commit 84df9525b0c27f3ebc2ebb1864fa62a97fdedb7d Author: Greg Kroah-Hartman Date: Mon Oct 22 07:37:37 2018 +0100 Linux 4.19 commit 8e630c31a3dfc7f4ab1007f95dd507cb2fe1dda5 Author: Greg Kroah-Hartman Date: Fri Oct 19 11:30:16 2018 +0200 MAINTAINERS: Add an entry for the code of conduct As I introduced these files, I'm willing to be the maintainer of them as well. Acked-by: Chris Mason Acked-by: Olof Johansson Acked-by: Steven Rostedt (VMware) Acked-by: Theodore Ts'o Acked-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit f3f76d640141e9a5aababafb80abbdc1c3c46823 Author: Greg Kroah-Hartman Date: Fri Oct 19 11:08:12 2018 +0200 Code of Conduct: Change the contact email address The contact point for the kernel's Code of Conduct should now be the Code of Conduct Committee, not the full TAB. Change the email address in the file to properly reflect this. Acked-by: Chris Mason Acked-by: Olof Johansson Acked-by: Theodore Ts'o Acked-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit d117a85478efaac1338c24c7504a6e759aaecdfc Author: Greg Kroah-Hartman Date: Fri Oct 19 11:04:07 2018 +0200 Code of Conduct Interpretation: Put in the proper URL for the committee There was a blank reference for how to find the Code of Conduct Committee. Fix that up by pointing it to the correct kernel.org website page location. Acked-by: Chris Mason Acked-by: Olof Johansson Acked-by: Theodore Ts'o Acked-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit f7e585843217caff0aa9fb7dc9d796f0fa92162b Author: Greg Kroah-Hartman Date: Fri Oct 19 10:45:08 2018 +0200 Code of Conduct: Provide links between the two documents Create a link between the Code of Conduct and the Code of Conduct Interpretation so that people can see that they are related. Acked-by: Chris Mason Acked-by: Olof Johansson Acked-by: Theodore Ts'o Acked-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit d84feee76f7f8171550ea2859c16f393599d0f58 Author: Greg Kroah-Hartman Date: Fri Oct 19 10:28:14 2018 +0200 Code of Conduct Interpretation: Properly reference the TAB correctly We use the term "TAB" before defining it later in the document. Fix that up by defining it at the first location. Reported-by: Kuninori Morimoto Acked-by: Chris Mason Acked-by: Olof Johansson Acked-by: Theodore Ts'o Acked-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 79dbeed36f7335ec6432029dbf019ebce28e963e Author: Greg Kroah-Hartman Date: Sun Oct 14 16:16:47 2018 +0200 Code of Conduct Interpretation: Add document explaining how the Code of Conduct is to be interpreted The Contributor Covenant Code of Conduct is a general document meant to provide a set of rules for almost any open source community. Every open-source community is unique and the Linux kernel is no exception. Because of this, this document describes how we in the Linux kernel community will interpret it. We also do not expect this interpretation to be static over time, and will adjust it as needed. This document was created with the input and feedback of the TAB as well as many current kernel maintainers. Co-Developed-by: Thomas Gleixner Co-Developed-by: Olof Johansson Acked-by: Alex Deucher Acked-by: Alexei Starovoitov Acked-by: Amir Goldstein Acked-by: Andrew Morton Acked-by: Andy Lutomirski Acked-by: Anna-Maria Gleixner Acked-by: Ard Biesheuvel Acked-by: Benjamin Herrenschmidt Acked-by: Boris Brezillon Acked-by: Borislav Petkov Acked-by: Chris Mason Acked-by: Christian Lütke-Stetzkamp Acked-by: Colin Ian King Acked-by: Dan Carpenter Acked-by: Dan Williams Acked-by: Daniel Borkmann Acked-by: Daniel Vetter Acked-by: Dave Airlie Acked-by: Dave Hansen Acked-by: David Ahern Acked-by: David Sterba Acked-by: Dmitry Torokhov Acked-by: Dominik Brodowski Acked-by: Eric Dumazet Acked-by: Felipe Balbi Acked-by: Felix Kuehling Acked-by: Florian Fainelli Acked-by: Geert Uytterhoeven Acked-by: Grant Likely Acked-by: Gregory CLEMENT Acked-by: Guenter Roeck Acked-by: Gustavo A. R. Silva Acked-by: Hans Verkuil Acked-by: Hans de Goede Acked-by: Harry Wentland Acked-by: Heiko Stuebner Acked-by: Ingo Molnar Acked-by: Jaegeuk Kim Acked-by: James Smart Acked-by: James Smart Acked-by: Jan Kara Acked-by: Jani Nikula Acked-by: Jason A. Donenfeld Acked-by: Jeff Kirsher Acked-by: Jens Axboe Acked-by: Jessica Yu Acked-by: Jia-Ju Bai Acked-by: Jiri Kosina Acked-by: Jiri Olsa Acked-by: Joerg Roedel Acked-by: Johan Hovold Acked-by: Johannes Thumshirn Acked-by: Jonathan Corbet Acked-by: Julia Lawall Acked-by: Kees Cook Acked-by: Kirill Tkhai Acked-by: Kuninori Morimoto Acked-by: Laurent Pinchart Acked-by: Lina Iyer Acked-by: Linus Torvalds Acked-by: Linus Walleij Acked-by: Mark Brown Acked-by: Masahiro Yamada Acked-by: Masami Hiramatsu Acked-by: Mathieu Desnoyers Acked-by: Matias Bjørling Acked-by: Mauro Carvalho Chehab Acked-by: Maxime Ripard Acked-by: Michael Ellerman Acked-by: Mike Rapoport Acked-by: Mimi Zohar Acked-by: Miquel Raynal Acked-by: Mishi Choudhary Acked-by: Nikolay Borisov Acked-by: Oded Gabbay Acked-by: Palmer Dabbelt Acked-by: Paul E. McKenney Acked-by: Peter Zijlstra Acked-by: Rafael J. Wysocki Acked-by: Richard Weinberger Acked-by: Rik van Riel Acked-by: Rob Clark Acked-by: Rob Herring Acked-by: Rodrigo Vivi Acked-by: Sean Paul Acked-by: Sebastian Andrzej Siewior Acked-by: Sebastian Reichel Acked-by: Sergio Paracuellos Acked-by: Shawn Guo Acked-by: Shuah Khan Acked-by: Simon Horman Acked-by: Srinivas Kandagatla Acked-by: Stephen Hemminger Acked-by: Takashi Iwai Acked-by: Tejun Heo Acked-by: Theodore Ts'o Acked-by: Thierry Reding Acked-by: Todd Poynor Acked-by: Viresh Kumar Acked-by: Wei Yongjun Acked-by: YueHaibing Reviewed-by: Steven Rostedt Signed-off-by: Thomas Gleixner Signed-off-by: Olof Johansson Signed-off-by: Greg Kroah-Hartman commit c1d1ba844f01e747aa0272a4ee5c886024cd90eb Author: Chris Mason Date: Thu Oct 11 09:09:31 2018 -0700 Code of conduct: Fix wording around maintainers enforcing the code of conduct As it was originally worded, this paragraph requires maintainers to enforce the code of conduct, or face potential repercussions. It sends the wrong message, when really we just want maintainers to be part of the solution and not violate the code of conduct themselves. Removing it doesn't limit our ability to enforce the code of conduct, and we can still encourage maintainers to help maintain high standards for the level of discourse in their subsystem. Signed-off-by: Chris Mason Acked-by: Alex Deucher Acked-by: Amir Goldstein Acked-by: Andrew Morton Acked-by: Anna-Maria Gleixner Acked-by: Ard Biesheuvel Acked-by: Benjamin Herrenschmidt Acked-by: Boris Brezillon Acked-by: Borislav Petkov Acked-by: Christian Lütke-Stetzkamp Acked-by: Christoph Hellwig Acked-by: Colin Ian King Acked-by: Dan Carpenter Acked-by: Dan Williams Acked-by: Daniel Borkmann Acked-by: Dave Airlie Acked-by: Dave Hansen Acked-by: David Ahern Acked-by: David Sterba Acked-by: Dmitry Torokhov Acked-by: Dominik Brodowski Acked-by: Eric Dumazet Acked-by: Felipe Balbi Acked-by: Felix Kuehling Acked-by: Florian Fainelli Acked-by: Florian Westphal Acked-by: Geert Uytterhoeven Acked-by: Grant Likely Acked-by: Gregory CLEMENT Acked-by: Guenter Roeck Acked-by: Gustavo A. R. Silva Acked-by: Hans Verkuil Acked-by: Hans de Goede Acked-by: Harry Wentland Acked-by: Heiko Stuebner Acked-by: Ingo Molnar Acked-by: Jaegeuk Kim Acked-by: James Smart Acked-by: James Smart Acked-by: Jan Kara Acked-by: Jason A. Donenfeld Acked-by: Jeff Kirsher Acked-by: Jens Axboe Acked-by: Jessica Yu Acked-by: Jia-Ju Bai Acked-by: Jiri Kosina Acked-by: Jiri Olsa Acked-by: Joerg Roedel Acked-by: Johan Hovold Acked-by: Johannes Thumshirn Acked-by: Jonathan Corbet Acked-by: Julia Lawall Acked-by: Kees Cook Acked-by: Kirill Tkhai Acked-by: Kuninori Morimoto Acked-by: Laurent Pinchart Acked-by: Lina Iyer Acked-by: Linus Torvalds Acked-by: Linus Walleij Acked-by: Mark Brown Acked-by: Masahiro Yamada Acked-by: Masami Hiramatsu Acked-by: Mathieu Desnoyers Acked-by: Matias Bjørling Acked-by: Maxime Ripard Acked-by: Michael Ellerman Acked-by: Mike Rapoport Acked-by: Mimi Zohar Acked-by: Miquel Raynal Acked-by: Nikolay Borisov Acked-by: Oded Gabbay Acked-by: Olof Johansson Acked-by: Palmer Dabbelt Acked-by: Paul E. McKenney Acked-by: Peter Zijlstra Acked-by: Rafael J. Wysocki Acked-by: Richard Weinberger Acked-by: Rik van Riel Acked-by: Rob Clark Acked-by: Rob Herring Acked-by: Rodrigo Vivi Acked-by: Sebastian Andrzej Siewior Acked-by: Sebastian Reichel Acked-by: Sergio Paracuellos Acked-by: Shawn Guo Acked-by: Shuah Khan Acked-by: Simon Horman Acked-by: Srinivas Kandagatla Acked-by: Stephen Hemminger Acked-by: Takashi Iwai Acked-by: Tejun Heo Acked-by: Theodore Ts'o Acked-by: Thierry Reding Acked-by: Thomas Gleixner Acked-by: Tim Bird Acked-by: Todd Poynor Acked-by: Trond Myklebust Acked-by: Viresh Kumar Acked-by: Wei Yongjun Acked-by: YueHaibing Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 467e050e9760fc31dcf854ec88401e18419f5f78 Merge: 23469de647c4 31d86033a074 Author: Greg Kroah-Hartman Date: Sun Oct 21 13:51:36 2018 +0200 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Wolfram writes: "i2c for 4.19 Another driver bugfix and MAINTAINERS addition from I2C." * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: rcar: cleanup DMA for all kinds of failure MAINTAINERS: Add entry for Broadcom STB I2C controller commit 23469de647c4c7b68b5d135927b1c509f0e757e6 Merge: b0d04fb56b31 d2fb4fb8ee91 Author: Greg Kroah-Hartman Date: Sun Oct 21 10:08:38 2018 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net David writes: "Networking: A few straggler bug fixes: 1) Fix indexing of multi-pass dumps of ipv6 addresses, from David Ahern. 2) Revert RCU locking change for bonding netpoll, causes worse problems than it solves. 3) pskb_trim_rcsum_slow() doesn't handle odd trim offsets, resulting in erroneous bad hw checksum triggers with CHECKSUM_COMPLETE devices. From Dimitris Michailidis. 4) a revert to some neighbour code changes that adjust notifications in a way that confuses some apps." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: Revert "neighbour: force neigh_invalidate when NUD_FAILED update is from admin" net/ipv6: Fix index counter for unicast addresses in in6_dump_addrs net: fix pskb_trim_rcsum_slow() with odd trim offset Revert "bond: take rcu lock in netpoll_send_skb_on_dev" commit d2fb4fb8ee91c1b8a1dbba6afda6f5ed2eb28bdc Author: Roopa Prabhu Date: Sat Oct 20 18:09:31 2018 -0700 Revert "neighbour: force neigh_invalidate when NUD_FAILED update is from admin" This reverts commit 8e326289e3069dfc9fa9c209924668dd031ab8ef. This patch results in unnecessary netlink notification when one tries to delete a neigh entry already in NUD_FAILED state. Found this with a buggy app that tries to delete a NUD_FAILED entry repeatedly. While the notification issue can be fixed with more checks, adding more complexity here seems unnecessary. Also, recent tests with other changes in the neighbour code have shown that the INCOMPLETE and PROBE checks are good enough for the original issue. Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 4ba4c566ba8448a05e6257e0b98a21f1a0d55315 Author: David Ahern Date: Fri Oct 19 10:00:19 2018 -0700 net/ipv6: Fix index counter for unicast addresses in in6_dump_addrs The loop wants to skip previously dumped addresses, so loops until current index >= saved index. If the message fills it wants to save the index for the next address to dump - ie., the one that did not fit in the current message. Currently, it is incrementing the index counter before comparing to the saved index, and then the saved index is off by 1 - it assumes the current address is going to fit in the message. Change the index handling to increment only after a succesful dump. Fixes: 502a2ffd7376a ("ipv6: convert idev_list to list macros") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 31d86033a0749a0463ea654130b2de5c163154f1 Author: Wolfram Sang Date: Fri Oct 19 21:15:26 2018 +0200 i2c: rcar: cleanup DMA for all kinds of failure DMA needs to be cleaned up not only on timeout, but on all errors where it has been setup before. Fixes: 73e8b0528346 ("i2c: rcar: add DMA support") Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 72a7a4aa77a05876e83f587f4cbe1e00ddc5ede1 Author: Kamal Dasu Date: Wed Oct 17 12:05:09 2018 -0400 MAINTAINERS: Add entry for Broadcom STB I2C controller Add an entry for the Broadcom STB I2C controller in the MAINTAINERS file. Signed-off-by: Kamal Dasu Acked-by: Florian Fainelli [wsa: fixed sorting and a whitespace error] Signed-off-by: Wolfram Sang commit b0d04fb56b3173626a15406d69f3026ca313057f Merge: 14dbc56aa27d 485734f3fc77 Author: Greg Kroah-Hartman Date: Sat Oct 20 15:04:23 2018 +0200 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "x86 fixes: It's 4 misc fixes, 3 build warning fixes and 3 comment fixes. In hindsight I'd have left out the 3 comment fixes to make the pull request look less scary at such a late point in the cycle. :-/" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/swiotlb: Enable swiotlb for > 4GiG RAM on 32-bit kernels x86/fpu: Fix i486 + no387 boot crash by only saving FPU registers on context switch if there is an FPU x86/fpu: Remove second definition of fpu in __fpu__restore_sig() x86/entry/64: Further improve paranoid_entry comments x86/entry/32: Clear the CS high bits x86/boot: Add -Wno-pointer-sign to KBUILD_CFLAGS x86/time: Correct the attribute on jiffies' definition x86/entry: Add some paranoid entry/exit CR3 handling comments x86/percpu: Fix this_cpu_read() x86/tsc: Force inlining of cyc2ns bits commit 14dbc56aa27d8b3f7cf99fa06e77fdc592b577c1 Merge: 9b00eb8ac273 9845c49cc9bb Author: Greg Kroah-Hartman Date: Sat Oct 20 15:03:45 2018 +0200 Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "scheduler fixes: Two fixes: a CFS-throttling bug fix, and an interactivity fix." * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Fix the min_vruntime update logic in dequeue_entity() sched/fair: Fix throttle_list starvation with low CFS quota commit 9b00eb8ac2738b27a1469046f2ca76449dcdf04a Merge: 270b77a0f30e 20e8e72d0fa8 Author: Greg Kroah-Hartman Date: Sat Oct 20 15:02:51 2018 +0200 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "perf fixes: Misc perf tooling fixes." * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf tools: Stop fallbacking to kallsyms for vdso symbols lookup perf tools: Pass build flags to traceevent build perf report: Don't crash on invalid inline debug information perf cpu_map: Align cpu map synthesized events properly. perf tools: Fix tracing_path_mount proper path perf tools: Fix use of alternatives to find JDIR perf evsel: Store ids for events with their own cpus perf_event__synthesize_event_update_cpus perf vendor events intel: Fix wrong filter_band* values for uncore events Revert "perf tools: Fix PMU term format max value calculation" tools headers uapi: Sync kvm.h copy tools arch uapi: Sync the x86 kvm.h copy commit d55bef5059dd057bd077155375c581b49d25be7e Author: Dimitris Michailidis Date: Fri Oct 19 17:07:13 2018 -0700 net: fix pskb_trim_rcsum_slow() with odd trim offset We've been getting checksum errors involving small UDP packets, usually 59B packets with 1 extra non-zero padding byte. netdev_rx_csum_fault() has been complaining that HW is providing bad checksums. Turns out the problem is in pskb_trim_rcsum_slow(), introduced in commit 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"). The source of the problem is that when the bytes we are trimming start at an odd address, as in the case of the 1 padding byte above, skb_checksum() returns a byte-swapped value. We cannot just combine this with skb->csum using csum_sub(). We need to use csum_block_sub() here that takes into account the parity of the start address and handles the swapping. Matches existing code in __skb_postpull_rcsum() and esp_remove_trailer(). Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends") Signed-off-by: Dimitris Michailidis Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 270b77a0f30e7bc61a9081b86d74dbb62fa6a69d Merge: 6b5201c21d40 fe7acd1e303d Author: Greg Kroah-Hartman Date: Sat Oct 20 09:23:12 2018 +0200 Merge tag 'drm-fixes-2018-10-20-1' of git://anongit.freedesktop.org/drm/drm Dave writes: "drm fixes for 4.19 final (part 2) Looked like two stragglers snuck in, one very urgent the pageflipping was missing a reference that could result in a GPF on non-i915 drivers, the other is an overflow in the sun4i dotclock calcs resulting in a mode not getting set." * tag 'drm-fixes-2018-10-20-1' of git://anongit.freedesktop.org/drm/drm: drm/sun4i: Fix an ulong overflow in the dotclock driver drm: Get ref on CRTC commit object when waiting for flip_done commit 6b5201c21d4022e71058cbd87b9dfe3116143af1 Merge: d4ec49d332ab ba0e41ca81b9 Author: Greg Kroah-Hartman Date: Sat Oct 20 09:20:48 2018 +0200 Merge tag 'trace-v4.19-rc8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Steven writes: "tracing: A few small fixes to synthetic events Masami found some issues with the creation of synthetic events. The first two patches fix handling of unsigned type, and handling of a space before an ending semi-colon. The third patch adds a selftest to test the processing of synthetic events." * tag 'trace-v4.19-rc8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: selftests: ftrace: Add synthetic event syntax testcase tracing: Fix synthetic event to allow semicolon at end tracing: Fix synthetic event to accept unsigned modifier commit d4ec49d332aba29827504cc666205aef91a281c7 Merge: c7b70a641df2 13c1c5e4d7f8 Author: Greg Kroah-Hartman Date: Sat Oct 20 08:42:56 2018 +0200 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Dmitry writes: "Input updates for 4.19-rc8 Just an addition to elan touchpad driver ACPI table." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15IGM commit fe7acd1e303d74584040a902d78726ba5a4b9b4a Merge: f8e6e1b6f0ae e84cb605e02f Author: Dave Airlie Date: Sat Oct 20 07:18:12 2018 +1000 Merge tag 'drm-misc-fixes-2018-10-19' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Second pull request for v4.19: - Fix ulong overflow in sun4i - Fix a serious GPF in waiting for flip_done from commit_tail(). Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/97d1ed42-1d99-fcc5-291e-cd1dc29a4252@linux.intel.com commit ba0e41ca81b935b958006c7120466e2217357827 Author: Masami Hiramatsu Date: Thu Oct 18 22:13:02 2018 +0900 selftests: ftrace: Add synthetic event syntax testcase Add a testcase to check the syntax and field types for synthetic_events interface. Link: http://lkml.kernel.org/r/153986838264.18251.16627517536956299922.stgit@devbox Acked-by: Shuah Khan Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit a360d9e4016c1fcf41553b37ad496870dc5723d0 Author: Masami Hiramatsu Date: Thu Oct 18 22:12:34 2018 +0900 tracing: Fix synthetic event to allow semicolon at end Fix synthetic event to allow independent semicolon at end. The synthetic_events interface accepts a semicolon after the last word if there is no space. # echo "myevent u64 var;" >> synthetic_events But if there is a space, it returns an error. # echo "myevent u64 var ;" > synthetic_events sh: write error: Invalid argument This behavior is difficult for users to understand. Let's allow the last independent semicolon too. Link: http://lkml.kernel.org/r/153986835420.18251.2191216690677025744.stgit@devbox Cc: Shuah Khan Cc: Tom Zanussi Cc: stable@vger.kernel.org Fixes: commit 4b147936fa50 ("tracing: Add support for 'synthetic' events") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 282447ba6b00c64678ffdf964f44e5c8b1c68377 Author: Masami Hiramatsu Date: Thu Oct 18 22:12:05 2018 +0900 tracing: Fix synthetic event to accept unsigned modifier Fix synthetic event to accept unsigned modifier for its field type correctly. Currently, synthetic_events interface returns error for "unsigned" modifiers as below; # echo "myevent unsigned long var" >> synthetic_events sh: write error: Invalid argument This is because argv_split() breaks "unsigned long" into "unsigned" and "long", but parse_synth_field() doesn't expected it. With this fix, synthetic_events can handle the "unsigned long" correctly like as below; # echo "myevent unsigned long var" >> synthetic_events # cat synthetic_events myevent unsigned long var Link: http://lkml.kernel.org/r/153986832571.18251.8448135724590496531.stgit@devbox Cc: Shuah Khan Cc: Tom Zanussi Cc: stable@vger.kernel.org Fixes: commit 4b147936fa50 ("tracing: Add support for 'synthetic' events") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 48995423143a097527802e28d7add20e5a27677a Author: David S. Miller Date: Fri Oct 19 10:45:08 2018 -0700 Revert "bond: take rcu lock in netpoll_send_skb_on_dev" This reverts commit 6fe9487892b32cb1c8b8b0d552ed7222a527fe30. It is causing more serious regressions than the RCU warning it is fixing. Signed-off-by: David S. Miller commit c7b70a641df26002e8f26e2b8122fcb6a1d815a1 Merge: b2a205ff49b9 9ae24af36691 Author: Greg Kroah-Hartman Date: Fri Oct 19 19:25:44 2018 +0200 Merge tag 'usb-4.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb I wrote: "USB fixes for 4.19-final Here are a small number of last-minute USB driver fixes Included here are: - spectre fix for usb storage gadgets - xhci fixes - cdc-acm fixes - usbip fixes for reported problems All of these have been in linux-next with no reported issues." * tag 'usb-4.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: gadget: storage: Fix Spectre v1 vulnerability USB: fix the usbfs flag sanitization for control transfers usb: xhci: pci: Enable Intel USB role mux on Apollo Lake platforms usb: roles: intel_xhci: Fix Unbalanced pm_runtime_enable cdc-acm: correct counting of UART states in serial state notification cdc-acm: do not reset notification buffer index upon urb unlinking cdc-acm: fix race between reset and control messaging usb: usbip: Fix BUG: KASAN: slab-out-of-bounds in vhci_hub_control() selftests: usbip: add wait after attach and before checking port status commit b2a205ff49b9c55d4bdda1bdb10ad19ebd646221 Merge: 91b15613ce7f 744889b7cbb5 Author: Greg Kroah-Hartman Date: Fri Oct 19 18:51:07 2018 +0200 Merge tag 'for-linus-20181019' of git://git.kernel.dk/linux-block Jens writes: "Block fixes for 4.19-final Two small fixes that should go into this release." * tag 'for-linus-20181019' of git://git.kernel.dk/linux-block: block: don't deal with discard limit in blkdev_issue_discard() nvme: remove ns sibling before clearing path commit e84cb605e02f1b3d0aee8d7157419cd8aaa06038 Author: Boris Brezillon Date: Thu Oct 18 12:02:50 2018 +0200 drm/sun4i: Fix an ulong overflow in the dotclock driver The calculated ideal rate can easily overflow an unsigned long, thus making the best div selection buggy as soon as no ideal match is found before the overflow occurs. Fixes: 4731a72df273 ("drm/sun4i: request exact rates to our parents") Cc: Signed-off-by: Boris Brezillon Acked-by: Maxime Ripard Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20181018100250.12565-1-boris.brezillon@bootlin.com commit 91b15613ce7fb3e724ca0d433eef8e6bf15322af Merge: 2a9666105445 d4d576f5ab7e Author: Greg Kroah-Hartman Date: Fri Oct 19 09:16:20 2018 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net David writes: "Networking 1) Fix gro_cells leak in xfrm layer, from Li RongQing. 2) BPF selftests change RLIMIT_MEMLOCK blindly, don't do that. From Eric Dumazet. 3) AF_XDP calls synchronize_net() under RCU lock, fix from Björn Töpel. 4) Out of bounds packet access in _decode_session6(), from Alexei Starovoitov. 5) Several ethtool bugs, where we copy a struct into the kernel twice and our validations of the values in the first copy can be invalidated by the second copy due to asynchronous updates to the memory by the user. From Wenwen Wang. 6) Missing netlink attribute validation in cls_api, from Davide Caratti. 7) LLC SAP sockets neet to be SOCK_RCU FREE, from Cong Wang. 8) rxrpc operates on wrong kvec, from Yue Haibing. 9) A regression was introduced by the disassosciation of route neighbour references in rt6_probe(), causing probe for neighbourless routes to not be properly rate limited. Fix from Sabrina Dubroca. 10) Unsafe RCU locking in tipc, from Tung Nguyen. 11) Use after free in inet6_mc_check(), from Eric Dumazet. 12) PMTU from icmp packets should update the SCTP transport pathmtu, from Xin Long. 13) Missing peer put on error in rxrpc, from David Howells. 14) Fix pedit in nfp driver, from Pieter Jansen van Vuuren. 15) Fix overflowing shift statement in qla3xxx driver, from Nathan Chancellor. 16) Fix Spectre v1 in ptp code, from Gustavo A. R. Silva. 17) udp6_unicast_rcv_skb() interprets udpv6_queue_rcv_skb() return value in an inverted manner, fix from Paolo Abeni. 18) Fix missed unresolved entries in ipmr dumps, from Nikolay Aleksandrov. 19) Fix NAPI handling under high load, we can completely miss events when NAPI has to loop more than one time in a cycle. From Heiner Kallweit." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (49 commits) ip6_tunnel: Fix encapsulation layout tipc: fix info leak from kernel tipc_event net: socket: fix a missing-check bug net: sched: Fix for duplicate class dump r8169: fix NAPI handling under high load net: ipmr: fix unresolved entry dumps net: mscc: ocelot: Fix comment in ocelot_vlant_wait_for_completion() sctp: fix the data size calculation in sctp_data_size virtio_net: avoid using netif_tx_disable() for serializing tx routine udp6: fix encap return code for resubmitting mlxsw: core: Fix use-after-free when flashing firmware during init sctp: not free the new asoc when sctp_wait_for_connect returns err sctp: fix race on sctp_id2asoc r8169: re-enable MSI-X on RTL8168g net: bpfilter: use get_pid_task instead of pid_task ptp: fix Spectre v1 vulnerability net: qla3xxx: Remove overflowing shift statement geneve, vxlan: Don't set exceptions if skb->len < mtu geneve, vxlan: Don't check skb_dst() twice sctp: get pr_assoc and pr_stream all status with SCTP_PR_SCTP_ALL instead ... commit 2a96661054452c3016c377d72a38c6d4948ea6ae Merge: 7555c5d5a879 27faeebd0081 Author: Greg Kroah-Hartman Date: Fri Oct 19 09:15:12 2018 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc David writes: "Sparc fixes: The main bit here is fixing how fallback system calls are handled in the sparc vDSO. Unfortunately, I fat fingered the commit and some perf debugging hacks slipped into the vDSO fix, which I revert in the very next commit." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc: Revert unintended perf changes. sparc: vDSO: Silence an uninitialized variable warning sparc: Fix syscall fallback bugs in VDSO. commit 7555c5d5a87973fbdee201ff63d2edd748933177 Merge: eb6d938ffa48 f8e6e1b6f0ae Author: Greg Kroah-Hartman Date: Fri Oct 19 08:31:22 2018 +0200 Merge tag 'drm-fixes-2018-10-19' of git://anongit.freedesktop.org/drm/drm Dave writes: "drm fixes for 4.19 final Just a last set of misc core fixes for final. 4 fixes, one use after free, one fb integration fix, one EDID fix, and one laptop panel quirk," * tag 'drm-fixes-2018-10-19' of git://anongit.freedesktop.org/drm/drm: drm/edid: VSDB yCBCr420 Deep Color mode bit definitions drm: fix use of freed memory in drm_mode_setcrtc drm: fb-helper: Reject all pixel format changing requests drm/edid: Add 6 bpc quirk for BOE panel in HP Pavilion 15-n233sl commit eb6d938ffa486dd89331cbfa2137038df6c912d2 Merge: fa520c47eaa1 a3671a4f973e Author: Greg Kroah-Hartman Date: Fri Oct 19 08:30:35 2018 +0200 Merge tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Doug writes: "Really final for-rc pull request for 4.19 Ok, so last week I thought we had sent our final pull request for 4.19. Well, wouldn't ya know someone went and found a couple Spectre v1 fixes were needed :-/. So, a couple *very* small specter patches for this (hopefully) final -rc week." * tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/ucma: Fix Spectre v1 vulnerability IB/ucm: Fix Spectre v1 vulnerability commit 485734f3fc77c1eb77ffe138c027b9a4bf0178f3 Author: Christoph Hellwig Date: Sun Oct 14 09:52:08 2018 +0200 x86/swiotlb: Enable swiotlb for > 4GiG RAM on 32-bit kernels We already build the swiotlb code for 32-bit kernels with PAE support, but the code to actually use swiotlb has only been enabled for 64-bit kernels for an unknown reason. Before Linux v4.18 we paper over this fact because the networking code, the SCSI layer and some random block drivers implemented their own bounce buffering scheme. [ mingo: Changelog fixes. ] Fixes: 21e07dba9fb1 ("scsi: reduce use of block bounce buffers") Fixes: ab74cfebafa3 ("net: remove the PCI_DMA_BUS_IS_PHYS check in illegal_highdma") Reported-by: Matthew Whitehead Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Tested-by: Matthew Whitehead Cc: konrad.wilk@oracle.com Cc: iommu@lists.linux-foundation.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181014075208.2715-1-hch@lst.de Signed-off-by: Ingo Molnar commit f8e6e1b6f0ae3bb91cdcd08213d36a0ce6e98535 Merge: 35a7f35ad1b1 9068e02f5874 Author: Dave Airlie Date: Fri Oct 19 13:51:55 2018 +1000 Merge tag 'drm-misc-fixes-2018-10-18' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v4.19: - Fix use of freed memory in drm_mode_setcrtc. - Reject pixel format changing requests in fb helper. - Add 6 bpc quirk for HP Pavilion 15-n233sl - Fix VSDB yCBCr420 Deep Color mode bit definitions Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/647fe5d0-4ec5-57cc-9f23-a4836b29e278@linux.intel.com commit d4d576f5ab7edcb757bb33e6a5600666a0b1232d Author: Stefano Brivio Date: Thu Oct 18 21:25:07 2018 +0200 ip6_tunnel: Fix encapsulation layout Commit 058214a4d1df ("ip6_tun: Add infrastructure for doing encapsulation") added the ip6_tnl_encap() call in ip6_tnl_xmit(), before the call to ipv6_push_frag_opts() to append the IPv6 Tunnel Encapsulation Limit option (option 4, RFC 2473, par. 5.1) to the outer IPv6 header. As long as the option didn't actually end up in generated packets, this wasn't an issue. Then commit 89a23c8b528b ("ip6_tunnel: Fix missing tunnel encapsulation limit option") fixed sending of this option, and the resulting layout, e.g. for FoU, is: .-------------------.------------.----------.-------------------.----- - - | Outer IPv6 Header | UDP header | Option 4 | Inner IPv6 Header | Payload '-------------------'------------'----------'-------------------'----- - - Needless to say, FoU and GUE (at least) won't work over IPv6. The option is appended by default, and I couldn't find a way to disable it with the current iproute2. Turn this into a more reasonable: .-------------------.----------.------------.-------------------.----- - - | Outer IPv6 Header | Option 4 | UDP header | Inner IPv6 Header | Payload '-------------------'----------'------------'-------------------'----- - - With this, and with 84dad55951b0 ("udp6: fix encap return code for resubmitting"), FoU and GUE work again over IPv6. Fixes: 058214a4d1df ("ip6_tun: Add infrastructure for doing encapsulation") Signed-off-by: Stefano Brivio Signed-off-by: David S. Miller commit b06f9d9f1a907dd03f203e2ce9e27e318c22ba01 Author: Jon Maloy Date: Thu Oct 18 17:38:29 2018 +0200 tipc: fix info leak from kernel tipc_event We initialize a struct tipc_event allocated on the kernel stack to zero to avert info leak to user space. Reported-by: syzbot+057458894bc8cada4dee@syzkaller.appspotmail.com Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit b6168562c8ce2bd5a30e213021650422e08764dc Author: Wenwen Wang Date: Thu Oct 18 09:36:46 2018 -0500 net: socket: fix a missing-check bug In ethtool_ioctl(), the ioctl command 'ethcmd' is checked through a switch statement to see whether it is necessary to pre-process the ethtool structure, because, as mentioned in the comment, the structure ethtool_rxnfc is defined with padding. If yes, a user-space buffer 'rxnfc' is allocated through compat_alloc_user_space(). One thing to note here is that, if 'ethcmd' is ETHTOOL_GRXCLSRLALL, the size of the buffer 'rxnfc' is partially determined by 'rule_cnt', which is actually acquired from the user-space buffer 'compat_rxnfc', i.e., 'compat_rxnfc->rule_cnt', through get_user(). After 'rxnfc' is allocated, the data in the original user-space buffer 'compat_rxnfc' is then copied to 'rxnfc' through copy_in_user(), including the 'rule_cnt' field. However, after this copy, no check is re-enforced on 'rxnfc->rule_cnt'. So it is possible that a malicious user race to change the value in the 'compat_rxnfc->rule_cnt' between these two copies. Through this way, the attacker can bypass the previous check on 'rule_cnt' and inject malicious data. This can cause undefined behavior of the kernel and introduce potential security risk. This patch avoids the above issue via copying the value acquired by get_user() to 'rxnfc->rule_cn', if 'ethcmd' is ETHTOOL_GRXCLSRLALL. Signed-off-by: Wenwen Wang Signed-off-by: David S. Miller commit 3c53ed8fef6881a864f0ee8240ed2793ef73ad0d Author: Phil Sutter Date: Thu Oct 18 10:34:26 2018 +0200 net: sched: Fix for duplicate class dump When dumping classes by parent, kernel would return classes twice: | # tc qdisc add dev lo root prio | # tc class show dev lo | class prio 8001:1 parent 8001: | class prio 8001:2 parent 8001: | class prio 8001:3 parent 8001: | # tc class show dev lo parent 8001: | class prio 8001:1 parent 8001: | class prio 8001:2 parent 8001: | class prio 8001:3 parent 8001: | class prio 8001:1 parent 8001: | class prio 8001:2 parent 8001: | class prio 8001:3 parent 8001: This comes from qdisc_match_from_root() potentially returning the root qdisc itself if its handle matched. Though in that case, root's classes were already dumped a few lines above. Fixes: cb395b2010879 ("net: sched: optimize class dumps") Signed-off-by: Phil Sutter Reviewed-by: Jiri Pirko Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 6b839b6cf9eada30b086effb51e5d6076bafc761 Author: Heiner Kallweit Date: Thu Oct 18 19:56:01 2018 +0200 r8169: fix NAPI handling under high load rtl_rx() and rtl_tx() are called only if the respective bits are set in the interrupt status register. Under high load NAPI may not be able to process all data (work_done == budget) and it will schedule subsequent calls to the poll callback. rtl_ack_events() however resets the bits in the interrupt status register, therefore subsequent calls to rtl8169_poll() won't call rtl_rx() and rtl_tx() - chip interrupts are still disabled. Fix this by calling rtl_rx() and rtl_tx() independent of the bits set in the interrupt status register. Both functions will detect if there's nothing to do for them. Fixes: da78dbff2e05 ("r8169: remove work from irq handler.") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 27faeebd00813cd52a140e8944b6b32729b50e61 Author: David S. Miller Date: Thu Oct 18 11:32:29 2018 -0700 sparc: Revert unintended perf changes. Some local debugging hacks accidently slipped into the VDSO commit. Sorry! Signed-off-by: David S. Miller commit 4364bcb2cd21d042bde4776448417ddffbc54045 Author: Leo Li Date: Mon Oct 15 09:46:40 2018 -0400 drm: Get ref on CRTC commit object when waiting for flip_done This fixes a general protection fault, caused by accessing the contents of a flip_done completion object that has already been freed. It occurs due to the preemption of a non-blocking commit worker thread W by another commit thread X. X continues to clear its atomic state at the end, destroying the CRTC commit object that W still needs. Switching back to W and accessing the commit objects then leads to bad results. Worker W becomes preemptable when waiting for flip_done to complete. At this point, a frequently occurring commit thread X can take over. Here's an example where W is a worker thread that flips on both CRTCs, and X does a legacy cursor update on both CRTCs: ... 1. W does flip work 2. W runs commit_hw_done() 3. W waits for flip_done on CRTC 1 4. > flip_done for CRTC 1 completes 5. W finishes waiting for CRTC 1 6. W waits for flip_done on CRTC 2 7. > Preempted by X 8. > flip_done for CRTC 2 completes 9. X atomic_check: hw_done and flip_done are complete on all CRTCs 10. X updates cursor on both CRTCs 11. X destroys atomic state 12. X done 13. > Switch back to W 14. W waits for flip_done on CRTC 2 15. W raises general protection fault The error looks like so: general protection fault: 0000 [#1] PREEMPT SMP PTI **snip** Call Trace: lock_acquire+0xa2/0x1b0 _raw_spin_lock_irq+0x39/0x70 wait_for_completion_timeout+0x31/0x130 drm_atomic_helper_wait_for_flip_done+0x64/0x90 [drm_kms_helper] amdgpu_dm_atomic_commit_tail+0xcae/0xdd0 [amdgpu] commit_tail+0x3d/0x70 [drm_kms_helper] process_one_work+0x212/0x650 worker_thread+0x49/0x420 kthread+0xfb/0x130 ret_from_fork+0x3a/0x50 Modules linked in: x86_pkg_temp_thermal amdgpu(O) chash(O) gpu_sched(O) drm_kms_helper(O) syscopyarea sysfillrect sysimgblt fb_sys_fops ttm(O) drm(O) Note that i915 has this issue masked, since hw_done is signaled after waiting for flip_done. Doing so will block the cursor update from happening until hw_done is signaled, preventing the cursor commit from destroying the state. v2: The reference on the commit object needs to be obtained before hw_done() is signaled, since that's the point where another commit is allowed to modify the state. Assuming that the new_crtc_state->commit object still exists within flip_done() is incorrect. Fix by getting a reference in setup_commit(), and releasing it during default_clear(). Signed-off-by: Leo Li Reviewed-by: Daniel Vetter Signed-off-by: Harry Wentland Link: https://patchwork.freedesktop.org/patch/msgid/1539611200-6184-1-git-send-email-sunpeng.li@amd.com commit 2ee653f644ab203364724cac85a7efd371367979 Merge: eddf016b9104 9dffff200fd1 Author: David S. Miller Date: Thu Oct 18 09:55:08 2018 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2018-10-18 1) Free the xfrm interface gro_cells when deleting the interface, otherwise we leak it. From Li RongQing. 2) net/core/flow.c does not exist anymore, so remove it from the MAINTAINERS file. 3) Fix a slab-out-of-bounds in _decode_session6. From Alexei Starovoitov. 4) Fix RCU protection when policies inserted into thei bydst lists. From Florian Westphal. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller commit 744889b7cbb56a64f957e65ade7cb65fe3f35714 Author: Ming Lei Date: Fri Oct 12 15:53:10 2018 +0800 block: don't deal with discard limit in blkdev_issue_discard() blk_queue_split() does respect this limit via bio splitting, so no need to do that in blkdev_issue_discard(), then we can align to normal bio submit(bio_add_page() & submit_bio()). More importantly, this patch fixes one issue introduced in a22c4d7e34402cc ("block: re-add discard_granularity and alignment checks"), in which zero discard bio may be generated in case of zero alignment. Fixes: a22c4d7e34402ccdf3 ("block: re-add discard_granularity and alignment checks") Cc: stable@vger.kernel.org Cc: Ming Lin Cc: Mike Snitzer Cc: Christoph Hellwig Cc: Xiao Ni Tested-by: Mariusz Dabrowski Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit fa520c47eaa15b9baa8ad66ac18da4a31679693b Author: Eric Sandeen Date: Wed Oct 17 15:23:59 2018 +0100 fscache: Fix out of bound read in long cookie keys fscache_set_key() can incur an out-of-bounds read, reported by KASAN: BUG: KASAN: slab-out-of-bounds in fscache_alloc_cookie+0x5b3/0x680 [fscache] Read of size 4 at addr ffff88084ff056d4 by task mount.nfs/32615 and also reported by syzbot at https://lkml.org/lkml/2018/7/8/236 BUG: KASAN: slab-out-of-bounds in fscache_set_key fs/fscache/cookie.c:120 [inline] BUG: KASAN: slab-out-of-bounds in fscache_alloc_cookie+0x7a9/0x880 fs/fscache/cookie.c:171 Read of size 4 at addr ffff8801d3cc8bb4 by task syz-executor907/4466 This happens for any index_key_len which is not divisible by 4 and is larger than the size of the inline key, because the code allocates exactly index_key_len for the key buffer, but the hashing loop is stepping through it 4 bytes (u32) at a time in the buf[] array. Fix this by calculating how many u32 buffers we'll need by using DIV_ROUND_UP, and then using kcalloc() to allocate a precleared allocation buffer to hold the index_key, then using that same count as the hashing index limit. Fixes: ec0328e46d6e ("fscache: Maintain a catalogue of allocated cookies") Reported-by: syzbot+a95b989b2dde8e806af8@syzkaller.appspotmail.com Signed-off-by: Eric Sandeen Cc: stable Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman commit 1ff22883b0b2f7a73eb2609ffe879c9fd96f6328 Author: David Howells Date: Wed Oct 17 15:23:45 2018 +0100 fscache: Fix incomplete initialisation of inline key space The inline key in struct rxrpc_cookie is insufficiently initialized, zeroing only 3 of the 4 slots, therefore an index_key_len between 13 and 15 bytes will end up hashing uninitialized memory because the memcpy only partially fills the last buf[] element. Fix this by clearing fscache_cookie objects on allocation rather than using the slab constructor to initialise them. We're going to pretty much fill in the entire struct anyway, so bringing it into our dcache writably shouldn't incur much overhead. This removes the need to do clearance in fscache_set_key() (where we aren't doing it correctly anyway). Also, we don't need to set cookie->key_len in fscache_set_key() as we already did it in the only caller, so remove that. Fixes: ec0328e46d6e ("fscache: Maintain a catalogue of allocated cookies") Reported-by: syzbot+a95b989b2dde8e806af8@syzkaller.appspotmail.com Reported-by: Eric Sandeen Cc: stable Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman commit 169b803397499be85bdd1e3d07d6f5e3d4bd669e Author: Al Viro Date: Wed Oct 17 15:23:26 2018 +0100 cachefiles: fix the race between cachefiles_bury_object() and rmdir(2) the victim might've been rmdir'ed just before the lock_rename(); unlike the normal callers, we do not look the source up after the parents are locked - we know it beforehand and just recheck that it's still the child of what used to be its parent. Unfortunately, the check is too weak - we don't spot a dead directory since its ->d_parent is unchanged, dentry is positive, etc. So we sail all the way to ->rename(), with hosting filesystems _not_ expecting to be asked renaming an rmdir'ed subdirectory. The fix is easy, fortunately - the lock on parent is sufficient for making IS_DEADDIR() on child safe. Cc: stable@vger.kernel.org Fixes: 9ae326a69004 (CacheFiles: A cache that backs onto a mounted filesystem) Signed-off-by: Al Viro Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman commit eb66ae030829605d61fbef1909ce310e29f78821 Author: Linus Torvalds Date: Fri Oct 12 15:22:59 2018 -0700 mremap: properly flush TLB before releasing the page Jann Horn points out that our TLB flushing was subtly wrong for the mremap() case. What makes mremap() special is that we don't follow the usual "add page to list of pages to be freed, then flush tlb, and then free pages". No, mremap() obviously just _moves_ the page from one page table location to another. That matters, because mremap() thus doesn't directly control the lifetime of the moved page with a freelist: instead, the lifetime of the page is controlled by the page table locking, that serializes access to the entry. As a result, we need to flush the TLB not just before releasing the lock for the source location (to avoid any concurrent accesses to the entry), but also before we release the destination page table lock (to avoid the TLB being flushed after somebody else has already done something to that page). This also makes the whole "need_flush" logic unnecessary, since we now always end up flushing the TLB for every valid entry. Reported-and-tested-by: Jann Horn Acked-by: Will Deacon Tested-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman commit 19e6420e4170acce7a8651dfb87195dff5adbe72 Author: Christoph Hellwig Date: Thu Oct 18 08:22:39 2018 +0200 LICENSES: Remove CC-BY-SA-4.0 license text Using non-GPL licenses for our documentation is rather problematic, as it can directly include other files, which generally are GPLv2 licensed and thus not compatible. Remove this license now that the only user (idr.rst) is gone to avoid people semi-accidentally using it again. Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman commit ca9f672f7c6b4f23b9b88600aaa285f35f07386e Merge: 9bd871df56a7 a309d5db5879 Author: Greg Kroah-Hartman Date: Thu Oct 18 11:24:32 2018 +0200 Merge branch 'ida-fixes-4.19-rc8' of git://git.infradead.org/users/willy/linux-dax Matthew writes: "IDA/IDR fixes for 4.19 I have two tiny fixes, one for the IDA test-suite and one for the IDR documentation license." * 'ida-fixes-4.19-rc8' of git://git.infradead.org/users/willy/linux-dax: idr: Change documentation license test_ida: Fix lockdep warning commit 20e8e72d0fa8e26202932c30d592bade73fdc701 Merge: b955a910d7fd edeb0c90df35 Author: Ingo Molnar Date: Thu Oct 18 07:41:29 2018 +0200 Merge tag 'perf-urgent-for-mingo-4.19-20181017' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/urgent fixes from Arnaldo Carvalho de Melo: - Stop falling back to kallsyms for vDSO symbols lookup, this wasn't being really used and is not valid in arches such as Sparc, where user and kernel space don't share the address space, relying only on cpumode to figure out what DSOs to lookup (Arnaldo Carvalho de Melo) - Align CPU map synthesized events properly, fixing SIGBUS in CPUs like Sparc (David Miller) - Fix use of alternatives to find JDIR (Jarod Wilson) - Store IDs for events with their own CPUs when synthesizing user level event details (scale, unit, etc) events, fixing a crash when recording a PMU event with a cpumask defined (Jiri Olsa) - Fix wrong filter_band* values for uncore Intel vendor events (Jiri Olsa) - Fix detection of tracefs path in systems without tracefs, where that path should be the debugfs mountpoint plus "/tracing/" (Jiri Olsa) - Pass build flags to traceevent build, allowing using alternative flags in distro packages, RPM, for instance (Jiri Olsa) - Fix 'perf report' crash on invalid inline debug information (Milian Wolff) - Synch KVM UAPI copies (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit eddf016b910486d2123675a6b5fd7d64f77cdca8 Author: Nikolay Aleksandrov Date: Wed Oct 17 22:34:34 2018 +0300 net: ipmr: fix unresolved entry dumps If the skb space ends in an unresolved entry while dumping we'll miss some unresolved entries. The reason is due to zeroing the entry counter between dumping resolved and unresolved mfc entries. We should just keep counting until the whole table is dumped and zero when we move to the next as we have a separate table counter. Reported-by: Colin Ian King Fixes: 8fb472c09b9d ("ipmr: improve hash scalability") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 06a36ecb5d0ee4b379845a5687f83084d3187521 Author: Gregory CLEMENT Date: Wed Oct 17 17:26:35 2018 +0200 net: mscc: ocelot: Fix comment in ocelot_vlant_wait_for_completion() The ocelot_vlant_wait_for_completion() function is very similar to the ocelot_mact_wait_for_completion(). It seemed to have be copied but the comment was not updated, so let's fix it. Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit 5660b9d9d6a29c2c3cc12f62ae44bfb56b0a15a9 Author: Xin Long Date: Wed Oct 17 21:11:27 2018 +0800 sctp: fix the data size calculation in sctp_data_size sctp data size should be calculated by subtracting data chunk header's length from chunk_hdr->length, not just data header. Fixes: 668c9beb9020 ("sctp: implement assign_number for sctp_stream_interleave") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 05c998b738fdd3e5d6a257bcacc8f34b6284d795 Author: Ake Koomsin Date: Wed Oct 17 19:44:12 2018 +0900 virtio_net: avoid using netif_tx_disable() for serializing tx routine Commit 713a98d90c5e ("virtio-net: serialize tx routine during reset") introduces netif_tx_disable() after netif_device_detach() in order to avoid use-after-free of tx queues. However, there are two issues. 1) Its operation is redundant with netif_device_detach() in case the interface is running. 2) In case of the interface is not running before suspending and resuming, the tx does not get resumed by netif_device_attach(). This results in losing network connectivity. It is better to use netif_tx_lock_bh()/netif_tx_unlock_bh() instead for serializing tx routine during reset. This also preserves the symmetry of netif_device_detach() and netif_device_attach(). Fixes commit 713a98d90c5e ("virtio-net: serialize tx routine during reset") Signed-off-by: Ake Koomsin Acked-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 9bd871df56a752029b07dde326d799648994b992 Merge: c343db455eb3 12ad0cb2123a Author: Greg Kroah-Hartman Date: Thu Oct 18 07:29:05 2018 +0200 Merge tag 'trace-v4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Steven writes: "tracing: Two fixes for 4.19 This fixes two bugs: - Fix size mismatch of tracepoint array - Have preemptirq test module use same clock source of the selftest" * tag 'trace-v4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Use trace_clock_local() for looping in preemptirq_delay_test.c tracepoint: Fix tracepoint array element size mismatch commit 84dad55951b0d009372ec21760b650634246e144 Author: Paolo Abeni Date: Wed Oct 17 11:44:04 2018 +0200 udp6: fix encap return code for resubmitting The commit eb63f2964dbe ("udp6: add missing checks on edumux packet processing") used the same return code convention of the ipv4 counterpart, but ipv6 uses the opposite one: positive values means resubmit. This change addresses the issue, using positive return value for resubmitting. Also update the related comment, which was broken, too. Fixes: eb63f2964dbe ("udp6: add missing checks on edumux packet processing") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 9b3bc7db759e64c33471025721817467f8c3ecd4 Author: Ido Schimmel Date: Wed Oct 17 08:05:45 2018 +0000 mlxsw: core: Fix use-after-free when flashing firmware during init When the switch driver (e.g., mlxsw_spectrum) determines it needs to flash a new firmware version it resets the ASIC after the flashing process. The bus driver (e.g., mlxsw_pci) then registers itself again with mlxsw_core which means (among other things) that the device registers itself again with the hwmon subsystem again. Since the device was registered with the hwmon subsystem using devm_hwmon_device_register_with_groups(), then the old hwmon device (registered before the flashing) was never unregistered and was referencing stale data, resulting in a use-after free. Fix by removing reliance on device managed APIs in mlxsw_hwmon_init(). Fixes: c86d62cc410c ("mlxsw: spectrum: Reset FW after flash") Signed-off-by: Ido Schimmel Reported-by: Alexander Petrovskiy Tested-by: Alexander Petrovskiy Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit c863850ce22e1b0bb365d49cadf51f4765153ae4 Author: Xin Long Date: Wed Oct 17 03:06:12 2018 +0800 sctp: not free the new asoc when sctp_wait_for_connect returns err When sctp_wait_for_connect is called to wait for connect ready for sp->strm_interleave in sctp_sendmsg_to_asoc, a panic could be triggered if cpu is scheduled out and the new asoc is freed elsewhere, as it will return err and later the asoc gets freed again in sctp_sendmsg. [ 285.840764] list_del corruption, ffff9f0f7b284078->next is LIST_POISON1 (dead000000000100) [ 285.843590] WARNING: CPU: 1 PID: 8861 at lib/list_debug.c:47 __list_del_entry_valid+0x50/0xa0 [ 285.846193] Kernel panic - not syncing: panic_on_warn set ... [ 285.846193] [ 285.848206] CPU: 1 PID: 8861 Comm: sctp_ndata Kdump: loaded Not tainted 4.19.0-rc7.label #584 [ 285.850559] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 [ 285.852164] Call Trace: ... [ 285.872210] ? __list_del_entry_valid+0x50/0xa0 [ 285.872894] sctp_association_free+0x42/0x2d0 [sctp] [ 285.873612] sctp_sendmsg+0x5a4/0x6b0 [sctp] [ 285.874236] sock_sendmsg+0x30/0x40 [ 285.874741] ___sys_sendmsg+0x27a/0x290 [ 285.875304] ? __switch_to_asm+0x34/0x70 [ 285.875872] ? __switch_to_asm+0x40/0x70 [ 285.876438] ? ptep_set_access_flags+0x2a/0x30 [ 285.877083] ? do_wp_page+0x151/0x540 [ 285.877614] __sys_sendmsg+0x58/0xa0 [ 285.878138] do_syscall_64+0x55/0x180 [ 285.878669] entry_SYSCALL_64_after_hwframe+0x44/0xa9 This is a similar issue with the one fixed in Commit ca3af4dd28cf ("sctp: do not free asoc when it is already dead in sctp_sendmsg"). But this one can't be fixed by returning -ESRCH for the dead asoc in sctp_wait_for_connect, as it will break sctp_connect's return value to users. This patch is to simply set err to -ESRCH before it returns to sctp_sendmsg when any err is returned by sctp_wait_for_connect for sp->strm_interleave, so that no asoc would be freed due to this. When users see this error, they will know the packet hasn't been sent. And it also makes sense to not free asoc because waiting connect fails, like the second call for sctp_wait_for_connect in sctp_sendmsg_to_asoc. Fixes: 668c9beb9020 ("sctp: implement assign_number for sctp_stream_interleave") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit b336decab22158937975293aea79396525f92bb3 Author: Marcelo Ricardo Leitner Date: Tue Oct 16 15:18:17 2018 -0300 sctp: fix race on sctp_id2asoc syzbot reported an use-after-free involving sctp_id2asoc. Dmitry Vyukov helped to root cause it and it is because of reading the asoc after it was freed: CPU 1 CPU 2 (working on socket 1) (working on socket 2) sctp_association_destroy sctp_id2asoc spin lock grab the asoc from idr spin unlock spin lock remove asoc from idr spin unlock free(asoc) if asoc->base.sk != sk ... [*] This can only be hit if trying to fetch asocs from different sockets. As we have a single IDR for all asocs, in all SCTP sockets, their id is unique on the system. An application can try to send stuff on an id that matches on another socket, and the if in [*] will protect from such usage. But it didn't consider that as that asoc may belong to another socket, it may be freed in parallel (read: under another socket lock). We fix it by moving the checks in [*] into the protected region. This fixes it because the asoc cannot be freed while the lock is held. Reported-by: syzbot+c7dd55d7aec49d48e49a@syzkaller.appspotmail.com Acked-by: Dmitry Vyukov Signed-off-by: Marcelo Ricardo Leitner Acked-by: Neil Horman Signed-off-by: David S. Miller commit 9675931e6b65d160d16bcc9472c1acef15524def Author: Heiner Kallweit Date: Tue Oct 16 19:35:17 2018 +0200 r8169: re-enable MSI-X on RTL8168g Similar to d49c88d7677b ("r8169: Enable MSI-X on RTL8106e") after e9d0ba506ea8 ("PCI: Reprogram bridge prefetch registers on resume") we can safely assume that this also fixes the root cause of the issue worked around by 7c53a722459c ("r8169: don't use MSI-X on RTL8168g"). So let's revert it. Fixes: 7c53a722459c ("r8169: don't use MSI-X on RTL8168g") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 84258438e8ce12d6888b68a1238bba9cb25307e2 Author: Taehee Yoo Date: Wed Oct 17 00:35:10 2018 +0900 net: bpfilter: use get_pid_task instead of pid_task pid_task() dereferences rcu protected tasks array. But there is no rcu_read_lock() in shutdown_umh() routine so that rcu_read_lock() is needed. get_pid_task() is wrapper function of pid_task. it holds rcu_read_lock() then calls pid_task(). if task isn't NULL, it increases reference count of task. test commands: %modprobe bpfilter %modprobe -rv bpfilter splat looks like: [15102.030932] ============================= [15102.030957] WARNING: suspicious RCU usage [15102.030985] 4.19.0-rc7+ #21 Not tainted [15102.031010] ----------------------------- [15102.031038] kernel/pid.c:330 suspicious rcu_dereference_check() usage! [15102.031063] other info that might help us debug this: [15102.031332] rcu_scheduler_active = 2, debug_locks = 1 [15102.031363] 1 lock held by modprobe/1570: [15102.031389] #0: 00000000580ef2b0 (bpfilter_lock){+.+.}, at: stop_umh+0x13/0x52 [bpfilter] [15102.031552] stack backtrace: [15102.031583] CPU: 1 PID: 1570 Comm: modprobe Not tainted 4.19.0-rc7+ #21 [15102.031607] Hardware name: To be filled by O.E.M. To be filled by O.E.M./Aptio CRB, BIOS 5.6.5 07/08/2015 [15102.031628] Call Trace: [15102.031676] dump_stack+0xc9/0x16b [15102.031723] ? show_regs_print_info+0x5/0x5 [15102.031801] ? lockdep_rcu_suspicious+0x117/0x160 [15102.031855] pid_task+0x134/0x160 [15102.031900] ? find_vpid+0xf0/0xf0 [15102.032017] shutdown_umh.constprop.1+0x1e/0x53 [bpfilter] [15102.032055] stop_umh+0x46/0x52 [bpfilter] [15102.032092] __x64_sys_delete_module+0x47e/0x570 [ ... ] Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module") Signed-off-by: Taehee Yoo Acked-by: Alexei Starovoitov Signed-off-by: David S. Miller commit efa61c8cf2950ab5c0e66cff3cabe2a2b24e81ba Author: Gustavo A. R. Silva Date: Tue Oct 16 15:06:41 2018 +0200 ptp: fix Spectre v1 vulnerability pin_index can be indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/ptp/ptp_chardev.c:253 ptp_ioctl() warn: potential spectre issue 'ops->pin_config' [r] (local cap) Fix this by sanitizing pin_index before using it to index ops->pin_config, and before passing it as an argument to function ptp_set_pinfunc(), in which it is used to index info->pin_config. Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 62d6f3b7b85e9ba79c96bfd36f501f180908e623 Author: Dan Carpenter Date: Sat Oct 13 13:26:53 2018 +0300 sparc: vDSO: Silence an uninitialized variable warning Smatch complains that "val" would be uninitialized if kstrtoul() fails. Fixes: 9a08862a5d2e ("vDSO for sparc") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 8c3bf9b62b667456a57aefcf1689e826df146159 Author: Nathan Chancellor Date: Fri Oct 12 19:14:58 2018 -0700 net: qla3xxx: Remove overflowing shift statement Clang currently warns: drivers/net/ethernet/qlogic/qla3xxx.c:384:24: warning: signed shift result (0xF00000000) requires 37 bits to represent, but 'int' only has 32 bits [-Wshift-overflow] ((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data)); ~~~~~~~~~~~~~~ ^ ~~ 1 warning generated. The warning is certainly accurate since ISP_NVRAM_MASK is defined as (0x000F << 16) which is then shifted by 16, resulting in 64424509440, well above UINT_MAX. Given that this is the only location in this driver where ISP_NVRAM_MASK is shifted again, it seems likely that ISP_NVRAM_MASK was originally defined without a shift and during the move of the shift to the definition, this statement wasn't properly removed (since ISP_NVRAM_MASK is used in the statenent right above this). Only the maintainers can confirm this since this statment has been here since the driver was first added to the kernel. Link: https://github.com/ClangBuiltLinux/linux/issues/127 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit dc6d0f0b4340ef6814d5345dbeaa5e909395dd1d Merge: 0ac1077e3a54 6b4f92af3d59 Author: David S. Miller Date: Wed Oct 17 21:51:14 2018 -0700 Merge branch 'geneve-vxlan-mtu' Stefano Brivio says: ==================== geneve, vxlan: Don't set exceptions if skb->len < mtu This series fixes the exception abuse described in 2/2, and 1/2 is just a preparatory change to make 2/2 less ugly. ==================== Signed-off-by: David S. Miller commit 6b4f92af3d59e882d3ba04c44a815266890d188f Author: Stefano Brivio Date: Fri Oct 12 23:53:59 2018 +0200 geneve, vxlan: Don't set exceptions if skb->len < mtu We shouldn't abuse exceptions: if the destination MTU is already higher than what we're transmitting, no exception should be created. Fixes: 52a589d51f10 ("geneve: update skb dst pmtu on tx path") Fixes: a93bf0ff4490 ("vxlan: update skb dst pmtu on tx path") Signed-off-by: Stefano Brivio Reviewed-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 7463e4f9b99c089cc962033b46349ff29f466e40 Author: Stefano Brivio Date: Fri Oct 12 23:53:58 2018 +0200 geneve, vxlan: Don't check skb_dst() twice Commit f15ca723c1eb ("net: don't call update_pmtu unconditionally") avoids that we try updating PMTU for a non-existent destination, but didn't clean up cases where the check was already explicit. Drop those redundant checks. Signed-off-by: Stefano Brivio Reviewed-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 776ca1543b5fe673aaf1beb244fcc2429d378083 Author: David S. Miller Date: Wed Oct 17 21:28:01 2018 -0700 sparc: Fix syscall fallback bugs in VDSO. First, the trap number for 32-bit syscalls is 0x10. Also, only negate the return value when syscall error is indicated by the carry bit being set. Signed-off-by: David S. Miller commit 12ad0cb2123aed30241a14792ef5bef9efcccbcd Author: Steven Rostedt (VMware) Date: Mon Oct 15 23:31:42 2018 -0400 tracing: Use trace_clock_local() for looping in preemptirq_delay_test.c The preemptirq_delay_test module is used for the ftrace selftest code that tests the latency tracers. The problem is that it uses ktime for the delay loop, and then checks the tracer to see if the delay loop is caught, but the tracer uses trace_clock_local() which uses various different other clocks to measure the latency. As ktime uses the clock cycles, and the code then converts that to nanoseconds, it causes rounding errors, and the preemptirq latency tests are failing due to being off by 1 (it expects to see a delay of 500000 us, but the delay is only 499999 us). This is happening due to a rounding error in the ktime (which is totally legit). The purpose of the test is to see if it can catch the delay, not to test the accuracy between trace_clock_local() and ktime_get(). Best to use apples to apples, and have the delay loop use the same clock as the latency tracer does. Cc: stable@vger.kernel.org Fixes: f96e8577da102 ("lib: Add module for testing preemptoff/irqsoff latency tracers") Acked-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 9c0be3f6b5d776dfe3ed249862c244a4486414dc Author: Mathieu Desnoyers Date: Sat Oct 13 15:10:50 2018 -0400 tracepoint: Fix tracepoint array element size mismatch commit 46e0c9be206f ("kernel: tracepoints: add support for relative references") changes the layout of the __tracepoint_ptrs section on architectures supporting relative references. However, it does so without turning struct tracepoint * const into const int elsewhere in the tracepoint code, which has the following side-effect: Setting mod->num_tracepoints is done in by module.c: mod->tracepoints_ptrs = section_objs(info, "__tracepoints_ptrs", sizeof(*mod->tracepoints_ptrs), &mod->num_tracepoints); Basically, since sizeof(*mod->tracepoints_ptrs) is a pointer size (rather than sizeof(int)), num_tracepoints is erroneously set to half the size it should be on 64-bit arch. So a module with an odd number of tracepoints misses the last tracepoint due to effect of integer division. So in the module going notifier: for_each_tracepoint_range(mod->tracepoints_ptrs, mod->tracepoints_ptrs + mod->num_tracepoints, tp_module_going_check_quiescent, NULL); the expression (mod->tracepoints_ptrs + mod->num_tracepoints) actually evaluates to something within the bounds of the array, but miss the last tracepoint if the number of tracepoints is odd on 64-bit arch. Fix this by introducing a new typedef: tracepoint_ptr_t, which is either "const int" on architectures that have PREL32 relocations, or "struct tracepoint * const" on architectures that does not have this feature. Also provide a new tracepoint_ptr_defer() static inline to encapsulate deferencing this type rather than duplicate code and ugly idefs within the for_each_tracepoint_range() implementation. This issue appears in 4.19-rc kernels, and should ideally be fixed before the end of the rc cycle. Acked-by: Ard Biesheuvel Acked-by: Jessica Yu Link: http://lkml.kernel.org/r/20181013191050.22389-1-mathieu.desnoyers@efficios.com Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheuvel@linaro.org Cc: Michael Ellerman Cc: Ingo Molnar Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Bjorn Helgaas Cc: Catalin Marinas Cc: James Morris Cc: James Morris Cc: Josh Poimboeuf Cc: Kees Cook Cc: Nicolas Pitre Cc: Paul Mackerras Cc: Petr Mladek Cc: Russell King Cc: "Serge E. Hallyn" Cc: Sergey Senozhatsky Cc: Thomas Garnier Cc: Thomas Gleixner Cc: Will Deacon Cc: Andrew Morton Cc: Linus Torvalds Cc: Greg Kroah-Hartman Signed-off-by: Mathieu Desnoyers Signed-off-by: Steven Rostedt (VMware) commit 9ae24af3669111d418242caec8dd4ebd9ba26860 Author: Gustavo A. R. Silva Date: Tue Oct 16 12:16:45 2018 +0200 usb: gadget: storage: Fix Spectre v1 vulnerability num can be indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/usb/gadget/function/f_mass_storage.c:3177 fsg_lun_make() warn: potential spectre issue 'fsg_opts->common->luns' [r] (local cap) Fix this by sanitizing num before using it to index fsg_opts->common->luns Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Acked-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman commit edeb0c90df3581b821a764052d185df985f8b8dc Author: Arnaldo Carvalho de Melo Date: Tue Oct 16 17:08:29 2018 -0300 perf tools: Stop fallbacking to kallsyms for vdso symbols lookup David reports that: Perf has this hack where it uses the kernel symbol map as a backup when a symbol can't be found in the user's symbol table(s). This causes problems because the tests driving this code path use machine__kernel_ip(), and that is completely meaningless on Sparc. On sparc64 the kernel and user live in physically separate virtual address spaces, rather than a shared one. And the kernel lives at a virtual address that overlaps common userspace addresses. So this test passes almost all the time when a user symbol lookup fails. The consequence of this is that, if the unfound user virtual address in the sample doesn't match up to a kernel symbol either, we trigger things like this code in builtin-top.c: if (al.sym == NULL && al.map != NULL) { const char *msg = "Kernel samples will not be resolved.\n"; /* * As we do lazy loading of symtabs we only will know if the * specified vmlinux file is invalid when we actually have a * hit in kernel space and then try to load it. So if we get * here and there are _no_ symbols in the DSO backing the * kernel map, bail out. * * We may never get here, for instance, if we use -K/ * --hide-kernel-symbols, even if the user specifies an * invalid --vmlinux ;-) */ if (!machine->kptr_restrict_warned && !top->vmlinux_warned && __map__is_kernel(al.map) && map__has_symbols(al.map)) { if (symbol_conf.vmlinux_name) { char serr[256]; dso__strerror_load(al.map->dso, serr, sizeof(serr)); ui__warning("The %s file can't be used: %s\n%s", symbol_conf.vmlinux_name, serr, msg); } else { ui__warning("A vmlinux file was not found.\n%s", msg); } if (use_browser <= 0) sleep(5); top->vmlinux_warned = true; } } When I fire up a compilation on sparc, this triggers immediately. I'm trying to figure out what the "backup to kernel map" code is accomplishing. I see some language in the current code and in the changes that have happened in this area talking about vdso. Does that really happen? The vdso is mapped into userspace virtual addresses, not kernel ones. More history. This didn't cause problems on sparc some time ago, because the kernel IP check used to be "ip < 0" :-) Sparc kernel addresses are not negative. But now with machine__kernel_ip(), which works using the symbol table determined kernel address range, it does trigger. What it all boils down to is that on architectures like sparc, machine__kernel_ip() should always return false in this scenerio, and therefore this kind of logic: if (cpumode == PERF_RECORD_MISC_USER && machine && mg != &machine->kmaps && machine__kernel_ip(machine, al->addr)) { is basically invalid. PERF_RECORD_MISC_USER implies no kernel address can possibly match for the sample/event in question (no matter how hard you try!) :-) So, I thought something had changed and in the past we would somehow find that address in the kallsyms, but I couldn't find anything to back that up, the patch introducing this is over a decade old, lots of things changed, so I was just thinking I was missing something. I tried a gtod busy loop to generate vdso activity and added a 'perf probe' at that branch, on x86_64 to see if it ever gets hit: Made thread__find_map() noinline, as 'perf probe' in lines of inline functions seems to not be working, only at function start. (Masami?) # perf probe -x ~/bin/perf -L thread__find_map:57 57 if (cpumode == PERF_RECORD_MISC_USER && machine && 58 mg != &machine->kmaps && 59 machine__kernel_ip(machine, al->addr)) { 60 mg = &machine->kmaps; 61 load_map = true; 62 goto try_again; } } else { /* * Kernel maps might be changed when loading * symbols so loading * must be done prior to using kernel maps. */ 69 if (load_map) 70 map__load(al->map); 71 al->addr = al->map->map_ip(al->map, al->addr); # perf probe -x ~/bin/perf thread__find_map:60 Added new event: probe_perf:thread__find_map (on thread__find_map:60 in /home/acme/bin/perf) You can now use it in all perf tools, such as: perf record -e probe_perf:thread__find_map -aR sleep 1 # Then used this to see if, system wide, those probe points were being hit: # perf trace -e *perf:thread*/max-stack=8/ ^C[root@jouet ~]# No hits when running 'perf top' and: # cat gtod.c #include int main(void) { struct timeval tv; while (1) gettimeofday(&tv, 0); return 0; } [root@jouet c]# ./gtod ^C Pressed 'P' in 'perf top' and the [vdso] samples are there: 62.84% [vdso] [.] __vdso_gettimeofday 8.13% gtod [.] main 7.51% [vdso] [.] 0x0000000000000914 5.78% [vdso] [.] 0x0000000000000917 5.43% gtod [.] _init 2.71% [vdso] [.] 0x000000000000092d 0.35% [kernel] [k] native_io_delay 0.33% libc-2.26.so [.] __memmove_avx_unaligned_erms 0.20% [vdso] [.] 0x000000000000091d 0.17% [i2c_i801] [k] i801_access 0.06% firefox [.] free 0.06% libglib-2.0.so.0.5400.3 [.] g_source_iter_next 0.05% [vdso] [.] 0x0000000000000919 0.05% libpthread-2.26.so [.] __pthread_mutex_lock 0.05% libpixman-1.so.0.34.0 [.] 0x000000000006d3a7 0.04% [kernel] [k] entry_SYSCALL_64_trampoline 0.04% libxul.so [.] style::dom_apis::query_selector_slow 0.04% [kernel] [k] module_get_kallsym 0.04% firefox [.] malloc 0.04% [vdso] [.] 0x0000000000000910 I added a 'perf probe' to thread__find_map:69, and that surely got tons of hits, i.e. for every map found, just to make sure the 'perf probe' command was really working. In the process I noticed a bug, we're only have records for '[vdso]' for pre-existing commands, i.e. ones that are running when we start 'perf top', when we will generate the PERF_RECORD_MMAP by looking at /perf/PID/maps. I.e. like this, for preexisting processes with a vdso map, again, tracing for all the system, only pre-existing processes get a [vdso] map (when having one): [root@jouet ~]# perf probe -x ~/bin/perf __machine__addnew_vdso Added new event: probe_perf:__machine__addnew_vdso (on __machine__addnew_vdso in /home/acme/bin/perf) You can now use it in all perf tools, such as: perf record -e probe_perf:__machine__addnew_vdso -aR sleep 1 [root@jouet ~]# perf trace -e probe_perf:__machine__addnew_vdso/max-stack=8/ 0.000 probe_perf:__machine__addnew_vdso:(568eb3) __machine__addnew_vdso (/home/acme/bin/perf) map__new (/home/acme/bin/perf) machine__process_mmap2_event (/home/acme/bin/perf) machine__process_event (/home/acme/bin/perf) perf_event__process (/home/acme/bin/perf) perf_tool__process_synth_event (/home/acme/bin/perf) perf_event__synthesize_mmap_events (/home/acme/bin/perf) __event__synthesize_thread (/home/acme/bin/perf) The kernel is generating a PERF_RECORD_MMAP for vDSOs, but somehow 'perf top' is not getting those records while 'perf record' is: # perf record ~acme/c/gtod ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.076 MB perf.data (1499 samples) ] # perf report -D | grep PERF_RECORD_MMAP2 71293612401913 0x11b48 [0x70]: PERF_RECORD_MMAP2 25484/25484: [0x400000(0x1000) @ 0 fd:02 1137 541179306]: r-xp /home/acme/c/gtod 71293612419012 0x11be0 [0x70]: PERF_RECORD_MMAP2 25484/25484: [0x7fa4a2783000(0x227000) @ 0 fd:00 3146370 854107250]: r-xp /usr/lib64/ld-2.26.so 71293612432110 0x11c50 [0x60]: PERF_RECORD_MMAP2 25484/25484: [0x7ffcdb53a000(0x2000) @ 0 00:00 0 0]: r-xp [vdso] 71293612509944 0x11cb0 [0x70]: PERF_RECORD_MMAP2 25484/25484: [0x7fa4a23cd000(0x3b6000) @ 0 fd:00 3149723 262067164]: r-xp /usr/lib64/libc-2.26.so # # perf script | grep vdso | head gtod 25484 71293.612768: 2485554 cycles:ppp: 7ffcdb53a914 [unknown] ([vdso]) gtod 25484 71293.613576: 2149343 cycles:ppp: 7ffcdb53a917 [unknown] ([vdso]) gtod 25484 71293.614274: 1814652 cycles:ppp: 7ffcdb53aca8 __vdso_gettimeofday+0x98 ([vdso]) gtod 25484 71293.614862: 1669070 cycles:ppp: 7ffcdb53acc5 __vdso_gettimeofday+0xb5 ([vdso]) gtod 25484 71293.615404: 1451589 cycles:ppp: 7ffcdb53acc5 __vdso_gettimeofday+0xb5 ([vdso]) gtod 25484 71293.615999: 1269941 cycles:ppp: 7ffcdb53ace6 __vdso_gettimeofday+0xd6 ([vdso]) gtod 25484 71293.616405: 1177946 cycles:ppp: 7ffcdb53a914 [unknown] ([vdso]) gtod 25484 71293.616775: 1121290 cycles:ppp: 7ffcdb53ac47 __vdso_gettimeofday+0x37 ([vdso]) gtod 25484 71293.617150: 1037721 cycles:ppp: 7ffcdb53ace6 __vdso_gettimeofday+0xd6 ([vdso]) gtod 25484 71293.617478: 994526 cycles:ppp: 7ffcdb53ace6 __vdso_gettimeofday+0xd6 ([vdso]) # The patch is the obvious one and with it we also continue to resolve vdso symbols for pre-existing processes in 'perf top' and for all processes in 'perf record' + 'perf report/script'. Suggested-by: David Miller Acked-by: David Miller Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-cs7skq9pp0kjypiju6o7trse@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7a7080b53467ad96c0b371e9d2a2a312f96f99c2 Merge: 5e65a20341e0 48f78be33260 Author: Jens Axboe Date: Wed Oct 17 09:45:49 2018 -0600 Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linus Pull single NVMe fix from Christoph. * 'nvme-4.19' of git://git.infradead.org/nvme: nvme: remove ns sibling before clearing path commit c343db455eb3105f11bb5ac290d77ab2006b0209 Merge: c0cff31be705 cf8afe5c5362 Author: Greg Kroah-Hartman Date: Wed Oct 17 14:01:00 2018 +0200 Merge branch 'parisc-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Helge writes: "parisc fix: Fix an unitialized variable usage in the parisc unwind code." * 'parisc-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix uninitialized variable usage in unwind.c commit c0cff31be705014ce127d6a6570b02f8515de3e2 Merge: b955a910d7fd 02621216e1d8 Author: Greg Kroah-Hartman Date: Wed Oct 17 13:40:10 2018 +0200 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Stephen writes: "clk fixes for v4.19-rc8 One fix for the Allwinner A10 SoC's audio PLL that wasn't properly set and generating noise." * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: sunxi-ng: sun4i: Set VCO and PLL bias current to lowest setting commit 2224d616528194b02424c91c2ee254b3d29942c3 Author: Sebastian Andrzej Siewior Date: Tue Oct 16 22:25:25 2018 +0200 x86/fpu: Fix i486 + no387 boot crash by only saving FPU registers on context switch if there is an FPU Booting an i486 with "no387 nofxsr" ends with with the following crash: math_emulate: 0060:c101987d Kernel panic - not syncing: Math emulation needed in kernel on the first context switch in user land. The reason is that copy_fpregs_to_fpstate() tries FNSAVE which does not work as the FPU is turned off. This bug was introduced in: f1c8cd0176078 ("x86/fpu: Change fpu->fpregs_active users to fpu->fpstate_active") Add a check for X86_FEATURE_FPU before trying to save FPU registers (we have such a check in switch_fpu_finish() already). Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: stable@vger.kernel.org Fixes: f1c8cd0176078 ("x86/fpu: Change fpu->fpregs_active users to fpu->fpstate_active") Link: http://lkml.kernel.org/r/20181016202525.29437-4-bigeasy@linutronix.de Signed-off-by: Ingo Molnar commit 6aa676761d4c1acfa31320e55fa1f83f3fcbbc7a Author: Sebastian Andrzej Siewior Date: Tue Oct 16 22:25:24 2018 +0200 x86/fpu: Remove second definition of fpu in __fpu__restore_sig() Commit: c5bedc6847c3b ("x86/fpu: Get rid of PF_USED_MATH usage, convert it to fpu->fpstate_active") introduced the 'fpu' variable at top of __restore_xstate_sig(), which now shadows the other definition: arch/x86/kernel/fpu/signal.c:318:28: warning: symbol 'fpu' shadows an earlier one arch/x86/kernel/fpu/signal.c:271:20: originally declared here Remove the shadowed definition of 'fpu', as the two definitions are the same. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: c5bedc6847c3b ("x86/fpu: Get rid of PF_USED_MATH usage, convert it to fpu->fpstate_active") Link: http://lkml.kernel.org/r/20181016202525.29437-3-bigeasy@linutronix.de Signed-off-by: Ingo Molnar commit ae852495be365f6be433dde6629d3f0316f8efde Author: Andy Lutomirski Date: Sun Oct 14 11:38:18 2018 -0700 x86/entry/64: Further improve paranoid_entry comments Commit: 16561f27f94e ("x86/entry: Add some paranoid entry/exit CR3 handling comments") ... added some comments. This improves them a bit: - When I first read the new comments, it was unclear to me whether they were referring to the case where paranoid_entry interrupted other entry code or where paranoid_entry was itself interrupted. Clarify it. - Remove the EBX comment. We no longer use EBX as a SWAPGS indicator. Signed-off-by: Andy Lutomirski Acked-by: Thomas Gleixner Cc: Borislav Petkov Cc: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/c47daa1888dc2298e7e1d3f82bd76b776ea33393.1539542111.git.luto@kernel.org Signed-off-by: Ingo Molnar commit 04f4f954b69526d7af8ffb8e5780f08b8a6cda2d Author: Jan Kiszka Date: Mon Oct 15 16:09:29 2018 +0200 x86/entry/32: Clear the CS high bits Even if not on an entry stack, the CS's high bits must be initialized because they are unconditionally evaluated in PARANOID_EXIT_TO_KERNEL_MODE. Failing to do so broke the boot on Galileo Gen2 and IOT2000 boards. [ bp: Make the commit message tone passive and impartial. ] Fixes: b92a165df17e ("x86/entry/32: Handle Entry from Kernel-Mode on Entry-Stack") Signed-off-by: Jan Kiszka Signed-off-by: Borislav Petkov Reviewed-by: Joerg Roedel Acked-by: Joerg Roedel CC: "H. Peter Anvin" CC: Andrea Arcangeli CC: Andy Lutomirski CC: Boris Ostrovsky CC: Brian Gerst CC: Dave Hansen CC: David Laight CC: Denys Vlasenko CC: Eduardo Valentin CC: Greg KH CC: Ingo Molnar CC: Jiri Kosina CC: Josh Poimboeuf CC: Juergen Gross CC: Linus Torvalds CC: Peter Zijlstra CC: Thomas Gleixner CC: Will Deacon CC: aliguori@amazon.com CC: daniel.gruss@iaik.tugraz.at CC: hughd@google.com CC: keescook@google.com CC: linux-mm CC: x86-ml Link: http://lkml.kernel.org/r/f271c747-1714-5a5b-a71f-ae189a093b8d@siemens.com Signed-off-by: Ingo Molnar commit 298faf53200fc02af38d32715697df6e661c1257 Author: Jiri Olsa Date: Tue Oct 16 17:06:07 2018 +0200 perf tools: Pass build flags to traceevent build So the extra user build flags are propagated to libtraceevent. Signed-off-by: Jiri Olsa Cc: "Herton R. Krzesinski" Cc: Steven Rostedt (VMware) Cc: Tzvetomir Stoyanov (VMware) Cc: Yordan Karadzhov (VMware) Link: http://lkml.kernel.org/r/20181016150614.21260-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d4046e8e17b9f378cb861982ef71c63911b5dff3 Author: Milian Wolff Date: Wed Sep 26 15:52:07 2018 +0200 perf report: Don't crash on invalid inline debug information When the function name for an inline frame is invalid, we must not try to demangle this symbol, otherwise we crash with: #0 0x0000555555895c01 in bfd_demangle () #1 0x0000555555823262 in demangle_sym (dso=0x555555d92b90, elf_name=0x0, kmodule=0) at util/symbol-elf.c:215 #2 dso__demangle_sym (dso=dso@entry=0x555555d92b90, kmodule=, kmodule@entry=0, elf_name=elf_name@entry=0x0) at util/symbol-elf.c:400 #3 0x00005555557fef4b in new_inline_sym (funcname=0x0, base_sym=0x555555d92b90, dso=0x555555d92b90) at util/srcline.c:89 #4 inline_list__append_dso_a2l (dso=dso@entry=0x555555c7bb00, node=node@entry=0x555555e31810, sym=sym@entry=0x555555d92b90) at util/srcline.c:264 #5 0x00005555557ff27f in addr2line (dso_name=dso_name@entry=0x555555d92430 "/home/milian/.debug/.build-id/f7/186d14bb94f3c6161c010926da66033d24fce5/elf", addr=addr@entry=2888, file=file@entry=0x0, line=line@entry=0x0, dso=dso@entry=0x555555c7bb00, unwind_inlines=unwind_inlines@entry=true, node=0x555555e31810, sym=0x555555d92b90) at util/srcline.c:313 #6 0x00005555557ffe7c in addr2inlines (sym=0x555555d92b90, dso=0x555555c7bb00, addr=2888, dso_name=0x555555d92430 "/home/milian/.debug/.build-id/f7/186d14bb94f3c6161c010926da66033d24fce5/elf") at util/srcline.c:358 So instead handle the case where we get invalid function names for inlined frames and use a fallback '??' function name instead. While this crash was originally reported by Hadrien for rust code, I can now also reproduce it with trivial C++ code. Indeed, it seems like libbfd fails to interpret the debug information for the inline frame symbol name: $ addr2line -e /home/milian/.debug/.build-id/f7/186d14bb94f3c6161c010926da66033d24fce5/elf -if b48 main /usr/include/c++/8.2.1/complex:610 ?? /usr/include/c++/8.2.1/complex:618 ?? /usr/include/c++/8.2.1/complex:675 ?? /usr/include/c++/8.2.1/complex:685 main /home/milian/projects/kdab/rnd/hotspot/tests/test-clients/cpp-inlining/main.cpp:39 I've reported this bug upstream and also attached a patch there which should fix this issue: https://sourceware.org/bugzilla/show_bug.cgi?id=23715 Reported-by: Hadrien Grasland Signed-off-by: Milian Wolff Cc: Jin Yao Cc: Jiri Olsa Cc: Namhyung Kim Fixes: a64489c56c30 ("perf report: Find the inline stack for a given address") [ The above 'Fixes:' cset is where originally the problem was introduced, i.e. using a2l->funcname without checking if it is NULL, but this current patch fixes the current codebase, i.e. multiple csets were applied after a64489c56c30 before the problem was reported by Hadrien ] Link: http://lkml.kernel.org/r/20180926135207.30263-3-milian.wolff@kdab.com Signed-off-by: Arnaldo Carvalho de Melo commit 0ac1077e3a549bf8d35971613e2be05bdbb41a00 Author: Xin Long Date: Tue Oct 16 15:52:02 2018 +0800 sctp: get pr_assoc and pr_stream all status with SCTP_PR_SCTP_ALL instead According to rfc7496 section 4.3 or 4.4: sprstat_policy: This parameter indicates for which PR-SCTP policy the user wants the information. It is an error to use SCTP_PR_SCTP_NONE in sprstat_policy. If SCTP_PR_SCTP_ALL is used, the counters provided are aggregated over all supported policies. We change to dump pr_assoc and pr_stream all status by SCTP_PR_SCTP_ALL instead, and return error for SCTP_PR_SCTP_NONE, as it also said "It is an error to use SCTP_PR_SCTP_NONE in sprstat_policy. " Fixes: 826d253d57b1 ("sctp: add SCTP_PR_ASSOC_STATUS on sctp sockopt") Fixes: d229d48d183f ("sctp: add SCTP_PR_STREAM_STATUS sockopt for prsctp") Reported-by: Ying Xu Signed-off-by: Xin Long Acked-by: Neil Horman Signed-off-by: David S. Miller commit b955a910d7fde877e068f68fada5aac02e3a073d Merge: a886199872db a06ecbfe784c Author: Greg Kroah-Hartman Date: Tue Oct 16 18:53:31 2018 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc David writes: "Sparc fixes 1) Revert the %pOF change, it causes regressions. 2) Wire up io_pgetevents(). 3) Fix perf events on single-PCR sparc64 cpus. 4) Do proper perf event throttling like arm and x86." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: Revert "sparc: Convert to using %pOFn instead of device_node.name" sparc64: Set %l4 properly on trap return after handling signals. sparc64: Make proc_id signed. sparc: Throttle perf events properly. sparc: Fix single-pcr perf event counter management. sparc: Wire up io_pgetevents system call. sunvdc: Remove VLA usage commit a886199872db1d65e88e2a5b015016ab75b5b168 Merge: f0a7d1883d9f 073c1a781e4a Author: Greg Kroah-Hartman Date: Tue Oct 16 18:52:00 2018 +0200 Merge tag 'selinux-pr-20181015' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Paul writes: "SELinux fixes for v4.19 We've got one SELinux "fix" that I'd like to get into v4.19 if possible. I'm using double quotes on "fix" as this is just an update to the MAINTAINERS file and not a code change. From my perspective, MAINTAINERS updates generally don't warrant inclusion during the -rcX phase, but this is a change to the mailing list location so it seemed prudent to get this in before v4.19 is released" * tag 'selinux-pr-20181015' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: MAINTAINERS: update the SELinux mailing list location commit a3671a4f973ee9d9621d60166cc3b037c397d604 Author: Gustavo A. R. Silva Date: Tue Oct 16 16:59:01 2018 +0200 RDMA/ucma: Fix Spectre v1 vulnerability hdr.cmd can be indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/infiniband/core/ucma.c:1686 ucma_write() warn: potential spectre issue 'ucma_cmd_table' [r] (local cap) Fix this by sanitizing hdr.cmd before using it to index ucm_cmd_table. Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Signed-off-by: Doug Ledford commit 0295e39595e1146522f2722715dba7f7fba42217 Author: Gustavo A. R. Silva Date: Tue Oct 16 16:32:40 2018 +0200 IB/ucm: Fix Spectre v1 vulnerability hdr.cmd can be indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/infiniband/core/ucm.c:1127 ib_ucm_write() warn: potential spectre issue 'ucm_cmd_table' [r] (local cap) Fix this by sanitizing hdr.cmd before using it to index ucm_cmd_table. Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Signed-off-by: Doug Ledford commit 0ed149cf5239cc6e7e65bf00f769e8f1e91076c0 Author: David Miller Date: Thu Oct 11 22:46:55 2018 -0700 perf cpu_map: Align cpu map synthesized events properly. The size of the resulting cpu map can be smaller than a multiple of sizeof(u64), resulting in SIGBUS on cpus like Sparc as the next event will not be aligned properly. Signed-off-by: David S. Miller Cc: Jiri Olsa Cc: Kan Liang Fixes: 6c872901af07 ("perf cpu_map: Add cpu_map event synthesize function") Link: http://lkml.kernel.org/r/20181011.224655.716771175766946817.davem@davemloft.net Signed-off-by: Arnaldo Carvalho de Melo commit c458a6206d2a8600934617ccf88ba7d3a030faba Author: Jiri Olsa Date: Tue Oct 16 13:48:18 2018 +0200 perf tools: Fix tracing_path_mount proper path If there's no tracefs (RHEL7) support the tracing_path_mount returns debugfs path which results in following fail: # perf probe sys_write kprobe_events file does not exist - please rebuild kernel with CONFIG_KPROBE_EVENTS. Error: Failed to add events. In tracing_path_debugfs_mount function we need to return the 'tracing' path instead of just the mount to make it work: # perf probe sys_write Added new event: probe:sys_write (on sys_write) You can now use it in all perf tools, such as: perf record -e probe:sys_write -aR sleep 1 Adding the 'return tracing_path;' also to tracing_path_tracefs_mount function just for consistency with tracing_path_debugfs_mount. Upstream keeps working, because it has the tracefs support. Link: http://lkml.kernel.org/n/tip-yiwkzexq9fk1ey1xg3gnjlw4@git.kernel.org Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt Fixes: 23773ca18b39 ("perf tools: Make perf aware of tracefs") Link: http://lkml.kernel.org/r/20181016114818.3595-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 36b8d4628d3cc8f5a748e508cce8673bc00fc63c Author: Jarod Wilson Date: Thu Sep 6 18:18:12 2018 -0400 perf tools: Fix use of alternatives to find JDIR When a build is run from something like a cron job, the user's $PATH is rather minimal, of note, not including /usr/sbin in my own case. Because of that, an automated rpm package build ultimately fails to find libperf-jvmti.so, because somewhere within the build, this happens... /bin/sh: alternatives: command not found /bin/sh: alternatives: command not found Makefile.config:849: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel ...and while the build continues, libperf-jvmti.so isn't built, and things fall down when rpm tries to find all the %files specified. Exact same system builds everything just fine when the job is launched from a login shell instead of a cron job, since alternatives is in $PATH, so openjdk is actually found. The test required to get into this section of code actually specifies the full path, as does a block just above it, so let's do that here too. Signed-off-by: Jarod Wilson Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: William Cohen Fixes: d4dfdf00d43e ("perf jvmti: Plug compilation into perf build") Link: http://lkml.kernel.org/r/20180906221812.11167-1-jarod@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 9068e02f58740778d8270840657f1e250a2cc60f Author: Clint Taylor Date: Fri Oct 5 14:52:15 2018 -0700 drm/edid: VSDB yCBCr420 Deep Color mode bit definitions HDMI Forum VSDB YCBCR420 deep color capability bits are 2:0. Correct definitions in the header for the mask to work correctly. Fixes: e6a9a2c3dc43 ("drm/edid: parse ycbcr 420 deep color information") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107893 Cc: # v4.14+ Signed-off-by: Clint Taylor Reviewed-by: Jani Nikula Reviewed-by: Shashank Sharma Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1538776335-12569-1-git-send-email-clinton.a.taylor@intel.com commit 4ab8455f8bd83298bf7f67ab9357e3b1cc765c7d Author: Jiri Olsa Date: Wed Oct 3 23:20:52 2018 +0200 perf evsel: Store ids for events with their own cpus perf_event__synthesize_event_update_cpus John reported crash when recording on an event under PMU with cpumask defined: root@localhost:~# ./perf_debug_ record -e armv8_pmuv3_0/br_mis_pred/ sleep 1 perf: Segmentation fault Obtained 9 stack frames. ./perf_debug_() [0x4c5ef8] [0xffff82ba267c] ./perf_debug_() [0x4bc5a8] ./perf_debug_() [0x419550] ./perf_debug_() [0x41a928] ./perf_debug_() [0x472f58] ./perf_debug_() [0x473210] ./perf_debug_() [0x4070f4] /lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe0) [0xffff8294c8a0] Segmentation fault (core dumped) We synthesize an update event that needs to touch the evsel id array, which is not defined at that time. Fixing this by forcing the id allocation for events with their own cpus. Reported-by: John Garry Signed-off-by: Jiri Olsa Tested-by: John Garry Cc: Alexander Shishkin Cc: Andi Kleen Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linuxarm@huawei.com Fixes: bfd8f72c2778 ("perf record: Synthesize unit/scale/... in event update") Link: http://lkml.kernel.org/r/20181003212052.GA32371@krava Signed-off-by: Arnaldo Carvalho de Melo commit 665c365a77fbfeabe52694aedf3446d5f2f1ce42 Author: Alan Stern Date: Mon Oct 15 16:55:04 2018 -0400 USB: fix the usbfs flag sanitization for control transfers Commit 7a68d9fb8510 ("USB: usbdevfs: sanitize flags more") checks the transfer flags for URBs submitted from userspace via usbfs. However, the check for whether the USBDEVFS_URB_SHORT_NOT_OK flag should be allowed for a control transfer was added in the wrong place, before the code has properly determined the direction of the control transfer. (Control transfers are special because for them, the direction is set by the bRequestType byte of the Setup packet rather than direction bit of the endpoint address.) This patch moves code which sets up the allow_short flag for control transfers down after is_in has been set to the correct value. Signed-off-by: Alan Stern Reported-and-tested-by: syzbot+24a30223a4b609bb802e@syzkaller.appspotmail.com Fixes: 7a68d9fb8510 ("USB: usbdevfs: sanitize flags more") CC: Oliver Neukum CC: Signed-off-by: Greg Kroah-Hartman commit cf8afe5c53621eda385be961bc72329a2adcd767 Author: Helge Deller Date: Tue Oct 16 08:21:48 2018 +0200 parisc: Fix uninitialized variable usage in unwind.c As noticed by Dave Anglin, the last commit introduced a small bug where the potentially uninitialized r struct is used instead of the regs pointer as input for unwind_frame_init(). Fix it. Signed-off-by: Helge Deller Reported-by: John David Anglin commit 9845c49cc9bbb317a0bc9e9cf78d8e09d54c9af0 Author: Song Muchun Date: Sun Oct 14 19:26:12 2018 +0800 sched/fair: Fix the min_vruntime update logic in dequeue_entity() The comment and the code around the update_min_vruntime() call in dequeue_entity() are not in agreement. From commit: b60205c7c558 ("sched/fair: Fix min_vruntime tracking") I think that we want to update min_vruntime when a task is sleeping/migrating. So, the check is inverted there - fix it. Signed-off-by: Song Muchun Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: b60205c7c558 ("sched/fair: Fix min_vruntime tracking") Link: http://lkml.kernel.org/r/20181014112612.2614-1-smuchun@gmail.com Signed-off-by: Ingo Molnar commit bd8be2cf8b69573707f837786474c00ff7423a0f Merge: 1890fea7936a 140b6abac26d Author: David S. Miller Date: Mon Oct 15 23:17:25 2018 -0700 Merge branch 'nfp-fix-pedit-set-action-offloads' Jakub Kicinski says: ==================== nfp: fix pedit set action offloads Pieter says: This set fixes set actions when using multiple pedit actions with partial masks and with multiple keys per pedit action. Additionally it fixes set ipv6 pedit action offloads when using it in combination with other header keys. The problem would only trigger if one combines multiple pedit actions of the same type with partial masks, e.g.: $ tc filter add dev netdev protocol ip parent ffff: \ flower indev netdev \ ip_proto tcp \ action pedit ex munge \ ip src set 11.11.11.11 retain 65535 munge \ ip src set 22.22.22.22 retain 4294901760 pipe \ csum ip and tcp pipe \ mirred egress redirect dev netdev ==================== Signed-off-by: David S. Miller commit 140b6abac26d799f75d772ab5e969b34ad8d68f1 Author: Pieter Jansen van Vuuren Date: Mon Oct 15 16:52:25 2018 -0700 nfp: flower: use offsets provided by pedit instead of index for ipv6 Previously when populating the set ipv6 address action, we incorrectly made use of pedit's key index to determine which 32bit word should be set. We now calculate which word has been selected based on the offset provided by the pedit action. Fixes: 354b82bb320e ("nfp: add set ipv6 source and destination address") Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit d08c9e589300b015e72e5b41ff4dfed6eb8e7421 Author: Pieter Jansen van Vuuren Date: Mon Oct 15 16:52:24 2018 -0700 nfp: flower: fix multiple keys per pedit action Previously we only allowed a single header key per pedit action to change the header. This used to result in the last header key in the pedit action to overwrite previous headers. We now keep track of them and allow multiple header keys per pedit action. Fixes: c0b1bd9a8b8a ("nfp: add set ipv4 header action flower offload") Fixes: 354b82bb320e ("nfp: add set ipv6 source and destination address") Fixes: f8b7b0a6b113 ("nfp: add set tcp and udp header action flower offload") Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 8913806f166e47c6b3fe8253e9cfb9caabe64341 Author: Pieter Jansen van Vuuren Date: Mon Oct 15 16:52:23 2018 -0700 nfp: flower: fix pedit set actions for multiple partial masks Previously we did not correctly change headers when using multiple pedit actions with partial masks. We now take this into account and no longer just commit the last pedit action. Fixes: c0b1bd9a8b8a ("nfp: add set ipv4 header action flower offload") Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 1890fea7936ad9be0b7caf6a94146b0d905c4b60 Author: David Howells Date: Mon Oct 15 22:37:21 2018 +0100 rxrpc: Fix a missing rxrpc_put_peer() in the error_report handler Fix a missing call to rxrpc_put_peer() on the main path through the rxrpc_error_report() function. This manifests itself as a ref leak whenever an ICMP packet or other error comes in. In commit f334430316e7, the hand-off of the ref to a work item was removed and was not replaced with a put. Fixes: f334430316e7 ("rxrpc: Fix error distribution") Signed-off-by: David Howells Signed-off-by: David S. Miller commit d805397c3822d57ca3884d4bea37b2291fc40992 Author: Xin Long Date: Mon Oct 15 19:58:29 2018 +0800 sctp: use the pmtu from the icmp packet to update transport pathmtu Other than asoc pmtu sync from all transports, sctp_assoc_sync_pmtu is also processing transport pmtu_pending by icmp packets. But it's meaningless to use sctp_dst_mtu(t->dst) as new pmtu for a transport. The right pmtu value should come from the icmp packet, and it would be saved into transport->mtu_info in this patch and used later when the pmtu sync happens in sctp_sendmsg_to_asoc or sctp_packet_config. Besides, without this patch, as pmtu can only be updated correctly when receiving a icmp packet and no place is holding sock lock, it will take long time if the sock is busy with sending packets. Note that it doesn't process transport->mtu_info in .release_cb(), as there is no enough information for pmtu update, like for which asoc or transport. It is not worth traversing all asocs to check pmtu_pending. So unlike tcp, sctp does this in tx path, for which mtu_info needs to be atomic_t. Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit ec20a63aa8b8ec3223fb25cdb2a49f9f9dfda88c Author: Fugang Duan Date: Mon Oct 15 05:19:00 2018 +0000 net: fec: don't dump RX FIFO register when not available Commit db65f35f50e0 ("net: fec: add support of ethtool get_regs") introduce ethool "--register-dump" interface to dump all FEC registers. But not all silicon implementations of the Freescale FEC hardware module have the FRBR (FIFO Receive Bound Register) and FRSR (FIFO Receive Start Register) register, so we should not be trying to dump them on those that don't. To fix it we create a quirk flag, FEC_QUIRK_HAS_RFREG, and check it before dump those RX FIFO registers. Signed-off-by: Fugang Duan Signed-off-by: David S. Miller commit fbe1222c63b805e946c3af29b0bfbfee4c2fbeff Author: Colin Ian King Date: Sat Oct 13 16:48:25 2018 +0100 qed: fix spelling mistake "Ireelevant" -> "Irrelevant" Trivial fix to spelling mistake in DP_INFO message Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit dc012f3628eaecfb5ba68404a5c30ef501daf63d Author: Eric Dumazet Date: Fri Oct 12 18:58:53 2018 -0700 ipv6: mcast: fix a use-after-free in inet6_mc_check syzbot found a use-after-free in inet6_mc_check [1] The problem here is that inet6_mc_check() uses rcu and read_lock(&iml->sflock) So the fact that ip6_mc_leave_src() is called under RTNL and the socket lock does not help us, we need to acquire iml->sflock in write mode. In the future, we should convert all this stuff to RCU. [1] BUG: KASAN: use-after-free in ipv6_addr_equal include/net/ipv6.h:521 [inline] BUG: KASAN: use-after-free in inet6_mc_check+0xae7/0xb40 net/ipv6/mcast.c:649 Read of size 8 at addr ffff8801ce7f2510 by task syz-executor0/22432 CPU: 1 PID: 22432 Comm: syz-executor0 Not tainted 4.19.0-rc7+ #280 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 ipv6_addr_equal include/net/ipv6.h:521 [inline] inet6_mc_check+0xae7/0xb40 net/ipv6/mcast.c:649 __raw_v6_lookup+0x320/0x3f0 net/ipv6/raw.c:98 ipv6_raw_deliver net/ipv6/raw.c:183 [inline] raw6_local_deliver+0x3d3/0xcb0 net/ipv6/raw.c:240 ip6_input_finish+0x467/0x1aa0 net/ipv6/ip6_input.c:345 NF_HOOK include/linux/netfilter.h:289 [inline] ip6_input+0xe9/0x600 net/ipv6/ip6_input.c:426 ip6_mc_input+0x48a/0xd20 net/ipv6/ip6_input.c:503 dst_input include/net/dst.h:450 [inline] ip6_rcv_finish+0x17a/0x330 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] ipv6_rcv+0x120/0x640 net/ipv6/ip6_input.c:271 __netif_receive_skb_one_core+0x14d/0x200 net/core/dev.c:4913 __netif_receive_skb+0x2c/0x1e0 net/core/dev.c:5023 netif_receive_skb_internal+0x12c/0x620 net/core/dev.c:5126 napi_frags_finish net/core/dev.c:5664 [inline] napi_gro_frags+0x75a/0xc90 net/core/dev.c:5737 tun_get_user+0x3189/0x4250 drivers/net/tun.c:1923 tun_chr_write_iter+0xb9/0x154 drivers/net/tun.c:1968 call_write_iter include/linux/fs.h:1808 [inline] do_iter_readv_writev+0x8b0/0xa80 fs/read_write.c:680 do_iter_write+0x185/0x5f0 fs/read_write.c:959 vfs_writev+0x1f1/0x360 fs/read_write.c:1004 do_writev+0x11a/0x310 fs/read_write.c:1039 __do_sys_writev fs/read_write.c:1112 [inline] __se_sys_writev fs/read_write.c:1109 [inline] __x64_sys_writev+0x75/0xb0 fs/read_write.c:1109 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457421 Code: 75 14 b8 14 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 34 b5 fb ff c3 48 83 ec 08 e8 1a 2d 00 00 48 89 04 24 b8 14 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 63 2d 00 00 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007f2d30ecaba0 EFLAGS: 00000293 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 000000000000003e RCX: 0000000000457421 RDX: 0000000000000001 RSI: 00007f2d30ecabf0 RDI: 00000000000000f0 RBP: 0000000020000500 R08: 00000000000000f0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 00007f2d30ecb6d4 R13: 00000000004c4890 R14: 00000000004d7b90 R15: 00000000ffffffff Allocated by task 22437: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc mm/slab.c:3718 [inline] __kmalloc+0x14e/0x760 mm/slab.c:3727 kmalloc include/linux/slab.h:518 [inline] sock_kmalloc+0x15a/0x1f0 net/core/sock.c:1983 ip6_mc_source+0x14dd/0x1960 net/ipv6/mcast.c:427 do_ipv6_setsockopt.isra.9+0x3afb/0x45d0 net/ipv6/ipv6_sockglue.c:743 ipv6_setsockopt+0xbd/0x170 net/ipv6/ipv6_sockglue.c:933 rawv6_setsockopt+0x59/0x140 net/ipv6/raw.c:1069 sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:3038 __sys_setsockopt+0x1ba/0x3c0 net/socket.c:1902 __do_sys_setsockopt net/socket.c:1913 [inline] __se_sys_setsockopt net/socket.c:1910 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1910 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 22430: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3813 __sock_kfree_s net/core/sock.c:2004 [inline] sock_kfree_s+0x29/0x60 net/core/sock.c:2010 ip6_mc_leave_src+0x11a/0x1d0 net/ipv6/mcast.c:2448 __ipv6_sock_mc_close+0x20b/0x4e0 net/ipv6/mcast.c:310 ipv6_sock_mc_close+0x158/0x1d0 net/ipv6/mcast.c:328 inet6_release+0x40/0x70 net/ipv6/af_inet6.c:452 __sock_release+0xd7/0x250 net/socket.c:579 sock_close+0x19/0x20 net/socket.c:1141 __fput+0x385/0xa30 fs/file_table.c:278 ____fput+0x15/0x20 fs/file_table.c:309 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801ce7f2500 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 16 bytes inside of 192-byte region [ffff8801ce7f2500, ffff8801ce7f25c0) The buggy address belongs to the page: page:ffffea000739fc80 count:1 mapcount:0 mapping:ffff8801da800040 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea0006f6e548 ffffea000737b948 ffff8801da800040 raw: 0000000000000000 ffff8801ce7f2000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ce7f2400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ce7f2480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8801ce7f2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801ce7f2580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801ce7f2600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit d3092b2efca1cd1d492d0b08499a2066c5ca8cec Author: Tung Nguyen Date: Fri Oct 12 22:46:55 2018 +0200 tipc: fix unsafe rcu locking when accessing publication list The binding table's 'cluster_scope' list is rcu protected to handle races between threads changing the list and those traversing the list at the same moment. We have now found that the function named_distribute() uses the regular list_for_each() macro to traverse the said list. Likewise, the function tipc_named_withdraw() is removing items from the same list using the regular list_del() call. When these two functions execute in parallel we see occasional crashes. This commit fixes this by adding the missing _rcu() suffixes. Signed-off-by: Tung Nguyen Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 7ec8dc96e1cb45693f28f1287802ef6f2888dae0 Author: David Howells Date: Fri Oct 12 16:38:36 2018 +0100 rxrpc: Fix incorrect conditional on IPV6 The udpv6_encap_enable() function is part of the ipv6 code, and if that is configured as a loadable module and rxrpc is built in then a build failure will occur because the conditional check is wrong: net/rxrpc/local_object.o: In function `rxrpc_lookup_local': local_object.c:(.text+0x2688): undefined reference to `udpv6_encap_enable' Use the correct config symbol (CONFIG_AF_RXRPC_IPV6) in the conditional check rather than CONFIG_IPV6 as that will do the right thing. Fixes: 5271953cad31 ("rxrpc: Use the UDP encap_rcv hook") Reported-by: kbuild-all@01.org Reported-by: Arnd Bergmann Signed-off-by: David Howells Reviewed-by: Arnd Bergmann Signed-off-by: David S. Miller commit f547fac624be53ad8b07e9ebca7654a7827ba61b Author: Sabrina Dubroca Date: Fri Oct 12 16:22:47 2018 +0200 ipv6: rate-limit probes for neighbourless routes When commit 270972554c91 ("[IPV6]: ROUTE: Add Router Reachability Probing (RFC4191).") introduced router probing, the rt6_probe() function required that a neighbour entry existed. This neighbour entry is used to record the timestamp of the last probe via the ->updated field. Later, commit 2152caea7196 ("ipv6: Do not depend on rt->n in rt6_probe().") removed the requirement for a neighbour entry. Neighbourless routes skip the interval check and are not rate-limited. This patch adds rate-limiting for neighbourless routes, by recording the timestamp of the last probe in the fib6_info itself. Fixes: 2152caea7196 ("ipv6: Do not depend on rt->n in rt6_probe().") Signed-off-by: Sabrina Dubroca Reviewed-by: Stefano Brivio Signed-off-by: David S. Miller commit 64bd9c8135751b561f27edaaffe93d07093f81af Author: Florian Fainelli Date: Thu Oct 11 15:06:33 2018 -0700 net: bcmgenet: Poll internal PHY for GENETv5 On GENETv5, there is a hardware issue which prevents the GENET hardware from generating a link UP interrupt when the link is operating at 10Mbits/sec. Since we do not have any way to configure the link detection logic, fallback to polling in that case. Fixes: 421380856d9c ("net: bcmgenet: add support for the GENETv5 hardware") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit d6672a5a97918f92bf2f3a2591f25d02bb0897a4 Author: YueHaibing Date: Thu Oct 11 22:32:39 2018 +0100 rxrpc: use correct kvec num when sending BUSY response packet Fixes gcc '-Wunused-but-set-variable' warning: net/rxrpc/output.c: In function 'rxrpc_reject_packets': net/rxrpc/output.c:527:11: warning: variable 'ioc' set but not used [-Wunused-but-set-variable] 'ioc' is the correct kvec num when sending a BUSY (or an ABORT) response packet. Fixes: ece64fec164f ("rxrpc: Emit BUSY packets when supposed to rather than ABORTs") Signed-off-by: YueHaibing Signed-off-by: David Howells Signed-off-by: David S. Miller commit d7b4c24f45d2efe51b8f213da4593fefd49240ba Author: David Howells Date: Thu Oct 11 22:32:31 2018 +0100 rxrpc: Fix an uninitialised variable Fix an uninitialised variable introduced by the last patch. This can cause a crash when a new call comes in to a local service, such as when an AFS fileserver calls back to the local cache manager. Fixes: c1e15b4944c9 ("rxrpc: Fix the packet reception routine") Signed-off-by: David Howells Signed-off-by: David S. Miller commit 4af00f4cc1ba34da4654ac31830843cae871642d Author: Jon Maloy Date: Thu Oct 11 22:02:29 2018 +0200 tipc: initialize broadcast link stale counter correctly In the commit referred to below we added link tolerance as an additional criteria for declaring broadcast transmission "stale" and resetting the unicast links to the affected node. Unfortunately, this 'improvement' introduced two bugs, which each and one alone cause only limited problems, but combined lead to seemingly stochastic unicast link resets, depending on the amount of broadcast traffic transmitted. The first issue, a missing initialization of the 'tolerance' field of the receiver broadcast link, was recently fixed by commit 047491ea334a ("tipc: set link tolerance correctly in broadcast link"). Ths second issue, where we omit to reset the 'stale_cnt' field of the same link after a 'stale' period is over, leads to this counter accumulating over time, and in the absence of the 'tolerance' criteria leads to the above described symptoms. This commit adds the missing initialization. Fixes: a4dc70d46cf1 ("tipc: extend link reset criteria for stale packet retransmission") Signed-off-by: Jon Maloy Acked-by: Ying Xue Signed-off-by: David S. Miller commit 5a8e7aea953bdb6d4da13aff6f1e7f9c62023499 Author: Cong Wang Date: Thu Oct 11 11:15:13 2018 -0700 llc: set SOCK_RCU_FREE in llc_sap_add_socket() WHen an llc sock is added into the sk_laddr_hash of an llc_sap, it is not marked with SOCK_RCU_FREE. This causes that the sock could be freed while it is still being read by __llc_lookup_established() with RCU read lock. sock is refcounted, but with RCU read lock, nothing prevents the readers getting a zero refcnt. Fix it by setting SOCK_RCU_FREE in llc_sap_add_socket(). Reported-by: syzbot+11e05f04c15e03be5254@syzkaller.appspotmail.com Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit d0f068e5720ac4eea13e184bb7526848f189f909 Merge: e331473fee3d 37fdffb217a4 Author: David S. Miller Date: Mon Oct 15 21:51:28 2018 -0700 Merge tag 'mlx5-fixes-2018-10-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2018-10-10 This pull request includes some fixes to mlx5 driver, Please pull and let me know if there's any problem. For -stable v4.11: ('net/mlx5: Take only bit 24-26 of wqe.pftype_wq for page fault type') For -stable v4.17: ('net/mlx5: Fix memory leak when setting fpga ipsec caps') For -stable v4.18: ('net/mlx5: WQ, fixes for fragmented WQ buffers API') ==================== Signed-off-by: David S. Miller commit e331473fee3d500bb0d2582a1fe598df3326d8cd Author: Davide Caratti Date: Wed Oct 10 22:00:58 2018 +0200 net/sched: cls_api: add missing validation of netlink attributes Similarly to what has been done in 8b4c3cdd9dd8 ("net: sched: Add policy validation for tc attributes"), fix classifier code to add validation of TCA_CHAIN and TCA_KIND netlink attributes. tested with: # ./tdc.py -c filter v2: Let sch_api and cls_api share nla_policy they have in common, thanks to David Ahern. v3: Avoid EXPORT_SYMBOL(), as validation of those attributes is not done by TC modules, thanks to Cong Wang. While at it, restore the 'Delete / get qdisc' comment to its orginal position, just above tc_get_qdisc() function prototype. Fixes: 5bc1701881e39 ("net: sched: introduce multichain support for filters") Signed-off-by: Davide Caratti Signed-off-by: David S. Miller commit 58f5bbe331c566f49c9559568f982202a278aa78 Author: Wenwen Wang Date: Mon Oct 8 10:49:35 2018 -0500 ethtool: fix a privilege escalation bug In dev_ethtool(), the eth command 'ethcmd' is firstly copied from the use-space buffer 'useraddr' and checked to see whether it is ETHTOOL_PERQUEUE. If yes, the sub-command 'sub_cmd' is further copied from the user space. Otherwise, 'sub_cmd' is the same as 'ethcmd'. Next, according to 'sub_cmd', a permission check is enforced through the function ns_capable(). For example, the permission check is required if 'sub_cmd' is ETHTOOL_SCOALESCE, but it is not necessary if 'sub_cmd' is ETHTOOL_GCOALESCE, as suggested in the comment "Allow some commands to be done by anyone". The following execution invokes different handlers according to 'ethcmd'. Specifically, if 'ethcmd' is ETHTOOL_PERQUEUE, ethtool_set_per_queue() is called. In ethtool_set_per_queue(), the kernel object 'per_queue_opt' is copied again from the user-space buffer 'useraddr' and 'per_queue_opt.sub_command' is used to determine which operation should be performed. Given that the buffer 'useraddr' is in the user space, a malicious user can race to change the sub-command between the two copies. In particular, the attacker can supply ETHTOOL_PERQUEUE and ETHTOOL_GCOALESCE to bypass the permission check in dev_ethtool(). Then before ethtool_set_per_queue() is called, the attacker changes ETHTOOL_GCOALESCE to ETHTOOL_SCOALESCE. In this way, the attacker can bypass the permission check and execute ETHTOOL_SCOALESCE. This patch enforces a check in ethtool_set_per_queue() after the second copy from 'useraddr'. If the sub-command is different from the one obtained in the first copy in dev_ethtool(), an error code EINVAL will be returned. Fixes: f38d138a7da6 ("net/ethtool: support set coalesce per queue") Signed-off-by: Wenwen Wang Reviewed-by: Michal Kubecek Signed-off-by: David S. Miller commit 2bb3207dbbd4d30e96dd0e1c8e013104193bd59c Author: Wenwen Wang Date: Tue Oct 9 08:15:38 2018 -0500 ethtool: fix a missing-check bug In ethtool_get_rxnfc(), the eth command 'cmd' is compared against 'ETHTOOL_GRXFH' to see whether it is necessary to adjust the variable 'info_size'. Then the whole structure of 'info' is copied from the user-space buffer 'useraddr' with 'info_size' bytes. In the following execution, 'info' may be copied again from the buffer 'useraddr' depending on the 'cmd' and the 'info.flow_type'. However, after these two copies, there is no check between 'cmd' and 'info.cmd'. In fact, 'cmd' is also copied from the buffer 'useraddr' in dev_ethtool(), which is the caller function of ethtool_get_rxnfc(). Given that 'useraddr' is in the user space, a malicious user can race to change the eth command in the buffer between these copies. By doing so, the attacker can supply inconsistent data and cause undefined behavior because in the following execution 'info' will be passed to ops->get_rxnfc(). This patch adds a necessary check on 'info.cmd' and 'cmd' to confirm that they are still same after the two copies in ethtool_get_rxnfc(). Otherwise, an error code EINVAL will be returned. Signed-off-by: Wenwen Wang Signed-off-by: David S. Miller commit d49c88d7677ba737e9d2759a87db0402d5ab2607 Author: Jian-Hong Pan Date: Thu Sep 27 12:09:48 2018 +0800 r8169: Enable MSI-X on RTL8106e Originally, we have an issue where r8169 MSI-X interrupt is broken after S3 suspend/resume on RTL8106e of ASUS X441UAR. 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136] (rev 07) Subsystem: ASUSTeK Computer Inc. RTL810xE PCI Express Fast Ethernet controller [1043:200f] Flags: bus master, fast devsel, latency 0, IRQ 16 I/O ports at e000 [size=256] Memory at ef100000 (64-bit, non-prefetchable) [size=4K] Memory at e0000000 (64-bit, prefetchable) [size=16K] Capabilities: [40] Power Management version 3 Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+ Capabilities: [70] Express Endpoint, MSI 01 Capabilities: [b0] MSI-X: Enable+ Count=4 Masked- Capabilities: [d0] Vital Product Data Capabilities: [100] Advanced Error Reporting Capabilities: [140] Virtual Channel Capabilities: [160] Device Serial Number 01-00-00-00-36-4c-e0-00 Capabilities: [170] Latency Tolerance Reporting Kernel driver in use: r8169 Kernel modules: r8169 We found the all of the values in PCI BAR=4 of the ethernet adapter become 0xFF after system resumes. That breaks the MSI-X interrupt. Therefore, we can only fall back to MSI interrupt to fix the issue at that time. However, there is a commit which resolves the drivers getting nothing in PCI BAR=4 after system resumes. It is 04cb3ae895d7 "PCI: Reprogram bridge prefetch registers on resume" by Daniel Drake. After apply the patch, the ethernet adapter works fine before suspend and after resume. So, we can revert the workaround after the commit "PCI: Reprogram bridge prefetch registers on resume" is merged into main tree. This patch reverts commit 7bb05b85bc2d1a1b647b91424b2ed4a18e6ecd81 "r8169: don't use MSI-X on RTL8106e". Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=201181 Fixes: 7bb05b85bc2d ("r8169: don't use MSI-X on RTL8106e") Signed-off-by: Jian-Hong Pan Signed-off-by: David S. Miller commit a06ecbfe784ceb22e56ae3cd75fe77138e7cfa0b Author: David S. Miller Date: Mon Oct 15 18:32:54 2018 -0700 Revert "sparc: Convert to using %pOFn instead of device_node.name" This reverts commit 0b9871a3a8cc7234c285b5d9bf66cc6712cfee7c. Causes crashes with qemu, interacts badly with commit commit 6d0a70a284be ("vsprintf: print OF node name using full_name") etc. Reported-by: Guenter Roeck Signed-off-by: David S. Miller commit a309d5db58793d4d91f5a346e3fa58aa6bf60b12 Author: Matthew Wilcox Date: Mon Oct 15 16:28:21 2018 -0400 idr: Change documentation license This documentation was inadvertently released under the CC-BY-SA-4.0 license. It was intended to be released under GPL-2.0 or later. Signed-off-by: Matthew Wilcox commit c994b12945a65cd892ca2cf7ddcf0b7d8b25cdec Author: Matthew Wilcox Date: Mon Oct 15 16:23:08 2018 -0400 test_ida: Fix lockdep warning The IDA was declared on the stack instead of statically, so lockdep triggered a warning that it was improperly initialised. Reported-by: 0day bot Tested-by: Rong Chen Signed-off-by: Matthew Wilcox commit 13c1c5e4d7f887cba36c5e3df3faa22071c1469f Author: Mikhail Nikiforov Date: Mon Oct 15 11:17:56 2018 -0700 Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15IGM Add ELAN061C to the ACPI table to support Elan touchpad found in Lenovo IdeaPad 330-15IGM. Signed-off-by: Mikhail Nikiforov Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit f0a7d1883d9f78ae7bf15fc258bf9a2b20f35b76 Author: David Howells Date: Mon Oct 15 12:43:02 2018 +0100 afs: Fix clearance of reply The recent patch to fix the afs_server struct leak didn't actually fix the bug, but rather fixed some of the symptoms. The problem is that an asynchronous call that holds a resource pointed to by call->reply[0] will find the pointer cleared in the call destructor, thereby preventing the resource from being cleaned up. In the case of the server record leak, the afs_fs_get_capabilities() function in devel code sets up a call with reply[0] pointing at the server record that should be altered when the result is obtained, but this was being cleared before the destructor was called, so the put in the destructor does nothing and the record is leaked. Commit f014ffb025c1 removed the additional ref obtained by afs_install_server(), but the removal of this ref is actually used by the garbage collector to mark a server record as being defunct after the record has expired through lack of use. The offending clearance of call->reply[0] upon completion in afs_process_async_call() has been there from the origin of the code, but none of the asynchronous calls actually use that pointer currently, so it should be safe to remove (note that synchronous calls don't involve this function). Fix this by the following means: (1) Revert commit f014ffb025c1. (2) Remove the clearance of reply[0] from afs_process_async_call(). Without this, afs_manage_servers() will suffer an assertion failure if it sees a server record that didn't get used because the usage count is not 1. Fixes: f014ffb025c1 ("afs: Fix afs_server struct leak") Fixes: 08e0e7c82eea ("[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.") Signed-off-by: David Howells Cc: stable Signed-off-by: Greg Kroah-Hartman commit 35a7f35ad1b150ddf59a41dcac7b2fa32982be0e Author: Greg Kroah-Hartman Date: Mon Oct 15 07:20:24 2018 +0200 Linux 4.19-rc8 commit d1f1f98c6d1708a90436e1a3b2aff5e93946731b Author: David S. Miller Date: Sun Oct 14 20:22:28 2018 -0700 sparc64: Set %l4 properly on trap return after handling signals. If we did some signal processing, we have to reload the pt_regs tstate register because it's value may have changed. In doing so we also have to extract the %pil value contained in there anre load that into %l4. This value is at bit 20 and thus needs to be shifted down before we later write it into the %pil register. Most of the time this is harmless as we are returning to userspace and the %pil is zero for that case. Signed-off-by: David S. Miller commit b3e1eb8e7ac9aaa283989496651d99267c4cad6c Author: David S. Miller Date: Sun Oct 14 20:19:31 2018 -0700 sparc64: Make proc_id signed. So that when it is unset, ie. '-1', userspace can see it properly. Signed-off-by: David S. Miller commit 028c99fa912b4ad2174793da97694a9c4b2cd305 Merge: bab5c80b2110 cee271678d0e Author: David S. Miller Date: Sun Oct 14 13:01:20 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2018-10-14 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix xsk map update and delete operation to not call synchronize_net() but to piggy back on SOCK_RCU_FREE for sockets instead as we are not allowed to sleep under RCU, from Björn. 2) Do not change RLIMIT_MEMLOCK in reuseport_bpf selftest if the process already has unlimited RLIMIT_MEMLOCK, from Eric. ==================== Signed-off-by: David S. Miller commit dca5203e3fe2f5d8bc8157b205d766142d3a6b77 Author: Nathan Chancellor Date: Fri Oct 12 18:07:14 2018 -0700 x86/boot: Add -Wno-pointer-sign to KBUILD_CFLAGS When compiling the kernel with Clang, this warning appears even though it is disabled for the whole kernel because this folder has its own set of KBUILD_CFLAGS. It was disabled before the beginning of git history. In file included from arch/x86/boot/compressed/kaslr.c:29: In file included from arch/x86/boot/compressed/misc.h:21: In file included from ./include/linux/elf.h:5: In file included from ./arch/x86/include/asm/elf.h:77: In file included from ./arch/x86/include/asm/vdso.h:11: In file included from ./include/linux/mm_types.h:9: In file included from ./include/linux/spinlock.h:88: In file included from ./arch/x86/include/asm/spinlock.h:43: In file included from ./arch/x86/include/asm/qrwlock.h:6: ./include/asm-generic/qrwlock.h:101:53: warning: passing 'u32 *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign] if (likely(atomic_try_cmpxchg_acquire(&lock->cnts, &cnts, _QW_LOCKED))) ^~~~~ ./include/linux/compiler.h:76:40: note: expanded from macro 'likely' # define likely(x) __builtin_expect(!!(x), 1) ^ ./include/asm-generic/atomic-instrumented.h:69:66: note: passing argument to parameter 'old' here static __always_inline bool atomic_try_cmpxchg(atomic_t *v, int *old, int new) ^ Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Nick Desaulniers Link: https://lkml.kernel.org/r/20181013010713.6999-1-natechancellor@gmail.com commit 53c13ba8ed39e89f21a0b98f4c8a241bb44e483d Author: Nathan Chancellor Date: Fri Oct 12 17:53:12 2018 -0700 x86/time: Correct the attribute on jiffies' definition Clang warns that the declaration of jiffies in include/linux/jiffies.h doesn't match the definition in arch/x86/time/kernel.c: arch/x86/kernel/time.c:29:42: warning: section does not match previous declaration [-Wsection] __visible volatile unsigned long jiffies __cacheline_aligned = INITIAL_JIFFIES; ^ ./include/linux/cache.h:49:4: note: expanded from macro '__cacheline_aligned' __section__(".data..cacheline_aligned"))) ^ ./include/linux/jiffies.h:81:31: note: previous attribute is here extern unsigned long volatile __cacheline_aligned_in_smp __jiffy_arch_data jiffies; ^ ./arch/x86/include/asm/cache.h:20:2: note: expanded from macro '__cacheline_aligned_in_smp' __page_aligned_data ^ ./include/linux/linkage.h:39:29: note: expanded from macro '__page_aligned_data' #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) ^ ./include/linux/compiler_attributes.h:233:56: note: expanded from macro '__section' #define __section(S) __attribute__((__section__(#S))) ^ 1 warning generated. The declaration was changed in commit 7c30f352c852 ("jiffies.h: declare jiffies and jiffies_64 with ____cacheline_aligned_in_smp") but wasn't updated here. Make them match so Clang no longer warns. Fixes: 7c30f352c852 ("jiffies.h: declare jiffies and jiffies_64 with ____cacheline_aligned_in_smp") Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Nick Desaulniers Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181013005311.28617-1-natechancellor@gmail.com commit 16561f27f94e6193ee8f5b9b74801e1668c86efc Author: Dave Hansen Date: Fri Oct 12 16:21:18 2018 -0700 x86/entry: Add some paranoid entry/exit CR3 handling comments Andi Kleen was just asking me about the NMI CR3 handling and why we restore it unconditionally. I was *sure* we had documented it well. We did not. Add some documentation. We have common entry code where the CR3 value is stashed, but three places in two big code paths where we restore it. I put bulk of the comments in this common path and then refer to it from the other spots. Signed-off-by: Dave Hansen Signed-off-by: Thomas Gleixner Cc: luto@kernel.org Cc: bp@alien8.de Cc: "H. Peter Anvin" Cc: Borislav Petkov Link: https://lkml.kernel.org/r/20181012232118.3EAAE77B@viggo.jf.intel.com commit b59167ac7bafd804c91e49ad53c6d33a7394d4c8 Author: Peter Zijlstra Date: Thu Oct 11 12:38:27 2018 +0200 x86/percpu: Fix this_cpu_read() Eric reported that a sequence count loop using this_cpu_read() got optimized out. This is wrong, this_cpu_read() must imply READ_ONCE() because the interface is IRQ-safe, therefore an interrupt can have changed the per-cpu value. Fixes: 7c3576d261ce ("[PATCH] i386: Convert PDA into the percpu section") Reported-by: Eric Dumazet Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Acked-by: Eric Dumazet Cc: hpa@zytor.com Cc: eric.dumazet@gmail.com Cc: bp@alien8.de Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181011104019.748208519@infradead.org commit 4907c68abd3f60f650f98d5a69d4ec77c0bde44f Author: Peter Zijlstra Date: Thu Oct 11 12:38:26 2018 +0200 x86/tsc: Force inlining of cyc2ns bits Looking at the asm for native_sched_clock() I noticed we don't inline enough. Mostly caused by sharing code with cyc2ns_read_begin(), which we didn't used to do. So mark all that __force_inline to make it DTRT. Fixes: 59eaef78bfea ("x86/tsc: Remodel cyc2ns to use seqcount_latch()") Reported-by: Eric Dumazet Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Cc: eric.dumazet@gmail.com Cc: bp@alien8.de Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181011104019.695196158@infradead.org commit 3a27203102ebfa67bd0bced05b1def499bb59db2 Merge: a24a0eb9c897 4628a64591e6 Author: Greg Kroah-Hartman Date: Sun Oct 14 08:34:31 2018 +0200 Merge tag 'libnvdimm-fixes-4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Dan writes: "libnvdimm/dax 4.19-rc8 * Fix a livelock in dax_layout_busy_page() present since v4.18. The lockup triggers when truncating an actively mapped huge page out of a mapping pinned for direct-I/O. * Fix mprotect() clobbers of _PAGE_DEVMAP. Broken since v4.5 mprotect() clears this flag that is needed to communicate the liveness of device pages to the get_user_pages() path." * tag 'libnvdimm-fixes-4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: mm: Preserve _PAGE_DEVMAP across mprotect() calls filesystem-dax: Fix dax_layout_busy_page() livelock commit a24a0eb9c8972803a8707041fc9ed9080cdaf1b9 Merge: 7ec21823634d 34d1b82cd198 Author: Greg Kroah-Hartman Date: Sun Oct 14 08:33:35 2018 +0200 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Wolfram writes: "i2c fix for 4.19: I2C has one documentation bugfix for something we changed during the v4.19 cycle" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: Fix kerneldoc for renamed i2c dma put function commit 7ec21823634d7cb7ea20539b877c0d31830c6ad4 Merge: f8ccb14fd6c9 5f8bb004bca4 Author: Greg Kroah-Hartman Date: Sat Oct 13 15:11:15 2018 +0200 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Paolo writes: "KVM fixes for 4.19-rc8 Leftover bugfixes." * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: vmx: hyper-v: don't pass EPT configuration info to vmx_hv_remote_flush_tlb() KVM: x86: support CONFIG_KVM_AMD=y with CONFIG_CRYPTO_DEV_CCP_DD=m ARM: KVM: Correctly order SGI register entries in the cp15 array commit 5f8bb004bca43f7b5043c02b4aa5b9b43e15fe50 Author: Vitaly Kuznetsov Date: Thu Oct 11 12:03:12 2018 +0200 KVM: vmx: hyper-v: don't pass EPT configuration info to vmx_hv_remote_flush_tlb() I'm observing random crashes in multi-vCPU L2 guests running on KVM on Hyper-V. I bisected the issue to the commit 877ad952be3d ("KVM: vmx: Add tlb_remote_flush callback support"). Hyper-V TLFS states: "AddressSpace specifies an address space ID (an EPT PML4 table pointer)" So apparently, Hyper-V doesn't expect us to pass naked EPTP, only PML4 pointer should be used. Strip off EPT configuration information before calling into vmx_hv_remote_flush_tlb(). Fixes: 877ad952be3d ("KVM: vmx: Add tlb_remote_flush callback support") Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit f8ccb14fd6c9f58ef766062b7e3929c423580f09 Author: Richard Weinberger Date: Sat Oct 13 10:18:41 2018 +0200 ubifs: Fix WARN_ON logic in exit path ubifs_assert() is not WARN_ON(), so we have to invert the checks. Randy faced this warning with UBIFS being a module, since most users use UBIFS as builtin because UBIFS is the rootfs nobody noticed so far. :-( Including me. Reported-by: Randy Dunlap Fixes: 54169ddd382d ("ubifs: Turn two ubifs_assert() into a WARN_ON()") Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman commit 79fc170b1f5c36f486d886bfbd59eb4e62321128 Merge: cafa017dc5df ac081c3be3fa Author: Greg Kroah-Hartman Date: Sat Oct 13 09:31:19 2018 +0200 Merge branch 'akpm' Fixes from Andrew: * akpm: fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters() mm/thp: fix call to mmu_notifier in set_pmd_migration_entry() v2 mm/mmap.c: don't clobber partially overlapping VMA with MAP_FIXED_NOREPLACE ocfs2: fix a GCC warning commit ac081c3be3fae6d0cc3e1862507fca3862d30b67 Author: Khazhismel Kumykov Date: Fri Oct 12 21:34:40 2018 -0700 fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters() On non-preempt kernels this loop can take a long time (more than 50 ticks) processing through entries. Link: http://lkml.kernel.org/r/20181010172623.57033-1-khazhy@google.com Signed-off-by: Khazhismel Kumykov Acked-by: OGAWA Hirofumi Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit bfba8e5cf28f413aa05571af493871d74438979f Author: Jérôme Glisse Date: Fri Oct 12 21:34:36 2018 -0700 mm/thp: fix call to mmu_notifier in set_pmd_migration_entry() v2 Inside set_pmd_migration_entry() we are holding page table locks and thus we can not sleep so we can not call invalidate_range_start/end() So remove call to mmu_notifier_invalidate_range_start/end() because they are call inside the function calling set_pmd_migration_entry() (see try_to_unmap_one()). Link: http://lkml.kernel.org/r/20181012181056.7864-1-jglisse@redhat.com Signed-off-by: Jérôme Glisse Reported-by: Andrea Arcangeli Reviewed-by: Zi Yan Acked-by: Michal Hocko Cc: Greg Kroah-Hartman Cc: Kirill A. Shutemov Cc: "H. Peter Anvin" Cc: Anshuman Khandual Cc: Dave Hansen Cc: David Nellans Cc: Ingo Molnar Cc: Mel Gorman Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Thomas Gleixner Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 7aa867dd89526e9cfd9714d8b9b587c016eaea34 Author: Jann Horn Date: Fri Oct 12 21:34:32 2018 -0700 mm/mmap.c: don't clobber partially overlapping VMA with MAP_FIXED_NOREPLACE Daniel Micay reports that attempting to use MAP_FIXED_NOREPLACE in an application causes that application to randomly crash. The existing check for handling MAP_FIXED_NOREPLACE looks up the first VMA that either overlaps or follows the requested region, and then bails out if that VMA overlaps *the start* of the requested region. It does not bail out if the VMA only overlaps another part of the requested region. Fix it by checking that the found VMA only starts at or after the end of the requested region, in which case there is no overlap. Test case: user@debian:~$ cat mmap_fixed_simple.c #include #include #include #include #include #ifndef MAP_FIXED_NOREPLACE #define MAP_FIXED_NOREPLACE 0x100000 #endif int main(void) { char *p; errno = 0; p = mmap((void*)0x10001000, 0x4000, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED_NOREPLACE, -1, 0); printf("p1=%p err=%m\n", p); errno = 0; p = mmap((void*)0x10000000, 0x2000, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED_NOREPLACE, -1, 0); printf("p2=%p err=%m\n", p); char cmd[100]; sprintf(cmd, "cat /proc/%d/maps", getpid()); system(cmd); return 0; } user@debian:~$ gcc -o mmap_fixed_simple mmap_fixed_simple.c user@debian:~$ ./mmap_fixed_simple p1=0x10001000 err=Success p2=0x10000000 err=Success 10000000-10002000 r--p 00000000 00:00 0 10002000-10005000 ---p 00000000 00:00 0 564a9a06f000-564a9a070000 r-xp 00000000 fe:01 264004 /home/user/mmap_fixed_simple 564a9a26f000-564a9a270000 r--p 00000000 fe:01 264004 /home/user/mmap_fixed_simple 564a9a270000-564a9a271000 rw-p 00001000 fe:01 264004 /home/user/mmap_fixed_simple 564a9a54a000-564a9a56b000 rw-p 00000000 00:00 0 [heap] 7f8eba447000-7f8eba5dc000 r-xp 00000000 fe:01 405885 /lib/x86_64-linux-gnu/libc-2.24.so 7f8eba5dc000-7f8eba7dc000 ---p 00195000 fe:01 405885 /lib/x86_64-linux-gnu/libc-2.24.so 7f8eba7dc000-7f8eba7e0000 r--p 00195000 fe:01 405885 /lib/x86_64-linux-gnu/libc-2.24.so 7f8eba7e0000-7f8eba7e2000 rw-p 00199000 fe:01 405885 /lib/x86_64-linux-gnu/libc-2.24.so 7f8eba7e2000-7f8eba7e6000 rw-p 00000000 00:00 0 7f8eba7e6000-7f8eba809000 r-xp 00000000 fe:01 405876 /lib/x86_64-linux-gnu/ld-2.24.so 7f8eba9e9000-7f8eba9eb000 rw-p 00000000 00:00 0 7f8ebaa06000-7f8ebaa09000 rw-p 00000000 00:00 0 7f8ebaa09000-7f8ebaa0a000 r--p 00023000 fe:01 405876 /lib/x86_64-linux-gnu/ld-2.24.so 7f8ebaa0a000-7f8ebaa0b000 rw-p 00024000 fe:01 405876 /lib/x86_64-linux-gnu/ld-2.24.so 7f8ebaa0b000-7f8ebaa0c000 rw-p 00000000 00:00 0 7ffcc99fa000-7ffcc9a1b000 rw-p 00000000 00:00 0 [stack] 7ffcc9b44000-7ffcc9b47000 r--p 00000000 00:00 0 [vvar] 7ffcc9b47000-7ffcc9b49000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] user@debian:~$ uname -a Linux debian 4.19.0-rc6+ #181 SMP Wed Oct 3 23:43:42 CEST 2018 x86_64 GNU/Linux user@debian:~$ As you can see, the first page of the mapping at 0x10001000 was clobbered. Link: http://lkml.kernel.org/r/20181010152736.99475-1-jannh@google.com Fixes: a4ff8e8620d3 ("mm: introduce MAP_FIXED_NOREPLACE") Signed-off-by: Jann Horn Reported-by: Daniel Micay Acked-by: Michal Hocko Acked-by: John Hubbard Acked-by: Kees Cook Acked-by: Vlastimil Babka Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 1cff514a5101d514900f0e94613402d8a18359e6 Author: zhong jiang Date: Fri Oct 12 21:34:26 2018 -0700 ocfs2: fix a GCC warning Fix the following compile warning: fs/ocfs2/dlmglue.c:99:30: warning: ‘lockdep_keys’ defined but not used [-Wunused-variable] static struct lock_class_key lockdep_keys[OCFS2_NUM_LOCK_TYPES]; Link: http://lkml.kernel.org/r/1536938148-32110-1-git-send-email-zhongjiang@huawei.com Signed-off-by: zhong jiang Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit cafa017dc5df8abc38308fedae3f1bd7ff67802d Merge: ed66c252d916 5e65a20341e0 Author: Greg Kroah-Hartman Date: Sat Oct 13 09:07:23 2018 +0200 Merge tag 'for-linus-20181012' of git://git.kernel.dk/linux-block Jens writes: "block fix for 4.19-rc Just a single fix that should go in, fixing a regression introduced in the blk-wbt code." * tag 'for-linus-20181012' of git://git.kernel.dk/linux-block: blk-wbt: wake up all when we scale up, not down commit ed66c252d9169698b1052d5e3dc7b7764adb20b9 Merge: e66d001c454b fee5150c484c Author: Greg Kroah-Hartman Date: Sat Oct 13 09:06:27 2018 +0200 Merge tag 'gfs2-4.19.fixes3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Andreas writes: "gfs2 4.19 fixes Fix iomap buffered write support for journaled files" * tag 'gfs2-4.19.fixes3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Fix iomap buffered write support for journaled files (2) commit e66d001c454b9ac8d7b809e84f457b98def209a1 Merge: bab5c80b2110 ca2b497253ad Author: Greg Kroah-Hartman Date: Sat Oct 13 09:05:37 2018 +0200 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Will writes: "More arm64 fixes - Reject CHAIN PMU events when they are not part of a 64-bit counter - Fix WARN_ON_ONCE() that triggers for reserved regions that don't correspond to mapped memory" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: perf: Reject stand-alone CHAIN events for PMUv3 arm64: Fix /proc/iomem for reserved but not memory regions commit 455adb3174d2c8518cef1a61140c211f6ac224d2 Author: David S. Miller Date: Fri Oct 12 10:33:20 2018 -0700 sparc: Throttle perf events properly. Like x86 and arm, call perf_sample_event_took() in perf event NMI interrupt handler. Signed-off-by: David S. Miller commit cfdc3170d214046b9509183fe9b9544dc644d40b Author: David S. Miller Date: Fri Oct 12 10:31:58 2018 -0700 sparc: Fix single-pcr perf event counter management. It is important to clear the hw->state value for non-stopped events when they are added into the PMU. Otherwise when the event is scheduled out, we won't read the counter because HES_UPTODATE is still set. This breaks 'perf stat' and similar use cases, causing all the events to show zero. This worked for multi-pcr because we make explicit sparc_pmu_start() calls in calculate_multiple_pcrs(). calculate_single_pcr() doesn't do this because the idea there is to accumulate all of the counter settings into the single pcr value. So we have to add explicit hw->state handling there. Like x86, we use the PERF_HES_ARCH bit to track truly stopped events so that we don't accidently start them on a reload. Related to all of this, sparc_pmu_start() is missing a userpage update so add it. Signed-off-by: David S. Miller commit bab5c80b211035739997ebd361a679fa85b39465 Merge: f014ffb025c1 3f4258bbe036 Author: Greg Kroah-Hartman Date: Fri Oct 12 17:41:27 2018 +0200 Merge tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Arnd writes: "ARM: SoC fixes for 4.19 Two last minute bugfixes, both for NXP platforms: * The Layerscape 'qbman' infrastructure suffers from probe ordering bugs in some configurations, a two-patch series adds a hotfix for this. 4.20 will have a longer set of patches to rework it. * The old imx53-qsb board regressed in 4.19 after the addition of cpufreq support, adding a set of explicit operating points fixes this." * tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: soc: fsl: qman_portals: defer probe after qman's probe soc: fsl: qbman: add APIs to retrieve the probing status ARM: dts: imx53-qsb: disable 1.2GHz OPP commit f014ffb025c159fd51d19af8af0022a991aaa4f8 Author: David Howells Date: Fri Oct 12 14:00:57 2018 +0100 afs: Fix afs_server struct leak Fix a leak of afs_server structs. The routine that installs them in the various lookup lists and trees gets a ref on leaving the function, whether it added the server or a server already exists. It shouldn't increment the refcount if it added the server. The effect of this that "rmmod kafs" will hang waiting for the leaked server to become unused. Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation") Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman commit b40afc0066405e5ecfce73949b56ddd6bb65bd10 Author: Peter Rosin Date: Fri Oct 12 14:46:46 2018 +0000 MAINTAINERS: use the correct location for dt-bindings includes for mux Just drop the "linux" part of the path, it was never correct. Reported-by: Joe Perches Fixes: 256ac0375098 ("dt-bindings: document devicetree bindings for mux-controllers and gpio-mux") Signed-off-by: Peter Rosin Signed-off-by: Greg Kroah-Hartman commit 38a12607a82f3cba4149d36cc54695bd33f5ce04 Author: Peter Rosin Date: Fri Oct 12 14:46:40 2018 +0000 mux: adgs1408: use the correct MODULE_LICENSE The file is GPL v2 or later. Acked-by: Mircea Caprioru Signed-off-by: Peter Rosin Signed-off-by: Greg Kroah-Hartman commit fee5150c484c75c473dc1e2d07cb6151384ef85f Author: Andreas Gruenbacher Date: Wed Oct 10 21:18:18 2018 +0100 gfs2: Fix iomap buffered write support for journaled files (2) It turns out that the fix in commit 6636c3cc56 is bad; the assertion that the iomap code no longer creates buffer heads is incorrect for filesystems that set the IOMAP_F_BUFFER_HEAD flag. Instead, what's happening is that gfs2_iomap_begin_write treats all files that have the jdata flag set as journaled files, which is incorrect as long as those files are inline ("stuffed"). We're handling stuffed files directly via the page cache, which is why we ended up with pages without buffer heads in gfs2_page_add_databufs. Fix this by handling stuffed journaled files correctly in gfs2_iomap_begin_write. This reverts commit 6636c3cc5690c11631e6366cf9a28fb99c8b25bb. Signed-off-by: Andreas Gruenbacher commit ca2b497253ad01c80061a1f3ee9eb91b5d54a849 Author: Will Deacon Date: Fri Oct 5 13:24:36 2018 +0100 arm64: perf: Reject stand-alone CHAIN events for PMUv3 It doesn't make sense for a perf event to be configured as a CHAIN event in isolation, so extend the arm_pmu structure with a ->filter_match() function to allow the backend PMU implementation to reject CHAIN events early. Cc: Reviewed-by: Suzuki K Poulose Signed-off-by: Will Deacon commit d91680e687f47984ffd3200c8e5d587903e7bd11 Author: Will Deacon Date: Thu Oct 11 11:29:14 2018 +0100 arm64: Fix /proc/iomem for reserved but not memory regions We describe ranges of 'reserved' memory to userspace via /proc/iomem. Commit 50d7ba36b916 ("arm64: export memblock_reserve()d regions via /proc/iomem") updated the logic to export regions that were reserved because their contents should be preserved. This allowed kexec-tools to tell the difference between 'reserved' memory that must be preserved and not overwritten, (e.g. the ACPI tables), and 'nomap' memory that must not be touched without knowing the memory-attributes (e.g. RAS CPER regions). The above commit wrongly assumed that memblock_reserve() would not be used to reserve regions that aren't memory. It turns out this is exactly what early_init_dt_reserve_memory_arch() will do if it finds a DT reserved-memory that was also carved out of the memory node, which results in a WARN_ON_ONCE() and the region being reserved instead of ignored. The ramoops description on hikey and dragonboard-410c both do this, so we can't simply write this configuration off as "buggy firmware". Avoid this issue by rewriting reserve_memblock_reserved_regions() so that only the portions of reserved regions which overlap with mapped memory are actually reserved. Fixes: 50d7ba36b916 ("arm64: export memblock_reserve()d regions via /proc/iomem") Reported-by: John Stultz Reported-by: Paolo Pisati CC: Akashi Takahiro CC: Ard Biesheuvel Reviewed-by: James Morse Signed-off-by: Will Deacon commit 6b3944e42e2e554aa5a4be681ecd70dccd459114 Author: David Howells Date: Thu Oct 11 22:45:49 2018 +0100 afs: Fix cell proc list Access to the list of cells by /proc/net/afs/cells has a couple of problems: (1) It should be checking against SEQ_START_TOKEN for the keying the header line. (2) It's only holding the RCU read lock, so it can't just walk over the list without following the proper RCU methods. Fix these by using an hlist instead of an ordinary list and using the appropriate accessor functions to follow it with RCU. Since the code that adds a cell to the list must also necessarily change, sort the list on insertion whilst we're at it. Fixes: 989782dcdc91 ("afs: Overhaul cell database management") Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman commit 4ea07abbfbdadb10bc67c2b78dc2dbfafa4b1009 Merge: 60bd7be764e8 4f666675cdff Author: Greg Kroah-Hartman Date: Fri Oct 12 12:57:05 2018 +0200 Merge tag 'mmc-v4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Ulf writes: "MMC core: - Avoid fragile multiblock reads for the last sector in SPI mode WIFI/SDIO: - libertas: Fixup suspend sequence for the SDIO card" * tag 'mmc-v4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: libertas: call into generic suspend code before turning off power mmc: block: avoid multiblock reads for the last sector in SPI mode commit 60bd7be764e8adada97034b4836875b3e449bd7c Merge: ef0e75a47c4a 3e779a2e7f90 Author: Greg Kroah-Hartman Date: Fri Oct 12 12:56:25 2018 +0200 Merge tag 'gpio-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Linus writes: "GPIO fix for the v4.19 series: - Fix up the interrupt parent for the irqdomains." * tag 'gpio-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: Assign gpio_irq_chip::parents to non-stack pointer commit ef0e75a47c4ad518aa3c91bb6a86a329b890f263 Merge: a291ab2d40e9 f259f896f234 Author: Greg Kroah-Hartman Date: Fri Oct 12 12:55:47 2018 +0200 Merge tag 'pinctrl-v4.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Linus writes: "pin control fix for v4.19: A single pin control fix for v4.19: - Interrupt setup in the MCP23S08 driver." * tag 'pinctrl-v4.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: mcp23s08: fix irq and irqchip setup order commit a291ab2d40e97a5ae0c07bf62f04ad7c438f66d0 Merge: 62d2e531d7f3 f0fe77f601c3 Author: Greg Kroah-Hartman Date: Fri Oct 12 12:54:26 2018 +0200 Merge tag 'mtd/fixes-for-4.19-rc8' of git://git.infradead.org/linux-mtd Boris writes: "mdt: fix for 4.19-rc8 * Fix a stack overflow in lib/bch.c" * tag 'mtd/fixes-for-4.19-rc8' of git://git.infradead.org/linux-mtd: lib/bch: fix possible stack overrun commit 62d2e531d7f353a77356c461bac12a0dc23aff7c Merge: c789174bde28 5ba15878f23c Author: Greg Kroah-Hartman Date: Fri Oct 12 12:53:48 2018 +0200 Merge tag 'drm-fixes-2018-10-12-1' of git://anongit.freedesktop.org/drm/drm Dave writes: "drm fixes for 4.19-rc8 single nouveau runtime reference and mst change" * tag 'drm-fixes-2018-10-12-1' of git://anongit.freedesktop.org/drm/drm: drm/nouveau/drm/nouveau: Grab runtime PM ref in nv50_mstc_detect() commit c789174bde280c90bb8cdc680cf58a8f03fcdca0 Merge: eb81bfb224ce dd9a40349570 Author: Greg Kroah-Hartman Date: Fri Oct 12 12:53:06 2018 +0200 Merge tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Doug writes: "RDMA fixes: Final for-rc pull request for 4.19 We only have one bug to submit this time around. It fixes a DMA unmap issue where we unmapped the DMA address from the IOMMU before we did from the card, resulting in a DMAR error with IOMMU enabled, or possible crash without." * tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: IB/mlx5: Unmap DMA addr from HCA before IOMMU commit eb81bfb224ced3701bcc7b08f309665bf0549252 Merge: 0c53b6a5f82a cecf10704899 Author: Greg Kroah-Hartman Date: Fri Oct 12 12:35:02 2018 +0200 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Dmitry writes: "Input updates for v4.19-rc7 - we added a few scheduling points into various input interfaces to ensure that large writes will not cause RCU stalls - fixed configuring PS/2 keyboards as wakeup devices on newer platforms - added a new Xbox gamepad ID." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: uinput - add a schedule point in uinput_inject_events() Input: evdev - add a schedule point in evdev_write() Input: mousedev - add a schedule point in mousedev_write() Input: i8042 - enable keyboard wakeups by default when s2idle is used Input: xpad - add support for Xbox1 PDP Camo series gamepad commit 0c53b6a5f82a539b59cdd669c4a866238371fa23 Merge: 90ad18418c2d 52c8ee5bad8f Author: Greg Kroah-Hartman Date: Fri Oct 12 12:33:54 2018 +0200 Merge tag 'next-fixes-20181012' of git://git.kernel.org/pub/scm/linux/kernel/git/sfr/next-fixes Stephen writes: "A couple of warning fixes: Two fixes from Peter Oberparleiter : Commit 6b7dca401cb1 ("tracing: Allow gcov profiling on only ftrace subsystem") uncovered linker problems when using gcov kernel profiling on some architectures. These problems were likely introduced earlier, and are possibly related to compiler changes." * tag 'next-fixes-20181012' of git://git.kernel.org/pub/scm/linux/kernel/git/sfr/next-fixes: vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections vmlinux.lds.h: Fix incomplete .text.exit discards commit f0fe77f601c3d6a821198f88f7adb0a05b8fe03e Author: Arnd Bergmann Date: Thu Oct 11 13:06:17 2018 +0200 lib/bch: fix possible stack overrun The previous patch introduced very large kernel stack usage and a Makefile change to hide the warning about it. From what I can tell, a number of things went wrong here: - The BCH_MAX_T constant was set to the maximum value for 'n', not the maximum for 't', which is much smaller. - The stack usage is actually larger than the entire kernel stack on some architectures that can use 4KB stacks (m68k, sh, c6x), which leads to an immediate overrun. - The justification in the patch description claimed that nothing changed, however that is not the case even without the two points above: the configuration is machine specific, and most boards never use the maximum BCH_ECC_WORDS() length but instead have something much smaller. That maximum would only apply to machines that use both the maximum block size and the maximum ECC strength. The largest value for 't' that I could find is '32', which in turn leads to a 60 byte array instead of 2048 bytes. Making it '64' for future extension seems also worthwhile, with 120 bytes for the array. Anything larger won't fit into the OOB area on NAND flash. With that changed, the warning can be enabled again. Only linux-4.19+ contains the breakage, so this is only needed as a stable backport if it does not make it into the release. Fixes: 02361bc77888 ("lib/bch: Remove VLA usage") Reported-by: Ard Biesheuvel Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: Boris Brezillon commit 90ad18418c2d3db23ee827cdd74fed2ca9b70a18 Merge: 0778a9f2dd92 6b9bab550cac Author: Greg Kroah-Hartman Date: Fri Oct 12 09:01:59 2018 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net David writes: "Networking 1) RXRPC receive path fixes from David Howells. 2) Re-export __skb_recv_udp(), from Jiri Kosina. 3) Fix refcounting in u32 classificer, from Al Viro. 4) Userspace netlink ABI fixes from Eugene Syromiatnikov. 5) Don't double iounmap on rmmod in ena driver, from Arthur Kiyanovski. 6) Fix devlink string attribute handling, we must pull a copy into a kernel buffer if the lifetime extends past the netlink request. From Moshe Shemesh. 7) Fix hangs in RDS, from Ka-Cheong Poon. 8) Fix recursive locking lockdep warnings in tipc, from Ying Xue. 9) Clear RX irq correctly in socionext, from Ilias Apalodimas. 10) bcm_sf2 fixes from Florian Fainelli." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (38 commits) net: dsa: bcm_sf2: Call setup during switch resume net: dsa: bcm_sf2: Fix unbind ordering net: phy: sfp: remove sfp_mutex's definition r8169: set RX_MULTI_EN bit in RxConfig for 8168F-family chips net: socionext: clear rx irq correctly net/mlx4_core: Fix warnings during boot on driverinit param set failures tipc: eliminate possible recursive locking detected by LOCKDEP selftests: udpgso_bench.sh explicitly requires bash selftests: rtnetlink.sh explicitly requires bash. qmi_wwan: Added support for Gemalto's Cinterion ALASxx WWAN interface tipc: queue socket protocol error messages into socket receive buffer tipc: set link tolerance correctly in broadcast link net: ipv4: don't let PMTU updates increase route MTU net: ipv4: update fnhe_pmtu when first hop's MTU changes net/ipv6: stop leaking percpu memory in fib6 info rds: RDS (tcp) hangs on sendto() to unresponding address net: make skb_partial_csum_set() more robust against overflows devlink: Add helper function for safely copy string param devlink: Fix param cmode driverinit for string type devlink: Fix param set handling for string type ... commit 6b9bab550cac108d86c731c207e3e74ea10eb638 Merge: 052858663db3 54baca096386 Author: David S. Miller Date: Thu Oct 11 15:20:00 2018 -0700 Merge branch 'net-dsa-bcm_sf2-Couple-of-fixes' Florian Fainelli says: ==================== net: dsa: bcm_sf2: Couple of fixes Here are two fixes for the bcm_sf2 driver that were found during testing unbind and analysing another issue during system suspend/resume. ==================== Signed-off-by: David S. Miller commit 54baca096386d862d19c10f58f34bf787c6b3cbe Author: Florian Fainelli Date: Tue Oct 9 16:48:58 2018 -0700 net: dsa: bcm_sf2: Call setup during switch resume There is no reason to open code what the switch setup function does, in fact, because we just issued a switch reset, we would make all the register get their default values, including for instance, having unused port be enabled again and wasting power and leading to an inappropriate switch core clock being selected. Fixes: 8cfa94984c9c ("net: dsa: bcm_sf2: add suspend/resume callbacks") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit bf3b452b7af787b8bf27de6490dc4eedf6f97599 Author: Florian Fainelli Date: Tue Oct 9 16:48:57 2018 -0700 net: dsa: bcm_sf2: Fix unbind ordering The order in which we release resources is unfortunately leading to bus errors while dismantling the port. This is because we set priv->wol_ports_mask to 0 to tell bcm_sf2_sw_suspend() that it is now permissible to clock gate the switch. Later on, when dsa_slave_destroy() comes in from dsa_unregister_switch() and calls dsa_switch_ops::port_disable, we perform the same dismantling again, and this time we hit registers that are clock gated. Make sure that dsa_unregister_switch() is the first thing that happens, which takes care of releasing all user visible resources, then proceed with clock gating hardware. We still need to set priv->wol_ports_mask to 0 to make sure that an enabled port properly gets disabled in case it was previously used as part of Wake-on-LAN. Fixes: d9338023fb8e ("net: dsa: bcm_sf2: Make it a real platform device driver") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 52c8ee5bad8f33d02c567f6609f43d69303fc48d Author: Peter Oberparleiter Date: Thu Sep 13 13:00:00 2018 +0200 vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections Enabling both CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y and CONFIG_GCOV_PROFILE_ALL=y results in linker warnings: warning: orphan section `.data..LPBX1' being placed in section `.data..LPBX1'. LD_DEAD_CODE_DATA_ELIMINATION adds compiler flag -fdata-sections. This option causes GCC to create separate data sections for data objects, including those generated by GCC internally for gcov profiling. The names of these objects start with a dot (.LPBX0, .LPBX1), resulting in section names starting with 'data..'. As section names starting with 'data..' are used for specific purposes in the Linux kernel, the linker script does not automatically include them in the output data section, resulting in the "orphan section" linker warnings. Fix this by specifically including sections named "data..LPBX*" in the data section. Reported-by: Stephen Rothwell Tested-by: Stephen Rothwell Tested-by: Arnd Bergmann Acked-by: Arnd Bergmann Signed-off-by: Peter Oberparleiter Signed-off-by: Stephen Rothwell commit 8dcf86caa1e3daf4a6ccf38e97f4f752b411f829 Author: Peter Oberparleiter Date: Thu Sep 13 12:59:59 2018 +0200 vmlinux.lds.h: Fix incomplete .text.exit discards Enabling CONFIG_GCOV_PROFILE_ALL=y causes linker errors on ARM: `.text.exit' referenced in section `.ARM.exidx.text.exit': defined in discarded section `.text.exit' `.text.exit' referenced in section `.fini_array.00100': defined in discarded section `.text.exit' And related errors on NDS32: `.text.exit' referenced in section `.dtors.65435': defined in discarded section `.text.exit' The gcov compiler flags cause certain compiler versions to generate additional destructor-related sections that are not yet handled by the linker script, resulting in references between discarded and non-discarded sections. Since destructors are not used in the Linux kernel, fix this by discarding these additional sections. Reported-by: Arnd Bergmann Tested-by: Arnd Bergmann Acked-by: Arnd Bergmann Reported-by: Greentime Hu Tested-by: Masami Hiramatsu Signed-off-by: Peter Oberparleiter Signed-off-by: Stephen Rothwell commit 34d1b82cd198379545ca634119e296fce06252aa Author: Stephen Boyd Date: Mon Oct 8 07:55:20 2018 -0700 i2c: Fix kerneldoc for renamed i2c dma put function This function was renamed in commit 82fe39a6bc7b ("i2c: refactor function to release a DMA safe buffer") but this kernel doc wasn't updated to point at the new function. Rename it. Fixes: 82fe39a6bc7b ("i2c: refactor function to release a DMA safe buffer") Signed-off-by: Stephen Boyd Signed-off-by: Wolfram Sang commit 5e65a20341e02df637d1c16cd487858d2c6a876a Author: Josef Bacik Date: Thu Oct 11 15:29:30 2018 -0400 blk-wbt: wake up all when we scale up, not down Tetsuo brought to my attention that I screwed up the scale_up/scale_down helpers when I factored out the rq-qos code. We need to wake up all the waiters when we add slots for requests to make, not when we shrink the slots. Otherwise we'll end up things waiting forever. This was a mistake and simply puts everything back the way it was. cc: stable@vger.kernel.org Fixes: a79050434b45 ("blk-rq-qos: refactor out common elements of blk-wbt") eported-by: Tetsuo Handa Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 052858663db31bd1ead76744df5d39d8bb703c77 Author: Sebastian Andrzej Siewior Date: Thu Oct 11 17:06:21 2018 +0200 net: phy: sfp: remove sfp_mutex's definition The sfp_mutex variable is defined but never used in this file. Not even in the commit that introduced that variable. Remove sfp_mutex, it has no purpose. Cc: Andrew Lunn Cc: Florian Fainelli Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 511cfd580f23b0e0fcd5659931ef14c6e2c062b0 Author: Maciej S. Szmigiero Date: Thu Oct 11 16:02:10 2018 +0200 r8169: set RX_MULTI_EN bit in RxConfig for 8168F-family chips It has been reported that since commit 05212ba8132b42 ("r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices") at least RTL_GIGA_MAC_VER_38 NICs work erratically after a resume from suspend. The problem has been traced to a missing RX_MULTI_EN bit in the RxConfig register. We already set this bit for RTL_GIGA_MAC_VER_35 NICs of the same 8168F chip family so let's do it also for its other siblings: RTL_GIGA_MAC_VER_36 and RTL_GIGA_MAC_VER_38. Curiously, the NIC seems to work fine after a system boot without having this bit set as long as the system isn't suspended and resumed. Fixes: 05212ba8132b42 ("r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices") Reported-by: Chris Clayton Signed-off-by: Maciej S. Szmigiero Reviewed-by: Heiner Kallweit Tested-by: Chris Clayton Signed-off-by: David S. Miller commit 2a1e89df785082a0fd7264ca6d3d834abe84fa25 Author: Ilias Apalodimas Date: Thu Oct 11 15:28:26 2018 +0300 net: socionext: clear rx irq correctly commit 63ae7949e94a ("net: socionext: Use descriptor info instead of MMIO reads on Rx") removed constant mmio reads from the driver and started using a descriptor field to check if packet should be processed. This lead the napi rx handler being constantly called while no packets needed processing and ksoftirq getting 100% cpu usage. Issue one mmio read to clear the irq correcty after processing packets Signed-off-by: Ilias Apalodimas Reported-by: Ard Biesheuvel Tested-by: Ard Biesheuvel Acked-by: Ard Biesheuvel Signed-off-by: David S. Miller commit 26450608348e91a782691dbfcc836478f4381071 Author: Moshe Shemesh Date: Thu Oct 11 15:01:19 2018 +0300 net/mlx4_core: Fix warnings during boot on driverinit param set failures During boot, mlx4_core sets the driverinit configuration parameters and updates the devlink module on the initial values calling devlink_param_driverinit_value_set(). If devlink_param_driverinit_value_set() returns an error mlx4_core reports kernel module warning. This caused false alarm during boot in case kernel was compiled with CONFIG_NET_DEVLINK off. Fix by removing warning reported in case devlink_param_driverinit_value_set() fails. This actually makes the function mlx4_devlink_set_init_value() redundant to using directly devlink_param_driverinit_value_set() and so removed. It fixes the following kernel trace: mlx4_core 0000:00:06.0: devlink set parameter 0 value failed (err = -95) mlx4_core 0000:00:06.0: devlink set parameter 1 value failed (err = -95) mlx4_core 0000:00:06.0: devlink set parameter 4 value failed (err = -95) mlx4_core 0000:00:06.0: devlink set parameter 5 value failed (err = -95) mlx4_core 0000:00:06.0: devlink set parameter 3 value failed (err = -95) Fixes: bd1b51dc66df ("mlx4: Add mlx4 initial parameters table and register it") Signed-off-by: Moshe Shemesh Signed-off-by: Tariq Toukan Signed-off-by: David S. Miller commit 0778a9f2dd924c3af41971ba40eec44793aea531 Merge: e5337178f702 479adb89a97b Author: Greg Kroah-Hartman Date: Thu Oct 11 19:24:01 2018 +0200 Merge branch 'for-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Tejun writes: "cgroup fixes for v4.19-rc7 One cgroup2 threaded mode fix for v4.19-rc7. While threaded mode isn't used widely (yet) and the bug requires somewhat convoluted sequence of operations, it causes a userland visible malfunction - EINVAL on a valid attempt to enable threaded mode. This pull request contains the fix" * 'for-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Fix dom_cgrp propagation when enabling threaded mode commit a1f8dd34e64af689e95122921fb2ca83dedd4c4e Author: Ying Xue Date: Thu Oct 11 19:57:56 2018 +0800 tipc: eliminate possible recursive locking detected by LOCKDEP When booting kernel with LOCKDEP option, below warning info was found: WARNING: possible recursive locking detected 4.19.0-rc7+ #14 Not tainted -------------------------------------------- swapper/0/1 is trying to acquire lock: 00000000dcfc0fc8 (&(&list->lock)->rlock#4){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline] 00000000dcfc0fc8 (&(&list->lock)->rlock#4){+...}, at: tipc_link_reset+0x125/0xdf0 net/tipc/link.c:850 but task is already holding lock: 00000000cbb9b036 (&(&list->lock)->rlock#4){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline] 00000000cbb9b036 (&(&list->lock)->rlock#4){+...}, at: tipc_link_reset+0xfa/0xdf0 net/tipc/link.c:849 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&(&list->lock)->rlock#4); lock(&(&list->lock)->rlock#4); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by swapper/0/1: #0: 00000000f7539d34 (pernet_ops_rwsem){+.+.}, at: register_pernet_subsys+0x19/0x40 net/core/net_namespace.c:1051 #1: 00000000cbb9b036 (&(&list->lock)->rlock#4){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline] #1: 00000000cbb9b036 (&(&list->lock)->rlock#4){+...}, at: tipc_link_reset+0xfa/0xdf0 net/tipc/link.c:849 stack backtrace: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.0-rc7+ #14 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1af/0x295 lib/dump_stack.c:113 print_deadlock_bug kernel/locking/lockdep.c:1759 [inline] check_deadlock kernel/locking/lockdep.c:1803 [inline] validate_chain kernel/locking/lockdep.c:2399 [inline] __lock_acquire+0xf1e/0x3c60 kernel/locking/lockdep.c:3411 lock_acquire+0x1db/0x520 kernel/locking/lockdep.c:3900 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:168 spin_lock_bh include/linux/spinlock.h:334 [inline] tipc_link_reset+0x125/0xdf0 net/tipc/link.c:850 tipc_link_bc_create+0xb5/0x1f0 net/tipc/link.c:526 tipc_bcast_init+0x59b/0xab0 net/tipc/bcast.c:521 tipc_init_net+0x472/0x610 net/tipc/core.c:82 ops_init+0xf7/0x520 net/core/net_namespace.c:129 __register_pernet_operations net/core/net_namespace.c:940 [inline] register_pernet_operations+0x453/0xac0 net/core/net_namespace.c:1011 register_pernet_subsys+0x28/0x40 net/core/net_namespace.c:1052 tipc_init+0x83/0x104 net/tipc/core.c:140 do_one_initcall+0x109/0x70a init/main.c:885 do_initcall_level init/main.c:953 [inline] do_initcalls init/main.c:961 [inline] do_basic_setup init/main.c:979 [inline] kernel_init_freeable+0x4bd/0x57f init/main.c:1144 kernel_init+0x13/0x180 init/main.c:1063 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 The reason why the noise above was complained by LOCKDEP is because we nested to hold l->wakeupq.lock and l->inputq->lock in tipc_link_reset function. In fact it's unnecessary to move skb buffer from l->wakeupq queue to l->inputq queue while holding the two locks at the same time. Instead, we can move skb buffers in l->wakeupq queue to a temporary list first and then move the buffers of the temporary list to l->inputq queue, which is also safe for us. Fixes: 3f32d0be6c16 ("tipc: lock wakeup & inputq at tipc_link_reset()") Reported-by: Dmitry Vyukov Signed-off-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: David S. Miller commit e5337178f7023bd06a39c06e1fab88817559c0f3 Merge: 834d3cd294ab 5318321d367c Author: Greg Kroah-Hartman Date: Thu Oct 11 19:23:07 2018 +0200 Merge tag 'kbuild-fixes-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Masahiro writes: "Kbuild fixes for v4.19 (2nd) - Fix warnings from recordmcount.pl when building with Clang - Allow Clang to use GNU toolchains correctly - Disable CONFIG_SAMPLES for UML to avoid build error" * tag 'kbuild-fixes-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: samples: disable CONFIG_SAMPLES for UML kbuild: allow to use GCC toolchain not in Clang search path ftrace: Build with CPPFLAGS to get -Qunused-arguments commit 26b1f4cb9150ac9662063a3bdc3c0a44bf622981 Merge: 4f7617705bff 12a2ea962c06 Author: David S. Miller Date: Thu Oct 11 10:19:46 2018 -0700 Merge branch 'net-explicitly-requires-bash-when-needed' Paolo Abeni says: ==================== net: explicitly requires bash when needed. Some test scripts require bash-only features but use the default shell. This may cause random failures if the default shell is not bash. Instead of doing a potentially complex rewrite of such scripts, these patches require the bash interpreter, where needed. ==================== Signed-off-by: David S. Miller commit 12a2ea962c06efb30764c47b140d2ec9d3cd7cb0 Author: Paolo Abeni Date: Thu Oct 11 10:54:53 2018 +0200 selftests: udpgso_bench.sh explicitly requires bash The udpgso_bench.sh script requires several bash-only features. This may cause random failures if the default shell is not bash. Address the above explicitly requiring bash as the script interpreter Fixes: 3a687bef148d ("selftests: udp gso benchmark") Signed-off-by: Paolo Abeni Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 3c718e677c2b35b449992adc36ecce883c467e98 Author: Paolo Abeni Date: Thu Oct 11 10:54:52 2018 +0200 selftests: rtnetlink.sh explicitly requires bash. the script rtnetlink.sh requires a bash-only features (sleep with sub-second precision). This may cause random test failure if the default shell is not bash. Address the above explicitly requiring bash as the script interpreter. Fixes: 33b01b7b4f19 ("selftests: add rtnetlink test script") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 834d3cd294abd9ad81c6cbaefdda28aa491ceb06 Merge: 9f203e2f2f06 329e09893909 Author: Greg Kroah-Hartman Date: Thu Oct 11 19:10:30 2018 +0200 Merge tag 'alloc-args-v4.19-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Kees writes: "Fix open-coded multiplication arguments to allocators - Fixes several new open-coded multiplications added in the 4.19 merge window." * tag 'alloc-args-v4.19-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: treewide: Replace more open-coded allocation size multiplications commit 94aafb74cee0002e2f2eb6dc5376f54d5951ab4d Author: Jiri Olsa Date: Wed Oct 10 10:03:39 2018 +0200 perf vendor events intel: Fix wrong filter_band* values for uncore events Michael reported that he could not stat following event: $ perf stat -e unc_p_freq_ge_1200mhz_cycles -a -- ls event syntax error: '..e_1200mhz_cycles' \___ value too big for format, maximum is 255 Run 'perf list' for a list of valid events The event is unwrapped into: uncore_pcu/event=0xb,filter_band0=1200/ where filter_band0 format says it's one byte only: # cat uncore_pcu/format/filter_band0 config1:0-7 while JSON files specifies bigger number: "Filter": "filter_band0=1200", all the filter_band* formats show 1 byte width: # cat uncore_pcu/format/filter_band1 config1:8-15 # cat uncore_pcu/format/filter_band2 config1:16-23 # cat uncore_pcu/format/filter_band3 config1:24-31 The reason of the issue is that filter_band* values are supposed to be in 100Mhz units.. it's stated in the JSON help for the events, like: filter_band3=XXX, with XXX in 100Mhz units This patch divides the filter_band* values by 100, plus there's couple of changes that actually change the number completely, like: - "Filter": "edge=1,filter_band2=4000", + "Filter": "edge=1,filter_band2=30", Reported-by: Michael Petlan Signed-off-by: Jiri Olsa Acked-by: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181010080339.GB15790@krava Signed-off-by: Arnaldo Carvalho de Melo commit 9dffff200fd178f11dd50eb1fd8ccd0650c9284e Author: Florian Westphal Date: Wed Oct 10 18:02:21 2018 +0200 xfrm: policy: use hlist rcu variants on insert bydst table/list lookups use rcu, so insertions must use rcu versions. Fixes: a7c44247f704e ("xfrm: policy: make xfrm_policy_lookup_bytype lockless") Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit 9f7e43da6ae4862b48bac233838ba808c1167a0d Author: Alexei Starovoitov Date: Tue Oct 9 09:59:36 2018 -0700 net/xfrm: fix out-of-bounds packet access BUG: KASAN: slab-out-of-bounds in _decode_session6+0x1331/0x14e0 net/ipv6/xfrm6_policy.c:161 Read of size 1 at addr ffff8801d882eec7 by task syz-executor1/6667 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x30d mm/kasan/report.c:412 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430 _decode_session6+0x1331/0x14e0 net/ipv6/xfrm6_policy.c:161 __xfrm_decode_session+0x71/0x140 net/xfrm/xfrm_policy.c:2299 xfrm_decode_session include/net/xfrm.h:1232 [inline] vti6_tnl_xmit+0x3c3/0x1bc1 net/ipv6/ip6_vti.c:542 __netdev_start_xmit include/linux/netdevice.h:4313 [inline] netdev_start_xmit include/linux/netdevice.h:4322 [inline] xmit_one net/core/dev.c:3217 [inline] dev_hard_start_xmit+0x272/0xc10 net/core/dev.c:3233 __dev_queue_xmit+0x2ab2/0x3870 net/core/dev.c:3803 dev_queue_xmit+0x17/0x20 net/core/dev.c:3836 Reported-by: syzbot+acffccec848dc13fe459@syzkaller.appspotmail.com Reported-by: Eric Dumazet Signed-off-by: Alexei Starovoitov Signed-off-by: Steffen Klassert commit baa9be4ffb55876923dc9716abc0a448e510ba30 Author: Phil Auld Date: Mon Oct 8 10:36:40 2018 -0400 sched/fair: Fix throttle_list starvation with low CFS quota With a very low cpu.cfs_quota_us setting, such as the minimum of 1000, distribute_cfs_runtime may not empty the throttled_list before it runs out of runtime to distribute. In that case, due to the change from c06f04c7048 to put throttled entries at the head of the list, later entries on the list will starve. Essentially, the same X processes will get pulled off the list, given CPU time and then, when expired, get put back on the head of the list where distribute_cfs_runtime will give runtime to the same set of processes leaving the rest. Fix the issue by setting a bit in struct cfs_bandwidth when distribute_cfs_runtime is running, so that the code in throttle_cfs_rq can decide to put the throttled entry on the tail or the head of the list. The bit is set/cleared by the callers of distribute_cfs_runtime while they hold cfs_bandwidth->lock. This is easy to reproduce with a handful of CPU consumers. I use 'crash' on the live system. In some cases you can simply look at the throttled list and see the later entries are not changing: crash> list cfs_rq.throttled_list -H 0xffff90b54f6ade40 -s cfs_rq.runtime_remaining | paste - - | awk '{print $1" "$4}' | pr -t -n3 1 ffff90b56cb2d200 -976050 2 ffff90b56cb2cc00 -484925 3 ffff90b56cb2bc00 -658814 4 ffff90b56cb2ba00 -275365 5 ffff90b166a45600 -135138 6 ffff90b56cb2da00 -282505 7 ffff90b56cb2e000 -148065 8 ffff90b56cb2fa00 -872591 9 ffff90b56cb2c000 -84687 10 ffff90b56cb2f000 -87237 11 ffff90b166a40a00 -164582 crash> list cfs_rq.throttled_list -H 0xffff90b54f6ade40 -s cfs_rq.runtime_remaining | paste - - | awk '{print $1" "$4}' | pr -t -n3 1 ffff90b56cb2d200 -994147 2 ffff90b56cb2cc00 -306051 3 ffff90b56cb2bc00 -961321 4 ffff90b56cb2ba00 -24490 5 ffff90b166a45600 -135138 6 ffff90b56cb2da00 -282505 7 ffff90b56cb2e000 -148065 8 ffff90b56cb2fa00 -872591 9 ffff90b56cb2c000 -84687 10 ffff90b56cb2f000 -87237 11 ffff90b166a40a00 -164582 Sometimes it is easier to see by finding a process getting starved and looking at the sched_info: crash> task ffff8eb765994500 sched_info PID: 7800 TASK: ffff8eb765994500 CPU: 16 COMMAND: "cputest" sched_info = { pcount = 8, run_delay = 697094208, last_arrival = 240260125039, last_queued = 240260327513 }, crash> task ffff8eb765994500 sched_info PID: 7800 TASK: ffff8eb765994500 CPU: 16 COMMAND: "cputest" sched_info = { pcount = 8, run_delay = 697094208, last_arrival = 240260125039, last_queued = 240260327513 }, Signed-off-by: Phil Auld Reviewed-by: Ben Segall Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: stable@vger.kernel.org Fixes: c06f04c70489 ("sched: Fix potential near-infinite distribute_cfs_runtime() loop") Link: http://lkml.kernel.org/r/20181008143639.GA4019@pauld.bos.csb Signed-off-by: Ingo Molnar commit 9f203e2f2f065cd74553e6474f0ae3675f39fb0f Merge: a22dd3629e25 184d47f0fd36 Author: Greg Kroah-Hartman Date: Thu Oct 11 12:28:23 2018 +0200 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "x86 fixes An intel_rdt memory access fix and a VLA fix in pgd_alloc()." * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Avoid VLA in pgd_alloc() x86/intel_rdt: Fix out-of-bounds memory access in CBM tests commit a22dd3629e257e5db51ad12610d00bb2856b291d Merge: 6302aad48c5c e054637597ba Author: Greg Kroah-Hartman Date: Thu Oct 11 12:27:47 2018 +0200 Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "scheduler fix: Cleanup of dead code left over from the recent sched/numa fixes." * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: mm, sched/numa: Remove remaining traces of NUMA rate-limiting commit 6302aad48c5cb56c9f9c3fb7aa73d2f1f2f10540 Merge: 9dcd936c5312 c1883f10cfe0 Author: Greg Kroah-Hartman Date: Thu Oct 11 12:27:03 2018 +0200 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo, a man of few words, writes: "perf fixes: misc perf tooling fixes" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf record: Use unmapped IP for inline callchain cursors perf python: Use -Wno-redundant-decls to build with PYTHON=python3 perf report: Don't try to map ip to invalid map perf script python: Fix export-to-sqlite.py sample columns perf script python: Fix export-to-postgresql.py occasional failure commit cee271678d0e3177a25d0fcb2fa5e051d48e4262 Author: Björn Töpel Date: Mon Oct 8 19:40:16 2018 +0200 xsk: do not call synchronize_net() under RCU read lock The XSKMAP update and delete functions called synchronize_net(), which can sleep. It is not allowed to sleep during an RCU read section. Instead we need to make sure that the sock sk_destruct (xsk_destruct) function is asynchronously called after an RCU grace period. Setting the SOCK_RCU_FREE flag for XDP sockets takes care of this. Fixes: fbfc504a24f5 ("bpf: introduce new bpf AF_XDP map type BPF_MAP_TYPE_XSKMAP") Reported-by: Eric Dumazet Signed-off-by: Björn Töpel Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit 4f7617705bfff84d756fe4401a1f4f032f374984 Author: Giacinto Cifelli Date: Wed Oct 10 20:05:53 2018 +0200 qmi_wwan: Added support for Gemalto's Cinterion ALASxx WWAN interface Added support for Gemalto's Cinterion ALASxx WWAN interfaces by adding QMI_FIXED_INTF with Cinterion's VID and PID. Signed-off-by: Giacinto Cifelli Acked-by: Bjørn Mork Signed-off-by: David S. Miller commit e7eb05823806502747eadc31039cecfd7836ddeb Author: Parthasarathy Bhuvaragan Date: Wed Oct 10 17:50:23 2018 +0200 tipc: queue socket protocol error messages into socket receive buffer In tipc_sk_filter_rcv(), when we detect protocol messages with error we call tipc_sk_conn_proto_rcv() and let it reset the connection and notify the socket by calling sk->sk_state_change(). However, tipc_sk_filter_rcv() may have been called from the function tipc_backlog_rcv(), in which case the socket lock is held and the socket already awake. This means that the sk_state_change() call is ignored and the error notification lost. Now the receive queue will remain empty and the socket sleeps forever. In this commit, we convert the protocol message into a connection abort message and enqueue it into the socket's receive queue. By this addition to the above state change we cover all conditions. Acked-by: Ying Xue Signed-off-by: Parthasarathy Bhuvaragan Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 047491ea334a454fa0647ec99dadcc6dd38417e0 Author: Jon Maloy Date: Wed Oct 10 17:34:01 2018 +0200 tipc: set link tolerance correctly in broadcast link In the patch referred to below we added link tolerance as an additional criteria for declaring broadcast transmission "stale" and resetting the affected links. However, the 'tolerance' field of the broadcast link is never set, and remains at zero. This renders the whole commit without the intended improving effect, but luckily also with no negative effect. In this commit we add the missing initialization. Fixes: a4dc70d46cf1 ("tipc: extend link reset criteria for stale packet retransmission") Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 28b6bfebdd2fde5e09aa830bbeb284ec96c2c0a0 Merge: 7abab7b9b498 28d35bcdd392 Author: David S. Miller Date: Wed Oct 10 22:44:47 2018 -0700 Merge branch 'net-ipv4-fixes-for-PMTU-when-link-MTU-changes' Sabrina Dubroca says: ==================== net: ipv4: fixes for PMTU when link MTU changes The first patch adapts the changes that commit e9fa1495d738 ("ipv6: Reflect MTU changes on PMTU of exceptions for MTU-less routes") did in IPv6 to IPv4: lower PMTU when the first hop's MTU drops below it, and raise PMTU when the first hop was limiting PMTU discovery and its MTU is increased. The second patch fixes bugs introduced in commit d52e5a7e7ca4 ("ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu") that only appear once the first patch is applied. Selftests for these cases were introduced in net-next commit e44e428f59e4 ("selftests: pmtu: add basic IPv4 and IPv6 PMTU tests") v2: add cover letter, and fix a few small things in patch 1 ==================== Signed-off-by: David S. Miller commit 28d35bcdd3925e7293408cdb8aa5f2aac5f0d6e3 Author: Sabrina Dubroca Date: Tue Oct 9 17:48:15 2018 +0200 net: ipv4: don't let PMTU updates increase route MTU When an MTU update with PMTU smaller than net.ipv4.route.min_pmtu is received, we must clamp its value. However, we can receive a PMTU exception with PMTU < old_mtu < ip_rt_min_pmtu, which would lead to an increase in PMTU. To fix this, take the smallest of the old MTU and ip_rt_min_pmtu. Before this patch, in case of an update, the exception's MTU would always change. Now, an exception can have only its lock flag updated, but not the MTU, so we need to add a check on locking to the following "is this exception getting updated, or close to expiring?" test. Fixes: d52e5a7e7ca4 ("ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu") Signed-off-by: Sabrina Dubroca Reviewed-by: Stefano Brivio Signed-off-by: David S. Miller commit af7d6cce53694a88d6a1bb60c9a239a6a5144459 Author: Sabrina Dubroca Date: Tue Oct 9 17:48:14 2018 +0200 net: ipv4: update fnhe_pmtu when first hop's MTU changes Since commit 5aad1de5ea2c ("ipv4: use separate genid for next hop exceptions"), exceptions get deprecated separately from cached routes. In particular, administrative changes don't clear PMTU anymore. As Stefano described in commit e9fa1495d738 ("ipv6: Reflect MTU changes on PMTU of exceptions for MTU-less routes"), the PMTU discovered before the local MTU change can become stale: - if the local MTU is now lower than the PMTU, that PMTU is now incorrect - if the local MTU was the lowest value in the path, and is increased, we might discover a higher PMTU Similarly to what commit e9fa1495d738 did for IPv6, update PMTU in those cases. If the exception was locked, the discovered PMTU was smaller than the minimal accepted PMTU. In that case, if the new local MTU is smaller than the current PMTU, let PMTU discovery figure out if locking of the exception is still needed. To do this, we need to know the old link MTU in the NETDEV_CHANGEMTU notifier. By the time the notifier is called, dev->mtu has been changed. This patch adds the old MTU as additional information in the notifier structure, and a new call_netdevice_notifiers_u32() function. Fixes: 5aad1de5ea2c ("ipv4: use separate genid for next hop exceptions") Signed-off-by: Sabrina Dubroca Reviewed-by: Stefano Brivio Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 7abab7b9b498650404800a08765f44929fee8f31 Author: Mike Rapoport Date: Tue Oct 9 07:02:01 2018 +0300 net/ipv6: stop leaking percpu memory in fib6 info The fib6_info_alloc() function allocates percpu memory to hold per CPU pointers to rt6_info, but this memory is never freed. Fix it. Fixes: a64efe142f5e ("net/ipv6: introduce fib6_info struct and helpers") Signed-off-by: Mike Rapoport Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 49b538e79b59378e7ac09742bb4bd57b3b91fd94 Merge: 9a4890bd6d63 c1e15b4944c9 Author: David S. Miller Date: Wed Oct 10 22:27:38 2018 -0700 Merge tag 'rxrpc-fixes-20181008' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs David Howells says: ==================== rxrpc: Fix packet reception code Here are a set of patches that prepares for and fix problems in rxrpc's package reception code. There serious problems are: (A) There's a window between binding the socket and setting the data_ready hook in which packets can find their way into the UDP socket's receive queues. (B) The skb_recv_udp() will return an error (and clear the error state) if there was an error on the Tx side. rxrpc doesn't handle this. (C) The rxrpc data_ready handler doesn't fully drain the UDP receive queue. (D) The rxrpc data_ready handler assumes it is called in a non-reentrant state. The second patch fixes (A) - (C); the third patch renders (B) and (C) non-issues by using the recap_rcv hook instead of data_ready - and the final patch fixes (D). That last is the most complex. The preparatory patches are: (1) Fix some places that are doing things in the wrong net namespace. (2) Stop taking the rcu read lock as it's held by the IP input routine in the call chain. (3) Only end the Tx phase if *we* rotated the final packet out of the Tx buffer. (4) Don't assume that the call state won't change after dropping the call_state lock. (5) Only take receive window and MTU suze parameters from an ACK packet if it's the latest ACK packet. (6) Record connection-level abort information correctly. (7) Fix a trace line. And then there are three main patches - note that these are mixed in with the preparatory patches somewhat: (1) Fix the setup window (A), skb_recv_udp() error check (B) and packet drainage (C). (2) Switch to using the encap_rcv instead of data_ready to cut out the effects of the UDP read queues and get the packets delivered directly. (3) Add more locking into the various packet input paths to defend against re-entrance (D). ==================== Signed-off-by: David S. Miller commit 9a4890bd6d6325a1c88564a20ab310b2d56f6094 Author: Ka-Cheong Poon Date: Mon Oct 8 09:17:11 2018 -0700 rds: RDS (tcp) hangs on sendto() to unresponding address In rds_send_mprds_hash(), if the calculated hash value is non-zero and the MPRDS connections are not yet up, it will wait. But it should not wait if the send is non-blocking. In this case, it should just use the base c_path for sending the message. Signed-off-by: Ka-Cheong Poon Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit 9dcd936c5312f870955f108e8a1bfebf3eb6f688 Merge: 4718dcad7dec 118aa47c7072 Author: Greg Kroah-Hartman Date: Thu Oct 11 07:18:39 2018 +0200 Merge tag 'for-4.19/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Mike writes: "device mapper fix for 4.19 final - Fix for earlier 4.19 final DM linear change that incorrectly checked for CONFIG_DM_ZONED rather than CONFIG_BLK_DEV_ZONED." * tag 'for-4.19/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm linear: fix linear_end_io conditional definition commit 4718dcad7decac3a43b7339b2226f3d987cca75c Merge: b8db9e69dba9 b39989009bdb Author: Greg Kroah-Hartman Date: Thu Oct 11 07:17:42 2018 +0200 Merge tag 'xfs-fixes-for-4.19-rc7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Dave writes: "xfs: fixes for 4.19-rc7 Update for 4.19-rc7 to fix numerous file clone and deduplication issues." * tag 'xfs-fixes-for-4.19-rc7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: fix data corruption w/ unaligned reflink ranges xfs: fix data corruption w/ unaligned dedupe ranges xfs: update ctime and remove suid before cloning files xfs: zero posteof blocks when cloning above eof xfs: refactor clonerange preparation into a separate helper commit 118aa47c7072bce05fc39bd40a1c0a90caed72ab Author: Damien Le Moal Date: Thu Oct 11 11:45:30 2018 +0900 dm linear: fix linear_end_io conditional definition The dm-linear target is independent of the dm-zoned target. For code requiring support for zoned block devices, use CONFIG_BLK_DEV_ZONED instead of CONFIG_DM_ZONED. While at it, similarly to dm linear, also enable the DM_TARGET_ZONED_HM feature in dm-flakey only if CONFIG_BLK_DEV_ZONED is defined. Fixes: beb9caac211c1 ("dm linear: eliminate linear_end_io call if CONFIG_DM_ZONED disabled") Fixes: 0be12c1c7fce7 ("dm linear: add support for zoned block devices") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Mike Snitzer commit 37fdffb217a45609edccbb8b407d031143f551c0 Author: Tariq Toukan Date: Tue Aug 21 14:41:41 2018 +0300 net/mlx5: WQ, fixes for fragmented WQ buffers API mlx5e netdevice used to calculate fragment edges by a call to mlx5_wq_cyc_get_frag_size(). This calculation did not give the correct indication for queues smaller than a PAGE_SIZE, (broken by default on PowerPC, where PAGE_SIZE == 64KB). Here it is replaced by the correct new calls/API. Since (TX/RX) Work Queues buffers are fragmented, here we introduce changes to the API in core driver, so that it gets a stride index and returns the index of last stride on same fragment, and an additional wrapping function that returns the number of physically contiguous strides that can be written contiguously to the work queue. This obsoletes the following API functions, and their buggy usage in EN driver: * mlx5_wq_cyc_get_frag_size() * mlx5_wq_cyc_ctr2fragix() The new API improves modularity and hides the details of such calculation for mlx5e netdevice and mlx5_ib rdma drivers. New calculation is also more efficient, and improves performance as follows: Packet rate test: pktgen, UDP / IPv4, 64byte, single ring, 8K ring size. Before: 16,477,619 pps After: 17,085,793 pps 3.7% improvement Fixes: 3a2f70331226 ("net/mlx5: Use order-0 allocations for all WQ types") Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit a48bc513159d4767f9988f0d857b2b0c38a4d614 Author: Huy Nguyen Date: Tue Sep 11 14:58:22 2018 -0500 net/mlx5: Take only bit 24-26 of wqe.pftype_wq for page fault type The HW spec defines only bits 24-26 of pftype_wq as the page fault type, use the required mask to ensure that. Fixes: d9aaed838765 ("{net,IB}/mlx5: Refactor page fault handling") Signed-off-by: Huy Nguyen Signed-off-by: Eli Cohen Signed-off-by: Saeed Mahameed commit fd7e848077c1a466b9187537adce16658f7cb94b Author: Talat Batheesh Date: Thu Aug 30 16:31:52 2018 +0300 net/mlx5: Fix memory leak when setting fpga ipsec caps Allocated memory for context should be freed once finished working with it. Fixes: d6c4f0298cec ("net/mlx5: Refactor accel IPSec code") Signed-off-by: Talat Batheesh Reviewed-by: Or Gerlitz Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit b8db9e69dba97075d37d7bc20ef49f39298e3875 Merge: 588b593821b8 beb9caac211c Author: Greg Kroah-Hartman Date: Wed Oct 10 22:13:20 2018 +0200 Merge tag 'for-4.19/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Mike writes: "device mapper fixes for 4.19 final - Fix a DM cache module init error path bug that doesn't properly cleanup a KMEM_CACHE if target registration fails. - Two stable@ fixes for DM zoned target; 4.20 will have changes that eliminate this code entirely but <= 4.19 needs these changes." * tag 'for-4.19/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm linear: eliminate linear_end_io call if CONFIG_DM_ZONED disabled dm: fix report zone remapping to account for partition offset dm cache: destroy migration_cache if cache target registration failed commit 588b593821b8dd6efe6b6850930b501fc3c94a13 Merge: f7e59f3895ed 62165600ae73 Author: Greg Kroah-Hartman Date: Wed Oct 10 22:09:44 2018 +0200 Merge tag 'trace-v4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Steven writes: "vsprint fix: It was reported that trace_printk() was not reporting properly values that came after a dereference pointer. trace_printk() utilizes vbin_printf() and bstr_printf() to keep the overhead of tracing down. vbin_printf() does not do any conversions and just stors the string format and the raw arguments into the buffer. bstr_printf() is used to read the buffer and does the conversions to complete the printf() output. This can be troublesome with dereferenced pointers because the reference may be different from the time vbin_printf() is called to the time bstr_printf() is called. To fix this, a prior commit changed vbin_printf() to convert dereferenced pointers into strings and load the converted string into the buffer. But the change to bstr_printf() had an off-by-one error and didn't account for the nul character at the end of the string and this corrupted the rest of the values in the format that came after a dereferenced pointer." * tag 'trace-v4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: vsprintf: Fix off-by-one bug in bstr_printf() processing dereferenced pointers commit f7e59f3895ed47f5a5a8b19b001effc6dbdbad88 Merge: bb2d8f2f6104 8894891446c9 Author: Greg Kroah-Hartman Date: Wed Oct 10 22:09:02 2018 +0200 Merge tag 'devicetree-fixes-for-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Rob writes: "Devicetree fixes for 4.19, part 3: - Fix DT unittest on Oldworld MAC systems" * tag 'devicetree-fixes-for-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of: unittest: Disable interrupt node tests for old world MAC systems commit dd9a403495704fc80fb9f399003013ef2be2ee23 Author: Valentine Fatiev Date: Wed Oct 10 09:56:25 2018 +0300 IB/mlx5: Unmap DMA addr from HCA before IOMMU The function that puts back the MR in cache also removes the DMA address from the HCA. Therefore we need to call this function before we remove the DMA mapping from MMU. Otherwise the HCA may access a memory that is no longer DMA mapped. Call trace: NMI: IOCK error (debug interrupt?) for reason 71 on CPU 0. CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.0-rc6+ #4 Hardware name: HP ProLiant DL360p Gen8, BIOS P71 08/20/2012 RIP: 0010:intel_idle+0x73/0x120 Code: 80 5c 01 00 0f ae 38 0f ae f0 31 d2 65 48 8b 04 25 80 5c 01 00 48 89 d1 0f 60 02 RSP: 0018:ffffffff9a403e38 EFLAGS: 00000046 RAX: 0000000000000030 RBX: 0000000000000005 RCX: 0000000000000001 RDX: 0000000000000000 RSI: ffffffff9a5790c0 RDI: 0000000000000000 RBP: 0000000000000030 R08: 0000000000000000 R09: 0000000000007cf9 R10: 000000000000030a R11: 0000000000000018 R12: 0000000000000000 R13: ffffffff9a5792b8 R14: ffffffff9a5790c0 R15: 0000002b48471e4d FS: 0000000000000000(0000) GS:ffff9c6caf400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f5737185000 CR3: 0000000590c0a002 CR4: 00000000000606f0 Call Trace: cpuidle_enter_state+0x7e/0x2e0 do_idle+0x1ed/0x290 cpu_startup_entry+0x6f/0x80 start_kernel+0x524/0x544 ? set_init_arg+0x55/0x55 secondary_startup_64+0xa4/0xb0 DMAR: DRHD: handling fault status reg 2 DMAR: [DMA Read] Request device [04:00.0] fault addr b34d2000 [fault reason 06] PTE Read access is not set DMAR: [DMA Read] Request device [01:00.2] fault addr bff8b000 [fault reason 06] PTE Read access is not set Fixes: f3f134f5260a ("RDMA/mlx5: Fix crash while accessing garbage pointer and freed memory") Signed-off-by: Valentine Fatiev Reviewed-by: Moni Shoua Signed-off-by: Leon Romanovsky Signed-off-by: Doug Ledford commit 52b5d6f5dcf0e5201392f7d417148ccb537dbf6f Author: Eric Dumazet Date: Wed Oct 10 06:59:35 2018 -0700 net: make skb_partial_csum_set() more robust against overflows syzbot managed to crash in skb_checksum_help() [1] : BUG_ON(offset + sizeof(__sum16) > skb_headlen(skb)); Root cause is the following check in skb_partial_csum_set() if (unlikely(start > skb_headlen(skb)) || unlikely((int)start + off > skb_headlen(skb) - 2)) return false; If skb_headlen(skb) is 1, then (skb_headlen(skb) - 2) becomes 0xffffffff and the check fails to detect that ((int)start + off) is off the limit, since the compare is unsigned. When we fix that, then the first condition (start > skb_headlen(skb)) becomes obsolete. Then we should also check that (skb_headroom(skb) + start) wont overflow 16bit field. [1] kernel BUG at net/core/dev.c:2880! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 7330 Comm: syz-executor4 Not tainted 4.19.0-rc6+ #253 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:skb_checksum_help+0x9e3/0xbb0 net/core/dev.c:2880 Code: 85 00 ff ff ff 48 c1 e8 03 42 80 3c 28 00 0f 84 09 fb ff ff 48 8b bd 00 ff ff ff e8 97 a8 b9 fb e9 f8 fa ff ff e8 2d 09 76 fb <0f> 0b 48 8b bd 28 ff ff ff e8 1f a8 b9 fb e9 b1 f6 ff ff 48 89 cf RSP: 0018:ffff8801d83a6f60 EFLAGS: 00010293 RAX: ffff8801b9834380 RBX: ffff8801b9f8d8c0 RCX: ffffffff8608c6d7 RDX: 0000000000000000 RSI: ffffffff8608cc63 RDI: 0000000000000006 RBP: ffff8801d83a7068 R08: ffff8801b9834380 R09: 0000000000000000 R10: ffff8801d83a76d8 R11: 0000000000000000 R12: 0000000000000001 R13: 0000000000010001 R14: 000000000000ffff R15: 00000000000000a8 FS: 00007f1a66db5700(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f7d77f091b0 CR3: 00000001ba252000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: skb_csum_hwoffload_help+0x8f/0xe0 net/core/dev.c:3269 validate_xmit_skb+0xa2a/0xf30 net/core/dev.c:3312 __dev_queue_xmit+0xc2f/0x3950 net/core/dev.c:3797 dev_queue_xmit+0x17/0x20 net/core/dev.c:3838 packet_snd net/packet/af_packet.c:2928 [inline] packet_sendmsg+0x422d/0x64c0 net/packet/af_packet.c:2953 Fixes: 5ff8dda3035d ("net: Ensure partial checksum offset is inside the skb head") Signed-off-by: Eric Dumazet Cc: Herbert Xu Reported-by: syzbot Signed-off-by: David S. Miller commit 8b79f410438f5407ff45ceb72ad1eb02409652b4 Merge: 4cf34c0cf60e bde74ad10eb5 Author: David S. Miller Date: Wed Oct 10 10:19:10 2018 -0700 Merge branch 'devlink-param-type-string-fixes' Moshe Shemesh says: ==================== devlink param type string fixes This patchset fixes devlink param infrastructure for string param type. The devlink param infrastructure doesn't handle copying the string data correctly. The first two patches fix it and the third patch adds helper function to safely copy string value without exceeding DEVLINK_PARAM_MAX_STRING_VALUE. ==================== Signed-off-by: David S. Miller commit bde74ad10eb55aaa472c37b107934e6b8563c25e Author: Moshe Shemesh Date: Wed Oct 10 16:09:27 2018 +0300 devlink: Add helper function for safely copy string param Devlink string param buffer is allocated at the size of DEVLINK_PARAM_MAX_STRING_VALUE. Add helper function which makes sure this size is not exceeded. Renamed DEVLINK_PARAM_MAX_STRING_VALUE to __DEVLINK_PARAM_MAX_STRING_VALUE to emphasize that it should be used by devlink only. The driver should use the helper function instead to verify it doesn't exceed the allowed length. Signed-off-by: Moshe Shemesh Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 1276534c988ba752fa01bf090412a877ee783829 Author: Moshe Shemesh Date: Wed Oct 10 16:09:26 2018 +0300 devlink: Fix param cmode driverinit for string type Driverinit configuration mode value is held by devlink to enable the driver fetch the value after reload command. In case the param type is string devlink should copy the value from driver string buffer to devlink string buffer on devlink_param_driverinit_value_set() and vice-versa on devlink_param_driverinit_value_get(). Fixes: ec01aeb1803e ("devlink: Add support for get/set driverinit value") Signed-off-by: Moshe Shemesh Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit f355cfcdb251e22b9dfb78c0eef4005a9d902a35 Author: Moshe Shemesh Date: Wed Oct 10 16:09:25 2018 +0300 devlink: Fix param set handling for string type In case devlink param type is string, it needs to copy the string value it got from the input to devlink_param_value. Fixes: e3b7ca18ad7b ("devlink: Add param set command") Signed-off-by: Moshe Shemesh Signed-off-by: David S. Miller commit 5318321d367c21ca1fe9eb00caefc239c938750a Author: Masahiro Yamada Date: Tue Sep 18 12:58:33 2018 +0900 samples: disable CONFIG_SAMPLES for UML Some samples require headers installation, so commit 3fca1700c4c3 ("kbuild: make samples really depend on headers_install") added such dependency in the top Makefile. However, UML fails to build with CONFIG_SAMPLES=y because UML does not support headers_install. Fixes: 3fca1700c4c3 ("kbuild: make samples really depend on headers_install") Reported-by: Kees Cook Cc: David Howells Signed-off-by: Masahiro Yamada commit beb9caac211c1be1bc118bb62d5cf09c4107e6a5 Author: Mike Snitzer Date: Wed Oct 10 12:01:55 2018 -0400 dm linear: eliminate linear_end_io call if CONFIG_DM_ZONED disabled It is best to avoid any extra overhead associated with bio completion. DM core will indirectly call a DM target's .end_io if it is defined. In the case of DM linear, there is no need to do so (for every bio that completes) if CONFIG_DM_ZONED is not enabled. Avoiding an extra indirect call for every bio completion is very important for ensuring DM linear doesn't incur more overhead that further widens the performance gap between dm-linear and raw block devices. Fixes: 0be12c1c7fce7 ("dm linear: add support for zoned block devices") Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer commit f259f896f2348f0302f6f88d4382378cf9d23a7e Author: Marco Felsch Date: Tue Oct 2 10:06:46 2018 +0200 pinctrl: mcp23s08: fix irq and irqchip setup order Since 'commit 02e389e63e35 ("pinctrl: mcp23s08: fix irq setup order")' the irq request isn't the last devm_* allocation. Without a deeper look at the irq and testing this isn't a good solution. Since this driver relies on the devm mechanism, requesting a interrupt should be the last thing to avoid memory corruptions during unbinding. 'Commit 02e389e63e35 ("pinctrl: mcp23s08: fix irq setup order")' fixed the order for the interrupt-controller use case only. The mcp23s08_irq_setup() must be split into two to fix it for the interrupt-controller use case and to register the irq at last. So the irq will be freed first during unbind. Cc: stable@vger.kernel.org Cc: Jan Kundrát Cc: Dmitry Mastykin Cc: Sebastian Reichel Fixes: 82039d244f87 ("pinctrl: mcp23s08: add pinconf support") Fixes: 02e389e63e35 ("pinctrl: mcp23s08: fix irq setup order") Signed-off-by: Marco Felsch Tested-by: Phil Reid Signed-off-by: Linus Walleij commit 3e779a2e7f909015f21428b66834127496110b6d Author: Stephen Boyd Date: Mon Oct 8 09:32:13 2018 -0700 gpio: Assign gpio_irq_chip::parents to non-stack pointer gpiochip_set_cascaded_irqchip() is passed 'parent_irq' as an argument and then the address of that argument is assigned to the gpio chips gpio_irq_chip 'parents' pointer shortly thereafter. This can't ever work, because we've just assigned some stack address to a pointer that we plan to dereference later in gpiochip_irq_map(). I ran into this issue with the KASAN report below when gpiochip_irq_map() tried to setup the parent irq with a total junk pointer for the 'parents' array. BUG: KASAN: stack-out-of-bounds in gpiochip_irq_map+0x228/0x248 Read of size 4 at addr ffffffc0dde472e0 by task swapper/0/1 CPU: 7 PID: 1 Comm: swapper/0 Not tainted 4.14.72 #34 Call trace: [] dump_backtrace+0x0/0x718 [] show_stack+0x20/0x2c [] __dump_stack+0x20/0x28 [] dump_stack+0x80/0xbc [] print_address_description+0x70/0x238 [] kasan_report+0x1cc/0x260 [] __asan_report_load4_noabort+0x2c/0x38 [] gpiochip_irq_map+0x228/0x248 [] irq_domain_associate+0x114/0x2ec [] irq_create_mapping+0x120/0x234 [] irq_create_fwspec_mapping+0x4c8/0x88c [] irq_create_of_mapping+0x180/0x210 [] of_irq_get+0x138/0x198 [] spi_drv_probe+0x94/0x178 [] driver_probe_device+0x51c/0x824 [] __device_attach_driver+0x148/0x20c [] bus_for_each_drv+0x120/0x188 [] __device_attach+0x19c/0x2dc [] device_initial_probe+0x20/0x2c [] bus_probe_device+0x80/0x154 [] device_add+0x9b8/0xbdc [] spi_add_device+0x1b8/0x380 [] spi_register_controller+0x111c/0x1378 [] spi_geni_probe+0x4dc/0x6f8 [] platform_drv_probe+0xdc/0x130 [] driver_probe_device+0x51c/0x824 [] __driver_attach+0x100/0x194 [] bus_for_each_dev+0x104/0x16c [] driver_attach+0x48/0x54 [] bus_add_driver+0x274/0x498 [] driver_register+0x1ac/0x230 [] __platform_driver_register+0xcc/0xdc [] spi_geni_driver_init+0x1c/0x24 [] do_one_initcall+0x240/0x3dc [] kernel_init_freeable+0x378/0x468 [] kernel_init+0x14/0x110 [] ret_from_fork+0x10/0x18 The buggy address belongs to the page: page:ffffffbf037791c0 count:0 mapcount:0 mapping: (null) index:0x0 flags: 0x4000000000000000() raw: 4000000000000000 0000000000000000 0000000000000000 00000000ffffffff raw: ffffffbf037791e0 ffffffbf037791e0 0000000000000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffffffc0dde47180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffffc0dde47200: f1 f1 f1 f1 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f2 f2 >ffffffc0dde47280: f2 f2 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 ^ ffffffc0dde47300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffffc0dde47380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Let's leave around one unsigned int in the gpio_irq_chip struct for the single parent irq case and repoint the 'parents' array at it. This way code is left mostly intact to setup parents and we waste an extra few bytes per structure of which there should be only a handful in a system. Cc: Evan Green Cc: Thierry Reding Cc: Grygorii Strashko Fixes: e0d897289813 ("gpio: Implement tighter IRQ chip integration") Signed-off-by: Stephen Boyd Signed-off-by: Linus Walleij commit 4f666675cdff0b986195413215eb062b7da6586f Author: Daniel Mack Date: Mon Oct 8 22:03:57 2018 +0200 libertas: call into generic suspend code before turning off power When powering down a SDIO connected card during suspend, make sure to call into the generic lbs_suspend() function before pulling the plug. This will make sure the card is successfully deregistered from the system to avoid communication to the card starving out. Fixes: 7444a8092906 ("libertas: fix suspend and resume for SDIO connected cards") Signed-off-by: Daniel Mack Reviewed-by: Ulf Hansson Acked-by: Kalle Valo Signed-off-by: Ulf Hansson commit 8894891446c9380709451b99ab45c5c53adfd2fc Author: Guenter Roeck Date: Tue Sep 25 21:06:24 2018 -0700 of: unittest: Disable interrupt node tests for old world MAC systems On systems with OF_IMAP_OLDWORLD_MAC set in of_irq_workarounds, the devicetree interrupt parsing code is different, causing unit tests of devicetree interrupt nodes to fail. Due to a bug in unittest code, which tries to dereference an uninitialized pointer, this results in a crash. OF: /testcase-data/phandle-tests/consumer-a: arguments longer than property Unable to handle kernel paging request for data at address 0x00bc616e Faulting instruction address: 0xc08e9468 Oops: Kernel access of bad area, sig: 11 [#1] BE PREEMPT PowerMac Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.72-rc1-yocto-standard+ #1 task: cf8e0000 task.stack: cf8da000 NIP: c08e9468 LR: c08ea5bc CTR: c08ea5ac REGS: cf8dbb50 TRAP: 0300 Not tainted (4.14.72-rc1-yocto-standard+) MSR: 00001032 CR: 82004044 XER: 00000000 DAR: 00bc616e DSISR: 40000000 GPR00: c08ea5bc cf8dbc00 cf8e0000 c13ca517 c13ca517 c13ca8a0 00000066 00000002 GPR08: 00000063 00bc614e c0b05865 000affff 82004048 00000000 c00047f0 00000000 GPR16: c0a80000 c0a9cc34 c13ca517 c0ad1134 05ffffff 000affff c0b05860 c0abeef8 GPR24: cecec278 cecec278 c0a8c4d0 c0a885e0 c13ca8a0 05ffffff c13ca8a0 c13ca517 NIP [c08e9468] device_node_gen_full_name+0x30/0x15c LR [c08ea5bc] device_node_string+0x190/0x3c8 Call Trace: [cf8dbc00] [c007f670] trace_hardirqs_on_caller+0x118/0x1fc (unreliable) [cf8dbc40] [c08ea5bc] device_node_string+0x190/0x3c8 [cf8dbcb0] [c08eb794] pointer+0x25c/0x4d0 [cf8dbd00] [c08ebcbc] vsnprintf+0x2b4/0x5ec [cf8dbd60] [c08ec00c] vscnprintf+0x18/0x48 [cf8dbd70] [c008e268] vprintk_store+0x4c/0x22c [cf8dbda0] [c008ecac] vprintk_emit+0x94/0x130 [cf8dbdd0] [c008ff54] printk+0x5c/0x6c [cf8dbe10] [c0b8ddd4] of_unittest+0x2220/0x26f8 [cf8dbea0] [c0004434] do_one_initcall+0x4c/0x184 [cf8dbf00] [c0b4534c] kernel_init_freeable+0x13c/0x1d8 [cf8dbf30] [c0004814] kernel_init+0x24/0x118 [cf8dbf40] [c0013398] ret_from_kernel_thread+0x5c/0x64 The problem was observed when running a qemu test for the g3beige machine with devicetree unittests enabled. Disable interrupt node tests on affected systems to avoid both false unittest failures and the crash. With this patch in place, unittest on the affected system passes with the following message. dt-test ### end of unittest - 144 passed, 0 failed Fixes: 53a42093d96ef ("of: Add device tree selftests") Signed-off-by: Guenter Roeck Reviewed-by: Frank Rowand Signed-off-by: Rob Herring commit bb2d8f2f61047cbde08b78ec03e4ebdb01ee5434 Merge: c350a1d46670 d4d2313a3c17 Author: Greg Kroah-Hartman Date: Wed Oct 10 08:48:39 2018 +0200 Merge tag 'tag-chrome-platform-fixes-for-v4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform Benson writes: "chrome-platform fix for v4.19-rc8 This contains a fix to 57e94c8b974d ("mfd: cros-ec: Increase maximum mkbp event size"), which caused cros_ec based chromebooks to truncate an entire column of their built-in keyboard." * tag 'tag-chrome-platform-fixes-for-v4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform: mfd: cros-ec: copy the whole event in get_next_event_xfer commit c350a1d466707eb01333ed22238664f3482df25a Merge: 3a0671e7ba19 6685b357363b Author: Greg Kroah-Hartman Date: Wed Oct 10 08:47:32 2018 +0200 Merge branch 'for-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu Dennis writes: "percpu fixes for-4.19-rc8 The new percpu allocator introduced in 4.14 had a missing free for the percpu metadata. This caused a memory leak when percpu memory is being churned resulting in the allocation and deallocation of percpu memory chunks" * 'for-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu: percpu: stop leaking bitmap metadata blocks commit 3a0671e7ba195c5cb9b1a43265ef24a0875afcaa Merge: 3d647e62686f dc480feb454a Author: Greg Kroah-Hartman Date: Wed Oct 10 08:46:11 2018 +0200 Merge tag 'gfs2-4.19.fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Andreas writes: "gfs2 4.19 fix: This fixes a regression introduced in commit 64bc06bb32ee "gfs2: iomap buffered write support"" * tag 'gfs2-4.19.fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Fix iomap buffered write support for journaled files commit 3d647e62686f447ca4c9ba6b4500fed5f0368a98 Merge: 701f2eb6f938 7c75544983ed Author: Greg Kroah-Hartman Date: Wed Oct 10 08:44:35 2018 +0200 Merge tag 's390-4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Martin writes: "s390 fixes for 4.19-rc8 Four more patches for 4.19: - Fix resume after suspend-to-disk if resume-CPU != suspend-CPU - Fix vfio-ccw check for pinned pages - Two patches to avoid a usercopy-whitelist warning in vfio-ccw" * tag 's390-4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/cio: Fix how vfio-ccw checks pinned pages s390/cio: Refactor alloc of ccw_io_region s390/cio: Convert ccw_io_region to pointer s390/hibernate: fix error handling when suspend cpu != resume cpu commit 701f2eb6f9382409bfa1e68a62729d6e5de54eef Merge: 64c5e530ac2c 148b9aba99e0 Author: Greg Kroah-Hartman Date: Wed Oct 10 08:43:15 2018 +0200 Merge tag 'mips_fixes_4.19_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Paul writes: "A few MIPS fixes for 4.19: - Avoid suboptimal placement of our VDSO when using the legacy mmap layout, which can prevent statically linked programs that were able to allocate large amounts of memory using the brk syscall prior to the introduction of our VDSO from functioning correctly. - Fix up CONFIG_CMDLINE handling for platforms which ought to ignore DT arguments but have incorrectly used them & lost other arguments since v3.16. - Fix a path in MAINTAINERS to use valid wildcards. - Fixup a regression from v4.17 in memset() for systems using CPU_DADDI_WORKAROUNDS." * tag 'mips_fixes_4.19_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: memset: Fix CPU_DADDI_WORKAROUNDS `small_fixup' regression MAINTAINERS: MIPS/LOONGSON2 ARCHITECTURE - Use the normal wildcard style MIPS: Fix CONFIG_CMDLINE handling MIPS: VDSO: Always map near top of user memory commit 073c1a781e4a1217d572506621434cd6d750969b Author: Paul Moore Date: Wed Oct 10 01:50:15 2018 -0400 MAINTAINERS: update the SELinux mailing list location Signed-off-by: Paul Moore commit d4d2313a3c17eff4aef9a544023c2df5b9f5bedc Author: Emil Karlson Date: Wed Oct 3 21:43:18 2018 +0300 mfd: cros-ec: copy the whole event in get_next_event_xfer Commit 57e94c8b974db2d83c60e1139c89a70806abbea0 caused cros-ec keyboard events be truncated on many chromebooks so that Left and Right keys on Column 12 were always 0. Use ret as memcpy len to fix this. The old code was using ec_dev->event_size, which is the event payload/data size excluding event_type header, for the length of the memcpy operation. Use ret as memcpy length to avoid the off by one and copy the whole msg->data. Fixes: 57e94c8b974d ("mfd: cros-ec: Increase maximum mkbp event size") Acked-by: Enric Balletbo i Serra Tested-by: Emil Renner Berthing Signed-off-by: Emil Karlson Signed-off-by: Benson Leung commit 7c26701a77ec4569d9054b334d70724a06ad62f9 Author: David S. Miller Date: Tue Oct 9 16:52:38 2018 -0700 sparc: Wire up io_pgetevents system call. Signed-off-by: David S. Miller commit 4628a64591e6cee181237060961e98c615c33966 Author: Jan Kara Date: Tue Oct 9 12:19:17 2018 +0200 mm: Preserve _PAGE_DEVMAP across mprotect() calls Currently _PAGE_DEVMAP bit is not preserved in mprotect(2) calls. As a result we will see warnings such as: BUG: Bad page map in process JobWrk0013 pte:800001803875ea25 pmd:7624381067 addr:00007f0930720000 vm_flags:280000f9 anon_vma: (null) mapping:ffff97f2384056f0 index:0 file:457-000000fe00000030-00000009-000000ca-00000001_2001.fileblock fault:xfs_filemap_fault [xfs] mmap:xfs_file_mmap [xfs] readpage: (null) CPU: 3 PID: 15848 Comm: JobWrk0013 Tainted: G W 4.12.14-2.g7573215-default #1 SLE12-SP4 (unreleased) Hardware name: Intel Corporation S2600WFD/S2600WFD, BIOS SE5C620.86B.01.00.0833.051120182255 05/11/2018 Call Trace: dump_stack+0x5a/0x75 print_bad_pte+0x217/0x2c0 ? enqueue_task_fair+0x76/0x9f0 _vm_normal_page+0xe5/0x100 zap_pte_range+0x148/0x740 unmap_page_range+0x39a/0x4b0 unmap_vmas+0x42/0x90 unmap_region+0x99/0xf0 ? vma_gap_callbacks_rotate+0x1a/0x20 do_munmap+0x255/0x3a0 vm_munmap+0x54/0x80 SyS_munmap+0x1d/0x30 do_syscall_64+0x74/0x150 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 ... when mprotect(2) gets used on DAX mappings. Also there is a wide variety of other failures that can result from the missing _PAGE_DEVMAP flag when the area gets used by get_user_pages() later. Fix the problem by including _PAGE_DEVMAP in a set of flags that get preserved by mprotect(2). Fixes: 69660fd797c3 ("x86, mm: introduce _PAGE_DEVMAP") Fixes: ebd31197931d ("powerpc/mm: Add devmap support for ppc64") Cc: Signed-off-by: Jan Kara Acked-by: Michal Hocko Reviewed-by: Johannes Thumshirn Signed-off-by: Dan Williams commit 9864cd5dc54cade89fd4b0954c2e522841aa247c Author: Damien Le Moal Date: Tue Oct 9 14:24:31 2018 +0900 dm: fix report zone remapping to account for partition offset If dm-linear or dm-flakey are layered on top of a partition of a zoned block device, remapping of the start sector and write pointer position of the zones reported by a report zones BIO must be modified to account for the target table entry mapping (start offset within the device and entry mapping with the dm device). If the target's backing device is a partition of a whole disk, the start sector on the physical device of the partition must also be accounted for when modifying the zone information. However, dm_remap_zone_report() was not considering this last case, resulting in incorrect zone information remapping with targets using disk partitions. Fix this by calculating the target backing device start sector using the position of the completed report zones BIO and the unchanged position and size of the original report zone BIO. With this value calculated, the start sector and write pointer position of the target zones can be correctly remapped. Fixes: 10999307c14e ("dm: introduce dm_remap_zone_report()") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Mike Snitzer commit c7cd55504a5b0fc826a2cd9540845979d24ae542 Author: Shenghui Wang Date: Sun Oct 7 14:45:41 2018 +0800 dm cache: destroy migration_cache if cache target registration failed Commit 7e6358d244e47 ("dm: fix various targets to dm_register_target after module __init resources created") inadvertently introduced this bug when it moved dm_register_target() after the call to KMEM_CACHE(). Fixes: 7e6358d244e47 ("dm: fix various targets to dm_register_target after module __init resources created") Cc: stable@vger.kernel.org Signed-off-by: Shenghui Wang Signed-off-by: Mike Snitzer commit 4cf34c0cf60e328b72ae17016b7c12fc66dbf76b Merge: e2a322a0c8ce 248ab77342d0 Author: David S. Miller Date: Tue Oct 9 10:49:50 2018 -0700 Merge branch 'ena-fixes' Arthur Kiyanovski says: ==================== minor bug fixes for ENA Ethernet driver Arthur Kiyanovski (4): net: ena: fix warning in rmmod caused by double iounmap net: ena: fix rare bug when failed restart/resume is followed by driver removal net: ena: fix NULL dereference due to untimely napi initialization net: ena: fix auto casting to boolean ==================== Signed-off-by: David S. Miller commit 248ab77342d0453f067b666b36f0f517ea66c361 Author: Arthur Kiyanovski Date: Tue Oct 9 11:21:30 2018 +0300 net: ena: fix auto casting to boolean Eliminate potential auto casting compilation error. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 78a55d05def95144ca5fa9a64c49b2a0636a9866 Author: Arthur Kiyanovski Date: Tue Oct 9 11:21:29 2018 +0300 net: ena: fix NULL dereference due to untimely napi initialization napi poll functions should be initialized before running request_irq(), to handle a rare condition where there is a pending interrupt, causing the ISR to fire immediately while the poll function wasn't set yet, causing a NULL dereference. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit d7703ddbd7c9cb1ab7c08e1b85b314ff8cea38e9 Author: Arthur Kiyanovski Date: Tue Oct 9 11:21:28 2018 +0300 net: ena: fix rare bug when failed restart/resume is followed by driver removal In a rare scenario when ena_device_restore() fails, followed by device remove, an FLR will not be issued. In this case, the device will keep sending asynchronous AENQ keep-alive events, even after driver removal, leading to memory corruption. Fixes: 8c5c7abdeb2d ("net: ena: add power management ops to the ENA driver") Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit d79c3888bde6581da7ff9f9d6f581900ecb5e632 Author: Arthur Kiyanovski Date: Tue Oct 9 11:21:27 2018 +0300 net: ena: fix warning in rmmod caused by double iounmap Memory mapped with devm_ioremap is automatically freed when the driver is disconnected from the device. Therefore there is no need to explicitly call devm_iounmap. Fixes: 0857d92f71b6 ("net: ena: add missing unmap bars on device removal") Fixes: 411838e7b41c ("net: ena: fix rare kernel crash when bar memory remap fails") Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller commit 4cebf459b6eb834eb28149da7ff51fadd83f2b19 Merge: 853c110982ea ec876f4b252c Author: Paolo Bonzini Date: Tue Oct 9 18:49:32 2018 +0200 Merge tag 'kvmarm-fixes-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master KVM/arm fixes for 4.19, take #2 - Correctly order GICv3 SGI registers in the cp15 array commit 853c110982eaff0d99dace3f66f1ba58b5bfd9d5 Author: Paolo Bonzini Date: Tue Oct 9 18:35:29 2018 +0200 KVM: x86: support CONFIG_KVM_AMD=y with CONFIG_CRYPTO_DEV_CCP_DD=m SEV requires access to the AMD cryptographic device APIs, and this does not work when KVM is builtin and the crypto driver is a module. Actually the Kconfig conditions for CONFIG_KVM_AMD_SEV try to disable SEV in that case, but it does not work because the actual crypto calls are not culled, only sev_hardware_setup() is. This patch adds two CONFIG_KVM_AMD_SEV checks that gate all the remaining SEV code; it fixes this particular configuration, and drops 5 KiB of code when CONFIG_KVM_AMD_SEV=n. Reported-by: Guenter Roeck Signed-off-by: Paolo Bonzini commit dc480feb454a975b7ee2c18a2f98fb34e04d3baf Author: Andreas Gruenbacher Date: Tue Oct 9 13:20:05 2018 +0200 gfs2: Fix iomap buffered write support for journaled files Commit 64bc06bb32ee broke buffered writes to journaled files (chattr +j): we'll try to journal the buffer heads of the page being written to in gfs2_iomap_journaled_page_done. However, the iomap code no longer creates buffer heads, so we'll BUG() in gfs2_page_add_databufs. Fix that by creating buffer heads ourself when needed. Signed-off-by: Andreas Gruenbacher commit c02588a352defaf985fc1816eb6232663159e1b8 Author: Heikki Krogerus Date: Mon Oct 1 18:53:05 2018 +0300 usb: xhci: pci: Enable Intel USB role mux on Apollo Lake platforms Intel Apollo Lake has the same internal USB role mux as Intel Cherry Trail. Cc: Signed-off-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 009b1948e153ae448f62f1887e2b58d0e05db51b Author: Wan Ahmad Zainie Date: Tue Oct 9 12:52:47 2018 +0800 usb: roles: intel_xhci: Fix Unbalanced pm_runtime_enable Add missing pm_runtime_disable() to remove(), in order to avoid an Unbalanced pm_runtime_enable when the module is removed and re-probed. Error log: root@intel-corei7-64:~# modprobe -r intel_xhci_usb_role_switch root@intel-corei7-64:~# modprobe intel_xhci_usb_role_switch intel_xhci_usb_sw intel_xhci_usb_sw: Unbalanced pm_runtime_enable! Fixes: cb2968468605 (usb: roles: intel_xhci: Enable runtime PM) Cc: Reviewed-by: Heikki Krogerus Signed-off-by: Wan Ahmad Zainie Signed-off-by: Greg Kroah-Hartman commit f976d0e5747ca65ccd0fb2a4118b193d70aa1836 Author: Tobias Herzog Date: Sat Sep 22 22:11:11 2018 +0200 cdc-acm: correct counting of UART states in serial state notification The usb standard ("Universal Serial Bus Class Definitions for Communication Devices") distiguishes between "consistent signals" (DSR, DCD), and "irregular signals" (break, ring, parity error, framing error, overrun). The bits of "irregular signals" are set, if this error/event occurred on the device side and are immeadeatly unset, if the serial state notification was sent. Like other drivers of real serial ports do, just the occurence of those events should be counted in serial_icounter_struct (but no 1->0 transitions). Signed-off-by: Tobias Herzog Acked-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman commit dae3ddba36f8c337fb59cef07d564da6fc9b7551 Author: Tobias Herzog Date: Sat Sep 22 22:11:10 2018 +0200 cdc-acm: do not reset notification buffer index upon urb unlinking Resetting the write index of the notification buffer on urb unlink (e.g. closing a cdc-acm device from userspace) may lead to wrong interpretation of further received notifications, in case the index is not 0 when urb unlink happens (i.e. when parts of a notification already have been transferred). On the device side there is no "reset" of the notification transimission and thus we would get out of sync with the device. Signed-off-by: Tobias Herzog Acked-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman commit 9397940ed812b942c520e0c25ed4b2c64d57e8b9 Author: Oliver Neukum Date: Thu Oct 4 15:49:06 2018 +0200 cdc-acm: fix race between reset and control messaging If a device splits up a control message and a reset() happens between the parts, the message is lost and already recieved parts must be dropped. Signed-off-by: Oliver Neukum Fixes: 1aba579f3cf51 ("cdc-acm: handle read pipe errors") Cc: stable Signed-off-by: Greg Kroah-Hartman commit 81f7567c51ad97668d1c3a48e8ecc482e64d4161 Author: Shuah Khan (Samsung OSG) Date: Fri Oct 5 16:17:44 2018 -0600 usb: usbip: Fix BUG: KASAN: slab-out-of-bounds in vhci_hub_control() vhci_hub_control() accesses port_status array with out of bounds port value. Fix it to reference port_status[] only with a valid rhport value when invalid_rhport flag is true. The invalid_rhport flag is set early on after detecting in port value is within the bounds or not. The following is used reproduce the problem and verify the fix: C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14ed8ab6400000 Reported-by: syzbot+bccc1fe10b70fadc78d0@syzkaller.appspotmail.com Cc: stable Signed-off-by: Shuah Khan (Samsung OSG) Signed-off-by: Greg Kroah-Hartman commit 4b0aaacee51eb6592a03fdefd5ce97558518e291 Author: Shuah Khan (Samsung OSG) Date: Fri Oct 5 16:17:43 2018 -0600 selftests: usbip: add wait after attach and before checking port status Add sleep between attach and "usbip port" check to make sure status is updated. Running attach and query back shows incorrect status. Signed-off-by: Shuah Khan (Samsung OSG) Signed-off-by: Greg Kroah-Hartman commit 1b9caa10b31dda0866f4028e4bfb923fb6e4072f Author: Jiri Olsa Date: Wed Oct 3 09:20:46 2018 +0200 Revert "perf tools: Fix PMU term format max value calculation" This reverts commit ac0e2cd555373ae6f8f3a3ad3fbbf5b6d1e7aaaa. Michael reported an issue with oversized terms values assignment and I noticed there was actually a misunderstanding of the max value check in the past. The above commit's changelog says: If bit 21 is set, there is parsing issues as below. $ perf stat -a -e uncore_qpi_0/event=0x200002,umask=0x8/ event syntax error: '..pi_0/event=0x200002,umask=0x8/' \___ value too big for format, maximum is 511 But there's no issue there, because the event value is distributed along the value defined by the format. Even if the format defines separated bit, the value is treated as a continual number, which should follow the format definition. In above case it's 9-bit value with last bit separated: $ cat uncore_qpi_0/format/event config:0-7,21 Hence the value 0x200002 is correctly reported as format violation, because it exceeds 9 bits. It should have been 0x102 instead, which sets the 9th bit - the bit 21 of the format. $ perf stat -vv -a -e uncore_qpi_0/event=0x102,umask=0x8/ Using CPUID GenuineIntel-6-2D ... ------------------------------------------------------------ perf_event_attr: type 10 size 112 config 0x200802 sample_type IDENTIFIER ... Reported-by: Michael Petlan Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Fixes: ac0e2cd55537 ("perf tools: Fix PMU term format max value calculation") Link: http://lkml.kernel.org/r/20181003072046.29276-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ec876f4b252c4084acad259ce3e65ad97f44f040 Author: Marc Zyngier Date: Thu Oct 4 09:35:35 2018 +0100 ARM: KVM: Correctly order SGI register entries in the cp15 array The ICC_ASGI1R and ICC_SGI0R register entries in the cp15 array are not correctly ordered, leading to a BUG() at boot time. Move them to their natural location. Fixes: 3e8a8a50c7ef ("KVM: arm: vgic-v3: Add support for ICC_SGI0R and ICC_ASGI1R accesses") Reported-by: Florian Fainelli Tested-by: Florian Fainelli Signed-off-by: Marc Zyngier commit 41591b38f5f8f78344954b68582b5f00e56ffe61 Author: Chris Boot Date: Mon Oct 8 17:07:30 2018 +0200 mmc: block: avoid multiblock reads for the last sector in SPI mode On some SD cards over SPI, reading with the multiblock read command the last sector will leave the card in a bad state. Remove last sectors from the multiblock reading cmd. Signed-off-by: Chris Boot Signed-off-by: Clément Péron Cc: stable@vger.kernel.org # v4.10+ Signed-off-by: Ulf Hansson commit 64c5e530ac2cab7e710c3bd08ef8594a016e4f9a Merge: 0854ba5ff5c9 c58a584f05e3 Author: Greg Kroah-Hartman Date: Tue Oct 9 09:17:46 2018 +0200 Merge tag 'arc-4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Vineet writes: "ARC updates for 4.19-rc8 - Fix clone syscall to update Thread pointer register - Make/build updates (needed for AGL/OE builds) [Alexey] - Typo fix [Colin Ian King]" * tag 'arc-4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: clone syscall to setp r25 as thread pointer ARC: build: Don't set CROSS_COMPILE in arch's Makefile ARC: fix spelling mistake "entires" -> "entries" ARC: build: Get rid of toolchain check ARCv2: build: use mcpu=hs38 iso generic mcpu=archs commit 184d47f0fd365108bd06ab26cdb3450b716269fd Author: Kees Cook Date: Mon Oct 8 16:54:34 2018 -0700 x86/mm: Avoid VLA in pgd_alloc() Arnd Bergmann reported that turning on -Wvla found a new (unintended) VLA usage: arch/x86/mm/pgtable.c: In function 'pgd_alloc': include/linux/build_bug.h:29:45: error: ISO C90 forbids variable length array 'u_pmds' [-Werror=vla] arch/x86/mm/pgtable.c:190:34: note: in expansion of macro 'static_cpu_has' #define PREALLOCATED_USER_PMDS (static_cpu_has(X86_FEATURE_PTI) ? \ ^~~~~~~~~~~~~~ arch/x86/mm/pgtable.c:431:16: note: in expansion of macro 'PREALLOCATED_USER_PMDS' pmd_t *u_pmds[PREALLOCATED_USER_PMDS]; ^~~~~~~~~~~~~~~~~~~~~~ Use the actual size of the array that is used for X86_FEATURE_PTI, which is known at build time, instead of the variable size. [ mingo: Squashed original fix with followup fix to avoid bisection breakage, wrote new changelog. ] Reported-by: Arnd Bergmann Original-written-by: Arnd Bergmann Reported-by: Borislav Petkov Signed-off-by: Kees Cook Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Dave Hansen Cc: Joerg Roedel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Toshi Kani Fixes: 1be3f247c288 ("x86/mm: Avoid VLA in pgd_alloc()") Link: http://lkml.kernel.org/r/20181008235434.GA35035@beast Signed-off-by: Ingo Molnar commit e054637597ba36d3729ba6a3a3dd7aad8e2a3003 Author: Srikar Dronamraju Date: Sat Oct 6 16:53:19 2018 +0530 mm, sched/numa: Remove remaining traces of NUMA rate-limiting Remove the leftover pglist_data::numabalancing_migrate_lock and its initialization, we stopped using this lock with: efaffc5e40ae ("mm, sched/numa: Remove rate-limiting of automatic NUMA balancing migration") [ mingo: Rewrote the changelog. ] Signed-off-by: Srikar Dronamraju Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Linux-MM Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1538824999-31230-1-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 49e00eee00612b1357596fed8a88b621a7648c14 Author: Reinette Chatre Date: Thu Oct 4 14:05:23 2018 -0700 x86/intel_rdt: Fix out-of-bounds memory access in CBM tests While the DOC at the beginning of lib/bitmap.c explicitly states that "The number of valid bits in a given bitmap does _not_ need to be an exact multiple of BITS_PER_LONG.", some of the bitmap operations do indeed access BITS_PER_LONG portions of the provided bitmap no matter the size of the provided bitmap. For example, if bitmap_intersects() is provided with an 8 bit bitmap the operation will access BITS_PER_LONG bits from the provided bitmap. While the operation ensures that these extra bits do not affect the result, the memory is still accessed. The capacity bitmasks (CBMs) are typically stored in u32 since they can never exceed 32 bits. A few instances exist where a bitmap_* operation is performed on a CBM by simply pointing the bitmap operation to the stored u32 value. The consequence of this pattern is that some bitmap_* operations will access out-of-bounds memory when interacting with the provided CBM. This is confirmed with a KASAN test that reports: BUG: KASAN: stack-out-of-bounds in __bitmap_intersects+0xa2/0x100 and BUG: KASAN: stack-out-of-bounds in __bitmap_weight+0x58/0x90 Fix this by moving any CBM provided to a bitmap operation needing BITS_PER_LONG to an 'unsigned long' variable. [ tglx: Changed related function arguments to unsigned long and got rid of the _cbm extra step ] Fixes: 72d505056604 ("x86/intel_rdt: Add utilities to test pseudo-locked region possibility") Fixes: 49f7b4efa110 ("x86/intel_rdt: Enable setting of exclusive mode") Fixes: d9b48c86eb38 ("x86/intel_rdt: Display resource groups' allocations' size in bytes") Fixes: 95f0b77efa57 ("x86/intel_rdt: Initialize new resource group with sane defaults") Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/69a428613a53f10e80594679ac726246020ff94f.1538686926.git.reinette.chatre@intel.com Signed-off-by: Ingo Molnar commit c1e15b4944c9fa7fbbb74f7a5920a1e31b4b965a Author: David Howells Date: Mon Oct 8 15:46:25 2018 +0100 rxrpc: Fix the packet reception routine The rxrpc_input_packet() function and its call tree was built around the assumption that data_ready() handler called from UDP to inform a kernel service that there is data to be had was non-reentrant. This means that certain locking could be dispensed with. This, however, turns out not to be the case with a multi-queue network card that can deliver packets to multiple cpus simultaneously. Each of those cpus can be in the rxrpc_input_packet() function at the same time. Fix by adding or changing some structure members: (1) Add peer->rtt_input_lock to serialise access to the RTT buffer. (2) Make conn->service_id into a 32-bit variable so that it can be cmpxchg'd on all arches. (3) Add call->input_lock to serialise access to the Rx/Tx state. Note that although the Rx and Tx states are (almost) entirely separate, there's no point completing the separation and having separate locks since it's a bi-phasal RPC protocol rather than a bi-direction streaming protocol. Data transmission and data reception do not take place simultaneously on any particular call. and making the following functional changes: (1) In rxrpc_input_data(), hold call->input_lock around the core to prevent simultaneous producing of packets into the Rx ring and updating of tracking state for a particular call. (2) In rxrpc_input_ping_response(), only read call->ping_serial once, and check it before checking RXRPC_CALL_PINGING as that's a cheaper test. The bit test and bit clear can then be combined. No further locking is needed here. (3) In rxrpc_input_ack(), take call->input_lock after we've parsed much of the ACK packet. The superseded ACK check is then done both before and after the lock is taken. The handing of ackinfo data is split, parsing before the lock is taken and processing with it held. This is keyed on rxMTU being non-zero. Congestion management is also done within the locked section. (4) In rxrpc_input_ackall(), take call->input_lock around the Tx window rotation. The ACKALL packet carries no information and is only really useful after all packets have been transmitted since it's imprecise. (5) In rxrpc_input_implicit_end_call(), we use rx->incoming_lock to prevent calls being simultaneously implicitly ended on two cpus and also to prevent any races with incoming call setup. (6) In rxrpc_input_packet(), use cmpxchg() to effect the service upgrade on a connection. It is only permitted to happen once for a connection. (7) In rxrpc_new_incoming_call(), we have to recheck the routing inside rx->incoming_lock to see if someone else set up the call, connection or peer whilst we were getting there. We can't trust the values from the earlier routing check unless we pin refs on them - which we want to avoid. Further, we need to allow for an incoming call to have its state changed on another CPU between us making it live and us adjusting it because the conn is now in the RXRPC_CONN_SERVICE state. (8) In rxrpc_peer_add_rtt(), take peer->rtt_input_lock around the access to the RTT buffer. Don't need to lock around setting peer->rtt. For reference, the inventory of state-accessing or state-altering functions used by the packet input procedure is: > rxrpc_input_packet() * PACKET CHECKING * ROUTING > rxrpc_post_packet_to_local() > rxrpc_find_connection_rcu() - uses RCU > rxrpc_lookup_peer_rcu() - uses RCU > rxrpc_find_service_conn_rcu() - uses RCU > idr_find() - uses RCU * CONNECTION-LEVEL PROCESSING - Service upgrade - Can only happen once per conn ! Changed to use cmpxchg > rxrpc_post_packet_to_conn() - Setting conn->hi_serial - Probably safe not using locks - Maybe use cmpxchg * CALL-LEVEL PROCESSING > Old-call checking > rxrpc_input_implicit_end_call() > rxrpc_call_completed() > rxrpc_queue_call() ! Need to take rx->incoming_lock > __rxrpc_disconnect_call() > rxrpc_notify_socket() > rxrpc_new_incoming_call() - Uses rx->incoming_lock for the entire process - Might be able to drop this earlier in favour of the call lock > rxrpc_incoming_call() ! Conflicts with rxrpc_input_implicit_end_call() > rxrpc_send_ping() - Don't need locks to check rtt state > rxrpc_propose_ACK * PACKET DISTRIBUTION > rxrpc_input_call_packet() > rxrpc_input_data() * QUEUE DATA PACKET ON CALL > rxrpc_reduce_call_timer() - Uses timer_reduce() ! Needs call->input_lock() > rxrpc_receiving_reply() ! Needs locking around ack state > rxrpc_rotate_tx_window() > rxrpc_end_tx_phase() > rxrpc_proto_abort() > rxrpc_input_dup_data() - Fills the Rx buffer - rxrpc_propose_ACK() - rxrpc_notify_socket() > rxrpc_input_ack() * APPLY ACK PACKET TO CALL AND DISCARD PACKET > rxrpc_input_ping_response() - Probably doesn't need any extra locking ! Need READ_ONCE() on call->ping_serial > rxrpc_input_check_for_lost_ack() - Takes call->lock to consult Tx buffer > rxrpc_peer_add_rtt() ! Needs to take a lock (peer->rtt_input_lock) ! Could perhaps manage with cmpxchg() and xadd() instead > rxrpc_input_requested_ack - Consults Tx buffer ! Probably needs a lock > rxrpc_peer_add_rtt() > rxrpc_propose_ack() > rxrpc_input_ackinfo() - Changes call->tx_winsize ! Use cmpxchg to handle change ! Should perhaps track serial number - Uses peer->lock to record MTU specification changes > rxrpc_proto_abort() ! Need to take call->input_lock > rxrpc_rotate_tx_window() > rxrpc_end_tx_phase() > rxrpc_input_soft_acks() - Consults the Tx buffer > rxrpc_congestion_management() - Modifies the Tx annotations ! Needs call->input_lock() > rxrpc_queue_call() > rxrpc_input_abort() * APPLY ABORT PACKET TO CALL AND DISCARD PACKET > rxrpc_set_call_completion() > rxrpc_notify_socket() > rxrpc_input_ackall() * APPLY ACKALL PACKET TO CALL AND DISCARD PACKET ! Need to take call->input_lock > rxrpc_rotate_tx_window() > rxrpc_end_tx_phase() > rxrpc_reject_packet() There are some functions used by the above that queue the packet, after which the procedure is terminated: - rxrpc_post_packet_to_local() - local->event_queue is an sk_buff_head - local->processor is a work_struct - rxrpc_post_packet_to_conn() - conn->rx_queue is an sk_buff_head - conn->processor is a work_struct - rxrpc_reject_packet() - local->reject_queue is an sk_buff_head - local->processor is a work_struct And some that offload processing to process context: - rxrpc_notify_socket() - Uses RCU lock - Uses call->notify_lock to call call->notify_rx - Uses call->recvmsg_lock to queue recvmsg side - rxrpc_queue_call() - call->processor is a work_struct - rxrpc_propose_ACK() - Uses call->lock to wrap __rxrpc_propose_ACK() And a bunch that complete a call, all of which use call->state_lock to protect the call state: - rxrpc_call_completed() - rxrpc_set_call_completion() - rxrpc_abort_call() - rxrpc_proto_abort() - Also uses rxrpc_queue_call() Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") Signed-off-by: David Howells commit 4e2abd3c051830a0d4189340fe79f2549bdf36de Author: David Howells Date: Mon Oct 8 19:44:39 2018 +0100 rxrpc: Fix the rxrpc_tx_packet trace line Fix the rxrpc_tx_packet trace line by storing the where parameter. Fixes: 4764c0da69dc ("rxrpc: Trace packet transmission") Signed-off-by: David Howells commit 647530924f47c93db472ee3cf43b7ef1425581b6 Author: David Howells Date: Mon Oct 8 15:46:17 2018 +0100 rxrpc: Fix connection-level abort handling Fix connection-level abort handling to cache the abort and error codes properly so that a new incoming call can be properly aborted if it races with the parent connection being aborted by another CPU. The abort_code and error parameters can then be dropped from rxrpc_abort_calls(). Fixes: f5c17aaeb2ae ("rxrpc: Calls should only have one terminal state") Signed-off-by: David Howells commit 298bc15b2079c324e82d0a6fda39c3d762af7282 Author: David Howells Date: Mon Oct 8 15:46:11 2018 +0100 rxrpc: Only take the rwind and mtu values from latest ACK Move the out-of-order and duplicate ACK packet check to before the call to rxrpc_input_ackinfo() so that the receive window size and MTU size are only checked in the latest ACK packet and don't regress. Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") Signed-off-by: David Howells commit d7782145e1ad537df4ce74e58c50f1f732a1462d Author: Dan Williams Date: Sat Oct 6 10:56:11 2018 -0700 filesystem-dax: Fix dax_layout_busy_page() livelock In the presence of multi-order entries the typical pagevec_lookup_entries() pattern may loop forever: while (index < end && pagevec_lookup_entries(&pvec, mapping, index, min(end - index, (pgoff_t)PAGEVEC_SIZE), indices)) { ... for (i = 0; i < pagevec_count(&pvec); i++) { index = indices[i]; ... } index++; /* BUG */ } The loop updates 'index' for each index found and then increments to the next possible page to continue the lookup. However, if the last entry in the pagevec is multi-order then the next possible page index is more than 1 page away. Fix this locally for the filesystem-dax case by checking for dax-multi-order entries. Going forward new users of multi-order entries need to be similarly careful, or we need a generic way to report the page increment in the radix iterator. Fixes: 5fac7408d828 ("mm, fs, dax: handle layout changes to pinned dax...") Cc: Cc: Ross Zwisler Cc: Matthew Wilcox Reviewed-by: Jan Kara Signed-off-by: Dan Williams commit ff5d1a42096cd96e70546c97d92f01d10cbddc2d Author: Kees Cook Date: Mon Oct 8 08:46:51 2018 -0700 sunvdc: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this moves the math for cookies calculation into macros and allocates a fixed size array for the maximum number of cookies and adds a runtime sanity check. (Note that the size was always fixed, but just hidden from the compiler.) [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Cc: Jens Axboe Cc: linux-block@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 25fe15e54fe5e15b4963fe101f7cd8bad4f11393 Author: Arnaldo Carvalho de Melo Date: Mon Oct 8 12:09:14 2018 -0300 tools headers uapi: Sync kvm.h copy To pick up the changes introduced in: 6fbbde9a1969 ("KVM: x86: Control guest reads of MSR_PLATFORM_INFO") That is not yet used in tools such as 'perf trace'. The type of the change in this file, a simple integer parameter to the KVM_CHECK_EXTENSION ioctl should be easier to implement tho, adding to the libbeauty TODO list. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Adrian Hunter Cc: David Ahern Cc: Drew Schmitt Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-67h1bio5bihi1q6dy7hgwwx8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4312f2ab136a5f1a7b247f6e4a75b95afaf9d23b Author: Arnaldo Carvalho de Melo Date: Mon Oct 8 12:04:51 2018 -0300 tools arch uapi: Sync the x86 kvm.h copy To get the changes in: d1766202779e ("x86/kvm/lapic: always disable MMIO interface in x2APIC mode") That at this time will not generate changes in tools such as 'perf trace', that still needs more work in tools/perf/examples/bpf/augmented_syscalls.c to need such id -> string tables. This silences the following perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h' diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Vitaly Kuznetsov Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-yadntj2ok6zpzjwi656onuh0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit dfe995224693798e554ab4770f6d8a096afc60cd Author: David Howells Date: Mon Oct 8 15:46:05 2018 +0100 rxrpc: Carry call state out of locked section in rxrpc_rotate_tx_window() Carry the call state out of the locked section in rxrpc_rotate_tx_window() rather than sampling it afterwards. This is only used to select tracepoint data, but could have changed by the time we do the tracepoint. Signed-off-by: David Howells commit c479d5f2c2e1ce609da08c075054440d97ddff52 Author: David Howells Date: Mon Oct 8 15:46:01 2018 +0100 rxrpc: Don't check RXRPC_CALL_TX_LAST after calling rxrpc_rotate_tx_window() We should only call the function to end a call's Tx phase if we rotated the marked-last packet out of the transmission buffer. Make rxrpc_rotate_tx_window() return an indication of whether it just rotated the packet marked as the last out of the transmit buffer, carrying the information out of the locked section in that function. We can then check the return value instead of examining RXRPC_CALL_TX_LAST. Fixes: 70790dbe3f66 ("rxrpc: Pass the last Tx packet marker in the annotation buffer") Signed-off-by: David Howells commit bfd2821117a751763718f1b5e57216c0d9b19a49 Author: David Howells Date: Mon Oct 8 15:45:56 2018 +0100 rxrpc: Don't need to take the RCU read lock in the packet receiver We don't need to take the RCU read lock in the rxrpc packet receive function because it's held further up the stack in the IP input routine around the UDP receive routines. Fix this by dropping the RCU read lock calls from rxrpc_input_packet(). This simplifies the code. Fixes: 70790dbe3f66 ("rxrpc: Pass the last Tx packet marker in the annotation buffer") Signed-off-by: David Howells commit 5271953cad31b97dea80f848c16e96ad66401199 Author: David Howells Date: Thu Oct 4 11:10:51 2018 +0100 rxrpc: Use the UDP encap_rcv hook Use the UDP encap_rcv hook to cut the bit out of the rxrpc packet reception in which a packet is placed onto the UDP receive queue and then immediately removed again by rxrpc. Going via the queue in this manner seems like it should be unnecessary. This does, however, require the invention of a value to place in encap_type as that's one of the conditions to switch packets out to the encap_rcv hook. Possibly the value doesn't actually matter for anything other than sockopts on the UDP socket, which aren't accessible outside of rxrpc anyway. This seems to cut a bit of time out of the time elapsed between each sk_buff being timestamped and turning up in rxrpc (the final number in the following trace excerpts). I measured this by making the rxrpc_rx_packet trace point print the time elapsed between the skb being timestamped and the current time (in ns), e.g.: ... 424.278721: rxrpc_rx_packet: ... ACK 25026 So doing a 512MiB DIO read from my test server, with an unmodified kernel: N min max sum mean stddev 27605 2626 7581 7.83992e+07 2840.04 181.029 and with the patch applied: N min max sum mean stddev 27547 1895 12165 6.77461e+07 2459.29 255.02 Signed-off-by: David Howells commit 0854ba5ff5c938307cd783e996b62c83f1ce923b Merge: 0238df646e62 b7dc10b64f61 Author: Greg Kroah-Hartman Date: Mon Oct 8 16:25:01 2018 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc David writes: "Sparc fixes: 1) Minor fallthru comment tweaks from Gustavo A. R. Silva. 2) VLA removal from Kees Cook. 3) Make sparc vdso Makefile match x86, from Masahiro Yamada. 4) Fix clock divider programming in mach64 driver, from Mikulas Patocka." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc64: fix fall-through annotation sparc32: fix fall-through annotation sparc: vdso: clean-up vdso Makefile oradax: remove redundant null check before kfree sparc64: viohs: Remove VLA usage sbus: Use of_get_child_by_name helper sparc: Convert to using %pOFn instead of device_node.name mach64: detect the dot clock divider correctly on sparc commit 48f78be3326052a7718678ff9a78d6d884a50323 Author: Keith Busch Date: Fri Oct 5 08:57:06 2018 -0600 nvme: remove ns sibling before clearing path The code had been clearing a namespace being deleted as the current path while that namespace was still in the path siblings list. It is possible a new IO could set that namespace back to the current path since it appeared to be an eligable path to select, which may result in a use-after-free error. This patch ensures a namespace being removed is not eligable to be reset as a current path prior to clearing it as the current path. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 262f9d811c7608f1e74258ceecfe1fa213bdf912 Author: Eric Dumazet Date: Fri Oct 5 19:38:46 2018 -0700 bpf: do not blindly change rlimit in reuseport net selftest If the current process has unlimited RLIMIT_MEMLOCK, we should should leave it as is. Fixes: 941ff6f11c02 ("bpf: fix rlimit in reuseport net selftest") Signed-off-by: John Sperbeck Signed-off-by: Eric Dumazet Acked-by: Daniel Borkmann Signed-off-by: Daniel Borkmann commit 7c75544983edece1b745367922cf1053606cd369 Merge: c458dda3d07c 24abf2901b18 Author: Martin Schwidefsky Date: Mon Oct 8 09:08:21 2018 +0200 Merge tag 'vfio-ccw-20181002' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw into fixes Pull vfio-ccw from Cornelia Huck with the following changes: - Another fix for vfio-ccw: make sure it accesses the correct entries in the pfn_array_table arrays when checking pinned pages. commit 5ba15878f23c4bafb95afa0dabe9d08d89520259 Merge: 0238df646e62 e46368cf77f2 Author: Dave Airlie Date: Mon Oct 8 16:37:56 2018 +1000 Merge branch 'linux-4.19' of git://github.com/skeggsb/linux into drm-fixes runtime refcount fix for mst connectors. Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/CABDvA=nydWjs26=TZHqistLXjCwm-vHmrisbP6K=FMZ5gW1wnQ@mail.gmail.com commit b7dc10b64f6190a008f05baf697d4d8fa9b8ed51 Author: Gustavo A. R. Silva Date: Tue Oct 2 12:19:54 2018 +0200 sparc64: fix fall-through annotation Replace "fallthru" with a proper "fall through" annotation. This fix is part of the ongoing efforts to enabling -Wimplicit-fallthrough Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit c4beb225f93a2fdaffbe2a610eccb0f6c86b3e45 Author: Gustavo A. R. Silva Date: Tue Oct 2 12:15:17 2018 +0200 sparc32: fix fall-through annotation Replace "fallthru" with a proper "fall through" annotation. This fix is part of the ongoing efforts to enabling -Wimplicit-fallthrough Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 8cf7765d33ae894cd7722502fbb737efad0eaa9b Author: Masahiro Yamada Date: Wed Sep 12 12:39:13 2018 +0900 sparc: vdso: clean-up vdso Makefile arch/sparc/vdso/Makefile is a replica of arch/x86/entry/vdso/Makefile. Clean-up the Makefile in the same way as I did for x86: - Remove unnecessary export - Put the generated linker script to $(obj)/ instead of $(src)/ - Simplify cmd_vdso2c The corresponding x86 commits are: - 61615faf0a89 ("x86/build/vdso: Remove unnecessary export in Makefile") - 1742ed2088cc ("x86/build/vdso: Put generated linker scripts to $(obj)/") - c5fcdbf15523 ("x86/build/vdso: Simplify 'cmd_vdso2c'") Signed-off-by: Masahiro Yamada Signed-off-by: David S. Miller commit 16e2a9d396c140d9a47d6b22e2a631f36c31e844 Author: Colin Ian King Date: Fri Sep 7 11:35:00 2018 +0100 oradax: remove redundant null check before kfree A null check before a kfree is redundant, so remove it. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 31a43fa7945a1de8c550b35c211be5670e32f12b Author: Kees Cook Date: Wed Sep 5 15:03:51 2018 -0700 sparc64: viohs: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this allocates a fixed size array for the maximum number of cookies and adds a runtime sanity check. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1 RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit df58f37b5d8f883fb18ba85e8d9a624154879832 Author: Rob Herring Date: Wed Aug 29 15:03:37 2018 -0500 sbus: Use of_get_child_by_name helper Use the of_get_child_by_name() helper instead of open coding searching for the '/options' node. This removes directly accessing the name pointer as well. Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: David S. Miller commit 0b9871a3a8cc7234c285b5d9bf66cc6712cfee7c Author: Rob Herring Date: Tue Aug 28 10:44:32 2018 -0500 sparc: Convert to using %pOFn instead of device_node.name In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: David S. Miller commit 76ebebd2464c5c8a4453c98b6dbf9c95a599e810 Author: Mikulas Patocka Date: Fri Aug 17 15:19:37 2018 -0400 mach64: detect the dot clock divider correctly on sparc On Sun Ultra 5, it happens that the dot clock is not set up properly for some videomodes. For example, if we set the videomode "r1024x768x60" in the firmware, Linux would incorrectly set a videomode with refresh rate 180Hz when booting (suprisingly, my LCD monitor can display it, although display quality is very low). The reason is this: Older mach64 cards set the divider in the register VCLK_POST_DIV. The register has four 2-bit fields (the field that is actually used is specified in the lowest two bits of the register CLOCK_CNTL). The 2 bits select divider "1, 2, 4, 8". On newer mach64 cards, there's another bit added - the top four bits of PLL_EXT_CNTL extend the divider selection, so we have possible dividers "1, 2, 4, 8, 3, 5, 6, 12". The Linux driver clears the top four bits of PLL_EXT_CNTL and never sets them, so it can work regardless if the card supports them. However, the sparc64 firmware may set these extended dividers during boot - and the mach64 driver detects incorrect dot clock in this case. This patch makes the driver read the additional divider bit from PLL_EXT_CNTL and calculate the initial refresh rate properly. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Acked-by: David S. Miller Reviewed-by: Ville Syrjälä Signed-off-by: David S. Miller commit e2a322a0c8ce3d825e8a56c063ce3f81b719083c Merge: 6d4c407744dd d4f0006a08f5 Author: David S. Miller Date: Sun Oct 7 21:06:28 2018 -0700 Merge branch 'net-smc-userspace-breakage-fixes' Eugene Syromiatnikov says: ==================== net/smc: userspace breakage fixes These two patches correct some userspace-affecting issues introduced during 4.19 development cycle, specifically: * New structure "struct smcd_diag_dmbinfo" has been defined in a way that would lead to different layout of the structure on most 32-bit ABIs in comparison with layout on 64-bit ABIs; * One of the commits renamed an UAPI-exposed field name. Changes since v1: * Managed not to forget to add --cover-letter. * Commit ID format in commit message has been changed in accordance with Sergei Shtylyov's recommendations. ==================== Signed-off-by: David S. Miller commit d4f0006a08f52b5320f038780286ef312535fc64 Author: Eugene Syromiatnikov Date: Sun Oct 7 16:57:37 2018 +0200 net/smc: retain old name for diag_mode field Commit c601171d7a60 ("net/smc: provide smc mode in smc_diag.c") changed the name of diag_fallback field of struct smc_diag_msg structure to diag_mode. However, this structure is a part of UAPI, and this change breaks user space applications that use it ([1], for example). Since the new name is more suitable, convert the field to a union that provides access to the data via both the new and the old name. [1] https://gitlab.com/strace/strace/blob/v4.24/netlink_smc_diag.c#L165 Fixes: c601171d7a60 ("net/smc: provide smc mode in smc_diag.c") Signed-off-by: Eugene Syromiatnikov Signed-off-by: David S. Miller commit a21048c8ec7caf4def353b00b75bf75535deba80 Author: Eugene Syromiatnikov Date: Sun Oct 7 16:57:31 2018 +0200 net/smc: use __aligned_u64 for 64-bit smc_diag fields Commit 4b1b7d3b30a6 ("net/smc: add SMC-D diag support") introduced new UAPI-exposed structure, struct smcd_diag_dmbinfo. However, it's not usable by compat binaries, as it has different layout there. Probably, the most straightforward fix that will avoid similar issues in the future is to use __aligned_u64 for 64-bit fields. Fixes: 4b1b7d3b30a6 ("net/smc: add SMC-D diag support") Signed-off-by: Eugene Syromiatnikov Signed-off-by: David S. Miller commit 6d4c407744dd0338da5d5d76f40dce5adabfb30a Author: Al Viro Date: Sun Oct 7 07:40:17 2018 -0400 net: sched: cls_u32: fix hnode refcounting cls_u32.c misuses refcounts for struct tc_u_hnode - it counts references via ->hlist and via ->tp_root together. u32_destroy() drops the former and, in case when there had been links, leaves the sucker on the list. As the result, there's nothing to protect it from getting freed once links are dropped. That also makes the "is it busy" check incapable of catching the root hnode - it *is* busy (there's a reference from tp), but we don't see it as something separate. "Is it our root?" check partially covers that, but the problem exists for others' roots as well. AFAICS, the minimal fix preserving the existing behaviour (where it doesn't include oopsen, that is) would be this: * count tp->root and tp_c->hlist as separate references. I.e. have u32_init() set refcount to 2, not 1. * in u32_destroy() we always drop the former; in u32_destroy_hnode() - the latter. That way we have *all* references contributing to refcount. List removal happens in u32_destroy_hnode() (called only when ->refcnt is 1) an in u32_destroy() in case of tc_u_common going away, along with everything reachable from it. IOW, that way we know that u32_destroy_key() won't free something still on the list (or pointed to by someone's ->root). Reproducer: tc qdisc add dev eth0 ingress tc filter add dev eth0 parent ffff: protocol ip prio 100 handle 1: \ u32 divisor 1 tc filter add dev eth0 parent ffff: protocol ip prio 200 handle 2: \ u32 divisor 1 tc filter add dev eth0 parent ffff: protocol ip prio 100 \ handle 1:0:11 u32 ht 1: link 801: offset at 0 mask 0f00 shift 6 \ plus 0 eat match ip protocol 6 ff tc filter delete dev eth0 parent ffff: protocol ip prio 200 tc filter change dev eth0 parent ffff: protocol ip prio 100 \ handle 1:0:11 u32 ht 1: link 0: offset at 0 mask 0f00 shift 6 plus 0 \ eat match ip protocol 6 ff tc filter delete dev eth0 parent ffff: protocol ip prio 100 Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 7e823644b60555f70f241274b8d0120dd919269a Author: Jiri Kosina Date: Thu Oct 4 13:37:32 2018 +0200 udp: Unbreak modules that rely on external __skb_recv_udp() availability Commit 2276f58ac589 ("udp: use a separate rx queue for packet reception") turned static inline __skb_recv_udp() from being a trivial helper around __skb_recv_datagram() into a UDP specific implementaion, making it EXPORT_SYMBOL_GPL() at the same time. There are external modules that got broken by __skb_recv_udp() not being visible to them. Let's unbreak them by making __skb_recv_udp EXPORT_SYMBOL(). Rationale (one of those) why this is actually "technically correct" thing to do: __skb_recv_udp() used to be an inline wrapper around __skb_recv_datagram(), which itself (still, and correctly so, I believe) is EXPORT_SYMBOL(). Cc: Paolo Abeni Cc: Eric Dumazet Fixes: 2276f58ac589 ("udp: use a separate rx queue for packet reception") Signed-off-by: Jiri Kosina Signed-off-by: David S. Miller commit 6685b357363bfe295e3ae73665014db4aed62c58 Author: Mike Rapoport Date: Sun Oct 7 11:31:51 2018 +0300 percpu: stop leaking bitmap metadata blocks The commit ca460b3c9627 ("percpu: introduce bitmap metadata blocks") introduced bitmap metadata blocks. These metadata blocks are allocated whenever a new chunk is created, but they are never freed. Fix it. Fixes: ca460b3c9627 ("percpu: introduce bitmap metadata blocks") Signed-off-by: Mike Rapoport Cc: stable@vger.kernel.org Signed-off-by: Dennis Zhou commit 0238df646e6224016a45505d2c111a24669ebe21 Author: Greg Kroah-Hartman Date: Sun Oct 7 17:26:02 2018 +0200 Linux 4.19-rc7 commit fb1c592cf4c9eeb84ec6bce13c13c11c7d05b6c7 Merge: 4ebaf0754c7a eafa717bc145 Author: Greg Kroah-Hartman Date: Sun Oct 7 08:15:57 2018 +0200 Merge tag 'char-misc-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc I wrote: "Char/Misc fixes for 4.19-rc7 Here are 8 small fixes for some char/misc driver issues Included here are: - fpga driver fixes - thunderbolt bugfixes - firmware core revert/fix - hv core fix - hv tool fix All of these have been in linux-next with no reported issues." * tag 'char-misc-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: thunderbolt: Initialize after IOMMUs thunderbolt: Do not handle ICM events after domain is stopped firmware: Always initialize the fw_priv list object docs: fpga: document fpga manager flags fpga: bridge: fix obvious function documentation error tools: hv: fcopy: set 'error' in case an unknown operation was requested fpga: do not access region struct after fpga_region_unregister Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect() commit 4ebaf0754c7a1109e66693f488f02b78f5875fee Merge: cc02f852872d 5b162cc4ac27 Author: Greg Kroah-Hartman Date: Sun Oct 7 08:14:59 2018 +0200 Merge tag 'tty-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty I wrote: "Serial driver fixes for 4.19-rc7 Here are 3 small serial driver fixes for 4.19-rc7 - 2 sh-sci bugfixes for reported issues - a revert of the PM handling for the 8250_dw code All of these have been in linux-next with no reported issues." * tag 'tty-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: Revert "serial: sh-sci: Allow for compressed SCIF address" Revert "serial: sh-sci: Remove SCIx_RZ_SCIFA_REGTYPE" Revert "serial: 8250_dw: Fix runtime PM handling" commit cc02f852872d2f9f3a15b3429b77998271814de0 Merge: 055d8d9eae35 555df5820e73 Author: Greg Kroah-Hartman Date: Sun Oct 7 08:14:06 2018 +0200 Merge tag 'usb-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb I wrote: "USB fixes for 4.19-rc7 Here are some small USB fixes for 4.19-rc7 These include: - the usual xhci bugfixes for reported issues - some new serial driver device ids - bugfix for the option serial driver for some devices - bugfix for the cdc_acm driver that has been there for a long time. All of these have been in linux-next for a while with no reported issues." * tag 'usb-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: xhci-mtk: resume USB3 roothub first xhci: Add missing CAS workaround for Intel Sunrise Point xHCI usb: cdc_acm: Do not leak URB buffers USB: serial: simple: add Motorola Tetra MTP6550 id USB: serial: option: add two-endpoints device-id flag USB: serial: option: improve Quectel EP06 detection commit 055d8d9eae35ac1edb97fcf70f357cea227bf3b2 Merge: 40fa9167d307 9ce7610e6d20 Author: Greg Kroah-Hartman Date: Sun Oct 7 07:07:33 2018 +0200 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Wolfram writes: "i2c for 4.19 I2C has three driver bugfixes and a fix for a typo for you." * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: designware: Call i2c_dw_clk_rate() only when calculating timings i2c: i2c-scmi: fix for i2c_smbus_write_block_data i2c: i2c-isch: fix spelling mistake "unitialized" -> "uninitialized" i2c: i2c-qcom-geni: Properly handle DMA safe buffers commit 40fa9167d307de29be2740bc10c4093502a917ed Merge: cd2093cb45a4 3cc5746e5ad7 Author: Greg Kroah-Hartman Date: Sun Oct 7 07:06:52 2018 +0200 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi James writes: "SCSI fixes on 20181006 Small fix for an unititialized mutex in the qedi driver." * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: qedi: Initialize the stats mutex lock commit cd2093cb45a4d9332d4e5a2170602f74bca298a4 Merge: c1d84a1b42ef ac1788cc7da4 Author: Greg Kroah-Hartman Date: Sun Oct 7 07:05:43 2018 +0200 Merge tag 'powerpc-4.19-4' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Michael writes: "powerpc fixes for 4.19 #4 Four regression fixes. A fix for a change to lib/xz which broke our zImage loader when building with XZ compression. OK'ed by Herbert who merged the original patch. The recent fix we did to avoid patching __init text broke some 32-bit machines, fix that. Our show_user_instructions() could be tricked into printing kernel memory, add a check to avoid that. And a fix for a change to our NUMA initialisation logic, which causes crashes in some kdump configurations. Thanks to: Christophe Leroy, Hari Bathini, Jann Horn, Joel Stanley, Meelis Roos, Murilo Opsfelder Araujo, Srikar Dronamraju." * tag 'powerpc-4.19-4' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/numa: Skip onlining a offline node in kdump path powerpc: Don't print kernel instructions in show_user_instructions() powerpc/lib: fix book3s/32 boot failure due to code patching lib/xz: Put CRC32_POLY_LE in xz_private.h commit c1d84a1b42ef70d8ae601df9cadedc7ed4f1beb1 Merge: 091a1eaa0e30 35f3625c2185 Author: Greg Kroah-Hartman Date: Sat Oct 6 02:11:30 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Dave writes: "Networking fixes: 1) Fix truncation of 32-bit right shift in bpf, from Jann Horn. 2) Fix memory leak in wireless wext compat, from Stefan Seyfried. 3) Use after free in cfg80211's reg_process_hint(), from Yu Zhao. 4) Need to cancel pending work when unbinding in smsc75xx otherwise we oops, also from Yu Zhao. 5) Don't allow enslaving a team device to itself, from Ido Schimmel. 6) Fix backwards compat with older userspace for rtnetlink FDB dumps. From Mauricio Faria. 7) Add validation of tc policy netlink attributes, from David Ahern. 8) Fix RCU locking in rawv6_send_hdrinc(), from Wei Wang." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits) net: mvpp2: Extract the correct ethtype from the skb for tx csum offload ipv6: take rcu lock in rawv6_send_hdrinc() net: sched: Add policy validation for tc attributes rtnetlink: fix rtnl_fdb_dump() for ndmsg header yam: fix a missing-check bug net: bpfilter: Fix type cast and pointer warnings net: cxgb3_main: fix a missing-check bug bpf: 32-bit RSH verification must truncate input before the ALU op net: phy: phylink: fix SFP interface autodetection be2net: don't flip hw_features when VXLANs are added/deleted net/packet: fix packet drop as of virtio gso net: dsa: b53: Keep CPU port as tagged in all VLANs openvswitch: load NAT helper bnxt_en: get the reduced max_irqs by the ones used by RDMA bnxt_en: free hwrm resources, if driver probe fails. bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request bnxt_en: Fix VNIC reservations on the PF. team: Forbid enslaving team device to itself net/usb: cancel pending work when unbinding smsc75xx mlxsw: spectrum: Delete RIF when VLAN device is removed ... commit b39989009bdb84992915c9869f58094ed5becf10 Author: Dave Chinner Date: Sat Oct 6 11:44:39 2018 +1000 xfs: fix data corruption w/ unaligned reflink ranges When reflinking sub-file ranges, a data corruption can occur when the source file range includes a partial EOF block. This shares the unknown data beyond EOF into the second file at a position inside EOF, exposing stale data in the second file. XFS only supports whole block sharing, but we still need to support whole file reflink correctly. Hence if the reflink request includes the last block of the souce file, only proceed with the reflink operation if it lands at or past the destination file's current EOF. If it lands within the destination file EOF, reject the entire request with -EINVAL and make the caller go the hard way. This avoids the data corruption vector, but also avoids disruption of returning EINVAL to userspace for the common case of whole file cloning. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit dceeb47b0ed65e14de53507a8a9c32a90831cfa1 Author: Dave Chinner Date: Sat Oct 6 11:44:19 2018 +1000 xfs: fix data corruption w/ unaligned dedupe ranges A deduplication data corruption is Exposed by fstests generic/505 on XFS. It is caused by extending the block match range to include the partial EOF block, but then allowing unknown data beyond EOF to be considered a "match" to data in the destination file because the comparison is only made to the end of the source file. This corrupts the destination file when the source extent is shared with it. XFS only supports whole block dedupe, but we still need to appear to support whole file dedupe correctly. Hence if the dedupe request includes the last block of the souce file, don't include it in the actual XFS dedupe operation. If the rest of the range dedupes successfully, then report the partial last block as deduped, too, so that userspace sees it as a successful dedupe rather than return EINVAL because we can't dedupe unaligned blocks. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 329e09893909d409039f6a79757d9b80b67efe39 Author: Kees Cook Date: Fri Oct 5 16:21:46 2018 -0700 treewide: Replace more open-coded allocation size multiplications As done treewide earlier, this catches several more open-coded allocation size calculations that were added to the kernel during the merge window. This performs the following mechanical transformations using Coccinelle: kvmalloc(a * b, ...) -> kvmalloc_array(a, b, ...) kvzalloc(a * b, ...) -> kvcalloc(a, b, ...) devm_kzalloc(..., a * b, ...) -> devm_kcalloc(..., a, b, ...) Signed-off-by: Kees Cook commit 091a1eaa0e309b0e8dcbf3f2da12c7f3d03ed182 Merge: 5943a9bbbb98 d41aa5252394 Author: Greg Kroah-Hartman Date: Fri Oct 5 16:33:03 2018 -0700 Merge branch 'akpm' * akpm: mm: madvise(MADV_DODUMP): allow hugetlbfs pages ocfs2: fix locking for res->tracking and dlm->tracking_list mm/vmscan.c: fix int overflow in callers of do_shrink_slab() mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly mm/vmstat.c: fix outdated vmstat_text proc: restrict kernel stack dumps to root mm/hugetlb: add mmap() encodings for 32MB and 512MB page sizes mm/migrate.c: split only transparent huge pages when allocation fails ipc/shm.c: use ERR_CAST() for shm_lock() error return mm/gup_benchmark: fix unsigned comparison to zero in __gup_benchmark_ioctl mm, thp: fix mlocking THP page with migration enabled ocfs2: fix crash in ocfs2_duplicate_clusters_by_page() hugetlb: take PMD sharing into account when flushing tlb/caches mm: migration: fix migration of huge PMD shared pages commit d41aa5252394c065d1f04d1ceea885b70d00c9c6 Author: Daniel Black Date: Fri Oct 5 15:52:19 2018 -0700 mm: madvise(MADV_DODUMP): allow hugetlbfs pages Reproducer, assuming 2M of hugetlbfs available: Hugetlbfs mounted, size=2M and option user=testuser # mount | grep ^hugetlbfs hugetlbfs on /dev/hugepages type hugetlbfs (rw,pagesize=2M,user=dan) # sysctl vm.nr_hugepages=1 vm.nr_hugepages = 1 # grep Huge /proc/meminfo AnonHugePages: 0 kB ShmemHugePages: 0 kB HugePages_Total: 1 HugePages_Free: 1 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB Hugetlb: 2048 kB Code: #include #include #define SIZE 2*1024*1024 int main() { void *ptr; ptr = mmap(NULL, SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_HUGETLB | MAP_ANONYMOUS, -1, 0); madvise(ptr, SIZE, MADV_DONTDUMP); madvise(ptr, SIZE, MADV_DODUMP); } Compile and strace: mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB, -1, 0) = 0x7ff7c9200000 madvise(0x7ff7c9200000, 2097152, MADV_DONTDUMP) = 0 madvise(0x7ff7c9200000, 2097152, MADV_DODUMP) = -1 EINVAL (Invalid argument) hugetlbfs pages have VM_DONTEXPAND in the VmFlags driver pages based on author testing with analysis from Florian Weimer[1]. The inclusion of VM_DONTEXPAND into the VM_SPECIAL defination was a consequence of the large useage of VM_DONTEXPAND in device drivers. A consequence of [2] is that VM_DONTEXPAND marked pages are unable to be marked DODUMP. A user could quite legitimately madvise(MADV_DONTDUMP) their hugetlbfs memory for a while and later request that madvise(MADV_DODUMP) on the same memory. We correct this omission by allowing madvice(MADV_DODUMP) on hugetlbfs pages. [1] https://stackoverflow.com/questions/52548260/madvisedodump-on-the-same-ptr-size-as-a-successful-madvisedontdump-fails-wit [2] commit 0103bd16fb90 ("mm: prepare VM_DONTDUMP for using in drivers") Link: http://lkml.kernel.org/r/20180930054629.29150-1-daniel@linux.ibm.com Link: https://lists.launchpad.net/maria-discuss/msg05245.html Fixes: 0103bd16fb90 ("mm: prepare VM_DONTDUMP for using in drivers") Reported-by: Kenneth Penza Signed-off-by: Daniel Black Reviewed-by: Mike Kravetz Cc: Konstantin Khlebnikov Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit cbe355f57c8074bc4f452e5b6e35509044c6fa23 Author: Ashish Samant Date: Fri Oct 5 15:52:15 2018 -0700 ocfs2: fix locking for res->tracking and dlm->tracking_list In dlm_init_lockres() we access and modify res->tracking and dlm->tracking_list without holding dlm->track_lock. This can cause list corruptions and can end up in kernel panic. Fix this by locking res->tracking and dlm->tracking_list with dlm->track_lock instead of dlm->spinlock. Link: http://lkml.kernel.org/r/1529951192-4686-1-git-send-email-ashish.samant@oracle.com Signed-off-by: Ashish Samant Reviewed-by: Changwei Ge Acked-by: Joseph Qi Acked-by: Jun Piao Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit b8e57efa2c98cc56c49461c4950cf026422c29e9 Author: Kirill Tkhai Date: Fri Oct 5 15:52:10 2018 -0700 mm/vmscan.c: fix int overflow in callers of do_shrink_slab() do_shrink_slab() returns unsigned long value, and the placing into int variable cuts high bytes off. Then we compare ret and 0xfffffffe (since SHRINK_EMPTY is converted to ret type). Thus a large number of objects returned by do_shrink_slab() may be interpreted as SHRINK_EMPTY, if low bytes of their value are equal to 0xfffffffe. Fix that by declaration ret as unsigned long in these functions. Link: http://lkml.kernel.org/r/153813407177.17544.14888305435570723973.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Reported-by: Cyrill Gorcunov Acked-by: Cyrill Gorcunov Reviewed-by: Josef Bacik Cc: Michal Hocko Cc: Andrey Ryabinin Cc: Johannes Weiner Cc: Tetsuo Handa Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 58bc4c34d249bf1bc50730a9a209139347cfacfe Author: Jann Horn Date: Fri Oct 5 15:52:07 2018 -0700 mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly 5dd0b16cdaff ("mm/vmstat: Make NR_TLB_REMOTE_FLUSH_RECEIVED available even on UP") made the availability of the NR_TLB_REMOTE_FLUSH* counters inside the kernel unconditional to reduce #ifdef soup, but (either to avoid showing dummy zero counters to userspace, or because that code was missed) didn't update the vmstat_array, meaning that all following counters would be shown with incorrect values. This only affects kernel builds with CONFIG_VM_EVENT_COUNTERS=y && CONFIG_DEBUG_TLBFLUSH=y && CONFIG_SMP=n. Link: http://lkml.kernel.org/r/20181001143138.95119-2-jannh@google.com Fixes: 5dd0b16cdaff ("mm/vmstat: Make NR_TLB_REMOTE_FLUSH_RECEIVED available even on UP") Signed-off-by: Jann Horn Reviewed-by: Kees Cook Reviewed-by: Andrew Morton Acked-by: Michal Hocko Acked-by: Roman Gushchin Cc: Davidlohr Bueso Cc: Oleg Nesterov Cc: Christoph Lameter Cc: Kemi Wang Cc: Andy Lutomirski Cc: Ingo Molnar Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 28e2c4bb99aa40f9d5f07ac130cbc4da0ea93079 Author: Jann Horn Date: Fri Oct 5 15:52:03 2018 -0700 mm/vmstat.c: fix outdated vmstat_text 7a9cdebdcc17 ("mm: get rid of vmacache_flush_all() entirely") removed the VMACACHE_FULL_FLUSHES statistics, but didn't remove the corresponding entry in vmstat_text. This causes an out-of-bounds access in vmstat_show(). Luckily this only affects kernels with CONFIG_DEBUG_VM_VMACACHE=y, which is probably very rare. Link: http://lkml.kernel.org/r/20181001143138.95119-1-jannh@google.com Fixes: 7a9cdebdcc17 ("mm: get rid of vmacache_flush_all() entirely") Signed-off-by: Jann Horn Reviewed-by: Kees Cook Reviewed-by: Andrew Morton Acked-by: Michal Hocko Acked-by: Roman Gushchin Cc: Davidlohr Bueso Cc: Oleg Nesterov Cc: Christoph Lameter Cc: Kemi Wang Cc: Andy Lutomirski Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit f8a00cef17206ecd1b30d3d9f99e10d9fa707aa7 Author: Jann Horn Date: Fri Oct 5 15:51:58 2018 -0700 proc: restrict kernel stack dumps to root Currently, you can use /proc/self/task/*/stack to cause a stack walk on a task you control while it is running on another CPU. That means that the stack can change under the stack walker. The stack walker does have guards against going completely off the rails and into random kernel memory, but it can interpret random data from your kernel stack as instruction pointers and stack pointers. This can cause exposure of kernel stack contents to userspace. Restrict the ability to inspect kernel stacks of arbitrary tasks to root in order to prevent a local attacker from exploiting racy stack unwinding to leak kernel task stack contents. See the added comment for a longer rationale. There don't seem to be any users of this userspace API that can't gracefully bail out if reading from the file fails. Therefore, I believe that this change is unlikely to break things. In the case that this patch does end up needing a revert, the next-best solution might be to fake a single-entry stack based on wchan. Link: http://lkml.kernel.org/r/20180927153316.200286-1-jannh@google.com Fixes: 2ec220e27f50 ("proc: add /proc/*/stack") Signed-off-by: Jann Horn Acked-by: Kees Cook Cc: Alexey Dobriyan Cc: Ken Chen Cc: Will Deacon Cc: Laura Abbott Cc: Andy Lutomirski Cc: Catalin Marinas Cc: Josh Poimboeuf Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H . Peter Anvin" Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 20916d4636a9b3c1bf562b305f91d126771edaf9 Author: Anshuman Khandual Date: Fri Oct 5 15:51:54 2018 -0700 mm/hugetlb: add mmap() encodings for 32MB and 512MB page sizes ARM64 architecture also supports 32MB and 512MB HugeTLB page sizes. This just adds mmap() system call argument encoding for them. Link: http://lkml.kernel.org/r/1537841300-6979-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Acked-by: Punit Agrawal Acked-by: Mike Kravetz Cc: Michal Hocko Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit e6112fc300702f96374f34368513d57795fc6d23 Author: Anshuman Khandual Date: Fri Oct 5 15:51:51 2018 -0700 mm/migrate.c: split only transparent huge pages when allocation fails split_huge_page_to_list() fails on HugeTLB pages. I was experimenting with moving 32MB contig HugeTLB pages on arm64 (with a debug patch applied) and hit the following stack trace when the kernel crashed. [ 3732.462797] Call trace: [ 3732.462835] split_huge_page_to_list+0x3b0/0x858 [ 3732.462913] migrate_pages+0x728/0xc20 [ 3732.462999] soft_offline_page+0x448/0x8b0 [ 3732.463097] __arm64_sys_madvise+0x724/0x850 [ 3732.463197] el0_svc_handler+0x74/0x110 [ 3732.463297] el0_svc+0x8/0xc [ 3732.463347] Code: d1000400 f90b0e60 f2fbd5a2 a94982a1 (f9000420) When unmap_and_move[_huge_page]() fails due to lack of memory, the splitting should happen only for transparent huge pages not for HugeTLB pages. PageTransHuge() returns true for both THP and HugeTLB pages. Hence the conditonal check should test PagesHuge() flag to make sure that given pages is not a HugeTLB one. Link: http://lkml.kernel.org/r/1537798495-4996-1-git-send-email-anshuman.khandual@arm.com Fixes: 94723aafb9 ("mm: unclutter THP migration") Signed-off-by: Anshuman Khandual Acked-by: Michal Hocko Acked-by: Naoya Horiguchi Cc: Kirill A. Shutemov Cc: Zi Yan Cc: Mike Kravetz Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 59cf0a9339ca4b0226e9b4329dfb0a5b8b0b9bc2 Author: Kees Cook Date: Fri Oct 5 15:51:48 2018 -0700 ipc/shm.c: use ERR_CAST() for shm_lock() error return This uses ERR_CAST() instead of an open-coded cast, as it is casting across structure pointers, which upsets __randomize_layout: ipc/shm.c: In function `shm_lock': ipc/shm.c:209:9: note: randstruct: casting between randomized structure pointer types (ssa): `struct shmid_kernel' and `struct kern_ipc_perm' return (void *)ipcp; ^~~~~~~~~~~~ Link: http://lkml.kernel.org/r/20180919180722.GA15073@beast Fixes: 82061c57ce93 ("ipc: drop ipc_lock()") Signed-off-by: Kees Cook Cc: Davidlohr Bueso Cc: Manfred Spraul Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 51896864579d5a3349740847083f4db5c6487164 Author: YueHaibing Date: Fri Oct 5 15:51:44 2018 -0700 mm/gup_benchmark: fix unsigned comparison to zero in __gup_benchmark_ioctl get_user_pages_fast() will return negative value if no pages were pinned, then be converted to a unsigned, which is compared to zero, giving the wrong result. Link: http://lkml.kernel.org/r/20180921095015.26088-1-yuehaibing@huawei.com Fixes: 09e35a4a1ca8 ("mm/gup_benchmark: handle gup failures") Signed-off-by: YueHaibing Reviewed-by: Andrew Morton Cc: Michael S. Tsirkin Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit e125fe405abedc1dc8a5b2229b80ee91c1434015 Author: Kirill A. Shutemov Date: Fri Oct 5 15:51:41 2018 -0700 mm, thp: fix mlocking THP page with migration enabled A transparent huge page is represented by a single entry on an LRU list. Therefore, we can only make unevictable an entire compound page, not individual subpages. If a user tries to mlock() part of a huge page, we want the rest of the page to be reclaimable. We handle this by keeping PTE-mapped huge pages on normal LRU lists: the PMD on border of VM_LOCKED VMA will be split into PTE table. Introduction of THP migration breaks[1] the rules around mlocking THP pages. If we had a single PMD mapping of the page in mlocked VMA, the page will get mlocked, regardless of PTE mappings of the page. For tmpfs/shmem it's easy to fix by checking PageDoubleMap() in remove_migration_pmd(). Anon THP pages can only be shared between processes via fork(). Mlocked page can only be shared if parent mlocked it before forking, otherwise CoW will be triggered on mlock(). For Anon-THP, we can fix the issue by munlocking the page on removing PTE migration entry for the page. PTEs for the page will always come after mlocked PMD: rmap walks VMAs from oldest to newest. Test-case: #include #include #include #include #include int main(void) { unsigned long nodemask = 4; void *addr; addr = mmap((void *)0x20000000UL, 2UL << 20, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_LOCKED, -1, 0); if (fork()) { wait(NULL); return 0; } mlock(addr, 4UL << 10); mbind(addr, 2UL << 20, MPOL_PREFERRED | MPOL_F_RELATIVE_NODES, &nodemask, 4, MPOL_MF_MOVE); return 0; } [1] https://lkml.kernel.org/r/CAOMGZ=G52R-30rZvhGxEbkTw7rLLwBGadVYeo--iizcD3upL3A@mail.gmail.com Link: http://lkml.kernel.org/r/20180917133816.43995-1-kirill.shutemov@linux.intel.com Fixes: 616b8371539a ("mm: thp: enable thp migration in generic path") Signed-off-by: Kirill A. Shutemov Reported-by: Vegard Nossum Reviewed-by: Zi Yan Cc: Naoya Horiguchi Cc: Vlastimil Babka Cc: Andrea Arcangeli Cc: [4.14+] Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 69eb7765b9c6902444c89c54e7043242faf981e5 Author: Larry Chen Date: Fri Oct 5 15:51:37 2018 -0700 ocfs2: fix crash in ocfs2_duplicate_clusters_by_page() ocfs2_duplicate_clusters_by_page() may crash if one of the extent's pages is dirty. When a page has not been written back, it is still in dirty state. If ocfs2_duplicate_clusters_by_page() is called against the dirty page, the crash happens. To fix this bug, we can just unlock the page and wait until the page until its not dirty. The following is the backtrace: kernel BUG at /root/code/ocfs2/refcounttree.c:2961! [exception RIP: ocfs2_duplicate_clusters_by_page+822] __ocfs2_move_extent+0x80/0x450 [ocfs2] ? __ocfs2_claim_clusters+0x130/0x250 [ocfs2] ocfs2_defrag_extent+0x5b8/0x5e0 [ocfs2] __ocfs2_move_extents_range+0x2a4/0x470 [ocfs2] ocfs2_move_extents+0x180/0x3b0 [ocfs2] ? ocfs2_wait_for_recovery+0x13/0x70 [ocfs2] ocfs2_ioctl_move_extents+0x133/0x2d0 [ocfs2] ocfs2_ioctl+0x253/0x640 [ocfs2] do_vfs_ioctl+0x90/0x5f0 SyS_ioctl+0x74/0x80 do_syscall_64+0x74/0x140 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 Once we find the page is dirty, we do not wait until it's clean, rather we use write_one_page() to write it back Link: http://lkml.kernel.org/r/20180829074740.9438-1-lchen@suse.com [lchen@suse.com: update comments] Link: http://lkml.kernel.org/r/20180830075041.14879-1-lchen@suse.com [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Larry Chen Acked-by: Changwei Ge Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Joseph Qi Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit dff11abe280b47c21b804a8ace318e0638bb9a49 Author: Mike Kravetz Date: Fri Oct 5 15:51:33 2018 -0700 hugetlb: take PMD sharing into account when flushing tlb/caches When fixing an issue with PMD sharing and migration, it was discovered via code inspection that other callers of huge_pmd_unshare potentially have an issue with cache and tlb flushing. Use the routine adjust_range_if_pmd_sharing_possible() to calculate worst case ranges for mmu notifiers. Ensure that this range is flushed if huge_pmd_unshare succeeds and unmaps a PUD_SUZE area. Link: http://lkml.kernel.org/r/20180823205917.16297-3-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Acked-by: Kirill A. Shutemov Reviewed-by: Naoya Horiguchi Cc: Vlastimil Babka Cc: Davidlohr Bueso Cc: Michal Hocko Cc: Jerome Glisse Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 017b1660df89f5fb4bfe66c34e35f7d2031100c7 Author: Mike Kravetz Date: Fri Oct 5 15:51:29 2018 -0700 mm: migration: fix migration of huge PMD shared pages The page migration code employs try_to_unmap() to try and unmap the source page. This is accomplished by using rmap_walk to find all vmas where the page is mapped. This search stops when page mapcount is zero. For shared PMD huge pages, the page map count is always 1 no matter the number of mappings. Shared mappings are tracked via the reference count of the PMD page. Therefore, try_to_unmap stops prematurely and does not completely unmap all mappings of the source page. This problem can result is data corruption as writes to the original source page can happen after contents of the page are copied to the target page. Hence, data is lost. This problem was originally seen as DB corruption of shared global areas after a huge page was soft offlined due to ECC memory errors. DB developers noticed they could reproduce the issue by (hotplug) offlining memory used to back huge pages. A simple testcase can reproduce the problem by creating a shared PMD mapping (note that this must be at least PUD_SIZE in size and PUD_SIZE aligned (1GB on x86)), and using migrate_pages() to migrate process pages between nodes while continually writing to the huge pages being migrated. To fix, have the try_to_unmap_one routine check for huge PMD sharing by calling huge_pmd_unshare for hugetlbfs huge pages. If it is a shared mapping it will be 'unshared' which removes the page table entry and drops the reference on the PMD page. After this, flush caches and TLB. mmu notifiers are called before locking page tables, but we can not be sure of PMD sharing until page tables are locked. Therefore, check for the possibility of PMD sharing before locking so that notifiers can prepare for the worst possible case. Link: http://lkml.kernel.org/r/20180823205917.16297-2-mike.kravetz@oracle.com [mike.kravetz@oracle.com: make _range_in_vma() a static inline] Link: http://lkml.kernel.org/r/6063f215-a5c8-2f0c-465a-2c515ddc952d@oracle.com Fixes: 39dde65c9940 ("shared page table for hugetlb page") Signed-off-by: Mike Kravetz Acked-by: Kirill A. Shutemov Reviewed-by: Naoya Horiguchi Acked-by: Michal Hocko Cc: Vlastimil Babka Cc: Davidlohr Bueso Cc: Jerome Glisse Cc: Mike Kravetz Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 5943a9bbbb98b5c957662edd2fc902cc14e65895 Merge: b98d6cb80b0d 95375f2ab296 Author: Greg Kroah-Hartman Date: Fri Oct 5 16:11:16 2018 -0700 Merge tag 'pci-v4.19-fixes-3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Bjorn writes: "PCI fixes for v4.19: - Reprogram bridge prefetch registers to fix NVIDIA and Radeon issues after suspend/resume (Daniel Drake) - Fix mvebu I/O mapping creation sequence (Thomas Petazzoni) - Fix minor MAINTAINERS file match issue (Bjorn Helgaas)" * tag 'pci-v4.19-fixes-3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: mvebu: Fix PCI I/O mapping creation sequence MAINTAINERS: Remove obsolete drivers/pci pattern from ACPI section PCI: Reprogram bridge prefetch registers on resume commit b98d6cb80b0dc44e1d3382bc8c530eaa80ad5b6c Merge: 3830711f3e93 5d07384a666d Author: Greg Kroah-Hartman Date: Fri Oct 5 16:09:56 2018 -0700 Merge tag 'for-4.19/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Mike writes: "device mapper fixes - Fix a DM thinp __udivdi3 undefined on 32-bit bug introduced during 4.19 merge window. - Fix leak and dangling pointer in DM multipath's scsi_dh related code. - A couple stable@ fixes for DM cache's resize support. - A DM raid fix to remove "const" from decipher_sync_action()'s return type." * tag 'for-4.19/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm cache: fix resize crash if user doesn't reload cache table dm cache metadata: ignore hints array being too small during resize dm raid: remove bogus const from decipher_sync_action() return type dm mpath: fix attached_handler_name leak and dangling hw_handler_name pointer dm thin metadata: fix __udivdi3 undefined on 32-bit commit 3830711f3e93b056e3e3597f2b39da2df4636e0b Merge: 5aebc7d2780d 19a4fbffc94e Author: Greg Kroah-Hartman Date: Fri Oct 5 16:09:11 2018 -0700 Merge tag 'gpio-v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Linus writes: "A single GPIO fix: Free the last used descriptor, an off by one error. This is tagged for stable as well." * tag 'gpio-v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpiolib: Free the last requested descriptor commit 5aebc7d2780df9176ee92f6d3bfd54b04457e349 Merge: 31d099085d54 69e445ab8b66 Author: Greg Kroah-Hartman Date: Fri Oct 5 16:08:12 2018 -0700 Merge tag 'pm-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Rafael writes: "Power management fix for 4.19-rc7 Fix a bug that may cause runtime PM to misbehave for some devices after a failing or aborted system suspend which is nasty enough for an -rc7 time frame fix." * tag 'pm-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM / core: Clear the direct_complete flag on errors commit 31d099085d5415a073b52358a5fc61d50e9ab614 Merge: 247373b5dd68 d7cbbe49a930 Author: Greg Kroah-Hartman Date: Fri Oct 5 16:07:13 2018 -0700 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "perf fixes: - fix a CPU#0 hot unplug bug and a PCI enumeration bug in the x86 Intel uncore PMU driver - fix a CPU event enumeration bug in the x86 AMD PMU driver - fix a perf ring-buffer corruption bug when using tracepoints - fix a PMU unregister locking bug" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/amd/uncore: Set ThreadMask and SliceMask for L3 Cache perf events perf/x86/intel/uncore: Fix PCI BDF address of M3UPI on SKX perf/ring_buffer: Prevent concurent ring buffer access perf/x86/intel/uncore: Use boot_cpu_data.phys_proc_id instead of hardcorded physical package ID 0 perf/core: Fix perf_pmu_unregister() locking commit 247373b5dd685fd307d2ea7fd0e58353486e4ad4 Merge: 8be673735e51 02e425668f5c Author: Greg Kroah-Hartman Date: Fri Oct 5 15:40:57 2018 -0700 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "x86 fixes: Misc fixes: - fix various vDSO bugs: asm constraints and retpolines - add vDSO test units to make sure they never re-appear - fix UV platform TSC initialization bug - fix build warning on Clang" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/vdso: Fix vDSO syscall fallback asm constraint regression x86/cpu/amd: Remove unnecessary parentheses x86/vdso: Only enable vDSO retpolines when enabled and supported x86/tsc: Fix UV TSC initialization x86/platform/uv: Provide is_early_uv_system() selftests/x86: Add clock_gettime() tests to test_vdso x86/vdso: Fix asm constraints on vDSO syscall fallbacks commit 8be673735e5144e13fe739fba5a0a33fc50f3a16 Merge: 1df377db3d01 37355bdc5a12 Author: Greg Kroah-Hartman Date: Fri Oct 5 15:39:38 2018 -0700 Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "scheduler fixes: These fixes address a rather involved performance regression between v4.17->v4.19 in the sched/numa auto-balancing code. Since distros really need this fix we accelerated it to sched/urgent for a faster upstream merge. NUMA scheduling and balancing performance is now largely back to v4.17 levels, without reintroducing the NUMA placement bugs that v4.18 and v4.19 fixed. Many thanks to Srikar Dronamraju, Mel Gorman and Jirka Hladky, for reporting, testing, re-testing and solving this rather complex set of bugs." * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/numa: Migrate pages to local nodes quicker early in the lifetime of a task mm, sched/numa: Remove rate-limiting of automatic NUMA balancing migration sched/numa: Avoid task migration for small NUMA improvement mm/migrate: Use spin_trylock() while resetting rate limit sched/numa: Limit the conditions where scan period is reset sched/numa: Reset scan rate whenever task moves across nodes sched/numa: Pass destination CPU as a parameter to migrate_task_rq sched/numa: Stop multiple tasks from moving to the CPU at the same time commit 1df377db3d0131057fa33b4dcda05c3e341308ab Merge: 8b6b383c1fa3 e4a02ed2aaf4 Author: Greg Kroah-Hartman Date: Fri Oct 5 15:38:32 2018 -0700 Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Ingo writes: "locking fixes: A fix in the ww_mutex self-test that produces a scary splat, plus an updates to the maintained-filed patters in MAINTAINER." * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/ww_mutex: Fix runtime warning in the WW mutex selftest MAINTAINERS: Remove dead path from LOCKING PRIMITIVES entry commit 8b6b383c1fa33c7ed49885672cc2ddf61d6b46f0 Merge: b2e45b46d85b 709ae62e8e6d Author: Greg Kroah-Hartman Date: Fri Oct 5 15:37:22 2018 -0700 Merge tag 'sound-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Takashi writes: "sound fixes for 4.19-rc7 Just two small fixes for HD-audio: one is for a typo in completion timeout, and another a fixup for Dell machines as usual" * tag 'sound-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Cannot adjust speaker's volume on Dell XPS 27 7760 ALSA: hda: Fix the audio-component completion timeout commit 35f3625c21852ad839f20c91c7d81c4c1101e207 Author: Maxime Chevallier Date: Fri Oct 5 09:04:40 2018 +0200 net: mvpp2: Extract the correct ethtype from the skb for tx csum offload When offloading the L3 and L4 csum computation on TX, we need to extract the l3_proto from the ethtype, independently of the presence of a vlan tag. The actual driver uses skb->protocol as-is, resulting in packets with the wrong L4 checksum being sent when there's a vlan tag in the packet header and checksum offloading is enabled. This commit makes use of vlan_protocol_get() to get the correct ethtype regardless the presence of a vlan tag. Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit") Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit a688caa34beb2fd2a92f1b6d33e40cde433ba160 Author: Wei Wang Date: Thu Oct 4 10:12:37 2018 -0700 ipv6: take rcu lock in rawv6_send_hdrinc() In rawv6_send_hdrinc(), in order to avoid an extra dst_hold(), we directly assign the dst to skb and set passed in dst to NULL to avoid double free. However, in error case, we free skb and then do stats update with the dst pointer passed in. This causes use-after-free on the dst. Fix it by taking rcu read lock right before dst could get released to make sure dst does not get freed until the stats update is done. Note: we don't have this issue in ipv4 cause dst is not used for stats update in v4. Syzkaller reported following crash: BUG: KASAN: use-after-free in rawv6_send_hdrinc net/ipv6/raw.c:692 [inline] BUG: KASAN: use-after-free in rawv6_sendmsg+0x4421/0x4630 net/ipv6/raw.c:921 Read of size 8 at addr ffff8801d95ba730 by task syz-executor0/32088 CPU: 1 PID: 32088 Comm: syz-executor0 Not tainted 4.19.0-rc2+ #93 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 rawv6_send_hdrinc net/ipv6/raw.c:692 [inline] rawv6_sendmsg+0x4421/0x4630 net/ipv6/raw.c:921 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2114 __sys_sendmsg+0x11d/0x280 net/socket.c:2152 __do_sys_sendmsg net/socket.c:2161 [inline] __se_sys_sendmsg net/socket.c:2159 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2159 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457099 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f83756edc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f83756ee6d4 RCX: 0000000000457099 RDX: 0000000000000000 RSI: 0000000020003840 RDI: 0000000000000004 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004d4b30 R14: 00000000004c90b1 R15: 0000000000000000 Allocated by task 32088: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x730 mm/slab.c:3554 dst_alloc+0xbb/0x1d0 net/core/dst.c:105 ip6_dst_alloc+0x35/0xa0 net/ipv6/route.c:353 ip6_rt_cache_alloc+0x247/0x7b0 net/ipv6/route.c:1186 ip6_pol_route+0x8f8/0xd90 net/ipv6/route.c:1895 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2093 fib6_rule_lookup+0x277/0x860 net/ipv6/fib6_rules.c:122 ip6_route_output_flags+0x2c5/0x350 net/ipv6/route.c:2121 ip6_route_output include/net/ip6_route.h:88 [inline] ip6_dst_lookup_tail+0xe27/0x1d60 net/ipv6/ip6_output.c:951 ip6_dst_lookup_flow+0xc8/0x270 net/ipv6/ip6_output.c:1079 rawv6_sendmsg+0x12d9/0x4630 net/ipv6/raw.c:905 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2114 __sys_sendmsg+0x11d/0x280 net/socket.c:2152 __do_sys_sendmsg net/socket.c:2161 [inline] __se_sys_sendmsg net/socket.c:2159 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2159 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 5356: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x83/0x290 mm/slab.c:3756 dst_destroy+0x267/0x3c0 net/core/dst.c:141 dst_destroy_rcu+0x16/0x19 net/core/dst.c:154 __rcu_reclaim kernel/rcu/rcu.h:236 [inline] rcu_do_batch kernel/rcu/tree.c:2576 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2880 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2847 [inline] rcu_process_callbacks+0xf23/0x2670 kernel/rcu/tree.c:2864 __do_softirq+0x30b/0xad8 kernel/softirq.c:292 Fixes: 1789a640f556 ("raw: avoid two atomics in xmit") Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit c58a584f05e35d1d4342923cd7aac07d9c3d3d16 Author: Vineet Gupta Date: Fri Oct 5 12:48:48 2018 -0700 ARC: clone syscall to setp r25 as thread pointer Per ARC TLS ABI, r25 is designated TP (thread pointer register). However so far kernel didn't do any special treatment, like setting up usermode r25, even for CLONE_SETTLS. We instead relied on libc runtime to do this, in say clone libc wrapper [1]. This was deliberate to keep kernel ABI agnostic (userspace could potentially change TP, specially for different ARC ISA say ARCompact vs. ARCv2 with different spare registers etc) However userspace setting up r25, after clone syscall opens a race, if child is not scheduled and gets a signal instead. It starts off in userspace not in clone but in a signal handler and anything TP sepcific there such as pthread_self() fails which showed up with uClibc testsuite nptl/tst-kill6 [2] Fix this by having kernel populate r25 to TP value. So this locks in ABI, but it was not going to change anyways, and fwiw is same for both ARCompact (arc700 core) and ARCvs (HS3x cores) [1] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libc/sysdeps/linux/arc/clone.S [2] https://github.com/wbx-github/uclibc-ng-test/blob/master/test/nptl/tst-kill6.c Fixes: ARC STAR 9001378481 Cc: stable@vger.kernel.org Reported-by: Nikita Sobolev Signed-off-by: Vineet Gupta commit 8b4c3cdd9dd8290343ce959a132d3b334062c5b9 Author: David Ahern Date: Wed Oct 3 15:05:36 2018 -0700 net: sched: Add policy validation for tc attributes A number of TC attributes are processed without proper validation (e.g., length checks). Add a tca policy for all input attributes and use when invoking nlmsg_parse. The 2 Fixes tags below cover the latest additions. The other attributes are a string (KIND), nested attribute (OPTIONS which does seem to have validation in most cases), for dumps only or a flag. Fixes: 5bc1701881e39 ("net: sched: introduce multichain support for filters") Fixes: d47a6b0e7c492 ("net: sched: introduce ingress/egress block index attributes for qdisc") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit bd961c9bc66497f0c63f4ba1d02900bb85078366 Author: Mauricio Faria de Oliveira Date: Mon Oct 1 22:46:40 2018 -0300 rtnetlink: fix rtnl_fdb_dump() for ndmsg header Currently, rtnl_fdb_dump() assumes the family header is 'struct ifinfomsg', which is not always true -- 'struct ndmsg' is used by iproute2 ('ip neigh'). The problem is, the function bails out early if nlmsg_parse() fails, which does occur for iproute2 usage of 'struct ndmsg' because the payload length is shorter than the family header alone (as 'struct ifinfomsg' is assumed). This breaks backward compatibility with userspace -- nothing is sent back. Some examples with iproute2 and netlink library for go [1]: 1) $ bridge fdb show 33:33:00:00:00:01 dev ens3 self permanent 01:00:5e:00:00:01 dev ens3 self permanent 33:33:ff:15:98:30 dev ens3 self permanent This one works, as it uses 'struct ifinfomsg'. fdb_show() @ iproute2/bridge/fdb.c """ .n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)), ... if (rtnl_dump_request(&rth, RTM_GETNEIGH, [...] """ 2) $ ip --family bridge neigh RTNETLINK answers: Invalid argument Dump terminated This one fails, as it uses 'struct ndmsg'. do_show_or_flush() @ iproute2/ip/ipneigh.c """ .n.nlmsg_type = RTM_GETNEIGH, .n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg)), """ 3) $ ./neighlist < no output > This one fails, as it uses 'struct ndmsg'-based. neighList() @ netlink/neigh_linux.go """ req := h.newNetlinkRequest(unix.RTM_GETNEIGH, [...] msg := Ndmsg{ """ The actual breakage was introduced by commit 0ff50e83b512 ("net: rtnetlink: bail out from rtnl_fdb_dump() on parse error"), because nlmsg_parse() fails if the payload length (with the _actual_ family header) is less than the family header length alone (which is assumed, in parameter 'hdrlen'). This is true in the examples above with struct ndmsg, with size and payload length shorter than struct ifinfomsg. However, that commit just intends to fix something under the assumption the family header is indeed an 'struct ifinfomsg' - by preventing access to the payload as such (via 'ifm' pointer) if the payload length is not sufficient to actually contain it. The assumption was introduced by commit 5e6d24358799 ("bridge: netlink dump interface at par with brctl"), to support iproute2's 'bridge fdb' command (not 'ip neigh') which indeed uses 'struct ifinfomsg', thus is not broken. So, in order to unbreak the 'struct ndmsg' family headers and still allow 'struct ifinfomsg' to continue to work, check for the known message sizes used with 'struct ndmsg' in iproute2 (with zero or one attribute which is not used in this function anyway) then do not parse the data as ifinfomsg. Same examples with this patch applied (or revert/before the original fix): $ bridge fdb show 33:33:00:00:00:01 dev ens3 self permanent 01:00:5e:00:00:01 dev ens3 self permanent 33:33:ff:15:98:30 dev ens3 self permanent $ ip --family bridge neigh dev ens3 lladdr 33:33:00:00:00:01 PERMANENT dev ens3 lladdr 01:00:5e:00:00:01 PERMANENT dev ens3 lladdr 33:33:ff:15:98:30 PERMANENT $ ./neighlist netlink.Neigh{LinkIndex:2, Family:7, State:128, Type:0, Flags:2, IP:net.IP(nil), HardwareAddr:net.HardwareAddr{0x33, 0x33, 0x0, 0x0, 0x0, 0x1}, LLIPAddr:net.IP(nil), Vlan:0, VNI:0} netlink.Neigh{LinkIndex:2, Family:7, State:128, Type:0, Flags:2, IP:net.IP(nil), HardwareAddr:net.HardwareAddr{0x1, 0x0, 0x5e, 0x0, 0x0, 0x1}, LLIPAddr:net.IP(nil), Vlan:0, VNI:0} netlink.Neigh{LinkIndex:2, Family:7, State:128, Type:0, Flags:2, IP:net.IP(nil), HardwareAddr:net.HardwareAddr{0x33, 0x33, 0xff, 0x15, 0x98, 0x30}, LLIPAddr:net.IP(nil), Vlan:0, VNI:0} Tested on mainline (v4.19-rc6) and net-next (3bd09b05b068). References: [1] netlink library for go (test-case) https://github.com/vishvananda/netlink $ cat ~/go/src/neighlist/main.go package main import ("fmt"; "syscall"; "github.com/vishvananda/netlink") func main() { neighs, _ := netlink.NeighList(0, syscall.AF_BRIDGE) for _, neigh := range neighs { fmt.Printf("%#v\n", neigh) } } $ export GOPATH=~/go $ go get github.com/vishvananda/netlink $ go build neighlist $ ~/go/src/neighlist/neighlist Thanks to David Ahern for suggestions to improve this patch. Fixes: 0ff50e83b512 ("net: rtnetlink: bail out from rtnl_fdb_dump() on parse error") Fixes: 5e6d24358799 ("bridge: netlink dump interface at par with brctl") Reported-by: Aidan Obley Signed-off-by: Mauricio Faria de Oliveira Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 0781168e23a2fc8dceb989f11fc5b39b3ccacc35 Author: Wenwen Wang Date: Fri Oct 5 10:59:36 2018 -0500 yam: fix a missing-check bug In yam_ioctl(), the concrete ioctl command is firstly copied from the user-space buffer 'ifr->ifr_data' to 'ioctl_cmd' and checked through the following switch statement. If the command is not as expected, an error code EINVAL is returned. In the following execution the buffer 'ifr->ifr_data' is copied again in the cases of the switch statement to specific data structures according to what kind of ioctl command is requested. However, after the second copy, no re-check is enforced on the newly-copied command. Given that the buffer 'ifr->ifr_data' is in the user space, a malicious user can race to change the command between the two copies. This way, the attacker can inject inconsistent data and cause undefined behavior. This patch adds a re-check in each case of the switch statement if there is a second copy in that case, to re-check whether the command obtained in the second copy is the same as the one in the first copy. If not, an error code EINVAL will be returned. Signed-off-by: Wenwen Wang Signed-off-by: David S. Miller commit 33aa8da1f8a7dc050b9d68f1db761ab787621065 Author: Shanthosh RK Date: Fri Oct 5 20:57:48 2018 +0530 net: bpfilter: Fix type cast and pointer warnings Fixes the following Sparse warnings: net/bpfilter/bpfilter_kern.c:62:21: warning: cast removes address space of expression net/bpfilter/bpfilter_kern.c:101:49: warning: Using plain integer as NULL pointer Signed-off-by: Shanthosh RK Signed-off-by: David S. Miller commit 2c05d88818ab6571816b93edce4d53703870d7ae Author: Wenwen Wang Date: Fri Oct 5 08:48:27 2018 -0500 net: cxgb3_main: fix a missing-check bug In cxgb_extension_ioctl(), the command of the ioctl is firstly copied from the user-space buffer 'useraddr' to 'cmd' and checked through the switch statement. If the command is not as expected, an error code EOPNOTSUPP is returned. In the following execution, i.e., the cases of the switch statement, the whole buffer of 'useraddr' is copied again to a specific data structure, according to what kind of command is requested. However, after the second copy, there is no re-check on the newly-copied command. Given that the buffer 'useraddr' is in the user space, a malicious user can race to change the command between the two copies. By doing so, the attacker can supply malicious data to the kernel and cause undefined behavior. This patch adds a re-check in each case of the switch statement if there is a second copy in that case, to re-check whether the command obtained in the second copy is the same as the one in the first copy. If not, an error code EINVAL is returned. Signed-off-by: Wenwen Wang Signed-off-by: David S. Miller commit cecf10704899467a787975e3d94a1f0129b9688e Author: Dmitry Torokhov Date: Thu Oct 4 17:50:48 2018 -0700 Input: uinput - add a schedule point in uinput_inject_events() Large writes to uinput interface may cause rcu stalls. Let's add cond_resched() to the loop to avoid this. Reviewed-by: Paul E. McKenney Signed-off-by: Dmitry Torokhov commit 36d2582ff235b4e01ad64a734c877a52dc762d9c Author: Dmitry Torokhov Date: Thu Oct 4 17:45:54 2018 -0700 Input: evdev - add a schedule point in evdev_write() Large writes to evdev interface may cause rcu stalls. Let's add cond_resched() to the loop to avoid this. Reviewed-by: Paul E. McKenney Signed-off-by: Dmitry Torokhov commit b8d5b7cec43618c8f91a9fbe80067ef2dcbc4d35 Merge: 7e4183752735 b799207e1e18 Author: David S. Miller Date: Fri Oct 5 10:53:13 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2018-10-05 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix to truncate input on ALU operations in 32 bit mode, from Jann. 2) Fixes for cgroup local storage to reject reserved flags on element update and rejection of map allocation with zero-sized value, from Roman. ==================== Signed-off-by: David S. Miller commit b799207e1e1816b09e7a5920fbb2d5fcf6edd681 Author: Jann Horn Date: Fri Oct 5 18:17:59 2018 +0200 bpf: 32-bit RSH verification must truncate input before the ALU op When I wrote commit 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification"), I assumed that, in order to emulate 64-bit arithmetic with 32-bit logic, it is sufficient to just truncate the output to 32 bits; and so I just moved the register size coercion that used to be at the start of the function to the end of the function. That assumption is true for almost every op, but not for 32-bit right shifts, because those can propagate information towards the least significant bit. Fix it by always truncating inputs for 32-bit ops to 32 bits. Also get rid of the coerce_reg_to_size() after the ALU op, since that has no effect. Fixes: 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification") Acked-by: Daniel Borkmann Signed-off-by: Jann Horn Signed-off-by: Daniel Borkmann commit 148b9aba99e0bbadf361747d21456e1589015f74 Author: Maciej W. Rozycki Date: Tue Oct 2 12:50:11 2018 +0100 MIPS: memset: Fix CPU_DADDI_WORKAROUNDS `small_fixup' regression Fix a commit 8a8158c85e1e ("MIPS: memset.S: EVA & fault support for small_memset") regression and remove assembly warnings: arch/mips/lib/memset.S: Assembler messages: arch/mips/lib/memset.S:243: Warning: Macro instruction expanded into multiple instructions in a branch delay slot triggering with the CPU_DADDI_WORKAROUNDS option set and this code: PTR_SUBU a2, t1, a0 jr ra PTR_ADDIU a2, 1 This is because with that option in place the DADDIU instruction, which the PTR_ADDIU CPP macro expands to, becomes a GAS macro, which in turn expands to an LI/DADDU (or actually ADDIU/DADDU) sequence: 13c: 01a4302f dsubu a2,t1,a0 140: 03e00008 jr ra 144: 24010001 li at,1 148: 00c1302d daddu a2,a2,at ... Correct this by switching off the `noreorder' assembly mode and letting GAS schedule this jump's delay slot, as there is nothing special about it that would require manual scheduling. With this change in place correct code is produced: 13c: 01a4302f dsubu a2,t1,a0 140: 24010001 li at,1 144: 03e00008 jr ra 148: 00c1302d daddu a2,a2,at ... Signed-off-by: Maciej W. Rozycki Signed-off-by: Paul Burton Fixes: 8a8158c85e1e ("MIPS: memset.S: EVA & fault support for small_memset") Patchwork: https://patchwork.linux-mips.org/patch/20833/ Cc: Ralf Baechle Cc: stable@vger.kernel.org # 4.17+ commit c1883f10cfe05c707cce46d6999411c50a2413ca Merge: d7cbbe49a930 7a8a8fcf7b86 Author: Ingo Molnar Date: Fri Oct 5 18:14:00 2018 +0200 Merge tag 'perf-urgent-for-mingo-4.19-20181005' 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 the build on Clear Linux, coping with redundant declarations of function prototypes in python3 header files by adding -Wno-redundant-decls to build with PYTHON=python3 (Arnaldo Carvalho de Melo) - Fixes for processing inline frames in backtraces using DWARF based unwinding (Milian Wolff) - Cope with bad DWARF info for function names for inline frames,not trying to demangle this symbol. Problem reported with rust but reproduced as well with C++. Problem reported to the libbpf maintainers (Milian Wolff) - Fix python export to postgresql and sqlite code (Adrian Hunter) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit b2e45b46d85bfc67b7b28e0e0c1c7e9b9a35892c Merge: 08b297bb10d6 b3e9b515b08e Author: Greg Kroah-Hartman Date: Fri Oct 5 08:30:40 2018 -0700 Merge tag 'iommu-fixes-v4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Joerg writes: "IOMMU Fix for Linux v4.19-rc6 One important fix: - Fix a memory leak with AMD IOMMU when SME is active and a VM has assigned devices. In that case the complete guest memory will be leaked without this fix." * tag 'iommu-fixes-v4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/amd: Clear memory encryption mask from physical address commit 08b297bb10d6a270739d92098adabe3c550377e9 Merge: 4fbeba43b9b6 cc906f07d7d5 Author: Greg Kroah-Hartman Date: Fri Oct 5 08:29:44 2018 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Paolo writes: "KVM changes for 4.19-rc7 x86 and PPC bugfixes, mostly introduced in 4.19-rc1." * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: kvm: nVMX: fix entry with pending interrupt if APICv is enabled KVM: VMX: hide flexpriority from guest when disabled at the module level KVM: VMX: check for existence of secondary exec controls before accessing KVM: PPC: Book3S HV: Avoid crash from THP collapse during radix page fault KVM: x86: fix L1TF's MMIO GFN calculation tools/kvm_stat: cut down decimal places in update interval dialog KVM: nVMX: Fix emulation of VM_ENTRY_LOAD_BNDCFGS KVM: x86: Do not use kvm_x86_ops->mpx_supported() directly KVM: nVMX: Do not expose MPX VMX controls when guest MPX disabled KVM: x86: never trap MSR_KERNEL_GS_BASE commit 4fbeba43b9b6f76a270108edcf5305dc1882a478 Merge: 087f759a4155 ba439a6cbfa2 Author: Greg Kroah-Hartman Date: Fri Oct 5 08:28:35 2018 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Herbert writes: "Crypto Fixes for 4.19 This push fixes the following issues: - Out-of-bound stack access in qat. - Illegal schedule in mxs-dcp. - Memory corruption in chelsio. - Incorrect pointer computation in caam." * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: qat - Fix KASAN stack-out-of-bounds bug in adf_probe() crypto: mxs-dcp - Fix wait logic on chan threads crypto: chelsio - Fix memory corruption in DMA Mapped buffers. crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic commit 087f759a4155dcae08fb82841af2bafd231c7c9b Merge: befad944e231 7af929d6d05b Author: Greg Kroah-Hartman Date: Fri Oct 5 08:27:47 2018 -0700 Merge tag '4.19-rc6-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Steve writes: "SMB3 fixes four small SMB3 fixes: one for stable, the others to address a more recent regression" * tag '4.19-rc6-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb3: fix lease break problem introduced by compounding cifs: only wake the thread for the very last PDU in a compound cifs: add a warning if we try to to dequeue a deleted mid smb2: fix missing files in root share directory listing commit 7a8a8fcf7b860e4b2d4edc787c844d41cad9dfcf Author: Milian Wolff Date: Wed Sep 26 15:52:06 2018 +0200 perf record: Use unmapped IP for inline callchain cursors Only use the mapped IP to find inline frames, but keep using the unmapped IP for the callchain cursor. This ensures we properly show the unmapped IP when displaying a frame we received via the dso__parse_addr_inlines API for a module which does not contain sufficient debug symbols to show the srcline. This is another follow-up to commit 19610184693c ("perf script: Show virtual addresses instead of offsets"). Signed-off-by: Milian Wolff Acked-by: Jiri Olsa Tested-by: Ravi Bangoria Tested-by: Arnaldo Carvalho de Melo Cc: Jin Yao Cc: Namhyung Kim Cc: Sandipan Das Fixes: 19610184693c ("perf script: Show virtual addresses instead of offsets") Link: http://lkml.kernel.org/r/20180926135207.30263-2-milian.wolff@kdab.com Link: http://lkml.kernel.org/r/20181002073949.3297-1-milian.wolff@kdab.com [ Squashed a fix from Milian for a problem reported by Ravi, fixed up space damage ] Signed-off-by: Arnaldo Carvalho de Melo commit 62165600ae73ebd76e2d9b992b36360408d570d8 Author: Steven Rostedt (VMware) Date: Fri Oct 5 10:08:03 2018 -0400 vsprintf: Fix off-by-one bug in bstr_printf() processing dereferenced pointers The functions vbin_printf() and bstr_printf() are used by trace_printk() to try to keep the overhead down during printing. trace_printk() uses vbin_printf() at the time of execution, as it only scans the fmt string to record the printf values into the buffer, and then uses vbin_printf() to do the conversions to print the string based on the format and the saved values in the buffer. This is an issue for dereferenced pointers, as before commit 841a915d20c7b, the processing of the pointer could happen some time after the pointer value was recorded (reading the trace buffer). This means the processing of the value at a later time could show different results, or even crash the system, if the pointer no longer existed. Commit 841a915d20c7b addressed this by processing dereferenced pointers at the time of execution and save the result in the ring buffer as a string. The bstr_printf() would then treat these pointers as normal strings, and print the value. But there was an off-by-one bug here, where after processing the argument, it move the pointer only "strlen(arg)" which made the arg pointer not point to the next argument in the ring buffer, but instead point to the nul character of the last argument. This causes any values after a dereferenced pointer to be corrupted. Cc: stable@vger.kernel.org Fixes: 841a915d20c7b ("vsprintf: Do not have bprintf dereference pointers") Reported-by: Nikolay Borisov Tested-by: Nikolay Borisov Signed-off-by: Steven Rostedt (VMware) commit 05a2f54679861deb188750ba2a70187000b2c71f Author: Arnaldo Carvalho de Melo Date: Tue Sep 18 16:08:02 2018 -0300 perf python: Use -Wno-redundant-decls to build with PYTHON=python3 When building in ClearLinux using 'make PYTHON=python3' with gcc 8.2.1 it fails with: GEN /tmp/build/perf/python/perf.so In file included from /usr/include/python3.7m/Python.h:126, from /git/linux/tools/perf/util/python.c:2: /usr/include/python3.7m/import.h:58:24: error: redundant redeclaration of ‘_PyImport_AddModuleObject’ [-Werror=redundant-decls] PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *, PyObject *); ^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/python3.7m/import.h:47:24: note: previous declaration of ‘_PyImport_AddModuleObject’ was here PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *name, ^~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors error: command 'gcc' failed with exit status 1 And indeed there is a redundant declaration in that Python.h file, one with parameter names and the other without, so just add -Wno-error=redundant-decls to the python setup instructions. Now perf builds with gcc in ClearLinux with the following Dockerfile: # docker.io/acmel/linux-perf-tools-build-clearlinux:latest FROM docker.io/clearlinux:latest MAINTAINER Arnaldo Carvalho de Melo RUN swupd update && \ swupd bundle-add sysadmin-basic-dev RUN mkdir -m 777 -p /git /tmp/build/perf /tmp/build/objtool /tmp/build/linux && \ groupadd -r perfbuilder && \ useradd -m -r -g perfbuilder perfbuilder && \ chown -R perfbuilder.perfbuilder /tmp/build/ /git/ USER perfbuilder COPY rx_and_build.sh / ENV EXTRA_MAKE_ARGS=PYTHON=python3 ENTRYPOINT ["/rx_and_build.sh"] Now to figure out why the build fails with clang, that is present in the above container as detected by the rx_and_build.sh script: clang version 6.0.1 (tags/RELEASE_601/final) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/sbin make: Entering directory '/git/linux/tools/perf' BUILD: Doing 'make -j4' parallel build HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep Auto-detecting system features: ... dwarf: [ OFF ] ... dwarf_getlocations: [ OFF ] ... glibc: [ OFF ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ OFF ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libslang: [ OFF ] ... libcrypto: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ OFF ] ... lzma: [ OFF ] ... get_cpuid: [ OFF ] ... bpf: [ OFF ] Makefile.config:331: *** No gnu/libc-version.h found, please install glibc-dev[el]. Stop. make[1]: *** [Makefile.perf:206: sub-make] Error 2 make: *** [Makefile:70: all] Error 2 make: Leaving directory '/git/linux/tools/perf' Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Thiago Macieira Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-c3khb9ac86s00qxzjrueomme@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2cfa2271604bb26e75b828d38f357ed084464795 Author: David Howells Date: Fri Oct 5 14:05:35 2018 +0100 rxrpc: Fix the data_ready handler Fix the rxrpc_data_ready() function to pick up all packets and to not miss any. There are two problems: (1) The sk_data_ready pointer on the UDP socket is set *after* it is bound. This means that it's open for business before we're ready to dequeue packets and there's a tiny window exists in which a packet can sneak onto the receive queue, but we never know about it. Fix this by setting the pointers on the socket prior to binding it. (2) skb_recv_udp() will return an error (such as ENETUNREACH) if there was an error on the transmission side, even though we set the sk_error_report hook. Because rxrpc_data_ready() returns immediately in such a case, it never actually removes its packet from the receive queue. Fix this by abstracting out the UDP dequeuing and checksumming into a separate function that keeps hammering on skb_recv_udp() until it returns -EAGAIN, passing the packets extracted to the remainder of the function. and two potential problems: (3) It might be possible in some circumstances or in the future for packets to be being added to the UDP receive queue whilst rxrpc is running consuming them, so the data_ready() handler might get called less often than once per packet. Allow for this by fully draining the queue on each call as (2). (4) If a packet fails the checksum check, the code currently returns after discarding the packet without checking for more. Allow for this by fully draining the queue on each call as (2). Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") Signed-off-by: David Howells Acked-by: Paolo Abeni commit 5e33a23ba4b56c109b732d57a0a76558a37d9ec5 Author: David Howells Date: Fri Oct 5 14:05:34 2018 +0100 rxrpc: Fix some missed refs to init_net Fix some refs to init_net that should've been changed to the appropriate network namespace. Fixes: 2baec2c3f854 ("rxrpc: Support network namespacing") Signed-off-by: David Howells Acked-by: Paolo Abeni commit ac1788cc7da4ce54edcfd2e499afdb0a23d5c41d Author: Srikar Dronamraju Date: Fri Sep 28 09:17:32 2018 +0530 powerpc/numa: Skip onlining a offline node in kdump path With commit 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot"), kdump kernel on shared LPAR may crash. The necessary conditions are - Shared LPAR with at least 2 nodes having memory and CPUs. - Memory requirement for kdump kernel must be met by the first N-1 nodes where there are at least N nodes with memory and CPUs. Example numactl of such a machine. $ numactl -H available: 5 nodes (0,2,5-7) node 0 cpus: node 0 size: 0 MB node 0 free: 0 MB node 2 cpus: node 2 size: 255 MB node 2 free: 189 MB node 5 cpus: 24 25 26 27 28 29 30 31 node 5 size: 4095 MB node 5 free: 4024 MB node 6 cpus: 0 1 2 3 4 5 6 7 16 17 18 19 20 21 22 23 node 6 size: 6353 MB node 6 free: 5998 MB node 7 cpus: 8 9 10 11 12 13 14 15 32 33 34 35 36 37 38 39 node 7 size: 7640 MB node 7 free: 7164 MB node distances: node 0 2 5 6 7 0: 10 40 40 40 40 2: 40 10 40 40 40 5: 40 40 10 40 40 6: 40 40 40 10 20 7: 40 40 40 20 10 Steps to reproduce. 1. Load / start kdump service. 2. Trigger a kdump (for example : echo c > /proc/sysrq-trigger) When booting a kdump kernel with 2048M: kexec: Starting switchover sequence. I'm in purgatory Using 1TB segments hash-mmu: Initializing hash mmu with SLB Linux version 4.19.0-rc5-master+ (srikar@linux-xxu6) (gcc version 4.8.5 (SUSE Linux)) #1 SMP Thu Sep 27 19:45:00 IST 2018 Found initrd at 0xc000000009e70000:0xc00000000ae554b4 Using pSeries machine description ----------------------------------------------------- ppc64_pft_size = 0x1e phys_mem_size = 0x88000000 dcache_bsize = 0x80 icache_bsize = 0x80 cpu_features = 0x000000ff8f5d91a7 possible = 0x0000fbffcf5fb1a7 always = 0x0000006f8b5c91a1 cpu_user_features = 0xdc0065c2 0xef000000 mmu_features = 0x7c006001 firmware_features = 0x00000007c45bfc57 htab_hash_mask = 0x7fffff physical_start = 0x8000000 ----------------------------------------------------- numa: NODE_DATA [mem 0x87d5e300-0x87d67fff] numa: NODE_DATA(0) on node 6 numa: NODE_DATA [mem 0x87d54600-0x87d5e2ff] Top of RAM: 0x88000000, Total RAM: 0x88000000 Memory hole size: 0MB Zone ranges: DMA [mem 0x0000000000000000-0x0000000087ffffff] DMA32 empty Normal empty Movable zone start for each node Early memory node ranges node 6: [mem 0x0000000000000000-0x0000000087ffffff] Could not find start_pfn for node 0 Initmem setup node 0 [mem 0x0000000000000000-0x0000000000000000] On node 0 totalpages: 0 Initmem setup node 6 [mem 0x0000000000000000-0x0000000087ffffff] On node 6 totalpages: 34816 Unable to handle kernel paging request for data at address 0x00000060 Faulting instruction address: 0xc000000008703a54 Oops: Kernel access of bad area, sig: 11 [#1] LE SMP NR_CPUS=2048 NUMA pSeries Modules linked in: CPU: 11 PID: 1 Comm: swapper/11 Not tainted 4.19.0-rc5-master+ #1 NIP: c000000008703a54 LR: c000000008703a38 CTR: 0000000000000000 REGS: c00000000b673440 TRAP: 0380 Not tainted (4.19.0-rc5-master+) MSR: 8000000002009033 CR: 24022022 XER: 20000002 CFAR: c0000000086fc238 IRQMASK: 0 GPR00: c000000008703a38 c00000000b6736c0 c000000009281900 0000000000000000 GPR04: 0000000000000000 0000000000000000 fffffffffffff001 c00000000b660080 GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000220 GPR12: 0000000000002200 c000000009e51400 0000000000000000 0000000000000008 GPR16: 0000000000000000 c000000008c152e8 c000000008c152a8 0000000000000000 GPR20: c000000009422fd8 c000000009412fd8 c000000009426040 0000000000000008 GPR24: 0000000000000000 0000000000000000 c000000009168bc8 c000000009168c78 GPR28: c00000000b126410 0000000000000000 c00000000916a0b8 c00000000b126400 NIP [c000000008703a54] bus_add_device+0x84/0x1e0 LR [c000000008703a38] bus_add_device+0x68/0x1e0 Call Trace: [c00000000b6736c0] [c000000008703a38] bus_add_device+0x68/0x1e0 (unreliable) [c00000000b673740] [c000000008700194] device_add+0x454/0x7c0 [c00000000b673800] [c00000000872e660] __register_one_node+0xb0/0x240 [c00000000b673860] [c00000000839a6bc] __try_online_node+0x12c/0x180 [c00000000b673900] [c00000000839b978] try_online_node+0x58/0x90 [c00000000b673930] [c0000000080846d8] find_and_online_cpu_nid+0x158/0x190 [c00000000b673a10] [c0000000080848a0] numa_update_cpu_topology+0x190/0x580 [c00000000b673c00] [c000000008d3f2e4] smp_cpus_done+0x94/0x108 [c00000000b673c70] [c000000008d5c00c] smp_init+0x174/0x19c [c00000000b673d00] [c000000008d346b8] kernel_init_freeable+0x1e0/0x450 [c00000000b673dc0] [c0000000080102e8] kernel_init+0x28/0x160 [c00000000b673e30] [c00000000800b65c] ret_from_kernel_thread+0x5c/0x80 Instruction dump: 60000000 60000000 e89e0020 7fe3fb78 4bff87d5 60000000 7c7d1b79 4082008c e8bf0050 e93e0098 3b9f0010 2fa50000 38630018 419e0114 7f84e378 ---[ end trace 593577668c2daa65 ]--- However a regular kernel with 4096M (2048 gets reserved for crash kernel) boots properly. Unlike regular kernels, which mark all available nodes as online, kdump kernel only marks just enough nodes as online and marks the rest as offline at boot. However kdump kernel boots with all available CPUs. With Commit 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot"), all CPUs are onlined on their respective nodes at boot time. try_online_node() tries to online the offline nodes but fails as all needed subsystems are not yet initialized. As part of fix, detect and skip early onlining of a offline node. Fixes: 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot") Reported-by: Pavithra Prakash Signed-off-by: Srikar Dronamraju Tested-by: Hari Bathini Signed-off-by: Michael Ellerman commit a932ed3b718147c6537da290b7a91e990fdedb43 Author: Michael Ellerman Date: Fri Oct 5 16:43:55 2018 +1000 powerpc: Don't print kernel instructions in show_user_instructions() Recently we implemented show_user_instructions() which dumps the code around the NIP when a user space process dies with an unhandled signal. This was modelled on the x86 code, and we even went so far as to implement the exact same bug, namely that if the user process crashed with its NIP pointing into the kernel we will dump kernel text to dmesg. eg: bad-bctr[2996]: segfault (11) at c000000000010000 nip c000000000010000 lr 12d0b0894 code 1 bad-bctr[2996]: code: fbe10068 7cbe2b78 7c7f1b78 fb610048 38a10028 38810020 fb810050 7f8802a6 bad-bctr[2996]: code: 3860001c f8010080 48242371 60000000 <7c7b1b79> 4082002c e8010080 eb610048 This was discovered on x86 by Jann Horn and fixed in commit 342db04ae712 ("x86/dumpstack: Don't dump kernel memory based on usermode RIP"). Fix it by checking the adjusted NIP value (pc) and number of instructions against USER_DS, and bail if we fail the check, eg: bad-bctr[2969]: segfault (11) at c000000000010000 nip c000000000010000 lr 107930894 code 1 bad-bctr[2969]: Bad NIP, not dumping instructions. Fixes: 88b0fe175735 ("powerpc: Add show_user_instructions()") Signed-off-by: Michael Ellerman commit 064253c1c0625efd0362a0b7ecdbe8bee2a2904d Author: Tomi Valkeinen Date: Mon Sep 17 14:00:54 2018 +0300 drm: fix use of freed memory in drm_mode_setcrtc drm_mode_setcrtc() retries modesetting in case one of the functions it calls returns -EDEADLK. connector_set, mode and fb are freed before retrying, but they are not set to NULL. This can cause drm_mode_setcrtc() to use those variables. For example: On the first try __drm_mode_set_config_internal() returns -EDEADLK. connector_set, mode and fb are freed. Next retry starts, and drm_modeset_lock_all_ctx() returns -EDEADLK, and we jump to 'out'. The code will happily try to release all three again. This leads to crashes of different kinds, depending on the sequence the EDEADLKs happen. Fix this by setting the three variables to NULL at the start of the retry loop. Signed-off-by: Tomi Valkeinen Reviewed-by: Ville Syrjälä Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180917110054.4053-1-tomi.valkeinen@ti.com commit 9ce7610e6d201e3923c0b2f454f2e1d54f5da49e Author: Jarkko Nikula Date: Mon Oct 1 14:49:05 2018 +0300 i2c: designware: Call i2c_dw_clk_rate() only when calculating timings There are platforms which don't provide input clock rate but provide I2C timing parameters. Commit 3bd4f277274b ("i2c: designware: Call i2c_dw_clk_rate() only once in i2c_dw_init_master()") causes needless warning during probe on those platforms since i2c_dw_clk_rate(), which causes the warning when input clock is unknown, is called even when there is no need to calculate timing parameters. Fixes: 3bd4f277274b ("i2c: designware: Call i2c_dw_clk_rate() only once in i2c_dw_init_master()") Reported-by: Ard Biesheuvel Cc: # 4.19 Signed-off-by: Jarkko Nikula Tested-by: Ard Biesheuvel Signed-off-by: Wolfram Sang commit 7debbf015f580693680f3d2a3cef0cf99dcef688 Author: Darrick J. Wong Date: Fri Oct 5 19:05:41 2018 +1000 xfs: update ctime and remove suid before cloning files Before cloning into a file, update the ctime and remove sensitive attributes like suid, just like we'd do for a regular file write. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 410fdc72b05afabef3afb51167085799dcc7b3cf Author: Darrick J. Wong Date: Fri Oct 5 19:04:27 2018 +1000 xfs: zero posteof blocks when cloning above eof When we're reflinking between two files and the destination file range is well beyond the destination file's EOF marker, zero any posteof speculative preallocations in the destination file so that we don't expose stale disk contents. The previous strategy of trying to clear the preallocations does not work if the destination file has the PREALLOC flag set. Uncovered by shared/010. Reported-by: Zorro Lang Bugzilla-id: https://bugzilla.kernel.org/show_bug.cgi?id=201259 Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 0d41e1d28c2e969094ef7933b8521f1e08d30251 Author: Darrick J. Wong Date: Fri Oct 5 19:04:22 2018 +1000 xfs: refactor clonerange preparation into a separate helper Refactor all the reflink preparation steps into a separate helper that we'll use to land all the upcoming fixes for insufficient input checks. This rework also moves the invalidation of the destination range to the prep function so that it is done before the range is remapped. This ensures that nobody can access the data in range being remapped until the remap is complete. [dgc: fix xfs_reflink_remap_prep() return value and caller check to handle vfs_clone_file_prep_inodes() returning 0 to mean "nothing to do". ] [dgc: make sure length changed by vfs_clone_file_prep_inodes() gets propagated back to XFS code that does the remapping. ] Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit b3e9b515b08e407ab3a026dc2e4d935c48d05f69 Author: Singh, Brijesh Date: Thu Oct 4 21:40:23 2018 +0000 iommu/amd: Clear memory encryption mask from physical address Boris Ostrovsky reported a memory leak with device passthrough when SME is active. The VFIO driver uses iommu_iova_to_phys() to get the physical address for an iova. This physical address is later passed into vfio_unmap_unpin() to unpin the memory. The vfio_unmap_unpin() uses pfn_valid() before unpinning the memory. The pfn_valid() check was failing because encryption mask was part of the physical address returned. This resulted in the memory not being unpinned and therefore leaked after the guest terminates. The memory encryption mask must be cleared from the physical address in iommu_iova_to_phys(). Fixes: 2543a786aa25 ("iommu/amd: Allow the AMD IOMMU to work with memory encryption") Reported-by: Boris Ostrovsky Cc: Tom Lendacky Cc: Joerg Roedel Cc: Cc: Borislav Petkov Cc: Paolo Bonzini Cc: Radim Krčmář Cc: kvm@vger.kernel.org Cc: Boris Ostrovsky Cc: # 4.14+ Signed-off-by: Brijesh Singh Signed-off-by: Joerg Roedel commit 7e4183752735deb7543e179a44f4f4b44917cd6f Author: Baruch Siach Date: Wed Oct 3 19:04:49 2018 +0300 net: phy: phylink: fix SFP interface autodetection When connecting SFP PHY to phylink use the detected interface. Otherwise, the link fails to come up when the configured 'phy-mode' differs from the SFP detected mode. Move most of phylink_connect_phy() into __phylink_connect_phy(), and leave phylink_connect_phy() as a wrapper. phylink_sfp_connect_phy() can now pass the SFP detected PHY interface to __phylink_connect_phy(). This fixes 1GB SFP module link up on eth3 of the Macchiatobin board that is configured in the DT to "2500base-x" phy-mode. Fixes: 9525ae83959b6 ("phylink: add phylink infrastructure") Suggested-by: Russell King Signed-off-by: Baruch Siach Signed-off-by: David S. Miller commit 2d52527e80c2dc0c5f43f50adf183781262ec565 Author: Davide Caratti Date: Wed Oct 3 15:20:58 2018 +0200 be2net: don't flip hw_features when VXLANs are added/deleted the be2net implementation of .ndo_tunnel_{add,del}() changes the value of NETIF_F_GSO_UDP_TUNNEL bit in 'features' and 'hw_features', but it forgets to call netdev_features_change(). Moreover, ethtool setting for that bit can potentially be reverted after a tunnel is added or removed. GSO already does software segmentation when 'hw_enc_features' is 0, even if VXLAN offload is turned on. In addition, commit 096de2f83ebc ("benet: stricter vxlan offloading check in be_features_check") avoids hardware segmentation of non-VXLAN tunneled packets, or VXLAN packets having wrong destination port. So, it's safe to avoid flipping the above feature on addition/deletion of VXLAN tunnels. Fixes: 630f4b70567f ("be2net: Export tunnel offloads only when a VxLAN tunnel is created") Signed-off-by: Davide Caratti Signed-off-by: David S. Miller commit cc906f07d7d569a30bb6f0baf8f80b2968353dc9 Merge: 7e7126846c95 6579804c4317 Author: Paolo Bonzini Date: Fri Oct 5 09:39:53 2018 +0200 Merge tag 'kvm-ppc-fixes-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into kvm-master Third set of PPC KVM fixes for 4.19 One patch here, fixing a potential host crash introduced (or at least exacerbated) by a previous fix for corruption relating to radix guest page faults and THP operations. commit e46368cf77f2cb6304c51d9ff5f147cfb7dc0074 Author: Lyude Paul Date: Fri Sep 14 16:44:03 2018 -0400 drm/nouveau/drm/nouveau: Grab runtime PM ref in nv50_mstc_detect() While we currently grab a runtime PM ref in nouveau's normal connector detection code, we apparently don't do this for MST. This means if we're in a scenario where the GPU is suspended and userspace attempts to do a connector probe on an MSTC connector, the probe will fail entirely due to the DP aux channel and GPU not being woken up: [ 316.633489] nouveau 0000:01:00.0: i2c: aux 000a: begin idle timeout ffffffff [ 316.635713] nouveau 0000:01:00.0: i2c: aux 000a: begin idle timeout ffffffff [ 316.637785] nouveau 0000:01:00.0: i2c: aux 000a: begin idle timeout ffffffff ... So, grab a runtime PM ref here. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Reviewed-by: Karol Herbst Signed-off-by: Ben Skeggs commit 9d2f67e43b73e8af7438be219b66a5de0cfa8bd9 Author: Jianfeng Tan Date: Sat Sep 29 15:41:27 2018 +0000 net/packet: fix packet drop as of virtio gso When we use raw socket as the vhost backend, a packet from virito with gso offloading information, cannot be sent out in later validaton at xmit path, as we did not set correct skb->protocol which is further used for looking up the gso function. To fix this, we set this field according to virito hdr information. Fixes: e858fae2b0b8f4 ("virtio_net: use common code for virtio_net_hdr and skb GSO conversion") Signed-off-by: Jianfeng Tan Signed-off-by: David S. Miller commit ca8931948344c485569b04821d1f6bcebccd376b Author: Florian Fainelli Date: Thu Oct 4 20:24:13 2018 -0700 net: dsa: b53: Keep CPU port as tagged in all VLANs Commit c499696e7901 ("net: dsa: b53: Stop using dev->cpu_port incorrectly") was a bit too trigger happy in removing the CPU port from the VLAN membership because we rely on DSA to program the CPU port VLAN, which it does, except it does not bother itself with tagged/untagged and just usese untagged. Having the CPU port "follow" the user ports tagged/untagged is not great and does not allow for properly differentiating, so keep the CPU port tagged in all VLANs. Reported-by: Gerhard Wiesinger Fixes: c499696e7901 ("net: dsa: b53: Stop using dev->cpu_port incorrectly") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 17c357efe5eceebdc3971a48b3d4d61a03c1178b Author: Flavio Leitner Date: Fri Sep 28 14:51:28 2018 -0300 openvswitch: load NAT helper Load the respective NAT helper module if the flow uses it. Signed-off-by: Flavio Leitner Signed-off-by: David S. Miller commit 508646aa2ba57cea501e0300468f84d5cc3dd8cd Merge: 471b83bd8bbe c78fe058879b Author: David S. Miller Date: Thu Oct 4 21:41:16 2018 -0700 Merge branch 'bnxt_en-fixes' Michael Chan says: ==================== bnxt_en: Misc. bug fixes. 4 small bug fixes related to setting firmware message enables bits, possible memory leak when probe fails, and ring accouting when RDMA driver is loaded. Please queue these for -stable as well. Thanks. ==================== Signed-off-by: David S. Miller commit c78fe058879bdea919d44f23e21da26f603e9166 Author: Vasundhara Volam Date: Fri Oct 5 00:26:03 2018 -0400 bnxt_en: get the reduced max_irqs by the ones used by RDMA When getting the max rings supported, get the reduced max_irqs by the ones used by RDMA. If the number MSIX is the limiting factor, this bug may cause the max ring count to be higher than it should be when RDMA driver is loaded and may result in ring allocation failures. Fixes: 30f529473ec9 ("bnxt_en: Do not modify max IRQ count after RDMA driver requests/frees IRQs.") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit a2bf74f4e1b82395dad2b08d2a911d9151db71c1 Author: Venkat Duvvuru Date: Fri Oct 5 00:26:02 2018 -0400 bnxt_en: free hwrm resources, if driver probe fails. When the driver probe fails, all the resources that were allocated prior to the failure must be freed. However, hwrm dma response memory is not getting freed. This patch fixes the problem described above. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Signed-off-by: Venkat Duvvuru Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 5db0e0969af6501ad45fe0494039d3b9c797822b Author: Vasundhara Volam Date: Fri Oct 5 00:26:01 2018 -0400 bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request In HWRM_QUEUE_COS2BW_CFG request, enables field should have the bits set only for the queue ids which are having the valid parameters. This causes firmware to return error when the TC to hardware CoS queue mapping is not 1:1 during DCBNL ETS setup. Fixes: 2e8ef77ee0ff ("bnxt_en: Add TC to hardware QoS queue mapping logic.") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit dbe80d446c859873820eedfff4abc61c71f1927b Author: Michael Chan Date: Fri Oct 5 00:26:00 2018 -0400 bnxt_en: Fix VNIC reservations on the PF. The enables bit for VNIC was set wrong when calling the HWRM_FUNC_CFG firmware call to reserve VNICs. This has the effect that the firmware will keep a large number of VNICs for the PF, and having very few for VFs. DPDK driver running on the VFs, which requires more VNICs, may not work properly as a result. Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit f74c371fe72a4f820d287db8067683fb533e4ede Author: Eric Dumazet Date: Thu Oct 4 17:41:37 2018 -0700 Input: mousedev - add a schedule point in mousedev_write() syzbot was able to trigger rcu stalls by calling write() with large number of bytes. Add a cond_resched() in the loop to avoid this. Link: https://lkml.org/lkml/2018/8/23/1106 Signed-off-by: Eric Dumazet Reported-by: syzbot+9436b02171ac0894d33e@syzkaller.appspotmail.com Reviewed-by: Paul E. McKenney Signed-off-by: Dmitry Torokhov commit befad944e2312c18d855013ce154ca7d2b110ade Merge: 010bd965f971 bdf800c6fdf5 Author: Greg Kroah-Hartman Date: Thu Oct 4 17:23:58 2018 -0700 Merge tag 'drm-fixes-2018-10-05' of git://anongit.freedesktop.org/drm/drm Dave writes: "amdgpu and two core fixes Two fixes for amdgpu: one corrects a use of process->mm one fix for display code race condition that can result in a crash Two core fixes: One for a use-after-free in the leasing code One for a cma/fbdev crash." * tag 'drm-fixes-2018-10-05' of git://anongit.freedesktop.org/drm/drm: drm/amdkfd: Fix incorrect use of process->mm drm/amd/display: Signal hw_done() after waiting for flip_done() drm/cma-helper: Fix crash in fbdev error path drm: fix use-after-free read in drm_mode_create_lease_ioctl() commit bdf800c6fdf5674999bc0228d5040cc0ae218fa8 Merge: 3a9df1e92593 11b29c9e2578 Author: Dave Airlie Date: Fri Oct 5 08:39:31 2018 +1000 Merge branch 'drm-fixes-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes - Fix an ordering issue in DC with respect to atomic flips that could result in a crash - Fix incorrect use of process->mm in KFD Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/1538668374-22334-1-git-send-email-alexander.deucher@amd.com commit 3a9df1e9259362ed1ec321ce4229f1cd992355e6 Merge: d8938c981f58 4d4c2d89913e Author: Dave Airlie Date: Fri Oct 5 08:39:01 2018 +1000 Merge tag 'drm-misc-fixes-2018-10-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v4.19-rc7: - Fix use-after-free in drm_mode_create_lease_ioctl() - Fix crash in fbdev error path. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/13b2c3ac-9a96-710e-ceb9-890af164f10e@linux.intel.com commit 471b83bd8bbe4e89743683ef8ecb78f7029d8288 Author: Ido Schimmel Date: Mon Oct 1 12:21:59 2018 +0300 team: Forbid enslaving team device to itself team's ndo_add_slave() acquires 'team->lock' and later tries to open the newly enslaved device via dev_open(). This emits a 'NETDEV_UP' event that causes the VLAN driver to add VLAN 0 on the team device. team's ndo_vlan_rx_add_vid() will also try to acquire 'team->lock' and deadlock. Fix this by checking early at the enslavement function that a team device is not being enslaved to itself. A similar check was added to the bond driver in commit 09a89c219baf ("bonding: disallow enslaving a bond to itself"). WARNING: possible recursive locking detected 4.18.0-rc7+ #176 Not tainted -------------------------------------------- syz-executor4/6391 is trying to acquire lock: (____ptrval____) (&team->lock){+.+.}, at: team_vlan_rx_add_vid+0x3b/0x1e0 drivers/net/team/team.c:1868 but task is already holding lock: (____ptrval____) (&team->lock){+.+.}, at: team_add_slave+0xdb/0x1c30 drivers/net/team/team.c:1947 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&team->lock); lock(&team->lock); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by syz-executor4/6391: #0: (____ptrval____) (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:77 [inline] #0: (____ptrval____) (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x412/0xc30 net/core/rtnetlink.c:4662 #1: (____ptrval____) (&team->lock){+.+.}, at: team_add_slave+0xdb/0x1c30 drivers/net/team/team.c:1947 stack backtrace: CPU: 1 PID: 6391 Comm: syz-executor4 Not tainted 4.18.0-rc7+ #176 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_deadlock_bug kernel/locking/lockdep.c:1765 [inline] check_deadlock kernel/locking/lockdep.c:1809 [inline] validate_chain kernel/locking/lockdep.c:2405 [inline] __lock_acquire.cold.64+0x1fb/0x486 kernel/locking/lockdep.c:3435 lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924 __mutex_lock_common kernel/locking/mutex.c:757 [inline] __mutex_lock+0x176/0x1820 kernel/locking/mutex.c:894 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:909 team_vlan_rx_add_vid+0x3b/0x1e0 drivers/net/team/team.c:1868 vlan_add_rx_filter_info+0x14a/0x1d0 net/8021q/vlan_core.c:210 __vlan_vid_add net/8021q/vlan_core.c:278 [inline] vlan_vid_add+0x63e/0x9d0 net/8021q/vlan_core.c:308 vlan_device_event.cold.12+0x2a/0x2f net/8021q/vlan.c:381 notifier_call_chain+0x180/0x390 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1735 call_netdevice_notifiers net/core/dev.c:1753 [inline] dev_open+0x173/0x1b0 net/core/dev.c:1433 team_port_add drivers/net/team/team.c:1219 [inline] team_add_slave+0xa8b/0x1c30 drivers/net/team/team.c:1948 do_set_master+0x1c9/0x220 net/core/rtnetlink.c:2248 do_setlink+0xba4/0x3e10 net/core/rtnetlink.c:2382 rtnl_setlink+0x2a9/0x400 net/core/rtnetlink.c:2636 rtnetlink_rcv_msg+0x46e/0xc30 net/core/rtnetlink.c:4665 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4683 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x5a0/0x760 net/netlink/af_netlink.c:1343 netlink_sendmsg+0xa18/0xfd0 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:642 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:652 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2126 __sys_sendmsg+0x11d/0x290 net/socket.c:2164 __do_sys_sendmsg net/socket.c:2173 [inline] __se_sys_sendmsg net/socket.c:2171 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2171 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x456b29 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9706bf8c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f9706bf96d4 RCX: 0000000000456b29 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004d3548 R14: 00000000004c8227 R15: 0000000000000000 Fixes: 87002b03baab ("net: introduce vlan_vid_[add/del] and use them instead of direct [add/kill]_vid ndo calls") Signed-off-by: Ido Schimmel Reported-and-tested-by: syzbot+bd051aba086537515cdb@syzkaller.appspotmail.com Signed-off-by: David S. Miller commit f7b2a56e1f3dcbdb4cf09b2b63e859ffe0e09df8 Author: Yu Zhao Date: Fri Sep 28 17:04:30 2018 -0600 net/usb: cancel pending work when unbinding smsc75xx Cancel pending work before freeing smsc75xx private data structure during binding. This fixes the following crash in the driver: BUG: unable to handle kernel NULL pointer dereference at 0000000000000050 IP: mutex_lock+0x2b/0x3f Workqueue: events smsc75xx_deferred_multicast_write [smsc75xx] task: ffff8caa83e85700 task.stack: ffff948b80518000 RIP: 0010:mutex_lock+0x2b/0x3f Call Trace: smsc75xx_deferred_multicast_write+0x40/0x1af [smsc75xx] process_one_work+0x18d/0x2fc worker_thread+0x1a2/0x269 ? pr_cont_work+0x58/0x58 kthread+0xfa/0x10a ? pr_cont_work+0x58/0x58 ? rcu_read_unlock_sched_notrace+0x48/0x48 ret_from_fork+0x22/0x40 Signed-off-by: Yu Zhao Signed-off-by: David S. Miller commit 9e15ff7b89b6d9c51c296499539ea884220ab590 Merge: b576eddb5d8d 1db585294547 Author: David S. Miller Date: Thu Oct 4 13:47:39 2018 -0700 Merge tag 'mac80211-for-davem-2018-10-04' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== Just three small fixes: * fix use-after-free in regulatory code * fix rx-mgmt key flag in AP mode (mac80211) * fix wireless extensions compat code memory leak ==================== Signed-off-by: David S. Miller commit 479adb89a97b0a33e5a9d702119872cc82ca21aa Author: Tejun Heo Date: Thu Oct 4 13:28:08 2018 -0700 cgroup: Fix dom_cgrp propagation when enabling threaded mode A cgroup which is already a threaded domain may be converted into a threaded cgroup if the prerequisite conditions are met. When this happens, all threaded descendant should also have their ->dom_cgrp updated to the new threaded domain cgroup. Unfortunately, this propagation was missing leading to the following failure. # cd /sys/fs/cgroup/unified # cat cgroup.subtree_control # show that no controllers are enabled # mkdir -p mycgrp/a/b/c # echo threaded > mycgrp/a/b/cgroup.type At this point, the hierarchy looks as follows: mycgrp [d] a [dt] b [t] c [inv] Now let's make node "a" threaded (and thus "mycgrp" s made "domain threaded"): # echo threaded > mycgrp/a/cgroup.type By this point, we now have a hierarchy that looks as follows: mycgrp [dt] a [t] b [t] c [inv] But, when we try to convert the node "c" from "domain invalid" to "threaded", we get ENOTSUP on the write(): # echo threaded > mycgrp/a/b/c/cgroup.type sh: echo: write error: Operation not supported This patch fixes the problem by * Moving the opencoded ->dom_cgrp save and restoration in cgroup_enable_threaded() into cgroup_{save|restore}_control() so that mulitple cgroups can be handled. * Updating all threaded descendants' ->dom_cgrp to point to the new dom_cgrp when enabling threaded mode. Signed-off-by: Tejun Heo Reported-and-tested-by: "Michael Kerrisk (man-pages)" Reported-by: Amin Jamali Reported-by: Joao De Almeida Pereira Link: https://lore.kernel.org/r/CAKgNAkhHYCMn74TCNiMJ=ccLd7DcmXSbvw3CbZ1YREeG7iJM5g@mail.gmail.com Fixes: 454000adaa2a ("cgroup: introduce cgroup->dom_cgrp and threaded css_set handling") Cc: stable@vger.kernel.org # v4.14+ commit 010bd965f9711f801f2902ec3a6a2826c6656491 Merge: ac0657edb13a 1a8f8d2a443e Author: Greg Kroah-Hartman Date: Thu Oct 4 13:24:38 2018 -0700 Merge tag 'ovl-fixes-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Miklos writes: "overlayfs fixes for 4.19-rc7 This update fixes a couple of regressions in the stacked file update added in this cycle, as well as some older bugs uncovered by syzkaller. There's also one trivial naming change that touches other parts of the fs subsystem." * tag 'ovl-fixes-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: fix format of setxattr debug ovl: fix access beyond unterminated strings ovl: make symbol 'ovl_aops' static vfs: swap names of {do,vfs}_clone_file_range() ovl: fix freeze protection bypass in ovl_clone_file_range() ovl: fix freeze protection bypass in ovl_write_iter() ovl: fix memory leak on unlink of indexed file commit 5d07384a666d4b2f781dc056bfeec2c27fbdf383 Author: Mike Snitzer Date: Tue Sep 25 20:56:02 2018 -0400 dm cache: fix resize crash if user doesn't reload cache table A reload of the cache's DM table is needed during resize because otherwise a crash will occur when attempting to access smq policy entries associated with the portion of the cache that was recently extended. The reason is cache-size based data structures in the policy will not be resized, the only way to safely extend the cache is to allow for a proper cache policy initialization that occurs when the cache table is loaded. For example the smq policy's space_init(), init_allocator(), calc_hotspot_params() must be sized based on the extended cache size. The fix for this is to disallow cache resizes of this pattern: 1) suspend "cache" target's device 2) resize the fast device used for the cache 3) resume "cache" target's device Instead, the last step must be a full reload of the cache's DM table. Fixes: 66a636356 ("dm cache: add stochastic-multi-queue (smq) policy") Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer commit 4561ffca88c546f96367f94b8f1e4715a9c62314 Author: Joe Thornber Date: Mon Sep 24 16:19:30 2018 -0400 dm cache metadata: ignore hints array being too small during resize Commit fd2fa9541 ("dm cache metadata: save in-core policy_hint_size to on-disk superblock") enabled previously written policy hints to be used after a cache is reactivated. But in doing so the cache metadata's hint array was left exposed to out of bounds access because on resize the metadata's on-disk hint array wasn't ever extended. Fix this by ignoring that there are no on-disk hints associated with the newly added cache blocks. An expanded on-disk hint array is later rewritten upon the next clean shutdown of the cache. Fixes: fd2fa9541 ("dm cache metadata: save in-core policy_hint_size to on-disk superblock") Cc: stable@vger.kernel.org Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer commit 69e445ab8b66a9f30519842ef18be555d3ee9b51 Author: Rafael J. Wysocki Date: Thu Oct 4 11:08:12 2018 +0200 PM / core: Clear the direct_complete flag on errors If __device_suspend() runs asynchronously (in which case the device passed to it is in dpm_suspended_list at that point) and it returns early on an error or pending wakeup, and the power.direct_complete flag has been set for the device already, the subsequent device_resume() will be confused by that and it will call pm_runtime_enable() incorrectly, as runtime PM has not been disabled for the device by __device_suspend(). To avoid that, clear power.direct_complete if __device_suspend() is not going to disable runtime PM for the device before returning. Fixes: aae4518b3124 (PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily) Reported-by: Al Cooper Tested-by: Al Cooper Reviewed-by: Ulf Hansson Cc: 3.16+ # 3.16+ Signed-off-by: Rafael J. Wysocki commit b576eddb5d8d8bdd5fe4fada5e397c19b7ea4ffc Merge: cec4de302c5f c360867ec46a Author: David S. Miller Date: Thu Oct 4 09:53:03 2018 -0700 Merge branch 'mlxsw-fixes' Ido Schimmel says: ==================== mlxsw: Couple of fixes First patch works around an hardware issue in Spectrum-2 where a field indicating the event type is always set to the same value. Since there are only two event types and they are reported using different queues, we can use the queue number to derive the event type. Second patch prevents a router interface (RIF) leakage when a VLAN device is deleted from on top a bridge device. ==================== Signed-off-by: David S. Miller commit c360867ec46a4ec5cb19e5c329d65dff522cc69d Author: Ido Schimmel Date: Thu Oct 4 15:48:03 2018 +0000 mlxsw: spectrum: Delete RIF when VLAN device is removed In commit 602b74eda813 ("mlxsw: spectrum_switchdev: Do not leak RIFs when removing bridge") I handled the case where RIFs created for VLAN devices were not properly cleaned up when their real device (a bridge) was removed. However, I forgot to handle the case of the VLAN device itself being removed. Do so now when the VLAN device is being unlinked from its real device. Fixes: 99f44bb3527b ("mlxsw: spectrum: Enable L3 interfaces on top of bridge devices") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Reported-by: Artem Shvorin Tested-by: Artem Shvorin Signed-off-by: David S. Miller commit f3c84a8e3e922afdcbc55f04df8fdf8a548f5a21 Author: Nir Dotan Date: Thu Oct 4 15:48:02 2018 +0000 mlxsw: pci: Derive event type from event queue number Due to a hardware issue in Spectrum-2, the field event_type of the event queue element (EQE) has become reserved. It was used to distinguish between command interface completion events and completion events. Use queue number to determine event type, as command interface completion events are always received on EQ0 and mlxsw driver maps completion events to EQ1. Fixes: c3ab435466d5 ("mlxsw: spectrum: Extend to support Spectrum-2 ASIC") Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ac0657edb13ac7971569aa88cc6f27ea26deb883 Merge: 10be83cc6418 3a58ac65e2d7 Author: Greg Kroah-Hartman Date: Thu Oct 4 09:48:10 2018 -0700 Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm Russell writes: "A couple of small ARM fixes from Stefan and Thomas: - Adding the io_pgetevents syscall - Fixing a bounds check in pci_ioremap_io()" * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8799/1: mm: fix pci_ioremap_io() offset check ARM: 8787/1: wire up io_pgetevents syscall commit 10be83cc641884e7c5dfcc0d3e74ba9f3b332e27 Merge: 1b0350c355b2 d8938c981f58 Author: Greg Kroah-Hartman Date: Thu Oct 4 09:18:44 2018 -0700 Merge tag 'drm-fixes-2018-10-04' of git://anongit.freedesktop.org/drm/drm Dave writes: "drm exynos, tda9950 and intel fixes 3 i915 fixes: compressed error handling zlib fix compiler warning cleanup and a minor code cleanup 2 tda9950: Two fixes for the HDMI CEC 1 exynos: A fix required for IOMMU interaction." * tag 'drm-fixes-2018-10-04' of git://anongit.freedesktop.org/drm/drm: drm/i915: Handle incomplete Z_FINISH for compressed error states drm/i915: Avoid compiler warning for maybe unused gu_misc_iir drm/i915: Do not redefine the has_csr parameter. drm/exynos: Use selected dma_dev default iommu domain instead of a fake one drm/i2c: tda9950: set MAX_RETRIES for errors only drm/i2c: tda9950: fix timeout counter check commit 1b0350c355b2f32bcbd453310bf6dfb50cbe965f Merge: d2467adb6610 e55ec4ddbef9 Author: Greg Kroah-Hartman Date: Thu Oct 4 09:17:38 2018 -0700 Merge tag 'xfs-fixes-for-4.19-rc6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Dave writes: "XFS fixes for 4.19-rc6 Accumlated regression and bug fixes for 4.19-rc6, including: o make iomap correctly mark dirty pages for sub-page block sizes o fix regression in handling extent-to-btree format conversion errors o fix torn log wrap detection for new logs o various corrupt inode detection fixes o various delalloc state fixes o cleanup all the missed transaction cancel cases missed from changes merged in 4.19-rc1 o fix lockdep false positive on transaction allocation o fix locking and reference counting on buffer log items" * tag 'xfs-fixes-for-4.19-rc6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: fix error handling in xfs_bmap_extents_to_btree iomap: set page dirty after partial delalloc on mkwrite xfs: remove invalid log recovery first/last cycle check xfs: validate inode di_forkoff xfs: skip delalloc COW blocks in xfs_reflink_end_cow xfs: don't treat unknown di_flags2 as corruption in scrub xfs: remove duplicated include from alloc.c xfs: don't bring in extents in xfs_bmap_punch_delalloc_range xfs: fix transaction leak in xfs_reflink_allocate_cow() xfs: avoid lockdep false positives in xfs_trans_alloc xfs: refactor xfs_buf_log_item reference count handling xfs: clean up xfs_trans_brelse() xfs: don't unlock invalidated buf on aborted tx commit xfs: remove last of unnecessary xfs_defer_cancel() callers xfs: don't crash the vfs on a garbage inline symlink commit d2467adb66108f1b7fec8cadbdb8ca140e88effe Merge: cec4de302c5f ef1f2258748b Author: Greg Kroah-Hartman Date: Thu Oct 4 09:16:11 2018 -0700 Merge tag 'riscv-for-linus-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux Palmer writes: "A Single RISC-V Fix for 4.19-rc7 This tag contains a single patch that managed to get lost in the shuffle, which explains why it's so late. This single line has been floating around in various patch sets for months, and fixes our DMA32 region." * tag 'riscv-for-linus-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: RISCV: Fix end PFN for low memory commit 3f4258bbe0363b3d5330b93de0e86b7796ff1a74 Merge: 30a0af882694 5a1eb8b95428 Author: Arnd Bergmann Date: Thu Oct 4 17:37:17 2018 +0200 Merge tag 'soc-fsl-fix-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into fixes NXP/FSL SoC driver fixes for v4.19 round 2 - Fix crash of qman_portal by deferring its probe if qman is not probed * tag 'soc-fsl-fix-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux: soc: fsl: qman_portals: defer probe after qman's probe soc: fsl: qbman: add APIs to retrieve the probing status soc: fsl: qe: Fix copy/paste bug in ucc_get_tdm_sync_shift() soc: fsl: qbman: qman: avoid allocating from non existing gen_pool ARM: dts: BCM63xx: Fix incorrect interrupt specifiers MAINTAINERS: update the Annapurna Labs maintainer email ARM: dts: sun8i: drop A64 HDMI PHY fallback compatible from R40 DT ARM: dts: at91: sama5d2_ptc_ek: fix nand pinctrl Signed-off-by: Arnd Bergmann commit 11b29c9e25788d0afb2ddb67bcd89424bd25f2f7 Author: Felix Kuehling Date: Tue Oct 2 18:41:12 2018 -0400 drm/amdkfd: Fix incorrect use of process->mm This mm_struct pointer should never be dereferenced. If running in a user thread, just use current->mm. If running in a kernel worker use get_task_mm to get a safe reference to the mm_struct. Reviewed-by: Oded Gabbay Acked-by: Christian König Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 30a0af8826942cc6b1277f89a6ed3e3b986d1643 Merge: 17b57b1883c1 eea96566c189 Author: Arnd Bergmann Date: Thu Oct 4 17:33:37 2018 +0200 Merge tag 'imx-fixes-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into fixes i.MX fixes for 4.19, round 2: - i.MX53 QSB board stops working when cpufreq driver is enabled, because the default OPP table has the maximum CPU frequency at 1.2GHz, while the board is only capable of running 1GHz. Fix up the OPP table for the board to get it work with cpufreq driver. * tag 'imx-fixes-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: dts: imx53-qsb: disable 1.2GHz OPP Signed-off-by: Arnd Bergmann commit 987bf116445db5d63a5c2ed94c4479687d9c9973 Author: Shirish S Date: Mon Sep 24 19:01:47 2018 +0530 drm/amd/display: Signal hw_done() after waiting for flip_done() In amdgpu_dm_commit_tail(), wait until flip_done() is signaled before we signal hw_done(). [Why] This is to temporarily address a paging error that occurs when a nonblocking commit contends with another commit, particularly in a mirrored display configuration where at least 2 CRTCs are updated. The error occurs in drm_atomic_helper_wait_for_flip_done(), when we attempt to access the contents of new_crtc_state->commit. Here's the sequence for a mirrored 2 display setup (irrelevant steps left out for clarity): **THREAD 1** | **THREAD 2** | Initialize atomic state for flip | | Queue worker | ... | Do work for flip | | Signal hw_done() on CRTC 1 | Signal hw_done() on CRTC 2 | | Wait for flip_done() on CRTC 1 <---- **PREEMPTED BY THREAD 1** Initialize atomic state for cursor | update (1) | | Do cursor update work on both CRTCs | | Clear atomic state (2) | **DONE** | ... | | Wait for flip_done() on CRTC 2 | *ERROR* | The issue starts with (1). When the atomic state is initialized, the current CRTC states are duplicated to be the new_crtc_states, and referenced to be the old_crtc_states. (The new_crtc_states are to be filled with update data.) Some things to note: * Due to the mirrored configuration, the cursor updates on both CRTCs. * At this point, the pflip IRQ has already been handled, and flip_done signaled on all CRTCs. The cursor commit can therefore continue. * The old_crtc_states used by the cursor update are the **same states** as the new_crtc_states used by the flip worker. At (2), the old_crtc_state is freed (*), and the cursor commit completes. We then context switch back to the flip worker, where we attempt to access the new_crtc_state->commit object. This is problematic, as this state has already been freed. (*) Technically, 'state->crtcs[i].state' is freed, which was made to reference old_crtc_state in drm_atomic_helper_swap_state() [How] By moving hw_done() after wait_for_flip_done(), we're guaranteed that the new_crtc_state (from the flip worker's perspective) still exists. This is because any other commit will be blocked, waiting for the hw_done() signal. Note that both the i915 and imx drivers have this sequence flipped already, masking this problem. Signed-off-by: Shirish S Signed-off-by: Leo Li Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 7e7126846c95a34f98a1524d5c473af1f0783735 Author: Paolo Bonzini Date: Wed Oct 3 13:44:26 2018 +0200 kvm: nVMX: fix entry with pending interrupt if APICv is enabled Commit b5861e5cf2fcf83031ea3e26b0a69d887adf7d21 introduced a check on the interrupt-window and NMI-window CPU execution controls in order to inject an external interrupt vmexit before the first guest instruction executes. However, when APIC virtualization is enabled the host does not need a vmexit in order to inject an interrupt at the next interrupt window; instead, it just places the interrupt vector in RVI and the processor will inject it as soon as possible. Therefore, on machines with APICv it is not enough to check the CPU execution controls: the same scenario can also happen if RVI>vPPR. Fixes: b5861e5cf2fcf83031ea3e26b0a69d887adf7d21 Reviewed-by: Nikita Leshchenko Cc: Sean Christopherson Cc: Liran Alon Cc: Radim Krčmář Signed-off-by: Paolo Bonzini commit 1a8f8d2a443ef9ad9a3065ba8c8119df714240fa Author: Miklos Szeredi Date: Thu Oct 4 14:49:10 2018 +0200 ovl: fix format of setxattr debug Format has a typo: it was meant to be "%.*s", not "%*s". But at some point callers grew nonprintable values as well, so use "%*pE" instead with a maximized length. Reported-by: Amir Goldstein Signed-off-by: Miklos Szeredi Fixes: 3a1e819b4e80 ("ovl: store file handle of lower inode on copy up") Cc: # v4.12 commit 601350ff58d5415a001769532f6b8333820e5786 Author: Amir Goldstein Date: Fri Sep 28 21:00:48 2018 +0300 ovl: fix access beyond unterminated strings KASAN detected slab-out-of-bounds access in printk from overlayfs, because string format used %*s instead of %.*s. > BUG: KASAN: slab-out-of-bounds in string+0x298/0x2d0 lib/vsprintf.c:604 > Read of size 1 at addr ffff8801c36c66ba by task syz-executor2/27811 > > CPU: 0 PID: 27811 Comm: syz-executor2 Not tainted 4.19.0-rc5+ #36 ... > printk+0xa7/0xcf kernel/printk/printk.c:1996 > ovl_lookup_index.cold.15+0xe8/0x1f8 fs/overlayfs/namei.c:689 Reported-by: syzbot+376cea2b0ef340db3dd4@syzkaller.appspotmail.com Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi Fixes: 359f392ca53e ("ovl: lookup index entry for copy up origin") Cc: # v4.13 commit 2cf7ea9f40fabee0f8b40db4eb2d1e85cc6c0a95 Author: Paolo Bonzini Date: Wed Oct 3 10:34:00 2018 +0200 KVM: VMX: hide flexpriority from guest when disabled at the module level As of commit 8d860bbeedef ("kvm: vmx: Basic APIC virtualization controls have three settings"), KVM will disable VIRTUALIZE_APIC_ACCESSES when a nested guest writes APIC_BASE MSR and kvm-intel.flexpriority=0, whereas previously KVM would allow a nested guest to enable VIRTUALIZE_APIC_ACCESSES so long as it's supported in hardware. That is, KVM now advertises VIRTUALIZE_APIC_ACCESSES to a guest but doesn't (always) allow setting it when kvm-intel.flexpriority=0, and may even initially allow the control and then clear it when the nested guest writes APIC_BASE MSR, which is decidedly odd even if it doesn't cause functional issues. Hide the control completely when the module parameter is cleared. reported-by: Sean Christopherson Fixes: 8d860bbeedef ("kvm: vmx: Basic APIC virtualization controls have three settings") Cc: Jim Mattson Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit fd6b6d9b82f97a851fb0078201ddc38fe9728cda Author: Sean Christopherson Date: Mon Oct 1 14:25:34 2018 -0700 KVM: VMX: check for existence of secondary exec controls before accessing Return early from vmx_set_virtual_apic_mode() if the processor doesn't support VIRTUALIZE_APIC_ACCESSES or VIRTUALIZE_X2APIC_MODE, both of which reside in SECONDARY_VM_EXEC_CONTROL. This eliminates warnings due to VMWRITEs to SECONDARY_VM_EXEC_CONTROL (VMCS field 401e) failing on processors without secondary exec controls. Remove the similar check for TPR shadowing as it is incorporated in the flexpriority_enabled check and the APIC-related code in vmx_update_msr_bitmap() is further gated by VIRTUALIZE_X2APIC_MODE. Reported-by: Gerhard Wiesinger Fixes: 8d860bbeedef ("kvm: vmx: Basic APIC virtualization controls have three settings") Cc: Jim Mattson Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit db05c481977599236f12a85e55de9f5ab37b0a2c Author: Eugeniy Paltsev Date: Wed Oct 3 19:45:38 2018 +0300 drm: fb-helper: Reject all pixel format changing requests drm fbdev emulation doesn't support changing the pixel format at all, so reject all pixel format changing requests. Cc: stable@vger.kernel.org Signed-off-by: Eugeniy Paltsev Reviewed-by: Ville Syrjälä Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20181003164538.5534-1-Eugeniy.Paltsev@synopsys.com commit 02e425668f5c9deb42787d10001a3b605993ad15 Author: Andy Lutomirski Date: Wed Oct 3 16:23:49 2018 -0700 x86/vdso: Fix vDSO syscall fallback asm constraint regression When I added the missing memory outputs, I failed to update the index of the first argument (ebx) on 32-bit builds, which broke the fallbacks. Somehow I must have screwed up my testing or gotten lucky. Add another test to cover gettimeofday() as well. Signed-off-by: Andy Lutomirski Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: stable@vger.kernel.org Fixes: 715bd9d12f84 ("x86/vdso: Fix asm constraints on vDSO syscall fallbacks") Link: http://lkml.kernel.org/r/21bd45ab04b6d838278fa5bebfa9163eceffa13c.1538608971.git.luto@kernel.org Signed-off-by: Ingo Molnar commit 709ae62e8e6d9ac4df7dadb3b8ae432675c45ef9 Author: Kai-Heng Feng Date: Thu Oct 4 11:39:42 2018 +0800 ALSA: hda/realtek - Cannot adjust speaker's volume on Dell XPS 27 7760 The issue is the same as commit dd9aa335c880 ("ALSA: hda/realtek - Can't adjust speaker's volume on a Dell AIO"), the output requires to connect to a node with Amp-out capability. Applying the same fixup ALC298_FIXUP_SPK_VOLUME can fix the issue. BugLink: https://bugs.launchpad.net/bugs/1775068 Signed-off-by: Kai-Heng Feng Cc: Signed-off-by: Takashi Iwai commit 5f78aec0d7e9f239d64b2cd1c9e671345ff92f94 Author: Steffen Klassert Date: Thu Oct 4 07:21:48 2018 +0200 MAINTAINERS: Remove net/core/flow.c net/core/flow.c does not exist anymore, so remove it from the IPSEC NETWORKING section of the MAINTAINERS file. Signed-off-by: Steffen Klassert commit 6579804c431712d56956a63b1a01509441cc6800 Author: Paul Mackerras Date: Thu Oct 4 14:51:11 2018 +1000 KVM: PPC: Book3S HV: Avoid crash from THP collapse during radix page fault Commit 71d29f43b633 ("KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size", 2018-09-11) added a call to __find_linux_pte() and a dereference of the returned PTE pointer to the radix page fault path in the common case where the page is normal system memory. Previously, __find_linux_pte() was only called for mappings to physical addresses which don't have a page struct (e.g. memory-mapped I/O) or where the page struct is marked as reserved memory. This exposes us to the possibility that the returned PTE pointer could be NULL, for example in the case of a concurrent THP collapse operation. Dereferencing the returned NULL pointer causes a host crash. To fix this, we check for NULL, and if it is NULL, we retry the operation by returning to the guest, with the expectation that it will generate the same page fault again (unless of course it has been fixed up by another CPU in the meantime). Fixes: 71d29f43b633 ("KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size") Signed-off-by: Paul Mackerras commit d8938c981f58ee344687b7910a611ac345960045 Merge: 659c9370e53c e0dccce1193f Author: Dave Airlie Date: Thu Oct 4 10:28:27 2018 +1000 Merge branch 'drm-tda9950-fixes' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-fixes two tda9950 fixes. Signed-off-by: Dave Airlie From: Russell King Link: https://patchwork.freedesktop.org/patch/msgid/20181001162948.GA9508@rmk-PC.armlinux.org.uk commit 659c9370e53c99b2e98eba0c07161f839dbf8521 Merge: 77d981b16f2d 4c9613ce556f Author: Dave Airlie Date: Thu Oct 4 10:04:38 2018 +1000 Merge tag 'drm-intel-fixes-2018-10-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes There's one fix for our zlib incomlete Z_FINISH on our error state handling, plus a compilation warning fix and a tiny code clean up. Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20181003202840.GA23560@intel.com commit cec4de302c5ff2c5eb3bfcb0c4845a095f5149b9 Merge: 95773dc08627 4233cfe6ec46 Author: Greg Kroah-Hartman Date: Wed Oct 3 16:09:11 2018 -0700 Merge gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net David writes: "Networking fixes: 1) Prefix length validation in xfrm layer, from Steffen Klassert. 2) TX status reporting fix in mac80211, from Andrei Otcheretianski. 3) Fix hangs due to TX_DROP in mac80211, from Bob Copeland. 4) Fix DMA error regression in b43, from Larry Finger. 5) Add input validation to xenvif_set_hash_mapping(), from Jan Beulich. 6) SMMU unmapping fix in hns driver, from Yunsheng Lin. 7) Bluetooh crash in unpairing on SMP, from Matias Karhumaa. 8) WoL handling fixes in the phy layer, from Heiner Kallweit. 9) Fix deadlock in bonding, from Mahesh Bandewar. 10) Fill ttl inherit infor in vxlan driver, from Hangbin Liu. 11) Fix TX timeouts during netpoll, from Michael Chan. 12) RXRPC layer fixes from David Howells. 13) Another batch of ndo_poll_controller() removals to deal with excessive resource consumption during load. From Eric Dumazet. 14) Fix a specific TIPC failure secnario, from LUU Duc Canh. 15) Really disable clocks in r8169 during suspend so that low power states can actually be reached. 16) Fix SYN backlog lockdep issue in tcp and dccp, from Eric Dumazet. 17) Fix RCU locking in netpoll SKB send, which shows up in bonding, from Dave Jones. 18) Fix TX stalls in r8169, from Heiner Kallweit. 19) Fix locksup in nfp due to control message storms, from Jakub Kicinski. 20) Various rmnet bug fixes from Subash Abhinov Kasiviswanathan and Sean Tranchetti. 21) Fix use after free in ip_cmsg_recv_dstaddr(), from Eric Dumazet." * gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net: (122 commits) ixgbe: check return value of napi_complete_done() sctp: fix fall-through annotation r8169: always autoneg on resume ipv4: fix use-after-free in ip_cmsg_recv_dstaddr() net: qualcomm: rmnet: Fix incorrect allocation flag in receive path net: qualcomm: rmnet: Fix incorrect allocation flag in transmit net: qualcomm: rmnet: Skip processing loopback packets net: systemport: Fix wake-up interrupt race during resume rtnl: limit IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES to 4096 bonding: fix warning message inet: make sure to grab rcu_read_lock before using ireq->ireq_opt nfp: avoid soft lockups under control message storm declance: Fix continuation with the adapter identification message net: fec: fix rare tx timeout r8169: fix network stalls due to missing bit TXCFG_AUTO_FIFO tun: napi flags belong to tfile tun: initialize napi_mutex unconditionally tun: remove unused parameters bond: take rcu lock in netpoll_send_skb_on_dev rtnetlink: Fail dump if target netnsid is invalid ... commit 4233cfe6ec4683497d7318f55ce7617e97f2e610 Author: Song Liu Date: Wed Oct 3 11:30:35 2018 -0700 ixgbe: check return value of napi_complete_done() The NIC driver should only enable interrupts when napi_complete_done() returns true. This patch adds the check for ixgbe. Cc: stable@vger.kernel.org # 4.10+ Suggested-by: Eric Dumazet Signed-off-by: Song Liu Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller commit 95773dc0862717ab9612d69bc07d0386bd104603 Merge: 6bebe37927f3 ce01a1575f45 Author: Greg Kroah-Hartman Date: Wed Oct 3 11:06:49 2018 -0700 Merge tag 'linux-kselftest-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Shuah writes: "kselftest fixes for 4.19-rc7 This fixes update for 4.19-rc7 consists one fix to rseq test to prevent it from seg-faulting when compiled with -fpie." * tag 'linux-kselftest-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: rseq/selftests: fix parametrized test with -fpie commit 2cc543f5cd6deda27ef463686fa08c16c8c0990b Author: Gustavo A. R. Silva Date: Wed Oct 3 12:45:56 2018 +0200 sctp: fix fall-through annotation Replace "fallthru" with a proper "fall through" annotation. This fix is part of the ongoing efforts to enabling -Wimplicit-fallthrough Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 4c9613ce556fdeb671e779668b627ea3a2b61728 Author: Chris Wilson Date: Wed Oct 3 09:24:22 2018 +0100 drm/i915: Handle incomplete Z_FINISH for compressed error states The final call to zlib_deflate(Z_FINISH) may require more output space to be allocated and so needs to re-invoked. Failure to do so in the current code leads to incomplete zlib streams (albeit intact due to the use of Z_SYNC_FLUSH) resulting in the occasional short object capture. v2: Check against overrunning our pre-allocated page array v3: Drop Z_SYNC_FLUSH entirely Testcase: igt/i915-error-capture.js Fixes: 0a97015d45ee ("drm/i915: Compress GPU objects in error state") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: # v4.10+ Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20181003082422.23214-1-chris@chris-wilson.co.uk (cherry picked from commit 83bc0f5b432f60394466deef16fc753e27371d0b) Signed-off-by: Rodrigo Vivi commit 6bebe37927f3023e92de66964df8ff75151dcea9 Merge: 5b372600ccf1 ad608fbcf166 Author: Greg Kroah-Hartman Date: Wed Oct 3 04:23:46 2018 -0700 Merge tag 'media/v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Mauro writes: "media fixes for v4.19-rc6" * tag 'media/v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: v4l: event: Prevent freeing event subscriptions while accessed commit 5b372600ccf1116701e96cf593559a60c9bee7e0 Merge: 73dec82d8d2b 9ff3541e3ddf Author: Greg Kroah-Hartman Date: Wed Oct 3 04:22:30 2018 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Jiri writes: "HID fixes: - hantick touchpad fix from Anisse Astier - device ID addition for Ice Lake mobile from Srinivas Pandruvada - touchscreen resume fix for certain i2c-hid driven devices from Hans de Goede" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: intel-ish-hid: Enable Ice Lake mobile HID: i2c-hid: Remove RESEND_REPORT_DESCR quirk and its handling HID: i2c-hid: disable runtime PM operations on hantick touchpad commit 73dec82d8d2b2c6c9c9a66a1c8daae3fcd71d602 Merge: 1d2ba7fee28b ffc4c92227db Author: Greg Kroah-Hartman Date: Wed Oct 3 04:21:23 2018 -0700 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Al writes: "xattrs regression fix from Andreas; sat in -next for quite a while." * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: sysfs: Do not return POSIX ACL xattrs via listxattr commit ad608fbcf166fec809e402d548761768f602702c Author: Sakari Ailus Date: Tue Sep 11 05:32:37 2018 -0400 media: v4l: event: Prevent freeing event subscriptions while accessed The event subscriptions are added to the subscribed event list while holding a spinlock, but that lock is subsequently released while still accessing the subscription object. This makes it possible to unsubscribe the event --- and freeing the subscription object's memory --- while the subscription object is simultaneously accessed. Prevent this by adding a mutex to serialise the event subscription and unsubscription. This also gives a guarantee to the callback ops that the add op has returned before the del op is called. This change also results in making the elems field less special: subscriptions are only added to the event list once they are fully initialised. Signed-off-by: Sakari Ailus Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart Cc: stable@vger.kernel.org # for 4.14 and up Fixes: c3b5b0241f62 ("V4L/DVB: V4L: Events: Add backend") Signed-off-by: Mauro Carvalho Chehab commit 0711a43b6d84ff9189adfbf83c8bbf56eef794bf Author: Kai-Heng Feng Date: Tue Oct 2 23:29:11 2018 +0800 drm/edid: Add 6 bpc quirk for BOE panel in HP Pavilion 15-n233sl There's another panel that reports "DFP 1.x compliant TMDS" but it supports 6bpc instead of 8 bpc. Apply 6 bpc quirk for the panel to fix it. BugLink: https://bugs.launchpad.net/bugs/1794387 Cc: # v4.8+ Signed-off-by: Kai-Heng Feng Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20181002152911.4370-1-kai.heng.feng@canonical.com commit e4a02ed2aaf447fa849e3254bfdb3b9b01e1e520 Author: Guenter Roeck Date: Tue Oct 2 14:48:49 2018 -0700 locking/ww_mutex: Fix runtime warning in the WW mutex selftest If CONFIG_WW_MUTEX_SELFTEST=y is enabled, booting an image in an arm64 virtual machine results in the following traceback if 8 CPUs are enabled: DEBUG_LOCKS_WARN_ON(__owner_task(owner) != current) WARNING: CPU: 2 PID: 537 at kernel/locking/mutex.c:1033 __mutex_unlock_slowpath+0x1a8/0x2e0 ... Call trace: __mutex_unlock_slowpath() ww_mutex_unlock() test_cycle_work() process_one_work() worker_thread() kthread() ret_from_fork() If requesting b_mutex fails with -EDEADLK, the error variable is reassigned to the return value from calling ww_mutex_lock on a_mutex again. If this call fails, a_mutex is not locked. It is, however, unconditionally unlocked subsequently, causing the reported warning. Fix the problem by using two error variables. With this change, the selftest still fails as follows: cyclic deadlock not resolved, ret[7/8] = -35 However, the traceback is gone. Signed-off-by: Guenter Roeck Cc: Chris Wilson Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Fixes: d1b42b800e5d0 ("locking/ww_mutex: Add kselftests for resolving ww_mutex cyclic deadlocks") Link: http://lkml.kernel.org/r/1538516929-9734-1-git-send-email-linux@roeck-us.net Signed-off-by: Ingo Molnar commit 77d981b16f2db81ba6c7792a9102652045535127 Merge: 17b57b1883c1 1feda5eb77fc Author: Dave Airlie Date: Wed Oct 3 16:31:11 2018 +1000 Merge tag 'exynos-drm-fixes-for-v4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes Use default iommu domain instead of fake one - This patch makes it to reuse default IOMMU domain instead of allocating a fake IOMMU domain, and allows some design changes for enhancement of IOMMU framework[1] without breaking Exynos DRM. [1] https://www.spinics.net/lists/arm-kernel/msg676098.html Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/1538360696-23579-1-git-send-email-inki.dae@samsung.com commit 88296bd42b4e9d24e138a68b337c235b5cac89a7 Author: Nathan Chancellor Date: Tue Oct 2 15:45:11 2018 -0700 x86/cpu/amd: Remove unnecessary parentheses Clang warns when multiple pairs of parentheses are used for a single conditional statement. arch/x86/kernel/cpu/amd.c:925:14: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((c->x86 == 6)) { ~~~~~~~^~~~ arch/x86/kernel/cpu/amd.c:925:14: note: remove extraneous parentheses around the comparison to silence this warning if ((c->x86 == 6)) { ~ ^ ~ arch/x86/kernel/cpu/amd.c:925:14: note: use '=' to turn this equality comparison into an assignment if ((c->x86 == 6)) { ^~ = 1 warning generated. Signed-off-by: Nathan Chancellor Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20181002224511.14929-1-natechancellor@gmail.com Link: https://github.com/ClangBuiltLinux/linux/issues/187 Signed-off-by: Ingo Molnar commit 4f166564014aba65ad6f15b612f6711fd0f117ee Author: Andy Lutomirski Date: Tue Oct 2 21:26:50 2018 -0700 x86/vdso: Only enable vDSO retpolines when enabled and supported When I fixed the vDSO build to use inline retpolines, I messed up the Makefile logic and made it unconditional. It should have depended on CONFIG_RETPOLINE and on the availability of compiler support. This broke the build on some older compilers. Reported-by: nikola.ciprich@linuxbox.cz Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: David Woodhouse Cc: Linus Torvalds Cc: Matt Rickard Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: jason.vas.dias@gmail.com Cc: stable@vger.kernel.org Fixes: 2e549b2ee0e3 ("x86/vdso: Fix vDSO build if a retpoline is emitted") Link: http://lkml.kernel.org/r/08a1f29f2c238dd1f493945e702a521f8a5aa3ae.1538540801.git.luto@kernel.org Signed-off-by: Ingo Molnar commit 9003b369499b3320d3f16145145b729fb6ff3bd4 Author: Alex Xu (Hello71) Date: Sun Sep 30 11:06:39 2018 -0400 r8169: always autoneg on resume This affects at least versions 25 and 33, so assume all cards are broken and just renegotiate by default. Fixes: 10bc6a6042c9 ("r8169: fix autoneg issue on resume with RTL8168E") Signed-off-by: Alex Xu (Hello71) Signed-off-by: David S. Miller commit 64199fc0a46ba211362472f7f942f900af9492fd Author: Eric Dumazet Date: Sun Sep 30 11:33:39 2018 -0700 ipv4: fix use-after-free in ip_cmsg_recv_dstaddr() Caching ip_hdr(skb) before a call to pskb_may_pull() is buggy, do not do it. Fixes: 2efd4fca703a ("ip: in cmsg IP(V6)_ORIGDSTADDR call pskb_may_pull") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Reported-by: syzbot Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit b9f1bcb22091aacc0202c9ff6181e696cd1dc7dc Merge: 31c73cb5e296 cee26487620b Author: David S. Miller Date: Tue Oct 2 22:20:24 2018 -0700 Merge tag 'mlx5-fixes-2018-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2018-10-01 This pull request includes some fixes to mlx5 driver, Please pull and let me know if there's any problem. For -stable v4.11: "6e0a4a23c59a ('net/mlx5: E-Switch, Fix out of bound access when setting vport rate')" For -stable v4.18: "98d6627c372a ('net/mlx5e: Set vlan masks for all offloaded TC rules')" ==================== Signed-off-by: David S. Miller commit 31c73cb5e296fa56093c1df270e1ebc818cae211 Merge: 45ec318578c0 ec405641e2b7 Author: David S. Miller Date: Tue Oct 2 22:16:00 2018 -0700 Merge branch 'rmnet-fixes' Subash Abhinov Kasiviswanathan says: ==================== net: qualcomm: rmnet: Updates 2018-10-02 This series is a set of small fixes for rmnet driver Patch 1 is a fix for a scenario reported by syzkaller Patch 2 & 3 are fixes for incorrect allocation flags ==================== Signed-off-by: David S. Miller commit ec405641e2b73160e26ef17580d0cf28565d146c Author: Subash Abhinov Kasiviswanathan Date: Tue Oct 2 18:52:03 2018 -0600 net: qualcomm: rmnet: Fix incorrect allocation flag in receive path The incoming skb needs to be reallocated in case the headroom is not sufficient to adjust the ethernet header. This allocation needs to be atomic otherwise it results in this splat [<600601bb>] ___might_sleep+0x185/0x1a3 [<603f6314>] ? _raw_spin_unlock_irqrestore+0x0/0x27 [<60069bb0>] ? __wake_up_common_lock+0x95/0xd1 [<600602b0>] __might_sleep+0xd7/0xe2 [<60065598>] ? enqueue_task_fair+0x112/0x209 [<600eea13>] __kmalloc_track_caller+0x5d/0x124 [<600ee9b6>] ? __kmalloc_track_caller+0x0/0x124 [<602696d5>] __kmalloc_reserve.isra.34+0x30/0x7e [<603f629b>] ? _raw_spin_lock_irqsave+0x0/0x3d [<6026b744>] pskb_expand_head+0xbf/0x310 [<6025ca6a>] rmnet_rx_handler+0x7e/0x16b [<6025c9ec>] ? rmnet_rx_handler+0x0/0x16b [<6027ad0c>] __netif_receive_skb_core+0x301/0x96f [<60033c17>] ? set_signals+0x0/0x40 [<6027bbcb>] __netif_receive_skb+0x24/0x8e Fixes: 74692caf1b0b ("net: qualcomm: rmnet: Process packets over ethernet") Signed-off-by: Sean Tranchetti Signed-off-by: Subash Abhinov Kasiviswanathan Signed-off-by: David S. Miller commit 6392ff3c8e4c23d0a09b0ae9f94feb3effed490b Author: Subash Abhinov Kasiviswanathan Date: Tue Oct 2 18:52:02 2018 -0600 net: qualcomm: rmnet: Fix incorrect allocation flag in transmit The incoming skb needs to be reallocated in case the headroom is not sufficient to add the MAP header. This allocation needs to be atomic otherwise it results in the following splat [32805.801456] BUG: sleeping function called from invalid context [32805.841141] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [32805.904773] task: ffffffd7c5f62280 task.stack: ffffff80464a8000 [32805.910851] pc : ___might_sleep+0x180/0x188 [32805.915143] lr : ___might_sleep+0x180/0x188 [32806.131520] Call trace: [32806.134041] ___might_sleep+0x180/0x188 [32806.137980] __might_sleep+0x50/0x84 [32806.141653] __kmalloc_track_caller+0x80/0x3bc [32806.146215] __kmalloc_reserve+0x3c/0x88 [32806.150241] pskb_expand_head+0x74/0x288 [32806.154269] rmnet_egress_handler+0xb0/0x1d8 [32806.162239] rmnet_vnd_start_xmit+0xc8/0x13c [32806.166627] dev_hard_start_xmit+0x148/0x280 [32806.181181] sch_direct_xmit+0xa4/0x198 [32806.185125] __qdisc_run+0x1f8/0x310 [32806.188803] net_tx_action+0x23c/0x26c [32806.192655] __do_softirq+0x220/0x408 [32806.196420] do_softirq+0x4c/0x70 Fixes: ceed73a2cf4a ("drivers: net: ethernet: qualcomm: rmnet: Initial implementation") Signed-off-by: Subash Abhinov Kasiviswanathan Signed-off-by: David S. Miller commit a07f388e2cde2be74b263f85df6f672fea0305a1 Author: Sean Tranchetti Date: Tue Oct 2 18:52:01 2018 -0600 net: qualcomm: rmnet: Skip processing loopback packets RMNET RX handler was processing invalid packets that were originally sent on the real device and were looped back via dev_loopback_xmit(). This was detected using syzkaller. Fixes: ceed73a2cf4a ("drivers: net: ethernet: qualcomm: rmnet: Initial implementation") Signed-off-by: Sean Tranchetti Signed-off-by: Subash Abhinov Kasiviswanathan Signed-off-by: David S. Miller commit 45ec318578c0c22a11f5b9927d064418e1ab1905 Author: Florian Fainelli Date: Tue Oct 2 16:52:03 2018 -0700 net: systemport: Fix wake-up interrupt race during resume The AON_PM_L2 is normally used to trigger and identify the source of a wake-up event. Since the RX_SYS clock is no longer turned off, we also have an interrupt being sent to the SYSTEMPORT INTRL_2_0 controller, and that interrupt remains active up until the magic packet detector is disabled which happens much later during the driver resumption. The race happens if we have a CPU that is entering the SYSTEMPORT INTRL2_0 handler during resume, and another CPU has managed to clear the wake-up interrupt during bcm_sysport_resume_from_wol(). In that case, we have the first CPU stuck in the interrupt handler with an interrupt cause that has been cleared under its feet, and so we keep returning IRQ_NONE and we never make any progress. This was not a problem before because we would always turn off the RX_SYS clock during WoL, so the SYSTEMPORT INTRL2_0 would also be turned off as well, thus not latching the interrupt. The fix is to make sure we do not enable either the MPD or BRCM_TAG_MATCH interrupts since those are redundant with what the AON_PM_L2 interrupt controller already processes and they would cause such a race to occur. Fixes: bb9051a2b230 ("net: systemport: Add support for WAKE_FILTER") Fixes: 83e82f4c706b ("net: systemport: add Wake-on-LAN support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 7af929d6d05ba5564139718e30d5bc96bdbc716a Author: Steve French Date: Tue Oct 2 18:54:09 2018 -0500 smb3: fix lease break problem introduced by compounding Fixes problem (discovered by Aurelien) introduced by recent commit: commit b24df3e30cbf48255db866720fb71f14bf9d2f39 ("cifs: update receive_encrypted_standard to handle compounded responses") which broke the ability to respond to some lease breaks (lease breaks being ignored is a problem since can block server response for duration of the lease break timeout). Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Reviewed-by: Pavel Shilovsky commit 4e34feb5e96328df6a362c88098502b07c1b1e69 Author: Ronnie Sahlberg Date: Thu Aug 30 10:13:00 2018 +1000 cifs: only wake the thread for the very last PDU in a compound For compounded PDUs we whould only wake the waiting thread for the very last PDU of the compound. We do this so that we are guaranteed that the demultiplex_thread will not process or access any of those MIDs any more once the send/recv thread starts processing. Else there is a race where at the end of the send/recv processing we will try to delete all the mids of the compound. If the multiplex thread still has other mids to process at this point for this compound this can lead to an oops. Needed to fix recent commit: commit 730928c8f4be88e9d6a027a16b1e8fa9c59fc077 ("cifs: update smb2_queryfs() to use compounding") Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 11bde899817b575f6e9f22f35ec7e3296cd466b4 Merge: 0e1d6eca5113 3baafeffa48a Author: David S. Miller Date: Tue Oct 2 16:16:59 2018 -0700 Merge tag 'wireless-drivers-for-davem-2018-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers Kalle Valo says: ==================== wireless-drivers fixes for 4.19 First, and also hopefully the last, set of fixes for 4.19. All small but still important fixes mt76x0 * fix a bug when a virtual interface is removed multiple times b43 * fix DMA error related regression with proprietary firmware iwlwifi * fix an oops which was a regression in v4.19-rc1 ==================== Signed-off-by: David S. Miller commit ddf83afb9f60ee58cdec30bb615eff65d00ba05e Author: Ronnie Sahlberg Date: Thu Aug 30 10:12:59 2018 +1000 cifs: add a warning if we try to to dequeue a deleted mid cifs_delete_mid() is called once we are finished handling a mid and we expect no more work done on this mid. Needed to fix recent commit: commit 730928c8f4be88e9d6a027a16b1e8fa9c59fc077 ("cifs: update smb2_queryfs() to use compounding") Add a warning if someone tries to dequeue a mid that has already been flagged to be deleted. Also change list_del() to list_del_init() so that if we have similar bugs resurface in the future we will not oops. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 0595751f267994c3c7027377058e4185b3a28e75 Author: Aurelien Aptel Date: Thu May 17 16:35:07 2018 +0200 smb2: fix missing files in root share directory listing When mounting a Windows share that is the root of a drive (eg. C$) the server does not return . and .. directory entries. This results in the smb2 code path erroneously skipping the 2 first entries. Pseudo-code of the readdir() code path: cifs_readdir(struct file, struct dir_context) initiate_cifs_search <-- if no reponse cached yet server->ops->query_dir_first dir_emit_dots dir_emit <-- adds "." and ".." if we're at pos=0 find_cifs_entry initiate_cifs_search <-- if pos < start of current response (restart search) server->ops->query_dir_next <-- if pos > end of current response (fetch next search res) for(...) <-- loops over cur response entries starting at pos cifs_filldir <-- skip . and .., emit entry cifs_fill_dirent dir_emit pos++ A) dir_emit_dots() always adds . & .. and sets the current dir pos to 2 (0 and 1 are done). Therefore we always want the index_to_find to be 2 regardless of if the response has . and .. B) smb1 code initializes index_of_last_entry with a +2 offset in cifssmb.c CIFSFindFirst(): psrch_inf->index_of_last_entry = 2 /* skip . and .. */ + psrch_inf->entries_in_buffer; Later in find_cifs_entry() we want to find the next dir entry at pos=2 as a result of (A) first_entry_in_buffer = cfile->srch_inf.index_of_last_entry - cfile->srch_inf.entries_in_buffer; This var is the dir pos that the first entry in the buffer will have therefore it must be 2 in the first call. If we don't offset index_of_last_entry by 2 (like in (B)), first_entry_in_buffer=0 but we were instructed to get pos=2 so this code in find_cifs_entry() skips the 2 first which is ok for non-root shares, as it skips . and .. from the response but is not ok for root shares where the 2 first are actual files pos_in_buf = index_to_find - first_entry_in_buffer; // pos_in_buf=2 // we skip 2 first response entries :( for (i = 0; (i < (pos_in_buf)) && (cur_ent != NULL); i++) { /* go entry by entry figuring out which is first */ cur_ent = nxt_dir_entry(cur_ent, end_of_smb, cfile->srch_inf.info_level); } C) cifs_filldir() skips . and .. so we can safely ignore them for now. Sample program: int main(int argc, char **argv) { const char *path = argc >= 2 ? argv[1] : "."; DIR *dh; struct dirent *de; printf("listing path <%s>\n", path); dh = opendir(path); if (!dh) { printf("opendir error %d\n", errno); return 1; } while (1) { de = readdir(dh); if (!de) { if (errno) { printf("readdir error %d\n", errno); return 1; } printf("end of listing\n"); break; } printf("off=%lu <%s>\n", de->d_off, de->d_name); } return 0; } Before the fix with SMB1 on root shares: <.> off=1 <..> off=2 <$Recycle.Bin> off=3 off=4 and on non-root shares: <.> off=1 <..> off=4 <-- after adding .., the offsets jumps to +2 because <2536> off=5 we skipped . and .. from response buffer (C) <411> off=6 but still incremented pos off=7 off=8 Therefore the fix for smb2 is to mimic smb1 behaviour and offset the index_of_last_entry by 2. Test results comparing smb1 and smb2 before/after the fix on root share, non-root shares and on large directories (ie. multi-response dir listing): PRE FIX ======= pre-1-root VS pre-2-root: ERR pre-2-root is missing [bootmgr, $Recycle.Bin] pre-1-nonroot VS pre-2-nonroot: OK~ same files, same order, different offsets pre-1-nonroot-large VS pre-2-nonroot-large: OK~ same files, same order, different offsets POST FIX ======== post-1-root VS post-2-root: OK same files, same order, same offsets post-1-nonroot VS post-2-nonroot: OK same files, same order, same offsets post-1-nonroot-large VS post-2-nonroot-large: OK same files, same order, same offsets REGRESSION? =========== pre-1-root VS post-1-root: OK same files, same order, same offsets pre-1-nonroot VS post-1-nonroot: OK same files, same order, same offsets BugLink: https://bugzilla.samba.org/show_bug.cgi?id=13107 Signed-off-by: Aurelien Aptel Signed-off-by: Paulo Alcantara Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French CC: Stable commit 0e1d6eca5113858ed2caea61a5adc03c595f6096 Author: Eric Dumazet Date: Tue Oct 2 15:47:35 2018 -0700 rtnl: limit IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES to 4096 We have an impressive number of syzkaller bugs that are linked to the fact that syzbot was able to create a networking device with millions of TX (or RX) queues. Let's limit the number of RX/TX queues to 4096, this really should cover all known cases. A separate patch will add various cond_resched() in the loops handling sysfs entries at device creation and dismantle. Tested: lpaa6:~# ip link add gre-4097 numtxqueues 4097 numrxqueues 4097 type ip6gretap RTNETLINK answers: Invalid argument lpaa6:~# time ip link add gre-4096 numtxqueues 4096 numrxqueues 4096 type ip6gretap real 0m0.180s user 0m0.000s sys 0m0.107s Fixes: 76ff5cc91935 ("rtnl: allow to specify number of rx and tx queues on device creation") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit 0f3b914c9cfcd7bbedd445dc4ac5dd999fa213c2 Author: Mahesh Bandewar Date: Tue Oct 2 12:14:34 2018 -0700 bonding: fix warning message RX queue config for bonding master could be different from its slave device(s). With the commit 6a9e461f6fe4 ("bonding: pass link-local packets to bonding master also."), the packet is reinjected into stack with skb->dev as bonding master. This potentially triggers the message: "bondX received packet on queue Y, but number of RX queues is Z" whenever the queue that packet is received on is higher than the numrxqueues on bonding master (Y > Z). Fixes: 6a9e461f6fe4 ("bonding: pass link-local packets to bonding master also.") Reported-by: John Sperbeck Signed-off-by: Eric Dumazet Signed-off-by: Mahesh Bandewar Signed-off-by: David S. Miller commit 2ab2ddd301a22ca3c5f0b743593e4ad2953dfa53 Author: Eric Dumazet Date: Tue Oct 2 12:35:05 2018 -0700 inet: make sure to grab rcu_read_lock before using ireq->ireq_opt Timer handlers do not imply rcu_read_lock(), so my recent fix triggered a LOCKDEP warning when SYNACK is retransmit. Lets add rcu_read_lock()/rcu_read_unlock() pairs around ireq->ireq_opt usages instead of guessing what is done by callers, since it is not worth the pain. Get rid of ireq_opt_deref() helper since it hides the logic without real benefit, since it is now a standard rcu_dereference(). Fixes: 1ad98e9d1bdf ("tcp/dccp: fix lockdep issue when SYN is backlogged") Signed-off-by: Eric Dumazet Reported-by: Willem de Bruijn Signed-off-by: David S. Miller commit 5b162cc4ac27ba76e576abc9090c54cf90a17980 Author: Geert Uytterhoeven Date: Thu Aug 30 14:54:04 2018 +0200 Revert "serial: sh-sci: Allow for compressed SCIF address" This reverts commit 2d4dd0da45401c7ae7332b4d1eb7bbb1348edde9. This broke earlycon on all Renesas ARM platforms using a SCIF port for the serial console (R-Car, RZ/A1, RZ/G1, RZ/G2 SoCs), due to an incorrect value of port->regshift. Signed-off-by: Geert Uytterhoeven Acked-by: Chris Brandt Signed-off-by: Greg Kroah-Hartman commit 10653022456dc77b398777fd8e95126c77954b49 Author: Geert Uytterhoeven Date: Thu Aug 30 14:54:03 2018 +0200 Revert "serial: sh-sci: Remove SCIx_RZ_SCIFA_REGTYPE" This reverts commit 7acece71a517cad83a0842a94d94c13f271b680c. Signed-off-by: Geert Uytterhoeven Acked-by: Chris Brandt Signed-off-by: Greg Kroah-Hartman commit beeeac43b6fae5f5eaf707b6fcc2bf1e09deb785 Author: Guenter Roeck Date: Mon Oct 1 21:42:37 2018 -0700 Revert "serial: 8250_dw: Fix runtime PM handling" This reverts commit d76c74387e1c978b6c5524a146ab0f3f72206f98. While commit d76c74387e1c ("serial: 8250_dw: Fix runtime PM handling") fixes runtime PM handling when using kgdb, it introduces a traceback for everyone else. BUG: sleeping function called from invalid context at /mnt/host/source/src/third_party/kernel/next/drivers/base/power/runtime.c:1034 in_atomic(): 1, irqs_disabled(): 1, pid: 1, name: swapper/0 7 locks held by swapper/0/1: #0: 000000005ec5bc72 (&dev->mutex){....}, at: __driver_attach+0xb5/0x12b #1: 000000005d5fa9e5 (&dev->mutex){....}, at: __device_attach+0x3e/0x15b #2: 0000000047e93286 (serial_mutex){+.+.}, at: serial8250_register_8250_port+0x51/0x8bb #3: 000000003b328f07 (port_mutex){+.+.}, at: uart_add_one_port+0xab/0x8b0 #4: 00000000fa313d4d (&port->mutex){+.+.}, at: uart_add_one_port+0xcc/0x8b0 #5: 00000000090983ca (console_lock){+.+.}, at: vprintk_emit+0xdb/0x217 #6: 00000000c743e583 (console_owner){-...}, at: console_unlock+0x211/0x60f irq event stamp: 735222 __down_trylock_console_sem+0x4a/0x84 console_unlock+0x338/0x60f __do_softirq+0x4a4/0x50d irq_exit+0x64/0xe2 CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.19.0-rc5 #6 Hardware name: Google Caroline/Caroline, BIOS Google_Caroline.7820.286.0 03/15/2017 Call Trace: dump_stack+0x7d/0xbd ___might_sleep+0x238/0x259 __pm_runtime_resume+0x4e/0xa4 ? serial8250_rpm_get+0x2e/0x44 serial8250_console_write+0x44/0x301 ? lock_acquire+0x1b8/0x1fa console_unlock+0x577/0x60f vprintk_emit+0x1f0/0x217 printk+0x52/0x6e register_console+0x43b/0x524 uart_add_one_port+0x672/0x8b0 ? set_io_from_upio+0x150/0x162 serial8250_register_8250_port+0x825/0x8bb dw8250_probe+0x80c/0x8b0 ? dw8250_serial_inq+0x8e/0x8e ? dw8250_check_lcr+0x108/0x108 ? dw8250_runtime_resume+0x5b/0x5b ? dw8250_serial_outq+0xa1/0xa1 ? dw8250_remove+0x115/0x115 platform_drv_probe+0x76/0xc5 really_probe+0x1f1/0x3ee ? driver_allows_async_probing+0x5d/0x5d driver_probe_device+0xd6/0x112 ? driver_allows_async_probing+0x5d/0x5d bus_for_each_drv+0xbe/0xe5 __device_attach+0xdd/0x15b bus_probe_device+0x5a/0x10b device_add+0x501/0x894 ? _raw_write_unlock+0x27/0x3a platform_device_add+0x224/0x2b7 mfd_add_device+0x718/0x75b ? __kmalloc+0x144/0x16a ? mfd_add_devices+0x38/0xdb mfd_add_devices+0x9b/0xdb intel_lpss_probe+0x7d4/0x8ee intel_lpss_pci_probe+0xac/0xd4 pci_device_probe+0x101/0x18e ... Revert the offending patch until a more comprehensive solution is available. Cc: Tony Lindgren Cc: Andy Shevchenko Cc: Phil Edworthy Fixes: d76c74387e1c ("serial: 8250_dw: Fix runtime PM handling") Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit ef1f2258748b675422ca0107e5bfb9ceeac675de Author: Atish Patra Date: Tue Sep 11 11:30:18 2018 -0700 RISCV: Fix end PFN for low memory Use memblock_end_of_DRAM which provides correct last low memory PFN. Without that, DMA32 region becomes empty resulting in zero pages being allocated for DMA32. This patch is based on earlier patch from palmer which never merged into 4.19. I just edited the commit text to make more sense. Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 2647c43c7f3ba4b752bfce261d53b16e2f5bc9e3 Author: Mike Travis Date: Tue Oct 2 13:01:46 2018 -0500 x86/tsc: Fix UV TSC initialization The recent rework of the TSC calibration code introduced a regression on UV systems as it added a call to tsc_early_init() which initializes the TSC ADJUST values before acpi_boot_table_init(). In the case of UV systems, that is a necessary step that calls uv_system_init(). This informs tsc_sanitize_first_cpu() that the kernel runs on a platform with async TSC resets as documented in commit 341102c3ef29 ("x86/tsc: Add option that TSC on Socket 0 being non-zero is valid") Fix it by skipping the early tsc initialization on UV systems and let TSC init tests take place later in tsc_init(). Fixes: cf7a63ef4e02 ("x86/tsc: Calibrate tsc only once") Suggested-by: Hedi Berriche Signed-off-by: Mike Travis Signed-off-by: Thomas Gleixner Reviewed-by: Russ Anderson Reviewed-by: Dimitri Sivanich Cc: "H. Peter Anvin" Cc: Russ Anderson Cc: Dimitri Sivanich Cc: Borislav Petkov Cc: Kate Stewart Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Len Brown Cc: Dou Liyang Cc: Xiaoming Gao Cc: Rajvi Jingar Link: https://lkml.kernel.org/r/20181002180144.923579706@stormcage.americas.sgi.com commit 20a8378aa9dd108a01cb0e695599f5257a885c4b Author: Mike Travis Date: Tue Oct 2 13:01:45 2018 -0500 x86/platform/uv: Provide is_early_uv_system() Introduce is_early_uv_system() which uses efi.uv_systab to decide early in the boot process whether the kernel runs on a UV system. This is needed to skip other early setup/init code that might break the UV platform if done too early such as before necessary ACPI tables parsing takes place. Suggested-by: Hedi Berriche Signed-off-by: Mike Travis Signed-off-by: Thomas Gleixner Reviewed-by: Russ Anderson Reviewed-by: Dimitri Sivanich Cc: "H. Peter Anvin" Cc: Russ Anderson Cc: Dimitri Sivanich Cc: Borislav Petkov Cc: Kate Stewart Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Len Brown Cc: Dou Liyang Cc: Xiaoming Gao Cc: Rajvi Jingar Link: https://lkml.kernel.org/r/20181002180144.801700401@stormcage.americas.sgi.com commit ff58e2df62ce29d0552278c290ae494b30fe0c6f Author: Jakub Kicinski Date: Tue Oct 2 10:10:14 2018 -0700 nfp: avoid soft lockups under control message storm When FW floods the driver with control messages try to exit the cmsg processing loop every now and then to avoid soft lockups. Cmsg processing is generally very lightweight so 512 seems like a reasonable budget, which should not be exceeded under normal conditions. Fixes: 77ece8d5f196 ("nfp: add control vNIC datapath") Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Tested-by: Pieter Jansen van Vuuren Signed-off-by: David S. Miller commit fe3a83af6a50199bf250fa331e94216912f79395 Author: Maciej W. Rozycki Date: Tue Oct 2 14:23:45 2018 +0100 declance: Fix continuation with the adapter identification message Fix a commit 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing continuation lines") regression with the `declance' driver, which caused the adapter identification message to be split between two lines, e.g.: declance.c: v0.011 by Linux MIPS DECstation task force tc6: PMAD-AA , addr = 08:00:2b:1b:2a:6a, irq = 14 tc6: registered as eth0. Address that properly, by printing identification with a single call, making the messages now look like: declance.c: v0.011 by Linux MIPS DECstation task force tc6: PMAD-AA, addr = 08:00:2b:1b:2a:6a, irq = 14 tc6: registered as eth0. Signed-off-by: Maciej W. Rozycki Fixes: 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing continuation lines") Signed-off-by: David S. Miller commit 657ade07df72847f591ccdb36bd9b91ed0edbac3 Author: Rickard x Andersson Date: Tue Oct 2 14:49:32 2018 +0200 net: fec: fix rare tx timeout During certain heavy network loads TX could time out with TX ring dump. TX is sometimes never restarted after reaching "tx_stop_threshold" because function "fec_enet_tx_queue" only tests the first queue. In addition the TX timeout callback function failed to recover because it also operated only on the first queue. Signed-off-by: Rickard x Andersson Signed-off-by: David S. Miller commit eafa717bc145963c944bb0a64d16add683861b35 Author: Mika Westerberg Date: Mon Sep 24 13:20:45 2018 +0300 thunderbolt: Initialize after IOMMUs If IOMMU is enabled and Thunderbolt driver is built into the kernel image, it will be probed before IOMMUs are attached to the PCI bus. Because of this DMA mappings the driver does will not go through IOMMU and start failing right after IOMMUs are enabled. For this reason move the Thunderbolt driver initialization happen at rootfs level. Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit 86da809dda64a63fc27e05a215475325c3aaae92 Author: Mika Westerberg Date: Mon Sep 24 13:20:44 2018 +0300 thunderbolt: Do not handle ICM events after domain is stopped If there is a long chain of devices connected when the driver is loaded ICM sends device connected event for each and those are put to tb->wq for later processing. Now if the driver gets unloaded in the middle, so that the work queue is not yet empty it gets flushed by tb_domain_stop(). However, by that time the root switch is already removed so the driver crashes when it tries to dereference it in ICM event handling callbacks. Fix this by checking whether the root switch is already removed. If it is we know that the domain is stopped and we should merely skip handling the event. Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit b45ba4a51cde29b2939365ef0c07ad34c8321789 Author: Christophe Leroy Date: Mon Oct 1 12:21:10 2018 +0000 powerpc/lib: fix book3s/32 boot failure due to code patching Commit 51c3c62b58b3 ("powerpc: Avoid code patching freed init sections") accesses 'init_mem_is_free' flag too early, before the kernel is relocated. This provokes early boot failure (before the console is active). As it is not necessary to do this verification that early, this patch moves the test into patch_instruction() instead of __patch_instruction(). This modification also has the advantage of avoiding unnecessary remappings. Fixes: 51c3c62b58b3 ("powerpc: Avoid code patching freed init sections") Cc: stable@vger.kernel.org # 4.13+ Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit b0584ea66d73919cbf5878a3420a837f06ab8396 Author: Roman Gushchin Date: Tue Oct 2 02:41:53 2018 +0000 bpf: don't accept cgroup local storage with zero value size Explicitly forbid creating cgroup local storage maps with zero value size, as it makes no sense and might even cause a panic. Reported-by: syzbot+18628320d3b14a5c459c@syzkaller.appspotmail.com Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Signed-off-by: Daniel Borkmann commit 1d2ba7fee28b3a47cca8e8f4f94a22d30b2b3a6f Merge: 5e0b19ac332b 7c968791f775 Author: Greg Kroah-Hartman Date: Tue Oct 2 05:19:43 2018 -0700 Merge tag 'fbdev-v4.19-rc7' of https://github.com/bzolnier/linux Bartlomiej writes: "fbdev fixes for v4.19-rc7: - fix OMAPFB_MEMORY_READ ioctl to not leak kernel memory in omapfb driver (Tomi Valkeinen) - add missing prepare/unprepare clock operations in pxa168fb driver (Lubomir Rintel) - add nobgrt option in efifb driver to disable ACPI BGRT logo restore (Hans de Goede) - fix spelling mistake in fall-through annotation in stifb driver (Gustavo A. R. Silva) - fix URL for uvesafb repository in the documentation (Adam Jackson)" * tag 'fbdev-v4.19-rc7' of https://github.com/bzolnier/linux: video/fbdev/stifb: Fix spelling mistake in fall-through annotation uvesafb: Fix URLs in the documentation efifb: BGRT: Add nobgrt option fbdev/omapfb: fix omapfb_memory_read infoleak pxa168fb: prepare the clock commit 5e0b19ac332b92356ef7145a4ddfb571cf66ab99 Merge: 385afbf8c3e8 1b09d9c232cd Author: Greg Kroah-Hartman Date: Tue Oct 2 05:19:04 2018 -0700 Merge tag 'mmc-v4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Ulf writes: "MMC core: - Fixup conversion of debounce time to/from ms/us MMC host: - sdhi: Fixup whitelisting for Gen3 types" * tag 'mmc-v4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: slot-gpio: Fix debounce time to use miliseconds again mmc: core: Fix debounce time to use microseconds mmc: sdhi: sys_dmac: check for all Gen3 types when whitelisting commit 4d4c2d89913e2d891bd6a34b12050a2576e60525 Author: Noralf Trønnes Date: Mon Oct 1 21:45:36 2018 +0200 drm/cma-helper: Fix crash in fbdev error path Sergey Suloev reported a crash happening in drm_client_dev_hotplug() when fbdev had failed to register. [ 9.124598] vc4_hdmi 3f902000.hdmi: ASoC: Failed to create component debugfs directory [ 9.147667] vc4_hdmi 3f902000.hdmi: vc4-hdmi-hifi <-> 3f902000.hdmi mapping ok [ 9.155184] vc4_hdmi 3f902000.hdmi: ASoC: no DMI vendor name! [ 9.166544] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4]) [ 9.173840] vc4-drm soc:gpu: bound 3f806000.vec (ops vc4_vec_ops [vc4]) [ 9.181029] vc4-drm soc:gpu: bound 3f004000.txp (ops vc4_txp_ops [vc4]) [ 9.188519] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4]) [ 9.195690] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4]) [ 9.203523] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4]) [ 9.215032] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4]) [ 9.274785] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4]) [ 9.290246] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0 [ 9.297464] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [ 9.304600] [drm] Driver supports precise vblank timestamp query. [ 9.382856] vc4-drm soc:gpu: [drm:drm_fb_helper_fbdev_setup [drm_kms_helper]] *ERROR* Failed to set fbdev configuration [ 10.404937] Unable to handle kernel paging request at virtual address 00330a656369768a [ 10.441620] [00330a656369768a] address between user and kernel address ranges [ 10.449087] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 10.454762] Modules linked in: brcmfmac vc4 drm_kms_helper cfg80211 drm rfkill smsc95xx brcmutil usbnet drm_panel_orientation_quirks raspberrypi_hwmon bcm2835_dma crc32_ce pwm_bcm2835 bcm2835_rng virt_dma rng_core i2c_bcm2835 ip_tables x_tables ipv6 [ 10.477296] CPU: 2 PID: 45 Comm: kworker/2:1 Not tainted 4.19.0-rc5 #3 [ 10.483934] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT) [ 10.489966] Workqueue: events output_poll_execute [drm_kms_helper] [ 10.596515] Process kworker/2:1 (pid: 45, stack limit = 0x000000007e8924dc) [ 10.603590] Call trace: [ 10.606259] drm_client_dev_hotplug+0x5c/0xb0 [drm] [ 10.611303] drm_kms_helper_hotplug_event+0x30/0x40 [drm_kms_helper] [ 10.617849] output_poll_execute+0xc4/0x1e0 [drm_kms_helper] [ 10.623616] process_one_work+0x1c8/0x318 [ 10.627695] worker_thread+0x48/0x428 [ 10.631420] kthread+0xf8/0x128 [ 10.634615] ret_from_fork+0x10/0x18 [ 10.638255] Code: 54000220 f9401261 aa1303e0 b4000141 (f9400c21) [ 10.644456] ---[ end trace c75b4a4b0e141908 ]--- The reason for this is that drm_fbdev_cma_init() removes the drm_client when fbdev registration fails, but it doesn't remove the client from the drm_device client list. So the client list now has a pointer that points into the unknown and we have a 'use after free' situation. Split drm_client_new() into drm_client_init() and drm_client_add() to fix removal in the error path. Fixes: 894a677f4b3e ("drm/cma-helper: Use the generic fbdev emulation") Reported-by: Sergey Suloev Cc: Stefan Wahren Cc: Eric Anholt Cc: Daniel Vetter Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20181001194536.57756-1-noralf@tronnes.org commit 37355bdc5a129899f6b245900a8eb944a092f7fd Author: Mel Gorman Date: Mon Oct 1 11:05:25 2018 +0100 sched/numa: Migrate pages to local nodes quicker early in the lifetime of a task Automatic NUMA Balancing uses a multi-stage pass to decide whether a page should migrate to a local node. This filter avoids excessive ping-ponging if a page is shared or used by threads that migrate cross-node frequently. Threads inherit both page tables and the preferred node ID from the parent. This means that threads can trigger hinting faults earlier than a new task which delays scanning for a number of seconds. As it can be load balanced very early in its lifetime there can be an unnecessary delay before it starts migrating thread-local data. This patch migrates private pages faster early in the lifetime of a thread using the sequence counter as an identifier of new tasks. With this patch applied, STREAM performance is the same as 4.17 even though processes are not spread cross-node prematurely. Other workloads showed a mix of minor gains and losses. This is somewhat expected most workloads are not very sensitive to the starting conditions of a process. 4.19.0-rc5 4.19.0-rc5 4.17.0 numab-v1r1 fastmigrate-v1r1 vanilla MB/sec copy 43298.52 ( 0.00%) 47335.46 ( 9.32%) 47219.24 ( 9.06%) MB/sec scale 30115.06 ( 0.00%) 32568.12 ( 8.15%) 32527.56 ( 8.01%) MB/sec add 32825.12 ( 0.00%) 36078.94 ( 9.91%) 35928.02 ( 9.45%) MB/sec triad 32549.52 ( 0.00%) 35935.94 ( 10.40%) 35969.88 ( 10.51%) Signed-off-by: Mel Gorman Reviewed-by: Rik van Riel Acked-by: Peter Zijlstra Cc: Jirka Hladky Cc: Linus Torvalds Cc: Linux-MM Cc: Srikar Dronamraju Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20181001100525.29789-3-mgorman@techsingularity.net Signed-off-by: Ingo Molnar commit efaffc5e40aeced0bcb497ed7a0a5b8c14abfcdf Author: Mel Gorman Date: Mon Oct 1 11:05:24 2018 +0100 mm, sched/numa: Remove rate-limiting of automatic NUMA balancing migration Rate limiting of page migrations due to automatic NUMA balancing was introduced to mitigate the worst-case scenario of migrating at high frequency due to false sharing or slowly ping-ponging between nodes. Since then, a lot of effort was spent on correctly identifying these pages and avoiding unnecessary migrations and the safety net may no longer be required. Jirka Hladky reported a regression in 4.17 due to a scheduler patch that avoids spreading STREAM tasks wide prematurely. However, once the task was properly placed, it delayed migrating the memory due to rate limiting. Increasing the limit fixed the problem for him. Currently, the limit is hard-coded and does not account for the real capabilities of the hardware. Even if an estimate was attempted, it would not properly account for the number of memory controllers and it could not account for the amount of bandwidth used for normal accesses. Rather than fudging, this patch simply eliminates the rate limiting. However, Jirka reports that a STREAM configuration using multiple processes achieved similar performance to 4.16. In local tests, this patch improved performance of STREAM relative to the baseline but it is somewhat machine-dependent. Most workloads show little or not performance difference implying that there is not a heavily reliance on the throttling mechanism and it is safe to remove. STREAM on 2-socket machine 4.19.0-rc5 4.19.0-rc5 numab-v1r1 noratelimit-v1r1 MB/sec copy 43298.52 ( 0.00%) 44673.38 ( 3.18%) MB/sec scale 30115.06 ( 0.00%) 31293.06 ( 3.91%) MB/sec add 32825.12 ( 0.00%) 34883.62 ( 6.27%) MB/sec triad 32549.52 ( 0.00%) 34906.60 ( 7.24% Signed-off-by: Mel Gorman Reviewed-by: Rik van Riel Acked-by: Peter Zijlstra Cc: Jirka Hladky Cc: Linus Torvalds Cc: Linux-MM Cc: Srikar Dronamraju Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20181001100525.29789-2-mgorman@techsingularity.net Signed-off-by: Ingo Molnar commit 6d348925b306ab0cc9757a09a8cea6bf288018e4 Author: Will Deacon Date: Mon Oct 1 15:28:56 2018 +0100 MAINTAINERS: Remove dead path from LOCKING PRIMITIVES entry Since 890658b7ab48 ("locking/mutex: Kill arch specific code"), there are no mutex header files under arch/, so we can remove the redundant entry from MAINTAINERS. Reported-by: Joe Perches Signed-off-by: Will Deacon Cc: Jason Low Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20181001142856.GC9716@arm.com Signed-off-by: Ingo Molnar commit 12d43deb1ee639d01a2a8d2a7a4cc8ad31224475 Author: Jann Horn Date: Mon Oct 1 17:31:17 2018 +0200 drm: fix use-after-free read in drm_mode_create_lease_ioctl() fd_install() moves the reference given to it into the file descriptor table of the current process. If the current process is multithreaded, then immediately after fd_install(), another thread can close() the file descriptor and cause the file's resources to be cleaned up. Since the reference to "lessee" is held by the file, we must not access "lessee" after the fd_install() call. As far as I can tell, to reach this codepath, the caller must have an open file descriptor to a DRI device in master mode. I'm not sure what the requirements for that are. Signed-off-by: Jann Horn Fixes: 62884cd386b8 ("drm: Add four ioctls for managing drm mode object leases [v7]") Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20181001153117.216923-1-jannh@google.com commit 24abf2901b18bf941b9f21ea2ce5791f61097ae4 Author: Eric Farman Date: Tue Oct 2 03:02:35 2018 +0200 s390/cio: Fix how vfio-ccw checks pinned pages We have two nested loops to check the entries within the pfn_array_table arrays. But we mistakenly use the outer array as an index in our check, and completely ignore the indexing performed by the inner loop. Cc: stable@vger.kernel.org Signed-off-by: Eric Farman Message-Id: <20181002010235.42483-1-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit 6fd98e775f24fd41520928d345f5db3ff52bb35d Author: Srikar Dronamraju Date: Fri Sep 21 23:19:01 2018 +0530 sched/numa: Avoid task migration for small NUMA improvement If NUMA improvement from the task migration is going to be very minimal, then avoid task migration. Specjbb2005 results (8 warehouses) Higher bops are better 2 Socket - 2 Node Haswell - X86 JVMS Prev Current %Change 4 198512 205910 3.72673 1 313559 318491 1.57291 2 Socket - 4 Node Power8 - PowerNV JVMS Prev Current %Change 8 74761.9 74935.9 0.232739 1 214874 226796 5.54837 2 Socket - 2 Node Power9 - PowerNV JVMS Prev Current %Change 4 180536 189780 5.12031 1 210281 205695 -2.18089 4 Socket - 4 Node Power7 - PowerVM JVMS Prev Current %Change 8 56511.4 60370 6.828 1 104899 108100 3.05151 1/7 cases is regressing, if we look at events migrate_pages seem to vary the most especially in the regressing case. Also some amount of variance is expected between different runs of Specjbb2005. Some events stats before and after applying the patch. perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 13,818,546 13,801,554 migrations 1,149,960 1,151,541 faults 385,583 433,246 cache-misses 55,259,546,768 55,168,691,835 sched:sched_move_numa 2,257 2,551 sched:sched_stick_numa 9 24 sched:sched_swap_numa 512 904 migrate:mm_migrate_pages 2,225 1,571 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 72692 113682 numa_hint_faults_local 62270 102163 numa_hit 238762 240181 numa_huge_pte_updates 48 36 numa_interleave 75 64 numa_local 238676 240103 numa_other 86 78 numa_pages_migrated 2225 1564 numa_pte_updates 98557 134080 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 3,173,490 3,079,150 migrations 36,966 31,455 faults 108,776 99,081 cache-misses 12,200,075,320 11,588,126,740 sched:sched_move_numa 1,264 1 sched:sched_stick_numa 0 0 sched:sched_swap_numa 0 0 migrate:mm_migrate_pages 899 36 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 21109 430 numa_hint_faults_local 17120 77 numa_hit 72934 71277 numa_huge_pte_updates 42 0 numa_interleave 33 22 numa_local 72866 71218 numa_other 68 59 numa_pages_migrated 915 23 numa_pte_updates 42326 0 perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 8,312,022 8,707,565 migrations 231,705 171,342 faults 310,242 310,820 cache-misses 402,324,573 136,115,400 sched:sched_move_numa 193 215 sched:sched_stick_numa 0 6 sched:sched_swap_numa 3 24 migrate:mm_migrate_pages 93 162 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 11838 8985 numa_hint_faults_local 11216 8154 numa_hit 90689 93819 numa_huge_pte_updates 0 0 numa_interleave 1579 882 numa_local 89634 93496 numa_other 1055 323 numa_pages_migrated 92 169 numa_pte_updates 12109 9217 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 2,170,481 2,152,072 migrations 10,126 10,704 faults 160,962 164,376 cache-misses 10,834,845 3,818,437 sched:sched_move_numa 10 16 sched:sched_stick_numa 0 0 sched:sched_swap_numa 0 7 migrate:mm_migrate_pages 2 199 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 403 2248 numa_hint_faults_local 358 1666 numa_hit 25898 25704 numa_huge_pte_updates 0 0 numa_interleave 207 200 numa_local 25860 25679 numa_other 38 25 numa_pages_migrated 2 197 numa_pte_updates 400 2234 perf stats 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 110,339,633 93,330,595 migrations 4,139,812 4,122,061 faults 863,622 865,979 cache-misses 231,838,045,660 225,395,083,479 sched:sched_move_numa 2,196 2,372 sched:sched_stick_numa 33 24 sched:sched_swap_numa 544 769 migrate:mm_migrate_pages 2,469 1,677 vmstat 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 85748 91638 numa_hint_faults_local 66831 78096 numa_hit 242213 242225 numa_huge_pte_updates 0 0 numa_interleave 0 2 numa_local 242211 242219 numa_other 2 6 numa_pages_migrated 2376 1515 numa_pte_updates 86233 92274 perf stats 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 59,331,057 51,487,271 migrations 552,019 537,170 faults 266,586 256,921 cache-misses 73,796,312,990 70,073,831,187 sched:sched_move_numa 981 576 sched:sched_stick_numa 54 24 sched:sched_swap_numa 286 327 migrate:mm_migrate_pages 713 726 vmstat 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 14807 12000 numa_hint_faults_local 5738 5024 numa_hit 36230 36470 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 36228 36465 numa_other 2 5 numa_pages_migrated 703 726 numa_pte_updates 14742 11930 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Cc: Jirka Hladky Cc: Linus Torvalds Cc: Mel Gorman Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1537552141-27815-7-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 7534612123e0f5d020aba1076a6bb505db0e6bfe Author: Srikar Dronamraju Date: Fri Sep 21 23:19:00 2018 +0530 mm/migrate: Use spin_trylock() while resetting rate limit Since this spinlock will only serialize the migrate rate limiting, convert the spin_lock() to a spin_trylock(). If another thread is updating, this task can move on. Specjbb2005 results (8 warehouses) Higher bops are better 2 Socket - 2 Node Haswell - X86 JVMS Prev Current %Change 4 205332 198512 -3.32145 1 319785 313559 -1.94693 2 Socket - 4 Node Power8 - PowerNV JVMS Prev Current %Change 8 74912 74761.9 -0.200368 1 206585 214874 4.01239 2 Socket - 2 Node Power9 - PowerNV JVMS Prev Current %Change 4 189162 180536 -4.56011 1 213760 210281 -1.62753 4 Socket - 4 Node Power7 - PowerVM JVMS Prev Current %Change 8 58736.8 56511.4 -3.78877 1 105419 104899 -0.49327 Avoiding stretching of window intervals may be the reason for the regression. Also code now uses READ_ONCE/WRITE_ONCE. That may also be hurting performance to some extent. Some events stats before and after applying the patch. perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 14,285,708 13,818,546 migrations 1,180,621 1,149,960 faults 339,114 385,583 cache-misses 55,205,631,894 55,259,546,768 sched:sched_move_numa 843 2,257 sched:sched_stick_numa 6 9 sched:sched_swap_numa 219 512 migrate:mm_migrate_pages 365 2,225 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 26907 72692 numa_hint_faults_local 24279 62270 numa_hit 239771 238762 numa_huge_pte_updates 0 48 numa_interleave 68 75 numa_local 239688 238676 numa_other 83 86 numa_pages_migrated 363 2225 numa_pte_updates 27415 98557 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 3,202,779 3,173,490 migrations 37,186 36,966 faults 106,076 108,776 cache-misses 12,024,873,744 12,200,075,320 sched:sched_move_numa 931 1,264 sched:sched_stick_numa 0 0 sched:sched_swap_numa 1 0 migrate:mm_migrate_pages 637 899 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 17409 21109 numa_hint_faults_local 14367 17120 numa_hit 73953 72934 numa_huge_pte_updates 20 42 numa_interleave 25 33 numa_local 73892 72866 numa_other 61 68 numa_pages_migrated 668 915 numa_pte_updates 27276 42326 perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 8,474,013 8,312,022 migrations 254,934 231,705 faults 320,506 310,242 cache-misses 110,580,458 402,324,573 sched:sched_move_numa 725 193 sched:sched_stick_numa 0 0 sched:sched_swap_numa 7 3 migrate:mm_migrate_pages 145 93 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 22797 11838 numa_hint_faults_local 21539 11216 numa_hit 89308 90689 numa_huge_pte_updates 0 0 numa_interleave 865 1579 numa_local 88955 89634 numa_other 353 1055 numa_pages_migrated 149 92 numa_pte_updates 22930 12109 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 2,195,628 2,170,481 migrations 11,179 10,126 faults 149,656 160,962 cache-misses 8,117,515 10,834,845 sched:sched_move_numa 49 10 sched:sched_stick_numa 0 0 sched:sched_swap_numa 0 0 migrate:mm_migrate_pages 5 2 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 3577 403 numa_hint_faults_local 3476 358 numa_hit 26142 25898 numa_huge_pte_updates 0 0 numa_interleave 358 207 numa_local 26042 25860 numa_other 100 38 numa_pages_migrated 5 2 numa_pte_updates 3587 400 perf stats 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 100,602,296 110,339,633 migrations 4,135,630 4,139,812 faults 789,256 863,622 cache-misses 226,160,621,058 231,838,045,660 sched:sched_move_numa 1,366 2,196 sched:sched_stick_numa 16 33 sched:sched_swap_numa 374 544 migrate:mm_migrate_pages 1,350 2,469 vmstat 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 47857 85748 numa_hint_faults_local 39768 66831 numa_hit 240165 242213 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 240165 242211 numa_other 0 2 numa_pages_migrated 1224 2376 numa_pte_updates 48354 86233 perf stats 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 58,515,496 59,331,057 migrations 564,845 552,019 faults 245,807 266,586 cache-misses 73,603,757,976 73,796,312,990 sched:sched_move_numa 996 981 sched:sched_stick_numa 10 54 sched:sched_swap_numa 193 286 migrate:mm_migrate_pages 646 713 vmstat 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 13422 14807 numa_hint_faults_local 5619 5738 numa_hit 36118 36230 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 36116 36228 numa_other 2 2 numa_pages_migrated 616 703 numa_pte_updates 13374 14742 Suggested-by: Peter Zijlstra Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Cc: Jirka Hladky Cc: Linus Torvalds Cc: Mel Gorman Cc: Mike Galbraith Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1537552141-27815-6-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 05cbdf4f5c191ff378c47bbf66d7230beb725bdb Author: Mel Gorman Date: Fri Sep 21 23:18:59 2018 +0530 sched/numa: Limit the conditions where scan period is reset migrate_task_rq_fair() resets the scan rate for NUMA balancing on every cross-node migration. In the event of excessive load balancing due to saturation, this may result in the scan rate being pegged at maximum and further overloading the machine. This patch only resets the scan if NUMA balancing is active, a preferred node has been selected and the task is being migrated from the preferred node as these are the most harmful. For example, a migration to the preferred node does not justify a faster scan rate. Similarly, a migration between two nodes that are not preferred is probably bouncing due to over-saturation of the machine. In that case, scanning faster and trapping more NUMA faults will further overload the machine. Specjbb2005 results (8 warehouses) Higher bops are better 2 Socket - 2 Node Haswell - X86 JVMS Prev Current %Change 4 203370 205332 0.964744 1 328431 319785 -2.63252 2 Socket - 4 Node Power8 - PowerNV JVMS Prev Current %Change 1 206070 206585 0.249915 2 Socket - 2 Node Power9 - PowerNV JVMS Prev Current %Change 4 188386 189162 0.41192 1 201566 213760 6.04963 4 Socket - 4 Node Power7 - PowerVM JVMS Prev Current %Change 8 59157.4 58736.8 -0.710985 1 105495 105419 -0.0720413 Some events stats before and after applying the patch. perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 13,825,492 14,285,708 migrations 1,152,509 1,180,621 faults 371,948 339,114 cache-misses 55,654,206,041 55,205,631,894 sched:sched_move_numa 1,856 843 sched:sched_stick_numa 4 6 sched:sched_swap_numa 428 219 migrate:mm_migrate_pages 898 365 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 57146 26907 numa_hint_faults_local 51612 24279 numa_hit 238164 239771 numa_huge_pte_updates 16 0 numa_interleave 63 68 numa_local 238085 239688 numa_other 79 83 numa_pages_migrated 883 363 numa_pte_updates 67540 27415 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 3,288,525 3,202,779 migrations 38,652 37,186 faults 111,678 106,076 cache-misses 12,111,197,376 12,024,873,744 sched:sched_move_numa 900 931 sched:sched_stick_numa 0 0 sched:sched_swap_numa 5 1 migrate:mm_migrate_pages 714 637 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 18572 17409 numa_hint_faults_local 14850 14367 numa_hit 73197 73953 numa_huge_pte_updates 11 20 numa_interleave 25 25 numa_local 73138 73892 numa_other 59 61 numa_pages_migrated 712 668 numa_pte_updates 24021 27276 perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 8,451,543 8,474,013 migrations 202,804 254,934 faults 310,024 320,506 cache-misses 253,522,507 110,580,458 sched:sched_move_numa 213 725 sched:sched_stick_numa 0 0 sched:sched_swap_numa 2 7 migrate:mm_migrate_pages 88 145 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 11830 22797 numa_hint_faults_local 11301 21539 numa_hit 90038 89308 numa_huge_pte_updates 0 0 numa_interleave 855 865 numa_local 89796 88955 numa_other 242 353 numa_pages_migrated 88 149 numa_pte_updates 12039 22930 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 2,049,153 2,195,628 migrations 11,405 11,179 faults 162,309 149,656 cache-misses 7,203,343 8,117,515 sched:sched_move_numa 22 49 sched:sched_stick_numa 0 0 sched:sched_swap_numa 0 0 migrate:mm_migrate_pages 1 5 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 1693 3577 numa_hint_faults_local 1669 3476 numa_hit 25177 26142 numa_huge_pte_updates 0 0 numa_interleave 194 358 numa_local 24993 26042 numa_other 184 100 numa_pages_migrated 1 5 numa_pte_updates 1577 3587 perf stats 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 94,515,937 100,602,296 migrations 4,203,554 4,135,630 faults 832,697 789,256 cache-misses 226,248,698,331 226,160,621,058 sched:sched_move_numa 1,730 1,366 sched:sched_stick_numa 14 16 sched:sched_swap_numa 432 374 migrate:mm_migrate_pages 1,398 1,350 vmstat 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 80079 47857 numa_hint_faults_local 68620 39768 numa_hit 241187 240165 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 241186 240165 numa_other 1 0 numa_pages_migrated 1347 1224 numa_pte_updates 80729 48354 perf stats 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 63,704,961 58,515,496 migrations 573,404 564,845 faults 230,878 245,807 cache-misses 76,568,222,781 73,603,757,976 sched:sched_move_numa 509 996 sched:sched_stick_numa 31 10 sched:sched_swap_numa 182 193 migrate:mm_migrate_pages 541 646 vmstat 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 8501 13422 numa_hint_faults_local 2960 5619 numa_hit 35526 36118 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 35526 36116 numa_other 0 2 numa_pages_migrated 539 616 numa_pte_updates 8433 13374 Signed-off-by: Mel Gorman Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Cc: Jirka Hladky Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1537552141-27815-5-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 3f9672baaa70fc62765857f13f007feb01f9ad33 Author: Srikar Dronamraju Date: Fri Sep 21 23:18:58 2018 +0530 sched/numa: Reset scan rate whenever task moves across nodes Currently task scan rate is reset when NUMA balancer migrates the task to a different node. If NUMA balancer initiates a swap, reset is only applicable to the task that initiates the swap. Similarly no scan rate reset is done if the task is migrated across nodes by traditional load balancer. Instead move the scan reset to the migrate_task_rq. This ensures the task moved out of its preferred node, either gets back to its preferred node quickly or finds a new preferred node. Doing so, would be fair to all tasks migrating across nodes. Specjbb2005 results (8 warehouses) Higher bops are better 2 Socket - 2 Node Haswell - X86 JVMS Prev Current %Change 4 200668 203370 1.3465 1 321791 328431 2.06345 2 Socket - 4 Node Power8 - PowerNV JVMS Prev Current %Change 1 204848 206070 0.59654 2 Socket - 2 Node Power9 - PowerNV JVMS Prev Current %Change 4 188098 188386 0.153112 1 200351 201566 0.606436 4 Socket - 4 Node Power7 - PowerVM JVMS Prev Current %Change 8 58145.9 59157.4 1.73959 1 103798 105495 1.63491 Some events stats before and after applying the patch. perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 13,912,183 13,825,492 migrations 1,155,931 1,152,509 faults 367,139 371,948 cache-misses 54,240,196,814 55,654,206,041 sched:sched_move_numa 1,571 1,856 sched:sched_stick_numa 9 4 sched:sched_swap_numa 463 428 migrate:mm_migrate_pages 703 898 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 50155 57146 numa_hint_faults_local 45264 51612 numa_hit 239652 238164 numa_huge_pte_updates 36 16 numa_interleave 68 63 numa_local 239576 238085 numa_other 76 79 numa_pages_migrated 680 883 numa_pte_updates 71146 67540 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 3,156,720 3,288,525 migrations 30,354 38,652 faults 97,261 111,678 cache-misses 12,400,026,826 12,111,197,376 sched:sched_move_numa 4 900 sched:sched_stick_numa 0 0 sched:sched_swap_numa 1 5 migrate:mm_migrate_pages 20 714 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 272 18572 numa_hint_faults_local 186 14850 numa_hit 71362 73197 numa_huge_pte_updates 0 11 numa_interleave 23 25 numa_local 71299 73138 numa_other 63 59 numa_pages_migrated 2 712 numa_pte_updates 0 24021 perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 8,606,824 8,451,543 migrations 155,352 202,804 faults 301,409 310,024 cache-misses 157,759,224 253,522,507 sched:sched_move_numa 168 213 sched:sched_stick_numa 0 0 sched:sched_swap_numa 3 2 migrate:mm_migrate_pages 125 88 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 4650 11830 numa_hint_faults_local 3946 11301 numa_hit 90489 90038 numa_huge_pte_updates 0 0 numa_interleave 892 855 numa_local 90034 89796 numa_other 455 242 numa_pages_migrated 124 88 numa_pte_updates 4818 12039 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 2,113,167 2,049,153 migrations 10,533 11,405 faults 142,727 162,309 cache-misses 5,594,192 7,203,343 sched:sched_move_numa 10 22 sched:sched_stick_numa 0 0 sched:sched_swap_numa 0 0 migrate:mm_migrate_pages 6 1 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 744 1693 numa_hint_faults_local 584 1669 numa_hit 25551 25177 numa_huge_pte_updates 0 0 numa_interleave 263 194 numa_local 25302 24993 numa_other 249 184 numa_pages_migrated 6 1 numa_pte_updates 744 1577 perf stats 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 101,227,352 94,515,937 migrations 4,151,829 4,203,554 faults 745,233 832,697 cache-misses 224,669,561,766 226,248,698,331 sched:sched_move_numa 617 1,730 sched:sched_stick_numa 2 14 sched:sched_swap_numa 187 432 migrate:mm_migrate_pages 316 1,398 vmstat 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 24195 80079 numa_hint_faults_local 21639 68620 numa_hit 238331 241187 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 238331 241186 numa_other 0 1 numa_pages_migrated 204 1347 numa_pte_updates 24561 80729 perf stats 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 62,738,978 63,704,961 migrations 562,702 573,404 faults 228,465 230,878 cache-misses 75,778,067,952 76,568,222,781 sched:sched_move_numa 648 509 sched:sched_stick_numa 13 31 sched:sched_swap_numa 137 182 migrate:mm_migrate_pages 733 541 vmstat 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 10281 8501 numa_hint_faults_local 3242 2960 numa_hit 36338 35526 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 36338 35526 numa_other 0 0 numa_pages_migrated 706 539 numa_pte_updates 10176 8433 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Cc: Jirka Hladky Cc: Linus Torvalds Cc: Mel Gorman Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1537552141-27815-4-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 1327237a5978b00bcc665c33046c9bae75da1154 Author: Srikar Dronamraju Date: Fri Sep 21 23:18:57 2018 +0530 sched/numa: Pass destination CPU as a parameter to migrate_task_rq This additional parameter (new_cpu) is used later for identifying if task migration is across nodes. No functional change. Specjbb2005 results (8 warehouses) Higher bops are better 2 Socket - 2 Node Haswell - X86 JVMS Prev Current %Change 4 203353 200668 -1.32036 1 328205 321791 -1.95427 2 Socket - 4 Node Power8 - PowerNV JVMS Prev Current %Change 1 214384 204848 -4.44809 2 Socket - 2 Node Power9 - PowerNV JVMS Prev Current %Change 4 188553 188098 -0.241311 1 196273 200351 2.07772 4 Socket - 4 Node Power7 - PowerVM JVMS Prev Current %Change 8 57581.2 58145.9 0.980702 1 103468 103798 0.318939 Brings out the variance between different specjbb2005 runs. Some events stats before and after applying the patch. perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 13,941,377 13,912,183 migrations 1,157,323 1,155,931 faults 382,175 367,139 cache-misses 54,993,823,500 54,240,196,814 sched:sched_move_numa 2,005 1,571 sched:sched_stick_numa 14 9 sched:sched_swap_numa 529 463 migrate:mm_migrate_pages 1,573 703 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 67099 50155 numa_hint_faults_local 58456 45264 numa_hit 240416 239652 numa_huge_pte_updates 18 36 numa_interleave 65 68 numa_local 240339 239576 numa_other 77 76 numa_pages_migrated 1574 680 numa_pte_updates 77182 71146 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 3,176,453 3,156,720 migrations 30,238 30,354 faults 87,869 97,261 cache-misses 12,544,479,391 12,400,026,826 sched:sched_move_numa 23 4 sched:sched_stick_numa 0 0 sched:sched_swap_numa 6 1 migrate:mm_migrate_pages 10 20 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 236 272 numa_hint_faults_local 201 186 numa_hit 72293 71362 numa_huge_pte_updates 0 0 numa_interleave 26 23 numa_local 72233 71299 numa_other 60 63 numa_pages_migrated 8 2 numa_pte_updates 0 0 perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 8,478,820 8,606,824 migrations 171,323 155,352 faults 307,499 301,409 cache-misses 240,353,599 157,759,224 sched:sched_move_numa 214 168 sched:sched_stick_numa 0 0 sched:sched_swap_numa 4 3 migrate:mm_migrate_pages 89 125 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 5301 4650 numa_hint_faults_local 4745 3946 numa_hit 92943 90489 numa_huge_pte_updates 0 0 numa_interleave 899 892 numa_local 92345 90034 numa_other 598 455 numa_pages_migrated 88 124 numa_pte_updates 5505 4818 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 2,066,172 2,113,167 migrations 11,076 10,533 faults 149,544 142,727 cache-misses 10,398,067 5,594,192 sched:sched_move_numa 43 10 sched:sched_stick_numa 0 0 sched:sched_swap_numa 0 0 migrate:mm_migrate_pages 6 6 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 3552 744 numa_hint_faults_local 3347 584 numa_hit 25611 25551 numa_huge_pte_updates 0 0 numa_interleave 213 263 numa_local 25583 25302 numa_other 28 249 numa_pages_migrated 6 6 numa_pte_updates 3535 744 perf stats 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 99,358,136 101,227,352 migrations 4,041,607 4,151,829 faults 749,653 745,233 cache-misses 225,562,543,251 224,669,561,766 sched:sched_move_numa 771 617 sched:sched_stick_numa 14 2 sched:sched_swap_numa 204 187 migrate:mm_migrate_pages 1,180 316 vmstat 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 27409 24195 numa_hint_faults_local 20677 21639 numa_hit 239988 238331 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 239983 238331 numa_other 5 0 numa_pages_migrated 1016 204 numa_pte_updates 27916 24561 perf stats 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 60,899,307 62,738,978 migrations 544,668 562,702 faults 270,834 228,465 cache-misses 74,543,455,635 75,778,067,952 sched:sched_move_numa 735 648 sched:sched_stick_numa 25 13 sched:sched_swap_numa 174 137 migrate:mm_migrate_pages 816 733 vmstat 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 11059 10281 numa_hint_faults_local 4733 3242 numa_hit 41384 36338 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 41383 36338 numa_other 1 0 numa_pages_migrated 815 706 numa_pte_updates 11323 10176 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Cc: Jirka Hladky Cc: Linus Torvalds Cc: Mel Gorman Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1537552141-27815-3-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit a4739eca4456e3d140cc656c5331d42b7465f91d Author: Srikar Dronamraju Date: Fri Sep 21 23:18:56 2018 +0530 sched/numa: Stop multiple tasks from moving to the CPU at the same time Task migration under NUMA balancing can happen in parallel. More than one task might choose to migrate to the same CPU at the same time. This can result in: - During task swap, choosing a task that was not part of the evaluation. - During task swap, task which just got moved into its preferred node, moving to a completely different node. - During task swap, task failing to move to the preferred node, will have to wait an extra interval for the next migrate opportunity. - During task movement, multiple task movements can cause load imbalance. This problem is more likely if there are more cores per node or more nodes in the system. Use a per run-queue variable to check if NUMA-balance is active on the run-queue. Specjbb2005 results (8 warehouses) Higher bops are better 2 Socket - 2 Node Haswell - X86 JVMS Prev Current %Change 4 200194 203353 1.57797 1 311331 328205 5.41995 2 Socket - 4 Node Power8 - PowerNV JVMS Prev Current %Change 1 197654 214384 8.46429 2 Socket - 2 Node Power9 - PowerNV JVMS Prev Current %Change 4 192605 188553 -2.10379 1 213402 196273 -8.02664 4 Socket - 4 Node Power7 - PowerVM JVMS Prev Current %Change 8 52227.1 57581.2 10.2516 1 102529 103468 0.915838 There is a regression on power 9 box. If we look at the details, that box has a sudden jump in cache-misses with this patch. All other parameters seem to be pointing towards NUMA consolidation. perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 13,345,784 13,941,377 migrations 1,127,820 1,157,323 faults 374,736 382,175 cache-misses 55,132,054,603 54,993,823,500 sched:sched_move_numa 1,923 2,005 sched:sched_stick_numa 52 14 sched:sched_swap_numa 595 529 migrate:mm_migrate_pages 1,932 1,573 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 60605 67099 numa_hint_faults_local 51804 58456 numa_hit 239945 240416 numa_huge_pte_updates 14 18 numa_interleave 60 65 numa_local 239865 240339 numa_other 80 77 numa_pages_migrated 1931 1574 numa_pte_updates 67823 77182 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After cs 3,016,467 3,176,453 migrations 37,326 30,238 faults 115,342 87,869 cache-misses 11,692,155,554 12,544,479,391 sched:sched_move_numa 965 23 sched:sched_stick_numa 8 0 sched:sched_swap_numa 35 6 migrate:mm_migrate_pages 1,168 10 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Haswell - X86 Event Before After numa_hint_faults 16286 236 numa_hint_faults_local 11863 201 numa_hit 112482 72293 numa_huge_pte_updates 33 0 numa_interleave 20 26 numa_local 112419 72233 numa_other 63 60 numa_pages_migrated 1144 8 numa_pte_updates 32859 0 perf stats 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 8,629,724 8,478,820 migrations 221,052 171,323 faults 308,661 307,499 cache-misses 135,574,913 240,353,599 sched:sched_move_numa 147 214 sched:sched_stick_numa 0 0 sched:sched_swap_numa 2 4 migrate:mm_migrate_pages 64 89 vmstat 8th warehouse Multi JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 11481 5301 numa_hint_faults_local 10968 4745 numa_hit 89773 92943 numa_huge_pte_updates 0 0 numa_interleave 1116 899 numa_local 89220 92345 numa_other 553 598 numa_pages_migrated 62 88 numa_pte_updates 11694 5505 perf stats 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After cs 2,272,887 2,066,172 migrations 12,206 11,076 faults 163,704 149,544 cache-misses 4,801,186 10,398,067 sched:sched_move_numa 44 43 sched:sched_stick_numa 0 0 sched:sched_swap_numa 0 0 migrate:mm_migrate_pages 17 6 vmstat 8th warehouse Single JVM 2 Socket - 2 Node Power9 - PowerNV Event Before After numa_hint_faults 2261 3552 numa_hint_faults_local 1993 3347 numa_hit 25726 25611 numa_huge_pte_updates 0 0 numa_interleave 239 213 numa_local 25498 25583 numa_other 228 28 numa_pages_migrated 17 6 numa_pte_updates 2266 3535 perf stats 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 117,980,962 99,358,136 migrations 3,950,220 4,041,607 faults 736,979 749,653 cache-misses 224,976,072,879 225,562,543,251 sched:sched_move_numa 504 771 sched:sched_stick_numa 50 14 sched:sched_swap_numa 239 204 migrate:mm_migrate_pages 1,260 1,180 vmstat 8th warehouse Multi JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 18293 27409 numa_hint_faults_local 11969 20677 numa_hit 240854 239988 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 240851 239983 numa_other 3 5 numa_pages_migrated 1190 1016 numa_pte_updates 18106 27916 perf stats 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After cs 61,053,158 60,899,307 migrations 551,586 544,668 faults 244,174 270,834 cache-misses 74,326,766,973 74,543,455,635 sched:sched_move_numa 344 735 sched:sched_stick_numa 24 25 sched:sched_swap_numa 140 174 migrate:mm_migrate_pages 568 816 vmstat 8th warehouse Single JVM 4 Socket - 4 Node Power7 - PowerVM Event Before After numa_hint_faults 6461 11059 numa_hint_faults_local 2283 4733 numa_hit 35661 41384 numa_huge_pte_updates 0 0 numa_interleave 0 0 numa_local 35661 41383 numa_other 0 1 numa_pages_migrated 568 815 numa_pte_updates 6518 11323 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rik van Riel Acked-by: Mel Gorman Cc: Jirka Hladky Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1537552141-27815-2-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit d7cbbe49a9304520181fb8c9272d1327deec8453 Author: Natarajan, Janakarajan Date: Thu Sep 27 15:51:55 2018 +0000 perf/x86/amd/uncore: Set ThreadMask and SliceMask for L3 Cache perf events In Family 17h, some L3 Cache Performance events require the ThreadMask and SliceMask to be set. For other events, these fields do not affect the count either way. Set ThreadMask and SliceMask to 0xFF and 0xF respectively. Signed-off-by: Janakarajan Natarajan Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Borislav Petkov Cc: H . Peter Anvin Cc: Jiri Olsa Cc: Linus Torvalds Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Suravee Cc: Thomas Gleixner Cc: Vince Weaver Link: http://lkml.kernel.org/r/Message-ID: Signed-off-by: Ingo Molnar commit 9d92cfeaf5215158d26d2991be7f7ff865cb98f3 Author: Kan Liang Date: Fri Sep 21 07:07:06 2018 -0700 perf/x86/intel/uncore: Fix PCI BDF address of M3UPI on SKX The counters on M3UPI Link 0 and Link 3 don't count properly, and writing 0 to these counters may causes system crash on some machines. The PCI BDF addresses of the M3UPI in the current code are incorrect. The correct addresses should be: D18:F1 0x204D D18:F2 0x204E D18:F5 0x204D Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Fixes: cd34cd97b7b4 ("perf/x86/intel/uncore: Add Skylake server uncore support") Link: http://lkml.kernel.org/r/1537538826-55489-1-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar commit cd6fb677ce7e460c25bdd66f689734102ec7d642 Author: Jiri Olsa Date: Sun Sep 23 18:13:43 2018 +0200 perf/ring_buffer: Prevent concurent ring buffer access Some of the scheduling tracepoints allow the perf_tp_event code to write to ring buffer under different cpu than the code is running on. This results in corrupted ring buffer data demonstrated in following perf commands: # perf record -e 'sched:sched_switch,sched:sched_wakeup' perf bench sched messaging # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.383 [sec] [ perf record: Woken up 8 times to write data ] 0x42b890 [0]: failed to process type: -1765585640 [ perf record: Captured and wrote 4.825 MB perf.data (29669 samples) ] # perf report --stdio 0x42b890 [0]: failed to process type: -1765585640 The reason for the corruption are some of the scheduling tracepoints, that have __perf_task dfined and thus allow to store data to another cpu ring buffer: sched_waking sched_wakeup sched_wakeup_new sched_stat_wait sched_stat_sleep sched_stat_iowait sched_stat_blocked The perf_tp_event function first store samples for current cpu related events defined for tracepoint: hlist_for_each_entry_rcu(event, head, hlist_entry) perf_swevent_event(event, count, &data, regs); And then iterates events of the 'task' and store the sample for any task's event that passes tracepoint checks: ctx = rcu_dereference(task->perf_event_ctxp[perf_sw_context]); list_for_each_entry_rcu(event, &ctx->event_list, event_entry) { if (event->attr.type != PERF_TYPE_TRACEPOINT) continue; if (event->attr.config != entry->type) continue; perf_swevent_event(event, count, &data, regs); } Above code can race with same code running on another cpu, ending up with 2 cpus trying to store under the same ring buffer, which is specifically not allowed. This patch prevents the problem, by allowing only events with the same current cpu to receive the event. NOTE: this requires the use of (per-task-)per-cpu buffers for this feature to work; perf-record does this. Signed-off-by: Jiri Olsa [peterz: small edits to Changelog] Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Andrew Vagin Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Fixes: e6dab5ffab59 ("perf/trace: Add ability to set a target task for events") Link: http://lkml.kernel.org/r/20180923161343.GB15054@krava Signed-off-by: Ingo Molnar commit 6265adb9726098b7f4f7ca70bc51992b25fdd9d6 Author: Masayoshi Mizuma Date: Mon Sep 10 10:47:50 2018 -0400 perf/x86/intel/uncore: Use boot_cpu_data.phys_proc_id instead of hardcorded physical package ID 0 Physical package id 0 doesn't always exist, we should use boot_cpu_data.phys_proc_id here. Signed-off-by: Masayoshi Mizuma Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Linus Torvalds Cc: Masayoshi Mizuma Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Link: http://lkml.kernel.org/r/20180910144750.6782-1-msys.mizuma@gmail.com Signed-off-by: Ingo Molnar commit a9f9772114c8b07ae75bcb3654bd017461248095 Author: Peter Zijlstra Date: Tue Sep 25 17:58:35 2018 +0200 perf/core: Fix perf_pmu_unregister() locking When we unregister a PMU, we fail to serialize the @pmu_idr properly. Fix that by doing the entire thing under pmu_lock. Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Fixes: 2e80a82a49c4 ("perf: Dynamic pmu types") Signed-off-by: Ingo Molnar commit 7c03e7035ac1cf2a6165754e4f3a49c2f1977838 Author: Andy Lutomirski Date: Mon Oct 1 12:52:16 2018 -0700 selftests/x86: Add clock_gettime() tests to test_vdso Now that the vDSO implementation of clock_gettime() is getting reworked, add a selftest for it. This tests that its output is consistent with the syscall version. This is marked for stable to serve as a test for commit 715bd9d12f84 ("x86/vdso: Fix asm constraints on vDSO syscall fallbacks") Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/082399674de2619b2befd8c0dde49b260605b126.1538422295.git.luto@kernel.org commit ad5f97faff4231e72b96bd96adbe1b6e977a9b86 Author: Heiner Kallweit Date: Fri Sep 28 23:51:54 2018 +0200 r8169: fix network stalls due to missing bit TXCFG_AUTO_FIFO Some of the chip-specific hw_start functions set bit TXCFG_AUTO_FIFO in register TxConfig. The original patch changed the order of some calls resulting in these changes being overwritten by rtl_set_tx_config_registers() in rtl_hw_start(). This eventually resulted in network stalls especially under high load. Analyzing the chip-specific hw_start functions all chip version from 34, with the exception of version 39, need this bit set. This patch moves setting this bit to rtl_set_tx_config_registers(). Fixes: 4fd48c4ac0a0 ("r8169: move common initializations to tp->hw_start") Reported-by: Ortwin Glück Reported-by: David Arendt Root-caused-by: Maciej S. Szmigiero Tested-by: Tony Atkinson Tested-by: David Arendt Tested-by: Ortwin Glück Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 715bd9d12f84d8f5cc8ad21d888f9bc304a8eb0b Author: Andy Lutomirski Date: Mon Oct 1 12:52:15 2018 -0700 x86/vdso: Fix asm constraints on vDSO syscall fallbacks The syscall fallbacks in the vDSO have incorrect asm constraints. They are not marked as writing to their outputs -- instead, they are marked as clobbering "memory", which is useless. In particular, gcc is smart enough to know that the timespec parameter hasn't escaped, so a memory clobber doesn't clobber it. And passing a pointer as an asm *input* does not tell gcc that the pointed-to value is changed. Add in the fact that the asm instructions weren't volatile, and gcc was free to omit them entirely unless their sole output (the return value) is used. Which it is (phew!), but that stops happening with some upcoming patches. As a trivial example, the following code: void test_fallback(struct timespec *ts) { vdso_fallback_gettime(CLOCK_MONOTONIC, ts); } compiles to: 00000000000000c0 : c0: c3 retq To add insult to injury, the RCX and R11 clobbers on 64-bit builds were missing. The "memory" clobber is also unnecessary -- no ordering with respect to other memory operations is needed, but that's going to be fixed in a separate not-for-stable patch. Fixes: 2aae950b21e4 ("x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu") Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/2c0231690551989d2fafa60ed0e7b5cc8b403908.1538422295.git.luto@kernel.org commit 2547496eb18c60f2be9663f71913dfbf703dcbe1 Merge: 6fe9487892b3 af3fb24eecb2 Author: David S. Miller Date: Mon Oct 1 23:27:28 2018 -0700 Merge branch 'tun-races' Eric Dumazet says: ==================== tun: address two syzbot reports Small changes addressing races discovered by syzbot. First patch is a cleanup. Second patch moves a mutex init sooner. Third patch makes sure each tfile gets its own napi enable flags. ==================== Signed-off-by: David S. Miller commit af3fb24eecb2c59246e03c99386037fd5ad84ffd Author: Eric Dumazet Date: Fri Sep 28 14:51:49 2018 -0700 tun: napi flags belong to tfile Since tun->flags might be shared by multiple tfile structures, it is better to make sure tun_get_user() is using the flags for the current tfile. Presence of the READ_ONCE() in tun_napi_frags_enabled() gave a hint of what could happen, but we need something stronger to please syzbot. kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 13647 Comm: syz-executor5 Not tainted 4.19.0-rc5+ #59 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:dev_gro_receive+0x132/0x2720 net/core/dev.c:5427 Code: 48 c1 ea 03 80 3c 02 00 0f 85 6e 20 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 6e 10 49 8d bd d0 00 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 59 20 00 00 4d 8b a5 d0 00 00 00 31 ff 41 81 e4 RSP: 0018:ffff8801c400f410 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8618d325 RDX: 000000000000001a RSI: ffffffff86189f97 RDI: 00000000000000d0 RBP: ffff8801c400f608 R08: ffff8801c8fb4300 R09: 0000000000000000 R10: ffffed0038801ed7 R11: 0000000000000003 R12: ffff8801d327d358 R13: 0000000000000000 R14: ffff8801c16dd8c0 R15: 0000000000000004 FS: 00007fe003615700(0000) GS:ffff8801dac00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe1f3c43db8 CR3: 00000001bebb2000 CR4: 00000000001406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: napi_gro_frags+0x3f4/0xc90 net/core/dev.c:5715 tun_get_user+0x31d5/0x42a0 drivers/net/tun.c:1922 tun_chr_write_iter+0xb9/0x154 drivers/net/tun.c:1967 call_write_iter include/linux/fs.h:1808 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457579 Code: 1d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 eb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fe003614c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457579 RDX: 0000000000000012 RSI: 0000000020000000 RDI: 000000000000000a RBP: 000000000072c040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe0036156d4 R13: 00000000004c5574 R14: 00000000004d8e98 R15: 00000000ffffffff Modules linked in: RIP: 0010:dev_gro_receive+0x132/0x2720 net/core/dev.c:5427 Code: 48 c1 ea 03 80 3c 02 00 0f 85 6e 20 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 6e 10 49 8d bd d0 00 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 59 20 00 00 4d 8b a5 d0 00 00 00 31 ff 41 81 e4 RSP: 0018:ffff8801c400f410 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8618d325 RDX: 000000000000001a RSI: ffffffff86189f97 RDI: 00000000000000d0 RBP: ffff8801c400f608 R08: ffff8801c8fb4300 R09: 0000000000000000 R10: ffffed0038801ed7 R11: 0000000000000003 R12: ffff8801d327d358 R13: 0000000000000000 R14: ffff8801c16dd8c0 R15: 0000000000000004 FS: 00007fe003615700(0000) GS:ffff8801dac00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe1f3c43db8 CR3: 00000001bebb2000 CR4: 00000000001406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit c7256f579f8302ce2c038181c30060d0b40017b2 Author: Eric Dumazet Date: Fri Sep 28 14:51:48 2018 -0700 tun: initialize napi_mutex unconditionally This is the first part to fix following syzbot report : console output: https://syzkaller.appspot.com/x/log.txt?x=145378e6400000 kernel config: https://syzkaller.appspot.com/x/.config?x=443816db871edd66 dashboard link: https://syzkaller.appspot.com/bug?extid=e662df0ac1d753b57e80 Following patch is fixing the race condition, but it seems safer to initialize this mutex at tfile creation anyway. Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver") Signed-off-by: Eric Dumazet Reported-by: syzbot+e662df0ac1d753b57e80@syzkaller.appspotmail.com Signed-off-by: David S. Miller commit 06e55addd3f40b5294e448c2cb7605ca4f28c2e3 Author: Eric Dumazet Date: Fri Sep 28 14:51:47 2018 -0700 tun: remove unused parameters tun_napi_disable() and tun_napi_del() do not need a pointer to the tun_struct Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 6fe9487892b32cb1c8b8b0d552ed7222a527fe30 Author: Dave Jones Date: Fri Sep 28 16:26:08 2018 -0400 bond: take rcu lock in netpoll_send_skb_on_dev The bonding driver lacks the rcu lock when it calls down into netdev_lower_get_next_private_rcu from bond_poll_controller, which results in a trace like: WARNING: CPU: 2 PID: 179 at net/core/dev.c:6567 netdev_lower_get_next_private_rcu+0x34/0x40 CPU: 2 PID: 179 Comm: kworker/u16:15 Not tainted 4.19.0-rc5-backup+ #1 Workqueue: bond0 bond_mii_monitor RIP: 0010:netdev_lower_get_next_private_rcu+0x34/0x40 Code: 48 89 fb e8 fe 29 63 ff 85 c0 74 1e 48 8b 45 00 48 81 c3 c0 00 00 00 48 8b 00 48 39 d8 74 0f 48 89 45 00 48 8b 40 f8 5b 5d c3 <0f> 0b eb de 31 c0 eb f5 0f 1f 40 00 0f 1f 44 00 00 48 8> RSP: 0018:ffffc9000087fa68 EFLAGS: 00010046 RAX: 0000000000000000 RBX: ffff880429614560 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 00000000ffffffff RDI: ffffffffa184ada0 RBP: ffffc9000087fa80 R08: 0000000000000001 R09: 0000000000000000 R10: ffffc9000087f9f0 R11: ffff880429798040 R12: ffff8804289d5980 R13: ffffffffa1511f60 R14: 00000000000000c8 R15: 00000000ffffffff FS: 0000000000000000(0000) GS:ffff88042f880000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f4b78fce180 CR3: 000000018180f006 CR4: 00000000001606e0 Call Trace: bond_poll_controller+0x52/0x170 netpoll_poll_dev+0x79/0x290 netpoll_send_skb_on_dev+0x158/0x2c0 netpoll_send_udp+0x2d5/0x430 write_ext_msg+0x1e0/0x210 console_unlock+0x3c4/0x630 vprintk_emit+0xfa/0x2f0 printk+0x52/0x6e ? __netdev_printk+0x12b/0x220 netdev_info+0x64/0x80 ? bond_3ad_set_carrier+0xe9/0x180 bond_select_active_slave+0x1fc/0x310 bond_mii_monitor+0x709/0x9b0 process_one_work+0x221/0x5e0 worker_thread+0x4f/0x3b0 kthread+0x100/0x140 ? process_one_work+0x5e0/0x5e0 ? kthread_delayed_work_timer_fn+0x90/0x90 ret_from_fork+0x24/0x30 We're also doing rcu dereferences a layer up in netpoll_send_skb_on_dev before we call down into netpoll_poll_dev, so just take the lock there. Suggested-by: Cong Wang Signed-off-by: Dave Jones Signed-off-by: David S. Miller commit 893626d6a353d1356528f94e081246ecf233d77a Author: David Ahern Date: Fri Sep 28 12:28:41 2018 -0700 rtnetlink: Fail dump if target netnsid is invalid Link dumps can return results from a target namespace. If the namespace id is invalid, then the dump request should fail if get_target_net fails rather than continuing with a dump of the current namespace. Fixes: 79e1ad148c844 ("rtnetlink: use netnsid to query interface") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 7f6d6558ae44bc193eb28df3617c364d3bb6df39 Author: Flavio Leitner Date: Fri Sep 28 14:55:34 2018 -0300 Revert "openvswitch: Fix template leak in error cases." This reverts commit 90c7afc96cbbd77f44094b5b651261968e97de67. When the commit was merged, the code used nf_ct_put() to free the entry, but later on commit 76644232e612 ("openvswitch: Free tmpl with tmpl_free.") replaced that with nf_ct_tmpl_free which is a more appropriate. Now the original problem is removed. Then 44d6e2f27328 ("net: Replace NF_CT_ASSERT() with WARN_ON().") replaced a debug assert with a WARN_ON() which is trigged now. Signed-off-by: Flavio Leitner Acked-by: Joe Stringer Signed-off-by: David S. Miller commit 4da402597c2b75c4b636ab2416baf921b363b325 Author: Li RongQing Date: Sun Sep 30 15:06:06 2018 +0800 xfrm: fix gro_cells leak when remove virtual xfrm interfaces The device gro_cells has been initialized, it should be freed, otherwise it will be leaked Fixes: f203b76d78092faf2 ("xfrm: Add virtual xfrm interfaces") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing Signed-off-by: Steffen Klassert commit 92d7c74b6f72a8a7d04970d5dcfb99673daaf91d Merge: d949cfedbcba cb28c306b93b Author: David S. Miller Date: Mon Oct 1 22:40:39 2018 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Johan Hedberg says: ==================== pull request: bluetooth 2018-09-27 Here's one more Bluetooth fix for 4.19, fixing the handling of an attempt to unpair a device while pairing is in progress. Let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller commit d949cfedbcbab4e91590576cbace2671924ad69c Author: LUU Duc Canh Date: Wed Sep 26 22:28:52 2018 +0200 tipc: ignore STATE_MSG on wrong link session The initial session number when a link is created is based on a random value, taken from struct tipc_net->random. It is then incremented for each link reset to avoid mixing protocol messages from different link sessions. However, when a bearer is reset all its links are deleted, and will later be re-created using the same random value as the first time. This means that if the link never went down between creation and deletion we will still sometimes have two subsequent sessions with the same session number. In virtual environments with potentially long transmission times this has turned out to be a real problem. We now fix this by randomizing the session number each time a link is created. With a session number size of 16 bits this gives a risk of session collision of 1/64k. To reduce this further, we also introduce a sanity check on the very first STATE message arriving at a link. If this has an acknowledge value differing from 0, which is logically impossible, we ignore the message. The final risk for session collision is hence reduced to 1/4G, which should be sufficient. Signed-off-by: LUU Duc Canh Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit aeadd93f2b0a609f603ac33e574b97a9832d1b90 Author: Dan Carpenter Date: Sat Sep 22 16:46:48 2018 +0300 net: sched: act_ipt: check for underflow in __tcf_ipt_init() If "td->u.target_size" is larger than sizeof(struct xt_entry_target) we return -EINVAL. But we don't check whether it's smaller than sizeof(struct xt_entry_target) and that could lead to an out of bounds read. Fixes: 7ba699c604ab ("[NET_SCHED]: Convert actions from rtnetlink to new netlink API") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit ee0b6f4834b59bb0002e2dc8f42a73a399a9246e Merge: 1ad98e9d1bdf 32bf94fb5c2e Author: David S. Miller Date: Mon Oct 1 22:29:25 2018 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2018-10-01 1) Validate address prefix lengths in the xfrm selector, otherwise we may hit undefined behaviour in the address matching functions if the prefix is too big for the given address family. 2) Fix skb leak on local message size errors. From Thadeu Lima de Souza Cascardo. 3) We currently reset the transport header back to the network header after a transport mode transformation is applied. This leads to an incorrect transport header when multiple transport mode transformations are applied. Reset the transport header only after all transformations are already applied to fix this. From Sowmini Varadhan. 4) We only support one offloaded xfrm, so reset crypto_done after the first transformation in xfrm_input(). Otherwise we may call the wrong input method for subsequent transformations. From Sowmini Varadhan. 5) Fix NULL pointer dereference when skb_dst_force clears the dst_entry. skb_dst_force does not really force a dst refcount anymore, it might clear it instead. xfrm code did not expect this, add a check to not dereference skb_dst() if it was cleared by skb_dst_force. 6) Validate xfrm template mode, otherwise we can get a stack-out-of-bounds read in xfrm_state_find. From Sean Tranchetti. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller commit 555df5820e733cded7eb8d0bf78b2a791be51d75 Author: Chunfeng Yun Date: Mon Oct 1 18:36:08 2018 +0300 usb: xhci-mtk: resume USB3 roothub first Give USB3 devices a better chance to enumerate at USB3 speeds if they are connected to a suspended host. Porting from "671ffdff5b13 xhci: resume USB 3 roothub first" Cc: Signed-off-by: Chunfeng Yun Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit ffe84e01bb1b38c7eb9c6b6da127a6c136d251df Author: Mathias Nyman Date: Mon Oct 1 18:36:07 2018 +0300 xhci: Add missing CAS workaround for Intel Sunrise Point xHCI The workaround for missing CAS bit is also needed for xHC on Intel sunrisepoint PCH. For more details see: Intel 100/c230 series PCH specification update Doc #332692-006 Errata #8 Cc: Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit f2924d4b16ae138c2de6a0e73f526fb638330858 Author: Romain Izard Date: Thu Sep 20 16:49:04 2018 +0200 usb: cdc_acm: Do not leak URB buffers When the ACM TTY port is disconnected, the URBs it uses must be killed, and then the buffers must be freed. Unfortunately a previous refactor removed the code freeing the buffers because it looked extremely similar to the code killing the URBs. As a result, there were many new leaks for each plug/unplug cycle of a CDC-ACM device, that were detected by kmemleak. Restore the missing code, and the memory leak is removed. Fixes: ba8c931ded8d ("cdc-acm: refactor killing urbs") Signed-off-by: Romain Izard Acked-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman commit dcb44ac0601e7fcda6d9d9930fd80c7124240146 Merge: 17b57b1883c1 f5fad711c06e Author: Greg Kroah-Hartman Date: Mon Oct 1 17:53:29 2018 -0700 Merge tag 'usb-serial-4.19-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for v4.19-rc7 Here are some device-id patches for 4.19-rc7. Some Quectel modems have a vendor command which can be used to disable certain interfaces in their configurations, but unlike some other modems this also causes the interface numbers to change. These patches allow us to support all such interface permutations at least for the Quectel EP06. All have been in linux-next with no reported issues. Signed-off-by: Johan Hovold * tag 'usb-serial-4.19-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: simple: add Motorola Tetra MTP6550 id USB: serial: option: add two-endpoints device-id flag USB: serial: option: improve Quectel EP06 detection commit 385afbf8c3e8bdf13fc729e8b2c172d1208d97f9 Merge: b62e4255930b 2a3f93459d68 Author: Greg Kroah-Hartman Date: Mon Oct 1 17:24:20 2018 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Will writes: "Late arm64 fixes - Fix handling of young contiguous ptes for hugetlb mappings - Fix livelock when taking access faults on contiguous hugetlb mappings - Tighten up register accesses via KVM SET_ONE_REG ioctl()s" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: KVM: Sanitize PSTATE.M when being set from userspace arm64: KVM: Tighten guest core register access from userspace arm64: hugetlb: Avoid unnecessary clearing in huge_ptep_set_access_flags arm64: hugetlb: Fix handling of young ptes commit b62e4255930bb25505bc400556c799b1b5d53ac1 Merge: ef0f2584c24f 082dc55e3c5e Author: Greg Kroah-Hartman Date: Mon Oct 1 17:23:27 2018 -0700 Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Olof writes: "ARM: SoC fixes A handful of fixes that have been coming in the last couple of weeks: - Freescale fixes for on-chip accellerators - A DT fix for stm32 to avoid fallback to non-DMA SPI mode - Fixes for badly specified interrupts on BCM63xx SoCs - Allwinner A64 HDMI was incorrectly specified as fully compatble with R40 - Drive strength fix for SAMA5D2 NAND pins on one board" * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: dts: stm32: update SPI6 dmas property on stm32mp157c soc: fsl: qe: Fix copy/paste bug in ucc_get_tdm_sync_shift() soc: fsl: qbman: qman: avoid allocating from non existing gen_pool ARM: dts: BCM63xx: Fix incorrect interrupt specifiers MAINTAINERS: update the Annapurna Labs maintainer email ARM: dts: sun8i: drop A64 HDMI PHY fallback compatible from R40 DT ARM: dts: at91: sama5d2_ptc_ek: fix nand pinctrl commit ef0f2584c24f81f7c8e02a023833c313284e7d39 Merge: 17b57b1883c1 bac6f6cda206 Author: Greg Kroah-Hartman Date: Mon Oct 1 17:22:36 2018 -0700 Merge tag 'pstore-v4.19-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Kees writes: "Pstore fixes for v4.19-rc7 - Fix failure-path memory leak in ramoops_init (nixiaoming)" * tag 'pstore-v4.19-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore/ram: Fix failure-path memory leak in ramoops_init commit 684bec1092b6991ff2a7751e8a763898576eb5c2 Author: Daniel Drake Date: Mon Oct 1 15:55:22 2018 -0700 Input: i8042 - enable keyboard wakeups by default when s2idle is used Previously, on typical consumer laptops, pressing a key on the keyboard when the system is in suspend would cause it to wake up (default or unconditional behaviour). This happens because the EC generates a SCI interrupt in this scenario. That is no longer true on modern laptops based on Intel WhiskeyLake, including Acer Swift SF314-55G, Asus UX333FA, Asus UX433FN and Asus UX533FD. We confirmed with Asus EC engineers that the "Modern Standby" design has been modified so that the EC no longer generates a SCI in this case; the keyboard controller itself should be used for wakeup. In order to retain the standard behaviour of being able to use the keyboard to wake up the system, enable serio wakeups by default on platforms that are using s2idle. Link: https://lkml.kernel.org/r/CAB4CAwfQ0mPMqCLp95TVjw4J0r5zKPWkSvvkK4cpZUGE--w8bQ@mail.gmail.com Reviewed-by: Rafael J. Wysocki Signed-off-by: Daniel Drake Signed-off-by: Dmitry Torokhov commit 9735082a7cbae572c2eabdc45acecc8c9fa0759b Author: Ramses Ramírez Date: Fri Sep 28 16:59:26 2018 -0700 Input: xpad - add support for Xbox1 PDP Camo series gamepad The "Xbox One PDP Wired Controller - Camo series" has a different product-id than the regular PDP controller and the PDP stealth series, but it uses the same initialization sequence. This patch adds the product-id of the camo series to the structures that handle the other PDP Xbox One controllers. Signed-off-by: Ramses Ramírez Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit 5a1eb8b9542884592a018829bb1ff20c9695d925 Author: Laurentiu Tudor Date: Wed Sep 26 16:22:31 2018 +0300 soc: fsl: qman_portals: defer probe after qman's probe Defer probe of qman portals after qman probing. This fixes the crash below, seen on NXP LS1043A SoCs: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000004 Mem abort info: ESR = 0x96000004 Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 [0000000000000004] user address but active_mm is swapper Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-rc1-next-20180622-00200-g986f5c179185 #9 Hardware name: LS1043A RDB Board (DT) pstate: 80000005 (Nzcv daif -PAN -UAO) pc : qman_set_sdest+0x74/0xa0 lr : qman_portal_probe+0x22c/0x470 sp : ffff00000803bbc0 x29: ffff00000803bbc0 x28: 0000000000000000 x27: ffff0000090c1b88 x26: ffff00000927cb68 x25: ffff00000927c000 x24: ffff00000927cb60 x23: 0000000000000000 x22: 0000000000000000 x21: ffff0000090e9000 x20: ffff800073b5c810 x19: ffff800027401298 x18: ffffffffffffffff x17: 0000000000000001 x16: 0000000000000000 x15: ffff0000090e96c8 x14: ffff80002740138a x13: ffff0000090f2000 x12: 0000000000000030 x11: ffff000008f25000 x10: 0000000000000000 x9 : ffff80007bdfd2c0 x8 : 0000000000004000 x7 : ffff80007393cc18 x6 : 0040000000000001 x5 : 0000000000000000 x4 : ffffffffffffffff x3 : 0000000000000004 x2 : ffff00000927c900 x1 : 0000000000000000 x0 : 0000000000000004 Process swapper/0 (pid: 1, stack limit = 0x(____ptrval____)) Call trace: qman_set_sdest+0x74/0xa0 platform_drv_probe+0x50/0xa8 driver_probe_device+0x214/0x2f8 __driver_attach+0xd8/0xe0 bus_for_each_dev+0x68/0xc8 driver_attach+0x20/0x28 bus_add_driver+0x108/0x228 driver_register+0x60/0x110 __platform_driver_register+0x40/0x48 qman_portal_driver_init+0x20/0x84 do_one_initcall+0x58/0x168 kernel_init_freeable+0x184/0x22c kernel_init+0x10/0x108 ret_from_fork+0x10/0x18 Code: f9400443 11001000 927e4800 8b000063 (b9400063) ---[ end trace 4f6d50489ecfb930 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b Signed-off-by: Laurentiu Tudor Signed-off-by: Li Yang commit 242cdad873a75652f97c35aad61270581e0f3a2e Author: Joel Stanley Date: Fri Sep 21 12:24:31 2018 +0930 lib/xz: Put CRC32_POLY_LE in xz_private.h This fixes a regression introduced by faa16bc404d72a5 ("lib: Use existing define with polynomial"). The cleanup added a dependency on include/linux, which broke the PowerPC boot wrapper/decompresser when KERNEL_XZ is enabled: BOOTCC arch/powerpc/boot/decompress.o In file included from arch/powerpc/boot/../../../lib/decompress_unxz.c:233, from arch/powerpc/boot/decompress.c:42: arch/powerpc/boot/../../../lib/xz/xz_crc32.c:18:10: fatal error: linux/crc32poly.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~~ The powerpc decompresser is a hairy corner of the kernel. Even while building a 64-bit kernel it needs to build a 32-bit binary and therefore avoid including files from include/linux. This allows users of the xz library to avoid including headers from 'include/linux/' while still achieving the cleanup of the magic number. Fixes: faa16bc404d72a5 ("lib: Use existing define with polynomial") Reported-by: Meelis Roos Reported-by: kbuild test robot Suggested-by: Christophe LEROY Signed-off-by: Joel Stanley Tested-by: Meelis Roos Signed-off-by: Michael Ellerman commit 1ad98e9d1bdf4724c0a8532fabd84bf3c457c2bc Author: Eric Dumazet Date: Mon Oct 1 15:02:26 2018 -0700 tcp/dccp: fix lockdep issue when SYN is backlogged In normal SYN processing, packets are handled without listener lock and in RCU protected ingress path. But syzkaller is known to be able to trick us and SYN packets might be processed in process context, after being queued into socket backlog. In commit 06f877d613be ("tcp/dccp: fix other lockdep splats accessing ireq_opt") I made a very stupid fix, that happened to work mostly because of the regular path being RCU protected. Really the thing protecting ireq->ireq_opt is RCU read lock, and the pseudo request refcnt is not relevant. This patch extends what I did in commit 449809a66c1d ("tcp/dccp: block BH for SYN processing") by adding an extra rcu_read_{lock|unlock} pair in the paths that might be taken when processing SYN from socket backlog (thus possibly in process context) Fixes: 06f877d613be ("tcp/dccp: fix other lockdep splats accessing ireq_opt") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit c8424ddd9715bf1200392a677a8a0e819c99a726 Merge: 43955a45dc0b 40e4f26e6a14 Author: David S. Miller Date: Mon Oct 1 15:41:01 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for your net tree: 1) Skip ip_sabotage_in() for packet making into the VRF driver, otherwise packets are dropped, from David Ahern. 2) Clang compilation warning uncovering typo in the nft_validate_register_store() call from nft_osf, from Stefan Agner. 3) Double sizeof netlink message length calculations in ctnetlink, from zhong jiang. 4) Missing rb_erase() on batch full in rbtree garbage collector, from Taehee Yoo. 5) Calm down compilation warning in nf_hook(), from Florian Westphal. 6) Missing check for non-null sk in xt_socket before validating netns procedence, from Flavio Leitner. ==================== Signed-off-by: David S. Miller commit 02621216e1d8a13abf1d040ff3b7ccf41b2df578 Merge: bded6c03e398 80a6ec7d5e16 Author: Stephen Boyd Date: Mon Oct 1 15:22:25 2018 -0700 Merge tag 'sunxi-clk-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-fixes Pull Allwinner clk fixes for 4.19 from Maxime Ripard: One fix for the Audio PLL that were not properly set and generating noise on the A10 SoCs. * tag 'sunxi-clk-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: sun4i: Set VCO and PLL bias current to lowest setting commit 95375f2ab2960c135484d83ea9f8f357cb1be26a Author: Thomas Petazzoni Date: Mon Oct 1 14:49:34 2018 +0200 PCI: mvebu: Fix PCI I/O mapping creation sequence Commit ee1604381a371 ("PCI: mvebu: Only remap I/O space if configured") had the side effect that the PCI I/O mapping was created much earlier than before, at a point where the probe() of the driver could still fail. This is for example a problem if one gets an -EPROBE_DEFER at some point during probe(), after pci_ioremap_io() has been called. Indeed, there is currently no function to undo what pci_ioremap_io() did, and switching to pci_remap_iospace() is not an option in pci-mvebu due to the need for special memory attributes on Armada 38x. Reverting ee1604381a371 ("PCI: mvebu: Only remap I/O space if configured") would be a possibility, but it would require also reverting 42342073e38b5 ("PCI: mvebu: Convert to use pci_host_bridge directly"). So instead, we use an open-coded version of pci_host_probe() that creates the PCI I/O mapping at a point where we are guaranteed not to fail anymore. Fixes: ee1604381a371 ("PCI: mvebu: Only remap I/O space if configured") Reported-by: Jan Kundrát Tested-by: Jan Kundrát Signed-off-by: Thomas Petazzoni Signed-off-by: Bjorn Helgaas Acked-by: Lorenzo Pieralisi commit cee26487620bc9bc3c7db21b6984d91f7bae12ae Author: Jianbo Liu Date: Sat Aug 25 03:29:58 2018 +0000 net/mlx5e: Set vlan masks for all offloaded TC rules In flow steering, if asked to, the hardware matches on the first ethertype which is not vlan. It's possible to set a rule as follows, which is meant to match on untagged packet, but will match on a vlan packet: tc filter add dev eth0 parent ffff: protocol ip flower ... To avoid this for packets with single tag, we set vlan masks to tell hardware to check the tags for every matched packet. Fixes: 095b6cfd69ce ('net/mlx5e: Add TC vlan match parsing') Signed-off-by: Jianbo Liu Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 11aa5800ed66ed0415b7509f02881c76417d212a Author: Eran Ben Elisha Date: Sun Sep 16 14:45:27 2018 +0300 net/mlx5: E-Switch, Fix out of bound access when setting vport rate The code that deals with eswitch vport bw guarantee was going beyond the eswitch vport array limit, fix that. This was pointed out by the kernel address sanitizer (KASAN). The error from KASAN log: [2018-09-15 15:04:45] BUG: KASAN: slab-out-of-bounds in mlx5_eswitch_set_vport_rate+0x8c1/0xae0 [mlx5_core] Fixes: c9497c98901c ("net/mlx5: Add support for setting VF min rate") Signed-off-by: Eran Ben Elisha Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 4d8fcf216c90bc25e34ae2200aa8985ee3158898 Author: Alaa Hleihel Date: Wed Sep 5 11:43:23 2018 +0300 net/mlx5e: Avoid unbounded peer devices when unpairing TC hairpin rules If the peer device was already unbound, then do not attempt to modify it's resources, otherwise we will crash on dereferencing non-existing device. Fixes: 5c65c564c962 ("net/mlx5e: Support offloading TC NIC hairpin flows") Signed-off-by: Alaa Hleihel Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 4ca8ca9fe7dc792000c3762de5081a4d6dc33667 Author: Chris Wilson Date: Wed Sep 26 11:47:18 2018 +0100 drm/i915: Avoid compiler warning for maybe unused gu_misc_iir /kisskb/src/drivers/gpu/drm/i915/i915_irq.c: warning: 'gu_misc_iir' may be used uninitialized in this function [-Wuninitialized]: => 3120:10 Silence the compiler warning by ensuring that the local variable is initialised and removing the guard that is confusing the older gcc. Reported-by: Geert Uytterhoeven Fixes: df0d28c185ad ("drm/i915/icl: GSE interrupt moves from DE_MISC to GU_MISC") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Paulo Zanoni Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180926104718.17462-1-chris@chris-wilson.co.uk (cherry picked from commit 7a90938332d80faf973fbcffdf6e674e7b8f0914) Signed-off-by: Rodrigo Vivi commit bda6b1c95751bbf1779562b8eca3c20b270c0f53 Author: Anusha Srivatsa Date: Fri Aug 17 10:33:30 2018 -0700 drm/i915: Do not redefine the has_csr parameter. Let us reuse the already defined has_csr check and not redefine it. The main difference is that in effect this will flip .has_csr to 1 (via GEN9_FEATURES which GEN11_FEATURES pulls in). Suggested-by: Imre Deak Cc: Imre Deak Cc: Rodrigo Vivi Signed-off-by: Anusha Srivatsa Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=107382 Reviewed-by: Imre Deak Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/1534527210-16841-1-git-send-email-anusha.srivatsa@intel.com (cherry picked from commit da4468a1aa75457e6134127b19761b7ba62ce945) Signed-off-by: Rodrigo Vivi commit e7e86f42fa68c70cab4e964017273da32a77af07 Author: Joe Perches Date: Sun Sep 30 09:21:34 2018 -0700 MAINTAINERS: MIPS/LOONGSON2 ARCHITECTURE - Use the normal wildcard style Neither git nor get_maintainer understands the curly brace style. Signed-off-by: Joe Perches Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20821/ Cc: Huacai Chen Cc: linux-mips Cc: LKML commit c458dda3d07c110ce1d007998f67273325ad8662 Merge: 55a5542a5462 bf42daed6bd1 Author: Martin Schwidefsky Date: Mon Oct 1 16:07:42 2018 +0200 Merge tag 'vfio-ccw-20181001' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw into fixes Pull vfio-ccw from Cornelia Huck with the following changes: - Change allocation of ccw_io_region so that the usercopy hardening code can figure out that everything is fine. commit daa07cbc9ae3da2d61b7ce900c0b9107d134f2c1 Author: Sean Christopherson Date: Tue Sep 25 13:20:00 2018 -0700 KVM: x86: fix L1TF's MMIO GFN calculation One defense against L1TF in KVM is to always set the upper five bits of the *legal* physical address in the SPTEs for non-present and reserved SPTEs, e.g. MMIO SPTEs. In the MMIO case, the GFN of the MMIO SPTE may overlap with the upper five bits that are being usurped to defend against L1TF. To preserve the GFN, the bits of the GFN that overlap with the repurposed bits are shifted left into the reserved bits, i.e. the GFN in the SPTE will be split into high and low parts. When retrieving the GFN from the MMIO SPTE, e.g. to check for an MMIO access, get_mmio_spte_gfn() unshifts the affected bits and restores the original GFN for comparison. Unfortunately, get_mmio_spte_gfn() neglects to mask off the reserved bits in the SPTE that were used to store the upper chunk of the GFN. As a result, KVM fails to detect MMIO accesses whose GPA overlaps the repurprosed bits, which in turn causes guest panics and hangs. Fix the bug by generating a mask that covers the lower chunk of the GFN, i.e. the bits that aren't shifted by the L1TF mitigation. The alternative approach would be to explicitly zero the five reserved bits that are used to store the upper chunk of the GFN, but that requires additional run-time computation and makes an already-ugly bit of code even more inscrutable. I considered adding a WARN_ON_ONCE(low_phys_bits-1 <= PAGE_SHIFT) to warn if GENMASK_ULL() generated a nonsensical value, but that seemed silly since that would mean a system that supports VMX has less than 18 bits of physical address space... Reported-by: Sakari Ailus Fixes: d9b47449c1a1 ("kvm: x86: Set highest physical address bits in non-present/reserved SPTEs") Cc: Junaid Shahid Cc: Jim Mattson Cc: stable@vger.kernel.org Reviewed-by: Junaid Shahid Tested-by: Sakari Ailus Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit fe804cd6774938814242aa67bb7e7cbc934b1203 Author: Stefan Raspl Date: Tue Sep 25 09:19:36 2018 +0200 tools/kvm_stat: cut down decimal places in update interval dialog We currently display the default number of decimal places for floats in _show_set_update_interval(), which is quite pointless. Cutting down to a single decimal place. Signed-off-by: Stefan Raspl Signed-off-by: Paolo Bonzini commit 62cf9bd8118c4009f02c477ef78c723f49e53e16 Author: Liran Alon Date: Fri Sep 14 03:25:54 2018 +0300 KVM: nVMX: Fix emulation of VM_ENTRY_LOAD_BNDCFGS L2 IA32_BNDCFGS should be updated with vmcs12->guest_bndcfgs only when VM_ENTRY_LOAD_BNDCFGS is specified in vmcs12->vm_entry_controls. Otherwise, L2 IA32_BNDCFGS should be set to vmcs01->guest_bndcfgs which is L1 IA32_BNDCFGS. Reviewed-by: Nikita Leshchenko Reviewed-by: Darren Kenny Signed-off-by: Liran Alon Signed-off-by: Paolo Bonzini commit 503234b3fdcaa578395c07e393ea3e5d13958824 Author: Liran Alon Date: Fri Sep 14 03:25:53 2018 +0300 KVM: x86: Do not use kvm_x86_ops->mpx_supported() directly Commit a87036add092 ("KVM: x86: disable MPX if host did not enable MPX XSAVE features") introduced kvm_mpx_supported() to return true iff MPX is enabled in the host. However, that commit seems to have missed replacing some calls to kvm_x86_ops->mpx_supported() to kvm_mpx_supported(). Complete original commit by replacing remaining calls to kvm_mpx_supported(). Fixes: a87036add092 ("KVM: x86: disable MPX if host did not enable MPX XSAVE features") Suggested-by: Sean Christopherson Signed-off-by: Liran Alon Signed-off-by: Paolo Bonzini commit 5f76f6f5ff96587af5acd5930f7d9fea81e0d1a8 Author: Liran Alon Date: Fri Sep 14 03:25:52 2018 +0300 KVM: nVMX: Do not expose MPX VMX controls when guest MPX disabled Before this commit, KVM exposes MPX VMX controls to L1 guest only based on if KVM and host processor supports MPX virtualization. However, these controls should be exposed to guest only in case guest vCPU supports MPX. Without this change, a L1 guest running with kernel which don't have commit 691bd4340bef ("kvm: vmx: allow host to access guest MSR_IA32_BNDCFGS") asserts in QEMU on the following: qemu-kvm: error: failed to set MSR 0xd90 to 0x0 qemu-kvm: .../qemu-2.10.0/target/i386/kvm.c:1801 kvm_put_msrs: Assertion 'ret == cpu->kvm_msr_buf->nmsrs failed' This is because L1 KVM kvm_init_msr_list() will see that vmx_mpx_supported() (As it only checks MPX VMX controls support) and therefore KVM_GET_MSR_INDEX_LIST IOCTL will include MSR_IA32_BNDCFGS. However, later when L1 will attempt to set this MSR via KVM_SET_MSRS IOCTL, it will fail because !guest_cpuid_has_mpx(vcpu). Therefore, fix the issue by exposing MPX VMX controls to L1 guest only when vCPU supports MPX. Fixes: 36be0b9deb23 ("KVM: x86: Add nested virtualization support for MPX") Reported-by: Eyal Moscovici Reviewed-by: Nikita Leshchenko Reviewed-by: Darren Kenny Signed-off-by: Liran Alon Signed-off-by: Paolo Bonzini commit 2a3f93459d689d990b3ecfbe782fec89b97d3279 Author: Marc Zyngier Date: Thu Sep 27 16:53:22 2018 +0100 arm64: KVM: Sanitize PSTATE.M when being set from userspace Not all execution modes are valid for a guest, and some of them depend on what the HW actually supports. Let's verify that what userspace provides is compatible with both the VM settings and the HW capabilities. Cc: Fixes: 0d854a60b1d7 ("arm64: KVM: enable initialization of a 32bit vcpu") Reviewed-by: Christoffer Dall Reviewed-by: Mark Rutland Reviewed-by: Dave Martin Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit d26c25a9d19b5976b319af528886f89cf455692d Author: Dave Martin Date: Thu Sep 27 16:53:21 2018 +0100 arm64: KVM: Tighten guest core register access from userspace We currently allow userspace to access the core register file in about any possible way, including straddling multiple registers and doing unaligned accesses. This is not the expected use of the ABI, and nobody is actually using it that way. Let's tighten it by explicitly checking the size and alignment for each field of the register file. Cc: Fixes: 2f4a07c5f9fe ("arm64: KVM: guest one-reg interface") Reviewed-by: Christoffer Dall Reviewed-by: Mark Rutland Signed-off-by: Dave Martin [maz: rewrote Dave's initial patch to be more easily backported] Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit 1db58529454742f67ebd96e3588315e880b72837 Author: Yu Zhao Date: Thu Sep 27 17:05:04 2018 -0600 cfg80211: fix use-after-free in reg_process_hint() reg_process_hint_country_ie() can free regulatory_request and return REG_REQ_ALREADY_SET. We shouldn't use regulatory_request after it's called. KASAN error was observed when this happens. BUG: KASAN: use-after-free in reg_process_hint+0x839/0x8aa [cfg80211] Read of size 4 at addr ffff8800c430d434 by task kworker/1:3/89 Workqueue: events reg_todo [cfg80211] Call Trace: dump_stack+0xc1/0x10c ? _atomic_dec_and_lock+0x1ad/0x1ad ? _raw_spin_lock_irqsave+0xa0/0xd2 print_address_description+0x86/0x26f ? reg_process_hint+0x839/0x8aa [cfg80211] kasan_report+0x241/0x29b reg_process_hint+0x839/0x8aa [cfg80211] reg_todo+0x204/0x5b9 [cfg80211] process_one_work+0x55f/0x8d0 ? worker_detach_from_pool+0x1b5/0x1b5 ? _raw_spin_unlock_irq+0x65/0xdd ? _raw_spin_unlock_irqrestore+0xf3/0xf3 worker_thread+0x5dd/0x841 ? kthread_parkme+0x1d/0x1d kthread+0x270/0x285 ? pr_cont_work+0xe3/0xe3 ? rcu_read_unlock_sched_notrace+0xca/0xca ret_from_fork+0x22/0x40 Allocated by task 2718: set_track+0x63/0xfa __kmalloc+0x119/0x1ac regulatory_hint_country_ie+0x38/0x329 [cfg80211] __cfg80211_connect_result+0x854/0xadd [cfg80211] cfg80211_rx_assoc_resp+0x3bc/0x4f0 [cfg80211] smsc95xx v1.0.6 ieee80211_sta_rx_queued_mgmt+0x1803/0x7ed5 [mac80211] ieee80211_iface_work+0x411/0x696 [mac80211] process_one_work+0x55f/0x8d0 worker_thread+0x5dd/0x841 kthread+0x270/0x285 ret_from_fork+0x22/0x40 Freed by task 89: set_track+0x63/0xfa kasan_slab_free+0x6a/0x87 kfree+0xdc/0x470 reg_process_hint+0x31e/0x8aa [cfg80211] reg_todo+0x204/0x5b9 [cfg80211] process_one_work+0x55f/0x8d0 worker_thread+0x5dd/0x841 kthread+0x270/0x285 ret_from_fork+0x22/0x40 Signed-off-by: Yu Zhao Signed-off-by: Johannes Berg commit 211710ca74adf790b46ab3867fcce8047b573cd1 Author: Felix Fietkau Date: Sat Sep 29 16:01:58 2018 +0200 mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys key->sta is only valid after ieee80211_key_link, which is called later in this function. Because of that, the IEEE80211_KEY_FLAG_RX_MGMT is never set when management frame protection is enabled. Fixes: e548c49e6dc6b ("mac80211: add key flag for management keys") Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau Signed-off-by: Johannes Berg commit 848e616e66d4592fe9afc40743d3504deb7632b4 Author: Stefan Seyfried Date: Sun Sep 30 12:53:00 2018 +0200 cfg80211: fix wext-compat memory leak cfg80211_wext_giwrate and sinfo.pertid might allocate sinfo.pertid via rdev_get_station(), but never release it. Fix that. Fixes: 8689c051a201 ("cfg80211: dynamically allocate per-tid stats for station info") Signed-off-by: Stefan Seyfried [johannes: fix error path, use cfg80211_sinfo_release_content(), add Fixes] Signed-off-by: Johannes Berg commit 1feda5eb77fc279a4c4eb93b9a0ac3bf7254b57a Author: Marek Szyprowski Date: Fri Sep 28 18:09:23 2018 +0200 drm/exynos: Use selected dma_dev default iommu domain instead of a fake one Instead of allocating a fake IOMMU domain for all Exynos DRM components, simply reuse the default IOMMU domain of the already selected DMA device. This allows some design changes in IOMMU framework without breaking IOMMU support in Exynos DRM. Signed-off-by: Marek Szyprowski Reviewed-by: Robin Murphy Signed-off-by: Inki Dae commit 08d9db00fe0e300d6df976e6c294f974988226dd Author: Edgar Cherkasov Date: Thu Sep 27 11:56:03 2018 +0300 i2c: i2c-scmi: fix for i2c_smbus_write_block_data The i2c-scmi driver crashes when the SMBus Write Block transaction is executed: WARNING: CPU: 9 PID: 2194 at mm/page_alloc.c:3931 __alloc_pages_slowpath+0x9db/0xec0 Call Trace: ? get_page_from_freelist+0x49d/0x11f0 ? alloc_pages_current+0x6a/0xe0 ? new_slab+0x499/0x690 __alloc_pages_nodemask+0x265/0x280 alloc_pages_current+0x6a/0xe0 kmalloc_order+0x18/0x40 kmalloc_order_trace+0x24/0xb0 ? acpi_ut_allocate_object_desc_dbg+0x62/0x10c __kmalloc+0x203/0x220 acpi_os_allocate_zeroed+0x34/0x36 acpi_ut_copy_eobject_to_iobject+0x266/0x31e acpi_evaluate_object+0x166/0x3b2 acpi_smbus_cmi_access+0x144/0x530 [i2c_scmi] i2c_smbus_xfer+0xda/0x370 i2cdev_ioctl_smbus+0x1bd/0x270 i2cdev_ioctl+0xaa/0x250 do_vfs_ioctl+0xa4/0x600 SyS_ioctl+0x79/0x90 do_syscall_64+0x73/0x130 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 ACPI Error: Evaluating _SBW: 4 (20170831/smbus_cmi-185) This problem occurs because the length of ACPI Buffer object is not defined/initialized in the code before a corresponding ACPI method is called. The obvious patch below fixes this issue. Signed-off-by: Edgar Cherkasov Acked-by: Viktor Krasnov Acked-by: Michael Brunner Signed-off-by: Wolfram Sang commit e55ec4ddbef9897199c307dfb23167e3801fdaf5 Author: Dave Chinner Date: Mon Oct 1 08:11:07 2018 +1000 xfs: fix error handling in xfs_bmap_extents_to_btree Commit 01239d77b9dd ("xfs: fix a null pointer dereference in xfs_bmap_extents_to_btree") attempted to fix a null pointer dreference when a fuzzing corruption of some kind was found. This fix was flawed, resulting in assert failures like: XFS: Assertion failed: ifp->if_broot == NULL, file: fs/xfs/libxfs/xfs_bmap.c, line: 715 ..... Call Trace: xfs_bmap_extents_to_btree+0x6b9/0x7b0 __xfs_bunmapi+0xae7/0xf00 ? xfs_log_reserve+0x1c8/0x290 xfs_reflink_remap_extent+0x20b/0x620 xfs_reflink_remap_blocks+0x7e/0x290 xfs_reflink_remap_range+0x311/0x530 vfs_dedupe_file_range_one+0xd7/0xe0 vfs_dedupe_file_range+0x15b/0x1a0 do_vfs_ioctl+0x267/0x6c0 The problem is that the error handling code now asserts that the inode fork is not in btree format before the error handling code undoes the modifications that put the fork back in extent format. Fix this by moving the assert back to after the xfs_iroot_realloc() call that returns the fork to extent format, and clean up the jump labels to be meaningful. Also, returning ENOSPC when xfs_btree_get_bufl() fails to instantiate the buffer that was allocated (the actual fix in the commit mentioned above) is incorrect. This is a fatal error - only an invalid block address or a filesystem shutdown can result in failing to get a buffer here. Hence change this to EFSCORRUPTED so that the higher layer knows this was a corruption related failure and should not treat it as an ENOSPC error. This should result in a shutdown (via cancelling a dirty transaction) which is necessary as we do not attempt to clean up the (invalid) block that we have already allocated. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit bac6f6cda206ad7cbe0c73c35e494377ce9c4749 Author: Kees Cook Date: Fri Sep 28 15:17:50 2018 -0700 pstore/ram: Fix failure-path memory leak in ramoops_init As reported by nixiaoming, with some minor clarifications: 1) memory leak in ramoops_register_dummy(): dummy_data = kzalloc(sizeof(*dummy_data), GFP_KERNEL); but no kfree() if platform_device_register_data() fails. 2) memory leak in ramoops_init(): Missing platform_device_unregister(dummy) and kfree(dummy_data) if platform_driver_register(&ramoops_driver) fails. I've clarified the purpose of ramoops_register_dummy(), and added a common cleanup routine for all three failure paths to call. Reported-by: nixiaoming Cc: stable@vger.kernel.org Cc: Anton Vorontsov Cc: Colin Cross Cc: Tony Luck Cc: Joel Fernandes Cc: Geliang Tang Signed-off-by: Kees Cook commit 7012040576c6ae25a47035659ee48673612c2c27 Author: Bjorn Andersson Date: Wed Sep 19 18:09:38 2018 -0700 firmware: Always initialize the fw_priv list object When freeing the fw_priv the item is taken off the list. This causes an oops in the FW_OPT_NOCACHE case as the list object is not initialized. Make sure to initialize the list object regardless of this flag. Fixes: 422b3db2a503 ("firmware: Fix security issue with request_firmware_into_buf()") Cc: stable@vger.kernel.org Cc: Rishabh Bhatnagar Signed-off-by: Bjorn Andersson Reviewed-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 492ecf6d6598e7c3b0b1372653ed21da50ddfb09 Author: Alan Tull Date: Wed Sep 12 09:43:25 2018 -0500 docs: fpga: document fpga manager flags Add flags #defines to kerneldoc documentation in a useful place. Signed-off-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit b4d9a0e5ca139640a45bcda87bc718f85d8008af Author: Alan Tull Date: Wed Sep 12 09:43:24 2018 -0500 fpga: bridge: fix obvious function documentation error fpga_bridge_dev_match() returns a FPGA bridge struct, not a FPGA manager struct so s/manager/bridge/. Signed-off-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit c2d68afba86d1ff01e7300c68bc16a9234dcd8e9 Author: Vitaly Kuznetsov Date: Mon Sep 17 04:14:55 2018 +0000 tools: hv: fcopy: set 'error' in case an unknown operation was requested 'error' variable is left uninitialized in case we see an unknown operation. As we don't immediately return and proceed to pwrite() we need to set it to something, HV_E_FAIL sounds good enough. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Cc: stable Signed-off-by: Greg Kroah-Hartman commit 34bd283396af1f05c43fa64d51378d38affb1cf1 Author: Alan Tull Date: Wed Sep 12 09:43:23 2018 -0500 fpga: do not access region struct after fpga_region_unregister A couple drivers were accessing the region struct after it had been freed. Save off the pointer to the mgr before the region struct gets freed. Signed-off-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit 41e270f6898e7502be9fd6920ee0a108ca259d36 Author: Dexuan Cui Date: Mon Sep 17 04:14:54 2018 +0000 Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect() With CONFIG_DEBUG_PREEMPT=y, I always see this warning: BUG: using smp_processor_id() in preemptible [00000000] Fix the false warning by using get/put_cpu(). Here vmbus_connect() sends a message to the host and waits for the host's response. The host will deliver the response message and an interrupt on CPU msg->target_vcpu, and later the interrupt handler will wake up vmbus_connect(). vmbus_connect() doesn't really have to run on the same cpu as CPU msg->target_vcpu, so it's safe to call put_cpu() just here. Signed-off-by: Dexuan Cui Cc: stable@vger.kernel.org Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 17b57b1883c1285f3d0dc2266e8f79286a7bef38 Author: Greg Kroah-Hartman Date: Sun Sep 30 07:15:35 2018 -0700 Linux 4.19-rc6 commit 9a10b063758c756a4d60d63acb890c27d03c9bef Merge: 9ba6873e1603 03d179a840ce Author: Greg Kroah-Hartman Date: Sun Sep 30 06:20:33 2018 -0700 Merge tag 'auxdisplay-for-greg-v4.19-rc6' of https://github.com/ojeda/linux Miguel writes: "A trivial fix for auxdisplay - MAINTAINERS reference fix for moved file Reported by Joe Perches" * tag 'auxdisplay-for-greg-v4.19-rc6' of https://github.com/ojeda/linux: MAINTAINERS: fix reference to moved drivers/{misc => auxdisplay}/panel.c commit 9ba6873e1603988adf97dd5abe18936a2aeff1fd Merge: 291d0e5d81e1 f52afc93cd01 Author: Greg Kroah-Hartman Date: Sun Sep 30 06:19:38 2018 -0700 Merge tag 'libnvdimm-fixes2-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Dan writes: "filesystem-dax for 4.19-rc6 Fix a deadlock in the new for 4.19 dax_lock_mapping_entry() routine." * tag 'libnvdimm-fixes2-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: dax: Fix deadlock in dax_lock_mapping_entry() commit 03d179a840ce9e694db9d69bb643fdee04cfd28f Author: Miguel Ojeda Date: Sun Sep 30 13:50:05 2018 +0200 MAINTAINERS: fix reference to moved drivers/{misc => auxdisplay}/panel.c Commit 51c1e9b554c9 ("auxdisplay: Move panel.c to drivers/auxdisplay folder") moved the file, but the MAINTAINERS reference was not updated. Link: https://lore.kernel.org/lkml/20180928220131.31075-1-joe@perches.com/ Reported-by: Joe Perches Signed-off-by: Miguel Ojeda commit 291d0e5d81e101392379217b06251fe8c27f1f80 Merge: e75417739b1d 133424a20777 Author: Greg Kroah-Hartman Date: Sat Sep 29 14:52:14 2018 -0700 Merge tag 'for-linus-20180929' of git://git.kernel.dk/linux-block Jens writes: "Block fixes for 4.19-rc6 A set of fixes that should go into this release. This pull request contains: - A fix (hopefully) for the persistent grants for xen-blkfront. A previous fix from this series wasn't complete, hence reverted, and this one should hopefully be it. (Boris Ostrovsky) - Fix for an elevator drain warning with SMR devices, which is triggered when you switch schedulers (Damien) - bcache deadlock fix (Guoju Fang) - Fix for the block unplug tracepoint, which has had the timer/explicit flag reverted since 4.11 (Ilya) - Fix a regression in this series where the blk-mq timeout hook is invoked with the RCU read lock held, hence preventing it from blocking (Keith) - NVMe pull from Christoph, with a single multipath fix (Susobhan Dey)" * tag 'for-linus-20180929' of git://git.kernel.dk/linux-block: xen/blkfront: correct purging of persistent grants Revert "xen/blkfront: When purging persistent grants, keep them in the buffer" blk-mq: I/O and timer unplugs are inverted in blktrace bcache: add separate workqueue for journal_write to avoid deadlock xen/blkfront: When purging persistent grants, keep them in the buffer block: fix deadline elevator drain for zoned block devices blk-mq: Allow blocking queue tag iter callbacks nvme: properly propagate errors in nvme_mpath_init commit e75417739b1de4f6eb99f3f080c67bfd6812d562 Merge: e1ce697db674 bdec8d7fa55e Author: Greg Kroah-Hartman Date: Sat Sep 29 14:34:06 2018 -0700 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Thomas writes: "A single fix for the AMD memory encryption boot code so it does not read random garbage instead of the cached encryption bit when a kexec kernel is allocated above the 32bit address limit." * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Fix kexec booting failure in the SEV bit detection code commit e1ce697db67421cc7e9a1cc1312149f3a4e08c93 Merge: af17b3aa1fea 090bcfd5d1b6 Author: Greg Kroah-Hartman Date: Sat Sep 29 14:32:49 2018 -0700 Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Thomas writes: "Three small fixes for clocksource drivers: - Proper error handling in the Atmel PIT driver - Add CLOCK_SOURCE_SUSPEND_NONSTOP for TI SoCs so suspend works again - Fix the next event function for Facebook Backpack-CMM BMC chips so usleep(100) doesnt sleep several milliseconds" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/timer-atmel-pit: Properly handle error cases clocksource/drivers/fttmr010: Fix set_next_event handler clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs commit 43955a45dc0b4f3be7f0c3afc0e080ed59bb5280 Author: Johannes Berg Date: Wed Sep 26 22:19:42 2018 +0200 netlink: fix typo in nla_parse_nested() comment Fix a simple typo: attribuets -> attributes Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit ac8bd9e13be22a3d24bfc80972d4688e3e50e457 Author: Hans de Goede Date: Wed Sep 26 22:12:39 2018 +0200 r8169: Disable clk during suspend / resume Disable the clk during suspend to save power. Note that tp->clk may be NULL, the clk core functions handle this without problems. Reviewed-by: Andy Shevchenko Tested-by: Carlo Caione Signed-off-by: Hans de Goede Signed-off-by: David S. Miller commit c333fa0c4f220f8f7ea5acd6b0ebf3bf13fd684d Author: Shahed Shaikh Date: Wed Sep 26 12:41:10 2018 -0700 qlcnic: fix Tx descriptor corruption on 82xx devices In regular NIC transmission flow, driver always configures MAC using Tx queue zero descriptor as a part of MAC learning flow. But with multi Tx queue supported NIC, regular transmission can occur on any non-zero Tx queue and from that context it uses Tx queue zero descriptor to configure MAC, at the same time TX queue zero could be used by another CPU for regular transmission which could lead to Tx queue zero descriptor corruption and cause FW abort. This patch fixes this in such a way that driver always configures learned MAC address from the same Tx queue which is used for regular transmission. Fixes: 7e2cf4feba05 ("qlcnic: change driver hardware interface mechanism") Signed-off-by: Shahed Shaikh Signed-off-by: David S. Miller commit c140eb166d681f66bd7e99fb121357db1a503e7f Author: LUU Duc Canh Date: Wed Sep 26 21:00:54 2018 +0200 tipc: fix failover problem We see the following scenario: 1) Link endpoint B on node 1 discovers that its peer endpoint is gone. Since there is a second working link, failover procedure is started. 2) Link endpoint A on node 1 sends a FAILOVER message to peer endpoint A on node 2. The node item 1->2 goes to state FAILINGOVER. 3) Linke endpoint A/2 receives the failover, and is supposed to take down its parallell link endpoint B/2, while producing a FAILOVER message to send back to A/1. 4) However, B/2 has already been deleted, so no FAILOVER message can created. 5) Node 1->2 remains in state FAILINGOVER forever, refusing to receive any messages that can bring B/1 up again. We are left with a non- redundant link between node 1 and 2. We fix this with letting endpoint A/2 build a dummy FAILOVER message to send to back to A/1, so that the situation can be resolved. Signed-off-by: LUU Duc Canh Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit af17b3aa1fea3a87d81b499b3039a4b76a668d87 Merge: 82ec752cce8b befb1b3c2703 Author: Greg Kroah-Hartman Date: Sat Sep 29 11:32:03 2018 -0700 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Thomas writes: "A single fix for a missing sanity check when a pinned event is tried to be read on the wrong CPU due to a legit event scheduling failure." * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Add sanity check to deal with pinned event failure commit 418b9a353a821f5d1787fd310d2af31232e9ff32 Merge: 982d608f0f6a c530c471ba37 Author: David S. Miller Date: Sat Sep 29 11:31:30 2018 -0700 Merge branch 'net-usb-Check-for-Wake-on-LAN-modes' Florian Fainelli says: ==================== net: usb: Check for Wake-on-LAN modes Most of our USB Ethernet drivers don't seem to be checking properly whether the user is supplying a correct Wake-on-LAN mode to enter, so the experience as an user could be confusing, since it would generally lead to either no wake-up, or the device not being marked for wake-up. Please review! Changes in v2: - fixed lan78xx handling, thanks Woojung! ==================== Signed-off-by: David S. Miller commit c530c471ba37bdd9fe1c7185b01455c00ae606fb Author: Florian Fainelli Date: Fri Sep 28 16:18:56 2018 -0700 smsc95xx: Check for Wake-on-LAN modes The driver does not check for Wake-on-LAN modes specified by an user, but will conditionally set the device as wake-up enabled or not based on that, which could be a very confusing user experience. Fixes: e0e474a83c18 ("smsc95xx: add wol magic packet support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 9c734b2769a73eea2e9e9767c0e0bf839ff23679 Author: Florian Fainelli Date: Fri Sep 28 16:18:55 2018 -0700 smsc75xx: Check for Wake-on-LAN modes The driver does not check for Wake-on-LAN modes specified by an user, but will conditionally set the device as wake-up enabled or not based on that, which could be a very confusing user experience. Fixes: 6c636503260d ("smsc75xx: add wol magic packet support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit f2750df1548bd8a2b060eb609fc43ca82811af4c Author: Florian Fainelli Date: Fri Sep 28 16:18:54 2018 -0700 r8152: Check for supported Wake-on-LAN Modes The driver does not check for Wake-on-LAN modes specified by an user, but will conditionally set the device as wake-up enabled or not based on that, which could be a very confusing user experience. Fixes: 21ff2e8976b1 ("r8152: support WOL") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit c5cb93e994ffb43b7b3b1ff10b9f928f54574a36 Author: Florian Fainelli Date: Fri Sep 28 16:18:53 2018 -0700 sr9800: Check for supported Wake-on-LAN modes The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: 19a38d8e0aa3 ("USB2NET : SR9800 : One chip USB2.0 USB2NET SR9800 Device Driver Support") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit eb9ad088f96653a26b340f7c447c44cf023d5cdc Author: Florian Fainelli Date: Fri Sep 28 16:18:52 2018 -0700 lan78xx: Check for supported Wake-on-LAN modes The driver supports a fair amount of Wake-on-LAN modes, but is not checking that the user specified one that is supported. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Signed-off-by: Florian Fainelli Reviewed-by: Woojung Huh Signed-off-by: David S. Miller commit 5ba6b4aa9a410c5e2c6417df52b5e2118ea9b467 Author: Florian Fainelli Date: Fri Sep 28 16:18:51 2018 -0700 ax88179_178a: Check for supported Wake-on-LAN modes The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: e2ca90c276e1 ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit c4ce446e33d7a0e978256ac6fea4c80e59d9de5f Author: Florian Fainelli Date: Fri Sep 28 16:18:50 2018 -0700 asix: Check for supported Wake-on-LAN modes The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: 2e55cc7210fe ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 982d608f0f6a9f2700f1a2b35538d686898f78ae Merge: f810dcece09f d6d1cd2578c4 Author: David S. Miller Date: Sat Sep 29 11:28:49 2018 -0700 Merge branch 'ieee802154-for-davem-2018-09-28' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2018-09-28 An update from ieee802154 for your *net* tree. Some cleanup patches throughout the drivers from the Huawei tag team Yue Haibing and Zhong Jiang. Xue is replacing some magic numbers with defines in his mcr20a driver. ==================== Signed-off-by: David S. Miller commit f810dcece09f7ae9720aeb01e25391883013047d Merge: f13d1b48b95b f334430316e7 Author: David S. Miller Date: Sat Sep 29 11:28:17 2018 -0700 Merge tag 'rxrpc-fixes-20180928' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs David Howells says: ==================== rxrpc: Fixes Here are some miscellaneous fixes for AF_RXRPC: (1) Remove a duplicate variable initialisation. (2) Fix one of the checks made when we decide to set up a new incoming service call in which a flag is being checked in the wrong field of the packet header. This check is abstracted out into helper functions. (3) Fix RTT gathering. The code has been trying to make use of socket timestamps, but wasn't actually enabling them. The code has also been recording a transmit time for the outgoing packet for which we're going to measure the RTT after sending the message - but we can get the incoming packet before we get to that and record a negative RTT. (4) Fix the emission of BUSY packets (we are emitting ABORTs instead). (5) Improve error checking on incoming packets. (6) Try to fix a bug in new service call handling whereby a BUG we should never be able to reach somehow got triggered. Do this by moving much of the checking as early as possible and not repeating it later (depends on (5) above). (7) Fix the sockopts set on a UDP6 socket to include the ones set on a UDP4 socket so that we receive UDP4 errors and packet-too-large notifications too. (8) Fix the distribution of errors so that we do it at the point of receiving an error in the UDP callback rather than deferring it thereby cutting short any transmissions that would otherwise occur in the window. ==================== Signed-off-by: David S. Miller commit 82ec752cce8b19b69efcfc96303b2ed33e01fd48 Merge: 7a6878bb4e7a d51aea13dd67 Author: Greg Kroah-Hartman Date: Sat Sep 29 06:50:36 2018 -0700 Merge tag 'pm-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Rafael writes: "Power management fix for 4.19-rc6 Fix incorrect __init and __exit annotations in the Qualcomm Kryo cpufreq driver (Nathan Chancellor)." * tag 'pm-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: qcom-kryo: Fix section annotations commit d51aea13dd6753186a2bea7619029c460bdf0c4c Author: Nathan Chancellor Date: Wed Sep 19 17:22:21 2018 -0700 cpufreq: qcom-kryo: Fix section annotations There is currently a warning when building the Kryo cpufreq driver into the kernel image: WARNING: vmlinux.o(.text+0x8aa424): Section mismatch in reference from the function qcom_cpufreq_kryo_probe() to the function .init.text:qcom_cpufreq_kryo_get_msm_id() The function qcom_cpufreq_kryo_probe() references the function __init qcom_cpufreq_kryo_get_msm_id(). This is often because qcom_cpufreq_kryo_probe lacks a __init annotation or the annotation of qcom_cpufreq_kryo_get_msm_id is wrong. Remove the '__init' annotation from qcom_cpufreq_kryo_get_msm_id so that there is no more mismatch warning. Additionally, Nick noticed that the remove function was marked as '__init' when it should really be marked as '__exit'. Fixes: 46e2856b8e18 (cpufreq: Add Kryo CPU scaling driver) Fixes: 5ad7346b4ae2 (cpufreq: kryo: Add module remove and exit) Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Acked-by: Viresh Kumar Cc: 4.18+ # 4.18+ Signed-off-by: Rafael J. Wysocki commit 7a6878bb4e7ac410b8748e115df8265cf32b1be3 Merge: e704966c45e4 974c24c5bed7 Author: Greg Kroah-Hartman Date: Sat Sep 29 02:52:24 2018 -0700 Merge tag 'dma-mapping-4.19-3' of git://git.infradead.org/users/hch/dma-mapping Christoph writes: "dma mapping fix for 4.19-rc6 fix a missing Kconfig symbol for commits introduced in 4.19-rc" * tag 'dma-mapping-4.19-3' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: add the missing ARCH_HAS_SYNC_DMA_FOR_CPU_ALL declaration commit 561295a32579e2db3b22f74d1f45d5c4c4fd9375 Author: Brian Foster Date: Sat Sep 29 13:51:01 2018 +1000 iomap: set page dirty after partial delalloc on mkwrite The iomap page fault mechanism currently dirties the associated page after the full block range of the page has been allocated. This leaves the page susceptible to delayed allocations without ever being set dirty on sub-page block sized filesystems. For example, consider a page fault on a page with one preexisting real (non-delalloc) block allocated in the middle of the page. The first iomap_apply() iteration performs delayed allocation on the range up to the preexisting block, the next iteration finds the preexisting block, and the last iteration attempts to perform delayed allocation on the range after the prexisting block to the end of the page. If the first allocation succeeds and the final allocation fails with -ENOSPC, iomap_apply() returns the error and iomap_page_mkwrite() fails to dirty the page having already performed partial delayed allocation. This eventually results in the page being invalidated without ever converting the delayed allocation to real blocks. This problem is reliably reproduced by generic/083 on XFS on ppc64 systems (64k page size, 4k block size). It results in leaked delalloc blocks on inode reclaim, which triggers an assert failure in xfs_fs_destroy_inode() and filesystem accounting inconsistency. Move the set_page_dirty() call from iomap_page_mkwrite() to the actor callback, similar to how the buffer head implementation works. The actor callback is called iff ->iomap_begin() returns success, so ensures the page is dirtied as soon as possible after an allocation. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit ec2ed0b5e96fea2a4539bd7f7f43499ecd45be8b Author: Brian Foster Date: Sat Sep 29 13:50:41 2018 +1000 xfs: remove invalid log recovery first/last cycle check One of the first steps of log recovery is to check for the special case of a zeroed log. If the first cycle in the log is zero or the tail portion of the log is zeroed, the head is set to the first instance of cycle 0. xlog_find_zeroed() includes a sanity check that enforces that the first cycle in the log must be 1 if the last cycle is 0. While this is true in most cases, the check is not totally valid because it doesn't consider the case where the filesystem crashed after a partial/out of order log buffer completion that wraps around the end of the physical log. For example, consider a filesystem that has completed most of the first cycle of the log, reaches the end of the physical log and splits the next single log buffer write into two in order to wrap around the end of the log. If these I/Os are reordered, the second (wrapped) I/O completes and the first happens to fail, the log is left in a state where the last cycle of the log is 0 and the first cycle is 2. This causes the xlog_find_zeroed() sanity check to fail and prevents the filesystem from mounting. This situation has been reproduced on particular systems via repeated runs of generic/475. This is an expected state that log recovery already knows how to deal with, however. Since the log is still partially zeroed, the head is detected correctly and points to a valid tail. The subsequent stale block detection clears blocks beyond the head up to the tail (within a maximum range), with the express purpose of clearing such out of order writes. As expected, this removes the out of order cycle 2 blocks at the physical start of the log. In other words, the only thing that prevents a clean mount and recovery of the filesystem in this scenario is the specific (last == 0 && first != 1) sanity check in xlog_find_zeroed(). Since the log head/tail are now independently validated via cycle, log record and CRC checks, this highly specific first cycle check is of dubious value. Remove it and rely on the higher level validation to determine whether log content is sane and recoverable. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 339e1a3fcdd1990e5ec115325ccb4c6f4cc5ee16 Author: Eric Sandeen Date: Sat Sep 29 13:50:13 2018 +1000 xfs: validate inode di_forkoff Verify the inode di_forkoff, lifted from xfs_repair's process_check_inode_forkoff(). Signed-off-by: Eric Sandeen Reviewed-by: Brian Foster Signed-off-by: Dave Chinner commit f5f3f959b70b272dfe2d05758e43ae52f5ff7748 Author: Christoph Hellwig Date: Sat Sep 29 13:49:58 2018 +1000 xfs: skip delalloc COW blocks in xfs_reflink_end_cow The iomap direct I/O code issues a single ->end_io call for the whole I/O request, and if some of the extents cowered needed a COW operation it will call xfs_reflink_end_cow over the whole range. When we do AIO writes we drop the iolock after doing the initial setup, but before the I/O completion. Between dropping the lock and completing the I/O we can have a racing buffered write create new delalloc COW fork extents in the region covered by the outstanding direct I/O write, and thus see delalloc COW fork extents in xfs_reflink_end_cow. As concurrent writes are fundamentally racy and no guarantees are given we can simply skip those. This can be easily reproduced with xfstests generic/208 in always_cow mode. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit f369a13cead821e679c7415dc66a17ec48cc26bf Author: Eric Sandeen Date: Sat Sep 29 13:49:00 2018 +1000 xfs: don't treat unknown di_flags2 as corruption in scrub xchk_inode_flags2() currently treats any di_flags2 values that the running kernel doesn't recognize as corruption, and calls xchk_ino_set_corrupt() if they are set. However, it's entirely possible that these flags were set in some newer kernel and are quite valid, but ignored in this kernel. (Validators don't care one bit about unknown di_flags2.) Call xchk_ino_set_warning instead, because this may or may not actually indicate a problem. Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 2863c2ebc4f45d2bc150016f36e2f31c155597e8 Author: YueHaibing Date: Sat Sep 29 13:48:21 2018 +1000 xfs: remove duplicated include from alloc.c Remove duplicated include xfs_alloc.h Signed-off-by: YueHaibing Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 0065b54119973c9089f8222c1c8f9237ed9787a9 Author: Christoph Hellwig Date: Sat Sep 29 13:47:46 2018 +1000 xfs: don't bring in extents in xfs_bmap_punch_delalloc_range This function is only used to punch out delayed allocations on I/O failure, which means we need to have read the extents earlier. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit df307077916fde42734a49022fc8ed23cc58caa4 Author: Dave Chinner Date: Sat Sep 29 13:47:15 2018 +1000 xfs: fix transaction leak in xfs_reflink_allocate_cow() When xfs_reflink_allocate_cow() allocates a transaction, it drops the ILOCK to perform the operation. This Introduces a race condition where another thread modifying the file can perform the COW allocation operation underneath us. This result in the retry loop finding an allocated block and jumping straight to the conversion code. It does not, however, cancel the transaction it holds and so this gets leaked. This results in a lockdep warning: ================================================ WARNING: lock held when returning to user space! 4.18.5 #1 Not tainted ------------------------------------------------ worker/6123 is leaving the kernel with locks still held! 1 lock held by worker/6123: #0: 000000009eab4f1b (sb_internal#2){.+.+}, at: xfs_trans_alloc+0x17c/0x220 And eventually the filesystem deadlocks because it runs out of log space that is reserved by the leaked transaction and never gets released. The logic flow in xfs_reflink_allocate_cow() is a convoluted mess of gotos - it's no surprise that it has bug where the flow through several goto jumps then fails to clean up context from a non-obvious logic path. CLean up the logic flow and make sure every path does the right thing. Reported-by: Alexander Y. Fomichev Tested-by: Alexander Y. Fomichev Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200981 Signed-off-by: Dave Chinner [hch: slight refactor] Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 8683edb7755b853f0dd92e07fe2e7a7e675a84d7 Author: Dave Chinner Date: Sat Sep 29 13:46:21 2018 +1000 xfs: avoid lockdep false positives in xfs_trans_alloc We've had a few reports of lockdep tripping over memory reclaim context vs filesystem freeze "deadlocks". They all have looked to be false positives on analysis, but it seems that they are being tripped because we take freeze references before we run a GFP_KERNEL allocation for the struct xfs_trans. We can avoid this false positive vector just by re-ordering the operations in xfs_trans_alloc(). That is. we need allocate the structure before we take the freeze reference and enter the GFP_NOFS allocation context that follows the xfs_trans around. This prevents lockdep from seeing the GFP_KERNEL allocation inside the transaction context, and that prevents it from triggering the freeze level vs alloc context vs reclaim warnings. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig commit 95808459b110f16b50f03a70ecfa72bb14bd8a96 Author: Brian Foster Date: Sat Sep 29 13:45:26 2018 +1000 xfs: refactor xfs_buf_log_item reference count handling The xfs_buf_log_item structure has a reference counter with slightly tricky semantics. In the common case, a buffer is logged and committed in a transaction, committed to the on-disk log (added to the AIL) and then finally written back and removed from the AIL. The bli refcount covers two potentially overlapping timeframes: 1. the bli is held in an active transaction 2. the bli is pinned by the log The caveat to this approach is that the reference counter does not purely dictate the lifetime of the bli. IOW, when a dirty buffer is physically logged and unpinned, the bli refcount may go to zero as the log item is inserted into the AIL. Only once the buffer is written back can the bli finally be freed. The above semantics means that it is not enough for the various refcount decrementing contexts to release the bli on decrement to zero. xfs_trans_brelse(), transaction commit (->iop_unlock()) and unpin (->iop_unpin()) must all drop the associated reference and make additional checks to determine if the current context is responsible for freeing the item. For example, if a transaction holds but does not dirty a particular bli, the commit may drop the refcount to zero. If the bli itself is clean, it is also not AIL resident and must be freed at this time. The same is true for xfs_trans_brelse(). If the transaction dirties a bli and then aborts or an unpin results in an abort due to a log I/O error, the last reference count holder is expected to explicitly remove the item from the AIL and release it (since an abort means filesystem shutdown and metadata writeback will never occur). This leads to fairly complex checks being replicated in a few different places. Since ->iop_unlock() and xfs_trans_brelse() are nearly identical, refactor the logic into a common helper that implements and documents the semantics in one place. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 23420d05e67d23728e116321c4afe084ebfa6427 Author: Brian Foster Date: Sat Sep 29 13:45:02 2018 +1000 xfs: clean up xfs_trans_brelse() xfs_trans_brelse() is a bit of a historical mess, similar to xfs_buf_item_unlock(). It is unnecessarily verbose, has snippets of commented out code, inconsistency with regard to stale items, etc. Clean up xfs_trans_brelse() to use similar logic and flow as xfs_buf_item_unlock() with regard to bli reference count handling. This patch makes no functional changes, but facilitates further refactoring of the common bli reference count handling code. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit d9183105caa926522a4bc8a40e162de7019f1a21 Author: Brian Foster Date: Sat Sep 29 13:44:40 2018 +1000 xfs: don't unlock invalidated buf on aborted tx commit xfstests generic/388,475 occasionally reproduce assertion failures in xfs_buf_item_unpin() when the final bli reference is dropped on an invalidated buffer and the buffer is not locked as it is expected to be. Invalidated buffers should remain locked on transaction commit until the final unpin, at which point the buffer is removed from the AIL and the bli is freed since stale buffers are not written back. The assert failures are associated with filesystem shutdown, typically due to log I/O errors injected by the test. The problematic situation can occur if the shutdown happens to cause a race between an active transaction that has invalidated a particular buffer and an I/O error on a log buffer that contains the bli associated with the same (now stale) buffer. Both transaction and log contexts acquire a bli reference. If the transaction has already invalidated the buffer by the time the I/O error occurs and ends up aborting due to shutdown, the transaction and log hold the last two references to a stale bli. If the transaction cancel occurs first, it treats the buffer as non-stale due to the aborted state: the bli reference is dropped and the buffer is released/unlocked. The log buffer I/O error handling eventually calls into xfs_buf_item_unpin(), drops the final reference to the bli and treats it as stale. The buffer wasn't left locked by xfs_buf_item_unlock(), however, so the assert fails and the buffer is double unlocked. The latter problem is mitigated by the fact that the fs is shutdown and no further damage is possible. ->iop_unlock() of an invalidated buffer should behave consistently with respect to the bli refcount, regardless of aborted state. If the refcount remains elevated on commit, we know the bli is awaiting an unpin (since it can't be in another transaction) and will be handled appropriately on log buffer completion. If the final bli reference of an invalidated buffer is dropped in ->iop_unlock(), we can assume the transaction has aborted because invalidation implies a dirty transaction. In the non-abort case, the log would have acquired a bli reference in ->iop_pin() and prevented bli release at ->iop_unlock() time. In the abort case the item must be freed and buffer unlocked because it wasn't pinned by the log. Rework xfs_buf_item_unlock() to simplify the currently circuitous and duplicate logic and leave invalidated buffers locked based on bli refcount, regardless of aborted state. This ensures that a pinned, stale buffer is always found locked when eventually unpinned. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit d5a2e2893da0d62c3888c91ae2da798adc17a9b9 Author: Brian Foster Date: Sat Sep 29 13:41:58 2018 +1000 xfs: remove last of unnecessary xfs_defer_cancel() callers Now that deferred operations are completely managed via transactions, it's no longer necessary to cancel the dfops in error paths that already cancel the associated transaction. There are a few such calls lingering throughout the codebase. Remove all remaining unnecessary calls to xfs_defer_cancel(). This leaves xfs_defer_cancel() calls in two places. The first is the call in the transaction cancel path itself, which facilitates this patch. The second is made via the xfs_defer_finish() error path to provide consistent error semantics with transaction commit. For example, xfs_trans_commit() expects an xfs_defer_finish() failure to clean up the dfops structure before it returns. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit ae29478766f4c8e16edca6fe1e25d73c47991ebe Author: Darrick J. Wong Date: Sat Sep 29 13:40:40 2018 +1000 xfs: don't crash the vfs on a garbage inline symlink The VFS routine that calls ->get_link blindly copies whatever's returned into the user's buffer. If we return a NULL pointer, the vfs will crash on the null pointer. Therefore, return -EFSCORRUPTED instead of blowing up the kernel. [dgc: clean up with hch's suggestions] Reported-by: wen.xu@gatech.edu Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit e704966c45e48d0220d1ee5e463034ae493a95b2 Merge: 2f19e7a7e63a 4fef1250eafd Author: Greg Kroah-Hartman Date: Fri Sep 28 18:04:50 2018 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Dmitry writes: "Input updates for v4.19-rc5 Just a few driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: uinput - allow for max == min during input_absinfo validation Input: elantech - enable middle button of touchpad on ThinkPad P72 Input: atakbd - fix Atari CapsLock behaviour Input: atakbd - fix Atari keymap Input: egalax_ts - add system wakeup support Input: gpio-keys - fix a documentation index issue commit 2f19e7a7e63a04f4bbaf327d9d0e69ac800b2b8f Merge: 8f0566118e2d c949a8e8b43f Author: Greg Kroah-Hartman Date: Fri Sep 28 18:04:06 2018 -0700 Merge tag 'spi-fix-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Mark writes: "spi: Fixes for v4.19 Quite a few fixes for the Renesas drivers in here, plus a fix for the Tegra driver and some documentation fixes for the recently added spi-mem code. The Tegra fix is relatively large but fairly straightforward and mechanical, it runs on probe so it's been reasonably well covered in -next testing." * tag 'spi-fix-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-mem: Move the DMA-able constraint doc to the kerneldoc header spi: spi-mem: Add missing description for data.nbytes field spi: rspi: Fix interrupted DMA transfers spi: rspi: Fix invalid SPI use during system suspend spi: sh-msiof: Fix handling of write value for SISTR register spi: sh-msiof: Fix invalid SPI use during system suspend spi: gpio: Fix copy-and-paste error spi: tegra20-slink: explicitly enable/disable clock commit 8f0566118e2def0bb8e05de8b19942e9e8111c9a Merge: f005de0183de fb6de923ca33 Author: Greg Kroah-Hartman Date: Fri Sep 28 18:02:25 2018 -0700 Merge tag 'regulator-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Mark writes: "regulator: Fixes for 4.19 A collection of fairly minor bug fixes here, a couple of driver specific ones plus two core fixes. There's one fix for the new suspend state code which fixes some confusion with constant values that are supposed to indicate noop operation and another fixing a race condition with the creation of sysfs files on new regulators." * tag 'regulator-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: fix crash caused by null driver data regulator: Fix 'do-nothing' value for regulators without suspend state regulator: da9063: fix DT probing with constraints regulator: bd71837: Disable voltage monitoring for LDO3/4 commit f005de0183de4c3df509f7a437a04774461f4c02 Merge: 900915f9036f 7e0cf1c983b5 Author: Greg Kroah-Hartman Date: Fri Sep 28 17:43:32 2018 -0700 Merge tag 'powerpc-4.19-3' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Michael writes: "powerpc fixes for 4.19 #3 A reasonably big batch of fixes due to me being away for a few weeks. A fix for the TM emulation support on Power9, which could result in corrupting the guest r11 when running under KVM. Two fixes to the TM code which could lead to userspace GPR corruption if we take an SLB miss at exactly the wrong time. Our dynamic patching code had a bug that meant we could patch freed __init text, which could lead to corrupting userspace memory. csum_ipv6_magic() didn't work on little endian platforms since we optimised it recently. A fix for an endian bug when reading a device tree property telling us how many storage keys the machine has available. Fix a crash seen on some configurations of PowerVM when migrating the partition from one machine to another. A fix for a regression in the setup of our CPU to NUMA node mapping in KVM guests. A fix to our selftest Makefiles to make them work since a recent change to the shared Makefile logic." * tag 'powerpc-4.19-3' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: selftests/powerpc: Fix Makefiles for headers_install change powerpc/numa: Use associativity if VPHN hcall is successful powerpc/tm: Avoid possible userspace r1 corruption on reclaim powerpc/tm: Fix userspace r13 corruption powerpc/pseries: Fix unitialized timer reset on migration powerpc/pkeys: Fix reading of ibm, processor-storage-keys property powerpc: fix csum_ipv6_magic() on little endian platforms powerpc/powernv/ioda2: Reduce upper limit for DMA window size (again) powerpc: Avoid code patching freed init sections KVM: PPC: Book3S HV: Fix guest r11 corruption with POWER9 TM workarounds commit 900915f9036fbf029d899432af96d39fcaaa7b54 Merge: f151f57bfd97 72923e5488f0 Author: Greg Kroah-Hartman Date: Fri Sep 28 17:42:44 2018 -0700 Merge tag 'pinctrl-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Linus writes: "Pin control fixes for v4.19: - Fixes to x86 hardware: - AMD interrupt debounce issues - Faulty Intel cannonlake register offset - Revert pin translation IRQ locking" * tag 'pinctrl-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: Revert "pinctrl: intel: Do pin translation when lock IRQ" pinctrl: cannonlake: Fix HOSTSW_OWN register offset of H variant pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type commit 573bcd380921b5216b62dcd072ec426f5ecbeb9d Author: Bjorn Helgaas Date: Fri Sep 28 17:34:21 2018 -0500 MAINTAINERS: Remove obsolete drivers/pci pattern from ACPI section Prior to 256a45937093 ("PCI/AER: Squash aerdrv_acpi.c into aerdrv.c"), drivers/pci/pcie/aer/aerdrv_acpi.c contained code to parse the ACPI HEST table. That code now lives in drivers/pci/pcie/aer.c. Remove the "F: drivers/pci/*/*/*acpi*" pattern because it matches nothing. We could add a "F: drivers/pci/pcie/aer.c" pattern to the ACPI APEI section, but that file sees a lot of changes, almost none of which are of interest to the ACPI folks. Signed-off-by: Bjorn Helgaas Acked-by: Rafael J. Wysocki commit befb1b3c2703897c5b8ffb0044dc5d0e5f27c5d7 Author: Reinette Chatre Date: Wed Sep 19 10:29:06 2018 -0700 perf/core: Add sanity check to deal with pinned event failure It is possible that a failure can occur during the scheduling of a pinned event. The initial portion of perf_event_read_local() contains the various error checks an event should pass before it can be considered valid. Ensure that the potential scheduling failure of a pinned event is checked for and have a credible error. Suggested-by: Peter Zijlstra Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: acme@kernel.org Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/6486385d1f30336e9973b24c8c65f5079543d3d3.1537377064.git.reinette.chatre@intel.com commit 951d223c6c16ed5d2a71a4d1f13c1e65d6882156 Author: Paul Burton Date: Thu Sep 27 22:59:18 2018 +0000 MIPS: Fix CONFIG_CMDLINE handling Commit 8ce355cf2e38 ("MIPS: Setup boot_command_line before plat_mem_setup") fixed a problem for systems which have CONFIG_CMDLINE_BOOL=y & use a DT with a chosen node that has either no bootargs property or an empty one. In this configuration early_init_dt_scan_chosen() copies CONFIG_CMDLINE into boot_command_line, but the MIPS code doesn't know this so it appends CONFIG_CMDLINE (via builtin_cmdline) to boot_command_line again. The result is that boot_command_line contains the arguments from CONFIG_CMDLINE twice. That commit took the approach of simply setting up boot_command_line from the MIPS code before early_init_dt_scan_chosen() runs, causing it not to copy CONFIG_CMDLINE to boot_command_line if a chosen node with no bootargs property is found. Unfortunately this is problematic for systems which do have a non-empty bootargs property & CONFIG_CMDLINE_BOOL=y. There early_init_dt_scan_chosen() will overwrite boot_command_line with the arguments from DT, which means we lose those from CONFIG_CMDLINE entirely. This breaks CONFIG_MIPS_CMDLINE_DTB_EXTEND. If we have CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER or CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND selected and the DT has a bootargs property which we should ignore, it will instead be honoured breaking those configurations too. Fix this by reverting commit 8ce355cf2e38 ("MIPS: Setup boot_command_line before plat_mem_setup") to restore the former behaviour, and fixing the CONFIG_CMDLINE duplication issue by initializing boot_command_line to a non-empty string that early_init_dt_scan_chosen() will not overwrite with CONFIG_CMDLINE. This is a little ugly, but cleanup in this area is on its way. In the meantime this is at least easy to backport & contains the ugliness within arch/mips/. Signed-off-by: Paul Burton Fixes: 8ce355cf2e38 ("MIPS: Setup boot_command_line before plat_mem_setup") References: https://patchwork.linux-mips.org/patch/18804/ Patchwork: https://patchwork.linux-mips.org/patch/20813/ Cc: Frank Rowand Cc: Jaedon Shin Cc: Mathieu Malaterre Cc: Rob Herring Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # v4.16+ commit ea7e0480a4b695d0aa6b3fa99bd658a003122113 Author: Paul Burton Date: Tue Sep 25 15:51:26 2018 -0700 MIPS: VDSO: Always map near top of user memory When using the legacy mmap layout, for example triggered using ulimit -s unlimited, get_unmapped_area() fills memory from bottom to top starting from a fairly low address near TASK_UNMAPPED_BASE. This placement is suboptimal if the user application wishes to allocate large amounts of heap memory using the brk syscall. With the VDSO being located low in the user's virtual address space, the amount of space available for access using brk is limited much more than it was prior to the introduction of the VDSO. For example: # ulimit -s unlimited; cat /proc/self/maps 00400000-004ec000 r-xp 00000000 08:00 71436 /usr/bin/coreutils 004fc000-004fd000 rwxp 000ec000 08:00 71436 /usr/bin/coreutils 004fd000-0050f000 rwxp 00000000 00:00 0 00cc3000-00ce4000 rwxp 00000000 00:00 0 [heap] 2ab96000-2ab98000 r--p 00000000 00:00 0 [vvar] 2ab98000-2ab99000 r-xp 00000000 00:00 0 [vdso] 2ab99000-2ab9d000 rwxp 00000000 00:00 0 ... Resolve this by adjusting STACK_TOP to reserve space for the VDSO & providing an address hint to get_unmapped_area() causing it to use this space even when using the legacy mmap layout. We reserve enough space for the VDSO, plus 1MB or 256MB for 32 bit & 64 bit systems respectively within which we randomize the VDSO base address. Previously this randomization was taken care of by the mmap base address randomization performed by arch_mmap_rnd(). The 1MB & 256MB sizes are somewhat arbitrary but chosen such that we have some randomization without taking up too much of the user's virtual address space, which is often in short supply for 32 bit systems. With this the VDSO is always mapped at a high address, leaving lots of space for statically linked programs to make use of brk: # ulimit -s unlimited; cat /proc/self/maps 00400000-004ec000 r-xp 00000000 08:00 71436 /usr/bin/coreutils 004fc000-004fd000 rwxp 000ec000 08:00 71436 /usr/bin/coreutils 004fd000-0050f000 rwxp 00000000 00:00 0 00c28000-00c49000 rwxp 00000000 00:00 0 [heap] ... 7f67c000-7f69d000 rwxp 00000000 00:00 0 [stack] 7f7fc000-7f7fd000 rwxp 00000000 00:00 0 7fcf1000-7fcf3000 r--p 00000000 00:00 0 [vvar] 7fcf3000-7fcf4000 r-xp 00000000 00:00 0 [vdso] Signed-off-by: Paul Burton Reported-by: Huacai Chen Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") Cc: Huacai Chen Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # v4.4+ commit f13d1b48b95bdafce6f9ad2cccbb9a6494f5a049 Merge: 05c5e9ff22e3 0c3b9d1b37df Author: David S. Miller Date: Fri Sep 28 11:12:29 2018 -0700 Merge branch 'netpoll-second-round-of-fixes' Eric Dumazet says: ==================== netpoll: second round of fixes. As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture, showing one ksoftirqd eating all cycles can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. It seems that all networking drivers that do use NAPI for their TX completions, should not provide a ndo_poll_controller() : Most NAPI drivers have netpoll support already handled in core networking stack, since netpoll_poll_dev() uses poll_napi(dev) to iterate through registered NAPI contexts for a device. First patch is a fix in poll_one_napi(). Then following patches take care of ten drivers. ==================== Signed-off-by: David S. Miller commit 0c3b9d1b37df16ae6046a5a01f769bf3d21b838c Author: Eric Dumazet Date: Thu Sep 27 09:32:01 2018 -0700 ibmvnic: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. ibmvnic uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. ibmvnic_netpoll_controller() was completely wrong anyway, as it was scheduling NAPI to service RX queues (instead of TX), so I doubt netpoll ever worked on this driver. Signed-off-by: Eric Dumazet Cc: Thomas Falcon Cc: John Allen Signed-off-by: David S. Miller commit a4f570be654de779eaf626a79c4e0aa5a790505f Author: Eric Dumazet Date: Thu Sep 27 09:32:00 2018 -0700 sfc-falcon: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. sfc-falcon uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Solarflare linux maintainers Cc: Edward Cree Cc: Bert Kenward Acked-By: Bert Kenward Signed-off-by: David S. Miller commit 9447a10ff607debe5e30cc438fb56925a559b9d9 Author: Eric Dumazet Date: Thu Sep 27 09:31:59 2018 -0700 sfc: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. sfc uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Edward Cree Cc: Bert Kenward Cc: Solarflare linux maintainers Acked-By: Bert Kenward Signed-off-by: David S. Miller commit 21627982e4fff76a053f4d08d7fb56e532e08d52 Author: Eric Dumazet Date: Thu Sep 27 09:31:58 2018 -0700 net: ena: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. ena uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Netanel Belgazal Cc: Saeed Bishara Cc: Zorik Machulsky Signed-off-by: David S. Miller commit 3548fcf7d877c682c9a5a413c51929739192156d Author: Eric Dumazet Date: Thu Sep 27 09:31:57 2018 -0700 qlogic: netxen: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. netxen uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Manish Chopra Cc: Rahul Verma Signed-off-by: David S. Miller commit 81b059b2187d77b957bf85318dbd4f36d60555e3 Author: Eric Dumazet Date: Thu Sep 27 09:31:56 2018 -0700 qlcnic: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. qlcnic uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Harish Patil Cc: Manish Chopra Signed-off-by: David S. Miller commit 260dd2c3e2aeefbe78065f0737dceae1ceb1196a Author: Eric Dumazet Date: Thu Sep 27 09:31:55 2018 -0700 virtio_net: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. virto_net uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: "Michael S. Tsirkin" Cc: Jason Wang Signed-off-by: David S. Miller commit 4bd2c03be707253f1157bd759fdd6971e4f70403 Author: Eric Dumazet Date: Thu Sep 27 09:31:54 2018 -0700 net: hns: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. hns uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Yisen Zhuang Cc: Salil Mehta Signed-off-by: David S. Miller commit 226a2dd62c5d789088fcf7804fbe5613887870a5 Author: Eric Dumazet Date: Thu Sep 27 09:31:53 2018 -0700 ehea: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. ehea uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Douglas Miller Signed-off-by: David S. Miller commit e71fb423e0dea3c9f98f0101e965426edfe849cd Author: Eric Dumazet Date: Thu Sep 27 09:31:52 2018 -0700 hinic: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. hinic uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Note that hinic_netpoll() was incorrectly scheduling NAPI on both RX and TX queues. Signed-off-by: Eric Dumazet Cc: Aviad Krawczyk Signed-off-by: David S. Miller commit c24498c6827b71f80fecc9fb1b70a792053d41a9 Author: Eric Dumazet Date: Thu Sep 27 09:31:51 2018 -0700 netpoll: do not test NAPI_STATE_SCHED in poll_one_napi() Since we do no longer require NAPI drivers to provide an ndo_poll_controller(), napi_schedule() has not been done before poll_one_napi() invocation. So testing NAPI_STATE_SCHED is likely to cause early returns. While we are at it, remove outdated comment. Note to future bisections : This change might surface prior bugs in drivers. See commit 73f21c653f93 ("bnxt_en: Fix TX timeout during netpoll.") for one occurrence. Fixes: ac3d9dd034e5 ("netpoll: make ndo_poll_controller() optional") Signed-off-by: Eric Dumazet Tested-by: Song Liu Cc: Michael Chan Signed-off-by: David S. Miller commit 05c5e9ff22e33cb9706b20fd3cf33b802f7edbf6 Merge: 5f672090e44f 1222a1601488 Author: David S. Miller Date: Fri Sep 28 10:41:59 2018 -0700 Merge tag 'mac80211-for-davem-2018-09-27' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== More patches than I'd like perhaps, but each seems reasonable: * two new spectre-v1 mitigations in nl80211 * TX status fix in general, and mesh in particular * powersave vs. offchannel fix * regulatory initialization fix * fix for a queue hang due to a bad return value * allocate TXQs for active monitor interfaces, fixing my earlier patch to avoid unnecessary allocations where I missed this case needed them * fix TDLS data frames priority assignment * fix scan results processing to take into account duplicate channel numbers (over different operating classes, but we don't necessarily know the operating class) * various hwsim fixes for radio destruction and new radio announcement messages * remove an extraneous kernel-doc line ==================== Signed-off-by: David S. Miller commit 5f672090e44f4951084c5e1d6b0668a5fc422af8 Author: Sudarsana Reddy Kalluru Date: Thu Sep 27 04:12:10 2018 -0700 qed: Fix shmem structure inconsistency between driver and the mfw. The structure shared between driver and the management FW (mfw) differ in sizes. This would lead to issues when driver try to access the structure members which are not-aligned with the mfw copy e.g., data_ptr usage in the case of mfw_tlv request. Align the driver structure with mfw copy, add reserved field(s) to driver structure for the members not used by the driver. Fixes: dd006921d67f ("qed: Add MFW interfaces for TLV request support.) Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Michal Kalderon commit cb973127a793c5ade8102aa4ab7bb5e4b1e64190 Author: Sudarsana Reddy Kalluru Date: Wed Sep 26 21:57:03 2018 -0700 Update maintainers for bnx2/bnx2x/qlge/qlcnic drivers. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ameen Rahman Signed-off-by: David S. Miller commit ce7d17d6c607aa0d898f4712e75e27d319816b3b Author: Stephen Hemminger Date: Thu Sep 27 10:47:01 2018 +0200 MAINTAINERS: change bridge maintainers I haven't been doing reviews only but not active development on bridge code for several years. Roopa and Nikolay have been doing most of the new features and have agreed to take over as new co-maintainers. Signed-off-by: Stephen Hemminger Acked-by: Roopa Prabhu Acked-by: Nikolay Aleksandrov commit 26258cb3a1acc10f81ca439297e4b890815d9a71 Merge: d4ce58082f20 048a7f8b4ec0 Author: David S. Miller Date: Fri Sep 28 10:27:33 2018 -0700 Merge branch 's390-qeth-fixes' Julian Wiedmann says: ==================== s390/qeth: fixes 2019-09-26 please apply two qeth patches for -net. The first is a trivial cleanup required for patch #2 by Jean, which fixes a potential endless loop. ==================== Signed-off-by: David S. Miller commit 048a7f8b4ec085d5c56ad4a3bf450389a4aed5f9 Author: Jean Delvare Date: Wed Sep 26 18:07:10 2018 +0200 s390: qeth: Fix potential array overrun in cmd/rc lookup Functions qeth_get_ipa_msg and qeth_get_ipa_cmd_name are modifying the last member of global arrays without any locking that I can see. If two instances of either function are running at the same time, it could cause a race ultimately leading to an array overrun (the contents of the last entry of the array is the only guarantee that the loop will ever stop). Performing the lookups without modifying the arrays is admittedly slower (two comparisons per iteration instead of one) but these are operations which are rare (should only be needed in error cases or when debugging, not during successful operation) and it seems still less costly than introducing a mutex to protect the arrays in question. As a side bonus, it allows us to declare both arrays as const data. Signed-off-by: Jean Delvare Cc: Julian Wiedmann Cc: Ursula Braun Cc: Martin Schwidefsky Cc: Heiko Carstens Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 065a2cdcbdf8eb9aefb66e1a24b2d684b8b8852b Author: zhong jiang Date: Wed Sep 26 18:07:09 2018 +0200 s390: qeth_core_mpc: Use ARRAY_SIZE instead of reimplementing its function Use the common code ARRAY_SIZE macro instead of a private implementation. Reviewed-by: Jean Delvare Signed-off-by: zhong jiang Signed-off-by: Martin Schwidefsky Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit f151f57bfd97fb8c76bbef9e181ecba5dd750f2a Merge: ed1b3f4c4fc3 fcb1349a2af5 Author: Greg Kroah-Hartman Date: Fri Sep 28 18:55:17 2018 +0200 Merge tag 'drm-fixes-2018-09-28' of git://anongit.freedesktop.org/drm/drm Dave writes: "drm fixes for 4.19-rc6 Looks like a pretty normal week for graphics, core: syncobj fix, panel link regression revert amd: suspend/resume fixes, EDID emulation fix mali-dp: NV12 writeback and vblank reset fixes etnaviv: DMA setup fix" * tag 'drm-fixes-2018-09-28' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: Fix Edid emulation for linux drm/amd/display: Fix Vega10 lightup on S3 resume drm/amdgpu: Fix vce work queue was not cancelled when suspend Revert "drm/panel: Add device_link from panel device to DRM device" drm/syncobj: Don't leak fences when WAIT_FOR_SUBMIT is set drm/malidp: Fix writeback in NV12 drm: mali-dp: Call drm_crtc_vblank_reset on device init drm/etnaviv: add DMA configuration for etnaviv platform device commit ed1b3f4c4fc35babaa44246c711ab728dbc9721b Merge: 278e59a00741 57a489786de9 Author: Greg Kroah-Hartman Date: Fri Sep 28 18:53:22 2018 +0200 Merge tag 'riscv-for-linus-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux Palmer writes: "A Single RISC-V Update for 4.19-rc6 The Debian guys have been pushing on our port and found some unversioned symbols leaking into modules. This PR contains a single fix for that issue." * tag 'riscv-for-linus-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: RISC-V: include linux/ftrace.h in asm-prototypes.h commit 278e59a0074139e0437d5b5f641923fce64bcd4d Merge: ad0371482b1e f188b99f0b2d Author: Greg Kroah-Hartman Date: Fri Sep 28 18:20:41 2018 +0200 Merge tag 'pci-v4.19-fixes-2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Bjorn writes: "PCI fixes: - Fix ACPI hotplug issue that causes black screen crash at boot (Mika Westerberg) - Fix DesignWare "scheduling while atomic" issues (Jisheng Zhang) - Add PPC contacts to MAINTAINERS for PCI core error handling (Bjorn Helgaas) - Sort Mobiveil MAINTAINERS entry (Lorenzo Pieralisi)" * tag 'pci-v4.19-fixes-2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: ACPI / hotplug / PCI: Don't scan for non-hotplug bridges if slot is not bridge PCI: dwc: Fix scheduling while atomic issues MAINTAINERS: Move mobiveil PCI driver entry where it belongs MAINTAINERS: Update PPC contacts for PCI core error handling commit 1b09d9c232cdaea59fb50ac437d3921ed1f1eafb Author: Marek Szyprowski Date: Fri Sep 28 14:20:40 2018 +0200 mmc: slot-gpio: Fix debounce time to use miliseconds again The debounce value passed to mmc_gpiod_request_cd() function is in microseconds, but msecs_to_jiffies() requires the value to be in miliseconds to properly calculate the delay, so adjust the value stored in cd_debounce_delay_ms context entry. Fixes: 1d71926bbd59 ("mmc: core: Fix debounce time to use microseconds") Fixes: bfd694d5e21c ("mmc: core: Add tunable delay before detecting card after card is inserted") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Marek Szyprowski Reviewed-by: Linus Walleij Signed-off-by: Ulf Hansson commit 133424a207774d3d32a38d560c6469ed31c0472f Merge: 6c7678674014 bb830add192e Author: Jens Axboe Date: Fri Sep 28 09:41:40 2018 -0600 Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linus Pull NVMe fix from Christoph. * 'nvme-4.19' of git://git.infradead.org/nvme: nvme: properly propagate errors in nvme_mpath_init commit 6c7678674014b4552caf0e5aa0ca34078a377482 Author: Juergen Gross Date: Fri Sep 28 09:28:27 2018 +0200 xen/blkfront: correct purging of persistent grants Commit a46b53672b2c2e3770b38a4abf90d16364d2584b ("xen/blkfront: cleanup stale persistent grants") introduced a regression as purged persistent grants were not pu into the list of free grants again. Correct that. Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross Signed-off-by: Jens Axboe commit 15c206887603a452f13fbfde2db0f8830d37028c Author: Jens Axboe Date: Fri Sep 28 09:40:17 2018 -0600 Revert "xen/blkfront: When purging persistent grants, keep them in the buffer" Fix didn't work for all cases, reverting to add a (hopefully) better fix. This reverts commit f151ba989d149bbdfc90e5405724bbea094f9b17. Signed-off-by: Jens Axboe commit 4288ea006c73e37c2a4f60dfaef20dd167b8df31 Author: Roman Gushchin Date: Fri Sep 28 14:33:21 2018 +0100 bpf: harden flags check in cgroup_storage_update_elem() cgroup_storage_update_elem() shouldn't accept any flags argument values except BPF_ANY and BPF_EXIST to guarantee the backward compatibility, had a new flag value been added. Fixes: de9cbbaadba5 ("bpf: introduce cgroup storage maps") Signed-off-by: Roman Gushchin Reported-by: Daniel Borkmann Cc: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 40e4f26e6a14fc1496eabb8b0004a547303114e6 Author: Flavio Leitner Date: Thu Sep 27 19:36:28 2018 -0300 netfilter: xt_socket: check sk before checking for netns. Only check for the network namespace if the socket is available. Fixes: f564650106a6 ("netfilter: check if the socket netns is correct.") Reported-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Flavio Leitner Signed-off-by: Pablo Neira Ayuso commit 421c119f558761556afca6a62ad183bc2d8659e0 Author: Florian Westphal Date: Mon Sep 24 14:10:04 2018 +0200 netfilter: avoid erronous array bounds warning Unfortunately some versions of gcc emit following warning: $ make net/xfrm/xfrm_output.o linux/compiler.h:252:20: warning: array subscript is above array bounds [-Warray-bounds] hook_head = rcu_dereference(net->nf.hooks_arp[hook]); ^~~~~~~~~~~~~~~~~~~~~ xfrm_output_resume passes skb_dst(skb)->ops->family as its 'pf' arg so compiler can't know that we'll never access hooks_arp[]. (NFPROTO_IPV4 or NFPROTO_IPV6 are only possible cases). Avoid this by adding an explicit WARN_ON_ONCE() check. This patch has no effect if the family is a compile-time constant as gcc will remove the switch() construct entirely. Reported-by: David Ahern Signed-off-by: Florian Westphal Reviewed-by: David Ahern Signed-off-by: Pablo Neira Ayuso commit a13f814a67b12a2f29d1decf4b4f4e700658a517 Author: Taehee Yoo Date: Thu Aug 30 17:56:52 2018 +0900 netfilter: nft_set_rbtree: add missing rb_erase() in GC routine The nft_set_gc_batch_check() checks whether gc buffer is full. If gc buffer is full, gc buffer is released by the nft_set_gc_batch_complete() internally. In case of rbtree, the rb_erase() should be called before calling the nft_set_gc_batch_complete(). therefore the rb_erase() should be called before calling the nft_set_gc_batch_check() too. test commands: table ip filter { set set1 { type ipv4_addr; flags interval, timeout; gc-interval 10s; timeout 1s; elements = { 1-2, 3-4, 5-6, ... 10000-10001, } } } %nft -f test.nft splat looks like: [ 430.273885] kasan: GPF could be caused by NULL-ptr deref or user memory access [ 430.282158] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN PTI [ 430.283116] CPU: 1 PID: 190 Comm: kworker/1:2 Tainted: G B 4.18.0+ #7 [ 430.283116] Workqueue: events_power_efficient nft_rbtree_gc [nf_tables_set] [ 430.313559] RIP: 0010:rb_next+0x81/0x130 [ 430.313559] Code: 08 49 bd 00 00 00 00 00 fc ff df 48 bb 00 00 00 00 00 fc ff df 48 85 c0 75 05 eb 58 48 89 d4 [ 430.313559] RSP: 0018:ffff88010cdb7680 EFLAGS: 00010207 [ 430.313559] RAX: 0000000000b84854 RBX: dffffc0000000000 RCX: ffffffff83f01973 [ 430.313559] RDX: 000000000017090c RSI: 0000000000000008 RDI: 0000000000b84864 [ 430.313559] RBP: ffff8801060d4588 R08: fffffbfff09bc349 R09: fffffbfff09bc349 [ 430.313559] R10: 0000000000000001 R11: fffffbfff09bc348 R12: ffff880100f081a8 [ 430.313559] R13: dffffc0000000000 R14: ffff880100ff8688 R15: dffffc0000000000 [ 430.313559] FS: 0000000000000000(0000) GS:ffff88011b400000(0000) knlGS:0000000000000000 [ 430.313559] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 430.313559] CR2: 0000000001551008 CR3: 000000005dc16000 CR4: 00000000001006e0 [ 430.313559] Call Trace: [ 430.313559] nft_rbtree_gc+0x112/0x5c0 [nf_tables_set] [ 430.313559] process_one_work+0xc13/0x1ec0 [ 430.313559] ? _raw_spin_unlock_irq+0x29/0x40 [ 430.313559] ? pwq_dec_nr_in_flight+0x3c0/0x3c0 [ 430.313559] ? set_load_weight+0x270/0x270 [ 430.313559] ? __switch_to_asm+0x34/0x70 [ 430.313559] ? __switch_to_asm+0x40/0x70 [ 430.313559] ? __switch_to_asm+0x34/0x70 [ 430.313559] ? __switch_to_asm+0x34/0x70 [ 430.313559] ? __switch_to_asm+0x40/0x70 [ 430.313559] ? __switch_to_asm+0x34/0x70 [ 430.313559] ? __switch_to_asm+0x40/0x70 [ 430.313559] ? __switch_to_asm+0x34/0x70 [ 430.313559] ? __switch_to_asm+0x34/0x70 [ 430.313559] ? __switch_to_asm+0x40/0x70 [ 430.313559] ? __switch_to_asm+0x34/0x70 [ 430.313559] ? __schedule+0x6d3/0x1f50 [ 430.313559] ? find_held_lock+0x39/0x1c0 [ 430.313559] ? __sched_text_start+0x8/0x8 [ 430.313559] ? cyc2ns_read_end+0x10/0x10 [ 430.313559] ? save_trace+0x300/0x300 [ 430.313559] ? sched_clock_local+0xd4/0x140 [ 430.313559] ? find_held_lock+0x39/0x1c0 [ 430.313559] ? worker_thread+0x353/0x1120 [ 430.313559] ? worker_thread+0x353/0x1120 [ 430.313559] ? lock_contended+0xe70/0xe70 [ 430.313559] ? __lock_acquire+0x4500/0x4500 [ 430.535635] ? do_raw_spin_unlock+0xa5/0x330 [ 430.535635] ? do_raw_spin_trylock+0x101/0x1a0 [ 430.535635] ? do_raw_spin_lock+0x1f0/0x1f0 [ 430.535635] ? _raw_spin_lock_irq+0x10/0x70 [ 430.535635] worker_thread+0x15d/0x1120 [ ... ] Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support") Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit f334430316e7fd37c4821ebec627e27714bb5d76 Author: David Howells Date: Thu Sep 27 15:13:09 2018 +0100 rxrpc: Fix error distribution Fix error distribution by immediately delivering the errors to all the affected calls rather than deferring them to a worker thread. The problem with the latter is that retries and things can happen in the meantime when we want to stop that sooner. To this end: (1) Stop the error distributor from removing calls from the error_targets list so that peer->lock isn't needed to synchronise against other adds and removals. (2) Require the peer's error_targets list to be accessed with RCU, thereby avoiding the need to take peer->lock over distribution. (3) Don't attempt to affect a call's state if it is already marked complete. Signed-off-by: David Howells commit 37a675e768d7606fe8a53e0c459c9b53e121ac20 Author: David Howells Date: Thu Sep 27 15:13:09 2018 +0100 rxrpc: Fix transport sockopts to get IPv4 errors on an IPv6 socket It seems that enabling IPV6_RECVERR on an IPv6 socket doesn't also turn on IP_RECVERR, so neither local errors nor ICMP-transported remote errors from IPv4 peer addresses are returned to the AF_RXRPC protocol. Make the sockopt setting code in rxrpc_open_socket() fall through from the AF_INET6 case to the AF_INET case to turn on all the AF_INET options too in the AF_INET6 case. Fixes: f2aeed3a591f ("rxrpc: Fix error reception on AF_INET6 sockets") Signed-off-by: David Howells commit 0099dc589bfa7caf6f2608c4cbc1181cfee22b0c Author: David Howells Date: Thu Sep 27 15:13:09 2018 +0100 rxrpc: Make service call handling more robust Make the following changes to improve the robustness of the code that sets up a new service call: (1) Cache the rxrpc_sock struct obtained in rxrpc_data_ready() to do a service ID check and pass that along to rxrpc_new_incoming_call(). This means that I can remove the check from rxrpc_new_incoming_call() without the need to worry about the socket attached to the local endpoint getting replaced - which would invalidate the check. (2) Cache the rxrpc_peer struct, thereby allowing the peer search to be done once. The peer is passed to rxrpc_new_incoming_call(), thereby saving the need to repeat the search. This also reduces the possibility of rxrpc_publish_service_conn() BUG()'ing due to the detection of a duplicate connection, despite the initial search done by rxrpc_find_connection_rcu() having turned up nothing. This BUG() shouldn't ever get hit since rxrpc_data_ready() *should* be non-reentrant and the result of the initial search should still hold true, but it has proven possible to hit. I *think* this may be due to __rxrpc_lookup_peer_rcu() cutting short the iteration over the hash table if it finds a matching peer with a zero usage count, but I don't know for sure since it's only ever been hit once that I know of. Another possibility is that a bug in rxrpc_data_ready() that checked the wrong byte in the header for the RXRPC_CLIENT_INITIATED flag might've let through a packet that caused a spurious and invalid call to be set up. That is addressed in another patch. (3) Fix __rxrpc_lookup_peer_rcu() to skip peer records that have a zero usage count rather than stopping and returning not found, just in case there's another peer record behind it in the bucket. (4) Don't search the peer records in rxrpc_alloc_incoming_call(), but rather either use the peer cached in (2) or, if one wasn't found, preemptively install a new one. Fixes: 8496af50eb38 ("rxrpc: Use RCU to access a peer's service connection tree") Signed-off-by: David Howells commit 403fc2a138457f1071b186786a7589ef7382c8bc Author: David Howells Date: Thu Sep 27 15:13:08 2018 +0100 rxrpc: Improve up-front incoming packet checking Do more up-front checking on incoming packets to weed out invalid ones and also ones aimed at services that we don't support. Whilst we're at it, replace the clearing of call and skew if we don't find a connection with just initialising the variables to zero at the top of the function. Signed-off-by: David Howells commit ece64fec164f523bfbe874abdef2a0e6ff376251 Author: David Howells Date: Thu Sep 27 15:13:08 2018 +0100 rxrpc: Emit BUSY packets when supposed to rather than ABORTs In the input path, a received sk_buff can be marked for rejection by setting RXRPC_SKB_MARK_* in skb->mark and, if needed, some auxiliary data (such as an abort code) in skb->priority. The rejection is handled by queueing the sk_buff up for dealing with in process context. The output code reads the mark and priority and, theoretically, generates an appropriate response packet. However, if RXRPC_SKB_MARK_BUSY is set, this isn't noticed and an ABORT message with a random abort code is generated (since skb->priority wasn't set to anything). Fix this by outputting the appropriate sort of packet. Also, whilst we're at it, most of the marks are no longer used, so remove them and rename the remaining two to something more obvious. Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") Signed-off-by: David Howells commit b604dd9883f783a94020d772e4fe03160f455372 Author: David Howells Date: Thu Sep 27 15:13:08 2018 +0100 rxrpc: Fix RTT gathering Fix RTT information gathering in AF_RXRPC by the following means: (1) Enable Rx timestamping on the transport socket with SO_TIMESTAMPNS. (2) If the sk_buff doesn't have a timestamp set when rxrpc_data_ready() collects it, set it at that point. (3) Allow ACKs to be requested on the last packet of a client call, but not a service call. We need to be careful lest we undo: bf7d620abf22c321208a4da4f435e7af52551a21 Author: David Howells Date: Thu Oct 6 08:11:51 2016 +0100 rxrpc: Don't request an ACK on the last DATA packet of a call's Tx phase but that only really applies to service calls that we're handling, since the client side gets to send the final ACK (or not). (4) When about to transmit an ACK or DATA packet, record the Tx timestamp before only; don't update the timestamp afterwards. (5) Switch the ordering between recording the serial and recording the timestamp to always set the serial number first. The serial number shouldn't be seen referenced by an ACK packet until we've transmitted the packet bearing it - so in the Rx path, we don't need the timestamp until we've checked the serial number. Fixes: cf1a6474f807 ("rxrpc: Add per-peer RTT tracker") Signed-off-by: David Howells commit dc71db34e4f3c06b8277c8f3c2ff014610607a8c Author: David Howells Date: Thu Sep 27 15:13:08 2018 +0100 rxrpc: Fix checks as to whether we should set up a new call There's a check in rxrpc_data_ready() that's checking the CLIENT_INITIATED flag in the packet type field rather than in the packet flags field. Fix this by creating a pair of helper functions to check whether the packet is going to the client or to the server and use them generally. Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") Signed-off-by: David Howells commit 3cc5746e5ad7688e274e193fa71278d98aa52759 Author: Nilesh Javali Date: Thu Sep 27 05:15:35 2018 -0700 scsi: qedi: Initialize the stats mutex lock Fix kernel NULL pointer dereference, Call Trace: [] __mutex_lock_slowpath+0xa6/0x1d0 [] mutex_lock+0x1f/0x2f [] qedi_get_protocol_tlv_data+0x61/0x450 [qedi] [] ? map_vm_area+0x2e/0x40 [] ? __vmalloc_node_range+0x170/0x280 [] ? qed_mfw_process_tlv_req+0x27d/0xbd0 [qed] [] qed_mfw_fill_tlv_data+0x4b/0xb0 [qed] [] qed_mfw_process_tlv_req+0x299/0xbd0 [qed] [] ? __switch_to+0xce/0x580 [] qed_slowpath_task+0x5b/0x80 [qed] Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 7e0cf1c983b5b24426d130fd949a055d520acc9a Author: Michael Ellerman Date: Fri Sep 28 14:53:18 2018 +1000 selftests/powerpc: Fix Makefiles for headers_install change Commit b2d35fa5fc80 ("selftests: add headers_install to lib.mk") introduced a requirement that Makefiles more than one level below the selftests directory need to define top_srcdir, but it didn't update any of the powerpc Makefiles. This broke building all the powerpc selftests with eg: make[1]: Entering directory '/src/linux/tools/testing/selftests/powerpc' BUILD_TARGET=/src/linux/tools/testing/selftests/powerpc/alignment; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C alignment all make[2]: Entering directory '/src/linux/tools/testing/selftests/powerpc/alignment' ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory make[2]: *** No rule to make target '../../../../scripts/subarch.include'. make[2]: Failed to remake makefile '../../../../scripts/subarch.include'. Makefile:38: recipe for target 'alignment' failed Fix it by setting top_srcdir in the affected Makefiles. Fixes: b2d35fa5fc80 ("selftests: add headers_install to lib.mk") Signed-off-by: Michael Ellerman commit ba439a6cbfa2936a6713f64cb499de7943673fe3 Author: Waiman Long Date: Sat Sep 22 20:41:55 2018 -0400 crypto: qat - Fix KASAN stack-out-of-bounds bug in adf_probe() The following KASAN warning was printed when booting a 64-bit kernel on some systems with Intel CPUs: [ 44.512826] ================================================================== [ 44.520165] BUG: KASAN: stack-out-of-bounds in find_first_bit+0xb0/0xc0 [ 44.526786] Read of size 8 at addr ffff88041e02fc50 by task kworker/0:2/124 [ 44.535253] CPU: 0 PID: 124 Comm: kworker/0:2 Tainted: G X --------- --- 4.18.0-12.el8.x86_64+debug #1 [ 44.545858] Hardware name: Intel Corporation PURLEY/PURLEY, BIOS BKVDTRL1.86B.0005.D08.1712070559 12/07/2017 [ 44.555682] Workqueue: events work_for_cpu_fn [ 44.560043] Call Trace: [ 44.562502] dump_stack+0x9a/0xe9 [ 44.565832] print_address_description+0x65/0x22e [ 44.570683] ? find_first_bit+0xb0/0xc0 [ 44.570689] kasan_report.cold.6+0x92/0x19f [ 44.578726] find_first_bit+0xb0/0xc0 [ 44.578737] adf_probe+0x9eb/0x19a0 [qat_c62x] [ 44.578751] ? adf_remove+0x110/0x110 [qat_c62x] [ 44.591490] ? mark_held_locks+0xc8/0x140 [ 44.591498] ? _raw_spin_unlock+0x30/0x30 [ 44.591505] ? trace_hardirqs_on_caller+0x381/0x570 [ 44.604418] ? adf_remove+0x110/0x110 [qat_c62x] [ 44.604427] local_pci_probe+0xd4/0x180 [ 44.604432] ? pci_device_shutdown+0x110/0x110 [ 44.617386] work_for_cpu_fn+0x51/0xa0 [ 44.621145] process_one_work+0x8fe/0x16e0 [ 44.625263] ? pwq_dec_nr_in_flight+0x2d0/0x2d0 [ 44.629799] ? lock_acquire+0x14c/0x400 [ 44.633645] ? move_linked_works+0x12e/0x2a0 [ 44.637928] worker_thread+0x536/0xb50 [ 44.641690] ? __kthread_parkme+0xb6/0x180 [ 44.645796] ? process_one_work+0x16e0/0x16e0 [ 44.650160] kthread+0x30c/0x3d0 [ 44.653400] ? kthread_create_worker_on_cpu+0xc0/0xc0 [ 44.658457] ret_from_fork+0x3a/0x50 [ 44.663557] The buggy address belongs to the page: [ 44.668350] page:ffffea0010780bc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0 [ 44.676356] flags: 0x17ffffc0000000() [ 44.680023] raw: 0017ffffc0000000 ffffea0010780bc8 ffffea0010780bc8 0000000000000000 [ 44.687769] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 44.695510] page dumped because: kasan: bad access detected [ 44.702578] Memory state around the buggy address: [ 44.707372] ffff88041e02fb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 44.714593] ffff88041e02fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 44.721810] >ffff88041e02fc00: 00 00 00 00 00 00 f1 f1 f1 f1 04 f2 f2 f2 f2 f2 [ 44.729028] ^ [ 44.734864] ffff88041e02fc80: f2 f2 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 [ 44.742082] ffff88041e02fd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 44.749299] ================================================================== Looking into the code: int ret, bar_mask; : for_each_set_bit(bar_nr, (const unsigned long *)&bar_mask, It is casting a 32-bit integer pointer to a 64-bit unsigned long pointer. There are two problems here. First, the 32-bit pointer address may not be 64-bit aligned. Secondly, it is accessing an extra 4 bytes. This is fixed by changing the bar_mask type to unsigned long. Cc: Signed-off-by: Waiman Long Signed-off-by: Herbert Xu commit d80771c08363ad7fbf0f56f5301e7ca65065c582 Author: Leonard Crestez Date: Fri Sep 21 18:03:18 2018 +0300 crypto: mxs-dcp - Fix wait logic on chan threads When compiling with CONFIG_DEBUG_ATOMIC_SLEEP=y the mxs-dcp driver prints warnings such as: WARNING: CPU: 0 PID: 120 at kernel/sched/core.c:7736 __might_sleep+0x98/0x9c do not call blocking ops when !TASK_RUNNING; state=1 set at [<8081978c>] dcp_chan_thread_sha+0x3c/0x2ec The problem is that blocking ops will manipulate current->state themselves so it is not allowed to call them between set_current_state(TASK_INTERRUPTIBLE) and schedule(). Fix this by converting the per-chan mutex to a spinlock (it only protects tiny list ops anyway) and rearranging the wait logic so that callbacks are called current->state as TASK_RUNNING. Those callbacks will indeed call blocking ops themselves so this is required. Cc: Signed-off-by: Leonard Crestez Signed-off-by: Herbert Xu commit add92a817e60e308a419693413a38d9d1e663aff Author: Harsh Jain Date: Wed Sep 19 22:42:16 2018 +0530 crypto: chelsio - Fix memory corruption in DMA Mapped buffers. Update PCI Id in "cpl_rx_phys_dsgl" header. In case pci_chan_id and tx_chan_id are not derived from same queue, H/W can send request completion indication before completing DMA Transfer. Herbert, It would be good if fix can be merge to stable tree. For 4.14 kernel, It requires some update to avoid mege conficts. Cc: Signed-off-by: Harsh Jain Signed-off-by: Herbert Xu commit fcb1349a2af5a3c4a1d789bb5d1a9b3e582652a3 Merge: adba0e5493ab fbbdadf2faf1 Author: Dave Airlie Date: Fri Sep 28 09:30:11 2018 +1000 Merge branch 'drm-fixes-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes Just a few fixes for 4.19: - Couple of suspend/resume fixes - Fix EDID emulation with DC Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180927155418.2813-1-alexander.deucher@amd.com commit adba0e5493ab21fb5098bc1654aca6826036273c Merge: 576156bb01a6 d6a77ba0eb92 Author: Dave Airlie Date: Fri Sep 28 09:25:26 2018 +1000 Merge tag 'drm-misc-fixes-2018-09-27-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes - Revert adding device-link to panels - Don't leak fences in drm/syncobj Signed-off-by: Dave Airlie From: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180927152712.GA53076@art_vandelay commit 083874549fdfefa629dfa752785e20427dde1511 Author: Daniel Drake Date: Thu Sep 27 15:47:33 2018 -0500 PCI: Reprogram bridge prefetch registers on resume On 38+ Intel-based ASUS products, the NVIDIA GPU becomes unusable after S3 suspend/resume. The affected products include multiple generations of NVIDIA GPUs and Intel SoCs. After resume, nouveau logs many errors such as: fifo: fault 00 [READ] at 0000005555555000 engine 00 [GR] client 04 [HUB/FE] reason 4a [] on channel -1 [007fa91000 unknown] DRM: failed to idle channel 0 [DRM] Similarly, the NVIDIA proprietary driver also fails after resume (black screen, 100% CPU usage in Xorg process). We shipped a sample to NVIDIA for diagnosis, and their response indicated that it's a problem with the parent PCI bridge (on the Intel SoC), not the GPU. Runtime suspend/resume works fine, only S3 suspend is affected. We found a workaround: on resume, rewrite the Intel PCI bridge 'Prefetchable Base Upper 32 Bits' register (PCI_PREF_BASE_UPPER32). In the cases that I checked, this register has value 0 and we just have to rewrite that value. Linux already saves and restores PCI config space during suspend/resume, but this register was being skipped because upon resume, it already has value 0 (the correct, pre-suspend value). Intel appear to have previously acknowledged this behaviour and the requirement to rewrite this register: https://bugzilla.kernel.org/show_bug.cgi?id=116851#c23 Based on that, rewrite the prefetch register values even when that appears unnecessary. We have confirmed this solution on all the affected models we have in-hands (X542UQ, UX533FD, X530UN, V272UN). Additionally, this solves an issue where r8169 MSI-X interrupts were broken after S3 suspend/resume on ASUS X441UAR. This issue was recently worked around in commit 7bb05b85bc2d ("r8169: don't use MSI-X on RTL8106e"). It also fixes the same issue on RTL6186evl/8111evl on an Aimfor-tech laptop that we had not yet patched. I suspect it will also fix the issue that was worked around in commit 7c53a722459c ("r8169: don't use MSI-X on RTL8168g"). Thomas Martitz reports that this change also solves an issue where the AMD Radeon Polaris 10 GPU on the HP Zbook 14u G5 is unresponsive after S3 suspend/resume. Link: https://bugzilla.kernel.org/show_bug.cgi?id=201069 Signed-off-by: Daniel Drake Signed-off-by: Bjorn Helgaas Reviewed-by: Rafael J. Wysocki Reviewed-By: Peter Wu CC: stable@vger.kernel.org commit 853dc104e6a43cba9a7a87542bc6d8e3b74f0bc9 Author: Laurentiu Tudor Date: Wed Sep 26 16:22:30 2018 +0300 soc: fsl: qbman: add APIs to retrieve the probing status Add a couple of new APIs to check the probing status of qman and bman: 'int bman_is_probed()' and 'int qman_is_probed()'. They return the following values. * 1 if qman/bman were probed correctly * 0 if qman/bman were not yet probed * -1 if probing of qman/bman failed Drivers that use qman/bman driver services are required to use these APIs before calling any functions exported by qman or bman drivers or otherwise they will crash the kernel. The APIs will be used in the following couple of qbman portal patches and later in the series in the dpaa1 ethernet driver. Signed-off-by: Laurentiu Tudor Signed-off-by: Li Yang commit ad0371482b1ed599a0e9f8cce50e8499c7c1497b Merge: c127e59bee3e 5c5702e259dc Author: Greg Kroah-Hartman Date: Thu Sep 27 21:53:55 2018 +0200 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Jason writes: "Second RDMA rc pull request - Fix a long standing race bug when destroying comp_event file descriptors - srp, hfi1, bnxt_re: Various driver crashes from missing validation and other cases - Fixes for regressions in patches merged this window in the gid cache, devx, ucma and uapi." * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/core: Set right entry state before releasing reference IB/mlx5: Destroy the DEVX object upon error flow IB/uverbs: Free uapi on destroy RDMA/bnxt_re: Fix system crash during RDMA resource initialization IB/hfi1: Fix destroy_qp hang after a link down IB/hfi1: Fix context recovery when PBC has an UnsupportedVL IB/hfi1: Invalid user input can result in crash IB/hfi1: Fix SL array bounds check RDMA/uverbs: Fix validity check for modify QP IB/srp: Avoid that sg_reset -d ${srp_device} triggers an infinite loop ucma: fix a use-after-free in ucma_resolve_ip() RDMA/uverbs: Atomically flush and mark closed the comp event queue cxgb4: fix abort_req_rss6 struct commit c127e59bee3e26d8059683dcb919006b6a76e90c Merge: c307aaf3eb47 9e796c9db93b Author: Greg Kroah-Hartman Date: Thu Sep 27 21:16:24 2018 +0200 Merge tag 'for_v4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Jan writes: "an ext2 patch fixing fsync(2) for DAX mounts." * tag 'for_v4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2, dax: set ext2_dax_aops for dax files commit 587562d0c7cd6861f4f90a2eb811cccb1a376f5f Author: Ilya Dryomov Date: Wed Sep 26 14:35:50 2018 +0200 blk-mq: I/O and timer unplugs are inverted in blktrace trace_block_unplug() takes true for explicit unplugs and false for implicit unplugs. schedule() unplugs are implicit and should be reported as timer unplugs. While correct in the legacy code, this has been inverted in blk-mq since 4.11. Cc: stable@vger.kernel.org Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers") Reviewed-by: Omar Sandoval Signed-off-by: Ilya Dryomov Signed-off-by: Jens Axboe commit ff4ce2885af8f9e8e99864d78dbeb4673f089c76 Author: Milian Wolff Date: Wed Sep 26 15:52:05 2018 +0200 perf report: Don't try to map ip to invalid map Fixes a crash when the report encounters an address that could not be associated with an mmaped region: #0 0x00005555557bdc4a in callchain_srcline (ip=, sym=0x0, map=0x0) at util/machine.c:2329 #1 unwind_entry (entry=entry@entry=0x7fffffff9180, arg=arg@entry=0x7ffff5642498) at util/machine.c:2329 #2 0x00005555558370af in entry (arg=0x7ffff5642498, cb=0x5555557bdb50 , thread=, ip=18446744073709551615) at util/unwind-libunwind-local.c:586 #3 get_entries (ui=ui@entry=0x7fffffff9620, cb=0x5555557bdb50 , arg=0x7ffff5642498, max_stack=) at util/unwind-libunwind-local.c:703 #4 0x0000555555837192 in _unwind__get_entries (cb=, arg=, thread=, data=, max_stack=) at util/unwind-libunwind-local.c:725 #5 0x00005555557c310f in thread__resolve_callchain_unwind (max_stack=127, sample=0x7fffffff9830, evsel=0x555555c7b3b0, cursor=0x7ffff5642498, thread=0x555555c7f6f0) at util/machine.c:2351 #6 thread__resolve_callchain (thread=0x555555c7f6f0, cursor=0x7ffff5642498, evsel=0x555555c7b3b0, sample=0x7fffffff9830, parent=0x7fffffff97b8, root_al=0x7fffffff9750, max_stack=127) at util/machine.c:2378 #7 0x00005555557ba4ee in sample__resolve_callchain (sample=, cursor=, parent=parent@entry=0x7fffffff97b8, evsel=, al=al@entry=0x7fffffff9750, max_stack=) at util/callchain.c:1085 Signed-off-by: Milian Wolff Tested-by: Sandipan Das Acked-by: Jiri Olsa Cc: Jin Yao Cc: Namhyung Kim Fixes: 2a9d5050dc84 ("perf script: Show correct offsets for DWARF-based unwinding") Link: http://lkml.kernel.org/r/20180926135207.30263-1-milian.wolff@kdab.com Signed-off-by: Arnaldo Carvalho de Melo commit ce01a1575f45bf319e374592656441021a7f5823 Author: Mathieu Desnoyers Date: Thu Sep 27 14:39:19 2018 -0400 rseq/selftests: fix parametrized test with -fpie On x86-64, the parametrized selftest code for rseq crashes with a segmentation fault when compiled with -fpie. This happens when the param_test binary is loaded at an address beyond 32-bit on x86-64. The issue is caused by use of a 32-bit register to hold the address of the loop counter variable. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Acked-by: "Paul E . McKenney" Cc: # v4.18 Cc: Shuah Khan Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Andi Kleen Cc: linux-kselftest@vger.kernel.org Cc: "H . Peter Anvin" Cc: Chris Lameter Cc: Russell King Cc: Michael Kerrisk Cc: "Paul E . McKenney" Cc: Paul Turner Cc: Boqun Feng Cc: Josh Triplett Cc: Steven Rostedt Cc: Ben Maurer Cc: Andy Lutomirski Cc: Andrew Morton Cc: Linus Torvalds Signed-off-by: Shuah Khan (Samsung OSG) commit 3baafeffa48a12b3cec9a0b6d4049fba02d53cea Author: Pavel Machek Date: Tue Sep 25 16:56:53 2018 +0300 iwlwifi: 1000: set the TFD queue size .max_tfd_queue_size was ommited for 1000 card serries leading to oops in swiotlb. Fixes: 7b3e42ea2ead ("iwlwifi: support multiple tfd queue max sizes for different devices") Tested-by: Randy Dunlap Signed-off-by: Pavel Machek Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit f52afc93cd018fe6910133a05d44671192d1aeb0 Author: Jan Kara Date: Thu Sep 27 13:23:32 2018 +0200 dax: Fix deadlock in dax_lock_mapping_entry() When dax_lock_mapping_entry() has to sleep to obtain entry lock, it will fail to unlock mapping->i_pages spinlock and thus immediately deadlock against itself when retrying to grab the entry lock again. Fix the problem by unlocking mapping->i_pages before retrying. Fixes: c2a7d2a11552 ("filesystem-dax: Introduce dax_lock_mapping_entry()") Reported-by: Barret Rhoden Signed-off-by: Jan Kara Signed-off-by: Dan Williams commit bdec8d7fa55e6f5314ed72e5a0b435d90ff90548 Author: Kairui Song Date: Thu Sep 27 20:38:45 2018 +0800 x86/boot: Fix kexec booting failure in the SEV bit detection code Commit 1958b5fc4010 ("x86/boot: Add early boot support when running with SEV active") can occasionally cause system resets when kexec-ing a second kernel even if SEV is not active. That's because get_sev_encryption_bit() uses 32-bit rIP-relative addressing to read the value of enc_bit - a variable which caches a previously detected encryption bit position - but kexec may allocate the early boot code to a higher location, beyond the 32-bit addressing limit. In this case, garbage will be read and get_sev_encryption_bit() will return the wrong value, leading to accessing memory with the wrong encryption setting. Therefore, remove enc_bit, and thus get rid of the need to do 32-bit rIP-relative addressing in the first place. [ bp: massage commit message heavily. ] Fixes: 1958b5fc4010 ("x86/boot: Add early boot support when running with SEV active") Suggested-by: Borislav Petkov Signed-off-by: Kairui Song Signed-off-by: Borislav Petkov Reviewed-by: Tom Lendacky Cc: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de Cc: mingo@redhat.com Cc: hpa@zytor.com Cc: brijesh.singh@amd.com Cc: kexec@lists.infradead.org Cc: dyoung@redhat.com Cc: bhe@redhat.com Cc: ghook@redhat.com Link: https://lkml.kernel.org/r/20180927123845.32052-1-kasong@redhat.com commit 0f843e65d9eef4936929bb036c5f771fb261eea4 Author: Guoju Fang Date: Thu Sep 27 23:41:46 2018 +0800 bcache: add separate workqueue for journal_write to avoid deadlock After write SSD completed, bcache schedules journal_write work to system_wq, which is a public workqueue in system, without WQ_MEM_RECLAIM flag. system_wq is also a bound wq, and there may be no idle kworker on current processor. Creating a new kworker may unfortunately need to reclaim memory first, by shrinking cache and slab used by vfs, which depends on bcache device. That's a deadlock. This patch create a new workqueue for journal_write with WQ_MEM_RECLAIM flag. It's rescuer thread will work to avoid the deadlock. Signed-off-by: Guoju Fang Cc: stable@vger.kernel.org Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit d6d1cd2578c4da0764ad334e3411c1c1b1557f58 Author: Xue Liu Date: Fri Aug 31 23:46:41 2018 +0200 ieee802154: mcr20a: Replace magic number with constants The combination of defined constants are used to present the state of IRQ so the magic numbers has been replaced. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: Xue Liu Signed-off-by: Stefan Schmidt commit fbbdadf2faf17cd88e9c447701495540377c5743 Author: Bhawanpreet Lakha Date: Wed Sep 26 13:42:10 2018 -0400 drm/amd/display: Fix Edid emulation for linux [Why] EDID emulation didn't work properly for linux, as we stop programming if nothing is connected physically. [How] We get a flag from DRM when we want to do edid emulation. We check if this flag is true and nothing is connected physically, if so we only program the front end using VIRTUAL_SIGNAL. Signed-off-by: Bhawanpreet Lakha Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher commit 599760d6d0abbab71f9726b49858d2ec45e74c0a Author: Roman Li Date: Wed Sep 26 13:42:16 2018 -0400 drm/amd/display: Fix Vega10 lightup on S3 resume [Why] There have been a few reports of Vega10 display remaining blank after S3 resume. The regression is caused by workaround for mode change on Vega10 - skip set_bandwidth if stream count is 0. As a result we skipped dispclk reset on suspend, thus on resume we may skip the clock update assuming it hasn't been changed. On some systems it causes display blank or 'out of range'. [How] Revert "drm/amd/display: Fix Vega10 black screen after mode change" Verified that it hadn't cause mode change regression. Signed-off-by: Roman Li Reviewed-by: Sun peng Li Acked-by: Leo Li Signed-off-by: Alex Deucher commit 61ea6f5831974ebd1a57baffd7cc30600a2e26fc Author: Rex Zhu Date: Thu Sep 27 20:48:39 2018 +0800 drm/amdgpu: Fix vce work queue was not cancelled when suspend The vce cancel_delayed_work_sync never be called. driver call the function in error path. This caused the A+A suspend hang when runtime pm enebled. As we will visit the smu in the idle queue. this will cause smu hang because the dgpu has been suspend, and the dgpu also will be waked up. As the smu has been hang, so the dgpu resume will failed. Reviewed-by: Christian König Reviewed-by: Feifei Xu Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit d6a77ba0eb92d8ffa4b05a442fc20d0a9b11c4c4 Author: Linus Walleij Date: Thu Sep 27 14:41:30 2018 +0200 Revert "drm/panel: Add device_link from panel device to DRM device" This reverts commit 0c08754b59da5557532d946599854e6df28edc22. commit 0c08754b59da ("drm/panel: Add device_link from panel device to DRM device") creates a circular dependency under these circumstances: 1. The panel depends on dsi-host because it is MIPI-DSI child device. 2. dsi-host depends on the drm parent device (connector->dev->dev) this should be allowed. 3. drm parent dev (connector->dev->dev) depends on the panel after this patch. This makes the dependency circular and while it appears it does not affect any in-tree drivers (they do not seem to have dsi hosts depending on the same parent device) this does not seem right. As noted in a response from Andrzej Hajda, the intent is likely to make the panel dependent on the DRM device (connector->dev) not its parent. But we have no way of doing that since the DRM device doesn't contain any struct device on its own (arguably it should). Revert this until a proper approach is figured out. Cc: Jyri Sarha Cc: Eric Anholt Cc: Andrzej Hajda Signed-off-by: Linus Walleij Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180927124130.9102-1-linus.walleij@linaro.org commit 090bcfd5d1b631ef0f6f46de19ae5a8d0cbfd6a0 Merge: 864f893f31ee 52bf4a900d9c Author: Thomas Gleixner Date: Thu Sep 27 16:50:22 2018 +0200 Merge branch 'clockevents/4.19-fixes' of https://git.linaro.org/people/daniel.lezcano/linux into timers/urgent Pull another fix from Daniel Lezcano, which felt through the cracks: - Fix a potential memory leak reported by smatch in the atmel timer driver commit bf42daed6bd136774415ae6d26c8475152f92b54 Author: Eric Farman Date: Fri Sep 21 22:40:13 2018 +0200 s390/cio: Refactor alloc of ccw_io_region If I attach a vfio-ccw device to my guest, I get the following warning on the host when the host kernel is CONFIG_HARDENED_USERCOPY=y [250757.595325] Bad or missing usercopy whitelist? Kernel memory overwrite attempt detected to SLUB object 'dma-kmalloc-512' (offset 64, size 124)! [250757.595365] WARNING: CPU: 2 PID: 10958 at mm/usercopy.c:81 usercopy_warn+0xac/0xd8 [250757.595369] Modules linked in: kvm vhost_net vhost tap xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack libcrc32c devlink tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables sunrpc dm_multipath s390_trng crc32_vx_s390 ghash_s390 prng aes_s390 des_s390 des_generic sha512_s390 sha1_s390 eadm_sch tape_3590 tape tape_class qeth_l2 qeth ccwgroup vfio_ccw vfio_mdev zcrypt_cex4 mdev vfio_iommu_type1 zcrypt vfio sha256_s390 sha_common zfcp scsi_transport_fc qdio dasd_eckd_mod dasd_mod [250757.595424] CPU: 2 PID: 10958 Comm: CPU 2/KVM Not tainted 4.18.0-derp #2 [250757.595426] Hardware name: IBM 3906 M05 780 (LPAR) ...snip regs... [250757.595523] Call Trace: [250757.595529] ([<0000000000349210>] usercopy_warn+0xa8/0xd8) [250757.595535] [<000000000032daaa>] __check_heap_object+0xfa/0x160 [250757.595540] [<0000000000349396>] __check_object_size+0x156/0x1d0 [250757.595547] [<000003ff80332d04>] vfio_ccw_mdev_write+0x74/0x148 [vfio_ccw] [250757.595552] [<000000000034ed12>] __vfs_write+0x3a/0x188 [250757.595556] [<000000000034f040>] vfs_write+0xa8/0x1b8 [250757.595559] [<000000000034f4e6>] ksys_pwrite64+0x86/0xc0 [250757.595568] [<00000000008959a0>] system_call+0xdc/0x2b0 [250757.595570] Last Breaking-Event-Address: [250757.595573] [<0000000000349210>] usercopy_warn+0xa8/0xd8 While vfio_ccw_mdev_{write|read} validates that the input position/count does not run over the ccw_io_region struct, the usercopy code that does copy_{to|from}_user doesn't necessarily know this. It sees the variable length and gets worried that it's affecting a normal kmalloc'd struct, and generates the above warning. Adjust how the ccw_io_region is alloc'd with a whitelist to remove this warning. The boundary checking will continue to do its thing. Signed-off-by: Eric Farman Message-Id: <20180921204013.95804-3-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit c98e16b2fa1202dd8c66900823591cd110a1a213 Author: Eric Farman Date: Fri Sep 21 22:40:12 2018 +0200 s390/cio: Convert ccw_io_region to pointer In the event that we want to change the layout of the ccw_io_region in the future[1], it might be easier to work with it as a pointer within the vfio_ccw_private struct rather than an embedded struct. [1] https://patchwork.kernel.org/comment/22228541/ Signed-off-by: Eric Farman Message-Id: <20180921204013.95804-2-farman@linux.ibm.com> Signed-off-by: Cornelia Huck commit f151ba989d149bbdfc90e5405724bbea094f9b17 Author: Boris Ostrovsky Date: Sat Sep 22 15:55:49 2018 -0400 xen/blkfront: When purging persistent grants, keep them in the buffer Commit a46b53672b2c ("xen/blkfront: cleanup stale persistent grants") added support for purging persistent grants when they are not in use. As part of the purge, the grants were removed from the grant buffer, This eventually causes the buffer to become empty, with BUG_ON triggered in get_free_grant(). This can be observed even on an idle system, within 20-30 minutes. We should keep the grants in the buffer when purging, and only free the grant ref. Fixes: a46b53672b2c ("xen/blkfront: cleanup stale persistent grants") Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky Signed-off-by: Jens Axboe commit 092ffc51fb3f9b8369e737c9320bf0bffb2c898f Author: David Howells Date: Thu Sep 27 15:13:07 2018 +0100 rxrpc: Remove dup code from rxrpc_find_connection_rcu() rxrpc_find_connection_rcu() initialises variable k twice with the same information. Remove one of the initialisations. Signed-off-by: David Howells commit 659902db7008f233e3d514c774b5ff3d46c8edd8 Author: zhong jiang Date: Fri Sep 14 13:04:37 2018 +0800 ieee802154: ca8210: remove redundant condition check before debugfs_remove debugfs_remove has taken the IS_ERR into account. Just remove the unnecessary condition. Signed-off-by: zhong jiang Signed-off-by: Stefan Schmidt commit 52bf4a900d9cede3eb14982d0f2c5e6db6d97cc3 Author: Alexandre Belloni Date: Wed Apr 25 12:14:39 2018 +0200 clocksource/drivers/timer-atmel-pit: Properly handle error cases The smatch utility reports a possible leak: smatch warnings: drivers/clocksource/timer-atmel-pit.c:183 at91sam926x_pit_dt_init() warn: possible memory leak of 'data' Ensure data is freed before exiting with an error. Reported-by: Dan Carpenter Signed-off-by: Alexandre Belloni Cc: stable@vger.kernel.org Signed-off-by: Daniel Lezcano commit 1222a16014888ed9733c11e221730d4a8196222b Author: Masashi Honma Date: Tue Sep 25 11:15:01 2018 +0900 nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds Use array_index_nospec() to sanitize i with respect to speculation. Note that the user doesn't control i directly, but can make it out of bounds by not finding a threshold in the array. Signed-off-by: Masashi Honma [add note about user control, as explained by Masashi] Signed-off-by: Johannes Berg commit d4ce58082f206bf6e7d697380c7bc5480a8b0264 Author: Maciej Żenczykowski Date: Tue Sep 25 21:59:28 2018 -0700 net-tcp: /proc/sys/net/ipv4/tcp_probe_interval is a u32 not int (fix documentation and sysctl access to treat it as such) Tested: # zcat /proc/config.gz | egrep ^CONFIG_HZ CONFIG_HZ_1000=y CONFIG_HZ=1000 # echo $[(1<<32)/1000 + 1] | tee /proc/sys/net/ipv4/tcp_probe_interval 4294968 tee: /proc/sys/net/ipv4/tcp_probe_interval: Invalid argument # echo $[(1<<32)/1000] | tee /proc/sys/net/ipv4/tcp_probe_interval 4294967 # echo 0 | tee /proc/sys/net/ipv4/tcp_probe_interval # echo -1 | tee /proc/sys/net/ipv4/tcp_probe_interval -1 tee: /proc/sys/net/ipv4/tcp_probe_interval: Invalid argument Signed-off-by: Maciej Żenczykowski Signed-off-by: David S. Miller commit 73f21c653f930f438d53eed29b5e4c65c8a0f906 Author: Michael Chan Date: Wed Sep 26 00:41:04 2018 -0400 bnxt_en: Fix TX timeout during netpoll. The current netpoll implementation in the bnxt_en driver has problems that may miss TX completion events. bnxt_poll_work() in effect is only handling at most 1 TX packet before exiting. In addition, there may be in flight TX completions that ->poll() may miss even after we fix bnxt_poll_work() to handle all visible TX completions. netpoll may not call ->poll() again and HW may not generate IRQ because the driver does not ARM the IRQ when the budget (0 for netpoll) is reached. We fix it by handling all TX completions and to always ARM the IRQ when we exit ->poll() with 0 budget. Also, the logic to ACK the completion ring in case it is almost filled with TX completions need to be adjusted to take care of the 0 budget case, as discussed with Eric Dumazet Reported-by: Song Liu Reviewed-by: Song Liu Tested-by: Song Liu Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 8fd780698745ba121530c5c20fd237aacde4c371 Author: Hangbin Liu Date: Wed Sep 26 10:35:42 2018 +0800 vxlan: fill ttl inherit info When add vxlan ttl inherit support, I forgot to fill it when dump vlxan info. Fix it now. Fixes: 72f6d71e491e6 ("vxlan: add ttl inherit support") Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit 3e322474485931e7ea6e4c5560089991a7f03cbc Author: Andrew Lunn Date: Tue Sep 25 01:50:00 2018 +0200 net: phy: sfp: Fix unregistering of HWMON SFP device A HWMON device is only registered is the SFP module supports the diagnostic page and is complient to SFF8472. Don't unconditionally unregister the hwmon device when the SFP module is remove, otherwise we access data structures which don't exist. Reported-by: Florian Fainelli Fixes: 1323061a018a ("net: phy: sfp: Add HWMON support for module sensors") Signed-off-by: Andrew Lunn Tested-by: Florian Fainelli Signed-off-by: David S. Miller commit 77f2d753819b7d50c16abfb778caf1fe075faed0 Author: Nathan Chancellor Date: Mon Sep 24 14:42:12 2018 -0700 qed: Avoid implicit enum conversion in qed_iwarp_parse_rx_pkt Clang warns when one enumerated type is implicitly converted to another. drivers/net/ethernet/qlogic/qed/qed_iwarp.c:1713:25: warning: implicit conversion from enumeration type 'enum tcp_ip_version' to different enumeration type 'enum qed_tcp_ip_version' [-Wenum-conversion] cm_info->ip_version = TCP_IPV4; ~ ^~~~~~~~ drivers/net/ethernet/qlogic/qed/qed_iwarp.c:1733:25: warning: implicit conversion from enumeration type 'enum tcp_ip_version' to different enumeration type 'enum qed_tcp_ip_version' [-Wenum-conversion] cm_info->ip_version = TCP_IPV6; ~ ^~~~~~~~ 2 warnings generated. Use the appropriate values from the expected type, qed_tcp_ip_version: TCP_IPV4 = QED_TCP_IPV4 = 0 TCP_IPV6 = QED_TCP_IPV6 = 1 Link: https://github.com/ClangBuiltLinux/linux/issues/125 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit 1c492a9d55ba99079210ed901dd8a5423f980487 Author: Nathan Chancellor Date: Mon Sep 24 15:17:03 2018 -0700 qed: Avoid constant logical operation warning in qed_vf_pf_acquire Clang warns when a constant is used in a boolean context as it thinks a bitwise operation may have been intended. drivers/net/ethernet/qlogic/qed/qed_vf.c:415:27: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] if (!p_iov->b_pre_fp_hsi && ^ drivers/net/ethernet/qlogic/qed/qed_vf.c:415:27: note: use '&' for a bitwise operation if (!p_iov->b_pre_fp_hsi && ^~ & drivers/net/ethernet/qlogic/qed/qed_vf.c:415:27: note: remove constant to silence this warning if (!p_iov->b_pre_fp_hsi && ~^~ 1 warning generated. This has been here since commit 1fe614d10f45 ("qed: Relax VF firmware requirements") and I am not entirely sure why since 0 isn't a special case. Just remove the statement causing Clang to warn since it isn't required. Link: https://github.com/ClangBuiltLinux/linux/issues/126 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit d4859d749aa7090ffb743d15648adb962a1baeae Author: Mahesh Bandewar Date: Mon Sep 24 14:40:11 2018 -0700 bonding: avoid possible dead-lock Syzkaller reported this on a slightly older kernel but it's still applicable to the current kernel - ====================================================== WARNING: possible circular locking dependency detected 4.18.0-next-20180823+ #46 Not tainted ------------------------------------------------------ syz-executor4/26841 is trying to acquire lock: 00000000dd41ef48 ((wq_completion)bond_dev->name){+.+.}, at: flush_workqueue+0x2db/0x1e10 kernel/workqueue.c:2652 but task is already holding lock: 00000000768ab431 (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:77 [inline] 00000000768ab431 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x412/0xc30 net/core/rtnetlink.c:4708 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (rtnl_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0x171/0x1700 kernel/locking/mutex.c:1073 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1088 rtnl_lock+0x17/0x20 net/core/rtnetlink.c:77 bond_netdev_notify drivers/net/bonding/bond_main.c:1310 [inline] bond_netdev_notify_work+0x44/0xd0 drivers/net/bonding/bond_main.c:1320 process_one_work+0xc73/0x1aa0 kernel/workqueue.c:2153 worker_thread+0x189/0x13c0 kernel/workqueue.c:2296 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:415 -> #1 ((work_completion)(&(&nnw->work)->work)){+.+.}: process_one_work+0xc0b/0x1aa0 kernel/workqueue.c:2129 worker_thread+0x189/0x13c0 kernel/workqueue.c:2296 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:415 -> #0 ((wq_completion)bond_dev->name){+.+.}: lock_acquire+0x1e4/0x4f0 kernel/locking/lockdep.c:3901 flush_workqueue+0x30a/0x1e10 kernel/workqueue.c:2655 drain_workqueue+0x2a9/0x640 kernel/workqueue.c:2820 destroy_workqueue+0xc6/0x9d0 kernel/workqueue.c:4155 __alloc_workqueue_key+0xef9/0x1190 kernel/workqueue.c:4138 bond_init+0x269/0x940 drivers/net/bonding/bond_main.c:4734 register_netdevice+0x337/0x1100 net/core/dev.c:8410 bond_newlink+0x49/0xa0 drivers/net/bonding/bond_netlink.c:453 rtnl_newlink+0xef4/0x1d50 net/core/rtnetlink.c:3099 rtnetlink_rcv_msg+0x46e/0xc30 net/core/rtnetlink.c:4711 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2454 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4729 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x5a0/0x760 net/netlink/af_netlink.c:1343 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2115 __sys_sendmsg+0x11d/0x290 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2160 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: (wq_completion)bond_dev->name --> (work_completion)(&(&nnw->work)->work) --> rtnl_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock((work_completion)(&(&nnw->work)->work)); lock(rtnl_mutex); lock((wq_completion)bond_dev->name); *** DEADLOCK *** 1 lock held by syz-executor4/26841: stack backtrace: CPU: 1 PID: 26841 Comm: syz-executor4 Not tainted 4.18.0-next-20180823+ #46 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_circular_bug.isra.34.cold.55+0x1bd/0x27d kernel/locking/lockdep.c:1222 check_prev_add kernel/locking/lockdep.c:1862 [inline] check_prevs_add kernel/locking/lockdep.c:1975 [inline] validate_chain kernel/locking/lockdep.c:2416 [inline] __lock_acquire+0x3449/0x5020 kernel/locking/lockdep.c:3412 lock_acquire+0x1e4/0x4f0 kernel/locking/lockdep.c:3901 flush_workqueue+0x30a/0x1e10 kernel/workqueue.c:2655 drain_workqueue+0x2a9/0x640 kernel/workqueue.c:2820 destroy_workqueue+0xc6/0x9d0 kernel/workqueue.c:4155 __alloc_workqueue_key+0xef9/0x1190 kernel/workqueue.c:4138 bond_init+0x269/0x940 drivers/net/bonding/bond_main.c:4734 register_netdevice+0x337/0x1100 net/core/dev.c:8410 bond_newlink+0x49/0xa0 drivers/net/bonding/bond_netlink.c:453 rtnl_newlink+0xef4/0x1d50 net/core/rtnetlink.c:3099 rtnetlink_rcv_msg+0x46e/0xc30 net/core/rtnetlink.c:4711 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2454 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4729 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x5a0/0x760 net/netlink/af_netlink.c:1343 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2115 __sys_sendmsg+0x11d/0x290 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2160 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f2df20a5c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f2df20a66d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 0000000000930140 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004d40b8 R14: 00000000004c8ad8 R15: 0000000000000001 Signed-off-by: Mahesh Bandewar Signed-off-by: David S. Miller commit 6a9e461f6fe4434e6172304b69774daff9a3ac4c Author: Mahesh Bandewar Date: Mon Sep 24 14:39:42 2018 -0700 bonding: pass link-local packets to bonding master also. Commit b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on") changed the behavior of how link-local-multicast packets are processed. The change in the behavior broke some legacy use cases where these packets are expected to arrive on bonding master device also. This patch passes the packet to the stack with the link it arrived on as well as passes to the bonding-master device to preserve the legacy use case. Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on") Reported-by: Michal Soltys Signed-off-by: Mahesh Bandewar Signed-off-by: David S. Miller commit d3a315795b4ce8b105a64a90699103121bde04a8 Author: Nathan Chancellor Date: Mon Sep 24 14:34:53 2018 -0700 qed: Avoid implicit enum conversion in qed_roce_mode_to_flavor Clang warns when one enumerated type is implicitly converted to another. drivers/net/ethernet/qlogic/qed/qed_roce.c:153:12: warning: implicit conversion from enumeration type 'enum roce_mode' to different enumeration type 'enum roce_flavor' [-Wenum-conversion] flavor = ROCE_V2_IPV6; ~ ^~~~~~~~~~~~ drivers/net/ethernet/qlogic/qed/qed_roce.c:156:12: warning: implicit conversion from enumeration type 'enum roce_mode' to different enumeration type 'enum roce_flavor' [-Wenum-conversion] flavor = MAX_ROCE_MODE; ~ ^~~~~~~~~~~~~ 2 warnings generated. Use the appropriate values from the expected type, roce_flavor: ROCE_V2_IPV6 = RROCE_IPV6 = 2 MAX_ROCE_MODE = MAX_ROCE_FLAVOR = 3 While we're add it, ditch the local variable flavor, we can just return the value directly from the switch statement. Link: https://github.com/ClangBuiltLinux/linux/issues/125 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit db803f36e56f23b5a2266807e190d1dc11554d54 Author: Nathan Chancellor Date: Mon Sep 24 14:05:27 2018 -0700 qed: Fix mask parameter in qed_vf_prep_tunn_req_tlv Clang complains when one enumerated type is implicitly converted to another. drivers/net/ethernet/qlogic/qed/qed_vf.c:686:6: warning: implicit conversion from enumeration type 'enum qed_tunn_mode' to different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion] QED_MODE_L2GENEVE_TUNN, ^~~~~~~~~~~~~~~~~~~~~~ Update mask's parameter to expect qed_tunn_mode, which is what was intended. Link: https://github.com/ClangBuiltLinux/linux/issues/125 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit a898fba32229efd5e6b6154f83fa86a7145156b9 Author: Nathan Chancellor Date: Mon Sep 24 13:53:34 2018 -0700 qed: Avoid implicit enum conversion in qed_set_tunn_cls_info Clang warns when one enumerated type is implicitly converted to another. drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:163:25: warning: implicit conversion from enumeration type 'enum tunnel_clss' to different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion] p_tun->vxlan.tun_cls = type; ~ ^~~~ drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:165:26: warning: implicit conversion from enumeration type 'enum tunnel_clss' to different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion] p_tun->l2_gre.tun_cls = type; ~ ^~~~ drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:167:26: warning: implicit conversion from enumeration type 'enum tunnel_clss' to different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion] p_tun->ip_gre.tun_cls = type; ~ ^~~~ drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:169:29: warning: implicit conversion from enumeration type 'enum tunnel_clss' to different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion] p_tun->l2_geneve.tun_cls = type; ~ ^~~~ drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:171:29: warning: implicit conversion from enumeration type 'enum tunnel_clss' to different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion] p_tun->ip_geneve.tun_cls = type; ~ ^~~~ 5 warnings generated. Avoid this by changing type to an int. Link: https://github.com/ClangBuiltLinux/linux/issues/125 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit 079db3fd4ef164a59006425a988b1c73639fade8 Author: Colin Ian King Date: Mon Sep 24 18:39:51 2018 +0100 wimax/i2400m: fix spelling mistake "not unitialized" -> "uninitialized" Trivial fix to spelling mistake in ms_to_errno array of error messages and remove confusing "not" from the error text since the error code refers to an uninitialized error code. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 5a94df70d3878ae597dd8331ec0add491bdfe851 Author: Colin Ian King Date: Mon Sep 24 16:51:41 2018 +0100 qed: fix spelling mistake "toogle" -> "toggle" Trivial fix to spelling mistake in DP_VERBOSE message Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 30ed48719282aecf6728f6777fefe8440bf6ed5a Merge: d31d1d03aa90 93f41e67dc8f Author: David S. Miller Date: Wed Sep 26 20:04:11 2018 -0700 Merge branch 'net-phy-fix-WoL-handling-when-suspending-the-PHY' Heiner Kallweit says: ==================== net: phy: fix WoL handling when suspending the PHY phy_suspend doesn't always recognize that WoL is enabled and therefore suspends the PHY when it should not. First idea to address the issue was to reuse checks used in mdio_bus_phy_may_suspend which check whether relevant devices are wakeup-enabled. Florian raised some concerns because drivers may enable wakeup even if WoL isn't enabled (e.g. certain USB network drivers). The new approach focuses on reducing the risk to break existing stuff. We add a flag wol_enabled to struct net_device which is set in ethtool_set_wol(). Then this flag is checked in phy_suspend(). This doesn't cover 100% of the cases yet (e.g. if WoL is enabled w/o explicit configuration), but it covers the most relevant cases with very little risk of regressions. v2: - Fix a typo ==================== Signed-off-by: David S. Miller commit 93f41e67dc8ff0fd987120a6ef2717f21462c534 Author: Heiner Kallweit Date: Mon Sep 24 22:01:32 2018 +0200 net: phy: fix WoL handling when suspending the PHY Core of the problem is that phy_suspend() suspends the PHY when it should not because of WoL. phy_suspend() checks for WoL already, but this works only if the PHY driver handles WoL (what is rarely the case). Typically WoL is handled by the MAC driver. This patch uses new member wol_enabled of struct net_device as additional criteria in the check when not to suspend the PHY because of WoL. Last but not least change phy_detach() to call phy_suspend() before attached_dev is set to NULL. phy_suspend() accesses attached_dev when checking whether the MAC driver activated WoL. Fixes: f1e911d5d0df ("r8169: add basic phylib support") Fixes: e8cfd9d6c772 ("net: phy: call state machine synchronously in phy_stop") Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 6194114324139dc16f3251c67ed853bd6d4ae056 Author: Heiner Kallweit Date: Mon Sep 24 21:58:59 2018 +0200 net: core: add member wol_enabled to struct net_device Add flag wol_enabled to struct net_device indicating whether Wake-on-LAN is enabled. As first user phy_suspend() will use it to decide whether PHY can be suspended or not. Fixes: f1e911d5d0df ("r8169: add basic phylib support") Fixes: e8cfd9d6c772 ("net: phy: call state machine synchronously in phy_stop") Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit d31d1d03aa909aa6257d9d581eb0eb5d0ed366e2 Author: David S. Miller Date: Wed Sep 26 20:01:36 2018 -0700 Revert "net: phy: fix WoL handling when suspending the PHY" This reverts commit e0511f6c1ccdd153cf063764e93ac177a8553c5d. I commited the wrong version of these changes. Signed-off-by: David S. Miller commit e0511f6c1ccdd153cf063764e93ac177a8553c5d Author: Heiner Kallweit Date: Sun Sep 23 15:38:21 2018 +0200 net: phy: fix WoL handling when suspending the PHY Actually there's nothing wrong with the two changes marked as "Fixes", they just revealed a problem which has been existing before. After having switched r8169 to phylib it was reported that WoL from shutdown doesn't work any longer (WoL from suspend isn't affected). Reason is that during shutdown phy_disconnect()->phy_detach()-> phy_suspend() is called. A similar issue occurs when the phylib state machine calls phy_suspend() when handling state PHY_HALTED. Core of the problem is that phy_suspend() suspends the PHY when it should not due to WoL. phy_suspend() checks for WoL already, but this works only if the PHY driver handles WoL (what is rarely the case). Typically WoL is handled by the MAC driver. phylib knows about this and handles it in mdio_bus_phy_may_suspend(), but that's used only when suspending the system, not in other cases like shutdown. Therefore factor out the relevant check from mdio_bus_phy_may_suspend() to a new function phy_may_suspend() and use it in phy_suspend(). Last but not least change phy_detach() to call phy_suspend() before attached_dev is set to NULL. phy_suspend() accesses attached_dev when checking whether the MAC driver activated WoL. Fixes: f1e911d5d0df ("r8169: add basic phylib support") Fixes: e8cfd9d6c772 ("net: phy: call state machine synchronously in phy_stop") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 36f19d5b4f99fa9fa8263877e5f8e669d7fddc14 Author: David Ahern Date: Wed Sep 26 17:35:14 2018 -0700 net/ipv6: Remove extra call to ip6_convert_metrics for multipath case The change to move metrics from the dst to rt6_info moved the call to ip6_convert_metrics from ip6_route_add to ip6_route_info_create. In doing so it makes the call in ip6_route_info_append redundant and actually leaks the metrics installed as part of the ip6_route_info_create. Remove the now unnecessary call. Fixes: d4ead6b34b67f ("net/ipv6: move metrics from dst to rt6_info") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 854f31ccdd7964c9c2e68da234a3a8aedb51cf6b Author: Damien Le Moal Date: Thu Sep 27 10:55:13 2018 +0900 block: fix deadline elevator drain for zoned block devices When the deadline scheduler is used with a zoned block device, writes to a zone will be dispatched one at a time. This causes the warning message: deadline: forced dispatching is broken (nr_sorted=X), please report this to be displayed when switching to another elevator with the legacy I/O path while write requests to a zone are being retained in the scheduler queue. Prevent this message from being displayed when executing elv_drain_elevator() for a zoned block device. __blk_drain_queue() will loop until all writes are dispatched and completed, resulting in the desired elevator queue drain without extensive modifications to the deadline code itself to handle forced-dispatch calls. Signed-off-by: Damien Le Moal Fixes: 8dc8146f9c92 ("deadline-iosched: Introduce zone locking support") Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe commit 576156bb01a62c1f64b32b416593862bb34bddaa Merge: e89fe98bba86 89578d04b52c Author: Dave Airlie Date: Thu Sep 27 10:49:44 2018 +1000 Merge branch 'for-upstream/malidp-fixes' of git://linux-arm.org/linux-ld into drm-fixes Fix NV12 writeback and fix vblank reset. Signed-off-by: Dave Airlie From: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20180921112354.GR936@e110455-lin.cambridge.arm.com commit e89fe98bba86550c209ecaea44d6ece941f2fda4 Merge: 6bf4ca7fbc85 1a866306e0fb Author: Dave Airlie Date: Thu Sep 27 10:19:26 2018 +1000 Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux into drm-fixes one fix to get a proper DMA configuration in place for the etnaviv virtual device. I'm sending this as a fix, as a dma-mapping change at the ARC architecture side during the 4.19 cycle broke etnaviv on this platform, which gets remedied with this patch, but it also enables ARM64. Signed-off-by: Dave Airlie From: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/ea1f712bf09bf9439c6b092bf2c2bde7bb01cf5e.camel@pengutronix.de commit 1d71926bbd59facc4bdb6f13117d3a1aee8b83ba Author: Tony Lindgren Date: Tue Sep 18 16:16:56 2018 -0700 mmc: core: Fix debounce time to use microseconds The debounce value in device tree is in milliseconds but needs to be in microseconds for mmc_gpiod_request_cd(). Fixes: bfd694d5e21c ("mmc: core: Add tunable delay before detecting card after card is inserted") Cc: Shawn Lin Signed-off-by: Tony Lindgren Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Ulf Hansson commit f188b99f0b2d33794b4af8a225f95d1e968c0a3f Author: Mika Westerberg Date: Wed Sep 26 15:39:28 2018 -0500 ACPI / hotplug / PCI: Don't scan for non-hotplug bridges if slot is not bridge HP 6730b laptop has an ethernet NIC connected to one of the PCIe root ports. The root ports themselves are native PCIe hotplug capable. Now, during boot after PCI devices are scanned the BIOS triggers ACPI bus check directly to the NIC: ACPI: \_SB_.PCI0.RP06.NIC_: Bus check in hotplug_event() It is not clear why it is sending bus check but regardless the ACPI hotplug notify handler calls enable_slot() directly (instead of going through acpiphp_check_bridge() as there is no bridge), which ends up handling special case for non-hotplug bridges with native PCIe hotplug. This results a crash of some kind but the reporter only sees black screen so it is hard to figure out the exact spot and what actually happens. Based on a few fix proposals it was tracked to crash somewhere inside pci_assign_unassigned_bridge_resources(). In any case we should not really be in that special branch at all because the ACPI notify happened to a slot that is not a PCI bridge (it is just a regular PCI device). Fix this so that we only go to that special branch if we are calling enable_slot() for a bridge (e.g., the ACPI notification was for the bridge). Link: https://bugzilla.kernel.org/show_bug.cgi?id=201127 Fixes: 84c8b58ed3ad ("ACPI / hotplug / PCI: Don't scan bridges managed by native hotplug") Reported-by: Peter Anemone Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Rafael J. Wysocki CC: stable@vger.kernel.org # v4.18+ commit 7c968791f7753bf0e52a21729498509ea3dd751b Author: Gustavo A. R. Silva Date: Wed Sep 26 18:50:54 2018 +0200 video/fbdev/stifb: Fix spelling mistake in fall-through annotation Replace "fall though" with a proper "fall through" annotation. This fix is part of the ongoing efforts to enabling -Wimplicit-fallthrough Addresses-Coverity-ID: 402013 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Cc: "James E.J. Bottomley" Cc: Helge Deller Signed-off-by: Bartlomiej Zolnierkiewicz commit 676709b1bcb513c6acf0bb7698dffcc53c2a8970 Author: Adam Jackson Date: Wed Sep 26 18:11:23 2018 +0200 uvesafb: Fix URLs in the documentation Signed-off-by: Adam Jackson Reviewed-by: Randy Dunlap Signed-off-by: Bartlomiej Zolnierkiewicz commit cf7389b8095fabae076ef28b49dc3059b9eb899f Author: Hans de Goede Date: Wed Sep 26 18:11:22 2018 +0200 efifb: BGRT: Add nobgrt option In some setups restoring the BGRT logo is undesirable, allow passing video=efifb:nobgrt on the kernel commandline to disable it. Reported-by: David Herrmann Signed-off-by: Hans de Goede Reviewed-by: David Herrmann Signed-off-by: Bartlomiej Zolnierkiewicz commit 1bafcbf59fed92af58955024452f45430d3898c5 Author: Tomi Valkeinen Date: Wed Sep 26 18:11:22 2018 +0200 fbdev/omapfb: fix omapfb_memory_read infoleak OMAPFB_MEMORY_READ ioctl reads pixels from the LCD's memory and copies them to a userspace buffer. The code has two issues: - The user provided width and height could be large enough to overflow the calculations - The copy_to_user() can copy uninitialized memory to the userspace, which might contain sensitive kernel information. Fix these by limiting the width & height parameters, and only copying the amount of data that we actually received from the LCD. Signed-off-by: Tomi Valkeinen Reported-by: Jann Horn Cc: stable@vger.kernel.org Cc: security@kernel.org Cc: Will Deacon Cc: Jann Horn Cc: Tony Lindgren Signed-off-by: Bartlomiej Zolnierkiewicz commit d85536cde91fcfed6fb8d983783bd2b92c843939 Author: Lubomir Rintel Date: Wed Sep 26 18:11:22 2018 +0200 pxa168fb: prepare the clock Add missing prepare/unprepare operations for fbi->clk, this fixes following kernel warning: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:874 clk_core_enable+0x2c/0x1b0 Enabling unprepared disp0_clk Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-rc8-00032-g02b43ddd4f21-dirty #25 Hardware name: Marvell MMP2 (Device Tree Support) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (__warn+0xd8/0xf0) [] (__warn) from [] (warn_slowpath_fmt+0x44/0x6c) [] (warn_slowpath_fmt) from [] (clk_core_enable+0x2c/0x1b0) [] (clk_core_enable) from [] (clk_core_enable_lock+0x18/0x2c) [] (clk_core_enable_lock) from [] (pxa168fb_probe+0x464/0x6ac) [] (pxa168fb_probe) from [] (platform_drv_probe+0x48/0x94) [] (platform_drv_probe) from [] (driver_probe_device+0x328/0x470) [] (driver_probe_device) from [] (__driver_attach+0xb0/0x124) [] (__driver_attach) from [] (bus_for_each_dev+0x64/0xa0) [] (bus_for_each_dev) from [] (bus_add_driver+0x1b8/0x230) [] (bus_add_driver) from [] (driver_register+0xac/0xf0) [] (driver_register) from [] (do_one_initcall+0xb8/0x1f0) [] (do_one_initcall) from [] (kernel_init_freeable+0x294/0x2e0) [] (kernel_init_freeable) from [] (kernel_init+0x8/0x10c) [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) Exception stack(0xd008bfb0 to 0xd008bff8) bfa0: 00000000 00000000 00000000 00000000 bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace c0af40f9e2ed7cb4 ]--- Signed-off-by: Lubomir Rintel [b.zolnierkie: enhance patch description a bit] Signed-off-by: Bartlomiej Zolnierkiewicz commit 337fe9f5c1e7de1f391c6a692531379d2aa2ee11 Author: Jason Ekstrand Date: Wed Sep 26 02:17:03 2018 -0500 drm/syncobj: Don't leak fences when WAIT_FOR_SUBMIT is set We attempt to get fences earlier in the hopes that everything will already have fences and no callbacks will be needed. If we do succeed in getting a fence, getting one a second time will result in a duplicate ref with no unref. This is causing memory leaks in Vulkan applications that create a lot of fences; playing for a few hours can, apparently, bring down the system. Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107899 Reviewed-by: Chris Wilson Signed-off-by: Jason Ekstrand Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180926071703.15257-1-jason.ekstrand@intel.com commit aaccf3c97418f169afdbb5855e9cbcbda34e90fd Merge: f39684524b39 6bf4ca7fbc85 Author: Bartlomiej Zolnierkiewicz Date: Wed Sep 26 15:54:31 2018 +0200 Merge tag 'v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next Sync with upstream (which now contains fbdev-v4.19 changes) to prepare a base for fbdev-v4.20 changes. commit c307aaf3eb47969105887e4e8991ec00960a7ce8 Merge: a38523185b40 5ebb1bc2d63d Author: Greg Kroah-Hartman Date: Wed Sep 26 13:08:53 2018 +0200 Merge tag 'iommu-fixes-v4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Joerg writes: "IOMMU Fixes for Linux v4.19-rc5 Three fixes queued up: - Warning fix for Rockchip IOMMU where there were IRQ handlers for offlined hardware. - Fix for Intel VT-d because recent changes caused boot failures on some machines because it tried to allocate to much contiguous memory. - Fix for AMD IOMMU to handle eMMC devices correctly that appear as ACPI HID devices." * tag 'iommu-fixes-v4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/amd: Return devid as alias for ACPI HID devices iommu/vt-d: Handle memory shortage on pasid table allocation iommu/rockchip: Free irqs in shutdown handler commit cb28c306b93b71f2741ce1a5a66289db26715f4d Author: Matias Karhumaa Date: Wed Sep 26 09:13:46 2018 +0300 Bluetooth: SMP: fix crash in unpairing In case unpair_device() was called through mgmt interface at the same time when pairing was in progress, Bluetooth kernel module crash was seen. [ 600.351225] general protection fault: 0000 [#1] SMP PTI [ 600.351235] CPU: 1 PID: 11096 Comm: btmgmt Tainted: G OE 4.19.0-rc1+ #1 [ 600.351238] Hardware name: Dell Inc. Latitude E5440/08RCYC, BIOS A18 05/14/2017 [ 600.351272] RIP: 0010:smp_chan_destroy.isra.10+0xce/0x2c0 [bluetooth] [ 600.351276] Code: c0 0f 84 b4 01 00 00 80 78 28 04 0f 84 53 01 00 00 4d 85 ed 0f 85 ab 00 00 00 48 8b 08 48 8b 50 08 be 10 00 00 00 48 89 51 08 <48> 89 0a 48 b9 00 02 00 00 00 00 ad de 48 89 48 08 48 8b 83 00 01 [ 600.351279] RSP: 0018:ffffa9be839b3b50 EFLAGS: 00010246 [ 600.351282] RAX: ffff9c999ac565a0 RBX: ffff9c9996e98c00 RCX: ffff9c999aa28b60 [ 600.351285] RDX: dead000000000200 RSI: 0000000000000010 RDI: ffff9c999e403500 [ 600.351287] RBP: ffffa9be839b3b70 R08: 0000000000000000 R09: ffffffff92a25c00 [ 600.351290] R10: ffffa9be839b3ae8 R11: 0000000000000001 R12: ffff9c995375b800 [ 600.351292] R13: 0000000000000000 R14: ffff9c99619a5000 R15: ffff9c9962a01c00 [ 600.351295] FS: 00007fb2be27c700(0000) GS:ffff9c999e880000(0000) knlGS:0000000000000000 [ 600.351298] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 600.351300] CR2: 00007fb2bdadbad0 CR3: 000000041c328001 CR4: 00000000001606e0 [ 600.351302] Call Trace: [ 600.351325] smp_failure+0x4f/0x70 [bluetooth] [ 600.351345] smp_cancel_pairing+0x74/0x80 [bluetooth] [ 600.351370] unpair_device+0x1c1/0x330 [bluetooth] [ 600.351399] hci_sock_sendmsg+0x960/0x9f0 [bluetooth] [ 600.351409] ? apparmor_socket_sendmsg+0x1e/0x20 [ 600.351417] sock_sendmsg+0x3e/0x50 [ 600.351422] sock_write_iter+0x85/0xf0 [ 600.351429] do_iter_readv_writev+0x12b/0x1b0 [ 600.351434] do_iter_write+0x87/0x1a0 [ 600.351439] vfs_writev+0x98/0x110 [ 600.351443] ? ep_poll+0x16d/0x3d0 [ 600.351447] ? ep_modify+0x73/0x170 [ 600.351451] do_writev+0x61/0xf0 [ 600.351455] ? do_writev+0x61/0xf0 [ 600.351460] __x64_sys_writev+0x1c/0x20 [ 600.351465] do_syscall_64+0x5a/0x110 [ 600.351471] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 600.351474] RIP: 0033:0x7fb2bdb62fe0 [ 600.351477] Code: 73 01 c3 48 8b 0d b8 6e 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 69 c7 2c 00 00 75 10 b8 14 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 de 80 01 00 48 89 04 24 [ 600.351479] RSP: 002b:00007ffe062cb8f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 [ 600.351484] RAX: ffffffffffffffda RBX: 000000000255b3d0 RCX: 00007fb2bdb62fe0 [ 600.351487] RDX: 0000000000000001 RSI: 00007ffe062cb920 RDI: 0000000000000004 [ 600.351490] RBP: 00007ffe062cb920 R08: 000000000255bd80 R09: 0000000000000000 [ 600.351494] R10: 0000000000000353 R11: 0000000000000246 R12: 0000000000000001 [ 600.351497] R13: 00007ffe062cbbe0 R14: 0000000000000000 R15: 0000000000000000 [ 600.351501] Modules linked in: algif_hash algif_skcipher af_alg cmac ipt_MASQUERADE nf_conntrack_netlink nfnetlink xfrm_user xfrm_algo iptable_nat nf_nat_ipv4 xt_addrtype iptable_filter ip_tables xt_conntrack x_tables nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c br_netfilter bridge stp llc overlay arc4 nls_iso8859_1 dm_crypt intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp dell_laptop kvm_intel crct10dif_pclmul dell_smm_hwmon crc32_pclmul ghash_clmulni_intel pcbc aesni_intel aes_x86_64 crypto_simd cryptd glue_helper intel_cstate intel_rapl_perf uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev media hid_multitouch input_leds joydev serio_raw dell_wmi snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic dell_smbios dcdbas sparse_keymap [ 600.351569] snd_hda_intel btusb snd_hda_codec btrtl btbcm btintel snd_hda_core bluetooth(OE) snd_hwdep snd_pcm iwlmvm ecdh_generic wmi_bmof dell_wmi_descriptor snd_seq_midi mac80211 snd_seq_midi_event lpc_ich iwlwifi snd_rawmidi snd_seq snd_seq_device snd_timer cfg80211 snd soundcore mei_me mei dell_rbtn dell_smo8800 mac_hid parport_pc ppdev lp parport autofs4 hid_generic usbhid hid i915 nouveau kvmgt vfio_mdev mdev vfio_iommu_type1 vfio kvm irqbypass i2c_algo_bit ttm drm_kms_helper syscopyarea sysfillrect sysimgblt mxm_wmi psmouse ahci sdhci_pci cqhci libahci fb_sys_fops sdhci drm e1000e video wmi [ 600.351637] ---[ end trace e49e9f1df09c94fb ]--- [ 600.351664] RIP: 0010:smp_chan_destroy.isra.10+0xce/0x2c0 [bluetooth] [ 600.351666] Code: c0 0f 84 b4 01 00 00 80 78 28 04 0f 84 53 01 00 00 4d 85 ed 0f 85 ab 00 00 00 48 8b 08 48 8b 50 08 be 10 00 00 00 48 89 51 08 <48> 89 0a 48 b9 00 02 00 00 00 00 ad de 48 89 48 08 48 8b 83 00 01 [ 600.351669] RSP: 0018:ffffa9be839b3b50 EFLAGS: 00010246 [ 600.351672] RAX: ffff9c999ac565a0 RBX: ffff9c9996e98c00 RCX: ffff9c999aa28b60 [ 600.351674] RDX: dead000000000200 RSI: 0000000000000010 RDI: ffff9c999e403500 [ 600.351676] RBP: ffffa9be839b3b70 R08: 0000000000000000 R09: ffffffff92a25c00 [ 600.351679] R10: ffffa9be839b3ae8 R11: 0000000000000001 R12: ffff9c995375b800 [ 600.351681] R13: 0000000000000000 R14: ffff9c99619a5000 R15: ffff9c9962a01c00 [ 600.351684] FS: 00007fb2be27c700(0000) GS:ffff9c999e880000(0000) knlGS:0000000000000000 [ 600.351686] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 600.351689] CR2: 00007fb2bdadbad0 CR3: 000000041c328001 CR4: 00000000001606e0 Crash happened because list_del_rcu() was called twice for smp->ltk. This was possible if unpair_device was called right after ltk was generated but before keys were distributed. In this commit smp_cancel_pairing was refactored to cancel pairing if it is in progress and otherwise just removes keys. Once keys are removed from rcu list, pointers to smp context's keys are set to NULL to make sure removed list items are not accessed later. This commit also adjusts the functionality of mgmt unpair_device() little bit. Previously pairing was canceled only if pairing was in state that keys were already generated. With this commit unpair_device() cancels pairing already in earlier states. Bug was found by fuzzing kernel SMP implementation using Synopsys Defensics. Reported-by: Pekka Oikarainen Signed-off-by: Matias Karhumaa Signed-off-by: Johan Hedberg commit 28ef8b49a338dc1844e86b7954cfffc7dfa2660a Author: Martin Willi Date: Tue Sep 25 09:51:02 2018 +0200 mac80211_hwsim: do not omit multicast announce of first added radio The allocation of hwsim radio identifiers uses a post-increment from 0, so the first radio has idx 0. This idx is explicitly excluded from multicast announcements ever since, but it is unclear why. Drop that idx check and announce the first radio as well. This makes userspace happy if it relies on these events. Signed-off-by: Martin Willi Signed-off-by: Johannes Berg commit f1c47eb61d52379de5747d02bb36be20d7a2d0d3 Author: Martin Willi Date: Tue Sep 25 09:41:14 2018 +0200 mac80211_hwsim: fix race in radio destruction from netlink notifier The asynchronous destruction from a work-queue of radios tagged with destroy-on-close may race with the owning namespace about to exit, resulting in potential use-after-free of that namespace. Instead of using a work-queue, move radios about to destroy to a temporary list, which can be worked on synchronously after releasing the lock. This should be safe to do from the netlink socket notifier, as the namespace is guaranteed to not get released. Signed-off-by: Martin Willi Signed-off-by: Johannes Berg commit 628980e5c8f038f730582c6ee50b7410741cd96e Author: Martin Willi Date: Tue Sep 25 09:41:13 2018 +0200 mac80211_hwsim: fix locking when iterating radios during ns exit The cleanup of radios during namespace exit has recently been reworked to directly delete a radio while temporarily releasing the spinlock, fixing a race condition between the work-queue execution and namespace exits. However, the temporary unlock allows unsafe modifications on the iterated list, resulting in a potential crash when continuing the iteration of additional radios. Move radios about to destroy to a temporary list, and clean that up after releasing the spinlock once iteration is complete. Fixes: 8cfd36a0b53a ("mac80211_hwsim: fix use-after-free bug in hwsim_exit_net") Signed-off-by: Martin Willi Signed-off-by: Johannes Berg commit 30fe6d50eb088783c8729c7d930f65296b2b3fa7 Author: Masashi Honma Date: Tue Sep 25 11:15:00 2018 +0900 nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT Use array_index_nospec() to sanitize ridx with respect to speculation. Signed-off-by: Masashi Honma Signed-off-by: Johannes Berg commit 0bcbf6518456f63038a290bd359237d31f6f8ac3 Author: Randy Dunlap Date: Sun Sep 23 11:59:13 2018 -0700 cfg80211: fix reg_query_regdb_wmm kernel-doc Drop @ptr from kernel-doc for function reg_query_regdb_wmm(). This function parameter was recently removed so update the kernel-doc to match that and remove the kernel-doc warnings. Removes 109 occurrences of this warning message: ../include/net/cfg80211.h:4869: warning: Excess function parameter 'ptr' description in 'reg_query_regdb_wmm' Fixes: 38cb87ee47fb ("cfg80211: make wmm_rule part of the reg_rule structure") Signed-off-by: Randy Dunlap Cc: Stanislaw Gruszka Cc: Johannes Berg Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Signed-off-by: Johannes Berg commit 8105f9b8a8879bff7f1d43d0720c993a99c9d135 Author: Felix Fietkau Date: Sat Sep 22 18:35:31 2018 +0200 mac80211: allocate TXQs for active monitor interfaces Monitor mode interfaces with the active flag are passed down to the driver. Drivers using TXQ expect that all interfaces have allocated TXQs before they get added. Fixes: 79af1f866193d ("mac80211: avoid allocating TXQs that won't be used") Cc: stable@vger.kernel.org Reported-by: Catrinel Catrinescu Signed-off-by: Felix Fietkau Signed-off-by: Johannes Berg commit 5ebb1bc2d63d90dd204169e21fd7a0b4bb8c776e Author: Arindam Nath Date: Tue Sep 18 15:40:58 2018 +0530 iommu/amd: Return devid as alias for ACPI HID devices ACPI HID devices do not actually have an alias for them in the IVRS. But dev_data->alias is still used for indexing into the IOMMU device table for devices being handled by the IOMMU. So for ACPI HID devices, we simply return the corresponding devid as an alias, as parsed from IVRS table. Signed-off-by: Arindam Nath Fixes: 2bf9a0a12749 ('iommu/amd: Add iommu support for ACPI HID devices') Signed-off-by: Joerg Roedel commit 3f32d0be6c16b902b687453c962d17eea5b8ea19 Author: Parthasarathy Bhuvaragan Date: Tue Sep 25 22:09:10 2018 +0200 tipc: lock wakeup & inputq at tipc_link_reset() In tipc_link_reset() we copy the wakeup queue to input queue using skb_queue_splice_init(link->wakeupq, link->inputq). This is performed without holding any locks. The lists might be simultaneously be accessed by other cpu threads in tipc_sk_rcv(), something leading to to random missing packets. Signed-off-by: Parthasarathy Bhuvaragan Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 94b6ddce71780575fbbf9d2c36afc8440e61a281 Author: Parthasarathy Bhuvaragan Date: Tue Sep 25 21:56:57 2018 +0200 tipc: reset bearer if device carrier not ok If we detect that under lying carrier detects errors and goes down, we reset the bearer. Signed-off-by: Parthasarathy Bhuvaragan Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 082dc55e3c5e559b0e6855c0de23ebd674bcc91e Author: Amelie Delaunay Date: Thu Sep 20 18:34:16 2018 +0200 ARM: dts: stm32: update SPI6 dmas property on stm32mp157c Remove unused parameter from SPI6 dmas property on stm32mp157c SoC. Fixes: dc3f8c86c10d ("ARM: dts: stm32: add SPI support on stm32mp157c") Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue [olof: Without this patch, SPI6 will fall back to interrupt mode with lower perfmance] Signed-off-by: Olof Johansson commit 530ca2c9bd6949c72c9b5cfc330cb3dbccaa3f5b Author: Keith Busch Date: Tue Sep 25 10:36:20 2018 -0600 blk-mq: Allow blocking queue tag iter callbacks A recent commit runs tag iterator callbacks under the rcu read lock, but existing callbacks do not satisfy the non-blocking requirement. The commit intended to prevent an iterator from accessing a queue that's being modified. This patch fixes the original issue by taking a queue reference instead of reading it, which allows callbacks to make blocking calls. Fixes: f5bbbbe4d6357 ("blk-mq: sync the update nr_hw_queues with blk_mq_queue_tag_busy_iter") Acked-by: Jianchao Wang Signed-off-by: Keith Busch Signed-off-by: Jens Axboe commit bb830add192e9d8338082c0fc2c209e23b43d865 Author: Susobhan Dey Date: Tue Sep 25 12:29:15 2018 -0700 nvme: properly propagate errors in nvme_mpath_init Signed-off-by: Susobhan Dey Signed-off-by: Christoph Hellwig commit 974c24c5bed75b53e229a6f68a0533b6d5f48feb Author: Christoph Hellwig Date: Tue Sep 11 11:00:49 2018 +0200 dma-mapping: add the missing ARCH_HAS_SYNC_DMA_FOR_CPU_ALL declaration The patch adding the infrastructure failed to actually add the symbol declaration, oops.. Fixes: faef87723a ("dma-noncoherent: add a arch_sync_dma_for_cpu_all hook") Signed-off-by: Christoph Hellwig Reviewed-by: Paul Burton Acked-by: Florian Fainelli Signed-off-by: Christoph Hellwig commit 5c5702e259dc66e6fceed5117effab79c186e87a Author: Parav Pandit Date: Tue Sep 25 12:10:40 2018 +0300 RDMA/core: Set right entry state before releasing reference Currently add_modify_gid() for IB link layer has followong issue in cache update path. When GID update event occurs, core releases reference to the GID table without updating its state and/or entry pointer. CPU-0 CPU-1 ------ ----- ib_cache_update() IPoIB ULP add_modify_gid() [..] put_gid_entry() refcnt = 0, but state = valid, entry is valid. (work item is not yet executed). ipoib_create_ah() rdma_create_ah() rdma_get_gid_attr() <-- Tries to acquire gid_attr which has refcnt = 0. This is incorrect. GID entry state and entry pointer is provides the accurate GID enty state. Such fields must be updated with rwlock to protect against readers and, such fields must be in sane state before refcount can drop to zero. Otherwise above race condition can happen leading to use-after-free situation. Following backtrace has been observed when cache update for an IB port is triggered while IPoIB ULP is creating an AH. Therefore, when updating GID entry, first mark a valid entry as invalid through state and set the barrier so that no callers can acquired the GID entry, followed by release reference to it. refcount_t: increment on 0; use-after-free. WARNING: CPU: 4 PID: 29106 at lib/refcount.c:153 refcount_inc_checked+0x30/0x50 Workqueue: ib-comp-unb-wq ib_cq_poll_work [ib_core] RIP: 0010:refcount_inc_checked+0x30/0x50 RSP: 0018:ffff8802ad36f600 EFLAGS: 00010082 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000002 RSI: 0000000000000008 RDI: ffffffff86710100 RBP: ffff8802d6e60a30 R08: ffffed005d67bf8b R09: ffffed005d67bf8b R10: 0000000000000001 R11: ffffed005d67bf8a R12: ffff88027620cee8 R13: ffff8802d6e60988 R14: ffff8802d6e60a78 R15: 0000000000000202 FS: 0000000000000000(0000) GS:ffff8802eb200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f3ab35e5c88 CR3: 00000002ce84a000 CR4: 00000000000006e0 IPv6: ADDRCONF(NETDEV_CHANGE): ib1: link becomes ready Call Trace: rdma_get_gid_attr+0x220/0x310 [ib_core] ? lock_acquire+0x145/0x3a0 rdma_fill_sgid_attr+0x32c/0x470 [ib_core] rdma_create_ah+0x89/0x160 [ib_core] ? rdma_fill_sgid_attr+0x470/0x470 [ib_core] ? ipoib_create_ah+0x52/0x260 [ib_ipoib] ipoib_create_ah+0xf5/0x260 [ib_ipoib] ipoib_mcast_join_complete+0xbbe/0x2540 [ib_ipoib] Fixes: b150c3862d21 ("IB/core: Introduce GID entry reference counts") Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 96fc74333f84cfdf8d434c6c07254e215e2aad00 Author: Zhao Qiang Date: Thu Feb 1 14:54:32 2018 +0800 soc: fsl: qe: Fix copy/paste bug in ucc_get_tdm_sync_shift() There is a copy and paste bug so we accidentally use the RX_ shift when we're in TX_ mode. Fixes: bb8b2062aff3 ("fsl/qe: setup clock source for TDM mode") Signed-off-by: Dan Carpenter Signed-off-by: Zhao Qiang Signed-off-by: Li Yang (cherry picked from commit 3cb31b634052ed458922e0c8e2b4b093d7fb60b9) Signed-off-by: Olof Johansson commit 64e9e22e68512da8df3c9a7430f07621e48db3c2 Author: Alexandre Belloni Date: Thu Aug 23 23:36:00 2018 +0200 soc: fsl: qbman: qman: avoid allocating from non existing gen_pool If the qman driver didn't probe, calling qman_alloc_fqid_range, qman_alloc_pool_range or qman_alloc_cgrid_range (as done in dpaa_eth) will pass a NULL pointer to gen_pool_alloc, leading to a NULL pointer dereference. Signed-off-by: Alexandre Belloni Reviewed-by: Roy Pledge Signed-off-by: Li Yang (cherry picked from commit f72487a2788aa70c3aee1d0ebd5470de9bac953a) Signed-off-by: Olof Johansson commit 1a677ff4ce6acc3bdb2d01bb25eb687a6e28aa1d Merge: 9f71e7d5d97b 3ab97942d021 Author: Olof Johansson Date: Tue Sep 25 13:51:16 2018 -0700 Merge tag 'arm-soc/for-4.19/devicetree-fixes' of https://github.com/Broadcom/stblinux into fixes This pull request contains Broadcom ARM-based SoCs Device Tree changes intended for 4.19, please pull the following: - Florian fixes the PPI and SPI interrupts in the BCM63138 (DSL) SoC DTS * tag 'arm-soc/for-4.19/devicetree-fixes' of https://github.com/Broadcom/stblinux: ARM: dts: BCM63xx: Fix incorrect interrupt specifiers Signed-off-by: Olof Johansson commit e8ef090a614292db01b5956a6f5467afbe6c5cf7 Author: Yishai Hadas Date: Tue Sep 25 12:11:12 2018 +0300 IB/mlx5: Destroy the DEVX object upon error flow Upon DEVX object creation the object must be destroyed upon a follows error flow. Fixes: 7efce3691d33 ("IB/mlx5: Add obj create and destroy functionality") Signed-off-by: Yishai Hadas Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a9360abd3de0aad745d25d003923d56afb28a04b Author: Mark Bloch Date: Tue Sep 25 11:23:55 2018 +0300 IB/uverbs: Free uapi on destroy Make sure we free struct uverbs_api once we clean the radix tree. It was allocated by uverbs_alloc_api(). Fixes: 9ed3e5f44772 ("IB/uverbs: Build the specs into a radix tree at runtime") Reported-by: Bart Van Assche Signed-off-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a38523185b40fd85d2afe5b5fbfb0952f7153e96 Merge: 846e8dd47c26 41c9b1be335b Author: Greg Kroah-Hartman Date: Tue Sep 25 21:37:41 2018 +0200 erge tag 'libnvdimm-fixes-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Dan writes: "libnvdimm/dax for 4.19-rc6 * (2) fixes for the dax error handling updates that were merged for v4.19-rc1. My mails to Al have been bouncing recently, so I do not have his ack but the uaccess change is of the trivial / obviously correct variety. The address_space_operations fixes a regression. * A filesystem-dax fix to correct the zero page lookup to be compatible with non-x86 (mips and s390) architectures." * tag 'libnvdimm-fixes-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: device-dax: Add missing address_space_operations uaccess: Fix is_source param for check_copy_size() in copy_to_iter_mcsafe() filesystem-dax: Fix use of zero page commit 9f71e7d5d97b8ed1262b777fd5b37667aa18d3fd Merge: e6f0e1c75695 379e36d3f591 Author: Olof Johansson Date: Tue Sep 25 12:30:16 2018 -0700 Merge tag 'at91-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into fixes AT91 fixes for 4.19: - fix a NAND issue on sama5d2_ptc_ek (drive strength setting to fix corruption) * tag 'at91-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sama5d2_ptc_ek: fix nand pinctrl Signed-off-by: Olof Johansson commit 69383c5913a5d74b4aa7e2b78a5cf14ebfbba538 Author: Wei Yongjun Date: Tue Sep 25 14:57:42 2018 +0000 ovl: make symbol 'ovl_aops' static Fixes the following sparse warning: fs/overlayfs/inode.c:507:39: warning: symbol 'ovl_aops' was not declared. Should it be static? Fixes: 5b910bd615ba ("ovl: fix GPF in swapfile_activate of file from overlayfs over xfs") Signed-off-by: Wei Yongjun Signed-off-by: Miklos Szeredi commit 92ef12b32feab8f277b69e9fb89ede2796777f4d Author: Parthasarathy Bhuvaragan Date: Tue Sep 25 18:21:58 2018 +0200 tipc: fix flow control accounting for implicit connect In the case of implicit connect message with data > 1K, the flow control accounting is incorrect. At this state, the socket does not know the peer nodes capability and falls back to legacy flow control by return 1, however the receiver of this message will perform the new block accounting. This leads to a slack and eventually traffic disturbance. In this commit, we perform tipc_node_get_capabilities() at implicit connect and perform accounting based on the peer's capability. Signed-off-by: Parthasarathy Bhuvaragan Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 2e9361efa707e186d91b938e44f9e326725259f7 Author: Yunsheng Lin Date: Tue Sep 25 10:21:55 2018 +0100 net: hns: fix for unmapping problem when SMMU is on If SMMU is on, there is more likely that skb_shinfo(skb)->frags[i] can not send by a single BD. when this happen, the hns_nic_net_xmit_hw function map the whole data in a frags using skb_frag_dma_map, but unmap each BD' data individually when tx is done, which causes problem when SMMU is on. This patch fixes this problem by ummapping the whole data in a frags when tx is done. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Reviewed-by: Yisen Zhuang Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 970f1713ce22e625257af62a3f7d5e1761cc4f02 Merge: e1e5d8a9fe73 871088bf92e1 Author: David S. Miller Date: Tue Sep 25 10:39:35 2018 -0700 Merge branch 'xen-netback-hash' Jan Beulich says: ==================== xen-netback: hash mapping handling adjustments First and foremost the fix for XSA-270. On top of that further changes which looked desirable to me while investigating that XSA. 1: fix input validation in xenvif_set_hash_mapping() 2: validate queue numbers in xenvif_set_hash_mapping() 3: handle page straddling in xenvif_set_hash_mapping() ==================== Signed-off-by: Jan Beulich Signed-off-by: David S. Miller commit 871088bf92e11efb69bbdbd537e48c0ad4f63729 Author: Jan Beulich Date: Tue Sep 25 02:13:37 2018 -0600 xen-netback: handle page straddling in xenvif_set_hash_mapping() There's no guarantee that the mapping array doesn't cross a page boundary. Use a second grant copy operation if necessary. Signed-off-by: Jan Beulich Acked-by: Wei Liu Reviewed-by: Paul Durrant Signed-off-by: David S. Miller commit 22f9cde3401077ea450b69bf9b0bba373e12e454 Author: Jan Beulich Date: Tue Sep 25 02:13:01 2018 -0600 xen-netback: validate queue numbers in xenvif_set_hash_mapping() Checking them before the grant copy means nothing as to the validity of the incoming request. As we shouldn't make the new data live before having validated it, introduce a second instance of the mapping array. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Signed-off-by: David S. Miller commit 780e83c259fc33e8959fed8dfdad17e378d72b62 Author: Jan Beulich Date: Tue Sep 25 02:12:30 2018 -0600 xen-netback: fix input validation in xenvif_set_hash_mapping() Both len and off are frontend specified values, so we need to make sure there's no overflow when adding the two for the bounds check. We also want to avoid undefined behavior and hence use off to index into ->hash.mapping[] only after bounds checking. This at the same time allows to take care of not applying off twice for the bounds checking against vif->num_queues. It is also insufficient to bounds check copy_op.len, as this is len truncated to 16 bits. This is XSA-270 / CVE-2018-15471. Reported-by: Felix Wilhelm Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Tested-by: Paul Durrant Cc: stable@vger.kernel.org [4.7 onwards] Signed-off-by: David S. Miller commit e1e5d8a9fe737d94ccc0ccbaf0c97f69a8f3e000 Author: Michal Simek Date: Tue Sep 25 08:32:50 2018 +0200 net: macb: Clean 64b dma addresses if they are not detected Clear ADDR64 dma bit in DMACFG register in case that HW_DMA_CAP_64B is not detected on 64bit system. The issue was observed when bootloader(u-boot) does not check macb feature at DCFG6 register (DAW64_OFFSET) and enabling 64bit dma support by default. Then macb driver is reading DMACFG register back and only adding 64bit dma configuration but not cleaning it out. Signed-off-by: Michal Simek Acked-by: Nicolas Ferre Signed-off-by: David S. Miller commit 846e8dd47c264e0b359afed28ea88e0acdee6818 Merge: bfb0e9b490bc f1f1fadacaf0 Author: Greg Kroah-Hartman Date: Tue Sep 25 18:14:14 2018 +0200 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi James writes: "SCSI fixes on 20180925 Nine obvious bug fixes mostly in individual drivers. The target fix is of particular importance because it's CVE related." * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: sd: don't crash the host on invalid commands scsi: ipr: System hung while dlpar adding primary ipr adapter back scsi: target: iscsi: Use bin2hex instead of a re-implementation scsi: target: iscsi: Use hex2bin instead of a re-implementation scsi: lpfc: Synchronize access to remoteport via rport scsi: ufs: Disable blk-mq for now scsi: sd: Contribute to randomness when running rotational device scsi: ibmvscsis: Ensure partition name is properly NUL terminated scsi: ibmvscsis: Fix a stringop-overflow warning commit bfb0e9b490bc15f243009359745a9d8a94089dc4 Merge: ccf791e5e6b1 3e3b81965cbf Author: Greg Kroah-Hartman Date: Tue Sep 25 17:54:55 2018 +0200 Merge tag 'usb-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb I wrote: "USB fixes for 4.19-rc6 Here are some small USB core and driver fixes for reported issues for 4.19-rc6. The most visible is the oops fix for when the USB core is built into the kernel that is present in 4.18. Turns out not many people actually do that so it went unnoticed for a while. The rest is some tiny typec, musb, and other core fixes. All have been in linux-next with no reported issues." * tag 'usb-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: typec: mux: Take care of driver module reference counting usb: core: safely deal with the dynamic quirk lists usb: roles: Take care of driver module reference counting USB: handle NULL config in usb_find_alt_setting() USB: fix error handling in usb_driver_claim_interface() USB: remove LPM management from usb_driver_claim_interface() USB: usbdevfs: restore warning for nonsensical flags USB: usbdevfs: sanitize flags more Revert "usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()" usb: musb: dsps: do not disable CPPI41 irq in driver teardown commit ccf791e5e6b16477b196e81b85f7d5a067e0c8d9 Merge: fc0c8146680e 7e620984b625 Author: Greg Kroah-Hartman Date: Tue Sep 25 17:22:50 2018 +0200 Merge tag 'tty-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty I wrote: "TTY/Serial driver fixes for 4.19-rc6 Here are a number of small tty and serial driver fixes for reported issues for 4.19-rc6. One should hopefully resolve a much-reported issue that syzbot has found in the tty layer. Although there are still more issues there, getting this fixed is nice to see finally happen. All of these have been in linux-next for a while with no reported issues." * tag 'tty-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: imx: restore handshaking irq for imx1 tty: vt_ioctl: fix potential Spectre v1 tty: Drop tty->count on tty_reopen() failure serial: cpm_uart: return immediately from console poll tty: serial: lpuart: avoid leaking struct tty_struct serial: mvebu-uart: Fix reporting of effective CSIZE to userspace commit fc0c8146680e362ebeaed0294b869425cc18230e Merge: 8c0f9f5b309d 59d08d00d43c Author: Greg Kroah-Hartman Date: Tue Sep 25 17:01:52 2018 +0200 Merge tag 'char-misc-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Greg (well I), wrote: "Char/Misc driver fixes for 4.19-rc6 Here are some soundwire and intel_th (tracing) driver fixes for some reported issues. All of these have been in linux-next for a week with no reported issues." * tag 'char-misc-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: intel_th: pci: Add Ice Lake PCH support intel_th: Fix resource handling for ACPI glue layer intel_th: Fix device removal logic soundwire: Fix acquiring bus lock twice during master release soundwire: Fix incorrect exit after configuring stream soundwire: Fix duplicate stream state assignment commit d005efe18db0b4a123dd92ea8e77e27aee8f99fd Author: Adrian Hunter Date: Tue Sep 11 14:45:04 2018 +0300 perf script python: Fix export-to-sqlite.py sample columns With the "branches" export option, not all sample columns are exported. However the unwanted columns are not at the end of the tuple, as assumed by the code. Fix by taking the first 15 and last 3 values, instead of the first 18. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20180911114504.28516-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 25e11700b54c7b6b5ebfc4361981dae12299557b Author: Adrian Hunter Date: Tue Sep 11 14:45:03 2018 +0300 perf script python: Fix export-to-postgresql.py occasional failure Occasional export failures were found to be caused by truncating 64-bit pointers to 32-bits. Fix by explicitly setting types for all ctype arguments and results. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20180911114504.28516-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 2483ef056f6e42f61cd266452e2841165dfe1b5c Author: Srikar Dronamraju Date: Tue Sep 25 17:55:15 2018 +0530 powerpc/numa: Use associativity if VPHN hcall is successful Currently associativity is used to lookup node-id even if the preceding VPHN hcall failed. However this can cause CPU to be made part of the wrong node, (most likely to be node 0). This is because VPHN is not enabled on KVM guests. With 2ea6263 ("powerpc/topology: Get topology for shared processors at boot"), associativity is used to set to the wrong node. Hence KVM guest topology is broken. For example : A 4 node KVM guest before would have reported. [root@localhost ~]# numactl -H available: 4 nodes (0-3) node 0 cpus: 0 1 2 3 node 0 size: 1746 MB node 0 free: 1604 MB node 1 cpus: 4 5 6 7 node 1 size: 2044 MB node 1 free: 1765 MB node 2 cpus: 8 9 10 11 node 2 size: 2044 MB node 2 free: 1837 MB node 3 cpus: 12 13 14 15 node 3 size: 2044 MB node 3 free: 1903 MB node distances: node 0 1 2 3 0: 10 40 40 40 1: 40 10 40 40 2: 40 40 10 40 3: 40 40 40 10 Would now report: [root@localhost ~]# numactl -H available: 4 nodes (0-3) node 0 cpus: 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 node 0 size: 1746 MB node 0 free: 1244 MB node 1 cpus: node 1 size: 2044 MB node 1 free: 2032 MB node 2 cpus: 1 node 2 size: 2044 MB node 2 free: 2028 MB node 3 cpus: node 3 size: 2044 MB node 3 free: 2032 MB node distances: node 0 1 2 3 0: 10 40 40 40 1: 40 10 40 40 2: 40 40 10 40 3: 40 40 40 10 Fix this by skipping associativity lookup if the VPHN hcall failed. Fixes: 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot") Signed-off-by: Srikar Dronamraju Signed-off-by: Michael Ellerman commit 96dc89d526ef77604376f06220e3d2931a0bfd58 Author: Michael Neuling Date: Tue Sep 25 19:36:47 2018 +1000 powerpc/tm: Avoid possible userspace r1 corruption on reclaim Current we store the userspace r1 to PACATMSCRATCH before finally saving it to the thread struct. In theory an exception could be taken here (like a machine check or SLB miss) that could write PACATMSCRATCH and hence corrupt the userspace r1. The SLB fault currently doesn't touch PACATMSCRATCH, but others do. We've never actually seen this happen but it's theoretically possible. Either way, the code is fragile as it is. This patch saves r1 to the kernel stack (which can't fault) before we turn MSR[RI] back on. PACATMSCRATCH is still used but only with MSR[RI] off. We then copy r1 from the kernel stack to the thread struct once we have MSR[RI] back on. Suggested-by: Breno Leitao Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman commit cf13435b730a502e814c63c84d93db131e563f5f Author: Michael Neuling Date: Mon Sep 24 17:27:04 2018 +1000 powerpc/tm: Fix userspace r13 corruption When we treclaim we store the userspace checkpointed r13 to a scratch SPR and then later save the scratch SPR to the user thread struct. Unfortunately, this doesn't work as accessing the user thread struct can take an SLB fault and the SLB fault handler will write the same scratch SPRG that now contains the userspace r13. To fix this, we store r13 to the kernel stack (which can't fault) before we access the user thread struct. Found by running P8 guest + powervm + disable_1tb_segments + TM. Seen as a random userspace segfault with r13 looking like a kernel address. Signed-off-by: Michael Neuling Reviewed-by: Breno Leitao Signed-off-by: Michael Ellerman commit be9e6598aeb0db70a7927d6b3bb4d3d6fb1c3e18 Author: Lu Baolu Date: Sat Sep 8 09:42:53 2018 +0800 iommu/vt-d: Handle memory shortage on pasid table allocation Pasid table memory allocation could return failure due to memory shortage. Limit the pasid table size to 1MiB because current 8MiB contiguous physical memory allocation can be hard to come by. W/o a PASID table, the device could continue to work with only shared virtual memory impacted. So, let's go ahead with context mapping even the memory allocation for pasid table failed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107783 Fixes: cc580e41260d ("iommu/vt-d: Per PCI device pasid table interfaces") Cc: Ashok Raj Cc: Jacob Pan Cc: Mika Westerberg Reported-and-tested-by: Pelton Kyle D Tested-by: Mika Westerberg Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit 8c0f9f5b309d627182d5da72a69246f58bde1026 Author: Lubomir Rintel Date: Mon Sep 24 13:18:34 2018 +0100 Revert "uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name" This changes UAPI, breaking iwd and libell: ell/key.c: In function 'kernel_dh_compute': ell/key.c:205:38: error: 'struct keyctl_dh_params' has no member named 'private'; did you mean 'dh_private'? struct keyctl_dh_params params = { .private = private, ^~~~~~~ dh_private This reverts commit 8a2336e549d385bb0b46880435b411df8d8200e8. Fixes: 8a2336e549d3 ("uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name") Signed-off-by: Lubomir Rintel Signed-off-by: David Howells cc: Randy Dunlap cc: Mat Martineau cc: Stephan Mueller cc: James Morris cc: "Serge E. Hallyn" cc: Mat Martineau cc: Andrew Morton cc: Linus Torvalds cc: Signed-off-by: James Morris Signed-off-by: Greg Kroah-Hartman commit 72923e5488f0604fac8ef2c7e683fabd3b4c203b Author: Mika Westerberg Date: Mon Sep 24 17:32:12 2018 +0300 Revert "pinctrl: intel: Do pin translation when lock IRQ" This reverts commit 55aedef50d4d810670916d9fce4a40d5da2079e7. Commit 55aedef50d4d ("pinctrl: intel: Do pin translation when lock IRQ") added special translation from GPIO number to hardware pin number to irq_reqres/relres hooks to avoid failure when IRQs are requested. The actual failure happened inside gpiochip_lock_as_irq() because it calls gpiod_get_direction() and pinctrl-intel.c::intel_gpio_get_direction() implementation originally missed the translation so the two hooks made it work by skipping the ->get_direction() call entirely (it overwrote the default GPIOLIB provided functions). The proper fix that adds translation to GPIO callbacks was merged with commit 96147db1e1df ("pinctrl: intel: Do pin translation in other GPIO operations as well"). This allows us to use the default GPIOLIB provided functions again. In addition as find out by Benjamin Tissoires the two functions (intel_gpio_irq_reqres()/intel_gpio_irq_relres()) now cause problems of their own because they operate on pin numbers and pass that pin number to gpiochip_lock_as_irq() which actually expects a GPIO number. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199911 Fixes: 55aedef50d4d ("pinctrl: intel: Do pin translation when lock IRQ") Reported-and-tested-by: Benjamin Tissoires Signed-off-by: Mika Westerberg Acked-by: Andy Shevchenko Signed-off-by: Linus Walleij commit e50d95e2ad1266f8d3fcdf0724f03dbdffd400aa Author: Mika Westerberg Date: Mon Sep 24 17:32:11 2018 +0300 pinctrl: cannonlake: Fix HOSTSW_OWN register offset of H variant It turns out the HOSTSW_OWN register offset is different between LP and H variants. The latter should use 0xc0 instead so fix that. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199911 Fixes: a663ccf0fea1 ("pinctrl: intel: Add Intel Cannon Lake PCH-H pin controller support") Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit b85bfa246efd24ea3fdb5ee949c28e3110c6d299 Author: Daniel Kurtz Date: Sat Sep 22 13:58:26 2018 -0600 pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type From the AMD BKDG, if WAKE_INT_MASTER_REG.MaskStsEn is set, a software write to the debounce registers of *any* gpio will block wake/interrupt status generation for *all* gpios for a length of time that depends on WAKE_INT_MASTER_REG.MaskStsLength[11:0]. During this period the Interrupt Delivery bit (INTERRUPT_ENABLE) will read as 0. In commit 4c1de0414a1340 ("pinctrl/amd: poll InterruptEnable bits in enable_irq") we tried to fix this same "gpio Interrupts are blocked immediately after writing debounce registers" problem, but incorrectly assumed it only affected the gpio whose debounce was being configured and not ALL gpios. To solve this for all gpios, we move the polling loop from amd_gpio_irq_enable() to amd_gpio_irq_set_type(), while holding the gpio spinlock. This ensures that another gpio operation (e.g. amd_gpio_irq_unmask()) can read a temporarily disabled IRQ and incorrectly disable it while trying to modify some other register bits. Fixes: 4c1de0414a1340 pinctrl/amd: poll InterruptEnable bits in enable_irq Signed-off-by: Daniel Kurtz Signed-off-by: Linus Walleij commit 2dd68cc7fd8c3ae9c151c0565824b5ef42e3806b Merge: 02214bfc89c7 f4a518797b40 Author: Greg Kroah-Hartman Date: Tue Sep 25 11:19:28 2018 +0200 Merge gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net Dave writes: "Networking fixes: 1) Fix multiqueue handling of coalesce timer in stmmac, from Jose Abreu. 2) Fix memory corruption in NFC, from Suren Baghdasaryan. 3) Don't write reserved bits in ravb driver, from Kazuya Mizuguchi. 4) SMC bug fixes from Karsten Graul, YueHaibing, and Ursula Braun. 5) Fix TX done race in mvpp2, from Antoine Tenart. 6) ipv6 metrics leak, from Wei Wang. 7) Adjust firmware version requirements in mlxsw, from Petr Machata. 8) Fix autonegotiation on resume in r8169, from Heiner Kallweit. 9) Fixed missing entries when dumping /proc/net/if_inet6, from Jeff Barnhill. 10) Fix double free in devlink, from Dan Carpenter. 11) Fix ethtool regression from UFO feature removal, from Maciej Żenczykowski. 12) Fix drivers that have a ndo_poll_controller() that captures the cpu entirely on loaded hosts by trying to drain all rx and tx queues, from Eric Dumazet. 13) Fix memory corruption with jumbo frames in aquantia driver, from Friedemann Gerold." * gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net: (79 commits) net: mvneta: fix the remaining Rx descriptor unmapping issues ip_tunnel: be careful when accessing the inner header mpls: allow routes on ip6gre devices net: aquantia: memory corruption on jumbo frames tun: remove ndo_poll_controller nfp: remove ndo_poll_controller bnxt: remove ndo_poll_controller bnx2x: remove ndo_poll_controller mlx5: remove ndo_poll_controller mlx4: remove ndo_poll_controller i40evf: remove ndo_poll_controller ice: remove ndo_poll_controller igb: remove ndo_poll_controller ixgb: remove ndo_poll_controller fm10k: remove ndo_poll_controller ixgbevf: remove ndo_poll_controller ixgbe: remove ndo_poll_controller bonding: use netpoll_poll_dev() helper netpoll: make ndo_poll_controller() optional rds: Fix build regression. ... commit 74bc2abca7603c956d1e331e8b9bee7b874c1eec Author: Heiko Stuebner Date: Mon Aug 27 12:56:24 2018 +0200 iommu/rockchip: Free irqs in shutdown handler In the iommu's shutdown handler we disable runtime-pm which could result in the irq-handler running unclocked and since commit 3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM framework") we warn about that fact. This can cause warnings on shutdown on some Rockchip machines, so free the irqs in the shutdown handler before we disable runtime-pm. Reported-by: Enric Balletbo i Serra Fixes: 3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM framework") Signed-off-by: Heiko Stuebner Tested-by: Enric Balletbo i Serra Acked-by: Marc Zyngier Signed-off-by: Joerg Roedel commit ea51e17b953f391c0a7d6684141e76a5ab209fef Author: Colin Ian King Date: Mon Sep 24 18:14:37 2018 +0100 i2c: i2c-isch: fix spelling mistake "unitialized" -> "uninitialized" Trivial fix to spelling mistake in dev_notice message. Signed-off-by: Colin Ian King Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit 6697576788816985f9c79da190abfaad7c9e1738 Author: Stephen Boyd Date: Thu Sep 20 11:03:22 2018 -0700 i2c: i2c-qcom-geni: Properly handle DMA safe buffers We shouldn't attempt to DMA map the message buffers passed into this driver from the i2c core unless the message we're mapping have been properly setup for DMA. The i2c core indicates such a situation by setting the I2C_M_DMA_SAFE flag, so check for that flag before using DMA mode. We can also bounce the buffer if it isn't already mapped properly by using the i2c_get_dma_safe_msg_buf() APIs, so do that when we want to use DMA for a message. This fixes a problem where the kernel oopses cleaning pages for a buffer that's mapped into the vmalloc space. The pages are returned from request_firmware() and passed down directly to the i2c master to write to the i2c touchscreen device. Mapping vmalloc buffers with dma_map_single() won't work reliably, causing an oops like below: Unable to handle kernel paging request at virtual address ffffffc01391d000 ... Reported-by: Philip Chen Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Wolfram Sang commit 57a489786de9ec37d6e25ef1305dc337047f0236 Author: James Cowgill Date: Thu Sep 6 22:57:56 2018 +0100 RISC-V: include linux/ftrace.h in asm-prototypes.h Building a riscv kernel with CONFIG_FUNCTION_TRACER and CONFIG_MODVERSIONS enabled results in these two warnings: MODPOST vmlinux.o WARNING: EXPORT symbol "return_to_handler" [vmlinux] version generation failed, symbol will not be versioned. WARNING: EXPORT symbol "_mcount" [vmlinux] version generation failed, symbol will not be versioned. When exporting symbols from an assembly file, the MODVERSIONS code requires their prototypes to be defined in asm-prototypes.h (see scripts/Makefile.build). Since both of these symbols have prototypes defined in linux/ftrace.h, include this header from RISC-V's asm-prototypes.h. Reported-by: Karsten Merker Signed-off-by: James Cowgill Signed-off-by: Palmer Dabbelt commit f4a518797b40e956b6e6220b42657e045dc24470 Author: Antoine Tenart Date: Mon Sep 24 16:56:13 2018 +0200 net: mvneta: fix the remaining Rx descriptor unmapping issues With CONFIG_DMA_API_DEBUG enabled we get DMA unmapping warning in various places of the mvneta driver, for example when putting down an interface while traffic is passing through. The issue is when using s/w buffer management, the Rx buffers are mapped using dma_map_page but unmapped with dma_unmap_single. This patch fixes this by using the right unmapping function. Fixes: 562e2f467e71 ("net: mvneta: Improve the buffer allocation method for SWBM") Signed-off-by: Antoine Tenart Reviewed-by: Gregory CLEMENT Signed-off-by: David S. Miller commit ccfec9e5cb2d48df5a955b7bf47f7782157d3bc2 Author: Paolo Abeni Date: Mon Sep 24 15:48:19 2018 +0200 ip_tunnel: be careful when accessing the inner header Cong noted that we need the same checks introduced by commit 76c0ddd8c3a6 ("ip6_tunnel: be careful when accessing the inner header") even for ipv4 tunnels. Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.") Suggested-by: Cong Wang Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit d8e2262a5044c1a05b4da51e5d0976f10c487a9f Author: Saif Hasan Date: Fri Sep 21 14:30:05 2018 -0700 mpls: allow routes on ip6gre devices Summary: This appears to be necessary and sufficient change to enable `MPLS` on `ip6gre` tunnels (RFC4023). This diff allows IP6GRE devices to be recognized by MPLS kernel module and hence user can configure interface to accept packets with mpls headers as well setup mpls routes on them. Test Plan: Test plan consists of multiple containers connected via GRE-V6 tunnel. Then carrying out testing steps as below. - Carry out necessary sysctl settings on all containers ``` sysctl -w net.mpls.platform_labels=65536 sysctl -w net.mpls.ip_ttl_propagate=1 sysctl -w net.mpls.conf.lo.input=1 ``` - Establish IP6GRE tunnels ``` ip -6 tunnel add name if_1_2_1 mode ip6gre \ local 2401:db00:21:6048:feed:0::1 \ remote 2401:db00:21:6048:feed:0::2 key 1 ip link set dev if_1_2_1 up sysctl -w net.mpls.conf.if_1_2_1.input=1 ip -4 addr add 169.254.0.2/31 dev if_1_2_1 scope link ip -6 tunnel add name if_1_3_1 mode ip6gre \ local 2401:db00:21:6048:feed:0::1 \ remote 2401:db00:21:6048:feed:0::3 key 1 ip link set dev if_1_3_1 up sysctl -w net.mpls.conf.if_1_3_1.input=1 ip -4 addr add 169.254.0.4/31 dev if_1_3_1 scope link ``` - Install MPLS encap rules on node-1 towards node-2 ``` ip route add 192.168.0.11/32 nexthop encap mpls 32/64 \ via inet 169.254.0.3 dev if_1_2_1 ``` - Install MPLS forwarding rules on node-2 and node-3 ``` // node2 ip -f mpls route add 32 via inet 169.254.0.7 dev if_2_4_1 // node3 ip -f mpls route add 64 via inet 169.254.0.12 dev if_4_3_1 ``` - Ping 192.168.0.11 (node4) from 192.168.0.1 (node1) (where routing towards 192.168.0.1 is via IP route directly towards node1 from node4) ``` ping 192.168.0.11 ``` - tcpdump on interface to capture ping packets wrapped within MPLS header which inturn wrapped within IP6GRE header ``` 16:43:41.121073 IP6 2401:db00:21:6048:feed::1 > 2401:db00:21:6048:feed::2: DSTOPT GREv0, key=0x1, length 100: MPLS (label 32, exp 0, ttl 255) (label 64, exp 0, [S], ttl 255) IP 192.168.0.1 > 192.168.0.11: ICMP echo request, id 1208, seq 45, length 64 0x0000: 6000 2cdb 006c 3c3f 2401 db00 0021 6048 `.,..l Signed-off-by: David S. Miller commit 3ab97942d0213b6583a5408630a8cbbfbf54730f Author: Florian Fainelli Date: Wed Sep 19 17:14:01 2018 -0700 ARM: dts: BCM63xx: Fix incorrect interrupt specifiers A number of our interrupts were incorrectly specified, fix both the PPI and SPI interrupts to be correct. Fixes: b5762cacc411 ("ARM: bcm63138: add NAND DT support") Fixes: 46d4bca0445a ("ARM: BCM63XX: add BCM63138 minimal Device Tree") Signed-off-by: Florian Fainelli commit d2f85c9e1cf8ecdccae3e44fb2c4a36b1bbc4cb7 Merge: d26ed6b0e5e2 fad0c40fab14 Author: David S. Miller Date: Mon Sep 24 10:08:45 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2018-09-24 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Several fixes for BPF sockmap to only allow sockets being attached in ESTABLISHED state, from John. 2) Fix up the license to LGPL/BSD for the libc compat header which contains fallback helpers that libbpf and bpftool is using, from Jakub. ==================== Signed-off-by: David S. Miller commit 031e6e6b4e1277e76e73a6ab209095ad9bf3ce52 Author: Steve Capper Date: Fri Sep 21 16:34:05 2018 +0100 arm64: hugetlb: Avoid unnecessary clearing in huge_ptep_set_access_flags For contiguous hugetlb, huge_ptep_set_access_flags performs a get_clear_flush (which then flushes the TLBs) even when no change of ptes is necessary. Unfortunately, this behaviour can lead to back-to-back page faults being generated when running with multiple threads that access the same contiguous huge page. Thread 1 | Thread 2 -----------------------------+------------------------------ hugetlb_fault | huge_ptep_set_access_flags | -> invalidate pte range | hugetlb_fault continue processing | wait for hugetlb_fault_mutex release mutex and return | huge_ptep_set_access_flags | -> invalidate pte range hugetlb_fault ... This patch changes huge_ptep_set_access_flags s.t. we first read the contiguous range of ptes (whilst preserving dirty information); the pte range is only then invalidated where necessary and this prevents further spurious page faults. Fixes: d8bdcff28764 ("arm64: hugetlb: Add break-before-make logic for contiguous entries") Reported-by: Lei Zhang Signed-off-by: Steve Capper Signed-off-by: Will Deacon commit 469ed9d823b7d240d6b9574f061ded7c3834c167 Author: Steve Capper Date: Fri Sep 21 16:34:04 2018 +0100 arm64: hugetlb: Fix handling of young ptes In the contiguous bit hugetlb break-before-make code we assume that all hugetlb pages are young. In fact, remove_migration_pte is able to place an old hugetlb pte so this assumption is not valid. This patch fixes the contiguous hugetlb scanning code to preserve young ptes. Fixes: d8bdcff28764 ("arm64: hugetlb: Add break-before-make logic for contiguous entries") Signed-off-by: Steve Capper Signed-off-by: Will Deacon commit 4679b61f2640e07724507fcd9dc070517bc6e6cb Author: Paolo Bonzini Date: Mon Sep 24 17:23:01 2018 +0200 KVM: x86: never trap MSR_KERNEL_GS_BASE KVM has an old optimization whereby accesses to the kernel GS base MSR are trapped when the guest is in 32-bit and not when it is in 64-bit mode. The idea is that swapgs is not available in 32-bit mode, thus the guest has no reason to access the MSR unless in 64-bit mode and 32-bit applications need not pay the price of switching the kernel GS base between the host and the guest values. However, this optimization adds complexity to the code for little benefit (these days most guests are going to be 64-bit anyway) and in fact broke after commit 678e315e78a7 ("KVM: vmx: add dedicated utility to access guest's kernel_gs_base", 2018-08-06); the guest kernel GS base can be corrupted across SMIs and UEFI Secure Boot is therefore broken (a secure boot Linux guest, for example, fails to reach the login prompt about half the time). This patch just removes the optimization; the kernel GS base MSR is now never trapped by KVM, similarly to the FS and GS base MSRs. Fixes: 678e315e78a780dbef384b92339c8414309dbc11 Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit de5c95d0f518537f59ee5aef762abc46f868c377 Author: Selvin Xavier Date: Thu Sep 20 22:33:00 2018 -0700 RDMA/bnxt_re: Fix system crash during RDMA resource initialization bnxt_re_ib_reg acquires and releases the rtnl lock whenever it accesses the L2 driver. The following sequence can trigger a crash Acquires the rtnl_lock -> Registers roce driver callback with L2 driver -> release the rtnl lock bnxt_re acquires the rtnl_lock -> Request for MSIx vectors -> release the rtnl_lock Issue happens when bnxt_re proceeds with remaining part of initialization and L2 driver invokes bnxt_ulp_irq_stop as a part of bnxt_open_nic. The crash is in bnxt_qplib_nq_stop_irq as the NQ structures are not initialized yet, [ 3551.726647] BUG: unable to handle kernel NULL pointer dereference at (null) [ 3551.726656] IP: [] bnxt_qplib_nq_stop_irq+0x59/0xb0 [bnxt_re] [ 3551.726674] PGD 0 [ 3551.726679] Oops: 0002 1 SMP ... [ 3551.726822] Hardware name: Dell Inc. PowerEdge R720/08RW36, BIOS 2.4.3 07/09/2014 [ 3551.726826] task: ffff97e30eec5ee0 ti: ffff97e3173bc000 task.ti: ffff97e3173bc000 [ 3551.726829] RIP: 0010:[] [] bnxt_qplib_nq_stop_irq+0x59/0xb0 [bnxt_re] ... [ 3551.726872] Call Trace: [ 3551.726886] [] bnxt_re_stop_irq+0x4e/0x70 [bnxt_re] [ 3551.726899] [] bnxt_ulp_irq_stop+0x43/0x70 [bnxt_en] [ 3551.726908] [] bnxt_reserve_rings+0x174/0x1e0 [bnxt_en] [ 3551.726917] [] __bnxt_open_nic+0x368/0x9a0 [bnxt_en] [ 3551.726925] [] bnxt_open_nic+0x1b/0x50 [bnxt_en] [ 3551.726934] [] bnxt_setup_mq_tc+0x11f/0x260 [bnxt_en] [ 3551.726943] [] bnxt_dcbnl_ieee_setets+0xb8/0x1f0 [bnxt_en] [ 3551.726954] [] dcbnl_ieee_set+0x9a/0x250 [ 3551.726966] [] ? __alloc_skb+0xa1/0x2d0 [ 3551.726972] [] dcb_doit+0x13a/0x210 [ 3551.726981] [] rtnetlink_rcv_msg+0xa7/0x260 [ 3551.726989] [] ? rtnl_unicast+0x20/0x30 [ 3551.726996] [] ? __kmalloc_node_track_caller+0x58/0x290 [ 3551.727002] [] ? dcb_doit+0x166/0x210 [ 3551.727007] [] ? __alloc_skb+0x8d/0x2d0 [ 3551.727012] [] ? rtnl_newlink+0x880/0x880 ... [ 3551.727104] [] system_call_fastpath+0x1c/0x21 ... [ 3551.727164] RIP [] bnxt_qplib_nq_stop_irq+0x59/0xb0 [bnxt_re] [ 3551.727175] RSP [ 3551.727177] CR2: 0000000000000000 Avoid this inconsistent state and system crash by acquiring the rtnl lock for the entire duration of device initialization. Re-factor the code to remove the rtnl lock from the individual function and acquire and release it from the caller. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Fixes: 6e04b1035689 ("RDMA/bnxt_re: Fix broken RoCE driver due to recent L2 driver changes") Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit f5fad711c06e652f90f581fc7c2caee327c33d31 Author: Johan Hovold Date: Mon Sep 24 15:28:10 2018 +0200 USB: serial: simple: add Motorola Tetra MTP6550 id Add device-id for the Motorola Tetra radio MTP6550. Bus 001 Device 004: ID 0cad:9012 Motorola CGISS Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x0cad Motorola CGISS idProduct 0x9012 bcdDevice 24.16 iManufacturer 1 Motorola Solutions, Inc. iProduct 2 TETRA PEI interface iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 55 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 3 Generic Serial config bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 Device Status: 0x0000 (Bus Powered) Reported-by: Hans Hult Cc: stable Signed-off-by: Johan Hovold commit 02214bfc89c71bcc5167f653994cfa5c57f10ff1 Merge: 6bf4ca7fbc85 324493fba775 Author: Greg Kroah-Hartman Date: Mon Sep 24 15:16:41 2018 +0200 Merge tag 'media/v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Mauro briefly writes: "media fixes for v4.19-rc5 some drivers and Kbuild fixes" * tag 'media/v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: platform: fix cros-ec-cec build error media: staging/media/mt9t031/Kconfig: remove bogus entry media: i2c: mt9v111: Fix v4l2-ctrl error handling media: camss: add missing includes media: camss: Use managed memory allocations media: camss: mark PM functions as __maybe_unused media: af9035: prevent buffer overflow on write media: video_function_calls.rst: drop obsolete video-set-attributes reference commit 8604895a34d92f5e186ceb931b0d1b384030ea3d Author: Michael Bringmann Date: Thu Sep 20 11:45:13 2018 -0500 powerpc/pseries: Fix unitialized timer reset on migration After migration of a powerpc LPAR, the kernel executes code to update the system state to reflect new platform characteristics. Such changes include modifications to device tree properties provided to the system by PHYP. Property notifications received by the post_mobility_fixup() code are passed along to the kernel in general through a call to of_update_property() which in turn passes such events back to all modules through entries like the '.notifier_call' function within the NUMA module. When the NUMA module updates its state, it resets its event timer. If this occurs after a previous call to stop_topology_update() or on a system without VPHN enabled, the code runs into an unitialized timer structure and crashes. This patch adds a safety check along this path toward the problem code. An example crash log is as follows. ibmvscsi 30000081: Re-enabling adapter! ------------[ cut here ]------------ kernel BUG at kernel/time/timer.c:958! Oops: Exception in kernel mode, sig: 5 [#1] LE SMP NR_CPUS=2048 NUMA pSeries Modules linked in: nfsv3 nfs_acl nfs tcp_diag udp_diag inet_diag lockd unix_diag af_packet_diag netlink_diag grace fscache sunrpc xts vmx_crypto pseries_rng sg binfmt_misc ip_tables xfs libcrc32c sd_mod ibmvscsi ibmveth scsi_transport_srp dm_mirror dm_region_hash dm_log dm_mod CPU: 11 PID: 3067 Comm: drmgr Not tainted 4.17.0+ #179 ... NIP mod_timer+0x4c/0x400 LR reset_topology_timer+0x40/0x60 Call Trace: 0xc0000003f9407830 (unreliable) reset_topology_timer+0x40/0x60 dt_update_callback+0x100/0x120 notifier_call_chain+0x90/0x100 __blocking_notifier_call_chain+0x60/0x90 of_property_notify+0x90/0xd0 of_update_property+0x104/0x150 update_dt_property+0xdc/0x1f0 pseries_devicetree_update+0x2d0/0x510 post_mobility_fixup+0x7c/0xf0 migration_store+0xa4/0xc0 kobj_attr_store+0x30/0x60 sysfs_kf_write+0x64/0xa0 kernfs_fop_write+0x16c/0x240 __vfs_write+0x40/0x200 vfs_write+0xc8/0x240 ksys_write+0x5c/0x100 system_call+0x58/0x6c Fixes: 5d88aa85c00b ("powerpc/pseries: Update CPU maps when device tree is updated") Cc: stable@vger.kernel.org # v3.10+ Signed-off-by: Michael Bringmann Signed-off-by: Michael Ellerman commit 9ff3541e3ddf96800ce8fcd225c9e7956da49418 Author: Srinivas Pandruvada Date: Tue Sep 11 16:45:43 2018 -0700 HID: intel-ish-hid: Enable Ice Lake mobile Added PCI ID for Ice Lake mobile platform. Signed-off-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina commit afbb1169ed5b58cfca017e368b53e019cf285853 Author: Hans de Goede Date: Wed Sep 19 20:52:45 2018 +0200 HID: i2c-hid: Remove RESEND_REPORT_DESCR quirk and its handling Commit 52cf93e63ee6 ("HID: i2c-hid: Don't reset device upon system resume") removes the need for the RESEND_REPORT_DESCR quirk for Raydium devices, but kept it for the SIS device id 10FB touchscreens, as the author of that commit could not determine if the quirk is still necessary there. I've tested suspend/resume on a Toshiba Click Mini L9W-B which is the device for which this quirk was added in the first place and with the "Don't reset device upon system resume" fix the quirk is no longer necessary, so this commit removes it. Note even better I also had some other devices with SIS touchscreens which suspend/resume issues, where the RESEND_REPORT_DESCR quirk did not help. I've also tested these devices with the "Don't reset device upon system resume" fix and I'm happy to report that that fix also fixes touchscreen resume on the following devices: Asus T100HA Asus T200TA Peaq C1010 Cc: Kai-Heng Feng Acked-by: Benjamin Tissoires Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 864f893f31eecf4d944539ad5ec1d004aefc3f41 Merge: 6bf4ca7fbc85 4451d3f59f2a Author: Thomas Gleixner Date: Mon Sep 24 10:55:38 2018 +0200 Merge branch 'clockevents/4.19-fixes' of https://git.linaro.org/people/daniel.lezcano/linux into timers/urgent Pull clockevent fixed from Daniel Lezcano: - Add the CLOCK_SOURCE_SUSPEND_NONSTOP for non-am43 SoCs (Keerthy) - Fix set_next_event handler for the fttmr010 (Tao Ren) commit a725356b6659469d182d662f22d770d83d3bc7b5 Author: Amir Goldstein Date: Tue Sep 18 16:34:34 2018 +0300 vfs: swap names of {do,vfs}_clone_file_range() Commit 031a072a0b8a ("vfs: call vfs_clone_file_range() under freeze protection") created a wrapper do_clone_file_range() around vfs_clone_file_range() moving the freeze protection to former, so overlayfs could call the latter. The more common vfs practice is to call do_xxx helpers from vfs_xxx helpers, where freeze protecction is taken in the vfs_xxx helper, so this anomality could be a source of confusion. It seems that commit 8ede205541ff ("ovl: add reflink/copyfile/dedup support") may have fallen a victim to this confusion - ovl_clone_file_range() calls the vfs_clone_file_range() helper in the hope of getting freeze protection on upper fs, but in fact results in overlayfs allowing to bypass upper fs freeze protection. Swap the names of the two helpers to conform to common vfs practice and call the correct helpers from overlayfs and nfsd. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit d9d150ae50675e3c1d68047aafb2e981be685d90 Author: Amir Goldstein Date: Tue Sep 18 16:34:33 2018 +0300 ovl: fix freeze protection bypass in ovl_clone_file_range() Tested by doing clone on overlayfs while upper xfs+reflink is frozen: xfs_io -f /ovl/y fsfreeze -f /xfs xfs_io> reflink /ovl/x Before the fix xfs_io enters xfs_reflink_remap_range() and blocks in xfs_trans_alloc(). After the fix, xfs_io blocks outside xfs code in ovl_clone_file_range(). Fixes: 8ede205541ff ("ovl: add reflink/copyfile/dedup support") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 898cc19d8af2d6a80a9f2804b0db2e83c5dd8863 Author: Amir Goldstein Date: Tue Sep 18 16:34:32 2018 +0300 ovl: fix freeze protection bypass in ovl_write_iter() Tested by re-writing to an open overlayfs file while upper ext4 is frozen: xfs_io -f /ovl/x xfs_io> pwrite 0 4096 fsfreeze -f /ext4 xfs_io> pwrite 0 4096 WARNING: CPU: 0 PID: 1492 at fs/ext4/ext4_jbd2.c:53 \ ext4_journal_check_start+0x48/0x82 After the fix, the second write blocks in ovl_write_iter() and avoids hitting WARN_ON(sb->s_writers.frozen == SB_FREEZE_COMPLETE) in ext4_journal_check_start(). Fixes: 2a92e07edc5e ("ovl: add ovl_write_iter()") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 63e132528032ce937126aba591a7b37ec593a6bb Author: Amir Goldstein Date: Tue Sep 18 16:34:31 2018 +0300 ovl: fix memory leak on unlink of indexed file The memory leak was detected by kmemleak when running xfstests overlay/051,053 Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries") Cc: # v4.13 Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit d26ed6b0e5e23190d43ab34bc69cbecdc464a2cf Author: Friedemann Gerold Date: Sat Sep 15 18:03:39 2018 +0300 net: aquantia: memory corruption on jumbo frames This patch fixes skb_shared area, which will be corrupted upon reception of 4K jumbo packets. Originally build_skb usage purpose was to reuse page for skb to eliminate needs of extra fragments. But that logic does not take into account that skb_shared_info should be reserved at the end of skb data area. In case packet data consumes all the page (4K), skb_shinfo location overflows the page. As a consequence, __build_skb zeroed shinfo data above the allocated page, corrupting next page. The issue is rarely seen in real life because jumbo are normally larger than 4K and that causes another code path to trigger. But it 100% reproducible with simple scapy packet, like: sendp(IP(dst="192.168.100.3") / TCP(dport=443) \ / Raw(RandString(size=(4096-40))), iface="enp1s0") Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code") Reported-by: Friedemann Gerold Reported-by: Michael Rauch Signed-off-by: Friedemann Gerold Tested-by: Nikita Danilov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 841dfa43788a309d353b3b7a81c85ed8d3eac130 Merge: 16fdf8ba9839 765cdc209cb8 Author: David S. Miller Date: Sun Sep 23 21:55:26 2018 -0700 Merge branch 'netpoll-avoid-capture-effects-for-NAPI-drivers' Eric Dumazet says: ==================== netpoll: avoid capture effects for NAPI drivers As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture, showing one ksoftirqd eating all cycles can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. It seems that all networking drivers that do use NAPI for their TX completions, should not provide a ndo_poll_controller() : Most NAPI drivers have netpoll support already handled in core networking stack, since netpoll_poll_dev() uses poll_napi(dev) to iterate through registered NAPI contexts for a device. This patch series take care of the first round, we will handle other drivers in future rounds. ==================== Signed-off-by: David S. Miller commit 765cdc209cb89fb81215310a066cd0a3018ffef7 Author: Eric Dumazet Date: Fri Sep 21 15:27:52 2018 -0700 tun: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. tun uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 0825ce70318e9c576acbdd5ceb4a8d563263cf8f Author: Eric Dumazet Date: Fri Sep 21 15:27:51 2018 -0700 nfp: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. nfp uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Jakub Kicinski Acked-by: Jakub Kicinski Tested-by: Jakub Kicinski Signed-off-by: David S. Miller commit 58e0e22bff638055278ea73e34d0d07a95260790 Author: Eric Dumazet Date: Fri Sep 21 15:27:50 2018 -0700 bnxt: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. bnxt uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Michael Chan Signed-off-by: David S. Miller commit d8ea6a91ad70ae0881d76446df27d3f58fd478c3 Author: Eric Dumazet Date: Fri Sep 21 15:27:49 2018 -0700 bnx2x: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. bnx2x uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Ariel Elior Signed-off-by: David S. Miller commit 9c29bcd189f4ab1644b7125713602532d0aefdb7 Author: Eric Dumazet Date: Fri Sep 21 15:27:48 2018 -0700 mlx5: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. mlx5 uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Saeed Mahameed Signed-off-by: David S. Miller commit a24b66c249f71dde11da5ba3b4c397a42ece3fc9 Author: Eric Dumazet Date: Fri Sep 21 15:27:47 2018 -0700 mlx4: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. mlx4 uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Tariq Toukan Signed-off-by: David S. Miller commit 1aa28fb98368078bcaf527bf46c0e001db934414 Author: Eric Dumazet Date: Fri Sep 21 15:27:46 2018 -0700 i40evf: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. i40evf uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Jeff Kirsher Signed-off-by: David S. Miller commit 158a08a694c4ecf9574fe452db24a6b4943853aa Author: Eric Dumazet Date: Fri Sep 21 15:27:45 2018 -0700 ice: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. ice uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Jeff Kirsher Signed-off-by: David S. Miller commit 0542997edece2d75e0bf3e173dfddf1b2b3ef756 Author: Eric Dumazet Date: Fri Sep 21 15:27:44 2018 -0700 igb: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. igb uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Jeff Kirsher Signed-off-by: David S. Miller commit 2753166e4be9df4677745a7f7d9d8daa94938a08 Author: Eric Dumazet Date: Fri Sep 21 15:27:43 2018 -0700 ixgb: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. ixgb uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. This also removes a problematic use of disable_irq() in a context it is forbidden, as explained in commit af3e0fcf7887 ("8139too: Use disable_irq_nosync() in rtl8139_poll_controller()") Signed-off-by: Eric Dumazet Cc: Jeff Kirsher Signed-off-by: David S. Miller commit dda9d57e2d4245c0d8e309ee7399bf2ebfca64ae Author: Eric Dumazet Date: Fri Sep 21 15:27:42 2018 -0700 fm10k: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture lasts for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. fm10k uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Jeff Kirsher Signed-off-by: David S. Miller commit 6f5d941ebadeb1150530f205af0eb5cf5bfeb219 Author: Eric Dumazet Date: Fri Sep 21 15:27:41 2018 -0700 ixgbevf: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. ixgbevf uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet Cc: Jeff Kirsher Signed-off-by: David S. Miller commit b80e71a986c2ab5677dc6b84923cd7030b690800 Author: Eric Dumazet Date: Fri Sep 21 15:27:40 2018 -0700 ixgbe: remove ndo_poll_controller As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. ixgbe uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Reported-by: Song Liu Signed-off-by: Eric Dumazet Tested-by: Song Liu Cc: Jeff Kirsher Signed-off-by: David S. Miller commit 93f62ad5e83a13e0c224dfca5ef40f90c09aad51 Author: Eric Dumazet Date: Fri Sep 21 15:27:39 2018 -0700 bonding: use netpoll_poll_dev() helper We want to allow NAPI drivers to no longer provide ndo_poll_controller() method, as it has been proven problematic. team driver must not look at its presence, but instead call netpoll_poll_dev() which factorize the needed actions. Signed-off-by: Eric Dumazet Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Acked-by: Jay Vosburgh Signed-off-by: David S. Miller commit ac3d9dd034e565df2c034ab2ca71f0a9f69153c1 Author: Eric Dumazet Date: Fri Sep 21 15:27:38 2018 -0700 netpoll: make ndo_poll_controller() optional As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. It seems that all networking drivers that do use NAPI for their TX completions, should not provide a ndo_poll_controller(). NAPI drivers have netpoll support already handled in core networking stack, since netpoll_poll_dev() uses poll_napi(dev) to iterate through registered NAPI contexts for a device. This patch allows netpoll_poll_dev() to process NAPI contexts even for drivers not providing ndo_poll_controller(), allowing for following patches in NAPI drivers. Also we export netpoll_poll_dev() so that it can be called by bonding/team drivers in following patches. Reported-by: Song Liu Signed-off-by: Eric Dumazet Tested-by: Song Liu Signed-off-by: David S. Miller commit 4451d3f59f2a6f95e5d205c2d04ea072955d080d Author: Tao Ren Date: Wed Sep 19 15:13:31 2018 -0700 clocksource/drivers/fttmr010: Fix set_next_event handler Currently, the aspeed MATCH1 register is updated to in set_next_event handler, with the assumption that COUNT register value is preserved when the timer is disabled and it continues decrementing after the timer is enabled. But the assumption is wrong: RELOAD register is loaded into COUNT register when the aspeed timer is enabled, which means the next event may be delayed because timer interrupt won't be generated until <0xFFFFFFFF - current_count + cycles>. The problem can be fixed by updating RELOAD register to , and COUNT register will be re-loaded when the timer is enabled and interrupt is generated when COUNT register overflows. The test result on Facebook Backpack-CMM BMC hardware (AST2500) shows the issue is fixed: without the patch, usleep(100) suspends the process for several milliseconds (and sometimes even over 40 milliseconds); after applying the fix, usleep(100) takes averagely 240 microseconds to return under the same workload level. Signed-off-by: Tao Ren Reviewed-by: Linus Walleij Tested-by: Lei YU Signed-off-by: Daniel Lezcano commit 16fdf8ba98391650ce4bc4f3f71629d8a413bc21 Author: David S. Miller Date: Sun Sep 23 12:25:15 2018 -0700 rds: Fix build regression. Use DECLARE_* not DEFINE_* Fixes: 8360ed6745df ("RDS: IB: Use DEFINE_PER_CPU_SHARED_ALIGNED for rds_ib_stats") Signed-off-by: David S. Miller commit 6bf4ca7fbc85d80446ac01c0d1d77db4d91a6d84 Author: Greg Kroah-Hartman Date: Sun Sep 23 19:15:18 2018 +0200 Linux 4.19-rc5 commit d02771fb166274e75ebda8aefc86ea2816416165 Merge: 18d49ec3c62f 10492ee8ed91 Author: Greg Kroah-Hartman Date: Sun Sep 23 17:19:27 2018 +0200 Merge tag 'mfd-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Lee writes: "MFD fixes for v4.19 - Fix Dialog DA9063 regulator constraints issue causing failure in probe - Fix OMAP Device Tree compatible strings to match DT" * tag 'mfd-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: mfd: omap-usb-host: Fix dts probe of children mfd: da9063: Fix DT probing with constraints commit e6f0e1c7569508f5b0e23cbac6e5d9da3f9bb284 Merge: a4986b08287e 13b91ed77a65 Author: Olof Johansson Date: Sun Sep 23 05:30:28 2018 -0700 Merge tag 'sunxi-fixes-for-4.19-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into fixes Allwinner fixes - round 2 One additional fix regarding HDMI on the R40 SoC. Based on preliminary tests and code dumps for the R40, it was thought that the whole HDMI block was the same on the R40 and A64. Recent tests regarding the A64 showed that this was not the case. The HDMI PHY on the A64 only has one clock parent. How this occurs at the hardware level is unclear, as Allwinner has not given any feedback on this matter. Nevertheless it is clear that the hardware acts differently between the A64 and R40 in such a way that the R40's HDMI PHY is not backward compatible with the A64's. As such we need to drop the fallback compatible string in the R40's device tree. This was added in v4.19-rc1. * tag 'sunxi-fixes-for-4.19-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: ARM: dts: sun8i: drop A64 HDMI PHY fallback compatible from R40 DT Signed-off-by: Olof Johansson commit a4986b08287e0868fad6dd1b6e8ed840b2f1003f Author: Antoine Tenart Date: Wed Sep 19 08:58:02 2018 +0200 MAINTAINERS: update the Annapurna Labs maintainer email Free Electrons became Bootlin. Update my email accordingly. Signed-off-by: Antoine Tenart Signed-off-by: Olof Johansson commit 18d49ec3c62f46d7225f822e112742fbe0daf94b Merge: a83f87c1d2a9 d59f532480f5 Author: Greg Kroah-Hartman Date: Sun Sep 23 13:32:19 2018 +0200 Merge tag 'for-linus-4.19d-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Juergen writes: "xen: Two small fixes for xen drivers." * tag 'for-linus-4.19d-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: issue warning message when out of grant maptrack entries xen/x86/vpmu: Zero struct pt_regs before calling into sample handling code commit a83f87c1d2a93a8fd2413ce8f410b69848db0fd5 Merge: 328c6333ba3d b57e99b4b8b0 Author: Greg Kroah-Hartman Date: Sun Sep 23 08:33:28 2018 +0200 Merge tag 'for-linus-20180922' of git://git.kernel.dk/linux-block Jens writes: "Just a single fix in this pull request, fixing a regression in /proc/diskstats caused by the unification of timestamps." * tag 'for-linus-20180922' of git://git.kernel.dk/linux-block: block: use nanosecond resolution for iostat commit 328c6333ba3df92d5ea7f2cee46379ed57882af6 Merge: 52890d2afc6a 05ab1d8a4b36 Author: Greg Kroah-Hartman Date: Sun Sep 23 08:10:12 2018 +0200 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Thomas writes: "A set of fixes for x86: - Resolve the kvmclock regression on AMD systems with memory encryption enabled. The rework of the kvmclock memory allocation during early boot results in encrypted storage, which is not shareable with the hypervisor. Create a new section for this data which is mapped unencrypted and take care that the later allocations for shared kvmclock memory is unencrypted as well. - Fix the build regression in the paravirt code introduced by the recent spectre v2 updates. - Ensure that the initial static page tables cover the fixmap space correctly so early console always works. This worked so far by chance, but recent modifications to the fixmap layout can - depending on kernel configuration - move the relevant entries to a different place which is not covered by the initial static page tables. - Address the regressions and issues which got introduced with the recent extensions to the Intel Recource Director Technology code. - Update maintainer entries to document reality" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Expand static page table for fixmap space MAINTAINERS: Add X86 MM entry x86/intel_rdt: Add Reinette as co-maintainer for RDT MAINTAINERS: Add Borislav to the x86 maintainers x86/paravirt: Fix some warning messages x86/intel_rdt: Fix incorrect loop end condition x86/intel_rdt: Fix exclusive mode handling of MBA resource x86/intel_rdt: Fix incorrect loop end condition x86/intel_rdt: Do not allow pseudo-locking of MBA resource x86/intel_rdt: Fix unchecked MSR access x86/intel_rdt: Fix invalid mode warning when multiple resources are managed x86/intel_rdt: Global closid helper to support future fixes x86/intel_rdt: Fix size reporting of MBA resource x86/intel_rdt: Fix data type in parsing callbacks x86/kvm: Use __bss_decrypted attribute in shared variables x86/mm: Add .bss..decrypted section to hold shared variables commit 52890d2afc6a06d6121ae1fd4bfc2448b0d67728 Merge: ea092676b0d9 5d05dfd13f20 Author: Greg Kroah-Hartman Date: Sun Sep 23 08:09:16 2018 +0200 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Thomas writes: "- Provide a strerror_r wrapper so lib/bpf can be built on systems without _GNU_SOURCE - Unbreak the man page generator when building out of tree" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf Documentation: Fix out-of-tree asciidoctor man page generation tools lib bpf: Provide wrapper for strerror_r to build in !_GNU_SOURCE systems commit ea092676b0d9c13f20a3bc02c5b0bf537c27346e Merge: 10dc890d4228 008d2f444222 Author: Greg Kroah-Hartman Date: Sun Sep 23 08:06:54 2018 +0200 Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Thomas writes: "Make the EFI arm stub device tree loader default on to unbreak existing EFI boot loaders which do not have DTB support." * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi/libstub/arm: default EFI_ARMSTUB_DTB_LOADER to y commit 474ff2600889e16280dbc6ada8bfecb216169a70 Author: Maciej Żenczykowski Date: Sat Sep 22 01:34:01 2018 -0700 net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN So it should not fail with EPERM even though it is no longer implemented... This is a fix for: (userns)$ egrep ^Cap /proc/self/status CapInh: 0000003fffffffff CapPrm: 0000003fffffffff CapEff: 0000003fffffffff CapBnd: 0000003fffffffff CapAmb: 0000003fffffffff (userns)$ tcpdump -i usb_rndis0 tcpdump: WARNING: usb_rndis0: SIOCETHTOOL(ETHTOOL_GUFO) ioctl failed: Operation not permitted Warning: Kernel filter failed: Bad file descriptor tcpdump: can't remove kernel filter: Bad file descriptor With this change it returns EOPNOTSUPP instead of EPERM. See also https://github.com/the-tcpdump-group/libpcap/issues/689 Fixes: 08a00fea6de2 "net: Remove references to NETIF_F_UFO from ethtool." Cc: David S. Miller Signed-off-by: Maciej Żenczykowski Signed-off-by: David S. Miller commit 41c9b1be335b5afc3b5fb71c5d16f9d5939cd13f Author: Dave Jiang Date: Mon Sep 10 16:18:29 2018 -0700 device-dax: Add missing address_space_operations With address_space_operations missing for device dax, namely the .set_page_dirty, we hit a kernel warning when running destructive ndctl unit test: make TESTS=device-dax check WARNING: CPU: 3 PID: 7380 at fs/buffer.c:581 __set_page_dirty+0xb1/0xc0 Setting address_space_operations to noop_set_page_dirty and noop_invalidatepage for device dax to prevent fallback to __set_page_dirty_buffers() and block_invalidatepage() respectively. Fixes: 2232c6382a ("device-dax: Enable page_mapping()") Acked-by: Jeff Moyer Reported-by: Vishal Verma Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 8360ed6745df6de2d8ddff8e2116789258fe5890 Author: Nathan Chancellor Date: Fri Sep 21 11:04:51 2018 -0700 RDS: IB: Use DEFINE_PER_CPU_SHARED_ALIGNED for rds_ib_stats Clang warns when two declarations' section attributes don't match. net/rds/ib_stats.c:40:1: warning: section does not match previous declaration [-Wsection] DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_ib_statistics, rds_ib_stats); ^ ./include/linux/percpu-defs.h:142:2: note: expanded from macro 'DEFINE_PER_CPU_SHARED_ALIGNED' DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ ^ ./include/linux/percpu-defs.h:93:9: note: expanded from macro 'DEFINE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name; \ ^ ./include/linux/percpu-defs.h:49:26: note: expanded from macro '__PCPU_ATTRS' __percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \ ^ net/rds/ib.h:446:1: note: previous attribute is here DECLARE_PER_CPU(struct rds_ib_statistics, rds_ib_stats); ^ ./include/linux/percpu-defs.h:111:2: note: expanded from macro 'DECLARE_PER_CPU' DECLARE_PER_CPU_SECTION(type, name, "") ^ ./include/linux/percpu-defs.h:87:9: note: expanded from macro 'DECLARE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name ^ ./include/linux/percpu-defs.h:49:26: note: expanded from macro '__PCPU_ATTRS' __percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \ ^ 1 warning generated. The initial definition was added in commit ec16227e1414 ("RDS/IB: Infiniband transport") and the cache aligned definition was added in commit e6babe4cc4ce ("RDS/IB: Stats and sysctls") right after. The definition probably should have been updated in net/rds/ib.h, which is what this patch does. Link: https://github.com/ClangBuiltLinux/linux/issues/114 Signed-off-by: Nathan Chancellor Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit b57e99b4b8b0ebdf9707424e7ddc0c392bdc5fe6 Author: Omar Sandoval Date: Fri Sep 21 16:44:34 2018 -0700 block: use nanosecond resolution for iostat Klaus Kusche reported that the I/O busy time in /proc/diskstats was not updating properly on 4.18. This is because we started using ktime to track elapsed time, and we convert nanoseconds to jiffies when we update the partition counter. However, this gets rounded down, so any I/Os that take less than a jiffy are not accounted for. Previously in this case, the value of jiffies would sometimes increment while we were doing I/O, so at least some I/Os were accounted for. Let's convert the stats to use nanoseconds internally. We still report milliseconds as before, now more accurately than ever. The value is still truncated to 32 bits for backwards compatibility. Fixes: 522a777566f5 ("block: consolidate struct request timestamp fields") Cc: stable@vger.kernel.org Reported-by: Klaus Kusche Signed-off-by: Omar Sandoval Signed-off-by: Jens Axboe commit 8ac1ee6f4d62e781e3b3fd8b9c42b70371427669 Author: Nathan Chancellor Date: Fri Sep 21 02:44:12 2018 -0700 net/mlx4: Use cpumask_available for eq->affinity_mask Clang warns that the address of a pointer will always evaluated as true in a boolean context: drivers/net/ethernet/mellanox/mlx4/eq.c:243:11: warning: address of array 'eq->affinity_mask' will always evaluate to 'true' [-Wpointer-bool-conversion] if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask)) ~~~~~^~~~~~~~~~~~~ 1 warning generated. Use cpumask_available, introduced in commit f7e30f01a9e2 ("cpumask: Add helper cpumask_available()"), which does the proper checking and avoids this warning. Link: https://github.com/ClangBuiltLinux/linux/issues/86 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit 83fe9a966111b51a34f10c35e568e45bff34de48 Author: Dan Carpenter Date: Fri Sep 21 11:07:55 2018 +0300 devlink: double free in devlink_resource_fill() Smatch reports that devlink_dpipe_send_and_alloc_skb() frees the skb on error so this is a double free. We fixed a bunch of these bugs in commit 7fe4d6dcbcb4 ("devlink: Remove redundant free on error path") but we accidentally overlooked this one. Fixes: d9f9b9a4d05f ("devlink: Add support for resource abstraction") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit e6ce3822a9f264b3f24c1acdc624131fb014f2f0 Author: YueHaibing Date: Fri Sep 21 11:46:37 2018 +0800 net: apple: fix return type of ndo_start_xmit function The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t. Found by coccinelle. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 648c361a568dcd098a3496c6c66bca4c8473e52b Author: YueHaibing Date: Fri Sep 21 11:44:05 2018 +0800 net: i825xx: fix return type of ndo_start_xmit function The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t. Found by coccinelle. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit f0f25516e3b9efff2a34059347d13361d26e314a Author: YueHaibing Date: Fri Sep 21 11:35:11 2018 +0800 net: wiznet: fix return type of ndo_start_xmit function The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t. Found by coccinelle. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 28d304efb88f18aadfe9219f0e4b2b0ef9558a3b Author: YueHaibing Date: Fri Sep 21 11:05:50 2018 +0800 net: sgi: fix return type of ndo_start_xmit function The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t. Found by coccinelle. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit f3bf939f3d4552becb115d76e17b3e5957bab4a2 Author: YueHaibing Date: Fri Sep 21 11:02:37 2018 +0800 net: cirrus: fix return type of ndo_start_xmit function The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t. Found by coccinelle. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 72b462798c2a258725dd741d1c6c139446e20d12 Author: YueHaibing Date: Fri Sep 21 10:53:47 2018 +0800 net: seeq: fix return type of ndo_start_xmit function The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t. Found by coccinelle. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 54be5b8ce33f8d1a05b258070c81ed98f935883d Author: Wei Yongjun Date: Fri Sep 21 02:53:17 2018 +0000 PCI: hv: Fix return value check in hv_pci_assign_slots() In case of error, the function pci_create_slot() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot information") Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 86f9bd1ff61c413a2a251fa736463295e4e24733 Author: Jeff Barnhill <0xeffeff@gmail.com> Date: Fri Sep 21 00:45:27 2018 +0000 net/ipv6: Display all addresses in output of /proc/net/if_inet6 The backend handling for /proc/net/if_inet6 in addrconf.c doesn't properly handle starting/stopping the iteration. The problem is that at some point during the iteration, an overflow is detected and the process is subsequently stopped. The item being shown via seq_printf() when the overflow occurs is not actually shown, though. When start() is subsequently called to resume iterating, it returns the next item, and thus the item that was being processed when the overflow occurred never gets printed. Alter the meaning of the private data member "offset". Currently, when it is not 0 (which only happens at the very beginning), "offset" represents the next hlist item to be printed. After this change, "offset" always represents the current item. This is also consistent with the private data member "bucket", which represents the current bucket, and also the use of "pos" as defined in seq_file.txt: The pos passed to start() will always be either zero, or the most recent pos used in the previous session. Signed-off-by: Jeff Barnhill <0xeffeff@gmail.com> Signed-off-by: David S. Miller commit f88b4c01b97e09535505cf3c327fdbce55c27f00 Author: Sean Tranchetti Date: Thu Sep 20 14:29:45 2018 -0600 netlabel: check for IPV4MASK in addrinfo_get netlbl_unlabel_addrinfo_get() assumes that if it finds the NLBL_UNLABEL_A_IPV4ADDR attribute, it must also have the NLBL_UNLABEL_A_IPV4MASK attribute as well. However, this is not necessarily the case as the current checks in netlbl_unlabel_staticadd() and friends are not sufficent to enforce this. If passed a netlink message with NLBL_UNLABEL_A_IPV4ADDR, NLBL_UNLABEL_A_IPV6ADDR, and NLBL_UNLABEL_A_IPV6MASK attributes, these functions will all call netlbl_unlabel_addrinfo_get() which will then attempt dereference NULL when fetching the non-existent NLBL_UNLABEL_A_IPV4MASK attribute: Unable to handle kernel NULL pointer dereference at virtual address 0 Process unlab (pid: 31762, stack limit = 0xffffff80502d8000) Call trace: netlbl_unlabel_addrinfo_get+0x44/0xd8 netlbl_unlabel_staticremovedef+0x98/0xe0 genl_rcv_msg+0x354/0x388 netlink_rcv_skb+0xac/0x118 genl_rcv+0x34/0x48 netlink_unicast+0x158/0x1f0 netlink_sendmsg+0x32c/0x338 sock_sendmsg+0x44/0x60 ___sys_sendmsg+0x1d0/0x2a8 __sys_sendmsg+0x64/0xb4 SyS_sendmsg+0x34/0x4c el0_svc_naked+0x34/0x38 Code: 51001149 7100113f 540000a0 f9401508 (79400108) ---[ end trace f6438a488e737143 ]--- Kernel panic - not syncing: Fatal exception Signed-off-by: Sean Tranchetti Signed-off-by: David S. Miller commit fad0c40fab14523ca381a30fef88b7c3266bef1c Merge: 080220b68714 5028027844cf Author: Daniel Borkmann Date: Sat Sep 22 02:46:42 2018 +0200 Merge branch 'bpf-sockmap-estab-fixes' John Fastabend says: ==================== Eric noted that using the close callback is not sufficient to catch all transitions from ESTABLISHED state to a LISTEN state. So this series does two things. First, only allow adding socks in ESTABLISH state and second use unhash callback to catch tcp_disconnect() transitions. v2: added check for ESTABLISH state in hash update sockmap as well v3: Do not release lock from unhash in error path, no lock was used in the first place. And drop not so useful code comments v4: convert, if (unhash()) return unhash(); return to if (unhash()) unhash(); return; Thanks for reviewing Yonghong I carried your ACKs forward. ==================== Signed-off-by: Daniel Borkmann commit 5028027844cfc6168e39650abecd817ba64c9d98 Author: John Fastabend Date: Tue Sep 18 09:01:54 2018 -0700 bpf: test_maps, only support ESTABLISHED socks Ensure that sockets added to a sock{map|hash} that is not in the ESTABLISHED state is rejected. Fixes: 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks") Signed-off-by: John Fastabend Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit b05545e15e1ff1d6a6a8593971275f9cc3e6b92b Author: John Fastabend Date: Tue Sep 18 09:01:49 2018 -0700 bpf: sockmap, fix transition through disconnect without close It is possible (via shutdown()) for TCP socks to go trough TCP_CLOSE state via tcp_disconnect() without actually calling tcp_close which would then call our bpf_tcp_close() callback. Because of this a user could disconnect a socket then put it in a LISTEN state which would break our assumptions about sockets always being ESTABLISHED state. To resolve this rely on the unhash hook, which is called in the disconnect case, to remove the sock from the sockmap. Reported-by: Eric Dumazet Fixes: 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks") Signed-off-by: John Fastabend Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 5607fff303636d48b88414c6be353d9fed700af2 Author: John Fastabend Date: Tue Sep 18 09:01:44 2018 -0700 bpf: sockmap only allow ESTABLISHED sock state After this patch we only allow socks that are in ESTABLISHED state or are being added via a sock_ops event that is transitioning into an ESTABLISHED state. By allowing sock_ops events we allow users to manage sockmaps directly from sock ops programs. The two supported sock_ops ops are BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB and BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB. Similar to TLS ULP this ensures sk_user_data is correct. Reported-by: Eric Dumazet Fixes: 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks") Signed-off-by: John Fastabend Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 10dc890d4228cd17ddfd09ba9aaa9221627e29b2 Merge: a27fb6d983c7 96147db1e1df Author: Greg Kroah-Hartman Date: Fri Sep 21 20:01:16 2018 +0200 Merge tag 'pinctrl-v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Linus writes: "Pin control fixes for v4.19: - Two fixes for the Intel pin controllers than cause problems on laptops." * tag 'pinctrl-v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: intel: Do pin translation in other GPIO operations as well pinctrl: cannonlake: Fix gpio base for GPP-E commit f1f1fadacaf08b7cf11714c0c29f8fa4d4ef68a9 Author: Johannes Thumshirn Date: Fri Sep 21 09:01:01 2018 +0200 scsi: sd: don't crash the host on invalid commands When sd_init_command() get's a command with a unknown req_op() it crashes the system via BUG(). This makes debugging the actual reason for the broken request cmd_flags pretty hard as the system is down before it's able to write out debugging data on the serial console or the trace buffer. Change the BUG() to a WARN_ON() and return BLKPREP_KILL to fail gracefully and return an I/O error to the producer of the request. Signed-off-by: Johannes Thumshirn Cc: Hannes Reinecke Cc: Bart Van Assche Cc: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 318ddb34b2052f838aa243d07173e2badf3e630e Author: Wen Xiong Date: Thu Sep 20 19:32:12 2018 -0500 scsi: ipr: System hung while dlpar adding primary ipr adapter back While dlpar adding primary ipr adapter back, driver goes through adapter initialization then schedule ipr_worker_thread to start te disk scan by dropping the host lock, calling scsi_add_device. Then get the adapter reset request again, so driver does scsi_block_requests, this will cause the scsi_add_device get hung until we unblock. But we can't run ipr_worker_thread to do the unblock because its stuck in scsi_add_device. This patch fixes the issue. [mkp: typo and whitespace fixes] Signed-off-by: Wen Xiong Acked-by: Brian King Signed-off-by: Martin K. Petersen commit 8c39e2699f8acb2e29782a834e56306da24937fe Author: Vincent Pelletier Date: Sun Sep 9 04:09:27 2018 +0000 scsi: target: iscsi: Use bin2hex instead of a re-implementation Signed-off-by: Vincent Pelletier Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 1816494330a83f2a064499d8ed2797045641f92c Author: Vincent Pelletier Date: Sun Sep 9 04:09:26 2018 +0000 scsi: target: iscsi: Use hex2bin instead of a re-implementation This change has the following effects, in order of descreasing importance: 1) Prevent a stack buffer overflow 2) Do not append an unnecessary NULL to an anyway binary buffer, which is writing one byte past client_digest when caller is: chap_string_to_hex(client_digest, chap_r, strlen(chap_r)); The latter was found by KASAN (see below) when input value hes expected size (32 hex chars), and further analysis revealed a stack buffer overflow can happen when network-received value is longer, allowing an unauthenticated remote attacker to smash up to 17 bytes after destination buffer (16 bytes attacker-controlled and one null). As switching to hex2bin requires specifying destination buffer length, and does not internally append any null, it solves both issues. This addresses CVE-2018-14633. Beyond this: - Validate received value length and check hex2bin accepted the input, to log this rejection reason instead of just failing authentication. - Only log received CHAP_R and CHAP_C values once they passed sanity checks. ================================================================== BUG: KASAN: stack-out-of-bounds in chap_string_to_hex+0x32/0x60 [iscsi_target_mod] Write of size 1 at addr ffff8801090ef7c8 by task kworker/0:0/1021 CPU: 0 PID: 1021 Comm: kworker/0:0 Tainted: G O 4.17.8kasan.sess.connops+ #2 Hardware name: To be filled by O.E.M. To be filled by O.E.M./Aptio CRB, BIOS 5.6.5 05/19/2014 Workqueue: events iscsi_target_do_login_rx [iscsi_target_mod] Call Trace: dump_stack+0x71/0xac print_address_description+0x65/0x22e ? chap_string_to_hex+0x32/0x60 [iscsi_target_mod] kasan_report.cold.6+0x241/0x2fd chap_string_to_hex+0x32/0x60 [iscsi_target_mod] chap_server_compute_md5.isra.2+0x2cb/0x860 [iscsi_target_mod] ? chap_binaryhex_to_asciihex.constprop.5+0x50/0x50 [iscsi_target_mod] ? ftrace_caller_op_ptr+0xe/0xe ? __orc_find+0x6f/0xc0 ? unwind_next_frame+0x231/0x850 ? kthread+0x1a0/0x1c0 ? ret_from_fork+0x35/0x40 ? ret_from_fork+0x35/0x40 ? iscsi_target_do_login_rx+0x3bc/0x4c0 [iscsi_target_mod] ? deref_stack_reg+0xd0/0xd0 ? iscsi_target_do_login_rx+0x3bc/0x4c0 [iscsi_target_mod] ? is_module_text_address+0xa/0x11 ? kernel_text_address+0x4c/0x110 ? __save_stack_trace+0x82/0x100 ? ret_from_fork+0x35/0x40 ? save_stack+0x8c/0xb0 ? 0xffffffffc1660000 ? iscsi_target_do_login+0x155/0x8d0 [iscsi_target_mod] ? iscsi_target_do_login_rx+0x3bc/0x4c0 [iscsi_target_mod] ? process_one_work+0x35c/0x640 ? worker_thread+0x66/0x5d0 ? kthread+0x1a0/0x1c0 ? ret_from_fork+0x35/0x40 ? iscsi_update_param_value+0x80/0x80 [iscsi_target_mod] ? iscsit_release_cmd+0x170/0x170 [iscsi_target_mod] chap_main_loop+0x172/0x570 [iscsi_target_mod] ? chap_server_compute_md5.isra.2+0x860/0x860 [iscsi_target_mod] ? rx_data+0xd6/0x120 [iscsi_target_mod] ? iscsit_print_session_params+0xd0/0xd0 [iscsi_target_mod] ? cyc2ns_read_begin.part.2+0x90/0x90 ? _raw_spin_lock_irqsave+0x25/0x50 ? memcmp+0x45/0x70 iscsi_target_do_login+0x875/0x8d0 [iscsi_target_mod] ? iscsi_target_check_first_request.isra.5+0x1a0/0x1a0 [iscsi_target_mod] ? del_timer+0xe0/0xe0 ? memset+0x1f/0x40 ? flush_sigqueue+0x29/0xd0 iscsi_target_do_login_rx+0x3bc/0x4c0 [iscsi_target_mod] ? iscsi_target_nego_release+0x80/0x80 [iscsi_target_mod] ? iscsi_target_restore_sock_callbacks+0x130/0x130 [iscsi_target_mod] process_one_work+0x35c/0x640 worker_thread+0x66/0x5d0 ? flush_rcu_work+0x40/0x40 kthread+0x1a0/0x1c0 ? kthread_bind+0x30/0x30 ret_from_fork+0x35/0x40 The buggy address belongs to the page: page:ffffea0004243bc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x17fffc000000000() raw: 017fffc000000000 0000000000000000 0000000000000000 00000000ffffffff raw: ffffea0004243c20 ffffea0004243ba0 0000000000000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801090ef680: f2 f2 f2 f2 f2 f2 f2 01 f2 f2 f2 f2 f2 f2 f2 00 ffff8801090ef700: f2 f2 f2 f2 f2 f2 f2 00 02 f2 f2 f2 f2 f2 f2 00 >ffff8801090ef780: 00 f2 f2 f2 f2 f2 f2 00 00 f2 f2 f2 f2 f2 f2 00 ^ ffff8801090ef800: 00 f2 f2 f2 f2 f2 f2 00 00 00 00 02 f2 f2 f2 f2 ffff8801090ef880: f2 f2 f2 00 00 00 00 00 00 00 00 f2 f2 f2 f2 00 ================================================================== Signed-off-by: Vincent Pelletier Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 652ef42c134da1bbb03bd4c9b4291dfaf8d7febb Author: Antoine Tenart Date: Thu Sep 20 12:08:54 2018 +0200 net: mscc: fix the frame extraction into the skb When extracting frames from the Ocelot switch, the frame check sequence (FCS) is present at the end of the data extracted. The FCS was put into the sk buffer which introduced some issues (as length related ones), as the FCS shouldn't be part of an Rx sk buffer. This patch fixes the Ocelot switch extraction behaviour by discarding the FCS. Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support") Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller commit a27fb6d983c7b5bb0129ae4d7a7c81758173bfab Merge: 0eba8697bce1 26b471c7e2f7 Author: Greg Kroah-Hartman Date: Fri Sep 21 16:21:42 2018 +0200 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Paolo writes: "It's mostly small bugfixes and cleanups, mostly around x86 nested virtualization. One important change, not related to nested virtualization, is that the ability for the guest kernel to trap CPUID instructions (in Linux that's the ARCH_SET_CPUID arch_prctl) is now masked by default. This is because the feature is detected through an MSR; a very bad idea that Intel seems to like more and more. Some applications choke if the other fields of that MSR are not initialized as on real hardware, hence we have to disable the whole MSR by default, as was the case before Linux 4.12." * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (23 commits) KVM: nVMX: Fix bad cleanup on error of get/set nested state IOCTLs kvm: selftests: Add platform_info_test KVM: x86: Control guest reads of MSR_PLATFORM_INFO KVM: x86: Turbo bits in MSR_PLATFORM_INFO nVMX x86: Check VPID value on vmentry of L2 guests nVMX x86: check posted-interrupt descriptor addresss on vmentry of L2 KVM: nVMX: Wake blocked vCPU in guest-mode if pending interrupt in virtual APICv KVM: VMX: check nested state and CR4.VMXE against SMM kvm: x86: make kvm_{load|put}_guest_fpu() static x86/hyper-v: rename ipi_arg_{ex,non_ex} structures KVM: VMX: use preemption timer to force immediate VMExit KVM: VMX: modify preemption timer bit only when arming timer KVM: VMX: immediately mark preemption timer expired only for zero value KVM: SVM: Switch to bitmap_zalloc() KVM/MMU: Fix comment in walk_shadow_page_lockless_end() kvm: selftests: use -pthread instead of -lpthread KVM: x86: don't reset root in kvm_mmu_setup() kvm: mmu: Don't read PDPTEs when paging is not enabled x86/kvm/lapic: always disable MMIO interface in x2APIC mode KVM: s390: Make huge pages unavailable in ucontrol VMs ... commit 0eba8697bce15dc06e2b5c4c66d672c37ca43be0 Merge: 211b100a5ced f061c1cc404a Author: Greg Kroah-Hartman Date: Fri Sep 21 15:29:44 2018 +0200 Merge tag 'upstream-4.19-rc4' of git://git.infradead.org/linux-ubifs Richard writes: "This pull request contains fixes for UBIFS: - A wrong UBIFS assertion in mount code - Fix for a NULL pointer deref in mount code - Revert of a bad fix for xattrs" * tag 'upstream-4.19-rc4' of git://git.infradead.org/linux-ubifs: Revert "ubifs: xattr: Don't operate on deleted inodes" ubifs: drop false positive assertion ubifs: Check for name being NULL while mounting commit 98e616fe7c94f9c787092b6364405d99bdf42153 Author: zhong jiang Date: Sat Sep 8 21:44:08 2018 +0800 ieee802154: remove unecessary condition check before debugfs_remove_recursive debugfs_remove_recursive has taken IS_ERR_OR_NULL into account. So just remove the condition check before debugfs_remove_recursive. Signed-off-by: zhong jiang Signed-off-by: Stefan Schmidt commit 89578d04b52c872aef6b1257b5f6caf6bcc35abe Author: Alexandru Gheorghe Date: Wed Aug 22 16:18:19 2018 +0100 drm/malidp: Fix writeback in NV12 When we want to writeback to memory in NV12 format we need to program the RGB2YUV coefficients. Currently, we don't program the coefficients and NV12 doesn't work at all. This patchset fixes that by programming a sane default(bt709, limited range) as rgb2yuv coefficients. In the long run, probably we need to think of a way for userspace to be able to program that, but for now I think this is better than not working at all or not advertising NV12 as a supported format for memwrite. Changes since v1: - Write the rgb2yuv coefficients only once, since we don't change them at all, just write them the first time NV12 is programmed, suggested by Brian Starkey, here [1] [1] https://lists.freedesktop.org/archives/dri-devel/2018-August/186819.html Signed-off-by: Alexandru Gheorghe Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit 69be1984ded00a11b1ed0888c6d8e4f35370372f Author: Alexandru Gheorghe Date: Mon Jul 16 11:07:07 2018 +0100 drm: mali-dp: Call drm_crtc_vblank_reset on device init Currently, if userspace calls drm_wait_vblank before the crtc is activated the crtc vblank_enable hook is called, which in case of malidp driver triggers some warninngs. This happens because on device init we don't inform the drm core about the vblank state by calling drm_crtc_vblank_on/off/reset which together with drm_vblank_get have some magic that prevents calling drm_vblank_enable when crtc is off. Signed-off-by: Alexandru Gheorghe Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit 5b3686c7aaade973b8806dba4ecc99bec8c988f3 Author: YueHaibing Date: Thu Aug 9 14:44:29 2018 +0800 ieee802154: Use kmemdup instead of duplicating it in ca8210_test_int_driver_write Replace calls to kmalloc followed by a memcpy with a direct call to kmemdup. Signed-off-by: YueHaibing Signed-off-by: Stefan Schmidt commit 211b100a5ceda9d1856a3f84334f9ca5f680b638 Merge: a38fd7d808e6 d611aaf336b2 Author: Greg Kroah-Hartman Date: Fri Sep 21 09:41:05 2018 +0200 Merge tag 'for-linus-20180920' of git://git.kernel.dk/linux-block Jens writes: "Storage fixes for 4.19-rc5 - Fix for leaking kernel pointer in floppy ioctl (Andy Whitcroft) - NVMe pull request from Christoph, and a single ANA log page fix (Hannes) - Regression fix for libata qd32 support, where we trigger an illegal active command transition. This fixes a CD-ROM detection issue that was reported, but could also trigger premature completion of the internal tag (me)" * tag 'for-linus-20180920' of git://git.kernel.dk/linux-block: floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl libata: mask swap internal and hardware tag nvme: count all ANA groups for ANA Log page commit a38fd7d808e6a9dcc8fac30fc870ccb88ce07221 Merge: 234b69e3e089 4fcb7f8be829 Author: Greg Kroah-Hartman Date: Fri Sep 21 09:11:18 2018 +0200 Merge tag 'drm-fixes-2018-09-21' of git://anongit.freedesktop.org/drm/drm David writes: "drm fixes for 4.19-rc5: - core: fix debugfs for atomic, fix the check for atomic for non-modesetting drivers - amdgpu: adds a new PCI id, some kfd fixes and a sdma fix - i915: a bunch of GVT fixes. - vc4: scaling fix - vmwgfx: modesetting fixes and a old buffer eviction fix - udl: framebuffer destruction fix - sun4i: disable on R40 fix until next kernel - pl111: NULL termination on table fix" * tag 'drm-fixes-2018-09-21' of git://anongit.freedesktop.org/drm/drm: (21 commits) drm/amdkfd: Fix ATS capablity was not reported correctly on some APUs drm/amdkfd: Change the control stack MTYPE from UC to NC on GFX9 drm/amdgpu: Fix SDMA HQD destroy error on gfx_v7 drm/vmwgfx: Fix buffer object eviction drm/vmwgfx: Don't impose STDU limits on framebuffer size drm/vmwgfx: limit mode size for all display unit to texture_max drm/vmwgfx: limit screen size to stdu_max during check_modeset drm/vmwgfx: don't check for old_crtc_state enable status drm/amdgpu: add new polaris pci id drm: sun4i: drop second PLL from A64 HDMI PHY drm: fix drm_drv_uses_atomic_modeset on non modesetting drivers. drm/i915/gvt: clear ggtt entries when destroy vgpu drm/i915/gvt: request srcu_read_lock before checking if one gfn is valid drm/i915/gvt: Add GEN9_CLKGATE_DIS_4 to default BXT mmio handler drm/i915/gvt: Init PHY related registers for BXT drm/atomic: Use drm_drv_uses_atomic_modeset() for debugfs creation drm/fb-helper: Remove set but not used variable 'connector_funcs' drm: udl: Destroy framebuffer only if it was initialized drm/sun4i: Remove R40 display pipeline compatibles drm/pl111: Make sure of_device_id tables are NULL terminated ... commit 13cc6f48c7434ce46ba6dbc90003a136a263d75a Author: Horia Geantă Date: Fri Sep 14 18:34:28 2018 +0300 crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic In some cases the zero-length hw_desc array at the end of ablkcipher_edesc struct requires for 4B of tail padding. Due to tail padding and the way pointers to S/G table and IV are computed: edesc->sec4_sg = (void *)edesc + sizeof(struct ablkcipher_edesc) + desc_bytes; iv = (u8 *)edesc->hw_desc + desc_bytes + sec4_sg_bytes; first 4 bytes of IV are overwritten by S/G table. Update computation of pointer to S/G table to rely on offset of hw_desc member and not on sizeof() operator. Cc: # 4.13+ Fixes: 115957bb3e59 ("crypto: caam - fix IV DMA mapping and updating") Signed-off-by: Horia Geantă Signed-off-by: Herbert Xu commit 10bc6a6042c900934a097988b5d50e3cf3f91781 Author: Heiner Kallweit Date: Thu Sep 20 22:47:09 2018 +0200 r8169: fix autoneg issue on resume with RTL8168E It was reported that chip version 33 (RTL8168E) ends up with 10MBit/Half on a 1GBit link after resuming from S3 (with different link partners). For whatever reason the PHY on this chip doesn't properly start a renegotiation when soft-reset. Explicitly requesting a renegotiation fixes this. Fixes: a2965f12fde6 ("r8169: remove rtl8169_set_speed_xmii") Signed-off-by: Heiner Kallweit Reported-by: Neil MacLeod Tested-by: Neil MacLeod Signed-off-by: David S. Miller commit 9e210178267b80c4eeb832fade7e146a18c84915 Author: James Smart Date: Thu Sep 13 15:41:10 2018 -0700 scsi: lpfc: Synchronize access to remoteport via rport The driver currently uses the ndlp to get the local rport which is then used to get the nvme transport remoteport pointer. There can be cases where a stale remoteport pointer is obtained as synchronization isn't done through the different dereferences. Correct by using locks to synchronize the dereferences. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit d87161bea405e3260377026ca8a704a3f68bd67a Author: Adrian Hunter Date: Thu Sep 13 14:28:48 2018 +0300 scsi: ufs: Disable blk-mq for now blk-mq does not support runtime pm, so disable blk-mq support for now. Fixes: d5038a13eca7 ("scsi: core: switch to scsi-mq by default") Signed-off-by: Adrian Hunter Acked-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit b4a4957d3d1c328b733fce783b7264996f866ad2 Author: Michael J. Ruhl Date: Thu Sep 20 12:59:14 2018 -0700 IB/hfi1: Fix destroy_qp hang after a link down rvt_destroy_qp() cannot complete until all in process packets have been released from the underlying hardware. If a link down event occurs, an application can hang with a kernel stack similar to: cat /proc//stack quiesce_qp+0x178/0x250 [hfi1] rvt_reset_qp+0x23d/0x400 [rdmavt] rvt_destroy_qp+0x69/0x210 [rdmavt] ib_destroy_qp+0xba/0x1c0 [ib_core] nvme_rdma_destroy_queue_ib+0x46/0x80 [nvme_rdma] nvme_rdma_free_queue+0x3c/0xd0 [nvme_rdma] nvme_rdma_destroy_io_queues+0x88/0xd0 [nvme_rdma] nvme_rdma_error_recovery_work+0x52/0xf0 [nvme_rdma] process_one_work+0x17a/0x440 worker_thread+0x126/0x3c0 kthread+0xcf/0xe0 ret_from_fork+0x58/0x90 0xffffffffffffffff quiesce_qp() waits until all outstanding packets have been freed. This wait should be momentary. During a link down event, the cleanup handling does not ensure that all packets caught by the link down are flushed properly. This is caused by the fact that the freeze path and the link down event is handled the same. This is not correct. The freeze path waits until the HFI is unfrozen and then restarts PIO. A link down is not a freeze event. The link down path cannot restart the PIO until link is restored. If the PIO path is restarted before the link comes up, the application (QP) using the PIO path will hang (until link is restored). Fix by separating the linkdown path from the freeze path and use the link down path for link down events. Close a race condition sc_disable() by acquiring both the progress and release locks. Close a race condition in sc_stop() by moving the setting of the flag bits under the alloc lock. Cc: # 4.9.x+ Fixes: 7724105686e7 ("IB/hfi1: add driver files") Reviewed-by: Mike Marciniszyn Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit d623500b3c4efd8d4e945ac9003c6b87b469a9ab Author: Michael J. Ruhl Date: Thu Sep 20 12:59:05 2018 -0700 IB/hfi1: Fix context recovery when PBC has an UnsupportedVL If a packet stream uses an UnsupportedVL (virtual lane), the send engine will not send the packet, and it will not indicate that an error has occurred. This will cause the packet stream to block. HFI has 8 virtual lanes available for packet streams. Each lane can be enabled or disabled using the UnsupportedVL mask. If a lane is disabled, adding a packet to the send context must be disallowed. The current mask for determining unsupported VLs defaults to 0 (allow all). This is incorrect. Only the VLs that are defined should be allowed. Determine which VLs are disabled (mtu == 0), and set the appropriate unsupported bit in the mask. The correct mask will allow the send engine to error on the invalid VL, and error recovery will work correctly. Cc: # 4.9.x+ Fixes: 7724105686e7 ("IB/hfi1: add driver files") Reviewed-by: Mike Marciniszyn Reviewed-by: Lukasz Odzioba Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 94694d18cf27a6faad91487a38ce516c2b16e7d9 Author: Michael J. Ruhl Date: Thu Sep 20 12:58:56 2018 -0700 IB/hfi1: Invalid user input can result in crash If the number of packets in a user sdma request does not match the actual iovectors being sent, sdma_cleanup can be called on an uninitialized request structure, resulting in a crash similar to this: BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 IP: [] __sdma_txclean+0x57/0x1e0 [hfi1] PGD 8000001044f61067 PUD 1052706067 PMD 0 Oops: 0000 [#1] SMP CPU: 30 PID: 69912 Comm: upsm Kdump: loaded Tainted: G OE ------------ 3.10.0-862.el7.x86_64 #1 Hardware name: Intel Corporation S2600KPR/S2600KPR, BIOS SE5C610.86B.01.01.0019.101220160604 10/12/2016 task: ffff8b331c890000 ti: ffff8b2ed1f98000 task.ti: ffff8b2ed1f98000 RIP: 0010:[] [] __sdma_txclean+0x57/0x1e0 [hfi1] RSP: 0018:ffff8b2ed1f9bab0 EFLAGS: 00010286 RAX: 0000000000008b2b RBX: ffff8b2adf6e0000 RCX: 0000000000000000 RDX: 00000000000000a0 RSI: ffff8b2e9eedc540 RDI: ffff8b2adf6e0000 RBP: ffff8b2ed1f9bad8 R08: 0000000000000000 R09: ffffffffc0b04a06 R10: ffff8b331c890190 R11: ffffe6ed00bf1840 R12: ffff8b3315480000 R13: ffff8b33154800f0 R14: 00000000fffffff2 R15: ffff8b2e9eedc540 FS: 00007f035ac47740(0000) GS:ffff8b331e100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000008 CR3: 0000000c03fe6000 CR4: 00000000001607e0 Call Trace: [] user_sdma_send_pkts+0xdcd/0x1990 [hfi1] [] ? gup_pud_range+0x140/0x290 [] ? hfi1_mmu_rb_insert+0x155/0x1b0 [hfi1] [] hfi1_user_sdma_process_request+0xc5b/0x11b0 [hfi1] [] hfi1_aio_write+0xba/0x110 [hfi1] [] do_sync_readv_writev+0x7b/0xd0 [] do_readv_writev+0xce/0x260 [] ? tty_ldisc_deref+0x19/0x20 [] ? n_tty_ioctl+0xe0/0xe0 [] vfs_writev+0x35/0x60 [] SyS_writev+0x7f/0x110 [] system_call_fastpath+0x1c/0x21 Code: 06 49 c7 47 18 00 00 00 00 0f 87 89 01 00 00 5b 41 5c 41 5d 41 5e 41 5f 5d c3 66 2e 0f 1f 84 00 00 00 00 00 48 8b 4e 10 48 89 fb <48> 8b 51 08 49 89 d4 83 e2 0c 41 81 e4 00 e0 00 00 48 c1 ea 02 RIP [] __sdma_txclean+0x57/0x1e0 [hfi1] RSP CR2: 0000000000000008 There are two exit points from user_sdma_send_pkts(). One (free_tx) merely frees the slab entry and one (free_txreq) cleans the sdma_txreq prior to freeing the slab entry. The free_txreq variation can only be called after one of the sdma_init*() variations has been called. In the panic case, the slab entry had been allocated but not inited. Fix the issue by exiting through free_tx thus avoiding sdma_clean(). Cc: # 4.9.x+ Fixes: 7724105686e7 ("IB/hfi1: add driver files") Reviewed-by: Mike Marciniszyn Reviewed-by: Lukasz Odzioba Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 0dbfaa9f2813787679e296eb5476e40938ab48c8 Author: Ira Weiny Date: Thu Sep 20 12:58:46 2018 -0700 IB/hfi1: Fix SL array bounds check The SL specified by a user needs to be a valid SL. Add a range check to the user specified SL value which protects from running off the end of the SL to SC table. CC: stable@vger.kernel.org Fixes: 7724105686e7 ("IB/hfi1: add driver files") Signed-off-by: Ira Weiny Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 4fcb7f8be829d21bcbb24eef2204fb6b34ed1f80 Merge: 618cc1514b1e 44d8cc6f1a90 Author: Dave Airlie Date: Fri Sep 21 09:52:21 2018 +1000 Merge branch 'drm-fixes-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes A few fixes for 4.19: - Add a new polaris pci id - KFD fixes for raven and gfx7 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180920155850.5455-1-alexander.deucher@amd.com commit 618cc1514b1eed3bc1c46914d73a9914211aa9a4 Merge: 8ca4fff974ad e71cf5918765 Author: Dave Airlie Date: Fri Sep 21 09:50:46 2018 +1000 Merge branch 'vmwgfx-fixes-4.19' of git://people.freedesktop.org/~thomash/linux into drm-fixes A couple of modesetting fixes and a fix for a long-standing buffer-eviction problem cc'd stable. Signed-off-by: Dave Airlie From: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20180920063935.35492-1-thellstrom@vmware.com commit 4eeed3686981ff887bbdd7254139e2eca276534c Author: Majd Dibbiny Date: Tue Sep 18 10:51:37 2018 +0300 RDMA/uverbs: Fix validity check for modify QP Uverbs shouldn't enforce QP state in the command unless the user set the QP state bit in the attribute mask. In addition, only copy qp attr fields which have the corresponding bit set in the attribute mask over to the internal attr structure. Fixes: 88de869bbe4f ("RDMA/uverbs: Ensure validity of current QP state value") Fixes: bc38a6abdd5a ("[PATCH] IB uverbs: core implementation") Signed-off-by: Majd Dibbiny Signed-off-by: Jack Morgenstein Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9024143e700f89d74b8cdaf316a3499d74fc56fe Author: Jisheng Zhang Date: Thu Sep 20 16:32:52 2018 -0500 PCI: dwc: Fix scheduling while atomic issues When programming the inbound/outbound ATUs, we call usleep_range() after each checking PCIE_ATU_ENABLE bit. Unfortunately, the ATU programming can be executed in atomic context: inbound ATU programming could be called through pci_epc_write_header() =>dw_pcie_ep_write_header() =>dw_pcie_prog_inbound_atu() outbound ATU programming could be called through pci_bus_read_config_dword() =>dw_pcie_rd_conf() =>dw_pcie_prog_outbound_atu() Fix this issue by calling mdelay() instead. Fixes: f8aed6ec624f ("PCI: dwc: designware: Add EP mode support") Fixes: d8bbeb39fbf3 ("PCI: designware: Wait for iATU enable") Signed-off-by: Jisheng Zhang [lorenzo.pieralisi@arm.com: commit log update] Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Acked-by: Gustavo Pimentel commit b3027b7746ce1e5a9429715ee6492aca2a6e4cf0 Author: Lorenzo Pieralisi Date: Wed Sep 19 17:06:36 2018 +0100 MAINTAINERS: Move mobiveil PCI driver entry where it belongs Commit 92f9ccca4c08 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver DT bindings") managed to add a MAINTAINERS entry where it does not really belong (ie in the middle of a totally unrelated series of entries and in the wrong alphabetical order). Fix it. Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Cc: Subrahmanya Lingappa commit 05ab1d8a4b36ee912b7087c6da127439ed0a903e Author: Feng Tang Date: Thu Sep 20 10:58:28 2018 +0800 x86/mm: Expand static page table for fixmap space We met a kernel panic when enabling earlycon, which is due to the fixmap address of earlycon is not statically setup. Currently the static fixmap setup in head_64.S only covers 2M virtual address space, while it actually could be in 4M space with different kernel configurations, e.g. when VSYSCALL emulation is disabled. So increase the static space to 4M for now by defining FIXMAP_PMD_NUM to 2, and add a build time check to ensure that the fixmap is covered by the initial static page tables. Fixes: 1ad83c858c7d ("x86_64,vsyscall: Make vsyscall emulation configurable") Suggested-by: Thomas Gleixner Signed-off-by: Feng Tang Signed-off-by: Thomas Gleixner Tested-by: kernel test robot Reviewed-by: Juergen Gross (Xen parts) Cc: H Peter Anvin Cc: Peter Zijlstra Cc: Michal Hocko Cc: Yinghai Lu Cc: Dave Hansen Cc: Andi Kleen Cc: Andy Lutomirsky Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180920025828.23699-1-feng.tang@intel.com commit 234b69e3e089d850a98e7b3145bd00e9b52b1111 Author: Junxiao Bi Date: Thu Sep 20 12:22:51 2018 -0700 ocfs2: fix ocfs2 read block panic While reading block, it is possible that io error return due to underlying storage issue, in this case, BH_NeedsValidate was left in the buffer head. Then when reading the very block next time, if it was already linked into journal, that will trigger the following panic. [203748.702517] kernel BUG at fs/ocfs2/buffer_head_io.c:342! [203748.702533] invalid opcode: 0000 [#1] SMP [203748.702561] Modules linked in: ocfs2 ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs sunrpc dm_switch dm_queue_length dm_multipath bonding be2iscsi iscsi_boot_sysfs bnx2i cnic uio cxgb4i iw_cxgb4 cxgb4 cxgb3i libcxgbi iw_cxgb3 cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ipmi_devintf iTCO_wdt iTCO_vendor_support dcdbas ipmi_ssif i2c_core ipmi_si ipmi_msghandler acpi_pad pcspkr sb_edac edac_core lpc_ich mfd_core shpchp sg tg3 ptp pps_core ext4 jbd2 mbcache2 sr_mod cdrom sd_mod ahci libahci megaraid_sas wmi dm_mirror dm_region_hash dm_log dm_mod [203748.703024] CPU: 7 PID: 38369 Comm: touch Not tainted 4.1.12-124.18.6.el6uek.x86_64 #2 [203748.703045] Hardware name: Dell Inc. PowerEdge R620/0PXXHP, BIOS 2.5.2 01/28/2015 [203748.703067] task: ffff880768139c00 ti: ffff88006ff48000 task.ti: ffff88006ff48000 [203748.703088] RIP: 0010:[] [] ocfs2_read_blocks+0x669/0x7f0 [ocfs2] [203748.703130] RSP: 0018:ffff88006ff4b818 EFLAGS: 00010206 [203748.703389] RAX: 0000000008620029 RBX: ffff88006ff4b910 RCX: 0000000000000000 [203748.703885] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 00000000023079fe [203748.704382] RBP: ffff88006ff4b8d8 R08: 0000000000000000 R09: ffff8807578c25b0 [203748.704877] R10: 000000000f637376 R11: 000000003030322e R12: 0000000000000000 [203748.705373] R13: ffff88006ff4b910 R14: ffff880732fe38f0 R15: 0000000000000000 [203748.705871] FS: 00007f401992c700(0000) GS:ffff880bfebc0000(0000) knlGS:0000000000000000 [203748.706370] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [203748.706627] CR2: 00007f4019252440 CR3: 00000000a621e000 CR4: 0000000000060670 [203748.707124] Stack: [203748.707371] ffff88006ff4b828 ffffffffa0609f52 ffff88006ff4b838 0000000000000001 [203748.707885] 0000000000000000 0000000000000000 ffff880bf67c3800 ffffffffa05eca00 [203748.708399] 00000000023079ff ffffffff81c58b80 0000000000000000 0000000000000000 [203748.708915] Call Trace: [203748.709175] [] ? ocfs2_inode_cache_io_unlock+0x12/0x20 [ocfs2] [203748.709680] [] ? ocfs2_empty_dir_filldir+0x80/0x80 [ocfs2] [203748.710185] [] ocfs2_read_dir_block_direct+0x3b/0x200 [ocfs2] [203748.710691] [] ocfs2_prepare_dx_dir_for_insert.isra.57+0x19f/0xf60 [ocfs2] [203748.711204] [] ? ocfs2_metadata_cache_io_unlock+0x1f/0x30 [ocfs2] [203748.711716] [] ocfs2_prepare_dir_for_insert+0x13a/0x890 [ocfs2] [203748.712227] [] ? ocfs2_check_dir_for_entry+0x8e/0x140 [ocfs2] [203748.712737] [] ocfs2_mknod+0x4b2/0x1370 [ocfs2] [203748.713003] [] ocfs2_create+0x65/0x170 [ocfs2] [203748.713263] [] vfs_create+0xdb/0x150 [203748.713518] [] do_last+0x815/0x1210 [203748.713772] [] ? path_init+0xb9/0x450 [203748.714123] [] path_openat+0x80/0x600 [203748.714378] [] ? handle_pte_fault+0xd15/0x1620 [203748.714634] [] do_filp_open+0x3a/0xb0 [203748.714888] [] ? __alloc_fd+0xa7/0x130 [203748.715143] [] do_sys_open+0x12c/0x220 [203748.715403] [] ? syscall_trace_enter_phase1+0x11b/0x180 [203748.715668] [] ? system_call_after_swapgs+0xe9/0x190 [203748.715928] [] SyS_open+0x1e/0x20 [203748.716184] [] system_call_fastpath+0x18/0xd7 [203748.716440] Code: 00 00 48 8b 7b 08 48 83 c3 10 45 89 f8 44 89 e1 44 89 f2 4c 89 ee e8 07 06 11 e1 48 8b 03 48 85 c0 75 df 8b 5d c8 e9 4d fa ff ff <0f> 0b 48 8b 7d a0 e8 dc c6 06 00 48 b8 00 00 00 00 00 00 00 10 [203748.717505] RIP [] ocfs2_read_blocks+0x669/0x7f0 [ocfs2] [203748.717775] RSP Joesph ever reported a similar panic. Link: https://oss.oracle.com/pipermail/ocfs2-devel/2013-May/008931.html Link: http://lkml.kernel.org/r/20180912063207.29484-1-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Cc: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Changwei Ge Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 172b06c32b949759fe6313abec514bc4f15014f4 Author: Roman Gushchin Date: Thu Sep 20 12:22:46 2018 -0700 mm: slowly shrink slabs with a relatively small number of objects 9092c71bb724 ("mm: use sc->priority for slab shrink targets") changed the way that the target slab pressure is calculated and made it priority-based: delta = freeable >> priority; delta *= 4; do_div(delta, shrinker->seeks); The problem is that on a default priority (which is 12) no pressure is applied at all, if the number of potentially reclaimable objects is less than 4096 (1<<12). This causes the last objects on slab caches of no longer used cgroups to (almost) never get reclaimed. It's obviously a waste of memory. It can be especially painful, if these stale objects are holding a reference to a dying cgroup. Slab LRU lists are reparented on memcg offlining, but corresponding objects are still holding a reference to the dying cgroup. If we don't scan these objects, the dying cgroup can't go away. Most likely, the parent cgroup hasn't any directly charged objects, only remaining objects from dying children cgroups. So it can easily hold a reference to hundreds of dying cgroups. If there are no big spikes in memory pressure, and new memory cgroups are created and destroyed periodically, this causes the number of dying cgroups grow steadily, causing a slow-ish and hard-to-detect memory "leak". It's not a real leak, as the memory can be eventually reclaimed, but it could not happen in a real life at all. I've seen hosts with a steadily climbing number of dying cgroups, which doesn't show any signs of a decline in months, despite the host is loaded with a production workload. It is an obvious waste of memory, and to prevent it, let's apply a minimal pressure even on small shrinker lists. E.g. if there are freeable objects, let's scan at least min(freeable, scan_batch) objects. This fix significantly improves a chance of a dying cgroup to be reclaimed, and together with some previous patches stops the steady growth of the dying cgroups number on some of our hosts. Link: http://lkml.kernel.org/r/20180905230759.12236-1-guro@fb.com Fixes: 9092c71bb724 ("mm: use sc->priority for slab shrink targets") Signed-off-by: Roman Gushchin Acked-by: Rik van Riel Cc: Josef Bacik Cc: Johannes Weiner Cc: Shakeel Butt Cc: Michal Hocko Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 3bf181bc5d8bc86f04ffd538d7fda9e69af1f2c2 Author: YueHaibing Date: Thu Sep 20 12:22:43 2018 -0700 kernel/sys.c: remove duplicated include Link: http://lkml.kernel.org/r/20180821133424.18716-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit b45d71fb89ab8adfe727b9d0ee188ed58582a647 Author: Joel Fernandes (Google) Date: Thu Sep 20 12:22:39 2018 -0700 mm: shmem.c: Correctly annotate new inodes for lockdep Directories and inodes don't necessarily need to be in the same lockdep class. For ex, hugetlbfs splits them out too to prevent false positives in lockdep. Annotate correctly after new inode creation. If its a directory inode, it will be put into a different class. This should fix a lockdep splat reported by syzbot: > ====================================================== > WARNING: possible circular locking dependency detected > 4.18.0-rc8-next-20180810+ #36 Not tainted > ------------------------------------------------------ > syz-executor900/4483 is trying to acquire lock: > 00000000d2bfc8fe (&sb->s_type->i_mutex_key#9){++++}, at: inode_lock > include/linux/fs.h:765 [inline] > 00000000d2bfc8fe (&sb->s_type->i_mutex_key#9){++++}, at: > shmem_fallocate+0x18b/0x12e0 mm/shmem.c:2602 > > but task is already holding lock: > 0000000025208078 (ashmem_mutex){+.+.}, at: ashmem_shrink_scan+0xb4/0x630 > drivers/staging/android/ashmem.c:448 > > which lock already depends on the new lock. > > -> #2 (ashmem_mutex){+.+.}: > __mutex_lock_common kernel/locking/mutex.c:925 [inline] > __mutex_lock+0x171/0x1700 kernel/locking/mutex.c:1073 > mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1088 > ashmem_mmap+0x55/0x520 drivers/staging/android/ashmem.c:361 > call_mmap include/linux/fs.h:1844 [inline] > mmap_region+0xf27/0x1c50 mm/mmap.c:1762 > do_mmap+0xa10/0x1220 mm/mmap.c:1535 > do_mmap_pgoff include/linux/mm.h:2298 [inline] > vm_mmap_pgoff+0x213/0x2c0 mm/util.c:357 > ksys_mmap_pgoff+0x4da/0x660 mm/mmap.c:1585 > __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] > __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline] > __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > -> #1 (&mm->mmap_sem){++++}: > __might_fault+0x155/0x1e0 mm/memory.c:4568 > _copy_to_user+0x30/0x110 lib/usercopy.c:25 > copy_to_user include/linux/uaccess.h:155 [inline] > filldir+0x1ea/0x3a0 fs/readdir.c:196 > dir_emit_dot include/linux/fs.h:3464 [inline] > dir_emit_dots include/linux/fs.h:3475 [inline] > dcache_readdir+0x13a/0x620 fs/libfs.c:193 > iterate_dir+0x48b/0x5d0 fs/readdir.c:51 > __do_sys_getdents fs/readdir.c:231 [inline] > __se_sys_getdents fs/readdir.c:212 [inline] > __x64_sys_getdents+0x29f/0x510 fs/readdir.c:212 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > -> #0 (&sb->s_type->i_mutex_key#9){++++}: > lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924 > down_write+0x8f/0x130 kernel/locking/rwsem.c:70 > inode_lock include/linux/fs.h:765 [inline] > shmem_fallocate+0x18b/0x12e0 mm/shmem.c:2602 > ashmem_shrink_scan+0x236/0x630 drivers/staging/android/ashmem.c:455 > ashmem_ioctl+0x3ae/0x13a0 drivers/staging/android/ashmem.c:797 > vfs_ioctl fs/ioctl.c:46 [inline] > file_ioctl fs/ioctl.c:501 [inline] > do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685 > ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702 > __do_sys_ioctl fs/ioctl.c:709 [inline] > __se_sys_ioctl fs/ioctl.c:707 [inline] > __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > other info that might help us debug this: > > Chain exists of: > &sb->s_type->i_mutex_key#9 --> &mm->mmap_sem --> ashmem_mutex > > Possible unsafe locking scenario: > > CPU0 CPU1 > ---- ---- > lock(ashmem_mutex); > lock(&mm->mmap_sem); > lock(ashmem_mutex); > lock(&sb->s_type->i_mutex_key#9); > > *** DEADLOCK *** > > 1 lock held by syz-executor900/4483: > #0: 0000000025208078 (ashmem_mutex){+.+.}, at: > ashmem_shrink_scan+0xb4/0x630 drivers/staging/android/ashmem.c:448 Link: http://lkml.kernel.org/r/20180821231835.166639-1-joel@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Reported-by: syzbot Reviewed-by: NeilBrown Suggested-by: NeilBrown Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Hugh Dickins Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit a1b3d2f217cf51505858c5c160abef96c3e91721 Author: Dominique Martinet Date: Thu Sep 20 12:22:35 2018 -0700 fs/proc/kcore.c: fix invalid memory access in multi-page read optimization The 'm' kcore_list item could point to kclist_head, and it is incorrect to look at m->addr / m->size in this case. There is no choice but to run through the list of entries for every address if we did not find any entry in the previous iteration Reset 'm' to NULL in that case at Omar Sandoval's suggestion. [akpm@linux-foundation.org: add comment] Link: http://lkml.kernel.org/r/1536100702-28706-1-git-send-email-asmadeus@codewreck.org Fixes: bf991c2231117 ("proc/kcore: optimize multiple page reads") Signed-off-by: Dominique Martinet Reviewed-by: Andrew Morton Cc: Omar Sandoval Cc: Alexey Dobriyan Cc: Eric Biederman Cc: James Morse Cc: Bhupesh Sharma Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 889c695d419f19e5db52592dafbaf26143c36d1f Author: Pasha Tatashin Date: Thu Sep 20 12:22:30 2018 -0700 mm: disable deferred struct page for 32-bit arches Deferred struct page init is needed only on systems with large amount of physical memory to improve boot performance. 32-bit systems do not benefit from this feature. Jiri reported a problem where deferred struct pages do not work well with x86-32: [ 0.035162] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) [ 0.035725] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) [ 0.036269] Initializing CPU#0 [ 0.036513] Initializing HighMem for node 0 (00036ffe:0007ffe0) [ 0.038459] page:f6780000 is uninitialized and poisoned [ 0.038460] raw: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff [ 0.039509] page dumped because: VM_BUG_ON_PAGE(1 && PageCompound(page)) [ 0.040038] ------------[ cut here ]------------ [ 0.040399] kernel BUG at include/linux/page-flags.h:293! [ 0.040823] invalid opcode: 0000 [#1] SMP PTI [ 0.041166] CPU: 0 PID: 0 Comm: swapper Not tainted 4.19.0-rc1_pt_jiri #9 [ 0.041694] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/2014 [ 0.042496] EIP: free_highmem_page+0x64/0x80 [ 0.042839] Code: 13 46 d8 c1 e8 18 5d 83 e0 03 8d 04 c0 c1 e0 06 ff 80 ec 5f 44 d8 c3 8d b4 26 00 00 00 00 ba 08 65 28 d8 89 d8 e8 fc 71 02 00 <0f> 0b 8d 76 00 8d bc 27 00 00 00 00 ba d0 b1 26 d8 89 d8 e8 e4 71 [ 0.044338] EAX: 0000003c EBX: f6780000 ECX: 00000000 EDX: d856cbe8 [ 0.044868] ESI: 0007ffe0 EDI: d838df20 EBP: d838df00 ESP: d838defc [ 0.045372] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00210086 [ 0.045913] CR0: 80050033 CR2: 00000000 CR3: 18556000 CR4: 00040690 [ 0.046413] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 [ 0.046913] DR6: fffe0ff0 DR7: 00000400 [ 0.047220] Call Trace: [ 0.047419] add_highpages_with_active_regions+0xbd/0x10d [ 0.047854] set_highmem_pages_init+0x5b/0x71 [ 0.048202] mem_init+0x2b/0x1e8 [ 0.048460] start_kernel+0x1d2/0x425 [ 0.048757] i386_start_kernel+0x93/0x97 [ 0.049073] startup_32_smp+0x164/0x168 [ 0.049379] Modules linked in: [ 0.049626] ---[ end trace 337949378db0abbb ]--- We free highmem pages before their struct pages are initialized: mem_init() set_highmem_pages_init() add_highpages_with_active_regions() free_highmem_page() .. Access uninitialized struct page here.. Because there is no reason to have this feature on 32-bit systems, just disable it. Link: http://lkml.kernel.org/r/20180831150506.31246-1-pavel.tatashin@microsoft.com Fixes: 2e3ca40f03bb ("mm: relax deferred struct page requirements") Signed-off-by: Pavel Tatashin Reported-by: Jiri Slaby Acked-by: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit f83606f5eb007adc33bc8541ede00590f477bdeb Author: KJ Tsanaktsidis Date: Thu Sep 20 12:22:25 2018 -0700 fork: report pid exhaustion correctly Make the clone and fork syscalls return EAGAIN when the limit on the number of pids /proc/sys/kernel/pid_max is exceeded. Currently, when the pid_max limit is exceeded, the kernel will return ENOSPC from the fork and clone syscalls. This is contrary to the documented behaviour, which explicitly calls out the pid_max case as one where EAGAIN should be returned. It also leads to really confusing error messages in userspace programs which will complain about a lack of disk space when they fail to create processes/threads for this reason. This error is being returned because alloc_pid() uses the idr api to find a new pid; when there are none available, idr_alloc_cyclic() returns -ENOSPC, and this is being propagated back to userspace. This behaviour has been broken before, and was explicitly fixed in commit 35f71bc0a09a ("fork: report pid reservation failure properly"), so I think -EAGAIN is definitely the right thing to return in this case. The current behaviour change dates from commit 95846ecf9dac ("pid: replace pid bitmap implementation with IDR AIP") and was I believe unintentional. This patch has no impact on the case where allocating a pid fails because the child reaper for the namespace is dead; that case will still return -ENOMEM. Link: http://lkml.kernel.org/r/20180903111016.46461-1-ktsanaktsidis@zendesk.com Fixes: 95846ecf9dac ("pid: replace pid bitmap implementation with IDR AIP") Signed-off-by: KJ Tsanaktsidis Reviewed-by: Andrew Morton Acked-by: Michal Hocko Cc: Gargi Sharma Cc: Rik van Riel Cc: Oleg Nesterov Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman commit 9068a427ee0beb1365a0925e8c33f338f09f5e97 Author: Thomas Gleixner Date: Wed Sep 19 14:33:14 2018 +0200 MAINTAINERS: Add X86 MM entry Dave, Andy and Peter are de facto overseing the mm parts of X86. Add an explicit maintainers entry. Signed-off-by: Thomas Gleixner Acked-by: Dave Hansen Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra Acked-by: Ingo Molnar commit a8b3bb338e4ee4cc84a2b9a6fdf27049b84baa59 Author: Fenghua Yu Date: Thu Sep 20 12:37:08 2018 -0700 x86/intel_rdt: Add Reinette as co-maintainer for RDT Reinette Chatre is doing great job on enabling pseudo-locking and other features in RDT. Add her as co-maintainer for RDT. Suggested-by: Thomas Gleixner Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar Acked-by: Reinette Chatre Cc: "H Peter Anvin" Cc: "Tony Luck" Link: https://lkml.kernel.org/r/1537472228-221799-1-git-send-email-fenghua.yu@intel.com commit f061c1cc404a618858a77aea233fde0aeaad2f2d Author: Richard Weinberger Date: Sun Sep 16 23:57:35 2018 +0200 Revert "ubifs: xattr: Don't operate on deleted inodes" This reverts commit 11a6fc3dc743e22fb50f2196ec55bee5140d3c52. UBIFS wants to assert that xattr operations are only issued on files with positive link count. The said patch made this operations return -ENOENT for unlinked files such that the asserts will no longer trigger. This was wrong since xattr operations are perfectly fine on unlinked files. Instead the assertions need to be fixed/removed. Cc: Fixes: 11a6fc3dc743 ("ubifs: xattr: Don't operate on deleted inodes") Reported-by: Koen Vandeputte Tested-by: Joel Stanley Signed-off-by: Richard Weinberger commit d3bdc016c598e09a4ddf17805d17d43759b0a582 Author: Sascha Hauer Date: Wed Sep 12 14:51:38 2018 +0200 ubifs: drop false positive assertion The following sequence triggers ubifs_assert(c, c->lst.taken_empty_lebs > 0); at the end of ubifs_remount_fs(): mount -t ubifs /dev/ubi0_0 /mnt echo 1 > /sys/kernel/debug/ubifs/ubi0_0/ro_error umount /mnt mount -t ubifs -o ro /dev/ubix_y /mnt mount -o remount,ro /mnt The resulting UBIFS assert failed in ubifs_remount_fs at 1878 (pid 161) is a false positive. In the case above c->lst.taken_empty_lebs has never been changed from its initial zero value. This will only happen when the deferred recovery is done. Fix this by doing the assertion only when recovery has been done already. Signed-off-by: Sascha Hauer Signed-off-by: Richard Weinberger commit 37f31b6ca4311b94d985fb398a72e5399ad57925 Author: Richard Weinberger Date: Mon Sep 3 23:06:23 2018 +0200 ubifs: Check for name being NULL while mounting The requested device name can be NULL or an empty string. Check for that and refuse to continue. UBIFS has to do this manually since we cannot use mount_bdev(), which checks for this condition. Fixes: 1e51764a3c2ac ("UBIFS: add new flash file system") Reported-by: syzbot+38bd0f7865e5c6379280@syzkaller.appspotmail.com Signed-off-by: Richard Weinberger commit c949a8e8b43f2c75567269bcc9a50d704ae3c420 Author: Boris Brezillon Date: Thu Sep 20 09:31:11 2018 +0200 spi: spi-mem: Move the DMA-able constraint doc to the kerneldoc header We'd better have that documented in the kerneldoc header, so that it's exposed to the doc generated by Sphinx. Signed-off-by: Boris Brezillon Signed-off-by: Mark Brown commit 60489f085574157c343fc62a32f997fe7346a659 Author: Boris Brezillon Date: Thu Sep 20 09:31:10 2018 +0200 spi: spi-mem: Add missing description for data.nbytes field Add a description for spi_mem_op.data.nbytes to the kerneldoc header. Fixes: c36ff266dc82 ("spi: Extend the core to ease integration of SPI memory controllers") Signed-off-by: Boris Brezillon Signed-off-by: Mark Brown commit d7ab5cdce54da631f0c8c11e506c974536a3581e Author: Xin Long Date: Thu Sep 20 17:27:28 2018 +0800 sctp: update dst pmtu with the correct daddr When processing pmtu update from an icmp packet, it calls .update_pmtu with sk instead of skb in sctp_transport_update_pmtu. However for sctp, the daddr in the transport might be different from inet_sock->inet_daddr or sk->sk_v6_daddr, which is used to update or create the route cache. The incorrect daddr will cause a different route cache created for the path. So before calling .update_pmtu, inet_sock->inet_daddr/sk->sk_v6_daddr should be updated with the daddr in the transport, and update it back after it's done. The issue has existed since route exceptions introduction. Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.") Reported-by: ian.periam@dialogic.com Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 8c6ec3613e7b0aade20a3196169c0bab32ed3e3f Author: Davide Caratti Date: Wed Sep 19 19:01:37 2018 +0200 bnxt_en: don't try to offload VLAN 'modify' action bnxt offload code currently supports only 'push' and 'pop' operation: let .ndo_setup_tc() return -EOPNOTSUPP if VLAN 'modify' action is configured. Fixes: 2ae7408fedfe ("bnxt_en: bnxt: add TC flower filter offload support") Signed-off-by: Davide Caratti Acked-by: Sathya Perla Signed-off-by: David S. Miller commit 26b471c7e2f7befd0f59c35b257749ca57e0ed70 Author: Liran Alon Date: Sun Sep 16 14:28:20 2018 +0300 KVM: nVMX: Fix bad cleanup on error of get/set nested state IOCTLs The handlers of IOCTLs in kvm_arch_vcpu_ioctl() are expected to set their return value in "r" local var and break out of switch block when they encounter some error. This is because vcpu_load() is called before the switch block which have a proper cleanup of vcpu_put() afterwards. However, KVM_{GET,SET}_NESTED_STATE IOCTLs handlers just return immediately on error without performing above mentioned cleanup. Thus, change these handlers to behave as expected. Fixes: 8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE") Reviewed-by: Mark Kanda Reviewed-by: Patrick Colp Signed-off-by: Liran Alon Signed-off-by: Paolo Bonzini commit 346fa83d10934cf206e2fd0f514bf8ce186f08fe Author: zhong jiang Date: Wed Sep 19 20:21:11 2018 +0800 netfilter: conntrack: get rid of double sizeof sizeof(sizeof()) is quite strange and does not seem to be what is wanted here. The issue is detected with the help of Coccinelle. Fixes: 39215846740a ("netfilter: conntrack: remove nlattr_size pointer from l4proto trackers") Signed-off-by: zhong jiang Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit bab4344975fe2c719eda32de59298d6de26fe126 Author: Stefan Agner Date: Mon Sep 17 22:21:36 2018 -0700 netfilter: nft_osf: use enum nft_data_types for nft_validate_register_store The function nft_validate_register_store requires a struct of type struct nft_data_types. NFTA_DATA_VALUE is of type enum nft_verdict_attributes. Pass the correct enum type. This fixes a warning seen with Clang: net/netfilter/nft_osf.c:52:8: warning: implicit conversion from enumeration type 'enum nft_data_attributes' to different enumeration type 'enum nft_data_types' [-Wenum-conversion] NFTA_DATA_VALUE, NFT_OSF_MAXGENRELEN); ^~~~~~~~~~~~~~~ Fixes: b96af92d6eaf ("netfilter: nf_tables: implement Passive OS fingerprint module in nft_osf") Link: https://github.com/ClangBuiltLinux/linux/issues/103 Signed-off-by: Stefan Agner Signed-off-by: Pablo Neira Ayuso commit a173f066c7cfc031acb8f541708041e009fc9812 Author: David Ahern Date: Mon Sep 17 08:20:36 2018 -0700 netfilter: bridge: Don't sabotage nf_hook calls from an l3mdev For starters, the bridge netfilter code registers operations that are invoked any time nh_hook is called. Specifically, ip_sabotage_in watches for nested calls for NF_INET_PRE_ROUTING when a bridge is in the stack. Packet wise, the bridge netfilter hook runs first. br_nf_pre_routing allocates nf_bridge, sets in_prerouting to 1 and calls NF_HOOK for NF_INET_PRE_ROUTING. It's finish function, br_nf_pre_routing_finish, then resets in_prerouting flag to 0 and the packet continues up the stack. The packet eventually makes it to the VRF driver and it invokes nf_hook for NF_INET_PRE_ROUTING in case any rules have been added against the vrf device. Because of the registered operations the call to nf_hook causes ip_sabotage_in to be invoked. That function sees the nf_bridge on the skb and that in_prerouting is not set. Thinking it is an invalid nested call it steals (drops) the packet. Update ip_sabotage_in to recognize that the bridge or one of its upper devices (e.g., vlan) can be enslaved to a VRF (L3 master device) and allow the packet to go through the nf_hook a second time. Fixes: 73e20b761acf ("net: vrf: Add support for PREROUTING rules on vrf device") Reported-by: D'Souza, Nelson Signed-off-by: David Ahern Signed-off-by: Pablo Neira Ayuso commit e0dccce1193f87597548d0db6ecc942fb92c04cd Author: Hans Verkuil Date: Mon Aug 27 14:28:50 2018 +0200 drm/i2c: tda9950: set MAX_RETRIES for errors only The CEC_TX_STATUS_MAX_RETRIES should be set for errors only to prevent the CEC framework from retrying the transmit. If the transmit was successful, then don't set this flag. Found by running 'cec-compliance -A' on a beaglebone box. Signed-off-by: Hans Verkuil Signed-off-by: Russell King commit d98627d1360d55e3b28f702caca8b6342c4a4e45 Author: Colin Ian King Date: Sun May 27 22:42:55 2018 +0100 drm/i2c: tda9950: fix timeout counter check Currently the check to see if the timeout has reached zero is incorrect and the check is instead checking if the timeout is non-zero and not zero, hence it will break out of the loop on the first iteration and the msleep is never executed. Fix this by breaking from the loop when timeout is zero. Detected by CoverityScan, CID#1469404 ("Logically Dead Code") Fixes: f0316f93897c ("drm/i2c: tda9950: add CEC driver") Signed-off-by: Colin Ian King Signed-off-by: Russell King commit fb6de923ca3358a91525552b4907d4cb38730bdd Author: Yu Zhao Date: Wed Sep 19 15:30:51 2018 -0600 regulator: fix crash caused by null driver data dev_set_drvdata() needs to be called before device_register() exposes device to userspace. Otherwise kernel crashes after it gets null pointer from dev_get_drvdata() when userspace tries to access sysfs entries. [Removed backtrace for length -- broonie] Signed-off-by: Yu Zhao Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 44d8cc6f1a905e4bb1d4221a898abb0d7e9d100a Author: Yong Zhao Date: Wed Sep 12 21:42:20 2018 -0400 drm/amdkfd: Fix ATS capablity was not reported correctly on some APUs Because CRAT_CU_FLAGS_IOMMU_PRESENT was not set in some BIOS crat, we need to workaround this. For future compatibility, we also overwrite the bit in capability according to the value of needs_iommu_device. Acked-by: Alex Deucher Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 15426dbb65c5b37680d27e84d58a1ed3b8532518 Author: Yong Zhao Date: Wed Sep 12 21:42:19 2018 -0400 drm/amdkfd: Change the control stack MTYPE from UC to NC on GFX9 CWSR fails on Raven if the control stack is MTYPE_UC, which is used for regular GART mappings. As a workaround we map it using MTYPE_NC. The MEC firmware expects the control stack at one page offset from the start of the MQD so it is part of the MQD allocation on GFXv9. AMDGPU added a memory allocation flag just for this purpose. Acked-by: Alex Deucher Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit caaa4c8a6be2a275bd14f2369ee364978ff74704 Author: Amber Lin Date: Wed Sep 12 21:42:18 2018 -0400 drm/amdgpu: Fix SDMA HQD destroy error on gfx_v7 A wrong register bit was examinated for checking SDMA status so it reports false failures. This typo only appears on gfx_v7. gfx_v8 checks the correct bit. Acked-by: Alex Deucher Signed-off-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 96147db1e1dff83679e71ac92193cbcab761a14c Author: Mika Westerberg Date: Tue Sep 18 18:36:21 2018 +0300 pinctrl: intel: Do pin translation in other GPIO operations as well For some reason I thought GPIOLIB handles translation from GPIO ranges to pinctrl pins but it turns out not to be the case. This means that when GPIOs operations are performed for a pin controller having a custom GPIO base such as Cannon Lake and Ice Lake incorrect pin number gets used internally. Fix this in the same way we did for lock/unlock IRQ operations and translate the GPIO number to pin before using it. Fixes: a60eac3239f0 ("pinctrl: intel: Allow custom GPIO base for pad groups") Reported-by: Rajat Jain Signed-off-by: Mika Westerberg Tested-by: Rajat Jain Signed-off-by: Linus Walleij commit d611aaf336b2e8e81f98490eabf7b92889b15319 Merge: 65eea8edc315 be1277f5eb17 Author: Jens Axboe Date: Thu Sep 20 09:10:38 2018 -0600 Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linus Pull NVMe fix from Christoph. * 'nvme-4.19' of git://git.infradead.org/nvme: nvme: count all ANA groups for ANA Log page commit 65eea8edc315589d6c993cf12dbb5d0e9ef1fe4e Author: Andy Whitcroft Date: Thu Sep 20 09:09:48 2018 -0600 floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl The final field of a floppy_struct is the field "name", which is a pointer to a string in kernel memory. The kernel pointer should not be copied to user memory. The FDGETPRM ioctl copies a floppy_struct to user memory, including this "name" field. This pointer cannot be used by the user and it will leak a kernel address to user-space, which will reveal the location of kernel code and data and undermine KASLR protection. Model this code after the compat ioctl which copies the returned data to a previously cleared temporary structure on the stack (excluding the name pointer) and copy out to userspace from there. As we already have an inparam union with an appropriate member and that memory is already cleared even for read only calls make use of that as a temporary store. Based on an initial patch by Brian Belleville. CVE-2018-7755 Signed-off-by: Andy Whitcroft Broke up long line. Signed-off-by: Jens Axboe commit 56ce3c5a50f4d8cc95361b1ec7f152006c6320d8 Author: Johannes Berg Date: Thu Sep 20 09:27:30 2018 +0200 smc: generic netlink family should be __ro_after_init The generic netlink family is only initialized during module init, so it should be __ro_after_init like all other generic netlink families. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit f9d5b1d50840320fb6c66fafd1a532a995fc3758 Author: Petr Machata Date: Thu Sep 20 09:31:45 2018 +0300 mlxsw: spectrum: Bump required firmware version MC-aware mode was introduced to mlxsw in commit 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports") and fixed up later in commit 3a3539cd3632 ("mlxsw: spectrum_buffers: Set up a dedicated pool for BUM traffic"). As the final piece of puzzle, a firmware issue whereby a wrong priority was assigned to BUM traffic was corrected in FW version 13.1703.4. Therefore require this FW version in the driver. Fixes: 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports") Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 7ce5c8cd753f9afa8e79e9ec40351998e354f239 Author: Jens Axboe Date: Thu Sep 20 08:30:55 2018 -0600 libata: mask swap internal and hardware tag hen we're comparing the hardware completion mask passed in from the driver with the internal tag pending mask, we need to account for the fact that the internal tag is different from the hardware tag. If not, then we can end up either prematurely completing the internal tag (since it's not set in the hw mask), or simply flag an error: ata2: illegal qc_active transition (100000000->00000001) If the internal tag is set, then swap that with the hardware tag in this case before comparing with what the hardware reports. Fixes: 28361c403683 ("libata: add extra internal command") Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=201151 Cc: stable@vger.kernel.org Reported-by: Paul Sbarra Tested-by: Paul Sbarra Signed-off-by: Jens Axboe commit ae596de1a0c8c2c924dc99d23c026259372ab234 Author: Miguel Ojeda Date: Tue Sep 18 18:55:42 2018 +0200 Compiler Attributes: naked can be shared The naked attribute is supported by at least gcc >= 4.6 (for ARM, which is the only current user), gcc >= 8 (for x86), clang >= 3.1 and icc >= 13. See https://godbolt.org/z/350Dyc Therefore, move it out of compiler-gcc.h so that the definition is shared by all compilers. This also fixes Clang support for ARM32 --- 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive"). Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") Cc: Rasmus Villemoes Cc: Eli Friedman Cc: Christopher Li Cc: Kees Cook Cc: Ingo Molnar Cc: Geert Uytterhoeven Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Joe Perches Cc: Dominique Martinet Cc: Linus Torvalds Cc: linux-sparse@vger.kernel.org Suggested-by: Arnd Bergmann Tested-by: Stefan Agner Reviewed-by: Stefan Agner Reviewed-by: Luc Van Oostenryck Reviewed-by: Nick Desaulniers Signed-off-by: Miguel Ojeda Signed-off-by: Greg Kroah-Hartman commit d124b44f09cab67fc6da4a4513417e3e54b01efc Author: Miguel Ojeda Date: Tue Sep 18 18:55:41 2018 +0200 Compiler Attributes: naked was fixed in gcc 4.6 Commit 9c695203a7dd ("compiler-gcc.h: gcc-4.5 needs noclone and noinline on __naked functions") added noinline and noclone as a workaround for a gcc 4.5 bug, which was resolved in 4.6.0. Since now the minimum gcc supported version is 4.6, we can clean it up. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290 and https://godbolt.org/z/h6NMIL Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") Cc: Rasmus Villemoes Cc: Eli Friedman Cc: Christopher Li Cc: Kees Cook Cc: Ingo Molnar Cc: Geert Uytterhoeven Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Joe Perches Cc: Dominique Martinet Cc: Linus Torvalds Cc: linux-sparse@vger.kernel.org Tested-by: Stefan Agner Reviewed-by: Stefan Agner Reviewed-by: Luc Van Oostenryck Reviewed-by: Nick Desaulniers Signed-off-by: Miguel Ojeda Signed-off-by: Greg Kroah-Hartman commit 7e620984b62532783912312e334f3c48cdacbd5d Author: Uwe Kleine-König Date: Thu Sep 20 14:11:17 2018 +0200 serial: imx: restore handshaking irq for imx1 Back in 2015 when irda was dropped from the driver imx1 was broken. This change reintroduces the support for the third interrupt of the UART. Fixes: afe9cbb1a6ad ("serial: imx: drop support for IRDA") Cc: stable Signed-off-by: Uwe Kleine-König Reviewed-by: Leonard Crestez Signed-off-by: Greg Kroah-Hartman commit c716a25b9b70084e1144f77423f5aedd772ea478 Author: Thiago Jung Bauermann Date: Thu Sep 20 01:38:58 2018 -0300 powerpc/pkeys: Fix reading of ibm, processor-storage-keys property scan_pkey_feature() uses of_property_read_u32_array() to read the ibm,processor-storage-keys property and calls be32_to_cpu() on the value it gets. The problem is that of_property_read_u32_array() already returns the value converted to the CPU byte order. The value of pkeys_total ends up more or less sane because there's a min() call in pkey_initialize() which reduces pkeys_total to 32. So in practice the kernel ignores the fact that the hypervisor reserved one key for itself (the device tree advertises 31 keys in my test VM). This is wrong, but the effect in practice is that when a process tries to allocate the 32nd key, it gets an -EINVAL error instead of -ENOSPC which would indicate that there aren't any keys available Fixes: cf43d3b26452 ("powerpc: Enable pkey subsystem") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Thiago Jung Bauermann Signed-off-by: Michael Ellerman commit 2823c8716c687d6c7e261a3a02b3cab43809fe9c Author: Larry Finger Date: Mon Aug 27 10:34:07 2018 -0500 b43: fix DMA error related regression with proprietary firmware In commit 66cffd6daab7 ("b43: fix transmit failure when VT is switched"), a condition is noted where the network controller needs to be reset. Note that this situation happens when running the open-source firmware (http://netweb.ing.unibs.it/~openfwwf/), plus a number of other special conditions. for a different card model, it is reported that this change breaks operation running the proprietary firmware (https://marc.info/?l=linux-wireless&m=153504546924558&w=2). Rather than reverting the previous patch, the code is tweaked to avoid the reset unless the open-source firmware is being used. Fixes: 66cffd6daab7 ("b43: fix transmit failure when VT is switched") Cc: Stable # 4.18+ Cc: Taketo Kabe Reported-and-tested-by: D. Prabhu Signed-off-by: Larry Finger Signed-off-by: Kalle Valo commit 3e3b81965cbfa01fda6d77750feedc3c46fc28d0 Author: Heikki Krogerus Date: Wed Sep 19 10:58:04 2018 +0300 usb: typec: mux: Take care of driver module reference counting Functions typec_mux_get() and typec_switch_get() already make sure that the mux device reference count is incremented, but the same must be done to the driver module as well to prevent the drivers from being unloaded in the middle of operation. This fixes a potential "BUG: unable to handle kernel paging request at ..." from happening. Fixes: 93dd2112c7b2 ("usb: typec: mux: Get the mux identifier from function parameter") Acked-by: Hans de Goede Tested-by: Hans de Goede Signed-off-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 16c4cb19fa85c648a803752eb63cac0ef69231c2 Author: Harry Pan Date: Fri Sep 14 16:58:16 2018 +0800 usb: core: safely deal with the dynamic quirk lists Applying dynamic usbcore quirks in early booting when the slab is not yet ready would cause kernel panic of null pointer dereference because the quirk_count has been counted as 1 while the quirk_list was failed to allocate. i.e., [ 1.044970] BUG: unable to handle kernel NULL pointer dereference at (null) [ 1.044995] IP: [] usb_detect_quirks+0x88/0xd1 [ 1.045016] PGD 0 [ 1.045026] Oops: 0000 [#1] PREEMPT SMP [ 1.046986] gsmi: Log Shutdown Reason 0x03 [ 1.046995] Modules linked in: [ 1.047008] CPU: 0 PID: 81 Comm: kworker/0:3 Not tainted 4.4.154 #28 [ 1.047016] Hardware name: Google Coral/Coral, BIOS Google_Coral.10068.27.0 12/04/2017 [ 1.047028] Workqueue: usb_hub_wq hub_event [ 1.047037] task: ffff88017a321c80 task.stack: ffff88017a384000 [ 1.047044] RIP: 0010:[] [] usb_detect_quirks+0x88/0xd1 To tackle this odd, let's balance the quirk_count to 0 when the kcalloc call fails, and defer the quirk setting into a lower level callback which ensures that the kernel memory management has been initialized. Fixes: 027bd6cafd9a ("usb: core: Add "quirks" parameter for usbcore") Signed-off-by: Harry Pan Acked-by: Kai-Heng Feng Cc: stable Signed-off-by: Greg Kroah-Hartman commit 5c54fcac9a9de559b444ac63ec3cd82f1d157a0b Author: Heikki Krogerus Date: Wed Sep 19 10:58:05 2018 +0300 usb: roles: Take care of driver module reference counting This fixes potential "BUG: unable to handle kernel paging request at ..." from happening. Fixes: fde0aa6c175a ("usb: common: Small class for USB role switches") Cc: Acked-by: Hans de Goede Tested-by: Hans de Goede Signed-off-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 55a5542a546238354d1f209f794414168cf8c71d Author: Gerald Schaefer Date: Mon Sep 10 18:03:29 2018 +0200 s390/hibernate: fix error handling when suspend cpu != resume cpu The resume code checks if the resume cpu is the same as the suspend cpu. If not, and if it is also not possible to switch to the suspend cpu, an error message should be printed and the resume process should be stopped by loading a disabled wait psw. The current logic is broken in multiple ways, the message is never printed, and the disabled wait psw never loaded because the kernel panics before that: - sam31 and SIGP_SET_ARCHITECTURE to ESA mode is wrong, this will break on the first 64bit instruction in sclp_early_printk(). - The init stack should be used, but the stack pointer is not set up correctly (missing aghi %r15,-STACK_FRAME_OVERHEAD). - __sclp_early_printk() checks the sclp_init_state. If it is not sclp_init_state_uninitialized, it simply returns w/o printing anything. In the resumed kernel however, sclp_init_state will never be uninitialized. This patch fixes those issues by removing the sam31/ESA logic, adding a correct init stack pointer, and also introducing sclp_early_printk_force() to allow using sclp_early_printk() even when sclp_init_state is not uninitialized. Reviewed-by: Heiko Carstens Signed-off-by: Gerald Schaefer Signed-off-by: Martin Schwidefsky commit 85682a7e3b9c664995ad477520f917039afdc330 Author: Christophe Leroy Date: Mon Sep 10 06:09:04 2018 +0000 powerpc: fix csum_ipv6_magic() on little endian platforms On little endian platforms, csum_ipv6_magic() keeps len and proto in CPU byte order. This generates a bad results leading to ICMPv6 packets from other hosts being dropped by powerpc64le platforms. In order to fix this, len and proto should be converted to network byte order ie bigendian byte order. However checksumming 0x12345678 and 0x56341278 provide the exact same result so it is enough to rotate the sum of len and proto by 1 byte. PPC32 only support bigendian so the fix is needed for PPC64 only Fixes: e9c4943a107b ("powerpc: Implement csum_ipv6_magic in assembly") Reported-by: Jianlin Shi Reported-by: Xin Long Cc: # 4.18+ Signed-off-by: Christophe Leroy Tested-by: Xin Long Signed-off-by: Michael Ellerman commit c9a4cb204e9eb7fa7dfbe3f7d3a674fa530aa193 Author: Alan Stern Date: Mon Sep 10 14:00:53 2018 -0400 USB: handle NULL config in usb_find_alt_setting() usb_find_alt_setting() takes a pointer to a struct usb_host_config as an argument; it searches for an interface with specified interface and alternate setting numbers in that config. However, it crashes if the usb_host_config pointer argument is NULL. Since this is a general-purpose routine, available for use in many places, we want to to be more robust. This patch makes it return NULL whenever the config argument is NULL. Signed-off-by: Alan Stern Reported-by: syzbot+19c3aaef85a89d451eac@syzkaller.appspotmail.com CC: Signed-off-by: Greg Kroah-Hartman commit bd729f9d67aa9a303d8925bb8c4f06af25f407d1 Author: Alan Stern Date: Mon Sep 10 13:59:59 2018 -0400 USB: fix error handling in usb_driver_claim_interface() The syzbot fuzzing project found a use-after-free bug in the USB core. The bug was caused by usbfs not unbinding from an interface when the USB device file was closed, which led another process to attempt the unbind later on, after the private data structure had been deallocated. The reason usbfs did not unbind the interface at the appropriate time was because it thought the interface had never been claimed in the first place. This was caused by the fact that usb_driver_claim_interface() does not clean up properly when device_bind_driver() returns an error. Although the error code gets passed back to the caller, the iface->dev.driver pointer remains set and iface->condition remains equal to USB_INTERFACE_BOUND. This patch adds proper error handling to usb_driver_claim_interface(). Signed-off-by: Alan Stern Reported-by: syzbot+f84aa7209ccec829536f@syzkaller.appspotmail.com CC: Signed-off-by: Greg Kroah-Hartman commit c183813fcee44a249339b7c46e1ad271ca1870aa Author: Alan Stern Date: Mon Sep 10 13:58:51 2018 -0400 USB: remove LPM management from usb_driver_claim_interface() usb_driver_claim_interface() disables and re-enables Link Power Management, but it shouldn't do either one, for the reasons listed below. This patch removes the two LPM-related function calls from the routine. The reason for disabling LPM in the analogous function usb_probe_interface() is so that drivers won't have to deal with unwanted LPM transitions in their probe routine. But usb_driver_claim_interface() doesn't call the driver's probe routine (or any other callbacks), so that reason doesn't apply here. Furthermore, no driver other than usbfs will ever call usb_driver_claim_interface() unless it is already bound to another interface in the same device, which means disabling LPM here would be redundant. usbfs doesn't interact with LPM at all. Lastly, the error return from usb_unlocked_disable_lpm() isn't handled properly; the code doesn't clean up its earlier actions before returning. Signed-off-by: Alan Stern Fixes: 8306095fd2c1 ("USB: Disable USB 3.0 LPM in critical sections.") CC: Signed-off-by: Greg Kroah-Hartman commit 81e0403b26d94360abd1f6a57311337973bc82cd Author: Oliver Neukum Date: Wed Sep 5 12:07:03 2018 +0200 USB: usbdevfs: restore warning for nonsensical flags If we filter flags before they reach the core we need to generate our own warnings. Signed-off-by: Oliver Neukum Fixes: 0cb54a3e47cb ("USB: debugging code shouldn't alter control flow") Cc: stable Signed-off-by: Greg Kroah-Hartman commit 7a68d9fb851012829c29e770621905529bd9490b Author: Oliver Neukum Date: Wed Sep 5 12:07:02 2018 +0200 USB: usbdevfs: sanitize flags more Requesting a ZERO_PACKET or not is sensible only for output. In the input direction the device decides. Likewise accepting short packets makes sense only for input. This allows operation with panic_on_warn without opening up a local DOS. Signed-off-by: Oliver Neukum Reported-by: syzbot+843efa30c8821bd69f53@syzkaller.appspotmail.com Fixes: 0cb54a3e47cb ("USB: debugging code shouldn't alter control flow") Cc: stable Signed-off-by: Greg Kroah-Hartman commit e871db8d78df1c411032cbb3acfdf8930509360e Author: Sebastian Andrzej Siewior Date: Tue Sep 11 10:00:44 2018 +0200 Revert "usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()" This reverts commit 6e22e3af7bb3a7b9dc53cb4687659f6e63fca427. The bug the patch describes to, has been already fixed in commit 2df6948428542 ("USB: cdc-wdm: don't enable interrupts in USB-giveback") so need to this, revert it. Fixes: 6e22e3af7bb3 ("usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()") Cc: stable Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit 783f3b4e9ec50491c21746e7e05ec6c39c21f563 Author: Bin Liu Date: Mon Sep 17 11:40:22 2018 -0500 usb: musb: dsps: do not disable CPPI41 irq in driver teardown TI AM335x CPPI 4.1 module uses a single register bit for CPPI interrupts in both musb controllers. So disabling the CPPI irq in one musb driver breaks the other musb module. Since musb is already disabled before tearing down dma controller in musb_remove(), it is safe to not disable CPPI irq in musb_dma_controller_destroy(). Fixes: 255348289f71 ("usb: musb: dsps: Manage CPPI 4.1 DMA interrupt in DSPS") Cc: stable@vger.kernel.org Signed-off-by: Bin Liu Signed-off-by: Greg Kroah-Hartman commit 4b92e7fd76e94624e3d5ff56b3d6a5788c4a7ac8 Merge: d82920849f30 4a3e85f2674c Author: Greg Kroah-Hartman Date: Thu Sep 20 11:25:20 2018 +0200 Merge tag 'mtd/fixes-for-4.19-rc5' of git://git.infradead.org/linux-mtd Boris writes: "- Fixes a bug in the ->read/write_reg() implementation of the m25p80 driver - Make sure of_node_get/put() calls are balanced in the partition parsing code - Fix a race in the denali NAND controller driver - Fix false positive WARN_ON() in the marvell NAND controller driver" * tag 'mtd/fixes-for-4.19-rc5' of git://git.infradead.org/linux-mtd: mtd: devices: m25p80: Make sure the buffer passed in op is DMA-able mtd: partitions: fix unbalanced of_node_get/put() mtd: rawnand: denali: fix a race condition when DMA is kicked mtd: rawnand: marvell: prevent harmless warnings commit d82920849f305a83b893a90eca6391de411d77ef Merge: eb9a29f9e585 196f4eeeb78f Author: Greg Kroah-Hartman Date: Thu Sep 20 09:50:49 2018 +0200 Merge tag 'sound-4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Takashi writes: "sound fixes for 4.19-rc5 here comes a collection of various fixes, mostly for stable-tree or regression fixes. Two relatively high LOCs are about the (rather simple) conversion of uapi integer types in topology API, and a regression fix about HDMI hotplug notification on AMD HD-audio. The rest are all small individual fixes like ASoC Intel Skylake race condition, minor uninitialized page leak in emu10k1 ioctl, Firewire audio error paths, and so on." * tag 'sound-4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (33 commits) ALSA: fireworks: fix memory leak of response buffer at error path ALSA: oxfw: fix memory leak of discovered stream formats at error path ALSA: oxfw: fix memory leak for model-dependent data at error path ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at error path ALSA: hda - Enable runtime PM only for discrete GPU ALSA: oxfw: fix memory leak of private data ALSA: firewire-tascam: fix memory leak of private data ALSA: firewire-digi00x: fix memory leak of private data sound: don't call skl_init_chip() to reset intel skl soc sound: enable interrupt after dma buffer initialization Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation" ALSA: emu10k1: fix possible info leak to userspace on SNDRV_EMU10K1_IOCTL_INFO ASoC: cs4265: fix MMTLR Data switch control ASoC: AMD: Ensure reset bit is cleared before configuring ALSA: fireface: fix memory leak in ff400_switch_fetching_mode() ALSA: bebob: use address returned by kmalloc() instead of kernel stack for streaming DMA mapping ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER ASoC: rsnd: adg: care clock-frequency size ASoC: uniphier: change status to orphan ASoC: rsnd: fixup not to call clk_get/set under non-atomic ... commit b3a5402cbcebaf5a9db4d6a3268070e4a099355d Author: Takashi Iwai Date: Tue Sep 18 18:21:11 2018 +0200 ALSA: hda: Fix the audio-component completion timeout The timeout of audio component binding was incorrectly specified in msec, not in jiffies, which results in way too shorter timeout than expected. Along with fixing it, add the information print about the binding failure to show the unexpected situation more clearly. Fixes: a57942bfdd61 ("ALSA: hda: Make audio component support more generic") Signed-off-by: Takashi Iwai commit 32bf94fb5c2ec4ec842152d0e5937cd4bb6738fa Author: Sean Tranchetti Date: Wed Sep 19 13:54:56 2018 -0600 xfrm: validate template mode XFRM mode parameters passed as part of the user templates in the IP_XFRM_POLICY are never properly validated. Passing values other than valid XFRM modes can cause stack-out-of-bounds reads to occur later in the XFRM processing: [ 140.535608] ================================================================ [ 140.543058] BUG: KASAN: stack-out-of-bounds in xfrm_state_find+0x17e4/0x1cc4 [ 140.550306] Read of size 4 at addr ffffffc0238a7a58 by task repro/5148 [ 140.557369] [ 140.558927] Call trace: [ 140.558936] dump_backtrace+0x0/0x388 [ 140.558940] show_stack+0x24/0x30 [ 140.558946] __dump_stack+0x24/0x2c [ 140.558949] dump_stack+0x8c/0xd0 [ 140.558956] print_address_description+0x74/0x234 [ 140.558960] kasan_report+0x240/0x264 [ 140.558963] __asan_report_load4_noabort+0x2c/0x38 [ 140.558967] xfrm_state_find+0x17e4/0x1cc4 [ 140.558971] xfrm_resolve_and_create_bundle+0x40c/0x1fb8 [ 140.558975] xfrm_lookup+0x238/0x1444 [ 140.558977] xfrm_lookup_route+0x48/0x11c [ 140.558984] ip_route_output_flow+0x88/0xc4 [ 140.558991] raw_sendmsg+0xa74/0x266c [ 140.558996] inet_sendmsg+0x258/0x3b0 [ 140.559002] sock_sendmsg+0xbc/0xec [ 140.559005] SyS_sendto+0x3a8/0x5a8 [ 140.559008] el0_svc_naked+0x34/0x38 [ 140.559009] [ 140.592245] page dumped because: kasan: bad access detected [ 140.597981] page_owner info is not active (free page?) [ 140.603267] [ 140.653503] ================================================================ Signed-off-by: Sean Tranchetti Signed-off-by: Steffen Klassert commit bffd5e86951c43e87abf12157e4d6ff7dc37cec9 Merge: cf5cca6e4cc4 7e3e375ceede Author: David S. Miller Date: Wed Sep 19 23:12:24 2018 -0700 Merge branch 'qed-fixes' Sudarsana Reddy Kalluru says: ==================== qed: Fix series for multi-function mode implementation. The patch series addresses few issues in the switch dependent multi-function modes. Please consider applying it to 'net' tree. ==================== Signed-off-by: David S. Miller commit 7e3e375ceede8fba5218362d14db7de25fa83f12 Author: Sudarsana Reddy Kalluru Date: Wed Sep 19 21:59:12 2018 -0700 qed: Add missing device config for RoCE EDPM in UFP mode. This patch adds support to configure the DORQ to use vlan-id/priority for roce EDPM. Fixes: cac6f691 ("qed: Add support for Unified Fabric Port") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Tomer Tayar Signed-off-by: David S. Miller commit 0216da9413afa546627a1b0d319dfd17fef34050 Author: Sudarsana Reddy Kalluru Date: Wed Sep 19 21:59:11 2018 -0700 qed: Do not add VLAN 0 tag to untagged frames in multi-function mode. In certain multi-function switch dependent modes, firmware adds vlan tag 0 to the untagged frames. This leads to double tagging for the traffic if the dcbx is enabled, which is not the desired behavior. To avoid this, driver needs to set "dcb_dont_add_vlan0" flag. Fixes: cac6f691 ("qed: Add support for Unified Fabric Port") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Tomer Tayar Signed-off-by: David S. Miller commit 50fdf60181b01b7383b85d4b9acbb842263d96a2 Author: Sudarsana Reddy Kalluru Date: Wed Sep 19 21:59:10 2018 -0700 qed: Fix populating the invalid stag value in multi function mode. In multi-function mode, driver receives the stag value (outer vlan) for a PF from management FW (MFW). If the stag value is negotiated prior to the driver load, then the stag is not notified to the driver and hence driver will have the invalid stag value. The fix is to request the MFW for STAG value during the driver load time. Fixes: cac6f691 ("qed: Add support for Unified Fabric Port") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Tomer Tayar Signed-off-by: David S. Miller commit e71cf591876536f7dd5a54ef68d631278ca6faa1 Author: Thomas Hellstrom Date: Fri Sep 14 09:24:19 2018 +0200 drm/vmwgfx: Fix buffer object eviction Commit 19be55701071 ("drm/ttm: add operation ctx to ttm_bo_validate v2") introduced a regression where the vmwgfx driver refused to evict a buffer that was still busy instead of waiting for it to become idle. Fix this. Cc: Signed-off-by: Thomas Hellstrom Reviewed-by: Christian König commit a4bd815a94b7aae27e2413f2ce7b458f9843b8ae Author: Deepak Rawat Date: Thu Sep 13 12:46:10 2018 +0200 drm/vmwgfx: Don't impose STDU limits on framebuffer size If framebuffers are larger, we create bounce surfaces that are within STDU limits. Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit 140b4e67c2e1269a945c5caacdcb0c0346ad4cef Author: Deepak Rawat Date: Thu Sep 13 12:44:13 2018 +0200 drm/vmwgfx: limit mode size for all display unit to texture_max For all display units, limit mode size exposed to texture_max_width/ height as this is the maximum framebuffer size that virtual device can create. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit 0c1b174b1b9a497230f937345d4db76fea267398 Author: Deepak Rawat Date: Thu Sep 13 12:34:37 2018 +0200 drm/vmwgfx: limit screen size to stdu_max during check_modeset For STDU individual screen target size is limited by SVGA_REG_SCREENTARGET_MAX_WIDTH/HEIGHT registers so add that limit during atomic check_modeset. An additional limit is placed in the update_layout ioctl to avoid requesting layouts that current user-space typically can't support. Also modified the comments to reflect current limitation on topology. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit bfc888261474efb0676f0e1d128f22c9692b97b1 Author: Deepak Rawat Date: Thu Sep 13 12:33:49 2018 +0200 drm/vmwgfx: don't check for old_crtc_state enable status During atomic check to prepare the new topology no need to check if old_crtc_state was enabled or not. This will cause atomic_check to fail because due to connector routing a crtc can be in atomic_state even if there was no change to enable status. Detected this issue with igt run. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Signed-off-by: Thomas Hellstrom commit 7233b8cab39014620ac9534da11f0f3e506d8fd8 Author: Alexey Kardashevskiy Date: Tue Sep 11 15:38:05 2018 +1000 powerpc/powernv/ioda2: Reduce upper limit for DMA window size (again) mpe: This was fixed originally in commit d3d4ffaae439 ("powerpc/powernv/ioda2: Reduce upper limit for DMA window size"), but contrary to what the merge commit says was inadvertently lost by me in commit ce57c6610cc2 ("Merge branch 'topic/ppc-kvm' into next") which brought in changes that moved the code to a new file. So reapply it to the new file. Original commit message follows: We use PHB in mode1 which uses bit 59 to select a correct DMA window. However there is mode2 which uses bits 59:55 and allows up to 32 DMA windows per a PE. Even though documentation does not clearly specify that, it seems that the actual hardware does not support bits 59:55 even in mode1, in other words we can create a window as big as 1<<58 but DMA simply won't work. This reduces the upper limit from 59 to 55 bits to let the userspace know about the hardware limits. Fixes: ce57c6610cc2 ("Merge branch 'topic/ppc-kvm' into next") Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit cf5cca6e4cc4dea604d8c83e7676f10459d6809c Author: Antoine Tenart Date: Wed Sep 19 15:29:06 2018 +0200 net: mvneta: fix the Rx desc buffer DMA unmapping With CONFIG_DMA_API_DEBUG enabled we now get a warning when using the mvneta driver: mvneta d0030000.ethernet: DMA-API: device driver frees DMA memory with wrong function [device address=0x000000001165b000] [size=4096 bytes] [mapped as page] [unmapped as single] This is because when using the s/w buffer management, the Rx descriptor buffer is mapped with dma_map_page but unmapped with dma_unmap_single. This patch fixes this by using the right unmapping function. Fixes: 562e2f467e71 ("net: mvneta: Improve the buffer allocation method for SWBM") Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller commit 76c0ddd8c3a683f6e2c6e60e11dc1a1558caf4bc Author: Paolo Abeni Date: Wed Sep 19 15:02:07 2018 +0200 ip6_tunnel: be careful when accessing the inner header the ip6 tunnel xmit ndo assumes that the processed skb always contains an ip[v6] header, but syzbot has found a way to send frames that fall short of this assumption, leading to the following splat: BUG: KMSAN: uninit-value in ip6ip6_tnl_xmit net/ipv6/ip6_tunnel.c:1307 [inline] BUG: KMSAN: uninit-value in ip6_tnl_start_xmit+0x7d2/0x1ef0 net/ipv6/ip6_tunnel.c:1390 CPU: 0 PID: 4504 Comm: syz-executor558 Not tainted 4.16.0+ #87 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x185/0x1d0 lib/dump_stack.c:53 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:683 ip6ip6_tnl_xmit net/ipv6/ip6_tunnel.c:1307 [inline] ip6_tnl_start_xmit+0x7d2/0x1ef0 net/ipv6/ip6_tunnel.c:1390 __netdev_start_xmit include/linux/netdevice.h:4066 [inline] netdev_start_xmit include/linux/netdevice.h:4075 [inline] xmit_one net/core/dev.c:3026 [inline] dev_hard_start_xmit+0x5f1/0xc70 net/core/dev.c:3042 __dev_queue_xmit+0x27ee/0x3520 net/core/dev.c:3557 dev_queue_xmit+0x4b/0x60 net/core/dev.c:3590 packet_snd net/packet/af_packet.c:2944 [inline] packet_sendmsg+0x7c70/0x8a30 net/packet/af_packet.c:2969 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg net/socket.c:640 [inline] ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046 __sys_sendmmsg+0x42d/0x800 net/socket.c:2136 SYSC_sendmmsg+0xc4/0x110 net/socket.c:2167 SyS_sendmmsg+0x63/0x90 net/socket.c:2162 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 RIP: 0033:0x441819 RSP: 002b:00007ffe58ee8268 EFLAGS: 00000213 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000441819 RDX: 0000000000000002 RSI: 0000000020000100 RDI: 0000000000000003 RBP: 00000000006cd018 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000213 R12: 0000000000402510 R13: 00000000004025a0 R14: 0000000000000000 R15: 0000000000000000 Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline] kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321 slab_post_alloc_hook mm/slab.h:445 [inline] slab_alloc_node mm/slub.c:2737 [inline] __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369 __kmalloc_reserve net/core/skbuff.c:138 [inline] __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206 alloc_skb include/linux/skbuff.h:984 [inline] alloc_skb_with_frags+0x1d4/0xb20 net/core/skbuff.c:5234 sock_alloc_send_pskb+0xb56/0x1190 net/core/sock.c:2085 packet_alloc_skb net/packet/af_packet.c:2803 [inline] packet_snd net/packet/af_packet.c:2894 [inline] packet_sendmsg+0x6454/0x8a30 net/packet/af_packet.c:2969 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg net/socket.c:640 [inline] ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046 __sys_sendmmsg+0x42d/0x800 net/socket.c:2136 SYSC_sendmmsg+0xc4/0x110 net/socket.c:2167 SyS_sendmmsg+0x63/0x90 net/socket.c:2162 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 This change addresses the issue adding the needed check before accessing the inner header. The ipv4 side of the issue is apparently there since the ipv4 over ipv6 initial support, and the ipv6 side predates git history. Fixes: c4d3efafcc93 ("[IPV6] IP6TUNNEL: Add support to IPv4 over IPv6 tunnel.") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot+3fde91d4d394747d6db4@syzkaller.appspotmail.com Tested-by: Alexander Potapenko Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 13b91ed77a65cf3bf23353880245d0cbd9138294 Author: Icenowy Zheng Date: Sun Sep 16 12:34:09 2018 +0800 ARM: dts: sun8i: drop A64 HDMI PHY fallback compatible from R40 DT The R40 HDMI PHY seems to be different to the A64 one, the A64 one has no input mux, but the R40 one has. Drop the A64 fallback compatible from the HDMI PHY node in R40 DT. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard [wens@csie.org: Fix subject prefix order] Signed-off-by: Chen-Yu Tsai commit 30f3984ede683b98a4e8096e200df78bf0609b4f Author: Alex Deucher Date: Tue Sep 18 15:28:24 2018 -0500 drm/amdgpu: add new polaris pci id Add new pci id. Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit aa86b03c3ee65fc7bd4438dbb70665534df86050 Merge: 69ba423d35c2 dabeb13eee81 Author: David S. Miller Date: Wed Sep 19 20:32:46 2018 -0700 Merge tag 'batadv-net-for-davem-20180919' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== pull request for net: batman-adv 2018-09-19 here are some bugfixes which we would like to see integrated into net. We forgot to bump the version number in the last round for net-next, so the belated patch to do that is included - we hope you can adopt it. This will most likely create a merge conflict later when merging into net-next with this rounds net-next patchset, but net-next should keep the 2018.4 version[1]. [1] resolution: --- a/net/batman-adv/main.h +++ b/net/batman-adv/main.h @@ -25,11 +25,7 @@ #define BATADV_DRIVER_DEVICE "batman-adv" #ifndef BATADV_SOURCE_VERSION -<<<<<<< -#define BATADV_SOURCE_VERSION "2018.3" -======= #define BATADV_SOURCE_VERSION "2018.4" ->>>>>>> #endif /* B.A.T.M.A.N. parameters */ Please pull or let me know of any problem! Here are some batman-adv bugfixes: - Avoid ELP information leak, by Sven Eckelmann - Fix sysfs segfault issues, by Sven Eckelmann (2 patches) - Fix locking when adding entries in various lists, by Sven Eckelmann (5 patches) - Fix refcount if queue_work() fails, by Marek Lindner (2 patches) - Fixup forgotten version bump, by Sven Eckelmann ==================== Signed-off-by: David S. Miller commit 8ca4fff974ad5288d38298f15bf218f2eac2d5e7 Merge: d5b3a31b1cea a530bf948ab7 Author: Dave Airlie Date: Thu Sep 20 10:01:46 2018 +1000 Merge tag 'drm-intel-fixes-2018-09-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes Only fixes coming from gvt containing "Two more BXT fixes from Colin, one srcu locking fix and one fix for GGTT clear when destroy vGPU." Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180919151915.GA6309@intel.com commit d5b3a31b1ceaa9d6f44646848ebde590f2a03d84 Merge: 7876320f8880 558a9ef94a32 Author: Dave Airlie Date: Thu Sep 20 10:00:31 2018 +1000 Merge tag 'drm-misc-fixes-2018-09-19' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v4.19-rc5: - Fix crash in vgem in drm_drv_uses_atomic_modeset. - Allow atomic drivers that don't set DRIVER_ATOMIC to create debugfs entries. - Fix compiler warning for unused connector_funcs. - Fix null pointer deref on UDL unplug. - Disable DRM support for sun4i's R40 for now. (Not all patches went in for v4.19, so it has to wait a cycle.) - NULL-terminate the of_device_id table in pl111. - Make sure vc4 NV12 planar format works when displaying an unscaled fb. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/dda393bb-f13f-8d36-711b-cacfc578e5a3@linux.intel.com commit 8b56ee91ffc88ea01400c012e10fe22a9d233265 Author: Drew Schmitt Date: Mon Aug 20 10:32:16 2018 -0700 kvm: selftests: Add platform_info_test Test guest access to MSR_PLATFORM_INFO when the capability is enabled or disabled. Signed-off-by: Drew Schmitt Signed-off-by: Paolo Bonzini commit 6fbbde9a1969dfb476467ebf69a475095ef3fd4d Author: Drew Schmitt Date: Mon Aug 20 10:32:15 2018 -0700 KVM: x86: Control guest reads of MSR_PLATFORM_INFO Add KVM_CAP_MSR_PLATFORM_INFO so that userspace can disable guest access to reads of MSR_PLATFORM_INFO. Disabling access to reads of this MSR gives userspace the control to "expose" this platform-dependent information to guests in a clear way. As it exists today, guests that read this MSR would get unpopulated information if userspace hadn't already set it (and prior to this patch series, only the CPUID faulting information could have been populated). This existing interface could be confusing if guests don't handle the potential for incorrect/incomplete information gracefully (e.g. zero reported for base frequency). Signed-off-by: Drew Schmitt Signed-off-by: Paolo Bonzini commit d84f1cff9028c00ee870f0293b0c7a3866071dfa Author: Drew Schmitt Date: Mon Aug 20 10:32:14 2018 -0700 KVM: x86: Turbo bits in MSR_PLATFORM_INFO Allow userspace to set turbo bits in MSR_PLATFORM_INFO. Previously, only the CPUID faulting bit was settable. But now any bit in MSR_PLATFORM_INFO would be settable. This can be used, for example, to convey frequency information about the platform on which the guest is running. Signed-off-by: Drew Schmitt Signed-off-by: Paolo Bonzini commit ba8e23db59dc07e5de74fd7bd310e297d3e4ba54 Author: Krish Sadhukhan Date: Tue Sep 4 14:42:58 2018 -0400 nVMX x86: Check VPID value on vmentry of L2 guests According to section "Checks on VMX Controls" in Intel SDM vol 3C, the following check needs to be enforced on vmentry of L2 guests: If the 'enable VPID' VM-execution control is 1, the value of the of the VPID VM-execution control field must not be 0000H. Signed-off-by: Krish Sadhukhan Reviewed-by: Mark Kanda Reviewed-by: Liran Alon Reviewed-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 6de84e581c083c4357b45c31b7ef71335725d850 Author: Krish Sadhukhan Date: Thu Aug 23 20:03:03 2018 -0400 nVMX x86: check posted-interrupt descriptor addresss on vmentry of L2 According to section "Checks on VMX Controls" in Intel SDM vol 3C, the following check needs to be enforced on vmentry of L2 guests: - Bits 5:0 of the posted-interrupt descriptor address are all 0. - The posted-interrupt descriptor address does not set any bits beyond the processor's physical-address width. Signed-off-by: Krish Sadhukhan Reviewed-by: Mark Kanda Reviewed-by: Liran Alon Reviewed-by: Darren Kenny Reviewed-by: Karl Heubaum Signed-off-by: Paolo Bonzini commit e6c67d8cf1173b229f0c4343d1cc7925eca11c11 Author: Liran Alon Date: Tue Sep 4 10:56:52 2018 +0300 KVM: nVMX: Wake blocked vCPU in guest-mode if pending interrupt in virtual APICv In case L1 do not intercept L2 HLT or enter L2 in HLT activity-state, it is possible for a vCPU to be blocked while it is in guest-mode. According to Intel SDM 26.6.5 Interrupt-Window Exiting and Virtual-Interrupt Delivery: "These events wake the logical processor if it just entered the HLT state because of a VM entry". Therefore, if L1 enters L2 in HLT activity-state and L2 has a pending deliverable interrupt in vmcs12->guest_intr_status.RVI, then the vCPU should be waken from the HLT state and injected with the interrupt. In addition, if while the vCPU is blocked (while it is in guest-mode), it receives a nested posted-interrupt, then the vCPU should also be waken and injected with the posted interrupt. To handle these cases, this patch enhances kvm_vcpu_has_events() to also check if there is a pending interrupt in L2 virtual APICv provided by L1. That is, it evaluates if there is a pending virtual interrupt for L2 by checking RVI[7:4] > VPPR[7:4] as specified in Intel SDM 29.2.1 Evaluation of Pending Interrupts. Note that this also handles the case of nested posted-interrupt by the fact RVI is updated in vmx_complete_nested_posted_interrupt() which is called from kvm_vcpu_check_block() -> kvm_arch_vcpu_runnable() -> kvm_vcpu_running() -> vmx_check_nested_events() -> vmx_complete_nested_posted_interrupt(). Reviewed-by: Nikita Leshenko Reviewed-by: Darren Kenny Signed-off-by: Liran Alon Signed-off-by: Paolo Bonzini commit 5bea5123cbf08f990a1aee8f08c643a272e06a0f Author: Paolo Bonzini Date: Tue Sep 18 15:19:17 2018 +0200 KVM: VMX: check nested state and CR4.VMXE against SMM VMX cannot be enabled under SMM, check it when CR4 is set and when nested virtualization state is restored. This should fix some WARNs reported by syzkaller, mostly around alloc_shadow_vmcs. Signed-off-by: Paolo Bonzini commit 822f312d47f0200dc0999c9f006fe94aa43bd0bd Author: Sebastian Andrzej Siewior Date: Wed Sep 12 15:33:45 2018 +0200 kvm: x86: make kvm_{load|put}_guest_fpu() static The functions kvm_load_guest_fpu() kvm_put_guest_fpu() are only used locally, make them static. This requires also that both functions are moved because they are used before their implementation. Those functions were exported (via EXPORT_SYMBOL) before commit e5bb40251a920 ("KVM: Drop kvm_{load,put}_guest_fpu() exports"). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Paolo Bonzini commit a1efa9b70097a7ebb7c0a10bb72648776771b281 Author: Vitaly Kuznetsov Date: Mon Aug 27 18:48:57 2018 +0200 x86/hyper-v: rename ipi_arg_{ex,non_ex} structures These structures are going to be used from KVM code so let's make their names reflect their Hyper-V origin. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Roman Kagan Acked-by: K. Y. Srinivasan Signed-off-by: Paolo Bonzini commit d264ee0c2ed20c6a426663590d4fc7a36cb6abd7 Author: Sean Christopherson Date: Mon Aug 27 15:21:12 2018 -0700 KVM: VMX: use preemption timer to force immediate VMExit A VMX preemption timer value of '0' is guaranteed to cause a VMExit prior to the CPU executing any instructions in the guest. Use the preemption timer (if it's supported) to trigger immediate VMExit in place of the current method of sending a self-IPI. This ensures that pending VMExit injection to L1 occurs prior to executing any instructions in the guest (regardless of nesting level). When deferring VMExit injection, KVM generates an immediate VMExit from the (possibly nested) guest by sending itself an IPI. Because hardware interrupts are blocked prior to VMEnter and are unblocked (in hardware) after VMEnter, this results in taking a VMExit(INTR) before any guest instruction is executed. But, as this approach relies on the IPI being received before VMEnter executes, it only works as intended when KVM is running as L0. Because there are no architectural guarantees regarding when IPIs are delivered, when running nested the INTR may "arrive" long after L2 is running e.g. L0 KVM doesn't force an immediate switch to L1 to deliver an INTR. For the most part, this unintended delay is not an issue since the events being injected to L1 also do not have architectural guarantees regarding their timing. The notable exception is the VMX preemption timer[1], which is architecturally guaranteed to cause a VMExit prior to executing any instructions in the guest if the timer value is '0' at VMEnter. Specifically, the delay in injecting the VMExit causes the preemption timer KVM unit test to fail when run in a nested guest. Note: this approach is viable even on CPUs with a broken preemption timer, as broken in this context only means the timer counts at the wrong rate. There are no known errata affecting timer value of '0'. [1] I/O SMIs also have guarantees on when they arrive, but I have no idea if/how those are emulated in KVM. Signed-off-by: Sean Christopherson [Use a hook for SVM instead of leaving the default in x86.c - Paolo] Signed-off-by: Paolo Bonzini commit f459a707ed313f110e4939d634317edcf9e96774 Author: Sean Christopherson Date: Mon Aug 27 15:21:11 2018 -0700 KVM: VMX: modify preemption timer bit only when arming timer Provide a singular location where the VMX preemption timer bit is set/cleared so that future usages of the preemption timer can ensure the VMCS bit is up-to-date without having to modify unrelated code paths. For example, the preemption timer can be used to force an immediate VMExit. Cache the status of the timer to avoid redundant VMREAD and VMWRITE, e.g. if the timer stays armed across multiple VMEnters/VMExits. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 4c008127e4716d246b44b403f8a65ae9744d32c4 Author: Sean Christopherson Date: Mon Aug 27 15:21:10 2018 -0700 KVM: VMX: immediately mark preemption timer expired only for zero value A VMX preemption timer value of '0' at the time of VMEnter is architecturally guaranteed to cause a VMExit prior to the CPU executing any instructions in the guest. This architectural definition is in place to ensure that a previously expired timer is correctly recognized by the CPU as it is possible for the timer to reach zero and not trigger a VMexit due to a higher priority VMExit being signalled instead, e.g. a pending #DB that morphs into a VMExit. Whether by design or coincidence, commit f4124500c2c1 ("KVM: nVMX: Fully emulate preemption timer") special cased timer values of '0' and '1' to ensure prompt delivery of the VMExit. Unlike '0', a timer value of '1' has no has no architectural guarantees regarding when it is delivered. Modify the timer emulation to trigger immediate VMExit if and only if the timer value is '0', and document precisely why '0' is special. Do this even if calibration of the virtual TSC failed, i.e. VMExit will occur immediately regardless of the frequency of the timer. Making only '0' a special case gives KVM leeway to be more aggressive in ensuring the VMExit is injected prior to executing instructions in the nested guest, and also eliminates any ambiguity as to why '1' is a special case, e.g. why wasn't the threshold for a "short timeout" set to 10, 100, 1000, etc... Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit a101c9d63ebb294144e596bfe9b4ae3156b1be96 Author: Andy Shevchenko Date: Thu Aug 30 14:49:59 2018 +0300 KVM: SVM: Switch to bitmap_zalloc() Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Paolo Bonzini commit 9a9845867c28dc876e7a3289c1745644a34bb393 Author: Tianyu Lan Date: Fri Sep 7 05:45:02 2018 +0000 KVM/MMU: Fix comment in walk_shadow_page_lockless_end() kvm_commit_zap_page() has been renamed to kvm_mmu_commit_zap_page() This patch is to fix the commit. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit 6bd317d3c865ebcddcb287a424093fe4758c40ef Author: Lei Yang Date: Wed Aug 29 15:04:08 2018 +0800 kvm: selftests: use -pthread instead of -lpthread I run into the following error testing/selftests/kvm/dirty_log_test.c:285: undefined reference to `pthread_create' testing/selftests/kvm/dirty_log_test.c:297: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status my gcc version is gcc version 4.8.4 "-pthread" would work everywhere Signed-off-by: Lei Yang Signed-off-by: Paolo Bonzini commit 83b20b28c670868bfb717be4fe1557c925a81657 Author: Wei Yang Date: Fri Sep 7 19:59:47 2018 +0800 KVM: x86: don't reset root in kvm_mmu_setup() Here is the code path which shows kvm_mmu_setup() is invoked after kvm_mmu_create(). Since kvm_mmu_setup() is only invoked in this code path, this means the root_hpa and prev_roots are guaranteed to be invalid. And it is not necessary to reset it again. kvm_vm_ioctl_create_vcpu() kvm_arch_vcpu_create() vmx_create_vcpu() kvm_vcpu_init() kvm_arch_vcpu_init() kvm_mmu_create() kvm_arch_vcpu_setup() kvm_mmu_setup() kvm_init_mmu() This patch set reset_roots to false in kmv_mmu_setup(). Fixes: 50c28f21d045dde8c52548f8482d456b3f0956f5 Signed-off-by: Wei Yang Reviewed-by: Liran Alon Signed-off-by: Paolo Bonzini commit d35b34a9a70edae7ef923f100e51b8b5ae9fe899 Author: Junaid Shahid Date: Wed Aug 8 17:45:24 2018 -0700 kvm: mmu: Don't read PDPTEs when paging is not enabled kvm should not attempt to read guest PDPTEs when CR0.PG = 0 and CR4.PAE = 1. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit d1766202779e81d0f2a94c4650a6ba31497d369d Author: Vitaly Kuznetsov Date: Thu Aug 2 17:08:16 2018 +0200 x86/kvm/lapic: always disable MMIO interface in x2APIC mode When VMX is used with flexpriority disabled (because of no support or if disabled with module parameter) MMIO interface to lAPIC is still available in x2APIC mode while it shouldn't be (kvm-unit-tests): PASS: apic_disable: Local apic enabled in x2APIC mode PASS: apic_disable: CPUID.1H:EDX.APIC[bit 9] is set FAIL: apic_disable: *0xfee00030: 50014 The issue appears because we basically do nothing while switching to x2APIC mode when APIC access page is not used. apic_mmio_{read,write} only check if lAPIC is disabled before proceeding to actual write. When APIC access is virtualized we correctly manipulate with VMX controls in vmx_set_virtual_apic_mode() and we don't get vmexits from memory writes in x2APIC mode so there's no issue. Disabling MMIO interface seems to be easy. The question is: what do we do with these reads and writes? If we add apic_x2apic_mode() check to apic_mmio_in_range() and return -EOPNOTSUPP these reads and writes will go to userspace. When lAPIC is in kernel, Qemu uses this interface to inject MSIs only (see kvm_apic_mem_write() in hw/i386/kvm/apic.c). This somehow works with disabled lAPIC but when we're in xAPIC mode we will get a real injected MSI from every write to lAPIC. Not good. The simplest solution seems to be to just ignore writes to the region and return ~0 for all reads when we're in x2APIC mode. This is what this patch does. However, this approach is inconsistent with what currently happens when flexpriority is enabled: we allocate APIC access page and create KVM memory region so in x2APIC modes all reads and writes go to this pre-allocated page which is, btw, the same for all vCPUs. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 080220b687147fd9376878534aba7194f17f6ef5 Author: Jakub Kicinski Date: Tue Sep 18 10:13:59 2018 -0700 tools: bpf: fix license for a compat header file libc_compat.h is used by libbpf so make sure it's licensed under LGPL or BSD license. The license change should be OK, I'm the only author of the file. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit ee92efe41cf358f4b99e73509f2bfd4733609f26 Author: Bart Van Assche Date: Mon Sep 17 18:10:05 2018 -0700 IB/srp: Avoid that sg_reset -d ${srp_device} triggers an infinite loop Use different loop variables for the inner and outer loop. This avoids that an infinite loop occurs if there are more RDMA channels than target->req_ring_size. Fixes: d92c0da71a35 ("IB/srp: Add multichannel support") Cc: Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit eb9a29f9e585044ec71e82d815298ad7e4908858 Merge: 6ad49fa1993d 55066354285b Author: Greg Kroah-Hartman Date: Wed Sep 19 22:59:30 2018 +0200 Merge tag 'hwmon-for-linus-v4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Guenter writes: "Various bug fixes for nct6775 driver" commit 6ad49fa1993d92ef652ed85d525b8ce85fa653fd Merge: 4ca719a338d5 cbe3fd39d223 Author: Greg Kroah-Hartman Date: Wed Sep 19 22:34:22 2018 +0200 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi James writes: "SCSI fixes on 20180919 A couple of small but important fixes, one affecting big endian and the other fixing a BUG_ON in scatterlist processing. Signed-off-by: James E.J. Bottomley " commit d59f532480f5231bf62615a9287e05b78225fb05 Author: Juergen Gross Date: Wed Sep 19 15:42:33 2018 +0200 xen: issue warning message when out of grant maptrack entries When a driver domain (e.g. dom0) is running out of maptrack entries it can't map any more foreign domain pages. Instead of silently stalling the affected domUs issue a rate limited warning in this case in order to make it easier to detect that situation. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 70513d58751d7c6c1a0133557b13089b9f2e3e66 Author: Boris Ostrovsky Date: Thu Jul 12 13:27:00 2018 -0400 xen/x86/vpmu: Zero struct pt_regs before calling into sample handling code Otherwise we may leak kernel stack for events that sample user registers. Reported-by: Mark Rutland Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky Cc: stable@vger.kernel.org commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 Author: Stefan Agner Date: Mon Sep 17 19:31:57 2018 -0700 kbuild: allow to use GCC toolchain not in Clang search path When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: https://github.com/ClangBuiltLinux/linux/issues/78 Signed-off-by: Stefan Agner Reviewed-and-tested-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 5a4630aadb9a9525474e9ac92965829f990cb5c4 Author: Joel Stanley Date: Mon Sep 17 17:07:54 2018 +0930 ftrace: Build with CPPFLAGS to get -Qunused-arguments When building to record the mcount locations the kernel uses KBUILD_CFLAGS but not KBUILD_CPPFLAGS. This means it lacks -Qunused-arguments when building with clang, resulting in a lot of noisy warnings. Signed-off-by: Joel Stanley Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 336b08088d4da009108d4418e241ca95c9152237 Author: Thomas Gleixner Date: Wed Sep 19 13:48:41 2018 +0200 MAINTAINERS: Add Borislav to the x86 maintainers Borislav is effectivly maintaining parts of X86 already, make it official. Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar Acked-by: Borislav Petkov commit 9e796c9db93b4840d1b00e550eea26db7cb741e2 Author: Toshi Kani Date: Fri Sep 14 08:51:14 2018 -0600 ext2, dax: set ext2_dax_aops for dax files Sync syscall to DAX file needs to flush processor cache, but it currently does not flush to existing DAX files. This is because 'ext2_da_aops' is set to address_space_operations of existing DAX files, instead of 'ext2_dax_aops', since S_DAX flag is set after ext2_set_aops() in the open path. Similar to ext4, change ext2_iget() to initialize i_flags before ext2_set_aops(). Fixes: fb094c90748f ("ext2, dax: introduce ext2_dax_aops") Signed-off-by: Toshi Kani Suggested-by: Jan Kara Cc: Jan Kara Cc: Dan Williams Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: Signed-off-by: Jan Kara commit 5d05dfd13f20b01a3cd5d293058baa7d5c1583b6 Merge: f21f7fa263ac 169e366c0808 Author: Ingo Molnar Date: Wed Sep 19 13:25:35 2018 +0200 Merge tag 'perf-urgent-for-mingo-4.19-20180918' 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 the build on !_GNU_SOURCE libc systems such as Alpine Linux/musl libc due to usage of strerror_r glibc variant on libbpf (Arnaldo Carvalho de Melo) - Fix out-of-tree asciidoctor man page generation (Ben Hutchings) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit 571d0563c8881595f4ab027aef9ed1c55e3e7b7c Author: Dan Carpenter Date: Wed Sep 19 13:35:53 2018 +0300 x86/paravirt: Fix some warning messages The first argument to WARN_ONCE() is a condition. Fixes: 5800dc5c19f3 ("x86/paravirt: Fix spectre-v2 mitigations for paravirt guests") Signed-off-by: Dan Carpenter Signed-off-by: Thomas Gleixner Reviewed-by: Juergen Gross Cc: Peter Zijlstra Cc: Alok Kataria Cc: "H. Peter Anvin" Cc: virtualization@lists.linux-foundation.org Cc: kernel-janitors@vger.kernel.org Link: https://lkml.kernel.org/r/20180919103553.GD9238@mwanda commit 3a58ac65e2d7969bcdf1b6acb70fa4d12a88e53e Author: Thomas Petazzoni Date: Thu Sep 13 16:48:08 2018 +0100 ARM: 8799/1: mm: fix pci_ioremap_io() offset check IO_SPACE_LIMIT is the ending address of the PCI IO space, i.e something like 0xfffff (and not 0x100000). Therefore, when offset = 0xf0000 is passed as argument, this function fails even though the offset + SZ_64K fits below the IO_SPACE_LIMIT. This makes the last chunk of 64 KB of the I/O space not usable as it cannot be mapped. This patch fixes that by substracing 1 to offset + SZ_64K, so that we compare the addrss of the last byte of the I/O space against IO_SPACE_LIMIT instead of the address of the first byte of what is after the I/O space. Fixes: c2794437091a4 ("ARM: Add fixed PCI i/o mapping") Signed-off-by: Thomas Petazzoni Acked-by: Nicolas Pitre Signed-off-by: Russell King commit 73aeb2cbcdc9be391b3d32a55319a59ce425426f Author: Stefan Agner Date: Tue Sep 11 04:27:41 2018 +0100 ARM: 8787/1: wire up io_pgetevents syscall Wire up the new io_pgetevents syscall for ARM. Signed-off-by: Stefan Agner Acked-by: Christoph Hellwig Signed-off-by: Russell King commit 558a9ef94a329a1ac75613407ad15d0d0071ff4c Author: Icenowy Zheng Date: Sun Sep 16 12:34:06 2018 +0800 drm: sun4i: drop second PLL from A64 HDMI PHY The A64 HDMI PHY seems to be not able to use the second video PLL as clock parent in experiments. Drop the support for the second PLL from A64 HDMI PHY driver. Fixes: b46e2c9f5f64 ("drm/sun4i: Add support for A64 HDMI PHY") Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180916043409.62374-2-icenowy@aosc.io commit 4ca719a338d5ebb713e0ae56c208a689f1efe20f Merge: f21f7fa263ac 24568b47d48e Author: Greg Kroah-Hartman Date: Wed Sep 19 08:29:42 2018 +0200 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Crypto stuff from Herbert: "This push fixes a potential boot hang in ccp and an incorrect CPU capability check in aegis/morus on x86." * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: x86/aegis,morus - Do not require OSXSAVE for SSE2 crypto: ccp - add timeout support in the SEV command commit f21f7fa263ac005713f0a7a43179c5aea0fabe85 Merge: eba2d6b34a32 83f365554e47 Author: Greg Kroah-Hartman Date: Wed Sep 19 07:41:46 2018 +0200 Merge tag 'trace-v4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Steven writes: "Vaibhav Nagarnaik found that modifying the ring buffer size could cause a huge latency in the system because it does a while loop to free pages without releasing the CPU (on non preempt kernels). In a case where there are hundreds of thousands of pages to free it could actually cause a system stall. A properly place cond_resched() solves this issue." commit eba2d6b34a32bdc3585c5810633ec38f9472380c Merge: 5211da9ca526 ff0e9f26288d Author: Greg Kroah-Hartman Date: Wed Sep 19 07:21:21 2018 +0200 Merge tag 'platform-drivers-x86-v4.19-2' of git://git.infradead.org/linux-platform-drivers-x86 Darren writes: "platform-drivers-x86 for v4.19-2 Free allocated ACPI buffers in two drivers. The following is an automated git shortlog grouped by driver: alienware-wmi: - Correct a memory leak dell-smbios-wmi: - Correct a memory leak" * tag 'platform-drivers-x86-v4.19-2' of git://git.infradead.org/linux-platform-drivers-x86: platform/x86: alienware-wmi: Correct a memory leak platform/x86: dell-smbios-wmi: Correct a memory leak commit 69ba423d35c25ae06fa419ac1d4f6c4e2b74e412 Merge: 126d6848ef13 ce7ea4af0838 Author: David S. Miller Date: Tue Sep 18 20:17:01 2018 -0700 Merge branch 'ipv6-fix-issues-on-accessing-fib6_metrics' Wei Wang says: ==================== ipv6: fix issues on accessing fib6_metrics The latest fix on the memory leak of fib6_metrics still causes use-after-free. This patch series first revert the previous fix and propose a new fix that is more inline with ipv4 logic and is tested to fix the use-after-free issue reported. ==================== Signed-off-by: David S. Miller commit ce7ea4af0838ffd4667ecad4eb5eec7a25342f1e Author: Wei Wang Date: Tue Sep 18 13:45:00 2018 -0700 ipv6: fix memory leak on dst->_metrics When dst->_metrics and f6i->fib6_metrics share the same memory, both take reference count on the dst_metrics structure. However, when dst is destroyed, ip6_dst_destroy() only invokes dst_destroy_metrics_generic() which does not take care of READONLY metrics and does not release refcnt. This causes memory leak. Similar to ipv4 logic, the fix is to properly release refcnt and free the memory space pointed by dst->_metrics if refcnt becomes 0. Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes") Reported-by: Sabrina Dubroca Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 8675860592321a43bbb0b5aedc244a9b2321edc3 Author: Wei Wang Date: Tue Sep 18 13:44:59 2018 -0700 Revert "ipv6: fix double refcount of fib6_metrics" This reverts commit e70a3aad44cc8b24986687ffc98c4a4f6ecf25ea. This change causes use-after-free on dst->_metrics. The crash trace looks like this: [ 97.763269] BUG: KASAN: use-after-free in ip6_mtu+0x116/0x140 [ 97.769038] Read of size 4 at addr ffff881781d2cf84 by task svw_NetThreadEv/8801 [ 97.777954] CPU: 76 PID: 8801 Comm: svw_NetThreadEv Not tainted 4.15.0-smp-DEV #11 [ 97.777956] Hardware name: Default string Default string/Indus_QC_02, BIOS 5.46.4 03/29/2018 [ 97.777957] Call Trace: [ 97.777971] [] dump_stack+0x4d/0x72 [ 97.777985] [] print_address_description+0x6f/0x260 [ 97.777997] [] kasan_report+0x257/0x370 [ 97.778001] [] ? ip6_mtu+0x116/0x140 [ 97.778004] [] __asan_report_load4_noabort+0x19/0x20 [ 97.778008] [] ip6_mtu+0x116/0x140 [ 97.778013] [] tcp_current_mss+0x12e/0x280 [ 97.778016] [] ? tcp_mtu_to_mss+0x2d0/0x2d0 [ 97.778022] [] ? depot_save_stack+0x138/0x4a0 [ 97.778037] [] ? __mmdrop+0x145/0x1f0 [ 97.778040] [] ? save_stack+0xb1/0xd0 [ 97.778046] [] tcp_send_mss+0x22/0x220 [ 97.778059] [] tcp_sendmsg_locked+0x4f9/0x39f0 [ 97.778062] [] ? kasan_check_write+0x14/0x20 [ 97.778066] [] ? tcp_sendpage+0x60/0x60 [ 97.778070] [] ? rw_copy_check_uvector+0x69/0x280 [ 97.778075] [] ? import_iovec+0x9f/0x430 [ 97.778078] [] ? kasan_slab_free+0x87/0xc0 [ 97.778082] [] ? memzero_page+0x140/0x140 [ 97.778085] [] ? kasan_check_write+0x14/0x20 [ 97.778088] [] tcp_sendmsg+0x2c/0x50 [ 97.778092] [] ? tcp_sendmsg+0x2c/0x50 [ 97.778098] [] inet_sendmsg+0x103/0x480 [ 97.778102] [] ? inet_gso_segment+0x15b0/0x15b0 [ 97.778105] [] sock_sendmsg+0xba/0xf0 [ 97.778108] [] ___sys_sendmsg+0x6ca/0x8e0 [ 97.778113] [] ? hrtimer_try_to_cancel+0x71/0x3b0 [ 97.778116] [] ? copy_msghdr_from_user+0x3d0/0x3d0 [ 97.778119] [] ? memset+0x31/0x40 [ 97.778123] [] ? schedule_hrtimeout_range_clock+0x165/0x380 [ 97.778127] [] ? hrtimer_nanosleep_restart+0x250/0x250 [ 97.778130] [] ? __hrtimer_init+0x180/0x180 [ 97.778133] [] ? ktime_get_ts64+0x172/0x200 [ 97.778137] [] ? __fget_light+0x8c/0x2f0 [ 97.778141] [] __sys_sendmsg+0xe6/0x190 [ 97.778144] [] ? __sys_sendmsg+0xe6/0x190 [ 97.778147] [] ? SyS_shutdown+0x20/0x20 [ 97.778152] [] ? wake_up_q+0xe0/0xe0 [ 97.778155] [] ? __sys_sendmsg+0x190/0x190 [ 97.778158] [] SyS_sendmsg+0x13/0x20 [ 97.778162] [] do_syscall_64+0x2ac/0x430 [ 97.778166] [] ? do_page_fault+0x35/0x3d0 [ 97.778171] [] ? page_fault+0x2f/0x50 [ 97.778174] [] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 [ 97.778177] RIP: 0033:0x7f83fa36000d [ 97.778178] RSP: 002b:00007f83ef9229e0 EFLAGS: 00000293 ORIG_RAX: 000000000000002e [ 97.778180] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f83fa36000d [ 97.778182] RDX: 0000000000004000 RSI: 00007f83ef922f00 RDI: 0000000000000036 [ 97.778183] RBP: 00007f83ef923040 R08: 00007f83ef9231f8 R09: 00007f83ef923168 [ 97.778184] R10: 0000000000000000 R11: 0000000000000293 R12: 00007f83f69c5b40 [ 97.778185] R13: 000000000000001c R14: 0000000000000001 R15: 0000000000004000 [ 97.779684] Allocated by task 5919: [ 97.783185] save_stack+0x46/0xd0 [ 97.783187] kasan_kmalloc+0xad/0xe0 [ 97.783189] kmem_cache_alloc_trace+0xdf/0x580 [ 97.783190] ip6_convert_metrics.isra.79+0x7e/0x190 [ 97.783192] ip6_route_info_create+0x60a/0x2480 [ 97.783193] ip6_route_add+0x1d/0x80 [ 97.783195] inet6_rtm_newroute+0xdd/0xf0 [ 97.783198] rtnetlink_rcv_msg+0x641/0xb10 [ 97.783200] netlink_rcv_skb+0x27b/0x3e0 [ 97.783202] rtnetlink_rcv+0x15/0x20 [ 97.783203] netlink_unicast+0x4be/0x720 [ 97.783204] netlink_sendmsg+0x7bc/0xbf0 [ 97.783205] sock_sendmsg+0xba/0xf0 [ 97.783207] ___sys_sendmsg+0x6ca/0x8e0 [ 97.783208] __sys_sendmsg+0xe6/0x190 [ 97.783209] SyS_sendmsg+0x13/0x20 [ 97.783211] do_syscall_64+0x2ac/0x430 [ 97.783213] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 [ 97.784709] Freed by task 0: [ 97.785056] knetbase: Error: /proc/sys/net/core/txcs_enable does not exist [ 97.794497] save_stack+0x46/0xd0 [ 97.794499] kasan_slab_free+0x71/0xc0 [ 97.794500] kfree+0x7c/0xf0 [ 97.794501] fib6_info_destroy_rcu+0x24f/0x310 [ 97.794504] rcu_process_callbacks+0x38b/0x1730 [ 97.794506] __do_softirq+0x1c8/0x5d0 Reported-by: John Sperbeck Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 126d6848ef13958e1cb959e96c21d19bc498ade9 Author: Russell King Date: Tue Sep 18 16:48:53 2018 +0100 sfp: fix oops with ethtool -m If a network interface is created prior to the SFP socket being available, ethtool can request module information. This unfortunately leads to an oops: Unable to handle kernel NULL pointer dereference at virtual address 00000008 pgd = (ptrval) [00000008] *pgd=7c400831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] SMP ARM Modules linked in: CPU: 0 PID: 1480 Comm: ethtool Not tainted 4.19.0-rc3 #138 Hardware name: Broadcom Northstar Plus SoC PC is at sfp_get_module_info+0x8/0x10 LR is at dev_ethtool+0x218c/0x2afc Fix this by not filling in the network device's SFP bus pointer until SFP is fully bound, thereby avoiding the core calling into the SFP bus code. Fixes: ce0aa27ff3f6 ("sfp: add sfp-bus to bridge between network devices and sfp cages") Reported-by: Florian Fainelli Tested-by: Florian Fainelli Signed-off-by: Russell King Signed-off-by: David S. Miller commit 774268f3e51b53ed432a1ec516574fd5ba469398 Author: Antoine Tenart Date: Tue Sep 18 16:58:47 2018 +0200 net: mvpp2: fix a txq_done race condition When no Tx IRQ is available, the txq_done() routine (called from tx_done()) shouldn't be called from the polling function, as in such case it is already called in the Tx path thanks to an hrtimer. This mostly occurred when using PPv2.1, as the engine then do not have Tx IRQs. Fixes: edc660fa09e2 ("net: mvpp2: replace TX coalescing interrupts with hrtimer") Reported-by: Stefan Chulski Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller commit 81d0b759e161f8c560fb0fce1aa95b00ac19e624 Merge: 2fe397a3959d 381897798a94 Author: David S. Miller Date: Tue Sep 18 20:11:43 2018 -0700 Merge branch 'net-smc-fixes' Ursula Braun says: ==================== net/smc: fixes 2018-09-18 here are some fixes in different areas of the smc code for the net tree. ==================== Signed-off-by: David S. Miller commit 381897798a94065ffcad0772eecdc6b04a7ff23d Author: YueHaibing Date: Tue Sep 18 15:46:38 2018 +0200 net/smc: fix sizeof to int comparison Comparing an int to a size, which is unsigned, causes the int to become unsigned, giving the wrong result. kernel_sendmsg can return a negative error code. Signed-off-by: YueHaibing Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 71d117f527425e2d6a5029e8365d82a8d2d6916a Author: Karsten Graul Date: Tue Sep 18 15:46:37 2018 +0200 net/smc: no urgent data check for listen sockets Don't check a listen socket for pending urgent data in smc_poll(). Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit dd65d87a6abd537ae9bb3bdcee8905704b936884 Author: Ursula Braun Date: Tue Sep 18 15:46:36 2018 +0200 net/smc: enable fallback for connection abort in state INIT If a linkgroup is terminated abnormally already due to failing LLC CONFIRM LINK or LLC ADD LINK, fallback to TCP is still possible. In this case do not switch to state SMC_PEERABORTWAIT and do not set sk_err. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 1ca52fcfaca43665d525645348801a6f4a4b9e9a Author: Ursula Braun Date: Tue Sep 18 15:46:35 2018 +0200 net/smc: remove duplicate mutex_unlock For a failing smc_listen_rdma_finish() smc_listen_decline() is called. If fallback is possible, the new socket is already enqueued to be accepted in smc_listen_decline(). Avoid enqueuing a second time afterwards in this case, otherwise the smc_create_lgr_pending lock is released twice: [ 373.463976] WARNING: bad unlock balance detected! [ 373.463978] 4.18.0-rc7+ #123 Tainted: G O [ 373.463979] ------------------------------------- [ 373.463980] kworker/1:1/30 is trying to release lock (smc_create_lgr_pending) at: [ 373.463990] [<000003ff801205fc>] smc_listen_work+0x22c/0x5d0 [smc] [ 373.463991] but there are no more locks to release! [ 373.463991] other info that might help us debug this: [ 373.463993] 2 locks held by kworker/1:1/30: [ 373.463994] #0: 00000000772cbaed ((wq_completion)"events"){+.+.}, at: process_one_work+0x1ec/0x6b0 [ 373.464000] #1: 000000003ad0894a ((work_completion)(&new_smc->smc_listen_work)){+.+.}, at: process_one_work+0x1ec/0x6b0 [ 373.464003] stack backtrace: [ 373.464005] CPU: 1 PID: 30 Comm: kworker/1:1 Kdump: loaded Tainted: G O 4.18.0-rc7uschi+ #123 [ 373.464007] Hardware name: IBM 2827 H43 738 (LPAR) [ 373.464010] Workqueue: events smc_listen_work [smc] [ 373.464011] Call Trace: [ 373.464015] ([<0000000000114100>] show_stack+0x60/0xd8) [ 373.464019] [<0000000000a8c9bc>] dump_stack+0x9c/0xd8 [ 373.464021] [<00000000001dcaf8>] print_unlock_imbalance_bug+0xf8/0x108 [ 373.464022] [<00000000001e045c>] lock_release+0x114/0x4f8 [ 373.464025] [<0000000000aa87fa>] __mutex_unlock_slowpath+0x4a/0x300 [ 373.464027] [<000003ff801205fc>] smc_listen_work+0x22c/0x5d0 [smc] [ 373.464029] [<0000000000197a68>] process_one_work+0x2a8/0x6b0 [ 373.464030] [<0000000000197ec2>] worker_thread+0x52/0x410 [ 373.464033] [<000000000019fd0e>] kthread+0x15e/0x178 [ 373.464035] [<0000000000aaf58a>] kernel_thread_starter+0x6/0xc [ 373.464052] [<0000000000aaf584>] kernel_thread_starter+0x0/0xc [ 373.464054] INFO: lockdep is turned off. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 648a5a7aed346c3b8fe7c32a835edfb0dfbf4451 Author: Ursula Braun Date: Tue Sep 18 15:46:34 2018 +0200 net/smc: fix non-blocking connect problem In state SMC_INIT smc_poll() delegates polling to the internal CLC socket. This means, once the connect worker has finished its kernel_connect() step, the poll wake-up may occur. This is not intended. The wake-up should occur from the wake up call in smc_connect_work() after __smc_connect() has finished. Thus in state SMC_INIT this patch now calls sock_poll_wait() on the main SMC socket. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 2fe397a3959de8a472f165e6d152f64cb77fa2cc Author: Kazuya Mizuguchi Date: Tue Sep 18 12:22:26 2018 +0200 ravb: do not write 1 to reserved bits EtherAVB hardware requires 0 to be written to status register bits in order to clear them, however, care must be taken not to: 1. Clear other bits, by writing zero to them 2. Write one to reserved bits This patch corrects the ravb driver with respect to the second point above. This is done by defining reserved bit masks for the affected registers and, after auditing the code, ensure all sites that may write a one to a reserved bit use are suitably masked. Signed-off-by: Kazuya Mizuguchi Signed-off-by: Simon Horman Reviewed-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 65fac4fe9080714df80d430888834ce87c6716ba Author: zhong jiang Date: Tue Sep 18 15:15:44 2018 +0800 net: bnxt: Fix a uninitialized variable warning. Fix the following compile warning: drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:49:5: warning: ‘nvm_param.dir_type’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (nvm_param.dir_type == BNXT_NVM_PORT_CFG) Signed-off-by: zhong jiang Acked-by: Michael Chan Signed-off-by: David S. Miller commit 6344244c71fdb797853ad5d0b9a076b911fa18a4 Merge: 08e39982ef64 8f92e35aff96 Author: David S. Miller Date: Tue Sep 18 19:59:23 2018 -0700 Merge tag 'mlx5-fixes-2018-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2018-09-17 Sorry about the previous submission of this series which was mistakenly marked for net-next, here I am resending with 'net' mark. This series provides three fixes to mlx5 core and mlx5e netdevice driver. Please pull and let me know if there's any problem. For -stable v4.16: ('net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ') ==================== Signed-off-by: David S. Miller commit 08e39982ef64f800fd1f9b9b92968d14d5fafa82 Author: Christian Lamparter Date: Mon Sep 17 17:22:40 2018 +0200 net: emac: fix fixed-link setup for the RTL8363SB switch On the Netgear WNDAP620, the emac ethernet isn't receiving nor xmitting any frames from/to the RTL8363SB (identifies itself as a RTL8367RB). This is caused by the emac hardware not knowing the forced link parameters for speed, duplex, pause, etc. This begs the question, how this was working on the original driver code, when it was necessary to set the phy_address and phy_map to 0xffffffff. But I guess without access to the old PPC405/440/460 hardware, it's not possible to know. Signed-off-by: Christian Lamparter Signed-off-by: David S. Miller commit e285d5bfb7e9785d289663baef252dd315e171f8 Author: Suren Baghdasaryan Date: Mon Sep 17 15:51:41 2018 +0200 NFC: Fix the number of pipes According to ETSI TS 102 622 specification chapter 4.4 pipe identifier is 7 bits long which allows for 128 unique pipe IDs. Because NFC_HCI_MAX_PIPES is used as the number of pipes supported and not as the max pipe ID, its value should be 128 instead of 127. nfc_hci_recv_from_llc extracts pipe ID from packet header using NFC_HCI_FRAGMENT(0x7F) mask which allows for pipe ID value of 127. Same happens when NCI_HCP_MSG_GET_PIPE() is being used. With pipes array having only 127 elements and pipe ID of 127 the OOB memory access will result. Cc: Samuel Ortiz Cc: Allen Pais Cc: "David S. Miller" Suggested-by: Dan Carpenter Signed-off-by: Suren Baghdasaryan Reviewed-by: Kees Cook Cc: stable Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller commit 674d9de02aa7d521ebdf66c3958758bdd9c64e11 Author: Suren Baghdasaryan Date: Mon Sep 17 15:51:40 2018 +0200 NFC: Fix possible memory corruption when handling SHDLC I-Frame commands When handling SHDLC I-Frame commands "pipe" field used for indexing into an array should be checked before usage. If left unchecked it might access memory outside of the array of size NFC_HCI_MAX_PIPES(127). Malformed NFC HCI frames could be injected by a malicious NFC device communicating with the device being attacked (remote attack vector), or even by an attacker with physical access to the I2C bus such that they could influence the data transfers on that bus (local attack vector). skb->data is controlled by the attacker and has only been sanitized in the most trivial ways (CRC check), therefore we can consider the create_info struct and all of its members to tainted. 'create_info->pipe' with max value of 255 (uint8) is used to take an offset of the hdev->pipes array of 127 elements which can lead to OOB write. Cc: Samuel Ortiz Cc: Allen Pais Cc: "David S. Miller" Suggested-by: Kevin Deus Signed-off-by: Suren Baghdasaryan Acked-by: Kees Cook Cc: stable Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller commit 0a286afee5a1e8dca86d824209dbd3200294f86f Author: Sabrina Dubroca Date: Mon Sep 17 15:30:06 2018 +0200 selftests: pmtu: properly redirect stderr to /dev/null The cleanup function uses "$CMD 2 > /dev/null", which doesn't actually send stderr to /dev/null, so when the netns doesn't exist, the error message is shown. Use "2> /dev/null" instead, so that those messages disappear, as was intended. Fixes: d1f1b9cbf34c ("selftests: net: Introduce first PMTU test") Signed-off-by: Sabrina Dubroca Acked-by: Stefano Brivio Signed-off-by: David S. Miller commit 87ebcffd82ecc58175f1667af58b8138d43fb859 Merge: 5211da9ca526 0431100b3d82 Author: David S. Miller Date: Tue Sep 18 19:48:08 2018 -0700 Merge branch 'stmmac-Coalesce-and-tail-addr-fixes' Jose Abreu says: ==================== net: stmmac: Coalesce and tail addr fixes The fix for coalesce timer and a fix in tail address setting that impacts XGMAC2 operation. The series is: Tested-by: Jerome Brunet on a113 s400 board (single queue) ==================== Signed-off-by: David S. Miller commit 0431100b3d82c509729ece1ab22ada2484e209c1 Author: Jose Abreu Date: Mon Sep 17 09:22:57 2018 +0100 net: stmmac: Fixup the tail addr setting in xmit path Currently we are always setting the tail address of descriptor list to the end of the pre-allocated list. According to databook this is not correct. Tail address should point to the last available descriptor + 1, which means we have to update the tail address everytime we call the xmit function. This should make no impact in older versions of MAC but in newer versions there are some DMA features which allows the IP to fetch descriptors in advance and in a non sequential order so its critical that we set the tail address correctly. Signed-off-by: Jose Abreu Fixes: f748be531d70 ("stmmac: support new GMAC4") Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller commit 8fce3331702316d4bcfeb0771c09ac75d2192bbc Author: Jose Abreu Date: Mon Sep 17 09:22:56 2018 +0100 net: stmmac: Rework coalesce timer and fix multi-queue races This follows David Miller advice and tries to fix coalesce timer in multi-queue scenarios. We are now using per-queue coalesce values and per-queue TX timer. Coalesce timer default values was changed to 1ms and the coalesce frames to 25. Tested in B2B setup between XGMAC2 and GMAC5. Signed-off-by: Jose Abreu Fixes: ce736788e8a ("net: stmmac: adding multiple buffers for TX") Cc: Florian Fainelli Cc: Neil Armstrong Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller commit 19a4fbffc94e41abaa2a623a25ce2641d69eccf0 Author: Ricardo Ribalda Delgado Date: Thu Sep 13 15:37:04 2018 +0200 gpiolib: Free the last requested descriptor The current code only frees N-1 gpios if an error occurs during gpiod_set_transitory, gpiod_direction_output or gpiod_direction_input. Leading to gpios that cannot be used by userspace nor other drivers. Cc: Timur Tabi Cc: stable@vger.kernel.org Fixes: ab3dbcf78f60f46d ("gpioib: do not free unrequested descriptors) Reported-by: Jan Lorenzen Reported-by: Jim Paris Signed-off-by: Ricardo Ribalda Delgado Signed-off-by: Linus Walleij commit 8e2aac333785f91ff74e219a1e78e6bdc1ef2c41 Author: Simon Detheridge Date: Sat Sep 15 22:15:18 2018 +0100 pinctrl: cannonlake: Fix gpio base for GPP-E The gpio base for GPP-E was set incorrectly to 258 instead of 256, preventing the touchpad working on my Tong Fang GK5CN5Z laptop. Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=200787 Signed-off-by: Simon Detheridge Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit 4fef1250eafddc5182cd5c3c354a6971bcf7520d Author: Peter Hutterer Date: Tue Sep 18 09:53:32 2018 -0700 Input: uinput - allow for max == min during input_absinfo validation These values are inclusive, so a range of 1 requires min == max. Signed-off-by: Peter Hutterer Reviewed-by: Martin Kepplinger Signed-off-by: Dmitry Torokhov commit 91a97507323e1ad4bfc10f4a5922e67cdaf8b3cd Author: Aaron Ma Date: Tue Sep 18 09:32:22 2018 -0700 Input: elantech - enable middle button of touchpad on ThinkPad P72 Adding 2 new touchpad IDs to support middle button support. Cc: stable@vger.kernel.org Signed-off-by: Aaron Ma Signed-off-by: Dmitry Torokhov commit 52d2c7bf7c90217fbe875d2d76f310979c48eb83 Author: Michael Schmitz Date: Mon Sep 17 15:27:49 2018 -0700 Input: atakbd - fix Atari CapsLock behaviour The CapsLock key on Atari keyboards is not a toggle, it does send the normal make and break scancodes. Drop the CapsLock toggle handling code, which did cause the CapsLock key to merely act as a Shift key. Tested-by: Michael Schmitz Signed-off-by: Michael Schmitz Signed-off-by: Andreas Schwab Signed-off-by: Dmitry Torokhov commit 9e62df51be993035c577371ffee5477697a56aad Author: Andreas Schwab Date: Mon Sep 17 12:43:34 2018 -0700 Input: atakbd - fix Atari keymap Fix errors in Atari keymap (mostly in keypad, help and undo keys). Patch provided on debian-68k ML by Andreas Schwab , keymap array size and unhandled scancode limit adjusted to 0x73 by me. Tested-by: Michael Schmitz Signed-off-by: Michael Schmitz Signed-off-by: Andreas Schwab Signed-off-by: Dmitry Torokhov commit 49f62249a9577b0f8c20c7c843d23289d143daf1 Author: Anson Huang Date: Mon Sep 17 11:08:52 2018 -0700 Input: egalax_ts - add system wakeup support This patch adds wakeup function support for egalax touch screen, if "wakeup-source" is added to device tree's egalax touch screen node, the wakeup function will be enabled, and egalax touch screen will be able to wakeup system from suspend. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Dmitry Torokhov commit b8a946d8dc245ec3adae65c8eab6f3e73a950af3 Author: Song Qiang Date: Mon Sep 17 11:08:01 2018 -0700 Input: gpio-keys - fix a documentation index issue gpio_keys.c now exists in the drivers/input/keyboard/ rather than drivers/input/. Signed-off-by: Song Qiang Signed-off-by: Dmitry Torokhov commit 008d2f444222554289867e1686f1be1c1bcd0ef4 Merge: 11da3a7f84f1 d31095936594 Author: Thomas Gleixner Date: Wed Sep 19 00:12:06 2018 +0200 Merge tag 'efi-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/urgent Pull EFI fix from Ard Biesheuvel: Apply a fix from Scott to make the ARM stub's DTB loader opt-out rather than opt-in. commit 235fe0851bcf1d6ffd6cef4c7eb0d701d0946053 Author: Bjorn Helgaas Date: Wed Sep 12 11:55:26 2018 -0500 MAINTAINERS: Update PPC contacts for PCI core error handling The original PCI error recovery functionality was for the powerpc-specific IBM EEH feature. PCIe subsequently added some similar features, including AER and DPC, that can be used on any architecture. We want the generic PCI core error handling support to work with all of these features. Driver error recovery callbacks should be independent of which feature the platform provides. Add the generic PCI core error recovery files to the powerpc EEH MAINTAINERS entry so the powerpc folks will be copied on changes to the generic PCI error handling strategy. Add Sam and Oliver as maintainers for this area. Signed-off-by: Bjorn Helgaas Acked-by: Russell Currey Acked-by: Sam Bobroff commit ffb2315fd22c2568747402eecdc581a245a2f5ba Author: Reinette Chatre Date: Sat Sep 15 14:58:27 2018 -0700 x86/intel_rdt: Fix incorrect loop end condition In order to determine a sane default cache allocation for a new CAT/CDP resource group, all resource groups are checked to determine which cache portions are available to share. At this time all possible CLOSIDs that can be supported by the resource is checked. This is problematic if the resource supports more CLOSIDs than another CAT/CDP resource. In this case, the number of CLOSIDs that could be allocated are fewer than the number of CLOSIDs that can be supported by the resource. Limit the check of closids to that what is supported by the system based on the minimum across all resources. Fixes: 95f0b77ef ("x86/intel_rdt: Initialize new resource group with sane defaults") Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Xiaochen Shen" Cc: "Chen Yu" Link: https://lkml.kernel.org/r/1537048707-76280-10-git-send-email-fenghua.yu@intel.com commit 939b90b20bc87e199b6b53942764b987289b87ce Author: Reinette Chatre Date: Sat Sep 15 14:58:26 2018 -0700 x86/intel_rdt: Fix exclusive mode handling of MBA resource It is possible for a resource group to consist out of MBA as well as CAT/CDP resources. The "exclusive" resource mode only applies to the CAT/CDP resources since MBA allocations cannot be specified to overlap or not. When a user requests a resource group to become "exclusive" then it can only be successful if there are CAT/CDP resources in the group and none of their CBMs associated with the group's CLOSID overlaps with any other resource group. Fix the "exclusive" mode setting by failing if there isn't any CAT/CDP resource in the group and ensuring that the CBM checking is only done on CAT/CDP resources. Fixes: 49f7b4efa ("x86/intel_rdt: Enable setting of exclusive mode") Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Xiaochen Shen" Cc: "Chen Yu" Link: https://lkml.kernel.org/r/1537048707-76280-9-git-send-email-fenghua.yu@intel.com commit f0df4e1acf3d721958dcafb2c9c0bdf25189068d Author: Reinette Chatre Date: Sat Sep 15 14:58:25 2018 -0700 x86/intel_rdt: Fix incorrect loop end condition A loop is used to check if a CAT resource's CBM of one CLOSID overlaps with the CBM of another CLOSID of the same resource. The loop is run over all CLOSIDs supported by the resource. The problem with running the loop over all CLOSIDs supported by the resource is that its number of supported CLOSIDs may be more than the number of supported CLOSIDs on the system, which is the minimum number of CLOSIDs supported across all resources. Fix the loop to only consider the number of system supported CLOSIDs, not all that are supported by the resource. Fixes: 49f7b4efa ("x86/intel_rdt: Enable setting of exclusive mode") Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Xiaochen Shen" Cc: "Chen Yu" Link: https://lkml.kernel.org/r/1537048707-76280-8-git-send-email-fenghua.yu@intel.com commit 32d736abed4febff4b6bf85d5d240ee24d254322 Author: Reinette Chatre Date: Sat Sep 15 14:58:24 2018 -0700 x86/intel_rdt: Do not allow pseudo-locking of MBA resource A system supporting pseudo-locking may have MBA as well as CAT resources of which only the CAT resources could support cache pseudo-locking. When the schemata to be pseudo-locked is provided it should be checked that that schemata does not attempt to pseudo-lock a MBA resource. Fixes: e0bdfe8e3 ("x86/intel_rdt: Support creation/removal of pseudo-locked region") Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Xiaochen Shen" Cc: "Chen Yu" Link: https://lkml.kernel.org/r/1537048707-76280-7-git-send-email-fenghua.yu@intel.com commit 70479c012b67b89e219c40eddc5dc338b7c447a3 Author: Reinette Chatre Date: Sat Sep 15 14:58:23 2018 -0700 x86/intel_rdt: Fix unchecked MSR access When a new resource group is created, it is initialized with sane defaults that currently assume the resource being initialized is a CAT resource. This code path is also followed by a MBA resource that is not allocated the same as a CAT resource and as a result we encounter the following unchecked MSR access error: unchecked MSR access error: WRMSR to 0xd51 (tried to write 0x0000 000000000064) at rIP: 0xffffffffae059994 (native_write_msr+0x4/0x20) Call Trace: mba_wrmsr+0x41/0x80 update_domains+0x125/0x130 rdtgroup_mkdir+0x270/0x500 Fix the above by ensuring the initial allocation is only attempted on a CAT resource. Fixes: 95f0b77ef ("x86/intel_rdt: Initialize new resource group with sane defaults") Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Xiaochen Shen" Cc: "Chen Yu" Link: https://lkml.kernel.org/r/1537048707-76280-6-git-send-email-fenghua.yu@intel.com commit 47d53b184aee983ab9492503da11b0a81b19145b Author: Reinette Chatre Date: Sat Sep 15 14:58:22 2018 -0700 x86/intel_rdt: Fix invalid mode warning when multiple resources are managed When multiple resources are managed by RDT, the number of CLOSIDs used is the minimum of the CLOSIDs supported by each resource. In the function rdt_bit_usage_show(), the annotated bitmask is created to depict how the CAT supporting caches are being used. During this annotated bitmask creation, each resource group is queried for its mode that is used as a label in the annotated bitmask. The maximum number of resource groups is currently assumed to be the number of CLOSIDs supported by the resource for which the information is being displayed. This is incorrect since the number of active CLOSIDs is the minimum across all resources. If information for a cache instance with more CLOSIDs than another is being generated we thus encounter a warning like: invalid mode for closid 8 WARNING: CPU: 88 PID: 1791 at [SNIP]/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c :827 rdt_bit_usage_show+0x221/0x2b0 Fix this by ensuring that only the number of supported CLOSIDs are considered. Fixes: e651901187ab8 ("x86/intel_rdt: Introduce "bit_usage" to display cache allocations details") Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Xiaochen Shen" Cc: "Chen Yu" Link: https://lkml.kernel.org/r/1537048707-76280-5-git-send-email-fenghua.yu@intel.com commit c793da8e4c62d2c002a79c47f44efead450cbcae Author: Reinette Chatre Date: Sat Sep 15 14:58:21 2018 -0700 x86/intel_rdt: Global closid helper to support future fixes The number of CLOSIDs supported by a system is the minimum number of CLOSIDs supported by any of its resources. Care should be taken when iterating over the CLOSIDs of a resource since it may be that the number of CLOSIDs supported on the system is less than the number of CLOSIDs supported by the resource. Introduce a helper function that can be used to query the number of CLOSIDs that is supported by all resources, irrespective of how many CLOSIDs are supported by a particular resource. Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Xiaochen Shen" Cc: "Chen Yu" Link: https://lkml.kernel.org/r/1537048707-76280-4-git-send-email-fenghua.yu@intel.com commit f968dc119a159a95628a20de2a2dcc913d0a82d7 Author: Reinette Chatre Date: Sat Sep 15 14:58:20 2018 -0700 x86/intel_rdt: Fix size reporting of MBA resource Chen Yu reported a divide-by-zero error when accessing the 'size' resctrl file when a MBA resource is enabled. divide error: 0000 [#1] SMP PTI CPU: 93 PID: 1929 Comm: cat Not tainted 4.19.0-rc2-debug-rdt+ #25 RIP: 0010:rdtgroup_cbm_to_size+0x7e/0xa0 Call Trace: rdtgroup_size_show+0x11a/0x1d0 seq_read+0xd8/0x3b0 Quoting Chen Yu's report: This is because for MB resource, the r->cache.cbm_len is zero, thus calculating size in rdtgroup_cbm_to_size() will trigger the exception. Fix this issue in the 'size' file by getting correct memory bandwidth value which is in MBps when MBA software controller is enabled or in percentage when MBA software controller is disabled. Fixes: d9b48c86eb38 ("x86/intel_rdt: Display resource groups' allocations in bytes") Reported-by: Chen Yu Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Tested-by: Chen Yu Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Xiaochen Shen" Link: https://lkml.kernel.org/r/20180904174614.26682-1-yu.c.chen@intel.com Link: https://lkml.kernel.org/r/1537048707-76280-3-git-send-email-fenghua.yu@intel.com commit 753694a8df318f204a0ac1303de136def16f2e9c Author: Xiaochen Shen Date: Sat Sep 15 14:58:19 2018 -0700 x86/intel_rdt: Fix data type in parsing callbacks Each resource is associated with a parsing callback to parse the data provided from user space when writing schemata file. The 'data' parameter in the callbacks is defined as a void pointer which is error prone due to lack of type check. parse_bw() processes the 'data' parameter as a string while its caller actually passes the parameter as a pointer to struct rdt_cbm_parse_data. Thus, parse_bw() takes wrong data and causes failure of parsing MBA throttle value. To fix the issue, the 'data' parameter in all parsing callbacks is defined and handled as a pointer to struct rdt_parse_data (renamed from struct rdt_cbm_parse_data). Fixes: 7604df6e16ae ("x86/intel_rdt: Support flexible data to parsing callbacks") Fixes: 9ab9aa15c309 ("x86/intel_rdt: Ensure requested schemata respects mode") Signed-off-by: Xiaochen Shen Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Cc: "H Peter Anvin" Cc: "Tony Luck" Cc: "Chen Yu" Link: https://lkml.kernel.org/r/1537048707-76280-2-git-send-email-fenghua.yu@intel.com commit 40660f1fcee8d524a60b5101538e42b1f39f106d Author: Alexey Brodkin Date: Sun Sep 16 23:47:57 2018 +0300 ARC: build: Don't set CROSS_COMPILE in arch's Makefile There's not much sense in doing that because if user or his build-system didn't set CROSS_COMPILE we still may very well make incorrect guess. But as it turned out setting CROSS_COMPILE is not as harmless as one may think: with recent changes that implemented automatic discovery of __host__ gcc features unconditional setup of CROSS_COMPILE leads to failures on execution of "make xxx_defconfig" with absent cross-compiler, for more info see [1]. Set CROSS_COMPILE as well gets in the way if we want only to build .dtb's (again with absent cross-compiler which is not really needed for building .dtb's), see [2]. Note, we had to change LIBGCC assignment type from ":=" to "=" so that is is resolved on its usage, otherwise if it is resolved at declaration time with missing CROSS_COMPILE we're getting this error message from host GCC: | gcc: error: unrecognized command line option -mmedium-calls | gcc: error: unrecognized command line option -mno-sdata [1] http://lists.infradead.org/pipermail/linux-snps-arc/2018-September/004308.html [2] http://lists.infradead.org/pipermail/linux-snps-arc/2018-September/004320.html Signed-off-by: Alexey Brodkin Cc: Masahiro Yamada Cc: Rob Herring Signed-off-by: Vineet Gupta commit a530bf948ab77b0f5cc57c55dd525eb813768782 Merge: 7876320f8880 7759ca3aac79 Author: Rodrigo Vivi Date: Tue Sep 18 08:09:43 2018 -0700 Merge tag 'gvt-fixes-2018-09-18' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2018-09-18 - Fix initial DPIO PHY register state for BXT (Colin) - BXT untracked GEN9_CLKGATE_DIS_4 warning fix (Colin) - Fix srcu lock for GFN valid check (Weinan) - Should clear GGTT entry value after vGPU destroy (Zhipeng) Signed-off-by: Rodrigo Vivi From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20180918073349.GQ20737@zhen-hp.sh.intel.com commit 59d08d00d43c644ee2011d7ff1807bdd69f31fe0 Author: Alexander Shishkin Date: Tue Sep 18 16:10:49 2018 +0300 intel_th: pci: Add Ice Lake PCH support This adds Intel(R) Trace Hub PCI ID for Ice Lake PCH. Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman commit ebe4582281d6e90972f057318a6edea14810ea48 Author: Alexander Shishkin Date: Tue Sep 18 16:10:48 2018 +0300 intel_th: Fix resource handling for ACPI glue layer The core of the driver expects the resource array from the glue layer to be indexed by even numbers, as is the case for 64-bit PCI resources. This doesn't hold true for others, ACPI in this instance, which leads to an out-of-bounds access and an ioremap() on whatever address that access fetches. This patch fixes the problem by reading resource array differently based on whether the 64-bit flag is set, which would indicate PCI glue layer. Signed-off-by: Alexander Shishkin Fixes: ebc57e399b8e ("intel_th: Add ACPI glue layer") CC: stable@vger.kernel.org # v4.17+ Signed-off-by: Greg Kroah-Hartman commit 8801922cd94c918e4dc3a108ecaa500c4d40583f Author: Alexander Shishkin Date: Tue Sep 18 16:10:47 2018 +0300 intel_th: Fix device removal logic Commit a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices") brings in new subdevice addition/removal logic that's broken for "host mode": the SWITCH device has no children to begin with, which is not handled in the code. This results in a null dereference bug later down the path. This patch fixes the subdevice removal code to handle host mode correctly. Signed-off-by: Alexander Shishkin Fixes: a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices") CC: stable@vger.kernel.org # v4.14+ Signed-off-by: Greg Kroah-Hartman commit e97267cb4d1ee01ca0929638ec0fcbb0904f903d Author: Gustavo A. R. Silva Date: Thu Aug 16 15:30:38 2018 -0500 tty: vt_ioctl: fix potential Spectre v1 vsa.console is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/tty/vt/vt_ioctl.c:711 vt_ioctl() warn: potential spectre issue 'vc_cons' [r] Fix this by sanitizing vsa.console before using it to index vc_cons Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Reviewed-by: Alan Cox Signed-off-by: Greg Kroah-Hartman commit fe32416790093b31364c08395727de17ec96ace1 Author: Dmitry Safonov Date: Tue Sep 18 00:52:52 2018 +0100 tty: Drop tty->count on tty_reopen() failure In case of tty_ldisc_reinit() failure, tty->count should be decremented back, otherwise we will never release_tty(). Tetsuo reported that it fixes noisy warnings on tty release like: pts pts4033: tty_release: tty->count(10529) != (#fd's(7) + #kopen's(0)) Fixes: commit 892d1fa7eaae ("tty: Destroy ldisc instance on hangup") Cc: stable@vger.kernel.org # v4.6+ Cc: Greg Kroah-Hartman Cc: Jiri Slaby Reviewed-by: Jiri Slaby Tested-by: Jiri Slaby Tested-by: Mark Rutland Tested-by: Tetsuo Handa Signed-off-by: Dmitry Safonov Signed-off-by: Greg Kroah-Hartman commit be28c1e3ca29887e207f0cbcd294cefe5074bab6 Author: Christophe Leroy Date: Fri Sep 14 10:32:50 2018 +0000 serial: cpm_uart: return immediately from console poll kgdb expects poll function to return immediately and returning NO_POLL_CHAR when no character is available. Fixes: f5316b4aea024 ("kgdb,8250,pl011: Return immediately from console poll") Cc: Jason Wessel Cc: Signed-off-by: Christophe Leroy Signed-off-by: Greg Kroah-Hartman commit 3216c622a24b0ebb9c159a8d1daf7f17a106b3f5 Author: Stefan Agner Date: Tue Aug 28 12:44:24 2018 +0200 tty: serial: lpuart: avoid leaking struct tty_struct The function tty_port_tty_get() gets a reference to the tty. Since the code is not using tty_port_tty_set(), the reference is kept even after closing the tty. Avoid using tty_port_tty_get() by directly access the tty instance. Since lpuart_start_rx_dma() is called from the .startup() and .set_termios() callback, it is safe to assume the tty instance is valid. Cc: stable@vger.kernel.org # v4.9+ Fixes: 5887ad43ee02 ("tty: serial: fsl_lpuart: Use cyclic DMA for Rx") Signed-off-by: Stefan Agner Signed-off-by: Greg Kroah-Hartman commit e0bf2d4982fe7d9ddaf550dd023803ea286f47fc Author: Jan Kiszka Date: Sun Aug 26 19:49:32 2018 +0200 serial: mvebu-uart: Fix reporting of effective CSIZE to userspace Apparently, this driver (or the hardware) does not support character length settings. It's apparently running in 8-bit mode, but it makes userspace believe it's in 5-bit mode. That makes tcsetattr with CS8 incorrectly fail, breaking e.g. getty from busybox, thus the login shell on ttyMVx. Fix by hard-wiring CS8 into c_cflag. Signed-off-by: Jan Kiszka Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port") Cc: stable # 4.6+ Signed-off-by: Greg Kroah-Hartman commit 169e366c08084aeb49a3793c892c9abfaa47eeda Author: Ben Hutchings Date: Sun Sep 16 16:17:05 2018 +0100 perf Documentation: Fix out-of-tree asciidoctor man page generation The dependency for the man page rule using asciidoctor incorrectly specifies a source file in $(OUTPUT). When building out-of-tree, the source file is not found, resulting in a fall-back to the following rule which uses xmlto. Signed-off-by: Ben Hutchings Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180916151704.GF4765@decadent.org.uk Fixes: ffef80ecf89f ("perf Documentation: Support for asciidoctor") Signed-off-by: Arnaldo Carvalho de Melo commit 6d41907c630d3196be89c9ed5a7f8258486b3eaf Author: Arnaldo Carvalho de Melo Date: Fri Sep 14 16:47:14 2018 -0300 tools lib bpf: Provide wrapper for strerror_r to build in !_GNU_SOURCE systems Same problem that got fixed in a similar fashion in tools/perf/ in c8b5f2c96d1b ("tools: Introduce str_error_r()"), fix it in the same way, licensing needs to be sorted out to libbpf to use libapi, so, for this simple case, just get the same wrapper in tools/lib/bpf. This makes libbpf and its users (bpftool, selftests, perf) to build again in Alpine Linux 3.[45678] and edge. Acked-by: Alexei Starovoitov Cc: Adrian Hunter Cc: Daniel Borkmann Cc: David Ahern Cc: Hendrik Brueckner Cc: Jakub Kicinski Cc: Jiri Olsa Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Quentin Monnet Cc: Thomas Richter Cc: Wang Nan Cc: Yonghong Song Fixes: 1ce6a9fc1549 ("bpf: fix build error in libbpf with EXTRA_CFLAGS="-Wp, -D_FORTIFY_SOURCE=2 -O2"") Link: https://lkml.kernel.org/r/20180917151636.GA21790@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1795f81f6167bd57b37459789f1f05ab61ace896 Merge: cb5fb87a2fbe 71d29f43b633 Author: Paolo Bonzini Date: Tue Sep 18 15:13:00 2018 +0200 Merge tag 'kvm-ppc-fixes-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD Second set of PPC KVM fixes for 4.19 Two fixes for KVM on POWER machines. Both of these relate to memory corruption and host crashes seen when transparent huge pages are enabled. The first fixes a host crash that can occur when a DMA mapping is removed by the guest and the page mapped was part of a transparent huge page; the second fixes corruption that could occur when a hypervisor page fault for a radix guest is being serviced at the same time that the backing page is being collapsed or split. commit cb5fb87a2fbee188fac605e0ebff8c35efdbaf3d Merge: 7876320f8880 40ebdb8e59df Author: Paolo Bonzini Date: Tue Sep 18 15:12:51 2018 +0200 Merge tag 'kvm-s390-master-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Fixes for 4.19 - more fallout from the hugetlbfs enablement - bugfix for vma handling commit 51c3c62b58b357e8d35e4cc32f7b4ec907426fe3 Author: Michael Neuling Date: Fri Sep 14 11:14:11 2018 +1000 powerpc: Avoid code patching freed init sections This stops us from doing code patching in init sections after they've been freed. In this chain: kvm_guest_init() -> kvm_use_magic_page() -> fault_in_pages_readable() -> __get_user() -> __get_user_nocheck() -> barrier_nospec(); We have a code patching location at barrier_nospec() and kvm_guest_init() is an init function. This whole chain gets inlined, so when we free the init section (hence kvm_guest_init()), this code goes away and hence should no longer be patched. We seen this as userspace memory corruption when using a memory checker while doing partition migration testing on powervm (this starts the code patching post migration via /sys/kernel/mobility/migration). In theory, it could also happen when using /sys/kernel/debug/powerpc/barrier_nospec. Cc: stable@vger.kernel.org # 4.13+ Signed-off-by: Michael Neuling Reviewed-by: Nicholas Piggin Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman commit ffc4c92227db5699493e43eb140b4cb5904c30ff Author: Andreas Gruenbacher Date: Tue Sep 18 00:36:36 2018 -0400 sysfs: Do not return POSIX ACL xattrs via listxattr Commit 786534b92f3c introduced a regression that caused listxattr to return the POSIX ACL attribute names even though sysfs doesn't support POSIX ACLs. This happens because simple_xattr_list checks for NULL i_acl / i_default_acl, but inode_init_always initializes those fields to ACL_NOT_CACHED ((void *)-1). For example: $ getfattr -m- -d /sys /sys: system.posix_acl_access: Operation not supported /sys: system.posix_acl_default: Operation not supported Fix this in simple_xattr_list by checking if the filesystem supports POSIX ACLs. Fixes: 786534b92f3c ("tmpfs: listxattr should include POSIX ACL xattrs") Reported-by: Marc Aurèle La France Tested-by: Marc Aurèle La France Signed-off-by: Andreas Gruenbacher Cc: stable@vger.kernel.org # v4.5+ Signed-off-by: Al Viro commit 57078338b2e4c07fb76bef23369cae0acfb1f7bc Author: Dave Airlie Date: Tue Sep 18 16:20:18 2018 +1000 drm: fix drm_drv_uses_atomic_modeset on non modesetting drivers. vgem seems to oops on the intel CI due to the vgem debugfs init hitting this path now. Check if we have mode_config funcs before checking one. Signed-off-by: Dave Airlie Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180918062018.24942-1-airlied@gmail.com commit d193d1a210ff98ee2f47d54665d1aa716ae8051b Merge: 7876320f8880 8d6ccf5cebbc Author: Greg Kroah-Hartman Date: Tue Sep 18 11:11:06 2018 +0200 Merge tag 'soundwire-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-linus Vinod writes: soundwire fixes for 4.19 - fixes in bus for - bus lock on master release - incorrect exit after stream configuration - duplicate stream state assignment commit 4a3e85f2674cbfb81052059107d0165269778e2f Author: Boris Brezillon Date: Mon Sep 17 16:31:30 2018 +0200 mtd: devices: m25p80: Make sure the buffer passed in op is DMA-able As documented in spi-mem.h, spi_mem_op->data.buf.{in,out} must be DMA-able, and commit 4120f8d158ef ("mtd: spi-nor: Use the spi_mem_xx() API") failed to follow this rule as buffers passed to ->{read,write}_reg() are usually placed on the stack. Fix that by allocating a scratch buffer and copying the data around. Fixes: 4120f8d158ef ("mtd: spi-nor: Use the spi_mem_xx() API") Reported-by: Jarkko Nikula Cc: Signed-off-by: Boris Brezillon Tested-by: Jarkko Nikula Reviewed-by: Jarkko Nikula commit 5211da9ca526a5adddee1ccd078e6e33a583ab36 Merge: 3918c21eacb0 30bfd9306281 Author: Greg Kroah-Hartman Date: Tue Sep 18 09:31:53 2018 +0200 Merge gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net Dave writes: "Various fixes, all over the place: 1) OOB data generation fix in bluetooth, from Matias Karhumaa. 2) BPF BTF boundary calculation fix, from Martin KaFai Lau. 3) Don't bug on excessive frags, to be compatible in situations mixing older and newer kernels on each end. From Juergen Gross. 4) Scheduling in RCU fix in hv_netvsc, from Stephen Hemminger. 5) Zero keying information in TLS layer before freeing copies of them, from Sabrina Dubroca. 6) Fix NULL deref in act_sample, from Davide Caratti. 7) Orphan SKB before GRO in veth to prevent crashes with XDP, from Toshiaki Makita. 8) Fix use after free in ip6_xmit, from Eric Dumazet. 9) Fix VF mac address regression in bnxt_en, from Micahel Chan. 10) Fix MSG_PEEK behavior in TLS layer, from Daniel Borkmann. 11) Programming adjustments to r8169 which fix not being to enter deep sleep states on some machines, from Kai-Heng Feng and Hans de Goede. 12) Fix DST_NOCOUNT flag handling for ipv6 routes, from Peter Oskolkov." * gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net: (45 commits) net/ipv6: do not copy dst flags on rt init qmi_wwan: set DTR for modems in forced USB2 mode clk: x86: Stop marking clocks as CLK_IS_CRITICAL r8169: Get and enable optional ether_clk clock clk: x86: add "ether_clk" alias for Bay Trail / Cherry Trail r8169: enable ASPM on RTL8106E r8169: Align ASPM/CLKREQ setting function with vendor driver Revert "kcm: remove any offset before parsing messages" kcm: remove any offset before parsing messages net: ethernet: Fix a unused function warning. net: dsa: mv88e6xxx: Fix ATU Miss Violation tls: fix currently broken MSG_PEEK behavior hv_netvsc: pair VF based on serial number PCI: hv: support reporting serial number as slot information bnxt_en: Fix VF mac address regression. ipv6: fix possible use-after-free in ip6_xmit() net: hp100: fix always-true check for link up state ARM: dts: at91: add new compatibility string for macb on sama5d3 net: macb: disable scatter-gather for macb on sama5d3 net: mvpp2: let phylink manage the carrier state ... commit 0328ba90407c82874f9f39f9a5a6e5ad6cb76f44 Author: Geert Uytterhoeven Date: Mon Sep 17 10:02:34 2018 +0200 dm raid: remove bogus const from decipher_sync_action() return type With gcc-4.1.2: drivers/md/dm-raid.c:3357: warning: type qualifiers ignored on function return type Remove the "const" keyword to fix this. Fixes: 36a240a706d43383 ("dm raid: fix RAID leg rebuild errors") Signed-off-by: Geert Uytterhoeven Acked-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit b592211c33f745af67a3271ce77c10fc1e6d6241 Author: Mike Snitzer Date: Mon Sep 17 11:38:47 2018 -0400 dm mpath: fix attached_handler_name leak and dangling hw_handler_name pointer Commit e8f74a0f0011 ("dm mpath: eliminate need to use scsi_device_from_queue") introduced 2 regressions: 1) memory leak occurs if attached_handler_name is not assigned to m->hw_handler_name 2) m->hw_handler_name can become a dangling pointer if the RETAIN_ATTACHED_HW_HANDLER flag is set and scsi_dh_attach() returns -EBUSY. Fix both of these by clearing 'attached_handler_name' pointer passed to setup_scsi_dh() after it is assigned to m->hw_handler_name. And if setup_scsi_dh() doesn't consume 'attached_handler_name' parse_path() will kfree() it. Fixes: e8f74a0f0011 ("dm mpath: eliminate need to use scsi_device_from_queue") Cc: stable@vger.kernel.org # 4.16+ Reported-by: Bart Van Assche Signed-off-by: Mike Snitzer commit 30bfd93062814d6767e452a8f5ddcd97f7e38c7e Author: Peter Oskolkov Date: Mon Sep 17 10:20:53 2018 -0700 net/ipv6: do not copy dst flags on rt init DST_NOCOUNT in dst_entry::flags tracks whether the entry counts toward route cache size (net->ipv6.sysctl.ip6_rt_max_size). If the flag is NOT set, dst_ops::pcpuc_entries counter is incremented in dist_init() and decremented in dst_destroy(). This flag is tied to allocation/deallocation of dst_entry and should not be copied from another dst/route. Otherwise it can happen that dst_ops::pcpuc_entries counter grows until no new routes can be allocated because the counter reached ip6_rt_max_size due to DST_NOCOUNT not set and thus no counter decrements on gc-ed routes. Fixes: 3b6761d18bc1 ("net/ipv6: Move dst flags to booleans in fib entries") Cc: David Ahern Acked-by: Wei Wang Signed-off-by: Peter Oskolkov Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 7759ca3aac79648d01c9edcb3b00503c02bec2f5 Author: Zhipeng Gong Date: Mon Sep 17 15:45:08 2018 +0800 drm/i915/gvt: clear ggtt entries when destroy vgpu When one vgpu is destroyed, its ggtt entries are not cleared. This patch clears ggtt entries to avoid information leak. v2: add 'Fixes' tag (Zhenyu) Fixes: 2707e4446688 ("drm/i915/gvt: vGPU graphics memory virtualization") Signed-off-by: Zhipeng Gong Reviewed-by: Hang Yuan Signed-off-by: Zhenyu Wang commit a1ac5f0943019bfd76345fe05a42cbc400da685c Author: Weinan Li Date: Mon Sep 17 09:46:14 2018 +0800 drm/i915/gvt: request srcu_read_lock before checking if one gfn is valid Fix the suspicious RCU usage issue in intel_vgpu_emulate_mmio_write. Here need to request the srcu read lock of kvm->srcu before doing gfn_to_memslot(). The detailed log is as below: [ 218.710688] ============================= [ 218.710690] WARNING: suspicious RCU usage [ 218.710693] 4.14.15-dd+ #314 Tainted: G U [ 218.710695] ----------------------------- [ 218.710697] ./include/linux/kvm_host.h:575 suspicious rcu_dereference_check() usage! [ 218.710699] other info that might help us debug this: [ 218.710702] rcu_scheduler_active = 2, debug_locks = 1 [ 218.710704] 1 lock held by qemu-system-x86/2144: [ 218.710706] #0: (&gvt->lock){+.+.}, at: [] intel_vgpu_emulate_mmio_write+0x5a/0x2d0 [ 218.710721] stack backtrace: [ 218.710724] CPU: 0 PID: 2144 Comm: qemu-system-x86 Tainted: G U 4.14.15-dd+ #314 [ 218.710727] Hardware name: Dell Inc. OptiPlex 7040/0Y7WYT, BIOS 1.1.1 10/07/2015 [ 218.710729] Call Trace: [ 218.710734] dump_stack+0x7c/0xb3 [ 218.710739] gfn_to_memslot+0x15f/0x170 [ 218.710743] kvm_is_visible_gfn+0xa/0x30 [ 218.710746] intel_vgpu_emulate_gtt_mmio_write+0x267/0x3c0 [ 218.710751] ? __mutex_unlock_slowpath+0x3b/0x260 [ 218.710754] intel_vgpu_emulate_mmio_write+0x182/0x2d0 [ 218.710759] intel_vgpu_rw+0xba/0x170 [kvmgt] [ 218.710763] intel_vgpu_write+0x14d/0x1a0 [kvmgt] [ 218.710767] __vfs_write+0x23/0x130 [ 218.710770] vfs_write+0xb0/0x1b0 [ 218.710774] SyS_pwrite64+0x73/0x90 [ 218.710777] entry_SYSCALL_64_fastpath+0x25/0x9c [ 218.710780] RIP: 0033:0x7f33e8a91da3 [ 218.710783] RSP: 002b:00007f33dddc8700 EFLAGS: 00000293 v2: add 'Fixes' tag, refine log format.(Zhenyu) Fixes: cc753fbe1ac4 ("drm/i915/gvt: validate gfn before set shadow page") Reviewed-by: Zhenyu Wang Signed-off-by: Weinan Li Signed-off-by: Zhenyu Wang commit d817de3bc186c305b8e72a52547df2971c06499d Author: Colin Xu Date: Fri Sep 14 15:12:23 2018 +0800 drm/i915/gvt: Add GEN9_CLKGATE_DIS_4 to default BXT mmio handler Host prints lots of untracked MMIO at 0x4653c when creating linux guest. "gvt: vgpu 2: untracked MMIO 0004653c len 4" GEN9_CLKGATE_DIS_4 (0x4653c) is accessed by i915 for gmbus clockgating. However vgpu doesn't support any clockgating powergating operations on related mmio access trap so need add it to default handler. GEN9_CLKGATE_DIS_4 is accessed in bxt_gmbus_clock_gating() which only applies to GEN9_LP so doens't show the warning on other platforms. The solution is to add it to default handler init_bxt_mmio_info(). Reviewed-by: He, Min Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit db7c8f1e5f1c1a5e1aaec04e50be6721c1cb4dff Author: Colin Xu Date: Mon Sep 17 12:19:03 2018 +0800 drm/i915/gvt: Init PHY related registers for BXT Recent patch fixed the call trace "ERROR Port B enabled but PHY powered down? (PHY_CTL 00000000)". but introduced another similar call trace shown as: "ERROR Port C enabled but PHY powered down? (PHY_CTL 00000200)". The call trace will appear when host and guest enabled different ports, i.e. host using PORT C or neither PORT is enabled, while guest is always using PORT B as simulated by gvt. The issue is actually covered previously before the commit and reverals now when the commit do the right thing. On BXT, some PHY registers are initialized by vbios, before i915 loaded. Later i915 will re-program some, or skip some based on the implementation. The initialized mmio for guest i915 is done by gvt, based on the snapshot taken from host. If host and guest have different PORT enabled, some DPIO PHY mmios that gvt initialized for guest i915 will not match the simualted monitor for guest, which leads to guest i915 print the calltrace when it's trying to enable PHY and PORT. The solution is to init these DPIO PHY registers to default value, then guest i915 will program them to reasonable value based on the default powerwell table and enabled PORT. Together with the old patch, all similar call trace in guest kernel on BXT can be resolved. v2: Move PHY register init to intel_vgpu_reset_mmio (Min) v3: Do not delete empty line in issue fix patch. (zhenyu) Fixes: c8ab5ac30ccc ("drm/i915/gvt: Make correct handling to vreg BXT_PHY_CTL_FAMILY") Reviewed-by: He, Min Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 922005c7f50e7f4b2a6dbc182e9c575b4f92396b Author: Bjørn Mork Date: Mon Sep 17 22:00:24 2018 +0200 qmi_wwan: set DTR for modems in forced USB2 mode Recent firmware revisions have added the ability to force these modems to USB2 mode, hiding their SuperSpeed capabilities from the host. The driver has been using the SuperSpeed capability, as shown by the bcdUSB field of the device descriptor, to detect the need to enable the DTR quirk. This method fails when the modems are forced to USB2 mode by the modem firmware. Fix by unconditionally enabling the DTR quirk for the affected device IDs. Reported-by: Fred Veldini Reported-by: Deshu Wen Signed-off-by: Bjørn Mork Reported-by: Fred Veldini Reported-by: Deshu Wen Signed-off-by: Bjørn Mork Signed-off-by: David S. Miller commit 89bfd48d679ed4f2ce4cbd9a8f8cbcd041c9050c Merge: 0866cd15029b 648e921888ad Author: David S. Miller Date: Mon Sep 17 18:47:58 2018 -0700 Merge branch 'r8169-clk-fixes' Hans de Goede says: ==================== r8169 (x86) clk fixes to fix S0ix not being reached This series adds code to the r8169 ethernet driver to get and enable an external clock if present, avoiding the need for a hack in the clk-pmc-atom driver where that clock was left on continuesly causing x86 some devices to not reach deep power saving states (S0ix) when suspended causing to them to quickly drain their battery while suspended. The 3 commits in this series need to be merged in order to avoid regressions while bisecting. The clk-pmc-atom driver does not see much changes (it was last touched over a year ago). So the clk maintainers have agreed with merging all 3 patches through the net tree. All 3 patches have Stephen Boyd's Acked-by for this purpose. This v2 of the series only had some minor tweaks done to the commit messages and is ready for merging through the net tree now. ==================== Signed-off-by: David S. Miller commit 648e921888ad96ea3dc922739e96716ad3225d7f Author: Hans de Goede Date: Wed Sep 12 11:34:56 2018 +0200 clk: x86: Stop marking clocks as CLK_IS_CRITICAL Commit d31fd43c0f9a ("clk: x86: Do not gate clocks enabled by the firmware"), which added the code to mark clocks as CLK_IS_CRITICAL, causes all unclaimed PMC clocks on Cherry Trail devices to be on all the time, resulting on the device not being able to reach S0i3 when suspended. The reason for this commit is that on some Bay Trail / Cherry Trail devices the r8169 ethernet controller uses pmc_plt_clk_4. Now that the clk-pmc-atom driver exports an "ether_clk" alias for pmc_plt_clk_4 and the r8169 driver has been modified to get and enable this clock (if present) the marking of the clocks as CLK_IS_CRITICAL is no longer necessary. This commit removes the CLK_IS_CRITICAL marking, fixing Cherry Trail devices not being able to reach S0i3 greatly decreasing their battery drain when suspended. Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=193891#c102 Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=196861 Cc: Johannes Stezenbach Cc: Carlo Caione Reported-by: Johannes Stezenbach Reviewed-by: Andy Shevchenko Acked-by: Stephen Boyd Signed-off-by: Hans de Goede Signed-off-by: David S. Miller commit c2f6f3ee7f22521fabc3295f51149bc3f4dd9202 Author: Hans de Goede Date: Wed Sep 12 11:34:55 2018 +0200 r8169: Get and enable optional ether_clk clock On some boards a platform clock is used as clock for the r8169 chip, this commit adds support for getting and enabling this clock (assuming it has an "ether_clk" alias set on it). This is related to commit d31fd43c0f9a ("clk: x86: Do not gate clocks enabled by the firmware") which is a previous attempt to fix this for some x86 boards, but this causes all Cherry Trail SoC using boards to not reach there lowest power states when suspending. This commit (together with an atom-pmc-clk driver commit adding the alias) fixes things properly by making the r8169 get the clock and enable it when it needs it. Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=193891#c102 Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=196861 Cc: Johannes Stezenbach Cc: Carlo Caione Reported-by: Johannes Stezenbach Acked-by: Stephen Boyd Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: David S. Miller commit b1e3454d39f992e5409cd19f97782185950df6e7 Author: Hans de Goede Date: Wed Sep 12 11:34:54 2018 +0200 clk: x86: add "ether_clk" alias for Bay Trail / Cherry Trail Commit d31fd43c0f9a ("clk: x86: Do not gate clocks enabled by the firmware") causes all unclaimed PMC clocks on Cherry Trail devices to be on all the time, resulting on the device not being able to reach S0i2 or S0i3 when suspended. The reason for this commit is that on some Bay Trail / Cherry Trail devices the ethernet controller uses pmc_plt_clk_4. This commit adds an "ether_clk" alias, so that the relevant ethernet drivers can try to (optionally) use this, without needing X86 specific code / hacks, thus fixing ethernet on these devices without breaking S0i3 support. This commit uses clkdev_hw_create() to create the alias, mirroring the code for the already existing "mclk" alias for pmc_plt_clk_3. Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=193891#c102 Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=196861 Cc: Johannes Stezenbach Cc: Carlo Caione Reported-by: Johannes Stezenbach Acked-by: Stephen Boyd Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: David S. Miller commit 0866cd15029baa3331ba347794053472306e8eb3 Author: Kai-Heng Feng Date: Wed Sep 12 14:58:21 2018 +0800 r8169: enable ASPM on RTL8106E The Intel SoC was prevented from entering lower idle state because of RTL8106E's ASPM was not enabled. So enable ASPM on RTL8106E (chip version 39). Now the Intel SoC can enter lower idle state, power consumption and temperature are much lower. Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit 94235460f9eaefc4f0a3a4a6014fb4c6db4241cc Author: Kai-Heng Feng Date: Wed Sep 12 14:58:20 2018 +0800 r8169: Align ASPM/CLKREQ setting function with vendor driver There's a small delay after setting ASPM in vendor drivers, r8101 and r8168. In addition, those drivers enable ASPM before ClkReq, also change that to align with vendor driver. I haven't seen anything bad becasue of this, but I think it's better to keep in sync with vendor driver. Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit 3275b4df3c39f97ee3fe982c9bafd6f3b7ff0dfe Author: David S. Miller Date: Mon Sep 17 18:43:42 2018 -0700 Revert "kcm: remove any offset before parsing messages" This reverts commit 072222b488bc55cce92ff246bdc10115fd57d3ab. I just read that this causes regressions. Signed-off-by: David S. Miller commit 072222b488bc55cce92ff246bdc10115fd57d3ab Author: Dominique Martinet Date: Tue Sep 11 11:21:43 2018 +0200 kcm: remove any offset before parsing messages The current code assumes kcm users know they need to look for the strparser offset within their bpf program, which is not documented anywhere and examples laying around do not do. The actual recv function does handle the offset well, so we can create a temporary clone of the skb and pull that one up as required for parsing. The pull itself has a cost if we are pulling beyond the head data, measured to 2-3% latency in a noisy VM with a local client stressing that path. The clone's impact seemed too small to measure. This bug can be exhibited easily by implementing a "trivial" kcm parser taking the first bytes as size, and on the client sending at least two such packets in a single write(). Note that bpf sockmap has the same problem, both for parse and for recv, so it would pulling twice or a real pull within the strparser logic if anyone cares about that. Signed-off-by: Dominique Martinet Signed-off-by: David S. Miller commit 3c499ea0c662e2f38aafbd4f516b08aab8cfa0e5 Author: Lyude Paul Date: Mon Sep 17 13:37:33 2018 -0400 drm/atomic: Use drm_drv_uses_atomic_modeset() for debugfs creation As pointed out by Daniel Vetter, we should be usinng drm_drv_uses_atomic_modeset() for determining whether or not we want to make the debugfs nodes for atomic instead of checking DRIVER_ATOMIC, as the former isn't an accurate representation of whether or not the driver is actually using atomic modesetting internally (even though it might not be exposing atomic capabilities). Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: stable@vger.kernel.org Reviewed-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180917173733.21293-1-lyude@redhat.com commit 83f365554e47997ec68dc4eca3f5dce525cd15c3 Author: Vaibhav Nagarnaik Date: Fri Sep 7 15:31:29 2018 -0700 ring-buffer: Allow for rescheduling when removing pages When reducing ring buffer size, pages are removed by scheduling a work item on each CPU for the corresponding CPU ring buffer. After the pages are removed from ring buffer linked list, the pages are free()d in a tight loop. The loop does not give up CPU until all pages are removed. In a worst case behavior, when lot of pages are to be freed, it can cause system stall. After the pages are removed from the list, the free() can happen while the work is rescheduled. Call cond_resched() in the loop to prevent the system hangup. Link: http://lkml.kernel.org/r/20180907223129.71994-1-vnagarnaik@google.com Cc: stable@vger.kernel.org Fixes: 83f40318dab00 ("ring-buffer: Make removal of ring buffer pages atomic") Reported-by: Jason Behmer Signed-off-by: Vaibhav Nagarnaik Signed-off-by: Steven Rostedt (VMware) commit 8f92e35aff9692028279d3c03e88547df6d15020 Author: Saeed Mahameed Date: Sat Sep 15 00:50:02 2018 -0700 net/mlx5e: TLS, Read capabilities only when it is safe Read TLS caps from the core driver only when TLS is supported, i.e mlx5_accel_is_tls_device returns true. Fixes: 790af90c00d2 ("net/mlx5e: TLS, build TLS netdev from capabilities") Change-Id: I5f21ff4d684901af487e366a7e0cf032b54ee9cf Reported-by: Michal Kubecek Signed-off-by: Saeed Mahameed Reviewed-by: Boris Pismenny Reviewed-by: Tariq Toukan commit 6b359d5550a1ae7a1269c9dc1dd73dfdc4d6fe58 Author: Alaa Hleihel Date: Mon Sep 3 10:38:14 2018 +0300 net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ When modifying hairpin SQ, instead of checking if the next state equals to MLX5_SQC_STATE_RDY, we compare it against the MLX5_RQC_STATE_RDY enum value. The code worked since both of MLX5_RQC_STATE_RDY and MLX5_SQC_STATE_RDY have the same value today. This patch fixes this issue. Fixes: 18e568c390c6 ("net/mlx5: Hairpin pair core object setup") Change-Id: I6758aa7b4bd137966ae28206b70648c5bc223b46 Signed-off-by: Alaa Hleihel Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 250ae0d46d857ed61f3e0abf584901e46bd2c638 Author: Eli Cohen Date: Sun Sep 2 12:01:53 2018 +0300 net/mlx5: Fix read from coherent memory Use accessor function READ_ONCE to read from coherent memory modified by the device and read by the driver. This becomes most important in preemptive kernels where cond_resched implementation does not have the side effect which guaranteed the updated value. Fixes: 269d26f47f6f ("net/mlx5: Reduce command polling interval") Change-Id: Ie6deeb565ffaf76777b07448c7fbcce3510bbb8a Signed-off-by: Eli Cohen Reported-by: Jesper Dangaard Brouer Signed-off-by: Saeed Mahameed commit 3918c21eacb06e3d9d43f718354cbce6703f4812 Merge: ad3273d5f1b9 5223c9c1cbfc Author: Greg Kroah-Hartman Date: Mon Sep 17 22:34:25 2018 +0200 Merge tag 'spi-fix-v4.19-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Mark writes: "spi: Fixes for v4.19 As well as one driver fix there's a couple of fixes here which address issues with the use of IDRs for allocation of dynamic bus numbers, ensuring that dynamic bus numbers interact well with static bus numbers assigned via DT and otherwise." * tag 'spi-fix-v4.19-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-fsl-dspi: fix broken DSPI_EOQ_MODE spi: Fix double IDR allocation with DT aliases spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers commit 324493fba77500592bbaa66421729421f139d4b5 Author: Randy Dunlap Date: Tue Aug 14 12:02:31 2018 -0400 media: platform: fix cros-ec-cec build error Fix build when MFD_CROS_EC is not enabled but COMPILE_TEST=y. Fixes this build error: ERROR: "cros_ec_cmd_xfer_status" [drivers/media/platform/cros-ec-cec/cros-ec-cec.ko] undefined! Signed-off-by: Randy Dunlap Cc: Neil Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2ea15030c3f0554db695f85e4760da8621c183d3 Author: Wolfram Sang Date: Tue Sep 11 15:06:26 2018 +0200 mmc: sdhi: sys_dmac: check for all Gen3 types when whitelisting Fixes: 26eb2607fa28 ("mmc: renesas_sdhi: add eMMC HS400 mode support") Signed-off-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit 196f4eeeb78f53e0a598db8f9408b6f8b270c355 Merge: c3b55e2ec9c7 75383f8d39d4 Author: Takashi Iwai Date: Mon Sep 17 18:59:21 2018 +0200 Merge tag 'asoc-v4.19-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v4.19 This is the usual set of small fixes scatterd around various drivers, plus one fix for DAPM and a UAPI build fix. There's not a huge amount that stands out here relative to anything else. commit 013ad043906b2befd4a9bfb06219ed9fedd92716 Author: Mike Snitzer Date: Thu Sep 13 21:16:20 2018 -0400 dm thin metadata: fix __udivdi3 undefined on 32-bit sector_div() is only viable for use with sector_t. dm_block_t is typedef'd to uint64_t -- so use div_u64() instead. Fixes: 3ab918281 ("dm thin metadata: try to avoid ever aborting transactions") Signed-off-by: Mike Snitzer commit c73480910e9686a5c25155cb4d418d594b678196 Author: zhong jiang Date: Mon Sep 17 18:44:19 2018 +0800 net: ethernet: Fix a unused function warning. Fix the following compile warning: drivers/net/ethernet/microchip/lan743x_main.c:2964:12: warning: ‘lan743x_pm_suspend’ defined but not used [-Wunused-function] static int lan743x_pm_suspend(struct device *dev) drivers/net/ethernet/microchip/lan743x_main.c:2987:12: warning: ‘lan743x_pm_resume’ defined but not used [-Wunused-function] static int lan743x_pm_resume(struct device *dev) Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit ddca24dfcf1bec608668dd44c45d49397b70f520 Author: Andrew Lunn Date: Fri Sep 14 23:46:12 2018 +0200 net: dsa: mv88e6xxx: Fix ATU Miss Violation Fix a cut/paste error and a typo which results in ATU miss violations not being reported. Fixes: 0977644c5005 ("net: dsa: mv88e6xxx: Decode ATU problem interrupt") Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 50c6b58a814d86a93c0f6964570f839632854044 Author: Daniel Borkmann Date: Fri Sep 14 23:00:55 2018 +0200 tls: fix currently broken MSG_PEEK behavior In kTLS MSG_PEEK behavior is currently failing, strace example: [pid 2430] socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3 [pid 2430] socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 4 [pid 2430] bind(4, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 [pid 2430] listen(4, 10) = 0 [pid 2430] getsockname(4, {sa_family=AF_INET, sin_port=htons(38855), sin_addr=inet_addr("0.0.0.0")}, [16]) = 0 [pid 2430] connect(3, {sa_family=AF_INET, sin_port=htons(38855), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 [pid 2430] setsockopt(3, SOL_TCP, 0x1f /* TCP_??? */, [7564404], 4) = 0 [pid 2430] setsockopt(3, 0x11a /* SOL_?? */, 1, "\3\0033\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 0 [pid 2430] accept(4, {sa_family=AF_INET, sin_port=htons(49636), sin_addr=inet_addr("127.0.0.1")}, [16]) = 5 [pid 2430] setsockopt(5, SOL_TCP, 0x1f /* TCP_??? */, [7564404], 4) = 0 [pid 2430] setsockopt(5, 0x11a /* SOL_?? */, 2, "\3\0033\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 0 [pid 2430] close(4) = 0 [pid 2430] sendto(3, "test_read_peek", 14, 0, NULL, 0) = 14 [pid 2430] sendto(3, "_mult_recs\0", 11, 0, NULL, 0) = 11 [pid 2430] recvfrom(5, "test_read_peektest_read_peektest"..., 64, MSG_PEEK, NULL, NULL) = 64 As can be seen from strace, there are two TLS records sent, i) 'test_read_peek' and ii) '_mult_recs\0' where we end up peeking 'test_read_peektest_read_peektest'. This is clearly wrong, and what happens is that given peek cannot call into tls_sw_advance_skb() to unpause strparser and proceed with the next skb, we end up looping over the current one, copying the 'test_read_peek' over and over into the user provided buffer. Here, we can only peek into the currently held skb (current, full TLS record) as otherwise we would end up having to hold all the original skb(s) (depending on the peek depth) in a separate queue when unpausing strparser to process next records, minimally intrusive is to return only up to the current record's size (which likely was what c46234ebb4d1 ("tls: RX path for ktls") originally intended as well). Thus, after patch we properly peek the first record: [pid 2046] wait4(2075, [pid 2075] socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3 [pid 2075] socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 4 [pid 2075] bind(4, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 [pid 2075] listen(4, 10) = 0 [pid 2075] getsockname(4, {sa_family=AF_INET, sin_port=htons(55115), sin_addr=inet_addr("0.0.0.0")}, [16]) = 0 [pid 2075] connect(3, {sa_family=AF_INET, sin_port=htons(55115), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 [pid 2075] setsockopt(3, SOL_TCP, 0x1f /* TCP_??? */, [7564404], 4) = 0 [pid 2075] setsockopt(3, 0x11a /* SOL_?? */, 1, "\3\0033\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 0 [pid 2075] accept(4, {sa_family=AF_INET, sin_port=htons(45732), sin_addr=inet_addr("127.0.0.1")}, [16]) = 5 [pid 2075] setsockopt(5, SOL_TCP, 0x1f /* TCP_??? */, [7564404], 4) = 0 [pid 2075] setsockopt(5, 0x11a /* SOL_?? */, 2, "\3\0033\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 0 [pid 2075] close(4) = 0 [pid 2075] sendto(3, "test_read_peek", 14, 0, NULL, 0) = 14 [pid 2075] sendto(3, "_mult_recs\0", 11, 0, NULL, 0) = 11 [pid 2075] recvfrom(5, "test_read_peek", 64, MSG_PEEK, NULL, NULL) = 14 Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Daniel Borkmann Signed-off-by: David S. Miller commit aa079bd05032bc068c28fc9111d952d67134b395 Merge: 28ea334bd165 00d7ddba1143 Author: David S. Miller Date: Mon Sep 17 07:59:41 2018 -0700 Merge branch 'hv_netvsc-associate-VF-and-PV-device-by-serial-number' Stephen Hemminger says: ==================== hv_netvsc: associate VF and PV device by serial number The Hyper-V implementation of PCI controller has concept of 32 bit serial number (not to be confused with PCI-E serial number). This value is sent in the protocol from the host to indicate SR-IOV VF device is attached to a synthetic NIC. Using the serial number (instead of MAC address) to associate the two devices avoids lots of potential problems when there are duplicate MAC addresses from tunnels or layered devices. The patch set is broken into two parts, one is for the PCI controller and the other is for the netvsc device. Normally, these go through different trees but sending them together here for better review. The PCI changes were submitted previously, but the main review comment was "why do you need this?". This is why. v2 - slot name can be shorter. remove locking when creating pci_slots; see comment for explaination ==================== Signed-off-by: David S. Miller commit 00d7ddba1143623b31bc2c15d18216e2da031b14 Author: Stephen Hemminger Date: Fri Sep 14 12:54:57 2018 -0700 hv_netvsc: pair VF based on serial number Matching network device based on MAC address is problematic since a non VF network device can be creted with a duplicate MAC address causing confusion and problems. The VMBus API does provide a serial number that is a better matching method. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit a15f2c08c70811f120d99288d81f70d7f3d104f1 Author: Stephen Hemminger Date: Fri Sep 14 12:54:56 2018 -0700 PCI: hv: support reporting serial number as slot information The Hyper-V host API for PCI provides a unique "serial number" which can be used as basis for sysfs PCI slot table. This can be useful for cases where userspace wants to find the PCI device based on serial number. When an SR-IOV NIC is added, the host sends an attach message with serial number. The kernel doesn't use the serial number, but it is useful when doing the same thing in a userspace driver such as the DPDK. By having /sys/bus/pci/slots/N it provides a direct way to find the matching PCI device. There maybe some cases where serial number is not unique such as when using GPU's. But the PCI slot infrastructure will handle that. This has a side effect which may also be useful. The common udev network device naming policy uses the slot information (rather than PCI address). Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 28ea334bd1657f3c43485b4a8592672fc6835fac Author: Michael Chan Date: Fri Sep 14 15:41:29 2018 -0400 bnxt_en: Fix VF mac address regression. The recent commit to always forward the VF MAC address to the PF for approval may not work if the PF driver or the firmware is older. This will cause the VF driver to fail during probe: bnxt_en 0000:00:03.0 (unnamed net_device) (uninitialized): hwrm req_type 0xf seq id 0x5 error 0xffff bnxt_en 0000:00:03.0 (unnamed net_device) (uninitialized): VF MAC address 00:00:17:02:05:d0 not approved by the PF bnxt_en 0000:00:03.0: Unable to initialize mac address. bnxt_en: probe of 0000:00:03.0 failed with error -99 We fix it by treating the error as fatal only if the VF MAC address is locally generated by the VF. Fixes: 707e7e966026 ("bnxt_en: Always forward VF MAC address to the PF.") Reported-by: Seth Forshee Reported-by: Siwei Liu Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit bbd6528d28c1b8e80832b3b018ec402b6f5c3215 Author: Eric Dumazet Date: Fri Sep 14 12:02:31 2018 -0700 ipv6: fix possible use-after-free in ip6_xmit() In the unlikely case ip6_xmit() has to call skb_realloc_headroom(), we need to call skb_set_owner_w() before consuming original skb, otherwise we risk a use-after-free. Bring IPv6 in line with what we do in IPv4 to fix this. Fixes: 1da177e4c3f41 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit a7f38002fb69b44f8fc622ecb838665d0b8666af Author: Colin Ian King Date: Fri Sep 14 17:39:53 2018 +0100 net: hp100: fix always-true check for link up state The operation ~(p100_inb(VG_LAN_CFG_1) & HP100_LINK_UP) returns a value that is always non-zero and hence the wait for the link to drop always terminates prematurely. Fix this by using a logical not operator instead of a bitwise complement. This issue has been in the driver since pre-2.6.12-rc2. Detected by CoverityScan, CID#114157 ("Logical vs. bitwise operator") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 321cc359d899a8e988f3725d87c18a628e1cc624 Author: Nicolas Ferre Date: Fri Sep 14 17:48:11 2018 +0200 ARM: dts: at91: add new compatibility string for macb on sama5d3 We need this new compatibility string as we experienced different behavior for this 10/100Mbits/s macb interface on this particular SoC. Backward compatibility is preserved as we keep the alternative strings. Signed-off-by: Nicolas Ferre Signed-off-by: David S. Miller commit eb4ed8e2d7fecb5f40db38e4498b9ee23cddf196 Author: Nicolas Ferre Date: Fri Sep 14 17:48:10 2018 +0200 net: macb: disable scatter-gather for macb on sama5d3 Create a new configuration for the sama5d3-macb new compatibility string. This configuration disables scatter-gather because we experienced lock down of the macb interface of this particular SoC under very high load. Signed-off-by: Nicolas Ferre Signed-off-by: David S. Miller commit 41948ccb4a856dddacfbd4d789d4fa8663fe41bb Author: Antoine Tenart Date: Fri Sep 14 16:56:35 2018 +0200 net: mvpp2: let phylink manage the carrier state Net drivers using phylink shouldn't mess with the link carrier themselves and should let phylink manage it. The mvpp2 driver wasn't following this best practice as the mac_config() function made calls to change the link carrier state. This led to wrongly reported carrier link state which then triggered other issues. This patch fixes this behaviour. But the PPv2 driver relied on this misbehaviour in two cases: for fixed links and when not using phylink (ACPI mode). The later was fixed by adding an explicit call to link_up(), which when the ACPI mode will use phylink should be removed. The fixed link case was relying on the mac_config() function to set the link up, as we found an issue in phylink_start() which assumes the carrier is off. If not, the link_up() function is never called. To fix this, a call to netif_carrier_off() is added just before phylink_start() so that we do not introduce a regression in the driver. Fixes: 4bb043262878 ("net: mvpp2: phylink support") Reported-by: Russell King Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller commit 8540827ebac6b654ab2f69c8fbce9e4fbd6304a0 Author: Guillaume Nault Date: Fri Sep 14 16:28:05 2018 +0200 pppoe: fix reception of frames with no mac header pppoe_rcv() needs to look back at the Ethernet header in order to lookup the PPPoE session. Therefore we need to ensure that the mac header is big enough to contain an Ethernet header. Otherwise eth_hdr(skb)->h_source might access invalid data. ================================================================== BUG: KMSAN: uninit-value in __get_item drivers/net/ppp/pppoe.c:172 [inline] BUG: KMSAN: uninit-value in get_item drivers/net/ppp/pppoe.c:236 [inline] BUG: KMSAN: uninit-value in pppoe_rcv+0xcef/0x10e0 drivers/net/ppp/pppoe.c:450 CPU: 0 PID: 4543 Comm: syz-executor355 Not tainted 4.16.0+ #87 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x185/0x1d0 lib/dump_stack.c:53 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:683 __get_item drivers/net/ppp/pppoe.c:172 [inline] get_item drivers/net/ppp/pppoe.c:236 [inline] pppoe_rcv+0xcef/0x10e0 drivers/net/ppp/pppoe.c:450 __netif_receive_skb_core+0x47df/0x4a90 net/core/dev.c:4562 __netif_receive_skb net/core/dev.c:4627 [inline] netif_receive_skb_internal+0x49d/0x630 net/core/dev.c:4701 netif_receive_skb+0x230/0x240 net/core/dev.c:4725 tun_rx_batched drivers/net/tun.c:1555 [inline] tun_get_user+0x740f/0x7c60 drivers/net/tun.c:1962 tun_chr_write_iter+0x1d4/0x330 drivers/net/tun.c:1990 call_write_iter include/linux/fs.h:1782 [inline] new_sync_write fs/read_write.c:469 [inline] __vfs_write+0x7fb/0x9f0 fs/read_write.c:482 vfs_write+0x463/0x8d0 fs/read_write.c:544 SYSC_write+0x172/0x360 fs/read_write.c:589 SyS_write+0x55/0x80 fs/read_write.c:581 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 RIP: 0033:0x4447c9 RSP: 002b:00007fff64c8fc28 EFLAGS: 00000297 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004447c9 RDX: 000000000000fd87 RSI: 0000000020000600 RDI: 0000000000000004 RBP: 00000000006cf018 R08: 00007fff64c8fda8 R09: 00007fff00006bda R10: 0000000000005fe7 R11: 0000000000000297 R12: 00000000004020d0 R13: 0000000000402160 R14: 0000000000000000 R15: 0000000000000000 Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline] kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321 slab_post_alloc_hook mm/slab.h:445 [inline] slab_alloc_node mm/slub.c:2737 [inline] __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369 __kmalloc_reserve net/core/skbuff.c:138 [inline] __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206 alloc_skb include/linux/skbuff.h:984 [inline] alloc_skb_with_frags+0x1d4/0xb20 net/core/skbuff.c:5234 sock_alloc_send_pskb+0xb56/0x1190 net/core/sock.c:2085 tun_alloc_skb drivers/net/tun.c:1532 [inline] tun_get_user+0x2242/0x7c60 drivers/net/tun.c:1829 tun_chr_write_iter+0x1d4/0x330 drivers/net/tun.c:1990 call_write_iter include/linux/fs.h:1782 [inline] new_sync_write fs/read_write.c:469 [inline] __vfs_write+0x7fb/0x9f0 fs/read_write.c:482 vfs_write+0x463/0x8d0 fs/read_write.c:544 SYSC_write+0x172/0x360 fs/read_write.c:589 SyS_write+0x55/0x80 fs/read_write.c:581 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 ================================================================== Fixes: 224cf5ad14c0 ("ppp: Move the PPP drivers") Reported-by: syzbot+f5f6080811c849739212@syzkaller.appspotmail.com Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit f025571e96caa95ffc3c1792f762a584893de582 Author: Corentin Labbe Date: Fri Sep 14 11:20:07 2018 +0000 net: ethernet: ti: add missing GENERIC_ALLOCATOR dependency This patch mades TI_DAVINCI_CPDMA select GENERIC_ALLOCATOR. without that, the following sparc64 build failure happen drivers/net/ethernet/ti/davinci_cpdma.o: In function `cpdma_check_free_tx_desc': (.text+0x278): undefined reference to `gen_pool_avail' drivers/net/ethernet/ti/davinci_cpdma.o: In function `cpdma_chan_submit': (.text+0x340): undefined reference to `gen_pool_alloc' (.text+0x5c4): undefined reference to `gen_pool_free' drivers/net/ethernet/ti/davinci_cpdma.o: In function `__cpdma_chan_free': davinci_cpdma.c:(.text+0x64c): undefined reference to `gen_pool_free' drivers/net/ethernet/ti/davinci_cpdma.o: In function `cpdma_desc_pool_destroy.isra.6': davinci_cpdma.c:(.text+0x17ac): undefined reference to `gen_pool_size' davinci_cpdma.c:(.text+0x17b8): undefined reference to `gen_pool_avail' davinci_cpdma.c:(.text+0x1824): undefined reference to `gen_pool_size' davinci_cpdma.c:(.text+0x1830): undefined reference to `gen_pool_avail' drivers/net/ethernet/ti/davinci_cpdma.o: In function `cpdma_ctlr_create': (.text+0x19f8): undefined reference to `devm_gen_pool_create' (.text+0x1a90): undefined reference to `gen_pool_add_virt' Makefile:1011: recipe for target 'vmlinux' failed Signed-off-by: Corentin Labbe Signed-off-by: David S. Miller commit 85516a9881a31e2c7a8d10f4697f3adcccc7cef1 Author: Miquel Raynal Date: Fri Sep 7 16:35:54 2018 +0200 mtd: partitions: fix unbalanced of_node_get/put() While at first mtd_part_of_parse() would just call of_get_chil_by_name(), it has been patched to deal with sub-partitions and will now directly manipulate the node returned by mtd_get_of_node() if the MTD device is a partition. A of_node_put() was a bit below in the code, to balance the of_get_child_by_name(). However, despite its name, mtd_get_of_node() does not take a reference on the OF node. It is a simple helper hiding some pointer logic to retrieve the OF node related to an MTD device. The direct effect of such unbalanced reference counting is visible by rmmod'ing any module that would have added MTD partitions: OF: ERROR: Bad of_node_put() on As it seems normal to get a reference on the OF node during the of_property_for_each_string() that follows, add a call to of_node_get() when relevant. Fixes: 76a832254ab0 ("mtd: partitions: use DT info for parsing partitions with "compatible" prop") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Signed-off-by: Boris Brezillon commit 3341ba9f0f2637a51738ef5de5114e13a1cd3eca Author: Stanislaw Gruszka Date: Mon Sep 3 12:26:21 2018 +0200 mt76x0: fix remove_interface We wrongly use wcid_mask instead of vif_mask. This creates problems when the interface is removed more than 8 times, for example with iw: iw dev interface add type iw dev del This caused 'ifconfig up' to fail with error: SIOCSIFFLAGS: No space left on device Fixes: 95e444098a7b ("mt76x0: main file") Reported-and-tested-by: Sid Hayn Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit be1277f5eb17a2e5788139eabb0b53dd04c695f3 Author: Hannes Reinecke Date: Mon Jul 16 12:58:33 2018 +0200 nvme: count all ANA groups for ANA Log page When issuing a short read on the ANA log page the number of groups should not change, even though the final returned data might contain less groups than that number. Signed-off-by: Hannes Reinecke [switched to a for loop] Signed-off-by: Christoph Hellwig commit 55066354285b36ee09dc50e2527f43a97c567177 Author: Guenter Roeck Date: Mon Sep 17 05:23:58 2018 -0700 hwmon: (nct6775) Use different register to get fan RPM for fan7 The documented register to retrieve the fan RPM for fan7 is found to be unreliable at least with NCT6796D revision 3. Let's use register 0x4ce instead. This is undocumented for NCT6796D, but documented for NCT6797D and NCT6798D and known to be working. Reported-by: Robert Kern Cc: Robert Kern Fixes: 81820059a428 ("hwmon: (nct6775) Add support for NCT6796D") Signed-off-by: Guenter Roeck commit c3b55e2ec9c76e7a0de2a0b1dc851fdc9440385b Author: Takashi Sakamoto Date: Mon Sep 17 17:26:41 2018 +0900 ALSA: fireworks: fix memory leak of response buffer at error path After allocating memory object for response buffer, ALSA fireworks driver has leak of the memory object at error path. This commit releases the object at the error path. Fixes: 7d3c1d5901aa('ALSA: fireworks: delayed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 1064bc685d359f549f91c2d5f111965a9284f328 Author: Takashi Sakamoto Date: Mon Sep 17 17:26:20 2018 +0900 ALSA: oxfw: fix memory leak of discovered stream formats at error path After finishing discover of stream formats, ALSA OXFW driver has memory leak of allocated memory object at error path. This commit releases the memory object at the error path. Fixes: 6c29230e2a5f ('ALSA: oxfw: delayed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit ce925f088b979537f22f9e05eb923ef9822ca139 Author: Takashi Sakamoto Date: Mon Sep 17 17:26:08 2018 +0900 ALSA: oxfw: fix memory leak for model-dependent data at error path After allocating model-dependent data, ALSA OXFW driver has memory leak of the data at error path. This commit releases the data at the error path. Fixes: 6c29230e2a5f ('ALSA: oxfw: delayed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit b1fbebd4164b3d170ad916dcd692cf843c9c065d Author: Takashi Sakamoto Date: Mon Sep 17 17:25:24 2018 +0900 ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at error path After allocating model-dependent data for M-Audio FW1814 and ProjectMix I/O, ALSA bebob driver has memory leak at error path. This commit releases the allocated data at the error path. Fixes: 04a2c73c97eb('ALSA: bebob: delayed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit ad3273d5f1b99d7319a986ab568dcbde2f9e53dd Merge: c0747ad363ff cce6c9f7e602 Author: Greg Kroah-Hartman Date: Mon Sep 17 09:13:47 2018 +0200 Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Ted writes: Various ext4 bug fixes; primarily making ext4 more robust against maliciously crafted file systems, and some DAX fixes. * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4, dax: set ext4_dax_aops for dax files ext4, dax: add ext4_bmap to ext4_dax_aops ext4: don't mark mmp buffer head dirty ext4: show test_dummy_encryption mount option in /proc/mounts ext4: close race between direct IO and ext4_break_layouts() ext4: fix online resizing for bigalloc file systems with a 1k block size ext4: fix online resize's handling of a too-small final block group ext4: recalucate superblock checksum after updating free blocks/inodes ext4: avoid arithemetic overflow that can trigger a BUG ext4: avoid divide by zero fault when deleting corrupted inline directories ext4: check to make sure the rename(2)'s destination is not freed ext4: add nonstring annotations to ext4.h commit 83e32a5910772e1475d3640a429b7686695f04d1 Author: Xuewei Zhang Date: Thu Sep 6 13:37:19 2018 -0700 scsi: sd: Contribute to randomness when running rotational device Currently a scsi device won't contribute to kernel randomness when it uses blk-mq. Since we commonly use scsi on rotational device with blk-mq, it make sense to keep contributing to kernel randomness in these cases. This is especially important for virtual machines. commit b5b6e8c8d3b4 ("scsi: virtio_scsi: fix IO hang caused by automatic irq vector affinity") made all virtio-scsi device to use blk-mq, which does not contribute to randomness today. So for a virtual machine only having virtio-scsi disk (which is common), it will simple stop getting randomness from its disks in today's implementation. With this patch, if the above VM has rotational virtio-scsi device, then it can still benefit from the entropy generated from the disk. Reported-by: Xuewei Zhang Signed-off-by: Xuewei Zhang Reviewed-by: Ming Lei Reviewed-by: Maciej Żenczykowski Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit adad633af7b970bfa5dd1b624a4afc83cac9b235 Author: Laura Abbott Date: Tue Sep 11 12:22:26 2018 -0700 scsi: ibmvscsis: Ensure partition name is properly NUL terminated While reviewing another part of the code, Kees noticed that the strncpy of the partition name might not always be NUL terminated. Switch to using strscpy which does this safely. Reported-by: Kees Cook Signed-off-by: Laura Abbott Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit d792d4c4fc866ae224b0b0ca2aabd87d23b4d6cc Author: Laura Abbott Date: Tue Sep 11 12:22:25 2018 -0700 scsi: ibmvscsis: Fix a stringop-overflow warning There's currently a warning about string overflow with strncat: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_probe': drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:3479:2: error: 'strncat' specified bound 64 equals destination size [-Werror=stringop-overflow=] strncat(vscsi->eye, vdev->name, MAX_EYE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Switch to a single snprintf instead of a strcpy + strcat to handle this cleanly. Signed-off-by: Laura Abbott Suggested-by: Kees Cook Signed-off-by: Martin K. Petersen commit f14040bca89258b8a1c71e2112e430462172ce93 Author: Michael Neuling Date: Thu Sep 13 15:33:47 2018 +1000 KVM: PPC: Book3S HV: Fix guest r11 corruption with POWER9 TM workarounds When we come into the softpatch handler (0x1500), we use r11 to store the HSRR0 for later use by the denorm handler. We also use the softpatch handler for the TM workarounds for POWER9. Unfortunately, in kvmppc_interrupt_hv we later store r11 out to the vcpu assuming it's still what we got from userspace. This causes r11 to be corrupted in the VCPU and hence when we restore the guest, we get a corrupted r11. We've seen this when running TM tests inside guests on P9. This fixes the problem by only touching r11 in the denorm case. Fixes: 4bb3c7a020 ("KVM: PPC: Book3S HV: Work around transactional memory bugs in POWER9") Cc: # 4.17+ Test-by: Suraj Jitindar Singh Reviewed-by: Paul Mackerras Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman commit c0747ad363fff90c2edf490fc089e3ae0920b410 Merge: 7876320f8880 a987785dcd6c Author: Greg Kroah-Hartman Date: Mon Sep 17 07:24:28 2018 +0200 Merge tag 'linux-kselftest-4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pulled kselftest fixes from Shuah: "This Kselftest fixes update for 4.9-rc5 consists of: -- fixes to build failures -- fixes to add missing config files to increase test coverage -- fixes to cgroup test and a new cgroup test for memory.oom.group" commit 0376d5dce0aa174e5e4cd8b8644a9ea40b9657f9 Merge: 4bf9ffa0fb57 4c3d795cb012 Author: David S. Miller Date: Sun Sep 16 17:47:03 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2018-09-16 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix end boundary calculation in BTF for the type section, from Martin. 2) Fix and revert subtraction of pointers that was accidentally allowed for unprivileged programs, from Alexei. 3) Fix bpf_msg_pull_data() helper by using __GFP_COMP in order to avoid a warning in linearizing sg pages into a single one for large allocs, from Tushar. ==================== Signed-off-by: David S. Miller commit 4bf9ffa0fb5744ed40d7348c24fa9ae398b1d603 Author: Toshiaki Makita Date: Fri Sep 14 13:33:44 2018 +0900 veth: Orphan skb before GRO GRO expects skbs not to be owned by sockets, but when XDP is enabled veth passed skbs owned by sockets. It caused corrupted sk_wmem_alloc. Paolo Abeni reported the following splat: [ 362.098904] refcount_t overflow at skb_set_owner_w+0x5e/0xa0 in iperf3[1644], uid/euid: 0/0 [ 362.108239] WARNING: CPU: 0 PID: 1644 at kernel/panic.c:648 refcount_error_report+0xa0/0xa4 [ 362.117547] Modules linked in: tcp_diag inet_diag veth intel_rapl sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel intel_cstate intel_uncore intel_rapl_perf ipmi_ssif iTCO_wdt sg ipmi_si iTCO_vendor_support ipmi_devintf mxm_wmi ipmi_msghandler pcspkr dcdbas mei_me wmi mei lpc_ich acpi_power_meter pcc_cpufreq xfs libcrc32c sd_mod mgag200 drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ixgbe igb ttm ahci mdio libahci ptp crc32c_intel drm pps_core libata i2c_algo_bit dca dm_mirror dm_region_hash dm_log dm_mod [ 362.176622] CPU: 0 PID: 1644 Comm: iperf3 Not tainted 4.19.0-rc2.vanilla+ #2025 [ 362.184777] Hardware name: Dell Inc. PowerEdge R730/072T6D, BIOS 2.1.7 06/16/2016 [ 362.193124] RIP: 0010:refcount_error_report+0xa0/0xa4 [ 362.198758] Code: 08 00 00 48 8b 95 80 00 00 00 49 8d 8c 24 80 0a 00 00 41 89 c1 44 89 2c 24 48 89 de 48 c7 c7 18 4d e7 9d 31 c0 e8 30 fa ff ff <0f> 0b eb 88 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 41 54 49 89 fc [ 362.219711] RSP: 0018:ffff9ee6ff603c20 EFLAGS: 00010282 [ 362.225538] RAX: 0000000000000000 RBX: ffffffff9de83e10 RCX: 0000000000000000 [ 362.233497] RDX: 0000000000000001 RSI: ffff9ee6ff6167d8 RDI: ffff9ee6ff6167d8 [ 362.241457] RBP: ffff9ee6ff603d78 R08: 0000000000000490 R09: 0000000000000004 [ 362.249416] R10: 0000000000000000 R11: ffff9ee6ff603990 R12: ffff9ee664b94500 [ 362.257377] R13: 0000000000000000 R14: 0000000000000004 R15: ffffffff9de615f9 [ 362.265337] FS: 00007f1d22d28740(0000) GS:ffff9ee6ff600000(0000) knlGS:0000000000000000 [ 362.274363] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 362.280773] CR2: 00007f1d222f35d0 CR3: 0000001fddfec003 CR4: 00000000001606f0 [ 362.288733] Call Trace: [ 362.291459] [ 362.293702] ex_handler_refcount+0x4e/0x80 [ 362.298269] fixup_exception+0x35/0x40 [ 362.302451] do_trap+0x109/0x150 [ 362.306048] do_error_trap+0xd5/0x130 [ 362.315766] invalid_op+0x14/0x20 [ 362.319460] RIP: 0010:skb_set_owner_w+0x5e/0xa0 [ 362.324512] Code: ef ff ff 74 49 48 c7 43 60 20 7b 4a 9d 8b 85 f4 01 00 00 85 c0 75 16 8b 83 e0 00 00 00 f0 01 85 44 01 00 00 0f 88 d8 23 16 00 <5b> 5d c3 80 8b 91 00 00 00 01 8b 85 f4 01 00 00 89 83 a4 00 00 00 [ 362.345465] RSP: 0018:ffff9ee6ff603e20 EFLAGS: 00010a86 [ 362.351291] RAX: 0000000000001100 RBX: ffff9ee65deec700 RCX: ffff9ee65e829244 [ 362.359250] RDX: 0000000000000100 RSI: ffff9ee65e829100 RDI: ffff9ee65deec700 [ 362.367210] RBP: ffff9ee65e829100 R08: 000000000002a380 R09: 0000000000000000 [ 362.375169] R10: 0000000000000002 R11: fffff1a4bf77bb00 R12: ffffc0754661d000 [ 362.383130] R13: ffff9ee65deec200 R14: ffff9ee65f597000 R15: 00000000000000aa [ 362.391092] veth_xdp_rcv+0x4e4/0x890 [veth] [ 362.399357] veth_poll+0x4d/0x17a [veth] [ 362.403731] net_rx_action+0x2af/0x3f0 [ 362.407912] __do_softirq+0xdd/0x29e [ 362.411897] do_softirq_own_stack+0x2a/0x40 [ 362.416561] [ 362.418899] do_softirq+0x4b/0x70 [ 362.422594] __local_bh_enable_ip+0x50/0x60 [ 362.427258] ip_finish_output2+0x16a/0x390 [ 362.431824] ip_output+0x71/0xe0 [ 362.440670] __tcp_transmit_skb+0x583/0xab0 [ 362.445333] tcp_write_xmit+0x247/0xfb0 [ 362.449609] __tcp_push_pending_frames+0x2d/0xd0 [ 362.454760] tcp_sendmsg_locked+0x857/0xd30 [ 362.459424] tcp_sendmsg+0x27/0x40 [ 362.463216] sock_sendmsg+0x36/0x50 [ 362.467104] sock_write_iter+0x87/0x100 [ 362.471382] __vfs_write+0x112/0x1a0 [ 362.475369] vfs_write+0xad/0x1a0 [ 362.479062] ksys_write+0x52/0xc0 [ 362.482759] do_syscall_64+0x5b/0x180 [ 362.486841] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 362.492473] RIP: 0033:0x7f1d22293238 [ 362.496458] Code: 89 02 48 c7 c0 ff ff ff ff eb b3 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 c5 54 2d 00 8b 00 85 c0 75 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 41 54 49 89 d4 55 [ 362.517409] RSP: 002b:00007ffebaef8008 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 362.525855] RAX: ffffffffffffffda RBX: 0000000000002800 RCX: 00007f1d22293238 [ 362.533816] RDX: 0000000000002800 RSI: 00007f1d22d36000 RDI: 0000000000000005 [ 362.541775] RBP: 00007f1d22d36000 R08: 00000002db777a30 R09: 0000562b70712b20 [ 362.549734] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 [ 362.557693] R13: 0000000000002800 R14: 00007ffebaef8060 R15: 0000562b70712260 In order to avoid this, orphan the skb before entering GRO. Fixes: 948d4f214fde ("veth: Add driver XDP") Reported-by: Paolo Abeni Signed-off-by: Toshiaki Makita Tested-by: Paolo Abeni Signed-off-by: David S. Miller commit 978298888e3efb4fd7ff9bf2b9ed6f8de4a1312e Merge: edf2ef724280 eb63f2964dbe Author: David S. Miller Date: Sun Sep 16 15:27:44 2018 -0700 Merge branch 'udp-add-missing-check-on-edumx-rx-path' Paolo Abeni says: ==================== udp: add missing check on edumx rx path The early demux RX path for the UDP protocol is currently missing some checks. Both ipv4 and ipv6 implementations lack checksum conversion and the ipv6 implementation additionally lack the zero checksum validation. The first patch takes care of UDPv4 and the second one of UDPv6 ==================== Signed-off-by: David S. Miller commit eb63f2964dbe36f26deac77d3016791675821ded Author: Paolo Abeni Date: Thu Sep 13 16:27:21 2018 +0200 udp6: add missing checks on edumux packet processing Currently the UDPv6 early demux rx code path lacks some mandatory checks, already implemented into the normal RX code path - namely the checksum conversion and no_check6_rx check. Similar to the previous commit, we move the common processing to an UDPv6 specific helper and call it from both edemux code path and normal code path. In respect to the UDPv4, we need to add an explicit check for non zero csum according to no_check6_rx value. Reported-by: Jianlin Shi Suggested-by: Xin Long Fixes: c9f2c1ae123a ("udp6: fix socket leak on early demux") Fixes: 2abb7cdc0dc8 ("udp: Add support for doing checksum unnecessary conversion") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 2b5a921740a55c00223a797d075b9c77c42cb171 Author: Paolo Abeni Date: Thu Sep 13 16:27:20 2018 +0200 udp4: fix IP_CMSG_CHECKSUM for connected sockets commit 2abb7cdc0dc8 ("udp: Add support for doing checksum unnecessary conversion") left out the early demux path for connected sockets. As a result IP_CMSG_CHECKSUM gives wrong values for such socket when GRO is not enabled/available. This change addresses the issue by moving the csum conversion to a common helper and using such helper in both the default and the early demux rx path. Fixes: 2abb7cdc0dc8 ("udp: Add support for doing checksum unnecessary conversion") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit edf2ef7242805e53ec2e0841db26e06d8bc7da70 Author: Jongsung Kim Date: Thu Sep 13 18:32:21 2018 +0900 stmmac: fix valid numbers of unicast filter entries Synopsys DWC Ethernet MAC can be configured to have 1..32, 64, or 128 unicast filter entries. (Table 7-8 MAC Address Registers from databook) Fix dwmac1000_validate_ucast_entries() to accept values between 1 and 32 in addition. Signed-off-by: Jongsung Kim Signed-off-by: David S. Miller commit 7876320f88802b22d4e2daf7eb027dd14175a0f8 Author: Linus Torvalds Date: Sun Sep 16 11:52:37 2018 -0700 Linux 4.19-rc4 commit 8a104f8b5867c682d994ffa7a74093c54469c11f Author: Greg Kroah-Hartman Date: Sat Sep 15 20:26:44 2018 +0200 Code of Conduct: Let's revamp it. The Code of Conflict is not achieving its implicit goal of fostering civility and the spirit of 'be excellent to each other'. Explicit guidelines have demonstrated success in other projects and other areas of the kernel. Here is a Code of Conduct statement for the wider kernel. It is based on the Contributor Covenant as described at www.contributor-covenant.org From this point forward, we should abide by these rules in order to help make the kernel community a welcoming environment to participate in. Signed-off-by: Chris Mason Signed-off-by: Dan Williams Signed-off-by: Jonathan Corbet Signed-off-by: Olof Johansson Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds commit cce6c9f7e6029caee45c459db5b3e78fec6973cb Author: Toshi Kani Date: Sat Sep 15 21:37:59 2018 -0400 ext4, dax: set ext4_dax_aops for dax files Sync syscall to DAX file needs to flush processor cache, but it currently does not flush to existing DAX files. This is because 'ext4_da_aops' is set to address_space_operations of existing DAX files, instead of 'ext4_dax_aops', since S_DAX flag is set after ext4_set_aops() in the open path. New file -------- lookup_open ext4_create __ext4_new_inode ext4_set_inode_flags // Set S_DAX flag ext4_set_aops // Set aops to ext4_dax_aops Existing file ------------- lookup_open ext4_lookup ext4_iget ext4_set_aops // Set aops to ext4_da_aops ext4_set_inode_flags // Set S_DAX flag Change ext4_iget() to initialize i_flags before ext4_set_aops(). Fixes: 5f0663bb4a64 ("ext4, dax: introduce ext4_dax_aops") Signed-off-by: Toshi Kani Signed-off-by: Theodore Ts'o Suggested-by: Jan Kara Cc: stable@vger.kernel.org commit 94dbb63117e82253c9592816aa4465f0a9c94850 Author: Toshi Kani Date: Sat Sep 15 21:23:41 2018 -0400 ext4, dax: add ext4_bmap to ext4_dax_aops Ext4 mount path calls .bmap to the journal inode. This currently works for the DAX mount case because ext4_iget() always set 'ext4_da_aops' to any regular files. In preparation to fix ext4_iget() to set 'ext4_dax_aops' for ext4 DAX files, add ext4_bmap() to 'ext4_dax_aops', since bmap works for DAX inodes. Fixes: 5f0663bb4a64 ("ext4, dax: introduce ext4_dax_aops") Signed-off-by: Toshi Kani Signed-off-by: Theodore Ts'o Suggested-by: Jan Kara Cc: stable@vger.kernel.org commit f6de298806d9cbc63a4907bca34a06162b9d7dce Author: Guenter Roeck Date: Thu Sep 13 20:01:12 2018 -0700 hwmon: (nct6775) Fix RPM output for fan7 on NCT6796D fan7 on NCT6796D does not have a fan count register; it only has an RPM register. Switch to using RPM registers to read the fan speed for all chips supporting it to solve the problem for good. Reported-by: Robert Kern Cc: Robert Kern Fixes: 81820059a428 ("hwmon: (nct6775) Add support for NCT6796D") Signed-off-by: Guenter Roeck commit fe18d649891d813964d3aaeebad873f281627fbc Author: Li Dongyang Date: Sat Sep 15 17:11:25 2018 -0400 ext4: don't mark mmp buffer head dirty Marking mmp bh dirty before writing it will make writeback pick up mmp block later and submit a write, we don't want the duplicate write as kmmpd thread should have full control of reading and writing the mmp block. Another reason is we will also have random I/O error on the writeback request when blk integrity is enabled, because kmmpd could modify the content of the mmp block(e.g. setting new seq and time) while the mmp block is under I/O requested by writeback. Signed-off-by: Li Dongyang Signed-off-by: Theodore Ts'o Reviewed-by: Andreas Dilger Cc: stable@vger.kernel.org commit 6a1cac56f41f9ea94e440dfcc1cac44b41a1b194 Author: Brijesh Singh Date: Fri Sep 14 08:45:59 2018 -0500 x86/kvm: Use __bss_decrypted attribute in shared variables The recent removal of the memblock dependency from kvmclock caused a SEV guest regression because the wall_clock and hv_clock_boot variables are no longer mapped decrypted when SEV is active. Use the __bss_decrypted attribute to put the static wall_clock and hv_clock_boot in the .bss..decrypted section so that they are mapped decrypted during boot. In the preparatory stage of CPU hotplug, the per-cpu pvclock data pointer assigns either an element of the static array or dynamically allocated memory for the pvclock data pointer. The static array are now mapped decrypted but the dynamically allocated memory is not mapped decrypted. However, when SEV is active this memory range must be mapped decrypted. Add a function which is called after the page allocator is up, and allocate memory for the pvclock data pointers for the all possible cpus. Map this memory range as decrypted when SEV is active. Fixes: 368a540e0232 ("x86/kvmclock: Remove memblock dependency") Suggested-by: Thomas Gleixner Signed-off-by: Brijesh Singh Signed-off-by: Thomas Gleixner Cc: Tom Lendacky Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Paolo Bonzini Cc: Sean Christopherson Cc: "Radim Krčmář" Cc: kvm@vger.kernel.org Link: https://lkml.kernel.org/r/1536932759-12905-3-git-send-email-brijesh.singh@amd.com commit b3f0907c71e006e12fde74ea9a745b6096b6f90f Author: Brijesh Singh Date: Fri Sep 14 08:45:58 2018 -0500 x86/mm: Add .bss..decrypted section to hold shared variables kvmclock defines few static variables which are shared with the hypervisor during the kvmclock initialization. When SEV is active, memory is encrypted with a guest-specific key, and if the guest OS wants to share the memory region with the hypervisor then it must clear the C-bit before sharing it. Currently, we use kernel_physical_mapping_init() to split large pages before clearing the C-bit on shared pages. But it fails when called from the kvmclock initialization (mainly because the memblock allocator is not ready that early during boot). Add a __bss_decrypted section attribute which can be used when defining such shared variable. The so-defined variables will be placed in the .bss..decrypted section. This section will be mapped with C=0 early during boot. The .bss..decrypted section has a big chunk of memory that may be unused when memory encryption is not active, free it when memory encryption is not active. Suggested-by: Thomas Gleixner Signed-off-by: Brijesh Singh Signed-off-by: Thomas Gleixner Cc: Tom Lendacky Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Radim Krčmář Cc: kvm@vger.kernel.org Link: https://lkml.kernel.org/r/1536932759-12905-2-git-send-email-brijesh.singh@amd.com commit 338affb548c243d2af25b1ca628e67819350de6b Author: Eric Biggers Date: Sat Sep 15 14:28:26 2018 -0400 ext4: show test_dummy_encryption mount option in /proc/mounts When in effect, add "test_dummy_encryption" to _ext4_show_options() so that it is shown in /proc/mounts and other relevant procfs files. Signed-off-by: Eric Biggers Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit 27c5a778dfe23d1de8d9ebfbc6a54595a79ac709 Merge: 4314daa55b4d 002b87d2aace Author: Linus Torvalds Date: Sat Sep 15 08:02:46 2018 -1000 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Ingol Molnar: "Misc fixes: - EFI crash fix - Xen PV fixes - do not allow PTI on 2-level 32-bit kernels for now - documentation fix" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/APM: Fix build warning when PROC_FS is not enabled Revert "x86/mm/legacy: Populate the user page-table with user pgd's" x86/efi: Load fixmap GDT in efi_call_phys_epilog() before setting %cr3 x86/xen: Disable CPU0 hotplug for Xen PV x86/EISA: Don't probe EISA bus for Xen PV guests x86/doc: Fix Documentation/x86/earlyprintk.txt commit 4314daa55b4ddc2dc1c28a3835b484de33ffbfdd Merge: c0be92b5b14b 882a78a9f39f Author: Linus Torvalds Date: Sat Sep 15 08:00:37 2018 -1000 Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Ingo Molnar: "Misc fixes: various scheduler metrics corner case fixes, a sched_features deadlock fix, and a topology fix for certain NUMA systems" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Fix kernel-doc notation warning sched/fair: Fix load_balance redo for !imbalance sched/fair: Fix scale_rt_capacity() for SMT sched/fair: Fix vruntime_normalized() for remote non-migration wakeup sched/pelt: Fix update_blocked_averages() for RT and DL classes sched/topology: Set correct NUMA topology type sched/debug: Fix potential deadlock when writing to sched_features commit c0be92b5b14bc6928363527602dabff57875473a Merge: ca062f8df5d1 cb48b6a26cac Author: Linus Torvalds Date: Sat Sep 15 06:44:32 2018 -1000 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Ingo Molnar: "Mostly tooling fixes, but also breakpoint and x86 PMU driver fixes" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) perf tools: Fix maps__find_symbol_by_name() tools headers uapi: Update tools's copy of linux/if_link.h tools headers uapi: Update tools's copy of linux/vhost.h tools headers uapi: Update tools's copies of kvm headers tools headers uapi: Update tools's copy of drm/drm.h tools headers uapi: Update tools's copy of asm-generic/unistd.h tools headers uapi: Update tools's copy of linux/perf_event.h perf/core: Force USER_DS when recording user stack data perf/UAPI: Clearly mark __PERF_SAMPLE_CALLCHAIN_EARLY as internal use perf/x86/intel: Add support/quirk for the MISPREDICT bit on Knights Landing CPUs perf annotate: Fix parsing aarch64 branch instructions after objdump update perf probe powerpc: Ignore SyS symbols irrespective of endianness perf event-parse: Use fixed size string for comms perf util: Fix bad memory access in trace info. perf tools: Streamline bpf examples and headers installation perf evsel: Fix potential null pointer dereference in perf_evsel__new_idx() perf arm64: Fix include path for asm-generic/unistd.h perf/hw_breakpoint: Simplify breakpoint enable in perf_event_modify_breakpoint perf/hw_breakpoint: Enable breakpoint in modify_user_hw_breakpoint perf/hw_breakpoint: Remove superfluous bp->attr.disabled = 0 ... commit ca062f8df5d13e3a5c029449a12c20ac5069c094 Merge: 3a5af36b6d0e 0b405c65ad45 Author: Linus Torvalds Date: Sat Sep 15 06:39:09 2018 -1000 Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fixes from Ingo Molnar: "Misc fixes: liblockdep fixes and ww_mutex fixes" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/ww_mutex: Fix spelling mistake "cylic" -> "cyclic" locking/lockdep: Delete unnecessary #include tools/lib/lockdep: Add dummy task_struct state member tools/lib/lockdep: Add empty nmi.h tools/lib/lockdep: Update Sasha Levin email to MSFT jump_label: Fix typo in warning message locking/mutex: Fix mutex debug call and ww_mutex documentation commit 37196ba4ae95a2077d78715eb12e879e57613d43 Author: Guenter Roeck Date: Thu Sep 13 19:43:58 2018 -0700 hwmon: (nct6775) Fix virtual temperature sources for NCT6796D The following kernel log message is reported for the nct6775 driver on ASUS WS X299 SAGE. nct6775: Found NCT6796D or compatible chip at 0x2e:0x290 nct6775 nct6775.656: Invalid temperature source 11 at index 0, source register 0x100, temp register 0x73 nct6775 nct6775.656: Invalid temperature source 11 at index 2, source register 0x300, temp register 0x77 nct6775 nct6775.656: Invalid temperature source 11 at index 3, source register 0x800, temp register 0x79 nct6775 nct6775.656: Invalid temperature source 11 at index 4, source register 0x900, temp register 0x7b A recent version of the datasheet lists temperature source 11 as reserved. However, an older version of the datasheet lists temperature sources 10 and 11 as supported virtual temperature sources. Apparently the older version of the datasheet is correct, so list those temperature sources as supported. Virtual temperature sources are different than other temperature sources: Values are not read from a temperature sensor, but written either from BIOS or an embedded controller. As such, each virtual temperature has to be reported. Since there is now more than one temperature source, we have to keep virtual temperature sources in a chip-specific mask and can no longer rely on the assumption that there is only one virtual temperature source with a fixed index. This accounts for most of the complexity of this patch. Reported-by: Robert Kern Cc: Robert Kern Fixes: 81820059a428 ("hwmon: (nct6775) Add support for NCT6796D") Signed-off-by: Guenter Roeck commit 002b87d2aace62b4f3841c3aa43309d2380092be Author: Randy Dunlap Date: Fri Sep 14 15:10:29 2018 -0700 x86/APM: Fix build warning when PROC_FS is not enabled Fix build warning in apm_32.c when CONFIG_PROC_FS is not enabled: ../arch/x86/kernel/apm_32.c:1643:12: warning: 'proc_apm_show' defined but not used [-Wunused-function] static int proc_apm_show(struct seq_file *m, void *v) Fixes: 3f3942aca6da ("proc: introduce proc_create_single{,_data}") Signed-off-by: Randy Dunlap Signed-off-by: Thomas Gleixner Reviewed-by: Christoph Hellwig Cc: Jiri Kosina Link: https://lkml.kernel.org/r/be39ac12-44c2-4715-247f-4dcc3c525b8b@infradead.org commit cf51e4b9c34407bf0c3d9b582b7837e047e1df47 Author: Masahiro Yamada Date: Thu Sep 13 14:58:49 2018 +0900 mtd: rawnand: denali: fix a race condition when DMA is kicked I thought the read-back of the DMA_ENABLE register was unnecessary (at least it is working on my boards), then deleted it in commit 586a2c52909d ("mtd: nand: denali: squash denali_enable_dma() helper into caller"). Sorry, I was wrong - it caused a timing issue on Cyclone5 SoCFPGAs. Revive the register read-back, commenting why this is necessary. Fixes: 586a2c52909d ("mtd: nand: denali: squash denali_enable_dma() helper into caller") Cc: Reported-by: Steffen Trumtrar Signed-off-by: Masahiro Yamada Reviewed-by: Miquel Raynal Signed-off-by: Boris Brezillon commit 3a5af36b6d0e4a42ec2a8552ace87edbe2a90ae4 Merge: 589109df3184 097f5863b1a0 Author: Linus Torvalds Date: Fri Sep 14 19:33:42 2018 -1000 Merge tag '4.19-rc3-smb3-cifs' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Fixes for four CIFS/SMB3 potential pointer overflow issues, one minor build fix, and a build warning cleanup" * tag '4.19-rc3-smb3-cifs' of git://git.samba.org/sfrench/cifs-2.6: cifs: read overflow in is_valid_oplock_break() cifs: integer overflow in in SMB2_ioctl() CIFS: fix wrapping bugs in num_entries() cifs: prevent integer overflow in nxt_dir_entry() fs/cifs: require sha512 fs/cifs: suppress a string overflow warning commit 589109df31843384f410ba09f6b8383464408d1e Merge: 5b945fd2c34c 9f0c5124f4a8 Author: Linus Torvalds Date: Fri Sep 14 19:25:28 2018 -1000 Merge tag 'nfs-for-4.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client bugfixes from Anna Schumaker: "These are a handful of fixes for problems that Trond found. Patch #1 and #3 have the same name, a second issue was found after applying the first patch. Stable bugfixes: - v4.17+: Fix tracepoint Oops in initiate_file_draining() - v4.11+: Fix an infinite loop on I/O Other fixes: - Return errors if a waiting layoutget is killed - Don't open code clearing of delegation state" * tag 'nfs-for-4.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs: NFS: Don't open code clearing of delegation state NFSv4.1 fix infinite loop on I/O. NFSv4: Fix a tracepoint Oops in initiate_file_draining() pNFS: Ensure we return the error if someone kills a waiting layoutget NFSv4: Fix a tracepoint Oops in initiate_file_draining() commit 5b945fd2c34c6324752fc793266b4598a307d765 Merge: 090b75bcba62 b1f4ff74fcb0 Author: Linus Torvalds Date: Fri Sep 14 17:31:02 2018 -1000 Merge tag 'trace-v4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fix from Steven Rostedt: "This fixes an issue with the build system caused by a change that modifies CC_FLAGS_FTRACE. The issue is that it breaks the dependencies and causes "make targz-pkg" to rebuild the entire world" * tag 'trace-v4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/Makefile: Fix handling redefinition of CC_FLAGS_FTRACE commit 090b75bcba62e8e0e43c8acdbc230d26c5b731dc Merge: d7c0268090e2 e54192b48da7 Author: Linus Torvalds Date: Fri Sep 14 13:03:17 2018 -1000 Merge tag 'devicetree-fixes-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull DeviceTree fix from Rob Herring: "One regression for a 20 year old PowerMac: - Fix a regression on systems having a DT without any phandles which happens on a PowerMac G3" * tag 'devicetree-fixes-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of: fix phandle cache creation for DTs with no phandles commit d7c0268090e23f3517c7b7555d3f4f9d73580f96 Merge: eae4f8851f35 58a575699040 Author: Linus Torvalds Date: Fri Sep 14 13:01:06 2018 -1000 Merge tag 'for-linus-4.19c-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "This contains some minor cleanups and fixes: - a new knob for controlling scrubbing of pages returned by the Xen balloon driver to the Xen hypervisor to address a boot performance issue seen in large guests booted pre-ballooned - a fix of a regression in the gntdev driver which made it impossible to use fully virtualized guests (HVM guests) with a 4.19 based dom0 - a fix in Xen cpu hotplug functionality which could be triggered by wrong admin commands (setting number of active vcpus to 0) One further note: the patches have all been under test for several days in another branch. This branch has been rebased in order to avoid merge conflicts" * tag 'for-linus-4.19c-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/gntdev: fix up blockable calls to mn_invl_range_start xen: fix GCC warning and remove duplicate EVTCHN_ROW/EVTCHN_COL usage xen: avoid crash in disable_hotplug_cpu xen/balloon: add runtime control for scrubbing ballooned out pages xen/manage: don't complain about an empty value in control/sysrq node commit eae4f8851f35ceb75f56a861659800c33603a476 Merge: 3e153256d9f1 4a7f50f78c22 Author: Linus Torvalds Date: Fri Sep 14 12:56:42 2018 -1000 Merge tag 'xtensa-20180914' of git://github.com/jcmvbkbc/linux-xtensa Pull Xtensa fixes and cleanups from Max Filippov: - don't allocate memory in platform_setup as the memory allocator is not initialized at that point yet; - remove unnecessary ifeq KBUILD_SRC from arch/xtensa/Makefile; - enable SG chaining in arch/xtensa/Kconfig. * tag 'xtensa-20180914' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: enable SG chaining in Kconfig xtensa: remove unnecessary KBUILD_SRC ifeq conditional xtensa: ISS: don't allocate memory in platform_setup commit 3e153256d9f18b0568fb568958db2d3f83a5365c Merge: f3c0b8ce4840 500dd232449e Author: Linus Torvalds Date: Fri Sep 14 12:42:02 2018 -1000 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "The trickle of arm64 fixes continues to come in. Nothing that's the end of the world, but we've got a fix for PCI IO port accesses, an accidental naked "asm goto" and a fix to the vmcoreinfo PT_NOTE merged this time around which we'd like to get sorted before it becomes ABI. - Fix ioport_map() mapping the wrong physical address for some I/O BARs - Remove direct use of "asm goto", since some compilers don't like that - Ensure kimage_voffset is always present in vmcoreinfo PT_NOTE" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: asm-generic: io: Fix ioport_map() for !CONFIG_GENERIC_IOMAP && CONFIG_INDIRECT_PIO arm64: kernel: arch_crash_save_vmcoreinfo() should depend on CONFIG_CRASH_CORE arm64: jump_label.h: use asm_volatile_goto macro instead of "asm goto" commit 9f0c5124f4a82503ee5d55c60b0b9c6afc3af68b Author: Trond Myklebust Date: Wed Sep 5 14:07:15 2018 -0400 NFS: Don't open code clearing of delegation state Add a helper for the case when the nfs4 open state has been set to use a delegation stateid, and we want to revert to using the open stateid. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 994b15b983a72e1148a173b61e5b279219bb45ae Author: Trond Myklebust Date: Wed Sep 5 14:07:14 2018 -0400 NFSv4.1 fix infinite loop on I/O. The previous fix broke recovery of delegated stateids because it assumes that if we did not mark the delegation as suspect, then the delegation has effectively been revoked, and so it removes that delegation irrespectively of whether or not it is valid and still in use. While this is "mostly harmless" for ordinary I/O, we've seen pNFS fail with LAYOUTGET spinning in an infinite loop while complaining that we're using an invalid stateid (in this case the all-zero stateid). What we rather want to do here is ensure that the delegation is always correctly marked as needing testing when that is the case. So we want to close the loophole offered by nfs4_schedule_stateid_recovery(), which marks the state as needing to be reclaimed, but not the delegation that may be backing it. Fixes: 0e3d3e5df07dc ("NFSv4.1 fix infinite loop on IO BAD_STATEID error") Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org # v4.11+ Signed-off-by: Anna Schumaker commit 2edaead69e7573f35e8d5dc20938e41eacc21b35 Author: Trond Myklebust Date: Wed Sep 5 14:07:13 2018 -0400 NFSv4: Fix a tracepoint Oops in initiate_file_draining() Now that the value of 'ino' can be NULL or an ERR_PTR(), we need to change the test in the tracepoint. Fixes: ce5624f7e6675 ("NFSv4: Return NFS4ERR_DELAY when a layout fails...") Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org # v4.17+ Signed-off-by: Anna Schumaker commit d03360aaf5ccac49581960bd736258c62972b88b Author: Trond Myklebust Date: Wed Sep 5 14:07:12 2018 -0400 pNFS: Ensure we return the error if someone kills a waiting layoutget If someone interrupts a wait on one or more outstanding layoutgets in pnfs_update_layout() then return the ERESTARTSYS/EINTR error. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 2a534a7473bf4e7f1c12805113f80c795fc8e89a Author: Trond Myklebust Date: Thu Aug 23 11:02:49 2018 -0400 NFSv4: Fix a tracepoint Oops in initiate_file_draining() Now that the value of 'ino' can be NULL or an ERR_PTR(), we need to change the test in the tracepoint. Fixes: ce5624f7e6675 ("NFSv4: Return NFS4ERR_DELAY when a layout fails...") Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org # v4.17+ Signed-off-by: Anna Schumaker commit 7c2020c3022dfa6801d420b55ef0c507322d2c60 Author: Colin Ian King Date: Fri Sep 14 12:27:27 2018 +0100 ARC: fix spelling mistake "entires" -> "entries" Trivial fix to spelling mistake in Kconfig Signed-off-by: Colin Ian King Signed-off-by: Vineet Gupta commit 1a866306e0fbf3caab168c1389e4497702749441 Author: Lucas Stach Date: Wed Sep 12 16:34:27 2018 +0200 drm/etnaviv: add DMA configuration for etnaviv platform device The etnaviv device is a virtual device backing the DRM device, which may drive multiple hardware GPU core devices. As most of the dma-mapping handling is done through the virtual device, we need to make sure that a proper DMA setup is in place. The easiest way to get a reasonable configuration is to let the virtual device share the DMA configuration with one of the GPU devices, so call of_dma_configure() with the right parameters manually. This assumes that all etnaviv driven GPU devices in the system share the same DMA configuration. If we ever encounter a SoC where the GPUs are on busses with different offsets or behind different IOMMUs that will require much deeper changes to the driver, as we would need to implement etnaviv specific versions of most of the DRM helper functions. For now we should be fine with this solution. Signed-off-by: Lucas Stach Tested-by: Guido Günther Tested-by: Eugeniy Paltsev commit f3c0b8ce48408b742a9154d53d19e3c7ff97772d Merge: 1abc088afd5b 111b009f7e8b Author: Linus Torvalds Date: Fri Sep 14 06:08:40 2018 -1000 Merge tag 'dmaengine-fix-4.19-rc4' of git://git.infradead.org/users/vkoul/slave-dma Pull dmaengine fix from Vinod Koul: "Fix the mic_x100_dma driver to use devm_kzalloc for driver memory, so that it is freed properly when it unregisters from dmaengine using managed API" * tag 'dmaengine-fix-4.19-rc4' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: mic_x100_dma: use devm_kzalloc to fix an issue commit 1abc088afd5b8b64582510dd9f801fd215a87feb Merge: c284cf062191 df3aa13c7bbb Author: Linus Torvalds Date: Fri Sep 14 05:59:48 2018 -1000 Merge tag 'usb-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are a number of small USB driver fixes for -rc4. The usual suspects of gadget, xhci, and dwc2/3 are in here, along with some reverts of reported problem changes, and a number of build documentation warning fixes. Full details are in the shortlog. All of these have been in linux-next with no reported issues" * tag 'usb-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (28 commits) Revert "cdc-acm: implement put_char() and flush_chars()" usb: Change usb_of_get_companion_dev() place to usb/common usb: xhci: fix interrupt transfer error happened on MTK platforms usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt() usb: misc: uss720: Fix two sleep-in-atomic-context bugs usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in u132_get_frame() usb: Avoid use-after-free by flushing endpoints early in usb_set_interface() linux/mod_devicetable.h: fix kernel-doc missing notation for typec_device_id usb/typec: fix kernel-doc notation warning for typec_match_altmode usb: Don't die twice if PCI xhci host is not responding in resume usb: mtu3: fix error of xhci port id when enable U3 dual role usb: uas: add support for more quirk flags USB: Add quirk to support DJI CineSSD usb: typec: fix kernel-doc parameter warning usb/dwc3/gadget: fix kernel-doc parameter warning USB: yurex: Check for truncation in yurex_read() USB: yurex: Fix buffer over-read in yurex_write() usb: host: xhci-plat: Iterate over parent nodes for finding quirks xhci: Fix use after free for URB cancellation on a reallocated endpoint USB: add quirk for WORLDE Controller KS49 or Prodipe MIDI 49C USB controller ... commit dabeb13eee81329338b1f8f330dfcc37a86714d7 Author: Sven Eckelmann Date: Fri Sep 14 10:47:14 2018 +0200 batman-adv: Increase version number to 2018.3 Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit c284cf062191237abfda57dd526cd10afc8abb19 Merge: 45d9ab8a306b 7f2bf7840b74 Author: Linus Torvalds Date: Fri Sep 14 05:58:12 2018 -1000 Merge tag 'tty-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty fixes from Greg KH: "Here are three small HVC tty driver fixes to resolve a reported regression from 4.19-rc1. All of these have been in linux-next for a while with no reported issues" * tag 'tty-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: hvc: hvc_write() fix break condition tty: hvc: hvc_poll() fix read loop batching tty: hvc: hvc_poll() fix read loop hang commit 34043d250f51368f214aed7f54c2dc29c819a8c7 Author: Davide Caratti Date: Fri Sep 14 12:03:18 2018 +0200 net/sched: act_sample: fix NULL dereference in the data path Matteo reported the following splat, testing the datapath of TC 'sample': BUG: KASAN: null-ptr-deref in tcf_sample_act+0xc4/0x310 Read of size 8 at addr 0000000000000000 by task nc/433 CPU: 0 PID: 433 Comm: nc Not tainted 4.19.0-rc3-kvm #17 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS ?-20180531_142017-buildhw-08.phx2.fedoraproject.org-1.fc28 04/01/2014 Call Trace: kasan_report.cold.6+0x6c/0x2fa tcf_sample_act+0xc4/0x310 ? dev_hard_start_xmit+0x117/0x180 tcf_action_exec+0xa3/0x160 tcf_classify+0xdd/0x1d0 htb_enqueue+0x18e/0x6b0 ? deref_stack_reg+0x7a/0xb0 ? htb_delete+0x4b0/0x4b0 ? unwind_next_frame+0x819/0x8f0 ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 __dev_queue_xmit+0x722/0xca0 ? unwind_get_return_address_ptr+0x50/0x50 ? netdev_pick_tx+0xe0/0xe0 ? save_stack+0x8c/0xb0 ? kasan_kmalloc+0xbe/0xd0 ? __kmalloc_track_caller+0xe4/0x1c0 ? __kmalloc_reserve.isra.45+0x24/0x70 ? __alloc_skb+0xdd/0x2e0 ? sk_stream_alloc_skb+0x91/0x3b0 ? tcp_sendmsg_locked+0x71b/0x15a0 ? tcp_sendmsg+0x22/0x40 ? __sys_sendto+0x1b0/0x250 ? __x64_sys_sendto+0x6f/0x80 ? do_syscall_64+0x5d/0x150 ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 ? __sys_sendto+0x1b0/0x250 ? __x64_sys_sendto+0x6f/0x80 ? do_syscall_64+0x5d/0x150 ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 ip_finish_output2+0x495/0x590 ? ip_copy_metadata+0x2e0/0x2e0 ? skb_gso_validate_network_len+0x6f/0x110 ? ip_finish_output+0x174/0x280 __tcp_transmit_skb+0xb17/0x12b0 ? __tcp_select_window+0x380/0x380 tcp_write_xmit+0x913/0x1de0 ? __sk_mem_schedule+0x50/0x80 tcp_sendmsg_locked+0x49d/0x15a0 ? tcp_rcv_established+0x8da/0xa30 ? tcp_set_state+0x220/0x220 ? clear_user+0x1f/0x50 ? iov_iter_zero+0x1ae/0x590 ? __fget_light+0xa0/0xe0 tcp_sendmsg+0x22/0x40 __sys_sendto+0x1b0/0x250 ? __ia32_sys_getpeername+0x40/0x40 ? _copy_to_user+0x58/0x70 ? poll_select_copy_remaining+0x176/0x200 ? __pollwait+0x1c0/0x1c0 ? ktime_get_ts64+0x11f/0x140 ? kern_select+0x108/0x150 ? core_sys_select+0x360/0x360 ? vfs_read+0x127/0x150 ? kernel_write+0x90/0x90 __x64_sys_sendto+0x6f/0x80 do_syscall_64+0x5d/0x150 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fefef2b129d Code: ff ff ff ff eb b6 0f 1f 80 00 00 00 00 48 8d 05 51 37 0c 00 41 89 ca 8b 00 85 c0 75 20 45 31 c9 45 31 c0 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 6b f3 c3 66 0f 1f 84 00 00 00 00 00 41 56 41 RSP: 002b:00007fff2f5350c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000056118d60c120 RCX: 00007fefef2b129d RDX: 0000000000002000 RSI: 000056118d629320 RDI: 0000000000000003 RBP: 000056118d530370 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000002000 R13: 000056118d5c2a10 R14: 000056118d5c2a10 R15: 000056118d5303b8 tcf_sample_act() tried to update its per-cpu stats, but tcf_sample_init() forgot to allocate them, because tcf_idr_create() was called with a wrong value of 'cpustats'. Setting it to true proved to fix the reported crash. Reported-by: Matteo Croce Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") Fixes: 5c5670fae430 ("net/sched: Introduce sample tc action") Tested-by: Matteo Croce Signed-off-by: Davide Caratti Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 45d9ab8a306bd096faad32cd43a814b40e91870a Merge: 319cbacfc0f2 65aac1742328 Author: Linus Torvalds Date: Fri Sep 14 05:43:43 2018 -1000 Merge tag 'staging-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging/IIO driver fixes from Greg KH: "Here are a few small staging and iio driver fixes for -rc4. Nothing major, just a few small bugfixes for some reported issues, and a MAINTAINERS file update for the fbtft drivers. We also re-enable the building of the erofs filesystem as the XArray patches that were causing it to break never got merged in the -rc1 cycle, so there's no reason it can't be turned back on for now. The problem that was previously there is now being handled in the Xarray tree at the moment, so it will not hit us again in the future. All of these patches have been in linux-next with no reported issues" * tag 'staging-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: vboxvideo: Change address of scanout buffer on page-flip staging: vboxvideo: Fix IRQs no longer working staging: gasket: TODO: re-implement using UIO staging/fbtft: Update TODO and mailing lists staging: erofs: rename superblock flags (MS_xyz -> SB_xyz) iio: imu: st_lsm6dsx: take into account ts samples in wm configuration Revert "iio: temperature: maxim_thermocouple: add MAX31856 part" Revert "staging: erofs: disable compiling temporarile" MAINTAINERS: Switch a maintainer for drivers/staging/gasket staging: wilc1000: revert "fix TODO to compile spi and sdio components in single module" commit 319cbacfc0f272297849ce61d36557a408bb3771 Merge: a06b0c82a049 422b3db2a503 Author: Linus Torvalds Date: Fri Sep 14 05:40:13 2018 -1000 Merge tag 'char-misc-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are a small handful of char/misc driver fixes for 4.19-rc4. All of them are simple, resolving reported problems in a few drivers. Full details are in the shortlog. All of these have been in linux-next with no reported issues" * tag 'char-misc-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: firmware: Fix security issue with request_firmware_into_buf() vmbus: don't return values for uninitalized channels fpga: dfl: fme: fix return value check in in pr_mgmt_init() misc: hmc6352: fix potential Spectre v1 Tools: hv: Fix a bug in the key delete code misc: ibmvsm: Fix wrong assignment of return code android: binder: fix the race mmap and alloc_new_buf_locked mei: bus: need to unlink client before freeing mei: bus: fix hw module get/put balance mei: fix use-after-free in mei_cl_write mei: ignore not found client in the enumeration commit 61a6bd83abf2f14b2a917b6a0279c88d299267af Author: Joerg Roedel Date: Fri Sep 14 12:59:14 2018 +0200 Revert "x86/mm/legacy: Populate the user page-table with user pgd's" This reverts commit 1f40a46cf47c12d93a5ad9dccd82bd36ff8f956a. It turned out that this patch is not sufficient to enable PTI on 32 bit systems with legacy 2-level page-tables. In this paging mode the huge-page PTEs are in the top-level page-table directory, where also the mirroring to the user-space page-table happens. So every huge PTE exits twice, in the kernel and in the user page-table. That means that accessed/dirty bits need to be fetched from two PTEs in this mode to be safe, but this is not trivial to implement because it needs changes to generic code just for the sake of enabling PTI with 32-bit legacy paging. As all systems that need PTI should support PAE anyway, remove support for PTI when 32-bit legacy paging is used. Fixes: 7757d607c6b3 ('x86/pti: Allow CONFIG_PAGE_TABLE_ISOLATION for x86_32') Reported-by: Meelis Roos Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Borislav Petkov Cc: Andrea Arcangeli Link: https://lkml.kernel.org/r/1536922754-31379-1-git-send-email-joro@8bytes.org commit 58a57569904039d9ac38c0ff2a88396a43899689 Author: Michal Hocko Date: Wed Sep 5 09:21:39 2018 +1000 xen/gntdev: fix up blockable calls to mn_invl_range_start Patch series "mmu_notifiers follow ups". Tetsuo has noticed some fallouts from 93065ac753e4 ("mm, oom: distinguish blockable mode for mmu notifiers"). One of them has been fixed and picked up by AMD/DRM maintainer [1]. XEN issue is fixed by patch 1. I have also clarified expectations about blockable semantic of invalidate_range_end. Finally the last patch removes MMU_INVALIDATE_DOES_NOT_BLOCK which is no longer used nor needed. [1] http://lkml.kernel.org/r/20180824135257.GU29735@dhcp22.suse.cz This patch (of 3): 93065ac753e4 ("mm, oom: distinguish blockable mode for mmu notifiers") has introduced blockable parameter to all mmu_notifiers and the notifier has to back off when called in !blockable case and it could block down the road. The above commit implemented that for mn_invl_range_start but both in_range checks are done unconditionally regardless of the blockable mode and as such they would fail all the time for regular calls. Fix this by checking blockable parameter as well. Once we are there we can remove the stale TODO. The lock has to be sleepable because we wait for completion down in gnttab_unmap_refs_sync. Link: http://lkml.kernel.org/r/20180827112623.8992-2-mhocko@kernel.org Fixes: 93065ac753e4 ("mm, oom: distinguish blockable mode for mmu notifiers") Signed-off-by: Michal Hocko Cc: Boris Ostrovsky Cc: Juergen Gross Cc: David Rientjes Cc: Jerome Glisse Cc: Tetsuo Handa Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 4dca864b59dd150a221730775e2f21f49779c135 Author: Josh Abraham Date: Wed Sep 12 15:13:54 2018 -1000 xen: fix GCC warning and remove duplicate EVTCHN_ROW/EVTCHN_COL usage This patch removes duplicate macro useage in events_base.c. It also fixes gcc warning: variable ‘col’ set but not used [-Wunused-but-set-variable] Signed-off-by: Joshua Abraham Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 3366cdb6d350d95466ee430ac50f3c8415ca8f46 Author: Olaf Hering Date: Fri Sep 7 16:31:35 2018 +0200 xen: avoid crash in disable_hotplug_cpu The command 'xl vcpu-set 0 0', issued in dom0, will crash dom0: BUG: unable to handle kernel NULL pointer dereference at 00000000000002d8 PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 7 PID: 65 Comm: xenwatch Not tainted 4.19.0-rc2-1.ga9462db-default #1 openSUSE Tumbleweed (unreleased) Hardware name: Intel Corporation S5520UR/S5520UR, BIOS S5500.86B.01.00.0050.050620101605 05/06/2010 RIP: e030:device_offline+0x9/0xb0 Code: 77 24 00 e9 ce fe ff ff 48 8b 13 e9 68 ff ff ff 48 8b 13 e9 29 ff ff ff 48 8b 13 e9 ea fe ff ff 90 66 66 66 66 90 41 54 55 53 87 d8 02 00 00 01 0f 85 88 00 00 00 48 c7 c2 20 09 60 81 31 f6 RSP: e02b:ffffc90040f27e80 EFLAGS: 00010203 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff8801f3800000 RSI: ffffc90040f27e70 RDI: 0000000000000000 RBP: 0000000000000000 R08: ffffffff820e47b3 R09: 0000000000000000 R10: 0000000000007ff0 R11: 0000000000000000 R12: ffffffff822e6d30 R13: dead000000000200 R14: dead000000000100 R15: ffffffff8158b4e0 FS: 00007ffa595158c0(0000) GS:ffff8801f39c0000(0000) knlGS:0000000000000000 CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000002d8 CR3: 00000001d9602000 CR4: 0000000000002660 Call Trace: handle_vcpu_hotplug_event+0xb5/0xc0 xenwatch_thread+0x80/0x140 ? wait_woken+0x80/0x80 kthread+0x112/0x130 ? kthread_create_worker_on_cpu+0x40/0x40 ret_from_fork+0x3a/0x50 This happens because handle_vcpu_hotplug_event is called twice. In the first iteration cpu_present is still true, in the second iteration cpu_present is false which causes get_cpu_device to return NULL. In case of cpu#0, cpu_online is apparently always true. Fix this crash by checking if the cpu can be hotplugged, which is false for a cpu that was just removed. Also check if the cpu was actually offlined by device_remove, otherwise leave the cpu_present state as it is. Rearrange to code to do all work with device_hotplug_lock held. Signed-off-by: Olaf Hering Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 197ecb3802c04499d8ff4f8cb28f6efa008067db Author: Marek Marczykowski-Górecki Date: Fri Sep 7 18:49:08 2018 +0200 xen/balloon: add runtime control for scrubbing ballooned out pages Scrubbing pages on initial balloon down can take some time, especially in nested virtualization case (nested EPT is slow). When HVM/PVH guest is started with memory= significantly lower than maxmem=, all the extra pages will be scrubbed before returning to Xen. But since most of them weren't used at all at that point, Xen needs to populate them first (from populate-on-demand pool). In nested virt case (Xen inside KVM) this slows down the guest boot by 15-30s with just 1.5GB needed to be returned to Xen. Add runtime parameter to enable/disable it, to allow initially disabling scrubbing, then enable it back during boot (for example in initramfs). Such usage relies on assumption that a) most pages ballooned out during initial boot weren't used at all, and b) even if they were, very few secrets are in the guest at that time (before any serious userspace kicks in). Convert CONFIG_XEN_SCRUB_PAGES to CONFIG_XEN_SCRUB_PAGES_DEFAULT (also enabled by default), controlling default value for the new runtime switch. Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 87dffe86d406bee8782cac2db035acb9a28620a7 Author: Vitaly Kuznetsov Date: Thu Sep 6 13:26:08 2018 +0200 xen/manage: don't complain about an empty value in control/sysrq node When guest receives a sysrq request from the host it acknowledges it by writing '\0' to control/sysrq xenstore node. This, however, make xenstore watch fire again but xenbus_scanf() fails to parse empty value with "%c" format string: sysrq: SysRq : Emergency Sync Emergency Sync complete xen:manage: Error -34 reading sysrq code in control/sysrq Ignore -ERANGE the same way we already ignore -ENOENT, empty value in control/sysrq is totally legal. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Wei Liu Signed-off-by: Boris Ostrovsky commit 500dd232449e7c07500e713dc6970aa713f8e4f1 Author: Andrew Murray Date: Thu Sep 13 13:48:27 2018 +0100 asm-generic: io: Fix ioport_map() for !CONFIG_GENERIC_IOMAP && CONFIG_INDIRECT_PIO The !CONFIG_GENERIC_IOMAP version of ioport_map uses MMIO_UPPER_LIMIT to prevent users from making I/O accesses outside the expected I/O range - however it erroneously treats MMIO_UPPER_LIMIT as a mask which is contradictory to its other users. The introduction of CONFIG_INDIRECT_PIO, which subtracts an arbitrary amount from IO_SPACE_LIMIT to form MMIO_UPPER_LIMIT, results in ioport_map mangling the given port rather than capping it. We address this by aligning more closely with the CONFIG_GENERIC_IOMAP implementation of ioport_map by using the comparison operator and returning NULL where the port exceeds MMIO_UPPER_LIMIT. Though note that we preserve the existing behavior of masking with IO_SPACE_LIMIT such that we don't break existing buggy drivers that somehow rely on this masking. Fixes: 5745392e0c2b ("PCI: Apply the new generic I/O management on PCI IO hosts") Reported-by: Will Deacon Reviewed-by: Arnd Bergmann Signed-off-by: Andrew Murray Signed-off-by: Will Deacon commit 35aecc02b5b621782111f64cbb032c7f6a90bb32 Author: Johan Hovold Date: Thu Sep 13 11:21:50 2018 +0200 USB: serial: option: add two-endpoints device-id flag Allow matching on interfaces having two endpoints by adding a new device-id flag. This allows for the handling of devices whose interface numbers can change (e.g. Quectel EP06) to be contained in the device-id table. Tested-by: Kristian Evensen Cc: stable Signed-off-by: Johan Hovold commit 36cae568404a298a19a6e8a3f18641075d4cab04 Author: Kristian Evensen Date: Thu Sep 13 11:21:49 2018 +0200 USB: serial: option: improve Quectel EP06 detection The Quectel EP06 (and EM06/EG06) LTE modem supports updating the USB configuration, without the VID/PID or configuration number changing. When the configuration is updated and interfaces are added/removed, the interface numbers are updated. This causes our current code for matching EP06 not to work as intended, as the assumption about reserved interfaces no longer holds. If for example the diagnostic (first) interface is removed, option will (try to) bind to the QMI interface. This patch improves EP06 detection by replacing the current match with two matches, and those matches check class, subclass and protocol as well as VID and PID. The diag interface exports class, subclass and protocol as 0xff. For the other serial interfaces, class is 0xff and subclass and protocol are both 0x0. The modem can export the following devices and always in this order: diag, nmea, at, ppp. qmi and adb. This means that diag can only ever be interface 0, and interface numbers 1-5 should be marked as reserved. The three other serial devices can have interface numbers 0-3, but I have not marked any interfaces as reserved. The reason is that the serial devices are the only interfaces exported by the device where subclass and protocol is 0x0. QMI exports the same class, subclass and protocol values as the diag interface. However, the two interfaces have different number of endpoints, QMI has three and diag two. I have added a check for number of interfaces if VID/PID matches the EP06, and we ignore the device if number of interfaces equals three (and subclass is set). Signed-off-by: Kristian Evensen Acked-by: Dan Williams [ johan: drop uneeded RSVD(5) for ADB ] Cc: stable Signed-off-by: Johan Hovold commit 807588ac92018bde88a1958f546438e840eb0158 Author: Anisse Astier Date: Wed Sep 12 15:07:05 2018 +0200 HID: i2c-hid: disable runtime PM operations on hantick touchpad This hantick HTIX5288 touchpad can quickly fall in a wrong state if there are too many open/close operations. This will either make it stop reporting any input, or will shift all the input reads by a few bytes, making it impossible to decode. Here, we never release the probed touchpad runtime pm while the driver is loaded, which should disable all runtime pm suspend/resumes. This fast repetition of sleep/wakeup is also more likely to happen when using runtime PM, which is why the quirk is done there, and not for all power downs, which would include suspend or module removal. Signed-off-by: Anisse Astier Cc: stable@vger.kernel.org Acked-by: Benjamin Tissoires Reviewed-by: Hans de Goede Tested-by: Philip Müller Signed-off-by: Jiri Kosina commit 24568b47d48ec8c906fd0f589489a08b17e1edca Author: Ondrej Mosnacek Date: Wed Sep 5 09:26:41 2018 +0200 crypto: x86/aegis,morus - Do not require OSXSAVE for SSE2 It turns out OSXSAVE needs to be checked only for AVX, not for SSE. Without this patch the affected modules refuse to load on CPUs with SSE2 but without AVX support. Fixes: 877ccce7cbe8 ("crypto: x86/aegis,morus - Fix and simplify CPUID checks") Cc: # 4.18 Reported-by: Zdenek Kaspar Signed-off-by: Ondrej Mosnacek Signed-off-by: Herbert Xu commit a06b0c82a049d34d4dc273e8692ed0894458c468 Merge: 48751b562bce a6ae928c2583 Author: Linus Torvalds Date: Thu Sep 13 19:37:08 2018 -1000 Merge tag 'printk-for-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk Pull printk fix from Petr Mladek: "Revert a commit that caused "quiet", "debug", and "loglevel" early parameters to be ignored for early boot messages" * tag 'printk-for-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk: Revert "printk: make sure to print log on console." commit 48751b562bce96c4284885571da1bdda7673f38e Merge: 4d8d9f540b78 8c25741aaad8 Author: Linus Torvalds Date: Thu Sep 13 19:21:40 2018 -1000 Merge tag 'ovl-fixes-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Pull overlayfs fixes from Miklos Szeredi: "This fixes a regression in the recent file stacking update, reported and fixed by Amir Goldstein. The fix is fairly trivial, but involves adding a fadvise() f_op and the associated churn in the vfs. As discussed on -fsdevel, there are other possible uses for this method, than allowing proper stacking for overlays. And there's one other fix for a syzkaller detected oops" * tag 'ovl-fixes-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: fix oopses in ovl_fill_super() failure paths ovl: add ovl_fadvise() vfs: implement readahead(2) using POSIX_FADV_WILLNEED vfs: add the fadvise() file operation Documentation/filesystems: update documentation of file_operations ovl: fix GPF in swapfile_activate of file from overlayfs over xfs ovl: respect FIEMAP_FLAG_SYNC flag commit 4d8d9f540b780f7a3688a72275aecd8fd99c99e5 Merge: a0efc03b7925 b228ba1cb95a Author: Linus Torvalds Date: Thu Sep 13 19:16:11 2018 -1000 Merge tag 'for-linus-20180913' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Three fixes that should go into this series. This contains: - Increase number of policies supported by blk-cgroup. With blk-iolatency, we now have four in kernel, but we had a hard limit of three... - Fix regression in null_blk, where the zoned supported broke queue_mode=0 (bio based). - NVMe pull request, with a single fix for an issue in the rdma code" * tag 'for-linus-20180913' of git://git.kernel.dk/linux-block: null_blk: fix zoned support for non-rq based operation blk-cgroup: increase number of supported policies nvmet-rdma: fix possible bogus dereference under heavy load commit a0efc03b7925c4b606b1c49feb394859754e1cc8 Merge: 0f9aeeac1df7 3ab918281668 Author: Linus Torvalds Date: Thu Sep 13 19:12:55 2018 -1000 Merge tag 'for-4.19/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - DM verity fix for crash due to using vmalloc'd buffers with the asynchronous crypto hadsh API. - Fix to both DM crypt and DM integrity targets to discontinue using CRYPTO_TFM_REQ_MAY_SLEEP because its use of GFP_KERNEL can lead to deadlock by recursing back into a filesystem. - Various DM raid fixes related to reshape and rebuild races. - Fix for DM thin-provisioning to avoid data corruption that was a side-effect of needing to abort DM thin metadata transaction due to running out of metadata space. Fix is to reserve a small amount of metadata space so that once it is used the DM thin-pool can finish its active transaction before switching to read-only mode. * tag 'for-4.19/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm thin metadata: try to avoid ever aborting transactions dm raid: bump target version, update comments and documentation dm raid: fix RAID leg rebuild errors dm raid: fix rebuild of specific devices by updating superblock dm raid: fix stripe adding reshape deadlock dm raid: fix reshape race on small devices dm: disable CRYPTO_TFM_REQ_MAY_SLEEP to fix a GFP_KERNEL recursion deadlock dm verity: fix crash on bufio buffer that was allocated with vmalloc commit 0f9aeeac1df7b7c984dea04384a2b54c343710ab Merge: 145ea6f10d42 2b6318a09fd3 Author: Linus Torvalds Date: Thu Sep 13 18:54:47 2018 -1000 Merge tag 'drm-fixes-2018-09-14' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "This is the general drm fixes pull for rc4. i915: - Two GVT fixes (one for the mm reference issue you pointed out) - Gen 2 video playback fix - IPS timeout error suppression on Broadwell amdgpu: - Small memory leak - SR-IOV reset - locking fix - updated SDMA golden registers nouveau: - Remove some leftover debugging" * tag 'drm-fixes-2018-09-14' of git://anongit.freedesktop.org/drm/drm: drm/nouveau/devinit: fix warning when PMU/PRE_OS is missing drm/amdgpu: fix error handling in amdgpu_cs_user_fence_chunk drm/i915/overlay: Allocate physical registers from stolen drm/amdgpu: move PSP init prior to IH in gpu reset drm/amdgpu: Fix SDMA hang in prt mode v2 drm/amdgpu: fix amdgpu_mn_unlock() in the CS error path drm/i915/bdw: Increase IPS disable timeout to 100ms drm/i915/gvt: Fix the incorrect length of child_device_config issue drm/i915/gvt: Fix life cycle reference on KVM mm commit 145ea6f10d42dac0a1e8a6dfb83b273c0acabf5b Merge: 4624d6ea1b7f 831b624df1b4 Author: Linus Torvalds Date: Thu Sep 13 18:52:41 2018 -1000 Merge tag 'pstore-v4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore fix from Kees Cook: "This fixes a 6 year old pstore bug that everyone just got lucky in avoiding, likely due only using page-aligned persistent ram regions: - Handle page-vs-byte offset handling between iomap and vmap (Bin Yang)" * tag 'pstore-v4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore: Fix incorrect persistent ram buffer mapping commit 4624d6ea1b7fe83f1e36caf4537600414ca833f6 Merge: bd5bca13819b c483a5cc9d09 Author: Linus Torvalds Date: Thu Sep 13 18:49:23 2018 -1000 Merge tag 'mmc-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC host fixes from Ulf Hansson: - meson-mx-sdio: Fix OF child-node lookup - omap_hsmmc: Fix wakeirq handling on removal * tag 'mmc-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: meson-mx-sdio: fix OF child-node lookup mmc: omap_hsmmc: fix wakeirq handling on removal commit bd5bca13819b6534b71f45c9dab0e08219929e72 Merge: f1c03a465192 5bc5a671b1f4 Author: Linus Torvalds Date: Thu Sep 13 18:47:45 2018 -1000 Merge tag 'pinctrl-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: - A complicated IRQ fix for the MSM driver (see commit) - Fix the group/function check in the Ingenic driver - Deal with a possible NULL pointer dereference in the Madera driver * tag 'pinctrl-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: madera: Fix possible NULL pointer with pdata config pinctrl: ingenic: Fix group & function error checking pinctrl: msm: Really mask level interrupts to prevent latching commit f1c03a465192fea123789c85e44dc2610730b6cb Merge: 72d4c6e5893a 1194c4154662 Author: Linus Torvalds Date: Thu Sep 13 16:35:25 2018 -1000 Merge branch 'for-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu Pull percpu maintainership update from Tejun Heo: "This updates the MAINTAINERS file to transfer the percpu tree maintainership to Dennis Zhou. Dennis rewrote a good portion of the percpu allocator, knows most of percpu related code, is already listed as a co-maintainer, has been reliable, and now sits right behind me. I'll keep reviewing and involved with percpu stuff and am sure that Dennis will soon make a better maintainer than I ever was" * 'for-4.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: MAINTAINERS: Make Dennis the percpu tree maintainer commit 72d4c6e5893a122c2fd060ded2b490582a5bb377 Merge: 1d176582c795 5c41aaad409c Author: Linus Torvalds Date: Thu Sep 13 16:33:26 2018 -1000 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel Pull hexagon fixes from Richard Kuo: "Some fixes for compile warnings" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel: hexagon: modify ffs() and fls() to return int arch/hexagon: fix kernel/dma.c build warning commit 1d176582c795d05d15245f75407a3e1db62f740a Merge: 7a9cdebdcc17 fa108f95c676 Author: Linus Torvalds Date: Thu Sep 13 16:22:24 2018 -1000 Merge tag 's390-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Martin Schwidefsky: - One fix for the zcrypt driver to correctly handle incomplete encryption/decryption operations. - A cleanup for the aqmask/apmask parsing to avoid variable length arrays on the stack. * tag 's390-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/zcrypt: remove VLA usage from the AP bus s390/crypto: Fix return code checking in cbc_paes_crypt() commit 7a9cdebdcc17e426fb5287e4a82db1dfe86339b2 Author: Linus Torvalds Date: Wed Sep 12 23:57:48 2018 -1000 mm: get rid of vmacache_flush_all() entirely Jann Horn points out that the vmacache_flush_all() function is not only potentially expensive, it's buggy too. It also happens to be entirely unnecessary, because the sequence number overflow case can be avoided by simply making the sequence number be 64-bit. That doesn't even grow the data structures in question, because the other adjacent fields are already 64-bit. So simplify the whole thing by just making the sequence number overflow case go away entirely, which gets rid of all the complications and makes the code faster too. Win-win. [ Oleg Nesterov points out that the VMACACHE_FULL_FLUSHES statistics also just goes away entirely with this ] Reported-by: Jann Horn Suggested-by: Will Deacon Acked-by: Davidlohr Bueso Cc: Oleg Nesterov Cc: stable@kernel.org Signed-off-by: Linus Torvalds commit 2b6318a09fd346edea42a60f8d0c07b2eea2d079 Merge: 25824ca38e83 3483f08106fc Author: Dave Airlie Date: Fri Sep 14 09:38:35 2018 +1000 Merge branch 'linux-4.19' of git://github.com/skeggsb/linux into drm-fixes One more nouveau fix to remove some debug warnings. Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/CABDvA==GF63dy8a9j611=-0x8G6FRu7uC-ZQypsLO_hqV4OAcA@mail.gmail.com commit 25824ca38e83d02cbc35b50d7f7a79ab5c7998a0 Merge: db7f06d49037 0165de983272 Author: Dave Airlie Date: Fri Sep 14 09:35:55 2018 +1000 Merge branch 'drm-fixes-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes A few fixes for 4.19: - Fix a small memory leak - SR-IOV reset fix - Fix locking in MMU-notifier error path - Updated SDMA golden settings to fix a PRT hang Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180912154735.2683-1-alexander.deucher@amd.com commit db7f06d49037859febb14c396bdc57ef250bedc1 Merge: 2887e5ce15dd 17dc7af70e89 Author: Dave Airlie Date: Fri Sep 14 09:33:05 2018 +1000 Merge tag 'drm-intel-fixes-2018-09-11' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes This contains a regression fix for video playbacks on gen 2 hardware, a IPS timeout error suppression on Broadwell and GVT bucked with "Most critical one is to fix KVM's mm reference when we access guest memory, issue was raised by Linus [1], and another one with virtual opregion fix." [1] - https://lists.freedesktop.org/archives/intel-gvt-dev/2018-August/004130.html Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180911223229.GA30328@intel.com commit 1cebf8f143c21eb422cd0f4e27ab2ae366eb4d04 Author: Johannes Berg Date: Thu Sep 13 14:40:55 2018 +0200 socket: fix struct ifreq size in compat ioctl As reported by Reobert O'Callahan, since Viro's commit to kill dev_ifsioc() we attempt to copy too much data in compat mode, which may lead to EFAULT when the 32-bit version of struct ifreq sits at/near the end of a page boundary, and the next page isn't mapped. Fix this by passing the approprate compat/non-compat size to copy and using that, as before the dev_ifsioc() removal. This works because only the embedded "struct ifmap" has different size, and this is only used in SIOCGIFMAP/SIOCSIFMAP which has a different handler. All other parts of the union are naturally compatible. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=199469. Fixes: bf4405737f9f ("kill dev_ifsioc()") Reported-by: Robert O'Callahan Signed-off-by: Johannes Berg Signed-off-by: David S. Miller commit 615f64458ad890ef94abc879a66d8b27236e733a Author: Alexey Brodkin Date: Thu Sep 13 23:24:28 2018 +0300 ARC: build: Get rid of toolchain check This check is very naive: we simply test if GCC invoked without "-mcpu=XXX" has ARC700 define set. In that case we think that GCC was built with "--with-cpu=arc700" and has libgcc built for ARC700. Otherwise if ARC700 is not defined we think that everythng was built for ARCv2. But in reality our life is much more interesting. 1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu" it may generate code for any ARC core). 2. libgcc might be built with explicitly specified "--mcpu=YYY" That's exactly what happens in case of multilibbed toolchains: - GCC is configured with default settings - All the libs built for many different CPU flavors I.e. that check gets in the way of usage of multilibbed toolchains. And even non-multilibbed toolchains are affected. OpenEmbedded also builds GCC without "--with-cpu" because each and every target component later is compiled with explicitly set "-mcpu=ZZZ". Acked-by: Rob Herring Signed-off-by: Alexey Brodkin Signed-off-by: Vineet Gupta commit 1194c4154662ac60312c164e9eaab0f8dd0dd36f Author: Tejun Heo Date: Thu Sep 13 12:16:36 2018 -0700 MAINTAINERS: Make Dennis the percpu tree maintainer Dennis rewrote a significant portion of the percpu allocator and has shown that he can respond in a timely and helpful manner when issues are reported against percpu allocator. Let's make Dennis the percpu tree maintainer. Signed-off-by: Tejun Heo Cc: Dennis Zhou Cc: Christoph Lameter commit c56cae23c6b167acc68043c683c4573b80cbcc2c Author: Toke Høiland-Jørgensen Date: Thu Sep 13 16:43:07 2018 +0200 gso_segment: Reset skb->mac_len after modifying network header When splitting a GSO segment that consists of encapsulated packets, the skb->mac_len of the segments can end up being set wrong, causing packet drops in particular when using act_mirred and ifb interfaces in combination with a qdisc that splits GSO packets. This happens because at the time skb_segment() is called, network_header will point to the inner header, throwing off the calculation in skb_reset_mac_len(). The network_header is subsequently adjust by the outer IP gso_segment handlers, but they don't set the mac_len. Fix this by adding skb_reset_mac_len() calls to both the IPv4 and IPv6 gso_segment handlers, after they modify the network_header. Many thanks to Eric Dumazet for his help in identifying the cause of the bug. Acked-by: Dave Taht Reviewed-by: Eric Dumazet Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit bffb9b51a230e61cc3870f30cc158a8a003eb55f Merge: 79140335ac12 e6a57d22f787 Author: David S. Miller Date: Thu Sep 13 12:06:12 2018 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Johan Hedberg says: ==================== pull request: bluetooth 2018-09-13 A few Bluetooth fixes for the 4.19-rc series: - Fixed rw_semaphore leak in hci_ldisc - Fixed local Out-of-Band pairing data handling Let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller commit 79140335ac12e71d9270dabe030274a297d8a2cf Merge: f0e0d04413fc c844eb46b7d4 Author: David S. Miller Date: Thu Sep 13 12:03:47 2018 -0700 Merge branch 'tls-don-t-leave-keys-in-kernel-memory' Sabrina Dubroca says: ==================== tls: don't leave keys in kernel memory There are a few places where the RX/TX key for a TLS socket is copied to kernel memory. This series clears those memory areas when they're no longer needed. v2: add union tls_crypto_context, following Vakul Garg's comment swap patch 2 and 3, using new union in patch 3 ==================== Signed-off-by: David S. Miller commit c844eb46b7d43c2cf760169df5ae1d5b033af338 Author: Sabrina Dubroca Date: Wed Sep 12 17:44:43 2018 +0200 tls: clear key material from kernel memory when do_tls_setsockopt_conf fails Fixes: 3c4d7559159b ("tls: kernel TLS support") Signed-off-by: Sabrina Dubroca Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 86029d10af18381814881d6cce2dd6872163b59f Author: Sabrina Dubroca Date: Wed Sep 12 17:44:42 2018 +0200 tls: zero the crypto information from tls_context before freeing This contains key material in crypto_send_aes_gcm_128 and crypto_recv_aes_gcm_128. Introduce union tls_crypto_context, and replace the two identical unions directly embedded in struct tls_context with it. We can then use this union to clean up the memory in the new tls_ctx_free() function. Fixes: 3c4d7559159b ("tls: kernel TLS support") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 7cba09c6d5bc73ebbd25a353742d9ddb7a713b95 Author: Sabrina Dubroca Date: Wed Sep 12 17:44:41 2018 +0200 tls: don't copy the key out of tls12_crypto_info_aes_gcm_128 There's no need to copy the key to an on-stack buffer before calling crypto_aead_setkey(). Fixes: 3c4d7559159b ("tls: kernel TLS support") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit f0e0d04413fcce9bc76388839099aee93cd0d33b Author: Vasily Khoruzhick Date: Thu Sep 13 11:12:03 2018 -0700 neighbour: confirm neigh entries when ARP packet is received Update 'confirmed' timestamp when ARP packet is received. It shouldn't affect locktime logic and anyway entry can be confirmed by any higher-layer protocol. Thus it makes sense to confirm it when ARP packet is received. Fixes: 77d7123342dc ("neighbour: update neigh timestamps iff update is effective") Signed-off-by: Vasily Khoruzhick Signed-off-by: David S. Miller commit 56a49d7048703f5ffdb84d3a0ee034108fba6850 Author: Roopa Prabhu Date: Wed Sep 12 13:21:48 2018 -0700 net: rtnl_configure_link: fix dev flags changes arg to __dev_notify_flags This fix addresses https://bugzilla.kernel.org/show_bug.cgi?id=201071 Commit 5025f7f7d506 wrongly relied on __dev_change_flags to notify users of dev flag changes in the case when dev->rtnl_link_state = RTNL_LINK_INITIALIZED. Fix it by indicating flag changes explicitly to __dev_notify_flags. Fixes: 5025f7f7d506 ("rtnetlink: add rtnl_link_state check in rtnl_configure_link") Reported-By: Liam mcbirnie Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 9824dfae5741275473a23a7ed5756c7b6efacc9d Author: Willy Tarreau Date: Wed Sep 12 07:36:35 2018 +0200 net/appletalk: fix minor pointer leak to userspace in SIOCFINDIPDDPRT Fields ->dev and ->next of struct ipddp_route may be copied to userspace on the SIOCFINDIPDDPRT ioctl. This is only accessible to CAP_NET_ADMIN though. Let's manually copy the relevant fields instead of using memcpy(). BugLink: http://blog.infosectcbr.com.au/2018/09/linux-kernel-infoleaks.html Cc: Jann Horn Signed-off-by: Willy Tarreau Signed-off-by: David S. Miller commit 018349d70f28a78d5343b3660cb66e1667005f8a Author: Stephen Hemminger Date: Thu Sep 13 08:03:43 2018 -0700 hv_netvsc: fix schedule in RCU context When netvsc device is removed it can call reschedule in RCU context. This happens because canceling the subchannel setup work could (in theory) cause a reschedule when manipulating the timer. To reproduce, run with lockdep enabled kernel and unbind a network device from hv_netvsc (via sysfs). [ 160.682011] WARNING: suspicious RCU usage [ 160.707466] 4.19.0-rc3-uio+ #2 Not tainted [ 160.709937] ----------------------------- [ 160.712352] ./include/linux/rcupdate.h:302 Illegal context switch in RCU read-side critical section! [ 160.723691] [ 160.723691] other info that might help us debug this: [ 160.723691] [ 160.730955] [ 160.730955] rcu_scheduler_active = 2, debug_locks = 1 [ 160.762813] 5 locks held by rebind-eth.sh/1812: [ 160.766851] #0: 000000008befa37a (sb_writers#6){.+.+}, at: vfs_write+0x184/0x1b0 [ 160.773416] #1: 00000000b097f236 (&of->mutex){+.+.}, at: kernfs_fop_write+0xe2/0x1a0 [ 160.783766] #2: 0000000041ee6889 (kn->count#3){++++}, at: kernfs_fop_write+0xeb/0x1a0 [ 160.787465] #3: 0000000056d92a74 (&dev->mutex){....}, at: device_release_driver_internal+0x39/0x250 [ 160.816987] #4: 0000000030f6031e (rcu_read_lock){....}, at: netvsc_remove+0x1e/0x250 [hv_netvsc] [ 160.828629] [ 160.828629] stack backtrace: [ 160.831966] CPU: 1 PID: 1812 Comm: rebind-eth.sh Not tainted 4.19.0-rc3-uio+ #2 [ 160.832952] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v1.0 11/26/2012 [ 160.832952] Call Trace: [ 160.832952] dump_stack+0x85/0xcb [ 160.832952] ___might_sleep+0x1a3/0x240 [ 160.832952] __flush_work+0x57/0x2e0 [ 160.832952] ? __mutex_lock+0x83/0x990 [ 160.832952] ? __kernfs_remove+0x24f/0x2e0 [ 160.832952] ? __kernfs_remove+0x1b2/0x2e0 [ 160.832952] ? mark_held_locks+0x50/0x80 [ 160.832952] ? get_work_pool+0x90/0x90 [ 160.832952] __cancel_work_timer+0x13c/0x1e0 [ 160.832952] ? netvsc_remove+0x1e/0x250 [hv_netvsc] [ 160.832952] ? __lock_is_held+0x55/0x90 [ 160.832952] netvsc_remove+0x9a/0x250 [hv_netvsc] [ 160.832952] vmbus_remove+0x26/0x30 [ 160.832952] device_release_driver_internal+0x18a/0x250 [ 160.832952] unbind_store+0xb4/0x180 [ 160.832952] kernfs_fop_write+0x113/0x1a0 [ 160.832952] __vfs_write+0x36/0x1a0 [ 160.832952] ? rcu_read_lock_sched_held+0x6b/0x80 [ 160.832952] ? rcu_sync_lockdep_assert+0x2e/0x60 [ 160.832952] ? __sb_start_write+0x141/0x1a0 [ 160.832952] ? vfs_write+0x184/0x1b0 [ 160.832952] vfs_write+0xbe/0x1b0 [ 160.832952] ksys_write+0x55/0xc0 [ 160.832952] do_syscall_64+0x60/0x1b0 [ 160.832952] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 160.832952] RIP: 0033:0x7fe48f4c8154 Resolve this by getting RTNL earlier. This is safe because the subchannel work queue does trylock on RTNL and will detect the race. Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic") Signed-off-by: Stephen Hemminger Reviewed-by: Haiyang Zhang Signed-off-by: David S. Miller commit 5fe23f262e0548ca7f19fb79f89059a60d087d22 Author: Cong Wang Date: Wed Sep 12 16:27:44 2018 -0700 ucma: fix a use-after-free in ucma_resolve_ip() There is a race condition between ucma_close() and ucma_resolve_ip(): CPU0 CPU1 ucma_resolve_ip(): ucma_close(): ctx = ucma_get_ctx(file, cmd.id); list_for_each_entry_safe(ctx, tmp, &file->ctx_list, list) { mutex_lock(&mut); idr_remove(&ctx_idr, ctx->id); mutex_unlock(&mut); ... mutex_lock(&mut); if (!ctx->closing) { mutex_unlock(&mut); rdma_destroy_id(ctx->cm_id); ... ucma_free_ctx(ctx); ret = rdma_resolve_addr(); ucma_put_ctx(ctx); Before idr_remove(), ucma_get_ctx() could still find the ctx and after rdma_destroy_id(), rdma_resolve_addr() may still access id_priv pointer. Also, ucma_put_ctx() may use ctx after ucma_free_ctx() too. ucma_close() should call ucma_put_ctx() too which tests the refcnt and waits for the last one releasing it. The similar pattern is already used by ucma_destroy_id(). Reported-and-tested-by: syzbot+da2591e115d57a9cbb8b@syzkaller.appspotmail.com Reported-by: syzbot+cfe3c1e8ef634ba8964b@syzkaller.appspotmail.com Cc: Jason Gunthorpe Cc: Doug Ledford Cc: Leon Romanovsky Signed-off-by: Cong Wang Reviewed-by: Leon Romanovsky Signed-off-by: Doug Ledford commit 831b624df1b420c8f9281ed1307a8db23afb72df Author: Bin Yang Date: Wed Sep 12 03:36:34 2018 +0000 pstore: Fix incorrect persistent ram buffer mapping persistent_ram_vmap() returns the page start vaddr. persistent_ram_iomap() supports non-page-aligned mapping. persistent_ram_buffer_map() always adds offset-in-page to the vaddr returned from these two functions, which causes incorrect mapping of non-page-aligned persistent ram buffer. By default ftrace_size is 4096 and max_ftrace_cnt is nr_cpu_ids. Without this patch, the zone_sz in ramoops_init_przs() is 4096/nr_cpu_ids which might not be page aligned. If the offset-in-page > 2048, the vaddr will be in next page. If the next page is not mapped, it will cause kernel panic: [ 0.074231] BUG: unable to handle kernel paging request at ffffa19e0081b000 ... [ 0.075000] RIP: 0010:persistent_ram_new+0x1f8/0x39f ... [ 0.075000] Call Trace: [ 0.075000] ramoops_init_przs.part.10.constprop.15+0x105/0x260 [ 0.075000] ramoops_probe+0x232/0x3a0 [ 0.075000] platform_drv_probe+0x3e/0xa0 [ 0.075000] driver_probe_device+0x2cd/0x400 [ 0.075000] __driver_attach+0xe4/0x110 [ 0.075000] ? driver_probe_device+0x400/0x400 [ 0.075000] bus_for_each_dev+0x70/0xa0 [ 0.075000] driver_attach+0x1e/0x20 [ 0.075000] bus_add_driver+0x159/0x230 [ 0.075000] ? do_early_param+0x95/0x95 [ 0.075000] driver_register+0x70/0xc0 [ 0.075000] ? init_pstore_fs+0x4d/0x4d [ 0.075000] __platform_driver_register+0x36/0x40 [ 0.075000] ramoops_init+0x12f/0x131 [ 0.075000] do_one_initcall+0x4d/0x12c [ 0.075000] ? do_early_param+0x95/0x95 [ 0.075000] kernel_init_freeable+0x19b/0x222 [ 0.075000] ? rest_init+0xbb/0xbb [ 0.075000] kernel_init+0xe/0xfc [ 0.075000] ret_from_fork+0x3a/0x50 Signed-off-by: Bin Yang [kees: add comments describing the mapping differences, updated commit log] Fixes: 24c3d2f342ed ("staging: android: persistent_ram: Make it possible to use memory outside of bootmem") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook commit f5b9bac7451cfc962970cb3fa3a7027ffa69e369 Author: Cong Wang Date: Tue Sep 11 14:22:23 2018 -0700 net_sched: notify filter deletion when deleting a chain When we delete a chain of filters, we need to notify user-space we are deleting each filters in this chain too. Fixes: 32a4f5ecd738 ("net: sched: introduce chain object to uapi") Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 37a3a98ef601f89100e3bb657fb0e190b857028c Author: Takashi Iwai Date: Mon Sep 10 16:20:25 2018 +0200 ALSA: hda - Enable runtime PM only for discrete GPU The recent change of vga_switcheroo allowed the runtime PM for HD-audio on AMD GPUs, but this also resulted in a regression. When the HD-audio controller driver gets runtime-suspended, HD-audio link is turned off, and the hotplug notification is ignored. This leads to the inconsistent audio state (the connection isn't notified and ELD is ignored). The best fix would be to implement the proper ELD notification via the audio component, but it's still not ready. As a quick workaround, this patch adds the check of runtime_idle and allows the runtime suspend only when the vga_switcheroo is bound with discrete GPU. That is, a system with a single GPU and APU would be again without runtime PM to keep the HD-audio link for the hotplug notification and ELD read out. Also, the codec->auto_runtime_pm flag is set only for the discrete GPU at the time GPU gets bound via vga_switcheroo (i.e. only dGPU is forcibly runtime-PM enabled), so that APU can still get the ELD notification. For identifying which GPU is bound, a new vga_switcheroo client callback, gpu_bound, is implemented. The vga_switcheroo simply calls this when GPU is bound, and tells whether it's dGPU or APU. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200945 Fixes: 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller") Reported-by: Jian-Hong Pan Tested-by: Jian-Hong Pan Acked-by: Lukas Wunner Signed-off-by: Takashi Iwai commit ad4f15dc2c70b1de5e0a64d27335962fbc9cf71c Author: Juergen Gross Date: Tue Sep 11 09:04:48 2018 +0200 xen/netfront: don't bug in case of too many frags Commit 57f230ab04d291 ("xen/netfront: raise max number of slots in xennet_get_responses()") raised the max number of allowed slots by one. This seems to be problematic in some configurations with netback using a larger MAX_SKB_FRAGS value (e.g. old Linux kernel with MAX_SKB_FRAGS defined as 18 instead of nowadays 17). Instead of BUG_ON() in this case just fall back to retransmission. Fixes: 57f230ab04d291 ("xen/netfront: raise max number of slots in xennet_get_responses()") Cc: stable@vger.kernel.org Signed-off-by: Juergen Gross Signed-off-by: David S. Miller commit 22d0bd82cc7cec7d9ed4bd5913f3ab65643364be Author: Xin Long Date: Tue Sep 11 14:33:58 2018 +0800 ipv6: use rt6_info members when dst is set in rt6_fill_node In inet6_rtm_getroute, since Commit 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes"), it has used rt->from to dump route info instead of rt. However for some route like cache, some of its information like flags or gateway is not the same as that of the 'from' one. It caused 'ip route get' to dump the wrong route information. In Jianlin's testing, the output information even lost the expiration time for a pmtu route cache due to the wrong fib6_flags. So change to use rt6_info members for dst addr, src addr, flags and gateway when it tries to dump a route entry without fibmatch set. v1->v2: - not use rt6i_prefsrc. - also fix the gw dump issue. Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes") Reported-by: Jianlin Shi Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 3b7d96a0dbb6b630878597a1838fc39f808b761b Author: Keerthy Date: Wed Aug 8 18:44:59 2018 +0530 clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs The 32k clocksource is NONSTOP for non-am43 SoCs. Hence add the flag for all the other SoCs. Reported-by: Tony Lindgren Signed-off-by: Keerthy Acked-by: Tony Lindgren Signed-off-by: Daniel Lezcano commit 498fe23aad8e3b5a9554f55719c537603b4476ea Author: Takashi Sakamoto Date: Thu Sep 13 21:31:18 2018 +0900 ALSA: oxfw: fix memory leak of private data Although private data of sound card instance is usually allocated in the tail of the instance, drivers in ALSA firewire stack allocate the private data before allocating the instance. In this case, the private data should be released explicitly at .private_free callback of the instance. This commit fixes memory leak following to the above design. Fixes: 6c29230e2a5f ('ALSA: oxfw: delayed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 8d28277c065a974873c6781d44b7bcdcd8fb4e8a Author: Takashi Sakamoto Date: Thu Sep 13 21:31:05 2018 +0900 ALSA: firewire-tascam: fix memory leak of private data Although private data of sound card instance is usually allocated in the tail of the instance, drivers in ALSA firewire stack allocate the private data before allocating the instance. In this case, the private data should be released explicitly at .private_free callback of the instance. This commit fixes memory leak following to the above design. Fixes: b610386c8afb ('ALSA: firewire-tascam: deleyed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit a49a83ab05e34edd6c71a4fbd062c9a7ba6d18aa Author: Takashi Sakamoto Date: Thu Sep 13 21:30:34 2018 +0900 ALSA: firewire-digi00x: fix memory leak of private data Although private data of sound card instance is usually allocated in the tail of the instance, drivers in ALSA firewire stack allocate the private data before allocating the instance. In this case, the private data should be released explicitly at .private_free callback of the instance. This commit fixes memory leak following to the above design. Fixes: 86c8dd7f4da3 ('ALSA: firewire-digi00x: delayed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 54eda9df17f3215b9ed16629ee71ea07413efdaf Merge: d3bd5973c72e 9d27e39d309c Author: Linus Torvalds Date: Wed Sep 12 19:39:56 2018 -1000 Merge tag 'pci-v4.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI fixes from Bjorn Helgaas: - Add Tyrel Datwyler as maintainer for PPC64 RPA hotplug (Tyrel Datwyler) - Add Gustavo Pimentel as DesignWare PCI maintainer (Joao Pinto) - Fix a Switchtec Spectre v1 vulnerability (Gustavo A. R. Silva) - Revert an unnecessary Intel 300 ACS quirk (Mika Westerberg) - Fix pciehp hot-add/powerfault detection that left indicators in wrong state (Keith Busch) - Fix pci_reset_bus() logic error (Dennis Dalessandro) - Revert IB/hfi1 PCI reset change that caused a deadlock (Dennis Dalessandro) - Allow enabling PASID on Root Complex Integrated Endpoints (Felix Kuehling) * tag 'pci-v4.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Fix enabling of PASID on RC integrated endpoints IB/hfi1,PCI: Allow bus reset while probing PCI: Fix faulty logic in pci_reset_bus() PCI: pciehp: Fix hot-add vs powerfault detection order switchtec: Fix Spectre v1 vulnerability Revert "PCI: Add ACS quirk for Intel 300 series" MAINTAINERS: Add Gustavo Pimentel as DesignWare PCI maintainer MAINTAINERS: Add entries for PPC64 RPA PCI hotplug drivers commit d3bd5973c72e04f03539858b9149e6b604bfb51d Merge: 7428b2e5d0b1 a8627cda7cff Author: Linus Torvalds Date: Wed Sep 12 19:33:56 2018 -1000 Merge tag 'for-linus-4.19' of git://github.com/cminyard/linux-ipmi Pull IPMI bugfixes from Corey Minyard: "A few fixes that came around or after the merge window, except for commit cd2315d471f4 ("ipmi: kcs_bmc: don't change device name") which is for a driver that very few people use, and those people need the change" * tag 'for-linus-4.19' of git://github.com/cminyard/linux-ipmi: ipmi: Fix NULL pointer dereference in ssif_probe ipmi: Fix I2C client removal in the SSIF driver ipmi: Move BT capabilities detection to the detect call ipmi: Rework SMI registration failure ipmi: kcs_bmc: don't change device name commit 3702a0585e64d70d5bf73bf3e943b8d6005b72c1 Author: Brijesh Singh Date: Wed Aug 15 16:11:25 2018 -0500 crypto: ccp - add timeout support in the SEV command Currently, the CCP driver assumes that the SEV command issued to the PSP will always return (i.e. it will never hang). But recently, firmware bugs have shown that a command can hang. Since of the SEV commands are used in probe routines, this can cause boot hangs and/or loss of virtualization capabilities. To protect against firmware bugs, add a timeout in the SEV command execution flow. If a command does not complete within the specified timeout then return -ETIMEOUT and stop the driver from executing any further commands since the state of the SEV firmware is unknown. Cc: Tom Lendacky Cc: Gary Hook Cc: Herbert Xu Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Signed-off-by: Herbert Xu commit 7428b2e5d0b195f2a5e40f91d2b41a8503fcfe68 Merge: 67b076095dd7 2887e5ce15dd Author: Linus Torvalds Date: Wed Sep 12 17:36:47 2018 -1000 Merge tag 'drm-fixes-2018-09-12' of git://anongit.freedesktop.org/drm/drm Pull drm nouveau fixes from Dave Airlie: "I'm sending this separately as it's a bit larger than I generally like for one driver, but it does contain a bunch of make my nvidia laptop not die (runpm) and a bunch to make my docking station and monitor display stuff (mst) fixes. Lyude has spent a lot of time on these, and we are putting the fixes into distro kernels as well asap, as it helps a bunch of standard Lenovo laptops, so I'm fairly happy things are better than they were before these patches, but I decided to split them out just for clarification" * tag 'drm-fixes-2018-09-12' of git://anongit.freedesktop.org/drm/drm: drm/nouveau/disp/gm200-: enforce identity-mapped SOR assignment for LVDS/eDP panels drm/nouveau/disp: fix DP disable race drm/nouveau/disp: move eDP panel power handling drm/nouveau/disp: remove unused struct member drm/nouveau/TBDdevinit: don't fail when PMU/PRE_OS is missing from VBIOS drm/nouveau/mmu: don't attempt to dereference vmm without valid instance pointer drm/nouveau: fix oops in client init failure path drm/nouveau: Fix nouveau_connector_ddc_detect() drm/nouveau/drm/nouveau: Don't forget to cancel hpd_work on suspend/unload drm/nouveau/drm/nouveau: Prevent handling ACPI HPD events too early drm/nouveau: Reset MST branching unit before enabling drm/nouveau: Only write DP_MSTM_CTRL when needed drm/nouveau: Remove useless poll_enable() call in drm_load() drm/nouveau: Remove useless poll_disable() call in switcheroo_set_state() drm/nouveau: Remove useless poll_enable() call in switcheroo_set_state() drm/nouveau: Fix deadlocks in nouveau_connector_detect() drm/nouveau/drm/nouveau: Use pm_runtime_get_noresume() in connector_detect() drm/nouveau/drm/nouveau: Fix deadlock with fb_helper with async RPM requests drm/nouveau: Remove duplicate poll_enable() in pmops_runtime_suspend() drm/nouveau/drm/nouveau: Fix bogus drm_kms_helper_poll_enable() placement commit 67b076095dd7a13ff24e9b5f830fcb1291ae0678 Merge: 96eddb810b14 4851bfd64d42 Author: Linus Torvalds Date: Wed Sep 12 17:32:50 2018 -1000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Pull networking fixes from David Miller: 1) Fix up several Kconfig dependencies in netfilter, from Martin Willi and Florian Westphal. 2) Memory leak in be2net driver, from Petr Oros. 3) Memory leak in E-Switch handling of mlx5 driver, from Raed Salem. 4) mlx5_attach_interface needs to check for errors, from Huy Nguyen. 5) tipc_release() needs to orphan the sock, from Cong Wang. 6) Need to program TxConfig register after TX/RX is enabled in r8169 driver, not beforehand, from Maciej S. Szmigiero. 7) Handle 64K PAGE_SIZE properly in ena driver, from Netanel Belgazal. 8) Fix crash regression in ip_do_fragment(), from Taehee Yoo. 9) syzbot can create conditions where kernel log is flooded with synflood warnings due to creation of many listening sockets, fix that. From Willem de Bruijn. 10) Fix RCU issues in rds socket layer, from Cong Wang. 11) Fix vlan matching in nfp driver, from Pieter Jansen van Vuuren. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (59 commits) nfp: flower: reject tunnel encap with ipv6 outer headers for offloading nfp: flower: fix vlan match by checking both vlan id and vlan pcp tipc: check return value of __tipc_dump_start() s390/qeth: don't dump past end of unknown HW header s390/qeth: use vzalloc for QUERY OAT buffer s390/qeth: switch on SG by default for IQD devices s390/qeth: indicate error when netdev allocation fails rds: fix two RCU related problems r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED erspan: fix error handling for erspan tunnel erspan: return PACKET_REJECT when the appropriate tunnel is not found tcp: rate limit synflood warnings further MIPS: lantiq: dma: add dev pointer netfilter: xt_hashlimit: use s->file instead of s->private netfilter: nfnetlink_queue: Solve the NFQUEUE/conntrack clash for NF_REPEAT netfilter: cttimeout: ctnl_timeout_find_get() returns incorrect pointer to type netfilter: conntrack: timeout interface depend on CONFIG_NF_CONNTRACK_TIMEOUT netfilter: conntrack: reset tcp maxwin on re-register qmi_wwan: Support dynamic config on Quectel EP06 ethernet: renesas: convert to SPDX identifiers ... commit 3483f08106fcd0e8edad2b9f2fc4726d25177799 Author: Ben Skeggs Date: Thu Sep 13 10:56:38 2018 +1000 drm/nouveau/devinit: fix warning when PMU/PRE_OS is missing Messed up when sending pull request and sent an outdated version of previous patch, this fixes it up to remove warnings. Signed-off-by: Ben Skeggs commit b228ba1cb95afbaeeb86cf06cd9fd6f6369c3b14 Author: Jens Axboe Date: Wed Sep 12 18:21:11 2018 -0600 null_blk: fix zoned support for non-rq based operation The supported added for zones in null_blk seem to assume that only rq based operation is possible. But this depends on the queue_mode setting, if this is set to 0, then cmd->bio is what we need to be operating on. Right now any attempt to load null_blk with queue_mode=0 will insta-crash, since cmd->rq is NULL and null_handle_cmd() assumes it to always be set. Make the zoned code deal with bio's instead, or pass in the appropriate sector/nr_sectors instead. Fixes: ca4b2a011948 ("null_blk: add zone support") Tested-by: Omar Sandoval Signed-off-by: Jens Axboe commit 097f5863b1a0c9901f180bbd56ae7d630655faaa Author: Dan Carpenter Date: Thu Sep 6 12:47:01 2018 +0300 cifs: read overflow in is_valid_oplock_break() We need to verify that the "data_offset" is within bounds. Reported-by: Dr Silvio Cesare of InfoSect Signed-off-by: Dan Carpenter Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit dfb06cba8c73c0704710b2e3fbe2c35ac66a01b4 Author: Dave Jiang Date: Wed Sep 5 13:31:40 2018 -0700 uaccess: Fix is_source param for check_copy_size() in copy_to_iter_mcsafe() copy_to_iter_mcsafe() is passing in the is_source parameter as "false" to check_copy_size(). This is different than what copy_to_iter() does. Also, the addr parameter passed to check_copy_size() is the source so therefore we should be passing in "true" instead. Fixes: 8780356ef630 ("x86/asm/memcpy_mcsafe: Define copy_to_iter_mcsafe()") Cc: Reported-by: Fan Du Signed-off-by: Dave Jiang Reviewed-by: Vishal Verma Reported-by: Wenwei Tao Signed-off-by: Dan Williams commit 4c3d795cb012a378855543a775408fba1ccff6f2 Author: Tushar Dave Date: Wed Sep 12 22:15:29 2018 +0200 bpf: use __GFP_COMP while allocating page Helper bpg_msg_pull_data() can allocate multiple pages while linearizing multiple scatterlist elements into one shared page. However, if the shared page has size > PAGE_SIZE, using copy_page_to_iter() causes below warning. e.g. [ 6367.019832] WARNING: CPU: 2 PID: 7410 at lib/iov_iter.c:825 page_copy_sane.part.8+0x0/0x8 To avoid above warning, use __GFP_COMP while allocating multiple contiguous pages. Fixes: 015632bb30da ("bpf: sk_msg program helper bpf_sk_msg_pull_data") Signed-off-by: Tushar Dave Signed-off-by: Daniel Borkmann commit 67e3816842fe6414d629c7515b955952ec40c7d7 Author: Steve Wise Date: Fri Aug 31 07:16:03 2018 -0700 RDMA/uverbs: Atomically flush and mark closed the comp event queue Currently a uverbs completion event queue is flushed of events in ib_uverbs_comp_event_close() with the queue spinlock held and then released. Yet setting ev_queue->is_closed is not set until later in uverbs_hot_unplug_completion_event_file(). In between the time ib_uverbs_comp_event_close() releases the lock and uverbs_hot_unplug_completion_event_file() acquires the lock, a completion event can arrive and be inserted into the event queue by ib_uverbs_comp_handler(). This can cause a "double add" list_add warning or crash depending on the kernel configuration, or a memory leak because the event is never dequeued since the queue is already closed down. So add setting ev_queue->is_closed = 1 to ib_uverbs_comp_event_close(). Cc: stable@vger.kernel.org Fixes: 1e7710f3f656 ("IB/core: Change completion channel to use the reworked objects schema") Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe commit dd066823db2ac4e22f721ec85190817b58059a54 Author: Alexei Starovoitov Date: Wed Sep 12 14:06:10 2018 -0700 bpf/verifier: disallow pointer subtraction Subtraction of pointers was accidentally allowed for unpriv programs by commit 82abbf8d2fc4. Revert that part of commit. Fixes: 82abbf8d2fc4 ("bpf: do not allow root to mangle valid pointers") Reported-by: Jann Horn Acked-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 4851bfd64d42d9fb6d2d30a41c8523614b412a7a Merge: 12a78b026f87 224de549f0be Author: David S. Miller Date: Wed Sep 12 13:18:30 2018 -0700 Merge branch 'nfp-flower-fixes' Jakub Kicinski says: ==================== nfp: flower: fixes for flower offload Two fixes for flower matching and tunnel encap. Pieter fixes VLAN matching if the entire VLAN id is masked out and match is only performed on the PCP field. Louis adds validation of tunnel flags for encap, most importantly we should not offload actions on IPv6 tunnels if it's not supported. ==================== Signed-off-by: David S. Miller commit 224de549f0beca58fb95c0b8da9cb2bfa8c6cc12 Author: Louis Peens Date: Tue Sep 11 06:38:45 2018 -0700 nfp: flower: reject tunnel encap with ipv6 outer headers for offloading This fixes a bug where ipv6 tunnels would report that it is getting offloaded to hardware but would actually be rejected by hardware. Fixes: b27d6a95a70d ("nfp: compile flower vxlan tunnel set actions") Signed-off-by: Louis Peens Reviewed-by: John Hurley Reviewed-by: Simon Horman Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit db191db813722297be36ffce2862e0f2b0e54d82 Author: Pieter Jansen van Vuuren Date: Tue Sep 11 06:38:44 2018 -0700 nfp: flower: fix vlan match by checking both vlan id and vlan pcp Previously we only checked if the vlan id field is present when trying to match a vlan tag. The vlan id and vlan pcp field should be treated independently. Fixes: 5571e8c9f241 ("nfp: extend flower matching capabilities") Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 12a78b026f870c575d3a98998b25084aac5b3c61 Author: Cong Wang Date: Tue Sep 11 15:12:17 2018 -0700 tipc: check return value of __tipc_dump_start() When __tipc_dump_start() fails with running out of memory, we have no reason to continue, especially we should avoid calling tipc_dump_done(). Fixes: 8f5c5fcf3533 ("tipc: call start and done ops directly in __tipc_nl_compat_dumpit()") Reported-and-tested-by: syzbot+3f8324abccfbf8c74a9f@syzkaller.appspotmail.com Cc: Jon Maloy Cc: Ying Xue Signed-off-by: Cong Wang Acked-by: Ying Xue Signed-off-by: David S. Miller commit 6b4d24de299be72d96c1f3b318905ccaaf47b904 Merge: cc4dfb7f70a3 0ac1487c4b2d Author: David S. Miller Date: Wed Sep 12 13:12:52 2018 -0700 Merge branch 'qeth-fixes' Julian Wiedmann says: ==================== s390/qeth: fixes 2018-09-12 please apply the following qeth fixes for -net. Patch 1 resolves a regression in an error path, while patch 2 enables the SG support by default that was newly introduced with 4.19. Patch 3 takes care of a longstanding problem with large-order allocations, and patch 4 fixes a potential out-of-bounds access. ==================== Signed-off-by: David S. Miller commit 0ac1487c4b2de383b91ecad1be561b8f7a2c15f4 Author: Julian Wiedmann Date: Wed Sep 12 15:31:35 2018 +0200 s390/qeth: don't dump past end of unknown HW header For inbound data with an unsupported HW header format, only dump the actual HW header. We have no idea how much payload follows it, and what it contains. Worst case, we dump past the end of the Inbound Buffer and access whatever is located next in memory. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit aec45e857c5538664edb76a60dd452e3265f37d1 Author: Wenjia Zhang Date: Wed Sep 12 15:31:34 2018 +0200 s390/qeth: use vzalloc for QUERY OAT buffer qeth_query_oat_command() currently allocates the kernel buffer for the SIOC_QETH_QUERY_OAT ioctl with kzalloc. So on systems with fragmented memory, large allocations may fail (eg. the qethqoat tool by default uses 132KB). Solve this issue by using vzalloc, backing the allocation with non-contiguous memory. Signed-off-by: Wenjia Zhang Reviewed-by: Julian Wiedmann Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 04db741d0df02fdb9ea4ddca32615153407dcf7f Author: Julian Wiedmann Date: Wed Sep 12 15:31:33 2018 +0200 s390/qeth: switch on SG by default for IQD devices Scatter-gather transmit brings a nice performance boost. Considering the rather large MTU sizes at play, it's also totally the Right Thing To Do. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 778b1ac737494cec156f17c80da44664c1f77cf6 Author: Julian Wiedmann Date: Wed Sep 12 15:31:32 2018 +0200 s390/qeth: indicate error when netdev allocation fails Bailing out on allocation error is nice, but we also need to tell the ccwgroup core that creating the qeth groupdev failed. Fixes: d3d1b205e89f ("s390/qeth: allocate netdevice early") Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 4b1c5d917d34f705096bb7dd8a2bd19b0881970e Author: Martin KaFai Lau Date: Wed Sep 12 10:29:11 2018 -0700 bpf: btf: Fix end boundary calculation for type section The end boundary math for type section is incorrect in btf_check_all_metas(). It just happens that hdr->type_off is always 0 for now because there are only two sections (type and string) and string section must be at the end (ensured in btf_parse_str_sec). However, type_off may not be 0 if a new section would be added later. This patch fixes it. Fixes: f80442a4cd18 ("bpf: btf: Change how section is supported in btf_header") Reported-by: Dmitry Vyukov Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit cf40361ede6cf9dc09349e4c049dc0d166ca2d8b Author: Guenter Roeck Date: Tue Sep 11 11:18:12 2018 -0700 x86/efi: Load fixmap GDT in efi_call_phys_epilog() before setting %cr3 Commit eeb89e2bb1ac ("x86/efi: Load fixmap GDT in efi_call_phys_epilog()") moved loading the fixmap in efi_call_phys_epilog() after load_cr3() since it was assumed to be more logical. Turns out this is incorrect: In efi_call_phys_prolog(), the gdt with its physical address is loaded first, and when the %cr3 is reloaded in _epilog from initial_page_table to swapper_pg_dir again the gdt is no longer mapped. This results in a triple fault if an interrupt occurs after load_cr3() and before load_fixmap_gdt(0). Calling load_fixmap_gdt(0) first restores the execution order prior to commit eeb89e2bb1ac and fixes the problem. Fixes: eeb89e2bb1ac ("x86/efi: Load fixmap GDT in efi_call_phys_epilog()") Signed-off-by: Guenter Roeck Signed-off-by: Thomas Gleixner Acked-by: Linus Torvalds Cc: Ard Biesheuvel Cc: linux-efi@vger.kernel.org Cc: Andy Lutomirski Cc: Joerg Roedel Link: https://lkml.kernel.org/r/1536689892-21538-1-git-send-email-linux@roeck-us.net commit 999696752db1099aba595aac4f8d881f8c7cf4e6 Author: Juergen Gross Date: Wed Sep 12 19:41:22 2018 +0200 x86/xen: Disable CPU0 hotplug for Xen PV Xen PV guests don't allow CPU0 hotplug, so disable it. Signed-off-by: Juergen Gross Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: boris.ostrovsky@oracle.com Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/20180912174122.24282-1-jgross@suse.com Signed-off-by: Ingo Molnar commit cb48b6a26cace226d8b299a48c73e808eb0c4f61 Merge: 02e184476eff 03db8b583d1c Author: Ingo Molnar Date: Wed Sep 12 21:10:05 2018 +0200 Merge tag 'perf-urgent-for-mingo-4.19-20180912' 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 finding a symbol by name when multiple maps use the same backing DSO, so we must first see if that symbol name is in the DSO, then see if it is inside the range of addresses for that specific map (Adrian Hunter) - Update the tools copies of UAPI headers, which silences the warnings emitted when building the tools and in some cases, like for the new KVM ioctls, results in 'perf trace' being able to translate that ioctl number to a string (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit b1f4ff74fcb0e82664e8633cc225c2ad4234878a Author: Paulo Zanoni Date: Mon Sep 10 10:59:56 2018 -0700 tracing/Makefile: Fix handling redefinition of CC_FLAGS_FTRACE As a Kernel developer, I make heavy use of "make targz-pkg" in order to locally compile and remotely install my development Kernels. The nice feature I rely on is that after a normal "make", "make targz-pkg" only generates the tarball without having to recompile everything. That was true until commit f28bc3c32c05 ("tracing: Handle CC_FLAGS_FTRACE more accurately"). After it, running "make targz-pkg" after "make" will recompile the whole Kernel tree, making my development workflow much slower. The Kernel is choosing to recompile everything because it claims the command line has changed. A diff of the .cmd files show a repeated -mfentry in one of the files. That is because "make targz-pkg" calls "make modules_install" and the environment is already populated with the exported variables, CC_FLAGS_FTRACE being one of them. Then, -mfentry gets duplicated because it is not protected behind an ifndef block, like -pg. To complicate the problem a little bit more, architectures can define their own version CC_FLAGS_FTRACE, so our code not only has to consider recursive Makefiles, but also architecture overrides. So in this patch we move CC_FLAGS_FTRACE up and unconditionally define it to -pg. Then we let the architecture Makefiles possibly override it, and finally append the extra options later. This ensures the variable is always fully redefined at each invocation so recursive Makefiles don't keep appending, and hopefully it maintains the intended behavior on how architectures can override the defaults.. Thanks Steven Rostedt and Vasily Gorbik for the help on this regression. Cc: Michal Marek Cc: Ingo Molnar Cc: Tvrtko Ursulin Cc: linux-kbuild@vger.kernel.org Fixes: commit f28bc3c32c05 ("tracing: Handle CC_FLAGS_FTRACE more accurately") Acked-by: Vasily Gorbik Signed-off-by: Paulo Zanoni Signed-off-by: Steven Rostedt (VMware) commit 96eddb810b146e4d364e35f38dc11d16680c66eb Merge: aeb5427218a7 e866d3e84eb7 Author: Linus Torvalds Date: Wed Sep 12 06:51:27 2018 -1000 Merge tag 'riscv-for-linus-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux Pull RISC-V fix from Palmer Dabbelt: "This contains what I hope to be the last RISC-V patch for 4.19. It fixes a bug in our initramfs support by removing some broken and obselete code" * tag 'riscv-for-linus-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: riscv: Do not overwrite initrd_start and initrd_end commit aeb5427218a72ead8be673c0fba21839d2a3bb70 Merge: 5e335542de83 c77a2fa3ff8f Author: Linus Torvalds Date: Wed Sep 12 06:44:03 2018 -1000 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Three fixes, all in drivers (qedi and iscsi target) so no wider impact even if the code changes are a bit extensive" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: qedi: Add the CRC size within iSCSI NVM image scsi: iscsi: target: Fix conn_ops double free scsi: iscsi: target: Set conn->sess to NULL when iscsi_login_set_conn_values fails commit d310959365942b100f79b56bcce859968fe7ca9c Author: Scott Branden Date: Tue Sep 11 13:26:38 2018 -0700 efi/libstub/arm: default EFI_ARMSTUB_DTB_LOADER to y Default EFI_ARMSTUB_DTB_LOADER to y to allow the dtb= command line parameter to function with efi loader. Required for development purposes and to boot on existing bootloaders that do not support devicetree provided by the firmware or by the bootloader. Fixes: 3d7ee348aa41 ("efi/libstub/arm: Add opt-in Kconfig option ...") Signed-off-by: Scott Branden Signed-off-by: Ard Biesheuvel commit 2d204ee9d671327915260071c19350d84344e096 Author: Dan Carpenter Date: Mon Sep 10 14:12:07 2018 +0300 cifs: integer overflow in in SMB2_ioctl() The "le32_to_cpu(rsp->OutputOffset) + *plen" addition can overflow and wrap around to a smaller value which looks like it would lead to an information leak. Fixes: 4a72dafa19ba ("SMB2 FSCTL and IOCTL worker function") Signed-off-by: Dan Carpenter Signed-off-by: Steve French Reviewed-by: Aurelien Aptel CC: Stable commit 56446f218af1133c802dad8e9e116f07f381846c Author: Dan Carpenter Date: Thu Sep 6 12:48:22 2018 +0300 CIFS: fix wrapping bugs in num_entries() The problem is that "entryptr + next_offset" and "entryptr + len + size" can wrap. I ended up changing the type of "entryptr" because it makes the math easier when we don't have to do so much casting. Signed-off-by: Dan Carpenter Signed-off-by: Steve French Reviewed-by: Aurelien Aptel Reviewed-by: Pavel Shilovsky CC: Stable commit 8ad8aa353524d89fa2e09522f3078166ff78ec42 Author: Dan Carpenter Date: Thu Sep 6 12:47:51 2018 +0300 cifs: prevent integer overflow in nxt_dir_entry() The "old_entry + le32_to_cpu(pDirInfo->NextEntryOffset)" can wrap around so I have added a check for integer overflow. Reported-by: Dr Silvio Cesare of InfoSect Reviewed-by: Ronnie Sahlberg Reviewed-by: Aurelien Aptel Signed-off-by: Dan Carpenter Signed-off-by: Steve French CC: Stable commit 6ee67e351cdae68b4c9c7df74124b9f9fb81e966 Author: YueHaibing Date: Wed Sep 12 03:15:30 2018 +0000 drm/fb-helper: Remove set but not used variable 'connector_funcs' Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/drm_fb_helper.c: In function 'drm_pick_crtcs': drivers/gpu/drm/drm_fb_helper.c:2373:43: warning: variable 'connector_funcs' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/1536722130-108819-1-git-send-email-yuehaibing@huawei.com commit 40ebdb8e59df36e2cc71810bd021a0808b16c956 Author: Janosch Frank Date: Wed Aug 1 11:48:28 2018 +0100 KVM: s390: Make huge pages unavailable in ucontrol VMs We currently do not notify all gmaps when using gmap_pmdp_xchg(), due to locking constraints. This makes ucontrol VMs, which is the only VM type that creates multiple gmaps, incompatible with huge pages. Also we would need to hold the guest_table_lock of all gmaps that have this vmaddr maped to synchronize access to the pmd. ucontrol VMs are rather exotic and creating a new locking concept is no easy task. Hence we return EINVAL when trying to active KVM_CAP_S390_HPAGE_1M and report it as being not available when checking for it. Fixes: a4499382 ("KVM: s390: Add huge page enablement control") Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Message-Id: <20180801112508.138159-1-frankja@linux.ibm.com> Signed-off-by: Janosch Frank commit 1843abd03250115af6cec0892683e70cf2297c25 Author: Janosch Frank Date: Thu Aug 16 09:02:31 2018 +0100 s390/mm: Check for valid vma before zapping in gmap_discard Userspace could have munmapped the area before doing unmapping from the gmap. This would leave us with a valid vmaddr, but an invalid vma from which we would try to zap memory. Let's check before using the vma. Fixes: 1e133ab296f3 ("s390/mm: split arch/s390/mm/pgtable.c") Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Reported-by: Dan Carpenter Message-Id: <20180816082432.78828-1-frankja@linux.ibm.com> Signed-off-by: Janosch Frank commit dab99a0f77e9764a00b0203d0155ca134247f461 Author: Hans Verkuil Date: Thu Aug 30 06:18:22 2018 -0400 media: staging/media/mt9t031/Kconfig: remove bogus entry The 'config SOC_CAMERA_IMX074' is a copy-and-paste error and should be removed. This Kconfig is for mt9t031 only. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9d2ac5f4bec00a0697ab77c999ef38753b3cb900 Author: Jacopo Mondi Date: Fri Aug 3 12:40:58 2018 +0200 media: i2c: mt9v111: Fix v4l2-ctrl error handling Fix error handling of v4l2_ctrl creation by inspecting the ctrl.error flag instead of testing for each returned value correctness. As reported by Dan Carpenter returning PTR_ERR() on the v4l2_ctrl_new_std() return value is also wrong, as that function return NULL on error. While at there re-order the cleanup path to respect the operation inverse order. Fixes: aab7ed1c "media: i2c: Add driver for Aptina MT9V111" Reported-by: Dan Carpenter Signed-off-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 379e36d3f591cb62e781907edafea17d75e8c1fa Author: Ludovic Desroches Date: Fri Sep 7 10:18:51 2018 +0200 ARM: dts: at91: sama5d2_ptc_ek: fix nand pinctrl The drive strength has to be set to medium otherwise some data corruption may happen. Signed-off-by: Ludovic Desroches Acked-by: Nicolas Ferre Signed-off-by: Alexandre Belloni commit 75383f8d39d4c0fb96083dd460b7b139fbdac492 Author: Yu Zhao Date: Tue Sep 11 15:15:16 2018 -0600 sound: don't call skl_init_chip() to reset intel skl soc Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which 1) sets bus->chip_init to prevent multiple entrances before device is stopped; 2) enables interrupt. We shouldn't use it for the purpose of resetting device only because 1) when we really want to initialize device, we won't be able to do so; 2) we are ready to handle interrupt yet, and kernel crashes when interrupt comes in. Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset device properly. Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe") Reviewed-by: Takashi Iwai Signed-off-by: Yu Zhao Signed-off-by: Mark Brown commit b61749a89f826eb61fc59794d9e4697bd246eb61 Author: Yu Zhao Date: Tue Sep 11 15:14:04 2018 -0600 sound: enable interrupt after dma buffer initialization In snd_hdac_bus_init_chip(), we enable interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers. If irq has been acquired and irq handler uses the dma buffer, kernel may crash when interrupt comes in. Fix the problem by postponing enabling irq after dma buffer initialization. And warn once on null dma buffer pointer during the initialization. Reviewed-by: Takashi Iwai Signed-off-by: Yu Zhao Signed-off-by: Mark Brown commit 542cedec53c9e8b73f3f05bf8468823598c50489 Author: Yu Zhao Date: Tue Sep 11 15:12:46 2018 -0600 Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation" This reverts commit 12eeeb4f4733bbc4481d01df35933fc15beb8b19. The patch doesn't fix accessing memory with null pointer in skl_interrupt(). There are two problems: 1) skl_init_chip() is called twice, before and after dma buffer is allocate. The first call sets bus->chip_init which prevents the second from initializing bus->corb.buf and rirb.buf from bus->rb.area. 2) snd_hdac_bus_init_chip() enables interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers. There is a small window which skl_interrupt() can be called if irq has been acquired. If so, it crashes when using null dma buffer pointers. Will fix the problems in the following patches. Also attaching the crash for future reference. [ 16.949148] general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI [ 16.950903] Call Trace: [ 16.950906] [ 16.950918] skl_interrupt+0x19e/0x2d6 [snd_soc_skl] [ 16.950926] ? dma_supported+0xb5/0xb5 [snd_soc_skl] [ 16.950933] __handle_irq_event_percpu+0x27a/0x6c8 [ 16.950937] ? __irq_wake_thread+0x1d1/0x1d1 [ 16.950942] ? __do_softirq+0x57a/0x69e [ 16.950944] handle_irq_event_percpu+0x95/0x1ba [ 16.950948] ? _raw_spin_unlock+0x65/0xdc [ 16.950951] ? __handle_irq_event_percpu+0x6c8/0x6c8 [ 16.950953] ? _raw_spin_unlock+0x65/0xdc [ 16.950957] ? time_cpufreq_notifier+0x483/0x483 [ 16.950959] handle_irq_event+0x89/0x123 [ 16.950962] handle_fasteoi_irq+0x16f/0x425 [ 16.950965] handle_irq+0x1fe/0x28e [ 16.950969] do_IRQ+0x6e/0x12e [ 16.950972] common_interrupt+0x7a/0x7a [ 16.950974] [ 16.951031] RIP: snd_hdac_bus_update_rirb+0x19b/0x4cf [snd_hda_core] RSP: ffff88015c807c08 [ 16.951036] ---[ end trace 58bf9ece1775bc92 ]--- Fixes: 2eeeb4f4733b ("ASoC: Intel: Skylake: Acquire irq after RIRB allocation") Signed-off-by: Yu Zhao Signed-off-by: Mark Brown commit fa108f95c6769ec15ea59b7db00454b82afc6121 Author: Martin Schwidefsky Date: Wed Sep 5 07:45:11 2018 +0200 s390/zcrypt: remove VLA usage from the AP bus The use of variable length arrays on the stack is deprecated. git commit 3d8f60d38e249f989a7fca9c2370c31c3d5487e1 "s390/zcrypt: hex string mask improvements for apmask and aqmask." added three new VLA arrays. Remove them again. Reviewed-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 422b3db2a5036add39a82425b1dd9fb6c96481e8 Author: Rishabh Bhatnagar Date: Fri Aug 31 08:43:31 2018 -0700 firmware: Fix security issue with request_firmware_into_buf() When calling request_firmware_into_buf() with the FW_OPT_NOCACHE flag it is expected that firmware is loaded into buffer from memory. But inside alloc_lookup_fw_priv every new firmware that is loaded is added to the firmware cache (fwc) list head. So if any driver requests a firmware that is already loaded the code iterates over the above mentioned list and it can end up giving a pointer to other device driver's firmware buffer. Also the existing copy may either be modified by drivers, remote processors or even freed. This causes a potential security issue with batched requests when using request_firmware_into_buf. Fix alloc_lookup_fw_priv to not add to the fwc head list if FW_OPT_NOCACHE is set, and also don't do the lookup in the list. Fixes: 0e742e9275 ("firmware: provide infrastructure to make fw caching optional") [mcgrof: broken since feature introduction on v4.8] Cc: stable@vger.kernel.org # v4.8+ Signed-off-by: Vikram Mulukutla Signed-off-by: Rishabh Bhatnagar Signed-off-by: Luis Chamberlain Signed-off-by: Greg Kroah-Hartman commit 6712cc9c22117a8af9f3df272b4a44fd2e4201cd Author: Stephen Hemminger Date: Mon Aug 20 21:16:40 2018 +0000 vmbus: don't return values for uninitalized channels For unsupported device types, the vmbus channel ringbuffer is never initialized, and therefore reading the sysfs files will return garbage or cause a kernel OOPS. Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan Cc: # 4.15 Signed-off-by: Greg Kroah-Hartman commit 029d727b4f5d7c82f78e0395a0d220271c2f92b8 Author: Wei Yongjun Date: Thu Aug 16 14:42:13 2018 -0500 fpga: dfl: fme: fix return value check in in pr_mgmt_init() In case of error, the function dfl_fme_create_region() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 29de76240e86 ("fpga: dfl: fme: add partial reconfiguration sub feature support") Signed-off-by: Wei Yongjun Acked-by: Moritz Fischer Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit de916736aaaadddbd6061472969f667b14204aa9 Author: Gustavo A. R. Silva Date: Wed Aug 15 10:50:41 2018 -0500 misc: hmc6352: fix potential Spectre v1 val is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/misc/hmc6352.c:54 compass_store() warn: potential spectre issue 'map' [r] Fix this by sanitizing val before using it to index map Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman commit 86503bd35dec0ce363e9fdbf5299927422ed3899 Author: K. Y. Srinivasan Date: Fri Aug 10 23:06:07 2018 +0000 Tools: hv: Fix a bug in the key delete code Fix a bug in the key delete code - the num_records range from 0 to num_records-1. Signed-off-by: K. Y. Srinivasan Reported-by: David Binderman Cc: Reviewed-by: Michael Kelley Signed-off-by: Greg Kroah-Hartman commit c55e9318871cd06e4aa10f5023cc2dcdfbb08577 Author: Bryant G. Ly Date: Mon Aug 6 08:31:00 2018 -0500 misc: ibmvsm: Fix wrong assignment of return code Currently the assignment is flipped and rc is always 0. Signed-off-by: Bryant G. Ly Fixes: 0eca353e7ae7 ("misc: IBM Virtual Management Channel Driver (VMC)") Reviewed-by: Bradley Warrum Cc: stable Signed-off-by: Greg Kroah-Hartman commit da1b9564e85b1d7baf66cbfabcab27e183a1db63 Author: Minchan Kim Date: Thu Aug 23 14:29:56 2018 +0900 android: binder: fix the race mmap and alloc_new_buf_locked There is RaceFuzzer report like below because we have no lock to close below the race between binder_mmap and binder_alloc_new_buf_locked. To close the race, let's use memory barrier so that if someone see alloc->vma is not NULL, alloc->vma_vm_mm should be never NULL. (I didn't add stable mark intentionallybecause standard android userspace libraries that interact with binder (libbinder & libhwbinder) prevent the mmap/ioctl race. - from Todd) " Thread interleaving: CPU0 (binder_alloc_mmap_handler) CPU1 (binder_alloc_new_buf_locked) ===== ===== // drivers/android/binder_alloc.c // #L718 (v4.18-rc3) alloc->vma = vma; // drivers/android/binder_alloc.c // #L346 (v4.18-rc3) if (alloc->vma == NULL) { ... // alloc->vma is not NULL at this point return ERR_PTR(-ESRCH); } ... // #L438 binder_update_page_range(alloc, 0, (void *)PAGE_ALIGN((uintptr_t)buffer->data), end_page_addr); // In binder_update_page_range() #L218 // But still alloc->vma_vm_mm is NULL here if (need_mm && mmget_not_zero(alloc->vma_vm_mm)) alloc->vma_vm_mm = vma->vm_mm; Crash Log: ================================================================== BUG: KASAN: null-ptr-deref in __atomic_add_unless include/asm-generic/atomic-instrumented.h:89 [inline] BUG: KASAN: null-ptr-deref in atomic_add_unless include/linux/atomic.h:533 [inline] BUG: KASAN: null-ptr-deref in mmget_not_zero include/linux/sched/mm.h:75 [inline] BUG: KASAN: null-ptr-deref in binder_update_page_range+0xece/0x18e0 drivers/android/binder_alloc.c:218 Write of size 4 at addr 0000000000000058 by task syz-executor0/11184 CPU: 1 PID: 11184 Comm: syz-executor0 Not tainted 4.18.0-rc3 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x16e/0x22c lib/dump_stack.c:113 kasan_report_error mm/kasan/report.c:352 [inline] kasan_report+0x163/0x380 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x140/0x1a0 mm/kasan/kasan.c:267 kasan_check_write+0x14/0x20 mm/kasan/kasan.c:278 __atomic_add_unless include/asm-generic/atomic-instrumented.h:89 [inline] atomic_add_unless include/linux/atomic.h:533 [inline] mmget_not_zero include/linux/sched/mm.h:75 [inline] binder_update_page_range+0xece/0x18e0 drivers/android/binder_alloc.c:218 binder_alloc_new_buf_locked drivers/android/binder_alloc.c:443 [inline] binder_alloc_new_buf+0x467/0xc30 drivers/android/binder_alloc.c:513 binder_transaction+0x125b/0x4fb0 drivers/android/binder.c:2957 binder_thread_write+0xc08/0x2770 drivers/android/binder.c:3528 binder_ioctl_write_read.isra.39+0x24f/0x8e0 drivers/android/binder.c:4456 binder_ioctl+0xa86/0xf34 drivers/android/binder.c:4596 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x154/0xd40 fs/ioctl.c:686 ksys_ioctl+0x94/0xb0 fs/ioctl.c:701 __do_sys_ioctl fs/ioctl.c:708 [inline] __se_sys_ioctl fs/ioctl.c:706 [inline] __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:706 do_syscall_64+0x167/0x4b0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe " Signed-off-by: Todd Kjos Signed-off-by: Minchan Kim Reviewed-by: Martijn Coenen Cc: stable Signed-off-by: Greg Kroah-Hartman commit 34f1166afd67f9f48a08c52f36180048908506a4 Author: Tomas Winkler Date: Mon Aug 27 22:40:16 2018 +0300 mei: bus: need to unlink client before freeing In case a client fails to connect in mei_cldev_enable(), the caller won't call the mei_cldev_disable leaving the client in a linked stated. Upon driver unload the client structure will be freed in mei_cl_bus_dev_release(), leaving a stale pointer on a fail_list. This will eventually end up in crash during power down flow in mei_cl_set_disonnected(). RIP: mei_cl_set_disconnected+0x5/0x260[mei] Call trace: mei_cl_all_disconnect+0x22/0x30 mei_reset+0x194/0x250 __synchronize_hardirq+0x43/0x50 _cond_resched+0x15/0x30 mei_me_intr_clear+0x20/0x100 mei_stop+0x76/0xb0 mei_me_shutdown+0x3f/0x80 pci_device_shutdown+0x34/0x60 kernel_restart+0x0e/0x30 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200455 Fixes: 'c110cdb17148 ("mei: bus: make a client pointer always available")' Cc: 4.10+ Tested-by: Georg Müller Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 69bf5313035926b0b6a6578de4f3168a8f5c19b8 Author: Tomas Winkler Date: Mon Aug 27 22:40:15 2018 +0300 mei: bus: fix hw module get/put balance In case the device is not connected it doesn't 'get' hw module and hence should not 'put' it on disable. Cc: 4.16+ Fixes:'commit 257355a44b99 ("mei: make module referencing local to the bus.c")' Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200455 Tested-by: Georg Müller Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit c1a214ad82d7ac6f19fe48f90b13403b40ead9dc Author: John Hubbard Date: Thu Aug 23 09:16:58 2018 +0300 mei: fix use-after-free in mei_cl_write KASAN reports a use-after-free during startup, in mei_cl_write: BUG: KASAN: use-after-free in mei_cl_write+0x601/0x870 [mei] (drivers/misc/mei/client.c:1770) This is caused by commit 98e70866aacb ("mei: add support for variable length mei headers."), which changed the return value from len, to buf->size. That ends up using a stale buf pointer, because blocking call, the cb (callback) is deleted in me_cl_complete() function. However, fortunately, len remains unchanged throughout the function (and I don't see anything else that would require re-reading buf->size either), so the fix is to simply revert the change, and return len, as before. Fixes: 98e70866aacb ("mei: add support for variable length mei headers.") CC: Arnd Bergmann CC: Greg Kroah-Hartman Signed-off-by: John Hubbard Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 8d2d8935d30cc2acc57a3196dc10dfa8d5cbcdab Author: Alexander Usyskin Date: Mon Aug 6 17:47:33 2018 +0300 mei: ignore not found client in the enumeration Some of the ME clients are available only for BIOS operation and are removed during hand off to an OS. However the removal is not instant. A client may be visible on the client list when the mei driver requests for enumeration, while the subsequent request for properties will be answered with client not found error value. The default behavior for an error is to perform client reset while this error is harmless and the link reset should be prevented. This issue started to be visible due to suspend/resume timing changes. Currently reported only on the Haswell based system. Fixes: [33.564957] mei_me 0000:00:16.0: hbm: properties response: wrong status = 1 CLIENT_NOT_FOUND [33.564978] mei_me 0000:00:16.0: mei_irq_read_handler ret = -71. [33.565270] mei_me 0000:00:16.0: unexpected reset: dev_state = INIT_CLIENTS fw status = 1E000255 60002306 00000200 00004401 00000000 00000010 Cc: Reported-by: Heiner Kallweit Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit cc4dfb7f70a344f24c1c71e298deea0771dadcb2 Author: Cong Wang Date: Mon Sep 10 18:27:26 2018 -0700 rds: fix two RCU related problems When a rds sock is bound, it is inserted into the bind_hash_table which is protected by RCU. But when releasing rds sock, after it is removed from this hash table, it is freed immediately without respecting RCU grace period. This could cause some use-after-free as reported by syzbot. Mark the rds sock with SOCK_RCU_FREE before inserting it into the bind_hash_table, so that it would be always freed after a RCU grace period. The other problem is in rds_find_bound(), the rds sock could be freed in between rhashtable_lookup_fast() and rds_sock_addref(), so we need to extend RCU read lock protection in rds_find_bound() to close this race condition. Reported-and-tested-by: syzbot+8967084bcac563795dc6@syzkaller.appspotmail.com Reported-by: syzbot+93a5839deb355537440f@syzkaller.appspotmail.com Cc: Sowmini Varadhan Cc: Santosh Shilimkar Cc: rds-devel@oss.oracle.com Signed-off-by: Cong Wang Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit 6ad569019999300afd8e614d296fdc356550b77f Author: Kai-Heng Feng Date: Tue Sep 11 01:51:43 2018 +0800 r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED After system suspend, sometimes the r8169 doesn't work when ethernet cable gets pluggued. This issue happens because rtl_reset_work() doesn't get called from rtl8169_runtime_resume(), after system suspend. In rtl_task(), RTL_FLAG_TASK_* only gets cleared if this condition is met: if (!netif_running(dev) || !test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags)) ... If RTL_FLAG_TASK_ENABLED was cleared during system suspend while RTL_FLAG_TASK_RESET_PENDING was set, the next rtl_schedule_task() won't schedule task as the flag is still there. So in addition to clearing RTL_FLAG_TASK_ENABLED, also clears other flags. Cc: Heiner Kallweit Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit 51dc63e3911fbb1f0a7a32da2fe56253e2040ea4 Author: Haishuang Yan Date: Mon Sep 10 22:19:48 2018 +0800 erspan: fix error handling for erspan tunnel When processing icmp unreachable message for erspan tunnel, tunnel id should be erspan_net_id instead of ipgre_net_id. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Cc: William Tu Signed-off-by: Haishuang Yan Acked-by: William Tu Signed-off-by: David S. Miller commit 5a64506b5c2c3cdb29d817723205330378075448 Author: Haishuang Yan Date: Mon Sep 10 22:19:47 2018 +0800 erspan: return PACKET_REJECT when the appropriate tunnel is not found If erspan tunnel hasn't been established, we'd better send icmp port unreachable message after receive erspan packets. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Cc: William Tu Signed-off-by: Haishuang Yan Acked-by: William Tu Signed-off-by: David S. Miller commit eea96566c189c77e5272585984eb2729881a2f1d Author: Sascha Hauer Date: Wed Sep 12 08:23:01 2018 +0200 ARM: dts: imx53-qsb: disable 1.2GHz OPP The maximum CPU frequency for the i.MX53 QSB is 1GHz, so disable the 1.2GHz OPP. This makes the board work again with configs that have cpufreq enabled like imx_v6_v7_defconfig on which the board stopped working with the addition of cpufreq-dt support. Fixes: 791f416608 ("ARM: dts: imx53: add cpufreq-dt support") Signed-off-by: Sascha Hauer Signed-off-by: Shawn Guo commit 0297c1c2eadb5bd996a873b87597af3b91c0d4ba Author: Willem de Bruijn Date: Sun Sep 9 19:12:12 2018 -0400 tcp: rate limit synflood warnings further Convert pr_info to net_info_ratelimited to limit the total number of synflood warnings. Commit 946cedccbd73 ("tcp: Change possible SYN flooding messages") rate limits synflood warnings to one per listener. Workloads that open many listener sockets can still see a high rate of log messages. Syzkaller is one frequent example. Signed-off-by: Willem de Bruijn Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 2d946e5bcdabc1deef72d01bc92a2801c71d6d8d Author: Hauke Mehrtens Date: Sun Sep 9 21:26:23 2018 +0200 MIPS: lantiq: dma: add dev pointer dma_zalloc_coherent() now crashes if no dev pointer is given. Add a dev pointer to the ltq_dma_channel structure and fill it in the driver using it. This fixes a bug introduced in kernel 4.19. Signed-off-by: Hauke Mehrtens Signed-off-by: David S. Miller commit 4a7f50f78c221aac7253ea7059e1986eb622b0e5 Author: Max Filippov Date: Tue Sep 11 22:12:59 2018 -0700 xtensa: enable SG chaining in Kconfig Signed-off-by: Max Filippov commit 8e966fab8eeb45db9f5a570ac4521f684d9696e1 Author: Masahiro Yamada Date: Wed Sep 12 13:25:19 2018 +0900 xtensa: remove unnecessary KBUILD_SRC ifeq conditional You can always prefix variant/platform header search paths with $(srctree)/ because $(srctree) is '.' for in-tree building. Signed-off-by: Masahiro Yamada Signed-off-by: Max Filippov commit b90ca5cc32f59bb214847c6855959702f00c6801 Author: Matthew Wilcox Date: Tue Sep 11 21:27:44 2018 -0700 filesystem-dax: Fix use of zero page Use my_zero_pfn instead of ZERO_PAGE(), and pass the vaddr to it instead of zero so it works on MIPS and s390 who reference the vaddr to select a zero page. Cc: Fixes: 91d25ba8a6b0 ("dax: use common 4k zero page for dax mmap reads") Signed-off-by: Matthew Wilcox Reviewed-by: Ross Zwisler Signed-off-by: Dan Williams commit 4ecdf770914392eb654d24f00e301d3e6afd1cfc Merge: 7c5cca358854 1286df269f49 Author: David S. Miller Date: Tue Sep 11 21:17:30 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for you net tree: 1) Remove duplicated include at the end of UDP conntrack, from Yue Haibing. 2) Restore conntrack dependency on xt_cluster, from Martin Willi. 3) Fix splat with GSO skbs from the checksum target, from Florian Westphal. 4) Rework ct timeout support, the template strategy to attach custom timeouts is not correct since it will not work in conjunction with conntrack zones and we have a possible free after use when removing the rule due to missing refcounting. To fix these problems, do not use conntrack template at all and set custom timeout on the already valid conntrack object. This fix comes with a preparation patch to simplify timeout adjustment by initializating the first position of the timeout array for all of the existing trackers. Patchset from Florian Westphal. 5) Fix missing dependency on from IPv4 chain NAT type, from Florian. 6) Release chain reference counter from the flush path, from Taehee Yoo. 7) After flushing an iptables ruleset, conntrack hooks are unregistered and entries are left stale to be cleaned up by the timeout garbage collector. No TCP tracking is done on established flows by this time. If ruleset is reloaded, then hooks are registered again and TCP tracking is restored, which considers packets to be invalid. Clear window tracking to exercise TCP flow pickup from the middle given that history is lost for us. Again from Florian. 8) Fix crash from netlink interface with CONFIG_NF_CONNTRACK_TIMEOUT=y and CONFIG_NF_CT_NETLINK_TIMEOUT=n. 9) Broken CT target due to returning incorrect type from ctnl_timeout_find_get(). 10) Solve conntrack clash on NF_REPEAT verdicts too, from Michal Vaner. 11) Missing conversion of hashlimit sysctl interface to new API, from Cong Wang. ==================== Signed-off-by: David S. Miller commit 9d27e39d309c93025ae6aa97236af15bef2a5f1f Author: Felix Kuehling Date: Mon Sep 10 15:27:42 2018 -0400 PCI: Fix enabling of PASID on RC integrated endpoints Set the eetlp_prefix_path on PCIE_EXP_TYPE_RC_END devices to allow PASID to be enabled on them. This fixes IOMMUv2 initialization on AMD Carrizo APUs. Link: https://bugzilla.kernel.org/show_bug.cgi?id=201079 Fixes: 7ce3f912ae ("PCI: Enable PASID only if entire path supports End-End TLP prefixes") Signed-off-by: Felix Kuehling Signed-off-by: Bjorn Helgaas commit bfc456060d0cbcf6902a436d358b60cb1534668c Author: Dennis Dalessandro Date: Fri Aug 31 10:34:14 2018 -0700 IB/hfi1,PCI: Allow bus reset while probing Calling into the new API to reset the secondary bus results in a deadlock. This occurs because the device/bus is already locked at probe time. Reverting back to the old behavior while the API is improved. Link: https://bugzilla.kernel.org/show_bug.cgi?id=200985 Fixes: c6a44ba950d1 ("PCI: Rename pci_try_reset_bus() to pci_reset_bus()") Fixes: 409888e0966e ("IB/hfi1: Use pci_try_reset_bus() for initiating PCI Secondary Bus Reset") Signed-off-by: Dennis Dalessandro Signed-off-by: Bjorn Helgaas Reviewed-by: Michael J. Ruhl Cc: Sinan Kaya commit d8a5281035895cdb5ff77756eff72966ec76edd0 Author: Dennis Dalessandro Date: Wed Sep 5 16:08:03 2018 +0000 PCI: Fix faulty logic in pci_reset_bus() The pci_reset_bus() function calls pci_probe_reset_slot() to determine whether to call the slot or bus reset. The check has faulty logic in that it does not account for pci_probe_reset_slot() being able to return an errno. Fix by only calling the slot reset when the function returns 0. Fixes: 811c5cb37df4 ("PCI: Unify try slot and bus reset API") Signed-off-by: Dennis Dalessandro Signed-off-by: Bjorn Helgaas Reviewed-by: Michael J. Ruhl Cc: Sinan Kaya commit 5e335542de83558e46d28de1008a1c37d5d6679a Merge: 28a0ea77ba50 52cf93e63ee6 Author: Linus Torvalds Date: Tue Sep 11 16:23:21 2018 -1000 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID fixes from Jiri Kosina: - functional regression fix for sensor-hub driver from Hans de Goede - stop doing device reset for i2c-hid devices, which unbreaks some of them (and is in line with the specification), from Kai-Heng Feng - error handling fix for hid-core from Gustavo A. R. Silva - functional regression fix for some Elan panels from Benjamin Tissoires - a few new device ID additions and misc small fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: i2c-hid: Don't reset device upon system resume HID: sensor-hub: Restore fixup for Lenovo ThinkPad Helix 2 sensor hub report HID: core: fix NULL pointer dereference HID: core: fix grouping by application HID: multitouch: fix Elan panels with 2 input modes declaration HID: hid-saitek: Add device ID for RAT 7 Contagion HID: core: fix memory leak on probe HID: input: fix leaking custom input node name HID: add support for Apple Magic Keyboards HID: i2c-hid: Fix flooded incomplete report after S3 on Rayd touchscreen HID: intel-ish-hid: Enable Sunrise Point-H ish driver commit cbe3fd39d223f14b1c60c80fe9347a3dd08c2edb Author: Dan Carpenter Date: Sat Sep 8 11:42:27 2018 +0300 scsi: qla2xxx: Fix an endian bug in fcpcmd_is_corrupted() We should first do the le16_to_cpu endian conversion and then apply the FCP_CMD_LENGTH_MASK mask. Fixes: 5f35509db179 ("qla2xxx: Terminate exchange if corrupted") Signed-off-by: Dan Carpenter Acked-by: Quinn Tran Acked-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 679fcae46c8b2352bba3485d521da070cfbe68e6 Author: Laura Abbott Date: Tue Sep 4 11:47:40 2018 -0700 scsi: iscsi: target: Don't use stack buffer for scatterlist Fedora got a bug report of a crash with iSCSI: kernel BUG at include/linux/scatterlist.h:143! ... RIP: 0010:iscsit_do_crypto_hash_buf+0x154/0x180 [iscsi_target_mod] ... Call Trace: ? iscsi_target_tx_thread+0x200/0x200 [iscsi_target_mod] iscsit_get_rx_pdu+0x4cd/0xa90 [iscsi_target_mod] ? native_sched_clock+0x3e/0xa0 ? iscsi_target_tx_thread+0x200/0x200 [iscsi_target_mod] iscsi_target_rx_thread+0x81/0xf0 [iscsi_target_mod] kthread+0x120/0x140 ? kthread_create_worker_on_cpu+0x70/0x70 ret_from_fork+0x3a/0x50 This is a BUG_ON for using a stack buffer with a scatterlist. There are two cases that trigger this bug. Switch to using a dynamically allocated buffer for one case and do not assign a NULL buffer in another case. Signed-off-by: Laura Abbott Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 71d29f43b6332badc5598c656616a62575e83342 Author: Nicholas Piggin Date: Tue Sep 11 20:48:34 2018 +1000 KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size THP paths can defer splitting compound pages until after the actual remap and TLB flushes to split a huge PMD/PUD. This causes radix partition scope page table mappings to get out of synch with the host qemu page table mappings. This results in random memory corruption in the guest when running with THP. The easiest way to reproduce is use KVM balloon to free up a lot of memory in the guest and then shrink the balloon to give the memory back, while some work is being done in the guest. Cc: David Gibson Cc: "Aneesh Kumar K.V" Cc: kvm-ppc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nicholas Piggin Signed-off-by: Paul Mackerras commit 425333bf3a7743715c17e503049d0837d6c4a603 Author: Alexey Kardashevskiy Date: Mon Sep 10 18:29:07 2018 +1000 KVM: PPC: Avoid marking DMA-mapped pages dirty in real mode At the moment the real mode handler of H_PUT_TCE calls iommu_tce_xchg_rm() which in turn reads the old TCE and if it was a valid entry, marks the physical page dirty if it was mapped for writing. Since it is in real mode, realmode_pfn_to_page() is used instead of pfn_to_page() to get the page struct. However SetPageDirty() itself reads the compound page head and returns a virtual address for the head page struct and setting dirty bit for that kills the system. This adds additional dirty bit tracking into the MM/IOMMU API for use in the real mode. Note that this does not change how VFIO and KVM (in virtual mode) set this bit. The KVM (real mode) changes include: - use the lowest bit of the cached host phys address to carry the dirty bit; - mark pages dirty when they are unpinned which happens when the preregistered memory is released which always happens in virtual mode; - add mm_iommu_ua_mark_dirty_rm() helper to set delayed dirty bit; - change iommu_tce_xchg_rm() to take the kvm struct for the mm to use in the new mm_iommu_ua_mark_dirty_rm() helper; - move iommu_tce_xchg_rm() to book3s_64_vio_hv.c (which is the only caller anyway) to reduce the real mode KVM and IOMMU knowledge across different subsystems. This removes realmode_pfn_to_page() as it is not used anymore. While we at it, remove some EXPORT_SYMBOL_GPL() as that code is for the real mode only and modules cannot call it anyway. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Paul Mackerras commit 6a92b11169a65b3f8cc512c75a252cbd0d096ba0 Author: Boris Ostrovsky Date: Tue Sep 11 15:55:38 2018 -0400 x86/EISA: Don't probe EISA bus for Xen PV guests For unprivileged Xen PV guests this is normal memory and ioremap will not be able to properly map it. While at it, since ioremap may return NULL, add a test for pointer's validity. Reported-by: Andy Smith Signed-off-by: Boris Ostrovsky Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Cc: xen-devel@lists.xenproject.org Cc: jgross@suse.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180911195538.23289-1-boris.ostrovsky@oracle.com commit 0165de983272d1fae0809ed9db47c46a412279bc Author: Christian König Date: Mon Sep 10 15:52:55 2018 +0200 drm/amdgpu: fix error handling in amdgpu_cs_user_fence_chunk Slowly leaking memory one page at a time :) Signed-off-by: Christian König Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 28a0ea77ba50fc8a9684b7af96ece05dfeb6f64b Merge: 11da3a7f84f1 8f28b178f71c Author: Linus Torvalds Date: Tue Sep 11 08:46:11 2018 -1000 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "This fixes one major regression with NFS and mlx4 due to the max_sg rework in this merge window, tidies a few minor error_path regressions, and various small fixes. The HFI1 driver is broken this cycle due to a regression caused by a PCI change, it is looking like Bjorn will merge a fix for this. Also, the lingering ipoib issue I mentioned earlier still remains unfixed. Summary: - Fix possible FD type confusion crash - Fix a user trigger-able crash in cxgb4 - Fix bad handling of IOMMU resources causing user controlled leaking in bnxt - Add missing locking in ipoib to fix a rare 'stuck tx' situation - Add missing locking in cma - Add two missing missing uverbs cleanups on failure paths, regressions from this merge window - Fix a regression from this merge window that caused RDMA NFS to not work with the mlx4 driver due to the max_sg changes" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/mlx4: Ensure that maximal send/receive SGE less than supported by HW RDMA/cma: Protect cma dev list with lock RDMA/uverbs: Fix error cleanup path of ib_uverbs_add_one() bnxt_re: Fix couple of memory leaks that could lead to IOMMU call traces IB/ipoib: Avoid a race condition between start_xmit and cm_rep_handler iw_cxgb4: only allow 1 flush on user qps IB/core: Release object lock if destroy failed RDMA/ucma: check fd type in ucma_migrate_id() commit b1f382178d150f256c1cf95b9341fda6eb764459 Author: Ross Zwisler Date: Tue Sep 11 13:31:16 2018 -0400 ext4: close race between direct IO and ext4_break_layouts() If the refcount of a page is lowered between the time that it is returned by dax_busy_page() and when the refcount is again checked in ext4_break_layouts() => ___wait_var_event(), the waiting function ext4_wait_dax_page() will never be called. This means that ext4_break_layouts() will still have 'retry' set to false, so we'll stop looping and never check the refcount of other pages in this inode. Instead, always continue looping as long as dax_layout_busy_page() gives us a page which it found with an elevated refcount. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara Signed-off-by: Jan Kara Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit 03db8b583d1c3c84963e08e2abf6c79081da5c31 Author: Adrian Hunter Date: Fri Sep 7 11:51:16 2018 +0300 perf tools: Fix maps__find_symbol_by_name() Commit 1c5aae7710bb ("perf machine: Create maps for x86 PTI entry trampolines") revealed a problem with maps__find_symbol_by_name() that resulted in probes not being found e.g. $ sudo perf probe xsk_mmap xsk_mmap is out of .text, skip it. Probe point 'xsk_mmap' not found. Error: Failed to add events. maps__find_symbol_by_name() can optionally return the map of the found symbol. It can get the map wrong because, in fact, the symbol is found on the map's dso, not allowing for the possibility that the dso has more than one map. Fix by always checking the map contains the symbol. Reported-by: Björn Töpel Signed-off-by: Adrian Hunter Tested-by: Björn Töpel Cc: Jiri Olsa Cc: stable@vger.kernel.org Fixes: 1c5aae7710bb ("perf machine: Create maps for x86 PTI entry trampolines") Link: http://lkml.kernel.org/r/20180907085116.25782-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5db48a8d01319620d390bf6d9da5410be14f98e3 Author: Arnaldo Carvalho de Melo Date: Tue Sep 11 14:10:52 2018 -0300 tools headers uapi: Update tools's copy of linux/if_link.h To get the changes in: 3e7a50ceb11e ("net: report min and max mtu network device settings") 2756f68c3149 ("net: bridge: add support for backup port") a25717d2b604 ("xdp: support simultaneous driver and hw XDP attachment") 4f91da26c811 ("xdp: add per mode attributes for attached programs") f203b76d7809 ("xfrm: Add virtual xfrm interfaces") Silencing this libbpf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h' Cc: Adrian Hunter Cc: Daniel Borkmann Cc: David Ahern Cc: David S. Miller Cc: Jakub Kicinski Cc: Jiri Olsa Cc: Namhyung Kim Cc: Nikolay Aleksandrov Cc: Steffen Klassert Cc: Stephen Hemminger Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-xd9ztioa894zemv8ag8kg64u@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 01c5f85aebaaddfd7e6051fb2ec80c1d4b463554 Author: Jens Axboe Date: Tue Sep 11 10:59:53 2018 -0600 blk-cgroup: increase number of supported policies After merging the iolatency policy, we potentially now have 4 policies being registered, but only support 3. This causes one of them to fail loading. Takashi reports that BFQ no longer works for him, because it fails to load due to policy registration failure. Bump to 5 policies, and also add a warning for when we have exceeded the global amount. If we have to touch this again, we should switch to a dynamic scheme instead. Reported-by: Takashi Iwai Reviewed-by: Jeff Moyer Tested-by: Takashi Iwai Signed-off-by: Jens Axboe commit 65aac17423284634169489f298169c3e3f099cc7 Author: Hans de Goede Date: Mon Sep 10 20:30:39 2018 +0200 staging: vboxvideo: Change address of scanout buffer on page-flip Commit 2408898e3b6c ("staging: vboxvideo: Add page-flip support") only calls vbox_crtc_do_set_base() on page-flips, but despite that function's name it only pins the new fb, unpins the old fb and sets vbox_crtc->fb_offset. It does not program the hardware to scan out at the new vbox_crtc->fb_offset value. This was causing only every other frame (assuming page-flipping between 2 buffers) to be shown since we kept scanning out of the old (now unpinned!) buffer. This commit fixes this by adding code to vbox_crtc_page_flip() to tell the hardware to scanout from the new fb_offset. Fixes: 2408898e3b6c ("staging: vboxvideo: Add page-flip support") Cc: Steve Longerbeam Signed-off-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 1ebafd1561a05ea7868f46d88420fe9323f981f6 Author: Hans de Goede Date: Mon Sep 10 20:30:38 2018 +0200 staging: vboxvideo: Fix IRQs no longer working Commit 1daddbc8dec5 ("staging: vboxvideo: Update driver to use drm_dev_register.") replaced the obsolere drm_get_pci_dev() with normal pci probe and remove functions. But the new vbox_pci_probe() is missing a pci_enable_device() call, causing interrupts to not be delivered. This causes resizes of the vm window to not get seen by the drm/kms code. This commit adds the missing pci_enable_device() call, fixing this. Fixes: 1daddbc8dec5 ("staging: vboxvideo: Update driver to use ...") Cc: Fabio Rafael da Rosa Signed-off-by: Hans de Goede Reviewed-by: Nicholas Mc Guire Signed-off-by: Greg Kroah-Hartman commit e54192b48da75f025ae4b277925eaf6aca1d13bd Author: Rob Herring Date: Tue Sep 11 09:28:14 2018 -0500 of: fix phandle cache creation for DTs with no phandles With commit 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()"), a G3 PowerMac fails to boot. The root cause is the DT for this system has no phandle properties when booted with BootX. of_populate_phandle_cache() does not handle the case of no phandles correctly. The problem is roundup_pow_of_two() for 0 is undefined. The implementation subtracts 1 underflowing and then things are in the weeds. Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()") Cc: stable@vger.kernel.org # 4.17+ Reported-by: Finn Thain Tested-by: Stan Johnson Reviewed-by: Frank Rowand Cc: Benjamin Herrenschmidt Signed-off-by: Rob Herring commit 7f28785c41f4d5635e69c183b3de8ea19093ccef Author: Arnaldo Carvalho de Melo Date: Tue Sep 11 13:12:40 2018 -0300 tools headers uapi: Update tools's copy of linux/vhost.h To get the changes in: c48300c92ad9 ("vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition") This makes 'perf trace' and other tools in the future using its beautifiers in a libbeauty.so library be able to translate these new ioctl to strings: $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > /tmp/after $ diff -u /tmp/before /tmp/after --- /tmp/before 2018-09-11 13:10:57.923038244 -0300 +++ /tmp/after 2018-09-11 13:11:20.329012685 -0300 @@ -15,6 +15,7 @@ [0x22] = "SET_VRING_ERR", [0x23] = "SET_VRING_BUSYLOOP_TIMEOUT", [0x24] = "GET_VRING_BUSYLOOP_TIMEOUT", + [0x25] = "SET_BACKEND_FEATURES", [0x30] = "NET_SET_BACKEND", [0x40] = "SCSI_SET_ENDPOINT", [0x41] = "SCSI_CLEAR_ENDPOINT", @@ -27,4 +28,5 @@ static const char *vhost_virtio_ioctl_read_cmds[] = { [0x00] = "GET_FEATURES", [0x12] = "GET_VRING_BASE", + [0x26] = "GET_BACKEND_FEATURES", }; $ We'll also use this to be able to express syscall filters using symbolic these symbolic names, something like: # perf trace --all-cpus -e ioctl(cmd=*GET_FEATURES) This silences the following warning during perf's build: Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h' diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h Cc: Adrian Hunter Cc: David Ahern Cc: David S. Miller Cc: Gleb Fotengauer-Malinovskiy Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-35x71oei2hdui9u0tarpimbq@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Arnaldo Carvalho de Melo commit 0210c156d7fd330bce1c2c842bee9d27f1c5dfeb Author: Arnaldo Carvalho de Melo Date: Tue Sep 11 11:18:58 2018 -0300 tools headers uapi: Update tools's copies of kvm headers To get the changes in: a449938297e5 ("KVM: s390: Add huge page enablement control") 8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE") be26b3a73413 ("arm64: KVM: export the capability to set guest SError syndrome") b7b27facc7b5 ("arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS") b0960b9569db ("KVM: arm: Add 32bit get/set events support") a3da7b4a3be5 ("KVM: s390: add etoken support for guests") This makes 'perf trace' automagically get aware of these new ioctls: $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h $ tools/perf/trace/beauty/kvm_ioctl.sh > /tmp/after $ diff -u /tmp/before /tmp/after --- /tmp/before 2018-09-11 11:18:29.173207586 -0300 +++ /tmp/after 2018-09-11 11:18:38.488200446 -0300 @@ -84,6 +84,8 @@ [0xbb] = "MEMORY_ENCRYPT_REG_REGION", [0xbc] = "MEMORY_ENCRYPT_UNREG_REGION", [0xbd] = "HYPERV_EVENTFD", + [0xbe] = "GET_NESTED_STATE", + [0xbf] = "SET_NESTED_STATE", [0xe0] = "CREATE_DEVICE", [0xe1] = "SET_DEVICE_ATTR", [0xe2] = "G And cures the following warning during perf's build: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Adrian Hunter Cc: Christian Borntraeger Cc: Cornelia Huck Cc: David Ahern Cc: David Hildenbrand Cc: Dongjiu Geng Cc: Eduardo Habkost Cc: James Morse Cc: Janosch Frank Cc: Jim Mattson Cc: Jiri Olsa Cc: Marc Zyngier Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-2vvwh2o19orn56di0ksrtgzr@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Arnaldo Carvalho de Melo commit 10492ee8ed9188d6d420e1f79b2b9bdbc0624e65 Author: Tony Lindgren Date: Wed Apr 25 07:29:22 2018 -0700 mfd: omap-usb-host: Fix dts probe of children It currently only works if the parent bus uses "simple-bus". We currently try to probe children with non-existing compatible values. And we're missing .probe. I noticed this while testing devices configured to probe using ti-sysc interconnect target module driver. For that we also may want to rebind the driver, so let's remove __init and __exit. Signed-off-by: Tony Lindgren Acked-by: Roger Quadros Signed-off-by: Lee Jones commit 17dc7af70e89db773a7213f0b4270c69236a63ab Author: Chris Wilson Date: Thu Sep 6 20:01:43 2018 +0100 drm/i915/overlay: Allocate physical registers from stolen Given that we are now reasonably confident in our ability to detect and reserve the stolen memory (physical memory reserved for graphics by the BIOS) for ourselves on most machines, we can put it to use. In this case, we need a page to hold the overlay registers. On an i915g running MythTv, H Buus noticed that commit 6a2c4232ece145d8b5a8f95f767bd6d0d2d2f2bb Author: Chris Wilson Date: Tue Nov 4 04:51:40 2014 -0800 drm/i915: Make the physical object coherent with GTT introduced stuttering into his video playback. After discarding the likely suspect of it being the physical cursor updates, we were left with the use of the phys object for the overlay. And lo, if we completely avoid using the phys object (allocated just once on module load!) by switching to stolen memory, the stuttering goes away. For lack of a better explanation, claim victory and kill two birds with one stone. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107600 Fixes: 6a2c4232ece1 ("drm/i915: Make the physical object coherent with GTT") Signed-off-by: Chris Wilson Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180906190144.1272-1-chris@chris-wilson.co.uk (cherry picked from commit c8124d399224d626728e2ffb95a1d564a7c06968) Signed-off-by: Rodrigo Vivi commit 9f34519a82356f6cf0ccb8480ee0ed99b3d0af75 Author: Steve Wise Date: Fri Aug 31 11:52:00 2018 -0700 cxgb4: fix abort_req_rss6 struct Remove the incorrect WR_HDR field which can cause a misinterpretation of ABORT CPL by ULDs, such as iw_cxgb4. Fixes: a3cdaa69e4ae ("cxgb4: Adds CPL support for Shared Receive Queues") Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe commit 434ea1bfbfc707f5fed9292df6a9b91dfb8e41f2 Author: Arnaldo Carvalho de Melo Date: Tue Sep 11 11:07:56 2018 -0300 tools headers uapi: Update tools's copy of drm/drm.h To get the changes in: d67b6a206507 ("drm: writeback: Add client capability for exposing writeback connectors") This is for an argument to a DRM ioctl, which is not being prettyfied in the 'perf trace' DRM ioctl beautifier, but will now that syscalls are starting to have pointer arguments augmented via BPF. This time around this just cures the following warning during perf's build: Warning: Kernel ABI header at 'tools/include/uapi/drm/drm.h' differs from latest version at 'include/uapi/drm/drm.h' diff -u tools/include/uapi/drm/drm.h include/uapi/drm/drm.h Cc: Adrian Hunter Cc: Brian Starkey Cc: David Ahern Cc: Eric Anholt Cc: Jiri Olsa Cc: Liviu Dudau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sean Paul Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-n7qib1bac6mc6w9oke7r4qdc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Arnaldo Carvalho de Melo commit f9e6e4351e0bb0811a8b3696679cc6050e4f5947 Author: Arnaldo Carvalho de Melo Date: Tue Sep 11 11:00:54 2018 -0300 tools headers uapi: Update tools's copy of asm-generic/unistd.h To get the changes in: db7a2d1809a5 ("asm-generic: unistd.h: Wire up sys_rseq") That wires up the new 'rsec' system call, which will automagically support that syscall in the syscall table used by 'perf trace' on arm/arm64. This cures the following warning during perf's build: Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h' diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Arnd Bergmann Cc: David Ahern Cc: Hendrik Brueckner Cc: Jiri Olsa Cc: Kim Phillips Cc: Mathieu Desnoyers Cc: Michael Ellerman Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Thomas Richter Cc: Wang Nan Cc: Will Deacon Link: https://lkml.kernel.org/n/tip-vt7k2itnitp1t9p3dp7qeb08@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0ee03d936cbb300309ed6154ac1cc12b63e9785f Author: Arnaldo Carvalho de Melo Date: Tue Sep 11 10:57:13 2018 -0300 tools headers uapi: Update tools's copy of linux/perf_event.h To get the changes in: 09121255c784 ("perf/UAPI: Clearly mark __PERF_SAMPLE_CALLCHAIN_EARLY as internal use") This cures the following warning during perf's build: Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h' diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h Cc: Peter Zijlstra Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-2vvwh2o19orn56di0ksrtgzr@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 34fb6bf9b13aef4ca14224f2175ecd189e98160b Author: Keith Busch Date: Wed Sep 5 14:35:41 2018 -0600 PCI: pciehp: Fix hot-add vs powerfault detection order If both hot-add and power fault were observed in a single interrupt, we handled the hot-add first, then the power fault, in this path: pciehp_ist if (events & (PDC | DLLSC)) pciehp_handle_presence_or_link_change case OFF_STATE: pciehp_enable_slot __pciehp_enable_slot board_added pciehp_power_on_slot ctrl->power_fault_detected = 0 pcie_write_cmd(ctrl, PCI_EXP_SLTCTL_PWR_ON, PCI_EXP_SLTCTL_PCC) pciehp_green_led_on(p_slot) # power LED on pciehp_set_attention_status(p_slot, 0) # attention LED off if ((events & PFD) && !ctrl->power_fault_detected) ctrl->power_fault_detected = 1 pciehp_set_attention_status(1) # attention LED on pciehp_green_led_off(slot) # power LED off This left the attention indicator on (even though the hot-add succeeded) and the power indicator off (even though the slot power was on). Fix this by checking for power faults before checking for new devices. Prior to 0e94916e6091, this was successful because everything was chained through work queues and the order was: INT_PRESENCE_ON -> INT_POWER_FAULT -> ENABLE_REQ The ENABLE_REQ cleared the power fault at the end, but now everything is handled inline with the interrupt thread, such that the work ENABLE_REQ was doing happens before power fault handling now. Fixes: 0e94916e6091 ("PCI: pciehp: Handle events synchronously") Signed-off-by: Keith Busch [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner commit 46feb6b495f7628a6dbf36c4e6d80faf378372d4 Author: Gustavo A. R. Silva Date: Thu Aug 16 14:06:46 2018 -0500 switchtec: Fix Spectre v1 vulnerability p.port can is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/pci/switch/switchtec.c:912 ioctl_port_to_pff() warn: potential spectre issue 'pcfg->dsp_pff_inst_id' [r] Fix this by sanitizing p.port before using it to index pcfg->dsp_pff_inst_id Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Bjorn Helgaas Acked-by: Logan Gunthorpe Cc: stable@vger.kernel.org commit 50ca031b51106b1b46162d4e9ecccb7edc95682f Author: Mika Westerberg Date: Wed Sep 5 14:09:54 2018 +0300 Revert "PCI: Add ACS quirk for Intel 300 series" This reverts f154a718e6cc ("PCI: Add ACS quirk for Intel 300 series"). It turns out that erratum "PCH PCIe* Controller Root Port (ACSCTLR) Appear As Read Only" has been fixed in 300 series chipsets, even though the datasheet [1] claims otherwise. To make ACS work properly on 300 series root ports, revert the faulty commit. [1] https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/300-series-c240-series-chipset-pch-spec-update.pdf Fixes: f154a718e6cc ("PCI: Add ACS quirk for Intel 300 series") Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v4.18+ commit f30cf498b4277dcb20514f3f1daa89c2281f3395 Author: Joao Pinto Date: Tue Sep 11 13:06:30 2018 +0100 MAINTAINERS: Add Gustavo Pimentel as DesignWare PCI maintainer Currently I am managing the Synopsys drivers & tools team (full-time) and so I am passing the pcie-designware maintenance to Gustavo. Signed-off-by: Joao Pinto Signed-off-by: Bjorn Helgaas CC: Gustavo Pimentel CC: Jingoo Han commit c3f00182a83b590655cb68b43b9dcc6cdd05316a Author: Tyrel Datwyler Date: Thu Sep 6 14:16:53 2018 -0500 MAINTAINERS: Add entries for PPC64 RPA PCI hotplug drivers Add myself as maintainer of the IBM RPA hotplug modules in the drivers/pci/hotplug directory. These modules provide kernel interfaces for support of Dynamic Logical Partitioning (DLPAR) of Logical and Physical IO slots, and hotplug of physical PCI slots of a PHB on RPA-compliant ppc64 platforms (pseries). Signed-off-by: Tyrel Datwyler Signed-off-by: Bjorn Helgaas commit e6a57d22f787e73635ce0d29eef0abb77928b3e9 Author: Hermes Zhang Date: Tue Aug 28 09:48:30 2018 +0800 Bluetooth: hci_ldisc: Free rw_semaphore on close The percpu_rw_semaphore is not currently freed, and this leads to a crash when the stale rcu callback is invoked. DEBUG_OBJECTS detects this. ODEBUG: free active (active state 1) object type: rcu_head hint: (null) ------------[ cut here ]------------ WARNING: CPU: 1 PID: 2024 at debug_print_object+0xac/0xc8 PC is at debug_print_object+0xac/0xc8 LR is at debug_print_object+0xac/0xc8 Call trace: [] debug_print_object+0xac/0xc8 [] debug_check_no_obj_freed+0x1e8/0x228 [] kfree+0x1cc/0x250 [] hci_uart_tty_close+0x54/0x108 [] tty_ldisc_close.isra.1+0x40/0x58 [] tty_ldisc_kill+0x1c/0x40 [] tty_ldisc_release+0x94/0x170 [] tty_release_struct+0x1c/0x58 [] tty_release+0x3b0/0x490 [] __fput+0x88/0x1d0 [] ____fput+0xc/0x18 [] task_work_run+0x9c/0xc0 [] do_exit+0x24c/0x8a0 [] do_group_exit+0x38/0xa0 [] __wake_up_parent+0x0/0x28 [] el0_svc_naked+0x34/0x38 ---[ end trace bfe08cbd89098cdf ]--- Signed-off-by: Hermes Zhang Signed-off-by: Marcel Holtmann commit 4ba5175f2c10affd412fa41855cecda02b66cd71 Author: Matias Karhumaa Date: Tue Sep 11 14:10:13 2018 +0300 Bluetooth: Use correct tfm to generate OOB data In case local OOB data was generated and other device initiated pairing claiming that it has got OOB data, following crash occurred: [ 222.847853] general protection fault: 0000 [#1] SMP PTI [ 222.848025] CPU: 1 PID: 42 Comm: kworker/u5:0 Tainted: G C 4.18.0-custom #4 [ 222.848158] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 222.848307] Workqueue: hci0 hci_rx_work [bluetooth] [ 222.848416] RIP: 0010:compute_ecdh_secret+0x5a/0x270 [bluetooth] [ 222.848540] Code: 0c af f5 48 8b 3d 46 de f0 f6 ba 40 00 00 00 be c0 00 60 00 e8 b7 7b c5 f5 48 85 c0 0f 84 ea 01 00 00 48 89 c3 e8 16 0c af f5 <49> 8b 47 38 be c0 00 60 00 8b 78 f8 48 83 c7 48 e8 51 84 c5 f5 48 [ 222.848914] RSP: 0018:ffffb1664087fbc0 EFLAGS: 00010293 [ 222.849021] RAX: ffff8a5750d7dc00 RBX: ffff8a5671096780 RCX: ffffffffc08bc32a [ 222.849111] RDX: 0000000000000000 RSI: 00000000006000c0 RDI: ffff8a5752003800 [ 222.849192] RBP: ffffb1664087fc60 R08: ffff8a57525280a0 R09: ffff8a5752003800 [ 222.849269] R10: ffffb1664087fc70 R11: 0000000000000093 R12: ffff8a5674396e00 [ 222.849350] R13: ffff8a574c2e79aa R14: ffff8a574c2e796a R15: 020e0e100d010101 [ 222.849429] FS: 0000000000000000(0000) GS:ffff8a5752500000(0000) knlGS:0000000000000000 [ 222.849518] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 222.849586] CR2: 000055856016a038 CR3: 0000000110d2c005 CR4: 00000000000606e0 [ 222.849671] Call Trace: [ 222.849745] ? sc_send_public_key+0x110/0x2a0 [bluetooth] [ 222.849825] ? sc_send_public_key+0x115/0x2a0 [bluetooth] [ 222.849925] smp_recv_cb+0x959/0x2490 [bluetooth] [ 222.850023] ? _cond_resched+0x19/0x40 [ 222.850105] ? mutex_lock+0x12/0x40 [ 222.850202] l2cap_recv_frame+0x109d/0x3420 [bluetooth] [ 222.850315] ? l2cap_recv_frame+0x109d/0x3420 [bluetooth] [ 222.850426] ? __switch_to_asm+0x34/0x70 [ 222.850515] ? __switch_to_asm+0x40/0x70 [ 222.850625] ? __switch_to_asm+0x34/0x70 [ 222.850724] ? __switch_to_asm+0x40/0x70 [ 222.850786] ? __switch_to_asm+0x34/0x70 [ 222.850846] ? __switch_to_asm+0x40/0x70 [ 222.852581] ? __switch_to_asm+0x34/0x70 [ 222.854976] ? __switch_to_asm+0x40/0x70 [ 222.857475] ? __switch_to_asm+0x40/0x70 [ 222.859775] ? __switch_to_asm+0x34/0x70 [ 222.861218] ? __switch_to_asm+0x40/0x70 [ 222.862327] ? __switch_to_asm+0x34/0x70 [ 222.863758] l2cap_recv_acldata+0x266/0x3c0 [bluetooth] [ 222.865122] hci_rx_work+0x1c9/0x430 [bluetooth] [ 222.867144] process_one_work+0x210/0x4c0 [ 222.868248] worker_thread+0x41/0x4d0 [ 222.869420] kthread+0x141/0x160 [ 222.870694] ? process_one_work+0x4c0/0x4c0 [ 222.871668] ? kthread_create_worker_on_cpu+0x90/0x90 [ 222.872896] ret_from_fork+0x35/0x40 [ 222.874132] Modules linked in: algif_hash algif_skcipher af_alg rfcomm bnep btusb btrtl btbcm btintel snd_intel8x0 cmac intel_rapl_perf vboxvideo(C) snd_ac97_codec bluetooth ac97_bus joydev ttm snd_pcm ecdh_generic drm_kms_helper snd_timer snd input_leds drm serio_raw fb_sys_fops soundcore syscopyarea sysfillrect sysimgblt mac_hid sch_fq_codel ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip_tables x_tables autofs4 btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic usbhid hid crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel aes_x86_64 crypto_simd cryptd glue_helper ahci psmouse libahci i2c_piix4 video e1000 pata_acpi [ 222.883153] fbcon_switch: detected unhandled fb_set_par error, error code -16 [ 222.886774] fbcon_switch: detected unhandled fb_set_par error, error code -16 [ 222.890503] ---[ end trace 6504aa7a777b5316 ]--- [ 222.890541] RIP: 0010:compute_ecdh_secret+0x5a/0x270 [bluetooth] [ 222.890551] Code: 0c af f5 48 8b 3d 46 de f0 f6 ba 40 00 00 00 be c0 00 60 00 e8 b7 7b c5 f5 48 85 c0 0f 84 ea 01 00 00 48 89 c3 e8 16 0c af f5 <49> 8b 47 38 be c0 00 60 00 8b 78 f8 48 83 c7 48 e8 51 84 c5 f5 48 [ 222.890555] RSP: 0018:ffffb1664087fbc0 EFLAGS: 00010293 [ 222.890561] RAX: ffff8a5750d7dc00 RBX: ffff8a5671096780 RCX: ffffffffc08bc32a [ 222.890565] RDX: 0000000000000000 RSI: 00000000006000c0 RDI: ffff8a5752003800 [ 222.890571] RBP: ffffb1664087fc60 R08: ffff8a57525280a0 R09: ffff8a5752003800 [ 222.890576] R10: ffffb1664087fc70 R11: 0000000000000093 R12: ffff8a5674396e00 [ 222.890581] R13: ffff8a574c2e79aa R14: ffff8a574c2e796a R15: 020e0e100d010101 [ 222.890586] FS: 0000000000000000(0000) GS:ffff8a5752500000(0000) knlGS:0000000000000000 [ 222.890591] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 222.890594] CR2: 000055856016a038 CR3: 0000000110d2c005 CR4: 00000000000606e0 This commit fixes a bug where invalid pointer to crypto tfm was used for SMP SC ECDH calculation when OOB was in use. Solution is to use same crypto tfm than when generating OOB material on generate_oob() function. This bug was introduced in commit c0153b0b901a ("Bluetooth: let the crypto subsystem generate the ecc privkey"). Bug was found by fuzzing kernel SMP implementation using Synopsys Defensics. Signed-off-by: Matias Karhumaa Signed-off-by: Johan Hedberg Signed-off-by: Marcel Holtmann commit 94f14e4728125f979629b2b020d31cd718191626 Author: Johan Hedberg Date: Tue Sep 11 14:10:12 2018 +0300 Bluetooth: SMP: Fix trying to use non-existent local OOB data A remote device may claim that it has received our OOB data, even though we never geneated it. Add a new flag to track whether we actually have OOB data, and ignore the remote peer's flag if haven't generated OOB data. Signed-off-by: Johan Hedberg Signed-off-by: Marcel Holtmann commit 84c57dbd3c480fb2730c393a2cef994ddb4f42cc Author: James Morse Date: Mon Sep 10 15:20:54 2018 +0100 arm64: kernel: arch_crash_save_vmcoreinfo() should depend on CONFIG_CRASH_CORE Since commit 23c85094fe18 ("proc/kcore: add vmcoreinfo note to /proc/kcore") the kernel has exported the vmcoreinfo PT_NOTE on /proc/kcore as well as /proc/vmcore. arm64 only exposes it's additional arch information via arch_crash_save_vmcoreinfo() if built with CONFIG_KEXEC, as kdump was previously the only user of vmcoreinfo. Move this weak function to a separate file that is built at the same time as its caller in kernel/crash_core.c. This ensures values like 'kimage_voffset' are always present in the vmcoreinfo PT_NOTE. CC: AKASHI Takahiro Reviewed-by: Bhupesh Sharma Signed-off-by: James Morse Signed-off-by: Will Deacon commit 13aceef06adfaf93d52e01e28a8bc8a0ad471d83 Author: Miguel Ojeda Date: Sun Sep 9 17:47:31 2018 +0200 arm64: jump_label.h: use asm_volatile_goto macro instead of "asm goto" All other uses of "asm goto" go through asm_volatile_goto, which avoids a miscompile when using GCC < 4.8.2. Replace our open-coded "asm goto" statements with the asm_volatile_goto macro to avoid issues with older toolchains. Cc: Catalin Marinas Reviewed-by: Nick Desaulniers Signed-off-by: Miguel Ojeda Signed-off-by: Will Deacon commit 9e1437937807b0122e8da1ca8765be2adca9aee6 Author: Steffen Klassert Date: Tue Sep 11 10:31:15 2018 +0200 xfrm: Fix NULL pointer dereference when skb_dst_force clears the dst_entry. Since commit 222d7dbd258d ("net: prevent dst uses after free") skb_dst_force() might clear the dst_entry attached to the skb. The xfrm code don't expect this to happen, so we crash with a NULL pointer dereference in this case. Fix it by checking skb_dst(skb) for NULL after skb_dst_force() and drop the packet in cast the dst_entry was cleared. Fixes: 222d7dbd258d ("net: prevent dst uses after free") Reported-by: Tobias Hommel Reported-by: Kristian Evensen Reported-by: Wolfgang Walter Signed-off-by: Steffen Klassert commit a6ae928c25835ca18deb4a527079f169b68ed292 Author: Petr Mladek Date: Mon Sep 10 15:52:06 2018 +0200 Revert "printk: make sure to print log on console." This reverts commit 375899cddcbb26881b03cb3fbdcfd600e4e67f4a. The visibility of early messages did not longer take into account "quiet", "debug", and "loglevel" early parameters. It would be possible to invalidate and recompute LOG_NOCONS flag for the affected messages. But it would be hairy. Instead this patch just reverts the problematic commit. We could come up with a better solution for the original problem. For example, we could simplify the logic and just mark messages that should always be visible or always invisible on the console. Also this patch reverts the related build fix commit ffaa619af1b06 ("printk: Fix warning about unused suppress_message_printing"). Finally, this patch does not put back the unused LOG_NOCONS flag. Link: http://lkml.kernel.org/r/20180910145747.emvfzv4mzlk5dfqk@pathway.suse.cz Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H . Peter Anvin" Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Cc: Steven Rostedt Cc: Maninder Singh Reported-by: Hans de Goede Acked-by: Hans de Goede Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 2887e5ce15ddaa2f9a19e66f7462bbf0fe6867e0 Merge: 11da3a7f84f1 53b0cc46f27c Author: Dave Airlie Date: Tue Sep 11 16:54:40 2018 +1000 Merge branch 'linux-4.19' of git://github.com/skeggsb/linux into drm-fixes A bunch of fixes for MST/runpm problems and races, as well as fixes for issues that prevent more recent laptops from booting. Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/CABDvA==GF63dy8a9j611=-0x8G6FRu7uC-ZQypsLO_hqV4OAcA@mail.gmail.com commit 3a74987b24279d242d17f522f8435f1942a3c948 Author: Emily Deng Date: Mon Sep 10 17:51:31 2018 +0800 drm/amdgpu: move PSP init prior to IH in gpu reset since we use PSP to program IH regs now Signed-off-by: Monk Liu Acked-by: Christian König Reviewed-by: Huang Rui Signed-off-by: Emily Deng Signed-off-by: Alex Deucher commit 68ebc13ea40656fddd3803735d621921a2d74a5e Author: Tao Zhou Date: Fri Sep 7 13:50:31 2018 +0800 drm/amdgpu: Fix SDMA hang in prt mode v2 Fix SDMA hang in prt mode, clear XNACK_WATERMARK in reg SDMA0_UTCL1_WATERMK to avoid the issue Affected ASICs: VEGA10 VEGA12 RV1 RV2 v2: add reg clear for SDMA1 Signed-off-by: Tao Zhou Tested-by: Yukun Li Reviewed-by: Hawking Zhang Acked-by: Christian König Signed-off-by: Alex Deucher commit b463d4e53ca9bdbf227e19b477fbfcdedaa14c84 Author: Christian König Date: Mon Sep 3 10:51:51 2018 +0200 drm/amdgpu: fix amdgpu_mn_unlock() in the CS error path Avoid unlocking a lock we never locked. Signed-off-by: Christian König Reviewed-by: Junwei Zhang Signed-off-by: Alex Deucher commit 5c41aaad409c097cf1ef74f2c649fed994744ef5 Author: Randy Dunlap Date: Sun Jul 22 16:03:58 2018 -0700 hexagon: modify ffs() and fls() to return int Building drivers/mtd/nand/raw/nandsim.c on arch/hexagon/ produces a printk format build warning. This is due to hexagon's ffs() being coded as returning long instead of int. Fix the printk format warning by changing all of hexagon's ffs() and fls() functions to return int instead of long. The variables that they return are already int instead of long. This return type matches the return type in . ../drivers/mtd/nand/raw/nandsim.c: In function 'init_nandsim': ../drivers/mtd/nand/raw/nandsim.c:760:2: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long int' [-Wformat] There are no ffs() or fls() allmodconfig build errors after making this change. Signed-off-by: Randy Dunlap Cc: Richard Kuo Cc: linux-hexagon@vger.kernel.org Cc: Geert Uytterhoeven Patch-mainline: linux-kernel @ 07/22/2018, 16:03 Signed-off-by: Richard Kuo commit 200f351e27f014fcbf69b544b0b4b72aeaf45fd3 Author: Randy Dunlap Date: Fri Jul 20 20:17:35 2018 -0700 arch/hexagon: fix kernel/dma.c build warning Fix build warning in arch/hexagon/kernel/dma.c by casting a void * to unsigned long to match the function parameter type. ../arch/hexagon/kernel/dma.c: In function 'arch_dma_alloc': ../arch/hexagon/kernel/dma.c:51:5: warning: passing argument 2 of 'gen_pool_add' makes integer from pointer without a cast [enabled by default] ../include/linux/genalloc.h:112:19: note: expected 'long unsigned int' but argument is of type 'void *' Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Patch-mainline: linux-kernel @ 07/20/2018, 20:17 [rkuo@codeaurora.org: fixed architecture name] Signed-off-by: Richard Kuo commit 1286df269f498165061e0cf8092ca212545dbb5a Author: Cong Wang Date: Wed Sep 5 11:41:31 2018 -0700 netfilter: xt_hashlimit: use s->file instead of s->private After switching to the new procfs API, it is supposed to retrieve the private pointer from PDE_DATA(file_inode(s->file)), s->private is no longer referred. Fixes: 1cd671827290 ("netfilter/x_tables: switch to proc_create_seq_private") Reported-by: Sami Farin Signed-off-by: Cong Wang Acked-by: Christoph Hellwig Tested-by: Sami Farin Signed-off-by: Pablo Neira Ayuso commit ad18d7bf68a3da860ebb62a59c449804a6d237b4 Author: Michal 'vorner' Vaner Date: Tue Sep 4 13:25:44 2018 +0200 netfilter: nfnetlink_queue: Solve the NFQUEUE/conntrack clash for NF_REPEAT NF_REPEAT places the packet at the beginning of the iptables chain instead of accepting or rejecting it right away. The packet however will reach the end of the chain and continue to the end of iptables eventually, so it needs the same handling as NF_ACCEPT and NF_DROP. Fixes: 368982cd7d1b ("netfilter: nfnetlink_queue: resolve clash for unconfirmed conntracks") Signed-off-by: Michal 'vorner' Vaner Signed-off-by: Pablo Neira Ayuso commit 99e25d071fca91eb90ffa2f51240547a69137bde Author: Pablo Neira Ayuso Date: Mon Sep 3 13:53:22 2018 +0200 netfilter: cttimeout: ctnl_timeout_find_get() returns incorrect pointer to type Compiler did not catch incorrect typing in the rcu hook assignment. % nfct add timeout test-tcp inet tcp established 100 close 10 close_wait 10 % iptables -I OUTPUT -t raw -p tcp -j CT --timeout test-tcp dmesg - xt_CT: Timeout policy `test-tcp' can only be used by L3 protocol number 25000 The CT target bails out with incorrect layer 3 protocol number. Fixes: 6c1fd7dc489d ("netfilter: cttimeout: decouple timeout policy from nfnetlink_cttimeout object") Reported-by: Harsha Sharma Signed-off-by: Pablo Neira Ayuso commit a874752a10da113f513980e28f562d946d3f829d Author: Pablo Neira Ayuso Date: Fri Aug 31 12:36:01 2018 +0200 netfilter: conntrack: timeout interface depend on CONFIG_NF_CONNTRACK_TIMEOUT Now that cttimeout support for nft_ct is in place, these should depend on CONFIG_NF_CONNTRACK_TIMEOUT otherwise we can crash when dumping the policy if this option is not enabled. [ 71.600121] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 [...] [ 71.600141] CPU: 3 PID: 7612 Comm: nft Not tainted 4.18.0+ #246 [...] [ 71.600188] Call Trace: [ 71.600201] ? nft_ct_timeout_obj_dump+0xc6/0xf0 [nft_ct] Signed-off-by: Pablo Neira Ayuso commit f94e63801ab2791ed64c409d0f751f6a0c953ead Author: Florian Westphal Date: Fri Aug 24 23:22:08 2018 +0200 netfilter: conntrack: reset tcp maxwin on re-register Doug Smythies says: Sometimes it is desirable to temporarily disable, or clear, the iptables rule set on a computer being controlled via a secure shell session (SSH). While unwise on an internet facing computer, I also do it often on non-internet accessible computers while testing. Recently, this has become problematic, with the SSH session being dropped upon re-load of the rule set. The problem is that when all rules are deleted, conntrack hooks get unregistered. In case the rules are re-added later, its possible that tcp window has moved far enough so that all packets are considered invalid (out of window) until entry expires (which can take forever, default established timeout is 5 days). Fix this by clearing maxwin of existing tcp connections on register. v2: don't touch entries on hook removal. v3: remove obsolete expiry check. Reported-by: Doug Smythies Fixes: 4d3a57f23dec59 ("netfilter: conntrack: do not enable connection tracking unless needed") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 3ab91828166895600efd9cdc3a0eb32001f7204a Author: Joe Thornber Date: Mon Sep 10 16:50:09 2018 +0100 dm thin metadata: try to avoid ever aborting transactions Committing a transaction can consume some metadata of it's own, we now reserve a small amount of metadata to cover this. Free metadata reported by the kernel will not include this reserve. If any of the reserve has been used after a commit we enter a new internal state PM_OUT_OF_METADATA_SPACE. This is reported as PM_READ_ONLY, so no userland changes are needed. If the metadata device is resized the pool will move back to PM_WRITE. These changes mean we never need to abort and rollback a transaction due to running out of metadata space. This is particularly important because there have been a handful of reports of data corruption against DM thin-provisioning that can all be attributed to the thin-pool having ran out of metadata space. Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer commit ff0e9f26288d2daee4950f42b37a3d3d30d36ec1 Author: Mario Limonciello Date: Mon Sep 10 13:01:53 2018 -0500 platform/x86: alienware-wmi: Correct a memory leak An ACPI buffer that was allocated was not being freed after use. Signed-off-by: Mario Limonciello Cc: stable@vger.kernel.org Signed-off-by: Darren Hart (VMware) commit affab51082174f60ef71ced8ab5fbe71f00e9ae3 Author: Mario Limonciello Date: Mon Sep 10 13:01:52 2018 -0500 platform/x86: dell-smbios-wmi: Correct a memory leak ACPI buffers were being allocated but never freed. Reported-by: Pinzhen Xu Signed-off-by: Mario Limonciello Cc: stable@vger.kernel.org Signed-off-by: Darren Hart (VMware) commit fcb74da1eb8edd3a4ef9b9724f88ed709d684227 Author: Emil Lundmark Date: Mon May 28 16:27:11 2018 +0200 drm: udl: Destroy framebuffer only if it was initialized This fixes a NULL pointer dereference that can happen if the UDL driver is unloaded before the framebuffer is initialized. This can happen e.g. if the USB device is unplugged right after it was plugged in. As explained by Stéphane Marchesin: It happens when fbdev is disabled (which is the case for Chrome OS). Even though intialization of the fbdev part is optional (it's done in udlfb_create which is the callback for fb_probe()), the teardown isn't optional (udl_driver_unload -> udl_fbdev_cleanup -> udl_fbdev_destroy). Note that udl_fbdev_cleanup *tries* to be conditional (you can see it does if (!udl->fbdev)) but that doesn't work, because udl->fbdev is always set during udl_fbdev_init. Cc: stable@vger.kernel.org Suggested-by: Sean Paul Reviewed-by: Sean Paul Acked-by: Daniel Vetter Signed-off-by: Emil Lundmark Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180528142711.142466-1-lndmrk@chromium.org Signed-off-by: Sean Paul commit 3510e7a7f91088159bfc67e8abdc9f9e77d28870 Author: Chen-Yu Tsai Date: Mon Aug 27 16:39:50 2018 +0800 drm/sun4i: Remove R40 display pipeline compatibles Two patches from the R40 display pipeline support series weren't applied with the rest of the series. When they did get applied, the -rc6 deadline for drm-misc-next had past, so they didn't get into 4.19-rc1 with the rest of the series. However, the two patches are crucial in the parsing of the R40's display pipeline graph in the device tree. Without them, the driver crashes because it can't follow the odd graph structure. This patch removes the R40 compatibles from the sun4i-drm driver, effectively disabling DRM support for the R40 for one release cycle. This will prevent the driver from crashing upon probing. The compatibles should be reinstated for the next release. Signed-off-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180827083950.602-1-wens@csie.org Signed-off-by: Sean Paul commit 7eb33224572636248d5b6cfa1a6b2472207be5c4 Author: zhong jiang Date: Sat Aug 4 18:49:27 2018 +0800 drm/pl111: Make sure of_device_id tables are NULL terminated We prefer to of_device_id tables are NULL terminated. So make vexpress_muxfpga_match is NULL terminated. Signed-off-by: zhong jiang Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/1533379767-15629-1-git-send-email-zhongjiang@huawei.com Signed-off-by: Sean Paul commit 658d8cbd07dae22ccecf49399e18c609c4e85c53 Author: Boris Brezillon Date: Wed Jul 25 14:29:07 2018 +0200 drm/vc4: Fix the "no scaling" case on multi-planar YUV formats When there's no scaling requested ->is_unity should be true no matter the format. Also, when no scaling is requested and we have a multi-planar YUV format, we should leave ->y_scaling[0] to VC4_SCALING_NONE and only set ->x_scaling[0] to VC4_SCALING_PPF. Doing this fixes an hardly visible artifact (seen when using modetest and a rather big overlay plane in YUV420). Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.") Cc: Signed-off-by: Boris Brezillon Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180725122907.13702-1-boris.brezillon@bootlin.com Signed-off-by: Sean Paul commit 50cbc03e509676a558cc9ac1c448d5c17beee2c2 Merge: 92a680314946 792fab2c0d45 Author: Rodrigo Vivi Date: Mon Sep 10 12:37:34 2018 -0700 Merge tag 'gvt-fixes-2018-09-10' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2018-09-10 - KVM mm access reference fix (Zhenyu) - Fix child device config length for virtual opregion (Weinan) Signed-off-by: Rodrigo Vivi From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20180910092212.GZ20737@zhen-hp.sh.intel.com commit df3aa13c7bbb307e172c37f193f9a7aa058d4739 Author: Oliver Neukum Date: Wed Sep 5 17:56:46 2018 +0200 Revert "cdc-acm: implement put_char() and flush_chars()" This reverts commit a81cf9799ad7299b03a4dff020d9685f9ac5f3e0. The patch causes a regression, which I cannot find the reason for. So let's revert for now, as a revert hurts only performance. Original report: I was trying to resolve the problem with Oliver but we don't get any conclusion for 5 months, so I am now sending this to mail list and cdc_acm authors. I am using simple request-response protocol to obtain the boiller parameters in constant intervals. A simple one transaction is: 1. opening the /dev/ttyACM0 2. sending the following 10-bytes request to the device: unsigned char req[] = {0x02, 0xfe, 0x01, 0x05, 0x08, 0x02, 0x01, 0x69, 0xab, 0x03}; 3. reading response (frame of 74 bytes length). 4. closing the descriptor I am doing this transaction with 5 seconds intervals. Before the bad commit everything was working correctly: I've got a requests and a responses in a timely manner. After the bad commit more time I am using the kernel module, more problems I have. The graph [2] is showing the problem. As you can see after module load all seems fine but after about 30 minutes I've got a plenty of EAGAINs when doing read()'s and trying to read back the data. When I rmmod and insmod the cdc_acm module again, then the situation is starting over again: running ok shortly after load, and more time it is running, more EAGAINs I have when calling read(). As a bonus I can see the problem on the device itself: The device is configured as you can see here on this screen [3]. It has two transmision LEDs: TX and RX. Blink duration is set for 100ms. This is a recording before the bad commit when all is working fine: [4] And this is with the bad commit: [5] As you can see the TX led is blinking wrongly long (indicating transmission?) and I have problems doing read() calls (EAGAIN). Reported-by: Mariusz Bialonczyk Signed-off-by: Oliver Neukum Fixes: a81cf9799ad7 ("cdc-acm: implement put_char() and flush_chars()") Cc: stable Signed-off-by: Greg Kroah-Hartman commit fa827966090e2a6fc07b437d0d2ffae748ec6e28 Author: Yoshihiro Shimoda Date: Mon Aug 20 12:10:26 2018 +0900 usb: Change usb_of_get_companion_dev() place to usb/common Since renesas_usb3 udc driver calls usb_of_get_companion_dev() which is on usb/core/of.c, build error like below happens if we disable CONFIG_USB because the usb/core/ needs CONFIG_USB: ERROR: "usb_of_get_companion_dev" [drivers/usb/gadget/udc/renesas_usb3.ko] undefined! According to the usb/gadget/Kconfig, "NOTE: Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !!". So, to fix the issue, this patch changes the usb_of_get_companion_dev() place from usb/core/of.c to usb/common/common.c to be called by both host and gadget. Reported-by: John Garry Fixes: 39facfa01c9f ("usb: gadget: udc: renesas_usb3: Add register of usb role switch") Signed-off-by: Yoshihiro Shimoda Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 0a3b53305c8ff427bbc1d9d5bd78524007f19600 Author: Chunfeng Yun Date: Fri Sep 7 15:29:12 2018 +0800 usb: xhci: fix interrupt transfer error happened on MTK platforms The MTK xHCI controller use some reserved bytes in endpoint context for bandwidth scheduling, so need keep them in xhci_endpoint_copy(); The issue is introduced by: commit f5249461b504 ("xhci: Clear the host side toggle manually when endpoint is soft reset") It resets endpoints and will drop bandwidth scheduling parameters used by interrupt or isochronous endpoints on MTK xHCI controller. Fixes: f5249461b504 ("xhci: Clear the host side toggle manually when endpoint is soft reset") Cc: stable@vger.kernel.org Signed-off-by: Chunfeng Yun Tested-by: Sean Wang Signed-off-by: Greg Kroah-Hartman commit 7c5cca3588545e7f255171e28e0dd6e384ebb91d Author: Kristian Evensen Date: Sat Sep 8 13:50:48 2018 +0200 qmi_wwan: Support dynamic config on Quectel EP06 Quectel EP06 (and EM06/EG06) supports dynamic configuration of USB interfaces, without the device changing VID/PID or configuration number. When the configuration is updated and interfaces are added/removed, the interface numbers change. This means that the current code for matching EP06 does not work. This patch removes the current EP06 interface number match, and replaces it with a match on class, subclass and protocol. Unfortunately, matching on those three alone is not enough, as the diag interface exports the same values as QMI. The other serial interfaces + adb export different values and do not match. The diag interface only has two endpoints, while the QMI interface has three. I have therefore added a check for number of interfaces, and we ignore the interface if the number of endpoints equals two. Signed-off-by: Kristian Evensen Acked-by: Bjørn Mork Acked-by: Dan Williams Signed-off-by: David S. Miller commit 92a6803149465e2339f8f7f8f6415d75be80073d Author: Imre Deak Date: Wed Sep 5 13:00:05 2018 +0300 drm/i915/bdw: Increase IPS disable timeout to 100ms During IPS disabling the current 42ms timeout value leads to occasional timeouts, increase it to 100ms which seems to get rid of the problem. References: https://bugs.freedesktop.org/show_bug.cgi?id=107494 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107562 Reported-by: Diego Viola Tested-by: Diego Viola Cc: Diego Viola Cc: Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180905100005.7663-1-imre.deak@intel.com (cherry picked from commit acb3ef0ee40ea657280a4a11d9f60eb2937c0dca) Signed-off-by: Rodrigo Vivi commit 3ebb17446b954b7d39264564ec3f7522d502e785 Author: Kuninori Morimoto Date: Fri Sep 7 02:02:45 2018 +0000 ethernet: renesas: convert to SPDX identifiers This patch updates license to use SPDX-License-Identifier instead of verbose license text. Signed-off-by: Kuninori Morimoto Signed-off-by: David S. Miller commit 00a99339f0a30b593d06f31499c4bbd965979567 Author: Vineet Gupta Date: Fri Sep 7 15:13:10 2018 -0700 ARCv2: build: use mcpu=hs38 iso generic mcpu=archs helps gcc with better instruction selections such as 64-bit multiply MPYD before ------ 82c34b58 : 82c34b58: ld r2,[0x83068d00] 82c34b60: add_s r2,r2,0x7530 82c34b66: mov_s r0,0x989680 82c34b6c: mpymu r5,r2,r0 82c34b70: mpy r4,r2,r0 82c34b74: mov_s r0,r4 82c34b76: j_s.d [blink] 82c34b78: mov_s r1,r5 82c34b7a: nop_s after ------ 82c34b7c : 82c34b7c: ld r0,[0x83064d00] 82c34b84: add_s r0,r0,0x7530 82c34b8a: mpydu r0,r0,0x989680 82c34b92: j_s [blink] Signed-off-by: Vineet Gupta commit 383584157786e09fed6d9e87b2cd8784b6709216 Author: Ahmed S. Darwish Date: Mon Sep 10 15:28:37 2018 +0000 staging: gasket: TODO: re-implement using UIO The gasket in-kernel framework, recently introduced under staging, re-implements what is already long-time provided by the UIO subsystem, with extra PCI BAR remapping and MSI conveniences. Before moving it out of staging, make sure we add the new bits to the UIO framework instead, then transform its signle client, the Apex driver, to a proper UIO driver (uio_driver.h). Link: https://lkml.kernel.org/r/20180828103817.GB1397@do-kernel Signed-off-by: Ahmed S. Darwish Signed-off-by: Greg Kroah-Hartman commit 7f2bf7840b74a160f908db83bc8829f8de10629b Author: Nicholas Piggin Date: Sun Sep 9 15:39:16 2018 +1000 tty: hvc: hvc_write() fix break condition Commit 550ddadcc758 ("tty: hvc: hvc_write() may sleep") broke the termination condition in case the driver stops accepting characters. This can result in unnecessary polling of the busy driver. Restore it by testing the hvc_push return code. Tested-by: Matteo Croce Tested-by: Jason Gunthorpe Tested-by: Leon Romanovsky Signed-off-by: Nicholas Piggin Signed-off-by: Greg Kroah-Hartman commit 68b2fc714fb1e08385f9c810d84f06affd007350 Author: Nicholas Piggin Date: Sun Sep 9 15:39:15 2018 +1000 tty: hvc: hvc_poll() fix read loop batching Commit ec97eaad1383 ("tty: hvc: hvc_poll() break hv read loop") removes get_chars batching entirely, which slows down large console operations like paste -- virtio console "feels worse than a 9600 baud serial line," reports Matteo. This adds back batching in a more latency friendly way. If the caller can sleep then we try to fill the entire flip buffer, releasing the lock and scheduling between each iteration. If it can not sleep, then batches are limited to 128 bytes. Matteo confirms this fixes the performance problem. Latency testing the powerpc OPAL console with OpenBMC UART with a large paste shows about 0.25ms latency, which seems reasonable. 10ms latencies were typical for this case before the latency breaking work, so we still see most of the benefit. kopald-1204 0d.h. 5us : hvc_poll <-hvc_handle_interrupt kopald-1204 0d.h. 5us : __hvc_poll <-hvc_handle_interrupt kopald-1204 0d.h. 5us : _raw_spin_lock_irqsave <-__hvc_poll kopald-1204 0d.h. 5us : tty_port_tty_get <-__hvc_poll kopald-1204 0d.h. 6us : _raw_spin_lock_irqsave <-tty_port_tty_get kopald-1204 0d.h. 6us : _raw_spin_unlock_irqrestore <-tty_port_tty_get kopald-1204 0d.h. 6us : tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 7us : __tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 7us+: opal_get_chars <-__hvc_poll kopald-1204 0d.h. 36us : tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 36us : __tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 36us+: opal_get_chars <-__hvc_poll kopald-1204 0d.h. 65us : tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 65us : __tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 66us+: opal_get_chars <-__hvc_poll kopald-1204 0d.h. 94us : tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 95us : __tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 95us+: opal_get_chars <-__hvc_poll kopald-1204 0d.h. 124us : tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 124us : __tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 125us+: opal_get_chars <-__hvc_poll kopald-1204 0d.h. 154us : tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 154us : __tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 154us+: opal_get_chars <-__hvc_poll kopald-1204 0d.h. 183us : tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 184us : __tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 184us+: opal_get_chars <-__hvc_poll kopald-1204 0d.h. 213us : tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 213us : __tty_buffer_request_room <-__hvc_poll kopald-1204 0d.h. 213us+: opal_get_chars <-__hvc_poll kopald-1204 0d.h. 242us : _raw_spin_unlock_irqrestore <-__hvc_poll kopald-1204 0d.h. 242us : tty_flip_buffer_push <-__hvc_poll kopald-1204 0d.h. 243us : queue_work_on <-tty_flip_buffer_push kopald-1204 0d.h. 243us : tty_kref_put <-__hvc_poll kopald-1204 0d.h. 243us : hvc_kick <-hvc_handle_interrupt kopald-1204 0d.h. 243us : wake_up_process <-hvc_kick kopald-1204 0d.h. 244us : try_to_wake_up <-hvc_kick kopald-1204 0d.h. 244us : _raw_spin_lock_irqsave <-try_to_wake_up kopald-1204 0d.h. 244us : _raw_spin_unlock_irqrestore <-try_to_wake_up Reported-by: Matteo Croce Tested-by: Matteo Croce Tested-by: Jason Gunthorpe Tested-by: Leon Romanovsky Signed-off-by: Nicholas Piggin Signed-off-by: Greg Kroah-Hartman commit 6e7f6b82c60afb46ff71c2127421c66207966d6d Author: Nicholas Piggin Date: Sun Sep 9 15:39:14 2018 +1000 tty: hvc: hvc_poll() fix read loop hang Commit ec97eaad1383 ("tty: hvc: hvc_poll() break hv read loop") causes the virtio console to hang at times (e.g., if you paste a bunch of characters to it. The reason is that get_chars must return 0 before we can be sure the driver will kick or poll input again, but this change only scheduled a poll if get_chars had returned a full count. Change this to poll on any > 0 count. Reported-by: Matteo Croce Reported-by: Jason Gunthorpe Tested-by: Matteo Croce Tested-by: Jason Gunthorpe Tested-by: Leon Romanovsky Signed-off-by: Nicholas Piggin Signed-off-by: Greg Kroah-Hartman commit a318c2432218d3cd189ec8228b8a795666899c2a Author: Philipp Zabel Date: Fri Aug 31 14:34:02 2018 +0200 mfd: da9063: Fix DT probing with constraints Commit 1c892e38ce59 ("regulator: da9063: Handle less LDOs on DA9063L") reordered the da9063_regulator_info[] array, but not the DA9063_ID_* regulator ids and not the da9063_matches[] array, because ids are used as indices in the array initializer. This mismatch between regulator id and da9063_regulator_info[] array index causes the driver probe to fail because constraints from DT are not applied to the correct regulator: da9063 0-0058: Device detected (chip-ID: 0x61, var-ID: 0x50) DA9063_BMEM: Bringing 900000uV into 3300000-3300000uV DA9063_LDO9: Bringing 3300000uV into 2500000-2500000uV DA9063_LDO1: Bringing 900000uV into 3300000-3300000uV DA9063_LDO1: failed to apply 3300000-3300000uV constraint(-22) This patch reorders the DA9063_ID_* as apparently intended, and with them the entries in the da90630_matches[] array. Fixes: 1c892e38ce59 ("regulator: da9063: Handle less LDOs on DA9063L") Signed-off-by: Philipp Zabel Reviewed-by: Marek Vasut Reviewed-by: Geert Uytterhoeven Signed-off-by: Lee Jones commit 49434c6c575d2008c0abbc93e615019f39e01252 Author: Willy Tarreau Date: Sat Sep 8 08:12:21 2018 +0200 ALSA: emu10k1: fix possible info leak to userspace on SNDRV_EMU10K1_IOCTL_INFO snd_emu10k1_fx8010_ioctl(SNDRV_EMU10K1_IOCTL_INFO) allocates memory using kmalloc() and partially fills it by calling snd_emu10k1_fx8010_info() before returning the resulting structure to userspace, leaving uninitialized holes. Let's just use kzalloc() here. BugLink: http://blog.infosectcbr.com.au/2018/09/linux-kernel-infoleaks.html Signed-off-by: Willy Tarreau Cc: Jann Horn Cc: Signed-off-by: Takashi Iwai commit 90a3b7f8aba3011badacd6d8121e03aa24ac79d1 Author: Sébastien Szymanski Date: Thu Sep 6 11:16:00 2018 +0200 ASoC: cs4265: fix MMTLR Data switch control The MMTLR bit is in the CS4265_SPDIF_CTL2 register at address 0x12 bit 0 and not at address 0x0 bit 1. Fix this. Signed-off-by: Sébastien Szymanski Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit bf93585ee1e25461426c61e5ff64a3acd9e30e88 Merge: d5274b3cd6a8 8407879c4e0d Author: Jens Axboe Date: Mon Sep 10 08:16:56 2018 -0600 Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linus Pull single NVMe fix from Christoph. * 'nvme-4.19' of git://git.infradead.org/nvme: nvmet-rdma: fix possible bogus dereference under heavy load commit 21a268069203cc72d1b2990bc68386516fabc274 Author: Miquel Raynal Date: Fri Sep 7 16:29:54 2018 +0200 mtd: rawnand: marvell: prevent harmless warnings Since the addition of WARN_ON() in nand_subop_get_data/addr_len() helpers, this driver will produce harmless warnings (mostly at probe) just because it always calls the nand_subop_get_data_len() helper in the parsing function (even on non-data instructions, where this value is meaningless and unneeded). Fix these warnings by deriving the length only when it is relevant. Fixes: 760c435e0f85 ("mtd: rawnand: make subop helpers return unsigned values") Signed-off-by: Miquel Raynal Signed-off-by: Boris Brezillon commit 07e846bace717729fd20b5d99521a5f8c7d7a9cb Author: Randy Dunlap Date: Sun Aug 5 20:34:05 2018 -0700 x86/doc: Fix Documentation/x86/earlyprintk.txt Fix a few issues in Documentation/x86/earlyprintk.txt: - correct typos, punctuation, missing word, wrong word - change product name from Netchip to NetChip - expand where to add "earlyprintk=dbg" Signed-off-by: Randy Dunlap Cc: Eric W. Biederman Cc: Jason Wessel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yinghai Lu Cc: linux-doc@vger.kernel.org Cc: linux-usb@vger.kernel.org Link: http://lkml.kernel.org/r/d0c40ac3-7659-6374-dbda-23d3d2577f30@infradead.org Signed-off-by: Ingo Molnar commit 02e184476eff848273826c1d6617bb37e5bcc7ad Author: Yabin Cui Date: Thu Aug 23 15:59:35 2018 -0700 perf/core: Force USER_DS when recording user stack data Perf can record user stack data in response to a synchronous request, such as a tracepoint firing. If this happens under set_fs(KERNEL_DS), then we end up reading user stack data using __copy_from_user_inatomic() under set_fs(KERNEL_DS). I think this conflicts with the intention of using set_fs(KERNEL_DS). And it is explicitly forbidden by hardware on ARM64 when both CONFIG_ARM64_UAO and CONFIG_ARM64_PAN are used. So fix this by forcing USER_DS when recording user stack data. Signed-off-by: Yabin Cui Acked-by: Peter Zijlstra (Intel) Cc: Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: 88b0193d9418 ("perf/callchain: Force USER_DS when invoking perf_callchain_user()") Link: http://lkml.kernel.org/r/20180823225935.27035-1-yabinc@google.com Signed-off-by: Ingo Molnar commit 0b405c65ad459f5f4d3db1672246172bd19d946d Author: Colin Ian King Date: Fri Aug 24 12:22:35 2018 +0100 locking/ww_mutex: Fix spelling mistake "cylic" -> "cyclic" Trivial fix to spelling mistake in pr_err() error message Signed-off-by: Colin Ian King Acked-by: Will Deacon Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: kernel-janitors@vger.kernel.org Link: http://lkml.kernel.org/r/20180824112235.8842-1-colin.king@canonical.com Signed-off-by: Ingo Molnar commit dc5591a03f1d6dae6b11cdf1d74b023f7ac0fdbf Author: Ben Hutchings Date: Tue Aug 28 21:33:15 2018 +0100 locking/lockdep: Delete unnecessary #include Commit: c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") added the inclusion of . liblockdep doesn't have a stub version of that header so now fails to build. However, commit: bff1b208a5d1 ("tracing: Partial revert of "tracing: Centralize preemptirq tracepoints and unify their usage"") removed the use of functions declared in that header. So delete the #include. Signed-off-by: Ben Hutchings Cc: Joel Fernandes Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Will Deacon Fixes: bff1b208a5d1 ("tracing: Partial revert of "tracing: Centralize ...") Fixes: c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints ...") Link: http://lkml.kernel.org/r/20180828203315.GD18030@decadent.org.uk Signed-off-by: Ingo Molnar commit 16214312df6d5aaa5324864d032ce565e97f8890 Author: Sasha Levin Date: Mon Aug 13 19:05:39 2018 +0000 tools/lib/lockdep: Add dummy task_struct state member Commit: 8cc05c71ba5f ("locking/lockdep: Move sanity check to inside lockdep_print_held_locks()") added accesses to the task_struct's state member. Add dummy userspace declaration. Signed-off-by: Sasha Levin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180813190527.16853-4-alexander.levin@microsoft.com Signed-off-by: Ingo Molnar commit 1064ea494bb00519c6e34f791dcf17436f70592d Author: Sasha Levin Date: Mon Aug 13 19:05:38 2018 +0000 tools/lib/lockdep: Add empty nmi.h Required since: 88f1c87de11a8 ("locking/lockdep: Avoid triggering hardlockup from debug_show_all_locks()") Signed-off-by: Sasha Levin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180813190527.16853-3-alexander.levin@microsoft.com Signed-off-by: Ingo Molnar commit 83e01228cb35823f7bd0e5a0584e24ed72a8af2b Author: Sasha Levin Date: Mon Aug 13 19:05:37 2018 +0000 tools/lib/lockdep: Update Sasha Levin email to MSFT Signed-off-by: Sasha Levin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180813190527.16853-2-alexander.levin@microsoft.com Signed-off-by: Ingo Molnar commit 2a665dba016d5493c7d826fec82b0cb643b30d42 Author: Akshu Agrawal Date: Mon Sep 10 13:36:30 2018 +0530 ASoC: AMD: Ensure reset bit is cleared before configuring HW register descriptions says: "DMA Channel Reset...Software must confirm that this bit is cleared before reprogramming any of the channel configuration registers." There could be cases where dma stop errored out leaving dma channel in reset state. We need to ensure that before the start of another dma, channel is out of the reset state. Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit 8c25741aaad8be6fbe51510e917c740e0059cf83 Author: Miklos Szeredi Date: Mon Sep 10 11:43:29 2018 +0200 ovl: fix oopses in ovl_fill_super() failure paths ovl_free_fs() dereferences ofs->workbasedir and ofs->upper_mnt in cases when those might not have been initialized yet. Fix the initialization order for these fields. Reported-by: syzbot+c75f181dc8429d2eb887@syzkaller.appspotmail.com Signed-off-by: Miklos Szeredi Cc: # v4.15 Fixes: 95e6d4177cb7 ("ovl: grab reference to workbasedir early") Fixes: a9075cdb467d ("ovl: factor out ovl_free_fs() helper") commit f8ff6b2d4a51f08ff53360aab633ba6d4f2d54b6 Author: Daniel Vetter Date: Wed Sep 5 17:40:09 2018 +0200 staging/fbtft: Update TODO and mailing lists Motivated by the ksummit-discuss discussion. Cc: Shuah Khan Cc: Thomas Petazzoni Cc: Mauro Carvalho Chehab Cc: linux-fbdev@vger.kernel.org Signed-off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman commit 882a78a9f39f5535b209b4aa0a1741e35b8c67fb Author: Randy Dunlap Date: Mon Sep 3 12:53:17 2018 -0700 sched/fair: Fix kernel-doc notation warning Fix kernel-doc warning for missing 'flags' parameter description: ../kernel/sched/fair.c:3371: warning: Function parameter or member 'flags' not described in 'attach_entity_load_avg' Signed-off-by: Randy Dunlap Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: ea14b57e8a18 ("sched/cpufreq: Provide migration hint") Link: http://lkml.kernel.org/r/cdda0d42-880d-4229-a9f7-5899c977a063@infradead.org Signed-off-by: Ingo Molnar commit da260fe12330be8b003c2ab07a112704163ea675 Author: Borislav Petkov Date: Fri Sep 7 12:35:21 2018 +0200 jump_label: Fix typo in warning message There's no 'allocatote' - use the next best thing: 'allocate' :-) Signed-off-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) Cc: Jason Baron Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180907103521.31344-1-bp@alien8.de Signed-off-by: Ingo Molnar commit bb3485c8ace6475c269b1aa2da674490f455f412 Author: Vincent Guittot Date: Fri Sep 7 09:51:04 2018 +0200 sched/fair: Fix load_balance redo for !imbalance It can happen that load_balance() finds a busiest group and then a busiest rq but the calculated imbalance is in fact 0. In such situation, detach_tasks() returns immediately and lets the flag LBF_ALL_PINNED set. The busiest CPU is then wrongly assumed to have pinned tasks and removed from the load balance mask. then, we redo a load balance without the busiest CPU. This creates wrong load balance situation and generates wrong task migration. If the calculated imbalance is 0, it's useless to try to find a busiest rq as no task will be migrated and we can return immediately. This situation can happen with heterogeneous system or smp system when RT tasks are decreasing the capacity of some CPUs. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: dietmar.eggemann@arm.com Cc: jhugo@codeaurora.org Link: http://lkml.kernel.org/r/1536306664-29827-1-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 287cdaac5700c5b8970d739f73d742d863d3e2ca Author: Vincent Guittot Date: Tue Sep 4 11:36:26 2018 +0200 sched/fair: Fix scale_rt_capacity() for SMT Since commit: 523e979d3164 ("sched/core: Use PELT for scale_rt_capacity()") scale_rt_capacity() returns the remaining capacity and not a scale factor to apply on cpu_capacity_orig. arch_scale_cpu() is directly called by scale_rt_capacity() so we must take the sched_domain argument. Reported-by: Srikar Dronamraju Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Srikar Dronamraju Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: 523e979d3164 ("sched/core: Use PELT for scale_rt_capacity()") Link: http://lkml.kernel.org/r/20180904093626.GA23936@linaro.org Signed-off-by: Ingo Molnar commit d0cdb3ce8834332d918fc9c8ff74f8a169ec9abe Author: Steve Muckle Date: Fri Aug 31 15:42:17 2018 -0700 sched/fair: Fix vruntime_normalized() for remote non-migration wakeup When a task which previously ran on a given CPU is remotely queued to wake up on that same CPU, there is a period where the task's state is TASK_WAKING and its vruntime is not normalized. This is not accounted for in vruntime_normalized() which will cause an error in the task's vruntime if it is switched from the fair class during this time. For example if it is boosted to RT priority via rt_mutex_setprio(), rq->min_vruntime will not be subtracted from the task's vruntime but it will be added again when the task returns to the fair class. The task's vruntime will have been erroneously doubled and the effective priority of the task will be reduced. Note this will also lead to inflation of all vruntimes since the doubled vruntime value will become the rq's min_vruntime when other tasks leave the rq. This leads to repeated doubling of the vruntime and priority penalty. Fix this by recognizing a WAKING task's vruntime as normalized only if sched_remote_wakeup is true. This indicates a migration, in which case the vruntime would have been normalized in migrate_task_rq_fair(). Based on a similar patch from John Dias . Suggested-by: Peter Zijlstra Tested-by: Dietmar Eggemann Signed-off-by: Steve Muckle Signed-off-by: Peter Zijlstra (Intel) Cc: Chris Redpath Cc: John Dias Cc: Linus Torvalds Cc: Miguel de Dios Cc: Morten Rasmussen Cc: Patrick Bellasi Cc: Paul Turner Cc: Quentin Perret Cc: Thomas Gleixner Cc: Todd Kjos Cc: kernel-team@android.com Fixes: b5179ac70de8 ("sched/fair: Prepare to fix fairness problems on migration") Link: http://lkml.kernel.org/r/20180831224217.169476-1-smuckle@google.com Signed-off-by: Ingo Molnar commit 12b04875d666e83d27511df25580de84505bc758 Author: Vincent Guittot Date: Fri Aug 31 17:22:55 2018 +0200 sched/pelt: Fix update_blocked_averages() for RT and DL classes update_blocked_averages() is called to periodiccally decay the stalled load of idle CPUs and to sync all loads before running load balance. When cfs rq is idle, it trigs a load balance during pick_next_task_fair() in order to potentially pull tasks and to use this newly idle CPU. This load balance happens whereas prev task from another class has not been put and its utilization updated yet. This may lead to wrongly account running time as idle time for RT or DL classes. Test that no RT or DL task is running when updating their utilization in update_blocked_averages(). We still update RT and DL utilization instead of simply skipping them to make sure that all metrics are synced when used during load balance. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: 371bf4273269 ("sched/rt: Add rt_rq utilization tracking") Fixes: 3727e0e16340 ("sched/dl: Add dl_rq utilization tracking") Link: http://lkml.kernel.org/r/1535728975-22799-1-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit e5e96fafd9028b1478b165db78c52d981c14f471 Author: Srikar Dronamraju Date: Fri Aug 10 22:30:18 2018 +0530 sched/topology: Set correct NUMA topology type With the following commit: 051f3ca02e46 ("sched/topology: Introduce NUMA identity node sched domain") the scheduler introduced a new NUMA level. However this leads to the NUMA topology on 2 node systems to not be marked as NUMA_DIRECT anymore. After this commit, it gets reported as NUMA_BACKPLANE, because sched_domains_numa_level is now 2 on 2 node systems. Fix this by allowing setting systems that have up to 2 NUMA levels as NUMA_DIRECT. While here remove code that assumes that level can be 0. Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Cc: Andre Wild Cc: Heiko Carstens Cc: Linus Torvalds Cc: Mel Gorman Cc: Michael Ellerman Cc: Peter Zijlstra Cc: Rik van Riel Cc: Suravee Suthikulpanit Cc: Thomas Gleixner Cc: linuxppc-dev Fixes: 051f3ca02e46 "Introduce NUMA identity node sched domain" Link: http://lkml.kernel.org/r/1533920419-17410-1-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit e73e81975f2447e6f556100cada64a18ec631cbb Author: Jiada Wang Date: Tue Jul 31 21:12:22 2018 +0900 sched/debug: Fix potential deadlock when writing to sched_features The following lockdep report can be triggered by writing to /sys/kernel/debug/sched_features: ====================================================== WARNING: possible circular locking dependency detected 4.18.0-rc6-00152-gcd3f77d74ac3-dirty #18 Not tainted ------------------------------------------------------ sh/3358 is trying to acquire lock: 000000004ad3989d (cpu_hotplug_lock.rw_sem){++++}, at: static_key_enable+0x14/0x30 but task is already holding lock: 00000000c1b31a88 (&sb->s_type->i_mutex_key#3){+.+.}, at: sched_feat_write+0x160/0x428 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&sb->s_type->i_mutex_key#3){+.+.}: lock_acquire+0xb8/0x148 down_write+0xac/0x140 start_creating+0x5c/0x168 debugfs_create_dir+0x18/0x220 opp_debug_register+0x8c/0x120 _add_opp_dev+0x104/0x1f8 dev_pm_opp_get_opp_table+0x174/0x340 _of_add_opp_table_v2+0x110/0x760 dev_pm_opp_of_add_table+0x5c/0x240 dev_pm_opp_of_cpumask_add_table+0x5c/0x100 cpufreq_init+0x160/0x430 cpufreq_online+0x1cc/0xe30 cpufreq_add_dev+0x78/0x198 subsys_interface_register+0x168/0x270 cpufreq_register_driver+0x1c8/0x278 dt_cpufreq_probe+0xdc/0x1b8 platform_drv_probe+0xb4/0x168 driver_probe_device+0x318/0x4b0 __device_attach_driver+0xfc/0x1f0 bus_for_each_drv+0xf8/0x180 __device_attach+0x164/0x200 device_initial_probe+0x10/0x18 bus_probe_device+0x110/0x178 device_add+0x6d8/0x908 platform_device_add+0x138/0x3d8 platform_device_register_full+0x1cc/0x1f8 cpufreq_dt_platdev_init+0x174/0x1bc do_one_initcall+0xb8/0x310 kernel_init_freeable+0x4b8/0x56c kernel_init+0x10/0x138 ret_from_fork+0x10/0x18 -> #2 (opp_table_lock){+.+.}: lock_acquire+0xb8/0x148 __mutex_lock+0x104/0xf50 mutex_lock_nested+0x1c/0x28 _of_add_opp_table_v2+0xb4/0x760 dev_pm_opp_of_add_table+0x5c/0x240 dev_pm_opp_of_cpumask_add_table+0x5c/0x100 cpufreq_init+0x160/0x430 cpufreq_online+0x1cc/0xe30 cpufreq_add_dev+0x78/0x198 subsys_interface_register+0x168/0x270 cpufreq_register_driver+0x1c8/0x278 dt_cpufreq_probe+0xdc/0x1b8 platform_drv_probe+0xb4/0x168 driver_probe_device+0x318/0x4b0 __device_attach_driver+0xfc/0x1f0 bus_for_each_drv+0xf8/0x180 __device_attach+0x164/0x200 device_initial_probe+0x10/0x18 bus_probe_device+0x110/0x178 device_add+0x6d8/0x908 platform_device_add+0x138/0x3d8 platform_device_register_full+0x1cc/0x1f8 cpufreq_dt_platdev_init+0x174/0x1bc do_one_initcall+0xb8/0x310 kernel_init_freeable+0x4b8/0x56c kernel_init+0x10/0x138 ret_from_fork+0x10/0x18 -> #1 (subsys mutex#6){+.+.}: lock_acquire+0xb8/0x148 __mutex_lock+0x104/0xf50 mutex_lock_nested+0x1c/0x28 subsys_interface_register+0xd8/0x270 cpufreq_register_driver+0x1c8/0x278 dt_cpufreq_probe+0xdc/0x1b8 platform_drv_probe+0xb4/0x168 driver_probe_device+0x318/0x4b0 __device_attach_driver+0xfc/0x1f0 bus_for_each_drv+0xf8/0x180 __device_attach+0x164/0x200 device_initial_probe+0x10/0x18 bus_probe_device+0x110/0x178 device_add+0x6d8/0x908 platform_device_add+0x138/0x3d8 platform_device_register_full+0x1cc/0x1f8 cpufreq_dt_platdev_init+0x174/0x1bc do_one_initcall+0xb8/0x310 kernel_init_freeable+0x4b8/0x56c kernel_init+0x10/0x138 ret_from_fork+0x10/0x18 -> #0 (cpu_hotplug_lock.rw_sem){++++}: __lock_acquire+0x203c/0x21d0 lock_acquire+0xb8/0x148 cpus_read_lock+0x58/0x1c8 static_key_enable+0x14/0x30 sched_feat_write+0x314/0x428 full_proxy_write+0xa0/0x138 __vfs_write+0xd8/0x388 vfs_write+0xdc/0x318 ksys_write+0xb4/0x138 sys_write+0xc/0x18 __sys_trace_return+0x0/0x4 other info that might help us debug this: Chain exists of: cpu_hotplug_lock.rw_sem --> opp_table_lock --> &sb->s_type->i_mutex_key#3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#3); lock(opp_table_lock); lock(&sb->s_type->i_mutex_key#3); lock(cpu_hotplug_lock.rw_sem); *** DEADLOCK *** 2 locks held by sh/3358: #0: 00000000a8c4b363 (sb_writers#10){.+.+}, at: vfs_write+0x238/0x318 #1: 00000000c1b31a88 (&sb->s_type->i_mutex_key#3){+.+.}, at: sched_feat_write+0x160/0x428 stack backtrace: CPU: 5 PID: 3358 Comm: sh Not tainted 4.18.0-rc6-00152-gcd3f77d74ac3-dirty #18 Hardware name: Renesas H3ULCB Kingfisher board based on r8a7795 ES2.0+ (DT) Call trace: dump_backtrace+0x0/0x288 show_stack+0x14/0x20 dump_stack+0x13c/0x1ac print_circular_bug.isra.10+0x270/0x438 check_prev_add.constprop.16+0x4dc/0xb98 __lock_acquire+0x203c/0x21d0 lock_acquire+0xb8/0x148 cpus_read_lock+0x58/0x1c8 static_key_enable+0x14/0x30 sched_feat_write+0x314/0x428 full_proxy_write+0xa0/0x138 __vfs_write+0xd8/0x388 vfs_write+0xdc/0x318 ksys_write+0xb4/0x138 sys_write+0xc/0x18 __sys_trace_return+0x0/0x4 This is because when loading the cpufreq_dt module we first acquire cpu_hotplug_lock.rw_sem lock, then in cpufreq_init(), we are taking the &sb->s_type->i_mutex_key lock. But when writing to /sys/kernel/debug/sched_features, the cpu_hotplug_lock.rw_sem lock depends on the &sb->s_type->i_mutex_key lock. To fix this bug, reverse the lock acquisition order when writing to sched_features, this way cpu_hotplug_lock.rw_sem no longer depends on &sb->s_type->i_mutex_key. Tested-by: Dietmar Eggemann Signed-off-by: Jiada Wang Signed-off-by: Peter Zijlstra (Intel) Cc: Eugeniu Rosca Cc: George G. Davis Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180731121222.26195-1-jiada_wang@mentor.com Signed-off-by: Ingo Molnar commit 5f0abea6ab6dd3104fc00c64a86d58b5d59a3818 Author: Gao Xiang Date: Thu Sep 6 17:01:47 2018 +0800 staging: erofs: rename superblock flags (MS_xyz -> SB_xyz) This patch follows commit 1751e8a6cb93 ("Rename superblock flags (MS_xyz -> SB_xyz)") and after commit ("vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled"), there is no MS_RDONLY and MS_NOATIME at all. Reported-by: Stephen Rothwell Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Reviewed-by: David Howells Signed-off-by: Greg Kroah-Hartman commit e13e2366d8415e029fe96a62502955083e272cef Author: Thomas Hellstrom Date: Mon Sep 3 16:07:08 2018 +0200 locking/mutex: Fix mutex debug call and ww_mutex documentation The following commit: 08295b3b5bee ("Implement an algorithm choice for Wound-Wait mutexes") introduced a reference in the documentation to a function that was removed in an earlier commit. It also forgot to remove a call to debug_mutex_add_waiter() which is now unconditionally called by __mutex_add_waiter(). Fix those bugs. Signed-off-by: Thomas Hellstrom Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: dri-devel@lists.freedesktop.org Fixes: 08295b3b5bee ("Implement an algorithm choice for Wound-Wait mutexes") Link: http://lkml.kernel.org/r/20180903140708.2401-1-thellstrom@vmware.com Signed-off-by: Ingo Molnar commit 09121255c784fd36ad6237a4e239c634b0209de0 Author: Peter Zijlstra Date: Wed Aug 29 14:13:13 2018 +0200 perf/UAPI: Clearly mark __PERF_SAMPLE_CALLCHAIN_EARLY as internal use Vince noted that commit: 6cbc304f2f36 ("perf/x86/intel: Fix unwind errors from PEBS entries (mk-II)") 'leaked' __PERF_SAMPLE_CALLCHAIN_EARLY into the UAPI namespace. And while sys_perf_event_open() will error out if you try to use it, it is exposed. Clearly mark it for internal use only to avoid any confusion. Requested-by: Vince Weaver Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit 16160c1946b702dcfa95ef63389a56deb2f1c7cb Author: Jacek Tomaka Date: Thu Aug 2 09:38:30 2018 +0800 perf/x86/intel: Add support/quirk for the MISPREDICT bit on Knights Landing CPUs Problem: perf did not show branch predicted/mispredicted bit in brstack. Output of perf -F brstack for profile collected Before: 0x4fdbcd/0x4fdc03/-/-/-/0 0x45f4c1/0x4fdba0/-/-/-/0 0x45f544/0x45f4bb/-/-/-/0 0x45f555/0x45f53c/-/-/-/0 0x7f66901cc24b/0x45f555/-/-/-/0 0x7f66901cc22e/0x7f66901cc23d/-/-/-/0 0x7f66901cc1ff/0x7f66901cc20f/-/-/-/0 0x7f66901cc1e8/0x7f66901cc1fc/-/-/-/0 After: 0x4fdbcd/0x4fdc03/P/-/-/0 0x45f4c1/0x4fdba0/P/-/-/0 0x45f544/0x45f4bb/P/-/-/0 0x45f555/0x45f53c/P/-/-/0 0x7f66901cc24b/0x45f555/P/-/-/0 0x7f66901cc22e/0x7f66901cc23d/P/-/-/0 0x7f66901cc1ff/0x7f66901cc20f/P/-/-/0 0x7f66901cc1e8/0x7f66901cc1fc/P/-/-/0 Cause: As mentioned in Software Development Manual vol 3, 17.4.8.1, IA32_PERF_CAPABILITIES[5:0] indicates the format of the address that is stored in the LBR stack. Knights Landing reports 1 (LBR_FORMAT_LIP) as its format. Despite that, registers containing FROM address of the branch, do have MISPREDICT bit but because of the format indicated in IA32_PERF_CAPABILITIES[5:0], LBR did not read MISPREDICT bit. Solution: Teach LBR about above Knights Landing quirk and make it read MISPREDICT bit. Signed-off-by: Jacek Tomaka Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180802013830.10600-1-jacekt@dugeo.com Signed-off-by: Ingo Molnar commit c42055105785580563535e6d3143cad95c7ac7ee Author: Yuan-Chi Pang Date: Thu Sep 6 16:57:48 2018 +0800 mac80211: fix TX status reporting for ieee80211s TX status reporting to ieee80211s is through ieee80211s_update_metric. There are two problems about ieee80211s_update_metric: 1. The purpose is to estimate the fail probability to a specific link. No need to restrict to data frame. 2. Current implementation does not work if wireless driver does not pass tx_status with skb. Fix this by removing ieee80211_is_data condition, passing ieee80211_tx_status directly to ieee80211s_update_metric, and putting it in both __ieee80211_tx_status and ieee80211_tx_status_ext. Signed-off-by: Yuan-Chi Pang Signed-off-by: Johannes Berg commit cb59bc14e830028d2244861216df038165d7625d Author: Johannes Berg Date: Wed Sep 5 13:34:02 2018 +0200 mac80211: TDLS: fix skb queue/priority assignment If the TDLS setup happens over a connection to an AP that doesn't have QoS, we nevertheless assign a non-zero TID (skb->priority) and queue mapping, which may confuse us or drivers later. Fix it by just assigning the special skb->priority and then using ieee80211_select_queue() just like other data frames would go through. Signed-off-by: Johannes Berg commit 119f94a6fefcc76d47075b83d2b73d04c895df78 Author: Jouni Malinen Date: Wed Sep 5 18:52:22 2018 +0300 cfg80211: Address some corner cases in scan result channel updating cfg80211_get_bss_channel() is used to update the RX channel based on the available frame payload information (channel number from DSSS Parameter Set element or HT Operation element). This is needed on 2.4 GHz channels where frames may be received on neighboring channels due to overlapping frequency range. This might of some use on the 5 GHz band in some corner cases, but things are more complex there since there is no n:1 or 1:n mapping between channel numbers and frequencies due to multiple different starting frequencies in different operating classes. This could result in ieee80211_channel_to_frequency() returning incorrect frequency and ieee80211_get_channel() returning incorrect channel information (or indication of no match). In the previous implementation, this could result in some scan results being dropped completely, e.g., for the 4.9 GHz channels. That prevented connection to such BSSs. Fix this by using the driver-provided channel pointer if ieee80211_get_channel() does not find matching channel data for the channel number in the frame payload and if the scan is done with 5 MHz or 10 MHz channel bandwidth. While doing this, also add comments describing what the function is trying to achieve to make it easier to understand what happens here and why. Signed-off-by: Jouni Malinen Signed-off-by: Johannes Berg commit 36f3a6e02c143a7e9e4e143e416371f67bc1fae6 Author: Takashi Sakamoto Date: Sun Sep 9 22:25:52 2018 +0900 ALSA: fireface: fix memory leak in ff400_switch_fetching_mode() An allocated memory forgets to be released. Fixes: 76fdb3a9e13 ('ALSA: fireface: add support for Fireface 400') Cc: # 4.12+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 493626f2d87a74e6dbea1686499ed6e7e600484e Author: Takashi Sakamoto Date: Sun Sep 9 22:25:12 2018 +0900 ALSA: bebob: use address returned by kmalloc() instead of kernel stack for streaming DMA mapping When executing 'fw_run_transaction()' with 'TCODE_WRITE_BLOCK_REQUEST', an address of 'payload' argument is used for streaming DMA mapping by 'firewire_ohci' module if 'size' argument is larger than 8 byte. Although in this case the address should not be on kernel stack, current implementation of ALSA bebob driver uses data in kernel stack for a cue to boot M-Audio devices. This often brings unexpected result, especially for a case of CONFIG_VMAP_STACK=y. This commit fixes the bug. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=201021 Reference: https://forum.manjaro.org/t/firewire-m-audio-410-driver-wont-load-firmware/51165 Fixes: a2b2a7798fb6('ALSA: bebob: Send a cue to load firmware for M-Audio Firewire series') Cc: # v3.16+ Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 11da3a7f84f19c26da6f86af878298694ede0804 Author: Linus Torvalds Date: Sun Sep 9 17:26:43 2018 -0700 Linux 4.19-rc3 commit 5d407b071dc369c26a38398326ee2be53651cfe4 Author: Taehee Yoo Date: Mon Sep 10 02:47:05 2018 +0900 ip: frags: fix crash in ip_do_fragment() A kernel crash occurrs when defragmented packet is fragmented in ip_do_fragment(). In defragment routine, skb_orphan() is called and skb->ip_defrag_offset is set. but skb->sk and skb->ip_defrag_offset are same union member. so that frag->sk is not NULL. Hence crash occurrs in skb->sk check routine in ip_do_fragment() when defragmented packet is fragmented. test commands: %iptables -t nat -I POSTROUTING -j MASQUERADE %hping3 192.168.4.2 -s 1000 -p 2000 -d 60000 splat looks like: [ 261.069429] kernel BUG at net/ipv4/ip_output.c:636! [ 261.075753] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN PTI [ 261.083854] CPU: 1 PID: 1349 Comm: hping3 Not tainted 4.19.0-rc2+ #3 [ 261.100977] RIP: 0010:ip_do_fragment+0x1613/0x2600 [ 261.106945] Code: e8 e2 38 e3 fe 4c 8b 44 24 18 48 8b 74 24 08 e9 92 f6 ff ff 80 3c 02 00 0f 85 da 07 00 00 48 8b b5 d0 00 00 00 e9 25 f6 ff ff <0f> 0b 0f 0b 44 8b 54 24 58 4c 8b 4c 24 18 4c 8b 5c 24 60 4c 8b 6c [ 261.127015] RSP: 0018:ffff8801031cf2c0 EFLAGS: 00010202 [ 261.134156] RAX: 1ffff1002297537b RBX: ffffed0020639e6e RCX: 0000000000000004 [ 261.142156] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880114ba9bd8 [ 261.150157] RBP: ffff880114ba8a40 R08: ffffed0022975395 R09: ffffed0022975395 [ 261.158157] R10: 0000000000000001 R11: ffffed0022975394 R12: ffff880114ba9ca4 [ 261.166159] R13: 0000000000000010 R14: ffff880114ba9bc0 R15: dffffc0000000000 [ 261.174169] FS: 00007fbae2199700(0000) GS:ffff88011b400000(0000) knlGS:0000000000000000 [ 261.183012] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 261.189013] CR2: 00005579244fe000 CR3: 0000000119bf4000 CR4: 00000000001006e0 [ 261.198158] Call Trace: [ 261.199018] ? dst_output+0x180/0x180 [ 261.205011] ? save_trace+0x300/0x300 [ 261.209018] ? ip_copy_metadata+0xb00/0xb00 [ 261.213034] ? sched_clock_local+0xd4/0x140 [ 261.218158] ? kill_l4proto+0x120/0x120 [nf_conntrack] [ 261.223014] ? rt_cpu_seq_stop+0x10/0x10 [ 261.227014] ? find_held_lock+0x39/0x1c0 [ 261.233008] ip_finish_output+0x51d/0xb50 [ 261.237006] ? ip_fragment.constprop.56+0x220/0x220 [ 261.243011] ? nf_ct_l4proto_register_one+0x5b0/0x5b0 [nf_conntrack] [ 261.250152] ? rcu_is_watching+0x77/0x120 [ 261.255010] ? nf_nat_ipv4_out+0x1e/0x2b0 [nf_nat_ipv4] [ 261.261033] ? nf_hook_slow+0xb1/0x160 [ 261.265007] ip_output+0x1c7/0x710 [ 261.269005] ? ip_mc_output+0x13f0/0x13f0 [ 261.273002] ? __local_bh_enable_ip+0xe9/0x1b0 [ 261.278152] ? ip_fragment.constprop.56+0x220/0x220 [ 261.282996] ? nf_hook_slow+0xb1/0x160 [ 261.287007] raw_sendmsg+0x21f9/0x4420 [ 261.291008] ? dst_output+0x180/0x180 [ 261.297003] ? sched_clock_cpu+0x126/0x170 [ 261.301003] ? find_held_lock+0x39/0x1c0 [ 261.306155] ? stop_critical_timings+0x420/0x420 [ 261.311004] ? check_flags.part.36+0x450/0x450 [ 261.315005] ? _raw_spin_unlock_irq+0x29/0x40 [ 261.320995] ? _raw_spin_unlock_irq+0x29/0x40 [ 261.326142] ? cyc2ns_read_end+0x10/0x10 [ 261.330139] ? raw_bind+0x280/0x280 [ 261.334138] ? sched_clock_cpu+0x126/0x170 [ 261.338995] ? check_flags.part.36+0x450/0x450 [ 261.342991] ? __lock_acquire+0x4500/0x4500 [ 261.348994] ? inet_sendmsg+0x11c/0x500 [ 261.352989] ? dst_output+0x180/0x180 [ 261.357012] inet_sendmsg+0x11c/0x500 [ ... ] v2: - clear skb->sk at reassembly routine.(Eric Dumarzet) Fixes: fa0f527358bd ("ip: use rb trees for IP frag queue.") Suggested-by: Eric Dumazet Signed-off-by: Taehee Yoo Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit fa94351b56d64208ce45c19ec0d4dc711074e607 Merge: 9a5682765a2e 4e67b2a5df5d Author: Ingo Molnar Date: Sun Sep 9 21:36:31 2018 +0200 Merge tag 'perf-urgent-for-mingo-4.19-20180903' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/urgent fixes from Arnaldo Carvalho de Melo: Kernel: - Modify breakpoint fixes (Jiri Olsa) perf annotate: - Fix parsing aarch64 branch instructions after objdump update (Kim Phillips) - Fix parsing indirect calls in 'perf annotate' (Martin Liška) perf probe: - Ignore SyS symbols irrespective of endianness on PowerPC (Sandipan Das) perf trace: - Fix include path for asm-generic/unistd.h on arm64 (Kim Phillips) Core libraries: - Fix potential null pointer dereference in perf_evsel__new_idx() (Hisao Tanabe) - Use fixed size string for comms instead of scanf("%m"), that is not present in the bionic libc and leads to a crash (Chris Phlipot) - Fix bad memory access in trace info on 32-bit systems, we were reading 8 bytes from a 4-byte long variable when saving the command line in the perf.data file. (Chris Phlipot) Build system: - Streamline bpf examples and headers installation, clarifying some install messages. (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit 52ea992cfac357b73180d5c051dca43bc8d20c2a Author: Vakul Garg Date: Thu Sep 6 21:41:40 2018 +0530 net/tls: Set count of SG entries if sk_alloc_sg returns -ENOSPC tls_sw_sendmsg() allocates plaintext and encrypted SG entries using function sk_alloc_sg(). In case the number of SG entries hit MAX_SKB_FRAGS, sk_alloc_sg() returns -ENOSPC and sets the variable for current SG index to '0'. This leads to calling of function tls_push_record() with 'sg_encrypted_num_elem = 0' and later causes kernel crash. To fix this, set the number of SG elements to the number of elements in plaintext/encrypted SG arrays in case sk_alloc_sg() returns -ENOSPC. Fixes: 3c4d7559159b ("tls: kernel TLS support") Signed-off-by: Vakul Garg Signed-off-by: David S. Miller commit 0e1f4c76be241377d282e34ebea6d16ff7829747 Merge: 5cf4a8532c99 37dff155dcf5 Author: David S. Miller Date: Sun Sep 9 07:59:56 2018 -0700 Merge branch 'ena-fixes' Netanel Belgazal says: ==================== bug fixes for ENA Ethernet driver ==================== Signed-off-by: David S. Miller commit 37dff155dcf57f6c08bf1641c5ddf9abd45f2b1f Author: Netanel Belgazal Date: Sun Sep 9 08:15:26 2018 +0000 net: ena: fix incorrect usage of memory barriers Added memory barriers where they were missing to support multiple architectures, and removed redundant ones. As part of removing the redundant memory barriers and improving performance, we moved to more relaxed versions of memory barriers, as well as to the more relaxed version of writel - writel_relaxed, while maintaining correctness. Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller commit 28abf4e9c9201eda5c4d29ea609d07e877b464b8 Author: Netanel Belgazal Date: Sun Sep 9 08:15:25 2018 +0000 net: ena: fix missing calls to READ_ONCE Add READ_ONCE calls where necessary (for example when iterating over a memory field that gets updated by the hardware). Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller commit 944b28aa2982b4590d4d4dfc777cf85135dca2c0 Author: Netanel Belgazal Date: Sun Sep 9 08:15:24 2018 +0000 net: ena: fix missing lock during device destruction acquire the rtnl_lock during device destruction to avoid using partially destroyed device. ena_remove() shares almost the same logic as ena_destroy_device(), so use ena_destroy_device() and avoid duplications. Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller commit fe870c77efdf8682252545cbd3d29800d8379efc Author: Netanel Belgazal Date: Sun Sep 9 08:15:23 2018 +0000 net: ena: fix potential double ena_destroy_device() ena_destroy_device() can potentially be called twice. To avoid this, check that the device is running and only then proceed destroying it. Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller commit cfa324a514233b28a6934de619183eee941f02d7 Author: Netanel Belgazal Date: Sun Sep 9 08:15:22 2018 +0000 net: ena: fix device destruction to gracefully free resources When ena_destroy_device() is called from ena_suspend(), the device is still reachable from the driver. Therefore, the driver can send a command to the device to free all resources. However, in all other cases of calling ena_destroy_device(), the device is potentially in an error state and unreachable from the driver. In these cases the driver must not send commands to the device. The current implementation does not request resource freeing from the device even when possible. We add the graceful parameter to ena_destroy_device() to enable resource freeing when possible, and use it in ena_suspend(). Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller commit ef5b0771d247379c90c8bf1332ff32f7f74bff7f Author: Netanel Belgazal Date: Sun Sep 9 08:15:21 2018 +0000 net: ena: fix driver when PAGE_SIZE == 64kB The buffer length field in the ena rx descriptor is 16 bit, and the current driver passes a full page in each ena rx descriptor. When PAGE_SIZE equals 64kB or more, the buffer length field becomes zero. To solve this issue, limit the ena Rx descriptor to use 16kB even when allocating 64kB kernel pages. This change would not impact ena device functionality, as 16kB is still larger than maximum MTU. Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller commit 772ed869f535b4ec2b134645c951ff22de4d3f79 Author: Netanel Belgazal Date: Sun Sep 9 08:15:20 2018 +0000 net: ena: fix surprise unplug NULL dereference kernel crash Starting with driver version 1.5.0, in case of a surprise device unplug, there is a race caused by invoking ena_destroy_device() from two different places. As a result, the readless register might be accessed after it was destroyed. Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller commit 9a5682765a2e5f93cf2fe7b612b8072b18f0c68a Merge: 3567994a05ba 9bc4f28af75a Author: Linus Torvalds Date: Sun Sep 9 07:05:15 2018 -0700 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: "A set of fixes for x86: - Prevent multiplication result truncation on 32bit. Introduced with the early timestamp reworrk. - Ensure microcode revision storage to be consistent under all circumstances - Prevent write tearing of PTEs - Prevent confusion of user and kernel reegisters when dumping fatal signals verbosely - Make an error return value in a failure path of the vector allocation negative. Returning EINVAL might the caller assume success and causes further wreckage. - A trivial kernel doc warning fix" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Use WRITE_ONCE() when setting PTEs x86/apic/vector: Make error return value negative x86/process: Don't mix user/kernel regs in 64bit __show_regs() x86/tsc: Prevent result truncation on 32bit x86: Fix kernel-doc atomic.h warnings x86/microcode: Update the new microcode revision unconditionally x86/microcode: Make sure boot_cpu_data.microcode is up-to-date commit 3567994a05ba6490f6055650fbb892c926ae7fca Merge: 225ad3cfec4c e2c631ba75a7 Author: Linus Torvalds Date: Sun Sep 9 06:55:27 2018 -0700 Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timekeeping fixes from Thomas Gleixner: "Two fixes for timekeeping: - Revert to the previous kthread based update, which is unfortunately required due to lock ordering issues. The removal caused boot failures on old Core2 machines. Add a proper comment why the thread needs to stay to prevent accidental removal in the future. - Fix a silly typo in a function declaration" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource: Revert "Remove kthread" timekeeping: Fix declaration of read_persistent_wall_and_boot_offset() commit 225ad3cfec4c0ad1971b3c00f379986a3eb6ab07 Merge: e0a0d0584840 4cb205c0c50f Author: Linus Torvalds Date: Sun Sep 9 06:49:29 2018 -0700 Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irqchip fix from Thomas Gleixner: "A single fix to prevent allocating excessive memory in the GIC/ITS driver. While the subject of the patch might suggest otherwise this is a real fix as some SoCs exceed the memory allocation limits and fail to boot" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic-v3-its: Cap lpi_id_bits to reduce memory footprint commit e0a0d05848401df48b10f3defce14a5670a0f9f6 Merge: 3243a89dcbd8 69fa6eb7d6a6 Author: Linus Torvalds Date: Sun Sep 9 06:48:06 2018 -0700 Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull cpu hotplug fixes from Thomas Gleixner: "Two fixes for the hotplug state machine code: - Move the misplaces smb() in the hotplug thread function to the proper place, otherwise a half update control struct could be observed - Prevent state corruption on error rollback, which causes the state to advance by one and as a consequence skip it in the bringup sequence" * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu/hotplug: Prevent state corruption on error rollback cpu/hotplug: Adjust misplaced smb() in cpuhp_thread_fun() commit 3243a89dcbd8f5810b72ee0903d349bd000c4c9d Merge: 1d22577703b3 9b25436662d5 Author: Linus Torvalds Date: Sun Sep 9 05:54:05 2018 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random Pull random driver fix from Ted Ts'o: "Fix things so the choice of whether or not to trust RDRAND to initialize the CRNG is configurable via the boot option random.trust_cpu={on,off}" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random: random: make CPU trust a boot parameter commit 1d22577703b32f15d189466bd9c7f1973a295529 Merge: f8f65382c98a f0b0d88a8251 Author: Linus Torvalds Date: Sun Sep 9 05:42:11 2018 -0700 Merge tag 'kbuild-fixes-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - make setlocalversion more robust about -dirty check - loosen the pkg-config requirement for Kconfig - change missing depmod to a warning from an error - warn modules_install when System.map is missing * tag 'kbuild-fixes-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: modules_install: warn when missing System.map file kbuild: make missing $DEPMOD a Warning instead of an Error kconfig: do not require pkg-config on make {menu,n}config kconfig: remove a spurious self-assignment scripts/setlocalversion: git: Make -dirty check more robust commit eca743dc37e1018decfb307d564387477c1ac4fd Merge: f86cf25a6091 a13bf65f3f2e Author: Greg Kroah-Hartman Date: Sun Sep 9 09:33:29 2018 +0200 Merge tag 'iio-fixes-4.19a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First set of IIO fixes for the 4.19 cycle. * ad9523 - sysfs write should return the number of characters used or an error, not 0 which could result in an infinite loop in userspace. * lsm6dsx - Fix computation of length when updating the watermark to include timestamps avoiding the watermark being set earlier than intended. * maxim_thermocouple - Revert a patch adding the max31856 as it's not actually compatible with the register set that this driver supports. * si1133 - Fix an impossible value check so we don't always error out whether the passed in value is good or bad. commit 5890184d2b506f88886b7322d7d44464453bd3a6 Author: Stefan Metzmacher Date: Fri Sep 7 18:24:17 2018 +0200 fs/cifs: require sha512 This got lost in commit 0fdfef9aa7ee68ddd508aef7c98630cfc054f8d6, which removed CONFIG_CIFS_SMB311. Signed-off-by: Stefan Metzmacher Fixes: 0fdfef9aa7ee68ddd ("smb3: simplify code by removing CONFIG_CIFS_SMB311") CC: Stable CC: linux-cifs@vger.kernel.org Signed-off-by: Steve French commit bcfb84a996f6fa90b5e6e2954b2accb7a4711097 Author: Stephen Rothwell Date: Mon Sep 3 13:15:58 2018 +1000 fs/cifs: suppress a string overflow warning A powerpc build of cifs with gcc v8.2.0 produces this warning: fs/cifs/cifssmb.c: In function ‘CIFSSMBNegotiate’: fs/cifs/cifssmb.c:605:3: warning: ‘strncpy’ writing 16 bytes into a region of size 1 overflows the destination [-Wstringop-overflow=] strncpy(pSMB->DialectsArray+count, protocols[i].name, 16); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since we are already doing a strlen() on the source, change the strncpy to a memcpy(). Signed-off-by: Stephen Rothwell Signed-off-by: Steve French commit f0b0d88a825149ef3b06656886bc211c71dcb852 Author: Randy Dunlap Date: Thu Sep 6 16:37:24 2018 -0700 kbuild: modules_install: warn when missing System.map file If there is no System.map file for "make modules_install", scripts/depmod.sh will silently exit with success, having done nothing. Since this is an unexpected situation, change it to report a Warning for the missing file. The behavior is not changed except for the Warning message. The (previous) silent success and new Warning can be reproduced by: $ make mrproper; make defconfig $ make modules; make modules_install and since System.map is produced by "make vmlinux", the steps above omit producing the System.map file. Reported-by: Masahiro Yamada Signed-off-by: Randy Dunlap Signed-off-by: Masahiro Yamada commit f8f65382c98a28e3c2b20df9dd4231dca5a11682 Merge: 0f3aa48ad4c3 bdf7ffc89922 Author: Linus Torvalds Date: Sat Sep 8 15:52:45 2018 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull KVM fixes from Radim Krčmář: "ARM: - Fix a VFP corruption in 32-bit guest - Add missing cache invalidation for CoW pages - Two small cleanups s390: - Fallout from the hugetlbfs support: pfmf interpretion and locking - VSIE: fix keywrapping for nested guests PPC: - Fix a bug where pages might not get marked dirty, causing guest memory corruption on migration - Fix a bug causing reads from guest memory to use the wrong guest real address for very large HPT guests (>256G of memory), leading to failures in instruction emulation. x86: - Fix out of bound access from malicious pv ipi hypercalls (introduced in rc1) - Fix delivery of pending interrupts when entering a nested guest, preventing arbitrarily late injection - Sanitize kvm_stat output after destroying a guest - Fix infinite loop when emulating a nested guest page fault and improve the surrounding emulation code - Two minor cleanups" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (28 commits) KVM: LAPIC: Fix pv ipis out-of-bounds access KVM: nVMX: Fix loss of pending IRQ/NMI before entering L2 arm64: KVM: Remove pgd_lock KVM: Remove obsolete kvm_unmap_hva notifier backend arm64: KVM: Only force FPEXC32_EL2.EN if trapping FPSIMD KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW KVM: s390: Properly lock mm context allow_gmap_hpage_1m setting KVM: s390: vsie: copy wrapping keys to right place KVM: s390: Fix pfmf and conditional skey emulation tools/kvm_stat: re-animate display of dead guests tools/kvm_stat: indicate dead guests as such tools/kvm_stat: handle guest removals more gracefully tools/kvm_stat: don't reset stats when setting PID filter for debugfs tools/kvm_stat: fix updates for dead guests tools/kvm_stat: fix handling of invalid paths in debugfs provider tools/kvm_stat: fix python3 issues KVM: x86: Unexport x86_emulate_instruction() KVM: x86: Rename emulate_instruction() to kvm_emulate_instruction() KVM: x86: Do not re-{try,execute} after failed emulation in L2 KVM: x86: Default to not allowing emulation retry in kvm_mmu_page_fault ... commit 0f3aa48ad4c307fb72b8eb43add26c8f314d396a Merge: d7b686ebf704 a132bb90414b Author: Linus Torvalds Date: Sat Sep 8 15:38:57 2018 -0700 Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC fixes from Olof Johansson: "A few more fixes who have trickled in: - MMC bus width fixup for some Allwinner platforms - Fix for NULL deref in ti-aemif when no platform data is passed in - Fix div by 0 in SCMI code - Add a missing module alias in a new RPi driver" * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: memory: ti-aemif: fix a potential NULL-pointer dereference firmware: arm_scmi: fix divide by zero when sustained_perf_level is zero hwmon: rpi: add module alias to raspberrypi-hwmon arm64: allwinner: dts: h6: fix Pine H64 MMC bus width commit a132bb90414bfad4f8ee23cb45fe6946a89b167d Merge: 6b45a2b1c0bc d177c8b61d6b Author: Olof Johansson Date: Sat Sep 8 10:04:37 2018 -0700 Merge tag 'sunxi-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into fixes Allwinner fixes for 4.19 Just one fix for H6 mmc on the Pine H64: the mmc bus width was missing from the device tree. This was added in 4.19-rc1. * tag 'sunxi-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: allwinner: dts: h6: fix Pine H64 MMC bus width Signed-off-by: Olof Johansson commit 9bc4f28af75a91aea0ae383f50b0a430c4509303 Author: Nadav Amit Date: Sun Sep 2 11:14:50 2018 -0700 x86/mm: Use WRITE_ONCE() when setting PTEs When page-table entries are set, the compiler might optimize their assignment by using multiple instructions to set the PTE. This might turn into a security hazard if the user somehow manages to use the interim PTE. L1TF does not make our lives easier, making even an interim non-present PTE a security hazard. Using WRITE_ONCE() to set PTEs and friends should prevent this potential security hazard. I skimmed the differences in the binary with and without this patch. The differences are (obviously) greater when CONFIG_PARAVIRT=n as more code optimizations are possible. For better and worse, the impact on the binary with this patch is pretty small. Skimming the code did not cause anything to jump out as a security hazard, but it seems that at least move_soft_dirty_pte() caused set_pte_at() to use multiple writes. Signed-off-by: Nadav Amit Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: Dave Hansen Cc: Andi Kleen Cc: Josh Poimboeuf Cc: Michal Hocko Cc: Vlastimil Babka Cc: Sean Christopherson Cc: Andy Lutomirski Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180902181451.80520-1-namit@vmware.com commit 47b7360ce563e18c524ce92b55fb4da72b3b3578 Author: Thomas Gleixner Date: Sat Sep 8 12:07:26 2018 +0200 x86/apic/vector: Make error return value negative activate_managed() returns EINVAL instead of -EINVAL in case of error. While this is unlikely to happen, the positive return value would cause further malfunction at the call site. Fixes: 2db1f959d9dc ("x86/vector: Handle managed interrupts proper") Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org commit 5cf4a8532c992bb22a9ecd5f6d93f873f4eaccc2 Author: Vincent Whitchurch Date: Thu Sep 6 15:54:59 2018 +0200 tcp: really ignore MSG_ZEROCOPY if no SO_ZEROCOPY According to the documentation in msg_zerocopy.rst, the SO_ZEROCOPY flag was introduced because send(2) ignores unknown message flags and any legacy application which was accidentally passing the equivalent of MSG_ZEROCOPY earlier should not see any new behaviour. Before commit f214f915e7db ("tcp: enable MSG_ZEROCOPY"), a send(2) call which passed the equivalent of MSG_ZEROCOPY without setting SO_ZEROCOPY would succeed. However, after that commit, it fails with -ENOBUFS. So it appears that the SO_ZEROCOPY flag fails to fulfill its intended purpose. Fix it. Fixes: f214f915e7db ("tcp: enable MSG_ZEROCOPY") Signed-off-by: Vincent Whitchurch Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit a162c3511410b50f09c002fea56fea2153b679d0 Author: Cong Wang Date: Thu Sep 6 14:50:16 2018 -0700 net_sched: properly cancel netlink dump on failure When nla_put*() fails after nla_nest_start(), we need to call nla_nest_cancel() to cancel the message, otherwise we end up calling nla_nest_end() like a success. Fixes: 0ed5269f9e41 ("net/sched: add tunnel option support to act_tunnel_key") Cc: Davide Caratti Cc: Simon Horman Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 8edfe2e992b75aee3da9316e9697c531194c2f53 Author: Juergen Gross Date: Fri Sep 7 14:21:30 2018 +0200 xen/netfront: fix waiting for xenbus state change Commit 822fb18a82aba ("xen-netfront: wait xenbus state change when load module manually") added a new wait queue to wait on for a state change when the module is loaded manually. Unfortunately there is no wakeup anywhere to stop that waiting. Instead of introducing a new wait queue rename the existing module_unload_q to module_wq and use it for both purposes (loading and unloading). As any state change of the backend might be intended to stop waiting do the wake_up_all() in any case when netback_changed() is called. Fixes: 822fb18a82aba ("xen-netfront: wait xenbus state change when load module manually") Cc: #4.18 Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: David S. Miller commit d7b686ebf704e3d91925a535a0905ba6be23757c Merge: 2c34a0e041a7 da4dfaf8428d Author: Linus Torvalds Date: Fri Sep 7 17:30:40 2018 -0700 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: - bugfixes for uniphier, i801, and xiic drivers - ID removal (never produced) for imx - one MAINTAINER addition * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: xiic: Record xilinx i2c with Zynq fragment i2c: xiic: Make the start and the byte count write atomic i2c: i801: fix DNV's SMBCTRL register offset i2c: imx-lpi2c: Remove mx8dv compatible entry dt-bindings: imx-lpi2c: Remove mx8dv compatible entry i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP i2c: uniphier: issue STOP only for last message or I2C_M_STOP commit 2c34a0e041a7063e6e3b3be8866a88975f3342d4 Merge: ecfe951f0c1b dd45210b6dd4 Author: Linus Torvalds Date: Fri Sep 7 16:45:32 2018 -0700 Merge tag 'arc-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC updates from Vineet Gupta: - Fix for atomic_fetch_#op [Will Deacon] - Enable per device IOC [Eugeniy Paltsev] - Remove redundant gcc version checks [Masahiro Yamada] - Miscll platform config/DT updates [Alexey Brodkin] * tag 'arc-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: don't check for HIGHMEM pages in arch_dma_alloc ARC: IOC: panic if both IOC and ZONE_HIGHMEM enabled ARC: dma [IOC] Enable per device io coherency ARC: dma [IOC]: mark DMA devices connected as dma-coherent ARC: atomics: unbork atomic_fetch_##op() arc: remove redundant GCC version checks ARC: sort Kconfig ARC: cleanup show_faulting_vma() ARC: [plat-axs*]: Enable SWAP ARC: [plat-axs*/plat-hsdk]: Allow U-Boot to pass MAC-address to the kernel ARC: configs: cleanup commit ecfe951f0c1b169ea4b7dd6f3a404dfedd795bc2 Author: David Howells Date: Fri Sep 7 23:55:17 2018 +0100 afs: Fix cell specification to permit an empty address list Fix the cell specification mechanism to allow cells to be pre-created without having to specify at least one address (the addresses will be upcalled for). This allows the cell information preload service to avoid the need to issue loads of DNS lookups during boot to get the addresses for each cell (500+ lookups for the 'standard' cell list[*]). The lookups can be done later as each cell is accessed through the filesystem. Also remove the print statement that prints a line every time a new cell is added. [*] There are 144 cells in the list. Each cell is first looked up for an SRV record, and if that fails, for an AFSDB record. These get a list of server names, each of which then has to be looked up to get the addresses for that server. E.g.: dig srv _afs3-vlserver._udp.grand.central.org Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit a987785dcd6c8ae2915460582aebd6481c81eb67 Author: Jay Kamat Date: Fri Sep 7 14:34:05 2018 -0700 Add tests for memory.oom.group Add tests for memory.oom.group for the following cases: - Killing all processes in a leaf cgroup, but leaving the parent untouched - Killing all processes in a parent and leaf cgroup - Keeping processes marked by OOM_SCORE_ADJ_MIN alive when considered for being killed by the group oom killer. Signed-off-by: Jay Kamat Acked-by: Roman Gushchin Signed-off-by: Shuah Khan (Samsung OSG) commit 48c2bb0b9cf863e0ed78e269f188ce65b73e0fd1 Author: Jay Kamat Date: Fri Sep 7 14:34:04 2018 -0700 Fix cg_read_strcmp() Fix a couple issues with cg_read_strcmp(), to improve correctness of cgroup tests - Fix cg_read_strcmp() always returning 0 for empty "needle" strings. Previously, this function read to a size = 1 buffer when comparing against empty strings, which would lead to cg_read_strcmp() comparing two empty strings. - Fix a memory leak in cg_read_strcmp() Fixes: 84092dbcf901 ("selftests: cgroup: add memory controller self-tests") Signed-off-by: Jay Kamat Acked-by: Roman Gushchin Signed-off-by: Shuah Khan (Samsung OSG) commit f74dd480cf4e31e12971c58a1d832044db945670 Author: Maciej S. Szmigiero Date: Fri Sep 7 20:15:22 2018 +0200 r8169: set TxConfig register after TX / RX is enabled, just like RxConfig Commit 3559d81e76bf ("r8169: simplify rtl_hw_start_8169") changed order of two register writes: 1) Caused RxConfig to be written before TX / RX is enabled, 2) Caused TxConfig to be written before TX / RX is enabled. At least on XIDs 10000000 ("RTL8169sb/8110sb") and 18000000 ("RTL8169sc/8110sc") such writes are ignored by the chip, leaving values in these registers intact. Change 1) was reverted by commit 05212ba8132b42 ("r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices"), however change 2) wasn't. In practice, this caused TxConfig's "InterFrameGap time" and "Max DMA Burst Size per Tx DMA Burst" bits to be zero dramatically reducing TX performance (in my tests it dropped from around 500Mbps to around 50Mbps). This patch fixes the issue by moving TxConfig register write a bit later in the code so it happens after TX / RX is already enabled. Fixes: 05212ba8132b42 ("r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices") Signed-off-by: Maciej S. Szmigiero Signed-off-by: David S. Miller commit 3d0e7a9e00fd8f0de499ac3f57331d0d378304c4 Merge: a12ed06ba2d3 41a950411265 Author: Linus Torvalds Date: Fri Sep 7 12:15:37 2018 -0700 Merge tag 'md/4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md Pull MD fixes from Shaohua Li: - Fix a locking issue for md-cluster (Guoqing) - Fix a sync crash for raid10 (Ni) - Fix a reshape bug with raid5 cache enabled (me) * tag 'md/4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md: md-cluster: release RESYNC lock after the last resync message RAID10 BUG_ON in raise_barrier when force is true and conf->barrier is 0 md/raid5-cache: disable reshape completely commit a12ed06ba2d3fa60e08e7449fe0c1715de401395 Merge: d042a240a823 e92c0eaf7543 Author: Linus Torvalds Date: Fri Sep 7 10:57:59 2018 -0700 Merge tag 'ceph-for-4.19-rc3' of https://github.com/ceph/ceph-client Pull ceph fixes from Ilya Dryomov: "Two rbd patches to complete support for images within namespaces that went into -rc1 and a use-after-free fix. The rbd changes have been sitting in a branch for quite a while but couldn't be included into the -rc1 pull request because of a pending wire protocol backwards compatibility fixup that only got committed early this week" * tag 'ceph-for-4.19-rc3' of https://github.com/ceph/ceph-client: rbd: support cloning across namespaces rbd: factor out get_parent_info() ceph: avoid a use-after-free in ceph_destroy_options() commit d042a240a823d4c048c4b0a5c19c65ac75b7addb Merge: 4ff8a142bdb3 9bdda4e9cf2d Author: Linus Torvalds Date: Fri Sep 7 10:54:46 2018 -0700 Merge tag 'for_v4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify fix from Jan Kara: "A small fsnotify fix from Amir" * tag 'for_v4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fsnotify: fix ignore mask logic in fsnotify() commit 4ff8a142bdb395482dd8744ed5ec2994dc3b81a3 Merge: 539373401411 fac880c7d074 Author: Linus Torvalds Date: Fri Sep 7 10:37:23 2018 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fix from Will Deacon: "Just one small fix here, preventing a VM_WARN_ON when a !present PMD/PUD is "freed" as part of a huge ioremap() operation. The correct behaviour is to skip the free silently in this case, which is a little weird (the function is a bit of a misnomer), but it follows the x86 implementation" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: fix erroneous warnings in page freeing functions commit 539373401411bdc9c9bdedb9908196c8dcccfc43 Merge: 69ddce94e368 a6b7eb3b4176 Author: Linus Torvalds Date: Fri Sep 7 10:25:26 2018 -0700 Merge tag 'acpi-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These fix a regression from the 4.18 cycle in the ACPI driver for Intel SoCs (LPSS) and prevent dmi_check_system() from being called on non-x86 systems in the ACPI core. Specifics: - Fix a power management regression in the ACPI driver for Intel SoCs (LPSS) introduced by a system-wide suspend/resume fix during the 4.18 cycle (Zhang Rui). - Prevent dmi_check_system() from being called on non-x86 systems in the ACPI core (Jean Delvare)" * tag 'acpi-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / LPSS: Force LPSS quirks on boot ACPI / bus: Only call dmi_check_system() on X86 commit 69ddce94e3681e63595690eba2310440f8349c4a Merge: a49a9dcce802 f7c50fa636f7 Author: Linus Torvalds Date: Fri Sep 7 10:20:31 2018 -0700 Merge tag 'sound-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Just a few small fixes: - a fix for the recursive work cancellation in a specific HD-audio operation mode - a fix for potentially uninitialized memory access via rawmidi - the register bit access fixes for ASoC HD-audio" * tag 'sound-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda: Fix several mismatch for register mask and value ALSA: rawmidi: Initialize allocated buffers ALSA: hda - Fix cancel_work_sync() stall from jackpoll work commit bdf7ffc89922a52a4f08a12f7421ea24bb7626a0 Author: Wanpeng Li Date: Thu Aug 30 10:03:30 2018 +0800 KVM: LAPIC: Fix pv ipis out-of-bounds access Dan Carpenter reported that the untrusted data returns from kvm_register_read() results in the following static checker warning: arch/x86/kvm/lapic.c:576 kvm_pv_send_ipi() error: buffer underflow 'map->phys_map' 's32min-s32max' KVM guest can easily trigger this by executing the following assembly sequence in Ring0: mov $10, %rax mov $0xFFFFFFFF, %rbx mov $0xFFFFFFFF, %rdx mov $0, %rsi vmcall As this will cause KVM to execute the following code-path: vmx_handle_exit() -> handle_vmcall() -> kvm_emulate_hypercall() -> kvm_pv_send_ipi() which will reach out-of-bounds access. This patch fixes it by adding a check to kvm_pv_send_ipi() against map->max_apic_id, ignoring destinations that are not present and delivering the rest. We also check whether or not map->phys_map[min + i] is NULL since the max_apic_id is set to the max apic id, some phys_map maybe NULL when apic id is sparse, especially kvm unconditionally set max_apic_id to 255 to reserve enough space for any xAPIC ID. Reported-by: Dan Carpenter Reviewed-by: Liran Alon Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Liran Alon Cc: Dan Carpenter Signed-off-by: Wanpeng Li [Add second "if (min > map->max_apic_id)" to complete the fix. -Radim] Signed-off-by: Radim Krčmář commit b5861e5cf2fcf83031ea3e26b0a69d887adf7d21 Author: Liran Alon Date: Mon Sep 3 15:20:22 2018 +0300 KVM: nVMX: Fix loss of pending IRQ/NMI before entering L2 Consider the case L1 had a IRQ/NMI event until it executed VMLAUNCH/VMRESUME which wasn't delivered because it was disallowed (e.g. interrupts disabled). When L1 executes VMLAUNCH/VMRESUME, L0 needs to evaluate if this pending event should cause an exit from L2 to L1 or delivered directly to L2 (e.g. In case L1 don't intercept EXTERNAL_INTERRUPT). Usually this would be handled by L0 requesting a IRQ/NMI window by setting VMCS accordingly. However, this setting was done on VMCS01 and now VMCS02 is active instead. Thus, when L1 executes VMLAUNCH/VMRESUME we force L0 to perform pending event evaluation by requesting a KVM_REQ_EVENT. Note that above scenario exists when L1 KVM is about to enter L2 but requests an "immediate-exit". As in this case, L1 will disable-interrupts and then send a self-IPI before entering L2. Reviewed-by: Nikita Leshchenko Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Liran Alon Signed-off-by: Radim Krčmář commit 564ad0aa85b3202311c4c8744fd1fdab4568d529 Merge: ed2ef2910064 df3190e22016 Author: Radim Krčmář Date: Fri Sep 7 18:38:25 2018 +0200 Merge tag 'kvm-arm-fixes-for-v4.19-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm Fixes for KVM/ARM for Linux v4.19 v2: - Fix a VFP corruption in 32-bit guest - Add missing cache invalidation for CoW pages - Two small cleanups commit c793279c77035053e67937f5743c6ebfc303e7c5 Author: Guenter Roeck Date: Thu Sep 6 09:47:51 2018 -0700 hwmon: (nct6775) Fix access to fan pulse registers Not all fans have a fan pulse register. This can result in reading beyond the end of REG_FAN_PULSES and FAN_PULSE_SHIFT arrays, and was reported by smatch as possible error. 1672 for (i = 0; i < ARRAY_SIZE(data->rpm); i++) { ^^^^^^^^^^^^^^^^^^^^^^^^ This is a 7 element array. ... 1685 data->fan_pulses[i] = 1686 (nct6775_read_value(data, data->REG_FAN_PULSES[i]) 1687 >> data->FAN_PULSE_SHIFT[i]) & 0x03; ^^^^^^^^^^^^^^^^^^^^^^^^ FAN_PULSE_SHIFT is either 5 or 6 elements. To fix the problem, we have to ensure that all REG_FAN_PULSES and FAN_PULSE_SHIFT have the appropriate length, and that REG_FAN_PULSES is only read if the register actually exists. Fixes: 6c009501ff200 ("hwmon: (nct6775) Add support for NCT6102D/6106D") Reported-by: Dan Carpenter Signed-off-by: Guenter Roeck commit ed2ef29100644eabc6099cbf1a3aa9d938555ab8 Merge: 732b53146ac8 df88f3181f10 Author: Radim Krčmář Date: Fri Sep 7 18:30:47 2018 +0200 Merge tag 'kvm-s390-master-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux KVM: s390: Fixes for 4.19 - Fallout from the hugetlbfs support: pfmf interpretion and locking - VSIE: fix keywrapping for nested guests commit df3190e22016abf74ef67c9691e9fa1012a66bd5 Author: Steven Price Date: Mon Aug 13 17:04:53 2018 +0100 arm64: KVM: Remove pgd_lock The lock has never been used and the page tables are protected by mmu_lock in struct kvm. Reviewed-by: Suzuki K Poulose Signed-off-by: Steven Price Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall commit a35381e10dc46dd75e65e4b3832d9a0005d48d44 Author: Marc Zyngier Date: Thu Aug 23 10:18:14 2018 +0100 KVM: Remove obsolete kvm_unmap_hva notifier backend kvm_unmap_hva is long gone, and we only have kvm_unmap_hva_range to deal with. Drop the now obsolete code. Fixes: fb1522e099f0 ("KVM: update to new mmu_notifier semantic v2") Cc: James Hogan Reviewed-by: Paolo Bonzini Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall commit 7d14919c0d475a795c0127631ac8ecb2b0f31831 Author: Marc Zyngier Date: Thu Aug 23 11:51:43 2018 +0100 arm64: KVM: Only force FPEXC32_EL2.EN if trapping FPSIMD If trapping FPSIMD in the context of an AArch32 guest, it is critical to set FPEXC32_EL2.EN to 1 so that the trapping is taken to EL2 and not EL1. Conversely, it is just as critical *not* to set FPEXC32_EL2.EN to 1 if we're not going to trap FPSIMD, as we then corrupt the existing VFP state. Moving the call to __activate_traps_fpsimd32 to the point where we know for sure that we are going to trap ensures that we don't set that bit spuriously. Fixes: e6b673b741ea ("KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing") Cc: stable@vger.kernel.org # v4.18 Cc: Dave Martin Reported-by: Alexander Graf Tested-by: Alexander Graf Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall commit 694556d54f354d3fe43bb2e61fd6103cca2638a4 Author: Marc Zyngier Date: Thu Aug 23 09:58:27 2018 +0100 KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW When triggering a CoW, we unmap the RO page via an MMU notifier (invalidate_range_start), and then populate the new PTE using another one (change_pte). In the meantime, we'll have copied the old page into the new one. The problem is that the data for the new page is sitting in the cache, and should the guest have an uncached mapping to that page (or its MMU off), following accesses will bypass the cache. In a way, this is similar to what happens on a translation fault: We need to clean the page to the PoC before mapping it. So let's just do that. This fixes a KVM unit test regression observed on a HiSilicon platform, and subsequently reproduced on Seattle. Fixes: a9c0e12ebee5 ("KVM: arm/arm64: Only clean the dcache on translation fault") Cc: stable@vger.kernel.org # v4.16+ Reported-by: Mike Galbraith Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall commit da4dfaf8428d9f71e2ac4f736bacb81adab36504 Author: Michal Simek Date: Fri Sep 7 08:02:05 2018 +0200 i2c: xiic: Record xilinx i2c with Zynq fragment Include xilinx soft i2c controller to Zynq fragment to make clear who is responsible for it. Signed-off-by: Michal Simek Signed-off-by: Wolfram Sang commit 80a6ec7d5e1653208eb53f6738620dab98f6f50e Author: Chen-Yu Tsai Date: Thu Sep 6 21:25:37 2018 +0800 clk: sunxi-ng: sun4i: Set VCO and PLL bias current to lowest setting The default mid-level PLL bias current setting interferes with sigma delta modulation. This manifests as decreased audio quality at lower sampling rates, which sounds like radio broadcast quality, and distortion noises at sampling rates at 48 kHz or above. Changing the bias current settings to the lowest gets rid of the noise. Fixes: de3448519194 ("clk: sunxi-ng: sun4i: Use sigma-delta modulation for audio PLL") Cc: # 4.15.x Signed-off-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard commit a6b7eb3b4176d9732d74d214b349932faa5524b4 Merge: f11fc4bc669b 5d128fbd8b20 Author: Rafael J. Wysocki Date: Fri Sep 7 10:05:20 2018 +0200 Merge branch 'acpi-bus' Merge ACPI core fix to avoid calling dmi_check_system() on non-x86. * acpi-bus: ACPI / bus: Only call dmi_check_system() on X86 commit 4c4af6900844ab04c9434c972021d7b48610e06a Author: Marek Lindner Date: Fri Sep 7 05:45:55 2018 +0800 batman-adv: fix hardif_neigh refcount on queue_work() failure The hardif_neigh refcounter is to be decreased by the queued work and currently is never decreased if the queue_work() call fails. Fix by checking the queue_work() return value and decrease refcount if necessary. Signed-off-by: Marek Lindner Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 5af96b9c59c72fb2af2d19c5cc2f3cdcee391dff Author: Marek Lindner Date: Fri Sep 7 05:45:54 2018 +0800 batman-adv: fix backbone_gw refcount on queue_work() failure The backbone_gw refcounter is to be decreased by the queued work and currently is never decreased if the queue_work() call fails. Fix by checking the queue_work() return value and decrease refcount if necessary. Signed-off-by: Marek Lindner Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 8f5c5fcf353302374b36232d6885c1a3b579e5ca Author: Cong Wang Date: Tue Sep 4 14:54:55 2018 -0700 tipc: call start and done ops directly in __tipc_nl_compat_dumpit() __tipc_nl_compat_dumpit() uses a netlink_callback on stack, so the only way to align it with other ->dumpit() call path is calling tipc_dump_start() and tipc_dump_done() directly inside it. Otherwise ->dumpit() would always get NULL from cb->args[]. But tipc_dump_start() uses sock_net(cb->skb->sk) to retrieve net pointer, the cb->skb here doesn't set skb->sk, the net pointer is saved in msg->net instead, so introduce a helper function __tipc_dump_start() to pass in msg->net. Ying pointed out cb->args[0...3] are already used by other callbacks on this call path, so we can't use cb->args[0] any more, use cb->args[4] instead. Fixes: 9a07efa9aea2 ("tipc: switch to rhashtable iterator") Reported-and-tested-by: syzbot+e93a2c41f91b8e2c7d9b@syzkaller.appspotmail.com Cc: Jon Maloy Cc: Ying Xue Signed-off-by: Cong Wang Acked-by: Ying Xue Signed-off-by: David S. Miller commit a49a9dcce802b3651013f659813df1361d306172 Merge: 631267f6adcc 67c6ed7cf9eb Author: Linus Torvalds Date: Thu Sep 6 20:19:57 2018 -0700 Merge tag 'drm-fixes-2018-09-07' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Seems to have been overly quiet this week so I expect next week will be more stuff, just one pull from Rodrigo with i915 fixes in it. Quoting Rodrigo: 'The critical fix here on display side is the DP MST regression one. But this pull also include fixes for DP SST, small VDSC register fix and GVT's bucked with "BXT fixes, two guest warning fixes, dmabuf format mod fix and one for recent multiple VM timeout failure'." * tag 'drm-fixes-2018-09-07' of git://anongit.freedesktop.org/drm/drm: drm/i915/dp_mst: Fix enabling pipe clock for all streams drm/i915/dsc: Fix PPS register definition macros for 2nd VDSC engine drm/i915: Re-apply "Perform link quality check, unconditionally during long pulse" drm/i915/gvt: Give new born vGPU higher scheduling chance drm/i915/gvt: Fix drm_format_mod value for vGPU plane drm/i915/gvt: move intel_runtime_pm_get out of spin_lock in stop_schedule drm/i915/gvt: Handle GEN9_WM_CHICKEN3 with F_CMD_ACCESS. drm/i915/gvt: Make correct handling to vreg BXT_PHY_CTL_FAMILY drm/i915/gvt: emulate gen9 dbuf ctl register access commit 631267f6adcc8d760d145dbd33d83d133d2733d7 Merge: 2601dd392dd1 c90bbce9eedd Author: Linus Torvalds Date: Thu Sep 6 19:35:30 2018 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu fix from Greg Ungerer: "A single change to fix booting on ColdFire platforms that have RAM starting at a non-0 address" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: fix early memory reservation for ColdFire MMU systems commit 67c6ed7cf9ebe53815f15bfdeb49ad91801c2235 Merge: 57361846b52b 2b82435cb90b Author: Dave Airlie Date: Fri Sep 7 11:06:58 2018 +1000 Merge tag 'drm-intel-fixes-2018-09-05' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes The critical fix here on display side is the DP MST regression one. But this pull also include fixes for DP SST, small VDSC register fix and GVT's bucked with "BXT fixes, two guest warning fixes, dmabuf format mod fix and one for recent multiple VM timeout failure." Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180905183000.GA2151@intel.com commit 2601dd392dd1cabd11935448c0afe3293feb27a3 Merge: c6ff25ce3564 0f02cfbc3d9e Author: Linus Torvalds Date: Thu Sep 6 15:42:10 2018 -0700 Merge tag 'mips_fixes_4.19_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fix from Paul Burton: "A single fix for v4.19-rc3, resolving a problem with our VDSO data page for systems with dcache aliasing. Those systems could previously observe stale data, causing clock_gettime() & gettimeofday() to return incorrect values" * tag 'mips_fixes_4.19_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: VDSO: Match data page cache colouring when D$ aliases commit c6ff25ce3564ac3a61f2f0a45d5d9c3af423359e Merge: ca16eb342ebe 395a2076b406 Author: Linus Torvalds Date: Thu Sep 6 15:39:11 2018 -0700 Merge tag '4.19-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Four small SMB3 fixes, three for stable, and one minor debug clarification" * tag '4.19-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: connect to servername instead of IP for IPC$ share smb3: check for and properly advertise directory lease support smb3: minor debugging clarifications in rfc1001 len processing SMB3: Backup intent flag missing for directory opens with backupuid mounts fs/cifs: don't translate SFM_SLASH (U+F026) to backslash commit e2c631ba75a7e727e8db0a9d30a06bfd434adb3a Author: Peter Zijlstra Date: Wed Sep 5 10:41:58 2018 +0200 clocksource: Revert "Remove kthread" I turns out that the silly spawn kthread from worker was actually needed. clocksource_watchdog_kthread() cannot be called directly from clocksource_watchdog_work(), because clocksource_select() calls timekeeping_notify() which uses stop_machine(). One cannot use stop_machine() from a workqueue() due lock inversions wrt CPU hotplug. Revert the patch but add a comment that explain why we jump through such apparently silly hoops. Fixes: 7197e77abcb6 ("clocksource: Remove kthread") Reported-by: Siegfried Metz Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Tested-by: Niklas Cassel Tested-by: Kevin Shanahan Tested-by: viktor_jaegerskuepper@freenet.de Tested-by: Siegfried Metz Cc: rafael.j.wysocki@intel.com Cc: len.brown@intel.com Cc: diego.viola@gmail.com Cc: rui.zhang@intel.com Cc: bjorn.andersson@linaro.org Link: https://lkml.kernel.org/r/20180905084158.GR24124@hirez.programming.kicks-ass.net commit 5380c05b682991a6818c3755d450a3e87eeac0e5 Author: Heinz Mauelshagen Date: Thu Sep 6 14:02:54 2018 -0400 dm raid: bump target version, update comments and documentation Bump target version to reflect the documented fixes are available. Also fix some code comments (typos and clarity). Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit 36a240a706d43383bbdd377522501ddd2e5771f6 Author: Heinz Mauelshagen Date: Thu Sep 6 22:54:29 2018 +0200 dm raid: fix RAID leg rebuild errors On fast devices such as NVMe, a flaw in rs_get_progress() results in false target status output when userspace lvm2 requests leg rebuilds (symptom of the failure is device health chars 'aaaaaaaa' instead of expected 'aAaAAAAA' causing lvm2 to fail). The correct sync action state definitions already exist in decipher_sync_action() so fix rs_get_progress() to use it. Change decipher_sync_action() to return an enum rather than a string for the sync states and call it from rs_get_progress(). Introduce sync_str() to translate from enum to the string that is needed by raid_status(). Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit c44a5ee803d2b7ed8c2e6ce24a5c4dd60778886e Author: Heinz Mauelshagen Date: Thu Sep 6 18:33:40 2018 +0200 dm raid: fix rebuild of specific devices by updating superblock Update superblock when particular devices are requested via rebuild (e.g. lvconvert --replace ...) to avoid spurious failure with the "New device injected into existing raid set without 'delta_disks' or 'rebuild' parameter specified" error message. Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit 644e2537fdc77baeeefc829524937bca64329f82 Author: Heinz Mauelshagen Date: Thu Sep 6 18:33:39 2018 +0200 dm raid: fix stripe adding reshape deadlock When initiating a stripe adding reshape, a deadlock between md_stop_writes() waiting for the sync thread to stop and the running sync thread waiting for inactive stripes occurs (this frequently happens on single-core but rarely on multi-core systems). Fix this deadlock by setting MD_RECOVERY_WAIT to have the main MD resynchronization thread worker (md_do_sync()) bail out when initiating the reshape via constructor arguments. Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit ca16eb342ebedbf3bb1d8450048fe428895b0b65 Merge: db44bf4b4768 d5274b3cd6a8 Author: Linus Torvalds Date: Thu Sep 6 14:01:15 2018 -0700 Merge tag 'for-linus-20180906' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Small collection of fixes that should go into this release. This contains: - Small series that fixes a race between blkcg teardown and writeback (Dennis Zhou) - Fix disallowing invalid block size settings from the nbd ioctl (me) - BFQ fix for a use-after-free on last release of a bfqg (Konstantin Khlebnikov) - Fix for the "don't warn for flush" fix (Mikulas)" * tag 'for-linus-20180906' of git://git.kernel.dk/linux-block: block: bfq: swap puts in bfqg_and_blkg_put block: don't warn when doing fsync on read-only devices nbd: don't allow invalid blocksize settings blkcg: use tryget logic when associating a blkg with a bio blkcg: delay blkg destruction until after writeback has finished Revert "blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()" commit 53b0cc46f27cfc2cadca609b503a7d92b5185a47 Author: Ben Skeggs Date: Tue Sep 4 15:57:11 2018 +1000 drm/nouveau/disp/gm200-: enforce identity-mapped SOR assignment for LVDS/eDP panels Fixes eDP backlight issues on more recent laptops. Signed-off-by: Ben Skeggs commit e04cfdc9b7398c60dbc70212415ea63b6c6a93ae Author: Ben Skeggs Date: Tue Sep 4 15:57:09 2018 +1000 drm/nouveau/disp: fix DP disable race If a HPD pulse signalling the need to retrain the link occurs between the KMS driver releasing the output and the supervisor interrupt that finishes the teardown, it was possible get a NULL-ptr deref. Avoid this by marking the link as inactive earlier. Signed-off-by: Ben Skeggs commit f6d52b2172b1adfde010df34730290c282ee641b Author: Ben Skeggs Date: Tue Sep 4 15:57:07 2018 +1000 drm/nouveau/disp: move eDP panel power handling We need to do this earlier to prevent aux channel timeouts in resume paths on certain systems. Signed-off-by: Ben Skeggs commit 606557708fa06ebf21372d8fabf6f97529ab2349 Author: Ben Skeggs Date: Tue Sep 4 15:57:04 2018 +1000 drm/nouveau/disp: remove unused struct member Signed-off-by: Ben Skeggs commit 0a6986c6595e9afd20ff7280dab36431c1e467f8 Author: Ben Skeggs Date: Tue Sep 4 15:56:57 2018 +1000 drm/nouveau/TBDdevinit: don't fail when PMU/PRE_OS is missing from VBIOS This Falcon application doesn't appear to be present on some newer systems, so let's not fail init if we can't find it. TBD: is there a way to determine whether it *should* be there? Signed-off-by: Ben Skeggs commit 51ed833c881b9d96557c773f6a37018d79e29a46 Author: Ben Skeggs Date: Tue Aug 28 14:10:42 2018 +1000 drm/nouveau/mmu: don't attempt to dereference vmm without valid instance pointer Fixes oopses in certain failure paths. Signed-off-by: Ben Skeggs commit a43b16dda2d7485f5c5aed075c1dc9785e339515 Author: Ben Skeggs Date: Tue Aug 28 14:10:34 2018 +1000 drm/nouveau: fix oops in client init failure path The NV_ERROR macro requires drm->client to be initialised, which it may not be at this stage of the init process. Signed-off-by: Ben Skeggs commit d5986a1c4dcd00cb8b9eee4a56ee93868222a9a2 Author: Lyude Paul Date: Thu Aug 30 13:16:28 2018 -0400 drm/nouveau: Fix nouveau_connector_ddc_detect() It looks like that when we moved over to using drm_connector_for_each_possible_encoder() in nouveau, that one rather important part of this function got dropped by accident: /* Right v here */ for (i = 0; nv_encoder = NULL, i < DRM_CONNECTOR_MAX_ENCODER; i++) { int id = connector->encoder_ids[i]; if (id == 0) break; Since it's rather difficult to notice: the conditional in this loop is actually: nv_encoder = NULL, i < DRM_CONNECTOR_MAX_ENCODER Meaning that all early breaks result in nv_encoder keeping it's value, otherwise nv_encoder = NULL. Ugh. Since this got dropped, nouveau_connector_ddc_detect() now returns an encoder for every single connector, regardless of whether or not it's detected: [ 1780.056185] nouveau 0000:01:00.0: DRM: DDC responded, but no EDID for DP-2 So: fix this to ensure we only return an encoder if we actually found one, and clean up the rest of the function while we're at it since it's nearly impossible to read properly. Changes since v1: - Don't skip ddc probing for LVDS if we can't switch DDC through vga-switcheroo, just do the DDC probing without calling vga_switcheroo_lock_ddc() - skeggsb Signed-off-by: Lyude Paul Cc: Ville Syrjälä Fixes: ddba766dd07e ("drm/nouveau: Use drm_connector_for_each_possible_encoder()") Reviewed-by: Ville Syrjälä Signed-off-by: Ben Skeggs commit 2f7ca781fd382cf8dde73ed36dfdd93fd05b3332 Author: Lyude Paul Date: Tue Aug 7 17:32:48 2018 -0400 drm/nouveau/drm/nouveau: Don't forget to cancel hpd_work on suspend/unload Currently, there's nothing in nouveau that actually cancels this work struct. So, cancel it on suspend/unload. Otherwise, if we're unlucky enough hpd_work might try to keep running up until the system is suspended. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs commit 79e765ad665da4b8aa7e9c878bd2fef837f6fea5 Author: Lyude Paul Date: Thu Aug 16 16:13:13 2018 -0400 drm/nouveau/drm/nouveau: Prevent handling ACPI HPD events too early On most systems with ACPI hotplugging support, it seems that we always receive a hotplug event once we re-enable EC interrupts even if the GPU hasn't even been resumed yet. This can cause problems since even though we schedule hpd_work to handle connector reprobing for us, hpd_work synchronizes on pm_runtime_get_sync() to wait until the device is ready to perform reprobing. Since runtime suspend/resume callbacks are disabled before the PM core calls ->suspend(), any calls to pm_runtime_get_sync() during this period will grab a runtime PM ref and return immediately with -EACCES. Because we schedule hpd_work from our ACPI HPD handler, and hpd_work synchronizes on pm_runtime_get_sync(), this causes us to launch a connector reprobe immediately even if the GPU isn't actually resumed just yet. This causes various warnings in dmesg and occasionally, also prevents some displays connected to the dedicated GPU from coming back up after suspend. Example: usb 1-4: USB disconnect, device number 14 usb 1-4.1: USB disconnect, device number 15 WARNING: CPU: 0 PID: 838 at drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h:170 nouveau_dp_detect+0x17e/0x370 [nouveau] CPU: 0 PID: 838 Comm: kworker/0:6 Not tainted 4.17.14-201.Lyude.bz1477182.V3.fc28.x86_64 #1 Hardware name: LENOVO 20EQS64N00/20EQS64N00, BIOS N1EET77W (1.50 ) 03/28/2018 Workqueue: events nouveau_display_hpd_work [nouveau] RIP: 0010:nouveau_dp_detect+0x17e/0x370 [nouveau] RSP: 0018:ffffa15143933cf0 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff8cb4f656c400 RCX: 0000000000000000 RDX: ffffa1514500e4e4 RSI: ffffa1514500e4e4 RDI: 0000000001009002 RBP: ffff8cb4f4a8a800 R08: ffffa15143933cfd R09: ffffa15143933cfc R10: 0000000000000000 R11: 0000000000000000 R12: ffff8cb4fb57a000 R13: ffff8cb4fb57a000 R14: ffff8cb4f4a8f800 R15: ffff8cb4f656c418 FS: 0000000000000000(0000) GS:ffff8cb51f400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f78ec938000 CR3: 000000073720a003 CR4: 00000000003606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? _cond_resched+0x15/0x30 nouveau_connector_detect+0x2ce/0x520 [nouveau] ? _cond_resched+0x15/0x30 ? ww_mutex_lock+0x12/0x40 drm_helper_probe_detect_ctx+0x8b/0xe0 [drm_kms_helper] drm_helper_hpd_irq_event+0xa8/0x120 [drm_kms_helper] nouveau_display_hpd_work+0x2a/0x60 [nouveau] process_one_work+0x187/0x340 worker_thread+0x2e/0x380 ? pwq_unbound_release_workfn+0xd0/0xd0 kthread+0x112/0x130 ? kthread_create_worker_on_cpu+0x70/0x70 ret_from_fork+0x35/0x40 Code: 4c 8d 44 24 0d b9 00 05 00 00 48 89 ef ba 09 00 00 00 be 01 00 00 00 e8 e1 09 f8 ff 85 c0 0f 85 b2 01 00 00 80 7c 24 0c 03 74 02 <0f> 0b 48 89 ef e8 b8 07 f8 ff f6 05 51 1b c8 ff 02 0f 84 72 ff ---[ end trace 55d811b38fc8e71a ]--- So, to fix this we attempt to grab a runtime PM reference in the ACPI handler itself asynchronously. If the GPU is already awake (it will have normal hotplugging at this point) or runtime PM callbacks are currently disabled on the device, we drop our reference without updating the autosuspend delay. We only schedule connector reprobes when we successfully managed to queue up a resume request with our asynchronous PM ref. This also has the added benefit of preventing redundant connector reprobes from ACPI while the GPU is runtime resumed! Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Cc: Karol Herbst Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1477182#c41 Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs commit fa3cdf8d0b092c4561f9f017dfac409eb7644737 Author: Lyude Paul Date: Thu Aug 9 18:22:06 2018 -0400 drm/nouveau: Reset MST branching unit before enabling When probing a new MST device, it's not safe to make any assumptions about it's current state. While most well mannered MST hubs will just disable the branching unit on hotplug disconnects, this isn't enough to save us from various other scenarios that might have resulted in something writing to the MST branching unit before we got control of it. This could happen if a previous probe we tried failed, if we're booting in kexec context and the hub is still in the state the last kernel put it in, etc. Luckily; there is no reason we can't just reset the branching unit every time we enable a new topology. So, fix this by resetting it on enabling new topologies to ensure that we always start off with a clean, unmodified topology state on MST sinks. This fixes occasional hard-lockups on my P50's laptop dock (e.g. AUX times out all DPCD trasactions) observed after multiple docks, undocks, and module reloads. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Cc: Karol Herbst Signed-off-by: Ben Skeggs commit b26b4590dd53e012526342e749c423e6c0e73437 Author: Lyude Paul Date: Thu Aug 9 18:22:05 2018 -0400 drm/nouveau: Only write DP_MSTM_CTRL when needed Currently, nouveau will re-write the DP_MSTM_CTRL register for an MST hub every time it receives a long HPD pulse on DP. This isn't actually necessary and additionally, has some unintended side effects. With the P50 I've got here, rewriting DP_MSTM_CTRL constantly seems to make it rather likely (1 out of 5 times usually) that bringing up MST with it's ThinkPad dock will fail and result in sideband messages timing out in the middle. Afterwards, successive probes don't manage to get the dock to communicate properly over MST sideband properly. Many times sideband message timeouts from MST hubs are indicative of either the source or the sink dropping an ESI event, which can cause DRM's perspective of the topology's current state to go out of sync with reality. While it's tough to really know for sure what's happening to the dock, using userspace tools to write to DP_MSTM_CTRL in the middle of the MST link probing process does appear to make things flaky. It's possible that when we write to DP_MSTM_CTRL, the function that gets triggered to respond in the dock's firmware temporarily puts it in a state where it might end up not reporting an ESI to the source, or ends up dropping a sideband message we sent it. So, to fix this we make it so that when probing an MST topology, we respect it's current state. If the dock's already enabled, we simply read DP_MSTM_CTRL and disable the topology if it's value is not what we expected. Otherwise, we perform the normal MST probing dance. We avoid taking any action except if the state of the MST topology actually changes. This fixes MST sideband message timeouts and detection failures on my P50 with its ThinkPad dock. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Cc: Karol Herbst Signed-off-by: Ben Skeggs commit 7326ead9828e5eb5c6030d80310241c404e919f9 Author: Lyude Paul Date: Wed Aug 15 15:15:13 2018 -0400 drm/nouveau: Remove useless poll_enable() call in drm_load() Again, this doesn't do anything. drm_kms_helper_poll_enable() will have already been called in nouveau_display_init() Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Acked-by: Daniel Vetter Cc: Lukas Wunner Signed-off-by: Ben Skeggs commit 0d7b2d4def679cae3bf2728fc31be7f8a48ceab3 Author: Lyude Paul Date: Wed Aug 15 15:15:12 2018 -0400 drm/nouveau: Remove useless poll_disable() call in switcheroo_set_state() This won't do anything but potentially make us miss hotplugs. We already call drm_kms_helper_poll_disable() in nouveau_pmops_suspend()->nouveau_display_suspend()->nouveau_display_fini() Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Acked-by: Daniel Vetter Cc: Lukas Wunner Signed-off-by: Ben Skeggs commit 0445f7537d0742e4f8bcf594a8d81fb901fd131e Author: Lyude Paul Date: Wed Aug 15 15:15:11 2018 -0400 drm/nouveau: Remove useless poll_enable() call in switcheroo_set_state() This doesn't do anything, drm_kms_helper_poll_enable() gets called in nouveau_pmops_resume()->nouveau_display_resume()->nouveau_display_init() already. Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Acked-by: Daniel Vetter Cc: Lukas Wunner Signed-off-by: Ben Skeggs commit 3e1a12754d4df5804bfca5dedf09d2ba291bdc2a Author: Lyude Paul Date: Wed Aug 15 15:00:15 2018 -0400 drm/nouveau: Fix deadlocks in nouveau_connector_detect() When we disable hotplugging on the GPU, we need to be able to synchronize with each connector's hotplug interrupt handler before the interrupt is finally disabled. This can be a problem however, since nouveau_connector_detect() currently grabs a runtime power reference when handling connector probing. This will deadlock the runtime suspend handler like so: [ 861.480896] INFO: task kworker/0:2:61 blocked for more than 120 seconds. [ 861.483290] Tainted: G O 4.18.0-rc6Lyude-Test+ #1 [ 861.485158] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 861.486332] kworker/0:2 D 0 61 2 0x80000000 [ 861.487044] Workqueue: events nouveau_display_hpd_work [nouveau] [ 861.487737] Call Trace: [ 861.488394] __schedule+0x322/0xaf0 [ 861.489070] schedule+0x33/0x90 [ 861.489744] rpm_resume+0x19c/0x850 [ 861.490392] ? finish_wait+0x90/0x90 [ 861.491068] __pm_runtime_resume+0x4e/0x90 [ 861.491753] nouveau_display_hpd_work+0x22/0x60 [nouveau] [ 861.492416] process_one_work+0x231/0x620 [ 861.493068] worker_thread+0x44/0x3a0 [ 861.493722] kthread+0x12b/0x150 [ 861.494342] ? wq_pool_ids_show+0x140/0x140 [ 861.494991] ? kthread_create_worker_on_cpu+0x70/0x70 [ 861.495648] ret_from_fork+0x3a/0x50 [ 861.496304] INFO: task kworker/6:2:320 blocked for more than 120 seconds. [ 861.496968] Tainted: G O 4.18.0-rc6Lyude-Test+ #1 [ 861.497654] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 861.498341] kworker/6:2 D 0 320 2 0x80000080 [ 861.499045] Workqueue: pm pm_runtime_work [ 861.499739] Call Trace: [ 861.500428] __schedule+0x322/0xaf0 [ 861.501134] ? wait_for_completion+0x104/0x190 [ 861.501851] schedule+0x33/0x90 [ 861.502564] schedule_timeout+0x3a5/0x590 [ 861.503284] ? mark_held_locks+0x58/0x80 [ 861.503988] ? _raw_spin_unlock_irq+0x2c/0x40 [ 861.504710] ? wait_for_completion+0x104/0x190 [ 861.505417] ? trace_hardirqs_on_caller+0xf4/0x190 [ 861.506136] ? wait_for_completion+0x104/0x190 [ 861.506845] wait_for_completion+0x12c/0x190 [ 861.507555] ? wake_up_q+0x80/0x80 [ 861.508268] flush_work+0x1c9/0x280 [ 861.508990] ? flush_workqueue_prep_pwqs+0x1b0/0x1b0 [ 861.509735] nvif_notify_put+0xb1/0xc0 [nouveau] [ 861.510482] nouveau_display_fini+0xbd/0x170 [nouveau] [ 861.511241] nouveau_display_suspend+0x67/0x120 [nouveau] [ 861.511969] nouveau_do_suspend+0x5e/0x2d0 [nouveau] [ 861.512715] nouveau_pmops_runtime_suspend+0x47/0xb0 [nouveau] [ 861.513435] pci_pm_runtime_suspend+0x6b/0x180 [ 861.514165] ? pci_has_legacy_pm_support+0x70/0x70 [ 861.514897] __rpm_callback+0x7a/0x1d0 [ 861.515618] ? pci_has_legacy_pm_support+0x70/0x70 [ 861.516313] rpm_callback+0x24/0x80 [ 861.517027] ? pci_has_legacy_pm_support+0x70/0x70 [ 861.517741] rpm_suspend+0x142/0x6b0 [ 861.518449] pm_runtime_work+0x97/0xc0 [ 861.519144] process_one_work+0x231/0x620 [ 861.519831] worker_thread+0x44/0x3a0 [ 861.520522] kthread+0x12b/0x150 [ 861.521220] ? wq_pool_ids_show+0x140/0x140 [ 861.521925] ? kthread_create_worker_on_cpu+0x70/0x70 [ 861.522622] ret_from_fork+0x3a/0x50 [ 861.523299] INFO: task kworker/6:0:1329 blocked for more than 120 seconds. [ 861.523977] Tainted: G O 4.18.0-rc6Lyude-Test+ #1 [ 861.524644] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 861.525349] kworker/6:0 D 0 1329 2 0x80000000 [ 861.526073] Workqueue: events nvif_notify_work [nouveau] [ 861.526751] Call Trace: [ 861.527411] __schedule+0x322/0xaf0 [ 861.528089] schedule+0x33/0x90 [ 861.528758] rpm_resume+0x19c/0x850 [ 861.529399] ? finish_wait+0x90/0x90 [ 861.530073] __pm_runtime_resume+0x4e/0x90 [ 861.530798] nouveau_connector_detect+0x7e/0x510 [nouveau] [ 861.531459] ? ww_mutex_lock+0x47/0x80 [ 861.532097] ? ww_mutex_lock+0x47/0x80 [ 861.532819] ? drm_modeset_lock+0x88/0x130 [drm] [ 861.533481] drm_helper_probe_detect_ctx+0xa0/0x100 [drm_kms_helper] [ 861.534127] drm_helper_hpd_irq_event+0xa4/0x120 [drm_kms_helper] [ 861.534940] nouveau_connector_hotplug+0x98/0x120 [nouveau] [ 861.535556] nvif_notify_work+0x2d/0xb0 [nouveau] [ 861.536221] process_one_work+0x231/0x620 [ 861.536994] worker_thread+0x44/0x3a0 [ 861.537757] kthread+0x12b/0x150 [ 861.538463] ? wq_pool_ids_show+0x140/0x140 [ 861.539102] ? kthread_create_worker_on_cpu+0x70/0x70 [ 861.539815] ret_from_fork+0x3a/0x50 [ 861.540521] Showing all locks held in the system: [ 861.541696] 2 locks held by kworker/0:2/61: [ 861.542406] #0: 000000002dbf8af5 ((wq_completion)"events"){+.+.}, at: process_one_work+0x1b3/0x620 [ 861.543071] #1: 0000000076868126 ((work_completion)(&drm->hpd_work)){+.+.}, at: process_one_work+0x1b3/0x620 [ 861.543814] 1 lock held by khungtaskd/64: [ 861.544535] #0: 0000000059db4b53 (rcu_read_lock){....}, at: debug_show_all_locks+0x23/0x185 [ 861.545160] 3 locks held by kworker/6:2/320: [ 861.545896] #0: 00000000d9e1bc59 ((wq_completion)"pm"){+.+.}, at: process_one_work+0x1b3/0x620 [ 861.546702] #1: 00000000c9f92d84 ((work_completion)(&dev->power.work)){+.+.}, at: process_one_work+0x1b3/0x620 [ 861.547443] #2: 000000004afc5de1 (drm_connector_list_iter){.+.+}, at: nouveau_display_fini+0x96/0x170 [nouveau] [ 861.548146] 1 lock held by dmesg/983: [ 861.548889] 2 locks held by zsh/1250: [ 861.549605] #0: 00000000348e3cf6 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x37/0x40 [ 861.550393] #1: 000000007009a7a8 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0xc1/0x870 [ 861.551122] 6 locks held by kworker/6:0/1329: [ 861.551957] #0: 000000002dbf8af5 ((wq_completion)"events"){+.+.}, at: process_one_work+0x1b3/0x620 [ 861.552765] #1: 00000000ddb499ad ((work_completion)(¬ify->work)#2){+.+.}, at: process_one_work+0x1b3/0x620 [ 861.553582] #2: 000000006e013cbe (&dev->mode_config.mutex){+.+.}, at: drm_helper_hpd_irq_event+0x6c/0x120 [drm_kms_helper] [ 861.554357] #3: 000000004afc5de1 (drm_connector_list_iter){.+.+}, at: drm_helper_hpd_irq_event+0x78/0x120 [drm_kms_helper] [ 861.555227] #4: 0000000044f294d9 (crtc_ww_class_acquire){+.+.}, at: drm_helper_probe_detect_ctx+0x3d/0x100 [drm_kms_helper] [ 861.556133] #5: 00000000db193642 (crtc_ww_class_mutex){+.+.}, at: drm_modeset_lock+0x4b/0x130 [drm] [ 861.557864] ============================================= [ 861.559507] NMI backtrace for cpu 2 [ 861.560363] CPU: 2 PID: 64 Comm: khungtaskd Tainted: G O 4.18.0-rc6Lyude-Test+ #1 [ 861.561197] Hardware name: LENOVO 20EQS64N0B/20EQS64N0B, BIOS N1EET78W (1.51 ) 05/18/2018 [ 861.561948] Call Trace: [ 861.562757] dump_stack+0x8e/0xd3 [ 861.563516] nmi_cpu_backtrace.cold.3+0x14/0x5a [ 861.564269] ? lapic_can_unplug_cpu.cold.27+0x42/0x42 [ 861.565029] nmi_trigger_cpumask_backtrace+0xa1/0xae [ 861.565789] arch_trigger_cpumask_backtrace+0x19/0x20 [ 861.566558] watchdog+0x316/0x580 [ 861.567355] kthread+0x12b/0x150 [ 861.568114] ? reset_hung_task_detector+0x20/0x20 [ 861.568863] ? kthread_create_worker_on_cpu+0x70/0x70 [ 861.569598] ret_from_fork+0x3a/0x50 [ 861.570370] Sending NMI from CPU 2 to CPUs 0-1,3-7: [ 861.571426] NMI backtrace for cpu 6 skipped: idling at intel_idle+0x7f/0x120 [ 861.571429] NMI backtrace for cpu 7 skipped: idling at intel_idle+0x7f/0x120 [ 861.571432] NMI backtrace for cpu 3 skipped: idling at intel_idle+0x7f/0x120 [ 861.571464] NMI backtrace for cpu 5 skipped: idling at intel_idle+0x7f/0x120 [ 861.571467] NMI backtrace for cpu 0 skipped: idling at intel_idle+0x7f/0x120 [ 861.571469] NMI backtrace for cpu 4 skipped: idling at intel_idle+0x7f/0x120 [ 861.571472] NMI backtrace for cpu 1 skipped: idling at intel_idle+0x7f/0x120 [ 861.572428] Kernel panic - not syncing: hung_task: blocked tasks So: fix this by making it so that normal hotplug handling /only/ happens so long as the GPU is currently awake without any pending runtime PM requests. In the event that a hotplug occurs while the device is suspending or resuming, we can simply defer our response until the GPU is fully runtime resumed again. Changes since v4: - Use a new trick I came up with using pm_runtime_get() instead of the hackish junk we had before Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Acked-by: Daniel Vetter Cc: stable@vger.kernel.org Cc: Lukas Wunner Signed-off-by: Ben Skeggs commit 6833fb1ec120bf078e1a527c573a09d4de286224 Author: Lyude Paul Date: Wed Aug 15 15:00:14 2018 -0400 drm/nouveau/drm/nouveau: Use pm_runtime_get_noresume() in connector_detect() It's true we can't resume the device from poll workers in nouveau_connector_detect(). We can however, prevent the autosuspend timer from elapsing immediately if it hasn't already without risking any sort of deadlock with the runtime suspend/resume operations. So do that instead of entirely avoiding grabbing a power reference. Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Acked-by: Daniel Vetter Cc: stable@vger.kernel.org Cc: Lukas Wunner Signed-off-by: Ben Skeggs commit 7fec8f5379fb6eddabc0aaef6d2304c366808f97 Author: Lyude Paul Date: Wed Aug 15 15:00:13 2018 -0400 drm/nouveau/drm/nouveau: Fix deadlock with fb_helper with async RPM requests Currently, nouveau uses the generic drm_fb_helper_output_poll_changed() function provided by DRM as it's output_poll_changed callback. Unfortunately however, this function doesn't grab runtime PM references early enough and even if it did-we can't block waiting for the device to resume in output_poll_changed() since it's very likely that we'll need to grab the fb_helper lock at some point during the runtime resume process. This currently results in deadlocking like so: [ 246.669625] INFO: task kworker/4:0:37 blocked for more than 120 seconds. [ 246.673398] Not tainted 4.18.0-rc5Lyude-Test+ #2 [ 246.675271] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 246.676527] kworker/4:0 D 0 37 2 0x80000000 [ 246.677580] Workqueue: events output_poll_execute [drm_kms_helper] [ 246.678704] Call Trace: [ 246.679753] __schedule+0x322/0xaf0 [ 246.680916] schedule+0x33/0x90 [ 246.681924] schedule_preempt_disabled+0x15/0x20 [ 246.683023] __mutex_lock+0x569/0x9a0 [ 246.684035] ? kobject_uevent_env+0x117/0x7b0 [ 246.685132] ? drm_fb_helper_hotplug_event.part.28+0x20/0xb0 [drm_kms_helper] [ 246.686179] mutex_lock_nested+0x1b/0x20 [ 246.687278] ? mutex_lock_nested+0x1b/0x20 [ 246.688307] drm_fb_helper_hotplug_event.part.28+0x20/0xb0 [drm_kms_helper] [ 246.689420] drm_fb_helper_output_poll_changed+0x23/0x30 [drm_kms_helper] [ 246.690462] drm_kms_helper_hotplug_event+0x2a/0x30 [drm_kms_helper] [ 246.691570] output_poll_execute+0x198/0x1c0 [drm_kms_helper] [ 246.692611] process_one_work+0x231/0x620 [ 246.693725] worker_thread+0x214/0x3a0 [ 246.694756] kthread+0x12b/0x150 [ 246.695856] ? wq_pool_ids_show+0x140/0x140 [ 246.696888] ? kthread_create_worker_on_cpu+0x70/0x70 [ 246.697998] ret_from_fork+0x3a/0x50 [ 246.699034] INFO: task kworker/0:1:60 blocked for more than 120 seconds. [ 246.700153] Not tainted 4.18.0-rc5Lyude-Test+ #2 [ 246.701182] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 246.702278] kworker/0:1 D 0 60 2 0x80000000 [ 246.703293] Workqueue: pm pm_runtime_work [ 246.704393] Call Trace: [ 246.705403] __schedule+0x322/0xaf0 [ 246.706439] ? wait_for_completion+0x104/0x190 [ 246.707393] schedule+0x33/0x90 [ 246.708375] schedule_timeout+0x3a5/0x590 [ 246.709289] ? mark_held_locks+0x58/0x80 [ 246.710208] ? _raw_spin_unlock_irq+0x2c/0x40 [ 246.711222] ? wait_for_completion+0x104/0x190 [ 246.712134] ? trace_hardirqs_on_caller+0xf4/0x190 [ 246.713094] ? wait_for_completion+0x104/0x190 [ 246.713964] wait_for_completion+0x12c/0x190 [ 246.714895] ? wake_up_q+0x80/0x80 [ 246.715727] ? get_work_pool+0x90/0x90 [ 246.716649] flush_work+0x1c9/0x280 [ 246.717483] ? flush_workqueue_prep_pwqs+0x1b0/0x1b0 [ 246.718442] __cancel_work_timer+0x146/0x1d0 [ 246.719247] cancel_delayed_work_sync+0x13/0x20 [ 246.720043] drm_kms_helper_poll_disable+0x1f/0x30 [drm_kms_helper] [ 246.721123] nouveau_pmops_runtime_suspend+0x3d/0xb0 [nouveau] [ 246.721897] pci_pm_runtime_suspend+0x6b/0x190 [ 246.722825] ? pci_has_legacy_pm_support+0x70/0x70 [ 246.723737] __rpm_callback+0x7a/0x1d0 [ 246.724721] ? pci_has_legacy_pm_support+0x70/0x70 [ 246.725607] rpm_callback+0x24/0x80 [ 246.726553] ? pci_has_legacy_pm_support+0x70/0x70 [ 246.727376] rpm_suspend+0x142/0x6b0 [ 246.728185] pm_runtime_work+0x97/0xc0 [ 246.728938] process_one_work+0x231/0x620 [ 246.729796] worker_thread+0x44/0x3a0 [ 246.730614] kthread+0x12b/0x150 [ 246.731395] ? wq_pool_ids_show+0x140/0x140 [ 246.732202] ? kthread_create_worker_on_cpu+0x70/0x70 [ 246.732878] ret_from_fork+0x3a/0x50 [ 246.733768] INFO: task kworker/4:2:422 blocked for more than 120 seconds. [ 246.734587] Not tainted 4.18.0-rc5Lyude-Test+ #2 [ 246.735393] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 246.736113] kworker/4:2 D 0 422 2 0x80000080 [ 246.736789] Workqueue: events_long drm_dp_mst_link_probe_work [drm_kms_helper] [ 246.737665] Call Trace: [ 246.738490] __schedule+0x322/0xaf0 [ 246.739250] schedule+0x33/0x90 [ 246.739908] rpm_resume+0x19c/0x850 [ 246.740750] ? finish_wait+0x90/0x90 [ 246.741541] __pm_runtime_resume+0x4e/0x90 [ 246.742370] nv50_disp_atomic_commit+0x31/0x210 [nouveau] [ 246.743124] drm_atomic_commit+0x4a/0x50 [drm] [ 246.743775] restore_fbdev_mode_atomic+0x1c8/0x240 [drm_kms_helper] [ 246.744603] restore_fbdev_mode+0x31/0x140 [drm_kms_helper] [ 246.745373] drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xb0 [drm_kms_helper] [ 246.746220] drm_fb_helper_set_par+0x2d/0x50 [drm_kms_helper] [ 246.746884] drm_fb_helper_hotplug_event.part.28+0x96/0xb0 [drm_kms_helper] [ 246.747675] drm_fb_helper_output_poll_changed+0x23/0x30 [drm_kms_helper] [ 246.748544] drm_kms_helper_hotplug_event+0x2a/0x30 [drm_kms_helper] [ 246.749439] nv50_mstm_hotplug+0x15/0x20 [nouveau] [ 246.750111] drm_dp_send_link_address+0x177/0x1c0 [drm_kms_helper] [ 246.750764] drm_dp_check_and_send_link_address+0xa8/0xd0 [drm_kms_helper] [ 246.751602] drm_dp_mst_link_probe_work+0x51/0x90 [drm_kms_helper] [ 246.752314] process_one_work+0x231/0x620 [ 246.752979] worker_thread+0x44/0x3a0 [ 246.753838] kthread+0x12b/0x150 [ 246.754619] ? wq_pool_ids_show+0x140/0x140 [ 246.755386] ? kthread_create_worker_on_cpu+0x70/0x70 [ 246.756162] ret_from_fork+0x3a/0x50 [ 246.756847] Showing all locks held in the system: [ 246.758261] 3 locks held by kworker/4:0/37: [ 246.759016] #0: 00000000f8df4d2d ((wq_completion)"events"){+.+.}, at: process_one_work+0x1b3/0x620 [ 246.759856] #1: 00000000e6065461 ((work_completion)(&(&dev->mode_config.output_poll_work)->work)){+.+.}, at: process_one_work+0x1b3/0x620 [ 246.760670] #2: 00000000cb66735f (&helper->lock){+.+.}, at: drm_fb_helper_hotplug_event.part.28+0x20/0xb0 [drm_kms_helper] [ 246.761516] 2 locks held by kworker/0:1/60: [ 246.762274] #0: 00000000fff6be0f ((wq_completion)"pm"){+.+.}, at: process_one_work+0x1b3/0x620 [ 246.762982] #1: 000000005ab44fb4 ((work_completion)(&dev->power.work)){+.+.}, at: process_one_work+0x1b3/0x620 [ 246.763890] 1 lock held by khungtaskd/64: [ 246.764664] #0: 000000008cb8b5c3 (rcu_read_lock){....}, at: debug_show_all_locks+0x23/0x185 [ 246.765588] 5 locks held by kworker/4:2/422: [ 246.766440] #0: 00000000232f0959 ((wq_completion)"events_long"){+.+.}, at: process_one_work+0x1b3/0x620 [ 246.767390] #1: 00000000bb59b134 ((work_completion)(&mgr->work)){+.+.}, at: process_one_work+0x1b3/0x620 [ 246.768154] #2: 00000000cb66735f (&helper->lock){+.+.}, at: drm_fb_helper_restore_fbdev_mode_unlocked+0x4c/0xb0 [drm_kms_helper] [ 246.768966] #3: 000000004c8f0b6b (crtc_ww_class_acquire){+.+.}, at: restore_fbdev_mode_atomic+0x4b/0x240 [drm_kms_helper] [ 246.769921] #4: 000000004c34a296 (crtc_ww_class_mutex){+.+.}, at: drm_modeset_backoff+0x8a/0x1b0 [drm] [ 246.770839] 1 lock held by dmesg/1038: [ 246.771739] 2 locks held by zsh/1172: [ 246.772650] #0: 00000000836d0438 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x37/0x40 [ 246.773680] #1: 000000001f4f4d48 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0xc1/0x870 [ 246.775522] ============================================= After trying dozens of different solutions, I found one very simple one that should also have the benefit of preventing us from having to fight locking for the rest of our lives. So, we work around these deadlocks by deferring all fbcon hotplug events that happen after the runtime suspend process starts until after the device is resumed again. Changes since v7: - Fixup commit message - Daniel Vetter Changes since v6: - Remove unused nouveau_fbcon_hotplugged_in_suspend() - Ilia Changes since v5: - Come up with the (hopefully final) solution for solving this dumb problem, one that is a lot less likely to cause issues with locking in the future. This should work around all deadlock conditions with fbcon brought up thus far. Changes since v4: - Add nouveau_fbcon_hotplugged_in_suspend() to workaround deadlock condition that Lukas described - Just move all of this out of drm_fb_helper. It seems that other DRM drivers have already figured out other workarounds for this. If other drivers do end up needing this in the future, we can just move this back into drm_fb_helper again. Changes since v3: - Actually check if fb_helper is NULL in both new helpers - Actually check drm_fbdev_emulation in both new helpers - Don't fire off a fb_helper hotplug unconditionally; only do it if the following conditions are true (as otherwise, calling this in the wrong spot will cause Bad Things to happen): - fb_helper hotplug handling was actually inhibited previously - fb_helper actually has a delayed hotplug pending - fb_helper is actually bound - fb_helper is actually initialized - Add __must_check to drm_fb_helper_suspend_hotplug(). There's no situation where a driver would actually want to use this without checking the return value, so enforce that - Rewrite and clarify the documentation for both helpers. - Make sure to return true in the drm_fb_helper_suspend_hotplug() stub that's provided in drm_fb_helper.h when CONFIG_DRM_FBDEV_EMULATION isn't enabled - Actually grab the toplevel fb_helper lock in drm_fb_helper_resume_hotplug(), since it's possible other activity (such as a hotplug) could be going on at the same time the driver calls drm_fb_helper_resume_hotplug(). We need this to check whether or not drm_fb_helper_hotplug_event() needs to be called anyway Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Acked-by: Daniel Vetter Cc: stable@vger.kernel.org Cc: Lukas Wunner Signed-off-by: Ben Skeggs commit 611ce855420a6e8b9ff47af5f47431d52c7709f8 Author: Lyude Paul Date: Wed Aug 15 15:00:12 2018 -0400 drm/nouveau: Remove duplicate poll_enable() in pmops_runtime_suspend() Since actual hotplug notifications don't get disabled until nouveau_display_fini() is called, all this will do is cause any hotplugs that happen between this drm_kms_helper_poll_disable() call and the actual hotplug disablement to potentially be dropped if ACPI isn't around to help us. Signed-off-by: Lyude Paul Acked-by: Karol Herbst Acked-by: Daniel Vetter Cc: stable@vger.kernel.org Cc: Lukas Wunner Signed-off-by: Ben Skeggs commit d77ef138ff572409ab93d492e5e6c826ee6fb21d Author: Lyude Paul Date: Wed Aug 15 15:00:11 2018 -0400 drm/nouveau/drm/nouveau: Fix bogus drm_kms_helper_poll_enable() placement Turns out this part is my fault for not noticing when reviewing 9a2eba337cace ("drm/nouveau: Fix drm poll_helper handling"). Currently we call drm_kms_helper_poll_enable() from nouveau_display_hpd_work(). This makes basically no sense however, because that means we're calling drm_kms_helper_poll_enable() every time we schedule the hotplug detection work. This is also against the advice mentioned in drm_kms_helper_poll_enable()'s documentation: Note that calls to enable and disable polling must be strictly ordered, which is automatically the case when they're only call from suspend/resume callbacks. Of course, hotplugs can't really be ordered. They could even happen immediately after we called drm_kms_helper_poll_disable() in nouveau_display_fini(), which can lead to all sorts of issues. Additionally; enabling polling /after/ we call drm_helper_hpd_irq_event() could also mean that we'd miss a hotplug event anyway, since drm_helper_hpd_irq_event() wouldn't bother trying to probe connectors so long as polling is disabled. So; simply move this back into nouveau_display_init() again. The race condition that both of these patches attempted to work around has already been fixed properly in d61a5c106351 ("drm/nouveau: Fix deadlock on runtime suspend") Fixes: 9a2eba337cace ("drm/nouveau: Fix drm poll_helper handling") Signed-off-by: Lyude Paul Acked-by: Karol Herbst Acked-by: Daniel Vetter Cc: Lukas Wunner Cc: Peter Ujfalusi Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs commit 8f28b178f71cc56eccf2a6e2c0ace17c82f900d7 Author: Leon Romanovsky Date: Mon Sep 3 09:11:14 2018 +0300 RDMA/mlx4: Ensure that maximal send/receive SGE less than supported by HW In calculating the global maximum number of the Scatter/Gather elements supported, the following four maximum parameters must be taken into consideration: max_sg_rq, max_sg_sq, max_desc_sz_rq and max_desc_sz_sq. However instead of bringing this complexity to query_device, which still won't be sufficient anyway (the calculations are dependent on QP type), the safer approach will be to restore old code, which will give us 32 SGEs. Fixes: 33023fb85a42 ("IB/core: add max_send_sge and max_recv_sge attributes") Reported-by: Chuck Lever Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 954a8e3aea87e896e320cf648c1a5bbe47de443e Author: Parav Pandit Date: Thu Aug 30 08:35:19 2018 +0300 RDMA/cma: Protect cma dev list with lock When AF_IB addresses are used during rdma_resolve_addr() a lock is not held. A cma device can get removed while list traversal is in progress which may lead to crash. ie CPU0 CPU1 ==== ==== rdma_resolve_addr() cma_resolve_ib_dev() list_for_each() cma_remove_one() cur_dev->device mutex_lock(&lock) list_del(); mutex_unlock(&lock); cma_process_remove(); Therefore, hold a lock while traversing the list which avoids such situation. Cc: # 3.10 Fixes: f17df3b0dede ("RDMA/cma: Add support for AF_IB to rdma_resolve_addr()") Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Reviewed-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit ae7304c3ea28a3ba47a7a8312c76c654ef24967e Author: Shubhrajyoti Datta Date: Mon Sep 3 15:11:11 2018 +0530 i2c: xiic: Make the start and the byte count write atomic Disable interrupts while configuring the transfer and enable them back. We have below as the programming sequence 1. start and slave address 2. byte count and stop In some customer platform there was a lot of interrupts between 1 and 2 and after slave address (around 7 clock cyles) if 2 is not executed then the transaction is nacked. To fix this case make the 2 writes atomic. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek [wsa: added a newline for better readability] Signed-off-by: Wolfram Sang Cc: stable@kernel.org commit 4cb205c0c50f613e2de91f0eb19d5247ed003e89 Author: Jia He Date: Tue Aug 28 12:53:26 2018 +0800 irqchip/gic-v3-its: Cap lpi_id_bits to reduce memory footprint Commit fe8e93504ce8 ("irqchip/gic-v3-its: Use full range of LPIs"), removes the cap for lpi_id_bits, which causes the following warning to trigger on a QDF2400 server: WARNING: CPU: 0 PID: 0 at mm/page_alloc.c:4066 __alloc_pages_nodemask ... Call trace: __alloc_pages_nodemask+0x2d8/0x1188 alloc_pages_current+0x8c/0xd8 its_allocate_prop_table+0x5c/0xb8 its_init+0x220/0x3c0 gic_init_bases+0x250/0x380 gic_acpi_init+0x16c/0x2a4 In its_alloc_lpi_tables(), lpi_id_bits is 24 in QDF2400. The allocation in allocate_prop_table() tries therefore to allocate 16M (order 12 if pagesize=4k), which triggers the warning. As said by MarcL Capping lpi_id_bits at 16 (which is what we had before) is plenty, will save a some memory, and gives some margin before we need to push it up again. Bring the upper limit of lpi_id_bits back to prevent Fixes: fe8e93504ce8 ("irqchip/gic-v3-its: Use full range of LPIs") Suggested-by: Marc Zyngier Signed-off-by: Jia He Signed-off-by: Thomas Gleixner Acked-by: Marc Zyngier Tested-by: Olof Johansson Cc: Jason Cooper Cc: linux-arm-kernel@lists.infradead.org Link: https://lkml.kernel.org/r/1535432006-2304-1-git-send-email-jia.he@hxt-semitech.com commit ef439d49e0bfb26cd5f03c88b4cb7cc9073ed30c Author: Max Filippov Date: Thu Sep 6 11:19:20 2018 -0700 xtensa: ISS: don't allocate memory in platform_setup Memory allocator is not initialized at that point yet, use static array instead. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov commit 7035c568999d6774ff35459a0280eb33e0207168 Author: Lei Yang Date: Thu Sep 6 13:47:23 2018 +0800 cgroup: kselftests: add test_core to .gitignore Update .gitignore file. Signed-off-by: Lei Yang Signed-off-by: Shuah Khan (Samsung OSG) commit 38b0bd0cda07d34ad6f145fce675ead74739c44e Author: Heinz Mauelshagen Date: Thu Sep 6 18:33:38 2018 +0200 dm raid: fix reshape race on small devices Loading a new mapping table, the dm-raid target's constructor retrieves the volatile reshaping state from the raid superblocks. When the new table is activated in a following resume, the actual reshape position is retrieved. The reshape driven by the previous mapping can already have finished on small and/or fast devices thus updating raid superblocks about the new raid layout. This causes the actual array state (e.g. stripe size reshape finished) to be inconsistent with the one in the new mapping, causing hangs with left behind devices. This race does not occur with usual raid device sizes but with small ones (e.g. those created by the lvm2 test suite). Fix by no longer transferring stale/inconsistent raid_set state during preresume. Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit d5274b3cd6a814ccb2f56d81ee87cbbf51bd4cf7 Author: Konstantin Khlebnikov Date: Thu Sep 6 11:05:44 2018 +0300 block: bfq: swap puts in bfqg_and_blkg_put Fix trivial use-after-free. This could be last reference to bfqg. Fixes: 8f9bebc33dd7 ("block, bfq: access and cache blkg data only when safe") Acked-by: Paolo Valente Signed-off-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe commit 432061b3da64e488be3403124a72a9250bbe96d4 Author: Mikulas Patocka Date: Wed Sep 5 09:17:45 2018 -0400 dm: disable CRYPTO_TFM_REQ_MAY_SLEEP to fix a GFP_KERNEL recursion deadlock There's a XFS on dm-crypt deadlock, recursing back to itself due to the crypto subsystems use of GFP_KERNEL, reported here: https://bugzilla.kernel.org/show_bug.cgi?id=200835 * dm-crypt calls crypt_convert in xts mode * init_crypt from xts.c calls kmalloc(GFP_KERNEL) * kmalloc(GFP_KERNEL) recurses into the XFS filesystem, the filesystem tries to submit some bios and wait for them, causing a deadlock Fix this by updating both the DM crypt and integrity targets to no longer use the CRYPTO_TFM_REQ_MAY_SLEEP flag, which will change the crypto allocations from GFP_KERNEL to GFP_ATOMIC, therefore they can't recurse into a filesystem. A GFP_ATOMIC allocation can fail, but init_crypt() in xts.c handles the allocation failure gracefully - it will fall back to preallocated buffer if the allocation fails. The crypto API maintainer says that the crypto API only needs to allocate memory when dealing with unaligned buffers and therefore turning CRYPTO_TFM_REQ_MAY_SLEEP off is safe (see this discussion: https://www.redhat.com/archives/dm-devel/2018-August/msg00195.html ) Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 6b45a2b1c0bc2aec84d1c56a1976ca9c8a621ecb Author: Bartosz Golaszewski Date: Thu Sep 6 14:12:19 2018 +0200 memory: ti-aemif: fix a potential NULL-pointer dereference Platform data pointer may be NULL. We check it everywhere but in one place. Fix it. Fixes: 8af70cd2ca50 ("memory: aemif: add support for board files") Reported-by: Dan Carpenter Signed-off-by: Bartosz Golaszewski Cc: stable@vger.kernel.org Signed-off-by: Olof Johansson commit fac880c7d074fdfca874114b5c47b36aa034e4ee Author: Mark Rutland Date: Wed Sep 5 17:38:57 2018 +0100 arm64: fix erroneous warnings in page freeing functions In pmd_free_pte_page() and pud_free_pmd_page() we try to warn if they hit a present non-table entry. In both cases we'll warn for non-present entries, as the VM_WARN_ON() only checks the entry is not a table entry. This has been observed to result in warnings when booting a v4.19-rc2 kernel under qemu. Fix this by bailing out earlier for non-present entries. Fixes: ec28bb9c9b0826d7 ("arm64: Implement page table free interfaces") Signed-off-by: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Will Deacon commit e312b6dcbb633bc87414f1143e0015adbbf87ae0 Merge: 96d529bac562 d07f05fb8643 Author: Olof Johansson Date: Thu Sep 6 10:00:03 2018 -0700 Merge tag 'arm-soc/for-4.19/drivers-fixes' of https://github.com/Broadcom/stblinux into fixes This pull request contains Broadcom ARM/ARM64 SoCs drivers fixes for 4.19, please pull the following: - Peter adds an alias to the Raspberry Pi HWMON driver that was just merged as part of the 4.19 merge window * tag 'arm-soc/for-4.19/drivers-fixes' of https://github.com/Broadcom/stblinux: hwmon: rpi: add module alias to raspberrypi-hwmon Signed-off-by: Olof Johansson commit 96d529bac562574600eda85726fcfa3eef6dde8e Author: Sudeep Holla Date: Thu Sep 6 16:10:39 2018 +0100 firmware: arm_scmi: fix divide by zero when sustained_perf_level is zero Firmware can provide zero as values for sustained performance level and corresponding sustained frequency in kHz in order to hide the actual frequencies and provide only abstract values. It may endup with divide by zero scenario resulting in kernel panic. Let's set the multiplication factor to one if either one or both of them (sustained_perf_level and sustained_freq) are set to zero. Fixes: a9e3fbfaa0ff ("firmware: arm_scmi: add initial support for performance protocol") Reported-by: Ionela Voinescu Signed-off-by: Sudeep Holla Signed-off-by: Olof Johansson commit db44bf4b4768a0664d3c9d9000ecb747de31ded8 Merge: be65e2595b4c edf4e7b7b910 Author: Linus Torvalds Date: Thu Sep 6 09:42:14 2018 -0700 Merge tag 'apparmor-pr-2018-09-06' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor Pull apparmor fix from John Johansen: "A fix for an issue syzbot discovered last week: - Fix for bad debug check when converting secids to secctx" * tag 'apparmor-pr-2018-09-06' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor: apparmor: fix bad debug check in apparmor_secid_to_secctx() commit be65e2595b4c1fbeceba336d8ee83406726b1d8d Merge: 5404525b98c2 d1c392c9e2a3 Author: Linus Torvalds Date: Thu Sep 6 09:06:49 2018 -0700 Merge tag 'trace-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This fixes two annoying bugs: - The first one is a side effect caused by using SRCU for rcuidle tracepoints. It seems that the perf was depending on the rcuidle tracepoints to make RCU watch when it wasn't. The real fix will be to have perf use SRCU instead of depending on RCU watching, but that can't be done until SRCU is safe to use in NMI context (Paul's working on that). - The second bug fix is for a bug that's been periodically making my tests fail randomly for some time. I haven't had time to track it down, but finally have. It has to do with stressing NMIs (via perf) while enabling or disabling ftrace function handling with lockdep enabled. If an interrupt happens and just as it returns, it sets lockdep back to "interrupts enabled" but before it returns an NMI is triggered, and if this happens while printk_nmi_enter has a breakpoint attached to it (because ftrace is converting it to or from nop to call fentry), the breakpoint trap also calls into lockdep, and since returning from the NMI to a interrupt handler, interrupts were disabled when the NMI went off, lockdep keeps its state as interrupts disabled when it returns back from the interrupt handler where interrupts are enabled. This causes lockdep_assert_irqs_enabled() to trigger a false positive" * tag 'trace-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: printk/tracing: Do not trace printk_nmi_enter() tracing: Add back in rcu_irq_enter/exit_irqson() for rcuidle tracepoints commit 5404525b98c2fa18b8bd47047f9bf2e67825c857 Merge: b36fdc6853a3 b6fdfbff0789 Author: Linus Torvalds Date: Thu Sep 6 09:04:45 2018 -0700 Merge tag 'for-4.19-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - fix for improper fsync after hardlink - fix for a corruption during file deduplication - use after free fixes - RCU warning fix - fix for buffered write to nodatacow file * tag 'for-4.19-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: Fix suspicious RCU usage warning in btrfs_debug_in_rcu btrfs: use after free in btrfs_quota_enable btrfs: btrfs_shrink_device should call commit transaction at the end btrfs: fix qgroup_free wrong num_bytes in btrfs_subvolume_reserve_metadata Btrfs: fix data corruption when deduplicating between different files Btrfs: sync log after logging new name Btrfs: fix unexpected failure of nocow buffered writes after snapshotting when low on space commit d1c392c9e2a301f38998a353f467f76414e38725 Author: Steven Rostedt (VMware) Date: Wed Sep 5 16:29:49 2018 -0400 printk/tracing: Do not trace printk_nmi_enter() I hit the following splat in my tests: ------------[ cut here ]------------ IRQs not enabled as expected WARNING: CPU: 3 PID: 0 at kernel/time/tick-sched.c:982 tick_nohz_idle_enter+0x44/0x8c Modules linked in: ip6t_REJECT nf_reject_ipv6 ip6table_filter ip6_tables ipv6 CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.19.0-rc2-test+ #2 Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 02/22/2014 EIP: tick_nohz_idle_enter+0x44/0x8c Code: ec 05 00 00 00 75 26 83 b8 c0 05 00 00 00 75 1d 80 3d d0 36 3e c1 00 75 14 68 94 63 12 c1 c6 05 d0 36 3e c1 01 e8 04 ee f8 ff <0f> 0b 58 fa bb a0 e5 66 c1 e8 25 0f 04 00 64 03 1d 28 31 52 c1 8b EAX: 0000001c EBX: f26e7f8c ECX: 00000006 EDX: 00000007 ESI: f26dd1c0 EDI: 00000000 EBP: f26e7f40 ESP: f26e7f38 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010296 CR0: 80050033 CR2: 0813c6b0 CR3: 2f342000 CR4: 001406f0 Call Trace: do_idle+0x33/0x202 cpu_startup_entry+0x61/0x63 start_secondary+0x18e/0x1ed startup_32_smp+0x164/0x168 irq event stamp: 18773830 hardirqs last enabled at (18773829): [] trace_hardirqs_on_thunk+0xc/0x10 hardirqs last disabled at (18773830): [] trace_hardirqs_off_thunk+0xc/0x10 softirqs last enabled at (18773824): [] __do_softirq+0x25f/0x2bf softirqs last disabled at (18773767): [] call_on_stack+0x45/0x4b ---[ end trace b7c64aa79e17954a ]--- After a bit of debugging, I found what was happening. This would trigger when performing "perf" with a high NMI interrupt rate, while enabling and disabling function tracer. Ftrace uses breakpoints to convert the nops at the start of functions to calls to the function trampolines. The breakpoint traps disable interrupts and this makes calls into lockdep via the trace_hardirqs_off_thunk in the entry.S code. What happens is the following: do_idle { [interrupts enabled] [interrupts disabled] TRACE_IRQS_OFF [lockdep says irqs off] [...] TRACE_IRQS_IRET test if pt_regs say return to interrupts enabled [yes] TRACE_IRQS_ON [lockdep says irqs are on] nmi_enter() { printk_nmi_enter() [traced by ftrace] [ hit ftrace breakpoint ] TRACE_IRQS_OFF [lockdep says irqs off] [...] TRACE_IRQS_IRET [return from breakpoint] test if pt_regs say interrupts enabled [no] [iret back to interrupt] [iret back to code] tick_nohz_idle_enter() { lockdep_assert_irqs_enabled() [lockdep say no!] Although interrupts are indeed enabled, lockdep thinks it is not, and since we now do asserts via lockdep, it gives a false warning. The issue here is that printk_nmi_enter() is called before lockdep_off(), which disables lockdep (for this reason) in NMIs. By simply not allowing ftrace to see printk_nmi_enter() (via notrace annotation) we keep lockdep from getting confused. Cc: stable@vger.kernel.org Fixes: 42a0bb3f71383 ("printk/nmi: generic solution for safe printk in NMI") Acked-by: Sergey Senozhatsky Acked-by: Petr Mladek Signed-off-by: Steven Rostedt (VMware) commit 6da410d97ffa486eb0379236d5444e5f4527c07a Merge: fce471e3c119 ad9421e36a77 Author: David S. Miller Date: Thu Sep 6 07:56:04 2018 -0700 Merge tag 'mlx5e-fixes-2018-09-05' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2018-09-05 This pull request contains some fixes for mlx5 etherent netdevice and core driver. Please pull and let me know if there's any problem. For -stable v4.9: ('net/mlx5: Fix debugfs cleanup in the device init/remove flow') For -stable v4.12: ("net/mlx5: E-Switch, Fix memory leak when creating switchdev mode FDB tables") For -stable v4.13: ("net/mlx5: Fix use-after-free in self-healing flow") For -stable v4.14: ("net/mlx5: Check for error in mlx5_attach_interface") For -stable v4.15: ("net/mlx5: Fix not releasing read lock when adding flow rules") For -stable v4.17: ("net/mlx5: Fix possible deadlock from lockdep when adding fte to fg") For -stable v4.18: ("net/mlx5: Use u16 for Work Queue buffer fragment size") ==================== Signed-off-by: David S. Miller commit 52cf93e63ee672a92f349edc6ddad86ec8808fd8 Author: Kai-Heng Feng Date: Thu Sep 6 10:55:18 2018 +0800 HID: i2c-hid: Don't reset device upon system resume Raydium touchscreen triggers interrupt storm after system-wide suspend: [ 179.085033] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete report (58/65535) According to Raydium, Windows driver does not reset the device after system resume. The HID over I2C spec does specify a reset should be used at intialization, but it doesn't specify if reset is required for system suspend. Tested this patch on other i2c-hid touchpanels I have and those touchpanels do work after S3 without doing reset. If any regression happens to other touchpanel vendors, we can use quirk for Raydium devices. There's still one device uses I2C_HID_QUIRK_RESEND_REPORT_DESCR so keep it there. Cc: Aaron Ma Cc: AceLan Kao Signed-off-by: Kai-Heng Feng Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit e92c0eaf754310f9f31e9229a3f7274a67478f82 Author: Ilya Dryomov Date: Wed Aug 22 17:26:10 2018 +0200 rbd: support cloning across namespaces If parent_get class method is not supported by the OSDs, fall back to the legacy class method and assume that the parent is in the default (i.e. "") namespace. The "use the child's image namespace" workaround is no longer needed because creating images within namespaces will require parent_get aware OSDs. Signed-off-by: Ilya Dryomov Reviewed-by: Jason Dillaman commit eb3b2d6be4b5e1612827b986cca241c5d104fc41 Author: Ilya Dryomov Date: Wed Aug 22 17:11:27 2018 +0200 rbd: factor out get_parent_info() In preparation for the new parent_get and parent_overlap_get class methods, factor out the fetching and decoding of parent data. As a side effect, we now decode all four fields in the "no parent" case. Signed-off-by: Ilya Dryomov Reviewed-by: Jason Dillaman commit 8aaff15168cfbc7c8980fdb0e8a585f1afe56ec0 Author: Ilya Dryomov Date: Fri Aug 24 15:32:43 2018 +0200 ceph: avoid a use-after-free in ceph_destroy_options() syzbot reported a use-after-free in ceph_destroy_options(), called from ceph_mount(). The problem was that create_fs_client() consumed the opt pointer on some errors, but not on all of them. Make sure it always consumes both libceph and ceph options. Reported-by: syzbot+8ab6f1042021b4eed062@syzkaller.appspotmail.com Signed-off-by: Ilya Dryomov Reviewed-by: "Yan, Zheng" commit 69fa6eb7d6a64801ea261025cce9723d9442d773 Author: Thomas Gleixner Date: Thu Sep 6 15:21:38 2018 +0200 cpu/hotplug: Prevent state corruption on error rollback When a teardown callback fails, the CPU hotplug code brings the CPU back to the previous state. The previous state becomes the new target state. The rollback happens in undo_cpu_down() which increments the state unconditionally even if the state is already the same as the target. As a consequence the next CPU hotplug operation will start at the wrong state. This is easily to observe when __cpu_disable() fails. Prevent the unconditional undo by checking the state vs. target before incrementing state and fix up the consequently wrong conditional in the unplug code which handles the failure of the final CPU take down on the control CPU side. Fixes: 4dddfb5faa61 ("smp/hotplug: Rewrite AP state machine core") Reported-by: Neeraj Upadhyay Signed-off-by: Thomas Gleixner Tested-by: Geert Uytterhoeven Tested-by: Sudeep Holla Tested-by: Neeraj Upadhyay Cc: josh@joshtriplett.org Cc: peterz@infradead.org Cc: jiangshanlai@gmail.com Cc: dzickus@redhat.com Cc: brendan.jackman@arm.com Cc: malat@debian.org Cc: sramana@codeaurora.org Cc: linux-arm-msm@vger.kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1809051419580.1416@nanos.tec.linutronix.de ---- commit f8b7530aa0a1def79c93101216b5b17cf408a70a Author: Neeraj Upadhyay Date: Wed Sep 5 11:22:07 2018 +0530 cpu/hotplug: Adjust misplaced smb() in cpuhp_thread_fun() The smp_mb() in cpuhp_thread_fun() is misplaced. It needs to be after the load of st->should_run to prevent reordering of the later load/stores w.r.t. the load of st->should_run. Fixes: 4dddfb5faa61 ("smp/hotplug: Rewrite AP state machine core") Signed-off-by: Neeraj Upadhyay Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: josh@joshtriplett.org Cc: peterz@infradead.org Cc: jiangshanlai@gmail.com Cc: dzickus@redhat.com Cc: brendan.jackman@arm.com Cc: malat@debian.org Cc: mojha@codeaurora.org Cc: sramana@codeaurora.org Cc: linux-arm-msm@vger.kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1536126727-11629-1-git-send-email-neeraju@codeaurora.org commit ae3cdc97dc10c7a3b31f297dab429bfb774c9ccb Author: Sven Eckelmann Date: Sun Aug 12 21:04:45 2018 +0200 batman-adv: Prevent duplicated tvlv handler The function batadv_tvlv_handler_register is responsible for adding new tvlv_handler to the handler_list. It first checks whether the entry already is in the list or not. If it is, then the creation of a new entry is aborted. But the lock for the list is only held when the list is really modified. This could lead to duplicated entries because another context could create an entry with the same key between the check and the list manipulation. The check and the manipulation of the list must therefore be in the same locked code section. Fixes: ef26157747d4 ("batman-adv: tvlv - basic infrastructure") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit e7136e48ffdfb9f37b0820f619380485eb407361 Author: Sven Eckelmann Date: Sun Aug 12 21:04:44 2018 +0200 batman-adv: Prevent duplicated global TT entry The function batadv_tt_global_orig_entry_add is responsible for adding new tt_orig_list_entry to the orig_list. It first checks whether the entry already is in the list or not. If it is, then the creation of a new entry is aborted. But the lock for the list is only held when the list is really modified. This could lead to duplicated entries because another context could create an entry with the same key between the check and the list manipulation. The check and the manipulation of the list must therefore be in the same locked code section. Fixes: d657e621a0f5 ("batman-adv: add reference counting for type batadv_tt_orig_list_entry") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 94cb82f594ed86be303398d6dfc7640a6f1d45d4 Author: Sven Eckelmann Date: Sun Aug 12 21:04:43 2018 +0200 batman-adv: Prevent duplicated softif_vlan entry The function batadv_softif_vlan_get is responsible for adding new softif_vlan to the softif_vlan_list. It first checks whether the entry already is in the list or not. If it is, then the creation of a new entry is aborted. But the lock for the list is only held when the list is really modified. This could lead to duplicated entries because another context could create an entry with the same key between the check and the list manipulation. The check and the manipulation of the list must therefore be in the same locked code section. Fixes: 5d2c05b21337 ("batman-adv: add per VLAN interface attribute framework") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 9fe6299dde587788f245e9f7a5a1b296fad4e8c7 Author: Jann Horn Date: Fri Aug 31 21:41:51 2018 +0200 x86/process: Don't mix user/kernel regs in 64bit __show_regs() When the kernel.print-fatal-signals sysctl has been enabled, a simple userspace crash will cause the kernel to write a crash dump that contains, among other things, the kernel gsbase into dmesg. As suggested by Andy, limit output to pt_regs, FS_BASE and KERNEL_GS_BASE in this case. This also moves the bitness-specific logic from show_regs() into process_{32,64}.c. Fixes: 45807a1df9f5 ("vdso: print fatal signals") Signed-off-by: Jann Horn Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Greg Kroah-Hartman Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180831194151.123586-1-jannh@google.com commit 17f6bac2249356c795339e03a0742cd79be3cab8 Author: Chuanhua Lei Date: Thu Sep 6 18:03:23 2018 +0800 x86/tsc: Prevent result truncation on 32bit Loops per jiffy is calculated by multiplying tsc_khz with 1e3 and then dividing it by HZ. Both tsc_khz and the temporary variable holding the multiplication result are of type unsigned long, so on 32bit the result is truncated to the lower 32bit. Use u64 as type for the temporary variable and cast tsc_khz to it before multiplying. [ tglx: Massaged changelog and removed pointless braces ] Fixes: cf7a63ef4e02 ("x86/tsc: Calibrate tsc only once") Signed-off-by: Chuanhua Lei Signed-off-by: Thomas Gleixner Cc: yixin.zhu@linux.intel.com Cc: "H. Peter Anvin" Cc: Peter Zijlstra Cc: Len Brown Cc: Pavel Tatashin Cc: Rajvi Jingar Cc: Dou Liyang Link: https://lkml.kernel.org/r/1536228203-18701-1-git-send-email-chuanhua.lei@linux.intel.com commit fa122fec8640eb7186ce5a41b83a4c1744ceef8f Author: Sven Eckelmann Date: Sun Aug 12 21:04:42 2018 +0200 batman-adv: Prevent duplicated nc_node entry The function batadv_nc_get_nc_node is responsible for adding new nc_nodes to the in_coding_list and out_coding_list. It first checks whether the entry already is in the list or not. If it is, then the creation of a new entry is aborted. But the lock for the list is only held when the list is really modified. This could lead to duplicated entries because another context could create an entry with the same key between the check and the list manipulation. The check and the manipulation of the list must therefore be in the same locked code section. Fixes: d56b1705e28c ("batman-adv: network coding - detect coding nodes and remove these after timeout") Signed-off-by: Sven Eckelmann Acked-by: Marek Lindner Signed-off-by: Simon Wunderlich commit dff9bc42ab0b2d38c5e90ddd79b238fed5b4c7ad Author: Sven Eckelmann Date: Sun Aug 12 21:04:41 2018 +0200 batman-adv: Prevent duplicated gateway_node entry The function batadv_gw_node_add is responsible for adding new gw_node to the gateway_list. It is expecting that the caller already checked that there is not already an entry with the same key or not. But the lock for the list is only held when the list is really modified. This could lead to duplicated entries because another context could create an entry with the same key between the check and the list manipulation. The check and the manipulation of the list must therefore be in the same locked code section. Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol") Signed-off-by: Sven Eckelmann Acked-by: Marek Lindner Signed-off-by: Simon Wunderlich commit a25bab9d723a08bd0bdafb1529faf9094c690b70 Author: Sven Eckelmann Date: Fri Aug 31 16:56:29 2018 +0200 batman-adv: Fix segfault when writing to sysfs elp_interval The per hardif sysfs file "batman_adv/elp_interval" is using the generic functions to store/show uint values. The helper __batadv_store_uint_attr requires the softif net_device as parameter to print the resulting change as info text when the users writes to this file. It uses the helper function batadv_info to add it at the same time to the kernel ring buffer and to the batman-adv debug log (when CONFIG_BATMAN_ADV_DEBUG is enabled). The function batadv_info requires as first parameter the batman-adv softif net_device. This parameter is then used to find the private buffer which contains the debug log for this batman-adv interface. But batadv_store_throughput_override used as first argument the slave net_device. This slave device doesn't have the batadv_priv private data which is access by batadv_info. Writing to this file with CONFIG_BATMAN_ADV_DEBUG enabled can either lead to a segfault or to memory corruption. Fixes: 0744ff8fa8fa ("batman-adv: Add hard_iface specific sysfs wrapper macros for UINT") Signed-off-by: Sven Eckelmann Acked-by: Marek Lindner Signed-off-by: Simon Wunderlich commit b9fd14c20871e6189f635e49b32d7789e430b3c8 Author: Sven Eckelmann Date: Fri Aug 31 16:46:47 2018 +0200 batman-adv: Fix segfault when writing to throughput_override The per hardif sysfs file "batman_adv/throughput_override" prints the resulting change as info text when the users writes to this file. It uses the helper function batadv_info to add it at the same time to the kernel ring buffer and to the batman-adv debug log (when CONFIG_BATMAN_ADV_DEBUG is enabled). The function batadv_info requires as first parameter the batman-adv softif net_device. This parameter is then used to find the private buffer which contains the debug log for this batman-adv interface. But batadv_store_throughput_override used as first argument the slave net_device. This slave device doesn't have the batadv_priv private data which is access by batadv_info. Writing to this file with CONFIG_BATMAN_ADV_DEBUG enabled can either lead to a segfault or to memory corruption. Fixes: 0b5ecc6811bd ("batman-adv: add throughput override attribute to hard_ifaces") Signed-off-by: Sven Eckelmann Acked-by: Marek Lindner Signed-off-by: Simon Wunderlich commit 88d0895d0ea9d4431507d576c963f2ff9918144d Author: Sven Eckelmann Date: Fri Aug 31 15:08:44 2018 +0200 batman-adv: Avoid probe ELP information leak The probe ELPs for WiFi interfaces are expanded to contain at least BATADV_ELP_MIN_PROBE_SIZE bytes. This is usually a lot more than the number of bytes which the template ELP packet requires. These extra padding bytes were not initialized and thus could contain data which were previously stored at the same location. It is therefore required to set it to some predefined or random values to avoid leaking private information from the system transmitting these kind of packets. Fixes: e4623c913508 ("batman-adv: Avoid probe ELP information leak") Signed-off-by: Sven Eckelmann Acked-by: Antonio Quartulli Signed-off-by: Simon Wunderlich commit f11fc4bc669b8622510c1039499f5a9d24248fec Author: Zhang Rui Date: Mon Sep 3 10:00:07 2018 +0800 ACPI / LPSS: Force LPSS quirks on boot Commit 12864ff8545f (ACPI / LPSS: Avoid PM quirks on suspend and resume from hibernation) bypasses lpss quirks for S3 and S4, by setting a flag for S3/S4 in acpi_lpss_suspend(), and check that flag in acpi_lpss_resume(). But this overlooks the boot case where acpi_lpss_resume() may get called without a corresponding acpi_lpss_suspend() having been called. Thus force setting the flag during boot. Fixes: 12864ff8545f (ACPI / LPSS: Avoid PM quirks on suspend and resume from hibernation) Link: https://bugzilla.kernel.org/show_bug.cgi?id=200989 Reported-and-tested-by: William Lieurance Signed-off-by: Zhang Rui Cc: 4.15+ # 4.15+: 12864ff8545f (ACPI / LPSS: Avoid ...) Signed-off-by: Rafael J. Wysocki commit 5d128fbd8b20f8a48cb13c3eced789d1f9573ecd Author: Jean Delvare Date: Tue Sep 4 14:55:26 2018 +0200 ACPI / bus: Only call dmi_check_system() on X86 Calling dmi_check_system() early only works on X86. Other architectures initialize the DMI subsystem later so it's not ready yet when ACPI itself gets initialized. In the best case it results in a useless call to a function which will do nothing. But depending on the dmi implementation, it could also result in warnings. Best is to not call the function when it can't work and isn't needed. Additionally, if anyone ever needs to add non-x86 quirks, it would surprisingly not work, so document the limitation to avoid confusion. Signed-off-by: Jean Delvare Fixes: cce4f632db20 (ACPI: fix early DSDT dmi check warnings on ia64) Signed-off-by: Rafael J. Wysocki commit 6c92d5a2744e27619a8fcc9d74b91ee9f1cdebd1 Author: Kuninori Morimoto Date: Thu Sep 6 03:21:47 2018 +0000 ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER Current rsnd driver will fallback to PIO mode if it can't get DMA handler. But, DMA might return -EPROBE_DEFER when probe timing. This driver always fallback to PIO mode especially from commit ac6bbf0cdf4206c ("iommu: Remove IOMMU_OF_DECLARE") because of this reason. The DMA driver will be probed later, but sound driver might be probed as PIO mode in such case. This patch fixup this issue. Then, -EPROBE_DEFER is not error. Thus, let's don't indicate error message in such case. And it needs to call rsnd_adg_remove() individually if probe failed, because it registers clk which should be unregister. Maybe PIO fallback feature itself is not needed, but let's keep it so far. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 69235ccf491d2e26aefd465c0d3ccd1e3b2a9a9c Author: Kuninori Morimoto Date: Thu Sep 6 03:21:33 2018 +0000 ASoC: rsnd: adg: care clock-frequency size ADG has buffer over flow bug if DT has more than 3 clock-frequency. This patch fixup this issue, and uses first 2 values. clock-frequency = ; /* this is OK */ clock-frequency = ; /* this is NG */ Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown commit bfa150f37f80fc65ac23dc457faf8eb2cd6232d0 Merge: d8c3916023d4 d9707490077b Author: Greg Kroah-Hartman Date: Thu Sep 6 11:21:54 2018 +0200 Merge tag 'fixes-for-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fixes for v4.19-rc2 NET2280 got a fix to an old patch attempting to fix locking for gadget framework callbacks. DWC2 fixed a bug where driver was attempting to access registers before clocks were enabled. DWC3 got a fix for ULPI clock configuration on Baytrail devices. FOTG210 plugged a memory leak and Renesas USB3 fixed ep0 maxpacket size. commit fce471e3c119895842c2b1a3ff51f3c1d108c656 Merge: ee28bb56ac5b b7f41565546d Author: David S. Miller Date: Wed Sep 5 22:32:22 2018 -0700 Merge branch 'iucv-fixes' Julian Wiedmann says: ==================== net/iucv: fixes 2018-09-05 please apply three straight-forward fixes for iucv. One that prevents leaking the skb on malformed inbound packets, one to fix the error handling on transmit error, and one to get rid of a compile warning. ==================== Signed-off-by: David S. Miller commit b7f41565546d393747fd554f9526c1187c6bf652 Author: Julian Wiedmann Date: Wed Sep 5 16:55:12 2018 +0200 net/iucv: declare iucv_path_table_empty() as static Fixes a compile warning. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit b2f543949acd1ba64313fdad9e672ef47550d773 Author: Julian Wiedmann Date: Wed Sep 5 16:55:11 2018 +0200 net/af_iucv: fix skb handling on HiperTransport xmit error When sending an skb, afiucv_hs_send() bails out on various error conditions. But currently the caller has no way of telling whether the skb was freed or not - resulting in potentially either a) leaked skbs from iucv_send_ctrl(), or b) double-free's from iucv_sock_sendmsg(). As dev_queue_xmit() will always consume the skb (even on error), be consistent and also free the skb from all other error paths. This way callers no longer need to care about managing the skb. Signed-off-by: Julian Wiedmann Reviewed-by: Ursula Braun Signed-off-by: David S. Miller commit 222440996d6daf635bed6cb35041be22ede3e8a0 Author: Julian Wiedmann Date: Wed Sep 5 16:55:10 2018 +0200 net/af_iucv: drop inbound packets with invalid flags Inbound packets may have any combination of flag bits set in their iucv header. If we don't know how to handle a specific combination, drop the skb instead of leaking it. To clarify what error is returned in this case, replace the hard-coded 0 with the corresponding macro. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit ee28bb56ac5b4c0c08ef10d33cc7adb749bbf4c6 Author: Davide Caratti Date: Tue Sep 4 19:00:19 2018 +0200 net/sched: fix memory leak in act_tunnel_key_init() If users try to install act_tunnel_key 'set' rules with duplicate values of 'index', the tunnel metadata are allocated, but never released. Then, kmemleak complains as follows: # tc a a a tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 index 111 # echo clear > /sys/kernel/debug/kmemleak # tc a a a tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 index 111 Error: TC IDR already exists. We have an error talking to the kernel # echo scan > /sys/kernel/debug/kmemleak # cat /sys/kernel/debug/kmemleak unreferenced object 0xffff8800574e6c80 (size 256): comm "tc", pid 5617, jiffies 4298118009 (age 57.990s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 1c e8 b0 ff ff ff ff ................ 81 24 c2 ad ff ff ff ff 00 00 00 00 00 00 00 00 .$.............. backtrace: [<00000000b7afbf4e>] tunnel_key_init+0x8a5/0x1800 [act_tunnel_key] [<000000007d98fccd>] tcf_action_init_1+0x698/0xac0 [<0000000099b8f7cc>] tcf_action_init+0x15c/0x590 [<00000000dc60eebe>] tc_ctl_action+0x336/0x5c2 [<000000002f5a2f7d>] rtnetlink_rcv_msg+0x357/0x8e0 [<000000000bfe7575>] netlink_rcv_skb+0x124/0x350 [<00000000edab656f>] netlink_unicast+0x40f/0x5d0 [<00000000b322cdcb>] netlink_sendmsg+0x6e8/0xba0 [<0000000063d9d490>] sock_sendmsg+0xb3/0xf0 [<00000000f0d3315a>] ___sys_sendmsg+0x654/0x960 [<00000000c06cbd42>] __sys_sendmsg+0xd3/0x170 [<00000000ce72e4b0>] do_syscall_64+0xa5/0x470 [<000000005caa2d97>] entry_SYSCALL_64_after_hwframe+0x49/0xbe [<00000000fac1b476>] 0xffffffffffffffff This problem theoretically happens also in case users attempt to setup a geneve rule having wrong configuration data, or when the kernel fails to allocate 'params_new'. Ensure that tunnel_key_init() releases the tunnel metadata also in the above conditions. Addresses-Coverity-ID: 1373974 ("Resource leak") Fixes: d0f6dd8a914f4 ("net/sched: Introduce act_tunnel_key") Fixes: 0ed5269f9e41f ("net/sched: add tunnel option support to act_tunnel_key") Signed-off-by: Davide Caratti Acked-by: Cong Wang Signed-off-by: David S. Miller commit 0a3b8b2b215f9e84b82ae97df71292ccfd92b1e7 Author: Cong Wang Date: Mon Sep 3 19:12:41 2018 -0700 tipc: orphan sock in tipc_release() Before we unlock the sock in tipc_release(), we have to detach sk->sk_socket from sk, otherwise a parallel tipc_sk_fill_sock_diag() could stil read it after we free this socket. Fixes: c30b70deb5f4 ("tipc: implement socket diagnostics for AF_TIPC") Reported-and-tested-by: syzbot+48804b87c16588ad491d@syzkaller.appspotmail.com Cc: Jon Maloy Cc: Ying Xue Signed-off-by: Cong Wang Acked-by: Ying Xue Signed-off-by: David S. Miller commit 792fab2c0d45758ad3d187bd252570d2bb627fa9 Author: Weinan Li Date: Tue Sep 4 14:13:43 2018 +0800 drm/i915/gvt: Fix the incorrect length of child_device_config issue GVT-g emualte the opregion for guest with bdb version as '186' which child_device_config length should be '33'. v2: split into 2 patch. 1st for issue fix, 2nd for code clean up.(Zhenyu) v3: add fixes tag.(Zhenyu) Fixes: 4023f301d28f ("drm/i915/gvt: opregion virtualization for win") CC: Xiaolin Zhang Reviewed-by: Xiaolin Zhang Signed-off-by: Weinan Li Signed-off-by: Zhenyu Wang commit ad9421e36a77056a4f095d49b9605e80b4d216ed Author: Roi Dayan Date: Mon Aug 20 11:43:03 2018 +0300 net/mlx5: Fix possible deadlock from lockdep when adding fte to fg This is a false positive report due to incorrect nested lock annotations as we lock multiple fgs with the same subclass. Instead of locking all fgs only lock the one being used as was done before. Fixes: bd71b08ec2ee ("net/mlx5: Support multiple updates of steering rules in parallel") Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed commit fc433829f9a29530d492f0eb20804ac5e6967204 Author: Saeed Mahameed Date: Fri Aug 24 12:24:10 2018 -0700 net/mlx5e: Ethtool steering, fix udp source port value Copy and paste bug was introduced in the offending patch. We need to write udp source port value into the headers value and not headers criteria "mask". Fixes: 142644f8a1f8 ("net/mlx5e: Ethtool steering flow parsing refactoring") Signed-off-by: Saeed Mahameed commit 47bc94b82291e007da61ee1b3d18c77871f3e158 Author: Huy Nguyen Date: Wed Aug 15 11:08:48 2018 -0500 net/mlx5: Check for error in mlx5_attach_interface Currently, mlx5_attach_interface does not check for error after calling intf->attach or intf->add. When these two calls fails, the client is not initialized and will cause issues such as kernel panic on invalid address in the teardown path (mlx5_detach_interface) Fixes: 737a234bb638 ("net/mlx5: Introduce attach/detach to interface API") Signed-off-by: Huy Nguyen Signed-off-by: Saeed Mahameed commit df7ddb2396cd162e64aaff9401be05e31e438961 Author: Daniel Jurgens Date: Mon Aug 27 09:09:46 2018 -0500 net/mlx5: Consider PCI domain in search for next dev The PCI BDF is not unique. PCI domain must also be considered when searching for the next physical device during lag setup. Example below: mlx5_core 0000:01:00.0: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0000:01:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0001:01:00.0: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0001:01:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) Signed-off-by: Daniel Jurgens Reviewed-by: Aviv Heller Signed-off-by: Saeed Mahameed commit 071304772fc747d5df13c51f1cf48a4b922a5e0d Author: Roi Dayan Date: Sun Aug 19 08:56:09 2018 +0300 net/mlx5: Fix not releasing read lock when adding flow rules If building match list fg fails and we never jumped to search_again_locked label then the function returned without unlocking the read lock. Fixes: bd71b08ec2ee ("net/mlx5: Support multiple updates of steering rules in parallel") Signed-off-by: Roi Dayan Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit c88a026e01219488e745f4f0267fd76c2bb68421 Author: Raed Salem Date: Tue Aug 21 15:22:42 2018 +0300 net/mlx5: E-Switch, Fix memory leak when creating switchdev mode FDB tables The memory allocated for the slow path table flow group input structure was not freed upon successful return, fix that. Fixes: 1967ce6ea5c8 ("net/mlx5: E-Switch, Refactor fast path FDB table creation in switchdev mode") Signed-off-by: Raed Salem Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit a09036221092989b88c55d24d1f12ceb1d7d361f Author: Tariq Toukan Date: Tue Aug 21 16:07:58 2018 +0300 net/mlx5: Use u16 for Work Queue buffer strides offset Minimal stride size is 16. Hence, the number of strides in a fragment (of PAGE_SIZE) is <= PAGE_SIZE / 16 <= 4K. u16 is sufficient to represent this. Fixes: d7037ad73daa ("net/mlx5: Fix QP fragmented buffer allocation") Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 8d71e818506718e8d7032ce824b5c74a17d4f7a5 Author: Tariq Toukan Date: Tue Aug 21 16:04:41 2018 +0300 net/mlx5: Use u16 for Work Queue buffer fragment size Minimal stride size is 16. Hence, the number of strides in a fragment (of PAGE_SIZE) is <= PAGE_SIZE / 16 <= 4K. u16 is sufficient to represent this. Fixes: 388ca8be0037 ("IB/mlx5: Implement fragmented completion queue (CQ)") Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 5df816e7f43f1297c40021ef17ec6e722b45c82f Author: Jack Morgenstein Date: Tue Aug 7 09:59:03 2018 +0300 net/mlx5: Fix debugfs cleanup in the device init/remove flow When initializing the device (procedure init_one), the driver calls mlx5_pci_init to perform pci initialization. As part of this initialization, mlx5_pci_init creates a debugfs directory. If this creation fails, init_one aborts, returning failure to the caller (which is the probe method caller). The main reason for such a failure to occur is if the debugfs directory already exists. This can happen if the last time mlx5_pci_close was called, debugfs_remove (silently) failed due to the debugfs directory not being empty. Guarantee that such a debugfs_remove failure will not occur by instead calling debugfs_remove_recursive in procedure mlx5_pci_close. Fixes: 59211bd3b632 ("net/mlx5: Split the load/unload flow into hardware and software flows") Signed-off-by: Jack Morgenstein Reviewed-by: Daniel Jurgens Signed-off-by: Saeed Mahameed commit 76d5581c870454be5f1f1a106c57985902e7ea20 Author: Jack Morgenstein Date: Sun Aug 5 09:19:33 2018 +0300 net/mlx5: Fix use-after-free in self-healing flow When the mlx5 health mechanism detects a problem while the driver is in the middle of init_one or remove_one, the driver needs to prevent the health mechanism from scheduling future work; if future work is scheduled, there is a problem with use-after-free: the system WQ tries to run the work item (which has been freed) at the scheduled future time. Prevent this by disabling work item scheduling in the health mechanism when the driver is in the middle of init_one() or remove_one(). Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Jack Morgenstein Reviewed-by: Feras Daoud Signed-off-by: Saeed Mahameed commit 08e74be103051861eb2c1ee52a2dcf119cde264f Author: Parav Pandit Date: Wed Sep 5 09:47:57 2018 +0300 RDMA/uverbs: Fix error cleanup path of ib_uverbs_add_one() If ib_uverbs_create_uapi() fails, dev_num should be freed from the bitmap. Fixes: 7d96c9b17636 ("IB/uverbs: Have the core code create the uverbs_root_spec") Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8b2ded1c94c06f841f8c1612bcfa33c85012a36b Author: Mikulas Patocka Date: Wed Sep 5 16:14:36 2018 -0600 block: don't warn when doing fsync on read-only devices It is possible to call fsync on a read-only handle (for example, fsck.ext2 does it when doing read-only check), and this call results in kernel warning. The patch b089cfd95d32 ("block: don't warn for flush on read-only device") attempted to disable the warning, but it is buggy and it doesn't (op_is_flush tests flags, but bio_op strips off the flags). Signed-off-by: Mikulas Patocka Fixes: 721c7fc701c7 ("block: fail op_is_write() requests to read-only partitions") Cc: stable@vger.kernel.org # 4.18 Signed-off-by: Jens Axboe commit f40f299bbe806a2e2c8b0d7cdda822fa3bdd171b Author: Somnath Kotur Date: Wed Sep 5 13:20:34 2018 +0530 bnxt_re: Fix couple of memory leaks that could lead to IOMMU call traces 1. DMA-able memory allocated for Shadow QP was not being freed. 2. bnxt_qplib_alloc_qp_hdr_buf() had a bug wherein the SQ pointer was erroneously pointing to the RQ. But since the corresponding free_qp_hdr_buf() was correct, memory being free was less than what was allocated. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Somnath Kotur Signed-off-by: Jason Gunthorpe commit e3f3d7ab00cd459d0f7a839758a4542f4d4b8ac8 Author: Dan Carpenter Date: Wed Sep 5 10:46:27 2018 +0300 hwmon: (nct6775) Set weight source to zero correctly This is dead code because j can never be 1 at this point. We had intended to just test if the bit was clear. Fixes: bbd8decd4123 ("hwmon: (nct6775) Add support for weighted fan control") Signed-off-by: Dan Carpenter Signed-off-by: Guenter Roeck commit 816e846c2eb9129a3e0afa5f920c8bbc71efecaa Author: Aaron Knister Date: Fri Aug 24 08:42:46 2018 -0400 IB/ipoib: Avoid a race condition between start_xmit and cm_rep_handler Inside of start_xmit() the call to check if the connection is up and the queueing of the packets for later transmission is not atomic which leaves a window where cm_rep_handler can run, set the connection up, dequeue pending packets and leave the subsequently queued packets by start_xmit() sitting on neigh->queue until they're dropped when the connection is torn down. This only applies to connected mode. These dropped packets can really upset TCP, for example, and cause multi-minute delays in transmission for open connections. Here's the code in start_xmit where we check to see if the connection is up: if (ipoib_cm_get(neigh)) { if (ipoib_cm_up(neigh)) { ipoib_cm_send(dev, skb, ipoib_cm_get(neigh)); goto unref; } } The race occurs if cm_rep_handler execution occurs after the above connection check (specifically if it gets to the point where it acquires priv->lock to dequeue pending skb's) but before the below code snippet in start_xmit where packets are queued. if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) { push_pseudo_header(skb, phdr->hwaddr); spin_lock_irqsave(&priv->lock, flags); __skb_queue_tail(&neigh->queue, skb); spin_unlock_irqrestore(&priv->lock, flags); } else { ++dev->stats.tx_dropped; dev_kfree_skb_any(skb); } The patch acquires the netif tx lock in cm_rep_handler for the section where it sets the connection up and dequeues and retransmits deferred skb's. Fixes: 839fcaba355a ("IPoIB: Connected mode experimental support") Cc: stable@vger.kernel.org Signed-off-by: Aaron Knister Tested-by: Ira Weiny Reviewed-by: Ira Weiny Signed-off-by: Jason Gunthorpe commit 8407879c4e0d7731f6e7e905893cecf61a7762c7 Author: Sagi Grimberg Date: Mon Sep 3 03:47:07 2018 -0700 nvmet-rdma: fix possible bogus dereference under heavy load Currently we always repost the recv buffer before we send a response capsule back to the host. Since ordering is not guaranteed for send and recv completions, it is posible that we will receive a new request from the host before we got a send completion for the response capsule. Today, we pre-allocate 2x rsps the length of the queue, but in reality, under heavy load there is nothing that is really preventing the gap to expand until we exhaust all our rsps. To fix this, if we don't have any pre-allocated rsps left, we dynamically allocate a rsp and make sure to free it when we are done. If under memory pressure we fail to allocate a rsp, we silently drop the command and wait for the host to retry. Reported-by: Steve Wise Tested-by: Steve Wise Signed-off-by: Sagi Grimberg [hch: dropped a superflous assignment] Signed-off-by: Christoph Hellwig commit d07f05fb86439c41dd6967c94be3ba3837b21567 Author: Peter Robinson Date: Sat Jul 21 00:02:12 2018 +0100 hwmon: rpi: add module alias to raspberrypi-hwmon The raspberrypi-hwmon driver doesn't automatically load, although it does work when loaded, by adding the alias it auto loads as expected when built as a module. Tested on RPi2/RPi3 on 32 bit kernel and RPi3B+ on aarch64 with Fedora 28 and a patched 4.18 RC kernel. Fixes: 3c493c885cf ("hwmon: Add support for RPi voltage sensor") Signed-off-by: Peter Robinson CC: Stefan Wahren CC: Eric Anholt Acked-by: Guenter Roeck Tested-by: Stefan Wahren Reviewed-by: Eric Anholt Signed-off-by: Florian Fainelli commit 4d85af102a66ee6aeefa596f273169e77fb2b48e Author: Lei Yang Date: Wed Sep 5 17:57:15 2018 +0800 selftests: memory-hotplug: add required configs add CONFIG_MEMORY_HOTREMOVE=y in config without this config, /sys/devices/system/memory/memory*/removable always return 0, I endup getting an early skip during test Signed-off-by: Lei Yang Signed-off-by: Shuah Khan (Samsung OSG) commit 53cf59d6c0ad3edc4f4449098706a8f8986258b6 Author: Lei Yang Date: Wed Sep 5 11:14:49 2018 +0800 selftests/efivarfs: add required kernel configs add config file Signed-off-by: Lei Yang Signed-off-by: Shuah Khan (Samsung OSG) commit b36fdc6853a38a6f8749897a33435635019e0647 Merge: f4697d9a8a9c d49b48f088c3 Author: Linus Torvalds Date: Wed Sep 5 09:27:45 2018 -0700 Merge tag 'gpio-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO fixes from Linus Walleij: "Some GPIO fixes. The ACPI stuff is probably the most annoying for users that get fixed this time. - Atomic contexts, cansleep* calls and such fastpath/slopwpath things. - Defer ACPI event handler registration to late_initcall() so IRQs do not fire in our face before other drivers have a chance to register handlers. - Race condition if a consumer requests a GPIO after gpiochip_add_data_with_key() but before of_gpiochip_add() - Probe errorpath in the dwapb driver" * tag 'gpio-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: Fix crash due to registration race gpio: dwapb: Fix error handling in dwapb_gpio_probe() gpiolib-acpi: Register GpioInt ACPI event handlers from a late_initcall gpiolib: acpi: Switch to cansleep version of GPIO library call gpio: adp5588: Fix sleep-in-atomic-context bug commit f4697d9a8a9c7a3ce4d33bb37bb1390f0d17c870 Merge: d0c1db1da4b7 b9eb3b14f1db Author: Linus Torvalds Date: Wed Sep 5 09:17:20 2018 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "A set of very minor fixes and a couple of reverts to fix a major problem (the attempt to change the busy count causes a hang when attempting to change the drive cache type)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: aacraid: fix a signedness bug Revert "scsi: core: avoid host-wide host_busy counter for scsi_mq" Revert "scsi: core: fix scsi_host_queue_ready" scsi: libata: Add missing newline at end of file scsi: target: iscsi: cxgbit: use pr_debug() instead of pr_info() scsi: hpsa: limit transfer length to 1MB, not 512kB scsi: lpfc: Correct MDS diag and nvmet configuration scsi: lpfc: Default fdmi_on to on scsi: csiostor: fix incorrect port capabilities scsi: csiostor: add a check for NULL pointer after kmalloc() scsi: documentation: add scsi_mod.use_blk_mq to scsi-parameters scsi: core: Update SCSI_MQ_DEFAULT help text to match default commit d0c1db1da4b7e16bcca139bca7f3b3557a8cf3d7 Merge: 0e9b10395018 3350139c0ff3 Author: Linus Torvalds Date: Wed Sep 5 09:13:31 2018 -0700 Merge tag 'nds32-for-linus-4.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux Pull nds32 updates from Greentime Hu: "Contained in here are the bug fixes, building error fixes and ftrace support for nds32" * tag 'nds32-for-linus-4.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux: nds32: linker script: GCOV kernel may refers data in __exit nds32: fix build error because of wrong semicolon nds32: Fix a kernel panic issue because of wrong frame pointer access. nds32: Only print one page of stack when die to prevent printing too much information. nds32: Add macro definition for offset of lp register on stack nds32: Remove the deprecated ABI implementation nds32/stack: Get real return address by using ftrace_graph_ret_addr nds32/ftrace: Support dynamic function graph tracer nds32/ftrace: Support dynamic function tracer nds32/ftrace: Add RECORD_MCOUNT support nds32/ftrace: Support static function graph tracer nds32/ftrace: Support static function tracer nds32: Extract the checking and getting pointer to a macro nds32: Clean up the coding style nds32: Fix get_user/put_user macro expand pointer problem nds32: Fix empty call trace nds32: add NULL entry to the end of_device_id array nds32: fix logic for module commit 865e63b04e9b2a658d7f26bd13a71dcd964a9118 Author: Steven Rostedt (VMware) Date: Tue Sep 4 16:26:11 2018 -0400 tracing: Add back in rcu_irq_enter/exit_irqson() for rcuidle tracepoints Borislav reported the following splat: ============================= WARNING: suspicious RCU usage 4.19.0-rc1+ #1 Not tainted ----------------------------- ./include/linux/rcupdate.h:631 rcu_read_lock() used illegally while idle! other info that might help us debug this: RCU used illegally from idle CPU! rcu_scheduler_active = 2, debug_locks = 1 RCU used illegally from extended quiescent state! 1 lock held by swapper/0/0: #0: 000000004557ee0e (rcu_read_lock){....}, at: perf_event_output_forward+0x0/0x130 stack backtrace: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.0-rc1+ #1 Hardware name: LENOVO 2320CTO/2320CTO, BIOS G2ET86WW (2.06 ) 11/13/2012 Call Trace: dump_stack+0x85/0xcb perf_event_output_forward+0xf6/0x130 __perf_event_overflow+0x52/0xe0 perf_swevent_overflow+0x91/0xb0 perf_tp_event+0x11a/0x350 ? find_held_lock+0x2d/0x90 ? __lock_acquire+0x2ce/0x1350 ? __lock_acquire+0x2ce/0x1350 ? retint_kernel+0x2d/0x2d ? find_held_lock+0x2d/0x90 ? tick_nohz_get_sleep_length+0x83/0xb0 ? perf_trace_cpu+0xbb/0xd0 ? perf_trace_buf_alloc+0x5a/0xa0 perf_trace_cpu+0xbb/0xd0 cpuidle_enter_state+0x185/0x340 do_idle+0x1eb/0x260 cpu_startup_entry+0x5f/0x70 start_kernel+0x49b/0x4a6 secondary_startup_64+0xa4/0xb0 This is due to the tracepoints moving to SRCU usage which does not require RCU to be "watching". But perf uses these tracepoints with RCU and expects it to be. Hence, we still need to add in the rcu_irq_enter/exit_irqson() calls for "rcuidle" tracepoints. This is a temporary fix until we have SRCU working in NMI context, and then perf can be converted to use that instead of normal RCU. Link: http://lkml.kernel.org/r/20180904162611.6a120068@gandalf.local.home Cc: x86-ml Cc: Peter Zijlstra Reported-by: Borislav Petkov Tested-by: Borislav Petkov Reviewed-by: "Paul E. McKenney" Fixes: e6753f23d961d ("tracepoint: Make rcuidle tracepoint callers use SRCU") Signed-off-by: Steven Rostedt (VMware) commit e65a9e480e91ddf9e15155454d370cead64689c8 Author: Stefan Wahren Date: Wed Sep 5 15:23:18 2018 +0200 net: qca_spi: Fix race condition in spi transfers With performance optimization the spi transfer and messages of basic register operations like qcaspi_read_register moved into the private driver structure. But they weren't protected against mutual access (e.g. between driver kthread and ethtool). So dumping the QCA7000 registers via ethtool during network traffic could make spi_sync hang forever, because the completion in spi_message is overwritten. So revert the optimization completely. Fixes: 291ab06ecf676 ("net: qualcomm: new Ethernet over SPI driver for QCA700") Signed-off-by: Stefan Wahren Signed-off-by: David S. Miller commit 9d7f19dc4673fbafebfcbf30eb90e09fa7d1c037 Author: Petr Oros Date: Wed Sep 5 14:37:45 2018 +0200 be2net: Fix memory leak in be_cmd_get_profile_config() DMA allocated memory is lost in be_cmd_get_profile_config() when we call it with non-NULL port_res parameter. Signed-off-by: Petr Oros Reviewed-by: Ivan Vecera Signed-off-by: David S. Miller commit 3a3539cd36327c6f9e0ffd9f3fd3dea7ff8b3567 Author: Petr Machata Date: Wed Sep 5 12:16:00 2018 +0200 mlxsw: spectrum_buffers: Set up a dedicated pool for BUM traffic MC-aware mode was recently enabled by mlxsw on Spectrum switches in commit 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports"). Unfortunately, testing has shown that the fix is incomplete and in the presented form actually makes the problem even worse, because any amount of MC traffic causes UC disruption. The reason for this is that currently, mlxsw configures the MC-specific TCs (8..15) to map to pool 0. It also configures a maximum buffer size of 0, but for MC traffic that maximum is disregarded and not part of the quota. Therefore MC traffic is always admitted to the egress buffer. Fix the configuration by directing the MC TCs into pool 15, which is dedicated to MC traffic and recognized as such by the silicon. Fixes: 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports") Signed-off-by: Petr Machata Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit d8c3916023d438a40cf16b284ee6ae7acab57b64 Merge: 6e22e3af7bb3 5dfdd24eb3d3 Author: Greg Kroah-Hartman Date: Wed Sep 5 16:25:02 2018 +0200 Merge tag 'usb-serial-4.19-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for v4.19-rc3 Here are two fixes for array-underflow bugs in completion handlers due to insufficient sanity checks. All have been in linux-next with no reported issues. Signed-off-by: Johan Hovold commit b2d35fa5fc80c27e868e393dcab4c94a0d71737f Author: Anders Roxell Date: Tue Sep 4 12:47:21 2018 +0200 selftests: add headers_install to lib.mk If the kernel headers aren't installed we can't build all the tests. Add a new make target rule 'khdr' in the file lib.mk to generate the kernel headers and that gets include for every test-dir Makefile that includes lib.mk If the testdir in turn have its own sub-dirs the top_srcdir needs to be set to the linux-rootdir to be able to generate the kernel headers. Signed-off-by: Anders Roxell Reviewed-by: Fathi Boudra Signed-off-by: Shuah Khan (Samsung OSG) commit 6e22e3af7bb3a7b9dc53cb4687659f6e63fca427 Author: Jia-Ju Bai Date: Sat Sep 1 16:12:10 2018 +0800 usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt() wdm_in_callback() is a completion handler function for the USB driver. So it should not sleep. But it calls service_outstanding_interrupt(), which calls usb_submit_urb() with GFP_KERNEL. To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC. This bug is found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai Cc: stable Signed-off-by: Greg Kroah-Hartman commit bc8acc214d3f1cafebcbcd101a695bbac716595d Author: Jia-Ju Bai Date: Sat Sep 1 16:25:08 2018 +0800 usb: misc: uss720: Fix two sleep-in-atomic-context bugs async_complete() in uss720.c is a completion handler function for the USB driver. So it should not sleep, but it is can sleep according to the function call paths (from bottom to top) in Linux-4.16. [FUNC] set_1284_register(GFP_KERNEL) drivers/usb/misc/uss720.c, 372: set_1284_register in parport_uss720_frob_control drivers/parport/ieee1284.c, 560: [FUNC_PTR]parport_uss720_frob_control in parport_ieee1284_ack_data_avail drivers/parport/ieee1284.c, 577: parport_ieee1284_ack_data_avail in parport_ieee1284_interrupt ./include/linux/parport.h, 474: parport_ieee1284_interrupt in parport_generic_irq drivers/usb/misc/uss720.c, 116: parport_generic_irq in async_complete [FUNC] get_1284_register(GFP_KERNEL) drivers/usb/misc/uss720.c, 382: get_1284_register in parport_uss720_read_status drivers/parport/ieee1284.c, 555: [FUNC_PTR]parport_uss720_read_status in parport_ieee1284_ack_data_avail drivers/parport/ieee1284.c, 577: parport_ieee1284_ack_data_avail in parport_ieee1284_interrupt ./include/linux/parport.h, 474: parport_ieee1284_interrupt in parport_generic_irq drivers/usb/misc/uss720.c, 116: parport_generic_irq in async_complete Note that [FUNC_PTR] means a function pointer call is used. To fix these bugs, GFP_KERNEL is replaced with GFP_ATOMIC. These bugs are found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai Cc: stable Signed-off-by: Greg Kroah-Hartman commit 6d4f268fa132742fe96dad22307c68d237356d88 Author: Jia-Ju Bai Date: Sat Sep 1 17:23:47 2018 +0800 usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in u132_get_frame() i_usX2Y_subs_startup in usbusx2yaudio.c is a completion handler function for the USB driver. So it should not sleep, but it is can sleep according to the function call paths (from bottom to top) in Linux-4.16. [FUNC] msleep drivers/usb/host/u132-hcd.c, 2558: msleep in u132_get_frame drivers/usb/core/hcd.c, 2231: [FUNC_PTR]u132_get_frame in usb_hcd_get_frame_number drivers/usb/core/usb.c, 822: usb_hcd_get_frame_number in usb_get_current_frame_number sound/usb/usx2y/usbusx2yaudio.c, 303: usb_get_current_frame_number in i_usX2Y_urb_complete sound/usb/usx2y/usbusx2yaudio.c, 366: i_usX2Y_urb_complete in i_usX2Y_subs_startup Note that [FUNC_PTR] means a function pointer call is used. To fix this bug, msleep() is replaced with mdelay(). This bug is found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai Cc: stable Signed-off-by: Greg Kroah-Hartman commit f9a5b4f58b280c1d26255376713c132f93837621 Author: Mathias Nyman Date: Mon Sep 3 15:44:16 2018 +0300 usb: Avoid use-after-free by flushing endpoints early in usb_set_interface() The steps taken by usb core to set a new interface is very different from what is done on the xHC host side. xHC hardware will do everything in one go. One command is used to set up new endpoints, free old endpoints, check bandwidth, and run the new endpoints. All this is done by xHC when usb core asks the hcd to check for available bandwidth. At this point usb core has not yet flushed the old endpoints, which will cause use-after-free issues in xhci driver as queued URBs are cancelled on a re-allocated endpoint. To resolve this add a call to usb_disable_interface() which will flush the endpoints before calling usb_hcd_alloc_bandwidth() Additional checks in xhci driver will also be implemented to gracefully handle stale URB cancel on freed and re-allocated endpoints Cc: Reported-by: Sudip Mukherjee Signed-off-by: Mathias Nyman Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit d23df2dc56325c72b51670b1fb400ddd23dc17cd Author: Randy Dunlap Date: Mon Sep 3 12:51:59 2018 -0700 linux/mod_devicetable.h: fix kernel-doc missing notation for typec_device_id Fix kernel-doc warning for missing struct member description: ../include/linux/mod_devicetable.h:763: warning: Function parameter or member 'driver_data' not described in 'typec_device_id' Fixes: 8a37d87d72f0c ("usb: typec: Bus type for alternate modes") Signed-off-by: Randy Dunlap Cc: Heikki Krogerus Reviewed-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 40de5fe4f45c5b804ea085d7e3f1a72fc6705929 Author: Randy Dunlap Date: Mon Sep 3 12:58:35 2018 -0700 usb/typec: fix kernel-doc notation warning for typec_match_altmode Fix kernel-doc warning for missing function parameter 'mode' description: ../drivers/usb/typec/bus.c:268: warning: Function parameter or member 'mode' not described in 'typec_match_altmode' Also fix typos for same function documentation. Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes") Signed-off-by: Randy Dunlap Acked-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit f3dc41c5d22b2ca14a0802a65d8cdc33a3882d4e Author: Mathias Nyman Date: Tue Sep 4 17:35:16 2018 +0300 usb: Don't die twice if PCI xhci host is not responding in resume usb_hc_died() should only be called once, and with the primary HCD as parameter. It will mark both primary and secondary hcd's dead. Remove the extra call to usb_cd_died with the shared hcd as parameter. Fixes: ff9d78b36f76 ("USB: Set usb_hcd->state and flags for shared roothubs") Signed-off-by: Mathias Nyman Cc: stable Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit ae45893f74c72e632cbad882509f12558db2e4f3 Author: Katsuhiro Suzuki Date: Wed Sep 5 17:31:37 2018 +0900 ASoC: uniphier: change status to orphan Since I'm leaving from Socionext, I'll unable to access specification documents of this hardware (these are not public). So change the state to orphan until someone will maintain this driver. Signed-off-by: Katsuhiro Suzuki Signed-off-by: Mark Brown commit 8dbbaa47b96f6ea5f09f922b4effff3c505cd8cf Author: Geert Uytterhoeven Date: Wed Sep 5 10:49:39 2018 +0200 spi: rspi: Fix interrupted DMA transfers When interrupted, wait_event_interruptible_timeout() returns -ERESTARTSYS, and the SPI transfer in progress will fail, as expected: m25p80 spi0.0: SPI transfer failed: -512 spi_master spi0: failed to transfer one message from queue However, as the underlying DMA transfers may not have completed, all subsequent SPI transfers may start to fail: spi_master spi0: receive timeout qspi_transfer_out_in() returned -110 m25p80 spi0.0: SPI transfer failed: -110 spi_master spi0: failed to transfer one message from queue Fix this by calling dmaengine_terminate_all() not only for timeouts, but also for errors. This can be reproduced on r8a7991/koelsch, using "hd /dev/mtd0" followed by CTRL-C. Signed-off-by: Geert Uytterhoeven Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit c1ca59c22c56930b377a665fdd1b43351887830b Author: Geert Uytterhoeven Date: Wed Sep 5 10:49:38 2018 +0200 spi: rspi: Fix invalid SPI use during system suspend If the SPI queue is running during system suspend, the system may lock up. Fix this by stopping/restarting the queue during system suspend/resume, by calling spi_master_suspend()/spi_master_resume() from the PM callbacks. In-kernel users will receive an -ESHUTDOWN error while system suspend/resume is in progress. Based on a patch for sh-msiof by Gaku Inami. Signed-off-by: Geert Uytterhoeven Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 31a5fae4c5a009898da6d177901d5328051641ff Author: Hiromitsu Yamasaki Date: Wed Sep 5 10:49:37 2018 +0200 spi: sh-msiof: Fix handling of write value for SISTR register This patch changes writing to the SISTR register according to the H/W user's manual. The TDREQ bit and RDREQ bits of SISTR are read-only, and must be written their initial values of zero. Signed-off-by: Hiromitsu Yamasaki [geert: reword] Signed-off-by: Geert Uytterhoeven Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit ffa69d6a16f686efe45269342474e421f2aa58b2 Author: Gaku Inami Date: Wed Sep 5 10:49:36 2018 +0200 spi: sh-msiof: Fix invalid SPI use during system suspend If the SPI queue is running during system suspend, the system may lock up. Fix this by stopping/restarting the queue during system suspend/resume by calling spi_master_suspend()/spi_master_resume() from the PM callbacks. In-kernel users will receive an -ESHUTDOWN error while system suspend/resume is in progress. Signed-off-by: Gaku Inami Signed-off-by: Hiromitsu Yamasaki [geert: Cleanup, reword] Signed-off-by: Geert Uytterhoeven Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 78af87b8bbbbcaa613f1a7d8f14472fe9a7dc622 Author: Chunfeng Yun Date: Wed Aug 29 10:36:49 2018 +0800 usb: mtu3: fix error of xhci port id when enable U3 dual role If dual role mode is enabled, when switch u3port0 to device mode, it will affect port id calculation of host(xHCI), specially when host supports multi U2 ports or U3 ports, so need enable its dual role mode, and fix it here. Signed-off-by: Chunfeng Yun Cc: stable Signed-off-by: Greg Kroah-Hartman commit 42d1c6d4a06a77b3ab206a919b9050c3080f3a71 Author: Oliver Neukum Date: Thu Aug 9 16:03:37 2018 +0200 usb: uas: add support for more quirk flags The hope that UAS devices would be less broken than old style storage devices has turned out to be unfounded. Make UAS support more of the quirk flags of the old driver. Signed-off-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman commit f45681f9becaa65111ed0a691ccf080a0cd5feb8 Author: Tim Anderson Date: Thu Aug 9 14:55:34 2018 -0700 USB: Add quirk to support DJI CineSSD This device does not correctly handle the LPM operations. Also, the device cannot handle ATA pass-through commands and locks up when attempted while running in super speed. This patch adds the equivalent quirk logic as found in uas. Signed-off-by: Tim Anderson Acked-by: Alan Stern Cc: stable Signed-off-by: Greg Kroah-Hartman commit 49aa5afda2ed9cf6a8819707014385ede895ff87 Author: Randy Dunlap Date: Sun Sep 2 19:30:48 2018 -0700 usb: typec: fix kernel-doc parameter warning Fix kernel-doc warning (13 times): ../drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' Signed-off-by: Randy Dunlap Acked-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 4e3121abcf536f26fd08a4b395c6a6711a961641 Author: Randy Dunlap Date: Sun Sep 2 19:39:55 2018 -0700 usb/dwc3/gadget: fix kernel-doc parameter warning Fix kernel-doc warning: ../drivers/usb/dwc3/gadget.c:510: warning: Excess function parameter 'dwc' description in 'dwc3_gadget_start_config' Signed-off-by: Randy Dunlap Cc: Felipe Balbi Signed-off-by: Greg Kroah-Hartman commit 14427b86837a4baf1c121934c6599bdb67dfa9fc Author: Ben Hutchings Date: Wed Aug 15 21:45:37 2018 +0100 USB: yurex: Check for truncation in yurex_read() snprintf() always returns the full length of the string it could have printed, even if it was truncated because the buffer was too small. So in case the counter value is truncated, we will over-read from in_buffer and over-write to the caller's buffer. I don't think it's actually possible for this to happen, but in case truncation occurs, WARN and return -EIO. Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman commit 7e10f14ebface44a48275c8d6dc1caae3668d5a9 Author: Ben Hutchings Date: Wed Aug 15 21:44:25 2018 +0100 USB: yurex: Fix buffer over-read in yurex_write() If the written data starts with a digit, yurex_write() tries to parse it as an integer using simple_strtoull(). This requires a null- terminator, and currently there's no guarantee that there is one. (The sample program at https://github.com/NeoCat/YUREX-driver-for-Linux/blob/master/sample/yurex_clock.pl writes an integer without a null terminator. It seems like it must have worked by chance!) Always add a null byte after the written data. Enlarge the buffer to allow for this. Cc: stable@vger.kernel.org Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman commit 222471f7640d9771a993218d825d84825adc805d Author: Anurag Kumar Vulisha Date: Fri Aug 31 17:24:42 2018 +0300 usb: host: xhci-plat: Iterate over parent nodes for finding quirks In xhci_plat_probe() both sysdev and pdev->dev are being used for finding quirks. There are some drivers(like dwc3 host.c) which adds quirks(like usb3-lpm-capable) into pdev and the logic present in xhci_plat_probe() checks for quirks in either sysdev or pdev for finding the quirks. Because of this logic, some of the quirks are getting missed(usb3-lpm-capable quirk added by dwc3 host.c driver is getting missed).This patch fixes this by iterating over all the available parents for finding the quirks. In this way all the quirks which are present in child or parent are correctly updated. Signed-off-by: Anurag Kumar Vulisha Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit 4937213ba7fafa13f30496b3965ffe93970d8b53 Author: Mathias Nyman Date: Fri Aug 31 17:24:43 2018 +0300 xhci: Fix use after free for URB cancellation on a reallocated endpoint Make sure the cancelled URB is on the current endpoint ring. If the endpoint ring has been reallocated since the URB was enqueued then the URB may contain TD and TRB pointers to a already freed ring. In this the case return the URB without touching any of the freed ring structure data. Don't try to stop the ring. It would be useless. This can occur if endpoint is not flushed before it is dropped and re-added, which is the case in usb_set_interface() as xhci does things in an odd order. Cc: Tested-by: Sudip Mukherjee Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit 9b83a1c301ad6d24988a128c69b42cbaaf537d82 Author: Maxence Duprès Date: Wed Aug 8 23:56:33 2018 +0000 USB: add quirk for WORLDE Controller KS49 or Prodipe MIDI 49C USB controller WORLDE Controller KS49 or Prodipe MIDI 49C USB controller cause a -EPROTO error, a communication restart and loop again. This issue has already been fixed for KS25. https://lore.kernel.org/patchwork/patch/753077/ I just add device 201 for KS49 in quirks.c to get it works. Signed-off-by: Laurent Roux Cc: stable Signed-off-by: Greg Kroah-Hartman commit 6eae4a6c2be387fec41b0d2782c4fffb57159498 Author: Bob Copeland Date: Wed Sep 5 06:22:59 2018 -0400 mac80211: fix pending queue hang due to TX_DROP In our environment running lots of mesh nodes, we are seeing the pending queue hang periodically, with the debugfs queues file showing lines such as: 00: 0x00000000/348 i.e. there are a large number of frames but no stop reason set. One way this could happen is if queue processing from the pending tasklet exited early without processing all frames, and without having some future event (incoming frame, stop reason flag, ...) to reschedule it. Exactly this can occur today if ieee80211_tx() returns false due to packet drops or power-save buffering in the tx handlers. In the past, this function would return true in such cases, and the change to false doesn't seem to be intentional. Fix this case by reverting to the previous behavior. Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue") Signed-off-by: Bob Copeland Acked-by: Toke Høiland-Jørgensen Signed-off-by: Johannes Berg commit d9707490077bee0c7060ef5665a90656e1078b66 Author: Bruno Meirelles Herrera Date: Mon Aug 27 18:36:38 2018 -0300 usb: dwc2: Fix call location of dwc2_check_core_endianness Some SoC/IP as STM32F469, the snpsid can only be read after clock is enabled, otherwise it will read as 0, and the dwc2_check_core_endianness will assume the core and AHB have opposite endianness, leading to the following error: [ 1.976339] dwc2 50000000.usb: 50000000.usb supply vusb_d not found, using dummy regulator [ 1.986124] dwc2 50000000.usb: Linked as a consumer to regulator.0 [ 1.992711] dwc2 50000000.usb: 50000000.usb supply vusb_a not found, using dummy regulator [ 2.003672] dwc2 50000000.usb: dwc2_core_reset: HANG! AHB Idle timeout GRSTCTL GRSTCTL_AHBIDLE [ 2.015176] dwc2: probe of 50000000.usb failed with error -16 The proposed patch changes the location where dwc2_check_core_endianness is called, allowing the clock peripheral to be enabled first. Acked-by: Minas Harutyunyan Tested-by: Martin Blumenstingl Signed-off-by: Bruno Meirelles Herrera Signed-off-by: Felipe Balbi commit ade573eb1e03d1ee5abcb3359b1259469ab6e8ed Author: Hans de Goede Date: Sat Aug 18 10:12:08 2018 +0200 HID: sensor-hub: Restore fixup for Lenovo ThinkPad Helix 2 sensor hub report Commit b0f847e16c1e ("HID: hid-sensor-hub: Force logical minimum to 1 for power and report state") not only replaced the descriptor fixup done for devices with the HID_SENSOR_HUB_ENUM_QUIRK with a generic fix, but also accidentally removed the unrelated descriptor fixup for the Lenovo ThinkPad Helix 2 sensor hub. This commit restores this fixup. Restoring this fixup not only fixes the Lenovo ThinkPad Helix 2's sensors, but also the Lenovo ThinkPad 8's sensors. Fixes: b0f847e16c1e ("HID: hid-sensor-hub: Force logical minimum ...") Cc: Srinivas Pandruvada Cc: Fernando D S Lima Acked-by: Srinivas Pandruvada Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit b034ed50a2bb517c4b76e84f7723cb6bf60a4edd Author: Gustavo A. R. Silva Date: Wed Aug 29 10:22:09 2018 -0500 HID: core: fix NULL pointer dereference There is a NULL pointer dereference in case memory resources for *parse* are not successfully allocated. Fix this by adding a new goto label and make the execution path jump to it in case vzalloc() fails. Addresses-Coverity-ID: 1473081 ("Dereference after null check") Fixes: b2dd9f2e5a8a ("HID: core: fix memory leak on probe") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Stefan Agner Signed-off-by: Jiri Kosina commit 24f33e64fcd0d50a4b1a8e5b41bd0257aa66b0e8 Author: Andrei Otcheretianski Date: Wed Sep 5 08:06:12 2018 +0300 cfg80211: reg: Init wiphy_idx in regulatory_hint_core() Core regulatory hints didn't set wiphy_idx to WIPHY_IDX_INVALID. Since the regulatory request is zeroed, wiphy_idx was always implicitly set to 0. This resulted in updating only phy #0. Fix that. Fixes: 806a9e39670b ("cfg80211: make regulatory_request use wiphy_idx instead of wiphy") Signed-off-by: Andrei Otcheretianski Signed-off-by: Luca Coelho [add fixes tag] Signed-off-by: Johannes Berg commit 94a5b3acd0aef83c0e38b5117eda7b2abf4a05a4 Author: Andrei Otcheretianski Date: Wed Sep 5 08:06:14 2018 +0300 mac80211: Don't wake up from PS for offchannel TX Otherwise the offchannel frame might be queued due to IEEE80211_QUEUE_STOP_REASON_PS and later dropped (in ieee80211_tx_frags()). Anyway, it doesn't make much sense to wake up the device during ROC. Signed-off-by: Andrei Otcheretianski Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 8682250b3c1b75a45feb7452bc413d004cfe3778 Author: Andrei Otcheretianski Date: Wed Sep 5 08:06:13 2018 +0300 mac80211: Always report TX status If a frame is dropped for any reason, mac80211 wouldn't report the TX status back to user space. As the user space may rely on the TX_STATUS to kick its state machines, resends etc, it's better to just report this frame as not acked instead. Signed-off-by: Andrei Otcheretianski Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit c483a5cc9d09f4ceaa9abb106f863cc89cb643d9 Author: Johan Hovold Date: Mon Aug 27 10:21:48 2018 +0200 mmc: meson-mx-sdio: fix OF child-node lookup Use the new of_get_compatible_child() helper to lookup the slot child node instead of using of_find_compatible_node(), which searches the entire tree from a given start node and thus can return an unrelated (i.e. non-child) node. This also addresses a potential use-after-free (e.g. after probe deferral) as the tree-wide helper drops a reference to its first argument (i.e. the node of the device being probed). While at it, also fix up the related slot-node reference leak. Fixes: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs") Cc: stable # 4.15 Cc: Carlo Caione Cc: Martin Blumenstingl Cc: Ulf Hansson Acked-by: Martin Blumenstingl Signed-off-by: Johan Hovold Signed-off-by: Ulf Hansson commit 3350139c0ff3c95724b784f7109987d533cb3ecd Author: Greentime Hu Date: Tue Sep 4 14:25:57 2018 +0800 nds32: linker script: GCOV kernel may refers data in __exit This patch is used to fix nds32 allmodconfig/allyesconfig build error because GCOV kernel embeds counters in the kernel for each line and a part of that embed in __exit text. So we need to keep the EXIT_TEXT and EXIT_DATA if CONFIG_GCOV_KERNEL=y. Link: https://lkml.org/lkml/2018/9/1/125 Signed-off-by: Greentime Hu Reviewed-by: Masami Hiramatsu commit e866d3e84eb7c9588afb77604d417e8cc49fe216 Author: Guenter Roeck Date: Tue Aug 28 17:33:46 2018 -0700 riscv: Do not overwrite initrd_start and initrd_end setup_initrd() overwrites initrd_start and initrd_end if __initramfs_size is larger than 0, which is always true even if there is no embedded initramfs. This prevents booting qemu with "-initrd" parameter. Overwriting initrd_start and initrd_end is not necessary since __initramfs_start and __initramfs_size are used directly in populate_rootfs() to load the built-in initramfs, so just drop that code. Signed-off-by: Guenter Roeck Signed-off-by: Palmer Dabbelt commit 0e9b10395018ab78bf6bffcb9561a703c7f82cee Merge: 28619527b8a7 ae98043f5f7f Author: Linus Torvalds Date: Tue Sep 4 17:01:11 2018 -0700 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "17 fixes" * emailed patches from Andrew Morton : nilfs2: convert to SPDX license tags drivers/dax/device.c: convert variable to vm_fault_t type lib/Kconfig.debug: fix three typos in help text checkpatch: add __ro_after_init to known $Attribute mm: fix BUG_ON() in vmf_insert_pfn_pud() from VM_MIXEDMAP removal uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name memory_hotplug: fix kernel_panic on offline page processing checkpatch: add optional static const to blank line declarations test ipc/shm: properly return EIDRM in shm_lock() mm/hugetlb: filter out hugetlb pages if HUGEPAGE migration is not supported. mm/util.c: improve kvfree() kerneldoc tools/vm/page-types.c: fix "defined but not used" warning tools/vm/slabinfo.c: fix sign-compare warning kmemleak: always register debugfs file mm: respect arch_dup_mmap() return value mm, oom: fix missing tlb_finish_mmu() in __oom_reap_task_mm(). mm: memcontrol: print proper OOM header when no eligible victim left commit ae98043f5f7fa45b65084f70e3ada3209873ebb4 Author: Ryusuke Konishi Date: Tue Sep 4 15:46:30 2018 -0700 nilfs2: convert to SPDX license tags Remove the verbose license text from NILFS2 files and replace them with SPDX tags. This does not change the license of any of the code. Link: http://lkml.kernel.org/r/1535624528-5982-1-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 36bdac1e674debd2714cb3e80eaa18266c2426e4 Author: Souptick Joarder Date: Tue Sep 4 15:46:26 2018 -0700 drivers/dax/device.c: convert variable to vm_fault_t type As part of 226ab561075f ("device-dax: Convert to vmf_insert_mixed and vm_fault_t") in 4.19-rc1, 'rc' was not converted to vm_fault_t. Now converted. Link: http://lkml.kernel.org/r/20180830153813.GA26059@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Cc: Dan Williams Cc: Dave Jiang Cc: Ross Zwisler Cc: Vishal Verma Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4c5d114ea04d5b6c7009d46895ec26109aa654f3 Author: Thibaut Sautereau Date: Tue Sep 4 15:46:23 2018 -0700 lib/Kconfig.debug: fix three typos in help text Fix three typos in CONFIG_WARN_ALL_UNSEEDED_RANDOM help text. Link: http://lkml.kernel.org/r/20180830194505.4778-1-thibaut@sautereau.fr Signed-off-by: Thibaut Sautereau Acked-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c5967e989f1fe702e75d7405b9251ec7e490d847 Author: Joe Perches Date: Tue Sep 4 15:46:20 2018 -0700 checkpatch: add __ro_after_init to known $Attribute __ro_after_init is a specific __attribute__ that checkpatch does currently not understand. Add it to the known $Attribute types so that code that uses variables declared with __ro_after_init are not thought to be a modifier type. This appears as a defect in checkpatch output of code like: static bool trust_cpu __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU); [...] if (trust_cpu && arch_init) { where checkpatch reports: ERROR: space prohibited after that '&&' (ctx:WxW) if (trust_cpu && arch_init) { Link: http://lkml.kernel.org/r/0fa8a2cb83ade4c525e18261ecf6cfede3015983.camel@perches.com Signed-off-by: Joe Perches Reported-by: Kees Cook Tested-by: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 62ec0d8c4f332dedf19d6fad15ddea639044d5fe Author: Dave Jiang Date: Tue Sep 4 15:46:16 2018 -0700 mm: fix BUG_ON() in vmf_insert_pfn_pud() from VM_MIXEDMAP removal It looks like I missed the PUD path when doing VM_MIXEDMAP removal. This can be triggered by: 1. Boot with memmap=4G!8G 2. build ndctl with destructive flag on 3. make TESTS=device-dax check [ +0.000675] kernel BUG at mm/huge_memory.c:824! Applying the same change that was applied to vmf_insert_pfn_pmd() in the original patch. Link: http://lkml.kernel.org/r/153565957352.35524.1005746906902065126.stgit@djiang5-desk3.ch.intel.com Fixes: e1fb4a08649 ("dax: remove VM_MIXEDMAP for fsdax and device dax") Signed-off-by: Dave Jiang Reported-by: Vishal Verma Tested-by: Vishal Verma Acked-by: Jeff Moyer Reviewed-by: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8a2336e549d385bb0b46880435b411df8d8200e8 Author: Randy Dunlap Date: Tue Sep 4 15:46:13 2018 -0700 uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name Since this header is in "include/uapi/linux/", apparently people want to use it in userspace programs -- even in C++ ones. However, the header uses a C++ reserved keyword ("private"), so change that to "dh_private" instead to allow the header file to be used in C++ userspace. Fixes https://bugzilla.kernel.org/show_bug.cgi?id=191051 Link: http://lkml.kernel.org/r/0db6c314-1ef4-9bfa-1baa-7214dd2ee061@infradead.org Fixes: ddbb41148724 ("KEYS: Add KEYCTL_DH_COMPUTE command") Signed-off-by: Randy Dunlap Reviewed-by: Andrew Morton Cc: David Howells Cc: James Morris Cc: "Serge E. Hallyn" Cc: Mat Martineau Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4e8346d0be889c7ab5eb2d3deedc18111d741e99 Author: Mikhail Zaslonko Date: Tue Sep 4 15:46:09 2018 -0700 memory_hotplug: fix kernel_panic on offline page processing Within show_valid_zones() the function test_pages_in_a_zone() should be called for online memory blocks only. Otherwise it might lead to the VM_BUG_ON due to uninitialized struct pages (when CONFIG_DEBUG_VM_PGFLAGS kernel option is set): page dumped because: VM_BUG_ON_PAGE(PagePoisoned(p)) ------------[ cut here ]------------ Call Trace: ([<000000000038f91e>] test_pages_in_a_zone+0xe6/0x168) [<0000000000923472>] show_valid_zones+0x5a/0x1a8 [<0000000000900284>] dev_attr_show+0x3c/0x78 [<000000000046f6f0>] sysfs_kf_seq_show+0xd0/0x150 [<00000000003ef662>] seq_read+0x212/0x4b8 [<00000000003bf202>] __vfs_read+0x3a/0x178 [<00000000003bf3ca>] vfs_read+0x8a/0x148 [<00000000003bfa3a>] ksys_read+0x62/0xb8 [<0000000000bc2220>] system_call+0xdc/0x2d8 That VM_BUG_ON was triggered by the page poisoning introduced in mm/sparse.c with the git commit d0dc12e86b31 ("mm/memory_hotplug: optimize memory hotplug"). With the same commit the new 'nid' field has been added to the struct memory_block in order to store and later on derive the node id for offline pages (instead of accessing struct page which might be uninitialized). But one reference to nid in show_valid_zones() function has been overlooked. Fixed with current commit. Also, nr_pages will not be used any more after test_pages_in_a_zone() call, do not update it. Link: http://lkml.kernel.org/r/20180828090539.41491-1-zaslonko@linux.ibm.com Fixes: d0dc12e86b31 ("mm/memory_hotplug: optimize memory hotplug") Signed-off-by: Mikhail Zaslonko Acked-by: Michal Hocko Reviewed-by: Pavel Tatashin Cc: [4.17+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 328b5f417a4ac929e20d98b989a2babac66c8520 Author: Joe Perches Date: Tue Sep 4 15:46:06 2018 -0700 checkpatch: add optional static const to blank line declarations test Using a static const struct definition as part of a series of declarations produces a false positive "Missing a blank line after declarations" for code like: WARNING: Missing a blank line after declarations #710: FILE: drivers/gpu/drm/tidss/tidss_scale_coefs.c:137: + int inc; + static const struct { So fix it. Link: http://lkml.kernel.org/r/5905126e70b0ed1781e49265fd5c49c5090d0223.camel@perches.com Signed-off-by: Joe Perches Reported-by: Jyri Sarha Cc: "Valkeinen, Tomi" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9c21dae291d1b7763b749dfaef3fb911286c0d98 Author: Davidlohr Bueso Date: Tue Sep 4 15:46:02 2018 -0700 ipc/shm: properly return EIDRM in shm_lock() When getting rid of the general ipc_lock(), this was missed furthermore, making the comment around the ipc object validity check bogus. Under EIDRM conditions, callers will in turn not see the error and continue with the operation. Link: http://lkml.kernel.org/r/20180824030920.GD3677@linux-r8p5 Link: http://lkml.kernel.org/r/20180823024051.GC13343@shao2-debian Fixes: 82061c57ce9 ("ipc: drop ipc_lock()") Signed-off-by: Davidlohr Bueso Reported-by: kernel test robot Cc: Manfred Spraul Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 464c7ffbcb164b2e5cebfa406b7fc6cdb7945344 Author: Aneesh Kumar K.V Date: Tue Sep 4 15:45:59 2018 -0700 mm/hugetlb: filter out hugetlb pages if HUGEPAGE migration is not supported. When scanning for movable pages, filter out Hugetlb pages if hugepage migration is not supported. Without this we hit infinte loop in __offline_pages() where we do pfn = scan_movable_pages(start_pfn, end_pfn); if (pfn) { /* We have movable pages */ ret = do_migrate_range(pfn, end_pfn); goto repeat; } Fix this by checking hugepage_migration_supported both in has_unmovable_pages which is the primary backoff mechanism for page offlining and for consistency reasons also into scan_movable_pages because it doesn't make any sense to return a pfn to non-migrateable huge page. This issue was revealed by, but not caused by 72b39cfc4d75 ("mm, memory_hotplug: do not fail offlining too early"). Link: http://lkml.kernel.org/r/20180824063314.21981-1-aneesh.kumar@linux.ibm.com Fixes: 72b39cfc4d75 ("mm, memory_hotplug: do not fail offlining too early") Signed-off-by: Aneesh Kumar K.V Reported-by: Haren Myneni Acked-by: Michal Hocko Reviewed-by: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 04b8e946075d4582093e84f54dc1a004b227794d Author: Andrew Morton Date: Tue Sep 4 15:45:55 2018 -0700 mm/util.c: improve kvfree() kerneldoc Scooped from an email from Matthew. Cc: Mike Rapoport Cc: Jonathan Corbet Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7ab660f8baecfe26c1c267fa8e64d2073feae2bb Author: Naoya Horiguchi Date: Tue Sep 4 15:45:51 2018 -0700 tools/vm/page-types.c: fix "defined but not used" warning debugfs_known_mountpoints[] is not used any more, so let's remove it. Link: http://lkml.kernel.org/r/1535102651-19418-1-git-send-email-n-horiguchi@ah.jp.nec.com Signed-off-by: Naoya Horiguchi Reviewed-by: Andrew Morton Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 904506562e0856f2535d876407d087c9459d345b Author: Naoya Horiguchi Date: Tue Sep 4 15:45:48 2018 -0700 tools/vm/slabinfo.c: fix sign-compare warning Currently we get the following compiler warning: slabinfo.c:854:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (s->object_size < min_objsize) ^ due to the mismatch of signed/unsigned comparison. ->object_size and ->slab_size are never expected to be negative, so let's define them as unsigned int. [n-horiguchi@ah.jp.nec.com: convert everything - none of these can be negative] Link: http://lkml.kernel.org/r/20180826234947.GA9787@hori1.linux.bs1.fc.nec.co.jp Link: http://lkml.kernel.org/r/1535103134-20239-1-git-send-email-n-horiguchi@ah.jp.nec.com Signed-off-by: Naoya Horiguchi Reviewed-by: Andrew Morton Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b353756b2b71915e81ed41239292306622d08c9f Author: Vincent Whitchurch Date: Tue Sep 4 15:45:44 2018 -0700 kmemleak: always register debugfs file If kmemleak built in to the kernel, but is disabled by default, the debugfs file is never registered. Because of this, it is not possible to find out if the kernel is built with kmemleak support by checking for the presence of this file. To allow this, always register the file. After this patch, if the file doesn't exist, kmemleak is not available in the kernel. If writing "scan" or any other value than "clear" to this file results in EBUSY, then kmemleak is available but is disabled by default and can be activated via the kernel command line. Catalin: "that's also consistent with a late disabling of kmemleak when the debugfs entry sticks around." Link: http://lkml.kernel.org/r/20180824131220.19176-1-vincent.whitchurch@axis.com Signed-off-by: Vincent Whitchurch Acked-by: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1ed0cc5a01a4d868d9907ce96468c4b4c6709556 Author: Nadav Amit Date: Tue Sep 4 15:45:41 2018 -0700 mm: respect arch_dup_mmap() return value Commit d70f2a14b72a ("include/linux/sched/mm.h: uninline mmdrop_async(), etc") ignored the return value of arch_dup_mmap(). As a result, on x86, a failure to duplicate the LDT (e.g. due to memory allocation error) would leave the duplicated memory mapping in an inconsistent state. Fix by using the return value, as it was before the change. Link: http://lkml.kernel.org/r/20180823051229.211856-1-namit@vmware.com Fixes: d70f2a14b72a4 ("include/linux/sched/mm.h: uninline mmdrop_async(), etc") Signed-off-by: Nadav Amit Acked-by: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 79cc81057eef7ad846588976296ab0f266c1a7a5 Author: Tetsuo Handa Date: Tue Sep 4 15:45:37 2018 -0700 mm, oom: fix missing tlb_finish_mmu() in __oom_reap_task_mm(). Commit 93065ac753e4 ("mm, oom: distinguish blockable mode for mmu notifiers") has added an ability to skip over vmas with blockable mmu notifiers. This however didn't call tlb_finish_mmu as it should. As a result inc_tlb_flush_pending has been called without its pairing dec_tlb_flush_pending and all callers mm_tlb_flush_pending would flush even though this is not really needed. This alone is not harmful and it seems there shouldn't be any such callers for oom victims at all but there is no real reason to skip tlb_finish_mmu on early skip either so call it. [mhocko@suse.com: new changelog] Link: http://lkml.kernel.org/r/b752d1d5-81ad-7a35-2394-7870641be51c@i-love.sakura.ne.jp Signed-off-by: Tetsuo Handa Acked-by: Michal Hocko Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3100dab2aa09dc6e082956e306fc9f81b3cc0f7a Author: Johannes Weiner Date: Tue Sep 4 15:45:34 2018 -0700 mm: memcontrol: print proper OOM header when no eligible victim left When the memcg OOM killer runs out of killable tasks, it currently prints a WARN with no further OOM context. This has caused some user confusion. Warnings indicate a kernel problem. In a reported case, however, the situation was triggered by a nonsensical memcg configuration (hard limit set to 0). But without any VM context this wasn't obvious from the report, and it took some back and forth on the mailing list to identify what is actually a trivial issue. Handle this OOM condition like we handle it in the global OOM killer: dump the full OOM context and tell the user we ran out of tasks. This way the user can identify misconfigurations easily by themselves and rectify the problem - without having to go through the hassle of running into an obscure but unsettling warning, finding the appropriate kernel mailing list and waiting for a kernel developer to remote-analyze that the memcg configuration caused this. If users cannot make sense of why the OOM killer was triggered or why it failed, they will still report it to the mailing list, we know that from experience. So in case there is an actual kernel bug causing this, kernel developers will very likely hear about it. Link: http://lkml.kernel.org/r/20180821160406.22578-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Michal Hocko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 308aa2b8f7b7db3332a7d41099fd37851fb793b2 Author: Steve Wise Date: Fri Aug 31 07:15:56 2018 -0700 iw_cxgb4: only allow 1 flush on user qps Once the qp has been flushed, it cannot be flushed again. The user qp flush logic wasn't enforcing it however. The bug can cause touch-after-free crashes like: Unable to handle kernel paging request for data at address 0x000001ec Faulting instruction address: 0xc008000016069100 Oops: Kernel access of bad area, sig: 11 [#1] ... NIP [c008000016069100] flush_qp+0x80/0x480 [iw_cxgb4] LR [c00800001606cd6c] c4iw_modify_qp+0x71c/0x11d0 [iw_cxgb4] Call Trace: [c00800001606cd6c] c4iw_modify_qp+0x71c/0x11d0 [iw_cxgb4] [c00800001606e868] c4iw_ib_modify_qp+0x118/0x200 [iw_cxgb4] [c0080000119eae80] ib_security_modify_qp+0xd0/0x3d0 [ib_core] [c0080000119c4e24] ib_modify_qp+0xc4/0x2c0 [ib_core] [c008000011df0284] iwcm_modify_qp_err+0x44/0x70 [iw_cm] [c008000011df0fec] destroy_cm_id+0xcc/0x370 [iw_cm] [c008000011ed4358] rdma_destroy_id+0x3c8/0x520 [rdma_cm] [c0080000134b0540] ucma_close+0x90/0x1b0 [rdma_ucm] [c000000000444da4] __fput+0xe4/0x2f0 So fix flush_qp() to only flush the wq once. Cc: stable@vger.kernel.org Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe commit e4ff3d22c11dd505353896cdcad0ee8f3251be68 Author: Artemy Kovalyov Date: Tue Aug 28 14:40:32 2018 +0300 IB/core: Release object lock if destroy failed The object lock was supposed to always be released during destroy, but when the destruction retry series was integrated with the destroy series it created a failure path that missed the unlock. Keep with convention, if destroy fails the caller must undo all locking. Fixes: 87ad80abc70d ("IB/uverbs: Consolidate uobject destruction") Signed-off-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0d23ba6034b9cf48b8918404367506da3e4b3ee5 Author: Jann Horn Date: Mon Sep 3 18:54:14 2018 +0200 RDMA/ucma: check fd type in ucma_migrate_id() The current code grabs the private_data of whatever file descriptor userspace has supplied and implicitly casts it to a `struct ucma_file *`, potentially causing a type confusion. This is probably fine in practice because the pointer is only used for comparisons, it is never actually dereferenced; and even in the comparisons, it is unlikely that a file from another filesystem would have a ->private_data pointer that happens to also be valid in this context. But ->private_data is not always guaranteed to be a valid pointer to an object owned by the file's filesystem; for example, some filesystems just cram numbers in there. Check the type of the supplied file descriptor to be safe, analogous to how other places in the kernel do it. Fixes: 88314e4dda1e ("RDMA/cma: add support for rdma_migrate_id()") Signed-off-by: Jann Horn Signed-off-by: Jason Gunthorpe commit dd45210b6dd4f1512eafcc41774154ebb762360f Author: Eugeniy Paltsev Date: Mon Jul 30 19:26:36 2018 +0300 ARC: don't check for HIGHMEM pages in arch_dma_alloc __GFP_HIGHMEM flag is cleared by upper layer functions (in include/linux/dma-mapping.h) so we'll never get a __GFP_HIGHMEM flag in arch_dma_alloc gfp argument. That's why alloc_pages will never return highmem page here. Get rid of highmem pages handling and cleanup arch_dma_alloc and arch_dma_free functions. Reviewed-by: Christoph Hellwig Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta commit 2b720e99a1297417b979bf4810a0f01d27133c48 Author: Eugeniy Paltsev Date: Mon Jul 30 19:26:35 2018 +0300 ARC: IOC: panic if both IOC and ZONE_HIGHMEM enabled Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta commit 2820a708d5a321342bef34e459fdc8679c30e20f Author: Eugeniy Paltsev Date: Mon Jul 30 19:26:34 2018 +0300 ARC: dma [IOC] Enable per device io coherency So far the IOC treatment was global on ARC, being turned on (or off) for all devices in the system. With this patch, this can now be done per device using the "dma-coherent" DT property; IOW with this patch we can use both HW-coherent and regular DMA peripherals simultaneously. The changes involved are too many so enlisting the summary below: 1. common code calls ARC arch_setup_dma_ops() per device. 2. For coherent dma (IOC) it plugs in generic @dma_direct_ops which doesn't need any arch specific backend: No need for any explicit cache flushes or MMU mappings to provide for uncached access - dma_(map|sync)_single* return early as corresponding dma ops callbacks are NULL in generic code. So arch_sync_dma_*() -> dma_cache_*() need not handle the coherent dma case, hence drop ARC __dma_cache_*_ioc() which were no-op anyways 3. For noncoherent dma (non IOC) generic @dma_noncoherent_ops is used which in turns calls ARC specific routines - arch_dma_alloc() no longer checks for @ioc_enable since this is called only for !IOC case. Reviewed-by: Christoph Hellwig Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta [vgupta: rewrote changelog] commit 28619527b8a712590c93d0a9e24b4425b9376a8c Merge: 60c1f89241d4 a33710bdb6b2 Author: Linus Torvalds Date: Tue Sep 4 12:45:11 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Pull networking fixes from David Miller: 1) Must perform TXQ teardown before unregistering interfaces in mac80211, from Toke Høiland-Jørgensen. 2) Don't allow creating mac80211_hwsim with less than one channel, from Johannes Berg. 3) Division by zero in cfg80211, fix from Johannes Berg. 4) Fix endian issue in tipc, from Haiqing Bai. 5) BPF sockmap use-after-free fixes from Daniel Borkmann. 6) Spectre-v1 in mac80211_hwsim, from Jinbum Park. 7) Missing rhashtable_walk_exit() in tipc, from Cong Wang. 8) Revert kvzalloc() conversion of AF_PACKET, it breaks mmap() when kvzalloc() tries to use kmalloc() pages. From Eric Dumazet. 9) Fix deadlock in hv_netvsc, from Dexuan Cui. 10) Do not restart timewait timer on RST, from Florian Westphal. 11) Fix double lwstate refcount grab in ipv6, from Alexey Kodanev. 12) Unsolicit report count handling is off-by-one, fix from Hangbin Liu. 13) Sleep-in-atomic in cadence driver, from Jia-Ju Bai. 14) Respect ttl-inherit in ip6 tunnel driver, from Hangbin Liu. 15) Use-after-free in act_ife, fix from Cong Wang. 16) Missing hold to meta module in act_ife, from Vlad Buslov. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (91 commits) net: phy: sfp: Handle unimplemented hwmon limits and alarms net: sched: action_ife: take reference to meta module act_ife: fix a potential use-after-free net/mlx5: Fix SQ offset in QPs with small RQ tipc: correct spelling errors for tipc_topsrv_queue_evt() comments tipc: correct spelling errors for struct tipc_bc_base's comment bnxt_en: Do not adjust max_cp_rings by the ones used by RDMA. bnxt_en: Clean up unused functions. bnxt_en: Fix firmware signaled resource change logic in open. sctp: not traverse asoc trans list if non-ipv6 trans exists for ipv6_flowlabel sctp: fix invalid reference to the index variable of the iterator net/ibm/emac: wrong emac_calc_base call was used by typo net: sched: null actions array pointer before releasing action vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition r8169: add support for NCube 8168 network card ip6_tunnel: respect ttl inherit for ip6tnl mac80211: shorten the IBSS debug messages mac80211: don't Tx a deauth frame if the AP forbade Tx mac80211: Fix station bandwidth setting after channel switch mac80211: fix a race between restart and CSA flows ... commit 0d6c3011409135ea84e2a231b013a22017ff999a Author: Benjamin Tissoires Date: Tue Sep 4 15:31:14 2018 +0200 HID: core: fix grouping by application commit f07b3c1da92d ("HID: generic: create one input report per application type") was effectively the same as MULTI_INPUT: hidinput->report was never set, so hidinput_match_application() always returned null. Fix that by testing against the real application. Note that this breaks some old eGalax touchscreens that expect MULTI_INPUT instead of HID_QUIRK_INPUT_PER_APP. Enable this quirk for backward compatibility on all non-Win8 touchscreens. link: https://bugzilla.kernel.org/show_bug.cgi?id=200847 link: https://bugzilla.kernel.org/show_bug.cgi?id=200849 link: https://bugs.archlinux.org/task/59699 link: https://github.com/NixOS/nixpkgs/issues/45165 Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit ec6adef5fbc3f140c70e7499fdad818acb3a46c6 Author: Benjamin Tissoires Date: Tue Sep 4 15:31:12 2018 +0200 HID: multitouch: fix Elan panels with 2 input modes declaration When implementing commit 7f81c8db5489 ("HID: multitouch: simplify the settings of the various features"), I wrongly removed a test that made sure we never try to set the second InputMode feature to something else than 0. This broke badly some recent Elan panels that now forget to send the click button in some area of the touchpad. Link: https://bugzilla.kernel.org/show_bug.cgi?id=200899 Fixes: 7f81c8db5489 ("HID: multitouch: simplify the settings of the various features") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit a33710bdb6b284f8f1e24f1119d167037b374ebb Author: Andrew Lunn Date: Tue Sep 4 04:23:56 2018 +0200 net: phy: sfp: Handle unimplemented hwmon limits and alarms Not all SFPs implement the registers containing sensor limits and alarms. Luckily, there is a bit indicating if they are implemented or not. Add checking for this bit, when deciding if the hwmon attributes should be visible. Fixes: 1323061a018a ("net: phy: sfp: Add HWMON support for module sensors") Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 84cb8eb26cb9ce3c79928094962a475a9d850a53 Author: Vlad Buslov Date: Tue Sep 4 00:44:42 2018 +0300 net: sched: action_ife: take reference to meta module Recent refactoring of add_metainfo() caused use_all_metadata() to add metainfo to ife action metalist without taking reference to module. This causes warning in module_put called from ife action cleanup function. Implement add_metainfo_and_get_ops() function that returns with reference to module taken if metainfo was added successfully, and call it from use_all_metadata(), instead of calling __add_metainfo() directly. Example warning: [ 646.344393] WARNING: CPU: 1 PID: 2278 at kernel/module.c:1139 module_put+0x1cb/0x230 [ 646.352437] Modules linked in: act_meta_skbtcindex act_meta_mark act_meta_skbprio act_ife ife veth nfsv3 nfs fscache xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c tun ebtable_filter ebtables ip6table_filter ip6_tables bridge stp llc mlx5_ib ib_uverbs ib_core intel_rapl sb_edac x86_pkg_temp_thermal mlx5_core coretemp kvm_intel kvm nfsd igb irqbypass crct10dif_pclmul devlink crc32_pclmul mei_me joydev ses crc32c_intel enclosure auth_rpcgss i2c_algo_bit ioatdma ptp mei pps_core ghash_clmulni_intel iTCO_wdt iTCO_vendor_support pcspkr dca ipmi_ssif lpc_ich target_core_mod i2c_i801 ipmi_si ipmi_devintf pcc_cpufreq wmi ipmi_msghandler nfs_acl lockd acpi_pad acpi_power_meter grace sunrpc mpt3sas raid_class scsi_transport_sas [ 646.425631] CPU: 1 PID: 2278 Comm: tc Not tainted 4.19.0-rc1+ #799 [ 646.432187] Hardware name: Supermicro SYS-2028TP-DECR/X10DRT-P, BIOS 2.0b 03/30/2017 [ 646.440595] RIP: 0010:module_put+0x1cb/0x230 [ 646.445238] Code: f3 66 94 02 e8 26 ff fa ff 85 c0 74 11 0f b6 1d 51 30 94 02 80 fb 01 77 60 83 e3 01 74 13 65 ff 0d 3a 83 db 73 e9 2b ff ff ff <0f> 0b e9 00 ff ff ff e8 59 01 fb ff 85 c0 75 e4 48 c7 c2 20 62 6b [ 646.464997] RSP: 0018:ffff880354d37068 EFLAGS: 00010286 [ 646.470599] RAX: 0000000000000000 RBX: ffffffffc0a52518 RCX: ffffffff8c2668db [ 646.478118] RDX: 0000000000000003 RSI: dffffc0000000000 RDI: ffffffffc0a52518 [ 646.485641] RBP: ffffffffc0a52180 R08: fffffbfff814a4a4 R09: fffffbfff814a4a3 [ 646.493164] R10: ffffffffc0a5251b R11: fffffbfff814a4a4 R12: 1ffff1006a9a6e0d [ 646.500687] R13: 00000000ffffffff R14: ffff880362bab890 R15: dead000000000100 [ 646.508213] FS: 00007f4164c99800(0000) GS:ffff88036fe40000(0000) knlGS:0000000000000000 [ 646.516961] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 646.523080] CR2: 00007f41638b8420 CR3: 0000000351df0004 CR4: 00000000001606e0 [ 646.530595] Call Trace: [ 646.533408] ? find_symbol_in_section+0x260/0x260 [ 646.538509] tcf_ife_cleanup+0x11b/0x200 [act_ife] [ 646.543695] tcf_action_cleanup+0x29/0xa0 [ 646.548078] __tcf_action_put+0x5a/0xb0 [ 646.552289] ? nla_put+0x65/0xe0 [ 646.555889] __tcf_idr_release+0x48/0x60 [ 646.560187] tcf_generic_walker+0x448/0x6b0 [ 646.564764] ? tcf_action_dump_1+0x450/0x450 [ 646.569411] ? __lock_is_held+0x84/0x110 [ 646.573720] ? tcf_ife_walker+0x10c/0x20f [act_ife] [ 646.578982] tca_action_gd+0x972/0xc40 [ 646.583129] ? tca_get_fill.constprop.17+0x250/0x250 [ 646.588471] ? mark_lock+0xcf/0x980 [ 646.592324] ? check_chain_key+0x140/0x1f0 [ 646.596832] ? debug_show_all_locks+0x240/0x240 [ 646.601839] ? memset+0x1f/0x40 [ 646.605350] ? nla_parse+0xca/0x1a0 [ 646.609217] tc_ctl_action+0x215/0x230 [ 646.613339] ? tcf_action_add+0x220/0x220 [ 646.617748] rtnetlink_rcv_msg+0x56a/0x6d0 [ 646.622227] ? rtnl_fdb_del+0x3f0/0x3f0 [ 646.626466] netlink_rcv_skb+0x18d/0x200 [ 646.630752] ? rtnl_fdb_del+0x3f0/0x3f0 [ 646.634959] ? netlink_ack+0x500/0x500 [ 646.639106] netlink_unicast+0x2d0/0x370 [ 646.643409] ? netlink_attachskb+0x340/0x340 [ 646.648050] ? _copy_from_iter_full+0xe9/0x3e0 [ 646.652870] ? import_iovec+0x11e/0x1c0 [ 646.657083] netlink_sendmsg+0x3b9/0x6a0 [ 646.661388] ? netlink_unicast+0x370/0x370 [ 646.665877] ? netlink_unicast+0x370/0x370 [ 646.670351] sock_sendmsg+0x6b/0x80 [ 646.674212] ___sys_sendmsg+0x4a1/0x520 [ 646.678443] ? copy_msghdr_from_user+0x210/0x210 [ 646.683463] ? lock_downgrade+0x320/0x320 [ 646.687849] ? debug_show_all_locks+0x240/0x240 [ 646.692760] ? do_raw_spin_unlock+0xa2/0x130 [ 646.697418] ? _raw_spin_unlock+0x24/0x30 [ 646.701798] ? __handle_mm_fault+0x1819/0x1c10 [ 646.706619] ? __pmd_alloc+0x320/0x320 [ 646.710738] ? debug_show_all_locks+0x240/0x240 [ 646.715649] ? restore_nameidata+0x7b/0xa0 [ 646.720117] ? check_chain_key+0x140/0x1f0 [ 646.724590] ? check_chain_key+0x140/0x1f0 [ 646.729070] ? __fget_light+0xbc/0xd0 [ 646.733121] ? __sys_sendmsg+0xd7/0x150 [ 646.737329] __sys_sendmsg+0xd7/0x150 [ 646.741359] ? __ia32_sys_shutdown+0x30/0x30 [ 646.746003] ? up_read+0x53/0x90 [ 646.749601] ? __do_page_fault+0x484/0x780 [ 646.754105] ? do_syscall_64+0x1e/0x2c0 [ 646.758320] do_syscall_64+0x72/0x2c0 [ 646.762353] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 646.767776] RIP: 0033:0x7f4163872150 [ 646.771713] Code: 8b 15 3c 7d 2b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb cd 66 0f 1f 44 00 00 83 3d b9 d5 2b 00 00 75 10 b8 2e 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 be cd 00 00 48 89 04 24 [ 646.791474] RSP: 002b:00007ffdef7d6b58 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 646.799721] RAX: ffffffffffffffda RBX: 0000000000000024 RCX: 00007f4163872150 [ 646.807240] RDX: 0000000000000000 RSI: 00007ffdef7d6bd0 RDI: 0000000000000003 [ 646.814760] RBP: 000000005b8b9482 R08: 0000000000000001 R09: 0000000000000000 [ 646.822286] R10: 00000000000005e7 R11: 0000000000000246 R12: 00007ffdef7dad20 [ 646.829807] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000679bc0 [ 646.837360] irq event stamp: 6083 [ 646.841043] hardirqs last enabled at (6081): [] __call_rcu+0x17d/0x500 [ 646.849882] hardirqs last disabled at (6083): [] trace_hardirqs_off_thunk+0x1a/0x1c [ 646.859775] softirqs last enabled at (5968): [] __do_softirq+0x4a1/0x6ee [ 646.868784] softirqs last disabled at (6082): [] tcf_ife_cleanup+0x39/0x200 [act_ife] [ 646.878845] ---[ end trace b1b8c12ffe51e657 ]--- Fixes: 5ffe57da29b3 ("act_ife: fix a potential deadlock") Signed-off-by: Vlad Buslov Acked-by: Cong Wang Signed-off-by: David S. Miller commit 6d784f1625ea68783cc1fb17de8f6cd3e1660c3f Author: Cong Wang Date: Mon Sep 3 11:08:15 2018 -0700 act_ife: fix a potential use-after-free Immediately after module_put(), user could delete this module, so e->ops could be already freed before we call e->ops->release(). Fix this by moving module_put() after ops->release(). Fixes: ef6980b6becb ("introduce IFE action") Cc: Jamal Hadi Salim Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 639505d4397b8c654a8e2616f9cb70ece40c83f9 Author: Tariq Toukan Date: Mon Sep 3 18:06:24 2018 +0300 net/mlx5: Fix SQ offset in QPs with small RQ Correct the formula for calculating the RQ page remainder, which should be in byte granularity. The result will be non-zero only for RQs smaller than PAGE_SIZE, as an RQ size is a power of 2. Divide this by the SQ stride (MLX5_SEND_WQE_BB) to get the SQ offset in strides granularity. Fixes: d7037ad73daa ("net/mlx5: Fix QP fragmented buffer allocation") Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 732b53146ac8f604e45c593efe0579f78205fdcc Merge: c012a0f26775 46dec40fb741 Author: Radim Krčmář Date: Tue Sep 4 21:12:46 2018 +0200 Merge tag 'kvm-ppc-fixes-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc PPC KVM fixes for 4.19 Two small fixes for KVM on POWER machines; one fixes a bug where pages might not get marked dirty, causing guest memory corruption on migration, and the other fixes a bug causing reads from guest memory to use the wrong guest real address for very large HPT guests (>256G of memory), leading to failures in instruction emulation. commit bc811f05d77f47059c197a98b6ad242eb03999cb Author: Jens Axboe Date: Tue Sep 4 11:52:34 2018 -0600 nbd: don't allow invalid blocksize settings syzbot reports a divide-by-zero off the NBD_SET_BLKSIZE ioctl. We need proper validation of the input here. Not just if it's zero, but also if the value is a power-of-2 and in a valid range. Add that. Cc: stable@vger.kernel.org Reported-by: syzbot Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 1723c3155f117ee6e00f28fadf6e9eda4fc85806 Author: Linus Walleij Date: Tue Sep 4 15:39:30 2018 +0200 spi: gpio: Fix copy-and-paste error This fixes an embarrassing copy-and-paste error in the errorpath of spi_gpio_request(): we were checking the wrong struct member for error code right after retrieveing the sck GPIO. Fixes: 9b00bc7b901ff672 ("spi: spi-gpio: Rewrite to use GPIO descriptors") Reviewed-by: Geert Uytterhoeven Signed-off-by: Linus Walleij Signed-off-by: Mark Brown commit 851a15114895c5bce163a6f2d57e0aa4658a1be4 Author: Felipe Balbi Date: Mon Sep 3 11:24:57 2018 +0300 i2c: i801: fix DNV's SMBCTRL register offset DNV's iTCO is slightly different with SMBCTRL sitting at a different offset when compared to all other devices. Let's fix so that we can properly use iTCO watchdog. Fixes: 84d7f2ebd70d ("i2c: i801: Add support for Intel DNV") Cc: # v4.4+ Signed-off-by: Felipe Balbi Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit e4b069e0945fa14c71cf8b5b89f8b1b2aa68dbc2 Author: Mikulas Patocka Date: Wed Aug 22 12:45:51 2018 -0400 dm verity: fix crash on bufio buffer that was allocated with vmalloc Since commit d1ac3ff008fb ("dm verity: switch to using asynchronous hash crypto API") dm-verity uses asynchronous crypto calls for verification, so that it can use hardware with asynchronous processing of crypto operations. These asynchronous calls don't support vmalloc memory, but the buffer data can be allocated with vmalloc if dm-bufio is short of memory and uses a reserved buffer that was preallocated in dm_bufio_client_create(). Fix verity_hash_update() so that it deals with vmalloc'd memory correctly. Reported-by: "Xiao, Jin" Signed-off-by: Mikulas Patocka Fixes: d1ac3ff008fb ("dm verity: switch to using asynchronous hash crypto API") Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: Mike Snitzer commit 3c398f3c3bef21961eaaeb93227fa66d440dc83d Author: Andreas Kemnade Date: Sun Sep 2 09:30:58 2018 +0200 mmc: omap_hsmmc: fix wakeirq handling on removal after unbinding mmc I get things like this: [ 185.294067] mmc1: card 0001 removed [ 185.305206] omap_hsmmc 480b4000.mmc: wake IRQ with no resume: -13 The wakeirq stays in /proc-interrupts rebinding shows this: [ 289.795959] genirq: Flags mismatch irq 112. 0000200a (480b4000.mmc:wakeup) vs. 0000200a (480b4000.mmc:wakeup) [ 289.808959] omap_hsmmc 480b4000.mmc: Unable to request wake IRQ [ 289.815338] omap_hsmmc 480b4000.mmc: no SDIO IRQ support, falling back to polling That bug seems to be introduced by switching from devm_request_irq() to generic wakeirq handling. So let us cleanup at removal. Signed-off-by: Andreas Kemnade Fixes: 5b83b2234be6 ("mmc: omap_hsmmc: Change wake-up interrupt to use generic wakeirq") Cc: stable@vger.kernel.org # v4.2+ Signed-off-by: Ulf Hansson commit df88f3181f10565c6e3a89eb6f0f9e6afaaf15f1 Author: Janosch Frank Date: Thu Aug 30 16:14:18 2018 +0200 KVM: s390: Properly lock mm context allow_gmap_hpage_1m setting We have to do down_write on the mm semaphore to set a bitfield in the mm context. Signed-off-by: Janosch Frank Fixes: a4499382 ("KVM: s390: Add huge page enablement control") Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger commit 204c97245612b6c255edf4e21e24d417c4a0c008 Author: Pierre Morel Date: Thu Aug 23 12:25:54 2018 +0200 KVM: s390: vsie: copy wrapping keys to right place Copy the key mask to the right offset inside the shadow CRYCB Fixes: bbeaa58b3 ("KVM: s390: vsie: support aes dea wrapping keys") Signed-off-by: Pierre Morel Reviewed-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Janosch Frank Cc: stable@vger.kernel.org # v4.8+ Message-Id: <1535019956-23539-2-git-send-email-pmorel@linux.ibm.com> Signed-off-by: Janosch Frank Signed-off-by: Christian Borntraeger commit a11bdb1a6b782ee97587f92fae798efc78c31093 Author: Janosch Frank Date: Thu Aug 30 10:13:55 2018 +0200 KVM: s390: Fix pfmf and conditional skey emulation We should not return with a lock. We also have to increase the address when we do page clearing. Fixes: bd096f644319 ("KVM: s390: Add skey emulation fault handling") Signed-off-by: Janosch Frank Message-Id: <20180830081355.59234-1-frankja@linux.ibm.com> Reviewed-by: David Hildenbrand Signed-off-by: Christian Borntraeger commit b81126e01a8c6048249955feea46c8217ebefa91 Author: Ingo Franzki Date: Mon Aug 27 14:28:47 2018 +0200 s390/crypto: Fix return code checking in cbc_paes_crypt() The return code of cpacf_kmc() is less than the number of bytes to process in case of an error, not greater. The crypt routines for the other cipher modes already have this correctly. Cc: stable@vger.kernel.org # v4.11+ Fixes: 279378430768 ("s390/crypt: Add protected key AES module") Signed-off-by: Ingo Franzki Acked-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 782710e333a526780d65918d669cb96646983ba2 Author: Sowmini Varadhan Date: Mon Sep 3 04:36:53 2018 -0700 xfrm: reset crypto_done when iterating over multiple input xfrms We only support one offloaded xfrm (we do not have devices that can handle more than one offload), so reset crypto_done in xfrm_input() when iterating over multiple transforms in xfrm_input, so that we can invoke the appropriate x->type->input for the non-offloaded transforms Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API") Signed-off-by: Sowmini Varadhan Signed-off-by: Steffen Klassert commit bfc0698bebcb16d19ecfc89574ad4d696955e5d3 Author: Sowmini Varadhan Date: Mon Sep 3 04:36:52 2018 -0700 xfrm: reset transport header back to network header after all input transforms ahave been applied A policy may have been set up with multiple transforms (e.g., ESP and ipcomp). In this situation, the ingress IPsec processing iterates in xfrm_input() and applies each transform in turn, processing the nexthdr to find any additional xfrm that may apply. This patch resets the transport header back to network header only after the last transformation so that subsequent xfrms can find the correct transport header. Fixes: 7785bba299a8 ("esp: Add a software GRO codepath") Suggested-by: Steffen Klassert Signed-off-by: Sowmini Varadhan Signed-off-by: Steffen Klassert commit 0a1b60d76b0abcc2a0de4eb96d5dd379cd855f30 Author: Zhenyu Wang Date: Fri Aug 31 10:58:52 2018 +0800 drm/i915/gvt: Fix life cycle reference on KVM mm Handle guest mm access life cycle properly with mmget()/mmput(). As noted by Linus, use_mm() depends on valid live page table but KVM's mmgrab() doesn't guarantee that. As vGPU usage depends on guest VM life cycle, need to make sure to use mmget()/mmput() to guarantee VM address access. v3: fix build v2: v1 caused a weird dependence issue which failed for vfio device release, which result invalid mdev vgpu and kvm state without proper release taken. This trys to put right reference around VM address space access instead. Cc: Linus Torvalds Cc: Paolo Bonzini Cc: Zhi Wang Reviewed-by: Zhi Wang Signed-off-by: Zhenyu Wang commit ec865393292f5ad8d52da20788b3685ebce44c48 Author: Greentime Hu Date: Tue Aug 28 16:07:39 2018 +0800 nds32: fix build error because of wrong semicolon It shall be removed in the define usage. We shall not put a semicolon there. /kisskb/src/arch/nds32/include/asm/elf.h:126:29: error: expected '}' before ';' token #define ELF_DATA ELFDATA2LSB; ^ /kisskb/src/fs/proc/kcore.c:318:17: note: in expansion of macro 'ELF_DATA' [EI_DATA] = ELF_DATA, ^~~~~~~~ /kisskb/src/fs/proc/kcore.c:312:15: note: to match this '{' .e_ident = { ^ /kisskb/src/scripts/Makefile.build:307: recipe for target 'fs/proc/kcore.o' failed Signed-off-by: Greentime Hu commit 0cde56e0280d70ce26b54d22131944c2fe584b38 Author: Greentime Hu Date: Thu Aug 23 15:05:46 2018 +0800 nds32: Fix a kernel panic issue because of wrong frame pointer access. It can make sure that trace_hardirqs_off/trace_hardirqs_on can get a correct return address by frame pointer through __builtin_return_address() in this fix. Unable to handle kernel paging request at virtual address fffffffc pgd = 3c42e9cf [fffffffc] *pgd=02a9c000 Internal error: Oops: 1 [#1] Modules linked in: CPU: 0 PC is at trace_hardirqs_off+0x78/0xec LP is at common_exception_handler+0xda/0xf4 pc : [] lp : [] Tainted: G W sp : ada60ab0 fp : efcaff48 gp : 3a020490 r25: efcb0000 r24: 00000000 r23: 00000000 r22: 00000000 r21: 00000000 r20: 000700c1 r19: 000700ca r18: 3a21b018 r17: 00000001 r16: 00000002 r15: 00000001 r14: 0000002a r13: 3a00a804 r12: ada60ab0 r11: 3a113af8 r10: 3a01c530 r9 : 3a124404 r8 : 00120f9c r7 : b2352eba r6 : 00000000 r5 : 3a126b58 r4 : 00000000 r3 : 3a1726a8 r2 : b2921000 r1 : 00000000 r0 : 00000000 IRQs off Segment user Process init (pid: 1, stack limit = 0x069d7f15) Stack: (0xada60ab0 to 0xada61000) Stack: 0aa0: 00000000 00000003 3a110000 0011f000 Stack: 0ac0: 00000005 00000000 00000000 00000000 ada60b10 3a01fe68 ada60b0c ada60b08 Stack: 0ae0: 00000000 ada60ab8 ada60b30 3a020550 00000000 00000001 3a11c2f8 3a01c6e8 Stack: 0b00: 3a01cb80 fffffba8 3a113af8 3a21b018 3a122c28 00003ec4 00000165 00000000 Stack: 0b20: 3a126aec 0000006c 00000000 00000001 3a01fe68 00000000 00000003 00000000 Stack: 0b40: 00000001 000003f8 3a020930 3a01c530 00000008 ada60c18 3a020490 3a003120 Stack: 0b60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0b80: 00000000 00000000 00000000 00000000 ffff8000 00000000 00000000 00000000 Stack: 0ba0: 00000000 00000001 3a020550 00000000 3a01d020 00000000 fffff000 fffff000 Stack: 0bc0: 00000000 00000000 00000000 00000000 ada60f2c 00000000 00000001 00000000 Stack: 0be0: 00000000 00000000 3a01fe68 fffffab0 00008034 00000008 3a0010cc 3a01fe68 Stack: 0c00: 00000000 00000000 00000001 ada60c88 3a020490 3a0139d4 0009dc6f 00000000 Stack: 0c20: 00000000 00000000 ada60fce fffff000 00000000 0000ebe0 3a020038 3a020550 Stack: 0c40: ada60f20 ada60c90 3a0007f0 3a0002a8 ada60c8c 00000000 00000000 ada60c88 Stack: 0c60: 3a020490 3a004570 00000000 00000000 ada60f20 3a0007f0 3a000000 00000000 Stack: 0c80: 3a020490 3a004850 00000000 3a013f24 3a000000 00000000 3a01ff44 00000000 Stack: 0ca0: 00000000 00000000 00000000 00000000 00000000 00000000 3a01ff84 3a01ff7c Stack: 0cc0: 3a01ff4c 3a01ff5c 3a01ff64 3a01ff9c 3a01ffa4 3a01ffac 3a01ff6c 3a01ff74 Stack: 0ce0: 00000000 00000000 3a01ff44 00000000 00000000 00000000 00000000 00000000 Stack: 0d00: 3a01ff8c 00000000 00000000 3a01ff94 00000000 00000000 00000000 00000000 Stack: 0d20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0d40: 3a01ffbc 3a01ffb4 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0d60: 00000000 00000000 00000000 00000000 00000000 3a01ffc4 00000000 00000000 Stack: 0d80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0da0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0dc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 3a01ff54 Stack: 0de0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0e00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0e20: 00000000 00000004 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0e40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0e60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0e80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0ea0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Stack: 0ec0: 00000000 00000000 00000000 00000000 ffffffff 00000000 00000000 00000000 Stack: 0ee0: 00000000 00000000 00000000 00000000 ada60f20 00000000 00000000 00000000 Stack: 0f00: 00000000 00000000 00000000 00000000 00000000 00000000 3a020490 3a000b24 Stack: 0f20: 00000001 ada60fde 00000000 ada60fe4 ada60feb 00000000 00000021 3a038000 Stack: 0f40: 00000010 0009dc6f 00000006 00001000 00000011 00000064 00000003 00008034 Stack: 0f60: 00000004 00000020 00000005 00000008 00000007 3a000000 00000008 00000000 Stack: 0f80: 00000009 0000ebe0 0000000b 00000000 0000000c 00000000 0000000d 00000000 Stack: 0fa0: 0000000e 00000000 00000017 00000000 00000019 ada60fce 0000001f ada60ff6 Stack: 0fc0: 00000000 00000000 00000000 b5010000 fa839914 23b5dd89 a2aea540 692fc82e Stack: 0fe0: 0074696e 454d4f48 54002f3d 3d4d5245 756e696c 692f0078 0074696e 00000000 CPU: 0 PID: 1 Comm: init Tainted: G W 4.18.0-00015-g1888b64a2558-dirty #112 Hardware name: andestech,ae3xx (DT) Call Trace: [] dump_stack+0x2c/0x38 [] die+0x128/0x18c [] do_page_fault+0x3b8/0x4e0 [] ret_from_exception+0x0/0x10 [] common_exception_handler+0xda/0xf4 Signed-off-by: Greentime Hu commit 487c4b2323b26cfb5fd4d77d3605a92c182b6288 Author: Greentime Hu Date: Thu Aug 23 14:47:43 2018 +0800 nds32: Only print one page of stack when die to prevent printing too much information. It may print too much information sometimes if the stack is wrong or too big. This patch can limit the debug information in a page of stack. Signed-off-by: Greentime Hu commit 95f93ed7fe92c16f5346e477491d91e4fa8e92b8 Author: Zong Li Date: Mon Aug 20 09:51:29 2018 +0800 nds32: Add macro definition for offset of lp register on stack Use macro to replace the magic number. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit c5fdf7e00d490dc094a97d287e0fa27e253cca84 Author: Zong Li Date: Mon Aug 20 09:40:08 2018 +0800 nds32: Remove the deprecated ABI implementation We are not using NDS32 ABI 2 for now, just remove the preprocessor directives __NDS32_ABI_2. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 1e377ae9b04aef4dc531fa4c5f81b65d440ebcba Author: Zong Li Date: Wed Aug 15 11:05:40 2018 +0800 nds32/stack: Get real return address by using ftrace_graph_ret_addr Function graph tracer has modified the return address to 'return_to_handler' on stack, and provide the 'ftrace_graph_ret_addr' to get the real return address. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 95cd2f7bce9aa712473bba1b5b3f4fdec148baee Author: Zong Li Date: Wed Aug 15 11:01:10 2018 +0800 nds32/ftrace: Support dynamic function graph tracer This patch contains the implementation of dynamic function graph tracer. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 6b1d6d2fba37129f690ee7e9164f225c55626cac Author: Zong Li Date: Wed Aug 15 11:00:08 2018 +0800 nds32/ftrace: Support dynamic function tracer This patch contains the implementation of dynamic function tracer. The mcount call is composed of three instructions, so there are three nop for enough placeholder. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit fbf58a52ac088669dfa930e557d0303a9fbb7e17 Author: Zong Li Date: Wed Aug 15 10:57:16 2018 +0800 nds32/ftrace: Add RECORD_MCOUNT support Recognize NDS32 object files in recordmcount.pl. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 1e9b14c0d92b61a0979fd5ee24d5e7f080f11030 Author: Zong Li Date: Wed Aug 15 10:53:04 2018 +0800 nds32/ftrace: Support static function graph tracer This patch contains implementation of static function graph tracer. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit a18082575c664847d36c6ca030b09ce8d93aec2f Author: Zong Li Date: Wed Aug 15 10:45:59 2018 +0800 nds32/ftrace: Support static function tracer This patch support the static function tracer. On nds32 ABI, we need to always push return address to stack for __builtin_return_address can work correctly, otherwise, it will get the wrong value of $lp at leaf function. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 487913ab18c215b06611c4c91c7e905fc0960eb8 Author: Zong Li Date: Mon Aug 13 16:02:53 2018 +0800 nds32: Extract the checking and getting pointer to a macro Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 7ef39548df8cdb6406e3b4b7255e7f8cd3fe3b13 Author: Zong Li Date: Mon Aug 13 15:08:52 2018 +0800 nds32: Clean up the coding style 1. Adjust indentation. 2. Unify argument name of each macro. 3. Add space after comma in parameters list. 4. Add space after 'if' keyword. 5. Replace space by tab. 6. Change asm volatile to __asm__ __volatile__ Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 6cce95a6c7d288ac2126eee4b95df448b9015b84 Author: Zong Li Date: Mon Aug 13 14:48:49 2018 +0800 nds32: Fix get_user/put_user macro expand pointer problem The pointer argument of macro need to be taken out once first, and then use the new pointer in the macro body. In kernel/trace/trace.c, get_user(ch, ubuf++) causes the unexpected increment after expand the macro. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit c17df7960534357fb74074c2f514c831d4a9cf5a Author: Zong Li Date: Mon Aug 13 13:28:23 2018 +0800 nds32: Fix empty call trace The compiler predefined macro 'NDS32_ABI_2' had been removed, it should use the '__NDS32_ABI_2' here. Signed-off-by: Zong Li Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 1944a50859ec2b570b42b459ac25d607fc7c31f0 Author: YueHaibing Date: Tue Aug 7 12:03:13 2018 +0800 nds32: add NULL entry to the end of_device_id array Make sure of_device_id tables are NULL terminated. Found by coccinelle spatch "misc/of_table.cocci" Signed-off-by: YueHaibing Acked-by: Greentime Hu Signed-off-by: Greentime Hu commit 1dfdf99106668679b0de5a62fd4f42c1a11c9445 Author: Greentime Hu Date: Wed Jul 18 09:54:55 2018 +0800 nds32: fix logic for module This bug is report by Dan Carpenter. We shall use ~loc_mask instead of !loc_mask because we need to and(&) the bits of ~loc_mask. Reported-by: Dan Carpenter Fixes: c9a4a8da6baa ("nds32: Loadable modules") Signed-off-by: Greentime Hu commit fc3e3bf55f48e5b18481075b0591ca938c9dba78 Merge: a484ef3442d2 c6e57b3896fc Author: David S. Miller Date: Mon Sep 3 22:12:02 2018 -0700 Merge tag 'mac80211-for-davem-2018-09-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== Here are quite a large number of fixes, notably: * various A-MSDU building fixes (currently only affects mt76) * syzkaller & spectre fixes in hwsim * TXQ vs. teardown fix that was causing crashes * embed WMM info in reg rule, bad code here had been causing crashes * one compilation issue with fix from Arnd (rfkill-gpio includes) * fixes for a race and bad data during/after channel switch * nl80211: a validation fix, attribute type & unit fixes along with other small fixes. ==================== Signed-off-by: David S. Miller commit a484ef3442d2f05fa59edf4f6d14a8169d1b94a6 Author: Zhenbo Gao Date: Mon Sep 3 16:36:46 2018 +0800 tipc: correct spelling errors for tipc_topsrv_queue_evt() comments tipc_conn_queue_evt -> tipc_topsrv_queue_evt tipc_send_work -> tipc_conn_send_work tipc_send_to_sock -> tipc_conn_send_to_sock Signed-off-by: Zhenbo Gao Reviewed-by: Ying Xue Signed-off-by: David S. Miller commit 9cc1bf3928b31e515ed15477b3c7eb653d0b3b42 Author: Zhenbo Gao Date: Mon Sep 3 16:36:45 2018 +0800 tipc: correct spelling errors for struct tipc_bc_base's comment Trivial fix for two spelling mistakes. Signed-off-by: Zhenbo Gao Reviewed-by: Ying Xue Signed-off-by: David S. Miller commit a104d18def0468afdd0d753a91fc770f90df30e3 Merge: 6570aa1d1039 00fe9c326d20 Author: David S. Miller Date: Mon Sep 3 21:59:43 2018 -0700 Merge branch 'bnxt_en-Bug-fixes' Michael Chan says: ==================== bnxt_en: Bug fixes. This short series fixes resource related logic in the driver, mostly affecting the RDMA driver under corner cases. ==================== Signed-off-by: David S. Miller commit 00fe9c326d2027f2437dea38ef0e82f9d02d94c0 Author: Michael Chan Date: Mon Sep 3 04:23:19 2018 -0400 bnxt_en: Do not adjust max_cp_rings by the ones used by RDMA. Currently, the driver adjusts the bp->hw_resc.max_cp_rings by the number of MSIX vectors used by RDMA. There is one code path in open that needs to check the true max_cp_rings including any used by RDMA. This code is now checking for the reduced max_cp_rings which will fail when the number of cp rings is very small. To fix this in a clean way, we don't adjust max_cp_rings anymore. Instead, we add a helper bnxt_get_max_func_cp_rings_for_en() to get the reduced max_cp_rings when appropriate. Fixes: ec86f14ea506 ("bnxt_en: Add ULP calls to stop and restart IRQs.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ad95c27bdb930105f3eea02621bda157caf2862d Author: Michael Chan Date: Mon Sep 3 04:23:18 2018 -0400 bnxt_en: Clean up unused functions. Remove unused bnxt_subtract_ulp_resources(). Change bnxt_get_max_func_irqs() to static since it is only locally used. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 6b95c3e9697254dab0c8eafc6ab9d5e10d2eca4e Author: Michael Chan Date: Mon Sep 3 04:23:17 2018 -0400 bnxt_en: Fix firmware signaled resource change logic in open. When the driver detects that resources have changed during open, it should reset the rx and tx rings to 0. This will properly setup the init sequence to initialize the default rings again. We also need to signal the RDMA driver to stop and clear its interrupts. We then call the RoCE driver to restart if a new set of default rings is successfully reserved. Fixes: 25e1acd6b92b ("bnxt_en: Notify firmware about IF state changes.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 6570aa1d1039fc389cdcbeb8c6e1d1f370f113f4 Merge: bf68066fccb1 741880e1f2f5 Author: David S. Miller Date: Mon Sep 3 21:57:55 2018 -0700 Merge branch 'sctp-two-fixes-for-spp_ipv6_flowlabel-and-spp_dscp-sockopts' Xin Long says: ==================== sctp: two fixes for spp_ipv6_flowlabel and spp_dscp sockopts This patchset fixes two problems in sctp_apply_peer_addr_params() when setting spp_ipv6_flowlabel or spp_dscp. ==================== Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 741880e1f2f59b20125dc480765d2546cec66080 Author: Xin Long Date: Mon Sep 3 15:47:11 2018 +0800 sctp: not traverse asoc trans list if non-ipv6 trans exists for ipv6_flowlabel When users set params.spp_address and get a trans, ipv6_flowlabel flag should be applied into this trans. But even if this one is not an ipv6 trans, it should not go to apply it into all other transes of the asoc but simply ignore it. Fixes: 0b0dce7a36fb ("sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams") Signed-off-by: Xin Long Signed-off-by: David S. Miller commit af8a2b8ba7678b4695f9e854ba9abae1076beabe Author: Xin Long Date: Mon Sep 3 15:47:10 2018 +0800 sctp: fix invalid reference to the index variable of the iterator Now in sctp_apply_peer_addr_params(), if SPP_IPV6_FLOWLABEL flag is set and trans is NULL, it would use trans as the index variable to traverse transport_addr_list, then trans is set as the last transport of it. Later, if SPP_DSCP flag is set, it would enter into the wrong branch as trans is actually an invalid reference. So fix it by using a new index variable to traverse transport_addr_list for both SPP_DSCP and SPP_IPV6_FLOWLABEL flags process. Fixes: 0b0dce7a36fb ("sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams") Reported-by: Julia Lawall Signed-off-by: Xin Long Signed-off-by: David S. Miller commit bf68066fccb10fce6bbffdda24ee2ae314c9c5b2 Author: Ivan Mikhaylov Date: Mon Sep 3 10:26:28 2018 +0300 net/ibm/emac: wrong emac_calc_base call was used by typo __emac_calc_base_mr1 was used instead of __emac4_calc_base_mr1 by copy-paste mistake for emac4syn. Fixes: 45d6e545505fd32edb812f085be7de45b6a5c0af ("net/ibm/emac: add 8192 rx/tx fifo size") Signed-off-by: Ivan Mikhaylov Signed-off-by: David S. Miller commit c10bbfae3ae43fae1d77e16f05a73474acf514ff Author: Vlad Buslov Date: Mon Sep 3 10:04:55 2018 +0300 net: sched: null actions array pointer before releasing action Currently, tcf_action_delete() nulls actions array pointer after putting and deleting it. However, if tcf_idr_delete_index() returns an error, pointer to action is not set to null. That results it being released second time in error handling code of tca_action_gd(). Kasan error: [ 807.367755] ================================================================== [ 807.375844] BUG: KASAN: use-after-free in tc_setup_cb_call+0x14e/0x250 [ 807.382763] Read of size 8 at addr ffff88033e636000 by task tc/2732 [ 807.391289] CPU: 0 PID: 2732 Comm: tc Tainted: G W 4.19.0-rc1+ #799 [ 807.399542] Hardware name: Supermicro SYS-2028TP-DECR/X10DRT-P, BIOS 2.0b 03/30/2017 [ 807.407948] Call Trace: [ 807.410763] dump_stack+0x92/0xeb [ 807.414456] print_address_description+0x70/0x360 [ 807.419549] kasan_report+0x14d/0x300 [ 807.423582] ? tc_setup_cb_call+0x14e/0x250 [ 807.428150] tc_setup_cb_call+0x14e/0x250 [ 807.432539] ? nla_put+0x65/0xe0 [ 807.436146] fl_dump+0x394/0x3f0 [cls_flower] [ 807.440890] ? fl_tmplt_dump+0x140/0x140 [cls_flower] [ 807.446327] ? lock_downgrade+0x320/0x320 [ 807.450702] ? lock_acquire+0xe2/0x220 [ 807.454819] ? is_bpf_text_address+0x5/0x140 [ 807.459475] ? memcpy+0x34/0x50 [ 807.462980] ? nla_put+0x65/0xe0 [ 807.466582] tcf_fill_node+0x341/0x430 [ 807.470717] ? tcf_block_put+0xe0/0xe0 [ 807.474859] tcf_node_dump+0xdb/0xf0 [ 807.478821] fl_walk+0x8e/0x170 [cls_flower] [ 807.483474] tcf_chain_dump+0x35a/0x4d0 [ 807.487703] ? tfilter_notify+0x170/0x170 [ 807.492091] ? tcf_fill_node+0x430/0x430 [ 807.496411] tc_dump_tfilter+0x362/0x3f0 [ 807.500712] ? tc_del_tfilter+0x850/0x850 [ 807.505104] ? kasan_unpoison_shadow+0x30/0x40 [ 807.509940] ? __mutex_unlock_slowpath+0xcf/0x410 [ 807.515031] netlink_dump+0x263/0x4f0 [ 807.519077] __netlink_dump_start+0x2a0/0x300 [ 807.523817] ? tc_del_tfilter+0x850/0x850 [ 807.528198] rtnetlink_rcv_msg+0x46a/0x6d0 [ 807.532671] ? rtnl_fdb_del+0x3f0/0x3f0 [ 807.536878] ? tc_del_tfilter+0x850/0x850 [ 807.541280] netlink_rcv_skb+0x18d/0x200 [ 807.545570] ? rtnl_fdb_del+0x3f0/0x3f0 [ 807.549773] ? netlink_ack+0x500/0x500 [ 807.553913] netlink_unicast+0x2d0/0x370 [ 807.558212] ? netlink_attachskb+0x340/0x340 [ 807.562855] ? _copy_from_iter_full+0xe9/0x3e0 [ 807.567677] ? import_iovec+0x11e/0x1c0 [ 807.571890] netlink_sendmsg+0x3b9/0x6a0 [ 807.576192] ? netlink_unicast+0x370/0x370 [ 807.580684] ? netlink_unicast+0x370/0x370 [ 807.585154] sock_sendmsg+0x6b/0x80 [ 807.589015] ___sys_sendmsg+0x4a1/0x520 [ 807.593230] ? copy_msghdr_from_user+0x210/0x210 [ 807.598232] ? do_wp_page+0x174/0x880 [ 807.602276] ? __handle_mm_fault+0x749/0x1c10 [ 807.607021] ? __handle_mm_fault+0x1046/0x1c10 [ 807.611849] ? __pmd_alloc+0x320/0x320 [ 807.615973] ? check_chain_key+0x140/0x1f0 [ 807.620450] ? check_chain_key+0x140/0x1f0 [ 807.624929] ? __fget_light+0xbc/0xd0 [ 807.628970] ? __sys_sendmsg+0xd7/0x150 [ 807.633172] __sys_sendmsg+0xd7/0x150 [ 807.637201] ? __ia32_sys_shutdown+0x30/0x30 [ 807.641846] ? up_read+0x53/0x90 [ 807.645442] ? __do_page_fault+0x484/0x780 [ 807.649949] ? do_syscall_64+0x1e/0x2c0 [ 807.654164] do_syscall_64+0x72/0x2c0 [ 807.658198] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 807.663625] RIP: 0033:0x7f42e9870150 [ 807.667568] Code: 8b 15 3c 7d 2b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb cd 66 0f 1f 44 00 00 83 3d b9 d5 2b 00 00 75 10 b8 2e 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 be cd 00 00 48 89 04 24 [ 807.687328] RSP: 002b:00007ffdbf595b58 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 807.695564] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f42e9870150 [ 807.703083] RDX: 0000000000000000 RSI: 00007ffdbf595b80 RDI: 0000000000000003 [ 807.710605] RBP: 00007ffdbf599d90 R08: 0000000000679bc0 R09: 000000000000000f [ 807.718127] R10: 00000000000005e7 R11: 0000000000000246 R12: 00007ffdbf599d88 [ 807.725651] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 807.735048] Allocated by task 2687: [ 807.738902] kasan_kmalloc+0xa0/0xd0 [ 807.742852] __kmalloc+0x118/0x2d0 [ 807.746615] tcf_idr_create+0x44/0x320 [ 807.750738] tcf_nat_init+0x41e/0x530 [act_nat] [ 807.755638] tcf_action_init_1+0x4e0/0x650 [ 807.760104] tcf_action_init+0x1ce/0x2d0 [ 807.764395] tcf_exts_validate+0x1d8/0x200 [ 807.768861] fl_change+0x55a/0x26b4 [cls_flower] [ 807.773845] tc_new_tfilter+0x748/0xa20 [ 807.778051] rtnetlink_rcv_msg+0x56a/0x6d0 [ 807.782517] netlink_rcv_skb+0x18d/0x200 [ 807.786804] netlink_unicast+0x2d0/0x370 [ 807.791095] netlink_sendmsg+0x3b9/0x6a0 [ 807.795387] sock_sendmsg+0x6b/0x80 [ 807.799240] ___sys_sendmsg+0x4a1/0x520 [ 807.803445] __sys_sendmsg+0xd7/0x150 [ 807.807473] do_syscall_64+0x72/0x2c0 [ 807.811506] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 807.818776] Freed by task 2728: [ 807.822283] __kasan_slab_free+0x122/0x180 [ 807.826752] kfree+0xf4/0x2f0 [ 807.830080] __tcf_action_put+0x5a/0xb0 [ 807.834281] tcf_action_put_many+0x46/0x70 [ 807.838747] tca_action_gd+0x232/0xc40 [ 807.842862] tc_ctl_action+0x215/0x230 [ 807.846977] rtnetlink_rcv_msg+0x56a/0x6d0 [ 807.851444] netlink_rcv_skb+0x18d/0x200 [ 807.855731] netlink_unicast+0x2d0/0x370 [ 807.860021] netlink_sendmsg+0x3b9/0x6a0 [ 807.864312] sock_sendmsg+0x6b/0x80 [ 807.868166] ___sys_sendmsg+0x4a1/0x520 [ 807.872372] __sys_sendmsg+0xd7/0x150 [ 807.876401] do_syscall_64+0x72/0x2c0 [ 807.880431] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 807.887704] The buggy address belongs to the object at ffff88033e636000 which belongs to the cache kmalloc-256 of size 256 [ 807.900909] The buggy address is located 0 bytes inside of 256-byte region [ffff88033e636000, ffff88033e636100) [ 807.913155] The buggy address belongs to the page: [ 807.918322] page:ffffea000cf98d80 count:1 mapcount:0 mapping:ffff88036f80ee00 index:0x0 compound_mapcount: 0 [ 807.928831] flags: 0x5fff8000008100(slab|head) [ 807.933647] raw: 005fff8000008100 ffffea000db44f00 0000000400000004 ffff88036f80ee00 [ 807.942050] raw: 0000000000000000 0000000080190019 00000001ffffffff 0000000000000000 [ 807.950456] page dumped because: kasan: bad access detected [ 807.958240] Memory state around the buggy address: [ 807.963405] ffff88033e635f00: fc fc fc fc fb fb fb fb fb fb fb fc fc fc fc fb [ 807.971288] ffff88033e635f80: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc [ 807.979166] >ffff88033e636000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 807.994882] ^ [ 807.998477] ffff88033e636080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 808.006352] ffff88033e636100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 808.014230] ================================================================== [ 808.022108] Disabling lock debugging due to kernel taint Fixes: edfaf94fa705 ("net_sched: improve and refactor tcf_action_put_many()") Signed-off-by: Vlad Buslov Acked-by: Cong Wang Signed-off-by: David S. Miller commit 2b82435cb90bed2c5f8398730d964dd11602217c Author: Imre Deak Date: Fri Aug 31 20:47:39 2018 +0300 drm/i915/dp_mst: Fix enabling pipe clock for all streams commit afb2c4437dae ("drm/i915/ddi: Push pipe clock enabling to encoders") inadvertently stopped enabling the pipe clock for any DP-MST stream after the first one. It also rearranged the pipe clock enabling wrt. initial MST payload allocation step (which may or may not be a problem, but it's contrary to the spec.). Fix things by making the above commit truly a non-functional change. Fixes: afb2c4437dae ("drm/i915/ddi: Push pipe clock enabling to encoders") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107365 Reported-by: Lyude Paul Reported-by: dmummenschanz@web.de Tested-by: dmummenschanz@web.de Tested-by: Lyude Paul Cc: Lyude Paul Cc: dmummenschanz@web.de Cc: Ville Syrjälä Cc: Rodrigo Vivi Cc: Chris Wilson Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Reviewed-by: Lyude Paul Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180831174739.30387-1-imre.deak@intel.com (cherry picked from commit 2b5cf4ef541f1b2facaca58cae5e8e0b5f19ad4c) Signed-off-by: Rodrigo Vivi commit 4fe967912ee83048beb45a6b4f0f6774fddcfa0a Author: Manasi Navare Date: Thu Aug 23 18:48:07 2018 -0700 drm/i915/dsc: Fix PPS register definition macros for 2nd VDSC engine This patch fixes the PPS4 and PPS5 register definition macros that were resulting into an incorect MMIO address. Fixes: 2efbb2f099fb ("i915/dp/dsc: Add DSC PPS register definitions") Cc: Anusha Srivatsa Signed-off-by: Manasi Navare Reviewed-by: Rodrigo Vivi Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20180824014807.14681-1-manasi.d.navare@intel.com (cherry picked from commit 5df52391ddbed869c7d67b00fbb013bd64334115) Signed-off-by: Rodrigo Vivi commit 399334708b4f07b107094e5db4a390f0f25d2d4f Author: Jan-Marek Glogowski Date: Sat Aug 25 15:10:35 2018 -0400 drm/i915: Re-apply "Perform link quality check, unconditionally during long pulse" This re-applies the workaround for "some DP sinks, [which] are a little nuts" from commit 1a36147bb939 ("drm/i915: Perform link quality check unconditionally during long pulse"). It makes the secondary AOC E2460P monitor connected via DP to an acer Veriton N4640G usable again. This hunk was dropped in commit c85d200e8321 ("drm/i915: Move SST DP link retraining into the ->post_hotplug() hook") Fixes: c85d200e8321 ("drm/i915: Move SST DP link retraining into the ->post_hotplug() hook") [Cleaned up commit message, added stable cc] Signed-off-by: Lyude Paul Signed-off-by: Jan-Marek Glogowski Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20180825191035.3945-1-lyude@redhat.com (cherry picked from commit 3cf71bc9904d7ee4a25a822c5dcb54c7804ea388) Signed-off-by: Rodrigo Vivi commit f518cd94ecdce3298c9bace261475b6342a0111d Merge: 57361846b52b 54ff01fd0d44 Author: Rodrigo Vivi Date: Mon Sep 3 21:30:55 2018 -0700 Merge tag 'gvt-fixes-2018-09-04' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2018-09-04 - two BXT virtual display emulation fixes (Colin) - gen9 dbuf guest warning fix (Xiaolin) - vgpu close pm warning fix (Hang) - dmabuf format_mod fix (Zhenyu) - multiple VM guest failure fix for scheduling (Zhenyu) Signed-off-by: Rodrigo Vivi From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20180904025437.GE20737@zhen-hp.sh.intel.com commit c48300c92ad9f029f4dcbcf5d71ad880e3acf2fa Author: Gleb Fotengauer-Malinovskiy Date: Mon Sep 3 20:59:13 2018 +0300 vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition The _IOC_READ flag fits this ioctl request more because this request actually only writes to, but doesn't read from userspace. See NOTEs in include/uapi/asm-generic/ioctl.h for more information. Fixes: 429711aec282 ("vhost: switch to use new message format") Signed-off-by: Gleb Fotengauer-Malinovskiy Acked-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 5f8c10936fab2b69a487400f2872902e597dd320 Author: Theodore Ts'o Date: Mon Sep 3 22:25:01 2018 -0400 ext4: fix online resizing for bigalloc file systems with a 1k block size An online resize of a file system with the bigalloc feature enabled and a 1k block size would be refused since ext4_resize_begin() did not understand s_first_data_block is 0 for all bigalloc file systems, even when the block size is 1k. Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit f0a459dec5495a3580f8d784555e6f8f3bf7f263 Author: Theodore Ts'o Date: Mon Sep 3 22:19:43 2018 -0400 ext4: fix online resize's handling of a too-small final block group Avoid growing the file system to an extent so that the last block group is too small to hold all of the metadata that must be stored in the block group. This problem can be triggered with the following reproducer: umount /mnt mke2fs -F -m0 -b 4096 -t ext4 -O resize_inode,^has_journal \ -E resize=1073741824 /tmp/foo.img 128M mount /tmp/foo.img /mnt truncate --size 1708M /tmp/foo.img resize2fs /dev/loop0 295400 umount /mnt e2fsck -fy /tmp/foo.img Reported-by: Torsten Hilbrich Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit 9fd0e09a4e86499639653243edfcb417a05c5c46 Author: Anthony Wong Date: Fri Aug 31 20:06:42 2018 +0800 r8169: add support for NCube 8168 network card This card identifies itself as: Ethernet controller [0200]: NCube Device [10ff:8168] (rev 06) Subsystem: TP-LINK Technologies Co., Ltd. Device [7470:3468] Adding a new entry to rtl8169_pci_tbl makes the card work. Link: http://launchpad.net/bugs/1788730 Signed-off-by: Anthony Wong Signed-off-by: David S. Miller commit 36feaac35405e932ad9c321d7a2db8a7e4a4d7ca Author: Hangbin Liu Date: Fri Aug 31 16:52:01 2018 +0800 ip6_tunnel: respect ttl inherit for ip6tnl man ip-tunnel ttl section says: 0 is a special value meaning that packets inherit the TTL value. IPv4 tunnel respect this in ip_tunnel_xmit(), but IPv6 tunnel has not implement it yet. To make IPv6 behave consistently with IP tunnel, add ipv6 tunnel inherit support. Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit f7c50fa636f72490baceb1664ba64973137266f2 Author: Keyon Jie Date: Mon Sep 3 10:47:09 2018 +0800 ALSA: hda: Fix several mismatch for register mask and value E.g. for snd_hdac_ext_link_clear_stream_id(), we should set (1 << stream) as mask, and 0 as value, here correct it and several similar mismatches. And, here also remove unreadable register_mask usage for those mask value updating. Signed-off-by: Keyon Jie Signed-off-by: Takashi Iwai commit edf4e7b7b9104b58fddfcd073bd7dcc1585d5326 Author: John Johansen Date: Sat Sep 1 01:57:52 2018 -0700 apparmor: fix bad debug check in apparmor_secid_to_secctx() apparmor_secid_to_secctx() has a bad debug statement tripping on a condition handle by the code. When kconfig SECURITY_APPARMOR_DEBUG is enabled the debug WARN_ON will trip when **secdata is NULL resulting in the following trace. ------------[ cut here ]------------ AppArmor WARN apparmor_secid_to_secctx: ((!secdata)): WARNING: CPU: 0 PID: 14826 at security/apparmor/secid.c:82 apparmor_secid_to_secctx+0x2b5/0x2f0 security/apparmor/secid.c:82 Kernel panic - not syncing: panic_on_warn set ... CPU: 0 PID: 14826 Comm: syz-executor1 Not tainted 4.19.0-rc1+ #193 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 panic+0x238/0x4e7 kernel/panic.c:184 __warn.cold.8+0x163/0x1ba kernel/panic.c:536 report_bug+0x252/0x2d0 lib/bug.c:186 fixup_bug arch/x86/kernel/traps.c:178 [inline] do_error_trap+0x1fc/0x4d0 arch/x86/kernel/traps.c:296 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:993 RIP: 0010:apparmor_secid_to_secctx+0x2b5/0x2f0 security/apparmor/secid.c:82 Code: c7 c7 40 66 58 87 e8 6a 6d 0f fe 0f 0b e9 6c fe ff ff e8 3e aa 44 fe 48 c7 c6 80 67 58 87 48 c7 c7 a0 65 58 87 e8 4b 6d 0f fe <0f> 0b e9 3f fe ff ff 48 89 df e8 fc a7 83 fe e9 ed fe ff ff bb f4 RSP: 0018:ffff8801ba1bed10 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff8801ba1beed0 RCX: ffffc9000227e000 RDX: 0000000000018482 RSI: ffffffff8163ac01 RDI: 0000000000000001 RBP: ffff8801ba1bed30 R08: ffff8801b80ec080 R09: ffffed003b603eca R10: ffffed003b603eca R11: ffff8801db01f657 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000000 R15: ffff8801ba1beed0 security_secid_to_secctx+0x63/0xc0 security/security.c:1314 ctnetlink_secctx_size net/netfilter/nf_conntrack_netlink.c:621 [inline] ctnetlink_nlmsg_size net/netfilter/nf_conntrack_netlink.c:659 [inline] ctnetlink_conntrack_event+0x303/0x1470 net/netfilter/nf_conntrack_netlink.c:706 nf_conntrack_eventmask_report+0x55f/0x930 net/netfilter/nf_conntrack_ecache.c:151 nf_conntrack_event_report include/net/netfilter/nf_conntrack_ecache.h:112 [inline] nf_ct_delete+0x33c/0x5d0 net/netfilter/nf_conntrack_core.c:601 nf_ct_iterate_cleanup+0x48c/0x5e0 net/netfilter/nf_conntrack_core.c:1892 nf_ct_iterate_cleanup_net+0x23c/0x2d0 net/netfilter/nf_conntrack_core.c:1974 ctnetlink_flush_conntrack net/netfilter/nf_conntrack_netlink.c:1226 [inline] ctnetlink_del_conntrack+0x66c/0x850 net/netfilter/nf_conntrack_netlink.c:1258 nfnetlink_rcv_msg+0xd88/0x1070 net/netfilter/nfnetlink.c:228 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2454 nfnetlink_rcv+0x1c0/0x4d0 net/netfilter/nfnetlink.c:560 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x5a0/0x760 net/netlink/af_netlink.c:1343 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2114 __sys_sendmsg+0x11d/0x290 net/socket.c:2152 __do_sys_sendmsg net/socket.c:2161 [inline] __se_sys_sendmsg net/socket.c:2159 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2159 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f7bc6e03c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f7bc6e046d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 0000000020d65000 RDI: 0000000000000003 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004d4588 R14: 00000000004c8d5c R15: 0000000000000000 Dumping ftrace buffer: (ftrace buffer empty) Kernel Offset: disabled Rebooting in 86400 seconds.. CC: #4.18 Fixes: c092921219d2 ("apparmor: add support for mapping secids and using secctxes") Reported-by: syzbot+21016130b0580a9de3b5@syzkaller.appspotmail.com Signed-off-by: John Johansen commit 3edd79cf5a44b12dbb13bc320f5788aed6562b36 Author: Marek Szyprowski Date: Mon Sep 3 16:49:37 2018 +0200 regulator: Fix 'do-nothing' value for regulators without suspend state Some regulators don't have all states defined and in such cases regulator core should not assume anything. However in current implementation of of_get_regulation_constraints() DO_NOTHING_IN_SUSPEND enable value was set only for regulators which had suspend node defined, otherwise the default 0 value was used, what means DISABLE_IN_SUSPEND. This lead to broken system suspend/resume on boards, which had simple regulator constraints definition (without suspend state nodes). To avoid further mismatches between the default and uninitialized values of the suspend enabled/disabled states, change the values of the them, so default '0' means DO_NOTHING_IN_SUSPEND. Fixes: 72069f9957a1: regulator: leave one item to record whether regulator is enabled Signed-off-by: Marek Szyprowski Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 4d230d12710646788af581ba0155d83ab48b955c Author: Jiada Wang Date: Mon Sep 3 07:08:58 2018 +0000 ASoC: rsnd: fixup not to call clk_get/set under non-atomic Clocking operations clk_get/set_rate, are non-atomic, they shouldn't be called in soc_pcm_trigger() which is atomic. Following issue was found due to execution of clk_get_rate() causes sleep in soc_pcm_trigger(), which shouldn't be blocked. We can reproduce this issue by following > enable CONFIG_DEBUG_ATOMIC_SLEEP=y > compile, and boot > mount -t debugfs none /sys/kernel/debug > while true; do cat /sys/kernel/debug/clk/clk_summary > /dev/null; done & > while true; do aplay xxx; done This patch adds support to .prepare callback, and moves non-atomic clocking operations to it. As .prepare is non-atomic, it is always called before trigger_start/trigger_stop. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620 in_atomic(): 1, irqs_disabled(): 128, pid: 2242, name: aplay INFO: lockdep is turned off. irq event stamp: 5964 hardirqs last enabled at (5963): [] mutex_lock_nested+0x6e8/0x6f0 hardirqs last disabled at (5964): [] _raw_spin_lock_irqsave+0x24/0x68 softirqs last enabled at (5502): [] __do_softirq+0x560/0x10c0 softirqs last disabled at (5495): [] irq_exit+0x160/0x25c Preemption disabled at:[ 62.904063] [] snd_pcm_stream_lock+0xb4/0xc0 CPU: 2 PID: 2242 Comm: aplay Tainted: G B C 4.9.54+ #186 Hardware name: Renesas Salvator-X board based on r8a7795 (DT) Call trace: [] dump_backtrace+0x0/0x37c [] show_stack+0x14/0x1c [] dump_stack+0xfc/0x154 [] ___might_sleep+0x57c/0x58c [] __might_sleep+0x208/0x21c [] mutex_lock_nested+0xb4/0x6f0 [] clk_prepare_lock+0xb0/0x184 [] clk_core_get_rate+0x14/0x54 [] clk_get_rate+0x20/0x34 [] rsnd_adg_ssi_clk_try_start+0x158/0x4f8 [snd_soc_rcar] [] rsnd_ssi_init+0x668/0x7a0 [snd_soc_rcar] [] rsnd_soc_dai_trigger+0x4bc/0xcf8 [snd_soc_rcar] [] soc_pcm_trigger+0x2a4/0x2d4 Fixes: e7d850dd10f4 ("ASoC: rsnd: use mod base common method on SSI-parent") Signed-off-by: Jiada Wang Signed-off-by: Timo Wischer [Kuninori: tidyup for upstream] Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 5a7b44a8df822e0667fc76ed7130252523993bda Author: Takashi Iwai Date: Mon Sep 3 15:16:43 2018 +0200 ALSA: rawmidi: Initialize allocated buffers syzbot reported the uninitialized value exposure in certain situations using virmidi loop. It's likely a very small race at writing and reading, and the influence is almost negligible. But it's safer to paper over this just by replacing the existing kvmalloc() with kvzalloc(). Reported-by: syzbot+194dffdb8b22fc5d207a@syzkaller.appspotmail.com Signed-off-by: Takashi Iwai commit 9bdda4e9cf2dcecb60a0683b10ffb8cd7e5f2f45 Author: Amir Goldstein Date: Sat Sep 1 09:40:01 2018 +0300 fsnotify: fix ignore mask logic in fsnotify() Commit 92183a42898d ("fsnotify: fix ignore mask logic in send_to_group()") acknoledges the use case of ignoring an event on an inode mark, because of an ignore mask on a mount mark of the same group (i.e. I want to get all events on this file, except for the events that came from that mount). This change depends on correctly merging the inode marks and mount marks group lists, so that the mount mark ignore mask would be tested in send_to_group(). Alas, the merging of the lists did not take into account the case where event in question is not in the mask of any of the mount marks. To fix this, completely remove the tests for inode and mount event masks from the lists merging code. Fixes: 92183a42898d ("fsnotify: fix ignore mask logic in send_to_group") Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit c43c5e9f524ec914e7e202f9c5ab91779629ccc6 Author: Christian Borntraeger Date: Mon Sep 3 10:15:33 2018 +0200 timekeeping: Fix declaration of read_persistent_wall_and_boot_offset() It is read_persistent_wall_and_boot_offset() and not read_persistent_clock_and_boot_offset() Fixes: 3eca993740b8eb40f51 ("timekeeping: Replace read_boot_clock64() with read_persistent_wall_and_boot_offset()") Signed-off-by: Christian Borntraeger Signed-off-by: Thomas Gleixner Cc: Pavel Tatashin Link: https://lkml.kernel.org/r/20180903081533.34366-1-borntraeger@de.ibm.com commit 7001cab1dabc0b72b2b672ef58a90ab64f5e2343 Author: Marcel Ziswiler Date: Wed Aug 29 08:47:57 2018 +0200 spi: tegra20-slink: explicitly enable/disable clock Depending on the SPI instance one may get an interrupt storm upon requesting resp. interrupt unless the clock is explicitly enabled beforehand. This has been observed trying to bring up instance 4 on T20. Signed-off-by: Marcel Ziswiler Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 7aa09ff24301535491cd4de1b93107ee91449a12 Author: Srinivas Kandagatla Date: Mon Sep 3 12:07:47 2018 +0100 ASoC: q6routing: initialize data correctly Some of the router data fields are left as default zeros which are valid dai ids, so initialize these to invalid value of -1. Without intializing these correctly get_session_from_id() can return incorrect session resulting in not closing the opened copp and messing up with the copp ref count. Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver") Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 4331f4d5ada5684fc77fa16e3f6177f077c9e6ec Author: Randy Dunlap Date: Sun Sep 2 19:30:53 2018 -0700 x86: Fix kernel-doc atomic.h warnings Fix kernel-doc warnings in arch/x86/include/asm/atomic.h that are caused by having a #define macro between the kernel-doc notation and the function name. Fixed by moving the #define macro to after the function implementation. Make the same change for atomic64_{32,64}.h for consistency even though there were no kernel-doc warnings found in these header files, but there would be if they were used in generation of documentation. Fixes these kernel-doc warnings: ../arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'i' description in 'arch_atomic_sub_and_test' ../arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'v' description in 'arch_atomic_sub_and_test' ../arch/x86/include/asm/atomic.h:96: warning: Excess function parameter 'v' description in 'arch_atomic_inc' ../arch/x86/include/asm/atomic.h:109: warning: Excess function parameter 'v' description in 'arch_atomic_dec' ../arch/x86/include/asm/atomic.h:124: warning: Excess function parameter 'v' description in 'arch_atomic_dec_and_test' ../arch/x86/include/asm/atomic.h:138: warning: Excess function parameter 'v' description in 'arch_atomic_inc_and_test' ../arch/x86/include/asm/atomic.h:153: warning: Excess function parameter 'i' description in 'arch_atomic_add_negative' ../arch/x86/include/asm/atomic.h:153: warning: Excess function parameter 'v' description in 'arch_atomic_add_negative' Fixes: 18cc1814d4e7 ("atomics/treewide: Make test ops optional") Signed-off-by: Randy Dunlap Signed-off-by: Thomas Gleixner Cc: Mark Rutland Link: https://lkml.kernel.org/r/0a1e678d-c8c5-b32c-2640-ed4e94d399d2@infradead.org commit c6e57b3896fc76299913b8cfd82d853bee8a2c84 Author: Emmanuel Grumbach Date: Fri Aug 31 11:31:13 2018 +0300 mac80211: shorten the IBSS debug messages When tracing is enabled, all the debug messages are recorded and must not exceed MAX_MSG_LEN (100) columns. Longer debug messages grant the user with: WARNING: CPU: 3 PID: 32642 at /tmp/wifi-core-20180806094828/src/iwlwifi-stack-dev/net/mac80211/./trace_msg.h:32 trace_event_raw_event_mac80211_msg_event+0xab/0xc0 [mac80211] Workqueue: phy1 ieee80211_iface_work [mac80211] RIP: 0010:trace_event_raw_event_mac80211_msg_event+0xab/0xc0 [mac80211] Call Trace: __sdata_dbg+0xbd/0x120 [mac80211] ieee80211_ibss_rx_queued_mgmt+0x15f/0x510 [mac80211] ieee80211_iface_work+0x21d/0x320 [mac80211] Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 6c18b27d6e5c6a7206364eae2b47bc8d8b2fa68f Author: Emmanuel Grumbach Date: Fri Aug 31 11:31:12 2018 +0300 mac80211: don't Tx a deauth frame if the AP forbade Tx If the driver fails to properly prepare for the channel switch, mac80211 will disconnect. If the CSA IE had mode set to 1, it means that the clients are not allowed to send any Tx on the current channel, and that includes the deauthentication frame. Make sure that we don't send the deauthentication frame in this case. In iwlwifi, this caused a failure to flush queues since the firmware already closed the queues after having parsed the CSA IE. Then mac80211 would wait until the deauthentication frame would go out (drv_flush(drop=false)) and that would never happen. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 0007e94355fdb71a1cf5dba0754155cba08f0666 Author: Ilan Peer Date: Fri Aug 31 11:31:10 2018 +0300 mac80211: Fix station bandwidth setting after channel switch When performing a channel switch flow for a managed interface, the flow did not update the bandwidth of the AP station and the rate scale algorithm. In case of a channel width downgrade, this would result with the rate scale algorithm using a bandwidth that does not match the interface channel configuration. Fix this by updating the AP station bandwidth and rate scaling algorithm before the actual channel change in case of a bandwidth downgrade, or after the actual channel change in case of a bandwidth upgrade. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit f3ffb6c3a28963657eb8b02a795d75f2ebbd5ef4 Author: Emmanuel Grumbach Date: Fri Aug 31 11:31:06 2018 +0300 mac80211: fix a race between restart and CSA flows We hit a problem with iwlwifi that was caused by a bug in mac80211. A bug in iwlwifi caused the firwmare to crash in certain cases in channel switch. Because of that bug, drv_pre_channel_switch would fail and trigger the restart flow. Now we had the hw restart worker which runs on the system's workqueue and the csa_connection_drop_work worker that runs on mac80211's workqueue that can run together. This is obviously problematic since the restart work wants to reconfigure the connection, while the csa_connection_drop_work worker does the exact opposite: it tries to disconnect. Fix this by cancelling the csa_connection_drop_work worker in the restart worker. Note that this can sound racy: we could have: driver iface_work CSA_work restart_work +++++++++++++++++++++++++++++++++++++++++++++ | <--drv_cs ---| -CS FAILED--> | | | cancel_work(CSA) schedule | CSA work | | | Race between those 2 But this is not possible because we flush the workqueue in the restart worker before we cancel the CSA worker. That would be bullet proof if we could guarantee that we schedule the CSA worker only from the iface_work which runs on the workqueue (and not on the system's workqueue), but unfortunately we do have an instance in which we schedule the CSA work outside the context of the workqueue (ieee80211_chswitch_done). Note also that we should probably cancel other workers like beacon_connection_loss_work and possibly others for different types of interfaces, at the very least, IBSS should suffer from the exact same problem, but for now, do the minimum to fix the actual bug that was actually experienced and reproduced. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit abd76d255d69d70206c01b9cb19ba36a9c1df6a1 Author: Dreyfuss, Haim Date: Fri Aug 31 11:31:04 2018 +0300 mac80211: fix WMM TXOP calculation In commit 9236c4523e5b ("mac80211: limit wmm params to comply with ETSI requirements"), we have limited the WMM parameters to comply with 802.11 and ETSI standard. Mistakenly the TXOP value was caluclated wrong. Fix it by taking the minimum between 802.11 to ETSI to make sure we are not violating both. Fixes: e552af058148 ("mac80211: limit wmm params to comply with ETSI requirements") Signed-off-by: Haim Dreyfuss Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 8442938c3a2177ba16043b3a935f2c78266ad399 Author: Dan Carpenter Date: Fri Aug 31 11:10:55 2018 +0300 cfg80211: fix a type issue in ieee80211_chandef_to_operating_class() The "chandef->center_freq1" variable is a u32 but "freq" is a u16 so we are truncating away the high bits. I noticed this bug because in commit 9cf0a0b4b64a ("cfg80211: Add support for 60GHz band channels 5 and 6") we made "freq <= 56160 + 2160 * 6" a valid requency when before it was only "freq <= 56160 + 2160 * 4" that was valid. It introduces a static checker warning: net/wireless/util.c:1571 ieee80211_chandef_to_operating_class() warn: always true condition '(freq <= 56160 + 2160 * 6) => (0-u16max <= 69120)' But really we probably shouldn't have been truncating the high bits away to begin with. Signed-off-by: Dan Carpenter Signed-off-by: Johannes Berg commit 66eb02d839e8495ae6b612e2d09ff599374b80e2 Author: Lorenzo Bianconi Date: Fri Aug 31 01:04:13 2018 +0200 mac80211: fix an off-by-one issue in A-MSDU max_subframe computation Initialize 'n' to 2 in order to take into account also the first packet in the estimation of max_subframe limit for a given A-MSDU since frag_tail pointer is NULL when ieee80211_amsdu_aggregate routine analyzes the second frame. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Johannes Berg commit b833a3660394876541d2513ce2736debc7c6797a Author: Amir Goldstein Date: Tue Aug 28 10:58:41 2018 +0300 ovl: add ovl_fadvise() Implement stacked fadvise to fix syscalls readahead(2) and fadvise64(2) on an overlayfs file. Suggested-by: Miklos Szeredi Fixes: d1d04ef8572b ("ovl: stack file ops") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 54ff01fd0d44b9681615f77c15fe9ea6dfadb501 Author: Zhenyu Wang Date: Thu Aug 30 11:33:43 2018 +0800 drm/i915/gvt: Give new born vGPU higher scheduling chance This trys to give new born vGPU with higher scheduling chance not only with adding to sched list head and also have higher priority for workload sched for 2 seconds after starting to schedule it. In order for fast GPU execution during VM boot, and ensure guest driver setup with required state given in time. This fixes recent failure seen on one VM with multiple linux VMs running on kernel with commit 2621cefaa42b3("drm/i915: Provide a timeout to i915_gem_wait_for_idle() on setup"), which had shorter setup timeout that caused context state init failed. v2: change to 2s for higher scheduling period Cc: Yuan Hang Reviewed-by: Hang Yuan Signed-off-by: Zhenyu Wang commit 215ab0f021c9fea3c18b75e7d522400ee6a49990 Author: Thadeu Lima de Souza Cascardo Date: Fri Aug 31 08:38:49 2018 -0300 xfrm6: call kfree_skb when skb is toobig After commit d6990976af7c5d8f55903bfb4289b6fb030bf754 ("vti6: fix PMTU caching and reporting on xmit"), some too big skbs might be potentially passed down to __xfrm6_output, causing it to fail to transmit but not free the skb, causing a leak of skb, and consequentially a leak of dst references. After running pmtu.sh, that shows as failure to unregister devices in a namespace: [ 311.397671] unregister_netdevice: waiting for veth_b to become free. Usage count = 1 The fix is to call kfree_skb in case of transmit failures. Fixes: dd767856a36e ("xfrm6: Don't call icmpv6_send on local error") Signed-off-by: Thadeu Lima de Souza Cascardo Reviewed-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit 395a2076b4064f97d3fce03af15210ff2a7bb7f9 Author: Thomas Werschlein Date: Thu Aug 30 18:29:20 2018 +0200 cifs: connect to servername instead of IP for IPC$ share This patch is required allows access to a Microsoft fileserver failover cluster behind a 1:1 NAT firewall. The change also provides stronger context for authentication and share connection (see MS-SMB2 3.3.5.7 and MS-SRVS 3.1.6.8) as noted by Tom Talpey, and addresses comments about the buffer size for the UNC made by Aurélien Aptel. Signed-off-by: Thomas Werschlein Signed-off-by: Steve French CC: Tom Talpey Reviewed-by: Aurelien Aptel CC: Stable commit f801568332321e2b1e7a8bd26c3e4913a312a2ec Author: Steve French Date: Fri Aug 31 15:12:10 2018 -0500 smb3: check for and properly advertise directory lease support Although servers will typically ignore unsupported features, we should advertise the support for directory leases (as Windows e.g. does) in the negotiate protocol capabilities we pass to the server, and should check for the server capability (CAP_DIRECTORY_LEASING) before sending a lease request for an open of a directory. This will prevent us from accidentally sending directory leases to SMB2.1 or SMB2 server for example. Signed-off-by: Steve French CC: Stable Reviewed-by: Ronnie Sahlberg commit 25f2573512d7b38bca4c0878109db9600b8b711f Author: Steve French Date: Wed Aug 29 09:22:22 2018 -0500 smb3: minor debugging clarifications in rfc1001 len processing I ran into some cases where server was returning the wrong length on frames but I couldn't easily match them to the command in the network trace (or server logs) since I need the command and/or multiplex id to find the offending SMB2/SMB3 command. Add these two fields to the log message. In the case of padding too much it may not be a problem in all cases but might have correlated to a network disconnect case in some problems we have been looking at. In the case of frame too short is even more important. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit 5e19697b56a64004e2d0ff1bb952ea05493c088f Author: Steve French Date: Mon Aug 27 17:04:13 2018 -0500 SMB3: Backup intent flag missing for directory opens with backupuid mounts When "backup intent" is requested on the mount (e.g. backupuid or backupgid mount options), the corresponding flag needs to be set on opens of directories (and files) but was missing in some places causing access denied trying to enumerate and backup servers. Fixes kernel bugzilla #200953 https://bugzilla.kernel.org/show_bug.cgi?id=200953 Reported-and-tested-by: Signed-off-by: Steve French CC: Stable Reviewed-by: Pavel Shilovsky commit c15e3f19a6d5c89b1209dc94b40e568177cb0921 Author: Jon Kuhn Date: Mon Jul 9 14:33:14 2018 +0000 fs/cifs: don't translate SFM_SLASH (U+F026) to backslash When a Mac client saves an item containing a backslash to a file server the backslash is represented in the CIFS/SMB protocol as as U+F026. Before this change, listing a directory containing an item with a backslash in its name will return that item with the backslash represented with a true backslash character (U+005C) because convert_sfm_character mapped U+F026 to U+005C when interpretting the CIFS/SMB protocol response. However, attempting to open or stat the path using a true backslash will result in an error because convert_to_sfm_char does not map U+005C back to U+F026 causing the CIFS/SMB request to be made with the backslash represented as U+005C. This change simply prevents the U+F026 to U+005C conversion from happenning. This is analogous to how the code does not do any translation of UNI_SLASH (U+F000). Signed-off-by: Jon Kuhn Signed-off-by: Steve French commit 60c1f89241d49bacf71035470684a8d7b4bb46ea Merge: 57361846b52b 8c89ef7b6b64 Author: Linus Torvalds Date: Sun Sep 2 20:09:36 2018 -0700 Merge tag 'dma-mapping-4.19-2' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: "A few fixes for the fallout of being a little more pedantic about dma masks" * tag 'dma-mapping-4.19-2' of git://git.infradead.org/users/hch/dma-mapping: of/platform: initialise AMBA default DMA masks sparc: set a default 32-bit dma mask for OF devices kernel/dma/direct: take DMA offset into account in dma_direct_supported commit c90bbce9eedd14f9428388d9442b5b3e98a2a6dd Author: Mike Rapoport Date: Mon Aug 20 08:25:37 2018 +0300 m68k: fix early memory reservation for ColdFire MMU systems The bootmem to memblock conversion introduced by the commit 1008a11590b9 ("m68k: switch to MEMBLOCK + NO_BOOTMEM") made reservation of kernel code and data to start from a wrong address. Fix it. Signed-off-by: Mike Rapoport Tested-by: Angelo Dureghello Signed-off-by: Greg Ungerer commit 59a03fea131d671a57b8ed3dc446264c61d4b75f Author: Vinson Lee Date: Sat Sep 1 21:20:27 2018 +0000 uapi: Fix linux/rds.h userspace compilation errors. Include linux/in6.h for struct in6_addr. /usr/include/linux/rds.h:156:18: error: field ‘laddr’ has incomplete type struct in6_addr laddr; ^~~~~ /usr/include/linux/rds.h:157:18: error: field ‘faddr’ has incomplete type struct in6_addr faddr; ^~~~~ /usr/include/linux/rds.h:178:18: error: field ‘laddr’ has incomplete type struct in6_addr laddr; ^~~~~ /usr/include/linux/rds.h:179:18: error: field ‘faddr’ has incomplete type struct in6_addr faddr; ^~~~~ /usr/include/linux/rds.h:198:18: error: field ‘bound_addr’ has incomplete type struct in6_addr bound_addr; ^~~~~~~~~~ /usr/include/linux/rds.h:199:18: error: field ‘connected_addr’ has incomplete type struct in6_addr connected_addr; ^~~~~~~~~~~~~~ /usr/include/linux/rds.h:219:18: error: field ‘local_addr’ has incomplete type struct in6_addr local_addr; ^~~~~~~~~~ /usr/include/linux/rds.h:221:18: error: field ‘peer_addr’ has incomplete type struct in6_addr peer_addr; ^~~~~~~~~ /usr/include/linux/rds.h:245:18: error: field ‘src_addr’ has incomplete type struct in6_addr src_addr; ^~~~~~~~ /usr/include/linux/rds.h:246:18: error: field ‘dst_addr’ has incomplete type struct in6_addr dst_addr; ^~~~~~~~ Fixes: b7ff8b1036f0 ("rds: Extend RDS API for IPv6 support") Signed-off-by: Vinson Lee Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit 16fe10cf92783ed9ceb182d6ea2b8adf5e8ec1b8 Author: Jia-Ju Bai Date: Sat Sep 1 20:11:05 2018 +0800 net: cadence: Fix a sleep-in-atomic-context bug in macb_halt_tx() The kernel module may sleep with holding a spinlock. The function call paths (from bottom to top) in Linux-4.16 are: [FUNC] usleep_range drivers/net/ethernet/cadence/macb_main.c, 648: usleep_range in macb_halt_tx drivers/net/ethernet/cadence/macb_main.c, 730: macb_halt_tx in macb_tx_error_task drivers/net/ethernet/cadence/macb_main.c, 721: _raw_spin_lock_irqsave in macb_tx_error_task To fix this bug, usleep_range() is replaced with udelay(). This bug is found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit a80afe89d81af6b64bf2d9b3afef70dcf75df12b Merge: 15a81b418e22 597222f72a94 Author: David S. Miller Date: Sun Sep 2 15:53:38 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2018-09-02 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix one remaining buggy offset override in sockmap's bpf_msg_pull_data() when linearizing multiple scatterlist elements, from Tushar. 2) Fix BPF sockmap's misuse of ULP when a collision with another ULP is found on map update where it would release existing ULP. syzbot found and triggered this couple of times now, fix from John. 3) Add missing xskmap type to bpftool so it will properly show the type on map dump, from Prashant. ==================== Signed-off-by: David S. Miller commit 20fdcd760a63ea66335c58bceb175e7712ab18ff Author: Fabio Estevam Date: Fri Aug 31 10:24:15 2018 -0300 i2c: imx-lpi2c: Remove mx8dv compatible entry mx8dv never entered into production and there is no other place in the kernel referring to this SoC, so remove it from the driver's compatible entry. Signed-off-by: Fabio Estevam Signed-off-by: Wolfram Sang commit f6eb89349078b2ca3e42dbb272ab444bab1b9f42 Author: Fabio Estevam Date: Fri Aug 31 10:24:14 2018 -0300 dt-bindings: imx-lpi2c: Remove mx8dv compatible entry mx8dv never entered into production and there is no other place in the kernel referring to this SoC, so remove it from the dt bindings documentation. Signed-off-by: Fabio Estevam Signed-off-by: Wolfram Sang commit 4c85609b08c4761eca0a40fd7beb06bc650f252d Author: Masahiro Yamada Date: Fri Aug 31 23:30:48 2018 +0900 i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP This driver currently emits a STOP if the next message is not I2C_MD_RD. It should not do it because it disturbs the I2C_RDWR ioctl, where read/write transactions are combined without STOP between. Issue STOP only when the message is the last one _or_ flagged with I2C_M_STOP. Fixes: 6a62974b667f ("i2c: uniphier_f: add UniPhier FIFO-builtin I2C driver") Signed-off-by: Masahiro Yamada Signed-off-by: Wolfram Sang commit 38f5d8d8cbb2ffa2b54315118185332329ec891c Author: Masahiro Yamada Date: Fri Aug 31 23:30:47 2018 +0900 i2c: uniphier: issue STOP only for last message or I2C_M_STOP This driver currently emits a STOP if the next message is not I2C_MD_RD. It should not do it because it disturbs the I2C_RDWR ioctl, where read/write transactions are combined without STOP between. Issue STOP only when the message is the last one _or_ flagged with I2C_M_STOP. Fixes: dd6fd4a32793 ("i2c: uniphier: add UniPhier FIFO-less I2C driver") Signed-off-by: Masahiro Yamada Signed-off-by: Wolfram Sang commit 57361846b52bc686112da6ca5368d11210796804 Author: Linus Torvalds Date: Sun Sep 2 14:37:30 2018 -0700 Linux 4.19-rc2 commit 15a81b418e22a9aa4a0504471fdcb0f4ebf69b96 Author: David Ahern Date: Thu Aug 30 14:15:43 2018 -0700 net/ipv6: Only update MTU metric if it set Jan reported a regression after an update to 4.18.5. In this case ipv6 default route is setup by systemd-networkd based on data from an RA. The RA contains an MTU of 1492 which is used when the route is first inserted but then systemd-networkd pushes down updates to the default route without the mtu set. Prior to the change to fib6_info, metrics such as MTU were held in the dst_entry and rt6i_pmtu in rt6_info contained an update to the mtu if any. ip6_mtu would look at rt6i_pmtu first and use it if set. If not, the value from the metrics is used if it is set and finally falling back to the idev value. After the fib6_info change metrics are contained in the fib6_info struct and there is no equivalent to rt6i_pmtu. To maintain consistency with the old behavior the new code should only reset the MTU in the metrics if the route update has it set. Fixes: d4ead6b34b67 ("net/ipv6: move metrics from dst to rt6_info") Reported-by: Jan Janssen Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 18eb8aea7fb2fb4490e578b1b8a1096c34b2fc48 Author: Tony Lindgren Date: Wed Aug 29 08:00:24 2018 -0700 net: ethernet: cpsw-phy-sel: prefer phandle for phy sel The cpsw-phy-sel device is not a child of the cpsw interconnect target module. It lives in the system control module. Let's fix this issue by trying to use cpsw-phy-sel phandle first if it exists and if not fall back to current usage of trying to find the cpsw-phy-sel child. That way the phy sel driver can be a child of the system control module where it belongs in the device tree. Without this fix, we cannot have a proper interconnect target module hierarchy in device tree for things like genpd. Note that deferred probe is mostly not supported by cpsw and this patch does not attempt to fix that. In case deferred probe support is needed, this could be added to cpsw_slave_open() and phy_connect() so they start handling and returning errors. For documenting it, looks like the cpsw-phy-sel is used for all cpsw device tree nodes. It's missing the related binding documentation, so let's also update the binding documentation accordingly. Cc: devicetree@vger.kernel.org Cc: Andrew Lunn Cc: Grygorii Strashko Cc: Ivan Khoronzhuk Cc: Mark Rutland Cc: Murali Karicheri Cc: Rob Herring Signed-off-by: Tony Lindgren Signed-off-by: David S. Miller commit 10d7fac4c52618d94a42d701d28f114147291ecc Author: Tony Lindgren Date: Wed Aug 29 08:00:23 2018 -0700 dt-bindings: net: cpsw: Document cpsw-phy-sel usage but prefer phandle The current cpsw usage for cpsw-phy-sel is undocumented but is used for all the boards using cpsw. And cpsw-phy-sel is not really a child of the cpsw device, it lives in the system control module instead. Let's document the existing usage, and improve it a bit where we prefer to use a phandle instead of a child device for it. That way we can properly describe the hardware in dts files for things like genpd. Cc: devicetree@vger.kernel.org Cc: Andrew Lunn Cc: Grygorii Strashko Cc: Ivan Khoronzhuk Cc: Mark Rutland Cc: Murali Karicheri Cc: Rob Herring Signed-off-by: Tony Lindgren Signed-off-by: David S. Miller commit c60e06c3e056f88d5c9bfffcb29dc8aee0b3827b Merge: 93bbadd6e0a2 ff06525fcb8a Author: David S. Miller Date: Sun Sep 2 13:39:37 2018 -0700 Merge branch 'igmp-fix-two-incorrect-unsolicit-report-count-issues' Hangbin Liu says: ==================== igmp: fix two incorrect unsolicit report count issues Just like the subject, fix two minor igmp unsolicit report count issues. ==================== Signed-off-by: David S. Miller commit ff06525fcb8ae3c302ac1319bf6c07c026dea964 Author: Hangbin Liu Date: Wed Aug 29 18:06:10 2018 +0800 igmp: fix incorrect unsolicit report count after link down and up After link down and up, i.e. when call ip_mc_up(), we doesn't init im->unsolicit_count. So after igmp_timer_expire(), we will not start timer again and only send one unsolicit report at last. Fix it by initializing im->unsolicit_count in igmp_group_added(), so we can respect igmp robustness value. Fixes: 24803f38a5c0b ("igmp: do not remove igmp souce list info when set link down") Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit 4fb7253e4f9a8f06a986a3b317e2f79d9b43d552 Author: Hangbin Liu Date: Wed Aug 29 18:06:08 2018 +0800 igmp: fix incorrect unsolicit report count when join group We should not start timer if im->unsolicit_count equal to 0 after decrease. Or we will send one more unsolicit report message. i.e. 3 instead of 2 by default. Fixes: 1da177e4c3f41 ("Linux-2.6.12-rc2") Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit 597222f72a94118f593e4f32bf58ae7e049a0df1 Author: John Fastabend Date: Thu Aug 30 21:25:02 2018 -0700 bpf: avoid misuse of psock when TCP_ULP_BPF collides with another ULP Currently we check sk_user_data is non NULL to determine if the sk exists in a map. However, this is not sufficient to ensure the psock or the ULP ops are not in use by another user, such as kcm or TLS. To avoid this when adding a sock to a map also verify it is of the correct ULP type. Additionally, when releasing a psock verify that it is the TCP_ULP_BPF type before releasing the ULP. The error case where we abort an update due to ULP collision can cause this error path. For example, __sock_map_ctx_update_elem() [...] err = tcp_set_ulp_id(sock, TCP_ULP_BPF) <- collides with TLS if (err) <- so err out here goto out_free [...] out_free: smap_release_sock() <- calling tcp_cleanup_ulp releases the TLS ULP incorrectly. Fixes: 2f857d04601a ("bpf: sockmap, remove STRPARSER map_flags and add multi-map support") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 97911e0ccb54c7478b9dac77e6c54c01b449e3a7 Author: Prashant Bhole Date: Fri Aug 31 15:32:42 2018 +0900 tools/bpf: bpftool, add xskmap in map types When listed all maps, bpftool currently shows (null) for xskmap. Added xskmap type in map_type_name[] to show correct type. Signed-off-by: Prashant Bhole Acked-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 9db39f4d4f94b61e4b64b077f6ddb2bdfb533a88 Author: Tushar Dave Date: Fri Aug 31 23:45:16 2018 +0200 bpf: Fix bpf_msg_pull_data() Helper bpf_msg_pull_data() mistakenly reuses variable 'offset' while linearizing multiple scatterlist elements. Variable 'offset' is used to find first starting scatterlist element i.e. msg->data = sg_virt(&sg[first_sg]) + start - offset" Use different variable name while linearizing multiple scatterlist elements so that value contained in variable 'offset' won't get overwritten. Fixes: 015632bb30da ("bpf: sk_msg program helper bpf_sk_msg_pull_data") Signed-off-by: Tushar Dave Signed-off-by: Daniel Borkmann commit a13bf65f3f2e36008ea60b49d3bda2527e09fd9c Author: Lorenzo Bianconi Date: Fri Aug 31 10:51:14 2018 +0200 iio: imu: st_lsm6dsx: take into account ts samples in wm configuration Take into account hw timer samples in pattern length computation done in st_lsm6dsx_update_watermark routine for watermark configuration. Moreover use samples in pattern (sip) already computed in st_lsm6dsx_update_decimators routine Fixes: 213451076bd3 ("iio: imu: st_lsm6dsx: add hw timestamp support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron commit fd6868d82b824b1bea42001ecc2411f2689d3634 Merge: a3ea9911e225 0413bedabc88 Author: Linus Torvalds Date: Sun Sep 2 10:56:01 2018 -0700 Merge tag 'devicetree-fixes-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "A couple of new helper functions in preparation for some tree wide clean-ups. I'm sending these new helpers now for rc2 in order to simplify the dependencies on subsequent cleanups across the tree in 4.20" * tag 'devicetree-fixes-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of: Add device_type access helper functions of: add node name compare helper functions of: add helper to lookup compatible child node commit a3ea9911e225337472fe7cc9278966049a1571e5 Merge: 899ba79553cf a72b44a871c2 Author: Linus Torvalds Date: Sun Sep 2 10:44:28 2018 -0700 Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC fixes from Olof Johansson: "First batch of fixes post-merge window: - A handful of devicetree changes for i.MX2{3,8} to change over to new panel bindings. The platforms were moved from legacy framebuffers to DRM and some development board panels hadn't yet been converted. - OMAP fixes related to ti-sysc driver conversion fallout, fixing some register offsets, no_console_suspend fixes, etc. - Droid4 changes to fix flaky eMMC probing and vibrator DTS mismerge. - Fixed 0755->0644 permissions on a newly added file. - Defconfig changes to make ARM Versatile more useful with QEMU (helps testing). - Enable defconfig options for new TI SoC platform that was merged this window (AM6)" * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: arm64: defconfig: Enable TI's AM6 SoC platform ARM: defconfig: Update the ARM Versatile defconfig ARM: dts: omap4-droid4: Fix emmc errors seen on some devices ARM: dts: Fix file permission for am335x-osd3358-sm-red.dts ARM: imx_v6_v7_defconfig: Select CONFIG_DRM_PANEL_SEIKO_43WVF1G ARM: mxs_defconfig: Select CONFIG_DRM_PANEL_SEIKO_43WVF1G ARM: dts: imx23-evk: Convert to the new display bindings ARM: dts: imx23-evk: Move regulators outside simple-bus ARM: dts: imx28-evk: Convert to the new display bindings ARM: dts: imx28-evk: Move regulators outside simple-bus Revert "ARM: dts: imx7d: Invert legacy PCI irq mapping" arm: dts: am4372: setup rtc as system-power-controller ARM: dts: omap4-droid4: fix vibrations on Droid 4 bus: ti-sysc: Fix no_console_suspend handling bus: ti-sysc: Fix module register ioremap for larger offsets ARM: OMAP2+: Fix module address for modules using mpu_rt_idx ARM: OMAP2+: Fix null hwmod for ti-sysc debug commit 914b087ff9e0e9a399a4927fa30793064afc0178 Author: Randy Dunlap Date: Tue Aug 28 12:59:10 2018 -0700 kbuild: make missing $DEPMOD a Warning instead of an Error When $DEPMOD is not found, only print a warning instead of exiting with an error message and error status: Warning: 'make modules_install' requires /sbin/depmod. Please install it. This is probably in the kmod package. Change the Error to a Warning because "not all build hosts for cross compiling Linux are Linux systems and are able to provide a working port of depmod, especially at the file patch /sbin/depmod." I.e., "make modules_install" may be used to copy/install the loadable modules files to a target directory on a build system and then transferred to an embedded device where /sbin/depmod is run instead of it being run on the build system. Fixes: 934193a654c1 ("kbuild: verify that $DEPMOD is installed") Signed-off-by: Randy Dunlap Reported-by: H. Nikolaus Schaller Cc: stable@vger.kernel.org Cc: Lucas De Marchi Cc: Lucas De Marchi Cc: Michal Marek Cc: Jessica Yu Cc: Chih-Wei Huang Signed-off-by: Masahiro Yamada commit fd65465b7016dc6d9fa5c2f39cc706c231c9a089 Author: Masahiro Yamada Date: Fri Aug 31 18:34:55 2018 +0900 kconfig: do not require pkg-config on make {menu,n}config Meelis Roos reported a {menu,n}config regression: "I have libncurses devel package installed in the default system location (as do 99%+ on actual developers probably) and in this case, pkg-config is useless. pkg-config is needed only when libraries and headers are installed in non-default locations but it is bad to require installation of pkg-config on all the machines where make menuconfig would be possibly run." For {menu,n}config, do not use pkg-config if it is not installed. For {g,x}config, keep checking pkg-config since we really rely on it for finding the installation paths of the required packages. Fixes: 4ab3b80159d4 ("kconfig: check for pkg-config on make {menu,n,g,x}config") Reported-by: Meelis Roos Signed-off-by: Masahiro Yamada Tested-by: Meelis Roos Tested-by: Randy Dunlap commit 899ba79553cf1699bdcd262950b48501b0285529 Merge: 1395d109cddc ff924c5a1ec7 Author: Linus Torvalds Date: Sun Sep 2 10:11:30 2018 -0700 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: "Speculation: - Make the microcode check more robust - Make the L1TF memory limit depend on the internal cache physical address space and not on the CPUID advertised physical address space, which might be significantly smaller. This avoids disabling L1TF on machines which utilize the full physical address space. - Fix the GDT mapping for EFI calls on 32bit PTI - Fix the MCE nospec implementation to prevent #GP Fixes and robustness: - Use the proper operand order for LSL in the VDSO - Prevent NMI uaccess race against CR3 switching - Add a lockdep check to verify that text_mutex is held in text_poke() functions - Repair the fallout of giving native_restore_fl() a prototype - Prevent kernel memory dumps based on usermode RIP - Wipe KASAN shadow stack before rewinding the stack to prevent false positives - Move the AMS GOTO enforcement to the actual build stage to allow user API header extraction without a compiler - Fix a section mismatch introduced by the on demand VDSO mapping change Miscellaneous: - Trivial typo, GCC quirk removal and CC_SET/OUT() cleanups" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/pti: Fix section mismatch warning/error x86/vdso: Fix lsl operand order x86/mce: Fix set_mce_nospec() to avoid #GP fault x86/efi: Load fixmap GDT in efi_call_phys_epilog() x86/nmi: Fix NMI uaccess race against CR3 switching x86: Allow generating user-space headers without a compiler x86/dumpstack: Don't dump kernel memory based on usermode RIP x86/asm: Use CC_SET()/CC_OUT() in __gen_sigismember() x86/alternatives: Lockdep-enforce text_mutex in text_poke*() x86/entry/64: Wipe KASAN stack shadow before rewind_stack_do_exit() x86/irqflags: Mark native_restore_fl extern inline x86/build: Remove jump label quirk for GCC older than 4.5.2 x86/Kconfig: Fix trivial typo x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+ x86/spectre: Add missing family 6 check to microcode check commit 1395d109cddcf6c8ebf20ba3bfaa2beb48febfbc Merge: 501dacbc2435 6fb86d972078 Author: Linus Torvalds Date: Sun Sep 2 10:09:35 2018 -0700 Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull CPU hotplug fix from Thomas Gleixner: "Remove the stale skip_onerr member from the hotplug states" * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu/hotplug: Remove skip_onerr field from cpuhp_step structure commit 501dacbc2435c0198e0c8561f21bceeeeed87293 Merge: 360bd62dc494 113fc08357ad Author: Linus Torvalds Date: Sun Sep 2 09:41:45 2018 -0700 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull core fixes from Thomas Gleixner: "A small set of updates for core code: - Prevent tracing in functions which are called from trace patching via stop_machine() to prevent executing half patched function trace entries. - Remove old GCC workarounds - Remove pointless includes of notifier.h" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Remove workaround for unreachable warnings from old GCC notifier: Remove notifier header file wherever not used watchdog: Mark watchdog touch functions as notrace commit 8da38ebaad23fe1b0c4a205438676f6356607cfc Author: Filippo Sironi Date: Tue Jul 31 17:29:30 2018 +0200 x86/microcode: Update the new microcode revision unconditionally Handle the case where microcode gets loaded on the BSP's hyperthread sibling first and the boot_cpu_data's microcode revision doesn't get updated because of early exit due to the siblings sharing a microcode engine. For that, simply write the updated revision on all CPUs unconditionally. Signed-off-by: Filippo Sironi Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Cc: prarit@redhat.com Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/1533050970-14385-1-git-send-email-sironi@amazon.de commit 370a132bb2227ff76278f98370e0e701d86ff752 Author: Prarit Bhargava Date: Tue Jul 31 07:27:39 2018 -0400 x86/microcode: Make sure boot_cpu_data.microcode is up-to-date When preparing an MCE record for logging, boot_cpu_data.microcode is used to read out the microcode revision on the box. However, on systems where late microcode update has happened, the microcode revision output in a MCE log record is wrong because boot_cpu_data.microcode is not updated when the microcode gets updated. But, the microcode revision saved in boot_cpu_data's microcode member should be kept up-to-date, regardless, for consistency. Make it so. Fixes: fa94d0c6e0f3 ("x86/MCE: Save microcode revision in machine check records") Signed-off-by: Prarit Bhargava Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Cc: Tony Luck Cc: sironi@amazon.de Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20180731112739.32338-1-prarit@redhat.com commit ff924c5a1ec7548825cc2d07980b03be4224ffac Author: Randy Dunlap Date: Sat Sep 1 21:01:28 2018 -0700 x86/pti: Fix section mismatch warning/error Fix the section mismatch warning in arch/x86/mm/pti.c: WARNING: vmlinux.o(.text+0x6972a): Section mismatch in reference from the function pti_clone_pgtable() to the function .init.text:pti_user_pagetable_walk_pte() The function pti_clone_pgtable() references the function __init pti_user_pagetable_walk_pte(). This is often because pti_clone_pgtable lacks a __init annotation or the annotation of pti_user_pagetable_walk_pte is wrong. FATAL: modpost: Section mismatches detected. Fixes: 85900ea51577 ("x86/pti: Map the vsyscall page if needed") Reported-by: kbuild test robot Signed-off-by: Randy Dunlap Signed-off-by: Thomas Gleixner Cc: Andy Lutomirski Link: https://lkml.kernel.org/r/43a6d6a3-d69d-5eda-da09-0b1c88215a2a@infradead.org commit 65099ea85e885c3ea1272eca8774b771419d8ce8 Author: Matt Ranostay Date: Sat Aug 25 02:00:48 2018 -0700 Revert "iio: temperature: maxim_thermocouple: add MAX31856 part" This reverts commit 535fba29b3e1afef4ba201b3c69a6992583ec0bd. Seems the submitter (er me, hang head in shame) didn't look at the datasheet enough to see that the registers are quite different. This needs to be reverted because a) would never work b) to open it be added to a Maxim RTDs (Resistance Temperature Detectors) under development by author Signed-off-by: Matt Ranostay Signed-off-by: Jonathan Cameron commit 8c89ef7b6b64ba093239305f77a485905d03f7bf Author: Linus Walleij Date: Fri Aug 31 16:13:07 2018 +0200 of/platform: initialise AMBA default DMA masks This addresses a v4.19-rc1 regression in the PL111 DRM driver in drivers/gpu/pl111/* The driver uses the CMA KMS helpers and will thus at some point call down to dma_alloc_attrs() to allocate a chunk of contigous DMA memory for the framebuffer. It appears that in v4.18, it was OK that this (and other DMA mastering AMBA devices) left dev->coherent_dma_mask blank (zero). In v4.19-rc1 the WARN_ON_ONCE(dev && !dev->coherent_dma_mask) in dma_alloc_attrs() in include/linux/dma-mapping.h is triggered. The allocation later fails when get_coherent_dma_mask() is called from __dma_alloc() and __dma_alloc() returns NULL: drm-clcd-pl111 dev:20: coherent DMA mask is unset drm-clcd-pl111 dev:20: [drm:drm_fb_helper_fbdev_setup] *ERROR* Failed to set fbdev configuration It turns out that in commit 4d8bde883bfb ("OF: Don't set default coherent DMA mask") the OF core stops setting the default DMA mask on new devices, especially those lines of the patch: - if (!dev->coherent_dma_mask) - dev->coherent_dma_mask = DMA_BIT_MASK(32); Robin Murphy solved a similar problem in a5516219b102 ("of/platform: Initialise default DMA masks") by simply assigning dev.coherent_dma_mask and the dev.dma_mask to point to the same when creating devices from the device tree, and introducing the same code into the code path creating AMBA/PrimeCell devices solved my problem, graphics now come up. The code simply assumes that the device can access all of the system memory by setting the coherent DMA mask to 0xffffffff when creating a device from the device tree, which is crude, but seems to be what kernel v4.18 assumed. The AMBA PrimeCells do not differ between coherent and streaming DMA so we can just assign the same to any DMA mask. Possibly drivers should augment their coherent DMA mask in accordance with "dma-ranges" from the device tree if more finegranular masking is needed. Reported-by: Russell King Fixes: 4d8bde883bfb ("OF: Don't set default coherent DMA mask") Cc: Russell King Cc: Robin Murphy Signed-off-by: Linus Walleij Signed-off-by: Christoph Hellwig commit 5a7faef72eb9d51487feac467c8c68afa459534c Author: Christoph Hellwig Date: Tue Aug 28 11:25:51 2018 +0200 sparc: set a default 32-bit dma mask for OF devices This keeps the historic default behavior for devices without a DMA mask, but removes the warning about a lacking DMA mask for doing DMA without a mask. Reported-by: Meelis Roos Signed-off-by: Christoph Hellwig Tested-by: Guenter Roeck commit a72b44a871c218e2a0580e68affa1d3528c0587a Merge: 67e6ddb5be44 2d59bb602314 Author: Olof Johansson Date: Sat Sep 1 18:22:19 2018 -0700 Merge tag 'omap-for-v4.19/fixes-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes Fixes for omap variants against v4.19-rc1 These are mostly fixes related to using ti-sysc interconnect target module driver for accessing right register offsets for sgx and cpsw and for no_console_suspend regression. There is also a droid4 emmc fix where emmc may not get detected for some models, and vibrator dts mismerge fix. And we have a file permission fix for am335x-osd3358-sm-red.dts that just got added. And we must tag RTC as system-power-controller for am437x for PMIC to shut down during poweroff. * tag 'omap-for-v4.19/fixes-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: omap4-droid4: Fix emmc errors seen on some devices ARM: dts: Fix file permission for am335x-osd3358-sm-red.dts arm: dts: am4372: setup rtc as system-power-controller ARM: dts: omap4-droid4: fix vibrations on Droid 4 bus: ti-sysc: Fix no_console_suspend handling bus: ti-sysc: Fix module register ioremap for larger offsets ARM: OMAP2+: Fix module address for modules using mpu_rt_idx ARM: OMAP2+: Fix null hwmod for ti-sysc debug Signed-off-by: Olof Johansson commit 93bbadd6e0a2a58e49d265b9b1aa58e621b60a26 Author: Alexey Kodanev Date: Thu Aug 30 19:11:24 2018 +0300 ipv6: don't get lwtstate twice in ip6_rt_copy_init() Commit 80f1a0f4e0cd ("net/ipv6: Put lwtstate when destroying fib6_info") partially fixed the kmemleak [1], lwtstate can be copied from fib6_info, with ip6_rt_copy_init(), and it should be done only once there. rt->dst.lwtstate is set by ip6_rt_init_dst(), at the start of the function ip6_rt_copy_init(), so there is no need to get it again at the end. With this patch, lwtstate also isn't copied from RTF_REJECT routes. [1]: unreferenced object 0xffff880b6aaa14e0 (size 64): comm "ip", pid 10577, jiffies 4295149341 (age 1273.903s) hex dump (first 32 bytes): 01 00 04 00 04 00 00 00 10 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000018664623>] lwtunnel_build_state+0x1bc/0x420 [<00000000b73aa29a>] ip6_route_info_create+0x9f7/0x1fd0 [<00000000ee2c5d1f>] ip6_route_add+0x14/0x70 [<000000008537b55c>] inet6_rtm_newroute+0xd9/0xe0 [<000000002acc50f5>] rtnetlink_rcv_msg+0x66f/0x8e0 [<000000008d9cd381>] netlink_rcv_skb+0x268/0x3b0 [<000000004c893c76>] netlink_unicast+0x417/0x5a0 [<00000000f2ab1afb>] netlink_sendmsg+0x70b/0xc30 [<00000000890ff0aa>] sock_sendmsg+0xb1/0xf0 [<00000000a2e7b66f>] ___sys_sendmsg+0x659/0x950 [<000000001e7426c8>] __sys_sendmsg+0xde/0x170 [<00000000fe411443>] do_syscall_64+0x9f/0x4a0 [<000000001be7b28b>] entry_SYSCALL_64_after_hwframe+0x49/0xbe [<000000006d21f353>] 0xffffffffffffffff Fixes: 6edb3c96a5f0 ("net/ipv6: Defer initialization of dst to data path") Signed-off-by: Alexey Kodanev Reviewed-by: David Ahern Signed-off-by: David S. Miller commit e78e5a91456fcecaa2efbb3706572fe043766f4d Author: Samuel Neves Date: Sat Sep 1 21:14:52 2018 +0100 x86/vdso: Fix lsl operand order In the __getcpu function, lsl is using the wrong target and destination registers. Luckily, the compiler tends to choose %eax for both variables, so it has been working so far. Fixes: a582c540ac1b ("x86/vdso: Use RDPID in preference to LSL when available") Signed-off-by: Samuel Neves Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180901201452.27828-1-sneves@dei.uc.pt commit 360bd62dc4943a0754e6cb5637e01b5b43143cfc Merge: b18ed664c262 74081c9f16a2 Author: Linus Torvalds Date: Sat Sep 1 13:17:15 2018 -0700 Merge tag 'linux-watchdog-4.19-rc2' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog fixlet from Wim Van Sebroeck: "Document support for r8a774a1" * tag 'linux-watchdog-4.19-rc2' of git://www.linux-watchdog.org/linux-watchdog: dt-bindings: watchdog: renesas-wdt: Document r8a774a1 support commit b18ed664c262e6c2f7067f2d12e566d134d13505 Merge: 420f51f4ab6b bded6c03e398 Author: Linus Torvalds Date: Sat Sep 1 13:03:32 2018 -0700 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Stephen Boyd: "Two small fixes, one for the x86 Stoney SoC to get a more accurate clk frequency and the other to fix a bad allocation in the Nuvoton NPCM7XX driver" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: x86: Set default parent to 48Mhz clk: npcm7xx: fix memory allocation commit 4274f516d4bc50648a4d97e4f67ecbd7b65cde4a Author: Theodore Ts'o Date: Sat Sep 1 14:42:14 2018 -0400 ext4: recalucate superblock checksum after updating free blocks/inodes When mounting the superblock, ext4_fill_super() calculates the free blocks and free inodes and stores them in the superblock. It's not strictly necessary, since we don't use them any more, but it's nice to keep them roughly aligned to reality. Since it's not critical for file system correctness, the code doesn't call ext4_commit_super(). The problem is that it's in ext4_commit_super() that we recalculate the superblock checksum. So if we're not going to call ext4_commit_super(), we need to call ext4_superblock_csum_set() to make sure the superblock checksum is consistent. Most of the time, this doesn't matter, since we end up calling ext4_commit_super() very soon thereafter, and definitely by the time the file system is unmounted. However, it doesn't work in this sequence: mke2fs -Fq -t ext4 /dev/vdc 128M mount /dev/vdc /vdc cp xfstests/git-versions /vdc godown /vdc umount /vdc mount /dev/vdc tune2fs -l /dev/vdc With this commit, the "tune2fs -l" no longer fails. Reported-by: Chengguang Xu Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit 9b25436662d5fb4c66eb527ead53cab15f596ee0 Author: Kees Cook Date: Mon Aug 27 14:51:54 2018 -0700 random: make CPU trust a boot parameter Instead of forcing a distro or other system builder to choose at build time whether the CPU is trusted for CRNG seeding via CONFIG_RANDOM_TRUST_CPU, provide a boot-time parameter for end users to control the choice. The CONFIG will set the default state instead. Signed-off-by: Kees Cook Signed-off-by: Theodore Ts'o commit bcd8e91f98c156f4b1ebcfacae675f9cfd962441 Author: Theodore Ts'o Date: Sat Sep 1 12:45:04 2018 -0400 ext4: avoid arithemetic overflow that can trigger a BUG A maliciously crafted file system can cause an overflow when the results of a 64-bit calculation is stored into a 32-bit length parameter. https://bugzilla.kernel.org/show_bug.cgi?id=200623 Signed-off-by: Theodore Ts'o Reported-by: Wen Xu Cc: stable@vger.kernel.org commit c1d0af1a1d5dfde880f588eceb4c00710e0f60ff Author: Christoph Hellwig Date: Fri Aug 24 08:07:52 2018 +0200 kernel/dma/direct: take DMA offset into account in dma_direct_supported When a device has a DMA offset the dma capable result will change due to the difference between the physical and DMA address. Take that into account. Signed-off-by: Christoph Hellwig Reviewed-by: Benjamin Herrenschmidt Reviewed-by: Robin Murphy commit c7486104a5ce7e8763e3cb5157bba8d0f1468d87 Author: LuckTony Date: Fri Aug 31 09:55:06 2018 -0700 x86/mce: Fix set_mce_nospec() to avoid #GP fault The trick with flipping bit 63 to avoid loading the address of the 1:1 mapping of the poisoned page while the 1:1 map is updated used to work when unmapping the page. But it falls down horribly when attempting to directly set the page as uncacheable. The problem is that when the cache mode is changed to uncachable, the pages needs to be flushed from the cache first. But the decoy address is non-canonical due to bit 63 flipped, and the CLFLUSH instruction throws a #GP fault. Add code to change_page_attr_set_clr() to fix the address before calling flush. Fixes: 284ce4011ba6 ("x86/memory_failure: Introduce {set, clear}_mce_nospec()") Suggested-by: Linus Torvalds Signed-off-by: Tony Luck Signed-off-by: Thomas Gleixner Acked-by: Linus Torvalds Cc: Peter Anvin Cc: Borislav Petkov Cc: linux-edac Cc: Dan Williams Cc: Dave Jiang Link: https://lkml.kernel.org/r/20180831165506.GA9605@agluck-desk commit f611a5b4a51fa36a0aa792be474f5d6aacaef7e3 Author: Thomas Falcon Date: Thu Aug 30 13:19:53 2018 -0500 ibmvnic: Include missing return code checks in reset function Check the return codes of these functions and halt reset in case of failure. The driver will remain in a dormant state until the next reset event, when device initialization will be re-attempted. Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller commit c81c7012e0c769b5704c2b07bd5224965e76fb70 Author: Sabrina Dubroca Date: Thu Aug 30 16:01:18 2018 +0200 selftests: pmtu: detect correct binary to ping ipv6 addresses Some systems don't have the ping6 binary anymore, and use ping for everything. Detect the absence of ping6 and try to use ping instead. Fixes: d1f1b9cbf34c ("selftests: net: Introduce first PMTU test") Signed-off-by: Sabrina Dubroca Acked-by: Stefano Brivio Signed-off-by: David S. Miller commit 902b5417f28d955cdb4898df6ffaab15f56c5cff Author: Sabrina Dubroca Date: Thu Aug 30 16:01:17 2018 +0200 selftests: pmtu: maximum MTU for vti4 is 2^16-1-20 Since commit 82612de1c98e ("ip_tunnel: restore binding to ifaces with a large mtu"), the maximum MTU for vti4 is based on IP_MAX_MTU instead of the mysterious constant 0xFFF8. This makes this selftest fail. Fixes: 82612de1c98e ("ip_tunnel: restore binding to ifaces with a large mtu") Signed-off-by: Sabrina Dubroca Acked-by: Stefano Brivio Acked-by: Nicolas Dichtel Signed-off-by: David S. Miller commit 63cc357f7bba6729869565a12df08441a5995d9a Author: Florian Westphal Date: Thu Aug 30 14:24:29 2018 +0200 tcp: do not restart timewait timer on rst reception RFC 1337 says: ''Ignore RST segments in TIME-WAIT state. If the 2 minute MSL is enforced, this fix avoids all three hazards.'' So with net.ipv4.tcp_rfc1337=1, expected behaviour is to have TIME-WAIT sk expire rather than removing it instantly when a reset is received. However, Linux will also re-start the TIME-WAIT timer. This causes connect to fail when tying to re-use ports or very long delays (until syn retry interval exceeds MSL). packetdrill test case: // Demonstrate bogus rearming of TIME-WAIT timer in rfc1337 mode. `sysctl net.ipv4.tcp_rfc1337=1` 0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 0.000 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 0.000 bind(3, ..., ...) = 0 0.000 listen(3, 1) = 0 0.100 < S 0:0(0) win 29200 0.100 > S. 0:0(0) ack 1 0.200 < . 1:1(0) ack 1 win 257 0.200 accept(3, ..., ...) = 4 // Receive first segment 0.310 < P. 1:1001(1000) ack 1 win 46 // Send one ACK 0.310 > . 1:1(0) ack 1001 // read 1000 byte 0.310 read(4, ..., 1000) = 1000 // Application writes 100 bytes 0.350 write(4, ..., 100) = 100 0.350 > P. 1:101(100) ack 1001 // ACK 0.500 < . 1001:1001(0) ack 101 win 257 // close the connection 0.600 close(4) = 0 0.600 > F. 101:101(0) ack 1001 win 244 // Our side is in FIN_WAIT_1 & waits for ack to fin 0.7 < . 1001:1001(0) ack 102 win 244 // Our side is in FIN_WAIT_2 with no outstanding data. 0.8 < F. 1001:1001(0) ack 102 win 244 0.8 > . 102:102(0) ack 1002 win 244 // Our side is now in TIME_WAIT state, send ack for fin. 0.9 < F. 1002:1002(0) ack 102 win 244 0.9 > . 102:102(0) ack 1002 win 244 // Peer reopens with in-window SYN: 1.000 < S 1000:1000(0) win 9200 // Therefore, reply with ACK. 1.000 > . 102:102(0) ack 1002 win 244 // Peer sends RST for this ACK. Normally this RST results // in tw socket removal, but rfc1337=1 setting prevents this. 1.100 < R 1002:1002(0) win 244 // second syn. Due to rfc1337=1 expect another pure ACK. 31.0 < S 1000:1000(0) win 9200 31.0 > . 102:102(0) ack 1002 win 244 // .. and another RST from peer. 31.1 < R 1002:1002(0) win 244 31.2 `echo no timer restart;ss -m -e -a -i -n -t -o state TIME-WAIT` // third syn after one minute. Time-Wait socket should have expired by now. 63.0 < S 1000:1000(0) win 9200 // so we expect a syn-ack & 3whs to proceed from here on. 63.0 > S. 0:0(0) ack 1 Without this patch, 'ss' shows restarts of tw timer and last packet is thus just another pure ack, more than one minute later. This restores the original code from commit 283fd6cf0be690a83 ("Merge in ANK networking jumbo patch") in netdev-vger-cvs.git . For some reason the else branch was removed/lost in 1f28b683339f7 ("Merge in TCP/UDP optimizations and [..]") and timer restart became unconditional. Reported-by: Michal Tesar Signed-off-by: Florian Westphal Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b0e0b0abbd5e52568e3848b0ba54a9efa3a11547 Author: Pavel Machek Date: Thu Aug 30 13:30:03 2018 +0200 net/rds: RDS is not Radio Data System Getting prompt "The RDS Protocol" (RDS) is not too helpful, and it is easily confused with Radio Data System (which we may want to support in kernel, too). Signed-off-by: Pavel Machek Acked-by: Sowmini Varadhan Acked-by: Santosh Shilimkar Acked-by: Sowmini Varadhan Signed-off-by: David S. Miller commit e04e7a7bbd4bbabef4e1a58367e5fc9b2edc3b10 Author: Dexuan Cui Date: Thu Aug 30 05:42:13 2018 +0000 hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe() This patch fixes the race between netvsc_probe() and rndis_set_subchannel(), which can cause a deadlock. These are the related 3 paths which show the deadlock: path #1: Workqueue: hv_vmbus_con vmbus_onmessage_work [hv_vmbus] Call Trace: schedule schedule_preempt_disabled __mutex_lock __device_attach bus_probe_device device_add vmbus_device_register vmbus_onoffer vmbus_onmessage_work process_one_work worker_thread kthread ret_from_fork path #2: schedule schedule_preempt_disabled __mutex_lock netvsc_probe vmbus_probe really_probe __driver_attach bus_for_each_dev driver_attach_async async_run_entry_fn process_one_work worker_thread kthread ret_from_fork path #3: Workqueue: events netvsc_subchan_work [hv_netvsc] Call Trace: schedule rndis_set_subchannel netvsc_subchan_work process_one_work worker_thread kthread ret_from_fork Before path #1 finishes, path #2 can start to run, because just before the "bus_probe_device(dev);" in device_add() in path #1, there is a line "object_uevent(&dev->kobj, KOBJ_ADD);", so systemd-udevd can immediately try to load hv_netvsc and hence path #2 can start to run. Next, path #2 offloads the subchannal's initialization to a workqueue, i.e. path #3, so we can end up in a deadlock situation like this: Path #2 gets the device lock, and is trying to get the rtnl lock; Path #3 gets the rtnl lock and is waiting for all the subchannel messages to be processed; Path #1 is trying to get the device lock, but since #2 is not releasing the device lock, path #1 has to sleep; since the VMBus messages are processed one by one, this means the sub-channel messages can't be procedded, so #3 has to sleep with the rtnl lock held, and finally #2 has to sleep... Now all the 3 paths are sleeping and we hit the deadlock. With the patch, we can make sure #2 gets both the device lock and the rtnl lock together, gets its job done, and releases the locks, so #1 and #3 will not be blocked for ever. Fixes: 8195b1396ec8 ("hv_netvsc: fix deadlock on hotplug") Signed-off-by: Dexuan Cui Cc: Stephen Hemminger Cc: K. Y. Srinivasan Cc: Haiyang Zhang Signed-off-by: David S. Miller commit 9ad716b95fd6c6be46a4f2d5936e514b5bcd744d Author: Jakub Kicinski Date: Wed Aug 29 12:46:08 2018 -0700 nfp: wait for posted reconfigs when disabling the device To avoid leaking a running timer we need to wait for the posted reconfigs after netdev is unregistered. In common case the process of deinitializing the device will perform synchronous reconfigs which wait for posted requests, but especially with VXLAN ports being actively added and removed there can be a race condition leaving a timer running after adapter structure is freed leading to a crash. Add an explicit flush after deregistering and for a good measure a warning to check if timer is running just before structures are freed. Fixes: 3d780b926a12 ("nfp: add async reconfiguration mechanism") Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit 3a7ad0634f0986d807772ba74f66f7c3a73612e5 Author: Eric Dumazet Date: Wed Aug 29 11:50:12 2018 -0700 Revert "packet: switch kvzalloc to allocate memory" This reverts commit 71e41286203c017d24f041a7cd71abea7ca7b1e0. mmap()/munmap() can not be backed by kmalloced pages : We fault in : VM_BUG_ON_PAGE(PageSlab(page), page); unmap_single_vma+0x8a/0x110 unmap_vmas+0x4b/0x90 unmap_region+0xc9/0x140 do_munmap+0x274/0x360 vm_munmap+0x81/0xc0 SyS_munmap+0x2b/0x40 do_syscall_64+0x13e/0x1c0 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Fixes: 71e41286203c ("packet: switch kvzalloc to allocate memory") Signed-off-by: Eric Dumazet Reported-by: John Sperbeck Bisected-by: John Sperbeck Cc: Zhang Yu Cc: Li RongQing Signed-off-by: David S. Miller commit 41a95041126522a921fb73df22cbdd520dfdebad Author: Guoqing Jiang Date: Fri Aug 31 10:05:57 2018 +0800 md-cluster: release RESYNC lock after the last resync message All the RESYNC messages are sent with resync lock held, the only exception is resync_finish which releases resync_lockres before send the last resync message, this should be changed as well. Otherwise, we can see deadlock issue as follows: clustermd2-gqjiang2:~ # cat /proc/mdstat Personalities : [raid10] [raid1] md0 : active raid1 sdg[0] sdf[1] 134144 blocks super 1.2 [2/2] [UU] [===================>.] resync = 99.6% (134144/134144) finish=0.0min speed=26K/sec bitmap: 1/1 pages [4KB], 65536KB chunk unused devices: clustermd2-gqjiang2:~ # ps aux|grep md|grep D root 20497 0.0 0.0 0 0 ? D 16:00 0:00 [md0_raid1] clustermd2-gqjiang2:~ # cat /proc/20497/stack [] dlm_lock_sync+0x8e/0xc0 [md_cluster] [] __sendmsg+0x98/0x130 [md_cluster] [] sendmsg+0x20/0x30 [md_cluster] [] resync_info_update+0xb5/0xc0 [md_cluster] [] md_reap_sync_thread+0x134/0x170 [md_mod] [] md_check_recovery+0x28c/0x510 [md_mod] [] raid1d+0x42/0x800 [raid1] [] md_thread+0x121/0x150 [md_mod] [] kthread+0xff/0x140 [] ret_from_fork+0x35/0x40 [] 0xffffffffffffffff clustermd-gqjiang1:~ # ps aux|grep md|grep D root 20531 0.0 0.0 0 0 ? D 16:00 0:00 [md0_raid1] root 20537 0.0 0.0 0 0 ? D 16:00 0:00 [md0_cluster_rec] root 20676 0.0 0.0 0 0 ? D 16:01 0:00 [md0_resync] clustermd-gqjiang1:~ # cat /proc/mdstat Personalities : [raid10] [raid1] md0 : active raid1 sdf[1] sdg[0] 134144 blocks super 1.2 [2/2] [UU] [===================>.] resync = 97.3% (131072/134144) finish=8076.8min speed=0K/sec bitmap: 1/1 pages [4KB], 65536KB chunk unused devices: clustermd-gqjiang1:~ # cat /proc/20531/stack [] metadata_update_start+0xcd/0xd0 [md_cluster] [] md_update_sb.part.61+0x97/0x820 [md_mod] [] md_check_recovery+0x29b/0x510 [md_mod] [] raid1d+0x42/0x800 [raid1] [] md_thread+0x121/0x150 [md_mod] [] kthread+0xff/0x140 [] ret_from_fork+0x35/0x40 [] 0xffffffffffffffff clustermd-gqjiang1:~ # cat /proc/20537/stack [] freeze_array+0xf2/0x140 [raid1] [] recv_daemon+0x41e/0x580 [md_cluster] [] md_thread+0x121/0x150 [md_mod] [] kthread+0xff/0x140 [] ret_from_fork+0x35/0x40 [] 0xffffffffffffffff clustermd-gqjiang1:~ # cat /proc/20676/stack [] dlm_lock_sync+0x8e/0xc0 [md_cluster] [] lock_token+0x2f/0xa0 [md_cluster] [] lock_comm+0x32/0x90 [md_cluster] [] sendmsg+0x15/0x30 [md_cluster] [] resync_info_update+0x8a/0xc0 [md_cluster] [] raid1_sync_request+0xa9a/0xb10 [raid1] [] md_do_sync+0xbaa/0xf90 [md_mod] [] md_thread+0x121/0x150 [md_mod] [] kthread+0xff/0x140 [] ret_from_fork+0x35/0x40 [] 0xffffffffffffffff Reviewed-by: NeilBrown Signed-off-by: Guoqing Jiang Signed-off-by: Shaohua Li commit 1d0ffd264204eba1861865560f1f7f7a92919384 Author: Xiao Ni Date: Thu Aug 30 15:57:09 2018 +0800 RAID10 BUG_ON in raise_barrier when force is true and conf->barrier is 0 In raid10 reshape_request it gets max_sectors in read_balance. If the underlayer disks have bad blocks, the max_sectors is less than last. It will call goto read_more many times. It calls raise_barrier(conf, sectors_done != 0) every time. In this condition sectors_done is not 0. So the value passed to the argument force of raise_barrier is true. In raise_barrier it checks conf->barrier when force is true. If force is true and conf->barrier is 0, it panic. In this case reshape_request submits bio to under layer disks. And in the callback function of the bio it calls lower_barrier. If the bio finishes before calling raise_barrier again, it can trigger the BUG_ON. Add one pair of raise_barrier/lower_barrier to fix this bug. Signed-off-by: Xiao Ni Suggested-by: Neil Brown Signed-off-by: Shaohua Li commit e254de6bcf3f5b6e78a92ac95fb91acef8adfe1a Author: Shaohua Li Date: Wed Aug 29 11:05:42 2018 -0700 md/raid5-cache: disable reshape completely We don't support reshape yet if an array supports log device. Previously we determine the fact by checking ->log. However, ->log could be NULL after a log device is removed, but the array is still marked to support log device. Don't allow reshape in this case too. User can disable log device support by setting 'consistency_policy' to 'resync' then do reshape. Reported-by: Xiao Ni Tested-by: Xiao Ni Signed-off-by: Shaohua Li commit 3111885015b458c97b4cf272e2a87f1d6f0ed06a Author: Dennis Zhou (Facebook) Date: Fri Aug 31 16:22:44 2018 -0400 blkcg: use tryget logic when associating a blkg with a bio There is a very small change a bio gets caught up in a really unfortunate race between a task migration, cgroup exiting, and itself trying to associate with a blkg. This is due to css offlining being performed after the css->refcnt is killed which triggers removal of blkgs that reach their blkg->refcnt of 0. To avoid this, association with a blkg should use tryget and fallback to using the root_blkg. Fixes: 08e18eab0c579 ("block: add bi_blkg to the bio for cgroups") Reviewed-by: Josef Bacik Signed-off-by: Dennis Zhou Cc: Jiufei Xue Cc: Joseph Qi Cc: Tejun Heo Cc: Josef Bacik Cc: Jens Axboe Signed-off-by: Jens Axboe commit 59b57717fff8b562825d9d25e0180ad7e8048ca9 Author: Dennis Zhou (Facebook) Date: Fri Aug 31 16:22:43 2018 -0400 blkcg: delay blkg destruction until after writeback has finished Currently, blkcg destruction relies on a sequence of events: 1. Destruction starts. blkcg_css_offline() is called and blkgs release their reference to the blkcg. This immediately destroys the cgwbs (writeback). 2. With blkgs giving up their reference, the blkcg ref count should become zero and eventually call blkcg_css_free() which finally frees the blkcg. Jiufei Xue reported that there is a race between blkcg_bio_issue_check() and cgroup_rmdir(). To remedy this, blkg destruction becomes contingent on the completion of all writeback associated with the blkcg. A count of the number of cgwbs is maintained and once that goes to zero, blkg destruction can follow. This should prevent premature blkg destruction related to writeback. The new process for blkcg cleanup is as follows: 1. Destruction starts. blkcg_css_offline() is called which offlines writeback. Blkg destruction is delayed on the cgwb_refcnt count to avoid punting potentially large amounts of outstanding writeback to root while maintaining any ongoing policies. Here, the base cgwb_refcnt is put back. 2. When the cgwb_refcnt becomes zero, blkcg_destroy_blkgs() is called and handles destruction of blkgs. This is where the css reference held by each blkg is released. 3. Once the blkcg ref count goes to zero, blkcg_css_free() is called. This finally frees the blkg. It seems in the past blk-throttle didn't do the most understandable things with taking data from a blkg while associating with current. So, the simplification and unification of what blk-throttle is doing caused this. Fixes: 08e18eab0c579 ("block: add bi_blkg to the bio for cgroups") Reviewed-by: Josef Bacik Signed-off-by: Dennis Zhou Cc: Jiufei Xue Cc: Joseph Qi Cc: Tejun Heo Cc: Josef Bacik Cc: Jens Axboe Signed-off-by: Jens Axboe commit 6b06546206868f723f2061d703a3c3c378dcbf4c Author: Dennis Zhou (Facebook) Date: Fri Aug 31 16:22:42 2018 -0400 Revert "blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()" This reverts commit 4c6994806f708559c2812b73501406e21ae5dcd0. Destroying blkgs is tricky because of the nature of the relationship. A blkg should go away when either a blkcg or a request_queue goes away. However, blkg's pin the blkcg to ensure they remain valid. To break this cycle, when a blkcg is offlined, blkgs put back their css ref. This eventually lets css_free() get called which frees the blkcg. The above commit (4c6994806f70) breaks this order of events by trying to destroy blkgs in css_free(). As the blkgs still hold references to the blkcg, css_free() is never called. The race between blkcg_bio_issue_check() and cgroup_rmdir() will be addressed in the following patch by delaying destruction of a blkg until all writeback associated with the blkcg has been finished. Fixes: 4c6994806f70 ("blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()") Reviewed-by: Josef Bacik Signed-off-by: Dennis Zhou Cc: Jiufei Xue Cc: Joseph Qi Cc: Tejun Heo Cc: Jens Axboe Signed-off-by: Jens Axboe commit 678c8110d23c0ac7d69fda558992c31be64e7507 Author: Eugeniy Paltsev Date: Mon Jul 30 19:26:33 2018 +0300 ARC: dma [IOC]: mark DMA devices connected as dma-coherent Mark DMA devices on AXS103 and HSDK boards connected through IOC port as dma-coherent. Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta commit a8627cda7cfffe1792c199660c2b4f03ba2bd97b Author: Gustavo A. R. Silva Date: Fri Aug 31 10:00:34 2018 -0500 ipmi: Fix NULL pointer dereference in ssif_probe There is a potential execution path in which function ssif_info_find() returns NULL, hence there is a NULL pointer dereference when accessing pointer *addr_info* Fix this by null checking *addr_info* before dereferencing it. Addresses-Coverity-ID: 1473145 ("Explicit null dereferenced") Fixes: e333054a91d1 ("ipmi: Fix I2C client removal in the SSIF driver") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Corey Minyard commit 3fcbb8260a87efb691d837e8cd24e81f65b3eb70 Author: Will Deacon Date: Thu Aug 30 13:52:38 2018 -0700 ARC: atomics: unbork atomic_fetch_##op() In 4.19-rc1, Eugeniy reported weird boot and IO errors on ARC HSDK | INFO: task syslogd:77 blocked for more than 10 seconds. | Not tainted 4.19.0-rc1-00007-gf213acea4e88 #40 | "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this | message. | syslogd D 0 77 76 0x00000000 | | Stack Trace: | __switch_to+0x0/0xac | __schedule+0x1b2/0x730 | io_schedule+0x5c/0xc0 | __lock_page+0x98/0xdc | find_lock_entry+0x38/0x100 | shmem_getpage_gfp.isra.3+0x82/0xbfc | shmem_fault+0x46/0x138 | handle_mm_fault+0x5bc/0x924 | do_page_fault+0x100/0x2b8 | ret_from_exception+0x0/0x8 He bisected to 84c6591103db ("locking/atomics, asm-generic/bitops/lock.h: Rewrite using atomic_fetch_*()") This commit however only unmasked the real issue introduced by commit 4aef66c8ae9 ("locking/atomic, arch/arc: Fix build") which missed the retry-if-scond-failed branch in atomic_fetch_##op() macros. The bisected commit started using atomic_fetch_##op() macros for building the rest of atomics. Fixes: 4aef66c8ae9 ("locking/atomic, arch/arc: Fix build") Reported-by: Eugeniy Paltsev Acked-by: Peter Zijlstra (Intel) Signed-off-by: Will Deacon Signed-off-by: Vineet Gupta [vgupta: wrote changelog] commit 0f02cfbc3d9e413d450d8d0fd660077c23f67eff Author: Paul Burton Date: Thu Aug 30 11:01:21 2018 -0700 MIPS: VDSO: Match data page cache colouring when D$ aliases When a system suffers from dcache aliasing a user program may observe stale VDSO data from an aliased cache line. Notably this can break the expectation that clock_gettime(CLOCK_MONOTONIC, ...) is, as its name suggests, monotonic. In order to ensure that users observe updates to the VDSO data page as intended, align the user mappings of the VDSO data page such that their cache colouring matches that of the virtual address range which the kernel will use to update the data page - typically its unmapped address within kseg0. This ensures that we don't introduce aliasing cache lines for the VDSO data page, and therefore that userland will observe updates without requiring cache invalidation. Signed-off-by: Paul Burton Reported-by: Hauke Mehrtens Reported-by: Rene Nielsen Reported-by: Alexandre Belloni Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") Patchwork: https://patchwork.linux-mips.org/patch/20344/ Tested-by: Alexandre Belloni Tested-by: Hauke Mehrtens Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # v4.4+ commit 7acfda539c0b9636a58bfee56abfb3aeee806d96 Author: Taehee Yoo Date: Sun Aug 26 02:35:44 2018 +0900 netfilter: nf_tables: release chain in flushing set When element of verdict map is deleted, the delete routine should release chain. however, flush element of verdict map routine doesn't release chain. test commands: %nft add table ip filter %nft add chain ip filter c1 %nft add map ip filter map1 { type ipv4_addr : verdict \; } %nft add element ip filter map1 { 1 : jump c1 } %nft flush map ip filter map1 %nft flush ruleset splat looks like: [ 4895.170899] kernel BUG at net/netfilter/nf_tables_api.c:1415! [ 4895.178114] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN PTI [ 4895.178880] CPU: 0 PID: 1670 Comm: nft Not tainted 4.18.0+ #55 [ 4895.178880] RIP: 0010:nf_tables_chain_destroy.isra.28+0x39/0x220 [nf_tables] [ 4895.178880] Code: fc ff df 53 48 89 fb 48 83 c7 50 48 89 fa 48 c1 ea 03 0f b6 04 02 84 c0 74 09 3c 03 7f 05 e8 3e 4c 25 e1 8b 43 50 85 c0 74 02 <0f> 0b 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 [ 4895.228342] RSP: 0018:ffff88010b98f4c0 EFLAGS: 00010202 [ 4895.234841] RAX: 0000000000000001 RBX: ffff8801131c6968 RCX: ffff8801146585b0 [ 4895.234841] RDX: 1ffff10022638d37 RSI: ffff8801191a9348 RDI: ffff8801131c69b8 [ 4895.234841] RBP: ffff8801146585a8 R08: 1ffff1002323526a R09: 0000000000000000 [ 4895.234841] R10: 0000000000000000 R11: 0000000000000000 R12: dead000000000200 [ 4895.234841] R13: dead000000000100 R14: ffffffffa3638af8 R15: dffffc0000000000 [ 4895.234841] FS: 00007f6d188e6700(0000) GS:ffff88011b600000(0000) knlGS:0000000000000000 [ 4895.234841] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4895.234841] CR2: 00007ffe72b8df88 CR3: 000000010e2d4000 CR4: 00000000001006f0 [ 4895.234841] Call Trace: [ 4895.234841] nf_tables_commit+0x2704/0x2c70 [nf_tables] [ 4895.234841] ? nfnetlink_rcv_batch+0xa4f/0x11b0 [nfnetlink] [ 4895.234841] ? nf_tables_setelem_notify.constprop.48+0x1a0/0x1a0 [nf_tables] [ 4895.323824] ? __lock_is_held+0x9d/0x130 [ 4895.323824] ? kasan_unpoison_shadow+0x30/0x40 [ 4895.333299] ? kasan_kmalloc+0xa9/0xc0 [ 4895.333299] ? kmem_cache_alloc_trace+0x2c0/0x310 [ 4895.333299] ? nfnetlink_rcv_batch+0xa4f/0x11b0 [nfnetlink] [ 4895.333299] nfnetlink_rcv_batch+0xdb9/0x11b0 [nfnetlink] [ 4895.333299] ? debug_show_all_locks+0x290/0x290 [ 4895.333299] ? nfnetlink_net_init+0x150/0x150 [nfnetlink] [ 4895.333299] ? sched_clock_cpu+0xe5/0x170 [ 4895.333299] ? sched_clock_local+0xff/0x130 [ 4895.333299] ? sched_clock_cpu+0xe5/0x170 [ 4895.333299] ? find_held_lock+0x39/0x1b0 [ 4895.333299] ? sched_clock_local+0xff/0x130 [ 4895.333299] ? memset+0x1f/0x40 [ 4895.333299] ? nla_parse+0x33/0x260 [ 4895.333299] ? ns_capable_common+0x6e/0x110 [ 4895.333299] nfnetlink_rcv+0x2c0/0x310 [nfnetlink] [ ... ] Fixes: 591054469b3e ("netfilter: nf_tables: revisit chain/object refcounting from elements") Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit e0758412208960be9de11e6d2350c81ffd88410f Author: Florian Westphal Date: Sat Aug 25 01:14:46 2018 +0200 netfilter: kconfig: nat related expression depend on nftables core NF_TABLES_IPV4 is now boolean so it is possible to set NF_TABLES=m NF_TABLES_IPV4=y NFT_CHAIN_NAT_IPV4=y which causes: nft_chain_nat_ipv4.c:(.text+0x6d): undefined reference to `nft_do_chain' Wrap NFT_CHAIN_NAT_IPV4 and related nat expressions with NF_TABLES to restore the dependency. Reported-by: Randy Dunlap Fixes: 02c7b25e5f54 ("netfilter: nf_tables: build-in filter chain type") Signed-off-by: Florian Westphal Acked-by: Randy Dunlap Signed-off-by: Pablo Neira Ayuso commit bc8d2e20a3eb2f8d268ad7bbca878cf3acdcf389 Author: Lukas Bulwahn Date: Thu Aug 30 11:18:42 2018 +0200 kconfig: remove a spurious self-assignment The self assignment was probably introduced by an automated code refactoring in commit 694c49a7c01c ("kconfig: drop localization support"). The issue was identified by a self-assign warning when running make menuconfig with clang. Fixes: 694c49a7c01c ("kconfig: drop localization support") Signed-off-by: Lukas Bulwahn Signed-off-by: Masahiro Yamada commit 6147b1cf19651c7de297e69108b141fb30aa2349 Author: Genki Sky Date: Tue Aug 28 23:26:24 2018 -0400 scripts/setlocalversion: git: Make -dirty check more robust $(git diff-index) relies on the index being refreshed. This refreshing of the index used to happen, but was removed in cdf2bc632ebc ("scripts/setlocalversion on write-protected source tree", 2013-06-14) due to issues with a read-only filesystem. If the index is not refreshed, one runs into problems. E.g. as described in [0], git stores the uid in its index, so even if just the uid has changed (or git is tricked into thinking so), then we will think the tree is dirty. So as in [1], if you package linux-git with a system that uses fakeroot(1), you get a "-dirty" version. Unless you manually $(git update-index --refresh) themselves. The simplest solution seems to be $(git status --porcelain), with an additional flag saying "ignore untracked files". It seems clearer about what it does, and avoids issues regarding cached indexes and writable filesystems, but still has stable output for scripting. [0]: https://public-inbox.org/git/0190ae30-b6c8-2a8b-b1fb-fd9d84e6dfdf@oracle.com/ [1]: https://bbs.archlinux.org/viewtopic.php?id=236702 Signed-off-by: Genki Sky Signed-off-by: Masahiro Yamada commit 420f51f4ab6bce6e580390729fadb89c31123636 Merge: 4290d5b9ca01 f52bb98f5ade Author: Linus Torvalds Date: Fri Aug 31 09:20:30 2018 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "A few arm64 fixes came in this week, specifically fixing some nasty truncation of return values from firmware calls and resolving a VM_BUG_ON due to accessing uninitialised struct pages corresponding to NOMAP pages. Summary: - Fix typos in SVE documentation - Fix type-checking and implicit truncation for SMCCC calls - Force CONFIG_HOLES_IN_ZONE=y so that SLAB doesn't fall over NOMAP regions" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: always enable CONFIG_HOLES_IN_ZONE arm/arm64: smccc-1.1: Handle function result as parameters arm/arm64: smccc-1.1: Make return values unsigned long Documentation/arm64/sve: Couple of improvements and typos commit eeb89e2bb1ac45b0836d4170e97a988c3a746c62 Author: Joerg Roedel Date: Fri Aug 31 10:05:38 2018 +0200 x86/efi: Load fixmap GDT in efi_call_phys_epilog() When PTI is enabled on x86-32 the kernel uses the GDT mapped in the fixmap for the simple reason that this address is also mapped for user-space. The efi_call_phys_prolog()/efi_call_phys_epilog() wrappers change the GDT to call EFI runtime services and switch back to the kernel GDT when they return. But the switch-back uses the writable GDT, not the fixmap GDT. When that happened and and the CPU returns to user-space it switches to the user %cr3 and tries to restore user segment registers. This fails because the writable GDT is not mapped in the user page-table, and without a GDT the fault handlers also can't be launched. The result is a triple fault and reboot of the machine. Fix that by restoring the GDT back to the fixmap GDT which is also mapped in the user page-table. Fixes: 7757d607c6b3 x86/pti: ('Allow CONFIG_PAGE_TABLE_ISOLATION for x86_32') Reported-by: Guenter Roeck Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Guenter Roeck Cc: Ard Biesheuvel Cc: Michal Hocko Cc: Andi Kleen Cc: Linus Torvalds Cc: Dave Hansen Cc: Pavel Machek Cc: hpa@zytor.com Cc: linux-efi@vger.kernel.org Link: https://lkml.kernel.org/r/1535702738-10971-1-git-send-email-joro@8bytes.org commit 4290d5b9ca018be10c7582524f7500df731bfab0 Merge: 01f6543a0dac 6d3c8ce012ce Author: Linus Torvalds Date: Fri Aug 31 08:45:16 2018 -0700 Merge tag 'for-linus-4.19b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - minor cleanup avoiding a warning when building with new gcc - a patch to add a new sysfs node for Xen frontend/backend drivers to make it easier to obtain the state of a pv device - two fixes for 32-bit pv-guests to avoid intermediate L1TF vulnerable PTEs * tag 'for-linus-4.19b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/xen: remove redundant variable save_pud xen: export device state to sysfs x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear x86/xen: don't write ptes directly in 32-bit PV guests commit 01f6543a0dacd8d9901a130b26e9fec080c1f276 Merge: 754cf4b2432d 0986b16ab49b Author: Linus Torvalds Date: Fri Aug 31 08:42:46 2018 -0700 Merge tag 'm68k-for-v4.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k fix from Geert Uytterhoeven: "Just a single fix for a bug introduced during the merge window: fix wrong date and time on PMU-based Macs" * tag 'm68k-for-v4.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k/mac: Use correct PMU response format commit 754cf4b2432dfea0f925a0b760506a9c97c8f00b Merge: 4658aff6eeaa cebc07d84ad7 Author: Linus Torvalds Date: Fri Aug 31 08:38:53 2018 -0700 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: - regression fixes for i801 and designware - better API and leak fix for releasing DMA safe buffers - better greppable strings for the bitbang algorithm * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: sh_mobile: fix leak when using DMA bounce buffer i2c: sh_mobile: define start_ch() void as it only returns 0 anyhow i2c: refactor function to release a DMA safe buffer i2c: algos: bit: make the error messages grepable i2c: designware: Re-init controllers with pm_disabled set on resume i2c: i801: Allow ACPI AML access I/O ports not reserved for SMBus commit d40e3e9e44db4b3c8777f3b515ba6097ba26e3b2 Author: Andrew F. Davis Date: Fri Aug 31 10:14:05 2018 -0500 ASoC: tas6424: Save last fault register even when clear When there is no fault bit set in a fault register we skip the fault reporting section for that register. This also skips over saving that registers value. We save the value so we will not double report an error, but if an error clears then returns we will also not report it as we did not save the all cleared register value. Fix this by saving the fault register value in the all clear path. Signed-off-by: Andrew F. Davis Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 4012e77a903d114f915fc607d6d2ed54a3d6c9b1 Author: Andy Lutomirski Date: Wed Aug 29 08:47:18 2018 -0700 x86/nmi: Fix NMI uaccess race against CR3 switching A NMI can hit in the middle of context switching or in the middle of switch_mm_irqs_off(). In either case, CR3 might not match current->mm, which could cause copy_from_user_nmi() and friends to read the wrong memory. Fix it by adding a new nmi_uaccess_okay() helper and checking it in copy_from_user_nmi() and in __copy_from_user_nmi()'s callers. Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Reviewed-by: Rik van Riel Cc: Nadav Amit Cc: Borislav Petkov Cc: Jann Horn Cc: Peter Zijlstra Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/dd956eba16646fd0b15c3c0741269dfd84452dac.1535557289.git.luto@kernel.org commit 829fe4aa9ac16417a904ad1de1307de906854bcf Author: Ben Hutchings Date: Wed Aug 29 20:43:17 2018 +0100 x86: Allow generating user-space headers without a compiler When bootstrapping an architecture, it's usual to generate the kernel's user-space headers (make headers_install) before building a compiler. Move the compiler check (for asm goto support) to the archprepare target so that it is only done when building code for the target. Fixes: e501ce957a78 ("x86: Force asm-goto") Reported-by: Helmut Grohne Signed-off-by: Ben Hutchings Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180829194317.GA4765@decadent.org.uk commit 342db04ae71273322f0011384a9ed414df8bdae4 Author: Jann Horn Date: Tue Aug 28 17:49:01 2018 +0200 x86/dumpstack: Don't dump kernel memory based on usermode RIP show_opcodes() is used both for dumping kernel instructions and for dumping user instructions. If userspace causes #PF by jumping to a kernel address, show_opcodes() can be reached with regs->ip controlled by the user, pointing to kernel code. Make sure that userspace can't trick us into dumping kernel memory into dmesg. Fixes: 7cccf0725cf7 ("x86/dumpstack: Add a show_ip() function") Signed-off-by: Jann Horn Signed-off-by: Thomas Gleixner Reviewed-by: Kees Cook Reviewed-by: Borislav Petkov Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: security@kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180828154901.112726-1-jannh@google.com commit ef394f3fbecbe61d69450ad8cf0fa8f713c8ce8f Author: Philipp Zabel Date: Fri Aug 31 14:34:02 2018 +0200 regulator: da9063: fix DT probing with constraints Commit 1c892e38ce59 ("regulator: da9063: Handle less LDOs on DA9063L") reordered the da9063_regulator_info[] array, but not the DA9063_ID_* regulator ids and not the da9063_matches[] array, because ids are used as indices in the array initializer. This mismatch between regulator id and da9063_regulator_info[] array index causes the driver probe to fail because constraints from DT are not applied to the correct regulator: da9063 0-0058: Device detected (chip-ID: 0x61, var-ID: 0x50) DA9063_BMEM: Bringing 900000uV into 3300000-3300000uV DA9063_LDO9: Bringing 3300000uV into 2500000-2500000uV DA9063_LDO1: Bringing 900000uV into 3300000-3300000uV DA9063_LDO1: failed to apply 3300000-3300000uV constraint(-22) This patch reorders the DA9063_ID_* as apparently intended, and with them the entries in the da90630_matches[] array. Fixes: 1c892e38ce59 ("regulator: da9063: Handle less LDOs on DA9063L") Signed-off-by: Philipp Zabel Reviewed-by: Geert Uytterhoeven Reviewed-by: Marek Vasut Signed-off-by: Mark Brown commit 0745dde62835be7e2afe62fcdb482fcad79cb743 Author: Corey Minyard Date: Thu Aug 30 13:06:21 2018 -0500 ipmi: Fix I2C client removal in the SSIF driver The SSIF driver was removing any client that came in through the platform interface, but it should only remove clients that it added. On a failure in the probe function, this could result in the following oops when the driver is removed and the client gets unregistered twice: CPU: 107 PID: 30266 Comm: rmmod Not tainted 4.18.0+ #80 Hardware name: Cavium Inc. Saber/Saber, BIOS Cavium reference firmware version 7.0 08/04/2018 pstate: 60400009 (nZCv daif +PAN -UAO) pc : kernfs_find_ns+0x28/0x120 lr : kernfs_find_and_get_ns+0x40/0x60 sp : ffff00002310fb50 x29: ffff00002310fb50 x28: ffff800a8240f800 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000056000000 x24: ffff000009073000 x23: ffff000008998b38 x22: 0000000000000000 x21: ffff800ed86de820 x20: 0000000000000000 x19: ffff00000913a1d8 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 5300737265766972 x13: 643d4d4554535953 x12: 0000000000000030 x11: 0000000000000030 x10: 0101010101010101 x9 : ffff800ea06cc3f9 x8 : 0000000000000000 x7 : 0000000000000141 x6 : ffff000009073000 x5 : ffff800adb706b00 x4 : 0000000000000000 x3 : 00000000ffffffff x2 : 0000000000000000 x1 : ffff000008998b38 x0 : ffff000008356760 Process rmmod (pid: 30266, stack limit = 0x00000000e218418d) Call trace: kernfs_find_ns+0x28/0x120 kernfs_find_and_get_ns+0x40/0x60 sysfs_unmerge_group+0x2c/0x6c dpm_sysfs_remove+0x34/0x70 device_del+0x58/0x30c device_unregister+0x30/0x7c i2c_unregister_device+0x84/0x90 [i2c_core] ssif_platform_remove+0x38/0x98 [ipmi_ssif] platform_drv_remove+0x2c/0x6c device_release_driver_internal+0x168/0x1f8 driver_detach+0x50/0xbc bus_remove_driver+0x74/0xe8 driver_unregister+0x34/0x5c platform_driver_unregister+0x20/0x2c cleanup_ipmi_ssif+0x50/0xd82c [ipmi_ssif] __arm64_sys_delete_module+0x1b4/0x220 el0_svc_handler+0x104/0x160 el0_svc+0x8/0xc Code: aa1e03e0 aa0203f6 aa0103f7 d503201f (7940e280) ---[ end trace 09f0e34cce8e2d8c ]--- Kernel panic - not syncing: Fatal exception SMP: stopping secondary CPUs Kernel Offset: disabled CPU features: 0x23800c38 So track the clients that the SSIF driver adds and only remove those. Reported-by: George Cherian Signed-off-by: Corey Minyard Tested-by: George Cherian Cc: # 4.14.x commit c86ba91be75702c013bbf7379542920b6920e98f Author: Corey Minyard Date: Thu Aug 23 15:22:35 2018 -0500 ipmi: Move BT capabilities detection to the detect call The capabilities detection was being done as part of the normal state machine, but it was possible for it to be running while the upper layers of the IPMI driver were initializing the device, resulting in error and failure to initialize. Move the capabilities detection to the the detect function, so it's done before anything else runs on the device. This also simplifies the state machine and removes some code, as a bonus. Signed-off-by: Corey Minyard Reported-by: Andrew Banman Tested-by: Andrew Banman Cc: commit 2512e40e48d21d8bac09f7e91d2c3ceb2d3b50b2 Author: Corey Minyard Date: Wed Aug 22 12:08:13 2018 -0500 ipmi: Rework SMI registration failure There were certain situations where ipmi_register_smi() would return a failure, but the interface would still be registered and would need to be unregistered. This is obviously a bad design and resulted in an oops in certain failure cases. If the interface is started up in ipmi_register_smi(), then an error occurs, shut down the interface there so the cleanup can be done properly. Fix the various smi users, too. Signed-off-by: Corey Minyard Reported-by: Justin Ernst Tested-by: Justin Ernst Cc: Andrew Banman Cc: Russ Anderson Cc: # 4.18.x commit 0413bedabc886c3a56804d1c80a58e99077b1d91 Author: Rob Herring Date: Tue Aug 28 15:10:48 2018 -0500 of: Add device_type access helper functions In preparation to remove direct access to device_node.type, add of_node_is_type() and of_node_get_device_type() helpers to check and retrieve the device type. Cc: Frank Rowand Signed-off-by: Rob Herring commit 6fb86d97207880c1286cd4cb3a7e6a598afbc727 Author: Mukesh Ojha Date: Tue Aug 28 12:24:54 2018 +0530 cpu/hotplug: Remove skip_onerr field from cpuhp_step structure When notifiers were there, `skip_onerr` was used to avoid calling particular step startup/teardown callbacks in the CPU up/down rollback path, which made the hotplug asymmetric. As notifiers are gone now after the full state machine conversion, the `skip_onerr` field is no longer required. Remove it from the structure and its usage. Signed-off-by: Mukesh Ojha Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/1535439294-31426-1-git-send-email-mojha@codeaurora.org commit f52bb98f5aded4c43e52f5ce19fb83f7261e9e73 Author: James Morse Date: Thu Aug 30 16:05:32 2018 +0100 arm64: mm: always enable CONFIG_HOLES_IN_ZONE Commit 6d526ee26ccd ("arm64: mm: enable CONFIG_HOLES_IN_ZONE for NUMA") only enabled HOLES_IN_ZONE for NUMA systems because the NUMA code was choking on the missing zone for nomap pages. This problem doesn't just apply to NUMA systems. If the architecture doesn't set HAVE_ARCH_PFN_VALID, pfn_valid() will return true if the pfn is part of a valid sparsemem section. When working with multiple pages, the mm code uses pfn_valid_within() to test each page it uses within the sparsemem section is valid. On most systems memory comes in MAX_ORDER_NR_PAGES chunks which all have valid/initialised struct pages. In this case pfn_valid_within() is optimised out. Systems where this isn't true (e.g. due to nomap) should set HOLES_IN_ZONE and provide HAVE_ARCH_PFN_VALID so that mm tests each page as it works with it. Currently non-NUMA arm64 systems can't enable HOLES_IN_ZONE, leading to a VM_BUG_ON(): | page:fffffdff802e1780 is uninitialized and poisoned | raw: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff | raw: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff | page dumped because: VM_BUG_ON_PAGE(PagePoisoned(p)) | ------------[ cut here ]------------ | kernel BUG at include/linux/mm.h:978! | Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [...] | CPU: 1 PID: 25236 Comm: dd Not tainted 4.18.0 #7 | Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 | pstate: 40000085 (nZcv daIf -PAN -UAO) | pc : move_freepages_block+0x144/0x248 | lr : move_freepages_block+0x144/0x248 | sp : fffffe0071177680 [...] | Process dd (pid: 25236, stack limit = 0x0000000094cc07fb) | Call trace: | move_freepages_block+0x144/0x248 | steal_suitable_fallback+0x100/0x16c | get_page_from_freelist+0x440/0xb20 | __alloc_pages_nodemask+0xe8/0x838 | new_slab+0xd4/0x418 | ___slab_alloc.constprop.27+0x380/0x4a8 | __slab_alloc.isra.21.constprop.26+0x24/0x34 | kmem_cache_alloc+0xa8/0x180 | alloc_buffer_head+0x1c/0x90 | alloc_page_buffers+0x68/0xb0 | create_empty_buffers+0x20/0x1ec | create_page_buffers+0xb0/0xf0 | __block_write_begin_int+0xc4/0x564 | __block_write_begin+0x10/0x18 | block_write_begin+0x48/0xd0 | blkdev_write_begin+0x28/0x30 | generic_perform_write+0x98/0x16c | __generic_file_write_iter+0x138/0x168 | blkdev_write_iter+0x80/0xf0 | __vfs_write+0xe4/0x10c | vfs_write+0xb4/0x168 | ksys_write+0x44/0x88 | sys_write+0xc/0x14 | el0_svc_naked+0x30/0x34 | Code: aa1303e0 90001a01 91296421 94008902 (d4210000) | ---[ end trace 1601ba47f6e883fe ]--- Remove the NUMA dependency. Link: https://www.spinics.net/lists/arm-kernel/msg671851.html Cc: Cc: Ard Biesheuvel Reported-by: Mikulas Patocka Reviewed-by: Pavel Tatashin Tested-by: Mikulas Patocka Signed-off-by: James Morse Signed-off-by: Will Deacon commit d49b48f088c323dbacae44dfbe56d9c985c8a2a1 Author: Vincent Whitchurch Date: Fri Aug 31 09:04:18 2018 +0200 gpio: Fix crash due to registration race gpiochip_add_data_with_key() adds the gpiochip to the gpio_devices list before of_gpiochip_add() is called, but it's only the latter which sets the ->of_xlate function pointer. gpiochip_find() can be called by someone else between these two actions, and it can find the chip and call of_gpiochip_match_node_and_xlate() which leads to the following crash due to a NULL ->of_xlate(). Unhandled prefetch abort: page domain fault (0x01b) at 0x00000000 Modules linked in: leds_gpio(+) gpio_generic(+) CPU: 0 PID: 830 Comm: insmod Not tainted 4.18.0+ #43 Hardware name: ARM-Versatile Express PC is at (null) LR is at of_gpiochip_match_node_and_xlate+0x2c/0x38 Process insmod (pid: 830, stack limit = 0x(ptrval)) (of_gpiochip_match_node_and_xlate) from (gpiochip_find+0x48/0x84) (gpiochip_find) from (of_get_named_gpiod_flags+0xa8/0x238) (of_get_named_gpiod_flags) from (gpiod_get_from_of_node+0x2c/0xc8) (gpiod_get_from_of_node) from (devm_fwnode_get_index_gpiod_from_child+0xb8/0x144) (devm_fwnode_get_index_gpiod_from_child) from (gpio_led_probe+0x208/0x3c4 [leds_gpio]) (gpio_led_probe [leds_gpio]) from (platform_drv_probe+0x48/0x9c) (platform_drv_probe) from (really_probe+0x1d0/0x3d4) (really_probe) from (driver_probe_device+0x78/0x1c0) (driver_probe_device) from (__driver_attach+0x120/0x13c) (__driver_attach) from (bus_for_each_dev+0x68/0xb4) (bus_for_each_dev) from (bus_add_driver+0x1a8/0x268) (bus_add_driver) from (driver_register+0x78/0x10c) (driver_register) from (do_one_initcall+0x54/0x1fc) (do_one_initcall) from (do_init_module+0x64/0x1f4) (do_init_module) from (load_module+0x2198/0x26ac) (load_module) from (sys_finit_module+0xe0/0x110) (sys_finit_module) from (ret_fast_syscall+0x0/0x54) One way to fix this would be to rework the hairy registration sequence in gpiochip_add_data_with_key(), but since I'd probably introduce a couple of new bugs if I attempted that, simply add a check for a non-NULL of_xlate function pointer in of_gpiochip_match_node_and_xlate(). This works since the driver looking for the gpio will simply fail to find the gpio and defer its probe and be reprobed when the driver which is registering the gpiochip has fully completed its probe. Signed-off-by: Vincent Whitchurch Signed-off-by: Linus Walleij commit 0986b16ab49b18063d29a9e02e9c7fab1928bc8e Author: Finn Thain Date: Fri Aug 24 12:02:06 2018 +1000 m68k/mac: Use correct PMU response format Now that the 68k Mac port has adopted the via-pmu driver, it must decode the PMU response accordingly otherwise the date and time will be wrong. Fixes: ebd722275f9cfc67 ("macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver") Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven commit 4658aff6eeaaf0b049ce787513abfc985c452e3a Merge: 217c3e019675 49a51c4b4064 Author: Linus Torvalds Date: Thu Aug 30 21:18:05 2018 -0700 Merge tag 'drm-fixes-2018-08-31' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular fixes pull: - Mediatek has a bunch of fixes to their RDMA and Overlay engines. - i915 has some Cannonlake/Geminilake watermark workarounds, LSPCON fix, HDCP free fix, audio fix and a ppgtt reference counting fix. - amdgpu has some SRIOV, Kasan, memory leaks and other misc fixes" * tag 'drm-fixes-2018-08-31' of git://anongit.freedesktop.org/drm/drm: (35 commits) drm/i915/audio: Hook up component bindings even if displays are disabled drm/i915: Increase LSPCON timeout drm/i915: Stop holding a ref to the ppgtt from each vma drm/i915: Free write_buf that we allocated with kzalloc. drm/i915: Fix glk/cnl display w/a #1175 drm/amdgpu: Need to set moved to true when evict bo drm/amdgpu: Remove duplicated power source update drm/amd/display: Fix memory leak caused by missed dc_sink_release drm/amdgpu: fix holding mn_lock while allocating memory drm/amdgpu: Power on uvd block when hw_fini drm/amdgpu: Update power state at the end of smu hw_init. drm/amdgpu: Fix vce initialize failed on Kaveri/Mullins drm/amdgpu: Enable/disable gfx PG feature in rlc safe mode drm/amdgpu: Adjust the VM size based on system memory size v2 drm/mediatek: fix connection from RDMA2 to DSI1 drm/mediatek: update some variable name from ovl to comp drm/mediatek: use layer_nr function to get layer number to init plane drm/mediatek: add function to return RDMA layer number drm/mediatek: add function to return OVL layer number drm/mediatek: add function to get layer number for component ... commit 217c3e0196758662aa0429863b09d1c13da1c5d6 Author: Stephen Rothwell Date: Fri Aug 31 07:47:28 2018 +1000 disable stringop truncation warnings for now They are too noisy Signed-off-by: Stephen Rothwell Signed-off-by: Linus Torvalds commit b6935d2aa49dabff296680a6f349b32e5a16afe0 Merge: fb6463856658 a0b9c4de7bf3 Author: Linus Torvalds Date: Thu Aug 30 18:02:02 2018 -0700 Merge tag 'pm-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These address a corner case in the menu cpuidle governor and fix error handling in the PM core's generic clock management code. Specifics: - Make the menu cpuidle governor avoid stopping the scheduler tick if the predicted idle duration exceeds the tick period length, but the selected idle state is shallow and deeper idle states with high target residencies are available (Rafael Wysocki). - Make the PM core's generic clock management code use a proper data type for one variable to make error handling work (Dan Carpenter)" * tag 'pm-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpuidle: menu: Retain tick when shallow state is selected PM / clk: signedness bug in of_pm_clk_add_clks() commit 2b52e2a67c86b0714eeae0d2030cb7fc14737626 Author: Masahiro Yamada Date: Mon Aug 27 12:07:37 2018 +0900 arc: remove redundant GCC version checks Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") bumped the minimum GCC version to 4.6 for all architectures. With GCC >= 4.6 assumed, 'upto_gcc44' is empty, 'atleast_gcc44' is y. Signed-off-by: Masahiro Yamada Signed-off-by: Vineet Gupta commit a0b9c4de7bf3dacc32a7e70fff25e158a0bf848f Merge: 757ab15c3f49 5e2e2f9f76e1 Author: Rafael J. Wysocki Date: Fri Aug 31 01:23:31 2018 +0200 Merge branch 'pm-core' Merge a generic clock management fix for 4.19-rc2. * pm-core: PM / clk: signedness bug in of_pm_clk_add_clks() commit bded6c03e398dc6e862dc8301fb9a60175740653 Author: Akshu Agrawal Date: Tue Aug 21 12:21:57 2018 +0530 clk: x86: Set default parent to 48Mhz System clk provided in ST soc can be set to: 48Mhz, non-spread 25Mhz, spread To get accurate rate, we need it to set it at non-spread option which is 48Mhz. Signed-off-by: Akshu Agrawal Reviewed-by: Daniel Kurtz Fixes: 421bf6a1f061 ("clk: x86: Add ST oscout platform clock") Signed-off-by: Stephen Boyd commit cebc07d84ad71bc58d6f59b770e4347da48a5a2b Author: Wolfram Sang Date: Fri Aug 24 16:52:46 2018 +0200 i2c: sh_mobile: fix leak when using DMA bounce buffer We only freed the bounce buffer after successful DMA, missing the cases where DMA setup may have gone wrong. Use a better location which always gets called after each message and use 'stop_after_dma' as a flag for a successful transfer. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Signed-off-by: Wolfram Sang commit 531db50170a3e6d113c968fe7a6dda8d55d02ede Author: Wolfram Sang Date: Fri Aug 24 16:52:45 2018 +0200 i2c: sh_mobile: define start_ch() void as it only returns 0 anyhow After various refactoring over the years, start_ch() doesn't return errno anymore, so make the function return void. This saves the error handling when calling it which in turn eases cleanup of resources of a future patch. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Signed-off-by: Wolfram Sang commit 82fe39a6bc7b866fc3ffd838e3c5a4cadb328b04 Author: Wolfram Sang Date: Fri Aug 24 16:52:44 2018 +0200 i2c: refactor function to release a DMA safe buffer a) rename to 'put' instead of 'release' to match 'get' when obtaining the buffer b) change the argument order to have the buffer as first argument c) add a new argument telling the function if the message was transferred. This allows the function to be used also in cases where setting up DMA failed, so the buffer needs to be freed without syncing to the message buffer. Also convert the only user. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Signed-off-by: Wolfram Sang commit 1204d12a494cf5dff497859a5febf2ae30a28970 Author: Jan Kundrát Date: Tue Aug 28 10:07:40 2018 +0200 i2c: algos: bit: make the error messages grepable Yep, I went looking for one of these, and I wasn't able to find it easily. That's worse than a line which is 82-chars long, IMHO. Signed-off-by: Jan Kundrát Signed-off-by: Wolfram Sang commit 9d9a152ebaa86a9dede4624919566483c955d0a7 Author: Hans de Goede Date: Wed Aug 29 15:06:31 2018 +0200 i2c: designware: Re-init controllers with pm_disabled set on resume On Bay Trail and Cherry Trail devices we set the pm_disabled flag for I2C busses which the OS shares with the PUNIT as these need special handling. Until now we called dev_pm_syscore_device(dev, true) for I2C controllers with this flag set to keep these I2C controllers always on. After commit 12864ff8545f ("ACPI / LPSS: Avoid PM quirks on suspend and resume from hibernation"), this no longer works. This commit modifies lpss_iosf_exit_d3_state() to only run if lpss_iosf_enter_d3_state() has ran before it, so that it does not run on a resume from hibernate (or from S3). On these systems the conditions for lpss_iosf_enter_d3_state() to run never become true, so lpss_iosf_exit_d3_state() never gets called and the 2 LPSS DMA controllers never get forced into D0 mode, instead they are left in their default automatic power-on when needed mode. The not forcing of D0 mode for the DMA controllers enables these systems to properly enter S0ix modes, which is a good thing. But after entering S0ix modes the I2C controller connected to the PMIC no longer works, leading to e.g. broken battery monitoring. The _PS3 method for this I2C controller looks like this: Method (_PS3, 0, NotSerialized) // _PS3: Power State 3 { If ((((PMID == 0x04) || (PMID == 0x05)) || (PMID == 0x06))) { Return (Zero) } PSAT |= 0x03 Local0 = PSAT /* \_SB_.I2C5.PSAT */ } Where PMID = 0x05, so we enter the Return (Zero) path on these systems. So even if we were to not call dev_pm_syscore_device(dev, true) the I2C controller will be left in D0 rather then be switched to D3. Yet on other Bay and Cherry Trail devices S0ix is not entered unless *all* I2C controllers are in D3 mode. This combined with the I2C controller no longer working now that we reach S0ix states on these systems leads to me believing that the PUNIT itself puts the I2C controller in D3 when all other conditions for entering S0ix states are true. Since now the I2C controller is put in D3 over a suspend/resume we must re-initialize it afterwards and that does indeed fix it no longer working. This commit implements this fix by: 1) Making the suspend_late callback a no-op if pm_disabled is set and making the resume_early callback skip the clock re-enable (since it now was not disabled) while still doing the necessary I2C controller re-init. 2) Removing the dev_pm_syscore_device(dev, true) call, so that the suspend and resume callbacks are actually called. Normally this would cause the ACPI pm code to call _PS3 putting the I2C controller in D3, wreaking havoc since it is shared with the PUNIT, but in this special case the _PS3 method is a no-op so we can safely allow a "fake" suspend / resume. Fixes: 12864ff8545f ("ACPI / LPSS: Avoid PM quirks on suspend and resume ...") Link: https://bugzilla.kernel.org/show_bug.cgi?id=200861 Cc: 4.15+ # 4.15+ Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 7fd6d98b89f382d414e1db528e29a67bbd749457 Author: Mika Westerberg Date: Thu Aug 30 11:50:13 2018 +0300 i2c: i801: Allow ACPI AML access I/O ports not reserved for SMBus Commit 7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR") made it possible for AML code to access SMBus I/O ports by installing custom SystemIO OpRegion handler and blocking i80i driver access upon first AML read/write to this OpRegion. However, while ThinkPad T560 does have SystemIO OpRegion declared under the SMBus device, it does not access any of the SMBus registers: Device (SMBU) { ... OperationRegion (SMBP, PCI_Config, 0x50, 0x04) Field (SMBP, DWordAcc, NoLock, Preserve) { , 5, TCOB, 11, Offset (0x04) } Name (TCBV, 0x00) Method (TCBS, 0, NotSerialized) { If ((TCBV == 0x00)) { TCBV = (\_SB.PCI0.SMBU.TCOB << 0x05) } Return (TCBV) /* \_SB_.PCI0.SMBU.TCBV */ } OperationRegion (TCBA, SystemIO, TCBS (), 0x10) Field (TCBA, ByteAcc, NoLock, Preserve) { Offset (0x04), , 9, CPSC, 1 } } Problem with the current approach is that it blocks all I/O port access and because this system has touchpad connected to the SMBus controller after first AML access (happens during suspend/resume cycle) the touchpad fails to work anymore. Fix this so that we allow ACPI AML I/O port access if it does not touch the region reserved for the SMBus. Fixes: 7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR") Link: https://bugzilla.kernel.org/show_bug.cgi?id=200737 Reported-by: Yussuf Khalil Signed-off-by: Mika Westerberg Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit fb64638566588392e4a544760b649fd7f857e33a Merge: 9f8f16c86e4d 52bd456a66c1 Author: Linus Torvalds Date: Thu Aug 30 13:39:04 2018 -0700 Merge tag 'for-linus-20180830' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Small collection of fixes that should go into this series. This pull contains: - NVMe pull request with three small fixes (via Christoph) - Kill useless NULL check before kmem_cache_destroy (Chengguang Xu) - Xen block driver pull request with persistent grant flushing fixes (Juergen Gross) - Final wbt fixes, wrapping up the changes for this series. These have been heavily tested (me) - cdrom info leak fix (Scott Bauer) - ATA dma quirk for SQ201 (Linus Walleij) - Straight forward bsg refcount_t conversion (John Pittman)" * tag 'for-linus-20180830' of git://git.kernel.dk/linux-block: cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status nvmet: free workqueue object if module init fails nvme-fcloop: Fix dropped LS's to removed target port nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event block: bsg: move atomic_t ref_count variable to refcount API block: remove unnecessary condition check ata: ftide010: Add a quirk for SQ201 blk-wbt: remove dead code blk-wbt: improve waking of tasks blk-wbt: abstract out end IO completion handler xen/blkback: remove unused pers_gnts_lock from struct xen_blkif_ring xen/blkback: move persistent grants flags to bool xen/blkfront: reorder tests in xlblk_init() xen/blkfront: cleanup stale persistent grants xen/blkback: don't keep persistent grants too long commit cd2315d471f45a36cb1329722920d89cd6d3d11f Author: Benjamin Fair Date: Fri Jul 6 11:16:03 2018 -0700 ipmi: kcs_bmc: don't change device name kcs_bmc_alloc(...) calls dev_set_name(...) which is incorrect as most bus driver frameworks, platform_driver in particular, assume that they are able to set the device name themselves. Signed-off-by: Benjamin Fair Signed-off-by: Corey Minyard commit f42b0e18f2e5cf34f73ef1b6327b49040b307a33 Author: Rob Herring Date: Mon Aug 27 07:50:47 2018 -0500 of: add node name compare helper functions In preparation to remove device_node.name pointer, add helper functions for node name comparisons which are a common pattern throughout the kernel. Cc: Frank Rowand Signed-off-by: Rob Herring commit 4e67b2a5df5d3f341776d12ee575e00ca3ef92de Author: Kim Phillips Date: Mon Aug 27 12:53:40 2018 -0500 perf annotate: Fix parsing aarch64 branch instructions after objdump update Starting with binutils 2.28, aarch64 objdump adds comments to the disassembly output to show the alternative names of a condition code [1]. It is assumed that commas in objdump comments could occur in other arches now or in the future, so this fix is arch-independent. The fix could have been done with arm64 specific jump__parse and jump__scnprintf functions, but the jump__scnprintf instruction would have to have its comment character be a literal, since the scnprintf functions cannot receive a struct arch easily. This inconvenience also applies to the generic jump__scnprintf, which is why we add a raw_comment pointer to struct ins_operands, so the __parse function assigns it to be re-used by its corresponding __scnprintf function. Example differences in 'perf annotate --stdio2' output on an aarch64 perf.data file: BEFORE: → b.cs ffff200008133d1c // b.hs, dffff7ecc47b AFTER : ↓ b.cs 18c BEFORE: → b.cc ffff200008d8d9cc // b.lo, b.ul, dffff727295b AFTER : ↓ b.cc 31c The branch target labels 18c and 31c also now appear in the output: BEFORE: add x26, x29, #0x80 AFTER : 18c: add x26, x29, #0x80 BEFORE: add x21, x21, #0x8 AFTER : 31c: add x21, x21, #0x8 The Fixes: tag below is added so stable branches will get the update; it doesn't necessarily mean that commit was broken at the time, rather it didn't withstand the aarch64 objdump update. Tested no difference in output for sample x86_64, power arch perf.data files. [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=bb7eff5206e4795ac79c177a80fe9f4630aaf730 Signed-off-by: Kim Phillips Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Anton Blanchard Cc: Christian Borntraeger Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Robin Murphy Cc: Taeung Song Cc: linux-arm-kernel@lists.infradead.org Fixes: b13bbeee5ee6 ("perf annotate: Fix branch instruction with multiple operands") Link: http://lkml.kernel.org/r/20180827125340.a2f7e291901d17cea05daba4@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit fa694160cca6dbba17c57dc7efec5f93feaf8795 Author: Sandipan Das Date: Tue Aug 28 14:38:48 2018 +0530 perf probe powerpc: Ignore SyS symbols irrespective of endianness This makes sure that the SyS symbols are ignored for any powerpc system, not just the big endian ones. Reported-by: Naveen N. Rao Signed-off-by: Sandipan Das Reviewed-by: Kamalesh Babulal Acked-by: Naveen N. Rao Cc: Jiri Olsa Cc: Ravi Bangoria Fixes: fb6d59423115 ("perf probe ppc: Use the right prefix when ignoring SyS symbols on ppc") Link: http://lkml.kernel.org/r/20180828090848.1914-1-sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3d8f7615319b2bca87a4815e13787439e3339a93 Author: Amir Goldstein Date: Wed Aug 29 08:41:29 2018 +0300 vfs: implement readahead(2) using POSIX_FADV_WILLNEED The implementation of readahead(2) syscall is identical to that of fadvise64(POSIX_FADV_WILLNEED) with a few exceptions: 1. readahead(2) returns -EINVAL for !mapping->a_ops and fadvise64() ignores the request and returns 0. 2. fadvise64() checks for integer overflow corner case 3. fadvise64() calls the optional filesystem fadvise() file operation Unite the two implementations by calling vfs_fadvise() from readahead(2) syscall. Check the !mapping->a_ops in readahead(2) syscall to preserve documented syscall ABI behaviour. Suggested-by: Miklos Szeredi Fixes: d1d04ef8572b ("ovl: stack file ops") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit c9f23d2bc21cb263ae931f3e264d003d746107bb Author: Chris Phlipot Date: Wed Aug 29 19:19:50 2018 -0700 perf event-parse: Use fixed size string for comms Some implementations of libc do not support the 'm' width modifier as part of the scanf string format specifier. This can cause the parsing to fail. Since the parser never checks if the scanf parsing was successesful, this can result in a crash. Change the comm string to be allocated as a fixed size instead of dynamically using 'm' scanf width modifier. This can be safely done since comm size is limited to 16 bytes by TASK_COMM_LEN within the kernel. This change prevents perf from crashing when linked against bionic as well as reduces the total number of heap allocations and frees invoked while accomplishing the same task. Signed-off-by: Chris Phlipot Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180830021950.15563-1-cphlipot0@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit a72f64261359b7451f8478f2a2bf357b4e6c757f Author: Chris Phlipot Date: Tue Aug 28 23:19:54 2018 -0700 perf util: Fix bad memory access in trace info. In the write to the output_fd in the error condition of record_saved_cmdline(), we are writing 8 bytes from a memory location on the stack that contains a primitive that is only 4 bytes in size. Change the primitive to 8 bytes in size to match the size of the write in order to avoid reading unknown memory from the stack. Signed-off-by: Chris Phlipot Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180829061954.18871-1-cphlipot0@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit dad2762aac17eac01ea97779e78a061ed1b83b86 Author: Arnaldo Carvalho de Melo Date: Wed Aug 29 17:31:52 2018 -0300 perf tools: Streamline bpf examples and headers installation We were emitting 4 lines, two of them misleading: make: Entering directory '/home/acme/git/perf/tools/perf' INSTALL lib INSTALL include/bpf INSTALL lib INSTALL examples/bpf make: Leaving directory '/home/acme/git/perf/tools/perf' Make it more compact by showing just two lines: make: Entering directory '/home/acme/git/perf/tools/perf' INSTALL bpf-headers INSTALL bpf-examples make: Leaving directory '/home/acme/git/perf/tools/perf' Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-0nvkyciqdkrgy829lony5925@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit fd8d2702791a970c751f8b526a17d8e725a05b46 Author: Hisao Tanabe Date: Sat Aug 25 00:45:56 2018 +0900 perf evsel: Fix potential null pointer dereference in perf_evsel__new_idx() If evsel is NULL, we should return NULL to avoid a NULL pointer dereference a bit later in the code. Signed-off-by: Hisao Tanabe Acked-by: Namhyung Kim Cc: Jiri Olsa Cc: Wang Nan Fixes: 03e0a7df3efd ("perf tools: Introduce bpf-output event") LPU-Reference: 20180824154556.23428-1-xtanabe@gmail.com Link: https://lkml.kernel.org/n/tip-e5plzjhx6595a5yjaf22jss3@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5ab1de932e2923f490645ad017a689c5b58dc433 Author: Kim Phillips Date: Mon Aug 6 17:28:00 2018 -0500 perf arm64: Fix include path for asm-generic/unistd.h The new syscall table support for arm64 mistakenly used the system's asm-generic/unistd.h file when processing the tools/arch/arm64/include/uapi/asm/unistd.h file's include directive: #include See "Committer notes" section of commit 2b5882435606 "perf arm64: Generate system call table from asm/unistd.h" for more details. This patch removes the committer's temporary workaround, and instructs the host compiler to search the build tree's include path for the right copy of the unistd.h file, instead of the one on the system's /usr/include path. It thus fixes the committer's test that cross-builds an arm64 perf on an x86 platform running Ubuntu 14.04.5 LTS with an old toolchain: $ tools/perf/arch/arm64/entry/syscalls/mksyscalltbl /gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc gcc `pwd`/tools tools/arch/arm64/include/uapi/asm/unistd.h | grep bpf [280] = "bpf", Signed-off-by: Kim Phillips Cc: Alexander Shishkin Cc: Hendrik Brueckner Cc: Jiri Olsa Cc: Michael Ellerman Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Thomas Richter Fixes: 2b5882435606 ("perf arm64: Generate system call table from asm/unistd.h") Link: http://lkml.kernel.org/r/20180806172800.bbcec3cfcc51e2facc978bf2@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit bf06278c3fdf8909c3a9283e2c270b0fc170fa90 Author: Jiri Olsa Date: Mon Aug 27 11:12:28 2018 +0200 perf/hw_breakpoint: Simplify breakpoint enable in perf_event_modify_breakpoint We can safely enable the breakpoint back for both the fail and success paths by checking only the bp->attr.disabled, which either holds the new 'requested' disabled state or the original breakpoint state. Committer testing: At the end of the series, the 'perf test' entry introduced as the first patch now runs to completion without finding the fixed issues: # perf test "bp modify" 62: x86 bp modify : Ok # In verbose mode: # perf test -v "bp modify" 62: x86 bp modify : --- start --- test child forked, pid 5161 rip 5950a0, bp_1 0x5950a0 in bp_1 rip 5950a0, bp_1 0x5950a0 in bp_1 test child finished with 0 ---- end ---- x86 bp modify: Ok Suggested-by: Oleg Nesterov Acked-by: Oleg Nesterov Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Milind Chabbi Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180827091228.2878-6-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 969558371bf926258241727ebb994f516f2e6f61 Author: Jiri Olsa Date: Mon Aug 27 11:12:27 2018 +0200 perf/hw_breakpoint: Enable breakpoint in modify_user_hw_breakpoint Currently we enable the breakpoint back only if the breakpoint modification was successful. If it fails we can leave the breakpoint in disabled state with attr->disabled == 0. We can safely enable the breakpoint back for both the fail and success paths by checking the bp->attr.disabled, which either holds the new 'requested' disabled state or the original breakpoint state. Suggested-by: Oleg Nesterov Signed-off-by: Jiri Olsa Acked-by: Frederic Weisbecker Acked-by: Oleg Nesterov Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Milind Chabbi Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180827091228.2878-5-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit cb45302d7c5e20f0c0598cdbd7753fa44daceb2a Author: Jiri Olsa Date: Mon Aug 27 11:12:26 2018 +0200 perf/hw_breakpoint: Remove superfluous bp->attr.disabled = 0 Once the breakpoint was succesfully modified, the attr->disabled value is in bp->attr.disabled. So there's no reason to set it again, removing that. Signed-off-by: Jiri Olsa Acked-by: Frederic Weisbecker Acked-by: Oleg Nesterov Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Milind Chabbi Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180827091228.2878-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bd14406b78e6daa1ea3c1673bda1ffc9efdeead0 Author: Jiri Olsa Date: Mon Aug 27 11:12:25 2018 +0200 perf/hw_breakpoint: Modify breakpoint even if the new attr has disabled set We need to change the breakpoint even if the attr with new fields has disabled set to true. Current code prevents following user code to change the breakpoint address: ptrace(PTRACE_POKEUSER, child, offsetof(struct user, u_debugreg[0]), addr_1) ptrace(PTRACE_POKEUSER, child, offsetof(struct user, u_debugreg[0]), addr_2) ptrace(PTRACE_POKEUSER, child, offsetof(struct user, u_debugreg[7]), dr7) The first PTRACE_POKEUSER creates the breakpoint with attr.disabled set to true: ptrace_set_breakpoint_addr(nr = 0) struct perf_event *bp = t->ptrace_bps[nr]; ptrace_register_breakpoint(..., disabled = true) ptrace_fill_bp_fields(..., disabled) register_user_hw_breakpoint So the second PTRACE_POKEUSER will be omitted: ptrace_set_breakpoint_addr(nr = 0) struct perf_event *bp = t->ptrace_bps[nr]; struct perf_event_attr attr = bp->attr; modify_user_hw_breakpoint(bp, &attr) if (!attr->disabled) modify_user_hw_breakpoint_check Reported-by: Milind Chabbi Signed-off-by: Jiri Olsa Acked-by: Frederic Weisbecker Acked-by: Oleg Nesterov Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180827091228.2878-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9b3579fc6c6ac45502de1fa9a1fdf873805c2157 Author: Jiri Olsa Date: Mon Aug 27 11:12:24 2018 +0200 perf tests: Add breakpoint modify tests Adding to tests that aims on kernel breakpoint modification bugs. First test creates HW breakpoint, tries to change it and checks it was properly changed. It aims on kernel issue that prevents HW breakpoint to be changed via ptrace interface. The first test forks, the child sets itself as ptrace tracee and waits in signal for parent to trace it, then it calls bp_1 and quits. The parent does following steps: - creates a new breakpoint (id 0) for bp_2 function - changes that breakpoint to bp_1 function - waits for the breakpoint to hit and checks it has proper rip of bp_1 function This test aims on an issue in kernel preventing to change disabled breakpoints Second test mimics the first one except for few steps in the parent: - creates a new breakpoint (id 0) for bp_1 function - changes that breakpoint to bogus (-1) address - waits for the breakpoint to hit and checks it has proper rip of bp_1 function This test aims on an issue in kernel disabling enabled breakpoint after unsuccesful change. Committer testing: # uname -a Linux jouet 4.18.0-rc8-00002-g1236568ee3cb #12 SMP Tue Aug 7 14:08:26 -03 2018 x86_64 x86_64 x86_64 GNU/Linux # perf test -v "bp modify" 62: x86 bp modify : --- start --- test child forked, pid 25671 in bp_1 tracee exited prematurely 2 FAILED arch/x86/tests/bp-modify.c:209 modify test 1 failed test child finished with -1 ---- end ---- x86 bp modify: FAILED! # Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Milind Chabbi Cc: Namhyung Kim Cc: Oleg Nesterov Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180827091228.2878-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1dc27f63303db58ce1b1a6932d1825305f86d574 Author: Martin Liška Date: Thu Aug 23 14:29:34 2018 +0200 perf annotate: Properly interpret indirect call The patch changes the parsing of: callq *0x8(%rbx) from: 0.26 │ → callq *8 to: 0.26 │ → callq *0x8(%rbx) in this case an address is followed by a register, thus one can't parse only the address. Committer testing: 1) run 'perf record sleep 10' 2) before applying the patch, run: perf annotate --stdio2 > /tmp/before 3) after applying the patch, run: perf annotate --stdio2 > /tmp/after 4) diff /tmp/before /tmp/after: --- /tmp/before 2018-08-28 11:16:03.238384143 -0300 +++ /tmp/after 2018-08-28 11:15:39.335341042 -0300 @@ -13274,7 +13274,7 @@ ↓ jle 128 hash_value = hash_table->hash_func (key); mov 0x8(%rsp),%rdi - 0.91 → callq *30 + 0.91 → callq *0x30(%r12) mov $0x2,%r8d cmp $0x2,%eax node_hash = hash_table->hashes[node_index]; @@ -13848,7 +13848,7 @@ mov %r14,%rdi sub %rbx,%r13 mov %r13,%rdx - → callq *38 + → callq *0x38(%r15) cmp %rax,%r13 1.91 ↓ je 240 1b4: mov $0xffffffff,%r13d @@ -14026,7 +14026,7 @@ mov %rcx,-0x500(%rbp) mov %r15,%rsi mov %r14,%rdi - → callq *38 + → callq *0x38(%rax) mov -0x500(%rbp),%rcx cmp %rax,%rcx ↓ jne 9b0 Signed-off-by: Martin Liška Tested-by: Arnaldo Carvalho de Melo Tested-by: Kim Phillips Cc: Jiri Olsa Link: http://lkml.kernel.org/r/bd1f3932-be2b-85f9-7582-111ee0a43b07@suse.cz Signed-off-by: Arnaldo Carvalho de Melo commit 9f8f16c86e4d9e2afcbdcd6045981c4d9129450e Merge: 48f8e8e96fc2 336d139f8718 Author: Linus Torvalds Date: Thu Aug 30 10:05:12 2018 -0700 Merge tag 'mtd/for-4.19-rc2' of git://git.infradead.org/linux-mtd Pull mtd fixes from Boris Brezillon: "Raw NAND fixes: - denali: Fix a regression caused by the nand_scan() rework - docg4: Fix a build error when gcc decides to not iniline some functions (can be reproduced with gcc 4.1.2): * tag 'mtd/for-4.19-rc2' of git://git.infradead.org/linux-mtd: mtd: rawnand: denali: do not pass zero maxchips to nand_scan() mtd: rawnand: docg4: Remove wrong __init annotations commit 48f8e8e96fc2b2fc99b09460224d57fe0a7e93b1 Merge: 58c3f14f86c9 d2332f887ddf Author: Linus Torvalds Date: Thu Aug 30 09:50:15 2018 -0700 Merge tag 'mmc-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fix unsupported parallel dispatch of requests MMC host: - atmel-mci/android-goldfish: Fixup logic of sg_copy_{from,to}_buffer - renesas_sdhi_internal_dmac: Prevent IRQ-storm due of DMAC IRQs - renesas_sdhi_internal_dmac: Fixup bad register offset" * tag 'mmc-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS mmc: block: Fix unsupported parallel dispatch of requests mmc: android-goldfish: fix bad logic of sg_copy_{from,to}_buffer conversion mmc: atmel-mci: fix bad logic of sg_copy_{from,to}_buffer conversion commit c012a0f2677529a0ae8f53a15bd7c61dc4ca5b5e Author: Stefan Raspl Date: Fri Aug 24 14:04:01 2018 +0200 tools/kvm_stat: re-animate display of dead guests When filtering by guest (interactive commands 'p'/'g'), and the respective guest was destroyed, detect when the guest is up again through the guest name if possible. I.e. when displaying events for a specific guest, it is not necessary anymore to restart kvm_stat in case the guest is restarted. Signed-off-by: Stefan Raspl Signed-off-by: Radim Krčmář commit 404517e40867aef60554ef497d5cf8d089a5b9cf Author: Stefan Raspl Date: Fri Aug 24 14:04:00 2018 +0200 tools/kvm_stat: indicate dead guests as such For destroyed guests, kvm_stat essentially freezes with the last data displayed. This is acceptable for users, in case they want to inspect the final data. But it looks a bit irritating. Therefore, detect this situation and display a respective indicator in the header. Signed-off-by: Stefan Raspl Signed-off-by: Radim Krčmář commit 29c39f38e4e8dbf0497e81db6c985ee59259f002 Author: Stefan Raspl Date: Fri Aug 24 14:03:59 2018 +0200 tools/kvm_stat: handle guest removals more gracefully When running with the DebugFS provider, removal of a guest can result in a negative CurAvg/s, which looks rather confusing. If so, suppress the body refresh and print a message instead. To reproduce, have at least one guest A completely booted. Then start another guest B (which generates a huge amount of events), then destroy B. On the next refresh, kvm_stat should display a whole lot of negative values in the CurAvg/s column. Signed-off-by: Stefan Raspl Signed-off-by: Radim Krčmář commit 0db8b3102368755242b44f2b30f93302c70e8e82 Author: Stefan Raspl Date: Fri Aug 24 14:03:58 2018 +0200 tools/kvm_stat: don't reset stats when setting PID filter for debugfs When setting a PID filter in debugfs, we unnecessarily reset the statistics, although there is no reason to do so. This behavior was merely introduced with commit 9f114a03c6854f "tools/kvm_stat: add interactive command 'r'", most likely to mimic the behavior of the tracepoints provider in this respect. However, there are plenty of differences between the two providers, so there is no reason not to take advantage of the possibility to filter by PID without resetting the statistics. Signed-off-by: Stefan Raspl Signed-off-by: Radim Krčmář commit 710ab11ad9329d2d4b044405e328c994b19a2aa9 Author: Stefan Raspl Date: Fri Aug 24 14:03:57 2018 +0200 tools/kvm_stat: fix updates for dead guests With pid filtering active, when a guest is removed e.g. via virsh shutdown, successive updates produce garbage. Therefore, we add code to detect this case and prevent further body updates. Note that when displaying the help dialog via 'h' in this case, once we exit we're stuck with the 'Collecting data...' message till we remove the filter. Signed-off-by: Stefan Raspl Signed-off-by: Radim Krčmář commit 617c66b9f236d20f11cecbb3f45e6d5675b2fae1 Author: Stefan Raspl Date: Fri Aug 24 14:03:56 2018 +0200 tools/kvm_stat: fix handling of invalid paths in debugfs provider When filtering by guest, kvm_stat displays garbage when the guest is destroyed - see sample output below. We add code to remove the invalid paths from the providers, so at least no more garbage is displayed. Here's a sample output to illustrate: kvm statistics - pid 13986 (foo) Event Total %Total CurAvg/s diagnose_258 -2 0.0 0 deliver_program_interruption -3 0.0 0 diagnose_308 -4 0.0 0 halt_poll_invalid -91 0.0 -6 deliver_service_signal -244 0.0 -16 halt_successful_poll -250 0.1 -17 exit_pei -285 0.1 -19 exit_external_request -312 0.1 -21 diagnose_9c -328 0.1 -22 userspace_handled -713 0.1 -47 halt_attempted_poll -939 0.2 -62 deliver_emergency_signal -3126 0.6 -208 halt_wakeup -7199 1.5 -481 exit_wait_state -7379 1.5 -493 diagnose_500 -56499 11.5 -3757 exit_null -85491 17.4 -5685 diagnose_44 -133300 27.1 -8874 exit_instruction -195898 39.8 -13037 Total -492063 Signed-off-by: Stefan Raspl Signed-off-by: Radim Krčmář commit 58f33cfe73076b6497bada4f7b5bda961ed68083 Author: Stefan Raspl Date: Fri Aug 24 14:03:55 2018 +0200 tools/kvm_stat: fix python3 issues Python3 returns a float for a regular division - switch to a division operator that returns an integer. Furthermore, filters return a generator object instead of the actual list - wrap result in yet another list, which makes it still work in both, Python2 and 3. Signed-off-by: Stefan Raspl Signed-off-by: Radim Krčmář commit 45cd0faae3715e305bc46e23b34c5ed4d185ceb8 Author: Amir Goldstein Date: Mon Aug 27 15:56:02 2018 +0300 vfs: add the fadvise() file operation This is going to be used by overlayfs and possibly useful for other filesystems. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 17ef445f9befdc5c9adac270b18240ad24ee50ec Author: Amir Goldstein Date: Mon Aug 27 15:56:01 2018 +0300 Documentation/filesystems: update documentation of file_operations ...to kernel 4.18. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 5b910bd615ba947383e63cd1ed106ffa3060159e Author: Amir Goldstein Date: Mon Aug 27 15:56:00 2018 +0300 ovl: fix GPF in swapfile_activate of file from overlayfs over xfs Since overlayfs implements stacked file operations, the underlying filesystems are not supposed to be exposed to the overlayfs file, whose f_inode is an overlayfs inode. Assigning an overlayfs file to swap_file results in an attempt of xfs code to dereference an xfs_inode struct from an ovl_inode pointer: CPU: 0 PID: 2462 Comm: swapon Not tainted 4.18.0-xfstests-12721-g33e17876ea4e #3402 RIP: 0010:xfs_find_bdev_for_inode+0x23/0x2f Call Trace: xfs_iomap_swapfile_activate+0x1f/0x43 __se_sys_swapon+0xb1a/0xee9 Fix this by not assigning the real inode mapping to f_mapping, which will cause swapon() to return an error (-EINVAL). Although it makes sense not to allow setting swpafile on an overlayfs file, some users may depend on it, so we may need to fix this up in the future. Keeping f_mapping pointing to overlay inode mapping will cause O_DIRECT open to fail. Fix this by installing ovl_aops with noop_direct_IO in overlay inode mapping. Keeping f_mapping pointing to overlay inode mapping will cause other a_ops related operations to fail (e.g. readahead()). Those will be fixed by follow up patches. Suggested-by: Miklos Szeredi Fixes: f7c72396d0de ("ovl: add O_DIRECT support") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 80d34810815b1d708e3e59901a2afcdbd90c2a6f Author: Amir Goldstein Date: Mon Aug 27 15:55:59 2018 +0300 ovl: respect FIEMAP_FLAG_SYNC flag Stacked overlayfs fiemap operation broke xfstests that test delayed allocation (with "_test_generic_punch -d"), because ovl_fiemap() failed to write dirty pages when requested. Fixes: 9e142c4102db ("ovl: add ovl_fiemap()") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit c60658d1d983641fcdbb16f86bc2f3806d88bab4 Author: Sean Christopherson Date: Thu Aug 23 13:56:53 2018 -0700 KVM: x86: Unexport x86_emulate_instruction() Allowing x86_emulate_instruction() to be called directly has led to subtle bugs being introduced, e.g. not setting EMULTYPE_NO_REEXECUTE in the emulation type. While most of the blame lies on re-execute being opt-out, exporting x86_emulate_instruction() also exposes its cr2 parameter, which may have contributed to commit d391f1207067 ("x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested") using x86_emulate_instruction() instead of emulate_instruction() because "hey, I have a cr2!", which in turn introduced its EMULTYPE_NO_REEXECUTE bug. Signed-off-by: Sean Christopherson Signed-off-by: Radim Krčmář commit 0ce97a2b627c5e26347aee298f571ddf925e5fe4 Author: Sean Christopherson Date: Thu Aug 23 13:56:52 2018 -0700 KVM: x86: Rename emulate_instruction() to kvm_emulate_instruction() Lack of the kvm_ prefix gives the impression that it's a VMX or SVM specific function, and there's no conflict that prevents adding the kvm_ prefix. Signed-off-by: Sean Christopherson Signed-off-by: Radim Krčmář commit 6c3dfeb6a48b1562bd5b8ec5f3317ef34d0134ef Author: Sean Christopherson Date: Thu Aug 23 13:56:51 2018 -0700 KVM: x86: Do not re-{try,execute} after failed emulation in L2 Commit a6f177efaa58 ("KVM: Reenter guest after emulation failure if due to access to non-mmio address") added reexecute_instruction() to handle the scenario where two (or more) vCPUS race to write a shadowed page, i.e. reexecute_instruction() is intended to return true if and only if the instruction being emulated was accessing a shadowed page. As L0 is only explicitly shadowing L1 tables, an emulation failure of a nested VM instruction cannot be due to a race to write a shadowed page and so should never be re-executed. This fixes an issue where an "MMIO" emulation failure[1] in L2 is all but guaranteed to result in an infinite loop when TDP is enabled. Because "cr2" is actually an L2 GPA when TDP is enabled, calling kvm_mmu_gva_to_gpa_write() to translate cr2 in the non-direct mapped case (L2 is never direct mapped) will almost always yield UNMAPPED_GVA and cause reexecute_instruction() to immediately return true. The !mmio_info_in_cache() check in kvm_mmu_page_fault() doesn't catch this case because mmio_info_in_cache() returns false for a nested MMU (the MMIO caching currently handles L1 only, e.g. to cache nested guests' GPAs we'd have to manually flush the cache when switching between VMs and when L1 updated its page tables controlling the nested guest). Way back when, commit 68be0803456b ("KVM: x86: never re-execute instruction with enabled tdp") changed reexecute_instruction() to always return false when using TDP under the assumption that KVM would only get into the emulator for MMIO. Commit 95b3cf69bdf8 ("KVM: x86: let reexecute_instruction work for tdp") effectively reverted that behavior in order to handle the scenario where emulation failed due to an access from L1 to the shadow page tables for L2, but it didn't account for the case where emulation failed in L2 with TDP enabled. All of the above logic also applies to retry_instruction(), added by commit 1cb3f3ae5a38 ("KVM: x86: retry non-page-table writing instructions"). An indefinite loop in retry_instruction() should be impossible as it protects against retrying the same instruction over and over, but it's still correct to not retry an L2 instruction in the first place. Fix the immediate issue by adding a check for a nested guest when determining whether or not to allow retry in kvm_mmu_page_fault(). In addition to fixing the immediate bug, add WARN_ON_ONCE in the retry functions since they are not designed to handle nested cases, i.e. they need to be modified even if there is some scenario in the future where we want to allow retrying a nested guest. [1] This issue was encountered after commit 3a2936dedd20 ("kvm: mmu: Don't expose private memslots to L2") changed the page fault path to return KVM_PFN_NOSLOT when translating an L2 access to a prive memslot. Returning KVM_PFN_NOSLOT is semantically correct when we want to hide a memslot from L2, i.e. there effectively is no defined memory region for L2, but it has the unfortunate side effect of making KVM think the GFN is a MMIO page, thus triggering emulation. The failure occurred with in-development code that deliberately exposed a private memslot to L2, which L2 accessed with an instruction that is not emulated by KVM. Fixes: 95b3cf69bdf8 ("KVM: x86: let reexecute_instruction work for tdp") Fixes: 1cb3f3ae5a38 ("KVM: x86: retry non-page-table writing instructions") Signed-off-by: Sean Christopherson Cc: Jim Mattson Cc: Krish Sadhukhan Cc: Xiao Guangrong Cc: stable@vger.kernel.org Signed-off-by: Radim Krčmář commit 472faffacd9032164f611f56329d0025ddca55b5 Author: Sean Christopherson Date: Thu Aug 23 13:56:50 2018 -0700 KVM: x86: Default to not allowing emulation retry in kvm_mmu_page_fault Effectively force kvm_mmu_page_fault() to opt-in to allowing retry to make it more obvious when and why it allows emulation to be retried. Previously this approach was less convenient due to retry and re-execute behavior being controlled by separate flags that were also inverted in their implementations (opt-in versus opt-out). Suggested-by: Paolo Bonzini Signed-off-by: Sean Christopherson Cc: stable@vger.kernel.org Signed-off-by: Radim Krčmář commit 384bf2218e96f57118270945b1841e4dbbe9e352 Author: Sean Christopherson Date: Thu Aug 23 13:56:49 2018 -0700 KVM: x86: Merge EMULTYPE_RETRY and EMULTYPE_ALLOW_REEXECUTE retry_instruction() and reexecute_instruction() are a package deal, i.e. there is no scenario where one is allowed and the other is not. Merge their controlling emulation type flags to enforce this in code. Name the combined flag EMULTYPE_ALLOW_RETRY to make it abundantly clear that we are allowing re{try,execute} to occur, as opposed to explicitly requesting retry of a previously failed instruction. Signed-off-by: Sean Christopherson Cc: stable@vger.kernel.org Signed-off-by: Radim Krčmář commit 8065dbd1ee0ef04321d80da7999b4f0086e0a407 Author: Sean Christopherson Date: Thu Aug 23 13:56:48 2018 -0700 KVM: x86: Invert emulation re-execute behavior to make it opt-in Re-execution of an instruction after emulation decode failure is intended to be used only when emulating shadow page accesses. Invert the flag to make allowing re-execution opt-in since that behavior is by far in the minority. Signed-off-by: Sean Christopherson Cc: stable@vger.kernel.org Signed-off-by: Radim Krčmář commit 35be0aded76b54a24dc8aa678a71bca22273e8d8 Author: Sean Christopherson Date: Thu Aug 23 13:56:47 2018 -0700 KVM: x86: SVM: Set EMULTYPE_NO_REEXECUTE for RSM emulation Re-execution after an emulation decode failure is only intended to handle a case where two or vCPUs race to write a shadowed page, i.e. we should never re-execute an instruction as part of RSM emulation. Add a new helper, kvm_emulate_instruction_from_buffer(), to support emulating from a pre-defined buffer. This eliminates the last direct call to x86_emulate_instruction() outside of kvm_mmu_page_fault(), which means x86_emulate_instruction() can be unexported in a future patch. Fixes: 7607b7174405 ("KVM: SVM: install RSM intercept") Cc: Brijesh Singh Signed-off-by: Sean Christopherson Cc: stable@vger.kernel.org Signed-off-by: Radim Krčmář commit c4409905cd6eb42cfd06126e9226b0150e05a715 Author: Sean Christopherson Date: Thu Aug 23 13:56:46 2018 -0700 KVM: VMX: Do not allow reexecute_instruction() when skipping MMIO instr Re-execution after an emulation decode failure is only intended to handle a case where two or vCPUs race to write a shadowed page, i.e. we should never re-execute an instruction as part of MMIO emulation. As handle_ept_misconfig() is only used for MMIO emulation, it should pass EMULTYPE_NO_REEXECUTE when using the emulator to skip an instr in the fast-MMIO case where VM_EXIT_INSTRUCTION_LEN is invalid. And because the cr2 value passed to x86_emulate_instruction() is only destined for use when retrying or reexecuting, we can simply call emulate_instruction(). Fixes: d391f1207067 ("x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested") Cc: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Cc: stable@vger.kernel.org Signed-off-by: Radim Krčmář commit 0186ec823280f5db55ab2e6291933bebe2e92772 Author: Colin Ian King Date: Tue Aug 28 16:22:28 2018 +0100 KVM: SVM: remove unused variable dst_vaddr_end Variable dst_vaddr_end is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: variable 'dst_vaddr_end' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Radim Krčmář commit b871da4a7778eda2e700ae8bf5f86e74a004c1ec Author: Vitaly Kuznetsov Date: Thu Aug 23 18:24:24 2018 +0200 KVM: nVMX: avoid redundant double assignment of nested_run_pending nested_run_pending is set 20 lines above and check_vmentry_prereqs()/ check_vmentry_postreqs() don't seem to be resetting it (the later, however, checks it). Signed-off-by: Vitaly Kuznetsov Reviewed-by: Paolo Bonzini Reviewed-by: Jim Mattson Reviewed-by: Eduardo Valentin Reviewed-by: Krish Sadhukhan Signed-off-by: Radim Krčmář commit 16037643969e095509cd8446a3f8e406a6dc3a2c Author: Takashi Iwai Date: Thu Aug 30 15:13:16 2018 +0200 ALSA: hda - Fix cancel_work_sync() stall from jackpoll work On AMD/ATI controllers, the HD-audio controller driver allows a bus reset upon the error recovery, and its procedure includes the cancellation of pending jack polling work as found in snd_hda_bus_codec_reset(). This works usually fine, but it becomes a problem when the reset happens from the jack poll work itself; then calling cancel_work_sync() from the work being processed tries to wait the finish endlessly. As a workaround, this patch adds the check of current_work() and applies the cancel_work_sync() only when it's not from the jackpoll_work. This doesn't fix the root cause of the reported error below, but at least, it eases the unexpected stall of the whole system. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200937 Cc: Cc: Lukas Wunner Signed-off-by: Takashi Iwai commit 755a8bf5579d22eb5636685c516d8dede799e27b Author: Marc Zyngier Date: Fri Aug 24 15:08:30 2018 +0100 arm/arm64: smccc-1.1: Handle function result as parameters If someone has the silly idea to write something along those lines: extern u64 foo(void); void bar(struct arm_smccc_res *res) { arm_smccc_1_1_smc(0xbad, foo(), res); } they are in for a surprise, as this gets compiled as: 0000000000000588 : 588: a9be7bfd stp x29, x30, [sp, #-32]! 58c: 910003fd mov x29, sp 590: f9000bf3 str x19, [sp, #16] 594: aa0003f3 mov x19, x0 598: aa1e03e0 mov x0, x30 59c: 94000000 bl 0 <_mcount> 5a0: 94000000 bl 0 5a4: aa0003e1 mov x1, x0 5a8: d4000003 smc #0x0 5ac: b4000073 cbz x19, 5b8 5b0: a9000660 stp x0, x1, [x19] 5b4: a9010e62 stp x2, x3, [x19, #16] 5b8: f9400bf3 ldr x19, [sp, #16] 5bc: a8c27bfd ldp x29, x30, [sp], #32 5c0: d65f03c0 ret 5c4: d503201f nop The call to foo "overwrites" the x0 register for the return value, and we end up calling the wrong secure service. A solution is to evaluate all the parameters before assigning anything to specific registers, leading to the expected result: 0000000000000588 : 588: a9be7bfd stp x29, x30, [sp, #-32]! 58c: 910003fd mov x29, sp 590: f9000bf3 str x19, [sp, #16] 594: aa0003f3 mov x19, x0 598: aa1e03e0 mov x0, x30 59c: 94000000 bl 0 <_mcount> 5a0: 94000000 bl 0 5a4: aa0003e1 mov x1, x0 5a8: d28175a0 mov x0, #0xbad 5ac: d4000003 smc #0x0 5b0: b4000073 cbz x19, 5bc 5b4: a9000660 stp x0, x1, [x19] 5b8: a9010e62 stp x2, x3, [x19, #16] 5bc: f9400bf3 ldr x19, [sp, #16] 5c0: a8c27bfd ldp x29, x30, [sp], #32 5c4: d65f03c0 ret Reported-by: Julien Grall Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit c77a2fa3ff8f73d1a485e67e6f81c64823739d59 Author: Nilesh Javali Date: Wed Aug 29 23:55:53 2018 -0700 scsi: qedi: Add the CRC size within iSCSI NVM image The QED driver commit, 1ac4329a1cff ("qed: Add configuration information to register dump and debug data"), removes the CRC length validation causing nvm_get_image failure while loading qedi driver: [qed_mcp_get_nvm_image:2700(host_10-0)]Image [0] is too big - 00006008 bytes where only 00006004 are available [qedi_get_boot_info:2253]:10: Could not get NVM image. ret = -12 Hence add and adjust the CRC size to iSCSI NVM image to read boot info at qedi load time. Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 05a86e78ea9823ec25b3515db078dd8a76fc263c Author: Mike Christie Date: Mon Aug 27 14:45:16 2018 -0500 scsi: iscsi: target: Fix conn_ops double free If iscsi_login_init_conn fails it can free conn_ops. __iscsi_target_login_thread will then call iscsi_target_login_sess_out which will also free it. This fixes the problem by organizing conn allocation/setup into parts that are needed through the life of the conn and parts that are only needed for the login. The free functions then release what was allocated in the alloc functions. With this patch we have: iscsit_alloc_conn/iscsit_free_conn - allocs/frees the conn we need for the entire life of the conn. iscsi_login_init_conn/iscsi_target_nego_release - allocs/frees the parts of the conn that are only needed during login. Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 7915919bb94e12460c58e27c708472e6f85f6699 Author: Vincent Pelletier Date: Mon Aug 27 14:45:15 2018 -0500 scsi: iscsi: target: Set conn->sess to NULL when iscsi_login_set_conn_values fails Fixes a use-after-free reported by KASAN when later iscsi_target_login_sess_out gets called and it tries to access conn->sess->se_sess: Disabling lock debugging due to kernel taint iSCSI Login timeout on Network Portal [::]:3260 iSCSI Login negotiation failed. ================================================================== BUG: KASAN: use-after-free in iscsi_target_login_sess_out.cold.12+0x58/0xff [iscsi_target_mod] Read of size 8 at addr ffff880109d070c8 by task iscsi_np/980 CPU: 1 PID: 980 Comm: iscsi_np Tainted: G O 4.17.8kasan.sess.connops+ #4 Hardware name: To be filled by O.E.M. To be filled by O.E.M./Aptio CRB, BIOS 5.6.5 05/19/2014 Call Trace: dump_stack+0x71/0xac print_address_description+0x65/0x22e ? iscsi_target_login_sess_out.cold.12+0x58/0xff [iscsi_target_mod] kasan_report.cold.6+0x241/0x2fd iscsi_target_login_sess_out.cold.12+0x58/0xff [iscsi_target_mod] iscsi_target_login_thread+0x1086/0x1710 [iscsi_target_mod] ? __sched_text_start+0x8/0x8 ? iscsi_target_login_sess_out+0x250/0x250 [iscsi_target_mod] ? __kthread_parkme+0xcc/0x100 ? parse_args.cold.14+0xd3/0xd3 ? iscsi_target_login_sess_out+0x250/0x250 [iscsi_target_mod] kthread+0x1a0/0x1c0 ? kthread_bind+0x30/0x30 ret_from_fork+0x35/0x40 Allocated by task 980: kasan_kmalloc+0xbf/0xe0 kmem_cache_alloc_trace+0x112/0x210 iscsi_target_login_thread+0x816/0x1710 [iscsi_target_mod] kthread+0x1a0/0x1c0 ret_from_fork+0x35/0x40 Freed by task 980: __kasan_slab_free+0x125/0x170 kfree+0x90/0x1d0 iscsi_target_login_thread+0x1577/0x1710 [iscsi_target_mod] kthread+0x1a0/0x1c0 ret_from_fork+0x35/0x40 The buggy address belongs to the object at ffff880109d06f00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 456 bytes inside of 512-byte region [ffff880109d06f00, ffff880109d07100) The buggy address belongs to the page: page:ffffea0004274180 count:1 mapcount:0 mapping:0000000000000000 index:0x0 compound_mapcount: 0 flags: 0x17fffc000008100(slab|head) raw: 017fffc000008100 0000000000000000 0000000000000000 00000001000c000c raw: dead000000000100 dead000000000200 ffff88011b002e00 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff880109d06f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff880109d07000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff880109d07080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff880109d07100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff880109d07180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== Signed-off-by: Vincent Pelletier [rebased against idr/ida changes and to handle ret review comments from Matthew] Signed-off-by: Mike Christie Cc: Matthew Wilcox Reviewed-by: Matthew Wilcox Signed-off-by: Martin K. Petersen commit 26e609eccd37967d3681662433086894830c5d62 Author: Uros Bizjak Date: Tue Aug 14 18:59:51 2018 +0200 x86/asm: Use CC_SET()/CC_OUT() in __gen_sigismember() Replace open-coded set instructions with CC_SET()/CC_OUT(). Signed-off-by: Uros Bizjak Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180814165951.13538-1-ubizjak@gmail.com commit 9222f606506c5f8ca2c8b8c939d59ed3e6ac4148 Author: Jiri Kosina Date: Tue Aug 28 08:55:14 2018 +0200 x86/alternatives: Lockdep-enforce text_mutex in text_poke*() text_poke() and text_poke_bp() must be called with text_mutex held. Put proper lockdep anotation in place instead of just mentioning the requirement in a comment. Reported-by: Peter Zijlstra Signed-off-by: Jiri Kosina Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Masami Hiramatsu Cc: Andy Lutomirski Link: https://lkml.kernel.org/r/nycvar.YFH.7.76.1808280853520.25787@cbobk.fhfr.pm commit 113fc08357ad4e8b84caa75402430875d9ac4c1a Author: Masahiro Yamada Date: Mon Aug 27 12:39:43 2018 +0900 objtool: Remove workaround for unreachable warnings from old GCC Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") bumped the minimum GCC version to 4.6 for all architectures. This effectively reverts commit da541b20021c ("objtool: Skip unreachable warnings for GCC 4.4 and older"), which was a workaround for GCC 4.4 or older. Signed-off-by: Masahiro Yamada Signed-off-by: Thomas Gleixner Acked-by: Josh Poimboeuf Cc: Peter Zijlstra Cc: Michal Marek Cc: linux-kbuild@vger.kernel.org Link: https://lkml.kernel.org/r/1535341183-19994-1-git-send-email-yamada.masahiro@socionext.com commit 13ba17bee18e321b073b49a88dcab10881f757da Author: Mukesh Ojha Date: Fri Aug 24 18:03:53 2018 +0530 notifier: Remove notifier header file wherever not used The conversion of the hotplug notifiers to a state machine left the notifier.h includes around in some places. Remove them. Signed-off-by: Mukesh Ojha Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/1535114033-4605-1-git-send-email-mojha@codeaurora.org commit cb9d7fd51d9fbb329d182423bd7b92d0f8cb0e01 Author: Vincent Whitchurch Date: Tue Aug 21 17:25:07 2018 +0200 watchdog: Mark watchdog touch functions as notrace Some architectures need to use stop_machine() to patch functions for ftrace, and the assumption is that the stopped CPUs do not make function calls to traceable functions when they are in the stopped state. Commit ce4f06dcbb5d ("stop_machine: Touch_nmi_watchdog() after MULTI_STOP_PREPARE") added calls to the watchdog touch functions from the stopped CPUs and those functions lack notrace annotations. This leads to crashes when enabling/disabling ftrace on ARM kernels built with the Thumb-2 instruction set. Fix it by adding the necessary notrace annotations. Fixes: ce4f06dcbb5d ("stop_machine: Touch_nmi_watchdog() after MULTI_STOP_PREPARE") Signed-off-by: Vincent Whitchurch Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: oleg@redhat.com Cc: tj@kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180821152507.18313-1-vincent.whitchurch@axis.com commit f12d11c5c184626b4befdee3d573ec8237405a33 Author: Jann Horn Date: Tue Aug 28 20:40:33 2018 +0200 x86/entry/64: Wipe KASAN stack shadow before rewind_stack_do_exit() Reset the KASAN shadow state of the task stack before rewinding RSP. Without this, a kernel oops will leave parts of the stack poisoned, and code running under do_exit() can trip over such poisoned regions and cause nonsensical false-positive KASAN reports about stack-out-of-bounds bugs. This does not wipe the exception stacks; if an oops happens on an exception stack, it might result in random KASAN false-positives from other tasks afterwards. This is probably relatively uninteresting, since if the kernel oopses on an exception stack, there are most likely bigger things to worry about. It'd be more interesting if vmapped stacks and KASAN were compatible, since then handle_stack_overflow() would oops from exception stack context. Fixes: 2deb4be28077 ("x86/dumpstack: When OOPSing, rewind the stack before do_exit()") Signed-off-by: Jann Horn Signed-off-by: Thomas Gleixner Acked-by: Andrey Ryabinin Cc: Andy Lutomirski Cc: Dmitry Vyukov Cc: Alexander Potapenko Cc: Kees Cook Cc: kasan-dev@googlegroups.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180828184033.93712-1-jannh@google.com commit 1f59a4581b5ecfe9b4f049a7a2cf904d8352842d Author: Nick Desaulniers Date: Mon Aug 27 14:40:09 2018 -0700 x86/irqflags: Mark native_restore_fl extern inline This should have been marked extern inline in order to pick up the out of line definition in arch/x86/kernel/irqflags.S. Fixes: 208cbb325589 ("x86/irqflags: Provide a declaration for native_save_fl") Reported-by: Ben Hutchings Signed-off-by: Nick Desaulniers Signed-off-by: Thomas Gleixner Reviewed-by: Juergen Gross Cc: "H. Peter Anvin" Cc: Boris Ostrovsky Cc: Greg Kroah-Hartman Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180827214011.55428-1-ndesaulniers@google.com commit 36bf9da2913054c218337d8cd7cb11bddc1fafb0 Author: Masahiro Yamada Date: Mon Aug 27 14:45:14 2018 +0900 x86/build: Remove jump label quirk for GCC older than 4.5.2 Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") bumped the minimum GCC version to 4.6 for all architectures. Remove the workaround code. It was the only user of cc-if-fullversion. Remove the macro as well. Signed-off-by: Masahiro Yamada Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Michal Marek Cc: linux-kbuild@vger.kernel.org Link: https://lkml.kernel.org/r/1535348714-25457-1-git-send-email-yamada.masahiro@socionext.com commit aa58acf325b4aadeecae2bfc90658273b47dbace Author: Johannes Berg Date: Thu Aug 30 10:55:49 2018 +0200 mac80211: always account for A-MSDU header changes In the error path of changing the SKB headroom of the second A-MSDU subframe, we would not account for the already-changed length of the first frame that just got converted to be in A-MSDU format and thus is a bit longer now. Fix this by doing the necessary accounting. It would be possible to reorder the operations, but that would make the code more complex (to calculate the necessary pad), and the headroom expansion should not fail frequently enough to make that worthwhile. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Johannes Berg Acked-by: Lorenzo Bianconi Signed-off-by: Johannes Berg commit 43822c98f2ebb2cbd5e467ab72bbcdae7f0caa22 Author: Harry Mallon Date: Tue Aug 28 22:51:29 2018 +0100 HID: hid-saitek: Add device ID for RAT 7 Contagion Signed-off-by: Harry Mallon Signed-off-by: Jiri Kosina commit 1eb507903665442360a959136dfa3234c43db085 Author: Lorenzo Bianconi Date: Wed Aug 29 21:03:25 2018 +0200 mac80211: do not convert to A-MSDU if frag/subframe limited Do not start to aggregate packets in a A-MSDU frame (converting the first subframe to A-MSDU, adding the header) if max_tx_fragments or max_amsdu_subframes limits are already exceeded by it. In particular, this happens when drivers set the limit to 1 to avoid A-MSDUs at all. Signed-off-by: Lorenzo Bianconi [reword commit message to be more precise] Signed-off-by: Johannes Berg commit 4f0223bfe9c3e62d8f45a85f1ef1b18a8a263ef9 Author: Arunk Khandavalli Date: Thu Aug 30 00:40:16 2018 +0300 cfg80211: nl80211_update_ft_ies() to validate NL80211_ATTR_IE nl80211_update_ft_ies() tried to validate NL80211_ATTR_IE with is_valid_ie_attr() before dereferencing it, but that helper function returns true in case of NULL pointer (i.e., attribute not included). This can result to dereferencing a NULL pointer. Fix that by explicitly checking that NL80211_ATTR_IE is included. Fixes: 355199e02b83 ("cfg80211: Extend support for IEEE 802.11r Fast BSS Transition") Signed-off-by: Arunk Khandavalli Signed-off-by: Jouni Malinen Signed-off-by: Johannes Berg commit dc641794929713c30b5c375da0c664d7e00bfded Merge: c4053ef32208 25a8238f4cc8 Author: David S. Miller Date: Wed Aug 29 22:10:59 2018 -0700 Merge branch 'net_sched-reject-unknown-tcfa_action-values' Paolo Abeni says: ==================== net_sched: reject unknown tcfa_action values As agreed some time ago, this changeset reject unknown tcfa_action values, instead of changing such values under the hood. A tdc test is included to verify the new behavior. v1 -> v2: - helper is now static and renamed according to act_* convention - updated extack message, according to the new behavior ==================== Reviewed-by: Xin Long Signed-off-by: David S. Miller commit 25a8238f4cc8425d4aade4f9041be468d0e8aa2e Author: Paolo Abeni Date: Wed Aug 29 10:22:34 2018 +0200 tc-testing: add test-cases for numeric and invalid control action Only the police action allows us to specify an arbitrary numeric value for the control action. This change introduces an explicit test case for the above feature and then leverage it for testing the kernel behavior for invalid control actions (reject). Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 97763dc0f4010bc20e2969a6bf9a40a2551c4f79 Author: Paolo Abeni Date: Wed Aug 29 10:22:33 2018 +0200 net_sched: reject unknown tcfa_action values After the commit 802bfb19152c ("net/sched: user-space can't set unknown tcfa_action values"), unknown tcfa_action values are converted to TC_ACT_UNSPEC, but the common agreement is instead rejecting such configurations. This change also introduces a helper to simplify the destruction of a single action, avoiding code duplication. v1 -> v2: - helper is now static and renamed according to act_* convention - updated extack message, according to the new behavior Fixes: 802bfb19152c ("net/sched: user-space can't set unknown tcfa_action values") Signed-off-by: Paolo Abeni Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit c4053ef322081554765e1b708d6cdd8855e1d72d Author: Baruch Siach Date: Wed Aug 29 09:44:39 2018 +0300 net: mvpp2: initialize port of_node pointer Without a valid of_node in struct device we can't find the mvpp2 port device by its DT node. Specifically, this breaks of_find_net_device_by_node(). For example, the Armada 8040 based Clearfog GT-8K uses Marvell 88E6141 switch connected to the &cp1_eth2 port: &cp1_mdio { ... switch0: switch0@4 { compatible = "marvell,mv88e6085"; ... ports { ... port@5 { reg = <5>; label = "cpu"; ethernet = <&cp1_eth2>; }; }; }; }; Without this patch, dsa_register_switch() returns -EPROBE_DEFER because of_find_net_device_by_node() can't find the device_node of the &cp1_eth2 device. Reviewed-by: Andrew Lunn Signed-off-by: Baruch Siach Signed-off-by: David S. Miller commit b244ffa15c8b1aabdc117c0b6008086df7b668b7 Author: Zhenyu Wang Date: Thu Aug 30 10:50:36 2018 +0800 drm/i915/gvt: Fix drm_format_mod value for vGPU plane Physical plane's tiling mode value is given directly as drm_format_mod for plane query, which is not correct fourcc code. Fix it by using correct intel tiling fourcc mod definition. Current qemu seems also doesn't correctly utilize drm_format_mod for plane object setting. Anyway this is required to fix the usage. v3: use DRM_FORMAT_MOD_LINEAR, fix comment v2: Fix missed old 'tiled' use for stride calculation Fixes: e546e281d33d ("drm/i915/gvt: Dmabuf support for GVT-g") Cc: Tina Zhang Cc: Gerd Hoffmann Cc: Colin Xu Reviewed-by: Colin Xu Signed-off-by: Zhenyu Wang commit b2b599fb54f90ae395ddc51f0d49e4f28244a8f8 Author: Hang Yuan Date: Wed Aug 29 17:15:56 2018 +0800 drm/i915/gvt: move intel_runtime_pm_get out of spin_lock in stop_schedule pm_runtime_get_sync in intel_runtime_pm_get might sleep if i915 device is not active. When stop vgpu schedule, the device may be inactive. So need to move runtime_pm_get out of spin_lock/unlock. Fixes: b24881e0b0b6("drm/i915/gvt: Add runtime_pm_get/put into gvt_switch_mmio Cc: Signed-off-by: Hang Yuan Signed-off-by: Xiong Zhang Signed-off-by: Zhenyu Wang commit b9b824a55876275f8506c1c187558ab22d879f73 Author: Colin Xu Date: Fri Aug 17 16:42:24 2018 +0800 drm/i915/gvt: Handle GEN9_WM_CHICKEN3 with F_CMD_ACCESS. Recent patch introduce strict check on scanning cmd: Commit 8d458ea0ec33 ("drm/i915/gvt: return error on cmd access") Before 8d458ea0ec33, if cmd_reg_handler() checks that a cmd access a mmio that not marked as F_CMD_ACCESS, it simply returns 0 and log an error. Now it will return -EBADRQC which will cause the workload fail to submit. On BXT, i915 applies WaClearHIZ_WM_CHICKEN3 which will program GEN9_WM_CHICKEN3 by LRI when init wa ctx. If it has no F_CMD_ACCESS flag, vgpu will fail to start. Also add F_MODE_MASK since it's mode mask reg. v2: Refresh commit message to elaborate issue symptom in detail. v3: Make SKL_PLUS share same handling since GEN9_WM_CHICKEN3 should be F_CMD_ACCESS from HW aspect. (yan, zhenyu) Signed-off-by: Colin Xu Acked-by: Zhao Yan Signed-off-by: Zhenyu Wang commit c8ab5ac30ccc20a31672ab0f8938a6271dfe4122 Author: Colin Xu Date: Mon Aug 20 16:46:34 2018 +0800 drm/i915/gvt: Make correct handling to vreg BXT_PHY_CTL_FAMILY Guest kernel will write to BXT_PHY_CTL_FAMILY to reset DDI PHY and pull BXT_PHY_CTL to check PHY status. Previous handling will set/reset BXT_PHY_CTL of all PHYs at same time on receiving vreg write to some BXT_PHY_CTL_FAMILY. If some BXT_PHY_CTL is already enabled, following reset to another BXT_PHY_CTL_FAMILY will clear the enabled BXT_PHY_CTL, which result in guest kernel print: ----------------------------------- [drm:intel_ddi_get_hw_state [i915]] *ERROR* Port B enabled but PHY powered down? (PHY_CTL 00000000) ----------------------------------- The correct handling should operate BXT_PHY_CTL_FAMILY and BXT_PHY_CTL on the same DDI. v2: Use correct reg define. The naming looks confusing, however current i915_reg.h bind DPIO_PHY0 to _PHY_CTL_FAMILY_DDI and bind DPIO_PHY1 to _PHY_CTL_FAMILY_EDP, pairing to _BXT_PHY_CTL_DDI_A and _BXT_PHY_CTL_DDI_B respectively. v3: v2 incorrectly map _PHY_CTL_FAMILY_EDP to _BXT_PHY_CTL_DDI_A. BXT_PHY_CTL() looks up DDI using PORTx but not PHYx. Based on DPIO_PHY to DDI mapping, make correct vreg handle to BXT_PHY_CTL on receiving vreg write to BXT_PHY_CTL_FAMILY. (He, Min) Current mapping according to bxt_power_wells: dpio-common-a: >>> DPIO_PHY1 >>> BXT_DPIO_CMN_A_POWER_DOMAINS >>> POWER_DOMAIN_PORT_DDI_A_LANES >>> PORT_A dpio-common-bc: >>> DPIO_PHY0 >>> BXT_DPIO_CMN_BC_POWER_DOMAINS >>> POWER_DOMAIN_PORT_DDI_B_LANES | POWER_DOMAIN_PORT_DDI_C_LANES >>> PORT_B or PORT_C Signed-off-by: Colin Xu Reviewed-by: He, Min Signed-off-by: Zhenyu Wang commit 9174c1d6196d612799808009ec2796df021ab625 Author: Xiaolin Zhang Date: Tue Aug 7 20:39:16 2018 +0800 drm/i915/gvt: emulate gen9 dbuf ctl register access there is below call track at boot time when booting guest with kabylake vgpu with specifal configuration and this try to fix it. [drm:gen9_dbuf_enable [i915]] *ERROR* DBuf power enable timeout ------------[ cut here ]------------ WARNING: gen9_dc_off_power_well_enable+0x224/0x230 [i915] Unexpected DBuf power power state (0x8000000a) Hardware name: Red Hat KVM, BIOS 1.11.0-2.el7 04/01/2014 Call Trace: [] dump_stack+0x19/0x1b [] __warn+0xd8/0x100 [] warn_slowpath_fmt+0x5f/0x80 [] gen9_dc_off_power_well_enable+0x224/0x230 [i915] [] intel_power_well_enable+0x42/0x50 [i915] [] __intel_display_power_get_domain+0x8a/0xb0 [i915] [] intel_display_power_get+0x33/0x50 [i915] [] intel_display_set_init_power+0x45/0x50 [i915] [] intel_power_domains_init_hw+0x63/0x8a0 [i915] [] i915_driver_load+0xae3/0x1760 [i915] [] ? nvmem_register+0x500/0x500 [] i915_pci_probe+0x2c/0x50 [i915] [] local_pci_probe+0x4a/0xb0 [] pci_device_probe+0x109/0x160 [] driver_probe_device+0xc5/0x3e0 [] __driver_attach+0x93/0xa0 [] ? __device_attach+0x50/0x50 [] bus_for_each_dev+0x75/0xc0 [] driver_attach+0x1e/0x20 [] bus_add_driver+0x200/0x2d0 [] driver_register+0x64/0xf0 [] __pci_register_driver+0xa5/0xc0 [] ? 0xffffffffc0928fff [] i915_init+0x59/0x5c [i915] [] do_one_initcall+0xba/0x240 [] load_module+0x272c/0x2bc0 [] ? ddebug_proc_write+0xf0/0xf0 [] SyS_init_module+0xc5/0x110 [] system_call_fastpath+0x1c/0x21 Signed-off-by: Xiaolin Zhang Signed-off-by: Zhenyu Wang commit c3c397c1f16c51601a3fac4fe0c63ad8aa85a904 Author: Doug Berger Date: Tue Aug 28 12:33:15 2018 -0700 net: bcmgenet: use MAC link status for fixed phy When using the fixed PHY with GENET (e.g. MOCA) the PHY link status can be determined from the internal link status captured by the MAC. This allows the PHY state machine to use the correct link state with the fixed PHY even if MAC link event interrupts are missed when the net device is opened. Fixes: 8d88c6ebb34c ("net: bcmgenet: enable MoCA link state change detection") Signed-off-by: Doug Berger Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit c305660b325463cdf3d944492f96155dc931b448 Author: Dinh Nguyen Date: Tue Aug 28 10:19:20 2018 -0500 net: stmmac: build the dwmac-socfpga platform driver for Stratix10 The Stratix10 SoC is an AARCH64 based platform that shares the same ethernet controller that is on other SoCFPGA platforms. Build the platform driver. Signed-off-by: Dinh Nguyen Signed-off-by: David S. Miller commit e0b7e7dc690183c79f772844cdc03a144d72a3e0 Merge: 85eb9af18224 f707ef61e172 Author: David S. Miller Date: Wed Aug 29 19:28:55 2018 -0700 Merge branch 'ipv6-fix-error-path-of-inet6_init' Sabrina Dubroca says: ==================== ipv6: fix error path of inet6_init() The error path of inet6_init() can trigger multiple kernel panics, mostly due to wrong ordering of cleanups. This series fixes those issues. ==================== Reviewed-by: Xin Long Signed-off-by: David S. Miller commit f707ef61e17261f2bb18c3e4871c6f135ab3aba9 Author: Sabrina Dubroca Date: Tue Aug 28 13:40:53 2018 +0200 net: rtnl: return early from rtnl_unregister_all when protocol isn't registered rtnl_unregister_all(PF_INET6) gets called from inet6_init in cases when no handler has been registered for PF_INET6 yet, for example if ip6_mr_init() fails. Abort and avoid a NULL pointer deref in that case. Example of panic (triggered by faking a failure of register_pernet_subsys): general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI [...] RIP: 0010:rtnl_unregister_all+0x17e/0x2a0 [...] Call Trace: ? rtnetlink_net_init+0x250/0x250 ? sock_unregister+0x103/0x160 ? kernel_getsockopt+0x200/0x200 inet6_init+0x197/0x20d Fixes: e2fddf5e96df ("[IPV6]: Make af_inet6 to check ip6_route_init return value.") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit a03dc36bdca6b614651fedfcd8559cf914d2d21d Author: Sabrina Dubroca Date: Tue Aug 28 13:40:52 2018 +0200 ipv6: fix cleanup ordering for pingv6 registration Commit 6d0bfe226116 ("net: ipv6: Add IPv6 support to the ping socket.") contains an error in the cleanup path of inet6_init(): when proto_register(&pingv6_prot, 1) fails, we try to unregister &pingv6_prot. When rawv6_init() fails, we skip unregistering &pingv6_prot. Example of panic (triggered by faking a failure of proto_register(&pingv6_prot, 1)): general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI [...] RIP: 0010:__list_del_entry_valid+0x79/0x160 [...] Call Trace: proto_unregister+0xbb/0x550 ? trace_preempt_on+0x6f0/0x6f0 ? sock_no_shutdown+0x10/0x10 inet6_init+0x153/0x1b8 Fixes: 6d0bfe226116 ("net: ipv6: Add IPv6 support to the ping socket.") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit afe49de44c27a89e8e9631c44b5ffadf6ace65e2 Author: Sabrina Dubroca Date: Tue Aug 28 13:40:51 2018 +0200 ipv6: fix cleanup ordering for ip6_mr failure Commit 15e668070a64 ("ipv6: reorder icmpv6_init() and ip6_mr_init()") moved the cleanup label for ipmr_fail, but should have changed the contents of the cleanup labels as well. Now we can end up cleaning up icmpv6 even though it hasn't been initialized (jump to icmp_fail or ipmr_fail). Simply undo things in the reverse order of their initialization. Example of panic (triggered by faking a failure of icmpv6_init): kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI [...] RIP: 0010:__list_del_entry_valid+0x79/0x160 [...] Call Trace: ? lock_release+0x8a0/0x8a0 unregister_pernet_operations+0xd4/0x560 ? ops_free_list+0x480/0x480 ? down_write+0x91/0x130 ? unregister_pernet_subsys+0x15/0x30 ? down_read+0x1b0/0x1b0 ? up_read+0x110/0x110 ? kmem_cache_create_usercopy+0x1b4/0x240 unregister_pernet_subsys+0x1d/0x30 icmpv6_cleanup+0x1d/0x30 inet6_init+0x1b5/0x23f Fixes: 15e668070a64 ("ipv6: reorder icmpv6_init() and ip6_mr_init()") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 58c3f14f86c98e4030b03e6ab929fa3190565d4f Merge: ff69279a44e9 47d80a68f10d Author: Linus Torvalds Date: Wed Aug 29 18:41:48 2018 -0700 Merge tag 'riscv-for-linus-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux Pull RISC-V fixes from Palmer Dabbelt: "RISC-V Fixes and Cleanups for 4.19-rc2 This contains a handful of patches that filtered their way in during the merge window but just didn't make the deadline. It includes: - Additional documentation in the riscv,cpu-intc device tree binding that resulted from some feedback I missed in the original patch set. - A build fix that provides the definition of tlb_flush() before including tlb.h, which fixes a RISC-V build regression introduced during this merge window. - A cosmetic cleanup to sys_riscv_flush_icache()" * tag 'riscv-for-linus-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: RISC-V: Use a less ugly workaround for unused variable warnings riscv: tlb: Provide definition of tlb_flush() before including tlb.h dt-bindings: riscv,cpu-intc: Cleanups from a missed review commit 49a51c4b4064c8a89ffd166434696138edef6b85 Merge: 185c3cfacafd 80ab316901bc Author: Dave Airlie Date: Thu Aug 30 11:34:55 2018 +1000 Merge tag 'drm-intel-fixes-2018-08-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - fix for GLK and CNL watermark workaround - fix for display affecting NUCs with LSPCON - freeing an allocated write_buf on hdcp - audio hook when display is disabled - vma stop holding ppgtt reference Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180829234512.GA32468@intel.com commit 185c3cfacafded57663dedd50bdab53fff0d8bc3 Merge: 852fde0a34ce 6ddd9769db4f Author: Dave Airlie Date: Thu Aug 30 11:30:02 2018 +1000 Merge branch 'drm-fixes-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes Fixes for 4.19: - SR-IOV fixes - Kasan and page fault fix on device removal - S3 stability fix for CZ/ST - VCE regression fixes for CIK parts - Avoid holding the mn_lock when allocating memory - DC memory leak fix - BO eviction fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180829202555.2653-1-alexander.deucher@amd.com commit 852fde0a34ce28da818d8538f42d0b9ea5331875 Merge: 5b394b2ddf03 08bcbed747eb Author: Dave Airlie Date: Thu Aug 30 10:25:47 2018 +1000 Merge branch 'mediatek-drm-fixes-4.19' of https://github.com/ckhu-mediatek/linux.git-tags into drm-fixes "Here are some fixes for mediatek drm driver." Mostly fixes around the RDMA and Overlay Signed-off-by: Dave Airlie From: CK Hu Link: https://patchwork.freedesktop.org/patch/msgid/1535346194.27648.5.camel@mtksdaap41 commit 85eb9af182243ce9a8b72410d5321c440ac5f8d7 Author: Davide Caratti Date: Mon Aug 27 22:56:22 2018 +0200 net/sched: act_pedit: fix dump of extended layered op in the (rare) case of failure in nla_nest_start(), missing NULL checks in tcf_pedit_key_ex_dump() can make the following command # tc action add action pedit ex munge ip ttl set 64 dereference a NULL pointer: BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 800000007d1cd067 P4D 800000007d1cd067 PUD 7acd3067 PMD 0 Oops: 0002 [#1] SMP PTI CPU: 0 PID: 3336 Comm: tc Tainted: G E 4.18.0.pedit+ #425 Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 RIP: 0010:tcf_pedit_dump+0x19d/0x358 [act_pedit] Code: be 02 00 00 00 48 89 df 66 89 44 24 20 e8 9b b1 fd e0 85 c0 75 46 8b 83 c8 00 00 00 49 83 c5 08 48 03 83 d0 00 00 00 4d 39 f5 <66> 89 04 25 00 00 00 00 0f 84 81 01 00 00 41 8b 45 00 48 8d 4c 24 RSP: 0018:ffffb5d4004478a8 EFLAGS: 00010246 RAX: ffff8880fcda2070 RBX: ffff8880fadd2900 RCX: 0000000000000000 RDX: 0000000000000002 RSI: ffffb5d4004478ca RDI: ffff8880fcda206e RBP: ffff8880fb9cb900 R08: 0000000000000008 R09: ffff8880fcda206e R10: ffff8880fadd2900 R11: 0000000000000000 R12: ffff8880fd26cf40 R13: ffff8880fc957430 R14: ffff8880fc957430 R15: ffff8880fb9cb988 FS: 00007f75a537a740(0000) GS:ffff8880fda00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000007a2fa005 CR4: 00000000001606f0 Call Trace: ? __nla_reserve+0x38/0x50 tcf_action_dump_1+0xd2/0x130 tcf_action_dump+0x6a/0xf0 tca_get_fill.constprop.31+0xa3/0x120 tcf_action_add+0xd1/0x170 tc_ctl_action+0x137/0x150 rtnetlink_rcv_msg+0x263/0x2d0 ? _cond_resched+0x15/0x40 ? rtnl_calcit.isra.30+0x110/0x110 netlink_rcv_skb+0x4d/0x130 netlink_unicast+0x1a3/0x250 netlink_sendmsg+0x2ae/0x3a0 sock_sendmsg+0x36/0x40 ___sys_sendmsg+0x26f/0x2d0 ? do_wp_page+0x8e/0x5f0 ? handle_pte_fault+0x6c3/0xf50 ? __handle_mm_fault+0x38e/0x520 ? __sys_sendmsg+0x5e/0xa0 __sys_sendmsg+0x5e/0xa0 do_syscall_64+0x5b/0x180 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f75a4583ba0 Code: c3 48 8b 05 f2 62 2c 00 f7 db 64 89 18 48 83 cb ff eb dd 0f 1f 80 00 00 00 00 83 3d fd c3 2c 00 00 75 10 b8 2e 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ae cc 00 00 48 89 04 24 RSP: 002b:00007fff60ee7418 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fff60ee7540 RCX: 00007f75a4583ba0 RDX: 0000000000000000 RSI: 00007fff60ee7490 RDI: 0000000000000003 RBP: 000000005b842d3e R08: 0000000000000002 R09: 0000000000000000 R10: 00007fff60ee6ea0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff60ee7554 R14: 0000000000000001 R15: 000000000066c100 Modules linked in: act_pedit(E) ip6table_filter ip6_tables iptable_filter binfmt_misc crct10dif_pclmul ext4 crc32_pclmul mbcache ghash_clmulni_intel jbd2 pcbc snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm aesni_intel crypto_simd snd_timer cryptd glue_helper snd joydev pcspkr soundcore virtio_balloon i2c_piix4 nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c ata_generic pata_acpi virtio_net net_failover virtio_blk virtio_console failover qxl crc32c_intel drm_kms_helper syscopyarea serio_raw sysfillrect sysimgblt fb_sys_fops ttm drm ata_piix virtio_pci libata virtio_ring i2c_core virtio floppy dm_mirror dm_region_hash dm_log dm_mod [last unloaded: act_pedit] CR2: 0000000000000000 Like it's done for other TC actions, give up dumping pedit rules and return an error if nla_nest_start() returns NULL. Fixes: 71d0ed7079df ("net/act_pedit: Support using offset relative to the conventional network headers") Signed-off-by: Davide Caratti Acked-by: Cong Wang Signed-off-by: David S. Miller commit 6e0bb04d0e4f597d8d8f4f21401a9636f2809fd1 Author: Chris Brandt Date: Mon Aug 27 12:42:02 2018 -0500 sh_eth: Add R7S9210 support Add support for the R7S9210 which is part of the RZ/A2 series. Signed-off-by: Chris Brandt Acked-by: Rob Herring Signed-off-by: David S. Miller commit def70b61afbc28f5df07841e0f770abde1b401ed Merge: 05212ba8132b 455c4401fe7a Author: David S. Miller Date: Wed Aug 29 18:08:20 2018 -0700 Merge branch 'hns-fixes' Peng Li says: ==================== net: hns: fix some bugs about speed and duplex change If there are packets in hardware when changing the spped or duplex, it may cause hardware hang up. This patchset adds the code for waiting chip to clean the all pkts(TX & RX) in chip when the driver uses the function named "adjust link". This patchset cleans the pkts as follows: 1) close rx of chip, close tx of protocol stack. 2) wait rcb, ppe, mac to clean. 3) adjust link 4) open rx of chip, open tx of protocol stack. ==================== Signed-off-by: David S. Miller commit 455c4401fe7a538facaffb35b906ce19f1ece474 Author: Peng Li Date: Mon Aug 27 09:59:30 2018 +0800 net: hns: add netif_carrier_off before change speed and duplex If there are packets in hardware when changing the speed or duplex, it may cause hardware hang up. This patch adds netif_carrier_off before change speed and duplex in ethtool_ops.set_link_ksettings, and adds netif_carrier_on after complete the change. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 31fabbee8f5c658c3fa1603c66e9e4f51ea8c2c6 Author: Peng Li Date: Mon Aug 27 09:59:29 2018 +0800 net: hns: add the code for cleaning pkt in chip If there are packets in hardware when changing the speed or duplex, it may cause hardware hang up. This patch adds the code for waiting chip to clean the all pkts(TX & RX) in chip when the driver uses the function named "adjust link". This patch cleans the pkts as follows: 1) close rx of chip, close tx of protocol stack. 2) wait rcb, ppe, mac to clean. 3) adjust link 4) open rx of chip, open tx of protocol stack. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 05212ba8132b42047ab5d63d759c6f9c28e7eab5 Author: Azat Khuzhin Date: Sun Aug 26 17:03:09 2018 +0300 r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices I have two Ethernet adapters: r8169 0000:03:01.0 eth0: RTL8169sb/8110sb, 00:14:d1:14:2d:49, XID 10000000, IRQ 18 r8169 0000:01:00.0 eth0: RTL8168e/8111e, 64:66:b3:11:14:5d, XID 2c200000, IRQ 30 And after upgrading from linux 4.15 [1] to linux 4.18+ [2] RTL8169sb failed to receive any packets. tcpdump shows a lot of checksum mismatch. [1]: a0f79386a4968b4925da6db2d1daffd0605a4402 [2]: 0519359784328bfa92bf0931bf0cff3b58c16932 (4.19 merge window opened) I started bisecting and the found that [3] breaks it. According to [4]: "For 8110S, 8110SB, and 8110SC series, the initial value of RxConfig needs to be set after the tx/rx is enabled." So I moved rtl_init_rxcfg() after enabling tx/rs and now my adapter works (RTL8168e works too). [3]: 3559d81e76bfe3803e89f2e04cf6ef7ab4f3aace [4]: e542a2269f232d61270ceddd42b73a4348dee2bb ("r8169: adjust the RxConfig settings.") Also drop "rx" from rtl_set_rx_tx_config_registers(), since it does nothing with it already. Fixes: 3559d81e76bfe3803e89f2e04cf6ef7ab4f3aace ("r8169: simplify rtl_hw_start_8169") Cc: Heiner Kallweit Cc: David S. Miller Cc: netdev@vger.kernel.org Cc: Realtek linux nic maintainers Signed-off-by: Azat Khuzhin Signed-off-by: David S. Miller commit 9a07efa9aea2f4a59f35da0785a4e6a6b5a96192 Author: Cong Wang Date: Fri Aug 24 12:28:06 2018 -0700 tipc: switch to rhashtable iterator syzbot reported a use-after-free in tipc_group_fill_sock_diag(), where tipc_group_fill_sock_diag() still reads tsk->group meanwhile tipc_group_delete() just deletes it in tipc_release(). tipc_nl_sk_walk() aims to lock this sock when walking each sock in the hash table to close race conditions with sock changes like this one, by acquiring tsk->sk.sk_lock.slock spinlock, unfortunately this doesn't work at all. All non-BH call path should take lock_sock() instead to make it work. tipc_nl_sk_walk() brutally iterates with raw rht_for_each_entry_rcu() where RCU read lock is required, this is the reason why lock_sock() can't be taken on this path. This could be resolved by switching to rhashtable iterator API's, where taking a sleepable lock is possible. Also, the iterator API's are friendly for restartable calls like diag dump, the last position is remembered behind the scence, all we need to do here is saving the iterator into cb->args[]. I tested this with parallel tipc diag dump and thousands of tipc socket creation and release, no crash or memory leak. Reported-by: syzbot+b9c8f3ab2994b7cd1625@syzkaller.appspotmail.com Cc: Jon Maloy Cc: Ying Xue Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit e5133f2f1261f8ab412e7fc5e3694c9f84328f89 Author: Jerome Brunet Date: Fri Aug 24 11:04:40 2018 +0200 Revert "net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit" This reverts commit 4ae0169fd1b3c792b66be58995b7e6b629919ecf. This change in the handling of the coalesce timer is causing regression on (at least) amlogic platforms. Network will break down very quickly (a few seconds) after starting a download. This can easily be reproduced using iperf3 for example. The problem has been reported on the S805, S905, S912 and A113 SoCs (Realtek and Micrel PHYs) and it is likely impacting all Amlogics platforms using Gbit ethernet No problem was seen with the platform using 10/100 only PHYs (GXL internal) Reverting change brings things back to normal and allows to use network again until we better understand the problem with the coalesce timer. Cc: Jose Abreu Cc: Joao Pinto Cc: Vitor Soares Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Corentin Labbe Signed-off-by: Jerome Brunet Signed-off-by: David S. Miller commit bd583fe30427500a2d0abe25724025b1cb5e2636 Author: Cong Wang Date: Thu Aug 23 16:19:44 2018 -0700 tipc: fix a missing rhashtable_walk_exit() rhashtable_walk_exit() must be paired with rhashtable_walk_enter(). Fixes: 40f9f4397060 ("tipc: Fix tipc_sk_reinit race conditions") Cc: Herbert Xu Cc: Ying Xue Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 9f2895461439fda2801a7906fb4c5fb3dbb37a0a Author: Alexey Kodanev Date: Thu Aug 23 19:49:54 2018 +0300 vti6: remove !skb->ignore_df check from vti6_xmit() Before the commit d6990976af7c ("vti6: fix PMTU caching and reporting on xmit") '!skb->ignore_df' check was always true because the function skb_scrub_packet() was called before it, resetting ignore_df to zero. In the commit, skb_scrub_packet() was moved below, and now this check can be false for the packet, e.g. when sending it in the two fragments, this prevents successful PMTU updates in such case. The next attempts to send the packet lead to the same tx error. Moreover, vti6 initial MTU value relies on PMTU adjustments. This issue can be reproduced with the following LTP test script: udp_ipsec_vti.sh -6 -p ah -m tunnel -s 2000 Fixes: ccd740cbc6e0 ("vti6: Add pmtu handling to vti6_xmit.") Signed-off-by: Alexey Kodanev Acked-by: Steffen Klassert Signed-off-by: David S. Miller commit 6a5d39aa9ac274d9ccdb50ec47112158537f00de Merge: 53ae914d898e d65e6c80c6bb Author: David S. Miller Date: Wed Aug 29 16:19:38 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2018-08-29 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix a build error in sk_reuseport_convert_ctx_access() when compiling with clang which cannot resolve hweight_long() at build time inside the BUILD_BUG_ON() assertion, from Stefan. 2) Several fixes for BPF sockmap, four of them in getting the bpf_msg_pull_data() helper to work, one use after free case in bpf_tcp_close() and one refcount leak in bpf_tcp_recvmsg(), from Daniel. 3) Another fix for BPF sockmap where we misaccount sk_mem_uncharge() in the socket redirect error case from unwinding scatterlist twice, from John. ==================== Signed-off-by: David S. Miller commit ff69279a44e9ba876466b7d3ab84d6dbd31cac92 Author: Ard Biesheuvel Date: Wed Aug 29 08:47:53 2018 +0200 powerpc: disable support for relative ksymtab references The newly added code that emits ksymtab entries as pairs of 32-bit relative references interacts poorly with the way powerpc lays out its address space: when a module exports a per-CPU variable, the primary module region covering the ksymtab entry -and thus the 32-bit relative reference- is too far away from the actual per-CPU variable's base address (to which the per-CPU offsets are applied to obtain the respective address of each CPU's copy), resulting in corruption when the module loader attempts to resolve symbol references of modules that are loaded on top and link to the exported per-CPU symbol. So let's disable this feature on powerpc. Even though it implements CONFIG_RELOCATABLE, it does not implement CONFIG_RANDOMIZE_BASE and so KASLR kernels (which are the main target of the feature) do not exist on powerpc anyway. Reported-by: Andreas Schwab Suggested-by: Nicholas Piggin Signed-off-by: Ard Biesheuvel Signed-off-by: Linus Torvalds commit af3a5fe4ddfe3d426eb025d4c3afd176efea658e Merge: f3f106dac045 d49dbfade96d Author: Linus Torvalds Date: Wed Aug 29 16:03:45 2018 -0700 Merge tag 'hwmon-for-linus-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Fix potential Spectre v1 in nct6775 - Add error checking to adt7475 driver - Fix reading shunt resistor value in ina2xx driver * tag 'hwmon-for-linus-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (nct6775) Fix potential Spectre v1 hwmon: (adt7475) Make adt7475_read_word() return errors hwmon: (adt7475) Potential error pointer dereferences hwmon: (ina2xx) fix sysfs shunt resistor read access commit f3f106dac0458e3010486860baba8fdc2a133e5e Merge: ff81a521b888 ee4af50ca94f Author: Linus Torvalds Date: Wed Aug 29 14:56:45 2018 -0700 Merge tag 'for_v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull misc fs fixes from Jan Kara: - make UDF to properly mount media created by Win7 - make isofs to properly refuse devices with large physical block size - fix a Spectre gadget in quotactl(2) - fix a warning in fsnotify code hit by syzkaller * tag 'for_v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf: Fix mounting of Win7 created UDF filesystems udf: Remove dead code from udf_find_fileset() fs/quota: Fix spectre gadget in do_quotactl fs/quota: Replace XQM_MAXQUOTAS usage with MAXQUOTAS isofs: reject hardware sector size > 2048 bytes fsnotify: fix false positive warning on inode delete commit ff81a521b888728e7ece69a437ac4d9ea810b6c6 Merge: b4df50de6ab6 c7c09dc187f0 Author: Linus Torvalds Date: Wed Aug 29 14:51:32 2018 -0700 Merge tag 'nios2-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 Pull nios2 fix from Ley Foon Tan: "remove duplicate DEBUG_STACK_USAGE symbol defintions" * tag 'nios2-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2: nios2: kconfig: remove duplicate DEBUG_STACK_USAGE symbol defintions commit 80ab316901bc4ae6dd0b5903dbe22766307eac9b Author: Chris Wilson Date: Fri Aug 17 11:02:41 2018 +0100 drm/i915/audio: Hook up component bindings even if displays are disabled If the display has been disabled by modparam, we still want to connect together the HW bits and bobs with the associated drivers so that we can continue to manage their runtime power gating. Fixes: 108109444ff6 ("drm/i915: Check num_pipes before initializing audio component") Signed-off-by: Chris Wilson Cc: Imre Deak Cc: Takashi Iwai Cc: Jani Nikula Cc: Elaine Wang Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20180817100241.4628-1-chris@chris-wilson.co.uk (cherry picked from commit 35a5fd9ebfa93758ca579e30f337b6c9126d995b) Signed-off-by: Rodrigo Vivi commit 299c2a904b1e8d5096d4813df6371357d97a6cd1 Author: Fredrik Schön Date: Fri Aug 17 22:07:28 2018 +0200 drm/i915: Increase LSPCON timeout 100 ms is not enough time for the LSPCON adapter on Intel NUC devices to settle. This causes dropped display modes at boot or screen reconfiguration. Empirical testing can reproduce the error up to a timeout of 190 ms. Basic boot and stress testing at 200 ms has not (yet) failed. Increase timeout to 400 ms to get some margin of error. Changes from v1: The initial suggestion of 1000 ms was lowered due to concerns about delaying valid timeout cases. Update patch metadata. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107503 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1570392 Fixes: 357c0ae9198a ("drm/i915/lspcon: Wait for expected LSPCON mode to settle") Cc: Shashank Sharma Cc: Imre Deak Cc: Jani Nikula Cc: # v4.11+ Reviewed-by: Rodrigo Vivi Reviewed-by: Shashank Sharma Signed-off-by: Fredrik Schön Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180817200728.8154-1-fredrik.schon@gmail.com (cherry picked from commit 59f1c8ab30d6f9042562949f42cbd3f3cf69de94) Signed-off-by: Rodrigo Vivi commit f013027e266553effa3e9d9d62236ae5ee3b25e7 Author: Chris Wilson Date: Thu Aug 16 08:34:46 2018 +0100 drm/i915: Stop holding a ref to the ppgtt from each vma The context owns both the ppgtt and the vma within it, and our activity tracking on the context ensures that we do not release active ppgtt. As the context fulfils our obligations for active memory tracking, we can relinquish the reference from the vma. This fixes a silly transient refleak from closed vma being kept alive until the entire system was idle, keeping all vm alive as well. Reported-by: Paulo Zanoni Testcase: igt/gem_ctx_create/files Fixes: 3365e2268b6b ("drm/i915: Lazily unbind vma on close") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Paulo Zanoni Reviewed-by: Mika Kuoppala Tested-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180816073448.19396-1-chris@chris-wilson.co.uk (cherry picked from commit a4417b7b419a68540ad7945ac4efbb39d19afa63) Signed-off-by: Rodrigo Vivi commit b4df50de6ab66e41b3b8d8acf3ce45c632084163 Merge: 3f16503b7d22 3d7c82060d1f Author: Linus Torvalds Date: Wed Aug 29 13:38:39 2018 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: - Check for the right CPU feature bit in sm4-ce on arm64. - Fix scatterwalk WARN_ON in aes-gcm-ce on arm64. - Fix unaligned fault in aesni on x86. - Fix potential NULL pointer dereference on exit in chtls. - Fix DMA mapping direction for RSA in caam. - Fix error path return value for xts setkey in caam. - Fix address endianness when DMA unmapping in caam. - Fix sleep-in-atomic in vmx. - Fix command corruption when queue is full in cavium/nitrox. * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: cavium/nitrox - fix for command corruption in queue full case with backlog submissions. crypto: vmx - Fix sleep-in-atomic bugs crypto: arm64/aes-gcm-ce - fix scatterwalk API violation crypto: aesni - Use unaligned loads from gcm_context_data crypto: chtls - fix null dereference chtls_free_uld() crypto: arm64/sm4-ce - check for the right CPU feature bit crypto: caam - fix DMA mapping direction for RSA forms 2 & 3 crypto: caam/qi - fix error path in xts setkey crypto: caam/jr - fix descriptor DMA unmapping commit 67e6ddb5be440a92b82e87ca0ab8f973ae31b12c Author: Nishanth Menon Date: Mon Aug 27 19:46:50 2018 -0500 arm64: defconfig: Enable TI's AM6 SoC platform Enable K3 SoC platform for TI's AM6 SoC. Signed-off-by: Nishanth Menon Acked-by: Tony Lindgren Signed-off-by: Olof Johansson commit 1dbd150d04f11a6e8d03c80132167e8d3391f8ce Author: Linus Walleij Date: Mon Aug 27 15:27:08 2018 +0200 ARM: defconfig: Update the ARM Versatile defconfig This updates the ARM Versatile defconfig to the latest Kconfig structural changes and adds the DUMB VGA bridge driver so that VGA works out of the box, e.g. with QEMU. Signed-off-by: Linus Walleij Signed-off-by: Olof Johansson commit 55a020e21c16d7e5b00783ccd6c0c4487731dd75 Merge: 5b394b2ddf03 b9543a2e39dc Author: Olof Johansson Date: Wed Aug 29 11:50:14 2018 -0700 Merge tag 'imx-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into fixes i.MX fixes for 4.19: - i.MX display folks decided to switch MXS display driver from legacy FB to DRM during 4.19 merge window. It leads to a fallout on some Freescale/NXP development boards with Seiko 43WVF1G panel, because this DRM panel driver is not enabled in i.MX defconfig. Here is a series from Fabio to convert i.MX23/28 EVK DT to Seiko 43WVF1G panel bindings and enable the panel driver in i.MX defconfig, so that users can still get functional LCD on these boards by default. - A fix from Leonard to revert incorrect legacy PCI irq mapping in i.MX7 device tree, that was caused by document errors. * tag 'imx-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx_v6_v7_defconfig: Select CONFIG_DRM_PANEL_SEIKO_43WVF1G ARM: mxs_defconfig: Select CONFIG_DRM_PANEL_SEIKO_43WVF1G ARM: dts: imx23-evk: Convert to the new display bindings ARM: dts: imx23-evk: Move regulators outside simple-bus ARM: dts: imx28-evk: Convert to the new display bindings ARM: dts: imx28-evk: Move regulators outside simple-bus Revert "ARM: dts: imx7d: Invert legacy PCI irq mapping" Signed-off-by: Olof Johansson commit 74081c9f16a213f8f2681c175dc6ad7d17ad16ba Author: Fabrizio Castro Date: Tue Aug 14 13:33:48 2018 +0100 dt-bindings: watchdog: renesas-wdt: Document r8a774a1 support RZ/G2M (R8A774A1) watchdog implementation is compatible with R-Car Gen3, therefore add relevant documentation. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Rob Herring Reviewed-by: Simon Horman Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 3799eca51c5be3cd76047a582ac52087373b54b3 Author: Arnd Bergmann Date: Wed Aug 15 06:27:28 2018 -0400 media: camss: add missing includes Multiple files in this driver fail to build because of missing header inclusions: drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c: In function 'csiphy_hw_version_read': drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c:31:18: error: implicit declaration of function 'readl_relaxed'; did you mean 'xchg_relaxed'? [-Werror=implicit-function-declaration] drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c: In function 'csiphy_hw_version_read': drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c:52:2: error: implicit declaration of function 'writel' [-Werror=implicit-function-declaration] Add linux/io.h there and in all other files that call readl/writel and related interfaces. Signed-off-by: Arnd Bergmann Signed-off-by: Todor Tomov Signed-off-by: Mauro Carvalho Chehab commit 55b518998996cc935d294bbf1f07ddba58b8b89e Author: Todor Tomov Date: Tue Aug 14 11:57:35 2018 -0400 media: camss: Use managed memory allocations Use managed memory allocations for structs which are used until the driver is removed. Signed-off-by: Todor Tomov Signed-off-by: Mauro Carvalho Chehab commit 44a9ffd4eb99ada6c1496a735a414414fef30696 Author: Arnd Bergmann Date: Fri Aug 17 05:53:42 2018 -0400 media: camss: mark PM functions as __maybe_unused The empty suspend/resume functions cause a build warning when they are unused: drivers/media/platform/qcom/camss/camss.c:1001:12: error: 'camss_runtime_resume' defined but not used [-Werror=unused-function] drivers/media/platform/qcom/camss/camss.c:996:12: error: 'camss_runtime_suspend' defined but not used [-Werror=unused-function] Mark them as __maybe_unused so the compiler can silently drop them. Fixes: 02afa816dbbf ("media: camss: Add basic runtime PM support") Signed-off-by: Arnd Bergmann Acked-by: Todor Tomov Acked-by: Geert Uytterhoeven Signed-off-by: Mauro Carvalho Chehab commit 312f73b648626a0526a3aceebb0a3192aaba05ce Author: Jozef Balga Date: Tue Aug 21 05:01:04 2018 -0400 media: af9035: prevent buffer overflow on write When less than 3 bytes are written to the device, memcpy is called with negative array size which leads to buffer overflow and kernel panic. This patch adds a condition and returns -EOPNOTSUPP instead. Fixes bugzilla issue 64871 [mchehab+samsung@kernel.org: fix a merge conflict and changed the condition to match the patch's comment, e. g. len == 3 could also be valid] Signed-off-by: Jozef Balga Signed-off-by: Mauro Carvalho Chehab commit d65e6c80c6bb72ced46ce90dea4016d913a8ddd4 Merge: 5b24109b0563 a8cf76a9023b Author: Alexei Starovoitov Date: Wed Aug 29 10:47:17 2018 -0700 Merge branch 'bpf_msg_pull_data-fixes' Daniel Borkmann says: ==================== This set contains three more fixes for the bpf_msg_pull_data() mainly for correcting scatterlist ring wrap-arounds as well as fixing up data pointers. For details please see individual patches. Thanks! ==================== Signed-off-by: Alexei Starovoitov commit a8cf76a9023bc6709b1361d06bb2fae5227b9d68 Author: Daniel Borkmann Date: Wed Aug 29 16:50:36 2018 +0200 bpf: fix sg shift repair start offset in bpf_msg_pull_data When we perform the sg shift repair for the scatterlist ring, we currently start out at i = first_sg + 1. However, this is not correct since the first_sg could point to the sge sitting at slot MAX_SKB_FRAGS - 1, and a subsequent i = MAX_SKB_FRAGS will access the scatterlist ring (sg) out of bounds. Add the sk_msg_iter_var() helper for iterating through the ring, and apply the same rule for advancing to the next ring element as we do elsewhere. Later work will use this helper also in other places. Fixes: 015632bb30da ("bpf: sk_msg program helper bpf_sk_msg_pull_data") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov commit 2e43f95dd8ee62bc8bf57f2afac37fbd70c8d565 Author: Daniel Borkmann Date: Wed Aug 29 16:50:35 2018 +0200 bpf: fix shift upon scatterlist ring wrap-around in bpf_msg_pull_data If first_sg and last_sg wraps around in the scatterlist ring, then we need to account for that in the shift as well. E.g. crafting such msgs where this is the case leads to a hang as shift becomes negative. E.g. consider the following scenario: first_sg := 14 |=> shift := -12 msg->sg_start := 10 last_sg := 3 | msg->sg_end := 5 round 1: i := 15, move_from := 3, sg[15] := sg[ 3] round 2: i := 0, move_from := -12, sg[ 0] := sg[-12] round 3: i := 1, move_from := -11, sg[ 1] := sg[-11] round 4: i := 2, move_from := -10, sg[ 2] := sg[-10] [...] round 13: i := 11, move_from := -1, sg[ 2] := sg[ -1] round 14: i := 12, move_from := 0, sg[ 2] := sg[ 0] round 15: i := 13, move_from := 1, sg[ 2] := sg[ 1] round 16: i := 14, move_from := 2, sg[ 2] := sg[ 2] round 17: i := 15, move_from := 3, sg[ 2] := sg[ 3] [...] This means we will loop forever and never hit the msg->sg_end condition to break out of the loop. When we see that the ring wraps around, then the shift should be MAX_SKB_FRAGS - first_sg + last_sg - 1. Meaning, the remainder slots from the tail of the ring and the head until last_sg combined. Fixes: 015632bb30da ("bpf: sk_msg program helper bpf_sk_msg_pull_data") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov commit 0e06b227c5221dd51b5569de93f3b9f532be4a32 Author: Daniel Borkmann Date: Wed Aug 29 16:50:34 2018 +0200 bpf: fix msg->data/data_end after sg shift repair in bpf_msg_pull_data In the current code, msg->data is set as sg_virt(&sg[i]) + start - offset and msg->data_end relative to it as msg->data + bytes. Using iterator i to point to the updated starting scatterlist element holds true for some cases, however not for all where we'd end up pointing out of bounds. It is /correct/ for these ones: 1) When first finding the starting scatterlist element (sge) where we find that the page is already privately owned by the msg and where the requested bytes and headroom fit into the sge's length. However, it's /incorrect/ for the following ones: 2) After we made the requested area private and updated the newly allocated page into first_sg slot of the scatterlist ring; when we find that no shift repair of the ring is needed where we bail out updating msg->data and msg->data_end. At that point i will point to last_sg, which in this case is the next elem of first_sg in the ring. The sge at that point might as well be invalid (e.g. i == msg->sg_end), which we use for setting the range of sg_virt(&sg[i]). The correct one would have been first_sg. 3) Similar as in 2) but when we find that a shift repair of the ring is needed. In this case we fix up all sges and stop once we've reached the end. In this case i will point to will point to the new msg->sg_end, and the sge at that point will be invalid. Again here the requested range sits in first_sg. Fixes: 015632bb30da ("bpf: sk_msg program helper bpf_sk_msg_pull_data") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov commit 4fbf51ee6e822ac28be28ff25883745131e8c4a3 Author: Hans Verkuil Date: Thu Aug 23 09:55:43 2018 -0400 media: video_function_calls.rst: drop obsolete video-set-attributes reference This fixes this warning: Documentation/media/uapi/dvb/video_function_calls.rst:9: WARNING: toctree contains reference to nonexisting document 'uapi/dvb/video-set-attributes' Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 52bd456a66c1abb7dd43628080025703248b1ea2 Merge: 8f3fafc9c2f0 04db0e5ec581 Author: Jens Axboe Date: Wed Aug 29 11:05:20 2018 -0600 Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linus Pull NVMe fixes from Christoph. * 'nvme-4.19' of git://git.infradead.org/nvme: nvmet: free workqueue object if module init fails nvme-fcloop: Fix dropped LS's to removed target port nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event commit 8f3fafc9c2f0ece10832c25f7ffcb07c97a32ad4 Author: Scott Bauer Date: Thu Apr 26 11:51:08 2018 -0600 cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status Like d88b6d04: "cdrom: information leak in cdrom_ioctl_media_changed()" There is another cast from unsigned long to int which causes a bounds check to fail with specially crafted input. The value is then used as an index in the slot array in cdrom_slot_status(). Signed-off-by: Scott Bauer Signed-off-by: Scott Bauer Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe commit 823f18f8b860526fc099c222619a126d57d2ad8c Author: Matti Vaittinen Date: Wed Aug 29 15:36:10 2018 +0300 regulator: bd71837: Disable voltage monitoring for LDO3/4 There is a HW quirk in BD71837. The shutdown sequence timings for bucks/LDOs which are enabled via register interface are changed. At PMIC poweroff the voltage for BUCK6/7 is cut immediately at the beginning of shut-down sequence. This causes LDO5/6 voltage monitoring to detect under voltage and force PMIC to emergency state instead of poweroff. Disable voltage monitoring for LDO5 and LDO6 at probe to avoid this. Signed-off-by: Matti Vaittinen Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 36156f9241cb0f9e37d998052873ca7501ad4b36 Author: Johan Hovold Date: Mon Aug 27 10:21:45 2018 +0200 of: add helper to lookup compatible child node Add of_get_compatible_child() helper that can be used to lookup compatible child nodes. Several drivers currently use of_find_compatible_node() to lookup child nodes while failing to notice that the of_find_ functions search the entire tree depth-first (from a given start node) and therefore can match unrelated nodes. The fact that these functions also drop a reference to the node they start searching from (e.g. the parent node) is typically also overlooked, something which can lead to use-after-free bugs. Signed-off-by: Johan Hovold Signed-off-by: Rob Herring commit a618cf4800970d260871c159b7eec014a1da2e81 Author: Alexey Khoroshilov Date: Tue Aug 28 23:40:26 2018 +0300 gpio: dwapb: Fix error handling in dwapb_gpio_probe() If dwapb_gpio_add_port() fails in dwapb_gpio_probe(), gpio->clk is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: Linus Walleij commit 5bc5a671b1f4b3aa019264ce970d3683a9ffa761 Author: Richard Fitzgerald Date: Tue Aug 28 09:45:37 2018 +0100 pinctrl: madera: Fix possible NULL pointer with pdata config If we are being configured via pdata we don't necessarily have any gpio mappings being configured that way so pdata->gpio_config could be NULL. Signed-off-by: Richard Fitzgerald Signed-off-by: Linus Walleij commit 823dd71f58eb2133c24af85fad056a8dbb1a76e9 Author: Paul Burton Date: Sat Aug 25 10:53:28 2018 -0700 pinctrl: ingenic: Fix group & function error checking Commit a203728ac6bb ("pinctrl: core: Return selector to the pinctrl driver") and commit f913cfce4ee4 ("pinctrl: pinmux: Return selector to the pinctrl driver") modified the return values of pinctrl_generic_add_group() and pinmux_generic_add_function() respectively, but did so without updating their callers. This broke the pinctrl-ingenic driver, which treats non-zero return values from these functions as errors & fails to probe. For example on a MIPS Ci20: pinctrl-ingenic 10010000.pin-controller: Failed to register group uart0-hwflow pinctrl-ingenic: probe of 10010000.pin-controller failed with error 1 Without the pinctrl driver probed, other drivers go on to fail to probe too & the system is unusable. Fix this by modifying the error checks to treat only negative values as errors, matching the commits that introduced the breakage & similar changes made to other drivers. Signed-off-by: Paul Burton Fixes: a203728ac6bb ("pinctrl: core: Return selector to the pinctrl driver") Fixes: f913cfce4ee4 ("pinctrl: pinmux: Return selector to the pinctrl driver") Cc: Linus Walleij Cc: Paul Cercueil Cc: Tony Lindgren Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Linus Walleij commit 78d3a92edbfb02e8cb83173cad84c3f2d5e1f070 Author: Hans de Goede Date: Tue Aug 14 16:07:03 2018 +0200 gpiolib-acpi: Register GpioInt ACPI event handlers from a late_initcall GpioInt ACPI event handlers may see there IRQ triggered immediately after requesting the IRQ (esp. level triggered ones). This means that they may run before any other (builtin) drivers have had a chance to register their OpRegion handlers, leading to errors like this: [ 1.133274] ACPI Error: No handler for Region [PMOP] ((____ptrval____)) [UserDefinedRegion] (20180531/evregion-132) [ 1.133286] ACPI Error: Region UserDefinedRegion (ID=141) has no handler (20180531/exfldio-265) [ 1.133297] ACPI Error: Method parse/execution failed \_SB.GPO2._L01, AE_NOT_EXIST (20180531/psparse-516) We already defer the manual initial trigger of edge triggered interrupts by running it from a late_initcall handler, this commit replaces this with deferring the entire acpi_gpiochip_request_interrupts() call till then, fixing the problem of some OpRegions not being registered yet. Note that this removes the need to have a list of edge triggered handlers which need to run, since the entire acpi_gpiochip_request_interrupts() call is now delayed, acpi_gpiochip_request_interrupt() can call these directly now. Acked-by: Mika Westerberg Signed-off-by: Hans de Goede Signed-off-by: Linus Walleij commit 993b9bc5c47fda86f8ab4e53d68c6fea5ff2764a Author: Andy Shevchenko Date: Mon Aug 13 19:00:27 2018 +0300 gpiolib: acpi: Switch to cansleep version of GPIO library call The commit ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events at least once on boot") added a initial value check for pin which is about to be locked as IRQ. Unfortunately, not all GPIO drivers can do that atomically. Thus, switch to cansleep version of the call. Otherwise we have a warning: ... WARNING: CPU: 2 PID: 1408 at drivers/gpio/gpiolib.c:2883 gpiod_get_value+0x46/0x50 ... RIP: 0010:gpiod_get_value+0x46/0x50 ... The change tested on Intel Broxton with Whiskey Cove PMIC GPIO controller. Fixes: ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events at least once on boot") Signed-off-by: Andy Shevchenko Cc: Hans de Goede Cc: Benjamin Tissoires Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit 0434ccdcf883e53ec7156a6843943e940dc1feb8 Author: Florian Westphal Date: Fri Aug 24 08:43:36 2018 +0200 netfilter: nf_tables: rework ct timeout set support Using a private template is problematic: 1. We can't assign both a zone and a timeout policy (zone assigns a conntrack template, so we hit problem 1) 2. Using a template needs to take care of ct refcount, else we'll eventually free the private template due to ->use underflow. This patch reworks template policy to instead work with existing conntrack. As long as such conntrack has not yet been placed into the hash table (unconfirmed) we can still add the timeout extension. The only caveat is that we now need to update/correct ct->timeout to reflect the initial/new state, otherwise the conntrack entry retains the default 'new' timeout. Side effect of this change is that setting the policy must now occur from chains that are evaluated *after* the conntrack lookup has taken place. No released kernel contains the timeout policy feature yet, so this change should be ok. Changes since v2: - don't handle 'ct is confirmed case' - after previous patch, no need to special-case tcp/dccp/sctp timeout anymore Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ef39078d6342deaddacdd550c4197421bd83fb76 Author: Florian Westphal Date: Fri Aug 24 08:43:35 2018 +0200 netfilter: conntrack: place 'new' timeout in first location too tcp, sctp and dccp trackers re-use the userspace ctnetlink states to index their timeout arrays, which means timeout[0] is never used. Copy the 'new' state (syn-sent, dccp-request, ..) to 0 as well so external users can simply read it off timeouts[0] without need to differentiate dccp/sctp/tcp and udp/icmp/gre/generic. The alternative is to map all array accesses to 'i - 1', but that is a much more intrusive change. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 1d8f574708a3fb6f18c85486d0c5217df893c0cf Author: Marc Zyngier Date: Fri Aug 24 15:08:29 2018 +0100 arm/arm64: smccc-1.1: Make return values unsigned long An unfortunate consequence of having a strong typing for the input values to the SMC call is that it also affects the type of the return values, limiting r0 to 32 bits and r{1,2,3} to whatever was passed as an input. Let's turn everything into "unsigned long", which satisfies the requirements of both architectures, and allows for the full range of return values. Reported-by: Julien Grall Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit afce0cc9ad8aa510650e781a51e43c26e2a34cf6 Author: Julien Grall Date: Tue Aug 14 11:33:32 2018 +0100 Documentation/arm64/sve: Couple of improvements and typos - Fix mismatch between SVE registers (Z) and FPSIMD register (V) - Don't prefix the path for [3] with Linux to stay consistent with [1] and [2]. Signed-off-by: Julien Grall Signed-off-by: Will Deacon commit 166ac9d55b0ab70b644e429be1f217fe8393cbd7 Author: Sara Sharon Date: Wed Aug 29 08:57:02 2018 +0200 mac80211: avoid kernel panic when building AMSDU from non-linear SKB When building building AMSDU from non-linear SKB, we hit a kernel panic when trying to push the padding to the tail. Instead, put the padding at the head of the next subframe. This also fixes the A-MSDU subframes to not have the padding accounted in the length field and not have pad at all for the last subframe, both required by the spec. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Sara Sharon Reviewed-by: Lorenzo Bianconi Signed-off-by: Johannes Berg commit 1f631c3201fe5491808df143d8fcba81b3197ffd Author: Yuan-Chi Pang Date: Wed Aug 29 09:30:08 2018 +0800 mac80211: mesh: fix HWMP sequence numbering to follow standard IEEE 802.11-2016 14.10.8.3 HWMP sequence numbering says: If it is a target mesh STA, it shall update its own HWMP SN to maximum (current HWMP SN, target HWMP SN in the PREQ element) + 1 immediately before it generates a PREP element in response to a PREQ element. Signed-off-by: Yuan-Chi Pang Signed-off-by: Johannes Berg commit 6537886cdc9a637711fd6da980dbb87c2c87c9aa Author: Michael Hennerich Date: Mon Aug 13 15:57:44 2018 +0200 gpio: adp5588: Fix sleep-in-atomic-context bug This fixes: [BUG] gpio: gpio-adp5588: A possible sleep-in-atomic-context bug in adp5588_gpio_write() [BUG] gpio: gpio-adp5588: A possible sleep-in-atomic-context bug in adp5588_gpio_direction_input() Reported-by: Jia-Ju Bai Signed-off-by: Michael Hennerich Signed-off-by: Linus Walleij commit b55326dc969ea2d704a008d9a97583b128f54f4f Author: Stephen Boyd Date: Thu Aug 16 13:06:46 2018 -0700 pinctrl: msm: Really mask level interrupts to prevent latching The interrupt controller hardware in this pin controller has two status enable bits. The first "normal" status enable bit enables or disables the summary interrupt line being raised when a gpio interrupt triggers and the "raw" status enable bit allows or prevents the hardware from latching an interrupt into the status register for a gpio interrupt. Currently we just toggle the "normal" status enable bit in the mask and unmask ops so that the summary irq interrupt going to the CPU's interrupt controller doesn't trigger for the masked gpio interrupt. For a level triggered interrupt, the flow would be as follows: the pin controller sees the interrupt, latches the status into the status register, raises the summary irq to the CPU, summary irq handler runs and calls handle_level_irq(), handle_level_irq() masks and acks the gpio interrupt, the interrupt handler runs, and finally unmask the interrupt. When the interrupt handler completes, we expect that the interrupt line level will go back to the deasserted state so the genirq code can unmask the interrupt without it triggering again. If we only mask the interrupt by clearing the "normal" status enable bit then we'll ack the interrupt but it will continue to show up as pending in the status register because the raw status bit is enabled, the hardware hasn't deasserted the line, and thus the asserted state latches into the status register again. When the hardware deasserts the interrupt the pin controller still thinks there is a pending unserviced level interrupt because it latched it earlier. This behavior causes software to see an extra interrupt for level type interrupts each time the interrupt is handled. Let's fix this by clearing the raw status enable bit for level type interrupts so that the hardware stops latching the status of the interrupt after we ack it. We don't do this for edge type interrupts because it seems that toggling the raw status enable bit for edge type interrupts causes spurious edge interrupts. Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson Reviewed-by: Bjorn Andersson Signed-off-by: Linus Walleij commit b497fff6f59ec4ab2816439e7ab976a90b7bab5c Author: Wei Yongjun Date: Tue Jul 31 14:38:52 2018 +0000 usb: dwc3: pci: Fix return value check in dwc3_byt_enable_ulpi_refclock() In case of error, the function pcim_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 7740d04d901d ("usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does not") Reviewed-by: Hans de Goede Signed-off-by: Wei Yongjun Signed-off-by: Felipe Balbi commit dfe1a51d2a36647f74cbad478801efa7cf394376 Author: Yoshihiro Shimoda Date: Fri Aug 3 12:12:46 2018 +0900 usb: gadget: udc: renesas_usb3: fix maxpacket size of ep0 This patch fixes an issue that maxpacket size of ep0 is incorrect for SuperSpeed. Otherwise, CDC NCM class with SuperSpeed doesn't work correctly on this driver because its control read data size is more than 64 bytes. Reported-by: Junki Kato Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller") Cc: # v4.5+ Signed-off-by: Yoshihiro Shimoda Tested-by: Junki Kato Signed-off-by: Felipe Balbi commit c37bd52836296ecc9a0fc8060b819089aebdbcde Author: Anton Vasilyev Date: Tue Aug 7 14:44:48 2018 +0300 usb: gadget: fotg210-udc: Fix memory leak of fotg210->ep[i] There is no deallocation of fotg210->ep[i] elements, allocated at fotg210_udc_probe. The patch adds deallocation of fotg210->ep array elements and simplifies error path of fotg210_udc_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Felipe Balbi commit dec3c23c9aa1815f07d98ae0375b4cbc10971e13 Author: Alan Stern Date: Wed Aug 8 11:20:39 2018 -0400 USB: net2280: Fix erroneous synchronization change Commit f16443a034c7 ("USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks") was based on a serious misunderstanding. It introduced regressions into both the dummy-hcd and net2280 drivers. The problem in dummy-hcd was fixed by commit 7dbd8f4cabd9 ("USB: dummy-hcd: Fix erroneous synchronization change"), but the problem in net2280 remains. Namely: the ->disconnect(), ->suspend(), ->resume(), and ->reset() callbacks must be invoked without the private lock held; otherwise a deadlock will occur when the callback routine tries to interact with the UDC driver. This patch largely is a reversion of the relevant parts of f16443a034c7. It also drops the private lock around the calls to ->suspend() and ->resume() (something the earlier patch forgot to do). This is safe from races with device interrupts because it occurs within the interrupt handler. Finally, the patch changes where the ->disconnect() callback is invoked when net2280_pullup() turns the pullup off. Rather than making the callback from within stop_activity() at a time when dropping the private lock could be unsafe, the callback is moved to a point after the lock has already been dropped. Signed-off-by: Alan Stern Fixes: f16443a034c7 ("USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks") Reported-by: D. Ziesche Tested-by: D. Ziesche CC: Signed-off-by: Felipe Balbi commit 66174b6998a645c39867c3a301b4ee4611d6ca5b Author: Arnd Bergmann Date: Mon Aug 13 23:56:55 2018 +0200 usb: dwc3: of-simple: avoid unused function warnings An incorrect #ifdef caused a pair of harmless warnings when CONFIG_PM_SLEEP is disabled: drivers/usb/dwc3/dwc3-of-simple.c:223:12: error: 'dwc3_of_simple_resume' defined but not used [-Werror=unused-function] static int dwc3_of_simple_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~ drivers/usb/dwc3/dwc3-of-simple.c:213:12: error: 'dwc3_of_simple_suspend' defined but not used [-Werror=unused-function] static int dwc3_of_simple_suspend(struct device *dev) Since the #ifdef method is generally hard to get right, use a simpler __maybe_unused annotation here to let the compiler drop the unused functions silently. This also improves compile-time coverage. Fixes: 76251db86561 ("usb: dwc3: of-simple: reset host controller at suspend/resume") Signed-off-by: Arnd Bergmann Signed-off-by: Felipe Balbi commit 5b24109b0563d45094c470684c1f8cea1af269f8 Author: Daniel Borkmann Date: Tue Aug 28 16:15:35 2018 +0200 bpf: fix several offset tests in bpf_msg_pull_data While recently going over bpf_msg_pull_data(), I noticed three issues which are fixed in here: 1) When we attempt to find the first scatterlist element (sge) for the start offset, we add len to the offset before we check for start < offset + len, whereas it should come after when we iterate to the next sge to accumulate the offsets. For example, given a start offset of 12 with a sge length of 8 for the first sge in the list would lead us to determine this sge as the first sge thinking it covers first 16 bytes where start is located, whereas start sits in subsequent sges so we would end up pulling in the wrong data. 2) After figuring out the starting sge, we have a short-cut test in !msg->sg_copy[i] && bytes <= len. This checks whether it's not needed to make the page at the sge private where we can just exit by updating msg->data and msg->data_end. However, the length test is not fully correct. bytes <= len checks whether the requested bytes (end - start offsets) fit into the sge's length. The part that is missing is that start must not be sge length aligned. Meaning, the start offset into the sge needs to be accounted as well on top of the requested bytes as otherwise we can access the sge out of bounds. For example the sge could have length of 8, our requested bytes could have length of 8, but at a start offset of 4, so we also would need to pull in 4 bytes of the next sge, when we jump to the out label we do set msg->data to sg_virt(&sg[i]) + start - offset and msg->data_end to msg->data + bytes which would be oob. 3) The subsequent bytes < copy test for finding the last sge has the same issue as in point 2) but also it tests for less than rather than less or equal to. Meaning if the sge length is of 8 and requested bytes of 8 while having the start aligned with the sge, we would unnecessarily go and pull in the next sge as well to make it private. Fixes: 015632bb30da ("bpf: sk_msg program helper bpf_sk_msg_pull_data") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov commit 3f16503b7d2274ac8cbab11163047ac0b4c66cfe Merge: 050cdc6c9501 152395fd03d4 Author: Linus Torvalds Date: Tue Aug 28 16:11:34 2018 -0700 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal Pull thermal fixes from Eduardo Valentin: "Minor fixes to OF thermal, qoriq, and rcar drivers" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: thermal: of-thermal: disable passive polling when thermal zone is disabled thermal: rcar_gen3_thermal: convert to SPDX identifiers thermal: rcar_thermal: convert to SPDX identifiers thermal: qoriq: Switch to SPDX identifier thermal: qoriq: Simplify the 'site' variable assignment thermal: qoriq: Use devm_thermal_zone_of_sensor_register() commit 450b6b9b169382205f88858541a8b79830262ce7 Author: Gustavo A. R. Silva Date: Thu Aug 23 18:06:54 2018 -0500 clk: npcm7xx: fix memory allocation One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); Notice that, currently, there is a bug during the allocation: sizeof(npcm7xx_clk_data) should be sizeof(*npcm7xx_clk_data) Fix this bug by using struct_size() in kzalloc() This issue was detected with the help of Coccinelle. Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Avi Fishman Signed-off-by: Stephen Boyd commit 6d3c8ce012cefbdd73a3bba3c7f9a44af1c6a0bb Author: Colin Ian King Date: Tue Aug 28 17:10:46 2018 +0100 x86/xen: remove redundant variable save_pud Variable save_pud is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: variable 'save_pud' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 076e2cedd6ea4786569c35f8725b4efdc1ecf2f2 Author: Joe Jin Date: Tue Aug 28 07:56:08 2018 -0700 xen: export device state to sysfs Export device state to sysfs to allow for easier get device state. Signed-off-by: Joe Jin Reviewed-by: Boris Ostrovsky Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Konrad Rzeszutek Wilk Signed-off-by: Boris Ostrovsky commit 47d80a68f10d3290204a12f7836a9a8190dfc327 Author: Palmer Dabbelt Date: Tue Aug 28 09:37:16 2018 -0700 RISC-V: Use a less ugly workaround for unused variable warnings Thanks to Christoph Hellwig for pointing out a cleaner way to do this, as my approach was quite ugly. CC: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit 0ce5671c4450527f90d2bfb31302f78580587983 Author: Will Deacon Date: Fri Aug 24 11:22:55 2018 -0700 riscv: tlb: Provide definition of tlb_flush() before including tlb.h As of commit fd1102f0aade ("mm: mmu_notifier fix for tlb_end_vma"), asm-generic/tlb.h now calls tlb_flush() from a static inline function, so we need to make sure that it's declared before #including the asm-generic header in the arch header. Reported-by: Guenter Roeck Fixes: fd1102f0aade ("mm: mmu_notifier fix for tlb_end_vma") Signed-off-by: Will Deacon [groeck: Use forward declaration instead of moving inline function] Signed-off-by: Guenter Roeck Signed-off-by: Palmer Dabbelt commit 11f65ad111fa29de2d11929f773bf1e553d5b7c4 Author: Palmer Dabbelt Date: Mon Aug 20 15:47:57 2018 -0700 dt-bindings: riscv,cpu-intc: Cleanups from a missed review I managed to miss one of Rob's code reviews on the mailing list . The patch has already been merged, so I'm submitting a fixup. Sorry! Fixes: b67bc7cb4088 ("dt-bindings: interrupt-controller: RISC-V local interrupt controller") Cc: Rob Herring Cc: Christoph Hellwig Cc: Karsten Merker Signed-off-by: Palmer Dabbelt commit 5223c9c1cbfc0cd4d0a1b50758e0949af3290fa1 Author: Angelo Dureghello Date: Sat Aug 18 01:51:58 2018 +0200 spi: spi-fsl-dspi: fix broken DSPI_EOQ_MODE This patch fixes the dspi_eoq_write function used by the ColdFire mcf5441x family. The 16 bit cmd part must be re-set at each data transfer. Also, now that fifo_size variables are used for eoq_read/write, a proper fifo size must be set (16 slots for the ColdFire dspi module version). Signed-off-by: Angelo Dureghello Acked-by: Esben Haabendal Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 1b1b1162745e5f9e5c6c095afc8081df3edabc50 Author: Rodrigo Vivi Date: Thu Aug 23 13:51:36 2018 -0700 drm/i915: Free write_buf that we allocated with kzalloc. We use kzalloc to allocate the write_buf that we use for i2c transfer on hdcp write. But it seems that we are forgetting to free the memory that is not needed after i2c transfer is completed. Reported-by: Brian J Wood Fixes: 2320175feb74 ("drm/i915: Implement HDCP for HDMI") Cc: Ramalingam C Cc: Sean Paul Cc: Jani Nikula Cc: Rodrigo Vivi Cc: # v4.17+ Signed-off-by: Rodrigo Vivi Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180823205136.31310-1-rodrigo.vivi@intel.com (cherry picked from commit 62d3a8deaa10b8346d979d0dabde56c33b742afa) Signed-off-by: Rodrigo Vivi commit 5b2695fd4b20f9b8320e9ecbfc232842bacf5b6f Author: Ville Syrjälä Date: Thu Jul 19 21:21:57 2018 +0300 drm/i915: Fix glk/cnl display w/a #1175 The workaround was supposed to look at the plane destination coordinates. Currently it's looking at some mixture of src and dst coordinates that doesn't make sense. Fix it up. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180719182214.4323-2-ville.syrjala@linux.intel.com Fixes: 394676f05bee (drm/i915: Add WA for planes ending close to left screen edge) Reviewed-by: Imre Deak (cherry picked from commit b1f1c2c11fc6c6cd3e361061e30f9b2839897b28) Signed-off-by: Rodrigo Vivi commit 04b2d03a75652bda989de1595048f0501dc0c0a0 Author: Geert Uytterhoeven Date: Tue Aug 21 11:53:03 2018 +0200 spi: Fix double IDR allocation with DT aliases If the SPI bus number is provided by a DT alias, idr_alloc() is called twice, leading to: WARNING: CPU: 1 PID: 1 at drivers/spi/spi.c:2179 spi_register_controller+0x11c/0x5d8 couldn't get idr Fix this by moving the handling of fixed SPI bus numbers up, before the DT handling code fills in ctlr->bus_num. Fixes: 1a4327fbf4554d5b ("spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers") Signed-off-by: Geert Uytterhoeven Tested-by: Fabio Estevam Signed-off-by: Mark Brown commit 5ea752c6efdf5aa8a57aed816d453a8f479f1b0a Author: Danny Smith Date: Thu Aug 23 10:26:20 2018 +0200 ASoC: sigmadsp: safeload should not have lower byte limit Fixed range in safeload conditional to allow safeload to up to 20 bytes, without a lower limit. Signed-off-by: Danny Smith Acked-by: Lars-Peter Clausen Signed-off-by: Mark Brown commit 960cdd50ca9fdfeb82c2757107bcb7f93c8d7d41 Author: Pierre-Louis Bossart Date: Wed Aug 22 22:49:36 2018 -0500 ASoC: wm8804: Add ACPI support HID made of either Wolfson/CirrusLogic PCI ID + 8804 identifier. This helps enumerate the HifiBerry Digi+ HAT boards on the Up2 platform. The scripts at https://github.com/thesofproject/acpi-scripts can be used to add the ACPI initrd overlays. Signed-off-by: Pierre-Louis Bossart Acked-by: Charles Keepax Signed-off-by: Mark Brown commit 7509487785d7a2bf3606cf26710f0ca29e9ca94d Author: Shuming Fan Date: Fri Aug 24 10:52:19 2018 +0800 ASoC: rt5682: Change DAC/ADC volume scale The step of DAC/ADC volume scale changes from 0.375dB to 0.75dB Signed-off-by: Shuming Fan Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit ca917f9fe1a0fab3dde41bba4bbd173c5a3c5805 Author: Ryan Lee Date: Thu Aug 23 18:37:08 2018 -0700 ASoC: max98373: Added 10ms sleep after amp software reset Signed-off-by: Ryan Lee Signed-off-by: Mark Brown commit 6ddd9769db4fc11a98bd7e58be1764e47fdb8384 Author: Emily Deng Date: Tue Aug 28 20:52:40 2018 +0800 drm/amdgpu: Need to set moved to true when evict bo Fix the VMC page fault when the running sequence is as below: 1.amdgpu_gem_create_ioctl 2.ttm_bo_swapout->amdgpu_vm_bo_invalidate, as not called amdgpu_vm_bo_base_init, so won't called list_add_tail(&base->bo_list, &bo->va). Even the bo was evicted, it won't set the bo_base->moved. 3.drm_gem_open_ioctl->amdgpu_vm_bo_base_init, here only called list_move_tail(&base->vm_status, &vm->evicted), but not set the bo_base->moved. 4.amdgpu_vm_bo_map->amdgpu_vm_bo_insert_map, as the bo_base->moved is not set true, the function amdgpu_vm_bo_insert_map will call list_move(&bo_va->base.vm_status, &vm->moved) 5.amdgpu_cs_ioctl won't validate the swapout bo, as it is only in the moved list, not in the evict list. So VMC page fault occurs. Signed-off-by: Emily Deng Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2d59bb602314a4b2593fde267734266b5e872dd0 Author: Tony Lindgren Date: Mon Aug 27 19:18:21 2018 -0700 ARM: dts: omap4-droid4: Fix emmc errors seen on some devices Otherwise we can get the following errors occasionally on some devices: mmc1: tried to HW reset card, got error -110 mmcblk1: error -110 requesting status mmcblk1: recovery failed! print_req_error: I/O error, dev mmcblk1, sector 14329 ... I have one device that hits this error almost on every boot, and another one that hits it only rarely with the other ones I've used behave without problems. I'm not sure if the issue is related to a particular eMMC card model, but in case it is, both of the machines with issues have: # cat /sys/class/mmc_host/mmc1/mmc1:0001/manfid \ /sys/class/mmc_host/mmc1/mmc1:0001/oemid \ /sys/class/mmc_host/mmc1/mmc1:0001/name 0x000045 0x0100 SEM16G and the working ones have: 0x000011 0x0100 016G92 Note that "ti,non-removable" is different as omap_hsmmc_reg_get() does not call omap_hsmmc_disable_boot_regulators() if no_regulator_off_init is set. And currently we set no_regulator_off_init only for "ti,non-removable" and not for "non-removable". It seems that we should have "non-removable" with some other mmc generic property behave in the same way instead of having to use a non-generic property. But let's fix the issue first. Fixes: 7e2f8c0ae670 ("ARM: dts: Add minimal support for motorola droid 4 xt894") Cc: Marcel Partap Cc: Merlijn Wajer Cc: Michael Scott Cc: NeKit Cc: Pavel Machek Cc: Sebastian Reichel Signed-off-by: Tony Lindgren commit ea4d65f14f6aaa53e379b93c5544245ef081b3e7 Merge: ce32d59ee2cd 496f3347d834 Author: Tony Lindgren Date: Tue Aug 28 09:58:03 2018 -0700 Merge branch 'perm-fix' into omap-for-v4.19/fixes-v2 commit 496f3347d834aec91c38b45d6249ed00f58ad233 Author: Neeraj Dantu Date: Tue Aug 28 16:37:58 2018 +0000 ARM: dts: Fix file permission for am335x-osd3358-sm-red.dts Fix wrong mode for dts file added by commit bb3e3fbbac86 ("ARM: dts: Add DT support for Octavo Systems OSD3358-SM-RED based on TI AM335x"). Signed-off-by: Neeraj Dantu CC: Robert Nelson CC: Jason Kridner Signed-off-by: Tony Lindgren commit f86cf25a609107960cf05263e491463feaae1f99 Author: Gao Xiang Date: Tue Aug 28 11:39:48 2018 +0800 Revert "staging: erofs: disable compiling temporarile" This reverts commit 156c3df8d4db4e693c062978186f44079413d74d. Since XArray and the new mount apis aren't merged in 4.19-rc1 merge window, the BROKEN mark can be reverted directly without any problems. Fixes: 156c3df8d4db ("staging: erofs: disable compiling temporarile") Cc: Matthew Wilcox Cc: David Howells Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit b2dd9f2e5a8a4a6afa9d41411cdbfc2f5ceeba71 Author: Stefan Agner Date: Tue Aug 28 13:29:54 2018 +0200 HID: core: fix memory leak on probe The dynamically allocted collection stack does not get freed in all situations. Make sure to also free the collection stack when using the parser in hid_open_report(). Fixes: 08a8a7cf1459 ("HID: core: do not upper bound the collection stack") Signed-off-by: Stefan Agner Signed-off-by: Jiri Kosina commit e38c0ac55ee67cf3626cfbc2283f8873dc44d370 Author: Stefan Agner Date: Tue Aug 28 13:29:55 2018 +0200 HID: input: fix leaking custom input node name Make sure to free the custom input node name on disconnect. Cc: stable@vger.kernel.org # v4.18+ Fixes: c554bb045511 ("HID: input: append a suffix matching the application") Signed-off-by: Stefan Agner Signed-off-by: Jiri Kosina commit ee345492437043a79db058a3d4f029ebcb52089a Author: Sean O'Brien Date: Mon Aug 27 13:02:15 2018 -0700 HID: add support for Apple Magic Keyboards USB device Vendor 05ac (Apple) Device 026c (Magic Keyboard with Numeric Keypad) Bluetooth devices Vendor 004c (Apple) Device 0267 (Magic Keyboard) Device 026c (Magic Keyboard with Numeric Keypad) Support already exists for the Magic Keyboard over USB connection. Add support for the Magic Keyboard over Bluetooth connection, and for the Magic Keyboard with Numeric Keypad over Bluetooth and USB connection. Signed-off-by: Sean O'Brien Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit fb6acf76c3fdd97fea6995e64e2c665725f00fc5 Author: AceLan Kao Date: Tue Aug 21 16:55:13 2018 +0800 HID: i2c-hid: Fix flooded incomplete report after S3 on Rayd touchscreen The incomplete report flooded after S3 and touchscreen becomes malfunctioned. [ 1367.646244] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete report (58/18785) [ 1367.649471] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete report (58/28743) [ 1367.651092] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete report (58/26757) [ 1367.652658] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete report (58/52280) [ 1367.654287] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete report (58/56059) Adding device ID, 04F3:30CC, to the quirk to re-send report description after resume. Cc: stable@vger.kernel.org Signed-off-by: AceLan Kao Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit e0ab8b26aa9661df0541a657e2b2416d90488809 Author: Andreas Bosch Date: Fri Aug 17 22:16:00 2018 +0200 HID: intel-ish-hid: Enable Sunrise Point-H ish driver Added PCI ID for Sunrise Point-H ISH. Signed-off-by: Andreas Bosch Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina commit b88d26d97c41680f7327e5fb8061ad0037877f40 Author: Haim Dreyfuss Date: Tue Aug 21 09:22:20 2018 +0300 nl80211: Pass center frequency in kHz instead of MHz freq_reg_info expects to get the frequency in kHz. Instead we accidently pass it in MHz. Thus, currently the function always return ERR rule. Fix that. Fixes: 50f32718e125 ("nl80211: Add wmm rule attribute to NL80211_CMD_GET_WIPHY dump command") Signed-off-by: Haim Dreyfuss Signed-off-by: Luca Coelho [fix kHz/MHz in commit message] Signed-off-by: Johannes Berg commit d3c89bbc7491d5e288ca2993e999d24ba9ff52ad Author: Haim Dreyfuss Date: Tue Aug 21 09:22:19 2018 +0300 nl80211: Fix nla_put_u8 to u16 for NL80211_WMMR_TXOP TXOP (also known as Channel Occupancy Time) is u16 and should be added using nla_put_u16 instead of u8, fix that. Fixes: 50f32718e125 ("nl80211: Add wmm rule attribute to NL80211_CMD_GET_WIPHY dump command") Signed-off-by: Haim Dreyfuss Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 3a2af7cccbbaf2362db9053a946a6084e12bfa73 Author: Jinbum Park Date: Tue Jul 31 23:10:40 2018 +0900 mac80211_hwsim: Fix possible Spectre-v1 for hwsim_world_regdom_custom User controls @idx which to be used as index of hwsim_world_regdom_custom. So, It can be exploited via Spectre-like attack. (speculative execution) This kind of attack leaks address of hwsim_world_regdom_custom, It leads an attacker to bypass security mechanism such as KASLR. So sanitize @idx before using it to prevent attack. I leveraged strategy [1] to find and exploit this gadget. [1] https://github.com/jinb-park/linux-exploit/tree/master/exploit-remaining-spectre-gadget/ Signed-off-by: Jinbum Park [johannes: unwrap URL] Signed-off-by: Johannes Berg commit 20932750d9c78d307e4f2f18f9c6a32b82b1e0e8 Author: Emmanuel Grumbach Date: Mon Aug 20 13:56:07 2018 +0300 mac80211: don't update the PM state of a peer upon a multicast frame I changed the way mac80211 updates the PM state of the peer. I forgot that we could also have multicast frames from the peer and that those frame should of course not change the PM state of the peer: A peer goes to power save when it needs to scan, but it won't send the broadcast Probe Request with the PM bit set. This made us mark the peer as awake when it wasn't and then Intel's firmware would fail to transmit because the peer is asleep according to its database. The driver warned about this and it looked like this: WARNING: CPU: 0 PID: 184 at /usr/src/linux-4.16.14/drivers/net/wireless/intel/iwlwifi/mvm/tx.c:1369 iwl_mvm_rx_tx_cmd+0x53b/0x860 CPU: 0 PID: 184 Comm: irq/124-iwlwifi Not tainted 4.16.14 #1 RIP: 0010:iwl_mvm_rx_tx_cmd+0x53b/0x860 Call Trace: iwl_pcie_rx_handle+0x220/0x880 iwl_pcie_irq_handler+0x6c9/0xa20 ? irq_forced_thread_fn+0x60/0x60 ? irq_thread_dtor+0x90/0x90 The relevant code that spits the WARNING is: case TX_STATUS_FAIL_DEST_PS: /* the FW should have stopped the queue and not * return this status */ WARN_ON(1); info->flags |= IEEE80211_TX_STAT_TX_FILTERED; This fixes https://bugzilla.kernel.org/show_bug.cgi?id=199967. Fixes: 9fef65443388 ("mac80211: always update the PM state of a peer on MGMT / DATA frames") Cc: #4.16+ Signed-off-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 38cb87ee47fb825f6c9d645c019f75b3905c0ab2 Author: Stanislaw Gruszka Date: Wed Aug 22 13:52:21 2018 +0200 cfg80211: make wmm_rule part of the reg_rule structure Make wmm_rule be part of the reg_rule structure. This simplifies the code a lot at the cost of having bigger memory usage. However in most cases we have only few reg_rule's and when we do have many like in iwlwifi we do not save memory as it allocates a separate wmm_rule for each channel anyway. This also fixes a bug reported in various places where somewhere the pointers were corrupted and we ended up doing a null-dereference. Fixes: 230ebaa189af ("cfg80211: read wmm rules from regulatory database") Signed-off-by: Stanislaw Gruszka [rephrase commit message slightly] Signed-off-by: Johannes Berg commit d7c863a2f65e48f442379f4ee1846d52e0c5d24d Author: Danek Duvall Date: Wed Aug 22 16:01:05 2018 -0700 mac80211_hwsim: correct use of IEEE80211_VHT_CAP_RXSTBC_X The mac80211_hwsim driver intends to say that it supports up to four STBC receive streams, but instead it ends up saying something undefined. The IEEE80211_VHT_CAP_RXSTBC_X macros aren't independent bits that can be ORed together, but values. In this case, _4 is the appropriate one to use. Signed-off-by: Danek Duvall Signed-off-by: Johannes Berg commit 67d1ba8a6dc83d90cd58b89fa6cbf9ae35a0cf7f Author: Danek Duvall Date: Wed Aug 22 16:01:04 2018 -0700 mac80211: correct use of IEEE80211_VHT_CAP_RXSTBC_X The mod mask for VHT capabilities intends to say that you can override the number of STBC receive streams, and it does, but only by accident. The IEEE80211_VHT_CAP_RXSTBC_X aren't bits to be set, but values (albeit left-shifted). ORing the bits together gets the right answer, but we should use the _MASK macro here instead. Signed-off-by: Danek Duvall Signed-off-by: Johannes Berg commit 501ca81760c204ec59b73e4a00bee5971fc0f1b1 Author: John Fastabend Date: Fri Aug 24 17:37:00 2018 -0700 bpf: sockmap, decrement copied count correctly in redirect error case Currently, when a redirect occurs in sockmap and an error occurs in the redirect call we unwind the scatterlist once in the error path of bpf_tcp_sendmsg_do_redirect() and then again in sendmsg(). Then in the error path of sendmsg we decrement the copied count by the send size. However, its possible we partially sent data before the error was generated. This can happen if do_tcp_sendpages() partially sends the scatterlist before encountering a memory pressure error. If this happens we need to decrement the copied value (the value tracking how many bytes were actually sent to TCP stack) by the number of remaining bytes _not_ the entire send size. Otherwise we risk confusing userspace. Also we don't need two calls to free the scatterlist one is good enough. So remove the one in bpf_tcp_sendmsg_do_redirect() and then properly reduce copied by the number of remaining bytes which may in fact be the entire send size if no bytes were sent. To do this use bool to indicate if free_start_sg() should do mem accounting or not. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 04db0e5ec58167364a80fd33ddb4f3b67434eb85 Author: Chaitanya Kulkarni Date: Wed Aug 15 18:48:25 2018 -0700 nvmet: free workqueue object if module init fails Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit afd299ca996929f4f98ac20da0044c0cdc124879 Author: James Smart Date: Thu Aug 9 16:00:14 2018 -0700 nvme-fcloop: Fix dropped LS's to removed target port When a targetport is removed from the config, fcloop will avoid calling the LS done() routine thinking the targetport is gone. This leaves the initiator reset/reconnect hanging as it waits for a status on the Create_Association LS for the reconnect. Change the filter in the LS callback path. If tport null (set when failed validation before "sending to remote port"), be sure to call done. This was the main bug. But, continue the logic that only calls done if tport was set but there is no remoteport (e.g. case where remoteport has been removed, thus host doesn't expect a completion). Signed-off-by: James Smart Signed-off-by: Christoph Hellwig commit f1ed3df20d2d223e0852cc4ac1f19bba869a7e3c Author: Michal Wnukowski Date: Wed Aug 15 15:51:57 2018 -0700 nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event In many architectures loads may be reordered with older stores to different locations. In the nvme driver the following two operations could be reordered: - Write shadow doorbell (dbbuf_db) into memory. - Read EventIdx (dbbuf_ei) from memory. This can result in a potential race condition between driver and VM host processing requests (if given virtual NVMe controller has a support for shadow doorbell). If that occurs, then the NVMe controller may decide to wait for MMIO doorbell from guest operating system, and guest driver may decide not to issue MMIO doorbell on any of subsequent commands. This issue is purely timing-dependent one, so there is no easy way to reproduce it. Currently the easiest known approach is to run "Oracle IO Numbers" (orion) that is shipped with Oracle DB: orion -run advanced -num_large 0 -size_small 8 -type rand -simulate \ concat -write 40 -duration 120 -matrix row -testname nvme_test Where nvme_test is a .lun file that contains a list of NVMe block devices to run test against. Limiting number of vCPUs assigned to given VM instance seems to increase chances for this bug to occur. On test environment with VM that got 4 NVMe drives and 1 vCPU assigned the virtual NVMe controller hang could be observed within 10-20 minutes. That correspond to about 400-500k IO operations processed (or about 100GB of IO read/writes). Orion tool was used as a validation and set to run in a loop for 36 hours (equivalent of pushing 550M IO operations). No issues were observed. That suggest that the patch fixes the issue. Fixes: f9f38e33389c ("nvme: improve performance for virtual NVMe devices") Signed-off-by: Michal Wnukowski Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg [hch: updated changelog and comment a bit] Signed-off-by: Christoph Hellwig commit 3f6e138d41ddff196f452993528cfe75762ede0f Author: Stefan Agner Date: Mon Aug 27 21:30:42 2018 +0200 bpf: fix build error with clang Building the newly introduced BPF_PROG_TYPE_SK_REUSEPORT leads to a compile time error when building with clang: net/core/filter.o: In function `sk_reuseport_convert_ctx_access': ../net/core/filter.c:7284: undefined reference to `__compiletime_assert_7284' It seems that clang has issues resolving hweight_long at compile time. Since SK_FL_PROTO_MASK is a constant, we can use the interface for known constant arguments which works fine with clang. Fixes: 2dbb9b9e6df6 ("bpf: Introduce BPF_PROG_TYPE_SK_REUSEPORT") Signed-off-by: Stefan Agner Signed-off-by: Alexei Starovoitov commit 15c480efab01197c965ce0562a43ffedd852b8f9 Author: Daniel Borkmann Date: Fri Aug 24 22:08:51 2018 +0200 bpf, sockmap: fix psock refcount leak in bpf_tcp_recvmsg In bpf_tcp_recvmsg() we first took a reference on the psock, however once we find that there are skbs in the normal socket's receive queue we return with processing them through tcp_recvmsg(). Problem is that we leak the taken reference on the psock in that path. Given we don't really do anything with the psock at this point, move the skb_queue_empty() test before we fetch the psock to fix this case. Fixes: 8934ce2fd081 ("bpf: sockmap redirect ingress support") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov commit e06fa9c16ce4b740996189fa5610eabcee734e6c Author: Daniel Borkmann Date: Fri Aug 24 22:08:50 2018 +0200 bpf, sockmap: fix potential use after free in bpf_tcp_close bpf_tcp_close() we pop the psock linkage to a map via psock_map_pop(). A parallel update on the sock hash map can happen between psock_map_pop() and lookup_elem_raw() where we override the element under link->hash / link->key. In bpf_tcp_close()'s lookup_elem_raw() we subsequently only test whether an element is present, but we do not test whether the element is infact the element we were looking for. We lock the sock in bpf_tcp_close() during that time, so do we hold the lock in sock_hash_update_elem(). However, the latter locks the sock which is newly updated, not the one we're purging from the hash table. This means that while one CPU is doing the lookup from bpf_tcp_close(), another CPU is doing the map update in parallel, dropped our sock from the hlist and released the psock. Subsequently the first CPU will find the new sock and attempts to drop and release the old sock yet another time. Fix is that we need to check the elements for a match after lookup, similar as we do in the sock map. Note that the hash tab elems are freed via RCU, so access to their link->hash / link->key is fine since we're under RCU read side there. Fixes: e9db4ef6bf4c ("bpf: sockhash fix omitted bucket lock in sock_close") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov commit db193954ed9e35701b6e489fa4cc97b08589341b Author: John Pittman Date: Mon Aug 27 14:33:05 2018 -0400 block: bsg: move atomic_t ref_count variable to refcount API Currently, variable ref_count within the bsg_device struct is of type atomic_t. For variables being used as reference counters, the refcount API should be used instead of atomic. The newer refcount API works to prevent counter overflows and use-after-free bugs. So, move this varable from the atomic API to refcount, potentially avoiding the issues mentioned. Signed-off-by: John Pittman Signed-off-by: Jens Axboe commit 62d2a1940709198a522a43ff8be8b8f6b3654dec Author: Chengguang Xu Date: Tue Aug 28 07:31:11 2018 +0800 block: remove unnecessary condition check kmem_cache_destroy() can handle NULL pointer correctly, so there is no need to check e->icq_cache before calling kmem_cache_destroy(). Signed-off-by: Chengguang Xu Signed-off-by: Jens Axboe commit 53ae914d898e5dd5984d352d5fa0b23410f966a0 Author: Zhu Yanjun Date: Sat Aug 25 15:19:05 2018 +0800 net/rds: Use rdma_read_gids to get connection SGID/DGID in IPv6 In IPv4, the newly introduced rdma_read_gids is used to read the SGID/DGID for the connection which returns GID correctly for RoCE transport as well. In IPv6, rdma_read_gids is also used. The following are why rdma_read_gids is introduced. rdma_addr_get_dgid() for RoCE for client side connections returns MAC address, instead of DGID. rdma_addr_get_sgid() for RoCE doesn't return correct SGID for IPv6 and when more than one IP address is assigned to the netdevice. So the transport agnostic rdma_read_gids() API is provided by rdma_cm module. Signed-off-by: Zhu Yanjun Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit ad8619864f0c9bd89e14d957afa3fd8aaf0720da Author: Linus Walleij Date: Mon Aug 27 00:20:11 2018 +0200 net: dsa: Drop GPIO includes Commit 52638f71fcff ("dsa: Move gpio reset into switch driver") moved the GPIO handling into the switch drivers but forgot to remove the GPIO header includes. Signed-off-by: Linus Walleij Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 30935198b7d0be12b1c45c328b66a7fdefb16256 Author: Haiqing Bai Date: Mon Aug 27 09:32:26 2018 +0800 tipc: fix the big/little endian issue in tipc_dest In function tipc_dest_push, the 32bit variables 'node' and 'port' are stored separately in uppper and lower part of 64bit 'value'. Then this value is assigned to dst->value which is a union like: union { struct { u32 port; u32 node; }; u64 value; } This works on little-endian machines like x86 but fails on big-endian machines. The fix remove the 'value' stack parameter and even the 'value' member of the union in tipc_dest, assign the 'node' and 'port' member directly with the input parameter to avoid the endian issue. Fixes: a80ae5306a73 ("tipc: improve destination linked list") Signed-off-by: Zhenbo Gao Acked-by: Jon Maloy Signed-off-by: Haiqing Bai Signed-off-by: David S. Miller commit ca2b1d2d4271209060a1c9e8e1ffb06fbecc812b Merge: 84581bdae958 b7b4247d5539 Author: David S. Miller Date: Mon Aug 27 15:16:16 2018 -0700 Merge branch 'net-sched-fixes' Jiri Pirko says: ==================== net: sched: couple of small fixes Jiri Pirko (2): net: sched: fix extack error message when chain is failed to be created net: sched: return -ENOENT when trying to remove filter from non-existent chain ==================== Acked-by: Cong Wang Signed-off-by: David S. Miller commit b7b4247d553939ccf02ff597ec60f41a2f93ee8e Author: Jiri Pirko Date: Mon Aug 27 20:58:44 2018 +0200 net: sched: return -ENOENT when trying to remove filter from non-existent chain When chain 0 was implicitly created, removal of non-existent filter from chain 0 gave -ENOENT. Once chain 0 became non-implicit, the same call is giving -EINVAL. Fix this by returning -ENOENT in that case. Reported-by: Roman Mashak Fixes: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation") Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit d5ed72a55bc0a321ef33d272e2b0bf0d2b06d1fe Author: Jiri Pirko Date: Mon Aug 27 20:58:43 2018 +0200 net: sched: fix extack error message when chain is failed to be created Instead "Cannot find" say "Cannot create". Fixes: c35a4acc2985 ("net: sched: cls_api: handle generic cls errors") Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 84581bdae9587023cea1d139523f0ef0f28bd88d Author: Xin Long Date: Mon Aug 27 18:41:32 2018 +0800 erspan: set erspan_ver to 1 by default when adding an erspan dev After erspan_ver is introudced, if erspan_ver is not set in iproute, its value will be left 0 by default. Since Commit 02f99df1875c ("erspan: fix invalid erspan version."), it has broken the traffic due to the version check in erspan_xmit if users are not aware of 'erspan_ver' param, like using an old version of iproute. To fix this compatibility problem, it sets erspan_ver to 1 by default when adding an erspan dev in erspan_setup. Note that we can't do it in ipgre_netlink_parms, as this function is also used by ipgre_changelink. Fixes: 02f99df1875c ("erspan: fix invalid erspan version.") Reported-by: Jianlin Shi Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 834539e69a5fe2aab33cc777ccfd4a4fcc5b9770 Author: Xin Long Date: Mon Aug 27 18:40:18 2018 +0800 sctp: remove useless start_fail from sctp_ht_iter in proc After changing rhashtable_walk_start to return void, start_fail would never be set other value than 0, and the checking for start_fail is pointless, so remove it. Fixes: 97a6ec4ac021 ("rhashtable: Change rhashtable_walk_start to return void") Signed-off-by: Xin Long Acked-by: Neil Horman Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit bab1be79a5169ac748d8292b20c86d874022d7ba Author: Xin Long Date: Mon Aug 27 18:38:31 2018 +0800 sctp: hold transport before accessing its asoc in sctp_transport_get_next As Marcelo noticed, in sctp_transport_get_next, it is iterating over transports but then also accessing the association directly, without checking any refcnts before that, which can cause an use-after-free Read. So fix it by holding transport before accessing the association. With that, sctp_transport_hold calls can be removed in the later places. Fixes: 626d16f50f39 ("sctp: export some apis or variables for sctp_diag and reuse some for proc") Reported-by: syzbot+fe62a0c9aa6a85c6de16@syzkaller.appspotmail.com Signed-off-by: Xin Long Acked-by: Neil Horman Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 46cb52ad414ac829680d0bb8cc7090ac2b577ca7 Author: Linus Walleij Date: Sun Jul 15 22:09:29 2018 +0200 ata: ftide010: Add a quirk for SQ201 The DMA is broken on this specific device for some unknown reason (probably badly designed or plain broken interface electronics) and will only work with PIO. Other users of the same hardware does not have this problem. Add a specific quirk so that this Gemini device gets DMA turned off. Also fix up some code around passing the port information around in probe while we're at it. Signed-off-by: Linus Walleij Signed-off-by: Jens Axboe commit c31d02d1290e1e82a08015199e408228e152991f Author: Thiago Jung Bauermann Date: Tue Jul 24 23:57:25 2018 -0300 selftests: kselftest: Remove outdated comment Commit 3c07aaef6598 ("selftests: kselftest: change KSFT_SKIP=4 instead of KSFT_PASS") reverted commit 11867a77eb85 ("selftests: kselftest framework: change skip exit code to 0") but missed removing the comment which that commit added, so do that now. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Shuah Khan (Samsung OSG) commit 2f4e7db0f7456d8312de88d321b889dbd10c18fd Author: Rex Zhu Date: Thu Aug 23 11:46:13 2018 +0800 drm/amdgpu: Remove duplicated power source update when ac/dc switch, driver will be notified by acpi event. then the power source will be updated. so don't need to get power source when set power state. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit e7603dadd3cc2fa65924d9e8ce0c6f2964866da0 Author: SivapiriyanKumarasamy Date: Wed Aug 15 16:55:18 2018 -0400 drm/amd/display: Fix memory leak caused by missed dc_sink_release [Why] There is currently an intermittent hang from a memory leak in DTN stress testing. It is caused by unfreed memory during driver disable. [How] Do a dc_sink_release in the case that skips it incorrectly. Signed-off-by: SivapiriyanKumarasamy Reviewed-by: Aric Cyr Acked-by: Leo Li Signed-off-by: Alex Deucher commit 4a2de54dc1d7668fa364d8483420ba64b120963b Author: Christian König Date: Fri Aug 24 14:48:02 2018 +0200 drm/amdgpu: fix holding mn_lock while allocating memory We can't hold the mn_lock while allocating memory. Signed-off-by: Christian König Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit 72ef23de207bad349ddc648296f330e176ac175b Author: Rex Zhu Date: Thu Aug 23 15:41:57 2018 +0800 drm/amdgpu: Power on uvd block when hw_fini when hw_fini/suspend, smu only need to power on uvd block if uvd pg is supported, don't need to call uvd to do hw_init. v2: fix typo in patch descriptions and comments. Reviewed-by: Alex Deucher Tested-by: Michel Dänzer Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 2ab4d0e74256fc49b7b270f63c1d1e47c2455abc Author: Rex Zhu Date: Fri Aug 24 16:17:54 2018 +0800 drm/amdgpu: Update power state at the end of smu hw_init. For SI/Kv, the power state is managed by function amdgpu_pm_compute_clocks. when dpm enabled, we should call amdgpu_pm_compute_clocks to update current power state instand of set boot state. this change can fix the oops when kfd driver was enabled on Kv. Reviewed-by: Alex Deucher Tested-by: Michel Dänzer Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 6d39df146ff12fb5c71634ad135144d5423590ec Author: Rex Zhu Date: Thu Aug 23 15:30:45 2018 +0800 drm/amdgpu: Fix vce initialize failed on Kaveri/Mullins Forgot to add vce pg support via smu for Kaveri/Mullins. Fixes: 561a5c83eadd ("drm/amd/pp: Unify powergate_uvd/vce/mmhub to set_powergating_by_smu") v2: refine patch descriptions suggested by Michel Reviewed-by: Alex Deucher Tested-by: Michel Dänzer Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 8ef23364b654d44244400d79988e677e504b21ba Author: Rex Zhu Date: Fri Aug 24 17:26:23 2018 +0800 drm/amdgpu: Enable/disable gfx PG feature in rlc safe mode This is required by gfx hw and can fix the rlc hang when do s3 stree test on Cz/St. Reviewed-by: Alex Deucher Signed-off-by: Hang Zhou Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit fca5d959972c18839f0306f19df2f121623447dd Author: Felix Kuehling Date: Tue Aug 21 17:14:32 2018 -0400 drm/amdgpu: Adjust the VM size based on system memory size v2 Set the VM size based on system memory size between the ASIC-specific limits given by min_vm_size and max_bits. GFXv9 GPUs will keep their default VM size of 256TB (48 bit). Only older GPUs will adjust VM size depending on system memory size. This makes more VM space available for ROCm applications on GFXv8 GPUs that want to map all available VRAM and system memory in their SVM address space. v2: * Clarify comment * Round up memory size before >> 30 * Round up automatic vm_size to power of two Signed-off-by: Felix Kuehling Acked-by: Junwei Zhang Reviewed-by: Huang Rui Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 88bc243a3f22b9938c0b53c577dee28025cdb920 Author: Anders Roxell Date: Fri Aug 24 14:49:41 2018 +0200 selftests: android: move config up a level 'make kselftest-merge' assumes that the config files for the tests are located under the 'main' test dir, like tools/testing/selftests/android/ and not in a subdir to android. Signed-off-by: Anders Roxell Signed-off-by: Shuah Khan (Samsung OSG) commit b0a84beb2e35536839ea289182684528f379b860 Author: Jens Axboe Date: Mon Aug 27 13:32:12 2018 -0600 blk-wbt: remove dead code We already note and mark discard and swap IO from bio_to_wbt_flags(). Signed-off-by: Jens Axboe commit 050cdc6c9501abcd64720b8cc3e7941efee9547d Merge: 908946c4bee7 98c8f125fd8a Author: Linus Torvalds Date: Mon Aug 27 11:59:39 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Pull networking fixes from David Miller: 1) ICE, E1000, IGB, IXGBE, and I40E bug fixes from the Intel folks. 2) Better fix for AB-BA deadlock in packet scheduler code, from Cong Wang. 3) bpf sockmap fixes (zero sized key handling, etc.) from Daniel Borkmann. 4) Send zero IPID in TCP resets and SYN-RECV state ACKs, to prevent attackers using it as a side-channel. From Eric Dumazet. 5) Memory leak in mediatek bluetooth driver, from Gustavo A. R. Silva. 6) Hook up rt->dst.input of ipv6 anycast routes properly, from Hangbin Liu. 7) hns and hns3 bug fixes from Huazhong Tan. 8) Fix RIF leak in mlxsw driver, from Ido Schimmel. 9) iova range check fix in vhost, from Jason Wang. 10) Fix hang in do_tcp_sendpages() with tls, from John Fastabend. 11) More r8152 chips need to disable RX aggregation, from Kai-Heng Feng. 12) Memory exposure in TCA_U32_SEL handling, from Kees Cook. 13) TCP BBR congestion control fixes from Kevin Yang. 14) hv_netvsc, ignore non-PCI devices, from Stephen Hemminger. 15) qed driver fixes from Tomer Tayar. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (77 commits) net: sched: Fix memory exposure from short TCA_U32_SEL qed: fix spelling mistake "comparsion" -> "comparison" vhost: correctly check the iova range when waking virtqueue qlge: Fix netdev features configuration. net: macb: do not disable MDIO bus at open/close time Revert "net: stmmac: fix build failure due to missing COMMON_CLK dependency" net: macb: Fix regression breaking non-MDIO fixed-link PHYs mlxsw: spectrum_switchdev: Do not leak RIFs when removing bridge i40e: fix condition of WARN_ONCE for stat strings i40e: Fix for Tx timeouts when interface is brought up if DCB is enabled ixgbe: fix driver behaviour after issuing VFLR ixgbe: Prevent unsupported configurations with XDP ixgbe: Replace GFP_ATOMIC with GFP_KERNEL igb: Replace mdelay() with msleep() in igb_integrated_phy_loopback() igb: Replace GFP_ATOMIC with GFP_KERNEL in igb_sw_init() igb: Use an advanced ctx descriptor for launchtime e1000: ensure to free old tx/rx rings in set_ringparam() e1000: check on netif_running() before calling e1000_up() ixgb: use dma_zalloc_coherent instead of allocator/memset ice: Trivial formatting fixes ... commit 336d139f8718b1336c9d22f0e462611ae1229850 Author: Masahiro Yamada Date: Mon Aug 27 16:01:41 2018 +0900 mtd: rawnand: denali: do not pass zero maxchips to nand_scan() Commit 49aa76b16676 ("mtd: rawnand: do not execute nand_scan_ident() if maxchips is zero") gave a new meaning for calling nand_scan_ident() with maxchips=0. It is a special usage for some drivers such as docg4, but actually the Denali driver may pass maxchips=0 to nand_scan() when the driver is enabled but no NAND chip is found on the board for some reasons. If nand_scan_with_ids() is called with maxchips=0, nand_scan_ident() is skipped, then nand_set_defaults() is skipped as well. Thus, the driver must set chip->controller beforehand. Otherwise, nand_attach() causes NULL pointer dereference. In fact, the Denali controller knows the number of connected chips before calling nand_scan_ident(); if DEVICE_RESET fails, there is no chip in that chip select. Then, denali_reset_banks() sets the maxchips to the number of detected chips. If no chip is found, maxchips is zero. In this case, there is no point for calling nand_scan() because we know it will fail for sure. Let's make the probe function fail immediately. Fixes: 49aa76b16676 ("mtd: rawnand: do not execute nand_scan_ident() if maxchips is zero") Signed-off-by: Masahiro Yamada Acked-by: Miquel Raynal Signed-off-by: Boris Brezillon commit b2d7a075a1ccef2fb321d595802190c8e9b39004 Author: Juergen Gross Date: Tue Aug 21 17:37:55 2018 +0200 x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear Using only 32-bit writes for the pte will result in an intermediate L1TF vulnerable PTE. When running as a Xen PV guest this will at once switch the guest to shadow mode resulting in a loss of performance. Use arch_atomic64_xchg() instead which will perform the requested operation atomically with all 64 bits. Some performance considerations according to: https://software.intel.com/sites/default/files/managed/ad/dc/Intel-Xeon-Scalable-Processor-throughput-latency.pdf The main number should be the latency, as there is no tight loop around native_ptep_get_and_clear(). "lock cmpxchg8b" has a latency of 20 cycles, while "lock xchg" (with a memory operand) isn't mentioned in that document. "lock xadd" (with xadd having 3 cycles less latency than xchg) has a latency of 11, so we can assume a latency of 14 for "lock xchg". Signed-off-by: Juergen Gross Reviewed-by: Thomas Gleixner Reviewed-by: Jan Beulich Tested-by: Jason Andryuk Signed-off-by: Boris Ostrovsky commit 849c70dacb169da751b171c7d230206a72cf7391 Author: Todd Poynor Date: Thu Aug 9 20:20:56 2018 -0700 MAINTAINERS: Switch a maintainer for drivers/staging/gasket Todd Poynor takes over for John Joseph. Signed-off-by: John Joseph Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 057d3ccf93a437080c4138cd6d74c4d7cf332131 Merge: 38cfb5a45ee0 6f2f39ad1a54 Author: Jens Axboe Date: Mon Aug 27 11:27:32 2018 -0600 Merge branch 'stable/for-jens-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-linus Pull Xen block driver fixes from Konrad: "Fix for flushing out persistent pages at a deterministic rate" * 'stable/for-jens-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/blkback: remove unused pers_gnts_lock from struct xen_blkif_ring xen/blkback: move persistent grants flags to bool xen/blkfront: reorder tests in xlblk_init() xen/blkfront: cleanup stale persistent grants xen/blkback: don't keep persistent grants too long commit 38cfb5a45ee013bfab5d1ae4c4738815e744b440 Author: Jens Axboe Date: Sun Aug 26 10:10:05 2018 -0600 blk-wbt: improve waking of tasks We have two potential issues: 1) After commit 2887e41b910b, we only wake one process at the time when we finish an IO. We really want to wake up as many tasks as can queue IO. Before this commit, we woke up everyone, which could cause a thundering herd issue. 2) A task can potentially consume two wakeups, causing us to (in practice) miss a wakeup. Fix both by providing our own wakeup function, which stops __wake_up_common() from waking up more tasks if we fail to get a queueing token. With the strict ordering we have on the wait list, this wakes the right tasks and the right amount of tasks. Based on a patch from Jianchao Wang . Tested-by: Agarwal, Anchal Signed-off-by: Jens Axboe commit 061a5427530633de93ace4ef001b99961984af62 Author: Jens Axboe Date: Sun Aug 26 10:09:06 2018 -0600 blk-wbt: abstract out end IO completion handler Prep patch for calling the handler from a different context, no functional changes in this patch. Tested-by: Agarwal, Anchal Signed-off-by: Jens Axboe commit b9eb3b14f1dbf16bf27b6c1ffe6b8c00ec945c9b Author: Dan Carpenter Date: Mon Aug 27 12:23:01 2018 +0300 scsi: aacraid: fix a signedness bug The problem is that ->reset_state is a u8 but it can be set to -1 or -2 in aac_tmf_callback() and the error handling in aac_eh_target_reset() relies on it to be signed. [mkp: fixed typo] Fixes: 0d643ff3c353 ("scsi: aacraid: use aac_tmf_callback for reset fib") Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit d772a65d8a6c45c376a8200a38f7f82fb480af6a Author: Ming Lei Date: Mon Aug 27 15:24:43 2018 +0800 Revert "scsi: core: avoid host-wide host_busy counter for scsi_mq" This reverts commit 328728630d9f2bf14b82ca30b5e47489beefe361. There is fundamental issue in commit 328728630d9f2bf1 (scsi: core: avoid host-wide host_busy counter for scsi_mq) because SCSI's host busy counter may not be same with counter of blk-mq's inflight tags, especially in case of none io scheduler. We may switch to other approach for addressing this scsi_mq's performance issue, such as percpu counter or kind of ways, so revert this commit first for fixing this kind of issue in EH path, as reported by Jens. Cc: Omar Sandoval , Cc: "Martin K. Petersen" , Cc: James Bottomley , Cc: Christoph Hellwig , Cc: Don Brace Cc: Kashyap Desai Cc: Mike Snitzer Cc: Hannes Reinecke Cc: Laurence Oberman Cc: Bart Van Assche Cc: Jens Axboe Reported-by: Jens Axboe Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen commit f45b8934b90b1d0017d33f8529941ec5020e9e0e Author: Arnd Bergmann Date: Mon Aug 13 23:20:33 2018 +0200 staging: wilc1000: revert "fix TODO to compile spi and sdio components in single module" The TODO item named "make spi and sdio components coexist in one build" was apparently addressed a long time ago, but never removed from the TODO file. However, the new patch that tries to address it actually makes it worse again by duplicating the common parts of the driver into two separate modules rather than sharing them. This also introduces a build regression when one of the two is built-in while the other is a loadable module: drivers/staging/wilc1000/wilc_debugfs.o:(.data+0x10): undefined reference to `__this_module' Reverting the patch makes it build again. I'm leaving the TODO file modification though, as there is nothing left to do for this item. A related problem however still seems to exist: one still cannot have multiple concurrent instances of wilc1000 devices present in the system, as there are lots of shared global variables such as host_interface.c:static struct wilc_vif *periodic_rssi_vif; wilc_sdio.c:static struct wilc_sdio g_sdio; wilc_wlan.c:static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP; wilc_wlan.c:static u32 pending_acks; wilc_wfi_cfgoperations.c:int wilc_connecting; In order to have multiple instances working (sdio, spi, or mixed), all such variables need to be dynamically allocated per instance and stored in 'struct wilc' or one of the structures referenced by it. Fixes: 9abc44ba4e2f ("staging: wilc1000: fix TODO to compile spi and sdio components in single module") Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 23aa8e69f2c6ceb0bdca52f4450ad1f45675ca73 Author: Ming Lei Date: Mon Aug 27 15:24:42 2018 +0800 Revert "scsi: core: fix scsi_host_queue_ready" This reverts commit 265d59aacbce7e50bdc1f5d25033c38dd70b3767. There is fundamental issue in commit 328728630d9f2bf1 (scsi: core: avoid host-wide host_busy counter for scsi_mq) because SCSI's host busy counter may not be same with counter of blk-mq's inflight tags, especially in case of none io scheduler. So revert this commit first. Cc: Omar Sandoval , Cc: "Martin K. Petersen" , Cc: James Bottomley , Cc: Christoph Hellwig , Cc: Don Brace Cc: Kashyap Desai Cc: Mike Snitzer Cc: Hannes Reinecke Cc: Laurence Oberman Cc: Bart Van Assche Cc: Guenter Roeck Cc: Jens Axboe Reported-by: Jens Axboe Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen commit 4e8065aa6c6f50765290be27ab8a64a4e44cb009 Author: Geert Uytterhoeven Date: Thu Aug 23 23:23:06 2018 +0200 scsi: libata: Add missing newline at end of file With gcc 4.1.2: drivers/ata/libata-core.c:7396:33: warning: no newline at end of file Fixes: 2fa4a32613c9182b ("scsi: libsas: dynamically allocate and free ata host") Signed-off-by: Geert Uytterhoeven Signed-off-by: Martin K. Petersen commit cedefa8544c6be216b4710575065e3a11065f8d0 Author: Varun Prakash Date: Sat Aug 11 21:10:29 2018 +0530 scsi: target: iscsi: cxgbit: use pr_debug() instead of pr_info() DDP programming happens in data path and it can fail because of lack of resources so use pr_debug() instead of pr_info() for this case. Signed-off-by: Varun Prakash Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit eb53a3ea3e009578a388f106620b22b1707cf2f6 Author: Martin Wilck Date: Wed Aug 22 13:25:44 2018 +0200 scsi: hpsa: limit transfer length to 1MB, not 512kB e2c7b43 was supposed to limit transfer length to 1MB, but got the unit of max_sectors wrong. Fixes: e2c7b433f729 ("scsi: hpsa: limit transfer length to 1MB") Signed-off-by: Martin Wilck Signed-off-by: Martin K. Petersen commit 53e13ee087a80e8d4fc95436318436e5c2c1f8c2 Author: James Smart Date: Thu Aug 16 16:04:05 2018 -0700 scsi: lpfc: Correct MDS diag and nvmet configuration A recent change added some MDS processing in the lpfc_drain_txq routine that relies on the fcp_wq being allocated. For nvmet operation the fcp_wq is not allocated because it can only be an nvme-target. When the original MDS support was added LS_MDS_LOOPBACK was defined wrong, (0x16) it should have been 0x10 (decimal value used for hex setting). This incorrect value allowed MDS_LOOPBACK to be set simultaneously with LS_NPIV_FAB_SUPPORTED, causing the driver to crash when it accesses the non-existent fcp_wq. Correct the bad value setting for LS_MDS_LOOPBACK. Fixes: ae9e28f36a6c ("lpfc: Add MDS Diagnostic support.") Cc: # v4.12+ Signed-off-by: Dick Kennedy Signed-off-by: James Smart Tested-by: Ewan D. Milne Signed-off-by: Martin K. Petersen commit 9abd9990e9779dc9c548c3599aaca7e3505ab19d Author: James Smart Date: Tue Aug 14 12:55:05 2018 -0700 scsi: lpfc: Default fdmi_on to on Change default behavior for fdmi registration to on. [mkp: patch was mangled] Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 68bdc630721c40e908d22cffe07b5ca225a69f6e Author: Varun Prakash Date: Sat Aug 11 21:14:08 2018 +0530 scsi: csiostor: fix incorrect port capabilities - use be32_to_cpu() instead of ntohs() for 32 bit port capabilities. - add a new function fwcaps32_to_caps16() to convert 32 bit port capabilities to 16 bit port capabilities. Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen commit 89809b028b6f54187b7d81a0c69b35d394c52e62 Author: Varun Prakash Date: Sat Aug 11 21:03:58 2018 +0530 scsi: csiostor: add a check for NULL pointer after kmalloc() Reported-by: Colin Ian King Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen commit a7ccd92c8d2ac4eb168b621e086be2dc9b8344f6 Author: John Pittman Date: Thu Aug 23 15:49:18 2018 -0400 scsi: documentation: add scsi_mod.use_blk_mq to scsi-parameters Kernel line argument scsi_mod.use_blk_mq is missing from file Documentation/scsi/scsi-parameters.txt. Add this option, providing mention of config setting and format. [mkp: clarified where to look] Signed-off-by: John Pittman Signed-off-by: Martin K. Petersen commit 3fba68fa35a2cbda157c6f49f26eefccb2e10043 Author: Geert Uytterhoeven Date: Tue Aug 21 13:44:07 2018 +0200 scsi: core: Update SCSI_MQ_DEFAULT help text to match default The default was changed, but the help text was not updated. Fix grammar (s/the option/this option/) while at it. [mkp: drop "new" as suggested by John Garry] Fixes: d5038a13eca72fb2 ("scsi: core: switch to scsi-mq by default") Signed-off-by: Geert Uytterhoeven Reviewed-by: Ming Lei Signed-off-by: Martin K. Petersen commit 6f2f39ad1a54978394851c05e327419ebeb7227e Author: Juergen Gross Date: Mon Aug 13 16:01:14 2018 +0200 xen/blkback: remove unused pers_gnts_lock from struct xen_blkif_ring pers_gnts_lock isn't being used anywhere. Remove it. Signed-off-by: Juergen Gross Reviewed-by: Roger Pau Monné Signed-off-by: Konrad Rzeszutek Wilk commit d77ff24e7fa2258877fa0b87efa06b9a58a37aab Author: Juergen Gross Date: Mon Aug 13 16:01:13 2018 +0200 xen/blkback: move persistent grants flags to bool The struct persistent_gnt flags member is meant to be a bitfield of different flags. There is only PERSISTENT_GNT_ACTIVE flag left, so convert it to a bool named "active". Signed-off-by: Juergen Gross Reviewed-by: Roger Pau Monné Signed-off-by: Konrad Rzeszutek Wilk commit 4bcddbae019df2614ea36976ba3d36313f93c6d3 Author: Juergen Gross Date: Mon Aug 13 16:01:12 2018 +0200 xen/blkfront: reorder tests in xlblk_init() In case we don't want pv block devices we should not test parameters for sanity and eventually print out error messages. So test precluding conditions before checking parameters. Signed-off-by: Juergen Gross Reviewed-by: Roger Pau Monné Signed-off-by: Konrad Rzeszutek Wilk commit a46b53672b2c2e3770b38a4abf90d16364d2584b Author: Juergen Gross Date: Mon Aug 13 16:01:11 2018 +0200 xen/blkfront: cleanup stale persistent grants Add a periodic cleanup function to remove old persistent grants which are no longer in use on the backend side. This avoids starvation in case there are lots of persistent grants for a device which no longer is involved in I/O business. Signed-off-by: Juergen Gross Reviewed-by: Roger Pau Monné Signed-off-by: Konrad Rzeszutek Wilk commit 973e5405f2f67ddbb2bf07b3ffc71908a37fea8e Author: Juergen Gross Date: Mon Aug 13 16:01:10 2018 +0200 xen/blkback: don't keep persistent grants too long Persistent grants are allocated until a threshold per ring is being reached. Those grants won't be freed until the ring is being destroyed meaning there will be resources kept busy which might no longer be used. Instead of freeing only persistent grants until the threshold is reached add a timestamp and remove all persistent grants not having been in use for a minute. Signed-off-by: Juergen Gross Reviewed-by: Roger Pau Monné Signed-off-by: Konrad Rzeszutek Wilk commit c27d0e9045bbbabffdde2bdba74e9971c4194ac4 Author: Vineet Gupta Date: Thu Aug 16 10:20:33 2018 -0700 ARC: sort Kconfig Signed-off-by: Vineet Gupta commit 1e3bece2ded71eb85ac297a43002a942964e381d Author: Eugeniy Paltsev Date: Mon Aug 6 19:44:23 2018 +0300 ARC: cleanup show_faulting_vma() - Remove unused variables - check return value of file_path Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta commit c83532fb0fe053d2e43e9387354cb1b52ba26427 Author: Alexey Brodkin Date: Thu Aug 2 11:50:16 2018 +0300 ARC: [plat-axs*]: Enable SWAP SWAP support on ARC was fixed earlier by commit 6e3761145a9b ("ARC: Fix CONFIG_SWAP") so now we may safely enable it on platforms that have external media like USB and SD-card. Note: it was already allowed for HSDK Signed-off-by: Alexey Brodkin Cc: stable@vger.kernel.org # 6e3761145a9b: ARC: Fix CONFIG_SWAP Signed-off-by: Vineet Gupta commit 5c0920897af59779546e9ea0e89c5db45c8aff33 Author: Alexey Brodkin Date: Thu Aug 2 13:19:37 2018 +0300 ARC: [plat-axs*/plat-hsdk]: Allow U-Boot to pass MAC-address to the kernel Otherwise kernel uses random MAC which is not very conveniet. With that change in place use might set desired MAC in U-Boot with "setenv ethaddr 11:22:33:44:55:66", save environment and then from boot to boot the same MAC will be used by the kernel. One other note for this to happen it's required to pass board's .dtb in U-Boot's "bootm" command like that: ------------------->8----------------- bootm 0x82000000 - 0x84000000 ------------------->8----------------- Here 0x82000000 is location of uImage while 0x80000000 is location of either axs10x.dtb or hsdk.dtb previously loaded from SD-card, USB storage or TFTP server. Signed-off-by: Alexey Brodkin Cc: Rob Herring Cc: stable@vger.kernel.org # 4.14 Cc: devicetree@vger.kernel.org Signed-off-by: Vineet Gupta commit 4051c323c59b535cfb7dc10b349544b4ad49c21e Author: Alexey Brodkin Date: Thu Aug 2 11:41:07 2018 +0300 ARC: configs: cleanup - Remove CONFIG_DEFAULT_HOSTNAME from defconfigs There's no reason to set the same hostname to all ARC boards by default. It usually gets overwritten by init scripts anyways. - Remove disabled CONFIG_DEVKMEM from defconfigs It is disabled by default Signed-off-by: Alexey Brodkin Signed-off-by: Vineet Gupta commit 908946c4bee705542f38bc06c0203a6d83e3700c Author: Jens Axboe Date: Mon Aug 27 08:37:46 2018 -0600 Fix up libata MAINTAINERS entry The email was botched in one entry, and I also forgot to update the location of the git tree. It'll be under the linux-block umbrella, just with different branches. Reported-by: Baruch Siach Fixes: 7634ccd2da97 ("libata: maintainership update") Signed-off-by: Jens Axboe Signed-off-by: Linus Torvalds commit f7c90c2aa4004808dff777ba6ae2c7294dd06851 Author: Juergen Gross Date: Tue Aug 21 17:37:54 2018 +0200 x86/xen: don't write ptes directly in 32-bit PV guests In some cases 32-bit PAE PV guests still write PTEs directly instead of using hypercalls. This is especially bad when clearing a PTE as this is done via 32-bit writes which will produce intermediate L1TF attackable PTEs. Change the code to use hypercalls instead. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: Boris Ostrovsky commit 4d982e25d0bdc83d8c64e66fdeca0b89240b3b85 Author: Theodore Ts'o Date: Mon Aug 27 09:22:45 2018 -0400 ext4: avoid divide by zero fault when deleting corrupted inline directories A specially crafted file system can trick empty_inline_dir() into reading past the last valid entry in a inline directory, and then run into the end of xattr marker. This will trigger a divide by zero fault. Fix this by using the size of the inline directory instead of dir->i_size. Also clean up error reporting in __ext4_check_dir_entry so that the message is clearer and more understandable --- and avoids the division by zero trap if the size passed in is zero. (I'm not sure why we coded it that way in the first place; printing offset % size is actually more confusing and less useful.) https://bugzilla.kernel.org/show_bug.cgi?id=200933 Signed-off-by: Theodore Ts'o Reported-by: Wen Xu Cc: stable@vger.kernel.org commit 5dfdd24eb3d39d815bc952ae98128e967c9bba49 Author: Johan Hovold Date: Tue Aug 21 11:59:53 2018 +0200 USB: serial: ti_usb_3410_5052: fix array underflow in completion handler Similarly to a recently reported bug in io_ti, a malicious USB device could set port_number to a negative value and we would underflow the port array in the interrupt completion handler. As these devices only have one or two ports, fix this by making sure we only consider the seventh bit when determining the port number (and ignore bits 0xb0 which are typically set to 0x30). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Signed-off-by: Johan Hovold commit 691a03cfe8ca483f9c48153b869d354e4ae3abef Author: Johan Hovold Date: Tue Aug 21 11:59:52 2018 +0200 USB: serial: io_ti: fix array underflow in completion handler As reported by Dan Carpenter, a malicious USB device could set port_number to a negative value and we would underflow the port array in the interrupt completion handler. As these devices only have one or two ports, fix this by making sure we only consider the seventh bit when determining the port number (and ignore bits 0xb0 which are typically set to 0x30). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Reported-by: Dan Carpenter Signed-off-by: Johan Hovold commit e3a5dc08715abba646324fd8456282bd77798e9c Author: Nikolas Nyby Date: Sat Aug 25 19:10:54 2018 -0400 x86/Kconfig: Fix trivial typo Fix a typo in the Kconfig help text: adverticed -> advertised. Signed-off-by: Nikolas Nyby Signed-off-by: Thomas Gleixner Cc: trivial@kernel.org Cc: tglx@linutronix.de Cc: x86@kernel.org Link: https://lkml.kernel.org/r/20180825231054.23813-1-nikolas@gnu.org commit cc51e5428ea54f575d49cfcede1d4cb3a72b4ec4 Author: Andi Kleen Date: Fri Aug 24 10:03:50 2018 -0700 x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+ On Nehalem and newer core CPUs the CPU cache internally uses 44 bits physical address space. The L1TF workaround is limited by this internal cache address width, and needs to have one bit free there for the mitigation to work. Older client systems report only 36bit physical address space so the range check decides that L1TF is not mitigated for a 36bit phys/32GB system with some memory holes. But since these actually have the larger internal cache width this warning is bogus because it would only really be needed if the system had more than 43bits of memory. Add a new internal x86_cache_bits field. Normally it is the same as the physical bits field reported by CPUID, but for Nehalem and newerforce it to be at least 44bits. Change the L1TF memory size warning to use the new cache_bits field to avoid bogus warnings and remove the bogus comment about memory size. Fixes: 17dbca119312 ("x86/speculation/l1tf: Add sysfs reporting for l1tf") Reported-by: George Anchev Reported-by: Christopher Snowhill Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Cc: Michael Hocko Cc: vbabka@suse.cz Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180824170351.34874-1-andi@firstfloor.org commit 1ab534e85c93945f7862378d8c8adcf408205b19 Author: Andi Kleen Date: Fri Aug 24 10:03:51 2018 -0700 x86/spectre: Add missing family 6 check to microcode check The check for Spectre microcodes does not check for family 6, only the model numbers. Add a family 6 check to avoid ambiguity with other families. Fixes: a5b296636453 ("x86/cpufeature: Blacklist SPEC_CTRL/PRED_CMD on early Spectre v2 microcodes") Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180824170351.34874-2-andi@firstfloor.org commit 166cd4421b0dabd2e438f5384f4ecf930dc8ab08 Author: Geert Uytterhoeven Date: Thu Aug 23 23:43:45 2018 +0200 mtd: rawnand: docg4: Remove wrong __init annotations If gcc (e.g. 4.1.2) decides not to inline init_mtd_structs() and read_id_reg(), this will cause section mismatches, and crashes: WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc10): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:init_mtd_structs() The function docg4_attach_chip() references the function __init init_mtd_structs(). This is often because docg4_attach_chip lacks a __init annotation or the annotation of init_mtd_structs is wrong. WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc3e): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:read_id_reg() The function docg4_attach_chip() references the function __init read_id_reg(). This is often because docg4_attach_chip lacks a __init annotation or the annotation of read_id_reg is wrong. Fix this by dropping the now incorrect __init annotations from init_mtd_structs() and read_id_reg(). Fixes: 66a38478dcc5b5a3 ("mtd: rawnand: docg4: convert driver to nand_scan()") Signed-off-by: Geert Uytterhoeven Signed-off-by: Boris Brezillon commit d177c8b61d6b4ef360b1c2682e4d8e3bae01738b Author: Icenowy Zheng Date: Thu Jul 26 12:48:05 2018 +0800 arm64: allwinner: dts: h6: fix Pine H64 MMC bus width Currently the enabled MMC controllers on Pine H64 do not have bus-width set, which make them fall back to 1-bit mode and become quite slow. Fix this by add the corresponding bus-width properties. Fixes: ecbd611882a1 ("arm64: allwinner: h6: enable MMC0/2 on Pine H64") Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit b9543a2e39dc909e6b7ec901b6c7208d01d5c0dd Author: Fabio Estevam Date: Fri Jul 20 17:39:21 2018 -0300 ARM: imx_v6_v7_defconfig: Select CONFIG_DRM_PANEL_SEIKO_43WVF1G imx6sl-evk, imx6sll-evk and imx6sx-sdb boards use a Seiko 43WVF1G panel. Now that the DRM mxsfb driver is the one selected by default, let's also select CONFIG_DRM_PANEL_SEIKO_43WVF1G so that these boards continue to have a working display by default. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0ffbc2824282793a3ebf04d4804dea15d5b211c6 Author: Fabio Estevam Date: Fri Jul 20 17:39:20 2018 -0300 ARM: mxs_defconfig: Select CONFIG_DRM_PANEL_SEIKO_43WVF1G imx23-evk and imx28-evk boards use a Seiko 43WVF1G panel. Now that the DRM mxsfb driver is the one selected by default, let's also select CONFIG_DRM_PANEL_SEIKO_43WVF1G so that these boards continue to have a working display by default. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 549644b8c3c125355a361def1e42f8319ac6ad6c Author: Fabio Estevam Date: Fri Jul 20 17:39:19 2018 -0300 ARM: dts: imx23-evk: Convert to the new display bindings imx23-evk board has a Seiko 43WVF1G parallel display. Instead of hardcoding the display timings in the device tree, use the "sii,43wvf1g" compatible instead. This aligns with the new mxsfb bindings scheme documented at: Documentation/devicetree/bindings/display/mxsfb.txt Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit cde305e9ce28d96d7f63e4fb5298291e90a91f8f Author: Fabio Estevam Date: Fri Jul 20 17:39:18 2018 -0300 ARM: dts: imx23-evk: Move regulators outside simple-bus It is recommended to place regulators outside simple-bus, so move them accordingly. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit c1539840fc25d89f3fe51038144dc0233b333453 Author: Fabio Estevam Date: Fri Jul 20 17:39:17 2018 -0300 ARM: dts: imx28-evk: Convert to the new display bindings imx28-evk board has a Seiko 43WVF1G parallel display. Instead of hardcoding the display timings in the device tree, use the "sii,43wvf1g" compatible instead. This aligns with the new mxsfb bindings scheme documented at: Documentation/devicetree/bindings/display/mxsfb.txt Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 90a96087b5fa835790a54c588184adfc867dbc12 Author: Fabio Estevam Date: Fri Jul 20 17:39:16 2018 -0300 ARM: dts: imx28-evk: Move regulators outside simple-bus It is recommended to place regulators outside simple-bus, so move them accordingly. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 538d6e9d597584e80514698e24321645debde78f Author: Leonard Crestez Date: Tue Jul 24 19:14:19 2018 +0300 Revert "ARM: dts: imx7d: Invert legacy PCI irq mapping" This reverts commit 1c86c9dd82f859b474474a7fee0d5195da2c9c1d. That commit followed the reference manual but unfortunately the imx7d manual is incorrect. Tested with ath9k pcie card and confirmed internally. Signed-off-by: Leonard Crestez Acked-by: Lucas Stach Fixes: 1c86c9dd82f8 ("ARM: dts: imx7d: Invert legacy PCI irq mapping") Signed-off-by: Shawn Guo commit b50282f3241acee880514212d88b6049fb5039c8 Author: Theodore Ts'o Date: Mon Aug 27 01:47:09 2018 -0400 ext4: check to make sure the rename(2)'s destination is not freed If the destination of the rename(2) system call exists, the inode's link count (i_nlinks) must be non-zero. If it is, the inode can end up on the orphan list prematurely, leading to all sorts of hilarity, including a use-after-free. https://bugzilla.kernel.org/show_bug.cgi?id=200931 Signed-off-by: Theodore Ts'o Reported-by: Wen Xu Cc: stable@vger.kernel.org commit 111b009f7e8bcdfc8d565b1f0e3ee5072bb7490b Author: Huang Shijie Date: Wed Aug 22 10:40:27 2018 +0800 dmaengine: mic_x100_dma: use devm_kzalloc to fix an issue The following patch introduced an issue. commit f6206f00d8c5 ("dmaengine: mic_x100_dma: use the new helper to simplify the code") This issue is : kfree(mic_dma_dev) ..... dma_async_device_unregister(mic_dma_dev->device); Free the memory, and use it again. So use devm_kzalloc to allocate mic_dma_dev to fix it. When the Devres try to release the resources, it will call release at the following order: dma_async_device_unregister(mic_dma_dev->device); ..... kfree(mic_dma_dev) Fixes: f6206f00d8c5 ("dmaengine: mic_x100_dma: use the new helper to simplify the code") Signed-off-by: Huang Shijie Signed-off-by: Vinod Koul commit 072ebb3bffe67d71d1f1e52add799f4491eab691 Author: Theodore Ts'o Date: Mon Aug 27 01:15:11 2018 -0400 ext4: add nonstring annotations to ext4.h This suppresses some false positives in gcc 8's -Wstringop-truncation Suggested by Miguel Ojeda (hopefully the __nonstring definition will eventually get accepted in the compiler-gcc.h header file). Signed-off-by: Theodore Ts'o Cc: Miguel Ojeda commit 8d6ccf5cebbc7ed1dee9986e36853a78dfb64084 Author: Sanyog Kale Date: Fri Jul 27 14:44:10 2018 +0530 soundwire: Fix acquiring bus lock twice during master release As part of sdw_stream_remove_master(), sdw_stream_remove_slave() is called which results in bus lock being acquired twice. So, fix it by performing specific Slave remove operations in sdw_release_master_stream() instead of calling sdw_stream_remove_slave(). Signed-off-by: Sanyog Kale Signed-off-by: Shreyas NC Acked-by: Pierre-Louis Bossart Signed-off-by: Vinod Koul commit 3fef1a2259c556cce34df2791688cb3001f81c92 Author: Shreyas NC Date: Fri Jul 27 14:44:09 2018 +0530 soundwire: Fix incorrect exit after configuring stream In sdw_stream_add_master() after the Master ports are configured, the stream is released incorrectly. So, fix it by avoiding stream release after configuring the Master for the stream. While at it, rename the label appropriately. Signed-off-by: Shreyas NC Acked-by: Pierre-Louis Bossart Signed-off-by: Vinod Koul commit 0aebe40bae6cf5652fdc3d05ecee15fbf5748194 Author: Shreyas NC Date: Fri Jul 27 14:44:08 2018 +0530 soundwire: Fix duplicate stream state assignment For a SoundWire stream it is expected that a Slave is added to the stream before Master is added. So, move the stream state to CONFIGURED after the first Slave is added and remove the stream state assignment for Master add. Along with these changes, add additional comments to explain the same. Signed-off-by: Shreyas NC Acked-by: Pierre-Louis Bossart Signed-off-by: Vinod Koul commit 08bcbed747eb87f00d2e2590b49607af1a9f4fe9 Author: Stu Hsieh Date: Thu Aug 9 10:15:49 2018 +0800 drm/mediatek: fix connection from RDMA2 to DSI1 This patch fix connection from RDMA2 to DSI1 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit f265905c939e21a0c9e83540d4c2776c3e43c310 Author: Stu Hsieh Date: Thu Aug 9 10:15:48 2018 +0800 drm/mediatek: update some variable name from ovl to comp This patch update some variable name from ovl to comp Because RDMA would be first HW in ddp, the naming ovl should be change to comp. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 66b2cf9623facfad790b335fcfd717258a00896b Author: Stu Hsieh Date: Thu Aug 9 10:15:47 2018 +0800 drm/mediatek: use layer_nr function to get layer number to init plane This patch use layer_nr function to get layer number to init plane When plane init in crtc create, it use the number of OVL layer to init plane. That's OVL can read 4 memory address. For mt2712 third ddp, it use RDMA to read memory. RDMA can read 1 memory address, so it just init one plane. For compatibility, this patch use mtk_ddp_comp_layer_nr function to get layer number from their HW component in ddp for plane init. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 98b6d76f957ba80017a3118fe0e33030b4bc017b Author: Stu Hsieh Date: Thu Aug 9 10:15:46 2018 +0800 drm/mediatek: add function to return RDMA layer number This patch add function to return RDMA layer number RDMA always has one layer. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 1cbcb763ea5035e7ef01010ea68eb3b5143ad7cb Author: Stu Hsieh Date: Thu Aug 9 10:15:45 2018 +0800 drm/mediatek: add function to return OVL layer number This patch add function to return OVL layer number For now, MT8173, MT2712, MT2701 OVL all has 4 layer. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 650afd49572b56a5c58134d4acfeb77acc69d622 Author: Stu Hsieh Date: Thu Aug 9 10:15:44 2018 +0800 drm/mediatek: add function to get layer number for component This patch add function to get layer number for component Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 94420a63cf784945061b7b5f38511b7a48f034eb Author: Stu Hsieh Date: Thu Aug 9 10:15:43 2018 +0800 drm/mediatek: add YUYV/UYVY color format support for RDMA This patch add YUYV/UYVY color format support for RDMA and transform matrix for YUYV/UYVY. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 55b53f6f7ccf0990ad83acf4fdb0436ff79fdfb6 Author: Stu Hsieh Date: Thu Aug 9 10:15:42 2018 +0800 drm/mediatek: add the comment about color format setting for OVL This patch add the comment about color format setting for OVL Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit b428391ed6bd5e3cb8ea9d1738ef4bd16af6cdb2 Author: Stu Hsieh Date: Thu Aug 9 10:15:41 2018 +0800 drm/mediatek: add RGB color format support for RDMA This patch add RGB color format support for RDMA, including RGB565, RGB888, RGBA8888 and ARGB8888. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 182add0b1b9170a1f8f2a049fe2e298222cf405a Author: Stu Hsieh Date: Thu Aug 9 10:15:40 2018 +0800 drm/mediatek: add memory mode and layer_config for RDMA This patch add memory mode for RDMA and layer_config for RDMA If use RDMA to read data from memory, it should set memory mode to RDMA Layer config set the data address and pitch to RDMA from plane setting. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 85186efc2a5975801cd4ba03a9143305e474b645 Author: Stu Hsieh Date: Thu Aug 9 10:15:39 2018 +0800 drm/mediatek: add connection from RDMA2 to DSI0 This patch add connection from RDMA2 to DSI0 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 0a14785ee32ad40458657edaf1025f71ebbc1147 Author: Stu Hsieh Date: Thu Aug 9 10:15:38 2018 +0800 drm/mediatek: add connection from RDMA1 to DSI0 This patch add connection from RDMA1 to DSI0 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 48d25d243bfb20a7230e9f226c560b71d989d962 Author: Stu Hsieh Date: Thu Aug 9 10:15:37 2018 +0800 drm/mediatek: add connection from RDMA0 to DSI1 This patch add connection from RDMA0 to DSI1 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 29d32e466e98e03378878e95339334971d0fdaf4 Author: Stu Hsieh Date: Thu Aug 9 10:15:36 2018 +0800 drm/mediatek: add connection from RDMA0 to DPI1 This patch add connection from RDMA0 to DPI1 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 8272806d21bf2a7fd74602cc7bade7d12f73ac4b Author: Thomas Zimmermann Date: Tue Jul 17 10:35:18 2018 +0200 drm/mediatek: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Reviewed-by: Philipp Zabel Signed-off-by: CK Hu commit 2b7bd20d5605e0314d677ea21b462543e73e466c Author: Souptick Joarder Date: Sat Jul 28 19:08:45 2018 +0530 drm/mediatek: Convert drm_atomic_helper_suspend/resume() convert drm_atomic_helper_suspend/resume() to use drm_mode_config_helper_suspend/resume(). Signed-off-by: Souptick Joarder Signed-off-by: Ajit Negi Signed-off-by: CK Hu commit c7c09dc187f0323ad40b5b6c57a6db673a386a7f Author: Tobias Klauser Date: Fri Aug 24 11:29:27 2018 +0800 nios2: kconfig: remove duplicate DEBUG_STACK_USAGE symbol defintions DEBUG_STACK_USAGE is already defined in lib/Kconfig.debug Signed-off-by: Tobias Klauser Signed-off-by: Ley Foon Tan commit d49dbfade96d5b0863ca8a90122a805edd5ef50a Author: Gustavo A. R. Silva Date: Wed Aug 15 08:14:37 2018 -0500 hwmon: (nct6775) Fix potential Spectre v1 val can be indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: vers/hwmon/nct6775.c:2698 store_pwm_weight_temp_sel() warn: potential spectre issue 'data->temp_src' [r] Fix this by sanitizing val before using it to index data->temp_src Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Signed-off-by: Guenter Roeck commit f196dec6d50abb2e65fb54a0621b2f1b4d922995 Author: Dan Carpenter Date: Tue Aug 14 13:07:47 2018 +0300 hwmon: (adt7475) Make adt7475_read_word() return errors The adt7475_read_word() function was meant to return negative error codes on failure. Signed-off-by: Dan Carpenter Reviewed-by: Tokunori Ikegami Signed-off-by: Guenter Roeck commit 9d19371df50a73301aec66a479b490587e889055 Author: Dan Carpenter Date: Tue Aug 14 12:12:36 2018 +0300 hwmon: (adt7475) Potential error pointer dereferences The adt7475_update_device() function returns error pointers. The problem is that in show_pwmfreq() we dereference it before the check. And then in pwm_use_point2_pwm_at_crit_show() there isn't a check at all. I don't know if it's required, but it silences a static checker warning and it's doesn't hurt anything to check. Signed-off-by: Dan Carpenter Reviewed-by: Tokunori Ikegami Signed-off-by: Guenter Roeck commit 3ad867001c91657c46dcf6656d52eb6080286fd5 Author: Lothar Felten Date: Tue Aug 14 09:09:37 2018 +0200 hwmon: (ina2xx) fix sysfs shunt resistor read access fix the sysfs shunt resistor read access: return the shunt resistor value, not the calibration register contents. update email address Signed-off-by: Lothar Felten Signed-off-by: Guenter Roeck commit 98c8f125fd8a6240ea343c1aa50a1be9047791b8 Author: Kees Cook Date: Sat Aug 25 22:58:01 2018 -0700 net: sched: Fix memory exposure from short TCA_U32_SEL Via u32_change(), TCA_U32_SEL has an unspecified type in the netlink policy, so max length isn't enforced, only minimum. This means nkeys (from userspace) was being trusted without checking the actual size of nla_len(), which could lead to a memory over-read, and ultimately an exposure via a call to u32_dump(). Reachability is CAP_NET_ADMIN within a namespace. Reported-by: Al Viro Cc: Jamal Hadi Salim Cc: Cong Wang Cc: Jiri Pirko Cc: "David S. Miller" Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 5b394b2ddf0347bef56e50c69a58773c94343ff3 Author: Linus Torvalds Date: Sun Aug 26 14:11:59 2018 -0700 Linux 4.19-rc1 commit b933d6ebf2d367647af870441341f76242259898 Merge: aba16dc5cf93 fd991a23c8f6 Author: Linus Torvalds Date: Sun Aug 26 13:39:05 2018 -0700 Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer update from Thomas Gleixner: "New defines for the compat time* types so they can be shared between 32bit and 64bit builds. Not used yet, but merging them now allows the actual conversions to be merged through different maintainer trees without dependencies We still have compat interfaces for 32bit on 64bit even with the new 2038 safe timespec/val variants because pointer size is different. And for the old style timespec/val interfaces we need yet another 'compat' interface for both 32bit native and 32bit on 64bit" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: y2038: Provide aliases for compat helpers commit aba16dc5cf9318b4e0fe92f8261779cd9f1d2d77 Merge: c4726e774ed2 1df895190233 Author: Linus Torvalds Date: Sun Aug 26 11:48:42 2018 -0700 Merge branch 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax Pull IDA updates from Matthew Wilcox: "A better IDA API: id = ida_alloc(ida, GFP_xxx); ida_free(ida, id); rather than the cumbersome ida_simple_get(), ida_simple_remove(). The new IDA API is similar to ida_simple_get() but better named. The internal restructuring of the IDA code removes the bitmap preallocation nonsense. I hope the net -200 lines of code is convincing" * 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax: (29 commits) ida: Change ida_get_new_above to return the id ida: Remove old API test_ida: check_ida_destroy and check_ida_alloc test_ida: Convert check_ida_conv to new API test_ida: Move ida_check_max test_ida: Move ida_check_leaf idr-test: Convert ida_check_nomem to new API ida: Start new test_ida module target/iscsi: Allocate session IDs from an IDA iscsi target: fix session creation failure handling drm/vmwgfx: Convert to new IDA API dmaengine: Convert to new IDA API ppc: Convert vas ID allocation to new IDA API media: Convert entity ID allocation to new IDA API ppc: Convert mmu context allocation to new IDA API Convert net_namespace to new IDA API cb710: Convert to new IDA API rsxx: Convert to new IDA API osd: Convert to new IDA API sd: Convert to new IDA API ... commit c4726e774ed27680c418e138234dfd2b8e1e89ac Merge: d207ea8e74ff b04413330c77 Author: Linus Torvalds Date: Sun Aug 26 11:41:08 2018 -0700 Merge tag 'gcc-plugins-v4.19-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull gcc plugin fix from Kees Cook: "Lift gcc test into Kconfig. This is for better behavior when the kernel is built with Clang, reported by Stefan Agner" * tag 'gcc-plugins-v4.19-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: Disable when building under Clang commit d207ea8e74ff45be0838afa12bdd2492fa9dc8bc Merge: 2a8a2b7c49d6 66e5db4a1ccc Author: Linus Torvalds Date: Sun Aug 26 11:25:21 2018 -0700 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf updates from Thomas Gleixner: "Kernel: - Improve kallsyms coverage - Add x86 entry trampolines to kcore - Fix ARM SPE handling - Correct PPC event post processing Tools: - Make the build system more robust - Small fixes and enhancements all over the place - Update kernel ABI header copies - Preparatory work for converting libtraceevnt to a shared library - License cleanups" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (100 commits) tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' tools arch x86: Update tools's copy of cpufeatures.h perf python: Fix pyrf_evlist__read_on_cpu() interface perf mmap: Store real cpu number in 'struct perf_mmap' perf tools: Remove ext from struct kmod_path perf tools: Add gzip_is_compressed function perf tools: Add lzma_is_compressed function perf tools: Add is_compressed callback to compressions array perf tools: Move the temp file processing into decompress_kmodule perf tools: Use compression id in decompress_kmodule() perf tools: Store compression id into struct dso perf tools: Add compression id into 'struct kmod_path' perf tools: Make is_supported_compression() static perf tools: Make decompress_to_file() function static perf tools: Get rid of dso__needs_decompress() call in __open_dso() perf tools: Get rid of dso__needs_decompress() call in symbol__disassemble() perf tools: Get rid of dso__needs_decompress() call in read_object_code() tools lib traceevent: Change to SPDX License format perf llvm: Allow passing options to llc in addition to clang perf parser: Improve error message for PMU address filters ... commit 2a8a2b7c49d6eb5f3348892c4676267376cfd40b Merge: de3750351c0d 6a012288d690 Author: Linus Torvalds Date: Sun Aug 26 10:13:21 2018 -0700 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: - Correct the L1TF fallout on 32bit and the off by one in the 'too much RAM for protection' calculation. - Add a helpful kernel message for the 'too much RAM' case - Unbreak the VDSO in case that the compiler desides to use indirect jumps/calls and emits retpolines which cannot be resolved because the kernel uses its own thunks, which does not work for the VDSO. Make it use the builtin thunks. - Re-export start_thread() which was unexported when the 32/64bit implementation was unified. start_thread() is required by modular binfmt handlers. - Trivial cleanups * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/speculation/l1tf: Suggest what to do on systems with too much RAM x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM x86/kvm/vmx: Remove duplicate l1d flush definitions x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit x86/process: Re-export start_thread() x86/mce: Add notifier_block forward declaration x86/vdso: Fix vDSO build if a retpoline is emitted commit de3750351c0de35472299506ace61a01f2bfc567 Merge: a9ce32337892 20b420dc4262 Author: Linus Torvalds Date: Sun Aug 26 09:55:28 2018 -0700 Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq update from Thomas Gleixner: "A small set of updats/fixes for the irq subsystem: - Allow GICv3 interrupts to be configured as wake-up sources to enable wakeup from suspend - Make the error handling of the STM32 irqchip init function work - A set of small cleanups and improvements" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic-v3: Allow interrupt to be configured as wake-up sources irqchip/tango: Set irq handler and data in one go dt-bindings: irqchip: renesas-irqc: Document r8a774a1 support irqchip/s3c24xx: Remove unneeded comparison of unsigned long to 0 irqchip/stm32: Fix init error handling irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP commit a9ce323378927d6e181d8527b718f792b8dcb6f2 Merge: 2923b27e5424 b639186ffe91 Author: Linus Torvalds Date: Sun Aug 26 09:47:00 2018 -0700 Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull licking update from Thomas Gleixner: "Mark the switch cases which fall through to the next case with the proper comment so the fallthrough compiler checks can be enabled" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: futex: Mark expected switch fall-throughs commit 2923b27e54242acf27fd16b299e102117c82f52f Merge: 828bf6e904eb c953cc987ab8 Author: Linus Torvalds Date: Sat Aug 25 18:43:59 2018 -0700 Merge tag 'libnvdimm-for-4.19_dax-memory-failure' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm memory-failure update from Dave Jiang: "As it stands, memory_failure() gets thoroughly confused by dev_pagemap backed mappings. The recovery code has specific enabling for several possible page states and needs new enabling to handle poison in dax mappings. In order to support reliable reverse mapping of user space addresses: 1/ Add new locking in the memory_failure() rmap path to prevent races that would typically be handled by the page lock. 2/ Since dev_pagemap pages are hidden from the page allocator and the "compound page" accounting machinery, add a mechanism to determine the size of the mapping that encompasses a given poisoned pfn. 3/ Given pmem errors can be repaired, change the speculatively accessed poison protection, mce_unmap_kpfn(), to be reversible and otherwise allow ongoing access from the kernel. A side effect of this enabling is that MADV_HWPOISON becomes usable for dax mappings, however the primary motivation is to allow the system to survive userspace consumption of hardware-poison via dax. Specifically the current behavior is: mce: Uncorrected hardware memory error in user-access at af34214200 {1}[Hardware Error]: It has been corrected by h/w and requires no further action mce: [Hardware Error]: Machine check events logged {1}[Hardware Error]: event severity: corrected Memory failure: 0xaf34214: reserved kernel page still referenced by 1 users [..] Memory failure: 0xaf34214: recovery action for reserved kernel page: Failed mce: Memory error not recovered ...and with these changes: Injecting memory failure for pfn 0x20cb00 at process virtual address 0x7f763dd00000 Memory failure: 0x20cb00: Killing dax-pmd:5421 due to hardware memory corruption Memory failure: 0x20cb00: recovery action for dax page: Recovered Given all the cross dependencies I propose taking this through nvdimm.git with acks from Naoya, x86/core, x86/RAS, and of course dax folks" * tag 'libnvdimm-for-4.19_dax-memory-failure' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm: libnvdimm, pmem: Restore page attributes when clearing errors x86/memory_failure: Introduce {set, clear}_mce_nospec() x86/mm/pat: Prepare {reserve, free}_memtype() for "decoy" addresses mm, memory_failure: Teach memory_failure() about dev_pagemap pages filesystem-dax: Introduce dax_lock_mapping_entry() mm, memory_failure: Collect mapping size in collect_procs() mm, madvise_inject_error: Let memory_failure() optionally take a page reference mm, dev_pagemap: Do not clear ->mapping on final put mm, madvise_inject_error: Disable MADV_SOFT_OFFLINE for ZONE_DEVICE pages filesystem-dax: Set page->index device-dax: Set page->index device-dax: Enable page_mapping() device-dax: Convert to vmf_insert_mixed and vm_fault_t commit 828bf6e904eb8fc8969333568802689fbbf07a40 Merge: b326272010b6 286e87718103 Author: Linus Torvalds Date: Sat Aug 25 18:13:10 2018 -0700 Merge tag 'libnvdimm-for-4.19_misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dave Jiang: "Collection of misc libnvdimm patches for 4.19 submission: - Adding support to read locked nvdimm capacity. - Change test code to make DSM failure code injection an override. - Add support for calculate maximum contiguous area for namespace. - Add support for queueing a short ARS when there is on going ARS for nvdimm. - Allow NULL to be passed in to ->direct_access() for kaddr and pfn params. - Improve smart injection support for nvdimm emulation testing. - Fix test code that supports for emulating controller temperature. - Fix hang on error before devm_memremap_pages() - Fix a bug that causes user memory corruption when data returned to user for ars_status. - Maintainer updates for Ross Zwisler emails and adding Jan Kara to fsdax" * tag 'libnvdimm-for-4.19_misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm: libnvdimm: fix ars_status output length calculation device-dax: avoid hang on error before devm_memremap_pages() tools/testing/nvdimm: improve emulation of smart injection filesystem-dax: Do not request kaddr and pfn when not required md/dm-writecache: Don't request pointer dummy_addr when not required dax/super: Do not request a pointer kaddr when not required tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access() s390, dcssblk: kaddr and pfn can be NULL to ->direct_access() libnvdimm, pmem: kaddr and pfn can be NULL to ->direct_access() acpi/nfit: queue issuing of ars when an uc error notification comes in libnvdimm: Export max available extent libnvdimm: Use max contiguous area for namespace size MAINTAINERS: Add Jan Kara for filesystem DAX MAINTAINERS: update Ross Zwisler's email address tools/testing/nvdimm: Fix support for emulating controller temperature tools/testing/nvdimm: Make DSM failure code injection an override acpi, nfit: Prefer _DSM over _LSR for namespace label reads libnvdimm: Introduce locked DIMM capacity support commit e75d039a54090470b7a42e803fd4f9398390f907 Author: Colin Ian King Date: Fri Aug 24 12:18:30 2018 +0100 qed: fix spelling mistake "comparsion" -> "comparison" Trivial fix to spelling mistake in DP_ERR error message Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 2d66f997f0545c8f7fc5cf0b49af1decb35170e7 Author: Jason Wang Date: Fri Aug 24 16:53:13 2018 +0800 vhost: correctly check the iova range when waking virtqueue We don't wakeup the virtqueue if the first byte of pending iova range is the last byte of the range we just got updated. This will lead a virtqueue to wait for IOTLB updating forever. Fixing by correct the check and wake up the virtqueue in this case. Fixes: 6b1e6cc7855b ("vhost: new device IOTLB API") Reported-by: Peter Xu Signed-off-by: Jason Wang Reviewed-by: Peter Xu Tested-by: Peter Xu Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 6750c87074c5b534d82fdaabb1deb45b8f1f57de Author: Manish Chopra Date: Thu Aug 23 13:20:52 2018 -0700 qlge: Fix netdev features configuration. qlge_fix_features() is not supposed to modify hardware or driver state, rather it is supposed to only fix requested fetures bits. Currently qlge_fix_features() also goes for interface down and up unnecessarily if there is not even any change in features set. This patch changes/fixes following - 1) Move reload of interface or device re-config from qlge_fix_features() to qlge_set_features(). 2) Reload of interface in qlge_set_features() only if relevant feature bit (NETIF_F_HW_VLAN_CTAG_RX) is changed. 3) Get rid of qlge_fix_features() since driver is not really required to fix any features bit. Signed-off-by: Manish Reviewed-by: Benjamin Poirier Signed-off-by: David S. Miller commit 0da70f808029476001109b6cb076737bc04cea2e Author: Anssi Hannula Date: Thu Aug 23 10:45:22 2018 +0300 net: macb: do not disable MDIO bus at open/close time macb_reset_hw() is called from macb_close() and indirectly from macb_open(). macb_reset_hw() zeroes the NCR register, including the MPE (Management Port Enable) bit. This will prevent accessing any other PHYs for other Ethernet MACs on the MDIO bus, which remains registered at macb_reset_hw() time, until macb_init_hw() is called from macb_open() which sets the MPE bit again. I.e. currently the MDIO bus has a short disruption at open time and is disabled at close time until the interface is opened again. Fix that by only touching the RE and TE bits when enabling and disabling RX/TX. v2: Make macb_init_hw() NCR write a single statement. Fixes: 6c36a7074436 ("macb: Use generic PHY layer") Signed-off-by: Anssi Hannula Reviewed-by: Claudiu Beznea Tested-by: Claudiu Beznea Signed-off-by: David S. Miller commit f7b9e8e111e0ce04ed7d1a1cb5b01b6e57775708 Author: Geert Uytterhoeven Date: Wed Aug 22 15:27:23 2018 +0200 Revert "net: stmmac: fix build failure due to missing COMMON_CLK dependency" This reverts commit bde4975310eb1982bd0bbff673989052d92fd481. All legacy clock implementations now implement clk_set_rate() (Some implementations may be dummies, though). Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Jose Abreu Signed-off-by: David S. Miller commit ab5f11055fdf8dfc3ddbd89e8e3cc550de41d1d3 Author: Ahmad Fatoum Date: Tue Aug 21 17:35:48 2018 +0200 net: macb: Fix regression breaking non-MDIO fixed-link PHYs commit 739de9a1563a ("net: macb: Reorganize macb_mii bringup") broke initializing macb on the EVB-KSZ9477 eval board. There, of_mdiobus_register was called even for the fixed-link representing the RGMII-link to the switch with the result that the driver attempts to enumerate PHYs on a non-existent MDIO bus: libphy: MACB_mii_bus: probed mdio_bus f0028000.ethernet-ffffffff: fixed-link has invalid PHY address mdio_bus f0028000.ethernet-ffffffff: scan phy fixed-link at address 0 [snip] mdio_bus f0028000.ethernet-ffffffff: scan phy fixed-link at address 31 The "MDIO" bus registration succeeds regardless, having claimed the reset GPIO, and calling of_phy_register_fixed_link later on fails because it tries to claim the same GPIO: macb f0028000.ethernet: broken fixed-link specification Fix this by registering the fixed-link before calling mdiobus_register. Fixes: 739de9a1563a ("net: macb: Reorganize macb_mii bringup") Signed-off-by: Ahmad Fatoum Signed-off-by: David S. Miller commit 602b74eda81311dbdb5dbab08c30f789f648ebdc Author: Ido Schimmel Date: Fri Aug 24 15:41:35 2018 +0300 mlxsw: spectrum_switchdev: Do not leak RIFs when removing bridge When a bridge device is removed, the VLANs are flushed from each configured port. This causes the ports to decrement the reference count on the associated FIDs (filtering identifier). If the reference count of a FID is 1 and it has a RIF (router interface), then this RIF is destroyed. However, if no port is member in the VLAN for which a RIF exists, then the RIF will continue to exist after the removal of the bridge. To reproduce: # ip link add name br0 type bridge vlan_filtering 1 # ip link set dev swp1 master br0 # ip link add link br0 name br0.10 type vlan id 10 # ip address add 192.0.2.0/24 dev br0.10 # ip link del dev br0 The RIF associated with br0.10 continues to exist. Fix this by iterating over all the bridge device uppers when it is destroyed and take care of destroying their RIFs. Fixes: 99f44bb3527b ("mlxsw: spectrum: Enable L3 interfaces on top of bridge devices") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit b326272010b6656210193d7ab93fa184087e8ee1 Merge: 1bc276775d93 1aa55ca9b14a Author: Linus Torvalds Date: Sat Aug 25 14:12:36 2018 -0700 Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC late updates from Olof Johansson: "A couple of late-merged changes that would be useful to get in this merge window: - Driver support for reset of audio complex on Meson platforms. The audio driver went in this merge window, and these changes have been in -next for a while (just not in our tree). - Power management fixes for IOMMU on Rockchip platforms, getting closer to kexec working on them, including Chromebooks. - Another pass updating "arm,psci" -> "psci" for some properties that have snuck in since last time it was done" * tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: iommu/rockchip: Move irq request past pm_runtime_enable iommu/rockchip: Handle errors returned from PM framework arm64: rockchip: Force CONFIG_PM on Rockchip systems ARM: rockchip: Force CONFIG_PM on Rockchip systems arm64: dts: Fix various entry-method properties to reflect documentation reset: imx7: Fix always writing bits as 0 reset: meson: add meson audio arb driver reset: meson: add dt-bindings for meson-axg audio arb commit 1bc276775d93faf42a3bb1c684cdb838ded8be56 Merge: b8dcdab36f53 d503ac531a52 Author: Linus Torvalds Date: Sat Aug 25 13:40:38 2018 -0700 Merge tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull more Kbuild updates from Masahiro Yamada: - add build_{menu,n,g,x}config targets for compile-testing Kconfig - fix and improve recursive dependency detection in Kconfig - fix parallel building of menuconfig/nconfig - fix syntax error in clang-version.sh - suppress distracting log from syncconfig - remove obsolete "rpm" target - remove VMLINUX_SYMBOL(_STR) macro entirely - fix microblaze build with CONFIG_DYNAMIC_FTRACE - move compiler test for dead code/data elimination to Kconfig - rename well-known LDFLAGS variable to KBUILD_LDFLAGS - misc fixes and cleanups * tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: rename LDFLAGS to KBUILD_LDFLAGS kbuild: pass LDFLAGS to recordmcount.pl kbuild: test dead code/data elimination support in Kconfig initramfs: move gen_initramfs_list.sh from scripts/ to usr/ vmlinux.lds.h: remove stale include export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() Coccinelle: remove pci_alloc_consistent semantic to detect in zalloc-simple.cocci kbuild: make sorting initramfs contents independent of locale kbuild: remove "rpm" target, which is alias of "rpm-pkg" kbuild: Fix LOADLIBES rename in Documentation/kbuild/makefiles.txt kconfig: suppress "configuration written to .config" for syncconfig kconfig: fix "Can't open ..." in parallel build kbuild: Add a space after `!` to prevent parsing as file pattern scripts: modpost: check memory allocation results kconfig: improve the recursive dependency report kconfig: report recursive dependency involving 'imply' kconfig: error out when seeing recursive dependency kconfig: add build-only configurator targets scripts/dtc: consolidate include path options in Makefile commit b8dcdab36f5394a09b66516057cccf61a81a3877 Merge: db84abf5f807 c125311d96b1 Author: Linus Torvalds Date: Sat Aug 25 13:30:23 2018 -0700 Merge tag 'for-linus-20180825' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "A few small fixes for this merge window: - Locking imbalance fix for bcache (Shan Hai) - A few small fixes for wbt. One is a cleanup/prep, one is a fix for an existing issue, and the last two are fixes for changes that went into this merge window (me)" * tag 'for-linus-20180825' of git://git.kernel.dk/linux-block: blk-wbt: don't maintain inflight counts if disabled blk-wbt: fix has-sleeper queueing check blk-wbt: use wq_has_sleeper() for wq active check blk-wbt: move disable check into get_limit() bcache: release dc->writeback_lock properly in bch_writeback_thread() commit db84abf5f8075a739bfd73ddc432e6b8fe3ec4b6 Merge: 04faac10fcd2 6e5461d774bf Author: Linus Torvalds Date: Sat Aug 25 13:27:35 2018 -0700 Merge tag 'upstream-4.19-rc1-fix' of git://git.infradead.org/linux-ubifs Pull UBIFS fix from Richard Weinberger: "Remove an empty file from UBIFS source" * tag 'upstream-4.19-rc1-fix' of git://git.infradead.org/linux-ubifs: ubifs: Remove empty file.h commit 04faac10fcd2d0f7af8183fa02dea26919e29571 Merge: 1b2de5d039c8 7753e38286d2 Author: Linus Torvalds Date: Sat Aug 25 13:17:53 2018 -0700 Merge tag '4.19-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Three small SMB3 fixes, one for stable" * tag '4.19-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module version number for cifs.ko to 2.12 cifs: check kmalloc before use cifs: check if SMB2 PDU size has been padded and suppress the warning cifs: create a define for how many iovs we need for an SMB2_open() commit 1b2de5d039c883c9d44ae5b2b6eca4ff9bd82dac Author: Linus Torvalds Date: Mon Jul 9 13:19:49 2018 -0700 mm/cow: don't bother write protecting already write-protected pages This is not normally noticeable, but repeated forks are unnecessarily expensive because they repeatedly dirty the parent page tables during the page table copy operation. It's trivial to just avoid write protecting the page table entry if it was already not writable. This patch was inspired by https://bugzilla.kernel.org/show_bug.cgi?id=200447 which points to an ancient "waste time re-doing fork" issue in the presence of lots of signals. That bug was fixed by Eric Biederman's signal handling series culminating in commit c3ad2c3b02e9 ("signal: Don't restart fork when signals come in"), but the unnecessary work for repeated forks is still work just fixing, particularly since the fix is trivial. Cc: Eric Biederman Cc: Oleg Nesterov Cc: Andrew Morton Signed-off-by: Linus Torvalds commit e0fcfe1f1acf2f129e0809ea89b9187e89e84246 Author: Colin Ian King Date: Sat Aug 25 12:24:31 2018 +0200 hpfs: remove unnecessary checks on the value of r when assigning error code At the point where r is being checked for different values, r is always going to be equal to 2 as the previous if statements jump to end or end1 if r is not 2. Hence the assignment to err can be simplified to just err an assignment without any checks on the value or r. Detected by CoverityScan, CID#1226737 ("Logically dead code") Signed-off-by: Colin Ian King Reviewed-by: Mikulas Patocka Signed-off-by: Linus Torvalds commit 7634ccd2da9734975cf7ce25139a7d4e8575b048 Author: Jens Axboe Date: Sat Aug 25 10:10:33 2018 -0600 libata: maintainership update Tejun Heo wrote: > > I asked Jens whether he could take care of the libata tree and he > thankfully agreed, so, from now on, Jens will be the libata > maintainer. > > Thanks a lot! Thanks for your work in this area. I still remember the first linux storage summit we did in Vancouver 2001, Tejun was invited to talk about his libata error handling work. Before that, it was basically a crap shoot if we recovered properly or not... A lot of water has flown under the bridge since then! Here's an "official" patch. Linus, can you apply it? Signed-off-by: Jens Axboe Signed-off-by: Linus Torvalds commit 3d7c82060d1fe65bde4023aac41a0b1bd7718e07 Author: Srikanth Jampala Date: Wed Aug 22 12:40:52 2018 +0530 crypto: cavium/nitrox - fix for command corruption in queue full case with backlog submissions. Earlier used to post the current command without checking queue full after backlog submissions. So, post the current command only after confirming the space in queue after backlog submissions. Maintain host write index instead of reading device registers to get the next free slot to post the command. Return -ENOSPC in queue full case. Signed-off-by: Srikanth Jampala Reviewed-by: Gadam Sreerama Tested-by: Jha, Chandan Signed-off-by: Herbert Xu commit 0522236d4f9c5ab2e79889cb020d1acbe5da416e Author: Ondrej Mosnacek Date: Wed Aug 22 08:26:31 2018 +0200 crypto: vmx - Fix sleep-in-atomic bugs This patch fixes sleep-in-atomic bugs in AES-CBC and AES-XTS VMX implementations. The problem is that the blkcipher_* functions should not be called in atomic context. The bugs can be reproduced via the AF_ALG interface by trying to encrypt/decrypt sufficiently large buffers (at least 64 KiB) using the VMX implementations of 'cbc(aes)' or 'xts(aes)'. Such operations then trigger BUG in crypto_yield(): [ 891.863680] BUG: sleeping function called from invalid context at include/crypto/algapi.h:424 [ 891.864622] in_atomic(): 1, irqs_disabled(): 0, pid: 12347, name: kcapi-enc [ 891.864739] 1 lock held by kcapi-enc/12347: [ 891.864811] #0: 00000000f5d42c46 (sk_lock-AF_ALG){+.+.}, at: skcipher_recvmsg+0x50/0x530 [ 891.865076] CPU: 5 PID: 12347 Comm: kcapi-enc Not tainted 4.19.0-0.rc0.git3.1.fc30.ppc64le #1 [ 891.865251] Call Trace: [ 891.865340] [c0000003387578c0] [c000000000d67ea4] dump_stack+0xe8/0x164 (unreliable) [ 891.865511] [c000000338757910] [c000000000172a58] ___might_sleep+0x2f8/0x310 [ 891.865679] [c000000338757990] [c0000000006bff74] blkcipher_walk_done+0x374/0x4a0 [ 891.865825] [c0000003387579e0] [d000000007e73e70] p8_aes_cbc_encrypt+0x1c8/0x260 [vmx_crypto] [ 891.865993] [c000000338757ad0] [c0000000006c0ee0] skcipher_encrypt_blkcipher+0x60/0x80 [ 891.866128] [c000000338757b10] [c0000000006ec504] skcipher_recvmsg+0x424/0x530 [ 891.866283] [c000000338757bd0] [c000000000b00654] sock_recvmsg+0x74/0xa0 [ 891.866403] [c000000338757c10] [c000000000b00f64] ___sys_recvmsg+0xf4/0x2f0 [ 891.866515] [c000000338757d90] [c000000000b02bb8] __sys_recvmsg+0x68/0xe0 [ 891.866631] [c000000338757e30] [c00000000000bbe4] system_call+0x5c/0x70 Fixes: 8c755ace357c ("crypto: vmx - Adding CBC routines for VMX module") Fixes: c07f5d3da643 ("crypto: vmx - Adding support for XTS") Cc: stable@vger.kernel.org Signed-off-by: Ondrej Mosnacek Signed-off-by: Herbert Xu commit c2b24c36e0a30ebd8fc7d068da7f0451f2c05c76 Author: Ard Biesheuvel Date: Mon Aug 20 16:58:34 2018 +0200 crypto: arm64/aes-gcm-ce - fix scatterwalk API violation Commit 71e52c278c54 ("crypto: arm64/aes-ce-gcm - operate on two input blocks at a time") modified the granularity at which the AES/GCM code processes its input to allow subsequent changes to be applied that improve performance by using aggregation to process multiple input blocks at once. For this reason, it doubled the algorithm's 'chunksize' property to 2 x AES_BLOCK_SIZE, but retained the non-SIMD fallback path that processes a single block at a time. In some cases, this violates the skcipher scatterwalk API, by calling skcipher_walk_done() with a non-zero residue value for a chunk that is expected to be handled in its entirety. This results in a WARN_ON() to be hit by the TLS self test code, but is likely to break other user cases as well. Unfortunately, none of the current test cases exercises this exact code path at the moment. Fixes: 71e52c278c54 ("crypto: arm64/aes-ce-gcm - operate on two ...") Reported-by: Vakul Garg Signed-off-by: Ard Biesheuvel Tested-by: Vakul Garg Signed-off-by: Herbert Xu commit e5b954e8d11fdde55eed35017370a3a0d8837754 Author: Dave Watson Date: Wed Aug 15 10:29:42 2018 -0700 crypto: aesni - Use unaligned loads from gcm_context_data A regression was reported bisecting to 1476db2d12 "Move HashKey computation from stack to gcm_context". That diff moved HashKey computation from the stack, which was explicitly aligned in the asm, to a struct provided from the C code, depending on AESNI_ALIGN_ATTR for alignment. It appears some compilers may not align this struct correctly, resulting in a crash on the movdqa instruction when attempting to encrypt or decrypt data. Fix by using unaligned loads for the HashKeys. On modern hardware there is no perf difference between the unaligned and aligned loads. All other accesses to gcm_context_data already use unaligned loads. Reported-by: Mauro Rossi Fixes: 1476db2d12 ("Move HashKey computation from stack to gcm_context") Cc: Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit 65b2c12dcdb883fc015c0ec65d6c2f857e0456ac Author: Ganesh Goudar Date: Fri Aug 10 18:27:41 2018 +0530 crypto: chtls - fix null dereference chtls_free_uld() call chtls_free_uld() only for the initialized cdev, this fixes NULL dereference in chtls_free_uld() Signed-off-by: Ganesh Goudar Signed-off-by: Atul Gupta Signed-off-by: Herbert Xu commit 7fa885e2a22fd0f91a2c23d9275f5021f618ff5a Author: Ard Biesheuvel Date: Tue Aug 7 23:18:36 2018 +0200 crypto: arm64/sm4-ce - check for the right CPU feature bit ARMv8.2 specifies special instructions for the SM3 cryptographic hash and the SM4 symmetric cipher. While it is unlikely that a core would implement one and not the other, we should only use SM4 instructions if the SM4 CPU feature bit is set, and we currently check the SM3 feature bit instead. So fix that. Fixes: e99ce921c468 ("crypto: arm64 - add support for SM4...") Cc: Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit f1bf9e60a0779ec97de9ecdc353e1d01cdd73f43 Author: Horia Geantă Date: Mon Aug 6 15:29:55 2018 +0300 crypto: caam - fix DMA mapping direction for RSA forms 2 & 3 Crypto engine needs some temporary locations in external memory for running RSA decrypt forms 2 and 3 (CRT). These are named "tmp1" and "tmp2" in the PDB. Update DMA mapping direction of tmp1 and tmp2 from TO_DEVICE to BIDIRECTIONAL, since engine needs r/w access. Cc: # 4.13+ Fixes: 52e26d77b8b3 ("crypto: caam - add support for RSA key form 2") Fixes: 4a651b122adb ("crypto: caam - add support for RSA key form 3") Signed-off-by: Horia Geantă Signed-off-by: Herbert Xu commit ad876a18048f43b1f66f5d474b7598538668c5de Author: Horia Geantă Date: Mon Aug 6 15:29:39 2018 +0300 crypto: caam/qi - fix error path in xts setkey xts setkey callback returns 0 on some error paths. Fix this by returning -EINVAL. Cc: # 4.12+ Fixes: b189817cf789 ("crypto: caam/qi - add ablkcipher and authenc algorithms") Signed-off-by: Horia Geantă Signed-off-by: Herbert Xu commit cc98963dbaaea93d17608641b8d6942a5327fc31 Author: Horia Geantă Date: Mon Aug 6 15:29:09 2018 +0300 crypto: caam/jr - fix descriptor DMA unmapping Descriptor address needs to be swapped to CPU endianness before being DMA unmapped. Cc: # 4.8+ Fixes: 261ea058f016 ("crypto: caam - handle core endianness != caam endianness") Reported-by: Laurentiu Tudor Signed-off-by: Horia Geantă Signed-off-by: Herbert Xu commit 757ab15c3f4968b5a29caf3fe8b67660ce84c3cd Author: Rafael J. Wysocki Date: Tue Aug 21 10:44:10 2018 +0200 cpuidle: menu: Retain tick when shallow state is selected The case addressed by commit 5ef499cd571c (cpuidle: menu: Handle stopped tick more aggressively) in the stopped tick case is present when the tick has not been stopped yet too. Namely, if only two CPU idle states, shallow state A with target residency significantly below the tick boundary and deep state B with target residency significantly above it, are available and the predicted idle duration is above the tick boundary, but below the target residency of state B, state A will be selected and the CPU may spend indefinite amount of time in it, which is not quite energy-efficient. However, if the tick has not been stopped yet and the governor is about to select a shallow idle state for the CPU even though the idle duration predicted by it is above the tick boundary, it should be fine to wake up the CPU early, so the tick can be retained then and the governor will have a chance to select a deeper state when it runs next time. [Note that when this really happens, it will make the idle duration predictor believe that the CPU might be idle longer than predicted, which will make it more likely to predict longer idle durations going forward, but that will also cause deeper idle states to be selected going forward, on average, which is what's needed here.] Fixes: 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states with stopped tick) Reported-by: Leo Yan Cc: 4.17+ # 4.17+: 5ef499cd571c (cpuidle: menu: Handle ...) Signed-off-by: Rafael J. Wysocki commit ae923785bc3af418b913bda7f92d247255a7b541 Merge: ff0fadfffe68 07f3701387dc Author: David S. Miller Date: Fri Aug 24 23:40:38 2018 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2018-08-24 This series contains fixes to e1000, igb, ixgb, ixgbe and i40e. YueHaibing from Huawei provides a change to use dma_zalloc_coherent() instead of calls to allocator followed by a memset for ixgb. Bo Chen provides a couple of fixes for e1000, first by adding a check to prevent a NULL pointer dereference. The second change is to clean up a possible resource leak on old transmit and receive rings when the device is not up. Jesus fixes an issue in the usage of an advanced transmit context descriptor for retrieving the timestamp of a packet for AF_PACKET if the IGB_TX_FLAGS_VLAN is not set in igb. Jia-Ju Bai provides several patches which replace GFP_ATOMIC with GFP_KERNEL, when using kzalloc() and kcalloc() which is not necessary. Also found an instance of mdelay() call which could be replaced with msleep(). Tony fixes ixgbe to allow MTU changes with XDP, by adding checks to ensure only supported values and return -EINVAL for when it is not supported. Sebastian fixed an issue that was not clearing VF mailbox memory and ensure queues are re-enabled correctly. Martyna fixes a transmit timeout when DCB is configured when bringing up an interface. Jake fixes a previous commit which accidentally reversed the check of the data pointer, so we can accurately count the size of the stats. ==================== Signed-off-by: David S. Miller commit 0519359784328bfa92bf0931bf0cff3b58c16932 Merge: 596766102a3a 2d17f460c5d7 Author: Linus Torvalds Date: Fri Aug 24 13:20:33 2018 -0700 Merge branch 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata Pull libata updates from Tejun Heo: "Nothing too interesting. Mostly ahci and ahci_platform changes, many around power management" * 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (22 commits) ata: ahci_platform: enable to get and control reset ata: libahci_platform: add reset control support ata: add an extra argument to ahci_platform_get_resources() ata: sata_rcar: Add r8a77965 support ata: sata_rcar: exclude setting of PHY registers in Gen3 ata: sata_rcar: really mask all interrupts on Gen2 and later Revert "ata: ahci_platform: allow disabling of hotplug to save power" ata: libahci: Allow reconfigure of DEVSLP register ata: libahci: Correct setting of DEVSLP register ata: ahci: Enable DEVSLP by default on x86 with SLP_S0 ata: ahci: Support state with min power but Partial low power state Revert "ata: ahci_platform: convert kcalloc to devm_kcalloc" ata: sata_rcar: Add rudimentary Runtime PM support ata: sata_rcar: Provide a short-hand for &pdev->dev ata: Only output sg element mapped number in verbose debug ata: Guard ata_scsi_dump_cdb() by ATA_VERBOSE_DEBUG ata: ahci_platform: convert kcalloc to devm_kcalloc ata: ahci_platform: convert kzallloc to kcalloc ata: ahci_platform: correct parameter documentation for ahci_platform_shutdown libata: remove ata_sff_data_xfer_noirq() ... commit 596766102a3a37ba20c4d9a4130a8a4b42b34646 Merge: 9022ada8ab6f e4f8d81c738d Author: Linus Torvalds Date: Fri Aug 24 13:19:27 2018 -0700 Merge branch 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: "Just one commit from Steven to take out spin lock from trace event handlers" * 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup/tracing: Move taking of spin lock out of trace event handlers commit 9022ada8ab6f1f1a932a3c93815061042e6548a5 Merge: 18b8bfdfbae5 87915adc3f0a Author: Linus Torvalds Date: Fri Aug 24 13:16:36 2018 -0700 Merge branch 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue updates from Tejun Heo: "Over the lockdep cross-release churn, workqueue lost some of the existing annotations. Johannes Berg restored it and also improved them" * 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: re-add lockdep dependencies for flushing workqueue: skip lockdep wq dependency in cancel_work_sync() commit 18b8bfdfbae5821a7df691bc1e542bbab6c31e9c Merge: d972604f6f87 6488a7f35eea Author: Linus Torvalds Date: Fri Aug 24 13:10:38 2018 -0700 Merge tag 'iommu-updates-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull IOMMU updates from Joerg Roedel: - PASID table handling updates for the Intel VT-d driver. It implements a global PASID space now so that applications usings multiple devices will just have one PASID. - A new config option to make iommu passthroug mode the default. - New sysfs attribute for iommu groups to export the type of the default domain. - A debugfs interface (for debug only) usable by IOMMU drivers to export internals to user-space. - R-Car Gen3 SoCs support for the ipmmu-vmsa driver - The ARM-SMMU now aborts transactions from unknown devices and devices not attached to any domain. - Various cleanups and smaller fixes all over the place. * tag 'iommu-updates-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (42 commits) iommu/omap: Fix cache flushes on L2 table entries iommu: Remove the ->map_sg indirection iommu/arm-smmu-v3: Abort all transactions if SMMU is enabled in kdump kernel iommu/arm-smmu-v3: Prevent any devices access to memory without registration iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA iommu/ipmmu-vmsa: Clarify supported platforms iommu/ipmmu-vmsa: Fix allocation in atomic context iommu: Add config option to set passthrough as default iommu: Add sysfs attribyte for domain type iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register iommu/arm-smmu: Error out only if not enough context interrupts iommu/io-pgtable-arm-v7s: Abort allocation when table address overflows the PTE iommu/io-pgtable-arm: Fix pgtable allocation in selftest iommu/vt-d: Remove the obsolete per iommu pasid tables iommu/vt-d: Apply per pci device pasid table in SVA iommu/vt-d: Allocate and free pasid table iommu/vt-d: Per PCI device pasid table interfaces iommu/vt-d: Add for_each_device_domain() helper iommu/vt-d: Move device_domain_info to header iommu/vt-d: Apply global PASID in SVA ... commit d972604f6f87478212f012af5560c4fd4bb2b01d Merge: 57bb8e37d71e d7a4303b8d1f Author: Linus Torvalds Date: Fri Aug 24 13:03:51 2018 -0700 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux Pull thermal management updates from Zhang Rui: - Add Daniel Lezcano as the reviewer of thermal framework and SoC driver changes (Daniel Lezcano). - Fix a bug in intel_dts_soc_thermal driver, which does not translate IO-APIC GSI (Global System Interrupt) into Linux irq number (Hans de Goede). - For device tree bindings, allow cooling devices sharing same trip point with same contribution value to share cooling map (Viresh Kumar). * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: dt-bindings: thermal: Allow multiple devices to share cooling map MAINTAINERS: Add Daniel Lezcano as designated reviewer for thermal Thermal: Intel SoC DTS: Translate IO-APIC GSI number to linux irq number commit 57bb8e37d71eac45b6ea9180698a9cc3db945e26 Merge: aa5b1054badb c037bd615885 Author: Linus Torvalds Date: Fri Aug 24 13:00:33 2018 -0700 Merge tag 'apparmor-pr-2018-08-23' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor Pull apparmor updates from John Johansen: "There is nothing major this time just four bug fixes and a patch to remove some dead code: Cleanups: - remove no-op permission check in policy_unpack Bug fixes: - fix an error code in __aa_create_ns() - fix failure to audit context info in build_change_hat - check buffer bounds when mapping permissions mask - fully initialize aa_perms struct when answering userspace query" * tag 'apparmor-pr-2018-08-23' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor: apparmor: remove no-op permission check in policy_unpack apparmor: fix an error code in __aa_create_ns() apparmor: Fix failure to audit context info in build_change_hat apparmor: Fully initialize aa_perms struct when answering userspace query apparmor: Check buffer bounds when mapping permissions mask commit aa5b1054badb60191f6a09e7ef65beacf837c5d4 Merge: e1dbc5a41051 0f52b3a00c78 Author: Linus Torvalds Date: Fri Aug 24 09:34:23 2018 -0700 Merge tag 'powerpc-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - An implementation for the newly added hv_ops->flush() for the OPAL hvc console driver backends, I forgot to apply this after merging the hvc driver changes before the merge window. - Enable all PCI bridges at boot on powernv, to avoid races when multiple children of a bridge try to enable it simultaneously. This is a workaround until the PCI core can be enhanced to fix the races. - A fix to query PowerVM for the correct system topology at boot before initialising sched domains, seen in some configurations to cause broken scheduling etc. - A fix for pte_access_permitted() on "nohash" platforms. - Two commits to fix SIGBUS when using remap_pfn_range() seen on Power9 due to a workaround when using the nest MMU (GPUs, accelerators). - Another fix to the VFIO code used by KVM, the previous fix had some bugs which caused guests to not start in some configurations. - A handful of other minor fixes. Thanks to: Aneesh Kumar K.V, Benjamin Herrenschmidt, Christophe Leroy, Hari Bathini, Luke Dashjr, Mahesh Salgaonkar, Nicholas Piggin, Paul Mackerras, Srikar Dronamraju. * tag 'powerpc-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mce: Fix SLB rebolting during MCE recovery path. KVM: PPC: Book3S: Fix guest DMA when guest partially backed by THP pages powerpc/mm/radix: Only need the Nest MMU workaround for R -> RW transition powerpc/mm/books3s: Add new pte bit to mark pte temporarily invalid. powerpc/nohash: fix pte_access_permitted() powerpc/topology: Get topology for shared processors at boot powerpc64/ftrace: Include ftrace.h needed for enable/disable calls powerpc/powernv/pci: Work around races in PCI bridge enabling powerpc/fadump: cleanup crash memory ranges support powerpc/powernv: provide a console flush operation for opal hvc driver powerpc/traps: Avoid rate limit messages from show unhandled signals powerpc/64s: Fix PACA_IRQ_HARD_DIS accounting in idle_power4() commit e1dbc5a41051d4791160727829903ec5169c7152 Merge: 40c431a5a5c2 4ec84835900b Author: Linus Torvalds Date: Fri Aug 24 09:31:34 2018 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Martin Schwidefsky: - A couple of patches for the zcrypt driver: + Add two masks to determine which AP cards and queues are host devices, this will be useful for KVM AP device passthrough + Add-on patch to improve the parsing of the new apmask and aqmask + Some code beautification - Second try to reenable the GCC plugins, the first patch set had a patch to do this but the merge somehow missed this - Remove the s390 specific GCC version check and use the generic one - Three patches for kdump, two bug fixes and one cleanup - Three patches for the PCI layer, one bug fix and two cleanups * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: remove gcc version check (4.3 or newer) s390/zcrypt: hex string mask improvements for apmask and aqmask. s390/zcrypt: AP bus support for alternate driver(s) s390/zcrypt: code beautify s390/zcrypt: switch return type to bool for ap_instructions_available() s390/kdump: Remove kzalloc_panic s390/kdump: Fix memleak in nt_vmcoreinfo s390/kdump: Make elfcorehdr size calculation ABI compliant s390/pci: remove fmb address from debug output s390/pci: remove stale rc s390/pci: fix out of bounds access during irq setup s390/zcrypt: fix ap_instructions_available() returncodes s390: reenable gcc plugins for real commit 40c431a5a5c2333079c67b03de6c0470e8306374 Merge: 4def1963608e f5d707ede37a Author: Linus Torvalds Date: Fri Aug 24 09:29:44 2018 -0700 Merge tag 'acpi-4.19-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI Kconfig fix from Rafael Wysocki: "Fix recent menuconfig breakage causing it to present ACPI-specific options incorrectly (Arnd Bergmann)" * tag 'acpi-4.19-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: fix menuconfig presentation of ACPI submenu commit 4def1963608ed2b61aca5b52fdedb4ca2798820c Merge: 5e8704ac1cfa 82c9a927bc5d Author: Linus Torvalds Date: Fri Aug 24 09:25:39 2018 -0700 Merge branch 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull namespace fixes from Eric Biederman: "This is a set of four fairly obvious bug fixes: - a switch from d_find_alias to d_find_any_alias because the xattr code perversely takes a dentry - two mutex vs copy_to_user fixes from Jann Horn - a fix to use a sanitized size not the size userspace passed in from Christian Brauner" * 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: getxattr: use correct xattr length sys: don't hold uts_sem while accessing userspace memory userns: move user access out of the mutex cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias() commit 5e8704ac1cfa9fceef94fcc457e18613b1589b34 Merge: 019cddc88f9e 3e20e97c2d55 Author: Linus Torvalds Date: Fri Aug 24 09:22:54 2018 -0700 Merge tag 'drm-next-2018-08-24' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Just a couple of fixes" One MAINTAINERS address change, two panels fixes, and set of amdgpu fixes (build fixes, display fixes and some others)" * tag 'drm-next-2018-08-24' of git://anongit.freedesktop.org/drm/drm: drm/edid: Add 6 bpc quirk for SDC panel in Lenovo B50-80 drm/amd/display: Don't build DCN1 when kcov is enabled Revert "drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86" drm/amdgpu/display: disable eDP fast boot optimization on DCE8 drm/amdgpu: fix amdgpu_amdkfd_remove_eviction_fence v3 drm/amdgpu: fix incorrect use of drm_file->pid drm/amdgpu: fix incorrect use of fcheck drm/powerplay: enable dpm under pass-through drm/amdgpu: access register without KIQ drm/amdgpu: set correct base for THM/NBIF/MP1 IP drm/amd/display: fix dentist did ranges drm/amd/display: make dp_ss_off optional drm/amd/display: fix dp_ss_control vbios flag parsing drm/amd/display: Do not retain link settings MAINTAINERS: drm-misc: Change seanpaul's email address drm/panel: simple: tv123wam: Add unprepare delay commit a296b16270ab8d3b1c2a41ca1dd4d2fc34b598d9 Author: Rex Zhu Date: Thu Aug 16 11:36:38 2018 +0800 drm/amd/display: Fix bug use wrong pp interface Used wrong pp interface, the original interface is exposed by dpm on SI and paritial CI. Pointed out by Francis David v2: dal only need to set min_dcefclk and min_fclk to smu. so use display_clock_voltage_request interface, instand of update all display configuration. Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 019cddc88f9e4ae0de2c76802f7137210c2101aa Merge: d002924f934a 00efcdce67a3 Author: Linus Torvalds Date: Fri Aug 24 08:57:26 2018 -0700 Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull second i2c update from Wolfram Sang: "As promised, here is my 2nd pull request for I2C, containing: - removal of the attach_adapter callback, converting its last user - removal of any __deprecated usage within I2C - one email address update - some SPDX conversion" * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: don't use any __deprecated handling anymore i2c: use SPDX identifier for Renesas drivers i2c: ocores: update my email address i2c: remove deprecated attach_adapter callback macintosh: therm_windtunnel: drop using attach_adapter commit 07f3701387dcab3a4fb0166098fb2754a1b927e1 Author: Jacob Keller Date: Mon Aug 20 08:12:27 2018 -0700 i40e: fix condition of WARN_ONCE for stat strings Commit 9b10df596bd4 ("i40e: use WARN_ONCE to replace the commented BUG_ON size check") introduced a warning check to make sure that the size of the stat strings was always the expected value. This code accidentally inverted the check of the data pointer. Fix this so that we accurately count the size of the stats we copied in. This fixes an erroneous WARN kernel splat that occurs when requesting ethtool statistics. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Tested-by: Mauro S M Rodrigues Signed-off-by: Jeff Kirsher commit fa38e30ac73fbb01d7e5d0fd1b12d412fa3ac3ee Author: Martyna Szapar Date: Tue Aug 7 17:11:23 2018 -0700 i40e: Fix for Tx timeouts when interface is brought up if DCB is enabled If interface is connected to switch port configured for DCB there are TX timeouts when bringing up interface. Problem started appearing after adding in i40e driver code mqprio hardware offload mode. In function i40e_vsi_configure_bw_alloc was added resetting BW rate which should be executing when mqprio qdisc is removed but was also when there was no mqprio qdisc added and DCB was enabled. In this patch was added additional check for DCB flag so now when DCB is enabled the correct DCB configs from before mqprio patch are restored. Signed-off-by: Martyna Szapar Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 939b701ad63314f5aa90dcd3d866f73954945209 Author: Sebastian Basierski Date: Tue Jul 31 18:16:00 2018 +0200 ixgbe: fix driver behaviour after issuing VFLR Since VFLR doesn't clear VFMBMEM (VF Mailbox Memory) and is not re-enabling queues correctly we should fix this behavior. Signed-off-by: Sebastian Basierski Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit fabf1bce103aa8e3db27ff2cc55f8e0fb0abcc30 Author: Tony Nguyen Date: Mon Jul 30 15:52:48 2018 -0700 ixgbe: Prevent unsupported configurations with XDP These changes address comments by Jakub Kicinski on commit 38b7e7f8ae82 ("ixgbe: Do not allow LRO or MTU change with XDP"). Change the MTU check with XDP to allow any supported value and only reject those outside of the range as opposed to rejecting any change when XDP is active. In situations where MTU size is not supported, return -EINVAL instead of -EPERM. Add checks when enabling SRIOV, DCB, or adding L2FW offloaded device as they are not supported with XDP. CC: Jakub Kicinski Signed-off-by: Tony Nguyen Acked-by: Jakub Kicinski Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 374f78f75be98c72876a4d0311b278cd226effba Author: Jia-Ju Bai Date: Fri Jul 27 16:22:31 2018 +0800 ixgbe: Replace GFP_ATOMIC with GFP_KERNEL ixgbe_fcoe_ddp_setup(), ixgbe_setup_fcoe_ddp_resources() and ixgbe_sw_init() are never called in atomic context. They call kmalloc(), dma_pool_alloc() and kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Acked-by: Sebastian Basierski Signed-off-by: Jeff Kirsher commit 69a64658de502c8ca383fe2c5a5208f00b5844cd Author: Jia-Ju Bai Date: Fri Jul 27 16:07:38 2018 +0800 igb: Replace mdelay() with msleep() in igb_integrated_phy_loopback() igb_integrated_phy_loopback() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 151356270b0761e455ed82bba3353fb494451555 Author: Jia-Ju Bai Date: Fri Jul 27 16:04:53 2018 +0800 igb: Replace GFP_ATOMIC with GFP_KERNEL in igb_sw_init() igb_sw_init() is never called in atomic context. It calls kzalloc() and kcalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit a798fbac33c4cbfe7d539298623b7af6c3f9525a Author: Jesus Sanchez-Palencia Date: Thu Jul 26 10:20:38 2018 -0700 igb: Use an advanced ctx descriptor for launchtime On i210, Launchtime (TxTime) requires the usage of an "Advanced Transmit Context Descriptor" for retrieving the timestamp of a packet. The igb driver correctly builds such descriptor on the segmentation flow (i.e. igb_tso()) or on the checksum one (i.e. igb_tx_csum()), but the feature is broken for AF_PACKET if the IGB_TX_FLAGS_VLAN is not set, which happens due to an early return on igb_tx_csum(). This flag is only set by the kernel when a VLAN interface is used, thus we can't just rely on it. Here we are fixing this issue by checking if launchtime is enabled for the current tx_ring before performing the early return. Signed-off-by: Jesus Sanchez-Palencia Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit ee400a3f1bfe7004a3e14b81c38ccc5583c26295 Author: Bo Chen Date: Mon Jul 23 09:01:30 2018 -0700 e1000: ensure to free old tx/rx rings in set_ringparam() In 'e1000_set_ringparam()', the tx_ring and rx_ring are updated with new value and the old tx/rx rings are freed only when the device is up. There are resource leaks on old tx/rx rings when the device is not up. This bug is reported by COD, a tool for testing kernel module binaries I am building. This patch fixes the bug by always calling 'kfree()' on old tx/rx rings in 'e1000_set_ringparam()'. Signed-off-by: Bo Chen Reviewed-by: Alexander Duyck Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit cf1acec008f8d7761aa3fd7c4bca7e17b2d2512d Author: Bo Chen Date: Mon Jul 23 09:01:29 2018 -0700 e1000: check on netif_running() before calling e1000_up() When the device is not up, the call to 'e1000_up()' from the error handling path of 'e1000_set_ringparam()' causes a kernel oops with a null-pointer dereference. The null-pointer dereference is triggered in function 'e1000_alloc_rx_buffers()' at line 'buffer_info = &rx_ring->buffer_info[i]'. This bug was reported by COD, a tool for testing kernel module binaries I am building. This bug was also detected by KFI from Dr. Kai Cong. This patch fixes the bug by checking on 'netif_running()' before calling 'e1000_up()' in 'e1000_set_ringparam()'. Signed-off-by: Bo Chen Acked-by: Alexander Duyck Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit a9910c0886470b659a6c3629d6467d5639c327e9 Author: YueHaibing Date: Thu Jul 19 22:04:07 2018 +0800 ixgb: use dma_zalloc_coherent instead of allocator/memset Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1aa55ca9b14af6cfd987ce4fdaf548f7067a5d07 Author: Marc Zyngier Date: Fri Aug 24 16:06:37 2018 +0100 iommu/rockchip: Move irq request past pm_runtime_enable Enabling the interrupt early, before power has been applied to the device, can result in an interrupt being delivered too early if: - the IOMMU shares an interrupt with a VOP - the VOP has a pending interrupt (after a kexec, for example) In these conditions, we end-up taking the interrupt without the IOMMU being ready to handle the interrupt (not powered on). Moving the interrupt request past the pm_runtime_enable() call makes sure we can at least access the IOMMU registers. Note that this is only a partial fix, and that the VOP interrupt will still be screaming until the VOP driver kicks in, which advocates for a more synchronized interrupt enabling/disabling approach. Fixes: 0f181d3cf7d98 ("iommu/rockchip: Add runtime PM support") Reviewed-by: Heiko Stuebner Signed-off-by: Marc Zyngier Signed-off-by: Olof Johansson commit 3fc7c5c0cff3150e471f5fd12f59971c6d2c6513 Author: Marc Zyngier Date: Fri Aug 24 16:06:36 2018 +0100 iommu/rockchip: Handle errors returned from PM framework pm_runtime_get_if_in_use can fail: either PM has been disabled altogether (-EINVAL), or the device hasn't been enabled yet (0). Sadly, the Rockchip IOMMU driver tends to conflate the two things by considering a non-zero return value as successful. This has the consequence of hiding other bugs, so let's handle this case throughout the driver, with a WARN_ON_ONCE so that we can try and work out what happened. Fixes: 0f181d3cf7d98 ("iommu/rockchip: Add runtime PM support") Reviewed-by: Heiko Stuebner Signed-off-by: Marc Zyngier Signed-off-by: Olof Johansson commit 7db7a8f5638a2ffe0c0c0d55b5186b6191fd6af7 Author: Marc Zyngier Date: Fri Aug 24 16:06:35 2018 +0100 arm64: rockchip: Force CONFIG_PM on Rockchip systems A number of the Rockchip-specific drivers (IOMMU, display controllers) are now assuming that CONFIG_PM is set, and may completely misbehave if that's not the case. Since there is hardly any reason for this configuration option not to be selected anyway, let's require it (in the same way Tegra already does). Signed-off-by: Marc Zyngier Signed-off-by: Olof Johansson commit d1558dfd9f22c99a5b8e1354ad881ee40749da89 Author: Marc Zyngier Date: Fri Aug 24 16:06:34 2018 +0100 ARM: rockchip: Force CONFIG_PM on Rockchip systems A number of the Rockchip-specific drivers (IOMMU, display controllers) are now assuming that CONFIG_PM is set, and may completely misbehave if that's not the case. Since there is hardly any reason for this configuration option not to be selected anyway, let's require it (in the same way Tegra already does). Signed-off-by: Marc Zyngier Signed-off-by: Olof Johansson commit e9880240e4f4efe40bb47aba3b6602cff2a76b1e Author: Amit Kucheria Date: Thu Aug 23 14:23:29 2018 +0530 arm64: dts: Fix various entry-method properties to reflect documentation The idle-states binding documentation[1] mentions that the 'entry-method' property is required on 64-bit platforms and must be set to "psci". commit a13f18f59d26 ("Documentation: arm: Fix typo in the idle-states bindings examples") attempted to fix this earlier but clearly more is needed. Fix the cpu-capacity.txt documentation that uses the incorrect value so we don't get copy-paste errors like these. Clarify the language in idle-states.txt by removing the reference to the psci bindings that might be causing this confusion. Finally, fix devicetrees of various boards to reflect current documentation. [1] Documentation/devicetree/bindings/arm/idle-states.txt (see idle-states node) Signed-off-by: Amit Kucheria Acked-by: Sudeep Holla Acked-by: Li Yang Signed-off-by: Olof Johansson commit 5920cce8569e36ffe966959833e0eeb80a91638c Merge: c37aad3612c4 26fce0557fa6 Author: Olof Johansson Date: Fri Aug 24 08:49:57 2018 -0700 Merge tag 'reset-fixes-for-4.18' of git://git.pengutronix.de/git/pza/linux into next/late Reset controller fixes for v4.18 This tag fixes reset assertion on i.MX7 for all non-inverted reset control bits. Currently only PCIE controller and PHY resets are used. * tag 'reset-fixes-for-4.18' of git://git.pengutronix.de/git/pza/linux: reset: imx7: Fix always writing bits as 0 Signed-off-by: Olof Johansson commit c37aad3612c4a9e01ca69ad07b8ca41dbd222c46 Merge: 29ed45fff058 d903779b58be Author: Olof Johansson Date: Fri Aug 24 08:49:48 2018 -0700 Merge tag 'reset-for-4.19-2' of git://git.pengutronix.de/git/pza/linux into next/late Reset controller changes for v4.19, part 2 This adds a single new driver for the Amlogic Meson Audio Memory Arbiter resets. * tag 'reset-for-4.19-2' of git://git.pengutronix.de/git/pza/linux: reset: meson: add meson audio arb driver reset: meson: add dt-bindings for meson-axg audio arb Signed-off-by: Olof Johansson commit d002924f934ad4d249f6716680433c912831d046 Merge: 33e17876ea4e 864d39df09b4 Author: Linus Torvalds Date: Fri Aug 24 08:45:19 2018 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: "virtio, vhost: fixes, tweaks No new features but a bunch of tweaks such as switching balloon from oom notifier to shrinker" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vhost/scsi: increase VHOST_SCSI_PREALLOC_PROT_SGLS to 2048 vhost: allow vhost-scsi driver to be built-in virtio: pci-legacy: Validate queue pfn virtio: mmio-v1: Validate queue PFN virtio_balloon: replace oom notifier with shrinker virtio-balloon: kzalloc the vb struct virtio-balloon: remove BUG() in init_vqs commit 00efcdce67a365ec1881a6fbf17f769d690244e9 Author: Sedat Dilek Date: Sun Aug 19 15:51:35 2018 +0200 i2c: don't use any __deprecated handling anymore This can be dropped with commit 771c035372a036f83353eef46dbb829780330234 ("deprecate the '__deprecated' attribute warnings entirely and for good") now in upstream. And we got rid of the last __deprecated use, too. Signed-off-by: Sedat Dilek [wsa: shortened commit message to reflect the current situation] Signed-off-by: Wolfram Sang commit 20b420dc42629f115a0339a2474aec419ea32ea0 Merge: f19f5c49bbc3 4110b5cbb014 Author: Thomas Gleixner Date: Fri Aug 24 16:06:42 2018 +0200 Merge tag 'irqchip-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip updates for 4.19, take #2 from Marc Zyngier: - bcm7038: compilation fix for !SMP - stm32: fix teardown on probe error - s3c24xx: fix compilation warning - renesas-irqc: r8a774a1 support - tango: chained irq setup simplification - gic-v3: allow wake-up sources commit 6a012288d6906fee1dbc244050ade1dafe4a9c8d Author: Vlastimil Babka Date: Thu Aug 23 16:21:29 2018 +0200 x86/speculation/l1tf: Suggest what to do on systems with too much RAM Two users have reported [1] that they have an "extremely unlikely" system with more than MAX_PA/2 memory and L1TF mitigation is not effective. Make the warning more helpful by suggesting the proper mem=X kernel boot parameter to make it effective and a link to the L1TF document to help decide if the mitigation is worth the unusable RAM. [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536 Suggested-by: Michal Hocko Signed-off-by: Vlastimil Babka Acked-by: Michal Hocko Cc: "H . Peter Anvin" Cc: Linus Torvalds Cc: Andi Kleen Cc: Dave Hansen Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/966571f0-9d7f-43dc-92c6-a10eec7a1254@suse.cz commit 6055af5e1c4f8654adb766f1bf93f0e4f7c4a4f4 Author: Wolfram Sang Date: Wed Aug 22 00:02:16 2018 +0200 i2c: use SPDX identifier for Renesas drivers Signed-off-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Wolfram Sang commit 5d3a01a228c703dad971cad11f14c0512c4c2713 Author: Peter Korsgaard Date: Wed Aug 22 18:16:07 2018 +0200 i2c: ocores: update my email address The old @sunsite.dk address is no longer active, so update the references. Signed-off-by: Peter Korsgaard Signed-off-by: Wolfram Sang commit 0c36dd37d5b80b43f4e3dc5a1dbfe6dbd86e8f2a Author: Wolfram Sang Date: Tue Aug 21 17:02:40 2018 +0200 i2c: remove deprecated attach_adapter callback There aren't any users left. Remove this callback from the 2.4 times. Phew, finally, that took years to reach... Signed-off-by: Wolfram Sang commit 3e7bed52719de4b5b5fb900869e293eae0bc3f3e Author: Wolfram Sang Date: Tue Aug 21 17:02:39 2018 +0200 macintosh: therm_windtunnel: drop using attach_adapter As we now have deferred probing, we can use a custom mechanism and finally get rid of the legacy interface from the i2c core. Signed-off-by: Wolfram Sang Acked-by: Michael Ellerman commit b6fdfbff078975c53383fc146a2a54985eab6b6d Author: Misono Tomohiro Date: Fri Aug 24 11:35:28 2018 +0900 btrfs: Fix suspicious RCU usage warning in btrfs_debug_in_rcu Commit 672d599041c8 ("btrfs: Use wrapper macro for rcu string to remove duplicate code") replaces some open coded RCU string handling with macro. It turns out that btrfs_debug_in_rcu() is used for the first time and the macro lacks lock/unlock of RCU string for non-debug case (i.e. when the message is not printed), leading to suspicious RCU usage warning when CONFIG_PROVE_RCU is on. Fix this by adding a wrapper to call lock/unlock for the non-debug case too. Fixes: 672d599041c8 ("btrfs: Use wrapper macro for rcu string to remove duplicate code") Reported-by: David Howells Tested-by: David Howells Signed-off-by: Misono Tomohiro Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6e5461d774bf42aae622ad0f3ff53e41962f886b Author: Richard Weinberger Date: Fri Aug 24 08:55:15 2018 +0200 ubifs: Remove empty file.h This empty file sneaked into the tree by mistake. Remove it. Fixes: 6eb61d587f45 ("ubifs: Pass struct ubifs_info to ubifs_assert()") Signed-off-by: Richard Weinberger commit 5e2e2f9f76e157063a656351728703cb02b068f1 Author: Dan Carpenter Date: Thu Aug 23 16:59:25 2018 +0300 PM / clk: signedness bug in of_pm_clk_add_clks() "count" needs to be signed for the error handling to work. I made "i" signed as well so they match. Fixes: 02113ba93ea4 (PM / clk: Add support for obtaining clocks from device-tree) Cc: 4.6+ # 4.6+ Signed-off-by: Dan Carpenter Signed-off-by: Rafael J. Wysocki commit ee4af50ca94f58afc3532662779b9cf80bbe27c8 Author: Jan Kara Date: Tue Aug 21 14:52:34 2018 +0200 udf: Fix mounting of Win7 created UDF filesystems Win7 is creating UDF filesystems with single partition with number 8192. Current partition descriptor scanning code does not handle this well as it incorrectly assumes that partition numbers will form mostly contiguous space of small numbers. This results in unmountable media due to errors like: UDF-fs: error (device dm-1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device dm-1): udf_fill_super: No fileset found Fix the problem by handling partition descriptors in a way that sparse partition numbering does not matter. Reported-and-tested-by: jean-luc malet CC: stable@vger.kernel.org Fixes: 7b78fd02fb19530fd101ae137a1f46aa466d9bb6 Signed-off-by: Jan Kara commit 82c82ab658655befcb6aa47cbdb98dadce1a0cfe Author: Jan Kara Date: Tue Aug 21 12:00:08 2018 +0200 udf: Remove dead code from udf_find_fileset() Remove dead code and slightly simplify code in udf_find_fileset(). Signed-off-by: Jan Kara commit 10568f6c5761db24249c610c94d6e44d5505a0ba Author: Florian Westphal Date: Wed Aug 22 11:33:27 2018 +0200 netfilter: xt_checksum: ignore gso skbs Satish Patel reports a skb_warn_bad_offload() splat caused by -j CHECKSUM rules: -A POSTROUTING -p tcp -m tcp --sport 80 -j CHECKSUM The CHECKSUM target has never worked with GSO skbs, and the above rule makes no sense as kernel will handle checksum updates on transmit. Unfortunately, there are 3rd party tools that install such rules, so we cannot reject this from the config plane without potential breakage. Amend Kconfig text to clarify that the CHECKSUM target is only useful in virtualized environments, where old dhcp clients that use AF_PACKET used to discard UDP packets with a 'bad' header checksum and add a one-time warning in case such rule isn't restricted to UDP. v2: check IP6T_F_PROTO flag before cmp (Michal Kubecek) Reported-by: Satish Patel Reported-by: Markos Chandras Reported-by: Michal Kubecek Signed-off-by: Florian Westphal Reviewed-by: Michal Kubecek Signed-off-by: Pablo Neira Ayuso commit b0a182f875689647b014bc01d36b340217792852 Author: Vlastimil Babka Date: Thu Aug 23 15:44:18 2018 +0200 x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM Two users have reported [1] that they have an "extremely unlikely" system with more than MAX_PA/2 memory and L1TF mitigation is not effective. In fact it's a CPU with 36bits phys limit (64GB) and 32GB memory, but due to holes in the e820 map, the main region is almost 500MB over the 32GB limit: [ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000081effffff] usable Suggestions to use 'mem=32G' to enable the L1TF mitigation while losing the 500MB revealed, that there's an off-by-one error in the check in l1tf_select_mitigation(). l1tf_pfn_limit() returns the last usable pfn (inclusive) and the range check in the mitigation path does not take this into account. Instead of amending the range check, make l1tf_pfn_limit() return the first PFN which is over the limit which is less error prone. Adjust the other users accordingly. [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536 Fixes: 17dbca119312 ("x86/speculation/l1tf: Add sysfs reporting for l1tf") Reported-by: George Anchev Reported-by: Christopher Snowhill Signed-off-by: Vlastimil Babka Signed-off-by: Thomas Gleixner Cc: "H . Peter Anvin" Cc: Linus Torvalds Cc: Andi Kleen Cc: Dave Hansen Cc: Michal Hocko Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180823134418.17008-1-vbabka@suse.cz commit ff0fadfffe681203bfe134e1041ab6ccb4aa3dff Merge: c08eebad4ac5 785e76d7a205 Author: David S. Miller Date: Thu Aug 23 22:41:55 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2018-08-24 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix BPF sockmap and tls where we get a hang in do_tcp_sendpages() when sndbuf is full due to missing calls into underlying socket's sk_write_space(), from John. 2) Two BPF sockmap fixes to reject invalid parameters on map creation and to fix a map element miscount on allocation failure. Another fix for BPF hash tables to use per hash table salt for jhash(), from Daniel. 3) Fix for bpftool's command line parsing in order to terminate on bad arguments instead of keeping looping in some border cases, from Quentin. 4) Fix error value of xdp_umem_assign_dev() in order to comply with expected bind ops error codes, from Prashant. ==================== Signed-off-by: David S. Miller commit 3e20e97c2d55fb18e4b06d16478edc757483b7db Merge: 8f13b60756a1 25da75043f86 Author: Dave Airlie Date: Fri Aug 24 13:40:58 2018 +1000 Merge tag 'drm-misc-next-fixes-2018-08-23-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-next - Add quirk to Lenovo B50-80 to use 6 bpc instead of 8 (Feng) Signed-off-by: Dave Airlie From: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180823205434.GA137644@art_vandelay commit 33e17876ea4edcd7f5c01efa78e8d02889261abf Merge: d475fac95779 2b7403035459 Author: Linus Torvalds Date: Thu Aug 23 19:20:12 2018 -0700 Merge branch 'akpm' (patches from Andrew) Merge yet more updates from Andrew Morton: - the rest of MM - various misc fixes and tweaks * emailed patches from Andrew Morton : (22 commits) mm: Change return type int to vm_fault_t for fault handlers lib/fonts: convert comments to utf-8 s390: ebcdic: convert comments to UTF-8 treewide: convert ISO_8859-1 text comments to utf-8 drivers/gpu/drm/gma500/: change return type to vm_fault_t docs/core-api: mm-api: add section about GFP flags docs/mm: make GFP flags descriptions usable as kernel-doc docs/core-api: split memory management API to a separate file docs/core-api: move *{str,mem}dup* to "String Manipulation" docs/core-api: kill trailing whitespace in kernel-api.rst mm/util: add kernel-doc for kvfree mm/util: make strndup_user description a kernel-doc comment fs/proc/vmcore.c: hide vmcoredd_mmap_dumps() for nommu builds treewide: correct "differenciate" and "instanciate" typos fs/afs: use new return type vm_fault_t drivers/hwtracing/intel_th/msu.c: change return type to vm_fault_t mm: soft-offline: close the race against page allocation mm: fix race on soft-offlining free huge pages namei: allow restricted O_CREAT of FIFOs and regular files hfs: prevent crash on exit from failed search ... commit 2b7403035459c75e193c6b04a293e518a4212de0 Author: Souptick Joarder Date: Thu Aug 23 17:01:36 2018 -0700 mm: Change return type int to vm_fault_t for fault handlers Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") The aim is to change the return type of finish_fault() and handle_mm_fault() to vm_fault_t type. As part of that clean up return type of all other recursively called functions have been changed to vm_fault_t type. The places from where handle_mm_fault() is getting invoked will be change to vm_fault_t type but in a separate patch. vmf_error() is the newly introduce inline function in 4.17-rc6. [akpm@linux-foundation.org: don't shadow outer local `ret' in __do_huge_pmd_anonymous_page()] Link: http://lkml.kernel.org/r/20180604171727.GA20279@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Reviewed-by: Andrew Morton Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a99237afc12ba697159ca313525dc390737dd52f Author: Arnd Bergmann Date: Thu Aug 23 17:01:32 2018 -0700 lib/fonts: convert comments to utf-8 The font files contain bit masks for characters in the cp437 character set, and comments showing what character this is supposed to be. This only makes sense when the terminal used to view the files is set to the same codepage, but all other files in the kernel now use utf-8 encoding. This changes those comments to utf-8 as well, for consistency. Link: http://lkml.kernel.org/r/20180724111600.4158975-3-arnd@arndb.de Signed-off-by: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8f2bc80c6ef8b940b86d0ab49743443a149acf7e Author: Arnd Bergmann Date: Thu Aug 23 17:01:29 2018 -0700 s390: ebcdic: convert comments to UTF-8 The ebcdic.c file contains tables for converting between ebcdic and PC codepage 437. I could however not identify which encoding was used for the comments. This seems to be some variation of ISO_8859-1 with non-UTF-8 escape characters. I have converted this to UTF-8 by manually removing the escape characters and then running it through recode, to get the same encoding that we use for the rest of the kernel. Link: http://lkml.kernel.org/r/20180724111600.4158975-2-arnd@arndb.de Signed-off-by: Arnd Bergmann Cc: Martin Schwidefsky Cc: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3723c63247854c97fe044c12a40e29043e9bbc1b Author: Arnd Bergmann Date: Thu Aug 23 17:01:26 2018 -0700 treewide: convert ISO_8859-1 text comments to utf-8 Almost all files in the kernel are either plain text or UTF-8 encoded. A couple however are ISO_8859-1, usually just a few characters in a C comments, for historic reasons. This converts them all to UTF-8 for consistency. Link: http://lkml.kernel.org/r/20180724111600.4158975-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Acked-by: Simon Horman [IPVS portion] Acked-by: Jonathan Cameron [IIO] Acked-by: Michael Ellerman [powerpc] Acked-by: Rob Herring Cc: Joe Perches Cc: Arnd Bergmann Cc: Samuel Ortiz Cc: "David S. Miller" Cc: Rob Herring Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0edf68137541a58984cc3a35a193558057f035cb Author: Souptick Joarder Date: Thu Aug 23 17:01:22 2018 -0700 drivers/gpu/drm/gma500/: change return type to vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_{pfn,mixed} returns err which driver mapped into VM_FAULT_* type. The new function vmf_insert_{pfn,mixed} will replace this inefficiency by returning VM_FAULT_* type. vmf_error() is the newly introduce inline function in 4.17-rc6. Link: http://lkml.kernel.org/r/20180713154541.GA3345@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Cc: David Airlie Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Patrik Jakobsson Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 038a07a5420a59f1291dcf2a506f66335ec1cf9c Author: Mike Rapoport Date: Thu Aug 23 17:01:19 2018 -0700 docs/core-api: mm-api: add section about GFP flags Link: http://lkml.kernel.org/r/1532626360-16650-8-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 263fade51f7bdd5ad7ebbfe82113a44c5ea4c36c Author: Mike Rapoport Date: Thu Aug 23 17:01:15 2018 -0700 docs/mm: make GFP flags descriptions usable as kernel-doc This patch adds DOC: headings for GFP flag descriptions and adjusts the formatting to fit sphinx expectations of paragraphs. Link: http://lkml.kernel.org/r/1532626360-16650-7-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 41f35b395c52c938363d41ff8db6527ff1bd7759 Author: Mike Rapoport Date: Thu Aug 23 17:01:12 2018 -0700 docs/core-api: split memory management API to a separate file This is basically copy-paste of the memory management section from kernel-api.rst with some minor adjustments: * The "User Space Memory Access" is moved to the beginning * The get_user_pages_fast reference is now a part of "User Space Memory Access" * And, of course, headings are adjusted with section being promoted to chapters Link: http://lkml.kernel.org/r/1532626360-16650-6-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1595617655f376a3dfa9d5e13ed953effe3476cb Author: Mike Rapoport Date: Thu Aug 23 17:01:09 2018 -0700 docs/core-api: move *{str,mem}dup* to "String Manipulation" The string and memory duplication routines fit better to the "String Manipulation" section than to "The SLAB Cache". Link: http://lkml.kernel.org/r/1532626360-16650-5-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7463f650be27887ede138b9c02dd1dcdf86f07d1 Author: Mike Rapoport Date: Thu Aug 23 17:01:05 2018 -0700 docs/core-api: kill trailing whitespace in kernel-api.rst Link: http://lkml.kernel.org/r/1532626360-16650-4-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ff4dc77293ec7aafb022b9b40b14ee188d43c901 Author: Mike Rapoport Date: Thu Aug 23 17:01:02 2018 -0700 mm/util: add kernel-doc for kvfree Link: http://lkml.kernel.org/r/1532626360-16650-3-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b86181f1ad94054ae953d81452329377abeec0a8 Author: Mike Rapoport Date: Thu Aug 23 17:00:59 2018 -0700 mm/util: make strndup_user description a kernel-doc comment Patch series "memory management documentation updates", v3. Here are several updates to the mm documentation. Aside from really minor changes in the first three patches, the updates are: * move the documentation of kstrdup and friends to "String Manipulation" section * split memory management API into a separate .rst file * adjust formating of the GFP flags description and include it in the reference documentation. This patch (of 7): The description of the strndup_user function misses '*' character at the beginning of the comment to be proper kernel-doc. Add the missing character. Link: http://lkml.kernel.org/r/1532626360-16650-2-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a2036a1ef2ee91acab01a0ae4a534070691a42ec Author: Arnd Bergmann Date: Thu Aug 23 17:00:55 2018 -0700 fs/proc/vmcore.c: hide vmcoredd_mmap_dumps() for nommu builds Without CONFIG_MMU, we get a build warning: fs/proc/vmcore.c:228:12: error: 'vmcoredd_mmap_dumps' defined but not used [-Werror=unused-function] static int vmcoredd_mmap_dumps(struct vm_area_struct *vma, unsigned long dst, The function is only referenced from an #ifdef'ed caller, so this uses the same #ifdef around it. Link: http://lkml.kernel.org/r/20180525213526.2117790-1-arnd@arndb.de Fixes: 7efe48df8a3d ("vmcore: append device dumps to vmcore as elf notes") Signed-off-by: Arnd Bergmann Cc: Ganesh Goudar Cc: "David S. Miller" Cc: Rahul Lakkireddy Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3cc97bea600372885923a1c270d82523411a4c70 Author: Finn Thain Date: Thu Aug 23 17:00:52 2018 -0700 treewide: correct "differenciate" and "instanciate" typos Also add these typos to spelling.txt so checkpatch.pl will look for them. Link: http://lkml.kernel.org/r/88af06b9de34d870cb0afc46cfd24e0458be2575.1529471371.git.fthain@telegraphics.com.au Signed-off-by: Finn Thain Cc: Masahiro Yamada Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0722f1862059767309b22e9469897eb9380d7a25 Author: Souptick Joarder Date: Thu Aug 23 17:00:48 2018 -0700 fs/afs: use new return type vm_fault_t Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. See 1c8f422059ae ("mm: change return type to vm_fault_t") for reference. Link: http://lkml.kernel.org/r/20180702152017.GA3780@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Cc: Matthew Wilcox Cc: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 42df050930e7dade82b4d38959320aa05f4022e3 Author: Souptick Joarder Date: Thu Aug 23 17:00:45 2018 -0700 drivers/hwtracing/intel_th/msu.c: change return type to vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. See 1c8f422059ae ("mm: change return type to vm_fault_t") for reference. Link: http://lkml.kernel.org/r/20180702155801.GA4010@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Cc: Alexander Shishkin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d4ae9916ea2947341180d2b538f48875ff393a86 Author: Naoya Horiguchi Date: Thu Aug 23 17:00:42 2018 -0700 mm: soft-offline: close the race against page allocation A process can be killed with SIGBUS(BUS_MCEERR_AR) when it tries to allocate a page that was just freed on the way of soft-offline. This is undesirable because soft-offline (which is about corrected error) is less aggressive than hard-offline (which is about uncorrected error), and we can make soft-offline fail and keep using the page for good reason like "system is busy." Two main changes of this patch are: - setting migrate type of the target page to MIGRATE_ISOLATE. As done in free_unref_page_commit(), this makes kernel bypass pcplist when freeing the page. So we can assume that the page is in freelist just after put_page() returns, - setting PG_hwpoison on free page under zone->lock which protects freelists, so this allows us to avoid setting PG_hwpoison on a page that is decided to be allocated soon. [akpm@linux-foundation.org: tweak set_hwpoison_free_buddy_page() comment] Link: http://lkml.kernel.org/r/1531452366-11661-3-git-send-email-n-horiguchi@ah.jp.nec.com Signed-off-by: Naoya Horiguchi Reported-by: Xishi Qiu Tested-by: Mike Kravetz Cc: Michal Hocko Cc: Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6bc9b56433b76e40d11099338d27fbc5cd2935ca Author: Naoya Horiguchi Date: Thu Aug 23 17:00:38 2018 -0700 mm: fix race on soft-offlining free huge pages Patch series "mm: soft-offline: fix race against page allocation". Xishi recently reported the issue about race on reusing the target pages of soft offlining. Discussion and analysis showed that we need make sure that setting PG_hwpoison should be done in the right place under zone->lock for soft offline. 1/2 handles free hugepage's case, and 2/2 hanldes free buddy page's case. This patch (of 2): There's a race condition between soft offline and hugetlb_fault which causes unexpected process killing and/or hugetlb allocation failure. The process killing is caused by the following flow: CPU 0 CPU 1 CPU 2 soft offline get_any_page // find the hugetlb is free mmap a hugetlb file page fault ... hugetlb_fault hugetlb_no_page alloc_huge_page // succeed soft_offline_free_page // set hwpoison flag mmap the hugetlb file page fault ... hugetlb_fault hugetlb_no_page find_lock_page return VM_FAULT_HWPOISON mm_fault_error do_sigbus // kill the process The hugetlb allocation failure comes from the following flow: CPU 0 CPU 1 mmap a hugetlb file // reserve all free page but don't fault-in soft offline get_any_page // find the hugetlb is free soft_offline_free_page // set hwpoison flag dissolve_free_huge_page // fail because all free hugepages are reserved page fault ... hugetlb_fault hugetlb_no_page alloc_huge_page ... dequeue_huge_page_node_exact // ignore hwpoisoned hugepage // and finally fail due to no-mem The root cause of this is that current soft-offline code is written based on an assumption that PageHWPoison flag should be set at first to avoid accessing the corrupted data. This makes sense for memory_failure() or hard offline, but does not for soft offline because soft offline is about corrected (not uncorrected) error and is safe from data lost. This patch changes soft offline semantics where it sets PageHWPoison flag only after containment of the error page completes successfully. Link: http://lkml.kernel.org/r/1531452366-11661-2-git-send-email-n-horiguchi@ah.jp.nec.com Signed-off-by: Naoya Horiguchi Reported-by: Xishi Qiu Suggested-by: Xishi Qiu Tested-by: Mike Kravetz Cc: Michal Hocko Cc: Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 30aba6656f61ed44cba445a3c0d38b296fa9e8f5 Author: Salvatore Mesoraca Date: Thu Aug 23 17:00:35 2018 -0700 namei: allow restricted O_CREAT of FIFOs and regular files Disallows open of FIFOs or regular files not owned by the user in world writable sticky directories, unless the owner is the same as that of the directory or the file is opened without the O_CREAT flag. The purpose is to make data spoofing attacks harder. This protection can be turned on and off separately for FIFOs and regular files via sysctl, just like the symlinks/hardlinks protection. This patch is based on Openwall's "HARDEN_FIFO" feature by Solar Designer. This is a brief list of old vulnerabilities that could have been prevented by this feature, some of them even allow for privilege escalation: CVE-2000-1134 CVE-2007-3852 CVE-2008-0525 CVE-2009-0416 CVE-2011-4834 CVE-2015-1838 CVE-2015-7442 CVE-2016-7489 This list is not meant to be complete. It's difficult to track down all vulnerabilities of this kind because they were often reported without any mention of this particular attack vector. In fact, before hardlinks/symlinks restrictions, fifos/regular files weren't the favorite vehicle to exploit them. [s.mesoraca16@gmail.com: fix bug reported by Dan Carpenter] Link: https://lkml.kernel.org/r/20180426081456.GA7060@mwanda Link: http://lkml.kernel.org/r/1524829819-11275-1-git-send-email-s.mesoraca16@gmail.com [keescook@chromium.org: drop pr_warn_ratelimited() in favor of audit changes in the future] [keescook@chromium.org: adjust commit subjet] Link: http://lkml.kernel.org/r/20180416175918.GA13494@beast Signed-off-by: Salvatore Mesoraca Signed-off-by: Kees Cook Suggested-by: Solar Designer Suggested-by: Kees Cook Cc: Al Viro Cc: Dan Carpenter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dc2572791d3a41bab94400af2b6bca9d71ccd303 Author: Ernesto A. Fernández Date: Thu Aug 23 17:00:31 2018 -0700 hfs: prevent crash on exit from failed search hfs_find_exit() expects fd->bnode to be NULL after a search has failed. hfs_brec_insert() may instead set it to an error-valued pointer. Fix this to prevent a crash. Link: http://lkml.kernel.org/r/53d9749a029c41b4016c495fc5838c9dba3afc52.1530294815.git.ernesto.mnd.fernandez@gmail.com Signed-off-by: Ernesto A. Fernández Cc: Anatoly Trosinenko Cc: Viacheslav Dubeyko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit aba93a92f49a002e2251e1745994c762cee01843 Author: Ernesto A. Fernandez Date: Thu Aug 23 17:00:28 2018 -0700 hfsplus: prevent crash on exit from failed search hfs_find_exit() expects fd->bnode to be NULL after a search has failed. hfs_brec_insert() may instead set it to an error-valued pointer. Fix this to prevent a crash. Link: http://lkml.kernel.org/r/803590a35221fbf411b2c141419aea3233a6e990.1530294813.git.ernesto.mnd.fernandez@gmail.com Signed-off-by: Ernesto A. Fernandez Reported-by: Anatoly Trosinenko Reviewed-by: Vyacheslav Dubeyko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a7ec7a4193a2eb3b5341243fc0b621c1ac9e4ec4 Author: Ernesto A. Fernández Date: Thu Aug 23 17:00:25 2018 -0700 hfsplus: fix NULL dereference in hfsplus_lookup() An HFS+ filesystem can be mounted read-only without having a metadata directory, which is needed to support hardlinks. But if the catalog data is corrupted, a directory lookup may still find dentries claiming to be hardlinks. hfsplus_lookup() does check that ->hidden_dir is not NULL in such a situation, but mistakenly does so after dereferencing it for the first time. Reorder this check to prevent a crash. This happens when looking up corrupted catalog data (dentry) on a filesystem with no metadata directory (this could only ever happen on a read-only mount). Wen Xu sent the replication steps in detail to the fsdevel list: https://bugzilla.kernel.org/show_bug.cgi?id=200297 Link: http://lkml.kernel.org/r/20180712215344.q44dyrhymm4ajkao@eaf Signed-off-by: Ernesto A. Fernández Reported-by: Wen Xu Cc: Viacheslav Dubeyko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d475fac95779577afefbad312c8635c29fe4441c Author: Will Deacon Date: Fri Aug 24 00:23:04 2018 +0100 arm64: tlb: Provide forward declaration of tlb_flush() before including tlb.h As of commit fd1102f0aade ("mm: mmu_notifier fix for tlb_end_vma"), asm-generic/tlb.h now calls tlb_flush() from a static inline function, so we need to make sure that it's declared before #including the asm-generic header in the arch header. Signed-off-by: Will Deacon Acked-by: Nicholas Piggin Signed-off-by: Linus Torvalds commit d503ac531a5246e4d910f971b213807fea925956 Author: Masahiro Yamada Date: Fri Aug 24 08:20:39 2018 +0900 kbuild: rename LDFLAGS to KBUILD_LDFLAGS Commit a0f97e06a43c ("kbuild: enable 'make CFLAGS=...' to add additional options to CC") renamed CFLAGS to KBUILD_CFLAGS. Commit 222d394d30e7 ("kbuild: enable 'make AFLAGS=...' to add additional options to AS") renamed AFLAGS to KBUILD_AFLAGS. Commit 06c5040cdb13 ("kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP") renamed CPPFLAGS to KBUILD_CPPFLAGS. For some reason, LDFLAGS was not renamed. Using a well-known variable like LDFLAGS may result in accidental override of the variable. Kbuild generally uses KBUILD_ prefixed variables for the internally appended options, so here is one more conversion to sanitize the naming convention. I did not touch Makefiles under tools/ since the tools build system is a different world. Signed-off-by: Masahiro Yamada Acked-by: Kirill A. Shutemov Reviewed-by: Palmer Dabbelt commit 87a32e624037e8b6e8538ed864dc9994853acc4d Author: Masahiro Yamada Date: Fri Aug 24 08:20:38 2018 +0900 kbuild: pass LDFLAGS to recordmcount.pl Since commit 0fbe9a245c60 ("microblaze: add endianness options to LDFLAGS instead of LD"), you cannot build the kernel for microblaze with CONFIG_DYNAMIC_FTRACE. Fixes: 0fbe9a245c60 ("microblaze: add endianness options to LDFLAGS instead of LD") Signed-off-by: Masahiro Yamada commit e85d1d65cd8a9083040e280d172eba762875f8f1 Author: Masahiro Yamada Date: Wed Aug 22 22:51:09 2018 +0900 kbuild: test dead code/data elimination support in Kconfig This config option should be enabled only when both the compiler and the linker support necessary flags. Add proper dependencies to Kconfig. Signed-off-by: Masahiro Yamada commit 53a01c9a5fcf74b7f855e70dd69742fb3cb84c83 Merge: 9157141c95bc 0af4c8be97a1 Author: Linus Torvalds Date: Thu Aug 23 16:03:58 2018 -0700 Merge tag 'nfs-for-4.19-1' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client updates from Anna Schumaker: "These patches include adding async support for the v4.2 COPY operation. I think Bruce is planning to send the server patches for the next release, but I figured we could get the client side out of the way now since it's been in my tree for a while. This shouldn't cause any problems, since the server will still respond with synchronous copies even if the client requests async. Features: - Add support for asynchronous server-side COPY operations Stable bufixes: - Fix an off-by-one in bl_map_stripe() (v3.17+) - NFSv4 client live hangs after live data migration recovery (v4.9+) - xprtrdma: Fix disconnect regression (v4.18+) - Fix locking in pnfs_generic_recover_commit_reqs (v4.14+) - Fix a sleep in atomic context in nfs4_callback_sequence() (v4.9+) Other bugfixes and cleanups: - Optimizations and fixes involving NFS v4.1 / pNFS layout handling - Optimize lseek(fd, SEEK_CUR, 0) on directories to avoid locking - Immediately reschedule writeback when the server replies with an error - Fix excessive attribute revalidation in nfs_execute_ok() - Add error checking to nfs_idmap_prepare_message() - Use new vm_fault_t return type - Return a delegation when reclaiming one that the server has recalled - Referrals should inherit proto setting from parents - Make rpc_auth_create_args a const - Improvements to rpc_iostats tracking - Fix a potential reference leak when there is an error processing a callback - Fix rmdir / mkdir / rename nlink accounting - Fix updating inode change attribute - Fix error handling in nfsn4_sp4_select_mode() - Use an appropriate work queue for direct-write completion - Don't busy wait if NFSv4 session draining is interrupted" * tag 'nfs-for-4.19-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (54 commits) pNFS: Remove unwanted optimisation of layoutget pNFS/flexfiles: ff_layout_pg_init_read should exit on error pNFS: Treat RECALLCONFLICT like DELAY... pNFS: When updating the stateid in layoutreturn, also update the recall range NFSv4: Fix a sleep in atomic context in nfs4_callback_sequence() NFSv4: Fix locking in pnfs_generic_recover_commit_reqs NFSv4: Fix a typo in nfs4_init_channel_attrs() NFSv4: Don't busy wait if NFSv4 session draining is interrupted NFS recover from destination server reboot for copies NFS add a simple sync nfs4_proc_commit after async COPY NFS handle COPY ERR_OFFLOAD_NO_REQS NFS send OFFLOAD_CANCEL when COPY killed NFS export nfs4_async_handle_error NFS handle COPY reply CB_OFFLOAD call race NFS add support for asynchronous COPY NFS COPY xdr handle async reply NFS OFFLOAD_CANCEL xdr NFS CB_OFFLOAD xdr NFS: Use an appropriate work queue for direct-write completion NFSv4: Fix error handling in nfs4_sp4_select_mode() ... commit 9157141c95bc3ffcdae93fde5d5aafee7ce6e39a Merge: 6f7948f566bf 108b833cde9c Author: Linus Torvalds Date: Thu Aug 23 16:00:10 2018 -0700 Merge tag 'nfsd-4.19-1' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Chuck Lever fixed a problem with NFSv4.0 callbacks over GSS from multi-homed servers. The only new feature is a minor bit of protocol (change_attr_type) which the client doesn't even use yet. Other than that, various bugfixes and cleanup" * tag 'nfsd-4.19-1' of git://linux-nfs.org/~bfields/linux: (27 commits) sunrpc: Add comment defining gssd upcall API keywords nfsd: Remove callback_cred nfsd: Use correct credential for NFSv4.0 callback with GSS sunrpc: Extract target name into svc_cred sunrpc: Enable the kernel to specify the hostname part of service principals sunrpc: Don't use stack buffer with scatterlist rpc: remove unneeded variable 'ret' in rdma_listen_handler nfsd: use true and false for boolean values nfsd: constify write_op[] fs/nfsd: Delete invalid assignment statements in nfsd4_decode_exchange_id NFSD: Handle full-length symlinks NFSD: Refactor the generic write vector fill helper svcrdma: Clean up Read chunk path svcrdma: Avoid releasing a page in svc_xprt_release() nfsd: Mark expected switch fall-through sunrpc: remove redundant variables 'checksumlen','blocksize' and 'data' nfsd: fix leaked file lock with nfs exported overlayfs nfsd: don't advertise a SCSI layout for an unsupported request_queue nfsd: fix corrupted reply to badly ordered compound nfsd: clarify check_op_ordering ... commit 6f7948f566bf423ddf5ff58dc0198afcf37c0b64 Merge: b39d7efc11b9 99a24e02ccf6 Author: Linus Torvalds Date: Thu Aug 23 15:58:04 2018 -0700 Merge tag 'upstream-4.19-rc1' of git://git.infradead.org/linux-ubifs Pull UBI/UBIFS updates from Richard Weinberger: - Year 2038 preparations - New UBI feature to skip CRC checks of static volumes - A new Kconfig option to disable xattrs in UBIFS - Lots of fixes in UBIFS, found by our new test framework * tag 'upstream-4.19-rc1' of git://git.infradead.org/linux-ubifs: (21 commits) ubifs: Set default assert action to read-only ubifs: Allow setting assert action as mount parameter ubifs: Rework ubifs_assert() ubifs: Pass struct ubifs_info to ubifs_assert() ubifs: Turn two ubifs_assert() into a WARN_ON() ubi: expose the volume CRC check skip flag ubi: provide a way to skip CRC checks ubifs: Use kmalloc_array() ubifs: Check data node size before truncate Revert "UBIFS: Fix potential integer overflow in allocation" ubifs: Add comment on c->commit_sem ubifs: introduce Kconfig symbol for xattr support ubifs: use swap macro in swap_dirty_idx ubifs: tnc: use monotonic znode timestamp ubifs: use timespec64 for inode timestamps ubifs: xattr: Don't operate on deleted inodes ubifs: gc: Fix typo ubifs: Fix memory leak in lprobs self-check ubi: Initialize Fastmap checkmapping correctly ubifs: Fix synced_i_size calculation for xattr inodes ... commit b39d7efc11b93d9150d99a731db26fd36e2facd2 Merge: 06e386a1db54 8cdc43afbb2c Author: Linus Torvalds Date: Thu Aug 23 15:51:09 2018 -0700 Merge tag 'pwm/for-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "This contains mostly minor bug fixes as well as some new chip support for existing drivers" * tag 'pwm/for-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: pwm: mediatek: Add MT7628 support dt-bindings: pwm: Add MT7628 information dt-bindings: pwm: rcar: Add bindings for R-Car E3 support pwm: meson: Fix mux clock names pwm: stm32-lp: Remove useless loop in stm32_pwm_lp_remove() pwm: omap-dmtimer: Return -EPROBE_DEFER if no dmtimer platform data pwm: mxs: Switch to SPDX identifier dt-bindings: pwm: fsl-ftm: Add compatible string for i.MX8QM pwm: fsl-ftm: Enable support for the new SoC i.MX8QM pwm: fsl-ftm: Added the support of per-compatible data pwm: fsl-ftm: Added a dedicated IP interface clock pwm: cros-ec: Switch to SPDX identifier pwm: imx: Switch to SPDX identifier pwm: tiehrpwm: Fix disabling of output of PWMs pwm: tiehrpwm: Don't use emulation mode bits to control PWM output pwm: berlin: Don't use broken prescaler values commit 06e386a1db54ab6a671e103e929b590f7a88f0e3 Merge: 99897b1e9931 f39684524b39 Author: Linus Torvalds Date: Thu Aug 23 15:44:58 2018 -0700 Merge tag 'fbdev-v4.19' of https://github.com/bzolnier/linux Pull fbdev updates from Bartlomiej Zolnierkiewicz: "Mostly small fixes and cleanups for fb drivers (the biggest updates are for udlfb and pxafb drivers). This also adds deferred console takeover support to the console code and efifb driver. Summary: - add support for deferred console takeover, when enabled defers fbcon taking over the console from the dummy console until the first text is displayed on the console - together with the "quiet" kernel commandline option this allows fbcon to still be used together with a smooth graphical bootup (Hans de Goede) - improve console locking debugging code (Thomas Zimmermann) - copy the ACPI BGRT boot graphics to the framebuffer when deferred console takeover support is used in efifb driver (Hans de Goede) - update udlfb driver - fix lost console when the user unplugs a USB adapter, fix the screen corruption issue, fix locking and add some performance optimizations (Mikulas Patocka) - update pxafb driver - fix using uninitialized memory, switch to devm_* API, handle initialization errors and add support for lcd-supply regulator (Daniel Mack) - add support for boards booted with a DeviceTree in pxa3xx_gcu driver (Daniel Mack) - rename omap2 module to omap2fb.ko to avoid conflicts with omap1 driver (Arnd Bergmann) - enable ACPI-based enumeration for goldfishfb driver (Yu Ning) - fix goldfishfb driver to make user space Android code use 60 fps (Christoffer Dall) - print big fat warning when nomodeset kernel parameter is used in vgacon driver (Lyude Paul) - remove VLA usage from fsl-diu-fb driver (Kees Cook) - misc fixes (Julia Lawall, Geert Uytterhoeven, Fredrik Noring, Yisheng Xie, Dan Carpenter, Daniel Vetter, Anton Vasilyev, Randy Dunlap, Gustavo A. R. Silva, Colin Ian King, Fengguang Wu) - misc cleanups (Roman Kiryanov, Yisheng Xie, Colin Ian King)" * tag 'fbdev-v4.19' of https://github.com/bzolnier/linux: (54 commits) Documentation/fb: corrections for fbcon.txt fbcon: Do not takeover the console from atomic context dummycon: Stop exporting dummycon_[un]register_output_notifier fbcon: Only defer console takeover if the current console driver is the dummycon fbcon: Only allow FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER if fbdev is builtin fbdev: omap2: omapfb: fix ifnullfree.cocci warnings fbdev: omap2: omapfb: fix bugon.cocci warnings fbdev: omap2: omapfb: fix boolreturn.cocci warnings fb: amifb: fix build warnings when not builtin fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set console: Replace #if 0 with atomic var 'ignore_console_lock_warning' udlfb: use spin_lock_irq instead of spin_lock_irqsave udlfb: avoid prefetch udlfb: optimization - test the backing buffer udlfb: allow reallocating the framebuffer udlfb: set line_length in dlfb_ops_set_par udlfb: handle allocation failure udlfb: set optimal write delay udlfb: make a local copy of fb_ops udlfb: don't switch if we are switching to the same videomode ... commit 99897b1e99311e67056808531141c8e16c221d42 Merge: 1290290c922f 8a328ac1f9eb Author: Linus Torvalds Date: Thu Aug 23 15:37:24 2018 -0700 Merge tag 'sound-fix-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "No surprises here: a regression fix for virmidi code refactoring, three fixes for the new AC97 bus compat and runtime PM, and a usual HD-audio quirk" * tag 'sound-fix-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Fix HP Headset Mic can't record ALSA: ac97: fix unbalanced pm_runtime_enable ALSA: ac97: fix check of pm_runtime_get_sync failure ALSA: ac97: fix device initialization in the compat layer ALSA: seq: virmidi: Fix discarding the unsubscribed output commit 1290290c922fdcefbce8984e6e44b8f4e3a169b5 Merge: 706a1ea65e6f 845b397a7771 Author: Linus Torvalds Date: Thu Aug 23 15:34:48 2018 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull more rdma updates from Jason Gunthorpe: "This is the SMC cleanup promised, a randconfig regression fix, and kernel oops fix. Summary: - Switch SMC over to rdma_get_gid_attr and remove the compat - Fix a crash in HFI1 with some BIOS's - Fix a randconfig failure" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: IB/ucm: fix UCM link error IB/hfi1: Invalid NUMA node information can cause a divide by zero RDMA/smc: Replace ib_query_gid with rdma_get_gid_attr commit 706a1ea65e6faaf853427a0e931f59d604dd45e3 Merge: d40acad1f197 48a8b97cfd80 Author: Linus Torvalds Date: Thu Aug 23 14:55:01 2018 -0700 Merge branch 'tlb-fixes' Merge fixes for missing TLB shootdowns. This fixes a couple of cases that involved us possibly freeing page table structures before the required TLB shootdown had been done. There are a few cleanup patches to make the code easier to follow, and to avoid some of the more problematic cases entirely when not necessary. To make this easier for backports, it undoes the recent lazy TLB patches, because the cleanups and fixes are more important, and Rik is ok with re-doing them later when things have calmed down. The missing TLB flush was only delayed, and the wrong ordering only happened under memory pressure (and in theory under a couple of other fairly theoretical situations), so this may have been all very unlikely to have hit people in practice. But getting the TLB shootdown wrong is _so_ hard to debug and see that I consider this a crticial fix. Many thanks to Jann Horn for having debugged this. * tlb-fixes: x86/mm: Only use tlb_remove_table() for paravirt mm: mmu_notifier fix for tlb_end_vma mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE mm/tlb: Remove tlb_remove_table() non-concurrent condition mm: move tlb_table_flush to tlb_flush_mmu_free x86/mm/tlb: Revert the recent lazy TLB patches commit d40acad1f1979194ecda83f77468751244b4b098 Merge: 0c4b0f815f20 75f2d3a0cef5 Author: Linus Torvalds Date: Thu Aug 23 14:52:23 2018 -0700 Merge tag 'for-linus-4.19b-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes and cleanups from Juergen Gross: "Some cleanups, some minor fixes and a fix for a bug introduced in this merge window hitting 32-bit PV guests" * tag 'for-linus-4.19b-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/xen: enable early use of set_fixmap in 32-bit Xen PV guest xen: remove unused hypercall functions x86/xen: remove unused function xen_auto_xlated_memory_setup() xen/ACPI: don't upload Px/Cx data for disabled processors x86/Xen: further refine add_preferred_console() invocations xen/mcelog: eliminate redundant setting of interface version x86/Xen: mark xen_setup_gdt() __init commit 0c4b0f815f20304156f66d47d0c2a6e148f6ffaa Merge: 2ab054fd1f88 690d9163bf4b Author: Linus Torvalds Date: Thu Aug 23 14:23:08 2018 -0700 Merge tag 'mips_4.19_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Paul Burton: - Fix microMIPS build failures by adding a .insn directive to the barrier_before_unreachable() asm statement in order to convince the toolchain that the asm statement is a valid branch target rather than a bogus attempt to switch ISA. - Clean up our declarations of TLB functions that we overwrite with generated code in order to prevent the compiler making assumptions about alignment that cause microMIPS kernels built with GCC 7 & above to die early during boot. - Fix up a regression for MIPS32 kernels which slipped into the main MIPS pull for 4.19, causing CONFIG_32BIT=y kernels to contain inappropriate MIPS64 instructions. - Extend our existing workaround for MIPSr6 builds that end up using the __multi3 intrinsic to GCC 7 & below, rather than just GCC 7. * tag 'mips_4.19_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7 MIPS: Workaround GCC __builtin_unreachable reordering bug compiler.h: Allow arch-specific asm/compiler.h MIPS: Avoid move psuedo-instruction whilst using MIPS_ISA_LEVEL MIPS: Consistently declare TLB functions MIPS: Export tlbmiss_handler_setup_pgd near its definition commit 2ab054fd1f88d7d22e6df7c34c41a2f9782c3f08 Merge: 2f34a64aeac4 5600779ea5f3 Author: Linus Torvalds Date: Thu Aug 23 14:09:37 2018 -0700 Merge tag 'for-linus' of git://github.com/openrisc/linux Pull OpenRISC update from Stafford Horne: "Just one change for 4.19: refactoring from Christoph Hellwig to use generic DMA facilities" * tag 'for-linus' of git://github.com/openrisc/linux: openrisc: use generic dma_noncoherent_ops openrisc: fix cache maintainance the the sync_single_for_device DMA operation openrisc: remove the no-op unmap_page and unmap_sg DMA operations openrisc: remove the sync_single_for_cpu DMA operation commit 2f34a64aeac4d87e8ed8275d9f1230e18a50079c Merge: ee090756962c afd3e3dad676 Author: Linus Torvalds Date: Thu Aug 23 14:02:22 2018 -0700 Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM device-tree updates from Olof Johansson: "Business as usual -- the bulk of our changes are to devicetree files with new hardware support, new SoCs and platforms, and new board types. New SoCs/platforms: - Raspberry Pi Compute Module (CM1) and IO board - i.MX6SSL from NXP - Renesas RZ/N1D SoC (R9A06G032), Dual Cortex-A7 with Ethernet, CAN and PLC interfaces - TI AM654 SoC, Quad Cortex-A53, safety subsystem with Cortex-R5 controllers, communication and PRU subsystem and lots of other interfaces (PCIe, USB3, etc). New boards and systems: - Several Atmel at91-based boards from Laird - Marvell Armada388-based Helios4 board from SolidRun - Samsung Aires-based phones (s5pv210) - Allwinner A64-based Pinebook laptop In addition to the above, there's the usual amount of new devices described on existing platforms, fixes and tweaks and new minor variants of boards/platforms" * tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (478 commits) arm64: dts: sdm845: Add tsens nodes arm64: dts: msm8996: thermal: Initialise via DT and add second controller arm64: dts: sprd: Add one suspend timer arm64: dts: sprd: Add SC27XX ADC device arm64: dts: sprd: Add SC27XX eFuse device arm64: dts: sprd: Add SC27XX vibrator device arm64: dts: sprd: Add SC27XX breathing light controller device arm64: dts: meson-axg: add spdif-dit codec arm64: dts: meson-axg: add lineout codec arm64: dts: meson-axg: add linein codec arm64: dts: meson-axg: add tdm interfaces arm64: dts: meson-axg: add tdmout formatters arm64: dts: meson-axg: add tdmin formatters arm64: dts: meson-axg: add spdifout arm64: dts: rockchip: add led support for Firefly-RK3399 arm64: dts: rockchip: remove deprecated Type-C PHY properties on rk3399 arm64: dts: rockchip: add power button support for Firefly-RK3399 ARM: dts: aspeed: Add coprocessor interrupt controller arm64: dts: meson-axg: add audio arb reset controller arm64: dts: meson-axg: add usb power regulator ... commit ee090756962c58b32af62b768ac7c58cc53af700 Merge: f3ea49621381 07d268f541de Author: Linus Torvalds Date: Thu Aug 23 14:00:05 2018 -0700 Merge tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC defconfig updates from Olof Johansson: "We keep these separate since some files are shared and conflict-prone, but there isn't really much to write about here. Some of the churnier pieces is for the Aspeed platforms, which did an overdue refresh of the defconfig, and enabled USB gadget and some drivers from there. Most of the rest are minor additions here and there to turn on drivers that are needed or useful on the various platforms" * tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (39 commits) ARM: multi_v7_defconfig: add CONFIG_UNIPHIER_THERMAL and CONFIG_SNI_AVE ARM: config: aspeed: Enable new FSI drivers ARM: config: multi_v5: Enable ASPEED drivers ARM: config: multi_v5: Refresh configuration ARM: config: aspeed: Update defconfig ARM: multi_v7_defconfig: Enable support for RZN1D-DB ARM: shmobile: defconfig: Disable /sbin/hotplug fork-bomb ARM: shmobile: defconfig: Enable support for RZN1D-DB ARM: shmobile: defconfig: Enable reset controller support ARM: shmobile: defconfig: Drop NET_VENDOR_=n arm64: defconfig: Enable more peripherals for Samsung Chromebook Plus. arm64: defconfig: Enable CONFIG_MTD_NAND_QCOM for IPQ8074 ARM: qcom_defconfig: Enable QCOM NAND related configs ARM: imx_v6_v7_defconfig: add DMATEST support ARM: mvebu_v7_defconfig: enable SFP support ARM: mvebu_v7_defconfig: sync defconfig ARM: multi_v7_defconfig: Add Marvell NAND controller support arm: configs: Add USB gadget to Aspeed G5 defconfig arm: configs: Add USB gadget to Aspeed G4 defconfig arm64: defconfig: enable HiSilicon PMU driver ... commit f3ea496213819c80ce9c49a9b65f9261da713d11 Merge: 9e259f9352d5 29ed45fff058 Author: Linus Torvalds Date: Thu Aug 23 13:52:46 2018 -0700 Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC driver updates from Olof Johansson: "Some of the larger changes this merge window: - Removal of drivers for Exynos5440, a Samsung SoC that never saw widespread use. - Uniphier support for USB3 and SPI reset handling - Syste control and SRAM drivers and bindings for Allwinner platforms - Qualcomm AOSS (Always-on subsystem) reset controller drivers - Raspberry Pi hwmon driver for voltage - Mediatek pwrap (pmic) support for MT6797 SoC" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (52 commits) drivers/firmware: psci_checker: stash and use topology_core_cpumask for hotplug tests soc: fsl: cleanup Kconfig menu soc: fsl: dpio: Convert DPIO documentation to .rst staging: fsl-mc: Remove remaining files staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl staging: fsl-dpaa2: eth: move generic FD defines to DPIO soc: fsl: qe: gpio: Add qe_gpio_set_multiple usb: host: exynos: Remove support for Exynos5440 clk: samsung: Remove support for Exynos5440 soc: sunxi: Add the A13, A23 and H3 system control compatibles reset: uniphier: add reset control support for SPI cpufreq: exynos: Remove support for Exynos5440 ata: ahci-platform: Remove support for Exynos5440 soc: imx6qp: Use GENPD_FLAG_ALWAYS_ON for PU errata soc: mediatek: pwrap: add mt6351 driver for mt6797 SoCs soc: mediatek: pwrap: add pwrap driver for mt6797 SoCs soc: mediatek: pwrap: fix cipher init setting error dt-bindings: pwrap: mediatek: add pwrap support for MT6797 reset: uniphier: add USB3 core reset control dt-bindings: reset: uniphier: add USB3 core reset support ... commit 9e259f9352d52053058a234f7c062c4e4f56dc85 Merge: 5563ae9b39c5 f0fc40aff6fe Author: Linus Torvalds Date: Thu Aug 23 13:44:43 2018 -0700 Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM 32-bit SoC platform updates from Olof Johansson: "Most of the SoC updates in this cycle are cleanups and moves to more modern infrastructure: - Davinci was moved to common clock framework - OMAP1-based Amstrad E3 "Superphone" saw a bunch of cleanups to the keyboard interface (bitbanged AT keyboard via GPIO). - Removal of some stale code for Renesas platforms - Power management improvements for i.MX6LL" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (112 commits) ARM: uniphier: select RESET_CONTROLLER arm64: uniphier: select RESET_CONTROLLER ARM: uniphier: remove empty Makefile ARM: exynos: Clear global variable on init error path ARM: exynos: Remove outdated maintainer information ARM: shmobile: Always enable ARCH_TIMER on SoCs with A7 and/or A15 ARM: shmobile: r8a7779: hide unused r8a7779_platform_cpu_kill soc: r9a06g032: don't build SMP files for non-SMP config ARM: shmobile: Add the R9A06G032 SMP enabler driver ARM: at91: pm: configure wakeup sources for ULP1 mode ARM: at91: pm: add PMC fast startup registers defines ARM: at91: pm: Add ULP1 mode support ARM: at91: pm: Use ULP0 naming instead of slow clock ARM: hisi: handle of_iomap and fix missing of_node_put ARM: hisi: check of_iomap and fix missing of_node_put ARM: hisi: fix error handling and missing of_node_put ARM: mx5: Set the DBGEN bit in ARM_GPC register ARM: imx51: Configure M4IF to avoid visual artifacts ARM: imx: call imx6sx_cpuidle_init() conditionally for 6sll ARM: imx: fix i.MX6SLL build ... commit 5563ae9b39c5ba492be1b18f2d72fd43ba549915 Merge: 452938cbd8f8 7a3b1bf70b37 Author: Linus Torvalds Date: Thu Aug 23 13:37:01 2018 -0700 Merge tag 'riscv-for-linus-4.19-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux Pull RISC-V fixes from Palmer Dabbelt: "This contains a pair of fixes to the RISC-V port: - The removal of our compat.h, which didn't do anything. - Fixes to sys_riscv_flush_icache to ensure it actually shows up. We're going to just call this a bug in the ABI, as it was always supposed to be there. I've given these a simple build+boot test, both individually and as the actual tag" * tag 'riscv-for-linus-4.19-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: riscv: Delete asm/compat.h RISC-V: Don't use a global include guard for uapi/asm/syscalls.h RISC-V: Define sys_riscv_flush_icache when SMP=n commit 7753e38286d2bd7380df8be843de83198e2ce492 Author: Steve French Date: Tue Aug 21 21:37:53 2018 -0500 cifs: update internal module version number for cifs.ko to 2.12 Signed-off-by: Steve French commit 126c97f4d0d1b5b956e8b0740c81a2b2a2ae548c Author: Nicholas Mc Guire Date: Thu Aug 23 12:24:02 2018 +0200 cifs: check kmalloc before use The kmalloc was not being checked - if it fails issue a warning and return -ENOMEM to the caller. Signed-off-by: Nicholas Mc Guire Fixes: b8da344b74c8 ("cifs: dynamic allocation of ntlmssp blob") Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky cc: Stable ` commit e6c47dd0da1e3a484e778046fc10da0b20606a86 Author: Ronnie Sahlberg Date: Wed Aug 22 12:19:24 2018 +1000 cifs: check if SMB2 PDU size has been padded and suppress the warning Some SMB2/3 servers, Win2016 but possibly others too, adds padding not only between PDUs in a compound but also to the final PDU. This padding extends the PDU to a multiple of 8 bytes. Check if the unexpected length looks like this might be the case and avoid triggering the log messages for : "SMB2 server sent bad RFC1001 len %d not %d\n" Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 4d8dfafc5cb88fe294a9273a3ef75dd4f9fa1aa2 Author: Ronnie Sahlberg Date: Tue Aug 21 11:49:21 2018 +1000 cifs: create a define for how many iovs we need for an SMB2_open() Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 452938cbd8f85a39c8a93553191c505a36b1beca Merge: 815f0ddb346c 9161a864ff88 Author: Linus Torvalds Date: Thu Aug 23 13:07:00 2018 -0700 Merge tag 'trace-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "Masami found an off by one bug in the code that keeps "notrace" functions from being traced by kprobes. During my testing, I found that there's places that we may want to add kprobes to notrace, thus we may end up changing this code before 4.19 is released. The history behind this change is that we found that adding kprobes to various notrace functions caused the kernel to crashed. We took the safe route and decided not to allow kprobes to trace any notrace function. But because notrace is added to functions that just cause weird side effects to the function tracer, but are still safe, preventing kprobes for all notrace functios may be too much of a big hammer. One such place is __schedule() is marked notrace, to keep function tracer from doing strange recursive loops when it gets traced with NEED_RESCHED set. With this change, one can not add kprobes to the scheduler. Masami also added code to use gcov on ftrace" * tag 'trace-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/kprobes: Fix to check notrace function with correct range tracing: Allow gcov profiling on only ftrace subsystem commit c08eebad4ac5992f87d783370fcffca5f28631c7 Merge: 0d092f06faa4 3968540ba61e Author: David S. Miller Date: Thu Aug 23 12:37:41 2018 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue Jeff Kirsher says: ==================== Intel Wired LAN Driver Fixes 2018-08-23 This series contains bug fixes to the ice driver. Anirudh provides several fixes, starting with static analysis fixes by replacing a bitwise-and with a constant value and replace "magic" numbers with defines. Fixed the control queue processing by removing unnecessary read/writes to registers, as well as getting a accurate value for "pending". Added additional checks to avoid NULL pointer dereferences. Fixed up code formatting issues, by cleaning up code comments and coding style. Bruce cleans up a duplicate check for owner, within the same function. Also cleans up interrupt causes that are not handled or applicable. Fix checkpatch warning about the use of bool in structures due to the wasted space and size of bool, so convert struct members to u8 instead. Jake fixes a number of potential bugs in the reporting of stats via ethtool, by simply reporting all the queue statistics, even for the queues that are not activated. Fixed a compiler warning, as well as make the code a bit cleaner but just using order_base_2() for calculating the power-of-2. Preethi adds a check to avoid a NULL pointer dereference crash during initialization. Brett clarifies the code when it comes to port VLANs and regular VLANs, by renaming defines and field values to match their intended use and purpose. Jesse initializes a variable to avoid garbage values being returned to the caller. ==================== Signed-off-by: David S. Miller commit 48a8b97cfd804a965fbbe7be2d56a7984ef6bdb1 Author: Peter Zijlstra Date: Wed Aug 22 17:30:16 2018 +0200 x86/mm: Only use tlb_remove_table() for paravirt If we don't use paravirt; don't play unnecessary and complicated games to free page-tables. Suggested-by: Linus Torvalds Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rik van Riel Signed-off-by: Linus Torvalds commit fd1102f0aadec7d18792b132e1d224290b2aecca Author: Nicholas Piggin Date: Thu Aug 23 18:47:09 2018 +1000 mm: mmu_notifier fix for tlb_end_vma The generic tlb_end_vma does not call invalidate_range mmu notifier, and it resets resets the mmu_gather range, which means the notifier won't be called on part of the range in case of an unmap that spans multiple vmas. ARM64 seems to be the only arch I could see that has notifiers and uses the generic tlb_end_vma. I have not actually tested it. [ Catalin and Will point out that ARM64 currently only uses the notifiers for KVM, which doesn't use the ->invalidate_range() callback right now, so it's a bug, but one that happens to not affect them. So not necessary for stable. - Linus ] Signed-off-by: Nicholas Piggin Acked-by: Catalin Marinas Acked-by: Will Deacon Signed-off-by: Linus Torvalds commit d86564a2f085b79ec046a5cba90188e612352806 Author: Peter Zijlstra Date: Wed Aug 22 17:30:15 2018 +0200 mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE Jann reported that x86 was missing required TLB invalidates when he hit the !*batch slow path in tlb_remove_table(). This is indeed the case; RCU_TABLE_FREE does not provide TLB (cache) invalidates, the PowerPC-hash where this code originated and the Sparc-hash where this was subsequently used did not need that. ARM which later used this put an explicit TLB invalidate in their __p*_free_tlb() functions, and PowerPC-radix followed that example. But when we hooked up x86 we failed to consider this. Fix this by (optionally) hooking tlb_remove_table() into the TLB invalidate code. NOTE: s390 was also needing something like this and might now be able to use the generic code again. [ Modified to be on top of Nick's cleanups, which simplified this patch now that tlb_flush_mmu_tlbonly() really only flushes the TLB - Linus ] Fixes: 9e52fc2b50de ("x86/mm: Enable RCU based page table freeing (CONFIG_HAVE_RCU_TABLE_FREE=y)") Reported-by: Jann Horn Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rik van Riel Cc: Nicholas Piggin Cc: David Miller Cc: Will Deacon Cc: Martin Schwidefsky Cc: Michael Ellerman Cc: stable@kernel.org Signed-off-by: Linus Torvalds commit a6f572084fbee8b30f91465f4a085d7a90901c57 Author: Peter Zijlstra Date: Wed Aug 22 17:30:14 2018 +0200 mm/tlb: Remove tlb_remove_table() non-concurrent condition Will noted that only checking mm_users is incorrect; we should also check mm_count in order to cover CPUs that have a lazy reference to this mm (and could do speculative TLB operations). If removing this turns out to be a performance issue, we can re-instate a more complete check, but in tlb_table_flush() eliding the call_rcu_sched(). Fixes: 267239116987 ("mm, powerpc: move the RCU page-table freeing into generic code") Reported-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rik van Riel Acked-by: Will Deacon Cc: Nicholas Piggin Cc: David Miller Cc: Martin Schwidefsky Cc: Michael Ellerman Cc: stable@kernel.org Signed-off-by: Linus Torvalds commit db7ddef301128dad394f1c0f77027f86ee9a4edb Author: Nicholas Piggin Date: Thu Aug 23 18:47:08 2018 +1000 mm: move tlb_table_flush to tlb_flush_mmu_free There is no need to call this from tlb_flush_mmu_tlbonly, it logically belongs with tlb_flush_mmu_free. This makes future fixes simpler. [ This was originally done to allow code consolidation for the mmu_notifier fix, but it also ends up helping simplify the HAVE_RCU_TABLE_INVALIDATE fix. - Linus ] Signed-off-by: Nicholas Piggin Acked-by: Will Deacon Cc: Peter Zijlstra Cc: stable@kernel.org Signed-off-by: Linus Torvalds commit 82c9a927bc5df6e06b72d206d24a9d10cced4eb5 Author: Christian Brauner Date: Thu Jun 7 13:43:48 2018 +0200 getxattr: use correct xattr length When running in a container with a user namespace, if you call getxattr with name = "system.posix_acl_access" and size % 8 != 4, then getxattr silently skips the user namespace fixup that it normally does resulting in un-fixed-up data being returned. This is caused by posix_acl_fix_xattr_to_user() being passed the total buffer size and not the actual size of the xattr as returned by vfs_getxattr(). This commit passes the actual length of the xattr as returned by vfs_getxattr() down. A reproducer for the issue is: touch acl_posix setfacl -m user:0:rwx acl_posix and the compile: #define _GNU_SOURCE #include #include #include #include #include #include #include /* Run in user namespace with nsuid 0 mapped to uid != 0 on the host. */ int main(int argc, void **argv) { ssize_t ret1, ret2; char buf1[128], buf2[132]; int fret = EXIT_SUCCESS; char *file; if (argc < 2) { fprintf(stderr, "Please specify a file with " "\"system.posix_acl_access\" permissions set\n"); _exit(EXIT_FAILURE); } file = argv[1]; ret1 = getxattr(file, "system.posix_acl_access", buf1, sizeof(buf1)); if (ret1 < 0) { fprintf(stderr, "%s - Failed to retrieve " "\"system.posix_acl_access\" " "from \"%s\"\n", strerror(errno), file); _exit(EXIT_FAILURE); } ret2 = getxattr(file, "system.posix_acl_access", buf2, sizeof(buf2)); if (ret2 < 0) { fprintf(stderr, "%s - Failed to retrieve " "\"system.posix_acl_access\" " "from \"%s\"\n", strerror(errno), file); _exit(EXIT_FAILURE); } if (ret1 != ret2) { fprintf(stderr, "The value of \"system.posix_acl_" "access\" for file \"%s\" changed " "between two successive calls\n", file); _exit(EXIT_FAILURE); } for (ssize_t i = 0; i < ret2; i++) { if (buf1[i] == buf2[i]) continue; fprintf(stderr, "Unexpected different in byte %zd: " "%02x != %02x\n", i, buf1[i], buf2[i]); fret = EXIT_FAILURE; } if (fret == EXIT_SUCCESS) fprintf(stderr, "Test passed\n"); else fprintf(stderr, "Test failed\n"); _exit(fret); } and run: ./tester acl_posix On a non-fixed up kernel this should return something like: root@c1:/# ./t Unexpected different in byte 16: ffffffa0 != 00 Unexpected different in byte 17: ffffff86 != 00 Unexpected different in byte 18: 01 != 00 and on a fixed kernel: root@c1:~# ./t Test passed Cc: stable@vger.kernel.org Fixes: 2f6f0654ab61 ("userns: Convert vfs posix_acl support to use kuids and kgids") Link: https://bugzilla.kernel.org/show_bug.cgi?id=199945 Reported-by: Colin Watson Signed-off-by: Christian Brauner Acked-by: Serge Hallyn Signed-off-by: Eric W. Biederman commit 3968540ba61e9a19a0c4bda733db70952708d264 Author: Anirudh Venkataramanan Date: Thu Aug 9 06:29:03 2018 -0700 ice: Trivial formatting fixes 1) Add missing "\n" when printing link event error message. 2) Update dev_err statement in probe. 3) Add function description for ice_clear_pf_cfg. 4) Fix coding style for ice_acquire_nvm. 5) netdev->mtu is unsigned so use %u. Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit 43f8b22450f0a721915f1d2c7e3db6dd9573e76b Author: Bruce Allan Date: Thu Aug 9 06:29:02 2018 -0700 ice: Change struct members from bool to u8 Recent versions of checkpatch have a new warning based on a documented preference of Linus to not use bool in structures due to wasted space and the size of bool is implementation dependent. For more information, see the email thread at https://lkml.org/lkml/2017/11/21/384. Signed-off-by: Bruce Allan Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit dab0588fb616c1774bbf108eab1749dda4ac6942 Author: Jesse Brandeburg Date: Thu Aug 9 06:29:01 2018 -0700 ice: Fix potential return of uninitialized value In ice_vsi_setup_[tx|rx]_rings, err is uninitialized which can result in a garbage value return to the caller. Fix that. Signed-off-by: Jesse Brandeburg Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit c7f2c42b80ed6009f44e355aefc1e40db9485a9d Author: Anirudh Venkataramanan Date: Thu Aug 9 06:29:00 2018 -0700 ice: Fix a few null pointer dereference issues 1) When ice_ena_msix_range() fails to reserve vectors, a devm_kfree() warning was seen in the error flow path. So check pf->irq_tracker before use in ice_clear_interrupt_scheme(). 2) In ice_vsi_cfg(), check vsi->netdev before use. 3) In ice_get_link_status, check link_up before use. Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit c1dc2912059901f97345d9e10c96b841215fdc0f Author: Martin Willi Date: Wed Aug 22 10:27:17 2018 +0200 netfilter: xt_cluster: add dependency on conntrack module The cluster match requires conntrack for matching packets. If the netns does not have conntrack hooks registered, the match does not work at all. Implicitly load the conntrack hook for the family, exactly as many other extensions do. This ensures that the match works even if the hooks have not been registered by other means. Signed-off-by: Martin Willi Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 3bcd7fa37f33cda8c5639a908e9eb42d856e5d8b Author: Bruce Allan Date: Thu Aug 9 06:28:59 2018 -0700 ice: Update to interrupts enabled in OICR Remove the following interrupt causes that are not applicable or not handled: - PFINT_OICR_HLP_RDY_M - PFINT_OICR_CPM_RDY_M - PFINT_OICR_GPIO_M - PFINT_OICR_STORM_DETECT_M Add the following interrupt cause that's actually handled in ice_misc_intr: - PFINT_OICR_PE_CRITERR_M Signed-off-by: Bruce Allan Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit 444c8263151afc06c01ac8ddcd1204624a7d4bb3 Author: Yue Haibing Date: Tue Aug 21 14:03:04 2018 +0000 netfilter: conntrack: remove duplicated include from nf_conntrack_proto_udp.c Remove duplicated include. Fixes: c779e849608a ("netfilter: conntrack: remove get_timeout() indirection") Signed-off-by: Yue Haibing Signed-off-by: Pablo Neira Ayuso commit 785e76d7a2051a9e28b9134d5388a45b16f5eb72 Author: Quentin Monnet Date: Thu Aug 23 17:46:25 2018 +0100 tools: bpftool: return from do_event_pipe() on bad arguments When command line parsing fails in the while loop in do_event_pipe() because the number of arguments is incorrect or because the keyword is unknown, an error message is displayed, but bpftool remains stuck in the loop. Make sure we exit the loop upon failure. Fixes: f412eed9dfde ("tools: bpftool: add simple perf event output reader") Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit b04413330c773c808c4c6a6cdd278f8ee0f8b613 Author: Kees Cook Date: Wed Aug 22 23:02:31 2018 -0700 gcc-plugins: Disable when building under Clang Prior to doing compiler feature detection in Kconfig, attempts to build GCC plugins with Clang would fail the build, much in the same way missing GCC plugin headers would fail the build. However, now that this logic has been lifted into Kconfig, add an explicit test for GCC (instead of duplicating it in the feature-test script). Reported-by: Stefan Agner Signed-off-by: Kees Cook Reviewed-by: Masahiro Yamada commit 5d8778d803e21f235e9bc727b5bd619f02abb88b Author: Brett Creeley Date: Thu Aug 9 06:28:58 2018 -0700 ice: Set VLAN flags correctly In the struct ice_aqc_vsi_props the field port_vlan_flags is an overloaded term because it is used for both port VLANs (PVLANs) and regular VLANs. This is an issue and is very confusing especially when dealing with VFs because normal VLANs and port VLANs are not the same. To fix this the field was renamed to vlan_flags and all of the #define's labeled *_PVLAN_* were renamed to *_VLAN_* if they are not specific to port VLANs. Also in ice_vsi_manage_vlan_stripping, set the ICE_AQ_VSI_VLAN_MODE_ALL bit to allow the driver to add a VLAN tag to all packets it sends. Signed-off-by: Brett Creeley Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit 1eb43fc754485d772b1165118a8fb80c385f0492 Author: Jacob Keller Date: Thu Aug 9 06:28:57 2018 -0700 ice: Use order_base_2 to calculate higher power of 2 Currently, we use a combination of ilog2 and is_power_of_2() to calculate the next power of 2 for the qcount. This appears to be causing a warning on some combinations of GCC and the Linux kernel: MODPOST 1 modules WARNING: "____ilog2_NaN" [ice.ko] undefined! This appears to because because GCC realizes that qcount could be zero in some circumstances and thus attempts to link against the intentionally undefined ___ilog2_NaN function. The order_base_2 function is intentionally defined to return 0 when passed 0 as an argument, and thus will be safe to use here. This not only fixes the warning but makes the resulting code slightly cleaner, and is really what we should have used originally. Also update the comment to make it more clear that we are rounding up, not just incrementing the ilog2 of qcount unconditionally. Signed-off-by: Jacob Keller Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit 3d6b640efcc1b07709b42dd2e9609401c6f88633 Author: Anirudh Venkataramanan Date: Thu Aug 9 06:28:56 2018 -0700 ice: Fix bugs in control queue processing This patch is a consolidation of multiple bug fixes for control queue processing. 1) In ice_clean_adminq_subtask() remove unnecessary reads/writes to registers. The bits PFINT_FW_CTL, PFINT_MBX_CTL and PFINT_SB_CTL are not set when an interrupt arrives, which means that clearing them again can be omitted. 2) Get an accurate value in "pending" by re-reading the control queue head register from the hardware. 3) Fix a corner case involving lost control queue messages by checking for new control messages (using ice_ctrlq_pending) before exiting the cleanup routine. Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit b29bc220e2c7bd494a4605defcd93b18d5a8cf86 Author: Preethi Banala Date: Thu Aug 9 06:28:55 2018 -0700 ice: Clean control queues only when they are initialized Clean control queues only when they are initialized. One of the ways to validate if the basic initialization is done is by checking value of cq->sq.head and cq->rq.head variables that specify the register address. This patch adds a check to avoid NULL pointer dereference crash when tried to shutdown uninitialized control queue. Signed-off-by: Preethi Banala Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit f8ba7db850350319348b6d3c276f8ba19bc098ef Author: Jacob Keller Date: Thu Aug 9 06:28:54 2018 -0700 ice: Report stats for allocated queues via ethtool stats It is not safe to have the string table for statistics change order or size over the lifetime of a given netdevice. This is because of the nature of the 3-step process for obtaining stats. First, user space performs a request for the size of the strings table. Second it performs a separate request for the strings themselves, after allocating space for the table. Third, it requests the stats themselves, also allocating space for the table. If the size decreased, there is potential to see garbage data or stats values. In the worst case, we could potentially see stats values become mis-aligned with their strings, so that it looks like a statistic is being reported differently than it actually is. Even worse, if the size increased, there is potential that the strings table or stats table was not allocated large enough and the stats code could access and write to memory it should not, potentially resulting in undefined behavior and system crashes. It isn't even safe if the size always changes under the RTNL lock. This is because the calls take place over multiple user space commands, so it is not possible to hold the RTNL lock for the entire duration of obtaining strings and stats. Further, not all consumers of the ethtool API are the user space ethtool program, and it is possible that one assumes the strings will not change (valid under the current contract), and thus only requests the stats values when requesting stats in a loop. Finally, it's not possible in the general case to detect when the size changes, because it is quite possible that one value which could impact the stat size increased, while another decreased. This would result in the same total number of stats, but reordering them so that stats no longer line up with the strings they belong to. Since only size changes aren't enough, we would need some sort of hash or token to determine when the strings no longer match. This would require extending the ethtool stats commands, but there is no more space in the relevant structures. The real solution to resolve this would be to add a completely new API for stats, probably over netlink. In the ice driver, the only thing impacting the stats that is not constant is the number of queues. Instead of reporting stats for each used queue, report stats for each allocated queue. We do not change the number of queues allocated for a given netdevice, as we pass this into the alloc_etherdev_mq() function to set the num_tx_queues and num_rx_queues. This resolves the potential bugs at the slight cost of displaying many queue statistics which will not be activated. Signed-off-by: Jacob Keller Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit 5ab522443bd1dafa9e32d6f4b029128efda072de Author: Anirudh Venkataramanan Date: Thu Aug 9 06:28:53 2018 -0700 ice: Cleanup magic number Use define for the unit size shift of the Rx LAN context descriptor base address instead of the magic number 7. Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit c0203475765f827e7b2eaf0a87222d0766e2cc4b Author: Daniel Borkmann Date: Wed Aug 22 23:49:37 2018 +0200 bpf: use per htab salt for bucket hash All BPF hash and LRU maps currently have a known and global seed we feed into jhash() which is 0. This is suboptimal, thus fix it by generating a random seed upon hashtab setup time which we can later on feed into jhash() on lookup, update and deletions. Fixes: 0f8e4bd8a1fc8 ("bpf: add hashtable type of eBPF maps") Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Acked-by: Song Liu Reviewed-by: Eduardo Valentin commit 6efa6239e7f8777dccddcebb643e6d9a0304bf43 Author: Bruce Allan Date: Thu Aug 9 06:28:52 2018 -0700 ice: Remove unnecessary node owner check There is already a check for owner == ICE_SCHED_NODE_OWNER_LAN at the beginning of ice_sched_update_vsi_child_nodes. Remove the additional check to address the static analysis tool smatch issue "warn: we tested 'owner' before and it was 'false'". Signed-off-by: Bruce Allan Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit 4381147df9098706caa5cf9fda37e53b2fe4871f Author: Anirudh Venkataramanan Date: Thu Aug 9 06:28:51 2018 -0700 ice: Fix multiple static analyser warnings This patch fixes the following smatch errors: 1) Fix "odd binop '0x0 & 0xc'" when performing the bitwise-and with a constant value of zero (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG). Remove a similar bitwise-and with 0 in ice_add_marker_act() and use the right mask ICE_LG_ACT_GENERIC_OFFSET_M in the expression. 2) Fix a similar issue "odd binop '0x0 & 0x1800' in ice_req_irq_msix_misc. 3) Fix "odd binop '0x380000 & 0x7fff8'" in ice_add_marker_act(). Also, use a new define ICE_LG_ACT_GENERIC_OFF_RX_DESC_PROF_IDX instead of magic number '7'. 4) Fix warn: odd binop '0x0 & 0x18' in ice_set_dflt_vsi_ctx() by removing unnecessary logic to explicitly unset bits 3 and 4 in port_vlan_bits. These bits are unset already by the memset on ctxt->info. Reported-by: Dan Carpenter Signed-off-by: Anirudh Venkataramanan Tested-by: Tony Brelinski Signed-off-by: Jeff Kirsher commit b9b8a41adeff5666b402996020b698504c927353 Author: Dan Carpenter Date: Mon Aug 20 11:25:33 2018 +0300 btrfs: use after free in btrfs_quota_enable The issue here is that btrfs_commit_transaction() frees "trans" on both the error and the success path. So the problem would be if btrfs_commit_transaction() succeeds, and then qgroup_rescan_init() fails. That means that "ret" is non-zero and "trans" is non-NULL and it leads to a use after free inside the btrfs_end_transaction() macro. Fixes: 340f1aa27f36 ("btrfs: qgroups: Move transaction management inside btrfs_quota_enable/disable") Signed-off-by: Dan Carpenter Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 801660b040d132f67fac6a95910ad307c5929b49 Author: Anand Jain Date: Mon Aug 6 18:12:37 2018 +0800 btrfs: btrfs_shrink_device should call commit transaction at the end Test case btrfs/164 reports use-after-free: [ 6712.084324] general protection fault: 0000 [#1] PREEMPT SMP .. [ 6712.195423] btrfs_update_commit_device_size+0x75/0xf0 [btrfs] [ 6712.201424] btrfs_commit_transaction+0x57d/0xa90 [btrfs] [ 6712.206999] btrfs_rm_device+0x627/0x850 [btrfs] [ 6712.211800] btrfs_ioctl+0x2b03/0x3120 [btrfs] Reason for this is that btrfs_shrink_device adds the resized device to the fs_devices::resized_devices after it has called the last commit transaction. So the list fs_devices::resized_devices is not empty when btrfs_shrink_device returns. Now the parent function btrfs_rm_device calls: btrfs_close_bdev(device); call_rcu(&device->rcu, free_device_rcu); and then does the transactio ncommit. It goes through the fs_devices::resized_devices in btrfs_update_commit_device_size and leads to use-after-free. Fix this by making sure btrfs_shrink_device calls the last needed btrfs_commit_transaction before the return. This is consistent with what the grow counterpart does and this makes sure the on-disk state is persistent when the function returns. Reported-by: Lu Fengqi Tested-by: Lu Fengqi Signed-off-by: Anand Jain Reviewed-by: David Sterba [ update changelog ] Signed-off-by: David Sterba commit a5b7f4295eeae8b05ca91f6d145cd8773b08de9e Author: Lu Fengqi Date: Thu Aug 9 09:46:04 2018 +0800 btrfs: fix qgroup_free wrong num_bytes in btrfs_subvolume_reserve_metadata After btrfs_qgroup_reserve_meta_prealloc(), num_bytes will be assigned again by btrfs_calc_trans_metadata_size(). Once block_rsv fails, we can't properly free the num_bytes of the previous qgroup_reserve. Use a separate variable to store the num_bytes of the qgroup_reserve. Delete the comment for the qgroup_reserved that does not exist and add a comment about use_global_rsv. Fixes: c4c129db5da8 ("btrfs: drop unused parameter qgroup_reserved") CC: stable@vger.kernel.org # 4.18+ Signed-off-by: Lu Fengqi Reviewed-by: David Sterba Signed-off-by: David Sterba commit de02b9f6bb65a6a1848f346f7a3617b7a9b930c0 Author: Filipe Manana Date: Fri Aug 17 09:38:59 2018 +0100 Btrfs: fix data corruption when deduplicating between different files If we deduplicate extents between two different files we can end up corrupting data if the source range ends at the size of the source file, the source file's size is not aligned to the filesystem's block size and the destination range does not go past the size of the destination file size. Example: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ xfs_io -f -c "pwrite -S 0x6b 0 2518890" /mnt/foo # The first byte with a value of 0xae starts at an offset (2518890) # which is not a multiple of the sector size. $ xfs_io -c "pwrite -S 0xae 2518890 102398" /mnt/foo # Confirm the file content is full of bytes with values 0x6b and 0xae. $ od -t x1 /mnt/foo 0000000 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b * 11467540 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b ae ae ae ae ae ae 11467560 ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae * 11777540 ae ae ae ae ae ae ae ae 11777550 # Create a second file with a length not aligned to the sector size, # whose bytes all have the value 0x6b, so that its extent(s) can be # deduplicated with the first file. $ xfs_io -f -c "pwrite -S 0x6b 0 557771" /mnt/bar # Now deduplicate the entire second file into a range of the first file # that also has all bytes with the value 0x6b. The destination range's # end offset must not be aligned to the sector size and must be less # then the offset of the first byte with the value 0xae (byte at offset # 2518890). $ xfs_io -c "dedupe /mnt/bar 0 1957888 557771" /mnt/foo # The bytes in the range starting at offset 2515659 (end of the # deduplication range) and ending at offset 2519040 (start offset # rounded up to the block size) must all have the value 0xae (and not # replaced with 0x00 values). In other words, we should have exactly # the same data we had before we asked for deduplication. $ od -t x1 /mnt/foo 0000000 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b * 11467540 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b ae ae ae ae ae ae 11467560 ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae * 11777540 ae ae ae ae ae ae ae ae 11777550 # Unmount the filesystem and mount it again. This guarantees any file # data in the page cache is dropped. $ umount /dev/sdb $ mount /dev/sdb /mnt $ od -t x1 /mnt/foo 0000000 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b * 11461300 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 00 00 00 00 00 11461320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 11470000 ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae * 11777540 ae ae ae ae ae ae ae ae 11777550 # The bytes in range 2515659 to 2519040 have a value of 0x00 and not a # value of 0xae, data corruption happened due to the deduplication # operation. So fix this by rounding down, to the sector size, the length used for the deduplication when the following conditions are met: 1) Source file's range ends at its i_size; 2) Source file's i_size is not aligned to the sector size; 3) Destination range does not cross the i_size of the destination file. Fixes: e1d227a42ea2 ("btrfs: Handle unaligned length in extent_same") CC: stable@vger.kernel.org # 4.2+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit d4682ba03ef618b6ef4be7cedc7aacaf505d3a58 Author: Filipe Manana Date: Mon Jun 11 19:24:28 2018 +0100 Btrfs: sync log after logging new name When we add a new name for an inode which was logged in the current transaction, we update the inode in the log so that its new name and ancestors are added to the log. However when we do this we do not persist the log, so the changes remain in memory only, and as a consequence, any ancestors that were created in the current transaction are updated such that future calls to btrfs_inode_in_log() return true. This leads to a subsequent fsync against such new ancestor directories returning immediately, without persisting the log, therefore after a power failure the new ancestor directories do not exist, despite fsync being called against them explicitly. Example: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ mkdir /mnt/A $ mkdir /mnt/B $ mkdir /mnt/A/C $ touch /mnt/B/foo $ xfs_io -c "fsync" /mnt/B/foo $ ln /mnt/B/foo /mnt/A/C/foo $ xfs_io -c "fsync" /mnt/A After the power failure, directory "A" does not exist, despite the explicit fsync on it. Instead of fixing this by changing the behaviour of the explicit fsync on directory "A" to persist the log instead of doing nothing, make the logging of the new file name (which happens when creating a hard link or renaming) persist the log. This approach not only is simpler, not requiring addition of new fields to the inode in memory structure, but also gives us the same behaviour as ext4, xfs and f2fs (possibly other filesystems too). A test case for fstests follows soon. Fixes: 12fcfd22fe5b ("Btrfs: tree logging unlink/rename fixes") Reported-by: Vijay Chidambaram Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit c125311d96b1bfcce0f5930a4f0fdfe39ea14f7c Author: Jens Axboe Date: Thu Aug 23 09:34:46 2018 -0600 blk-wbt: don't maintain inflight counts if disabled A previous commit removed the ability to have per-rq flags. We used those flags to maintain inflight counts. Since we don't have those anymore, we have to always maintain inflight counts, even if wbt is disabled. This is clearly suboptimal. Add a queue quiesce around changing the wbt latency settings from sysfs to work around this. With that, we can reliably put the enabled check in our bio_to_wbt_flags(), since we know the WBT_TRACKED flag will be consistent for the lifetime of the request. Fixes: c1c80384c8f ("block: remove external dependency on wbt_flags") Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 0f52b3a00c789569d7ed822b5a6b30f59a8d4393 Author: Mahesh Salgaonkar Date: Thu Aug 23 10:26:08 2018 +0530 powerpc/mce: Fix SLB rebolting during MCE recovery path. The commit e7e81847478 ("powerpc/64s: move machine check SLB flushing to mm/slb.c") introduced a bug in reloading bolted SLB entries. Unused bolted entries are stored with .esid=0 in the slb_shadow area, and that value is now used directly as the RB input to slbmte, which means the RB[52:63] index field is set to 0, which causes SLB entry 0 to be cleared. Fix this by storing the index bits in the unused bolted entries, which directs the slbmte to the right place. The SLB shadow area is also used by the hypervisor, but PAPR is okay with that, from LoPAPR v1.1, 14.11.1.3 SLB Shadow Buffer: Note: SLB is filled sequentially starting at index 0 from the shadow buffer ignoring the contents of RB field bits 52-63 Fixes: e7e81847478b ("powerpc/64s: move machine check SLB flushing to mm/slb.c") Signed-off-by: Mahesh Salgaonkar Signed-off-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 8cfbdbdc24815417a3ab35101ccf706b9a23ff17 Author: Paul Mackerras Date: Thu Aug 23 10:08:58 2018 +1000 KVM: PPC: Book3S: Fix guest DMA when guest partially backed by THP pages Commit 76fa4975f3ed ("KVM: PPC: Check if IOMMU page is contained in the pinned physical page", 2018-07-17) added some checks to ensure that guest DMA mappings don't attempt to map more than the guest is entitled to access. However, errors in the logic mean that legitimate guest requests to map pages for DMA are being denied in some situations. Specifically, if the first page of the range passed to mm_iommu_get() is mapped with a normal page, and subsequent pages are mapped with transparent huge pages, we end up with mem->pageshift == 0. That means that the page size checks in mm_iommu_ua_to_hpa() and mm_iommu_up_to_hpa_rm() will always fail for every page in that region, and thus the guest can never map any memory in that region for DMA, typically leading to a flood of error messages like this: qemu-system-ppc64: VFIO_MAP_DMA: -22 qemu-system-ppc64: vfio_dma_map(0x10005f47780, 0x800000000000000, 0x10000, 0x7fff63ff0000) = -22 (Invalid argument) The logic errors in mm_iommu_get() are: (a) use of 'ua' not 'ua + (i << PAGE_SHIFT)' in the find_linux_pte() call (meaning that find_linux_pte() returns the pte for the first address in the range, not the address we are currently up to); (b) use of 'pageshift' as the variable to receive the hugepage shift returned by find_linux_pte() - for a normal page this gets set to 0, leading to us setting mem->pageshift to 0 when we conclude that the pte returned by find_linux_pte() didn't match the page we were looking at; (c) comparing 'compshift', which is a page order, i.e. log base 2 of the number of pages, with 'pageshift', which is a log base 2 of the number of bytes. To fix these problems, this patch introduces 'cur_ua' to hold the current user address and uses that in the find_linux_pte() call; introduces 'pteshift' to hold the hugepage shift found by find_linux_pte(); and compares 'pteshift' with 'compshift + PAGE_SHIFT' rather than 'compshift'. The patch also moves the local_irq_restore to the point after the PTE pointer returned by find_linux_pte() has been dereferenced because otherwise the PTE could change underneath us, and adds a check to avoid doing the find_linux_pte() call once mem->pageshift has been reduced to PAGE_SHIFT, as an optimization. Fixes: 76fa4975f3ed ("KVM: PPC: Check if IOMMU page is contained in the pinned physical page") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Paul Mackerras Signed-off-by: Michael Ellerman commit f08d08f3db55452d31ba4a37c702da6245876b96 Author: Aneesh Kumar K.V Date: Wed Aug 22 22:46:05 2018 +0530 powerpc/mm/radix: Only need the Nest MMU workaround for R -> RW transition The Nest MMU workaround is only needed for RW upgrades. Avoid doing that for other PTE updates. We also avoid clearing the PTE while marking it invalid. This is because other page table walkers will find this PTE none and can result in unexpected behaviour due to that. Instead we clear _PAGE_PRESENT and set the software PTE bit _PAGE_INVALID. pte_present() is already updated to check for both bits. This makes sure page table walkers will find the PTE present and things like pte_pfn(pte) returns the right value. Based on an original patch from Benjamin Herrenschmidt Signed-off-by: Aneesh Kumar K.V Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 66e5db4a1ccc64f278653bc69dc406d184dc750a Merge: 5804b11034a2 78303650e4cd Author: Ingo Molnar Date: Thu Aug 23 10:29:19 2018 +0200 Merge tag 'perf-core-for-mingo-4.19-20180820' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: LLVM/clang/eBPF: (Arnaldo Carvalho de Melo) - Allow passing options to llc in addition to to clang. Hardware tracing: (Jack Henschel) - Improve error message for PMU address filters, clarifying availability of that feature in hardware having hardware tracing such as Intel PT. Python interface: (Jiri Olsa) - Fix read_on_cpu() interface. ELF/DWARF libraries: (Jiri Olsa) - Fix handling of the combo compressed module file + decompressed associated debuginfo file. Build (Rasmus Villemoes) - Disable parallelism for 'make clean', avoiding multiple submakes deleting the same files and causing the build to fail on systems such as Yocto. Kernel ABI copies: (Arnaldo Carvalho de Melo) - Update tools's copy of x86's cpufeatures.h. - Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy'. Miscellaneous: (Steven Rostedt) - Change libtraceevent to SPDX License format. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit 25da75043f8690fd083878447c91f289dfb63b87 Author: Kai-Heng Feng Date: Thu Aug 23 05:53:32 2018 +0000 drm/edid: Add 6 bpc quirk for SDC panel in Lenovo B50-80 Another panel that reports "DFP 1.x compliant TMDS" but it supports 6bpc instead of 8 bpc. Apply 6 bpc quirk for the panel to fix it. BugLink: https://bugs.launchpad.net/bugs/1788308 Cc: # v4.8+ Signed-off-by: Kai-Heng Feng Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180823055332.7723-1-kai.heng.feng@canonical.com commit f5d707ede37a962bc3cb9b3f8531a870dae29e46 Author: Arnd Bergmann Date: Tue Aug 21 22:37:33 2018 +0200 ACPI: fix menuconfig presentation of ACPI submenu My fix for a recursive Kconfig dependency caused another issue where the ACPI specific options end up in the top-level menu in 'menuconfig'. This was an unintended side-effect of having a silent option between 'menuconfig ACPI' and 'if ACPI'. Moving the ARCH_SUPPORTS_ACPI symbol ahead of the ACPI menu solves that problem and restores the previous presentation. Reported-by: Ard Biesheuvel Fixes: 2c870e61132c (arm64: fix ACPI dependencies) Signed-off-by: Arnd Bergmann Signed-off-by: Rafael J. Wysocki commit d2332f887ddfba50fee93b8e1736376517c2df0c Author: Sergei Shtylyov Date: Wed Aug 22 21:22:26 2018 +0300 mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts I have encountered an interrupt storm during the eMMC chip probing (and the chip finally didn't get detected). It turned out that U-Boot left the SDHI DMA interrupts enabled while the Linux driver didn't use those. Masking those interrupts in renesas_sdhi_internal_dmac_request_dma() gets rid of both issues... Signed-off-by: Sergei Shtylyov Reviewed-by: Wolfram Sang Fixes: 2a68ea7896e3 ("mmc: renesas-sdhi: add support for R-Car Gen3 SDHI DMAC") Cc: stable@vger.kernel.org # v4.14+ Signed-off-by: Ulf Hansson commit 9faf870e559a710c44e747ba20383ea82d8ac5d2 Author: Sergei Shtylyov Date: Wed Aug 22 21:28:01 2018 +0300 mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS The DM_CM_RST register actually has bits 0-31 defaulting to 1s and bits 32-63 defaulting to 0s -- fix off-by-one in #define RST_RESERVED_BITS. Signed-off-by: Sergei Shtylyov Reviewed-by: Wolfram Sang Fixes: 2a68ea7896e3 ("mmc: renesas-sdhi: add support for R-Car Gen3 SDHI DMAC") Cc: stable@vger.kernel.org # v4.14+ Signed-off-by: Ulf Hansson commit 0d092f06faa46b95a8e07b9bb5737b7c0f1176ee Merge: 6bfde2e196d8 addb3ffbca66 Author: David S. Miller Date: Wed Aug 22 22:43:11 2018 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Johan Hedberg says: ==================== pull request: bluetooth 2018-08-23 Here are two important Bluetooth fixes for the MediaTek and RealTek HCI drivers. Please let me know if there are any issues pulling, thanks. ==================== Signed-off-by: David S. Miller commit 6bfde2e196d8ddfea5317be986809abdb0be5a0c Merge: d23c4b6336ef 583e7281f1d8 Author: David S. Miller Date: Wed Aug 22 21:55:01 2018 -0700 Merge branch 'hns3-fixes' Huazhong Tan says: ==================== net: hns3: bug fix & optimization for HNS3 driver This patchset presents a bug fix found out when CONFIG_ARM64_64K_PAGES enable and an optimization for HNS3 driver. ==================== Signed-off-by: David S. Miller commit 583e7281f1d8234f3a3e483bd6fba7a72d24aa4e Author: Huazhong Tan Date: Thu Aug 23 11:37:16 2018 +0800 net: hns3: modify variable type in hns3_nic_reuse_page 'truesize' is supposed to be u32, not int, so fix it. Signed-off-by: Huazhong tan Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 27a5959308559fa6afcaa4e6cd81d25bcb2dda7c Author: Huazhong Tan Date: Thu Aug 23 11:37:15 2018 +0800 net: hns3: fix page_offset overflow when CONFIG_ARM64_64K_PAGES When enable the config item "CONFIG_ARM64_64K_PAGES", the size of PAGE_SIZE is 65536(64K). But the type of page_offset is u16, it will overflow. So change it to u32, when "CONFIG_ARM64_64K_PAGES" enabled. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Huazhong Tan Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit d23c4b6336ef30898dcdff351f21e633e7a64930 Author: Hangbin Liu Date: Thu Aug 23 11:31:37 2018 +0800 net/ipv6: init ip6 anycast rt->dst.input as ip6_input Commit 6edb3c96a5f02 ("net/ipv6: Defer initialization of dst to data path") forgot to handle anycast route and init anycast rt->dst.input to ip6_forward. Fix it by setting anycast rt->dst.input back to ip6_input. Fixes: 6edb3c96a5f02 ("net/ipv6: Defer initialization of dst to data path") Signed-off-by: Hangbin Liu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 58ce660f911c9fae146a94245efb04b4af6f02a9 Merge: 12a7f8696b85 339379a2fb13 Author: David S. Miller Date: Wed Aug 22 21:47:36 2018 -0700 Merge branch 'hns-fixes' Huazhong Tan says: ==================== net: hns: bug fixes & optimization for HNS driver This patchset presents some bug fixes found out when CONFIG_ARM64_64K_PAGES enable and an optimization for HNS driver. ==================== Signed-off-by: David S. Miller commit 339379a2fb13decd1802b403370cc3cdf21d819f Author: Huazhong Tan Date: Thu Aug 23 11:10:13 2018 +0800 net: hns: use eth_get_headlen interface instead of hns_nic_get_headlen Update hns to drop the hns_nic_get_headlen function in favour of eth_get_headlen, and hence also removes now redundant hns_nic_get_headlen. Signed-off-by: Huazhong Tan Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit b1ccd4c0ab6ef499f47dd84ed4920502a7147bba Author: Huazhong Tan Date: Thu Aug 23 11:10:12 2018 +0800 net: hns: fix skb->truesize underestimation skb->truesize is not meant to be tracking amount of used bytes in a skb, but amount of reserved/consumed bytes in memory. For instance, if we use a single byte in last page fragment, we have to account the full size of the fragment. So skb_add_rx_frag needs to calculate the length of the entire buffer into turesize. Fixes: 9cbe9fd5214e ("net: hns: optimize XGE capability by reducing cpu usage") Signed-off-by: Huazhong tan Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit ac4a5b52f5970479f4b2d94a7f98dbf9eaf675ab Author: Huazhong Tan Date: Thu Aug 23 11:10:11 2018 +0800 net: hns: modify variable type in hns_nic_reuse_page 'truesize' is supposed to be u32, not int, so fix it. Signed-off-by: Huazhong tan Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 3ed614dce3ca9912d22be215ff0f11104b69fe62 Author: Huazhong Tan Date: Thu Aug 23 11:10:10 2018 +0800 net: hns: fix length and page_offset overflow when CONFIG_ARM64_64K_PAGES When enable the config item "CONFIG_ARM64_64K_PAGES", the size of PAGE_SIZE is 65536(64K). But the type of length and page_offset are u16, they will overflow. So change them to u32. Fixes: 6fe6611ff275 ("net: add Hisilicon Network Subsystem hnae framework support") Signed-off-by: Huazhong Tan Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 12a7f8696b85aaff3a76cd12a15b101b2af65404 Merge: 431280eebed9 8e995bf14fdb Author: David S. Miller Date: Wed Aug 22 21:45:32 2018 -0700 Merge branch 'tcp_bbr-PROBE_RTT-minor-bug-fixes' Kevin Yang says: ==================== tcp_bbr: PROBE_RTT minor bug fixes This series includes two minor bug fixes for the TCP BBR PROBE_RTT mechanism, and one preparatory patch: (1) A preparatory patch to reorganize the PROBE_RTT logic by refactoring (into its own function) the code to exit PROBE_RTT, since the next patch will be using that code in a new context. (2) Fix: When BBR restarts from idle and if BBR is in PROBE_RTT mode, BBR should check if it's time to exit PROBE_RTT. If yes, then BBR should exit PROBE_RTT mode and restore the cwnd to its full value. (3) Fix: Apply the PROBE_RTT cwnd cap even if the count of fully-ACKed packets is 0. ==================== Signed-off-by: David S. Miller commit 8e995bf14fdb7e33681d5c3312b602fa342b878a Author: Kevin Yang Date: Wed Aug 22 17:43:16 2018 -0400 tcp_bbr: apply PROBE_RTT cwnd cap even if acked==0 This commit fixes a corner case where TCP BBR would enter PROBE_RTT mode but not reduce its cwnd. If a TCP receiver ACKed less than one full segment, the number of delivered/acked packets was 0, so that bbr_set_cwnd() would short-circuit and exit early, without cutting cwnd to the value we want for PROBE_RTT. The fix is to instead make sure that even when 0 full packets are ACKed, we do apply all the appropriate caps, including the cap that applies in PROBE_RTT mode. Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") Signed-off-by: Kevin Yang Signed-off-by: Neal Cardwell Reviewed-by: Yuchung Cheng Reviewed-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit 5490b32dce6932ea7ee8e3b2f76db2957c92af6e Author: Kevin Yang Date: Wed Aug 22 17:43:15 2018 -0400 tcp_bbr: in restart from idle, see if we should exit PROBE_RTT This patch fix the case where BBR does not exit PROBE_RTT mode when it restarts from idle. When BBR restarts from idle and if BBR is in PROBE_RTT mode, BBR should check if it's time to exit PROBE_RTT. If yes, then BBR should exit PROBE_RTT mode and restore the cwnd to its full value. Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") Signed-off-by: Kevin Yang Signed-off-by: Neal Cardwell Reviewed-by: Yuchung Cheng Reviewed-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit fb99886224294b2291d267da41395022fa4200e2 Author: Kevin Yang Date: Wed Aug 22 17:43:14 2018 -0400 tcp_bbr: add bbr_check_probe_rtt_done() helper This patch add a helper function bbr_check_probe_rtt_done() to 1. check the condition to see if bbr should exit probe_rtt mode; 2. process the logic of exiting probe_rtt mode. Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") Signed-off-by: Kevin Yang Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Reviewed-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit 431280eebed9f5079553daf003011097763e71fd Author: Eric Dumazet Date: Wed Aug 22 13:30:45 2018 -0700 ipv4: tcp: send zero IPID for RST and ACK sent in SYN-RECV and TIME-WAIT state tcp uses per-cpu (and per namespace) sockets (net->ipv4.tcp_sk) internally to send some control packets. 1) RST packets, through tcp_v4_send_reset() 2) ACK packets in SYN-RECV and TIME-WAIT state, through tcp_v4_send_ack() These packets assert IP_DF, and also use the hashed IP ident generator to provide an IPv4 ID number. Geoff Alexander reported this could be used to build off-path attacks. These packets should not be fragmented, since their size is smaller than IPV4_MIN_MTU. Only some tunneled paths could eventually have to fragment, regardless of inner IPID. We really can use zero IPID, to address the flaw, and as a bonus, avoid a couple of atomic operations in ip_idents_reserve() Signed-off-by: Eric Dumazet Reported-by: Geoff Alexander Tested-by: Geoff Alexander Signed-off-by: David S. Miller commit e500c6d349f7f36120886841c6f057ce248b48b2 Author: Cong Wang Date: Wed Aug 22 12:58:34 2018 -0700 addrconf: reduce unnecessary atomic allocations All the 3 callers of addrconf_add_mroute() assert RTNL lock, they don't take any additional lock either, so it is safe to convert it to GFP_KERNEL. Same for sit_add_v4_addrs(). Cc: David Ahern Signed-off-by: Cong Wang Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 191672ca07a7c10c3b84d01019a33d59b4317997 Author: Arnd Bergmann Date: Wed Aug 22 17:25:44 2018 +0200 net_sched: fix unused variable warning in stmmac The new tcf_exts_for_each_action() macro doesn't reference its arguments when CONFIG_NET_CLS_ACT is disabled, which leads to a harmless warning in at least one driver: drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c: In function 'tc_fill_actions': drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c:64:6: error: unused variable 'i' [-Werror=unused-variable] Adding a cast to void lets us avoid this kind of warning. To be on the safe side, do it for all three arguments, not just the one that caused the warning. Fixes: 244cd96adb5f ("net_sched: remove list_head from tc_action") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 93cfb6c17690c465509967aeb237717d10513a88 Author: Toke Høiland-Jørgensen Date: Wed Aug 22 12:29:43 2018 +0200 sch_cake: Fix TC filter flow override and expand it to hosts as well The TC filter flow mapping override completely skipped the call to cake_hash(); however that meant that the internal state was not being updated, which ultimately leads to deadlocks in some configurations. Fix that by passing the overridden flow ID into cake_hash() instead so it can react appropriately. In addition, the major number of the class ID can now be set to override the host mapping in host isolation mode. If both host and flow are overridden (or if the respective modes are disabled), flow dissection and hashing will be skipped entirely; otherwise, the hashing will be kept for the portions that are not set by the filter. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 3d0371b313b84ba7c16ebf2526a7a34f1c57b19e Author: Samuel Mendoza-Jonas Date: Wed Aug 22 14:57:44 2018 +1000 net/ncsi: Fixup .dumpit message flags and ID check in Netlink handler The ncsi_pkg_info_all_nl() .dumpit handler is missing the NLM_F_MULTI flag, causing additional package information after the first to be lost. Also fixup a sanity check in ncsi_write_package_info() to reject out of range package IDs. Signed-off-by: Samuel Mendoza-Jonas Signed-off-by: David S. Miller commit 00e1cae78120ee19462e7f96135cd1cc59a086e7 Author: Wolfram Sang Date: Wed Aug 22 00:02:19 2018 +0200 net: ethernet: renesas: use SPDX identifier for Renesas drivers Signed-off-by: Wolfram Sang Acked-by: Sergei Shtylyov Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit bd0dbb73e01306a1060e56f81e5fe287be936477 Author: Aneesh Kumar K.V Date: Wed Aug 22 22:46:04 2018 +0530 powerpc/mm/books3s: Add new pte bit to mark pte temporarily invalid. When splitting a huge pmd pte, we need to mark the pmd entry invalid. We can do that by clearing _PAGE_PRESENT bit. But then that will be taken as a swap pte. In order to differentiate between the two use a software pte bit when invalidating. For regular pte, due to bd5050e38aec ("powerpc/mm/radix: Change pte relax sequence to handle nest MMU hang") we need to mark the pte entry invalid when relaxing access permission. Instead of marking pte_none which can result in different page table walk routines possibly skipping this pte entry, invalidate it but still keep it marked present. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit 810e9f86f36f59f1d6f6710220c49afe0c705f38 Author: Christophe Leroy Date: Tue Aug 21 13:03:23 2018 +0000 powerpc/nohash: fix pte_access_permitted() Commit 5769beaf180a8 ("powerpc/mm: Add proper pte access check helper for other platforms") replaced generic pte_access_permitted() by an arch specific one. The generic one is defined as (pte_present(pte) && (!(write) || pte_write(pte))) The arch specific one is open coded checking that _PAGE_USER and _PAGE_WRITE (_PAGE_RW) flags are set, but lacking to check that _PAGE_RO and _PAGE_PRIVILEGED are unset, leading to a useless test on targets like the 8xx which defines _PAGE_RW and _PAGE_USER as 0. Commit 5fa5b16be5b31 ("powerpc/mm/hugetlb: Use pte_access_permitted for hugetlb access check") replaced some tests performed with pte helpers by a call to pte_access_permitted(), leading to the same issue. This patch rewrites powerpc/nohash pte_access_permitted() using pte helpers. Fixes: 5769beaf180a8 ("powerpc/mm: Add proper pte access check helper for other platforms") Fixes: 5fa5b16be5b31 ("powerpc/mm/hugetlb: Use pte_access_permitted for hugetlb access check") Cc: stable@vger.kernel.org # v4.15+ Signed-off-by: Christophe Leroy Reviewed-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit c037bd615885f1d9d3bdb48531bace79fae1505d Author: John Johansen Date: Tue Aug 21 17:19:53 2018 -0700 apparmor: remove no-op permission check in policy_unpack The patch 736ec752d95e: "AppArmor: policy routines for loading and unpacking policy" from Jul 29, 2010, leads to the following static checker warning: security/apparmor/policy_unpack.c:410 verify_accept() warn: bitwise AND condition is false here security/apparmor/policy_unpack.c:413 verify_accept() warn: bitwise AND condition is false here security/apparmor/policy_unpack.c 392 #define DFA_VALID_PERM_MASK 0xffffffff 393 #define DFA_VALID_PERM2_MASK 0xffffffff 394 395 /** 396 * verify_accept - verify the accept tables of a dfa 397 * @dfa: dfa to verify accept tables of (NOT NULL) 398 * @flags: flags governing dfa 399 * 400 * Returns: 1 if valid accept tables else 0 if error 401 */ 402 static bool verify_accept(struct aa_dfa *dfa, int flags) 403 { 404 int i; 405 406 /* verify accept permissions */ 407 for (i = 0; i < dfa->tables[YYTD_ID_ACCEPT]->td_lolen; i++) { 408 int mode = ACCEPT_TABLE(dfa)[i]; 409 410 if (mode & ~DFA_VALID_PERM_MASK) 411 return 0; 412 413 if (ACCEPT_TABLE2(dfa)[i] & ~DFA_VALID_PERM2_MASK) 414 return 0; fixes: 736ec752d95e ("AppArmor: policy routines for loading and unpacking policy") Reported-by: Dan Carpenter Signed-off-by: John Johansen commit 8f13b60756a1e5ddc9aa8c6b14807264b6833e5b Merge: 4d1608eebcb2 9d1d02ff3678 Author: Dave Airlie Date: Thu Aug 23 11:24:45 2018 +1000 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next Fixes for 4.19: - Fix build when KCOV is enabled - Misc display fixes - A couple of SR-IOV fixes - Fence fixes for eviction handling for KFD - Misc other fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180822203813.2733-1-alexander.deucher@amd.com commit 4d1608eebcb2191b10ac3aa4ca743a38ac05e100 Merge: 3d63a3c14741 4acd8d01a239 Author: Dave Airlie Date: Thu Aug 23 11:23:31 2018 +1000 Merge tag 'drm-misc-next-fixes-2018-08-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-next - Add an unprepare delay to the tv123wam panel (Sean) - Update seanpaul's email in MAINTAINERS (Sean) Signed-off-by: Dave Airlie From: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180822193850.GA214158@art_vandelay commit 52a288c736669851f166544d4a0b93e1090d7e9b Author: Peter Zijlstra Date: Wed Aug 22 17:30:13 2018 +0200 x86/mm/tlb: Revert the recent lazy TLB patches Revert commits: 95b0e6357d3e x86/mm/tlb: Always use lazy TLB mode 64482aafe55f x86/mm/tlb: Only send page table free TLB flush to lazy TLB CPUs ac0315896970 x86/mm/tlb: Make lazy TLB mode lazier 61d0beb5796a x86/mm/tlb: Restructure switch_mm_irqs_off() 2ff6ddf19c0e x86/mm/tlb: Leave lazy TLB mode at page table free time In order to simplify the TLB invalidate fixes for x86 and unify the parts that need backporting. We'll try again later. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rik van Riel Signed-off-by: Linus Torvalds commit 815f0ddb346c196018d4d8f8f55c12b83da1de3f Author: Nick Desaulniers Date: Wed Aug 22 16:37:24 2018 -0700 include/linux/compiler*.h: make compiler-*.h mutually exclusive Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") recently exposed a brittle part of the build for supporting non-gcc compilers. Both Clang and ICC define __GNUC__, __GNUC_MINOR__, and __GNUC_PATCHLEVEL__ for quick compatibility with code bases that haven't added compiler specific checks for __clang__ or __INTEL_COMPILER. This is brittle, as they happened to get compatibility by posing as a certain version of GCC. This broke when upgrading the minimal version of GCC required to build the kernel, to a version above what ICC and Clang claim to be. Rather than always including compiler-gcc.h then undefining or redefining macros in compiler-intel.h or compiler-clang.h, let's separate out the compiler specific macro definitions into mutually exclusive headers, do more proper compiler detection, and keep shared definitions in compiler_types.h. Fixes: cafa0010cd51 ("Raise the minimum required gcc version to 4.6") Reported-by: Masahiro Yamada Suggested-by: Eli Friedman Suggested-by: Joe Perches Signed-off-by: Nick Desaulniers Signed-off-by: Linus Torvalds commit 108b833cde9c9b93204e6a4e455829a67f9785c3 Author: Chuck Lever Date: Mon Aug 20 10:39:16 2018 -0400 sunrpc: Add comment defining gssd upcall API keywords During review, it was found that the target, service, and srchost keywords are easily conflated. Add an explainer. Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit a26dd64f5477968d730cf92868b4092314b8e45e Author: Chuck Lever Date: Thu Aug 16 12:06:09 2018 -0400 nfsd: Remove callback_cred Clean up: The global callback_cred is no longer used, so it can be removed. Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit cb25e7b293ec5cd82bc958a6c89dadeb198504b4 Author: Chuck Lever Date: Thu Aug 16 12:06:04 2018 -0400 nfsd: Use correct credential for NFSv4.0 callback with GSS I've had trouble when operating a multi-homed Linux NFS server with Kerberos using NFSv4.0. Lately, I've seen my clients reporting this (and then hanging): May 9 11:43:26 manet kernel: NFS: NFSv4 callback contains invalid cred The client-side commit f11b2a1cfbf5 ("nfs4: copy acceptor name from context to nfs_client") appears to be related, but I suspect this problem has been going on for some time before that. RFC 7530 Section 3.3.3 says: > For Kerberos V5, nfs/hostname would be a server principal in the > Kerberos Key Distribution Center database. This is the same > principal the client acquired a GSS-API context for when it issued > the SETCLIENTID operation ... In other words, an NFSv4.0 client expects that the server will use the same GSS principal for callback that the client used to establish its lease. For example, if the client used the service principal "nfs@server.domain" to establish its lease, the server is required to use "nfs@server.domain" when performing NFSv4.0 callback operations. The Linux NFS server currently does not. It uses a common service principal for all callback connections. Sometimes this works as expected, and other times -- for example, when the server is accessible via multiple hostnames -- it won't work at all. This patch scrapes the target name from the client credential, and uses that for the NFSv4.0 callback credential. That should be correct much more often. Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit 9abdda5ddab8a899ca8c4b859ef0a7710f40e0dd Author: Chuck Lever Date: Thu Aug 16 12:05:59 2018 -0400 sunrpc: Extract target name into svc_cred NFSv4.0 callback needs to know the GSS target name the client used when it established its lease. That information is available from the GSS context created by gssproxy. Make it available in each svc_cred. Note this will also give us access to the real target service principal name (which is typically "nfs", but spec does not require that). Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit a1a237775ec8fd2694b9f8e451821fd168e730d8 Author: Chuck Lever Date: Thu Aug 16 12:05:54 2018 -0400 sunrpc: Enable the kernel to specify the hostname part of service principals A multi-homed NFS server may have more than one "nfs" key in its keytab. Enable the kernel to pick the key it wants as a machine credential when establishing a GSS context. This is useful for GSS-protected NFSv4.0 callbacks, which are required by RFC 7530 S3.3.3 to use the same principal as the service principal the client used when establishing its lease. A complementary modification to rpc.gssd is required to fully enable this feature. Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit 44090cc876926277329e1608bafc01b9f6da627f Author: Laura Abbott Date: Fri Aug 17 14:43:54 2018 -0700 sunrpc: Don't use stack buffer with scatterlist Fedora got a bug report from NFS: kernel BUG at include/linux/scatterlist.h:143! ... RIP: 0010:sg_init_one+0x7d/0x90 .. make_checksum+0x4e7/0x760 [rpcsec_gss_krb5] gss_get_mic_kerberos+0x26e/0x310 [rpcsec_gss_krb5] gss_marshal+0x126/0x1a0 [auth_rpcgss] ? __local_bh_enable_ip+0x80/0xe0 ? call_transmit_status+0x1d0/0x1d0 [sunrpc] call_transmit+0x137/0x230 [sunrpc] __rpc_execute+0x9b/0x490 [sunrpc] rpc_run_task+0x119/0x150 [sunrpc] nfs4_run_exchange_id+0x1bd/0x250 [nfsv4] _nfs4_proc_exchange_id+0x2d/0x490 [nfsv4] nfs41_discover_server_trunking+0x1c/0xa0 [nfsv4] nfs4_discover_server_trunking+0x80/0x270 [nfsv4] nfs4_init_client+0x16e/0x240 [nfsv4] ? nfs_get_client+0x4c9/0x5d0 [nfs] ? _raw_spin_unlock+0x24/0x30 ? nfs_get_client+0x4c9/0x5d0 [nfs] nfs4_set_client+0xb2/0x100 [nfsv4] nfs4_create_server+0xff/0x290 [nfsv4] nfs4_remote_mount+0x28/0x50 [nfsv4] mount_fs+0x3b/0x16a vfs_kern_mount.part.35+0x54/0x160 nfs_do_root_mount+0x7f/0xc0 [nfsv4] nfs4_try_mount+0x43/0x70 [nfsv4] ? get_nfs_version+0x21/0x80 [nfs] nfs_fs_mount+0x789/0xbf0 [nfs] ? pcpu_alloc+0x6ca/0x7e0 ? nfs_clone_super+0x70/0x70 [nfs] ? nfs_parse_mount_options+0xb40/0xb40 [nfs] mount_fs+0x3b/0x16a vfs_kern_mount.part.35+0x54/0x160 do_mount+0x1fd/0xd50 ksys_mount+0xba/0xd0 __x64_sys_mount+0x21/0x30 do_syscall_64+0x60/0x1f0 entry_SYSCALL_64_after_hwframe+0x49/0xbe This is BUG_ON(!virt_addr_valid(buf)) triggered by using a stack allocated buffer with a scatterlist. Convert the buffer for rc4salt to be dynamically allocated instead. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1615258 Signed-off-by: Laura Abbott Signed-off-by: J. Bruce Fields commit eb7e5cfced102e61814f6f3e4cb4acb9f9315760 Author: Andrey Grodzovsky Date: Wed Aug 22 10:07:35 2018 -0400 drm/amdgpu: Fix page fault and kasan warning on pci device remove. Problem: When executing echo 1 > /sys/class/drm/card0/device/remove kasan warning as bellow and page fault happen because adev->gart.pages already freed by the time amdgpu_gart_unbind is called. BUG: KASAN: user-memory-access in amdgpu_gart_unbind+0x98/0x180 [amdgpu] Write of size 8 at addr 0000000000003648 by task bash/1828 CPU: 2 PID: 1828 Comm: bash Tainted: G W O 4.18.0-rc1-dev+ #29 Hardware name: Gigabyte Technology Co., Ltd. AX370-Gaming/AX370-Gaming-CF, BIOS F3 06/19/2017 Call Trace: dump_stack+0x71/0xab kasan_report+0x109/0x390 amdgpu_gart_unbind+0x98/0x180 [amdgpu] ttm_tt_unbind+0x43/0x60 [ttm] ttm_bo_move_ttm+0x83/0x1c0 [ttm] ttm_bo_handle_move_mem+0xb97/0xd00 [ttm] ttm_bo_evict+0x273/0x530 [ttm] ttm_mem_evict_first+0x29c/0x360 [ttm] ttm_bo_force_list_clean+0xfc/0x210 [ttm] ttm_bo_clean_mm+0xe7/0x160 [ttm] amdgpu_ttm_fini+0xda/0x1d0 [amdgpu] amdgpu_bo_fini+0xf/0x60 [amdgpu] gmc_v8_0_sw_fini+0x36/0x70 [amdgpu] amdgpu_device_fini+0x2d0/0x7d0 [amdgpu] amdgpu_driver_unload_kms+0x6a/0xd0 [amdgpu] drm_dev_unregister+0x79/0x180 [drm] amdgpu_pci_remove+0x2a/0x60 [amdgpu] pci_device_remove+0x5b/0x100 device_release_driver_internal+0x236/0x360 pci_stop_bus_device+0xbf/0xf0 pci_stop_and_remove_bus_device_locked+0x16/0x30 remove_store+0xda/0xf0 kernfs_fop_write+0x186/0x220 __vfs_write+0xcc/0x330 vfs_write+0xe6/0x250 ksys_write+0xb1/0x140 do_syscall_64+0x77/0x1e0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f66ebbb32c0 Fix: Split gmc_v{6,7,8,9}_0_gart_fini to postpone amdgpu_gart_fini to after memory managers are shut down since gart unbind happens as part of this procedure Signed-off-by: Andrey Grodzovsky Reviewed-by: Junwei Zhang Acked-by: Huang Rui Signed-off-by: Alex Deucher commit 899fbc33fd775b9dfa363db28f322272920a2196 Merge: 2edd73a42e0e 9bd5196e5cf7 Author: Linus Torvalds Date: Wed Aug 22 14:14:15 2018 -0700 Merge tag 'platform-drivers-x86-v4.19-1' of git://git.infradead.org/linux-platform-drivers-x86 Pull x86 platform driver updates from Andy Shevchenko: - The driver for Silead touchscreen configurations has been renamed from silead_dmi to touchscreen_dmi since it starts supporting other touchscreens which require some DMI quirks It also gets expanded to cover cases for Chuwi Vi10, ONDA V891W, Connect Tablet 9, Onda V820w, and Cube KNote i1101 tablets. - Another bunch of changes is related to Mellanox platform code to allow user space to communicate with Mellanox for system control and monitoring purposes. The driver notifies user on hotplug device signal receiving. - ASUS WMI drivers recognize lid flip action on UX360, and correctly toggles airplane mode LED. In addition the keyboard backlight toggle gets support. - ThinkPad ACPI driver enables support for calculator key (on at least P52). It also has been fixed to support three characters model designators, which are used for modern laptops. Earlier the battery, marked as BAT1, on ThinkPad laptops has not been configured properly, which is fixed. On the opposite the multi-battery configurations now probed correctly. - Dell SMBIOS driver starts working on some Dell servers which do not support token interface. The regression with backlight detection has also been fixed. In order to support dock mode on some laptops, Intel virtual button driver has been fixed. The last but not least is the fix to Intel HID driver due to changes in Dell systems that prevented to use power button. * tag 'platform-drivers-x86-v4.19-1' of git://git.infradead.org/linux-platform-drivers-x86: (47 commits) platform/x86: acer-wmi: Silence "unsupported" message a bit platform/x86: intel_punit_ipc: fix build errors platform/x86: ideapad: Add Y520-15IKBM and Y720-15IKBM to no_hw_rfkill platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360 platform/x86: acer-wmi: refactor function has_cap platform/x86: thinkpad_acpi: Fix multi-battery bug platform/x86: thinkpad_acpi: extend battery quirk coverage platform/x86: touchscreen_dmi: Add info for the Cube KNote i1101 tablet platform/x86: mlx-platform: Fix copy-paste error in mlxplat_init() platform/x86: mlx-platform: Remove unused define platform/x86: mlx-platform: Change mlxreg-io configuration for MSN274x systems Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces platform/x86: mlx-platform: Allow mlxreg-io driver activation for more systems platform/x86: mlx-platform: Add ASIC hotplug device configuration platform/mellanox: mlxreg-hotplug: Add hotplug hwmon uevent notification platform/mellanox: mlxreg-hotplug: Improve mechanism of ASIC health discovery platform/x86: mlx-platform: Add mlxreg-fan platform driver activation platform/x86: dell-laptop: Fix backlight detection platform/x86: toshiba_acpi: Fix defined but not used build warnings platform/x86: thinkpad_acpi: Support battery quirk ... commit 2edd73a42e0ec847770c8f7ae511d43c26e59b74 Author: Tony Luck Date: Wed Aug 22 13:39:21 2018 -0700 ia64: Fix allnoconfig section mismatch for ioc_init/ioc_iommu_info This has been broken for an embarassingly long time (since v4.4). Just needs a couple of __init tags on functions to make the sections match up. Signed-off-by: Tony Luck Signed-off-by: Linus Torvalds commit c45e6a037a536530bd25781ac7c989e52deb2a63 Author: Jens Axboe Date: Mon Aug 20 13:22:27 2018 -0600 blk-wbt: fix has-sleeper queueing check We need to do this inside the loop as well, or we can allow new IO to supersede previous IO. Tested-by: Anchal Agarwal Signed-off-by: Jens Axboe commit b78820937b4762b7d30b807d7156bec1d89e4dd3 Author: Jens Axboe Date: Mon Aug 20 13:20:50 2018 -0600 blk-wbt: use wq_has_sleeper() for wq active check We need the memory barrier before checking the list head, use the appropriate helper for this. The matching queue side memory barrier is provided by set_current_state(). Tested-by: Anchal Agarwal Signed-off-by: Jens Axboe commit ffa358dcaae1f2f00926484e712e06daa8953cb4 Author: Jens Axboe Date: Mon Aug 20 13:24:25 2018 -0600 blk-wbt: move disable check into get_limit() Check it in one place, instead of in multiple places. Tested-by: Anchal Agarwal Signed-off-by: Jens Axboe commit 45b74a65b9934d5e1520d97aa4e09cf2b8c69ac0 Merge: 433bcf67370b dbf2a4b1ffab Author: Linus Torvalds Date: Wed Aug 22 14:06:37 2018 -0700 Merge branch 'parisc-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull more parisc updates from Helge Deller: - fix boot failure of 64-bit kernel. It got broken by the unwind optimization commit in merge window. - fix 64-bit userspace support (static 64-bit applications only, e.g. we don't yet have 64-bit userspace support in glibc). - consolidate unwind initialization code. - add machine model description to stack trace. * 'parisc-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Add hardware description to stack traces parisc: Fix boot failure of 64-bit kernel parisc: Consolidate unwind initialization calls parisc: Update comments in syscall.S regarding wide userland parisc: Fix ptraced 64-bit applications to call 64-bit syscalls parisc: Restore possibility to execute 64-bit applications commit 3943b040f11ed0cc6d4585fd286a623ca8634547 Author: Shan Hai Date: Thu Aug 23 02:02:56 2018 +0800 bcache: release dc->writeback_lock properly in bch_writeback_thread() The writeback thread would exit with a lock held when the cache device is detached via sysfs interface, fix it by releasing the held lock before exiting the while-loop. Fixes: fadd94e05c02 (bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set) Signed-off-by: Shan Hai Signed-off-by: Coly Li Tested-by: Shenghui Wang Cc: stable@vger.kernel.org #4.17+ Signed-off-by: Jens Axboe commit 2f40c6eac74a2a60921cdec9e9a8a57e88e31434 Author: Emily Deng Date: Wed Aug 22 20:18:25 2018 +0800 amdgpu: fix multi-process hang issue SWDEV-146499: hang during multi vulkan process testing cause: the second frame's PREAMBLE_IB have clear-state and LOAD actions, those actions ruin the pipeline that is still doing process in the previous frame's work-load IB. fix: need insert pipeline sync if have context switch for SRIOV (because only SRIOV will report PREEMPTION flag to UMD) Signed-off-by: Monk Liu Signed-off-by: Emily Deng Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d98ff24e8e9be3329eea7c84d5e244d0c1cd0ab3 Author: Christian König Date: Tue Aug 21 15:09:39 2018 +0200 drm/amdgpu: fix preamble handling At this point the command submission can still be interrupted. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 433bcf67370bc170a345634aa1be4ee8ac905de9 Merge: b37211531194 35d231db53a6 Author: Linus Torvalds Date: Wed Aug 22 14:04:41 2018 -0700 Merge tag 'xtensa-20180820' of git://github.com/jcmvbkbc/linux-xtensa Pull Xtensa updates from Max Filippov: - switch xtensa arch to the generic noncoherent direct mapping operations - add support for DMA_ATTR_NO_KERNEL_MAPPING attribute - clean up users of platform/hardware.h in generic Xtensa code - fix assembly cache maintenance code for long cache lines - rework noMMU cache attributes initialization - add big-endian HiFi2 test_kc705_be CPU variant * tag 'xtensa-20180820' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: add test_kc705_be variant xtensa: clean up boot-elf/bootstrap.S xtensa: make bootparam parsing optional xtensa: drop variant IRQ support xtensa: drop unneeded platform/hardware.h headers xtensa: move PLATFORM_NR_IRQS to Kconfig xtensa: rework {CONFIG,PLATFORM}_DEFAULT_MEM_START xtensa: drop unused {CONFIG,PLATFORM}_DEFAULT_MEM_SIZE xtensa: rework noMMU cache attributes initialization xtensa: increase ranges in ___invalidate_{i,d}cache_all xtensa: limit offsets in __loop_cache_{all,page} xtensa: platform-specific handling of coherent memory xtensa: support DMA_ATTR_NO_KERNEL_MAPPING attribute xtensa: use generic dma_noncoherent_ops commit 8604ffcbf04f8f4f3f55a9e46e5ff948b2ed4290 Author: Christian König Date: Thu Aug 16 12:01:03 2018 +0200 drm/amdgpu: fix VM clearing for the root PD We need to figure out the address after validating the BO, not before. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Reviewed-by: Junwei Zhang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit b372115311942202346d93849991f07382783ef1 Merge: 5bed49adfe89 0027ff2a75f9 Author: Linus Torvalds Date: Wed Aug 22 13:52:44 2018 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull second set of KVM updates from Paolo Bonzini: "ARM: - Support for Group0 interrupts in guests - Cache management optimizations for ARMv8.4 systems - Userspace interface for RAS - Fault path optimization - Emulated physical timer fixes - Random cleanups x86: - fixes for L1TF - a new test case - non-support for SGX (inject the right exception in the guest) - fix lockdep false positive" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (49 commits) KVM: VMX: fixes for vmentry_l1d_flush module parameter kvm: selftest: add dirty logging test kvm: selftest: pass in extra memory when create vm kvm: selftest: include the tools headers kvm: selftest: unify the guest port macros tools: introduce test_and_clear_bit KVM: x86: SVM: Call x86_spec_ctrl_set_guest/host() with interrupts disabled KVM: vmx: Inject #UD for SGX ENCLS instruction in guest KVM: vmx: Add defines for SGX ENCLS exiting x86/kvm/vmx: Fix coding style in vmx_setup_l1d_flush() x86: kvm: avoid unused variable warning KVM: Documentation: rename the capability of KVM_CAP_ARM_SET_SERROR_ESR KVM: arm/arm64: Skip updating PTE entry if no change KVM: arm/arm64: Skip updating PMD entry if no change KVM: arm: Use true and false for boolean values KVM: arm/arm64: vgic: Do not use spin_lock_irqsave/restore with irq disabled KVM: arm/arm64: vgic: Move DEBUG_SPINLOCK_BUG_ON to vgic.h KVM: arm: vgic-v3: Add support for ICC_SGI0R and ICC_ASGI1R accesses KVM: arm64: vgic-v3: Add support for ICC_SGI0R_EL1 and ICC_ASGI1R_EL1 accesses KVM: arm/arm64: vgic-v3: Add core support for Group0 SGIs ... commit 5bed49adfe899667887db0739830190309c9011b Merge: fe6f0ed0dac7 1e7da865b8c0 Author: Linus Torvalds Date: Wed Aug 22 13:38:05 2018 -0700 Merge tag 'for-4.19/post-20180822' of git://git.kernel.dk/linux-block Pull more block updates from Jens Axboe: - Set of bcache fixes and changes (Coly) - The flush warn fix (me) - Small series of BFQ fixes (Paolo) - wbt hang fix (Ming) - blktrace fix (Steven) - blk-mq hardware queue count update fix (Jianchao) - Various little fixes * tag 'for-4.19/post-20180822' of git://git.kernel.dk/linux-block: (31 commits) block/DAC960.c: make some arrays static const, shrinks object size blk-mq: sync the update nr_hw_queues with blk_mq_queue_tag_busy_iter blk-mq: init hctx sched after update ctx and hctx mapping block: remove duplicate initialization tracing/blktrace: Fix to allow setting same value pktcdvd: fix setting of 'ret' error return for a few cases block: change return type to bool block, bfq: return nbytes and not zero from struct cftype .write() method block, bfq: improve code of bfq_bfqq_charge_time block, bfq: reduce write overcharge block, bfq: always update the budget of an entity when needed block, bfq: readd missing reset of parent-entity service blk-wbt: fix IO hang in wbt_wait() block: don't warn for flush on read-only device bcache: add the missing comments for smp_mb()/smp_wmb() bcache: remove unnecessary space before ioctl function pointer arguments bcache: add missing SPDX header bcache: move open brace at end of function definitions to next line bcache: add static const prefix to char * array declarations bcache: fix code comments style ... commit fe6f0ed0dac7df01014ef17fdad45e3eaf21b949 Merge: 6faf05c2b2b4 6aa58d8ad20a Author: Linus Torvalds Date: Wed Aug 22 13:29:39 2018 -0700 Merge tag 'f2fs-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this round, we've tuned f2fs to improve general performance by serializing block allocation and enhancing discard flows like fstrim which avoids user IO contention. And we've added fsync_mode=nobarrier which gives an option to user where it skips issuing cache_flush commands to underlying flash storage. And there are many bug fixes related to fuzzed images, revoked atomic writes, quota ops, and minor direct IO. Enhancements: - add fsync_mode=nobarrier which bypasses cache_flush command - enhance the discarding flow which avoids user IOs and issues in LBA order - readahead some encrypted blocks during GC - enable in-memory inode checksum to verify the blocks if F2FS_CHECK_FS is set - enhance nat_bits behavior - set -o discard by default - set REQ_RAHEAD to bio in ->readpages Bug fixes: - fix a corner case to corrupt atomic_writes revoking flow - revisit i_gc_rwsem to fix race conditions - fix some dio behaviors captured by xfstests - correct handling errors given by quota-related failures - add many sanity check flows to avoid fuzz test failures - add more error number propagation to their callers - fix several corner cases to continue fault injection w/ shutdown loop" * tag 'f2fs-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (89 commits) f2fs: readahead encrypted block during GC f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc f2fs: fix performance issue observed with multi-thread sequential read f2fs: fix to skip verifying block address for non-regular inode f2fs: rework fault injection handling to avoid a warning f2fs: support fault_type mount option f2fs: fix to return success when trimming meta area f2fs: fix use-after-free of dicard command entry f2fs: support discard submission error injection f2fs: split discard command in prior to block layer f2fs: wake up gc thread immediately when gc_urgent is set f2fs: fix incorrect range->len in f2fs_trim_fs() f2fs: refresh recent accessed nat entry in lru list f2fs: fix avoid race between truncate and background GC f2fs: avoid race between zero_range and background GC f2fs: fix to do sanity check with block address in main area v2 f2fs: fix to do sanity check with inline flags f2fs: fix to reset i_gc_failures correctly f2fs: fix invalid memory access f2fs: fix to avoid broken of dnode block list ... commit 6faf05c2b2b4fe70d9068067437649401531de0a Author: Miklos Szeredi Date: Wed Aug 22 10:55:22 2018 +0200 ovl: set I_CREATING on inode being created ...otherwise there will be list corruption due to inode_sb_list_add() being called for inode already on the sb list. Signed-off-by: Miklos Szeredi Fixes: e950564b97fd ("vfs: don't evict uninitialized inode") Signed-off-by: Linus Torvalds commit 9b2e0388bec8ec5427403e23faff3b58dd1c3200 Author: John Fastabend Date: Wed Aug 22 08:37:37 2018 -0700 bpf: sockmap: write_space events need to be passed to TCP handler When sockmap code is using the stream parser it also handles the write space events in order to handle the case where (a) verdict redirects skb to another socket and (b) the sockmap then sends the skb but due to memory constraints (or other EAGAIN errors) needs to do a retry. But the initial code missed a third case where the skb_send_sock_locked() triggers an sk_wait_event(). A typically case would be when sndbuf size is exceeded. If this happens because we do not pass the write_space event to the lower layers we never wake up the event and it will wait for sndtimeo. Which as noted in ktls fix may be rather large and look like a hang to the user. To reproduce the best test is to reduce the sndbuf size and send 1B data chunks to stress the memory handling. To fix this pass the event from the upper layer to the lower layer. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 67db7cd249e71f64346f481b629724376d063e08 Author: John Fastabend Date: Wed Aug 22 08:37:32 2018 -0700 tls: possible hang when do_tcp_sendpages hits sndbuf is full case Currently, the lower protocols sk_write_space handler is not called if TLS is sending a scatterlist via tls_push_sg. However, normally tls_push_sg calls do_tcp_sendpage, which may be under memory pressure, that in turn may trigger a wait via sk_wait_event. Typically, this happens when the in-flight bytes exceed the sdnbuf size. In the normal case when enough ACKs are received sk_write_space() will be called and the sk_wait_event will be woken up allowing it to send more data and/or return to the user. But, in the TLS case because the sk_write_space() handler does not wake up the events the above send will wait until the sndtimeo is exceeded. By default this is MAX_SCHEDULE_TIMEOUT so it look like a hang to the user (especially this impatient user). To fix this pass the sk_write_space event to the lower layers sk_write_space event which in the TCP case will wake any pending events. I observed the above while integrating sockmap and ktls. It initially appeared as test_sockmap (modified to use ktls) occasionally hanging. To reliably reproduce this reduce the sndbuf size and stress the tls layer by sending many 1B sends. This results in every byte needing a header and each byte individually being sent to the crypto layer. Signed-off-by: John Fastabend Acked-by: Dave Watson Signed-off-by: Daniel Borkmann commit cd9b44f90763c3367e8dd0601849ffb028e8ba52 Merge: df2def49c57b 2a9d64810042 Author: Linus Torvalds Date: Wed Aug 22 12:34:08 2018 -0700 Merge branch 'akpm' (patches from Andrew) Merge more updates from Andrew Morton: - the rest of MM - procfs updates - various misc things - more y2038 fixes - get_maintainer updates - lib/ updates - checkpatch updates - various epoll updates - autofs updates - hfsplus - some reiserfs work - fatfs updates - signal.c cleanups - ipc/ updates * emailed patches from Andrew Morton : (166 commits) ipc/util.c: update return value of ipc_getref from int to bool ipc/util.c: further variable name cleanups ipc: simplify ipc initialization ipc: get rid of ids->tables_initialized hack lib/rhashtable: guarantee initial hashtable allocation lib/rhashtable: simplify bucket_table_alloc() ipc: drop ipc_lock() ipc/util.c: correct comment in ipc_obtain_object_check ipc: rename ipcctl_pre_down_nolock() ipc/util.c: use ipc_rcu_putref() for failues in ipc_addid() ipc: reorganize initialization of kern_ipc_perm.seq ipc: compute kern_ipc_perm.id under the ipc lock init/Kconfig: remove EXPERT from CHECKPOINT_RESTORE fs/sysv/inode.c: use ktime_get_real_seconds() for superblock stamp adfs: use timespec64 for time conversion kernel/sysctl.c: fix typos in comments drivers/rapidio/devices/rio_mport_cdev.c: remove redundant pointer md fork: don't copy inconsistent signal handler state to child signal: make get_signal() return bool signal: make sigkill_pending() return bool ... commit eb29429d81e31b191f3b2bd19cf820279cec6463 Author: Daniel Borkmann Date: Wed Aug 22 18:09:17 2018 +0200 bpf, sockmap: fix sock hash count in alloc_sock_hash_elem When we try to allocate a new sock hash entry and the allocation fails, then sock hash map fails to reduce the map element counter, meaning we keep accounting this element although it was never used. Fix it by dropping the element counter on error. Fixes: 81110384441a ("bpf: sockmap, add hash map support") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend commit b845c898b2f1ea458d5453f0fa1da6e2dfce3bb4 Author: Daniel Borkmann Date: Tue Aug 21 15:55:00 2018 +0200 bpf, sockmap: fix sock_hash_alloc and reject zero-sized keys Currently, it is possible to create a sock hash map with key size of 0 and have the kernel return a fd back to user space. This is invalid for hash maps (and kernel also hasn't been tested for zero key size support in general at this point). Thus, reject such configuration. Fixes: 81110384441a ("bpf: sockmap, add hash map support") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Song Liu commit 2a9d6481004215da8e93edb588cf448f2af80303 Author: Manfred Spraul Date: Tue Aug 21 22:02:04 2018 -0700 ipc/util.c: update return value of ipc_getref from int to bool ipc_getref has still a return value of type "int", matching the atomic_t interface of atomic_inc_not_zero()/atomic_add_unless(). ipc_getref now uses refcount_inc_not_zero, which has a return value of type "bool". Therefore, update the return code to avoid implicit conversions. Link: http://lkml.kernel.org/r/20180712185241.4017-13-manfred@colorfullife.com Signed-off-by: Manfred Spraul Cc: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Dmitry Vyukov Cc: Herbert Xu Cc: Kees Cook Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 27c331a174614208d0b539019583990967ad9479 Author: Manfred Spraul Date: Tue Aug 21 22:02:00 2018 -0700 ipc/util.c: further variable name cleanups The varable names got a mess, thus standardize them again: id: user space id. Called semid, shmid, msgid if the type is known. Most functions use "id" already. idx: "index" for the idr lookup Right now, some functions use lid, ipc_addid() already uses idx as the variable name. seq: sequence number, to avoid quick collisions of the user space id key: user space key, used for the rhash tree Link: http://lkml.kernel.org/r/20180712185241.4017-12-manfred@colorfullife.com Signed-off-by: Manfred Spraul Cc: Dmitry Vyukov Cc: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Herbert Xu Cc: Kees Cook Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit eae04d25a713304c978d7c45dcab01b0e0811c74 Author: Davidlohr Bueso Date: Tue Aug 21 22:01:56 2018 -0700 ipc: simplify ipc initialization Now that we know that rhashtable_init() will not fail, we can get rid of a lot of the unnecessary cleanup paths when the call errored out. [manfred@colorfullife.com: variable name added to util.h to resolve checkpatch warning] Link: http://lkml.kernel.org/r/20180712185241.4017-11-manfred@colorfullife.com Signed-off-by: Davidlohr Bueso Signed-off-by: Manfred Spraul Cc: Dmitry Vyukov Cc: Herbert Xu Cc: Kees Cook Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dc2c8c84def6ce450c63529e08c1db100020994e Author: Davidlohr Bueso Date: Tue Aug 21 22:01:52 2018 -0700 ipc: get rid of ids->tables_initialized hack In sysvipc we have an ids->tables_initialized regarding the rhashtable, introduced in 0cfb6aee70bd ("ipc: optimize semget/shmget/msgget for lots of keys") It's there, specifically, to prevent nil pointer dereferences, from using an uninitialized api. Considering how rhashtable_init() can fail (probably due to ENOMEM, if anything), this made the overall ipc initialization capable of failure as well. That alone is ugly, but fine, however I've spotted a few issues regarding the semantics of tables_initialized (however unlikely they may be): - There is inconsistency in what we return to userspace: ipc_addid() returns ENOSPC which is certainly _wrong_, while ipc_obtain_object_idr() returns EINVAL. - After we started using rhashtables, ipc_findkey() can return nil upon !tables_initialized, but the caller expects nil for when the ipc structure isn't found, and can therefore call into ipcget() callbacks. Now that rhashtable initialization cannot fail, we can properly get rid of the hack altogether. [manfred@colorfullife.com: commit id extended to 12 digits] Link: http://lkml.kernel.org/r/20180712185241.4017-10-manfred@colorfullife.com Signed-off-by: Davidlohr Bueso Signed-off-by: Manfred Spraul Cc: Dmitry Vyukov Cc: Herbert Xu Cc: Kees Cook Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2d22ecf6db1c390974476758681ba4229018e774 Author: Davidlohr Bueso Date: Tue Aug 21 22:01:48 2018 -0700 lib/rhashtable: guarantee initial hashtable allocation rhashtable_init() may fail due to -ENOMEM, thus making the entire api unusable. This patch removes this scenario, however unlikely. In order to guarantee memory allocation, this patch always ends up doing GFP_KERNEL|__GFP_NOFAIL for both the tbl as well as alloc_bucket_spinlocks(). Upon the first table allocation failure, we shrink the size to the smallest value that makes sense and retry with __GFP_NOFAIL semantics. With the defaults, this means that from 64 buckets, we retry with only 4. Any later issues regarding performance due to collisions or larger table resizing (when more memory becomes available) is the least of our problems. Link: http://lkml.kernel.org/r/20180712185241.4017-9-manfred@colorfullife.com Signed-off-by: Davidlohr Bueso Signed-off-by: Manfred Spraul Acked-by: Herbert Xu Cc: Dmitry Vyukov Cc: Kees Cook Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 93f976b5190df32793908d49165f78e67fcb66cf Author: Davidlohr Bueso Date: Tue Aug 21 22:01:45 2018 -0700 lib/rhashtable: simplify bucket_table_alloc() As of ce91f6ee5b3b ("mm: kvmalloc does not fallback to vmalloc for incompatible gfp flags") we can simplify the caller and trust kvzalloc() to just do the right thing. For the case of the GFP_ATOMIC context, we can drop the __GFP_NORETRY flag for obvious reasons, and for the __GFP_NOWARN case, however, it is changed such that the caller passes the flag instead of making bucket_table_alloc() handle it. This slightly changes the gfp flags passed on to nested_table_alloc() as it will now also use GFP_ATOMIC | __GFP_NOWARN. However, I consider this a positive consequence as for the same reasons we want nowarn semantics in bucket_table_alloc(). [manfred@colorfullife.com: commit id extended to 12 digits, line wraps updated] Link: http://lkml.kernel.org/r/20180712185241.4017-8-manfred@colorfullife.com Signed-off-by: Davidlohr Bueso Signed-off-by: Manfred Spraul Acked-by: Michal Hocko Cc: Dmitry Vyukov Cc: Herbert Xu Cc: Kees Cook Cc: Michael Kerrisk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 82061c57ce93caa50fd01c11f8eb30ddc4c4bd75 Author: Davidlohr Bueso Date: Tue Aug 21 22:01:41 2018 -0700 ipc: drop ipc_lock() ipc/util.c contains multiple functions to get the ipc object pointer given an id number. There are two sets of function: One set verifies the sequence counter part of the id number, other functions do not check the sequence counter. The standard for function names in ipc/util.c is - ..._check() functions verify the sequence counter - ..._idr() functions do not verify the sequence counter ipc_lock() is an exception: It does not verify the sequence counter value, but this is not obvious from the function name. Furthermore, shm.c is the only user of this helper. Thus, we can simply move the logic into shm_lock() and get rid of the function altogether. [manfred@colorfullife.com: most of changelog] Link: http://lkml.kernel.org/r/20180712185241.4017-7-manfred@colorfullife.com Signed-off-by: Davidlohr Bueso Signed-off-by: Manfred Spraul Cc: Dmitry Vyukov Cc: Herbert Xu Cc: Kees Cook Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2e5ceb452c9b7f0a30c87bd61c01260e3d8464ad Author: Manfred Spraul Date: Tue Aug 21 22:01:37 2018 -0700 ipc/util.c: correct comment in ipc_obtain_object_check The comment that explains ipc_obtain_object_check is wrong: The function checks the sequence number, not the reference counter. Note that checking the reference counter would be meaningless: The reference counter is decreased without holding any locks, thus an object with kern_ipc_perm.deleted=true may disappear at the end of the next rcu grace period. Link: http://lkml.kernel.org/r/20180712185241.4017-6-manfred@colorfullife.com Signed-off-by: Manfred Spraul Reviewed-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Dmitry Vyukov Cc: Herbert Xu Cc: Kees Cook Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4241c1a304078569f544d51eeaf8bc270b6e377a Author: Manfred Spraul Date: Tue Aug 21 22:01:34 2018 -0700 ipc: rename ipcctl_pre_down_nolock() Both the comment and the name of ipcctl_pre_down_nolock() are misleading: The function must be called while holdling the rw semaphore. Therefore the patch renames the function to ipcctl_obtain_check(): This name matches the other names used in util.c: - "obtain" function look up a pointer in the idr, without acquiring the object lock. - The caller is responsible for locking. - _check means that the sequence number is checked. Link: http://lkml.kernel.org/r/20180712185241.4017-5-manfred@colorfullife.com Signed-off-by: Manfred Spraul Reviewed-by: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Dmitry Vyukov Cc: Herbert Xu Cc: Kees Cook Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 39cfffd774a2e8818250360a3e028b5eac9d5392 Author: Manfred Spraul Date: Tue Aug 21 22:01:29 2018 -0700 ipc/util.c: use ipc_rcu_putref() for failues in ipc_addid() ipc_addid() is impossible to use: - for certain failures, the caller must not use ipc_rcu_putref(), because the reference counter is not yet initialized. - for other failures, the caller must use ipc_rcu_putref(), because parallel operations could be ongoing already. The patch cleans that up, by initializing the refcount early, and by modifying all callers. The issues is related to the finding of syzbot+2827ef6b3385deb07eaf@syzkaller.appspotmail.com: syzbot found an issue with reading kern_ipc_perm.seq, here both read and write to already released memory could happen. Link: http://lkml.kernel.org/r/20180712185241.4017-4-manfred@colorfullife.com Signed-off-by: Manfred Spraul Cc: Dmitry Vyukov Cc: Kees Cook Cc: Davidlohr Bueso Cc: Davidlohr Bueso Cc: Herbert Xu Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e2652ae6bd7492cdc0436817cbcd09282eb0bb03 Author: Manfred Spraul Date: Tue Aug 21 22:01:25 2018 -0700 ipc: reorganize initialization of kern_ipc_perm.seq ipc_addid() initializes kern_ipc_perm.seq after having called idr_alloc() (within ipc_idr_alloc()). Thus a parallel semop() or msgrcv() that uses ipc_obtain_object_check() may see an uninitialized value. The patch moves the initialization of kern_ipc_perm.seq before the calls of idr_alloc(). Notes: 1) This patch has a user space visible side effect: If /proc/sys/kernel/*_next_id is used (i.e.: checkpoint/restore) and if semget()/msgget()/shmget() fails in the final step of adding the id to the rhash tree, then .._next_id is cleared. Before the patch, is remained unmodified. There is no change of the behavior after a successful ..get() call: It always clears .._next_id, there is no impact to non checkpoint/restore code as that code does not use .._next_id. 2) The patch correctly documents that after a call to ipc_idr_alloc(), the full tear-down sequence must be used. The callers of ipc_addid() do not fullfill that, i.e. more bugfixes are required. The patch is a squash of a patch from Dmitry and my own changes. Link: http://lkml.kernel.org/r/20180712185241.4017-3-manfred@colorfullife.com Reported-by: syzbot+2827ef6b3385deb07eaf@syzkaller.appspotmail.com Signed-off-by: Manfred Spraul Cc: Dmitry Vyukov Cc: Kees Cook Cc: Davidlohr Bueso Cc: Michael Kerrisk Cc: Davidlohr Bueso Cc: Herbert Xu Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 615c999cd8a07b7c3c93bbdee89ef705d2ce52e1 Author: Manfred Spraul Date: Tue Aug 21 22:01:21 2018 -0700 ipc: compute kern_ipc_perm.id under the ipc lock ipc_addid() initializes kern_ipc_perm.id after having called ipc_idr_alloc(). Thus a parallel semctl() or msgctl() that uses e.g. MSG_STAT may use this unitialized value as the return code. The patch moves all accesses to kern_ipc_perm.id under the spin_lock(). The issues is related to the finding of syzbot+2827ef6b3385deb07eaf@syzkaller.appspotmail.com: syzbot found an issue with kern_ipc_perm.seq Link: http://lkml.kernel.org/r/20180712185241.4017-2-manfred@colorfullife.com Signed-off-by: Manfred Spraul Reviewed-by: Davidlohr Bueso Cc: Dmitry Vyukov Cc: Kees Cook Cc: Davidlohr Bueso Cc: Herbert Xu Cc: Michael Kerrisk Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5cb366bb3a746f6b06ea086b322e21e345401c9d Author: Adrian Reber Date: Tue Aug 21 22:01:17 2018 -0700 init/Kconfig: remove EXPERT from CHECKPOINT_RESTORE The CHECKPOINT_RESTORE configuration option was introduced in 2012 and combined with EXPERT. CHECKPOINT_RESTORE is already enabled in many distribution kernels and also part of the defconfigs of various architectures. To make it easier for distributions to enable CHECKPOINT_RESTORE this removes EXPERT and moves the configuration option out of the EXPERT block. Link: http://lkml.kernel.org/r/20180712130733.11510-1-adrian@lisas.de Signed-off-by: Adrian Reber Acked-by: Oleg Nesterov Reviewed-by: Hendrik Brueckner Acked-by: Pavel Emelyanov Cc: Eric W. Biederman Cc: Andrei Vagin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3e811f053aec66e8a6d2a0ee3d031e7c988e3d15 Author: Arnd Bergmann Date: Tue Aug 21 22:01:13 2018 -0700 fs/sysv/inode.c: use ktime_get_real_seconds() for superblock stamp get_seconds() is deprecated in favor of ktime_get_real_seconds(), which returns a 64-bit timestamp. In the SYSV file system, the superblock timestamp is only 32 bits wide, and it is used to check whether a file system is clean, so the best solution seems to be to force a wraparound and explicitly convert it to an unsigned 32-bit value. This is independent of the inode timestamps that are also 32-bit wide on disk and that come from current_time(). Link: http://lkml.kernel.org/r/20180713145236.3152513-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Acked-by: Thomas Gleixner Reviewed-by: Andrew Morton Cc: Alexander Viro Cc: Christoph Hellwig Cc: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d9edcbc42c77b719e03dedb2aff719ae19659a0f Author: Arnd Bergmann Date: Tue Aug 21 22:01:09 2018 -0700 adfs: use timespec64 for time conversion We just truncate the seconds to 32-bit in one place now, so this can trivially be converted over to using timespec64 consistently. Link: http://lkml.kernel.org/r/20180620100133.4035614-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5f733e8a2dd130eaeed24cbaef49d349206cdb8b Author: Randy Dunlap Date: Tue Aug 21 22:01:06 2018 -0700 kernel/sysctl.c: fix typos in comments Fix a few typos/spellos in kernel/sysctl.c. Link: http://lkml.kernel.org/r/bb09a8b9-f984-6dd4-b07b-3ecaf200862e@infradead.org Signed-off-by: Randy Dunlap Acked-by: Kees Cook Cc: "Luis R. Rodriguez" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0ba7f398f39ebc33a695058a8d12c4d795430ffa Author: Colin Ian King Date: Tue Aug 21 22:01:01 2018 -0700 drivers/rapidio/devices/rio_mport_cdev.c: remove redundant pointer md Pointer md is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'md' set but not used [-Wunused-but-set-variable] Link: http://lkml.kernel.org/r/20180711082346.5223-1-colin.king@canonical.com Signed-off-by: Colin Ian King Acked-by: Alexandre Bounine Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 06e62a46bbba20aa5286102016a04214bb446141 Author: Jann Horn Date: Tue Aug 21 22:00:58 2018 -0700 fork: don't copy inconsistent signal handler state to child Before this change, if a multithreaded process forks while one of its threads is changing a signal handler using sigaction(), the memcpy() in copy_sighand() can race with the struct assignment in do_sigaction(). It isn't clear whether this can cause corruption of the userspace signal handler pointer, but it definitely can cause inconsistency between different fields of struct sigaction. Take the appropriate spinlock to avoid this. I have tested that this patch prevents inconsistency between sa_sigaction and sa_flags, which is possible before this patch. Link: http://lkml.kernel.org/r/20180702145108.73189-1-jannh@google.com Signed-off-by: Jann Horn Acked-by: Michal Hocko Reviewed-by: Andrew Morton Cc: Rik van Riel Cc: "Peter Zijlstra (Intel)" Cc: Kees Cook Cc: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 20ab7218d2507b2dbec9c053c2f1b96054e266b6 Author: Christian Brauner Date: Tue Aug 21 22:00:54 2018 -0700 signal: make get_signal() return bool make get_signal() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-18-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f99e9d8c5c7f5539e6d97fd04a4ad213e52daac0 Author: Christian Brauner Date: Tue Aug 21 22:00:50 2018 -0700 signal: make sigkill_pending() return bool sigkill_pending() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-17-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a19e2c01f71bb4b8442db450200a01a28db36a04 Author: Christian Brauner Date: Tue Aug 21 22:00:46 2018 -0700 signal: make legacy_queue() return bool legacy_queue() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-16-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit acd14e62f075f44cd04e1ac2920a515f9b80146e Author: Christian Brauner Date: Tue Aug 21 22:00:42 2018 -0700 signal: make wants_signal() return bool wants_signal() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-15-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8f11351eee9524c179361fcbf1538c993f2390e4 Author: Christian Brauner Date: Tue Aug 21 22:00:38 2018 -0700 signal: make flush_sigqueue_mask() void The return value of flush_sigqueue_mask() is never checked anywhere. Link: http://lkml.kernel.org/r/20180602103653.18181-14-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 67a48a24478841525ba73ec6d64caaf079cf3b7c Author: Christian Brauner Date: Tue Aug 21 22:00:34 2018 -0700 signal: make unhandled_signal() return bool unhandled_signal() already behaves like a boolean function. Let's actually declare it as such too. All callers treat it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-13-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 09ae854edb2d275d98a874c21c24c58cee4df14e Author: Christian Brauner Date: Tue Aug 21 22:00:30 2018 -0700 signal: make recalc_sigpending_tsk() return bool recalc_sigpending_tsk() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-12-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 938696a82974c33b93be9657b72521bc84f5c587 Author: Christian Brauner Date: Tue Aug 21 22:00:27 2018 -0700 signal: make has_pending_signals() return bool has_pending_signals() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-11-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6a0cdcd78892d4508e77cbec913eaf099ab4a8e9 Author: Christian Brauner Date: Tue Aug 21 22:00:23 2018 -0700 signal: make sig_ignored() return bool sig_ignored() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-10-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 41aaa481197dc566f691d403e0247bb53a017770 Author: Christian Brauner Date: Tue Aug 21 22:00:19 2018 -0700 signal: make sig_task_ignored() return bool sig_task_ignored() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-9-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e4a8b4efbfdf8ce86b1d410cc96d2790a05f1fd5 Author: Christian Brauner Date: Tue Aug 21 22:00:15 2018 -0700 signal: make sig_handler_ignored() return bool sig_handler_ignored() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-8-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2a9b90940957d3c0f744011b02b4575323be5947 Author: Christian Brauner Date: Tue Aug 21 22:00:11 2018 -0700 signal: make kill_ok_by_cred() return bool kill_ok_by_cred() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-7-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d8f993b3dba05ff354f9b9592afc44b1b3dbfd46 Author: Christian Brauner Date: Tue Aug 21 22:00:07 2018 -0700 signal: simplify rt_sigaction() The goto is not needed and does not add any clarity. Simply return -EINVAL on unexpected sigset_t struct size directly. Link: http://lkml.kernel.org/r/20180602103653.18181-6-christian@brauner.io Signed-off-by: Christian Brauner Acked-by: Oleg Nesterov Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b1d294c80393e7ba18b3c646fe9d8e6a206c7988 Author: Christian Brauner Date: Tue Aug 21 22:00:02 2018 -0700 signal: make do_sigpending() void do_sigpending() returned 0 unconditionally so it doesn't make sense to have it return at all. This allows us to simplify a bunch of syscall callers. Link: http://lkml.kernel.org/r/20180602103653.18181-5-christian@brauner.io Signed-off-by: Christian Brauner Acked-by: Al Viro Acked-by: Oleg Nesterov Reviewed-by: Andrew Morton Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6527de953354e550bf6d941fdcd1aaf832317e8d Author: Christian Brauner Date: Tue Aug 21 21:59:59 2018 -0700 signal: make may_ptrace_stop() return bool may_ptrace_stop() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-4-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bb17fcca078fc56ea7c7611cbe92687021cf6a31 Author: Christian Brauner Date: Tue Aug 21 21:59:55 2018 -0700 signal: make kill_as_cred_perm() return bool kill_as_cred_perm() already behaves like a boolean function. Let's actually declare it as such too. Link: http://lkml.kernel.org/r/20180602103653.18181-3-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Al Viro Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 52cba1a274818c3ee6299c1a1b476e7bc5037a2f Author: Christian Brauner Date: Tue Aug 21 21:59:51 2018 -0700 signal: make force_sigsegv() void Patch series "signal: refactor some functions", v3. This series refactors a bunch of functions in signal.c to simplify parts of the code. The greatest single change is declaring the static do_sigpending() helper as void which makes it possible to remove a bunch of unnecessary checks in the syscalls later on. This patch (of 17): force_sigsegv() returned 0 unconditionally so it doesn't make sense to have it return at all. In addition, there are no callers that check force_sigsegv()'s return value. Link: http://lkml.kernel.org/r/20180602103653.18181-2-christian@brauner.io Signed-off-by: Christian Brauner Reviewed-by: Andrew Morton Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: James Morris Cc: Kees Cook Cc: Peter Zijlstra Cc: Stephen Smalley Cc: Al Viro Cc: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f423420c23899469a3ba4e100def43ab26f2e0bf Author: Arnd Bergmann Date: Tue Aug 21 21:59:48 2018 -0700 fat: propagate 64-bit inode timestamps Now that we pass down 64-bit timestamps from VFS, we just need to convert that correctly into on-disk timestamps. To make that work correctly, this changes the last use of time_to_tm() in the kernel to time64_to_tm(), which also lets use remove that deprecated interfaces. Similarly, the time_t use in fat_time_fat2unix() truncates the timestamp on the way in, which can be avoided by using types that are wide enough to hold the intermediate values during the conversion. [hirofumi@mail.parknet.co.jp: remove useless temporary variable, needless long long] Link: http://lkml.kernel.org/r/20180619153646.3637529-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Acked-by: OGAWA Hirofumi Cc: Jeff Layton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0afa9626667c3659ef8bd82d42a11e39fedf235c Author: OGAWA Hirofumi Date: Tue Aug 21 21:59:44 2018 -0700 fat: validate ->i_start before using On corrupted FATfs may have invalid ->i_start. To handle it, this checks ->i_start before using, and return proper error code. Link: http://lkml.kernel.org/r/87o9f8y1t5.fsf_-_@mail.parknet.co.jp Signed-off-by: OGAWA Hirofumi Reported-by: Anatoly Trosinenko Tested-by: Anatoly Trosinenko Cc: Alan Cox Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f663b5b38fffeb31841f8bfaf0ef87a445b0ffee Author: Wentao Wang Date: Tue Aug 21 21:59:41 2018 -0700 fat: add FITRIM ioctl for FAT file system Add FITRIM ioctl for FAT file system [witallwang@gmail.com: use u64s] Link: http://lkml.kernel.org/r/87h8l37hub.fsf@mail.parknet.co.jp [hirofumi@mail.parknet.co.jp: bug fixes, coding style fixes, add signal check] Link: http://lkml.kernel.org/r/87fu10anhj.fsf@mail.parknet.co.jp Signed-off-by: Wentao Wang Signed-off-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a13f085d111e90469faf2d9965eb39b11c114d7e Author: Jann Horn Date: Tue Aug 21 21:59:37 2018 -0700 reiserfs: fix broken xattr handling (heap corruption, bad retval) This fixes the following issues: - When a buffer size is supplied to reiserfs_listxattr() such that each individual name fits, but the concatenation of all names doesn't fit, reiserfs_listxattr() overflows the supplied buffer. This leads to a kernel heap overflow (verified using KASAN) followed by an out-of-bounds usercopy and is therefore a security bug. - When a buffer size is supplied to reiserfs_listxattr() such that a name doesn't fit, -ERANGE should be returned. But reiserfs instead just truncates the list of names; I have verified that if the only xattr on a file has a longer name than the supplied buffer length, listxattr() incorrectly returns zero. With my patch applied, -ERANGE is returned in both cases and the memory corruption doesn't happen anymore. Credit for making me clean this code up a bit goes to Al Viro, who pointed out that the ->actor calling convention is suboptimal and should be changed. Link: http://lkml.kernel.org/r/20180802151539.5373-1-jannh@google.com Fixes: 48b32a3553a5 ("reiserfs: use generic xattr handlers") Signed-off-by: Jann Horn Acked-by: Jeff Mahoney Cc: Eric Biggers Cc: Al Viro Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8b73ce6a4bae4fe12bcb2c361c0da4183c2e1b6f Author: Arnd Bergmann Date: Tue Aug 21 21:59:34 2018 -0700 reiserfs: change j_timestamp type to time64_t This uses the deprecated time_t type but is write-only, and could be removed, but as Jeff explains, having a timestamp can be usefule for post-mortem analysis in crash dumps. In order to remove one of the last instances of time_t, this changes the type to time64_t, same as j_trans_start_time. Link: http://lkml.kernel.org/r/20180622133315.221210-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Cc: Jan Kara Cc: Jeff Mahoney Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b1d149c895b3229d70c0d4c69e14bdbe5fe8226 Author: Arnd Bergmann Date: Tue Aug 21 21:59:30 2018 -0700 reiserfs: remove obsolete print_time function Before linux-2.4.6, print_time() was used to pretty-print an inode time when running reiserfs in user space, after that it has become obsolete and is still a bit incorrect: It behaves differently on 32-bit and 64-bit machines, and uses a static buffer to hold a string, which could lead to undefined behavior if we ever called this from multiple places simultaneously. Since we always want to treat the timestamps as 'unsigned' anyway, simply printing them as an integer is both simpler and safer while avoiding the deprecated time_t type. Link: http://lkml.kernel.org/r/20180620142522.27639-3-arnd@arndb.de Signed-off-by: Arnd Bergmann Reviewed-by: Jan Kara Cc: Al Viro Cc: Jeff Mahoney Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 34d082604a7c8856051ff441fef0e22d93afd848 Author: Arnd Bergmann Date: Tue Aug 21 21:59:26 2018 -0700 reiserfs: use monotonic time for j_trans_start_time Using CLOCK_REALTIME time_t timestamps breaks on 32-bit systems in 2038, and gives surprising results with a concurrent settimeofday(). This changes the reiserfs journal timestamps to use ktime_get_seconds() instead, which makes it use a 64-bit CLOCK_MONOTONIC stamp. In the procfs output, the monotonic timestamp needs to be converted back to CLOCK_REALTIME to keep the existing ABI. Link: http://lkml.kernel.org/r/20180620142522.27639-2-arnd@arndb.de Signed-off-by: Arnd Bergmann Reviewed-by: Jan Kara Cc: Al Viro Cc: Jeff Mahoney Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f168d9fd634a4612d308d7dbe0a4d2a9b366c045 Author: Ernesto A. Fernández Date: Tue Aug 21 21:59:23 2018 -0700 hfsplus: drop ACL support The HFS+ Access Control Lists have not worked at all for the past five years, and nobody seems to have noticed. Besides, POSIX draft ACLs are not compatible with MacOS. Drop the feature entirely. Link: http://lkml.kernel.org/r/20180714190608.wtnmmtjqeyladkut@eaf Signed-off-by: Ernesto A. Fernández Acked-by: Christoph Hellwig Cc: Viacheslav Dubeyko Cc: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit afd6c9e1f5287ad236adcf56db8c42fef65561fa Author: Ernesto A. Fernández Date: Tue Aug 21 21:59:19 2018 -0700 hfsplus: fix decomposition of Hangul characters Files created under macOS cannot be opened under linux if their names contain Korean characters, and vice versa. The Korean alphabet is special because its normalization is done without a table. The module deals with it correctly when composing, but forgets about it for the decomposition. Fix this using the Hangul decomposition function provided in the Unicode Standard. The code fits a bit awkwardly because it requires a buffer, while all the other normalizations are returned as pointers to the decomposition table. This is actually also a bug because reordering may still be needed, but for now leave it as it is. The patch will cause trouble for Hangul filenames already created by the module in the past. This shouldn't really be concern because its main purpose was always sharing with macOS. If a user actually needs to access such a file the nodecompose mount option should be enough. Link: http://lkml.kernel.org/r/20180717220951.p6qqrgautc4pxvzu@eaf Signed-off-by: Ernesto A. Fernández Reported-by: Ting-Chang Hou Tested-by: Ting-Chang Hou Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 31651c607151f1034cfb57e5a78678bea54c362b Author: Ernesto A. Fernández Date: Tue Aug 21 21:59:16 2018 -0700 hfsplus: avoid deadlock on file truncation After an extent is removed from the extent tree, the corresponding bits are also cleared from the block allocation file. This is currently done without releasing the tree lock. The problem is that the allocation file has extents of its own; if it is fragmented enough, some of them may be in the extent tree as well, and hfsplus_get_block() will try to take the lock again. To avoid deadlock, only hold the extent tree lock during the actual tree operations. Link: http://lkml.kernel.org/r/20180709202549.auxwkb6memlegb4a@eaf Signed-off-by: Ernesto A. Fernández Reported-by: Anatoly Trosinenko Cc: Viacheslav Dubeyko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7464726cb5998846306ed0a7d6714afb2e37b25d Author: Tetsuo Handa Date: Tue Aug 21 21:59:12 2018 -0700 hfsplus: don't return 0 when fill_super() failed syzbot is reporting NULL pointer dereference at mount_fs() [1]. This is because hfsplus_fill_super() is by error returning 0 when hfsplus_fill_super() detected invalid filesystem image, and mount_bdev() is returning NULL because dget(s->s_root) == NULL if s->s_root == NULL, and mount_fs() is accessing root->d_sb because IS_ERR(root) == false if root == NULL. Fix this by returning -EINVAL when hfsplus_fill_super() detected invalid filesystem image. [1] https://syzkaller.appspot.com/bug?id=21acb6850cecbc960c927229e597158cf35f33d0 Link: http://lkml.kernel.org/r/d83ce31a-874c-dd5b-f790-41405983a5be@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Reported-by: syzbot Reviewed-by: Ernesto A. Fernández Reviewed-by: Andrew Morton Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c8ed98cd88a2b39f504e1ce6af42423c71ebe5b7 Author: Souptick Joarder Date: Tue Aug 21 21:59:08 2018 -0700 fs/nilfs2/file.c: use new return type vm_fault_t Use new return type vm_fault_t for page_mkwrite handler. Link: http://lkml.kernel.org/r/1529555928-2411-1-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Souptick Joarder Signed-off-by: Ryusuke Konishi Reviewed-by: Matthew Wilcox Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 21a1a52dbdd5c9dc17c546bbdb95038f53515d2c Author: Arnd Bergmann Date: Tue Aug 21 21:59:05 2018 -0700 nilfs2: use 64-bit superblock timstamps The mount time field in the superblock uses a 64-bit timestamp, but calling get_seconds() may truncate the current time to 32 bits. This changes it to ktime_get_real_seconds() to avoid the potential overflow. Link: http://lkml.kernel.org/r/20180620075041.4154396-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Acked-by: Ryusuke Konishi Cc: David Howells Cc: Jeff Layton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cbf6898fd69455092c43cd573b38d42c86ddb1e0 Author: Ian Kent Date: Tue Aug 21 21:59:01 2018 -0700 autofs: add AUTOFS_EXP_FORCED flag The userspace automount(8) daemon is meant to perform a forced expire when sent a SIGUSR2. But since the expiration is routed through the kernel and the kernel doesn't send an expire request if the mount is busy this hasn't worked at least since autofs version 5. Add an AUTOFS_EXP_FORCED flag to allow implemention of the feature and bump the protocol version so user space can check if it's implemented if needed. Link: http://lkml.kernel.org/r/152937734715.21213.6594007182776598970.stgit@pluto.themaw.net Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e5c85e1fe19c03777cbacf4b5a5167b2f5ff90fb Author: Ian Kent Date: Tue Aug 21 21:58:58 2018 -0700 autofs: make expire flags usage consistent with v5 params Make the usage of the expire flags consistent by naming the expire flags the same as it is named in the version 5 miscelaneous ioctl parameters and only check the bit flags when needed. Link: http://lkml.kernel.org/r/152937734046.21213.9454131988766280028.stgit@pluto.themaw.net Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 571bc35c42f3455bc55393f22cb97f7407a5a6d1 Author: Ian Kent Date: Tue Aug 21 21:58:54 2018 -0700 autofs: make autofs_expire_indirect() static autofs_expire_indirect() isn't used outside of fs/autofs/expire.c so make it static. Link: http://lkml.kernel.org/r/152937733512.21213.10509996499623738446.stgit@pluto.themaw.net Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5d30517d67e349164838ad039f0f2d09dde15f59 Author: Ian Kent Date: Tue Aug 21 21:58:51 2018 -0700 autofs: make autofs_expire_direct() static autofs_expire_direct() isn't used outside of fs/autofs/expire.c so make it static. Link: http://lkml.kernel.org/r/152937732944.21213.11821977712410930973.stgit@pluto.themaw.net Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d1055565bdc27fd4dc90a91988b938b949662025 Author: Ian Kent Date: Tue Aug 21 21:58:48 2018 -0700 autofs: fix clearing AUTOFS_EXP_LEAVES in autofs_expire_indirect() The expire flag AUTOFS_EXP_LEAVES is cleared before the second call to should_expire() in autofs_expire_indirect() but the parameter passed in the second call is incorrect. Fortunately AUTOFS_EXP_LEAVES expire flag has not been used for a long time but might be needed in the future so fix it rather than remove the expire leaves functionality. Link: http://lkml.kernel.org/r/152937732410.21213.7447294898147765076.stgit@pluto.themaw.net Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2fd9944f0fd41f7bc2f590169a9a758e1186b345 Author: Ian Kent Date: Tue Aug 21 21:58:44 2018 -0700 autofs: fix inconsistent use of now variable The global variable "now" in fs/autofs/expire.c is used in an inconsistent way, sometimes using jiffies directly, and sometimes using the "now" variable, and setting it isn't done consistently either. But the autofs dentry info last_used field is only updated during path walks or during expire so jiffies can be used directly and the global variable "now" removed. Link: http://lkml.kernel.org/r/152937731702.21213.7371321165189170865.stgit@pluto.themaw.net Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d4d79b8195bfc6d5d8f82f9189c1bc828cc7e03a Author: Ian Kent Date: Tue Aug 21 21:58:41 2018 -0700 autofs: fix directory and symlink access Depending on how it is configured the autofs user space daemon can leave in use mounts mounted at exit and re-connect to them at start up. But for this to work best the state of the autofs file system needs to be left intact over the restart. Also, at system shutdown, mounts in an autofs file system might be umounted exposing a mount point trigger for which subsequent access can lead to a hang. So recent versions of automount(8) now does its best to set autofs file system mounts catatonic at shutdown. When autofs file system mounts are catatonic it's currently possible to create and remove directories and symlinks which can be a problem at restart, as described above. So return EACCES in the directory, symlink and unlink methods if the autofs file system is catatonic. Link: http://lkml.kernel.org/r/152902119090.4144.9561910674530214291.stgit@pluto.themaw.net Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3f5c15d8a7d86fb642fe07df58c2065190f3e531 Author: Paul Menzel Date: Tue Aug 21 21:58:37 2018 -0700 init/main.c: log init process file name Add a log message to `run_init_process()`. This log message serves two purposes. 1. If the init process is not specified on the Linux Kernel command line, the user sees, what file was chosen. 2. The time stamps shows exactly, when the Linux kernel handed over control to the init process. Link: http://lkml.kernel.org/r/b1fc97fa-4aa9-1904-ddb5-859e78995c41@molgen.mpg.de Signed-off-by: Paul Menzel Reviewed-by: Andrew Morton Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3903bf940b1faec568a1bff0603f8470bdfc21c1 Author: Randy Dunlap Date: Tue Aug 21 21:58:34 2018 -0700 init/Kconfig: fix its typos Correct typos of "it's" to "its. Link: http://lkml.kernel.org/r/0ac627b6-5527-55f4-0489-1631aa34fc11@infradead.org Signed-off-by: Randy Dunlap Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Masahiro Yamada Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6ad018e3ca9efd80a724e32c02ae7552fd0829f2 Author: Luc Van Oostenryck Date: Tue Aug 21 21:58:30 2018 -0700 init/: remove ineffective sparse disabling Sparse checking used to be disabled on init/do_mounts.c and a few related files because "Many of the syscalls used in this file expect some of the arguments to be __user pointers not __kernel pointers". However since 28128c61e ("kconfig.h: Include compiler types to avoid missed struct attributes") the checks are, in fact, not disabled anymore because of the more early include of "linux/compiler_types.h" So remove the now ineffective #undefery that was done to disable these warnings, as well as the associated comment. Link: http://lkml.kernel.org/r/20180617115355.53799-1-luc.vanoostenryck@gmail.com Signed-off-by: Luc Van Oostenryck Cc: Dominik Brodowski Cc: Al Viro Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 992991c03ca033f779aae1afb5b0c27bcb7139c3 Author: Davidlohr Bueso Date: Tue Aug 21 21:58:26 2018 -0700 fs/eventpoll.c: simplify ep_is_linked() callers Instead of having each caller pass the rdllink explicitly, just have ep_is_linked() pass it while the callers just need the epi pointer. This helper is all about the rdllink, and this change, furthermore, improves the function's self documentation. Link: http://lkml.kernel.org/r/20180727053432.16679-3-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Jason Baron Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 679abf381a18e945457b01921f667cee9e656a7f Author: Davidlohr Bueso Date: Tue Aug 21 21:58:23 2018 -0700 fs/eventpoll.c: loosen irq safety in ep_poll() Similar to other calls, ep_poll() is not called with interrupts disabled, and we can therefore avoid the irq save/restore dance and just disable local irqs. In fact, the call should never be called in irq context at all, considering that the only path is epoll_wait(2) -> do_epoll_wait() -> ep_poll(). When running on a 2 socket 40-core (ht) IvyBridge a common pipe based epoll_wait(2) microbenchmark, the following performance improvements are seen: # threads vanilla dirty 1 1805587 2106412 2 1854064 2090762 4 1805484 2017436 8 1751222 1974475 16 1725299 1962104 32 1378463 1571233 64 787368 900784 Which is a pretty constantly near 15%. Also add a lockdep check such that we detect any mischief before deadlocking. Link: http://lkml.kernel.org/r/20180727053432.16679-2-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Peter Zijlstra Cc: Jason Baron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 514056d506e44084369f5ce1c8186e4253901a05 Author: Davidlohr Bueso Date: Tue Aug 21 21:58:19 2018 -0700 fs/eventpoll.c: simply CONFIG_NET_RX_BUSY_POLL ifdefery ... 'tis easier on the eye. [akpm@linux-foundation.org: use inlines rather than macros] Link: http://lkml.kernel.org/r/20180725185620.11020-1-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Cc: Jason Baron Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 133712a2ec8493596565e9de3d25659d6e66a47e Author: Rob Herring Date: Tue Aug 21 21:58:16 2018 -0700 checkpatch: DT bindings should be a separate patch Devicetree bindings should be their own patch as documented in Documentation/devicetree/bindings/submitting-patches.txt section I.1. This is because bindings are logically independent from a driver implementation, they have a different maintainer (even though they often are applied via the same tree), and it makes for a cleaner history in the DT only tree created with git-filter-branch. [robh@kernel.org: add doc pointer to warning, simplify logic] Link: http://lkml.kernel.org/r/20180810170513.26284-1-robh@kernel.org [robh@kernel.org: v3] Link: http://lkml.kernel.org/r/20180810225049.20452-1-robh@kernel.org Link: http://lkml.kernel.org/r/20180809205032.22205-1-robh@kernel.org Signed-off-by: Rob Herring Acked-by: Joe Perches Cc: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 809e082e973da2c7b751dab9348853cb8cc3f25c Author: Joe Perches Date: Tue Aug 21 21:58:12 2018 -0700 checkpatch: warn on unnecessary int declarations On Sun, 2018-08-05 at 08:52 -0700, Linus Torvalds wrote: > "long unsigned int" isn't _technically_ wrong. But we normally > call that type "unsigned long". So add a checkpatch test for it. Link: http://lkml.kernel.org/r/7bbd97dc0a1e5896a0251fada7bb68bb33643f77.camel@perches.com Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6ad724e2a48fc24dd9788490d85a3490cb0117c1 Author: Michal Zylowski Date: Tue Aug 21 21:58:08 2018 -0700 checkpatch: check for space after "else" keyword Current checkpatch implementation permits notation like } else{ in kernel code. It looks like oversight and inconsistency in checkpatch rules (e.g. instruction like 'do' is tested). Add regex for checking space after 'else' keyword and trigger error if space is not present. Link: http://lkml.kernel.org/r/1533545753-8870-1-git-send-email-michal.zylowski@intel.com Signed-off-by: Michal Zylowski Acked-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 56294112791ac11c6fcdc6544f1381f9272202db Author: Joe Perches Date: Tue Aug 21 21:58:04 2018 -0700 checkpatch: fix SPDX license check with --root= checkpatch uses the in-kernel script spdxcheck.py to validate the specific license in a file or script. This check can currently fail for a couple reasons: o spdxcheck.py assumes the existence of git tree that may not exist for a bare source tree from something like a tarball o the spdxcheck.py must be run from the top level root directory So add a git existence test and set the subprocess subdirectory. Link: http://lkml.kernel.org/r/2b32864324ae9c92948b002ec4c0c22409ed98f1.camel@perches.com Signed-off-by: Joe Perches Reported-by: Charlemagne Lasse Tested-by: Charlemagne Lasse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 490b292c834c5e72057f4315ef915692cbd6defd Author: Joe Perches Date: Tue Aug 21 21:58:01 2018 -0700 checkpatch: warn when a patch doesn't have a description Potential patches should have a commit description. Emit a warning when there isn't one. [akpm@linux-foundation.org: s/else if/elsif/] Link: http://lkml.kernel.org/r/1b099f4d8373aa583a17011992676bf0f3f09eee.camel@perches.com Signed-off-by: Joe Perches Suggested-by: Prakruthi Deepak Heragu Reviewed-by: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 60f890105547f7a48ea1d67c5ae69966c7245b23 Author: Prakruthi Deepak Heragu Date: Tue Aug 21 21:57:57 2018 -0700 checkpatch: check for #if 0/#if 1 The #if 0 or #if 1 is used to toggle features. Warn if #if 0 or #if 1 is present and suggest that they can be removed. [akpm@linux-foundation.org: fix spacing around periods, per Joe\ Link: http://lkml.kernel.org/r/1532625218-24321-1-git-send-email-pheragu@codeaurora.org Signed-off-by: Abhijeet Dharmapurikar Signed-off-by: Prakruthi Deepak Heragu Acked-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cab63cea374c684eb0db352b40a09e3f7c45057 Author: Joe Perches Date: Tue Aug 21 21:57:50 2018 -0700 checkpatch: fix krealloc reuse test The current krealloc test does not function correctly when the temporary pointer return name contains the original pointer name. Fix that by maximally matching the return pointer name and the original pointer name and doing a separate comparison of the both names. Link: http://lkml.kernel.org/r/e617ecb8c019a9c4c56540a1bec16c8aed43a4e4.camel@perches.com Signed-off-by: Joe Perches Reported-by: Lars-Peter Clausen Cc: Manish Narani Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3b6e8ac9e740b71b07df4a1e89ba5841686d8e9f Author: Joe Perches Date: Tue Aug 21 21:57:47 2018 -0700 checkpatch: validate SPDX license with spdxcheck.py Use the existing scripts/spdxcheck.py to validate any SPDX-License-Identifier found in line 1 or 2 of patches or files. Miscellanea: o Properly indent the existing SPDX-License-Identifier block. Link: http://lkml.kernel.org/r/05b832407b24e0a27e419906187cd863bc1617c7.camel@perches.com Signed-off-by: Joe Perches Acked-by: Rob Herring Cc: Thomas Gleixner Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8c8c45cfdd5d8dd555da0d13c1d53b48f99ffe6f Author: Joe Perches Date: Tue Aug 21 21:57:43 2018 -0700 checkpatch: fix macro argument reuse test Multiple line macro definitions where the arguments are separated by line continuations can cause checkpatch to emit invalid syntax regex tests. This can occur when a single argument is modified in a part of a patch. For example: (to not add a diff in the commit message) $ ./scripts/checkpatch.pl --git db023296f0115d2fe01fdabad54678f2b806da23 Unterminated \g... pattern in regex; And, the test does not work correctly when these arguments are all new as the initial patch line addition "+" is used in the argument name. Fix this by stripping the line continuations and any "+" from the list of arguments. Link: http://lkml.kernel.org/r/86cdb43a4db70670c102020093f7fb4eb3003e01.camel@perches.com Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cd2614967d8b636911a39dd639aa5b87cf280945 Author: Geert Uytterhoeven Date: Tue Aug 21 21:57:40 2018 -0700 checkpatch: warn if missing author Signed-off-by Print a warning if none of the Signed-off-by lines cover the patch author. Non-ASCII quoted printable encoding in From: headers and (lack of) double quotes are handled. Split From: headers are not fully handled: only the first part is compared. [geert+renesas@glider.be: only encode UTF-8 quoted printable mail headers] Link: http://lkml.kernel.org/r/20180718145254.4770-1-geert+renesas@glider.be Link: http://lkml.kernel.org/r/20180712100323.26684-1-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Acked-by: Joe Perches Acked-by: Linus Walleij Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 33aa4597dda21348590452656728af2553d2d572 Author: Geert Uytterhoeven Date: Tue Aug 21 21:57:36 2018 -0700 checkpatch: update section keywords As of commit bd721ea73e1f ("treewide: replace obsolete _refok by __ref"), __init_refok no longer exists, so it can be removed. While at it, add the modern variants that were still missing. Link: http://lkml.kernel.org/r/20180706084205.26367-1-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Acked-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b57980de6b228696dfaf70ad50a8550fbb14fc7 Author: Joe Perches Date: Tue Aug 21 21:57:33 2018 -0700 checkpatch: improve runtime execution speed a little checkpatch repeatedly uses a runtime minimum version check that validates the minimum perl version required for a regex match by using a "$^V ge 5.10.0" runtime string match. Only perform that minimum version test once and store the result to reduce string matching time. This reduces runtime execution time for patches or files with high line counts. An example runtime improvement: new: $ time ./scripts/checkpatch.pl -f drivers/net/ethernet/intel/i40e/i40e_main.c > /dev/null real 0m11.856s user 0m11.831s sys 0m0.025s old: $ time ./scripts/checkpatch.pl -f drivers/net/ethernet/intel/i40e/i40e_main.c > /dev/null real 0m13.330s user 0m13.282s sys 0m0.049s Link: http://lkml.kernel.org/r/db21aa9703833bad65ab70cc4e8a78da5b399138.camel@perches.com Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 79682c0c00893c683678d85a402392b75e90311d Author: Joe Perches Date: Tue Aug 21 21:57:29 2018 -0700 checkpatch: add --fix for CONCATENATED_STRING and STRING_FRAGMENTS Add the ability to --fix these string issues. e.g.: printk(KERN_INFO"bar" "baz"QUX); converts to printk(KERN_INFO "barbaz" QUX); Link: http://lkml.kernel.org/r/a9fb505ccfedffc5869d08832a7ff05a21d85621.camel@perches.com Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d729593e492e1e4c7cd8a418ee227d0bd4d5f36d Author: Joe Perches Date: Tue Aug 21 21:57:26 2018 -0700 checkpatch: add a --strict test for structs with bool member definitions A struct with a bool member can have different sizes on various architectures because neither bool size nor alignment is standardized. So emit a message on the use of bool in structs only in .h files and not .c files. There is the real possibility that this test could have a false positive when a bool is declared as an automatic, so limit the test to .h files where the only false positive is for declarations in static inline functions. Link: http://lkml.kernel.org/r/95477c93db187bab6da8a8ba7c57836868446179.camel@perches.com Signed-off-by: Joe Perches Suggested-by: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit de9df3993cfffde468c1c226382f24cec7e9fedc Author: Christophe Leroy Date: Tue Aug 21 21:57:22 2018 -0700 lib/test_hexdump.c: fix failure on big endian cpu On a big endian cpu, test_hexdump fails as follows. The logs show that bytes are expected in reversed order. [...] test_hexdump: Len: 24 buflen: 130 strlen: 97 test_hexdump: Result: 97 'be32db7b 0a1893b2 70bac424 7d83349b a69c31ad 9c0face9 .2.{....p..$}.4...1.....' test_hexdump: Expect: 97 '7bdb32be b293180a 24c4ba70 9b34837d ad319ca6 e9ac0f9c .2.{....p..$}.4...1.....' test_hexdump: Len: 8 buflen: 130 strlen: 77 test_hexdump: Result: 77 'be32db7b0a1893b2 .2.{....' test_hexdump: Expect: 77 'b293180a7bdb32be .2.{....' test_hexdump: Len: 6 buflen: 131 strlen: 87 test_hexdump: Result: 87 'be32 db7b 0a18 .2.{..' test_hexdump: Expect: 87 '32be 7bdb 180a .2.{..' test_hexdump: Len: 24 buflen: 131 strlen: 97 test_hexdump: Result: 97 'be32db7b 0a1893b2 70bac424 7d83349b a69c31ad 9c0face9 .2.{....p..$}.4...1.....' test_hexdump: Expect: 97 '7bdb32be b293180a 24c4ba70 9b34837d ad319ca6 e9ac0f9c .2.{....p..$}.4...1.....' test_hexdump: Len: 32 buflen: 131 strlen: 101 test_hexdump: Result: 101 'be32db7b0a1893b2 70bac4247d83349b a69c31ad9c0face9 4cd1199943b1af0c .2.{....p..$}.4...1.....L...C...' test_hexdump: Expect: 101 'b293180a7bdb32be 9b34837d24c4ba70 e9ac0f9cad319ca6 0cafb1439919d14c .2.{....p..$}.4...1.....L...C...' test_hexdump: failed 801 out of 1184 tests This patch fixes it. Link: http://lkml.kernel.org/r/f3112437f62c2f48300535510918e8be1dceacfb.1533610877.git.christophe.leroy@c-s.fr Fixes: 64d1d77a44697 ("hexdump: introduce test suite") Signed-off-by: Christophe Leroy Reviewed-by: Andy Shevchenko Cc: Michael Ellerman Cc: rashmica Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fd7338ef624fab2efbeb011c3e790693b4199c8e Author: Andy Shevchenko Date: Tue Aug 21 21:57:18 2018 -0700 lib/Kconfig: remove 'default n' for tests It seems contributors follow the style of Kconfig entries where explicit 'default n' is present. The default 'default' is 'n' already, thus, drop these lines from Kconfig to make it more clear. Link: http://lkml.kernel.org/r/20180719085131.79541-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Coly Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d23599630b0fdecf3b676140a97619def16f2060 Author: Coly Li Date: Tue Aug 21 21:57:15 2018 -0700 bcache: use routines from lib/crc64.c for CRC64 calculation Now we have crc64 calculation in lib/crc64.c, it is unnecessary for bcache to use its own version. This patch changes bcache code to use crc64 routines in lib/crc64.c. Link: http://lkml.kernel.org/r/20180718165545.1622-3-colyli@suse.de Signed-off-by: Coly Li Reviewed-by: Hannes Reinecke Reviewed-by: Andy Shevchenko Cc: Michael Lyle Cc: Kent Overstreet Cc: Thomas Gleixner Cc: Kate Stewart Cc: Randy Dunlap Cc: Eric Biggers Cc: Greg Kroah-Hartman Cc: Noah Massey Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit feba04fd2cf8f6a74865338df2e3e1e94d6cfd13 Author: Coly Li Date: Tue Aug 21 21:57:11 2018 -0700 lib: add crc64 calculation routines Patch series "add crc64 calculation as kernel library", v5. This patchset adds basic implementation of crc64 calculation as a Linux kernel library. Since bcache already does crc64 by itself, this patchset also modifies bcache code to use the new crc64 library routine. Currently bcache is the only user of crc64 calculation, another potential user is bcachefs which is on the way to be in mainline kernel. Therefore it makes sense to make crc64 calculation to be a public library. bcache uses crc64 as storage checksum, if a change of crc lib routines results an inconsistent result, the unmatched checksum may make bcache 'think' the on-disk is corrupted, such a change should be avoided or detected as early as possible. Therefore a patch is being prepared which adds a crc test framework, to check consistency of different calculations. This patch (of 2): Add the re-write crc64 calculation routines for Linux kernel. The CRC64 polynomical arithmetic follows ECMA-182 specification, inspired by CRC paper of Dr. Ross N. Williams (see http://www.ross.net/crc/download/crc_v3.txt) and other public domain implementations. All the changes work in this way, - When Linux kernel is built, host program lib/gen_crc64table.c will be compiled to lib/gen_crc64table and executed. - The output of gen_crc64table execution is an array called as lookup table (a.k.a POLY 0x42f0e1eba9ea369) which contain 256 64-bit long numbers, this table is dumped into header file lib/crc64table.h. - Then the header file is included by lib/crc64.c for normal 64bit crc calculation. - Function declaration of the crc64 calculation routines is placed in include/linux/crc64.h Currently bcache is the only user of crc64_be(), another potential user is bcachefs which is on the way to be in mainline kernel. Therefore it makes sense to move crc64 calculation into lib/crc64.c as public code. [colyli@suse.de: fix review comments from v4] Link: http://lkml.kernel.org/r/20180726053352.2781-2-colyli@suse.de Link: http://lkml.kernel.org/r/20180718165545.1622-2-colyli@suse.de Signed-off-by: Coly Li Co-developed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko Reviewed-by: Hannes Reinecke Cc: Greg Kroah-Hartman Cc: Andy Shevchenko Cc: Michael Lyle Cc: Kent Overstreet Cc: Thomas Gleixner Cc: Kate Stewart Cc: Eric Biggers Cc: Randy Dunlap Cc: Noah Massey Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b15f5f1ae18a70f2db0ec4b4e5fa525420a67270 Author: Colin Ian King Date: Tue Aug 21 21:57:07 2018 -0700 lib/test_debug_virtual.c: make struct pointer foo static The pointer foo is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'foo' was not declared. Should it be static? Link: http://lkml.kernel.org/r/20180624112206.5722-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9144d75e22cad3c89e6b2ccab551db9ee28d250a Author: Chris Wilson Date: Tue Aug 21 21:57:03 2018 -0700 include/linux/bitops.h: introduce BITS_PER_TYPE net_dim.h has a rather useful extension to BITS_PER_BYTE to compute the number of bits in a type (BITS_PER_BYTE * sizeof(T)), so promote the macro to bitops.h, alongside BITS_PER_BYTE, for wider usage. Link: http://lkml.kernel.org/r/20180706094458.14116-1-chris@chris-wilson.co.uk Signed-off-by: Chris Wilson Reviewed-by: Jani Nikula Cc: Randy Dunlap Cc: Andy Gospodarek Cc: David S. Miller Cc: Thomas Gleixner Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ccf7a6d457a8bd618c77468c38842b3f9d82cef4 Author: Andy Shevchenko Date: Tue Aug 21 21:56:59 2018 -0700 lib/bitmap.c: drop unnecessary 0 check for u32 array operations nbits == 0 is safe to be supplied to the function body, so remove unnecessary checks in bitmap_to_arr32() and bitmap_from_arr32(). Link: http://lkml.kernel.org/r/20180531131914.44352-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Yury Norov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0fbd75fd7feedd9e38fc1d3a01317aa23b83d29e Author: Joe Perches Date: Tue Aug 21 21:56:55 2018 -0700 get_maintainer: allow option --mpath to read all files in There is an external use case for multiple private MAINTAINER style files in a separate directory. Allow it. --mpath has a default of "./MAINTAINERS". The value entered can be either a file or a directory. The behaviors are now: --mpath Read only the specific file as file --mpath Read all files in as files --mpath --find-maintainer-files Recurse through and read all files named MAINTAINERS Link: http://lkml.kernel.org/r/991b2f20112d53863cd79e61d908f1d26d3e1971.camel@perches.com Signed-off-by: Joe Perches Tested-by: Don Zickus Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5f0baf95b1edfff5eb9b6f571febb859b047de97 Author: Joe Perches Date: Tue Aug 21 21:56:52 2018 -0700 get_maintainer.pl: add -mpath= for MAINTAINERS file location Add the ability to have an override for the location of the MAINTAINERS file. Miscellanea: o Properly indent a few lines with leading spaces Link: http://lkml.kernel.org/r/a86e69195076ed3c4c526fddc76b86c28e0a1e37.camel@perches.com Signed-off-by: Joe Perches Suggested-by: Don Zickus Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 31bb82c9caa9bd8fa8865fa28a7a81f67ddc0539 Author: Antonio Nino Diaz Date: Tue Aug 21 21:56:48 2018 -0700 get_maintainer: allow usage outside of kernel tree Add option '--no-tree' to get_maintainer.pl script to allow using this script in projects that aren't the Linux kernel if they use the same format for their MAINTAINERS file. This command is also available in checkpatch.pl, for example. Link: http://lkml.kernel.org/r/04452ac6-1575-f612-72c6-6ea88e70a9d5@arm.com Signed-off-by: Antonio Nino Diaz Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 92e641784055998879942d39c74d4f84fa750968 Author: Davidlohr Bueso Date: Tue Aug 21 21:56:45 2018 -0700 s/epoll: robustify irq safety with lockdep_assert_irqs_enabled() Sprinkle lockdep_assert_irqs_enabled() checks in the functions that do not save and restore interrupts when dealing with the ep->wq.lock. These are ep_scan_ready_list() and those called by epoll_ctl(): ep_insert, ep_modify and ep_remove. [akpm@linux-foundation.org: remove too-obvious comments] Link: http://lkml.kernel.org/r/20180721183127.3busfa335zlcjeox@linux-r8p5 Signed-off-by: Davidlohr Bueso Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 304b18b8d6af796c8ece221d34c92aeb1559789b Author: Davidlohr Bueso Date: Tue Aug 21 21:56:41 2018 -0700 fs/epoll: loosen irq safety in epoll_insert() and epoll_remove() Both functions are similar to the context of ep_modify(), called via epoll_ctl(2). Just like ep_modify(), saving and restoring interrupts is an overkill in these calls as it will never be called with irqs disabled. While ep_remove() can be called directly from EPOLL_CTL_DEL, it can also be called when releasing the file, but this also complies with the above. Link: http://lkml.kernel.org/r/20180720172956.2883-3-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Cc: Jason Baron Cc: Al Viro Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 002b343669c474151954266e7fcf727bf7faa851 Author: Davidlohr Bueso Date: Tue Aug 21 21:56:38 2018 -0700 fs/epoll: loosen irq safety in ep_scan_ready_list() Patch series "fs/epoll: loosen irq safety when possible". Both patches replace saving+restoring interrupts when taking the ep->lock (now the waitqueue lock), with just disabling local irqs. This shows immediate performance benefits in patch 1 for an epoll workload running on Xen. The main concern we need to have with this sort of changes in epoll is the ep_poll_callback() which is passed to the wait queue wakeup and is done very often under irq context, this patch does not touch this call. Patches have been tested pretty heavily with the customer workload, microbenchmarks, ltp testcases and two high level workloads that use epoll under the hood: nginx and libevent benchmarks. This patch (of 2): Saving and restoring interrupts in ep_scan_ready_list() is an overkill as it is never called with interrupts disabled. Loosen this to simply disabling local irqs such that archs where managing irqs is expensive or virtual environments. This patch yields some throughput improvements on a workload that is epoll intensive running on a single Xen DomU. 1 Job 7500 --> 8800 enq/s (+17%) 2 Jobs 14000 --> 15200 enq/s (+8%) 3 Jobs 20500 --> 22300 enq/s (+8%) 4 Jobs 25000 --> 28000 enq/s (+8-12)% On bare metal: For a 2-socket 40-core (ht) IvyBridge on a few workloads, unfortunately I don't have a xen environment and the results for Xen I do have (which numbers are in patch 1) I don't have the actual workload, so cannot compare them directly. 1) Different configurations were used for a epoll_wait (pipes io) microbench (http://linux-scalability.org/epoll/epoll-test.c) and shows around a 7-10% improvement in overall total number of times the epoll_wait() loops when using both regular and nested epolls, so very raw numbers, but measurable nonetheless. # threads vanilla dirty 1 1677717 1805587 2 1660510 1854064 4 1610184 1805484 8 1577696 1751222 16 1568837 1725299 32 1291532 1378463 64 752584 787368 Note that stddev is pretty small. 2) Another pipe test, which shows no real measurable improvement. (http://www.xmailserver.org/linux-patches/pipetest.c) Link: http://lkml.kernel.org/r/20180720172956.2883-2-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Cc: Jason Baron Cc: Al Viro Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e05a8e4d88d16e088d83ce679ac3343ac66c936b Author: Christoph Hellwig Date: Tue Aug 21 21:56:34 2018 -0700 sched/wait: assert the wait_queue_head lock is held in __wake_up_common Better ensure we actually hold the lock using lockdep than just commenting on it. Due to the various exported _locked interfaces it is far too easy to get the locking wrong. Link: http://lkml.kernel.org/r/20171214152344.6880-4-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Ingo Molnar Cc: Al Viro Cc: Andrea Arcangeli Cc: Ingo Molnar Cc: Jason Baron Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Davidlohr Bueso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c430d1e848ff1240d126e79780f3c26208b8aed9 Author: Matthew Wilcox Date: Tue Aug 21 21:56:30 2018 -0700 userfaultfd: use fault_wqh lock The userfaultfd code currently uses the unlocked waitqueue helpers for managing fault_wqh, but instead of holding the waitqueue lock for this waitqueue around these calls, it the waitqueue lock of fault_pending_wq, which is a different waitqueue instance. Given that the waitqueue is not exposed to the rest of the kernel this actually works ok at the moment, but prevents the userfaultfd locking rules from being enforced using lockdep. Switch to the internally locked waitqueue helpers instead. This means that the lock inside fault_wqh now nests inside the fault_pending_wqh lock, but that's not a problem since it was entirely unused before. [hch@lst.de: slight changelog updates] [rppt@linux.vnet.ibm.com: spotted changelog spellos] Link: http://lkml.kernel.org/r/20171214152344.6880-3-hch@lst.de Signed-off-by: Matthew Wilcox Signed-off-by: Christoph Hellwig Reviewed-by: Mike Rapoport Cc: Al Viro Cc: Andrea Arcangeli Cc: Ingo Molnar Cc: Jason Baron Cc: Peter Zijlstra Cc: Davidlohr Bueso Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ee8ef0a4b167c1f2605bc9b5701c603224673d53 Author: Christoph Hellwig Date: Tue Aug 21 21:56:26 2018 -0700 epoll: use the waitqueue lock to protect ep->wq Patch series "waitqueue lockdep annotation", v3. This series adds a strategic lockdep_assert_held to __wake_up_common to ensure callers really do hold the wait_queue_head lock when calling the unlocked wake_up variants. It turns out epoll did not do this for a fairly common path (hit all the time by systemd during bootup), so the second patch fixed this instance as well. This patch (of 3): The epoll code currently uses the unlocked waitqueue helpers for managing ep->wq, but instead of holding the waitqueue lock around these calls, it uses its own ep->lock spinlock. Given that the waitqueue is not exposed to the rest of the kernel this actually works ok at the moment, but prevents the epoll locking rules from being enforced using lockdep. Remove ep->lock and use the waitqueue lock to not only reduce the size of struct eventpoll but also to make sure we can assert locking invariants in the waitqueue code. Link: http://lkml.kernel.org/r/20171214152344.6880-2-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Jason Baron Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Al Viro Cc: Andrea Arcangeli Cc: Mike Rapoport Cc: Jason Baron Cc: Ingo Molnar Cc: Matthew Wilcox Cc: Davidlohr Bueso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 46e0c9be206fa7b11aca75da2d6b8535d0139752 Author: Ard Biesheuvel Date: Tue Aug 21 21:56:22 2018 -0700 kernel: tracepoints: add support for relative references To avoid the need for relocating absolute references to tracepoint structures at boot time when running relocatable kernels (which may take a disproportionate amount of space), add the option to emit these tables as relative references instead. Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheuvel@linaro.org Acked-by: Michael Ellerman Acked-by: Ingo Molnar Acked-by: Steven Rostedt (VMware) Signed-off-by: Ard Biesheuvel Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Bjorn Helgaas Cc: Catalin Marinas Cc: James Morris Cc: James Morris Cc: Jessica Yu Cc: Josh Poimboeuf Cc: Kees Cook Cc: Nicolas Pitre Cc: Paul Mackerras Cc: Petr Mladek Cc: Russell King Cc: "Serge E. Hallyn" Cc: Sergey Senozhatsky Cc: Thomas Garnier Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c9d8b55fa0191623fccb9ed67d2ff8f9159e9a89 Author: Ard Biesheuvel Date: Tue Aug 21 21:56:18 2018 -0700 PCI: Add support for relative addressing in quirk tables Allow the PCI quirk tables to be emitted in a way that avoids absolute references to the hook functions. This reduces the size of the entries, and, more importantly, makes them invariant under runtime relocation (e.g., for KASLR) Link: http://lkml.kernel.org/r/20180704083651.24360-6-ard.biesheuvel@linaro.org Acked-by: Bjorn Helgaas Acked-by: Michael Ellerman Acked-by: Ingo Molnar Signed-off-by: Ard Biesheuvel Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: James Morris Cc: James Morris Cc: Jessica Yu Cc: Josh Poimboeuf Cc: Kees Cook Cc: Nicolas Pitre Cc: Paul Mackerras Cc: Petr Mladek Cc: Russell King Cc: "Serge E. Hallyn" Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Thomas Garnier Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1b1eeca7e4c19fa76d409d4c7b338dba21f2df45 Author: Ard Biesheuvel Date: Tue Aug 21 21:56:13 2018 -0700 init: allow initcall tables to be emitted using relative references Allow the initcall tables to be emitted using relative references that are only half the size on 64-bit architectures and don't require fixups at runtime on relocatable kernels. Link: http://lkml.kernel.org/r/20180704083651.24360-5-ard.biesheuvel@linaro.org Acked-by: James Morris Acked-by: Sergey Senozhatsky Acked-by: Petr Mladek Acked-by: Michael Ellerman Acked-by: Ingo Molnar Signed-off-by: Ard Biesheuvel Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Bjorn Helgaas Cc: Catalin Marinas Cc: James Morris Cc: Jessica Yu Cc: Josh Poimboeuf Cc: Kees Cook Cc: Nicolas Pitre Cc: Paul Mackerras Cc: Russell King Cc: "Serge E. Hallyn" Cc: Steven Rostedt Cc: Thomas Garnier Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7290d58095712a89f845e1bca05334796dd49ed2 Author: Ard Biesheuvel Date: Tue Aug 21 21:56:09 2018 -0700 module: use relative references for __ksymtab entries An ordinary arm64 defconfig build has ~64 KB worth of __ksymtab entries, each consisting of two 64-bit fields containing absolute references, to the symbol itself and to a char array containing its name, respectively. When we build the same configuration with KASLR enabled, we end up with an additional ~192 KB of relocations in the .init section, i.e., one 24 byte entry for each absolute reference, which all need to be processed at boot time. Given how the struct kernel_symbol that describes each entry is completely local to module.c (except for the references emitted by EXPORT_SYMBOL() itself), we can easily modify it to contain two 32-bit relative references instead. This reduces the size of the __ksymtab section by 50% for all 64-bit architectures, and gets rid of the runtime relocations entirely for architectures implementing KASLR, either via standard PIE linking (arm64) or using custom host tools (x86). Note that the binary search involving __ksymtab contents relies on each section being sorted by symbol name. This is implemented based on the input section names, not the names in the ksymtab entries, so this patch does not interfere with that. Given that the use of place-relative relocations requires support both in the toolchain and in the module loader, we cannot enable this feature for all architectures. So make it dependent on whether CONFIG_HAVE_ARCH_PREL32_RELOCATIONS is defined. Link: http://lkml.kernel.org/r/20180704083651.24360-4-ard.biesheuvel@linaro.org Signed-off-by: Ard Biesheuvel Acked-by: Jessica Yu Acked-by: Michael Ellerman Reviewed-by: Will Deacon Acked-by: Ingo Molnar Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Bjorn Helgaas Cc: Catalin Marinas Cc: James Morris Cc: James Morris Cc: Josh Poimboeuf Cc: Kees Cook Cc: Nicolas Pitre Cc: Paul Mackerras Cc: Petr Mladek Cc: Russell King Cc: "Serge E. Hallyn" Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Thomas Garnier Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f922c4abdf7648523589abee9460c87f51630d2f Author: Ard Biesheuvel Date: Tue Aug 21 21:56:04 2018 -0700 module: allow symbol exports to be disabled To allow existing C code to be incorporated into the decompressor or the UEFI stub, introduce a CPP macro that turns all EXPORT_SYMBOL_xxx declarations into nops, and #define it in places where such exports are undesirable. Note that this gets rid of a rather dodgy redefine of linux/export.h's header guard. Link: http://lkml.kernel.org/r/20180704083651.24360-3-ard.biesheuvel@linaro.org Signed-off-by: Ard Biesheuvel Acked-by: Nicolas Pitre Acked-by: Michael Ellerman Reviewed-by: Will Deacon Acked-by: Ingo Molnar Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Bjorn Helgaas Cc: Catalin Marinas Cc: James Morris Cc: James Morris Cc: Jessica Yu Cc: Josh Poimboeuf Cc: Kees Cook Cc: Paul Mackerras Cc: Petr Mladek Cc: Russell King Cc: "Serge E. Hallyn" Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Thomas Garnier Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 271ca788774aaef9ca4c372573122cc4548cd401 Author: Ard Biesheuvel Date: Tue Aug 21 21:56:00 2018 -0700 arch: enable relative relocations for arm64, power and x86 Patch series "add support for relative references in special sections", v10. This adds support for emitting special sections such as initcall arrays, PCI fixups and tracepoints as relative references rather than absolute references. This reduces the size by 50% on 64-bit architectures, but more importantly, it removes the need for carrying relocation metadata for these sections in relocatable kernels (e.g., for KASLR) that needs to be fixed up at boot time. On arm64, this reduces the vmlinux footprint of such a reference by 8x (8 byte absolute reference + 24 byte RELA entry vs 4 byte relative reference) Patch #3 was sent out before as a single patch. This series supersedes the previous submission. This version makes relative ksymtab entries dependent on the new Kconfig symbol HAVE_ARCH_PREL32_RELOCATIONS rather than trying to infer from kbuild test robot replies for which architectures it should be blacklisted. Patch #1 introduces the new Kconfig symbol HAVE_ARCH_PREL32_RELOCATIONS, and sets it for the main architectures that are expected to benefit the most from this feature, i.e., 64-bit architectures or ones that use runtime relocations. Patch #2 add support for #define'ing __DISABLE_EXPORTS to get rid of ksymtab/kcrctab sections in decompressor and EFI stub objects when rebuilding existing C files to run in a different context. Patches #4 - #6 implement relative references for initcalls, PCI fixups and tracepoints, respectively, all of which produce sections with order ~1000 entries on an arm64 defconfig kernel with tracing enabled. This means we save about 28 KB of vmlinux space for each of these patches. [From the v7 series blurb, which included the jump_label patches as well]: For the arm64 kernel, all patches combined reduce the memory footprint of vmlinux by about 1.3 MB (using a config copied from Ubuntu that has KASLR enabled), of which ~1 MB is the size reduction of the RELA section in .init, and the remaining 300 KB is reduction of .text/.data. This patch (of 6): Before updating certain subsystems to use place relative 32-bit relocations in special sections, to save space and reduce the number of absolute relocations that need to be processed at runtime by relocatable kernels, introduce the Kconfig symbol and define it for some architectures that should be able to support and benefit from it. Link: http://lkml.kernel.org/r/20180704083651.24360-2-ard.biesheuvel@linaro.org Signed-off-by: Ard Biesheuvel Acked-by: Michael Ellerman Reviewed-by: Will Deacon Acked-by: Ingo Molnar Cc: Arnd Bergmann Cc: Kees Cook Cc: Thomas Garnier Cc: Thomas Gleixner Cc: "Serge E. Hallyn" Cc: Bjorn Helgaas Cc: Benjamin Herrenschmidt Cc: Russell King Cc: Paul Mackerras Cc: Catalin Marinas Cc: Petr Mladek Cc: James Morris Cc: Nicolas Pitre Cc: Josh Poimboeuf Cc: Steven Rostedt Cc: Sergey Senozhatsky , Cc: James Morris Cc: Jessica Yu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bc63804619465ad98af6d9086dab601a653066fb Author: Colin Ian King Date: Tue Aug 21 21:55:56 2018 -0700 spelling.txt: add more spellings to spelling.txt Here are some of the more common spelling mistakes and typos that I've found while fixing up spelling mistakes in the kernel over the past 6 months. Link: http://lkml.kernel.org/r/20180629150603.1159-1-colin.king@canonical.com Signed-off-by: Colin Ian King Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a2e514453861dd39b53b7a50b6771bd3f9852078 Author: Dmitry Vyukov Date: Tue Aug 21 21:55:52 2018 -0700 kernel/hung_task.c: allow to set checking interval separately from timeout Currently task hung checking interval is equal to timeout, as the result hung is detected anywhere between timeout and 2*timeout. This is fine for most interactive environments, but this hurts automated testing setups (syzbot). In an automated setup we need to strictly order CPU lockup < RCU stall < workqueue lockup < task hung < silent loss, so that RCU stall is not detected as task hung and task hung is not detected as silent machine loss. The large variance in task hung detection timeout requires setting silent machine loss timeout to a very large value (e.g. if task hung is 3 mins, then silent loss need to be set to ~7 mins). The additional 3 minutes significantly reduce testing efficiency because usually we crash kernel within a minute, and this can add hours to bug localization process as it needs to do dozens of tests. Allow setting checking interval separately from timeout. This allows to set timeout to, say, 3 minutes, but checking interval to 10 secs. The interval is controlled via a new hung_task_check_interval_secs sysctl, similar to the existing hung_task_timeout_secs sysctl. The default value of 0 results in the current behavior: checking interval is equal to timeout. [akpm@linux-foundation.org: update hung_task_timeout_max's comment] Link: http://lkml.kernel.org/r/20180611111004.203513-1-dvyukov@google.com Signed-off-by: Dmitry Vyukov Cc: Paul E. McKenney Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 91bc9aaf746ae41016bd6b61a48133e162542574 Author: Arnd Bergmann Date: Tue Aug 21 21:55:49 2018 -0700 kernel/crash_core.c: print timestamp using time64_t The get_seconds() call returns a 32-bit timestamp on some architectures, and will overflow in the future. The newer ktime_get_real_seconds() always returns a 64-bit timestamp that does not suffer from this problem. Link: http://lkml.kernel.org/r/20180618150329.941903-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Reviewed-by: Andrew Morton Cc: Dave Young Cc: Baoquan He Cc: "Kirill A. Shutemov" Cc: Petr Tesarik Cc: Marc-Andr Lureau Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 203583990cb675aeddff6d7623f68268068c078c Author: Rasmus Villemoes Date: Tue Aug 21 21:55:45 2018 -0700 linux/compiler.h: don't use bool Appararently, it's possible to have a non-trivial TU include a few headers, including linux/build_bug.h, without ending up with linux/types.h. So the 0day bot sent me config: um-x86_64_defconfig (attached as .config) >> include/linux/compiler.h:316:3: error: unknown type name 'bool'; did you mean '_Bool'? bool __cond = !(condition); \ for something I'm working on. Rather than contributing to the #include madness and including linux/types.h from compiler.h, just use int. Link: http://lkml.kernel.org/r/20180817101036.20969-1-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Cc: Christopher Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ce0a568d327968367f294ea2425fe2c6f4f33ed2 Author: Anna-Maria Gleixner Date: Tue Aug 21 21:55:42 2018 -0700 userns: use irqsave variant of refcount_dec_and_lock() The irqsave variant of refcount_dec_and_lock handles irqsave/restore when taking/releasing the spin lock. With this variant the call of local_irq_save/restore is no longer required. [bigeasy@linutronix.de: s@atomic_dec_and_lock@refcount_dec_and_lock@g] Link: http://lkml.kernel.org/r/20180703200141.28415-7-bigeasy@linutronix.de Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior Acked-by: Peter Zijlstra (Intel) Cc: "Eric W. Biederman" Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fc37191272a972d449bab3d8247cf52cadf5d4e6 Author: Sebastian Andrzej Siewior Date: Tue Aug 21 21:55:38 2018 -0700 userns: use refcount_t for reference counting instead atomic_t refcount_t type and corresponding API should be used instead of atomic_t wh en the variable is used as a reference counter. This avoids accidental refcounter overflows that might lead to use-after-free situations. Link: http://lkml.kernel.org/r/20180703200141.28415-6-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Suggested-by: Peter Zijlstra Acked-by: Peter Zijlstra (Intel) Reviewed-by: Andrew Morton Cc: "Eric W. Biederman" Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 060288a7320b2837a8ff2af1b3643bdbd5e568f6 Author: Anna-Maria Gleixner Date: Tue Aug 21 21:55:35 2018 -0700 bdi: use irqsave variant of refcount_dec_and_lock() The irqsave variant of refcount_dec_and_lock handles irqsave/restore when taking/releasing the spin lock. With this variant the call of local_irq_save/restore is no longer required. [bigeasy@linutronix.de: s@atomic_dec_and_lock@refcount_dec_and_lock@g] Link: http://lkml.kernel.org/r/20180703200141.28415-5-bigeasy@linutronix.de Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior Acked-by: Peter Zijlstra (Intel) Cc: Jens Axboe Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e58dd0de5eadf145895b13451a1fef8ef03946eb Author: Sebastian Andrzej Siewior Date: Tue Aug 21 21:55:31 2018 -0700 bdi: use refcount_t for reference counting instead atomic_t refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This permits avoiding accidental refcounter overflows that might lead to use-after-free situations. Link: http://lkml.kernel.org/r/20180703200141.28415-4-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Andrew Morton Acked-by: Peter Zijlstra (Intel) Suggested-by: Peter Zijlstra Cc: Jens Axboe Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cedc5b6aab493f6b1b1d381dccc0cc082da7d3d8 Author: Kees Cook Date: Tue Aug 21 21:55:28 2018 -0700 kernel.h: documentation for roundup() vs round_up() Things like 3619dec5103d ("dh key: fix rounding up KDF output length") expose the lack of explicit documentation for roundup() vs round_up(). At least we can try to document it better if anyone goes looking. Link: http://lkml.kernel.org/r/20180703041950.GA43464@beast Signed-off-by: Kees Cook Cc: Ingo Molnar Cc: Greg Kroah-Hartman Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 96c6a32ccb55a366054fd82cc63523bb7f7493d3 Author: Dmitry Vyukov Date: Tue Aug 21 21:55:24 2018 -0700 include/asm-generic/bug.h: clarify valid uses of WARN() Explicitly state that WARN*() should be used only for recoverable kernel issues/bugs and that it should not be used for any kind of invalid external inputs or transient conditions. Motivation: it's a very useful capability to be able to understand if a particular kernel splat means a kernel bug or simply an invalid user-space program. For the former one wants to notify kernel developers, while notifying kernel developers for the latter is annoying. Even a kernel developer may not know what to do with a WARNING in an unfamiliar subsystem. This is especially critical for any automated testing systems that may use panic_on_warn and mail kernel developers. The clear separation also serves as an additional documentation: is it a condition that must never occur because of additional checks/logic elsewhere? or is it simply a check for invalid inputs or unfortunate conditions? Use of pr_err() for user messages also leads to better error messages. "Something is wrong in file foo on line X" is not particularly useful message for end user. pr_err() forces developers to write more meaningful error messages for user. As of now we are almost there. We are doing systematic kernel testing with panic_on_warn and are not seeing massive amounts of false positives. But every now and then another WARN on ENOMEM or invalid inputs pops up and leads to a lengthy argument each time. The goal of this change is to officially document the rules. Link: http://lkml.kernel.org/r/20180620103716.61636-1-dvyukov@gmail.com Signed-off-by: Dmitry Vyukov Acked-by: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 23c85094fe1895caefdd19ef624ee687ec5f4507 Author: Omar Sandoval Date: Tue Aug 21 21:55:20 2018 -0700 proc/kcore: add vmcoreinfo note to /proc/kcore The vmcoreinfo information is useful for runtime debugging tools, not just for crash dumps. A lot of this information can be determined by other means, but this is much more convenient, and it only adds a page at most to the file. Link: http://lkml.kernel.org/r/fddbcd08eed76344863303878b12de1c1e2a04b6.1531953780.git.osandov@fb.com Signed-off-by: Omar Sandoval Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit eff4345e7fba0aac8665f00e8599b36946d9aaec Author: Omar Sandoval Date: Tue Aug 21 21:55:17 2018 -0700 crash_core: use VMCOREINFO_SYMBOL_ARRAY() for swapper_pg_dir This is preparation for allowing CRASH_CORE to be enabled for any architecture. swapper_pg_dir is always either an array or a macro expanding to NULL. In the latter case, VMCOREINFO_SYMBOL() won't work, as it tries to take the address of the given symbol: #define VMCOREINFO_SYMBOL(name) \ vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) Instead, use VMCOREINFO_SYMBOL_ARRAY(), which uses the value: #define VMCOREINFO_SYMBOL_ARRAY(name) \ vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)name) This is the same thing for the array case but isn't an error for the macro case. Link: http://lkml.kernel.org/r/c05f9781ec204f40fc96f95086e7b6de6a3eb2c3.1532563124.git.osandov@fb.com Signed-off-by: Omar Sandoval Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bf991c2231117d50a7645792b514354fc8d19dae Author: Omar Sandoval Date: Tue Aug 21 21:55:13 2018 -0700 proc/kcore: optimize multiple page reads The current code does a full search of the segment list every time for every page. This is wasteful, since it's almost certain that the next page will be in the same segment. Instead, check if the previous segment covers the current page before doing the list search. Link: http://lkml.kernel.org/r/fd346c11090cf93d867e01b8d73a6567c5ac6361.1531953780.git.osandov@fb.com Signed-off-by: Omar Sandoval Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 37e949bd5293ddb70acf236eedf2ae8caa1db57b Author: Omar Sandoval Date: Tue Aug 21 21:55:09 2018 -0700 proc/kcore: clean up ELF header generation Currently, the ELF file header, program headers, and note segment are allocated all at once, in some icky code dating back to 2.3. Programs tend to read the file header, then the program headers, then the note segment, all separately, so this is a waste of effort. It's cleaner and more efficient to handle the three separately. Link: http://lkml.kernel.org/r/19c92cbad0e11f6103ff3274b2e7a7e51a1eb74b.1531953780.git.osandov@fb.com Signed-off-by: Omar Sandoval Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3673fb08db73347332ab956d90090c1da6e610b7 Author: Omar Sandoval Date: Tue Aug 21 21:55:06 2018 -0700 proc/kcore: hold lock during read Now that we're using an rwsem, we can hold it during the entirety of read_kcore() and have a common return path. This is preparation for the next change. [akpm@linux-foundation.org: fix locking bug reported by Tetsuo Handa] Link: http://lkml.kernel.org/r/d7cfbc1e8a76616f3b699eaff9df0a2730380534.1531953780.git.osandov@fb.com Signed-off-by: Omar Sandoval Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Cc: Tetsuo Handa Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b66fb005c97544e9e589b2f2e60ccfe3808c6c3e Author: Omar Sandoval Date: Tue Aug 21 21:55:02 2018 -0700 proc/kcore: fix memory hotplug vs multiple opens race There's a theoretical race condition that will cause /proc/kcore to miss a memory hotplug event: CPU0 CPU1 // hotplug event 1 kcore_need_update = 1 open_kcore() open_kcore() kcore_update_ram() kcore_update_ram() // Walk RAM // Walk RAM __kcore_update_ram() __kcore_update_ram() kcore_need_update = 0 // hotplug event 2 kcore_need_update = 1 kcore_need_update = 0 Note that CPU1 set up the RAM kcore entries with the state after hotplug event 1 but cleared the flag for hotplug event 2. The RAM entries will therefore be stale until there is another hotplug event. This is an extremely unlikely sequence of events, but the fix makes the synchronization saner, anyways: we serialize the entire update sequence, which means that whoever clears the flag will always succeed in replacing the kcore list. Link: http://lkml.kernel.org/r/6106c509998779730c12400c1b996425df7d7089.1531953780.git.osandov@fb.com Signed-off-by: Omar Sandoval Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0b172f845ff963ab15e2d861dc155e2ab13241e9 Author: Omar Sandoval Date: Tue Aug 21 21:54:59 2018 -0700 proc/kcore: replace kclist_lock rwlock with rwsem Now we only need kclist_lock from user context and at fs init time, and the following changes need to sleep while holding the kclist_lock. Link: http://lkml.kernel.org/r/521ba449ebe921d905177410fee9222d07882f0d.1531953780.git.osandov@fb.com Signed-off-by: Omar Sandoval Reviewed-by: Andrew Morton Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bf53183164dbba00b342df7d2215b33007ed83ed Author: Omar Sandoval Date: Tue Aug 21 21:54:55 2018 -0700 proc/kcore: don't grab lock for memory hotplug notifier The memory hotplug notifier kcore_callback() only needs kclist_lock to prevent races with __kcore_update_ram(), but we can easily eliminate that race by using an atomic xchg() in __kcore_update_ram(). This is preparation for converting kclist_lock to an rwsem. Link: http://lkml.kernel.org/r/0a4bc89f4dbde8b5b2ea309f7b4fb6a85fe29df2.1531953780.git.osandov@fb.com Signed-off-by: Omar Sandoval Reviewed-by: Andrew Morton Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a8dd9c4df18edc873d244790d163564a5d17626b Author: Omar Sandoval Date: Tue Aug 21 21:54:51 2018 -0700 proc/kcore: don't grab lock for kclist_add() Patch series "/proc/kcore improvements", v4. This series makes a few improvements to /proc/kcore. It fixes a couple of small issues in v3 but is otherwise the same. Patches 1, 2, and 3 are prep patches. Patch 4 is a fix/cleanup. Patch 5 is another prep patch. Patches 6 and 7 are optimizations to ->read(). Patch 8 makes it possible to enable CRASH_CORE on any architecture, which is needed for patch 9. Patch 9 adds vmcoreinfo to /proc/kcore. This patch (of 9): kclist_add() is only called at init time, so there's no point in grabbing any locks. We're also going to replace the rwlock with a rwsem, which we don't want to try grabbing during early boot. While we're here, mark kclist_add() with __init so that we'll get a warning if it's called from non-init code. Link: http://lkml.kernel.org/r/98208db1faf167aa8b08eebfa968d95c70527739.1531953780.git.osandov@fb.com Signed-off-by: Omar Sandoval Reviewed-by: Andrew Morton Reviewed-by: Bhupesh Sharma Tested-by: Bhupesh Sharma Cc: Alexey Dobriyan Cc: Bhupesh Sharma Cc: Eric Biederman Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit df865e8337c397471b95f51017fea559bc8abb4a Author: James Morse Date: Tue Aug 21 21:54:48 2018 -0700 fs/proc/kcore.c: use __pa_symbol() for KCORE_TEXT list entries elf_kcore_store_hdr() uses __pa() to find the physical address of KCORE_RAM or KCORE_TEXT entries exported as program headers. This trips CONFIG_DEBUG_VIRTUAL's checks, as the KCORE_TEXT entries are not in the linear map. Handle these two cases separately, using __pa_symbol() for the KCORE_TEXT entries. Link: http://lkml.kernel.org/r/20180711131944.15252-1-james.morse@arm.com Signed-off-by: James Morse Cc: Alexey Dobriyan Cc: Omar Sandoval Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 36f062042b0fd9f8e41b97a472f52139886ca26f Author: Souptick Joarder Date: Tue Aug 21 21:54:44 2018 -0700 fs/proc/vmcore.c: use new typedef vm_fault_t Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. See 1c8f422059ae ("mm: change return type to vm_fault_t") for reference. Link: http://lkml.kernel.org/r/20180702153325.GA3875@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Cc: Ganesh Goudar Cc: Rahul Lakkireddy Cc: David S. Miller Cc: Alexey Dobriyan Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9a27e97aaab9a25fac2e8976e98e42ab7f4a8fac Author: Alexey Dobriyan Date: Tue Aug 21 21:54:41 2018 -0700 proc: use "unsigned int" in /proc/stat hook Number of CPUs is never high enough to force 64-bit arithmetic. Save couple of bytes on x86_64. Link: http://lkml.kernel.org/r/20180627200710.GC18434@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 891ae71dc4fbd2454a3fa569e115a7ca86630949 Author: Alexey Dobriyan Date: Tue Aug 21 21:54:37 2018 -0700 proc: spread "const" a bit Link: http://lkml.kernel.org/r/20180627200614.GB18434@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f6d2f584d88616e27eeb603dc8c88ca16e00d682 Author: Alexey Dobriyan Date: Tue Aug 21 21:54:34 2018 -0700 proc: use macro in /proc/latency hook ->latency_record is defined as struct latency_record[LT_SAVECOUNT]; so use the same macro whie iterating. Link: http://lkml.kernel.org/r/20180627200534.GA18434@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 41089b6d3e44a895076cc8ce56b08e463cb4f796 Author: Alexey Dobriyan Date: Tue Aug 21 21:54:30 2018 -0700 proc: save 2 atomic ops on write to "/proc/*/attr/*" Code checks if write is done by current to its own attributes. For that get/put pair is unnecessary as it can be done under RCU. Note: rcu_read_unlock() can be done even earlier since pointer to a task is not dereferenced. It depends if /proc code should look scary or not: rcu_read_lock(); task = pid_task(...); rcu_read_unlock(); if (!task) return -ESRCH; if (task != current) return -EACCESS: P.S.: rename "length" variable. Code like this length = -EINVAL; should not exist. Link: http://lkml.kernel.org/r/20180627200218.GF18113@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a44937fe4ef6a1190576492017939df636f4e38e Author: Alexey Dobriyan Date: Tue Aug 21 21:54:27 2018 -0700 proc: put task earlier in /proc/*/fail-nth Link: http://lkml.kernel.org/r/20180627195427.GE18113@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8d48b2e044218ba8b3f6b1d34e96a7474b6b0688 Author: Alexey Dobriyan Date: Tue Aug 21 21:54:23 2018 -0700 proc: smaller readlock section in readdir("/proc") Readdir context is thread local, so ->pos is thread local, move it out of readlock. Link: http://lkml.kernel.org/r/20180627195339.GD18113@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2cd36fb329487e9525db3ccdbac1e92053b646fa Author: Alexey Dobriyan Date: Tue Aug 21 21:54:20 2018 -0700 proc: test /proc/thread-self symlink Same story: I have WIP patch to make it faster, so better have a test as well. Link: http://lkml.kernel.org/r/20180627195209.GC18113@avx2 Signed-off-by: Alexey Dobriyan Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 61d47c4e71c1f080e7412315c8685bc682a8e53a Author: Alexey Dobriyan Date: Tue Aug 21 21:54:16 2018 -0700 proc: test /proc/self symlink There are plans to change how /proc/self result is calculated, for that a test is necessary. Use direct system call because of this whole getpid caching story. Link: http://lkml.kernel.org/r/20180627195103.GB18113@avx2 Signed-off-by: Alexey Dobriyan Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bdf228a27278d398ad26a156f01811be405867f9 Author: Arnd Bergmann Date: Tue Aug 21 21:54:13 2018 -0700 fs/proc/uptime.c: use ktime_get_boottime_ts64 get_monotonic_boottime() is deprecated and uses the old timespec type. Let's convert /proc/uptime to use ktime_get_boottime_ts64(). Link: http://lkml.kernel.org/r/20180620081746.282742-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Acked-by: Thomas Gleixner Cc: Al Viro Cc: Deepa Dinamani Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2d6e4e822ad8174b59414903ae6b35660032c20a Author: Alexey Dobriyan Date: Tue Aug 21 21:54:09 2018 -0700 proc: fixup PDE allocation bloat 24074a35c5c975 ("proc: Make inline name size calculation automatic") started to put PDE allocations into kmalloc-256 which is unnecessary as ~40 character names are very rare. Put allocation back into kmalloc-192 cache for 64-bit non-debug builds. Put BUILD_BUG_ON to know when PDE size has gotten out of control. [adobriyan@gmail.com: fix BUILD_BUG_ON breakage on powerpc64] Link: http://lkml.kernel.org/r/20180703191602.GA25521@avx2 Link: http://lkml.kernel.org/r/20180617215732.GA24688@avx2 Signed-off-by: Alexey Dobriyan Cc: David Howells Cc: Al Viro Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5df66d306ec9b1952d3d183fe4e2ced1a7b2bddb Author: Oscar Salvador Date: Tue Aug 21 21:54:06 2018 -0700 mm: fix comment for NODEMASK_ALLOC Currently, NODEMASK_ALLOC allocates a nodemask_t with kmalloc when NODES_SHIFT is higher than 8, otherwise it declares it within the stack. The comment says that the reasoning behind this, is that nodemask_t will be 256 bytes when NODES_SHIFT is higher than 8, but this is not true. For example, NODES_SHIFT = 9 will give us a 64 bytes nodemask_t. Let us fix up the comment for that. Another thing is that it might make sense to let values lower than 128bytes be allocated in the stack. Although this all depends on the depth of the stack (and this changes from function to function), I think that 64 bytes is something we can easily afford. So we could even bump the limit by 1 (from > 8 to > 9). Link: http://lkml.kernel.org/r/20180820085516.9687-1-osalvador@techadventures.net Signed-off-by: Oscar Salvador Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c8bd134a4bddafe5917d163eea73873932c15e83 Author: Peter Kalauskas Date: Tue Aug 21 21:54:02 2018 -0700 drivers/block/zram/zram_drv.c: fix bug storing backing_dev The call to strlcpy in backing_dev_store is incorrect. It should take the size of the destination buffer instead of the size of the source buffer. Additionally, ignore the newline character (\n) when reading the new file_name buffer. This makes it possible to set the backing_dev as follows: echo /dev/sdX > /sys/block/zram0/backing_dev The reason it worked before was the fact that strlcpy() copies 'len - 1' bytes, which is strlen(buf) - 1 in our case, so it accidentally didn't copy the trailing new line symbol. Which also means that "echo -n /dev/sdX" most likely was broken. Signed-off-by: Peter Kalauskas Link: http://lkml.kernel.org/r/20180813061623.GC64836@rodete-desktop-imager.corp.google.com Acked-by: Minchan Kim Reviewed-by: Sergey Senozhatsky Cc: [4.14+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7e8a6304d5419cbf056a59de92939e5eef039c57 Author: Dennis Zhou (Facebook) Date: Tue Aug 21 21:53:58 2018 -0700 /proc/meminfo: add percpu populated pages count Currently, percpu memory only exposes allocation and utilization information via debugfs. This more or less is only really useful for understanding the fragmentation and allocation information at a per-chunk level with a few global counters. This is also gated behind a config. BPF and cgroup, for example, have seen an increase in use causing increased use of percpu memory. Let's make it easier for someone to identify how much memory is being used. This patch adds the "Percpu" stat to meminfo to more easily look up how much percpu memory is in use. This number includes the cost for all allocated backing pages and not just insight at the per a unit, per chunk level. Metadata is excluded. I think excluding metadata is fair because the backing memory scales with the numbere of cpus and can quickly outweigh the metadata. It also makes this calculation light. Link: http://lkml.kernel.org/r/20180807184723.74919-1-dennisszhou@gmail.com Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Acked-by: Roman Gushchin Reviewed-by: Andrew Morton Acked-by: David Rientjes Acked-by: Vlastimil Babka Cc: Johannes Weiner Cc: Christoph Lameter Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3d8b38eb81cac81395f6a823f6bf401b327268e6 Author: Roman Gushchin Date: Tue Aug 21 21:53:54 2018 -0700 mm, oom: introduce memory.oom.group For some workloads an intervention from the OOM killer can be painful. Killing a random task can bring the workload into an inconsistent state. Historically, there are two common solutions for this problem: 1) enabling panic_on_oom, 2) using a userspace daemon to monitor OOMs and kill all outstanding processes. Both approaches have their downsides: rebooting on each OOM is an obvious waste of capacity, and handling all in userspace is tricky and requires a userspace agent, which will monitor all cgroups for OOMs. In most cases an in-kernel after-OOM cleaning-up mechanism can eliminate the necessity of enabling panic_on_oom. Also, it can simplify the cgroup management for userspace applications. This commit introduces a new knob for cgroup v2 memory controller: memory.oom.group. The knob determines whether the cgroup should be treated as an indivisible workload by the OOM killer. If set, all tasks belonging to the cgroup or to its descendants (if the memory cgroup is not a leaf cgroup) are killed together or not at all. To determine which cgroup has to be killed, we do traverse the cgroup hierarchy from the victim task's cgroup up to the OOMing cgroup (or root) and looking for the highest-level cgroup with memory.oom.group set. Tasks with the OOM protection (oom_score_adj set to -1000) are treated as an exception and are never killed. This patch doesn't change the OOM victim selection algorithm. Link: http://lkml.kernel.org/r/20180802003201.817-4-guro@fb.com Signed-off-by: Roman Gushchin Acked-by: Michal Hocko Acked-by: Johannes Weiner Cc: David Rientjes Cc: Tetsuo Handa Cc: Tejun Heo Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5989ad7b5ede38d605c588981f634c08252abfc3 Author: Roman Gushchin Date: Tue Aug 21 21:53:50 2018 -0700 mm, oom: refactor oom_kill_process() Patch series "introduce memory.oom.group", v2. This is a tiny implementation of cgroup-aware OOM killer, which adds an ability to kill a cgroup as a single unit and so guarantee the integrity of the workload. Although it has only a limited functionality in comparison to what now resides in the mm tree (it doesn't change the victim task selection algorithm, doesn't look at memory stas on cgroup level, etc), it's also much simpler and more straightforward. So, hopefully, we can avoid having long debates here, as we had with the full implementation. As it doesn't prevent any futher development, and implements an useful and complete feature, it looks as a sane way forward. This patch (of 2): oom_kill_process() consists of two logical parts: the first one is responsible for considering task's children as a potential victim and printing the debug information. The second half is responsible for sending SIGKILL to all tasks sharing the mm struct with the given victim. This commit splits oom_kill_process() with an intention to re-use the the second half: __oom_kill_process(). The cgroup-aware OOM killer will kill multiple tasks belonging to the victim cgroup. We don't need to print the debug information for the each task, as well as play with task selection (considering task's children), so we can't use the existing oom_kill_process(). Link: http://lkml.kernel.org/r/20171130152824.1591-2-guro@fb.com Link: http://lkml.kernel.org/r/20180802003201.817-3-guro@fb.com Signed-off-by: Roman Gushchin Acked-by: Michal Hocko Acked-by: Johannes Weiner Acked-by: David Rientjes Cc: Vladimir Davydov Cc: Tetsuo Handa Cc: David Rientjes Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1caed86022b9eb927283d8b2cdd7216baf43029e Author: Dmitry Safonov Date: Tue Aug 21 21:53:47 2018 -0700 tools/testing/selftests/vm/: add MAP_POPULATE test As with many other projects, we use some shmalloc allocator. At some point we need to make a part of allocated pages back private to process. And it should be populated straight away. Check that (MAP_PRIVATE | MAP_POPULATE) actually copies the private page. [akpm@linux-foundation.org: change message, per review discussion] Link: http://lkml.kernel.org/r/20180801233636.29354-1-dima@arista.com Signed-off-by: Dmitry Safonov Reviewed-by: Andrew Morton Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Hua Zhong Cc: Shuah Khan Cc: Stuart Ritchie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 03e85f9d5f1f8c74f127c5f7a87575d74a78d248 Author: Oscar Salvador Date: Tue Aug 21 21:53:43 2018 -0700 mm/page_alloc: Introduce free_area_init_core_hotplug Currently, whenever a new node is created/re-used from the memhotplug path, we call free_area_init_node()->free_area_init_core(). But there is some code that we do not really need to run when we are coming from such path. free_area_init_core() performs the following actions: 1) Initializes pgdat internals, such as spinlock, waitqueues and more. 2) Account # nr_all_pages and # nr_kernel_pages. These values are used later on when creating hash tables. 3) Account number of managed_pages per zone, substracting dma_reserved and memmap pages. 4) Initializes some fields of the zone structure data 5) Calls init_currently_empty_zone to initialize all the freelists 6) Calls memmap_init to initialize all pages belonging to certain zone When called from memhotplug path, free_area_init_core() only performs actions #1 and #4. Action #2 is pointless as the zones do not have any pages since either the node was freed, or we are re-using it, eitherway all zones belonging to this node should have 0 pages. For the same reason, action #3 results always in manages_pages being 0. Action #5 and #6 are performed later on when onlining the pages: online_pages()->move_pfn_range_to_zone()->init_currently_empty_zone() online_pages()->move_pfn_range_to_zone()->memmap_init_zone() This patch does two things: First, moves the node/zone initializtion to their own function, so it allows us to create a small version of free_area_init_core, where we only perform: 1) Initialization of pgdat internals, such as spinlock, waitqueues and more 4) Initialization of some fields of the zone structure data These two functions are: pgdat_init_internals() and zone_init_internals(). The second thing this patch does, is to introduce free_area_init_core_hotplug(), the memhotplug version of free_area_init_core(): Currently, we call free_area_init_node() from the memhotplug path. In there, we set some pgdat's fields, and call calculate_node_totalpages(). calculate_node_totalpages() calculates the # of pages the node has. Since the node is either new, or we are re-using it, the zones belonging to this node should not have any pages, so there is no point to calculate this now. Actually, we re-set these values to 0 later on with the calls to: reset_node_managed_pages() reset_node_present_pages() The # of pages per node and the # of pages per zone will be calculated when onlining the pages: online_pages()->move_pfn_range()->move_pfn_range_to_zone()->resize_zone_range() online_pages()->move_pfn_range()->move_pfn_range_to_zone()->resize_pgdat_range() Also, since free_area_init_core/free_area_init_node will now only get called during early init, let us replace __paginginit with __init, so their code gets freed up. [osalvador@techadventures.net: fix section usage] Link: http://lkml.kernel.org/r/20180731101752.GA473@techadventures.net [osalvador@suse.de: v6] Link: http://lkml.kernel.org/r/20180801122348.21588-6-osalvador@techadventures.net Link: http://lkml.kernel.org/r/20180730101757.28058-5-osalvador@techadventures.net Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Pasha Tatashin Cc: Aaron Lu Cc: Dan Williams Cc: David Hildenbrand Cc: Joonsoo Kim Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0188dc98ad5c7c361d46175623471d4be0fb8610 Author: Oscar Salvador Date: Tue Aug 21 21:53:39 2018 -0700 mm/page_alloc: inline function to handle CONFIG_DEFERRED_STRUCT_PAGE_INIT Let us move the code between CONFIG_DEFERRED_STRUCT_PAGE_INIT to an inline function. Not having an ifdef in the function makes the code more readable. Link: http://lkml.kernel.org/r/20180730101757.28058-4-osalvador@techadventures.net Signed-off-by: Oscar Salvador Acked-by: Michal Hocko Reviewed-by: Pavel Tatashin Acked-by: Vlastimil Babka Cc: Aaron Lu Cc: Dan Williams Cc: David Hildenbrand Cc: Joonsoo Kim Cc: Mel Gorman Cc: Pasha Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7cc2a9596d77e598a476ec7819046a453378d4a6 Author: Pavel Tatashin Date: Tue Aug 21 21:53:36 2018 -0700 mm: remove __paginginit __paginginit is the same thing as __meminit except for platforms without sparsemem, there it is defined as __init. Remove __paginginit and use __meminit. Use __ref in one single function that merges __meminit and __init sections: setup_usemap(). Link: http://lkml.kernel.org/r/20180801122348.21588-4-osalvador@techadventures.net Signed-off-by: Pavel Tatashin Signed-off-by: Oscar Salvador Reviewed-by: Oscar Salvador Cc: Pasha Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c1093b746c0576ed81c4d568d1e39cab651d37e6 Author: Pavel Tatashin Date: Tue Aug 21 21:53:32 2018 -0700 mm: access zone->node via zone_to_nid() and zone_set_nid() zone->node is configured only when CONFIG_NUMA=y, so it is a good idea to have inline functions to access this field in order to avoid ifdef's in c files. Link: http://lkml.kernel.org/r/20180730101757.28058-3-osalvador@techadventures.net Signed-off-by: Pavel Tatashin Signed-off-by: Oscar Salvador Reviewed-by: Oscar Salvador Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Aaron Lu Cc: Dan Williams Cc: David Hildenbrand Cc: Joonsoo Kim Cc: Mel Gorman Cc: Pasha Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ace1db39768cdc58f6b157d99ae5958ad34ffff8 Author: Oscar Salvador Date: Tue Aug 21 21:53:29 2018 -0700 mm/page_alloc.c: move ifdefery out of free_area_init_core Patch series "Refactor free_area_init_core and add free_area_init_core_hotplug", v6. This patchset does three things: 1) Clean up/refactor free_area_init_core/free_area_init_node by moving the ifdefery out of the functions. 2) Move the pgdat/zone initialization in free_area_init_core to its own function. 3) Introduce free_area_init_core_hotplug, a small subset of free_area_init_core, which is only called from memhotlug code path. In this way, we have: free_area_init_core: called during early initialization free_area_init_core_hotplug: called whenever a new node is allocated/re-used (memhotplug path) This patch (of 5): Moving the #ifdefs out of the function makes it easier to follow. Link: http://lkml.kernel.org/r/20180730101757.28058-2-osalvador@techadventures.net Signed-off-by: Oscar Salvador Acked-by: Michal Hocko Reviewed-by: Pavel Tatashin Acked-by: Vlastimil Babka Cc: Pasha Tatashin Cc: Mel Gorman Cc: Aaron Lu Cc: Joonsoo Kim Cc: Dan Williams Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 89696701ea847786f88ccc1c580fb4c3c20c4a3a Author: Oscar Salvador Date: Tue Aug 21 21:53:24 2018 -0700 mm: remove zone_id() and make use of zone_idx() in is_dev_zone() is_dev_zone() is using zone_id() to check if the zone is ZONE_DEVICE. zone_id() looks pretty much the same as zone_idx(), and while the use of zone_idx() is quite spread in the kernel, zone_id() is only being used by is_dev_zone(). This patch removes zone_id() and makes is_dev_zone() use zone_idx() to check the zone, so we do not have two things with the same functionality around. Link: http://lkml.kernel.org/r/20180730133718.28683-1-osalvador@techadventures.net Signed-off-by: Oscar Salvador Acked-by: Michal Hocko Acked-by: Vlastimil Babka Reviewed-by: Pavel Tatashin Cc: Pasha Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 85f237a57f143c0c895dcb7cc53fa0174522ce07 Author: juviliu Date: Tue Aug 21 21:53:20 2018 -0700 Documentation/sysctl/vm.txt: update __vm_enough_memory()'s path __vm_enough_memory has moved to mm/util.c. Link: http://lkml.kernel.org/r/E18EDF4A4FA4A04BBFA824B6D7699E532A7E5913@EXMBX-SZMAIL013.tencent.com Signed-off-by: Juvi Liu Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8de7ecc6483bf94cef9f48c4c3511ef3e9ee6d40 Author: Shakeel Butt Date: Tue Aug 21 21:53:17 2018 -0700 memcg: reduce memcg tree traversals for stats collection Currently cgroup-v1's memcg_stat_show traverses the memcg tree ~17 times to collect the stats while cgroup-v2's memory_stat_show traverses the memcg tree thrice. On a large machine, a couple thousand memcgs is very normal and if the churn is high and memcgs stick around during to several reasons, tens of thousands of nodes in memcg tree can exist. This patch has refactored and shared the stat collection code between cgroup-v1 and cgroup-v2 and has reduced the tree traversal to just one. I ran a simple benchmark which reads the root_mem_cgroup's stat file 1000 times in the presense of 2500 memcgs on cgroup-v1. The results are: Without the patch: $ time ./read-root-stat-1000-times real 0m1.663s user 0m0.000s sys 0m1.660s With the patch: $ time ./read-root-stat-1000-times real 0m0.468s user 0m0.000s sys 0m0.467s Link: http://lkml.kernel.org/r/20180724224635.143944-1-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Vladimir Davydov Cc: Greg Thelen Cc: Bruce Merry Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1c4c3b99c03d3e72ac643b01edcb83c0c0aafd46 Author: Jiang Biao Date: Tue Aug 21 21:53:13 2018 -0700 mm: fix page_freeze_refs and page_unfreeze_refs in comments page_freeze_refs/page_unfreeze_refs have already been relplaced by page_ref_freeze/page_ref_unfreeze , but they are not modified in the comments. Link: http://lkml.kernel.org/r/1532590226-106038-1-git-send-email-jiang.biao2@zte.com.cn Signed-off-by: Jiang Biao Acked-by: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8c9a134cae6f8d66f35321b07baa202f75ef2199 Author: Kees Cook Date: Tue Aug 21 21:53:10 2018 -0700 mm: clarify CONFIG_PAGE_POISONING and usage The Kconfig text for CONFIG_PAGE_POISONING doesn't mention that it has to be enabled explicitly. This updates the documentation for that and adds a note about CONFIG_PAGE_POISONING to the "page_poison" command line docs. While here, change description of CONFIG_PAGE_POISONING_ZERO too, as it's not "random" data, but rather the fixed debugging value that would be used when not zeroing. Additionally removes a stray "bool" in the Kconfig. Link: http://lkml.kernel.org/r/20180725223832.GA43733@beast Signed-off-by: Kees Cook Reviewed-by: Andrew Morton Cc: Jonathan Corbet Cc: Laura Abbott Cc: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a670468f5e0b5fad4db6e4d195f15915dc2a35c1 Author: Andrew Morton Date: Tue Aug 21 21:53:06 2018 -0700 mm: zero out the vma in vma_init() Rather than in vm_area_alloc(). To ensure that the various oddball stack-based vmas are in a good state. Some of the callers were zeroing them out, others were not. Acked-by: Kirill A. Shutemov Cc: Russell King Cc: Dmitry Vyukov Cc: Oleg Nesterov Cc: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a3bf6ce366496016990d8578af74673ea04178ff Author: Mike Rapoport Date: Tue Aug 21 21:53:03 2018 -0700 mm/mempool.c: add missing parameter description The kernel-doc for mempool_init function is missing the description of the pool parameter. Add it. Link: http://lkml.kernel.org/r/1532336274-26228-1-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 258f669e7e88c18edbc23fe5ce00a476b924551f Author: Vlastimil Babka Date: Tue Aug 21 21:52:59 2018 -0700 mm: /proc/pid/smaps_rollup: convert to single value seq_file The /proc/pid/smaps_rollup file is currently implemented via the m_start/m_next/m_stop seq_file iterators shared with the other maps files, that iterate over vma's. However, the rollup file doesn't print anything for each vma, only accumulate the stats. There are some issues with the current code as reported in [1] - the accumulated stats can get skewed if seq_file start()/stop() op is called multiple times, if show() is called multiple times, and after seeks to non-zero position. Patch [1] fixed those within existing design, but I believe it is fundamentally wrong to expose the vma iterators to the seq_file mechanism when smaps_rollup shows logically a single set of values for the whole address space. This patch thus refactors the code to provide a single "value" at offset 0, with vma iteration to gather the stats done internally. This fixes the situations where results are skewed, and simplifies the code, especially in show_smap(), at the expense of somewhat less code reuse. [1] https://marc.info/?l=linux-mm&m=151927723128134&w=2 [vbabka@suse.c: use seq_file infrastructure] Link: http://lkml.kernel.org/r/bf4525b0-fd5b-4c4c-2cb3-adee3dd95a48@suse.cz Link: http://lkml.kernel.org/r/20180723111933.15443-5-vbabka@suse.cz Signed-off-by: Vlastimil Babka Reported-by: Daniel Colascione Reviewed-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f1547959d9efd0be6cac2a2fd32f05dd7144dd6c Author: Vlastimil Babka Date: Tue Aug 21 21:52:56 2018 -0700 mm: /proc/pid/smaps: factor out common stats printing To prepare for handling /proc/pid/smaps_rollup differently from /proc/pid/smaps factor out from show_smap() printing the parts of output that are common for both variants, which is the bulk of the gathered memory stats. [vbabka@suse.cz: add const, per Alexey] Link: http://lkml.kernel.org/r/b45f319f-cd04-337b-37f8-77f99786aa8a@suse.cz Link: http://lkml.kernel.org/r/20180723111933.15443-4-vbabka@suse.cz Signed-off-by: Vlastimil Babka Reviewed-by: Alexey Dobriyan Cc: Daniel Colascione Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8e68d689afe3284a5bc1663562d3e0a45d1c64fd Author: Vlastimil Babka Date: Tue Aug 21 21:52:52 2018 -0700 mm: /proc/pid/smaps: factor out mem stats gathering To prepare for handling /proc/pid/smaps_rollup differently from /proc/pid/smaps factor out vma mem stats gathering from show_smap() - it will be used by both. Link: http://lkml.kernel.org/r/20180723111933.15443-3-vbabka@suse.cz Signed-off-by: Vlastimil Babka Reviewed-by: Alexey Dobriyan Cc: Daniel Colascione Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 871305bb20280804882bd08b39a38ccf1b4b68f9 Author: Vlastimil Babka Date: Tue Aug 21 21:52:48 2018 -0700 mm: /proc/pid/*maps remove is_pid and related wrappers Patch series "cleanups and refactor of /proc/pid/smaps*". The recent regression in /proc/pid/smaps made me look more into the code. Especially the issues with smaps_rollup reported in [1] as explained in Patch 4, which fixes them by refactoring the code. Patches 2 and 3 are preparations for that. Patch 1 is me realizing that there's a lot of boilerplate left from times where we tried (unsuccessfuly) to mark thread stacks in the output. Originally I had also plans to rework the translation from /proc/pid/*maps* file offsets to the internal structures. Now the offset means "vma number", which is not really stable (vma's can come and go between read() calls) and there's an extra caching of last vma's address. My idea was that offsets would be interpreted directly as addresses, which would also allow meaningful seeks (see the ugly seek_to_smaps_entry() in tools/testing/selftests/vm/mlock2.h). However loff_t is (signed) long long so that might be insufficient somewhere for the unsigned long addresses. So the result is fixed issues with skewed /proc/pid/smaps_rollup results, simpler smaps code, and a lot of unused code removed. [1] https://marc.info/?l=linux-mm&m=151927723128134&w=2 This patch (of 4): Commit b76437579d13 ("procfs: mark thread stack correctly in proc//maps") introduced differences between /proc/PID/maps and /proc/PID/task/TID/maps to mark thread stacks properly, and this was also done for smaps and numa_maps. However it didn't work properly and was ultimately removed by commit b18cb64ead40 ("fs/proc: Stop trying to report thread stacks"). Now the is_pid parameter for the related show_*() functions is unused and we can remove it together with wrapper functions and ops structures that differ for PID and TID cases only in this parameter. Link: http://lkml.kernel.org/r/20180723111933.15443-2-vbabka@suse.cz Signed-off-by: Vlastimil Babka Reviewed-by: Alexey Dobriyan Cc: Daniel Colascione Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 431f42fdfdb36f06f43c711fc59be9b814d8fb22 Author: Michal Hocko Date: Tue Aug 21 21:52:45 2018 -0700 mm/oom_kill.c: clean up oom_reap_task_mm() Andrew has noticed some inconsistencies in oom_reap_task_mm. Notably - Undocumented return value. - comment "failed to reap part..." is misleading - sounds like it's referring to something which happened in the past, is in fact referring to something which might happen in the future. - fails to call trace_finish_task_reaping() in one case - code duplication. - Increases mmap_sem hold time a little by moving trace_finish_task_reaping() inside the locked region. So sue me ;) - Sharing the finish: path means that the trace event won't distinguish between the two sources of finishing. Add a short explanation for the return value and fix the rest by reorganizing the function a bit to have unified function exit paths. Link: http://lkml.kernel.org/r/20180724141747.GP28386@dhcp22.suse.cz Suggested-by: Andrew Morton Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Cc: Tetsuo Handa Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c3b78b11efbb2865433abf9d22c004ffe4a73f5c Author: Rodrigo Freire Date: Tue Aug 21 21:52:41 2018 -0700 mm, oom: describe task memory unit, larger PID pad The default page memory unit of OOM task dump events might not be intuitive and potentially misleading for the non-initiated when debugging OOM events: These are pages and not kBs. Add a small printk prior to the task dump informing that the memory units are actually memory _pages_. Also extends PID field to align on up to 7 characters. Reference https://lkml.org/lkml/2018/7/3/1201 Link: http://lkml.kernel.org/r/c795eb5129149ed8a6345c273aba167ff1bbd388.1530715938.git.rfreire@redhat.com Signed-off-by: Rodrigo Freire Acked-by: David Rientjes Acked-by: Rafael Aquini Cc: Michal Hocko Cc: Tetsuo Handa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit af5679fbc669f31f7ebd0d473bca76c24c07de30 Author: Michal Hocko Date: Tue Aug 21 21:52:37 2018 -0700 mm, oom: remove oom_lock from oom_reaper oom_reaper used to rely on the oom_lock since e2fe14564d33 ("oom_reaper: close race with exiting task"). We do not really need the lock anymore though. 212925802454 ("mm: oom: let oom_reap_task and exit_mmap run concurrently") has removed serialization with the exit path based on the mm reference count and so we do not really rely on the oom_lock anymore. Tetsuo was arguing that at least MMF_OOM_SKIP should be set under the lock to prevent from races when the page allocator didn't manage to get the freed (reaped) memory in __alloc_pages_may_oom but it sees the flag later on and move on to another victim. Although this is possible in principle let's wait for it to actually happen in real life before we make the locking more complex again. Therefore remove the oom_lock for oom_reaper paths (both exit_mmap and oom_reap_task_mm). The reaper serializes with exit_mmap by mmap_sem + MMF_OOM_SKIP flag. There is no synchronization with out_of_memory path now. [mhocko@kernel.org: oom_reap_task_mm should return false when __oom_reap_task_mm did] Link: http://lkml.kernel.org/r/20180724141747.GP28386@dhcp22.suse.cz Link: http://lkml.kernel.org/r/20180719075922.13784-1-mhocko@kernel.org Signed-off-by: Michal Hocko Suggested-by: David Rientjes Acked-by: David Rientjes Cc: Tetsuo Handa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 93065ac753e4443840a057bfef4be71ec766fde9 Author: Michal Hocko Date: Tue Aug 21 21:52:33 2018 -0700 mm, oom: distinguish blockable mode for mmu notifiers There are several blockable mmu notifiers which might sleep in mmu_notifier_invalidate_range_start and that is a problem for the oom_reaper because it needs to guarantee a forward progress so it cannot depend on any sleepable locks. Currently we simply back off and mark an oom victim with blockable mmu notifiers as done after a short sleep. That can result in selecting a new oom victim prematurely because the previous one still hasn't torn its memory down yet. We can do much better though. Even if mmu notifiers use sleepable locks there is no reason to automatically assume those locks are held. Moreover majority of notifiers only care about a portion of the address space and there is absolutely zero reason to fail when we are unmapping an unrelated range. Many notifiers do really block and wait for HW which is harder to handle and we have to bail out though. This patch handles the low hanging fruit. __mmu_notifier_invalidate_range_start gets a blockable flag and callbacks are not allowed to sleep if the flag is set to false. This is achieved by using trylock instead of the sleepable lock for most callbacks and continue as long as we do not block down the call chain. I think we can improve that even further because there is a common pattern to do a range lookup first and then do something about that. The first part can be done without a sleeping lock in most cases AFAICS. The oom_reaper end then simply retries if there is at least one notifier which couldn't make any progress in !blockable mode. A retry loop is already implemented to wait for the mmap_sem and this is basically the same thing. The simplest way for driver developers to test this code path is to wrap userspace code which uses these notifiers into a memcg and set the hard limit to hit the oom. This can be done e.g. after the test faults in all the mmu notifier managed memory and set the hard limit to something really small. Then we are looking for a proper process tear down. [akpm@linux-foundation.org: coding style fixes] [akpm@linux-foundation.org: minor code simplification] Link: http://lkml.kernel.org/r/20180716115058.5559-1-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Christian König # AMD notifiers Acked-by: Leon Romanovsky # mlx and umem_odp Reported-by: David Rientjes Cc: "David (ChunMing) Zhou" Cc: Paolo Bonzini Cc: Alex Deucher Cc: David Airlie Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Doug Ledford Cc: Jason Gunthorpe Cc: Mike Marciniszyn Cc: Dennis Dalessandro Cc: Sudeep Dutt Cc: Ashutosh Dixit Cc: Dimitri Sivanich Cc: Boris Ostrovsky Cc: Juergen Gross Cc: "Jérôme Glisse" Cc: Andrea Arcangeli Cc: Felix Kuehling Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c2343d2761f86ae1b857f78c7cdb9f51e5fa1641 Author: Huang Ying Date: Tue Aug 21 21:52:29 2018 -0700 mm/swapfile.c: put_swap_page: share more between huge/normal code path In this patch, locking related code is shared between huge/normal code path in put_swap_page() to reduce code duplication. The `free_entries == 0` case is merged into the more general `free_entries != SWAPFILE_CLUSTER` case, because the new locking method makes it easy. The added lines is same as the removed lines. But the code size is increased when CONFIG_TRANSPARENT_HUGEPAGE=n. text data bss dec hex filename base: 24123 2004 340 26467 6763 mm/swapfile.o unified: 24485 2004 340 26829 68cd mm/swapfile.o Dig on step deeper with `size -A mm/swapfile.o` for base and unified kernel and compare the result, yields, -.text 17723 0 +.text 17835 0 -.orc_unwind_ip 1380 0 +.orc_unwind_ip 1480 0 -.orc_unwind 2070 0 +.orc_unwind 2220 0 -Total 26686 +Total 27048 The total difference is the same. The text segment difference is much smaller: 112. More difference comes from the ORC unwinder segments: (1480 + 2220) - (1380 + 2070) = 250. If the frame pointer unwinder is used, this costs nothing. Link: http://lkml.kernel.org/r/20180720071845.17920-9-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Daniel Jordan Acked-by: Dave Hansen Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dan Williams Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b32d5f32b9dbe64970f41602066f7904df15f3e9 Author: Huang Ying Date: Tue Aug 21 21:52:24 2018 -0700 mm/swapfile.c: add __swap_entry_free_locked() The part of __swap_entry_free() with lock held is separated into a new function __swap_entry_free_locked(). Because we want to reuse that piece of code in some other places. Just mechanical code refactoring, there is no any functional change in this function. Link: http://lkml.kernel.org/r/20180720071845.17920-8-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Daniel Jordan Acked-by: Dave Hansen Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dan Williams Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5d5e8f19544a35ae1609bd96ae6b28c9fcd1baf6 Author: Huang Ying Date: Tue Aug 21 21:52:20 2018 -0700 mm, swap, get_swap_pages: use entry_size instead of cluster in parameter As suggested by Matthew Wilcox, it is better to use "int entry_size" instead of "bool cluster" as parameter to specify whether to operate for huge or normal swap entries. Because this improve the flexibility to support other swap entry size. And Dave Hansen thinks that this improves code readability too. So in this patch, the "bool cluster" parameter of get_swap_pages() is replaced by "int entry_size". And nr_swap_entries() trick is used to reduce the binary size when !CONFIG_TRANSPARENT_HUGE_PAGE. text data bss dec hex filename base 24215 2028 340 26583 67d7 mm/swapfile.o head 24123 2004 340 26467 6763 mm/swapfile.o Link: http://lkml.kernel.org/r/20180720071845.17920-7-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-by: Matthew Wilcox Acked-by: Dave Hansen Cc: Daniel Jordan Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dan Williams Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a448f2d07f891ac65cc48017f17735ec73086bf0 Author: Huang Ying Date: Tue Aug 21 21:52:17 2018 -0700 mm/swapfile.c: unify normal/huge code path in put_swap_page() In this patch, the normal/huge code path in put_swap_page() and several helper functions are unified to avoid duplicated code, bugs, etc. and make it easier to review the code. The removed lines are more than added lines. And the binary size is kept exactly same when CONFIG_TRANSPARENT_HUGEPAGE=n. Link: http://lkml.kernel.org/r/20180720071845.17920-6-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-by: Dave Hansen Acked-by: Dave Hansen Reviewed-by: Daniel Jordan Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dan Williams Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 33ee011e5656edef6a58952006c486d342b7bbb5 Author: Huang Ying Date: Tue Aug 21 21:52:13 2018 -0700 mm/swapfile.c: unify normal/huge code path in swap_page_trans_huge_swapped() As suggested by Dave, we should unify the code path for normal and huge swap support if possible to avoid duplicated code, bugs, etc. and make it easier to review code. In this patch, the normal/huge code path in swap_page_trans_huge_swapped() is unified, the added and removed lines are same. And the binary size is kept almost same when CONFIG_TRANSPARENT_HUGEPAGE=n. text data bss dec hex filename base: 24179 2028 340 26547 67b3 mm/swapfile.o unified: 24215 2028 340 26583 67d7 mm/swapfile.o Link: http://lkml.kernel.org/r/20180720071845.17920-5-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-and-acked-by: Dave Hansen Reviewed-by: Daniel Jordan Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dan Williams Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit afa4711ef1399beb60964dcb2cd0369dfb0ac20a Author: Huang Ying Date: Tue Aug 21 21:52:09 2018 -0700 mm/swapfile.c: use swap_count() in swap_page_trans_huge_swapped() In swap_page_trans_huge_swapped(), to identify whether there's any page table mapping for a 4k sized swap entry, "si->swap_map[i] != SWAP_HAS_CACHE" is used. This works correctly now, because all users of the function will only call it after checking SWAP_HAS_CACHE. But as pointed out by Daniel, it is better to use "swap_count(map[i])" here, because it works for "map[i] == 0" case too. And this makes the implementation more consistent between normal and huge swap entry. Link: http://lkml.kernel.org/r/20180720071845.17920-4-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-and-reviewed-by: Daniel Jordan Acked-by: Dave Hansen Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dan Williams Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fe5266d5d5948abc6e71cdabb98e3f5cba811205 Author: Huang Ying Date: Tue Aug 21 21:52:05 2018 -0700 mm/swapfile.c: replace some #ifdef with IS_ENABLED() In mm/swapfile.c, THP (Transparent Huge Page) swap specific code is enclosed by #ifdef CONFIG_THP_SWAP/#endif to avoid code dilating when THP isn't enabled. But #ifdef/#endif in .c file hurt the code readability, so Dave suggested to use IS_ENABLED(CONFIG_THP_SWAP) instead and let compiler to do the dirty job for us. This has potential to remove some duplicated code too. From output of `size`, text data bss dec hex filename THP=y: 26269 2076 340 28685 700d mm/swapfile.o ifdef/endif: 24115 2028 340 26483 6773 mm/swapfile.o IS_ENABLED: 24179 2028 340 26547 67b3 mm/swapfile.o IS_ENABLED() based solution works quite well, almost as good as that of #ifdef/#endif. And from the diffstat, the removed lines are more than added lines. One #ifdef for split_swap_cluster() is kept. Because it is a public function with a stub implementation for CONFIG_THP_SWAP=n in swap.h. Link: http://lkml.kernel.org/r/20180720071845.17920-3-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-and-acked-by: Dave Hansen Reviewed-by: Daniel Jordan Reviewed-by: Andrew Morton Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dan Williams Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 59d98bf3c2b9218ff4cdb2a70aa52fffedf1786c Author: Huang Ying Date: Tue Aug 21 21:52:01 2018 -0700 mm: swap: add comments to lock_cluster_or_swap_info() Patch series "swap: THP optimizing refactoring", v4. Now the THP (Transparent Huge Page) swap optimizing is implemented in the way like below, #ifdef CONFIG_THP_SWAP huge_function(...) { } #else normal_function(...) { } #endif general_function(...) { if (huge) return thp_function(...); else return normal_function(...); } As pointed out by Dave Hansen, this will, 1. Create a new, wholly untested code path for huge page 2. Create two places to patch bugs 3. Are not reusing code when possible This patchset is to address these problems via merging huge/normal code path/functions if possible. One concern is that this may cause code size to dilate when !CONFIG_TRANSPARENT_HUGEPAGE. The data shows that most refactoring will only cause quite slight code size increase. This patch (of 8): To improve code readability. Link: http://lkml.kernel.org/r/20180720071845.17920-2-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-and-acked-by: Dave Hansen Reviewed-by: Daniel Jordan Reviewed-by: Andrew Morton Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dan Williams Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e50ef89b0f58a2cb0e7d496a97b851e0dced62a6 Author: Kirill Tkhai Date: Tue Aug 21 21:51:57 2018 -0700 mm: struct shrinker: make flags of unsigned type Currently, there are two flags only, so unsigned is more then enough. Also, move int seeks to keep these fields together. Link: http://lkml.kernel.org/r/153199748720.21131.6476256940113102483.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Michal Hocko Cc: Vladimir Davydov Cc: Tetsuo Handa Cc: Chris Wilson Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 92be775a3db343889ab159c44d55315c5ee0be4e Author: Kirill Tkhai Date: Tue Aug 21 21:51:53 2018 -0700 mm: struct shrink_control: keep int fields together Patch series "Reorderings in struct shrinker and struct shrink_control". These structures are intensively used during reclaim and, displace other data in cache, so there is no a reason they have int fields not grouped together. This patch (of 2): gfp_t is of unsigned type, so let's move nid to keep them together. Link: http://lkml.kernel.org/r/153199747930.21131.861043607301997810.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Michal Hocko Cc: Vladimir Davydov Cc: Tetsuo Handa Cc: Chris Wilson Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8df4a44cc46bf9dcfb80a37a59ae5dea2232dc58 Author: Kirill Tkhai Date: Tue Aug 21 21:51:49 2018 -0700 mm: check shrinker is memcg-aware in register_shrinker_prepared() There is a sad BUG introduced in patch adding SHRINKER_REGISTERING. shrinker_idr business is only for memcg-aware shrinkers. Only such type of shrinkers have id and they must be finaly installed via idr_replace() in this function. For !memcg-aware shrinkers we never initialize shrinker->id field. But there are all types of shrinkers passed to idr_replace(), and every !memcg-aware shrinker with random ID (most probably, its id is 0) replaces memcg-aware shrinker pointed by the ID in IDR. This patch fixes the problem. Link: http://lkml.kernel.org/r/8ff8a793-8211-713a-4ed9-d6e52390c2fc@virtuozzo.com Fixes: 7e010df53c80 "mm: use special value SHRINKER_REGISTERING instead of list_empty() check" Signed-off-by: Kirill Tkhai Reported-by: Cc: Andrey Ryabinin Cc: Johannes Weiner Cc: Josef Bacik Cc: Mel Gorman Cc: Michal Hocko Cc: Tetsuo Handa Cc: Shakeel Butt Cc: Cc: Huang Ying Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0633da48f0793aeba27f82d30605624416723a91 Author: Ian Kent Date: Tue Aug 21 21:51:45 2018 -0700 autofs: fix autofs_sbi() does not check super block type autofs_sbi() does not check the superblock magic number to verify it has been given an autofs super block. Link: http://lkml.kernel.org/r/153475422934.17131.7563724552005298277.stgit@pluto.themaw.net Reported-by: Signed-off-by: Ian Kent Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7b6924d94a60c6b8c1279ca003e8744e6cd9e8b1 Author: Jeremy Cline Date: Tue Jul 31 01:37:31 2018 +0000 fs/quota: Fix spectre gadget in do_quotactl 'type' is user-controlled, so sanitize it after the bounds check to avoid using it in speculative execution. This covers the following potential gadgets detected with the help of smatch: * fs/ext4/super.c:5741 ext4_quota_read() warn: potential spectre issue 'sb_dqopt(sb)->files' [r] * fs/ext4/super.c:5778 ext4_quota_write() warn: potential spectre issue 'sb_dqopt(sb)->files' [r] * fs/f2fs/super.c:1552 f2fs_quota_read() warn: potential spectre issue 'sb_dqopt(sb)->files' [r] * fs/f2fs/super.c:1608 f2fs_quota_write() warn: potential spectre issue 'sb_dqopt(sb)->files' [r] * fs/quota/dquot.c:412 mark_info_dirty() warn: potential spectre issue 'sb_dqopt(sb)->info' [w] * fs/quota/dquot.c:933 dqinit_needed() warn: potential spectre issue 'dquots' [r] * fs/quota/dquot.c:2112 dquot_commit_info() warn: potential spectre issue 'dqopt->ops' [r] * fs/quota/dquot.c:2362 vfs_load_quota_inode() warn: potential spectre issue 'dqopt->files' [w] (local cap) * fs/quota/dquot.c:2369 vfs_load_quota_inode() warn: potential spectre issue 'dqopt->ops' [w] (local cap) * fs/quota/dquot.c:2370 vfs_load_quota_inode() warn: potential spectre issue 'dqopt->info' [w] (local cap) * fs/quota/quota.c:110 quota_getfmt() warn: potential spectre issue 'sb_dqopt(sb)->info' [r] * fs/quota/quota_v2.c:84 v2_check_quota_file() warn: potential spectre issue 'quota_magics' [w] * fs/quota/quota_v2.c:85 v2_check_quota_file() warn: potential spectre issue 'quota_versions' [w] * fs/quota/quota_v2.c:96 v2_read_file_info() warn: potential spectre issue 'dqopt->info' [r] * fs/quota/quota_v2.c:172 v2_write_file_info() warn: potential spectre issue 'dqopt->info' [r] Additionally, a quick inspection indicates there are array accesses with 'type' in quota_on() and quota_off() functions which are also addressed by this. Cc: Josh Poimboeuf Cc: stable@vger.kernel.org Signed-off-by: Jeremy Cline Signed-off-by: Jan Kara commit 64d9d13828c6c8e188bba63794eee923df3d69a9 Author: Jeremy Cline Date: Tue Jul 31 01:37:30 2018 +0000 fs/quota: Replace XQM_MAXQUOTAS usage with MAXQUOTAS XQM_MAXQUOTAS and MAXQUOTAS are, it appears, equivalent. Replace all usage of XQM_MAXQUOTAS and remove it along with the unused XQM_*QUOTA definitions. Signed-off-by: Jeremy Cline Signed-off-by: Jan Kara commit 87915adc3f0acdf03c776df42e308e5a155c19af Author: Johannes Berg Date: Wed Aug 22 11:49:04 2018 +0200 workqueue: re-add lockdep dependencies for flushing In flush_work(), we need to create a lockdep dependency so that the following scenario is appropriately tagged as a problem: work_function() { mutex_lock(&mutex); ... } other_function() { mutex_lock(&mutex); flush_work(&work); // or cancel_work_sync(&work); } This is a problem since the work might be running and be blocked on trying to acquire the mutex. Similarly, in flush_workqueue(). These were removed after cross-release partially caught these problems, but now cross-release was reverted anyway. IMHO the removal was erroneous anyway though, since lockdep should be able to catch potential problems, not just actual ones, and cross-release would only have caught the problem when actually invoking wait_for_completion(). Fixes: fd1a5b04dfb8 ("workqueue: Remove now redundant lock acquisitions wrt. workqueue flushes") Signed-off-by: Johannes Berg Signed-off-by: Tejun Heo commit d6e89786bed977f37f55ffca11e563f6d2b1e3b5 Author: Johannes Berg Date: Wed Aug 22 11:49:03 2018 +0200 workqueue: skip lockdep wq dependency in cancel_work_sync() In cancel_work_sync(), we can only have one of two cases, even with an ordered workqueue: * the work isn't running, just cancelled before it started * the work is running, but then nothing else can be on the workqueue before it Thus, we need to skip the lockdep workqueue dependency handling, otherwise we get false positive reports from lockdep saying that we have a potential deadlock when the workqueue also has other work items with locking, e.g. work1_function() { mutex_lock(&mutex); ... } work2_function() { /* nothing */ } other_function() { queue_work(ordered_wq, &work1); queue_work(ordered_wq, &work2); mutex_lock(&mutex); cancel_work_sync(&work2); } As described above, this isn't a problem, but lockdep will currently flag it as if cancel_work_sync() was flush_work(), which *is* a problem. Signed-off-by: Johannes Berg Signed-off-by: Tejun Heo commit 2d17f460c5d79fa9fc794e813377f3276acf81ce Author: Kunihiko Hayashi Date: Wed Aug 22 21:13:03 2018 +0900 ata: ahci_platform: enable to get and control reset Unlike SoC-specific driver, generic ahci_platform driver doesn't have any chances to control resets. This adds AHCI_PLATFORM_GET_RESETS to ahci_platform_get_resources() on the generic driver to enable reset control support. Suggested-by: Hans de Goede Cc: Thierry Reding Signed-off-by: Kunihiko Hayashi Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit 9d2ab99573970838108add835442a03e23f8577b Author: Kunihiko Hayashi Date: Wed Aug 22 21:13:02 2018 +0900 ata: libahci_platform: add reset control support Add support to get and control a list of resets for the device as optional and shared. These resets must be kept de-asserted until the device is enabled. This is specified as shared because some SoCs like UniPhier series have common reset controls with all ahci controller instances. However, according to Thierry's view, https://www.spinics.net/lists/linux-ide/msg55357.html some hardware-specific drivers already use their own resets, and the common reset make a path to occur double controls of resets. The ahci_platform_get_resources() can get and control the reset only when the second argument includes AHCI_PLATFORM_GET_RESETS bit. Suggested-by: Hans de Goede Cc: Thierry Reding Signed-off-by: Kunihiko Hayashi Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit 16af2d65842d343c2f95733c3993a0b5baab08f9 Author: Kunihiko Hayashi Date: Wed Aug 22 21:13:01 2018 +0900 ata: add an extra argument to ahci_platform_get_resources() Add an extra argument to ahci_platform_get_resources(), that is for the bitmap representing the resource to get in this function. Currently there is no resources to be defined, so all the callers set '0' to the argument. Suggested-by: Hans de Goede Cc: Thierry Reding Cc: Matthias Brugger Cc: Patrice Chotard Cc: Maxime Ripard Signed-off-by: Kunihiko Hayashi Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit ce32d59ee2cd036f6e8a6ed17a06a0b0bec5c67c Author: Keerthy Date: Wed Jul 25 11:25:35 2018 +0530 arm: dts: am4372: setup rtc as system-power-controller RTC alarm2 is connected to pmic_en line and hence can be used to control the pmic enabling/disabling. Hence add the system-power-controller for rtc node. Signed-off-by: Keerthy Signed-off-by: Tony Lindgren commit f4efa74c09a7eddcc12cd13208f78743763f6e7a Author: Pavel Machek Date: Wed Aug 1 22:28:21 2018 +0200 ARM: dts: omap4-droid4: fix vibrations on Droid 4 Vibration GPIOs don't have anything to do with wakeup. Move it to normal section; this fixes vibrations on Droid 4. Fixes: a5effd968301 ("ARM: dts: omap4-droid4: Add vibrator") Signed-off-by: Pavel Machek Reviewed-by: Sebastian Reichel Signed-off-by: Tony Lindgren commit 4f3530f4a41d49c41015020cd9a5ed5c95b5d2db Author: Tony Lindgren Date: Wed Aug 8 01:07:06 2018 -0700 bus: ti-sysc: Fix no_console_suspend handling If no_console_suspend is set, we should keep console enabled during suspend. Lets fix this by only producing a warning if we can't idle hardware during suspend. Fixes: ef55f8215a78 ("bus: ti-sysc: Improve suspend and resume handling") Signed-off-by: Tony Lindgren commit 0027ff2a75f9dcf0537ac0a65c5840b0e21a4950 Author: Paolo Bonzini Date: Wed Aug 22 16:43:39 2018 +0200 KVM: VMX: fixes for vmentry_l1d_flush module parameter Two bug fixes: 1) missing entries in the l1d_param array; this can cause a host crash if an access attempts to reach the missing entry. Future-proof the get function against any overflows as well. However, the two entries VMENTER_L1D_FLUSH_EPT_DISABLED and VMENTER_L1D_FLUSH_NOT_REQUIRED must not be accepted by the parse function, so disable them there. 2) invalid values must be rejected even if the CPU does not have the bug, so test for them before checking boot_cpu_has(X86_BUG_L1TF) ... and a small refactoring, since the .cmd field is redundant with the index in the array. Reported-by: Bandan Das Cc: stable@vger.kernel.org Fixes: a7b9020b06ec6d7c3f3b0d4ef1a9eba12654f4f7 Signed-off-by: Paolo Bonzini commit 3b4cd0ff5407c14900bcda7ea4aeb43a65620deb Author: Peter Xu Date: Wed Aug 22 15:20:00 2018 +0800 kvm: selftest: add dirty logging test Test KVM dirty logging functionality. The test creates a standalone memory slot to test tracking the dirty pages since we can't really write to the default memory slot which still contains the guest ELF image. We have two threads running during the test: (1) the vcpu thread continuously dirties random guest pages by writting a iteration number to the first 8 bytes of the page (2) the host thread continuously fetches dirty logs for the testing memory region and verify each single bit of the dirty bitmap by checking against the values written onto the page Note that since the guest cannot calls the general userspace APIs like random(), it depends on the host to provide random numbers for the page indexes to dirty. Signed-off-by: Peter Xu Signed-off-by: Paolo Bonzini commit aee41be5933fdd1cd6fbd80b31954585e3520d98 Author: Peter Xu Date: Wed Aug 22 15:19:59 2018 +0800 kvm: selftest: pass in extra memory when create vm This information can be used to decide the size of the default memory slot, which will need to cover the extra pages with page tables. Signed-off-by: Peter Xu Signed-off-by: Paolo Bonzini commit bc8eb2fe2eefbcf66c947daebce7055a4110c66c Author: Peter Xu Date: Wed Aug 22 15:19:58 2018 +0800 kvm: selftest: include the tools headers Let the kvm selftest include the tools headers, then we can start to use things there like bitmap operations. Signed-off-by: Peter Xu Signed-off-by: Paolo Bonzini commit 4e18bccc2e5544f0be28fc1c4e6be47a469d6c60 Author: Peter Xu Date: Wed Aug 22 15:19:57 2018 +0800 kvm: selftest: unify the guest port macros Most of the tests are using the same way to do guest to host sync but the code is mostly duplicated. Generalize the guest port macros into the common header file and use it in different tests. Meanwhile provide "struct guest_args" and a helper "guest_args_read()" to hide the register details when playing with these port operations on RDI and RSI. Signed-off-by: Peter Xu Signed-off-by: Paolo Bonzini commit 07a262cc7c586e3f385a61b8870b0913bf31309a Author: Peter Xu Date: Wed Aug 22 15:19:56 2018 +0800 tools: introduce test_and_clear_bit We have test_and_set_bit but not test_and_clear_bit. Add it. Signed-off-by: Peter Xu Signed-off-by: Paolo Bonzini commit 024d83cadc6b2af027e473720f3c3da97496c318 Author: Thomas Gleixner Date: Sun Aug 12 20:41:45 2018 +0200 KVM: x86: SVM: Call x86_spec_ctrl_set_guest/host() with interrupts disabled Mikhail reported the following lockdep splat: WARNING: possible irq lock inversion dependency detected CPU 0/KVM/10284 just changed the state of lock: 000000000d538a88 (&st->lock){+...}, at: speculative_store_bypass_update+0x10b/0x170 but this lock was taken by another, HARDIRQ-safe lock in the past: (&(&sighand->siglock)->rlock){-.-.} and interrupts could create inverse lock ordering between them. Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&st->lock); local_irq_disable(); lock(&(&sighand->siglock)->rlock); lock(&st->lock); lock(&(&sighand->siglock)->rlock); *** DEADLOCK *** The code path which connects those locks is: speculative_store_bypass_update() ssb_prctl_set() do_seccomp() do_syscall_64() In svm_vcpu_run() speculative_store_bypass_update() is called with interupts enabled via x86_virt_spec_ctrl_set_guest/host(). This is actually a false positive, because GIF=0 so interrupts are disabled even if IF=1; however, we can easily move the invocations of x86_virt_spec_ctrl_set_guest/host() into the interrupt disabled region to cure it, and it's a good idea to keep the GIF=0/IF=1 area as small and self-contained as possible. Fixes: 1f50ddb4f418 ("x86/speculation: Handle HT correctly on AMD") Reported-by: Mikhail Gavrilov Signed-off-by: Thomas Gleixner Tested-by: Mikhail Gavrilov Cc: Joerg Roedel Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Matthew Wilcox Cc: Borislav Petkov Cc: Konrad Rzeszutek Wilk Cc: Tom Lendacky Cc: kvm@vger.kernel.org Cc: x86@kernel.org Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 0b665d30402819830caa21aa23942f70f36a7e72 Author: Sean Christopherson Date: Tue Aug 14 09:33:34 2018 -0700 KVM: vmx: Inject #UD for SGX ENCLS instruction in guest Virtualization of Intel SGX depends on Enclave Page Cache (EPC) management that is not yet available in the kernel, i.e. KVM support for exposing SGX to a guest cannot be added until basic support for SGX is upstreamed, which is a WIP[1]. Until SGX is properly supported in KVM, ensure a guest sees expected behavior for ENCLS, i.e. all ENCLS #UD. Because SGX does not have a true software enable bit, e.g. there is no CR4.SGXE bit, the ENCLS instruction can be executed[1] by the guest if SGX is supported by the system. Intercept all ENCLS leafs (via the ENCLS- exiting control and field) and unconditionally inject #UD. [1] https://www.spinics.net/lists/kvm/msg171333.html or https://lkml.org/lkml/2018/7/3/879 [2] A guest can execute ENCLS in the sense that ENCLS will not take an immediate #UD, but no ENCLS will ever succeed in a guest without explicit support from KVM (map EPC memory into the guest), unless KVM has a *very* egregious bug, e.g. accidentally mapped EPC memory into the guest SPTEs. In other words this patch is needed only to prevent the guest from seeing inconsistent behavior, e.g. #GP (SGX not enabled in Feature Control MSR) or #PF (leaf operand(s) does not point at EPC memory) instead of #UD on ENCLS. Intercepting ENCLS is not required to prevent the guest from truly utilizing SGX. Signed-off-by: Sean Christopherson Message-Id: <20180814163334.25724-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit 802ec461670773b433b678b27145050262df5994 Author: Sean Christopherson Date: Tue Aug 14 09:33:33 2018 -0700 KVM: vmx: Add defines for SGX ENCLS exiting Hardware support for basic SGX virtualization adds a new execution control (ENCLS_EXITING), VMCS field (ENCLS_EXITING_BITMAP) and exit reason (ENCLS), that enables a VMM to intercept specific ENCLS leaf functions, e.g. to inject faults when the VMM isn't exposing SGX to a VM. When ENCLS_EXITING is enabled, the VMM can set/clear bits in the bitmap to intercept/allow ENCLS leaf functions in non-root, e.g. setting bit 2 in the ENCLS_EXITING_BITMAP will cause ENCLS[EINIT] to VMExit(ENCLS). Note: EXIT_REASON_ENCLS was previously added by commit 1f5199927034 ("KVM: VMX: add missing exit reasons"). Signed-off-by: Sean Christopherson Message-Id: <20180814163334.25724-2-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini commit d806afa495e2e2a1a726e26c5e44f27818e804c1 Author: Yi Wang Date: Thu Aug 16 13:42:39 2018 +0800 x86/kvm/vmx: Fix coding style in vmx_setup_l1d_flush() Substitute spaces with tab. No functional changes. Signed-off-by: Yi Wang Reviewed-by: Jiang Biao Message-Id: <1534398159-48509-1-git-send-email-wang.yi59@zte.com.cn> Cc: stable@vger.kernel.org # L1TF Signed-off-by: Paolo Bonzini commit 7288bde1f9df6c1475675419bdd7725ce84dec56 Author: Arnd Bergmann Date: Mon Aug 20 23:37:50 2018 +0200 x86: kvm: avoid unused variable warning Removing one of the two accesses of the maxphyaddr variable led to a harmless warning: arch/x86/kvm/x86.c: In function 'kvm_set_mmio_spte_mask': arch/x86/kvm/x86.c:6563:6: error: unused variable 'maxphyaddr' [-Werror=unused-variable] Removing the #ifdef seems to be the nicest workaround, as it makes the code look cleaner than adding another #ifdef. Fixes: 28a1f3ac1d0c ("kvm: x86: Set highest physical address bits in non-present/reserved SPTEs") Signed-off-by: Arnd Bergmann Cc: stable@vger.kernel.org # L1TF Signed-off-by: Paolo Bonzini commit df2def49c57b4146520a1f4ca37bc3f494e2cd67 Merge: dfec4a8478e8 d1f3ab5b13c0 Author: Linus Torvalds Date: Wed Aug 22 07:44:50 2018 -0700 Merge tag 'acpi-4.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These update the ACPICA code in the kernel to the most recent upstream revision (which includes a regression fix and other improvements), make ACPICA clear the status of all ACPI events when entering sleep states (to restore the previous behavior) and update the ACPI operation region driver for the CrystalCove PMIC. Specifics: - Update the ACPICA code in the kernel to upstream revision 20180810 including: * Fix for AML parser regression causing it to mishandle opcodes that open a scope upon parse failures (Erik Schmauss) * Fix for a reference counting issue on large systems (Erik Schmauss) * Fix to discard values coming from register reads that have failed (Erik Schmauss) * Two acpiexec fixes (Bob Moore, Erik Schmauss) * Debugger cleanup (Bob Moore) * Cleanup of duplicate table error message (Bob Moore) * Cleanup of hex detection in the utilities (Erik Schmauss) - Make ACPICA clear the status of all ACPI events when entering sleep states again to avoid functional regressions (Rafael Wysocki) - Update the ACPI operation region driver for the CrystalCove PMIC to cover all of the known operation region fields (Hans de Goede)" * tag 'acpi-4.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / PMIC: CrystalCove: Extend PMOP support to support all possible fields ACPICA: Clear status of all events when entering sleep states ACPICA: Update version to 20180810 ACPICA: acpiexec: fix a small memory leak regression ACPICA: Reference Counts: increase max to 0x4000 for large servers ACPICA: Reference count: add additional debugging details ACPICA: acpi_exec: fixing -fi option ACPICA: Debugger: Cleanup interface to the AML disassembler ACPICA: AML Parser: skip opcodes that open a scope upon parse failure ACPICA: Utilities: split hex detection into smaller functions ACPICA: Update an error message for a duplicate table ACPICA: ACPICA: add status check for acpi_hw_read before assigning return value ACPICA: AML Parser: ignore all exceptions resulting from incorrect AML during table load commit dfec4a8478e8e81483a94b663f13153bb7796800 Merge: 159127ea8318 01ac7c4c2e03 Author: Linus Torvalds Date: Wed Aug 22 07:42:36 2018 -0700 Merge tag 'pm-4.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "These fix the main idle loop and the menu cpuidle governor, clean up the latter, fix a mistake in the PCI bus type's support for system suspend and resume, fix the ondemand and conservative cpufreq governors, address a build issue in the system wakeup framework and make the ACPI C-states desciptions less confusing. Specifics: - Make the idle loop handle stopped scheduler tick correctly (Rafael Wysocki). - Prevent the menu cpuidle governor from letting CPUs spend too much time in shallow idle states when it is invoked with scheduler tick stopped and clean it up somewhat (Rafael Wysocki). - Avoid invoking the platform firmware to make the platform enter the ACPI S3 sleep state with suspended PCIe root ports which may confuse the firmware and cause it to crash (Rafael Wysocki). - Fix sysfs-related race in the ondemand and conservative cpufreq governors which may cause the system to crash if the governor module is removed during an update of CPU frequency limits (Henry Willard). - Select SRCU when building the system wakeup framework to avoid a build issue in it (zhangyi). - Make the descriptions of ACPI C-states vendor-neutral to avoid confusion (Prarit Bhargava)" * tag 'pm-4.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpuidle: menu: Handle stopped tick more aggressively sched: idle: Avoid retaining the tick when it has been stopped PCI / ACPI / PM: Resume all bridges on suspend-to-RAM cpuidle: menu: Update stale polling override comment cpufreq: governor: Avoid accessing invalid governor_data x86/ACPI/cstate: Make APCI C1 FFH MWAIT C-state description vendor-neutral cpuidle: menu: Fix white space PM / sleep: wakeup: Fix build error caused by missing SRCU support commit 159127ea8318974b76542f62d6d23ec8bec91a28 Merge: 9617ba395f05 a2eed33dcdb7 Author: Linus Torvalds Date: Wed Aug 22 07:40:33 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide Pull IDE updates from David Miller: - Remove redundant variables (Colin Ian King) - Expected switch fall-through annotations (Gustavo A. R. Silva) * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide: ide: mark expected switch fall-throughs ide-tape: remove redundant variable buffer_size ide: remove redundant variables queue_run_ms and left commit 9617ba395f05f2f836d078363463f8978b0f73bc Merge: 20a9e57a09d3 c84ca616b126 Author: Linus Torvalds Date: Wed Aug 22 07:38:21 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc Pull sparc updates from David Miller: "Nothing super serious: - Convert sparc32 over to NO_BOOTMEM (Mike Rapoport) - Use dma_noncoherent_ops on sparc32 (Christoph Hellwig) - Fix kbuild defconfig handling on sparc32 (Masahiro Yamada)" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc: fix KBUILD_DEFCONFIG for ARCH=sparc32 sparc32: split ramdisk detection and reservation to a helper function sparc32: switch to NO_BOOTMEM sparc: mm/init_32: kill trailing whitespace sparc: use generic dma_noncoherent_ops commit f6f57a46435d7253a52a1a07a58183678ad266a0 Author: Masahiro Yamada Date: Tue Aug 21 00:29:51 2018 +0900 initramfs: move gen_initramfs_list.sh from scripts/ to usr/ scripts/gen_initramfs_list.sh is only invoked from usr/Makefile. Move it so that all tools to create initramfs are self-contained in the usr/ directory. Signed-off-by: Masahiro Yamada commit 7953002a7c6561c93defd19c81737012ef5a10dc Author: Masahiro Yamada Date: Tue Aug 21 00:06:24 2018 +0900 vmlinux.lds.h: remove stale include This is unneeded since commit a62143850053 ("vmlinux.lds.h: remove no-op macro VMLINUX_SYMBOL()"). Signed-off-by: Masahiro Yamada commit c4df32c80d04987023844c1fb13734a872c8f2e2 Author: Masahiro Yamada Date: Sun Aug 19 07:34:47 2018 +0900 export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() With the special case handling for Blackfin and Metag was removed by commit 94e58e0ac312 ("export.h: remove code for prefixing symbols with underscore"), VMLINUX_SYMBOL() is no-op. Replace the remaining usages, then remove the definition of VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR(). Signed-off-by: Masahiro Yamada commit 6fbd856950b41345ad5c893613efebdc0c356bc7 Author: zhong jiang Date: Sat Aug 18 21:51:12 2018 +0800 Coccinelle: remove pci_alloc_consistent semantic to detect in zalloc-simple.cocci Because pci_alloc_consistent has been deprecated. We prefer to use dma_alloc_coherent directly. Therefore, we should remove pci_alloc_consistent to increase the confidence. Acked-by: Julia Lawall Acked-by: Himanshu Jha Signed-off-by: zhong jiang Signed-off-by: Masahiro Yamada commit f55f2328bb28a8517620518c5d124f5194673309 Author: Andrzej Pietrasiewicz Date: Fri Aug 17 14:03:19 2018 +0200 kbuild: make sorting initramfs contents independent of locale Some LANG values (e.g. pl_PL.UTF-8) cause the sort command to output files before their parent directories, which makes them inaccessible for the kernel. In other words, when the kernel populates the rootfs, it is unable to create files whose parent directories have not been yet created. This patch makes sorting use the default (LANG=C) locale, which results in correctly laid out initramfs images (parent directories before files). Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Masahiro Yamada commit dd5806ede3d71b7577d1d9ec853755709b6b40fa Author: Masahiro Yamada Date: Fri Aug 17 11:37:21 2018 +0900 kbuild: remove "rpm" target, which is alias of "rpm-pkg" As commit ebaad7d36406 ("kbuild: rpm: prompt to use "rpm-pkg" if "rpm" target is used") noticed, the "rpm" target is now removed. I assume people have already migrated to "rpm-pkg". Signed-off-by: Masahiro Yamada commit c86b1f934215796b2a8e74b76eed733d104e21fc Author: Michal Suchanek Date: Thu Aug 16 19:05:55 2018 +0200 kbuild: Fix LOADLIBES rename in Documentation/kbuild/makefiles.txt Fixes: 8377bd2b9ee1 ("kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS") Signed-off-by: Michal Suchanek Acked-by: Laura Abbott Signed-off-by: Masahiro Yamada commit 9a9ddcf478319bff313837ca235c557d16133b3d Author: Masahiro Yamada Date: Thu Aug 16 16:48:26 2018 +0900 kconfig: suppress "configuration written to .config" for syncconfig The top-level Makefile invokes "make syncconfig" when necessary. Then, Kconfig displays the following message when .config is updated. # # configuration written to .config # It is distracting because "make syncconfig" happens during the build stage, and does nothing important in most cases. Suggested-by: Linus Torvalds Signed-off-by: Masahiro Yamada commit 98a4afbfafd226636cd6bb6a1208b3693daff2b1 Author: Masahiro Yamada Date: Thu Aug 16 13:36:48 2018 +0900 kconfig: fix "Can't open ..." in parallel build If you run "make menuconfig" or "make nconfig" with -j option in a fresh source tree, you will see several "Can't open ..." messages: $ make -j8 menuconfig HOSTCC scripts/basic/fixdep YACC scripts/kconfig/zconf.tab.c LEX scripts/kconfig/zconf.lex.c /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg /bin/sh: 1: .: HOSTCC scripts/kconfig/lxdialog/checklist.o Can't open scripts/kconfig/.mconf-cfg /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg HOSTCC scripts/kconfig/lxdialog/inputbox.o /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg UPD scripts/kconfig/.mconf-cfg /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg HOSTCC scripts/kconfig/lxdialog/menubox.o HOSTCC scripts/kconfig/lxdialog/textbox.o HOSTCC scripts/kconfig/lxdialog/util.o HOSTCC scripts/kconfig/lxdialog/yesno.o HOSTCC scripts/kconfig/mconf.o HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/mconf Correct dependencies to fix this problem. Fixes: 1c5af5cf9308 ("kconfig: refactor ncurses package checks for building mconf and nconf") Cc: linux-stable # v4.18 Reported-by: Borislav Petkov Signed-off-by: Masahiro Yamada Tested-by: Borislav Petkov commit b5f8cb9e908f46feaa5d0ddbf3e2e1b8d85d1a65 Author: Michael Forney Date: Wed Aug 15 17:13:50 2018 -0700 kbuild: Add a space after `!` to prevent parsing as file pattern Some shells use !(pattern|...|pattern) to match file names not containing the specified patterns. This may result in output like $ ./scripts/clang-version.sh gcc ./scripts/clang-version.sh[18]: COPYING: not found printf: %d __clang_major__: conversion error printf: %d __clang_minor__: conversion error printf: %d __clang_patchlevel__: conversion error 00000 $ and set CONFIG_CLANG_VERSION to the invalid value '00000'. POSIX says[0] If the pipeline begins with the reserved word ! and command1 is a subshell command, the application shall ensure that the ( operator at the beginning of command1 is separated from the ! by one or more characters. The behavior of the reserved word ! immediately followed by the ( operator is unspecified. So, just add a to prevent this. [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_02 Signed-off-by: Michael Forney Signed-off-by: Masahiro Yamada commit 1f3aa9002dc6a0d59a4b599b4fc8f01cf43ef014 Author: Randy Dunlap Date: Wed Aug 15 12:30:38 2018 -0700 scripts: modpost: check memory allocation results Fix missing error check for memory allocation functions in scripts/mod/modpost.c. Fixes kernel bugzilla #200319: https://bugzilla.kernel.org/show_bug.cgi?id=200319 Signed-off-by: Randy Dunlap Cc: Yuexing Wang Signed-off-by: Masahiro Yamada commit f498926c47aa7d4f1b6d08af2ba16f3cf8fcb151 Author: Masahiro Yamada Date: Wed Aug 15 14:59:45 2018 +0900 kconfig: improve the recursive dependency report This commit improves the messages of the recursive dependency. Currently, sym->dir_dep.expr is not checked. Hence, any dependency in property visibility is regarded as the dependency of the symbol. [Test Code 1] config A bool "a" depends on B config B bool "b" depends on A [Test Code 2] config A bool "a" if B config B bool "b" depends on A For both cases above, the same message is displayed: symbol B depends on A symbol A depends on B This commit changes the message for the latter, like this: symbol B depends on A symbol A prompt is visible depending on B Also, 'select' and 'imply' are distinguished. Signed-off-by: Masahiro Yamada Tested-by: Dirk Gouders commit 5e8c5299d31519e0327be1020f309fa62dc53036 Author: Masahiro Yamada Date: Wed Aug 15 14:59:44 2018 +0900 kconfig: report recursive dependency involving 'imply' Currently, Kconfig does not complain about the recursive dependency where 'imply' keywords are involved. [Test Code] config A bool "a" config B bool "b" imply A depends on A In the code above, Kconfig cannot calculate the symbol values correctly due to the circular dependency. For example, allyesconfig followed by syncconfig results in an odd behavior because CONFIG_B becomes visible in syncconfig. $ make allyesconfig scripts/kconfig/conf --allyesconfig Kconfig # # configuration written to .config # $ cat .config # # Automatically generated file; DO NOT EDIT. # Main menu # CONFIG_A=y $ make syncconfig scripts/kconfig/conf --syncconfig Kconfig * * Restart config... * * * Main menu * a (A) [Y/n/?] y b (B) [N/y/?] (NEW) To detect this correctly, sym_check_expr_deps() should recurse to not only sym->rev_dep.expr but also sym->implied.expr . At this moment, sym_check_print_recursive() cannot distinguish 'select' and 'imply' since it does not know the precise context where the recursive dependency has been hit. This will be solved by the next commit. In fact, even the document and the unit-test are confused. Using 'imply' does not solve recursive dependency since 'imply' addresses the unmet direct dependency, which 'select' could cause. Signed-off-by: Masahiro Yamada Tested-by: Dirk Gouders commit f1575595d15657bd78c139978107deabec5a3959 Author: Masahiro Yamada Date: Wed Aug 15 14:59:43 2018 +0900 kconfig: error out when seeing recursive dependency Originally, recursive dependency was a fatal error for Kconfig because Kconfig cannot compute symbol values in such a situation. Commit d595cea62403 ("kconfig: print more info when we see a recursive dependency") changed it to a warning, which I guess was not intentional. Get it back to an error again. Also, rename the unit test directory "warn_recursive_dep" to "err_recursive_dep" so that it matches to the behavior. Signed-off-by: Masahiro Yamada Tested-by: Dirk Gouders commit 4bf6a9af0e9107926d1fb0112e7f9acb0d798cb4 Author: Randy Dunlap Date: Tue Aug 14 17:36:49 2018 -0700 kconfig: add build-only configurator targets Add build-only targets for build_menuconfig, build_nconfig, build_xconfig, and build_gconfig. (targets must end in "config" to qualify in top-level Makefile) This allows these target to be built without execution (e.g., to look for errors or warnings) and/or to be built and checked by sparse. Signed-off-by: Randy Dunlap Signed-off-by: Masahiro Yamada commit e3fd9b5384f37e55261ebd261ad97951a44ece50 Author: Masahiro Yamada Date: Wed Jul 4 10:59:23 2018 +0900 scripts/dtc: consolidate include path options in Makefile It is tedious to specify extra compiler options for every file. HOST_EXTRACFLAGS is useful to add options to all files in a directory. -I$(src)/libfdt is needed for all the files in this directory to include libfdt_env.h etc. from scripts/dtc/libfdt/. On the other hand, -I$(src) is used to include check-in headers from generated C files. Thus, I added it only to dtc-lexer.lex.o and dtc-parser.tab.o . Signed-off-by: Masahiro Yamada Reviewed-by: Rob Herring commit 20a9e57a09d32c9149e065b73b714b9681349619 Merge: ad1d69735878 4bdf61ccbe76 Author: Linus Torvalds Date: Wed Aug 22 06:24:26 2018 -0700 Merge tag 'for-4.19' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux Pull arch/h8300 updates from Yoshinori Sato. * tag 'for-4.19' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux: h8300: fix IRQ no arch/h8300: add a defconfig target arch/h8300: eliminate kgbd.c warning arch/h8300: eliminate ptrace.h warnings h8300:let the checker know that size_t is ulong h8300: Don't include linux/kernel.h in asm/atomic.h h8300: remove unnecessary of_platform_populate call h8300: Correct signature of test_bit() h8300: irqchip: fix warning h8300: switch to NO_BOOTMEM h8300: gcc-8.1 fix h8300: Add missing output register. commit fd991a23c8f6ef30692f77409602ccf3614353b2 Author: Arnd Bergmann Date: Tue Aug 21 22:33:00 2018 +0200 y2038: Provide aliases for compat helpers As part of the system call rework for 64-bit time_t, we are restructuring the way that compat syscalls deal with 32-bit time_t, reusing the implementation for 32-bit architectures. Christoph Hellwig suggested a rename of the associated types and interfaces to avoid the confusing usage of the 'compat' prefix for 32-bit architectures. To prepare for doing that in linux-4.20, add a set of macros that allows to convert subsystems separately to the new names and avoids some of the nastier merge conflicts. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Acked-by: Christoph Hellwig Cc: y2038@lists.linaro.org Cc: John Stultz Cc: Deepa Dinamani Link: https://lkml.kernel.org/r/20180821203329.2089473-1-arnd@arndb.de commit 688e0581dbe0fa851188dd4fef887ea0c55aab13 Author: Dongjiu Geng Date: Mon Aug 20 17:39:25 2018 -0400 KVM: Documentation: rename the capability of KVM_CAP_ARM_SET_SERROR_ESR In the documentation description, this capability's name is KVM_CAP_ARM_SET_SERROR_ESR, but in the header file this capability's name is KVM_CAP_ARM_INJECT_SERROR_ESR, so change the documentation description to make it same. Signed-off-by: Dongjiu Geng Reported-by: Andrew Jones Reviewed-by: Andrew Jones Signed-off-by: Paolo Bonzini commit 631989303b06b8fdb15ec3b88aee2d25e80d4cec Merge: ad1d69735878 976d34e2dab1 Author: Paolo Bonzini Date: Wed Aug 22 14:07:56 2018 +0200 Merge tag 'kvmarm-for-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm updates for 4.19 - Support for Group0 interrupts in guests - Cache management optimizations for ARMv8.4 systems - Userspace interface for RAS, allowing error retrival and injection - Fault path optimization - Emulated physical timer fixes - Random cleanups commit 9bd5196e5cf7431d0118d86d7d784405663e763e Author: Benjamin Herrenschmidt Date: Thu Aug 16 09:27:10 2018 +1000 platform/x86: acer-wmi: Silence "unsupported" message a bit This driver prints that "Unsupported machine..." message on every boot on ThinkPad X1 Carbon laptops (and I assume a number of other systems), which causes graphical boots to "glitch" a bit and is rather annoying ... Make it a pr_debug instead. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Andy Shevchenko commit 4bdf61ccbe76ee0c14bf228e7277072179b36ba3 Author: Yoshinori Sato Date: Wed Jul 11 18:39:09 2018 +0900 h8300: fix IRQ no Old timer handler use 24 (Compare match A). But current timer handler use 26 (Overflow). Signed-off-by: Yoshinori Sato commit 7b291be81fde312868b9fd2f6a0419b76737f230 Author: Randy Dunlap Date: Wed Jul 18 23:04:29 2018 -0700 arch/h8300: add a defconfig target Make the "defconfig" target valid for arch/h8300. Currently "make ARCH=h8300 defconfig" produces: *** Can't find default configuration "arch/h8300/defconfig"! ../scripts/kconfig/Makefile:87: recipe for target 'defconfig' failed By adding a value for KBUILD_DEFCONFIG, "make ARCH=h8300 defconfig" successfully produces a kernel .config file: *** Default configuration is based on 'edosk2674_defconfig' This is useful for Kconfig editing/testing. Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: uclinux-h8-devel@lists.sourceforge.jp (moderated for non-subscribers) Signed-off-by: Yoshinori Sato commit ce156febeed1d2731fe6e325a842cb4640931d22 Author: Randy Dunlap Date: Thu Jul 19 19:36:06 2018 -0700 arch/h8300: eliminate kgbd.c warning Drop the "const" qualifier from arch_kgdb_ops to eliminate the gcc warning (gcc version is 8.1.0). arch/h8300/kernel/kgdb.c:132:24: error: conflicting type qualifiers for 'arch_kgdb_ops' const struct kgdb_arch arch_kgdb_ops = { In file included from ../arch/h8300/kernel/kgdb.c:12: ../include/linux/kgdb.h:284:26: note: previous declaration of 'arch_kgdb_ops' was here extern struct kgdb_arch arch_kgdb_ops; Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: uclinux-h8-devel@lists.sourceforge.jp Signed-off-by: Yoshinori Sato commit cfa2d688e2cc286e97cf134e7f1c1ebb697c1c74 Author: Randy Dunlap Date: Thu Jul 19 19:34:53 2018 -0700 arch/h8300: eliminate ptrace.h warnings Add a "struct task_struct;" stub to arch/h8300's ptrace.h header to eliminate gcc warnings (gcc version is 8.1.0). ../arch/h8300/include/asm/ptrace.h:32:34: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration extern long h8300_get_reg(struct task_struct *task, int regno); ../arch/h8300/include/asm/ptrace.h:33:33: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration extern int h8300_put_reg(struct task_struct *task, int regno, Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: uclinux-h8-devel@lists.sourceforge.jp Signed-off-by: Yoshinori Sato commit 1b803a357d520164404c6262710049b09b93ed5a Author: Luc Van Oostenryck Date: Wed May 30 23:03:43 2018 +0200 h8300:let the checker know that size_t is ulong All 64bit archs use unsigned long for size_t and most 32bit archs use 'unsigned int'. By default, this is what is assumed by sparse. However, on h8300 (a 32bit arch) size_t is unsigned long which can led sparse to emit wrong warnings. Fix this by passing to sparse the flag -msize-long, telling it that size_t is unsigned long. Signed-off-by: Luc Van Oostenryck Signed-off-by: Yoshinori Sato commit 9819d4e47e88af3d7f082af61b55cb381f23f1a1 Author: Will Deacon Date: Fri Jun 1 17:06:21 2018 +0100 h8300: Don't include linux/kernel.h in asm/atomic.h linux/kernel.h isn't needed by asm/atomic.h and will result in circular dependencies when the asm-generic atomic bitops are built around the tomic_long_t interface. Remove the broad include and replace it with linux/compiler.h for READ_ONCE etc and asm/irqflags.h for arch_local_irq_save etc. Cc: Yoshinori Sato Signed-off-by: Will Deacon Signed-off-by: Yoshinori Sato commit ec3d5f1658f44538907b149d6396453e0ceedc60 Author: Rob Herring Date: Tue Jun 19 15:40:54 2018 -0600 h8300: remove unnecessary of_platform_populate call The DT core will call of_platform_populate, so it is not necessary for arch specific code to call it unless there are custom match entries, auxdata or parent device. Neither of those apply here, so remove the call. Cc: Yoshinori Sato Cc: uclinux-h8-devel@lists.sourceforge.jp Signed-off-by: Rob Herring Signed-off-by: Yoshinori Sato commit 5743ee22bf3f8842f2330925434a727e1044e2a1 Author: Geert Uytterhoeven Date: Thu Jun 21 21:24:44 2018 +0200 h8300: Correct signature of test_bit() mm/filemap.c: In function 'clear_bit_unlock_is_negative_byte': mm/filemap.c:1181:30: warning: passing argument 2 of 'test_bit' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers] return test_bit(PG_waiters, mem); ^~~ In file included from include/linux/bitops.h:38, from include/linux/kernel.h:11, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from include/linux/dax.h:5, from mm/filemap.c:14: arch/h8300/include/asm/bitops.h:69:57: note: expected 'const long unsigned int *' but argument is of type 'volatile void *' static inline int test_bit(int nr, const unsigned long *addr) ~~~~~~~~~~~~~~~~~~~~~^~~~ Make the bitmask pointed to by the "addr" parameter volatile to fix this, like is done on other architectures. Signed-off-by: Geert Uytterhoeven Signed-off-by: Yoshinori Sato commit 558e6694cd4da8db31c2d4850c4823efa5dc77e9 Author: Yoshinori Sato Date: Mon Aug 13 10:07:46 2018 +0900 h8300: irqchip: fix warning Var "addr" type incorrect. It have interrupt controler register address. Type of void __iomem is correct. Signed-off-by: Yoshinori Sato commit c489dfefe739d37dde1cd7b26cd324607cedd934 Author: Rob Herring Date: Fri Mar 16 16:33:06 2018 -0500 h8300: switch to NO_BOOTMEM Commit 0fa1c579349f ("of/fdt: use memblock_virt_alloc for early alloc") inadvertently switched the DT unflattening allocations from memblock to bootmem which doesn't work because the unflattening happens before bootmem is initialized. Swapping the order of bootmem init and unflattening could also fix this, but removing bootmem is desired. So enable NO_BOOTMEM on h8300 like other architectures have done. Fixes: 0fa1c579349f ("of/fdt: use memblock_virt_alloc for early alloc") Cc: Yoshinori Sato Cc: uclinux-h8-devel@lists.sourceforge.jp Signed-off-by: Rob Herring Signed-off-by: Yoshinori Sato commit 811d1b0e65bed442050d62a48c39263f4c5b2d68 Author: Yoshinori Sato Date: Fri Jul 13 16:36:21 2018 +0900 h8300: gcc-8.1 fix Since gcc 8.1 does not generate an assignment statement to er 0, we had to explicitly write it. Signed-off-by: Yoshinori Sato commit 686320e94da368f5efc2003ba5de9353cf774602 Author: Yoshinori Sato Date: Thu Jul 12 23:31:45 2018 +0900 h8300: Add missing output register. Signed-off-by: Yoshinori Sato commit 1df895190233fcc30d46beca4550bcafb7b959a6 Author: Matthew Wilcox Date: Mon Jun 18 19:11:56 2018 -0400 ida: Change ida_get_new_above to return the id This calling convention makes more sense for the implementation as well as the callers. It even shaves 32 bytes off the compiled code size. Signed-off-by: Matthew Wilcox commit b03f8e43c9261878bf29d8cc1c3ba458cc98287e Author: Matthew Wilcox Date: Mon Jun 18 19:02:48 2018 -0400 ida: Remove old API Delete ida_pre_get(), ida_get_new(), ida_get_new_above() and ida_remove() from the public API. Some of these functions still exist as internal helpers, but they should not be called by consumers. Signed-off-by: Matthew Wilcox commit f272668deb9108b6118a85ffd73886b9a92c1002 Author: Matthew Wilcox Date: Mon Jun 18 18:39:28 2018 -0400 test_ida: check_ida_destroy and check_ida_alloc Move these tests from the userspace test-suite to the kernel test-suite. Also convert check_ida_random to the new API. Signed-off-by: Matthew Wilcox commit 5c78b0b1ebe16fbae39a1cada79ab067965828f5 Author: Matthew Wilcox Date: Mon Jun 18 18:10:32 2018 -0400 test_ida: Convert check_ida_conv to new API Move as much as possible to kernel space; leave the parts in user space that rely on checking memory allocation failures to detect the transition between an exceptional entry and a bitmap. Signed-off-by: Matthew Wilcox commit 161b47e31f9912947a3a72dcb161c79978a1fe04 Author: Matthew Wilcox Date: Mon Jun 18 17:25:20 2018 -0400 test_ida: Move ida_check_max Convert to new API and move to kernel space. Signed-off-by: Matthew Wilcox commit 0a3856392cff1542170b5bc37211c9a21fd0c3f6 Author: Matthew Wilcox Date: Mon Jun 18 17:23:37 2018 -0400 test_ida: Move ida_check_leaf Convert to new API and move to kernel space. Take the opportunity to test the situation a little more thoroughly (ie at different offsets). Signed-off-by: Matthew Wilcox commit 06b01113664feda7647962008e901fa540ecbf6f Author: Matthew Wilcox Date: Mon Jun 18 17:06:58 2018 -0400 idr-test: Convert ida_check_nomem to new API We can't move this test to kernel space because there's no way to force kmalloc to fail. But we can use the new API and check this works when the test is in userspace. Signed-off-by: Matthew Wilcox commit 8ab8ba38d48867aac01812e18f48fc9173ccd400 Author: Matthew Wilcox Date: Mon Jun 18 16:59:29 2018 -0400 ida: Start new test_ida module Start transitioning the IDA tests into kernel space. Framework heavily cribbed from test_xarray.c. Signed-off-by: Matthew Wilcox commit 31ff0ceeb266a4ac96f3fc8cebb85df862a22f92 Author: Matthew Wilcox Date: Tue Jun 19 01:23:04 2018 -0400 target/iscsi: Allocate session IDs from an IDA Since the session is never looked up by ID, we can use the more space-efficient IDA instead of the IDR. Signed-off-by: Matthew Wilcox commit 26abc916a898d34c5ad159315a2f683def3c5555 Author: Mike Christie Date: Thu Jul 26 12:13:49 2018 -0500 iscsi target: fix session creation failure handling The problem is that iscsi_login_zero_tsih_s1 sets conn->sess early in iscsi_login_set_conn_values. If the function fails later like when we alloc the idr it does kfree(sess) and leaves the conn->sess pointer set. iscsi_login_zero_tsih_s1 then returns -Exyz and we then call iscsi_target_login_sess_out and access the freed memory. This patch has iscsi_login_zero_tsih_s1 either completely setup the session or completely tear it down, so later in iscsi_target_login_sess_out we can just check for it being set to the connection. Cc: stable@vger.kernel.org Fixes: 0957627a9960 ("iscsi-target: Fix sess allocation leak in...") Signed-off-by: Mike Christie Acked-by: Martin K. Petersen Signed-off-by: Matthew Wilcox commit 4eb085e42fdee0314a89cd12bbd7ad67313d50dd Author: Matthew Wilcox Date: Mon Jun 18 16:00:05 2018 -0400 drm/vmwgfx: Convert to new IDA API Reorder allocation to avoid an awkward lock/unlock/lock sequence. Simpler code due to being able to use ida_alloc_max(), even if we can't eliminate the driver's spinlock. Signed-off-by: Matthew Wilcox Reviewed-by: Sinclair Yeh commit 485258b44854a6ea08bd32c3296729cc1c64dc30 Author: Matthew Wilcox Date: Mon Jun 18 15:41:48 2018 -0400 dmaengine: Convert to new IDA API Simpler and shorter code. Signed-off-by: Matthew Wilcox Acked-by: Vinod Koul commit cd38049e48f0d6ae151339b8882c3510a6ca6eb5 Author: Matthew Wilcox Date: Mon Jun 18 09:34:34 2018 -0400 ppc: Convert vas ID allocation to new IDA API Removes a custom spinlock and simplifies the code. Also fix an error where we could allocate one ID too many. Signed-off-by: Matthew Wilcox commit 5a2ab034396c063ceed167076424cf37d17cdc01 Author: Matthew Wilcox Date: Mon Jun 18 08:35:52 2018 -0400 media: Convert entity ID allocation to new IDA API Removes a call to ida_pre_get(). Signed-off-by: Matthew Wilcox Reviewed-by: Sakari Ailus Acked-by: Mauro Carvalho Chehab commit b3fa64170e21393b5790be89ab16cdfe1f5bddbc Author: Matthew Wilcox Date: Mon Jun 18 08:26:32 2018 -0400 ppc: Convert mmu context allocation to new IDA API ida_alloc_range is the perfect fit for this use case. Eliminates a custom spinlock, a call to ida_pre_get and a local check for the allocated ID exceeding a maximum. Signed-off-by: Matthew Wilcox Reviewed-by: Nicholas Piggin commit 6e77cc471090a2f37802cb328bffe4ce56f4ce18 Author: Matthew Wilcox Date: Sun Jun 17 05:37:08 2018 -0400 Convert net_namespace to new IDA API Signed-off-by: Matthew Wilcox commit 4c9ca2fd7c402c8eab6e949899af04bc3c249b2b Author: Matthew Wilcox Date: Mon Jun 11 15:53:18 2018 -0400 cb710: Convert to new IDA API Eliminates the custom spinlock and the call to ida_pre_get. Signed-off-by: Matthew Wilcox Acked-by: Michał Mirosław commit 37ae133c2e079d50d6198a4a230732e5016676de Author: Matthew Wilcox Date: Mon Jun 11 15:46:46 2018 -0400 rsxx: Convert to new IDA API Eliminate the custom spinlock and the call to ida_pre_get. Also add a call to ida_free() in the card remove routine, which I believe fixes a bug in this driver. Signed-off-by: Matthew Wilcox commit 5963e78d0cb6d5950cb22c1c0a9a31067483933d Author: Matthew Wilcox Date: Mon Jun 11 15:41:25 2018 -0400 osd: Convert to new IDA API Slightly simpler code. Signed-off-by: Matthew Wilcox commit 9401508012e2044ce841a57bc453c5746b671851 Author: Matthew Wilcox Date: Mon Jun 11 15:26:27 2018 -0400 sd: Convert to new IDA API Allows us to remove an explicit spinlock. Signed-off-by: Matthew Wilcox commit 0f0a0e54a2a15174535349db3a22355a6b1cf5fa Author: Matthew Wilcox Date: Mon Jun 11 15:17:58 2018 -0400 devpts: Convert to new IDA API ida_alloc_max() matches what this driver wants to do. Also removes a call to ida_pre_get(). We no longer need the protection of the mutex, so convert pty_count to an atomic_t and remove the mutex entirely. Signed-off-by: Matthew Wilcox commit 169b480e4c8b7409119458ebfb755283a5fc9826 Author: Matthew Wilcox Date: Mon Jun 11 12:31:36 2018 -0400 fs: Convert namespace IDAs to new API We don't need to keep track of the starting value; the IDA is efficient. Signed-off-by: Matthew Wilcox commit 5a66847e4471be8250da9fadb8d400f1947b9872 Author: Matthew Wilcox Date: Mon Jun 11 12:03:31 2018 -0400 fs: Convert unnamed_dev_ida to new API The new API is much easier for this user. Also add kerneldoc for get_anon_bdev(). Signed-off-by: Matthew Wilcox commit 3aed4bc1e591959733b4e939e9965e65ffdff603 Author: Matthew Wilcox Date: Wed Mar 21 16:49:06 2018 -0400 mtip32xx: Convert to new IDA API Removes a use of ida_pre_get() and a personalised spinlock. Signed-off-by: Matthew Wilcox Reviewed-by: Johannes Thumshirn commit 5ade60dda43c8906d4554374226c2eb11cc2ffba Author: Matthew Wilcox Date: Tue Mar 20 17:07:11 2018 -0400 ida: Add new API Add ida_alloc(), ida_alloc_min(), ida_alloc_max(), ida_alloc_range() and ida_free(). The ida_alloc_max() and ida_alloc_range() functions differ from ida_simple_get() in that they take an inclusive 'max' parameter instead of an exclusive 'end' parameter. Callers are about evenly split whether they'd like inclusive or exclusive parameters and 'max' is easier to document than 'end'. Change the IDA allocation to first attempt to allocate a bit using existing memory, and only allocate memory afterwards. Also change the behaviour of 'min' > INT_MAX from being a BUG() to returning -ENOSPC. Leave compatibility wrappers in place for ida_simple_get() and ida_simple_remove() to avoid changing all callers. Signed-off-by: Matthew Wilcox commit 50d97d50715a8664f6bddc18211279cd74b8c3bf Author: Matthew Wilcox Date: Thu Jun 21 15:36:45 2018 -0400 ida: Lock the IDA in ida_destroy The user has no need to handle locking between ida_simple_get() and ida_simple_remove(). They shouldn't be forced to think about whether ida_destroy() might be called at the same time as any of their other IDA manipulation calls. Improve the documnetation while I'm in here. Signed-off-by: Matthew Wilcox commit 76f070b4135563165c523ab560056b7a9353e2f2 Author: Matthew Wilcox Date: Sat Aug 18 07:05:50 2018 -0400 radix-tree: Fix UBSAN warning get_slot_offset() can be called with a NULL 'parent' argument. In this case, the calculated value will not be used, but calculating it is undefined. Rather than fixing the caller (__radix_tree_delete) to not call get_slot_offset(), make get_slot_offset() robust against being called with a NULL parent. Signed-off-by: Matthew Wilcox commit d1c0d5e3c63d61226a75f24d5c35fe20755f0180 Author: Matthew Wilcox Date: Sat May 19 16:30:54 2018 -0400 radix tree test suite: Enable ubsan Add support for the undefined behaviour sanitizer and fix the bugs that ubsan pointed out. Nothing major, and all in the test suite, not the code. Signed-off-by: Matthew Wilcox commit c9b933521aa5795f5b9b6f9809325d6b21710d78 Author: Matthew Wilcox Date: Tue Aug 21 23:22:54 2018 -0400 radix tree test suite: Fix compilation An include of xarray.h was added to lib/idr.c without updating the test suite. Signed-off-by: Matthew Wilcox commit ad1d69735878a6bf797705b5d2a20316d35e1113 Merge: d9a185f8b496 963545357202 Author: Linus Torvalds Date: Tue Aug 21 18:47:36 2018 -0700 Merge tag 'fuse-update-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse update from Miklos Szeredi: "Various bug fixes and cleanups" * tag 'fuse-update-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: reduce allocation size for splice_write fuse: use kvmalloc to allocate array of pipe_buffer structs. fuse: convert last timespec use to timespec64 fs: fuse: Adding new return type vm_fault_t fuse: simplify fuse_abort_conn() fuse: Add missed unlock_page() to fuse_readpages_fill() fuse: Don't access pipe->buffers without pipe_lock() fuse: fix initial parallel dirops fuse: Fix oops at process_init_reply() fuse: umount should wait for all requests fuse: fix unlocked access to processing queue fuse: fix double request_end() commit d9a185f8b49678775ef56ecbdbc7b76970302897 Merge: c22fc16d172f 989974c80457 Author: Linus Torvalds Date: Tue Aug 21 18:19:09 2018 -0700 Merge tag 'ovl-update-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Pull overlayfs updates from Miklos Szeredi: "This contains two new features: - Stack file operations: this allows removal of several hacks from the VFS, proper interaction of read-only open files with copy-up, possibility to implement fs modifying ioctls properly, and others. - Metadata only copy-up: when file is on lower layer and only metadata is modified (except size) then only copy up the metadata and continue to use the data from the lower file" * tag 'ovl-update-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: (66 commits) ovl: Enable metadata only feature ovl: Do not do metacopy only for ioctl modifying file attr ovl: Do not do metadata only copy-up for truncate operation ovl: add helper to force data copy-up ovl: Check redirect on index as well ovl: Set redirect on upper inode when it is linked ovl: Set redirect on metacopy files upon rename ovl: Do not set dentry type ORIGIN for broken hardlinks ovl: Add an inode flag OVL_CONST_INO ovl: Treat metacopy dentries as type OVL_PATH_MERGE ovl: Check redirects for metacopy files ovl: Move some dir related ovl_lookup_single() code in else block ovl: Do not expose metacopy only dentry from d_real() ovl: Open file with data except for the case of fsync ovl: Add helper ovl_inode_realdata() ovl: Store lower data inode in ovl_inode ovl: Fix ovl_getattr() to get number of blocks from lower ovl: Add helper ovl_dentry_lowerdata() to get lower data dentry ovl: Copy up meta inode data from lowest data inode ovl: Modify ovl_lookup() and friends to lookup metacopy dentry ... commit c22fc16d172fba4d19ffd8f2aa8fe67edba63895 Merge: c1fecabecc35 7d5e049e72c4 Author: Linus Torvalds Date: Tue Aug 21 18:15:47 2018 -0700 Merge tag 'xfs-4.19-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: - Fix an uninitialized variable - Don't use obviously garbage AG header counters to calculate transaction reservations - Trigger icount recalculation on bad icount when mounting * tag 'xfs-4.19-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: fix WARN_ON_ONCE on uninitialized variable xfs: sanity check ag header values in xrep_calc_ag_resblks xfs: recalculate summary counters at mount time if icount is bad commit c1fecabecc352e40f99e6c5d7a74b8fcdfb38ae1 Merge: 99cc7ad46b62 5198a4838145 Author: Linus Torvalds Date: Tue Aug 21 18:06:27 2018 -0700 Merge tag 'for-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - Improve support for TI bq20z75 in sbs-battery - Add Qualcomm PM8xxx reboot driver - Add cros-ec USBPD charger driver - Move ds2760 battery driver from w1 to power-supply and add DT support - Misc fixes * tag 'for-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (28 commits) power: supply: bq27xxx: Update comments power: supply: max77693_charger: fix unintentional fall-through power: supply: mark expected switch fall-throughs power: supply: lego_ev3_battery: fix Vce offset power: supply: lego_ev3_battery: Don't ignore iio_read_channel_processed() return value power: supply: ds2760_battery: add devicetree probing power: supply: ds2760_battery: merge ds2760 supply driver with its w1 slave companion w1: core: match sub-nodes of bus masters in devicetree dt-bindings: w1: document bindings for ds2760 battery monitor dt-bindings: w1: document generic onewire bindings power: supply: adp5061: Fix a couple off by ones dt-bindings: power: reset: qcom: Add resin binding adp5061: New driver for ADP5061 I2C battery charger power: generic-adc-battery: check for duplicate properties copied from iio channels power: generic-adc-battery: fix out-of-bounds write when copying channel properties power: supply: axp288_charger: Fix initial constant_charge_current value power: supply: ab8500: stop using getnstimeofday64() power: gemini-poweroff: Avoid more spurious poweroffs power: vexpress: fix corruption in notifier registration power: remove possible deadlock when unregistering power_supply ... commit 99cc7ad46b62ef20b0478147677bebd1157bd9cf Merge: 0214f46b3a03 19358d4488db Author: Linus Torvalds Date: Tue Aug 21 17:40:46 2018 -0700 Merge branch 'i2c/for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - the core has now a lockless variant of i2c_smbus_xfer. Some open coded versions of this got removed in drivers. This also enables proper SCCB support in regmap. - locking got a more precise naming. i2c_{un}lock_adapter() had to go, and we know use i2c_lock_bus() consistently with flags like I2C_LOCK_ROOT_ADAPTER and I2C_LOCK_SEGMENT to avoid ambiguity. - the gpio fault injector got a new delicate testcase - the bus recovery procedure got fixed to handle the new testcase correctly - a new quirk flag for controllers not able to handle zero length messages together with driver updates to use it - new drivers: FSI bus attached I2C masters, GENI I2C controller, Owl family S900 - and a good set of driver improvements and bugfixes * 'i2c/for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (77 commits) i2c: rcar: implement STOP and REP_START according to docs i2c: rcar: refactor private flags i2c: core: ACPI: Make acpi_gsb_i2c_read_bytes() check i2c_transfer return value i2c: core: ACPI: Properly set status byte to 0 for multi-byte writes dt-bindings: i2c: rcar: Add r8a774a1 support dt-bindings: i2c: sh_mobile: Add r8a774a1 support i2c: imx: Simplify stopped state tracking i2c: imx: Fix race condition in dma read i2c: pasemi: remove hardcoded bus numbers on smbus i2c: designware: Add SPDX license tag i2c: designware: Convert to use struct i2c_timings i2c: core: Parse SDA hold time from firmware i2c: designware-pcidrv: Mark expected switch fall-through i2c: amd8111: Mark expected switch fall-through i2c: sh_mobile: use core to detect 'no zero length read' quirk i2c: xlr: use core to detect 'no zero length' quirk i2c: rcar: use core to detect 'no zero length' quirk i2c: stu300: use core to detect 'no zero length' quirk i2c: pmcmsp: use core to detect 'no zero length' quirk i2c: mxs: use core to detect 'no zero length' quirk ... commit 0a6b29230ec336189bab32498df3f06c8a6944d8 Author: Dan Carpenter Date: Thu Aug 2 11:38:23 2018 +0300 apparmor: fix an error code in __aa_create_ns() We should return error pointers in this function. Returning NULL results in a NULL dereference in the caller. Fixes: 73688d1ed0b8 ("apparmor: refactor prepare_ns() and make usable from different views") Signed-off-by: Dan Carpenter Signed-off-by: John Johansen commit 845b397a7771f2d3504beff5521f452be0d22eec Author: Arnd Bergmann Date: Tue Aug 21 16:20:44 2018 +0200 IB/ucm: fix UCM link error Building UCM with CONFIG_INFINIBAND_USER_ACCESS=m results in a set of link errors including: drivers/infiniband/core/ucm.o: In function `ib_ucm_event_handler': ucm.c:(.text+0x6dc): undefined reference to `ib_copy_path_rec_to_user' drivers/infiniband/core/ucma.o: In function `ucma_event_handler': ucma.c:(.text+0xdc0): undefined reference to `ib_copy_ah_attr_to_user' To get it to build-test again, this makes the option itself a tristate, which lets Kconfig figure out the dependency correctly. Fixes: 486edfb1039d ("IB/ucm: Fix compiling ucm.c") Signed-off-by: Arnd Bergmann Signed-off-by: Jason Gunthorpe commit 864d39df09b43f9d09d80bc29d8e8888294b3c4b Author: Greg Edwards Date: Wed Aug 8 13:29:55 2018 -0600 vhost/scsi: increase VHOST_SCSI_PREALLOC_PROT_SGLS to 2048 The current value of VHOST_SCSI_PREALLOC_PROT_SGLS is too small to accommodate larger I/Os, e.g. 16-32 MiB, when the VIRTIO_SCSI_F_T10_PI feature bit is negotiated and the backing store supports T10 PI. vhost-scsi rejects the command with errors like: [ 59.581317] vhost_scsi_calc_sgls: requested sgl_count: 1820 exceeds pre-allocated max_sgls: 512 Signed-off-by: Greg Edwards Signed-off-by: Michael S. Tsirkin commit 84f3396b718dfac59a5fe328aea34bac93f2fc9c Author: Greg Edwards Date: Fri Aug 10 10:45:49 2018 -0600 vhost: allow vhost-scsi driver to be built-in It's useful to allow vhost-scsi to be built-in when testing vhost in L1 + L2 VMs and booting L1 VM with QEMU '-kernel' option. Signed-off-by: Greg Edwards Signed-off-by: Michael S. Tsirkin commit 69599206ea9a3f8f2e94d46580579cbf9d08ad6c Author: Suzuki K Poulose Date: Wed Jul 18 10:18:45 2018 +0100 virtio: pci-legacy: Validate queue pfn Legacy PCI over virtio uses a 32bit PFN for the queue. If the queue pfn is too large to fit in 32bits, which we could hit on arm64 systems with 52bit physical addresses (even with 64K page size), we simply miss out a proper link to the other side of the queue. Add a check to validate the PFN, rather than silently breaking the devices. Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Marc Zyngier Cc: Christoffer Dall Cc: Peter Maydel Cc: Jean-Philippe Brucker Signed-off-by: Suzuki K Poulose Signed-off-by: Michael S. Tsirkin commit 3fc92a96c2b7efdb7fc4f856713e2ab7439757f6 Author: Suzuki K Poulose Date: Wed Jul 18 10:18:44 2018 +0100 virtio: mmio-v1: Validate queue PFN virtio-mmio with virtio-v1 uses a 32bit PFN for the queue. If the queue pfn is too large to fit in 32bits, which we could hit on arm64 systems with 52bit physical addresses (even with 64K page size), we simply miss out a proper link to the other side of the queue. Add a check to validate the PFN, rather than silently breaking the devices. Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Marc Zyngier Cc: Christoffer Dall Cc: Peter Maydel Cc: Jean-Philippe Brucker Signed-off-by: Suzuki K Poulose Signed-off-by: Michael S. Tsirkin commit 71994620bb25a8b109388fefa9e99a28e355255a Author: Wei Wang Date: Thu Aug 16 15:50:58 2018 +0800 virtio_balloon: replace oom notifier with shrinker The OOM notifier is getting deprecated to use for the reasons: - As a callout from the oom context, it is too subtle and easy to generate bugs and corner cases which are hard to track; - It is called too late (after the reclaiming has been performed). Drivers with large amuont of reclaimable memory is expected to release them at an early stage of memory pressure; - The notifier callback isn't aware of oom contrains; Link: https://lkml.org/lkml/2018/7/12/314 This patch replaces the virtio-balloon oom notifier with a shrinker to release balloon pages on memory pressure. The balloon pages are given back to mm adaptively by returning the number of pages that the reclaimer is asking for (i.e. sc->nr_to_scan). Currently the max possible value of sc->nr_to_scan passed to the balloon shrinker is SHRINK_BATCH, which is 128. This is smaller than the limitation that only VIRTIO_BALLOON_ARRAY_PFNS_MAX (256) pages can be returned via one invocation of leak_balloon. But this patch still considers the case that SHRINK_BATCH or shrinker->batch could be changed to a value larger than VIRTIO_BALLOON_ARRAY_PFNS_MAX, which will need to do multiple invocations of leak_balloon. Historically, the feature VIRTIO_BALLOON_F_DEFLATE_ON_OOM has been used to release balloon pages on OOM. We continue to use this feature bit for the shrinker, so the shrinker is only registered when this feature bit has been negotiated with host. Signed-off-by: Wei Wang Cc: Michael S. Tsirkin Cc: Michal Hocko Cc: Andrew Morton Cc: Tetsuo Handa Signed-off-by: Michael S. Tsirkin commit c51d8fca0ce368c707fd090e0324f3ba40931d0a Author: Wei Wang Date: Thu Aug 16 15:50:57 2018 +0800 virtio-balloon: kzalloc the vb struct Zero all the vb fields at alloaction, so that we don't need to zero-initialize each field one by one later. Signed-off-by: Wei Wang Cc: Michael S. Tsirkin Cc: Tetsuo Handa Signed-off-by: Michael S. Tsirkin commit 74cf5b169c4c197a8c66feaf1a98bb009fa306f8 Author: Wei Wang Date: Thu Aug 16 15:50:56 2018 +0800 virtio-balloon: remove BUG() in init_vqs It's a bit overkill to use BUG when failing to add an entry to the stats_vq in init_vqs. So remove it and just return the error to the caller to bail out nicely. Signed-off-by: Wei Wang Cc: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin commit 0214f46b3a0383d6e33c297e7706216b6a550e4b Merge: 40fafdcbcd7a 84fe4cc09abc Author: Linus Torvalds Date: Tue Aug 21 13:47:29 2018 -0700 Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull core signal handling updates from Eric Biederman: "It was observed that a periodic timer in combination with a sufficiently expensive fork could prevent fork from every completing. This contains the changes to remove the need for that restart. This set of changes is split into several parts: - The first part makes PIDTYPE_TGID a proper pid type instead something only for very special cases. The part starts using PIDTYPE_TGID enough so that in __send_signal where signals are actually delivered we know if the signal is being sent to a a group of processes or just a single process. - With that prep work out of the way the logic in fork is modified so that fork logically makes signals received while it is running appear to be received after the fork completes" * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (22 commits) signal: Don't send signals to tasks that don't exist signal: Don't restart fork when signals come in. fork: Have new threads join on-going signal group stops fork: Skip setting TIF_SIGPENDING in ptrace_init_task signal: Add calculate_sigpending() fork: Unconditionally exit if a fatal signal is pending fork: Move and describe why the code examines PIDNS_ADDING signal: Push pid type down into complete_signal. signal: Push pid type down into __send_signal signal: Push pid type down into send_signal signal: Pass pid type into do_send_sig_info signal: Pass pid type into send_sigio_to_task & send_sigurg_to_task signal: Pass pid type into group_send_sig_info signal: Pass pid and pid type into send_sigqueue posix-timers: Noralize good_sigevent signal: Use PIDTYPE_TGID to clearly store where file signals will be sent pid: Implement PIDTYPE_TGID pids: Move the pgrp and session pid pointers from task_struct to signal_struct kvm: Don't open code task_pid in kvm_vcpu_ioctl pids: Compute task_tgid using signal->leader_pid ... commit 01ac7c4c2e035bc8d0d47dc880bbc25bf562a648 Merge: 5ef499cd571c 2a3eb51e30b9 9d64b539b738 3df6f61fff49 Author: Rafael J. Wysocki Date: Tue Aug 21 22:39:24 2018 +0200 Merge branches 'pm-cpufreq', 'pm-pci' and 'pm-sleep' Merge fixes for the ondemand and conservative cpufreq governors, PCI power management and system wakeup framework. * pm-cpufreq: cpufreq: governor: Avoid accessing invalid governor_data * pm-pci: PCI / ACPI / PM: Resume all bridges on suspend-to-RAM * pm-sleep: PM / sleep: wakeup: Fix build error caused by missing SRCU support commit d1f3ab5b13c03b6f32d5379cd3cd5c7e50ce612c Merge: f317c7dc12b7 b5c16c7925fb Author: Rafael J. Wysocki Date: Tue Aug 21 22:36:31 2018 +0200 Merge branch 'acpi-pmic' Merge a CrystalCove PMIC driver update. * acpi-pmic: ACPI / PMIC: CrystalCove: Extend PMOP support to support all possible fields commit 40fafdcbcd7a74e80ab0229b35bf6e497831e28f Merge: 5e26830990a9 40291fb75123 Author: Linus Torvalds Date: Tue Aug 21 13:33:33 2018 -0700 Merge tag 'chrome-platform-for-linus-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform Pull chrome platform updates from Benson Leung. Everything but the SPDX identifier updates actually came in earlier through the MFD merge. * tag 'chrome-platform-for-linus-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform: platform/chrome: chromeos_tbmc - fix SPDX identifier commit 5e26830990a9e8816b6854f77c550f1c847d89d8 Merge: 778a33959a8a c4347b05440f Author: Linus Torvalds Date: Tue Aug 21 13:18:22 2018 -0700 Merge tag 'microblaze-v4.19-rc1' of git://git.monstr.eu/linux-2.6-microblaze Pull arch/microblaze updates from Michal Simek: - use generic noncoherent direct mapping - use LDFLAGS instead of LD - pci error path fix - remove incorrect comments * tag 'microblaze-v4.19-rc1' of git://git.monstr.eu/linux-2.6-microblaze: microblaze/PCI: Remove stale pcibios_align_resource() comment microblaze: delete wrong comment about machine_early_init microblaze: add endianness options to LDFLAGS instead of LD microblaze: remove consistent_sync and consistent_sync_page microblaze: use generic dma_noncoherent_ops microblaze: warn if of_iomap() failed commit 96c26e04581667e3cd17ed74c2fc3499afea49b8 Author: Prashant Bhole Date: Mon Aug 20 09:54:25 2018 +0900 xsk: fix return value of xdp_umem_assign_dev() s/ENOTSUPP/EOPNOTSUPP/ in function umem_assign_dev(). This function's return value is directly returned by xsk_bind(). EOPNOTSUPP is bind()'s possible return value. Fixes: f734607e819b ("xsk: refactor xdp_umem_assign_dev()") Signed-off-by: Prashant Bhole Acked-by: Song Liu Acked-by: Björn Töpel Signed-off-by: Daniel Borkmann commit 78c452fe70681c6e6383916a264e0bf010e98058 Merge: b93c1b5ac864 5ffe57da29b3 Author: David S. Miller Date: Tue Aug 21 12:45:45 2018 -0700 Merge branch 'net_sched-fixes' Cong Wang says: ==================== net_sched: pending clean up and bug fixes This patchset aims to clean up and fixes some bugs in current merge window, this is why it is targeting -net. Patch 1-5 are clean up Vlad's patches merged in current merge window, patch 6 is just a trivial cleanup. Patch 7 reverts a lockdep warning fix and patch 8 provides a better fix for it. Patch 9 fixes a potential deadlock found by me during code review. Please see each patch for details. ==================== Signed-off-by: Cong Wang commit 5ffe57da29b3802baeddaa40909682bbb4cb4d48 Author: Cong Wang Date: Sun Aug 19 12:22:13 2018 -0700 act_ife: fix a potential deadlock use_all_metadata() acquires read_lock(&ife_mod_lock), then calls add_metainfo() which calls find_ife_oplist() which acquires the same lock again. Deadlock! Introduce __add_metainfo() which accepts struct tcf_meta_ops *ops as an additional parameter and let its callers to decide how to find it. For use_all_metadata(), it already has ops, no need to find it again, just call __add_metainfo() directly. And, as ife_mod_lock is only needed for find_ife_oplist(), this means we can make non-atomic allocation for populate_metalist() now. Fixes: 817e9f2c5c26 ("act_ife: acquire ife_mod_lock before reading ifeoplist") Cc: Jamal Hadi Salim Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 4e407ff5cd67ec76eeeea1deec227b7982dc7f66 Author: Cong Wang Date: Sun Aug 19 12:22:12 2018 -0700 act_ife: move tcfa_lock down to where necessary The only time we need to take tcfa_lock is when adding a new metainfo to an existing ife->metalist. We don't need to take tcfa_lock so early and so broadly in tcf_ife_init(). This means we can always take ife_mod_lock first, avoid the reverse locking ordering warning as reported by Vlad. Reported-by: Vlad Buslov Tested-by: Vlad Buslov Cc: Vlad Buslov Cc: Jamal Hadi Salim Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 8ce5be1c899d31f3cd047e5f707cd9dbfb81e076 Author: Cong Wang Date: Sun Aug 19 12:22:11 2018 -0700 Revert "net: sched: act_ife: disable bh when taking ife_mod_lock" This reverts commit 42c625a486f3 ("net: sched: act_ife: disable bh when taking ife_mod_lock"), because what ife_mod_lock protects is absolutely not touched in rate est timer BH context, they have no race. A better fix is following up. Cc: Vlad Buslov Cc: Jamal Hadi Salim Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit a0c2e90fe131d9a7440ac05c9c31fc35dfac2fa8 Author: Cong Wang Date: Sun Aug 19 12:22:10 2018 -0700 net_sched: remove unused tcfa_capab Cc: Jamal Hadi Salim Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 244cd96adb5f5ab39551081fb1f9009a54bb12ee Author: Cong Wang Date: Sun Aug 19 12:22:09 2018 -0700 net_sched: remove list_head from tc_action After commit 90b73b77d08e, list_head is no longer needed. Now we just need to convert the list iteration to array iteration for drivers. Fixes: 90b73b77d08e ("net: sched: change action API to use array of pointers to actions") Cc: Jiri Pirko Cc: Vlad Buslov Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 7d485c451fc82f8ae431cdb379521bc6d0641064 Author: Cong Wang Date: Sun Aug 19 12:22:08 2018 -0700 net_sched: remove unused tcf_idr_check() tcf_idr_check() is replaced by tcf_idr_check_alloc(), and __tcf_idr_check() now can be folded into tcf_idr_search(). Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action") Cc: Jiri Pirko Cc: Vlad Buslov Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit b144e7ec51a132eac00a68bf897b6349d810022f Author: Cong Wang Date: Sun Aug 19 12:22:07 2018 -0700 net_sched: remove unused parameter for tcf_action_delete() Fixes: 16af6067392c ("net: sched: implement reference counted action release") Cc: Jiri Pirko Cc: Vlad Buslov Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 97a3f84f2c84f81b859aedd2c186df09c2ee21a6 Author: Cong Wang Date: Sun Aug 19 12:22:06 2018 -0700 net_sched: remove unnecessary ops->delete() All ops->delete() wants is getting the tn->idrinfo, but we already have tc_action before calling ops->delete(), and tc_action has a pointer ->idrinfo. More importantly, each type of action does the same thing, that is, just calling tcf_idr_delete_index(). So it can be just removed. Fixes: b409074e6693 ("net: sched: add 'delete' function to action ops") Cc: Jiri Pirko Cc: Vlad Buslov Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit edfaf94fa705181eeb2fe0c36c0b902dedbd40f1 Author: Cong Wang Date: Sun Aug 19 12:22:05 2018 -0700 net_sched: improve and refactor tcf_action_put_many() tcf_action_put_many() is mostly called to clean up actions on failure path, but tcf_action_put_many(&actions[acts_deleted]) is used in the ugliest way: it passes a slice of the array and uses an additional NULL at the end to avoid out-of-bound access. acts_deleted is completely unnecessary since we can teach tcf_action_put_many() scan the whole array and checks against NULL pointer. Which also means tcf_action_delete() should set deleted action pointers to NULL to avoid double free. Fixes: 90b73b77d08e ("net: sched: change action API to use array of pointers to actions") Cc: Jiri Pirko Cc: Vlad Buslov Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit c84ca616b1260949782f408271336f0eda056c61 Author: Masahiro Yamada Date: Tue Aug 21 02:08:28 2018 +0900 sparc: fix KBUILD_DEFCONFIG for ARCH=sparc32 As commit 5ba800962a80 ("kbuild: update ARCH alias info for sparc") addressed, SPARC accepts ARCH=sparc32 as an alias. However, arch/sparc/Makefile wrongly sets KBUILD_DEFCONFIG, then sparc64_defconfig is chosen as the base configuration for ARCH=sparc32. $ make ARCH=sparc32 defconfig *** Default configuration is based on 'sparc64_defconfig' # # configuration written to .config # Fix the logic to choose sparc64_defconfig only when ARCH=sparc64. Signed-off-by: Masahiro Yamada Signed-off-by: David S. Miller commit aa59fa7806ef6cd63fdf78d802e960d9cb516f39 Merge: dfaad39cec85 8818d89cf8fb Author: David S. Miller Date: Tue Aug 21 12:40:26 2018 -0700 Merge branch 'sparc32-NO_BOOTMEM' Mike Rapoport says: ==================== sparc32: switch to NO_BOOTMEM These patches convert sparc32 to use memblock + nobootmem. I've made the conversion as simple as possible, just enough to allow moving HAVE_MEMBLOCK and NO_BOOTMEM to the common SPARC configuration. v2 changes: * split whitespace changes to a separate patch * address Sam's comments [1] [1] https://lkml.org/lkml/2018/8/2/403 ==================== Signed-off-by: David S. Miller commit 8818d89cf8fb4df617412c45a983773d3720a97a Author: Mike Rapoport Date: Mon Aug 6 13:52:35 2018 +0300 sparc32: split ramdisk detection and reservation to a helper function The detection and reservation of ramdisk memory were separated to allow bootmem bitmap initialization after the ramdisk boundaries are detected. Since the bootmem initialization is removed, the reservation of ramdisk memory is done immediately after its boundaries are found. Split the entire block into a separate helper function. Signed-off-by: Mike Rapoport Suggested-by: Sam Ravnborg Reviewed-by: Sam Ravnborg Signed-off-by: David S. Miller commit cca079ef8ac29a7c02192d2bad2ffe4c0c5ffdd0 Author: Mike Rapoport Date: Mon Aug 6 13:52:34 2018 +0300 sparc32: switch to NO_BOOTMEM Each populated sparc_phys_bank is added to memblock.memory. The reserve_bootmem() calls are replaced with memblock_reserve(), and the bootmem bitmap initialization is droppped. Signed-off-by: Mike Rapoport Reviewed-by: Sam Ravnborg Signed-off-by: David S. Miller commit 60ef86168247b051f2ef35ee24cb9d61c14844e7 Author: Mike Rapoport Date: Mon Aug 6 13:52:33 2018 +0300 sparc: mm/init_32: kill trailing whitespace Signed-off-by: Mike Rapoport Signed-off-by: David S. Miller commit dfaad39cec85790f87161705c14027a63be44496 Author: Christoph Hellwig Date: Tue Jul 31 10:02:04 2018 +0200 sparc: use generic dma_noncoherent_ops Switch to the generic noncoherent direct mapping implementation. This removes the previous sync_single_for_device implementation, which looks bogus given that no syncing is happening in the similar but more important map_single case. Signed-off-by: Christoph Hellwig Acked-by: Sam Ravnborg Signed-off-by: David S. Miller commit 9d1d02ff36783f954a206dfbf7943b7f2057f58b Author: Leo (Sunpeng) Li Date: Thu Aug 16 15:44:39 2018 -0400 drm/amd/display: Don't build DCN1 when kcov is enabled DCN1 contains code that utilizes fp math. When CONFIG_KCOV_INSTRUMENT_ALL and CONFIG_KCOV_ENABLE_COMPARISONS are enabled, build errors are found. See this earlier patch for details: https://lists.freedesktop.org/archives/dri-devel/2018-August/186131.html As a short term solution, disable CONFIG_DRM_AMD_DC_DCN1_0 when KCOV_INSTRUMENT_ALL and KCOV_ENABLE_COMPARISONS are enabled. In addition, make it a fully derived config, taking into account CONFIG_X86. Acked-by: Alex Deucher Acked-by: Arnd Bergmann Reviewed-by: Michel Dänzer Signed-off-by: Leo (Sunpeng) Li Signed-off-by: Alex Deucher commit dc37a9a08d5760e405ffdd94ec6bbb6efededba6 Author: Leo (Sunpeng) Li Date: Thu Aug 16 15:44:38 2018 -0400 Revert "drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86" This reverts commit 8624c3c4dbfe24fc6740687236a2e196f5f4bfb0. We need CONFIG_DRM_AMD_DC_DCN1_0 to guard code that is using fp math. Acked-by: Alex Deucher Reviewed-by: Michel Dänzer Signed-off-by: Leo (Sunpeng) Li Signed-off-by: Alex Deucher commit 95f05a3a2e6895ecfd8b4f64b5d6c6cf0b6a3f4a Author: Alex Deucher Date: Thu Aug 16 15:35:21 2018 -0500 drm/amdgpu/display: disable eDP fast boot optimization on DCE8 Seems to cause blank screens. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106940 Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit e6f8d26ebbcf45ff964abf7d9d2430401638067c Author: Christian König Date: Tue Aug 14 09:37:06 2018 +0200 drm/amdgpu: fix amdgpu_amdkfd_remove_eviction_fence v3 Fix quite a number of bugs here. Unfortunately only compile tested. v2: fix copy&paste error v3: fix 80 chars issue in comment Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit c4aed87630d41ee54e2ee23d4583c3dd423296dd Author: Christian König Date: Fri Aug 17 19:38:33 2018 +0200 drm/amdgpu: fix incorrect use of drm_file->pid That's the PID of the creator of the file (usually the X server) and not the end user of the file. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher CC: stable@vger.kernel.org commit bce31d4c1ae8865d6382e3a27b07b4bb8e020ade Author: Christian König Date: Fri Aug 17 19:36:08 2018 +0200 drm/amdgpu: fix incorrect use of fcheck The usage isn't RCU protected. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher CC: stable@vger.kernel.org commit 11a88c2e92feca1ed3fba19fa375f76d3c75f5d5 Author: Yintian Tao Date: Mon Aug 20 11:11:48 2018 +0800 drm/powerplay: enable dpm under pass-through Repeat enable dpm under pass-through because there is no actually hardware-fini and real power-off when guest vm shutdown or reboot. Otherwise, under pass-through it will be failed to populate populate and upload SCLK MCLK DPM levels due to zero of pcie_speed_table.count. Signed-off-by: Yintian Tao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fa1d04e9a896c468f0882425f5ba452a4b424108 Author: Yintian Tao Date: Wed Aug 15 16:20:55 2018 +0800 drm/amdgpu: access register without KIQ there is no need to access register such as mmSMC_IND_INDEX_11 and mmSMC_IND_DATA_11 through KIQ because they are VF-copy. Signed-off-by: Yintian Tao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit bde0781561dcd3a7e9d01e9cb9fd410f025f7ee3 Author: Evan Quan Date: Fri Aug 17 09:31:56 2018 +0800 drm/amdgpu: set correct base for THM/NBIF/MP1 IP Set correct address base for vega20. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 39a3cd6783521cb9ec463033ea6a24e42c2d5508 Author: Dmytro Laktyushkin Date: Wed Aug 8 18:27:55 2018 -0400 drm/amd/display: fix dentist did ranges Dentist did ranges were incomplete as max setting has an unusual divider step up of 66. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 66b198ffc934089c24f8a12436d46fdc283eaed8 Author: Dmytro Laktyushkin Date: Tue Aug 7 14:43:20 2018 -0400 drm/amd/display: make dp_ss_off optional dp_ss_off flag doesn't need to be set, so we create a link_init function if it is needed by an asic Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 16747b21098505bea3b7bc7009d8e16921a7ca65 Author: Dmytro Laktyushkin Date: Thu Aug 2 11:43:36 2018 -0400 drm/amd/display: fix dp_ss_control vbios flag parsing dp_ss_control = 0 means ss is off, we had a typo where we would double not dp_ss_control while setting dp_ss_off flag Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 8f7040b8f252fae4ca5d2453e9f50b78cf6b834f Author: Samson Tam Date: Mon Jul 30 12:22:35 2018 -0400 drm/amd/display: Do not retain link settings Do not retrain link settings if lane count and link rate are both unknown. Causes driver to be stuck reading VBIOS register after removing emulated connection. Signed-off-by: Samson Tam Reviewed-by: Anthony Koo Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 690d9163bf4b8563a2682e619f938e6a0443947f Author: Paul Burton Date: Tue Aug 21 12:12:59 2018 -0700 MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7 Some versions of GCC suboptimally generate calls to the __multi3() intrinsic for MIPS64r6 builds, resulting in link failures due to the missing function: LD vmlinux.o MODPOST vmlinux.o kernel/bpf/verifier.o: In function `kmalloc_array': include/linux/slab.h:631: undefined reference to `__multi3' fs/select.o: In function `kmalloc_array': include/linux/slab.h:631: undefined reference to `__multi3' ... We already have a workaround for this in which we provide the instrinsic, but we do so selectively for GCC 7 only. Unfortunately the issue occurs with older GCC versions too - it has been observed with both GCC 5.4.0 & GCC 6.4.0. MIPSr6 support was introduced in GCC 5, so all major GCC versions prior to GCC 8 are affected and we extend our workaround accordingly to all MIPS64r6 builds using GCC versions older than GCC 8. Signed-off-by: Paul Burton Reported-by: Vladimir Kondratiev Fixes: ebabcf17bcd7 ("MIPS: Implement __multi3 for GCC7 MIPS64r6 builds") Patchwork: https://patchwork.linux-mips.org/patch/20297/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # 4.15+ commit b93c1b5ac8643cc08bb74fa8ae21d6c63dfcb23d Author: Stephen Hemminger Date: Tue Aug 21 10:40:38 2018 -0700 hv_netvsc: ignore devices that are not PCI Registering another device with same MAC address (such as TAP, VPN or DPDK KNI) will confuse the VF autobinding logic. Restrict the search to only run if the device is known to be a PCI attached VF. Fixes: e8ff40d4bff1 ("hv_netvsc: improve VF device matching") Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 0af4c8be97a14d1df8a78b4993a09e8dff545a18 Author: Trond Myklebust Date: Tue Aug 21 10:25:34 2018 -0400 pNFS: Remove unwanted optimisation of layoutget If we knew that the file was empty, we wouldn't be asking for a layout. Any optimisation here is already done before calling pnfs_update_layout(). As it stands, we sometimes end up doing an unnecessary inband read to the MDS even when holding a layout. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 1c1aeaf1432f51b57341741dcb76a3825d63a168 Author: Trond Myklebust Date: Tue Aug 21 10:25:33 2018 -0400 pNFS/flexfiles: ff_layout_pg_init_read should exit on error If we get an error while retrieving the layout, then we should report it rather than falling back to I/O through the MDS. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 906d441febc0de974b2a6ef848a8f058f3bfada3 Author: Paul Burton Date: Mon Aug 20 15:36:18 2018 -0700 MIPS: Workaround GCC __builtin_unreachable reordering bug Some versions of GCC for the MIPS architecture suffer from a bug which can lead to instructions from beyond an unreachable statement being incorrectly reordered into earlier branch delay slots if the unreachable statement is the only content of a case in a switch statement. This can lead to seemingly random behaviour, such as invalid memory accesses from incorrectly reordered loads or stores, and link failures on microMIPS builds. See this potential GCC fix for details: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00360.html Runtime problems resulting from this bug were initially observed using a maltasmvp_defconfig v4.4 kernel built using GCC 4.9.2 (from a Codescape SDK 2015.06-05 toolchain), with the result being an address exception taken after log messages about the L1 caches (during probe of the L2 cache): Initmem setup node 0 [mem 0x0000000080000000-0x000000009fffffff] VPE topology {2,2} total 4 Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. Primary data cache 64kB, 4-way, PIPT, no aliases, linesize 32 bytes This is early enough that the kernel exception vectors are not in use, so any further output depends upon the bootloader. This is reproducible in QEMU where no further output occurs - ie. the system hangs here. Given the nature of the bug it may potentially be hit with differing symptoms. The bug is known to affect GCC versions as recent as 7.3, and it is unclear whether GCC 8 fixed it or just happens not to encounter the bug in the testcase found at the link above due to differing optimizations. This bug can be worked around by placing a volatile asm statement, which GCC is prevented from reordering past, prior to the __builtin_unreachable call. That was actually done already for other reasons by commit 173a3efd3edb ("bug.h: work around GCC PR82365 in BUG()"), but creates problems for microMIPS builds due to the lack of a .insn directive. The microMIPS ISA allows for interlinking with regular MIPS32 code by repurposing bit 0 of the program counter as an ISA mode bit. To switch modes one changes the value of this bit in the PC. However typical branch instructions encode their offsets as multiples of 2-byte instruction halfwords, which means they cannot change ISA mode - this must be done using either an indirect branch (a jump-register in MIPS terminology) or a dedicated jalx instruction. In order to ensure that regular branches don't attempt to target code in a different ISA which they can't actually switch to, the linker will check that branch targets are code in the same ISA as the branch. Unfortunately our empty asm volatile statements don't qualify as code, and the link for microMIPS builds fails with errors such as: arch/mips/mm/dma-default.s:3265: Error: branch to a symbol in another ISA mode arch/mips/mm/dma-default.s:5027: Error: branch to a symbol in another ISA mode Resolve this by adding a .insn directive within the asm statement which declares that what comes next is code. This may or may not be true, since we don't really know what comes next, but as this code is in an unreachable path anyway that doesn't matter since we won't execute it. We do this in asm/compiler.h & select CONFIG_HAVE_ARCH_COMPILER_H in order to have this included by linux/compiler_types.h after linux/compiler-gcc.h. This will result in asm/compiler.h being included in all C compilations via the -include linux/compiler_types.h argument in c_flags, which should be harmless. Signed-off-by: Paul Burton Fixes: 173a3efd3edb ("bug.h: work around GCC PR82365 in BUG()") Patchwork: https://patchwork.linux-mips.org/patch/20270/ Cc: James Hogan Cc: Ralf Baechle Cc: Arnd Bergmann Cc: linux-mips@linux-mips.org commit 04f264d3a8b0eb25d378127bd78c3c9a0261c828 Author: Paul Burton Date: Mon Aug 20 15:36:17 2018 -0700 compiler.h: Allow arch-specific asm/compiler.h We have a need to override the definition of barrier_before_unreachable() for MIPS, which means we either need to add architecture-specific code into linux/compiler-gcc.h or we need to allow the architecture to provide a header that can define the macro before the generic definition. The latter seems like the better approach. A straightforward approach to the per-arch header is to make use of asm-generic to provide a default empty header & adjust architectures which don't need anything specific to make use of that by adding the header to generic-y. Unfortunately this doesn't work so well due to commit 28128c61e08e ("kconfig.h: Include compiler types to avoid missed struct attributes") which caused linux/compiler_types.h to be included in the compilation of every C file via the -include linux/kconfig.h flag in c_flags. Because the -include flag is present for all C files we compile, we need the architecture-provided header to be present before any C files are compiled. If any C files can be compiled prior to the asm-generic header wrappers being generated then we hit a build failure due to missing header. Such cases do exist - one pointed out by the kbuild test robot is the compilation of arch/ia64/kernel/nr-irqs.c, which occurs as part of the archprepare target [1]. This leaves us with a few options: 1) Use generic-y & fix any build failures we find by enforcing ordering such that the asm-generic target occurs before any C compilation, such that linux/compiler_types.h can always include the generated asm-generic wrapper which in turn includes the empty asm-generic header. This would rely on us finding all the problematic cases - I don't know for sure that the ia64 issue is the only one. 2) Add an actual empty header to each architecture, so that we don't need the generated asm-generic wrapper. This seems messy. 3) Give up & add #ifdef CONFIG_MIPS or similar to linux/compiler_types.h. This seems messy too. 4) Include the arch header only when it's actually needed, removing the need for the asm-generic wrapper for all other architectures. This patch allows us to use approach 4, by including an asm/compiler.h header from linux/compiler_types.h after the inclusion of the compiler-specific linux/compiler-*.h header(s). We do this conditionally, only when CONFIG_HAVE_ARCH_COMPILER_H is selected, in order to avoid the need for asm-generic wrappers & the associated build ordering issue described above. The asm/compiler.h header is included after the generic linux/compiler-*.h header(s) for consistency with the way linux/compiler-intel.h & linux/compiler-clang.h are included after the linux/compiler-gcc.h header that they override. [1] https://lists.01.org/pipermail/kbuild-all/2018-August/051175.html Signed-off-by: Paul Burton Reviewed-by: Masahiro Yamada Patchwork: https://patchwork.linux-mips.org/patch/20269/ Cc: Arnd Bergmann Cc: James Hogan Cc: Masahiro Yamada Cc: Ralf Baechle Cc: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org Cc: linux-mips@linux-mips.org commit 1e7da865b8c0428b9bcb18ba05ba0f6f47bcfdb4 Author: Colin Ian King Date: Tue Aug 21 10:12:48 2018 +0100 block/DAC960.c: make some arrays static const, shrinks object size Don't populate the arrays ReadCacheStatus, WriteCacheStatus and SenseErrors on the stack but instead make them static const. Makes the object code smaller by 47 bytes: Before: text data bss dec hex filename 160974 34628 832 196434 2ff52 drivers/block/DAC960.o After: text data bss dec hex filename 160671 34884 832 196387 2ff23 drivers/block/DAC960.o (gcc version 8.2.0 x86_64) Signed-off-by: Colin Ian King Signed-off-by: Jens Axboe commit c27f1e2e9f29563cb093e96261e87c1ef83aeb98 Author: Yue Haibing Date: Tue Aug 21 14:05:42 2018 +0000 rds: tcp: remove duplicated include from tcp.c Remove duplicated include. Signed-off-by: Yue Haibing Acked-by: Sowmini Varadhan Signed-off-by: David S. Miller commit 093dee661d6004738c4cbcbf48835c1e6c6ebae3 Author: Yue Haibing Date: Tue Aug 21 13:58:08 2018 +0000 sch_cake: Remove unused including Remove including that don't need it. Signed-off-by: Yue Haibing Signed-off-by: David S. Miller commit f5bbbbe4d63577026f908a809f22f5fd5a90ea1f Author: Jianchao Wang Date: Tue Aug 21 15:15:04 2018 +0800 blk-mq: sync the update nr_hw_queues with blk_mq_queue_tag_busy_iter For blk-mq, part_in_flight/rw will invoke blk_mq_in_flight/rw to account the inflight requests. It will access the queue_hw_ctx and nr_hw_queues w/o any protection. When updating nr_hw_queues and blk_mq_in_flight/rw occur concurrently, panic comes up. Before update nr_hw_queues, the q will be frozen. So we could use q_usage_counter to avoid the race. percpu_ref_is_zero is used here so that we will not miss any in-flight request. The access to nr_hw_queues and queue_hw_ctx in blk_mq_queue_tag_busy_iter are under rcu critical section, __blk_mq_update_nr_hw_queues could use synchronize_rcu to ensure the zeroed q_usage_counter to be globally visible. Signed-off-by: Jianchao Wang Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit d48ece209f82c9ce07be942441b53d3fa3664936 Author: Jianchao Wang Date: Tue Aug 21 15:15:03 2018 +0800 blk-mq: init hctx sched after update ctx and hctx mapping Currently, when update nr_hw_queues, IO scheduler's init_hctx will be invoked before the mapping between ctx and hctx is adapted correctly by blk_mq_map_swqueue. The IO scheduler init_hctx (kyber) may depend on this mapping and get wrong result and panic finally. A simply way to fix this is that switch the IO scheduler to 'none' before update the nr_hw_queues, and then switch it back after update nr_hw_queues. blk_mq_sched_init_/exit_hctx are removed due to nobody use them any more. Signed-off-by: Jianchao Wang Signed-off-by: Jens Axboe commit addb3ffbca66954fb1d1791d2db2153c403f81af Author: Gustavo A. R. Silva Date: Tue Aug 14 10:10:31 2018 -0500 Bluetooth: mediatek: Fix memory leak In case memory resources for *fw* were allocated, release them before return. Addresses-Coverity-ID: 1472611 ("Resource leak") Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices") Signed-off-by: Gustavo A. R. Silva Acked-by: Sean Wang Signed-off-by: Marcel Holtmann commit 51474eff2bc2777061ab3658e014a37dc9d7a775 Author: Hans de Goede Date: Tue Aug 14 11:57:07 2018 +0200 Bluetooth: Make BT_HCIUART_RTL configuration option depend on ACPI At the moment we only support ACPI enumeration for serial port attached RTL bluetooth controllers. This commit adds a dependency on ACPI to the BT_HCIUART_RTL configuration option, fixing the following warning when ACPI is not enabled: drivers/bluetooth/hci_h5.c:920:22: warning: 'rtl_vnd' defined but not used Cc: Arnd Bergmann Reported-by: Arnd Bergmann Signed-off-by: Hans de Goede Acked-by: Arnd Bergmann Acked-by: Geert Uytterhoeven Signed-off-by: Marcel Holtmann commit 26caddf274cf1e89fd4ce44ab2b8dbc7a7f97681 Author: Adrian Hunter Date: Tue Aug 21 15:05:55 2018 +0300 mmc: block: Fix unsupported parallel dispatch of requests The mmc block driver does not support parallel dispatch of requests. In normal circumstances, all requests are anyway funneled through a single work item, so parallel dispatch never happens. However it can happen if there is no elevator. Fix that by detecting if a dispatch is in progress and returning busy (BLK_STS_RESOURCE) in that case Fixes: 81196976ed94 ("mmc: block: Add blk-mq support") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 17e96d8516e31c3cb52cb8e2ee79d1d2e6948c11 Author: Ludovic Desroches Date: Mon Aug 20 10:54:45 2018 +0200 mmc: android-goldfish: fix bad logic of sg_copy_{from,to}_buffer conversion The conversion to sg_copy_{from,to}_buffer has been done in the wrong way. sg_copy_to_buffer is a copy from an SG list to a linear buffer so it can't replace memcpy(dest, host->virt_base, data->sg->length) where dest is the virtual address of the SG. Same for sg_copy_from_buffer but in the opposite way. Signed-off-by: Ludovic Desroches Suggested-by: Douglas Gilbert Fixes: 53d7e098ba08 ("mmc: android-goldfish: use sg_copy_{from,to}_buffer") Signed-off-by: Ulf Hansson commit 19f5e9e015675fcdbf2c20e804b2e84e80201454 Author: Ludovic Desroches Date: Mon Aug 20 10:54:44 2018 +0200 mmc: atmel-mci: fix bad logic of sg_copy_{from,to}_buffer conversion The conversion to sg_copy_{from,to}_buffer has been done in the wrong way. sg_copy_to_buffer is a copy from an SG list to a linear buffer so it can't replace memcpy(buf + offset, &value, remaining) where buf is the virtual address of the SG. Same for sg_copy_to_buffer but in the opposite way. Signed-off-by: Ludovic Desroches Suggested-by: Douglas Gilbert Fixes: 5b4277814e3f ("mmc: atmel-mci: use sg_copy_{from,to}_buffer") Signed-off-by: Ulf Hansson commit 4ec84835900b6eceb5b49f9ffeec9a0916ba43d6 Author: Heiko Carstens Date: Tue Aug 21 13:37:57 2018 +0200 s390: remove gcc version check (4.3 or newer) git commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") raised the minimum gcc version to 4.6. Therefore remove the s390 specific gcc 4.3 version check, which wasn't sufficient anyway. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit 3d8f60d38e249f989a7fca9c2370c31c3d5487e1 Author: Harald Freudenberger Date: Mon Aug 20 15:27:45 2018 +0200 s390/zcrypt: hex string mask improvements for apmask and aqmask. The sysfs attributes /sys/bus/ap/apmask and /sys/bus/ap/aqmask and the kernel command line arguments ap.apm and ap.aqm get an improvement of the value parsing with this patch: The mask values are bitmaps in big endian order starting with bit 0. So adapter number 0 is the leftmost bit, mask is 0x8000... The sysfs attributes and the kernel command line accept 2 different formats: - Absolute hex string starting with 0x like "0x12345678" does set the mask starting from left to right. If the given string is shorter than the mask it is padded with 0s on the right. If the string is longer than the mask an error comes back (EINVAL). - Relative format - a concatenation (done with ',') of the terms +[-] or -[-]. may be any valid number (hex, decimal or octal) in the range 0...255. Here are some examples: "+0-15,+32,-128,-0xFF" "-0-255,+1-16,+0x128" Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 9161a864ff88e800de50494da095af19832e9583 Author: Masami Hiramatsu Date: Tue Aug 21 22:04:57 2018 +0900 tracing/kprobes: Fix to check notrace function with correct range Fix within_notrace_func() to check notrace function correctly. Since the ftrace_location_range(start, end) function checks the range inclusively (start <= ftrace-loc <= end), the end address must not include the entry address of next function. However, within_notrace_func() uses kallsyms_lookup_size_offset() to get the function size and calculate the end address from adding the size to the entry address. This means the end address is the entry address of the next function. In the result, within_notrace_func() fails to find notrace function if the next function of the target function is ftraced. Let's subtract 1 from the end address so that ftrace_location_range() can check it correctly. Link: http://lkml.kernel.org/r/153485669706.16611.17726752296213785504.stgit@devbox Fixes: commit 45408c4f9250 ("tracing: kprobes: Prohibit probing on notrace function") Reported-by: Michael Rodin Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 6b7dca401cb148603158119c89319c85228a2a61 Author: Masami Hiramatsu Date: Tue Aug 21 16:27:58 2018 +0900 tracing: Allow gcov profiling on only ftrace subsystem Add GCOV_PROFILE_FTRACE to allow gcov profiling on only files in ftrace subsystem. This config option will be used for checking kselftest/ftrace coverage. Link: http://lkml.kernel.org/r/153483647755.32472.4746349899604275441.stgit@devbox Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit dbf2a4b1ffab2867505be3b24221d5efa2200c91 Author: Helge Deller Date: Tue Aug 21 08:15:42 2018 +0200 parisc: Add hardware description to stack traces Signed-off-by: Helge Deller commit 8801ccb9fa524c195322c26b6d44e99827772bde Author: Helge Deller Date: Tue Aug 21 14:31:32 2018 +0200 parisc: Fix boot failure of 64-bit kernel Commit c8921d72e390 ("parisc: Fix and improve kernel stack unwinding") broke booting of 64-bit kernels. On 64-bit kernels function pointers are actually function descriptors which require dereferencing. In this patch we instead declare functions in assembly code which are referenced from C-code as external data pointers with the ENTRY() macro and thus can use a simple external reference to the functions. Signed-off-by: Helge Deller Fixes: c8921d72e390 ("parisc: Fix and improve kernel stack unwinding") commit 8a328ac1f9ebfc7621f76bbb27aa0382cc5b393d Author: Kailang Yang Date: Tue Aug 21 16:54:41 2018 +0800 ALSA: hda/realtek - Fix HP Headset Mic can't record This patch will fix HP workstation Headset Mic not recording. Signed-off-by: Kailang Yang Tested-by: Hui Wang Signed-off-by: Takashi Iwai commit 09a4e0be5826aa66c4ce9954841f110ffe63ef4f Author: Eric Sandeen Date: Thu Aug 16 21:44:02 2018 -0500 isofs: reject hardware sector size > 2048 bytes The largest block size supported by isofs is ISOFS_BLOCK_SIZE (2048), but isofs_fill_super calls sb_min_blocksize and sets the blocksize to the device's logical block size if it's larger than what we ended up with after option parsing. If for some reason we try to mount a hard 4k device as an isofs filesystem, we'll set opt.blocksize to 4096, and when we try to read the superblock we found via: block = iso_blknum << (ISOFS_BLOCK_BITS - s->s_blocksize_bits) with s_blocksize_bits greater than ISOFS_BLOCK_BITS, we'll have a negative shift and the bread will fail somewhat cryptically: isofs_fill_super: bread failed, dev=sda, iso_blknum=17, block=-2147483648 It seems best to just catch and clearly reject mounts of such a device. Reported-by: Bryan Gurney Signed-off-by: Eric Sandeen Signed-off-by: Jan Kara commit c4347b05440f4d72f8084c82c86d16863f69c8a2 Author: Lorenzo Pieralisi Date: Mon Aug 20 10:47:29 2018 +0100 microblaze/PCI: Remove stale pcibios_align_resource() comment commit 01cf9d524ff0 ("microblaze/PCI: Support generic Xilinx AXI PCIe Host Bridge IP driver") and commit ecf677c8dcaa ("PCI: Add a generic weak pcibios_align_resource()") first patched then removed pcibios_align_resource() from the microblaze architecture code but failed to remove the comment that was added to it. Remove it since it has now become stale and it is quite confusing. Signed-off-by: Lorenzo Pieralisi Cc: Palmer Dabbelt Cc: Bjorn Helgaas Cc: Bharat Kumar Gogada Cc: Michal Simek Signed-off-by: Michal Simek commit 6aa58d8ad20a3323f42274c25820a6f54192422d Author: Chao Yu Date: Tue Aug 14 22:37:25 2018 +0800 f2fs: readahead encrypted block during GC During GC, for each encrypted block, we will read block synchronously into meta page, and then submit it into current cold data log area. So this block read model with 4k granularity can make poor performance, like migrating non-encrypted block, let's readahead encrypted block as well to improve migration performance. To implement this, we choose meta page that its index is old block address of the encrypted block, and readahead ciphertext into this page, later, if readaheaded page is still updated, we will load its data into target meta page, and submit the write IO. Note that for OPU, truncation, deletion, we need to invalid meta page after we invalid old block address, to make sure we won't load invalid data from target meta page during encrypted block migration. for ((i = 0; i < 1000; i++)) do { xfs_io -f /mnt/f2fs/dir/$i -c "pwrite 0 128k" -c "fsync"; } done for ((i = 0; i < 1000; i+=2)) do { rm /mnt/f2fs/dir/$i; } done ret = ioctl(fd, F2FS_IOC_GARBAGE_COLLECT, 0); Before: gc-6549 [001] d..1 214682.212797: block_rq_insert: 8,32 RA 32768 () 786400 + 64 [gc] gc-6549 [001] d..1 214682.212802: block_unplug: [gc] 1 gc-6549 [001] .... 214682.213892: block_bio_queue: 8,32 R 67494144 + 8 [gc] gc-6549 [001] .... 214682.213899: block_getrq: 8,32 R 67494144 + 8 [gc] gc-6549 [001] .... 214682.213902: block_plug: [gc] gc-6549 [001] d..1 214682.213905: block_rq_insert: 8,32 R 4096 () 67494144 + 8 [gc] gc-6549 [001] d..1 214682.213908: block_unplug: [gc] 1 gc-6549 [001] .... 214682.226405: block_bio_queue: 8,32 R 67494152 + 8 [gc] gc-6549 [001] .... 214682.226412: block_getrq: 8,32 R 67494152 + 8 [gc] gc-6549 [001] .... 214682.226414: block_plug: [gc] gc-6549 [001] d..1 214682.226417: block_rq_insert: 8,32 R 4096 () 67494152 + 8 [gc] gc-6549 [001] d..1 214682.226420: block_unplug: [gc] 1 gc-6549 [001] .... 214682.226904: block_bio_queue: 8,32 R 67494160 + 8 [gc] gc-6549 [001] .... 214682.226910: block_getrq: 8,32 R 67494160 + 8 [gc] gc-6549 [001] .... 214682.226911: block_plug: [gc] gc-6549 [001] d..1 214682.226914: block_rq_insert: 8,32 R 4096 () 67494160 + 8 [gc] gc-6549 [001] d..1 214682.226916: block_unplug: [gc] 1 After: gc-5678 [003] .... 214327.025906: block_bio_queue: 8,32 R 67493824 + 8 [gc] gc-5678 [003] .... 214327.025908: block_bio_backmerge: 8,32 R 67493824 + 8 [gc] gc-5678 [003] .... 214327.025915: block_bio_queue: 8,32 R 67493832 + 8 [gc] gc-5678 [003] .... 214327.025917: block_bio_backmerge: 8,32 R 67493832 + 8 [gc] gc-5678 [003] .... 214327.025923: block_bio_queue: 8,32 R 67493840 + 8 [gc] gc-5678 [003] .... 214327.025925: block_bio_backmerge: 8,32 R 67493840 + 8 [gc] gc-5678 [003] .... 214327.025932: block_bio_queue: 8,32 R 67493848 + 8 [gc] gc-5678 [003] .... 214327.025934: block_bio_backmerge: 8,32 R 67493848 + 8 [gc] gc-5678 [003] .... 214327.025941: block_bio_queue: 8,32 R 67493856 + 8 [gc] gc-5678 [003] .... 214327.025943: block_bio_backmerge: 8,32 R 67493856 + 8 [gc] gc-5678 [003] .... 214327.025953: block_bio_queue: 8,32 R 67493864 + 8 [gc] gc-5678 [003] .... 214327.025955: block_bio_backmerge: 8,32 R 67493864 + 8 [gc] gc-5678 [003] .... 214327.025962: block_bio_queue: 8,32 R 67493872 + 8 [gc] gc-5678 [003] .... 214327.025964: block_bio_backmerge: 8,32 R 67493872 + 8 [gc] gc-5678 [003] .... 214327.025970: block_bio_queue: 8,32 R 67493880 + 8 [gc] gc-5678 [003] .... 214327.025972: block_bio_backmerge: 8,32 R 67493880 + 8 [gc] gc-5678 [003] .... 214327.026000: block_bio_queue: 8,32 WS 34123776 + 2048 [gc] gc-5678 [003] .... 214327.026019: block_getrq: 8,32 WS 34123776 + 2048 [gc] gc-5678 [003] d..1 214327.026021: block_rq_insert: 8,32 R 131072 () 67493632 + 256 [gc] gc-5678 [003] d..1 214327.026023: block_unplug: [gc] 1 gc-5678 [003] d..1 214327.026026: block_rq_issue: 8,32 R 131072 () 67493632 + 256 [gc] gc-5678 [003] .... 214327.026046: block_plug: [gc] Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6f8d4455060dfb0e32dfb8e685b97caf4ed1be41 Author: Jaegeuk Kim Date: Wed Jul 25 12:11:56 2018 +0900 f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc The f2fs_gc() called by f2fs_balance_fs() requires to be called outside of fi->i_gc_rwsem[WRITE], since f2fs_gc() can try to grab it in a loop. If it hits the miximum retrials in GC, let's give a chance to release gc_mutex for a short time in order not to go into live lock in the worst case. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 853137cef46ccc490e6fd4b160a1c252d6459842 Author: Jaegeuk Kim Date: Thu Aug 9 17:53:34 2018 -0700 f2fs: fix performance issue observed with multi-thread sequential read This reverts the commit - "b93f771 - f2fs: remove writepages lock" to fix the drop in sequential read throughput. Test: ./tiotest -t 32 -d /data/tio_tmp -f 32 -b 524288 -k 1 -k 3 -L device: UFS Before - read throughput: 185 MB/s total read requests: 85177 (of these ~80000 are 4KB size requests). total write requests: 2546 (of these ~2208 requests are written in 512KB). After - read throughput: 758 MB/s total read requests: 2417 (of these ~2042 are 512KB reads). total write requests: 2701 (of these ~2034 requests are written in 512KB). Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2ea62630681027c455117aa471ea3ab8bb099ead Author: Srikar Dronamraju Date: Fri Aug 17 20:24:39 2018 +0530 powerpc/topology: Get topology for shared processors at boot On a shared LPAR, Phyp will not update the CPU associativity at boot time. Just after the boot system does recognize itself as a shared LPAR and trigger a request for correct CPU associativity. But by then the scheduler would have already created/destroyed its sched domains. This causes - Broken load balance across Nodes causing islands of cores. - Performance degradation esp if the system is lightly loaded - dmesg to wrongly report all CPUs to be in Node 0. - Messages in dmesg saying borken topology. - With commit 051f3ca02e46 ("sched/topology: Introduce NUMA identity node sched domain"), can cause rcu stalls at boot up. The sched_domains_numa_masks table which is used to generate cpumasks is only created at boot time just before creating sched domains and never updated. Hence, its better to get the topology correct before the sched domains are created. For example on 64 core Power 8 shared LPAR, dmesg reports Brought up 512 CPUs Node 0 CPUs: 0-511 Node 1 CPUs: Node 2 CPUs: Node 3 CPUs: Node 4 CPUs: Node 5 CPUs: Node 6 CPUs: Node 7 CPUs: Node 8 CPUs: Node 9 CPUs: Node 10 CPUs: Node 11 CPUs: ... BUG: arch topology borken the DIE domain not a subset of the NUMA domain BUG: arch topology borken the DIE domain not a subset of the NUMA domain numactl/lscpu output will still be correct with cores spreading across all nodes: Socket(s): 64 NUMA node(s): 12 Model: 2.0 (pvr 004d 0200) Model name: POWER8 (architected), altivec supported Hypervisor vendor: pHyp Virtualization type: para L1d cache: 64K L1i cache: 32K NUMA node0 CPU(s): 0-7,32-39,64-71,96-103,176-183,272-279,368-375,464-471 NUMA node1 CPU(s): 8-15,40-47,72-79,104-111,184-191,280-287,376-383,472-479 NUMA node2 CPU(s): 16-23,48-55,80-87,112-119,192-199,288-295,384-391,480-487 NUMA node3 CPU(s): 24-31,56-63,88-95,120-127,200-207,296-303,392-399,488-495 NUMA node4 CPU(s): 208-215,304-311,400-407,496-503 NUMA node5 CPU(s): 168-175,264-271,360-367,456-463 NUMA node6 CPU(s): 128-135,224-231,320-327,416-423 NUMA node7 CPU(s): 136-143,232-239,328-335,424-431 NUMA node8 CPU(s): 216-223,312-319,408-415,504-511 NUMA node9 CPU(s): 144-151,240-247,336-343,432-439 NUMA node10 CPU(s): 152-159,248-255,344-351,440-447 NUMA node11 CPU(s): 160-167,256-263,352-359,448-455 Currently on this LPAR, the scheduler detects 2 levels of Numa and created numa sched domains for all CPUs, but it finds a single DIE domain consisting of all CPUs. Hence it deletes all numa sched domains. To address this, detect the shared processor and update topology soon after CPUs are setup so that correct topology is updated just before scheduler creates sched domain. With the fix, dmesg reports: numa: Node 0 CPUs: 0-7 32-39 64-71 96-103 176-183 272-279 368-375 464-471 numa: Node 1 CPUs: 8-15 40-47 72-79 104-111 184-191 280-287 376-383 472-479 numa: Node 2 CPUs: 16-23 48-55 80-87 112-119 192-199 288-295 384-391 480-487 numa: Node 3 CPUs: 24-31 56-63 88-95 120-127 200-207 296-303 392-399 488-495 numa: Node 4 CPUs: 208-215 304-311 400-407 496-503 numa: Node 5 CPUs: 168-175 264-271 360-367 456-463 numa: Node 6 CPUs: 128-135 224-231 320-327 416-423 numa: Node 7 CPUs: 136-143 232-239 328-335 424-431 numa: Node 8 CPUs: 216-223 312-319 408-415 504-511 numa: Node 9 CPUs: 144-151 240-247 336-343 432-439 numa: Node 10 CPUs: 152-159 248-255 344-351 440-447 numa: Node 11 CPUs: 160-167 256-263 352-359 448-455 and lscpu also reports: Socket(s): 64 NUMA node(s): 12 Model: 2.0 (pvr 004d 0200) Model name: POWER8 (architected), altivec supported Hypervisor vendor: pHyp Virtualization type: para L1d cache: 64K L1i cache: 32K NUMA node0 CPU(s): 0-7,32-39,64-71,96-103,176-183,272-279,368-375,464-471 NUMA node1 CPU(s): 8-15,40-47,72-79,104-111,184-191,280-287,376-383,472-479 NUMA node2 CPU(s): 16-23,48-55,80-87,112-119,192-199,288-295,384-391,480-487 NUMA node3 CPU(s): 24-31,56-63,88-95,120-127,200-207,296-303,392-399,488-495 NUMA node4 CPU(s): 208-215,304-311,400-407,496-503 NUMA node5 CPU(s): 168-175,264-271,360-367,456-463 NUMA node6 CPU(s): 128-135,224-231,320-327,416-423 NUMA node7 CPU(s): 136-143,232-239,328-335,424-431 NUMA node8 CPU(s): 216-223,312-319,408-415,504-511 NUMA node9 CPU(s): 144-151,240-247,336-343,432-439 NUMA node10 CPU(s): 152-159,248-255,344-351,440-447 NUMA node11 CPU(s): 160-167,256-263,352-359,448-455 Reported-by: Manjunatha H R Signed-off-by: Srikar Dronamraju [mpe: Trim / format change log] Tested-by: Michael Ellerman Signed-off-by: Michael Ellerman commit d6ee76d3d37d156c479348821574b6f99d6472a1 Author: Luke Dashjr Date: Thu Aug 16 21:36:26 2018 +0000 powerpc64/ftrace: Include ftrace.h needed for enable/disable calls this_cpu_disable_ftrace and this_cpu_enable_ftrace are inlines in ftrace.h Without it included, the build fails. Fixes: a4bc64d305af ("powerpc64/ftrace: Disable ftrace during kvm entry/exit") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Luke Dashjr Acked-by: Naveen N. Rao Signed-off-by: Michael Ellerman commit 778a33959a8ad4cb1ea2f4c5119f9e1e8b9f9d9b Merge: 6b2edf27fe26 f62800992e59 Author: Linus Torvalds Date: Mon Aug 20 19:37:09 2018 -0700 Merge tag 'please-pull-noboot' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux Pull ia64 NO_BOOTMEM conversion from Tony Luck: "Mike Rapoport kindly fixed up ia64 to work with NO_BOOTMEM" * tag 'please-pull-noboot' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux: ia64: switch to NO_BOOTMEM ia64: use mem_data to detect nodes' minimal and maximal PFNs ia64: remove unused num_dma_physpages member from 'struct early_node_data' ia64: contig/paging_init: reduce code duplication commit ab08dcd724543896303eae7de6288242bbaff458 Author: Yue Haibing Date: Tue Aug 21 01:41:56 2018 +0000 rhashtable: remove duplicated include from rhashtable.c Remove duplicated include. Signed-off-by: Yue Haibing Signed-off-by: David S. Miller commit 6b2edf27fe26c73cd67b6bf5ffb23dce882e1455 Merge: 7140ad3898dd 01675e9503c4 Author: Linus Torvalds Date: Mon Aug 20 19:02:17 2018 -0700 Merge tag 'linux-kselftest-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest update from Shuah Khan: - add cgroup core selftests - fix compile warnings in android ion test - fix to bugs in exclude and skip paths in vDSO test - remove obsolete config options - add missing .gitignore file * tag 'linux-kselftest-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/ftrace: Fix kprobe string testcase to not probe notrace function selftests: mount: remove no longer needed config option selftests: cgroup: add gitignore file Add cgroup core selftests selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run selftests: vDSO - fix to exclude x86 test on non-x86 platforms selftests/android: initialize heap_type to avoid compiling warning commit 7140ad3898dd119d993aff76a8752570c4f23871 Merge: 0a78ac4b9bb1 bb730b5833b5 Author: Linus Torvalds Date: Mon Aug 20 18:32:00 2018 -0700 Merge tag 'trace-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: - Restructure of lockdep and latency tracers This is the biggest change. Joel Fernandes restructured the hooks from irqs and preemption disabling and enabling. He got rid of a lot of the preprocessor #ifdef mess that they caused. He turned both lockdep and the latency tracers to use trace events inserted in the preempt/irqs disabling paths. But unfortunately, these started to cause issues in corner cases. Thus, parts of the code was reverted back to where lockdep and the latency tracers just get called directly (without using the trace events). But because the original change cleaned up the code very nicely we kept that, as well as the trace events for preempt and irqs disabling, but they are limited to not being called in NMIs. - Have trace events use SRCU for "rcu idle" calls. This was required for the preempt/irqs off trace events. But it also had to not allow them to be called in NMI context. Waiting till Paul makes an NMI safe SRCU API. - New notrace SRCU API to allow trace events to use SRCU. - Addition of mcount-nop option support - SPDX headers replacing GPL templates. - Various other fixes and clean ups. - Some fixes are marked for stable, but were not fully tested before the merge window opened. * tag 'trace-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (44 commits) tracing: Fix SPDX format headers to use C++ style comments tracing: Add SPDX License format tags to tracing files tracing: Add SPDX License format to bpf_trace.c blktrace: Add SPDX License format header s390/ftrace: Add -mfentry and -mnop-mcount support tracing: Add -mcount-nop option support tracing: Avoid calling cc-option -mrecord-mcount for every Makefile tracing: Handle CC_FLAGS_FTRACE more accurately Uprobe: Additional argument arch_uprobe to uprobe_write_opcode() Uprobes: Simplify uprobe_register() body tracepoints: Free early tracepoints after RCU is initialized uprobes: Use synchronize_rcu() not synchronize_sched() tracing: Fix synchronizing to event changes with tracepoint_synchronize_unregister() ftrace: Remove unused pointer ftrace_swapper_pid tracing: More reverting of "tracing: Centralize preemptirq tracepoints and unify their usage" tracing/irqsoff: Handle preempt_count for different configs tracing: Partial revert of "tracing: Centralize preemptirq tracepoints and unify their usage" tracing: irqsoff: Account for additional preempt_disable trace: Use rcu_dereference_raw for hooks from trace-event subsystem tracing/kprobes: Fix within_notrace_func() to check only notrace functions ... commit 0a78ac4b9bb15b2a00dc5a5aba22b0e48834e1ad Merge: bfebeb16722d 0fcf6c02b205 Author: Linus Torvalds Date: Mon Aug 20 18:26:55 2018 -0700 Merge tag 'ceph-for-4.19-rc1' of git://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "The main things are support for cephx v2 authentication protocol and basic support for rbd images within namespaces (myself). Also included are y2038 conversion patches from Arnd, a pile of miscellaneous fixes from Chengguang and Zheng's feature bit infrastructure for the filesystem" * tag 'ceph-for-4.19-rc1' of git://github.com/ceph/ceph-client: (40 commits) ceph: don't drop message if it contains more data than expected ceph: support cephfs' own feature bits crush: fix using plain integer as NULL warning libceph: remove unnecessary non NULL check for request_key ceph: refactor error handling code in ceph_reserve_caps() ceph: refactor ceph_unreserve_caps() ceph: change to void return type for __do_request() ceph: compare fsc->max_file_size and inode->i_size for max file size limit ceph: add additional size check in ceph_setattr() ceph: add additional offset check in ceph_write_iter() ceph: add additional range check in ceph_fallocate() ceph: add new field max_file_size in ceph_fs_client libceph: weaken sizeof check in ceph_x_verify_authorizer_reply() libceph: check authorizer reply/challenge length before reading libceph: implement CEPHX_V2 calculation mode libceph: add authorizer challenge libceph: factor out encrypt_authorizer() libceph: factor out __ceph_x_decrypt() libceph: factor out __prepare_write_connect() libceph: store ceph_auth_handshake pointer in ceph_connection ... commit 80f1a0f4e0cd4bfc8a74fc1c39843a6e7b206b95 Author: David Ahern Date: Mon Aug 20 13:02:41 2018 -0700 net/ipv6: Put lwtstate when destroying fib6_info Prior to the introduction of fib6_info lwtstate was managed by the dst code. With fib6_info releasing lwtstate needs to be done when the struct is freed. Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit bfebeb16722d93caf7870b63aa7d094b6843479a Merge: 3933ec73cd9b 6b583a64fd1e Author: Linus Torvalds Date: Mon Aug 20 16:30:27 2018 -0700 Merge tag 'rtc-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "It is now possible to add custom sysfs attributes while avoiding a possible race condition. Unused code has been removed resulting in a nice reduction of the code base. And more drivers have been switched to SPDX by their maintainers. Summary: Subsystem: - new helpers to add custom sysfs attributes - struct rtc_task removal along with rtc_irq_[un]register() - rtc_irq_set_state and rtc_irq_set_freq are not exported anymore Drivers: - armada38x: reset after rtc power loss - ds1307: now supports m41t11 - isl1208: now supports isl1219 and tamper detection - pcf2127: internal SRAM support" * tag 'rtc-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (34 commits) rtc: ds1307: simplify hwmon config rtc: s5m: Add SPDX license identifier rtc: maxim: Add SPDX license identifiers rtc: isl1219: add device tree documentation rtc: isl1208: set ev-evienb bit from device tree rtc: isl1208: Add "evdet" interrupt source for isl1219 rtc: isl1208: add support for isl1219 with tamper detection rtc: sysfs: facilitate attribute add to rtc device rtc: remove struct rtc_task char: rtc: remove task handling rtc: pcf85063: preserve control register value between stop and start rtc: sh: remove unused variable rtc_dev rtc: unexport rtc_irq_set_* rtc: simplify rtc_irq_set_state/rtc_irq_set_freq rtc: remove irq_task and irq_task_lock rtc: remove rtc_irq_register/rtc_irq_unregister rtc: sh: remove dead code rtc: sa1100: don't set PIE frequency rtc: ds1307: support m41t11 variant rtc: ds1307: fix data pointer to m41t0 ... commit 3933ec73cd9bbff4a98259d0eae606af4e2850a2 Merge: 7a324b3f0535 badf58a27213 Author: Linus Torvalds Date: Mon Aug 20 16:10:47 2018 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching Pull livepatching updates from Jiri Kosina: "Code cleanups from Kamalesh Babulal" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching: livepatch: Validate module/old func name length livepatch: Remove reliable stacktrace check in klp_try_switch_task() commit 7a324b3f0535ceb0f6676fa20ca2a7b6213008cb Merge: 61c4fc1eaf73 1429b47bfe98 Author: Linus Torvalds Date: Mon Aug 20 15:59:01 2018 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID updates from Jiri Kosina: - touch_max detection improvements and quirk handling fixes in wacom driver from Jason Gerecke and Ping Cheng - Palm rejection from Dmitry Torokhov and _dial support from Benjamin Tissoires for hid-multitouch driver - Low voltage support for i2c-hid driver from Stephen Boyd - Guitar-Hero support from Nicolas Adenis-Lamarre - other assorted small fixes and device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (40 commits) HID: intel_ish-hid: tx_buf memory leak on probe/remove HID: intel-ish-hid: Prevent loading of driver on Mehlow HID: cougar: Add support for the Cougar 500k Gaming Keyboard HID: cougar: make compare_device_paths reusable HID: intel-ish-hid: remove redundant variable num_frags HID: multitouch: handle palm for touchscreens HID: multitouch: touchscreens also use confidence reports HID: multitouch: report MT_TOOL_PALM for non-confident touches HID: microsoft: support the Surface Dial HID: core: do not upper bound the collection stack HID: input: enable Totem on the Dell Canvas 27 HID: multitouch: remove one copy of values HID: multitouch: ditch mt_report_id HID: multitouch: store a per application quirks value HID: multitouch: Store per collection multitouch data HID: multitouch: make sure the static list of class is not changed input: add MT_TOOL_DIAL HID: elan: Add support for touchpad on the Toshiba Click Mini L9W HID: elan: Add USB-id for HP x2 10-n000nd touchpad HID: elan: Add a flag for selecting if the touchpad has a LED ... commit 61c4fc1eaf736344904767d201b0d4f7a2ebaf79 Merge: 532c2b926dda 633786736ed5 Author: Linus Torvalds Date: Mon Aug 20 15:41:37 2018 -0700 Merge tag 'backlight-next-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "Core Framework: - Remove unused/obsolete code/comments New Functionality: - Allow less granular brightness specification for high-res PWMs; pwm_bl - Align brightness {inc,dec}rements with that perceived by the human-eye; pwm_bl Fix-ups: - Prepare for the introduction of -Wimplicit-fall-through; adp8860_bl Bug Fixes: - Fix uninitialised variable; pwm_bl" * tag 'backlight-next-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: pwm_bl: Fix uninitialized variable backlight: adp8860: Mark expected switch fall-through backlight: Remove obsolete comment for ->state dt-bindings: pwm-backlight: Move brightness-levels to optional backlight: pwm_bl: Compute brightness of LED linearly to human eye dt-bindings: pwm-backlight: Add a num-interpolation-steps property backlight: pwm_bl: Linear interpolation between brightness-levels commit 532c2b926dda11174700333a5dda5e3c0ee383f2 Merge: 8786583db541 d2c9281c184b Author: Linus Torvalds Date: Mon Aug 20 15:38:44 2018 -0700 Merge tag 'mfd-next-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Add Cirrus Logic Madera Codec (CS47L35, CS47L85 and CS47L90/91) driver - Add ChromeOS EC CEC driver - Add ROHM BD71837 PMIC driver New Device Support: - Add support for Dialog Semi DA9063L PMIC variant to DA9063 - Add support for Intel Ice Lake to Intel-PLSS-PCI - Add support for X-Powers AXP806 to AXP20x New Functionality: - Add support for USB Charging to the ChromeOS Embedded Controller - Add support for HDMI CEC to the ChromeOS Embedded Controller - Add support for HDMI CEC to Intel HDMI - Add support for accessory detection to Madera devices - Allow individual pins to be configured via DT' wlf,csnaddr-pd - Provide legacy platform specific EEPROM/Watchdog commands; rave-sp Fix-upsL - Trivial renaming/spelling fixes; cros_ec, da9063-* - Convert to Managed Resources (devm_*); da9063-*, ti_am335x_tscadc - Transition to helper macros/functions; da9063-* - Constify; kempld-core - Improve error path/messages; wm8994-core - Disable IRQs locally instead of relying on USB subsystem; dln2 - Remove unused code; rave-sp - New exports; sec-core Bug Fixes: - Fix possible false I2C transaction error; arizona-core - Fix declared memory area size; hi655x-pmic - Fix checksum type; rave-sp - Fix incorrect default serial port configuration: rave-sp - Fix incorrect coherent DMA mask for sub-devices; sm501" * tag 'mfd-next-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (60 commits) mfd: madera: Add register definitions for accessory detect mfd: sm501: Set coherent_dma_mask when creating subdevices mfd: bd71837: Devicetree bindings for ROHM BD71837 PMIC mfd: bd71837: Core driver for ROHM BD71837 PMIC media: platform: cros-ec-cec: Fix dependency on MFD_CROS_EC mfd: sec-core: Export OF module alias table mfd: as3722: Disable auto-power-on when AC OK mfd: axp20x: Support AXP806 in I2C mode mfd: axp20x: Add self-working mode support for AXP806 dt-bindings: mfd: axp20x: Add "self-working" mode for AXP806 mfd: wm8994: Allow to configure CS/ADDR Pulldown from dts mfd: wm8994: Allow to configure Speaker Mode Pullup from dts mfd: rave-sp: Emulate CMD_GET_STATUS on device that don't support it mfd: rave-sp: Add legacy watchdog ping command translation mfd: rave-sp: Add legacy EEPROM access command translation mfd: rave-sp: Initialize flow control and parity of the port mfd: rave-sp: Fix incorrectly specified checksum type mfd: rave-sp: Remove unused defines mfd: hi655x: Fix regmap area declared size for hi655x mfd: ti_am335x_tscadc: Fix struct clk memory leak ... commit 8786583db54197b3859311870912f51cb3fca434 Merge: cafa0010cd51 b748f2de4b2f Author: Linus Torvalds Date: Mon Aug 20 15:28:54 2018 -0700 Merge tag 'edac_fixes_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp Pull EDAC fix from Borislav Petkov: "An urgent fix for a NULL ptr deref on machines with LRDDR4 DIMMs, from Takashi Iwai" * tag 'edac_fixes_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC: Add missing MEM_LRDDR4 entry in edac_mem_types[] commit cafa0010cd51fb711fdcb50fc55f394c5f167a0a Author: Joe Perches Date: Mon Aug 20 13:15:26 2018 -0700 Raise the minimum required gcc version to 4.6 Various architectures fail to build properly with older versions of the gcc compiler. An example from Guenter Roeck in thread [1]: > > In file included from ./include/linux/mm.h:17:0, > from ./include/linux/pid_namespace.h:7, > from ./include/linux/ptrace.h:10, > from arch/openrisc/kernel/asm-offsets.c:32: > ./include/linux/mm_types.h:497:16: error: flexible array member in otherwise empty struct > > This is just an example with gcc 4.5.1 for or32. I have seen the problem > with gcc 4.4 (for unicore32) as well. So update the minimum required version of gcc to 4.6. [1] https://lore.kernel.org/lkml/20180814170904.GA12768@roeck-us.net/ Miscellanea: - Update Documentation/process/changes.rst - Remove and consolidate version test blocks in compiler-gcc.h for versions lower than 4.6 Signed-off-by: Joe Perches Reviewed-by: Kees Cook Reviewed-by: Nick Desaulniers Signed-off-by: Linus Torvalds commit 35d231db53a60b76e218a56da30ad071d4717b56 Merge: bfd5bb6f90af 2cc15e802b25 Author: Max Filippov Date: Mon Aug 20 13:24:24 2018 -0700 Merge branch 'xtensa-dma-fixes' (early part) into xtensa-fixes This switches xtensa arch to the generic noncoherent direct mapping operations, adds support for DMA_ATTR_NO_KERNEL_MAPPING attribute and allows for platform-specific handling of coherent memory. Signed-off-by: Max Filippov commit 176eb614b118c96e7797f5ddefd10708c316f621 Author: Kai-Heng Feng Date: Mon Aug 20 12:43:51 2018 +0800 r8152: disable RX aggregation on new Dell TB16 dock There's a new Dell TB16 dock with a different iSerialNumber. Apply the same fix from commit 0b1655143df0 ("r8152: disable RX aggregation on Dell TB16 dock") to this model. BugLink: https://bugs.launchpad.net/bugs/1785780 Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit bfd5bb6f90af092aa345b15cd78143956a13c2a8 Author: Max Filippov Date: Thu Sep 10 20:51:33 2015 +0300 xtensa: add test_kc705_be variant test_kc705_be is a big-endian Xtensa core with HiFi2 instructions. Signed-off-by: Max Filippov commit 0c692569ce1f8944490869604beb99de10278a12 Author: Max Filippov Date: Mon Aug 13 20:43:10 2018 -0700 xtensa: clean up boot-elf/bootstrap.S Drop unneeded headers, rewrite literal definitions with .literal. Signed-off-by: Max Filippov commit baac1d36d15d16fc064a901918bf844a36e97b1b Author: Max Filippov Date: Mon Aug 13 18:56:37 2018 -0700 xtensa: make bootparam parsing optional A kernel may not need any boot parameters from the bootloader, allow disabling bootparam parsing in that case. Signed-off-by: Max Filippov commit 8b5163eb988067093064ecb10265da27fd000cad Author: Max Filippov Date: Mon Aug 13 18:21:08 2018 -0700 xtensa: drop variant IRQ support If an xtensa core provides an additional IRQ controller it should be treated as a separate piece of hardware and be driven by an irqchip driver. Signed-off-by: Max Filippov commit fc862ee9976f0490a20b2a2b8ae0c4fbeb7bbf13 Author: Max Filippov Date: Mon Aug 13 18:14:14 2018 -0700 xtensa: drop unneeded platform/hardware.h headers platform/hardware.h no longer supply any information for processor.h, vectors.h, setup.c or vmlinux.lds.S, don't include it. This header is now empty in the platforms/iss, so remove it altogether. Signed-off-by: Max Filippov commit 994fa1c83d658f857dacf0512e8f7db246143d26 Author: Max Filippov Date: Mon Aug 13 18:11:38 2018 -0700 xtensa: move PLATFORM_NR_IRQS to Kconfig Signed-off-by: Max Filippov commit aea731c81f998af5e45654459bac24a1c808fb22 Author: Max Filippov Date: Mon Aug 13 16:45:54 2018 -0700 xtensa: rework {CONFIG,PLATFORM}_DEFAULT_MEM_START Drop PLATFORM_DEFAULT_MEM_START from the platform/hardware.h headers. Provide definition of CONFIG_DEFAULT_MEM_START always, allow changing it only in noMMU configurations when PLATFORM_WANT_DEFAULT_MEM is selected. Change prompt and description so that it's clear that it controls PAGE_OFFSET and PHYS_OFFSET. Signed-off-by: Max Filippov commit f79e4d5f92a129a1159c973735007d4ddc8541f3 Author: Max Filippov Date: Sun Aug 12 18:32:13 2018 -0700 xtensa: drop unused {CONFIG,PLATFORM}_DEFAULT_MEM_SIZE Now that noMMU cache attributes are set up separately drop no longer used macro PLATFORM_DEFAULT_MEM_SIZE and config symbol CONFIG_DEFAULT_MEM_SIZE used for setting it. Signed-off-by: Max Filippov commit cc26ebbebde8548014d9329ac2f6cf0178181789 Author: Tony Luck Date: Mon Aug 20 09:31:04 2018 -0700 ia64: Fix kernel BUG at lib/ioremap.c:72! Commit 0bbf47eab469 ("ia64: use asm-generic/io.h") results in a BUG while booting ia64. This is because asm-generic/io.h defines PCI_IOBASE, which results in the function acpi_pci_root_remap_iospace() doing a lot of unnecessary (and wrong) things. I'd suggested an #if !CONFIG_IA64 in the functon, but Arnd suggested keeping the fix inside the arch/ia64 tree. Fixes: 0bbf47eab469 ("ia64: use asm-generic/io.h") Suggested-by: Arnd Bergman Signed-off-by: Tony Luck Signed-off-by: Linus Torvalds commit 152395fd03d4ce1e535a75cdbf58105e50587611 Author: Anson Huang Date: Tue Jul 31 00:56:49 2018 +0800 thermal: of-thermal: disable passive polling when thermal zone is disabled When thermal zone is in passive mode, disabling its mode from sysfs is NOT taking effect at all, it is still polling the temperature of the disabled thermal zone and handling all thermal trips, it makes user confused. The disabling operation should disable the thermal zone behavior completely, for both active and passive mode, this patch clears the passive_delay when thermal zone is disabled and restores it when it is enabled. Signed-off-by: Anson Huang Signed-off-by: Eduardo Valentin commit 75f2d3a0cef5cd8cd41772c9f8ada37dee9c9369 Author: Juergen Gross Date: Mon Aug 20 17:24:20 2018 +0200 x86/xen: enable early use of set_fixmap in 32-bit Xen PV guest Commit 7b25b9cb0dad83 ("x86/xen/time: Initialize pv xen time in init_hypervisor_platform()") moved the mapping of the shared info area before pagetable_init(). This breaks booting as 32-bit PV guest as the use of set_fixmap isn't possible at this time on 32-bit. This can be worked around by populating the needed PMD on 32-bit kernel earlier. In order not to reimplement populate_extra_pte() using extend_brk() for allocating new page tables extend alloc_low_pages() to do that in case the early page table pool is not yet available. Fixes: 7b25b9cb0dad83 ("x86/xen/time: Initialize pv xen time in init_hypervisor_platform()") Signed-off-by: Juergen Gross Reviewed-by: Thomas Gleixner Signed-off-by: Boris Ostrovsky commit 00f53f758d9baffef9dc3efedf534bb0dc1872eb Author: Juergen Gross Date: Mon Aug 20 15:03:30 2018 +0200 xen: remove unused hypercall functions Remove Xen hypercall functions which are used nowhere in the kernel. Signed-off-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit df11b6912f63ab86e694db5e9dee4df050f4c137 Author: Juergen Gross Date: Mon Aug 20 15:02:03 2018 +0200 x86/xen: remove unused function xen_auto_xlated_memory_setup() xen_auto_xlated_memory_setup() is a leftover from PVH V1. Remove it. Signed-off-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 166deb0f0bcdda70cfa650982777f94da273f0e4 Author: Jan Beulich Date: Mon Jun 25 04:17:35 2018 -0600 xen/ACPI: don't upload Px/Cx data for disabled processors This is unnecessary and triggers a warning in the hypervisor. Often systems have more processor entries in their ACPI tables than are actually installed/active. The ACPI_STA_DEVICE_PRESENT bit cannot be reliably used, but the ACPI_MADT_ENABLED bit can. In order to not introduce new functions in the main ACPI processor driver code, simply use acpi_get_phys_id(), which does more than we need, but which checks the MADT enabled bit in the process. Any CPU for which we can't determine the APIC ID is unlikely to work properly anyway, so the extra checks done by acpi_get_phys_id() should do no harm. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Acked-by: Rafael J. Wysocki Signed-off-by: Boris Ostrovsky commit 71dc05635983ae711694f748d006e107387f1bab Author: Jan Beulich Date: Mon Jun 25 04:45:49 2018 -0600 x86/Xen: further refine add_preferred_console() invocations As the sequence of invocations matters, add "tty" only after "hvc" when a VGA console is available (which is often the case for Dom0, but hardly ever for DomU). Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit f76c318c779a40cb23ff70d9c5d6e1771987ebba Author: Jan Beulich Date: Mon Jun 25 04:19:48 2018 -0600 xen/mcelog: eliminate redundant setting of interface version This already gets done in HYPERVISOR_mca(). Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 2197082afd4ef7139ea1bcb10b81c2dc881830a4 Author: Jan Beulich Date: Mon Jun 25 04:34:01 2018 -0600 x86/Xen: mark xen_setup_gdt() __init Its only caller is __init, so to avoid section mismatch warnings when a compiler decides to not inline the function marke this function so as well. Take the opportunity and also make the function actually use its argument: The sole caller passes in zero anyway. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit d316522d06e9894429ace4b5f99e181bde4e7bd7 Author: Kuninori Morimoto Date: Mon Aug 20 11:42:35 2018 -0700 thermal: rcar_gen3_thermal: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Reviewed-by: Geert Uytterhoeven Reviewed-by: Daniel Lezcano Reviewed-by: Niklas Söderlund Reviewed-by: Simon Horman Signed-off-by: Eduardo Valentin commit c954579087f4c0185206cfa777e697874b1e7d13 Author: Kuninori Morimoto Date: Mon Jul 30 07:56:06 2018 +0000 thermal: rcar_thermal: convert to SPDX identifiers As original license mentioned, it is GPL-2.0 in SPDX. Then, MODULE_LICENSE() should be "GPL v2" instead of "GPL". See ${LINUX}/include/linux/module.h "GPL" [GNU Public License v2 or later] "GPL v2" [GNU Public License v2] Signed-off-by: Kuninori Morimoto Reviewed-by: Daniel Lezcano Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Eduardo Valentin commit b0c41e96cfd4305636f5ed0d60650e648485c54c Merge: 9c86336c15db b310974e0419 Author: David S. Miller Date: Mon Aug 20 11:34:39 2018 -0700 Merge branch 'qed-Misc-fixes-in-the-interface-with-the-MFW' Tomer Tayar says: ==================== qed: Misc fixes in the interface with the MFW This patch series fixes several issues in the driver's interface with the management FW (MFW). v1->v2: - Fix loop counter decrement to be pre instead of post. ==================== Signed-off-by: David S. Miller commit b310974e041913231b6e3d5d475d4df55c312301 Author: Tomer Tayar Date: Mon Aug 20 00:01:45 2018 +0300 qed: Avoid sending mailbox commands when MFW is not responsive Keep sending mailbox commands to the MFW when it is not responsive ends up with a redundant amount of timeout expiries. This patch prints the MCP status on the first command which is not responded, and blocks the following commands. Since the (un)load request commands might be not responded due to other PFs, the patch also adds the option to skip the blocking upon a failure. Signed-off-by: Tomer Tayar Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit eaa50fc59e5841910987e90b0438b2643041f508 Author: Tomer Tayar Date: Mon Aug 20 00:01:44 2018 +0300 qed: Prevent a possible deadlock during driver load and unload The MFW manages an internal lock to prevent concurrent hardware (de)initialization of different PFs. This, together with the busy-waiting for the MFW's responses for commands, might lead to a deadlock during concurrent load or unload of PFs. This patch adds the option to sleep within the busy-waiting, and uses it for the (un)load requests (which are not sent from an interrupt context) to prevent the possible deadlock. Signed-off-by: Tomer Tayar Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 76271809f49056f079e202bf6513d17b0d6dd34d Author: Tomer Tayar Date: Mon Aug 20 00:01:43 2018 +0300 qed: Wait for MCP halt and resume commands to take place Successive iterations of halting and resuming the management chip (MCP) might fail, since currently the driver doesn't wait for these operations to actually take place. This patch prevents the driver from moving forward before the operations are reflected in the state register. Signed-off-by: Tomer Tayar Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit f00d25f3154b676fcea4502a25b94bd7f142ca74 Author: Tomer Tayar Date: Mon Aug 20 00:01:42 2018 +0300 qed: Wait for ready indication before rereading the shmem The MFW might be reset and re-update its shared memory. Upon the detection of such a reset the driver rereads this memory, but it has to wait till the data is valid. This patch adds the missing wait for a data ready indication. Signed-off-by: Tomer Tayar Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 2dfef650217c0e24754cd4c3abbb43e98131a7cf Author: Fabio Estevam Date: Sat Jul 28 16:17:51 2018 -0300 thermal: qoriq: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Reviewed-by: Daniel Lezcano Acked-by: Philippe Ombredanne Signed-off-by: Eduardo Valentin commit 7a3b1bf70b37b3797c8570b82a473fd5749fab8d Merge: 66eb957df4c7 e45c7aca4914 Author: Palmer Dabbelt Date: Mon Aug 20 11:32:10 2018 -0700 RISC-V: Fix sys_riscv_flush_icache This contains a pair of patches that together fix sys_riscv_flush_icache on all systems: * The first enables sys_riscv_flush_icache() for non-SMP systems. * The second fixes a bug in our syscall header that caused sys_riscv_flush_icache to never get generated. commit 1a893a5a198eff228ddc1a364830f8928b8f9ac5 Author: Fabio Estevam Date: Sat Jul 28 16:17:50 2018 -0300 thermal: qoriq: Simplify the 'site' variable assignment There is no need to assign zero to the variable 'site' and then perform a compound bitwise OR operation afterwards. Make it simpler by assigning the final 'site' value directly. Signed-off-by: Fabio Estevam Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin commit f1506a69e3e72196c7c5ce4fd420d5e1a6965ed3 Author: Fabio Estevam Date: Sat Jul 28 16:17:49 2018 -0300 thermal: qoriq: Use devm_thermal_zone_of_sensor_register() By using the managed devm_thermal_zone_of_sensor_register() we can drop the explicit call to thermal_zone_of_sensor_unregister() in the qoriq_tmu_remove() function, which simplifies the code a bit. So switch to devm_thermal_zone_of_sensor_register(). Signed-off-by: Fabio Estevam Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin commit 66eb957df4c7f60afb2bf19873f12214a2b3b62b Author: Deepa Dinamani Date: Fri Jul 6 22:42:43 2018 -0700 riscv: Delete asm/compat.h riscv does not enable CONFIG_COMPAT in default configurations: defconfig, allmodconfig and allnoconfig. Remove the asm/compat.h as it does not seem to add any value to the architecture without CONFIG_COMPAT. Now that time compat syscalls are being reused in non CONFIG_COMPAT modes, asm-generic/compat.h provides definitions for riscv 32 bit mode. Reviewed-by: Christoph Hellwig Signed-off-by: Deepa Dinamani Cc: palmer@sifive.com Cc: linux-riscv@lists.infradead.org Signed-off-by: Palmer Dabbelt commit e45c7aca4914efc8bcdd8fc231efadcdc87ae2e5 Author: Palmer Dabbelt Date: Fri Aug 3 12:27:19 2018 -0700 RISC-V: Don't use a global include guard for uapi/asm/syscalls.h This file is expected to be included multiple times in the same file in order to allow the __SYSCALL macro to generate system call tables. With a global include guard we end up missing __NR_riscv_flush_icache in the syscall table, which results in icache flushes that escape the vDSO call to not actually do anything. The fix is to move to per-#define include guards, which allows the system call tables to actually be populated. Thanks to Macrus Comstedt for finding and fixing the bug! Cc: Marcus Comstedt Signed-off-by: Palmer Dabbelt commit 7847e7052fc37fff9761347411f2838849e2146d Author: Palmer Dabbelt Date: Thu Aug 9 12:53:57 2018 -0700 RISC-V: Define sys_riscv_flush_icache when SMP=n This would be necessary to make non-SMP builds work, but there is another error in the implementation of our syscall linkage that actually just causes sys_riscv_flush_icache to never build. I've build tested this on allnoconfig and allnoconfig+SMP=y, as well as defconfig like normal. CC: Christoph Hellwig CC: Guenter Roeck In-Reply-To: <20180809055830.GA17533@infradead.org> In-Reply-To: <20180809132612.GA31058@roeck-us.net> Signed-off-by: Palmer Dabbelt commit c513de490f808d8480346f9a58e6a4a5f3de12e7 Author: Michael J. Ruhl Date: Wed Aug 15 22:54:49 2018 -0700 IB/hfi1: Invalid NUMA node information can cause a divide by zero If the system BIOS does not supply NUMA node information to the PCI devices, the NUMA node is selected by choosing the current node. This can lead to the following crash: divide error: 0000 SMP CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G IOE ------------ 3.10.0-693.21.1.el7.x86_64 #1 Hardware name: Intel Corporation S2600KP/S2600KP, BIOS SE5C610.86B.01.01.0005.101720141054 10/17/2014 Workqueue: events work_for_cpu_fn task: ffff880174480fd0 ti: ffff880174488000 task.ti: ffff880174488000 RIP: 0010: [] hfi1_dev_affinity_init+0x129/0x6a0 [hfi1] RSP: 0018:ffff88017448bbf8 EFLAGS: 00010246 RAX: 0000000000000011 RBX: ffff88107ffba6c0 RCX: ffff88085c22e130 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880824ad0000 RBP: ffff88017448bc48 R08: 0000000000000011 R09: 0000000000000002 R10: ffff8808582b6ca0 R11: 0000000000003151 R12: ffff8808582b6ca0 R13: ffff8808582b6518 R14: ffff8808582b6010 R15: 0000000000000012 FS: 0000000000000000(0000) GS:ffff88085ec00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007efc707404f0 CR3: 0000000001a02000 CR4: 00000000001607f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Call Trace: hfi1_init_dd+0x14b3/0x27a0 [hfi1] ? pcie_capability_write_word+0x46/0x70 ? hfi1_pcie_init+0xc0/0x200 [hfi1] do_init_one+0x153/0x4c0 [hfi1] ? sched_clock_cpu+0x85/0xc0 init_one+0x1b5/0x260 [hfi1] local_pci_probe+0x4a/0xb0 work_for_cpu_fn+0x1a/0x30 process_one_work+0x17f/0x440 worker_thread+0x278/0x3c0 ? manage_workers.isra.24+0x2a0/0x2a0 kthread+0xd1/0xe0 ? insert_kthread_work+0x40/0x40 ret_from_fork+0x77/0xb0 ? insert_kthread_work+0x40/0x40 If the BIOS is not supplying NUMA information: - set the default table count to 1 for all possible nodes - select node 0 (instead of current NUMA) node to get consistent performance - generate an error indicating that the BIOS should be upgraded Reviewed-by: Gary Leshner Reviewed-by: Mike Marciniszyn Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit badf58a272132c7bb953666b65ef816c1ef9efff Merge: 6e9df95b76ca 1d98a69e5cef Author: Jiri Kosina Date: Mon Aug 20 18:33:50 2018 +0200 Merge branch 'for-4.19/upstream' into for-linus commit b639186ffe9168fd1d2f95a1fff8571720739126 Author: Gustavo A. R. Silva Date: Thu Aug 16 12:21:24 2018 -0500 futex: Mark expected switch fall-throughs In preparation of enabling -Wimplicit-fallthrough, mark switch cases which fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Darren Hart Link: https://lkml.kernel.org/r/20180816172124.GA2407@embeddedor.com commit c953cc987ab87d180e1d5de2f1c217abe33aac77 Author: Dan Williams Date: Fri Jul 13 21:50:37 2018 -0700 libnvdimm, pmem: Restore page attributes when clearing errors Use clear_mce_nospec() to restore WB mode for the kernel linear mapping of a pmem page that was marked 'HWPoison'. A page with 'HWPoison' set has also been marked UC in PAT (page attribute table) via set_mce_nospec() to prevent speculative retrievals of poison. The 'HWPoison' flag is only cleared when overwriting an entire page. Signed-off-by: Dan Williams Signed-off-by: Dave Jiang commit 284ce4011ba60d6c487b668eea729b6294930806 Author: Dan Williams Date: Fri Jul 13 21:50:32 2018 -0700 x86/memory_failure: Introduce {set, clear}_mce_nospec() Currently memory_failure() returns zero if the error was handled. On that result mce_unmap_kpfn() is called to zap the page out of the kernel linear mapping to prevent speculative fetches of potentially poisoned memory. However, in the case of dax mapped devmap pages the page may be in active permanent use by the device driver, so it cannot be unmapped from the kernel. Instead of marking the page not present, marking the page UC should be sufficient for preventing poison from being pre-fetched into the cache. Convert mce_unmap_pfn() to set_mce_nospec() remapping the page as UC, to hide it from speculative accesses. Given that that persistent memory errors can be cleared by the driver, include a facility to restore the page to cacheable operation, clear_mce_nospec(). Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Borislav Petkov Cc: Cc: Acked-by: Tony Luck Signed-off-by: Dan Williams Acked-by: Ingo Molnar Signed-off-by: Dave Jiang commit 510ee090abc3dbc862bd35f5f3d8b7284a9117b4 Author: Dan Williams Date: Fri Jul 13 21:50:27 2018 -0700 x86/mm/pat: Prepare {reserve, free}_memtype() for "decoy" addresses In preparation for using set_memory_uc() instead set_memory_np() for isolating poison from speculation, teach the memtype code to sanitize physical addresses vs __PHYSICAL_MASK. The motivation for using set_memory_uc() for this case is to allow ongoing access to persistent memory pages via the pmem-driver + memcpy_mcsafe() until the poison is repaired. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Tony Luck Cc: Borislav Petkov Cc: Cc: Signed-off-by: Dan Williams Acked-by: Ingo Molnar Signed-off-by: Dave Jiang commit 1429b47bfe98e63421d207aaae8038809c3f90ce Merge: ffbeeaa460a5 d4bdf2d2ba73 Author: Jiri Kosina Date: Mon Aug 20 18:13:57 2018 +0200 Merge branch 'for-4.19/wiimote' into for-linus Guitar-Hero devices support for hid-wiimote commit ffbeeaa460a500e640aeb0f4e91311d2ca02ba72 Merge: a91ddf23e240 418b573b4313 Author: Jiri Kosina Date: Mon Aug 20 18:12:42 2018 +0200 Merge branch 'for-4.19/wacom' into for-linus Wacom driver updates: - touch_max detection improvements - quirk handling cleanup - get rid of wacom custom usages commit a91ddf23e2400140382e08eca03786c6e948af86 Merge: 78a8ad794845 7f342e9c61d7 Author: Jiri Kosina Date: Mon Aug 20 18:11:20 2018 +0200 Merge branch 'for-4.19/upstream' into for-linus Assorted small driver/core fixes. commit 78a8ad7948451f5683fc3bc2791b17094f72b96d Merge: 16501e846dd2 ea58c33d4d85 Author: Jiri Kosina Date: Mon Aug 20 18:10:33 2018 +0200 Merge branch 'for-4.19/sony' into for-linus devm_* API conversion for hid-sony commit 16501e846dd23f56a23330cd874cfbfaf60daf1a Merge: f5dd80715ae1 28a042a3b7ab Author: Jiri Kosina Date: Mon Aug 20 18:09:06 2018 +0200 Merge branch 'for-4.19/multitouch-multiaxis' into for-linus Multitouch updates: - Dial support - Palm rejection for touchscreens - a few small assorted fixes commit f5dd80715ae1f34909cb04f29b7092dfc6717ed7 Merge: 4435b5774cdf 50fa92594a2b Author: Jiri Kosina Date: Mon Aug 20 18:07:36 2018 +0200 Merge branch 'for-4.19/intel-ish' into for-linus Device-specific fixes for hid-intel-ish commit 4435b5774cdf9b3547934333e8facbb3fc1057be Merge: 5a12d86ce3a9 6136f97cd2dd Author: Jiri Kosina Date: Mon Aug 20 18:07:01 2018 +0200 Merge branch 'for-4.19/i2c-hid' into for-linus Low voltage support for i2c-hid commit 5a12d86ce3a93b6442963e5f6e6511e8f470f760 Merge: 415d2b3392d7 e7ad3dc9f4a2 Author: Jiri Kosina Date: Mon Aug 20 18:06:30 2018 +0200 Merge branch 'for-4.19/elan' into for-linus Resolution/pressure fixes and new device support for hid-elan commit 415d2b3392d7a80903e0f97f051201aa02bf20e9 Merge: 4f65245f2d17 b8e759b8f6da Author: Jiri Kosina Date: Mon Aug 20 18:05:17 2018 +0200 Merge branch 'for-4.19/cougar' into for-linus New device support for hid-cougar commit 94d7a86c21a3d6046bf4616272313cb7d525075a Author: Josh Poimboeuf Date: Tue Aug 14 12:32:19 2018 -0500 x86/kvm/vmx: Remove duplicate l1d flush definitions These are already defined higher up in the file. Fixes: 7db92e165ac8 ("x86/kvm: Move l1tf setup function") Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner Cc: Paolo Bonzini Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/d7ca03ae210d07173452aeed85ffe344301219a5.1534253536.git.jpoimboe@redhat.com commit 9df9516940a61d29aedf4d91b483ca6597e7d480 Author: Vlastimil Babka Date: Mon Aug 20 11:58:35 2018 +0200 x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit On 32bit PAE kernels on 64bit hardware with enough physical bits, l1tf_pfn_limit() will overflow unsigned long. This in turn affects max_swapfile_size() and can lead to swapon returning -EINVAL. This has been observed in a 32bit guest with 42 bits physical address size, where max_swapfile_size() overflows exactly to 1 << 32, thus zero, and produces the following warning to dmesg: [ 6.396845] Truncating oversized swap area, only using 0k out of 2047996k Fix this by using unsigned long long instead. Fixes: 17dbca119312 ("x86/speculation/l1tf: Add sysfs reporting for l1tf") Fixes: 377eeaa8e11f ("x86/speculation/l1tf: Limit swap file size to MAX_PA/2") Reported-by: Dominique Leuenberger Reported-by: Adrian Schroeter Signed-off-by: Vlastimil Babka Signed-off-by: Thomas Gleixner Acked-by: Andi Kleen Acked-by: Michal Hocko Cc: "H . Peter Anvin" Cc: Linus Torvalds Cc: Dave Hansen Cc: Michal Hocko Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180820095835.5298-1-vbabka@suse.cz commit dc76803e57cc86589c4efcb5362918f9b0c0436f Author: Rian Hunter Date: Sun Aug 19 16:08:53 2018 -0700 x86/process: Re-export start_thread() The consolidation of the start_thread() functions removed the export unintentionally. This breaks binfmt handlers built as a module. Add it back. Fixes: e634d8fc792c ("x86-64: merge the standard and compat start_thread() functions") Signed-off-by: Rian Hunter Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Vitaly Kuznetsov Cc: Joerg Roedel Cc: Dmitry Safonov Cc: Josh Poimboeuf Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180819230854.7275-1-rian@alum.mit.edu commit 704ae091b061082b37a9968621af4c290c641d50 Author: Arnd Bergmann Date: Fri Aug 17 12:01:36 2018 +0200 x86/mce: Add notifier_block forward declaration Without linux/irq.h, there is no declaration of notifier_block, leading to a build warning: In file included from arch/x86/kernel/cpu/mcheck/threshold.c:10: arch/x86/include/asm/mce.h:151:46: error: 'struct notifier_block' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] It's sufficient to declare the struct tag here, which avoids pulling in more header files. Fixes: 447ae3166702 ("x86: Don't include linux/irq.h from asm/hardirq.h") Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Cc: Nicolai Stange Cc: "H. Peter Anvin" Cc: Greg Kroah-Hartman Cc: Borislav Petkov Link: https://lkml.kernel.org/r/20180817100156.3009043-1-arnd@arndb.de commit 2e549b2ee0e358bc758480e716b881f9cabedb6a Author: Andy Lutomirski Date: Thu Aug 16 12:41:15 2018 -0700 x86/vdso: Fix vDSO build if a retpoline is emitted Currently, if the vDSO ends up containing an indirect branch or call, GCC will emit the "external thunk" style of retpoline, and it will fail to link. Fix it by building the vDSO with inline retpoline thunks. I haven't seen any reports of this triggering on an unpatched kernel. Fixes: commit 76b043848fd2 ("x86/retpoline: Add initial retpoline support") Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Acked-by: Matt Rickard Cc: Borislav Petkov Cc: Jason Vas Dias Cc: David Woodhouse Cc: Peter Zijlstra Cc: Andi Kleen Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/c76538cd3afbe19c6246c2d1715bc6a60bd63985.1534448381.git.luto@kernel.org commit 286e87718103acdf85f4ed323a37e4839a8a7c05 Author: Vishal Verma Date: Fri Aug 10 13:23:15 2018 -0600 libnvdimm: fix ars_status output length calculation Commit efda1b5d87cb ("acpi, nfit, libnvdimm: fix / harden ars_status output length handling") Introduced additional hardening for ambiguity in the ACPI spec for ars_status output sizing. However, it had a couple of cases mixed up. Where it should have been checking for (and returning) "out_field[1] - 4" it was using "out_field[1] - 8" and vice versa. This caused a four byte discrepancy in the buffer size passed on to the command handler, and in some cases, this caused memory corruption like: ./daxdev-errors.sh: line 76: 24104 Aborted (core dumped) ./daxdev-errors $busdev $region malloc(): memory corruption Program received signal SIGABRT, Aborted. [...] #5 0x00007ffff7865a2e in calloc () from /lib64/libc.so.6 #6 0x00007ffff7bc2970 in ndctl_bus_cmd_new_ars_status (ars_cap=ars_cap@entry=0x6153b0) at ars.c:136 #7 0x0000000000401644 in check_ars_status (check=0x7fffffffdeb0, bus=0x604c20) at daxdev-errors.c:144 #8 test_daxdev_clear_error (region_name=, bus_name=) at daxdev-errors.c:332 Cc: Cc: Dave Jiang Cc: Keith Busch Cc: Lukasz Dorau Cc: Dan Williams Fixes: efda1b5d87cb ("acpi, nfit, libnvdimm: fix / harden ars_status output length handling") Signed-off-by: Vishal Verma Reviewed-by: Keith Busch Signed-of-by: Dave Jiang commit 7e0bdbe5c21cb8316a694e46ad5aad339f6894a6 Author: Harald Freudenberger Date: Fri Jul 20 08:36:53 2018 +0200 s390/zcrypt: AP bus support for alternate driver(s) The current AP bus, AP devices and AP device drivers implementation uses a clearly defined mapping for binding AP devices to AP device drivers. So for example a CEX6C queue will always be bound to the cex4queue device driver. The Linux Device Driver model has no sensitivity for more than one device driver eligible for one device type. If there exist more than one drivers matching to the device type, simple all drivers are tried consecutively. There is no way to determine and influence the probing order of the drivers. With KVM there is a need to provide additional device drivers matching to the very same type of AP devices. With a simple implementation the KVM drivers run in competition to the regular drivers. Whichever 'wins' a device depends on build order and implementation details within the common Linux Device Driver Model and is not deterministic. However, a userspace process could figure out which device should be bound to which driver and sort out the correct binding by manipulating attributes in the sysfs. If for security reasons a AP device must not get bound to the 'wrong' device driver the sorting out has to be done within the Linux kernel by the AP bus code. This patch modifies the behavior of the AP bus for probing drivers for devices in a way that two sets of drivers are usable. Two new bitmasks 'apmask' and 'aqmask' are used to mark a subset of the APQN range for 'usable by the ap bus and the default drivers' or 'not usable by the default drivers and thus available for alternate drivers like vfio-xxx'. So an APQN which is addressed by this masking only the default drivers will be probed. In contrary an APQN which is not addressed by the masks will never be probed and bound to default drivers but onny to alternate drivers. Eventually the two masks give a way to divide the range of APQNs into two pools: one pool of APQNs used by the AP bus and the default drivers and thus via zcrypt drivers available to the userspace of the system. And another pool where no zcrypt drivers are bound to and which can be used by alternate drivers (like vfio-xxx) for their needs. This division is hot-plug save and makes sure a APQN assigned to an alternate driver is at no time somehow exploitable by the wrong party. The two masks are located in sysfs at /sys/bus/ap/apmask and /sys/bus/ap/aqmask. The mask syntax is exactly the same as the already existing mask attributes in the /sys/bus/ap directory (for example ap_usage_domain_mask and ap_control_domain_mask). By default all APQNs belong to the ap bus and the default drivers: cat /sys/bus/ap/apmask 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff cat /sys/bus/ap/aqmask 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff The masks can be changed at boot time with the kernel command line like this: ... ap.apmask=0xffff ap.aqmask=0x40 This would give these two pools: default drivers pool: adapter 0 - 15, domain 1 alternate drivers pool: adapter 0 - 15, all but domain 1 adapter 16-255, all domains The sysfs attributes for this two masks are writeable and an administrator is able to reconfigure the assignements on the fly by writing new mask values into. With changing the mask(s) a revision of the existing queue to driver bindings is done. So all APQNs which are bound to the 'wrong' driver are reprobed via kernel function device_reprobe() and thus the new correct driver will be assigned with respect of the changed apmask and aqmask bits. The mask values are bitmaps in big endian order starting with bit 0. So adapter number 0 is the leftmost bit, mask is 0x8000... The sysfs attributes accept 2 different formats: - Absolute hex string starting with 0x like "0x12345678" does set the mask starting from left to right. If the given string is shorter than the mask it is padded with 0s on the right. If the string is longer than the mask an error comes back (EINVAL). - '+' or '-' followed by a numerical value. Valid examples are "+1", "-13", "+0x41", "-0xff" and even "+0" and "-0". Only the addressed bit in the mask is switched on ('+') or off ('-'). This patch will also be the base for an upcoming extension to the zcrypt drivers to be able to provide additional zcrypt device nodes with filtering based on ap and aq masks. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit ac2b96f351d7d222c46e524feca03005f3fa8d75 Author: Harald Freudenberger Date: Fri Aug 17 12:36:01 2018 +0200 s390/zcrypt: code beautify Code beautify by following most of the checkpatch suggestions: - SPDX license identifier line complains by checkpatch - missing space or newline complains by checkpatch - octal numbers for permssions complains by checkpatch - renaming of static sysfs functions complains by checkpatch - fix of block comment complains by checkpatch - fix printf like calls where function name instead of %s __func__ was used - __packed instead of __attribute__((packed)) - init to zero for static variables removed - use of DEVICE_ATTR_RO and DEVICE_ATTR_RW macros No functional code changes or API changes! Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 9b97e9f555f1fe5044dc76d9212078757aa143ce Author: Harald Freudenberger Date: Fri Aug 17 09:01:09 2018 +0200 s390/zcrypt: switch return type to bool for ap_instructions_available() Function ap_instructions_available() had returntype int but in fact returned 1 for true and 0 for false. Changed returntype to bool. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 78303650e4cd873c6c4276c6fe3e768ff0b46d22 Author: Arnaldo Carvalho de Melo Date: Mon Aug 20 10:17:14 2018 -0300 tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' To bring in the change made in this cset: Fixes: a7bea8308933 ("x86/asm/64: Use 32-bit XOR to zero registers") CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o LD /tmp/build/perf/bench/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf Silencing this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S' diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S Cc: Adrian Hunter Cc: David Ahern Cc: Jan Beulich Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-sad22dudoz71qr3tsnlqtkia@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 252df177113575a66fc505169a29221d7232eb1e Author: Arnaldo Carvalho de Melo Date: Mon Aug 20 10:13:13 2018 -0300 tools arch x86: Update tools's copy of cpufeatures.h To get the changes in the following csets: 301d328a6f8b ("x86/cpufeatures: Add EPT_AD feature bit") 706d51681d63 ("x86/speculation: Support Enhanced IBRS on future CPUs") No tools were affected, copy it to silence this perf tool build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Feiner Cc: Sai Praneeth Cc: Thomas Gleixner Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-bvs8wgd5wp4lz9f0xf1iug5r@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 19358d4488db7e6a04e940730cc75909d7d1e0d8 Author: Wolfram Sang Date: Wed Aug 8 09:59:28 2018 +0200 i2c: rcar: implement STOP and REP_START according to docs When doing a REP_START after a read message, the driver used to trigger a STOP first which would then be overwritten by REP_START. This was the only stable method found when doing the last refactoring. However, this was not in accordance with the documentation. After research from our BSP team and myself, we now can implement a version which works and is according to the documentation. The new approach ensures the ICMCR register is only changed when really needed. Tested on a R-Car Gen2 (H2) and Gen3 with DMA (M3N). Signed-off-by: Hiromitsu Yamasaki Signed-off-by: Wolfram Sang Reviewed-by: Ulrich Hecht Signed-off-by: Wolfram Sang commit b07531acd55180efc95e334605f04ca1eaf4e003 Author: Wolfram Sang Date: Wed Aug 8 09:59:27 2018 +0200 i2c: rcar: refactor private flags Use BIT macro to avoid shift-31-problem, indent a little more and use GENMASK to make it easier to add new flags. Signed-off-by: Wolfram Sang Reviewed-by: Ulrich Hecht Signed-off-by: Wolfram Sang commit 0a30446c0dca3483c384b54a431cc951e15f7e79 Author: Hans de Goede Date: Sun Aug 12 12:53:21 2018 +0200 i2c: core: ACPI: Make acpi_gsb_i2c_read_bytes() check i2c_transfer return value Currently acpi_gsb_i2c_read_bytes() directly returns i2c_transfer's return value. i2c_transfer returns a value < 0 on error and 2 (for 2 successfully executed transfers) on success. But the ACPI code expects 0 on success, so currently acpi_gsb_i2c_read_bytes()'s caller does: if (status > 0) status = 0; This commit makes acpi_gsb_i2c_read_bytes() return a value which can be directly consumed by the ACPI code, mirroring acpi_gsb_i2c_write_bytes(), this commit also makes acpi_gsb_i2c_read_bytes() explitcly check that i2c_transfer returns 2, rather then accepting any value > 0. Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Signed-off-by: Wolfram Sang commit c463a158cb6c5d9a85b7d894cd4f8116e8bd6be0 Author: Hans de Goede Date: Sun Aug 12 12:53:20 2018 +0200 i2c: core: ACPI: Properly set status byte to 0 for multi-byte writes acpi_gsb_i2c_write_bytes() returns i2c_transfer()'s return value, which is the number of transfers executed on success, so 1. The ACPI code expects us to store 0 in gsb->status for success, not 1. Specifically this breaks the following code in the Thinkpad 8 DSDT: ECWR = I2CW = ECWR /* \_SB_.I2C1.BAT0.ECWR */ If ((ECST == Zero)) { ECRD = I2CR /* \_SB_.I2C1.I2CR */ } Before this commit we set ECST to 1, causing the read to never happen breaking battery monitoring on the Thinkpad 8. This commit makes acpi_gsb_i2c_write_bytes() return 0 when i2c_transfer() returns 1, so the single write transfer completed successfully, and makes it return -EIO on for other (unexpected) return values >= 0. Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Signed-off-by: Wolfram Sang commit 0857f50807709ae109b9d11d7ca88c44dc7ca99f Author: Fabrizio Castro Date: Tue Aug 14 13:32:55 2018 +0100 dt-bindings: i2c: rcar: Add r8a774a1 support Document RZ/G2M (R8A774A1) I2C compatibility with the relevant driver dt-bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Wolfram Sang commit de460c20f4d76a25555458e2ec478f01b31fa60c Author: Fabrizio Castro Date: Tue Aug 14 13:33:08 2018 +0100 dt-bindings: i2c: sh_mobile: Add r8a774a1 support Document RZ/G2M (R8A774A1) SoC bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Wolfram Sang commit d3bc0fa8411c35194f99046157e2e26fe60e1d91 Author: Jan Kara Date: Mon Aug 20 13:55:45 2018 +0200 fsnotify: fix false positive warning on inode delete When inode is getting deleted and someone else holds reference to a mark attached to the inode, we just detach the connector from the inode. In that case fsnotify_put_mark() called from fsnotify_destroy_marks() will decide to recalculate mask for the inode and __fsnotify_recalc_mask() will WARN about invalid connector type: WARNING: CPU: 1 PID: 12015 at fs/notify/mark.c:139 __fsnotify_recalc_mask+0x2d7/0x350 fs/notify/mark.c:139 Actually there's no reason to warn about detached connector in __fsnotify_recalc_mask() so just silently skip updating the mask in such case. Reported-by: syzbot+c34692a51b9a6ca93540@syzkaller.appspotmail.com Fixes: 3ac70bfcde81 ("fsnotify: add helper to get mask from connector") Signed-off-by: Jan Kara commit 721f0dfc3ce821c6a32820ab63edfb48ed4af075 Author: Jiri Olsa Date: Fri Aug 17 13:45:56 2018 +0200 perf python: Fix pyrf_evlist__read_on_cpu() interface Jaroslav reported errors from valgrind over perf python script: # echo 0 > /sys/devices/system/cpu/cpu4/online # valgrind ./test.py ==7524== Memcheck, a memory error detector ... ==7524== Command: ./test.py ==7524== pid 7526 exited ==7524== Invalid read of size 8 ==7524== at 0xCC2C2B3: perf_mmap__read_forward (evlist.c:780) ==7524== by 0xCC2A681: pyrf_evlist__read_on_cpu (python.c:959) ... ==7524== Address 0x65c4868 is 16 bytes after a block of size 459,36.. ==7524== at 0x4C2B955: calloc (vg_replace_malloc.c:711) ==7524== by 0xCC2F484: zalloc (util.h:35) ==7524== by 0xCC2F484: perf_evlist__alloc_mmap (evlist.c:978) ... The reason for this is in the python interface, that allows a script to pass arbitrary cpu number, which is then used to access struct perf_evlist::mmap array. That's obviously wrong and works only when if all cpus are available and fails if some cpu is missing, like in the example above. This patch makes pyrf_evlist__read_on_cpu() search the evlist's maps array for the proper map to access. It's linear search at the moment. Based on the way how is the read_on_cpu used, I don't think we need to be fast in here. But we could add some hash in the middle to make it fast/er. We don't allow python interface to set write_backward event attribute, so it's safe to check only evlist's mmaps. Reported-by: Jaroslav Škarvada Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Joe Mario Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817114556.28000-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 31fb4c0d7b88f036edb96a6a3bd791289ea2f931 Author: Jiri Olsa Date: Fri Aug 17 13:45:55 2018 +0200 perf mmap: Store real cpu number in 'struct perf_mmap' Store the real cpu number in 'struct perf_mmap', which will be used by python interface that allows user to read a particular memory map for given cpu. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Jaroslav Škarvada Cc: Joe Mario Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817114556.28000-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b946cd37348aaef443a1d951144f79a70274867f Author: Jiri Olsa Date: Fri Aug 17 11:48:13 2018 +0200 perf tools: Remove ext from struct kmod_path Having comp carrying the compression ID, we no longer need return the extension. Removing it and updating the automated test. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-14-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 88c74dc76a30b9242c2df687deb44788d93fee6b Author: Jiri Olsa Date: Fri Aug 17 11:48:12 2018 +0200 perf tools: Add gzip_is_compressed function Add implementation of the is_compressed callback for gzip. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-13-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4b57fd44b61beb51b7d64f21c72941ba10c1ea2b Author: Jiri Olsa Date: Fri Aug 17 11:48:11 2018 +0200 perf tools: Add lzma_is_compressed function Add implementation of the is_compressed callback for lzma. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-12-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 8b42b7e5e8b5692bc5e57342bf00c40d64978407 Author: Jiri Olsa Date: Fri Aug 17 11:48:10 2018 +0200 perf tools: Add is_compressed callback to compressions array Add is_compressed callback to the compressions array, that returns 0 if the file is compressed or != 0 if not. The new callback is used to recognize the situation when we have a 'compressed' object, like: /lib/modules/.../drivers/net/ethernet/intel/igb/igb.ko.xz but we need to read its debug data from debuginfo files, which might not be compressed, like: /root/.debug/.build-id/d6/...c4b301f/debug So even for a 'compressed' object we read debug data from a plain uncompressed object. To keep this transparent, we detect this in decompress_kmodule() and return the file descriptor to the uncompressed file. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-11-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c9a8a6131fb68f6eabec34fd855e69b4855155e4 Author: Jiri Olsa Date: Fri Aug 17 11:48:09 2018 +0200 perf tools: Move the temp file processing into decompress_kmodule We will add a compression check in the following patch and it makes it easier if the file processing is done in a single place. It also makes the current code simpler. The decompress_kmodule function now returns the fd of the uncompressed file and the file name in the pathname arg, if it's provided. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-10-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit dde755a90e98a1c57f6a92d1a79bc5554024065c Author: Jiri Olsa Date: Fri Aug 17 11:48:08 2018 +0200 perf tools: Use compression id in decompress_kmodule() Once we parsed out the compression ID, we dont need to iterate all available compressions and we can call it directly. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-9-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2af5247530e073f4146d74ecd96cf64c953c001c Author: Jiri Olsa Date: Fri Aug 17 11:48:07 2018 +0200 perf tools: Store compression id into struct dso Add comp to 'struct dso' to hold the compression index. It will be used in the following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-8-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4b838b0db4e9cb3892b181ea9adc13cefb90d210 Author: Jiri Olsa Date: Fri Aug 17 11:48:06 2018 +0200 perf tools: Add compression id into 'struct kmod_path' Store a decompression ID in 'struct kmod_path', so it can be later stored in 'struct dso'. Switch 'struct kmod_path's 'comp' from 'bool' to 'int' to return the compressions array index. Add 0 index item into compressions array, so that the comp usage stays as it was: 0 - no compression, != 0 compression index. Update the kmod_path tests. Committer notes: Use a designated initializer + terminating comma, e.g. { .fmt = NULL, }, to fix the build in several distros: centos:6: util/dso.c:201: error: missing initializer centos:6: util/dso.c:201: error: (near initialization for 'compressions[0].decompress') debian:9: util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers] fedora:25: util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers] fedora:26: util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers] fedora:27: util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers] oraclelinux:6: util/dso.c:201: error: missing initializer oraclelinux:6: util/dso.c:201: error: (near initialization for 'compressions[0].decompress') ubuntu:12.04.5: util/dso.c:201:2: error: missing initializer [-Werror=missing-field-initializers] ubuntu:12.04.5: util/dso.c:201:2: error: (near initialization for 'compressions[0].decompress') [-Werror=missing-field-initializers] ubuntu:16.04: util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers] ubuntu:16.10: util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers] ubuntu:16.10: util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers] ubuntu:17.10: util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers] Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-7-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e1e139463db363a253296b431e61519d8809e386 Author: Jiri Olsa Date: Fri Aug 17 11:48:05 2018 +0200 perf tools: Make is_supported_compression() static There's no outside user of it. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-6-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 85e1d419e71eaa39248a9fa6572502a3c802f9ca Author: Jiri Olsa Date: Fri Aug 17 11:48:04 2018 +0200 perf tools: Make decompress_to_file() function static There's no outside user of it. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-5-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d68a29c2823ff6bd7a25cb748b577f2d88c1f47a Author: Jiri Olsa Date: Fri Aug 17 11:48:03 2018 +0200 perf tools: Get rid of dso__needs_decompress() call in __open_dso() There's no need to call dso__needs_decompress() twice in the function. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2354ae9bdc320939cc74695b564ccf178780dd61 Author: Jiri Olsa Date: Fri Aug 17 11:48:02 2018 +0200 perf tools: Get rid of dso__needs_decompress() call in symbol__disassemble() There's no need to call dso__needs_decompress() twice in the function. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bcd4287ead885e010cd49265d8c68f2373476b08 Author: Jiri Olsa Date: Fri Aug 17 11:48:01 2018 +0200 perf tools: Get rid of dso__needs_decompress() call in read_object_code() There's no need to call dso__needs_decompress() twice in the function. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180817094813.15086-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6ab025ed444cfd1f6cc93c05a977550ce82c8ea1 Author: Steven Rostedt (VMware) Date: Thu Aug 16 11:10:15 2018 -0400 tools lib traceevent: Change to SPDX License format Replace the GPL text with SPDX tags in the tools/lib/traceevent files. Signed-off-by: Steven Rostedt Cc: Jiri Olsa Cc: Tzvetomir Stoyanov (VMware) Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180816111015.125e0f25@gandalf.local.home Signed-off-by: Arnaldo Carvalho de Melo commit cb76371441d0984824a6e66f8f3d369f037edb34 Author: Arnaldo Carvalho de Melo Date: Wed Aug 15 17:07:01 2018 -0300 perf llvm: Allow passing options to llc in addition to clang The newly added 'llvm.opts' variable allows passing options directly to llc, like needed to get sane DWARF in BPF ELF debug sections: With: [root@seventh perf]# cat ~/.perfconfig [llvm] dump-obj = true clang-opt = -g [root@seventh perf]# We get: [root@seventh perf]# perf trace -e tools/perf/examples/bpf/hello.c cat /etc/passwd > /dev/null LLVM: dumping tools/perf/examples/bpf/hello.o 0.000 __bpf_stdout__:Hello, world 0.015 __bpf_stdout__:Hello, world 0.187 __bpf_stdout__:Hello, world [root@seventh perf]# pahole tools/perf/examples/bpf/hello.o struct clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566eefef9c3777bd780ec4cbb9efa764633b76c) { clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566e.org clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566eefef9c3777bd780ec4cbb9efa764633b76c); /* 0 4 */ clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566e.org clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566eefef9c3777bd780ec4cbb9efa764633b76c); /* 4 4 */ clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566e.org clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566eefef9c3777bd780ec4cbb9efa764633b76c); /* 8 4 */ clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566e.org clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566eefef9c3777bd780ec4cbb9efa764633b76c); /* 12 4 */ clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566e.org clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566eefef9c3777bd780ec4cbb9efa764633b76c); /* 16 4 */ clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566e.org clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566eefef9c3777bd780ec4cbb9efa764633b76c); /* 20 4 */ clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566e.org clang version 8.0.0 (http://llvm.org/git/clang.git 8587270a739ee30c926a76d5657e65e85b560f6e) (http://llvm.org/git/llvm.git 0566eefef9c3777bd780ec4cbb9efa764633b76c); /* 24 4 */ /* size: 28, cachelines: 1, members: 7 */ /* last cacheline: 28 bytes */ }; [root@seventh perf]# Adding these options to be passed to llvm's llc: [root@seventh perf]# cat ~/.perfconfig [llvm] dump-obj = true clang-opt = -g opts = -mattr=dwarfris [root@seventh perf]# We get sane output: [root@seventh perf]# perf trace -e tools/perf/examples/bpf/hello.c cat /etc/passwd > /dev/null LLVM: dumping tools/perf/examples/bpf/hello.o 0.000 __bpf_stdout__:Hello, world 0.015 __bpf_stdout__:Hello, world 0.185 __bpf_stdout__:Hello, world [root@seventh perf]# pahole tools/perf/examples/bpf/hello.o struct bpf_map { unsigned int type; /* 0 4 */ unsigned int key_size; /* 4 4 */ unsigned int value_size; /* 8 4 */ unsigned int max_entries; /* 12 4 */ unsigned int map_flags; /* 16 4 */ unsigned int inner_map_idx; /* 20 4 */ unsigned int numa_node; /* 24 4 */ /* size: 28, cachelines: 1, members: 7 */ /* last cacheline: 28 bytes */ }; [root@seventh perf]# Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Jiri Olsa Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Wang Nan , Cc: Yonghong Song Link: https://lkml.kernel.org/n/tip-0lrwmrip4dru1651rm8xa7tq@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 49836f7811f383d8613661fff110ce74f4710d52 Author: Jack Henschel Date: Wed Jul 4 14:13:45 2018 +0200 perf parser: Improve error message for PMU address filters This is the second version of a patch that improves the error message of the perf events parser when the PMU hardware does not support address filters. Previously, the perf returned the following error: $ perf record -e intel_pt// --filter 'filter sys_write' --filter option should follow a -e tracepoint or HW tracer option This implies there is some syntax error present in the command line, which is not true. Rather, notify the user that the CPU does not have support for this feature. For example, Intel chips based on the Broadwell micro-archticture have the Intel PT PMU, but do not support address filtering. Now, perf prints the following error message: $ perf record -e intel_pt// --filter 'filter sys_write' This CPU does not support address filtering Signed-off-by: Jack Henschel Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180704121345.19025-1-jackdev@mailbox.org Signed-off-by: Arnaldo Carvalho de Melo commit da15fc2fa9c07b23db8f5e479bd8a9f0d741ca07 Author: Rasmus Villemoes Date: Thu Jul 5 15:15:27 2018 +0200 perf tools: Disable parallelism for 'make clean' The Yocto build system does a 'make clean' when rebuilding due to changed dependencies, and that consistently fails for me (causing the whole BSP build to fail) with errors such as | find: '[...]/perf/1.0-r9/perf-1.0/plugin_mac80211.so': No such file or directory | find: '[...]/perf/1.0-r9/perf-1.0/plugin_mac80211.so': No such file or directory | find: find: '[...]/perf/1.0-r9/perf-1.0/libtraceevent.a''[...]/perf/1.0-r9/perf-1.0/libtraceevent.a': No such file or directory: No such file or directory | [...] | find: cannot delete '/mnt/xfs/devel/pil/yocto/tmp-glibc/work/wandboard-oe-linux-gnueabi/perf/1.0-r9/perf-1.0/util/.pstack.o.cmd': No such file or directory Apparently (despite the comment), 'make clean' ends up launching multiple sub-makes that all want to remove the same things - perhaps this only happens in combination with a O=... parameter. In any case, we don't lose much by explicitly disabling the parallelism for the clean target, and it makes automated builds much more reliable. Signed-off-by: Rasmus Villemoes Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180705131527.19749-1-linux@rasmusvillemoes.dk Signed-off-by: Arnaldo Carvalho de Melo commit 5ef499cd571c293b74a30d77e7ef512edb6ded6b Author: Rafael J. Wysocki Date: Tue Aug 14 12:34:40 2018 +0200 cpuidle: menu: Handle stopped tick more aggressively Commit 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states with stopped tick) missed the case when the target residencies of deep idle states of CPUs are above the tick boundary which may cause the CPU to get stuck in a shallow idle state for a long time. Say there are two CPU idle states available: one shallow, with the target residency much below the tick boundary and one deep, with the target residency significantly above the tick boundary. In that case, if the tick has been stopped already and the expected next timer event is relatively far in the future, the governor will assume the idle duration to be equal to TICK_USEC and it will select the idle state for the CPU accordingly. However, that will cause the shallow state to be selected even though it would have been more energy-efficient to select the deep one. To address this issue, modify the governor to always use the time till the closest timer event instead of the predicted idle duration if the latter is less than the tick period length and the tick has been stopped already. Also make it extend the search for a matching idle state if the tick is stopped to avoid settling on a shallow state if deep states with target residencies above the tick period length are available. In addition, make it always indicate that the tick should be stopped if it has been stopped already for consistency. Fixes: 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states with stopped tick) Reported-by: Leo Yan Acked-by: Peter Zijlstra (Intel) Cc: 4.17+ # 4.17+ Signed-off-by: Rafael J. Wysocki commit db2173198b9513f7add8009f225afa1f1c79bcc6 Author: Benjamin Herrenschmidt Date: Fri Aug 17 17:30:39 2018 +1000 powerpc/powernv/pci: Work around races in PCI bridge enabling The generic code is racy when multiple children of a PCI bridge try to enable it simultaneously. This leads to drivers trying to access a device through a not-yet-enabled bridge, and this EEH errors under various circumstances when using parallel driver probing. There is work going on to fix that properly in the PCI core but it will take some time. x86 gets away with it because (outside of hotplug), the BIOS enables all the bridges at boot time. This patch does the same thing on powernv by enabling all bridges that have child devices at boot time, thus avoiding subsequent races. It's suitable for backporting to stable and distros, while the proper PCI fix will probably be significantly more invasive. Signed-off-by: Benjamin Herrenschmidt Cc: stable@vger.kernel.org Signed-off-by: Michael Ellerman commit a58183138cb72059a0c278f8370a47f41dae9afa Author: Hari Bathini Date: Sat Aug 18 02:10:56 2018 +0530 powerpc/fadump: cleanup crash memory ranges support Commit 1bd6a1c4b80a ("powerpc/fadump: handle crash memory ranges array index overflow") changed crash memory ranges to a dynamic array that is reallocated on-demand with krealloc(). The relevant header for this call was not included. The kernel compiles though. But be cautious and add the header anyway. Also, memory allocation logic in fadump_add_crash_memory() takes care of memory allocation for crash memory ranges in all scenarios. Drop unnecessary memory allocation in fadump_setup_crash_memory_ranges(). Fixes: 1bd6a1c4b80a ("powerpc/fadump: handle crash memory ranges array index overflow") Cc: Mahesh Salgaonkar Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman commit 95b861a76c1ded3e89d33a3d9f4552dce22e9875 Author: Nicholas Piggin Date: Tue May 1 00:55:58 2018 +1000 powerpc/powernv: provide a console flush operation for opal hvc driver Provide the flush hv_op for the opal hvc driver. This will flush the firmware console buffers without spinning with interrupts disabled. Cc: Benjamin Herrenschmidt Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 997dd26cb3c8b7c9b8765751cc1491ad33b2024f Author: Michael Ellerman Date: Thu Aug 16 15:27:47 2018 +1000 powerpc/traps: Avoid rate limit messages from show unhandled signals In the recent commit to add an explicit ratelimit state when showing unhandled signals, commit 35a52a10c3ac ("powerpc/traps: Use an explicit ratelimit state for show_signal_msg()"), I put the check of show_unhandled_signals and the ratelimit state before the call to unhandled_signal() so as to avoid unnecessarily calling the latter when show_unhandled_signals is false. However that causes us to check the ratelimit state on every call, so if we take a lot of *handled* signals that has the effect of making the ratelimit code print warnings that callbacks have been suppressed when they haven't. So rearrange the code so that we check show_unhandled_signals first, then call unhandled_signal() and finally check the ratelimit state. Signed-off-by: Michael Ellerman Reviewed-by: Murilo Opsfelder Araujo commit 8cdc43afbb2cb58692c49fab0b13e2d9439c0642 Author: John Crispin Date: Wed Jul 25 11:52:09 2018 +0200 pwm: mediatek: Add MT7628 support Add support for MT7628. The SoC is legacy MIPS and hence has no complex clock tree. This patch add an extra flag to the SoC specific data indicating, that no clocks are present. Signed-off-by: John Crispin Reviewed-by: Matthias Brugger Signed-off-by: Thierry Reding commit 935be8e08a73e090ee8a9e252242c089f81a4ce4 Author: John Crispin Date: Wed Jul 25 11:52:08 2018 +0200 dt-bindings: pwm: Add MT7628 information Enhance the MediaTek PWM binding with details about the IP found in the MT7628 SoC. Signed-off-by: John Crispin Signed-off-by: Thierry Reding commit 5cd96041d027d958fe6b24e193488a468af0762e Author: Yoshihiro Shimoda Date: Mon Jul 30 20:49:51 2018 +0900 dt-bindings: pwm: rcar: Add bindings for R-Car E3 support This patch adds bindings for R-Car E3. No driver update is needed. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Acked-by: Rob Herring Signed-off-by: Thierry Reding commit b96e9eb62841c519ba1db32d036628be3cdef91f Author: Jerome Brunet Date: Wed Aug 1 12:57:20 2018 +0200 pwm: meson: Fix mux clock names Current clock name looks like this: /soc/bus@ffd00000/pwm@1b000#mux0 This is bad because CCF uses the clock to create a directory in clk debugfs. With such name, the directory creation (silently) fails and the debugfs entry end up being created at the debugfs root. With this change, the clock name will now be: ffd1b000.pwm#mux0 This matches the clock naming scheme used in the ethernet and mmc driver. It also fixes the problem with debugfs. Fixes: 36af66a79056 ("pwm: Convert to using %pOF instead of full_name") Signed-off-by: Jerome Brunet Acked-by: Neil Armstrong Signed-off-by: Thierry Reding commit 2c2059c0b85d93d527cd23c0491288ef0264aee5 Author: Fabrice Gasnier Date: Fri Jul 20 09:16:32 2018 +0200 pwm: stm32-lp: Remove useless loop in stm32_pwm_lp_remove() LPTimer has only one pwm channel (npwm = 1). Remove useless for loop in remove routine. Signed-off-by: Fabrice Gasnier Signed-off-by: Thierry Reding commit 43725feb593127b16318b871e3a9bf89a96d66cb Author: David Rivshin Date: Wed Aug 1 10:17:29 2018 -0400 pwm: omap-dmtimer: Return -EPROBE_DEFER if no dmtimer platform data If a pwm-omap-dmtimer is probed before the dmtimer it uses, the platform data won't be set yet. Fixes: ac30751df953 ("ARM: OMAP: pdata-quirks: Remove unused timer pdata") Cc: # 4.17+ Signed-off-by: David Rivshin Acked-by: Pavel Machek Tested-by: Pavel Machek Acked-by: Ladislav Michl Tested-by: Andreas Kemnade Signed-off-by: Thierry Reding commit 7059b36636beab57c3c43c62104483e5449bee95 Author: Rafael J. Wysocki Date: Thu Aug 9 19:08:34 2018 +0200 sched: idle: Avoid retaining the tick when it has been stopped If the tick has been stopped already, but the governor has not asked to stop it (which it can do sometimes), the idle loop should invoke tick_nohz_idle_stop_tick(), to let tick_nohz_stop_tick() take care of this case properly. Fixes: 554c8aa8ecad (sched: idle: Select idle state before stopping the tick) Cc: 4.17+ # 4.17+ Acked-by: Peter Zijlstra (Intel) Signed-off-by: Rafael J. Wysocki commit ef456a2de3716e2a38382ff2aa9a9c52962e7e84 Author: Esben Haabendal Date: Thu Aug 16 10:43:13 2018 +0200 i2c: imx: Simplify stopped state tracking Always update the stopped state when busy status have been checked. This is identical to what was done before, with the exception of error handling. Without this change, some errors cause the stopped state to be left in incorrect state in i2c_imx_stop(), i2c_imx_dma_read(), i2c_imx_read() and i2c_imx_xfer(). Signed-off-by: Esben Haabendal Acked-by: Uwe Kleine-König Signed-off-by: Wolfram Sang commit bed4ff1ed4d8f2ef5007c5c6ae1b29c5677a3632 Author: Esben Haabendal Date: Thu Aug 16 10:43:12 2018 +0200 i2c: imx: Fix race condition in dma read This fixes a race condition, where the DMAEN bit ends up being set after I2C slave has transmitted a byte following the dummy read. When that happens, an interrupt is generated instead, and no DMA request is generated to kickstart the DMA read, and a timeout happens after DMA_TIMEOUT (1 sec). Fixed by setting the DMAEN bit before the dummy read. Signed-off-by: Esben Haabendal Acked-by: Uwe Kleine-König Signed-off-by: Wolfram Sang Cc: stable@kernel.org commit 5c18d12ced225fa0ad5a03fb42bbb293815d1342 Author: Darren Stevens Date: Sun Dec 31 20:53:55 2017 +0000 i2c: pasemi: remove hardcoded bus numbers on smbus The pasemi smbus controller uses PCI_FUNC(dev->devfn) to define which number bus to attach to, however this fails when something else is probed first, for example an ATI Radeon graphics card will claim 9 or 10 busses, including the ones the pasemi wants. Patch the driver to call i2c_add_adapter rather than i2c_add_numbered_adapter. Signed-off-by: Darren Stevens Signed-off-by: Wolfram Sang commit 4110b5cbb014ebaaeb3d18ac8b98470b7251847d Author: Marc Zyngier Date: Fri Aug 17 09:18:01 2018 +0100 irqchip/gic-v3: Allow interrupt to be configured as wake-up sources Although GICv3 doesn't directly offers support for wake-up interrupts and relies on external HW for this, it shouldn't prevent the driver for such HW from doing it work. Let's set the required flags on the irq_chip structures. Reported-by: Lina Iyer Tested-by: Lina Iyer Reviewed-by: Sudeep Holla Signed-off-by: Marc Zyngier commit 44beda0c357f656e95febec8de7347015479295d Author: Martin Kaiser Date: Fri Aug 17 14:10:27 2018 +0200 irqchip/tango: Set irq handler and data in one go Replace the two separate calls for setting the irq handler and data with a single irq_set_chained_handler_and_data() call. Signed-off-by: Martin Kaiser Signed-off-by: Marc Zyngier commit ad0926f05b0f4d302247e434d67099d9f6b622f3 Author: Fabrizio Castro Date: Tue Aug 14 13:33:28 2018 +0100 dt-bindings: irqchip: renesas-irqc: Document r8a774a1 support Document RZ/G2M (R8A774A1) SoC bindings. Reviewed-by: Biju Das Reviewed-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Fabrizio Castro Signed-off-by: Marc Zyngier commit 15c566fcff9cc7b8fd64461d6ee6fd1bc665b444 Author: Andy Shevchenko Date: Fri Aug 10 13:26:49 2018 +0300 i2c: designware: Add SPDX license tag Replace short statement in comment with proper SPDX license tag. Note, for i2c-desingware-slave.c the identifier is chosen in accordance with MODULE_LICENSE() macro since it is visible to user. Another point to this choice is that the header seems to be copy'n'paste from the other file of this very driver. Acked-by: Luis Oliveira Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 8a54d8fc160e67ad485d95a0322ce1221f80770a Author: Johannes Berg Date: Mon Jun 18 09:29:57 2018 +0200 cfg80211: remove division by size of sizeof(struct ieee80211_wmm_rule) Pointer arithmetic already adjusts by the size of the struct, so the sizeof() calculation is wrong. This is basically the same as Colin King's patch for similar code in the iwlwifi driver. Fixes: 230ebaa189af ("cfg80211: read wmm rules from regulatory database") Signed-off-by: Johannes Berg commit 46dec40fb741f00f1864580130779aeeaf24fb3d Author: Paul Mackerras Date: Mon Aug 20 16:05:45 2018 +1000 KVM: PPC: Book3S HV: Don't truncate HPTE index in xlate function This fixes a bug which causes guest virtual addresses to get translated to guest real addresses incorrectly when the guest is using the HPT MMU and has more than 256GB of RAM, or more specifically has a HPT larger than 2GB. This has showed up in testing as a failure of the host to emulate doorbell instructions correctly on POWER9 for HPT guests with more than 256GB of RAM. The bug is that the HPTE index in kvmppc_mmu_book3s_64_hv_xlate() is stored as an int, and in forming the HPTE address, the index gets shifted left 4 bits as an int before being signed-extended to 64 bits. The simple fix is to make the variable a long int, matching the return type of kvmppc_hv_find_lock_hpte(), which is what calculates the index. Fixes: 697d3899dcb4 ("KVM: PPC: Implement MMIO emulation support for Book3S HV guests") Signed-off-by: Paul Mackerras commit 9c86336c15db1c48cbaddff56caf2be0a930e991 Author: Haishuang Yan Date: Mon Aug 20 10:51:05 2018 +0800 ip6_vti: fix a null pointer deference when destroy vti6 tunnel If load ip6_vti module and create a network namespace when set fb_tunnels_only_for_init_net to 1, then exit the namespace will cause following crash: [ 6601.677036] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 [ 6601.679057] PGD 8000000425eca067 P4D 8000000425eca067 PUD 424292067 PMD 0 [ 6601.680483] Oops: 0000 [#1] SMP PTI [ 6601.681223] CPU: 7 PID: 93 Comm: kworker/u16:1 Kdump: loaded Tainted: G E 4.18.0+ #3 [ 6601.683153] Hardware name: Fedora Project OpenStack Nova, BIOS seabios-1.7.5-11.el7 04/01/2014 [ 6601.684919] Workqueue: netns cleanup_net [ 6601.685742] RIP: 0010:vti6_exit_batch_net+0x87/0xd0 [ip6_vti] [ 6601.686932] Code: 7b 08 48 89 e6 e8 b9 ea d3 dd 48 8b 1b 48 85 db 75 ec 48 83 c5 08 48 81 fd 00 01 00 00 75 d5 49 8b 84 24 08 01 00 00 48 89 e6 <48> 8b 78 08 e8 90 ea d3 dd 49 8b 45 28 49 39 c6 4c 8d 68 d8 75 a1 [ 6601.690735] RSP: 0018:ffffa897c2737de0 EFLAGS: 00010246 [ 6601.691846] RAX: 0000000000000000 RBX: 0000000000000000 RCX: dead000000000200 [ 6601.693324] RDX: 0000000000000015 RSI: ffffa897c2737de0 RDI: ffffffff9f2ea9e0 [ 6601.694824] RBP: 0000000000000100 R08: 0000000000000000 R09: 0000000000000000 [ 6601.696314] R10: 0000000000000001 R11: 0000000000000000 R12: ffff8dc323c07e00 [ 6601.697812] R13: ffff8dc324a63100 R14: ffffa897c2737e30 R15: ffffa897c2737e30 [ 6601.699345] FS: 0000000000000000(0000) GS:ffff8dc33fdc0000(0000) knlGS:0000000000000000 [ 6601.701068] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 6601.702282] CR2: 0000000000000008 CR3: 0000000424966002 CR4: 00000000001606e0 [ 6601.703791] Call Trace: [ 6601.704329] cleanup_net+0x1b4/0x2c0 [ 6601.705268] process_one_work+0x16c/0x370 [ 6601.706145] worker_thread+0x49/0x3e0 [ 6601.706942] kthread+0xf8/0x130 [ 6601.707626] ? rescuer_thread+0x340/0x340 [ 6601.708476] ? kthread_bind+0x10/0x10 [ 6601.709266] ret_from_fork+0x35/0x40 Reproduce: modprobe ip6_vti echo 1 > /proc/sys/net/core/fb_tunnels_only_for_init_net unshare -n exit This because ip6n->tnls_wc[0] point to fallback device in default, but in non-default namespace, ip6n->tnls_wc[0] will be NULL, so add the NULL check comparatively. Fixes: e2948e5af8ee ("ip6_vti: fix creating fallback tunnel device for vti6") Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller commit 8fdd36d44205cd6bccca26246ae84d7515d10015 Merge: 2ad0d5269970 58064e1f46b1 Author: Linus Torvalds Date: Sun Aug 19 16:23:03 2018 -0700 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: "Only two changes. One cleans up warnings in the ColdFire DMA code, the other stubs out (with warnings) ColdFire clock api functions not normally used" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68knommu: Fix typos in Coldfire 5272 DMA debug code m68k: coldfire: Normalize clk API commit 2ad0d52699700a91660a406a4046017a2d7f246a Merge: e61cf2e3a5b4 e2948e5af8ee Author: Linus Torvalds Date: Sun Aug 19 11:51:45 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Pull networking fixes from David Miller: 1) Fix races in IPVS, from Tan Hu. 2) Missing unbind in matchall classifier, from Hangbin Liu. 3) Missing act_ife action release, from Vlad Buslov. 4) Cure lockdep splats in ila, from Cong Wang. 5) veth queue leak on link delete, from Toshiaki Makita. 6) Disable isdn's IIOCDBGVAR ioctl, it exposes kernel addresses. From Kees Cook. 7) RCU usage fixup in XDP, from Tariq Toukan. 8) Two TCP ULP fixes from Daniel Borkmann. 9) r8169 needs REALTEK_PHY as a Kconfig dependency, from Heiner Kallweit. 10) Always take tcf_lock with BH disabled, otherwise we can deadlock with rate estimator code paths. From Vlad Buslov. 11) Don't use MSI-X on RTL8106e r8169 chips, they don't resume properly. From Jian-Hong Pan. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (41 commits) ip6_vti: fix creating fallback tunnel device for vti6 ip_vti: fix a null pointer deferrence when create vti fallback tunnel r8169: don't use MSI-X on RTL8106e net: lan743x_ptp: convert to ktime_get_clocktai_ts64 net: sched: always disable bh when taking tcf_lock ip6_vti: simplify stats handling in vti6_xmit bpf: fix redirect to map under tail calls r8169: add missing Kconfig dependency tools/bpf: fix bpf selftest test_cgroup_storage failure bpf, sockmap: fix sock_map_ctx_update_elem race with exist/noexist bpf, sockmap: fix map elem deletion race with smap_stop_sock bpf, sockmap: fix leakage of smap_psock_map_entry tcp, ulp: fix leftover icsk_ulp_ops preventing sock from reattach tcp, ulp: add alias for all ulp modules bpf: fix a rcu usage warning in bpf_prog_array_copy_core() samples/bpf: all XDP samples should unload xdp/bpf prog on SIGTERM net/xdp: Fix suspicious RCU usage warning net/mlx5e: Delete unneeded function argument Documentation: networking: ti-cpsw: correct cbs parameters for Eth1 100Mb isdn: Disable IIOCDBGVAR ... commit e2948e5af8eeb6c945000772b7613b0323a0a203 Author: Haishuang Yan Date: Sun Aug 19 15:05:05 2018 +0800 ip6_vti: fix creating fallback tunnel device for vti6 When set fb_tunnels_only_for_init_net to 1, don't create fallback tunnel device for vti6 when a new namespace is created. Tested: [root@builder2 ~]# modprobe ip6_tunnel [root@builder2 ~]# modprobe ip6_vti [root@builder2 ~]# echo 1 > /proc/sys/net/core/fb_tunnels_only_for_init_net [root@builder2 ~]# unshare -n [root@builder2 ~]# ip link 1: lo: mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller commit cd1aa9c2c665cafbd05b83507d3f1096f3912aa4 Author: Haishuang Yan Date: Sun Aug 19 15:05:04 2018 +0800 ip_vti: fix a null pointer deferrence when create vti fallback tunnel After set fb_tunnels_only_for_init_net to 1, the itn->fb_tunnel_dev will be NULL and will cause following crash: [ 2742.849298] BUG: unable to handle kernel NULL pointer dereference at 0000000000000941 [ 2742.851380] PGD 800000042c21a067 P4D 800000042c21a067 PUD 42aaed067 PMD 0 [ 2742.852818] Oops: 0002 [#1] SMP PTI [ 2742.853570] CPU: 7 PID: 2484 Comm: unshare Kdump: loaded Not tainted 4.18.0-rc8+ #2 [ 2742.855163] Hardware name: Fedora Project OpenStack Nova, BIOS seabios-1.7.5-11.el7 04/01/2014 [ 2742.856970] RIP: 0010:vti_init_net+0x3a/0x50 [ip_vti] [ 2742.858034] Code: 90 83 c0 48 c7 c2 20 a1 83 c0 48 89 fb e8 6e 3b f6 ff 85 c0 75 22 8b 0d f4 19 00 00 48 8b 93 00 14 00 00 48 8b 14 ca 48 8b 12 82 41 09 00 00 04 c6 82 38 09 00 00 45 5b c3 66 0f 1f 44 00 00 [ 2742.861940] RSP: 0018:ffff9be28207fde0 EFLAGS: 00010246 [ 2742.863044] RAX: 0000000000000000 RBX: ffff8a71ebed4980 RCX: 0000000000000013 [ 2742.864540] RDX: 0000000000000000 RSI: 0000000000000013 RDI: ffff8a71ebed4980 [ 2742.866020] RBP: ffff8a71ea717000 R08: ffffffffc083903c R09: ffff8a71ea717000 [ 2742.867505] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8a71ebed4980 [ 2742.868987] R13: 0000000000000013 R14: ffff8a71ea5b49c0 R15: 0000000000000000 [ 2742.870473] FS: 00007f02266c9740(0000) GS:ffff8a71ffdc0000(0000) knlGS:0000000000000000 [ 2742.872143] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2742.873340] CR2: 0000000000000941 CR3: 000000042bc20006 CR4: 00000000001606e0 [ 2742.874821] Call Trace: [ 2742.875358] ops_init+0x38/0xf0 [ 2742.876078] setup_net+0xd9/0x1f0 [ 2742.876789] copy_net_ns+0xb7/0x130 [ 2742.877538] create_new_namespaces+0x11a/0x1d0 [ 2742.878525] unshare_nsproxy_namespaces+0x55/0xa0 [ 2742.879526] ksys_unshare+0x1a7/0x330 [ 2742.880313] __x64_sys_unshare+0xe/0x20 [ 2742.881131] do_syscall_64+0x5b/0x180 [ 2742.881933] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Reproduce: echo 1 > /proc/sys/net/core/fb_tunnels_only_for_init_net modprobe ip_vti unshare -n Fixes: 79134e6ce2c9 ("net: do not create fallback tunnels for non-default namespaces") Cc: Eric Dumazet Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller commit 7bb05b85bc2d1a1b647b91424b2ed4a18e6ecd81 Author: Jian-Hong Pan Date: Fri Aug 17 13:07:35 2018 +0800 r8169: don't use MSI-X on RTL8106e Found the ethernet network on ASUS X441UAR doesn't come back on resume from suspend when using MSI-X. The chip is RTL8106e - version 39. [ 21.848357] libphy: r8169: probed [ 21.848473] r8169 0000:02:00.0 eth0: RTL8106e, 0c:9d:92:32:67:b4, XID 44900000, IRQ 127 [ 22.518860] r8169 0000:02:00.0 enp2s0: renamed from eth0 [ 29.458041] Generic PHY r8169-200:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE) [ 63.227398] r8169 0000:02:00.0 enp2s0: Link is Up - 100Mbps/Full - flow control off [ 124.514648] Generic PHY r8169-200:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE) Here is the ethernet controller in detail: 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136] (rev 07) Subsystem: ASUSTeK Computer Inc. RTL810xE PCI Express Fast Ethernet controller [1043:200f] Flags: bus master, fast devsel, latency 0, IRQ 16 I/O ports at e000 [size=256] Memory at ef100000 (64-bit, non-prefetchable) [size=4K] Memory at e0000000 (64-bit, prefetchable) [size=16K] Capabilities: Kernel driver in use: r8169 Kernel modules: r8169 Falling back to MSI fixes the issue. Fixes: 6c6aa15fdea5 ("r8169: improve interrupt handling") Signed-off-by: Jian-Hong Pan Signed-off-by: David S. Miller commit 0b3e776e2e809b808875b10e35d1047c5c548da4 Author: Arnd Bergmann Date: Wed Aug 15 19:49:49 2018 +0200 net: lan743x_ptp: convert to ktime_get_clocktai_ts64 timekeeping_clocktai64() has been renamed to ktime_get_clocktai_ts64() for consistency with the other ktime_get_* access functions. Rename the new caller that has come up as well. Question: this is the only ptp driver that sets the hardware time to the current system time in TAI. Why does it do that? Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 653cd284a8a857ddfcf24f5bc3bd204a229f6c9f Author: Vlad Buslov Date: Tue Aug 14 21:46:16 2018 +0300 net: sched: always disable bh when taking tcf_lock Recently, ops->init() and ops->dump() of all actions were modified to always obtain tcf_lock when accessing private action state. Actions that don't depend on tcf_lock for synchronization with their data path use non-bh locking API. However, tcf_lock is also used to protect rate estimator stats in softirq context by timer callback. Change ops->init() and ops->dump() of all actions to disable bh when using tcf_lock to prevent deadlock reported by following lockdep warning: [ 105.470398] ================================ [ 105.475014] WARNING: inconsistent lock state [ 105.479628] 4.18.0-rc8+ #664 Not tainted [ 105.483897] -------------------------------- [ 105.488511] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. [ 105.494871] swapper/16/0 [HC0[0]:SC1[1]:HE1:SE0] takes: [ 105.500449] 00000000f86c012e (&(&p->tcfa_lock)->rlock){+.?.}, at: est_fetch_counters+0x3c/0xa0 [ 105.509696] {SOFTIRQ-ON-W} state was registered at: [ 105.514925] _raw_spin_lock+0x2c/0x40 [ 105.519022] tcf_bpf_init+0x579/0x820 [act_bpf] [ 105.523990] tcf_action_init_1+0x4e4/0x660 [ 105.528518] tcf_action_init+0x1ce/0x2d0 [ 105.532880] tcf_exts_validate+0x1d8/0x200 [ 105.537416] fl_change+0x55a/0x268b [cls_flower] [ 105.542469] tc_new_tfilter+0x748/0xa20 [ 105.546738] rtnetlink_rcv_msg+0x56a/0x6d0 [ 105.551268] netlink_rcv_skb+0x18d/0x200 [ 105.555628] netlink_unicast+0x2d0/0x370 [ 105.559990] netlink_sendmsg+0x3b9/0x6a0 [ 105.564349] sock_sendmsg+0x6b/0x80 [ 105.568271] ___sys_sendmsg+0x4a1/0x520 [ 105.572547] __sys_sendmsg+0xd7/0x150 [ 105.576655] do_syscall_64+0x72/0x2c0 [ 105.580757] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 105.586243] irq event stamp: 489296 [ 105.590084] hardirqs last enabled at (489296): [] _raw_spin_unlock_irq+0x29/0x40 [ 105.599765] hardirqs last disabled at (489295): [] _raw_spin_lock_irq+0x15/0x50 [ 105.609277] softirqs last enabled at (489292): [] irq_enter+0x83/0xa0 [ 105.618001] softirqs last disabled at (489293): [] irq_exit+0x140/0x190 [ 105.626813] other info that might help us debug this: [ 105.633976] Possible unsafe locking scenario: [ 105.640526] CPU0 [ 105.643325] ---- [ 105.646125] lock(&(&p->tcfa_lock)->rlock); [ 105.650747] [ 105.653717] lock(&(&p->tcfa_lock)->rlock); [ 105.658514] *** DEADLOCK *** [ 105.665349] 1 lock held by swapper/16/0: [ 105.669629] #0: 00000000a640ad99 ((&est->timer)){+.-.}, at: call_timer_fn+0x10b/0x550 [ 105.678200] stack backtrace: [ 105.683194] CPU: 16 PID: 0 Comm: swapper/16 Not tainted 4.18.0-rc8+ #664 [ 105.690249] Hardware name: Supermicro SYS-2028TP-DECR/X10DRT-P, BIOS 2.0b 03/30/2017 [ 105.698626] Call Trace: [ 105.701421] [ 105.703791] dump_stack+0x92/0xeb [ 105.707461] print_usage_bug+0x336/0x34c [ 105.711744] mark_lock+0x7c9/0x980 [ 105.715500] ? print_shortest_lock_dependencies+0x2e0/0x2e0 [ 105.721424] ? check_usage_forwards+0x230/0x230 [ 105.726315] __lock_acquire+0x923/0x26f0 [ 105.730597] ? debug_show_all_locks+0x240/0x240 [ 105.735478] ? mark_lock+0x493/0x980 [ 105.739412] ? check_chain_key+0x140/0x1f0 [ 105.743861] ? __lock_acquire+0x836/0x26f0 [ 105.748323] ? lock_acquire+0x12e/0x290 [ 105.752516] lock_acquire+0x12e/0x290 [ 105.756539] ? est_fetch_counters+0x3c/0xa0 [ 105.761084] _raw_spin_lock+0x2c/0x40 [ 105.765099] ? est_fetch_counters+0x3c/0xa0 [ 105.769633] est_fetch_counters+0x3c/0xa0 [ 105.773995] est_timer+0x87/0x390 [ 105.777670] ? est_fetch_counters+0xa0/0xa0 [ 105.782210] ? lock_acquire+0x12e/0x290 [ 105.786410] call_timer_fn+0x161/0x550 [ 105.790512] ? est_fetch_counters+0xa0/0xa0 [ 105.795055] ? del_timer_sync+0xd0/0xd0 [ 105.799249] ? __lock_is_held+0x93/0x110 [ 105.803531] ? mark_held_locks+0x20/0xe0 [ 105.807813] ? _raw_spin_unlock_irq+0x29/0x40 [ 105.812525] ? est_fetch_counters+0xa0/0xa0 [ 105.817069] ? est_fetch_counters+0xa0/0xa0 [ 105.821610] run_timer_softirq+0x3c4/0x9f0 [ 105.826064] ? lock_acquire+0x12e/0x290 [ 105.830257] ? __bpf_trace_timer_class+0x10/0x10 [ 105.835237] ? __lock_is_held+0x25/0x110 [ 105.839517] __do_softirq+0x11d/0x7bf [ 105.843542] irq_exit+0x140/0x190 [ 105.847208] smp_apic_timer_interrupt+0xac/0x3b0 [ 105.852182] apic_timer_interrupt+0xf/0x20 [ 105.856628] [ 105.859081] RIP: 0010:cpuidle_enter_state+0xd8/0x4d0 [ 105.864395] Code: 46 ff 48 89 44 24 08 0f 1f 44 00 00 31 ff e8 cf ec 46 ff 80 7c 24 07 00 0f 85 1d 02 00 00 e8 9f 90 4b ff fb 66 0f 1f 44 00 00 <4c> 8b 6c 24 08 4d 29 fd 0f 80 36 03 00 00 4c 89 e8 48 ba cf f7 53 [ 105.884288] RSP: 0018:ffff8803ad94fd20 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 [ 105.892494] RAX: 0000000000000000 RBX: ffffe8fb300829c0 RCX: ffffffffb41e19e1 [ 105.899988] RDX: 0000000000000007 RSI: dffffc0000000000 RDI: ffff8803ad9358ac [ 105.907503] RBP: ffffffffb6636300 R08: 0000000000000004 R09: 0000000000000000 [ 105.914997] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000004 [ 105.922487] R13: ffffffffb6636140 R14: ffffffffb66362d8 R15: 000000188d36091b [ 105.929988] ? trace_hardirqs_on_caller+0x141/0x2d0 [ 105.935232] do_idle+0x28e/0x320 [ 105.938817] ? arch_cpu_idle_exit+0x40/0x40 [ 105.943361] ? mark_lock+0x8c1/0x980 [ 105.947295] ? _raw_spin_unlock_irqrestore+0x32/0x60 [ 105.952619] cpu_startup_entry+0xc2/0xd0 [ 105.956900] ? cpu_in_idle+0x20/0x20 [ 105.960830] ? _raw_spin_unlock_irqrestore+0x32/0x60 [ 105.966146] ? trace_hardirqs_on_caller+0x141/0x2d0 [ 105.971391] start_secondary+0x2b5/0x360 [ 105.975669] ? set_cpu_sibling_map+0x1330/0x1330 [ 105.980654] secondary_startup_64+0xa5/0xb0 Taking tcf_lock in sample action with bh disabled causes lockdep to issue a warning regarding possible irq lock inversion dependency between tcf_lock, and psample_groups_lock that is taken when holding tcf_lock in sample init: [ 162.108959] Possible interrupt unsafe locking scenario: [ 162.116386] CPU0 CPU1 [ 162.121277] ---- ---- [ 162.126162] lock(psample_groups_lock); [ 162.130447] local_irq_disable(); [ 162.136772] lock(&(&p->tcfa_lock)->rlock); [ 162.143957] lock(psample_groups_lock); [ 162.150813] [ 162.153808] lock(&(&p->tcfa_lock)->rlock); [ 162.158608] *** DEADLOCK *** In order to prevent potential lock inversion dependency between tcf_lock and psample_groups_lock, extract call to psample_group_get() from tcf_lock protected section in sample action init function. Fixes: 4e232818bd32 ("net: sched: act_mirred: remove dependency on rtnl lock") Fixes: 764e9a24480f ("net: sched: act_vlan: remove dependency on rtnl lock") Fixes: 729e01260989 ("net: sched: act_tunnel_key: remove dependency on rtnl lock") Fixes: d77284956656 ("net: sched: act_sample: remove dependency on rtnl lock") Fixes: e8917f437006 ("net: sched: act_gact: remove dependency on rtnl lock") Fixes: b6a2b971c0b0 ("net: sched: act_csum: remove dependency on rtnl lock") Fixes: 2142236b4584 ("net: sched: act_bpf: remove dependency on rtnl lock") Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit e61cf2e3a5b452cfefcb145021f5a8ea88735cc1 Merge: 1009aa1205c2 28a1f3ac1d0c Author: Linus Torvalds Date: Sun Aug 19 10:38:36 2018 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull first set of KVM updates from Paolo Bonzini: "PPC: - minor code cleanups x86: - PCID emulation and CR3 caching for shadow page tables - nested VMX live migration - nested VMCS shadowing - optimized IPI hypercall - some optimizations ARM will come next week" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (85 commits) kvm: x86: Set highest physical address bits in non-present/reserved SPTEs KVM/x86: Use CC_SET()/CC_OUT in arch/x86/kvm/vmx.c KVM: X86: Implement PV IPIs in linux guest KVM: X86: Add kvm hypervisor init time platform setup callback KVM: X86: Implement "send IPI" hypercall KVM/x86: Move X86_CR4_OSXSAVE check into kvm_valid_sregs() KVM: x86: Skip pae_root shadow allocation if tdp enabled KVM/MMU: Combine flushing remote tlb in mmu_set_spte() KVM: vmx: skip VMWRITE of HOST_{FS,GS}_BASE when possible KVM: vmx: skip VMWRITE of HOST_{FS,GS}_SEL when possible KVM: vmx: always initialize HOST_{FS,GS}_BASE to zero during setup KVM: vmx: move struct host_state usage to struct loaded_vmcs KVM: vmx: compute need to reload FS/GS/LDT on demand KVM: nVMX: remove a misleading comment regarding vmcs02 fields KVM: vmx: rename __vmx_load_host_state() and vmx_save_host_state() KVM: vmx: add dedicated utility to access guest's kernel_gs_base KVM: vmx: track host_state.loaded using a loaded_vmcs pointer KVM: vmx: refactor segmentation code in vmx_save_host_state() kvm: nVMX: Fix fault priority for VMX operations kvm: nVMX: Fix fault vector for VMX operation at CPL > 0 ... commit 1009aa1205c2c5e9101437dcadfa195708d863bf Merge: 1d0926e99de7 627672cf431b Author: Linus Torvalds Date: Sun Aug 19 09:56:38 2018 -0700 Merge tag 'riscv-for-linus-4.19-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux Pull RISC-V updates from Palmer Dabbelt: "This contains some major improvements to the RISC-V port, including the necessary interrupt controller and timer support to actually make it to userspace. Support for three devices has been added: - the ISA-mandated timers on RISC-V systems. - the ISA-mandated first-level interrupt controller on RISC-V systems, which is handled as part of our core arch code because it's very small and tightly tied to the ISA. - SiFive's platform-level interrupt controller, which talks to the actual devices. In addition to these new devices, there are a handful of cleanups all over the RISC-V tree: - build fixes for various configurations: * A fix to the vDSO build's makefile so it respects CFLAGS. * The addition of __lshrti3, a libgcc derived function necessary for some 32-bit configurations. * !SMP && PERF_EVENTS - Cleanups to the arch code to remove the remnants of old versions of the drivers that were just properly submitted. * Some dead code from the timer driver, most of which wasn't ever even compiled. * Cleanups of some interrupt #defines, which are now local to the interrupt handling code. - Fixes to ptrace(), which while not being sufficient to fully make GDB work are at least sufficient to get simple GDB tasks to work. - Early printk support via RISC-V's architecturally mandated SBI console device. - A fix to our early debug trap handler to ensure it's always aligned. These patches have all been through a fairly extensive review process, but as this enables a whole pile of functionality (ie, userspace) I'm confident we'll need to submit a few more patches. The only concrete issues I know about are the sys_riscv_flush_icache patches, but as I managed to screw those up on Friday I figured it'd be best to let them bake another week. This tag boots a Fedora root filesystem on QEMU's master branch for me, and before this morning's rebase (from 4.18-rc8 to 4.18) it booted on the HiFive Unleashed. Thanks to Christoph Hellwig and the other guys at WD for getting the new drivers in shape!" * tag 'riscv-for-linus-4.19-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: dt-bindings: interrupt-controller: SiFive Plaform Level Interrupt Controller dt-bindings: interrupt-controller: RISC-V local interrupt controller RISC-V: Fix !CONFIG_SMP compilation error irqchip: add a SiFive PLIC driver RISC-V: Add the directive for alignment of stvec's value clocksource: new RISC-V SBI timer driver RISC-V: implement low-level interrupt handling RISC-V: add a definition for the SIE SEIE bit RISC-V: remove INTERRUPT_CAUSE_* defines from asm/irq.h RISC-V: simplify software interrupt / IPI code RISC-V: remove timer leftovers RISC-V: Add early printk support via the SBI console RISC-V: Don't increment sepc after breakpoint. RISC-V: implement __lshrti3. RISC-V: Use KBUILD_CFLAGS instead of KCFLAGS when building the vDSO commit 250ea7c5f56e350cdafebe6b87478b00db4f7af8 Author: Lihua Yao Date: Wed Aug 15 23:20:35 2018 +0800 ALSA: ac97: fix unbalanced pm_runtime_enable Runtime PM is enabled at ac97_bus_probe() and should be disabled at ac97_bus_remove(). Fixes: 74426fbff66e ("ALSA: ac97: add an ac97 bus") Signed-off-by: Lihua Yao Acked-by: Robert Jarzmik Cc: Signed-off-by: Takashi Iwai commit d15ec0b482ff502e4e19e43d15aa5072e4290199 Author: Lihua Yao Date: Wed Aug 15 23:20:34 2018 +0800 ALSA: ac97: fix check of pm_runtime_get_sync failure pm_runtime_get_sync returns negative on failure. Fixes: 74426fbff66e ("ALSA: ac97: add an ac97 bus") Signed-off-by: Lihua Yao Acked-by: Robert Jarzmik Cc: Signed-off-by: Takashi Iwai commit c7b8170790c19293acd835dc50b8247ec207d4a3 Author: Lihua Yao Date: Wed Aug 15 20:59:46 2018 +0800 ALSA: ac97: fix device initialization in the compat layer ac97->dev is an object of 'struct device' type. It should be initialized via device_initialize() or device_register(). Fixes: 74426fbff66e ("ALSA: ac97: add an ac97 bus") Signed-off-by: Lihua Yao Tested-by: Robert Jarzmik Acked-by: Robert Jarzmik Cc: Signed-off-by: Takashi Iwai commit 1d0926e99de7b486321e3db924b445531eea5e18 Merge: 08b5fa819970 3d27c4de8d4f Author: Linus Torvalds Date: Sun Aug 19 09:30:44 2018 -0700 Merge tag 'char-misc-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull UIO fix from Greg KH: "Here is a single UIO fix that I forgot to send before 4.18-final came out. It reverts a UIO patch that went in the 4.18 development window that was causing problems. This patch has been in linux-next for a while with no problems, I just forgot to send it earlier, or as part of the larger char/misc patch series from yesterday, my fault" * tag 'char-misc-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: Revert "uio: use request_threaded_irq instead" commit 08b5fa819970c318e58ab638f497633c25971813 Merge: 7f02e1ce4a13 13fe7056bebb Author: Linus Torvalds Date: Sat Aug 18 16:48:07 2018 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a new driver for Rohm BU21029 touch controller - new bitmap APIs: bitmap_alloc, bitmap_zalloc and bitmap_free - updates to Atmel, eeti. pxrc and iforce drivers - assorted driver cleanups and fixes. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (57 commits) MAINTAINERS: Add PhoenixRC Flight Controller Adapter Input: do not use WARN() in input_alloc_absinfo() Input: mark expected switch fall-throughs Input: raydium_i2c_ts - use true and false for boolean values Input: evdev - switch to bitmap API Input: gpio-keys - switch to bitmap_zalloc() Input: elan_i2c_smbus - cast sizeof to int for comparison bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free() md: Avoid namespace collision with bitmap API dm: Avoid namespace collision with bitmap API Input: pm8941-pwrkey - add resin entry Input: pm8941-pwrkey - abstract register offsets and event code Input: iforce - reorganize joystick configuration lists Input: atmel_mxt_ts - move completion to after config crc is updated Input: atmel_mxt_ts - don't report zero pressure from T9 Input: atmel_mxt_ts - zero terminate config firmware file Input: atmel_mxt_ts - refactor config update code to add context struct Input: atmel_mxt_ts - config CRC may start at T71 Input: atmel_mxt_ts - remove unnecessary debug on ENOMEM Input: atmel_mxt_ts - remove duplicate setup of ABS_MT_PRESSURE ... commit 7f02e1ce4a13edf295fcedbc663a8ca69bc1ff6e Merge: 9a96d63aa83c ddb34f480d1b Author: Linus Torvalds Date: Sat Aug 18 16:45:27 2018 -0700 Merge tag 'hwlock-v4.19' of git://github.com/andersson/remoteproc Pull hwspinlock updates from Bjorn Andersson: "This introduces devres helpers and an API to request a lock by name, then migrates the sprd SPI driver to use these" * tag 'hwlock-v4.19' of git://github.com/andersson/remoteproc: hwspinlock: Fix incorrect return pointers spi: sprd: Change to use devm_hwspin_lock_request_specific() spi: sprd: Replace of_hwspin_lock_get_id() with of_hwspin_lock_get_id_byname() hwspinlock: Fix one comment mistake hwspinlock: Remove redundant config hwspinlock: Add devm_xxx() APIs to register/unregister one hwlock controller hwspinlock: Add devm_xxx() APIs to request/free hwlock hwspinlock: Add one new API to support getting a specific hwlock by the name commit 9a96d63aa83c629e0c71f377fea7066fcf66d765 Merge: c54fc8658b50 00b645e0b4e4 Author: Linus Torvalds Date: Sat Aug 18 16:43:57 2018 -0700 Merge tag 'rpmsg-v4.19' of git://github.com/andersson/remoteproc Pull rpmsg updates from Bjorn Andersson: "This fixes a few compile and kerneldoc warnings, allows rpmsg devices to handle power domains, allow for labeling GLINK edges and supports compat for rpmsg_char" * tag 'rpmsg-v4.19' of git://github.com/andersson/remoteproc: rpmsg: Add compat ioctl for rpmsg char driver rpmsg: glink: Store edge name for glink device dt-bindings: soc: qcom: Add label for GLINK bindings rpmsg: core: add support to power domains for devices rpmsg: smd: fix kerneldoc warnings rpmsg: glink: Fix various kerneldoc warnings. rpmsg: glink: correctly annotate intent members rpmsg: smd: Add missing include of sizes.h commit c54fc8658b501b412d006886ebe3e8543a30a122 Merge: 6eaac34ff30e b2201ee554a5 Author: Linus Torvalds Date: Sat Aug 18 16:42:04 2018 -0700 Merge tag 'rproc-v4.19' of git://github.com/andersson/remoteproc Pull remoteproc updates from Bjorn Andersson: "This adds support for pre-start and post-shutdown hooks for remoteproc subdevices, refactors the Qualcomm Hexagon support to allow reuse between several drivers, makes authentication in the MDT file loader optional, migrates a few format strings to use %pK and migrates the Davinci driver to use the reset framework" * tag 'rproc-v4.19' of git://github.com/andersson/remoteproc: remoteproc/davinci: use the reset framework remoteproc/davinci: Mark error recovery as disabled remoteproc: st_slim: replace "%p" with "%pK" remoteproc: replace "%p" with "%pK" remoteproc: qcom: fix Q6V5_WCSS dependencies remoteproc: Reset table_ptr in rproc_start() failure paths remoteproc: qcom: q6v5-pil: fix modem hang on SDM845 after axis2 clk unvote remoteproc: qcom q6v5: fix modular build remoteproc: Introduce prepare and unprepare for subdevices remoteproc: rename subdev probe and remove functions remoteproc: Make client initialize ops in rproc_subdev remoteproc: Make start and stop in subdev optional remoteproc: Rename subdev functions to start/stop remoteproc: qcom: Introduce Hexagon V5 based WCSS driver remoteproc: qcom: q6v5-pil: Use common q6v5 helpers remoteproc: qcom: adsp: Use common q6v5 helpers remoteproc: q6v5: Extract common resource handling remoteproc: qcom: mdt_loader: Make the firmware authentication optional commit 6eaac34ff30e189fda28110298ca9fbfb2f51e28 Merge: 13bf2cf9e2d1 12aea518a202 Author: Linus Torvalds Date: Sat Aug 18 16:16:57 2018 -0700 Merge tag 'linux-watchdog-4.19-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - add MEN 16z069 IP-Core driver - renesas-wdt: add support for the R8A77990 wdt - stm32_iwdg: Add stm32mp1 support and pclk feature - sp805_wdt, orion_wdt, sprd_wdt: several improvements - imx2_wdt, stmp3xxx: switch to SPDX identifier * tag 'linux-watchdog-4.19-rc1' of git://www.linux-watchdog.org/linux-watchdog: watchdog: fix dependencies of menz69_wdt.o watchdog: sp805: Add clock-frequency property watchdog: add driver for the MEN 16z069 IP-Core watchdog: sprd_wdt: Remove redundant dev_err call in sprd_wdt_probe() watchdog: stmp3xxx: Switch to SPDX identifier watchdog: imx2_wdt: Switch to SPDX identifier watchdog: sp805: set WDOG_HW_RUNNING when appropriate watchdog: sp805: add 'timeout-sec' DT property support dt-bindings: watchdog: Add optional 'timeout-sec' property for sp805 dt-bindings: watchdog: Consolidate SP805 binding docs watchdog: orion_wdt: Mark watchdog as active when running at probe watchdog: stm32: add pclk feature for stm32mp1 dt-bindings: watchdog: add stm32mp1 support dt-bindings: watchdog: renesas-wdt: Add support for the R8A77990 wdt commit 13bf2cf9e2d1e0e56088ec6342c2726704100647 Merge: bbd60bffaf78 3257d86182cc Author: Linus Torvalds Date: Sat Aug 18 15:55:59 2018 -0700 Merge tag 'dmaengine-4.19-rc1' of git://git.infradead.org/users/vkoul/slave-dma Pull DMAengine updates from Vinod Koul: "This round brings couple of framework changes, a new driver and usual driver updates: - new managed helper for dmaengine framework registration - split dmaengine pause capability to pause and resume and allow drivers to report that individually - update dma_request_chan_by_mask() to handle deferred probing - move imx-sdma to use virt-dma - new driver for Actions Semi Owl family S900 controller - minor updates to intel, renesas, mv_xor, pl330 etc" * tag 'dmaengine-4.19-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (46 commits) dmaengine: Add Actions Semi Owl family S900 DMA driver dt-bindings: dmaengine: Add binding for Actions Semi Owl SoCs dmaengine: sh: rcar-dmac: Should not stop the DMAC by rcar_dmac_sync_tcr() dmaengine: mic_x100_dma: use the new helper to simplify the code dmaengine: add a new helper dmaenginem_async_device_register dmaengine: imx-sdma: add memcpy interface dmaengine: imx-sdma: add SDMA_BD_MAX_CNT to replace '0xffff' dmaengine: dma_request_chan_by_mask() to handle deferred probing dmaengine: pl330: fix irq race with terminate_all dmaengine: Revert "dmaengine: mv_xor_v2: enable COMPILE_TEST" dmaengine: mv_xor_v2: use {lower,upper}_32_bits to configure HW descriptor address dmaengine: mv_xor_v2: enable COMPILE_TEST dmaengine: mv_xor_v2: move unmap to before callback dmaengine: mv_xor_v2: convert callback to helper function dmaengine: mv_xor_v2: kill the tasklets upon exit dmaengine: mv_xor_v2: explicitly freeup irq dmaengine: sh: rcar-dmac: Add dma_pause operation dmaengine: sh: rcar-dmac: add a new function to clear CHCR.DE with barrier dmaengine: idma64: Support dmaengine_terminate_sync() dmaengine: hsu: Support dmaengine_terminate_sync() ... commit bbd60bffaf780464298cb7a39852f7f1065f1726 Merge: 307797159ac2 7f38abf220e2 Author: Linus Torvalds Date: Sat Aug 18 15:54:05 2018 -0700 Merge tag 'mmc-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: "Updates for MMC for v4.19. MMC core: - Add some fine-grained hooks to further support HS400 tuning - Improve error path for bus width setting for HS400es - Use a common method when checking R1 status MMC host: - renesas_sdhi: Add r8a77990 support - renesas_sdhi: Add eMMC HS400 mode support - tmio/renesas_sdhi: Improve tuning/clock management - tmio: Add eMMC HS400 mode support - sunxi: Add support for 3.3V eMMC DDR mode - mmci: Initial support to manage variant specific callbacks - sdhci: Don't try 3.3V I/O voltage if not supported - sdhci-pci-dwc-mshc: Add driver to support Synopsys dwc mshc SDHCI PCI - sdhci-of-dwcmshc: Add driver to support Synopsys DWC MSHC SDHCI - sdhci-msm: Add support for new version sdcc V5 - sdhci-pci-o2micro: Add support for O2 eMMC HS200 mode - sdhci-pci-o2micro: Add support for O2 hardware tuning - sdhci-pci-o2micro: Add MSI interrupt support for O2 SD host - sdhci-pci: Add support for Intel ICP - sdhci-tegra: Prevent ACMD23 and HS200 mode on Tegra 3 - sdhci-tegra: Fix eMMC DDR52 mode - sdhci-tegra: Improve clock management - dw_mmc-rockchip: Document compatible string for px30 - sdhci-esdhc-imx: Add support for 3.3V eMMC DDR mode - sdhci-of-esdhc: Set proper DMA mask for ls104x chips - sdhci-of-esdhc: Improve clock management - sdhci-of-arasan: Add a quirk to manage unstable clocks - dw_mmc-exynos: Address potential external abort during system resume - pxamci: Add support for common MMC DT bindings - pxamci: Several cleanups and improvements - pxamci: Merge immutable branch for pxa to switch to DMA slave maps" * tag 'mmc-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (56 commits) mmc: core: improve reasonableness of bus width setting for HS400es mmc: tmio: remove unneeded variable in tmio_mmc_start_command() mmc: renesas_sdhi: Fix sampling clock position selecting mmc: tmio: Fix tuning flow mmc: sunxi: remove output of virtual base address dt-bindings: mmc: rockchip-dw-mshc: add description for px30 mmc: renesas_sdhi: Add r8a77990 support mmc: sunxi: allow 3.3V DDR when DDR is available mmc: mmci: Add and implement a ->dma_setup() callback for qcom dml mmc: mmci: Initial support to manage variant specific callbacks mmc: tegra: Force correct divider calculation on DDR50/52 mmc: sdhci: Add MSI interrupt support for O2 SD host mmc: sdhci: Add support for O2 hardware tuning mmc: sdhci: Export sdhci tuning function symbol mmc: sdhci: Change O2 Host HS200 mode clock frequency to 200MHz mmc: sdhci: Add support for O2 eMMC HS200 mode mmc: tegra: Add and use tegra_sdhci_get_max_clock() mmc: sdhci-esdhc-imx: fix indent mmc: sdhci-esdhc-imx: disable clocks before changing frequency mmc: tegra: prevent ACMD23 on Tegra 3 ... commit bb107456ba5a85e50567d56b0c8050c2ad199e9b Author: Haishuang Yan Date: Sat Aug 18 22:43:48 2018 +0800 ip6_vti: simplify stats handling in vti6_xmit Same as ip_vti, use iptunnel_xmit_stats to updates stats in tunnel xmit code path. Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller commit 307797159ac25fe5a2048bf5c6a5718298edca57 Author: Linus Torvalds Date: Sat Aug 18 12:30:42 2018 -0700 pcmcia: remove long deprecated pcmcia_request_exclusive_irq() function This function was created as a deprecated fallback case back in 2010 by commit eb14120f743d ("pcmcia: re-work pcmcia_request_irq()") for legacy cases. Actual in-kernel users haven't been around for a long while. The last in-kernel user was apparently removed four years ago by commit 5f5316fcd08e ("am2150: Update nmclan_cs.c to use update PCMCIA API"). Just remove it entirely. Signed-off-by: Linus Torvalds commit 771c035372a036f83353eef46dbb829780330234 Author: Linus Torvalds Date: Sat Aug 18 12:19:56 2018 -0700 deprecate the '__deprecated' attribute warnings entirely and for good We haven't had lots of deprecation warnings lately, but the rdma use of it made them flare up again. They are not useful. They annoy everybody, and nobody ever does anything about them, because it's always "somebody elses problem". And when people start thinking that warnings are normal, they stop looking at them, and the real warnings that mean something go unnoticed. If you want to get rid of a function, just get rid of it. Convert every user to the new world order. And if you can't do that, then don't annoy everybody else with your marking that says "I couldn't be bothered to fix this, so I'll just spam everybody elses build logs with warnings about my laziness". Make a kernelnewbies wiki page about things that could be cleaned up, write a blog post about it, or talk to people on the mailing lists. But don't add warnings to the kernel build about cleanup that you think should happen but you aren't doing yourself. Don't. Just don't. Signed-off-by: Linus Torvalds commit a18d783fedfe6f9b720afe901db9501ce116ed81 Merge: d5acba26bfa0 d2fc88a61b4e Author: Linus Torvalds Date: Sat Aug 18 11:44:53 2018 -0700 Merge tag 'driver-core-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here are all of the driver core and related patches for 4.19-rc1. Nothing huge here, just a number of small cleanups and the ability to now stop the deferred probing after init happens. All of these have been in linux-next for a while with only a merge issue reported" * tag 'driver-core-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (21 commits) base: core: Remove WARN_ON from link dependencies check drivers/base: stop new probing during shutdown drivers: core: Remove glue dirs from sysfs earlier driver core: remove unnecessary function extern declare sysfs.h: fix non-kernel-doc comment PM / Domains: Stop deferring probe at the end of initcall iommu: Remove IOMMU_OF_DECLARE iommu: Stop deferring probe at end of initcalls pinctrl: Support stopping deferred probe after initcalls dt-bindings: pinctrl: add a 'pinctrl-use-default' property driver core: allow stopping deferred probe after init driver core: add a debugfs entry to show deferred devices sysfs: Fix internal_create_group() for named group updates base: fix order of OF initialization linux/device.h: fix kernel-doc notation warning Documentation: update firmware loader fallback reference kobject: Replace strncpy with memcpy drivers: base: cacheinfo: use OF property_read_u32 instead of get_property,read_number kernfs: Replace strncpy with memcpy device: Add #define dev_fmt similar to #define pr_fmt ... commit d5acba26bfa097a618be425522b1ec4269d3edaf Merge: 2475c515d403 128f38041035 Author: Linus Torvalds Date: Sat Aug 18 11:04:51 2018 -0700 Merge tag 'char-misc-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver updates from Greg KH: "Here is the bit set of char/misc drivers for 4.19-rc1 There is a lot here, much more than normal, seems like everyone is writing new driver subsystems these days... Anyway, major things here are: - new FSI driver subsystem, yet-another-powerpc low-level hardware bus - gnss, finally an in-kernel GPS subsystem to try to tame all of the crazy out-of-tree drivers that have been floating around for years, combined with some really hacky userspace implementations. This is only for GNSS receivers, but you have to start somewhere, and this is great to see. Other than that, there are new slimbus drivers, new coresight drivers, new fpga drivers, and loads of DT bindings for all of these and existing drivers. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (255 commits) android: binder: Rate-limit debug and userspace triggered err msgs fsi: sbefifo: Bump max command length fsi: scom: Fix NULL dereference misc: mic: SCIF Fix scif_get_new_port() error handling misc: cxl: changed asterisk position genwqe: card_base: Use true and false for boolean values misc: eeprom: assignment outside the if statement uio: potential double frees if __uio_register_device() fails eeprom: idt_89hpesx: clean up an error pointer vs NULL inconsistency misc: ti-st: Fix memory leak in the error path of probe() android: binder: Show extra_buffers_size in trace firmware: vpd: Fix section enabled flag on vpd_section_destroy platform: goldfish: Retire pdev_bus goldfish: Use dedicated macros instead of manual bit shifting goldfish: Add missing includes to goldfish.h mux: adgs1408: new driver for Analog Devices ADGS1408/1409 mux dt-bindings: mux: add adi,adgs1408 Drivers: hv: vmbus: Cleanup synic memory free path Drivers: hv: vmbus: Remove use of slow_virt_to_phys() Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind() ... commit 2475c515d4031c494ff452508a8bf8c281ec6e56 Merge: 336722eb9d97 e4f6a44c4aec Author: Linus Torvalds Date: Sat Aug 18 11:00:00 2018 -0700 Merge tag 'staging-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging and IIO updates from Greg KH: "Here are the big staging/iio patches for 4.19-rc1. Lots of churn here, with tons of cleanups happening in staging drivers, a removal of an old crypto driver that no one was using (skein), and the addition of some new IIO drivers. Also added was a "gasket" driver from Google that needs loads of work and the erofs filesystem. Even with adding all of the new drivers and a new filesystem, we are only adding about 1000 lines overall to the kernel linecount, which shows just how much cleanup happened, and how big the unused crypto driver was. All of these have been in the linux-next tree for a while now with no reported issues" * tag 'staging-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (903 commits) staging:rtl8192u: Remove unused macro definitions - Style staging:rtl8192u: Add spaces around '+' operator - Style staging:rtl8192u: Remove stale comment - Style staging: rtl8188eu: remove unused mp_custom_oid.h staging: fbtft: Add spaces around / - Style staging: fbtft: Erases some repetitive usage of function name - Style staging: fbtft: Adjust some empty-line problems - Style staging: fbtft: Removes one nesting level to help readability - Style staging: fbtft: Changes gamma table to define. staging: fbtft: A bit more information on dev_err. staging: fbtft: Fixes some alignment issues - Style staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style staging: rtl8188eu: remove unused array dB_Invert_Table staging: rtl8188eu: remove whitespace, add missing blank line staging: rtl8188eu: use is_multicast_ether_addr in rtw_sta_mgt.c staging: rtl8188eu: remove whitespace - style staging: rtl8188eu: cleanup block comment - style staging: rtl8188eu: use is_multicast_ether_addr in rtl8188eu_xmit.c staging: rtl8188eu: use is_multicast_ether_addr in recv_linux.c staging: rtlwifi: refactor rtl_get_tcb_desc ... commit 336722eb9d9732c5a497fb6299bf38cde413592b Merge: 5695d5d1970f 47ac76662ca9 Author: Linus Torvalds Date: Sat Aug 18 10:50:41 2018 -0700 Merge tag 'tty-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here is the big tty and serial driver pull request for 4.19-rc1. It's not all that big, just a number of small serial driver updates and fixes, along with some better vt handling for unicode characters for those using braille terminals. All of these patches have been in linux-next for a long time with no reported issues" * tag 'tty-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (73 commits) tty: serial: 8250: Revert NXP SC16C2552 workaround serial: 8250_exar: Read INT0 from slave device, too tty: rocket: Fix possible buffer overwrite on register_PCI serial: 8250_dw: Add ACPI support for uart on Broadcom SoC serial: 8250_dw: always set baud rate in dw8250_set_termios dt-bindings: serial: Add binding for uartlite tty: serial: uartlite: Add support for suspend and resume tty: serial: uartlite: Add clock adaptation tty: serial: uartlite: Add structure for private data serial: sh-sci: Improve support for separate TEI and DRI interrupts serial: sh-sci: Remove SCIx_RZ_SCIFA_REGTYPE serial: sh-sci: Allow for compressed SCIF address serial: sh-sci: Improve interrupts description serial: 8250: Use cached port name directly in messages serial: 8250_exar: Drop unused variable in pci_xr17v35x_setup() vt: drop unused struct vt_struct vt: avoid a VLA in the unicode screen scroll function vt: add /dev/vcsu* to devices.txt vt: coherence validation code for the unicode screen buffer vt: selection: take screen contents from uniscr if available ... commit 5695d5d1970f975de059bb6dec76941440f62488 Merge: 1f7a4c73a739 29c692c96b3a Author: Linus Torvalds Date: Sat Aug 18 10:21:49 2018 -0700 Merge tag 'usb-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/PHY updates from Greg KH: "Here is the big USB and phy driver patch set for 4.19-rc1. Nothing huge but there was a lot of work that happened this development cycle: - lots of type-c work, with drivers graduating out of staging, and displayport support being added. - new PHY drivers - the normal collection of gadget driver updates and fixes - code churn to work on the urb handling path, using irqsave() everywhere in anticipation of making this codepath a lot simpler in the future. - usbserial driver fixes and reworks - other misc changes All of these have been in linux-next with no reported issues for a while" * tag 'usb-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (159 commits) USB: serial: pl2303: add a new device id for ATEN usb: renesas_usbhs: Kconfig: convert to SPDX identifiers usb: dwc3: gadget: Check MaxPacketSize from descriptor usb: dwc2: Turn on uframe_sched on "stm32f4x9_fsotg" platforms usb: dwc2: Turn on uframe_sched on "amlogic" platforms usb: dwc2: Turn on uframe_sched on "his" platforms usb: dwc2: Turn on uframe_sched on "bcm" platforms usb: dwc2: gadget: ISOC's starting flow improvement usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic. usb: dwc3: core: Enable AutoRetry feature in the controller usb: dwc3: Set default mode for dwc_usb31 usb: gadget: udc: renesas_usb3: Add register of usb role switch usb: dwc2: replace ioread32/iowrite32_rep with dwc2_readl/writel_rep usb: dwc2: Modify dwc2_readl/writel functions prototype usb: dwc3: pci: Intel Merrifield can be host usb: dwc3: pci: Supply device properties via driver data arm64: dts: dwc3: description of incr burst type usb: dwc3: Enable undefined length INCR burst type usb: dwc3: add global soc bus configuration reg0 usb: dwc3: Describe 'wakeup_work' field of struct dwc3_pci ... commit 6e3bf9b04f79a009a7ff336ba7353ab565daaec8 Merge: 3fe49d699a96 f6069b9aa993 Author: David S. Miller Date: Sat Aug 18 10:02:49 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2018-08-18 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix a BPF selftest failure in test_cgroup_storage due to rlimit restrictions, from Yonghong. 2) Fix a suspicious RCU rcu_dereference_check() warning triggered from removing a device's XDP memory allocator by using the correct rhashtable lookup function, from Tariq. 3) A batch of BPF sockmap and ULP fixes mainly fixing leaks and races as well as enforcing module aliases for ULPs. Another fix for BPF map redirect to make them work again with tail calls, from Daniel. 4) Fix XDP BPF samples to unload their programs upon SIGTERM, from Jesper. ==================== Signed-off-by: David S. Miller commit 3fe49d699a9604eed851eb45e1e0adab0e25688e Merge: bfdd19ad80f2 feb9f55c33e5 Author: David S. Miller Date: Sat Aug 18 09:59:19 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter/IPVS fixes for net The following patchset contains Netfilter/IPVS fixes for your net tree: 1) Infinite loop in IPVS when net namespace is released, from Tan Hu. 2) Do not show negative timeouts in ip_vs_conn by using the new jiffies_delta_to_msecs(), patches from Matteo Croce. 3) Set F_IFACE flag for linklocal addresses in ip6t_rpfilter, from Florian Westphal. 4) Fix overflow in set size allocation, from Taehee Yoo. 5) Use netlink_dump_start() from ctnetlink to fix memleak from the error path, again from Florian. 6) Register nfnetlink_subsys in last place, otherwise netns init path may lose race and see net->nft uninitialized data. This also reverts previous attempt to fix this by increase netns refcount, patches from Florian. 7) Remove conntrack entries on layer 4 protocol tracker module removal, from Florian. 8) Use GFP_KERNEL_ACCOUNT for xtables blob allocation, from Michal Hocko. 9) Get tproxy documentation in sync with existing codebase, from Mate Eckl. 10) Honor preset layer 3 protocol via ctx->family in the new nft_ct timeout infrastructure, from Harsha Sharma. 11) Let uapi nfnetlink_osf.h compile standalone with no errors, from Dmitry V. Levin. 12) Missing braces compilation warning in nft_tproxy, patch from Mate Eclk. 13) Disregard bogus check to bail out on non-anonymous sets from the dynamic set update extension. ==================== Signed-off-by: David S. Miller commit 5804b11034a21e4287daaf017c5ad60ad7af8d67 Merge: 13e091b6dd0e 6855dc41b246 Author: Ingo Molnar Date: Sat Aug 18 13:11:51 2018 +0200 Merge tag 'perf-core-for-mingo-4.19-20180815' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: kernel: - kallsyms, x86: Export addresses of PTI entry trampolines (Alexander Shishkin) - kallsyms: Simplify update_iter_mod() (Adrian Hunter) - x86: Add entry trampolines to kcore (Adrian Hunter) Hardware tracing: - Fix auxtrace queue resize (Adrian Hunter) Arch specific: - Fix uninitialized ARM SPE record error variable (Kim Phillips) - Fix trace event post-processing in powerpc (Sandipan Das) Build: - Fix check-headers.sh AND list path of execution (Alexander Kapshuk) - Remove -mcet and -fcf-protection when building the python binding with older clang versions (Arnaldo Carvalho de Melo) - Make check-headers.sh check based on kernel dir (Jiri Olsa) - Move syscall_64.tbl check into check-headers.sh (Jiri Olsa) Infrastructure: - Check for null when copying nsinfo. (Benno Evers) Libraries: - Rename libtraceevent prefixes, prep work for making it a shared library generaly available (Tzvetomir Stoyanov (VMware)) Signed-off-by: Arnaldo Carvalho de Melo commit 1f7a4c73a739a63b3f108d8eda6f947fdc70dd65 Merge: 6ada4e282679 edcd9d977354 Author: Linus Torvalds Date: Fri Aug 17 17:27:58 2018 -0700 Merge tag '9p-for-4.19-2' of git://github.com/martinetd/linux Pull 9p updates from Dominique Martinet: "This contains mostly fixes (6 to be backported to stable) and a few changes, here is the breakdown: - rework how fids are attributed by replacing some custom tracking in a list by an idr - for packet-based transports (virtio/rdma) validate that the packet length matches what the header says - a few race condition fixes found by syzkaller - missing argument check when NULL device is passed in sys_mount - a few virtio fixes - some spelling and style fixes" * tag '9p-for-4.19-2' of git://github.com/martinetd/linux: (21 commits) net/9p/trans_virtio.c: add null terminal for mount tag 9p/virtio: fix off-by-one error in sg list bounds check 9p: fix whitespace issues 9p: fix multiple NULL-pointer-dereferences fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed 9p: validate PDU length net/9p/trans_fd.c: fix race by holding the lock net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree() net/9p/virtio: Fix hard lockup in req_done net/9p/trans_virtio.c: fix some spell mistakes in comments 9p/net: Fix zero-copy path in the 9p virtio transport 9p: Embed wait_queue_head into p9_req_t 9p: Replace the fidlist with an IDR 9p: Change p9_fid_create calling convention 9p: Fix comment on smp_wmb net/9p/client.c: version pointer uninitialized fs/9p/v9fs.c: fix spelling mistake "Uknown" -> "Unknown" net/9p: fix error path of p9_virtio_probe 9p/net/protocol.c: return -ENOMEM when kmalloc() failed net/9p/client.c: add missing '\n' at the end of p9_debug() ... commit 6ada4e2826794bdf8d88f938a9ced0b80894b037 Merge: 9bd553929f68 1e9264192961 Author: Linus Torvalds Date: Fri Aug 17 16:49:31 2018 -0700 Merge branch 'akpm' (patches from Andrew) Merge updates from Andrew Morton: - a few misc things - a few Y2038 fixes - ntfs fixes - arch/sh tweaks - ocfs2 updates - most of MM * emailed patches from Andrew Morton : (111 commits) mm/hmm.c: remove unused variables align_start and align_end fs/userfaultfd.c: remove redundant pointer uwq mm, vmacache: hash addresses based on pmd mm/list_lru: introduce list_lru_shrink_walk_irq() mm/list_lru.c: pass struct list_lru_node* as an argument to __list_lru_walk_one() mm/list_lru.c: move locking from __list_lru_walk_one() to its caller mm/list_lru.c: use list_lru_walk_one() in list_lru_walk_node() mm, swap: make CONFIG_THP_SWAP depend on CONFIG_SWAP mm/sparse: delete old sparse_init and enable new one mm/sparse: add new sparse_init_nid() and sparse_init() mm/sparse: move buffer init/fini to the common place mm/sparse: use the new sparse buffer functions in non-vmemmap mm/sparse: abstract sparse buffer allocations mm/hugetlb.c: don't zero 1GiB bootmem pages mm, page_alloc: double zone's batchsize mm/oom_kill.c: document oom_lock mm/hugetlb: remove gigantic page support for HIGHMEM mm, oom: remove sleep from under oom_lock kernel/dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous() mm/cma: remove unsupported gfp_mask parameter from cma_alloc() ... commit cfd54de3b0e4f82b3f2b80230726f74a6bec964f Author: Paul Burton Date: Fri Aug 17 15:36:24 2018 -0700 MIPS: Avoid move psuedo-instruction whilst using MIPS_ISA_LEVEL MIPS_ISA_LEVEL is always defined as the 64 bit ISA that is a compatible superset of the ISA that the kernel build is targeting, and is used to allow us to emit instructions that we may detect support for at runtime. When we use a .set MIPS_ISA_LEVEL directive & are building a 32-bit kernel, we therefore are temporarily allowing the assembler to generate MIPS64 instructions. Using the move pseudo-instruction whilst this is the case is problematic because the assembler is likely to emit a daddu instruction which will generate a reserved instruction exception when executed on a MIPS32 machine. Unfortunately the combination of commit a0a5ac3ce8fe ("MIPS: Fix delay slot bug in `atomic*_sub_if_positive' for R10000_LLSC_WAR") and commit 4936084c2ee2 ("MIPS: Cleanup R10000_LLSC_WAR logic in atomic.h") causes us to do exactly this in atomic_sub_if_positive(), and the result is MIPS64 daddu instructions in 32-bit kernels. Fix this by using .set mips0 to restore the default ISA after the ll instruction, and use .set MIPS_ISA_LEVEL again prior to the sc. This ensures everything but the ll & sc are assembled using the default ISA for the kernel build & the move pseudo-instruction is emitted as a MIPS32 addu instruction. We appear to have another pre-existing instance of the same issue in our atomic_fetch_*_relaxed() functions, and fix that up too by moving our .set move0 such that it occurs prior to use of the move pseudo-instruction. Signed-off-by: Paul Burton Fixes: a0a5ac3ce8fe ("MIPS: Fix delay slot bug in `atomic*_sub_if_positive' for R10000_LLSC_WAR") Fixes: 4936084c2ee2 ("MIPS: Cleanup R10000_LLSC_WAR logic in atomic.h") Patchwork: https://patchwork.linux-mips.org/patch/20253/ Cc: James Hogan Cc: Joshua Kinard Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 1e9264192961aa519595170aa8b0f7651a2ad28e Author: Colin Ian King Date: Fri Aug 17 15:50:07 2018 -0700 mm/hmm.c: remove unused variables align_start and align_end Variables align_start and align_end are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'align_start' set but not used [-Wunused-but-set-variable] warning: variable 'align_size' set but not used [-Wunused-but-set-variable] Link: http://lkml.kernel.org/r/20180714161124.3923-1-colin.king@canonical.com Signed-off-by: Colin Ian King Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5241d4727479aad77af50b80757c38268bfa4560 Author: Colin Ian King Date: Fri Aug 17 15:50:01 2018 -0700 fs/userfaultfd.c: remove redundant pointer uwq Pointer uwq is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'uwq' set but not used [-Wunused-but-set-variable] Link: http://lkml.kernel.org/r/20180717090802.18357-1-colin.king@canonical.com Signed-off-by: Colin Ian King Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ddbf369c0a33924f76d092985bd20d9310f43d7f Author: David Rientjes Date: Fri Aug 17 15:49:58 2018 -0700 mm, vmacache: hash addresses based on pmd When perf profiling a wide variety of different workloads, it was found that vmacache_find() had higher than expected cost: up to 0.08% of cpu utilization in some cases. This was found to rival other core VM functions such as alloc_pages_vma() with thp enabled and default mempolicy, and the conditionals in __get_vma_policy(). VMACACHE_HASH() determines which of the four per-task_struct slots a vma is cached for a particular address. This currently depends on the pfn, so pfn 5212 occupies a different vmacache slot than its neighboring pfn 5213. vmacache_find() iterates through all four of current's vmacache slots when looking up an address. Hashing based on pfn, an address has ~1/VMACACHE_SIZE chance of being cached in the first vmacache slot, or about 25%, *if* the vma is cached. This patch hashes an address by its pmd instead of pte to optimize for workloads with good spatial locality. This results in a higher probability of vmas being cached in the first slot that is checked: normally ~70% on the same workloads instead of 25%. [rientjes@google.com: various updates] Link: http://lkml.kernel.org/r/alpine.DEB.2.21.1807231532290.109445@chino.kir.corp.google.com Link: http://lkml.kernel.org/r/alpine.DEB.2.21.1807091749150.114630@chino.kir.corp.google.com Signed-off-by: David Rientjes Reviewed-by: Andrew Morton Cc: Davidlohr Bueso Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6b51e88199ca4f75ff647eff28efd30bfcb08dc4 Author: Sebastian Andrzej Siewior Date: Fri Aug 17 15:49:55 2018 -0700 mm/list_lru: introduce list_lru_shrink_walk_irq() Provide list_lru_shrink_walk_irq() and let it behave like list_lru_walk_one() except that it locks the spinlock with spin_lock_irq(). This is used by scan_shadow_nodes() because its lock nests within the i_pages lock which is acquired with IRQ. This change allows to use proper locking promitives instead hand crafted lock_irq_disable() plus spin_lock(). There is no EXPORT_SYMBOL provided because the current user is in-kernel only. Add list_lru_shrink_walk_irq() which acquires the spinlock with the proper locking primitives. Link: http://lkml.kernel.org/r/20180716111921.5365-5-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Vladimir Davydov Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6e018968f8d384d84484eba8e4c90489a25d7095 Author: Sebastian Andrzej Siewior Date: Fri Aug 17 15:49:51 2018 -0700 mm/list_lru.c: pass struct list_lru_node* as an argument to __list_lru_walk_one() __list_lru_walk_one() is invoked with struct list_lru *lru, int nid as the first two argument. Those two are only used to retrieve struct list_lru_node. Since this is already done by the caller of the function for the locking, we can pass struct list_lru_node* directly and avoid the dance around it. Link: http://lkml.kernel.org/r/20180716111921.5365-4-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Vladimir Davydov Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6cfe57a96ba33139c57056185d5eee9018e3dedc Author: Sebastian Andrzej Siewior Date: Fri Aug 17 15:49:48 2018 -0700 mm/list_lru.c: move locking from __list_lru_walk_one() to its caller Move the locking inside __list_lru_walk_one() to its caller. This is a preparation step in order to introduce list_lru_walk_one_irq() which does spin_lock_irq() instead of spin_lock() for the locking. Link: http://lkml.kernel.org/r/20180716111921.5365-3-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Vladimir Davydov Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 87a5ffc163966b2eb675c9c863c0caccab3183f6 Author: Sebastian Andrzej Siewior Date: Fri Aug 17 15:49:45 2018 -0700 mm/list_lru.c: use list_lru_walk_one() in list_lru_walk_node() Patch series "mm/list_lru: Add list_lru_shrink_walk_irq() and a user". This series removes the local_irq_disable() around list_lru_shrink_walk() (as used by mm/workingset) by adding list_lru_shrink_walk_irq(). Vladimir Davydov preferred this over `irq' argument which I added to struct list_lru. The initial post (of this series) received a Reviewed-by tag by Vladimir Davydov which I added to each patch of the series. The series applies on top of akpm's tree which has Kirill's shrink_slab series and does not clash with it (akpm asked me to wait a week or so and repost it then). I tested the code paths by triggering the OOM-killer via memory over commit and lockdep did not complain (nor did I see any warnings). This patch (of 4): list_lru_walk_node() invokes __list_lru_walk_one() with -1 as the memcg_idx parameter. The same can be achieved by list_lru_walk_one() and passing NULL as memcg argument which then gets converted into -1. This is a preparation step when the spin_lock() function is lifted to the caller of __list_lru_walk_one(). Invoke list_lru_walk_one() instead __list_lru_walk_one() when possible. Link: http://lkml.kernel.org/r/20180716111921.5365-2-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Vladimir Davydov Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 14fef28414c365a979311821bbf1018a8290cc0f Author: Huang Ying Date: Fri Aug 17 15:49:41 2018 -0700 mm, swap: make CONFIG_THP_SWAP depend on CONFIG_SWAP CONFIG_THP_SWAP should depend on CONFIG_SWAP, because it's unreasonable to optimize swapping for THP (Transparent Huge Page) without basic swapping support. In original code, when CONFIG_SWAP=n and CONFIG_THP_SWAP=y, split_swap_cluster() will not be built because it is in swapfile.c, but it will be called in huge_memory.c. This doesn't trigger a build error in practice because the call site is enclosed by PageSwapCache(), which is defined to be constant 0 when CONFIG_SWAP=n. But this is fragile and should be fixed. The comments are fixed too to reflect the latest progress. Link: http://lkml.kernel.org/r/20180713021228.439-1-ying.huang@intel.com Fixes: 38d8b4e6bdc8 ("mm, THP, swap: delay splitting THP during swap out") Signed-off-by: "Huang, Ying" Reviewed-by: Dan Williams Reviewed-by: Naoya Horiguchi Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Dave Hansen Cc: Zi Yan Cc: Daniel Jordan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2a3cb8baef71e4dad4a6ec17f5f0db9e05f46a01 Author: Pavel Tatashin Date: Fri Aug 17 15:49:37 2018 -0700 mm/sparse: delete old sparse_init and enable new one Rename new_sparse_init() to sparse_init() which enables it. Delete old sparse_init() and all the code that became obsolete with. [pasha.tatashin@oracle.com: remove unused sparse_mem_maps_populate_node()] Link: http://lkml.kernel.org/r/20180716174447.14529-6-pasha.tatashin@oracle.com Link: http://lkml.kernel.org/r/20180712203730.8703-6-pasha.tatashin@oracle.com Signed-off-by: Pavel Tatashin Tested-by: Michael Ellerman [powerpc] Tested-by: Oscar Salvador Reviewed-by: Oscar Salvador Cc: Pasha Tatashin Cc: Abdul Haleem Cc: Baoquan He Cc: Daniel Jordan Cc: Dan Williams Cc: Dave Hansen Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: Jan Kara Cc: Jérôme Glisse Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Souptick Joarder Cc: Steven Sistare Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 85c77f79139062901727cc3bd87a65212c8c0a32 Author: Pavel Tatashin Date: Fri Aug 17 15:49:33 2018 -0700 mm/sparse: add new sparse_init_nid() and sparse_init() sparse_init() requires to temporary allocate two large buffers: usemap_map and map_map. Baoquan He has identified that these buffers are so large that Linux is not bootable on small memory machines, such as a kdump boot. The buffers are especially large when CONFIG_X86_5LEVEL is set, as they are scaled to the maximum physical memory size. Baoquan provided a fix, which reduces these sizes of these buffers, but it is much better to get rid of them entirely. Add a new way to initialize sparse memory: sparse_init_nid(), which only operates within one memory node, and thus allocates memory either in large contiguous block or allocates section by section. This eliminates the need for use of temporary buffers. For simplified bisecting and review temporarly call sparse_init() new_sparse_init(), the new interface is going to be enabled as well as old code removed in the next patch. Link: http://lkml.kernel.org/r/20180712203730.8703-5-pasha.tatashin@oracle.com Signed-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador Tested-by: Oscar Salvador Tested-by: Michael Ellerman [powerpc] Cc: Pasha Tatashin Cc: Abdul Haleem Cc: Baoquan He Cc: Daniel Jordan Cc: Dan Williams Cc: Dave Hansen Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: Jan Kara Cc: Jérôme Glisse Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Souptick Joarder Cc: Steven Sistare Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit afda57bc13410459fc957e93341ade7bebca36e2 Author: Pavel Tatashin Date: Fri Aug 17 15:49:30 2018 -0700 mm/sparse: move buffer init/fini to the common place Now that both variants of sparse memory use the same buffers to populate memory map, we can move sparse_buffer_init()/sparse_buffer_fini() to the common place. Link: http://lkml.kernel.org/r/20180712203730.8703-4-pasha.tatashin@oracle.com Signed-off-by: Pavel Tatashin Tested-by: Michael Ellerman [powerpc] Tested-by: Oscar Salvador Reviewed-by: Andrew Morton Cc: Pasha Tatashin Cc: Abdul Haleem Cc: Baoquan He Cc: Daniel Jordan Cc: Dan Williams Cc: Dave Hansen Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: Jan Kara Cc: Jérôme Glisse Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Souptick Joarder Cc: Steven Sistare Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e131c06b14b8601e2b1dbc7ec9cc6418c293a067 Author: Pavel Tatashin Date: Fri Aug 17 15:49:26 2018 -0700 mm/sparse: use the new sparse buffer functions in non-vmemmap non-vmemmap sparse also allocated large contiguous chunk of memory, and if fails falls back to smaller allocations. Use the same functions to allocate buffer as the vmemmap-sparse Link: http://lkml.kernel.org/r/20180712203730.8703-3-pasha.tatashin@oracle.com Signed-off-by: Pavel Tatashin Tested-by: Michael Ellerman [powerpc] Reviewed-by: Oscar Salvador Tested-by: Oscar Salvador Cc: Pasha Tatashin Cc: Abdul Haleem Cc: Baoquan He Cc: Daniel Jordan Cc: Dan Williams Cc: Dave Hansen Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: Jan Kara Cc: Jérôme Glisse Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Souptick Joarder Cc: Steven Sistare Cc: Vlastimil Babka Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 35fd1eb1e8212c02f6eae24335a9e5b80f9519b4 Author: Pavel Tatashin Date: Fri Aug 17 15:49:21 2018 -0700 mm/sparse: abstract sparse buffer allocations Patch series "sparse_init rewrite", v6. In sparse_init() we allocate two large buffers to temporary hold usemap and memmap for the whole machine. However, we can avoid doing that if we changed sparse_init() to operated on per-node bases instead of doing it on the whole machine beforehand. As shown by Baoquan http://lkml.kernel.org/r/20180628062857.29658-1-bhe@redhat.com The buffers are large enough to cause machine stop to boot on small memory systems. Another benefit of these changes is that they also obsolete CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER. This patch (of 5): When struct pages are allocated for sparse-vmemmap VA layout, we first try to allocate one large buffer, and than if that fails allocate struct pages for each section as we go. The code that allocates buffer is uses global variables and is spread across several call sites. Cleanup the code by introducing three functions to handle the global buffer: sparse_buffer_init() initialize the buffer sparse_buffer_fini() free the remaining part of the buffer sparse_buffer_alloc() alloc from the buffer, and if buffer is empty return NULL Define these functions in sparse.c instead of sparse-vmemmap.c because later we will use them for non-vmemmap sparse allocations as well. [akpm@linux-foundation.org: use PTR_ALIGN()] [akpm@linux-foundation.org: s/BUG_ON/WARN_ON/] Link: http://lkml.kernel.org/r/20180712203730.8703-2-pasha.tatashin@oracle.com Signed-off-by: Pavel Tatashin Tested-by: Michael Ellerman [powerpc] Reviewed-by: Oscar Salvador Tested-by: Oscar Salvador Cc: Pasha Tatashin Cc: Steven Sistare Cc: Daniel Jordan Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Dan Williams Cc: Jan Kara Cc: Jérôme Glisse Cc: Souptick Joarder Cc: Baoquan He Cc: Greg Kroah-Hartman Cc: Vlastimil Babka Cc: Wei Yang Cc: Dave Hansen Cc: David Rientjes Cc: Ingo Molnar Cc: Abdul Haleem Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 330d6e489a0ab49136561d7f792b1d81bcdbb83c Author: Cannon Matthews Date: Fri Aug 17 15:49:17 2018 -0700 mm/hugetlb.c: don't zero 1GiB bootmem pages When using 1GiB pages during early boot, use the new memblock_virt_alloc_try_nid_raw() to allocate memory without zeroing it. Zeroing out hundreds or thousands of GiB in a single core memset() call is very slow, and can make early boot last upwards of 20-30 minutes on multi TiB machines. The memory does not need to be zero'd as the hugetlb pages are always zero'd on page fault. Tested: Booted with ~3800 1G pages, and it booted successfully in roughly the same amount of time as with 0, as opposed to the 25+ minutes it would take before. Link: http://lkml.kernel.org/r/20180711213313.92481-1-cannonmatthews@google.com Signed-off-by: Cannon Matthews Acked-by: Mike Kravetz Acked-by: Michal Hocko Cc: Andres Lagar-Cavilla Cc: Peter Feiner Cc: David Matlack Cc: Greg Thelen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d8a759b5703519d37fa5b752f825cbfc06b57906 Author: Aaron Lu Date: Fri Aug 17 15:49:14 2018 -0700 mm, page_alloc: double zone's batchsize To improve page allocator's performance for order-0 pages, each CPU has a Per-CPU-Pageset(PCP) per zone. Whenever an order-0 page is needed, PCP will be checked first before asking pages from Buddy. When PCP is used up, a batch of pages will be fetched from Buddy to improve performance and the size of batch can affect performance. zone's batch size gets doubled last time by commit ba56e91c9401("mm: page_alloc: increase size of per-cpu-pages") over ten years ago. Since then, CPU has envolved a lot and CPU's cache sizes also increased. Dave Hansen is concerned the current batch size doesn't fit well with modern hardware and suggested me to do two things: first, use a page allocator intensive benchmark, e.g. will-it-scale/page_fault1 to find out how performance changes with different batch sizes on various machines and then choose a new default batch size; second, see how this new batch size work with other workloads. In the first test, we saw performance gains on high-core-count systems and little to no effect on older systems with more modest core counts. In this phase's test data, two candidates: 63 and 127 are chosen. In the second step, ebizzy, oltp, kbuild, pigz, netperf, vm-scalability and more will-it-scale sub-tests are tested to see how these two candidates work with these workloads and decides a new default according to their results. Most test results are flat. will-it-scale/page_fault2 process mode has 10%-18% performance increase on 4-sockets Skylake and Broadwell. vm-scalability/lru-file-mmap-read has 17%-47% performance increase for 4-sockets servers while for 2-sockets servers, it caused 3%-8% performance drop. Further analysis showed that, with a larger pcp->batch and thus larger pcp->high(the relationship of pcp->high=6 * pcp->batch is maintained in this patch), zone lock contention shifted to LRU add side lock contention and that caused performance drop. This performance drop might be mitigated by others' work on optimizing LRU lock. Another downside of increasing pcp->batch is, when PCP is used up and need to fetch a batch of pages from Buddy, since batch is increased, that time can be longer than before. My understanding is, this doesn't affect slowpath where direct reclaim and compaction dominates. For fastpath, throughput is a win(according to will-it-scale/page_fault1) but worst latency can be larger now. Overall, I think double the batch size from 31 to 63 is relatively safe and provide good performance boost for high-core-count systems. The two phase's test results are listed below(all tests are done with THP disabled). Phase one(will-it-scale/page_fault1) test results: Skylake-EX: increased batch size has a good effect on zone->lock contention, though LRU contention will rise at the same time and limited the final performance increase. batch score change zone_contention lru_contention total_contention 31 15345900 +0.00% 64% 8% 72% 53 17903847 +16.67% 32% 38% 70% 63 17992886 +17.25% 24% 45% 69% 73 18022825 +17.44% 10% 61% 71% 119 18023401 +17.45% 4% 66% 70% 127 18029012 +17.48% 3% 66% 69% 137 18036075 +17.53% 4% 66% 70% 165 18035964 +17.53% 2% 67% 69% 188 18101105 +17.95% 2% 67% 69% 223 18130951 +18.15% 2% 67% 69% 255 18118898 +18.07% 2% 67% 69% 267 18101559 +17.96% 2% 67% 69% 299 18160468 +18.34% 2% 68% 70% 320 18139845 +18.21% 2% 67% 69% 393 18160869 +18.34% 2% 68% 70% 424 18170999 +18.41% 2% 68% 70% 458 18144868 +18.24% 2% 68% 70% 467 18142366 +18.22% 2% 68% 70% 498 18154549 +18.30% 1% 68% 69% 511 18134525 +18.17% 1% 69% 70% Broadwell-EX: similar pattern as Skylake-EX. batch score change zone_contention lru_contention total_contention 31 16703983 +0.00% 67% 7% 74% 53 18195393 +8.93% 43% 28% 71% 63 18288885 +9.49% 38% 33% 71% 73 18344329 +9.82% 35% 37% 72% 119 18535529 +10.96% 24% 46% 70% 127 18513596 +10.83% 23% 48% 71% 137 18514327 +10.84% 23% 48% 71% 165 18511840 +10.82% 22% 49% 71% 188 18593478 +11.31% 17% 53% 70% 223 18601667 +11.36% 17% 52% 69% 255 18774825 +12.40% 12% 58% 70% 267 18754781 +12.28% 9% 60% 69% 299 18892265 +13.10% 7% 63% 70% 320 18873812 +12.99% 8% 62% 70% 393 18891174 +13.09% 6% 64% 70% 424 18975108 +13.60% 6% 64% 70% 458 18932364 +13.34% 8% 62% 70% 467 18960891 +13.51% 5% 65% 70% 498 18944526 +13.41% 5% 64% 69% 511 18960839 +13.51% 5% 64% 69% Skylake-EP: although increased batch reduced zone->lock contention, but the effect is not as good as EX: zone->lock contention is still as high as 20% with a very high batch value instead of 1% on Skylake-EX or 5% on Broadwell-EX. Also, total_contention actually decreased with a higher batch but that doesn't translate to performance increase. batch score change zone_contention lru_contention total_contention 31 9554867 +0.00% 66% 3% 69% 53 9855486 +3.15% 63% 3% 66% 63 9980145 +4.45% 62% 4% 66% 73 10092774 +5.63% 62% 5% 67% 119 10310061 +7.90% 45% 19% 64% 127 10342019 +8.24% 42% 19% 61% 137 10358182 +8.41% 42% 21% 63% 165 10397060 +8.81% 37% 24% 61% 188 10341808 +8.24% 34% 26% 60% 223 10349135 +8.31% 31% 27% 58% 255 10327189 +8.08% 28% 29% 57% 267 10344204 +8.26% 27% 29% 56% 299 10325043 +8.06% 25% 30% 55% 320 10310325 +7.91% 25% 31% 56% 393 10293274 +7.73% 21% 31% 52% 424 10311099 +7.91% 21% 32% 53% 458 10321375 +8.02% 21% 32% 53% 467 10303881 +7.84% 21% 32% 53% 498 10332462 +8.14% 20% 33% 53% 511 10325016 +8.06% 20% 32% 52% Broadwell-EP: zone->lock and lru lock had an agreement to make sure performance doesn't increase and they successfully managed to keep total contention at 70%. batch score change zone_contention lru_contention total_contention 31 10121178 +0.00% 19% 50% 69% 53 10142366 +0.21% 6% 63% 69% 63 10117984 -0.03% 11% 58% 69% 73 10123330 +0.02% 7% 63% 70% 119 10108791 -0.12% 2% 67% 69% 127 10166074 +0.44% 3% 66% 69% 137 10141574 +0.20% 3% 66% 69% 165 10154499 +0.33% 2% 68% 70% 188 10124921 +0.04% 2% 67% 69% 223 10137399 +0.16% 2% 67% 69% 255 10143289 +0.22% 0% 68% 68% 267 10123535 +0.02% 1% 68% 69% 299 10140952 +0.20% 0% 68% 68% 320 10163170 +0.41% 0% 68% 68% 393 10000633 -1.19% 0% 69% 69% 424 10087998 -0.33% 0% 69% 69% 458 10187116 +0.65% 0% 69% 69% 467 10146790 +0.25% 0% 69% 69% 498 10197958 +0.76% 0% 69% 69% 511 10152326 +0.31% 0% 69% 69% Haswell-EP: similar to Broadwell-EP. batch score change zone_contention lru_contention total_contention 31 10442205 +0.00% 14% 48% 62% 53 10442255 +0.00% 5% 57% 62% 63 10452059 +0.09% 6% 57% 63% 73 10482349 +0.38% 5% 59% 64% 119 10454644 +0.12% 3% 60% 63% 127 10431514 -0.10% 3% 59% 62% 137 10423785 -0.18% 3% 60% 63% 165 10481216 +0.37% 2% 61% 63% 188 10448755 +0.06% 2% 61% 63% 223 10467144 +0.24% 2% 61% 63% 255 10480215 +0.36% 2% 61% 63% 267 10484279 +0.40% 2% 61% 63% 299 10466450 +0.23% 2% 61% 63% 320 10452578 +0.10% 2% 61% 63% 393 10499678 +0.55% 1% 62% 63% 424 10481454 +0.38% 1% 62% 63% 458 10473562 +0.30% 1% 62% 63% 467 10484269 +0.40% 0% 62% 62% 498 10505599 +0.61% 0% 62% 62% 511 10483395 +0.39% 0% 62% 62% Westmere-EP: contention is pretty small so not interesting. Note too high a batch value could hurt performance. batch score change zone_contention lru_contention total_contention 31 4831523 +0.00% 2% 3% 5% 53 4834086 +0.05% 2% 4% 6% 63 4834262 +0.06% 2% 3% 5% 73 4832851 +0.03% 2% 4% 6% 119 4830534 -0.02% 1% 3% 4% 127 4827461 -0.08% 1% 4% 5% 137 4827459 -0.08% 1% 3% 4% 165 4820534 -0.23% 0% 4% 4% 188 4817947 -0.28% 0% 3% 3% 223 4809671 -0.45% 0% 3% 3% 255 4802463 -0.60% 0% 4% 4% 267 4801634 -0.62% 0% 3% 3% 299 4798047 -0.69% 0% 3% 3% 320 4793084 -0.80% 0% 3% 3% 393 4785877 -0.94% 0% 3% 3% 424 4782911 -1.01% 0% 3% 3% 458 4779346 -1.08% 0% 3% 3% 467 4780306 -1.06% 0% 3% 3% 498 4780589 -1.05% 0% 3% 3% 511 4773724 -1.20% 0% 3% 3% Skylake-Desktop: similar to Westmere-EP, nothing interesting. batch score change zone_contention lru_contention total_contention 31 3906608 +0.00% 2% 3% 5% 53 3940164 +0.86% 2% 3% 5% 63 3937289 +0.79% 2% 3% 5% 73 3940201 +0.86% 2% 3% 5% 119 3933240 +0.68% 2% 3% 5% 127 3930514 +0.61% 2% 4% 6% 137 3938639 +0.82% 0% 3% 3% 165 3908755 +0.05% 0% 3% 3% 188 3905621 -0.03% 0% 3% 3% 223 3903015 -0.09% 0% 4% 4% 255 3889480 -0.44% 0% 3% 3% 267 3891669 -0.38% 0% 4% 4% 299 3898728 -0.20% 0% 4% 4% 320 3894547 -0.31% 0% 4% 4% 393 3875137 -0.81% 0% 4% 4% 424 3874521 -0.82% 0% 3% 3% 458 3880432 -0.67% 0% 4% 4% 467 3888715 -0.46% 0% 3% 3% 498 3888633 -0.46% 0% 4% 4% 511 3875305 -0.80% 0% 5% 5% Haswell-Desktop: zone->lock is pretty low as other desktops, though lru contention is higher than other desktops. batch score change zone_contention lru_contention total_contention 31 3511158 +0.00% 2% 5% 7% 53 3555445 +1.26% 2% 6% 8% 63 3561082 +1.42% 2% 6% 8% 73 3547218 +1.03% 2% 6% 8% 119 3571319 +1.71% 1% 7% 8% 127 3549375 +1.09% 0% 6% 6% 137 3560233 +1.40% 0% 6% 6% 165 3555176 +1.25% 2% 6% 8% 188 3551501 +1.15% 0% 8% 8% 223 3531462 +0.58% 0% 7% 7% 255 3570400 +1.69% 0% 7% 7% 267 3532235 +0.60% 1% 8% 9% 299 3562326 +1.46% 0% 6% 6% 320 3553569 +1.21% 0% 8% 8% 393 3539519 +0.81% 0% 7% 7% 424 3549271 +1.09% 0% 8% 8% 458 3528885 +0.50% 0% 8% 8% 467 3526554 +0.44% 0% 7% 7% 498 3525302 +0.40% 0% 9% 9% 511 3527556 +0.47% 0% 8% 8% Sandybridge-Desktop: the 0% contention isn't accurate but caused by dropped fractional part. Since multiple contention path's contentions are all under 1% here, with some arithmetic operations like add, the final deviation could be as large as 3%. batch score change zone_contention lru_contention total_contention 31 1744495 +0.00% 0% 0% 0% 53 1755341 +0.62% 0% 0% 0% 63 1758469 +0.80% 0% 0% 0% 73 1759626 +0.87% 0% 0% 0% 119 1770417 +1.49% 0% 0% 0% 127 1768252 +1.36% 0% 0% 0% 137 1767848 +1.34% 0% 0% 0% 165 1765088 +1.18% 0% 0% 0% 188 1766918 +1.29% 0% 0% 0% 223 1767866 +1.34% 0% 0% 0% 255 1768074 +1.35% 0% 0% 0% 267 1763187 +1.07% 0% 0% 0% 299 1765620 +1.21% 0% 0% 0% 320 1767603 +1.32% 0% 0% 0% 393 1764612 +1.15% 0% 0% 0% 424 1758476 +0.80% 0% 0% 0% 458 1758593 +0.81% 0% 0% 0% 467 1757915 +0.77% 0% 0% 0% 498 1753363 +0.51% 0% 0% 0% 511 1755548 +0.63% 0% 0% 0% Phase two test results: Note: all percent change is against base(batch=31). ebizzy.throughput (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 2410037±7% 2600451±2% +7.9% 2602878 +8.0% lkp-bdw-ex1 1493328 1489243 -0.3% 1492145 -0.1% lkp-skl-2sp2 1329674 1345891 +1.2% 1351056 +1.6% lkp-bdw-ep2 711511 711511 0.0% 710708 -0.1% lkp-wsm-ep2 75750 75528 -0.3% 75441 -0.4% lkp-skl-d01 264126 262791 -0.5% 264113 +0.0% lkp-hsw-d01 176601 176328 -0.2% 176368 -0.1% lkp-sb02 98937 98937 +0.0% 99030 +0.1% kbuild.buildtime (less is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 107.00 107.67 +0.6% 107.11 +0.1% lkp-bdw-ex1 97.33 97.33 +0.0% 97.42 +0.1% lkp-skl-2sp2 180.00 179.83 -0.1% 179.83 -0.1% lkp-bdw-ep2 178.17 179.17 +0.6% 177.50 -0.4% lkp-wsm-ep2 737.00 738.00 +0.1% 738.00 +0.1% lkp-skl-d01 642.00 653.00 +1.7% 653.00 +1.7% lkp-hsw-d01 1310.00 1316.00 +0.5% 1311.00 +0.1% netperf/TCP_STREAM.Throughput_total_Mbps (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 948790 947144 -0.2% 948333 -0.0% lkp-bdw-ex1 904224 904366 +0.0% 904926 +0.1% lkp-skl-2sp2 239731 239607 -0.1% 239565 -0.1% lk-bdw-ep2 365764 365933 +0.0% 365951 +0.1% lkp-wsm-ep2 93736 93803 +0.1% 93808 +0.1% lkp-skl-d01 77314 77303 -0.0% 77375 +0.1% lkp-hsw-d01 58617 60387 +3.0% 60208 +2.7% lkp-sb02 29990 30137 +0.5% 30103 +0.4% oltp.transactions (higer is better) machine batch=31 batch=63 batch=127 lkp-bdw-ex1 9073276 9100377 +0.3% 9036344 -0.4% lkp-skl-2sp2 8898717 8852054 -0.5% 8894459 -0.0% lkp-bdw-ep2 13426155 13384654 -0.3% 13333637 -0.7% lkp-hsw-ep2 13146314 13232784 +0.7% 13193163 +0.4% lkp-wsm-ep2 5035355 5019348 -0.3% 5033418 -0.0% lkp-skl-d01 418485 4413339 -0.1% 4419039 +0.0% lkp-hsw-d01 3517817±5% 3396120±3% -3.5% 3455138±3% -1.8% pigz.throughput (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1.513e+08 1.507e+08 -0.4% 1.511e+08 -0.2% lkp-bdw-ex1 2.060e+08 2.052e+08 -0.4% 2.044e+08 -0.8% lkp-skl-2sp2 8.836e+08 8.845e+08 +0.1% 8.836e+08 -0.0% lkp-bdw-ep2 8.275e+08 8.464e+08 +2.3% 8.330e+08 +0.7% lkp-wsm-ep2 2.224e+08 2.221e+08 -0.2% 2.218e+08 -0.3% lkp-skl-d01 1.177e+08 1.177e+08 -0.0% 1.176e+08 -0.1% lkp-hsw-d01 1.154e+08 1.154e+08 +0.1% 1.154e+08 -0.0% lkp-sb02 0.633e+08 0.633e+08 +0.1% 0.633e+08 +0.0% will-it-scale.malloc1.processes (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 620181 620484 +0.0% 620240 +0.0% lkp-bdw-ex1 1403610 1401201 -0.2% 1417900 +1.0% lkp-skl-2sp2 1288097 1284145 -0.3% 1283907 -0.3% lkp-bdw-ep2 1427879 1427675 -0.0% 1428266 +0.0% lkp-hsw-ep2 1362546 1353965 -0.6% 1354759 -0.6% lkp-wsm-ep2 2099657 2107576 +0.4% 2100226 +0.0% lkp-skl-d01 1476835 1476358 -0.0% 1474487 -0.2% lkp-hsw-d01 1308810 1303429 -0.4% 1301299 -0.6% lkp-sb02 589286 589284 -0.0% 588101 -0.2% will-it-scale.malloc1.threads (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 21289 21125 -0.8% 21241 -0.2% lkp-bdw-ex1 28114 28089 -0.1% 28007 -0.4% lkp-skl-2sp2 91866 91946 +0.1% 92723 +0.9% lkp-bdw-ep2 37637 37501 -0.4% 37317 -0.9% lkp-hsw-ep2 43673 43590 -0.2% 43754 +0.2% lkp-wsm-ep2 28577 28298 -1.0% 28545 -0.1% lkp-skl-d01 175277 173343 -1.1% 173082 -1.3% lkp-hsw-d01 130303 129566 -0.6% 129250 -0.8% lkp-sb02 113742±3% 116911 +2.8% 116417±3% +2.4% will-it-scale.malloc2.processes (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1.206e+09 1.206e+09 -0.0% 1.206e+09 +0.0% lkp-bdw-ex1 1.319e+09 1.319e+09 -0.0% 1.319e+09 +0.0% lkp-skl-2sp2 8.000e+08 8.021e+08 +0.3% 7.995e+08 -0.1% lkp-bdw-ep2 6.582e+08 6.634e+08 +0.8% 6.513e+08 -1.1% lkp-hsw-ep2 6.671e+08 6.669e+08 -0.0% 6.665e+08 -0.1% lkp-wsm-ep2 1.805e+08 1.806e+08 +0.0% 1.804e+08 -0.1% lkp-skl-d01 1.611e+08 1.611e+08 -0.0% 1.610e+08 -0.0% lkp-hsw-d01 1.333e+08 1.332e+08 -0.0% 1.332e+08 -0.0% lkp-sb02 82485104 82478206 -0.0% 82473546 -0.0% will-it-scale.malloc2.threads (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1.574e+09 1.574e+09 -0.0% 1.574e+09 -0.0% lkp-bdw-ex1 1.737e+09 1.737e+09 +0.0% 1.737e+09 -0.0% lkp-skl-2sp2 9.161e+08 9.162e+08 +0.0% 9.181e+08 +0.2% lkp-bdw-ep2 7.856e+08 8.015e+08 +2.0% 8.113e+08 +3.3% lkp-hsw-ep2 6.908e+08 6.904e+08 -0.1% 6.907e+08 -0.0% lkp-wsm-ep2 2.409e+08 2.409e+08 +0.0% 2.409e+08 -0.0% lkp-skl-d01 1.199e+08 1.199e+08 -0.0% 1.199e+08 -0.0% lkp-hsw-d01 1.029e+08 1.029e+08 -0.0% 1.029e+08 +0.0% lkp-sb02 68081213 68061423 -0.0% 68076037 -0.0% will-it-scale.page_fault2.processes (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 14509125±4% 16472364 +13.5% 17123117 +18.0% lkp-bdw-ex1 14736381 16196588 +9.9% 16364011 +11.0% lkp-skl-2sp2 6354925 6435444 +1.3% 6436644 +1.3% lkp-bdw-ep2 8749584 8834422 +1.0% 8827179 +0.9% lkp-hsw-ep2 8762591 8845920 +1.0% 8825697 +0.7% lkp-wsm-ep2 3036083 3030428 -0.2% 3021741 -0.5% lkp-skl-d01 2307834 2304731 -0.1% 2286142 -0.9% lkp-hsw-d01 1806237 1800786 -0.3% 1795943 -0.6% lkp-sb02 842616 837844 -0.6% 833921 -1.0% will-it-scale.page_fault2.threads machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1623294 1615132±2% -0.5% 1656777 +2.1% lkp-bdw-ex1 1995714 2025948 +1.5% 2113753±3% +5.9% lkp-skl-2sp2 2346708 2415591 +2.9% 2416919 +3.0% lkp-bdw-ep2 2342564 2344882 +0.1% 2300206 -1.8% lkp-hsw-ep2 1820658 1831681 +0.6% 1844057 +1.3% lkp-wsm-ep2 1725482 1733774 +0.5% 1740517 +0.9% lkp-skl-d01 1832833 1823628 -0.5% 1806489 -1.4% lkp-hsw-d01 1427913 1427287 -0.0% 1420226 -0.5% lkp-sb02 750626 748615 -0.3% 746621 -0.5% will-it-scale.page_fault3.processes (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 24382726 24400317 +0.1% 24668774 +1.2% lkp-bdw-ex1 35399750 35683124 +0.8% 35829492 +1.2% lkp-skl-2sp2 28136820 28068248 -0.2% 28147989 +0.0% lkp-bdw-ep2 37269077 37459490 +0.5% 37373073 +0.3% lkp-hsw-ep2 36224967 36114085 -0.3% 36104908 -0.3% lkp-wsm-ep2 16820457 16911005 +0.5% 16968596 +0.9% lkp-skl-d01 7721138 7725904 +0.1% 7756740 +0.5% lkp-hsw-d01 7611979 7650928 +0.5% 7651323 +0.5% lkp-sb02 3781546 3796502 +0.4% 3796827 +0.4% will-it-scale.page_fault3.threads (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1865820±3% 1900917±2% +1.9% 1826245±4% -2.1% lkp-bdw-ex1 3094060 3148326 +1.8% 3150036 +1.8% lkp-skl-2sp2 3952940 3953898 +0.0% 3989360 +0.9% lkp-bdw-ep2 3420373±3% 3643964 +6.5% 3644910±5% +6.6% lkp-hsw-ep2 2609635±2% 2582310±3% -1.0% 2780459 +6.5% lkp-wsm-ep2 4395001 4417196 +0.5% 4432499 +0.9% lkp-skl-d01 5363977 5400003 +0.7% 5411370 +0.9% lkp-hsw-d01 5274131 5311294 +0.7% 5319359 +0.9% lkp-sb02 2917314 2913004 -0.1% 2935286 +0.6% will-it-scale.read1.processes (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 73762279±14% 69322519±10% -6.0% 69349855±13% -6.0% (result unstable) lkp-bdw-ex1 1.701e+08 1.704e+08 +0.1% 1.705e+08 +0.2% lkp-skl-2sp2 63111570 63113953 +0.0% 63836573 +1.1% lkp-bdw-ep2 79247409 79424610 +0.2% 78012656 -1.6% lkp-hsw-ep2 67677026 68308800 +0.9% 67539106 -0.2% lkp-wsm-ep2 13339630 13939817 +4.5% 13766865 +3.2% lkp-skl-d01 10969487 10972650 +0.0% no data lkp-hsw-d01 9857342±2% 10080592±2% +2.3% 10131560 +2.8% lkp-sb02 5189076 5197473 +0.2% 5163253 -0.5% will-it-scale.read1.threads (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 62468045±12% 73666726±7% +17.9% 79553123±12% +27.4% (result unstable) lkp-bdw-ex1 1.62e+08 1.624e+08 +0.3% 1.614e+08 -0.3% lkp-skl-2sp2 58319780 59181032 +1.5% 59821353 +2.6% lkp-bdw-ep2 74057992 75698171 +2.2% 74990869 +1.3% lkp-hsw-ep2 63672959 63639652 -0.1% 64387051 +1.1% lkp-wsm-ep2 13489943 13526058 +0.3% 13259032 -1.7% lkp-skl-d01 10297906 10338796 +0.4% 10407328 +1.1% lkp-hsw-d01 9636721 9667376 +0.3% 9341147 -3.1% lkp-sb02 4801938 4804496 +0.1% 4802290 +0.0% will-it-scale.write1.processes (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1.111e+08 1.104e+08±2% -0.7% 1.122e+08±2% +1.0% lkp-bdw-ex1 1.392e+08 1.399e+08 +0.5% 1.397e+08 +0.4% lkp-skl-2sp2 59369233 58994841 -0.6% 58715168 -1.1% lkp-bdw-ep2 61820979 CPU throttle 63593123 +2.9% lkp-hsw-ep2 57897587 57435605 -0.8% 56347450 -2.7% lkp-wsm-ep2 7814203 7918017±2% +1.3% 7669068 -1.9% lkp-skl-d01 8886557 8971422 +1.0% 8818366 -0.8% lkp-hsw-d01 9171001±5% 9189915 +0.2% 9483909 +3.4% lkp-sb02 4475406 4475294 -0.0% 4501756 +0.6% will-it-scale.write1.threads (higer is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1.058e+08 1.055e+08±2% -0.2% 1.065e+08 +0.7% lkp-bdw-ex1 1.316e+08 1.300e+08 -1.2% 1.308e+08 -0.6% lkp-skl-2sp2 54492421 56086678 +2.9% 55975657 +2.7% lkp-bdw-ep2 59360449 59003957 -0.6% 58101262 -2.1% lkp-hsw-ep2 53346346±2% 52530876 -1.5% 52902487 -0.8% lkp-wsm-ep2 7774006 7800092±2% +0.3% 7558833 -2.8% lkp-skl-d01 8346174 8235695 -1.3% no data lkp-hsw-d01 8636244 8655731 +0.2% 8658868 +0.3% lkp-sb02 4181820 4204107 +0.5% 4182992 +0.0% vm-scalability.anon-r-rand.throughput (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 11933873±3% 12356544±2% +3.5% 12188624 +2.1% lkp-bdw-ex1 7114424±2% 7330949±2% +3.0% 7392419 +3.9% lkp-skl-2sp2 6773277±5% 6492332±8% -4.1% 6543962 -3.4% lkp-bdw-ep2 7133846±4% 7233508 +1.4% 7013518±3% -1.7% lkp-hsw-ep2 4576626 4527098 -1.1% 4551679 -0.5% lkp-wsm-ep2 2583599 2592492 +0.3% 2588039 +0.2% lkp-hsw-d01 998199±2% 1028311 +3.0% 1006460±2% +0.8% lkp-sb02 570572 567854 -0.5% 568449 -0.4% vm-scalability.anon-r-rand-mt.throughput (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1789419 1787830 -0.1% 1788208 -0.1% lkp-bdw-ex1 3492595±2% 3554966±2% +1.8% 3558835±3% +1.9% lkp-skl-2sp2 3856238±2% 3975403±4% +3.1% 3994600 +3.6% lkp-bdw-ep2 3726963±11% 3809292±6% +2.2% 3871924±4% +3.9% lkp-hsw-ep2 2131760±3% 2033578±4% -4.6% 2130727±6% -0.0% lkp-wsm-ep2 2369731 2368384 -0.1% 2370252 +0.0% lkp-skl-d01 1207128 1206220 -0.1% 1205801 -0.1% lkp-hsw-d01 964317 992329±2% +2.9% 992099±2% +2.9% lkp-sb02 567137 567346 +0.0% 566144 -0.2% vm-scalability.lru-file-mmap-read.throughput (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 19560469±6% 23018999 +17.7% 23418800 +19.7% lkp-bdw-ex1 17769135±14% 26141676±3% +47.1% 26284723±5% +47.9% lkp-skl-2sp2 14056512 13578884 -3.4% 13146214 -6.5% lkp-bdw-ep2 15336542 14737654 -3.9% 14088159 -8.1% lkp-hsw-ep2 16275498 15756296 -3.2% 15018090 -7.7% lkp-wsm-ep2 11272160 11237231 -0.3% 11310047 +0.3% lkp-skl-d01 7322119 7324569 +0.0% 7184148 -1.9% lkp-hsw-d01 6449234 6404542 -0.7% 6356141 -1.4% lkp-sb02 3517943 3520668 +0.1% 3527309 +0.3% vm-scalability.lru-file-mmap-read-rand.throughput (higher is better) machine batch=31 batch=63 batch=127 lkp-skl-4sp1 1689052 1697553 +0.5% 1698726 +0.6% lkp-bdw-ex1 1675246 1699764 +1.5% 1712226 +2.2% lkp-skl-2sp2 1800533 1799749 -0.0% 1800581 +0.0% lkp-bdw-ep2 1807422 1807758 +0.0% 1804932 -0.1% lkp-hsw-ep2 1809807 1808781 -0.1% 1807811 -0.1% lkp-wsm-ep2 1800198 1802434 +0.1% 1801236 +0.1% lkp-skl-d01 696689 695537 -0.2% 694106 -0.4% lkp-hsw-d01 698364 698666 +0.0% 696686 -0.2% lkp-sb02 258939 258787 -0.1% 258199 -0.3% Link: http://lkml.kernel.org/r/20180711055855.29072-1-aaron.lu@intel.com Signed-off-by: Aaron Lu Suggested-by: Dave Hansen Acked-by: Michal Hocko Acked-by: Jesper Dangaard Brouer Cc: Huang Ying Cc: Kemi Wang Cc: Tim Chen Cc: Andi Kleen Cc: Vlastimil Babka Cc: Mel Gorman Cc: Jesper Dangaard Brouer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a195d3f5b74f3f45a6742f9063b5e95a2522b46d Author: Michal Hocko Date: Fri Aug 17 15:49:10 2018 -0700 mm/oom_kill.c: document oom_lock Add comments describing oom_lock's scope. Requested-by: David Rientjes Link: http://lkml.kernel.org/r/20180711120121.25635-1-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Cc: David Rientjes Cc: Tetsuo Handa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 40d18ebffb3974272a920c41f2d74431152cae98 Author: Mike Kravetz Date: Fri Aug 17 15:49:07 2018 -0700 mm/hugetlb: remove gigantic page support for HIGHMEM This reverts ee8f248d266e ("hugetlb: add phys addr to struct huge_bootmem_page"). At one time powerpc used this field and supporting code. However that was removed with commit 79cc38ded1e1 ("powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line"). There are no users of this field and supporting code, so remove it. Link: http://lkml.kernel.org/r/20180711195913.1294-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Andrew Morton Acked-by: Michal Hocko Cc: "Aneesh Kumar K . V" Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Cannon Matthews Cc: Becky Bruce Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9bfe5ded054b8e28a94c78580f233d6879a00146 Author: Michal Hocko Date: Fri Aug 17 15:49:04 2018 -0700 mm, oom: remove sleep from under oom_lock Tetsuo has pointed out that since 27ae357fa82b ("mm, oom: fix concurrent munlock and oom reaper unmap, v3") we have a strong synchronization between the oom_killer and victim's exiting because both have to take the oom_lock. Therefore the original heuristic to sleep for a short time in out_of_memory doesn't serve the original purpose. Moreover Tetsuo has noticed that the short sleep can be more harmful than actually useful. Hammering the system with many processes can lead to a starvation when the task holding the oom_lock can block for a long time (minutes) and block any further progress because the oom_reaper depends on the oom_lock as well. Drop the short sleep from out_of_memory when we hold the lock. Keep the sleep when the trylock fails to throttle the concurrent OOM paths a bit. This should be solved in a more reasonable way (e.g. sleep proportional to the time spent in the active reclaiming etc.) but this is much more complex thing to achieve. This is a quick fixup to remove a stale code. Link: http://lkml.kernel.org/r/20180709074706.30635-1-mhocko@kernel.org Signed-off-by: Michal Hocko Reported-by: Tetsuo Handa Reviewed-by: Andrew Morton Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d834c5ab83febf9624ad3b16c3c348aa1e02014c Author: Marek Szyprowski Date: Fri Aug 17 15:49:00 2018 -0700 kernel/dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous() The CMA memory allocator doesn't support standard gfp flags for memory allocation, so there is no point having it as a parameter for dma_alloc_from_contiguous() function. Replace it by a boolean no_warn argument, which covers all the underlaying cma_alloc() function supports. This will help to avoid giving false feeling that this function supports standard gfp flags and callers can pass __GFP_ZERO to get zeroed buffer, what has already been an issue: see commit dd65a941f6ba ("arm64: dma-mapping: clear buffers allocated with FORCE_CONTIGUOUS flag"). Link: http://lkml.kernel.org/r/20180709122020eucas1p21a71b092975cb4a3b9954ffc63f699d1~-sqUFoa-h2939329393eucas1p2Y@eucas1p2.samsung.com Signed-off-by: Marek Szyprowski Acked-by: Michał Nazarewicz Acked-by: Vlastimil Babka Reviewed-by: Christoph Hellwig Cc: Laura Abbott Cc: Michal Hocko Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6518202970c1052148daaef9a8096711775e43a2 Author: Marek Szyprowski Date: Fri Aug 17 15:48:57 2018 -0700 mm/cma: remove unsupported gfp_mask parameter from cma_alloc() cma_alloc() doesn't really support gfp flags other than __GFP_NOWARN, so convert gfp_mask parameter to boolean no_warn parameter. This will help to avoid giving false feeling that this function supports standard gfp flags and callers can pass __GFP_ZERO to get zeroed buffer, what has already been an issue: see commit dd65a941f6ba ("arm64: dma-mapping: clear buffers allocated with FORCE_CONTIGUOUS flag"). Link: http://lkml.kernel.org/r/20180709122019eucas1p2340da484acfcc932537e6014f4fd2c29~-sqTPJKij2939229392eucas1p2j@eucas1p2.samsung.com Signed-off-by: Marek Szyprowski Acked-by: Michal Hocko Acked-by: Michał Nazarewicz Acked-by: Laura Abbott Acked-by: Vlastimil Babka Reviewed-by: Christoph Hellwig Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 50c150f26261e723523f077a67378736fa7511a4 Author: Rik van Riel Date: Fri Aug 17 15:48:53 2018 -0700 Revert "mm: always flush VMA ranges affected by zap_page_range" There was a bug in Linux that could cause madvise (and mprotect?) system calls to return to userspace without the TLB having been flushed for all the pages involved. This could happen when multiple threads of a process made simultaneous madvise and/or mprotect calls. This was noticed in the summer of 2017, at which time two solutions were created: 56236a59556c ("mm: refactor TLB gathering API") 99baac21e458 ("mm: fix MADV_[FREE|DONTNEED] TLB flush miss problem") and 4647706ebeee ("mm: always flush VMA ranges affected by zap_page_range") We need only one of these solutions, and the former appears to be a little more efficient than the latter, so revert that one. This reverts 4647706ebeee6e50 ("mm: always flush VMA ranges affected by zap_page_range") Link: http://lkml.kernel.org/r/20180706131019.51e3a5f0@imladris.surriel.com Signed-off-by: Rik van Riel Acked-by: Mel Gorman Cc: Andy Lutomirski Cc: Michal Hocko Cc: Minchan Kim Cc: "Kirill A. Shutemov" Cc: Mel Gorman Cc: "Aneesh Kumar K.V" Cc: Nicholas Piggin Cc: Nadav Amit Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c98aff649349d9147915a19d378c9c3c1bd85de0 Author: Baoquan He Date: Fri Aug 17 15:48:49 2018 -0700 mm/sparse: optimize memmap allocation during sparse_init() In sparse_init(), two temporary pointer arrays, usemap_map and map_map are allocated with the size of NR_MEM_SECTIONS. They are used to store each memory section's usemap and mem map if marked as present. With the help of these two arrays, continuous memory chunk is allocated for usemap and memmap for memory sections on one node. This avoids too many memory fragmentations. Like below diagram, '1' indicates the present memory section, '0' means absent one. The number 'n' could be much smaller than NR_MEM_SECTIONS on most of systems. |1|1|1|1|0|0|0|0|1|1|0|0|...|1|0||1|0|...|1||0|1|...|0| ------------------------------------------------------- 0 1 2 3 4 5 i i+1 n-1 n If we fail to populate the page tables to map one section's memmap, its ->section_mem_map will be cleared finally to indicate that it's not present. After use, these two arrays will be released at the end of sparse_init(). In 4-level paging mode, each array costs 4M which can be ignorable. While in 5-level paging, they costs 256M each, 512M altogether. Kdump kernel Usually only reserves very few memory, e.g 256M. So, even thouth they are temporarily allocated, still not acceptable. In fact, there's no need to allocate them with the size of NR_MEM_SECTIONS. Since the ->section_mem_map clearing has been deferred to the last, the number of present memory sections are kept the same during sparse_init() until we finally clear out the memory section's ->section_mem_map if its usemap or memmap is not correctly handled. Thus in the middle whenever for_each_present_section_nr() loop is taken, the i-th present memory section is always the same one. Here only allocate usemap_map and map_map with the size of 'nr_present_sections'. For the i-th present memory section, install its usemap and memmap to usemap_map[i] and mam_map[i] during allocation. Then in the last for_each_present_section_nr() loop which clears the failed memory section's ->section_mem_map, fetch usemap and memmap from usemap_map[] and map_map[] array and set them into mem_section[] accordingly. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/20180628062857.29658-5-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Pavel Tatashin Cc: Pasha Tatashin Cc: Dave Hansen Cc: Kirill A. Shutemov Cc: Oscar Salvador Cc: Pankaj Gupta Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9258631b33374f20d856032c3542b76ad7f5a312 Author: Baoquan He Date: Fri Aug 17 15:48:45 2018 -0700 mm/sparse.c: add a new parameter 'data_unit_size' for alloc_usemap_and_memmap It's used to pass the size of map data unit into alloc_usemap_and_memmap, and is preparation for next patch. Link: http://lkml.kernel.org/r/20180228032657.32385-4-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Pavel Tatashin Reviewed-by: Oscar Salvador Cc: Pasha Tatashin Cc: Kirill A. Shutemov Cc: Pankaj Gupta Cc: Dave Hansen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 07a34a8c36521c37119259d937d1389c3f5f6db9 Author: Baoquan He Date: Fri Aug 17 15:48:42 2018 -0700 mm/sparsemem.c: defer the ms->section_mem_map clearing In sparse_init(), if CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y, system will allocate one continuous memory chunk for mem maps on one node and populate the relevant page tables to map memory section one by one. If fail to populate for a certain mem section, print warning and its ->section_mem_map will be cleared to cancel the marking of being present. Like this, the number of mem sections marked as present could become less during sparse_init() execution. Here just defer the ms->section_mem_map clearing if failed to populate its page tables until the last for_each_present_section_nr() loop. This is in preparation for later optimizing the mem map allocation. [akpm@linux-foundation.org: remove now-unused local `ms', per Oscar] Link: http://lkml.kernel.org/r/20180228032657.32385-3-bhe@redhat.com Signed-off-by: Baoquan He Acked-by: Dave Hansen Reviewed-by: Pavel Tatashin Reviewed-by: Oscar Salvador Cc: Pasha Tatashin Cc: Kirill A. Shutemov Cc: Pankaj Gupta Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f2fc10e0b3fe7d1aecbd2cab6bf0007b6771e16d Author: Baoquan He Date: Fri Aug 17 15:48:38 2018 -0700 mm/sparse.c: add a static variable nr_present_sections Patch series "mm/sparse: Optimize memmap allocation during sparse_init()", v6. In sparse_init(), two temporary pointer arrays, usemap_map and map_map are allocated with the size of NR_MEM_SECTIONS. They are used to store each memory section's usemap and mem map if marked as present. In 5-level paging mode, this will cost 512M memory though they will be released at the end of sparse_init(). System with few memory, like kdump kernel which usually only has about 256M, will fail to boot because of allocation failure if CONFIG_X86_5LEVEL=y. In this patchset, optimize the memmap allocation code to only use usemap_map and map_map with the size of nr_present_sections. This makes kdump kernel boot up with normal crashkernel='' setting when CONFIG_X86_5LEVEL=y. This patch (of 5): nr_present_sections is used to record how many memory sections are marked as present during system boot up, and will be used in the later patch. Link: http://lkml.kernel.org/r/20180228032657.32385-2-bhe@redhat.com Signed-off-by: Baoquan He Acked-by: Dave Hansen Reviewed-by: Andrew Morton Reviewed-by: Pavel Tatashin Reviewed-by: Oscar Salvador Cc: Pasha Tatashin Cc: Kirill A. Shutemov Cc: Pankaj Gupta Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7e010df53c80197b23119e7d7b95892aa13629df Author: Kirill Tkhai Date: Fri Aug 17 15:48:34 2018 -0700 mm: use special value SHRINKER_REGISTERING instead of list_empty() check The patch introduces a special value SHRINKER_REGISTERING to use instead of list_empty() to differ a registering shrinker from unregistered shrinker. Why we need that at all? Shrinker registration is split in two parts. The first one is prealloc_shrinker(), which allocates shrinker memory and reserves ID in shrinker_idr. This function can fail. The second is register_shrinker_prepared(), and it finalizes the registration. This function actually makes shrinker available to be used from shrink_slab(), and it can't fail. One shrinker may be based on more then one LRU lists. So, we never clear the bit in memcg shrinker maps, when (one of) corresponding LRU list becomes empty, since other LRU lists may be not empty. See superblock shrinker for example: it is based on two LRU lists: s_inode_lru and s_dentry_lru. We do not want to clear shrinker bit, when there are no inodes in s_inode_lru, as s_dentry_lru may contain dentries. Instead of that, we use special algorithm to detect shrinkers having no elements at all its LRU lists, and this is made in shrink_slab_memcg(). See the comment in this function for the details. Also, in shrink_slab_memcg() we clear shrinker bit in the map, when we meet unregistered shrinker (bit is set, while there is no a shrinker in IDR). Otherwise, we would have done that at the moment of shrinker unregistration for all memcgs (and this looks worse, since iteration over all memcg may take much time). Also this would have imposed restrictions on shrinker unregistration order for its users: they would have had to guarantee, there are no new elements after unregister_shrinker() (otherwise, a new added element would have set a bit). So, if we meet a set bit in map and no shrinker in IDR when we're iterating over the map in shrink_slab_memcg(), this means the corresponding shrinker is unregistered, and we must clear the bit. Another case is shrinker registration. We want two things there: 1) do_shrink_slab() can be called only for completely registered shrinkers; 2) shrinker internal lists may be populated in any order with register_shrinker_prepared() (let's talk on the example with sb). Both of: a)list_lru_add(&inode->i_sb->s_inode_lru, &inode->i_lru); [cpu0] memcg_set_shrinker_bit(); [cpu0] ... register_shrinker_prepared(); [cpu1] and b)register_shrinker_prepared(); [cpu0] ... list_lru_add(&inode->i_sb->s_inode_lru, &inode->i_lru); [cpu1] memcg_set_shrinker_bit(); [cpu1] are legitimate. We don't want to impose restriction here and to force people to use only (b) variant. We don't want to force people to care, there is no elements in LRU lists before the shrinker is completely registered. Internal users of LRU lists and shrinker code are two different subsystems, and they have to be closed in themselves each other. In (a) case we have the bit set before shrinker is completely registered. We don't want do_shrink_slab() is called at this moment, so we have to detect such the registering shrinkers. Before this patch list_empty() (shrinker is not linked to the list) check was used for that. So, in (a) there could be a bit set, but we don't call do_shrink_slab() unless shrinker is linked to the list. It's just an indicator, I just overloaded linking to the list. This was not the best solution, since it's better not to touch the shrinker memory from shrink_slab_memcg() before it's completely registered (this also will be useful in the future to make shrink_slab() completely lockless). So, this patch introduces better way to detect registering shrinker, which allows not to dereference shrinker memory. It's just a ~0UL value, which we insert into the IDR during ID allocation. After shrinker is ready to be used, we insert actual shrinker pointer in the IDR, and it becomes available to shrink_slab_memcg(). We can't use NULL instead of this new value for this purpose as: shrink_slab_memcg() already uses NULL to detect unregistered shrinkers, and we don't want the function sees NULL and clears the bit, otherwise (a) won't work. This is the only thing the patch makes: the better way to detect registering shrinker. Nothing else this patch makes. Also this gives a better assembler, but it's minor side of the patch: Before: callq mov %rax,%r15 test %rax,%rax je mov 0x20(%rax),%rax lea 0x20(%r15),%rdx cmp %rax,%rdx je mov 0x8(%rsp),%edx mov %r15,%rsi lea 0x10(%rsp),%rdi callq After: callq mov %rax,%r15 lea -0x1(%rax),%rax cmp $0xfffffffffffffffd,%rax ja mov 0x8(%rsp),%edx mov %r15,%rsi lea 0x10(%rsp),%rdi callq ffffffff810cefd0 [ktkhai@virtuozzo.com: add #ifdef CONFIG_MEMCG_KMEM around idr_replace()] Link: http://lkml.kernel.org/r/758b8fec-7573-47eb-b26a-7b2847ae7b8c@virtuozzo.com Link: http://lkml.kernel.org/r/153355467546.11522.4518015068123480218.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Reviewed-by: Andrew Morton Cc: Vladimir Davydov Cc: Michal Hocko Cc: Andrey Ryabinin Cc: "Huang, Ying" Cc: Tetsuo Handa Cc: Matthew Wilcox Cc: Shakeel Butt Cc: Josef Bacik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ac7fb3ad2717c56cee70456ffe9d808230db528e Author: Kirill Tkhai Date: Fri Aug 17 15:48:30 2018 -0700 mm/vmscan.c: move check for SHRINKER_NUMA_AWARE to do_shrink_slab() In case of shrink_slab_memcg() we do not zero nid, when shrinker is not numa-aware. This is not a real problem, since currently all memcg-aware shrinkers are numa-aware too (we have two: super_block shrinker and workingset shrinker), but something may change in the future. Link: http://lkml.kernel.org/r/153320759911.18959.8842396230157677671.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Reviewed-by: Andrew Morton Cc: Vladimir Davydov Cc: Michal Hocko Cc: Andrey Ryabinin Cc: "Huang, Ying" Cc: Tetsuo Handa Cc: Matthew Wilcox Cc: Shakeel Butt Cc: Josef Bacik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f90280d6b7963fa8925258ed66b4f567fe73dfea Author: Kirill Tkhai Date: Fri Aug 17 15:48:25 2018 -0700 mm/vmscan.c: clear shrinker bit if there are no objects related to memcg To avoid further unneed calls of do_shrink_slab() for shrinkers, which already do not have any charged objects in a memcg, their bits have to be cleared. This patch introduces a lockless mechanism to do that without races without parallel list lru add. After do_shrink_slab() returns SHRINK_EMPTY the first time, we clear the bit and call it once again. Then we restore the bit, if the new return value is different. Note, that single smp_mb__after_atomic() in shrink_slab_memcg() covers two situations: 1)list_lru_add() shrink_slab_memcg list_add_tail() for_each_set_bit() <--- read bit do_shrink_slab() <--- missed list update (no barrier) set_bit() do_shrink_slab() <--- seen list update This situation, when the first do_shrink_slab() sees set bit, but it doesn't see list update (i.e., race with the first element queueing), is rare. So we don't add before the first call of do_shrink_slab() instead of this to do not slow down generic case. Also, it's need the second call as seen in below in (2). 2)list_lru_add() shrink_slab_memcg() list_add_tail() ... set_bit() ... ... for_each_set_bit() do_shrink_slab() do_shrink_slab() clear_bit() ... ... ... list_lru_add() ... list_add_tail() clear_bit() set_bit() do_shrink_slab() The barriers guarantee that the second do_shrink_slab() in the right side task sees list update if really cleared the bit. This case is drawn in the code comment. [Results/performance of the patchset] After the whole patchset applied the below test shows signify increase of performance: $echo 1 > /sys/fs/cgroup/memory/memory.use_hierarchy $mkdir /sys/fs/cgroup/memory/ct $echo 4000M > /sys/fs/cgroup/memory/ct/memory.kmem.limit_in_bytes $for i in `seq 0 4000`; do mkdir /sys/fs/cgroup/memory/ct/$i; echo $$ > /sys/fs/cgroup/memory/ct/$i/cgroup.procs; mkdir -p s/$i; mount -t tmpfs $i s/$i; touch s/$i/file; done Then, 5 sequential calls of drop caches: $time echo 3 > /proc/sys/vm/drop_caches 1)Before: 0.00user 13.78system 0:13.78elapsed 99%CPU 0.00user 5.59system 0:05.60elapsed 99%CPU 0.00user 5.48system 0:05.48elapsed 99%CPU 0.00user 8.35system 0:08.35elapsed 99%CPU 0.00user 8.34system 0:08.35elapsed 99%CPU 2)After 0.00user 1.10system 0:01.10elapsed 99%CPU 0.00user 0.00system 0:00.01elapsed 64%CPU 0.00user 0.01system 0:00.01elapsed 82%CPU 0.00user 0.00system 0:00.01elapsed 64%CPU 0.00user 0.01system 0:00.01elapsed 82%CPU The results show the performance increases at least in 548 times. Shakeel Butt tested this patchset with fork-bomb on his configuration: > I created 255 memcgs, 255 ext4 mounts and made each memcg create a > file containing few KiBs on corresponding mount. Then in a separate > memcg of 200 MiB limit ran a fork-bomb. > > I ran the "perf record -ag -- sleep 60" and below are the results: > > Without the patch series: > Samples: 4M of event 'cycles', Event count (approx.): 3279403076005 > + 36.40% fb.sh [kernel.kallsyms] [k] shrink_slab > + 18.97% fb.sh [kernel.kallsyms] [k] list_lru_count_one > + 6.75% fb.sh [kernel.kallsyms] [k] super_cache_count > + 0.49% fb.sh [kernel.kallsyms] [k] down_read_trylock > + 0.44% fb.sh [kernel.kallsyms] [k] mem_cgroup_iter > + 0.27% fb.sh [kernel.kallsyms] [k] up_read > + 0.21% fb.sh [kernel.kallsyms] [k] osq_lock > + 0.13% fb.sh [kernel.kallsyms] [k] shmem_unused_huge_count > + 0.08% fb.sh [kernel.kallsyms] [k] shrink_node_memcg > + 0.08% fb.sh [kernel.kallsyms] [k] shrink_node > > With the patch series: > Samples: 4M of event 'cycles', Event count (approx.): 2756866824946 > + 47.49% fb.sh [kernel.kallsyms] [k] down_read_trylock > + 30.72% fb.sh [kernel.kallsyms] [k] up_read > + 9.51% fb.sh [kernel.kallsyms] [k] mem_cgroup_iter > + 1.69% fb.sh [kernel.kallsyms] [k] shrink_node_memcg > + 1.35% fb.sh [kernel.kallsyms] [k] mem_cgroup_protected > + 1.05% fb.sh [kernel.kallsyms] [k] queued_spin_lock_slowpath > + 0.85% fb.sh [kernel.kallsyms] [k] _raw_spin_lock > + 0.78% fb.sh [kernel.kallsyms] [k] lruvec_lru_size > + 0.57% fb.sh [kernel.kallsyms] [k] shrink_node > + 0.54% fb.sh [kernel.kallsyms] [k] queue_work_on > + 0.46% fb.sh [kernel.kallsyms] [k] shrink_slab_memcg [ktkhai@virtuozzo.com: v9] Link: http://lkml.kernel.org/r/153112561772.4097.11011071937553113003.stgit@localhost.localdomain Link: http://lkml.kernel.org/r/153063070859.1818.11870882950920963480.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9b996468cfdba09f688f52dba4287de596194613 Author: Kirill Tkhai Date: Fri Aug 17 15:48:21 2018 -0700 mm: add SHRINK_EMPTY shrinker methods return value We need to distinguish the situations when shrinker has very small amount of objects (see vfs_pressure_ratio() called from super_cache_count()), and when it has no objects at all. Currently, in the both of these cases, shrinker::count_objects() returns 0. The patch introduces new SHRINK_EMPTY return value, which will be used for "no objects at all" case. It's is a refactoring mostly, as SHRINK_EMPTY is replaced by 0 by all callers of do_shrink_slab() in this patch, and all the magic will happen in further. Link: http://lkml.kernel.org/r/153063069574.1818.11037751256699341813.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit aeed1d325d429ac9699c4bf62d17156d60905519 Author: Vladimir Davydov Date: Fri Aug 17 15:48:17 2018 -0700 mm/vmscan.c: generalize shrink_slab() calls in shrink_node() The patch makes shrink_slab() be called for root_mem_cgroup in the same way as it's called for the rest of cgroups. This simplifies the logic and improves the readability. [ktkhai@virtuozzo.com: wrote changelog] Link: http://lkml.kernel.org/r/153063068338.1818.11496084754797453962.stgit@localhost.localdomain Signed-off-by: Vladimir Davydov Signed-off-by: Kirill Tkhai Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b0dedc49a2daa0f44ddc51fbf686b2ef012fccbf Author: Kirill Tkhai Date: Fri Aug 17 15:48:14 2018 -0700 mm/vmscan.c: iterate only over charged shrinkers during memcg shrink_slab() Using the preparations made in previous patches, in case of memcg shrink, we may avoid shrinkers, which are not set in memcg's shrinkers bitmap. To do that, we separate iterations over memcg-aware and !memcg-aware shrinkers, and memcg-aware shrinkers are chosen via for_each_set_bit() from the bitmap. In case of big nodes, having many isolated environments, this gives significant performance growth. See next patches for the details. Note that the patch does not respect to empty memcg shrinkers, since we never clear the bitmap bits after we set it once. Their shrinkers will be called again, with no shrinked objects as result. This functionality is provided by next patches. [ktkhai@virtuozzo.com: v9] Link: http://lkml.kernel.org/r/153112558507.4097.12713813335683345488.stgit@localhost.localdomain Link: http://lkml.kernel.org/r/153063066653.1818.976035462801487910.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fae91d6d8be5e20c47e459dbeb3d43bd5f9486f4 Author: Kirill Tkhai Date: Fri Aug 17 15:48:10 2018 -0700 mm/list_lru.c: set bit in memcg shrinker bitmap on first list_lru item appearance Introduce set_shrinker_bit() function to set shrinker-related bit in memcg shrinker bitmap, and set the bit after the first item is added and in case of reparenting destroyed memcg's items. This will allow next patch to make shrinkers be called only, in case of they have charged objects at the moment, and to improve shrink_slab() performance. [ktkhai@virtuozzo.com: v9] Link: http://lkml.kernel.org/r/153112557572.4097.17315791419810749985.stgit@localhost.localdomain Link: http://lkml.kernel.org/r/153063065671.1818.15914674956134687268.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dfd2f10ccfd7e6bd2a096eaf42e76a7229776322 Author: Kirill Tkhai Date: Fri Aug 17 15:48:06 2018 -0700 mm/memcontrol.c: export mem_cgroup_is_root() This will be used in next patch. Link: http://lkml.kernel.org/r/153063064347.1818.1987011484100392706.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3b82c4dcc2f0f98f2aca3b9dc9b88721e962eec9 Author: Kirill Tkhai Date: Fri Aug 17 15:48:01 2018 -0700 mm/list_lru.c: pass lru argument to memcg_drain_list_lru_node() This is just refactoring to allow next patches to have lru pointer in memcg_drain_list_lru_node(). Link: http://lkml.kernel.org/r/153063063164.1818.55009531386089350.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9bec5c35bfa3d41b046594b5890f772ed737f1fd Author: Kirill Tkhai Date: Fri Aug 17 15:47:58 2018 -0700 mm/list_lru: pass dst_memcg argument to memcg_drain_list_lru_node() This is just refactoring to allow the next patches to have dst_memcg pointer in memcg_drain_list_lru_node(). Link: http://lkml.kernel.org/r/153063062118.1818.2761273817739499749.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 44bd4a4759d5a714767aa6be7e806ab54b7fa3a8 Author: Kirill Tkhai Date: Fri Aug 17 15:47:54 2018 -0700 mm/list_lru.c: add memcg argument to list_lru_from_kmem() This is just refactoring to allow the next patches to have memcg pointer in list_lru_from_kmem(). Link: http://lkml.kernel.org/r/153063060664.1818.9541345386733498582.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c92e8e10cafeaaedc84f23fed1bfcf9cf07399c2 Author: Kirill Tkhai Date: Fri Aug 17 15:47:50 2018 -0700 fs: propagate shrinker::id to list_lru Add list_lru::shrinker_id field and populate it by registered shrinker id. This will be used to set correct bit in memcg shrinkers map by lru code in next patches, after there appeared the first related to memcg element in list_lru. Link: http://lkml.kernel.org/r/153063059758.1818.14866596416857717800.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2b3648a6ff83bd2a59b427d3537cc570933659b5 Author: Kirill Tkhai Date: Fri Aug 17 15:47:45 2018 -0700 fs/super.c: refactor alloc_super() Do two list_lru_init_memcg() calls after prealloc_super(). destroy_unused_super() in fail path is OK with this. Next patch needs such the order. Link: http://lkml.kernel.org/r/153063058712.1818.3382490999719078571.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 39887653aab4cffb0074d0d3c4f392e61b67d22b Author: Kirill Tkhai Date: Fri Aug 17 15:47:41 2018 -0700 mm/workingset.c: refactor workingset_init() Use prealloc_shrinker()/register_shrinker_prepared() instead of register_shrinker(). This will be used in next patch. [ktkhai@virtuozzo.com: v9] Link: http://lkml.kernel.org/r/153112550112.4097.16606173020912323761.stgit@localhost.localdomain Link: http://lkml.kernel.org/r/153063057666.1818.17625951186610808734.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0a4465d340282f92719f4e3a56545a848e638d15 Author: Kirill Tkhai Date: Fri Aug 17 15:47:37 2018 -0700 mm, memcg: assign memcg-aware shrinkers bitmap to memcg Imagine a big node with many cpus, memory cgroups and containers. Let we have 200 containers, every container has 10 mounts, and 10 cgroups. All container tasks don't touch foreign containers mounts. If there is intensive pages write, and global reclaim happens, a writing task has to iterate over all memcgs to shrink slab, before it's able to go to shrink_page_list(). Iteration over all the memcg slabs is very expensive: the task has to visit 200 * 10 = 2000 shrinkers for every memcg, and since there are 2000 memcgs, the total calls are 2000 * 2000 = 4000000. So, the shrinker makes 4 million do_shrink_slab() calls just to try to isolate SWAP_CLUSTER_MAX pages in one of the actively writing memcg via shrink_page_list(). I've observed a node spending almost 100% in kernel, making useless iteration over already shrinked slab. This patch adds bitmap of memcg-aware shrinkers to memcg. The size of the bitmap depends on bitmap_nr_ids, and during memcg life it's maintained to be enough to fit bitmap_nr_ids shrinkers. Every bit in the map is related to corresponding shrinker id. Next patches will maintain set bit only for really charged memcg. This will allow shrink_slab() to increase its performance in significant way. See the last patch for the numbers. [ktkhai@virtuozzo.com: v9] Link: http://lkml.kernel.org/r/153112549031.4097.3576147070498769979.stgit@localhost.localdomain [ktkhai@virtuozzo.com: add comment to mem_cgroup_css_online()] Link: http://lkml.kernel.org/r/521f9e5f-c436-b388-fe83-4dc870bfb489@virtuozzo.com Link: http://lkml.kernel.org/r/153063056619.1818.12550500883688681076.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b05706f1001fe662bafe198814c5999fd996dce0 Author: Kirill Tkhai Date: Fri Aug 17 15:47:33 2018 -0700 mm/memcontrol.c: move up for_each_mem_cgroup{, _tree} defines Next patch requires these defines are above their current position, so here they are moved to declarations. Link: http://lkml.kernel.org/r/153063055665.1818.5200425793649695598.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b4c2b231c3ba155623591fb6301ed97b95e1c039 Author: Kirill Tkhai Date: Fri Aug 17 15:47:29 2018 -0700 mm: assign id to every memcg-aware shrinker Introduce shrinker::id number, which is used to enumerate memcg-aware shrinkers. The number start from 0, and the code tries to maintain it as small as possible. This will be used to represent a memcg-aware shrinkers in memcg shrinkers map. Since all memcg-aware shrinkers are based on list_lru, which is per-memcg in case of !CONFIG_MEMCG_KMEM only, the new functionality will be under this config option. [ktkhai@virtuozzo.com: v9] Link: http://lkml.kernel.org/r/153112546435.4097.10607140323811756557.stgit@localhost.localdomain Link: http://lkml.kernel.org/r/153063054586.1818.6041047871606697364.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 84c07d11aa619c6d24c682f469b10f344f0c02aa Author: Kirill Tkhai Date: Fri Aug 17 15:47:25 2018 -0700 mm: introduce CONFIG_MEMCG_KMEM as combination of CONFIG_MEMCG && !CONFIG_SLOB Introduce new config option, which is used to replace repeating CONFIG_MEMCG && !CONFIG_SLOB pattern. Next patches add a little more memcg+kmem related code, so let's keep the defines more clearly. Link: http://lkml.kernel.org/r/153063053670.1818.15013136946600481138.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Andrey Ryabinin Cc: Chris Wilson Cc: Greg Kroah-Hartman Cc: Guenter Roeck Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Josef Bacik Cc: Li RongQing Cc: Matthew Wilcox Cc: Matthias Kaehlcke Cc: Mel Gorman Cc: Michal Hocko Cc: Minchan Kim Cc: Philippe Ombredanne Cc: Roman Gushchin Cc: Sahitya Tummala Cc: Stephen Rothwell Cc: Tetsuo Handa Cc: Thomas Gleixner Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e0295238e50f1aa16d4c902c837fd8d17861b698 Author: Kirill Tkhai Date: Fri Aug 17 15:47:21 2018 -0700 mm/list_lru.c: combine code under the same define Patch series "Improve shrink_slab() scalability (old complexity was O(n^2), new is O(n))", v8. This patcheset solves the problem with slow shrink_slab() occuring on the machines having many shrinkers and memory cgroups (i.e., with many containers). The problem is complexity of shrink_slab() is O(n^2) and it grows too fast with the growth of containers numbers. Let us have 200 containers, and every container has 10 mounts and 10 cgroups. All container tasks are isolated, and they don't touch foreign containers mounts. In case of global reclaim, a task has to iterate all over the memcgs and to call all the memcg-aware shrinkers for all of them. This means, the task has to visit 200 * 10 = 2000 shrinkers for every memcg, and since there are 2000 memcgs, the total calls of do_shrink_slab() are 2000 * 2000 = 4000000. 4 million calls are not a number operations, which can takes 1 cpu cycle. E.g., super_cache_count() accesses at least two lists, and makes arifmetical calculations. Even, if there are no charged objects, we do these calculations, and replaces cpu caches by read memory. I observed nodes spending almost 100% time in kernel, in case of intensive writing and global reclaim. The writer consumes pages fast, but it's need to shrink_slab() before the reclaimer reached shrink pages function (and frees SWAP_CLUSTER_MAX pages). Even if there is no writing, the iterations just waste the time, and slows reclaim down. Let's see the small test below: $echo 1 > /sys/fs/cgroup/memory/memory.use_hierarchy $mkdir /sys/fs/cgroup/memory/ct $echo 4000M > /sys/fs/cgroup/memory/ct/memory.kmem.limit_in_bytes $for i in `seq 0 4000`; do mkdir /sys/fs/cgroup/memory/ct/$i; echo $$ > /sys/fs/cgroup/memory/ct/$i/cgroup.procs; mkdir -p s/$i; mount -t tmpfs $i s/$i; touch s/$i/file; done Then, let's see drop caches time (5 sequential calls): $time echo 3 > /proc/sys/vm/drop_caches 0.00user 13.78system 0:13.78elapsed 99%CPU 0.00user 5.59system 0:05.60elapsed 99%CPU 0.00user 5.48system 0:05.48elapsed 99%CPU 0.00user 8.35system 0:08.35elapsed 99%CPU 0.00user 8.34system 0:08.35elapsed 99%CPU The last four calls don't actually shrink anything. So, the iterations over slab shrinkers take 5.48 seconds. Not so good for scalability. The patchset solves the problem by making shrink_slab() of O(n) complexity. There are following functional actions: 1) Assign id to every registered memcg-aware shrinker. 2) Maintain per-memcgroup bitmap of memcg-aware shrinkers, and set a shrinker-related bit after the first element is added to lru list (also, when removed child memcg elements are reparanted). 3) Split memcg-aware shrinkers and !memcg-aware shrinkers, and call a shrinker if its bit is set in memcg's shrinker bitmap. (Also, there is a functionality to clear the bit, after last element is shrinked). This gives significant performance increase. The result after patchset is applied: $time echo 3 > /proc/sys/vm/drop_caches 0.00user 1.10system 0:01.10elapsed 99%CPU 0.00user 0.00system 0:00.01elapsed 64%CPU 0.00user 0.01system 0:00.01elapsed 82%CPU 0.00user 0.00system 0:00.01elapsed 64%CPU 0.00user 0.01system 0:00.01elapsed 82%CPU The results show the performance increases at least in 548 times. So, the patchset makes shrink_slab() of less complexity and improves the performance in such types of load I pointed. This will give a profit in case of !global reclaim case, since there also will be less do_shrink_slab() calls. This patch (of 17): These two pairs of blocks of code are under the same #ifdef #else #endif. Link: http://lkml.kernel.org/r/153063052519.1818.9393587113056959488.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt Cc: Al Viro Cc: Johannes Weiner Cc: Michal Hocko Cc: Thomas Gleixner Cc: Philippe Ombredanne Cc: Sahitya Tummala Cc: Greg Kroah-Hartman Cc: Stephen Rothwell Cc: Roman Gushchin Cc: Matthias Kaehlcke Cc: Tetsuo Handa Cc: Chris Wilson Cc: Waiman Long Cc: Minchan Kim Cc: "Huang, Ying" Cc: Mel Gorman Cc: Josef Bacik Cc: Guenter Roeck Cc: Matthew Wilcox Cc: Li RongQing Cc: Andrey Ryabinin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a36aab890c2166744e6299dc55ef2c38cb6616c0 Author: Mike Rapoport Date: Fri Aug 17 15:47:17 2018 -0700 mm/memblock.c: replace u64 with phys_addr_t where appropriate Most functions in memblock already use phys_addr_t to represent a physical address with __memblock_free_late() being an exception. This patch replaces u64 with phys_addr_t in __memblock_free_late() and switches several format strings from %llx to %pa to avoid casting from phys_addr_t to u64. Link: http://lkml.kernel.org/r/1530637506-1256-1-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Pavel Tatashin Acked-by: Michal Hocko Cc: Pasha Tatashin Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4e40987f12de2f244d0d2ef64730aca92922c95a Author: Oscar Salvador Date: Fri Aug 17 15:47:14 2018 -0700 mm/sparse.c: make sparse_init_one_section void and remove check sparse_init_one_section() is being called from two sites: sparse_init() and sparse_add_one_section(). The former calls it from a for_each_present_section_nr() loop, and the latter marks the section as present before calling it. This means that when sparse_init_one_section() gets called, we already know that the section is present. So there is no point to double check that in the function. This removes the check and makes the function void. [ross.zwisler@linux.intel.com: fix error path in sparse_add_one_section] Link: http://lkml.kernel.org/r/20180706190658.6873-1-ross.zwisler@linux.intel.com [ross.zwisler@linux.intel.com: simplification suggested by Oscar] Link: http://lkml.kernel.org/r/20180706223358.742-1-ross.zwisler@linux.intel.com Link: http://lkml.kernel.org/r/20180702154325.12196-1-osalvador@techadventures.net Signed-off-by: Oscar Salvador Acked-by: Michal Hocko Reviewed-by: Pavel Tatashin Reviewed-by: Andrew Morton Cc: Pasha Tatashin Cc: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 29ef680ae7c21110af8e6416d84d8a72fc147b14 Author: Michal Hocko Date: Fri Aug 17 15:47:11 2018 -0700 memcg, oom: move out_of_memory back to the charge path Commit 3812c8c8f395 ("mm: memcg: do not trap chargers with full callstack on OOM") has changed the ENOMEM semantic of memcg charges. Rather than invoking the oom killer from the charging context it delays the oom killer to the page fault path (pagefault_out_of_memory). This in turn means that many users (e.g. slab or g-u-p) will get ENOMEM when the corresponding memcg hits the hard limit and the memcg is is OOM. This is behavior is inconsistent with !memcg case where the oom killer is invoked from the allocation context and the allocator keeps retrying until it succeeds. The difference in the behavior is user visible. mmap(MAP_POPULATE) might result in not fully populated ranges while the mmap return code doesn't tell that to the userspace. Random syscalls might fail with ENOMEM etc. The primary motivation of the different memcg oom semantic was the deadlock avoidance. Things have changed since then, though. We have an async oom teardown by the oom reaper now and so we do not have to rely on the victim to tear down its memory anymore. Therefore we can return to the original semantic as long as the memcg oom killer is not handed over to the users space. There is still one thing to be careful about here though. If the oom killer is not able to make any forward progress - e.g. because there is no eligible task to kill - then we have to bail out of the charge path to prevent from same class of deadlocks. We have basically two options here. Either we fail the charge with ENOMEM or force the charge and allow overcharge. The first option has been considered more harmful than useful because rare inconsistencies in the ENOMEM behavior is hard to test for and error prone. Basically the same reason why the page allocator doesn't fail allocations under such conditions. The later might allow runaways but those should be really unlikely unless somebody misconfigures the system. E.g. allowing to migrate tasks away from the memcg to a different unlimited memcg with move_charge_at_immigrate disabled. Link: http://lkml.kernel.org/r/20180628151101.25307-1-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Greg Thelen Cc: Johannes Weiner Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d39f8fb4b7776dcb09ec3bf7a321547083078ee3 Author: Mike Rapoport Date: Fri Aug 17 15:47:07 2018 -0700 mm: make DEFERRED_STRUCT_PAGE_INIT explicitly depend on SPARSEMEM The deferred memory initialization relies on section definitions, e.g PAGES_PER_SECTION, that are only available when CONFIG_SPARSEMEM=y on most architectures. Initially DEFERRED_STRUCT_PAGE_INIT depended on explicit ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT configuration option, but since the commit 2e3ca40f03bb13709df4 ("mm: relax deferred struct page requirements") this requirement was relaxed and now it is possible to enable DEFERRED_STRUCT_PAGE_INIT on architectures that support DISCONTINGMEM and NO_BOOTMEM which causes build failures. For instance, setting SMP=y and DEFERRED_STRUCT_PAGE_INIT=y on arc causes the following build failure: CC mm/page_alloc.o mm/page_alloc.c: In function 'update_defer_init': mm/page_alloc.c:321:14: error: 'PAGES_PER_SECTION' undeclared (first use in this function); did you mean 'USEC_PER_SEC'? (pfn & (PAGES_PER_SECTION - 1)) == 0) { ^~~~~~~~~~~~~~~~~ USEC_PER_SEC mm/page_alloc.c:321:14: note: each undeclared identifier is reported only once for each function it appears in In file included from include/linux/cache.h:5:0, from include/linux/printk.h:9, from include/linux/kernel.h:14, from include/asm-generic/bug.h:18, from arch/arc/include/asm/bug.h:32, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/mm.h:9, from mm/page_alloc.c:18: mm/page_alloc.c: In function 'deferred_grow_zone': mm/page_alloc.c:1624:52: error: 'PAGES_PER_SECTION' undeclared (first use in this function); did you mean 'USEC_PER_SEC'? unsigned long nr_pages_needed = ALIGN(1 << order, PAGES_PER_SECTION); ^ include/uapi/linux/kernel.h:11:47: note: in definition of macro '__ALIGN_KERNEL_MASK' #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) ^~~~ include/linux/kernel.h:58:22: note: in expansion of macro '__ALIGN_KERNEL' #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) ^~~~~~~~~~~~~~ mm/page_alloc.c:1624:34: note: in expansion of macro 'ALIGN' unsigned long nr_pages_needed = ALIGN(1 << order, PAGES_PER_SECTION); ^~~~~ In file included from include/asm-generic/bug.h:18:0, from arch/arc/include/asm/bug.h:32, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/mm.h:9, from mm/page_alloc.c:18: mm/page_alloc.c: In function 'free_area_init_node': mm/page_alloc.c:6379:50: error: 'PAGES_PER_SECTION' undeclared (first use in this function); did you mean 'USEC_PER_SEC'? pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, ^ include/linux/kernel.h:812:22: note: in definition of macro '__typecheck' (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ^ include/linux/kernel.h:836:24: note: in expansion of macro '__safe_cmp' __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~ include/linux/kernel.h:904:27: note: in expansion of macro '__careful_cmp' #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ^~~~~~~~~~~~~ mm/page_alloc.c:6379:29: note: in expansion of macro 'min_t' pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, ^~~~~ include/linux/kernel.h:836:2: error: first argument to '__builtin_choose_expr' not a constant __builtin_choose_expr(__safe_cmp(x, y), \ ^ include/linux/kernel.h:904:27: note: in expansion of macro '__careful_cmp' #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ^~~~~~~~~~~~~ mm/page_alloc.c:6379:29: note: in expansion of macro 'min_t' pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, ^~~~~ scripts/Makefile.build:317: recipe for target 'mm/page_alloc.o' failed Let's make the DEFERRED_STRUCT_PAGE_INIT explicitly depend on SPARSEMEM as the systems that support DISCONTIGMEM do not seem to have that huge amounts of memory that would make DEFERRED_STRUCT_PAGE_INIT relevant. Link: http://lkml.kernel.org/r/1530279308-24988-1-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Acked-by: Michal Hocko Reviewed-by: Pavel Tatashin Tested-by: Randy Dunlap Cc: Pasha Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0207df4fa1a869281ddbf72db6203dbf036b3e1a Author: Andrey Ryabinin Date: Fri Aug 17 15:47:04 2018 -0700 kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN KASAN learns about hotadded memory via the memory hotplug notifier. devm_memremap_pages() intentionally skips calling memory hotplug notifiers. So KASAN doesn't know anything about new memory added by devm_memremap_pages(). This causes a crash when KASAN tries to access non-existent shadow memory: BUG: unable to handle kernel paging request at ffffed0078000000 RIP: 0010:check_memory_region+0x82/0x1e0 Call Trace: memcpy+0x1f/0x50 pmem_do_bvec+0x163/0x720 pmem_make_request+0x305/0xac0 generic_make_request+0x54f/0xcf0 submit_bio+0x9c/0x370 submit_bh_wbc+0x4c7/0x700 block_read_full_page+0x5ef/0x870 do_read_cache_page+0x2b8/0xb30 read_dev_sector+0xbd/0x3f0 read_lba.isra.0+0x277/0x670 efi_partition+0x41a/0x18f0 check_partition+0x30d/0x5e9 rescan_partitions+0x18c/0x840 __blkdev_get+0x859/0x1060 blkdev_get+0x23f/0x810 __device_add_disk+0x9c8/0xde0 pmem_attach_disk+0x9a8/0xf50 nvdimm_bus_probe+0xf3/0x3c0 driver_probe_device+0x493/0xbd0 bus_for_each_drv+0x118/0x1b0 __device_attach+0x1cd/0x2b0 bus_probe_device+0x1ac/0x260 device_add+0x90d/0x1380 nd_async_device_register+0xe/0x50 async_run_entry_fn+0xc3/0x5d0 process_one_work+0xa0a/0x1810 worker_thread+0x87/0xe80 kthread+0x2d7/0x390 ret_from_fork+0x3a/0x50 Add kasan_add_zero_shadow()/kasan_remove_zero_shadow() - post mm_init() interface to map/unmap kasan_zero_page at requested virtual addresses. And use it to add/remove the shadow memory for hotplugged/unplugged device memory. Link: http://lkml.kernel.org/r/20180629164932.740-1-aryabinin@virtuozzo.com Fixes: 41e94a851304 ("add devm_memremap_pages") Signed-off-by: Andrey Ryabinin Reported-by: Dave Chinner Reviewed-by: Dan Williams Tested-by: Dan Williams Cc: Dmitry Vyukov Cc: Alexander Potapenko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 50f8b92f21d23789bd4ada593e8ddc56cc4f79fe Author: Song Liu Date: Fri Aug 17 15:47:00 2018 -0700 mm: thp: pass correct vm_flags to hugepage_vma_check() khugepaged_enter_vma_merge() passes a stale vma->vm_flags to hugepage_vma_check(). The argument vm_flags contains the latest value. Therefore, it is necessary to pass this vm_flags into hugepage_vma_check(). With this bug, madvise(MADV_HUGEPAGE) for mmap files in shmem fails to put memory in huge pages. Here is an example of failed madvise(): /* mount /dev/shm with huge=advise: * mount -o remount,huge=advise /dev/shm */ /* create file /dev/shm/huge */ #define HUGE_FILE "/dev/shm/huge" fd = open(HUGE_FILE, O_RDONLY); ptr = mmap(NULL, FILE_SIZE, PROT_READ, MAP_PRIVATE, fd, 0); ret = madvise(ptr, FILE_SIZE, MADV_HUGEPAGE); madvise() will return 0, but this memory region is never put in huge page (check from /proc/meminfo: ShmemHugePages). Link: http://lkml.kernel.org/r/20180629181752.792831-1-songliubraving@fb.com Fixes: 02b75dc8160d ("mm: thp: register mm for khugepaged when merging vma for shmem") Signed-off-by: Song Liu Reviewed-by: Rik van Riel Reviewed-by: Yang Shi Cc: Kirill A. Shutemov Cc: Hugh Dickins Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a718e28f538441a3b6612da9ff226973376cdf0f Author: Andrey Ryabinin Date: Fri Aug 17 15:46:57 2018 -0700 mm/fadvise.c: fix signed overflow UBSAN complaint Signed integer overflow is undefined according to the C standard. The overflow in ksys_fadvise64_64() is deliberate, but since it is signed overflow, UBSAN complains: UBSAN: Undefined behaviour in mm/fadvise.c:76:10 signed integer overflow: 4 + 9223372036854775805 cannot be represented in type 'long long int' Use unsigned types to do math. Unsigned overflow is defined so UBSAN will not complain about it. This patch doesn't change generated code. [akpm@linux-foundation.org: add comment explaining the casts] Link: http://lkml.kernel.org/r/20180629184453.7614-1-aryabinin@virtuozzo.com Signed-off-by: Andrey Ryabinin Reported-by: Reviewed-by: Andrew Morton Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 31f21da18132fc971297175077fafa3bd4184dc1 Author: Colin Ian King Date: Fri Aug 17 15:46:54 2018 -0700 mm/swap_slots.c: make swap_slots_cache_mutex and swap_slots_cache_enable_mutex static The mutexes swap_slots_cache_mutex and swap_slots_cache_enable_mutex are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'swap_slots_cache_mutex' was not declared. Should it be static? symbol 'swap_slots_cache_enable_mutex' was not declared. Should it be static? Link: http://lkml.kernel.org/r/20180624182536.4937-1-colin.king@canonical.com Signed-off-by: Colin Ian King Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4d0a5402f505eafe5b0a77f2dc77bb6c2e25a714 Author: Colin Ian King Date: Fri Aug 17 15:46:50 2018 -0700 mm/zsmalloc.c: make several functions and a struct static The functions zs_page_isolate, zs_page_migrate, zs_page_putback, lock_zspage, trylock_zspage and structure zsmalloc_aops are local to source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'zs_page_isolate' was not declared. Should it be static? symbol 'zs_page_migrate' was not declared. Should it be static? symbol 'zs_page_putback' was not declared. Should it be static? symbol 'zsmalloc_aops' was not declared. Should it be static? symbol 'lock_zspage' was not declared. Should it be static? symbol 'trylock_zspage' was not declared. Should it be static? [arnd@arndb.de: hide unused lock_zspage] Link: http://lkml.kernel.org/r/20180706130924.3891230-1-arnd@arndb.de Link: http://lkml.kernel.org/r/20180624213322.13776-1-colin.king@canonical.com Signed-off-by: Colin Ian King Reviewed-by: Sergey Senozhatsky Reviewed-by: Andrew Morton Cc: Minchan Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dcfe4df3d57f08f7bf4acdd36c89763fe188cf3c Author: Greg Thelen Date: Fri Aug 17 15:46:47 2018 -0700 mm/page-writeback.c: update stale account_page_redirty() comment Commit 93f78d882865 ("writeback: move backing_dev_info->bdi_stat[] into bdi_writeback") replaced BDI_DIRTIED with WB_DIRTIED in account_page_redirty(). Update comment to track that change. BDI_DIRTIED => WB_DIRTIED BDI_WRITTEN => WB_WRITTEN Link: http://lkml.kernel.org/r/20180625171526.173483-1-gthelen@google.com Signed-off-by: Greg Thelen Reviewed-by: Jan Kara Acked-by: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f745c6f5fe75734f3b35d9d4e6ebe2a7d010ddda Author: Shakeel Butt Date: Fri Aug 17 15:46:44 2018 -0700 fs, mm: account buffer_head to kmemcg The buffer_head can consume a significant amount of system memory and is directly related to the amount of page cache. In our production environment we have observed that a lot of machines are spending a significant amount of memory as buffer_head and can not be left as system memory overhead. Charging buffer_head is not as simple as adding __GFP_ACCOUNT to the allocation. The buffer_heads can be allocated in a memcg different from the memcg of the page for which buffer_heads are being allocated. One concrete example is memory reclaim. The reclaim can trigger I/O of pages of any memcg on the system. So, the right way to charge buffer_head is to extract the memcg from the page for which buffer_heads are being allocated and then use targeted memcg charging API. [shakeelb@google.com: use __GFP_ACCOUNT for directed memcg charging] Link: http://lkml.kernel.org/r/20180702220208.213380-1-shakeelb@google.com Link: http://lkml.kernel.org/r/20180627191250.209150-3-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Jan Kara Cc: Amir Goldstein Cc: Greg Thelen Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Alexander Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d46eb14b735b11927d4bdc2d1854c311af19de6d Author: Shakeel Butt Date: Fri Aug 17 15:46:39 2018 -0700 fs: fsnotify: account fsnotify metadata to kmemcg Patch series "Directed kmem charging", v8. The Linux kernel's memory cgroup allows limiting the memory usage of the jobs running on the system to provide isolation between the jobs. All the kernel memory allocated in the context of the job and marked with __GFP_ACCOUNT will also be included in the memory usage and be limited by the job's limit. The kernel memory can only be charged to the memcg of the process in whose context kernel memory was allocated. However there are cases where the allocated kernel memory should be charged to the memcg different from the current processes's memcg. This patch series contains two such concrete use-cases i.e. fsnotify and buffer_head. The fsnotify event objects can consume a lot of system memory for large or unlimited queues if there is either no or slow listener. The events are allocated in the context of the event producer. However they should be charged to the event consumer. Similarly the buffer_head objects can be allocated in a memcg different from the memcg of the page for which buffer_head objects are being allocated. To solve this issue, this patch series introduces mechanism to charge kernel memory to a given memcg. In case of fsnotify events, the memcg of the consumer can be used for charging and for buffer_head, the memcg of the page can be charged. For directed charging, the caller can use the scope API memalloc_[un]use_memcg() to specify the memcg to charge for all the __GFP_ACCOUNT allocations within the scope. This patch (of 2): A lot of memory can be consumed by the events generated for the huge or unlimited queues if there is either no or slow listener. This can cause system level memory pressure or OOMs. So, it's better to account the fsnotify kmem caches to the memcg of the listener. However the listener can be in a different memcg than the memcg of the producer and these allocations happen in the context of the event producer. This patch introduces remote memcg charging API which the producer can use to charge the allocations to the memcg of the listener. There are seven fsnotify kmem caches and among them allocations from dnotify_struct_cache, dnotify_mark_cache, fanotify_mark_cache and inotify_inode_mark_cachep happens in the context of syscall from the listener. So, SLAB_ACCOUNT is enough for these caches. The objects from fsnotify_mark_connector_cachep are not accounted as they are small compared to the notification mark or events and it is unclear whom to account connector to since it is shared by all events attached to the inode. The allocations from the event caches happen in the context of the event producer. For such caches we will need to remote charge the allocations to the listener's memcg. Thus we save the memcg reference in the fsnotify_group structure of the listener. This patch has also moved the members of fsnotify_group to keep the size same, at least for 64 bit build, even with additional member by filling the holes. [shakeelb@google.com: use GFP_KERNEL_ACCOUNT rather than open-coding it] Link: http://lkml.kernel.org/r/20180702215439.211597-1-shakeelb@google.com Link: http://lkml.kernel.org/r/20180627191250.209150-2-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Jan Kara Cc: Amir Goldstein Cc: Greg Thelen Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Alexander Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dc0b58643aff8b378086f25cce6789ccba68cbcb Author: Roman Gushchin Date: Fri Aug 17 15:46:36 2018 -0700 mm: introduce mem_cgroup_put() helper Introduce the mem_cgroup_put() helper, which helps to eliminate guarding memcg css release with "#ifdef CONFIG_MEMCG" in multiple places. Link: http://lkml.kernel.org/r/20180623000600.5818-2-guro@fb.com Signed-off-by: Roman Gushchin Reviewed-by: Shakeel Butt Reviewed-by: Andrew Morton Acked-by: Johannes Weiner Acked-by: Michal Hocko Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1a9b4b3d75679fbe8c3bb8fb7e957ea693b6a89c Author: Luis R. Rodriguez Date: Fri Aug 17 15:46:32 2018 -0700 mm: provide a fallback for PAGE_KERNEL_EXEC for architectures Some architectures just don't have PAGE_KERNEL_EXEC. The mm/nommu.c and mm/vmalloc.c code have been using PAGE_KERNEL as a fallback for years. Move this fallback to asm-generic. Link: http://lkml.kernel.org/r/20180510185507.2439-3-mcgrof@kernel.org Signed-off-by: Luis R. Rodriguez Suggested-by: Matthew Wilcox Reviewed-by: Andrew Morton Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Geert Uytterhoeven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a3266bd49c721e2e0a71f352d83713fbd60caadb Author: Luis R. Rodriguez Date: Fri Aug 17 15:46:29 2018 -0700 mm: provide a fallback for PAGE_KERNEL_RO for architectures Some architectures do not define certain PAGE_KERNEL_* flags, this is either because: a) The way to implement some of these flags is *not yet ported*, or b) The architecture *has no way* to describe them Over time we have accumulated a few PAGE_KERNEL_* fallback workarounds for architectures in the kernel which do not define them using *relatively safe* equivalents. Move these scattered fallback hacks into asm-generic. We start off with PAGE_KERNEL_RO using PAGE_KERNEL as a fallback. This has been in place on the firmware loader for years. Move the fallback into the respective asm-generic header. Link: http://lkml.kernel.org/r/20180510185507.2439-2-mcgrof@kernel.org Signed-off-by: Luis R. Rodriguez Reviewed-by: Andrew Morton Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Matthew Wilcox Cc: Geert Uytterhoeven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3172e5e61c8a78f690c50f221fdeedce35d0b1e4 Author: Oscar Salvador Date: Fri Aug 17 15:46:25 2018 -0700 mm/memory_hotplug.c: drop unnecessary checks from register_mem_sect_under_node() Callers of register_mem_sect_under_node() are always passing a valid memory_block (not NULL), so we can safely drop the check for NULL. In the same way, register_mem_sect_under_node() is only called in case the node is online, so we can safely remove that check as well. Link: http://lkml.kernel.org/r/20180622111839.10071-5-osalvador@techadventures.net Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin Tested-by: Reza Arbab Tested-by: Jonathan Cameron Cc: Pasha Tatashin Cc: Michal Hocko Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4fbce633910ed80b135b84160a22b219080c8082 Author: Oscar Salvador Date: Fri Aug 17 15:46:22 2018 -0700 mm/memory_hotplug.c: make register_mem_sect_under_node() a callback of walk_memory_range() link_mem_sections() and walk_memory_range() share most of the code, so we can use convert link_mem_sections() into a dummy function that calls walk_memory_range() with a callback to register_mem_sect_under_node(). This patch converts register_mem_sect_under_node() in order to match a walk_memory_range's callback, getting rid of the check_nid argument and checking instead if the system is still boothing, since we only have to check for the nid if the system is in such state. Link: http://lkml.kernel.org/r/20180622111839.10071-4-osalvador@techadventures.net Signed-off-by: Oscar Salvador Suggested-by: Pavel Tatashin Tested-by: Reza Arbab Tested-by: Jonathan Cameron Reviewed-by: Pavel Tatashin Cc: Michal Hocko Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d5b6f6a3610b05e6712cb9c61a85a6dff16e91cf Author: Oscar Salvador Date: Fri Aug 17 15:46:18 2018 -0700 mm/memory_hotplug.c: call register_mem_sect_under_node() When hotplugging memory, it is possible that two calls are being made to register_mem_sect_under_node(). One comes from __add_section()->hotplug_memory_register() and the other from add_memory_resource()->link_mem_sections() if we had to register a new node. In case we had to register a new node, hotplug_memory_register() will only handle/allocate the memory_block's since register_mem_sect_under_node() will return right away because the node it is not online yet. I think it is better if we leave hotplug_memory_register() to handle/allocate only memory_block's and make link_mem_sections() to call register_mem_sect_under_node(). So this patch removes the call to register_mem_sect_under_node() from hotplug_memory_register(), and moves the call to link_mem_sections() out of the condition, so it will always be called. In this way we only have one place where the memory sections are registered. Link: http://lkml.kernel.org/r/20180622111839.10071-3-osalvador@techadventures.net Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin Tested-by: Reza Arbab Tested-by: Jonathan Cameron Cc: Pasha Tatashin Cc: Michal Hocko Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b9ff036082cd1793a59b35c4432644fe44620664 Author: Oscar Salvador Date: Fri Aug 17 15:46:15 2018 -0700 mm/memory_hotplug.c: make add_memory_resource use __try_online_node This is a small cleanup for the memhotplug code. A lot more could be done, but it is better to start somewhere. I tried to unify/remove duplicated code. The following is what this patchset does: 1) add_memory_resource() has code to allocate a node in case it was offline. Since try_online_node has some code for that as well, I just made add_memory_resource() to use that so we can remove duplicated code.. This is better explained in patch 1/4. 2) register_mem_sect_under_node() will be called only from link_mem_sections() 3) Make register_mem_sect_under_node() a callback of walk_memory_range() 4) Drop unnecessary checks from register_mem_sect_under_node() I have done some tests and I could not see anything broken because of this patchset. add_memory_resource() contains code to allocate a new node in case it is necessary. Since try_online_node() also has some code for this purpose, let us make use of that and remove duplicate code. This introduces __try_online_node(), which is called by add_memory_resource() and try_online_node(). __try_online_node() has two new parameters, start_addr of the node, and if the node should be onlined and registered right away. This is always wanted if we are calling from do_cpu_up(), but not when we are calling from memhotplug code. Nothing changes from the point of view of the users of try_online_node(), since try_online_node passes start_addr=0 and online_node=true to __try_online_node(). Link: http://lkml.kernel.org/r/20180622111839.10071-2-osalvador@techadventures.net Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin Tested-by: Reza Arbab Tested-by: Jonathan Cameron Cc: Pasha Tatashin Cc: Michal Hocko Cc: Vlastimil Babka Cc: Pavel Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 930eaac5eed23bb52061a50f674753a319216041 Author: Andrew Morton Date: Fri Aug 17 15:46:11 2018 -0700 mm/list_lru.c: fold __list_lru_count_one() into its caller __list_lru_count_one() has a single callsite. Acked-by: Vladimir Davydov Cc: Sebastian Andrzej Siewior Cc: Kirill Tkhai Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6ca342d020e8b8315d430d3a7d7c65daadfb4d8b Author: Sebastian Andrzej Siewior Date: Fri Aug 17 15:46:08 2018 -0700 mm: workingset: make shadow_lru_isolate() use locking suffix shadow_lru_isolate() disables interrupts and acquires a lock. It could use spin_lock_irq() instead. It also uses local_irq_enable() while it could use spin_unlock_irq()/xa_unlock_irq(). Use proper suffix for lock/unlock in order to enable/disable interrupts during release/acquire of a lock. Link: http://lkml.kernel.org/r/20180622151221.28167-3-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Andrew Morton Cc: Vladimir Davydov Cc: Kirill Tkhai Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ae1e16da14b2bca94272c9f23c930be48994b2bb Author: Sebastian Andrzej Siewior Date: Fri Aug 17 15:46:05 2018 -0700 mm: workingset: remove local_irq_disable() from count_shadow_nodes() Patch series "mm: use irq locking suffix instead local_irq_disable()". A small series which avoids using local_irq_disable()/local_irq_enable() but instead does spin_lock_irq()/spin_unlock_irq() so it is within the context of the lock which it belongs to. Patch #1 is a cleanup where local_irq_.*() remained after the lock was removed. This patch (of 2): In 0c7c1bed7e13 ("mm: make counting of list_lru_one::nr_items lockless") the spin_lock(&nlru->lock); statement was replaced with rcu_read_lock(); in __list_lru_count_one(). The comment in count_shadow_nodes() says that the local_irq_disable() is required because the lock must be acquired with disabled interrupts and (spin_lock()) does not do so. Since the lock is replaced with rcu_read_lock() the local_irq_disable() is no longer needed. The code path is list_lru_shrink_count() -> list_lru_count_one() -> __list_lru_count_one() -> rcu_read_lock() -> list_lru_from_memcg_idx() -> rcu_read_unlock() Remove the local_irq_disable() statement. Link: http://lkml.kernel.org/r/20180622151221.28167-2-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Andrew Morton Reviewed-by: Kirill Tkhai Acked-by: Vladimir Davydov Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9ea9a68064035dee70f465f605a3e63990e33bd9 Author: Michal Hocko Date: Fri Aug 17 15:46:01 2018 -0700 mm: drop VM_BUG_ON from __get_free_pages There is no real reason to blow up just because the caller doesn't know that __get_free_pages cannot return highmem pages. Simply fix that up silently. Even if we have some confused users such a fixup will not be harmful. [akpm@linux-foundation.org: mask off __GFP_HIGHMEM] Link: http://lkml.kernel.org/r/20180622162841.25114-1-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Cc: Jiankang Chen Cc: Mel Gorman Cc: Johannes Weiner Cc: Yisheng Xie Cc: Hanjun Guo Cc: Kefeng Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 974e6d66b6b5c6e2d6a3ccc18b2f9a0b472be5b4 Author: Huang Ying Date: Fri Aug 17 15:45:57 2018 -0700 mm, hugetlbfs: pass fault address to cow handler This is to take better advantage of the general huge page copying optimization. Where, the target subpage will be copied last to avoid the cache lines of target subpage to be evicted when copying other subpages. This works better if the address of the target subpage is available when copying huge page. So hugetlbfs page fault handlers are changed to pass that information to hugetlb_cow(). This will benefit workloads which don't access the begin of the hugetlbfs huge page after the page fault under heavy cache contention. Link: http://lkml.kernel.org/r/20180524005851.4079-5-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Mike Kravetz Cc: Michal Hocko Cc: David Rientjes Cc: Andrea Arcangeli Cc: "Kirill A. Shutemov" Cc: Andi Kleen Cc: Jan Kara Cc: Matthew Wilcox Cc: Hugh Dickins Cc: Minchan Kim Cc: Shaohua Li Cc: Christopher Lameter Cc: "Aneesh Kumar K.V" Cc: Punit Agrawal Cc: Anshuman Khandual Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b7a1d406062449a4d51aea1df37a73285ced1dc Author: Huang Ying Date: Fri Aug 17 15:45:53 2018 -0700 mm, hugetlbfs: rename address to haddr in hugetlb_cow() To take better advantage of general huge page copying optimization, the target subpage address will be passed to hugetlb_cow(), then copy_user_huge_page(). So we will use both target subpage address and huge page size aligned address in hugetlb_cow(). To distinguish between them, "haddr" is used for huge page size aligned address to be consistent with Transparent Huge Page naming convention. Now, only huge page size aligned address is used in hugetlb_cow(), so the "address" is renamed to "haddr" in hugetlb_cow() in this patch. Next patch will use target subpage address in hugetlb_cow() too. The patch is just code cleanup without any functionality changes. Link: http://lkml.kernel.org/r/20180524005851.4079-4-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-by: Mike Kravetz Suggested-by: Michal Hocko Reviewed-by: Mike Kravetz Cc: David Rientjes Cc: Andrea Arcangeli Cc: "Kirill A. Shutemov" Cc: Andi Kleen Cc: Jan Kara Cc: Matthew Wilcox Cc: Hugh Dickins Cc: Minchan Kim Cc: Shaohua Li Cc: Christopher Lameter Cc: "Aneesh Kumar K.V" Cc: Punit Agrawal Cc: Anshuman Khandual Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c9f4cd71383576a916e7fca99c490fc92a289f5a Author: Huang Ying Date: Fri Aug 17 15:45:49 2018 -0700 mm, huge page: copy target sub-page last when copy huge page Huge page helps to reduce TLB miss rate, but it has higher cache footprint, sometimes this may cause some issue. For example, when copying huge page on x86_64 platform, the cache footprint is 4M. But on a Xeon E5 v3 2699 CPU, there are 18 cores, 36 threads, and only 45M LLC (last level cache). That is, in average, there are 2.5M LLC for each core and 1.25M LLC for each thread. If the cache contention is heavy when copying the huge page, and we copy the huge page from the begin to the end, it is possible that the begin of huge page is evicted from the cache after we finishing copying the end of the huge page. And it is possible for the application to access the begin of the huge page after copying the huge page. In c79b57e462b5d ("mm: hugetlb: clear target sub-page last when clearing huge page"), to keep the cache lines of the target subpage hot, the order to clear the subpages in the huge page in clear_huge_page() is changed to clearing the subpage which is furthest from the target subpage firstly, and the target subpage last. The similar order changing helps huge page copying too. That is implemented in this patch. Because we have put the order algorithm into a separate function, the implementation is quite simple. The patch is a generic optimization which should benefit quite some workloads, not for a specific use case. To demonstrate the performance benefit of the patch, we tested it with vm-scalability run on transparent huge page. With this patch, the throughput increases ~16.6% in vm-scalability anon-cow-seq test case with 36 processes on a 2 socket Xeon E5 v3 2699 system (36 cores, 72 threads). The test case set /sys/kernel/mm/transparent_hugepage/enabled to be always, mmap() a big anonymous memory area and populate it, then forked 36 child processes, each writes to the anonymous memory area from the begin to the end, so cause copy on write. For each child process, other child processes could be seen as other workloads which generate heavy cache pressure. At the same time, the IPC (instruction per cycle) increased from 0.63 to 0.78, and the time spent in user space is reduced ~7.2%. Link: http://lkml.kernel.org/r/20180524005851.4079-3-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Mike Kravetz Cc: Andi Kleen Cc: Jan Kara Cc: Michal Hocko Cc: Andrea Arcangeli Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Hugh Dickins Cc: Minchan Kim Cc: Shaohua Li Cc: Christopher Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c6ddfb6c58903262d2d77042c41dba58cf775d88 Author: Huang Ying Date: Fri Aug 17 15:45:46 2018 -0700 mm, clear_huge_page: move order algorithm into a separate function Patch series "mm, huge page: Copy target sub-page last when copy huge page", v2. Huge page helps to reduce TLB miss rate, but it has higher cache footprint, sometimes this may cause some issue. For example, when copying huge page on x86_64 platform, the cache footprint is 4M. But on a Xeon E5 v3 2699 CPU, there are 18 cores, 36 threads, and only 45M LLC (last level cache). That is, in average, there are 2.5M LLC for each core and 1.25M LLC for each thread. If the cache contention is heavy when copying the huge page, and we copy the huge page from the begin to the end, it is possible that the begin of huge page is evicted from the cache after we finishing copying the end of the huge page. And it is possible for the application to access the begin of the huge page after copying the huge page. In c79b57e462b5d ("mm: hugetlb: clear target sub-page last when clearing huge page"), to keep the cache lines of the target subpage hot, the order to clear the subpages in the huge page in clear_huge_page() is changed to clearing the subpage which is furthest from the target subpage firstly, and the target subpage last. The similar order changing helps huge page copying too. That is implemented in this patchset. The patchset is a generic optimization which should benefit quite some workloads, not for a specific use case. To demonstrate the performance benefit of the patchset, we have tested it with vm-scalability run on transparent huge page. With this patchset, the throughput increases ~16.6% in vm-scalability anon-cow-seq test case with 36 processes on a 2 socket Xeon E5 v3 2699 system (36 cores, 72 threads). The test case set /sys/kernel/mm/transparent_hugepage/enabled to be always, mmap() a big anonymous memory area and populate it, then forked 36 child processes, each writes to the anonymous memory area from the begin to the end, so cause copy on write. For each child process, other child processes could be seen as other workloads which generate heavy cache pressure. At the same time, the IPC (instruction per cycle) increased from 0.63 to 0.78, and the time spent in user space is reduced ~7.2%. This patch (of 4): In c79b57e462b5d ("mm: hugetlb: clear target sub-page last when clearing huge page"), to keep the cache lines of the target subpage hot, the order to clear the subpages in the huge page in clear_huge_page() is changed to clearing the subpage which is furthest from the target subpage firstly, and the target subpage last. This optimization could be applied to copying huge page too with the same order algorithm. To avoid code duplication and reduce maintenance overhead, in this patch, the order algorithm is moved out of clear_huge_page() into a separate function: process_huge_page(). So that we can use it for copying huge page too. This will change the direct calls to clear_user_highpage() into the indirect calls. But with the proper inline support of the compilers, the indirect call will be optimized to be the direct call. Our tests show no performance change with the patch. This patch is a code cleanup without functionality change. Link: http://lkml.kernel.org/r/20180524005851.4079-2-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-by: Mike Kravetz Reviewed-by: Mike Kravetz Cc: Andi Kleen Cc: Jan Kara Cc: Michal Hocko Cc: Andrea Arcangeli Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Hugh Dickins Cc: Minchan Kim Cc: Shaohua Li Cc: Christopher Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ac22b46a0b65dbeccbf4d458db95687e825bde90 Author: Jens Axboe Date: Fri Aug 17 15:45:42 2018 -0700 ext4: readpages() should submit IO as read-ahead a_ops->readpages() is only ever used for read-ahead. Ensure that we pass this information down to the block layer. Link: http://lkml.kernel.org/r/20180621010725.17813-5-axboe@kernel.dk Signed-off-by: Jens Axboe Reviewed-by: Andrew Morton Cc: Al Viro Cc: Chris Mason Cc: Christoph Hellwig Cc: Theodore Ts'o Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5e9d398240b2292b1091f921d29bbab374b755fd Author: Jens Axboe Date: Fri Aug 17 15:45:39 2018 -0700 btrfs: readpages() should submit IO as read-ahead a_ops->readpages() is only ever used for read-ahead. Ensure that we pass this information down to the block layer. Link: http://lkml.kernel.org/r/20180621010725.17813-4-axboe@kernel.dk Signed-off-by: Jens Axboe Reviewed-by: Andrew Morton Cc: Al Viro Cc: Chris Mason Cc: Christoph Hellwig Cc: Theodore Ts'o Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 74c8164e1cdb1eb22f1d49d54e515e81821a8ad0 Author: Jens Axboe Date: Fri Aug 17 15:45:36 2018 -0700 mpage: mpage_readpages() should submit IO as read-ahead a_ops->readpages() is only ever used for read-ahead, yet we don't flag the IO being submitted as such. Fix that up. Any file system that uses mpage_readpages() as its ->readpages() implementation will now get this right. Since we're passing in whether the IO is read-ahead or not, we don't need to pass in the 'gfp' separately, as it is dependent on the IO being read-ahead. Kill off that member. Add some documentation notes on ->readpages() being purely for read-ahead. Link: http://lkml.kernel.org/r/20180621010725.17813-3-axboe@kernel.dk Signed-off-by: Jens Axboe Reviewed-by: Andrew Morton Cc: Al Viro Cc: Chris Mason Cc: Christoph Hellwig Cc: Theodore Ts'o Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 357c1206520da7a40e383fe329ce379bda722cd9 Author: Jens Axboe Date: Fri Aug 17 15:45:32 2018 -0700 mpage: add argument structure for do_mpage_readpage() Patch series "Submit ->readpages() IO as read-ahead", v4. The only caller of ->readpages() is from read-ahead, yet we don't submit IO flagged with REQ_RAHEAD. This means we don't see it in blktrace, for instance, which is a shame. Additionally, it's preventing further functional changes in the block layer for deadling with read-ahead more intelligently. We already make assumptions about ->readpages() just being for read-ahead in the mpage implementation, using readahead_gfp_mask(mapping) as out GFP mask of choice. This small series fixes up mpage_readpages() to submit with REQ_RAHEAD, which takes care of file systems using mpage_readpages(). The first patch is a prep patch, that makes do_mpage_readpage() take an argument structure. This patch (of 4): We're currently passing 8 arguments to this function, clean it up a bit by packing the arguments in an args structure we pass to it. No intentional functional changes in this patch. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/20180621010725.17813-2-axboe@kernel.dk Signed-off-by: Jens Axboe Reviewed-by: Andrew Morton Cc: Al Viro Cc: Christoph Hellwig Cc: Theodore Ts'o Cc: Chris Mason Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 87aa752906ecf69842ef5ac1d0677aa75a4e0aac Author: Yang Shi Date: Fri Aug 17 15:45:29 2018 -0700 mm: thp: inc counter for collapsed shmem THP /sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed is used to record the counter of collapsed THP, but it just gets inc'ed in anonymous THP collapse path, do this for shmem THP collapse too. Link: http://lkml.kernel.org/r/1529622949-75504-2-git-send-email-yang.shi@linux.alibaba.com Signed-off-by: Yang Shi Acked-by: Kirill A. Shutemov Cc: Hugh Dickins Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c2231020ea7b53d486395dbd8d3216e0dd1fc7ee Author: Yang Shi Date: Fri Aug 17 15:45:26 2018 -0700 mm: thp: register mm for khugepaged when merging vma for shmem When merging anonymous page vma, if the size of the vma can fit in at least one hugepage, the mm will be registered for khugepaged for collapsing THP in the future. But it skips shmem vmas. Do so for shmem also, but not for file-private mappings when merging a vma in order to increase the odds of collapsing a hugepage via khugepaged. hugepage_vma_check() sounds like a good fit to do the check. And move the definition of it before khugepaged_enter_vma_merge() to avoid a build error. Link: http://lkml.kernel.org/r/1529697791-6950-1-git-send-email-yang.shi@linux.alibaba.com Signed-off-by: Yang Shi Acked-by: Kirill A. Shutemov Cc: Hugh Dickins Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8cded8668e1f49ab9b90682bca76e861782416e9 Author: Jia-Ju Bai Date: Fri Aug 17 15:45:22 2018 -0700 mm/mempool.c: remove unused argument in kasan_unpoison_element() and remove_element() The argument "gfp_t flags" is not used in kasan_unpoison_element() and remove_element(), so remove it. Link: http://lkml.kernel.org/r/20180621070332.16633-1-baijiaju1990@gmail.com Signed-off-by: Jia-Ju Bai Reviewed-by: Matthew Wilcox Acked-by: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bb451fdf3d058dfecee1c0b965342d344e7d8317 Author: Greg Thelen Date: Fri Aug 17 15:45:19 2018 -0700 mm/vmscan.c: condense scan_control Use smaller scan_control fields for order, priority, and reclaim_idx. Convert fields from int => s8. All easily fit within a byte: - allocation order range: 0..MAX_ORDER(64?) - priority range: 0..12(DEF_PRIORITY) - reclaim_idx range: 0..6(__MAX_NR_ZONES) Since 6538b8ea886e ("x86_64: expand kernel stack to 16K") x86_64 stack overflows are not an issue. But it's inefficient to use ints. Use s8 (signed byte) rather than u8 to allow for loops like: do { ... } while (--sc.priority >= 0); Add BUILD_BUG_ON to verify that s8 is capable of storing max values. This reduces sizeof(struct scan_control): - 96 => 80 bytes (x86_64) - 68 => 56 bytes (i386) scan_control structure field order is changed to utilize padding. After this patch there is 1 bit of scan_control padding. akpm: makes my vmscan.o's .text 572 bytes smaller as well. Link: http://lkml.kernel.org/r/20180530061212.84915-1-gthelen@google.com Signed-off-by: Greg Thelen Suggested-by: Matthew Wilcox Reviewed-by: Andrew Morton Cc: Michal Hocko Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 10ed63415223b16d7e80ba528556500231814232 Author: Kirill A. Shutemov Date: Fri Aug 17 15:45:15 2018 -0700 mm/page_ext.c: constify lookup_page_ext() argument lookup_page_ext() finds 'struct page_ext' for a given page. It requires only read access to the given struct page. Current implemnentation takes 'struct page *' as an argument. It makes compiler complain when 'const struct page *' passed. Change the argument to 'const struct page *'. Link: http://lkml.kernel.org/r/20180531135457.20167-3-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov Reviewed-by: Andrew Morton Cc: Vinayak Menon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b3a2369692fedcc439dfaa4f215cf5323a886c88 Author: Kirill A. Shutemov Date: Fri Aug 17 15:45:12 2018 -0700 include/linux/page_ext.h: drop definition of unused PAGE_EXT_DEBUG_POISON After commit bd33ef368135 ("mm: enable page poisoning early at boot") PAGE_EXT_DEBUG_POISON is not longer used. Remove it. Link: http://lkml.kernel.org/r/20180531135457.20167-2-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov Reviewed-by: Vinayak Menon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 46c9a946d766fa830a85d6599de5891fe9e717d2 Author: Arnd Bergmann Date: Fri Aug 17 15:45:09 2018 -0700 shmem: use monotonic time for i_generation get_seconds() is deprecated because it will lead to a 32-bit overflow in 2038 or 2106. We don't need the i_generation to be strictly monotonic anyway, and other file systems like ext4 and xfs just use prandom_u32(), so let's use the same one here. If this is considered too slow, we could also use ktime_get_seconds() or ktime_get_real_seconds() to keep the previous behavior. Both of these return a time64_t and are not deprecated, but only return a unique value once per second, and are predictable. Link: http://lkml.kernel.org/r/20180620082556.581543-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Reviewed-by: Andrew Morton Cc: Hugh Dickins Cc: Mike Kravetz Cc: "Kirill A. Shutemov" Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d6a24df00638a09abd8fb99bdb5a1c7fdd536e59 Author: Vlastimil Babka Date: Fri Aug 17 15:45:05 2018 -0700 mm, page_alloc: actually ignore mempolicies for high priority allocations __alloc_pages_slowpath() has for a long time contained code to ignore node restrictions from memory policies for high priority allocations. The current code that resets the zonelist iterator however does effectively nothing after commit 7810e6781e0f ("mm, page_alloc: do not break __GFP_THISNODE by zonelist reset") removed a buggy zonelist reset. Even before that commit, mempolicy restrictions were still not ignored, as they are passed in ac->nodemask which is untouched by the code. We can either remove the code, or make it work as intended. Since ac->nodemask can be set from task's mempolicy via alloc_pages_current() and thus also alloc_pages(), it may indeed affect kernel allocations, and it makes sense to ignore it to allow progress for high priority allocations. Thus, this patch resets ac->nodemask to NULL in such cases. This assumes all callers can handle it (i.e. there are no guarantees as in the case of __GFP_THISNODE) which seems to be the case. The same assumption is already present in check_retry_cpuset() for some time. The expected effect is that high priority kernel allocations in the context of userspace tasks (e.g. OOM victims) restricted by mempolicies will have higher chance to succeed if they are restricted to nodes with depleted memory, while there are other nodes with free memory left. It's not a new intention, but for the first time the code will match the intention, AFAICS. It was intended by commit 183f6371aac2 ("mm: ignore mempolicies when using ALLOC_NO_WATERMARK") in v3.6 but I think it never really worked, as mempolicy restriction was already encoded in nodemask, not zonelist, at that time. So originally that was for ALLOC_NO_WATERMARK only. Then it was adjusted by e46e7b77c909 ("mm, page_alloc: recalculate the preferred zoneref if the context can ignore memory policies") and cd04ae1e2dc8 ("mm, oom: do not rely on TIF_MEMDIE for memory reserves access") to the current state. So even GFP_ATOMIC would now ignore mempolicies after the initial attempts fail - if the code worked as people thought it does. Link: http://lkml.kernel.org/r/20180612122624.8045-1-vbabka@suse.cz Signed-off-by: Vlastimil Babka Acked-by: Michal Hocko Acked-by: Mel Gorman Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 59ae96ffc3a6731c3b85f9925e07e893d392e814 Author: Christian Hansen Date: Fri Aug 17 15:45:02 2018 -0700 tools/vm/page-types.c: add support for idle page tracking Add a flag which causes page-types to use the kernels's idle page tracking to mark pages idle. As the tool already prints the idle flag if set, subsequent runs will show which pages have been accessed since last run. [akpm@linux-foundation.org: simplify mark_page_idle()] [chansen3@cisco.com: reorganize mark_page_idle() logic, add docs] Link: http://lkml.kernel.org/r/20180706172237.21691-1-chansen3@cisco.com Link: http://lkml.kernel.org/r/20180612153223.13174-1-chansen3@cisco.com Signed-off-by: Christian Hansen Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7f1d23e607185e07e5df2a806a989c24627aef41 Author: Christian Hansen Date: Fri Aug 17 15:44:59 2018 -0700 tools/vm/page-types.c: include shared map counts Add a new flag that will read kpagecount for each PFN and print out the number of times the page is mapped along with the flags in the listing view. This information is useful in understanding and optimizing memory usage. Identifying pages which are not shared allows us to focus on adjusting the memory layout or access patterns for the sole owning process. Knowing the number of processes that share a page tells us how many other times we must make the same adjustments or how many processes to potentially disable. Truncated sample output: voffset map-cnt offset len flags 561a3591e 1 15fe8 1 ___U_lA____Ma_b___________________________ 561a3591f 1 2b103 1 ___U_lA____Ma_b___________________________ 561a36ca4 1 2cc78 1 ___U_lA____Ma_b___________________________ 7f588bb4e 14 2273c 1 __RU_lA____M______________________________ [akpm@linux-foundation.org: coding-style fixes] [chansen3@cisco.com: add documentation, tweak whitespace] Link: http://lkml.kernel.org/r/20180705181204.5529-1-chansen3@cisco.com Link: http://lkml.kernel.org/r/20180612153205.12879-1-chansen3@cisco.com Signed-off-by: Christian Hansen Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fadae2953072e9005c5f1d64e1049edb043494dc Author: Yang Shi Date: Fri Aug 17 15:44:55 2018 -0700 thp: use mm_file_counter to determine update which rss counter Since commit eca56ff906bd ("mm, shmem: add internal shmem resident memory accounting"), MM_SHMEMPAGES is added to separate the shmem accounting from regular files. So, all shmem pages should be accounted to MM_SHMEMPAGES instead of MM_FILEPAGES. And, normal 4K shmem pages have been accounted to MM_SHMEMPAGES, so shmem thp pages should be not treated differently. Account them to MM_SHMEMPAGES via mm_counter_file() since shmem pages are swap backed to keep consistent with normal 4K shmem pages. This will not change the rss counter of processes since shmem pages are still a part of it. The /proc/pid/status and /proc/pid/statm counters will however be more accurate wrt shmem usage, as originally intended. And as eca56ff906bd ("mm, shmem: add internal shmem resident memory accounting") mentioned, oom also could report more accurate "shmem-rss". Link: http://lkml.kernel.org/r/1529442518-17398-1-git-send-email-yang.shi@linux.alibaba.com Signed-off-by: Yang Shi Acked-by: Vlastimil Babka Cc: Hugh Dickins Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 720e14ebec642bc56c44e5e60a2d595900e5bbf0 Author: Pavel Tatashin Date: Fri Aug 17 15:44:52 2018 -0700 mm: skip invalid pages block at a time in zero_resv_unresv() The role of zero_resv_unavail() is to make sure that every struct page that is allocated but is not backed by memory that is accessible by kernel is zeroed and not in some uninitialized state. Since struct pages are allocated in blocks (2M pages in x86 case), we can skip pageblock_nr_pages at a time, when the first one is found to be invalid. This optimization may help since now on x86 every hole in e820 maps is marked as reserved in memblock, and thus will go through this function. This function is called before sched_clock() is initialized, so I used my x86 early boot clock patches to measure the performance improvement. With 1T hole on i7-8700 currently we would take 0.606918s of boot time, but with this optimization 0.001103s. Link: http://lkml.kernel.org/r/20180615155733.1175-1-pasha.tatashin@oracle.com Signed-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador Reviewed-by: Naoya Horiguchi Cc: Pasha Tatashin Cc: Steven Sistare Cc: Daniel Jordan Cc: Michal Hocko Cc: Matthew Wilcox Cc: Ingo Molnar Cc: Dan Williams Cc: "Huang, Ying" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 50a7ca3c6fc86955f99fc432fc8a186b968b365b Author: Souptick Joarder Date: Fri Aug 17 15:44:47 2018 -0700 mm: convert return type of handle_mm_fault() caller to vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") In this patch all the caller of handle_mm_fault() are changed to return vm_fault_t type. Link: http://lkml.kernel.org/r/20180617084810.GA6730@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Cc: Matthew Wilcox Cc: Richard Henderson Cc: Tony Luck Cc: Matt Turner Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Richard Kuo Cc: Geert Uytterhoeven Cc: Michal Simek Cc: James Hogan Cc: Ley Foon Tan Cc: Jonas Bonn Cc: James E.J. Bottomley Cc: Benjamin Herrenschmidt Cc: Palmer Dabbelt Cc: Yoshinori Sato Cc: David S. Miller Cc: Richard Weinberger Cc: Guan Xuetao Cc: Thomas Gleixner Cc: "H. Peter Anvin" Cc: "Levin, Alexander (Sasha Levin)" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0882ff9190e3bc51e2d78c3aadd7c690eeaa91d5 Author: Vlastimil Babka Date: Fri Aug 17 15:44:44 2018 -0700 mm, slub: restore the original intention of prefetch_freepointer() In SLUB, prefetch_freepointer() is used when allocating an object from cache's freelist, to make sure the next object in the list is cache-hot, since it's probable it will be allocated soon. Commit 2482ddec670f ("mm: add SLUB free list pointer obfuscation") has unintentionally changed the prefetch in a way where the prefetch is turned to a real fetch, and only the next->next pointer is prefetched. In case there is not a stream of allocations that would benefit from prefetching, the extra real fetch might add a useless cache miss to the allocation. Restore the previous behavior. Link: http://lkml.kernel.org/r/20180809085245.22448-1-vbabka@suse.cz Fixes: 2482ddec670f ("mm: add SLUB free list pointer obfuscation") Signed-off-by: Vlastimil Babka Acked-by: Kees Cook Cc: Daniel Micay Cc: Eric Dumazet Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1f4aace60b0edc2d885aaa263abf4df42c8c65a8 Author: NeilBrown Date: Fri Aug 17 15:44:41 2018 -0700 fs/seq_file.c: simplify seq_file iteration code and interface The documentation for seq_file suggests that it is necessary to be able to move the iterator to a given offset, however that is not the case. If the iterator is stored in the private data and is stable from one read() syscall to the next, it is only necessary to support first/next interactions. Implementing this in a client is a little clumsy. - if ->start() is given a pos of zero, it should go to start of sequence. - if ->start() is given the name pos that was given to the most recent next() or start(), it should restore the iterator to state just before that last call - if ->start is given another number, it should set the iterator one beyond the start just before the last ->start or ->next call. Also, the documentation says that the implementation can interpret the pos however it likes (other than zero meaning start), but seq_file increments the pos sometimes which does impose on the implementation. This patch simplifies the interface for first/next iteration and simplifies the code, while maintaining complete backward compatability. Now: - if ->start() is given a pos of zero, it should return an iterator placed at the start of the sequence - if ->start() is given a non-zero pos, it should return the iterator in the same state it was after the last ->start or ->next. This is particularly useful for interators which walk the multiple chains in a hash table, e.g. using rhashtable_walk*. See fs/gfs2/glock.c and drivers/staging/lustre/lustre/llite/vvp_dev.c A large part of achieving this is to *always* call ->next after ->show has successfully stored all of an entry in the buffer. Never just increment the index instead. Also: - always pass &m->index to ->start() and ->next(), never a temp variable - don't clear ->from when ->count is zero, as ->from is dead when ->count is zero. Some ->next functions do not increment *pos when they return NULL. To maintain compatability with this, we still need to increment m->index in one place, if ->next didn't increment it. Note that such ->next functions are buggy and should be fixed. A simple demonstration is dd if=/proc/swaps bs=1000 skip=1 Choose any block size larger than the size of /proc/swaps. This will always show the whole last line of /proc/swaps. This patch doesn't work around buggy next() functions for this case. [neilb@suse.com: ensure ->from is valid] Link: http://lkml.kernel.org/r/87601ryb8a.fsf@notabene.neil.brown.name Signed-off-by: NeilBrown Acked-by: Jonathan Corbet [docs] Tested-by: Jann Horn Cc: Alexander Viro Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cdfffc8722e99be8d400d8fa1fcd615d078ad43 Author: NeilBrown Date: Fri Aug 17 15:44:37 2018 -0700 vfs: discard ATTR_ATTR_FLAG This flag was introduce in 2.1.37pre1 and the only place it was tested was removed in 2.1.43pre1. The flag was never set. Let's discard it properly. Link: http://lkml.kernel.org/r/877en0hewz.fsf@notabene.neil.brown.name Signed-off-by: NeilBrown Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6cd00a01f0c1ae6a852b09c59b8dd55cc6c35d1d Author: Tetsuo Handa Date: Fri Aug 17 15:44:34 2018 -0700 fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot() Since only dentry->d_name.len + 1 bytes out of DNAME_INLINE_LEN bytes are initialized at __d_alloc(), we can't copy the whole size unconditionally. WARNING: kmemcheck: Caught 32-bit read from uninitialized memory (ffff8fa27465ac50) 636f6e66696766732e746d70000000000010000000000000020000000188ffff i i i i i i i i i i i i i u u u u u u u u u u i i i i i u u u u ^ RIP: 0010:take_dentry_name_snapshot+0x28/0x50 RSP: 0018:ffffa83000f5bdf8 EFLAGS: 00010246 RAX: 0000000000000020 RBX: ffff8fa274b20550 RCX: 0000000000000002 RDX: ffffa83000f5be40 RSI: ffff8fa27465ac50 RDI: ffffa83000f5be60 RBP: ffffa83000f5bdf8 R08: ffffa83000f5be48 R09: 0000000000000001 R10: ffff8fa27465ac00 R11: ffff8fa27465acc0 R12: ffff8fa27465ac00 R13: ffff8fa27465acc0 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f79737ac8c0(0000) GS:ffffffff8fc30000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff8fa274c0b000 CR3: 0000000134aa7002 CR4: 00000000000606f0 take_dentry_name_snapshot+0x28/0x50 vfs_rename+0x128/0x870 SyS_rename+0x3b2/0x3d0 entry_SYSCALL_64_fastpath+0x1a/0xa4 0xffffffffffffffff Link: http://lkml.kernel.org/r/201709131912.GBG39012.QMJLOVFSFFOOtH@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Cc: Vegard Nossum Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 480bd56485b77c36e17a411921266c6f06623d98 Author: Colin Ian King Date: Fri Aug 17 15:44:31 2018 -0700 ocfs2: make several functions and variables static (and some const) There are a variety of functions and variables that are local to the source and do not need to be in global scope, so make them static. Also make a couple of char arrays static const. Cleans up sparse warnings: symbol 'o2hb_heartbeat_mode_desc' was not declared. Should it be static? symbol 'o2hb_heartbeat_mode' was not declared. Should it be static? symbol 'o2hb_dependent_users' was not declared. Should it be static? symbol 'o2hb_region_dec_user' was not declared. Should it be static? symbol 'o2nm_fence_method_desc' was not declared. Should it be static? symbol 'lockdep_keys' was not declared. Should it be static? Link: http://lkml.kernel.org/r/20180628131659.12133-1-colin.king@canonical.com Signed-off-by: Colin Ian King Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Joseph Qi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 229ba1f82abe4c942e2ab5862daafdfe471fedd8 Author: wangyan Date: Fri Aug 17 15:44:27 2018 -0700 ocfs2: clean up some unnecessary code Several functions have some unnecessary code, clean up these code. Link: http://lkml.kernel.org/r/5B14DF72.5020800@huawei.com Signed-off-by: Yan Wang Reviewed-by: Jun Piao Reviewed-by: Andrew Morton Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Joseph Qi Cc: Changwei Ge Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 93f5920d8607c5e3f2d3b159377a7e7d7875ffdd Author: Jun Piao Date: Fri Aug 17 15:44:24 2018 -0700 ocfs2: return -EROFS when filesystem becomes read-only We should return -EROFS rather than other errno if filesystem becomes read-only. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/5B191B26.9010501@huawei.com Signed-off-by: Jun Piao Reviewed-by: Yiwen Jiang Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8d00d0c00c0720c43b0eec0e86a6e916192f35d0 Author: Nick Desaulniers Date: Fri Aug 17 15:44:21 2018 -0700 sh: prefer _THIS_IP_ to current_text_addr As part of the effort to reduce the code duplication between _THIS_IP_ and current_text_addr(), let's consolidate callers of current_text_addr() to use _THIS_IP_. Link: http://lkml.kernel.org/r/20180801185331.39535-1-ndesaulniers@google.com Signed-off-by: Nick Desaulniers Cc: Yoshinori Sato Cc: Rich Felker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 82f7c5103dcdd714486a64cfc5783cc4608d124c Author: Dmitry Torokhov Date: Fri Aug 17 15:44:17 2018 -0700 sh: make use of for_each_node_by_type() Instead of open-coding the loop, let's use canned macro. Also make sure we are not leaking "cpus" node reference. Link: http://lkml.kernel.org/r/20180624224252.GA220395@dtor-ws Signed-off-by: Dmitry Torokhov Reviewed-by: Andrew Morton Cc: Yoshinori Sato Cc: Rich Felker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ab62ef82ea49b8814f4b0e2fe61426acda793fb9 Author: Kees Cook Date: Fri Aug 17 15:44:14 2018 -0700 ntfs: mft: remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this allocates the maximum size stack buffer. Existing checks already require that blocksize >= NTFS_BLOCK_SIZE and mft_record_size <= PAGE_SIZE, so max_bhs can be at most PAGE_SIZE / NTFS_BLOCK_SIZE. Sanity checks are added for robustness. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Link: http://lkml.kernel.org/r/20180626172909.41453-4-keescook@chromium.org Signed-off-by: Kees Cook Cc: Anton Altaparmakov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2c27ce915078a5822aefb5db7bc2481664b26044 Author: Kees Cook Date: Fri Aug 17 15:44:11 2018 -0700 ntfs: decompress: remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this moves the stack buffer used during decompression to be allocated externally. The existing "dest_max_index" used in the VLA is bounded by cb_max_page. cb_max_page is bounded by max_page, and max_page is bounded by nr_pages. Since nr_pages is used for the "pages" allocation, it can similarly be used for the "completed_pages" allocation and passed into the decompression function. The error paths are updated to free the new allocation. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Link: http://lkml.kernel.org/r/20180626172909.41453-3-keescook@chromium.org Signed-off-by: Kees Cook Cc: Anton Altaparmakov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ac4ecf968acb9e54c335f99d842d56d6b90e28fb Author: Kees Cook Date: Fri Aug 17 15:44:07 2018 -0700 ntfs: aops: remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this uses the maximum size needed on the stack and adds a sanity check for robustness: index.block_size cannot be larger than PAGE_SIZE nor less than NTFS_BLOCK_SIZE. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Link: http://lkml.kernel.org/r/20180626172909.41453-2-keescook@chromium.org Signed-off-by: Kees Cook Cc: Anton Altaparmakov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a10dcebacdb0cf6eb29c211e99cf190cd131a16a Author: Sebastian Andrzej Siewior Date: Fri Aug 17 15:44:04 2018 -0700 fs/ntfs/aops.c: don't disable interrupts during kmap_atomic() ntfs_end_buffer_async_read() disables interrupts around kmap_atomic(). This is a leftover from the old kmap_atomic() implementation which relied on fixed mapping slots, so the caller had to make sure that the same slot could not be reused from an interrupting context. kmap_atomic() was changed to dynamic slots long ago and commit 1ec9c5ddc17a ("include/linux/highmem.h: remove the second argument of k[un]map_atomic()") removed the slot assignements, but the callers were not checked for now redundant interrupt disabling. Remove the conditional interrupt disable. Link: http://lkml.kernel.org/r/20180611144913.gln5mklhqcrfsoom@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Cc: Anton Altaparmakov Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bed95c43c15eb6b1ccc5b09e5ae08cac726c456d Author: Jeremy Cline Date: Fri Aug 17 15:44:01 2018 -0700 scripts: add Python 3 compatibility to spdxcheck.py "dict.has_key(key)" on dictionaries has been replaced with "key in dict". Additionally, when run under Python 3 some files don't decode with the default encoding (tested with UTF-8). To handle that, don't open the file in text mode and decode text line-by-line, ignoring encoding errors. This remains compatible with Python 2 and should have no functional change. Link: http://lkml.kernel.org/r/20180717190635.29467-1-jcline@redhat.com Signed-off-by: Jeremy Cline Acked-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fde5e903fb5893415fa49d280e998be226d0898f Author: Joe Perches Date: Fri Aug 17 15:43:57 2018 -0700 scripts/spdxcheck.py: work with current HEAD LICENSES/ directory Depending on how old your -next tree is, it may not have a master that has the LICENSES directory. Change the lookup to HEAD and find whatever LICENSE directory files are used in that branch. Miscellanea: - Remove the checkpatch test as it will have its own SPDX license identifier. Link: http://lkml.kernel.org/r/7eeefc862194930c773e662cb2152e178441d3b8.camel@perches.com Signed-off-by: Joe Perches Reviewed-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f08957d0ffe91f346c47cef95139c54aa7275cfe Author: Arnd Bergmann Date: Fri Aug 17 15:43:54 2018 -0700 fs/hpfs: extend gmt_to_local() conversion to 64-bit times The VFS timestamps are all 64-bit now, the only missing piece for hpfs is the internal conversion function. One interesting bit about hpfs is that it can already deal with moving the 136 year window of its timestamps to support a much wider range than other file systems with 32-bit timestamps. It also treats the timestamps as 'unsigned' on 64-bit architectures (but signed on 32-bit, because time_t always around to negative numbers in 2038). Changing the conversion to use time64_t makes 32-bit architectures behave the same way as 64-bit. For completeness, this also adds a clamp_t call for each conversion, so we don't wrap the timestamps but instead stay within the [0..U32_MAX] range of the on-disk timestamps. Link: http://lkml.kernel.org/r/20180718115017.742609-3-arnd@arndb.de Signed-off-by: Arnd Bergmann Cc: Mikulas Patocka Cc: Al Viro Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bcf451ecfc8d45618d13c9e4abcbbd770af20cc9 Author: Arnd Bergmann Date: Fri Aug 17 15:43:50 2018 -0700 fs/ntfs: use timespec64 directly for timestamp conversion Now that the VFS has been converted from timespec to timespec64 timestamps, only the conversion to/from ntfs timestamps uses 32-bit seconds. This changes that last missing piece to get the ntfs implementation y2038 safe on 32-bit architectures. Link: http://lkml.kernel.org/r/20180718115017.742609-2-arnd@arndb.de Signed-off-by: Arnd Bergmann Cc: Anton Altaparmakov Cc: Al Viro Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a3fda0ffeaf0114328024aee4a9ec3b08af4b077 Author: Arnd Bergmann Date: Fri Aug 17 15:43:47 2018 -0700 fs/ufs: use ktime_get_real_seconds for sb and cg timestamps get_seconds() is deprecated because of the 32-bit overflow and will be removed. All callers in ufs also truncate to a 32-bit number, so nothing changes during the conversion, but this should be harmless as the superblock and cylinder group timestamps are not visible to user space, except for checking the fs-dirty state, wich works fine across the overflow. This moves the call to get_seconds() into a new inline function, with a comment explaining the constraints, while converting it to ktime_get_real_seconds(). Link: http://lkml.kernel.org/r/20180718115017.742609-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Acked-by: Thomas Gleixner Cc: Al Viro Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2c1bb29aa6e7b0e52d84bd06bc199b0a5076a781 Author: Arnd Bergmann Date: Fri Aug 17 15:43:44 2018 -0700 firewire: use 64-bit time_t based interfaces 32-bit CLOCK_REALTIME timestamps overflow in year 2038, so all such interfaces are deprecated now. For the FW_CDEV_IOC_GET_CYCLE_TIMER2 ioctl, we already support 64-bit timestamps, but the implementation still uses timespec. This changes the code to use timespec64 instead with the appropriate accessor functions. Link: http://lkml.kernel.org/r/20180711124456.1023039-1-arnd@arndb.de Signed-off-by: Arnd Bergmann Cc: Stefan Richter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e1fb4a0864958fac2fb1b23f9f4562a9f90e3e8f Author: Dave Jiang Date: Fri Aug 17 15:43:40 2018 -0700 dax: remove VM_MIXEDMAP for fsdax and device dax This patch is reworked from an earlier patch that Dan has posted: https://patchwork.kernel.org/patch/10131727/ VM_MIXEDMAP is used by dax to direct mm paths like vm_normal_page() that the memory page it is dealing with is not typical memory from the linear map. The get_user_pages_fast() path, since it does not resolve the vma, is already using {pte,pmd}_devmap() as a stand-in for VM_MIXEDMAP, so we use that as a VM_MIXEDMAP replacement in some locations. In the cases where there is no pte to consult we fallback to using vma_is_dax() to detect the VM_MIXEDMAP special case. Now that we have explicit driver pfn_t-flag opt-in/opt-out for get_user_pages() support for DAX we can stop setting VM_MIXEDMAP. This also means we no longer need to worry about safely manipulating vm_flags in a future where we support dynamically changing the dax mode of a file. DAX should also now be supported with madvise_behavior(), vma_merge(), and copy_page_range(). This patch has been tested against ndctl unit test. It has also been tested against xfstests commit: 625515d using fake pmem created by memmap and no additional issues have been observed. Link: http://lkml.kernel.org/r/152847720311.55924.16999195879201817653.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Dave Jiang Acked-by: Dan Williams Cc: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e36488c83b6d871b35dd555afb2d434bd61687cf Author: Arnd Bergmann Date: Fri Aug 17 15:43:36 2018 -0700 bitfield: avoid gcc-8 -Wint-in-bool-context warning Passing an enum into FIELD_GET() produces a long but harmless warning on newer compilers: from include/linux/linkage.h:7, from include/linux/kernel.h:7, from include/linux/skbuff.h:17, from include/linux/if_ether.h:23, from include/linux/etherdevice.h:25, from drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c:63: drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c: In function 'iwl_mvm_rx_mpdu_mq': include/linux/bitfield.h:56:20: error: enum constant in boolean context [-Werror=int-in-bool-context] BUILD_BUG_ON_MSG(!(_mask), _pfx "mask is zero"); \ ^ ... include/linux/bitfield.h:103:3: note: in expansion of macro '__BF_FIELD_CHECK' __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \ ^~~~~~~~~~~~~~~~ drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c:1025:21: note: in expansion of macro 'FIELD_GET' le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIBG_SYM_OR_USER_NUM_MASK, The problem here is that the caller has no idea how the macro gets expanding, leading to a false-positive. It can be trivially avoided by doing a comparison against zero. This only recently started appearing as the iwlwifi driver was patched to use FIELD_GET. Link: http://lkml.kernel.org/r/20180813220950.194841-1-arnd@arndb.de Fixes: 514c30696fbc ("iwlwifi: add support for IEEE802.11ax") Signed-off-by: Arnd Bergmann Cc: Masahiro Yamada Cc: Johannes Berg Cc: Jakub Kicinski Cc: Andy Shevchenko Cc: Al Viro Cc: David Laight Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6ed191ca9045e595d02cdf206fd7d494a1573bdd Author: Dominique Martinet Date: Fri Aug 17 15:43:33 2018 -0700 9p: add Dominique Martinet to MAINTAINERS Link: http://lkml.kernel.org/r/1533869305-29325-1-git-send-email-asmadeus@codewreck.org Signed-off-by: Dominique Martinet Acked-by: Andrew Morton Cc: Eric Van Hensbergen Cc: Latchesar Ionkov Cc: Ron Minnich Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6b69cbd8b1fba2641bab1a68bb964fbab4277736 Author: Dominique Martinet Date: Fri Aug 17 15:43:29 2018 -0700 9p: remove Ron Minnich from MAINTAINERS Ron Minnich has left Sandia in 2011, and has not been involved in any 9p commit in recent years. Also add a CREDITS entry to record his contributions. Link: http://lkml.kernel.org/r/1534486244-1055-1-git-send-email-asmadeus@codewreck.org Signed-off-by: Dominique Martinet Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Ronald G. Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f6069b9aa9934ede26f41ac0781fce241279ad43 Author: Daniel Borkmann Date: Fri Aug 17 23:26:14 2018 +0200 bpf: fix redirect to map under tail calls Commits 109980b894e9 ("bpf: don't select potentially stale ri->map from buggy xdp progs") and 7c3001313396 ("bpf: fix ri->map_owner pointer on bpf_prog_realloc") tried to mitigate that buggy programs using bpf_redirect_map() helper call do not leave stale maps behind. Idea was to add a map_owner cookie into the per CPU struct redirect_info which was set to prog->aux by the prog making the helper call as a proof that the map is not stale since the prog is implicitly holding a reference to it. This owner cookie could later on get compared with the program calling into BPF whether they match and therefore the redirect could proceed with processing the map safely. In (obvious) hindsight, this approach breaks down when tail calls are involved since the original caller's prog->aux pointer does not have to match the one from one of the progs out of the tail call chain, and therefore the xdp buffer will be dropped instead of redirected. A way around that would be to fix the issue differently (which also allows to remove related work in fast path at the same time): once the life-time of a redirect map has come to its end we use it's map free callback where we need to wait on synchronize_rcu() for current outstanding xdp buffers and remove such a map pointer from the redirect info if found to be present. At that time no program is using this map anymore so we simply invalidate the map pointers to NULL iff they previously pointed to that instance while making sure that the redirect path only reads out the map once. Fixes: 97f91a7cf04f ("bpf: add bpf_redirect_map helper routine") Fixes: 109980b894e9 ("bpf: don't select potentially stale ri->map from buggy xdp progs") Reported-by: Sebastiano Miano Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov commit b4c296f9c96420b8e7e92466ea5960f10ee20aae Author: Jason Gunthorpe Date: Fri Aug 17 16:45:51 2018 -0600 RDMA/smc: Replace ib_query_gid with rdma_get_gid_attr All RDMA ULPs should be using rdma_get_gid_attr instead of ib_query_gid. Convert SMC to use the new API. In the process correct some confusion with gid_type - if attr->ndev is !NULL then gid_type can never be IB_GID_TYPE_IB by definition. IB_GID_TYPE_ROCE shares the same enum value and is probably what was intended here. Reviewed-by: Parav Pandit Signed-off-by: Jason Gunthorpe commit 9bd553929f68921be0f2014dd06561e0c8249a0d Merge: 022ff62c3d8c 0a3173a5f09b Author: Linus Torvalds Date: Fri Aug 17 12:44:48 2018 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "This has been a large cycle for RDMA, with several major patch series reworking parts of the core code. - Rework the so-called 'gid cache' and internal APIs to use a kref'd pointer to a struct instead of copying, push this upwards into the callers and add more stuff to the struct. The new design avoids some ugly races the old one suffered with. This is part of the namespace enablement work as the new struct is learning to be namespace aware. - Various uapi cleanups, moving more stuff to include/uapi and fixing some long standing bugs that have recently been discovered. - Driver updates for mlx5, mlx4 i40iw, rxe, cxgb4, hfi1, usnic, pvrdma, and hns - Provide max_send_sge and max_recv_sge attributes to better support HW where these values are asymmetric. - mlx5 user API 'devx' allows sending commands directly to the device FW, instead of trying to cram every wild and niche feature into the common API. Sort of like what GPU does. - Major write() and ioctl() API rework to cleanly support PCI device hot unplug and advance the ioctl conversion work - Sparse and compile warning cleanups - Add 'const' to the ib_poll_cq() signature, and permit a NULL 'bad_wr', which is the common use case - Various patches to avoid high order allocations across the stack - SRQ support for cxgb4, hns and qedr - Changes to IPoIB to better follow the netdev model for working with struct net_device liftime" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (312 commits) Revert "net/smc: Replace ib_query_gid with rdma_get_gid_attr" RDMA/hns: Fix usage of bitmap allocation functions return values IB/core: Change filter function return type from int to bool IB/core: Update GID entries for netdevice whose mac address changes IB/core: Add default GIDs of the bond master netdev IB/core: Consider adding default GIDs of bond device IB/core: Delete lower netdevice default GID entries in bonding scenario IB/core: Avoid confusing del_netdev_default_ips IB/core: Add comment for change upper netevent handling qedr: Add user space support for SRQ qedr: Add support for kernel mode SRQ's qedr: Add wrapping generic structure for qpidr and adjust idr routines. IB/mlx5: Fix leaking stack memory to userspace Update the e-mail address of Bart Van Assche IB/ucm: Fix compiling ucm.c IB/uverbs: Do not check for device disassociation during ioctl IB/uverbs: Remove struct uverbs_root_spec and all supporting code IB/uverbs: Use uverbs_api to unmarshal ioctl commands IB/uverbs: Use uverbs_alloc for allocations IB/uverbs: Add a simple allocator to uverbs_attr_bundle ... commit bfdd19ad80f203f42f05fd32a31c678c9c524ef9 Author: Heiner Kallweit Date: Fri Aug 17 20:42:16 2018 +0200 r8169: add missing Kconfig dependency Now that we switched the r8169 driver to use phylib, there's a dependency on the Realtek PHY drivers. This dependency was missing in Kconfig. Reported-by: Jouni Mettälä Fixes: f1e911d5d0df ("r8169: add basic phylib support") Signed-off-by: Heiner Kallweit Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit a85da34e97f553d27b520757ffc9b31232694a78 Author: Yonghong Song Date: Fri Aug 17 08:54:15 2018 -0700 tools/bpf: fix bpf selftest test_cgroup_storage failure The bpf selftest test_cgroup_storage failed in one of our production test servers. # sudo ./test_cgroup_storage Failed to create map: Operation not permitted It turns out this is due to insufficient locked memory with system default 16KB. Similar to other self tests, let us arm the process with unlimited locked memory. With this change, the test passed. # sudo ./test_cgroup_storage test_cgroup_storage:PASS Fixes: 68cfa3ac6b8d ("selftests/bpf: add a cgroup storage test") Cc: Roman Gushchin Signed-off-by: Yonghong Song Acked-by: Roman Gushchin Signed-off-by: Alexei Starovoitov commit 022ff62c3d8c3758d15ccc6b58615fd8f257ba85 Merge: f80a71b0c411 3d63a3c14741 Author: Linus Torvalds Date: Fri Aug 17 12:13:15 2018 -0700 Merge tag 'drm-next-2018-08-17-1' of git://anongit.freedesktop.org/drm/drm Pull drm msm support for adreno a6xx from Dave Airlie: "This is the support for new Qualcomm Snapdragon SoCs with the A6xx core. Userspace support is in mesa now" * tag 'drm-next-2018-08-17-1' of git://anongit.freedesktop.org/drm/drm: drm/msm: a6xx: fix spelling mistake: "initalization" -> "initialization" drm/msm: Add A6XX device support drm/msm: update generated headers drm/msm/adreno: Load the firmware before bringing up the hardware drm/msm: Add a helper function to parse clock names commit f80a71b0c4111e26433744721ad68f05c169ad39 Merge: edb0a2000936 0258d7a5e261 Author: Linus Torvalds Date: Fri Aug 17 12:10:22 2018 -0700 Merge tag 'drm-next-2018-08-17' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "First round of fixes for -rc1. I'll follow this up with the msm new hw support pull request. This just has three sets of fixes, some for msm before the new hw, a bunch of AMD fixes (includiing some required firmware changes for new hw), and a set of i915 (+gvt) fixes" * tag 'drm-next-2018-08-17' of git://anongit.freedesktop.org/drm/drm: (30 commits) drm/amdgpu: Use kvmalloc for allocating UVD/VCE/VCN BO backup memory drm/i915: set DP Main Stream Attribute for color range on DDI platforms drm/i915/selftests: Hold rpm for unparking drm/i915: Restore user forcewake domains across suspend drm/i915: Unmask user interrupts writes into HWSP on snb/ivb/vlv/hsw drm/i915/gvt: fix memory leak in intel_vgpu_ioctl() drm/i915/gvt: Off by one in intel_vgpu_write_fence() drm/i915/kvmgt: Fix potential Spectre v1 drm/i915/gvt: return error on cmd access drm/i915/gvt: initialize dmabuf mutex in vgpu_create drm/i915/gvt: fix cleanup sequence in intel_gvt_clean_device drm/amd/display: Guard against null crtc in CRC IRQ drm/amd/display: Pass connector id when executing VBIOS CT drm/amd/display: Check if clock source in use before disabling drm/amd/display: Allow clock sharing b/w HDMI and DVI drm/amd/display: Fix warning observed in mode change on Vega drm/amd/display: fix single link DVI has no display drm/amdgpu/vce: VCE entity initialization relies on ring initializtion drm/amdgpu/uvd: UVD entity initialization relys on ring initialization drm/amdgpu:add VCN booting with firmware loaded by PSP ... commit edb0a20009363ae787bfe0d6fd52abb504f05113 Merge: 5e2d059b52e3 5ad356eabc47 Author: Linus Torvalds Date: Fri Aug 17 11:48:04 2018 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "A couple of arm64 fixes - Fix boot on Hikey-960 by avoiding an IPI with interrupts disabled - Fix address truncation in pfn_valid() implementation" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid() arm64: Avoid calling stop_machine() when patching jump labels commit fcedba42d94ecdc14ca13d3797cba1ccbf743fa4 Author: Chaitanya Kulkarni Date: Thu Aug 16 15:45:29 2018 -0700 block: remove duplicate initialization This patch removes the duplicate initialization of q->queue_head in the blk_alloc_queue_node(). This removes the 2nd initialization so that we preserve the initialization order same as declaration present in struct request_queue. Reviewed-by: Omar Sandoval Signed-off-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe commit 5e2d059b52e397d9ac42f4c4d9d9a841887b5818 Merge: d190775206d0 a2dc009afa9a Author: Linus Torvalds Date: Fri Aug 17 11:32:50 2018 -0700 Merge tag 'powerpc-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: "Notable changes: - A fix for a bug in our page table fragment allocator, where a page table page could be freed and reallocated for something else while still in use, leading to memory corruption etc. The fix reuses pt_mm in struct page (x86 only) for a powerpc only refcount. - Fixes to our pkey support. Several are user-visible changes, but bring us in to line with x86 behaviour and/or fix outright bugs. Thanks to Florian Weimer for reporting many of these. - A series to improve the hvc driver & related OPAL console code, which have been seen to cause hardlockups at times. The hvc driver changes in particular have been in linux-next for ~month. - Increase our MAX_PHYSMEM_BITS to 128TB when SPARSEMEM_VMEMMAP=y. - Remove Power8 DD1 and Power9 DD1 support, neither chip should be in use anywhere other than as a paper weight. - An optimised memcmp implementation using Power7-or-later VMX instructions - Support for barrier_nospec on some NXP CPUs. - Support for flushing the count cache on context switch on some IBM CPUs (controlled by firmware), as a Spectre v2 mitigation. - A series to enhance the information we print on unhandled signals to bring it into line with other arches, including showing the offending VMA and dumping the instructions around the fault. Thanks to: Aaro Koskinen, Akshay Adiga, Alastair D'Silva, Alexey Kardashevskiy, Alexey Spirkov, Alistair Popple, Andrew Donnellan, Aneesh Kumar K.V, Anju T Sudhakar, Arnd Bergmann, Bartosz Golaszewski, Benjamin Herrenschmidt, Bharat Bhushan, Bjoern Noetel, Boqun Feng, Breno Leitao, Bryant G. Ly, Camelia Groza, Christophe Leroy, Christoph Hellwig, Cyril Bur, Dan Carpenter, Daniel Klamt, Darren Stevens, Dave Young, David Gibson, Diana Craciun, Finn Thain, Florian Weimer, Frederic Barrat, Gautham R. Shenoy, Geert Uytterhoeven, Geoff Levand, Guenter Roeck, Gustavo Romero, Haren Myneni, Hari Bathini, Joel Stanley, Jonathan Neuschäfer, Kees Cook, Madhavan Srinivasan, Mahesh Salgaonkar, Markus Elfring, Mathieu Malaterre, Mauro S. M. Rodrigues, Michael Hanselmann, Michael Neuling, Michael Schmitz, Mukesh Ojha, Murilo Opsfelder Araujo, Nicholas Piggin, Parth Y Shah, Paul Mackerras, Paul Menzel, Ram Pai, Randy Dunlap, Rashmica Gupta, Reza Arbab, Rodrigo R. Galvao, Russell Currey, Sam Bobroff, Scott Wood, Shilpasri G Bhat, Simon Guo, Souptick Joarder, Stan Johnson, Thiago Jung Bauermann, Tyrel Datwyler, Vaibhav Jain, Vasant Hegde, Venkat Rao, zhong jiang" * tag 'powerpc-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (234 commits) powerpc/mm/book3s/radix: Add mapping statistics powerpc/uaccess: Enable get_user(u64, *p) on 32-bit powerpc/mm/hash: Remove unnecessary do { } while(0) loop powerpc/64s: move machine check SLB flushing to mm/slb.c powerpc/powernv/idle: Fix build error powerpc/mm/tlbflush: update the mmu_gather page size while iterating address range powerpc/mm: remove warning about ‘type’ being set powerpc/32: Include setup.h header file to fix warnings powerpc: Move `path` variable inside DEBUG_PROM powerpc/powermac: Make some functions static powerpc/powermac: Remove variable x that's never read cxl: remove a dead branch powerpc/powermac: Add missing include of header pmac.h powerpc/kexec: Use common error handling code in setup_new_fdt() powerpc/xmon: Add address lookup for percpu symbols powerpc/mm: remove huge_pte_offset_and_shift() prototype powerpc/lib: Use patch_site to patch copy_32 functions once cache is enabled powerpc/pseries: Fix endianness while restoring of r3 in MCE handler. powerpc/fadump: merge adjacent memory ranges to reduce PT_LOAD segements powerpc/fadump: handle crash memory ranges array index overflow ... commit d190775206d06397a9309421cac5ba2f2c243521 Merge: 84f5685230c6 9be936f4b3a2 Author: Linus Torvalds Date: Fri Aug 17 10:51:22 2018 -0700 Merge tag 'modules-for-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux Pull modules updates from Jessica Yu: "Summary of modules changes for the 4.19 merge window: - Fix modules kallsyms for livepatch. Livepatch modules can have SHN_UNDEF symbols in their module symbol tables for later symbol resolution, but kallsyms shouldn't be returning these symbols - Some code cleanups and minor reshuffling in load_module() were done to log the module name when module signature verification fails" * tag 'modules-for-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux: kernel/module: Use kmemdup to replace kmalloc+memcpy ARM: module: fix modsign build error modsign: log module name in the event of an error module: replace VMLINUX_SYMBOL_STR() with __stringify() or string literal module: print sensible error code module: setup load info before module_sig_check() module: make it clear when we're handling the module copy in info->hdr module: exclude SHN_UNDEF symbols from kallsyms api commit 84f5685230c6aeb427947a2299dcb54c77863df0 Merge: f19f5c49bbc3 d8dfa59f5a51 Author: Linus Torvalds Date: Fri Aug 17 10:40:09 2018 -0700 Merge tag 'vla-leftovers-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull VLA removal leftovers from Kees Cook: - bus/imx-weim: Use maximum register count to avoid VLA - drm/i2c/tda9950: Use maximum CEC message size to avoid VLA * tag 'vla-leftovers-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: bus: imx-weim: Remove VLA usage drm/i2c: tda9950: Remove VLA usage commit f19f5c49bbc3ffcc9126cc245fc1b24cc29f4a37 Author: Sean Christopherson Date: Fri Aug 17 10:27:36 2018 -0700 x86/speculation/l1tf: Exempt zeroed PTEs from inversion It turns out that we should *not* invert all not-present mappings, because the all zeroes case is obviously special. clear_page() does not undergo the XOR logic to invert the address bits, i.e. PTE, PMD and PUD entries that have not been individually written will have val=0 and so will trigger __pte_needs_invert(). As a result, {pte,pmd,pud}_pfn() will return the wrong PFN value, i.e. all ones (adjusted by the max PFN mask) instead of zero. A zeroed entry is ok because the page at physical address 0 is reserved early in boot specifically to mitigate L1TF, so explicitly exempt them from the inversion when reading the PFN. Manifested as an unexpected mprotect(..., PROT_NONE) failure when called on a VMA that has VM_PFNMAP and was mmap'd to as something other than PROT_NONE but never used. mprotect() sends the PROT_NONE request down prot_none_walk(), which walks the PTEs to check the PFNs. prot_none_pte_entry() gets the bogus PFN from pte_pfn() and returns -EACCES because it thinks mprotect() is trying to adjust a high MMIO address. [ This is a very modified version of Sean's original patch, but all credit goes to Sean for doing this and also pointing out that sometimes the __pte_needs_invert() function only gets the protection bits, not the full eventual pte. But zero remains special even in just protection bits, so that's ok. - Linus ] Fixes: f22cc87f6c1f ("x86/speculation/l1tf: Invert all not present mappings") Signed-off-by: Sean Christopherson Acked-by: Andi Kleen Cc: Thomas Gleixner Cc: Josh Poimboeuf Cc: Michal Hocko Cc: Vlastimil Babka Cc: Dave Hansen Cc: Greg Kroah-Hartman Signed-off-by: Linus Torvalds commit b0e5c29426940bd6f137b6a3222fe87766323ae5 Merge: 2645b9d1a49c 1e1132ea21da Author: Linus Torvalds Date: Fri Aug 17 09:52:15 2018 -0700 Merge tag 'for-4.19/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - A couple stable fixes for the DM writecache target. - A stable fix for the DM cache target that fixes the potential for data corruption after an unclean shutdown of a cache device using writeback mode. - Update DM integrity target to allow the metadata to be stored on a separate device from data. - Fix DM kcopyd and the snapshot target to cond_resched() where appropriate and be more efficient with processing completed work. - A few fixes and improvements for DM crypt. - Add DM delay target feature to configure delay of flushes independent of writes. - Update DM thin-provisioning target to include metadata_low_watermark threshold in pool status. - Fix stale DM thin-provisioning Documentation. * tag 'for-4.19/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (26 commits) dm writecache: fix a crash due to reading past end of dirty_bitmap dm crypt: don't decrease device limits dm cache metadata: set dirty on all cache blocks after a crash dm snapshot: remove stale FIXME in snapshot_map() dm snapshot: improve performance by switching out_of_order_list to rbtree dm kcopyd: avoid softlockup in run_complete_job dm cache metadata: save in-core policy_hint_size to on-disk superblock dm thin: stop no_space_timeout worker when switching to write-mode dm kcopyd: return void from dm_kcopyd_copy() dm thin: include metadata_low_watermark threshold in pool status dm writecache: report start_sector in status line dm crypt: convert essiv from ahash to shash dm crypt: use wake_up_process() instead of a wait queue dm integrity: recalculate checksums on creation dm integrity: flush journal on suspend when using separate metadata device dm integrity: use version 2 for separate metadata dm integrity: allow separate metadata device dm integrity: add ic->start in get_data_sector() dm integrity: report provided data sectors in the status dm integrity: implement fair range locks ... commit 2645b9d1a49c2c2cf23895657bdf9a56e07a4da8 Merge: 46e62a072a82 4d97f7d53da7 Author: Linus Torvalds Date: Fri Aug 17 09:41:28 2018 -0700 Merge tag 'fsnotify_for_v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: "fsnotify cleanups from Amir and a small inotify improvement" * tag 'fsnotify_for_v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: inotify: Add flag IN_MASK_CREATE for inotify_add_watch() fanotify: factor out helpers to add/remove mark fsnotify: add helper to get mask from connector fsnotify: let connector point to an abstract object fsnotify: pass connp and object type to fsnotify_add_mark() fsnotify: use typedef fsnotify_connp_t for brevity commit 46e62a072a8254e9e3765fdc999aba325b7918df Merge: 5c60a7389d79 fe2c32545bfc Author: Linus Torvalds Date: Fri Aug 17 09:38:39 2018 -0700 Merge tag 'for_v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull UDF and ext2 update from Jan Kara. * tag 'for_v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2: use ktime_get_real_seconds for timestamps udf: convert inode stamps to timespec64 commit 8ecebf4d767e2307a946c8905278d6358eda35c3 Author: Robbie Ko Date: Mon Aug 6 10:30:30 2018 +0800 Btrfs: fix unexpected failure of nocow buffered writes after snapshotting when low on space Commit e9894fd3e3b3 ("Btrfs: fix snapshot vs nocow writting") forced nocow writes to fallback to COW, during writeback, when a snapshot is created. This resulted in writes made before creating the snapshot to unexpectedly fail with ENOSPC during writeback when success (0) was returned to user space through the write system call. The steps leading to this problem are: 1. When it's not possible to allocate data space for a write, the buffered write path checks if a NOCOW write is possible. If it is, it will not reserve space and success (0) is returned to user space. 2. Then when a snapshot is created, the root's will_be_snapshotted atomic is incremented and writeback is triggered for all inode's that belong to the root being snapshotted. Incrementing that atomic forces all previous writes to fallback to COW during writeback (running delalloc). 3. This results in the writeback for the inodes to fail and therefore setting the ENOSPC error in their mappings, so that a subsequent fsync on them will report the error to user space. So it's not a completely silent data loss (since fsync will report ENOSPC) but it's a very unexpected and undesirable behaviour, because if a clean shutdown/unmount of the filesystem happens without previous calls to fsync, it is expected to have the data present in the files after mounting the filesystem again. So fix this by adding a new atomic named snapshot_force_cow to the root structure which prevents this behaviour and works the following way: 1. It is incremented when we start to create a snapshot after triggering writeback and before waiting for writeback to finish. 2. This new atomic is now what is used by writeback (running delalloc) to decide whether we need to fallback to COW or not. Because we incremented this new atomic after triggering writeback in the snapshot creation ioctl, we ensure that all buffered writes that happened before snapshot creation will succeed and not fallback to COW (which would make them fail with ENOSPC). 3. The existing atomic, will_be_snapshotted, is kept because it is used to force new buffered writes, that start after we started snapshotting, to reserve data space even when NOCOW is possible. This makes these writes fail early with ENOSPC when there's no available space to allocate, preventing the unexpected behaviour of writeback later failing with ENOSPC due to a fallback to COW mode. Fixes: e9894fd3e3b3 ("Btrfs: fix snapshot vs nocow writting") Signed-off-by: Robbie Ko Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit 9e0d5c451f9e559dd06af3fff49a0d2068c634c4 Author: Helge Deller Date: Fri Aug 17 17:00:08 2018 +0200 parisc: Consolidate unwind initialization calls Signed-off-by: Helge Deller commit 54c770da992387abfa7df4817404d000ef034fa8 Author: Helge Deller Date: Thu Aug 16 22:36:26 2018 +0200 parisc: Update comments in syscall.S regarding wide userland We do support running 64-bit userspace processes, although there isn't yet full gcc and glibc support. Anyway, fix the comments to reflect the reality. Signed-off-by: Helge Deller commit b6fc0cccb6b35815a7d1cfc9279cdbfc2c61d00d Author: Helge Deller Date: Thu Aug 16 22:33:04 2018 +0200 parisc: Fix ptraced 64-bit applications to call 64-bit syscalls Fix the strace code path to call 64-bit syscalls in case we are executing by a 64-bit application. Signed-off-by: Helge Deller commit 5b00ca0b8035e49ef7c466e959c5cb457a654351 Author: Helge Deller Date: Thu Aug 16 22:39:50 2018 +0200 parisc: Restore possibility to execute 64-bit applications Executing 64-bit applications was broken. This patch restores this support and cleans up some code paths. Signed-off-by: Helge Deller commit 0ef8e3bb974af56346b34393e643d491d9141c66 Author: Tony Lindgren Date: Wed Aug 8 01:07:05 2018 -0700 bus: ti-sysc: Fix module register ioremap for larger offsets We can have the interconnect target module control registers pretty much anywhere within the module range. The current code attempts an incomplete optimization of the ioremap size but does it wrong and it only works for registers at the beginning of the module. Let's just use the largest control register to calculate the ioremap size. The ioremapped range is for most part cached anyways so there is no need for size optimization. Let's also update the comments accordingly. Fixes: 0eecc636e5a2 ("bus: ti-sysc: Add minimal TI sysc interconnect target driver") Signed-off-by: Tony Lindgren commit 1dbcb97c656eed1a244c960b8b3a469c3d20ce7b Author: Tony Lindgren Date: Wed Aug 8 01:07:04 2018 -0700 ARM: OMAP2+: Fix module address for modules using mpu_rt_idx If we use device tree data for a module interconnect target we want to map the control registers from the module start. Legacy hwmod platform data however is using child IP offsets for cpsw module with mpu_rt_idx. In cases where we have the interconnect target module already using device tree data with legacy hwmod platform data still around, the sysc register area is not adjusted for mpu_rt_idx causing wrong registers being accessed. Let's fix the issue for mixed dts and platform data mode by ioremapping the module registers using child IP offset if mpu_rt_idx is set. For device tree only data there's no reason to use mpu_rt_idx. Fixes: 6c72b3550672 ("ARM: OMAP2+: Parse module IO range from dts for legacy "ti,hwmods" support") Signed-off-by: Tony Lindgren commit 4769c003e0fcff0ee001a9102e2605bdaa5880f0 Author: Tony Lindgren Date: Wed Aug 8 01:07:03 2018 -0700 ARM: OMAP2+: Fix null hwmod for ti-sysc debug We may call omap_hwmod_parse_module_range() with no hwmod allocated yet and may have debug enabled. Let's fix this by checking for hwmod before trying to use it's name. Fixes: 6c72b3550672 ("ARM: OMAP2+: Parse module IO range from dts for legacy Signed-off-by: Tony Lindgren commit b748f2de4b2f578599f46c6000683a8da755bf68 Author: Takashi Iwai Date: Fri Aug 10 16:14:26 2018 +0200 EDAC: Add missing MEM_LRDDR4 entry in edac_mem_types[] The edac_mem_types[] array misses a MEM_LRDDR4 entry, which leads to NULL pointer dereference when accessed via sysfs or such. Signed-off-by: Takashi Iwai Cc: Mauro Carvalho Chehab Cc: Yazen Ghannam Cc: linux-edac Cc: Link: http://lkml.kernel.org/r/20180810141426.8918-1-tiwai@suse.de Fixes: 1e8096bb2031 ("EDAC: Add LRDDR4 DRAM type") Signed-off-by: Borislav Petkov commit 3257d86182cc27eda83d6854787256641f7c574b Merge: baab8537a12b e49756544a21 Author: Vinod Koul Date: Fri Aug 17 18:00:29 2018 +0530 Merge branch 'topic/pl330' into for-linus commit baab8537a12b108d7a37c0618f3438117aecb09b Merge: 4d4424823951 0f06c0275588 Author: Vinod Koul Date: Fri Aug 17 17:59:27 2018 +0530 Merge branch 'topic/imx' into for-linus commit 4d44248239510de89d48f22a4f52bd6f2883ad2f Merge: de764fdc9b42 0894aa28aece Author: Vinod Koul Date: Fri Aug 17 17:59:01 2018 +0530 Merge branch 'topic/xilinx' into for-linus commit de764fdc9b42756dfde5db23e917587d6f7ebd9f Merge: 89b7e78fb22a 90ec93cb6bca Author: Vinod Koul Date: Fri Aug 17 17:58:50 2018 +0530 Merge branch 'topic/ste' into for-linus commit 89b7e78fb22a59fe96f07b87afaec1d5b60f8484 Merge: 35e0db66a88d 218c21043d00 Author: Vinod Koul Date: Fri Aug 17 17:58:44 2018 +0530 Merge branch 'topic/renesas' into for-linus commit 35e0db66a88de30a2d069248f6357cb9f125892f Merge: e48696fb2076 47e20577c24d Author: Vinod Koul Date: Fri Aug 17 17:58:40 2018 +0530 Merge branch 'topic/owl' into for-linus commit e48696fb207645ca381aa77a15d00fbf2aaf4086 Merge: 531dabc7a629 38fce264b12b Author: Vinod Koul Date: Fri Aug 17 17:58:31 2018 +0530 Merge branch 'topic/nbpfaxi' into for-linus commit 531dabc7a62919035f84ec994b21adbcffa7f519 Merge: 2cc50b9f92dc 4bcde3a53edd Author: Vinod Koul Date: Fri Aug 17 17:58:24 2018 +0530 Merge branch 'topic/mv_xor' into for-linus commit 2cc50b9f92dc55a0f8c379a48893d8afde33628b Merge: d3df935e35f5 4cb0e6011216 Author: Vinod Koul Date: Fri Aug 17 17:58:07 2018 +0530 Merge branch 'topic/ioat' into for-linus commit d3df935e35f5be0cf2647e281bda60214c92dc79 Merge: d0c993f6acaf bbacb8e78a3b Author: Vinod Koul Date: Fri Aug 17 17:57:59 2018 +0530 Merge branch 'topic/intel' into for-linus commit d0c993f6acafb8e30000192c837aa7337de68d3b Merge: f6206f00d8c5 89a7e2f75285 Author: Vinod Koul Date: Fri Aug 17 17:57:48 2018 +0530 Merge branch 'topic/async_tx' into for-linus commit 340fd4cff43f18bace9358d4decdc9b6ed0715be Author: Randy Dunlap Date: Wed Aug 15 09:12:07 2018 -0700 platform/x86: intel_punit_ipc: fix build errors Fix build errors by #including . ../drivers/platform/x86/intel_punit_ipc.c: In function 'ipc_read_status': ../drivers/platform/x86/intel_punit_ipc.c:55:2: error: implicit declaration of function 'readl' [-Werror=implicit-function-declaration] return readl(ipcdev->base[type][BASE_IFACE]); ../drivers/platform/x86/intel_punit_ipc.c: In function 'ipc_write_cmd': ../drivers/platform/x86/intel_punit_ipc.c:60:2: error: implicit declaration of function 'writel' [-Werror=implicit-function-declaration] writel(cmd, ipcdev->base[type][BASE_IFACE]); Fixes: 447ae3166702 ("x86: Don't include linux/irq.h from asm/hardirq.h") Signed-off-by: Randy Dunlap Cc: Zha Qipeng Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Andy Shevchenko commit 5ad356eabc47d26a92140a0c4b20eba471c10de3 Author: Greg Hackmann Date: Wed Aug 15 12:51:21 2018 -0700 arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid() ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input before seeing if the PFN is valid. This leads to false positives when some of the upper bits are set, but the lower bits match a valid PFN. For example, the following userspace code looks up a bogus entry in /proc/kpageflags: int pagemap = open("/proc/self/pagemap", O_RDONLY); int pageflags = open("/proc/kpageflags", O_RDONLY); uint64_t pfn, val; lseek64(pagemap, [...], SEEK_SET); read(pagemap, &pfn, sizeof(pfn)); if (pfn & (1UL << 63)) { /* valid PFN */ pfn &= ((1UL << 55) - 1); /* clear flag bits */ pfn |= (1UL << 55); lseek64(pageflags, pfn * sizeof(uint64_t), SEEK_SET); read(pageflags, &val, sizeof(val)); } On ARM64 this causes the userspace process to crash with SIGSEGV rather than reading (1 << KPF_NOPAGE). kpageflags_read() treats the offset as valid, and stable_page_flags() will try to access an address between the user and kernel address ranges. Fixes: c1cc1552616d ("arm64: MMU initialisation") Cc: stable@vger.kernel.org Signed-off-by: Greg Hackmann Signed-off-by: Will Deacon commit f6cc0c50164994afd538911603b4a8f8029aeba7 Author: Will Deacon Date: Thu Aug 16 11:45:50 2018 +0100 arm64: Avoid calling stop_machine() when patching jump labels Patching a jump label involves patching a single instruction at a time, swizzling between a branch and a NOP. The architecture treats these instructions specially, so a concurrently executing CPU is guaranteed to see either the NOP or the branch, rather than an amalgamation of the two instruction encodings. However, in order to guarantee that the new instruction is visible, it is necessary to send an IPI to the concurrently executing CPU so that it discards any previously fetched instructions from its pipeline. This operation therefore cannot be completed from a context with IRQs disabled, but this is exactly what happens on the jump label path where the hotplug lock is held and irqs are subsequently disabled by stop_machine_cpuslocked(). This results in a deadlock during boot on Hikey-960. Due to the architectural guarantees around patching NOPs and branches, we don't actually need to stop_machine() at all on the jump label path, so we can avoid the deadlock by using the "nosync" variant of our instruction patching routine. Fixes: 693350a79980 ("arm64: insn: Don't fallback on nosync path for general insn patching") Reported-by: Tuomas Tynkkynen Reported-by: John Stultz Tested-by: Valentin Schneider Tested-by: Tuomas Tynkkynen Tested-by: John Stultz Signed-off-by: Will Deacon commit 9d64b539b738fc181442caab95f1f76d9bd58539 Author: Rafael J. Wysocki Date: Thu Aug 16 12:56:46 2018 +0200 PCI / ACPI / PM: Resume all bridges on suspend-to-RAM Commit 26112ddc254c (PCI / ACPI / PM: Resume bridges w/o drivers on suspend-to-RAM) attempted to fix a functional regression resulting from commit c62ec4610c40 (PM / core: Fix direct_complete handling for devices with no callbacks) by resuming PCI bridges without drivers (that is, "parallel PCI" ones) during system-wide suspend if the target system state is not ACPI S0 (working state). That turns out insufficient, however, as it is reported that, at least in one case, the platform firmware gets confused if a PCIe root port is suspended before entering the ACPI S3 sleep state. That issue was exposed by commit 77b3729ca03 (PCI / PM: Use SMART_SUSPEND and LEAVE_SUSPENDED flags for PCIe ports) that allowed PCIe ports to stay in runtime suspend during system-wide suspend (which is OK for suspend-to-idle, but turns out to be problematic otherwise). For this reason, drop the driver check from acpi_pci_need_resume() and resume all bridges (including PCIe ports with drivers) during system-wide suspend if the target system state is not ACPI S0. [If the target system state is ACPI S0, it means suspend-to-idle and the platform firmware is not going to be invoked to actually suspend the system, so there is no need to resume the bridges in that case.] Fixes: 77b3729ca03 (PCI / PM: Use SMART_SUSPEND and LEAVE_SUSPENDED flags for PCIe ports) Link: https://bugzilla.kernel.org/show_bug.cgi?id=200675 Reported-by: teika kazura Tested-by: teika kazura Reviewed-by: Mika Westerberg Acked-by: Bjorn Helgaas Cc: 4.16+ # 4.16+: 26112ddc254c (PCI / ACPI / PM: Resume bridges ...) Signed-off-by: Rafael J. Wysocki commit 3d63a3c14741ed015948943076f3c6a2f2cd7b27 Merge: 0258d7a5e261 546907de9952 Author: Dave Airlie Date: Fri Aug 17 10:46:45 2018 +1000 Merge tag 'drm-msm-next-2018-08-10' of git://people.freedesktop.org/~robclark/linux into drm-next An optional follow-on PR for 4.19, on top of previous -fixes PR, which brings in a6xx support. These patches have been on list since earlier in the year (mostly waiting for userspace). They have been in linux-next since earlier in the week, now that we have freedreno userspace working on a6xx[1][2]. So far glmark2, Chromium/ChromiumOS, gnome-shell, glamor, xonotic, etc, are working. And a healthy chuck of deqp works, and I've been busy fixing things. The needed libdrm changes (no new uapi changes needed) are already on master, and the 2nd branch is rebased on that. Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGuCKekZ2Dho80qxODT1BEUGg4hbq33ACUy5VXs3dHbDLA@mail.gmail.com commit b2201ee554a5811f569f31280b0079e7d6177606 Author: Bartosz Golaszewski Date: Thu Jun 21 09:37:03 2018 +0200 remoteproc/davinci: use the reset framework Switch to using the reset framework instead of handcoded reset routines we used so far. Reviewed-by: Sekhar Nori Reviewed-by: Philipp Zabel Signed-off-by: Bartosz Golaszewski Signed-off-by: Bjorn Andersson commit 0258d7a5e261b3ce0d730f6f8f66f833058ce2b6 Merge: 637319c67849 4795ac626a2f Author: Dave Airlie Date: Fri Aug 17 09:26:51 2018 +1000 Merge tag 'drm-intel-next-fixes-2018-08-16-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Fixes for: - DP full color range. - selftest for gem_object - forcewake on suspend - GPU reset This also include accumulated fixes from GVT: - Fix an error code in gvt_dma_map_page() (Dan) - Fix off by one error in intel_vgpu_write_fence() (Dan) - Fix potential Spectre v1 (Gustavo) - Fix workload free in vgpu release (Henry) - Fix cleanup sequence in intel_gvt_clean_device (Henry) - dmabuf mutex init place fix (Henry) - possible memory leak in intel_vgpu_ioctl() err path (Yi) - return error on cmd access check failure (Yan) Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180816190335.GA7765@intel.com commit 637319c67849baceea6ba466e62b70f9e674d85b Merge: d32e2c6de78f c9533d1bca33 Author: Dave Airlie Date: Fri Aug 17 09:26:07 2018 +1000 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next Fixes for 4.19: - Add VCN PSP FW loading for RV (this is required on upcoming parts) - Fix scheduler setup ordering for VCE and UVD - Few misc display fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180816181840.2786-1-alexander.deucher@amd.com commit d32e2c6de78f7be0b6ddc0f5267d17fe0cb1bbc1 Merge: 557ce95051c8 77a209cd7153 Author: Dave Airlie Date: Fri Aug 17 09:24:46 2018 +1000 Merge tag 'drm-msm-fixes-2018-08-10' of git://people.freedesktop.org/~robclark/linux into drm-next Some small msm fixes. Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGuZE0VEpatrtxGZtUB6FaQYr6Gf07UVpMsD15ook+5_WQ@mail.gmail.com commit bb730b5833b5bddf5cb226865e5f4496770d00b0 Author: Steven Rostedt (VMware) Date: Thu Aug 16 11:26:55 2018 -0400 tracing: Fix SPDX format headers to use C++ style comments The Linux kernel adopted the SPDX License format headers to ease license compliance management, and uses the C++ '//' style comments for the SPDX header tags. Some files in the tracing directory used the C style /* */ comments for them. To be consistent across all files, replace the /* */ C style SPDX tags with the C++ // SPDX tags. Signed-off-by: Steven Rostedt (VMware) commit bcea3f96e11cf2f0232d851e0fdb854f5ada425a Author: Steven Rostedt (VMware) Date: Thu Aug 16 11:23:53 2018 -0400 tracing: Add SPDX License format tags to tracing files Add the SPDX License header to ease license compliance management. Signed-off-by: Steven Rostedt (VMware) commit 179a0cc4e0e14216b3c46b5538436532cb9ed39a Author: Steven Rostedt (VMware) Date: Thu Aug 16 11:20:54 2018 -0400 tracing: Add SPDX License format to bpf_trace.c Add the SPDX License header to ease license compliance management. Acked-by: Alexei Starovoitov Acked-by: Daniel Borkmann Signed-off-by: Steven Rostedt (VMware) commit cbb2fb13db3209cf4264aa5f76393a12add91315 Merge: 965931e3a803 585f5a6252ee Author: Alexei Starovoitov Date: Thu Aug 16 14:58:08 2018 -0700 Merge branch 'sockmap-ulp-fixes' Daniel Borkmann says: ==================== Batch of various fixes related to BPF sockmap and ULP, including adding module alias to restrict module requests, races and memory leaks in sockmap code. For details please refer to the individual patches. Thanks! ==================== Signed-off-by: Alexei Starovoitov commit 585f5a6252ee43ec8feeee07387e3fcc7e8bb292 Author: Daniel Borkmann Date: Thu Aug 16 21:49:10 2018 +0200 bpf, sockmap: fix sock_map_ctx_update_elem race with exist/noexist The current code in sock_map_ctx_update_elem() allows for BPF_EXIST and BPF_NOEXIST map update flags. While on array-like maps this approach is rather uncommon, e.g. bpf_fd_array_map_update_elem() and others enforce map update flags to be BPF_ANY such that xchg() can be used directly, the current implementation in sock map does not guarantee that such operation with BPF_EXIST / BPF_NOEXIST is atomic. The initial test does a READ_ONCE(stab->sock_map[i]) to fetch the socket from the slot which is then tested for NULL / non-NULL. However later after __sock_map_ctx_update_elem(), the actual update is done through osock = xchg(&stab->sock_map[i], sock). Problem is that in the meantime a different CPU could have updated / deleted a socket on that specific slot and thus flag contraints won't hold anymore. I've been thinking whether best would be to just break UAPI and do an enforcement of BPF_ANY to check if someone actually complains, however trouble is that already in BPF kselftest we use BPF_NOEXIST for the map update, and therefore it might have been copied into applications already. The fix to keep the current behavior intact would be to add a map lock similar to the sock hash bucket lock only for covering the whole map. Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Song Liu Signed-off-by: Alexei Starovoitov commit 166ab6f0a0702fdd4d865ad5090bf3094ed83428 Author: Daniel Borkmann Date: Thu Aug 16 21:49:09 2018 +0200 bpf, sockmap: fix map elem deletion race with smap_stop_sock The smap_start_sock() and smap_stop_sock() are each protected under the sock->sk_callback_lock from their call-sites except in the case of sock_map_delete_elem() where we drop the old socket from the map slot. This is racy because the same sock could be part of multiple sock maps, so we run smap_stop_sock() in parallel, and given at that point psock->strp_enabled might be true on both CPUs, we might for example wrongly restore the sk->sk_data_ready / sk->sk_write_space. Therefore, hold the sock->sk_callback_lock as well on delete. Looks like 2f857d04601a ("bpf: sockmap, remove STRPARSER map_flags and add multi-map support") had this right, but later on e9db4ef6bf4c ("bpf: sockhash fix omitted bucket lock in sock_close") removed it again from delete leaving this smap_stop_sock() instance unprotected. Fixes: e9db4ef6bf4c ("bpf: sockhash fix omitted bucket lock in sock_close") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Song Liu Signed-off-by: Alexei Starovoitov commit d40b0116c94bd8fc2b63aae35ce8e66bb53bba42 Author: Daniel Borkmann Date: Thu Aug 16 21:49:08 2018 +0200 bpf, sockmap: fix leakage of smap_psock_map_entry While working on sockmap I noticed that we do not always kfree the struct smap_psock_map_entry list elements which track psocks attached to maps. In the case of sock_hash_ctx_update_elem(), these map entries are allocated outside of __sock_map_ctx_update_elem() with their linkage to the socket hash table filled. In the case of sock array, the map entries are allocated inside of __sock_map_ctx_update_elem() and added with their linkage to the psock->maps. Both additions are under psock->maps_lock each. Now, we drop these elements from their psock->maps list in a few occasions: i) in sock array via smap_list_map_remove() when an entry is either deleted from the map from user space, or updated via user space or BPF program where we drop the old socket at that map slot, or the sock array is freed via sock_map_free() and drops all its elements; ii) for sock hash via smap_list_hash_remove() in exactly the same occasions as just described for sock array; iii) in the bpf_tcp_close() where we remove the elements from the list via psock_map_pop() and iterate over them dropping themselves from either sock array or sock hash; and last but not least iv) once again in smap_gc_work() which is a callback for deferring the work once the psock refcount hit zero and thus the socket is being destroyed. Problem is that the only case where we kfree() the list entry is in case iv), which at that point should have an empty list in normal cases. So in cases from i) to iii) we unlink the elements without freeing where they go out of reach from us. Hence fix is to properly kfree() them as well to stop the leakage. Given these are all handled under psock->maps_lock there is no need for deferred RCU freeing. I later also ran with kmemleak detector and it confirmed the finding as well where in the state before the fix the object goes unreferenced while after the patch no kmemleak report related to BPF showed up. [...] unreferenced object 0xffff880378eadae0 (size 64): comm "test_sockmap", pid 2225, jiffies 4294720701 (age 43.504s) hex dump (first 32 bytes): 00 01 00 00 00 00 ad de 00 02 00 00 00 00 ad de ................ 50 4d 75 5d 03 88 ff ff 00 00 00 00 00 00 00 00 PMu]............ backtrace: [<000000005225ac3c>] sock_map_ctx_update_elem.isra.21+0xd8/0x210 [<0000000045dd6d3c>] bpf_sock_map_update+0x29/0x60 [<00000000877723aa>] ___bpf_prog_run+0x1e1f/0x4960 [<000000002ef89e83>] 0xffffffffffffffff unreferenced object 0xffff880378ead240 (size 64): comm "test_sockmap", pid 2225, jiffies 4294720701 (age 43.504s) hex dump (first 32 bytes): 00 01 00 00 00 00 ad de 00 02 00 00 00 00 ad de ................ 00 44 75 5d 03 88 ff ff 00 00 00 00 00 00 00 00 .Du]............ backtrace: [<000000005225ac3c>] sock_map_ctx_update_elem.isra.21+0xd8/0x210 [<0000000030e37a3a>] sock_map_update_elem+0x125/0x240 [<000000002e5ce36e>] map_update_elem+0x4eb/0x7b0 [<00000000db453cc9>] __x64_sys_bpf+0x1f9/0x360 [<0000000000763660>] do_syscall_64+0x9a/0x300 [<00000000422a2bb2>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [<000000002ef89e83>] 0xffffffffffffffff [...] Fixes: e9db4ef6bf4c ("bpf: sockhash fix omitted bucket lock in sock_close") Fixes: 54fedb42c653 ("bpf: sockmap, fix smap_list_map_remove when psock is in many maps") Fixes: 2f857d04601a ("bpf: sockmap, remove STRPARSER map_flags and add multi-map support") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Song Liu Signed-off-by: Alexei Starovoitov commit 90545cdc3f2b2ea700e24335610cd181e73756da Author: Daniel Borkmann Date: Thu Aug 16 21:49:07 2018 +0200 tcp, ulp: fix leftover icsk_ulp_ops preventing sock from reattach I found that in BPF sockmap programs once we either delete a socket from the map or we updated a map slot and the old socket was purged from the map that these socket can never get reattached into a map even though their related psock has been dropped entirely at that point. Reason is that tcp_cleanup_ulp() leaves the old icsk->icsk_ulp_ops intact, so that on the next tcp_set_ulp_id() the kernel returns an -EEXIST thinking there is still some active ULP attached. BPF sockmap is the only one that has this issue as the other user, kTLS, only calls tcp_cleanup_ulp() from tcp_v4_destroy_sock() whereas sockmap semantics allow dropping the socket from the map with all related psock state being cleaned up. Fixes: 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Song Liu Signed-off-by: Alexei Starovoitov commit 037b0b86ecf5646f8eae777d8b52ff8b401692ec Author: Daniel Borkmann Date: Thu Aug 16 21:49:06 2018 +0200 tcp, ulp: add alias for all ulp modules Lets not turn the TCP ULP lookup into an arbitrary module loader as we only intend to load ULP modules through this mechanism, not other unrelated kernel modules: [root@bar]# cat foo.c #include #include #include #include int main(void) { int sock = socket(PF_INET, SOCK_STREAM, 0); setsockopt(sock, IPPROTO_TCP, TCP_ULP, "sctp", sizeof("sctp")); return 0; } [root@bar]# gcc foo.c -O2 -Wall [root@bar]# lsmod | grep sctp [root@bar]# ./a.out [root@bar]# lsmod | grep sctp sctp 1077248 4 libcrc32c 16384 3 nf_conntrack,nf_nat,sctp [root@bar]# Fix it by adding module alias to TCP ULP modules, so probing module via request_module() will be limited to tcp-ulp-[name]. The existing modules like kTLS will load fine given tcp-ulp-tls alias, but others will fail to load: [root@bar]# lsmod | grep sctp [root@bar]# ./a.out [root@bar]# lsmod | grep sctp [root@bar]# Sockmap is not affected from this since it's either built-in or not. Fixes: 734942cc4ea6 ("tcp: ULP infrastructure") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Song Liu Signed-off-by: Alexei Starovoitov commit 50f7ccc64750610f57983720613713b2c14f0e9c Author: Rafael J. Wysocki Date: Thu Aug 16 12:55:01 2018 +0200 cpuidle: menu: Update stale polling override comment The comment to explain why the menu governor uses idle state 1 instead of idle state 0 as the first one sometimes is stale (among other things it mentions a user setting not present any more), so update it. Signed-off-by: Rafael J. Wysocki commit 2a3eb51e30b9ac66fe1b75877627a7e4aaeca24a Author: Henry Willard Date: Tue Aug 14 17:01:02 2018 -0700 cpufreq: governor: Avoid accessing invalid governor_data If cppc_cpufreq.ko is deleted at the same time that tuned-adm is changing profiles, there is a small chance that a race can occur between cpufreq_dbs_governor_exit() and cpufreq_dbs_governor_limits() resulting in a system failure when the latter tries to use policy->governor_data that has been freed by the former. This patch uses gov_dbs_data_mutex to synchronize access. Fixes: e788892ba3cc (cpufreq: governor: Get rid of governor events) Signed-off-by: Henry Willard [ rjw: Subject, minor white space adjustment ] Cc: 4.8+ # 4.8+ Signed-off-by: Rafael J. Wysocki commit 0a3173a5f09bc58a3638ecfd0a80bdbae55e123c Merge: 92f4e77c8591 5c60a7389d79 Author: Jason Gunthorpe Date: Thu Aug 16 14:13:03 2018 -0600 Merge branch 'linus/master' into rdma.git for-next rdma.git merge resolution for the 4.19 merge window Conflicts: drivers/infiniband/core/rdma_core.c - Use the rdma code and revise with the new spelling for atomic_fetch_add_unless drivers/nvme/host/rdma.c - Replace max_sge with max_send_sge in new blk code drivers/nvme/target/rdma.c - Use the blk code and revise to use NULL for ib_post_recv when appropriate - Replace max_sge with max_recv_sge in new blk code net/rds/ib_send.c - Use the net code and revise to use NULL for ib_post_recv when appropriate Signed-off-by: Jason Gunthorpe commit 5198a48381455969aa1053a0ca2e4ce409be2fc2 Merge: 3d779180c692 cc44ba91166b Author: Sebastian Reichel Date: Thu Aug 16 22:19:22 2018 +0200 Merge branch 'psy-fixes' into psy-next Signed-off-by: Sebastian Reichel commit 757d9140072054528b13bbe291583d9823cde195 Author: Steven Rostedt (VMware) Date: Thu Aug 16 16:08:37 2018 -0400 tracing/blktrace: Fix to allow setting same value Masami Hiramatsu reported: Current trace-enable attribute in sysfs returns an error if user writes the same setting value as current one, e.g. # cat /sys/block/sda/trace/enable 0 # echo 0 > /sys/block/sda/trace/enable bash: echo: write error: Invalid argument # echo 1 > /sys/block/sda/trace/enable # echo 1 > /sys/block/sda/trace/enable bash: echo: write error: Device or resource busy But this is not a preferred behavior, it should ignore if new setting is same as current one. This fixes the problem as below. # cat /sys/block/sda/trace/enable 0 # echo 0 > /sys/block/sda/trace/enable # echo 1 > /sys/block/sda/trace/enable # echo 1 > /sys/block/sda/trace/enable Link: http://lkml.kernel.org/r/20180816103802.08678002@gandalf.local.home Cc: Ingo Molnar Cc: Jens Axboe Cc: linux-block@vger.kernel.org Cc: stable@vger.kernel.org Fixes: cd649b8bb830d ("blktrace: remove sysfs_blk_trace_enable_show/store()") Reported-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Jens Axboe commit 566484a9e84c89d9875e8d5d1aac3dbc2d8f0ff4 Author: Jens Axboe Date: Thu Aug 16 14:09:28 2018 -0600 pktcdvd: fix setting of 'ret' error return for a few cases We initialize it to -ENOMEM, but then later overwrite it. After overwriting, we don't set it again for two later failure cases. Reported-by: Jason Wood Signed-off-by: Jens Axboe commit 92f4e77c85918eab5e5803d7e28ab89a7e6bd3a2 Author: Jason Gunthorpe Date: Wed Aug 15 16:52:58 2018 -0600 Revert "net/smc: Replace ib_query_gid with rdma_get_gid_attr" This reverts commit ddb457c6993babbcdd41fca638b870d2a2fc3941. The include rdma/ib_cache.h is kept, and we have to add a memset to the compat wrapper to avoid compiler warnings in gcc-7 This revert is done to avoid extensive merge conflicts with SMC changes in netdev during the 4.19 merge window. Signed-off-by: Jason Gunthorpe commit 965931e3a803a506482616f89239eff6901c17b8 Author: Yonghong Song Date: Tue Aug 14 11:01:12 2018 -0700 bpf: fix a rcu usage warning in bpf_prog_array_copy_core() Commit 394e40a29788 ("bpf: extend bpf_prog_array to store pointers to the cgroup storage") refactored the bpf_prog_array_copy_core() to accommodate new structure bpf_prog_array_item which contains bpf_prog array itself. In the old code, we had perf_event_query_prog_array(): mutex_lock(...) bpf_prog_array_copy_call(): prog = rcu_dereference_check(array, 1)->progs bpf_prog_array_copy_core(prog, ...) mutex_unlock(...) With the above commit, we had perf_event_query_prog_array(): mutex_lock(...) bpf_prog_array_copy_call(): bpf_prog_array_copy_core(array, ...): item = rcu_dereference(array)->items; ... mutex_unlock(...) The new code will trigger a lockdep rcu checking warning. The fix is to change rcu_dereference() to rcu_dereference_check() to prevent such a warning. Reported-by: syzbot+6e72317008eef84a216b@syzkaller.appspotmail.com Fixes: 394e40a29788 ("bpf: extend bpf_prog_array to store pointers to the cgroup storage") Cc: Roman Gushchin Signed-off-by: Yonghong Song Acked-by: Alexei Starovoitov Acked-by: Roman Gushchin Signed-off-by: Daniel Borkmann commit 817b89beb9d8876450fcde9155e17425c329569d Author: Jesper Dangaard Brouer Date: Wed Aug 15 16:57:14 2018 +0200 samples/bpf: all XDP samples should unload xdp/bpf prog on SIGTERM It is common XDP practice to unload/deattach the XDP bpf program, when the XDP sample program is Ctrl-C interrupted (SIGINT) or killed (SIGTERM). The samples/bpf programs xdp_redirect_cpu and xdp_rxq_info, forgot to trap signal SIGTERM (which is the default signal used by the kill command). This was discovered by Red Hat QA, which automated scripts depend on killing the XDP sample program after a timeout period. Fixes: fad3917e361b ("samples/bpf: add cpumap sample program xdp_redirect_cpu") Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info") Reported-by: Jean-Tsung Hsiao Signed-off-by: Jesper Dangaard Brouer Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 21b172ee11b6ec260bd7e6a27b11a8a8d392fce5 Author: Tariq Toukan Date: Mon Aug 13 12:21:58 2018 +0300 net/xdp: Fix suspicious RCU usage warning Fix the warning below by calling rhashtable_lookup_fast. Also, make some code movements for better quality and human readability. [ 342.450870] WARNING: suspicious RCU usage [ 342.455856] 4.18.0-rc2+ #17 Tainted: G O [ 342.462210] ----------------------------- [ 342.467202] ./include/linux/rhashtable.h:481 suspicious rcu_dereference_check() usage! [ 342.476568] [ 342.476568] other info that might help us debug this: [ 342.476568] [ 342.486978] [ 342.486978] rcu_scheduler_active = 2, debug_locks = 1 [ 342.495211] 4 locks held by modprobe/3934: [ 342.500265] #0: 00000000e23116b2 (mlx5_intf_mutex){+.+.}, at: mlx5_unregister_interface+0x18/0x90 [mlx5_core] [ 342.511953] #1: 00000000ca16db96 (rtnl_mutex){+.+.}, at: unregister_netdev+0xe/0x20 [ 342.521109] #2: 00000000a46e2c4b (&priv->state_lock){+.+.}, at: mlx5e_close+0x29/0x60 [mlx5_core] [ 342.531642] #3: 0000000060c5bde3 (mem_id_lock){+.+.}, at: xdp_rxq_info_unreg+0x93/0x6b0 [ 342.541206] [ 342.541206] stack backtrace: [ 342.547075] CPU: 12 PID: 3934 Comm: modprobe Tainted: G O 4.18.0-rc2+ #17 [ 342.556621] Hardware name: Dell Inc. PowerEdge R730/0H21J3, BIOS 1.5.4 10/002/2015 [ 342.565606] Call Trace: [ 342.568861] dump_stack+0x78/0xb3 [ 342.573086] xdp_rxq_info_unreg+0x3f5/0x6b0 [ 342.578285] ? __call_rcu+0x220/0x300 [ 342.582911] mlx5e_free_rq+0x38/0xc0 [mlx5_core] [ 342.588602] mlx5e_close_channel+0x20/0x120 [mlx5_core] [ 342.594976] mlx5e_close_channels+0x26/0x40 [mlx5_core] [ 342.601345] mlx5e_close_locked+0x44/0x50 [mlx5_core] [ 342.607519] mlx5e_close+0x42/0x60 [mlx5_core] [ 342.613005] __dev_close_many+0xb1/0x120 [ 342.617911] dev_close_many+0xa2/0x170 [ 342.622622] rollback_registered_many+0x148/0x460 [ 342.628401] ? __lock_acquire+0x48d/0x11b0 [ 342.633498] ? unregister_netdev+0xe/0x20 [ 342.638495] rollback_registered+0x56/0x90 [ 342.643588] unregister_netdevice_queue+0x7e/0x100 [ 342.649461] unregister_netdev+0x18/0x20 [ 342.654362] mlx5e_remove+0x2a/0x50 [mlx5_core] [ 342.659944] mlx5_remove_device+0xe5/0x110 [mlx5_core] [ 342.666208] mlx5_unregister_interface+0x39/0x90 [mlx5_core] [ 342.673038] cleanup+0x5/0xbfc [mlx5_core] [ 342.678094] __x64_sys_delete_module+0x16b/0x240 [ 342.683725] ? do_syscall_64+0x1c/0x210 [ 342.688476] do_syscall_64+0x5a/0x210 [ 342.693025] entry_SYSCALL_64_after_hwframe+0x49/0xbe Fixes: 8d5d88527587 ("xdp: rhashtable with allocator ID to pointer mapping") Signed-off-by: Tariq Toukan Suggested-by: Daniel Borkmann Cc: Jesper Dangaard Brouer Acked-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann commit 91c1e6ba39cf7f20d4b1c8510d51fff8d91f207c Author: Steven Rostedt (VMware) Date: Thu Aug 16 11:19:04 2018 -0400 blktrace: Add SPDX License format header Add the SPDX License header to ease license compliance management. Acked-by: Jens Axboe Signed-off-by: Steven Rostedt (VMware) commit 599d067dd3c1b9697b786c992b17cd6529c0459c Author: Chengguang Xu Date: Thu Aug 16 22:51:40 2018 +0800 block: change return type to bool Because blk_do_io_stat() only does a judgement about the request contributes to IO statistics, it better changes return type to bool. Signed-off-by: Chengguang Xu Signed-off-by: Jens Axboe commit 54c73f8651500181a948aa6767ae8c2bcfbe9f35 Author: Yuval Shaia Date: Thu Aug 16 12:02:20 2018 +0300 net/mlx5e: Delete unneeded function argument priv argument is not used by the function, delete it. Fixes: a89842811ea98 ("net/mlx5e: Merge per priority stats groups") Signed-off-by: Yuval Shaia Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 70fd8036d0d77bd93ae12185c66504a409d5b54e Author: Ivan Khoronzhuk Date: Wed Aug 15 23:29:53 2018 +0300 Documentation: networking: ti-cpsw: correct cbs parameters for Eth1 100Mb If set cbs parameters calculated for 1000Mb, but use on 100Mb port w/o h/w offload (for cpsw offload it doesn't matter), it works incorrectly. According to the example and testing board, second port is 100Mb interface. Correct them on recalculated for 100Mb interface. It allows to use the same command for CBS software implementation for board in example. Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 5e22002aa8809e2efab2da95855f73f63e14a36c Author: Kees Cook Date: Wed Aug 15 12:14:05 2018 -0700 isdn: Disable IIOCDBGVAR It was possible to directly leak the kernel address where the isdn_dev structure pointer was stored. This is a kernel ASLR bypass for anyone with access to the ioctl. The code had been present since the beginning of git history, though this shouldn't ever be needed for normal operation, therefore remove it. Reported-by: Al Viro Cc: Karsten Keil Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 45316818371d1fb3ecbffa4d4a2d0550e1822e92 Author: Lad, Prabhakar Date: Wed Aug 15 16:51:23 2018 +0100 net: dsa: add support for ksz9897 ethernet switch ksz9477 is superset of ksz9xx series, driver just works out of the box for ksz9897 chip with this patch. Signed-off-by: Lad, Prabhakar Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 7797b93b756dabffd1a8db3e7e7b778fb07ef0a6 Author: Toshiaki Makita Date: Wed Aug 15 17:07:29 2018 +0900 veth: Free queues on link delete David Ahern reported memory leak in veth. ======================================================================= $ cat /sys/kernel/debug/kmemleak unreferenced object 0xffff8800354d5c00 (size 1024): comm "ip", pid 836, jiffies 4294722952 (age 25.904s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<(____ptrval____)>] kmemleak_alloc+0x70/0x94 [<(____ptrval____)>] slab_post_alloc_hook+0x42/0x52 [<(____ptrval____)>] __kmalloc+0x101/0x142 [<(____ptrval____)>] kmalloc_array.constprop.20+0x1e/0x26 [veth] [<(____ptrval____)>] veth_newlink+0x147/0x3ac [veth] ... unreferenced object 0xffff88002e009c00 (size 1024): comm "ip", pid 836, jiffies 4294722958 (age 25.898s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<(____ptrval____)>] kmemleak_alloc+0x70/0x94 [<(____ptrval____)>] slab_post_alloc_hook+0x42/0x52 [<(____ptrval____)>] __kmalloc+0x101/0x142 [<(____ptrval____)>] kmalloc_array.constprop.20+0x1e/0x26 [veth] [<(____ptrval____)>] veth_newlink+0x219/0x3ac [veth] ======================================================================= veth_rq allocated in veth_newlink() was not freed on dellink. We need to free up them after veth_close() so that any packets will not reference the queues afterwards. Thus free them in veth_dev_free() in the same way as freeing stats structure (vstats). Also move queues allocation to veth_dev_init() to be in line with stats allocation. Fixes: 638264dc90227 ("veth: Support per queue XDP ring") Reported-by: David Ahern Signed-off-by: Toshiaki Makita Reviewed-by: David Ahern Tested-by: David Ahern Signed-off-by: David S. Miller commit ff93bca769925a2d8fd7f910cdf543d992e17f07 Author: Cong Wang Date: Tue Aug 14 15:21:31 2018 -0700 ila: make lockdep happy again Previously, alloc_ila_locks() and bucket_table_alloc() call spin_lock_init() separately, therefore they have two different lock names and lock class keys. However, after commit b893281715ab ("ila: Call library function alloc_bucket_locks") they both call helper alloc_bucket_spinlocks() which now only has one lock name and lock class key. This causes a few bogus lockdep warnings as reported by syzbot. Fix this by making alloc_bucket_locks() a macro and pass declaration name as lock name and a static lock class key inside the macro. Fixes: b893281715ab ("ila: Call library function alloc_bucket_locks") Reported-by: Cc: Tom Herbert Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 32039eac4c48f70dfaad36a84f30356ededc7ea8 Author: Vlad Buslov Date: Tue Aug 14 20:29:56 2018 +0300 net: sched: act_ife: always release ife action on init error Action init API was changed to always take reference to action, even when overwriting existing action. Substitute conditional action release, which was executed only if action is newly created, with unconditional release in tcf_ife_init() error handling code to prevent double free or memory leak in case of overwrite. Fixes: 4e8ddd7f1758 ("net: sched: don't release reference on action overwrite") Reported-by: Cong Wang Signed-off-by: Vlad Buslov Acked-by: Cong Wang Signed-off-by: David S. Miller commit 89982f7ccee2fcd8fea7936b81eec6defbf0f131 Merge: a1ceeca679dc 94710cac0ef4 Author: Jason Gunthorpe Date: Thu Aug 16 13:08:18 2018 -0600 Merge tag 'v4.18' into rdma.git for-next Resolve merge conflicts from the -rc cycle against the rdma.git tree: Conflicts: drivers/infiniband/core/uverbs_cmd.c - New ifs added to ib_uverbs_ex_create_flow in -rc and for-next - Merge removal of file->ucontext in for-next with new code in -rc drivers/infiniband/core/uverbs_main.c - for-next removed code from ib_uverbs_write() that was modified in for-rc Signed-off-by: Jason Gunthorpe commit fc8ebd01deeb12728c83381f6ec923e4a192ffd3 Author: Maciej S. Szmigiero Date: Wed Aug 15 23:56:45 2018 +0200 block, bfq: return nbytes and not zero from struct cftype .write() method The value that struct cftype .write() method returns is then directly returned to userspace as the value returned by write() syscall, so it should be the number of bytes actually written (or consumed) and not zero. Returning zero from write() syscall makes programs like /bin/echo or bash spin. Signed-off-by: Maciej S. Szmigiero Fixes: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support") Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe commit 5f34f69ede27dea1f167a0a6d8996f0194b27ba8 Author: Fabrizio Castro Date: Tue Aug 14 13:33:37 2018 +0100 dt-bindings: net: ravb: Add support for r8a774a1 SoC Document RZ/G2M (R8A774A1) SoC bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Sergei Shtylyov Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit a51c76b4dfb30496dc65396a957ef0f06af7fb22 Author: Hangbin Liu Date: Tue Aug 14 17:28:26 2018 +0800 cls_matchall: fix tcf_unbind_filter missing Fix tcf_unbind_filter missing in cls_matchall as this will trigger WARN_ON() in cbq_destroy_class(). Fixes: fd62d9f5c575f ("net/sched: matchall: Fix configuration race") Reported-by: Li Shuang Signed-off-by: Hangbin Liu Acked-by: Cong Wang Signed-off-by: David S. Miller commit f812164869b98d81d692ce12bfed76621a5c8908 Author: Paolo Valente Date: Thu Aug 16 18:51:18 2018 +0200 block, bfq: improve code of bfq_bfqq_charge_time bfq_bfqq_charge_time contains some lengthy and redundant code. This commit trims and condenses that code. Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit d5801088a7bd210dd8fd7add04745e35f0f6ea72 Author: Paolo Valente Date: Thu Aug 16 18:51:17 2018 +0200 block, bfq: reduce write overcharge When a sync request is dispatched, the queue that contains that request, and all the ancestor entities of that queue, are charged with the number of sectors of the request. In constrast, if the request is async, then the queue and its ancestor entities are charged with the number of sectors of the request, multiplied by an overcharge factor. This throttles the bandwidth for async I/O, w.r.t. to sync I/O, and it is done to counter the tendency of async writes to steal I/O throughput to reads. On the opposite end, the lower this parameter, the stabler I/O control, in the following respect. The lower this parameter is, the less the bandwidth enjoyed by a group decreases - when the group does writes, w.r.t. to when it does reads; - when other groups do reads, w.r.t. to when they do writes. The fixes "block, bfq: always update the budget of an entity when needed" and "block, bfq: readd missing reset of parent-entity service" improved I/O control in bfq to such an extent that it has been possible to revise this overcharge factor downwards. This commit introduces the resulting, new value. Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit e02a0aa26bf61b6e481a3d7453a150e692b0df80 Author: Paolo Valente Date: Thu Aug 16 18:51:16 2018 +0200 block, bfq: always update the budget of an entity when needed When the next child entity to serve changes for a given parent entity, the budget of that parent entity must be updated accordingly. Unfortunately, this update is not performed, by mistake, for the entities that happen to switch from having no child entity to serve, to having one child entity to serve. Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit 8a511ba5feec5947bee0635cff8bd796d5f77e3e Author: Paolo Valente Date: Thu Aug 16 18:51:15 2018 +0200 block, bfq: readd missing reset of parent-entity service The received-service counter needs to be equal to 0 when an entity is set in service. Unfortunately, commit "block, bfq: fix service being wrongly set to zero in case of preemption" mistakenly removed the resetting of this counter for the parent entities of the bfq_queue being set in service. This commit fixes this issue by resetting service for parent entities, directly on the expiration of the in-service bfq_queue. Fixes: 9fae8dd59ff3 ("block, bfq: fix service being wrongly set to zero in case of preemption") Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit 13fe7056bebb4015c6231a07a1be4d3aebbfe979 Merge: ed9800100f1a 100294cee9a9 Author: Dmitry Torokhov Date: Thu Aug 16 11:10:56 2018 -0700 Merge branch 'next' into for-linus Prepare input updates for 4.19 merge window. commit c9533d1bca3393fbdfe5b24ccb4cfe6a1a02d794 Author: Michel Dänzer Date: Fri Aug 3 17:24:32 2018 +0200 drm/amdgpu: Use kvmalloc for allocating UVD/VCE/VCN BO backup memory The allocated size can be (at least?) as large as megabytes, and there's no need for it to be physically contiguous. May avoid spurious failures to initialize / suspend the corresponding block while there's memory pressure. Bugzilla: https://bugs.freedesktop.org/107432 Reviewed-by: Christian König Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 5c60a7389d795e001c8748b458eb76e3a5b6008c Merge: b6d6a3076ac4 e1b437691a62 Author: Linus Torvalds Date: Thu Aug 16 10:53:45 2018 -0700 Merge tag 'for-linus-4.19-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux Pull orangefs updates from Mike Marshall: "Orangefs: one cleanup and Souptick's vm_fault_t patch: - add new return type vm_fault_t (Souptick Joarder) - remove redundant pointer (Colin Ian King)" * tag 'for-linus-4.19-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: remove redundant pointer orangefs_inode orangefs: Adding new return type vm_fault_t commit ea51f94b45a0fd657c61206c1b648cc72f95befa Author: Trond Myklebust Date: Wed Aug 15 21:35:45 2018 -0400 pNFS: Treat RECALLCONFLICT like DELAY... Yes, it is possible to get trapped in a loop, but the server should be administratively revoking the recalled layout if it never gets returned. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 1e1132ea21da6d7be92a72195204379c819cb70b Author: Mikulas Patocka Date: Thu Aug 16 12:23:19 2018 -0400 dm writecache: fix a crash due to reading past end of dirty_bitmap wc->dirty_bitmap_size is in bytes so must multiply it by 8, not by BITS_PER_LONG, to get number of bitmap_bits. Fixes crash in find_next_bit() that was reported: https://bugzilla.kernel.org/show_bug.cgi?id=200819 Reported-by: edo.rus@gmail.com Fixes: 48debafe4f2f ("dm: add writecache target") Cc: stable@vger.kernel.org # 4.18 Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit feb9f55c33e5114127238a2c87c069b4f30d1f23 Author: Pablo Neira Ayuso Date: Wed Aug 15 15:37:23 2018 +0200 netfilter: nft_dynset: allow dynamic updates of non-anonymous set This check is superfluous since it breaks valid configurations, remove it. Signed-off-by: Pablo Neira Ayuso commit 90d827f06bebbd9aded00c152e6c9eb2db4db1a3 Author: Máté Eckl Date: Tue Aug 14 22:09:10 2018 +0200 netfilter: nft_tproxy: Fix missing-braces warning This patch fixes a warning reported by the kbuild test robot (from linux-next tree): net/netfilter/nft_tproxy.c: In function 'nft_tproxy_eval_v6': >> net/netfilter/nft_tproxy.c:85:9: warning: missing braces around initializer [-Wmissing-braces] struct in6_addr taddr = {0}; ^ net/netfilter/nft_tproxy.c:85:9: warning: (near initialization for 'taddr.in6_u') [-Wmissing-braces] This warning is actually caused by a gcc bug already resolved in newer versions (kbuild used 4.9) so this kind of initialization is omitted and memset is used instead. Fixes: 4ed8eb6570a4 ("netfilter: nf_tables: Add native tproxy support") Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit cdb2f401246ef70b37eeedd9c6f9c28d611d8255 Author: Dmitry V. Levin Date: Mon Aug 13 18:43:36 2018 +0300 netfilter: uapi: fix linux/netfilter/nf_osf.h userspace compilation errors Move inclusion of and from linux/netfilter/xt_osf.h to linux/netfilter/nf_osf.h to fix the following linux/netfilter/nf_osf.h userspace compilation errors: /usr/include/linux/netfilter/nf_osf.h:59:24: error: 'MAX_IPOPTLEN' undeclared here (not in a function) struct nf_osf_opt opt[MAX_IPOPTLEN]; /usr/include/linux/netfilter/nf_osf.h:64:17: error: field 'ip' has incomplete type struct iphdr ip; /usr/include/linux/netfilter/nf_osf.h:65:18: error: field 'tcp' has incomplete type struct tcphdr tcp; Fixes: bfb15f2a95cb ("netfilter: extract Passive OS fingerprint infrastructure from xt_osf") Signed-off-by: Dmitry V. Levin Signed-off-by: Pablo Neira Ayuso commit 3206c516ce4e4b56d7b99341814c261ec190f6df Author: Harsha Sharma Date: Fri Aug 10 22:52:37 2018 +0530 netfilter: nft_ct: make l3 protocol field optional for timeout object If l3 protocol value is not specified for ct timeout object then use the value from nft_ctx protocol family. Signed-off-by: Harsha Sharma Signed-off-by: Pablo Neira Ayuso commit 1bfc2bc7ad8ac045045e99e33aa1ba727d2d291d Author: Máté Eckl Date: Fri Aug 10 12:58:39 2018 +0200 netfilter: doc: Add nf_tables part in tproxy.txt Recently, transparent proxy support has been added to nf_tables so that this document should be updated with the new information. - Nft commands are added as alternatives to iptables ones. - The link for a patched iptables is removed as it is already part of the mainline iptables implementation (and the link is dead). - tcprdr is added as an example implementation of a transparent proxy Cc: "David S. Miller" Cc: Jonathan Corbet Cc: Florian Westphal Cc: KOVACS Krisztian Cc: Pablo Neira Ayuso Cc: linux-doc@vger.kernel.org Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit a148ce15375fc664ad64762c751c0c2aecb2cafe Author: Michal Hocko Date: Tue Aug 7 21:54:00 2018 +0200 netfilter: x_tables: do not fail xt_alloc_table_info too easilly eacd86ca3b03 ("net/netfilter/x_tables.c: use kvmalloc() in xt_alloc_table_info()") has unintentionally fortified xt_alloc_table_info allocation when __GFP_RETRY has been dropped from the vmalloc fallback. Later on there was a syzbot report that this can lead to OOM killer invocations when tables are too large and 0537250fdc6c ("netfilter: x_tables: make allocation less aggressive") has been merged to restore the original behavior. Georgi Nikolov however noticed that he is not able to install his iptables anymore so this can be seen as a regression. The primary argument for 0537250fdc6c was that this allocation path shouldn't really trigger the OOM killer and kill innocent tasks. On the other hand the interface requires root and as such should allow what the admin asks for. Root inside a namespaces makes this more complicated because those might be not trusted in general. If they are not then such namespaces should be restricted anyway. Therefore drop the __GFP_NORETRY and replace it by __GFP_ACCOUNT to enfore memcg constrains on it. Fixes: 0537250fdc6c ("netfilter: x_tables: make allocation less aggressive") Reported-by: Georgi Nikolov Suggested-by: Vlastimil Babka Acked-by: Florian Westphal Signed-off-by: Michal Hocko Acked-by: Vlastimil Babka Signed-off-by: Pablo Neira Ayuso commit 1c117d3b721a2678020d522ff1bf33984d4f0a5a Author: Florian Westphal Date: Thu Aug 2 12:30:09 2018 +0200 netfilter: conntrack: fix removal of conntrack entries when l4tracker is removed nf_ct_l4proto_unregister_one() leaves conntracks added by to-be-removed tracker behind, nf_ct_l4proto_unregister has to iterate for each protocol to be removed. v2: call nf_ct_iterate_destroy without holding nf_ct_proto_mutex. Fixes: 2c41f33c1b703 ("netfilter: move table iteration out of netns exit paths") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6a48de0144767f2c6880540c0a4ac6741e3c440b Author: Florian Westphal Date: Thu Aug 2 21:44:41 2018 +0200 netfilter: nf_tables: don't prevent event handler from device cleanup on netns exit When a netnsamespace exits, the nf_tables pernet_ops will remove all rules. However, there is one caveat: Base chains that register ingress hooks will cause use-after-free: device is already gone at that point. The device event handlers prevent this from happening: netns exit synthesizes unregister events for all devices. However, an improper fix for a race condition made the notifiers a no-op in case they get called from netns exit path, so revert that part. This is safe now as the previous patch fixed nf_tables pernet ops and device notifier initialisation ordering. Fixes: 0a2cf5ee432c2 ("netfilter: nf_tables: close race between netns exit and rmmod") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d209df3e7f7002d9099fdb0f6df0f972b4386a63 Author: Florian Westphal Date: Thu Aug 2 21:44:40 2018 +0200 netfilter: nf_tables: fix register ordering We must register nfnetlink ops last, as that exposes nf_tables to userspace. Without this, we could theoretically get nfnetlink request before net->nft state has been initialized. Fixes: 99633ab29b213 ("netfilter: nf_tables: complete net namespace support") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 3e673b23b541b8e7f773b2d378d6eb99831741cd Author: Florian Westphal Date: Tue Jul 31 13:41:23 2018 +0200 netfilter: fix memory leaks on netlink_dump_start error Shaochun Chen points out we leak dumper filter state allocations stored in dump_control->data in case there is an error before netlink sets cb_running (after which ->done will be called at some point). In order to fix this, add .start functions and move allocations there. Same pattern as used in commit 90fd131afc565159c9e0ea742f082b337e10f8c6 ("netfilter: nf_tables: move dumper state allocation into ->start"). Reported-by: shaochun chen Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 4ef360dd6a65f6ef337645e1b65e744034754b19 Author: Taehee Yoo Date: Thu Jul 26 00:39:51 2018 +0900 netfilter: nft_set: fix allocation size overflow in privsize callback. In order to determine allocation size of set, ->privsize is invoked. At this point, both desc->size and size of each data structure of set are used. desc->size means number of element that is given by user. desc->size is u32 type. so that upperlimit of set element is 4294967295. but return type of ->privsize is also u32. hence overflow can occurred. test commands: %nft add table ip filter %nft add set ip filter hash1 { type ipv4_addr \; size 4294967295 \; } %nft list ruleset splat looks like: [ 1239.202910] kasan: CONFIG_KASAN_INLINE enabled [ 1239.208788] kasan: GPF could be caused by NULL-ptr deref or user memory access [ 1239.217625] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN PTI [ 1239.219329] CPU: 0 PID: 1603 Comm: nft Not tainted 4.18.0-rc5+ #7 [ 1239.229091] RIP: 0010:nft_hash_walk+0x1d2/0x310 [nf_tables_set] [ 1239.229091] Code: 84 d2 7f 10 4c 89 e7 89 44 24 38 e8 d8 5a 17 e0 8b 44 24 38 48 8d 7b 10 41 0f b6 0c 24 48 89 fa 48 89 fe 48 c1 ea 03 83 e6 07 <42> 0f b6 14 3a 40 38 f2 7f 1a 84 d2 74 16 [ 1239.229091] RSP: 0018:ffff8801118cf358 EFLAGS: 00010246 [ 1239.229091] RAX: 0000000000000000 RBX: 0000000000020400 RCX: 0000000000000001 [ 1239.229091] RDX: 0000000000004082 RSI: 0000000000000000 RDI: 0000000000020410 [ 1239.229091] RBP: ffff880114d5a988 R08: 0000000000007e94 R09: ffff880114dd8030 [ 1239.229091] R10: ffff880114d5a988 R11: ffffed00229bb006 R12: ffff8801118cf4d0 [ 1239.229091] R13: ffff8801118cf4d8 R14: 0000000000000000 R15: dffffc0000000000 [ 1239.229091] FS: 00007f5a8fe0b700(0000) GS:ffff88011b600000(0000) knlGS:0000000000000000 [ 1239.229091] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1239.229091] CR2: 00007f5a8ecc27b0 CR3: 000000010608e000 CR4: 00000000001006f0 [ 1239.229091] Call Trace: [ 1239.229091] ? nft_hash_remove+0xf0/0xf0 [nf_tables_set] [ 1239.229091] ? memset+0x1f/0x40 [ 1239.229091] ? __nla_reserve+0x9f/0xb0 [ 1239.229091] ? memcpy+0x34/0x50 [ 1239.229091] nf_tables_dump_set+0x9a1/0xda0 [nf_tables] [ 1239.229091] ? __kmalloc_reserve.isra.29+0x2e/0xa0 [ 1239.229091] ? nft_chain_hash_obj+0x630/0x630 [nf_tables] [ 1239.229091] ? nf_tables_commit+0x2c60/0x2c60 [nf_tables] [ 1239.229091] netlink_dump+0x470/0xa20 [ 1239.229091] __netlink_dump_start+0x5ae/0x690 [ 1239.229091] nft_netlink_dump_start_rcu+0xd1/0x160 [nf_tables] [ 1239.229091] nf_tables_getsetelem+0x2e5/0x4b0 [nf_tables] [ 1239.229091] ? nft_get_set_elem+0x440/0x440 [nf_tables] [ 1239.229091] ? nft_chain_hash_obj+0x630/0x630 [nf_tables] [ 1239.229091] ? nf_tables_dump_obj_done+0x70/0x70 [nf_tables] [ 1239.229091] ? nla_parse+0xab/0x230 [ 1239.229091] ? nft_get_set_elem+0x440/0x440 [nf_tables] [ 1239.229091] nfnetlink_rcv_msg+0x7f0/0xab0 [nfnetlink] [ 1239.229091] ? nfnetlink_bind+0x1d0/0x1d0 [nfnetlink] [ 1239.229091] ? debug_show_all_locks+0x290/0x290 [ 1239.229091] ? sched_clock_cpu+0x132/0x170 [ 1239.229091] ? find_held_lock+0x39/0x1b0 [ 1239.229091] ? sched_clock_local+0x10d/0x130 [ 1239.229091] netlink_rcv_skb+0x211/0x320 [ 1239.229091] ? nfnetlink_bind+0x1d0/0x1d0 [nfnetlink] [ 1239.229091] ? netlink_ack+0x7b0/0x7b0 [ 1239.229091] ? ns_capable_common+0x6e/0x110 [ 1239.229091] nfnetlink_rcv+0x2d1/0x310 [nfnetlink] [ 1239.229091] ? nfnetlink_rcv_batch+0x10f0/0x10f0 [nfnetlink] [ 1239.229091] ? netlink_deliver_tap+0x829/0x930 [ 1239.229091] ? lock_acquire+0x265/0x2e0 [ 1239.229091] netlink_unicast+0x406/0x520 [ 1239.509725] ? netlink_attachskb+0x5b0/0x5b0 [ 1239.509725] ? find_held_lock+0x39/0x1b0 [ 1239.509725] netlink_sendmsg+0x987/0xa20 [ 1239.509725] ? netlink_unicast+0x520/0x520 [ 1239.509725] ? _copy_from_user+0xa9/0xc0 [ 1239.509725] __sys_sendto+0x21a/0x2c0 [ 1239.509725] ? __ia32_sys_getpeername+0xa0/0xa0 [ 1239.509725] ? retint_kernel+0x10/0x10 [ 1239.509725] ? sched_clock_cpu+0x132/0x170 [ 1239.509725] ? find_held_lock+0x39/0x1b0 [ 1239.509725] ? lock_downgrade+0x540/0x540 [ 1239.509725] ? up_read+0x1c/0x100 [ 1239.509725] ? __do_page_fault+0x763/0x970 [ 1239.509725] ? retint_user+0x18/0x18 [ 1239.509725] __x64_sys_sendto+0x177/0x180 [ 1239.509725] do_syscall_64+0xaa/0x360 [ 1239.509725] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 1239.509725] RIP: 0033:0x7f5a8f468e03 [ 1239.509725] Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb d0 0f 1f 84 00 00 00 00 00 83 3d 49 c9 2b 00 00 75 13 49 89 ca b8 2c 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 34 c3 48 83 ec 08 e8 [ 1239.509725] RSP: 002b:00007ffd78d0b778 EFLAGS: 00000246 ORIG_RAX: 000000000000002c [ 1239.509725] RAX: ffffffffffffffda RBX: 00007ffd78d0c890 RCX: 00007f5a8f468e03 [ 1239.509725] RDX: 0000000000000034 RSI: 00007ffd78d0b7e0 RDI: 0000000000000003 [ 1239.509725] RBP: 00007ffd78d0b7d0 R08: 00007f5a8f15c160 R09: 000000000000000c [ 1239.509725] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd78d0b7e0 [ 1239.509725] R13: 0000000000000034 R14: 00007f5a8f9aff60 R15: 00005648040094b0 [ 1239.509725] Modules linked in: nf_tables_set nf_tables nfnetlink ip_tables x_tables [ 1239.670713] ---[ end trace 39375adcda140f11 ]--- [ 1239.676016] RIP: 0010:nft_hash_walk+0x1d2/0x310 [nf_tables_set] [ 1239.682834] Code: 84 d2 7f 10 4c 89 e7 89 44 24 38 e8 d8 5a 17 e0 8b 44 24 38 48 8d 7b 10 41 0f b6 0c 24 48 89 fa 48 89 fe 48 c1 ea 03 83 e6 07 <42> 0f b6 14 3a 40 38 f2 7f 1a 84 d2 74 16 [ 1239.705108] RSP: 0018:ffff8801118cf358 EFLAGS: 00010246 [ 1239.711115] RAX: 0000000000000000 RBX: 0000000000020400 RCX: 0000000000000001 [ 1239.719269] RDX: 0000000000004082 RSI: 0000000000000000 RDI: 0000000000020410 [ 1239.727401] RBP: ffff880114d5a988 R08: 0000000000007e94 R09: ffff880114dd8030 [ 1239.735530] R10: ffff880114d5a988 R11: ffffed00229bb006 R12: ffff8801118cf4d0 [ 1239.743658] R13: ffff8801118cf4d8 R14: 0000000000000000 R15: dffffc0000000000 [ 1239.751785] FS: 00007f5a8fe0b700(0000) GS:ffff88011b600000(0000) knlGS:0000000000000000 [ 1239.760993] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1239.767560] CR2: 00007f5a8ecc27b0 CR3: 000000010608e000 CR4: 00000000001006f0 [ 1239.775679] Kernel panic - not syncing: Fatal exception [ 1239.776630] Kernel Offset: 0x1f000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [ 1239.776630] Rebooting in 5 seconds.. Fixes: 20a69341f2d0 ("netfilter: nf_tables: add netlink set API") Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit da786717e0894886301ed2536843c13f9e8fd53e Author: Florian Westphal Date: Wed Jul 25 21:38:43 2018 +0200 netfilter: ip6t_rpfilter: set F_IFACE for linklocal addresses Roman reports that DHCPv6 client no longer sees replies from server due to ip6tables -t raw -A PREROUTING -m rpfilter --invert -j DROP rule. We need to set the F_IFACE flag for linklocal addresses, they are scoped per-device. Fixes: 47b7e7f82802 ("netfilter: don't set F_IFACE on ipv6 fib lookups") Reported-by: Roman Mamedov Tested-by: Roman Mamedov Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit b71ed54dc2a1dbb4328f7d7c98d712747aee92ba Author: Matteo Croce Date: Tue Jul 31 18:03:33 2018 +0200 ipvs: don't show negative times in ip_vs_conn Since commit 500462a9de65 ("timers: Switch to a non-cascading wheel"), timers duration can last even 12.5% more than the scheduled interval. IPVS has two handlers, /proc/net/ip_vs_conn and /proc/net/ip_vs_conn_sync, which shows the remaining time before that a connection expires. The default expire time for a connection is 60 seconds, and the expiration timer can fire even 4 seconds later than the scheduled time. The expiration time is calculated subtracting jiffies to the scheduled expiration time, and it's shown as a huge number when the timer fires late, since both values are unsigned. This can confuse script and tools which relies on it, like ipvsadm: root@mcroce-redhat:~# while ipvsadm -lc |grep SYN_RECV; do sleep 1 ; done TCP 00:05 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 00:04 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 00:03 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 00:02 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 00:01 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 00:00 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 68719476:44 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 68719476:43 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 68719476:42 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 68719476:41 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 68719476:40 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 TCP 68719476:39 SYN_RECV [fc00:1::1]:55732 [fc00:1::2]:8000 [fc00:2000::1]:8000 Signed-off-by: Matteo Croce Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit 14d32b2525dd3a21c29b0d9edf1748f5dabc1bbc Author: Matteo Croce Date: Tue Jul 31 18:03:32 2018 +0200 jiffies: add utility function to calculate delta in ms add jiffies_delta_to_msecs() helper func to calculate the delta between two times and eventually 0 if negative. Suggested-by: Eric Dumazet Signed-off-by: Matteo Croce Reviewed-by: Eric Dumazet Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit a53b42c11815d2357e31a9403ae3950517525894 Author: Tan Hu Date: Wed Jul 25 15:23:07 2018 +0800 ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest() We came across infinite loop in ipvs when using ipvs in docker env. When ipvs receives new packets and cannot find an ipvs connection, it will create a new connection, then if the dest is unavailable (i.e. IP_VS_DEST_F_AVAILABLE), the packet will be dropped sliently. But if the dropped packet is the first packet of this connection, the connection control timer never has a chance to start and the ipvs connection cannot be released. This will lead to memory leak, or infinite loop in cleanup_net() when net namespace is released like this: ip_vs_conn_net_cleanup at ffffffffa0a9f31a [ip_vs] __ip_vs_cleanup at ffffffffa0a9f60a [ip_vs] ops_exit_list at ffffffff81567a49 cleanup_net at ffffffff81568b40 process_one_work at ffffffff810a851b worker_thread at ffffffff810a9356 kthread at ffffffff810b0b6f ret_from_fork at ffffffff81697a18 race condition: CPU1 CPU2 ip_vs_in() ip_vs_conn_new() ip_vs_del_dest() __ip_vs_unlink_dest() ~IP_VS_DEST_F_AVAILABLE cp->dest && !IP_VS_DEST_F_AVAILABLE __ip_vs_conn_put ... cleanup_net ---> infinite looping Fix this by checking whether the timer already started. Signed-off-by: Tan Hu Reviewed-by: Jiang Biao Acked-by: Julian Anastasov Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit b6d6a3076ac4eecb2d9cbcf17730fc160b94cadc Merge: d01e12dd3f42 0dd0e297f0ec Author: Linus Torvalds Date: Thu Aug 16 10:34:05 2018 -0700 Merge tag 'vfio-v4.19-rc1' of git://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - mark switch fall-through cases (Gustavo A. R. Silva) - disable binding SR-IOV enabled PFs (Alex Williamson) * tag 'vfio-v4.19-rc1' of git://github.com/awilliam/linux-vfio: vfio-pci: Disable binding to PFs with SR-IOV enabled vfio: Mark expected switch fall-throughs commit ecf8402603d4df1278231439bbe5e92af4e02a17 Author: Trond Myklebust Date: Wed Aug 15 21:35:46 2018 -0400 pNFS: When updating the stateid in layoutreturn, also update the recall range When we update the layout stateid in nfs4_layoutreturn_refresh_stateid, we should also update the range in order to let the server know we're actually returning everything. Fixes: 16c278dbfa63 ("pnfs: Fix handling of NFS4ERR_OLD_STATEID replies...") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit d01e12dd3f4227f1be5d7c5bffa7b8240787bec1 Merge: 9502f0d1d905 84b64de597bc Author: Linus Torvalds Date: Thu Aug 16 10:21:18 2018 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal Pull thermal management updates from Eduardo Valentin: - rework tsens driver to add support for tsens-v2 (Amit Kucheria) - rework armada thermal driver to use syscon and multichannel support (Miquel Raynal) - fixes to TI SoC, IMX, Exynos, RCar, and hwmon drivers * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: (34 commits) thermal: armada: fix copy-paste error in armada_thermal_probe() thermal: rcar_thermal: avoid NULL dereference in absence of IRQ resources thermal: samsung: Remove Exynos5440 clock handling left-overs thermal: tsens: Fix negative temperature reporting thermal: tsens: switch from of_iomap() to devm_ioremap_resource() thermal: tsens: Rename variable thermal: tsens: Add generic support for TSENS v2 IP thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse thermal: tsens: Add support to split up register address space into two dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP thermal: tsens: Get rid of unused fields in structure thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info thermal_hwmon: Sanitize attribute name passed to hwmon dt-bindings: thermal: armada: add reference to new bindings dt-bindings: cp110: add the thermal node in the syscon file dt-bindings: cp110: update documentation since DT de-duplication dt-bindings: ap806: add the thermal node in the syscon file dt-bindings: cp110: prepare the syscon file to list other syscons nodes dt-bindings: ap806: prepare the syscon file to list other syscons nodes dt-bindings: cp110: rename cp110 syscon file ... commit 9502f0d1d9059988ca4edc566f81ba864568f39e Merge: ea93102f3224 2bb7005696e2 Author: Linus Torvalds Date: Thu Aug 16 10:16:08 2018 -0700 Merge tag 'mailbox-v4.19' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: - xgene: potential null pointer fix - omap: switch to spdx license and use of_device_get_match_data() to match data - ti-msgmgr: cleanup and optimisation. New TI specific feature - secure proxy thread. - mediatek: add driver for CMDQ controller. - nxp: add driver for MU controller * tag 'mailbox-v4.19' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: Add support for i.MX messaging unit dt-bindings: mailbox: imx-mu: add generic MU channel support dt-bindings: arm: fsl: add mu binding doc mailbox: add MODULE_LICENSE() for mtk-cmdq-mailbox.c mailbox: mediatek: Add Mediatek CMDQ driver dt-bindings: soc: Add documentation for the MediaTek GCE unit mailbox: ti-msgmgr: Add support for Secure Proxy dt-bindings: mailbox: Add support for secure proxy threads mailbox: ti-msgmgr: Move the memory region name to descriptor mailbox: ti-msgmgr: Change message count mask to be descriptor based mailbox: ti-msgmgr: Allocate Rx channel resources only on request mailbox: ti-msgmgr: Get rid of unused structure members mailbox/omap: use of_device_get_match_data() to get match data mailbox/omap: switch to SPDX license identifier mailbox: xgene-slimpro: Fix potential NULL pointer dereference commit ea93102f32244e3f45c8b26260be77ed0cc1d16c Author: Yannik Sembritzki Date: Thu Aug 16 14:05:23 2018 +0100 Fix kexec forbidding kernels signed with keys in the secondary keyring to boot The split of .system_keyring into .builtin_trusted_keys and .secondary_trusted_keys broke kexec, thereby preventing kernels signed by keys which are now in the secondary keyring from being kexec'd. Fix this by passing VERIFY_USE_SECONDARY_KEYRING to verify_pefile_signature(). Fixes: d3bfe84129f6 ("certs: Add a secondary system keyring that can be added to dynamically") Signed-off-by: Yannik Sembritzki Signed-off-by: David Howells Cc: kexec@lists.infradead.org Cc: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: stable@kernel.org Signed-off-by: Linus Torvalds commit 817aef260037f33ee0f44c17fe341323d3aebd6d Author: Yannik Sembritzki Date: Thu Aug 16 14:05:10 2018 +0100 Replace magic for trusting the secondary keyring with #define Replace the use of a magic number that indicates that verify_*_signature() should use the secondary keyring with a symbol. Signed-off-by: Yannik Sembritzki Signed-off-by: David Howells Cc: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org Signed-off-by: Linus Torvalds commit 4e31843f681c34f7185e7d169fe627c9d891ce2c Merge: f91e654474d4 fa687fb9ced4 Author: Linus Torvalds Date: Thu Aug 16 09:21:54 2018 -0700 Merge tag 'pci-v4.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci updates from Bjorn Helgaas: - Decode AER errors with names similar to "lspci" (Tyler Baicar) - Expose AER statistics in sysfs (Rajat Jain) - Clear AER status bits selectively based on the type of recovery (Oza Pawandeep) - Honor "pcie_ports=native" even if HEST sets FIRMWARE_FIRST (Alexandru Gagniuc) - Don't clear AER status bits if we're using the "Firmware-First" strategy where firmware owns the registers (Alexandru Gagniuc) - Use sysfs_match_string() to simplify ASPM sysfs parsing (Andy Shevchenko) - Remove unnecessary includes of (Bjorn Helgaas) - Defer DPC event handling to work queue (Keith Busch) - Use threaded IRQ for DPC bottom half (Keith Busch) - Print AER status while handling DPC events (Keith Busch) - Work around IDT switch ACS Source Validation erratum (James Puthukattukaran) - Emit diagnostics for all cases of PCIe Link downtraining (Links operating slower than they're capable of) (Alexandru Gagniuc) - Skip VFs when configuring Max Payload Size (Myron Stowe) - Reduce Root Port Max Payload Size if necessary when hot-adding a device below it (Myron Stowe) - Simplify SHPC existence/permission checks (Bjorn Helgaas) - Remove hotplug sample skeleton driver (Lukas Wunner) - Convert pciehp to threaded IRQ handling (Lukas Wunner) - Improve pciehp tolerance of missed events and initially unstable links (Lukas Wunner) - Clear spurious pciehp events on resume (Lukas Wunner) - Add pciehp runtime PM support, including for Thunderbolt controllers (Lukas Wunner) - Support interrupts from pciehp bridges in D3hot (Lukas Wunner) - Mark fall-through switch cases before enabling -Wimplicit-fallthrough (Gustavo A. R. Silva) - Move DMA-debug PCI init from arch code to PCI core (Christoph Hellwig) - Fix pci_request_irq() usage of IRQF_ONESHOT when no handler is supplied (Heiner Kallweit) - Unify PCI and DMA direction #defines (Shunyong Yang) - Add PCI_DEVICE_DATA() macro (Andy Shevchenko) - Check for VPD completion before checking for timeout (Bert Kenward) - Limit Netronome NFP5000 config space size to work around erratum (Jakub Kicinski) - Set IRQCHIP_ONESHOT_SAFE for PCI MSI irqchips (Heiner Kallweit) - Document ACPI description of PCI host bridges (Bjorn Helgaas) - Add "pci=disable_acs_redir=" parameter to disable ACS redirection for peer-to-peer DMA support (we don't have the peer-to-peer support yet; this is just one piece) (Logan Gunthorpe) - Clean up devm_of_pci_get_host_bridge_resources() resource allocation (Jan Kiszka) - Fixup resizable BARs after suspend/resume (Christian König) - Make "pci=earlydump" generic (Sinan Kaya) - Fix ROM BAR access routines to stay in bounds and check for signature correctly (Rex Zhu) - Add DMA alias quirk for Microsemi Switchtec NTB (Doug Meyer) - Expand documentation for pci_add_dma_alias() (Logan Gunthorpe) - To avoid bus errors, enable PASID only if entire path supports End-End TLP prefixes (Sinan Kaya) - Unify slot and bus reset functions and remove hotplug knowledge from callers (Sinan Kaya) - Add Function-Level Reset quirks for Intel and Samsung NVMe devices to fix guest reboot issues (Alex Williamson) - Add function 1 DMA alias quirk for Marvell 88SS9183 PCIe SSD Controller (Bjorn Helgaas) - Remove Xilinx AXI-PCIe host bridge arch dependency (Palmer Dabbelt) - Remove Aardvark outbound window configuration (Evan Wang) - Fix Aardvark bridge window sizing issue (Zachary Zhang) - Convert Aardvark to use pci_host_probe() to reduce code duplication (Thomas Petazzoni) - Correct the Cadence cdns_pcie_writel() signature (Alan Douglas) - Add Cadence support for optional generic PHYs (Alan Douglas) - Add Cadence power management ops (Alan Douglas) - Remove redundant variable from Cadence driver (Colin Ian King) - Add Kirin MSI support (Xiaowei Song) - Drop unnecessary root_bus_nr setting from exynos, imx6, keystone, armada8k, artpec6, designware-plat, histb, qcom, spear13xx (Shawn Guo) - Move link notification settings from DesignWare core to individual drivers (Gustavo Pimentel) - Add endpoint library MSI-X interfaces (Gustavo Pimentel) - Correct signature of endpoint library IRQ interfaces (Gustavo Pimentel) - Add DesignWare endpoint library MSI-X callbacks (Gustavo Pimentel) - Add endpoint library MSI-X test support (Gustavo Pimentel) - Remove unnecessary GFP_ATOMIC from Hyper-V "new child" allocation (Jia-Ju Bai) - Add more devices to Broadcom PAXC quirk (Ray Jui) - Work around corrupted Broadcom PAXC config space to enable SMMU and GICv3 ITS (Ray Jui) - Disable MSI parsing to work around broken Broadcom PAXC logic in some devices (Ray Jui) - Hide unconfigured functions to work around a Broadcom PAXC defect (Ray Jui) - Lower iproc log level to reduce console output during boot (Ray Jui) - Fix mobiveil iomem/phys_addr_t type usage (Lorenzo Pieralisi) - Fix mobiveil missing include file (Lorenzo Pieralisi) - Add mobiveil Kconfig/Makefile support (Lorenzo Pieralisi) - Fix mvebu I/O space remapping issues (Thomas Petazzoni) - Use generic pci_host_bridge in mvebu instead of ARM-specific API (Thomas Petazzoni) - Whitelist VMD devices with fast interrupt handlers to avoid sharing vectors with slow handlers (Keith Busch) * tag 'pci-v4.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (153 commits) PCI/AER: Don't clear AER bits if error handling is Firmware-First PCI: Limit config space size for Netronome NFP5000 PCI/MSI: Set IRQCHIP_ONESHOT_SAFE for PCI-MSI irqchips PCI/VPD: Check for VPD access completion before checking for timeout PCI: Add PCI_DEVICE_DATA() macro to fully describe device ID entry PCI: Match Root Port's MPS to endpoint's MPSS as necessary PCI: Skip MPS logic for Virtual Functions (VFs) PCI: Add function 1 DMA alias quirk for Marvell 88SS9183 PCI: Check for PCIe Link downtraining PCI: Add ACS Redirect disable quirk for Intel Sunrise Point PCI: Add device-specific ACS Redirect disable infrastructure PCI: Convert device-specific ACS quirks from NULL termination to ARRAY_SIZE PCI: Add "pci=disable_acs_redir=" parameter for peer-to-peer support PCI: Allow specifying devices using a base bus and path of devfns PCI: Make specifying PCI devices in kernel parameters reusable PCI: Hide ACS quirk declarations inside PCI core PCI: Delay after FLR of Intel DC P3700 NVMe PCI: Disable Samsung SM961/PM961 NVMe before FLR PCI: Export pcie_has_flr() PCI: mvebu: Drop bogus comment above mvebu_pcie_map_registers() ... commit 4acd8d01a2393f2145ad1db10b2d5c764582a98d Author: Sean Paul Date: Wed Aug 15 11:35:29 2018 -0400 MAINTAINERS: drm-misc: Change seanpaul's email address Since chromium.org is now enforcing DMARC, my mails are going to people's spam folders. While this development might be desirable for people I communicate with, it's undesirable for me :-) Cc: Dave Airlie Cc: Gustavo Padovan Cc: Maarten Lankhorst Acked-by: Daniel Vetter Signed-off-by: Sean Paul Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180815153604.90152-1-sean@poorly.run commit 28b7465376b9f9633bb774e45c0421dc4db7f303 Author: Philipp Rudo Date: Mon Aug 13 12:45:06 2018 +0200 s390/kdump: Remove kzalloc_panic For this function there are only two users, when 1) the elfcorehdr and 2) the vmcoreinfo is allocated. However a missing vmcoreinfo is not critical for kdump. So panicking when it cannot be allocated is not required. Remove kzalloc_panic and adjust its callers accordingly. Signed-off-by: Philipp Rudo Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 2d2e7075b87181ed0c675e4936e20bdadba02e1f Author: Philipp Rudo Date: Mon Aug 13 11:16:57 2018 +0200 s390/kdump: Fix memleak in nt_vmcoreinfo The vmcoreinfo of a crashed system is potentially fragmented. Thus the crash kernel has an intermediate step where the vmcoreinfo is copied into a temporary, continuous buffer in the crash kernel memory. This temporary buffer is never freed. Free it now to prevent the memleak. While at it replace all occurrences of "VMCOREINFO" by its corresponding macro to prevent potential renaming issues. Signed-off-by: Philipp Rudo Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 263b0e480c9b0fda77a89f5d6375d8a39de5c166 Author: Philipp Rudo Date: Mon Aug 6 13:39:52 2018 +0200 s390/kdump: Make elfcorehdr size calculation ABI compliant There are two ways to pass the vmcoreinfo to the crash kernel 1) via the os_info mechanism and 2) via the lowcore->vmcore_info field. In the Linux kernel only the second way is used. However, the first way is ABI for stand-alone kdump. So other OSes use it to pass additional debug info. Make the elfcorehdr size calculation aware of both possible ways. Fixes: 8cce437fbb5c ("s390/kdump: Fix elfcorehdr size calculation") Signed-off-by: Philipp Rudo Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 2abe24b4b095c9a7bfd8157daa8aea5c464b7aa9 Author: Sebastian Ott Date: Tue Jul 24 20:16:29 2018 +0200 s390/pci: remove fmb address from debug output This information was never useful and is nowadays replaced with random data. Just get rid of it. Signed-off-by: Sebastian Ott Signed-off-by: Heiko Carstens commit 38204071a024bb6b62e669e971799152809f1722 Author: Sebastian Ott Date: Mon Aug 13 11:27:23 2018 +0200 s390/pci: remove stale rc Get rid of a leftover return code in arch_setup_msi_irqs. Signed-off-by: Sebastian Ott Signed-off-by: Heiko Carstens commit 866f3576a72b2233a76dffb80290f8086dc49e17 Author: Sebastian Ott Date: Mon Aug 13 11:26:46 2018 +0200 s390/pci: fix out of bounds access during irq setup During interrupt setup we allocate interrupt vectors, walk the list of msi descriptors, and fill in the message data. Requesting more interrupts than supported on s390 can lead to an out of bounds access. When we restrict the number of interrupts we should also stop walking the msi list after all supported interrupts are handled. Cc: stable@vger.kernel.org Signed-off-by: Sebastian Ott Signed-off-by: Heiko Carstens commit 2395103b3fbf2553d94a64ac3e29595cb040474b Author: Harald Freudenberger Date: Thu Aug 9 11:59:34 2018 +0200 s390/zcrypt: fix ap_instructions_available() returncodes During review of KVM patches it was complained that the ap_instructions_available() function returns 0 if AP instructions are available and -ENODEV if not. The function acts like a boolean function to check for AP instructions available and thus should return 0 on failure and != 0 on success. Changed to the suggested behaviour and adapted the one and only caller of this function which is the ap bus core code. Signed-off-by: Harald Freudenberger Acked-by: Cornelia Huck Signed-off-by: Heiko Carstens commit 6f0a256253f48095ba2e5bcdfbed41f21643c105 Author: Oder Chiou Date: Wed Aug 15 14:47:49 2018 +0800 ASoC: rt5514: Fix the issue of the delay volume applied again After our evaluation, we need to modify the default values to make sure the volume applied immediately. Signed-off-by: Oder Chiou Signed-off-by: Mark Brown commit 0d22825255f25adb6a609f130b42c752d3fd0f5d Author: Ryan Lee Date: Wed Aug 15 18:53:38 2018 -0700 ASoC: max98373: Added speaker FS gain cotnrol register to volatile. Signed-off-by: Ryan Lee Signed-off-by: Mark Brown commit d2c9281c184bf2b768ac141a7a10586e0643695d Author: Richard Fitzgerald Date: Tue Aug 7 10:08:12 2018 +0100 mfd: madera: Add register definitions for accessory detect Add some register definitions for accessory detection, used by the extcon driver. Signed-off-by: Richard Fitzgerald Signed-off-by: Lee Jones commit 2f606da78230f09cf1a71fde6ee91d0c710fa2b2 Author: Guenter Roeck Date: Fri Aug 3 20:59:51 2018 -0700 mfd: sm501: Set coherent_dma_mask when creating subdevices Instantiating the sm501 OHCI subdevice results in a kernel warning. sm501-usb sm501-usb: SM501 OHCI sm501-usb sm501-usb: new USB bus registered, assigned bus number 1 WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 ohci_init+0x194/0x2d8 Modules linked in: CPU: 0 PID: 1 Comm: swapper Tainted: G W 4.18.0-rc7-00178-g0b5b1f9a78b5 #1 PC is at ohci_init+0x194/0x2d8 PR is at ohci_init+0x168/0x2d8 PC : 8c27844c SP : 8f81dd94 SR : 40008001 TEA : 29613060 R0 : 00000000 R1 : 00000000 R2 : 00000000 R3 : 00000202 R4 : 8fa98b88 R5 : 8c277e68 R6 : 00000000 R7 : 00000000 R8 : 8f965814 R9 : 8c388100 R10 : 8fa98800 R11 : 8fa98928 R12 : 8c48302c R13 : 8fa98920 R14 : 8c48302c MACH: 00000096 MACL: 0000017c GBR : 00000000 PR : 8c278420 Call trace: [<(ptrval)>] usb_add_hcd+0x1e8/0x6ec [<(ptrval)>] _dev_info+0x0/0x54 [<(ptrval)>] arch_local_save_flags+0x0/0x8 [<(ptrval)>] arch_local_irq_restore+0x0/0x24 [<(ptrval)>] ohci_hcd_sm501_drv_probe+0x114/0x2d8 ... Initialize coherent_dma_mask when creating SM501 subdevices to fix the problem. Fixes: b6d6454fdb66f ("mfd: SM501 core driver") Signed-off-by: Guenter Roeck Signed-off-by: Lee Jones commit 8d5a5ba9a8b93e70f77d7ab6b7d4f015c08a8e7e Author: Matti Vaittinen Date: Fri Aug 3 14:09:12 2018 +0300 mfd: bd71837: Devicetree bindings for ROHM BD71837 PMIC Document devicetree bindings for ROHM BD71837 PMIC MFD. Signed-off-by: Matti Vaittinen Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit 30107fa6908b6c2747ee9100b40af813f99483c3 Author: Matti Vaittinen Date: Fri Aug 3 14:08:14 2018 +0300 mfd: bd71837: Core driver for ROHM BD71837 PMIC ROHM BD71837 PMIC MFD driver providing interrupts and support for three subsystems: - clk - Regulators - input/power-key Signed-off-by: Matti Vaittinen Reviewed-by: Enric Balletbo i Serra Signed-off-by: Lee Jones commit f863ae594d33e57aa12cdde47e767e6e7942ee51 Author: Arnd Bergmann Date: Tue Jul 24 11:35:59 2018 +0200 media: platform: cros-ec-cec: Fix dependency on MFD_CROS_EC Without the MFD driver, we run into a link error: drivers/media/platform/cros-ec-cec/cros-ec-cec.o: In function `cros_ec_cec_transmit': cros-ec-cec.c:(.text+0x474): undefined reference to `cros_ec_cmd_xfer_status' drivers/media/platform/cros-ec-cec/cros-ec-cec.o: In function `cros_ec_cec_set_log_addr': cros-ec-cec.c:(.text+0x60b): undefined reference to `cros_ec_cmd_xfer_status' drivers/media/platform/cros-ec-cec/cros-ec-cec.o: In function `cros_ec_cec_adap_enable': cros-ec-cec.c:(.text+0x77d): undefined reference to `cros_ec_cmd_xfer_status' As we can compile-test all the dependency, the extra '| COMPILE_TEST' is not needed to get the build coverage, and we can simply turn MFD_CROS_EC into a hard dependency to make it build in all configurations. Fixes: cd70de2d356e ("media: platform: Add ChromeOS EC CEC driver") Signed-off-by: Arnd Bergmann Signed-off-by: Lee Jones commit f91e654474d413201ae578820fb63f8a811f6c4e Merge: c715ebeb0303 3dd0f18c70d9 Author: Linus Torvalds Date: Wed Aug 15 22:54:12 2018 -0700 Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull integrity updates from James Morris: "This adds support for EVM signatures based on larger digests, contains a new audit record AUDIT_INTEGRITY_POLICY_RULE to differentiate the IMA policy rules from the IMA-audit messages, addresses two deadlocks due to either loading or searching for crypto algorithms, and cleans up the audit messages" * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: EVM: fix return value check in evm_write_xattrs() integrity: prevent deadlock during digsig verification. evm: Allow non-SHA1 digital signatures evm: Don't deadlock if a crypto algorithm is unavailable integrity: silence warning when CONFIG_SECURITYFS is not enabled ima: Differentiate auditing policy rules from "audit" actions ima: Do not audit if CONFIG_INTEGRITY_AUDIT is not set ima: Use audit_log_format() rather than audit_log_string() ima: Call audit_log_string() rather than logging it untrusted commit c715ebeb0303b196f17376f189ae4e168d98b563 Merge: 04743f89bcad 5da08f7d0169 Author: Linus Torvalds Date: Wed Aug 15 22:51:12 2018 -0700 Merge branch 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull TPM updates from James Morris: - Migrate away from PM runtime as explicit cmdReady/goIdle transactions for every command is a spec requirement. PM runtime adds only a layer of complexity on our case. - tpm_tis drivers can now specify the hwrng quality. - TPM 2.0 code uses now tpm_buf for constructing messages. Jarkko thinks Tomas Winkler has done the same for TPM 1.2, and will start digging those changes from the patchwork in the near future. - Bug fixes and clean ups * 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: ima: Get rid of ima_used_chip and use ima_tpm_chip != NULL instead ima: Use tpm_default_chip() and call TPM functions with a tpm_chip tpm: replace TPM_TRANSMIT_RAW with TPM_TRANSMIT_NESTED tpm: Convert tpm_find_get_ops() to use tpm_default_chip() tpm: Implement tpm_default_chip() to find a TPM chip tpm: rename tpm_chip_find_get() to tpm_find_get_ops() tpm: Allow tpm_tis drivers to set hwrng quality. tpm: Return the actual size when receiving an unsupported command tpm: separate cmd_ready/go_idle from runtime_pm tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) tpm_tis_spi: Pass the SPI IRQ down to the driver tpm: migrate tpm2_get_random() to use struct tpm_buf tpm: migrate tpm2_get_tpm_pt() to use struct tpm_buf tpm: migrate tpm2_probe() to use struct tpm_buf tpm: migrate tpm2_shutdown() to use struct tpm_buf commit 04743f89bcad30a438ef4f38840caddd7978dbaa Merge: 5bae2be4efd5 df6b4e6608ee Author: Linus Torvalds Date: Wed Aug 15 22:49:04 2018 -0700 Merge branch 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull smack updates from James Morris: "Minor fixes from Piotr Sawicki" * 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: Smack: Inform peer that IPv6 traffic has been blocked Smack: Check UDP-Lite and DCCP protocols during IPv6 handling Smack: Fix handling of IPv4 traffic received by PF_INET6 sockets commit 5bae2be4efd557ba3ec18f125d18c546f6b03cd2 Merge: 2b2f2aedba98 bd646104ac5a Author: Linus Torvalds Date: Wed Aug 15 22:47:23 2018 -0700 Merge tag 'jfs-4.19' of git://github.com/kleikamp/linux-shaggy Pull jfs update from David Kleikamp: "Just one jfs patch for 4.19" * tag 'jfs-4.19' of git://github.com/kleikamp/linux-shaggy: jfs: use time64_t for otime commit 6b583a64fd1e019fd01626b46892ebf2361951c5 Author: Heiner Kallweit Date: Wed Sep 27 22:41:26 2017 +0200 rtc: ds1307: simplify hwmon config We don't have to define an extra config symbol, IS_REACHABLE does what we need. And having this config symbol just to save the few bytes of hwmon support on non-DS3231 chips isn't worth it IMO (especially as the symbol is set per default). Signed-off-by: Heiner Kallweit Signed-off-by: Alexandre Belloni commit 2b2f2aedba985108cbc92a761ac0d9fc4c774616 Merge: 72f02ba66bd8 f5580d0f8bf6 Author: Linus Torvalds Date: Wed Aug 15 22:40:03 2018 -0700 Merge tag 'gfs2-4.19.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Andreas Gruenbacher: - iomap support for buffered writes and for direct I/O - two patches that reduce the size of struct gfs2_inode - lots of fixes and cleanups * tag 'gfs2-4.19.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: (25 commits) gfs2: eliminate update_rgrp_lvb_unlinked gfs2: Fix gfs2_testbit to use clone bitmaps gfs2: Get rid of gfs2_ea_strlen gfs2: cleanup: call gfs2_rgrp_ondisk2lvb from gfs2_rgrp_out gfs2: Special-case rindex for gfs2_grow GFS2: rgrp free blocks used incorrectly gfs2: remove redundant variable 'moved' gfs2: use iomap_readpage for blocksize == PAGE_SIZE gfs2: Use iomap for stuffed direct I/O reads gfs2: fallocate_chunk: Always initialize struct iomap GFS2: Fix recovery issues for spectators fs: gfs2: Adding new return type vm_fault_t gfs2: using posix_acl_xattr_size instead of posix_acl_to_xattr gfs2: Don't reject a supposedly full bitmap if we have blocks reserved gfs2: Eliminate redundant ip->i_rgd gfs2: Stop messing with ip->i_rgd in the rlist code gfs2: Remove gfs2_write_{begin,end} gfs2: iomap direct I/O support gfs2: gfs2_extent_length cleanup gfs2: iomap buffered write support ... commit 72f02ba66bd83b54054da20eae550123de84da6f Merge: db06f826ec12 51372570ac3c Author: Linus Torvalds Date: Wed Aug 15 22:06:26 2018 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "This is mostly updates to the usual drivers: mpt3sas, lpfc, qla2xxx, hisi_sas, smartpqi, megaraid_sas, arcmsr. In addition, with the continuing absence of Nic we have target updates for tcmu and target core (all with reviews and acks). The biggest observable change is going to be that we're (again) trying to switch to mulitqueue as the default (a user can still override the setting on the kernel command line). Other major core stuff is the removal of the remaining Microchannel drivers, an update of the internal timers and some reworks of completion and result handling" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (203 commits) scsi: core: use blk_mq_run_hw_queues in scsi_kick_queue scsi: ufs: remove unnecessary query(DM) UPIU trace scsi: qla2xxx: Fix issue reported by static checker for qla2x00_els_dcmd2_sp_done() scsi: aacraid: Spelling fix in comment scsi: mpt3sas: Fix calltrace observed while running IO & reset scsi: aic94xx: fix an error code in aic94xx_init() scsi: st: remove redundant pointer STbuffer scsi: qla2xxx: Update driver version to 10.00.00.08-k scsi: qla2xxx: Migrate NVME N2N handling into state machine scsi: qla2xxx: Save frame payload size from ICB scsi: qla2xxx: Fix stalled relogin scsi: qla2xxx: Fix race between switch cmd completion and timeout scsi: qla2xxx: Fix Management Server NPort handle reservation logic scsi: qla2xxx: Flush mailbox commands on chip reset scsi: qla2xxx: Fix unintended Logout scsi: qla2xxx: Fix session state stuck in Get Port DB scsi: qla2xxx: Fix redundant fc_rport registration scsi: qla2xxx: Silent erroneous message scsi: qla2xxx: Prevent sysfs access when chip is down scsi: qla2xxx: Add longer window for chip reset ... commit db06f826ec12bf0701ea7fc0a3c0aa00b84417c8 Merge: 6de4c691eab8 ac7da1b787d9 Author: Linus Torvalds Date: Wed Aug 15 21:41:21 2018 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "The new and exciting feature this time around is in the clk core. We've added duty cycle support to the clk API so that clk signal duty cycle ratios can be adjusted while taking into account things like clk dividers and clk tree hierarchy. So far only one SoC has implemented support for this, but I expect there will be more to come in the future. Outside of the core, we have the usual pile of clk driver updates and additions. The Amlogic meson driver got the most lines in the diffstat this time around because it added support for a whole bunch of hardware and duty cycle configuration. After that the Rockchip PX30, Qualcomm SDM845, and Renesas SoC drivers fill in a majority of the diff. We're left with the collection of non-critical fixes after that. Overall it looks pretty quiet this time. Core: - Clk duty cycle support - Proper CLK_SET_RATE_GATE support throughout the tree New Drivers: - Actions Semi Owl series S700 SoC clk driver - Qualcomm SDM845 display clock controller - i.MX6SX ocram_s clk support - Uniphier NAND, USB3 PHY, and SPI clk support - Qualcomm RPMh clk driver - i.MX7D mailbox clk support - Maxim 9485 Programmable Clock Generator - expose 32 kHz PLL on PXA SoCs - imx6sll GPIO clk gate support - Atmel at91 I2S audio clk support - SI544/SI514 clk on/off support - i.MX6UL GPIO clock gates in CCM CCGR - Renesas Crypto Engine clocks on R-Car H3 - Renesas clk support for the new RZ/N1D SoC - Allwinner A64 display engine clock support - support for Rockchip's PX30 SoC - Amlogic Meson axg PCIe and audio clocks - Amlogic Meson GEN CLK on gxbb, gxl and axg Updates: - remove an unused variable from Exynos4412 ISP driver - fix a thinko bug in SCMI clk division logic - add missing of_node_put()s in some i.MX clk drivers - Tegra SDMMC clk jitter improvements with high speed signaling modes - SPDX tagging for qcom and cs2000-cp drivers - stop leaking con ids in __clk_put() - fix a corner case in fixed factor clk probing where node is in DT but parent clk is registered much later - Marvell Armada 3700 clk_pm_cpu_get_parent() had an invalid return value - i.MX clk init arrays removed in place of CLK_IS_CRITICAL - convert to CLK_IS_CRITICAL for i.MX51/53 driver - fix Tegra BPMP driver oops when xlating a NULL clk - proper default configuration for vic03 and vde clks on Tegra124 - mark Tegra memory controller clks as critical - fix array bounds clamp in Tegra's emc determine_rate() op - Ingenic i2s bit update and allow UDC clk to gate - fix name of aspeed SDC clk define to have only one 'CLK' - fix i.MX6QDL video clk parent - critical clk markings for qcom SDM845 - fix Stratix10 mpu_free_clk and sdmmc_free_clk parents - mark Rockchip's pclk_rkpwm_pmu as critical clock, due to it supplying the pwm used to drive the logic supply of the rk3399 core" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (85 commits) clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 clk: cs2000-cp: convert to SPDX identifiers clk: scmi: Fix the rounding of clock rate clk: qcom: Add display clock controller driver for SDM845 clk: mvebu: armada-37xx-periph: Remove unused var num_parents clk: samsung: Remove unused mout_user_aclk400_mcuisp_p4x12 variable clk: actions: Add S700 SoC clock support dt-bindings: clock: Add S700 support for Actions Semi Soc's clk: actions: Add missing REGMAP_MMIO dependency clk: uniphier: add clock frequency support for SPI clk: uniphier: add more USB3 PHY clocks clk: uniphier: add NAND 200MHz clock clk: tegra: make sdmmc2 and sdmmc4 as sdmmc clocks clk: tegra: Add sdmmc mux divider clock clk: tegra: Refactor fractional divider calculation clk: tegra: Fix includes required by fence_udelay() clk: imx6sll: fix missing of_node_put() clk: imx6ul: fix missing of_node_put() clk: imx: add ocram_s clock for i.mx6sx clk: mvebu: armada-37xx-periph: Fix wrong return value in get_parent ... commit 6de4c691eab8f421e34c5250f63bf3f477d30eec Merge: c1c2ad82c772 a5ec96ddfd55 Author: Linus Torvalds Date: Wed Aug 15 21:35:38 2018 -0700 Merge tag 'gpio-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for the v4.19 kernel cycle. I don't know if anything in particular stands out. Maybe the Aspeed coprocessor thing from Benji: Aspeed is doing baseboard management chips (BMC's) for servers etc. These Aspeed's are ARM processors that exist inside (I guess) Intel servers, and they are moving forward to using mainline Linux in those. This is one of the pieces of the puzzle to achive that. They are doing OpenBMC, it's pretty cool: https://lwn.net/Articles/683320/ Summary: Core changes: - Add a new API for explicitly naming GPIO consumers, when needed. - Don't let userspace set values on input lines. While we do not think anyone would do this crazy thing we better plug the hole before someone uses it and think it's a nifty feature. - Avoid calling chip->request() for unused GPIOs. New drivers/subdrivers: - The Mediatek MT7621 is supported which is a big win for OpenWRT and similar router distributions using this chip, as it seems every major router manufacturer on the planet has made products using this chip: https://wikidevi.com/wiki/MediaTek_MT7621 - The Tegra 194 is now supported. - The IT87 driver now supports IT8786E and IT8718F super-IO chips. - Add support for Rockchip RK3328 in the syscon GPIO driver. Driver changes: - Handle the get/set_multiple() properly on MMIO chips with inverted direction registers. We didn't have this problem until a new chip appear that has get/set registers AND inverted direction bits, OK now we handle it. - A patch series making more error codes percolate upward properly for different errors on gpiochip_lock_as_irq(). - Get/set multiple for the OMAP driver, accelerating these multiple line operations if possible. - A coprocessor interface for the Aspeed driver. Sometimes a few GPIO lines need to be grabbed by a co-processor for doing automated tasks, sometimes they are available as GPIO lines. By adding an explicit API in this driver we make it possible for the two line consumers to coexist. (This work was made available on the ib-aspeed branch, which may be appearing in other pull requests.) - Implemented .get_direction() and open drain in the SCH311x driver. - Continuing cleanup of included headers in GPIO drivers" * tag 'gpio-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (80 commits) gpio: it87: Add support for IT8613 gpio: it87: add support for IT8718F Super I/O. gpiolib: Avoid calling chip->request() for unused gpios gpio: tegra: Include the right header gpio: mmio: Fix up inverted direction registers gpio: xilinx: Use the right include gpio: timberdale: Include the right header gpio: tb10x: Use the right include gpiolib: Fix of_node inconsistency gpio: vr41xx: Bail out on gpiochip_lock_as_irq() error gpio: uniphier: Bail out on gpiochip_lock_as_irq() error gpio: xgene-sb: Don't shadow error code of gpiochip_lock_as_irq() gpio: em: Don't shadow error code of gpiochip_lock_as_irq() gpio: dwapb: Don't shadow error code of gpiochip_lock_as_irq() gpio: bcm-kona: Don't shadow error code of gpiochip_lock_as_irq() gpiolib: Don't shadow error code of gpiochip_lock_as_irq() gpio: syscon: rockchip: add GRF GPIO support for rk3328 gpio: omap: Add get/set_multiple() callbacks gpio: pxa: remove set but not used variable 'gpio_offset' gpio-it87: add support for IT8786E Super I/O ... commit c1c2ad82c772966d3cdb9a4852329fa2cf71853a Merge: 99a2c789ddeb 190bd6e98afc Author: Linus Torvalds Date: Wed Aug 15 21:31:19 2018 -0700 Merge tag 'edac_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp Pull EDAC updates from Borislav Petkov: - Add support for systems with PCI segmented buses to sb_edac, by Masayoshi Mizuma - The usual pile of fixes and cleanups * tag 'edac_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC, sb_edac: Add support for systems with segmented PCI buses EDAC, thunderx: Remove VLA usage EDAC, i7core: Fix memleaks and use-after-free on probe and remove EDAC: Fix memleak in module init error path EDAC, altera: Fix an error handling path in altr_s10_sdram_probe() commit 99a2c789ddeb703cf7b0a3d889ab1a25cf4cbbaf Merge: fa3b39cdafbf 9a47249d444d Author: Linus Torvalds Date: Wed Aug 15 21:16:02 2018 -0700 Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random Pull random updates from Ted Ts'o: "Some changes to trust cpu-based hwrng (such as RDRAND) for initializing hashed pointers and (optionally, controlled by a config option) to initialize the CRNG to avoid boot hangs" * tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random: random: Make crng state queryable random: remove preempt disabled region random: add a config option to trust the CPU's hwrng vsprintf: Add command line option debug_boot_weak_hash vsprintf: Use hw RNG for ptr_key random: Return nbytes filled from hw RNG random: Fix whitespace pre random-bytes work commit 84fe4cc09abc1a5ef3a282db3ed10f4d3f1e6a0b Author: Eric W. Biederman Date: Wed Aug 15 21:20:46 2018 -0500 signal: Don't send signals to tasks that don't exist Recently syzbot reported crashes in send_sigio_to_task and send_sigurg_to_task in linux-next. Despite finding a reproducer syzbot apparently did not bisected this or otherwise track down the offending commit in linux-next. I happened to see this report and examined the code because I had recently changed these functions as part of making PIDTYPE_TGID a real pid type so that fork would does not need to restart when receiving a signal. By examination I see that I spotted a bug in the code that could explain the reported crashes. When I took Oleg's suggestion and optimized send_sigurg and send_sigio to only send to a single task when type is PIDTYPE_PID or PIDTYPE_TGID I failed to handle pids that no longer point to tasks. The macro do_each_pid_task simply iterates for zero iterations. With pid_task an explicit NULL test is needed. Update the code to include the missing NULL test. Fixes: 019191342fec ("signal: Use PIDTYPE_TGID to clearly store where file signals will be sent") Reported-by: syzkaller-bugs@googlegroups.com Signed-off-by: "Eric W. Biederman" commit fa3b39cdafbfd5d9b1d064f5cf63cf0314f1d070 Merge: 25ca1d74c673 16b7db4c8150 Author: Linus Torvalds Date: Wed Aug 15 20:38:23 2018 -0700 Merge tag 'clang-format-for-linus-v4.19' of git://github.com/ojeda/linux Pull clang-format updates from Miguel Ojeda: "Two improvements for .clang-format: - Set IndentWrappedFunctionNames false (Jason Gunthorpe) - Add MAINTAINERS entry (Miguel Ojeda)" * tag 'clang-format-for-linus-v4.19' of git://github.com/ojeda/linux: MAINTAINERS: Add .clang-format entry clang-format: Set IndentWrappedFunctionNames false commit d983c89cc96a87db0c00821e81aa3d8296c12225 Author: Vasily Gorbik Date: Mon Aug 6 15:17:47 2018 +0200 s390/ftrace: Add -mfentry and -mnop-mcount support Utilize -mfentry and -mnop-mcount gcc options together with -mrecord-mcount to get compiler generated calls to the profiling functions as nops which are compatible with current -mhotpatch=0,3 approach. At the same time -mrecord-mcount enables __mcount_loc section generation by the compiler which allows to avoid using scripts/recordmcount.pl script. Link: http://lkml.kernel.org/r/patch-4.thread-aa7b8d.git-aa7b8dbf236f.your-ad-here.call-01533557518-ext-9465@work.hours Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Steven Rostedt (VMware) commit 2f4df0017baedd535254d987c6b10f855f1fb11f Author: Vasily Gorbik Date: Mon Aug 6 15:17:46 2018 +0200 tracing: Add -mcount-nop option support -mcount-nop gcc option generates the calls to the profiling functions as nops which allows to avoid patching mcount jump with NOP instructions initially. -mcount-nop gcc option will be activated if platform selects HAVE_NOP_MCOUNT and gcc actually supports it. In addition to that CC_USING_NOP_MCOUNT is defined and could be used by architectures to adapt ftrace patching behavior. Link: http://lkml.kernel.org/r/patch-3.thread-aa7b8d.git-e02ed2dc082b.your-ad-here.call-01533557518-ext-9465@work.hours Signed-off-by: Vasily Gorbik Signed-off-by: Steven Rostedt (VMware) commit 07d0408120216b60625c9a5b8012d1c3a907984d Author: Vasily Gorbik Date: Mon Aug 6 15:17:44 2018 +0200 tracing: Avoid calling cc-option -mrecord-mcount for every Makefile Currently if CONFIG_FTRACE_MCOUNT_RECORD is enabled -mrecord-mcount compiler flag support is tested for every Makefile. Top 4 cc-option usages: 511 -mrecord-mcount 11 -fno-stack-protector 9 -Wno-override-init 2 -fsched-pressure To address that move cc-option from scripts/Makefile.build to top Makefile and export CC_USING_RECORD_MCOUNT to be used in original place. While doing that also add -mrecord-mcount to CC_FLAGS_FTRACE (if gcc actually supports it). Link: http://lkml.kernel.org/r/patch-2.thread-aa7b8d.git-de935bace15a.your-ad-here.call-01533557518-ext-9465@work.hours Acked-by: Andi Kleen Signed-off-by: Vasily Gorbik Signed-off-by: Steven Rostedt (VMware) commit f28bc3c32c059ab4d13f52155fabd3e20f477f65 Author: Vasily Gorbik Date: Mon Aug 6 15:17:42 2018 +0200 tracing: Handle CC_FLAGS_FTRACE more accurately CC_FLAGS_FTRACE is exported and later used to remove ftrace relevant build flags from files which should be built without ftrace support. For that reason add -mfentry to CC_FLAGS_FTRACE as well. That fixes a problem with vdso32 build on s390, where -mfentry could not be used together with -m31 flag. At the same time flags like -pg and -mfentry are not relevant for asm files, so avoid adding them to KBUILD_AFLAGS. Introduce CC_FLAGS_USING instead of CC_USING_FENTRY to collect -DCC_USING_FENTRY (and future alike) which are relevant for both KBUILD_CFLAGS and KBUILD_AFLAGS. Link: http://lkml.kernel.org/r/patch-1.thread-aa7b8d.git-42971afe87de.your-ad-here.call-01533557518-ext-9465@work.hours Signed-off-by: Vasily Gorbik Signed-off-by: Steven Rostedt (VMware) commit 25ca1d74c6731d9d5f8e660195235050252a33ef Merge: 70b20dd7f897 ada953de4486 Author: Linus Torvalds Date: Wed Aug 15 19:23:24 2018 -0700 Merge tag 'auxdisplay-for-linus-v4.19' of git://github.com/ojeda/linux Pull auxdisplay updates from Miguel Ojeda: "Two cleanups for char_lcd: - simplify getting .drvdata (Wolfram Sang) - delete mdelay in long_sleep (Jia-Ju Bai)" * tag 'auxdisplay-for-linus-v4.19' of git://github.com/ojeda/linux: auxdisplay: simplify getting .drvdata auxdisplay: charlcd: delete mdelay in long_sleep commit 70b20dd7f897c6c14ab9e0d8400aed520ab5f09b Author: Linus Torvalds Date: Wed Aug 15 19:08:10 2018 -0700 ALSA: update dell-wmi mic-mute registration to new world order Commit c647f806b8c2 ("ALSA: hda - Allow multiple ADCs for mic mute LED controls") changed the return value of the snd_hda_gen_add_micmute_led() without actually updating the callers. Admittedly, almost no callers actually cared about the return value. But one call site very much did: the Dell wmi code. It would see the registration return zero, which _used_ to mean "failed" but now means "success", and clear the dell_micmute_led_set_func pointer. End result: the successful registration would end up calling the Dell code that thought it had all failed, and call through a NULL pointer. To make matters worse, it ends up being a tail-call, and with the retpoline sequence you don't even see the caller (dell_micmute_update()) in the stack trace, so the error ended up way less obvious than it should have been. Fixes: c647f806b8c2 "ALSA: hda - Allow multiple ADCs for mic mute LED controls" Cc: Takashi Iwai Signed-off-by: Linus Torvalds commit 71f3a82fab1b631ae9cb1feb677f498d4ca5007d Merge: 54dbe75bbf1e da2048b7348a Author: Linus Torvalds Date: Wed Aug 15 18:29:14 2018 -0700 Merge tag 'media/v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - new Socionext MN88443x ISDB-S/T demodulator driver: mn88443x - new sensor drivers: ak7375, ov2680 and rj54n1cb0c - an old soc-camera sensor driver converted to the V4L2 framework: mt9v111 - a new Voice-Coil Motor (VCM) driver: dw9807-vcm - some cleanups at cx25821, removing legacy unused code - some improvements at ddbridge driver - new platform driver: vicodec - some DVB API cleanups, removing ioctls and compat code for old out-of-tree drivers that were never merged upstream - improvements at DVB core to support frontents that support both Satellite and non-satellite delivery systems - got rid of the unused VIDIOC_RESERVED V4L2 ioctl - some cleanups/improvements at gl861 ISDB driver - several improvements on ov772x, ov7670 and ov5640, imx274, ov5645, and smiapp sensor drivers - fixes at em28xx to support dual TS devices - some cleanups at V4L2/VB2 locking logic - some API improvements at media controller - some cec core and drivers improvements - some uvcvideo improvements - some improvements at platform drivers: stm32-dcmi, rcar-vin, coda, reneseas-ceu, imx, vsp1, venus, camss - lots of other cleanups and fixes * tag 'media/v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (406 commits) Revert "media: vivid: shut up warnings due to a non-trivial logic" siano: get rid of an unused return code for debugfs register media: isp: fix a warning about a wrong struct initializer media: radio-wl1273: fix return code for the polling routine media: s3c-camif: fix return code for the polling routine media: saa7164: fix return codes for the polling routine media: exynos-gsc: fix return code if mutex was interrupted media: mt9v111: Fix build error with no VIDEO_V4L2_SUBDEV_API media: xc4000: get rid of uneeded casts media: drxj: get rid of uneeded casts media: tuner-xc2028: don't use casts for printing sizes media: cleanup fall-through comments media: vivid: shut up warnings due to a non-trivial logic media: rtl28xxu: be sure that it won't go past the array size media: mt9v111: avoid going past the buffer media: vsp1_dl: add a description for cmdpool field media: sta2x11: add a missing parameter description media: v4l2-mem2mem: add descriptions to MC fields media: i2c: fix warning in Aptina MT9V111 media: imx: shut up a false positive warning ... commit 54dbe75bbf1e189982516de179147208e90b5e45 Merge: dafa5f6577a9 557ce95051c8 Author: Linus Torvalds Date: Wed Aug 15 17:39:07 2018 -0700 Merge tag 'drm-next-2018-08-15' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "This is the main drm pull request for 4.19. Rob has some new hardware support for new qualcomm hw that I'll send along separately. This has the display part of it, the remaining pull is for the acceleration engine. This also contains a wound-wait/wait-die mutex rework, Peter has acked it for merging via my tree. Otherwise mostly the usual level of activity. Summary: core: - Wound-wait/wait-die mutex rework - Add writeback connector type - Add "content type" property for HDMI - Move GEM bo to drm_framebuffer - Initial gpu scheduler documentation - GPU scheduler fixes for dying processes - Console deferred fbcon takeover support - Displayport support for CEC tunneling over AUX panel: - otm8009a panel driver fixes - Innolux TV123WAM and G070Y2-L01 panel driver - Ilitek ILI9881c panel driver - Rocktech RK070ER9427 LCD - EDT ETM0700G0EDH6 and EDT ETM0700G0BDH6 - DLC DLC0700YZG-1 - BOE HV070WSA-100 - newhaven, nhd-4.3-480272ef-atxl LCD - DataImage SCF0700C48GGU18 - Sharp LQ035Q7DB03 - p079zca: Refactor to support multiple panels tinydrm: - ILI9341 display panel New driver: - vkms - virtual kms driver to testing. i915: - Icelake: Display enablement DSI support IRQ support Powerwell support - GPU reset fixes and improvements - Full ppgtt support refactoring - PSR fixes and improvements - Execlist improvments - GuC related fixes amdgpu: - Initial amdgpu documentation - JPEG engine support on VCN - CIK uses powerplay by default - Move to using core PCIE functionality for gens/lanes - DC/Powerplay interface rework - Stutter mode support for RV - Vega12 Powerplay updates - GFXOFF fixes - GPUVM fault debugging - Vega12 GFXOFF - DC improvements - DC i2c/aux changes - UVD 7.2 fixes - Powerplay fixes for Polaris12, CZ/ST - command submission bo_list fixes amdkfd: - Raven support - Power management fixes udl: - Cleanups and fixes nouveau: - misc fixes and cleanups. msm: - DPU1 support display controller in sdm845 - GPU coredump support. vmwgfx: - Atomic modesetting validation fixes - Support for multisample surfaces armada: - Atomic modesetting support completed. exynos: - IPPv2 fixes - Move g2d to component framework - Suspend/resume support cleanups - Driver cleanups imx: - CSI configuration improvements - Driver cleanups - Use atomic suspend/resume helpers - ipu-v3 V4L2 XRGB32/XBGR32 support pl111: - Add Nomadik LCDC variant v3d: - GPU scheduler jobs management sun4i: - R40 display engine support - TCON TOP driver mediatek: - MT2712 SoC support rockchip: - vop fixes omapdrm: - Workaround for DRA7 errata i932 - Fix mm_list locking mali-dp: - Writeback implementation PM improvements - Internal error reporting debugfs tilcdc: - Single fix for deferred probing hdlcd: - Teardown fixes tda998x: - Converted to a bridge driver. etnaviv: - Misc fixes" * tag 'drm-next-2018-08-15' of git://anongit.freedesktop.org/drm/drm: (1506 commits) drm/amdgpu/sriov: give 8s for recover vram under RUNTIME drm/scheduler: fix param documentation drm/i2c: tda998x: correct PLL divider calculation drm/i2c: tda998x: get rid of private fill_modes function drm/i2c: tda998x: move mode_valid() to bridge drm/i2c: tda998x: register bridge outside of component helper drm/i2c: tda998x: cleanup from previous changes drm/i2c: tda998x: allocate tda998x_priv inside tda998x_create() drm/i2c: tda998x: convert to bridge driver drm/scheduler: fix timeout worker setup for out of order job completions drm/amd/display: display connected to dp-1 does not light up drm/amd/display: update clk for various HDMI color depths drm/amd/display: program display clock on cache match drm/amd/display: Add NULL check for enabling dp ss drm/amd/display: add vbios table check for enabling dp ss drm/amd/display: Don't share clk source between DP and HDMI drm/amd/display: Fix DP HBR2 Eye Diagram Pattern on Carrizo drm/amd/display: Use calculated disp_clk_khz value for dce110 drm/amd/display: Implement custom degamma lut on dcn drm/amd/display: Destroy aux_engines only once ... commit dafa5f6577a9eecd2941add553d1672c30b02364 Merge: 9a76aba02a37 22240df7ac6d Author: Linus Torvalds Date: Wed Aug 15 16:01:47 2018 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - Fix dcache flushing crash in skcipher. - Add hash finup self-tests. - Reschedule during speed tests. Algorithms: - Remove insecure vmac and replace it with vmac64. - Add public key verification for DH/ECDH. Drivers: - Decrease priority of sha-mb on x86. - Improve NEON latency/throughput on ARM64. - Add md5/sha384/sha512/des/3des to inside-secure. - Support eip197d in inside-secure. - Only register algorithms supported by the host in virtio. - Add cts and remove incompatible cts1 from ccree. - Add hisilicon SEC security accelerator driver. - Replace msm hwrng driver with qcom pseudo rng driver. Misc: - Centralize CRC polynomials" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (121 commits) crypto: arm64/ghash-ce - implement 4-way aggregation crypto: arm64/ghash-ce - replace NEON yield check with block limit crypto: hisilicon - sec_send_request() can be static lib/mpi: remove redundant variable esign crypto: arm64/aes-ce-gcm - don't reload key schedule if avoidable crypto: arm64/aes-ce-gcm - implement 2-way aggregation crypto: arm64/aes-ce-gcm - operate on two input blocks at a time crypto: dh - make crypto_dh_encode_key() make robust crypto: dh - fix calculating encoded key size crypto: ccp - Check for NULL PSP pointer at module unload crypto: arm/chacha20 - always use vrev for 16-bit rotates crypto: ccree - allow bigger than sector XTS op crypto: ccree - zero all of request ctx before use crypto: ccree - remove cipher ivgen left overs crypto: ccree - drop useless type flag during reg crypto: ablkcipher - fix crash flushing dcache in error path crypto: blkcipher - fix crash flushing dcache in error path crypto: skcipher - fix crash flushing dcache in error path crypto: skcipher - remove unnecessary setting of walk->nbytes crypto: scatterwalk - remove scatterwalk_samebuf() ... commit 9a76aba02a37718242d7cdc294f0a3901928aa57 Merge: 0a957467c5fd 26a1ccc6c117 Author: Linus Torvalds Date: Wed Aug 15 15:04:25 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next Pull networking updates from David Miller: "Highlights: - Gustavo A. R. Silva keeps working on the implicit switch fallthru changes. - Support 802.11ax High-Efficiency wireless in cfg80211 et al, From Luca Coelho. - Re-enable ASPM in r8169, from Kai-Heng Feng. - Add virtual XFRM interfaces, which avoids all of the limitations of existing IPSEC tunnels. From Steffen Klassert. - Convert GRO over to use a hash table, so that when we have many flows active we don't traverse a long list during accumluation. - Many new self tests for routing, TC, tunnels, etc. Too many contributors to mention them all, but I'm really happy to keep seeing this stuff. - Hardware timestamping support for dpaa_eth/fsl-fman from Yangbo Lu. - Lots of cleanups and fixes in L2TP code from Guillaume Nault. - Add IPSEC offload support to netdevsim, from Shannon Nelson. - Add support for slotting with non-uniform distribution to netem packet scheduler, from Yousuk Seung. - Add UDP GSO support to mlx5e, from Boris Pismenny. - Support offloading of Team LAG in NFP, from John Hurley. - Allow to configure TX queue selection based upon RX queue, from Amritha Nambiar. - Support ethtool ring size configuration in aquantia, from Anton Mikaev. - Support DSCP and flowlabel per-transport in SCTP, from Xin Long. - Support list based batching and stack traversal of SKBs, this is very exciting work. From Edward Cree. - Busyloop optimizations in vhost_net, from Toshiaki Makita. - Introduce the ETF qdisc, which allows time based transmissions. IGB can offload this in hardware. From Vinicius Costa Gomes. - Add parameter support to devlink, from Moshe Shemesh. - Several multiplication and division optimizations for BPF JIT in nfp driver, from Jiong Wang. - Lots of prepatory work to make more of the packet scheduler layer lockless, when possible, from Vlad Buslov. - Add ACK filter and NAT awareness to sch_cake packet scheduler, from Toke Høiland-Jørgensen. - Support regions and region snapshots in devlink, from Alex Vesker. - Allow to attach XDP programs to both HW and SW at the same time on a given device, with initial support in nfp. From Jakub Kicinski. - Add TLS RX offload and support in mlx5, from Ilya Lesokhin. - Use PHYLIB in r8169 driver, from Heiner Kallweit. - All sorts of changes to support Spectrum 2 in mlxsw driver, from Ido Schimmel. - PTP support in mv88e6xxx DSA driver, from Andrew Lunn. - Make TCP_USER_TIMEOUT socket option more accurate, from Jon Maxwell. - Support for templates in packet scheduler classifier, from Jiri Pirko. - IPV6 support in RDS, from Ka-Cheong Poon. - Native tproxy support in nf_tables, from Máté Eckl. - Maintain IP fragment queue in an rbtree, but optimize properly for in-order frags. From Peter Oskolkov. - Improvde handling of ACKs on hole repairs, from Yuchung Cheng" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1996 commits) bpf: test: fix spelling mistake "REUSEEPORT" -> "REUSEPORT" hv/netvsc: Fix NULL dereference at single queue mode fallback net: filter: mark expected switch fall-through xen-netfront: fix warn message as irq device name has '/' cxgb4: Add new T5 PCI device ids 0x50af and 0x50b0 net: dsa: mv88e6xxx: missing unlock on error path rds: fix building with IPV6=m inet/connection_sock: prefer _THIS_IP_ to current_text_addr net: dsa: mv88e6xxx: bitwise vs logical bug net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd() ieee802154: hwsim: using right kind of iteration net: hns3: Add vlan filter setting by ethtool command -K net: hns3: Set tx ring' tc info when netdev is up net: hns3: Remove tx ring BD len register in hns3_enet net: hns3: Fix desc num set to default when setting channel net: hns3: Fix for phy link issue when using marvell phy driver net: hns3: Fix for information of phydev lost problem when down/up net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero net: hns3: Add support for serdes loopback selftest bnxt_en: take coredump_record structure off stack ... commit a1ceeca679dccc492235f0f629d9e9f7b3d51ca8 Author: Gal Pressman Date: Thu Aug 9 22:00:47 2018 +0300 RDMA/hns: Fix usage of bitmap allocation functions return values hns bitmap allocation functions return 0 on success and -1 on failure. Callers of these functions wrongly used their return value as an errno, fix that by making a proper conversion. Fixes: a598c6f4c5a8 ("IB/hns: Simplify function of pd alloc and qp alloc") Signed-off-by: Gal Pressman Acked-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 0a957467c5fd46142bc9c52758ffc552d4c5e2f7 Author: Guenter Roeck Date: Wed Aug 15 13:22:27 2018 -0700 x86: i8259: Add missing include file i8259.h uses inb/outb and thus needs to include asm/io.h to avoid the following build error, as seen with x86_64:defconfig and CONFIG_SMP=n. In file included from drivers/rtc/rtc-cmos.c:45:0: arch/x86/include/asm/i8259.h: In function 'inb_pic': arch/x86/include/asm/i8259.h:32:24: error: implicit declaration of function 'inb' arch/x86/include/asm/i8259.h: In function 'outb_pic': arch/x86/include/asm/i8259.h:45:2: error: implicit declaration of function 'outb' Reported-by: Sebastian Gottschall Suggested-by: Sebastian Gottschall Fixes: 447ae3166702 ("x86: Don't include linux/irq.h from asm/hardirq.h") Signed-off-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 4795ac626a2fe5ce99ff788080ace343faf4c886 Merge: 6209c285e7a5 7590ebb8b456 Author: Rodrigo Vivi Date: Wed Aug 15 13:42:31 2018 -0700 Merge tag 'gvt-next-fixes-2018-08-14' of https://github.com/intel/gvt-linux into drm-intel-next-fixes gvt-next-fixes-2018-08-14 - Fix an error code in gvt_dma_map_page() (Dan) - Fix off by one error in intel_vgpu_write_fence() (Dan) - Fix potential Spectre v1 (Gustavo) - Fix workload free in vgpu release (Henry) - Fix cleanup sequence in intel_gvt_clean_device (Henry) - dmabuf mutex init place fix (Henry) - possible memory leak in intel_vgpu_ioctl() err path (Yi) - return error on cmd access check failure (Yan) Signed-off-by: Rodrigo Vivi From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20180814073140.GJ22630@zhen-hp.sh.intel.com commit 6209c285e7a5e68dbcdf8fd2456c6dd68433806b Author: Jani Nikula Date: Tue Aug 14 09:00:01 2018 +0300 drm/i915: set DP Main Stream Attribute for color range on DDI platforms Since Haswell we have no color range indication either in the pipe or port registers for DP. Instead, there's a separate register for setting the DP Main Stream Attributes (MSA) directly. The MSA register definition makes no references to colorimetry, just a vague reference to the DP spec. The connection to the color range was lost. Apparently we've failed to set the proper MSA bit for limited, or CEA, range ever since the first DDI platforms. We've started setting other MSA parameters since commit dae847991a43 ("drm/i915: add intel_ddi_set_pipe_settings"). Without the crucial bit of information, the DP sink has no way of knowing the source is actually transmitting limited range RGB, leading to "washed out" colors. With the colorimetry information, compliant sinks should be able to handle the limited range properly. Native (i.e. non-LSPCON) HDMI was not affected because we do pass the color range via AVI infoframes. Though not the root cause, the problem was made worse for DDI platforms with commit 55bc60db5988 ("drm/i915: Add "Automatic" mode for the "Broadcast RGB" property"), which selects limited range RGB automatically based on the mode, as per the DP, HDMI and CEA specs. After all these years, the fix boils down to flipping one bit. [Per testing reports, this fixes DP sinks, but not the LSPCON. My educated guess is that the LSPCON fails to turn the CEA range MSA into AVI infoframes for HDMI.] Reported-by: Michał Kopeć Reported-by: N. W. Reported-by: Nicholas Stommel Reported-by: Tom Yan Tested-by: Nicholas Stommel References: https://bugs.freedesktop.org/show_bug.cgi?id=100023 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107476 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94921 Cc: Paulo Zanoni Cc: Rodrigo Vivi Cc: Ville Syrjälä Cc: # v3.9+ Reviewed-by: Rodrigo Vivi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180814060001.18224-1-jani.nikula@intel.com (cherry picked from commit dc5977da99ea28094b8fa4e9bacbd29bedc41de5) Signed-off-by: Rodrigo Vivi commit 3012ea60c57dbdf21206c7e787d6d0cde76a18a7 Author: Chris Wilson Date: Thu Aug 9 07:34:49 2018 +0100 drm/i915/selftests: Hold rpm for unparking The call to i915_gem_unpark() checks that we hold a rpm wakeref before taking a long term wakeref for i915->gt.awake. We should therefore make sure we do hold the wakeref when directly calling unpark to disable the retire worker. Fixes: 932cac10c8fb ("drm/i915/selftests: Prevent background reaping of active objects") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180809063449.4474-1-chris@chris-wilson.co.uk (cherry picked from commit 7b5ee80a5da3ea44c5abff48e3621135ae9d8177) Signed-off-by: Rodrigo Vivi commit 3af71f649d22f359790b4032446456a967a81742 Author: Chris Wilson Date: Wed Aug 8 22:08:42 2018 +0100 drm/i915: Restore user forcewake domains across suspend On suspend, we cancel the automatic forcewake and clear all other sources of forcewake so the machine can sleep before we do suspend. However, we expose the forcewake to userspace (only via debugfs, but nevertheless we do) and want to restore that upon resume or else our accounting will be off and we may not acquire the forcewake before we use it. So record which domains we cleared on suspend and reacquire them early on resume. v2: Hold the spinlock to appease our sanitychecks v3: s/fw_domains_user/fw_domains_saved/ to convey intent more clearly Reported-by: Imre Deak Fixes: b8473050805f ("drm/i915: Fix forcewake active domain tracking") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Cc: Imre Deak Reviewed-by: Imre Deak Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180808210842.3555-1-chris@chris-wilson.co.uk (cherry picked from commit d60996ab430c8a6033a0944c068edc5ec5becb9b) Signed-off-by: Rodrigo Vivi commit 341a15bb91d478c33d97b3b452a55181e5db6ea6 Author: Chris Wilson Date: Wed Aug 8 11:51:00 2018 +0100 drm/i915: Unmask user interrupts writes into HWSP on snb/ivb/vlv/hsw An oddity occurs on Sandybridge, Ivybridge and Haswell (and presumably Valleyview) in that for the period following the GPU restart after a reset, there are no GT interrupts received. From Ville's notes, bit 0 in the HWSTAM corresponds to the render interrupt, and if we unmask it we do see immediate resumption of GT interrupt delivery (via the master irq handler) after the reset. v2: Limit the w/a to the render interrupt from rcs Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107500 Fixes: c5498089463b ("drm/i915: Mask everything in ring HWSTAM on gen6+ in ringbuffer mode") References: d420a50c21ef ("drm/i915: Clean up the HWSTAM mess") Testcase: igt/gem_eio/reset-stress Signed-off-by: Chris Wilson Cc: Ville Syrjälä Acked-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180808105101.913-2-chris@chris-wilson.co.uk (cherry picked from commit a4a717010f4e8cacaa3f0cae8a22f25c39ae1d41) Signed-off-by: Rodrigo Vivi commit fa1b5d09d0771247d407df89228b3902de8e2ce6 Merge: 01f0e5cdedea 59e0b520c75c Author: Linus Torvalds Date: Wed Aug 15 13:05:12 2018 -0700 Merge tag 'kconfig-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kconfig consolidation from Masahiro Yamada: "Consolidation of Kconfig files by Christoph Hellwig. Move the source statements of arch-independent Kconfig files instead of duplicating the includes in every arch/$(SRCARCH)/Kconfig" * tag 'kconfig-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: add a Memory Management options" menu kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt kconfig: use a menu in arch/Kconfig to reduce clutter kconfig: include kernel/Kconfig.preempt from init/Kconfig Kconfig: consolidate the "Kernel hacking" menu kconfig: include common Kconfig files from top-level Kconfig kconfig: remove duplicate SWAP symbol defintions um: create a proper drivers Kconfig um: cleanup Kconfig files um: stop abusing KBUILD_KCONFIG commit fa687fb9ced47b97bd22297366e788dac1927dd7 Merge: 323fc7509a2a a7f58b9ecfd3 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:16 2018 -0500 Merge branch 'remotes/lorenzo/pci/vmd' - Whitelist VMD devices with fast interrupt handlers to avoid sharing vectors with slow handlers (Keith Busch) * remotes/lorenzo/pci/vmd: PCI: vmd: White list for fast interrupt handlers commit 323fc7509a2a752207924dee9866a1b4f2838db4 Merge: 732c47019de9 f23d0d449c16 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:15 2018 -0500 Merge branch 'remotes/lorenzo/pci/mvebu' - Fix mvebu I/O space remapping issues (Thomas Petazzoni) - Use generic pci_host_bridge in mvebu instead of ARM-specific API (Thomas Petazzoni) * remotes/lorenzo/pci/mvebu: PCI: mvebu: Drop bogus comment above mvebu_pcie_map_registers() PCI: mvebu: Convert to use pci_host_bridge directly PCI: mvebu: Use resource_size() to remap I/O space PCI: mvebu: Only remap I/O space if configured PCI: mvebu: Fix I/O space end address calculation PCI: mvebu: Remove redundant platform_set_drvdata() call commit 732c47019de9033a68ba50175b469c9cd105df73 Merge: 0ea77d2b209a 6f2c73c124b1 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:14 2018 -0500 Merge branch 'remotes/lorenzo/pci/mobiveil' - Fix mobiveil iomem/phys_addr_t type usage (Lorenzo Pieralisi) - Fix mobiveil missing include file (Lorenzo Pieralisi) - Add mobiveil Kconfig/Makefile support (Lorenzo Pieralisi) * remotes/lorenzo/pci/mobiveil: PCI: mobiveil: Add Kconfig/Makefile entries PCI: mobiveil: Add missing ../pci.h include PCI: mobiveil: Fix struct mobiveil_pcie.pcie_reg_base address type PCI: mobiveil: Integer overflow in IB_WIN_SIZE commit 0ea77d2b209ac50cb15388cf0824c95e6763ed31 Merge: 1974704eadb2 0043d4ae812e Author: Bjorn Helgaas Date: Wed Aug 15 14:59:13 2018 -0500 Merge branch 'remotes/lorenzo/pci/iproc' - Add more devices to Broadcom PAXC quirk (Ray Jui) - Work around corrupted Broadcom PAXC config space to enable SMMU and GICv3 ITS (Ray Jui) - Disable MSI parsing to work around broken Broadcom PAXC logic in some devices (Ray Jui) - Hide unconfigured functions to work around a Broadcom PAXC defect (Ray Jui) - Lower iproc log level to reduce console output during boot (Ray Jui) * remotes/lorenzo/pci/iproc: PCI: iproc: Reduce inbound/outbound mapping print level PCI: iproc: Reject unconfigured physical functions from PAXC PCI: iproc: Disable MSI parsing in certain PAXC blocks PCI: iproc: Fix up corrupted PAXC root complex config registers PCI: iproc: Activate PAXC bridge quirk for more devices commit 1974704eadb221f0e827e05989fe569ec7049a71 Merge: 0c38011aba35 7403bd14d7b5 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:12 2018 -0500 Merge branch 'remotes/lorenzo/pci/hv' - Remove unnecessary GFP_ATOMIC from Hyper-V "new child" allocation (Jia-Ju Bai) * remotes/lorenzo/pci/hv: PCI: hv: Replace GFP_ATOMIC with GFP_KERNEL in new_pcichild_device() commit 0c38011aba35b2cdca263c0ba4d28e2e727b5acb Merge: 37f0e311bca6 15c972dfb395 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:11 2018 -0500 Merge branch 'remotes/lorenzo/pci/dwc' - Add Kirin MSI support (Xiaowei Song) - Drop unnecessary root_bus_nr setting from exynos, imx6, keystone, armada8k, artpec6, designware-plat, histb, qcom, spear13xx (Shawn Guo) - Move link notification settings from DesignWare core to individual drivers (Gustavo Pimentel) - Add endpoint library MSI-X interfaces (Gustavo Pimentel) - Correct signature of endpoint library IRQ interfaces (Gustavo Pimentel) - Add DesignWare endpoint library MSI-X callbacks (Gustavo Pimentel) - Add endpoint library MSI-X test support (Gustavo Pimentel) * remotes/lorenzo/pci/dwc: PCI: endpoint: Add MSI set maximum restriction tools: PCI: Add MSI-X support pci_endpoint_test: Add 2 ioctl commands pci-epf-test/pci_endpoint_test: Add MSI-X support pci-epf-test/pci_endpoint_test: Use irq_type module parameter pci-epf-test/pci_endpoint_test: Cleanup PCI_ENDPOINT_TEST memspace PCI: dwc: Add legacy interrupt callback handler PCI: dwc: Rework MSI callbacks handler PCI: dwc: Add MSI-X callbacks handler PCI: Update xxx_pcie_ep_raise_irq() and pci_epc_raise_irq() signatures PCI: endpoint: Add MSI-X interfaces PCI: dwc: Fix EP link notification implementation PCI: spear13xx: Drop unnecessary root_bus_nr setting PCI: qcom: Drop unnecessary root_bus_nr setting PCI: histb: Drop unnecessary root_bus_nr setting PCI: designware-plat: Drop unnecessary root_bus_nr setting PCI: artpec6: Drop unnecessary root_bus_nr setting PCI: armada8k: Drop unnecessary root_bus_nr setting PCI: keystone: Drop unnecessary root_bus_nr setting PCI: imx6: Drop unnecessary root_bus_nr setting PCI: exynos: Drop unnecessary root_bus_nr setting PCI: kirin: Add MSI support commit 37f0e311bca66e9fe74703887c9bb4965914cabf Merge: ce342a1aa8c6 eb1e39f784e8 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:10 2018 -0500 Merge branch 'remotes/lorenzo/pci/cadence' - Correct the Cadence cdns_pcie_writel() signature (Alan Douglas) - Add Cadence support for optional generic PHYs (Alan Douglas) - Add Cadence power management ops (Alan Douglas) - Remove redundant variable from Cadence driver (Colin Ian King) * remotes/lorenzo/pci/cadence: PCI: pcie-cadence-ep: Remove redundant variable mmc PCI: cadence: Add shutdown callback to host driver PCI: cadence: Add Power Management ops for host and EP dt-bindings: PCI: cadence: Add DT bindings for optional PHYs PCI: cadence: Add generic PHY support to host and EP drivers PCI: cadence: Update cdns_pcie_writel() function signature commit ce342a1aa8c61fe3315b782f6cf4f34d5babce13 Merge: 0d56768651fc c8e144f8ab00 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:09 2018 -0500 Merge branch 'remotes/lorenzo/pci/aardvark' - Remove Aardvark outbound window configuration (Evan Wang) - Fix Aardvark bridge window sizing issue (Zachary Zhang) - Convert Aardvark to use pci_host_probe() to reduce code duplication (Thomas Petazzoni) * remotes/lorenzo/pci/aardvark: PCI: aardvark: Convert to use pci_host_probe() PCI: aardvark: Size bridges before resources allocation PCI: aardvark: Remove PCIe outbound window configuration PCI: aardvark: Introduce an advk_pcie_valid_device() helper # Conflicts: # drivers/pci/controller/pci-aardvark.c commit 0d56768651fc63691552ea59abc4b2ad07a74241 Merge: 3a48dc6fc260 34dbc9c6584d Author: Bjorn Helgaas Date: Wed Aug 15 14:59:07 2018 -0500 Merge branch 'remotes/lorenzo/pci/controller/misc' - Remove Xilinx AXI-PCIe host bridge arch dependency (Palmer Dabbelt) * remotes/lorenzo/pci/controller/misc: PCI/xilinx: Depend on OF instead of the ARCH commit 3a48dc6fc260c9cac302a9ffaeab95359431c485 Merge: e7aaf90f9d9d 7695e73f3db4 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:06 2018 -0500 Merge branch 'pci/virtualization' - To avoid bus errors, enable PASID only if entire path supports End-End TLP prefixes (Sinan Kaya) - Unify slot and bus reset functions and remove hotplug knowledge from callers (Sinan Kaya) - Add Function-Level Reset quirks for Intel and Samsung NVMe devices to fix guest reboot issues (Alex Williamson) - Add function 1 DMA alias quirk for Marvell 88SS9183 PCIe SSD Controller (Bjorn Helgaas) * pci/virtualization: PCI: Add function 1 DMA alias quirk for Marvell 88SS9183 PCI: Delay after FLR of Intel DC P3700 NVMe PCI: Disable Samsung SM961/PM961 NVMe before FLR PCI: Export pcie_has_flr() PCI: Rename pci_try_reset_bus() to pci_reset_bus() PCI: Deprecate pci_reset_bus() and pci_reset_slot() functions PCI: Unify try slot and bus reset API PCI: Hide pci_reset_bridge_secondary_bus() from drivers IB/hfi1: Use pci_try_reset_bus() for initiating PCI Secondary Bus Reset PCI: Handle error return from pci_reset_bridge_secondary_bus() PCI/IOV: Tidy pci_sriov_set_totalvfs() PCI: Enable PASID only if entire path supports End-End TLP prefixes # Conflicts: # drivers/pci/hotplug/pciehp_hpc.c commit e7aaf90f9d9dbbba54f67c653a1c56c2bf117268 Merge: 5fc054a54476 f778a0d26fe3 Author: Bjorn Helgaas Date: Wed Aug 15 14:59:03 2018 -0500 Merge branch 'pci/switchtec' - Add DMA alias quirk for Microsemi Switchtec NTB (Doug Meyer) - Expand documentation for pci_add_dma_alias() (Logan Gunthorpe) * pci/switchtec: PCI: Expand documentation for pci_add_dma_alias() PCI: Add DMA alias quirk for Microsemi Switchtec NTB switchtec: Use generic PCI Vendor ID and Class Code # Conflicts: # drivers/pci/quirks.c commit 5fc054a54476f9e2b3d6cc3eeb1537aa549d0ba3 Merge: c689209be231 783e84961b1d Author: Bjorn Helgaas Date: Wed Aug 15 14:59:01 2018 -0500 Merge branch 'pci/resource' - Clean up devm_of_pci_get_host_bridge_resources() resource allocation (Jan Kiszka) - Fixup resizable BARs after suspend/resume (Christian König) - Make "pci=earlydump" generic (Sinan Kaya) - Fix ROM BAR access routines to stay in bounds and check for signature correctly (Rex Zhu) * pci/resource: PCI: Make pci_get_rom_size() static PCI: Add check code for last image indicator not set PCI: Avoid accessing memory outside the ROM BAR PCI: Make early dump functionality generic PCI: Cleanup PCI_REBAR_CTRL_BAR_SHIFT handling PCI: Restore resized BAR state on resume PCI: Clean up resource allocation in devm_of_pci_get_host_bridge_resources() # Conflicts: # Documentation/admin-guide/kernel-parameters.txt commit c689209be23166b340c224df8ecd5deea163da56 Merge: eadf3d320943 10dbc9fedcf1 Author: Bjorn Helgaas Date: Wed Aug 15 14:58:58 2018 -0500 Merge branch 'pci/peer-to-peer' - Add "pci=disable_acs_redir=" parameter to disable ACS redirection for peer-to-peer DMA support (we don't have the peer-to-peer support yet; this is just one piece) (Logan Gunthorpe) * pci/peer-to-peer: PCI: Add ACS Redirect disable quirk for Intel Sunrise Point PCI: Add device-specific ACS Redirect disable infrastructure PCI: Convert device-specific ACS quirks from NULL termination to ARRAY_SIZE PCI: Add "pci=disable_acs_redir=" parameter for peer-to-peer support PCI: Allow specifying devices using a base bus and path of devfns PCI: Make specifying PCI devices in kernel parameters reusable PCI: Hide ACS quirk declarations inside PCI core commit eadf3d3209435faa500a8e39ff6181c41ecea29d Merge: 11c1a8e1f4fb 39a212ad15f3 Author: Bjorn Helgaas Date: Wed Aug 15 14:58:57 2018 -0500 Merge branch 'pci/notes' - Document ACPI description of PCI host bridges (Bjorn Helgaas) * pci/notes: PCI: Document ACPI description of PCI host bridges commit 11c1a8e1f4fb697c3d504b1951f476e2e0b3c076 Merge: a40f72db8a37 923aa4c378f9 Author: Bjorn Helgaas Date: Wed Aug 15 14:58:56 2018 -0500 Merge branch 'pci/msi' - Set IRQCHIP_ONESHOT_SAFE for PCI MSI irqchips (Heiner Kallweit) * pci/msi: PCI/MSI: Set IRQCHIP_ONESHOT_SAFE for PCI-MSI irqchips commit a40f72db8a3770ea135f4f48a007256fd1519549 Merge: c0638a455382 2538fb89b8f4 Author: Bjorn Helgaas Date: Wed Aug 15 14:58:54 2018 -0500 Merge branch 'pci/misc' - Mark fall-through switch cases before enabling -Wimplicit-fallthrough (Gustavo A. R. Silva) - Move DMA-debug PCI init from arch code to PCI core (Christoph Hellwig) - Fix pci_request_irq() usage of IRQF_ONESHOT when no handler is supplied (Heiner Kallweit) - Unify PCI and DMA direction #defines (Shunyong Yang) - Add PCI_DEVICE_DATA() macro (Andy Shevchenko) - Check for VPD completion before checking for timeout (Bert Kenward) - Limit Netronome NFP5000 config space size to work around erratum (Jakub Kicinski) * pci/misc: PCI: Limit config space size for Netronome NFP5000 PCI/VPD: Check for VPD access completion before checking for timeout PCI: Add PCI_DEVICE_DATA() macro to fully describe device ID entry PCI: Unify PCI and normal DMA direction definitions PCI: Use IRQF_ONESHOT if pci_request_irq() called with no handler PCI: Call dma_debug_add_bus() for pci_bus_type from PCI core PCI: Mark fall-through switch cases before enabling -Wimplicit-fallthrough # Conflicts: # drivers/pci/hotplug/pciehp_ctrl.c commit c0638a455382e01e42bf66d8d41e4b703f1550a5 Merge: a8bcb5e5966c 4e6a13356f1c Author: Bjorn Helgaas Date: Wed Aug 15 14:58:52 2018 -0500 Merge branch 'pci/hotplug' - Simplify SHPC existence/permission checks (Bjorn Helgaas) - Remove hotplug sample skeleton driver (Lukas Wunner) - Convert pciehp to threaded IRQ handling (Lukas Wunner) - Improve pciehp tolerance of missed events and initially unstable links (Lukas Wunner) - Clear spurious pciehp events on resume (Lukas Wunner) - Add pciehp runtime PM support, including for Thunderbolt controllers (Lukas Wunner) - Support interrupts from pciehp bridges in D3hot (Lukas Wunner) * pci/hotplug: PCI: pciehp: Deduplicate presence check on probe & resume PCI: pciehp: Avoid implicit fallthroughs in switch statements PCI: Whitelist Thunderbolt ports for runtime D3 PCI: Whitelist native hotplug ports for runtime D3 PCI: sysfs: Resume to D0 on function reset PCI: pciehp: Resume parent to D0 on config space access PCI: pciehp: Resume to D0 on enable/disable PCI: pciehp: Support interrupts sent from D3hot PCI: pciehp: Obey compulsory command delay after resume PCI: pciehp: Clear spurious events earlier on resume PCI: portdrv: Deduplicate PM callback iterator PCI: pciehp: Avoid slot access during reset PCI: pciehp: Always enable occupied slot on probe PCI: pciehp: Become resilient to missed events PCI: pciehp: Tolerate initially unstable link PCI: pciehp: Declare pciehp_enable/disable_slot() static PCI: pciehp: Drop enable/disable lock PCI: pciehp: Enable/disable exclusively from IRQ thread PCI: pciehp: Track enable/disable status PCI: pciehp: Publish to user space last on probe PCI: hotplug: Demidlayer registration with the core PCI: pciehp: Drop slot workqueue PCI: pciehp: Handle events synchronously PCI: pciehp: Stop blinking on slot enable failure PCI: pciehp: Convert to threaded polling PCI: pciehp: Convert to threaded IRQ PCI: pciehp: Document struct slot and struct controller PCI: pciehp: Declare pciehp_unconfigure_device() void PCI: pciehp: Drop unnecessary NULL pointer check PCI: pciehp: Fix unprotected list iteration in IRQ handler PCI: pciehp: Fix use-after-free on unplug PCI: hotplug: Don't leak pci_slot on registration failure PCI: hotplug: Delete skeleton driver PCI: shpchp: Separate existence of SHPC and permission to use it commit a8bcb5e5966ccbd99a6d06cf69ada7f95416aabc Merge: 1ca358a8e3ff 9f0e89359775 Author: Bjorn Helgaas Date: Wed Aug 15 14:58:52 2018 -0500 Merge branch 'pci/enumeration' - Work around IDT switch ACS Source Validation erratum (James Puthukattukaran) - Emit diagnostics for all cases of PCIe Link downtraining (Links operating slower than they're capable of) (Alexandru Gagniuc) - Skip VFs when configuring Max Payload Size (Myron Stowe) - Reduce Root Port Max Payload Size if necessary when hot-adding a device below it (Myron Stowe) * pci/enumeration: PCI: Match Root Port's MPS to endpoint's MPSS as necessary PCI: Skip MPS logic for Virtual Functions (VFs) PCI: Check for PCIe Link downtraining PCI: Workaround IDT switch ACS Source Validation erratum commit 1ca358a8e3ffa123a2e655b1b3569f7868597c59 Merge: 187dacce1942 e77b8216a2f9 Author: Bjorn Helgaas Date: Wed Aug 15 14:58:51 2018 -0500 Merge branch 'pci/dpc' - Defer DPC event handling to work queue (Keith Busch) - Use threaded IRQ for DPC bottom half (Keith Busch) - Print AER status while handling DPC events (Keith Busch) * pci/dpc: PCI/DPC: Remove indirection waiting for inactive link PCI/DPC: Use threaded IRQ for bottom half handling PCI/DPC: Print AER status in DPC event handling PCI/DPC: Remove rp_pio_status from dpc struct PCI/DPC: Defer event handling to work queue PCI/DPC: Leave interrupts enabled while handling event commit 187dacce194216c4d86c2afd0ca490a6d7fbb981 Merge: 3c3ab37f4c03 ce29af2a5056 Author: Bjorn Helgaas Date: Wed Aug 15 14:58:46 2018 -0500 Merge branch 'pci/aspm' - Use sysfs_match_string() to simplify ASPM sysfs parsing (Andy Shevchenko) - Remove unnecessary includes of (Bjorn Helgaas) * pci/aspm: PCI: Remove unnecessary include of iwlwifi: Remove unnecessary include of ath9k: Remove unnecessary include of igb: Remove unnecessary include of PCI/ASPM: Convert to use sysfs_match_string() helper commit 3c3ab37f4c03dc9c7c917ff3c1e71d6da81d3bd3 Merge: af863d18a1fb 45687f96c112 Author: Bjorn Helgaas Date: Wed Aug 15 14:58:45 2018 -0500 Merge branch 'pci/aer' - Decode AER errors with names similar to "lspci" (Tyler Baicar) - Expose AER statistics in sysfs (Rajat Jain) - Clear AER status bits selectively based on the type of recovery (Oza Pawandeep) - Honor "pcie_ports=native" even if HEST sets FIRMWARE_FIRST (Alexandru Gagniuc) - Don't clear AER status bits if we're using the "Firmware-First" strategy where firmware owns the registers (Alexandru Gagniuc) * pci/aer: PCI/AER: Don't clear AER bits if error handling is Firmware-First PCI/AER: Remove duplicate PCI_EXP_AER_FLAGS definition PCI/portdrv: Remove pcie_portdrv_err_handler.slot_reset PCI/AER: Clear device status bits during ERR_COR handling PCI/AER: Clear device status bits during ERR_FATAL and ERR_NONFATAL PCI/AER: Remove ERR_FATAL code from ERR_NONFATAL path PCI/AER: Factor out ERR_NONFATAL status bit clearing PCI/AER: Clear only ERR_NONFATAL bits during non-fatal recovery PCI/AER: Clear only ERR_FATAL status bits during fatal recovery PCI/AER: Honor "pcie_ports=native" even if HEST sets FIRMWARE_FIRST PCI/AER: Add sysfs attributes for rootport cumulative stats PCI/AER: Add sysfs attributes to provide AER stats and breakdown PCI/AER: Define aer_stats structure for AER capable devices PCI/AER: Move internal declarations to drivers/pci/pci.h PCI/AER: Adopt lspci names for AER error decoding PCI/AER: Expose internal API for obtaining AER information # Conflicts: # drivers/pci/pci.h commit af863d18a1fbedd164366d0f3d4946d9cc3edc46 Merge: ce397d215ccd 44bda4b7d26e Author: Bjorn Helgaas Date: Wed Aug 15 14:58:43 2018 -0500 Merge branch 'for-linus' * for-linus: PCI: Fix is_added/is_busmaster race condition PCI: mobiveil: Avoid integer overflow in IB_WIN_SIZE PCI/AER: Work around use-after-free in pcie_do_fatal_recovery() PCI: v3-semi: Fix I/O space page leak PCI: mediatek: Fix I/O space page leak PCI: faraday: Fix I/O space page leak PCI: aardvark: Fix I/O space page leak PCI: designware: Fix I/O space page leak PCI: versatile: Fix I/O space page leak PCI: xgene: Fix I/O space page leak PCI: OF: Fix I/O space page leak PCI: endpoint: Fix NULL pointer dereference error when CONFIGFS is disabled PCI: hv: Disable/enable IRQs rather than BH in hv_compose_msi_msg() nfp: stop limiting VFs to 0 PCI/IOV: Reset total_VFs limit after detaching PF driver PCI: faraday: Add missing of_node_put() PCI: xilinx-nwl: Add missing of_node_put() PCI: xilinx: Add missing of_node_put() PCI: endpoint: Use after free in pci_epf_unregister_driver() PCI: controller: dwc: Do not let PCIE_DW_PLAT_HOST default to yes PCI: rcar: Clean up PHY init on failure PCI: rcar: Shut the PHY down in failpath PCI: controller: Move PCI_DOMAINS selection to arch Kconfig PCI: Initialize endpoint library before controllers PCI: shpchp: Manage SHPC unconditionally on non-ACPI systems commit 01f0e5cdedea448ea48eaddc1366593126b0fe98 Merge: e026bcc56107 1880861226c1 Author: Linus Torvalds Date: Wed Aug 15 12:50:10 2018 -0700 Merge tag 'kconfig-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kconfig updates from Masahiro Yamada: - show clearer error messages where pkg-config is needed, but not installed - rename SYMBOL_AUTO to SYMBOL_NO_WRITE to reflect its semantics - create all necessary directories by Kconfig tool itself instead of Makefile - update the .config unconditionally when syncconfig is invoked - use 'include' directive instead of '-include' where include/config/{auto,tristate}.conf is mandatory - do not try to update the .config when running install targets - add .DELETE_ON_ERROR to delete partially updated files - misc cleanups and fixes * tag 'kconfig-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: remove P_ENV property type kconfig: remove unused sym_get_env_prop() function kconfig: fix the rule of mainmenu_stmt symbol init/Kconfig: Use short unix-style option instead of --longname Kbuild: Makefile.modbuiltin: include auto.conf and tristate.conf mandatory kbuild: remove auto.conf from prerequisite of phony targets kbuild: do not update config for 'make kernelrelease' kbuild: do not update config when running install targets kbuild: add .DELETE_ON_ERROR special target kbuild: use 'include' directive to load auto.conf from top Makefile kconfig: allow all config targets to write auto.conf if missing kconfig: make syncconfig update .config regardless of sym_change_count kconfig: create directories needed for syncconfig by itself kconfig: remove unneeded directory generation from local*config kconfig: split out useful helpers in confdata.c kconfig: rename file_write_dep and move it to confdata.c kconfig: fix typos in description of "choice" in kconfig-language.txt kconfig: handle format string before calling conf_message_callback() kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE kconfig: check for pkg-config on make {menu,n,g,x}config commit 45687f96c112adda2f1d1f05b977661eb00d5a1c Author: Alexandru Gagniuc Date: Tue Jul 17 10:31:23 2018 -0500 PCI/AER: Don't clear AER bits if error handling is Firmware-First If the platform requests Firmware-First error handling, firmware is responsible for reading and clearing AER status bits. If OSPM also clears them, we may miss errors. See ACPI v6.2, sec 18.3.2.5 and 18.4. This race is mostly of theoretical significance, as it is not easy to reasonably demonstrate it in testing. Signed-off-by: Alexandru Gagniuc [bhelgaas: add similar guards to pci_cleanup_aer_uncorrect_error_status() and pci_aer_clear_fatal_status()] Signed-off-by: Bjorn Helgaas commit dd81b2c8a3339c813568d07091fcd0d97dd0cf41 Author: Parav Pandit Date: Tue Aug 14 10:36:21 2018 +0300 IB/core: Change filter function return type from int to bool Filter functions returns either 0 or 1, therefore better change their return type from int to bool to reflect the same. Additionally some filter functions have suffix of _filter some doesn't. Make all filter function consistent to have __filter suffix to improve code readability. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d12e2eed2743856b4493aeda4f6ed1bb0fa47e57 Author: Parav Pandit Date: Tue Aug 14 10:36:20 2018 +0300 IB/core: Update GID entries for netdevice whose mac address changes Update all GID table entries of the netdevice whose MAC address changed. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 464b79b45aede2859eb46ae91786f0266868602b Author: Parav Pandit Date: Tue Aug 14 10:36:19 2018 +0300 IB/core: Add default GIDs of the bond master netdev Currently following issues exist: 1. Default GIDs of the lower (slave) netdevice if the bond netdevice is added. Rather default GID should be of bond master netdevice. 2. Due to this, when failover event occurs FAILOVER event handler attempts to delete the GID of the upper device and tries to add the default GID of the lower device. This is incorrect behavior. To have simple and correct code: (a) Split default GIDs addition out of add_netdev_ips(). This allows easier removal in future if RoCE default GIDs are removed. (b) Add default GIDs of the bond master device by using right filter and callback function. (c) Remove unused function enum_netdev_default_gids(). Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a03d4d2775c7f654bcea8a9f8f49f724fd4fa810 Author: Parav Pandit Date: Tue Aug 14 10:36:18 2018 +0300 IB/core: Consider adding default GIDs of bond device Now that we correctly delete the default GIDs of lower devices during CHANGEUPPER event, add default GIDs of the bonding master device. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 408f1242d940773e9e97a544803b0dcf28b70d17 Author: Parav Pandit Date: Tue Aug 14 10:36:17 2018 +0300 IB/core: Delete lower netdevice default GID entries in bonding scenario When NETDEV_CHANGEUPPER event occurs, lower device is not yet established as slave of the master, and when upper device is bond device, default GID entries not deleted. Due to this, when bond device is fully configured, default GID entries of bond device cannot be added as default GID entries are occupied by the lower netdevice. This is incorrect. Default GID entries should really be of bond netdevice because in all RoCE GIDs (default or IP), MAC address of the bond device will be used. It is confusing to have default GID of netdevice which is not really used for any purpose. Therefore, as first step, implement (a) filter function which filters if a CHANGEUPPER event netdevice and associated upper device is master device or not. (b) callback function which deletes the default GIDs of lower (event netdevice). Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e026bcc561071c9895c73058b9cc6823defb7be6 Merge: 7c7b562c6f0a 512ddf7d7db0 Author: Linus Torvalds Date: Wed Aug 15 12:09:03 2018 -0700 Merge tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - verify depmod is installed before modules_install - support build salt in case build ids must be unique between builds - allow users to specify additional host compiler flags via HOST*FLAGS, and rename internal variables to KBUILD_HOST*FLAGS - update buildtar script to drop vax support, add arm64 support - update builddeb script for better debarch support - document the pit-fall of if_changed usage - fix parallel build of UML with O= option - make 'samples' target depend on headers_install to fix build errors - remove deprecated host-progs variable - add a new coccinelle script for refcount_t vs atomic_t check - improve double-test coccinelle script - misc cleanups and fixes * tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (41 commits) coccicheck: return proper error code on fail Coccinelle: doubletest: reduce side effect false positives kbuild: remove deprecated host-progs variable kbuild: make samples really depend on headers_install um: clean up archheaders recipe kbuild: add %asm-generic to no-dot-config-targets um: fix parallel building with O= option scripts: Add Python 3 support to tracing/draw_functrace.py builddeb: Add automatic support for sh{3,4}{,eb} architectures builddeb: Add automatic support for riscv* architectures builddeb: Add automatic support for m68k architecture builddeb: Add automatic support for or1k architecture builddeb: Add automatic support for sparc64 architecture builddeb: Add automatic support for mips{,64}r6{,el} architectures builddeb: Add automatic support for mips64el architecture builddeb: Add automatic support for ppc64 and powerpcspe architectures builddeb: Introduce functions to simplify kconfig tests in set_debarch builddeb: Drop check for 32-bit s390 builddeb: Change architecture detection fallback to use dpkg-architecture builddeb: Skip architecture detection when KBUILD_DEBARCH is set ... commit 7c7b562c6f0a4fb13eee01cb39b111addfb165e6 Merge: b125d9038819 45d9a1e3cc45 Author: Linus Torvalds Date: Wed Aug 15 12:06:16 2018 -0700 Merge tag 'gcc-plugin-cleanup-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull gcc plugin cleanups from Kees Cook: - Kconfig and Makefile clean-ups (Masahiro Yamada, Kees Cook) - gcc-common.h definition clean-ups (Alexander Popov) * tag 'gcc-plugin-cleanup-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: Clean up the cgraph_create_edge* macros gcc-plugins: Regularize Makefile.gcc-plugins gcc-plugins: split out Kconfig entries to scripts/gcc-plugins/Kconfig gcc-plugins: remove unused GCC_PLUGIN_SUBDIR commit b125d903881901a53117dfe404c789850b4e98ed Merge: 8c326850304d 9f68cb579115 Author: Linus Torvalds Date: Wed Aug 15 11:18:53 2018 -0700 Merge tag 'printk-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk Pull printk updates from Petr Mladek: - Different vendors have a different expectation about a console quietness. Make it configurable to reduce bike-shedding about the upstream default - Decide about the message visibility when the message is stored. It avoids races caused by a delayed console handling - Always store printk() messages into the per-CPU buffers again in NMI. The only exception is when flushing trace log in panic(). There the risk of loosing messages is worth an eventual reordering - Handle invalid %pO printf modifiers correctly - Better handle %p printf modifier tests before crng is initialized - Some clean up * tag 'printk-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk: lib/vsprintf: Do not handle %pO[^F] as %px printk: Fix warning about unused suppress_message_printing printk/nmi: Prevent deadlock when accessing the main log buffer in NMI printk: Create helper function to queue deferred console handling printk: Split the code for storing a message into the log buffer printk: Clean up syslog_print_all() printk: Remove unnecessary kmalloc() from syslog during clear printk: Make CONSOLE_LOGLEVEL_QUIET configurable printk: make sure to print log on console. lib/test_printf.c: accept "ptrval" as valid result for plain 'p' tests commit 8c326850304d495deee6ff9a609173a340c5245b Merge: 6f7dac117d89 baa2a4fdd525 Author: Linus Torvalds Date: Wed Aug 15 10:46:54 2018 -0700 Merge tag 'audit-pr-20180814' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit patches from Paul Moore: "Twelve audit patches for v4.19 and they run the full gamut from fixes to features. Notable changes include the ability to use the "exe" audit filter field in a wider variety of filter types, a fix for our comparison of GID/EGID in audit filter rules, better association of related audit records (connecting related audit records together into one audit event), and a fix for a potential use-after-free in audit_add_watch(). All the patches pass the audit-testsuite and merge cleanly on your current master branch" * tag 'audit-pr-20180814' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: fix use-after-free in audit_add_watch audit: use ktime_get_coarse_real_ts64() for timestamps audit: use ktime_get_coarse_ts64() for time access audit: simplify audit_enabled check in audit_watch_log_rule_change() audit: check audit_enabled in audit_tree_log_remove_rule() cred: conditionally declare groups-related functions audit: eliminate audit_enabled magic number comparison audit: rename FILTER_TYPE to FILTER_EXCLUDE audit: Fix extended comparison of GID/EGID audit: tie ANOM_ABEND records to syscall audit: tie SECCOMP records to syscall audit: allow other filter list types for AUDIT_EXE commit 6f7dac117d895596ca52b935bdd534ac9032deb4 Merge: 92d4a03674b8 7e4237faa721 Author: Linus Torvalds Date: Wed Aug 15 10:39:06 2018 -0700 Merge tag 'selinux-pr-20180814' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull SELinux updates from Paul Moore: "There are 16 patches in here but really only one that is of any significance. That one patch is by nixiaoming and fixes a few places where we were not properly cleaning up dentry and inode objects in the selinuxfs error handling code. The rest are either printk->pr_* conversions, constification tweaks, and a minor tweak to MAINTAINERS. Everything passes the selinux-testsuite and looks to merge cleanly against your master branch" * tag 'selinux-pr-20180814' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: cleanup dentry and inodes on error in selinuxfs selinux: constify write_op[] selinux: Cleanup printk logging in netnode selinux: Cleanup printk logging in avc selinux: Cleanup printk logging in netif selinux: Cleanup printk logging in netport selinux: Cleanup printk logging in sidtab selinux: Cleanup printk logging in netlink selinux: Cleanup printk logging in selinuxfs selinux: Cleanup printk logging in services selinux: Cleanup printk logging in avtab selinux: Cleanup printk logging in hooks selinux: Cleanup printk logging in policydb selinux: Cleanup printk logging in ebitmap selinux: Cleanup printk logging in conditional MAINTAINERS: update the LSM and SELinux subsystems commit 92d4a03674b8c399c2f547580fa509db78226170 Merge: 1eb46908b35d 87ea58433208 Author: Linus Torvalds Date: Wed Aug 15 10:25:26 2018 -0700 Merge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull security subsystem updates from James Morris: - kstrdup() return value fix from Eric Biggers - Add new security_load_data hook to differentiate security checking of kernel-loaded binaries in the case of there being no associated file descriptor, from Mimi Zohar. - Add ability to IMA to specify a policy at build-time, rather than just via command line params or by loading a custom policy, from Mimi. - Allow IMA and LSMs to prevent sysfs firmware load fallback (e.g. if using signed firmware), from Mimi. - Allow IMA to deny loading of kexec kernel images, as they cannot be measured by IMA, from Mimi. * 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: security: check for kstrdup() failure in lsm_append() security: export security_kernel_load_data function ima: based on policy warn about loading firmware (pre-allocated buffer) module: replace the existing LSM hook in init_module ima: add build time policy ima: based on policy require signed firmware (sysfs fallback) firmware: add call to LSM hook before firmware sysfs fallback ima: based on policy require signed kexec kernel images kexec: add call to LSM hook in original kexec_load syscall security: define new LSM hook named security_kernel_load_data MAINTAINERS: remove the outdated "LINUX SECURITY MODULE (LSM) FRAMEWORK" entry commit 1eb46908b35dfbac0ec1848d4b1e39667e0187e9 Author: Guenter Roeck Date: Wed Aug 15 08:38:33 2018 -0700 x86/l1tf: Fix build error seen if CONFIG_KVM_INTEL is disabled allmodconfig+CONFIG_INTEL_KVM=n results in the following build error. ERROR: "l1tf_vmx_mitigation" [arch/x86/kvm/kvm.ko] undefined! Fixes: 5b76a3cff011 ("KVM: VMX: Tell the nested hypervisor to skip L1D flush on vmentry") Reported-by: Meelis Roos Cc: Meelis Roos Cc: Paolo Bonzini Cc: Thomas Gleixner Signed-off-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 3529b9703c112279d3c302ba0a941ac3a33daa37 Merge: 8c479c2c0f9d 1021bcf44d0e Author: Linus Torvalds Date: Wed Aug 15 09:22:52 2018 -0700 Merge tag 'pstore-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore update from Kees Cook: "This cycle has been very quiet for pstore: the only change is adding awareness of the zstd compression method" * tag 'pstore-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore: add zstd compression support commit 484004339d4514fde425f6e8a9f6a6cc979bb0c3 Author: Johannes Berg Date: Wed Aug 15 18:17:03 2018 +0200 mac80211_hwsim: require at least one channel Syzbot continues to try to create mac80211_hwsim radios, and manages to pass parameters that are later checked with WARN_ON in cfg80211 - catch another one in hwsim directly. Reported-by: syzbot+2a12f11c306afe871c1f@syzkaller.appspotmail.com Signed-off-by: Johannes Berg commit 8618289c46556fd4dd259a1af02ccc448032f48d Author: Trond Myklebust Date: Tue Aug 14 17:55:56 2018 -0400 NFSv4: Fix a sleep in atomic context in nfs4_callback_sequence() We must drop the lock before we can sleep in referring_call_exists(). Reported-by: Jia-Ju Bai Fixes: 045d2a6d076a ("NFSv4.1: Delay callback processing...") Cc: stable@vger.kernel.org # v4.9+ Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 8c479c2c0f9dc105c0afaa662a22f39383d4ce92 Merge: 31130a16d459 b5cb15d9372a Author: Linus Torvalds Date: Wed Aug 15 08:45:54 2018 -0700 Merge tag 'hardened-usercopy-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardened usercopy updates from Kees Cook: "This cleans up a minor Kconfig issue and adds a kernel boot option for disabling hardened usercopy for distro users that may have corner-case performance issues (e.g. high bandwidth small-packet UDP traffic). Summary: - drop unneeded Kconfig "select BUG" (Kamal Mostafa) - add "hardened_usercopy=off" rare performance needs (Chris von Recklinghausen)" * tag 'hardened-usercopy-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: usercopy: Allow boot cmdline disabling of hardening usercopy: Do not select BUG with HARDENED_USERCOPY commit d0fbb1d8a194c0ec0180c1d073ad709e45503a43 Author: Trond Myklebust Date: Tue Aug 14 17:25:37 2018 -0400 NFSv4: Fix locking in pnfs_generic_recover_commit_reqs The use of the inode->i_lock was converted to a mutex, but we forgot to remove the old inode unlock/lock() pair that allowed the layout segment to be put inside the loop. Reported-by: Jia-Ju Bai Fixes: e824f99adaaf1 ("NFSv4: Use a mutex to protect the per-inode commit...") Cc: stable@vger.kernel.org # v4.14+ Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 249dc49576fc953a7378b916c6a6d47ea81e4da2 Author: Charles Keepax Date: Wed Aug 15 13:11:35 2018 +0100 ASoC: dapm: Fix NULL pointer deference on CODEC to CODEC DAIs Commit a655de808cbde ("ASoC: core: Allow topology to override machine driver FE DAI link config.") caused soc_dai_hw_params to be come dependent on the substream private_data being set with a pointer to the snd_soc_pcm_runtime. Currently, CODEC to CODEC links don't set this, which causes a NULL pointer dereference: [<4069de54>] (soc_dai_hw_params) from [<40694b68>] (snd_soc_dai_link_event+0x1a0/0x380) Since the ASoC core in general assumes that the substream private_data will be set to a pointer to the snd_soc_pcm_runtime, update the CODEC to CODEC links to respect this. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit 1a4327fbf4554d5b78d75b19a13d40d6de220159 Author: Kirill Kapranov Date: Mon Aug 13 19:48:10 2018 +0300 spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers On systems where some controllers get a dynamic ID assigned and some have a fixed number (e.g. from ACPI tables), the current implementation might run into an IDR collision: in case of a fixed bus number is gotten by a driver (but not marked busy in IDR tree) and a driver with dynamic bus number gets the same ID and predictably fails. Fix this by means of checking-in fixed IDsin IDR as far as dynamic ones at the moment of the controller registration. Fixes: 9b61e302210e (spi: Pick spi bus number from Linux idr or spi alias) Signed-off-by: Kirill Kapranov Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 56c9bba135ab7884d65f92b19ee87f794508d7dc Author: Ike Panhc Date: Tue Aug 14 16:36:53 2018 +0800 platform/x86: ideapad: Add Y520-15IKBM and Y720-15IKBM to no_hw_rfkill Lenovo Y520-15IKBM and Y720-15IKBM are another Lenovo models without physical radio switch and ideapad-laptop reports it is hard blocked. Add them into no_hw_rfkill to unlock wireless. BugLink: https://bugs.launchpad.net/bugs/1723612 Signed-off-by: Ike Panhc Signed-off-by: Andy Shevchenko commit 880b29ac107d15644bf4da228376ba3cd6af6d71 Author: Aleh Filipovich Date: Fri Aug 10 22:07:25 2018 +0200 platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360 Add entry to WMI keymap for lid flip event on Asus UX360. On Asus Zenbook ux360 flipping lid from/to tablet mode triggers keyscan code 0xfa which cannot be handled and results in kernel log message "Unknown key fa pressed". Signed-off-by: Aleh Filipovich Signed-off-by: Andy Shevchenko commit aa7d16bfa3bd7a753c59b9bae1ac1ccda33bc27a Author: Gustavo A. R. Silva Date: Mon Aug 6 15:38:32 2018 -0500 platform/x86: acer-wmi: refactor function has_cap Refactor function has_cap in order to avoid returning integer values, when instead it should return booleans. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: "Lee, Chun-Yi" Signed-off-by: Andy Shevchenko commit d22296d9c38fd29a96bb5079fb8d17cee278f40e Author: Thomas Weißschuh Date: Thu Aug 2 00:24:18 2018 +0200 platform/x86: thinkpad_acpi: Fix multi-battery bug The struct containing the supported operations for all batteries is being zeroed on each battery probe. This prevents all other batteries except the lastly probed one from being configured. Signed-off-by: Thomas Weißschuh Signed-off-by: Andy Shevchenko commit 6640ee6289b9974334e36d8283fc07f37f3b235d Author: Jouke Witteveen Date: Thu Aug 2 22:28:49 2018 +0200 platform/x86: thinkpad_acpi: extend battery quirk coverage Based on bug reports and a web search for "Thinkpad_acpi: Error probing battery 2" four more models were found that require the battery quirk: Lenovo B5400, Thinkpad 11e, Thinkpad 11e gen 3, Thinkpad 13 gen 3. Signed-off-by: Jouke Witteveen Tested-by: James Cheshire Acked-by: Henrique de Moraes Holschuh Signed-off-by: Andy Shevchenko commit cda5915d15d390068dcdac54d03ddf29b445c6a5 Author: youling257 Date: Tue Jul 31 17:32:56 2018 +0800 platform/x86: touchscreen_dmi: Add info for the Cube KNote i1101 tablet Add touchscreen info for the Cube KNote i1101 tablet. Reported-and-tested-by: lkongl Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 207da7128a6d61a1ce3d052b3dfb10d237af6078 Author: Wei Yongjun Date: Wed Aug 8 04:00:30 2018 +0000 platform/x86: mlx-platform: Fix copy-paste error in mlxplat_init() The return value from platform_device_register_resndata() is not checked correctly. The test is done against a wrong variable. This patch fix it. Fixes: 0378123c5800 ("platform/x86: mlx-platform: Add mlxreg-fan platform driver activation") Signed-off-by: Wei Yongjun Acked-by: Vadim Pasternak Signed-off-by: Andy Shevchenko commit ac7da1b787d9ea43680c487613269742c48d8747 Merge: 032405a754fb d47317ca4ade 96455f734b2f 81351776c9fb 7a8655e19bdb 67075b3cb8d5 Author: Stephen Boyd Date: Tue Aug 14 23:00:15 2018 -0700 Merge branches 'clk-actions-s700', 'clk-exynos-unused', 'clk-qcom-dispcc-845', 'clk-scmi-round' and 'clk-cs2000-spdx' into clk-next * clk-actions-s700: : - Actions Semi Owl series S700 SoC clk driver clk: actions: Add S700 SoC clock support dt-bindings: clock: Add S700 support for Actions Semi Soc's clk: actions: Add missing REGMAP_MMIO dependency * clk-exynos-unused: : - Remove an unused variable from Exynos4412 ISP driver clk: samsung: Remove unused mout_user_aclk400_mcuisp_p4x12 variable * clk-qcom-dispcc-845: : - Qualcomm SDM845 display clock controller clk: qcom: Add display clock controller driver for SDM845 dt-bindings: clock: Introduce QCOM Display clock bindings clk: qcom: Move frequency table macro to common file * clk-scmi-round: : - Fix a thinko bug in SCMI clk division logic clk: scmi: Fix the rounding of clock rate * clk-cs2000-spdx: clk: cs2000-cp: convert to SPDX identifiers commit 032405a754fb338812732eac449cd10173f13a1a Merge: 4a18ef5babd1 d7b7c00dad79 7f5eac5934d7 c76a69e477b8 cec5dfa4e49c ff388ee36516 Author: Stephen Boyd Date: Tue Aug 14 22:58:53 2018 -0700 Merge branches 'clk-imx6-ocram', 'clk-missing-put', 'clk-tegra-sdmmc-jitter', 'clk-allwinner' and 'clk-uniphier' into clk-next * clk-imx6-ocram: : - i.MX6SX ocram_s clk support clk: imx: add ocram_s clock for i.mx6sx * clk-missing-put: : - Add missing of_node_put()s in some i.MX clk drivers clk: imx6sll: fix missing of_node_put() clk: imx6ul: fix missing of_node_put() * clk-tegra-sdmmc-jitter: : - Tegra SDMMC clk jitter improvements with high speed signaling modes clk: tegra: make sdmmc2 and sdmmc4 as sdmmc clocks clk: tegra: Add sdmmc mux divider clock clk: tegra: Refactor fractional divider calculation clk: tegra: Fix includes required by fence_udelay() * clk-allwinner: clk: sunxi-ng: add A64 compatible string dt-bindings: add compatible string for the A64 DE2 CCU clk: sunxi-ng: r40: Export video PLLs clk: sunxi-ng: r40: Allow setting parent rate to display related clocks clk: sunxi-ng: r40: Add minimal rate for video PLLs * clk-uniphier: : - Uniphier NAND, USB3 PHY, and SPI clk support clk: uniphier: add clock frequency support for SPI clk: uniphier: add more USB3 PHY clocks clk: uniphier: add NAND 200MHz clock commit 4a18ef5babd1bac0c746e87d1b94a7696fcd36be Merge: d16adaf0b92f 9c7e47025a6b f9419783a6b4 365f7a89c881 f6dab4233d6b 8927c27b3270 Author: Stephen Boyd Date: Tue Aug 14 22:58:49 2018 -0700 Merge branches 'clk-qcom-rpmh', 'clk-qcom-spdx', 'clk-con-id-leak', 'clk-fixed-factor-populated' and 'clk-mvebu-periph-parent' into clk-next * clk-qcom-rpmh: : - Qualcomm RPMh clk driver clk: qcom: clk-rpmh: Add QCOM RPMh clock driver * clk-qcom-spdx: : - SPDX tagging for qcom clk: qcom: Update SPDX headers for common files * clk-con-id-leak: : - Stop leaking con ids in __clk_put() clk: core: Potentially free connection id * clk-fixed-factor-populated: : - Fix a corner case in fixed factor clk probing where node is in DT but : parent clk is registered much later clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure * clk-mvebu-periph-parent: : - Marvell Armada 3700 clk_pm_cpu_get_parent() had an invalid return value clk: mvebu: armada-37xx-periph: Remove unused var num_parents clk: mvebu: armada-37xx-periph: Fix wrong return value in get_parent commit d16adaf0b92fc356537ba38d94590b8ed50e3552 Merge: 139054634b40 66c7bb7c4133 166f3a8ad677 30343897d8fd 566f5b67fc0c ee3d212d7c86 Author: Stephen Boyd Date: Tue Aug 14 22:58:45 2018 -0700 Merge branches 'clk-mvebu-spdx', 'clk-meson', 'clk-imx7d-mu', 'clk-imx-init-array-cleanup' and 'clk-rockchip' into clk-next * clk-mvebu-spdx: clk: mvebu: armada-37xx-periph: switch to SPDX license identifier * clk-meson: clk: meson: add gen_clk clk: meson: gxbb: remove HHI_GEN_CLK_CTNL duplicate definition clk: meson-axg: add clocks required by pcie driver clk: meson: remove unused clk-audio-divider driver clk: meson: stop rate propagation for audio clocks clk: meson: axg: add the audio clock controller driver clk: meson: add axg audio sclk divider driver clk: meson: add triple phase clock driver clk: meson: add clk-phase clock driver clk: meson: clean-up meson clock configuration clk: meson: remove obsolete register access clk: meson: expose GEN_CLK clkid clk: meson-axg: add pcie and mipi clock bindings dt-bindings: clock: add meson axg audio clock controller bindings clk: meson: audio-divider is one based clk: meson-gxbb: set fclk_div2 as CLK_IS_CRITICAL * clk-imx7d-mu: : - i.MX7D mailbox clk support clk: imx7d: add IMX7D_MU_ROOT_CLK * clk-imx-init-array-cleanup: : - i.MX clk init arrays removed in place of CLK_IS_CRITICAL clk: imx6sx: remove clks_init_on array clk: imx6sl: remove clks_init_on array clk: imx6q: remove clks_init_on array * clk-rockchip: clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 clk: rockchip: fix clk_i2sout parent selection bits on rk3399 clk: rockchip: add clock controller for px30 clk: rockchip: add support for half divider dt-bindings: add bindings for px30 clock controller clk: rockchip: add dt-binding header for px30 commit 139054634b4069a2e3892a8f6c3693ccca5f1c7d Merge: ea4f7872c71a d0897bc85ca8 f7b3182232c8 8097d4c75f00 da0d2239a56e 405fcacbd866 Author: Stephen Boyd Date: Tue Aug 14 22:58:42 2018 -0700 Merge branches 'clk-imx-critical', 'clk-tegra-bpmp', 'clk-tegra-124', 'clk-tegra-critical' and 'clk-tegra-emc-oob' into clk-next * clk-imx-critical: : - Convert to CLK_IS_CRITICAL for i.MX51/53 driver clk: imx51-imx53: Include sizes.h to silence compile errors clk: imx51-imx53: Annotate critical clocks as CLK_IS_CRITICAL * clk-tegra-bpmp: : - Fix Tegra BPMP driver oops when some xlating a NULL clk clk: tegra: bpmp: Don't crash when a clock fails to register * clk-tegra-124: : - Proper default configuration for vic03 and vde clks on Tegra124 clk: tegra: Make vde a child of pll_c3 clk: tegra: Make vic03 a child of pll_c3 * clk-tegra-critical: : - Mark Tegra memory controller clks as critical clk: tegra: Mark Memory Controller clock as critical * clk-tegra-emc-oob: : - Fix array bounds clamp in Tegra's emc determine_rate() op clk: tegra: emc: Avoid out-of-bounds bug commit ea4f7872c71adef8897f71bb6bb056856ccc8ed9 Merge: b183c6887af3 2b555a4b9cae 33f5104624b9 fc2065438936 cd88259a7215 9d8108f9f3cb Author: Stephen Boyd Date: Tue Aug 14 22:58:39 2018 -0700 Merge branches 'clk-ingenic-fixes', 'clk-max9485', 'clk-pxa-32k-pll', 'clk-aspeed' and 'clk-imx6sll-gpio' into clk-next * clk-ingenic-fixes: : - Ingenic i2s bit update and allow UDC clk to gate clk: ingenic: Add missing flag for UDC clock clk: ingenic: Fix incorrect data for the i2s clock * clk-max9485: : - Maxim 9485 Programmable Clock Generator clk: Add driver for MAX9485 dts: clk: add devicetree bindings for MAX9485 * clk-pxa-32k-pll: : - Expose 32 kHz PLL on PXA SoCs clk: pxa: export 32kHz PLL * clk-aspeed: : - Fix name of aspeed SDC clk define to have only one 'CLK' clk: aspeed: Fix SDCLK name * clk-imx6sll-gpio: : - imx6sll GPIO clk gate support clk: imx6sll: add GPIO LPCGs commit b183c6887af3bba1835bd4c9ef2de119afab737b Merge: 5ef7748ba37e a7047564fef3 cfb8282e18e2 964e3717e498 51b9a379a843 96e4ea8c253d Author: Stephen Boyd Date: Tue Aug 14 22:58:35 2018 -0700 Merge branches 'clk-imx6-video-parent', 'clk-qcom-sdm845-criticals', 'clk-renesas', 'clk-stratix10-fixes' and 'clk-atmel-i2s' into clk-next * clk-imx6-video-parent: : - Fix i.MX6QDL video clk parent clk: imx6: fix video_27m parent for IMX6QDL_CLK_CKO1_SEL * clk-qcom-sdm845-criticals: : - critical clk markings for qcom SDM845 clk: qcom: Enable clocks which needs to be always on for SDM845 * clk-renesas: clk: renesas: Renesas R9A06G032 clock driver dt-bindings: clock: renesas,r9a06g032-sysctrl: documentation dt-bindings: clock: Add the r9a06g032-sysctrl.h file clk: renesas: r8a7795: Add CCREE clock clk: renesas: r8a7795: Add CR clock * clk-stratix10-fixes: : - Fix Stratix10 mpu_free_clk and sdmmc_free_clk parents clk: socfpga: stratix10: fix the sdmmc_free_clk mux clk: socfpga: stratix10: fix the parents of mpu_free_clk * clk-atmel-i2s: : - Atmel at91 I2S audio clk support clk: at91: add I2S clock mux driver dt-bindings: clk: at91: add an I2S mux clock commit 5ef7748ba37e0b1667ae973c1162fa60c0248f49 Merge: 04cdd5af51c6 9461f7b33d11 9fba738a53dd e8f127caf63a 4a2eaa8e2567 Author: Stephen Boyd Date: Tue Aug 14 22:58:30 2018 -0700 Merge branches 'clk-qcom-set-rate-gate', 'clk-core-set-rate-gate', 'clk-core-duty-cycle', 'clk-si-prepare' and 'clk-imx-gpio-gates' into clk-next * clk-qcom-set-rate-gate: clk: qcom: drop CLK_SET_RATE_GATE from sdc clocks * clk-core-set-rate-gate: clk: fix CLK_SET_RATE_GATE with clock rate protection * clk-core-duty-cycle: clk: add duty cycle support * clk-si-prepare: : - SI544/SI514 clk on/off support clk-si514, clk-si544: Implement prepare/unprepare/is_prepared operations * clk-imx-gpio-gates: : - i.MX6UL GPIO clock gates in CCM CCGR clk: imx6ul: remove clks_init_on array clk: imx6ul: add GPIO clock gates dt-bindings: clock: imx6ul: Do not change the clock definition order commit c066fafc595eef5ae3c83ae3a8305956b8c3ef15 Author: Paul Mackerras Date: Tue Aug 14 20:37:45 2018 +1000 KVM: PPC: Book3S HV: Use correct pagesize in kvm_unmap_radix() Since commit e641a317830b ("KVM: PPC: Book3S HV: Unify dirty page map between HPT and radix", 2017-10-26), kvm_unmap_radix() computes the number of PAGE_SIZEd pages being unmapped and passes it to kvmppc_update_dirty_map(), which expects to be passed the page size instead. Consequently it will only mark one system page dirty even when a large page (for example a THP page) is being unmapped. The consequence of this is that part of the THP page might not get copied during live migration, resulting in memory corruption for the guest. This fixes it by computing and passing the page size in kvm_unmap_radix(). Cc: stable@vger.kernel.org # v4.15+ Fixes: e641a317830b (KVM: PPC: Book3S HV: Unify dirty page map between HPT and radix) Signed-off-by: Paul Mackerras commit 2bb7005696e2246baa88772341ca032ff09a63cb Author: Oleksij Rempel Date: Fri Aug 3 07:29:19 2018 +0200 mailbox: Add support for i.MX messaging unit The i.MX Messaging Unit is a two side block which allows applications implement communication over this sides. The MU includes the following features: - Messaging control by interrupts or by polling - Four general-purpose interrupt requests reflected to the other side - Three general-purpose flags reflected to the other side - Four receive registers with maskable interrupt - Four transmit registers with maskable interrupt Reviewed-by: Vladimir Zapolskiy Reviewed-by: Dong Aisheng Signed-off-by: Oleksij Rempel Signed-off-by: Jassi Brar commit d6ef139c83cc562b29a5cdac270f0a562c1c8eda Author: Oleksij Rempel Date: Fri Aug 3 07:29:17 2018 +0200 dt-bindings: mailbox: imx-mu: add generic MU channel support Each MU has four pairs of rx/tx data register with four rx/tx interrupts which can also be used as a separate channel. Reviewed-by: Rob Herring Signed-off-by: Oleksij Rempel Signed-off-by: Jassi Brar commit 480285bd11e63d9e225397516db39430f3e1b9c4 Author: Dong Aisheng Date: Fri Aug 3 07:29:16 2018 +0200 dt-bindings: arm: fsl: add mu binding doc The Messaging Unit module enables two processors within the SoC to communicate and coordinate by passing messages (e.g. data, status and control) through the MU interface. Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Mark Rutland Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Dong Aisheng Signed-off-by: Jassi Brar commit c5f45fbb464e49d94fc5e53e7f7885bcbb5be545 Author: Randy Dunlap Date: Tue Aug 7 09:42:15 2018 -0700 mailbox: add MODULE_LICENSE() for mtk-cmdq-mailbox.c Fix missing MODULE_LICENSE() in mtk-cmdq-mailbox.c: WARNING: modpost: missing MODULE_LICENSE() in drivers/mailbox/mtk-cmdq-mailbox.o Fixes: 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver") Signed-off-by: Randy Dunlap Cc: Cc: CK Hu Cc: Houlong Wei Signed-off-by: Jassi Brar commit 2538fb89b8f4ee9e1c1759cfb3c7989d9ef1f6e7 Author: Jakub Kicinski Date: Tue Aug 14 16:48:50 2018 -0700 PCI: Limit config space size for Netronome NFP5000 Like the NFP4000 and NFP6000, the NFP5000 as an erratum where reading/ writing to PCI config space addresses above 0x600 can cause the NFP to generate PCIe completion timeouts. Limit the NFP5000's PF's config space size to 0x600 bytes as is already done for the NFP4000 and NFP6000. The NFP5000's VF is 0x6003 (PCI_DEVICE_ID_NETRONOME_NFP6000_VF), the same device ID as the NFP6000's VF. Thus, its config space is already limited by the existing use of quirk_nfp6000(). Signed-off-by: Jakub Kicinski Signed-off-by: Bjorn Helgaas Reviewed-by: Tony Egan commit 31130a16d459de809cd1c03eabc9567d094aae6a Merge: 1202f4fdbcb6 3596924a233e Author: Linus Torvalds Date: Tue Aug 14 16:54:22 2018 -0700 Merge tag 'for-linus-4.19-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - add dma-buf functionality to Xen grant table handling - fix for booting the kernel as Xen PVH dom0 - fix for booting the kernel as a Xen PV guest with CONFIG_DEBUG_VIRTUAL enabled - other minor performance and style fixes * tag 'for-linus-4.19-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/balloon: fix balloon initialization for PVH Dom0 xen: don't use privcmd_call() from xen_mc_flush() xen/pv: Call get_cpu_address_sizes to set x86_virt/phys_bits xen/biomerge: Use true and false for boolean values xen/gntdev: don't dereference a null gntdev_dmabuf on allocation failure xen/spinlock: Don't use pvqspinlock if only 1 vCPU xen/gntdev: Implement dma-buf import functionality xen/gntdev: Implement dma-buf export functionality xen/gntdev: Add initial support for dma-buf UAPI xen/gntdev: Make private routines/structures accessible xen/gntdev: Allow mappings for DMA buffers xen/grant-table: Allow allocating buffers suitable for DMA xen/balloon: Share common memory reservation routines xen/grant-table: Make set/clear page private code shared commit 1202f4fdbcb6deeffd3eb39c94b8dc0cc8202b16 Merge: d0055f351e64 3c4d9137eefe Author: Linus Torvalds Date: Tue Aug 14 16:39:13 2018 -0700 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Will Deacon: "A bunch of good stuff in here. Worth noting is that we've pulled in the x86/mm branch from -tip so that we can make use of the core ioremap changes which allow us to put down huge mappings in the vmalloc area without screwing up the TLB. Much of the positive diffstat is because of the rseq selftest for arm64. Summary: - Wire up support for qspinlock, replacing our trusty ticket lock code - Add an IPI to flush_icache_range() to ensure that stale instructions fetched into the pipeline are discarded along with the I-cache lines - Support for the GCC "stackleak" plugin - Support for restartable sequences, plus an arm64 port for the selftest - Kexec/kdump support on systems booting with ACPI - Rewrite of our syscall entry code in C, which allows us to zero the GPRs on entry from userspace - Support for chained PMU counters, allowing 64-bit event counters to be constructed on current CPUs - Ensure scheduler topology information is kept up-to-date with CPU hotplug events - Re-enable support for huge vmalloc/IO mappings now that the core code has the correct hooks to use break-before-make sequences - Miscellaneous, non-critical fixes and cleanups" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (90 commits) arm64: alternative: Use true and false for boolean values arm64: kexec: Add comment to explain use of __flush_icache_range() arm64: sdei: Mark sdei stack helper functions as static arm64, kaslr: export offset in VMCOREINFO ELF notes arm64: perf: Add cap_user_time aarch64 efi/libstub: Only disable stackleak plugin for arm64 arm64: drop unused kernel_neon_begin_partial() macro arm64: kexec: machine_kexec should call __flush_icache_range arm64: svc: Ensure hardirq tracing is updated before return arm64: mm: Export __sync_icache_dcache() for xen-privcmd drivers/perf: arm-ccn: Use devm_ioremap_resource() to map memory arm64: Add support for STACKLEAK gcc plugin arm64: Add stack information to on_accessible_stack drivers/perf: hisi: update the sccl_id/ccl_id when MT is supported arm64: fix ACPI dependencies rseq/selftests: Add support for arm64 arm64: acpi: fix alignment fault in accessing ACPI efi/arm: map UEFI memory map even w/o runtime services enabled efi/arm: preserve early mapping of UEFI memory map longer for BGRT drivers: acpi: add dependency of EFI for arm64 ... commit b9f09866e0e964ab04968d44602fa3d9de5076f3 Author: Parav Pandit Date: Tue Aug 14 10:36:16 2018 +0300 IB/core: Avoid confusing del_netdev_default_ips Currently bond_delete_netdev_default_gids() is called by two callers. (a) del_netdev_default_ips_join() (b) del_netdev_default_ips() Both above functions changes the argument order while calling bond_delete_netdev_default_gids(). This required silly del_netdev_default_ips() wrapper. Additionally, del_netdev_default_ips() deletes default GIDs not IP based GIDs. del_netdev_default_ips() having _ips suffix is confusing. Therefore, get rid of confusing del_netdev_default_ips() and simplify bond_delete_netdev_default_gids() to follow same argument order as its caller. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 666e7099a41afbbc1fb3ee785cad808d2925e12a Author: Parav Pandit Date: Tue Aug 14 10:36:15 2018 +0300 IB/core: Add comment for change upper netevent handling Add comment for handling CHANGEUPPER netevent handling. To improve code readability, (a) move cmd definitions to its respective if-else branches, (b) avoid single line structure definitions. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 40b173ddce0fc6653a859889d1a90b5f5817061b Author: Yuval Bason Date: Thu Aug 9 17:29:38 2018 +0300 qedr: Add user space support for SRQ This patch adds support for SRQ's created in user space and update qedr_affiliated_event to deal with general SRQ events. Signed-off-by: Michal Kalderon Signed-off-by: Yuval Bason Signed-off-by: Jason Gunthorpe commit 3491c9e799fb96d909f22f3b39d8cca81e75c3a9 Author: Yuval Bason Date: Thu Aug 9 17:29:37 2018 +0300 qedr: Add support for kernel mode SRQ's Implement the SRQ specific verbs and update the poll_cq verb to deal with SRQ completions. Signed-off-by: Michal Kalderon Signed-off-by: Yuval Bason Signed-off-by: Jason Gunthorpe commit 1212767e23bbaba164cc7ea3a64115b3ae335063 Author: Yuval Bason Date: Thu Aug 9 17:29:36 2018 +0300 qedr: Add wrapping generic structure for qpidr and adjust idr routines. Today, we are using idr mechanism for QP's only. This patch prepares the qedr_idr stuctures and the idr routines for both QP's and SRQ's. Signed-off-by: Yuval Bason Signed-off-by: Michal Kalderon Signed-off-by: Jason Gunthorpe commit 99a24e02ccf6604e3020cf9e2c7a042b6ebb655f Author: Richard Weinberger Date: Thu Jul 12 13:02:00 2018 +0200 ubifs: Set default assert action to read-only Traditionally UBIFS just reported a failed assertion and moved on. The drawback is that users will notice UBIFS bugs when it is too late, most of the time when it is no longer about to mount. This makes bug hunting problematic since valuable information from failing asserts is long gone when UBIFS is dead. The other extreme, panic'ing on a failing assert is also not worthwhile, we want users and developers give a chance to collect as much debugging information as possible if UBIFS hits an assert. Therefore go for the third option, switch to read-only mode when an assert fails. That way UBIFS will not write possible bad data to the MTD and gives users the chance to collect debugging information. Signed-off-by: Richard Weinberger commit c38c5a7f2e5056555c22e7603c2151b118f3a494 Author: Richard Weinberger Date: Thu Jul 12 13:01:59 2018 +0200 ubifs: Allow setting assert action as mount parameter Expose our three options to userspace. Signed-off-by: Richard Weinberger commit 2e52eb74463f15c745d64948cedfaee722d6268c Author: Richard Weinberger Date: Thu Jul 12 13:01:58 2018 +0200 ubifs: Rework ubifs_assert() With having access to struct ubifs_info in ubifs_assert() we can give more information when an assert is failing. By using ubifs_err() we can tell which UBIFS instance failed. Also multiple actions can be taken now. We support: - report: This is what UBIFS did so far, just report the failure and go on. - read-only: Switch to read-only mode. - panic: shoot the kernel in the head. Signed-off-by: Richard Weinberger commit 6eb61d587f4515e4be5669eff383c0185009954f Author: Richard Weinberger Date: Thu Jul 12 13:01:57 2018 +0200 ubifs: Pass struct ubifs_info to ubifs_assert() This allows us to have more context in ubifs_assert() and take different actions depending on the configuration. Signed-off-by: Richard Weinberger commit 54169ddd382d461f7c01cc5a5182a4b4bc539489 Author: Richard Weinberger Date: Thu Jul 12 13:01:56 2018 +0200 ubifs: Turn two ubifs_assert() into a WARN_ON() We are going to pass struct ubifs_info to ubifs_assert() but while unloading the UBIFS module we don't have the info struct anymore. Therefore replace the asserts by a regular WARN_ON(). Signed-off-by: Richard Weinberger commit c355aa465fce5b446789348a2c50c3eb58ee6756 Author: Quentin Schulz Date: Mon Jul 2 11:43:51 2018 +0200 ubi: expose the volume CRC check skip flag Now that we have the logic for skipping CRC check for static UBI volumes in the core, let's expose it to users. This makes use of a padding byte in the volume description data structure as a flag. This flag only tell for now whether we should skip the CRC check of a volume. This checks the UBI volume for which we are trying to skip the CRC check is static. Let's also make sure that the flags passed to verify_mkvol_req are valid. We voluntarily do not take into account the skip_check flag in vol_cdev_write() as we want to make sure what we wrote was correctly written. Suggested-by: Boris Brezillon Signed-off-by: Quentin Schulz Reviewed-by: Boris Brezillon Signed-off-by: Richard Weinberger commit 62652517753f3cdddce10935139cfa6e00f8da33 Author: Quentin Schulz Date: Mon Jul 2 11:43:50 2018 +0200 ubi: provide a way to skip CRC checks Some users of static UBI volumes implement their own integrity check, thus making the volume CRC check done at open time useless. For instance, this is the case when one use the ubiblock + dm-verity + squashfs combination, where dm-verity already checks integrity of the block device but this time at the block granularity instead of verifying the whole volume. Skipping this test drastically improves the boot-time. Suggested-by: Boris Brezillon Signed-off-by: Quentin Schulz Reviewed-by: Boris Brezillon Reviewed-by: Richard Weinberger Signed-off-by: Richard Weinberger commit a3d218280c273f298b0a17902bc2b4aa3f1dae06 Author: Richard Weinberger Date: Mon Jul 2 23:47:13 2018 +0200 ubifs: Use kmalloc_array() Since commit 6da2ec56059c ("treewide: kmalloc() -> kmalloc_array()") we use kmalloc_array() for kmalloc() that computes the length with a multiplication. Cc: Kees Cook Suggested-by: Kees Cook Signed-off-by: Richard Weinberger Reviewed-by: Kees Cook Signed-off-by: Richard Weinberger commit 95a22d2084d72ea067d8323cc85677dba5d97cae Author: Richard Weinberger Date: Sun Jul 1 23:20:51 2018 +0200 ubifs: Check data node size before truncate Check whether the size is within bounds before using it. If the size is not correct, abort and dump the bad data node. Cc: Kees Cook Cc: Silvio Cesare Cc: stable@vger.kernel.org Fixes: 1e51764a3c2ac ("UBIFS: add new flash file system") Reported-by: Silvio Cesare Signed-off-by: Richard Weinberger Reviewed-by: Kees Cook Signed-off-by: Richard Weinberger commit 08acbdd6fd736b90f8d725da5a0de4de2dd6de62 Author: Richard Weinberger Date: Sun Jul 1 23:20:50 2018 +0200 Revert "UBIFS: Fix potential integer overflow in allocation" This reverts commit 353748a359f1821ee934afc579cf04572406b420. It bypassed the linux-mtd review process and fixes the issue not as it should. Cc: Kees Cook Cc: Silvio Cesare Cc: stable@vger.kernel.org Signed-off-by: Richard Weinberger commit 49d2e05fb474718804cd3d1ec1e07213ecffc040 Author: Richard Weinberger Date: Mon Aug 13 15:14:45 2018 +0200 ubifs: Add comment on c->commit_sem Every single time I come across that code, I get confused because it looks like a possible dead lock. Help myself by adding a comment. Signed-off-by: Richard Weinberger commit 7e5471ce6dba5f28a3c7afdfe168655d236f677b Author: Stefan Agner Date: Tue Jul 31 15:13:20 2018 +0200 ubifs: introduce Kconfig symbol for xattr support Allow to disable extended attribute support. This aids in reliability testing, especially since some xattr related bugs have surfaced. Also an embedded system might not need it, so this allows for a slightly smaller kernel (about 4KiB). Signed-off-by: Stefan Agner Signed-off-by: Richard Weinberger commit 1bf0572fe27030a0e82fc60f8323a2114c2b69d3 Author: Gustavo A. R. Silva Date: Tue Jul 17 11:56:43 2018 -0500 ubifs: use swap macro in swap_dirty_idx Make use of the swap macro and remove unnecessary variable *t*. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Richard Weinberger commit 3d95b89e573bb8460886ff2ca769b067bfcc50aa Author: Prarit Bhargava Date: Mon Aug 13 08:43:09 2018 -0400 x86/ACPI/cstate: Make APCI C1 FFH MWAIT C-state description vendor-neutral Commit 5209654a46ee (x86/ACPI/cstate: Allow ACPI C1 FFH MWAIT use on AMD systems) forgot to update the ACPI C1 idle state description and tools like turbostat display "ACPI FFH INTEL MWAIT 0x0" which is quite confusing on an AMD system. Drop the "INTEL" part from the ACPI C1 FFH MWAIT C-state description to avoid confusion. Fixes: 5209654a46ee (x86/ACPI/cstate: Allow ACPI C1 FFH MWAIT use on AMD systems) Signed-off-by: Prarit Bhargava [ rjw: Subject & changelog ] Signed-off-by: Rafael J. Wysocki commit 6855dc41b24619c3d1de3dbd27dd0546b0e45272 Author: Adrian Hunter Date: Wed Jun 6 15:54:11 2018 +0300 x86: Add entry trampolines to kcore Without program headers for PTI entry trampoline pages, the trampoline virtual addresses do not map to anything. Example before: sudo gdb --quiet vmlinux /proc/kcore Reading symbols from vmlinux...done. [New process 1] Core was generated by `BOOT_IMAGE=/boot/vmlinuz-4.16.0 root=UUID=a6096b83-b763-4101-807e-f33daff63233'. #0 0x0000000000000000 in irq_stack_union () (gdb) x /21ib 0xfffffe0000006000 0xfffffe0000006000: Cannot access memory at address 0xfffffe0000006000 (gdb) quit After: sudo gdb --quiet vmlinux /proc/kcore [sudo] password for ahunter: Reading symbols from vmlinux...done. [New process 1] Core was generated by `BOOT_IMAGE=/boot/vmlinuz-4.16.0-fix-4-00005-gd6e65a8b4072 root=UUID=a6096b83-b7'. #0 0x0000000000000000 in irq_stack_union () (gdb) x /21ib 0xfffffe0000006000 0xfffffe0000006000: swapgs 0xfffffe0000006003: mov %rsp,-0x3e12(%rip) # 0xfffffe00000021f8 0xfffffe000000600a: xchg %ax,%ax 0xfffffe000000600c: mov %cr3,%rsp 0xfffffe000000600f: bts $0x3f,%rsp 0xfffffe0000006014: and $0xffffffffffffe7ff,%rsp 0xfffffe000000601b: mov %rsp,%cr3 0xfffffe000000601e: mov -0x3019(%rip),%rsp # 0xfffffe000000300c 0xfffffe0000006025: pushq $0x2b 0xfffffe0000006027: pushq -0x3e35(%rip) # 0xfffffe00000021f8 0xfffffe000000602d: push %r11 0xfffffe000000602f: pushq $0x33 0xfffffe0000006031: push %rcx 0xfffffe0000006032: push %rdi 0xfffffe0000006033: mov $0xffffffff91a00010,%rdi 0xfffffe000000603a: callq 0xfffffe0000006046 0xfffffe000000603f: pause 0xfffffe0000006041: lfence 0xfffffe0000006044: jmp 0xfffffe000000603f 0xfffffe0000006046: mov %rdi,(%rsp) 0xfffffe000000604a: retq (gdb) quit In addition, entry trampolines all map to the same page. Represent that by giving the corresponding program headers in kcore the same offset. This has the benefit that, when perf tools uses /proc/kcore as a source for kernel object code, samples from different CPU trampolines are aggregated together. Note, such aggregation is normal for profiling i.e. people want to profile the object code, not every different virtual address the object code might be mapped to (across different processes for example). Notes by PeterZ: This also adds the KCORE_REMAP functionality. Signed-off-by: Adrian Hunter Acked-by: Andi Kleen Acked-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Dave Hansen Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Joerg Roedel Cc: Thomas Gleixner Cc: x86@kernel.org Link: http://lkml.kernel.org/r/1528289651-4113-4-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d83212d5dd6761625fe87cc23016bbaa47303271 Author: Alexander Shishkin Date: Wed Jun 6 15:54:10 2018 +0300 kallsyms, x86: Export addresses of PTI entry trampolines Currently, the addresses of PTI entry trampolines are not exported to user space. Kernel profiling tools need these addresses to identify the kernel code, so add a symbol and address for each CPU's PTI entry trampoline. Signed-off-by: Alexander Shishkin Acked-by: Andi Kleen Acked-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Dave Hansen Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Joerg Roedel Cc: Thomas Gleixner Cc: x86@kernel.org Link: http://lkml.kernel.org/r/1528289651-4113-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b96679422007c3fa04625be14977904c27c722eb Author: Adrian Hunter Date: Wed Jun 6 15:54:09 2018 +0300 kallsyms: Simplify update_iter_mod() The logic in update_iter_mod() is overcomplicated and gets worse every time another get_ksymbol_* function is added. In preparation for adding another get_ksymbol_* function, simplify logic in update_iter_mod(). Signed-off-by: Adrian Hunter Tested-by: (ftrace changes only) Steven Rostedt (VMware) Acked-by: Andi Kleen Acked-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Dave Hansen Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Joerg Roedel Cc: Thomas Gleixner Cc: x86@kernel.org Link: http://lkml.kernel.org/r/1528289651-4113-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit f390c5eb2858c9fceccba7c4118003b6baf9176a Author: Rafael J. Wysocki Date: Tue Aug 14 12:39:02 2018 +0200 cpuidle: menu: Fix white space Fix some damaged white space in menu_select(). Signed-off-by: Rafael J. Wysocki commit 3df6f61fff49632492490fb6e42646b803a9958a Author: zhangyi (F) Date: Tue Aug 14 10:34:42 2018 +0800 PM / sleep: wakeup: Fix build error caused by missing SRCU support Commit ea0212f40c6 (power: auto select CONFIG_SRCU) made the code in drivers/base/power/wakeup.c use SRCU instead of RCU, but it forgot to select CONFIG_SRCU in Kconfig, which leads to the following build error if CONFIG_SRCU is not selected somewhere else: drivers/built-in.o: In function `wakeup_source_remove': (.text+0x3c6fc): undefined reference to `synchronize_srcu' drivers/built-in.o: In function `pm_print_active_wakeup_sources': (.text+0x3c7a8): undefined reference to `__srcu_read_lock' drivers/built-in.o: In function `pm_print_active_wakeup_sources': (.text+0x3c84c): undefined reference to `__srcu_read_unlock' drivers/built-in.o: In function `device_wakeup_arm_wake_irqs': (.text+0x3d1d8): undefined reference to `__srcu_read_lock' drivers/built-in.o: In function `device_wakeup_arm_wake_irqs': (.text+0x3d228): undefined reference to `__srcu_read_unlock' drivers/built-in.o: In function `device_wakeup_disarm_wake_irqs': (.text+0x3d24c): undefined reference to `__srcu_read_lock' drivers/built-in.o: In function `device_wakeup_disarm_wake_irqs': (.text+0x3d29c): undefined reference to `__srcu_read_unlock' drivers/built-in.o:(.data+0x4158): undefined reference to `process_srcu' Fix this error by selecting CONFIG_SRCU when PM_SLEEP is enabled. Fixes: ea0212f40c6 (power: auto select CONFIG_SRCU) Cc: 4.2+ # 4.2+ Signed-off-by: zhangyi (F) [ rjw: Minor subject/changelog fixups ] Signed-off-by: Rafael J. Wysocki commit 6cff57320275b52d0a84b616602539c79e8d7117 Author: Arnd Bergmann Date: Fri Jul 13 16:31:56 2018 +0200 ubifs: tnc: use monotonic znode timestamp The tnc uses get_seconds() based timestamps to check the age of a znode, which has two problems: on 32-bit architectures this may overflow in 2038 or 2106, and it gives incorrect information when the system time is updated using settimeofday(). Using montonic timestamps with ktime_get_seconds() solves both thes problems. Signed-off-by: Arnd Bergmann Signed-off-by: Richard Weinberger commit 0eca0b8067c4dfa405e38abb4c3a87b1df14513c Author: Arnd Bergmann Date: Fri Jul 13 16:31:55 2018 +0200 ubifs: use timespec64 for inode timestamps Both vfs and the on-disk inode structures can deal with fine-grained timestamps now, so this is the last missing piece to make ubifs y2038-safe on 32-bit architectures. Signed-off-by: Arnd Bergmann Signed-off-by: Richard Weinberger commit 11a6fc3dc743e22fb50f2196ec55bee5140d3c52 Author: Richard Weinberger Date: Sun Jul 8 23:33:25 2018 +0200 ubifs: xattr: Don't operate on deleted inodes xattr operations can race with unlink and the following assert triggers: UBIFS assert failed in ubifs_jnl_change_xattr at 1606 (pid 6256) Fix this by checking i_nlink before working on the host inode. Cc: Fixes: 1e51764a3c2a ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger commit 312c39bd6d515122b4b0022780e46c63ea9b8bec Author: Richard Weinberger Date: Sun Jul 8 23:24:46 2018 +0200 ubifs: gc: Fix typo UBIFS operates on LEBs, not PEBs. Signed-off-by: Richard Weinberger commit eef19816ada3abd56d9f20c88794cc2fea83ebb2 Author: Richard Weinberger Date: Tue Jun 12 20:49:45 2018 +0200 ubifs: Fix memory leak in lprobs self-check Allocate the buffer after we return early. Otherwise memory is being leaked. Cc: Fixes: 1e51764a3c2a ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger commit 25677478474a91fa1b46f19a4a591a9848bca6fb Author: Richard Weinberger Date: Tue Jun 12 09:33:16 2018 +0200 ubi: Initialize Fastmap checkmapping correctly We cannot do it last, otherwithse it will be skipped for dynamic volumes. Reported-by: Lachmann, Juergen Fixes: 34653fd8c46e ("ubi: fastmap: Check each mapping only once") Signed-off-by: Richard Weinberger commit 59965593205fa4044850d35ee3557cf0b7edcd14 Author: Richard Weinberger Date: Tue Jun 12 00:52:28 2018 +0200 ubifs: Fix synced_i_size calculation for xattr inodes In ubifs_jnl_update() we sync parent and child inodes to the flash, in case of xattrs, the parent inode (AKA host inode) has a non-zero data_len. Therefore we need to adjust synced_i_size too. This issue was reported by ubifs self tests unter a xattr related work load. UBIFS error (ubi0:0 pid 1896): dbg_check_synced_i_size: ui_size is 4, synced_i_size is 0, but inode is clean UBIFS error (ubi0:0 pid 1896): dbg_check_synced_i_size: i_ino 65, i_mode 0x81a4, i_size 4 Cc: Fixes: 1e51764a3c2a ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger commit 00ee8b60102862f4daf0814d12a2ea2744fc0b9b Author: Richard Weinberger Date: Mon Jun 11 23:41:09 2018 +0200 ubifs: Fix directory size calculation for symlinks We have to account the name of the symlink and not the target length. Fixes: ca7f85be8d6c ("ubifs: Add support for encrypted symlinks") Cc: Signed-off-by: Richard Weinberger commit 99cbbe56eb8bede625f410ab62ba34673ffa7d21 Author: Adrian Hunter Date: Tue Aug 14 11:46:08 2018 +0300 perf auxtrace: Fix queue resize When the number of queues grows beyond 32, the array of queues is resized but not all members were being copied. Fix by also copying 'tid', 'cpu' and 'set'. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Fixes: e502789302a6e ("perf auxtrace: Add helpers for queuing AUX area tracing data") Link: http://lkml.kernel.org/r/20180814084608.6563-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d0055f351e647f33f3b0329bff022213bf8aa085 Author: Vlastimil Babka Date: Tue Aug 14 23:38:57 2018 +0200 x86/smp: fix non-SMP broken build due to redefinition of apic_id_is_primary_thread The function has an inline "return false;" definition with CONFIG_SMP=n but the "real" definition is also visible leading to "redefinition of ‘apic_id_is_primary_thread’" compiler error. Guard it with #ifdef CONFIG_SMP Signed-off-by: Vlastimil Babka Fixes: 6a4d2657e048 ("x86/smp: Provide topology_is_primary_thread()") Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds commit 269777aa530f3438ec1781586cdac0b5fe47b061 Author: Abel Vesa Date: Wed Aug 15 00:26:00 2018 +0300 cpu/hotplug: Non-SMP machines do not make use of booted_once Commit 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once") breaks non-SMP builds. [ I suspect the 'bool' fields should just be made to be bitfields and be exposed regardless of configuration, but that's a separate cleanup that I'll leave to the owners of this file for later. - Linus ] Fixes: 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once") Cc: Dave Hansen Cc: Thomas Gleixner Cc: Tony Luck Signed-off-by: Abel Vesa Signed-off-by: Linus Torvalds commit b5c16c7925fb9b7b1bb15c00bc20d5e24b7ab77f Author: Hans de Goede Date: Sun Aug 12 18:33:44 2018 +0200 ACPI / PMIC: CrystalCove: Extend PMOP support to support all possible fields Prior to this commit the CRC PMOP handler only supported the X285 and V18X PMOP fields. Leading to errors like these on device using the VBUS field: [ 765.766489] ACPI Error: AE_BAD_PARAMETER, Returned by Handler for [UserDefinedRegion] (20180531/evregion-266) [ 765.766526] ACPI Error: Method parse/execution failed \_SB.I2C1.BATC._BST, AE_BAD_PARAMETER (20180531/psparse-516) [ 765.766586] ACPI Error: AE_BAD_PARAMETER, Evaluating _BST (20180531/battery-577) This commit adds support for all known fields to the CRC PMOP OpRegion handler, the name and register info in this commit comes from: https://github.com/01org/ProductionKernelQuilts/blob/master/uefi/cht-m1stable/patches/0002-ACPI-Adding-support-for-WC-and-CRC-opregion.patch Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki commit f317c7dc12b73eb9d67fdae404563deb907dcfb7 Author: Rafael J. Wysocki Date: Sun Aug 12 12:50:09 2018 +0200 ACPICA: Clear status of all events when entering sleep states Commit fa85015c0d95 (ACPICA: Clear status of all events when entering S5) made the sleep state entry code in ACPICA clear the status of all ACPI events when entering S5 to fix a functional regression reported against commit 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume). However, it is reported now that the regression also affects system states other than S5 on some systems and causes them to wake up from sleep prematurely. For this reason, make the code in question clear the status of all ACPI events when entering all sleep states (in addition to S5) to avoid the premature wakeups (this may cause some wakeup events to be missed in theory, but the likelihood of that is small and the change here simply restores the previous behavior of the code). Fixes: 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume) Reported-by: Paul Menzel Tested-by: Paul Menzel Cc: 4.17+ # 4.17+: fa85015c0d95 ACPICA: Clear status ... Signed-off-by: Rafael J. Wysocki commit 5508672d7f4949f15c316ffd947228f130498534 Author: Arnaldo Carvalho de Melo Date: Tue Aug 14 18:00:40 2018 -0300 perf python: Remove -mcet and -fcf-protection when building with clang These options are not present in older clang versions, so when we build for a distro that has a gcc new enough to have these options and that the distro python build config settings use them but clang doesn't support, b00m. This is the case with fedora 28 and rawhide, so check if clang has the options and remove the missing ones from CFLAGS. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-7asds7yn6gzg6ns1lw17ukul@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4efa829d195172d630dcd1b2f9b239bcce69639e Author: Bob Moore Date: Fri Aug 10 14:43:04 2018 -0700 ACPICA: Update version to 20180810 Version 20180810. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 8b66fcfdee683072d416b6f12a9be6acd81f20ba Author: Bob Moore Date: Fri Aug 10 14:43:03 2018 -0700 ACPICA: acpiexec: fix a small memory leak regression Eliminates warnings only seen when acpiexec exits. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 8b23570ab001c1982c8a068cde468ff067255314 Author: Erik Schmauss Date: Fri Aug 10 14:43:02 2018 -0700 ACPICA: Reference Counts: increase max to 0x4000 for large servers Increase the reference count limit to 0x4000 as the current one is not sufficient for some large server systems. Reviewed-by: Dimitri Sivanich Tested-by: Russ Anderson Reported-by: Mike Travis Signed-off-by: Mike Travis Signed-off-by: Erik Schmauss [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki commit ff5340f8ac94d65609424675d587c030da951a53 Author: Erik Schmauss Date: Fri Aug 10 14:43:01 2018 -0700 ACPICA: Reference count: add additional debugging details Make reference counting diagnostics provide more information on what has happened. Signed-off-by: Erik Schmauss [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki commit 77d4e0966a8a6f8a3aa9d27b067a1fc0ec10628d Author: Erik Schmauss Date: Fri Aug 10 14:43:00 2018 -0700 ACPICA: acpi_exec: fixing -fi option Field elements listed in the init file used to be initialized after the table load and before executing module-level code blocks. The recent changes in module-level code mean that the table load becomes a method execution. If fields are used within module-level code and we are executing with -fi option, then these values are populated after the table has finished loading. This commit changes the initialization of objects listed in the init file so that field unit values are populated during the table load. Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit fb2ef998af44fb94214f3cf1c0e85d7a4e642fcb Author: Bob Moore Date: Fri Aug 10 14:42:59 2018 -0700 ACPICA: Debugger: Cleanup interface to the AML disassembler If the disassembler is configured out (such as when the debugger is part of a kernel), these debugger commands are disabled: List Disassemble Further, the Debug (single-step) command is simplified because each line of code cannot be disassembled. Reported-by: Colin Ian King Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 4a7c94c721074eafb27298d93dbcc339aa28e745 Author: Erik Schmauss Date: Fri Aug 10 14:42:58 2018 -0700 ACPICA: AML Parser: skip opcodes that open a scope upon parse failure This change skips the entire length of opcodes that open a scope (Device, Scope, Processor, etc) if the creation of the op fails. The failure could be caused by various errors including AE_ALREADY_EXISTS and AE_NOT_FOUND. Reported-by: Jeremy Linton Tested-by: Jeremy Linton Signed-off-by: Erik Schmauss Cc: 4.17+ # 4.17+ Signed-off-by: Rafael J. Wysocki commit 089b2bec97bbddb519e849a58b1ba8cc9880a4e5 Author: Erik Schmauss Date: Fri Aug 10 14:42:57 2018 -0700 ACPICA: Utilities: split hex detection into smaller functions acpi_ut_implicit_strtoul64() called acpi_ut_detect_hex_prefix() and ignored the return value. Instead, use acpi_ut_remove_hex_prefix(). Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 8a55c696d327008b003957d828ff04b81ead5dd1 Author: Bob Moore Date: Fri Aug 10 14:42:56 2018 -0700 ACPICA: Update an error message for a duplicate table In this case, the exception AE_ALREADY_EXISTS is more appropriate. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit f016b19a9275089a2ab06c2144567c2ad8d5d6ad Author: Erik Schmauss Date: Fri Aug 10 14:42:55 2018 -0700 ACPICA: ACPICA: add status check for acpi_hw_read before assigning return value The value coming from acpi_hw_read() should not be used if it returns an error code, so check the status returned by it before using that value in two places in acpi_hw_register_read(). Reported-by: Mark Gross Signed-off-by: Erik Schmauss [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki commit d46b6537f0ceed303047da918ed951f074a99288 Author: Erik Schmauss Date: Fri Aug 10 14:42:54 2018 -0700 ACPICA: AML Parser: ignore all exceptions resulting from incorrect AML during table load Macros to classify different AML exception codes have been added in order to ignore the exceptions, Signed-off-by: Erik Schmauss [ rjw: Fix damaged white space ] Signed-off-by: Rafael J. Wysocki commit 26dcc12c009e3222f8b975f23c605516a5d3b29f Author: Krzysztof Kozlowski Date: Tue Aug 7 18:19:19 2018 +0200 rtc: s5m: Add SPDX license identifier Replace GPL v2.0+ license statement with SPDX license identifier. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Alexandre Belloni commit 734c5cd5bc2f391ece9ab71b35abb33dfa5713ec Author: Krzysztof Kozlowski Date: Tue Aug 7 18:19:18 2018 +0200 rtc: maxim: Add SPDX license identifiers Replace GPL v2.0+ license statements with SPDX license identifiers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Alexandre Belloni commit 0625b4ba1a5d4703c7fb01c497bd6c156908af00 Author: Jason Gunthorpe Date: Tue Aug 14 15:33:52 2018 -0600 IB/mlx5: Fix leaking stack memory to userspace mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes were written. Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp") Cc: Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e6ecec342fefc2df01438cb0b8bacdd8641a6418 Merge: 747f62305dfb 3d83d3188460 Author: Linus Torvalds Date: Tue Aug 14 14:29:31 2018 -0700 Merge tag 'docs-4.19' of git://git.lwn.net/linux Pull documentation update from Jonathan Corbet: "This was a moderately busy cycle for docs, with the usual collection of small fixes and updates. We also have new ktime_get_*() docs from Arnd, some kernel-doc fixes, a new set of Italian translations (non so se vale la pena, ma non fa male - speriamo bene), and some extensive early memory-management documentation improvements from Mike Rapoport" * tag 'docs-4.19' of git://git.lwn.net/linux: (52 commits) Documentation: corrections to console/console.txt Documentation: add ioctl number entry for v4l2-subdev.h Remove gendered language from management style documentation scripts/kernel-doc: Escape all literal braces in regexes docs/mm: add description of boot time memory management docs/mm: memblock: add overview documentation docs/mm: memblock: add kernel-doc description for memblock types docs/mm: memblock: add kernel-doc comments for memblock_add[_node] docs/mm: memblock: update kernel-doc comments mm/memblock: add a name for memblock flags enumeration docs/mm: bootmem: add overview documentation docs/mm: bootmem: add kernel-doc description of 'struct bootmem_data' docs/mm: bootmem: fix kernel-doc warnings docs/mm: nobootmem: fixup kernel-doc comments mm/bootmem: drop duplicated kernel-doc comments Documentation: vm.txt: Adding 'nr_hugepages_mempolicy' parameter description. doc:it_IT: translation for kernel-hacking docs: Fix the reference labels in Locking.rst doc: tracing: Fix a typo of trace_stat mm: Introduce new type vm_fault_t ... commit 6f7ea94acbb751f617bfd674086b388460ee5b3b Author: Denis Osterland Date: Tue Jul 24 11:31:22 2018 +0000 rtc: isl1219: add device tree documentation The devicetree documentation for the ISL1219 device tree binding is added with a short example. It is not a trivial device, because it supports two interrupt sources. Signed-off-by: Denis Osterland Reviewed-by: Rob Herring Signed-off-by: Alexandre Belloni commit cfa30622c854747aba9c920c7dd30e5a123a414f Author: Denis Osterland Date: Tue Jul 24 11:31:21 2018 +0000 rtc: isl1208: set ev-evienb bit from device tree Add support to disable event in pull-up. Signed-off-by: Denis Osterland Signed-off-by: Alexandre Belloni commit 923aa4c378f9c7bbe2dff6f5632f95815b7700e9 Author: Heiner Kallweit Date: Sun Aug 5 22:31:03 2018 +0200 PCI/MSI: Set IRQCHIP_ONESHOT_SAFE for PCI-MSI irqchips If flag IRQCHIP_ONESHOT_SAFE isn't set for an irqchip and we have a threaded interrupt with no primary handler, flag IRQF_ONESHOT needs to be set for the interrupt, causing some overhead in the threaded interrupt handler. For more detailed explanation also check following comment in __setup_irq(): The interrupt was requested with handler = NULL, so we use the default primary handler for it. But it does not have the oneshot flag set. In combination with level interrupts this is deadly, because the default primary handler just wakes the thread, then the irq lines is reenabled, but the device still has the level irq asserted. Rinse and repeat.... While this works for edge type interrupts, we play it safe and reject unconditionally because we can't say for sure which type this interrupt really has. The type flags are unreliable as the underlying chip implementation can override them. Another comment in __setup_irq() gives a hint already that this overhead can be avoided for PCI-MSI: Some irq chips like MSI based interrupts are per se one shot safe. Check the chip flags, so we can avoid the unmask dance at the end of the threaded handler for those. Following this let's mark all PCI-MSI irqchips as oneshot-safe. See also discussion here: https://lkml.kernel.org/r/alpine.DEB.2.21.1808032136490.1658@nanos.tec.linutronix.de Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas commit 747f62305dfb8a592835c7401069bfdbc06acbae Merge: 2c20443ec221 f5b6c1fcb42f Author: Linus Torvalds Date: Tue Aug 14 14:10:30 2018 -0700 Merge tag 'sound-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "It's been busy summer weeks and hence lots of changes, partly for a few new drivers and partly for a wide range of fixes. Here are highlights: ALSA Core: - Fix rawmidi buffer management, code cleanup / refactoring - Fix the SG-buffer page handling with incorrect fallback size - Fix the stall at virmidi trigger callback with a large buffer; also offloading and code-refactoring along with it - Various ALSA sequencer code cleanups ASoC: - Deploy the standard snd_pcm_stop_xrun() helper in several drivers - Support for providing name prefixes to generic component nodes - Quite a few fixes for DPCM as it gains a bit wider use and more robust testing - Generalization of the DIO2125 support to a simple amplifier driver - Accessory detection support for the audio graph card - DT support for PXA AC'97 devices - Quirks for a number of new x86 systems - Support for AM Logic Meson, Everest ES7154, Intel systems with RT5682, Qualcomm QDSP6 and WCD9335, Realtek RT5682 and TI TAS5707 HD-audio: - Code refactoring in HD-audio ext codec codes to drop own classes; preliminary works for the upcoming legacy codec support - Generalized DRM audio component for the upcoming radeon / amdgpu support - Unification of mic mute-LED and GPIO support for various codecs - Further improvement of CA0132 codec support including Recon3D - Proper vga_switcheroo handling for AMD i-GPU - Update of model list in documentation - Fixups for another HP Spectre x360, Conexant codecs, power-save blacklist update USB-audio: - Fix the invalid sample rate setup with external clock - Support of UAC3 selector units and processing units - Basic UAC3 power-domain support - Support for Encore mDSD and Thesycon-based DSD devices - Preparation for future complete callback changes Firewire: - Add support for MOTU Traveler Misc: - The endianess notation fixes in various drivers - Add fall-through comment in lots of drivers - Various sparse warning fixes, e.g. about PCM format types" * tag 'sound-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (529 commits) ASoC: adav80x: mark expected switch fall-through ASoC: da7219: Add delays to capture path to remove DC offset noise ALSA: usb-audio: Mark expected switch fall-through ALSA: mixart: Mark expected switch fall-through ALSA: opl3: Mark expected switch fall-through ALSA: hda/ca0132 - Add exit commands for Recon3D ALSA: hda/ca0132 - Change mixer controls for Recon3D ALSA: hda/ca0132 - Add Recon3D input and output select commands ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D ALSA: hda/ca0132 - Add Recon3D startup functions and setup ALSA: hda/ca0132 - Add bool variable to enable/disable pci region2 mmio ALSA: hda/ca0132 - Add Recon3D pincfg ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D ALSA: hda/ca0132 - Add alt_functions unsolicited response ALSA: hda/ca0132 - Clean up ca0132_init function. ALSA: hda/ca0132 - Create mmio gpio function to make code clearer ASoC: wm_adsp: Make DSP name configurable by codec driver ASoC: wm_adsp: Declare firmware controls from codec driver ASoC: max98373: Added software reset register to readable registers ASoC: wm_adsp: Correct DSP pointer for preloader control ... commit 6eaf2781137842429c447bb491402b231df8a0f1 Author: Bert Kenward Date: Thu Jul 26 16:21:29 2018 +0100 PCI/VPD: Check for VPD access completion before checking for timeout Previously we checked the timeout before checking the VPD access completion bit. On a very heavily loaded system this can cause VPD access to timeout. Check the completion bit before checking the timeout. Signed-off-by: Bert Kenward Signed-off-by: Bjorn Helgaas commit 9ece7cd833a3e5e0740e2b681abe6ce5e6af6885 Author: Denis Osterland Date: Tue Jul 24 11:31:21 2018 +0000 rtc: isl1208: Add "evdet" interrupt source for isl1219 Add support for "evdet" named interrupt source. The check if i2c client irq matches evdet irq is needed for the case that there is only one interrupt named "evdet". In this case i2c client code handles this like an unnamed interrupt souce and assigns the value. Signed-off-by: Denis Osterland Reviewed-by: Michael Grzeschik Signed-off-by: Alexandre Belloni commit b72ae8cac0caff86fe414fceb940655c2d1371c9 Author: Andy Shevchenko Date: Sun Jul 29 16:16:56 2018 +0300 PCI: Add PCI_DEVICE_DATA() macro to fully describe device ID entry There are a lot of examples in the kernel where PCI_VDEVICE() is used and still looks not so convenient due to additional driver_data field attached. Introduce PCI_DEVICE_DATA() macro to fully describe device ID entry in shortest possible form. For example, before: { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD), (kernel_ulong_t) &dwc3_pci_mrfld_properties, }, after: { PCI_DEVICE_DATA(INTEL, MRFLD, &dwc3_pci_mrfld_properties) }, Drivers can be converted later on in independent way. While here, remove the unused macro with the same name from Ralink wireless driver. Signed-off-by: Andy Shevchenko Signed-off-by: Bjorn Helgaas Acked-by: Kalle Valo # for rt2x00 commit dd35bdb0768f1d03b043c4ba704fe9760eaa5891 Author: Michael Grzeschik Date: Tue Jul 24 11:31:21 2018 +0000 rtc: isl1208: add support for isl1219 with tamper detection We add support for the ISL1219 chip that got an integrated tamper detection function. This patch implements the feature by adding an additional timestamp0 file to sysfs device path. This file contains seconds since epoch, if an event occurred, or is empty, if none occurred. Signed-off-by: Michael Grzeschik Signed-off-by: Denis Osterland Signed-off-by: Alexandre Belloni commit a0a1a1ba303261d25814d11a05008d2931a69a8b Author: Denis Osterland Date: Tue Jul 24 11:31:22 2018 +0000 rtc: sysfs: facilitate attribute add to rtc device This patches addresses following problem: rtc_allocate_device devm_device_add_group <-- kernel oops / null pointer, because sysfs entry does not yet exist rtc_register_device rc = devm_device_add_group if (rc) return rc; <-- forbidden to return error code after device register This patch adds rtc_add_group(s) functions. The functions store the sum of attribute groups as device resource. Signed-off-by: Denis Osterland Signed-off-by: Alexandre Belloni commit 82fd4b05d704623a0e4aa7fda48e272a9889337d Author: Takashi Iwai Date: Tue Aug 14 21:27:51 2018 +0200 ALSA: seq: virmidi: Fix discarding the unsubscribed output The recent change to move the virmidi output processing to a work slightly modified the code to discard the unsubscribed outputs so that it works without a temporary buffer. However, this is actually buggy, and may spew a kernel warning due to the unexpected call of snd_rawmidi_transmit_ack(), as triggered by syzbot. This patch takes back to the original code in that part, use a temporary buffer and simply repeat snd_rawmidi_transmit(), in order to address the regression. Fixes: f7debfe54090 ("ALSA: seq: virmidi: Offload the output event processing") Reported-by: syzbot+ec5f605c91812d200367@syzkaller.appspotmail.com Signed-off-by: Takashi Iwai commit 2c20443ec221dcb76484b30933593e8ecd836bbd Merge: b018fc980055 76f7d6c07acd Author: Linus Torvalds Date: Tue Aug 14 13:39:52 2018 -0700 Merge tag 'acpi-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These revert two ACPICA commits that are not needed any more, rework the property graphs support in ACPI to be more aligned with the analogous DT code, add some new quirks and remove one that isn't needed any more, add a special platform driver to enumerate multiple I2C devices hooked up to the same device object in the ACPI tables and update the battery and button drivers. Specifics: - Revert two ACPICA commits that are not needed any more (Erik Schmauss). - Rework property graph support in the ACPI device properties framework to make it behave more like the analogous DT code and update the documentation of it (Sakari Ailus). - Change the default ACPI device status after initialization to ACPI_STA_DEFAULT instead of 0 (Hans de Goede). - Add a special platform driver for enumerating multiple I2C devices hooked up to the same object in the ACPI tables (Hans de Goede). - Fix the ACPI battery driver to avoid reporting full capacity on systems without support for that and clean it up (Hans de Goede, Dmitry Rozhkov, Lucas Rangit Magasweran). - Add two system wakeup quirks to the ACPI EC driver (Aaron Ma, Mika Westerberg). - Add the touchscreen on Dell Venue Pro 7139 to the list of "always present" devices to make it work (Tristian Celestin). - Revert a special tables handling quirk for Dell XPS 9570 and Precision M5530 which is not needed any more (Kai Heng Feng). - Add support for a new OEM _OSI string to allow system vendors to work around issues with NVidia HDMI audio (Alex Hung). - Prevent the ACPI button driver from reporting excessive system wakeup events and clean it up (Ravi Chandra Sadineni, Randy Dunlap). - Clean up two minor code style issues in the ACPI core and GHES handling on ARM64 (Dongjiu Geng, John Garry, Tom Todd)" * tag 'acpi-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (34 commits) platform/x86: Add ACPI i2c-multi-instantiate pseudo driver ACPI / x86: utils: Remove status workaround from acpi_device_always_present() ACPI / scan: Create platform device for fwnodes with multiple i2c devices ACPI / scan: Initialize status to ACPI_STA_DEFAULT ACPI / EC: Add another entry for Thinkpad X1 Carbon 6th ACPI: bus: Fix a pointer coding style issue arm64 / ACPI: clean the additional checks before calling ghes_notify_sea() ACPI / scan: Add static attribute to indirect_io_hosts[] ACPI / battery: Do not export energy_full[_design] on devices without full_charge_capacity ACPI / EC: Use ec_no_wakeup on ThinkPad X1 Yoga 3rd ACPI / battery: get rid of negations in conditions ACPI / battery: use specialized print macros ACPI / battery: reorder headers alphabetically ACPI / battery: drop inclusion of init.h ACPI: battery: remove redundant old_present check on insertion ACPI: property: graph: Update graph documentation to use generic references ACPI: property: graph: Improve graph documentation for port/ep numbering ACPI: property: graph: Fix graph documentation ACPI: property: Update documentation for hierarchical data extension 1.1 ACPI: property: Document key numbering for hierarchical data extension refs ... commit 0da9be22cdcbcbe0e5f04271dcfac71601526a3e Author: Bart Van Assche Date: Tue Aug 14 08:07:04 2018 -0700 Update the e-mail address of Bart Van Assche Since my @wdc.com e-mail address will become invalid after Friday August 24th, change it into an e-mail address that will remain valid after that date. Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit b018fc9800557bd14a40d69501e19c340eb2c521 Merge: c07b3682cd12 7425ecd5e3e8 Author: Linus Torvalds Date: Tue Aug 14 13:12:24 2018 -0700 Merge tag 'pm-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These add a new framework for CPU idle time injection, to be used by all of the idle injection code in the kernel in the future, fix some issues and add a number of relatively small extensions in multiple places. Specifics: - Add a new framework for CPU idle time injection (Daniel Lezcano). - Add AVS support to the armada-37xx cpufreq driver (Gregory CLEMENT). - Add support for current CPU frequency reporting to the ACPI CPPC cpufreq driver (George Cherian). - Rework the cooling device registration in the imx6q/thermal driver (Bastian Stender). - Make the pcc-cpufreq driver refuse to work with dynamic scaling governors on systems with many CPUs to avoid scalability issues with it (Rafael Wysocki). - Fix the intel_pstate driver to report different maximum CPU frequencies on systems where they really are different and to ignore the turbo active ratio if hardware-managend P-states (HWP) are in use; make it use the match_string() helper (Xie Yisheng, Srinivas Pandruvada). - Fix a minor deferred probe issue in the qcom-kryo cpufreq driver (Niklas Cassel). - Add a tracepoint for the tracking of frequency limits changes (from Andriod) to the cpufreq core (Ruchi Kandoi). - Fix a circular lock dependency between CPU hotplug and sysfs locking in the cpufreq core reported by lockdep (Waiman Long). - Avoid excessive error reports on driver registration failures in the ARM cpuidle driver (Sudeep Holla). - Add a new device links flag to the driver core to make links go away automatically on supplier driver removal (Vivek Gautam). - Eliminate potential race condition between system-wide power management transitions and system shutdown (Pingfan Liu). - Add a quirk to save NVS memory on system suspend for the ASUS 1025C laptop (Willy Tarreau). - Make more systems use suspend-to-idle (instead of ACPI S3) by default (Tristian Celestin). - Get rid of stack VLA usage in the low-level hibernation code on 64-bit x86 (Kees Cook). - Fix error handling in the hibernation core and mark an expected fall-through switch in it (Chengguang Xu, Gustavo Silva). - Extend the generic power domains (genpd) framework to support attaching a device to a power domain by name (Ulf Hansson). - Fix device reference counting and user limits initialization in the devfreq core (Arvind Yadav, Matthias Kaehlcke). - Fix a few issues in the rk3399_dmc devfreq driver and improve its documentation (Enric Balletbo i Serra, Lin Huang, Nick Milner). - Drop a redundant error message from the exynos-ppmu devfreq driver (Markus Elfring)" * tag 'pm-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (35 commits) PM / reboot: Eliminate race between reboot and suspend PM / hibernate: Mark expected switch fall-through cpufreq: intel_pstate: Ignore turbo active ratio in HWP cpufreq: Fix a circular lock dependency problem cpu/hotplug: Add a cpus_read_trylock() function x86/power/hibernate_64: Remove VLA usage cpufreq: trace frequency limits change cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP cpufreq: pcc-cpufreq: Disable dynamic scaling on many-CPU systems cpufreq: qcom-kryo: Silently error out on EPROBE_DEFER cpufreq / CPPC: Add cpuinfo_cur_freq support for CPPC cpufreq: armada-37xx: Add AVS support dt-bindings: marvell: Add documentation for the Armada 3700 AVS binding PM / devfreq: rk3399_dmc: Fix duplicated opp table on reload. PM / devfreq: Init user limits from OPP limits, not viceversa PM / devfreq: rk3399_dmc: fix spelling mistakes. PM / devfreq: rk3399_dmc: do not print error when get supply and clk defer. dt-bindings: devfreq: rk3399_dmc: move interrupts to be optional. PM / devfreq: rk3399_dmc: remove wait for dcf irq event. dt-bindings: clock: add rk3399 DDR3 standard speed bins. ... commit c07b3682cd12a017f976ec63bbd4758dc4c5100e Merge: 4d88e3d24905 2224f2ff9670 Author: Linus Torvalds Date: Tue Aug 14 13:07:22 2018 -0700 Merge tag 'leds-for-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds Pull LED updates from Jacek Anaszewski: "LED triggers improvements make the biggest part of this pull request. The most striking ones, that allowed for nice cleanups in the triggers are: - centralized handling of creation and removal of trigger sysfs attributes via attribute group - addition of module_led_trigger() helper The other things that need to be mentioned: New features and improvements to existing LED class drivers: - lt3593: add DT support, switch to gpiod interface - lm3692x: support LED sync configuration, change OF calls to fwnode calls - apu: modify PC Engines apu/apu2 driver to support apu3 Change in the drivers/net/can/led.c: - mark led trigger as broken since it's in the way for the further cleanups. It implements a subset of the netdev trigger and an Ack is needed from someone who can actually test and confirm that the netdev trigger works for can devices" * tag 'leds-for-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: (32 commits) leds: ns2: Change unsigned to unsigned int usb: simplify usbport trigger leds: gpio trigger: simplifications from core changes leds: backlight trigger: simplifications from core changes leds: activity trigger: simplifications from core changes leds: default-on trigger: make use of module_led_trigger() leds: heartbeat trigger: simplifications from core changes leds: oneshot trigger: simplifications from core changes leds: transient trigger: simplifications from core changes leds: timer trigger: simplifications from core changes leds: netdev trigger: simplifications from core changes leds: triggers: new function led_set_trigger_data() leds: triggers: define module_led_trigger helper leds: triggers: handle .trigger_data and .activated() in the core leds: triggers: add device attribute support leds: triggers: let struct led_trigger::activate() return an error code leds: triggers: make the MODULE_LICENSE string match the actual license leds: lm3692x: Support LED sync configuration dt: bindings: lm3692x: Update binding for LED sync control leds: lm3692x: Change DT calls to fwnode calls ... commit 4d88e3d24905eafa98cef0fc29365649ad8977b5 Merge: c6ed444fd6ff f11b9abc9318 Author: Linus Torvalds Date: Tue Aug 14 12:41:49 2018 -0700 Merge tag 'devicetree-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull Devicetree updates from Rob Herring: - Remove an obsolete hack for PPC32 longtrail systems - Make of_io_request_and_map() "name" arg optional - Add vendor prefixes for bitmain, Asus, and Y Soft - Remove 'interrupt-parent' from bindings as it is implicit - New properties for wm8994 audio codec - Add 'clocks' property support to SRAM binding - Add binding for ASPEED coprocessor interrupt controller - Various binding spelling and link fixes * tag 'devicetree-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: Documentation: remove dynamic-resolution-notes reference to non-existent file dt-bindings: Add Y Soft Corporation vendor prefix of/fdt: Remove PPC32 longtrail hack in memory scan dt-bindings: remove 'interrupt-parent' from bindings pinctrl: tegra: fix spelling in devicetree binding document usb: dwc3: rockchip: Fix PHY documentation links. dt-bindings: sound: wm8994: document wlf,csnaddr-pd property dt-bindings: sound: wm8994: document wlf,spkmode-pu property dt-bindings: sram: Add 'clocks' as an optional property dt-bindings: Add vendor prefix for AsusTek Computer Inc. dt-bindings: misc: ASPEED coprocessor interrupt controller dt-bindings: gpio: pca953x: Document interrupts, update example drivers/of: Make of_io_request_and_map() "name" argument optional dt-bindings: Add bitmain vendor prefix Documentation: devicetree: tilcdc: fix spelling mistake "suppors" -> "supports" commit c6ed444fd6fffaaf2e3857d926ed18bf3df81e8e Merge: 3860cae64c0a c2944a9a09a2 Author: Linus Torvalds Date: Tue Aug 14 12:31:27 2018 -0700 Merge tag 'pinctrl-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "This is the bulk of pin control changes for v4.19: Core changes: - Augment pinctrl_generic_add_group() and pinmux_generic_add_function() to return the selector for the added group/function to the caller and augment (hopefully) all drivers to handle this New subdrivers: - Qualcomm PM8998 and PM8005 are supported in the SPMI pin control and GPIO driver - Intel Ice Lake PCH (platform controller hub) support - NXP (ex Freescale) i.MX8MQ support - Berlin AS370 support Improvements to drivers: - Support interrupts on the Ocelot pin controller - Add SPI pins to the Uniphier driver - Define a GPIO compatible per SoC in the Tegra driver - Push Tegra initialization down in the initlevels - Support external wakeup interrupts on the Exynos - Add generic clocks pins to the meson driver - Add USB and HSCIF pins for some Renesas PFC chips - Suspend/resume support in the armada-37xx - Interrupt support for the Actions Semiconductor S900 also known as "owl" - Correct the pin ordering in Cedarfork - Debugfs output for INTF in the mcp23s08 driver - Avoid divisions in context save/restore in pinctrl-single The rest is minor bug fixes or cleanups" * tag 'pinctrl-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (69 commits) pinctrl: nomadik: silence uninitialized variable warning pinctrl: axp209: Fix NULL pointer dereference after allocation pinctrl: samsung: Remove duplicated "wakeup" in printk pinctrl: ocelot: add support for interrupt controller pinctrl: intel: Don't shadow error code of gpiochip_lock_as_irq() pinctrl: berlin: fix 'pctrl->functions' allocation in berlin_pinctrl_build_state gpio: tegra: Move driver registration to subsys_init level pinctrl: tegra: Move drivers registration to arch_init level pinctrl: baytrail: actually print the apparently misconfigured pin MAINTAINERS: Replace Heikki as maintainer of Intel pinctrl pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show() pinctrl: uniphier: add spi pin-mux settings pinctrl: cannonlake: Fix community ordering for H variant pinctrl: tegra: define GPIO compatible node per SoC pinctrl: intel: Do pin translation when lock IRQ pinctrl: imx: off by one in imx_pinconf_group_dbg_show() pinctrl: mediatek: include chained_irq.h header pinctrl/amd: only handle irq if it is pending and unmasked pinctrl/amd: fix gpio irq level in debugfs pinctrl: stm32: add syscfg mask parameter ... commit 3860cae64c0a2c3faeca5de92d5f8e37fddd340c Merge: 010b0e708e08 d22d59362b7b Author: Linus Torvalds Date: Tue Aug 14 12:04:49 2018 -0700 Merge tag 'regulator-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "The biggest set of changes in here is the addition of the Qualcomm RPMH driver. As well as the regualtor driver itself being quite large due to the usual involved Qualcomm regulator stuff there's also some code shared with the arm-soc tree, a bus driver required to communicate with the hardware that actually winds up being much larger than the regulator driver itself and a LLCC driver that was part of the same signed tag used with the arm-soc tree. Other than that it's a fairly standard and quiet release, highlights include: - Addition of device links from regulator consumers to their regulators, helping the core avoid dependency issues during suspend. - Support for the entertainingly innovative suspend implementation in the BD9571MWV. - Support for switch regulators on the PFUZE100, this required two goes due to backwards compatibility issues with old DTs that were discovered. - Support for Freescale PFUZE3001 and SocioNext UniPhier. - The aforementioned Qualcomm RPMH driver together with the driver changes required to support it" * tag 'regulator-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (52 commits) regulator: add QCOM RPMh regulator driver regulator: dt-bindings: add QCOM RPMh regulator bindings regulator: samsung: Add SPDX license identifiers regulator: maxim: Add SPDX license identifiers regulator: bd71837: adobt MFD changes to regulator driver regulator: tps65217: Fix NULL pointer dereference on probe regulator: Add support for CPCAP regulators on Motorola Xoom devices. regulator: Add sw2_sw4 voltage table to cpcap regulator. regulator: bd9571mwv: Make symbol 'dev_attr_backup_mode' static regulator: pfuze100: add support to en-/disable switch regulators regulator: pfuze100: add optional disable switch-regulators binding soc: qcom: rmtfs-mem: fix memleak in probe error paths soc: qcom: llc-slice: Add missing MODULE_LICENSE() drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() drivers: qcom: rpmh-rsc: fix the loop index check in get_req_from_tcs firmware: qcom: scm: add a dummy qcom_scm_assign_mem() drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children drivers: qcom: rpmh-rsc: allow active requests from wake TCS drivers: qcom: rpmh: add support for batch RPMH request drivers: qcom: rpmh: allow requests to be sent asynchronously ... commit 010b0e708e08727d38b82accb21832b63fe2c250 Merge: 792adb90fa72 c1acb21b32a3 Author: Linus Torvalds Date: Tue Aug 14 12:01:08 2018 -0700 Merge tag 'spi-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "Quite an active release for the SPI subsystem, lots of small updates and fixes scattered about with highlights including: - 3-wire support in the GPIO driver. - support for setting a custom memory name in the memory mapped flash drivers. - support for extended mode in the Freescale DSPI controller. - support for the non-standard integration with the Microsemi Ocelot platform in the DesignWare driver. - new driver for the SocioNext UniPhier" * tag 'spi-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (47 commits) spi: davinci: fix a NULL pointer dereference spi: spi-mem: Constify spi_mem->name mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name spi: spi-mem: Extend the SPI mem interface to set a custom memory name spi: spi-mem: Fix a typo in the documentation of struct spi_mem spi: uniphier: remove unnecessary include headers spi: spi-gpio: add SPI_3WIRE support spi: add flags parameter to txrx_word function pointers spi: add SPI controller driver for UniPhier SoC spi: add DT bindings for UniPhier SPI controller spi: dw: document Microsemi integration spi: img-spfi: Set device select bits for SPFI port state spi: omap2-mcspi: remove several redundant variables spi: dw-mmio: add MSCC Ocelot support spi: dw: export dw_spi_set_cs spi: spi-fsl-espi: Log fifo counters on error spi: imx: Use the longuest possible burst size when in dynamic_burst spi: imx: remove unnecessary check in spi_imx_can_dma spi: imx: Use correct number of bytes per words spi: imx: Use dynamic bursts only when bits_per_word is 8, 16 or 32 ... commit 792adb90fa724ce07c0171cbc96b9215af4b1045 Author: Vlastimil Babka Date: Tue Aug 14 20:50:47 2018 +0200 x86/init: fix build with CONFIG_SWAP=n The introduction of generic_max_swapfile_size and arch-specific versions has broken linking on x86 with CONFIG_SWAP=n due to undefined reference to 'generic_max_swapfile_size'. Fix it by compiling the x86-specific max_swapfile_size() only with CONFIG_SWAP=y. Reported-by: Tomas Pruzina Fixes: 377eeaa8e11f ("x86/speculation/l1tf: Limit swap file size to MAX_PA/2") Signed-off-by: Vlastimil Babka Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds commit 15bc88cd5f8e095fa7fe8494d1980ad29885d984 Merge: be718b524d8d 1dce5d849f94 Author: Linus Torvalds Date: Tue Aug 14 11:51:03 2018 -0700 Merge tag 'regmap-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "Several small new features for regmap this time around: - Support for SCCB, an I2C variant used on some media cards. This has also pulled in an I2C commit from Peter Rosin as a dependency. - Addition of an API for reading repeatedly from registers where the address doesn't automatically increment like some ADC outputs or GPIO status registers. - Support for bulk I/O on Slimbus" * tag 'regmap-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Add regmap_noinc_read API regmap: sccb: fix typo and sort headers alphabetically i2c: smbus: add unlocked __i2c_smbus_xfer variant regmap: add SCCB support regmap: slimbus: add support to multi read/write commit be718b524d8d8a25c18b7403c4dbfddacc8e89e3 Merge: f66dc7232002 cc57c07343bd Author: Linus Torvalds Date: Tue Aug 14 11:44:18 2018 -0700 Merge tag 'configfs-for-4.19' of git://git.infradead.org/users/hch/configfs Pull configfs updates from Christoph Hellwig: - simplify the cide by using kvasprintf (Bart Van Assche) - fix a gcc 8 string truncation warning by making the code simpler (Guenter Roeck) - fix a bug in rmdir() handling (Mike Christie) * tag 'configfs-for-4.19' of git://git.infradead.org/users/hch/configfs: configfs: fix registered group removal configfs: replace strncpy with memcpy configfs: use kvasprintf() instead of open-coding it commit f66dc7232002f032ffd860940f98732898ebfd79 Merge: b219a1d2de0c 6fa1d28e38cf Author: Linus Torvalds Date: Tue Aug 14 11:11:52 2018 -0700 Merge tag 'dma-mapping-4.19' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - a series from Robin to fix bus imposed dma limits by adding a separate mask for them to struct device instead of trying to squeeze a second meaning out of the existing dma mask as we did before. This has ACKs from the various other subsystems touched - a small swiotlb cleanup from Kees (acked by Konrad) - conversion of nios2 and sh to the new generic dma-noncoherent code. Various other architecture conversions will come through the architectures maintainers trees. * tag 'dma-mapping-4.19' of git://git.infradead.org/users/hch/dma-mapping: sh: use generic dma_noncoherent_ops sh: split arch/sh/mm/consistent.c sh: use dma_direct_ops for the CONFIG_DMA_COHERENT case sh: introduce a sh_cacheop_vaddr helper sh: simplify get_arch_dma_ops OF: Don't set default coherent DMA mask ACPI/IORT: Don't set default coherent DMA mask iommu/dma: Respect bus DMA limit for IOVAs of/device: Set bus DMA mask as appropriate ACPI/IORT: Set bus DMA mask as appropriate dma-mapping: Generalise dma_32bit_limit flag ACPI/IORT: Support address size limit for root complexes of/platform: Initialise default DMA masks nios2: use generic dma_noncoherent_ops swiotlb: clean up reporting dma-mapping: relax warning for per-device areas commit 344353366591acf659a0d0dea498611da78d67e2 Author: Kim Phillips Date: Fri Aug 10 17:45:12 2018 -0500 perf arm spe: Fix uninitialized record error variable The auxtrace init variable 'err' was not being initialized, leading perf to abort early in an SPE record command when there was no explicit error, rather only based whatever memory contents were on the stack. Initialize it explicitly on getting an SPE successfully, the same way cs-etm does. Signed-off-by: Kim Phillips Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Dongjiu Geng Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Fixes: ffd3d18c20b8 ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support") Link: http://lkml.kernel.org/r/20180810174512.52900813e57cbccf18ce99a2@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit c9b51a017065bf514ab5a380f2fb3b0dada5bc68 Author: Jiri Olsa Date: Mon Aug 13 13:15:04 2018 +0200 perf tools: Move syscall_64.tbl check into check-headers.sh Probably leftover from the time we introducd the check-headers.sh script. Committer testing: Remove the 'rseq' syscall from tools/perf/arch/x86/entry/syscalls/syscall_64.tbl to fake a diff: make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j4' parallel build Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl' diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl CC /tmp/build/perf/util/syscalltbl.o INSTALL trace_plugins $ diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl --- tools/perf/arch/x86/entry/syscalls/syscall_64.tbl 2018-08-13 15:49:50.896585176 -0300 +++ arch/x86/entry/syscalls/syscall_64.tbl 2018-07-20 12:04:04.536858304 -0300 @@ -342,6 +342,7 @@ 331 common pkey_free __x64_sys_pkey_free 332 common statx __x64_sys_statx 333 common io_pgetevents __x64_sys_io_pgetevents +334 common rseq __x64_sys_rseq # # x32-specific system call numbers start at 512 to avoid cache impact $ Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Kapshuk Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180813111504.3568-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7ea6e983b2cce9a4277ea602c2976d18bd75a908 Author: Jiri Olsa Date: Mon Aug 13 13:15:03 2018 +0200 perf tools: Make check-headers.sh check based on kernel dir Changing the logic to compare files with paths relative to kernel source base dir. This way we can keep the output message for 2 unrelated files, which is coming in following patch. Committer testing: Remove a line from tools/arch/x86/lib/memcpy_64.S to have it detected: make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j4' parallel build Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S' diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S INSTALL GTK UI INSTALL binaries Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Kapshuk Cc: Alexander Shishkin Cc: David Ahern Cc: Michael Ellerman Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180813111504.3568-1-jolsa@kernel.org Link: http://lkml.kernel.org/r/20180814072726.GA13931@krava [ Do not use pushd/popd, its a bashism, reported by Michael Ellerman, fixed by Jiri Olsa ] Signed-off-by: Arnaldo Carvalho de Melo commit b219a1d2de0c025318475e3bbf8e3215cf49d083 Merge: c2fc71c9b74c d63e2fc804c4 Author: Linus Torvalds Date: Tue Aug 14 11:03:16 2018 -0700 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md Pull MD updates from Shaohua Li: "A few MD fixes for 4.19-rc1: - several md-cluster fixes from Guoqing - a data corruption fix from BingJing - other cleanups" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md: md/raid5: fix data corruption of replacements after originals dropped drivers/md/raid5: Do not disable irq on release_inactive_stripe_list() call drivers/md/raid5: Use irqsave variant of atomic_dec_and_lock() md/r5cache: remove redundant pointer bio md-cluster: don't send msg if array is closing md-cluster: show array's status more accurate md-cluster: clear another node's suspend_area after the copy is finished commit c2fc71c9b74c1e87336a27dba1a5edc69d2690f1 Merge: 57ee3196ce7c 9805d4bcf8f9 Author: Linus Torvalds Date: Tue Aug 14 10:57:44 2018 -0700 Merge tag 'mtd/for-4.19' of git://git.infradead.org/linux-mtd Pull mtd updates from Boris Brezillon: "JFFS2 changes: - Support 64-bit timestamps MTD core changes: - Support sub-partitions - Clarify mtd_oob_ops documentation - Make Kconfig formatting consistent - Fix potential overflows in mtdchar_{write,read}() - Fallback to ->_{read,write}() when ->_{read,write}_oob() is missing and no OOB data were requested - Remove VLA usage in the bch lib MTD driver changes: - Use mtd_device_register() instead of mtd_device_parse_register() where applicable - Use proper printk format to print physical addresses in the solutionengine driver - Add missing mtd_set_of_node() call in the powernv driver - Remove unneeded variables in a few drivers - Plug the TRX part parser to the DT partition parsers logic - Check ioremap_cache() return code in the gpio-addr-flash driver - Stop using VMLINUX_SYMBOL_STR() in gen_probe.c SPI NOR core changes: - Apply reset hacks only when reset is explicitly marked as broken in the DT SPI NOR driver changes: - Minor cleanup/fixes in the m25p80 driver - Release flash_np in the nxp-spifi driver - Add suspend/resume hooks to the atmel-quadspi driver - Include gpio/consumer.h instead of gpio.h in the atmel-quadspi driver - Use %pK instead of %p in the stm32-quadspi driver - Improve timeout handling in the cadence-quadspi driver - Use mtd_device_register() instead of mtd_device_parse_register() in the intel-spi driver NAND core changes: - Add the SPI-NAND framework. - Create a helper to find the best ECC configuration. - Create NAND controller operations. - Allocate dynamically ONFI parameters structure. - Add defines for ONFI version bits. - Add manufacturer fixup for ONFI parameter page. - Add an option to specify NAND chip as a boot device. - Add Reed-Solomon error correction algorithm. - Better name for the controller structure. - Remove unused caller_is_module() definition. - Make subop helpers return unsigned values. - Expose _notsupp() helpers for raw page accessors. - Add default values for dynamic timings. - Kill the chip->scan_bbt() hook. - Rename nand_default_bbt() into nand_create_bbt(). - Start to clean the nand_chip structure. - Remove stale prototype from rawnand.h. Raw NAND controllers drivers changes: - Qcom: structuring cleanup. - Denali: use core helper to find the best ECC configuration. - Possible build of almost all drivers by adding a dependency on COMPILE_TEST for almost all of them in Kconfig, implies various fixes, Kconfig cleanup, GPIO headers inclusion cleanup, and even changes in sparc64 and ia64 architectures. - Clean the ->probe() functions error path of a lot of drivers. - Migrate all drivers to use nand_scan() instead of nand_scan_ident()/nand_scan_tail() pair. - Use mtd_device_register() where applicable to simplify the code. - Marvell: * Handle on-die ECC. * Better clocks handling. * Remove bogus comment. * Add suspend and resume support. - Tegra: add NAND controller driver. - Atmel: * Add module param to avoid using dma. * Drop Wenyou Yang from MAINTAINERS. - Denali: optimize timings handling. - FSMC: Stop using chip->read_buf(). - FSL: * Switch to SPDX license tag identifiers. * Fix qualifiers in MXC init functions. Raw NAND chip drivers changes: - Micron: * Add fixup for ONFI revision. * Update ecc_stats.corrected. * Make ECC activation stateful. * Avoid enabling/disabling ECC when it can't be disabled. * Get the actual number of bitflips. * Allow forced on-die ECC. * Support 8/512 on-die ECC. * Fix on-die ECC detection logic. - Hynix: * Fix decoding the OOB size on H27UCG8T2BTR. * Use ->exec_op() in hynix_nand_reg_write_op()" * tag 'mtd/for-4.19' of git://git.infradead.org/linux-mtd: (188 commits) mtd: rawnand: atmel: Select GENERIC_ALLOCATOR MAINTAINERS: drop Wenyou Yang from Atmel NAND driver support mtd: rawnand: allocate dynamically ONFI parameters during detection mtd: spi-nor: only apply reset hacks to broken hardware mtd: spi-nor: cadence-quadspi: fix timeout handling mtd: spi-nor: atmel-quadspi: Include gpio/consumer.h instead of gpio.h mtd: spi-nor: intel-spi: use mtd_device_register() mtd: spi-nor: stm32-quadspi: replace "%p" with "%pK" mtd: spi-nor: atmel-quadspi: add suspend/resume hooks mtd: rawnand: allocate model parameter dynamically mtd: rawnand: do not export nand_scan_[ident|tail]() anymore mtd: rawnand: txx9ndfmc: convert driver to nand_scan() mtd: rawnand: txx9ndfmc: clarify ECC parameters assignation mtd: rawnand: tegra: convert driver to nand_scan() mtd: rawnand: jz4740: convert driver to nand_scan() mtd: rawnand: jz4740: group nand_scan_{ident, tail} calls mtd: rawnand: jz4740: fix probe function error path mtd: rawnand: docg4: convert driver to nand_scan() mtd: rawnand: do not execute nand_scan_ident() if maxchips is zero mtd: rawnand: atmel: convert driver to nand_scan() ... commit 57ee3196ce7c7cbc52f2792414919d9756b42828 Merge: 73ba2fb33c49 f075dce66c60 Author: Linus Torvalds Date: Tue Aug 14 10:54:25 2018 -0700 Merge SCSI_IOCTL_SEND_COMMAND cleanup branch. Nobody commented on this patch back in July. So now it gets merged. * SCSI_IOCTL_SEND_COMMAND cleanup: scsi sg: remove incorrect scsi command checking logic commit 26a1ccc6c117be8e33e0410fce8c5298b0015b99 Author: Colin Ian King Date: Mon Aug 13 15:00:32 2018 +0100 bpf: test: fix spelling mistake "REUSEEPORT" -> "REUSEPORT" Trivial fix to spelling mistake in error message Signed-off-by: Colin Ian King Acked-by: Alexei Starovoitov Signed-off-by: David S. Miller commit 22fd99e948a68fda1f893f325dd338dec793de59 Author: Sean Paul Date: Mon Aug 13 17:30:40 2018 -0400 drm/panel: simple: tv123wam: Add unprepare delay The panel datasheet specifies a 500ms delay after power-down before re-enabling. Changes in v2: - None Changes in v3: - Added to the set Cc: Sandeep Panda Reviewed-by: Sandeep Panda Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180813213058.184821-2-sean@poorly.run commit dda9f4b9cac6bdd2a96253b4444d7a6ce5132edb Author: Chao Yu Date: Sat Aug 11 23:42:09 2018 +0800 f2fs: fix to skip verifying block address for non-regular inode generic/184 1s ... [failed, exit status 1]- output mismatch --- tests/generic/184.out 2015-01-11 16:52:27.643681072 +0800 QA output created by 184 - silence is golden +rm: cannot remove '/mnt/f2fs/null': Bad address +mknod: '/mnt/f2fs/null': Bad address +chmod: cannot access '/mnt/f2fs/null': Bad address +./tests/generic/184: line 36: /mnt/f2fs/null: Bad address ... F2FS-fs (zram0): access invalid blkaddr:259 EIP: f2fs_is_valid_blkaddr+0x14b/0x1b0 [f2fs] f2fs_iget+0x927/0x1010 [f2fs] f2fs_lookup+0x26e/0x630 [f2fs] __lookup_slow+0xb3/0x140 lookup_slow+0x31/0x50 walk_component+0x185/0x1f0 path_lookupat+0x51/0x190 filename_lookup+0x7f/0x140 user_path_at_empty+0x36/0x40 vfs_statx+0x61/0xc0 __do_sys_stat64+0x29/0x40 sys_stat64+0x13/0x20 do_fast_syscall_32+0xaa/0x22c entry_SYSENTER_32+0x53/0x86 In f2fs_iget(), we will check inode's first block address, if it is valid, we will set FI_FIRST_BLOCK_WRITTEN flag in inode. But we should only do this for regular inode, otherwise, like special inode, i_addr[0] is used for storing device info instead of block address, it will fail checking flow obviously. So for non-regular inode, let's skip verifying address and setting flag. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 28a1f3ac1d0c8558ee4453d9634dad891a6e922e Author: Junaid Shahid Date: Tue Aug 14 10:15:34 2018 -0700 kvm: x86: Set highest physical address bits in non-present/reserved SPTEs Always set the 5 upper-most supported physical address bits to 1 for SPTEs that are marked as non-present or reserved, to make them unusable for L1TF attacks from the guest. Currently, this just applies to MMIO SPTEs. (We do not need to mark PTEs that are completely 0 as physical page 0 is already reserved.) This allows mitigation of L1TF without disabling hyper-threading by using shadow paging mode instead of EPT. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit b19b46346f483ae055fa027cb2d5c2ca91484b91 Author: Takashi Iwai Date: Tue Aug 14 19:10:50 2018 +0200 hv/netvsc: Fix NULL dereference at single queue mode fallback The recent commit 916c5e1413be ("hv/netvsc: fix handling of fallback to single queue mode") tried to fix the fallback behavior to a single queue mode, but it changed the function to return zero incorrectly, while the function should return an object pointer. Eventually this leads to a NULL dereference at the callers that expect non-NULL value. Fix it by returning the proper net_device object. Fixes: 916c5e1413be ("hv/netvsc: fix handling of fallback to single queue mode") Signed-off-by: Takashi Iwai Reviewed-by: Stephen Hemminger Signed-off-by: David S. Miller commit 73ba2fb33c492916853dfe63e3b3163da0be661d Merge: 958f338e96f8 b86d865cb1ca Author: Linus Torvalds Date: Tue Aug 14 10:23:25 2018 -0700 Merge tag 'for-4.19/block-20180812' of git://git.kernel.dk/linux-block Pull block updates from Jens Axboe: "First pull request for this merge window, there will also be a followup request with some stragglers. This pull request contains: - Fix for a thundering heard issue in the wbt block code (Anchal Agarwal) - A few NVMe pull requests: * Improved tracepoints (Keith) * Larger inline data support for RDMA (Steve Wise) * RDMA setup/teardown fixes (Sagi) * Effects log suppor for NVMe target (Chaitanya Kulkarni) * Buffered IO suppor for NVMe target (Chaitanya Kulkarni) * TP4004 (ANA) support (Christoph) * Various NVMe fixes - Block io-latency controller support. Much needed support for properly containing block devices. (Josef) - Series improving how we handle sense information on the stack (Kees) - Lightnvm fixes and updates/improvements (Mathias/Javier et al) - Zoned device support for null_blk (Matias) - AIX partition fixes (Mauricio Faria de Oliveira) - DIF checksum code made generic (Max Gurtovoy) - Add support for discard in iostats (Michael Callahan / Tejun) - Set of updates for BFQ (Paolo) - Removal of async write support for bsg (Christoph) - Bio page dirtying and clone fixups (Christoph) - Set of bcache fix/changes (via Coly) - Series improving blk-mq queue setup/teardown speed (Ming) - Series improving merging performance on blk-mq (Ming) - Lots of other fixes and cleanups from a slew of folks" * tag 'for-4.19/block-20180812' of git://git.kernel.dk/linux-block: (190 commits) blkcg: Make blkg_root_lookup() work for queues in bypass mode bcache: fix error setting writeback_rate through sysfs interface null_blk: add lock drop/acquire annotation Blk-throttle: reduce tail io latency when iops limit is enforced block: paride: pd: mark expected switch fall-throughs block: Ensure that a request queue is dissociated from the cgroup controller block: Introduce blk_exit_queue() blkcg: Introduce blkg_root_lookup() block: Remove two superfluous #include directives blk-mq: count the hctx as active before allocating tag block: bvec_nr_vecs() returns value for wrong slab bcache: trivial - remove tailing backslash in macro BTREE_FLAG bcache: make the pr_err statement used for ENOENT only in sysfs_attatch section bcache: set max writeback rate when I/O request is idle bcache: add code comments for bset.c bcache: fix mistaken comments in request.c bcache: fix mistaken code comments in bcache.h bcache: add a comment in super.c bcache: avoid unncessary cache prefetch bch_btree_node_get() bcache: display rate debug parameters to 0 when writeback is not running ... commit 4597b62f7a60d912a2bd00ca574e6bc7b87be905 Author: Gustavo A. R. Silva Date: Tue Aug 14 11:20:21 2018 -0500 net: filter: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1472592 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 21f2706b20100bb3db378461ab9b8e2035309b5b Author: Xiao Liang Date: Tue Aug 14 23:21:28 2018 +0800 xen-netfront: fix warn message as irq device name has '/' There is a call trace generated after commit 2d408c0d4574b01b9ed45e02516888bf925e11a9( xen-netfront: fix queue name setting). There is no 'device/vif/xx-q0-tx' file found under /proc/irq/xx/. This patch only picks up device type and id as its name. With the patch, now /proc/interrupts looks like below and the warning message gone: 70: 21 0 0 0 xen-dyn -event vif0-q0-tx 71: 15 0 0 0 xen-dyn -event vif0-q0-rx 72: 14 0 0 0 xen-dyn -event vif0-q1-tx 73: 33 0 0 0 xen-dyn -event vif0-q1-rx 74: 12 0 0 0 xen-dyn -event vif0-q2-tx 75: 24 0 0 0 xen-dyn -event vif0-q2-rx 76: 19 0 0 0 xen-dyn -event vif0-q3-tx 77: 21 0 0 0 xen-dyn -event vif0-q3-rx Below is call trace information without this patch: name 'device/vif/0-q0-tx' WARNING: CPU: 2 PID: 37 at fs/proc/generic.c:174 __xlate_proc_name+0x85/0xa0 RIP: 0010:__xlate_proc_name+0x85/0xa0 RSP: 0018:ffffb85c40473c18 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000006 RCX: 0000000000000006 RDX: 0000000000000007 RSI: 0000000000000096 RDI: ffff984c7f516930 RBP: ffffb85c40473cb8 R08: 000000000000002c R09: 0000000000000229 R10: 0000000000000000 R11: 0000000000000001 R12: ffffb85c40473c98 R13: ffffb85c40473cb8 R14: ffffb85c40473c50 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff984c7f500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f69b6899038 CR3: 000000001c20a006 CR4: 00000000001606e0 Call Trace: __proc_create+0x45/0x230 ? snprintf+0x49/0x60 proc_mkdir_data+0x35/0x90 register_handler_proc+0xef/0x110 ? proc_register+0xfc/0x110 ? proc_create_data+0x70/0xb0 __setup_irq+0x39b/0x660 ? request_threaded_irq+0xad/0x160 request_threaded_irq+0xf5/0x160 ? xennet_tx_buf_gc+0x1d0/0x1d0 [xen_netfront] bind_evtchn_to_irqhandler+0x3d/0x70 ? xenbus_alloc_evtchn+0x41/0xa0 netback_changed+0xa46/0xcda [xen_netfront] ? find_watch+0x40/0x40 xenwatch_thread+0xc5/0x160 ? finish_wait+0x80/0x80 kthread+0x112/0x130 ? kthread_create_worker_on_cpu+0x70/0x70 ret_from_fork+0x35/0x40 Code: 81 5c 00 48 85 c0 75 cc 5b 49 89 2e 31 c0 5d 4d 89 3c 24 41 5c 41 5d 41 5e 41 5f c3 4c 89 ee 48 c7 c7 40 4f 0e b4 e8 65 ea d8 ff <0f> 0b b8 fe ff ff ff 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 0f 1f ---[ end trace 650e5561b0caab3a ]--- Signed-off-by: Xiao Liang Reviewed-by: Juergen Gross Signed-off-by: David S. Miller commit 6e24dcad021f82636709108a7f4c53f06ddf9ba0 Author: Ganesh Goudar Date: Tue Aug 14 16:21:37 2018 +0530 cxgb4: Add new T5 PCI device ids 0x50af and 0x50b0 Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit e29129fcac4b7fe9e5d087e2590b9e2e7125e84c Author: Dan Carpenter Date: Tue Aug 14 12:09:05 2018 +0300 net: dsa: mv88e6xxx: missing unlock on error path We added a new error path, but we need to drop the lock before we return. Fixes: 2d2e1dd29962 ("net: dsa: mv88e6xxx: Cache the port cmode") Signed-off-by: Dan Carpenter Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit f6f7a26abd14cfa0f3f3009a2d274d36798668bb Author: Arnd Bergmann Date: Tue Aug 14 11:07:42 2018 +0200 rds: fix building with IPV6=m When CONFIG_RDS_TCP is built-in and CONFIG_IPV6 is a loadable module, we get a link error agains the modular ipv6_chk_addr() function: net/rds/tcp.o: In function `rds_tcp_laddr_check': tcp.c:(.text+0x3b2): undefined reference to `ipv6_chk_addr' This adds back a dependency that forces RDS_TCP to also be a loadable module when IPV6 is one. Fixes: e65d4d96334e ("rds: Remove IPv6 dependency") Signed-off-by: Arnd Bergmann Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit df60f6e835f763258a06cdbb5690a2e35c1aac4e Author: Ming Lei Date: Tue Aug 14 23:57:49 2018 +0800 blk-wbt: fix IO hang in wbt_wait() On wbt invariant is that if one IO is tracked via WBT_TRACKED, rqw->inflight should be updated for tracking this IO. But commit c1c80384c8f ("block: remove external dependency on wbt_flags") forgets to remove the early handling of !rwb_enabled(rwb) inside wbt_wait(), then the inflight counter may not be increased in wbt_wait(), but decreased in wbt_done() for this kind of IO, so this counter may become negative, then wbt_wait() may wait forever. This patch fixes the report in the following link: https://marc.info/?l=linux-block&m=153221542021033&w=2 Fixes: c1c80384c8f ("block: remove external dependency on wbt_flags") Cc: Josef Bacik Reported-by: Ming Lei Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 96d18d8254dc5a3f0067a629866af4165b3afe32 Author: Nick Desaulniers Date: Wed Aug 1 14:57:59 2018 -0700 inet/connection_sock: prefer _THIS_IP_ to current_text_addr As part of the effort to reduce the code duplication between _THIS_IP_ and current_text_addr(), let's consolidate callers of current_text_addr() to use _THIS_IP_. Signed-off-by: Nick Desaulniers Acked-by: David S. Miller Signed-off-by: David S. Miller commit 6feddb4913011437aaafe34d672aceebdb7c201f Author: Dan Carpenter Date: Tue Aug 14 12:06:43 2018 +0300 net: dsa: mv88e6xxx: bitwise vs logical bug We are trying to test if these flags are set but there are some && vs & typos. Fixes: efd1ba6af93f ("net: dsa: mv88e6xxx: Add SERDES phydev_mac_change up for 6390") Signed-off-by: Dan Carpenter Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 66b51b0a0341fd42ce657739bdae0561b0410a85 Author: Jeremy Cline Date: Mon Aug 13 22:23:13 2018 +0000 net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd() req->sdiag_family is a user-controlled value that's used as an array index. Sanitize it after the bounds check to avoid speculative out-of-bounds array access. This also protects the sock_is_registered() call, so this removes the sanitize call there. Fixes: e978de7a6d38 ("net: socket: Fix potential spectre v1 gadget in sock_is_registered") Cc: Josh Poimboeuf Cc: konrad.wilk@oracle.com Cc: jamie.iles@oracle.com Cc: liran.alon@oracle.com Cc: stable@vger.kernel.org Signed-off-by: Jeremy Cline Signed-off-by: David S. Miller commit 1c89a8e3d9a235454169e189ea6c463bfa8749ab Author: Alexander Aring Date: Sun Aug 12 16:24:56 2018 -0400 ieee802154: hwsim: using right kind of iteration This patch fixes the error path to unsubscribe all other phy's from current phy. The actually code using a wrong kind of list iteration may copied from the case to unsubscribe the current phy from all other phy's. Cc: Stefan Schmidt Reported-by: Dan Carpenter Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb") Signed-off-by: Alexander Aring Signed-off-by: David S. Miller commit ac272a3e9c0838a2cbc76327e29788dc2af49abe Merge: 1bbf3aed25e0 3e85af6a6812 Author: David S. Miller Date: Tue Aug 14 09:54:24 2018 -0700 Merge branch 'hns3-next' Salil Mehta says: ==================== Misc bug fixes & small enhancements for HNS3 Driver This patch-set presents some bug fixes and minor enhancements to HNS3 Ethernet driver. Rework Summary: (*) Patch V1->V2 1. Fixed David S Miller's comments 2. Dropped patch 0005 "net: hns3: Fix for vf vlan delete failed problem" for now. ==================== Signed-off-by: David S. Miller commit 3e85af6a6812d2d4778c3b19f17384c2a9f73200 Author: Peng Li Date: Tue Aug 14 17:13:19 2018 +0100 net: hns3: Add vlan filter setting by ethtool command -K Revision(0x20) HW does not support enabling or disabling individual netdev's HW_VLAN_CTAG_FILTER feature, and Revision(0x21) supports enabling or disabling individual netdev's HW_VLAN_CTAG_FILTER feature. Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 1c77215480bcfa0852575180f997bd156f2aef17 Author: Yunsheng Lin Date: Tue Aug 14 17:13:18 2018 +0100 net: hns3: Set tx ring' tc info when netdev is up The HNS3_RING_TX_RING_TC_REG register is used to map tx ring to specific tc, the tx queue to tc mapping is needed by the hardware to do the correct tx schedule. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 26a07ccc1d0781fee3027e40a8bfa7a1a3358df3 Author: Yunsheng Lin Date: Tue Aug 14 17:13:17 2018 +0100 net: hns3: Remove tx ring BD len register in hns3_enet There is no HNS3_RING_TX_RING_BD_LEN_REG register according to UM, so this patch removes it. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 128b900de7df567ca7ca063bf5da4ed0f357db8c Author: Yunsheng Lin Date: Tue Aug 14 17:13:16 2018 +0100 net: hns3: Fix desc num set to default when setting channel When user set the channel num using "ethtool -L ethX", the desc num of BD will set to default value, which will cause desc num set by user lost problem. This patch fixes it by restoring the desc num set by user when setting channel num. Fixes: 09f2af6405b8 ("net: hns3: add support to modify tqps number") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 60081dcc4fce385ade26d3145b2479789df0b7e5 Author: Jian Shen Date: Tue Aug 14 17:13:15 2018 +0100 net: hns3: Fix for phy link issue when using marvell phy driver For marvell phy m88e1510, bit SUPPORTED_FIBRE of phydev->supported is default on. Both phy_resume() and phy_suspend() will check the SUPPORTED_FIBRE bit and write register of fibre page. Currently in hns3 driver, the SUPPORTED_FIBRE bit will be cleared after phy_connect_direct() finished. Because phy_resume() is called in phy_connect_direct(), and phy_suspend() is called when disconnect phy device, so the operation for fibre page register is not symmetrical. It will cause phy link issue when reload hns3 driver. This patch fixes it by disable the SUPPORTED_FIBRE before connecting phy. Fixes: 256727da7395 ("net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit b01b7cf19bf4a677d5dd4e63b12d86a021db751d Author: Fuyun Liang Date: Tue Aug 14 17:13:14 2018 +0100 net: hns3: Fix for information of phydev lost problem when down/up Function call of phy_connect_direct will reinitialize phydev. Some information like advertising will be lost. Phy_connect_direct only needs to be called once. And driver can run well. This patch adds some functions to ensure that phy_connect_direct is called only once to solve the information of phydev lost problem occurring when we stop the net and open it again. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 6c39d5278e62956238a681e4cfc69fae5507fc57 Author: Xi Wang Date: Tue Aug 14 17:13:13 2018 +0100 net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero According to the functional specification of hardware, the first descriptor of response from command 'lookup vlan talbe' is not valid. Currently, the first descriptor is parsed as normal value, which will cause an expected error. This patch fixes this problem by skipping the first descriptor. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Xi Wang Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 5fd50ac38fb66451672b75f8d143dbef6081dd3a Author: Peng Li Date: Tue Aug 14 17:13:12 2018 +0100 net: hns3: Add support for serdes loopback selftest This patch adds support for serdes loopback selftest in hns3 driver. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit b089cfd95d32638335c551651a8e00fd2c4edb0b Author: Jens Axboe Date: Tue Aug 14 10:52:40 2018 -0600 block: don't warn for flush on read-only device Don't warn for a flush issued to a read-only device. It's not strictly a writable command, as it doesn't change any on-media data by itself. Reported-by: Stefan Agner Fixes: 721c7fc701c7 ("block: fail op_is_write() requests to read-only partitions") Signed-off-by: Jens Axboe commit 7fa750a163089cf96866de402314d853a96cb342 Author: Arnd Bergmann Date: Mon Aug 13 23:38:06 2018 +0200 f2fs: rework fault injection handling to avoid a warning When CONFIG_F2FS_FAULT_INJECTION is disabled, we get a warning about an unused label: fs/f2fs/segment.c: In function '__submit_discard_cmd': fs/f2fs/segment.c:1059:1: error: label 'submit' defined but not used [-Werror=unused-label] This could be fixed by adding another #ifdef around it, but the more reliable way of doing this seems to be to remove the other #ifdefs where that is easily possible. By defining time_to_inject() as a trivial stub, most of the checks for CONFIG_F2FS_FAULT_INJECTION can go away. This also leads to nicer formatting of the code. Signed-off-by: Arnd Bergmann Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 958f338e96f874a0d29442396d6adf9c1e17aa2d Merge: 781fca5b1046 07d981ad4cf1 Author: Linus Torvalds Date: Tue Aug 14 09:46:06 2018 -0700 Merge branch 'l1tf-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Merge L1 Terminal Fault fixes from Thomas Gleixner: "L1TF, aka L1 Terminal Fault, is yet another speculative hardware engineering trainwreck. It's a hardware vulnerability which allows unprivileged speculative access to data which is available in the Level 1 Data Cache when the page table entry controlling the virtual address, which is used for the access, has the Present bit cleared or other reserved bits set. If an instruction accesses a virtual address for which the relevant page table entry (PTE) has the Present bit cleared or other reserved bits set, then speculative execution ignores the invalid PTE and loads the referenced data if it is present in the Level 1 Data Cache, as if the page referenced by the address bits in the PTE was still present and accessible. While this is a purely speculative mechanism and the instruction will raise a page fault when it is retired eventually, the pure act of loading the data and making it available to other speculative instructions opens up the opportunity for side channel attacks to unprivileged malicious code, similar to the Meltdown attack. While Meltdown breaks the user space to kernel space protection, L1TF allows to attack any physical memory address in the system and the attack works across all protection domains. It allows an attack of SGX and also works from inside virtual machines because the speculation bypasses the extended page table (EPT) protection mechanism. The assoicated CVEs are: CVE-2018-3615, CVE-2018-3620, CVE-2018-3646 The mitigations provided by this pull request include: - Host side protection by inverting the upper address bits of a non present page table entry so the entry points to uncacheable memory. - Hypervisor protection by flushing L1 Data Cache on VMENTER. - SMT (HyperThreading) control knobs, which allow to 'turn off' SMT by offlining the sibling CPU threads. The knobs are available on the kernel command line and at runtime via sysfs - Control knobs for the hypervisor mitigation, related to L1D flush and SMT control. The knobs are available on the kernel command line and at runtime via sysfs - Extensive documentation about L1TF including various degrees of mitigations. Thanks to all people who have contributed to this in various ways - patches, review, testing, backporting - and the fruitful, sometimes heated, but at the end constructive discussions. There is work in progress to provide other forms of mitigations, which might be less horrible performance wise for a particular kind of workloads, but this is not yet ready for consumption due to their complexity and limitations" * 'l1tf-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (75 commits) x86/microcode: Allow late microcode loading with SMT disabled tools headers: Synchronise x86 cpufeatures.h for L1TF additions x86/mm/kmmio: Make the tracer robust against L1TF x86/mm/pat: Make set_memory_np() L1TF safe x86/speculation/l1tf: Make pmd/pud_mknotpresent() invert x86/speculation/l1tf: Invert all not present mappings cpu/hotplug: Fix SMT supported evaluation KVM: VMX: Tell the nested hypervisor to skip L1D flush on vmentry x86/speculation: Use ARCH_CAPABILITIES to skip L1D flush on vmentry x86/speculation: Simplify sysfs report of VMX L1TF vulnerability Documentation/l1tf: Remove Yonah processors from not vulnerable list x86/KVM/VMX: Don't set l1tf_flush_l1d from vmx_handle_external_intr() x86/irq: Let interrupt handlers set kvm_cpu_l1tf_flush_l1d x86: Don't include linux/irq.h from asm/hardirq.h x86/KVM/VMX: Introduce per-host-cpu analogue of l1tf_flush_l1d x86/irq: Demote irq_cpustat_t::__softirq_pending to u16 x86/KVM/VMX: Move the l1tf_flush_l1d test to vmx_l1d_flush() x86/KVM/VMX: Replace 'vmx_l1d_flush_always' with 'vmx_l1d_flush_cond' x86/KVM/VMX: Don't set l1tf_flush_l1d to true from vmx_l1d_flush() cpu/hotplug: detect SMT disabled by BIOS ... commit e1b437691a624a7e767bbb140c730d2779797f53 Author: Colin Ian King Date: Tue Jul 17 15:42:53 2018 +0100 orangefs: remove redundant pointer orangefs_inode Pointer orangefs_inode is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'orangefs_inode' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Mike Marshall commit 8bf782f64737be055e6c1fad7a4c7cae7aae2d99 Author: Souptick Joarder Date: Fri Jun 29 00:12:40 2018 +0530 orangefs: Adding new return type vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. See the following commit 1c8f422059ae ("mm: change return type to vm_fault_t") Fixed checkpatch.pl warning. Signed-off-by: Souptick Joarder Signed-off-by: Mike Marshall commit 781fca5b104693bc9242199cc47c690dcaf6a4cb Merge: 10f3e23f07cb 01239d77b9dd Author: Linus Torvalds Date: Tue Aug 14 08:56:02 2018 -0700 Merge tag 'xfs-4.19-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Darrick Wong: "This is the second part of the XFS changes for 4.19. The biggest changes are the removal of buffer heads frm XFS, a massive reworking of the deferred transaction operations handling code, the removal of the long defunct barrier/nobarrier mount options, and the addition of a few more online repair functions. Summary: - Use extent maps to track pagecache page status instead of bufferhead state. - Refactor pagecache read and write paths to use the new iomap library functions, which enable us to drop the old bufferhead code for pagesize == blocksize filesystems. - Set up parallel per-block-per-page metadata to track subpage information that was tracked by buffer heads, which enables us to drop the old bufferhead code for pagesize > blocksize filesystems. - Tie a deferred ops control structure to a transaction so that we can take advantage of an upper-level dfops without having to plumb pointer passing through the code. - Refactor the deferred ops code to track deferred ops as part of the transaction structure (instead of as a separate data structure) so that we can simplify the scoping rules around defer_ops. - Refactor twisty delwri buffer submission code to avoid deadlocks. - Shorten and fix indenting problems in the scrub code. - Detect obviously bad summary counts at mount and fix them. - Directly associate deferred ops control structure with a transaction so that callers no longer have to manage it themselves. - Remove a couple of IRIX-era inode macros. - Remove the long-deprecated 'barrier' and 'nobarrier' mount options. - Clean up the inode fork structure a bit. - Check for bad fs summary counter values in the superblock. - Reduce COW fork lookups during writeback. - Refactor the deferred ops control structures into the transaction structure, thereby eliminating the need for transaction users to handle the deferred ops as a separate data structure. - Add the ability to repair AG headers online. - Fix a crash due to insufficient return value checking. - Various fixes and cleanups" * tag 'xfs-4.19-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (155 commits) xfs: fix a null pointer dereference in xfs_bmap_extents_to_btree xfs: remove b_last_holder & associated macros iomap: Switch to offset_in_page for clarity xfs: Close race between direct IO and xfs_break_layouts() xfs: repair the AGI xfs: repair the AGFL xfs: repair the AGF xfs: remove dead error handling code in xfs_dquot_disk_alloc() xfs: use WRITE_ONCE to update if_seq xfs: fix a comment in xfs_log_reserve xfs: only validate summary counts on primary superblock xfs: substitute spaces with tabs xfs: fold dfops into the transaction xfs: always defer agfl block frees xfs: pass transaction to xfs_defer_add() xfs: replace xfs_defer_ops ->dop_pending with on-stack list xfs: cancel dfops on xfs_defer_finish() error xfs: clean out superfluous dfops dop params/vars xfs: drop dop param from xfs_defer_op_type ->finish_item() callback xfs: automatic dfops inode relogging ... commit 12eeeb4f4733bbc4481d01df35933fc15beb8b19 Author: Yong Zhi Date: Mon Aug 13 18:15:14 2018 -0500 ASoC: Intel: Skylake: Acquire irq after RIRB allocation Cold reboot stress test found that the hda irq could access rirb ring buffer before its memory gets allocated which resulting in null pointer dereference inside snd_hdac_bus_update_rirb(). Fix it by moving the skl_acquire_irq after ring buffer allocation. While here, also change err return from -EBUSY to actual error code. Signed-off-by: Yong Zhi Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 7d5e049e72c4cb933b557c78cbd63285dd8102ce Author: Darrick J. Wong Date: Fri Aug 10 17:55:57 2018 -0700 iomap: fix WARN_ON_ONCE on uninitialized variable In commit 9dc55f1389f9569 ("iomap: add support for sub-pagesize buffered I/O without buffer heads") we moved the initialization of poff (it's computed from pos) into a separate helper function. Inline data only ever deals with pos == 0, hence the WARN_ON_ONCE, but now we're testing an uninitialized variable. Therefore, change the test to check the parameter directly. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino commit 1fc25f51d7c18e07e8cf935cbdd4603adfc7b3ad Author: Darrick J. Wong Date: Fri Aug 10 17:55:57 2018 -0700 xfs: sanity check ag header values in xrep_calc_ag_resblks Check the values we read in from the AG headers when calculating the block reservations for a repair transaction. If they're obviously wrong, substitute worst case assumptions (rather than ENOSPC on a bogus reservation request). Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino commit 9f0e89359775ee21fe1ea732e34edb52aef5addf Author: Myron Stowe Date: Mon Aug 13 12:19:46 2018 -0600 PCI: Match Root Port's MPS to endpoint's MPSS as necessary In commit 27d868b5e6cf ("PCI: Set MPS to match upstream bridge"), we made sure every device's MPS setting matches its upstream bridge, making it more likely that a hot-added device will work in a system with an optimized MPS configuration. Recently I've started encountering systems where the endpoint device's MPSS capability is less than its Root Port's current MPS value, thus the endpoint is not capable of matching its upstream bridge's MPS setting (see: bugzilla via "Link:" below). This leaves the system vulnerable - the upstream Root Port could respond with larger TLPs than the device can handle, and the device will consider them to be 'Malformed'. One could use the "pci=pcie_bus_safe" kernel parameter to work around the issue, but that forces a user to supply a kernel parameter to get the system to function reliably and may end up limiting MPS settings of other unrelated, sub-topologies which could benefit from maintaining their larger values. Augment Keith's approach to include tuning down a Root Port's MPS setting when its hot-added endpoint device is not capable of matching it. Link: https://bugzilla.kernel.org/show_bug.cgi?id=200527 Signed-off-by: Myron Stowe Signed-off-by: Bjorn Helgaas Acked-by: Jon Mason Cc: Keith Busch Cc: Sinan Kaya Cc: Dongdong Liu commit fb504caae7ef85be159743bd4b08ecde269ba55f Author: Dmitry V. Levin Date: Mon Aug 13 18:50:02 2018 +0300 ASoC: uapi: fix sound/skl-tplg-interface.h userspace compilation errors Include and consistently use types it provides to fix the following sound/skl-tplg-interface.h userspace compilation errors: /usr/include/sound/skl-tplg-interface.h:146:2: error: unknown type name 'u32' u32 set_params:2; /usr/include/sound/skl-tplg-interface.h:147:2: error: unknown type name 'u32' u32 rsvd:30; /usr/include/sound/skl-tplg-interface.h:148:2: error: unknown type name 'u32' u32 param_id; /usr/include/sound/skl-tplg-interface.h:149:2: error: unknown type name 'u32' u32 max; /usr/include/sound/skl-tplg-interface.h:166:2: error: unknown type name 'u16' u16 module_id; /usr/include/sound/skl-tplg-interface.h:167:2: error: unknown type name 'u16' u16 instance_id; /usr/include/sound/skl-tplg-interface.h:171:2: error: unknown type name 'u32' u32 channels; /usr/include/sound/skl-tplg-interface.h:172:2: error: unknown type name 'u32' u32 freq; /usr/include/sound/skl-tplg-interface.h:173:2: error: unknown type name 'u32' u32 bit_depth; /usr/include/sound/skl-tplg-interface.h:174:2: error: unknown type name 'u32' u32 valid_bit_depth; /usr/include/sound/skl-tplg-interface.h:175:2: error: unknown type name 'u32' u32 ch_cfg; /usr/include/sound/skl-tplg-interface.h:176:2: error: unknown type name 'u32' u32 interleaving_style; /usr/include/sound/skl-tplg-interface.h:177:2: error: unknown type name 'u32' u32 sample_type; /usr/include/sound/skl-tplg-interface.h:178:2: error: unknown type name 'u32' u32 ch_map; /usr/include/sound/skl-tplg-interface.h:182:2: error: unknown type name 'u32' u32 set_params:2; /usr/include/sound/skl-tplg-interface.h:183:2: error: unknown type name 'u32' u32 rsvd:30; /usr/include/sound/skl-tplg-interface.h:184:2: error: unknown type name 'u32' u32 param_id; /usr/include/sound/skl-tplg-interface.h:185:2: error: unknown type name 'u32' u32 caps_size; /usr/include/sound/skl-tplg-interface.h:186:2: error: unknown type name 'u32' u32 caps[HDA_SST_CFG_MAX]; /usr/include/sound/skl-tplg-interface.h:190:2: error: unknown type name 'u8' u8 pipe_id; /usr/include/sound/skl-tplg-interface.h:191:2: error: unknown type name 'u8' u8 pipe_priority; /usr/include/sound/skl-tplg-interface.h:192:2: error: unknown type name 'u16' u16 conn_type:4; /usr/include/sound/skl-tplg-interface.h:193:2: error: unknown type name 'u16' u16 rsvd:4; /usr/include/sound/skl-tplg-interface.h:194:2: error: unknown type name 'u16' u16 memory_pages:8; /usr/include/sound/skl-tplg-interface.h:200:2: error: unknown type name 'u16' u16 module_id; /usr/include/sound/skl-tplg-interface.h:201:2: error: unknown type name 'u16' u16 instance_id; /usr/include/sound/skl-tplg-interface.h:202:2: error: unknown type name 'u32' u32 max_mcps; /usr/include/sound/skl-tplg-interface.h:203:2: error: unknown type name 'u32' u32 mem_pages; /usr/include/sound/skl-tplg-interface.h:204:2: error: unknown type name 'u32' u32 obs; /usr/include/sound/skl-tplg-interface.h:205:2: error: unknown type name 'u32' u32 ibs; /usr/include/sound/skl-tplg-interface.h:206:2: error: unknown type name 'u32' u32 vbus_id; /usr/include/sound/skl-tplg-interface.h:208:2: error: unknown type name 'u32' u32 max_in_queue:8; /usr/include/sound/skl-tplg-interface.h:209:2: error: unknown type name 'u32' u32 max_out_queue:8; /usr/include/sound/skl-tplg-interface.h:210:2: error: unknown type name 'u32' u32 time_slot:8; /usr/include/sound/skl-tplg-interface.h:211:2: error: unknown type name 'u32' u32 core_id:4; /usr/include/sound/skl-tplg-interface.h:212:2: error: unknown type name 'u32' u32 rsvd1:4; /usr/include/sound/skl-tplg-interface.h:214:2: error: unknown type name 'u32' u32 module_type:8; /usr/include/sound/skl-tplg-interface.h:215:2: error: unknown type name 'u32' u32 conn_type:4; /usr/include/sound/skl-tplg-interface.h:216:2: error: unknown type name 'u32' u32 dev_type:4; /usr/include/sound/skl-tplg-interface.h:217:2: error: unknown type name 'u32' u32 hw_conn_type:4; /usr/include/sound/skl-tplg-interface.h:218:2: error: unknown type name 'u32' u32 rsvd2:12; /usr/include/sound/skl-tplg-interface.h:220:2: error: unknown type name 'u32' u32 params_fixup:8; /usr/include/sound/skl-tplg-interface.h:221:2: error: unknown type name 'u32' u32 converter:8; /usr/include/sound/skl-tplg-interface.h:222:2: error: unknown type name 'u32' u32 input_pin_type:1; /usr/include/sound/skl-tplg-interface.h:223:2: error: unknown type name 'u32' u32 output_pin_type:1; /usr/include/sound/skl-tplg-interface.h:224:2: error: unknown type name 'u32' u32 is_dynamic_in_pin:1; /usr/include/sound/skl-tplg-interface.h:225:2: error: unknown type name 'u32' u32 is_dynamic_out_pin:1; /usr/include/sound/skl-tplg-interface.h:226:2: error: unknown type name 'u32' u32 is_loadable:1; /usr/include/sound/skl-tplg-interface.h:227:2: error: unknown type name 'u32' u32 rsvd3:11; Fixes: 0c24fdc00244 ("ASoC: topology: Move skl-tplg-interface.h to uapi") Signed-off-by: Dmitry V. Levin Reviewed-by: Guenter Roeck Signed-off-by: Mark Brown Cc: # v4.18 commit 3dbe97efe8bf450b183d6dee2305cbc032e6b8a4 Author: Myron Stowe Date: Mon Aug 13 12:19:39 2018 -0600 PCI: Skip MPS logic for Virtual Functions (VFs) PCIe r4.0, sec 9.3.5.4, "Device Control Register", shows both Max_Payload_Size (MPS) and Max_Read_request_Size (MRRS) to be 'RsvdP' for VFs. Just prior to the table it states: "PF and VF functionality is defined in Section 7.5.3.4 except where noted in Table 9-16. For VF fields marked 'RsvdP', the PF setting applies to the VF." All of which implies that with respect to Max_Payload_Size Supported (MPSS), MPS, and MRRS values, we should not be paying any attention to the VF's fields, but rather only to the PF's. Only looking at the PF's fields also logically makes sense as it's the sole physical interface to the PCIe bus. Link: https://bugzilla.kernel.org/show_bug.cgi?id=200527 Fixes: 27d868b5e6cf ("PCI: Set MPS to match upstream bridge") Signed-off-by: Myron Stowe Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # 4.3+ Cc: Keith Busch Cc: Sinan Kaya Cc: Dongdong Liu Cc: Jon Mason commit 5e4cfadaf5b73a0801b2fa7fb007f98400ebfe6e Author: Marcel Ziswiler Date: Tue Aug 14 00:35:56 2018 +0200 ASoC: wm9712: fix replace codec to component Since commit 143b44845d87 ("ASoC: wm9712: replace codec to component") "wm9712-codec" got renamed to "wm9712-component", however, this change never got propagated down to the actual board/platform drivers. E.g. on Colibri T20 this lead to the following spew upon boot with sound/touch being broken: [ 2.214121] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered [ 2.222137] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517) ... [ 2.344384] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered [ 2.351885] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517) ... [ 2.668339] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered [ 2.675811] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517) ... [ 3.208408] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered [ 3.216312] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517) ... [ 3.235397] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered [ 3.248938] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517) ... [ 14.970443] ALSA device list: [ 14.996628] No soundcards found. This commit finally fixes this again. Signed-off-by: Marcel Ziswiler Acked-by: Charles Keepax Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 260c48b7ec26dfaf70d9230c3639f420e304e781 Author: Hans de Goede Date: Sun Aug 12 13:42:06 2018 +0200 ASoC: Intel: bytcr_rt5640: Add quirks for 2 more devices Add quirks to select the right input-map, jack-detect pin, etc. for: Linx Linx7 tablet Onda V975w tablet Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit bc00b3ec7722b33cb67fd2cb6bf334e03a6322c2 Author: Heiko Carstens Date: Tue Aug 14 13:29:11 2018 +0200 s390: reenable gcc plugins for real Martin's patch 6eedfaac712d ("s390: reenable gcc plugins") was lost in the merge commit 85a0b791bc17 ("Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux") therefore let's enable gcc plugins again. Cc: Martin Schwidefsky Signed-off-by: Heiko Carstens commit 77cfaf52eca5cac30ed029507e0cab065f888995 Author: Toke Høiland-Jørgensen Date: Mon Aug 13 14:16:25 2018 +0200 mac80211: Run TXQ teardown code before de-registering interfaces The TXQ teardown code can reference the vif data structures that are stored in the netdev private memory area if there are still packets on the queue when it is being freed. Since the TXQ teardown code is run after the netdevs are freed, this can lead to a use-after-free. Fix this by moving the TXQ teardown code to earlier in ieee80211_unregister_hw(). Reported-by: Ben Greear Tested-by: Ben Greear Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Johannes Berg commit f623f75ae443d0c771635d51cc986b9d389bf631 Author: Arnd Bergmann Date: Tue Aug 14 00:35:24 2018 +0200 rfkill-gpio: include linux/mod_devicetable.h One more driver is apparently broken by the recent change to linux/platform_device.h: net/rfkill/rfkill-gpio.c: In function 'rfkill_gpio_acpi_probe': net/rfkill/rfkill-gpio.c:82:29: error: dereferencing pointer to incomplete type 'const struct acpi_device_id' Include linux/mod_devicetable.h to get the definition of the acpi_device_id structure. Fixes: ac3167257b9f ("headers: separate linux/mod_devicetable.h from linux/platform_device.h") Signed-off-by: Arnd Bergmann Signed-off-by: Johannes Berg commit 9f68cb579115faa211ae067b4628cf11162783fb Merge: 554ec5086536 03fc7f9c99c1 Author: Petr Mladek Date: Tue Aug 14 13:36:15 2018 +0200 Merge branch 'for-4.19-nmi' into for-linus commit 76f7d6c07acd7a694ccc97355d37637f6677de51 Merge: 3c94280456d9 2c4c2a71bd6f b41901a2cf06 887532ca7ca5 Author: Rafael J. Wysocki Date: Tue Aug 14 10:17:28 2018 +0200 Merge branches 'acpi-button', 'acpi-battery' and 'acpi-osi' Merge updates of the ACPI battery and button drivers and support for a new OEM _OSI string for 4.19. * acpi-button: ACPI / button: fix defined but not used warning ACPI / button: increment wakeup count only when notified * acpi-battery: ACPI / battery: Do not export energy_full[_design] on devices without full_charge_capacity ACPI / battery: get rid of negations in conditions ACPI / battery: use specialized print macros ACPI / battery: reorder headers alphabetically ACPI / battery: drop inclusion of init.h ACPI: battery: remove redundant old_present check on insertion * acpi-osi: ACPI / OSI: Add OEM _OSI string to enable NVidia HDMI audio commit 3c94280456d9925a795e5d423330acac4b223823 Merge: 4a3f421b878d e64e84987de5 67fbd0a3a802 4c3be61e41b4 1035a0783523 Author: Rafael J. Wysocki Date: Tue Aug 14 10:06:45 2018 +0200 Merge branches 'acpi-x86', 'acpi-bus', 'acpi-ec' and 'acpi-apei' Merge ACPI x86-specific changes, core updates, EC driver updates and APEI support updates for 4.19. These add a special platform driver for handling multiple I2C devices hooked up to the same device object in the ACPI tables, add some new quirks and remove one that is not needed any more. * acpi-x86: platform/x86: Add ACPI i2c-multi-instantiate pseudo driver ACPI / x86: utils: Remove status workaround from acpi_device_always_present() ACPI / x86: enable touchscreen on Dell Venue Pro 7139 * acpi-bus: ACPI: bus: Fix a pointer coding style issue Revert "ACPI / bus: Parse tables as term_list for Dell XPS 9570 and Precision M5530" * acpi-ec: ACPI / EC: Add another entry for Thinkpad X1 Carbon 6th ACPI / EC: Use ec_no_wakeup on ThinkPad X1 Yoga 3rd * acpi-apei: arm64 / ACPI: clean the additional checks before calling ghes_notify_sea() commit 4a3f421b878d6240a01a556e036a38baf3268c26 Merge: aba941392aee 398404d8372c a4138e7c1228 Author: Rafael J. Wysocki Date: Tue Aug 14 10:04:59 2018 +0200 Merge branches 'acpica' and 'acpi-property' Merge ACPICA changes and updates of the ACPI device properties framework for 4.19. These revert two ACPICA commits that are not needed any more and modify the properties graph support in ACPI to be more in-line with the analogous DT code. * acpica: ACPICA: Update version to 20180629 ACPICA: Revert "iASL compiler: allow compilation of externals with paths that refer to existing names" ACPICA: Revert "iASL: change processing of external op namespace nodes for correctness" * acpi-property: ACPI: property: graph: Update graph documentation to use generic references ACPI: property: graph: Improve graph documentation for port/ep numbering ACPI: property: graph: Fix graph documentation ACPI: property: Update documentation for hierarchical data extension 1.1 ACPI: property: Document key numbering for hierarchical data extension refs ACPI: property: Use data node name and reg property for graphs ACPI: property: Allow direct graph endpoint references ACPI: property: Make the ACPI graph API private ACPI: property: Document hierarchical data extension references ACPI: property: Allow making references to non-device nodes ACPI: Convert ACPI reference args to generic fwnode reference args commit 7425ecd5e3e8c9d84f399a102282a23a90a19278 Merge: 8f0f2b621198 d3264f752a1a Author: Rafael J. Wysocki Date: Tue Aug 14 09:57:34 2018 +0200 Merge branch 'pm-cpufreq' Merge cpufreq changes for 4.19. These are driver extensions, some driver and core fixes and a new tracepoint for the tracking of frequency limits changes (coming from Android). * pm-cpufreq: cpufreq: intel_pstate: Ignore turbo active ratio in HWP cpufreq: Fix a circular lock dependency problem cpu/hotplug: Add a cpus_read_trylock() function cpufreq: trace frequency limits change cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP cpufreq: pcc-cpufreq: Disable dynamic scaling on many-CPU systems cpufreq: qcom-kryo: Silently error out on EPROBE_DEFER cpufreq / CPPC: Add cpuinfo_cur_freq support for CPPC cpufreq: armada-37xx: Add AVS support dt-bindings: marvell: Add documentation for the Armada 3700 AVS binding cpufreq: imx6q/thermal: imx: register cooling device depending on OF cpufreq: intel_pstate: use match_string() helper commit 8f0f2b621198bce551f83e87b71c6114b1a91a31 Merge: 17bc3432e39d 88763a5cf80c a33733fc4891 Author: Rafael J. Wysocki Date: Tue Aug 14 09:51:19 2018 +0200 Merge branches 'powercap' and 'pm-devfreq' Merge devfreq changes and a new CPU idle time injection framework for 4.19. * powercap: powercap / idle_inject: Add an idle injection framework * pm-devfreq: PM / devfreq: rk3399_dmc: Fix duplicated opp table on reload. PM / devfreq: Init user limits from OPP limits, not viceversa PM / devfreq: rk3399_dmc: fix spelling mistakes. PM / devfreq: rk3399_dmc: do not print error when get supply and clk defer. dt-bindings: devfreq: rk3399_dmc: move interrupts to be optional. PM / devfreq: rk3399_dmc: remove wait for dcf irq event. dt-bindings: clock: add rk3399 DDR3 standard speed bins. dt-bindings: devfreq: rk3399_dmc: improve binding documentation. PM / devfreq: use put_device() instead of kfree() PM / devfreq: exynos-ppmu: Delete an error message for a failed memory allocation in exynos_ppmu_probe() commit 17bc3432e39d10ff50a090a37bbdabfca69467c5 Merge: 9b7c19e96ced 1689cac5b32a 27dceb81f445 55f2503c3b69 231f94150011 818489e511a3 Author: Rafael J. Wysocki Date: Tue Aug 14 09:48:10 2018 +0200 Merge branches 'pm-core', 'pm-domains', 'pm-sleep', 'acpi-pm' and 'pm-cpuidle' Merge changes in the PM core, system-wide PM infrastructure, generic power domains (genpd) framework, ACPI PM infrastructure and cpuidle for 4.19. * pm-core: driver core: Add flag to autoremove device link on supplier unbind driver core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER * pm-domains: PM / Domains: Introduce dev_pm_domain_attach_by_name() PM / Domains: Introduce option to attach a device by name to genpd PM / Domains: dt: Add a power-domain-names property * pm-sleep: PM / reboot: Eliminate race between reboot and suspend PM / hibernate: Mark expected switch fall-through x86/power/hibernate_64: Remove VLA usage PM / hibernate: cast PAGE_SIZE to int when comparing with error code * acpi-pm: ACPI / PM: save NVS memory for ASUS 1025C laptop ACPI / PM: Default to s2idle in all machines supporting LP S0 * pm-cpuidle: ARM: cpuidle: silence error on driver registration failure commit 7590ebb8b456464e48840a6d106a0c07de6d723a Author: Yi Wang Date: Wed Aug 8 23:10:57 2018 +0800 drm/i915/gvt: fix memory leak in intel_vgpu_ioctl() The 'sparse' variable may leak when return in function intel_vgpu_ioctl(), and this patch fix this. Signed-off-by: Yi Wang Reviewed-by: Jiang Biao Signed-off-by: Zhenyu Wang commit 4b25e737cfc7f2ade956df3c747a7dd2ff1e2774 Author: Dan Carpenter Date: Tue Aug 7 09:46:02 2018 +0300 drm/i915/gvt: Off by one in intel_vgpu_write_fence() The > should be >= here so that we don't read one element beyond the end of the array. Fixes: 28a60dee2ce6 ("drm/i915/gvt: vGPU HW resource management") Signed-off-by: Dan Carpenter Reviewed-by: Rodrigo Vivi Signed-off-by: Zhenyu Wang commit de5372da605d3bca46e3102bab51b7e1c0e0a6f6 Author: Gustavo A. R. Silva Date: Thu Aug 2 22:40:19 2018 -0500 drm/i915/kvmgt: Fix potential Spectre v1 info.index can be indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/gpu/drm/i915/gvt/kvmgt.c:1232 intel_vgpu_ioctl() warn: potential spectre issue 'vgpu->vdev.region' [r] Fix this by sanitizing info.index before indirectly using it to index vgpu->vdev.region Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Signed-off-by: Zhenyu Wang commit 8d458ea0ec331adb4c829289e9a56c97d3c1e542 Author: Zhao Yan Date: Wed Aug 1 00:15:48 2018 -0400 drm/i915/gvt: return error on cmd access If a register is not cmd accessible, should not just print error message. Return error here so as not to deliver this cmd. v2: return -EBADRQC to align with return value elsewhere. (kevin tian) Signed-off-by: Zhao Yan Signed-off-by: Zhenyu Wang commit d6c6113bfe19af514128163a6d176437d45b7325 Author: Hang Yuan Date: Mon Jul 30 10:52:53 2018 +0800 drm/i915/gvt: initialize dmabuf mutex in vgpu_create Currently, the mutex used in GVT dmabuf support is not initialized until vgpu device is opened. If one vgpu device is opened and then removed, the mutex will be used in vgpu remove operation without initialization. This patch initializes the mutex in vgpu create operation to avoid the problem. Fixes: e546e281d33d("drm/i915/gvt: Dmabuf support for GVT-g") Signed-off-by: Hang Yuan Signed-off-by: Zhenyu Wang commit 3fd34ac02ae8cc20d78e3aed2cf6e67f0ae109ea Author: Hang Yuan Date: Mon Jul 23 20:15:46 2018 +0800 drm/i915/gvt: fix cleanup sequence in intel_gvt_clean_device Create one vGPU and then unbind IGD device from i915 driver. The following oops will happen. This patch will free vgpu resource first and then gvt resource to remove these oops. BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8 PGD 80000003c9d2c067 P4D 80000003c9d2c067 PUD 3c817c067 P MD 0 Oops: 0002 [#1] SMP PTI RIP: 0010:down_write+0x1b/0x40 Call Trace: debugfs_remove_recursive+0x46/0x1a0 intel_gvt_debugfs_remove_vgpu+0x15/0x30 [i915] intel_gvt_destroy_vgpu+0x2d/0xf0 [i915] intel_vgpu_remove+0x2c/0x30 [kvmgt] mdev_device_remove_ops+0x23/0x50 [mdev] mdev_device_remove+0xdb/0x190 [mdev] mdev_device_remove+0x190/0x190 [mdev] device_for_each_child+0x47/0x90 mdev_unregister_device+0xd5/0x120 [mdev] intel_gvt_clean_device+0x91/0x120 [i915] i915_driver_unload+0x9d/0x120 [i915] i915_pci_remove+0x15/0x20 [i915] pci_device_remove+0x3b/0xc0 device_release_driver_internal+0x157/0x230 unbind_store+0xfc/0x150 kernfs_fop_write+0x10f/0x180 __vfs_write+0x36/0x180 ? common_file_perm+0x41/0x130 ? _cond_resched+0x16/0x40 vfs_write+0xb3/0x1a0 ksys_write+0x52/0xc0 do_syscall_64+0x55/0x100 entry_SYSCALL_64_after_hwframe+0x44/0xa9 BUG: unable to handle kernel NULL pointer dereference at 0 000000000000038 PGD 8000000405bce067 P4D 8000000405bce067 PUD 405bcd067 PM D 0 Oops: 0000 [#1] SMP PTI RIP: 0010:hrtimer_active+0x5/0x40 Call Trace: hrtimer_try_to_cancel+0x25/0x120 ? tbs_sched_clean_vgpu+0x1f/0x50 [i915] hrtimer_cancel+0x15/0x20 intel_gvt_destroy_vgpu+0x4c/0xf0 [i915] intel_vgpu_remove+0x2c/0x30 [kvmgt] mdev_device_remove_ops+0x23/0x50 [mdev] mdev_device_remove+0xdb/0x190 [mdev] ? mdev_device_remove+0x190/0x190 [mdev] device_for_each_child+0x47/0x90 mdev_unregister_device+0xd5/0x120 [mdev] intel_gvt_clean_device+0x89/0x120 [i915] i915_driver_unload+0x9d/0x120 [i915] i915_pci_remove+0x15/0x20 [i915] pci_device_remove+0x3b/0xc0 device_release_driver_internal+0x157/0x230 unbind_store+0xfc/0x150 kernfs_fop_write+0x10f/0x180 __vfs_write+0x36/0x180 ? common_file_perm+0x41/0x130 ? _cond_resched+0x16/0x40 vfs_write+0xb3/0x1a0 ksys_write+0x52/0xc0 do_syscall_64+0x55/0x100 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: bc7b0be316ae("drm/i915/gvt: Add basic debugfs infrastructure") Fixes: afe04fbe6c52("drm/i915/gvt: create an idle vGPU") Signed-off-by: Hang Yuan Signed-off-by: Zhenyu Wang commit 993ff6d9df74305bc7b5bbc7a0810cf599b6394c Author: Nicholas Piggin Date: Tue Aug 7 23:21:56 2018 +1000 powerpc/64s: Fix PACA_IRQ_HARD_DIS accounting in idle_power4() When idle_power4() hard disables interrupts then finds a soft pending interrupt, it returns with interrupts hard disabled but without PACA_IRQ_HARD_DIS set. Commit 9b81c0211c ("powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely") added a warning for that condition (since disabled). Fix this by adding the PACA_IRQ_HARD_DIS for that case. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 10f3e23f07cb0c20f9bcb77a5b5a7eb2a1b2a2fe Merge: 3bb37da509e5 863c37fcb14f Author: Linus Torvalds Date: Mon Aug 13 22:34:47 2018 -0700 Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: - Convert content from the ext4 wiki to Documentation rst files so it is more likely to be updated as we add new features to ext4. - Add 64-bit timestamp support to ext4's superblock fields. - ... and the usual bug fixes and cleanups, including a Spectre gadget fixup and some hardening against maliciously corrupted file systems. * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (34 commits) ext4: remove unneeded variable "err" in ext4_mb_release_inode_pa() ext4: improve code readability in ext4_iget() ext4: fix spectre gadget in ext4_mb_regular_allocator() ext4: check for NUL characters in extended attribute's name ext4: use ext4_warning() for sb_getblk failure ext4: fix race when setting the bitmap corrupted flag ext4: reset error code in ext4_find_entry in fallback ext4: handle layout changes to pinned DAX mappings dax: dax_layout_busy_page() warn on !exceptional docs: fix up the obviously obsolete bits in the new ext4 documentation docs: add new ext4 superblock time extension fields docs: create filesystem internal section ext4: use swap macro in mext_page_double_lock ext4: check allocation failure when duplicating "data" in ext4_remount() ext4: fix warning message in ext4_enable_quotas() ext4: super: extend timestamps to 40 bits jbd2: replace current_kernel_time64 with ktime equivalent ext4: use timespec64 for all inode times ext4: use ktime_get_real_seconds for i_dtime ext4: use 64-bit timestamps for mmp_time ... commit 3bb37da509e576c80180fa0e4d1cfcaddf0cb82e Merge: 161fa27ff2e2 c4f7173ac3b7 Author: Linus Torvalds Date: Mon Aug 13 22:32:11 2018 -0700 Merge tag '4.19-smb3' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs updates from Steve French: "smb3/cifs fixes (including 8 for stable). Other improvements include: - improved tracing, improved stats - snapshots (previous version mounts work now over SMB3) - performance (compounding enabled for statfs, ~40% faster). - security (make it possible to build cifs.ko with insecure vers=1.0 disabled in Kconfig)" * tag '4.19-smb3' of git://git.samba.org/sfrench/cifs-2.6: (43 commits) smb3: create smb3 equivalent alias for cifs pseudo-xattrs smb3: allow previous versions to be mounted with snapshot= mount parm cifs: don't show domain= in mount output when domain is empty cifs: add missing support for ACLs in SMB 3.11 smb3: enumerating snapshots was leaving part of the data off end cifs: update smb2_queryfs() to use compounding cifs: update receive_encrypted_standard to handle compounded responses cifs: create SMB2_open_init()/SMB2_open_free() helpers. cifs: add SMB2_query_info_[init|free]() cifs: add SMB2_close_init()/SMB2_close_free() smb3: display stats counters for number of slow commands CIFS: fix uninitialized ptr deref in smb2 signing smb3: Do not send SMB3 SET_INFO if nothing changed smb3: fix minor debug output for CONFIG_CIFS_STATS smb3: add tracepoint for slow responses cifs: add compound_send_recv() cifs: make smb_send_rqst take an array of requests cifs: update init_sg, crypt_message to take an array of rqst smb3: update readme to correct information about /proc/fs/cifs/Stats smb3: fix reset of bytes read and written stats ... commit 161fa27ff2e2fd4ea7ccb660184670eab2b6ea98 Merge: a1a4f841ec45 806a1477b10a Author: Linus Torvalds Date: Mon Aug 13 22:29:03 2018 -0700 Merge branch 'iomap-4.19-merge' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull fs iomap refactoring from Darrick Wong: "This is the first part of the XFS changes for 4.19. Christoph and Andreas coordinated some refactoring work on the iomap code in preparation for removing buffer heads from XFS and porting gfs2 to iomap. I'm sending this small pull request ahead of the main XFS merge to avoid holding up gfs2 unnecessarily" * 'iomap-4.19-merge' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: add inline data support to iomap_readpage_actor iomap: support direct I/O to inline data iomap: refactor iomap_dio_actor iomap: add initial support for writes without buffer heads iomap: add an iomap-based readpage and readpages implementation iomap: add private pointer to struct iomap iomap: add a page_done callback iomap: generic inline data handling iomap: complete partial direct I/O writes synchronously iomap: mark newly allocated buffer heads as new fs: factor out a __generic_write_end helper commit a1a4f841ec4585185c0e75bfae43a18b282dd316 Merge: 575b94386bd5 39379faaad79 Author: Linus Torvalds Date: Mon Aug 13 21:58:53 2018 -0700 Merge tag 'for-4.19-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "Mostly fixes and cleanups, nothing big, though the notable thing is the inserted/deleted lines delta -1124. User visible changes: - allow defrag on opened read-only files that have rw permissions; similar to what dedupe will allow on such files Core changes: - tree checker improvements, reported by fuzzing: * more checks for: block group items, essential trees * chunk type validation * mount time cross-checks that physical and logical chunks match * switch more error codes to EUCLEAN aka EFSCORRUPTED Fixes: - fsync corner case fixes - fix send failure when root has deleted files still open - send, fix incorrect file layout after hole punching beyond eof - fix races between mount and deice scan ioctl, found by fuzzing - fix deadlock when delayed iput is called from writeback on the same inode; rare but has been observed in practice, also removes code - fix pinned byte accounting, using the right percpu helpers; this should avoid some write IO inefficiency during low space conditions - don't remove block group that still has pinned bytes - reset on-disk device stats value after replace, otherwise this would report stale values for the new device Cleanups: - time64_t/timespec64 cleanups - remove remaining dead code in scrub handling NOCOW extents after disabling it in previous cycle - simplify fsync regarding ordered extents logic and remove all the related code - remove redundant arguments in order to reduce stack space consumption - remove support for V0 type of extents, not in use since 2.6.30 - remove several unused structure members - fewer indirect function calls by inlining some callbacks - qgroup rescan timing fixes - vfs: iget cleanups" * tag 'for-4.19-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (182 commits) btrfs: revert fs_devices state on error of btrfs_init_new_device btrfs: Exit gracefully when chunk map cannot be inserted to the tree btrfs: Introduce mount time chunk <-> dev extent mapping check btrfs: Verify that every chunk has corresponding block group at mount time btrfs: Check that each block group has corresponding chunk at mount time Btrfs: send, fix incorrect file layout after hole punching beyond eof btrfs: Use wrapper macro for rcu string to remove duplicate code btrfs: simplify btrfs_iget btrfs: lift make_bad_inode into btrfs_iget btrfs: simplify IS_ERR/PTR_ERR checks btrfs: btrfs_iget never returns an is_bad_inode inode btrfs: replace: Reset on-disk dev stats value after replace btrfs: extent-tree: Remove unused __btrfs_free_block_rsv btrfs: backref: Use ERR_CAST to return error code btrfs: Remove redundant btrfs_release_path from btrfs_unlink_subvol btrfs: Remove root parameter from btrfs_unlink_subvol btrfs: Remove fs_info from btrfs_add_root_ref btrfs: Remove fs_info from btrfs_del_root_ref btrfs: Remove fs_info from btrfs_del_root btrfs: Remove fs_info from btrfs_delete_delayed_dir_index ... commit 575b94386bd539a7d803aee9fd4a8d275844c40f Merge: 4591343e3560 da33a871ba17 Author: Linus Torvalds Date: Mon Aug 13 21:56:50 2018 -0700 Merge tag 'locks-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux Pull file locking updates from Jeff Layton: "Just a couple of patches from Konstantin to fix /proc/locks when the process that set the lock has exited, and a new tracepoint for the flock() codepath. Also threw in mailmap entries for my addresses and a comment cleanup" * tag 'locks-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux: locks: remove misleading obsolete comment mailmap: remap some of my email addresses to kernel.org address locks: add tracepoint in flock codepath fs/lock: show locks taken by processes from another pidns fs/lock: skip lock owner pid translation in case we are in init_pid_ns commit 4591343e3560d51fa37a24cd262192a7b889a6a3 Merge: f2be26989770 7964410fcf13 63a67a926e21 Author: Linus Torvalds Date: Mon Aug 13 21:28:25 2018 -0700 Merge branches 'work.misc' and 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull misc vfs updates from Al Viro: "Misc cleanups from various folks all over the place I expected more fs/dcache.c cleanups this cycle, so that went into a separate branch. Said cleanups have missed the window, so in the hindsight it could've gone into work.misc instead. Decided not to cherry-pick, thus the 'work.dcache' branch" * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: dcache: Use true and false for boolean values fold generic_readlink() into its only caller fs: shave 8 bytes off of struct inode fs: Add more kernel-doc to the produced documentation fs: Fix attr.c kernel-doc removed extra extern file_fdatawait_range * 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: kill dentry_update_name_case() commit f2be269897708700ed9b2a96f695348a10a003e8 Merge: 4d2a073cde82 e8693bcfa0b4 Author: Linus Torvalds Date: Mon Aug 13 20:56:23 2018 -0700 Merge branch 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs aio updates from Al Viro: "Christoph's aio poll, saner this time around. This time it's pretty much local to fs/aio.c. Hopefully race-free..." * 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: aio: allow direct aio poll comletions for keyed wakeups aio: implement IOCB_CMD_POLL aio: add a iocb refcount timerfd: add support for keyed wakeups commit 4d2a073cde825dd1a0ce8ff8b6aef138997fbbd9 Merge: 0ea97a2d61df 808aa6c5e34a Author: Linus Torvalds Date: Mon Aug 13 20:54:14 2018 -0700 Merge branch 'work.lookup' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs lookup() updates from Al Viro: "More conversions of ->lookup() to d_splice_alias(). Should be reasonably complete now - the only leftovers are in ceph" * 'work.lookup' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: afs_try_auto_mntpt(): return NULL instead of ERR_PTR(-ENOENT) afs_lookup(): switch to d_splice_alias() afs: switch dynroot lookups to d_splice_alias() hpfs: fix an inode leak in lookup, switch to d_splice_alias() hostfs_lookup: switch to d_splice_alias() commit 1bbf3aed25e0fc256e825da1f5c45d7b4daa828e Author: Arnd Bergmann Date: Tue Aug 14 00:12:45 2018 +0200 bnxt_en: take coredump_record structure off stack The bnxt_coredump_record structure is very long, causing a warning about possible stack overflow on 32-bit architectures: drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c: In function 'bnxt_get_coredump': drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2989:1: error: the frame size of 1188 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] I could not see any reason to operate on an on-stack copy of the structure before copying it back into the caller-provided buffer, which also simplifies the code here. Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit cf87615d15f37182b2a3a4cd722288d3d5956900 Author: Arnd Bergmann Date: Tue Aug 14 00:10:34 2018 +0200 net: systemport: fix unused function warning The only remaining caller of this function is inside of an #ifdef after another caller got removed. This causes a harmless warning in some configurations: drivers/net/ethernet/broadcom/bcmsysport.c:1068:13: error: 'bcm_sysport_resume_from_wol' defined but not used [-Werror=unused-function] Removing the #ifdef around the PM functions simplifies the code and avoids the problem but letting the compiler drop the unused functions silently. Fixes: 9e85e22713d6 ("net: systemport: Do not re-configure upon WoL interrupt") Signed-off-by: Arnd Bergmann Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 81a8b0799632627b587af31ecd06112397e4ec36 Author: Arnd Bergmann Date: Mon Aug 13 23:50:41 2018 +0200 net: stmmac: mark PM functions as __maybe_unused The newly added suspend/resume functions cause a build warning when CONFIG_PM is disabled: drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:324:12: error: 'stmmac_pci_resume' defined but not used [-Werror=unused-function] drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:306:12: error: 'stmmac_pci_suspend' defined but not used [-Werror=unused-function] Mark them as __maybe_unused so gcc can drop them silently. Fixes: b7d0f08e9129 ("net: stmmac: Fix WoL for PCI-based setups") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit c2ebc25674e5123d134e81758828084f1cc58cc3 Author: Arnd Bergmann Date: Mon Aug 13 23:43:05 2018 +0200 l2tp: fix unused function warning Removing one of the callers of pppol2tp_session_get_sock caused a harmless warning in some configurations: net/l2tp/l2tp_ppp.c:142:21: 'pppol2tp_session_get_sock' defined but not used [-Wunused-function] Rather than adding another #ifdef here, using a proper IS_ENABLED() check makes the code more readable and avoids those warnings while letting the compiler figure out for itself which code is needed. This adds one pointer for the unused show() callback in struct l2tp_session, but that seems harmless. Fixes: b0e29063dcb3 ("l2tp: remove pppol2tp_session_ioctl()") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 3d46eee5a5f2f22ca04e2139e8c9a16b81d16073 Author: Arnd Bergmann Date: Mon Aug 13 23:26:54 2018 +0200 bnxt_en: avoid string overflow for record->system_name The utsname()->nodename string may be 64 bytes long, and it gets copied without the trailing nul byte into the shorter record->system_name, as gcc now warns: In file included from include/linux/bitmap.h:9, from include/linux/ethtool.h:16, from drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:13: In function 'strncpy', inlined from 'bnxt_fill_coredump_record' at drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2863:2: include/linux/string.h:254:9: error: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] Using strlcpy() at least avoids overflowing the destination buffer and adds proper nul-termination. It may still truncate long names though, which probably can't be solved here. Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.") Signed-off-by: Arnd Bergmann Acked-by: Michael Chan Signed-off-by: David S. Miller commit 9dc502d79778324df7db4e093ffddf5413a1cd5f Author: Arnd Bergmann Date: Mon Aug 13 23:19:22 2018 +0200 net: lan743x: fix building without CONFIG_PTP_1588_CLOCK Building without CONFIG_PTP_1588_CLOCK results in multiple failures, this was obviously not well tested: drivers/net/ethernet/microchip/lan743x_ptp.c: In function 'lan743x_ptp_isr': drivers/net/ethernet/microchip/lan743x_ptp.c:781:28: error: 'struct lan743x_ptp' has no member named 'ptp_clock'; did you mean 'tx_ts_lock'? ptp_schedule_worker(ptp->ptp_clock, 0); ^~~~~~~~~ tx_ts_lock drivers/net/ethernet/microchip/lan743x_ptp.c: In function 'lan743x_ptp_open': drivers/net/ethernet/microchip/lan743x_ptp.c:879:6: error: unused variable 'ret' [-Werror=unused-variable] int ret = -ENODEV; ^~~ At top level: drivers/net/ethernet/microchip/lan743x_ptp.c:63:13: error: 'lan743x_ptp_tx_ts_enqueue_ts' defined but not used [-Werror=unused-function] static void lan743x_ptp_tx_ts_enqueue_ts(struct lan743x_adapter *adapter, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors drivers/net/ethernet/microchip/lan743x_ethtool.c: In function 'lan743x_ethtool_get_ts_info': drivers/net/ethernet/microchip/lan743x_ethtool.c:558:19: error: 'struct lan743x_ptp' has no member named 'ptp_clock'; did you mean 'tx_ts_lock'? Those #ifdef checks are hard to get right, replace them all with IS_ENABLED() checks that leave the same code visible to the compiler but let it optimize out the unused bits based on the configuration. Fixes: 07624df1c9ef ("lan743x: lan743x: Add PTP support") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 3aad924025e2865e80212b9154749303618a1826 Author: Arnd Bergmann Date: Mon Aug 13 23:19:21 2018 +0200 net: lan743x: select CRC16 lan743x now fails to build when CONFIG_CRC16 is disabled: drivers/net/ethernet/microchip/lan743x_main.o: In function crc16' Force it on like all other users do. Fixes: 4d94282afd95 ("lan743x: Add power management support") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 0ea97a2d61df729ccce75b00a2fa37d39a508ab6 Merge: a66b4cd1e716 c7b15a8657da Author: Linus Torvalds Date: Mon Aug 13 20:25:58 2018 -0700 Merge branch 'work.mkdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs icache updates from Al Viro: - NFS mkdir/open_by_handle race fix - analogous solution for FUSE, replacing the one currently in mainline - new primitive to be used when discarding halfway set up inodes on failed object creation; gives sane warranties re icache lookups not returning such doomed by still not freed inodes. A bunch of filesystems switched to that animal. - Miklos' fix for last cycle regression in iget5_locked(); -stable will need a slightly different variant, unfortunately. - misc bits and pieces around things icache-related (in adfs and jfs). * 'work.mkdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: jfs: don't bother with make_bad_inode() in ialloc() adfs: don't put inodes into icache new helper: inode_fake_hash() vfs: don't evict uninitialized inode jfs: switch to discard_new_inode() ext2: make sure that partially set up inodes won't be returned by ext2_iget() udf: switch to discard_new_inode() ufs: switch to discard_new_inode() btrfs: switch to discard_new_inode() new primitive: discard_new_inode() kill d_instantiate_no_diralias() nfs_instantiate(): prevent multiple aliases for directory inode commit 7bb516ca5424e12b42124fab2906b6da9c81ba9c Author: Max Filippov Date: Sun Aug 12 06:01:40 2018 -0700 xtensa: rework noMMU cache attributes initialization Marking default memory region as cached is not always sufficient and is not flexible. Allow specifying cache attributes for the whole memory address space with new config entry MEMMAP_CACHEATTR. Apply it after cache initialization. Signed-off-by: Max Filippov commit fec3259c9f747c039f90e99570540114c8d81a14 Author: Max Filippov Date: Fri Aug 10 22:21:22 2018 -0700 xtensa: increase ranges in ___invalidate_{i,d}cache_all Cache invalidation macros use cache line size to iterate over invalidated cache lines, assuming that all cache ways are invalidated by single instruction, but xtensa ISA recommends to not assume that for future compatibility: In some implementations all ways at index Addry-1..z are invalidated regardless of the specified way, but for future compatibility this behavior should not be assumed. Iterate over all cache ways in ___invalidate_icache_all and ___invalidate_dcache_all. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov commit be75de25251f7cf3e399ca1f584716a95510d24a Author: Max Filippov Date: Fri Aug 10 20:43:48 2018 -0700 xtensa: limit offsets in __loop_cache_{all,page} When building kernel for xtensa cores with big cache lines (e.g. 128 bytes or more) __loop_cache_all and __loop_cache_page may generate assembly instructions with immediate fields that are too big. This results in the following build errors: arch/xtensa/mm/misc.S: Assembler messages: arch/xtensa/mm/misc.S:464: Error: operand 2 of 'diwbi' has invalid value '256' arch/xtensa/mm/misc.S:464: Error: operand 2 of 'diwbi' has invalid value '384' arch/xtensa/kernel/head.S: Assembler messages: arch/xtensa/kernel/head.S:172: Error: operand 2 of 'diu' has invalid value '256' arch/xtensa/kernel/head.S:172: Error: operand 2 of 'diu' has invalid value '384' arch/xtensa/kernel/head.S:176: Error: operand 2 of 'iiu' has invalid value '256' arch/xtensa/kernel/head.S:176: Error: operand 2 of 'iiu' has invalid value '384' arch/xtensa/kernel/head.S:255: Error: operand 2 of 'diwb' has invalid value '256' arch/xtensa/kernel/head.S:255: Error: operand 2 of 'diwb' has invalid value '384' Add parameter max_immed to these macros and use it to limit values of immediate operands. Extract common code of these macros into the new macro __loop_cache_unroll. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov commit a66b4cd1e7163adb327838a3c81faaf6a9330d5a Merge: b16528466786 5f336e722cc9 Author: Linus Torvalds Date: Mon Aug 13 19:58:36 2018 -0700 Merge branch 'work.open3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs open-related updates from Al Viro: - "do we need fput() or put_filp()" rules are gone - it's always fput() now. We keep track of that state where it belongs - in ->f_mode. - int *opened mess killed - in finish_open(), in ->atomic_open() instances and in fs/namei.c code around do_last()/lookup_open()/atomic_open(). - alloc_file() wrappers with saner calling conventions are introduced (alloc_file_clone() and alloc_file_pseudo()); callers converted, with much simplification. - while we are at it, saner calling conventions for path_init() and link_path_walk(), simplifying things inside fs/namei.c (both on open-related paths and elsewhere). * 'work.open3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (40 commits) few more cleanups of link_path_walk() callers allow link_path_walk() to take ERR_PTR() make path_init() unconditionally paired with terminate_walk() document alloc_file() changes make alloc_file() static do_shmat(): grab shp->shm_file earlier, switch to alloc_file_clone() new helper: alloc_file_clone() create_pipe_files(): switch the first allocation to alloc_file_pseudo() anon_inode_getfile(): switch to alloc_file_pseudo() hugetlb_file_setup(): switch to alloc_file_pseudo() ocxlflash_getfile(): switch to alloc_file_pseudo() cxl_getfile(): switch to alloc_file_pseudo() ... and switch shmem_file_setup() to alloc_file_pseudo() __shmem_file_setup(): reorder allocations new wrapper: alloc_file_pseudo() kill FILE_{CREATED,OPENED} switch atomic_open() and lookup_open() to returning 0 in all success cases document ->atomic_open() changes ->atomic_open(): return 0 in all success cases get rid of 'opened' in path_openat() and the helpers downstream ... commit b16528466786a540cb00148acb124e0149d62710 Merge: e5a32b5b21a1 4afec79f652b Author: Linus Torvalds Date: Mon Aug 13 19:53:26 2018 -0700 Merge tag 'hwmon-for-linus-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: - new driver for NPCM7xx PWM and Fan controller - new driver for Mellanox FAN controller - add support for MAX34451 to max34440 driver - add support for new Threadripper variants to k10temp driver - add error handling to adt7475 driver - cleanup nct6775 and nct7904 drivers - document sensor enable ABI attributes * tag 'hwmon-for-linus-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (adt7475) Change show functions to return error data correctly hwmon: (adt7475) Change update functions to add error handling hwmon: (adt7475) Change valid parameter to bool type hwmon: (adt7475) Split device update function to measure and limits hwmon: k10temp: Support Threadripper 2920X, 2970WX; simplify offset table hwmon: (k10temp) 27C Offset needed for Threadripper2 hwmon: (iio_hwmon) Use devm functions hwmon: Add NPCM7xx PWM and Fan driver dt-binding: hwmon: Add NPCM7xx PWM and Fan controller documentation hwmon: (pmbus/max34440) Add support for MAX34451. hwmon: Document the sensor enable attribute hwmon: (mlxreg-fan) Add support for Mellanox FAN driver hwmon: Mark expected switch fall-throughs hwmon: (nct6775) Fix comment in the description of pwm_mode hwmon: (nct7904) Fix UNSPECIFIED_INT warning hwmon: (nct7904) Fix CODE_INDENT error hwmon: (nct7904) Fix SPACING errors commit e8ae5e92beeec01e8badfecbc9adfd6f94ec87c8 Merge: 19997ba7cb74 008369dcc5f7 Author: David S. Miller Date: Mon Aug 13 19:37:42 2018 -0700 Merge branch 'net_sched-Fix-two-tc_index-filter-init-issues' Hangbin Liu says: ==================== net_sched: Fix two tc_index filter init issues These two patches fix two tc_index filter init issues. The first one fixes missing exts info in new filter, which will cause NULL pointer dereference when delete tcindex filter. The second one fixes missing res info when create new filter, which will make filter unbind failed. ==================== Signed-off-by: David S. Miller commit 008369dcc5f7bfba526c98054f8525322acf0ea3 Author: Hangbin Liu Date: Mon Aug 13 18:44:04 2018 +0800 net_sched: Fix missing res info when create new tc_index filter Li Shuang reported the following warn: [ 733.484610] WARNING: CPU: 6 PID: 21123 at net/sched/sch_cbq.c:1418 cbq_destroy_class+0x5d/0x70 [sch_cbq] [ 733.495190] Modules linked in: sch_cbq cls_tcindex sch_dsmark rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace fscache xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat l [ 733.574155] syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm igb ixgbe ahci libahci i2c_algo_bit libata i40e i2c_core dca mdio megaraid_sas dm_mirror dm_region_hash dm_log dm_mod [ 733.592500] CPU: 6 PID: 21123 Comm: tc Not tainted 4.18.0-rc8.latest+ #131 [ 733.600169] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.1.5 04/11/2016 [ 733.608518] RIP: 0010:cbq_destroy_class+0x5d/0x70 [sch_cbq] [ 733.614734] Code: e7 d9 d2 48 8b 7b 48 e8 61 05 da d2 48 8d bb f8 00 00 00 e8 75 ae d5 d2 48 39 eb 74 0a 48 89 df 5b 5d e9 16 6c 94 d2 5b 5d c3 <0f> 0b eb b6 0f 1f 44 00 00 66 2e 0f 1f 84 [ 733.635798] RSP: 0018:ffffbfbb066bb9d8 EFLAGS: 00010202 [ 733.641627] RAX: 0000000000000001 RBX: ffff9cdd17392800 RCX: 000000008010000f [ 733.649588] RDX: ffff9cdd1df547e0 RSI: ffff9cdd17392800 RDI: ffff9cdd0f84c800 [ 733.657547] RBP: ffff9cdd0f84c800 R08: 0000000000000001 R09: 0000000000000000 [ 733.665508] R10: ffff9cdd0f84d000 R11: 0000000000000001 R12: 0000000000000001 [ 733.673469] R13: 0000000000000000 R14: 0000000000000001 R15: ffff9cdd17392200 [ 733.681430] FS: 00007f911890a740(0000) GS:ffff9cdd1f8c0000(0000) knlGS:0000000000000000 [ 733.690456] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 733.696864] CR2: 0000000000b5544c CR3: 0000000859374002 CR4: 00000000001606e0 [ 733.704826] Call Trace: [ 733.707554] cbq_destroy+0xa1/0xd0 [sch_cbq] [ 733.712318] qdisc_destroy+0x62/0x130 [ 733.716401] dsmark_destroy+0x2a/0x70 [sch_dsmark] [ 733.721745] qdisc_destroy+0x62/0x130 [ 733.725829] qdisc_graft+0x3ba/0x470 [ 733.729817] tc_get_qdisc+0x2a6/0x2c0 [ 733.733901] ? cred_has_capability+0x7d/0x130 [ 733.738761] rtnetlink_rcv_msg+0x263/0x2d0 [ 733.743330] ? rtnl_calcit.isra.30+0x110/0x110 [ 733.748287] netlink_rcv_skb+0x4d/0x130 [ 733.752576] netlink_unicast+0x1a3/0x250 [ 733.756949] netlink_sendmsg+0x2ae/0x3a0 [ 733.761324] sock_sendmsg+0x36/0x40 [ 733.765213] ___sys_sendmsg+0x26f/0x2d0 [ 733.769493] ? handle_pte_fault+0x586/0xdf0 [ 733.774158] ? __handle_mm_fault+0x389/0x500 [ 733.778919] ? __sys_sendmsg+0x5e/0xa0 [ 733.783099] __sys_sendmsg+0x5e/0xa0 [ 733.787087] do_syscall_64+0x5b/0x180 [ 733.791171] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 733.796805] RIP: 0033:0x7f9117f23f10 [ 733.800791] Code: c3 48 8b 05 82 6f 2c 00 f7 db 64 89 18 48 83 cb ff eb dd 0f 1f 80 00 00 00 00 83 3d 8d d0 2c 00 00 75 10 b8 2e 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 [ 733.821873] RSP: 002b:00007ffe96818398 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 733.830319] RAX: ffffffffffffffda RBX: 000000005b71244c RCX: 00007f9117f23f10 [ 733.838280] RDX: 0000000000000000 RSI: 00007ffe968183e0 RDI: 0000000000000003 [ 733.846241] RBP: 00007ffe968183e0 R08: 000000000000ffff R09: 0000000000000003 [ 733.854202] R10: 00007ffe96817e20 R11: 0000000000000246 R12: 0000000000000000 [ 733.862161] R13: 0000000000662ee0 R14: 0000000000000000 R15: 0000000000000000 [ 733.870121] ---[ end trace 28edd4aad712ddca ]--- This is because we didn't update f->result.res when create new filter. Then in tcindex_delete() -> tcf_unbind_filter(), we will failed to find out the res and unbind filter, which will trigger the WARN_ON() in cbq_destroy_class(). Fix it by updating f->result.res when create new filter. Fixes: 6e0565697a106 ("net_sched: fix another crash in cls_tcindex") Reported-by: Li Shuang Signed-off-by: Hangbin Liu Acked-by: Cong Wang Signed-off-by: David S. Miller commit 2df8bee5654bb2b7312662ca6810d4dc16b0b67f Author: Hangbin Liu Date: Mon Aug 13 18:44:03 2018 +0800 net_sched: fix NULL pointer dereference when delete tcindex filter Li Shuang reported the following crash: [ 71.267724] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 [ 71.276456] PGD 800000085d9bd067 P4D 800000085d9bd067 PUD 859a0b067 PMD 0 [ 71.284127] Oops: 0000 [#1] SMP PTI [ 71.288015] CPU: 12 PID: 2386 Comm: tc Not tainted 4.18.0-rc8.latest+ #131 [ 71.295686] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.1.5 04/11/2016 [ 71.304037] RIP: 0010:tcindex_delete+0x72/0x280 [cls_tcindex] [ 71.310446] Code: 00 31 f6 48 87 75 20 48 85 f6 74 11 48 8b 47 18 48 8b 40 08 48 8b 40 50 e8 fb a6 f8 fc 48 85 db 0f 84 dc 00 00 00 48 8b 73 18 <8b> 56 04 48 8d 7e 04 85 d2 0f 84 7b 01 00 [ 71.331517] RSP: 0018:ffffb45207b3f898 EFLAGS: 00010282 [ 71.337345] RAX: ffff8ad3d72d6360 RBX: ffff8acc84393680 RCX: 000000000000002e [ 71.345306] RDX: ffff8ad3d72c8570 RSI: 0000000000000000 RDI: ffff8ad847a45800 [ 71.353277] RBP: ffff8acc84393688 R08: ffff8ad3d72c8400 R09: 0000000000000000 [ 71.361238] R10: ffff8ad3de786e00 R11: 0000000000000000 R12: ffffb45207b3f8c7 [ 71.369199] R13: ffff8ad3d93bd2a0 R14: 000000000000002e R15: ffff8ad3d72c9600 [ 71.377161] FS: 00007f9d3ec3e740(0000) GS:ffff8ad3df980000(0000) knlGS:0000000000000000 [ 71.386188] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 71.392597] CR2: 0000000000000004 CR3: 0000000852f06003 CR4: 00000000001606e0 [ 71.400558] Call Trace: [ 71.403299] tcindex_destroy_element+0x25/0x40 [cls_tcindex] [ 71.409611] tcindex_walk+0xbb/0x110 [cls_tcindex] [ 71.414953] tcindex_destroy+0x44/0x90 [cls_tcindex] [ 71.420492] ? tcindex_delete+0x280/0x280 [cls_tcindex] [ 71.426323] tcf_proto_destroy+0x16/0x40 [ 71.430696] tcf_chain_flush+0x51/0x70 [ 71.434876] tcf_block_put_ext.part.30+0x8f/0x1b0 [ 71.440122] tcf_block_put+0x4d/0x70 [ 71.444108] cbq_destroy+0x4d/0xd0 [sch_cbq] [ 71.448869] qdisc_destroy+0x62/0x130 [ 71.452951] dsmark_destroy+0x2a/0x70 [sch_dsmark] [ 71.458300] qdisc_destroy+0x62/0x130 [ 71.462373] qdisc_graft+0x3ba/0x470 [ 71.466359] tc_get_qdisc+0x2a6/0x2c0 [ 71.470443] ? cred_has_capability+0x7d/0x130 [ 71.475307] rtnetlink_rcv_msg+0x263/0x2d0 [ 71.479875] ? rtnl_calcit.isra.30+0x110/0x110 [ 71.484832] netlink_rcv_skb+0x4d/0x130 [ 71.489109] netlink_unicast+0x1a3/0x250 [ 71.493482] netlink_sendmsg+0x2ae/0x3a0 [ 71.497859] sock_sendmsg+0x36/0x40 [ 71.501748] ___sys_sendmsg+0x26f/0x2d0 [ 71.506029] ? handle_pte_fault+0x586/0xdf0 [ 71.510694] ? __handle_mm_fault+0x389/0x500 [ 71.515457] ? __sys_sendmsg+0x5e/0xa0 [ 71.519636] __sys_sendmsg+0x5e/0xa0 [ 71.523626] do_syscall_64+0x5b/0x180 [ 71.527711] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 71.533345] RIP: 0033:0x7f9d3e257f10 [ 71.537331] Code: c3 48 8b 05 82 6f 2c 00 f7 db 64 89 18 48 83 cb ff eb dd 0f 1f 80 00 00 00 00 83 3d 8d d0 2c 00 00 75 10 b8 2e 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 [ 71.558401] RSP: 002b:00007fff6f893398 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 71.566848] RAX: ffffffffffffffda RBX: 000000005b71274d RCX: 00007f9d3e257f10 [ 71.574810] RDX: 0000000000000000 RSI: 00007fff6f8933e0 RDI: 0000000000000003 [ 71.582770] RBP: 00007fff6f8933e0 R08: 000000000000ffff R09: 0000000000000003 [ 71.590729] R10: 00007fff6f892e20 R11: 0000000000000246 R12: 0000000000000000 [ 71.598689] R13: 0000000000662ee0 R14: 0000000000000000 R15: 0000000000000000 [ 71.606651] Modules linked in: sch_cbq cls_tcindex sch_dsmark xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_coni [ 71.685425] libahci i2c_algo_bit i2c_core i40e libata dca mdio megaraid_sas dm_mirror dm_region_hash dm_log dm_mod [ 71.697075] CR2: 0000000000000004 [ 71.700792] ---[ end trace f604eb1acacd978b ]--- Reproducer: tc qdisc add dev lo handle 1:0 root dsmark indices 64 set_tc_index tc filter add dev lo parent 1:0 protocol ip prio 1 tcindex mask 0xfc shift 2 tc qdisc add dev lo parent 1:0 handle 2:0 cbq bandwidth 10Mbit cell 8 avpkt 1000 mpu 64 tc class add dev lo parent 2:0 classid 2:1 cbq bandwidth 10Mbit rate 1500Kbit avpkt 1000 prio 1 bounded isolated allot 1514 weight 1 maxburst 10 tc filter add dev lo parent 2:0 protocol ip prio 1 handle 0x2e tcindex classid 2:1 pass_on tc qdisc add dev lo parent 2:1 pfifo limit 5 tc qdisc del dev lo root This is because in tcindex_set_parms, when there is no old_r, we set new exts to cr.exts. And we didn't set it to filter when r == &new_filter_result. Then in tcindex_delete() -> tcf_exts_get_net(), we will get NULL pointer dereference as we didn't init exts. Fix it by moving tcf_exts_change() after "if (old_r && old_r != r)" check. Then we don't need "cr" as there is no errout after that. Fixes: bf63ac73b3e13 ("net_sched: fix an oops in tcindex filter") Reported-by: Li Shuang Signed-off-by: Hangbin Liu Acked-by: Cong Wang Signed-off-by: David S. Miller commit 19997ba7cb7473a4061f42bdfe7e7928a020e714 Author: Jakub Kicinski Date: Mon Aug 13 18:31:05 2018 -0700 nfp: clean up return types in kdoc comments Remove 'Return:' information from functions which no longer return a value. Also update name and return types of nfp_nffw_info access functions. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit e5a32b5b21a18d24e9d735891550c194b4c60bd2 Merge: 2280a5360e4f 22f20a110321 Author: Linus Torvalds Date: Mon Aug 13 19:24:32 2018 -0700 Merge tag 'mips_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Paul Burton: "Here are the main MIPS changes for 4.19. An overview of the general architecture changes: - Massive DMA ops refactoring from Christoph Hellwig (huzzah for deleting crufty code!). - We introduce NT_MIPS_DSP & NT_MIPS_FP_MODE ELF notes & corresponding regsets to expose DSP ASE & floating point mode state respectively, both for live debugging & core dumps. - We better optimize our code by hard-coding cpu_has_* macros at compile time where their values are known due to the ISA revision that the kernel build is targeting. - The EJTAG exception handler now better handles SMP systems, where it was previously possible for CPUs to clobber a register value saved by another CPU. - Our implementation of memset() gained a couple of fixes for MIPSr6 systems to return correct values in some cases where stores fault. - We now implement ioremap_wc() using the uncached-accelerated cache coherency attribute where supported, which is detected during boot, and fall back to plain uncached access where necessary. The MIPS-specific (and unused in tree) ioremap_uncached_accelerated() & ioremap_cacheable_cow() are removed. - The prctl(PR_SET_FP_MODE, ...) syscall is better supported for SMP systems by reworking the way we ensure remote CPUs that may be running threads within the affected process switch mode. - Systems using the MIPS Coherence Manager will now set the MIPS_IC_SNOOPS_REMOTE flag to avoid some unnecessary cache maintenance overhead when flushing the icache. - A few fixes were made for building with clang/LLVM, which now sucessfully builds kernels for many of our platforms. - Miscellaneous cleanups all over. And some platform-specific changes: - ar7 gained stubs for a few clock API functions to fix build failures for some drivers. - ath79 gained support for a few new SoCs, a few fixes & better gpio-keys support. - Ci20 now exposes its SPI bus using the spi-gpio driver. - The generic platform can now auto-detect a suitable value for PHYS_OFFSET based upon the memory map described by the device tree, allowing us to avoid wasting memory on page book-keeping for systems where RAM starts at a non-zero physical address. - Ingenic systems using the jz4740 platform code now link their vmlinuz higher to allow for kernels of a realistic size. - Loongson32 now builds the kernel targeting MIPSr1 rather than MIPSr2 to avoid CPU errata. - Loongson64 gains a couple of fixes, a workaround for a write buffering issue & support for the Loongson 3A R3.1 CPU. - Malta now uses the piix4-poweroff driver to handle powering down. - Microsemi Ocelot gained support for its SPI bus & NOR flash, its second MDIO bus and can now be supported by a FIT/.itb image. - Octeon saw a bunch of header cleanups which remove a lot of duplicate or unused code" * tag 'mips_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (123 commits) MIPS: Remove remnants of UASM_ISA MIPS: netlogic: xlr: Remove erroneous check in nlm_fmn_send() MIPS: VDSO: Force link endianness MIPS: Always specify -EB or -EL when using clang MIPS: Use dins to simplify __write_64bit_c0_split() MIPS: Use read-write output operand in __write_64bit_c0_split() MIPS: Avoid using array as parameter to write_c0_kpgd() MIPS: vdso: Allow clang's --target flag in VDSO cflags MIPS: genvdso: Remove GOT checks MIPS: Remove obsolete MIPS checks for DST node "chosen@0" MIPS: generic: Remove input symbols from defconfig MIPS: Delete unused code in linux32.c MIPS: Remove unused sys_32_mmap2 MIPS: Remove nabi_no_regargs mips: dts: mscc: enable spi and NOR flash support on ocelot PCB123 mips: dts: mscc: Add spi on Ocelot MIPS: Loongson: Merge load addresses MIPS: Loongson: Set Loongson32 to MIPS32R1 MIPS: mscc: ocelot: add interrupt controller properties to GPIO controller MIPS: generic: Select MIPS_AUTO_PFN_OFFSET ... commit 2280a5360e4ff9320bfb12f760a8e9916ff5e7bc Merge: c2d9f5bc2db4 c8921d72e390 Author: Linus Torvalds Date: Mon Aug 13 19:18:02 2018 -0700 Merge branch 'parisc-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc updates from Helge Deller: - parisc now uses the generic dma_noncoherent_ops implementation (Christoph Hellwig) - further memory barrier and spinlock improvements (John David Anglin) - prepare removal of current_text_addr() functions (Nick Desaulniers) - improve kernel stack unwinding on parisc (me) - drop ENOTSUP which was defined on parisc only (me) * 'parisc-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix and improve kernel stack unwinding parisc: Remove unnecessary barriers from spinlock.h parisc: Remove ordered stores from syscall.S parisc: prefer _THIS_IP_ and _RET_IP_ statement expressions parisc: Add HAVE_REGS_AND_STACK_ACCESS_API feature parisc: Drop architecture-specific ENOTSUP define parisc: use generic dma_noncoherent_ops parisc: always use flush_kernel_dcache_range for DMA cache maintainance parisc: merge pcx_dma_ops and pcxl_dma_ops commit c2d9f5bc2db49bcc2e055340941b1873b74dfb5d Merge: 9b27efe08180 53ccb22b8d4a Author: Linus Torvalds Date: Mon Aug 13 19:15:48 2018 -0700 Merge branch 'clkdev' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM clkdev updates from Russell King: "A couple of cleanups for clkdev" * 'clkdev' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8778/1: clkdev: don't call __of_clk_get_by_name() unnecessarily from clk_get() ARM: 8776/1: clkdev: Remove duplicated negative index check from __of_clk_get() commit 9b27efe08180444e66c0922f89f3f883f4f9e35e Merge: 85a0b791bc17 c61b466d4f88 Author: Linus Torvalds Date: Mon Aug 13 19:13:38 2018 -0700 Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: - further Spectre variant 1 fixes for user accessors. - kbuild cleanups (Masahiro Yamada) - hook up sync core functionality (Will Deacon) - nommu updates for hypervisor mode booting (Vladimir Murzin) - use compiler built-ins for fls and ffs (Nicolas Pitre) * 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: spectre-v1: mitigate user accesses ARM: spectre-v1: use get_user() for __get_user() ARM: use __inttype() in get_user() ARM: oabi-compat: copy semops using __copy_from_user() ARM: vfp: use __copy_from_user() when restoring VFP state ARM: 8785/1: use compiler built-ins for ffs and fls ARM: 8784/1: NOMMU: Allow enter in Hyp mode ARM: 8783/1: NOMMU: Extend check for VBAR support ARM: 8782/1: vfp: clean up arch/arm/vfp/Makefile ARM: signal: copy registers using __copy_from_user() ARM: tcm: ensure inline stub functions are marked static ARM: 8779/1: add endianness option to LDFLAGS instead of LD ARM: 8777/1: Hook up SYNC_CORE functionality for sys_membarrier() commit 85a0b791bc17f7a49280b33e2905d109c062a47b Merge: 13e091b6dd0e 669f3765b755 Author: Linus Torvalds Date: Mon Aug 13 19:07:17 2018 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Heiko Carstens: "Since Martin is on vacation you get the s390 pull request from me: - Host large page support for KVM guests. As the patches have large impact on arch/s390/mm/ this series goes out via both the KVM and the s390 tree. - Add an option for no compression to the "Kernel compression mode" menu, this will come in handy with the rework of the early boot code. - A large rework of the early boot code that will make life easier for KASAN and KASLR. With the rework the bootable uncompressed image is not generated anymore, only the bzImage is available. For debuggung purposes the new "no compression" option is used. - Re-enable the gcc plugins as the issue with the latent entropy plugin is solved with the early boot code rework. - More spectre relates changes: + Detect the etoken facility and remove expolines automatically. + Add expolines to a few more indirect branches. - A rewrite of the common I/O layer trace points to make them consumable by 'perf stat'. - Add support for format-3 PCI function measurement blocks. - Changes for the zcrypt driver: + Add attributes to indicate the load of cards and queues. + Restructure some code for the upcoming AP device support in KVM. - Build flags improvements in various Makefiles. - A few fixes for the kdump support. - A couple of patches for gcc 8 compile warning cleanup. - Cleanup s390 specific proc handlers. - Add s390 support to the restartable sequence self tests. - Some PTR_RET vs PTR_ERR_OR_ZERO cleanup. - Lots of bug fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (107 commits) s390/dasd: fix hanging offline processing due to canceled worker s390/dasd: fix panic for failed online processing s390/mm: fix addressing exception after suspend/resume rseq/selftests: add s390 support s390: fix br_r1_trampoline for machines without exrl s390/lib: use expoline for all bcr instructions s390/numa: move initial setup of node_to_cpumask_map s390/kdump: Fix elfcorehdr size calculation s390/cpum_sf: save TOD clock base in SDBs for time conversion KVM: s390: Add huge page enablement control s390/mm: Add huge page gmap linking support s390/mm: hugetlb pages within a gmap can not be freed KVM: s390: Add skey emulation fault handling s390/mm: Add huge pmd storage key handling s390/mm: Clear skeys for newly mapped huge guest pmds s390/mm: Clear huge page storage keys on enable_skey s390/mm: Add huge page dirty sync support s390/mm: Add gmap pmd invalidation and clearing s390/mm: Add gmap pmd notification bit setting s390/mm: Add gmap pmd linking ... commit 486edfb1039dc413c4806d11accdedc8a4aa573b Author: Jason Gunthorpe Date: Mon Aug 13 20:04:37 2018 -0600 IB/ucm: Fix compiling ucm.c Even though this interface is marked CONFIG_BROKEN we still expect it to compile, at least until we delete it completely. Also mark INFINIBAND_USER_ACCESS_UCM with COMPILE_TEST so these situations can be detected. Fixes: e7ff98aefc9e ("RDMA/cma: Constify path record, ib_cm_event, listen_id pointers") Signed-off-by: Jason Gunthorpe commit 13e091b6dd0e78a518a7d8756607d3acb8215768 Merge: eac341194426 1088c6eef261 Author: Linus Torvalds Date: Mon Aug 13 18:28:19 2018 -0700 Merge branch 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 timer updates from Thomas Gleixner: "Early TSC based time stamping to allow better boot time analysis. This comes with a general cleanup of the TSC calibration code which grew warts and duct taping over the years and removes 250 lines of code. Initiated and mostly implemented by Pavel with help from various folks" * 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (37 commits) x86/kvmclock: Mark kvm_get_preset_lpj() as __init x86/tsc: Consolidate init code sched/clock: Disable interrupts when calling generic_sched_clock_init() timekeeping: Prevent false warning when persistent clock is not available sched/clock: Close a hole in sched_clock_init() x86/tsc: Make use of tsc_calibrate_cpu_early() x86/tsc: Split native_calibrate_cpu() into early and late parts sched/clock: Use static key for sched_clock_running sched/clock: Enable sched clock early sched/clock: Move sched clock initialization and merge with generic clock x86/tsc: Use TSC as sched clock early x86/tsc: Initialize cyc2ns when tsc frequency is determined x86/tsc: Calibrate tsc only once ARM/time: Remove read_boot_clock64() s390/time: Remove read_boot_clock64() timekeeping: Default boot time offset to local_clock() timekeeping: Replace read_boot_clock64() with read_persistent_wall_and_boot_offset() s390/time: Add read_persistent_wall_and_boot_offset() x86/xen/time: Output xen sched_clock time from 0 x86/xen/time: Initialize pv xen time in init_hypervisor_platform() ... commit eac341194426ba7ead3444923b9eba491ae4feeb Merge: d191c82d4d9b d878efce73fe Author: Linus Torvalds Date: Mon Aug 13 17:54:17 2018 -0700 Merge branch 'x86/pti' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 PTI updates from Thomas Gleixner: "The Speck brigade sadly provides yet another large set of patches destroying the perfomance which we carefully built and preserved - PTI support for 32bit PAE. The missing counter part to the 64bit PTI code implemented by Joerg. - A set of fixes for the Global Bit mechanics for non PCID CPUs which were setting the Global Bit too widely and therefore possibly exposing interesting memory needlessly. - Protection against userspace-userspace SpectreRSB - Support for the upcoming Enhanced IBRS mode, which is preferred over IBRS. Unfortunately we dont know the performance impact of this, but it's expected to be less horrible than the IBRS hammering. - Cleanups and simplifications" * 'x86/pti' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (60 commits) x86/mm/pti: Move user W+X check into pti_finalize() x86/relocs: Add __end_rodata_aligned to S_REL x86/mm/pti: Clone kernel-image on PTE level for 32 bit x86/mm/pti: Don't clear permissions in pti_clone_pmd() x86/mm/pti: Fix 32 bit PCID check x86/mm/init: Remove freed kernel image areas from alias mapping x86/mm/init: Add helper for freeing kernel image pages x86/mm/init: Pass unconverted symbol addresses to free_init_pages() mm: Allow non-direct-map arguments to free_reserved_area() x86/mm/pti: Clear Global bit more aggressively x86/speculation: Support Enhanced IBRS on future CPUs x86/speculation: Protect against userspace-userspace spectreRSB x86/kexec: Allocate 8k PGDs for PTI Revert "perf/core: Make sure the ring-buffer is mapped in all page-tables" x86/mm: Remove in_nmi() warning from vmalloc_fault() x86/entry/32: Check for VM86 mode in slow-path check perf/core: Make sure the ring-buffer is mapped in all page-tables x86/pti: Check the return value of pti_user_pagetable_walk_pmd() x86/pti: Check the return value of pti_user_pagetable_walk_p4d() x86/entry/32: Add debug code to check entry/exit CR3 ... commit d191c82d4d9bd0bb3b945fc458cc65053ef868a0 Merge: 4d5ac4b8ca1e 379d98ddf413 Author: Linus Torvalds Date: Mon Aug 13 17:50:17 2018 -0700 Merge branch 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 vdso update from Thomas Gleixner: "Use LD to link the VDSO libs instead of indirecting trough CC which causes build failures with Clang" * 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: vdso: Use $LD instead of $CC to link commit 6d43743e9079ac0531b60cde7eadd0f042873344 Author: Ravi Bangoria Date: Thu Aug 9 09:48:52 2018 +0530 Uprobe: Additional argument arch_uprobe to uprobe_write_opcode() Add addition argument 'arch_uprobe' to uprobe_write_opcode(). We need this in later set of patches. Link: http://lkml.kernel.org/r/20180809041856.1547-3-ravi.bangoria@linux.ibm.com Reviewed-by: Song Liu Acked-by: Srikar Dronamraju Signed-off-by: Ravi Bangoria Signed-off-by: Steven Rostedt (VMware) commit 38e967ae1e6022557e579f673fba544cf19cf1c6 Author: Ravi Bangoria Date: Thu Aug 9 09:48:51 2018 +0530 Uprobes: Simplify uprobe_register() body Simplify uprobe_register() function body and let __uprobe_register() handle everything. Also move dependency functions around to avoid build failures. Link: http://lkml.kernel.org/r/20180809041856.1547-2-ravi.bangoria@linux.ibm.com Reviewed-by: Song Liu Acked-by: Srikar Dronamraju Signed-off-by: Ravi Bangoria Signed-off-by: Steven Rostedt (VMware) commit 1880861226c13ddd42c34ddd30c3b502b650fe29 Author: Masahiro Yamada Date: Tue Aug 14 01:48:39 2018 +0900 kconfig: remove P_ENV property type This property is not set by anyone since commit 104daea149c4 ("kconfig: reference environment variables directly and remove 'option env='"). Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 4d5ac4b8ca1ecbdb600097a26071abc5b47500bf Merge: 203b4fc903b6 5800dc5c19f3 Author: Linus Torvalds Date: Mon Aug 13 17:01:03 2018 -0700 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 fixes from Thomas Gleixner: "Two fixes for x86: - Provide a declaration for native_save_fl() which unbreaks the wreckage caused by making it 'extern inline'. - Fix the failing paravirt patching which is supposed to replace indirect with direct calls. The wreckage is caused by an incorrect clobber test" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/paravirt: Fix spectre-v2 mitigations for paravirt guests x86/irqflags: Provide a declaration for native_save_fl commit c151272d1687ce2a379a93bf848080f9a42f1cef Author: Masahiro Yamada Date: Tue Aug 14 01:48:38 2018 +0900 kconfig: remove unused sym_get_env_prop() function This function is unused since commit 104daea149c4 ("kconfig: reference environment variables directly and remove 'option env='"). Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 512ddf7d7db056edfed3159ea7cb4e4a5eefddd4 Author: Denis Efremov Date: Fri Aug 10 23:25:55 2018 +0300 coccicheck: return proper error code on fail If coccicheck fails, it should return an error code distinct from zero to signal about an internal problem. Current code instead of exiting with the tool's error code returns the error code of 'echo "coccicheck failed"' which is almost always equals to zero, thus failing the original intention of alerting about a problem. This patch fixes the code. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Denis Efremov Acked-by: Julia Lawall Signed-off-by: Masahiro Yamada commit 09d4d9648bd01a4c124fcc30dd0c31503975e8c2 Author: Julia Lawall Date: Fri Aug 3 18:32:11 2018 +0200 Coccinelle: doubletest: reduce side effect false positives Ensure that the cited expression is not a function call or an assignment to reduce the chance of false positives. Slightly modify the warning message to indicate another source of false positves. Signed-off-by: Julia Lawall Signed-off-by: Masahiro Yamada commit 203b4fc903b644223a27ad3f25f3a0f3a3911d1d Merge: 7edcf0d314f6 765d28f13629 Author: Linus Torvalds Date: Mon Aug 13 16:29:35 2018 -0700 Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm updates from Thomas Gleixner: - Make lazy TLB mode even lazier to avoid pointless switch_mm() operations, which reduces CPU load by 1-2% for memcache workloads - Small cleanups and improvements all over the place * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Remove redundant check for kmem_cache_create() arm/asm/tlb.h: Fix build error implicit func declaration x86/mm/tlb: Make clear_asid_other() static x86/mm/tlb: Skip atomic operations for 'init_mm' in switch_mm_irqs_off() x86/mm/tlb: Always use lazy TLB mode x86/mm/tlb: Only send page table free TLB flush to lazy TLB CPUs x86/mm/tlb: Make lazy TLB mode lazier x86/mm/tlb: Restructure switch_mm_irqs_off() x86/mm/tlb: Leave lazy TLB mode at page table free time mm: Allocate the mm_cpumask (mm->cpu_bitmap[]) dynamically based on nr_cpu_ids x86/mm: Add TLB purge to free pmd/pte page interfaces ioremap: Update pgtable free interfaces with addr x86/mm: Disable ioremap free page handling on x86-PAE commit 7edcf0d314f69e506ddd9562062b2a79fa965bb9 Merge: 30de24c7dd21 d79d024820f2 Author: Linus Torvalds Date: Mon Aug 13 16:08:26 2018 -0700 Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 platform updates from Thomas Gleixner: "Trivial cleanups and improvements" * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/platform/UV: Remove redundant check of p == q x86/platform/olpc: Use PTR_ERR_OR_ZERO() x86/platform/UV: Mark memblock related init code and data correctly commit c371e7b438ca2e3e463b43d09cada1cc1254864f Merge: 42c625a486f3 cf916ffbe0c6 Author: David S. Miller Date: Mon Aug 13 16:04:18 2018 -0700 Merge tag 'mlx5e-updates-2018-08-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5e-updates-2018-08-10 This series provides the following updates to mlx5e netdevice driver. 1) First 4 patches extends the support for ethtool rxnfc flow steering - Added ipv6 support - l4 proto ip field for both ip6 and ip4 2) Next 4 patches, reorganizing flow steering structures and declaration into one header file, and add two Kconfig flags to allow disabling/enabling mlx5 netdevice rx flow steering at compile time: CONFIG_MLX5_EN_ARFS for en_arfs.c CONFIG_MLX5_EN_RXNFC for en_fs_ehtool.c 3) More kconfig flags dependencies - vxlan.c depends on CONFIG_VXLAN - clock.c depends on CONFIG_PTP_1588_CLOCK 4) Reorganize the Makefile ==================== Signed-off-by: David S. Miller commit 30de24c7dd21348b142ee977b687afc70b392af6 Merge: f4990264565c 4a7a54a55e72 Author: Linus Torvalds Date: Mon Aug 13 16:01:46 2018 -0700 Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cache QoS (RDT/CAR) updates from Thomas Gleixner: "Add support for pseudo-locked cache regions. Cache Allocation Technology (CAT) allows on certain CPUs to isolate a region of cache and 'lock' it. Cache pseudo-locking builds on the fact that a CPU can still read and write data pre-allocated outside its current allocated area on cache hit. With cache pseudo-locking data can be preloaded into a reserved portion of cache that no application can fill, and from that point on will only serve cache hits. The cache pseudo-locked memory is made accessible to user space where an application can map it into its virtual address space and thus have a region of memory with reduced average read latency. The locking is not perfect and gets totally screwed by WBINDV and similar mechanisms, but it provides a reasonable enhancement for certain types of latency sensitive applications. The implementation extends the current CAT mechanism and provides a generally useful exclusive CAT mode on which it builds the extra pseude-locked regions" * 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (45 commits) x86/intel_rdt: Disable PMU access x86/intel_rdt: Fix possible circular lock dependency x86/intel_rdt: Make CPU information accessible for pseudo-locked regions x86/intel_rdt: Support restoration of subset of permissions x86/intel_rdt: Fix cleanup of plr structure on error x86/intel_rdt: Move pseudo_lock_region_clear() x86/intel_rdt: Limit C-states dynamically when pseudo-locking active x86/intel_rdt: Support L3 cache performance event of Broadwell x86/intel_rdt: More precise L2 hit/miss measurements x86/intel_rdt: Create character device exposing pseudo-locked region x86/intel_rdt: Create debugfs files for pseudo-locking testing x86/intel_rdt: Create resctrl debug area x86/intel_rdt: Ensure RDT cleanup on exit x86/intel_rdt: Resctrl files reflect pseudo-locked information x86/intel_rdt: Support creation/removal of pseudo-locked region x86/intel_rdt: Pseudo-lock region creation/removal core x86/intel_rdt: Discover supported platforms via prefetch disable bits x86/intel_rdt: Add utilities to test pseudo-locked region possibility x86/intel_rdt: Split resource group removal in two x86/intel_rdt: Enable entering of pseudo-locksetup mode ... commit f4990264565c2ccb8f193d22aad3b429eceee1ef Merge: 27a52501970a be0e16ce7c3b Author: Linus Torvalds Date: Mon Aug 13 15:49:04 2018 -0700 Merge branch 'x86-hyperv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86/hyper-v update from Thomas Gleixner: "Add fast hypercall support for guest running on the Microsoft HyperV(isor)" * 'x86-hyperv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/hyper-v: Fix wrong merge conflict resolution x86/hyper-v: Check for VP_INVAL in hyperv_flush_tlb_others() x86/hyper-v: Check cpumask_to_vpset() return value in hyperv_flush_tlb_others_ex() x86/hyper-v: Trace PV IPI send x86/hyper-v: Use cheaper HVCALL_SEND_IPI hypercall when possible x86/hyper-v: Use 'fast' hypercall for HVCALL_SEND_IPI x86/hyper-v: Implement hv_do_fast_hypercall16 x86/hyper-v: Use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} hypercalls when possible commit dddc0557e3a02499ce336b1e2e67f5afaecccc80 Author: Nicholas Kazlauskas Date: Fri Aug 3 10:40:20 2018 -0400 drm/amd/display: Guard against null crtc in CRC IRQ [Why] A null pointer deference can occur if crtc is null in amdgpu_dm_crtc_handle_crc_irq. This can happen if get_crtc_by_otg_inst returns NULL during dm_crtc_high_irq, leading to a hang in some IGT test cases. [How] Check that CRTC is non-null before accessing its fields. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Sun peng Li Acked-by: Leo Li Signed-off-by: Alex Deucher commit 433149130c31de3f63b17b4ce08b45dab208f7e8 Author: Mikita Lipski Date: Tue Jul 17 10:52:19 2018 -0400 drm/amd/display: Pass connector id when executing VBIOS CT [why] Older ASICs require both phys_id and connector_id to execute bios command table. If we are not passing the right connector_id - it can lead to a black screen. [how] Set connector_obj_id when executing vbios command table Signed-off-by: Mikita Lipski Reviewed-by: Hersen Wu Acked-by: Leo Li Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit ad8960a6cb06c446d0a391ce095f6f28edf36aff Author: Mikita Lipski Date: Thu Aug 2 09:45:09 2018 -0400 drm/amd/display: Check if clock source in use before disabling [why] We are disabling clock source while other pipes are still using it, because we don't verify the number of pipes that share it. [how] - Adding a function in resources to return the number of pipes sharing the clock source. - Checking that no one is sharing the clock source before disabling Signed-off-by: Mikita Lipski Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit fc69009e35b74e45ad71140e94355e999b8d24af Author: Mikita Lipski Date: Mon Jul 16 09:17:55 2018 -0400 drm/amd/display: Allow clock sharing b/w HDMI and DVI [why] HDMI and DVI share the same PHY clock and single link DVI and HDMI both use 4 lanes, so they should be allowed to be sharing the same clock source if all other parameters are satisfied. [how] Change a check for general DVI to Dual DVI. Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher commit 7cb5285507172fabe87f87ef3d2cfe148e8a918d Author: Jerry (Fangzhi) Zuo Date: Tue Jul 31 15:15:38 2018 -0400 drm/amd/display: Fix warning observed in mode change on Vega [Why] DOUBLE_BUFFER_EN bit is getting cleared before enable blanking. That leads to CRTC_BLANK_DATA_EN is getting updated immediately. [How] Get DOUBLE_BUFFER_EN bit set, the same as DCE110. Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Charlene Liu Acked-by: Leo Li Signed-off-by: Alex Deucher commit 321f65a62359e1490c7d9910b8557174ce779df4 Author: Charlene Liu Date: Mon Jul 30 17:59:20 2018 -0400 drm/amd/display: fix single link DVI has no display Signed-off-by: Charlene Liu Reviewed-by: Dmytro Laktyushkin Acked-by: Leo Li Signed-off-by: Alex Deucher commit 20acbed47d30efbf14e5aecc5ec5e5f152db7810 Author: Emily Deng Date: Mon Aug 13 14:46:06 2018 +0800 drm/amdgpu/vce: VCE entity initialization relies on ring initializtion Entity init should after ring init, as the entity's sched_rq's initialization is in ring init. SWDEV-161495 Signed-off-by: Emily Deng Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 27a52501970a493a068657281dff8bcaacb6f6fb Merge: 7796916146b8 8e974b3b8edd Author: Linus Torvalds Date: Mon Aug 13 15:21:12 2018 -0700 Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 dump printing cleanup from Thomas Gleixner: "Clean up the show_opcodes() printout so nested dumps can be properly differentiated" * 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Avoid pr_cont() in show_opcodes() commit 33d5bd0705440c158c909da7538f05fc7a0ebcdf Author: Emily Deng Date: Mon Aug 13 14:45:34 2018 +0800 drm/amdgpu/uvd: UVD entity initialization relys on ring initialization Entity init should after ring init, as the entity's sched_rq's initialization is in ring init. SWDEV-161495 Signed-off-by: Emily Deng Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 4d77c0f676e910fb1f1870738aa4bd168f253621 Author: Likun Gao Date: Fri Aug 10 00:31:42 2018 +0800 drm/amdgpu:add VCN booting with firmware loaded by PSP Setup psp firmware loading for VCN, and make VCN block booting from tmr mac address. Signed-off-by: James Zhu Reviewed-by: Alex Deucher Acked-by: Huang Rui Reviewed-by: Likun Gao Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 235ac9de625a0a586093ad81b3de6f7d7ab913ed Author: Likun Gao Date: Fri Aug 10 00:31:41 2018 +0800 drm/amdgpu:add VCN support in PSP driver Add VCN support in PSP driver Signed-off-by: James Zhu Reviewed-by: Alex Deucher Acked-by: Huang Rui Reviewed-by: Likun Gao Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit c9ca989696ff28ffb015cc2b7c5577938ef2626c Author: Likun Gao Date: Fri Aug 10 00:31:40 2018 +0800 drm/amdgpu:add new firmware id for VCN Add the new firmware id for VCN into the enum Signed-off-by: James Zhu Reviewed-by: Alex Deucher Acked-by: Huang Rui Reviewed-by: Likun Gao Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 435198f33b56d7b875a8173a0227ddf0de285aa1 Author: James Zhu Date: Fri Aug 10 00:31:39 2018 +0800 drm/amdgpu: update tmr mc address Update tmr mc address with firmware loading address which is returned from PSP firmware Signed-off-by: James Zhu Reviewed-by: Alex Deucher Acked-by: Huang Rui Reviewed-by: Likun Gao Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit abf412b3efb2f943d9b98a489e9aca836be21333 Author: James Zhu Date: Fri Aug 10 00:31:38 2018 +0800 drm/amdgpu:add tmr mc address into amdgpu_firmware_info amdgpu IP blocks booting need Trust Memory Region(tmr) mc address of its firmware which is loaded by PSP Signed-off-by: James Zhu Reviewed-by: Alex Deucher Acked-by: Huang Rui Reviewed-by: Likun Gao Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 7796916146b8c34cbbef66470ab8b5b28cf47e83 Merge: 36f49ca8ca6d 301d328a6f8b Author: Linus Torvalds Date: Mon Aug 13 14:41:53 2018 -0700 Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cpu updates from Thomas Gleixner: "Two small updates for the CPU code: - Improve NUMA emulation - Add the EPT_AD CPU feature bit" * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpufeatures: Add EPT_AD feature bit x86/numa_emulation: Introduce uniform split capability x86/numa_emulation: Fix emulated-to-physical node mapping commit 62421cd943014a84b095cefb31d2261c51eb3d4b Author: Trond Myklebust Date: Sat Aug 11 11:52:39 2018 -0400 NFSv4: Fix a typo in nfs4_init_channel_attrs() The back channel size is allowed to be 1 or greater. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 8aafd2fde3784f962c87aa6ff9c88e4def307036 Author: Trond Myklebust Date: Sat Aug 11 11:52:38 2018 -0400 NFSv4: Don't busy wait if NFSv4 session draining is interrupted Catch the ERESTARTSYS error so that it can be processed by the callers. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 36f49ca8ca6d786936f48b874d30fded5b2b7bd9 Merge: 00b24d545549 0b2c1aec49dd Author: Linus Torvalds Date: Mon Aug 13 14:13:53 2018 -0700 Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Thomas Gleixner: "Trival cleanups" * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/iommu: Use NULL instead of 0 x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to fix ptr_ret.cocci warning commit 00b24d545549b5e4a49ff00f017391c3b62a2f05 Merge: f24d6f2654d3 bdc9c3e5ed95 Author: Linus Torvalds Date: Mon Aug 13 14:12:24 2018 -0700 Merge branch 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 build cleanup from Thomas Gleixner: "Remove a stale quirk for a no longer supported GCC version" * 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/build: Remove old -funit-at-a-time GCC quirk commit e4648aa4f98a87cf0a83f73a5864cede073053a0 Author: Olga Kornievskaia Date: Mon Aug 13 15:33:01 2018 -0400 NFS recover from destination server reboot for copies Mark the destination state to indicate a server-side copy is happening. On detecting a reboot and recovering open state check if any state is engaged in a server-side copy, if so, find the copy and mark it and then signal the waiting thread. Upon wakeup, if copy was marked then propage EAGAIN to the nfsd_copy_file_range and restart the copy from scratch. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit d8dfa59f5a512a536b80a4a8f12fa993683f48df Author: Kees Cook Date: Thu Jun 28 17:04:21 2018 -0700 bus: imx-weim: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this switches to using a maximum size and adds a sanity check. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Kees Cook Reviewed-by: Arnd Bergmann Acked-by: Shawn Guo commit 699112f5e831c088ff6aeea594d23ebecf6bd806 Author: Kees Cook Date: Tue Jun 19 21:38:31 2018 -0700 drm/i2c: tda9950: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this sets the buffer to maximum size and adds a sanity check. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Cc: David Airlie Cc: Hans Verkuil Cc: Russell King Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook commit f24d6f2654d39355cdf8285e21409ed8d56d4284 Merge: b9b8e5b76386 6709812f094d Author: Linus Torvalds Date: Mon Aug 13 13:35:26 2018 -0700 Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 asm updates from Thomas Gleixner: "The lowlevel and ASM code updates for x86: - Make stack trace unwinding more reliable - ASM instruction updates for better code generation - Various cleanups" * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/entry/64: Add two more instruction suffixes x86/asm/64: Use 32-bit XOR to zero registers x86/build/vdso: Simplify 'cmd_vdso2c' x86/build/vdso: Remove unused vdso-syms.lds x86/stacktrace: Enable HAVE_RELIABLE_STACKTRACE for the ORC unwinder x86/unwind/orc: Detect the end of the stack x86/stacktrace: Do not fail for ORC with regs on stack x86/stacktrace: Clarify the reliable success paths x86/stacktrace: Remove STACKTRACE_DUMP_ONCE x86/stacktrace: Do not unwind after user regs x86/asm: Use CC_SET/CC_OUT in percpu_cmpxchg8b_double() to micro-optimize code generation commit b9b8e5b76386da8d0795fa143bb012f1bf993733 Merge: 66e22087bdf6 216a37202f10 Author: Linus Torvalds Date: Mon Aug 13 13:32:42 2018 -0700 Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 boot updates from Thomas Gleixner: "Boot code updates for x86: - Allow to skip a given amount of huge pages for address layout randomization on the kernel command line to prevent regressions in the huge page allocation with small memory sizes - Various cleanups" * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Use CC_SET()/CC_OUT() instead of open coding it x86/boot/KASLR: Make local variable mem_limit static x86/boot/KASLR: Skip specified number of 1GB huge pages when doing physical randomization (KASLR) x86/boot/KASLR: Add two new functions for 1GB huge pages handling commit 66e22087bdf65c6bdea0a2994fbf7e16995f19f0 Merge: 1e45e9a95ec2 843c40890501 Author: Linus Torvalds Date: Mon Aug 13 13:31:08 2018 -0700 Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 apic update from Thomas Gleixner: "Trivial cleanups of the APIC related code" * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic: Trivial coding style fixes x86/vector: Merge allocate_vector() into assign_vector_locked() commit 1e45e9a95ec277272f73439629b6e3fe1f047e92 Merge: 8603596a327c fbfa9260085b Author: Linus Torvalds Date: Mon Aug 13 13:02:31 2018 -0700 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "The timers departement more or less proudly presents: - More Y2038 timekeeping work mostly in the core code. The work is slowly, but steadily targeting the actuall syscalls. - Enhanced timekeeping suspend/resume support by utilizing clocksources which do not stop during suspend, but are otherwise not the main timekeeping clocksources. - Make NTP adjustmets more accurate and immediate when the frequency is set directly and not incrementally. - Sanitize the overrung handing of posix timers - A new timer driver for Mediatek SoCs - The usual pile of fixes and updates all over the place" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (32 commits) clockevents: Warn if cpu_all_mask is used as cpumask tick/broadcast-hrtimer: Use cpu_possible_mask for ce_broadcast_hrtimer clocksource/drivers/arm_arch_timer: Fix bogus cpu_all_mask usage clocksource: ti-32k: Remove CLOCK_SOURCE_SUSPEND_NONSTOP flag timers: Clear timer_base::must_forward_clk with timer_base::lock held clocksource/drivers/sprd: Register one always-on timer to compensate suspend time clocksource/drivers/timer-mediatek: Add support for system timer clocksource/drivers/timer-mediatek: Convert the driver to timer-of clocksource/drivers/timer-mediatek: Use specific prefix for GPT clocksource/drivers/timer-mediatek: Rename mtk_timer to timer-mediatek clocksource/drivers/timer-mediatek: Add system timer bindings clocksource/drivers: Set clockevent device cpumask to cpu_possible_mask time: Introduce one suspend clocksource to compensate the suspend time time: Fix extra sleeptime injection when suspend fails timekeeping/ntp: Constify some function arguments ntp: Use kstrtos64 for s64 variable ntp: Remove redundant arguments timer: Fix coding style ktime: Provide typesafe ktime_to_ns() hrtimer: Improve kernel message printing ... commit 8603596a327c978534f5c45db135e6c36b4b1425 Merge: de5d1b39ea0b ec2cb7a526d4 Author: Linus Torvalds Date: Mon Aug 13 12:55:49 2018 -0700 Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf update from Thomas Gleixner: "The perf crowd presents: Kernel updates: - Removal of jprobes - Cleanup and consolidatation the handling of kprobes - Cleanup and consolidation of hardware breakpoints - The usual pile of fixes and updates to PMUs and event descriptors Tooling updates: - Updates and improvements all over the place. Nothing outstanding, just the (good) boring incremental grump work" * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (103 commits) perf trace: Do not require --no-syscalls to suppress strace like output perf bpf: Include uapi/linux/bpf.h from the 'perf trace' script's bpf.h perf tools: Allow overriding MAX_NR_CPUS at compile time perf bpf: Show better message when failing to load an object perf list: Unify metric group description format with PMU event description perf vendor events arm64: Update ThunderX2 implementation defined pmu core events perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet perf cs-etm: Fix start tracing packet handling perf build: Fix installation directory for eBPF perf c2c report: Fix crash for empty browser perf tests: Fix indexing when invoking subtests perf trace: Beautify the AF_INET & AF_INET6 'socket' syscall 'protocol' args perf trace beauty: Add beautifiers for 'socket''s 'protocol' arg perf trace beauty: Do not print NULL strarray entries perf beauty: Add a generator for IPPROTO_ socket's protocol constants tools include uapi: Grab a copy of linux/in.h perf tests: Fix complex event name parsing perf evlist: Fix error out while applying initial delay and LBR ... commit cf916ffbe0c628bb072ea829f300cff1874162ce Author: Eli Cohen Date: Sun Apr 29 09:17:34 2018 -0500 net/mlx5: Improve argument name for add flow API The last argument to mlx5_add_flow_rules passes the number of destinations in the struct pointed to by the dest arg. Change the name to better reflect this fact. Signed-off-by: Eli Cohen Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit a8274b854b5e7c78187d7b9eaf701e1f6e1ccfcb Author: Saeed Mahameed Date: Tue Jul 31 14:44:00 2018 -0700 net/mlx5: Reorganize the makefile Reorganize the Makefile and group files together according to their functionality and importance. Signed-off-by: Saeed Mahameed commit 6dbc80ca41f5a76e0d2ae4e96b2476d68a2ea17f Author: Moshe Shemesh Date: Sun Jul 29 13:29:45 2018 +0300 net/mlx5e: clock.c depends on CONFIG_PTP_1588_CLOCK lib/clock.c includes clock related functions which require ptp support. Thus compile out lib/clock.c and add the needed function stubs in case kconfig CONFIG_PTP_1588_CLOCK is off. Signed-off-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit c5791ab0abecb5e4a41673b83e3660f731b0717b Author: Saeed Mahameed Date: Fri Jul 13 10:58:49 2018 -0700 net/mlx5e: vxlan.c depends on CONFIG_VXLAN When vxlan is not enabled by kernel, no need to enable it in mlx5. Compile out lib/vxlan.c if CONFIG_VXLAN is not selected. Signed-off-by: Saeed Mahameed Reviewed-by: Moshe Shemesh Reviewed-by: Eran Ben Elisha commit 44f68ae0cad6afbd72d3de1c7b0e149c1655b626 Author: Saeed Mahameed Date: Thu Jul 12 03:09:19 2018 -0700 net/mlx5e: Move flow steering declarations into en/fs.h Move flow steering declarations and definitions into the dedicated en/fs.h header file Signed-off-by: Saeed Mahameed Reviewed-by: Moshe Shemesh commit ec080045977073c5e69a7fddee3a8aef9bf62881 Author: Saeed Mahameed Date: Thu Jul 12 03:01:26 2018 -0700 net/mlx5e: Add CONFIG_MLX5_EN_ARFS for accelerated flow steering support Add new mlx5 Kconfig flag to allow selecting accelerated flow steering support, and compile out en_arfs.c if not selected. Move arfs declarations and definitions to en/fs.h header file. Signed-off-by: Saeed Mahameed Reviewed-by: Moshe Shemesh commit fe6d86b3c3165e6c55d6b0049a13d3b65371163a Author: Saeed Mahameed Date: Wed Jul 11 12:02:42 2018 -0700 net/mlx5e: Add CONFIG_MLX5_EN_RXNFC for ethtool rx nfc Add new mlx5 Kconfig flag to allow selecting ethtool rx nfc support, and compile out en_fs_ehtool.c if not selected. Add en/fs.h header file to host all steering declarations and definitions. Signed-off-by: Saeed Mahameed Reviewed-by: Moshe Shemesh commit cff2b1e3e83286e569466663b35bf0ae23afcbcf Author: Saeed Mahameed Date: Tue Jul 10 17:04:49 2018 -0700 net/mlx5e: Ethtool steering, move ethtool callbacks Move ethool rxnfc callback into en_fs_etthool file where they belong. This will allow us to make many ethtool fs related helper functions static. Signed-off-by: Saeed Mahameed commit 974ce34a0c1278957448d83f53ddfc7a565171ec Author: Saeed Mahameed Date: Sun Jul 8 00:24:21 2018 -0700 net/mlx5e: Ethtool steering, l4 proto support Add support for l4 proto ip field in ethtool flow steering. Example: Redirect icmpv6 to rx queue #2 ethtool -U eth0 flow-type ip6 l4proto 58 action 2 Signed-off-by: Saeed Mahameed commit ca7deb028a2c7c38e6f743443376dd52ea526f0d Author: Saeed Mahameed Date: Thu Jul 5 17:11:09 2018 -0700 net/mlx5e: Ethtool steering, ip6 support Add ip6 support for ethtool flow steering. New supported flow types: ip6|tcp6|udp6| Supported fields: src-ip|dst-ip|src-port|dst-port Signed-off-by: Saeed Mahameed commit 7695e73f3db4576ef3ce05063c28e9a673425763 Author: Bjorn Helgaas Date: Mon Aug 13 14:30:41 2018 -0500 PCI: Add function 1 DMA alias quirk for Marvell 88SS9183 Add function 1 DMA alias quirk for Marvell 88SS9183 PCIe SSD Controller. Link: https://bugzilla.kernel.org/show_bug.cgi?id=42679#c134 Reported-and-tested-by: Felix Blüthner Signed-off-by: Bjorn Helgaas commit bc9e9cf0401f18e33b78d4c8a518661b8346baf7 Author: Mikulas Patocka Date: Fri Aug 10 11:23:56 2018 -0400 dm crypt: don't decrease device limits dm-crypt should only increase device limits, it should not decrease them. This fixes a bug where the user could creates a crypt device with 1024 sector size on the top of scsi device that had 4096 logical block size. The limit 4096 would be lost and the user could incorrectly send 1024-I/Os to the crypt device. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit de5d1b39ea0b38a9f4dfb08966042b7b91e2df30 Merge: 1c594774283a fd2efaa4eb53 Author: Linus Torvalds Date: Mon Aug 13 12:23:39 2018 -0700 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking/atomics update from Thomas Gleixner: "The locking, atomics and memory model brains delivered: - A larger update to the atomics code which reworks the ordering barriers, consolidates the atomic primitives, provides the new atomic64_fetch_add_unless() primitive and cleans up the include hell. - Simplify cmpxchg() instrumentation and add instrumentation for xchg() and cmpxchg_double(). - Updates to the memory model and documentation" * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (48 commits) locking/atomics: Rework ordering barriers locking/atomics: Instrument cmpxchg_double*() locking/atomics: Instrument xchg() locking/atomics: Simplify cmpxchg() instrumentation locking/atomics/x86: Reduce arch_cmpxchg64*() instrumentation tools/memory-model: Rename litmus tests to comply to norm7 tools/memory-model/Documentation: Fix typo, smb->smp sched/Documentation: Update wake_up() & co. memory-barrier guarantees locking/spinlock, sched/core: Clarify requirements for smp_mb__after_spinlock() sched/core: Use smp_mb() in wake_woken_function() tools/memory-model: Add informal LKMM documentation to MAINTAINERS locking/atomics/Documentation: Describe atomic_set() as a write operation tools/memory-model: Make scripts executable tools/memory-model: Remove ACCESS_ONCE() from model tools/memory-model: Remove ACCESS_ONCE() from recipes locking/memory-barriers.txt/kokr: Update Korean translation to fix broken DMA vs. MMIO ordering example MAINTAINERS: Add Daniel Lustig as an LKMM reviewer tools/memory-model: Fix ISA2+pooncelock+pooncelock+pombonce name tools/memory-model: Add litmus test for full multicopy atomicity locking/refcount: Always allow checked forms ... commit 1c594774283a7cfe6dc0f8ffdfb2dbfc497502c4 Merge: f7951c33f0fe d018031f562b Author: Linus Torvalds Date: Mon Aug 13 12:21:46 2018 -0700 Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull CPU hotplug update from Thomas Gleixner: "A trivial name fix for the hotplug state machine" * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu/hotplug: Clarify CPU hotplug step name for timers commit 142644f8a1f8b419005d8b3c641e80b32ce2a5f7 Author: Saeed Mahameed Date: Thu Jul 5 17:31:14 2018 -0700 net/mlx5e: Ethtool steering flow parsing refactoring Have a parsing function per flow type, that converts from ethtool rx flow spec to mlx5 flow spec. Will be useful to add support for ip6 ethtool flow steering in the next patch. Signed-off-by: Saeed Mahameed commit b29c61dac3a258575c438c7ae1fc4c20260d823c Author: Saeed Mahameed Date: Thu Jul 5 17:30:34 2018 -0700 net/mlx5e: Ethtool steering flow validation refactoring Have a ethtool rx flow spec validation helper function per flow type. Signed-off-by: Saeed Mahameed commit 491278b698774d3b0d8974acfc994cc482e95485 Author: Suman Anna Date: Mon Jul 23 18:27:57 2018 -0500 remoteproc/davinci: Mark error recovery as disabled The Davinci remoteproc driver does not support error recovery at present, so mark the corresponding remoteproc flag appropriately so that the debugfs flag shows the value as 'disabled' by default. Signed-off-by: Suman Anna Signed-off-by: Bjorn Andersson commit a2eed33dcdb7663170b01f05dd8d0a3323ffe4b3 Author: Gustavo A. R. Silva Date: Tue Jul 3 14:23:05 2018 -0500 ide: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 777a82f87a9af591c3b02e9983d6cd3109022ea9 Author: Colin Ian King Date: Mon Jul 2 11:00:26 2018 +0100 ide-tape: remove redundant variable buffer_size Variable buffer_size is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'buffer_size' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit bb1215a2d011db15e9a8d5d2469c0ad9651d7660 Author: Colin Ian King Date: Mon Jul 2 10:47:05 2018 +0100 ide: remove redundant variables queue_run_ms and left Variable queue_run_ms is not being used and is redundant and hence can be removed. Removing this also means that variable left can also be removed. Cleans up clang warning: warning: variable ‘queue_run_ms’ set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 51d8aac236493833acf60d9c3b6c42437a18da36 Author: Alexander Kapshuk Date: Sat Aug 11 11:39:15 2018 +0300 perf tools: Fix check-headers.sh AND list path of execution The '||' path of execution in the 'test' block of the check_2() function may also be taken if file2 does not exist, in which case the warning message about the ABI headers being different would still be printed where it should not be. See below. % file1=file1; file2=file2 % cmd="echo diff $file1 $file2" % test -f $file2 && \ eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file1' differs from latest version at '$file2'" >&2 Warning: Kernel ABI header at 'tools/file1' differs from latest version at 'file2' The proposed patch converts the code following the '&&' operator into a compound list to be executed in the current process environment only if file2 does exist. Should the files being compared differ, a diff command to compare the files concerned is printed on standard output. E.g. $ diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S Committer testing: Remove a line from that tools/arch/x86/lib/memcpy_64.S file to test this: BUILD: Doing 'make -j4' parallel build Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S' diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o Signed-off-by: Alexander Kapshuk Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180811083915.17471-1-alexander.kapshuk@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 42c625a486f367ad57d4257de6d9459daf9484a0 Author: Vlad Buslov Date: Mon Aug 13 20:20:11 2018 +0300 net: sched: act_ife: disable bh when taking ife_mod_lock Lockdep reports deadlock for following locking scenario in ife action: Task one: 1) Executes ife action update. 2) Takes tcfa_lock. 3) Waits on ife_mod_lock which is already taken by task two. Task two: 1) Executes any path that obtains ife_mod_lock without disabling bh (any path that takes ife_mod_lock while holding tcfa_lock has bh disabled) like loading a meta module, or creating new action. 2) Takes ife_mod_lock. 3) Task is preempted by rate estimator timer. 4) Timer callback waits on tcfa_lock which is taken by task one. In described case tasks deadlock because they take same two locks in different order. To prevent potential deadlock reported by lockdep, always disable bh when obtaining ife_mod_lock. Lockdep warning: [ 508.101192] ===================================================== [ 508.107708] WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected [ 508.114728] 4.18.0-rc8+ #646 Not tainted [ 508.119050] ----------------------------------------------------- [ 508.125559] tc/5460 [HC0[0]:SC0[2]:HE1:SE0] is trying to acquire: [ 508.132025] 000000005a938c68 (ife_mod_lock){++++}, at: find_ife_oplist+0x1e/0xc0 [act_ife] [ 508.140996] and this task is already holding: [ 508.147548] 00000000d46f6c56 (&(&p->tcfa_lock)->rlock){+.-.}, at: tcf_ife_init+0x6ae/0xf40 [act_ife] [ 508.157371] which would create a new lock dependency: [ 508.162828] (&(&p->tcfa_lock)->rlock){+.-.} -> (ife_mod_lock){++++} [ 508.169572] but this new dependency connects a SOFTIRQ-irq-safe lock: [ 508.178197] (&(&p->tcfa_lock)->rlock){+.-.} [ 508.178201] ... which became SOFTIRQ-irq-safe at: [ 508.189771] _raw_spin_lock+0x2c/0x40 [ 508.193906] est_fetch_counters+0x41/0xb0 [ 508.198391] est_timer+0x83/0x3c0 [ 508.202180] call_timer_fn+0x16a/0x5d0 [ 508.206400] run_timer_softirq+0x399/0x920 [ 508.210967] __do_softirq+0x157/0x97d [ 508.215102] irq_exit+0x152/0x1c0 [ 508.218888] smp_apic_timer_interrupt+0xc0/0x4e0 [ 508.223976] apic_timer_interrupt+0xf/0x20 [ 508.228540] cpuidle_enter_state+0xf8/0x5d0 [ 508.233198] do_idle+0x28a/0x350 [ 508.236881] cpu_startup_entry+0xc7/0xe0 [ 508.241296] start_secondary+0x2e8/0x3f0 [ 508.245678] secondary_startup_64+0xa5/0xb0 [ 508.250347] to a SOFTIRQ-irq-unsafe lock: (ife_mod_lock){++++} [ 508.256531] ... which became SOFTIRQ-irq-unsafe at: [ 508.267279] ... [ 508.267283] _raw_write_lock+0x2c/0x40 [ 508.273653] register_ife_op+0x118/0x2c0 [act_ife] [ 508.278926] do_one_initcall+0xf7/0x4d9 [ 508.283214] do_init_module+0x18b/0x44e [ 508.287521] load_module+0x4167/0x5730 [ 508.291739] __do_sys_finit_module+0x16d/0x1a0 [ 508.296654] do_syscall_64+0x7a/0x3f0 [ 508.300788] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 508.306302] other info that might help us debug this: [ 508.315286] Possible interrupt unsafe locking scenario: [ 508.322771] CPU0 CPU1 [ 508.327681] ---- ---- [ 508.332604] lock(ife_mod_lock); [ 508.336300] local_irq_disable(); [ 508.342608] lock(&(&p->tcfa_lock)->rlock); [ 508.349793] lock(ife_mod_lock); [ 508.355990] [ 508.358974] lock(&(&p->tcfa_lock)->rlock); [ 508.363803] *** DEADLOCK *** [ 508.370715] 2 locks held by tc/5460: [ 508.374680] #0: 00000000e27e4fa4 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x583/0x7b0 [ 508.383366] #1: 00000000d46f6c56 (&(&p->tcfa_lock)->rlock){+.-.}, at: tcf_ife_init+0x6ae/0xf40 [act_ife] [ 508.393648] the dependencies between SOFTIRQ-irq-safe lock and the holding lock: [ 508.403505] -> (&(&p->tcfa_lock)->rlock){+.-.} ops: 1001553 { [ 508.409646] HARDIRQ-ON-W at: [ 508.413136] _raw_spin_lock_bh+0x34/0x40 [ 508.419059] gnet_stats_start_copy_compat+0xa2/0x230 [ 508.426021] gnet_stats_start_copy+0x16/0x20 [ 508.432333] tcf_action_copy_stats+0x95/0x1d0 [ 508.438735] tcf_action_dump_1+0xb0/0x4e0 [ 508.444795] tcf_action_dump+0xca/0x200 [ 508.450673] tcf_exts_dump+0xd9/0x320 [ 508.456392] fl_dump+0x1b7/0x4a0 [cls_flower] [ 508.462798] tcf_fill_node+0x380/0x530 [ 508.468601] tfilter_notify+0xdf/0x1c0 [ 508.474404] tc_new_tfilter+0x84a/0xc90 [ 508.480270] rtnetlink_rcv_msg+0x5bd/0x7b0 [ 508.486419] netlink_rcv_skb+0x184/0x220 [ 508.492394] netlink_unicast+0x31b/0x460 [ 508.507411] netlink_sendmsg+0x3fb/0x840 [ 508.513390] sock_sendmsg+0x7b/0xd0 [ 508.518907] ___sys_sendmsg+0x4c6/0x610 [ 508.524797] __sys_sendmsg+0xd7/0x150 [ 508.530510] do_syscall_64+0x7a/0x3f0 [ 508.536201] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 508.543301] IN-SOFTIRQ-W at: [ 508.546834] _raw_spin_lock+0x2c/0x40 [ 508.552522] est_fetch_counters+0x41/0xb0 [ 508.558571] est_timer+0x83/0x3c0 [ 508.563912] call_timer_fn+0x16a/0x5d0 [ 508.569699] run_timer_softirq+0x399/0x920 [ 508.575840] __do_softirq+0x157/0x97d [ 508.581538] irq_exit+0x152/0x1c0 [ 508.586882] smp_apic_timer_interrupt+0xc0/0x4e0 [ 508.593533] apic_timer_interrupt+0xf/0x20 [ 508.599686] cpuidle_enter_state+0xf8/0x5d0 [ 508.605895] do_idle+0x28a/0x350 [ 508.611147] cpu_startup_entry+0xc7/0xe0 [ 508.617097] start_secondary+0x2e8/0x3f0 [ 508.623029] secondary_startup_64+0xa5/0xb0 [ 508.629245] INITIAL USE at: [ 508.632686] _raw_spin_lock_bh+0x34/0x40 [ 508.638557] gnet_stats_start_copy_compat+0xa2/0x230 [ 508.645491] gnet_stats_start_copy+0x16/0x20 [ 508.651719] tcf_action_copy_stats+0x95/0x1d0 [ 508.657992] tcf_action_dump_1+0xb0/0x4e0 [ 508.663937] tcf_action_dump+0xca/0x200 [ 508.669716] tcf_exts_dump+0xd9/0x320 [ 508.675337] fl_dump+0x1b7/0x4a0 [cls_flower] [ 508.681650] tcf_fill_node+0x380/0x530 [ 508.687366] tfilter_notify+0xdf/0x1c0 [ 508.693031] tc_new_tfilter+0x84a/0xc90 [ 508.698820] rtnetlink_rcv_msg+0x5bd/0x7b0 [ 508.704869] netlink_rcv_skb+0x184/0x220 [ 508.710758] netlink_unicast+0x31b/0x460 [ 508.716627] netlink_sendmsg+0x3fb/0x840 [ 508.722510] sock_sendmsg+0x7b/0xd0 [ 508.727931] ___sys_sendmsg+0x4c6/0x610 [ 508.733729] __sys_sendmsg+0xd7/0x150 [ 508.739346] do_syscall_64 +0x7a/0x3f0 [ 508.744943] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 508.751930] } [ 508.753964] ... key at: [] __key.61145+0x0/0x40 [ 508.760946] ... acquired at: [ 508.764294] _raw_read_lock+0x2f/0x40 [ 508.768513] find_ife_oplist+0x1e/0xc0 [act_ife] [ 508.773692] tcf_ife_init+0x82f/0xf40 [act_ife] [ 508.778785] tcf_action_init_1+0x510/0x750 [ 508.783468] tcf_action_init+0x1e8/0x340 [ 508.787938] tcf_action_add+0xc5/0x240 [ 508.792241] tc_ctl_action+0x203/0x2a0 [ 508.796550] rtnetlink_rcv_msg+0x5bd/0x7b0 [ 508.801200] netlink_rcv_skb+0x184/0x220 [ 508.805674] netlink_unicast+0x31b/0x460 [ 508.810129] netlink_sendmsg+0x3fb/0x840 [ 508.814611] sock_sendmsg+0x7b/0xd0 [ 508.818665] ___sys_sendmsg+0x4c6/0x610 [ 508.823029] __sys_sendmsg+0xd7/0x150 [ 508.827246] do_syscall_64+0x7a/0x3f0 [ 508.831483] entry_SYSCALL_64_after_hwframe+0x49/0xbe the dependencies between the lock to be acquired [ 508.838945] and SOFTIRQ-irq-unsafe lock: [ 508.851177] -> (ife_mod_lock){++++} ops: 95 { [ 508.855920] HARDIRQ-ON-W at: [ 508.859478] _raw_write_lock+0x2c/0x40 [ 508.865264] register_ife_op+0x118/0x2c0 [act_ife] [ 508.872071] do_one_initcall+0xf7/0x4d9 [ 508.877947] do_init_module+0x18b/0x44e [ 508.883819] load_module+0x4167/0x5730 [ 508.889595] __do_sys_finit_module+0x16d/0x1a0 [ 508.896043] do_syscall_64+0x7a/0x3f0 [ 508.901734] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 508.908827] HARDIRQ-ON-R at: [ 508.912359] _raw_read_lock+0x2f/0x40 [ 508.918043] find_ife_oplist+0x1e/0xc0 [act_ife] [ 508.924692] tcf_ife_init+0x82f/0xf40 [act_ife] [ 508.931252] tcf_action_init_1+0x510/0x750 [ 508.937393] tcf_action_init+0x1e8/0x340 [ 508.943366] tcf_action_add+0xc5/0x240 [ 508.949130] tc_ctl_action+0x203/0x2a0 [ 508.954922] rtnetlink_rcv_msg+0x5bd/0x7b0 [ 508.961024] netlink_rcv_skb+0x184/0x220 [ 508.966970] netlink_unicast+0x31b/0x460 [ 508.972915] netlink_sendmsg+0x3fb/0x840 [ 508.978859] sock_sendmsg+0x7b/0xd0 [ 508.984400] ___sys_sendmsg+0x4c6/0x610 [ 508.990264] __sys_sendmsg+0xd7/0x150 [ 508.995952] do_syscall_64+0x7a/0x3f0 [ 509.001643] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 509.008722] SOFTIRQ-ON-W at:\ [ 509.012242] _raw_write_lock+0x2c/0x40 [ 509.018013] register_ife_op+0x118/0x2c0 [act_ife] [ 509.024841] do_one_initcall+0xf7/0x4d9 [ 509.030720] do_init_module+0x18b/0x44e [ 509.036604] load_module+0x4167/0x5730 [ 509.042397] __do_sys_finit_module+0x16d/0x1a0 [ 509.048865] do_syscall_64+0x7a/0x3f0 [ 509.054551] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 509.061636] SOFTIRQ-ON-R at: [ 509.065145] _raw_read_lock+0x2f/0x40 [ 509.070854] find_ife_oplist+0x1e/0xc0 [act_ife] [ 509.077515] tcf_ife_init+0x82f/0xf40 [act_ife] [ 509.084051] tcf_action_init_1+0x510/0x750 [ 509.090172] tcf_action_init+0x1e8/0x340 [ 509.096124] tcf_action_add+0xc5/0x240 [ 509.101891] tc_ctl_action+0x203/0x2a0 [ 509.107671] rtnetlink_rcv_msg+0x5bd/0x7b0 [ 509.113811] netlink_rcv_skb+0x184/0x220 [ 509.119768] netlink_unicast+0x31b/0x460 [ 509.125716] netlink_sendmsg+0x3fb/0x840 [ 509.131668] sock_sendmsg+0x7b/0xd0 [ 509.137167] ___sys_sendmsg+0x4c6/0x610 [ 509.143010] __sys_sendmsg+0xd7/0x150 [ 509.148718] do_syscall_64+0x7a/0x3f0 [ 509.154443] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 509.161533] INITIAL USE at: [ 509.164956] _raw_read_lock+0x2f/0x40 [ 509.170574] find_ife_oplist+0x1e/0xc0 [act_ife] [ 509.177134] tcf_ife_init+0x82f/0xf40 [act_ife] [ 509.183619] tcf_action_init_1+0x510/0x750 [ 509.189674] tcf_action_init+0x1e8/0x340 [ 509.195534] tcf_action_add+0xc5/0x240 [ 509.201229] tc_ctl_action+0x203/0x2a0 [ 509.206920] rtnetlink_rcv_msg+0x5bd/0x7b0 [ 509.212936] netlink_rcv_skb+0x184/0x220 [ 509.218818] netlink_unicast+0x31b/0x460 [ 509.224699] netlink_sendmsg+0x3fb/0x840 [ 509.230581] sock_sendmsg+0x7b/0xd0 [ 509.235984] ___sys_sendmsg+0x4c6/0x610 [ 509.241791] __sys_sendmsg+0xd7/0x150 [ 509.247425] do_syscall_64+0x7a/0x3f0 [ 509.253007] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 509.259975] } [ 509.261998] ... key at: [] ife_mod_lock+0x18/0xffffffffffff8dc0 [act_ife] [ 509.271569] ... acquired at: [ 509.274912] _raw_read_lock+0x2f/0x40 [ 509.279134] find_ife_oplist+0x1e/0xc0 [act_ife] [ 509.284324] tcf_ife_init+0x82f/0xf40 [act_ife] [ 509.289425] tcf_action_init_1+0x510/0x750 [ 509.294068] tcf_action_init+0x1e8/0x340 [ 509.298553] tcf_action_add+0xc5/0x240 [ 509.302854] tc_ctl_action+0x203/0x2a0 [ 509.307153] rtnetlink_rcv_msg+0x5bd/0x7b0 [ 509.311805] netlink_rcv_skb+0x184/0x220 [ 509.316282] netlink_unicast+0x31b/0x460 [ 509.320769] netlink_sendmsg+0x3fb/0x840 [ 509.325248] sock_sendmsg+0x7b/0xd0 [ 509.329290] ___sys_sendmsg+0x4c6/0x610 [ 509.333687] __sys_sendmsg+0xd7/0x150 [ 509.337902] do_syscall_64+0x7a/0x3f0 [ 509.342116] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 509.349601] stack backtrace: [ 509.354663] CPU: 6 PID: 5460 Comm: tc Not tainted 4.18.0-rc8+ #646 [ 509.361216] Hardware name: Supermicro SYS-2028TP-DECR/X10DRT-P, BIOS 2.0b 03/30/2017 Fixes: ef6980b6becb ("introduce IFE action") Signed-off-by: Vlad Buslov Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 3f4417d693b43fa240ac8bde4487f67745ca23d8 Author: Benno Evers Date: Fri Aug 10 15:36:13 2018 +0200 perf tools: Check for null when copying nsinfo. The argument to nsinfo__copy() was assumed to be valid, but some code paths exist that will lead to NULL being passed. In particular, running 'perf script -D' on a perf.data file containing an PERF_RECORD_MMAP event associating the '[vdso]' dso with pid 0 earlier in the event stream will lead to a segfault. Since all calling code is already checking for a non-null return value, just return NULL for this case as well. Signed-off-by: Benno Evers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Krister Johansen Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180810133614.9925-1-bevers@mesosphere.com Signed-off-by: Arnaldo Carvalho de Melo commit bb2a0812eb784c3361ae4bbf7bd4d30a062bb2d8 Merge: c1617fb4c5ee 330ad75f6a79 Author: David S. Miller Date: Mon Aug 13 11:38:54 2018 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2018-08-13 There was one pretty bad bug that slipped into the MediaTek HCI driver in the last bluetooth-next pull request. Would it be possible to get this one-liner fix pulled to net-next before you make your first 4.19 pull request for Linus? Thanks. ==================== Signed-off-by: David S. Miller commit 0ae98637b611c51737eadd9cc6e041746dbb11ef Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:09 2018 -0400 tools lib traceevent: Rename static variables and functions in event-parse.c In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes static variables and functions in event-parse.c: pevent_func_params, __pevent_parse_format, __pevent_parse_event, pevent_error_str, pevent_search_event Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180703.575392642@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit c99eeaf5497288d4e0fbca7ee0c401fd35860481 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:08 2018 -0400 tools lib traceevent: Rename various pevent APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_reset_function_resolver, pevent_strerror, pevent_list_events, pevent_event_common_fields, pevent_event_fields, pevent_ref, pevent_unref Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180703.426198047@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 1634e4604cccbe6394dd858fb973604d2313336b Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:07 2018 -0400 tools lib traceevent: Rename internal parser related APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_buffer_init, pevent_read_token, pevent_free_token, pevent_peek_char, pevent_get_input_buf, pevent_get_input_buf_ptr Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180703.275281085@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 413af01c8d9d5d688df3244401cbddfe98bafe2a Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:06 2018 -0400 tools lib traceevent: Rename various pevent get/set/is APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_pid_is_registered, pevent_get_cpus, pevent_set_cpus, pevent_is_file_bigendian, pevent_is_host_bigendian, pevent_is_latency_format, pevent_set_latency_format Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180703.114110715@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 610e1e4ff0431b3a86a0ebfcdb47828b8e082329 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:05 2018 -0400 tools lib traceevent: Rename pevent_find_* APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_find_function, pevent_find_function_address, pevent_find_event_by_name, pevent_find_event_by_record Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180702.966965051@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 8b3e08722ec8b288066eab66193736a65645c0a2 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:04 2018 -0400 tools lib traceevent: Rename pevent field APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_free_format, pevent_free_format_field, pevent_get_field_raw, pevent_get_field_val, pevent_get_common_field_val, pevent_get_any_field_val Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180702.821244942@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit dc05ebf373e9e66c27aae0d9059e5d4ac56f3be0 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:03 2018 -0400 tools lib traceevent: Rename pevent_data_ APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_data_lat_fmt, pevent_data_type, pevent_data_event_from_type, pevent_data_pid, pevent_data_preempt_count, pevent_data_flags, pevent_data_comm_from_pid, pevent_data_pid_from_comm, pevent_cmdline_pid Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180702.678020020@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit b843e9c3a271a068b67df74ef24abb7c81f2463c Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:02 2018 -0400 tools lib traceevent: Rename pevent_register / unregister APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_register_print_function, pevent_unregister_print_function, pevent_register_event_handler, pevent_unregister_event_handler, pevent_register_function, pevent_register_trace_clock Signed-off-by: Steven Rostedt Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180702.524813185@goodmis.org Signed-off-by: Tzvetomir Stoyanov (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 64e237906963d0c26d3b25e7751b4d6aaa01f720 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:01 2018 -0400 tools lib traceevent: Rename pevent_filter* APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: PEVENT_FILTER_ERROR_BUFSZ, pevent_filter_alloc, pevent_filter_add_filter_str, pevent_filter_match, pevent_filter_strerror, pevent_event_filtered, pevent_filter_reset, pevent_filter_clear_trivial, pevent_filter_free, pevent_filter_make_string, pevent_filter_remove_event, pevent_filter_event_has_trivial, pevent_filter_copy, pevent_update_trivial, pevent_filter_compare Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180702.370659353@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit ca2921dd90268dc37cd5096eb985da4288aa7041 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:03:00 2018 -0400 tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "traceevent_". This changes APIs: traceevent_plugin_list_options, traceevent_plugin_free_options_list, traceevent_plugin_add_options, traceevent_plugin_remove_options, traceevent_print_plugins Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180702.089951638@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit f7951c33f0fed14ee26651a70a46899a59a31e18 Merge: 2406fb8d94fb 1b6266ebe3da Author: Linus Torvalds Date: Mon Aug 13 11:25:07 2018 -0700 Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Thomas Gleixner: - Cleanup and improvement of NUMA balancing - Refactoring and improvements to the PELT (Per Entity Load Tracking) code - Watchdog simplification and related cleanups - The usual pile of small incremental fixes and improvements * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits) watchdog: Reduce message verbosity stop_machine: Reflow cpu_stop_queue_two_works() sched/numa: Move task_numa_placement() closer to numa_migrate_preferred() sched/numa: Use group_weights to identify if migration degrades locality sched/numa: Update the scan period without holding the numa_group lock sched/numa: Remove numa_has_capacity() sched/numa: Modify migrate_swap() to accept additional parameters sched/numa: Remove unused task_capacity from 'struct numa_stats' sched/numa: Skip nodes that are at 'hoplimit' sched/debug: Reverse the order of printing faults sched/numa: Use task faults only if numa_group is not yet set up sched/numa: Set preferred_node based on best_cpu sched/numa: Simplify load_too_imbalanced() sched/numa: Evaluate move once per node sched/numa: Remove redundant field sched/debug: Show the sum wait time of a task group sched/fair: Remove #ifdefs from scale_rt_capacity() sched/core: Remove get_cpu() from sched_fork() sched/cpufreq: Clarify sugov_get_util() sched/sysctl: Remove unused sched_time_avg_ms sysctl ... commit 3cf477836e24187f2f3acbbf48c80a478d979093 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:59 2018 -0400 tools lib traceevent: Rename pevent_function* APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_function_handler, pevent_func_handler, pevent_func_arg_type, PEVENT_FUNC_ARG_VOID, PEVENT_FUNC_ARG_INT, PEVENT_FUNC_ARG_LONG, PEVENT_FUNC_ARG_STRING, PEVENT_FUNC_ARG_PTRS, PEVENT_FUNC_ARG_MAX_TYPES Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180701.935881193@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit d97f4ef177ddf8b877de2545dbd67d1faf6878f2 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:58 2018 -0400 tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes 'enum pevent_errno' to 'enum tep_errno'. Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180701.770475059@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 6fed932e9242b55a32dd75da7c2448b9b0c48a73 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:57 2018 -0400 tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes pevent_get_page_size API and enum pevent_flag to enum tep_flag Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180701.623942406@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit fc9b69710e0e5833c5d3e56c37cb56cfe89217c3 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:56 2018 -0400 tools lib traceevent, perf tools: Rename traceevent_* APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "traceevent_". This changes APIs: traceevent_host_bigendian, traceevent_load_plugins and traceevent_unload_plugins Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180701.484691639@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit ece2a4f48386acf7e35a751008976c9dda8d6232 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:55 2018 -0400 tools lib traceevent, perf tools: Rename pevent_set_* APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_set_file_bigendian, pevent_set_flag, pevent_set_function_resolver, pevent_set_host_bigendian, pevent_set_long_size, pevent_set_page_size and pevent_get_long_size Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180701.256265951@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 13a418904ee19e7a9892619cc93b025b31d08134 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:54 2018 -0400 tools lib traceevent, perf tools: Rename pevent_register_* APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_register_comm, pevent_register_print_string Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180700.948980691@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 59c1baee25e2b34f8e26a923ea229b3e00cab55a Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:53 2018 -0400 tools lib traceevent, perf tools: Rename pevent_read_number_* APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_read_number, pevent_read_number_field Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180700.804271434@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 6a48dc298ee1a4d87403086002b25c6821a1abc5 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:52 2018 -0400 tools lib traceevent, perf tools: Rename pevent print APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_print_field, pevent_print_fields, pevent_print_funcs, pevent_print_printk Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180700.654453763@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit c60167c187f9255e698998887bfbbba6418861b5 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:51 2018 -0400 tools lib traceevent, perf tools: Rename pevent parse APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_parse_event, pevent_parse_format, pevent_parse_header_page Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180700.469749700@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit af85cd19521fe956eeb2cc8b9e41b9b5bbb8e3ae Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:50 2018 -0400 tools lib traceevent, perf tools: Rename pevent find APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_find_any_field, pevent_find_common_field, pevent_find_event, pevent_find_field Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180700.316995920@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 4d5c58b15c4363219e19380848eb74ca60143187 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:49 2018 -0400 tools lib traceevent, perf tools: Rename pevent alloc / free APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes APIs: pevent_alloc, pevent_free, pevent_event_info and pevent_func_resolver_t Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180700.152609945@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit c32d52b4641d3c7b2569b3fe148bf687e5c61888 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:48 2018 -0400 tools lib traceevent, perf tools: Rename pevent plugin related APIs In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes the pevent plugin related API. Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180700.005287044@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 2406fb8d94fb17fee3ace0c09427c08825eacb16 Merge: 37a16046800c cfd355145c32 Author: Linus Torvalds Date: Mon Aug 13 11:21:34 2018 -0700 Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Thomas Gleixner: "A single bugfix to prevent a pinned thread which queues stomp machine work to be preempted by the stopper thread on its CPU which causes a live lock as it is unable to wake the second CPUs stopper thread" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: stop_machine: Atomically queue and wake stopper threads commit cbc49b25b9cf26bf8c91169085be27382d945dd7 Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:47 2018 -0400 tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes the 'struct pevent_record' to 'struct tep_record'. Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180659.866021298@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 37a16046800c29a8ca1ebe26086e363494062a17 Merge: b99cdfdf0b1c d5c84ef202d7 Author: Linus Torvalds Date: Mon Aug 13 11:19:25 2018 -0700 Merge branch 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 RAS updates from Thomas Gleixner: "A small set of changes to the RAS core: - Rework of the MCE bank scanning code - Y2038 converion" * 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Cleanup __mc_scan_banks() x86/mce: Carve out bank scanning code x86/mce: Remove !banks check x86/mce: Carve out the crashing_cpu check x86/mce: Always use 64-bit timestamps commit b99cdfdf0b1c077dcb24c0053d36d4ff5832224e Merge: d0daaeaf6014 ea73a5c6929b Author: Linus Torvalds Date: Mon Aug 13 10:49:41 2018 -0700 Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RCU updates from Thomas Gleixner: "A large update to RCU: Preparatory work for consolidating the RCU flavors: - Introduce grace-period sequence numbers to the RCU-bh, RCU-preempt, and RCU-sched flavors, replacing the old ->gpnum and ->completed pair of fields. This change allows lockless code to obtain the complete grace-period state with a single READ_ONCE(), which is needed to maintain tolerable lock contention during the upcoming consolidation of the three RCU flavors. Note that grace-period sequence numbers are already used by rcu_barrier(), expedited RCU grace periods, and SRCU, and are thus already heavily used and well-tested. Joel Fernandes contributed a number of excellent fixes and improvements. - Clean up some grace-period-reporting loose ends, including improving the handling of quiescent states from offline CPUs and fixing some false-positive WARN_ON_ONCE() invocations. (Strictly speaking, the WARN_ON_ONCE() invocations were quite correct, but their invariants were (harmlessly) violated by the earlier sloppy handling of quiescent states from offline CPUs.) In addition, improve grace-period forward-progress guarantees so as to allow removal of fail-safe checks that required otherwise needless lock acquisitions. Finally, add more diagnostics to help debug the upcoming consolidation of the RCU-bh, RCU-preempt, and RCU-sched flavors. The rest: - SRCU updates - Updates to rcutorture and associated scripting. - The usual pile of miscellaneous fixes" * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (118 commits) rcutorture: Fix rcu_barrier successes counter rcutorture: Add support to detect if boost kthread prio is too low rcutorture: Use monotonic timestamp for stall detection rcutorture: Make boost test more robust rcutorture: Disable RT throttling for boost tests rcutorture: Emphasize testing of single reader protection type rcutorture: Handle extended read-side critical sections rcutorture: Make rcu_torture_timer() use rcu_torture_one_read() rcutorture: Use per-CPU random state for rcu_torture_timer() rcutorture: Use atomic increment for n_rcu_torture_timers rcutorture: Extract common code from rcu_torture_reader() rcuperf: Remove unused torturing_tasks() function rcu: Remove rcutorture test version and sequence number rcutorture: Change units of onoff_interval to jiffies rcu: Assign higher prio to RCU threads if rcutorture is built-in rculist: Improve documentation for list_for_each_entry_from_rcu() srcu: Add grace-period number to rcutorture statistics printout rcu: Print stall-warning NMI dyntick state in hexadecimal MAINTAINERS: Update RCU, SRCU, and TORTURE-TEST entries rcu: Make rcu_seq_diff() more exact ... commit d494500a70434223bc35f862fab0679b13bea23d Author: Chao Yu Date: Wed Aug 8 17:36:41 2018 +0800 f2fs: support fault_type mount option Previously, once fault injection is on, by default, all kind of faults will be injected to f2fs, if we want to trigger single or specified combined type during the test, we need to configure sysfs entry, it will be a little inconvenient to integrate sysfs configuring into testsuit, such as xfstest. So this patch introduces a new mount option 'fault_type' to assist old option 'fault_injection', with these two mount options, we can specify any fault rate/type at mount-time. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3f16ecd950e56d60a574f73af9538f6e24030f9a Author: Chao Yu Date: Wed Aug 8 17:36:29 2018 +0800 f2fs: fix to return success when trimming meta area generic/251 --- tests/generic/251.out 2016-05-03 20:20:11.381899000 +0800 QA output created by 251 Running the test: done. +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument ... Ran: generic/251 Failures: generic/251 The reason is coverage of fstrim locates in meta area, previously we just return -EINVAL for such case, making generic/251 failed, to fix this problem, let's relieve restriction to return success with no block discarded. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6b9cb1242cb082044c8c3f8b9f35d9ada101dc41 Author: Chao Yu Date: Wed Aug 8 10:14:55 2018 +0800 f2fs: fix use-after-free of dicard command entry As Dan Carpenter reported: The patch 20ee4382322c: "f2fs: issue small discard by LBA order" from Jul 8, 2018, leads to the following Smatch warning: fs/f2fs/segment.c:1277 __issue_discard_cmd_orderly() warn: 'dc' was already freed. See also: fs/f2fs/segment.c:2550 __issue_discard_cmd_range() warn: 'dc' was already freed. In order to fix this issue, let's get error from __submit_discard_cmd(), and release current discard command after we referenced next one. Reported-by: Dan Carpenter Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b83dcfe67142ea9f4bfaa1e9e21504be9e3c1bf7 Author: Chao Yu Date: Mon Aug 6 20:30:18 2018 +0800 f2fs: support discard submission error injection This patch adds to support discard submission error injection for testing error handling of __submit_discard_cmd(). Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 35ec7d5748849762008e8ae9f8ad2766229d5794 Author: Chao Yu Date: Mon Aug 6 22:43:50 2018 +0800 f2fs: split discard command in prior to block layer Some devices has small max_{hw,}discard_sectors, so that in __blkdev_issue_discard(), one big size discard bio can be split into multiple small size discard bios, result in heavy load in IO scheduler and device, which can hang other sync IO for long time. Now, f2fs is trying to control discard commands more elaboratively, in order to make less conflict in between discard IO and user IO to enhance application's performance, so in this patch, we will split discard bio in f2fs in prior to in block layer to reduce issuing multiple discard bios in a short time. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a690efffd16302d23b0bbd00f84dcedc11935a8b Author: Sheng Yong Date: Sun Aug 5 12:45:35 2018 +0800 f2fs: wake up gc thread immediately when gc_urgent is set Fixes: 5b0e95398e2b ("f2fs: introduce sbi->gc_mode to determine the policy") Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6eae269461b84406a1240189e6f81e5234b6393c Author: Chao Yu Date: Sun Aug 5 23:09:00 2018 +0800 f2fs: fix incorrect range->len in f2fs_trim_fs() generic/260 reported below error: [+] Default length with start set (should succeed) [+] Length beyond the end of fs (should succeed) [+] Length beyond the end of fs with start set (should succeed) +./tests/generic/260: line 94: [: 18446744073709551615: integer expression expected +./tests/generic/260: line 104: [: 18446744073709551615: integer expression expected Test done ... In f2fs_trim_fs(), if there is no discard being trimmed, we need to correct range->len before return. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 22969158083c9e5c92f66718dde1a372baa1a49d Author: Chao Yu Date: Sun Aug 5 23:08:59 2018 +0800 f2fs: refresh recent accessed nat entry in lru list Introduce nat_list_lock to protect nm_i->nat_entries list, and manage it as a LRU list, refresh location for therein recent accessed entries in the list. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a33c150237a20d97a174243bc658c86502f9d370 Author: Chao Yu Date: Sun Aug 5 23:04:25 2018 +0800 f2fs: fix avoid race between truncate and background GC Thread A Background GC - f2fs_setattr isize to 0 - truncate_setsize - gc_data_segment - f2fs_get_read_data_page page #0 - set_page_dirty - set_cold_data - f2fs_truncate - f2fs_setattr isize to 4k - read 4k <--- hit data in cached page #0 Above race condition can cause read out invalid data in a truncated page, fix it by i_gc_rwsem[WRITE] lock. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c7079853c859c910b9d047a37891b4aafb8f8dd7 Author: Chao Yu Date: Sun Aug 5 23:02:22 2018 +0800 f2fs: avoid race between zero_range and background GC Thread A Background GC - f2fs_zero_range - truncate_pagecache_range - gc_data_segment - get_read_data_page - move_data_page - set_page_dirty - set_cold_data - f2fs_do_zero_range - dn->data_blkaddr = NEW_ADDR; - f2fs_set_data_blkaddr Actually, we don't need to set dirty & checked flag on the page, since all valid data in the page should be zeroed by zero_range(). Use i_gc_rwsem[WRITE] to avoid such race condition. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 91291e9998d208370eb8156c760691b873bd7522 Author: Chao Yu Date: Tue Jul 10 23:01:45 2018 +0800 f2fs: fix to do sanity check with block address in main area v2 This patch adds f2fs_is_valid_blkaddr() in below functions to do sanity check with block address to avoid pentential panic: - f2fs_grab_read_bio() - __written_first_block() https://bugzilla.kernel.org/show_bug.cgi?id=200465 - Reproduce - POC (poc.c) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void activity(char *mpoint) { char *xattr; int err; err = asprintf(&xattr, "%s/foo/bar/xattr", mpoint); char buf2[113]; memset(buf2, 0, sizeof(buf2)); listxattr(xattr, buf2, sizeof(buf2)); } int main(int argc, char *argv[]) { activity(argv[1]); return 0; } - kernel message [ 844.718738] F2FS-fs (loop0): Mounted with checkpoint version = 2 [ 846.430929] F2FS-fs (loop0): access invalid blkaddr:1024 [ 846.431058] WARNING: CPU: 1 PID: 1249 at fs/f2fs/checkpoint.c:154 f2fs_is_valid_blkaddr+0x10f/0x160 [ 846.431059] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd input_leds joydev soundcore serio_raw i2c_piix4 mac_hid ib_iser rdma_cm iw_cm ib_cm ib_core configfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi autofs4 raid10 raid456 libcrc32c async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq raid1 raid0 multipath linear qxl ttm crct10dif_pclmul crc32_pclmul drm_kms_helper ghash_clmulni_intel syscopyarea sysfillrect sysimgblt fb_sys_fops pcbc drm 8139too aesni_intel 8139cp floppy psmouse mii aes_x86_64 crypto_simd pata_acpi cryptd glue_helper [ 846.431310] CPU: 1 PID: 1249 Comm: a.out Not tainted 4.18.0-rc3+ #1 [ 846.431312] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 846.431315] RIP: 0010:f2fs_is_valid_blkaddr+0x10f/0x160 [ 846.431316] Code: 00 eb ed 31 c0 83 fa 05 75 ae 48 83 ec 08 48 8b 3f 89 f1 48 c7 c2 fc 0b 0f 8b 48 c7 c6 8b d7 09 8b 88 44 24 07 e8 61 8b ff ff <0f> 0b 0f b6 44 24 07 48 83 c4 08 eb 81 4c 8b 47 10 8b 8f 38 04 00 [ 846.431347] RSP: 0018:ffff961c414a7bc0 EFLAGS: 00010282 [ 846.431349] RAX: 0000000000000000 RBX: ffffc5f787b8ea80 RCX: 0000000000000000 [ 846.431350] RDX: 0000000000000000 RSI: ffff89dfffd165d8 RDI: ffff89dfffd165d8 [ 846.431351] RBP: ffff961c414a7c20 R08: 0000000000000001 R09: 0000000000000248 [ 846.431353] R10: 0000000000000000 R11: 0000000000000248 R12: 0000000000000007 [ 846.431369] R13: ffff89dff5492800 R14: ffff89dfae3aa000 R15: ffff89dff4ff88d0 [ 846.431372] FS: 00007f882e2fb700(0000) GS:ffff89dfffd00000(0000) knlGS:0000000000000000 [ 846.431373] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 846.431374] CR2: 0000000001a88008 CR3: 00000001eb572000 CR4: 00000000000006e0 [ 846.431384] Call Trace: [ 846.431426] f2fs_iget+0x6f4/0xe70 [ 846.431430] ? f2fs_find_entry+0x71/0x90 [ 846.431432] f2fs_lookup+0x1aa/0x390 [ 846.431452] __lookup_slow+0x97/0x150 [ 846.431459] lookup_slow+0x35/0x50 [ 846.431462] walk_component+0x1c6/0x470 [ 846.431479] ? memcg_kmem_charge_memcg+0x70/0x90 [ 846.431488] ? page_add_file_rmap+0x13/0x200 [ 846.431491] path_lookupat+0x76/0x230 [ 846.431501] ? __alloc_pages_nodemask+0xfc/0x280 [ 846.431504] filename_lookup+0xb8/0x1a0 [ 846.431534] ? _cond_resched+0x16/0x40 [ 846.431541] ? kmem_cache_alloc+0x160/0x1d0 [ 846.431549] ? path_listxattr+0x41/0xa0 [ 846.431551] path_listxattr+0x41/0xa0 [ 846.431570] do_syscall_64+0x55/0x100 [ 846.431583] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 846.431607] RIP: 0033:0x7f882de1c0d7 [ 846.431607] Code: f0 ff ff 73 01 c3 48 8b 0d be dd 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 c2 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 91 dd 2b 00 f7 d8 64 89 01 48 [ 846.431639] RSP: 002b:00007ffe8e66c238 EFLAGS: 00000202 ORIG_RAX: 00000000000000c2 [ 846.431641] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f882de1c0d7 [ 846.431642] RDX: 0000000000000071 RSI: 00007ffe8e66c280 RDI: 0000000001a880c0 [ 846.431643] RBP: 00007ffe8e66c300 R08: 0000000001a88010 R09: 0000000000000000 [ 846.431645] R10: 00000000000001ab R11: 0000000000000202 R12: 0000000000400550 [ 846.431646] R13: 00007ffe8e66c400 R14: 0000000000000000 R15: 0000000000000000 [ 846.431648] ---[ end trace abca54df39d14f5c ]--- [ 846.431651] F2FS-fs (loop0): invalid blkaddr: 1024, type: 5, run fsck to fix. [ 846.431762] WARNING: CPU: 1 PID: 1249 at fs/f2fs/f2fs.h:2697 f2fs_iget+0xd17/0xe70 [ 846.431763] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd input_leds joydev soundcore serio_raw i2c_piix4 mac_hid ib_iser rdma_cm iw_cm ib_cm ib_core configfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi autofs4 raid10 raid456 libcrc32c async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq raid1 raid0 multipath linear qxl ttm crct10dif_pclmul crc32_pclmul drm_kms_helper ghash_clmulni_intel syscopyarea sysfillrect sysimgblt fb_sys_fops pcbc drm 8139too aesni_intel 8139cp floppy psmouse mii aes_x86_64 crypto_simd pata_acpi cryptd glue_helper [ 846.431797] CPU: 1 PID: 1249 Comm: a.out Tainted: G W 4.18.0-rc3+ #1 [ 846.431798] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 846.431800] RIP: 0010:f2fs_iget+0xd17/0xe70 [ 846.431801] Code: ff ff 48 63 d8 e9 e1 f6 ff ff 48 8b 45 c8 41 b8 05 00 00 00 48 c7 c2 d8 e8 0e 8b 48 c7 c6 1d b0 0a 8b 48 8b 38 e8 f9 b4 00 00 <0f> 0b 48 8b 45 c8 f0 80 48 48 04 e9 d8 f9 ff ff 0f 0b 48 8b 43 18 [ 846.431832] RSP: 0018:ffff961c414a7bd0 EFLAGS: 00010282 [ 846.431834] RAX: 0000000000000000 RBX: ffffc5f787b8ea80 RCX: 0000000000000006 [ 846.431835] RDX: 0000000000000000 RSI: 0000000000000096 RDI: ffff89dfffd165d0 [ 846.431836] RBP: ffff961c414a7c20 R08: 0000000000000000 R09: 0000000000000273 [ 846.431837] R10: 0000000000000000 R11: ffff89dfad50ca60 R12: 0000000000000007 [ 846.431838] R13: ffff89dff5492800 R14: ffff89dfae3aa000 R15: ffff89dff4ff88d0 [ 846.431840] FS: 00007f882e2fb700(0000) GS:ffff89dfffd00000(0000) knlGS:0000000000000000 [ 846.431841] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 846.431842] CR2: 0000000001a88008 CR3: 00000001eb572000 CR4: 00000000000006e0 [ 846.431846] Call Trace: [ 846.431850] ? f2fs_find_entry+0x71/0x90 [ 846.431853] f2fs_lookup+0x1aa/0x390 [ 846.431856] __lookup_slow+0x97/0x150 [ 846.431858] lookup_slow+0x35/0x50 [ 846.431874] walk_component+0x1c6/0x470 [ 846.431878] ? memcg_kmem_charge_memcg+0x70/0x90 [ 846.431880] ? page_add_file_rmap+0x13/0x200 [ 846.431882] path_lookupat+0x76/0x230 [ 846.431884] ? __alloc_pages_nodemask+0xfc/0x280 [ 846.431886] filename_lookup+0xb8/0x1a0 [ 846.431890] ? _cond_resched+0x16/0x40 [ 846.431891] ? kmem_cache_alloc+0x160/0x1d0 [ 846.431894] ? path_listxattr+0x41/0xa0 [ 846.431896] path_listxattr+0x41/0xa0 [ 846.431898] do_syscall_64+0x55/0x100 [ 846.431901] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 846.431902] RIP: 0033:0x7f882de1c0d7 [ 846.431903] Code: f0 ff ff 73 01 c3 48 8b 0d be dd 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 c2 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 91 dd 2b 00 f7 d8 64 89 01 48 [ 846.431934] RSP: 002b:00007ffe8e66c238 EFLAGS: 00000202 ORIG_RAX: 00000000000000c2 [ 846.431936] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f882de1c0d7 [ 846.431937] RDX: 0000000000000071 RSI: 00007ffe8e66c280 RDI: 0000000001a880c0 [ 846.431939] RBP: 00007ffe8e66c300 R08: 0000000001a88010 R09: 0000000000000000 [ 846.431940] R10: 00000000000001ab R11: 0000000000000202 R12: 0000000000400550 [ 846.431941] R13: 00007ffe8e66c400 R14: 0000000000000000 R15: 0000000000000000 [ 846.431943] ---[ end trace abca54df39d14f5d ]--- [ 846.432033] F2FS-fs (loop0): access invalid blkaddr:1024 [ 846.432051] WARNING: CPU: 1 PID: 1249 at fs/f2fs/checkpoint.c:154 f2fs_is_valid_blkaddr+0x10f/0x160 [ 846.432051] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd input_leds joydev soundcore serio_raw i2c_piix4 mac_hid ib_iser rdma_cm iw_cm ib_cm ib_core configfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi autofs4 raid10 raid456 libcrc32c async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq raid1 raid0 multipath linear qxl ttm crct10dif_pclmul crc32_pclmul drm_kms_helper ghash_clmulni_intel syscopyarea sysfillrect sysimgblt fb_sys_fops pcbc drm 8139too aesni_intel 8139cp floppy psmouse mii aes_x86_64 crypto_simd pata_acpi cryptd glue_helper [ 846.432085] CPU: 1 PID: 1249 Comm: a.out Tainted: G W 4.18.0-rc3+ #1 [ 846.432086] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 846.432089] RIP: 0010:f2fs_is_valid_blkaddr+0x10f/0x160 [ 846.432089] Code: 00 eb ed 31 c0 83 fa 05 75 ae 48 83 ec 08 48 8b 3f 89 f1 48 c7 c2 fc 0b 0f 8b 48 c7 c6 8b d7 09 8b 88 44 24 07 e8 61 8b ff ff <0f> 0b 0f b6 44 24 07 48 83 c4 08 eb 81 4c 8b 47 10 8b 8f 38 04 00 [ 846.432120] RSP: 0018:ffff961c414a7900 EFLAGS: 00010286 [ 846.432122] RAX: 0000000000000000 RBX: 0000000000000400 RCX: 0000000000000006 [ 846.432123] RDX: 0000000000000000 RSI: 0000000000000096 RDI: ffff89dfffd165d0 [ 846.432124] RBP: ffff89dff5492800 R08: 0000000000000001 R09: 000000000000029d [ 846.432125] R10: ffff961c414a7820 R11: 000000000000029d R12: 0000000000000400 [ 846.432126] R13: 0000000000000000 R14: ffff89dff4ff88d0 R15: 0000000000000000 [ 846.432128] FS: 00007f882e2fb700(0000) GS:ffff89dfffd00000(0000) knlGS:0000000000000000 [ 846.432130] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 846.432131] CR2: 0000000001a88008 CR3: 00000001eb572000 CR4: 00000000000006e0 [ 846.432135] Call Trace: [ 846.432151] f2fs_wait_on_block_writeback+0x20/0x110 [ 846.432158] f2fs_grab_read_bio+0xbc/0xe0 [ 846.432161] f2fs_submit_page_read+0x21/0x280 [ 846.432163] f2fs_get_read_data_page+0xb7/0x3c0 [ 846.432165] f2fs_get_lock_data_page+0x29/0x1e0 [ 846.432167] f2fs_get_new_data_page+0x148/0x550 [ 846.432170] f2fs_add_regular_entry+0x1d2/0x550 [ 846.432178] ? __switch_to+0x12f/0x460 [ 846.432181] f2fs_add_dentry+0x6a/0xd0 [ 846.432184] f2fs_do_add_link+0xe9/0x140 [ 846.432186] __recover_dot_dentries+0x260/0x280 [ 846.432189] f2fs_lookup+0x343/0x390 [ 846.432193] __lookup_slow+0x97/0x150 [ 846.432195] lookup_slow+0x35/0x50 [ 846.432208] walk_component+0x1c6/0x470 [ 846.432212] ? memcg_kmem_charge_memcg+0x70/0x90 [ 846.432215] ? page_add_file_rmap+0x13/0x200 [ 846.432217] path_lookupat+0x76/0x230 [ 846.432219] ? __alloc_pages_nodemask+0xfc/0x280 [ 846.432221] filename_lookup+0xb8/0x1a0 [ 846.432224] ? _cond_resched+0x16/0x40 [ 846.432226] ? kmem_cache_alloc+0x160/0x1d0 [ 846.432228] ? path_listxattr+0x41/0xa0 [ 846.432230] path_listxattr+0x41/0xa0 [ 846.432233] do_syscall_64+0x55/0x100 [ 846.432235] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 846.432237] RIP: 0033:0x7f882de1c0d7 [ 846.432237] Code: f0 ff ff 73 01 c3 48 8b 0d be dd 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 c2 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 91 dd 2b 00 f7 d8 64 89 01 48 [ 846.432269] RSP: 002b:00007ffe8e66c238 EFLAGS: 00000202 ORIG_RAX: 00000000000000c2 [ 846.432271] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f882de1c0d7 [ 846.432272] RDX: 0000000000000071 RSI: 00007ffe8e66c280 RDI: 0000000001a880c0 [ 846.432273] RBP: 00007ffe8e66c300 R08: 0000000001a88010 R09: 0000000000000000 [ 846.432274] R10: 00000000000001ab R11: 0000000000000202 R12: 0000000000400550 [ 846.432275] R13: 00007ffe8e66c400 R14: 0000000000000000 R15: 0000000000000000 [ 846.432277] ---[ end trace abca54df39d14f5e ]--- [ 846.432279] F2FS-fs (loop0): invalid blkaddr: 1024, type: 5, run fsck to fix. [ 846.432376] WARNING: CPU: 1 PID: 1249 at fs/f2fs/f2fs.h:2697 f2fs_wait_on_block_writeback+0xb1/0x110 [ 846.432376] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd input_leds joydev soundcore serio_raw i2c_piix4 mac_hid ib_iser rdma_cm iw_cm ib_cm ib_core configfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi autofs4 raid10 raid456 libcrc32c async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq raid1 raid0 multipath linear qxl ttm crct10dif_pclmul crc32_pclmul drm_kms_helper ghash_clmulni_intel syscopyarea sysfillrect sysimgblt fb_sys_fops pcbc drm 8139too aesni_intel 8139cp floppy psmouse mii aes_x86_64 crypto_simd pata_acpi cryptd glue_helper [ 846.432410] CPU: 1 PID: 1249 Comm: a.out Tainted: G W 4.18.0-rc3+ #1 [ 846.432411] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 846.432413] RIP: 0010:f2fs_wait_on_block_writeback+0xb1/0x110 [ 846.432414] Code: 66 90 f0 ff 4b 34 74 59 5b 5d c3 48 8b 7d 00 41 b8 05 00 00 00 89 d9 48 c7 c2 d8 e8 0e 8b 48 c7 c6 1d b0 0a 8b e8 df bc fd ff <0f> 0b f0 80 4d 48 04 e9 67 ff ff ff 48 8b 03 48 c1 e8 37 83 e0 07 [ 846.432445] RSP: 0018:ffff961c414a7910 EFLAGS: 00010286 [ 846.432447] RAX: 0000000000000000 RBX: 0000000000000400 RCX: 0000000000000006 [ 846.432448] RDX: 0000000000000000 RSI: 0000000000000092 RDI: ffff89dfffd165d0 [ 846.432449] RBP: ffff89dff5492800 R08: 0000000000000000 R09: 00000000000002d1 [ 846.432450] R10: ffff961c414a7820 R11: ffff89dfad50cf80 R12: 0000000000000400 [ 846.432451] R13: 0000000000000000 R14: ffff89dff4ff88d0 R15: 0000000000000000 [ 846.432453] FS: 00007f882e2fb700(0000) GS:ffff89dfffd00000(0000) knlGS:0000000000000000 [ 846.432454] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 846.432455] CR2: 0000000001a88008 CR3: 00000001eb572000 CR4: 00000000000006e0 [ 846.432459] Call Trace: [ 846.432463] f2fs_grab_read_bio+0xbc/0xe0 [ 846.432464] f2fs_submit_page_read+0x21/0x280 [ 846.432466] f2fs_get_read_data_page+0xb7/0x3c0 [ 846.432468] f2fs_get_lock_data_page+0x29/0x1e0 [ 846.432470] f2fs_get_new_data_page+0x148/0x550 [ 846.432473] f2fs_add_regular_entry+0x1d2/0x550 [ 846.432475] ? __switch_to+0x12f/0x460 [ 846.432477] f2fs_add_dentry+0x6a/0xd0 [ 846.432480] f2fs_do_add_link+0xe9/0x140 [ 846.432483] __recover_dot_dentries+0x260/0x280 [ 846.432485] f2fs_lookup+0x343/0x390 [ 846.432488] __lookup_slow+0x97/0x150 [ 846.432490] lookup_slow+0x35/0x50 [ 846.432505] walk_component+0x1c6/0x470 [ 846.432509] ? memcg_kmem_charge_memcg+0x70/0x90 [ 846.432511] ? page_add_file_rmap+0x13/0x200 [ 846.432513] path_lookupat+0x76/0x230 [ 846.432515] ? __alloc_pages_nodemask+0xfc/0x280 [ 846.432517] filename_lookup+0xb8/0x1a0 [ 846.432520] ? _cond_resched+0x16/0x40 [ 846.432522] ? kmem_cache_alloc+0x160/0x1d0 [ 846.432525] ? path_listxattr+0x41/0xa0 [ 846.432526] path_listxattr+0x41/0xa0 [ 846.432529] do_syscall_64+0x55/0x100 [ 846.432531] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 846.432533] RIP: 0033:0x7f882de1c0d7 [ 846.432533] Code: f0 ff ff 73 01 c3 48 8b 0d be dd 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 c2 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 91 dd 2b 00 f7 d8 64 89 01 48 [ 846.432565] RSP: 002b:00007ffe8e66c238 EFLAGS: 00000202 ORIG_RAX: 00000000000000c2 [ 846.432567] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f882de1c0d7 [ 846.432568] RDX: 0000000000000071 RSI: 00007ffe8e66c280 RDI: 0000000001a880c0 [ 846.432569] RBP: 00007ffe8e66c300 R08: 0000000001a88010 R09: 0000000000000000 [ 846.432570] R10: 00000000000001ab R11: 0000000000000202 R12: 0000000000400550 [ 846.432571] R13: 00007ffe8e66c400 R14: 0000000000000000 R15: 0000000000000000 [ 846.432573] ---[ end trace abca54df39d14f5f ]--- [ 846.434280] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 [ 846.434424] PGD 80000001ebd3a067 P4D 80000001ebd3a067 PUD 1eb1ae067 PMD 0 [ 846.434551] Oops: 0000 [#1] SMP PTI [ 846.434697] CPU: 0 PID: 44 Comm: kworker/u5:0 Tainted: G W 4.18.0-rc3+ #1 [ 846.434805] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 846.435000] Workqueue: fscrypt_read_queue decrypt_work [ 846.435174] RIP: 0010:fscrypt_do_page_crypto+0x6e/0x2d0 [ 846.435351] Code: 00 65 48 8b 04 25 28 00 00 00 48 89 84 24 88 00 00 00 31 c0 e8 43 c2 e0 ff 49 8b 86 48 02 00 00 85 ed c7 44 24 70 00 00 00 00 <48> 8b 58 08 0f 84 14 02 00 00 48 8b 78 10 48 8b 0c 24 48 c7 84 24 [ 846.435696] RSP: 0018:ffff961c40f9bd60 EFLAGS: 00010206 [ 846.435870] RAX: 0000000000000000 RBX: ffffc5f787719b80 RCX: ffffc5f787719b80 [ 846.436051] RDX: ffffffff8b9f4b88 RSI: ffffffff8b0ae622 RDI: ffff961c40f9bdb8 [ 846.436261] RBP: 0000000000001000 R08: ffffc5f787719b80 R09: 0000000000001000 [ 846.436433] R10: 0000000000000018 R11: fefefefefefefeff R12: ffffc5f787719b80 [ 846.436562] R13: ffffc5f787719b80 R14: ffff89dff4ff88d0 R15: 0ffff89dfaddee60 [ 846.436658] FS: 0000000000000000(0000) GS:ffff89dfffc00000(0000) knlGS:0000000000000000 [ 846.436758] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 846.436898] CR2: 0000000000000008 CR3: 00000001eddd0000 CR4: 00000000000006f0 [ 846.437001] Call Trace: [ 846.437181] ? check_preempt_wakeup+0xf2/0x230 [ 846.437276] ? check_preempt_curr+0x7c/0x90 [ 846.437370] fscrypt_decrypt_page+0x48/0x4d [ 846.437466] __fscrypt_decrypt_bio+0x5b/0x90 [ 846.437542] decrypt_work+0x12/0x20 [ 846.437651] process_one_work+0x15e/0x3d0 [ 846.437740] worker_thread+0x4c/0x440 [ 846.437848] kthread+0xf8/0x130 [ 846.437938] ? rescuer_thread+0x350/0x350 [ 846.438022] ? kthread_associate_blkcg+0x90/0x90 [ 846.438117] ret_from_fork+0x35/0x40 [ 846.438201] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd input_leds joydev soundcore serio_raw i2c_piix4 mac_hid ib_iser rdma_cm iw_cm ib_cm ib_core configfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi autofs4 raid10 raid456 libcrc32c async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq raid1 raid0 multipath linear qxl ttm crct10dif_pclmul crc32_pclmul drm_kms_helper ghash_clmulni_intel syscopyarea sysfillrect sysimgblt fb_sys_fops pcbc drm 8139too aesni_intel 8139cp floppy psmouse mii aes_x86_64 crypto_simd pata_acpi cryptd glue_helper [ 846.438653] CR2: 0000000000000008 [ 846.438713] ---[ end trace abca54df39d14f60 ]--- [ 846.438796] RIP: 0010:fscrypt_do_page_crypto+0x6e/0x2d0 [ 846.438844] Code: 00 65 48 8b 04 25 28 00 00 00 48 89 84 24 88 00 00 00 31 c0 e8 43 c2 e0 ff 49 8b 86 48 02 00 00 85 ed c7 44 24 70 00 00 00 00 <48> 8b 58 08 0f 84 14 02 00 00 48 8b 78 10 48 8b 0c 24 48 c7 84 24 [ 846.439084] RSP: 0018:ffff961c40f9bd60 EFLAGS: 00010206 [ 846.439176] RAX: 0000000000000000 RBX: ffffc5f787719b80 RCX: ffffc5f787719b80 [ 846.440927] RDX: ffffffff8b9f4b88 RSI: ffffffff8b0ae622 RDI: ffff961c40f9bdb8 [ 846.442083] RBP: 0000000000001000 R08: ffffc5f787719b80 R09: 0000000000001000 [ 846.443284] R10: 0000000000000018 R11: fefefefefefefeff R12: ffffc5f787719b80 [ 846.444448] R13: ffffc5f787719b80 R14: ffff89dff4ff88d0 R15: 0ffff89dfaddee60 [ 846.445558] FS: 0000000000000000(0000) GS:ffff89dfffc00000(0000) knlGS:0000000000000000 [ 846.446687] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 846.447796] CR2: 0000000000000008 CR3: 00000001eddd0000 CR4: 00000000000006f0 - Location https://elixir.bootlin.com/linux/v4.18-rc4/source/fs/crypto/crypto.c#L149 struct crypto_skcipher *tfm = ci->ci_ctfm; Here ci can be NULL Note that this issue maybe require CONFIG_F2FS_FS_ENCRYPTION=y to reproduce. Reported-by Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit bcbfbd604dcba45246dd307c8317f216ada5567d Author: Chao Yu Date: Fri Jun 29 00:19:25 2018 +0800 f2fs: fix to do sanity check with inline flags https://bugzilla.kernel.org/show_bug.cgi?id=200221 - Overview BUG() in clear_inode() when mounting and un-mounting a corrupted f2fs image - Reproduce - Kernel message [ 538.601448] F2FS-fs (loop0): Invalid segment/section count (31, 24 x 1376257) [ 538.601458] F2FS-fs (loop0): Can't find valid F2FS filesystem in 2th superblock [ 538.724091] F2FS-fs (loop0): Try to recover 2th superblock, ret: 0 [ 538.724102] F2FS-fs (loop0): Mounted with checkpoint version = 2 [ 540.970834] ------------[ cut here ]------------ [ 540.970838] kernel BUG at fs/inode.c:512! [ 540.971750] invalid opcode: 0000 [#1] SMP KASAN PTI [ 540.972755] CPU: 1 PID: 1305 Comm: umount Not tainted 4.18.0-rc1+ #4 [ 540.974034] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 540.982913] RIP: 0010:clear_inode+0xc0/0xd0 [ 540.983774] Code: 8d a3 30 01 00 00 4c 89 e7 e8 1c ec f8 ff 48 8b 83 30 01 00 00 49 39 c4 75 1a 48 c7 83 a0 00 00 00 60 00 00 00 5b 41 5c 5d c3 <0f> 0b 0f 0b 0f 0b 0f 0b 0f 0b 0f 0b 0f 1f 40 00 66 66 66 66 90 55 [ 540.987570] RSP: 0018:ffff8801e34a7b70 EFLAGS: 00010002 [ 540.988636] RAX: 0000000000000000 RBX: ffff8801e9b744e8 RCX: ffffffffb840eb3a [ 540.990063] RDX: dffffc0000000000 RSI: 0000000000000004 RDI: ffff8801e9b746b8 [ 540.991499] RBP: ffff8801e34a7b80 R08: ffffed003d36e8ce R09: ffffed003d36e8ce [ 540.992923] R10: 0000000000000001 R11: ffffed003d36e8cd R12: ffff8801e9b74668 [ 540.994360] R13: ffff8801e9b74760 R14: ffff8801e9b74528 R15: ffff8801e9b74530 [ 540.995786] FS: 00007f4662bdf840(0000) GS:ffff8801f6f00000(0000) knlGS:0000000000000000 [ 540.997403] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 540.998571] CR2: 000000000175c568 CR3: 00000001dcfe6000 CR4: 00000000000006e0 [ 541.000015] Call Trace: [ 541.000554] f2fs_evict_inode+0x253/0x630 [ 541.001381] evict+0x16f/0x290 [ 541.002015] iput+0x280/0x300 [ 541.002654] dentry_unlink_inode+0x165/0x1e0 [ 541.003528] __dentry_kill+0x16a/0x260 [ 541.004300] dentry_kill+0x70/0x250 [ 541.005018] dput+0x154/0x1d0 [ 541.005635] do_one_tree+0x34/0x40 [ 541.006354] shrink_dcache_for_umount+0x3f/0xa0 [ 541.007285] generic_shutdown_super+0x43/0x1c0 [ 541.008192] kill_block_super+0x52/0x80 [ 541.008978] kill_f2fs_super+0x62/0x70 [ 541.009750] deactivate_locked_super+0x6f/0xa0 [ 541.010664] deactivate_super+0x5e/0x80 [ 541.011450] cleanup_mnt+0x61/0xa0 [ 541.012151] __cleanup_mnt+0x12/0x20 [ 541.012893] task_work_run+0xc8/0xf0 [ 541.013635] exit_to_usermode_loop+0x125/0x130 [ 541.014555] do_syscall_64+0x138/0x170 [ 541.015340] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 541.016375] RIP: 0033:0x7f46624bf487 [ 541.017104] Code: 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 c9 2b 00 f7 d8 64 89 01 48 [ 541.020923] RSP: 002b:00007fff5e12e9a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [ 541.022452] RAX: 0000000000000000 RBX: 0000000001753030 RCX: 00007f46624bf487 [ 541.023885] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 000000000175a1e0 [ 541.025318] RBP: 000000000175a1e0 R08: 0000000000000000 R09: 0000000000000014 [ 541.026755] R10: 00000000000006b2 R11: 0000000000000246 R12: 00007f46629c883c [ 541.028186] R13: 0000000000000000 R14: 0000000001753210 R15: 00007fff5e12ec30 [ 541.029626] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd mac_hid i2c_piix4 soundcore ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear 8139too crct10dif_pclmul crc32_pclmul qxl drm_kms_helper syscopyarea aesni_intel sysfillrect sysimgblt fb_sys_fops ttm drm aes_x86_64 crypto_simd cryptd 8139cp glue_helper mii pata_acpi floppy [ 541.039445] ---[ end trace 4ce02f25ff7d3df5 ]--- [ 541.040392] RIP: 0010:clear_inode+0xc0/0xd0 [ 541.041240] Code: 8d a3 30 01 00 00 4c 89 e7 e8 1c ec f8 ff 48 8b 83 30 01 00 00 49 39 c4 75 1a 48 c7 83 a0 00 00 00 60 00 00 00 5b 41 5c 5d c3 <0f> 0b 0f 0b 0f 0b 0f 0b 0f 0b 0f 0b 0f 1f 40 00 66 66 66 66 90 55 [ 541.045042] RSP: 0018:ffff8801e34a7b70 EFLAGS: 00010002 [ 541.046099] RAX: 0000000000000000 RBX: ffff8801e9b744e8 RCX: ffffffffb840eb3a [ 541.047537] RDX: dffffc0000000000 RSI: 0000000000000004 RDI: ffff8801e9b746b8 [ 541.048965] RBP: ffff8801e34a7b80 R08: ffffed003d36e8ce R09: ffffed003d36e8ce [ 541.050402] R10: 0000000000000001 R11: ffffed003d36e8cd R12: ffff8801e9b74668 [ 541.051832] R13: ffff8801e9b74760 R14: ffff8801e9b74528 R15: ffff8801e9b74530 [ 541.053263] FS: 00007f4662bdf840(0000) GS:ffff8801f6f00000(0000) knlGS:0000000000000000 [ 541.054891] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 541.056039] CR2: 000000000175c568 CR3: 00000001dcfe6000 CR4: 00000000000006e0 [ 541.058506] ================================================================== [ 541.059991] BUG: KASAN: stack-out-of-bounds in update_stack_state+0x38c/0x3e0 [ 541.061513] Read of size 8 at addr ffff8801e34a7970 by task umount/1305 [ 541.063302] CPU: 1 PID: 1305 Comm: umount Tainted: G D 4.18.0-rc1+ #4 [ 541.064838] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 541.066778] Call Trace: [ 541.067294] dump_stack+0x7b/0xb5 [ 541.067986] print_address_description+0x70/0x290 [ 541.068941] kasan_report+0x291/0x390 [ 541.069692] ? update_stack_state+0x38c/0x3e0 [ 541.070598] __asan_load8+0x54/0x90 [ 541.071315] update_stack_state+0x38c/0x3e0 [ 541.072172] ? __read_once_size_nocheck.constprop.7+0x20/0x20 [ 541.073340] ? vprintk_func+0x27/0x60 [ 541.074096] ? printk+0xa3/0xd3 [ 541.074762] ? __save_stack_trace+0x5e/0x100 [ 541.075634] unwind_next_frame.part.5+0x18e/0x490 [ 541.076594] ? unwind_dump+0x290/0x290 [ 541.077368] ? __show_regs+0x2c4/0x330 [ 541.078142] __unwind_start+0x106/0x190 [ 541.085422] __save_stack_trace+0x5e/0x100 [ 541.086268] ? __save_stack_trace+0x5e/0x100 [ 541.087161] ? unlink_anon_vmas+0xba/0x2c0 [ 541.087997] save_stack_trace+0x1f/0x30 [ 541.088782] save_stack+0x46/0xd0 [ 541.089475] ? __alloc_pages_slowpath+0x1420/0x1420 [ 541.090477] ? flush_tlb_mm_range+0x15e/0x220 [ 541.091364] ? __dec_node_state+0x24/0xb0 [ 541.092180] ? lock_page_memcg+0x85/0xf0 [ 541.092979] ? unlock_page_memcg+0x16/0x80 [ 541.093812] ? page_remove_rmap+0x198/0x520 [ 541.094674] ? mark_page_accessed+0x133/0x200 [ 541.095559] ? _cond_resched+0x1a/0x50 [ 541.096326] ? unmap_page_range+0xcd4/0xe50 [ 541.097179] ? rb_next+0x58/0x80 [ 541.097845] ? rb_next+0x58/0x80 [ 541.098518] __kasan_slab_free+0x13c/0x1a0 [ 541.099352] ? unlink_anon_vmas+0xba/0x2c0 [ 541.100184] kasan_slab_free+0xe/0x10 [ 541.100934] kmem_cache_free+0x89/0x1e0 [ 541.101724] unlink_anon_vmas+0xba/0x2c0 [ 541.102534] free_pgtables+0x101/0x1b0 [ 541.103299] exit_mmap+0x146/0x2a0 [ 541.103996] ? __ia32_sys_munmap+0x50/0x50 [ 541.104829] ? kasan_check_read+0x11/0x20 [ 541.105649] ? mm_update_next_owner+0x322/0x380 [ 541.106578] mmput+0x8b/0x1d0 [ 541.107191] do_exit+0x43a/0x1390 [ 541.107876] ? mm_update_next_owner+0x380/0x380 [ 541.108791] ? deactivate_super+0x5e/0x80 [ 541.109610] ? cleanup_mnt+0x61/0xa0 [ 541.110351] ? __cleanup_mnt+0x12/0x20 [ 541.111115] ? task_work_run+0xc8/0xf0 [ 541.111879] ? exit_to_usermode_loop+0x125/0x130 [ 541.112817] rewind_stack_do_exit+0x17/0x20 [ 541.113666] RIP: 0033:0x7f46624bf487 [ 541.114404] Code: Bad RIP value. [ 541.115094] RSP: 002b:00007fff5e12e9a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [ 541.116605] RAX: 0000000000000000 RBX: 0000000001753030 RCX: 00007f46624bf487 [ 541.118034] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 000000000175a1e0 [ 541.119472] RBP: 000000000175a1e0 R08: 0000000000000000 R09: 0000000000000014 [ 541.120890] R10: 00000000000006b2 R11: 0000000000000246 R12: 00007f46629c883c [ 541.122321] R13: 0000000000000000 R14: 0000000001753210 R15: 00007fff5e12ec30 [ 541.124061] The buggy address belongs to the page: [ 541.125042] page:ffffea00078d29c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0 [ 541.126651] flags: 0x2ffff0000000000() [ 541.127418] raw: 02ffff0000000000 dead000000000100 dead000000000200 0000000000000000 [ 541.128963] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 541.130516] page dumped because: kasan: bad access detected [ 541.131954] Memory state around the buggy address: [ 541.132924] ffff8801e34a7800: 00 f1 f1 f1 f1 00 f4 f4 f4 f3 f3 f3 f3 00 00 00 [ 541.134378] ffff8801e34a7880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 541.135814] >ffff8801e34a7900: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 [ 541.137253] ^ [ 541.138637] ffff8801e34a7980: f1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 541.140075] ffff8801e34a7a00: 00 00 00 00 00 00 00 00 f3 00 00 00 00 00 00 00 [ 541.141509] ================================================================== - Location https://elixir.bootlin.com/linux/v4.18-rc1/source/fs/inode.c#L512 BUG_ON(inode->i_data.nrpages); The root cause is root directory inode is corrupted, it has both inline_data and inline_dentry flag, and its nlink is zero, so in ->evict(), after dropping all page cache, it grabs page #0 for inline data truncation, result in panic in later clear_inode() where we will check inode->i_data.nrpages value. This patch adds inline flags check in sanity_check_inode, in addition, do sanity check with root inode's nlink. Reported-by Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d0daaeaf60143c02a2ef87f9f0703b63a0a7f8b3 Merge: 400439275d95 9e90c7985229 Author: Linus Torvalds Date: Mon Aug 13 10:47:26 2018 -0700 Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull genirq updates from Thomas Gleixner: "The irq departement provides: - A synchronization fix for free_irq() to synchronize just the removed interrupt thread on shared interrupt lines. - Consolidate the multi low level interrupt entry handling and mvoe it to the generic code instead of adding yet another copy for RISC-V - Refactoring of the ARM LPI allocator and LPI exposure to the hypervisor - Yet another interrupt chip driver for the JZ4725B SoC - Speed up for /proc/interrupts as people seem to love reading this file with high frequency - Miscellaneous fixes and updates" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) irqchip/gic-v3-its: Make its_lock a raw_spin_lock_t genirq/irqchip: Remove MULTI_IRQ_HANDLER as it's now obselete openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER arm64: Use the new GENERIC_IRQ_MULTI_HANDLER ARM: Convert to GENERIC_IRQ_MULTI_HANDLER irqchip: Port the ARM IRQ drivers to GENERIC_IRQ_MULTI_HANDLER irqchip/gic-v3-its: Reduce minimum LPI allocation to 1 for PCI devices dt-bindings: irqchip: renesas-irqc: Document r8a77980 support dt-bindings: irqchip: renesas-irqc: Document r8a77470 support irqchip/ingenic: Add support for the JZ4725B SoC irqchip/stm32: Add exti0 translation for stm32mp1 genirq: Remove redundant NULL pointer check in __free_irq() irqchip/gic-v3-its: Honor hypervisor enforced LPI range irqchip/gic-v3: Expose GICD_TYPER in the rdist structure irqchip/gic-v3-its: Drop chunk allocation compatibility irqchip/gic-v3-its: Move minimum LPI requirements to individual busses irqchip/gic-v3-its: Use full range of LPIs irqchip/gic-v3-its: Refactor LPI allocator genirq: Synchronize only with single thread on free_irq() genirq: Update code comments wrt recycled thread_mask ... commit 400439275d9543286f9d3f2925c3156f888e6b18 Merge: 0ad6b38ab2cc c4326563d9ab Author: Linus Torvalds Date: Mon Aug 13 10:25:08 2018 -0700 Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull EFI updates from Thomas Gleixner: "The EFI pile: - Make mixed mode UEFI runtime service invocations mutually exclusive, as mandated by the UEFI spec - Perform UEFI runtime services calls from a work queue so the calls into the firmware occur from a kernel thread - Honor the UEFI memory map attributes for live memory regions configured by UEFI as a framebuffer. This works around a coherency problem with KVM guests running on ARM. - Cleanups, improvements and fixes all over the place" * 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efivars: Call guid_parse() against guid_t type of variable efi/cper: Use consistent types for UUIDs efi/x86: Replace references to efi_early->is64 with efi_is_64bit() efi: Deduplicate efi_open_volume() efi/x86: Add missing NULL initialization in UGA draw protocol discovery efi/x86: Merge 32-bit and 64-bit UGA draw protocol setup routines efi/x86: Align efi_uga_draw_protocol typedef names to convention efi/x86: Merge the setup_efi_pci32() and setup_efi_pci64() routines efi/x86: Prevent reentrant firmware calls in mixed mode efi/esrt: Only call efi_mem_reserve() for boot services memory fbdev/efifb: Honour UEFI memory map attributes when mapping the FB efi: Drop type and attribute checks in efi_mem_desc_lookup() efi/libstub/arm: Add opt-in Kconfig option for the DTB loader efi: Remove the declaration of efi_late_init() as the function is unused efi/cper: Avoid using get_seconds() efi: Use a work queue to invoke EFI Runtime Services efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable() efi/x86: Clean up the eboot code commit 0ad6b38ab2cc00b886c34d945b6a30fdf5108c61 Merge: 03e61914a6d2 3ff4f80a74fd Author: Linus Torvalds Date: Mon Aug 13 10:21:28 2018 -0700 Merge branch 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull debugobjects update from Thomas Gleixner: "Two simple updates for the debug objects code: - Make the stack check warning more informative by adding the object and the stack page address to the printout - Remove a redundant NULL pointer check" * 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: debugobjects: Remove redundant NULL pointer check debugobjects: Make stack check warning more informative commit c1617fb4c5eea2ad38b5ffb937a732dbb137117f Merge: 961d9735357e 2ce3206b9eb3 Author: David S. Miller Date: Mon Aug 13 10:07:23 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2018-08-13 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Add driver XDP support for veth. This can be used in conjunction with redirect of another XDP program e.g. sitting on NIC so the xdp_frame can be forwarded to the peer veth directly without modification, from Toshiaki. 2) Add a new BPF map type REUSEPORT_SOCKARRAY and prog type SK_REUSEPORT in order to provide more control and visibility on where a SO_REUSEPORT sk should be located, and the latter enables to directly select a sk from the bpf map. This also enables map-in-map for application migration use cases, from Martin. 3) Add a new BPF helper bpf_skb_ancestor_cgroup_id() that returns the id of cgroup v2 that is the ancestor of the cgroup associated with the skb at the ancestor_level, from Andrey. 4) Implement BPF fs map pretty-print support based on BTF data for regular hash table and LRU map, from Yonghong. 5) Decouple the ability to attach BTF for a map from the key and value pretty-printer in BPF fs, and enable further support of BTF for maps for percpu and LPM trie, from Daniel. 6) Implement a better BPF sample of using XDP's CPU redirect feature for load balancing SKB processing to remote CPU. The sample implements the same XDP load balancing as Suricata does which is symmetric hash based on IP and L4 protocol, from Jesper. 7) Revert adding NULL pointer check with WARN_ON_ONCE() in __xdp_return()'s critical path as it is ensured that the allocator is present, from Björn. ==================== Signed-off-by: David S. Miller commit 961d9735357ec59be3e3e2c37c0ca6494f04461b Merge: 45c91fb20093 209b43759d65 Author: David S. Miller Date: Mon Aug 13 10:06:11 2018 -0700 Merge tag 'wireless-drivers-next-for-davem-2018-08-12' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== pull-request: wireless-drivers-next 2018-08-12 wireless-drivers-next patches for 4.19 Last set of new features for 4.19. Most notable is simplifying SSB debugging code with two Kconfig option removals and fixing mt76 USB build problems. Major changes: ath10k * add debugfs file warm_hw_reset wil6210 * add debugfs files tx_latency, link_stats and link_stats_global * add 3-MSI support * allow scan on AP interface * support max aggregation window size 64 ssb * remove CONFIG_SSB_SILENT and CONFIG_SSB_DEBUG Kconfig options mt76 * fix build problems with recently added USB support ==================== Signed-off-by: David S. Miller commit 03e61914a6d2c5bb95faaa470193cfdb71b7ea01 Merge: 94710cac0ef4 71a896687b85 Author: Linus Torvalds Date: Mon Aug 13 09:50:24 2018 -0700 Merge tag 'm68k-for-v4.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - Enable mac_scsi PDMA on PowerBook 500 - Generic dma_noncoherent_ops conversion - Time handling improvements - I/O accessor improvements - Conversion to MEMBLOCK and NO_BOOTMEM, to bring m68k in line with other mainstream architectures - Miscellaneous fixes and cleanups - Defconfig updates * tag 'm68k-for-v4.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k/defconfig: Update defconfigs for v4.18-rc6 m68k: switch to MEMBLOCK + NO_BOOTMEM m68k/page_no.h: force __va argument to be unsigned long m68k/bitops: convert __ffs to match generic declaration m68k/io: Switch mmu variant to m68k/io: Move mem*io define guards to Input: hilkbd - Add casts to HP9000/300 I/O accessors net: mac8390: Use standard memcpy_{from,to}io() m68k/io: Add missing ioremap define guards, fix typo m68k: Remove unused set_clock_mmss() helpers m68k: mac: Use time64_t in RTC handling m68k: Use generic dma_noncoherent_ops nubus: Set default dma mask for nubus_board devices m68k/mac: Enable PDMA for PowerBook 500 series commit 627672cf431b0379c07cc8d146f907cda6797222 Author: Palmer Dabbelt Date: Mon Jun 26 22:09:07 2017 -0700 dt-bindings: interrupt-controller: SiFive Plaform Level Interrupt Controller Add documentation for the SiFive implementation of the RISC-V Platform Level Interrupt Controller (PLIC). The PLIC connects global interrupt sources to the local interrupt controller on each hart. Signed-off-by: Palmer Dabbelt [hch: various fixes and updates] Signed-off-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit b67bc7cb408816b94224a74dff9868d2a38bf30c Author: Palmer Dabbelt Date: Mon Jun 26 22:07:50 2017 -0700 dt-bindings: interrupt-controller: RISC-V local interrupt controller Add documentation on the RISC-V local interrupt controller, which is a per-hart interrupt controller that manages all interrupts entering a RISC-V hart. This interrupt controller is present on all RISC-V systems. Signed-off-by: Palmer Dabbelt [hch: minor cleanups] Signed-off-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit 45c91fb200936b2c48e8605539d800a61abb1cbf Author: YueHaibing Date: Mon Aug 13 17:29:36 2018 +0800 liquidio: remove set but not used variable 'is25G' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/cavium/liquidio/lio_ethtool.c: In function 'lio_set_link_ksettings': drivers/net/ethernet/cavium/liquidio/lio_ethtool.c:392:6: warning: variable 'is25G' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 0ec456802d133e0eeb4d9ac4283a9982ad9b89af Author: YueHaibing Date: Mon Aug 13 14:59:02 2018 +0800 cxgb4: remove set but not used variable 'spd' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c: In function 'print_port_info': drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:5147:14: warning: variable 'spd' set but not used [-Wunused-but-set-variable] variable 'spd' is set but not used since commit 547fd27241a8 ("cxgb4: Warn if device doesn't have enough PCI bandwidth") Signed-off-by: YueHaibing Acked-by: Ganesh Goudar Signed-off-by: David S. Miller commit 3b20818b0acdd493e5b891140310b1435cccf81b Author: Yue Haibing Date: Mon Aug 13 06:39:21 2018 +0000 lan743x: lan743x: Remove duplicated include from lan743x_ptp.c Remove duplicated include. Signed-off-by: Yue Haibing Signed-off-by: David S. Miller commit 1150827b121e149632bc8f0d5d2b4453694648b6 Author: YueHaibing Date: Mon Aug 13 14:13:15 2018 +0800 virtio_net: remove duplicated include from virtio_net.c Remove duplicated include linux/netdevice.h Signed-off-by: YueHaibing Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 71e41286203c017d24f041a7cd71abea7ca7b1e0 Author: Li RongQing Date: Mon Aug 13 10:42:46 2018 +0800 packet: switch kvzalloc to allocate memory The patches includes following change: *Use modern kvzalloc()/kvfree() instead of custom allocations. *Remove order argument for alloc_pg_vec, it can get from req. *Remove order argument for free_pg_vec, free_pg_vec now uses kvfree which does not need order argument. *Remove pg_vec_order from struct packet_ring_buffer, no longer need to save/restore 'order' *Remove variable 'order' for packet_set_ring, it is now unused Signed-off-by: Zhang Yu Signed-off-by: Li RongQing Signed-off-by: David S. Miller commit 0192e7d46c776f7f735560bfa4d40eac3fd700f9 Author: Zong Li Date: Mon Aug 13 10:26:52 2018 +0800 net: Change the layout of structure trace_event_raw_fib_table_lookup There is an unalignment access about the structure 'trace_event_raw_fib_table_lookup'. In include/trace/events/fib.h, there is a memory operation which casting the 'src' data member to a pointer, and then store a value to this pointer point to. p32 = (__be32 *) __entry->src; *p32 = flp->saddr; The offset of 'src' in structure trace_event_raw_fib_table_lookup is not four bytes alignment. On some architectures, they don't permit the unalignment access, it need to pay the price to handle this situation in exception handler. Adjust the layout of structure to avoid this case. Fixes: 9f323973c915 ("net/ipv4: Udate fib_table_lookup tracepoint") Signed-off-by: Zong Li Acked-by: David Ahern Signed-off-by: David S. Miller commit a72ce9ad7cfc96e640122b2821f6bbc3588815b2 Merge: 9af18e56d43c 7c5790c4da0e Author: David S. Miller Date: Mon Aug 13 09:06:22 2018 -0700 Merge branch 'net-sched-actions-rename-for-grep-ability-and-consistency' Jamal Hadi Salim says: ==================== net: sched: actions rename for grep-ability and consistency Having a structure (example tcf_mirred) and a function with the same name is not good for readability or grepability. This long overdue patchset improves it and make sure there is consistency across all actions ==================== Signed-off-by: David S. Miller commit 7c5790c4da0e5b96b147d683c94ba3ed93e5f0fe Author: Jamal Hadi Salim Date: Sun Aug 12 09:35:01 2018 -0400 net: sched: act_mirred method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 8aa7f22e5649db6f994cda1212a37e7f8ae4e63e Author: Jamal Hadi Salim Date: Sun Aug 12 09:35:00 2018 -0400 net: sched: act_vlan method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 353d2c253f4cc5c7b28a041a79949f46ed5edb25 Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:59 2018 -0400 net: sched: act_skbmod method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 45da1dac612c0658ed946d573000e88f0d8ec5bc Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:58 2018 -0400 net: sched: act_skbedit method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 798de374e50309dba39cee16527cb3534e84ba86 Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:57 2018 -0400 net: sched: act_simple method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 2ac063474dc738700eab3425d1f7c4ad98776bcd Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:56 2018 -0400 net: sched: act_police method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 6a2b401cd17d41944672563b2edf65cdef44c242 Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:55 2018 -0400 net: sched: act_pedit method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 0390514fe15501e9ddc4e87bdeed35fec9fc4802 Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:54 2018 -0400 net: sched: act_nat method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 11b9695b3ff06990333d77963607944574953c98 Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:53 2018 -0400 net: sched: act_ipt method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 1740005e2a0cae1ba87e3efe2690755fe169837b Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:52 2018 -0400 net: sched: act_gact method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit c831549c3f53537e3b8a205c5d67cbc16c054f6a Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:51 2018 -0400 net: sched: act_sum method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 2fbec27f816bd95ebc468d17a784b20a72b95896 Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:50 2018 -0400 net: sched: act_bpf method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 962ad1f937d86456e88d8cbcd93766746297f711 Author: Jamal Hadi Salim Date: Sun Aug 12 09:34:49 2018 -0400 net: sched: act_connmark method rename for grep-ability and consistency Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 9af18e56d43ca4864ce65c3542c513827c2697de Author: Willem de Bruijn Date: Sun Aug 12 09:14:03 2018 -0400 cpumask: make cpumask_next_wrap available without smp The kbuild robot shows build failure on machines without CONFIG_SMP: drivers/net/virtio_net.c:1916:10: error: implicit declaration of function 'cpumask_next_wrap' cpumask_next_wrap is exported from lib/cpumask.o, which has lib-$(CONFIG_SMP) += cpumask.o same as other functions, also define it as static inline in the NR_CPUS==1 branch in include/linux/cpumask.h. If wrap is true and next == start, return nr_cpumask_bits, or 1. Else wrap across the range of valid cpus, here [0]. Fixes: 2ca653d607ce ("virtio_net: Stripe queue affinities across cores.") Signed-off-by: Willem de Bruijn Tested-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 7c53a722459c1d6ffb0f5b2058c06ca8980b8600 Author: Heiner Kallweit Date: Sun Aug 12 13:26:26 2018 +0200 r8169: don't use MSI-X on RTL8168g There have been two reports that network doesn't come back on resume from suspend when using MSI-X. Both cases affect the same chip version (RTL8168g - version 40), on different systems. Falling back to MSI fixes the issue. Even though we don't really have a proof yet that the network chip version is to blame, let's disable MSI-X for this version. Reported-by: Steve Dodd Reported-by: Lou Reed Tested-by: Steve Dodd Tested-by: Lou Reed Fixes: 6c6aa15fdea5 ("r8169: improve interrupt handling") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 0fcf6c02b205f80f24eb548b236543ec151cb01c Author: Yan, Zheng Date: Fri Aug 3 16:24:49 2018 +0800 ceph: don't drop message if it contains more data than expected Later version mds may encode more data into messages. Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 342ce1823ebaec573ac269b56bca78c698fec5c3 Author: Yan, Zheng Date: Fri May 11 18:47:29 2018 +0800 ceph: support cephfs' own feature bits Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 4de17aea5ceffe6d8350fde9d903a02037b221c6 Author: YueHaibing Date: Wed Aug 8 19:52:57 2018 +0800 crush: fix using plain integer as NULL warning Fixes the following sparse warnings: net/ceph/crush/mapper.c:517:76: warning: Using plain integer as NULL pointer net/ceph/crush/mapper.c:728:68: warning: Using plain integer as NULL pointer Signed-off-by: YueHaibing Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit bad87216fb8426302cd53a5fcfdd45c3a5d54383 Author: YueHaibing Date: Tue Aug 7 21:02:34 2018 +0800 libceph: remove unnecessary non NULL check for request_key request_key never return NULL,so no need do non-NULL check. Signed-off-by: YueHaibing Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit e5bc08d09f5fac5cd2901f34b510e67c524894ab Author: Chengguang Xu Date: Sat Jul 28 23:15:37 2018 +0800 ceph: refactor error handling code in ceph_reserve_caps() Call new helper __ceph_unreserve_caps() to reduce duplicated code. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 7bf8f736c8e0f2e854d41838eed12e317fb29963 Author: Chengguang Xu Date: Sat Jul 28 23:15:35 2018 +0800 ceph: refactor ceph_unreserve_caps() The code of ceph_unreserve_caps() and error handling in ceph_reserve_caps() are duplicated, so introduce a helper __ceph_unreserve_caps() to reduce duplicated code. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit d5548492902967dd088bd0a21df7d047df10f9f6 Author: Chengguang Xu Date: Sat Jul 28 16:30:48 2018 +0800 ceph: change to void return type for __do_request() We do not check return code for __do_request() in all callers, so change to void return type. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 9da12e3a7de1665a14063653b60e872da0ee7810 Author: Chengguang Xu Date: Thu Jul 19 22:15:27 2018 +0800 ceph: compare fsc->max_file_size and inode->i_size for max file size limit In ceph_llseek(), we compare fsc->max_file_size and inode->i_size to choose max file size limit. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 36a4c72d1c6f5f50d4db14a38f296855ae82571b Author: Chengguang Xu Date: Sun Aug 5 19:33:01 2018 +0800 ceph: add additional size check in ceph_setattr() ceph_setattr() finally calls vfs function inode_newsize_ok() to do offset validation and that is based on sb->s_maxbytes. Because we set sb->s_maxbytes to MAX_LFS_FILESIZE to through VFS check and do proper offset validation in cephfs level, we need adding proper offset validation before calling inode_newsize_ok(). Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 9ebcc22c1be80b090983caff218932593a1d58a7 Merge: 6d37fa49da1e fd5cf434a4b0 Author: David S. Miller Date: Mon Aug 13 08:49:37 2018 -0700 Merge branch 'nixge-Minor-cleanups' Moritz Fischer says: ==================== net: nixge: Minor cleanups in preparation of my 64-bit support series, here's some minor cleanup in preparation that gets rid of unneccesary accesses to the descriptor application fields. I've confirmed that the hardware does not access the fields in all our configurations. ==================== Signed-off-by: David S. Miller commit fd5cf434a4b0b25fc6f76b90373302a26d541ac8 Author: Moritz Fischer Date: Fri Aug 10 18:19:41 2018 -0700 net: nixge: Don't store skb in app4 field of descriptor Don't store skb in app4 field of descriptor since it is not being used anywhere (including hardware). Signed-off-by: Moritz Fischer Signed-off-by: David S. Miller commit e158770e22892f8f8e11810267e2a100d25d22c7 Author: Moritz Fischer Date: Fri Aug 10 18:19:40 2018 -0700 net: nixge: Do not zero application specific fields in desc Do not zero application specific fields in DMA descriptors. The hardware does ignore them, so should software. Signed-off-by: Moritz Fischer Signed-off-by: David S. Miller commit 6d37fa49da1e8db8fb1995be22ac837ca41ac8a8 Author: Wei Wang Date: Fri Aug 10 11:14:56 2018 -0700 l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache In l2tp code, if it is a L2TP_UDP_ENCAP tunnel, tunnel->sk points to a UDP socket. User could call sendmsg() on both this tunnel and the UDP socket itself concurrently. As l2tp_xmit_skb() holds socket lock and call __sk_dst_check() to refresh sk->sk_dst_cache, while udpv6_sendmsg() is lockless and call sk_dst_check() to refresh sk->sk_dst_cache, there could be a race and cause the dst cache to be freed multiple times. So we fix l2tp side code to always call sk_dst_check() to garantee xchg() is called when refreshing sk->sk_dst_cache to avoid race conditions. Syzkaller reported stack trace: BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_unless include/linux/atomic.h:575 [inline] BUG: KASAN: use-after-free in atomic_add_unless include/linux/atomic.h:597 [inline] BUG: KASAN: use-after-free in dst_hold_safe include/net/dst.h:308 [inline] BUG: KASAN: use-after-free in ip6_hold_safe+0xe6/0x670 net/ipv6/route.c:1029 Read of size 4 at addr ffff8801aea9a880 by task syz-executor129/4829 CPU: 0 PID: 4829 Comm: syz-executor129 Not tainted 4.18.0-rc7-next-20180802+ #30 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x30d mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272 atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] atomic_fetch_add_unless include/linux/atomic.h:575 [inline] atomic_add_unless include/linux/atomic.h:597 [inline] dst_hold_safe include/net/dst.h:308 [inline] ip6_hold_safe+0xe6/0x670 net/ipv6/route.c:1029 rt6_get_pcpu_route net/ipv6/route.c:1249 [inline] ip6_pol_route+0x354/0xd20 net/ipv6/route.c:1922 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2098 fib6_rule_lookup+0x283/0x890 net/ipv6/fib6_rules.c:122 ip6_route_output_flags+0x2c5/0x350 net/ipv6/route.c:2126 ip6_dst_lookup_tail+0x1278/0x1da0 net/ipv6/ip6_output.c:978 ip6_dst_lookup_flow+0xc8/0x270 net/ipv6/ip6_output.c:1079 ip6_sk_dst_lookup_flow+0x5ed/0xc50 net/ipv6/ip6_output.c:1117 udpv6_sendmsg+0x2163/0x36b0 net/ipv6/udp.c:1354 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x51d/0x930 net/socket.c:2115 __sys_sendmmsg+0x240/0x6f0 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2236 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x446a29 Code: e8 ac b8 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 eb 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4de5532db8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00000000006dcc38 RCX: 0000000000446a29 RDX: 00000000000000b8 RSI: 0000000020001b00 RDI: 0000000000000003 RBP: 00000000006dcc30 R08: 00007f4de5533700 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dcc3c R13: 00007ffe2b830fdf R14: 00007f4de55339c0 R15: 0000000000000001 Fixes: 71b1391a4128 ("l2tp: ensure sk->dst is still valid") Reported-by: syzbot+05f840f3b04f211bad55@syzkaller.appspotmail.com Signed-off-by: Wei Wang Signed-off-by: Martin KaFai Lau Cc: Guillaume Nault Cc: David Ahern Cc: Cong Wang Signed-off-by: David S. Miller commit e6f86b0f7ae473969a3301b74bf98af9e42ecd0e Author: Virgile Jarry Date: Fri Aug 10 17:48:15 2018 +0200 ipv6: Add icmp_echo_ignore_all support for ICMPv6 Preventing the kernel from responding to ICMP Echo Requests messages can be useful in several ways. The sysctl parameter 'icmp_echo_ignore_all' can be used to prevent the kernel from responding to IPv4 ICMP echo requests. For IPv6 pings, such a sysctl kernel parameter did not exist. Add the ability to prevent the kernel from responding to IPv6 ICMP echo requests through the use of the following sysctl parameter : /proc/sys/net/ipv6/icmp/echo_ignore_all. Update the documentation to reflect this change. Signed-off-by: Virgile Jarry Signed-off-by: David S. Miller commit 8f78004442202b4ee28657513d78e6bb937e877c Merge: 78cbac647e61 0b243d004ea6 Author: David S. Miller Date: Mon Aug 13 08:41:09 2018 -0700 Merge branch 'net-tls-Combined-memory-allocation-for-decryption-request' Vakul Garg says: ==================== net/tls: Combined memory allocation for decryption request This patch does a combined memory allocation from heap for scatterlists, aead_request, aad and iv for the tls record decryption path. In present code, aead_request is allocated from heap, scatterlists on a conditional basis are allocated on heap or on stack. This is inefficient as it may requires multiple kmalloc/kfree. The initialization vector passed in cryption request is allocated on stack. This is a problem since the stack memory is not dma-able from crypto accelerators. Doing one combined memory allocation for each decryption request fixes both the above issues. It also paves a way to be able to submit multiple async decryption requests while the previous one is pending i.e. being processed or queued. ==================== Signed-off-by: David S. Miller commit 0b243d004ea640875115d1500ec429a3e9f9fae9 Author: Vakul Garg Date: Fri Aug 10 20:46:41 2018 +0530 net/tls: Combined memory allocation for decryption request For preparing decryption request, several memory chunks are required (aead_req, sgin, sgout, iv, aad). For submitting the decrypt request to an accelerator, it is required that the buffers which are read by the accelerator must be dma-able and not come from stack. The buffers for aad and iv can be separately kmalloced each, but it is inefficient. This patch does a combined allocation for preparing decryption request and then segments into aead_req || sgin || sgout || iv || aad. Signed-off-by: Vakul Garg Signed-off-by: David S. Miller commit 4c42ae4f6ab78f9ce3fa7e66de44f666733288da Author: Atish Patra Date: Mon Aug 6 16:17:36 2018 -0700 RISC-V: Fix !CONFIG_SMP compilation error Enabling both CONFIG_PERF_EVENTS without !CONFIG_SMP generates following compilation error. arch/riscv/include/asm/perf_event.h:80:2: error: expected specifier-qualifier-list before 'irqreturn_t' irqreturn_t (*handle_irq)(int irq_num, void *dev); ^~~~~~~~~~~ Include interrupt.h in proper place to avoid compilation error. Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 8237f8bc4f6eb7e5ce2a19276079cfd3a7c6314a Author: Christoph Hellwig Date: Thu Jul 26 16:27:00 2018 +0200 irqchip: add a SiFive PLIC driver Add a driver for the SiFive implementation of the RISC-V Platform Level Interrupt Controller (PLIC). The PLIC connects global interrupt sources to the local interrupt controller on each hart. This driver is based on the driver in the RISC-V tree from Palmer Dabbelt, but has been almost entirely rewritten since, and includes many fixes from Atish Patra. Signed-off-by: Christoph Hellwig Acked-by: Thomas Gleixner Reviewed-by: Atish Patra [Binding update by Palmer] Signed-off-by: Palmer Dabbelt commit 94f592f0e5b9c17a7505119a2d6c0f1f529ae93d Author: Zong Li Date: Thu Aug 2 23:21:56 2018 +0800 RISC-V: Add the directive for alignment of stvec's value The stvec's value must be 4 byte alignment by specification definition. These directives avoid to stvec be set the non-alignment value. Signed-off-by: Zong Li Signed-off-by: Palmer Dabbelt commit 62b0194368147def8c5a77ce604a125d620fc582 Author: Palmer Dabbelt Date: Sat Aug 4 10:23:19 2018 +0200 clocksource: new RISC-V SBI timer driver The RISC-V ISA defines a per-hart real-time clock and timer, which is present on all systems. The clock is accessed via the 'rdtime' pseudo-instruction (which reads a CSR), and the timer is set via an SBI call. Contains various improvements from Atish Patra . Signed-off-by: Dmitriy Cherkasov Signed-off-by: Palmer Dabbelt [hch: remove dead code, add SPDX tags, used riscv_of_processor_hart(), minor cleanups, merged hotplug cpu support and other improvements from Atish] Signed-off-by: Christoph Hellwig Acked-by: Thomas Gleixner Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 6ea0f26a7913b2a72f9cbe84e77ad2cbeaaa9dde Author: Christoph Hellwig Date: Sat Aug 4 10:23:16 2018 +0200 RISC-V: implement low-level interrupt handling Add support for a routine that dispatches exceptions with the interrupt flags set to either the IPI or irqdomain code (and the clock source in the future). Loosely based on the irq-riscv-int.c irqchip driver from the RISC-V tree. Signed-off-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit bec2e6ac353d5c8a47c6eea639136bac3990093e Author: Christoph Hellwig Date: Sat Aug 4 10:23:15 2018 +0200 RISC-V: add a definition for the SIE SEIE bit This mirrors the SIE_SSIE and SETE bits that are used in a similar fashion. Signed-off-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit 4b40e9ddc892de508c3b3a3d82ee568c07c4308a Author: Christoph Hellwig Date: Sat Aug 4 10:23:14 2018 +0200 RISC-V: remove INTERRUPT_CAUSE_* defines from asm/irq.h These are only of use to the local irq controller driver, so add them in that driver implementation instead, which will be submitted soon. Signed-off-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit b9d5535746e306a456691177228a08f04b923a7b Author: Christoph Hellwig Date: Sat Aug 4 10:23:13 2018 +0200 RISC-V: simplify software interrupt / IPI code Rename handle_ipi to riscv_software_interrupt, drop the unused return value and move the prototype to irq.h together with riscv_timer_interupt. This allows simplifying the upcoming interrupt handling support. Signed-off-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit b9490350f751e5d17a24d0ae5af1f9e7f55c7c31 Author: Christoph Hellwig Date: Sat Aug 4 10:23:12 2018 +0200 RISC-V: remove timer leftovers This code is currently unused and will be added back later in a different place with the real interrupt and clocksource support. Signed-off-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit 5b5c2a2c44d7225ab3abbcc7e1881b97ea9872dd Author: Palmer Dabbelt Date: Fri Dec 8 15:10:35 2017 -0800 RISC-V: Add early printk support via the SBI console This code lives entirely within the RISC-V arch code. I've left it within an "#ifdef CONFIG_EARLY_PRINTK" despite always having EARLY_PRINTK support on RISC-V just in case someone wants to remove it. Reviewed-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit 758914fea278658943e3a56e4d373ae8c6f0d9e5 Author: Jim Wilson Date: Sat Jul 14 17:34:39 2018 -0700 RISC-V: Don't increment sepc after breakpoint. Adding 4 to sepc is pointless, and is wrong if we executed a 2-byte compressed breakpoint. This plus a corresponding gdb patch allows compressed breakpoints to work in gdb. Gdb maintainers have already agreed that this is the right approach. Signed-off-by: Jim Wilson Signed-off-by: Palmer Dabbelt commit a89757daf25cfe5320a5f40773271d86e2456c10 Author: Alex Guo Date: Sun Jul 29 01:14:47 2018 +0000 RISC-V: implement __lshrti3. Signed-off-by: Alex Guo Signed-off-by: Palmer Dabbelt commit 4938c79bd0f5f3650c8c2cd4cdc972f0a6962ce4 Author: Palmer Dabbelt Date: Wed Jul 4 14:07:14 2018 -0700 RISC-V: Use KBUILD_CFLAGS instead of KCFLAGS when building the vDSO If you use a 64-bit compiler to build a 32-bit kernel then you'll get an error when building the vDSO due to a library mismatch. The happens because the relevant "-march" argument isn't supplied to the GCC run that generates one of the vDSO intermediate files. I'm not actually sure what the right thing to do here is as I'm not particularly familiar with the kernel build system. I poked the documentation and it appears that KCFLAGS is the correct thing to do (it's suggested that should be used when building modules), but we set KBUILD_CFLAGS in arch/riscv/Makefile. This does at least fix the build error. Reviewed-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt commit c61b466d4f886613c7e71de8282701646a4d999d Merge: afc9f65e01cd 001a30c4d0e8 a3c0f84765bb Author: Russell King Date: Mon Aug 13 16:28:50 2018 +0100 Merge branches 'fixes', 'misc' and 'spectre' into for-linus Conflicts: arch/arm/include/asm/uaccess.h Signed-off-by: Russell King commit 53ccb22b8d4a9293cf4249f3b526892810038fd3 Author: Bartosz Golaszewski Date: Thu Jun 28 15:42:20 2018 +0100 ARM: 8778/1: clkdev: don't call __of_clk_get_by_name() unnecessarily from clk_get() The way this function is implemented caused some confusion when converting the TI DaVinci platform to using the common clock framework. Current kernel supports booting DaVinci boards both in device tree as well as legacy, board-file mode. In the latter, we always end up calling clk_get_sys() as of_node is NULL and __of_clk_get_by_name() returns -ENOENT. It was not obvious at first glance how clk_get(dev, NULL) will work in board-file mode since we always call __of_clk_get_by_name(). Let's make it clearer by checking if of_node is NULL and skipping right to clk_get_sys(). Cc: Sekhar Nori Cc: Kevin Hilman Cc: David Lechner Reviewed-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Bartosz Golaszewski Signed-off-by: Russell King commit f3b28362b683d8763e40ec9beee2f1d3bc616b8b Author: Krzysztof Kozlowski Date: Mon Aug 13 17:11:44 2018 +0200 irqchip/s3c24xx: Remove unneeded comparison of unsigned long to 0 irq_data->hwirq is unsigned long. This fixes GCC warning: drivers/irqchip/irq-s3c24xx.c: In function 's3c_irqext0_type': drivers/irqchip/irq-s3c24xx.c:253:19: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] if ((data->hwirq >= 0) && (data->hwirq <= 3)) { ^~ Signed-off-by: Krzysztof Kozlowski Signed-off-by: Marc Zyngier commit 4ce719f846a4177f2631e4149503e3baf3dce87b Author: Jason Gunthorpe Date: Thu Aug 9 20:14:44 2018 -0600 IB/uverbs: Do not check for device disassociation during ioctl Now that the ioctl path and uobjects are converted to use uverbs_api, it is now safe to remove the disassociation protection from the common ioctl code. This completes the work to make destroy functions continue to work even after device disassociation. Signed-off-by: Jason Gunthorpe commit 51d0a2b4cfa9979fd8a59faf483b4e84587ab4ea Author: Jason Gunthorpe Date: Thu Aug 9 20:14:43 2018 -0600 IB/uverbs: Remove struct uverbs_root_spec and all supporting code Everything now uses the uverbs_uapi data structure. Signed-off-by: Jason Gunthorpe commit 3a863577a7496278892360a69d90d8465733100c Author: Jason Gunthorpe Date: Thu Aug 9 20:14:42 2018 -0600 IB/uverbs: Use uverbs_api to unmarshal ioctl commands Convert the ioctl method syscall path to use the uverbs_api data structures. The new uapi structure includes all the same information, just in a different and more optimal way. - Use attr_bkey instead of 2 level radix trees for everything related to attributes. This includes the attribute storage, presence, and detection of missing mandatory attributes. - Avoid iterating over all attribute storage at finish, instead use find_first_bit with the attr_bkey to locate only those attrs that need cleanup. - Organize things to always run, and always rely on, cleanup. This avoids a bunch of tricky error unwind cases. - Locate the method using the radix tree, and locate the attributes using a very efficient incremental radix tree lookup - Use the precomputed destroy_bkey to handle uobject destruction - Use the precomputed allocation sizes and precomputed 'need_stack' to avoid maths in the fast path. This is optimal if userspace does not pass (many) unsupported attributes. Overall this results in much better codegen for the attribute accessors, everything is now stored in bitmaps or linear arrays indexed by attr_bkey. The compiler can compute attr_bkey values at compile time for all method attributes, meaning things like uverbs_attr_is_valid() now compile into single instruction bit tests. Signed-off-by: Jason Gunthorpe commit b61815e241652096b61f59ca2063edecb23602a2 Author: Jason Gunthorpe Date: Thu Aug 9 20:14:41 2018 -0600 IB/uverbs: Use uverbs_alloc for allocations Several handlers need temporary allocations for the life of the method, switch them to use the uverbs_alloc allocator. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky commit 461bb2eee4e162617e790c74d9b4ab10056cad7f Author: Jason Gunthorpe Date: Thu Aug 9 20:14:40 2018 -0600 IB/uverbs: Add a simple allocator to uverbs_attr_bundle This is similar in spirit to devm, it keeps track of any allocations linked to this method call and ensures they are all freed when the method exits. Further, if there is space in the internal/onstack buffer then the allocator will hand out that memory and avoid an expensive call to kalloc/kfree in the syscall path. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky commit 00d22a1c367d03f469f8e1e924b062b09b0545e8 Author: Darrick J. Wong Date: Fri Aug 10 17:55:56 2018 -0700 xfs: recalculate summary counters at mount time if icount is bad Since the sb write verifier trips on bad icounts, we should also force a mount time recalculation of the summary counters if the icount is bad. This helps us avoid blowing up at freeze/unmount time when the bad counter gets written back out. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino commit 976d34e2dab10ece5ea8fe7090b7692913f89084 Author: Punit Agrawal Date: Mon Aug 13 11:43:51 2018 +0100 KVM: arm/arm64: Skip updating PTE entry if no change When there is contention on faulting in a particular page table entry at stage 2, the break-before-make requirement of the architecture can lead to additional refaulting due to TLB invalidation. Avoid this by skipping a page table update if the new value of the PTE matches the previous value. Cc: stable@vger.kernel.org Fixes: d5d8184d35c9 ("KVM: ARM: Memory virtualization setup") Reviewed-by: Suzuki Poulose Acked-by: Christoffer Dall Signed-off-by: Punit Agrawal Signed-off-by: Marc Zyngier commit 86658b819cd0a9aa584cd84453ed268a6f013770 Author: Punit Agrawal Date: Mon Aug 13 11:43:50 2018 +0100 KVM: arm/arm64: Skip updating PMD entry if no change Contention on updating a PMD entry by a large number of vcpus can lead to duplicate work when handling stage 2 page faults. As the page table update follows the break-before-make requirement of the architecture, it can lead to repeated refaults due to clearing the entry and flushing the tlbs. This problem is more likely when - * there are large number of vcpus * the mapping is large block mapping such as when using PMD hugepages (512MB) with 64k pages. Fix this by skipping the page table update if there is no change in the entry being updated. Cc: stable@vger.kernel.org Fixes: ad361f093c1e ("KVM: ARM: Support hugetlbfs backed huge pages") Reviewed-by: Suzuki Poulose Acked-by: Christoffer Dall Signed-off-by: Punit Agrawal Signed-off-by: Marc Zyngier commit f11b9abc9318d5506f08156b4950c24e3cba73e5 Author: Harish Jenny K N Date: Thu Jul 19 17:24:04 2018 +0530 Documentation: remove dynamic-resolution-notes reference to non-existent file File dt-object-internal.txt does not exist. This patch removes a reference to it. Signed-off-by: Harish Jenny K N Reviewed-by: Frank Rowand Signed-off-by: Rob Herring commit 330ad75f6a79d46f11f7bf8937852ebb4673b1d5 Author: Dan Carpenter Date: Mon Aug 13 12:32:35 2018 +0300 Bluetooth: mediatek: pass correct size to h4_recv_buf() We're supposed to pass the number of elements in the mtk_recv_pkts, not the number of bytes. Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices") Signed-off-by: Dan Carpenter Signed-off-by: Marcel Holtmann commit f5b6c1fcb42fe7d6f2f6eb2220512e2a5f875133 Merge: 73b383141d29 4aa5db22d355 Author: Takashi Iwai Date: Mon Aug 13 12:12:31 2018 +0200 Merge tag 'asoc-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v4.19 A fairly big update, including quite a bit of core activity this time around (which is good to see) along with a fairly large set of new drivers. - A new snd_pcm_stop_xrun() helper which is now used in several drivers. - Support for providing name prefixes to generic component nodes. - Quite a few fixes for DPCM as it gains a bit wider use and more robust testing. - Generalization of the DIO2125 support to a simple amplifier driver. - Accessory detection support for the audio graph card. - DT support for PXA AC'97 devices. - Quirks for a number of new x86 systems. - Support for AM Logic Meson, Everest ES7154, Intel systems with RT5682, Qualcomm QDSP6 and WCD9335, Realtek RT5682 and TI TAS5707. commit 4096165d55218a6f58b6c2ebc5d2428aa0aa70e4 Author: Dan Carpenter Date: Wed Aug 8 15:03:19 2018 +0300 irqchip/stm32: Fix init error handling If there are any errors in stm32_exti_host_init() then it leads to a NULL dereference in the callers. The function should clean up after itself. Fixes: f9fc1745501e ("irqchip/stm32: Add host and driver data structures") Reviewed-by: Ludovic Barre Signed-off-by: Dan Carpenter Signed-off-by: Marc Zyngier commit 0702bc4d2fe793018ad9aa0eb14bff7f526c4095 Author: Jonas Gorski Date: Thu Aug 9 10:59:01 2018 +0200 irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP When compiling bmips with SMP disabled, the build fails with: drivers/irqchip/irq-bcm7038-l1.o: In function `bcm7038_l1_cpu_offline': drivers/irqchip/irq-bcm7038-l1.c:242: undefined reference to `irq_set_affinity_locked' make[5]: *** [vmlinux] Error 1 Fix this by adding and setting bcm7038_l1_cpu_offline only when actually compiling for SMP. It wouldn't have been used anyway, as it requires CPU_HOTPLUG, which in turn requires SMP. Fixes: 34c535793bcb ("irqchip/bcm7038-l1: Implement irq_cpu_offline() callback") Signed-off-by: Jonas Gorski Signed-off-by: Marc Zyngier commit c8921d72e390cb6fca3fb2b0c2badfda851647eb Author: Helge Deller Date: Sun Aug 5 00:03:29 2018 +0200 parisc: Fix and improve kernel stack unwinding This patchset fixes and improves stack unwinding a lot: 1. Show backward stack traces with up to 30 callsites 2. Add callinfo to ENTRY_CFI() such that every assembler function will get an entry in the unwind table 3. Use constants instead of numbers in call_on_stack() 4. Do not depend on CONFIG_KALLSYMS to generate backtraces. 5. Speed up backtrace generation Make sure you have this patch to GNU as installed: https://sourceware.org/ml/binutils/2018-07/msg00474.html Without this patch, unwind info in the kernel is often wrong for various functions. Signed-off-by: Helge Deller commit 3b885ac1dc35b87a39ee176a6c7e2af9c789d8b8 Author: John David Anglin Date: Sun Aug 12 16:31:17 2018 -0400 parisc: Remove unnecessary barriers from spinlock.h Now that mb() is an instruction barrier, it will slow performance if we issue unnecessary barriers. The spinlock defines have a number of unnecessary barriers.  The __ldcw() define is both a hardware and compiler barrier.  The mb() barriers in the routines using __ldcw() serve no purpose. The only barrier needed is the one in arch_spin_unlock().  We need to ensure all accesses are complete prior to releasing the lock. Signed-off-by: John David Anglin Cc: stable@vger.kernel.org # 4.0+ Signed-off-by: Helge Deller commit 7797167ffde1f00446301cb22b37b7c03194cfaf Author: John David Anglin Date: Sun Aug 12 16:38:03 2018 -0400 parisc: Remove ordered stores from syscall.S Now that we use a sync prior to releasing the locks in syscall.S, we don't need the PA 2.0 ordered stores used to release some locks.  Using an ordered store, potentially slows the release and subsequent code. There are a number of other ordered stores and loads that serve no purpose.  I have converted these to normal stores. Signed-off-by: John David Anglin Cc: stable@vger.kernel.org # 4.0+ Signed-off-by: Helge Deller commit 4a53ec1ccf932f86845c96a5092ba4507621c84d Author: Nick Desaulniers Date: Wed Aug 1 11:22:56 2018 -0700 parisc: prefer _THIS_IP_ and _RET_IP_ statement expressions As part of the effort to reduce the code duplication between _THIS_IP_ and current_text_addr(), let's consolidate callers of current_text_addr() to use _THIS_IP_. Signed-off-by: Nick Desaulniers Signed-off-by: Helge Deller commit 75ebedf1d26376cafad87b43196c15161463b82a Author: Helge Deller Date: Thu Jun 28 22:47:11 2018 +0200 parisc: Add HAVE_REGS_AND_STACK_ACCESS_API feature Some parts of the HAVE_REGS_AND_STACK_ACCESS_API feature is needed for the rseq syscall. This patch adds the most important parts, and as long as we don't support kprobes, we should be fine. Signed-off-by: Helge Deller commit 93cb8e20d56be40c541475f77b5f565fbb385a4b Author: Helge Deller Date: Sun Jul 1 18:18:15 2018 +0200 parisc: Drop architecture-specific ENOTSUP define parisc is the only Linux architecture which has defined a value for ENOTSUP. All other architectures #define ENOTSUP as EOPNOTSUPP in their libc headers. Having an own value for ENOTSUP which is different than EOPNOTSUPP often gives problems with userspace programs which expect both to be the same. One such example is a build error in the libuv package, as can be seen in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900237. Since we dropped HP-UX support, there is no real benefit in keeping an own value for ENOTSUP. This patch drops the parisc value for ENOTSUP from the kernel sources. glibc needs no patch, it reuses the exported headers. Signed-off-by: Helge Deller commit c1f59375b3782f478ac2c488889abdc00dd8e25f Author: Christoph Hellwig Date: Tue Jun 19 09:04:55 2018 +0200 parisc: use generic dma_noncoherent_ops Switch to the generic noncoherent direct mapping implementation. Fix sync_single_for_cpu to do skip the cache flush unless the transfer is to the device to match the more tested unmap_single path which should have the same cache coherency implications. Signed-off-by: Christoph Hellwig Signed-off-by: Helge Deller commit 7f1501053811414ddeff63db8f5d41bdbe38068f Author: Christoph Hellwig Date: Tue Jun 19 09:04:54 2018 +0200 parisc: always use flush_kernel_dcache_range for DMA cache maintainance Current the S/G list based DMA ops use flush_kernel_vmap_range which contains a few UP optimizations, while the rest of the DMA operations uses flush_kernel_dcache_range. The single vs sg operations are supposed to have the same effect, so they should use the same routines. Use the more conservation version for now, but if people more familiar with parisc think the vmap version is generally fine for DMA we should switch all interfaces over to it. Signed-off-by: Christoph Hellwig Signed-off-by: Helge Deller commit a34a9b9682a5a9de53386ed0872c7d38ca9d6b38 Author: Christoph Hellwig Date: Tue Jun 19 09:04:53 2018 +0200 parisc: merge pcx_dma_ops and pcxl_dma_ops The only difference is that pcxl supports dma coherent allocations, while pcx only supports non-consistent allocations and otherwise fails. But dma_alloc* is not in the fast path, and merging these two allows an easy migration path to the generic dma-noncoherent implementation, so do it. Signed-off-by: Christoph Hellwig Signed-off-by: Helge Deller commit a2dc009afa9ae8b92305be7728676562a104cb40 Author: Aneesh Kumar K.V Date: Mon Aug 13 11:14:57 2018 +0530 powerpc/mm/book3s/radix: Add mapping statistics Add statistics that show how memory is mapped within the kernel linear mapping. This is similar to commit 37cd944c8d8f ("s390/pgtable: add mapping statistics") We don't do this with Hash translation mode. Hash uses one size (mmu_linear_psize) to map the kernel linear mapping and we print the linear psize during boot as below. "Page orders: linear mapping = 24, virtual = 16, io = 16, vmemmap = 24" A sample output looks like: DirectMap4k: 0 kB DirectMap64k: 18432 kB DirectMap2M: 1030144 kB DirectMap1G: 11534336 kB Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit 241b5f7ffcbe6b93304c6a282e5a339e22dac5b4 Merge: 70b5c4ee8e3b bd96461249bd Author: Michael Ellerman Date: Mon Aug 13 16:06:23 2018 +1000 Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux into next Merge some updates from Scott: "This contains an 8xx compilation fix, and a dpaa device tree fix." commit 70b5c4ee8e3bf7ce107d6926d9c7d8ebb68578c2 Merge: b3124ec2f997 9f65b81f36e3 Author: Michael Ellerman Date: Mon Aug 13 16:04:10 2018 +1000 Merge branch 'topic/hvc' into next This branch held some hvc related commits (Hypervisor Virtual Console) so that they could get some wider testing in linux-next before merging. commit b3124ec2f9970c7374d34b00843d9791fca66afc Merge: f7a6947cd49b cca19f0b684f Author: Michael Ellerman Date: Mon Aug 13 15:59:06 2018 +1000 Merge branch 'fixes' into next Merge our fixes branch from the 4.18 cycle to resolve some minor conflicts. commit f9090d4c22130c861b9e00e063812ac69d93a4a2 Author: Hang Yuan Date: Tue Aug 7 18:29:21 2018 +0800 drm/i915/gvt: free workload in vgpu release Some workloads may be prepared in vgpu's queue but not be scheduled to run yet. If vgpu is released at this time, they will not be freed in workload complete callback and so need to be freed in vgpu release operation. Add new vgpu_release operation in gvt_ops to stop vgpu and release runtime resources. gvt_ops vgpu_deactivate operation will only stop vgpu. v2: add new gvt ops to clean vgpu running status (Xiong Zhang) Signed-off-by: Hang Yuan Reviewed-by: Xiong Zhang Signed-off-by: Zhenyu Wang commit 56869d45e364244a721de34ce9c5dc9ed022779e Author: Masahiro Yamada Date: Thu Aug 9 15:47:06 2018 +0900 kconfig: fix the rule of mainmenu_stmt symbol The rule of mainmenu_stmt does not have debug print of zconf_lineno(), but if it had, it would print a wrong line number for the same reason as commit b2d00d7c61c8 ("kconfig: fix line numbers for if-entries in menu tree"). The mainmenu_stmt does not need to eat following empty lines because they are reduced to common_stmt. Signed-off-by: Masahiro Yamada commit edcd9d977354304cb85aee61c2b96809edce41ed Author: piaojun Date: Fri Aug 3 17:22:20 2018 +0800 net/9p/trans_virtio.c: add null terminal for mount tag chan->tag is Non-null terminated which will result in printing messy code when debugging code. So we should add '\0' for tag to make the code more convenient and robust. In addition, I drop char->tag_len to simplify the code. Link: http://lkml.kernel.org/r/5B641ECC.5030401@huawei.com Signed-off-by: Jun Piao Signed-off-by: Dominique Martinet commit 23cba9cbde0bba05d772b335fe5f66aa82b9ad19 Author: jiangyiwen Date: Fri Aug 3 12:11:34 2018 +0800 9p/virtio: fix off-by-one error in sg list bounds check Because the value of limit is VIRTQUEUE_NUM, if index is equal to limit, it will cause sg array out of bounds, so correct the judgement of BUG_ON. Link: http://lkml.kernel.org/r/5B63D5F6.6080109@huawei.com Signed-off-by: Yiwen Jiang Reported-By: Dan Carpenter Acked-by: Jun Piao Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet commit c69f297d7f0b46187919d5c2aa36183688ecf3d4 Author: Stephen Hemminger Date: Tue Jul 24 12:29:10 2018 -0700 9p: fix whitespace issues Remove trailing whitespace and blank lines at EOF Link: http://lkml.kernel.org/m/20180724192918.31165-11-sthemmin@microsoft.com Signed-off-by: Stephen Hemminger Signed-off-by: Dominique Martinet commit 10aa14527f458e9867cf3d2cc6b8cb0f6704448b Author: Tomas Bortoli Date: Fri Jul 27 13:05:58 2018 +0200 9p: fix multiple NULL-pointer-dereferences Added checks to prevent GPFs from raising. Link: http://lkml.kernel.org/r/20180727110558.5479-1-tomasbortoli@gmail.com Signed-off-by: Tomas Bortoli Reported-by: syzbot+1a262da37d3bead15c39@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet commit 3111784bee81591ea2815011688d28b65df03627 Author: piaojun Date: Wed Jul 25 11:13:16 2018 +0800 fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed In my testing, v9fs_fid_xattr_set will return successfully even if the backend ext4 filesystem has no space to store xattr key-value. That will cause inconsistent behavior between front end and back end. The reason is that lsetxattr will be triggered by p9_client_clunk, and unfortunately we did not catch the error. This patch will catch the error to notify upper caller. p9_client_clunk (in 9p) p9_client_rpc(clnt, P9_TCLUNK, "d", fid->fid); v9fs_clunk (in qemu) put_fid free_fid v9fs_xattr_fid_clunk v9fs_co_lsetxattr s->ops->lsetxattr ext4_xattr_user_set (in host ext4 filesystem) Link: http://lkml.kernel.org/r/5B57EACC.2060900@huawei.com Signed-off-by: Jun Piao Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Cc: Andrew Morton Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet commit f984579a01d85166ee7380204a96d978a67687a1 Author: Tomas Bortoli Date: Mon Jul 23 17:44:04 2018 +0200 9p: validate PDU length This commit adds length check for the PDU size. The size contained in the header has to match the actual size, except for TCP (trans_fd.c) where actual length is not known ahead and the header's length will be checked only against the validity range. Link: http://lkml.kernel.org/r/20180723154404.2406-1-tomasbortoli@gmail.com Signed-off-by: Tomas Bortoli Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com To: Eric Van Hensbergen To: Ron Minnich To: Latchesar Ionkov Cc: David S. Miller Signed-off-by: Dominique Martinet commit 9f476d7c540cb57556d3cc7e78704e6cd5100f5f Author: Tomas Bortoli Date: Mon Jul 23 20:42:53 2018 +0200 net/9p/trans_fd.c: fix race by holding the lock It may be possible to run p9_fd_cancel() with a deleted req->req_list and incur in a double del. To fix hold the client->lock while changing the status, so the other threads will be synchronized. Link: http://lkml.kernel.org/r/20180723184253.6682-1-tomasbortoli@gmail.com Signed-off-by: Tomas Bortoli Reported-by: syzbot+735d926e9d1317c3310c@syzkaller.appspotmail.com To: Eric Van Hensbergen To: Ron Minnich To: Latchesar Ionkov Cc: Yiwen Jiang Cc: David S. Miller Signed-off-by: Dominique Martinet commit 430ac66eb4c5b5c4eb846b78ebf65747510b30f1 Author: Tomas Bortoli Date: Fri Jul 20 11:27:30 2018 +0200 net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree() The patch adds the flush in p9_mux_poll_stop() as it the function used by p9_conn_destroy(), in turn called by p9_fd_close() to stop the async polling associated with the data regarding the connection. Link: http://lkml.kernel.org/r/20180720092730.27104-1-tomasbortoli@gmail.com Signed-off-by: Tomas Bortoli Reported-by: syzbot+39749ed7d9ef6dfb23f6@syzkaller.appspotmail.com To: Eric Van Hensbergen To: Ron Minnich To: Latchesar Ionkov Cc: Yiwen Jiang Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet commit 31934da810365f603dec5a67e690e00cf900fc73 Author: jiangyiwen Date: Thu Jul 19 15:17:00 2018 +0800 net/9p/virtio: Fix hard lockup in req_done When client has multiple threads that issue io requests all the time, and the server has a very good performance, it may cause cpu is running in the irq context for a long time because it can check virtqueue has buf in the *while* loop. So we should keep chan->lock in the whole loop. [ Dominique: reworded subject line ] Link: http://lkml.kernel.org/r/5B503AEC.5080404@huawei.com Signed-off-by: Yiwen Jiang To: Andrew Morton To: Eric Van Hensbergen To: Ron Minnich To: Latchesar Ionkov Signed-off-by: Dominique Martinet commit c7ebbae7cf9c50253a978f25d72d16e012bd46f1 Author: piaojun Date: Wed Jul 18 11:45:29 2018 +0800 net/9p/trans_virtio.c: fix some spell mistakes in comments Fix spelling mistake in comments of p9_virtio_zc_request(). Link: http://lkml.kernel.org/r/5B4EB7D9.9010108@huawei.com Signed-off-by: Jun Piao Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Cc: Andrew Morton Signed-off-by: Dominique Martinet commit d28c756caee6e414d9ba367d0b92da24145af2a8 Author: Chirantan Ekbote Date: Mon Jul 16 17:35:29 2018 -0700 9p/net: Fix zero-copy path in the 9p virtio transport The zero-copy optimization when reading or writing large chunks of data is quite useful. However, the 9p messages created through the zero-copy write path have an incorrect message size: it should be the size of the header + size of the data being written but instead it's just the size of the header. This only works if the server ignores the size field of the message and otherwise breaks the framing of the protocol. Fix this by re-writing the message size field with the correct value. Tested by running `dd if=/dev/zero of=out bs=4k count=1` inside a virtio-9p mount. Link: http://lkml.kernel.org/r/20180717003529.114368-1-chirantan@chromium.org Signed-off-by: Chirantan Ekbote Reviewed-by: Greg Kurz Tested-by: Greg Kurz Cc: Dylan Reid Cc: Guenter Roeck Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet commit 2557d0c57c0c11af915d0d4d97402527958c0c01 Author: Matthew Wilcox Date: Wed Jul 11 14:02:23 2018 -0700 9p: Embed wait_queue_head into p9_req_t On a 64-bit system, the wait_queue_head_t is 24 bytes while the pointer to it is 8 bytes. Growing the p9_req_t by 16 bytes is better than performing a 24-byte memory allocation. Link: http://lkml.kernel.org/r/20180711210225.19730-5-willy@infradead.org Signed-off-by: Matthew Wilcox Reviewed-by: Greg Kurz Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Dominique Martinet commit f28cdf0430fc92acaa718e15598bdad6cb236a4d Author: Matthew Wilcox Date: Wed Jul 11 14:02:22 2018 -0700 9p: Replace the fidlist with an IDR The p9_idpool being used to allocate the IDs uses an IDR to allocate the IDs ... which we then keep in a doubly-linked list, rather than in the IDR which allocated them. We can use an IDR directly which saves two pointers per p9_fid, and a tiny memory allocation per p9_client. Link: http://lkml.kernel.org/r/20180711210225.19730-4-willy@infradead.org Signed-off-by: Matthew Wilcox Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Dominique Martinet commit b5303be2bee3c8b29de3f7f4ea8ae00c4e816760 Author: Matthew Wilcox Date: Wed Jul 11 14:02:21 2018 -0700 9p: Change p9_fid_create calling convention Return NULL instead of ERR_PTR when we can't allocate a FID. The ENOSPC return value was getting all the way back to userspace, and that's confusing for a userspace program which isn't expecting read() to tell it there's no space left on the filesystem. The best error we can return to indicate a temporary failure caused by lack of client resources is ENOMEM. Maybe it would be better to sleep until a FID is available, but that's not a change I'm comfortable making. Link: http://lkml.kernel.org/r/20180711210225.19730-3-willy@infradead.org Signed-off-by: Matthew Wilcox Reviewed-by: Jun Piao Reviewed-by: Greg Kurz Reviewed-by: Yiwen Jiang Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Dominique Martinet commit 2d58f63f72f28ba297a9ae344a5b5f0cf75bcd94 Author: Matthew Wilcox Date: Wed Jul 11 14:02:20 2018 -0700 9p: Fix comment on smp_wmb The previous comment misled me into thinking the barrier wasn't needed at all. Link: http://lkml.kernel.org/r/20180711210225.19730-2-willy@infradead.org Signed-off-by: Matthew Wilcox Reviewed-by: Greg Kurz Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Dominique Martinet commit 7913690dcc5e18e235769fd87c34143072f5dbea Author: Tomas Bortoli Date: Tue Jul 10 00:29:43 2018 +0200 net/9p/client.c: version pointer uninitialized The p9_client_version() does not initialize the version pointer. If the call to p9pdu_readf() returns an error and version has not been allocated in p9pdu_readf(), then the program will jump to the "error" label and will try to free the version pointer. If version is not initialized, free() will be called with uninitialized, garbage data and will provoke a crash. Link: http://lkml.kernel.org/r/20180709222943.19503-1-tomasbortoli@gmail.com Signed-off-by: Tomas Bortoli Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com Reviewed-by: Jun Piao Reviewed-by: Yiwen Jiang Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet commit 6baaac096179e7f49b7c3d1bc7785d7cd88215ee Author: Colin Ian King Date: Tue Jul 17 19:14:49 2018 -0700 fs/9p/v9fs.c: fix spelling mistake "Uknown" -> "Unknown" fix spelling mistake in pr_info message text Link: http://lkml.kernel.org/r/20180526150650.10562-1-colin.king@canonical.com Signed-off-by: Colin Ian King Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Dominique Martinet commit 92aef4675d5b1b55404e1532379e343bed0e5cf2 Author: Jean-Philippe Brucker Date: Tue Jul 17 19:14:45 2018 -0700 net/9p: fix error path of p9_virtio_probe Currently when virtio_find_single_vq fails, we go through del_vqs which throws a warning (Trying to free already-free IRQ). Skip del_vqs if vq allocation failed. Link: http://lkml.kernel.org/r/20180524101021.49880-1-jean-philippe.brucker@arm.com Signed-off-by: Jean-Philippe Brucker Reviewed-by: Greg Kurz Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Dominique Martinet commit b87d1d26521ef9f2e42bb182184d1427b4e07b26 Author: piaojun Date: Wed Jul 11 08:43:49 2018 +0800 9p/net/protocol.c: return -ENOMEM when kmalloc() failed We should return -ENOMEM to upper user when kmalloc failed to indicate accurate errno. Link: http://lkml.kernel.org/r/5B4552C5.60000@huawei.com Signed-off-by: Jun Piao Reviewed-by: Yiwen Jiang Reviewed-by: Andrew Morton Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Dominique Martinet commit 64ad31f3284060d59850da6d573ddbab542365cf Author: piaojun Date: Tue Jul 10 14:56:26 2018 +0800 net/9p/client.c: add missing '\n' at the end of p9_debug() In p9_client_getattr_dotl(), we should add '\n' at the end of printing log. Link: http://lkml.kernel.org/r/5B44589A.50302@huawei.com Signed-off-by: Jun Piao Reviewed-by: Yiwen Jiang Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Dominique Martinet commit fe6340e2d1f5ef9ebb9a82665b053c362837cbd6 Author: Souptick Joarder Date: Tue Jul 17 19:14:35 2018 -0700 fs/9p/vfs_file.c: use new return type vm_fault_t Use new return type vm_fault_t for page_mkwrite handler. See 1c8f422059ae ("mm: change return type to vm_fault_t") for reference. Link: http://lkml.kernel.org/r/20180702154928.GA3964@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Acked-by: Jun Piao Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Dominique Martinet commit 2ce3206b9eb3943de09f3bf4ec9134568420d8b9 Merge: e8d2bec04579 5ecd8c22739b Author: Daniel Borkmann Date: Mon Aug 13 01:02:40 2018 +0200 Merge branch 'bpf-ancestor-cgroup-id' Andrey Ignatov says: ==================== This patch set adds new BPF helper bpf_skb_ancestor_cgroup_id that returns id of cgroup v2 that is ancestor of cgroup associated with the skb at the ancestor_level. The helper is useful to implement policies in TC based on cgroups that are upper in hierarchy than immediate cgroup associated with skb. v1->v2: - more reliable check for testing IPv6 to become ready in selftest. ==================== Signed-off-by: Daniel Borkmann commit 5ecd8c22739b9a5f6d6431234decd912aa3f48ad Author: Andrey Ignatov Date: Sun Aug 12 10:49:30 2018 -0700 selftests/bpf: Selftest for bpf_skb_ancestor_cgroup_id Add selftests for bpf_skb_ancestor_cgroup_id helper. test_skb_cgroup_id.sh prepares testing interface and adds tc qdisc and filter for it using BPF object compiled from test_skb_cgroup_id_kern.c program. BPF program in test_skb_cgroup_id_kern.c gets ancestor cgroup id using the new helper at different levels of cgroup hierarchy that skb belongs to, including root level and non-existing level, and saves it to the map where the key is the level of corresponding cgroup and the value is its id. To trigger BPF program, user space program test_skb_cgroup_id_user is run. It adds itself into testing cgroup and sends UDP datagram to link-local multicast address of testing interface. Then it reads cgroup ids saved in kernel for different levels from the BPF map and compares them with those in user space. They must be equal for every level of ancestry. Example of run: # ./test_skb_cgroup_id.sh Wait for testing link-local IP to become available ... OK Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch! [PASS] Signed-off-by: Andrey Ignatov Signed-off-by: Daniel Borkmann commit 02f6ac7456a0d77360cb47b8d2ed4366b883096d Author: Andrey Ignatov Date: Sun Aug 12 10:49:29 2018 -0700 selftests/bpf: Add cgroup id helpers to bpf_helpers.h Add bpf_skb_cgroup_id and bpf_skb_ancestor_cgroup_id helpers to bpf_helpers.h to use them in tests and samples. Signed-off-by: Andrey Ignatov Signed-off-by: Daniel Borkmann commit 539764d07b49c5b322cc065d275f65df275e4991 Author: Andrey Ignatov Date: Sun Aug 12 10:49:28 2018 -0700 bpf: Sync bpf.h to tools/ Sync skb_ancestor_cgroup_id() related bpf UAPI changes to tools/. Signed-off-by: Andrey Ignatov Signed-off-by: Daniel Borkmann commit 7723628101aaeb1d723786747529b4ea65c5b5c5 Author: Andrey Ignatov Date: Sun Aug 12 10:49:27 2018 -0700 bpf: Introduce bpf_skb_ancestor_cgroup_id helper == Problem description == It's useful to be able to identify cgroup associated with skb in TC so that a policy can be applied to this skb, and existing bpf_skb_cgroup_id helper can help with this. Though in real life cgroup hierarchy and hierarchy to apply a policy to don't map 1:1. It's often the case that there is a container and corresponding cgroup, but there are many more sub-cgroups inside container, e.g. because it's delegated to containerized application to control resources for its subsystems, or to separate application inside container from infra that belongs to containerization system (e.g. sshd). At the same time it may be useful to apply a policy to container as a whole. If multiple containers like this are run on a host (what is often the case) and many of them have sub-cgroups, it may not be possible to apply per-container policy in TC with existing helpers such as bpf_skb_under_cgroup or bpf_skb_cgroup_id: * bpf_skb_cgroup_id will return id of immediate cgroup associated with skb, i.e. if it's a sub-cgroup inside container, it can't be used to identify container's cgroup; * bpf_skb_under_cgroup can work only with one cgroup and doesn't scale, i.e. if there are N containers on a host and a policy has to be applied to M of them (0 <= M <= N), it'd require M calls to bpf_skb_under_cgroup, and, if M changes, it'd require to rebuild & load new BPF program. == Solution == The patch introduces new helper bpf_skb_ancestor_cgroup_id that can be used to get id of cgroup v2 that is an ancestor of cgroup associated with skb at specified level of cgroup hierarchy. That way admin can place all containers on one level of cgroup hierarchy (what is a good practice in general and already used in many configurations) and identify specific cgroup on this level no matter what sub-cgroup skb is associated with. E.g. if there is a cgroup hierarchy: root/ root/container1/ root/container1/app11/ root/container1/app11/sub-app-a/ root/container1/app12/ root/container2/ root/container2/app21/ root/container2/app22/ root/container2/app22/sub-app-b/ , then having skb associated with root/container1/app11/sub-app-a/ it's possible to get ancestor at level 1, what is container1 and apply policy for this container, or apply another policy if it's container2. Policies can be kept e.g. in a hash map where key is a container cgroup id and value is an action. Levels where container cgroups are created are usually known in advance whether cgroup hierarchy inside container may be hard to predict especially in case when its creation is delegated to containerized application. == Implementation details == The helper gets ancestor by walking parents up to specified level. Another option would be to get different kind of "id" from cgroup->ancestor_ids[level] and use it with idr_find() to get struct cgroup for ancestor. But that would require radix lookup what doesn't seem to be better (at least it's not obviously better). Format of return value of the new helper is same as that of bpf_skb_cgroup_id. Signed-off-by: Andrey Ignatov Signed-off-by: Daniel Borkmann commit e8d2bec0457962e8f348a9a3627b398f7fe5c5fc Author: Daniel Borkmann Date: Sun Aug 12 01:59:17 2018 +0200 bpf: decouple btf from seq bpf fs dump and enable more maps Commit a26ca7c982cb ("bpf: btf: Add pretty print support to the basic arraymap") and 699c86d6ec21 ("bpf: btf: add pretty print for hash/lru_hash maps") enabled support for BTF and dumping via BPF fs for array and hash/lru map. However, both can be decoupled from each other such that regular BPF maps can be supported for attaching BTF key/value information, while not all maps necessarily need to dump via map_seq_show_elem() callback. The basic sanity check which is a prerequisite for all maps is that key/value size has to match in any case, and some maps can have extra checks via map_check_btf() callback, e.g. probing certain types or indicating no support in general. With that we can also enable retrieving BTF info for per-cpu map types and lpm. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Acked-by: Yonghong Song commit 47ac76662ca9c5852fd353093f19de3ae85f2e66 Author: Mark Date: Sun Aug 12 11:47:16 2018 -0400 tty: serial: 8250: Revert NXP SC16C2552 workaround Revert commit ecb988a3b7985913d1f0112f66667cdd15e40711: tty: serial: 8250: 8250_core: NXP SC16C2552 workaround The above commit causes userland application to no longer write correctly its first write to a dumb terminal connected to /dev/ttyS0. This commit seems to be the culprit. It's as though the TX FIFO is being reset during that write. What should be displayed is: PSW 80000000 INST 00000000 HALT // What is displayed is some variation of: T 00000000 HAL// Reverting this commit via this patch fixes my problem. Signed-off-by: Mark Hounschell Fixes: ecb988a3b798 ("tty: serial: 8250: 8250_core: NXP SC16C2552 workaround") Cc: stable Signed-off-by: Greg Kroah-Hartman commit 01239d77b9dd978863d1a75f0d095ab942a1fe66 Author: Shan Hai Date: Fri Aug 10 17:55:55 2018 -0700 xfs: fix a null pointer dereference in xfs_bmap_extents_to_btree Fuzzing tool reports a write to null pointer error in the xfs_bmap_extents_to_btree, fix it by bailing out on encountering a null pointer. Signed-off-by: Shan Hai Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fa6c668d807b1e9ac041101dfcb59bd8e279cfe5 Author: Eric Sandeen Date: Fri Aug 10 13:56:25 2018 -0700 xfs: remove b_last_holder & associated macros The old lock tracking infrastructure in xfs using the b_last_holder field seems to only be useful if you can get into the system with a debugger; it seems that the existing tracepoints would be the way to go these days, and this old infrastructure can be removed. Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 10259de1d8690a8c6dd98d564ff2690b5511c8f7 Author: Andreas Gruenbacher Date: Fri Aug 10 11:46:14 2018 -0700 iomap: Switch to offset_in_page for clarity Instead of open-coding pos & (PAGE_SIZE - 1) and pos & ~PAGE_MASK, use the offset_in_page macro. Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e25ff835af89a80aa6a4de58f413e494b2b96bd1 Author: Dave Jiang Date: Fri Aug 10 08:48:18 2018 -0700 xfs: Close race between direct IO and xfs_break_layouts() This patch is the duplicate of ross's fix for ext4 for xfs. If the refcount of a page is lowered between the time that it is returned by dax_busy_page() and when the refcount is again checked in xfs_break_layouts() => ___wait_var_event(), the waiting function xfs_wait_dax_page() will never be called. This means that xfs_break_layouts() will still have 'retry' set to false, so we'll stop looping and never check the refcount of other pages in this inode. Instead, always continue looping as long as dax_layout_busy_page() gives us a page which it found with an elevated refcount. Signed-off-by: Dave Jiang Reviewed-by: Jan Kara Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3d27c4de8d4fb2d4099ff324671792aa2578c6f9 Author: Xiubo Li Date: Sun Aug 12 07:58:23 2018 -0400 Revert "uio: use request_threaded_irq instead" Since mutex lock in irq hanler is useless currently, here will remove it together with it. This reverts commit 9421e45f5ff3d558cf8b75a8cc0824530caf3453. Reported-by: james.r.harris@intel.com CC: Ahsan Atta Signed-off-by: Xiubo Li Signed-off-by: Greg Kroah-Hartman commit 062a585ec21ea478be4826be7ddddb5b3ac49789 Author: Gustavo A. R. Silva Date: Tue Aug 7 19:04:40 2018 -0500 KVM: arm: Use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Marc Zyngier commit d0823cb346bc6f685f230bdbec51910a329e3fe3 Author: Jia He Date: Fri Aug 3 21:57:04 2018 +0800 KVM: arm/arm64: vgic: Do not use spin_lock_irqsave/restore with irq disabled kvm_vgic_sync_hwstate is only called with IRQ being disabled. There is thus no need to call spin_lock_irqsave/restore in vgic_fold_lr_state and vgic_prune_ap_list. This patch replace them with the non irq-safe version. Signed-off-by: Jia He Acked-by: Christoffer Dall [maz: commit message tidy-up] Signed-off-by: Marc Zyngier commit dc961e5395dde279b77e2cdbdcc99560b89bdfd9 Author: Jia He Date: Fri Aug 3 21:57:03 2018 +0800 KVM: arm/arm64: vgic: Move DEBUG_SPINLOCK_BUG_ON to vgic.h DEBUG_SPINLOCK_BUG_ON can be used with both vgic-v2 and vgic-v3, so let's move it to vgic.h Signed-off-by: Jia He [maz: commit message tidy-up] Signed-off-by: Marc Zyngier commit 3e8a8a50c7ef1a4f71921731f0e1748a7f70ddaa Author: Marc Zyngier Date: Mon Aug 6 13:06:01 2018 +0100 KVM: arm: vgic-v3: Add support for ICC_SGI0R and ICC_ASGI1R accesses In order to generate Group0 SGIs, let's add some decoding logic to access_gic_sgi(), and pass the generating group accordingly. Reviewed-by: Eric Auger Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 03bd646d863d1e4399d9dec658e1e5735f24cd2c Author: Marc Zyngier Date: Mon Aug 6 13:03:36 2018 +0100 KVM: arm64: vgic-v3: Add support for ICC_SGI0R_EL1 and ICC_ASGI1R_EL1 accesses In order to generate Group0 SGIs, let's add some decoding logic to access_gic_sgi(), and pass the generating group accordingly. Reviewed-by: Eric Auger Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 6249f2a479268702f7259aeee3671db2be3b922c Author: Marc Zyngier Date: Mon Aug 6 12:51:19 2018 +0100 KVM: arm/arm64: vgic-v3: Add core support for Group0 SGIs Although vgic-v3 now supports Group0 interrupts, it still doesn't deal with Group0 SGIs. As usually with the GIC, nothing is simple: - ICC_SGI1R can signal SGIs of both groups, since GICD_CTLR.DS==1 with KVM (as per 8.1.10, Non-secure EL1 access) - ICC_SGI0R can only generate Group0 SGIs - ICC_ASGI1R sees its scope refocussed to generate only Group0 SGIs (as per the note at the bottom of Table 8-14) We only support Group1 SGIs so far, so no material change. Reviewed-by: Eric Auger Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier commit e22fa39cd0132c409c8648e60282837d19643634 Author: Marc Zyngier Date: Mon Aug 6 11:44:07 2018 +0100 KVM: arm64: Remove non-existent AArch32 ICC_SGI1R encoding ICC_SGI1R is a 64bit system register, even on AArch32. It is thus pointless to have such an encoding in the 32bit cp15 array. Let's drop it. Reviewed-by: Eric Auger Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 73b383141d296c55bfbc0ce336a4a946627e7780 Merge: 627661ced824 91c6e15efc17 Author: Takashi Iwai Date: Sun Aug 12 08:55:01 2018 +0200 Merge branch 'for-next' into for-linus Preparation for 4.19 merge material. Signed-off-by: Takashi Iwai commit 78cbac647e61fb20ad615075949ea77cedf74e0c Merge: 6a92ef08a135 a4fd284a1f8f Author: David S. Miller Date: Sat Aug 11 17:54:18 2018 -0700 Merge branch 'ip-faster-in-order-IP-fragments' Peter Oskolkov says: ==================== ip: faster in-order IP fragments Added "Signed-off-by" in v2. ==================== Signed-off-by: David S. Miller commit a4fd284a1f8fd4b6c59aa59db2185b1e17c5c11c Author: Peter Oskolkov Date: Sat Aug 11 20:27:25 2018 +0000 ip: process in-order fragments efficiently This patch changes the runtime behavior of IP defrag queue: incoming in-order fragments are added to the end of the current list/"run" of in-order fragments at the tail. On some workloads, UDP stream performance is substantially improved: RX: ./udp_stream -F 10 -T 2 -l 60 TX: ./udp_stream -c -H -F 10 -T 5 -l 60 with this patchset applied on a 10Gbps receiver: throughput=9524.18 throughput_units=Mbit/s upstream (net-next): throughput=4608.93 throughput_units=Mbit/s Reported-by: Willem de Bruijn Signed-off-by: Peter Oskolkov Cc: Eric Dumazet Cc: Florian Westphal Signed-off-by: David S. Miller commit 353c9cb360874e737fb000545f783df756c06f9a Author: Peter Oskolkov Date: Sat Aug 11 20:27:24 2018 +0000 ip: add helpers to process in-order fragments faster. This patch introduces several helper functions/macros that will be used in the follow-up patch. No runtime changes yet. The new logic (fully implemented in the second patch) is as follows: * Nodes in the rb-tree will now contain not single fragments, but lists of consecutive fragments ("runs"). * At each point in time, the current "active" run at the tail is maintained/tracked. Fragments that arrive in-order, adjacent to the previous tail fragment, are added to this tail run without triggering the re-balancing of the rb-tree. * If a fragment arrives out of order with the offset _before_ the tail run, it is inserted into the rb-tree as a single fragment. * If a fragment arrives after the current tail fragment (with a gap), it starts a new "tail" run, as is inserted into the rb-tree at the end as the head of the new run. skb->cb is used to store additional information needed here (suggested by Eric Dumazet). Reported-by: Willem de Bruijn Signed-off-by: Peter Oskolkov Cc: Eric Dumazet Cc: Florian Westphal Signed-off-by: David S. Miller commit 6a92ef08a1351e4977d6acde2196fa94e9c3a660 Merge: 9a95d9c6429b ec0c96714e7d Author: David S. Miller Date: Sat Aug 11 17:52:00 2018 -0700 Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net commit eb2b3d034511f7f5f5fa781b9354ea4d5dbd4fc5 Author: Coly Li Date: Sat Aug 11 13:20:00 2018 +0800 bcache: add the missing comments for smp_mb()/smp_wmb() Checkpatch.pl warns there are 2 locations of smp_mb() and smp_wmb() without code comment. This patch adds the missing code comments for these memory barrier calls. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit d0c1b89a409fb8f55783e95effeb60d703f81061 Author: Coly Li Date: Sat Aug 11 13:19:59 2018 +0800 bcache: remove unnecessary space before ioctl function pointer arguments This is warned by checkpatch.pl, this patch removes the extra space. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit 87418ef9f07ac6bc00af7992dc1ccd96da46cd68 Author: Coly Li Date: Sat Aug 11 13:19:58 2018 +0800 bcache: add missing SPDX header The SPDX header is missing fro closure.c, super.c and util.c, this patch adds SPDX header for GPL-2.0 into these files. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit b3cf37bfa1a48acd5620d7be3dea05a4f76d87fd Author: Coly Li Date: Sat Aug 11 13:19:57 2018 +0800 bcache: move open brace at end of function definitions to next line This is not a preferred style to place open brace '{' at the end of function definition, checkpatch.pl reports error for such coding style. This patch moves them into the start of the next new line. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit e1f08f1bc0134c2ebd655fc63ed82e160c123b7b Author: Coly Li Date: Sat Aug 11 13:19:56 2018 +0800 bcache: add static const prefix to char * array declarations This patch declares char * array with const prefix in sysfs.c, which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit 3be11dbab67a3ed28358a950671de9b8e7fb5a02 Author: Coly Li Date: Sat Aug 11 13:19:55 2018 +0800 bcache: fix code comments style This patch fixes 3 style issues warned by checkpatch.pl, - Comment lines are not aligned - Comments use "/*" on subsequent lines - Comment lines use a trailing "*/" Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit 3069211be30015b78e096fc4d3774b7d4ba29781 Author: Coly Li Date: Sat Aug 11 13:19:54 2018 +0800 bcache: do not check NULL pointer before calling kmem_cache_destroy kmem_cache_destroy() is safe for NULL pointer as input, the NULL pointer checking is unncessary. This patch just removes the NULL pointer checking to make code simpler. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit bc81b47e828adfc3631e616fddc6b2203876b65d Author: Coly Li Date: Sat Aug 11 13:19:53 2018 +0800 bcache: prefer 'help' in Kconfig Current bcache Kconfig uses '---help---' as header of help information, for now 'help' is prefered. This patch fixes this style by replacing '---help---' by 'help' in bcache Kconfig file. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit 2b1edd23ecc6f5839d107a723a282a73bf00df3f Author: Coly Li Date: Sat Aug 11 13:19:52 2018 +0800 bcache: fix typo 'succesfully' to 'successfully' This patch fixes typo 'succesfully' to correct 'successfully', which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit d9c61d30e86a024b2f7c728706b8ab2c9e6ec2c1 Author: Coly Li Date: Sat Aug 11 13:19:51 2018 +0800 bcache: replace '%pF' by '%pS' in seq_printf() '%pF' and '%pf' are deprecated vsprintf pointer extensions, this patch replace them by '%pS', which is suggested by checkpatch.pl. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit c63ca7871aa3f1777e2af978ea1967b2f5bf0ae2 Author: Coly Li Date: Sat Aug 11 13:19:50 2018 +0800 bcache: fix indent by replacing blank by tabs bch_btree_insert_check_key() has unaligned indent, or indent by blank characters. This patch makes the indent aligned and replace blank by tabs. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit 6ae63e3501c493616612b90be26b35a6084fc75d Author: Coly Li Date: Sat Aug 11 13:19:49 2018 +0800 bcache: replace printk() by pr_*() routines There are still many places in bcache use printk to display kernel message, which are suggested to be preplaced by pr_*() routines like pr_err(), pr_info(), or pr_notice(). This patch replaces all printk() with a proper pr_*() routine for bcache code. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit 958bf494ecf0a6755309569a9083bf123d6e3754 Author: Coly Li Date: Sat Aug 11 13:19:48 2018 +0800 bcache: replace Symbolic permissions by octal permission numbers Symbolic permission names are used in bcache, for now octal permission numbers are encouraged to use for readability. This patch replaces all symbolic permissions by octal permission numbers. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit b0d30981c05f32d8cc032b209408ca3224f05f36 Author: Coly Li Date: Sat Aug 11 13:19:47 2018 +0800 bcache: style fixes for lines over 80 characters This patch fixes the lines over 80 characters into more lines, to minimize warnings by checkpatch.pl. There are still some lines exceed 80 characters, but it is better to be a single line and I don't change them. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit fc2d5988b5972bced859944986fb36d902ac3698 Author: Coly Li Date: Sat Aug 11 13:19:46 2018 +0800 bcache: add identifier names to arguments of function definitions There are many function definitions do not have identifier argument names, scripts/checkpatch.pl complains warnings like this, WARNING: function definition argument 'struct bcache_device *' should also have an identifier name #16735: FILE: writeback.h:120: +void bch_sectors_dirty_init(struct bcache_device *); This patch adds identifier argument names to all bcache function definitions to fix such warnings. Signed-off-by: Coly Li Reviewed: Shenghui Wang Signed-off-by: Jens Axboe commit 1fae7cf05293d3a2c9e59c1bc59372322386467c Author: Coly Li Date: Sat Aug 11 13:19:45 2018 +0800 bcache: style fix to add a blank line after declarations Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit 6f10f7d1b02b1bbc305f88d7696445dd38b13881 Author: Coly Li Date: Sat Aug 11 13:19:44 2018 +0800 bcache: style fix to replace 'unsigned' by 'unsigned int' This patch fixes warning reported by checkpatch.pl by replacing 'unsigned' with 'unsigned int'. Signed-off-by: Coly Li Reviewed-by: Shenghui Wang Signed-off-by: Jens Axboe commit b86d865cb1cae1e61527ea0b8977078bbf694328 Author: Bart Van Assche Date: Fri Aug 10 13:28:07 2018 -0700 blkcg: Make blkg_root_lookup() work for queues in bypass mode For legacy queues the only call of blkg_root_lookup() happens after bypass mode has been enabled. Since blkg_lookup() returns NULL for queues in bypass mode, modify the blkg_root_lookup() such that it no longer depends on bypass mode. Rename the function into blk_queue_root_blkg() as suggested by Tejun. Suggested-by: Tejun Heo Fixes: 6bad9b210a22 ("blkcg: Introduce blkg_root_lookup()") Signed-off-by: Bart Van Assche Cc: Tejun Heo Signed-off-by: Jens Axboe commit 9a95d9c6429bb58905fdfc95da2e1b7cc3fb55b7 Merge: 2b14e1ea212d e329bc427395 Author: David S. Miller Date: Sat Aug 11 12:37:10 2018 -0700 Merge branch 'Remove-rtnl-lock-dependency-from-all-action-implementations' Vlad Buslov says: ==================== Remove rtnl lock dependency from all action implementations Currently, all netlink protocol handlers for updating rules, actions and qdiscs are protected with single global rtnl lock which removes any possibility for parallelism. This patch set is a second step to remove rtnl lock dependency from TC rules update path. Recently, new rtnl registration flag RTNL_FLAG_DOIT_UNLOCKED was added. Handlers registered with this flag are called without RTNL taken. End goal is to have rule update handlers(RTM_NEWTFILTER, RTM_DELTFILTER, etc.) to be registered with UNLOCKED flag to allow parallel execution. However, there is no intention to completely remove or split rtnl lock itself. This patch set addresses specific problems in implementation of tc actions that prevent their control path from being executed concurrently. Additional changes are required to refactor classifiers API and individual classifiers for parallel execution. This patch set lays groundwork to eventually register rule update handlers as rtnl-unlocked. Action API is already prepared for parallel execution with previous patch set, which means that action ops that use action API for their implementation do not require additional modifications. (delete, search, etc.) Action API implements concurrency-safe reference counting and guarantees that cleanup/delete is called only once, after last reference to action is released. The goal of this change is to update specific actions APIs that access action private state directly, in order to be independent from external locking. General approach is to re-use existing tcf_lock spinlock (used by some action implementation to synchronize control path with data path) to protect action private state from concurrent modification. If action has rcu-protected pointer, tcf spinlock is used to protect its update code, instead of relying on rtnl lock. Some actions need to determine rtnl mutex status in order to release it. For example, ife action can load additional kernel modules(meta ops) and must make sure that no locks are held during module load. In such cases 'rtnl_held' argument is used to conditionally release rtnl mutex. Changes from V1 to V2: - Patch 12: - new patch - Patch 14: - refactor gen_new_estimator() to reuse stats_lock when re-assigning rate estimator statistics pointer - Remove mirred and tunnel_key helper function changes. (to be submitted and standalone patch) ==================== Signed-off-by: David S. Miller commit e329bc427395e2d74f2bb685ef3dddda91a6695f Author: Vlad Buslov Date: Fri Aug 10 20:51:55 2018 +0300 net: sched: act_police: remove dependency on rtnl lock Use tcf spinlock to protect police action private data from concurrent modification during dump. (init already uses tcf spinlock when changing police action state) Pass tcf spinlock as estimator lock argument to gen_replace_estimator() during action init. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 51a9f5ae653979ac4bdbd81778a10431f0177e3c Author: Vlad Buslov Date: Fri Aug 10 20:51:54 2018 +0300 net: core: protect rate estimator statistics pointer with lock Extend gen_new_estimator() to also take stats_lock when re-assigning rate estimator statistics pointer. (to be used by unlocked actions) Rename 'stats_lock' to 'lock' and change argument description to explain that it is now also used for control path. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 4e232818bd32b29f15bef532f320a14367d172b4 Author: Vlad Buslov Date: Fri Aug 10 20:51:53 2018 +0300 net: sched: act_mirred: remove dependency on rtnl lock Re-introduce mirred list spinlock, that was removed some time ago, in order to protect it from concurrent modifications, instead of relying on rtnl lock. Use tcf spinlock to protect mirred action private data from concurrent modification in init and dump. Rearrange access to mirred data in order to be performed only while holding the lock. Rearrange net dev access to always hold reference while working with it, instead of relying on rntl lock. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 84a75b329be84c108a21ab9c02a52a9bf9e5a919 Author: Vlad Buslov Date: Fri Aug 10 20:51:52 2018 +0300 net: sched: extend action ops with put_dev callback As a preparation for removing dependency on rtnl lock from rules update path, all users of shared objects must take reference while working with them. Extend action ops with put_dev() API to be used on net device returned by get_dev(). Modify mirred action (only action that implements get_dev callback): - Take reference to net device in get_dev. - Implement put_dev API that releases reference to net device. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 764e9a24480f6ffba5493fb21e6a7b030d6b8b67 Author: Vlad Buslov Date: Fri Aug 10 20:51:51 2018 +0300 net: sched: act_vlan: remove dependency on rtnl lock Use tcf spinlock to protect vlan action private data from concurrent modification during dump and init. Use rcu swap operation to reassign params pointer under protection of tcf lock. (old params value is not used by init, so there is no need of standalone rcu dereference step) Remove rtnl assertion that is no longer necessary. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 729e01260989cc06c8a78491b46545793aef323a Author: Vlad Buslov Date: Fri Aug 10 20:51:50 2018 +0300 net: sched: act_tunnel_key: remove dependency on rtnl lock Use tcf lock to protect tunnel key action struct private data from concurrent modification in init and dump. Use rcu swap operation to reassign params pointer under protection of tcf lock. (old params value is not used by init, so there is no need of standalone rcu dereference step) Remove rtnl lock assertion that is no longer required. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit c8814552fe51358f5fc46bc1c4aa4bb68454f4eb Author: Vlad Buslov Date: Fri Aug 10 20:51:49 2018 +0300 net: sched: act_skbmod: remove dependency on rtnl lock Move read of skbmod_p rcu pointer to be protected by tcf spinlock. Use tcf spinlock to protect private skbmod data from concurrent modification during dump. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 5e48180ed8bcfa60e02887ba801307caf14bbe40 Author: Vlad Buslov Date: Fri Aug 10 20:51:48 2018 +0300 net: sched: act_simple: remove dependency on rtnl lock Use tcf spinlock to protect private simple action data from concurrent modification during dump. (simple init already uses tcf spinlock when changing action state) Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit d7728495665601658c7f94f3b5fa4e3f54d71c18 Author: Vlad Buslov Date: Fri Aug 10 20:51:47 2018 +0300 net: sched: act_sample: remove dependency on rtnl lock Use tcf spinlock to protect private sample action data from concurrent modification during dump and init. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 67b0c1a3c9ced3726dea73000f8900f453fc894f Author: Vlad Buslov Date: Fri Aug 10 20:51:46 2018 +0300 net: sched: act_pedit: remove dependency on rtnl lock Rearrange pedit init code to only access pedit action data while holding tcf spinlock. Change keys allocation type to atomic to allow it to execute while holding tcf spinlock. Take tcf spinlock in dump function when accessing pedit action data. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit ff25276de997f41197ebab91935627c249a30fc4 Author: Vlad Buslov Date: Fri Aug 10 20:51:45 2018 +0300 net: sched: act_ipt: remove dependency on rtnl lock Use tcf spinlock to protect ipt action private data from concurrent modification during dump. Ipt init already takes tcf spinlock when modifying ipt state. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 54d0d423a48aa0e61bb39665d20376ba7b940535 Author: Vlad Buslov Date: Fri Aug 10 20:51:44 2018 +0300 net: sched: act_ife: remove dependency on rtnl lock Use tcf spinlock and rcu to protect params pointer from concurrent modification during dump and init. Use rcu swap operation to reassign params pointer under protection of tcf lock. (old params value is not used by init, so there is no need of standalone rcu dereference step) Ife action has meta-actions that are compiled as standalone modules. Rtnl mutex must be released while loading a kernel module. In order to support execution without rtnl mutex, propagate 'rtnl_held' argument to meta action loading functions. When requesting meta action module, conditionally release rtnl lock depending on 'rtnl_held' argument. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit e8917f437006686b8fa1b9e54f31d7abc0ea7e97 Author: Vlad Buslov Date: Fri Aug 10 20:51:43 2018 +0300 net: sched: act_gact: remove dependency on rtnl lock Use tcf spinlock to protect gact action private state from concurrent modification during dump and init. Remove rtnl assertion that is no longer necessary. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit b6a2b971c0b00253197682fbdf1c55fc0e2610a4 Author: Vlad Buslov Date: Fri Aug 10 20:51:42 2018 +0300 net: sched: act_csum: remove dependency on rtnl lock Use tcf lock to protect csum action struct private data from concurrent modification in init and dump. Use rcu swap operation to reassign params pointer under protection of tcf lock. (old params value is not used by init, so there is no need of standalone rcu dereference step) Remove rtnl assertion that is no longer necessary. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 2142236b45843dbcbe9691d24cf06caff91a78fd Author: Vlad Buslov Date: Fri Aug 10 20:51:41 2018 +0300 net: sched: act_bpf: remove dependency on rtnl lock Use tcf spinlock to protect bpf action private data from concurrent modification during dump and init. Remove rtnl lock assertion that is no longer necessary. Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 2b14e1ea212d6ce90a657ab8fe2161ea00518878 Merge: b70f1f3af47f 0d493b4d0be3 Author: David S. Miller Date: Sat Aug 11 12:25:15 2018 -0700 Merge branch 'net-sctp-Avoid-allocating-high-order-memory-with-kmalloc' Konstantin Khorenko says: ==================== net/sctp: Avoid allocating high order memory with kmalloc() Each SCTP association can have up to 65535 input and output streams. For each stream type an array of sctp_stream_in or sctp_stream_out structures is allocated using kmalloc_array() function. This function allocates physically contiguous memory regions, so this can lead to allocation of memory regions of very high order, i.e.: sizeof(struct sctp_stream_out) == 24, ((65535 * 24) / 4096) == 383 memory pages (4096 byte per page), which means 9th memory order. This can lead to a memory allocation failures on the systems under a memory stress. We actually do not need these arrays of memory to be physically contiguous. Possible simple solution would be to use kvmalloc() instread of kmalloc() as kvmalloc() can allocate physically scattered pages if contiguous pages are not available. But the problem is that the allocation can happed in a softirq context with GFP_ATOMIC flag set, and kvmalloc() cannot be used in this scenario. So the other possible solution is to use flexible arrays instead of contiguios arrays of memory so that the memory would be allocated on a per-page basis. This patchset replaces kvmalloc() with flex_array usage. It consists of two parts: * First patch is preparatory - it mechanically wraps all direct access to assoc->stream.out[] and assoc->stream.in[] arrays with SCTP_SO() and SCTP_SI() wrappers so that later a direct array access could be easily changed to an access to a flex_array (or any other possible alternative). * Second patch replaces kmalloc_array() with flex_array usage. v2 changes: sctp_stream_in() users are updated to provide stream as an argument, sctp_stream_{in,out}_ptr() are now just sctp_stream_{in,out}(). v3 changes: Move type chages struct sctp_stream_out -> flex_array to next patch. Make sctp_stream_{in,out}() static incline and move them to a header. Performance results (single stream): ==================================== * Kernel: v4.18-rc6 - stock and with 2 patches from Oleg (earlier in this thread) * Node: CPU (8 cores): Intel(R) Xeon(R) CPU E31230 @ 3.20GHz RAM: 32 Gb * netperf: taken from https://github.com/HewlettPackard/netperf.git, compiled from sources with sctp support * netperf server and client are run on the same node * ip link set lo mtu 1500 The script used to run tests: # cat run_tests.sh #!/bin/bash for test in SCTP_STREAM SCTP_STREAM_MANY SCTP_RR SCTP_RR_MANY; do echo "TEST: $test"; for i in `seq 1 3`; do echo "Iteration: $i"; set -x netperf -t $test -H localhost -p 22222 -S 200000,200000 -s 200000,200000 \ -l 60 -- -m 1452; set +x done done ================================================ Results (a bit reformatted to be more readable): Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec v4.18-rc7 v4.18-rc7 + fixes TEST: SCTP_STREAM 212992 212992 1452 60.21 1125.52 1247.04 212992 212992 1452 60.20 1376.38 1149.95 212992 212992 1452 60.20 1131.40 1163.85 TEST: SCTP_STREAM_MANY 212992 212992 1452 60.00 1111.00 1310.05 212992 212992 1452 60.00 1188.55 1130.50 212992 212992 1452 60.00 1108.06 1162.50 =========== Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec v4.18-rc7 v4.18-rc7 + fixes TEST: SCTP_RR 212992 212992 1 1 60.00 45486.98 46089.43 212992 212992 1 1 60.00 45584.18 45994.21 212992 212992 1 1 60.00 45703.86 45720.84 TEST: SCTP_RR_MANY 212992 212992 1 1 60.00 40.75 40.77 212992 212992 1 1 60.00 40.58 40.08 212992 212992 1 1 60.00 39.98 39.97 Performance results for many streams: ===================================== * Kernel: v4.18-rc8 - stock and with 2 patches v3 * Node: CPU (8 cores): Intel(R) Xeon(R) CPU E31230 @ 3.20GHz RAM: 32 Gb * sctp_test: https://github.com/sctp/lksctp-tools * both server and client are run on the same node * ip link set lo mtu 1500 * sysctl -w vm.max_map_count=65530000 (need it to make memory fragmented) The script used to run tests: ============================= # cat run_sctp_test.sh #!/bin/bash set -x uname -r ip link set lo mtu 1500 swapoff -a free cat /proc/buddyinfo ./src/apps/sctp_test -H 127.0.0.1 -P 22222 -l -d 0 & sleep 3 time ./src/apps/sctp_test -H 127.0.0.1 -P 22221 -h 127.0.0.1 -p 22222 \ -s -c 1 -M 65535 -T -t 1 -x 100000 -d 0 1>/dev/null killall -9 lt-sctp_test =============================== Results (a bit reformatted to be more readable): 1) ms stock kernel v4.18-rc8, no memory fragmentation test 1 test 2 test 3 real 0m14.715s 0m14.593s 0m15.954s user 0m0.954s 0m0.955s 0m0.854s sys 0m13.388s 0m12.537s 0m13.749s 2) kernel with fixes, no memory fragmentation test 1 test 2 test 3 real 0m14.959s 0m14.693s 0m14.762s user 0m0.948s 0m0.921s 0m0.929s sys 0m13.538s 0m13.225s 0m13.217s 3) kernel with fixes, memory fragmented 'free': total used free shared buff/cache available Mem: 32906008 30555200 302740 764 2048068 266452 Mem: 32906008 30379948 541436 764 1984624 442376 Mem: 32906008 30717312 262380 764 1926316 109908 /proc/buddyinfo: Node 0, zone Normal 40773 37 34 29 0 0 0 0 0 0 0 Node 0, zone Normal 100332 68 8 4 2 1 1 0 0 0 0 Node 0, zone Normal 31113 7 2 1 0 0 0 0 0 0 0 test 1 test 2 test 3 real 0m14.159s 0m15.252s 0m15.826s user 0m0.839s 0m1.004s 0m1.048s sys 0m11.827s 0m14.240s 0m14.778s ==================== Signed-off-by: David S. Miller commit 0d493b4d0be352b5e361e4fa0bc3efe952d8b10e Author: Konstantin Khorenko Date: Fri Aug 10 20:11:43 2018 +0300 net/sctp: Replace in/out stream arrays with flex_array This path replaces physically contiguous memory arrays allocated using kmalloc_array() with flexible arrays. This enables to avoid memory allocation failures on the systems under a memory stress. Signed-off-by: Oleg Babin Signed-off-by: Konstantin Khorenko Signed-off-by: David S. Miller commit 05364ca03cfd419caecb292fede20eb39667eaae Author: Konstantin Khorenko Date: Fri Aug 10 20:11:42 2018 +0300 net/sctp: Make wrappers for accessing in/out streams This patch introduces wrappers for accessing in/out streams indirectly. This will enable to replace physically contiguous memory arrays of streams with flexible arrays (or maybe any other appropriate mechanism) which do memory allocation on a per-page basis. Signed-off-by: Oleg Babin Signed-off-by: Konstantin Khorenko Signed-off-by: David S. Miller commit b70f1f3af47f4a21a25678f9ee587ed7986d62f8 Author: Keara Leibovitz Date: Fri Aug 10 10:09:41 2018 -0400 tc: Update README and add config Updated README. Added config file that contains the minimum required features enabled to run the tests currently present in the kernel. This must be updated when new unittests are created and require their own modules. Signed-off-by: Keara Leibovitz Signed-off-by: David S. Miller commit 3305f9a90524c8e9e59f29a62312c10ab00a7364 Merge: 8a8982d1e213 4f5f85e9a70e Author: David S. Miller Date: Sat Aug 11 12:13:49 2018 -0700 Merge branch 'l2tp-rework-pppol2tp-ioctl-handling' Guillaume Nault says: ==================== l2tp: rework pppol2tp ioctl handling The current ioctl() handling code can be simplified. It tests for non-relevant conditions and uselessly holds sockets. Once useless code is removed, it becomes even simpler to let pppol2tp_ioctl() handle commands directly, rather than dispatch them to pppol2tp_tunnel_ioctl() or pppol2tp_session_ioctl(). That is the approach taken by this series. Patch #1 and #2 define helper functions aimed at simplifying the rest of the patch set. Patch #3 drops useless tests in pppol2p_ioctl() and avoid holding a refcount on the socket. Patches #4, #5 and #6 are the core of the series. They let pppol2tp_ioctl() handle all ioctls and drop the tunnel and session specific functions. Then patch #6 brings a little bit of consolidation. Finally, patch #7 takes advantage of the simplified code to make pppol2tp sockets compatible with dev_ioctl(). Certainly not a killer feature, but it is trivial and it is always nice to see l2tp getting better integration with the rest of the stack. ==================== Signed-off-by: David S. Miller commit 4f5f85e9a70e13c8919e26609914253d18fbf858 Author: Guillaume Nault Date: Fri Aug 10 13:22:03 2018 +0200 l2tp: let pppol2tp_ioctl() fallback to dev_ioctl() Return -ENOIOCTLCMD for unknown ioctl commands. This lets dev_ioctl() handle generic socket ioctls like SIOCGIFNAME or SIOCGIFINDEX. PF_PPPOX/PX_PROTO_OL2TP was one of the few socket types not honouring this mechanism. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 7390ed8a405013d0a7e1f4dc8ac495e0ac04996f Author: Guillaume Nault Date: Fri Aug 10 13:22:02 2018 +0200 l2tp: zero out stats in pppol2tp_copy_stats() Integrate memset(0) in pppol2tp_copy_stats() to avoid calling it manually every time. While there, constify 'stats'. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit b0e29063dcb3bf14f515f95e748b60e4bab45e7c Author: Guillaume Nault Date: Fri Aug 10 13:22:01 2018 +0200 l2tp: remove pppol2tp_session_ioctl() pppol2tp_ioctl() has everything in place for handling PPPIOCGL2TPSTATS on session sockets. We just need to copy the stats and set ->session_id. As a side effect of sharing session and tunnel code, ->using_ipsec is properly set even when the request was made using a session socket. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 528534f0deda05c668756313a22974429a9df05a Author: Guillaume Nault Date: Fri Aug 10 13:22:00 2018 +0200 l2tp: remove pppol2tp_tunnel_ioctl() Handle PPPIOCGL2TPSTATS in pppol2tp_ioctl() if the socket represents a tunnel. This one is a bit special because the caller may use the tunnel socket to retrieve statistics of one of its sessions. If the session_id is set, the corresponding session's statistics are returned, instead of those of the tunnel. This is handled by the new pppol2tp_tunnel_copy_stats() helper function. Set ->tunnel_id and ->using_ipsec out of the conditional, so that it can be used by the 'else' branch in the following patch. We cannot do that for ->session_id, because tunnel sockets have to report the value that was originally passed in 'stats.session_id', while session sockets have to report their own session_id. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 79e6760e64d1b69a20af4d97ead291159d4c11c2 Author: Guillaume Nault Date: Fri Aug 10 13:21:58 2018 +0200 l2tp: handle PPPIOC[GS]MRU and PPPIOC[GS]FLAGS in pppol2tp_ioctl() Let pppol2tp_ioctl() handle ioctl commands directly. It still relies on pppol2tp_{session,tunnel}_ioctl() for PPPIOCGL2TPSTATS. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit bdd0292f96e43de46283ea0efdef8d13b4ffe895 Author: Guillaume Nault Date: Fri Aug 10 13:21:58 2018 +0200 l2tp: simplify pppol2tp_ioctl() * Drop test on 'sk': sock->sk cannot be NULL, or pppox_ioctl() could not have called us. * Drop test on 'SOCK_DEAD' state: if this flag was set, the socket would be in the process of being released and no ioctl could be running anymore. * Drop test on 'PPPOX_*' state: we depend on ->sk_user_data to get the session structure. If it is non-NULL, then the socket is connected. Testing for PPPOX_* is redundant. * Retrieve session using ->sk_user_data directly, instead of going through pppol2tp_sock_to_session(). This avoids grabbing a useless reference on the socket. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 01e28b921b19cb99a09dda89ab0e5dc49bf4ab38 Author: Guillaume Nault Date: Fri Aug 10 13:21:57 2018 +0200 l2tp: split l2tp_session_get() l2tp_session_get() is used for two different purposes. If 'tunnel' is NULL, the session is searched globally in the supplied network namespace. Otherwise it is searched exclusively in the tunnel context. Callers always know the context in which they need to search the session. But some of them do provide both a namespace and a tunnel, making the semantic of the call unclear. This patch defines l2tp_tunnel_get_session() for lookups done in a tunnel and restricts l2tp_session_get() to namespace searches. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit d6a61ec936676dbe25a6eb76e1229787dc2fbba8 Author: Guillaume Nault Date: Fri Aug 10 13:21:55 2018 +0200 l2tp: define l2tp_tunnel_uses_xfrm() Use helper function to figure out if a tunnel is using ipsec. Also, avoid accessing ->sk_policy directly since it's RCU protected. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 8a8982d1e2137aa020dd9fbc96b5e3c4fd871d0c Merge: 78aca3bbee88 b6311b7bea41 Author: David S. Miller Date: Sat Aug 11 12:11:36 2018 -0700 Merge branch 'netsec-driver-improvements' Ilias Apalodimas says: ==================== netsec driver improvements This patchset introduces some improvements on socionext netsec driver. - patch 1/2, avoids unneeded MMIO reads on the Rx path - patch 2/2, is adjusting the numbers of descriptors used Changes since v1: - Move dma_rmb() to protect descriptor accesses until the device has updated the NETSEC_RX_PKT_OWN_FIELD bit ==================== Signed-off-by: David S. Miller commit b6311b7bea41963c81da3ab58730dcc3c1aa388e Author: Ilias Apalodimas Date: Fri Aug 10 09:12:39 2018 +0300 net: socionext: Increase descriptors to 256 Increasing descriptors to 256 from 128 and adjusting the NAPI weight to 64 increases performace on Rx by ~20% on 64byte packets Signed-off-by: Ilias Apalodimas Signed-off-by: David S. Miller commit 63ae7949e94aad607c24d00b8ce3f5661c0a1e9d Author: Ilias Apalodimas Date: Fri Aug 10 09:12:38 2018 +0300 net: socionext: Use descriptor info instead of MMIO reads on Rx MMIO reads for remaining packets in queue occur (at least)twice per invocation of netsec_process_rx(). We can use the packet descriptor to identify if it's owned by the hardware and break out, avoiding the more expensive MMIO read operations. This has a ~2% increase on the pps of the Rx path when tested with 64byte packets Signed-off-by: Ilias Apalodimas Signed-off-by: David S. Miller commit 78aca3bbee880ea4d6f30d603c057058b03bdc77 Author: YueHaibing Date: Fri Aug 10 14:08:37 2018 +0800 vxge: remove set but not used variable 'req_out', 'status' and 'ret' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/neterion/vxge/vxge-config.c:1097:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/neterion/vxge/vxge-config.c:2263:6: warning: variable 'req_out' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/neterion/vxge/vxge-config.c:2262:22: warning: variable 'status' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/neterion/vxge/vxge-config.c:2360:22: warning: variable 'status' set but not used [-Wunused-but-set-variable] enum vxge_hw_status status = VXGE_HW_OK; Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 29afde505178403ccba6d3af919cc5b15a621ef7 Merge: 07624df1c9ef 2ca653d607ce Author: David S. Miller Date: Sat Aug 11 12:02:18 2018 -0700 Merge branch 'virtio_net-Expand-affinity-to-arbitrary-numbers-of-cpu-and-vq' Caleb Raitto says: ==================== virtio_net: Expand affinity to arbitrary numbers of cpu and vq Virtio-net tries to pin each virtual queue rx and tx interrupt to a cpu if there are as many queues as cpus. Expand this heuristic to configure a reasonable affinity setting also when the number of cpus != the number of virtual queues. Patch 1 allows vqs to take an affinity mask with more than 1 cpu. Patch 2 generalizes the algorithm in virtnet_set_affinity beyond the case where #cpus == #vqs. v2 changes: Renamed "virtio_net: Make vp_set_vq_affinity() take a mask." to "virtio: Make vp_set_vq_affinity() take a mask." Tested: [InstanceSetup] set_multiqueue = false $ cd /proc/irq $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list; done 0-15 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 0-15 0-15 0-15 0-15 $ cd /sys/class/net/eth0/queues/ $ for i in `seq 0 15` ; do sudo grep ".*" tx-$i/xps_cpus; done 0001 0002 0004 0008 0010 0020 0040 0080 0100 0200 0400 0800 1000 2000 4000 8000 $ sudo ethtool -L eth0 combined 15 $ cd /proc/irq $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list; done 0-15 0-1 0-1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 15 15 0-15 0-15 0-15 0-15 $ cd /sys/class/net/eth0/queues/ $ for i in `seq 0 14` ; do sudo grep ".*" tx-$i/xps_cpus; done 0003 0004 0008 0010 0020 0040 0080 0100 0200 0400 0800 1000 2000 4000 8000 $ sudo ethtool -L eth0 combined 8 $ cd /proc/irq $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list; done 0-15 0-1 0-1 2-3 2-3 4-5 4-5 6-7 6-7 8-9 8-9 10-11 10-11 12-13 12-13 14-15 14-15 9 9 10 10 11 11 12 12 13 13 14 14 15 15 15 15 0-15 0-15 0-15 0-15 $ cd /sys/class/net/eth0/queues/ $ for i in `seq 0 7` ; do sudo grep ".*" tx-$i/xps_cpus; done 0003 000c 0030 00c0 0300 0c00 3000 c000 $ sudo ethtool -L eth0 combined 16 $ sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu15/online" $ cd /proc/irq $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list; done 0-15 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 0 0 0-15 0-15 0-15 0-15 $ cd /sys/class/net/eth0/queues/ $ for i in `seq 0 15` ; do sudo grep ".*" tx-$i/xps_cpus; done 0001 0002 0004 0008 0010 0020 0040 0080 0100 0200 0400 0800 1000 2000 4000 0001 $ for i in `seq 8 15`; \ do sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu$i/online"; done $ cd /proc/irq $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list; done 0-15 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 0-15 0-15 0-15 0-15 $ cd /sys/class/net/eth0/queues/ $ for i in `seq 0 15` ; do sudo grep ".*" tx-$i/xps_cpus; done 0001 0002 0004 0008 0010 0020 0040 0080 0001 0002 0004 0008 0010 0020 0040 0080 ==================== Signed-off-by: David S. Miller commit 2ca653d607ce59f2729173a7ea56dbfa6330ec88 Author: Caleb Raitto Date: Thu Aug 9 17:28:40 2018 -0700 virtio_net: Stripe queue affinities across cores. Always set the affinity hint, even if #cpu != #vq. Handle the case where #cpu > #vq (including when #cpu % #vq != 0) and when #vq > #cpu (including when #vq % #cpu != 0). Signed-off-by: Caleb Raitto Signed-off-by: Willem de Bruijn Acked-by: Jon Olson Signed-off-by: David S. Miller commit 19e226e8cc5da02f17ed119f9137036c0f0f5d80 Author: Caleb Raitto Date: Thu Aug 9 18:18:28 2018 -0700 virtio: Make vp_set_vq_affinity() take a mask. Make vp_set_vq_affinity() take a cpumask instead of taking a single CPU. If there are fewer queues than cores, queue affinity should be able to map to multiple cores. Link: https://patchwork.ozlabs.org/patch/948149/ Suggested-by: Willem de Bruijn Signed-off-by: Caleb Raitto Acked-by: Gonglei Signed-off-by: David S. Miller commit 07624df1c9efd4b7f2f6762581587c590b03c7a2 Author: Bryan Whitehead Date: Thu Aug 9 15:36:10 2018 -0400 lan743x: lan743x: Add PTP support PTP support includes: Ingress, and egress timestamping. One step timestamping available. PTP clock support. Periodic output support. Signed-off-by: Bryan Whitehead Signed-off-by: David S. Miller commit 217e502b89d42dce2afa80a1256adceae070237e Merge: 8a8a894ebbc2 fd2123a3d752 Author: David S. Miller Date: Sat Aug 11 11:31:36 2018 -0700 Merge branch 'tcp-new-mechanism-to-ACK-immediately' Yuchung Cheng says: ==================== tcp: new mechanism to ACK immediately This patch is a follow-up feature improvement to the recent fixes on the performance issues in ECN (delayed) ACKs. Many of the fixes use tcp_enter_quickack_mode routine to force immediate ACKs. However the routine also reset tracking interactive session. This is not ideal because these immediate ACKs are required by protocol specifics unrelated to the interactiveness nature of the application. This patch set introduces a new flag to send a one-time immediate ACK without changing the status of interactive session tracking. With this patch set the immediate ACKs are generated upon these protocol states: 1) When a hole is repaired 2) When CE status changes between subsequent data packets received 3) When a data packet carries CWR flag ==================== Signed-off-by: David S. Miller commit fd2123a3d7527d4c7092633d55e877c0cc1d84a3 Author: Yuchung Cheng Date: Thu Aug 9 09:38:12 2018 -0700 tcp: avoid resetting ACK timer upon receiving packet with ECN CWR flag Previously commit 9aee40006190 ("tcp: ack immediately when a cwr packet arrives") calls tcp_enter_quickack_mode to force sending two immediate ACKs upon receiving a packet w/ CWR flag. The side effect is it'll also reset the delayed ACK timer and interactive session tracking. This patch removes that side effect by using the new ACK_NOW flag to force an immmediate ACK. Packetdrill to demonstrate: 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0 setsockopt(3, SOL_TCP, TCP_CONGESTION, "dctcp", 5) = 0 +0 bind(3, ..., ...) = 0 +0 listen(3, 1) = 0 +0 < [ect0] SEW 0:0(0) win 32792 +0 > SE. 0:0(0) ack 1 +.1 < [ect0] . 1:1(0) ack 1 win 257 +0 accept(3, ..., ...) = 4 +0 < [ect0] . 1:1001(1000) ack 1 win 257 +0 > [ect01] . 1:1(0) ack 1001 +0 write(4, ..., 1) = 1 +0 > [ect01] P. 1:2(1) ack 1001 +0 < [ect0] . 1001:2001(1000) ack 2 win 257 +0 write(4, ..., 1) = 1 +0 > [ect01] P. 2:3(1) ack 2001 +0 < [ect0] . 2001:3001(1000) ack 3 win 257 +0 < [ect0] . 3001:4001(1000) ack 3 win 257 // Ack delayed ... +.01 < [ce] P. 4001:4501(500) ack 3 win 257 +0 > [ect01] . 3:3(0) ack 4001 +0 > [ect01] E. 3:3(0) ack 4501 +.001 read(4, ..., 4500) = 4500 +0 write(4, ..., 1) = 1 +0 > [ect01] PE. 3:4(1) ack 4501 win 100 +.01 < [ect0] W. 4501:5501(1000) ack 4 win 257 // No delayed ACK on CWR flag +0 > [ect01] . 4:4(0) ack 5501 +.31 < [ect0] . 5501:6501(1000) ack 4 win 257 +0 > [ect01] . 4:4(0) ack 6501 Fixes: 9aee40006190 ("tcp: ack immediately when a cwr packet arrives") Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Signed-off-by: David S. Miller commit 15bdd5686c2c61373680b9015e95abf31778e4fd Author: Yuchung Cheng Date: Thu Aug 9 09:38:11 2018 -0700 tcp: always ACK immediately on hole repairs RFC 5681 sec 4.2: To provide feedback to senders recovering from losses, the receiver SHOULD send an immediate ACK when it receives a data segment that fills in all or part of a gap in the sequence space. When a gap is partially filled, __tcp_ack_snd_check already checks the out-of-order queue and correctly send an immediate ACK. However when a gap is fully filled, the previous implementation only resets pingpong mode which does not guarantee an immediate ACK because the quick ACK counter may be zero. This patch addresses this issue by marking the one-time immediate ACK flag instead. Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d2ccd7bc8acdcb9166c07a0255fb85bf877edb1f Author: Yuchung Cheng Date: Thu Aug 9 09:38:10 2018 -0700 tcp: avoid resetting ACK timer in DCTCP The recent fix of acking immediately in DCTCP on CE status change has an undesirable side-effect: it also resets TCP ack timer and disables pingpong mode (interactive session). But the CE status change has nothing to do with them. This patch addresses that by using the new one-time immediate ACK flag instead of calling tcp_enter_quickack_mode(). Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 466466dc6c28ca9dc401f10e235b9cde9a7c9162 Author: Yuchung Cheng Date: Thu Aug 9 09:38:09 2018 -0700 tcp: mandate a one-time immediate ACK Add a new flag to indicate a one-time immediate ACK. This flag is occasionaly set under specific TCP protocol states in addition to the more common quickack mechanism for interactive application. In several cases in the TCP code we want to force an immediate ACK but do not want to call tcp_enter_quickack_mode() because we do not want to forget the icsk_ack.pingpong or icsk_ack.ato state. Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 8a8a894ebbc23f52669b80c2ca5bf62d75267324 Author: Gustavo A. R. Silva Date: Thu Aug 9 10:47:20 2018 -0500 wimax: usb-tx: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I placed the "fall through" annotation at the bottom of the case, which is what GCC is expecting to find. Addresses-Coverity-ID: 115075 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 849063074a84fe388a15f5655bc26fdf3290a2ac Author: Gustavo A. R. Silva Date: Thu Aug 9 10:39:44 2018 -0500 wimax: usb-fw: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I placed the "fall through" annotation at the bottom of the case, which is what GCC is expecting to find. Addresses-Coverity-ID: 1369529 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit d331e7589753f02f93db350910e4bcbbecf6f726 Author: Gustavo A. R. Silva Date: Thu Aug 9 10:08:24 2018 -0500 net: dp83640: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced the code comment at the top of the switch statement with a proper "fall through" annotation for each case, which is what GCC is expecting to find. Addresses-Coverity-ID: 1056542 ("Missing break in switch") Addresses-Coverity-ID: 1339579 ("Missing break in switch") Addresses-Coverity-ID: 1369526 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 98ed1e642c451b3ed9f4c5785b291a3fc9e82166 Author: Colin Ian King Date: Thu Aug 9 12:00:49 2018 +0100 rxrpc: remove redundant static int 'zero' The static int 'zero' is defined but is never used hence it is redundant and can be removed. The use of this variable was removed with commit a158bdd3247b ("rxrpc: Fix call timeouts"). Cleans up clang warning: warning: 'zero' defined but not used [-Wunused-const-variable=] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit f741917e24e9de4cf5abe041ff1b4f28f9522387 Author: zhong jiang Date: Thu Aug 9 09:39:13 2018 +0800 drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend rtl8152_system_suspend defines the variable "ret", but it is not modified after initialization. So just remove it. Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit 9805d4bcf8f98dbeb1a66c3195f2ea8b917a083e Author: Boris Brezillon Date: Sat Aug 11 15:47:12 2018 +0200 mtd: rawnand: atmel: Select GENERIC_ALLOCATOR The driver uses genalloc functions. Select GENERIC_ALLOCATOR to prevent build errors when selected through COMPILE_TEST. Fixes: 88a40e7dca00 ("mtd: rawnand: atmel: Allow selection of this driver when COMPILE_TEST=y") Reported-by: Randy Dunlap Signed-off-by: Boris Brezillon Acked-by: Miquel Raynal Acked-by: Randy Dunlap commit d0eea5d8db42a9fbf89943253908579865a3eaad Merge: da86748bf600 bb276262e88d Author: Boris Brezillon Date: Sat Aug 11 12:19:35 2018 +0200 Merge tag 'spi-nor/for-4.19' of git://git.infradead.org/linux-mtd into mtd/next Pull SPI NOR updates from Boris Brezillon: " Core changes: - Apply reset hacks only when reset is explicitly marked as broken in the DT Driver changes: - Minor cleanup/fixes in the m25p80 driver - Release flash_np in the nxp-spifi driver - Add suspend/resume hooks to the atmel-quadspi driver - Include gpio/consumer.h instead of gpio.h in the atmel-quadspi driver - Use %pK instead of %p in the stm32-quadspi driver - Improve timeout handling in the cadence-quadspi driver - Use mtd_device_register() instead of mtd_device_parse_register() in the intel-spi driver " commit da86748bf60068e0d6ad56e5c919ca7e6782c4ba Merge: 76a832254ab0 ed128e8b757b Author: Boris Brezillon Date: Sat Aug 11 12:15:19 2018 +0200 Merge tag 'nand/for-4.19' of git://git.infradead.org/linux-mtd into mtd/next Pull NAND updates from Miquel Raynal: " NAND core changes: - Add the SPI-NAND framework. - Create a helper to find the best ECC configuration. - Create NAND controller operations. - Allocate dynamically ONFI parameters structure. - Add defines for ONFI version bits. - Add manufacturer fixup for ONFI parameter page. - Add an option to specify NAND chip as a boot device. - Add Reed-Solomon error correction algorithm. - Better name for the controller structure. - Remove unused caller_is_module() definition. - Make subop helpers return unsigned values. - Expose _notsupp() helpers for raw page accessors. - Add default values for dynamic timings. - Kill the chip->scan_bbt() hook. - Rename nand_default_bbt() into nand_create_bbt(). - Start to clean the nand_chip structure. - Remove stale prototype from rawnand.h. Raw NAND controllers drivers changes: - Qcom: structuring cleanup. - Denali: use core helper to find the best ECC configuration. - Possible build of almost all drivers by adding a dependency on COMPILE_TEST for almost all of them in Kconfig, implies various fixes, Kconfig cleanup, GPIO headers inclusion cleanup, and even changes in sparc64 and ia64 architectures. - Clean the ->probe() functions error path of a lot of drivers. - Migrate all drivers to use nand_scan() instead of nand_scan_ident()/nand_scan_tail() pair. - Use mtd_device_register() where applicable to simplify the code. - Marvell: * Handle on-die ECC. * Better clocks handling. * Remove bogus comment. * Add suspend and resume support. - Tegra: add NAND controller driver. - Atmel: * Add module param to avoid using dma. * Drop Wenyou Yang from MAINTAINERS. - Denali: optimize timings handling. - FSMC: Stop using chip->read_buf(). - FSL: * Switch to SPDX license tag identifiers. * Fix qualifiers in MXC init functions. Raw NAND chip drivers changes: - Micron: * Add fixup for ONFI revision. * Update ecc_stats.corrected. * Make ECC activation stateful. * Avoid enabling/disabling ECC when it can't be disabled. * Get the actual number of bitflips. * Allow forced on-die ECC. * Support 8/512 on-die ECC. * Fix on-die ECC detection logic. - Hynix: * Fix decoding the OOB size on H27UCG8T2BTR. * Use ->exec_op() in hynix_nand_reg_write_op(). " commit 42a0cc3478584d4d63f68f2f5af021ddbea771fa Author: Jann Horn Date: Mon Jun 25 18:34:10 2018 +0200 sys: don't hold uts_sem while accessing userspace memory Holding uts_sem as a writer while accessing userspace memory allows a namespace admin to stall all processes that attempt to take uts_sem. Instead, move data through stack buffers and don't access userspace memory while uts_sem is held. Cc: stable@vger.kernel.org Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jann Horn Signed-off-by: Eric W. Biederman commit 5820f140edef111a9ea2ef414ab2428b8cb805b1 Author: Jann Horn Date: Mon Jun 25 18:34:19 2018 +0200 userns: move user access out of the mutex The old code would hold the userns_state_mutex indefinitely if memdup_user_nul stalled due to e.g. a userfault region. Prevent that by moving the memdup_user_nul in front of the mutex_lock(). Note: This changes the error precedence of invalid buf/count/*ppos vs map already written / capabilities missing. Fixes: 22d917d80e84 ("userns: Rework the user_namespace adding uid/gid...") Cc: stable@vger.kernel.org Signed-off-by: Jann Horn Acked-by: Christian Brauner Acked-by: Serge Hallyn Signed-off-by: Eric W. Biederman commit 355139a8dba446cc11a424cddbf7afebc3041ba1 Author: Eddie.Horng Date: Fri Jul 20 15:30:00 2018 +0800 cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias() The code in cap_inode_getsecurity(), introduced by commit 8db6c34f1dbc ("Introduce v3 namespaced file capabilities"), should use d_find_any_alias() instead of d_find_alias() do handle unhashed dentry correctly. This is needed, for example, if execveat() is called with an open but unlinked overlayfs file, because overlayfs unhashes dentry on unlink. This is a regression of real life application, first reported at https://www.spinics.net/lists/linux-unionfs/msg05363.html Below reproducer and setup can reproduce the case. const char* exec="echo"; const char *newargv[] = { "echo", "hello", NULL}; const char *newenviron[] = { NULL }; int fd, err; fd = open(exec, O_PATH); unlink(exec); err = syscall(322/*SYS_execveat*/, fd, "", newargv, newenviron, AT_EMPTY_PATH); if(err<0) fprintf(stderr, "execveat: %s\n", strerror(errno)); gcc compile into ~/test/a.out mount -t overlay -orw,lowerdir=/mnt/l,upperdir=/mnt/u,workdir=/mnt/w none /mnt/m cd /mnt/m cp /bin/echo . ~/test/a.out Expected result: hello Actually result: execveat: Invalid argument dmesg: Invalid argument reading file caps for /dev/fd/3 The 2nd reproducer and setup emulates similar case but for regular filesystem: const char* exec="echo"; int fd, err; char buf[256]; fd = open(exec, O_RDONLY); unlink(exec); err = fgetxattr(fd, "security.capability", buf, 256); if(err<0) fprintf(stderr, "fgetxattr: %s\n", strerror(errno)); gcc compile into ~/test_fgetxattr cd /tmp cp /bin/echo . ~/test_fgetxattr Result: fgetxattr: Invalid argument On regular filesystem, for example, ext4 read xattr from disk and return to execveat(), will not trigger this issue, however, the overlay attr handler pass real dentry to vfs_getxattr() will. This reproducer calls fgetxattr() with an unlinked fd, involkes vfs_getxattr() then reproduced the case that d_find_alias() in cap_inode_getsecurity() can't find the unlinked dentry. Suggested-by: Amir Goldstein Acked-by: Amir Goldstein Acked-by: Serge E. Hallyn Fixes: 8db6c34f1dbc ("Introduce v3 namespaced file capabilities") Cc: # v4.14 Signed-off-by: Eddie Horng Signed-off-by: Eric W. Biederman commit 8605212a7c37b5d786544263bae5e697c1aaaa16 Author: Vasundhara Volam Date: Fri Aug 10 18:24:43 2018 -0400 bnxt_en: Fix strcpy() warnings in bnxt_ethtool.c This patch fixes following smatch warnings: drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2826 bnxt_fill_coredump_seg_hdr() error: strcpy() '"sEgM"' too large for 'seg_hdr->signature' (5 vs 4) drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2858 bnxt_fill_coredump_record() error: strcpy() '"cOrE"' too large for 'record->signature' (5 vs 4) drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2879 bnxt_fill_coredump_record() error: strcpy() 'utsname()->sysname' too large for 'record->os_name' (65 vs 32) Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.") Reported-by: Dan Carpenter Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 4bcb4ad6634ea1084faa630fe35d72f75b5e80fa Author: Paul Burton Date: Fri Aug 10 16:03:31 2018 -0700 MIPS: Consistently declare TLB functions Since at least the beginning of the git era we've declared our TLB exception handling functions inconsistently. They're actually functions, but we declare them as arrays of u32 where each u32 is an encoded instruction. This has always been the case for arch/mips/mm/tlbex.c, and has also been true for arch/mips/kernel/traps.c since commit 86a1708a9d54 ("MIPS: Make tlb exception handler definitions and declarations match.") which aimed for consistency but did so by consistently making the our C code inconsistent with our assembly. This is all usually harmless, but when using GCC 7 or newer to build a kernel targeting microMIPS (ie. CONFIG_CPU_MICROMIPS=y) it becomes problematic. With microMIPS bit 0 of the program counter indicates the ISA mode. When bit 0 is zero instructions are decoded using the standard MIPS32 or MIPS64 ISA. When bit 0 is one instructions are decoded using microMIPS. This means that function pointers become odd - their least significant bit is one for microMIPS code. We work around this in cases where we need to access code using loads & stores with our msk_isa16_mode() macro which simply clears bit 0 of the value it is given: #define msk_isa16_mode(x) ((x) & ~0x1) For example we do this for our TLB load handler in build_r4000_tlb_load_handler(): u32 *p = (u32 *)msk_isa16_mode((ulong)handle_tlbl); We then write code to p, expecting it to be suitably aligned (our LEAF macro aligns functions on 4 byte boundaries, so (ulong)handle_tlbl will give a value one greater than a multiple of 4 - ie. the start of a function on a 4 byte boundary, with the ISA mode bit 0 set). This worked fine up to GCC 6, but GCC 7 & onwards is smart enough to presume that handle_tlbl which we declared as an array of u32s must be aligned sufficiently that bit 0 of its address will never be set, and as a result optimize out msk_isa16_mode(). This leads to p having an address with bit 0 set, and when we go on to attempt to store code at that address we take an address error exception due to the unaligned memory access. This leads to an exception prior to the kernel having configured its own exception handlers, so we jump to whatever handlers the bootloader configured. In the case of QEMU this results in a silent hang, since it has no useful general exception vector. Fix this by consistently declaring our TLB-related functions as functions. For handle_tlbl(), handle_tlbs() & handle_tlbm() we do this in asm/tlbex.h & we make use of the existing declaration of tlbmiss_handler_setup_pgd() in asm/mmu_context.h. Our TLB handler generation code in arch/mips/mm/tlbex.c is adjusted to deal with these definitions, in most cases simply by casting the function pointers to u32 pointers. This allows us to include asm/mmu_context.h in arch/mips/mm/tlbex.c to get the definitions of tlbmiss_handler_setup_pgd & pgd_current, removing some needless duplication. Consistently using msk_isa16_mode() on function pointers means we no longer need the tlbmiss_handler_setup_pgd_start symbol so that is removed entirely. Now that we're declaring our functions as functions GCC stops optimizing out msk_isa16_mode() & a microMIPS kernel built with either GCC 7.3.0 or 8.1.0 boots successfully. Signed-off-by: Paul Burton commit b29fea3676033c48a1145b075b3e88c785271f70 Author: Paul Burton Date: Fri Aug 10 15:24:39 2018 -0700 MIPS: Export tlbmiss_handler_setup_pgd near its definition We export tlbmiss_handler_setup_pgd in arch/mips/mm/tlbex.c close to a declaration of it, rather than close to its definition as is standard. We've supported exporting symbols in assembly code since commit 22823ab419d8 ("EXPORT_SYMBOL() for asm"), so move the export to follow the function's (stub) definition. Signed-off-by: Paul Burton commit 9d6f417714c3aaf67b23ffdc1d2b036cce3ecc1c Merge: 74b247f4c363 91134d849a0e Author: Daniel Borkmann Date: Sat Aug 11 01:58:47 2018 +0200 Merge branch 'bpf-reuseport-map' Martin KaFai Lau says: ==================== This series introduces a new map type "BPF_MAP_TYPE_REUSEPORT_SOCKARRAY" and a new prog type BPF_PROG_TYPE_SK_REUSEPORT. Here is a snippet from a commit message: "To unleash the full potential of a bpf prog, it is essential for the userspace to be capable of directly setting up a bpf map which can then be consumed by the bpf prog to make decision. In this case, decide which SO_REUSEPORT sk to serve the incoming request. By adding BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, the userspace has total control and visibility on where a SO_REUSEPORT sk should be located in a bpf map. The later patch will introduce BPF_PROG_TYPE_SK_REUSEPORT such that the bpf prog can directly select a sk from the bpf map. That will raise the programmability of the bpf prog attached to a reuseport group (a group of sk serving the same IP:PORT). For example, in UDP, the bpf prog can peek into the payload (e.g. through the "data" pointer introduced in the later patch) to learn the application level's connection information and then decide which sk to pick from a bpf map. The userspace can tightly couple the sk's location in a bpf map with the application logic in generating the UDP payload's connection information. This connection info contact/API stays within the userspace. Also, when used with map-in-map, the userspace can switch the old-server-process's inner map to a new-server-process's inner map in one call "bpf_map_update_elem(outer_map, &index, &new_reuseport_array)". The bpf prog will then direct incoming requests to the new process instead of the old process. The old process can finish draining the pending requests (e.g. by "accept()") before closing the old-fds. [Note that deleting a fd from a bpf map does not necessary mean the fd is closed]" ==================== Signed-off-by: Daniel Borkmann commit 91134d849a0e8fbc70b8607d280e0d325dcaf7bb Author: Martin KaFai Lau Date: Wed Aug 8 01:01:31 2018 -0700 bpf: Test BPF_PROG_TYPE_SK_REUSEPORT This patch add tests for the new BPF_PROG_TYPE_SK_REUSEPORT. The tests cover: - IPv4/IPv6 + TCP/UDP - TCP syncookie - TCP fastopen - Cases when the bpf_sk_select_reuseport() returning errors - Cases when the bpf prog returns SK_DROP - Values from sk_reuseport_md - outer_map => reuseport_array The test depends on commit 3eee1f75f2b9 ("bpf: fix bpf_skb_load_bytes_relative pkt length check") Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 6bc8529c414f931ce0acef3099b015cf2f5c4291 Author: Martin KaFai Lau Date: Wed Aug 8 01:01:30 2018 -0700 bpf: test BPF_MAP_TYPE_REUSEPORT_SOCKARRAY This patch adds tests for the new BPF_MAP_TYPE_REUSEPORT_SOCKARRAY. Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 3bd43a8c91cba0493e507ed7baefa9b5613c28a9 Author: Martin KaFai Lau Date: Wed Aug 8 01:01:29 2018 -0700 bpf: Sync bpf.h uapi to tools/ This patch sync include/uapi/linux/bpf.h to tools/include/uapi/linux/ Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit aa5f0c96cc7b96a678779055b2ff4cd9dabd8ba7 Author: Martin KaFai Lau Date: Wed Aug 8 01:01:27 2018 -0700 bpf: Refactor ARRAY_SIZE macro to bpf_util.h This patch refactors the ARRAY_SIZE macro to bpf_util.h. Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 8217ca653ec601246832d562207bc24bdf652d2f Author: Martin KaFai Lau Date: Wed Aug 8 01:01:26 2018 -0700 bpf: Enable BPF_PROG_TYPE_SK_REUSEPORT bpf prog in reuseport selection This patch allows a BPF_PROG_TYPE_SK_REUSEPORT bpf prog to select a SO_REUSEPORT sk from a BPF_MAP_TYPE_REUSEPORT_ARRAY introduced in the earlier patch. "bpf_run_sk_reuseport()" will return -ECONNREFUSED when the BPF_PROG_TYPE_SK_REUSEPORT prog returns SK_DROP. The callers, in inet[6]_hashtable.c and ipv[46]/udp.c, are modified to handle this case and return NULL immediately instead of continuing the sk search from its hashtable. It re-uses the existing SO_ATTACH_REUSEPORT_EBPF setsockopt to attach BPF_PROG_TYPE_SK_REUSEPORT. The "sk_reuseport_attach_bpf()" will check if the attaching bpf prog is in the new SK_REUSEPORT or the existing SOCKET_FILTER type and then check different things accordingly. One level of "__reuseport_attach_prog()" call is removed. The "sk_unhashed() && ..." and "sk->sk_reuseport_cb" tests are pushed back to "reuseport_attach_prog()" in sock_reuseport.c. sock_reuseport.c seems to have more knowledge on those test requirements than filter.c. In "reuseport_attach_prog()", after new_prog is attached to reuse->prog, the old_prog (if any) is also directly freed instead of returning the old_prog to the caller and asking the caller to free. The sysctl_optmem_max check is moved back to the "sk_reuseport_attach_filter()" and "sk_reuseport_attach_bpf()". As of other bpf prog types, the new BPF_PROG_TYPE_SK_REUSEPORT is only bounded by the usual "bpf_prog_charge_memlock()" during load time instead of bounded by both bpf_prog_charge_memlock and sysctl_optmem_max. Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 2dbb9b9e6df67d444fbe425c7f6014858d337adf Author: Martin KaFai Lau Date: Wed Aug 8 01:01:25 2018 -0700 bpf: Introduce BPF_PROG_TYPE_SK_REUSEPORT This patch adds a BPF_PROG_TYPE_SK_REUSEPORT which can select a SO_REUSEPORT sk from a BPF_MAP_TYPE_REUSEPORT_ARRAY. Like other non SK_FILTER/CGROUP_SKB program, it requires CAP_SYS_ADMIN. BPF_PROG_TYPE_SK_REUSEPORT introduces "struct sk_reuseport_kern" to store the bpf context instead of using the skb->cb[48]. At the SO_REUSEPORT sk lookup time, it is in the middle of transiting from a lower layer (ipv4/ipv6) to a upper layer (udp/tcp). At this point, it is not always clear where the bpf context can be appended in the skb->cb[48] to avoid saving-and-restoring cb[]. Even putting aside the difference between ipv4-vs-ipv6 and udp-vs-tcp. It is not clear if the lower layer is only ipv4 and ipv6 in the future and will it not touch the cb[] again before transiting to the upper layer. For example, in udp_gro_receive(), it uses the 48 byte NAPI_GRO_CB instead of IP[6]CB and it may still modify the cb[] after calling the udp[46]_lib_lookup_skb(). Because of the above reason, if sk->cb is used for the bpf ctx, saving-and-restoring is needed and likely the whole 48 bytes cb[] has to be saved and restored. Instead of saving, setting and restoring the cb[], this patch opts to create a new "struct sk_reuseport_kern" and setting the needed values in there. The new BPF_PROG_TYPE_SK_REUSEPORT and "struct sk_reuseport_(kern|md)" will serve all ipv4/ipv6 + udp/tcp combinations. There is no protocol specific usage at this point and it is also inline with the current sock_reuseport.c implementation (i.e. no protocol specific requirement). In "struct sk_reuseport_md", this patch exposes data/data_end/len with semantic similar to other existing usages. Together with "bpf_skb_load_bytes()" and "bpf_skb_load_bytes_relative()", the bpf prog can peek anywhere in the skb. The "bind_inany" tells the bpf prog that the reuseport group is bind-ed to a local INANY address which cannot be learned from skb. The new "bind_inany" is added to "struct sock_reuseport" which will be used when running the new "BPF_PROG_TYPE_SK_REUSEPORT" bpf prog in order to avoid repeating the "bind INANY" test on "sk_v6_rcv_saddr/sk->sk_rcv_saddr" every time a bpf prog is run. It can only be properly initialized when a "sk->sk_reuseport" enabled sk is adding to a hashtable (i.e. during "reuseport_alloc()" and "reuseport_add_sock()"). The new "sk_select_reuseport()" is the main helper that the bpf prog will use to select a SO_REUSEPORT sk. It is the only function that can use the new BPF_MAP_TYPE_REUSEPORT_ARRAY. As mentioned in the earlier patch, the validity of a selected sk is checked in run time in "sk_select_reuseport()". Doing the check in verification time is difficult and inflexible (consider the map-in-map use case). The runtime check is to compare the selected sk's reuseport_id with the reuseport_id that we want. This helper will return -EXXX if the selected sk cannot serve the incoming request (e.g. reuseport_id not match). The bpf prog can decide if it wants to do SK_DROP as its discretion. When the bpf prog returns SK_PASS, the kernel will check if a valid sk has been selected (i.e. "reuse_kern->selected_sk != NULL"). If it does , it will use the selected sk. If not, the kernel will select one from "reuse->socks[]" (as before this patch). The SK_DROP and SK_PASS handling logic will be in the next patch. Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 5dc4c4b7d4e8115e7cde96a030f98cb3ab2e458c Author: Martin KaFai Lau Date: Wed Aug 8 01:01:24 2018 -0700 bpf: Introduce BPF_MAP_TYPE_REUSEPORT_SOCKARRAY This patch introduces a new map type BPF_MAP_TYPE_REUSEPORT_SOCKARRAY. To unleash the full potential of a bpf prog, it is essential for the userspace to be capable of directly setting up a bpf map which can then be consumed by the bpf prog to make decision. In this case, decide which SO_REUSEPORT sk to serve the incoming request. By adding BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, the userspace has total control and visibility on where a SO_REUSEPORT sk should be located in a bpf map. The later patch will introduce BPF_PROG_TYPE_SK_REUSEPORT such that the bpf prog can directly select a sk from the bpf map. That will raise the programmability of the bpf prog attached to a reuseport group (a group of sk serving the same IP:PORT). For example, in UDP, the bpf prog can peek into the payload (e.g. through the "data" pointer introduced in the later patch) to learn the application level's connection information and then decide which sk to pick from a bpf map. The userspace can tightly couple the sk's location in a bpf map with the application logic in generating the UDP payload's connection information. This connection info contact/API stays within the userspace. Also, when used with map-in-map, the userspace can switch the old-server-process's inner map to a new-server-process's inner map in one call "bpf_map_update_elem(outer_map, &index, &new_reuseport_array)". The bpf prog will then direct incoming requests to the new process instead of the old process. The old process can finish draining the pending requests (e.g. by "accept()") before closing the old-fds. [Note that deleting a fd from a bpf map does not necessary mean the fd is closed] During map_update_elem(), Only SO_REUSEPORT sk (i.e. which has already been added to a reuse->socks[]) can be used. That means a SO_REUSEPORT sk that is "bind()" for UDP or "bind()+listen()" for TCP. These conditions are ensured in "reuseport_array_update_check()". A SO_REUSEPORT sk can only be added once to a map (i.e. the same sk cannot be added twice even to the same map). SO_REUSEPORT already allows another sk to be created for the same IP:PORT. There is no need to re-create a similar usage in the BPF side. When a SO_REUSEPORT is deleted from the "reuse->socks[]" (e.g. "close()"), it will notify the bpf map to remove it from the map also. It is done through "bpf_sk_reuseport_detach()" and it will only be called if >=1 of the "reuse->sock[]" has ever been added to a bpf map. The map_update()/map_delete() has to be in-sync with the "reuse->socks[]". Hence, the same "reuseport_lock" used by "reuse->socks[]" has to be used here also. Care has been taken to ensure the lock is only acquired when the adding sk passes some strict tests. and freeing the map does not require the reuseport_lock. The reuseport_array will also support lookup from the syscall side. It will return a sock_gen_cookie(). The sock_gen_cookie() is on-demand (i.e. a sk's cookie is not generated until the very first map_lookup_elem()). The lookup cookie is 64bits but it goes against the logical userspace expectation on 32bits sizeof(fd) (and as other fd based bpf maps do also). It may catch user in surprise if we enforce value_size=8 while userspace still pass a 32bits fd during update. Supporting different value_size between lookup and update seems unintuitive also. We also need to consider what if other existing fd based maps want to return 64bits value from syscall's lookup in the future. Hence, reuseport_array supports both value_size 4 and 8, and assuming user will usually use value_size=4. The syscall's lookup will return ENOSPC on value_size=4. It will will only return 64bits value from sock_gen_cookie() when user consciously choose value_size=8 (as a signal that lookup is desired) which then requires a 64bits value in both lookup and update. Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 736b46027eb4a4c602d3b8b93d2f48c9facbd915 Author: Martin KaFai Lau Date: Wed Aug 8 01:01:22 2018 -0700 net: Add ID (if needed) to sock_reuseport and expose reuseport_lock A later patch will introduce a BPF_MAP_TYPE_REUSEPORT_ARRAY which allows a SO_REUSEPORT sk to be added to a bpf map. When a sk is removed from reuse->socks[], it also needs to be removed from the bpf map. Also, when adding a sk to a bpf map, the bpf map needs to ensure it is indeed in a reuse->socks[]. Hence, reuseport_lock is needed by the bpf map to ensure its map_update_elem() and map_delete_elem() operations are in-sync with the reuse->socks[]. The BPF_MAP_TYPE_REUSEPORT_ARRAY map will only acquire the reuseport_lock after ensuring the adding sk is already in a reuseport group (i.e. reuse->socks[]). The map_lookup_elem() will be lockless. This patch also adds an ID to sock_reuseport. A later patch will introduce BPF_PROG_TYPE_SK_REUSEPORT which allows a bpf prog to select a sk from a bpf map. It is inflexible to statically enforce a bpf map can only contain the sk belonging to a particular reuse->socks[] (i.e. same IP:PORT) during the bpf verification time. For example, think about the the map-in-map situation where the inner map can be dynamically changed in runtime and the outer map may have inner maps belonging to different reuseport groups. Hence, when the bpf prog (in the new BPF_PROG_TYPE_SK_REUSEPORT type) selects a sk, this selected sk has to be checked to ensure it belongs to the requesting reuseport group (i.e. the group serving that IP:PORT). The "sk->sk_reuseport_cb" pointer cannot be used for this checking purpose because the pointer value will change after reuseport_grow(). Instead of saving all checking conditions like the ones preced calling "reuseport_add_sock()" and compare them everytime a bpf_prog is run, a 32bits ID is introduced to survive the reuseport_grow(). The ID is only acquired if any of the reuse->socks[] is added to the newly introduced "BPF_MAP_TYPE_REUSEPORT_ARRAY" map. If "BPF_MAP_TYPE_REUSEPORT_ARRAY" is not used, the changes in this patch is a no-op. Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 40a1227ea845a37ab197dd1caffb60b047fa36b1 Author: Martin KaFai Lau Date: Wed Aug 8 01:01:21 2018 -0700 tcp: Avoid TCP syncookie rejected by SO_REUSEPORT socket Although the actual cookie check "__cookie_v[46]_check()" does not involve sk specific info, it checks whether the sk has recent synq overflow event in "tcp_synq_no_recent_overflow()". The tcp_sk(sk)->rx_opt.ts_recent_stamp is updated every second when it has sent out a syncookie (through "tcp_synq_overflow()"). The above per sk "recent synq overflow event timestamp" works well for non SO_REUSEPORT use case. However, it may cause random connection request reject/discard when SO_REUSEPORT is used with syncookie because it fails the "tcp_synq_no_recent_overflow()" test. When SO_REUSEPORT is used, it usually has multiple listening socks serving TCP connection requests destinated to the same local IP:PORT. There are cases that the TCP-ACK-COOKIE may not be received by the same sk that sent out the syncookie. For example, if reuse->socks[] began with {sk0, sk1}, 1) sk1 sent out syncookies and tcp_sk(sk1)->rx_opt.ts_recent_stamp was updated. 2) the reuse->socks[] became {sk1, sk2} later. e.g. sk0 was first closed and then sk2 was added. Here, sk2 does not have ts_recent_stamp set. There are other ordering that will trigger the similar situation below but the idea is the same. 3) When the TCP-ACK-COOKIE comes back, sk2 was selected. "tcp_synq_no_recent_overflow(sk2)" returns true. In this case, all syncookies sent by sk1 will be handled (and rejected) by sk2 while sk1 is still alive. The userspace may create and remove listening SO_REUSEPORT sockets as it sees fit. E.g. Adding new thread (and SO_REUSEPORT sock) to handle incoming requests, old process stopping and new process starting...etc. With or without SO_ATTACH_REUSEPORT_[CB]BPF, the sockets leaving and joining a reuseport group makes picking the same sk to check the syncookie very difficult (if not impossible). The later patches will allow bpf prog more flexibility in deciding where a sk should be located in a bpf map and selecting a particular SO_REUSEPORT sock as it sees fit. e.g. Without closing any sock, replace the whole bpf reuseport_array in one map_update() by using map-in-map. Getting the syncookie check working smoothly across socks in the same "reuse->socks[]" is important. A partial solution is to set the newly added sk's ts_recent_stamp to the max ts_recent_stamp of a reuseport group but that will require to iterate through reuse->socks[] OR pessimistically set it to "now - TCP_SYNCOOKIE_VALID" when a sk is joining a reuseport group. However, neither of them will solve the existing sk getting moved around the reuse->socks[] and that sk may not have ts_recent_stamp updated, unlikely under continuous synflood but not impossible. This patch opts to treat the reuseport group as a whole when considering the last synq overflow timestamp since they are serving the same IP:PORT from the userspace (and BPF program) perspective. "synq_overflow_ts" is added to "struct sock_reuseport". The tcp_synq_overflow() and tcp_synq_no_recent_overflow() will update/check reuse->synq_overflow_ts if the sk is in a reuseport group. Similar to the reuseport decision in __inet_lookup_listener(), both sk->sk_reuseport and sk->sk_reuseport_cb are tested for SO_REUSEPORT usage. Update on "synq_overflow_ts" happens at roughly once every second. A synflood test was done with a 16 rx-queues and 16 reuseport sockets. No meaningful performance change is observed. Before and after the change is ~9Mpps in IPv4. Cc: Eric Dumazet Signed-off-by: Martin KaFai Lau Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit c4f7173ac3b7e22934e51f0121833642a581d723 Author: Steve French Date: Fri Aug 10 18:46:58 2018 -0500 smb3: create smb3 equivalent alias for cifs pseudo-xattrs We really, really don't want to be encouraging people to use cifs (the dialect) since it is insecure, so to avoid confusion we want to move them to names which include 'smb3' instead of 'cifs' - so this simply creates an alias for the pseudo-xattrs e.g. can now do: getfattr -n user.smb3.creationtime /mnt1/file and getfattr -n user.smb3.dosattrib /mnt1/file and getfattr -n system.smb3_acl /mnt1/file instead of forcing you to use the string 'cifs' in these (e.g. getfattr -n system.cifs_acl /mnt1/file) Signed-off-by: Steve French commit 3093336481565248ce47557445977eeac21bfca8 Author: Chao Yu Date: Sat Jul 28 18:37:58 2018 +0800 f2fs: fix to reset i_gc_failures correctly Let's reset i_gc_failures to zero when we unset pinned state for file. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d3f07c049dab1a3f1740f476afd3d5e5b738c21c Author: Chao Yu Date: Thu Aug 2 22:59:12 2018 +0800 f2fs: fix invalid memory access syzbot found the following crash on: HEAD commit: d9bd94c0bcaa Add linux-next specific files for 20180801 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=1001189c400000 kernel config: https://syzkaller.appspot.com/x/.config?x=cc8964ea4d04518c dashboard link: https://syzkaller.appspot.com/bug?extid=c966a82db0b14aa37e81 compiler: gcc (GCC) 8.0.1 20180413 (experimental) Unfortunately, I don't have any reproducer for this crash yet. IMPORTANT: if you fix the bug, please add the following tag to the commit: Reported-by: syzbot+c966a82db0b14aa37e81@syzkaller.appspotmail.com loop7: rw=12288, want=8200, limit=20 netlink: 65342 bytes leftover after parsing attributes in process `syz-executor4'. openvswitch: netlink: Message has 8 unknown bytes. kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN CPU: 1 PID: 7615 Comm: syz-executor7 Not tainted 4.18.0-rc7-next-20180801+ #29 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__read_once_size include/linux/compiler.h:188 [inline] RIP: 0010:compound_head include/linux/page-flags.h:142 [inline] RIP: 0010:PageLocked include/linux/page-flags.h:272 [inline] RIP: 0010:f2fs_put_page fs/f2fs/f2fs.h:2011 [inline] RIP: 0010:validate_checkpoint+0x66d/0xec0 fs/f2fs/checkpoint.c:835 Code: e8 58 05 7f fe 4c 8d 6b 80 4d 8d 74 24 08 48 b8 00 00 00 00 00 fc ff df 4c 89 ea 48 c1 ea 03 c6 04 02 00 4c 89 f2 48 c1 ea 03 <80> 3c 02 00 0f 85 f4 06 00 00 4c 89 ea 4d 8b 7c 24 08 48 b8 00 00 RSP: 0018:ffff8801937cebe8 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff8801937cef30 RCX: ffffc90006035000 RDX: 0000000000000000 RSI: ffffffff82fd9658 RDI: 0000000000000005 RBP: ffff8801937cef58 R08: ffff8801ab254700 R09: fffff94000d9e026 R10: fffff94000d9e026 R11: ffffea0006cf0137 R12: fffffffffffffffb R13: ffff8801937ceeb0 R14: 0000000000000003 R15: ffff880193419b40 FS: 00007f36a61d5700(0000) GS:ffff8801db100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc04ff93000 CR3: 00000001d0562000 CR4: 00000000001426e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: f2fs_get_valid_checkpoint+0x436/0x1ec0 fs/f2fs/checkpoint.c:860 f2fs_fill_super+0x2d42/0x8110 fs/f2fs/super.c:2883 mount_bdev+0x314/0x3e0 fs/super.c:1344 f2fs_mount+0x3c/0x50 fs/f2fs/super.c:3133 legacy_get_tree+0x131/0x460 fs/fs_context.c:729 vfs_get_tree+0x1cb/0x5c0 fs/super.c:1743 do_new_mount fs/namespace.c:2603 [inline] do_mount+0x6f2/0x1e20 fs/namespace.c:2927 ksys_mount+0x12d/0x140 fs/namespace.c:3143 __do_sys_mount fs/namespace.c:3157 [inline] __se_sys_mount fs/namespace.c:3154 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3154 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45943a Code: b8 a6 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 bd 8a fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 9a 8a fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007f36a61d4a88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f36a61d4b30 RCX: 000000000045943a RDX: 00007f36a61d4ad0 RSI: 0000000020000100 RDI: 00007f36a61d4af0 RBP: 0000000020000100 R08: 00007f36a61d4b30 R09: 00007f36a61d4ad0 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000013 R13: 0000000000000000 R14: 00000000004c8ea0 R15: 0000000000000000 Modules linked in: Dumping ftrace buffer: (ftrace buffer empty) ---[ end trace bd8550c129352286 ]--- RIP: 0010:__read_once_size include/linux/compiler.h:188 [inline] RIP: 0010:compound_head include/linux/page-flags.h:142 [inline] RIP: 0010:PageLocked include/linux/page-flags.h:272 [inline] RIP: 0010:f2fs_put_page fs/f2fs/f2fs.h:2011 [inline] RIP: 0010:validate_checkpoint+0x66d/0xec0 fs/f2fs/checkpoint.c:835 Code: e8 58 05 7f fe 4c 8d 6b 80 4d 8d 74 24 08 48 b8 00 00 00 00 00 fc ff df 4c 89 ea 48 c1 ea 03 c6 04 02 00 4c 89 f2 48 c1 ea 03 <80> 3c 02 00 0f 85 f4 06 00 00 4c 89 ea 4d 8b 7c 24 08 48 b8 00 00 RSP: 0018:ffff8801937cebe8 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff8801937cef30 RCX: ffffc90006035000 RDX: 0000000000000000 RSI: ffffffff82fd9658 RDI: 0000000000000005 netlink: 65342 bytes leftover after parsing attributes in process `syz-executor4'. RBP: ffff8801937cef58 R08: ffff8801ab254700 R09: fffff94000d9e026 openvswitch: netlink: Message has 8 unknown bytes. R10: fffff94000d9e026 R11: ffffea0006cf0137 R12: fffffffffffffffb R13: ffff8801937ceeb0 R14: 0000000000000003 R15: ffff880193419b40 FS: 00007f36a61d5700(0000) GS:ffff8801db100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc04ff93000 CR3: 00000001d0562000 CR4: 00000000001426e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 In validate_checkpoint(), if we failed to call get_checkpoint_version(), we will pass returned invalid page pointer into f2fs_put_page, cause accessing invalid memory, this patch tries to handle error path correctly to fix this issue. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 50fa53eccf9f911a5b435248a2b0bd484fd82e5e Author: Chao Yu Date: Thu Aug 2 23:03:19 2018 +0800 f2fs: fix to avoid broken of dnode block list f2fs recovery flow is relying on dnode block link list, it means fsynced file recovery depends on previous dnode's persistence in the list, so during fsync() we should wait on all regular inode's dnode writebacked before issuing flush. By this way, we can avoid dnode block list being broken by out-of-order IO submission due to IO scheduler or driver. Sheng Yong helps to do the test with this patch: Target:/data (f2fs, -) 64MB / 32768KB / 4KB / 8 1 / PERSIST / Index Base: SEQ-RD(MB/s) SEQ-WR(MB/s) RND-RD(IOPS) RND-WR(IOPS) Insert(TPS) Update(TPS) Delete(TPS) 1 867.82 204.15 41440.03 41370.54 680.8 1025.94 1031.08 2 871.87 205.87 41370.3 40275.2 791.14 1065.84 1101.7 3 866.52 205.69 41795.67 40596.16 694.69 1037.16 1031.48 Avg 868.7366667 205.2366667 41535.33333 40747.3 722.21 1042.98 1054.753333 After: SEQ-RD(MB/s) SEQ-WR(MB/s) RND-RD(IOPS) RND-WR(IOPS) Insert(TPS) Update(TPS) Delete(TPS) 1 798.81 202.5 41143 40613.87 602.71 838.08 913.83 2 805.79 206.47 40297.2 41291.46 604.44 840.75 924.27 3 814.83 206.17 41209.57 40453.62 602.85 834.66 927.91 Avg 806.4766667 205.0466667 40883.25667 40786.31667 603.3333333 837.83 922.0033333 Patched/Original: 0.928332713 0.999074239 0.984300676 1.000957528 0.835398753 0.803303994 0.874141189 It looks like atomic write will suffer performance regression. I suspect that the criminal is that we forcing to wait all dnode being in storage cache before we issue PREFLUSH+FUA. BTW, will commit ("f2fs: don't need to wait for node writes for atomic write") cause the problem: we will lose data of last transaction after SPO, even if atomic write return no error: - atomic_open(); - write() P1, P2, P3; - atomic_commit(); - writeback data: P1, P2, P3; - writeback node: N1, N2, N3; <--- If N1, N2 is not writebacked, N3 with fsync_mark is writebacked, In SPOR, we won't find N3 since node chain is broken, turns out that losing last transaction. - preflush + fua; - power-cut If we don't wait dnode writeback for atomic_write: SEQ-RD(MB/s) SEQ-WR(MB/s) RND-RD(IOPS) RND-WR(IOPS) Insert(TPS) Update(TPS) Delete(TPS) 1 779.91 206.03 41621.5 40333.16 716.9 1038.21 1034.85 2 848.51 204.35 40082.44 39486.17 791.83 1119.96 1083.77 3 772.12 206.27 41335.25 41599.65 723.29 1055.07 971.92 Avg 800.18 205.55 41013.06333 40472.99333 744.0066667 1071.08 1030.18 Patched/Original: 0.92108464 1.001526693 0.987425886 0.993268102 1.030180511 1.026942031 0.976702294 SQLite's performance recovers. Jaegeuk: "Practically, I don't see db corruption becase of this. We can excuse to lose the last transaction." Finally, we decide to keep original implementation of atomic write interface sematics that we don't wait all dnode writeback before preflush+fua submission. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6e45f2a59ffb440f28719ab3a68bee5b8e9df16b Author: Gustavo A. R. Silva Date: Wed Aug 1 19:51:38 2018 -0500 f2fs: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e494c2f995d6181d6e29c4927d68e0f295ecf75b Author: Chao Yu Date: Wed Aug 1 19:16:11 2018 +0800 f2fs: fix to do sanity check with cp_pack_start_sum After fuzzing, cp_pack_start_sum could be corrupted, so current log's summary info should be wrong due to loading incorrect summary block. Then, if segment's type in current log is exceeded NR_CURSEG_TYPE, it can lead accessing invalid dirty_i->dirty_segmap bitmap finally. Add sanity check for cp_pack_start_sum to fix this issue. https://bugzilla.kernel.org/show_bug.cgi?id=200419 - Reproduce - Kernel message (f2fs-dev w/ KASAN) [ 3117.578432] F2FS-fs (loop0): Invalid log blocks per segment (8) [ 3117.578445] F2FS-fs (loop0): Can't find valid F2FS filesystem in 2th superblock [ 3117.581364] F2FS-fs (loop0): invalid crc_offset: 30716 [ 3117.583564] WARNING: CPU: 1 PID: 1225 at fs/f2fs/checkpoint.c:90 __get_meta_page+0x448/0x4b0 [ 3117.583570] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer joydev input_leds serio_raw snd soundcore mac_hid i2c_piix4 ib_iser rdma_cm iw_cm ib_cm ib_core configfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi btrfs zstd_decompress zstd_compress xxhash raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear 8139too qxl ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel psmouse aes_x86_64 8139cp crypto_simd cryptd mii glue_helper pata_acpi floppy [ 3117.584014] CPU: 1 PID: 1225 Comm: mount Not tainted 4.17.0+ #1 [ 3117.584017] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 3117.584022] RIP: 0010:__get_meta_page+0x448/0x4b0 [ 3117.584023] Code: 00 49 8d bc 24 84 00 00 00 e8 74 54 da ff 41 83 8c 24 84 00 00 00 08 4c 89 f6 4c 89 ef e8 c0 d9 95 00 48 89 ef e8 18 e3 00 00 <0f> 0b f0 80 4d 48 04 e9 0f fe ff ff 0f 0b 48 89 c7 48 89 04 24 e8 [ 3117.584072] RSP: 0018:ffff88018eb678c0 EFLAGS: 00010286 [ 3117.584082] RAX: ffff88018f0a6a78 RBX: ffffea0007a46600 RCX: ffffffff9314d1b2 [ 3117.584085] RDX: ffffffff00000001 RSI: 0000000000000000 RDI: ffff88018f0a6a98 [ 3117.584087] RBP: ffff88018ebe9980 R08: 0000000000000002 R09: 0000000000000001 [ 3117.584090] R10: 0000000000000001 R11: ffffed00326e4450 R12: ffff880193722200 [ 3117.584092] R13: ffff88018ebe9afc R14: 0000000000000206 R15: ffff88018eb67900 [ 3117.584096] FS: 00007f5694636840(0000) GS:ffff8801f3b00000(0000) knlGS:0000000000000000 [ 3117.584098] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3117.584101] CR2: 00000000016f21b8 CR3: 0000000191c22000 CR4: 00000000000006e0 [ 3117.584112] Call Trace: [ 3117.584121] ? f2fs_set_meta_page_dirty+0x150/0x150 [ 3117.584127] ? f2fs_build_segment_manager+0xbf9/0x3190 [ 3117.584133] ? f2fs_npages_for_summary_flush+0x75/0x120 [ 3117.584145] f2fs_build_segment_manager+0xda8/0x3190 [ 3117.584151] ? f2fs_get_valid_checkpoint+0x298/0xa00 [ 3117.584156] ? f2fs_flush_sit_entries+0x10e0/0x10e0 [ 3117.584184] ? map_id_range_down+0x17c/0x1b0 [ 3117.584188] ? __put_user_ns+0x30/0x30 [ 3117.584206] ? find_next_bit+0x53/0x90 [ 3117.584237] ? cpumask_next+0x16/0x20 [ 3117.584249] f2fs_fill_super+0x1948/0x2b40 [ 3117.584258] ? f2fs_commit_super+0x1a0/0x1a0 [ 3117.584279] ? sget_userns+0x65e/0x690 [ 3117.584296] ? set_blocksize+0x88/0x130 [ 3117.584302] ? f2fs_commit_super+0x1a0/0x1a0 [ 3117.584305] mount_bdev+0x1c0/0x200 [ 3117.584310] mount_fs+0x5c/0x190 [ 3117.584320] vfs_kern_mount+0x64/0x190 [ 3117.584330] do_mount+0x2e4/0x1450 [ 3117.584343] ? lockref_put_return+0x130/0x130 [ 3117.584347] ? copy_mount_string+0x20/0x20 [ 3117.584357] ? kasan_unpoison_shadow+0x31/0x40 [ 3117.584362] ? kasan_kmalloc+0xa6/0xd0 [ 3117.584373] ? memcg_kmem_put_cache+0x16/0x90 [ 3117.584377] ? __kmalloc_track_caller+0x196/0x210 [ 3117.584383] ? _copy_from_user+0x61/0x90 [ 3117.584396] ? memdup_user+0x3e/0x60 [ 3117.584401] ksys_mount+0x7e/0xd0 [ 3117.584405] __x64_sys_mount+0x62/0x70 [ 3117.584427] do_syscall_64+0x73/0x160 [ 3117.584440] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 3117.584455] RIP: 0033:0x7f5693f14b9a [ 3117.584456] Code: 48 8b 0d 01 c3 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ce c2 2b 00 f7 d8 64 89 01 48 [ 3117.584505] RSP: 002b:00007fff27346488 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 [ 3117.584510] RAX: ffffffffffffffda RBX: 00000000016e2030 RCX: 00007f5693f14b9a [ 3117.584512] RDX: 00000000016e2210 RSI: 00000000016e3f30 RDI: 00000000016ee040 [ 3117.584514] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 [ 3117.584516] R10: 00000000c0ed0000 R11: 0000000000000206 R12: 00000000016ee040 [ 3117.584519] R13: 00000000016e2210 R14: 0000000000000000 R15: 0000000000000003 [ 3117.584523] ---[ end trace a8e0d899985faf31 ]--- [ 3117.685663] F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix. [ 3117.685673] F2FS-fs (loop0): recover_data: ino = 2 (i_size: recover) recovered = 1, err = 0 [ 3117.685707] ================================================================== [ 3117.685955] BUG: KASAN: slab-out-of-bounds in __remove_dirty_segment+0xdd/0x1e0 [ 3117.686175] Read of size 8 at addr ffff88018f0a63d0 by task mount/1225 [ 3117.686477] CPU: 0 PID: 1225 Comm: mount Tainted: G W 4.17.0+ #1 [ 3117.686481] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 3117.686483] Call Trace: [ 3117.686494] dump_stack+0x71/0xab [ 3117.686512] print_address_description+0x6b/0x290 [ 3117.686517] kasan_report+0x28e/0x390 [ 3117.686522] ? __remove_dirty_segment+0xdd/0x1e0 [ 3117.686527] __remove_dirty_segment+0xdd/0x1e0 [ 3117.686532] locate_dirty_segment+0x189/0x190 [ 3117.686538] f2fs_allocate_new_segments+0xa9/0xe0 [ 3117.686543] recover_data+0x703/0x2c20 [ 3117.686547] ? f2fs_recover_fsync_data+0x48f/0xd50 [ 3117.686553] ? ksys_mount+0x7e/0xd0 [ 3117.686564] ? policy_nodemask+0x1a/0x90 [ 3117.686567] ? policy_node+0x56/0x70 [ 3117.686571] ? add_fsync_inode+0xf0/0xf0 [ 3117.686592] ? blk_finish_plug+0x44/0x60 [ 3117.686597] ? f2fs_ra_meta_pages+0x38b/0x5e0 [ 3117.686602] ? find_inode_fast+0xac/0xc0 [ 3117.686606] ? f2fs_is_valid_blkaddr+0x320/0x320 [ 3117.686618] ? __radix_tree_lookup+0x150/0x150 [ 3117.686633] ? dqget+0x670/0x670 [ 3117.686648] ? pagecache_get_page+0x29/0x410 [ 3117.686656] ? kmem_cache_alloc+0x176/0x1e0 [ 3117.686660] ? f2fs_is_valid_blkaddr+0x11d/0x320 [ 3117.686664] f2fs_recover_fsync_data+0xc23/0xd50 [ 3117.686670] ? f2fs_space_for_roll_forward+0x60/0x60 [ 3117.686674] ? rb_insert_color+0x323/0x3d0 [ 3117.686678] ? f2fs_recover_orphan_inodes+0xa5/0x700 [ 3117.686683] ? proc_register+0x153/0x1d0 [ 3117.686686] ? f2fs_remove_orphan_inode+0x10/0x10 [ 3117.686695] ? f2fs_attr_store+0x50/0x50 [ 3117.686700] ? proc_create_single_data+0x52/0x60 [ 3117.686707] f2fs_fill_super+0x1d06/0x2b40 [ 3117.686728] ? f2fs_commit_super+0x1a0/0x1a0 [ 3117.686735] ? sget_userns+0x65e/0x690 [ 3117.686740] ? set_blocksize+0x88/0x130 [ 3117.686745] ? f2fs_commit_super+0x1a0/0x1a0 [ 3117.686748] mount_bdev+0x1c0/0x200 [ 3117.686753] mount_fs+0x5c/0x190 [ 3117.686758] vfs_kern_mount+0x64/0x190 [ 3117.686762] do_mount+0x2e4/0x1450 [ 3117.686769] ? lockref_put_return+0x130/0x130 [ 3117.686773] ? copy_mount_string+0x20/0x20 [ 3117.686777] ? kasan_unpoison_shadow+0x31/0x40 [ 3117.686780] ? kasan_kmalloc+0xa6/0xd0 [ 3117.686786] ? memcg_kmem_put_cache+0x16/0x90 [ 3117.686790] ? __kmalloc_track_caller+0x196/0x210 [ 3117.686795] ? _copy_from_user+0x61/0x90 [ 3117.686801] ? memdup_user+0x3e/0x60 [ 3117.686804] ksys_mount+0x7e/0xd0 [ 3117.686809] __x64_sys_mount+0x62/0x70 [ 3117.686816] do_syscall_64+0x73/0x160 [ 3117.686824] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 3117.686829] RIP: 0033:0x7f5693f14b9a [ 3117.686830] Code: 48 8b 0d 01 c3 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ce c2 2b 00 f7 d8 64 89 01 48 [ 3117.686887] RSP: 002b:00007fff27346488 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 [ 3117.686892] RAX: ffffffffffffffda RBX: 00000000016e2030 RCX: 00007f5693f14b9a [ 3117.686894] RDX: 00000000016e2210 RSI: 00000000016e3f30 RDI: 00000000016ee040 [ 3117.686896] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 [ 3117.686899] R10: 00000000c0ed0000 R11: 0000000000000206 R12: 00000000016ee040 [ 3117.686901] R13: 00000000016e2210 R14: 0000000000000000 R15: 0000000000000003 [ 3117.687005] Allocated by task 1225: [ 3117.687152] kasan_kmalloc+0xa6/0xd0 [ 3117.687157] kmem_cache_alloc_trace+0xfd/0x200 [ 3117.687161] f2fs_build_segment_manager+0x2d09/0x3190 [ 3117.687165] f2fs_fill_super+0x1948/0x2b40 [ 3117.687168] mount_bdev+0x1c0/0x200 [ 3117.687171] mount_fs+0x5c/0x190 [ 3117.687174] vfs_kern_mount+0x64/0x190 [ 3117.687177] do_mount+0x2e4/0x1450 [ 3117.687180] ksys_mount+0x7e/0xd0 [ 3117.687182] __x64_sys_mount+0x62/0x70 [ 3117.687186] do_syscall_64+0x73/0x160 [ 3117.687190] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 3117.687285] Freed by task 19: [ 3117.687412] __kasan_slab_free+0x137/0x190 [ 3117.687416] kfree+0x8b/0x1b0 [ 3117.687460] ttm_bo_man_put_node+0x61/0x80 [ttm] [ 3117.687476] ttm_bo_cleanup_refs+0x15f/0x250 [ttm] [ 3117.687492] ttm_bo_delayed_delete+0x2f0/0x300 [ttm] [ 3117.687507] ttm_bo_delayed_workqueue+0x17/0x50 [ttm] [ 3117.687528] process_one_work+0x2f9/0x740 [ 3117.687531] worker_thread+0x78/0x6b0 [ 3117.687541] kthread+0x177/0x1c0 [ 3117.687545] ret_from_fork+0x35/0x40 [ 3117.687638] The buggy address belongs to the object at ffff88018f0a6300 which belongs to the cache kmalloc-192 of size 192 [ 3117.688014] The buggy address is located 16 bytes to the right of 192-byte region [ffff88018f0a6300, ffff88018f0a63c0) [ 3117.688382] The buggy address belongs to the page: [ 3117.688554] page:ffffea00063c2980 count:1 mapcount:0 mapping:ffff8801f3403180 index:0x0 [ 3117.688788] flags: 0x17fff8000000100(slab) [ 3117.688944] raw: 017fff8000000100 ffffea00063c2840 0000000e0000000e ffff8801f3403180 [ 3117.689166] raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 [ 3117.689386] page dumped because: kasan: bad access detected [ 3117.689653] Memory state around the buggy address: [ 3117.689816] ffff88018f0a6280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 3117.690027] ffff88018f0a6300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 3117.690239] >ffff88018f0a6380: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 3117.690448] ^ [ 3117.690644] ffff88018f0a6400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 3117.690868] ffff88018f0a6480: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 3117.691077] ================================================================== [ 3117.691290] Disabling lock debugging due to kernel taint [ 3117.693893] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 [ 3117.694120] PGD 80000001f01bc067 P4D 80000001f01bc067 PUD 1d9638067 PMD 0 [ 3117.694338] Oops: 0002 [#1] SMP KASAN PTI [ 3117.694490] CPU: 1 PID: 1225 Comm: mount Tainted: G B W 4.17.0+ #1 [ 3117.694703] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 3117.695073] RIP: 0010:__remove_dirty_segment+0xe2/0x1e0 [ 3117.695246] Code: c4 48 89 c7 e8 cf bb d7 ff 45 0f b6 24 24 41 83 e4 3f 44 88 64 24 07 41 83 e4 3f 4a 8d 7c e3 08 e8 b3 bc d7 ff 4a 8b 4c e3 08 4c 0f b3 29 0f 82 94 00 00 00 48 8d bd 20 04 00 00 e8 97 bb d7 [ 3117.695793] RSP: 0018:ffff88018eb67638 EFLAGS: 00010292 [ 3117.695969] RAX: 0000000000000000 RBX: ffff88018f0a6300 RCX: 0000000000000000 [ 3117.696182] RDX: 0000000000000000 RSI: 0000000000000297 RDI: 0000000000000297 [ 3117.696391] RBP: ffff88018ebe9980 R08: ffffed003e743ebb R09: ffffed003e743ebb [ 3117.696604] R10: 0000000000000001 R11: ffffed003e743eba R12: 0000000000000019 [ 3117.696813] R13: 0000000000000014 R14: 0000000000000320 R15: ffff88018ebe99e0 [ 3117.697032] FS: 00007f5694636840(0000) GS:ffff8801f3b00000(0000) knlGS:0000000000000000 [ 3117.697280] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3117.702357] CR2: 00007fe89bb1a000 CR3: 0000000191c22000 CR4: 00000000000006e0 [ 3117.707235] Call Trace: [ 3117.712077] locate_dirty_segment+0x189/0x190 [ 3117.716891] f2fs_allocate_new_segments+0xa9/0xe0 [ 3117.721617] recover_data+0x703/0x2c20 [ 3117.726316] ? f2fs_recover_fsync_data+0x48f/0xd50 [ 3117.730957] ? ksys_mount+0x7e/0xd0 [ 3117.735573] ? policy_nodemask+0x1a/0x90 [ 3117.740198] ? policy_node+0x56/0x70 [ 3117.744829] ? add_fsync_inode+0xf0/0xf0 [ 3117.749487] ? blk_finish_plug+0x44/0x60 [ 3117.754152] ? f2fs_ra_meta_pages+0x38b/0x5e0 [ 3117.758831] ? find_inode_fast+0xac/0xc0 [ 3117.763448] ? f2fs_is_valid_blkaddr+0x320/0x320 [ 3117.768046] ? __radix_tree_lookup+0x150/0x150 [ 3117.772603] ? dqget+0x670/0x670 [ 3117.777159] ? pagecache_get_page+0x29/0x410 [ 3117.781648] ? kmem_cache_alloc+0x176/0x1e0 [ 3117.786067] ? f2fs_is_valid_blkaddr+0x11d/0x320 [ 3117.790476] f2fs_recover_fsync_data+0xc23/0xd50 [ 3117.794790] ? f2fs_space_for_roll_forward+0x60/0x60 [ 3117.799086] ? rb_insert_color+0x323/0x3d0 [ 3117.803304] ? f2fs_recover_orphan_inodes+0xa5/0x700 [ 3117.807563] ? proc_register+0x153/0x1d0 [ 3117.811766] ? f2fs_remove_orphan_inode+0x10/0x10 [ 3117.815947] ? f2fs_attr_store+0x50/0x50 [ 3117.820087] ? proc_create_single_data+0x52/0x60 [ 3117.824262] f2fs_fill_super+0x1d06/0x2b40 [ 3117.828367] ? f2fs_commit_super+0x1a0/0x1a0 [ 3117.832432] ? sget_userns+0x65e/0x690 [ 3117.836500] ? set_blocksize+0x88/0x130 [ 3117.840501] ? f2fs_commit_super+0x1a0/0x1a0 [ 3117.844420] mount_bdev+0x1c0/0x200 [ 3117.848275] mount_fs+0x5c/0x190 [ 3117.852053] vfs_kern_mount+0x64/0x190 [ 3117.855810] do_mount+0x2e4/0x1450 [ 3117.859441] ? lockref_put_return+0x130/0x130 [ 3117.862996] ? copy_mount_string+0x20/0x20 [ 3117.866417] ? kasan_unpoison_shadow+0x31/0x40 [ 3117.869719] ? kasan_kmalloc+0xa6/0xd0 [ 3117.872948] ? memcg_kmem_put_cache+0x16/0x90 [ 3117.876121] ? __kmalloc_track_caller+0x196/0x210 [ 3117.879333] ? _copy_from_user+0x61/0x90 [ 3117.882467] ? memdup_user+0x3e/0x60 [ 3117.885604] ksys_mount+0x7e/0xd0 [ 3117.888700] __x64_sys_mount+0x62/0x70 [ 3117.891742] do_syscall_64+0x73/0x160 [ 3117.894692] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 3117.897669] RIP: 0033:0x7f5693f14b9a [ 3117.900563] Code: 48 8b 0d 01 c3 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ce c2 2b 00 f7 d8 64 89 01 48 [ 3117.906922] RSP: 002b:00007fff27346488 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 [ 3117.910159] RAX: ffffffffffffffda RBX: 00000000016e2030 RCX: 00007f5693f14b9a [ 3117.913469] RDX: 00000000016e2210 RSI: 00000000016e3f30 RDI: 00000000016ee040 [ 3117.916764] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 [ 3117.920071] R10: 00000000c0ed0000 R11: 0000000000000206 R12: 00000000016ee040 [ 3117.923393] R13: 00000000016e2210 R14: 0000000000000000 R15: 0000000000000003 [ 3117.926680] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer joydev input_leds serio_raw snd soundcore mac_hid i2c_piix4 ib_iser rdma_cm iw_cm ib_cm ib_core configfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi btrfs zstd_decompress zstd_compress xxhash raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear 8139too qxl ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel psmouse aes_x86_64 8139cp crypto_simd cryptd mii glue_helper pata_acpi floppy [ 3117.949979] CR2: 0000000000000000 [ 3117.954283] ---[ end trace a8e0d899985faf32 ]--- [ 3117.958575] RIP: 0010:__remove_dirty_segment+0xe2/0x1e0 [ 3117.962810] Code: c4 48 89 c7 e8 cf bb d7 ff 45 0f b6 24 24 41 83 e4 3f 44 88 64 24 07 41 83 e4 3f 4a 8d 7c e3 08 e8 b3 bc d7 ff 4a 8b 4c e3 08 4c 0f b3 29 0f 82 94 00 00 00 48 8d bd 20 04 00 00 e8 97 bb d7 [ 3117.971789] RSP: 0018:ffff88018eb67638 EFLAGS: 00010292 [ 3117.976333] RAX: 0000000000000000 RBX: ffff88018f0a6300 RCX: 0000000000000000 [ 3117.980926] RDX: 0000000000000000 RSI: 0000000000000297 RDI: 0000000000000297 [ 3117.985497] RBP: ffff88018ebe9980 R08: ffffed003e743ebb R09: ffffed003e743ebb [ 3117.990098] R10: 0000000000000001 R11: ffffed003e743eba R12: 0000000000000019 [ 3117.994761] R13: 0000000000000014 R14: 0000000000000320 R15: ffff88018ebe99e0 [ 3117.999392] FS: 00007f5694636840(0000) GS:ffff8801f3b00000(0000) knlGS:0000000000000000 [ 3118.004096] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3118.008816] CR2: 00007fe89bb1a000 CR3: 0000000191c22000 CR4: 00000000000006e0 - Location https://elixir.bootlin.com/linux/v4.18-rc3/source/fs/f2fs/segment.c#L775 if (test_and_clear_bit(segno, dirty_i->dirty_segmap[t])) dirty_i->nr_dirty[t]--; Here dirty_i->dirty_segmap[t] can be NULL which leads to crash in test_and_clear_bit() Reported-by Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 8d714f8aa34cf6a49b8d8d291ab01a59699604bd Author: Jaegeuk Kim Date: Tue Jul 31 09:09:01 2018 -0700 f2fs: avoid f2fs_bug_on() in cp_error case There is a subtle race condition to invoke f2fs_bug_on() in shutdown tests. I've confirmed that the last checkpoint is preserved in consistent state, so it'd be fine to just return error at this moment. Signed-off-by: Jaegeuk Kim commit 66110abc4c931f879d70e83e1281f891699364bf Author: Chao Yu Date: Sun Jul 29 12:16:59 2018 +0800 f2fs: fix to clear PG_checked flag in set_page_dirty() PG_checked flag will be set on data page during GC, later, we can recognize such page by the flag and migrate page to cold segment. But previously, we don't clear this flag when invalidating data page, after page redirtying, we will write it into wrong log. Let's clear PG_checked flag in set_page_dirty() to avoid this. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 546907de9952d718dd0ae1a78a665a56ab583635 Author: Colin Ian King Date: Wed Aug 8 18:18:33 2018 +0100 drm/msm: a6xx: fix spelling mistake: "initalization" -> "initialization" Trivial fix to spelling mistake in dev_err message and comment Signed-off-by: Colin Ian King Signed-off-by: Rob Clark commit 77a209cd7153cd758aa1b1417fb10017bead9454 Author: Jeykumar Sankaran Date: Tue Aug 7 19:56:51 2018 -0700 drm/msm/disp/dpu: fix early dereference of physical encoder This change validates the physical encoder before it is dereferenced. Signed-off-by: Jeykumar Sankaran Signed-off-by: Rob Clark commit 4b565ca5a2cbbbb6345e8789da89c193b6b00e5a Author: Jordan Crouse Date: Mon Aug 6 11:33:24 2018 -0600 drm/msm: Add A6XX device support Add support for the A6XX family of Adreno GPUs. The biggest addition is the GMU (Graphics Management Unit) which takes over most of the power management of the GPU itself but in a ironic twist of fate needs a goodly amount of management itself. Add support for the A6XX core code, the GMU and the HFI (hardware firmware interface) queue that the CPU uses to communicate with the GMU. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 2d756322533322650f4476265ba413498e998b56 Author: Rob Clark Date: Mon Aug 6 14:57:14 2018 -0400 drm/msm: update generated headers Resync generated headers to pull in a6xx registers. Signed-off-by: Rob Clark commit 2c087a336676961513f61a0012a88e399e69e943 Author: Jordan Crouse Date: Mon Aug 6 11:33:22 2018 -0600 drm/msm/adreno: Load the firmware before bringing up the hardware Failure to load firmware is the primary reason to fail adreno_load_gpu(). Try to load it first before going into the hardware initialization code and unwinding it. This is important for a6xx because the GMU gets loaded from the runtime power code and it is more costly to fail in that path because of missing firmware. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 8e54eea503caec53d39e67407ffa785690f38ba4 Author: Jordan Crouse Date: Mon Aug 6 11:33:21 2018 -0600 drm/msm: Add a helper function to parse clock names Add a helper function to parse the clock names and set up the bulk data so we can take advantage of the bulk clock functions instead of rolling our own. This is added as a helper function so the upcoming a6xx GMU code can also take advantage of it. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 3d83d3188460bf97afa0ac9895265422411e473a Author: Randy Dunlap Date: Mon Aug 6 16:24:55 2018 -0700 Documentation: corrections to console/console.txt Fix typos, line length, grammar, punctuation, and capitalization in console.txt. Signed-off-by: Randy Dunlap Cc: Antonino A. Daplas Cc: Greg Kroah-Hartman Signed-off-by: Jonathan Corbet commit 96fdb7c49957085b575127ae226e8c076cfcdf31 Author: Randy Dunlap Date: Tue Aug 7 08:28:25 2018 -0700 Documentation: add ioctl number entry for v4l2-subdev.h Update ioctl-number.txt for ioctl's that are defined in . Signed-off-by: Randy Dunlap Signed-off-by: Jonathan Corbet commit ee97d8abacb90487a2314eac5dd632fac920ca32 Author: Fox Foster Date: Tue Aug 7 19:47:51 2018 +0100 Remove gendered language from management style documentation This small commit replaces gendered pronouns for neutral ones. Signed-off-by: Fox Foster Signed-off-by: Jonathan Corbet commit 6a1f444fefeba392d1232b408aaf5902e33e0982 Author: Jason Gunthorpe Date: Thu Aug 9 20:14:39 2018 -0600 IB/uverbs: Remove the ib_uverbs_attr pointer from each attr Memory in the bundle is valuable, do not waste it holding an 8 byte pointer for the rare case of writing to a PTR_OUT. We can compute the pointer by storing a small 1 byte array offset and the base address of the uattr memory in the bundle private memory. This also means we can access the kernel's copy of the ib_uverbs_attr, so drop the copy of flags as well. Since the uattr base should be private bundle information this also de-inlines the already too big uverbs_copy_to inline and moves create_udata into uverbs_ioctl.c so they can see the private struct definition. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky commit 4b3dd2bbf0818ccb23e7f2831f2ca4a86789cd1f Author: Jason Gunthorpe Date: Thu Aug 9 20:14:38 2018 -0600 IB/uverbs: Provide implementation private memory for the uverbs_attr_bundle This already existed as the anonymous 'ctx' structure, but this was not really a useful form. Hoist this struct into bundle_priv and rework the internal things to use it instead. Move a bunch of the processing internal state into the priv and reduce the excessive use of function arguments. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky commit 6b0d08f4a27134e6fb49aa33ceb53356081bc92e Author: Jason Gunthorpe Date: Thu Aug 9 20:14:37 2018 -0600 IB/uverbs: Use uverbs_api to manage the object type inside the uobject Currently the struct uverbs_obj_type stored in the ib_uobject is part of the .rodata segment of the module that defines the object. This is a problem if drivers define new uapi objects as we will be left with a dangling pointer after device disassociation. Switch the uverbs_obj_type for struct uverbs_api_object, which is allocated memory that is part of the uverbs_api and is guaranteed to always exist. Further this moves the 'type_class' into this memory which means access to the IDR/FD function pointers is also guaranteed. Drivers cannot define new types. This makes it safe to continue to use all uobjects, including driver defined ones, after disassociation. Signed-off-by: Jason Gunthorpe commit 9ed3e5f447723a41de6bcc29633e9f7e6246d2f7 Author: Jason Gunthorpe Date: Thu Aug 9 20:14:36 2018 -0600 IB/uverbs: Build the specs into a radix tree at runtime This radix tree datastructure is intended to replace the 'hash' structure used today for parsing ioctl methods during system calls. This first commit introduces the structure and builds it from the existing .rodata descriptions. The so-called hash arrangement is actually a 5 level open coded radix tree. This new version uses a 3 level radix tree built using the radix tree library. Overall this is much less code and much easier to build as the radix tree API allows for dynamic modification during the building. There is a small memory penalty to pay for this, but since the radix tree is allocated on a per device basis, a few kb of RAM seems immaterial considering the gained simplicity. The radix tree is similar to the existing tree, but also has a 'attr_bkey' concept, which is a small value'd index for each method attribute. This is used to simplify and improve performance of everything in the next patches. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky Reviewed-by: Michael J. Ruhl commit 7d96c9b17636b6148534617ddf95dead18617776 Author: Jason Gunthorpe Date: Thu Aug 9 20:14:35 2018 -0600 IB/uverbs: Have the core code create the uverbs_root_spec There is no reason for drivers to do this, the core code should take of everything. The drivers will provide their information from rodata to describe their modifications to the core's base uapi specification. The core uses this to build up the runtime uapi for each device. Signed-off-by: Jason Gunthorpe Reviewed-by: Michael J. Ruhl Reviewed-by: Leon Romanovsky commit 0520344cdb1efa7c6404168b66f8dd0b1fe5face Author: Raghu Vatsavayi Date: Thu Aug 9 13:54:12 2018 -0700 liquidio: copperhead LED identification Add LED identification support for liquidio TP copperhead cards. Signed-off-by: Raghu Vatsavayi Acked-by: Derek Chickles Signed-off-by: Felix Manlunas Signed-off-by: David S. Miller commit 1e7953bc560451302dcb5d5b3fafd1949447579a Author: kbuild test robot Date: Fri Aug 10 09:29:59 2018 +0800 qed/qede: qede_setup_tc() can be static Fixes: 5e7baf0fcb2a ("qed/qede: Multi CoS support.") Signed-off-by: kbuild test robot Signed-off-by: David S. Miller commit 4f23c43c414d81b377a07b936e7edfe7167660b5 Author: YueHaibing Date: Fri Aug 10 10:37:30 2018 +0800 mlxsw: core: remove unnecessary function mlxsw_core_driver_put The function mlxsw_core_driver_put only traverse mlxsw_core_driver_list to find the matched mlxsw_driver,but never used it. So it can be removed safely. Signed-off-by: YueHaibing Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 0f5c6c30a0f8c629b92ecdaef61b315c43fde10a Author: Jisheng Zhang Date: Fri Aug 10 11:36:27 2018 +0800 net: mvneta: fix mvneta_config_rss on armada 3700 The mvneta Ethernet driver is used on a few different Marvell SoCs. Some SoCs have per cpu interrupts for Ethernet events, the driver uses a per CPU napi structure for this case. Some SoCs such as armada 3700 have a single interrupt for Ethernet events, the driver uses a global napi structure for this case. Current mvneta_config_rss() always operates the per cpu napi structure. Fix it by operating a global napi for "single interrupt" case, and per cpu napi structure for remaining cases. Signed-off-by: Jisheng Zhang Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC") Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 0d86caff06363151df21603eb1f4e3207ea91bd2 Author: Ursula Braun Date: Fri Aug 10 17:45:11 2018 +0200 net/smc: send response to test link signal With SMC-D z/OS sends a test link signal every 10 seconds. Linux is supposed to answer, otherwise the SMC-D connection breaks. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit a487711aac3b720b4a3a63d737604f47cd8dc36c Merge: bc4fcd0a1b76 abe8b2f71e28 Author: David S. Miller Date: Fri Aug 10 14:32:35 2018 -0700 Merge branch 'r8169-smaller-improvements' Heiner Kallweit says: ==================== r8169: smaller improvements This series includes smaller improvements, no functional change intended. ==================== Signed-off-by: David S. Miller commit abe8b2f71e28f0193e7a4c989ef5fae227e5a9f9 Author: Heiner Kallweit Date: Fri Aug 10 22:40:37 2018 +0200 r8169: don't configure max jumbo frame size per chip version We don't have to configure the max jumbo frame size per chip (sub-)version. It can be easily determined based on the chip family. And new members of the RTL8168 family (if there are any) should be automatically covered. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit eb88f5f7128ced3d6ab81004686035fb03087475 Author: Heiner Kallweit Date: Fri Aug 10 22:39:29 2018 +0200 r8169: don't configure csum function per chip version We don't have to configure the csum function per chip (sub-)version. The distinction is simple, versions RTL8102e and from RTL8168c onwards support csum_v2. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 05bbe5584ff9dc218f20398755de29f02dbc6093 Author: Heiner Kallweit Date: Fri Aug 10 22:38:29 2018 +0200 r8169: simplify interrupt handler Simplify the interrupt handler a little and make it better readable. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 098b01ad9837b4d4d0022f407300f069a999e55a Author: Heiner Kallweit Date: Fri Aug 10 22:37:31 2018 +0200 r8169: don't include asm headers directly The asm headers shouldn't be included directly. asm/irq.h is implicitly included by linux/interrupt.h, and instead of asm/io.h include linux/io.h. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit bc4fcd0a1b7635b012e5b2f3f0fb85a2d29fe13a Author: Heiner Kallweit Date: Fri Aug 10 21:27:55 2018 +0200 r8169: remove version info The version number hasn't changed for ages and in general I doubt it provides any benefit. The message in rtl_init_one() may even be misleading because it's printed also if something fails in probe. Therefore let's remove the version information. Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 0780b866668ed5f88fd79e96ea8ac94258939ae0 Merge: fd685657cd54 aa12af77aae0 Author: David S. Miller Date: Fri Aug 10 14:24:57 2018 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2018-08-10 Here's one more (most likely last) bluetooth-next pull request for the 4.19 kernel. - Added support for MediaTek serial Bluetooth devices - Initial skeleton for controller-side address resolution support - Fix BT_HCIUART_RTL related Kconfig dependencies - A few other minor fixes/cleanups Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller commit a5ec96ddfd55c501d451cb310566a1170c267ecb Author: Leonid Bloch Date: Thu Aug 9 01:26:36 2018 +0300 gpio: it87: Add support for IT8613 This was tested on actual hardware and found to work fine, but currently the official specifications of this chip could not be obtained to confirm the numbers. Signed-off-by: Leonid Bloch Signed-off-by: Linus Walleij commit 62885203f71b1116d6f56ae2e6014767e1d47995 Author: Ivan Podovalov Date: Wed Aug 8 11:46:22 2018 +0300 gpio: it87: add support for IT8718F Super I/O. The DIO connector on the WAFER-945GSE is interfaced to GPIO ports on the ITE IT8718F Super I/O chipset. From the datasheet of ITE IT8718F, the GPIO interface is identical to IT8728, so just add it to the same case as the other chip. Signed-off-by: Ivan Podovalov Signed-off-by: Linus Walleij commit 3789f5acb9bbe088f70779002f32e7c6a64000bc Author: Biju Das Date: Tue Aug 7 08:15:18 2018 +0100 gpiolib: Avoid calling chip->request() for unused gpios Add a check for unused gpios to avoid chip->request() call to client driver for unused gpios. Signed-off-by: Biju Das Reviewed-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit 21041daba2300c88f0da538b3480a9fae37430ea Author: Linus Walleij Date: Mon Aug 6 17:38:33 2018 +0200 gpio: tegra: Include the right header This is a GPIO driver so include only . Drop the use of GPIOF_* flags: these are for consumers, not drivers. Just return 0/1. Cc: Stefan Agner Cc: Thierry Reding Reviewed-by: Dmitry Osipenko Signed-off-by: Linus Walleij commit d799a4de0a250f1bdd99765bb8e55a5e2f469a1f Author: Linus Walleij Date: Fri Aug 3 00:52:18 2018 +0200 gpio: mmio: Fix up inverted direction registers The bgpio_init() takes one of two arguments to specify a register to set the direction of the GPIO line: either dirout that indicates that a 1 in the bit in that register sets the corresponding line to output, or dirin which indicates that a 1 in the bit in that register sets the corresponding line to input. Conversely setting the bit to 0 on these will turn the line into input and output respectively. One of these can be defined but not both. This means that a platform that sets a bit to 1 for output only defines dirout and a platform that sets a bit to 0 for output only defines dirin. In short this defines the polarity of the direction register. Both can also be left as NULL meaning the GPIO chip is either input only or output only. Tomer Maimon discovered that for get/set chips (those where the get and set registers are defined but no separate clear register, and specifying BGPIOF_READ_OUTPUT_REG_SET so that we say we want to read the output value from the SET register) we are unconditionally reading the value from the SET register when the direction bit is 1 and from the DAT register when the direction bit is 0, not taking the direction bit polarity into account. It would be expected that when the direction bit is inverted (dirin is defined but not dirout) we read the current value from the DAT register when the bit is 1 and from the SET register when the bit is 0. Currently only some versions of ATH79, brcmstb, some versions of CLP711x, GE, IOP and Loongson use the dirin mode (a 1 in the register means input). They are unaffected because BGPIOF_READ_OUTPUT_REG_SET is not set on any of them. (They do not read back the SET register to figure out the output value.) So this is no regression with current drivers. However the behaviour is wrong and does not work with Tomer's new driver where he needs to use the BGIOF_READ_OUTPUT_REG_SET. This fixes the above issue by: - Instead of defining separate functions for the inverted case, set up a flag in the gpio_chip that indicates that the direction is inverted. - Remove the special inverted functions for setting input/output and getting the direction, rely on the flag instead. - Respect this flag in bgpio_get_set() and bgpio_get_set_multiple() Reported-by: Tomer Maimon Signed-off-by: Linus Walleij commit 516df4eb284d5a5ee8f80f7b59170ba8e919b299 Author: Linus Walleij Date: Mon Aug 6 18:39:59 2018 +0200 gpio: xilinx: Use the right include This is a GPIO driver so use only . Acked-by: Michal Simek Signed-off-by: Linus Walleij commit c2944a9a09a21b917fa86858f078e77115ca9d22 Author: Dan Carpenter Date: Wed Aug 8 15:04:49 2018 +0300 pinctrl: nomadik: silence uninitialized variable warning This is harmless, but "val" isn't necessarily initialized if abx500_get_register_interruptible() fails. I've re-arranged the code to just return an error code in that situation. Signed-off-by: Dan Carpenter Signed-off-by: Linus Walleij commit 504c76979bccec66e4c2e41f6a006e49e284466f Author: Anton Vasilyev Date: Mon Aug 6 19:06:35 2018 +0300 pinctrl: axp209: Fix NULL pointer dereference after allocation There is no check that allocation in axp20x_funcs_groups_from_mask is successful. The patch adds corresponding check and return values. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Acked-by: Chen-Yu Tsai Signed-off-by: Linus Walleij commit 50fe83a3eb5000a9ea3586e1fcd8034bd3892b90 Author: Linus Walleij Date: Mon Aug 6 17:42:46 2018 +0200 gpio: timberdale: Include the right header This is a GPIO driver so include only . Cc: Richard Röjfors Signed-off-by: Linus Walleij commit 32e49b9a808a59791513ec59fec6466d8577a5fa Author: Linus Walleij Date: Mon Aug 6 16:18:05 2018 +0200 gpio: tb10x: Use the right include This driver includes the legacy and but all it needs is really . Signed-off-by: Linus Walleij commit 6ff0497402ef7269ee6a72f62eb85adaa7a4768e Author: Biju Das Date: Mon Aug 6 10:48:01 2018 +0100 gpiolib: Fix of_node inconsistency Some platforms are not setting of_node in the driver. On these platforms defining gpio-reserved-ranges on device tree leads to kernel crash. It is due to some parts of the gpio core relying on the driver to set up of_node,while other parts do themselves.This inconsistent behaviour leads to a crash. gpiochip_add_data_with_key() calls gpiochip_init_valid_mask() with of_node as NULL. of_gpiochip_add() fills "of_node" and calls of_gpiochip_init_valid_mask(). The fix is to move the assignment to chip->of_node from of_gpiochip_add() to gpiochip_add_data_with_key(). Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit 01f1974e5f08732de6cecc4287788a99cfc3b325 Author: Krzysztof Kozlowski Date: Mon Aug 6 18:33:40 2018 +0200 pinctrl: samsung: Remove duplicated "wakeup" in printk Double "wakeup" appears in printed message. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Linus Walleij commit f8a79d5c7ef47c62d97a30e16064caf2ef91f648 Author: Steven Rostedt (VMware) Date: Fri Aug 10 12:17:50 2018 -0400 tracepoints: Free early tracepoints after RCU is initialized When enabling trace events via the kernel command line, I hit this warning: WARNING: CPU: 0 PID: 13 at kernel/rcu/srcutree.c:236 check_init_srcu_struct+0xe/0x61 Modules linked in: CPU: 0 PID: 13 Comm: watchdog/0 Not tainted 4.18.0-rc6-test+ #6 Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 02/22/2014 RIP: 0010:check_init_srcu_struct+0xe/0x61 Code: 48 c7 c6 ec 8a 65 b4 e8 ff 79 fe ff 48 89 df 31 f6 e8 f2 fa ff ff 5a 5b 41 5c 5d c3 0f 1f 44 00 00 83 3d 68 94 b8 01 01 75 02 <0f> 0b 48 8b 87 f0 0a 00 00 a8 03 74 45 55 48 89 e5 41 55 41 54 4c RSP: 0000:ffff96eb9ea03e68 EFLAGS: 00010246 RAX: ffff96eb962b5b01 RBX: ffffffffb4a87420 RCX: 0000000000000001 RDX: ffffffffb3107969 RSI: ffff96eb962b5b40 RDI: ffffffffb4a87420 RBP: ffff96eb9ea03eb0 R08: ffffabbd00cd7f48 R09: 0000000000000000 R10: ffff96eb9ea03e68 R11: ffffffffb4a6eec0 R12: ffff96eb962b5b40 R13: ffff96eb9ea03ef8 R14: ffffffffb3107969 R15: ffffffffb3107948 FS: 0000000000000000(0000) GS:ffff96eb9ea00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff96eb13ab2000 CR3: 0000000192a1e001 CR4: 00000000001606f0 Call Trace: ? __call_srcu+0x2d/0x290 ? rcu_process_callbacks+0x26e/0x448 ? allocate_probes+0x2b/0x2b call_srcu+0x13/0x15 rcu_free_old_probes+0x1f/0x21 rcu_process_callbacks+0x2ed/0x448 __do_softirq+0x172/0x336 irq_exit+0x62/0xb2 smp_apic_timer_interrupt+0x161/0x19e apic_timer_interrupt+0xf/0x20 The problem is that the enabling of trace events before RCU is set up will cause SRCU to give this warning. To avoid this, add a list to store probes that need to be freed till after RCU is initialized, and then free them then. Link: http://lkml.kernel.org/r/20180810113554.1df28050@gandalf.local.home Link: http://lkml.kernel.org/r/20180810123517.5e9714ad@gandalf.local.home Acked-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) Fixes: e6753f23d961d ("tracepoint: Make rcuidle tracepoint callers use SRCU") Signed-off-by: Steven Rostedt (VMware) commit 016f8ffc48cb01d1e7701649c728c5d2e737d295 Author: Steven Rostedt (VMware) Date: Thu Aug 9 15:37:59 2018 -0400 uprobes: Use synchronize_rcu() not synchronize_sched() While debugging another bug, I was looking at all the synchronize*() functions being used in kernel/trace, and noticed that trace_uprobes was using synchronize_sched(), with a comment to synchronize with {u,ret}_probe_trace_func(). When looking at those functions, the data is protected with "rcu_read_lock()" and not with "rcu_read_lock_sched()". This is using the wrong synchronize_*() function. Link: http://lkml.kernel.org/r/20180809160553.469e1e32@gandalf.local.home Cc: stable@vger.kernel.org Fixes: 70ed91c6ec7f8 ("tracing/uprobes: Support ftrace_event_file base multibuffer") Acked-by: Oleg Nesterov Signed-off-by: Steven Rostedt (VMware) commit d878efce73fe86db34ddb2013260adf571a701a7 Author: Joerg Roedel Date: Wed Aug 8 13:16:40 2018 +0200 x86/mm/pti: Move user W+X check into pti_finalize() The user page-table gets the updated kernel mappings in pti_finalize(), which runs after the RO+X permissions got applied to the kernel page-table in mark_readonly(). But with CONFIG_DEBUG_WX enabled, the user page-table is already checked in mark_readonly() for insecure mappings. This causes false-positive warnings, because the user page-table did not get the updated mappings yet. Move the W+X check for the user page-table into pti_finalize() after it updated all required mappings. [ tglx: Folded !NX supported fix ] Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1533727000-9172-1-git-send-email-joro@8bytes.org commit e0a568dcd18bdaa77877d558700ce4d3bbbb12b8 Author: Steven Rostedt (VMware) Date: Thu Aug 9 15:31:48 2018 -0400 tracing: Fix synchronizing to event changes with tracepoint_synchronize_unregister() Now that some trace events can be protected by srcu_read_lock(tracepoint_srcu), we need to make sure all locations that depend on this are also protected. There were many places that did a synchronize_sched() thinking that it was enough to protect againts access to trace events. This use to be the case, but now that we use SRCU for _rcuidle() trace events, they may not be protected by synchronize_sched(), as they may be called in paths that RCU is not watching for preempt disable. Fixes: e6753f23d961d ("tracepoint: Make rcuidle tracepoint callers use SRCU") Signed-off-by: Steven Rostedt (VMware) commit b207de3ec531ff364843708c9fea968700aae8fe Author: Colin Ian King Date: Thu Aug 9 13:56:09 2018 +0100 ftrace: Remove unused pointer ftrace_swapper_pid Pointer ftrace_swapper_pid is defined but is never used hence it is redundant and can be removed. The use of this variable was removed in commit 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap like events do"). Cleans up clang warning: warning: 'ftrace_swapper_pid' defined but not used [-Wunused-const-variable=] Link: http://lkml.kernel.org/r/20180809125609.13142-1-colin.king@canonical.com Signed-off-by: Colin Ian King Signed-off-by: Steven Rostedt (VMware) commit 3f1756dc210e5abb37121da3e7c10d65920f6ec0 Author: Steven Rostedt (VMware) Date: Wed Aug 8 21:28:05 2018 -0400 tracing: More reverting of "tracing: Centralize preemptirq tracepoints and unify their usage" Joel Fernandes created a nice patch that cleaned up the duplicate hooks used by lockdep and irqsoff latency tracer. It made both use tracepoints. But the latency tracer is triggering warnings when using tracepoints to call into the latency tracer's routines. Mainly, they can be called from NMI context. If that happens, then the SRCU may not work properly because on some architectures, SRCU is not safe to be called in both NMI and non-NMI context. This is a partial revert of the clean up patch c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") that adds back the direct calls into the latency tracer. It also only calls the trace events when not in NMI. Link: http://lkml.kernel.org/r/20180809210654.622445925@goodmis.org Reviewed-by: Joel Fernandes (Google) Fixes: c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") Signed-off-by: Steven Rostedt (VMware) commit f27107fa20ad531ace5fd580473ff8dd0c6b9ca9 Author: Steven Rostedt (VMware) Date: Tue Aug 7 17:03:12 2018 -0400 tracing/irqsoff: Handle preempt_count for different configs I was hitting the following warning: WARNING: CPU: 0 PID: 1 at kernel/trace/trace_irqsoff.c:631 tracer_hardirqs_off+0x15/0x2a Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-rc6-test+ #13 Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 02/22/2014 EIP: tracer_hardirqs_off+0x15/0x2a Code: ff 85 c0 74 0e 8b 45 00 8b 50 04 8b 45 04 e8 35 ff ff ff 5d c3 55 64 a1 cc 37 51 c1 a9 ff ff ff 7f 89 e5 53 89 d3 89 ca 75 02 <0f> 0b e8 90 fc ff ff 85 c0 74 07 89 d8 e8 0c ff ff ff 5b 5d c3 55 EAX: 80000000 EBX: c04337f0 ECX: c04338e3 EDX: c04338e3 ESI: c04337f0 EDI: c04338e3 EBP: f2aa1d68 ESP: f2aa1d64 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00210046 CR0: 80050033 CR2: 00000000 CR3: 01668000 CR4: 001406f0 Call Trace: trace_irq_disable_rcuidle+0x63/0x6c trace_hardirqs_off+0x26/0x30 default_send_IPI_mask_allbutself_logical+0x31/0x93 default_send_IPI_allbutself+0x37/0x48 native_send_call_func_ipi+0x4d/0x6a smp_call_function_many+0x165/0x19d ? add_nops+0x34/0x34 ? trace_hardirqs_on_caller+0x2d/0x2d ? add_nops+0x34/0x34 smp_call_function+0x1f/0x23 on_each_cpu+0x15/0x43 ? trace_hardirqs_on_caller+0x2d/0x2d ? trace_hardirqs_on_caller+0x2d/0x2d ? trace_irq_disable_rcuidle+0x1/0x6c text_poke_bp+0xa0/0xc2 ? trace_hardirqs_on_caller+0x2d/0x2d arch_jump_label_transform+0xa7/0xcb ? trace_irq_disable_rcuidle+0x5/0x6c __jump_label_update+0x3e/0x6d jump_label_update+0x7d/0x81 static_key_slow_inc_cpuslocked+0x58/0x6d static_key_slow_inc+0x19/0x20 tracepoint_probe_register_prio+0x19e/0x1d1 ? start_critical_timings+0x1c/0x1c tracepoint_probe_register+0xf/0x11 irqsoff_tracer_init+0x21/0xf2 tracer_init+0x16/0x1a trace_selftest_startup_irqsoff+0x25/0xc4 run_tracer_selftest+0xca/0x131 register_tracer+0xd5/0x172 ? trace_event_define_fields_preemptirq_template+0x45/0x45 init_irqsoff_tracer+0xd/0x11 do_one_initcall+0xab/0x1e8 ? rcu_read_lock_sched_held+0x3d/0x44 ? trace_initcall_level+0x52/0x86 kernel_init_freeable+0x195/0x21a ? rest_init+0xb4/0xb4 kernel_init+0xd/0xe4 ret_from_fork+0x2e/0x38 It is due to running a CONFIG_PREEMPT_VOLUNTARY kernel, which would trigger this warning every time: WARN_ON_ONCE(preempt_count()); Because on CONFIG_PREEMPT_VOLUNTARY, preempt_count() is always zero. This warning is to make sure preempt_count is set because tracer_hardirqs_on() does a preempt_enable_notrace() to make the preempt_trace() work properly, as being called by a trace event, the trace event code disables preemption, and the tracer wants to know what the preemption was before it was called. Instead of enabling preemption like this, just record the preempt_count, subtract PREEMPT_DISABLE_OFFSET from it (which is zero with !CONFIG_PREEMPT set), and pass that value to the necessary functions, which should use the passed in parameter instead of calling preempt_count() directly. Fixes: da5b3ebb45277 ("tracing: irqsoff: Account for additional preempt_disable") Signed-off-by: Steven Rostedt (VMware) commit bff1b208a5d1dbb2355822ef859edcb9be0379e4 Author: Steven Rostedt (VMware) Date: Mon Aug 6 15:50:58 2018 -0400 tracing: Partial revert of "tracing: Centralize preemptirq tracepoints and unify their usage" Joel Fernandes created a nice patch that cleaned up the duplicate hooks used by lockdep and irqsoff latency tracer. It made both use tracepoints. But it caused lockdep to trigger several false positives. We have not figured out why yet, but removing lockdep from using the trace event hooks and just call its helper functions directly (like it use to), makes the problem go away. This is a partial revert of the clean up patch c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") that adds direct calls for lockdep, but also keeps most of the clean up done to get rid of the horrible preprocessor if statements. Link: http://lkml.kernel.org/r/20180806155058.5ee875f4@gandalf.local.home Cc: Peter Zijlstra Reviewed-by: Joel Fernandes (Google) Fixes: c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") Signed-off-by: Steven Rostedt (VMware) commit da2048b7348a0be92f706ac019e022139e29495e Author: Mauro Carvalho Chehab Date: Fri Aug 10 15:06:18 2018 -0400 Revert "media: vivid: shut up warnings due to a non-trivial logic" 0day kernel testing robot got the below dmesg and the first bad commit is https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master commit 3354b54f9f7037a1122d3b6009aa9d39829d6843 [ 248.847809] BUG: unable to handle kernel paging request at ffffc90000393131 [ 248.848015] Call Trace: [ 248.848015] ? vivid_dev_release+0xc0/0xc0 [ 248.848015] ? acpi_dev_pm_attach+0x27/0xd0 This reverts commit 3354b54f9f7037a1122d3b6009aa9d39829d6843. commit 74b247f4c36315e5c08580700a68e0eb3b72de03 Merge: 60afdf066a35 af2a81dab447 Author: Daniel Borkmann Date: Fri Aug 10 20:54:08 2018 +0200 Merge branch 'bpf-btf-for-htab-lru' Yonghong Song says: ==================== Commit a26ca7c982cb ("bpf: btf: Add pretty print support to the basic arraymap") added pretty print support to array map. This patch adds pretty print for hash and lru_hash maps. The following example shows the pretty-print result of a pinned hashmap. Without this patch set, user will get an error instead. struct map_value { int count_a; int count_b; }; cat /sys/fs/bpf/pinned_hash_map: 87907: {87907,87908} 57354: {37354,57355} 76625: {76625,76626} ... Patch #1 fixed a bug in bpffs map_seq_next() function so that all elements in the hash table will be traversed. Patch #2 implemented map_seq_show_elem() and map_check_btf() callback functions for hash and lru hash maps. Patch #3 enhanced tools/testing/selftests/bpf/test_btf.c to test bpffs hash and lru hash map pretty print. ==================== Signed-off-by: Daniel Borkmann commit af2a81dab44758de0b94679615ea75e8ee30aace Author: Yonghong Song Date: Thu Aug 9 08:55:21 2018 -0700 tools/bpf: add bpffs pretty print btf test for hash/lru_hash maps Pretty print tests for hash/lru_hash maps are added in test_btf.c. The btf type blob is the same as pretty print array map test. The test result: $ mount -t bpf bpf /sys/fs/bpf $ ./test_btf -p BTF pretty print array......OK BTF pretty print hash......OK BTF pretty print lru hash......OK PASS:3 SKIP:0 FAIL:0 Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 699c86d6ec21d0f885d12800249d138659de8489 Author: Yonghong Song Date: Thu Aug 9 08:55:20 2018 -0700 bpf: btf: add pretty print for hash/lru_hash maps Commit a26ca7c982cb ("bpf: btf: Add pretty print support to the basic arraymap") added pretty print support to array map. This patch adds pretty print for hash and lru_hash maps. The following example shows the pretty-print result of a pinned hashmap: struct map_value { int count_a; int count_b; }; cat /sys/fs/bpf/pinned_hash_map: 87907: {87907,87908} 57354: {37354,57355} 76625: {76625,76626} ... Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit dc1508a579e682a1e5f1ed0753390e0aa7c23a97 Author: Yonghong Song Date: Thu Aug 9 08:55:19 2018 -0700 bpf: fix bpffs non-array map seq_show issue In function map_seq_next() of kernel/bpf/inode.c, the first key will be the "0" regardless of the map type. This works for array. But for hash type, if it happens key "0" is in the map, the bpffs map show will miss some items if the key "0" is not the first element of the first bucket. This patch fixed the issue by guaranteeing to get the first element, if the seq_show is just started, by passing NULL pointer key to map_get_next_key() callback. This way, no missing elements will occur for bpffs hash table show even if key "0" is in the map. Fixes: a26ca7c982cb5 ("bpf: btf: Add pretty print support to the basic arraymap") Acked-by: Alexei Starovoitov Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 13942aa94a8b5df662d93c42c307b2f50cbe88b0 Author: Darrick J. Wong Date: Thu Aug 9 22:43:04 2018 -0700 xfs: repair the AGI Rebuild the AGI header items with some help from the rmapbt. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit 0e93d3f43ec7d3308bff25ce1be81d46330168c9 Author: Darrick J. Wong Date: Thu Aug 9 22:43:02 2018 -0700 xfs: repair the AGFL Repair the AGFL from the rmap data. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit f9ed6debca45dd9bcc02d77c98822d50aba342f4 Author: Darrick J. Wong Date: Thu Aug 9 22:42:53 2018 -0700 xfs: repair the AGF Regenerate the AGF from the rmap data. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit 096177a8b51937ba3004164f0366ef20656bb17a Author: Tzvetomir Stoyanov (VMware) Date: Wed Aug 8 14:02:46 2018 -0400 tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes the struct pevent to struct tep_handle. Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180659.706175783@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo commit 46451874c7c9afaa4e014aea0f0970f886444e0d Author: Coly Li Date: Fri Aug 10 23:45:50 2018 +0800 bcache: fix error setting writeback_rate through sysfs interface Commit ea8c5356d390 ("bcache: set max writeback rate when I/O request is idle") changes struct bch_ratelimit member rate from uint32_t to atomic_long_t and uses atomic_long_set() in drivers/md/bcache/sysfs.c to set new writeback rate, after the input is converted from memory buf to long int by sysfs_strtoul_clamp(). The above change has a problem because there is an implicit return inside sysfs_strtoul_clamp() so the following atomic_long_set() won't be called. This error is detected by 0day system with following snipped smatch warnings: drivers/md/bcache/sysfs.c:271 __cached_dev_store() error: uninitialized symbol 'v'. 270 sysfs_strtoul_clamp(writeback_rate, v, 1, INT_MAX); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @271 atomic_long_set(&dc->writeback_rate.rate, v); This patch fixes the above error by using strtoul_safe_clamp() to convert the input buffer into a long int type result. Fixes: ea8c5356d390 ("bcache: set max writeback rate when I/O request is idle") Cc: Kai Krakow Cc: Stefan Priebe Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit fd685657cd5441e504113db1928196d030c8c414 Merge: ebddd97afb89 e7ea2a52ffaf Author: David S. Miller Date: Fri Aug 10 10:33:08 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following batch contains netfilter updates for your net-next tree: 1) Expose NFT_OSF_MAXGENRELEN maximum OS name length from the new OS passive fingerprint matching extension, from Fernando Fernandez. 2) Add extension to support for fine grain conntrack timeout policies from nf_tables. As preparation works, this patchset moves nf_ct_untimeout() to nf_conntrack_timeout and it also decouples the timeout policy from the ctnl_timeout object, most work done by Harsha Sharma. 3) Enable connection tracking when conntrack helper is in place. 4) Missing enumeration in uapi header when splitting original xt_osf to nfnetlink_osf, also from Fernando. 5) Fix a sparse warning due to incorrect typing in the nf_osf_find(), from Wei Yongjun. ==================== Signed-off-by: David S. Miller commit 2d1ce5ec2117d16047334a1aa4b62e0cfb5a0605 Author: Alexandru Gagniuc Date: Mon Aug 6 18:25:35 2018 -0500 PCI: Check for PCIe Link downtraining When both ends of a PCIe Link are capable of a higher bandwidth than is currently in use, the Link is said to be "downtrained". A downtrained Link may indicate hardware or configuration problems in the system, but it's hard to identify such Links from userspace. Refactor pcie_print_link_status() so it continues to always print PCIe bandwidth information, as several NIC drivers desire. Add a new internal __pcie_print_link_status() to emit a message only when a device's bandwidth is constrained by the fabric and call it from the PCI core for all devices, which identifies all downtrained Links. It also emits messages for a few cases that are technically not downtrained, such as a x4 device in an open-ended x1 slot. Signed-off-by: Alexandru Gagniuc [bhelgaas: changelog, move __pcie_print_link_status() declaration to drivers/pci/, rename pcie_check_upstream_link() to pcie_report_downtraining()] Signed-off-by: Bjorn Helgaas commit ebddd97afb89cb1e88cc037aef2913ad4723a59f Author: Ganesh Goudar Date: Fri Aug 10 14:47:01 2018 +0530 cxgb4: add support to display DCB info display Data Center bridging information in debug fs. Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit e4ed2b9eff1dcc4ed7a85fa1e63f86b471215416 Author: Colin Ian King Date: Fri Aug 10 09:02:17 2018 +0100 net: chelsio: cxgb2: remove unused array pci_speed Array pci_speed is defined but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: 'pci_speed' defined but not used [-Wunused-const-variable=] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 29a06a779977d2af8ec783525e3d10cb616a4272 Author: Colin Ian King Date: Fri Aug 10 08:53:28 2018 +0100 mlxsw: remove unused arrays mlxsw_i2c_driver_name and mlxsw_pci_driver_name Arrays mlxsw_i2c_driver_name and mlxsw_pci_driver_name are defined but never used hence they are redundant and can be removed. Cleans up clang warnings: warning: 'mlxsw_i2c_driver_name' defined but not used warning: 'mlxsw_pci_driver_name' defined but not used Signed-off-by: Colin Ian King Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit c9fbb2d25295a566b97d62e6904741e8e1702d83 Author: Krzysztof Kozlowski Date: Fri Aug 10 10:47:43 2018 +0200 net: Provide stub for __netif_set_xps_queue if there is no CONFIG_XPS Building virtio_net driver without CONFIG_XPS fails with: drivers/net/virtio_net.c: In function ‘virtnet_set_affinity’: drivers/net/virtio_net.c:1910:3: error: implicit declaration of function ‘__netif_set_xps_queue’ [-Werror=implicit-function-declaration] __netif_set_xps_queue(vi->dev, mask, i, false); ^ Fixes: 4d99f6602cb5 ("net: allow to call netif_reset_xps_queues() under cpus_read_lock") Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit cdeaf9d04a5a0f51220d2f025385c553220bfb5c Author: Steve French Date: Fri Aug 10 02:25:06 2018 -0500 smb3: allow previous versions to be mounted with snapshot= mount parm mounting with the "snapshots=" mount parm allows a read-only view of a previous version of a file system (see MS-SMB2 and "timewarp" tokens, section 2.2.13.2.6) based on the timestamp passed in on the snapshots mount parm. Add processing to optionally send this create context. Example output: /mnt1 is mounted with "snapshots=..." and will see an earlier version of the directory, with three fewer files than /mnt2 the current version of the directory. root@Ubuntu-17-Virtual-Machine:~/cifs-2.6# cat /proc/mounts | grep cifs //172.22.149.186/public /mnt1 cifs ro,relatime,vers=default,cache=strict,username=smfrench,uid=0,noforceuid,gid=0,noforcegid,addr=172.22.149.186,file_mode=0755,dir_mode=0755,soft,nounix,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,snapshot=131748608570000000,actimeo=1 //172.22.149.186/public /mnt2 cifs rw,relatime,vers=default,cache=strict,username=smfrench,uid=0,noforceuid,gid=0,noforcegid,addr=172.22.149.186,file_mode=0755,dir_mode=0755,soft,nounix,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1 root@Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt1 EmptyDir newerdir root@Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt1/newerdir root@Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt2 EmptyDir file newerdir newestdir timestamp-trace.cap root@Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt2/newerdir new-file-not-in-snapshot Snapshots are extremely useful for comparing previous versions of files or directories, and recovering from data corruptions or mistakes. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit e55954a5f7ce0e321cea9f91f4ebeb2a4e0165f4 Author: Ronnie Sahlberg Date: Fri Aug 10 11:31:10 2018 +1000 cifs: don't show domain= in mount output when domain is empty Reported-by: Xiaoli Feng Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit c1777df1a5d541cda918ff0450c8adcc8b69c2fd Author: Ronnie Sahlberg Date: Fri Aug 10 11:03:55 2018 +1000 cifs: add missing support for ACLs in SMB 3.11 We were missing the methods for get_acl and friends for the 3.11 dialect. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French CC: Stable Reviewed-by: Pavel Shilovsky commit c1acb21b32a3bb601453764c9eac9fc8fbb3a81d Merge: c3c7126248a0 401c0d7712eb Author: Mark Brown Date: Fri Aug 10 17:51:52 2018 +0100 Merge branch 'spi-4.19' into spi-next commit c3c7126248a0750790ee33c4bd80a1847f55f5b6 Merge: 1ffaddd029c8 563a53f3906a Author: Mark Brown Date: Fri Aug 10 17:51:50 2018 +0100 Merge branch 'spi-4.18' into spi-linus commit d22d59362b7b2c749245f1269d447011c76ca41d Merge: a8afa92ec0d9 46fc033eba42 Author: Mark Brown Date: Fri Aug 10 17:31:24 2018 +0100 Merge branch 'regulator-4.19' into regulator-next commit a8afa92ec0d9312b23fd291aa8db95da266f2d5f Merge: 1ffaddd029c8 a9191579ba10 Author: Mark Brown Date: Fri Aug 10 17:31:22 2018 +0100 Merge branch 'regulator-4.18' into regulator-linus commit 46fc033eba42f5a4fb583b2ab53f0a9918468452 Author: David Collins Date: Fri Jul 13 18:50:59 2018 -0700 regulator: add QCOM RPMh regulator driver Add the QCOM RPMh regulator driver to manage PMIC regulators which are controlled via RPMh on some Qualcomm Technologies, Inc. SoCs. RPMh is a hardware block which contains several accelerators which are used to manage various hardware resources that are shared between the processors of the SoC. The final hardware state of a regulator is determined within RPMh by performing max aggregation of the requests made by all of the processors. Add support for PMIC regulator control via the voltage regulator manager (VRM) and oscillator buffer (XOB) RPMh accelerators. VRM supports manipulation of enable state, voltage, and mode. XOB supports manipulation of enable state. Signed-off-by: David Collins Reviewed-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke Signed-off-by: Mark Brown commit 0db021f7a2731cc559f0c5beb19ff3f677ff8626 Author: David Collins Date: Fri Jul 13 18:50:58 2018 -0700 regulator: dt-bindings: add QCOM RPMh regulator bindings Introduce bindings for RPMh regulator devices found on some Qualcomm Technlogies, Inc. SoCs. These devices allow a given processor within the SoC to make PMIC regulator requests which are aggregated within the RPMh hardware block along with requests from other processors in the SoC to determine the final PMIC regulator hardware state. Signed-off-by: David Collins Reviewed-by: Rob Herring Reviewed-by: Douglas Anderson Signed-off-by: Mark Brown commit 2de4471a263dd4f803d6cf89c543f38b2558ad88 Merge: 4f3fb2873583 78ee559d7fc6 Author: Mark Brown Date: Fri Aug 10 17:29:43 2018 +0100 Merge tag 'qcom-drivers-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into regulator-4.19 for RPMH Qualcomm ARM Based Driver Updates for v4.19 * Add Qualcomm LLCC driver * Add Qualcomm RPMH controller * Fix memleak in Qualcomm RMTFS * Add dummy qcom_scm_assign_mem() * Fix check for global partition in SMEM commit 4afec79f652b11189c07ce49498c4477adda887c Author: Tokunori Ikegami Date: Wed Aug 8 10:32:19 2018 +0900 hwmon: (adt7475) Change show functions to return error data correctly Change update device function to return an error pointer if needed, and report the error to user space. Signed-off-by: Tokunori Ikegami Cc: Guenter Roeck Cc: Chris Packham [groeck: Clarified/updated description] Signed-off-by: Guenter Roeck commit 702afead45e15407bea94ccee16b801bbe9db13e Author: Tokunori Ikegami Date: Wed Aug 8 10:32:18 2018 +0900 hwmon: (adt7475) Change update functions to add error handling I2C SMBus sometimes returns error codes. In the error case, measurement values are updated incorrectly. The sensor application then generates warning log messages and SNMP traps. To prevent this, add error handling into the update functions. Signed-off-by: Tokunori Ikegami Cc: Guenter Roeck Cc: Chris Packham [groeck: Update description] Signed-off-by: Guenter Roeck commit b36fb17159adad16a724f0d298a5b50269839ead Author: Tokunori Ikegami Date: Wed Aug 8 10:32:17 2018 +0900 hwmon: (adt7475) Change valid parameter to bool type Currently the valid variable is of type char, but it is used as boolean. So let's change it to bool. Signed-off-by: Tokunori Ikegami Cc: Guenter Roeck Cc: Chris Packham [groeck: Update description] Signed-off-by: Guenter Roeck commit 5cf943ede4af95313665ea81f224533d2aa272bb Author: Tokunori Ikegami Date: Wed Aug 8 10:32:16 2018 +0900 hwmon: (adt7475) Split device update function to measure and limits The update function reads both measurement and limit values. Those parts can be split so split them for a maintainability. Signed-off-by: Tokunori Ikegami Cc: Guenter Roeck Cc: Chris Packham [groeck: Clarify description] Signed-off-by: Guenter Roeck commit f39684524b391c5a7ed0ac44db4fec3357af1c5d Author: Randy Dunlap Date: Fri Aug 10 17:23:02 2018 +0200 Documentation/fb: corrections for fbcon.txt Fix grammar, spacing, indentation, and Kconfig menu locations in fbcon.txt. Signed-off-by: Randy Dunlap Cc: Antonino Daplas Cc: Geert Uytterhoeven Cc: Jonathan Corbet Signed-off-by: Bartlomiej Zolnierkiewicz commit df37e225f25933732c17e43cbe7d21eec31b24be Author: Hans de Goede Date: Fri Aug 10 17:23:02 2018 +0200 fbcon: Do not takeover the console from atomic context Taking over the console involves allocating mem with GFP_KERNEL, talking to drm drivers, etc. So this should not be done from an atomic context. But the console-output trigger deferred console takeover may happen from an atomic context, which leads to "BUG: sleeping function called from invalid context" errors. This commit fixes these errors by doing the deferred takeover from a workqueue. Signed-off-by: Hans de Goede [b.zolnierkie: remove unused variable] Signed-off-by: Bartlomiej Zolnierkiewicz commit 4d64c8e02cdad5ada0b9e1e3d20b73c279cafaf2 Author: Hans de Goede Date: Fri Aug 10 17:23:02 2018 +0200 dummycon: Stop exporting dummycon_[un]register_output_notifier Now that we only allow FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER when fbdev+fbcon are builtin exporting these is no longer necessary. Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit bedb38fc917527e7a6a7e5a0ecedd44690fab167 Author: Hans de Goede Date: Fri Aug 10 17:23:01 2018 +0200 fbcon: Only defer console takeover if the current console driver is the dummycon We rely on dummycon's output notifier mechanism to defer the takeover. If say vgacon is the current console driver then dummycon will never get used so its output notifier will also never get called and fbcon never takes over. This commit fixes this by only deferring the console takeover if the current console driver is the dummycon driver. This commit also moves the entirety of fbcon_start under the console_lock, since the conswitchp which fbcon_start now checks is protected by it. This commit also inlines fbcon_register_output_notifier, since we now need a #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER in fbcon_start anyways because of the write access to the deferred_takeover variable, this has the added advantage that it puts the dummycon_register_output_notifier() call directly after the "conswitchp != &dummy_con" comparison making it clear why that check is there. Note the arch setup code will set conswitchp to either dummy_con or vga_con, in the cases where it gets set to vga_con even though their is no vga_con present we rely on vga_con_startup() to set conswitchp to dummy_con. vga_con_startup() is guaranteed to happen before fb_console_init() as it gets called as a console_initcall where as fb_console_init() gets called as a subsys_initcall. Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit 15f4c357f909d5fbde43b36e137756d5c654a59d Author: Hans de Goede Date: Fri Aug 10 17:23:01 2018 +0200 fbcon: Only allow FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER if fbdev is builtin Having FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER with fbdev+fbcon being build as a module does not make much sense. Having FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER only when fbdev+fbcon are builtin was always the intention, hence the =y checks but they were checking the wrong option, fbcon is build as part of fb.ko, so we must check for FB=y. Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit aa12af77aae05008b3e637b85944dcd512f75eba Author: Ankit Navik Date: Tue Aug 7 13:16:35 2018 +0530 Bluetooth: Add definitions for LE set address resolution Add the definitions for LE address resolution enable HCI commands. When the LE address resolution enable gets changed via HCI commands make sure that flag gets updated. Signed-off-by: Ankit Navik Signed-off-by: Marcel Holtmann commit 60afdf066a35317efd5d1d7ae7c7f4ef2b32601f Merge: c4c202175424 638264dc9022 Author: Daniel Borkmann Date: Fri Aug 10 16:12:22 2018 +0200 Merge branch 'bpf-veth-xdp-support' Toshiaki Makita says: ==================== This patch set introduces driver XDP for veth. Basically this is used in conjunction with redirect action of another XDP program. NIC -----------> veth===veth (XDP) (redirect) (XDP) In this case xdp_frame can be forwarded to the peer veth without modification, so we can expect far better performance than generic XDP. Envisioned use-cases -------------------- * Container managed XDP program Container host redirects frames to containers by XDP redirect action, and privileged containers can deploy their own XDP programs. * XDP program cascading Two or more XDP programs can be called for each packet by redirecting xdp frames to veth. * Internal interface for an XDP bridge When using XDP redirection to create a virtual bridge, veth can be used to create an internal interface for the bridge. Implementation -------------- This changeset is making use of NAPI to implement ndo_xdp_xmit and XDP_TX/REDIRECT. This is mainly because XDP heavily relies on NAPI context. - patch 1: Export a function needed for veth XDP. - patch 2-3: Basic implementation of veth XDP. - patch 4-6: Add ndo_xdp_xmit. - patch 7-9: Add XDP_TX and XDP_REDIRECT. - patch 10: Performance optimization for multi-queue env. Tests and performance numbers ----------------------------- Tested with a simple XDP program which only redirects packets between NIC and veth. I used i40e 25G NIC (XXV710) for the physical NIC. The server has 20 of Xeon Silver 2.20 GHz cores. pktgen --(wire)--> XXV710 (i40e) <--(XDP redirect)--> veth===veth (XDP) The rightmost veth loads XDP progs and just does DROP or TX. The number of packets is measured in the XDP progs. The leftmost pktgen sends packets at 37.1 Mpps (almost 25G wire speed). veth XDP action Flows Mpps ================================ DROP 1 10.6 DROP 2 21.2 DROP 100 36.0 TX 1 5.0 TX 2 10.0 TX 100 31.0 I also measured netperf TCP_STREAM but was not so great performance due to lack of tx/rx checksum offload and TSO, etc. netperf <--(wire)--> XXV710 (i40e) <--(XDP redirect)--> veth===veth (XDP PASS) Direction Flows Gbps ============================== external->veth 1 20.8 external->veth 2 23.5 external->veth 100 23.6 veth->external 1 9.0 veth->external 2 17.8 veth->external 100 22.9 Also tested doing ifup/down or load/unload a XDP program repeatedly during processing XDP packets in order to check if enabling/disabling NAPI is working as expected, and found no problems. v8: - Don't use xdp_frame pointer address to calculate skb->head, headroom, and xdp_buff.data_hard_start. v7: - Introduce xdp_scrub_frame() to clear kernel pointers in xdp_frame and use it instead of memset(). v6: - Check skb->len only if reallocation is needed. - Add __GFP_NOWARN to alloc_page() since it can be triggered by external events. - Fix sparse warning around EXPORT_SYMBOL. v5: - Fix broken SOBs. v4: - Don't adjust MTU automatically. - Skip peer IFF_UP check on .ndo_xdp_xmit() because it is unnecessary. Add comments to explain that. - Use redirect_info instead of xdp_mem_info for storing no_direct flag to avoid per packet copy cost. v3: - Drop skb bulk xmit patch since it makes little performance difference. The hotspot in TCP skb xmit at this point is checksum computation in skb_segment and packet copy on XDP_REDIRECT due to cloned/nonlinear skb. - Fix race on closing device. - Add extack messages in ndo_bpf. v2: - Squash NAPI patch with "Add driver XDP" patch. - Remove conversion from xdp_frame to skb when NAPI is not enabled. - Introduce per-queue XDP ring (patch 8). - Introduce bulk skb xmit when XDP is enabled on the peer (patch 9). ==================== Signed-off-by: Toshiaki Makita Signed-off-by: Daniel Borkmann commit 638264dc90227cca00d20c26680171addce18e51 Author: Toshiaki Makita Date: Fri Aug 3 16:58:18 2018 +0900 veth: Support per queue XDP ring Move XDP and napi related fields from veth_priv to newly created veth_rq structure. When xdp_frames are enqueued from ndo_xdp_xmit and XDP_TX, rxq is selected by current cpu. When skbs are enqueued from the peer device, rxq is one to one mapping of its peer txq. This way we have a restriction that the number of rxqs must not less than the number of peer txqs, but leave the possibility to achieve bulk skb xmit in the future because txq lock would make it possible to remove rxq ptr_ring lock. v3: - Add extack messages. - Fix array overrun in veth_xmit. Signed-off-by: Toshiaki Makita Signed-off-by: Daniel Borkmann commit d1396004dd868642ea2596abe058d96dcf97990f Author: Toshiaki Makita Date: Fri Aug 3 16:58:17 2018 +0900 veth: Add XDP TX and REDIRECT This allows further redirection of xdp_frames like NIC -> veth--veth -> veth--veth (XDP) (XDP) (XDP) The intermediate XDP, redirecting packets from NIC to the other veth, reuses xdp_mem_info from NIC so that page recycling of the NIC works on the destination veth's XDP. In this way return_frame is not fully guarded by NAPI, since another NAPI handler on another cpu may use the same xdp_mem_info concurrently. Thus disable napi_direct by xdp_set_return_frame_no_direct() during the NAPI context. v8: - Don't use xdp_frame pointer address for data_hard_start of xdp_buff. v4: - Use xdp_[set|clear]_return_frame_no_direct() instead of a flag in xdp_mem_info. v3: - Fix double free when veth_xdp_tx() returns a positive value. - Convert xdp_xmit and xdp_redir variables into flags. Signed-off-by: Toshiaki Makita Signed-off-by: Daniel Borkmann commit 2539650fadbf63a431e76535a9de7bff6ea5e409 Author: Toshiaki Makita Date: Fri Aug 3 16:58:16 2018 +0900 xdp: Helpers for disabling napi_direct of xdp_return_frame We need some mechanism to disable napi_direct on calling xdp_return_frame_rx_napi() from some context. When veth gets support of XDP_REDIRECT, it will redirects packets which are redirected from other devices. On redirection veth will reuse xdp_mem_info of the redirection source device to make return_frame work. But in this case .ndo_xdp_xmit() called from veth redirection uses xdp_mem_info which is not guarded by NAPI, because the .ndo_xdp_xmit() is not called directly from the rxq which owns the xdp_mem_info. This approach introduces a flag in bpf_redirect_info to indicate that napi_direct should be disabled even when _rx_napi variant is used as well as helper functions to use it. A NAPI handler who wants to use this flag needs to call xdp_set_return_frame_no_direct() before processing packets, and call xdp_clear_return_frame_no_direct() after xdp_do_flush_map() before exiting NAPI. v4: - Use bpf_redirect_info for storing the flag instead of xdp_mem_info to avoid per-frame copy cost. Signed-off-by: Toshiaki Makita Signed-off-by: Daniel Borkmann commit 0b19cc0a8694d4295383f88bc3441765875a57bc Author: Toshiaki Makita Date: Fri Aug 3 16:58:15 2018 +0900 bpf: Make redirect_info accessible from modules We are going to add kern_flags field in redirect_info for kernel internal use. In order to avoid function call to access the flags, make redirect_info accessible from modules. Also as it is now non-static, add prefix bpf_ to redirect_info. v6: - Fix sparse warning around EXPORT_SYMBOL. Signed-off-by: Toshiaki Makita Signed-off-by: Daniel Borkmann commit af87a3aa1b5f397a2f5c99b97b000943c5177da7 Author: Toshiaki Makita Date: Fri Aug 3 16:58:14 2018 +0900 veth: Add ndo_xdp_xmit This allows NIC's XDP to redirect packets to veth. The destination veth device enqueues redirected packets to the napi ring of its peer, then they are processed by XDP on its peer veth device. This can be thought as calling another XDP program by XDP program using REDIRECT, when the peer enables driver XDP. Note that when the peer veth device does not set driver xdp, redirected packets will be dropped because the peer is not ready for NAPI. v4: - Don't use xdp_ok_fwd_dev() because checking IFF_UP is not necessary. Add comments about it and check only MTU. v2: - Drop the part converting xdp_frame into skb when XDP is not enabled. - Implement bulk interface of ndo_xdp_xmit. - Implement XDP_XMIT_FLUSH bit and drop ndo_xdp_flush. Signed-off-by: Toshiaki Makita Acked-by: John Fastabend Signed-off-by: Daniel Borkmann commit 9fc8d518d9d590998209f2686e026a488f65d41e Author: Toshiaki Makita Date: Fri Aug 3 16:58:13 2018 +0900 veth: Handle xdp_frames in xdp napi ring This is preparation for XDP TX and ndo_xdp_xmit. This allows napi handler to handle xdp_frames through xdp ring as well as sk_buff. v8: - Don't use xdp_frame pointer address to calculate skb->head and headroom. v7: - Use xdp_scrub_frame() instead of memset(). v3: - Revert v2 change around rings and use a flag to differentiate skb and xdp_frame, since bulk skb xmit makes little performance difference for now. v2: - Use another ring instead of using flag to differentiate skb and xdp_frame. This approach makes bulk skb transmit possible in veth_xmit later. - Clear xdp_frame feilds in skb->head. - Implement adjust_tail. Signed-off-by: Toshiaki Makita Acked-by: John Fastabend Acked-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann commit a8d5b4ab353738e16e5f9d21ab1e3d44b37983d0 Author: Toshiaki Makita Date: Fri Aug 3 16:58:12 2018 +0900 xdp: Helper function to clear kernel pointers in xdp_frame xdp_frame has kernel pointers which should not be readable from bpf programs. When we want to reuse xdp_frame region but it may be read by bpf programs later, we can use this helper to clear kernel pointers. This is more efficient than calling memset() for the entire struct. Signed-off-by: Toshiaki Makita Acked-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann commit dc2248220a4aa61560c95aca98d4162095bd7e8a Author: Toshiaki Makita Date: Fri Aug 3 16:58:11 2018 +0900 veth: Avoid drops by oversized packets when XDP is enabled Oversized packets including GSO packets can be dropped if XDP is enabled on receiver side, so don't send such packets from peer. Drop TSO and SCTP fragmentation features so that veth devices themselves segment packets with XDP enabled. Also cap MTU accordingly. v4: - Don't auto-adjust MTU but cap max MTU. Signed-off-by: Toshiaki Makita Signed-off-by: Daniel Borkmann commit 948d4f214fde43743c57aae0c708bff44f6345f2 Author: Toshiaki Makita Date: Fri Aug 3 16:58:10 2018 +0900 veth: Add driver XDP This is the basic implementation of veth driver XDP. Incoming packets are sent from the peer veth device in the form of skb, so this is generally doing the same thing as generic XDP. This itself is not so useful, but a starting point to implement other useful veth XDP features like TX and REDIRECT. This introduces NAPI when XDP is enabled, because XDP is now heavily relies on NAPI context. Use ptr_ring to emulate NIC ring. Tx function enqueues packets to the ring and peer NAPI handler drains the ring. Currently only one ring is allocated for each veth device, so it does not scale on multiqueue env. This can be resolved by allocating rings on the per-queue basis later. Note that NAPI is not used but netif_rx is used when XDP is not loaded, so this does not change the default behaviour. v6: - Check skb->len only when allocation is needed. - Add __GFP_NOWARN to alloc_page() as it can be triggered by external events. v3: - Fix race on closing the device. - Add extack messages in ndo_bpf. v2: - Squashed with the patch adding NAPI. - Implement adjust_tail. - Don't acquire consumer lock because it is guarded by NAPI. - Make poll_controller noop since it is unnecessary. - Register rxq_info on enabling XDP rather than on opening the device. Signed-off-by: Toshiaki Makita Signed-off-by: Daniel Borkmann commit b0768a86585d4d951a30ff565f19598dbbd67897 Author: Toshiaki Makita Date: Fri Aug 3 16:58:09 2018 +0900 net: Export skb_headers_offset_update This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita Signed-off-by: Daniel Borkmann commit c4c20217542469b9caf7f700ac9a2eeb32cb3742 Merge: eb91e4d4db06 1bca4e6b1863 Author: Daniel Borkmann Date: Fri Aug 10 16:07:50 2018 +0200 Merge branch 'bpf-sample-cpumap-lb' Jesper Dangaard Brouer says: ==================== Background: cpumap moves the SKB allocation out of the driver code, and instead allocate it on the remote CPU, and invokes the regular kernel network stack with the newly allocated SKB. The idea behind the XDP CPU redirect feature, is to use XDP as a load-balancer step in-front of regular kernel network stack. But the current sample code does not provide a good example of this. Part of the reason is that, I have implemented this as part of Suricata XDP load-balancer. Given this is the most frequent feature request I get. This patchset implement the same XDP load-balancing as Suricata does, which is a symmetric hash based on the IP-pairs + L4-protocol. The expected setup for the use-case is to reduce the number of NIC RX queues via ethtool (as XDP can handle more per core), and via smp_affinity assign these RX queues to a set of CPUs, which will be handling RX packets. The CPUs that runs the regular network stack is supplied to the sample xdp_redirect_cpu tool by specifying the --cpu option multiple times on the cmdline. I do note that cpumap SKB creation is not feature complete yet, and more work is coming. E.g. given GRO is not implemented yet, do expect TCP workloads to be slower. My measurements do indicate UDP workloads are faster. ==================== Signed-off-by: Daniel Borkmann commit 1bca4e6b1863c0a006fde6a66720a87823109294 Author: Jesper Dangaard Brouer Date: Fri Aug 10 14:03:02 2018 +0200 samples/bpf: xdp_redirect_cpu load balance like Suricata This implement XDP CPU redirection load-balancing across available CPUs, based on the hashing IP-pairs + L4-protocol. This equivalent to xdp-cpu-redirect feature in Suricata, which is inspired by the Suricata 'ippair' hashing code. An important property is that the hashing is flow symmetric, meaning that if the source and destination gets swapped then the selected CPU will remain the same. This is helps locality by placing both directions of a flows on the same CPU, in a forwarding/routing scenario. The hashing INITVAL (15485863 the 10^6th prime number) was fairly arbitrary choosen, but experiments with kernel tree pktgen scripts (pktgen_sample04_many_flows.sh +pktgen_sample05_flow_per_thread.sh) showed this improved the distribution. This patch also change the default loaded XDP program to be this load-balancer. As based on different user feedback, this seems to be the expected behavior of the sample xdp_redirect_cpu. Link: https://github.com/OISF/suricata/commit/796ec08dd7a63 Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann commit 11395686586bc9ca867b3f27501fd6c48244187a Author: Jesper Dangaard Brouer Date: Fri Aug 10 14:02:57 2018 +0200 samples/bpf: add Paul Hsieh's (LGPL 2.1) hash function SuperFastHash Adjusted function call API to take an initval. This allow the API user to set the initial value, as a seed. This could also be used for inputting the previous hash. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann commit eb91e4d4db06adef06e7f50c02813c13c6ca5a5b Author: Björn Töpel Date: Fri Aug 10 11:28:02 2018 +0200 Revert "xdp: add NULL pointer check in __xdp_return()" This reverts commit 36e0f12bbfd3016f495904b35e41c5711707509f. The reverted commit adds a WARN to check against NULL entries in the mem_id_ht rhashtable. Any kernel path implementing the XDP (generic or driver) fast path is required to make a paired xdp_rxq_info_reg/xdp_rxq_info_unreg call for proper function. In addition, a driver using a different allocation scheme than the default MEM_TYPE_PAGE_SHARED is required to additionally call xdp_rxq_info_reg_mem_model. For MEM_TYPE_ZERO_COPY, an xdp_rxq_info_reg_mem_model call ensures that the mem_id_ht rhashtable has a properly inserted allocator id. If not, this would be a driver bug. A NULL pointer kernel OOPS is preferred to the WARN. Suggested-by: Jesper Dangaard Brouer Signed-off-by: Björn Töpel Acked-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann commit f7a6947cd49b7ff4e03f1b4f7e7b223003d752ca Author: Michael Ellerman Date: Tue Jul 10 16:20:56 2018 +1000 powerpc/uaccess: Enable get_user(u64, *p) on 32-bit Currently if you build a 32-bit powerpc kernel and use get_user() to load a u64 value it will fail to build with eg: kernel/rseq.o: In function `rseq_get_rseq_cs': kernel/rseq.c:123: undefined reference to `__get_user_bad' This is hitting the check in __get_user_size() that makes sure the size we're copying doesn't exceed the size of the destination: #define __get_user_size(x, ptr, size, retval) do { retval = 0; __chk_user_ptr(ptr); if (size > sizeof(x)) (x) = __get_user_bad(); Which doesn't immediately make sense because the size of the destination is u64, but it's not really, because __get_user_check() etc. internally create an unsigned long and copy into that: #define __get_user_check(x, ptr, size) ({ long __gu_err = -EFAULT; unsigned long __gu_val = 0; The problem being that on 32-bit unsigned long is not big enough to hold a u64. We can fix this with a trick from hpa in the x86 code, we statically check the type of x and set the type of __gu_val to either unsigned long or unsigned long long. Signed-off-by: Michael Ellerman commit f405b510c93eeb7390d0e2c6ef8d12af9a33021a Author: Aneesh Kumar K.V Date: Thu Aug 9 19:06:42 2018 +0530 powerpc/mm/hash: Remove unnecessary do { } while(0) loop Avoid coverity false warnings like: *** CID 187347: Control flow issues (UNREACHABLE) /arch/powerpc/mm/hash_native_64.c: 819 in native_flush_hash_range() 813 slot += hidx & _PTEIDX_GROUP_IX; 814 hptep = htab_address + slot; 815 want_v = hpte_encode_avpn(vpn, psize, ssize); 816 hpte_v = hpte_get_old_v(hptep); 817 818 if (!HPTE_V_COMPARE(hpte_v, want_v) || !(hpte_v & HPTE_V_VALID)) >>> CID 187347: Control flow issues (UNREACHABLE) Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit e7e81847478b37a3958a3163171bf6aee99f87d7 Author: Nicholas Piggin Date: Fri Aug 10 16:42:48 2018 +1000 powerpc/64s: move machine check SLB flushing to mm/slb.c The machine check code that flushes and restores bolted segments in real mode belongs in mm/slb.c. This will also be used by pseries machine check and idle code in future changes. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit ae24ce5e12127eeef6bf946c3ee0e95f3797caaf Author: Aneesh Kumar K.V Date: Thu Aug 9 19:07:20 2018 +0530 powerpc/powernv/idle: Fix build error Fix the below build error using strlcpy instead of strncpy In function 'pnv_parse_cpuidle_dt', inlined from 'pnv_init_idle_states' at arch/powerpc/platforms/powernv/idle.c:840:7, inlined from '__machine_initcall_powernv_pnv_init_idle_states' at arch/powerpc/platforms/powernv/idle.c:870:1: arch/powerpc/platforms/powernv/idle.c:820:3: error: 'strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] strncpy(pnv_idle_states[i].name, temp_string[i], ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PNV_IDLE_NAME_LEN); Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit 0b6aa1a20add96437c46db77c9bae2d7529dfbc1 Author: Aneesh Kumar K.V Date: Thu Aug 9 19:06:59 2018 +0530 powerpc/mm/tlbflush: update the mmu_gather page size while iterating address range This patch makes sure we update the mmu_gather page size even if we are requesting for a fullmm flush. This avoids triggering VM_WARN_ON in code paths like __tlb_remove_page_size that explicitly check for removing range page size to be same as mmu gather page size. Fixes: 5a6099346c41 ("powerpc/64s/radix: tlb do not flush on page size when fullmm") Signed-off-by: Aneesh Kumar K.V Acked-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit fce278af81daf8599f9e94883cbe43068b6c4785 Author: Mathieu Malaterre Date: Fri Jun 22 21:27:47 2018 +0200 powerpc/mm: remove warning about ‘type’ being set ‘type’ is only used when CONFIG_DEBUG_HIGHMEM is set. So add a possibly unused tag to variable. Remove warning treated as error with W=1: arch/powerpc/mm/highmem.c:59:6: error: variable ‘type’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Mathieu Malaterre Signed-off-by: Michael Ellerman commit f2c6d0d1092e3da2bd36c768777e883fa3908548 Author: Mathieu Malaterre Date: Fri Jun 22 21:26:53 2018 +0200 powerpc/32: Include setup.h header file to fix warnings Make sure to include setup.h to provide the following prototypes: - irqstack_early_init - setup_power_save - initialize_cache_info Fix the following warnings (treated as error in W=1): arch/powerpc/kernel/setup_32.c:198:13: error: no previous prototype for ‘irqstack_early_init’ arch/powerpc/kernel/setup_32.c:238:13: error: no previous prototype for ‘setup_power_save’ arch/powerpc/kernel/setup_32.c:253:13: error: no previous prototype for ‘initialize_cache_info’ Signed-off-by: Mathieu Malaterre Signed-off-by: Michael Ellerman commit eab00a208eb63d863b6cc0a03f68b4424ef5add8 Author: Mathieu Malaterre Date: Wed Apr 4 22:08:35 2018 +0200 powerpc: Move `path` variable inside DEBUG_PROM Add gcc attribute unused for two variables. Fix warnings treated as errors with W=1: arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable] Suggested-by: Christophe Leroy Signed-off-by: Mathieu Malaterre Signed-off-by: Michael Ellerman commit 618a89d738fdd97f6fc58b7b666c7a84b2bb95e3 Author: Mathieu Malaterre Date: Wed Mar 28 21:39:35 2018 +0200 powerpc/powermac: Make some functions static These functions can all be static, make it so. Fix warnings treated as errors with W=1: arch/powerpc/platforms/powermac/pci.c:1022:6: error: no previous prototype for ‘pmac_pci_fixup_ohci’ arch/powerpc/platforms/powermac/pci.c:1057:6: error: no previous prototype for ‘pmac_pci_fixup_cardbus’ arch/powerpc/platforms/powermac/pci.c:1094:6: error: no previous prototype for ‘pmac_pci_fixup_pciata’ Remove has_address declaration and assignment since it's not used. Also add gcc attribute unused to fix a warning treated as error with W=1: arch/powerpc/platforms/powermac/pci.c:784:19: error: variable ‘has_address’ set but not used arch/powerpc/platforms/powermac/pci.c:907:22: error: variable ‘ht’ set but not used Suggested-by: Christophe Leroy Signed-off-by: Mathieu Malaterre Signed-off-by: Michael Ellerman commit 8921305c1ec9d9ea23e5f8eac3063021e836530a Author: Mathieu Malaterre Date: Wed Mar 28 21:30:28 2018 +0200 powerpc/powermac: Remove variable x that's never read Since the value of x is never intended to be read, remove it. Fix warning treated as error with W=1: arch/powerpc/platforms/powermac/udbg_scc.c:76:9: error: variable ‘x’ set but not used Suggested-by: Christophe Leroy Signed-off-by: Mathieu Malaterre Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman commit e4ecafb14fd9cd77d8f4320af1922e700db56d2b Author: Mathieu Malaterre Date: Thu Mar 22 22:05:28 2018 +0100 cxl: remove a dead branch In commit 14baf4d9c739 ("cxl: Add guest-specific code") the following code was added: if (afu->crs_len < 0) { dev_err(&afu->dev, "Unexpected configuration record size value\n"); return -EINVAL; } However the variable `crs_len` is of type u64 and cannot be compared < 0. Remove the dead code section. Fix the following warning treated as error with W=1: ../drivers/misc/cxl/guest.c:919:19: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] Signed-off-by: Mathieu Malaterre Signed-off-by: Michael Ellerman commit 2fff0f07b8441a481eb5fc0bfcd0e46d6dbd90db Author: Mathieu Malaterre Date: Thu Mar 22 21:20:02 2018 +0100 powerpc/powermac: Add missing include of header pmac.h The header `pmac.h` was not included, leading to the following warnings, treated as error with W=1: arch/powerpc/platforms/powermac/time.c:69:13: error: no previous prototype for ‘pmac_time_init’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:207:15: error: no previous prototype for ‘pmac_get_boot_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:222:6: error: no previous prototype for ‘pmac_get_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:240:5: error: no previous prototype for ‘pmac_set_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:259:12: error: no previous prototype for ‘via_calibrate_decr’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:311:13: error: no previous prototype for ‘pmac_calibrate_decr’ [-Werror=missing-prototypes] The function `via_calibrate_decr` was made static to silence a warning. Signed-off-by: Mathieu Malaterre Signed-off-by: Michael Ellerman commit baedcdf5054c151a33e34392af7d8c3a244f16e6 Author: Markus Elfring Date: Sun Mar 11 09:03:42 2018 +0100 powerpc/kexec: Use common error handling code in setup_new_fdt() Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Thiago Jung Bauermann Signed-off-by: Michael Ellerman commit 302c7b0c4ff5aed585419603f835dee30207e5d5 Author: Boqun Feng Date: Tue Nov 22 17:20:09 2016 +0800 powerpc/xmon: Add address lookup for percpu symbols Currently, in xmon, there is no obvious way to get an address for a percpu symbol for a particular cpu. Having such an ability would be good for debugging the system when percpu variables got involved. Therefore, this patch introduces a new xmon command "lp" to lookup the address for percpu symbols. Usage of "lp" is similar to "ls", except that we could add a cpu number to choose the variable of which cpu we want to lookup. If no cpu number is given, lookup for current cpu. Signed-off-by: Boqun Feng Signed-off-by: Michael Ellerman commit 646dbe40fa2a54118975792fa9b98cefac7d232e Author: Christophe Leroy Date: Wed Aug 8 15:36:34 2018 +0000 powerpc/mm: remove huge_pte_offset_and_shift() prototype huge_pte_offset_and_shift() has never existed Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit fa54a981ea7a852c145b05c95abba11e81fc1157 Author: Christophe Leroy Date: Thu Aug 9 08:14:41 2018 +0000 powerpc/lib: Use patch_site to patch copy_32 functions once cache is enabled The symbol memcpy_nocache_branch defined in order to allow patching of memset function once cache is enabled leads to confusing reports by perf tool. Using the new patch_site functionality solves this issue. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit cd813e1cd7122f2c261dce5b54d1e0c97f80e1a5 Author: Mahesh Salgaonkar Date: Tue Aug 7 19:46:46 2018 +0530 powerpc/pseries: Fix endianness while restoring of r3 in MCE handler. During Machine Check interrupt on pseries platform, register r3 points RTAS extended event log passed by hypervisor. Since hypervisor uses r3 to pass pointer to rtas log, it stores the original r3 value at the start of the memory (first 8 bytes) pointed by r3. Since hypervisor stores this info and rtas log is in BE format, linux should make sure to restore r3 value in correct endian format. Without this patch when MCE handler, after recovery, returns to code that that caused the MCE may end up with Data SLB access interrupt for invalid address followed by kernel panic or hang. Severe Machine check interrupt [Recovered] NIP [d00000000ca301b8]: init_module+0x1b8/0x338 [bork_kernel] Initiator: CPU Error type: SLB [Multihit] Effective address: d00000000ca70000 cpu 0xa: Vector: 380 (Data SLB Access) at [c0000000fc7775b0] pc: c0000000009694c0: vsnprintf+0x80/0x480 lr: c0000000009698e0: vscnprintf+0x20/0x60 sp: c0000000fc777830 msr: 8000000002009033 dar: a803a30c000000d0 current = 0xc00000000bc9ef00 paca = 0xc00000001eca5c00 softe: 3 irq_happened: 0x01 pid = 8860, comm = insmod vscnprintf+0x20/0x60 vprintk_emit+0xb4/0x4b0 vprintk_func+0x5c/0xd0 printk+0x38/0x4c init_module+0x1c0/0x338 [bork_kernel] do_one_initcall+0x54/0x230 do_init_module+0x8c/0x248 load_module+0x12b8/0x15b0 sys_finit_module+0xa8/0x110 system_call+0x58/0x6c --- Exception: c00 (System Call) at 00007fff8bda0644 SP (7fffdfbfe980) is in userspace This patch fixes this issue. Fixes: a08a53ea4c97 ("powerpc/le: Enable RTAS events support") Cc: stable@vger.kernel.org # v3.15+ Reviewed-by: Nicholas Piggin Signed-off-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman commit ced1bf52f47783135b985d2aacf53fa77fd72e2e Author: Hari Bathini Date: Tue Aug 7 02:12:54 2018 +0530 powerpc/fadump: merge adjacent memory ranges to reduce PT_LOAD segements With dynamic memory allocation support for crash memory ranges array, there is no hard limit on the no. of crash memory ranges kernel could export, but program headers count could overflow in the /proc/vmcore ELF file while exporting each memory range as PT_LOAD segment. Reduce the likelihood of a such scenario, by folding adjacent crash memory ranges which minimizes the total number of PT_LOAD segments. Signed-off-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman commit 1bd6a1c4b80a28d975287630644e6b47d0f977a5 Author: Hari Bathini Date: Tue Aug 7 02:12:45 2018 +0530 powerpc/fadump: handle crash memory ranges array index overflow Crash memory ranges is an array of memory ranges of the crashing kernel to be exported as a dump via /proc/vmcore file. The size of the array is set based on INIT_MEMBLOCK_REGIONS, which works alright in most cases where memblock memory regions count is less than INIT_MEMBLOCK_REGIONS value. But this count can grow beyond INIT_MEMBLOCK_REGIONS value since commit 142b45a72e22 ("memblock: Add array resizing support"). On large memory systems with a few DLPAR operations, the memblock memory regions count could be larger than INIT_MEMBLOCK_REGIONS value. On such systems, registering fadump results in crash or other system failures like below: task: c00007f39a290010 ti: c00000000b738000 task.ti: c00000000b738000 NIP: c000000000047df4 LR: c0000000000f9e58 CTR: c00000000010f180 REGS: c00000000b73b570 TRAP: 0300 Tainted: G L X (4.4.140+) MSR: 8000000000009033 CR: 22004484 XER: 20000000 CFAR: c000000000008500 DAR: 000007a450000000 DSISR: 40000000 SOFTE: 0 ... NIP [c000000000047df4] smp_send_reschedule+0x24/0x80 LR [c0000000000f9e58] resched_curr+0x138/0x160 Call Trace: resched_curr+0x138/0x160 (unreliable) check_preempt_curr+0xc8/0xf0 ttwu_do_wakeup+0x38/0x150 try_to_wake_up+0x224/0x4d0 __wake_up_common+0x94/0x100 ep_poll_callback+0xac/0x1c0 __wake_up_common+0x94/0x100 __wake_up_sync_key+0x70/0xa0 sock_def_readable+0x58/0xa0 unix_stream_sendmsg+0x2dc/0x4c0 sock_sendmsg+0x68/0xa0 ___sys_sendmsg+0x2cc/0x2e0 __sys_sendmsg+0x5c/0xc0 SyS_socketcall+0x36c/0x3f0 system_call+0x3c/0x100 as array index overflow is not checked for while setting up crash memory ranges causing memory corruption. To resolve this issue, dynamically allocate memory for crash memory ranges and resize it incrementally, in units of pagesize, on hitting array size limit. Fixes: 2df173d9e85d ("fadump: Initialize elfcore header and add PT_LOAD program headers.") Cc: stable@vger.kernel.org # v3.4+ Signed-off-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar [mpe: Just use PAGE_SIZE directly, fixup variable placement] Signed-off-by: Michael Ellerman commit 6bd6d8672208e8dc0c18588d6eb4588a195fd788 Author: Christophe Leroy Date: Mon Aug 6 15:09:11 2018 +0000 powerpc/cpm1: fix compilation error with CONFIG_PPC_EARLY_DEBUG_CPM commit e8cb7a55eb8dc ("powerpc: remove superflous inclusions of asm/fixmap.h") removed inclusion of asm/fixmap.h from files not including objects from that file. However, asm/mmu-8xx.h includes call to __fix_to_virt(). The proper way would be to include asm/fixmap.h in asm/mmu-8xx.h but it creates an inclusion loop. So we have to leave asm/fixmap.h in sysdep/cpm_common.c for CONFIG_PPC_EARLY_DEBUG_CPM CC arch/powerpc/sysdev/cpm_common.o In file included from ./arch/powerpc/include/asm/mmu.h:340:0, from ./arch/powerpc/include/asm/reg_8xx.h:8, from ./arch/powerpc/include/asm/reg.h:29, from ./arch/powerpc/include/asm/processor.h:13, from ./arch/powerpc/include/asm/thread_info.h:28, from ./include/linux/thread_info.h:38, from ./arch/powerpc/include/asm/ptrace.h:159, from ./arch/powerpc/include/asm/hw_irq.h:12, from ./arch/powerpc/include/asm/irqflags.h:12, from ./include/linux/irqflags.h:16, from ./include/asm-generic/cmpxchg-local.h:6, from ./arch/powerpc/include/asm/cmpxchg.h:537, from ./arch/powerpc/include/asm/atomic.h:11, from ./include/linux/atomic.h:5, from ./include/linux/mutex.h:18, from ./include/linux/kernfs.h:13, from ./include/linux/sysfs.h:16, from ./include/linux/kobject.h:20, from ./include/linux/device.h:16, from ./include/linux/node.h:18, from ./include/linux/cpu.h:17, from ./include/linux/of_device.h:5, from arch/powerpc/sysdev/cpm_common.c:21: arch/powerpc/sysdev/cpm_common.c: In function ‘udbg_init_cpm’: ./arch/powerpc/include/asm/mmu-8xx.h:218:25: error: implicit declaration of function ‘__fix_to_virt’ [-Werror=implicit-function-declaration] #define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE)) ^ arch/powerpc/sysdev/cpm_common.c:75:7: note: in expansion of macro ‘VIRT_IMMR_BASE’ VIRT_IMMR_BASE); ^ ./arch/powerpc/include/asm/mmu-8xx.h:218:39: error: ‘FIX_IMMR_BASE’ undeclared (first use in this function) #define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE)) ^ arch/powerpc/sysdev/cpm_common.c:75:7: note: in expansion of macro ‘VIRT_IMMR_BASE’ VIRT_IMMR_BASE); ^ ./arch/powerpc/include/asm/mmu-8xx.h:218:39: note: each undeclared identifier is reported only once for each function it appears in #define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE)) ^ arch/powerpc/sysdev/cpm_common.c:75:7: note: in expansion of macro ‘VIRT_IMMR_BASE’ VIRT_IMMR_BASE); ^ cc1: all warnings being treated as errors make[1]: *** [arch/powerpc/sysdev/cpm_common.o] Error 1 Fixes: e8cb7a55eb8dc ("powerpc: remove superflous inclusions of asm/fixmap.h") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit c42d3be0c06f0c1c416054022aa535c08a1f9b39 Author: Dan Carpenter Date: Wed Aug 8 14:57:24 2018 +0300 powerpc: Fix size calculation using resource_size() The problem is the the calculation should be "end - start + 1" but the plus one is missing in this calculation. Fixes: 8626816e905e ("powerpc: add support for MPIC message register API") Signed-off-by: Dan Carpenter Reviewed-by: Tyrel Datwyler Signed-off-by: Michael Ellerman commit 24576a70e7dfa703617a5e7ae8e6cbd66cfb6e5d Author: Rashmica Gupta Date: Fri Aug 3 16:06:01 2018 +1000 Documentation: Update documentation on ppc-memtrace Signed-off-by: Rashmica Gupta Signed-off-by: Michael Ellerman commit d3da701d3308ce1fa457f32c6c9e2102aedea030 Author: Rashmica Gupta Date: Fri Aug 3 16:06:00 2018 +1000 powerpc/powernv: Allow memory that has been hot-removed to be hot-added This patch allows the memory removed by memtrace to be readded to the kernel. So now you don't have to reboot your system to add the memory back to the kernel or to have a different amount of memory removed. Signed-off-by: Rashmica Gupta Tested-by: Michael Neuling Signed-off-by: Michael Ellerman commit 563a53f3906a6b43692498e5b3ae891fac93a4af Author: Bartosz Golaszewski Date: Fri Aug 10 11:13:52 2018 +0200 spi: davinci: fix a NULL pointer dereference On non-OF systems spi->controlled_data may be NULL. This causes a NULL pointer derefence on dm365-evm. Signed-off-by: Bartosz Golaszewski Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 07d981ad4cf1e78361c6db1c28ee5ba105f96cc1 Author: Josh Poimboeuf Date: Fri Aug 10 08:31:10 2018 +0100 x86/microcode: Allow late microcode loading with SMT disabled The kernel unnecessarily prevents late microcode loading when SMT is disabled. It should be safe to allow it if all the primary threads are online. Signed-off-by: Josh Poimboeuf Acked-by: Borislav Petkov Signed-off-by: David Woodhouse commit e02789a53d71334b067ad72eee5d4e88a0158083 Author: Steve French Date: Thu Aug 9 14:33:12 2018 -0500 smb3: enumerating snapshots was leaving part of the data off end When enumerating snapshots, the last few bytes of the final snapshot could be left off since we were miscalculating the length returned (leaving off the sizeof struct SRV_SNAPSHOT_ARRAY) See MS-SMB2 section 2.2.32.2. In addition fixup the length used to allow smaller buffer to be passed in, in order to allow returning the size of the whole snapshot array more easily. Sample userspace output with a kernel patched with this (mounted to a Windows volume with two snapshots). Before this patch, the second snapshot would be missing a few bytes at the end. ~/cifs-2.6# ~/enum-snapshots /mnt/file press enter to issue the ioctl to retrieve snapshot information ... size of snapshot array = 102 Num snapshots: 2 Num returned: 2 Array Size: 102 Snapshot 0:@GMT-2018.06.30-19.34.17 Snapshot 1:@GMT-2018.06.30-19.33.37 CC: Stable Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 730928c8f4be88e9d6a027a16b1e8fa9c59fc077 Author: Ronnie Sahlberg Date: Wed Aug 8 15:07:49 2018 +1000 cifs: update smb2_queryfs() to use compounding Change smb2_queryfs() to use a Create/QueryInfo/Close compound request. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Paulo Alcantara Reviewed-by: Pavel Shilovsky commit b24df3e30cbf48255db866720fb71f14bf9d2f39 Author: Ronnie Sahlberg Date: Wed Aug 8 15:07:45 2018 +1000 cifs: update receive_encrypted_standard to handle compounded responses Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Paulo Alcantara Reviewed-by: Pavel Shilovsky commit 557ce95051c8eff67af48612ab350d8408aa0541 Merge: 8511b7da1869 b045d3af7d1f Author: Dave Airlie Date: Fri Aug 10 11:43:02 2018 +1000 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next More fixes for 4.19: - Fixes for scheduler - Fix for SR-IOV - Fixes for display Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180809200052.2777-1-alexander.deucher@amd.com commit 8511b7da18694491afb50a5cf1515c29a999c7a4 Merge: 4abfe15e2a0a 2d87e6c1b99c Author: Dave Airlie Date: Fri Aug 10 11:37:30 2018 +1000 Merge tag 'imx-drm-fixes-2018-08-03' of git://git.pengutronix.de/git/pza/linux into drm-next drm/imx: ipu-v3 plane offset and IPU id fixes - Fix U/V plane offsets for odd vertical offsets. Due to wrong operator order, the y offset was not rounded down properly for vertically chroma subsampled planar formats. - Fix IPU id number for boards that don't have an OF alias for their single IPU in the device tree. This is necessary to support imx-media on i.MX51 and i.MX53 SoCs. Signed-off-by: Dave Airlie From: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/1533552680.4204.14.camel@pengutronix.de commit 4abfe15e2a0a700eb36587dc3b3b1c29a609e4fb Merge: 824da016fde1 5c41bb607125 Author: Dave Airlie Date: Fri Aug 10 10:44:20 2018 +1000 Merge tag 'imx-drm-next-2018-08-03' of git://git.pengutronix.de/git/pza/linux into drm-next drm/imx: use suspend/resume helpers, add ipu-v3 V4L2 XRGB32/XBGR32 support - Convert imx_drm_suspend/resume to use the drm_mode_config_helper_suspend/ resume functions. - Add support for V4L2_PIX_FMT_XRGB32/XBGR32, corresponding to DRM_FORMAT_XRGB8888/BGRX8888, respectively. Signed-off-by: Dave Airlie From: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/1533552701.4204.15.camel@pengutronix.de commit 10dbc9fedcf151ab794f5e22d4f34f1eff01a08f Author: Logan Gunthorpe Date: Thu Aug 9 17:09:17 2018 -0500 PCI: Add ACS Redirect disable quirk for Intel Sunrise Point Intel Sunrise Point PCH hardware has an implementation of the ACS bits that does not comply with the PCIe standard. Add a device-specific quirk, pci_quirk_disable_intel_spt_pch_acs_redir() to disable ACS Redirection on this system. Signed-off-by: Logan Gunthorpe [bhelgaas: changelog, split to separate patch] Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson commit 73c47ddef29b5869a2221e93cefdb56fd8263718 Author: Logan Gunthorpe Date: Thu Aug 9 16:51:43 2018 -0500 PCI: Add device-specific ACS Redirect disable infrastructure Intel Sunrise Point (SPT) PCH hardware has an implementation of the ACS bits that does not comply with the PCIe standard. To deal with this we need device-specific quirks to disable ACS redirection. Add a new pci_dev_specific_disable_acs_redir() quirk and a new .disable_acs_redir() function pointer for use by non-compliant devices. No functional change intended. Signed-off-by: Logan Gunthorpe [bhelgaas: split to separate patch, move pci_dev_specific_disable_acs_redir() declarations to drivers/pci/pci.h] Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson commit 3b269185c19268027ac79388b03c9d7322518e4c Author: Logan Gunthorpe Date: Thu Aug 9 16:45:47 2018 -0500 PCI: Convert device-specific ACS quirks from NULL termination to ARRAY_SIZE Convert the search for device-specific ACS enable quirks from searching a NULL-terminated array to iterating through the array, which is always fixed-size anyway. No functional change intended. Signed-off-by: Logan Gunthorpe [bhelgaas: changelog, split to separate patch for reviewability] Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson commit aaca43fda742223e4f62bd73e13055f5364e9a9b Author: Logan Gunthorpe Date: Mon Jul 30 10:18:40 2018 -0600 PCI: Add "pci=disable_acs_redir=" parameter for peer-to-peer support To support peer-to-peer traffic on a segment of the PCI hierarchy, we must disable the ACS redirect bits for select PCI bridges. The bridges must be selected before the devices are discovered by the kernel and the IOMMU groups created. Therefore, add a kernel command line parameter to specify devices which must have their ACS bits disabled. The new parameter takes a list of devices separated by a semicolon. Each device specified will have its ACS redirect bits disabled. This is similar to the existing 'resource_alignment' parameter. The ACS Request P2P Request Redirect, P2P Completion Redirect and P2P Egress Control bits are disabled, which is sufficient to always allow passing P2P traffic uninterrupted. The bits are set after the kernel (optionally) enables the ACS bits itself. It is also done regardless of whether the kernel or platform firmware sets the bits. If the user tries to disable the ACS redirect for a device without the ACS capability, print a warning to dmesg. Signed-off-by: Logan Gunthorpe [bhelgaas: reorder to add the generic code first and move the device-specific quirk to subsequent patches] Signed-off-by: Bjorn Helgaas Reviewed-by: Stephen Bates Reviewed-by: Alex Williamson Acked-by: Christian König commit 922983c2a1a2f679cd576eb7162f413c15a4e979 Author: Jason Gunthorpe Date: Thu Aug 9 19:19:35 2018 +0300 IB/uverbs: Fix reading of 32 bit flags This is missing a zeroing of the high bits of flags, and is also not correct for big endian machines. Properly zero extend the 32 bit flags into the 64 bit stack variable. Reported-by: Michael J. Ruhl Fixes: bccd06223f21 ("IB/uverbs: Add UVERBS_ATTR_FLAGS_IN to the specs language") Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky Reviewed-by: Michael J. Ruhl commit 22f20a110321efb7cde3e87ae99862e1036ca285 Author: Paul Burton Date: Thu Aug 9 14:43:42 2018 -0700 MIPS: Remove remnants of UASM_ISA Commit 33679a50370d ("MIPS: uasm: Remove needless ISA abstraction") removed use of the MIPS_ISA preprocessor macro, but left a couple of unused definitions of it behind. Remove the dead code. Signed-off-by: Paul Burton commit 36d2f761b5aa688567b6aebdc6d68e73682275d4 Author: Ganesh Goudar Date: Thu Aug 9 12:32:03 2018 +0530 cxgb4: update 1.20.8.0 as the latest firmware supported Change t4fw_version.h to update latest firmware version number to 1.20.8.0. Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 4d99f6602cb552fb58db0c3b1d935bb6fa017f24 Author: Andrei Vagin Date: Wed Aug 8 20:07:35 2018 -0700 net: allow to call netif_reset_xps_queues() under cpus_read_lock The definition of static_key_slow_inc() has cpus_read_lock in place. In the virtio_net driver, XPS queues are initialized after setting the queue:cpu affinity in virtnet_set_affinity() which is already protected within cpus_read_lock. Lockdep prints a warning when we are trying to acquire cpus_read_lock when it is already held. This patch adds an ability to call __netif_set_xps_queue under cpus_read_lock(). Acked-by: Jason Wang ============================================ WARNING: possible recursive locking detected 4.18.0-rc3-next-20180703+ #1 Not tainted -------------------------------------------- swapper/0/1 is trying to acquire lock: 00000000cf973d46 (cpu_hotplug_lock.rw_sem){++++}, at: static_key_slow_inc+0xe/0x20 but task is already holding lock: 00000000cf973d46 (cpu_hotplug_lock.rw_sem){++++}, at: init_vqs+0x513/0x5a0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(cpu_hotplug_lock.rw_sem); lock(cpu_hotplug_lock.rw_sem); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by swapper/0/1: #0: 00000000244bc7da (&dev->mutex){....}, at: __driver_attach+0x5a/0x110 #1: 00000000cf973d46 (cpu_hotplug_lock.rw_sem){++++}, at: init_vqs+0x513/0x5a0 #2: 000000005cd8463f (xps_map_mutex){+.+.}, at: __netif_set_xps_queue+0x8d/0xc60 v2: move cpus_read_lock() out of __netif_set_xps_queue() Cc: "Nambiar, Amritha" Cc: "Michael S. Tsirkin" Cc: Jason Wang Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue") Signed-off-by: Andrei Vagin Signed-off-by: David S. Miller commit 45db33709ccc7330c55fc6751c96468de407f2ac Author: Logan Gunthorpe Date: Mon Jul 30 10:18:38 2018 -0600 PCI: Allow specifying devices using a base bus and path of devfns When specifying PCI devices on the kernel command line using a bus/device/function address, bus numbers can change when adding or replacing a device, changing motherboard firmware, or applying kernel parameters like "pci=assign-buses". When bus numbers change, it's likely the command line tweak will be applied to the wrong device. Therefore, it is useful to be able to specify devices with a base bus number and the path of devfns needed to get to it, similar to the "device scope" structure in the Intel VT-d spec, Section 8.3.1. Thus, we add an option to specify devices in the following format: [:]:.[/.]* The path can be any segment within the PCI hierarchy of any length and determined through the use of 'lspci -t'. When specified this way, it is less likely that a renumbered bus will result in a valid device specification and the tweak won't be applied to the wrong device. Signed-off-by: Logan Gunthorpe [bhelgaas: use "device" instead of "slot" in documentation since that's the usual language in the PCI specs] Signed-off-by: Bjorn Helgaas Reviewed-by: Stephen Bates Reviewed-by: Alex Williamson Acked-by: Christian König commit 07d8d7e57c28ca9a07dab4efd75dad3a654aeb85 Author: Logan Gunthorpe Date: Mon Jul 30 10:18:37 2018 -0600 PCI: Make specifying PCI devices in kernel parameters reusable Separate out the code to match a PCI device with a string (typically originating from a kernel parameter) from the pci_specified_resource_alignment() function into its own helper function. While we are at it, this change fixes the kernel style of the function (fixing a number of long lines and extra parentheses). Additionally, make the analogous change to the kernel parameter documentation: Separate the description of how to specify a PCI device into its own section at the head of the "pci=" parameter. This patch should have no functional alterations. Signed-off-by: Logan Gunthorpe [bhelgaas: use "device" instead of "slot" in documentation since that's the usual language in the PCI specs] Signed-off-by: Bjorn Helgaas Reviewed-by: Stephen Bates Reviewed-by: Alex Williamson Acked-by: Christian König commit bd2e9567db72e37f7f4b90faa5133bc7365b5f65 Author: Bjorn Helgaas Date: Thu Aug 9 16:19:52 2018 -0500 PCI: Hide ACS quirk declarations inside PCI core Move declarations for these functions: pci_dev_specific_acs_enabled() pci_dev_specific_enable_acs() from include/linux/pci.h to drivers/pci/pci.h because nothing outside the PCI core needs to use them. Signed-off-by: Bjorn Helgaas commit 4005a7cb4f553a21d60f24ed7a18fbd26c6db9f4 Author: Andrew Lunn Date: Wed Aug 8 20:54:12 2018 +0200 net: phy: sftp: print debug message with text, not numbers Convert the state numbers, device state, etc from numbers to strings when printing debug messages. Signed-off-by: Andrew Lunn Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 51507c5f6484055c3d6071e9fb7aac5567efc20f Author: Colin Ian King Date: Wed Aug 8 19:04:27 2018 +0100 ethernet/qlogic: remove unused array msi_tgt_status Array msi_tgt_status is defined but never used, hence it is redundant and can be removed. Cleans up clang warning: warning: 'msi_tgt_status' defined but not used [-Wunused-const-variable=] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 933de7866b57b2fc8adc160642a81f07175f138d Author: Linus Walleij Date: Wed Aug 8 14:38:55 2018 +0200 net: dsa: rtl8366rb: Support port 4 (WAN) The totally undocumented IO mode needs to be set to enumerator 0 to enable port 4 also known as WAN in most configurations, for ordinary traffic. The 3 bits in the register come up as 010 after reset, but need to be set to 000. The Realtek source code contains a name for these bits, but no explanation of what the 8 different IO modes may be. Set it to zero for the time being and drop a comment so people know what is going on if they run into trouble. This "mode zero" works fine with the D-Link DIR-685 with RTL8366RB. Signed-off-by: Linus Walleij Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit cd16e5b233aadad5c4652f5466d1505a9f78bade Author: YueHaibing Date: Wed Aug 8 20:29:08 2018 +0800 mlxsw: spectrum_flower: use PTR_ERR_OR_ZERO() Fix ptr_ret.cocci warnings: drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c:543:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: YueHaibing Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 63cc5bcc9fc467bbe61cc9ee52509294bdf04c4b Author: Jiri Pirko Date: Wed Aug 8 14:04:13 2018 +0200 net: sched: fix block->refcnt decrement Currently the refcnt is never decremented in case the value is not 1. Fix it by adding decrement in case the refcnt is not 1. Reported-by: Vlad Buslov Fixes: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation") Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 0bab1cdc8c4d5392a5d9037cfbdbb2cacc91ce5e Author: YueHaibing Date: Wed Aug 8 19:59:32 2018 +0800 decnet: fix using plain integer as NULL warning Fixes the following sparse warning: net/decnet/dn_route.c:407:30: warning: Using plain integer as NULL pointer net/decnet/dn_route.c:1923:22: warning: Using plain integer as NULL pointer Signed-off-by: YueHaibing Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit 15693fd37fc3a49da356164ed15b571c175efc34 Author: YueHaibing Date: Wed Aug 8 19:40:31 2018 +0800 net: skbuff.h: fix using plain integer as NULL warning Fixes the following sparse warning: ./include/linux/skbuff.h:2365:58: warning: Using plain integer as NULL pointer Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 98471b5b7294665aeb9345d65eea2bf69687ad11 Author: Petr Oros Date: Wed Aug 8 13:35:01 2018 +0200 be2net: Use Kconfig flag to support for enabling/disabling adapters Add flags to enable/disable supported chips in be2net. With disable support are removed coresponding PCI IDs and also codepaths with [BE2|BE3|BEx|lancer|skyhawk]_chip checks. Disable chip will reduce module size by: BE2 ~2kb BE3 ~3kb Lancer ~10kb Skyhawk ~9kb When enable skyhawk only it will reduce module size by ~20kb New help style in Kconfig Reviewed-by: Ivan Vecera Signed-off-by: Petr Oros Signed-off-by: David S. Miller commit eb95f52fc72d15566fe06807c9e0cabbcd3480f1 Author: Maria Pasechnik Date: Wed Aug 8 11:46:30 2018 +0300 net: ipv6_gre: Fix GRO to work on IPv6 over GRE tap IPv6 GRO over GRE tap is not working while GRO is not set over the native interface. gro_list_prepare function updates the same_flow variable of existing sessions to 1 if their mac headers match the one of the incoming packet. same_flow is used to filter out non-matching sessions and keep potential ones for aggregation. The number of bytes to compare should be the number of bytes in the mac headers. In gro_list_prepare this number is set to be skb->dev->hard_header_len. For GRE interfaces this hard_header_len should be as it is set in the initialization process (when GRE is created), it should not be overridden. But currently it is being overridden by the value that is actually supposed to represent the needed_headroom. Therefore, the number of bytes compared in order to decide whether the the mac headers are the same is greater than the length of the headers. As it's documented in netdevice.h, hard_header_len is the maximum hardware header length, and needed_headroom is the extra headroom the hardware may need. hard_header_len is basically all the bytes received by the physical till layer 3 header of the packet received by the interface. For example, if the interface is a GRE tap then the needed_headroom should be the total length of the following headers: IP header of the physical, GRE header, mac header of GRE. It is often used to calculate the MTU of the created interface. This patch removes the override of the hard_header_len, and assigns the calculated value to needed_headroom. This way, the comparison in gro_list_prepare is really of the mac headers, and if the packets have the same mac headers the same_flow will be set to 1. Performance testing: 45% higher bandwidth. Measuring bandwidth of single-stream IPv4 TCP traffic over IPv6 GRE tap while GRO is not set on the native. NIC: ConnectX-4LX Before (GRO not working) : 7.2 Gbits/sec After (GRO working): 10.5 Gbits/sec Signed-off-by: Maria Pasechnik Signed-off-by: Tariq Toukan Signed-off-by: David S. Miller commit 333771526fbe14de3c871d8717bafc7b5b5249b3 Merge: 2eee32a74f6a 2ce9c93eaca6 Author: David S. Miller Date: Thu Aug 9 14:05:31 2018 -0700 Merge branch 'qed-Enhancements' Manish Chopra says: ==================== qed*: Enhancements This patch series adds following support in drivers - 1. Egress mqprio offload. 2. Add destination IP based flow profile. 3. Ingress flower offload (for drop action). Please consider applying this series to "net-next". ==================== Signed-off-by: David S. Miller commit 2ce9c93eaca6c67e3fa8828a471738a32cd66770 Author: Manish Chopra Date: Thu Aug 9 11:13:51 2018 -0700 qede: Ingress tc flower offload (drop action) support. The main motive of this patch is to lay down driver's tc offload infrastructure in place. With these changes tc can offload various supported flow profiles (4 tuples, src-ip, dst-ip, l4 port) for the drop action. Dropped flows statistic is a global counter for all the offloaded flows for drop action and is populated in ethtool statistics as common "gft_filter_drop". Examples - tc qdisc add dev p4p1 ingress tc filter add dev p4p1 protocol ipv4 parent ffff: flower \ skip_sw ip_proto tcp dst_ip 192.168.40.200 action drop tc filter add dev p4p1 protocol ipv4 parent ffff: flower \ skip_sw ip_proto udp src_ip 192.168.40.100 action drop tc filter add dev p4p1 protocol ipv4 parent ffff: flower \ skip_sw ip_proto tcp src_ip 192.168.40.100 dst_ip 192.168.40.200 \ src_port 453 dst_port 876 action drop tc filter add dev p4p1 protocol ipv4 parent ffff: flower \ skip_sw ip_proto tcp dst_port 98 action drop Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 91a56adbf178fa840069d000fb9d902f30e52456 Author: Manish Chopra Date: Thu Aug 9 11:13:50 2018 -0700 qede: Add destination ip based flow profile. This patch adds support for dropping and redirecting the flows based on destination IP in the packet. This also moves the profile mode settings in their own functions which can be used through tc flows in successive patch. For example - ethtool -N p5p1 flow-type tcp4 dst-ip 192.168.40.100 action -1 ethtool -N p5p1 flow-type udp4 dst-ip 192.168.50.100 action 1 ethtool -N p5p1 flow-type tcp4 dst-ip 192.168.60.100 action 0x100000000 Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 5e7baf0fcb2a3aef7329f3c7543d4695a46bd321 Author: Manish Chopra Date: Thu Aug 9 11:13:49 2018 -0700 qed/qede: Multi CoS support. This patch adds support for tc mqprio offload, using this different traffic classes on the adapter can be utilized based on configured priority to tc map. For example - tc qdisc add dev eth0 root mqprio num_tc 4 map 0 1 2 3 This will cause SKBs with priority 0,1,2,3 to transmit over tc 0,1,2,3 hardware queues respectively. Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 2eee32a74f6ad6f64ec418286f8a383c3ce73ccb Merge: a736e0746807 1a363b0d3bdc Author: David S. Miller Date: Thu Aug 9 14:02:50 2018 -0700 Merge branch 's390-qeth-next' Julian Wiedmann says: ==================== s390/qeth: updates 2018-08-09 one more set of patches for net-next. This is all sorts of cleanups and more refactoring on the way to using netdev_priv. Please apply. ==================== Signed-off-by: David S. Miller commit 1a363b0d3bdc7ee369d1f46f2ed7538b1d9481c7 Author: Gustavo A. R. Silva Date: Thu Aug 9 14:48:04 2018 +0200 s390/qeth: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit f15cdaf237e9acc2ee14663ba53b872a27ee7015 Author: Julian Wiedmann Date: Thu Aug 9 14:48:03 2018 +0200 s390/qeth: don't restrict qeth_card to DMA memory Allocating the main qeth_card struct with GFP_DMA blocks us from moving it into netdev_priv(). But the only reason why we need DMA memory is the ccw1 structs embedded into each ccw channel. So extract those into separate allocations, like we already do for the cmd buffers. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 95f4d8b75ad3fb774113450c9788af0dde91a27d Author: Julian Wiedmann Date: Thu Aug 9 14:48:02 2018 +0200 s390/qeth: clean up card initialization The qeth_card struct is kzalloc-ed, so remove all the redundant 0-initializations. While at it, split up what's left of qeth_determine_card_type(). Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 24142fd8d87d763bfc401cb0c496bb1050fea0b8 Author: Julian Wiedmann Date: Thu Aug 9 14:48:01 2018 +0200 s390/qeth: do basic setup for data channel The data channel currently doesn't need a setup operation, because we don't use pre-allocated cmd buffers for its IO. But subsequent changes will introduce further setup that also applies to the data channel. This refactors things a bit, so that the new stuff can then be automatically applied to all channels. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 45ca2fd64682cd1ea14b480fbb4b38b601ac123b Author: Julian Wiedmann Date: Thu Aug 9 14:48:00 2018 +0200 s390/qeth: use qeth_setup_ccw() to set up all CCWs Re-work the helper a little bit, so that it can be used for all CCWs that qeth issues. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 750b162598ec5b65cdb44d18f050b45cb7f8d31b Author: Julian Wiedmann Date: Thu Aug 9 14:47:59 2018 +0200 s390/qeth: reduce hard-coded access to ccw channels Where possible use accessor macros and local pointers to access the ccw channels. This makes it less likely to miss a spot. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 73657a3e5b0de69ccdabed0e340dcbbc99f46119 Author: Julian Wiedmann Date: Thu Aug 9 14:47:58 2018 +0200 s390/qeth: extract helper for MPC protocol type Just a little code deduplication. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 61884de08f8368b9aa289ab8dc953e0ce4c755b1 Author: Jens Axboe Date: Thu Aug 9 14:22:41 2018 -0600 null_blk: add lock drop/acquire annotation sparse complains: drivers/block/null_blk_main.c:816:24: sparse: context imbalance in 'null_insert_page' - unexpected unlock Fix it by adding the necessary annotations to the function. Signed-off-by: Jens Axboe commit 51ba09452d11b17248d80c740c2fd14c9fdc2c99 Author: Alex Williamson Date: Thu Aug 9 14:04:31 2018 -0600 PCI: Delay after FLR of Intel DC P3700 NVMe Add a device-specific reset for Intel DC P3700 NVMe device which exhibits a timeout failure in drivers waiting for the ready status to update after NVMe enable if the driver interacts with the device too soon after FLR. As this has been observed in device assignment scenarios, resolve this with a device-specific reset quirk to add an additional, heuristically determined, delay after the FLR completes. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1592654 Signed-off-by: Alex Williamson Signed-off-by: Bjorn Helgaas commit ffb0863426eb91a14101376051cfafa5527e665d Author: Alex Williamson Date: Thu Aug 9 15:18:33 2018 -0500 PCI: Disable Samsung SM961/PM961 NVMe before FLR The Samsung SM961/PM961 (960 EVO) sometimes fails to return from FLR with the PCI config space reading back as -1. A reproducible instance of this behavior is resolved by clearing the enable bit in the NVMe configuration register and waiting for the ready status to clear (disabling the NVMe controller) prior to FLR. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1542494 Signed-off-by: Alex Williamson Signed-off-by: Bjorn Helgaas commit 2d2917f7747805a1f4188672f308d82a8ba01700 Author: Alex Williamson Date: Thu Aug 9 14:04:14 2018 -0600 PCI: Export pcie_has_flr() pcie_flr() suggests pcie_has_flr() to ensure that PCIe FLR support is present prior to calling. pcie_flr() is exported while pcie_has_flr() is not. Resolve this. Signed-off-by: Alex Williamson Signed-off-by: Bjorn Helgaas commit ac5bb5b3b0502b90b489e6b19c46b8c3dbe2e640 Author: zhong jiang Date: Tue Aug 7 07:20:00 2018 -0400 rpc: remove unneeded variable 'ret' in rdma_listen_handler The ret is not modified after initalization, So just remove the variable and return 0. Signed-off-by: zhong jiang Signed-off-by: J. Bruce Fields commit a677a78325b3057ce03b6129f549ece85b0c8dd2 Author: Gustavo A. R. Silva Date: Wed Aug 1 19:44:05 2018 -0500 nfsd: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: J. Bruce Fields commit c2cdc2ab24873289db8588a0a7ccec508d7ad075 Author: Eric Biggers Date: Tue Jul 17 11:01:25 2018 -0700 nfsd: constify write_op[] write_op[] is never modified, so make it 'const'. Signed-off-by: Eric Biggers Signed-off-by: J. Bruce Fields commit 5ed96bc5451bb736a0b7d5d72a0f444316dc6559 Author: nixiaoming Date: Mon Jul 23 09:57:11 2018 +0800 fs/nfsd: Delete invalid assignment statements in nfsd4_decode_exchange_id READ_BUF(8); dummy = be32_to_cpup(p++); dummy = be32_to_cpup(p++); ... READ_BUF(4); dummy = be32_to_cpup(p++); Assigning value to "dummy" here, but that stored value is overwritten before it can be used. At the same time READ_BUF() will re-update the pointer p. delete invalid assignment statements Signed-off-by: nixiaoming Signed-off-by: Chuck Lever Signed-off-by: Trond Myklebust Signed-off-by: J. Bruce Fields commit 11b4d66ea3313d9b03a83b80458ddee64990e3c3 Author: Chuck Lever Date: Fri Jul 27 11:19:10 2018 -0400 NFSD: Handle full-length symlinks I've given up on the idea of zero-copy handling of SYMLINK on the server side. This is because the Linux VFS symlink API requires the symlink pathname to be in a NUL-terminated kmalloc'd buffer. The NUL-termination is going to be problematic (watching out for landing on a page boundary and dealing with a 4096-byte pathname). I don't believe that SYMLINK creation is on a performance path or is requested frequently enough that it will cause noticeable CPU cache pollution due to data copies. There will be two places where a transport callout will be necessary to fill in the rqstp: one will be in the svc_fill_symlink_pathname() helper that is used by NFSv2 and NFSv3, and the other will be in nfsd4_decode_create(). Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit 3fd9557aec919e2db99365ad5a2c00d04ae8893c Author: Chuck Lever Date: Fri Jul 27 11:19:05 2018 -0400 NFSD: Refactor the generic write vector fill helper fill_in_write_vector() is nearly the same logic as svc_fill_write_vector(), but there are a few differences so that the former can handle multiple WRITE payloads in a single COMPOUND. svc_fill_write_vector() can be adjusted so that it can be used in the NFSv4 WRITE code path too. Instead of assuming the pages are coming from rq_args.pages, have the caller pass in the page list. The immediate benefit is a reduction of code duplication. It also prevents the NFSv4 WRITE decoder from passing an empty vector element when the transport has provided the payload in the xdr_buf's page array. Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit 07d0ff3b0cd23a4ba7078fb5cc3aeb25e38b3557 Author: Chuck Lever Date: Fri Jul 27 11:18:59 2018 -0400 svcrdma: Clean up Read chunk path Simplify the error handling at the tail of recv_read_chunk() by re-arranging rq_pages[] housekeeping and documenting it properly. NB: In this path, svc_rdma_recvfrom returns zero. Therefore no subsequent reply processing is done on the svc_rqstp, and thus the rq_respages field does not need to be updated. Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit a53d5cb0646a12586ae45c892c7a411d47ee1a1d Author: Chuck Lever Date: Fri Jul 27 11:18:54 2018 -0400 svcrdma: Avoid releasing a page in svc_xprt_release() svc_xprt_release() invokes svc_free_res_pages(), which releases pages between rq_respages and rq_next_page. Historically, the RPC/RDMA transport has set these two pointers to be different by one, which means: - one page gets released when svc_recv returns 0. This normally happens whenever one or more RDMA Reads need to be dispatched to complete construction of an RPC Call. - one page gets released after every call to svc_send. In both cases, this released page is immediately refilled by svc_alloc_arg. There does not seem to be a reason for releasing this page. To avoid this unnecessary memory allocator traffic, set rq_next_page more carefully. Signed-off-by: Chuck Lever Signed-off-by: J. Bruce Fields commit 7b4d6da4bb6d0ece17ca27f0b4612df87f873d83 Author: Gustavo A. R. Silva Date: Tue Jul 31 21:24:10 2018 -0500 nfsd: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: J. Bruce Fields commit 9cc3b98d1fdb0d279c6ba9264cac1ae2210497d2 Author: YueHaibing Date: Wed Aug 1 14:28:10 2018 +0800 sunrpc: remove redundant variables 'checksumlen','blocksize' and 'data' Variables 'checksumlen','blocksize' and 'data' are being assigned, but are never used, hence they are redundant and can be removed. Fix the following warning: net/sunrpc/auth_gss/gss_krb5_wrap.c:443:7: warning: variable ‘blocksize’ set but not used [-Wunused-but-set-variable] net/sunrpc/auth_gss/gss_krb5_crypto.c:376:15: warning: variable ‘checksumlen’ set but not used [-Wunused-but-set-variable] net/sunrpc/xprtrdma/svc_rdma.c:97:9: warning: variable ‘data’ set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Reviewed-by: Chuck Lever Signed-off-by: J. Bruce Fields commit 64bed6cbe38bc95689fb9399872d9ce250192f90 Author: Amir Goldstein Date: Fri Jul 13 17:22:24 2018 +0300 nfsd: fix leaked file lock with nfs exported overlayfs nfsd and lockd call vfs_lock_file() to lock/unlock the inode returned by locks_inode(file). Many places in nfsd/lockd code use the inode returned by file_inode(file) for lock manipulation. With Overlayfs, file_inode() (the underlying inode) is not the same object as locks_inode() (the overlay inode). This can result in "Leaked POSIX lock" messages and eventually to a kernel crash as reported by Eddie Horng: https://marc.info/?l=linux-unionfs&m=153086643202072&w=2 Fix all the call sites in nfsd/lockd that should use locks_inode(). This is a correctness bug that manifested when overlayfs gained NFS export support in v4.16. Reported-by: Eddie Horng Tested-by: Eddie Horng Cc: Jeff Layton Fixes: 8383f1748829 ("ovl: wire up NFS export operations") Cc: stable@vger.kernel.org Signed-off-by: Amir Goldstein Signed-off-by: J. Bruce Fields commit cd6a2064dbf9e485b80c54687f0ce91cca91a6df Author: Guenter Roeck Date: Thu Aug 9 11:50:46 2018 -0700 hwmon: k10temp: Support Threadripper 2920X, 2970WX; simplify offset table All announced Threadripper 29xx models have a temperature offset of 27 degrees C. Simplify temperature offset table to match all 29xx Threadripper models with a single entry. Also simplify the table to match all 19xx Threadripper models with a single entry. This effectively drops entries for Threadripper 1910/1920/1950 which never saw the light of day. Cc: Michael Larabel Cc: Clemens Ladisch Signed-off-by: Guenter Roeck commit a736e074680745faa5dc6be8dd3c58ad4850aab9 Merge: 192e91d244e3 112cbae26d18 Author: David S. Miller Date: Thu Aug 9 11:52:36 2018 -0700 Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net Overlapping changes in RXRPC, changing to ktime_get_seconds() whilst adding some tracepoints. Signed-off-by: David S. Miller commit 991f61fe7e1db3f74b72a3a5cbe6b012804eb0ee Author: Liu Bo Date: Fri Aug 10 01:47:02 2018 +0800 Blk-throttle: reduce tail io latency when iops limit is enforced When an application's iops has exceeded its cgroup's iops limit, surely it is throttled and kernel will set a timer for dispatching, thus IO latency includes the delay. However, the dispatch delay which is calculated by the limit and the elapsed jiffies is suboptimal. As the dispatch delay is only calculated once the application's iops is (iops limit + 1), it doesn't need to wait any longer than the remaining time of the current slice. The difference can be proved by the following fio job and cgroup iops setting, ----- $ echo 4 > /mnt/config/nullb/disk1/mbps # limit nullb's bandwidth to 4MB/s for testing. $ echo "253:1 riops=100 rbps=max" > /sys/fs/cgroup/unified/cg1/io.max $ cat r2.job [global] name=fio-rand-read filename=/dev/nullb1 rw=randread bs=4k direct=1 numjobs=1 time_based=1 runtime=60 group_reporting=1 [file1] size=4G ioengine=libaio iodepth=1 rate_iops=50000 norandommap=1 thinktime=4ms ----- wo patch: file1: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 fio-3.7-66-gedfc Starting 1 process read: IOPS=99, BW=400KiB/s (410kB/s)(23.4MiB/60001msec) slat (usec): min=10, max=336, avg=27.71, stdev=17.82 clat (usec): min=2, max=28887, avg=5929.81, stdev=7374.29 lat (usec): min=24, max=28901, avg=5958.73, stdev=7366.22 clat percentiles (usec): | 1.00th=[ 4], 5.00th=[ 4], 10.00th=[ 4], 20.00th=[ 4], | 30.00th=[ 4], 40.00th=[ 4], 50.00th=[ 6], 60.00th=[11731], | 70.00th=[11863], 80.00th=[11994], 90.00th=[12911], 95.00th=[22676], | 99.00th=[23725], 99.50th=[23987], 99.90th=[23987], 99.95th=[25035], | 99.99th=[28967] w/ patch: file1: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 fio-3.7-66-gedfc Starting 1 process read: IOPS=100, BW=400KiB/s (410kB/s)(23.4MiB/60005msec) slat (usec): min=10, max=155, avg=23.24, stdev=16.79 clat (usec): min=2, max=12393, avg=5961.58, stdev=5959.25 lat (usec): min=23, max=12412, avg=5985.91, stdev=5951.92 clat percentiles (usec): | 1.00th=[ 3], 5.00th=[ 3], 10.00th=[ 4], 20.00th=[ 4], | 30.00th=[ 4], 40.00th=[ 5], 50.00th=[ 47], 60.00th=[11863], | 70.00th=[11994], 80.00th=[11994], 90.00th=[11994], 95.00th=[11994], | 99.00th=[11994], 99.50th=[11994], 99.90th=[12125], 99.95th=[12125], | 99.99th=[12387] Signed-off-by: Liu Bo Signed-off-by: Jens Axboe commit a29dba161ad1a01bbfbc80aa184b089ddd169a4e Author: Joerg Roedel Date: Thu Aug 9 11:44:49 2018 +0200 x86/relocs: Add __end_rodata_aligned to S_REL This new symbol needs to be in the workaround-list for buggy binutils, otherwise the build with gcc-4.6 fails. Fixes: 39d668e04eda ('x86/mm/pti: Make pti_clone_kernel_text() compile on 32 bit') Reported-by: Stephen Rothwell Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Sedat Dilek Cc: "H. Peter Anvin" Cc: Peter Zijlstra Cc: Linux-Next Mailing List Link: https://lkml.kernel.org/r/20180809094449.ddmnrkz7qkvo3j2x@suse.de commit 192e91d244e376b32d90ffbf78c87a0fb35a4040 Merge: ff50eda44d08 80dfb28641b2 Author: David S. Miller Date: Thu Aug 9 11:16:29 2018 -0700 Merge branch 'Add-support-for-XGMAC2-in-stmmac' Jose Abreu says: ==================== Add support for XGMAC2 in stmmac This series adds support for 10Gigabit IP in stmmac. The IP is called XGMAC2 and has many similarities with GMAC4. Due to this, its relatively easy to incorporate this new IP into stmmac driver by adding a new block and filling the necessary callbacks. The functionality added by this series is still reduced but its only a starting point which will later be expanded. I splitted the patches into funcionality and to ease the review. Only the patch 8/9 really enables the XGMAC2 block by adding a new compatible string. Version 4 addresses review comments of Florian Fainelli and Rob Herring. NOTE: Although the IP supports 10G, for now it was only possible to test it at 1G speed due to 10G PHY HW shipping problems. Here follows iperf3 results at 1G: Connecting to host 192.168.0.10, port 5201 [ 4] local 192.168.0.3 port 39178 connected to 192.168.0.10 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 110 MBytes 920 Mbits/sec 0 482 KBytes [ 4] 1.00-2.00 sec 113 MBytes 946 Mbits/sec 0 482 KBytes [ 4] 2.00-3.00 sec 112 MBytes 937 Mbits/sec 0 482 KBytes [ 4] 3.00-4.00 sec 113 MBytes 946 Mbits/sec 0 482 KBytes [ 4] 4.00-5.00 sec 112 MBytes 935 Mbits/sec 0 482 KBytes [ 4] 5.00-6.00 sec 113 MBytes 946 Mbits/sec 0 482 KBytes [ 4] 6.00-7.00 sec 112 MBytes 937 Mbits/sec 0 482 KBytes [ 4] 7.00-8.00 sec 113 MBytes 946 Mbits/sec 0 482 KBytes [ 4] 8.00-9.00 sec 112 MBytes 937 Mbits/sec 0 482 KBytes [ 4] 9.00-10.00 sec 113 MBytes 946 Mbits/sec 0 482 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 1.09 GBytes 940 Mbits/sec 0 sender [ 4] 0.00-10.00 sec 1.09 GBytes 938 Mbits/sec receiver ==================== Signed-off-by: David S. Miller commit 80dfb28641b2284df846f9005233e542e5c4ec68 Author: Jose Abreu Date: Wed Aug 8 09:04:37 2018 +0100 dt-bindings: net: stmmac: Add the bindings documentation for XGMAC2. Adds the documentation for XGMAC2 DT bindings. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Sergei Shtylyov Cc: devicetree@vger.kernel.org Cc: Rob Herring Signed-off-by: David S. Miller commit a3f142478a5aa155fca461cb764ace6a317a4ff1 Author: Jose Abreu Date: Wed Aug 8 09:04:36 2018 +0100 net: stmmac: Add the bindings parsing for XGMAC2 Add the bindings parsing for XGMAC2 IP block. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller commit 7d9e6c5afab6bfb932acaef93111448bb876911c Author: Jose Abreu Date: Wed Aug 8 09:04:35 2018 +0100 net: stmmac: Integrate XGMAC into main driver flow Now that we have all the XGMAC related callbacks, lets start integrating this IP block into main driver. Also, we corrected the initialization flow to only start DMA after setting descriptors length. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Andrew Lunn Signed-off-by: David S. Miller commit 4bb7aff9e6d0f92483f27ec04683efc2fdd42d25 Author: Jose Abreu Date: Wed Aug 8 09:04:34 2018 +0100 net: stmmac: Add PTP support for XGMAC2 XGMAC2 uses the same engine of timestamping as GMAC4. Let's use the same callbacks. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller commit 6fc21117b791b601362fd2240fab833cbdbfdc15 Author: Jose Abreu Date: Wed Aug 8 09:04:33 2018 +0100 net: stmmac: Add MDIO related functions for XGMAC2 Add the MDIO related funcionalities for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Andrew Lunn Cc: Florian Fainelli Signed-off-by: David S. Miller commit 874dfb65a484cff9b95014ed66c7cc6d2d6c4436 Author: Jose Abreu Date: Wed Aug 8 09:04:32 2018 +0100 net: stmmac: Add descriptor related callbacks for XGMAC2 Add the descriptor related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller commit d6ddfacd95c79d43465d4a85dffb1c9beca343a9 Author: Jose Abreu Date: Wed Aug 8 09:04:31 2018 +0100 net: stmmac: Add DMA related callbacks for XGMAC2 Add the DMA related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Florian Fainelli Signed-off-by: David S. Miller commit 2142754f8b9c619e22e1c9d1973cacc4a214695c Author: Jose Abreu Date: Wed Aug 8 09:04:30 2018 +0100 net: stmmac: Add MAC related callbacks for XGMAC2 Add the MAC related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller commit 48ae5554a076c1bca31448d60263e4038def9f6f Author: Jose Abreu Date: Wed Aug 8 09:04:29 2018 +0100 net: stmmac: Add XGMAC 2.10 HWIF entry Add a new entry to HWIF table for XGMAC 2.10. For now we fill it with empty callbacks which will be added in posterior patches. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller commit ff50eda44d08587322efb73c5489ac3fec271830 Merge: 78b39066c425 734447d4ed7b Author: David S. Miller Date: Thu Aug 9 11:08:21 2018 -0700 Merge branch 'More-complete-PHYLINK-support-for-mv88e6xxx' Andrew Lunn says: ==================== More complete PHYLINK support for mv88e6xxx Previous patches added sufficient PHYLINK support to the mv88e6xxx that it did not break existing use cases, basically fixed-link phys. This patchset builds out the support so that SFP modules, up to 2.5Gbps can be supported, on mv88e6390X, on ports 9 and 10. It also provides a framework which can be extended to support SFPs on ports 2-8 of mv88e6390X, 10Gbps PHYs, and SFP support on the 6352 family. Russell King did much of the initial work, implementing the validate and mac_link_state calls. However, there is an important TODO in the commit message: needs to call phylink_mac_change() when the port link comes up/goes down. The remaining patches implement this, by adding more support for the SERDES interfaces, in particular, interrupt support so we get notified when the SERDES gains/looses sync. This has been tested on the ZII devel C, using a Clearfog as peer device. ==================== Signed-off-by: David S. Miller commit 734447d4ed7b1f31617c28959fd5adfbd9e39d13 Author: Andrew Lunn Date: Thu Aug 9 15:38:49 2018 +0200 net: dsa: mv88e6xxx: Re-setup interrupts on CMODE change. When a port changes CMODE, the SERDES interface being used can change. Disable interrupts for the old SERDES interface, and enable interrupts on the new. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit efd1ba6af93ff63d40f92515a83405133145c028 Author: Andrew Lunn Date: Thu Aug 9 15:38:48 2018 +0200 net: dsa: mv88e6xxx: Add SERDES phydev_mac_change up for 6390 phylink wants to know when the MAC layers notices a change in the link. For the 6390 family, this is a change in the SERDES state. Add interrupt support for the SERDES interface used to implement SGMII/1000Base-X/2500Base-X. This is currently limited to ports 9 and 10. Support for the 10G SERDES and other ports will be added later, building on this basic framework. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 7b898469b91ea08e42dbed52acf8dfcb4f5914d0 Author: Andrew Lunn Date: Thu Aug 9 15:38:47 2018 +0200 net: dsa: mv88e6xxx: link mv88e6xxx_port to mv88e6xxx_chip An up coming change will register interrupts for individual switch ports, using the mv88e6xxx_port as the interrupt context information. Add members to the mv88e6xxx_port structure so we can link it back to the mv88e6xxx_chip member the port belongs to and the port number of the port. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 364e9d7776a389941cea6c40783f90c236b402ce Author: Andrew Lunn Date: Thu Aug 9 15:38:46 2018 +0200 net: dsa: mv88e6xxx: Power on/off SERDES on cmode change The 6390 family has a number of SERDES interfaces per port. When the cmode changes, eg 1000Base-X to XAUI, the SERDES interface in use will also change. Power down the old SERDES interface and power up the new SERDES interface. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 2d2e1dd29962ce0e6bc2c35fe804d919bf3e7f68 Author: Andrew Lunn Date: Thu Aug 9 15:38:45 2018 +0200 net: dsa: mv88e6xxx: Cache the port cmode The ports CMODE indicates the type of link between the MAC and the PHY. It is used often in the SERDES code. Rather than read it each time, cache its value. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit f8236a0835597b166a9f0bab38b9b31bd932ce98 Author: Andrew Lunn Date: Thu Aug 9 15:38:44 2018 +0200 net: dsa: mv88e6xxx: 2500Base-X uses the 1000Base-X SERDES The 6390 has three different SERDES interface types. 2500Base-X is implemented by the SGMII/1000Base-X SERDES. So power on/off the correct SERDES. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit e6891c76dd89418d08efbf72f65c93efc4a94556 Author: Andrew Lunn Date: Thu Aug 9 15:38:43 2018 +0200 net: dsa: mv88e6xxx: Add serdes register read/write helper Add a helper for accessing SERDES registers of the 6390 family. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 23ef57d8230b0f3a92443fc4c88b1ec52994a70a Author: Andrew Lunn Date: Thu Aug 9 15:38:42 2018 +0200 net: dsa: mv88e6xxx: Rename sgmii/10g power functions There is a need to add more functions manipulating the SERDES interfaces. Cleanup the namespace. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 07ffbd74d1786d13a4f3a6bc01400ea59e8b19c0 Author: Andrew Lunn Date: Thu Aug 9 15:38:41 2018 +0200 net: dsa: mv88e6xxx: 6390 vs 6390X SERDES support The 6390 has two SERDES interfaces, used by ports 9 and 10. The 6390X has eight SERDES interfaces. These allow ports 9 and 10 to do 10G. Or if lower speeds are used, some of the SERDES interfaces can be used by ports 2-8 for 1000Base-X. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit a8c01c0d941d2f220a5a31ded77a67d89ddec3b0 Author: Andrew Lunn Date: Thu Aug 9 15:38:40 2018 +0200 net: dsa: mv88e6xxx: Refactor SERDES lane code The 6390 family has 8 SERDES lanes. What ports use these lanes depends on how ports 9 and 10 are configured. If 9 and 10 does not make use of a line, one of the lower ports can use it. Add a function to return the lane a port is using, if any, and simplify the code to power up/down the lane. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 6c422e34b1b6533af5730280835365d4b50786d3 Author: Russell King Date: Thu Aug 9 15:38:39 2018 +0200 net: dsa: mv88e6xxx: add phylink support Add rudimentary phylink support to mv88e6xxx. TODO: - needs to call phylink_mac_change() when the port link comes up/goes down. Signed-off-by: Russell King Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 624c0f0239f04cce78c86afa95eb2841c84fbab1 Author: Russell King Date: Thu Aug 9 15:38:38 2018 +0200 phylink: add helper for configuring 2500BaseX modes Add a helper for MAC drivers to use in their validate callback to deal with 2500BaseX vs 1000BaseX modes, where the hardware supports both but it is not possible to automatically select between them. This helper defaults to 1000BaseX, as that is the 802.3 standard, and will allow users to select 2500BaseX either by forcing the speed if AN is disabled, or by changing the advertising mask if AN is enabled. Disabling AN is not recommended as it is only the speed that we're interested in controlling, not the duplex or pause mode parameters. Signed-off-by: Russell King Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 54186b91bde1711080d0b23ce25f0bee5a058fc9 Author: Andrew Lunn Date: Thu Aug 9 15:38:37 2018 +0200 net: dsa: mv88e6xxx: Add support to enabling pause The 6185 can enable/disable 802.3z pause be setting the MyPause bit in the port status register. Add an op to support this. Signed-off-by: Russell King Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit c3ad2c3b02e953ead2b8d52a0c9e70312930c3d0 Author: Eric W. Biederman Date: Mon Jul 23 15:20:37 2018 -0500 signal: Don't restart fork when signals come in. Wen Yang and majiang report that a periodic signal received during fork can cause fork to continually restart preventing an application from making progress. The code was being overly pessimistic. Fork needs to guarantee that a signal sent to multiple processes is logically delivered before the fork and just to the forking process or logically delivered after the fork to both the forking process and it's newly spawned child. For signals like periodic timers that are always delivered to a single process fork can safely complete and let them appear to logically delivered after the fork(). While examining this issue I also discovered that fork today will miss signals delivered to multiple processes during the fork and handled by another thread. Similarly the current code will also miss blocked signals that are delivered to multiple process, as those signals will not appear pending during fork. Add a list of each thread that is currently forking, and keep on that list a signal set that records all of the signals sent to multiple processes. When fork completes initialize the new processes shared_pending signal set with it. The calculate_sigpending function will see those signals and set TIF_SIGPENDING causing the new task to take the slow path to userspace to handle those signals. Making it appear as if those signals were received immediately after the fork. It is not possible to send real time signals to multiple processes and exceptions don't go to multiple processes, which means that that are no signals sent to multiple processes that require siginfo. This means it is safe to not bother collecting siginfo on signals sent during fork. The sigaction of a child of fork is initially the same as the sigaction of the parent process. So a signal the parent ignores the child will also initially ignore. Therefore it is safe to ignore signals sent to multiple processes and ignored by the forking process. Signals sent to only a single process or only a single thread and delivered during fork are treated as if they are received after the fork, and generally not dealt with. They won't cause any problems. V2: Added removal from the multiprocess list on failure. V3: Use -ERESTARTNOINTR directly V4: - Don't queue both SIGCONT and SIGSTOP - Initialize signal_struct.multiprocess in init_task - Move setting of shared_pending to before the new task is visible to signals. This prevents signals from comming in before shared_pending.signal is set to delayed.signal and being lost. V5: - rework list add and delete to account for idle threads v6: - Use sigdelsetmask when removing stop signals Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200447 Reported-by: Wen Yang and Reported-by: majiang Fixes: 4a2c7a7837da ("[PATCH] make fork() atomic wrt pgrp/session signals") Signed-off-by: "Eric W. Biederman" commit b9763cdfd4a91a34f95ccc5e881ff2aa366197ef Author: Marcel Holtmann Date: Thu Aug 9 10:33:07 2018 +0200 Bluetooth: Introduce BT_HCIUART_RTL configuration option Like all the other UART protocols, introduce a configuration option for Realtek based serial devices. Signed-off-by: Marcel Holtmann Signed-off-by: Hans de Goede Signed-off-by: Johan Hedberg commit 354b064b8ebc1e1ede58550ca9e08bfa81e6af43 Author: Sandipan Das Date: Thu Aug 9 21:49:29 2018 +0530 perf probe powerpc: Fix trace event post-processing In some cases, a symbol may have multiple aliases. Attempting to add an entry probe for such symbols results in a probe being added at an incorrect location while it fails altogether for return probes. This is only applicable for binaries with debug information. During the arch-dependent post-processing, the offset from the start of the symbol at which the probe is to be attached is determined and added to the start address of the symbol to get the probe's location. In case there are multiple aliases, this offset gets added multiple times for each alias of the symbol and we end up with an incorrect probe location. This can be verified on a powerpc64le system as shown below. $ nm /lib/modules/$(uname -r)/build/vmlinux | grep "sys_open$" ... c000000000414290 T __se_sys_open c000000000414290 T sys_open $ objdump -d /lib/modules/$(uname -r)/build/vmlinux | grep -A 10 "<__se_sys_open>:" c000000000414290 <__se_sys_open>: c000000000414290: 19 01 4c 3c addis r2,r12,281 c000000000414294: 70 c4 42 38 addi r2,r2,-15248 c000000000414298: a6 02 08 7c mflr r0 c00000000041429c: e8 ff a1 fb std r29,-24(r1) c0000000004142a0: f0 ff c1 fb std r30,-16(r1) c0000000004142a4: f8 ff e1 fb std r31,-8(r1) c0000000004142a8: 10 00 01 f8 std r0,16(r1) c0000000004142ac: c1 ff 21 f8 stdu r1,-64(r1) c0000000004142b0: 78 23 9f 7c mr r31,r4 c0000000004142b4: 78 1b 7e 7c mr r30,r3 For both the entry probe and the return probe, the probe location should be _text+4276888 (0xc000000000414298). Since another alias exists for 'sys_open', the post-processing code will end up adding the offset (8 for powerpc64le) twice and perf will attempt to add the probe at _text+4276896 (0xc0000000004142a0) instead. Before: # perf probe -v -a sys_open probe-definition(0): sys_open symbol:sys_open file:(null) line:0 offset:0 return:0 lazy:(null) 0 arguments Looking at the vmlinux_path (8 entries long) Using /lib/modules/4.18.0-rc8+/build/vmlinux for symbols Open Debuginfo file: /lib/modules/4.18.0-rc8+/build/vmlinux Try to find probe point from debuginfo. Symbol sys_open address found : c000000000414290 Matched function: __se_sys_open [2ad03a0] Probe point found: __se_sys_open+0 Found 1 probe_trace_events. Opening /sys/kernel/debug/tracing/kprobe_events write=1 Writing event: p:probe/sys_open _text+4276896 Added new event: probe:sys_open (on sys_open) ... # perf probe -v -a sys_open%return $retval probe-definition(0): sys_open%return symbol:sys_open file:(null) line:0 offset:0 return:1 lazy:(null) 0 arguments Looking at the vmlinux_path (8 entries long) Using /lib/modules/4.18.0-rc8+/build/vmlinux for symbols Open Debuginfo file: /lib/modules/4.18.0-rc8+/build/vmlinux Try to find probe point from debuginfo. Symbol sys_open address found : c000000000414290 Matched function: __se_sys_open [2ad03a0] Probe point found: __se_sys_open+0 Found 1 probe_trace_events. Opening /sys/kernel/debug/tracing/README write=0 Opening /sys/kernel/debug/tracing/kprobe_events write=1 Parsing probe_events: p:probe/sys_open _text+4276896 Group:probe Event:sys_open probe:p Writing event: r:probe/sys_open__return _text+4276896 Failed to write event: Invalid argument Error: Failed to add events. Reason: Invalid argument (Code: -22) After: # perf probe -v -a sys_open probe-definition(0): sys_open symbol:sys_open file:(null) line:0 offset:0 return:0 lazy:(null) 0 arguments Looking at the vmlinux_path (8 entries long) Using /lib/modules/4.18.0-rc8+/build/vmlinux for symbols Open Debuginfo file: /lib/modules/4.18.0-rc8+/build/vmlinux Try to find probe point from debuginfo. Symbol sys_open address found : c000000000414290 Matched function: __se_sys_open [2ad03a0] Probe point found: __se_sys_open+0 Found 1 probe_trace_events. Opening /sys/kernel/debug/tracing/kprobe_events write=1 Writing event: p:probe/sys_open _text+4276888 Added new event: probe:sys_open (on sys_open) ... # perf probe -v -a sys_open%return $retval probe-definition(0): sys_open%return symbol:sys_open file:(null) line:0 offset:0 return:1 lazy:(null) 0 arguments Looking at the vmlinux_path (8 entries long) Using /lib/modules/4.18.0-rc8+/build/vmlinux for symbols Open Debuginfo file: /lib/modules/4.18.0-rc8+/build/vmlinux Try to find probe point from debuginfo. Symbol sys_open address found : c000000000414290 Matched function: __se_sys_open [2ad03a0] Probe point found: __se_sys_open+0 Found 1 probe_trace_events. Opening /sys/kernel/debug/tracing/README write=0 Opening /sys/kernel/debug/tracing/kprobe_events write=1 Parsing probe_events: p:probe/sys_open _text+4276888 Group:probe Event:sys_open probe:p Writing event: r:probe/sys_open__return _text+4276888 Added new event: probe:sys_open__return (on sys_open%return) ... Reported-by: Aneesh Kumar Signed-off-by: Sandipan Das Acked-by: Naveen N. Rao Cc: Aneesh Kumar Cc: Jiri Olsa Cc: Ravi Bangoria Fixes: 99e608b5954c ("perf probe ppc64le: Fix probe location when using DWARF") Link: http://lkml.kernel.org/r/20180809161929.35058-1-sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 78b39066c425ce913af1c0353d8fdc5d8c416e32 Merge: 82b94f5d6891 88cc318ebd87 Author: David S. Miller Date: Thu Aug 9 10:36:11 2018 -0700 Merge branch 'mlxsw-Various-updates' Ido Schimmel says: ==================== mlxsw: Various updates Patches 1-3 update the driver to use a new firmware version. Due to a recently discovered issue, the version (and future ones) does not support matching on VLAN ID at egress. This is enforced in the driver and reported back to the user via extack. Patch 4 adds a new selftest for the recently introduced algorithmic TCAM. Patch 5 converts the driver to use SPDX identifiers. Patches 6-7 fix a bug in ethtool stats reporting and expose counters for all 16 TCs, following recent MC-aware changes that utilize TCs 8-15. ==================== Signed-off-by: David S. Miller commit 88cc318ebd8740eae4784566757cbbc760244f5b Author: Petr Machata Date: Thu Aug 9 11:59:13 2018 +0300 mlxsw: spectrum: Expose counter for all 16 TCs Before MC-aware mode was enabled in commit 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports"), only 8 traffic classes were used. Under MC-aware regime, however, besides using TCs 0-7 for UC traffic, it additionally uses TCs 8-15 for BUM traffic. It is therefore desirable to show counters for these TCs as well. Update ethtool stats pool length, mlxsw_sp_port_get_strings() and mlxsw_sp_port_get_stats() to include artifacts for all 16 TCs. For consistency and simplicity, expose tc_no_buffer_discard_uc_tc for BUM TCs as well, even though it ought to stay at 0 all the time. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 9897dce2e39aa2f1fa7260b4a936a34f3fc6e775 Author: Petr Machata Date: Thu Aug 9 11:59:12 2018 +0300 mlxsw: spectrum: Include RFC-2819 counters in stats length The function mlxsw_sp_port_get_sset_count() is supposed to return the total number of ethtool strings that mlxsw supports. Specifically for names of statistic counters (the only string type that mlxsw supports as of now), that number is stored in MLXSW_SP_PORT_ETHTOOL_STATS_LEN. However, when adding RFC-2891 counters, that define wasn't updated to include the new counters. As a result, ethtool snips out the counters towards the end of the list, which contains per-TC counters, and only the first three traffic classes end up being reported. Fix by adding MLXSW_SP_PORT_HW_RFC_2819_STATS_LEN as appropriate. Fixes: 1222d15a01c7 ("mlxsw: spectrum: Expose counters for various packet sizes") Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 9948a0641a17a38935a28d05f6c56d9d1ffabae6 Author: Jiri Pirko Date: Thu Aug 9 11:59:11 2018 +0300 mlxsw: Replace license text with SPDX identifiers and adjust copyrights Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 3dd91570564679e13c4755cc5cdf2a535e3e1e34 Author: Ido Schimmel Date: Thu Aug 9 11:59:10 2018 +0300 selftests: mlxsw: Add TC flower test for Spectrum-2 Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit c86d62cc410cc5ab54c7e53a0c58efd3a025cac3 Author: Jiri Pirko Date: Thu Aug 9 11:59:09 2018 +0300 mlxsw: spectrum: Reset FW after flash Recent FW fixes a bug and allows to load newly flashed FW image after reset. So make sure the reset happens after flash. Indicate the need down to PCI layer by -EAGAIN. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a716d55e4d52af551f250a54eb72882ddbc3fb87 Author: Nir Dotan Date: Thu Aug 9 11:59:08 2018 +0300 mlxsw: spectrum: Update the supported firmware to version 13.1702.6 This new firmware contains: - Support for new types of cables - Support for flashing future firmware without reboot - Support for Router ARP BC and UC traps Signed-off-by: Nir Dotan Acked-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 903fcf734f468afb5a3f153f870f58e4c1d5e525 Author: Nir Dotan Date: Thu Aug 9 11:59:07 2018 +0300 mlxsw: spectrum_flower: Disallow usage of vlan_id key on egress As recent spectrum FW imposes a limitation on using vlan_id key for egress ACL, disallow the usage of that key accordingly and return a proper extack message. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 01675e9503c4e20c5ce9aebdfe6a9cf2ae4991e0 Author: Masami Hiramatsu Date: Sat Jul 28 22:56:24 2018 +0900 selftests/ftrace: Fix kprobe string testcase to not probe notrace function Fix kprobe string argument testcase to not probe notrace function. Instead, it probes tracefs function which must be available with ftrace. Signed-off-by: Masami Hiramatsu Acked-by: Steven Rostedt (VMware) Signed-off-by: Shuah Khan (Samsung OSG) commit 9a29ad52d5c0b4732b0decbddb67c4c3ff4a70ce Author: Anders Roxell Date: Tue Jun 26 17:32:13 2018 +0200 selftests: mount: remove no longer needed config option Since commit eedf265aa003 ("devpts: Make each mount of devpts an independent filesystem.") CONFIG_DEVPTS_MULTIPLE_INSTANCES isn't needed in the defconfig anymore. Signed-off-by: Anders Roxell Signed-off-by: Shuah Khan (Samsung OSG) commit a0dde8be2ab8a92ab512e99bea5343017b639c9e Author: Anders Roxell Date: Thu Jun 21 00:54:12 2018 +0200 selftests: cgroup: add gitignore file Add the executable 'test_memcontrol' to a .gitignore file. Signed-off-by: Anders Roxell Signed-off-by: Shuah Khan (Samsung OSG) commit b045d3af7d1f443dd5209a096568e0ce983127e9 Author: Emily Deng Date: Thu Aug 9 10:03:04 2018 +0800 drm/amdgpu/sriov: give 8s for recover vram under RUNTIME Extend the timeout for recovering vram bos from shadows on sr-iov to cover the worst case scenario for timeslices and VFs Under runtime, the wait fence time could be quite long when other VFs are in exclusive mode. For example, for 4 VF, every VF's exclusive timeout time is set to 3s, then the worst case is 9s. If the VF number is more than 4,then the worst case time will be longer. The 8s is the test data, with setting to 8s, it will pass the TDR test for 1000 times. SWDEV-161490 Signed-off-by: Monk Liu Signed-off-by: Emily Deng Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 275e6fa8ecfd8ec1eb36a865d6dafc64f4bed462 Author: Nayan Deshmukh Date: Thu Aug 9 15:18:12 2018 +0530 drm/scheduler: fix param documentation We no longer have sched parameter so remove its description as well Signed-off-by: Nayan Deshmukh Signed-off-by: Alex Deucher commit 6b8d84e2f1299a5876ed812b137c49686cc85c7c Author: Olga Kornievskaia Date: Mon Jul 9 15:13:36 2018 -0400 NFS add a simple sync nfs4_proc_commit after async COPY A COPY with unstable write data needs a simple sync commit. Filehandle value is gotten as a part of the inner loop so in case of a reboot retry it should get the new value. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 539f57b3e0fdaad20ddb0a45913cefee0c8c29c1 Author: Olga Kornievskaia Date: Mon Jul 9 15:13:35 2018 -0400 NFS handle COPY ERR_OFFLOAD_NO_REQS If client sent async COPY and server replied with ERR_OFFLOAD_NO_REQS, client should retry with a synchronous copy. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit c975c20926575e5968c617ec437647b2f9d87532 Author: Olga Kornievskaia Date: Mon Jul 9 15:13:34 2018 -0400 NFS send OFFLOAD_CANCEL when COPY killed When COPY is killed by the user send OFFLOAD_CANCEL to server processing the copy. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 0f913a57d74ddae9f168c59d4003f3fd3e293669 Author: Olga Kornievskaia Date: Mon Jul 9 15:13:33 2018 -0400 NFS export nfs4_async_handle_error Make this function available to nfs42proc.c Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit bc0c9079b48ddcf1f8a6e1aaa277288b263c78d8 Author: Olga Kornievskaia Date: Mon Jul 9 15:13:32 2018 -0400 NFS handle COPY reply CB_OFFLOAD call race It's possible that server replies back with CB_OFFLOAD call and COPY reply at the same time such that client will process CB_OFFLOAD before reply to COPY. For that keep a list of pending callback stateids received and then before waiting on completion check the pending list. Cleanup any pending copies on the client shutdown. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 62164f317972fcd36590578888f33a1994dda519 Author: Olga Kornievskaia Date: Mon Jul 9 15:13:31 2018 -0400 NFS add support for asynchronous COPY Change xdr to always send COPY asynchronously. Keep the list copies send in a list under a server structure. Once copy is sent, it waits on a completion structure that will be signalled by the callback thread that receives CB_OFFLOAD. If CB_OFFLOAD returned an error and even if it returned partial bytes, ignore them (as we can't commit without a verifier to match) and return an error. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 67aa7444c4beb40aafedd8d2c60bbcc54987adda Author: Olga Kornievskaia Date: Mon Jul 9 15:13:30 2018 -0400 NFS COPY xdr handle async reply If server returns async reply, it must include a callback stateid, wr_callback_id in the write_response4. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit cb95deea0b4aa5c7c7423f4e075a3ddcd59e710b Author: Olga Kornievskaia Date: Mon Jul 9 15:13:29 2018 -0400 NFS OFFLOAD_CANCEL xdr Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 5178a125f6d5fb0720315ea4f7cca642fb936031 Author: Olga Kornievskaia Date: Mon Jul 9 15:13:28 2018 -0400 NFS CB_OFFLOAD xdr Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 0a1c749dee4c52465d5580d77e0f8aaa9215c357 Author: Gustavo A. R. Silva Date: Thu Aug 9 10:54:46 2018 -0500 block: paride: pd: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1056543 ("Missing break in switch") Addresses-Coverity-ID: 1056544 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jens Axboe commit 5b1fe7bec8a8d0cc547a22e7ddc2bd59acd67de4 Author: Ilya Dryomov Date: Thu Aug 9 12:38:28 2018 +0200 dm cache metadata: set dirty on all cache blocks after a crash Quoting Documentation/device-mapper/cache.txt: The 'dirty' state for a cache block changes far too frequently for us to keep updating it on the fly. So we treat it as a hint. In normal operation it will be written when the dm device is suspended. If the system crashes all cache blocks will be assumed dirty when restarted. This got broken in commit f177940a8091 ("dm cache metadata: switch to using the new cursor api for loading metadata") in 4.9, which removed the code that consulted cmd->clean_when_opened (CLEAN_SHUTDOWN on-disk flag) when loading cache blocks. This results in data corruption on an unclean shutdown with dirty cache blocks on the fast device. After the crash those blocks are considered clean and may get evicted from the cache at any time. This can be demonstrated by doing a lot of reads to trigger individual evictions, but uncache is more predictable: ### Disable auto-activation in lvm.conf to be able to do uncache in ### time (i.e. see uncache doing flushing) when the fix is applied. # xfs_io -d -c 'pwrite -b 4M -S 0xaa 0 1G' /dev/vdb # vgcreate vg_cache /dev/vdb /dev/vdc # lvcreate -L 1G -n lv_slowdev vg_cache /dev/vdb # lvcreate -L 512M -n lv_cachedev vg_cache /dev/vdc # lvcreate -L 256M -n lv_metadev vg_cache /dev/vdc # lvconvert --type cache-pool --cachemode writeback vg_cache/lv_cachedev --poolmetadata vg_cache/lv_metadev # lvconvert --type cache vg_cache/lv_slowdev --cachepool vg_cache/lv_cachedev # xfs_io -d -c 'pwrite -b 4M -S 0xbb 0 512M' /dev/mapper/vg_cache-lv_slowdev # xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2 0fe00000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ 0fe00010: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ # dmsetup status vg_cache-lv_slowdev 0 2097152 cache 8 27/65536 128 8192/8192 1 100 0 0 0 8192 7065 2 metadata2 writeback 2 migration_threshold 2048 smq 0 rw - ^^^^ 7065 * 64k = 441M yet to be written to the slow device # echo b >/proc/sysrq-trigger # vgchange -ay vg_cache # xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2 0fe00000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ 0fe00010: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ # lvconvert --uncache vg_cache/lv_slowdev Flushing 0 blocks for cache vg_cache/lv_slowdev. Logical volume "lv_cachedev" successfully removed Logical volume vg_cache/lv_slowdev is not cached. # xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2 0fe00000: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ 0fe00010: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ This is the case with both v1 and v2 cache pool metatata formats. After applying this patch: # vgchange -ay vg_cache # xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2 0fe00000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ 0fe00010: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ # lvconvert --uncache vg_cache/lv_slowdev Flushing 3724 blocks for cache vg_cache/lv_slowdev. ... Flushing 71 blocks for cache vg_cache/lv_slowdev. Logical volume "lv_cachedev" successfully removed Logical volume vg_cache/lv_slowdev is not cached. # xfs_io -d -c 'pread -v 254M 512' /dev/mapper/vg_cache-lv_slowdev | head -n 2 0fe00000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ 0fe00010: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ Cc: stable@vger.kernel.org Fixes: f177940a8091 ("dm cache metadata: switch to using the new cursor api for loading metadata") Signed-off-by: Ilya Dryomov Signed-off-by: Mike Snitzer commit 209b43759d65b2cc99ce7757249aacc82b03c4e2 Author: Michael Büsch Date: Tue Jul 31 22:15:09 2018 +0200 ssb: Remove SSB_WARN_ON, SSB_BUG_ON and SSB_DEBUG Use the standard WARN_ON instead. If a small kernel is desired, WARN_ON can be disabled globally. Also remove SSB_DEBUG. Besides WARN_ON it only adds a tiny debug check. Include this check unconditionally. Signed-off-by: Michael Buesch Signed-off-by: Kalle Valo commit b8b6069cf2087545fe53ec920e8353133e9a70bf Author: Michael Büsch Date: Tue Jul 31 21:56:38 2018 +0200 ssb: Remove home-grown printk wrappers Replace the ssb printk wrappers by standard print helpers. Also remove SSB_SILENT. Nobody should use it anyway. Originally submitted by Joe Perches . Modified to add dev_... based printks. Signed-off-by: Michael Buesch Tested-by: Michael Buesch Cc: Joe Perches Signed-off-by: Kalle Valo commit 4d77a89e3924b12f4a5628b21237e57ab4703866 Author: Michael Büsch Date: Tue Jul 31 21:14:16 2018 +0200 b43legacy/leds: Ensure NUL-termination of LED name string strncpy might not NUL-terminate the string, if the name equals the buffer size. Use strlcpy instead. Signed-off-by: Michael Buesch Cc: stable@vger.kernel.org Signed-off-by: Kalle Valo commit 2aa650d1950fce94f696ebd7db30b8830c2c946f Author: Michael Büsch Date: Tue Jul 31 21:14:04 2018 +0200 b43/leds: Ensure NUL-termination of LED name string strncpy might not NUL-terminate the string, if the name equals the buffer size. Use strlcpy instead. Signed-off-by: Michael Buesch Cc: stable@vger.kernel.org Signed-off-by: Kalle Valo commit c7743c428111912fffceb38b860024f7e33b3e3c Author: Gustavo A. R. Silva Date: Sat Aug 4 19:04:53 2018 -0500 ssb: driver_gige: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Michael Buesch Signed-off-by: Kalle Valo commit ad2e6d23bdadd7db7086c578f3c77f244d405b3b Author: YueHaibing Date: Mon Aug 6 12:54:40 2018 +0800 rtlwifi: btcoex: Fix if == else warnings in halbtc8723b2ant.c Fix following coccinelle warning: ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:2952:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:2961:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3011:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3020:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3439:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3448:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3339:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3348:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3074:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3083:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3192:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3201:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3267:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3276:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3124:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:3133:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:2821:2-4: WARNING: possible condition with no effect (if == else) ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c:2830:2-4: WARNING: possible condition with no effect (if == else) Signed-off-by: YueHaibing Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo commit 26b701adc37855a51af3e998241791fae94f99ab Author: Colin Ian King Date: Fri Aug 3 14:42:24 2018 +0100 iwlegacy: fix spelling mistake "acumulative" -> "accumulative" fix spelling mistake in rx stats text Signed-off-by: Colin Ian King Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 35204d0aa83ff4f8bdab7b0eab927dcaa7c4b7f6 Author: Colin Ian King Date: Fri Aug 3 08:46:36 2018 +0100 rsi: remove redundant variables bss, wh and temp_flash_content Variables bss, wh and temp_flash_content are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'bss' set but not used [-Wunused-but-set-variable] warning: variable 'wh' set but not used [-Wunused-but-set-variable] warning: variable 'temp_flash_content' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit 24ecc3585348b616993a3c4d6dc2c6b8007e358c Author: Bart Van Assche Date: Thu Aug 9 07:53:38 2018 -0700 block: Ensure that a request queue is dissociated from the cgroup controller Several block drivers call alloc_disk() followed by put_disk() if something fails before device_add_disk() is called without calling blk_cleanup_queue(). Make sure that also for this scenario a request queue is dissociated from the cgroup controller. This patch avoids that loading the parport_pc, paride and pf drivers triggers the following kernel crash: BUG: KASAN: null-ptr-deref in pi_init+0x42e/0x580 [paride] Read of size 4 at addr 0000000000000008 by task modprobe/744 Call Trace: dump_stack+0x9a/0xeb kasan_report+0x139/0x350 pi_init+0x42e/0x580 [paride] pf_init+0x2bb/0x1000 [pf] do_one_initcall+0x8e/0x405 do_init_module+0xd9/0x2f2 load_module+0x3ab4/0x4700 SYSC_finit_module+0x176/0x1a0 do_syscall_64+0xee/0x2b0 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Reported-by: Alexandru Moise <00moses.alexander00@gmail.com> Fixes: a063057d7c73 ("block: Fix a race between request queue removal and the block cgroup controller") # v4.17 Signed-off-by: Bart Van Assche Tested-by: Alexandru Moise <00moses.alexander00@gmail.com> Reviewed-by: Johannes Thumshirn Cc: Tejun Heo Cc: Christoph Hellwig Cc: Ming Lei Cc: Alexandru Moise <00moses.alexander00@gmail.com> Cc: Joseph Qi Cc: Signed-off-by: Jens Axboe commit 4cf6324b17e96b7b7ab4021c6929500934d46750 Author: Bart Van Assche Date: Thu Aug 9 07:53:37 2018 -0700 block: Introduce blk_exit_queue() This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: Christoph Hellwig Cc: Ming Lei Cc: Omar Sandoval Cc: Alexandru Moise <00moses.alexander00@gmail.com> Cc: Joseph Qi Cc: Signed-off-by: Jens Axboe commit 6bad9b210a228d2fe0e0efe26d9b115348529cee Author: Bart Van Assche Date: Thu Aug 9 07:53:36 2018 -0700 blkcg: Introduce blkg_root_lookup() This new function will be used in a later patch to verify whether a queue has been dissociated from the cgroup controller before being released. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig Cc: Ming Lei Cc: Omar Sandoval Cc: Johannes Thumshirn Cc: Alexandru Moise <00moses.alexander00@gmail.com> Cc: Joseph Qi Cc: Signed-off-by: Jens Axboe commit d863cb03fc5f913c98a9c5d7ecb66fb4a3b29bae Author: Claudio Date: Wed Jul 18 19:33:58 2018 +0200 Add cgroup core selftests This commit adds tests for some of the core functionalities of cgroups v2. The commit adds tests for some core principles of croup V2 API: - test_cgcore_internal_process_constraint Tests internal process constraint. You can't add a pid to a domain parent if a controller is enabled. - test_cgcore_top_down_constraint_enable Tests that you can't enable a controller on a child if it's not enabled on the parent. - test_cgcore_top_down_constraint_disable Tests that you can't disable a controller on a parent if it's enabled in a child. - test_cgcore_no_internal_process_constraint_on_threads Tests that there's no internal process constrain on threaded cgroups. You can add threads/processes on a parent with a controller enabled. - test_cgcore_parent_becomes_threaded Tests that when a child becomes threaded the parent type becomes domain threaded. - test_cgcore_invalid_domain In a situation like: A (domain threaded) - B (threaded) - C (domain) it tests that C can't be used until it is turned into a threaded cgroup. The "cgroup.type" file will report "domain (invalid)" in these cases. Operations which fail due to invalid topology use EOPNOTSUPP as the errno. - test_cgcore_populated In a situation like: A(0) - B(0) - C(1) \ D(0) It tests that A, B and C's "populated" fields would be 1 while D's 0. It tests that after the one process in C is moved to root, A,B and C's "populated" fields would flip to "0" and file modified events will be generated on the "cgroup.events" files of both cgroups. Signed-off-by: Claudio Zumbo Cc: Shuah Khan Cc: Roman Gushchin Cc: Tejun Heo Cc: kernel-team@fb.com Acked-by: Tejun Heo Reviewed-by: Roman Gushchin Signed-off-by: Shuah Khan (Samsung OSG) commit 1ec49a236565060566be547b6e050bb414d0da96 Author: Valdis Kletnieks Date: Wed Aug 8 16:16:54 2018 -0400 mt76: fix build for MediaTek MT7610U USB wireless dongle The mt76x0 driver requires the mt76 core driver to actually function. So add a 'select' to avoid embarrassing 'symbol unknown' errors when attempting to modprobe it in a module tree that doesn't include mt76.ko Signed-off-by: Valdis Kletnieks Signed-off-by: Kalle Valo commit b1f4267cc5448d20ae0c515a74141e74365e78a3 Author: Bart Van Assche Date: Thu Aug 9 07:47:28 2018 -0700 block: Remove two superfluous #include directives Commit 12f5b9314545 ("blk-mq: Remove generation seqeunce") removed the only seqcount_t and u64_stats_sync instances from but did not remove the corresponding #include directives. Since these include directives are no longer needed, remove them. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Keith Busch Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke , Cc: Johannes Thumshirn Signed-off-by: Jens Axboe commit 17ad18fd12a35bf84109741415594e21f2577e5e Author: Kees Cook Date: Tue Aug 7 15:50:40 2018 -0700 mt76x0: Remove VLA usage Even with "const" variables, the compiler will generate warnings about VLA usage. In the quest to remove all VLAs from the kernel[1], this uses a #define instead of a const to do the array sizing. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Fixes: e87b5039511a ("mt76x0: eeprom files") Signed-off-by: Kees Cook Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 1b622bd59e9fc4375febf8697684746211eaeb4a Author: Stanislaw Gruszka Date: Tue Aug 7 10:43:37 2018 +0200 mt76x0: perform mt76x0_mac_set_ampdu_factor Remove return added accidentally in mt76x0_mac_set_ampdu_factor. Reported-by: Dan Carpenter Fixes: a77443498137 ("mt76x0: mac files") Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 5dc5bf2899a505085492b1273d34d4a51c41e093 Author: Stanislaw Gruszka Date: Tue Aug 7 10:43:09 2018 +0200 mt76x0: correct type for eeprom gain value Change type to u8 to allow sanity check agaist 0xff; Reported-by: Dan Carpenter Fixes: e87b5039511a ("mt76x0: eeprom files") Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 27a8aea13053700ad2a08189024df7e341d1ee51 Author: Winnie Chang Date: Tue Aug 7 21:19:41 2018 -0500 brcmfmac: fix brcmf_wiphy_wowl_params() NULL pointer dereference The kernel BUG happens when wowl is enabled from firmware. In brcmf_wiphy_wowl_params(), cfg is a NULL pointer because it is drvr->config returned from wiphy_to_cfg(), and drvr->config is not set yet. To fix it, set drvr->config before brcmf_setup_wiphy() which calls brcmf_wiphy_wowl_params(). Fixes: 856d5a011c86 ("brcmfmac: allocate struct brcmf_pub instance using wiphy_new()") Signed-off-by: Winnie Chang Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo commit d263ed9926823c462f99a7679e18f0c9e5b8550d Author: Jianchao Wang Date: Thu Aug 9 08:34:17 2018 -0600 blk-mq: count the hctx as active before allocating tag Currently, we count the hctx as active after allocate driver tag successfully. If a previously inactive hctx try to get tag first time, it may fails and need to wait. However, due to the stale tag ->active_queues, the other shared-tags users are still able to occupy all driver tags while there is someone waiting for tag. Consequently, even if the previously inactive hctx is waked up, it still may not be able to get a tag and could be starved. To fix it, we count the hctx as active before try to allocate driver tag, then when it is waiting the tag, the other shared-tag users will reserve budget for it. Reviewed-by: Ming Lei Signed-off-by: Jianchao Wang Signed-off-by: Jens Axboe commit d6c02a9beb67f13d5f14f23e72fa9981e8b84477 Author: Greg Edwards Date: Wed Aug 8 13:27:53 2018 -0600 block: bvec_nr_vecs() returns value for wrong slab In commit ed996a52c868 ("block: simplify and cleanup bvec pool handling"), the value of the slab index is incremented by one in bvec_alloc() after the allocation is done to indicate an index value of 0 does not need to be later freed. bvec_nr_vecs() was not updated accordingly, and thus returns the wrong value. Decrement idx before performing the lookup. Fixes: ed996a52c868 ("block: simplify and cleanup bvec pool handling") Signed-off-by: Greg Edwards Signed-off-by: Jens Axboe commit 4884f8bf87f6af065b8268b3baf0d16aff95de4a Merge: cbb751c060fe 66414e80245e Author: Jens Axboe Date: Thu Aug 9 08:22:21 2018 -0600 Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-4.19/block Pull NVMe updates from Christoph: "This should be the last round of NVMe updates before the 4.19 merge window opens. It conatins support for write protected (aka read-only) namespaces from Chaitanya, two ANA fixes from Hannes and a fabrics fix from Tal Shorer." * 'nvme-4.19' of git://git.infradead.org/nvme: nvme-fabrics: fix ctrl_loss_tmo < 0 to reconnect forever nvmet: add ns write protect support nvme: set gendisk read only based on nsattr nvme.h: add support for ns write protect definitions nvme.h: fixup ANA group descriptor format nvme: fixup crash on failed discovery commit cbb751c060fe61140e3f23dc7cd95190bba4c89e Author: Shenghui Wang Date: Thu Aug 9 15:48:51 2018 +0800 bcache: trivial - remove tailing backslash in macro BTREE_FLAG Remove the tailing backslash in macro BTREE_FLAG in btree.h Signed-off-by: Shenghui Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit e921efeb07048a6f5daa540e5f04f19ec9360da2 Author: Shenghui Wang Date: Thu Aug 9 15:48:50 2018 +0800 bcache: make the pr_err statement used for ENOENT only in sysfs_attatch section The pr_err statement in the code for sysfs_attatch section would run for various error codes, which maybe confusing. E.g, Run the command twice: echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be891 > \ /sys/block/bcache0/bcache/attach [the backing dev got attached on the first run] echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be891 > \ /sys/block/bcache0/bcache/attach In dmesg, after the command run twice, we can get: bcache: bch_cached_dev_attach() Can't attach sda6: already attached bcache: __cached_dev_store() Can't attach 796b5c05-b03c-4bc7-9cbd-\ a8df5e8be891 : cache set not found The first statement in the message was right, but the second was confusing. bch_cached_dev_attach has various pr_ statements for various error codes, except ENOENT. After the change, rerun above command twice: echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be891 > \ /sys/block/bcache0/bcache/attach echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be891 > \ /sys/block/bcache0/bcache/attach In dmesg we only got: bcache: bch_cached_dev_attach() Can't attach sda6: already attached No confusing "cache set not found" message anymore. And for some not exist SET-UUID: echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be898 > \ /sys/block/bcache0/bcache/attach In dmesg we can get: bcache: __cached_dev_store() Can't attach 796b5c05-b03c-4bc7-9cbd-\ a8df5e8be898 : cache set not found Signed-off-by: Shenghui Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit ea8c5356d39048bc94bae068228f51ddbecc6b89 Author: Coly Li Date: Thu Aug 9 15:48:49 2018 +0800 bcache: set max writeback rate when I/O request is idle Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle") allows the writeback rate to be faster if there is no I/O request on a bcache device. It works well if there is only one bcache device attached to the cache set. If there are many bcache devices attached to a cache set, it may introduce performance regression because multiple faster writeback threads of the idle bcache devices will compete the btree level locks with the bcache device who have I/O requests coming. This patch fixes the above issue by only permitting fast writebac when all bcache devices attached on the cache set are idle. And if one of the bcache devices has new I/O request coming, minimized all writeback throughput immediately and let PI controller __update_writeback_rate() to decide the upcoming writeback rate for each bcache device. Also when all bcache devices are idle, limited wrieback rate to a small number is wast of thoughput, especially when backing devices are slower non-rotation devices (e.g. SATA SSD). This patch sets a max writeback rate for each backing device if the whole cache set is idle. A faster writeback rate in idle time means new I/Os may have more available space for dirty data, and people may observe a better write performance then. Please note bcache may change its cache mode in run time, and this patch still works if the cache mode is switched from writeback mode and there is still dirty data on cache. Fixes: Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle") Cc: stable@vger.kernel.org #4.16+ Signed-off-by: Coly Li Tested-by: Kai Krakow Tested-by: Stefan Priebe Cc: Michael Lyle Signed-off-by: Jens Axboe commit b467a6ac0b4bf57ec8c2329212e8a8a0231a2ef2 Author: Coly Li Date: Thu Aug 9 15:48:48 2018 +0800 bcache: add code comments for bset.c This patch tries to add code comments in bset.c, to make some tricky code and designment to be more comprehensible. Most information of this patch comes from the discussion between Kent and I, he offers very informative details. If there is any mistake of the idea behind the code, no doubt that's from me misrepresentation. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 0cba2e71111e4bd156e67086de3484c7b907a4fc Author: Coly Li Date: Thu Aug 9 15:48:47 2018 +0800 bcache: fix mistaken comments in request.c This patch updates code comment in bch_keylist_realloc() by fixing incorrected function names, to make the code to be more comprehennsible. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit cb329dec11822f84f9d7309766a1f3a35d3d182a Author: Coly Li Date: Thu Aug 9 15:48:46 2018 +0800 bcache: fix mistaken code comments in bcache.h This patch updates the code comment in struct cache with correct array names, to make the code to be more comprehensible. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit e57fd746848597e9c701751e26416d4b2e3b27ea Author: Coly Li Date: Thu Aug 9 15:48:45 2018 +0800 bcache: add a comment in super.c This patch adds a line of code comment in super.c:register_bdev(), to make code to be more comprehensible. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit c2e8dcf7fa43ed236cb341c33aa3a75687557c43 Author: Coly Li Date: Thu Aug 9 15:48:44 2018 +0800 bcache: avoid unncessary cache prefetch bch_btree_node_get() In bch_btree_node_get() the read-in btree node will be partially prefetched into L1 cache for following bset iteration (if there is). But if the btree node read is failed, the perfetch operations will waste L1 cache space. This patch checkes whether read operation and only does cache prefetch when read I/O succeeded. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit b4cb6efc1af7da2fa1e9ff0eaf90e2be02cfdf5f Author: Coly Li Date: Thu Aug 9 15:48:43 2018 +0800 bcache: display rate debug parameters to 0 when writeback is not running When writeback is not running, writeback rate should be 0, other value is misleading. And the following dyanmic writeback rate debug parameters should be 0 too, rate, proportional, integral, change otherwise they are misleading when writeback is not running. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 78ac2107176baa0daf65b0fb8e561d2ed14c83ca Author: Coly Li Date: Thu Aug 9 15:48:42 2018 +0800 bcache: do not check return value of debugfs_create_dir() Greg KH suggests that normal code should not care about debugfs. Therefore no matter successful or failed of debugfs_create_dir() execution, it is unncessary to check its return value. There are two functions called debugfs_create_dir() and check the return value, which are bch_debug_init() and closure_debug_init(). This patch changes these two functions from int to void type, and ignore return values of debugfs_create_dir(). This patch does not fix exact bug, just makes things work as they should. Signed-off-by: Coly Li Suggested-by: Greg Kroah-Hartman Cc: stable@vger.kernel.org Cc: Kai Krakow Cc: Kent Overstreet Signed-off-by: Jens Axboe commit 4aa5db22d35588e1a5d2ee88472348ea73d9fb23 Merge: 6c0848398776 f2cf0ef7c0ce Author: Mark Brown Date: Thu Aug 9 14:47:05 2018 +0100 Merge branch 'asoc-4.19' into asoc-next commit 6c084839877666d987ff8bc4e0facd3c02d99d61 Merge: 1ffaddd029c8 0717edbdfed6 Author: Mark Brown Date: Thu Aug 9 14:46:56 2018 +0100 Merge branch 'asoc-4.18' into asoc-linus commit f2cf0ef7c0ce141bb38f315c34c56e6ef5667a27 Author: Gustavo A. R. Silva Date: Wed Aug 8 14:19:33 2018 -0500 ASoC: adav80x: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1056531 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Acked-by: Lars-Peter Clausen Signed-off-by: Mark Brown commit d6c6ab93e17f139c9b7f9b077307ebddc05a7990 Author: Masahiro Yamada Date: Thu Aug 9 14:19:31 2018 +0900 kbuild: remove deprecated host-progs variable The host-progs has been kept as an alias of hostprogs-y for a long time (at least since the beginning of Git era), with the clear prompt: Usage of host-progs is deprecated. Please replace with hostprogs-y! Enough time for the migration has passed. Signed-off-by: Masahiro Yamada Acked-by: Max Filippov commit 47f38ae08df0aebb0e43fca50bf380aefea1f4d1 Author: Rob Landley Date: Wed Aug 8 13:06:43 2018 +0900 init/Kconfig: Use short unix-style option instead of --longname Avoids warning messages with the latest release of toybox, which never bothered to implement the --longopts nothing was using. Signed-off-by: Rob Landley Signed-off-by: Masahiro Yamada commit 3fca1700c4c38aaec1cea0c143b0ff8da029fd9c Author: Masahiro Yamada Date: Wed Aug 8 11:14:14 2018 +0900 kbuild: make samples really depend on headers_install Kernel headers must be installed into $(objtree)/usr/include to avoid the build failure of samples. Commit ddea05fa148b ("kbuild: make samples depend on headers_install") addressed this, but "samples/" is only used for the single target build. "make samples/" properly installs kernel headers, but it does not work for general building because a phony target "sample" (no trailing slash) is used. Reported-by: David Howells Signed-off-by: Masahiro Yamada Tested-by: David Howells commit e64e84987de5486839afaccd191df71012ac1800 Author: Hans de Goede Date: Thu Aug 9 13:40:46 2018 +0200 platform/x86: Add ACPI i2c-multi-instantiate pseudo driver On systems with ACPI instantiated i2c-clients, normally there is 1 fw_node per i2c-device and that fw-node contains 1 I2cSerialBus resource for that 1 i2c-device. But in some rare cases the manufacturer has decided to describe multiple i2c-devices in a single ACPI fwnode with multiple I2cSerialBus resources. An earlier attempt to fix this in the i2c-core resulted in a lot of extra code to support this corner-case. This commit introduces a new i2c-multi-instantiate driver which fixes this in a different way. This new driver can be built as a module which will only loaded on affected systems. This driver will instantiate a new i2c-client per I2cSerialBus resource, using the driver_data from the acpi_device_id it is binding to to tell it which chip-type (and optional irq-resource) to use when instantiating. Note this driver depends on a platform device being instantiated for the ACPI fwnode, see the i2c_multi_instantiate_ids list of ACPI device-ids in drivers/acpi/scan.c: acpi_device_enumeration_by_parent(). Acked-by: Andy Shevchenko Acked-by: Wolfram Sang Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 669f3765b755fd8739ab46ce3a9c6292ce8b3d2a Author: Stefan Haberland Date: Wed Jul 25 14:00:47 2018 +0200 s390/dasd: fix hanging offline processing due to canceled worker During offline processing two worker threads are canceled without freeing the device reference which leads to a hanging offline process. Reviewed-by: Jan Hoeppner Signed-off-by: Stefan Haberland Signed-off-by: Martin Schwidefsky commit 7c6553d4db03350dad0110c3224194c19df76a8f Author: Stefan Haberland Date: Wed Jul 25 13:27:10 2018 +0200 s390/dasd: fix panic for failed online processing Fix a panic that occurs for a device that got an error in dasd_eckd_check_characteristics() during online processing. For example the read configuration data command may have failed. If this error occurs the device is not being set online and the earlier invoked steps during online processing are rolled back. Therefore dasd_eckd_uncheck_device() is called which needs a valid private structure. But this pointer is not valid if dasd_eckd_check_characteristics() has failed. Check for a valid device->private pointer to prevent a panic. Reviewed-by: Jan Hoeppner Signed-off-by: Stefan Haberland Signed-off-by: Martin Schwidefsky commit 1dce5d849f94b90e2ed52056e7eefab3c17277b8 Merge: 1ffaddd029c8 1cbddedbed79 Author: Mark Brown Date: Thu Aug 9 11:17:30 2018 +0100 Merge branch 'regmap-4.19' into regmap-next commit 1cbddedbed799be9906ab3f2e5f58e618e6eb475 Merge: 75eb3a67a29e 74fe7b551f33 Author: Mark Brown Date: Thu Aug 9 11:15:06 2018 +0100 Merge tag 'regmap-noinc-read' into regmap-4.19 regmap: Support non-incrementing registers Some devices have individual registers that don't autoincrement the register address during bulk reads but instead repeatedly read the same value, for example for monitoring GPIOs or ADCs. Add support for these. commit 21ba074cb47171a34f60e250e8f7ef3dc1529e43 Author: Hans de Goede Date: Thu Aug 9 11:15:57 2018 +0200 ACPI / x86: utils: Remove status workaround from acpi_device_always_present() Now that we init the status field to ACPI_STA_DEFAULT rather then to 0, the workaround for acpi_match_device_ids() always returning -ENOENT when status is 0 is no longer needed. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit d0ed4c60abfb9a4ab6cd416d1dea9df6266f8fc7 Merge: 72a361a5b91c aba941392aee Author: Rafael J. Wysocki Date: Thu Aug 9 12:12:52 2018 +0200 Merge branch 'acpi-scan' to satisfy dependencies. commit aba941392aeef2d1bc064a1e4b09293473ef7b9b Author: Hans de Goede Date: Thu Aug 9 11:15:56 2018 +0200 ACPI / scan: Create platform device for fwnodes with multiple i2c devices Some devices have multiple I2cSerialBus resources and for things to work an i2c-client must be instantiated for each, each with its own i2c_device_id. Normally we only instantiate an i2c-client for the first resource, using the ACPI HID as id. This commit adds a list of HIDs of devices, which need multiple i2c-clients instantiated from a single fwnode, to acpi_device_enumeration_by_parent and makes acpi_device_enumeration_by_parent return false for these devices so that a platform device will be instantiated. This allows the drivers/platform/x86/i2c-multi-instantiate.c driver, which knows which i2c_device_id to use for each resource, to bind to the fwnode and initiate an i2c-client for each resource. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 74fe7b551f3385fa585d92616c85b3a575b2b2cb Author: Crestez Dan Leonard Date: Tue Aug 7 17:52:17 2018 +0300 regmap: Add regmap_noinc_read API The regmap API usually assumes that bulk read operations will read a range of registers but some I2C/SPI devices have certain registers for which a such a read operation will return data from an internal FIFO instead. Add an explicit API to support bulk read without range semantics. Some linux drivers use regmap_bulk_read or regmap_raw_read for such registers, for example mpu6050 or bmi150 from IIO. This only happens to work because when caching is disabled a single regmap read op will map to a single bus read op (as desired). This breaks if caching is enabled and reg+1 happens to be a cacheable register. Without regmap support refactoring a driver to enable regmap caching requires separate I2C and SPI paths. This is exactly what regmap is supposed to help avoid. Suggested-by: Jonathan Cameron Signed-off-by: Crestez Dan Leonard Signed-off-by: Stefan Popa Signed-off-by: Mark Brown commit 17c81d2f5a59929c73a2a19fd49fe0b068fda76f Author: Adam Thomson Date: Thu Aug 9 10:48:50 2018 +0100 ASoC: da7219: Add delays to capture path to remove DC offset noise On some platforms it has been noted that a pop noise can be witnessed when capturing audio, mainly for first time after a headset jack has been inserted. This is due to a DC offset in the Mic PGA and so to avoid this delays are required when powering up the capture path. This commit rectifies the problem by adding delays post Mic PGA and post Mixin PGA. The post Mic PGA delay is determined based on Mic Bias voltage, and is only applied the first time after a headset jack is inserted. Signed-off-by: Adam Thomson Signed-off-by: Mark Brown commit 5971b0c1594d6c34e257101ed5fdffec65205c50 Author: Hans de Goede Date: Wed Aug 8 10:30:03 2018 +0200 ACPI / scan: Initialize status to ACPI_STA_DEFAULT Since commit 63347db0affa "ACPI / scan: Use acpi_bus_get_status() to initialize ACPI_TYPE_DEVICE devs" the status field of normal acpi_devices gets set to 0 by acpi_bus_type_and_status() and filled with its actual value later when acpi_add_single_object() calls acpi_bus_get_status(). This means that any acpi_match_device_ids() calls in between will always fail with -ENOENT. We already have a workaround for this, which temporary forces status to ACPI_STA_DEFAULT in drivers/acpi/x86/utils.c: acpi_device_always_present() and the next commit in this series adds another acpi_match_device_ids() call between status being initialized as 0 and the acpi_bus_get_status() call. Rather then adding another workaround, this commit makes acpi_bus_type_and_status() initialize status to ACPI_STA_DEFAULT, this is safe to do as the only code looking at status between the initialization and the acpi_bus_get_status() call is those acpi_match_device_ids() calls. Note this does mean that we need to (re)set status to 0 in case the acpi_bus_get_status() call fails. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 4c3be61e41b4206878cd021afbdb85f5b76f2099 Author: Mika Westerberg Date: Wed Aug 8 12:50:37 2018 +0300 ACPI / EC: Add another entry for Thinkpad X1 Carbon 6th Commit 2c4d6baf1bc4 (ACPI / EC: Use ec_no_wakeup on more Thinkpad X1 Carbon 6th systems) changed the DMI table to match all systems where DMI product family is "Thinkpad X1 Carbon 6th". However, the system I have here has this string written differently (ThinkPad vs. Thinkpad) which makes the match fail. In addition to that, after BIOS upgrade Robin now has the same string than my system has (perhaps newer BIOS has changed the string). In any case add another DMI entry to acpi_ec_no_wakeup[] table hopefully covering all the X1 Carbon 6th systems out there. Fixes: 2c4d6baf1bc4 (ACPI / EC: Use ec_no_wakeup on more Thinkpad X1 Carbon 6th systems) Signed-off-by: Mika Westerberg [ rjw: Rebase and change the ident string to match the product familiy ] Signed-off-by: Rafael J. Wysocki commit 67fbd0a3a802bc80218f6c33d594f34f0ecb02f9 Author: Tom Todd Date: Wed Aug 8 01:52:02 2018 +0100 ACPI: bus: Fix a pointer coding style issue Fix white space in the argument list of acpi_device_remove(). Signed-off-by: Tom Todd Signed-off-by: Rafael J. Wysocki commit 1035a0783523d8c730c44944a71b254f3a649e25 Author: Dongjiu Geng Date: Tue Aug 7 12:26:15 2018 -0400 arm64 / ACPI: clean the additional checks before calling ghes_notify_sea() In order to remove the additional check before calling the ghes_notify_sea(), make stub definition when !CONFIG_ACPI_APEI_SEA. After this cleanup, we can simply call the ghes_notify_sea() to let APEI driver handle the SEA notification. Signed-off-by: Dongjiu Geng Acked-by: Will Deacon Signed-off-by: Rafael J. Wysocki commit a6f0729508df6a067c4a074ec187ecd9d2457a6b Author: John Garry Date: Tue Aug 7 21:15:05 2018 +0800 ACPI / scan: Add static attribute to indirect_io_hosts[] Array indirect_io_hosts[] is declared in acpi_is_indirect_io_slave() as a const array, which means that the array will be re-built for each call. Optimise by adding the static attribute, which means that the array is added to const-data pool and not re-built per function call. Reported-by: Hans de Goede Signed-off-by: John Garry Signed-off-by: Rafael J. Wysocki commit b41901a2cf06f33c030be96c075872201089d47a Author: Hans de Goede Date: Tue Aug 7 09:36:30 2018 +0200 ACPI / battery: Do not export energy_full[_design] on devices without full_charge_capacity On some devices (with a buggy _BIX implementation) full_charge_capacity always reports as 0. This means that our energy_full sysfs attribute will also always be 0, which is not useful to export. Worse we calculate our reported capacity on full_charge_capacity and if it is 0 we always report 0. This causes userspace to immediately shutdown or hibernate the laptop since it assumes that the battery is critically low. This commit makes us not report energy_full[_design] or capacity on such broken devices, avoiding the immediate shutdown / hibernate from userspace. Link: https://bugzilla.kernel.org/show_bug.cgi?id=83941 Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit e24f14b0ff985f3e09e573ba1134bfdf42987e05 Author: David Woodhouse Date: Wed Aug 8 11:00:16 2018 +0100 tools headers: Synchronise x86 cpufeatures.h for L1TF additions Signed-off-by: David Woodhouse commit 91c6e15efc1756b068dc6e945c1626397e60a119 Author: Gustavo A. R. Silva Date: Wed Aug 8 17:23:44 2018 -0500 ALSA: usb-audio: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1357413 ("Missing break in switch") Addresses-Coverity-ID: 114917 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 725097323bbcbbca51ede20b542c6229a2869445 Author: Gustavo A. R. Silva Date: Wed Aug 8 17:11:48 2018 -0500 ALSA: mixart: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced the code comment with a proper "fall through" annotation, which is what GCC is expecting to find. Addresses-Coverity-ID: 114889 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 37a366face294facb9c9d9fdd9f5b64a27456cbd Author: Gerald Schaefer Date: Tue Aug 7 18:57:11 2018 +0200 s390/mm: fix addressing exception after suspend/resume Commit c9b5ad546e7d "s390/mm: tag normal pages vs pages used in page tables" accidentally changed the logic in arch_set_page_states(), which is used by the suspend/resume code. set_page_stable(page, order) was changed to set_page_stable_dat(page, 0). After this, only the first page of higher order pages will be set to stable, and a write to one of the unstable pages will result in an addressing exception. Fix this by using "order" again, instead of "0". Fixes: c9b5ad546e7d ("s390/mm: tag normal pages vs pages used in page tables") Cc: stable@vger.kernel.org # 4.14+ Reviewed-by: Heiko Carstens Signed-off-by: Gerald Schaefer Signed-off-by: Martin Schwidefsky commit 4c14d1ce17bcc4c0c0f291ee162f9de73c4ee2eb Author: Vasily Gorbik Date: Mon Jul 9 17:07:48 2018 +0200 rseq/selftests: add s390 support Implement support for s390 in the rseq selftests, in order to sanity check the recently enabled rseq syscall. The Implementation covers both 64-bit and 31-bit mode. Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 47e20577c24d206730bef085cb53d9812efca6f4 Author: Manivannan Sadhasivam Date: Thu Jul 26 10:36:57 2018 +0530 dmaengine: Add Actions Semi Owl family S900 DMA driver Add Actions Semi Owl family S900 DMA driver. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Vinod Koul commit 50454acaac63c4dea03a765242eb0d662a4fc383 Author: Manivannan Sadhasivam Date: Thu Jul 26 10:36:55 2018 +0530 dt-bindings: dmaengine: Add binding for Actions Semi Owl SoCs Add devicetree binding for Actions Semi Owl SoCs DMA controller. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Signed-off-by: Vinod Koul commit 82b94f5d6891a8e58efdb9b054bdadbbdddec9d9 Merge: 13403d6952a5 269d26f47f6f Author: David S. Miller Date: Wed Aug 8 19:34:55 2018 -0700 Merge branch 'mlx5-next' Saeed Mahameed says: ==================== Mellanox, mlx5 next updates 2018-08-09 This series includes mlx5 core driver updates and mostly simple cleanups. From Denis: Use max #EQs reported by firmware to request MSIX vectors. From Eli: Trivial cleanups, unused arguments/functions and reduce command polling interval when command interface is in polling mode. From Eran: Rename vport state enums, to better reflect their actual usage. ==================== Signed-off-by: David S. Miller commit 269d26f47f6f7d4275b0e225c9ee80cf4a31aa8c Author: Eli Cohen Date: Wed Aug 8 16:23:53 2018 -0700 net/mlx5: Reduce command polling interval Use cond_resched() instead of usleep_range() to decrease the time between polling attempts thus reducing overall driver load time. Below is a comparison before and after the change, of loading eight virtual functions. Before: real 0m8.785s user 0m0.093s sys 0m0.090s After: real 0m5.730s user 0m0.097s sys 0m0.087s Signed-off-by: Eli Cohen Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit d1fd79f34f2d56f969472d7285ea5239ab7b7bf0 Author: Eli Cohen Date: Wed Aug 8 16:23:52 2018 -0700 net/mlx5: Unexport functions that need not be exported mlx5_query_vport_state() and mlx5_modify_vport_admin_state() are used only from within mlx5_core - unexport them. Signed-off-by: Eli Cohen Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 29d8ebd44de8999e292dbb4de76744d4a41039ec Author: Eli Cohen Date: Wed Aug 8 16:23:51 2018 -0700 net/mlx5: Remove unused mlx5_query_vport_admin_state mlx5_query_vport_admin_state() is not used anywhere. Remove it. Signed-off-by: Eli Cohen Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 8e3debc08b9a1a4c049c4e3bd2cfe73614a9a6cb Author: Eli Cohen Date: Wed Aug 8 16:23:50 2018 -0700 net/mlx5: E-Switch, Remove unused argument when creating legacy FDB Remove unused nvports argument. Signed-off-by: Eli Cohen Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit cc9c82a8668cf98748bfbaa83c5c092d5115c25b Author: Eran Ben Elisha Date: Wed Aug 8 16:23:49 2018 -0700 net/mlx5: Rename modify/query_vport state related enums Modify and query vport state commands share the same admin_state and op_mod values, rename the enums to fit them both. In addition, remove the esw prefix from the admin state enum as this also applied for vnic. Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 342ac8448f1fb213908656ae5581d0f37a5954e8 Author: Denis Drozdov Date: Wed Aug 8 16:23:48 2018 -0700 net/mlx5: Use max_num_eqs for calculation of required MSIX vectors New firmware has defined new HCA capability field called "max_num_eqs", that is the number of available EQs after subtracting reserved FW EQs. Before this capability the FW reported the EQ number in "log_max_eqs", the reported value also contained FW reserved EQs, but the driver might be failing to load on 320 cpus systems due to the fact that FW reserved EQs were not available to the driver. Now the driver has to obtain max_num_eqs value from new FW to get real number of EQs available. Signed-off-by: Denis Drozdov Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 51372570ac3c919b036e760f4ca449e81cf8e995 Author: Jianchao Wang Date: Wed Aug 8 14:24:59 2018 +0800 scsi: core: use blk_mq_run_hw_queues in scsi_kick_queue We don't use blk-mq start/stop hw queue any more, so no reason to use blk_mq_start_hw_queues which does clear_bit, replace it with blk_mq_run_hw_queues. Signed-off-by: Jianchao Wang Reviewed-by: Ming Lei Signed-off-by: Martin K. Petersen commit e7c3b37983c4ed038a3b982aa3dafc76dfa86249 Author: Ohad Sharabi Date: Sun Aug 5 16:26:23 2018 +0300 scsi: ufs: remove unnecessary query(DM) UPIU trace This patch removes redundant trace that occurs when sending Device Management(DM) request (fix behavior in commit 6667e6d91c88 ("scsi: ufs: add trace event for ufs upiu"). Since the function send_command is called also for DM request, UPIU trace for DM request is called twice- one identified as query_* the other as send/complete. Signed-off-by: Ohad Sharabi Fixes: 6667e6d91c88 ("scsi: ufs: add trace event for ufs upiu") Reviewed-by: Stanislav Nijnikov Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit e9f7be0c4316a0ea1c47b1e800baa58fb937096c Author: Quinn Tran Date: Tue Aug 7 20:39:52 2018 -0700 scsi: qla2xxx: Fix issue reported by static checker for qla2x00_els_dcmd2_sp_done() This patch fixes following Smatch complaint: drivers/scsi/qla2xxx/qla_iocb.c:2647 qla2x00_els_dcmd2_sp_done() error: we previously assumed 'e' could be null (see line 2631) Fixes: 8777e4314d39 ("scsi: qla2xxx: Migrate NVME N2N handling into state machine") Reported-by: Dan Carpenter Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 13403d6952a5adf80d3d5668c290490852b4def2 Author: Wei Yongjun Date: Wed Aug 8 03:10:39 2018 +0000 ieee802154: hwsim: fix missing unlock on error in hwsim_add_one() Add the missing unlock before return from function hwsim_add_one() in the error handling case. Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb") Signed-off-by: Wei Yongjun Signed-off-by: Stefan Schmidt Signed-off-by: David S. Miller commit 470770bf841b49fe129876300dfcb74a8bbabe99 Author: Wei Yongjun Date: Wed Aug 8 02:43:46 2018 +0000 ieee802154: hwsim: fix copy-paste error in hwsim_set_edge_lqi() The return value from kzalloc() is not checked correctly. The test is done against a wrong variable. This patch fix it. Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb") Signed-off-by: Wei Yongjun Signed-off-by: Stefan Schmidt Signed-off-by: David S. Miller commit 1c9f4a3fce770f194647dd1441502dd5b84ca883 Author: Alexander Aring Date: Tue Aug 7 19:32:49 2018 -0400 ieee802154: hwsim: fix rcu handling This patch adds missing rcu_assign_pointer()/rcu_dereference() to used rcu pointers. There was already a previous commit c5d99d2b35da ("ieee802154: hwsim: fix rcu address annotation"), but there was more which was pointed out on my side by using newest sparse version. Cc: Stefan Schmidt Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb") Signed-off-by: Alexander Aring Signed-off-by: Stefan Schmidt Signed-off-by: David S. Miller commit d98e000cc79e740f0c9e2dee59cd4b12a2f11a52 Author: Dongliang Mu Date: Tue Aug 7 01:14:29 2018 -0400 scsi: aacraid: Spelling fix in comment requesed -> requested Signed-off-by: Dongliang Mu Signed-off-by: Martin K. Petersen commit e70183143cc472960bc60dfee1b7bbe1949feffb Author: Sreekanth Reddy Date: Thu Jul 12 12:53:29 2018 -0400 scsi: mpt3sas: Fix calltrace observed while running IO & reset Below kernel BUG was observed while running IOs with host reset (issued from application), mpt3sas_cm0: diag reset: SUCCESS ------------[ cut here ]------------ WARNING: CPU: 12 PID: 4336 at drivers/scsi/mpt3sas/mpt3sas_base.c:3282 mpt3sas_base_clear_st+0x3d/0x40 [mpt3sas] Modules linked in: macsec tcp_diag udp_diag inet_diag unix_diag af_packet_diag netlink_diag binfmt_misc fuse xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun devlink ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter sunrpc vfat fat sb_edac intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd iTCO_wdt iTCO_vendor_support dcdbas pcspkr joydev ipmi_ssif ses enclosure sg ipmi_devintf acpi_pad ipmi_msghandler acpi_power_meter mei_me lpc_ich wmi mei shpchp ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_generic ata_generic pata_acpi uas usb_storage mgag200 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm ata_piix mpt3sas libata crct10dif_pclmul crct10dif_common tg3 crc32c_intel i2c_core raid_class ptp scsi_transport_sas pps_core dm_mirror dm_region_hash dm_log dm_mod CPU: 12 PID: 4336 Comm: python Kdump: loaded Tainted: G W ------------ 3.10.0-875.el7.brdc.x86_64 #1 Hardware name: Dell Inc. PowerEdge R820/0YWR73, BIOS 1.5.0 03/08/2013 Call Trace: [] dump_stack+0x19/0x1b [] __warn+0xd8/0x100 [] warn_slowpath_null+0x1d/0x20 [] mpt3sas_base_clear_st+0x3d/0x40 [mpt3sas] [] _scsih_flush_running_cmds+0x92/0xe0 [mpt3sas] [] mpt3sas_scsih_reset_handler+0x43b/0xaf0 [mpt3sas] [] ? vprintk_default+0x29/0x40 [] ? printk+0x60/0x77 [] ? _base_diag_reset+0x238/0x340 [mpt3sas] [] mpt3sas_base_hard_reset_handler+0x1ad/0x420 [mpt3sas] [] _ctl_ioctl_main.isra.12+0x11b9/0x1200 [mpt3sas] [] ? xfs_file_aio_write+0x155/0x1b0 [xfs] [] ? do_sync_write+0x93/0xe0 [] _ctl_ioctl+0x1a/0x20 [mpt3sas] [] do_vfs_ioctl+0x350/0x560 [] ? __sb_end_write+0x31/0x60 [] SyS_ioctl+0xa1/0xc0 [] ? system_call_after_swapgs+0xa2/0x146 [] system_call_fastpath+0x1c/0x21 [] ? system_call_after_swapgs+0xae/0x146 ---[ end trace 5dac5b98d89aaa3c ]--- ------------[ cut here ]------------ kernel BUG at block/blk-core.c:1476! invalid opcode: 0000 [#1] SMP Modules linked in: macsec tcp_diag udp_diag inet_diag unix_diag af_packet_diag netlink_diag binfmt_misc fuse xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun devlink ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter sunrpc vfat fat sb_edac intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd iTCO_wdt iTCO_vendor_support dcdbas pcspkr joydev ipmi_ssif ses enclosure sg ipmi_devintf acpi_pad ipmi_msghandler acpi_power_meter mei_me lpc_ich wmi mei shpchp ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_generic ata_generic pata_acpi uas usb_storage mgag200 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm ata_piix mpt3sas libata crct10dif_pclmul crct10dif_common tg3 crc32c_intel i2c_core raid_class ptp scsi_transport_sas pps_core dm_mirror dm_region_hash dm_log dm_mod CPU: 12 PID: 4336 Comm: python Kdump: loaded Tainted: G W ------------ 3.10.0-875.el7.brdc.x86_64 #1 Hardware name: Dell Inc. PowerEdge R820/0YWR73, BIOS 1.5.0 03/08/2013 task: ffff903fc96e0fd0 ti: ffff903fb1eec000 task.ti: ffff903fb1eec000 RIP: 0010:[] [] blk_requeue_request+0x90/0xa0 RSP: 0018:ffff903c6b783dc0 EFLAGS: 00010087 RAX: ffff903bb67026d0 RBX: ffff903b7d6a6140 RCX: dead000000000200 RDX: ffff903bb67026d0 RSI: ffff903bb6702580 RDI: ffff903bb67026d0 RBP: ffff903c6b783dd8 R08: ffff903bb67026d0 R09: ffffd97e80000000 R10: ffff903c658bac00 R11: 0000000000000000 R12: ffff903bb6702580 R13: ffff903fa9a292f0 R14: 0000000000000246 R15: 0000000000001057 FS: 00007f7026f5b740(0000) GS:ffff903c6b780000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f298877c004 CR3: 00000000caf36000 CR4: 00000000000607e0 Call Trace: [] __scsi_queue_insert+0xbf/0x110 [] scsi_io_completion+0x5da/0x6a0 [] scsi_finish_command+0xdc/0x140 [] scsi_softirq_done+0x132/0x160 [] blk_done_softirq+0x96/0xc0 [] __do_softirq+0xf5/0x280 [] call_softirq+0x1c/0x30 [] do_softirq+0x65/0xa0 [] irq_exit+0x105/0x110 [] smp_apic_timer_interrupt+0x48/0x60 [] apic_timer_interrupt+0x162/0x170 [] ? scsi_done+0x21/0x60 [] ? delay_tsc+0x38/0x60 [] __const_udelay+0x2d/0x30 [] _base_handshake_req_reply_wait+0x8e/0x4a0 [mpt3sas] [] _base_get_ioc_facts+0x123/0x590 [mpt3sas] [] ? _base_diag_reset+0x238/0x340 [mpt3sas] [] mpt3sas_base_hard_reset_handler+0x1f3/0x420 [mpt3sas] [] _ctl_ioctl_main.isra.12+0x11b9/0x1200 [mpt3sas] [] ? xfs_file_aio_write+0x155/0x1b0 [xfs] [] ? do_sync_write+0x93/0xe0 [] _ctl_ioctl+0x1a/0x20 [mpt3sas] [] do_vfs_ioctl+0x350/0x560 [] ? __sb_end_write+0x31/0x60 [] SyS_ioctl+0xa1/0xc0 [] ? system_call_after_swapgs+0xa2/0x146 [] system_call_fastpath+0x1c/0x21 [] ? system_call_after_swapgs+0xae/0x146 Code: 83 c3 10 4c 89 e2 4c 89 ee e8 8d 21 04 00 48 8b 03 48 85 c0 75 e5 41 f6 44 24 4a 10 74 ad 4c 89 e6 4c 89 ef e8 b2 42 00 00 eb a0 <0f> 0b 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 RIP [] blk_requeue_request+0x90/0xa0 RSP As a part of host reset operation, driver will flushout all IOs outstanding at driver level with "DID_RESET" result. To find which are all commands outstanding at the driver level, driver loops with smid starting from one to HBA queue depth and calls mpt3sas_scsih_scsi_lookup_get() to get scmd as shown below for (smid = 1; smid <= ioc->scsiio_depth; smid++) { scmd = mpt3sas_scsih_scsi_lookup_get(ioc, smid); if (!scmd) continue; But in mpt3sas_scsih_scsi_lookup_get() function, driver returns some scsi cmnds which are not outstanding at the driver level (possibly request is constructed at block layer since QUEUE_FLAG_QUIESCED is not set. Even if driver uses scsi_block_requests and scsi_unblock_requests, issue still persists as they will be just blocking further IO from scsi layer and not from block layer) and these commands are flushed with DID_RESET host bytes thus resulting into above kernel BUG. This issue got introduced by commit dbec4c9040ed ("scsi: mpt3sas: lockless command submission"). To fix this issue, we have modified the mpt3sas_scsih_scsi_lookup_get() to check for smid equals to zero (note: whenever any scsi cmnd is processing at the driver level then smid for that scsi cmnd will be non-zero, always it starts from one) before it returns the scmd pointer to the caller. If smid is zero then this function returns scmd pointer as NULL and driver won't flushout those scsi cmnds at driver level with DID_RESET host byte thus this issue will not be observed. [mkp: amended with updated fix from Sreekanth] Signed-off-by: Sreekanth Reddy Fixes: dbec4c9040ed ("scsi: mpt3sas: lockless command submission") Cc: stable@vger.kernel.org # v4.16+ Reviewed-by: Tomas Henzl Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 0756c57bce3d26da2592d834d8910b6887021701 Author: Dan Carpenter Date: Wed Aug 8 17:29:09 2018 +0300 scsi: aic94xx: fix an error code in aic94xx_init() We accidentally return success instead of -ENOMEM on this error path. Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Signed-off-by: Dan Carpenter Reviewed-by: Johannes Thumshirn Reviewed-by: John Garry Signed-off-by: Martin K. Petersen commit 990528171f0c31bd0dfe3da7f60b02664abbcf34 Author: Colin Ian King Date: Fri Aug 3 11:47:52 2018 +0100 scsi: st: remove redundant pointer STbuffer Pointer STbuffer is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'STbuffer' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Acked-by: Kai Mäkisara Signed-off-by: Martin K. Petersen commit c9a5e6a968bd328753b694d19b952068c65dc5e7 Author: Mike Snitzer Date: Wed Aug 8 20:50:58 2018 -0400 dm snapshot: remove stale FIXME in snapshot_map() Commit ae1093be ("dm snapshot: use mutex instead of rw_semaphore") eliminated the need to worry about read vs write locking. So remove a FIXME in snapshot_map() that is concerned about selectively taking a write lock. Signed-off-by: Mike Snitzer commit 1eb9fb52040fc6e5656c277b562229f09467c9f8 Author: Ronnie Sahlberg Date: Wed Aug 8 15:07:46 2018 +1000 cifs: create SMB2_open_init()/SMB2_open_free() helpers. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Paulo Alcantara Reviewed-by: Pavel Shilovsky commit 296ecbae7fdf209b1e0fb08b8bd82e5e9b637439 Author: Ronnie Sahlberg Date: Wed Aug 1 09:26:17 2018 +1000 cifs: add SMB2_query_info_[init|free]() Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky Reviewed-by: Paulo Alcantara commit bd96461249bdded1f6ee50b25e8cd4ce3faaf581 Author: Camelia Groza Date: Wed Jul 18 14:46:51 2018 +0300 powerpc/dts/fsl: t2080rdb: use the Cortina PHY driver compatible The Cortina PHY is not compatible with IEEE 802.3 clause 45. Signed-off-by: Camelia Groza [scottwood: made commit message about compatibility, not driver choice] Signed-off-by: Scott Wood commit 39e560a9182e72ad8b0fd2d922f0c516c663cc59 Author: Camelia Groza Date: Wed Jul 18 14:46:50 2018 +0300 powerpc/dts/fsl: t4240rdb: use the Cortina PHY driver compatible The Cortina PHY is not compatible with IEEE 802.3 clause 45. Signed-off-by: Camelia Groza [scottwood: made commit message about compatibility, not driver choice] Signed-off-by: Scott Wood commit 24f36ce6166059783436bdaba3f3b8f23a6d2ddd Author: Camelia Groza Date: Wed Jul 18 14:46:49 2018 +0300 powerpc/configs/dpaa: enable the Cortina PHY driver Cortina PHYs are present on T4240RDB and T2080RDB. Enable the driver by default. Signed-off-by: Camelia Groza Signed-off-by: Scott Wood commit 8eb4ecfab03d21146e144b0693ce96839d58202d Author: Ronnie Sahlberg Date: Wed Aug 1 09:26:16 2018 +1000 cifs: add SMB2_close_init()/SMB2_close_free() Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky Reviewed-by: Paulo Alcantara commit 2a39926c6aa9dda4fd26741f0f834a555f403d32 Author: Christophe Leroy Date: Mon Aug 6 15:09:11 2018 +0000 powerpc/cpm1: fix compilation error with CONFIG_PPC_EARLY_DEBUG_CPM commit e8cb7a55eb8dc ("powerpc: remove superflous inclusions of asm/fixmap.h") removed inclusion of asm/fixmap.h from files not including objects from that file. However, asm/mmu-8xx.h includes call to __fix_to_virt(). The proper way would be to include asm/fixmap.h in asm/mmu-8xx.h but it creates an inclusion loop. So we have to leave asm/fixmap.h in sysdep/cpm_common.c for CONFIG_PPC_EARLY_DEBUG_CPM CC arch/powerpc/sysdev/cpm_common.o In file included from ./arch/powerpc/include/asm/mmu.h:340:0, from ./arch/powerpc/include/asm/reg_8xx.h:8, from ./arch/powerpc/include/asm/reg.h:29, from ./arch/powerpc/include/asm/processor.h:13, from ./arch/powerpc/include/asm/thread_info.h:28, from ./include/linux/thread_info.h:38, from ./arch/powerpc/include/asm/ptrace.h:159, from ./arch/powerpc/include/asm/hw_irq.h:12, from ./arch/powerpc/include/asm/irqflags.h:12, from ./include/linux/irqflags.h:16, from ./include/asm-generic/cmpxchg-local.h:6, from ./arch/powerpc/include/asm/cmpxchg.h:537, from ./arch/powerpc/include/asm/atomic.h:11, from ./include/linux/atomic.h:5, from ./include/linux/mutex.h:18, from ./include/linux/kernfs.h:13, from ./include/linux/sysfs.h:16, from ./include/linux/kobject.h:20, from ./include/linux/device.h:16, from ./include/linux/node.h:18, from ./include/linux/cpu.h:17, from ./include/linux/of_device.h:5, from arch/powerpc/sysdev/cpm_common.c:21: arch/powerpc/sysdev/cpm_common.c: In function ‘udbg_init_cpm’: ./arch/powerpc/include/asm/mmu-8xx.h:218:25: error: implicit declaration of function ‘__fix_to_virt’ [-Werror=implicit-function-declaration] #define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE)) ^ arch/powerpc/sysdev/cpm_common.c:75:7: note: in expansion of macro ‘VIRT_IMMR_BASE’ VIRT_IMMR_BASE); ^ ./arch/powerpc/include/asm/mmu-8xx.h:218:39: error: ‘FIX_IMMR_BASE’ undeclared (first use in this function) #define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE)) ^ arch/powerpc/sysdev/cpm_common.c:75:7: note: in expansion of macro ‘VIRT_IMMR_BASE’ VIRT_IMMR_BASE); ^ ./arch/powerpc/include/asm/mmu-8xx.h:218:39: note: each undeclared identifier is reported only once for each function it appears in #define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE)) ^ arch/powerpc/sysdev/cpm_common.c:75:7: note: in expansion of macro ‘VIRT_IMMR_BASE’ VIRT_IMMR_BASE); ^ cc1: all warnings being treated as errors make[1]: *** [arch/powerpc/sysdev/cpm_common.o] Error 1 Fixes: e8cb7a55eb8dc ("powerpc: remove superflous inclusions of asm/fixmap.h") Signed-off-by: Christophe Leroy Signed-off-by: Scott Wood commit 46483c2ea4664679130d6489112f180c2bfc801d Author: NeilBrown Date: Wed Aug 8 09:20:02 2018 +1000 NFS: Use an appropriate work queue for direct-write completion When a direct-write completes, a work_struct is schedule to handle the completion. When NFS is being used for swap, the direct write might be a swap-out, so memory allocation can block until the write completes. The work queue currently used is not WQ_MEM_RECLAIM, so tasks can block waiting for memory - this leads to deadlock. So use nfsiod_workqueue instead. This will always have a running thread, and work items should never block waiting for memory. Signed-off-by: Neil Brown Signed-off-by: Anna Schumaker commit 72bf75cfc00c02aa66ef6133048f37aa5d88825c Author: Wei Yongjun Date: Thu Aug 2 05:42:04 2018 +0000 NFSv4: Fix error handling in nfs4_sp4_select_mode() Error code is set in the error handling cases but never used. Fix it. Fixes: 937e3133cd0b ("NFSv4.1: Ensure we clear the SP4_MACH_CRED flags in nfs4_sp4_select_mode()") Signed-off-by: Wei Yongjun Signed-off-by: Anna Schumaker commit 10db5b7a2f44379f63c159a77456d4d22df53c51 Author: Gustavo A. R. Silva Date: Wed Aug 1 19:55:51 2018 -0500 pnfs: Use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Anna Schumaker commit 2230ca0d284e6431ae7baf444f49f662bb490a58 Author: Trond Myklebust Date: Wed Aug 1 14:28:57 2018 -0400 pnfs: pnfs_find_lseg() should not check NFS_LSEG_LAYOUTRETURN Layout segment validity is determined only by the NFS_LSEG_VALID flag. If it is set, the layout segment is finable. As it is, when the flexfiles driver sets NFS_LSEG_LAYOUTRETURN to indicate that we cannot discard the layout segment, but that it must be returned, then this can result in an unnecessary layoutget storm. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 01e03bdc745bf2b86fadfc44e57512fd39f9d54f Author: Gustavo A. R. Silva Date: Tue Jul 31 21:18:44 2018 -0500 NFS: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Anna Schumaker commit c8d07159c93150c25c3319df3d53cfc6dd46d3ee Author: Trond Myklebust Date: Tue Jul 31 15:54:12 2018 -0400 NFSv4: Mark the inode change attribute up to date in update_changeattr() When we update the change attribute, we should also clear the flag that says it is out of date. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 5636ec4eb6b804cd7e67e3a896f1624609dfb427 Author: Trond Myklebust Date: Tue Jul 31 15:54:11 2018 -0400 NFSv4: Detect nlink changes on cross-directory renames too If the object being renamed from one directory to another is also a directory, then 'nlink' will change for both directories. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 3c591175d6432ca9b7d26a171715652d88902715 Author: Trond Myklebust Date: Tue Jul 31 15:54:10 2018 -0400 NFSv4: bump/drop the nlink count on the parent dir when we mkdir/rmdir Ensure that we always bump or drop the nlink count on the parent directory when we do a mkdir or a rmdir(). This needs to be done by hand as we don't have pre/post op attributes. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit c16467dc03db5e2532484026a25b0eef80012ea1 Author: Trond Myklebust Date: Sun Jul 29 22:39:15 2018 -0400 pnfs: Fix handling of NFS4ERR_OLD_STATEID replies to layoutreturn If the server tells us that out layoutreturn raced with another layout update, then we must ensure that the new layout segments are not in use before we resend with an updated layout stateid. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 8d4fb8ff427a23e573c9373b2bb3d1d6e8ea4399 Author: Chuck Lever Date: Sat Jul 28 10:46:47 2018 -0400 xprtrdma: Fix disconnect regression I found that injecting disconnects with v4.18-rc resulted in random failures of the multi-threaded git regression test. The root cause appears to be that, after a reconnect, the RPC/RDMA transport is waking pending RPCs before the transport has posted enough Receive buffers to receive the Replies. If a Reply arrives before enough Receive buffers are posted, the connection is dropped. A few connection drops happen in quick succession as the client and server struggle to regain credit synchronization. This regression was introduced with commit 7c8d9e7c8863 ("xprtrdma: Move Receive posting to Receive handler"). The client is supposed to post a single Receive when a connection is established because it's not supposed to send more than one RPC Call before it gets a fresh credit grant in the first RPC Reply [RFC 8166, Section 3.3.3]. Unfortunately there appears to be a longstanding bug in the Linux client's credit accounting mechanism. On connect, it simply dumps all pending RPC Calls onto the new connection. It's possible it has done this ever since the RPC/RDMA transport was added to the kernel ten years ago. Servers have so far been tolerant of this bad behavior. Currently no server implementation ever changes its credit grant over reconnects, and servers always repost enough Receives before connections are fully established. The Linux client implementation used to post a Receive before each of these Calls. This has covered up the flooding send behavior. I could try to correct this old bug so that the client sends exactly one RPC Call and waits for a Reply. Since we are so close to the next merge window, I'm going to instead provide a simple patch to post enough Receives before a reconnect completes (based on the number of credits granted to the previous connection). The spurious disconnects will be gone, but the client will still send multiple RPC Calls immediately after a reconnect. Addressing the latter problem will wait for a merge window because a) I expect it to be a large change requiring lots of testing, and b) obviously the Linux client has interoperated successfully since day zero while still being broken. Fixes: 7c8d9e7c8863 ("xprtrdma: Move Receive posting to ... ") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit e3ea52b578be221d9d5564d17005d01a8d390b92 Author: Andy Shevchenko Date: Wed Jul 25 17:39:26 2018 +0300 i2c: designware: Convert to use struct i2c_timings Instead of using custom variables and parser, convert the driver to use the ones provided by I2C core. No functional change intended. Signed-off-by: Andy Shevchenko Reviewed-by: Alexandre Belloni Tested-by: Alexandre Belloni Signed-off-by: Wolfram Sang commit 4717be73c2843a3d6d8546872177a19358f6b7b5 Author: Andy Shevchenko Date: Wed Jul 25 17:39:25 2018 +0300 i2c: core: Parse SDA hold time from firmware There are two drivers already using the SDA hold time setting. It might be more in the future, thus, make I2C core to parse the setting for us if provided by firmware. Signed-off-by: Andy Shevchenko Tested-by: Alexandre Belloni Reviewed-by: Alexandre Belloni Acked-by: Ludovic Desroches Signed-off-by: Wolfram Sang commit 1c02cbf7de0dc778bbd3735089ce903c8a55517d Author: Gustavo A. R. Silva Date: Tue Jul 3 14:10:55 2018 -0500 i2c: designware-pcidrv: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Acked-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit ee87a0ce2f91aa4f4906a5f515152aa5019200ad Author: Gustavo A. R. Silva Date: Tue Jul 3 14:07:51 2018 -0500 i2c: amd8111: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Wolfram Sang commit 1063711b57393c1999248cccb57bebfaf16739e7 Author: Andi Kleen Date: Tue Aug 7 15:09:38 2018 -0700 x86/mm/kmmio: Make the tracer robust against L1TF The mmio tracer sets io mapping PTEs and PMDs to non present when enabled without inverting the address bits, which makes the PTE entry vulnerable for L1TF. Make it use the right low level macros to actually invert the address bits to protect against L1TF. In principle this could be avoided because MMIO tracing is not likely to be enabled on production machines, but the fix is straigt forward and for consistency sake it's better to get rid of the open coded PTE manipulation. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner commit 0c93c5ce107659069d16fa34ddce465acdf9d996 Author: Gustavo A. R. Silva Date: Wed Aug 8 14:25:16 2018 -0500 ALSA: opl3: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114878 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 6a9405b56c274024564f9014bba97b92c91b34d6 Author: Konstantin Khlebnikov Date: Tue Aug 7 17:24:54 2018 +0300 perf map: Optimize maps__fixup_overlappings() This function splits and removes overlapping areas. Maps in tree are ordered by start address thus we could find first overlap and stop if next map does not overlap. Signed-off-by: Konstantin Khlebnikov Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/153365189407.435244.7234821822450484712.stgit@buzz Signed-off-by: Arnaldo Carvalho de Melo commit e5adfc3e7e774ba86f7bb725c6eef5f32df8630e Author: Konstantin Khlebnikov Date: Tue Aug 7 12:09:01 2018 +0300 perf map: Synthesize maps only for thread group leader Threads share map_groups, all map events are merged into it. Thus we could send mmaps only for thread group leader. Otherwise it took ages to attach and record something from processes with many vmas and threads. Thread group leader could be already dead, but it seems perf cannot handle this case anyway. Testing dummy: #include #include #include #include #include void *thread(void *arg) { pause(); } int main(int argc, char **argv) { int threads = 10000; int vmas = 50000; pthread_t th; for (int i = 0; i < threads; i++) pthread_create(&th, NULL, thread, NULL); for (int i = 0; i < vmas; i++) mmap(NULL, 4096, (i & 1) ? PROT_READ : PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); sleep(60); return 0; } Comment by Jiri Olsa: We actualy synthesize the group leader (if we found one) for the thread even if it's not present in the thread_map, so the process maps are always in data. Signed-off-by: Konstantin Khlebnikov Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/153363294102.396323.6277944760215058174.stgit@buzz Signed-off-by: Arnaldo Carvalho de Melo commit 88cf7084f9b4b3744294b438884c2b7999b0200a Author: Arnaldo Carvalho de Melo Date: Tue Aug 7 16:26:35 2018 -0300 perf trace: Wire up the augmented syscalls with the syscalls:sys_enter_FOO beautifier We just check that the evsel is the one we associated with the bpf-output event associated with the "__augmented_syscalls__" eBPF map, to show that the formatting is done properly: # perf trace -e perf/tools/perf/examples/bpf/augmented_syscalls.c,openat cat /etc/passwd > /dev/null 0.000 ( ): __augmented_syscalls__:dfd: CWD, filename: 0x43e06da8, flags: CLOEXEC 0.006 ( ): syscalls:sys_enter_openat:dfd: CWD, filename: 0x43e06da8, flags: CLOEXEC 0.007 ( 0.004 ms): cat/11486 openat(dfd: CWD, filename: 0x43e06da8, flags: CLOEXEC ) = 3 0.029 ( ): __augmented_syscalls__:dfd: CWD, filename: 0x4400ece0, flags: CLOEXEC 0.030 ( ): syscalls:sys_enter_openat:dfd: CWD, filename: 0x4400ece0, flags: CLOEXEC 0.031 ( 0.004 ms): cat/11486 openat(dfd: CWD, filename: 0x4400ece0, flags: CLOEXEC ) = 3 0.249 ( ): __augmented_syscalls__:dfd: CWD, filename: 0xc3700d6 0.250 ( ): syscalls:sys_enter_openat:dfd: CWD, filename: 0xc3700d6 0.252 ( 0.003 ms): cat/11486 openat(dfd: CWD, filename: 0xc3700d6 ) = 3 # Now we just need to get the full blown enter/exit handlers to check if the evsel being processed is the augmented_syscalls one to go pick the pointer payloads from the end of the payload. We also need to state somehow what is the layout for multi pointer arg syscalls. Also handy would be to have a BTF file with the struct definitions used in syscalls, compact, generated at kernel built time and available for use in eBPF programs. Till we get there we can go on doing some manual coupling of the most relevant syscalls with some hand built beautifiers. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-r6ba5izrml82nwfmwcp7jpkm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d3d1c4bdf5a793ab10c448f9cf5aa5b19ce026d3 Author: Arnaldo Carvalho de Melo Date: Tue Aug 7 16:21:44 2018 -0300 perf trace: Setup the augmented syscalls bpf-output event fields The payload that is put in place by the eBPF script attached to syscalls:sys_enter_openat (and other syscalls with pointers, in the future) can be consumed by the existing sys_enter beautifiers if evsel->priv is setup with a struct syscall_tp with struct tp_fields for the 'syscall_id' and 'args' fields expected by the beautifiers, this patch does just that. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-xfjyog8oveg2fjys9r1yy1es@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 78e890ea8683f7d570f911637b23b23d27be4aed Author: Arnaldo Carvalho de Melo Date: Tue Aug 7 16:19:05 2018 -0300 perf bpf: Make bpf__setup_output_event() return the bpf-output event We're calling it to setup that event, and we'll need it later to decide if the bpf-output event we're handling is the one setup for a specific purpose, return it using ERR_PTR, etc. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-zhachv7il2n1lopt9aonwhu7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e0b6d2ef329098bd9780ec00a75db3b11922031a Author: Arnaldo Carvalho de Melo Date: Tue Aug 7 15:40:13 2018 -0300 perf trace: Handle "bpf-output" events associated with "__augmented_syscalls__" BPF map Add an example BPF script that writes syscalls:sys_enter_openat raw tracepoint payloads augmented with the first 64 bytes of the "filename" syscall pointer arg. Then catch it and print it just like with things written to the "__bpf_stdout__" map associated with a PERF_COUNT_SW_BPF_OUTPUT software event, by just letting the default tracepoint handler in 'perf trace', trace__event_handler(), to use bpf_output__fprintf(trace, sample), just like it does with all other PERF_COUNT_SW_BPF_OUTPUT events, i.e. just do a dump on the payload, so that we can check if what is being printed has at least the first 64 bytes of the "filename" arg: The augmented_syscalls.c eBPF script: # cat tools/perf/examples/bpf/augmented_syscalls.c // SPDX-License-Identifier: GPL-2.0 #include struct bpf_map SEC("maps") __augmented_syscalls__ = { .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, .key_size = sizeof(int), .value_size = sizeof(u32), .max_entries = __NR_CPUS__, }; struct syscall_enter_openat_args { unsigned long long common_tp_fields; long syscall_nr; long dfd; char *filename_ptr; long flags; long mode; }; struct augmented_enter_openat_args { struct syscall_enter_openat_args args; char filename[64]; }; int syscall_enter(openat)(struct syscall_enter_openat_args *args) { struct augmented_enter_openat_args augmented_args; probe_read(&augmented_args.args, sizeof(augmented_args.args), args); probe_read_str(&augmented_args.filename, sizeof(augmented_args.filename), args->filename_ptr); perf_event_output(args, &__augmented_syscalls__, BPF_F_CURRENT_CPU, &augmented_args, sizeof(augmented_args)); return 1; } license(GPL); # So it will just prepare a raw_syscalls:sys_enter payload for the "openat" syscall. This will eventually be done for all syscalls with pointer args, globally or just when the user asks, using some spec, which args of which syscalls it wants "expanded" this way, we'll probably start with just all the syscalls that have char * pointers with familiar names, the ones we already handle with the probe:vfs_getname kprobe if it is in place hooking the kernel getname_flags() function used to copy from user the paths. Running it we get: # perf trace -e perf/tools/perf/examples/bpf/augmented_syscalls.c,openat cat /etc/passwd > /dev/null 0.000 ( ): __augmented_syscalls__:X?.C......................`\..................../etc/ld.so.cache..#......,....ao.k...............k......1."......... 0.006 ( ): syscalls:sys_enter_openat:dfd: CWD, filename: 0x5c600da8, flags: CLOEXEC 0.008 ( 0.005 ms): cat/31292 openat(dfd: CWD, filename: 0x5c600da8, flags: CLOEXEC ) = 3 0.036 ( ): __augmented_syscalls__:X?.C.......................\..................../lib64/libc.so.6......... .\....#........?.......=.C..../."......... 0.037 ( ): syscalls:sys_enter_openat:dfd: CWD, filename: 0x5c808ce0, flags: CLOEXEC 0.039 ( 0.007 ms): cat/31292 openat(dfd: CWD, filename: 0x5c808ce0, flags: CLOEXEC ) = 3 0.323 ( ): __augmented_syscalls__:X?.C.....................P....................../etc/passwd......>.C....@................>.C.....,....ao.>.C........ 0.325 ( ): syscalls:sys_enter_openat:dfd: CWD, filename: 0xe8be50d6 0.327 ( 0.004 ms): cat/31292 openat(dfd: CWD, filename: 0xe8be50d6 ) = 3 # We need to go on optimizing this to avoid seding trash or zeroes in the pointer content payload, using the return from bpf_probe_read_str(), but to keep things simple at this stage and make incremental progress, lets leave it at that for now. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-g360n1zbj6bkbk6q0qo11c28@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 8fa25f303adfed6eab921db8e242e59dd0b3b004 Author: Arnaldo Carvalho de Melo Date: Tue Aug 7 15:10:19 2018 -0300 perf bpf: Add wrappers to BPF_FUNC_probe_read(_str) functions Will be used shortly in the augmented syscalls work together with a PERF_COUNT_SW_BPF_OUTPUT software event to insert syscalls + pointer contents in the perf ring buffer, to be consumed by 'perf trace' beautifiers. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-ajlkpz4cd688ulx1u30htkj3@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit aa31be3a4874d91fb40d872f1865805ab411035c Author: Arnaldo Carvalho de Melo Date: Mon Aug 6 11:35:37 2018 -0300 perf bpf: Add bpf__setup_output_event() strerror() counterpart That is just bpf__strerror_setup_stdout() renamed to the more general "setup_output_event" method, keep the existing stdout() as a wrapper. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-nwnveo428qn0b48axj50vkc7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 92bbe8d834d293c4db7a70fd53884ec1c95d61dc Author: Arnaldo Carvalho de Melo Date: Mon Aug 6 09:53:35 2018 -0300 perf bpf: Generalize bpf__setup_stdout() We will use it to set up other bpf-output events, for instance to generate augmented syscall entry tracepoints with pointer contents. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-4r7kw0nsyi4vyz6xm1tzx6a3@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5941d856a90435b32a3296c0b7df8f0075430b81 Author: Arnaldo Carvalho de Melo Date: Mon Aug 6 09:46:33 2018 -0300 perf bpf: Make bpf__for_each_stdout_map() generic By passing a 'name' arg, that will eventually be used to setup more "bpf-output" events, e.g. to create a event where to create raw_syscalls like events that in addition to the syscall arguments will also copy the pointer contents being passed from/to userspace. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-talrnxps9p3qozk3aeh91fgv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 53a5d7b80032fcf48cdc5a6c96c8dc8a120b64ef Author: Arnaldo Carvalho de Melo Date: Mon Aug 6 09:15:18 2018 -0300 perf bpf: Add bpf/stdio.h wrapper to bpf_perf_event_output function That, together with the map __bpf_output__ that is already handled by 'perf trace' to print that event's contents as strings provides a debugging facility, to show it in use, print a simple string everytime the syscalls:sys_enter_openat() syscall tracepoint is hit: # cat tools/perf/examples/bpf/hello.c #include int syscall_enter(openat)(void *args) { puts("Hello, world\n"); return 0; } license(GPL); # # perf trace -e openat,tools/perf/examples/bpf/hello.c cat /etc/passwd > /dev/null 0.016 ( ): __bpf_stdout__:Hello, world 0.018 ( 0.010 ms): cat/9079 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC) = 3 0.057 ( ): __bpf_stdout__:Hello, world 0.059 ( 0.011 ms): cat/9079 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC) = 3 0.417 ( ): __bpf_stdout__:Hello, world 0.419 ( 0.009 ms): cat/9079 openat(dfd: CWD, filename: /etc/passwd) = 3 # This is part of an ongoing experimentation on making eBPF scripts as consumed by perf to be as concise as possible and using familiar concepts such as stdio.h functions, that end up just wrapping the existing BPF functions, trying to hide as much boilerplate as possible while using just conventions and C preprocessor tricks. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-4tiaqlx5crf0fwpe7a6j84x7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7402e543a74a08ae630234012356ff5cf947bd61 Author: Arnaldo Carvalho de Melo Date: Mon Aug 6 09:02:26 2018 -0300 perf bpf: Add struct bpf_map struct A helper structure used by eBPF C program to describe map attributes to elf_bpf loader, to be used initially by the special __bpf_stdout__ map used to print strings into the perf ring buffer in BPF scripts, e.g.: Using the upcoming stdio.h and puts() macros to use the __bpf_stdout__ map to add strings to the ring buffer: # cat tools/perf/examples/bpf/hello.c #include int syscall_enter(openat)(void *args) { puts("Hello, world\n"); return 0; } license(GPL); # # cat ~/.perfconfig [llvm] dump-obj = true # perf trace -e openat,tools/perf/examples/bpf/hello.c/call-graph=dwarf/ cat /etc/passwd > /dev/null LLVM: dumping tools/perf/examples/bpf/hello.o 0.016 ( ): __bpf_stdout__:Hello, world 0.018 ( 0.010 ms): cat/9079 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3 0.057 ( ): __bpf_stdout__:Hello, world 0.059 ( 0.011 ms): cat/9079 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC ) = 3 0.417 ( ): __bpf_stdout__:Hello, world 0.419 ( 0.009 ms): cat/9079 openat(dfd: CWD, filename: /etc/passwd ) = 3 # # file tools/perf/examples/bpf/hello.o tools/perf/examples/bpf/hello.o: ELF 64-bit LSB relocatable, *unknown arch 0xf7* version 1 (SYSV), not stripped # readelf -SW tools/perf/examples/bpf/hello.o There are 10 section headers, starting at offset 0x208: Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [ 0] NULL 0000000000000000 000000 000000 00 0 0 0 [ 1] .strtab STRTAB 0000000000000000 000188 00007f 00 0 0 1 [ 2] .text PROGBITS 0000000000000000 000040 000000 00 AX 0 0 4 [ 3] syscalls:sys_enter_openat PROGBITS 0000000000000000 000040 000088 00 AX 0 0 8 [ 4] .relsyscalls:sys_enter_openat REL 0000000000000000 000178 000010 10 9 3 8 [ 5] maps PROGBITS 0000000000000000 0000c8 00001c 00 WA 0 0 4 [ 6] .rodata.str1.1 PROGBITS 0000000000000000 0000e4 00000e 01 AMS 0 0 1 [ 7] license PROGBITS 0000000000000000 0000f2 000004 00 WA 0 0 1 [ 8] version PROGBITS 0000000000000000 0000f8 000004 00 WA 0 0 4 [ 9] .symtab SYMTAB 0000000000000000 000100 000078 18 1 1 8 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), p (processor specific) # readelf -s tools/perf/examples/bpf/hello.o Symbol table '.symtab' contains 5 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 5 __bpf_stdout__ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 7 _license 3: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 8 _version 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 3 syscall_enter_openat # Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-81fg60om2ifnatsybzwmiga3@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e6902d1b7326149952abf8e7f07513e254668e52 Author: Jiri Olsa Date: Sat Aug 4 15:05:21 2018 +0200 perf report: Add --percent-type option Set annotation percent type from following choices: global-period, local-period, global-hits, local-hits With following report option setup the percent type will be passed to annotation browser: $ perf report --percent-type period-local The local/global keywords set if the percentage is computed in the scope of the function (local) or the whole data (global). The period/hits keywords set the base the percentage is computed on - the samples period or the number of samples (hits). Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-21-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 88c211907720f9eb23308401305aefa25392417f Author: Jiri Olsa Date: Sat Aug 4 15:05:20 2018 +0200 perf annotate: Add --percent-type option Add --percent-type option to set annotation percent type from following choices: global-period, local-period, global-hits, local-hits Examples: $ perf annotate --percent-type period-local --stdio | head -1 Percent | Source code ... es, percent: local period) $ perf annotate --percent-type hits-local --stdio | head -1 Percent | Source code ... es, percent: local hits) $ perf annotate --percent-type hits-global --stdio | head -1 Percent | Source code ... es, percent: global hits) $ perf annotate --percent-type period-global --stdio | head -1 Percent | Source code ... es, percent: global period) The local/global keywords set if the percentage is computed in the scope of the function (local) or the whole data (global). The period/hits keywords set the base the percentage is computed on - the samples period or the number of samples (hits). Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-20-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4c04868fbe931ec315ad34bb7e28e5cf725f88e4 Author: Jiri Olsa Date: Sat Aug 4 15:05:19 2018 +0200 perf annotate: Display percent type in stdio output In following patches we will allow to switch percent type even for stdio annotation outputs. Adding the percent type value into the annotation outputs title. $ perf annotate --stdio Percent | Sou ... instructions:u } (2805 samples, percent: local period) --------------------------- ... ------------------------------------------------------ ... $ perf annotate --stdio2 Samples: 2K of events 'anon ... count (approx.): 156525487, [percent: local period] safe_write.c() /usr/bin/yes Percent ... Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-19-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit addba8b66f9101b0e55a151fc543ff35990bc8ef Author: Jiri Olsa Date: Sat Aug 4 15:05:18 2018 +0200 perf annotate: Make local period the default percent type Currently we display the percentages in annotation output based on number of samples hits. Switching it to period based percentage by default, because it corresponds more to the time spent on the line. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-18-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 3e0d79531984c731951d9a8a5be406df3a78ac97 Author: Jiri Olsa Date: Sat Aug 4 15:05:17 2018 +0200 perf annotate: Add support to toggle percent type Add new key bindings to toggle percent type/base in annotation UI browser: 'p' to switch between local and global percent type 'b' to switch between hits and perdio percent base Add the following help messages to the UI browser '?' window: ... p Toggle percent type [local/global] b Toggle percent base [period/hits] ... Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-17-jolsa@kernel.org [ Moved percent_type to be the last arg to sym_title(), its an arg to what is being formmated (buf, size) ] Signed-off-by: Arnaldo Carvalho de Melo commit d4265b1a1b9b58df9c3bc0a3a7aa5b72c079c77a Author: Jiri Olsa Date: Sat Aug 4 15:05:16 2018 +0200 perf annotate: Pass browser percent_type in annotate_browser__calc_percent() Pass browser percent_type in annotate_browser__calc_percent(). Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-16-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4c650ddc2e9e8f1d8dc46f13b30b1b9a6017fb02 Author: Jiri Olsa Date: Sat Aug 4 15:05:15 2018 +0200 perf annotate: Pass 'struct annotation_options' to map_symbol__annotation_dump() Pass 'struct annotation_options' to map_symbol__annotation_dump(), to carry on and pass the percent_type value. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-15-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c849c12cf344e4b99dbf98df642b622b6c91bbfd Author: Jiri Olsa Date: Sat Aug 4 15:05:14 2018 +0200 perf annotate: Pass struct annotation_options to symbol__calc_lines() Pass struct annotation_options to symbol__calc_lines(), to carry on and pass the percent_type value. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-14-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 796ca33d5ceb621f238021c34cff8cfaa1100623 Author: Jiri Olsa Date: Sat Aug 4 15:05:13 2018 +0200 perf annotate: Add percent_type to struct annotation_options It will be used to carry user selection of percent type for annotation output. Passing the percent_type to the annotation_line__print function as the first step and making it default to current percentage type (PERCENT_HITS_LOCAL) value. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-13-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e58684df912906d944967e2ce0f3ed5d5140d1e5 Author: Jiri Olsa Date: Sat Aug 4 15:05:12 2018 +0200 perf annotate: Add PERCENT_PERIOD_GLOBAL percent value Adding and computing global period percent value for annotation line. Storing it in struct annotation_data percent array under new PERCENT_PERIOD_GLOBAL index. At the moment it's not displayed, it's coming in following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-12-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ab371169fb7db9587f09137e93a49c6afeab16f7 Author: Jiri Olsa Date: Sat Aug 4 15:05:11 2018 +0200 perf annotate: Add PERCENT_PERIOD_LOCAL percent value Adding and computing local period percent value for annotation line. Storing it in struct annotation_data percent array under new PERCENT_PERIOD_LOCAL index. At the moment it's not displayed, it's coming in following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-11-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 75a8c1ff287b2a949b50c1c1e58a6492e21a3ac5 Author: Jiri Olsa Date: Sat Aug 4 15:05:10 2018 +0200 perf annotate: Add PERCENT_HITS_GLOBAL percent value Adding and computing global hits percent value for annotation line. Storing it in struct annotation_data percent array under new PERCENT_HITS_GLOBAL index. At the moment it's not displayed, it's coming in following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-10-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6d9f0c2d5ef7568c29fa5927748c4915a9c7760a Author: Jiri Olsa Date: Sat Aug 4 15:05:09 2018 +0200 perf annotate: Switch struct annotation_data::percent to array So we can hold multiple percent values for annotation line. The first member of this array is current local hits percent value (PERCENT_HITS_LOCAL index), so no functional change is expected. Adding annotation_data__percent function to return requested percent value from struct annotation_data. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-9-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2bcf73069b0722c92a84c0fd57df542890a74904 Author: Jiri Olsa Date: Sat Aug 4 15:05:08 2018 +0200 perf annotate: Loop group events directly in annotation__calc_percent() We need to bring in 'struct hists' object and for that we need 'struct perf_evsel' object in the scope. Switching the group data loop with the evsel group loop. It does the same thing, but it brings evsel object, that we can use later get the 'struct hists' object. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-8-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 48a1e4f2381387a097ea9f7897c5c32e9aaa708d Author: Jiri Olsa Date: Sat Aug 4 15:05:07 2018 +0200 perf annotate: Rename hist to sym_hist in annotation__calc_percent We will need to bring in 'struct hists' variable in this scope, so it's better we do this rename first. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-7-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0440af74dcd0f32b134b1c4d47dc25f0bb539ded Author: Jiri Olsa Date: Sat Aug 4 15:05:06 2018 +0200 perf annotate: Rename local sample variables to data Based on previous rename, changing also the local variable names to fit properly. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-6-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c2f938ba5aa61ba60e9217848e666c783cbcce1c Author: Jiri Olsa Date: Sat Aug 4 15:05:05 2018 +0200 perf annotate: Rename struct annotation_line::samples* to data* The name 'samples*' is little confusing because we have nested 'struct sym_hist_entry' under annotation_line struct, which holds 'nr_samples' as well. Also the holding struct name is 'annotation_data' so the 'data' name fits better. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-5-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0683d13c1afbf5cca147b6f578d1463be132b11b Author: Jiri Olsa Date: Sat Aug 4 15:05:04 2018 +0200 perf annotate: Get rid of annotation__scnprintf_samples_period() We have more current function tto get the title for annotation, which is hists__scnprintf_title. They both have same output as far as the annotation's header line goes. They differ in counting of the nr_samples, hists__scnprintf_title provides more accurate number based on the setup of the symbol_conf.filter_relative variable. Plus it also displays any uid/thread/dso/socket filters/zooms if there are set any, which annotation__scnprintf_samples_period does not. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5ecf7d30eb4f9c046f5284f20133d7b69729c315 Author: Jiri Olsa Date: Sat Aug 4 15:05:03 2018 +0200 perf annotate: Make annotation_line__max_percent static There's no outside user of it. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7a3e71e0d806070071f53271705b0c511c0359fc Author: Jiri Olsa Date: Sat Aug 4 15:05:02 2018 +0200 perf annotate: Make symbol__annotate_fprintf2() local There's no outside user of it. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lkml.kernel.org/r/20180804130521.11408-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit dda9ac966d39cec5a501b0b4d0210b3c2a167e6c Author: Arnaldo Carvalho de Melo Date: Fri Aug 3 16:28:35 2018 -0300 perf bpf: Add 'syscall_enter' probe helper for syscall enter tracepoints Allowing one to hook into the syscalls:sys_enter_NAME tracepoints, an example is provided that hooks into the 'openat' syscall. Using it with the probe:vfs_getname probe into getname_flags to get the filename args as it is copied from userspace: # perf probe -l probe:vfs_getname (on getname_flags:73@acme/git/linux/fs/namei.c with pathname) # perf trace -e probe:*getname,tools/perf/examples/bpf/sys_enter_openat.c cat /etc/passwd > /dev/null 0.000 probe:vfs_getname:(ffffffffbd2a8983) pathname="/etc/ld.so.preload" 0.022 syscalls:sys_enter_openat:dfd: CWD, filename: 0xafbe8da8, flags: CLOEXEC 0.027 probe:vfs_getname:(ffffffffbd2a8983) pathname="/etc/ld.so.cache" 0.054 syscalls:sys_enter_openat:dfd: CWD, filename: 0xafdf0ce0, flags: CLOEXEC 0.057 probe:vfs_getname:(ffffffffbd2a8983) pathname="/lib64/libc.so.6" 0.316 probe:vfs_getname:(ffffffffbd2a8983) pathname="/usr/lib/locale/locale-archive" 0.375 syscalls:sys_enter_openat:dfd: CWD, filename: 0xe2b2b0b4 0.379 probe:vfs_getname:(ffffffffbd2a8983) pathname="/etc/passwd" # Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-2po9jcqv1qgj0koxlg8kkg30@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 3c8b81864080b710bdce446fd8401923f26fc4d4 Author: Yury Norov Date: Sat Jun 23 10:35:01 2018 +0300 perf tools: Drop unneeded bitmap_zero() calls bitmap_zero() is called after bitmap_alloc() in perf code. But bitmap_alloc() internally uses calloc() which guarantees that allocated area is zeroed. So following bitmap_zero is unneeded. Drop it. This happened because of confusing name for bitmap allocator. It should has name bitmap_zalloc instead of bitmap_alloc. This series: https://lkml.org/lkml/2018/6/18/841 introduces a new API for bitmap allocations in kernel, and functions there are named correctly. Following patch propogates the API to tools, and fixes naming issue. Signed-off-by: Yury Norov Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Morton Cc: Andriy Shevchenko Cc: David Ahern Cc: David Carrillo-Cisneros Cc: Dmitry Torokhov Cc: Jin Yao Cc: Jiri Olsa Cc: Kate Stewart Cc: Matthew Wilcox Cc: Mike Snitzer Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Philippe Ombredanne Link: http://lkml.kernel.org/r/20180623073502.16321-1-ynorov@caviumnetworks.com Signed-off-by: Arnaldo Carvalho de Melo commit 704089e77acf74b17ed294683660937000ecb9ee Author: Sean V Kelley Date: Thu Aug 2 21:18:11 2018 -0700 perf vendor events arm64: Enable JSON events for eMAG This patch adds the Ampere Computing eMAG file. This platform follows the ARMv8 recommended IMPLEMENTATION DEFINED events, where applicable. Signed-off-by: Sean V Kelley Reviewed-by: John Garry Cc: Alexander Shishkin Cc: Ganapatrao Kulkarni Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Cc: William Cohen Cc: linux-arm-kernel@lists.infradead.org LPU-Reference: 20180803041811.17065-1-seanvk.dev@oregontracks.org Signed-off-by: Arnaldo Carvalho de Melo commit 33d9e1832e528ff61f481558882ee0f82e288440 Author: Thomas Richter Date: Thu Aug 2 09:46:22 2018 +0200 perf report: Add GUI report support for s390 auxiliary trace Add support for s390 auxiliary trace support. Use 'perf record -e rbd000 -- ls' to create the perf.data file. Use 'perf report' to display the auxiliary trace data. Output before: [root@s35lp76 perf]# ./perf report --stdio 0x128 [0x10]: failed to process type: 70 Error: failed to process sample [root@s35lp76 perf]# Output after: [root@s35lp76 perf]# ./perf report --stdio 18.21% 18.21% ls [kernel.kallsyms] [k] ftrace_likely_update 9.52% 9.52% ls [kernel.kallsyms] [k] lock_acquire 9.38% 9.38% ls [kernel.kallsyms] [k] lock_release 3.45% 3.45% ls [kernel.kallsyms] [k] lock_acquired 2.88% 2.88% ls [kernel.kallsyms] [k] link_path_walk 2.63% 2.63% ls [kernel.kallsyms] [k] __d_lookup 2.38% 2.38% ls [kernel.kallsyms] [k] __d_lookup_rcu 2.04% 2.04% ls [kernel.kallsyms] [k] ___might_sleep 1.83% 1.83% ls [kernel.kallsyms] [k] debug_lockdep_rcu_enabled 1.44% 1.44% ls [kernel.kallsyms] [k] dput .... Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180802074622.13641-4-tmricht@linux.ibm.com [ Use PRI[xd]64 to fix the build on debian:experimental-x-mips (gcc 8.1.0) and others ] Signed-off-by: Arnaldo Carvalho de Melo commit 2f295f91b740f0055735a7528f8f4cf8b3111239 Author: Connor McAdams Date: Wed Aug 8 13:34:22 2018 -0400 ALSA: hda/ca0132 - Add exit commands for Recon3D This patch adds exit functions for the Recon3D, and cleans up the current exit function. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit e25e3445049c353223752fd1bacead9d413b0a5a Author: Connor McAdams Date: Wed Aug 8 13:34:21 2018 -0400 ALSA: hda/ca0132 - Change mixer controls for Recon3D This patch adds changes to setup the Recon3D's mixer controls. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit 42aa3a169062c48e5cbb1f3a6523f8b7c892b699 Author: Connor McAdams Date: Wed Aug 8 13:34:20 2018 -0400 ALSA: hda/ca0132 - Add Recon3D input and output select commands This patch adds commands to the alternative input and output select commands to support the Recon3D. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit c986f50ca974397f8726bf6776ad8938d6808848 Author: Connor McAdams Date: Wed Aug 8 13:34:19 2018 -0400 ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D The Recon3D can use many of the same functions as the Recon3Di, so many of the r3di prefix function remain the same, but change their names to the more generic r3d prefix. This patch does this, and adds quirk checks for things specific to the Recon3Di. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit e42c7c7313e41f121d252711e35deae7964c95ad Author: Connor McAdams Date: Wed Aug 8 13:34:18 2018 -0400 ALSA: hda/ca0132 - Add Recon3D startup functions and setup This patch adds functions for Recon3D startup, and sets values for things such as use_pci_mmio. It also renames some functions and tables from the sbz prefix into ca0132, as the Recon3D uses them as well. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit 08eca6b1f1468a4021bac7b3929fd3eb491e2629 Author: Connor McAdams Date: Wed Aug 8 13:34:17 2018 -0400 ALSA: hda/ca0132 - Add bool variable to enable/disable pci region2 mmio This patch adds the ability to choose whether or not to map the pci region2, which is used for things such as GPIO on the Recon3D and Sound Blaster Z. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit 7f73df95401f7a2392ccf1880ba1e54cfed62779 Author: Connor McAdams Date: Wed Aug 8 13:34:16 2018 -0400 ALSA: hda/ca0132 - Add Recon3D pincfg This patch adds pin configs from the Recon3D, taken from the Window's driver. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit 8f8c523c4604afe231196920bf08310141a4f0ba Author: Connor McAdams Date: Wed Aug 8 13:34:15 2018 -0400 ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D This patch adds the PCI subsys ID for the Recon3D that has been tested, and adds the QUIRK_R3D enumeration. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit a1b7f016a1ae5e51f0e11a70cf1a5875d3ccee73 Author: Connor McAdams Date: Wed Aug 8 13:34:14 2018 -0400 ALSA: hda/ca0132 - Add alt_functions unsolicited response This patch fixes a previous oversight where the microphone unsolicited response would use the wrong input selection function. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit d97420d2b0379e498adc3fae5db8fa70945b5d56 Author: Connor McAdams Date: Wed Aug 8 13:34:13 2018 -0400 ALSA: hda/ca0132 - Clean up ca0132_init function. This patch cleans up ca0132_init by removing unnecessary commands and ordering things better. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit a62e4739473a29646af4e37a5da289795cde6dc0 Author: Connor McAdams Date: Wed Aug 8 13:34:12 2018 -0400 ALSA: hda/ca0132 - Create mmio gpio function to make code clearer This patch adds a new function, ca0132_mmio_gpio_set, to clear up what is going on with writes to mmio region 0x320. Signed-off-by: Connor McAdams Signed-off-by: Takashi Iwai commit 2b1444f2e28be94b8f0b37376e1c619fd8cad63b Author: Thomas Richter Date: Thu Aug 2 09:46:21 2018 +0200 perf report: Add raw report support for s390 auxiliary trace Add support for s390 auxiliary trace support. Use 'perf record -e rbd000' to create the perf.data file. The event also has the symbolic name SF_CYCLES_BASIC_DIAG, using 'perf record -e SF_CYCLES_BASIC_DIAG' is equivalent. Use 'perf report -D' to display the auxiliary trace data. Output before: 0 0 0x25a66 [0x30]: PERF_RECORD_AUXTRACE size: 0x40000 offset: 0 ref: 0 idx: 4 tid: -1 cpu: 4 Nothing else Output after: 0 0 0x25a66 [0x30]: PERF_RECORD_AUXTRACE size: 0x40000 offset: 0 ref: 0 idx: 4 tid: -1 cpu: 4 . . ... s390 AUX data: size 262144 bytes [00000000] Basic Def:0001 Inst:0000 TW AS:3 ASN:0xffff IA:0x0000000000c2f1bc CL:1 HPP:0x8000000000000000 GPP:000000000000000000 [0x000020] Diag Def:8005 [0x0000bf] Basic Def:0001 Inst:0000 TW AS:3 ASN:0xffff IA:0x0000000000c2f1bc CL:1 HPP:0x8000000000000000 GPP:000000000000000000 [0x0000df] Diag Def:8005 [0x00017e] Basic Def:0001 Inst:0000 TW AS:3 ASN:0xffff IA:0x0000000000c2f1bc CL:1 HPP:0x8000000000000000 GPP:000000000000000000 .... [0x000fc0] Trailer F T bsdes:32 dsdes:159 Overflow:0 Time:0xd4ab59a8450fa108 C:1 TOD:0xd4ab4ec98ceb3832 1:0x8000000000000000 2:0xd4ab4ec98ceb3832 This output is shown for every sampled data block. The output contains the - basic-sampling data entry - diagnostic-sampling data entry - trailer entry The basic sampling entry and diagnostic sampling entry sizes can be extracted using the trailer entries in the SDB. On older hardware these values (bsdes and dsdes in the trailer entry) are reserved and zero. Older hardware use hard coded values based on the s390 machine type. Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Heiko Carstens Cc: Martin Schwidefsky Cc: Michael Ellerman Link: http://lkml.kernel.org/r/20180802074622.13641-3-tmricht@linux.ibm.com Link: http://lkml.kernel.org/r/eda2632e-7919-5ffd-5f68-821e77d216fa@linux.ibm.com [ Merged a fix for a 'tipe puned' problem reported by Michael Ellerman see last Link tag. ] [ Removed __packed from two structs, they're already naturally packed and having that. ] [ attribute breaks the build in gcc 8.1.1 mips, 4.4.7 x86_64, 7.1.1 ARCompact ISA, etc) ] Signed-off-by: Arnaldo Carvalho de Melo commit ed9800100f1a70154c11cfa0ccc0b9ff51e3436a Author: Marcus Folkesson Date: Wed Aug 8 11:20:59 2018 -0700 MAINTAINERS: Add PhoenixRC Flight Controller Adapter Add MAINTAINERS entry for PhoenixRC Flight Controller Adapter Signed-off-by: Marcus Folkesson Signed-off-by: Dmitry Torokhov commit 100294cee9a98bfd4d6cb2d1c8a8aef0e959b0c4 Author: Dmitry Torokhov Date: Mon Aug 6 15:10:40 2018 -0700 Input: do not use WARN() in input_alloc_absinfo() Some of fuzzers set panic_on_warn=1 so that they can handle WARN()ings the same way they handle full-blown kernel crashes. We used WARN() in input_alloc_absinfo() to get a better idea where memory allocation failed, but since then kmalloc() and friends started dumping call stack on memory allocation failures anyway, so we are not getting anything extra from WARN(). Because of the above, let's replace WARN with dev_err(). We use dev_err() instead of simply removing message and relying on kcalloc() to give us stack dump so that we'd know the instance of hardware device to which we were trying to attach input device. Reported-by: Dmitry Vyukov Acked-by: Dmitry Vyukov Signed-off-by: Dmitry Torokhov commit 17a4ed5545c5599852a5d75c5fb2c8e597943f99 Author: Gustavo A. R. Silva Date: Mon Aug 6 15:31:02 2018 -0700 Input: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Dmitry Torokhov commit 6cad4e269e25dddd7260a53e9d9d90ba3a3cc35a Author: Gustavo A. R. Silva Date: Mon Aug 6 15:20:19 2018 -0700 Input: raydium_i2c_ts - use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Dmitry Torokhov commit e7ea2a52ffaf60a211edc0df97dcf194d1257714 Author: Wei Yongjun Date: Wed Aug 8 03:23:44 2018 +0000 netfilter: nfnetlink_osf: fix using plain integer as NULL warning Fixes the following sparse warning: net/netfilter/nfnetlink_osf.c:274:24: warning: Using plain integer as NULL pointer Signed-off-by: Wei Yongjun Signed-off-by: Pablo Neira Ayuso commit da33a871ba178dbe81da7d755818d3c2088cae32 Author: Jeff Layton Date: Wed Aug 8 12:54:09 2018 -0400 locks: remove misleading obsolete comment The spinlock handling in this file has changed significantly since this comment was written, and the file_lock_lock is no more. In addition, this overall comment no longer applies. Deleting an entry now requires both locks. Signed-off-by: Jeff Layton commit 02eec6c9fc0cb13169cc97a6139771768791f92b Author: Paul Burton Date: Wed Aug 8 09:30:56 2018 -0700 MIPS: netlogic: xlr: Remove erroneous check in nlm_fmn_send() In nlm_fmn_send() we have a loop which attempts to send a message multiple times in order to handle the transient failure condition of a lack of available credit. When examining the status register to detect the failure we check for a condition that can never be true, which falls foul of gcc 8's -Wtautological-compare: In file included from arch/mips/netlogic/common/irq.c:65: ./arch/mips/include/asm/netlogic/xlr/fmn.h: In function 'nlm_fmn_send': ./arch/mips/include/asm/netlogic/xlr/fmn.h:304:22: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] if ((status & 0x2) == 1) ^~ If the path taken if this condition were true all we do is print a message to the kernel console. Since failures seem somewhat expected here (making the console message questionable anyway) and the condition has clearly never evaluated true we simply remove it, rather than attempting to fix it to check status correctly. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20174/ Cc: Ganesan Ramalingam Cc: James Hogan Cc: Jayachandran C Cc: John Crispin Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 9c2956d2ad9e0e7d5827290ba9a716ed3fb83bcd Author: Zhao Chen Date: Wed Aug 8 06:37:30 2018 +0000 net-next: hinic: fix a problem in free_tx_poll() This patch fixes the problem below. The problem can be reproduced by the following steps: 1) Connecting all HiNIC interfaces 2) On server side # sudo ifconfig eth0 192.168.100.1 up #Using MLX CX4 card # iperf -s 3) On client side # sudo ifconfig eth0 192.168.100.2 up #Using our HiNIC card # iperf -c 192.168.101.1 -P 10 -t 100000 after hours of testing, we will see errors: hinic 0000:05:00.0: No MGMT msg handler, mod = 0 hinic 0000:05:00.0: No MGMT msg handler, mod = 0 hinic 0000:05:00.0: No MGMT msg handler, mod = 0 hinic 0000:05:00.0: No MGMT msg handler, mod = 0 The errors are caused by the following problem. 1) The hinic_get_wqe() checks the "wq->delta" to allocate new WQEs: if (atomic_sub_return(num_wqebbs, &wq->delta) <= 0) { atomic_add(num_wqebbs, &wq->delta); return ERR_PTR(-EBUSY); } If the WQE occupies multiple pages, the shadow WQE will be used. Then the hinic_xmit_frame() fills the WQE. 2) While in parallel with 1), the free_tx_poll() checks the "wq->delta" to free old WQEs: if ((atomic_read(&wq->delta) + num_wqebbs) > wq->q_depth) return ERR_PTR(-EBUSY); There is a probability that the shadow WQE which hinic_xmit_frame() is using will be damaged by copy_wqe_to_shadow(): if (curr_pg != end_pg) { void *shadow_addr = &wq->shadow_wqe[curr_pg * wq->max_wqe_size]; copy_wqe_to_shadow(wq, shadow_addr, num_wqebbs, *cons_idx); return shadow_addr; } This can cause WQE data error and you will see the above error messages. This patch fixes the problem. Signed-off-by: Zhao Chen Signed-off-by: David S. Miller commit 5a0c6cee1767a551dacfa6e266ac4795bba0555e Author: zhong jiang Date: Tue Aug 7 19:20:09 2018 +0800 net:mod: remove unneeded variable 'ret' in init_p9 The ret is modified after initalization, so just remove it and return 0. Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit fb3b467e067385748445c5295fdbde548b631cb2 Author: zhong jiang Date: Tue Aug 7 19:20:08 2018 +0800 net:af_iucv: get rid of the unneeded variable 'err' in afiucv_pm_freeze We will not use the variable 'err' after initalization, So remove it and return 0. Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit 605391d0f4bfdff2f2c6c5477ce0ccf776d8d5c0 Author: Richard Fitzgerald Date: Wed Aug 8 17:13:39 2018 +0100 ASoC: wm_adsp: Make DSP name configurable by codec driver Instead of harcoding that a core must always be called "DSPn" add a name member to struct wm_adsp so that the owning codec driver can provide a custom name. This allows for re-use of the wm_adsp driver with parts where the processing cores are named differently. If no name is provided the default DSPn name is used. Signed-off-by: Richard Fitzgerald Signed-off-by: Mark Brown commit 35ef57a4190d4253b73720cf0402158eda0f1bc8 Merge: 0a047f07525f 0717edbdfed6 Author: Mark Brown Date: Wed Aug 8 17:32:10 2018 +0100 Merge branch 'asoc-4.18' into asoc-4.19 wmadsp dep commit 0a047f07525fecfa8f6fccc5d30afff7e816de8d Author: Richard Fitzgerald Date: Wed Aug 8 17:13:38 2018 +0100 ASoC: wm_adsp: Declare firmware controls from codec driver To allow for more flexibility in naming of DSP-type cores move the creation of the firmware controls to the codec drivers instead of having a hardcoded list in wm_adsp. Signed-off-by: Richard Fitzgerald Signed-off-by: Mark Brown commit 212dfd909ea8b630e5d6fa4d25aeec9c4b4b14a5 Author: Fernando Fernandez Mancera Date: Tue Aug 7 22:06:52 2018 +0200 netfilter: nfnetlink_osf: add missing enum in nfnetlink_osf uapi header xt_osf_window_size_options was originally part of include/uapi/linux/netfilter/xt_osf.h, restore it. Fixes: bfb15f2a95cb ("netfilter: extract Passive OS fingerprint infrastructure from xt_osf") Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit a12fc00b237c25519cc861b56dd4ca41bbec4ed3 Author: zhong jiang Date: Wed Aug 8 23:22:47 2018 +0800 drivers/block/drbd: remove the null check for kmem_cache_destroy kmem_cache_destroy has taken null pointer into account. So it is safe to drop the null check before calling the function. Signed-off-by: zhong jiang Signed-off-by: Jens Axboe commit 61b717d041b1976530f68f8b539b2e3a7dd8e39c Author: Bart Van Assche Date: Tue Jun 26 08:39:36 2018 -0700 RDMA/rxe: Set wqe->status correctly if an unexpected response is received Every function that returns COMPST_ERROR must set wqe->status to another value than IB_WC_SUCCESS before returning COMPST_ERROR. Fix the only code path for which this is not yet the case. Signed-off-by: Bart Van Assche Cc: Reviewed-by: Yuval Shaia Signed-off-by: Jason Gunthorpe commit 2e51e45cf613491a2bd9d757f04e36d8617be5ac Author: Potnuri Bharat Teja Date: Fri Aug 3 18:26:47 2018 +0530 iw_cxgb4: pass window scale in flowc work request This will allow FW to not send more data to TP (which would then need to be buffered). Pass the negotiated TCP window scale to FW in the FLOWC WR. Also refactor send_flowc() a bit to clean it up. Signed-off-by: Steve Wise Signed-off-by: Potnuri Bharat Teja Signed-off-by: Jason Gunthorpe commit 0dfe452241f4904de497aef01ad2f609ccb9be90 Author: Leon Romanovsky Date: Wed Aug 1 14:25:41 2018 -0700 RDMA/mlx5: Fix shift overflow in mlx5_ib_create_wq [ 61.182439] UBSAN: Undefined behaviour in drivers/infiniband/hw/mlx5/qp.c:5366:34 [ 61.183673] shift exponent 4294967288 is too large for 32-bit type 'unsigned int' [ 61.185530] CPU: 0 PID: 639 Comm: qp Not tainted 4.18.0-rc1-00037-g4aa1d69a9c60-dirty #96 [ 61.186981] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014 [ 61.188315] Call Trace: [ 61.188661] dump_stack+0xc7/0x13b [ 61.190427] ubsan_epilogue+0x9/0x49 [ 61.190899] __ubsan_handle_shift_out_of_bounds+0x1ea/0x22f [ 61.197040] mlx5_ib_create_wq+0x1c99/0x1d50 [ 61.206632] ib_uverbs_ex_create_wq+0x499/0x820 [ 61.213892] ib_uverbs_write+0x77e/0xae0 [ 61.248018] vfs_write+0x121/0x3b0 [ 61.249831] ksys_write+0xa1/0x120 [ 61.254024] do_syscall_64+0x7c/0x2a0 [ 61.256178] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 61.259211] RIP: 0033:0x7f54bab70e99 [ 61.262125] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 [ 61.268678] RSP: 002b:00007ffe1541c318 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 61.271076] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f54bab70e99 [ 61.273795] RDX: 0000000000000070 RSI: 0000000020000240 RDI: 0000000000000003 [ 61.276982] RBP: 00007ffe1541c330 R08: 00000000200078e0 R09: 0000000000000002 [ 61.280035] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004005c0 [ 61.283279] R13: 00007ffe1541c420 R14: 0000000000000000 R15: 0000000000000000 Cc: # 4.7 Fixes: 79b20a6c3014 ("IB/mlx5: Add receive Work Queue verbs") Cc: syzkaller Reported-by: Noa Osherovich Signed-off-by: Leon Romanovsky Signed-off-by: Kees Cook Signed-off-by: Jason Gunthorpe commit d36b6ad27c7b95e3f6bfbf6ea33757c8e8accf01 Author: Kees Cook Date: Wed Aug 1 14:25:40 2018 -0700 test_overflow: Add shift overflow tests This adds overflow tests for the new check_shift_overflow() helper to validate overflow, signedness glitches, storage glitches, etc. Co-developed-by: Rasmus Villemoes Signed-off-by: Kees Cook Signed-off-by: Jason Gunthorpe commit 0c66847793d1982d1083dc6f7adad60fa265ce9c Author: Jason Gunthorpe Date: Wed Aug 1 14:25:39 2018 -0700 overflow.h: Add arithmetic shift helper Add shift_overflow() helper to assist driver authors in ensuring that shift operations don't cause overflows or other odd conditions. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky [kees: tweaked comments and commit log, dropped unneeded assignment] Signed-off-by: Kees Cook commit f5580d0f8bf60993a5fbc73ee04678070ffbba57 Author: Bob Peterson Date: Wed Aug 8 09:53:30 2018 -0500 gfs2: eliminate update_rgrp_lvb_unlinked Function update_rgrp_lvb_unlinked used to do the same thing as be32_add_cpu. This patch removes it in favor of using be32_add_cpu directly. Signed-off-by: Bob Peterson Reviewed-by: Andrew Price commit 69daf897d75b31ff90031bb0a49a8d65cedfe3ca Author: zhong jiang Date: Wed Aug 8 23:00:35 2018 +0800 drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy mempool_destroy has taken the null pointer into account. So it is safe to remove the null check. Signed-off-by: zhong jiang Signed-off-by: Jens Axboe commit d5fcc4e46e5168e6a6ce1e350ad0714a9d880c8e Author: zhong jiang Date: Wed Aug 8 22:58:33 2018 +0800 drivers/block/mtip32xx: remove the null check for debugfs_remove_recursive debugfs_remove_recursive has taken null pointer into account. So it is safe to drop the null check before calling the function. Signed-off-by: zhong jiang Signed-off-by: Jens Axboe commit 3596924a233e45aa918c961a902170fc4916461b Author: Roger Pau Monne Date: Wed Aug 8 13:46:41 2018 +0200 xen/balloon: fix balloon initialization for PVH Dom0 The current balloon code tries to calculate a delta factor for the balloon target when running in HVM mode in order to account for memory used by the firmware. This workaround for memory accounting doesn't work properly on a PVH Dom0, that has a static-max value different from the target value even at startup. Note that this is not a problem for DomUs because guests are started with a static-max value that matches the amount of RAM in the memory map. Fix this by forcefully setting target_diff for Dom0, regardless of it's mode. Reported-by: Gabriel Bercarug Signed-off-by: Roger Pau Monné Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit f23d0d449c169d94cc958196a1d088705ef26ebc Author: Thomas Petazzoni Date: Fri Aug 3 16:38:48 2018 +0200 PCI: mvebu: Drop bogus comment above mvebu_pcie_map_registers() This comment has been there since the driver was introduced, but seems to be a leftover from previous iterations of the driver. Indeed, we do not lookup in a list to find the register ranges that matches the given port/lane, as the "reg" property is in each sub-node representing a PCI port. There is no lookup involved at all. Signed-off-by: Thomas Petazzoni Signed-off-by: Lorenzo Pieralisi commit 42342073e38b50113354944cd51dcfed28d857a1 Author: Thomas Petazzoni Date: Fri Aug 3 16:38:47 2018 +0200 PCI: mvebu: Convert to use pci_host_bridge directly Rather than using the ARM-specific pci_common_init_dev() API, use the pci_host_bridge logic directly. Unfortunately, we can't use devm_of_pci_get_host_bridge_resources(), because the DT binding for describing PCIe apertures for this PCI controller is a bit special, and we cannot retrieve them from the 'ranges' property. Therefore, we still have some special code to handle this. Signed-off-by: Thomas Petazzoni Signed-off-by: Lorenzo Pieralisi commit 8179de98cd35242446f4c7a6ecdd73c6c41f0cfb Author: Mauro Carvalho Chehab Date: Wed Aug 8 09:54:49 2018 -0400 siano: get rid of an unused return code for debugfs register The siano's debugfs register logic is optional: it should be ok if it fails. So, no need to check if debufs register succeeded. Signed-off-by: Mauro Carvalho Chehab commit 6c33d826b5c468033c21d8653d148dd758bbab28 Author: Mauro Carvalho Chehab Date: Tue Aug 7 09:48:36 2018 -0400 media: isp: fix a warning about a wrong struct initializer As sparse complains: drivers/media/platform/omap3isp/isp.c:303:39: warning: Using plain integer as NULL pointer when a struct is initialized with { 0 }, actually the first element of the struct is initialized with zeros, initializing the other elements recursively. That can even generate gcc warnings on nested structs. So, instead, use the gcc-specific syntax for that (with is used broadly inside the Kernel), initializing it with {}; Signed-off-by: Mauro Carvalho Chehab commit dcefa533bd97922a3cac37f395247082be44600b Author: Mauro Carvalho Chehab Date: Tue Aug 7 09:25:37 2018 -0400 media: radio-wl1273: fix return code for the polling routine All poll handlers should return a poll flag, and not error codes. So, instead of returning an error, do the right thing here, e. g. to return EPOLERR on errors, just like the V4L2 VB2 code. Solves the following sparse warning: drivers/media/radio/radio-wl1273.c:1099:24: warning: incorrect type in return expression (different base types) drivers/media/radio/radio-wl1273.c:1099:24: expected restricted __poll_t drivers/media/radio/radio-wl1273.c:1099:24: got int Signed-off-by: Mauro Carvalho Chehab commit c46aa8491dd40d4ede5c9196c20d78e1e8c27786 Author: Mauro Carvalho Chehab Date: Tue Aug 7 09:23:33 2018 -0400 media: s3c-camif: fix return code for the polling routine All poll handlers should return a poll flag, and not error codes. So, instead of returning an error, do the right thing here, e. g. to return EPOLERR on errors, just like the V4L2 VB2 code. Solves the following sparse warning: drivers/media/platform/s3c-camif/camif-capture.c:604:21: warning: incorrect type in assignment (different base types) drivers/media/platform/s3c-camif/camif-capture.c:604:21: expected restricted __poll_t [usertype] ret drivers/media/platform/s3c-camif/camif-capture.c:604:21: got int Signed-off-by: Mauro Carvalho Chehab commit 9de1be6ec05a635079fbcf75c5d47f656b61fe4a Author: Mauro Carvalho Chehab Date: Tue Aug 7 09:18:26 2018 -0400 media: saa7164: fix return codes for the polling routine All poll handlers should return a poll flag, and not error codes. So, instead of returning an error, do the right thing at saa7164, e. g. to return EPOLERR on errors, just like the V4L2 VB2 code. Solves the following sparse warnings: drivers/media/pci/saa7164/saa7164-vbi.c:632:24: warning: incorrect type in return expression (different base types) drivers/media/pci/saa7164/saa7164-vbi.c:632:24: expected restricted __poll_t drivers/media/pci/saa7164/saa7164-vbi.c:632:24: got int drivers/media/pci/saa7164/saa7164-vbi.c:637:40: warning: incorrect type in return expression (different base types) drivers/media/pci/saa7164/saa7164-vbi.c:637:40: expected restricted __poll_t drivers/media/pci/saa7164/saa7164-vbi.c:637:40: got int drivers/media/pci/saa7164/saa7164-vbi.c:647:40: warning: incorrect type in return expression (different base types) drivers/media/pci/saa7164/saa7164-vbi.c:647:40: expected restricted __poll_t drivers/media/pci/saa7164/saa7164-vbi.c:647:40: got int Signed-off-by: Mauro Carvalho Chehab commit 541b647a34d36827bf06aa64c3a5e5936cffa10f Author: Mauro Carvalho Chehab Date: Tue Aug 7 09:15:27 2018 -0400 media: exynos-gsc: fix return code if mutex was interrupted All poll routines expect a poll flag, and not error codes. So, instead of returning -ERESTARTSYS if the mutex got interrupted, return EPOLERR, just like the V4L2 VB2 code. Solves this sparce warning: drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24: warning: incorrect type in return expression (different base types) drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24: expected restricted __poll_t drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24: got int Signed-off-by: Mauro Carvalho Chehab commit 484f9b372dd8da6a4a9867ebcd10e5c2b21ab478 Author: Jacopo Mondi Date: Tue Aug 7 11:38:14 2018 -0400 media: mt9v111: Fix build error with no VIDEO_V4L2_SUBDEV_API The v4l2_subdev_get_try_format() function is only defined if the VIDEO_V4L2_SUBDEV_API Kconfig option is enabled. Builds configured without that symbol fails with: drivers/media/i2c/mt9v111.c:801:10: error: implicit declaration of function 'v4l2_subdev_get_try_format'; Fix this by protecting the function call by testing for the right symbol. media: mt9v111: fix random build errors Fix the internal check for it to do the right thing if the subdev API is not built. Fixes: aab7ed1c ("media: i2c: Add driver for Aptina MT9V111") Reported-by: Randy Dunlap Reported-by: kbuild test robot Signed-off-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit 8218840f76a525f014f404b5e97d9523e327f4b0 Author: Mauro Carvalho Chehab Date: Tue Aug 7 08:16:09 2018 -0400 media: xc4000: get rid of uneeded casts Instead of doing casts, use %zd to print sizes, in order to make smatch happier: drivers/media/tuners/xc4000.c:818 xc4000_fwupload() warn: argument 4 to %d specifier is cast from pointer Signed-off-by: Mauro Carvalho Chehab commit c4f047969fa1707e1312e6600b630aef516e13c6 Author: Mauro Carvalho Chehab Date: Tue Aug 7 08:14:43 2018 -0400 media: drxj: get rid of uneeded casts Instead of doing casts, use %zd to print sizes, in order to make smatch happier: drivers/media/dvb-frontends/drx39xyj/drxj.c:11814 drx_ctrl_u_code() warn: argument 4 to %u specifier is cast from pointer drivers/media/dvb-frontends/drx39xyj/drxj.c:11845 drx_ctrl_u_code() warn: argument 3 to %u specifier is cast from pointer drivers/media/dvb-frontends/drx39xyj/drxj.c:11869 drx_ctrl_u_code() warn: argument 3 to %u specifier is cast from pointer drivers/media/dvb-frontends/drx39xyj/drxj.c:11878 drx_ctrl_u_code() warn: argument 3 to %u specifier is cast from pointer Signed-off-by: Mauro Carvalho Chehab commit 3fcb3c836ef413d3fc848288b308eb655e08d853 Author: Mauro Carvalho Chehab Date: Tue Aug 7 08:10:34 2018 -0400 media: tuner-xc2028: don't use casts for printing sizes Makes smatch happier by using %zd instead of casting sizes: drivers/media/tuners/tuner-xc2028.c:378 load_all_firmwares() warn: argument 4 to %d specifier is cast from pointer drivers/media/tuners/tuner-xc2028.c:619 load_firmware() warn: argument 6 to %d specifier is cast from pointer Signed-off-by: Mauro Carvalho Chehab commit 40e431112c63296a6130810ab62a5fe73953f074 Author: Mauro Carvalho Chehab Date: Tue Aug 7 07:59:20 2018 -0400 media: cleanup fall-through comments As Ian pointed out, adding a '-' to the fallthrough seems to meet the regex requirements at level 3 of the warning, at least when the comment fits into a single line. So, replace by a single line the comments that were broken into multiple lines just to make gcc -Wimplicit-fallthrough=3 happy. Suggested-by: Ian Arkver Signed-off-by: Mauro Carvalho Chehab commit 3354b54f9f7037a1122d3b6009aa9d39829d6843 Author: Mauro Carvalho Chehab Date: Tue Aug 7 07:29:12 2018 -0400 media: vivid: shut up warnings due to a non-trivial logic The vivid driver uses a complex logic to save one kalloc/kfree allocation. That non-trivial way of allocating data causes smatch to warn: drivers/media/platform/vivid/vivid-core.c:869 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]' drivers/media/platform/vivid/vivid-core.c:869 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]' I also needed to read the code several times in order to understand what it was desired there. It turns that the logic was right, although confusing to read. As it is doing allocations on a non-standard way, let's add some documentation while shutting up the false positive. Signed-off-by: Mauro Carvalho Chehab commit 845b978a871bff3707eee611b32e4be0b9a94dd2 Author: Mauro Carvalho Chehab Date: Tue Aug 7 06:49:26 2018 -0400 media: rtl28xxu: be sure that it won't go past the array size smatch warns that the RC query code could go past the array size: drivers/media/usb/dvb-usb-v2/rtl28xxu.c:1757 rtl2832u_rc_query() error: buffer overflow 'buf' 128 <= 130 drivers/media/usb/dvb-usb-v2/rtl28xxu.c:1758 rtl2832u_rc_query() error: buffer overflow 'buf' 128 <= 130 The driver logic gets the length of the IR RX buffer with: ret = rtl28xxu_rd_reg(d, IR_RX_BC, &buf[0]); ... len = buf[0]; In thesis, this could range between 0 and 255 [1]. While this should never happen in practice, due to hardware limits, smatch is right when it complains about that, as there's nothing at the logic that would prevent it. So, if for whatever reason, buf[0] gets filled by rtl28xx read functions with a value bigger than 128, it will go past the array. So, add an explicit check. [1] I've no idea why smatch thinks that the maximum value is 130. I double-checked the code several times. Was unable to find any reason for assuming 130. Perhaps smatch is not properly parsing u8 here? Fixes: b5cbaa43a676 ("[media] rtl28xx: initial support for rtl2832u") Signed-off-by: Mauro Carvalho Chehab commit d9a71866944967b8622c493ef1b570ccb74e45ae Author: Mauro Carvalho Chehab Date: Tue Aug 7 06:36:31 2018 -0400 media: mt9v111: avoid going past the buffer As warned by smatch: drivers/media/i2c/mt9v111.c:854 mt9v111_enum_frame_size() error: buffer overflow 'mt9v111_frame_sizes' 5 <= 5 drivers/media/i2c/mt9v111.c:855 mt9v111_enum_frame_size() error: buffer overflow 'mt9v111_frame_sizes' 5 <= 5 drivers/media/i2c/mt9v111.c:856 mt9v111_enum_frame_size() error: buffer overflow 'mt9v111_frame_sizes' 5 <= 5 drivers/media/i2c/mt9v111.c:857 mt9v111_enum_frame_size() error: buffer overflow 'mt9v111_frame_sizes' 5 <= 5 Signed-off-by: Mauro Carvalho Chehab commit 75070c6a3311e320508427bbc779c4de6942872e Author: Mauro Carvalho Chehab Date: Tue Aug 7 06:17:00 2018 -0400 media: vsp1_dl: add a description for cmdpool field Gets rid of this build warning: drivers/media/platform/vsp1/vsp1_dl.c:229: warning: Function parameter or member 'cmdpool' not described in 'vsp1_dl_manager' Fixes: f3b98e3c4d2e ("media: vsp1: Provide support for extended command pools") Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit 5a553d6ba103e28247f4e2d10bcc25545cd4d9cb Author: Thomas Petazzoni Date: Fri Aug 3 16:38:46 2018 +0200 PCI: mvebu: Use resource_size() to remap I/O space Instead of hardcoding the remapping of IO_SPACE_LIMIT - SZ_64K, use resource_size(). However, we cannot use just IO_SPACE_LIMIT, because pci_ioremap_io() has a bug and doesn't allow remapping the last 64 KB before IO_SPACE_LIMIT, so we ensure that we do not exceed this limit. When the pci_ioremap_io() issue is fixed, this work around can be dropped. Note that this workaround already existed, since we were mapping only up to IO_SPACE_LIMIT - SZ_64K. Suggested-by: Lorenzo Pieralisi Signed-off-by: Thomas Petazzoni [lorenzo.pieralisi@arm.com: tweaked the commit log] Signed-off-by: Lorenzo Pieralisi commit ee1604381a371b3ea6aec7d5e43b6e3f5e153854 Author: Thomas Petazzoni Date: Fri Aug 3 16:38:45 2018 +0200 PCI: mvebu: Only remap I/O space if configured If there is no PCI I/O aperture configured in the Device Tree, it does not make sense to create the virtual mapping for the PCI I/O space, since we will anyway not create the MBus window that will allow to access it. Therefore, do the pci_ioremap_io() only if necessary. Signed-off-by: Thomas Petazzoni Signed-off-by: Lorenzo Pieralisi commit dfd0309fd7b30a5baffaf47b2fccb88b46d64d69 Author: Thomas Petazzoni Date: Fri Aug 3 16:38:44 2018 +0200 PCI: mvebu: Fix I/O space end address calculation pcie->realio.end should be the address of last byte of the area, therefore using resource_size() of another resource is not correct, we must substract 1 to get the address of the last byte. Fixes: 11be65472a427 ("PCI: mvebu: Adapt to the new device tree layout") Signed-off-by: Thomas Petazzoni Signed-off-by: Lorenzo Pieralisi commit 6554f9501915101ba89aab6e40c83139d23f853a Author: Thomas Petazzoni Date: Fri Aug 3 16:38:43 2018 +0200 PCI: mvebu: Remove redundant platform_set_drvdata() call This is already done earlier in mvebu_pcie_probe(). Signed-off-by: Thomas Petazzoni Signed-off-by: Lorenzo Pieralisi commit 3db2776d9fca45305e6c2065905d9a0e7b2c8212 Author: David Jeffery Date: Tue Aug 7 16:56:00 2018 -0400 dm snapshot: improve performance by switching out_of_order_list to rbtree copy_complete()'s processing of out_of_order_list can result in quadratic complexity in the worst case. As such it was the source of consuming too much cpu and the source of significant loss in performance. Fix this by converting out_of_order_list to an rbtree. This improved a dm-snapshot test copy workload from 32 seconds to 4 seconds. Signed-off-by: David Jeffery Signed-off-by: Mikulas Patocka Tested-by: Brett Hull Signed-off-by: Mike Snitzer commit 784c9a29e99eb40b842c29ecf1cc3a79e00fb629 Author: John Pittman Date: Mon Aug 6 15:53:12 2018 -0400 dm kcopyd: avoid softlockup in run_complete_job It was reported that softlockups occur when using dm-snapshot ontop of slow (rbd) storage. E.g.: [ 4047.990647] watchdog: BUG: soft lockup - CPU#10 stuck for 22s! [kworker/10:23:26177] ... [ 4048.034151] Workqueue: kcopyd do_work [dm_mod] [ 4048.034156] RIP: 0010:copy_callback+0x41/0x160 [dm_snapshot] ... [ 4048.034190] Call Trace: [ 4048.034196] ? __chunk_is_tracked+0x70/0x70 [dm_snapshot] [ 4048.034200] run_complete_job+0x5f/0xb0 [dm_mod] [ 4048.034205] process_jobs+0x91/0x220 [dm_mod] [ 4048.034210] ? kcopyd_put_pages+0x40/0x40 [dm_mod] [ 4048.034214] do_work+0x46/0xa0 [dm_mod] [ 4048.034219] process_one_work+0x171/0x370 [ 4048.034221] worker_thread+0x1fc/0x3f0 [ 4048.034224] kthread+0xf8/0x130 [ 4048.034226] ? max_active_store+0x80/0x80 [ 4048.034227] ? kthread_bind+0x10/0x10 [ 4048.034231] ret_from_fork+0x35/0x40 [ 4048.034233] Kernel panic - not syncing: softlockup: hung tasks Fix this by calling cond_resched() after run_complete_job()'s callout to the dm_kcopyd_notify_fn (which is dm-snap.c:copy_callback in the above trace). Signed-off-by: John Pittman Signed-off-by: Mike Snitzer commit e4f6a44c4aeca9eda153302abb0c14d053914f72 Author: John Whitmore Date: Tue Aug 7 22:12:41 2018 +0100 staging:rtl8192u: Remove unused macro definitions - Style Removed unused macro definitions as they add nothing to the code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6a2e1905bfb9c826bcc0c866a8abfb8802a02ab7 Author: John Whitmore Date: Tue Aug 7 22:12:40 2018 +0100 staging:rtl8192u: Add spaces around '+' operator - Style Add spaces around '+' operator as required by the coding standard. This clears the checkpatch issue. This change is purely coding style in nature and should have not effect on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 976418c5771992948753e875340f5b07505d3a28 Author: John Whitmore Date: Tue Aug 7 22:12:39 2018 +0100 staging:rtl8192u: Remove stale comment - Style Remove a comment which appears to be from a previous version of code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a621f75cb8dde0ea57ff14e001766da1f1347431 Author: Michael Straube Date: Wed Aug 8 13:06:21 2018 +0200 staging: rtl8188eu: remove unused mp_custom_oid.h The header mp_custom_oid.h is not used, so remove it. 'git grep mp_custom_oid.h drivers/staging/rtl8188eu/' returns nothing. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 1b989094bae2d73ea65994cc388bb00585005556 Author: Leonardo Brás Date: Tue Aug 7 21:29:49 2018 -0300 staging: fbtft: Add spaces around / - Style Puts spaces around the /. Signed-off-by: Leonardo Brás Signed-off-by: Greg Kroah-Hartman commit 1315e8bad80c02a630e4f20e1518b21c3adef4d6 Author: Leonardo Brás Date: Tue Aug 7 21:29:18 2018 -0300 staging: fbtft: Erases some repetitive usage of function name - Style Changes this functions to avoid using "blank" on debug twice. Improves log readability. Signed-off-by: Leonardo Brás Signed-off-by: Greg Kroah-Hartman commit c21cbb5ee3b2c21907915fd365ad1ad85579d603 Author: Leonardo Brás Date: Tue Aug 7 21:29:10 2018 -0300 staging: fbtft: Adjust some empty-line problems - Style Erases some blank lines. Signed-off-by: Leonardo Brás Signed-off-by: Greg Kroah-Hartman commit 5bfac06f3e21669a1109fe05bb457adac711312a Author: Leonardo Brás Date: Tue Aug 7 21:29:04 2018 -0300 staging: fbtft: Removes one nesting level to help readability - Style This nesting level was removed to improve readability. Signed-off-by: Leonardo Brás Signed-off-by: Greg Kroah-Hartman commit d9932c8be094b2891c50348513bfeae578cd5e1e Author: Leonardo Brás Date: Tue Aug 7 21:28:57 2018 -0300 staging: fbtft: Changes gamma table to define. Most of other "Gamma Tables" were already boxed on a define, just did the same to PIOLED. Signed-off-by: Leonardo Brás Signed-off-by: Greg Kroah-Hartman commit e66f30ee1369af24366ce947a29d1362b8cd882c Author: Leonardo Brás Date: Tue Aug 7 21:28:50 2018 -0300 staging: fbtft: A bit more information on dev_err. Adds a bit more information on debug. The line break was to avoid obfuscating the parameters on the end of a large line. Signed-off-by: Leonardo Brás Signed-off-by: Greg Kroah-Hartman commit 333c7b940526be12b8a831b08f948a07e0955271 Author: Leonardo Brás Date: Tue Aug 7 21:28:29 2018 -0300 staging: fbtft: Fixes some alignment issues - Style Fixes (most) alignment issues pointed by checkpatch.pl. Signed-off-by: Leonardo Brás Signed-off-by: Greg Kroah-Hartman commit 0b1533c6c6f63bca9807fd6f295d769b6f4b5a11 Author: Leonardo Brás Date: Tue Aug 7 21:28:16 2018 -0300 staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style Puts macro arguments in parenthesis to avoid precedence issues. Some large lines were broken to fit the 80-char limit. Signed-off-by: Leonardo Brás Signed-off-by: Greg Kroah-Hartman commit 243638bc1c76a34d709432a59453f31123408742 Author: Colin Ian King Date: Mon Aug 6 14:31:02 2018 +0100 staging: rtl8188eu: remove unused array dB_Invert_Table Array dB_Invert_Table is declared but not used, hence it is redundant and can be removed. Cleans up clang warning: warning: ‘dB_Invert_Table’ defined but not used [-Wunused-const-variable=] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 705030a151cd2700415ba0eed98bd20459bac8b0 Author: Michael Straube Date: Sun Aug 5 21:05:16 2018 +0200 staging: rtl8188eu: remove whitespace, add missing blank line Replace tabs with spaces and/or remove spaces where appropriate. Add a missing blank line after declarations. Also clears checkpatch warnings. WARNING: Statements should start on a tabstop WARNING: suspect code indent for conditional statements (8, 17) Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 5c3bd8481c38a94b5442de556a88edfe5848e9a8 Author: Michael Straube Date: Sun Aug 5 21:05:15 2018 +0200 staging: rtl8188eu: use is_multicast_ether_addr in rtw_sta_mgt.c Use is_multicast_ether_addr instead of custom IS_MCAST in core/rtw_sta_mgt.c. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit e18676cc6e208e4b6cb7bd07faeac4a3e6aed9fa Author: Michael Straube Date: Sun Aug 5 21:05:14 2018 +0200 staging: rtl8188eu: remove whitespace - style Replace tabs with spaces and/or remove spaces where appropriate. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 353c6774bd8ebaab76f01efd3ed5551073b1be4c Author: Michael Straube Date: Sun Aug 5 21:05:13 2018 +0200 staging: rtl8188eu: cleanup block comment - style Cleanup a block comment to conform with kernel coding style. Also cleans 'line over 80 characters' checkpatch warnings. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit d39e86cbd8ae75e6761b14ce34e689a13605629e Author: Michael Straube Date: Sun Aug 5 21:05:12 2018 +0200 staging: rtl8188eu: use is_multicast_ether_addr in rtl8188eu_xmit.c Use is_multicast_ether_addr instead of custom IS_MCAST in hal/rtl8188eu_xmit.c. There is only one use, so remove the extra variable for the result of IS_MCAST. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 247e415fbc3e4728a3d2ea3334f19e1d3556f4c1 Author: Michael Straube Date: Sun Aug 5 21:05:11 2018 +0200 staging: rtl8188eu: use is_multicast_ether_addr in recv_linux.c Use is_multicast_ether_addr instead of custom IS_MCAST in os_dep/recv_linux.c. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit f7992a043f5cf9a3249c9168e828166c2ce2674d Author: Luke Triantafyllidis Date: Fri Aug 3 14:37:13 2018 +1000 staging: rtlwifi: refactor rtl_get_tcb_desc Refactored rtl_get_tcb_desc slightly to stay within the 80 character line limit. Signed-off-by: Luke Triantafyllidis Signed-off-by: Greg Kroah-Hartman commit e083926b3e269d4064825dcf2ad50c636fddf8cf Author: Ian Abbott Date: Mon Aug 6 11:05:13 2018 +0100 staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice The PFI subdevice flags indicate that the subdevice is readable and writeable, but that is only true for the supported "M-series" boards, not the older "E-series" boards. Only set the SDF_READABLE and SDF_WRITABLE subdevice flags for the M-series boards. These two flags are mainly for informational purposes. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit 532f14d973949948bf1a3f33e17a8548a30b33d5 Author: Sergio Paracuellos Date: Fri Aug 3 10:27:08 2018 +0200 staging: mt7621-dts: add pcie controller port registers The pcie node of the device tree only contains registers for the host-bridge and pcie port 0. Add the pcie port 1 and pcie port 2 also. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 4cafd03a916e2f7c15520fed0b7894cf25f4ecc5 Author: Sergio Paracuellos Date: Fri Aug 3 10:27:07 2018 +0200 staging: mt7621-pci: remove remaining pci_legacy dependant code pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 8594351af0f9e065885a6bbcb5248736e8a5612a Author: Sergio Paracuellos Date: Fri Aug 3 10:27:06 2018 +0200 staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 88e8fa0c26ba400ac15fad9cf6461f746ddb3aca Author: Sergio Paracuellos Date: Fri Aug 3 10:27:05 2018 +0200 staging: mt7621-pci: use BIT macro in preprocessor definitions Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit c00f0352bed0ff03d193a56387eb421e04d9415b Author: Sergio Paracuellos Date: Fri Aug 3 10:27:04 2018 +0200 staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 152f3893f4bdcbf2202c08d376b837b62f54a7e4 Author: Sergio Paracuellos Date: Fri Aug 3 10:27:03 2018 +0200 staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit cd7d07db8b83cfc88d4ee3a1d5f751cf6af58f13 Author: Sergio Paracuellos Date: Fri Aug 3 10:27:02 2018 +0200 staging: mt7621-pci: review includes putting them in alphabethic order There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit e38bb1754003d9a0fba5b59f23c850615664cbe6 Author: Sergio Paracuellos Date: Fri Aug 3 10:27:01 2018 +0200 staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write] Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit edec14020e3fcfb0a86bfa9f1d512b922697890f Author: Sergio Paracuellos Date: Fri Aug 3 10:27:00 2018 +0200 staging: mt7621-pci: remove unused macros There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit f8427fae570988deb5a78514ae6d70be1af0d358 Author: Sergio Paracuellos Date: Fri Aug 3 10:26:59 2018 +0200 staging: mt7621-pci: simplify write_config function write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit c0431f4f4aef9a52875d19af3c220e6c8f60d427 Author: Sergio Paracuellos Date: Fri Aug 3 10:26:58 2018 +0200 staging: mt7621-pci: simplify read_config function read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 9f999b41502714e7a33f3723f4a3aba85bd0324c Author: Sergio Paracuellos Date: Fri Aug 3 10:26:57 2018 +0200 staging: mt7621-pci: use pcie_[read|write] in [write|read]_config Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 52ed727ca031ca7a6fcfde55a2902ac4845d736c Author: Sergio Paracuellos Date: Fri Aug 3 10:26:56 2018 +0200 staging: mt7621-pci: add pcie_write and pcie_read helpers Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit e9d03d17dd94399bbc658394501d41a10ea1ef70 Author: Sergio Paracuellos Date: Fri Aug 3 10:26:55 2018 +0200 staging: mt7621-pci: remove dead code derived to not use custom reads and writes Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 8571c62d45cb7e9fdff87fe5132002d17fbce7a3 Author: Sergio Paracuellos Date: Fri Aug 3 10:26:54 2018 +0200 staging: mt7621-pci: use generic kernel pci subsystem read and write map_bus callback is called before every .read/.write operation. Implement it and change custom read write operations for the pci subsystem generics. Make the probe function to don't use legacy stuff and request bus resources directly. Get pci register base and ranges from device tree. The driver is not using PCI_LEGACY code anymore and shall use the PCI_DRIVERS_GENERIC option to correct compile it. Add also new Kconfig file for this controller setting there its correct dependencies. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 3c4d9137eefecf273a520d392071ffc9df0a9a7a Author: Gustavo A. R. Silva Date: Tue Aug 7 18:59:57 2018 -0500 arm64: alternative: Use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Will Deacon commit 6488a7f35eeab463f6c9c2ea34d30ca856f0bc8e Merge: 7efe25a70c37 5c5c87411488 379521462e4a d81dc82e0f19 04c532a1cdc7 f1a066fcc972 d9737953d851 d88e61faad52 Author: Joerg Roedel Date: Wed Aug 8 12:02:27 2018 +0200 Merge branches 'arm/shmobile', 'arm/renesas', 'arm/msm', 'arm/smmu', 'arm/omap', 'x86/amd', 'x86/vt-d' and 'core' into next commit 66414e80245e1e73222f67ee711951c7f4bdedab Author: Tal Shorer Date: Tue Aug 7 23:42:39 2018 +0300 nvme-fabrics: fix ctrl_loss_tmo < 0 to reconnect forever When the user supplies a ctrl_loss_tmo < 0, we warn them that this will cause the fabrics layer to attempt reconnection forever. However, in reality the fabrics layer never attempts to reconnect because the condition to test whether we should reconnect is backwards in this case. Signed-off-by: Tal Shorer Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit dedf0be544614b6d9d395e78d72cc8c30d03e440 Author: Chaitanya Kulkarni Date: Tue Aug 7 23:01:07 2018 -0700 nvmet: add ns write protect support This patch implements the Namespace Write Protect feature described in "NVMe TP 4005a Namespace Write Protect". In this version, we implement No Write Protect and Write Protect states for target ns which can be toggled by set-features commands from the host side. For write-protect state transition, we need to flush the ns specified as a part of command so we also add helpers for carrying out synchronous flush operations. Signed-off-by: Chaitanya Kulkarni [hch: fixed an incorrect endianess conversion, minor cleanups] Signed-off-by: Christoph Hellwig commit 1293477f4f324f9cf23a36f6cc0adc6801f1baac Author: Chaitanya Kulkarni Date: Tue Aug 7 23:01:06 2018 -0700 nvme: set gendisk read only based on nsattr NVMe 1.3 TP 4005 introduces new filed (NSATTR). This field indicates whether given namespace is write protected or not. This patch sets the gendisk associated with the namespace to read only based on the identify namespace nsattr field. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 93045d5942da60801e71764597d448cf37a798c1 Author: Chaitanya Kulkarni Date: Tue Aug 7 23:01:05 2018 -0700 nvme.h: add support for ns write protect definitions Add various definitions from NVMe 1.3 TP 4005. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 8b92d0e3d400390660a26ef7f475524700fb86cf Author: Hannes Reinecke Date: Wed Aug 8 08:35:29 2018 +0200 nvme.h: fixup ANA group descriptor format ANA Phase 3 draft had the 'reserved' field in the group descriptor format set to '23:17' (so that the first namespace identifier started at byte 24), but that got move with the approved TP to '31:17' (so that the first namespace identifier started at byte 32). Signed-off-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 0717edbdfed61b4c1e8291140f78882d3a481042 Author: Ryan Lee Date: Tue Aug 7 20:06:38 2018 -0700 ASoC: max98373: Added software reset register to readable registers Signed-off-by: Ryan Lee Signed-off-by: Mark Brown commit b1470d4ce77c2d60661c7d5325d4fb8063e15ff8 Author: Ajit Pandey Date: Tue Aug 7 18:30:42 2018 +0100 ASoC: wm_adsp: Correct DSP pointer for preloader control The offset of the DSP core needs to be taken into account for the DSP preloader control get and put. Currently the dsp->preloaded variable will only ever be read/updated on the first DSP, whilst this doesn't affect the operation of the control the readback will be incorrect. Signed-off-by: Ajit Pandey Signed-off-by: Charles Keepax Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 4f3fb287358337d739bd2186769a8c74aae19ac6 Author: Krzysztof Kozlowski Date: Tue Aug 7 18:18:26 2018 +0200 regulator: samsung: Add SPDX license identifiers Replace GPL v2.0+ license statements with SPDX license identifiers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Mark Brown commit 5e9384c705fcfa6bf6d3937967df3ab1f5e414cb Author: Krzysztof Kozlowski Date: Tue Aug 7 18:18:25 2018 +0200 regulator: maxim: Add SPDX license identifiers Replace GPL v2.0 and v2.0+ license statements with SPDX license identifiers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Mark Brown commit f861e3e28a3016a2064d9f600eaa92a530b732b4 Author: Matthias Kaehlcke Date: Tue Aug 7 10:19:40 2018 -0700 ASoC: rt5677: Fix initialization of rt5677_of_match.data The driver expects to find the device id in rt5677_of_match.data, however it is currently assigned to rt5677_of_match.type. Fix this. The problem was found with the help of clang: sound/soc/codecs/rt5677.c:5010:36: warning: expression which evaluates to zero treated as a null pointer constant of type 'const void *' [-Wnon-literal-null-conversion] { .compatible = "realtek,rt5677", RT5677 }, ^~~~~~ Fixes: ddc9e69b9dc2 ("ASoC: rt5677: Hide platform data in the module sources") Signed-off-by: Matthias Kaehlcke Reviewed-by: Guenter Roeck Acked-by: Andy Shevchenko Signed-off-by: Mark Brown commit c5fe50aaa20c87cd863fdc56ec7c8e504986f31d Author: Michael Straube Date: Sun Aug 5 22:43:06 2018 +0200 Revert "staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames" On a Raven Ridge system with a r8188eu usb wifi device commit 515ce733e86e ("staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames") is causing two bugs and a warning in dmesg: [ 22.618465] BUG: scheduling while atomic: NetworkManager/489/0x00000202 [ 22.618466] Modules linked in: amdkfd amd_iommu_v2 amdgpu nls_iso8859_1 nls_cp437 vfat fat r8188eu(C) edac_mce_amd chash kvm_amd gpu_sched i2c_algo_bit ccp ttm rng_core lib80211 kvm snd_hda_codec_realtek snd_hda_codec_generic cfg80211 snd_hda_codec_hdmi snd_hda_intel input_leds drm_kms_helper irqbypass snd_hda_codec crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc rfkill led_class mousedev joydev wmi_bmof snd_hda_core drm aesni_intel snd_hwdep aes_x86_64 crypto_simd cryptd glue_helper snd_pcm pcspkr sp5100_tco snd_timer r8169 k10temp agpgart i2c_piix4 snd mii syscopyarea sysfillrect sysimgblt fb_sys_fops soundcore rtc_cmos evdev gpio_amdpt pinctrl_amd mac_hid wmi pcc_cpufreq acpi_cpufreq crypto_user ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 fscrypto hid_generic usbhid hid sd_mod [ 22.618549] ahci xhci_pci libahci xhci_hcd crc32c_intel libata usbcore scsi_mod usb_common [ 22.618554] Preemption disabled at: [ 22.618558] [] __dev_queue_xmit+0x74/0x910 [ 22.618561] CPU: 3 PID: 489 Comm: NetworkManager Tainted: G C 4.18.0-rc7-staging+ #14 [ 22.618562] Hardware name: Gigabyte Technology Co., Ltd. A320M-S2H/A320M-S2H-CF, BIOS F23d 04/17/2018 [ 22.618563] Call Trace: [ 22.618569] dump_stack+0x5c/0x80 [ 22.618571] ? __dev_queue_xmit+0x74/0x910 [ 22.618574] __schedule_bug.cold.14+0x82/0x9b [ 22.618576] __schedule+0x6fd/0x8b0 [ 22.618578] ? enqueue_task_fair+0xc3/0x730 [ 22.618580] schedule+0x32/0x90 [ 22.618581] schedule_timeout+0x311/0x4a0 [ 22.618583] ? _raw_spin_unlock_irqrestore+0x20/0x40 [ 22.618585] ? try_to_wake_up+0x231/0x480 [ 22.618586] wait_for_common+0x15f/0x190 [ 22.618588] ? wake_up_q+0x70/0x70 [ 22.618597] ? rtw_aes_encrypt+0x26f/0x290 [r8188eu] [ 22.618598] wait_for_completion_killable+0x19/0x30 [ 22.618601] call_usermodehelper_exec+0x115/0x160 [ 22.618603] __request_module+0x1ac/0x3e2 [ 22.618606] ? netlink_broadcast_filtered+0x142/0x400 [ 22.618607] ? netlink_broadcast+0xf/0x20 [ 22.618615] rtw_aes_encrypt+0x26f/0x290 [r8188eu] [ 22.618622] ? rtw_get_stainfo+0xe6/0x130 [r8188eu] [ 22.618629] rtw_xmitframe_coalesce+0x950/0xb00 [r8188eu] [ 22.618631] ? _raw_spin_lock_irqsave+0x25/0x50 [ 22.618638] rtw_hal_xmit+0x83/0x130 [r8188eu] [ 22.618645] rtw_xmit+0x258/0x5d0 [r8188eu] [ 22.618652] rtw_xmit_entry+0xe8/0x2e7 [r8188eu] [ 22.618654] dev_hard_start_xmit+0xa5/0x240 [ 22.618657] sch_direct_xmit+0x150/0x340 [ 22.618658] __dev_queue_xmit+0x2f6/0x910 [ 22.618661] packet_sendmsg+0x948/0x15a7 [ 22.618663] ? attach_to_pi_owner+0x38/0x180 [ 22.618666] sock_sendmsg+0x33/0x40 [ 22.618668] __sys_sendto+0xee/0x160 [ 22.618670] ? memzero_explicit+0xa/0x10 [ 22.618672] ? urandom_read+0x120/0x270 [ 22.618675] __x64_sys_sendto+0x24/0x30 [ 22.618677] do_syscall_64+0x5b/0x170 [ 22.618678] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 22.618680] RIP: 0033:0x7f0942790c12 [ 22.618680] Code: 48 83 ec 18 44 89 4c 24 08 e8 9a f5 ff ff 44 8b 4c 24 08 4d 89 f8 45 89 f2 89 c5 4c 89 ea 4c 89 e6 89 df b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3a 89 ef 48 89 44 24 08 e8 ca f5 ff ff 48 8b [ 22.618700] RSP: 002b:00007ffe2051be30 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 22.618701] RAX: ffffffffffffffda RBX: 0000000000000011 RCX: 00007f0942790c12 [ 22.618702] RDX: 0000000000000148 RSI: 0000559278761700 RDI: 0000000000000011 [ 22.618703] RBP: 0000000000000000 R08: 00005592787aa860 R09: 0000000000000014 [ 22.618703] R10: 0000000000000000 R11: 0000000000000293 R12: 0000559278761700 [ 22.618704] R13: 0000000000000148 R14: 0000000000000000 R15: 00005592787aa860 [ 22.620488] lib80211_crypt: registered algorithm 'CCMP' [ 22.620735] ------------[ cut here ]------------ [ 22.620738] DEBUG_LOCKS_WARN_ON(val > preempt_count()) [ 22.620744] WARNING: CPU: 3 PID: 489 at kernel/sched/core.c:3246 preempt_count_sub+0x5a/0x90 [ 22.620749] Modules linked in: lib80211_crypt_ccmp amdkfd amd_iommu_v2 amdgpu nls_iso8859_1 nls_cp437 vfat fat r8188eu(C) edac_mce_amd chash kvm_amd gpu_sched i2c_algo_bit ccp ttm rng_core lib80211 kvm snd_hda_codec_realtek snd_hda_codec_generic cfg80211 snd_hda_codec_hdmi snd_hda_intel input_leds drm_kms_helper irqbypass snd_hda_codec crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc rfkill led_class mousedev joydev wmi_bmof snd_hda_core drm aesni_intel snd_hwdep aes_x86_64 crypto_simd cryptd glue_helper snd_pcm pcspkr sp5100_tco snd_timer r8169 k10temp agpgart i2c_piix4 snd mii syscopyarea sysfillrect sysimgblt fb_sys_fops soundcore rtc_cmos evdev gpio_amdpt pinctrl_amd mac_hid wmi pcc_cpufreq acpi_cpufreq crypto_user ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 fscrypto hid_generic [ 22.620792] usbhid hid sd_mod ahci xhci_pci libahci xhci_hcd crc32c_intel libata usbcore scsi_mod usb_common [ 22.620803] CPU: 3 PID: 489 Comm: NetworkManager Tainted: G WC 4.18.0-rc7-staging+ #14 [ 22.620804] Hardware name: Gigabyte Technology Co., Ltd. A320M-S2H/A320M-S2H-CF, BIOS F23d 04/17/2018 [ 22.620808] RIP: 0010:preempt_count_sub+0x5a/0x90 [ 22.620809] Code: 14 f7 6b c3 e8 57 89 2d 00 85 c0 74 f6 8b 15 55 6a 5a 01 85 d2 75 ec 48 c7 c6 2e 01 e7 94 48 c7 c7 db b2 e5 94 e8 90 77 fd ff <0f> 0b c3 84 d2 75 c9 e8 2a 89 2d 00 85 c0 74 c9 8b 05 28 6a 5a 01 [ 22.620842] RSP: 0018:ffffa1904133bc48 EFLAGS: 00010286 [ 22.620844] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001 [ 22.620846] RDX: 0000000080000001 RSI: ffffffff94e82606 RDI: 00000000ffffffff [ 22.620847] RBP: ffff8eb4449eac00 R08: 0000001af4246984 R09: 00000000000003f1 [ 22.620849] R10: ffffffff955f7700 R11: 0000000000000000 R12: ffff8eb4449eacac [ 22.620850] R13: ffff8eb4565da800 R14: ffff8eb453ca2000 R15: 0000000000000003 [ 22.620852] FS: 00007f0944d69000(0000) GS:ffff8eb45ecc0000(0000) knlGS:0000000000000000 [ 22.620853] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 22.620854] CR2: 00007ffe20518fa8 CR3: 0000000207844000 CR4: 00000000003406e0 [ 22.620855] Call Trace: [ 22.620859] _raw_spin_unlock+0x16/0x30 [ 22.620862] sch_direct_xmit+0x178/0x340 [ 22.620866] __dev_queue_xmit+0x2f6/0x910 [ 22.620870] packet_sendmsg+0x948/0x15a7 [ 22.620873] ? attach_to_pi_owner+0x38/0x180 [ 22.620877] sock_sendmsg+0x33/0x40 [ 22.620880] __sys_sendto+0xee/0x160 [ 22.620885] ? memzero_explicit+0xa/0x10 [ 22.620887] ? urandom_read+0x120/0x270 [ 22.620891] __x64_sys_sendto+0x24/0x30 [ 22.620893] do_syscall_64+0x5b/0x170 [ 22.620896] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 22.620898] RIP: 0033:0x7f0942790c12 [ 22.620899] Code: 48 83 ec 18 44 89 4c 24 08 e8 9a f5 ff ff 44 8b 4c 24 08 4d 89 f8 45 89 f2 89 c5 4c 89 ea 4c 89 e6 89 df b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3a 89 ef 48 89 44 24 08 e8 ca f5 ff ff 48 8b [ 22.620925] RSP: 002b:00007ffe2051be30 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 22.620928] RAX: ffffffffffffffda RBX: 0000000000000011 RCX: 00007f0942790c12 [ 22.620929] RDX: 0000000000000148 RSI: 0000559278761700 RDI: 0000000000000011 [ 22.620930] RBP: 0000000000000000 R08: 00005592787aa860 R09: 0000000000000014 [ 22.620931] R10: 0000000000000000 R11: 0000000000000293 R12: 0000559278761700 [ 22.620933] R13: 0000000000000148 R14: 0000000000000000 R15: 00005592787aa860 [ 22.620936] ---[ end trace ecf9299fa6cc3176 ]--- [ 22.620940] BUG: using __this_cpu_read() in preemptible [00000000] code: NetworkManager/489 [ 22.620942] caller is __local_bh_enable_ip+0x50/0x80 [ 22.620945] CPU: 3 PID: 489 Comm: NetworkManager Tainted: G WC 4.18.0-rc7-staging+ #14 [ 22.620946] Hardware name: Gigabyte Technology Co., Ltd. A320M-S2H/A320M-S2H-CF, BIOS F23d 04/17/2018 [ 22.620947] Call Trace: [ 22.620950] dump_stack+0x5c/0x80 [ 22.620955] check_preemption_disabled.cold.0+0x46/0x51 [ 22.620958] __local_bh_enable_ip+0x50/0x80 [ 22.620961] __dev_queue_xmit+0x450/0x910 [ 22.620964] packet_sendmsg+0x948/0x15a7 [ 22.620967] ? attach_to_pi_owner+0x38/0x180 [ 22.620971] sock_sendmsg+0x33/0x40 [ 22.620973] __sys_sendto+0xee/0x160 [ 22.620976] ? memzero_explicit+0xa/0x10 [ 22.620978] ? urandom_read+0x120/0x270 [ 22.620982] __x64_sys_sendto+0x24/0x30 [ 22.620984] do_syscall_64+0x5b/0x170 [ 22.620986] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 22.620990] RIP: 0033:0x7f0942790c12 [ 22.620991] Code: 48 83 ec 18 44 89 4c 24 08 e8 9a f5 ff ff 44 8b 4c 24 08 4d 89 f8 45 89 f2 89 c5 4c 89 ea 4c 89 e6 89 df b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3a 89 ef 48 89 44 24 08 e8 ca f5 ff ff 48 8b [ 22.621017] RSP: 002b:00007ffe2051be30 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 22.621020] RAX: ffffffffffffffda RBX: 0000000000000011 RCX: 00007f0942790c12 [ 22.621021] RDX: 0000000000000148 RSI: 0000559278761700 RDI: 0000000000000011 [ 22.621024] RBP: 0000000000000000 R08: 00005592787aa860 R09: 0000000000000014 [ 22.621025] R10: 0000000000000000 R11: 0000000000000293 R12: 0000559278761700 [ 22.621026] R13: 0000000000000148 R14: 0000000000000000 R15: 00005592787aa860 Revert the commit fixes the issues and dmesg looks good again. Fixes: 515ce733e86e ("staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames") Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 3978c8e3237c9d09364501bcefdb8c40368421d9 Author: Gao Xiang Date: Mon Aug 6 11:27:53 2018 +0800 staging: erofs: remove an extra semicolon in z_erofs_vle_unzip_all There is an extra semicolon in z_erofs_vle_unzip_all, remove it. Reported-by: Julia Lawall Signed-off-by: zhong jiang Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit ec6e6925fc2adb98ef351d7c25a7e41caa4d5b77 Author: zhong jiang Date: Mon Aug 6 11:10:19 2018 +0800 staging: gasket: remove some extra semicolon That semicolons are unneeded, Just remove them. Signed-off-by: zhong jiang Signed-off-by: Greg Kroah-Hartman commit 8d84a9c1d29dbad517228e7e64d07b4d86dc7f59 Author: Sumit Pundir Date: Tue Aug 7 16:14:28 2018 +0530 staging: gasket: fix code indent for conditional statement Fixed a coding style issue related to indentation. Reported by checkpatch.pl Signed-off-by: Sumit Pundir Signed-off-by: Greg Kroah-Hartman commit d37d2dd41f7ad0bc0996e600727480ffaaad6fd3 Author: Todd Poynor Date: Sun Aug 5 13:07:49 2018 -0700 staging: gasket: core: remove incorrect extraneous comment A copy-and-pasted comment from another code sequence is removed from gasket core init sequence. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 4801fc6f7f72447efc7c2f6e886c887ff5bf5f4c Author: Todd Poynor Date: Sun Aug 5 13:07:48 2018 -0700 staging: gasket: apex: place in low power reset until opened The apex device is left out of reset mode at the end of device probe/initialize processing. Add a call to enter reset at the end of the sequence, triggering power gating and other low power features. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 95a2c279b2c7c2e59977d5b0773a15ba26b7ce4b Author: Todd Poynor Date: Sun Aug 5 13:07:47 2018 -0700 staging: gasket: core: protect against races during unregister Keep mutex held across the unregistration operation, until the driver_desc field of the global table is removed, to prevent a concurrent accessor from looking up the driver_desc while gasket_unregister_device() is in the processing of removing it. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 71934948b0a18c227de088a40c7660b5ed8cce2c Author: Todd Poynor Date: Sun Aug 5 13:07:46 2018 -0700 staging: gasket: apex: move sysfs setup code to probe function The gasket framework no longer provides callbacks to the device driver for sysfs setup and teardown. Move the sysfs setup code to the device probe function. Apex does not implement sysfs cleanup code. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 565eeedaa0c1b2b0d8abd3845e349de29065a5d2 Author: Todd Poynor Date: Sun Aug 5 13:07:45 2018 -0700 staging: gasket: core: remove sysfs setup and cleanup callbacks Gasket device drivers now call into the gasket framework to initialize and de-initialize, rather than the other way around. The calling code can perform sysfs setup and cleanup actions without callbacks from the framework. Remove the sysfs setup and cleanup callbacks. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit c169d876bfbfedd9ed3d3968924c24455bb4cb2f Author: Todd Poynor Date: Sun Aug 5 13:07:44 2018 -0700 staging: gasket: apex: fold device add/remove logic inline Gasket device drivers are now in charge of the device add and remove sequences; the framework callbacks for these are deleted. Move the apex device add callback code to the probe function. Apex did not implement the removal callback. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 4420ea9366a5df61cbb0bb2ad827ff6391904f56 Author: Todd Poynor Date: Sun Aug 5 13:07:43 2018 -0700 staging: gasket: core: delete device add and remove callbacks Gasket device drivers are now in charge of orchestrating the device add and removal sequences, so the callbacks from the framework to the device drivers for these events are no longer needed. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 38da89d5cc958d2b0cf03c237cd155ab08973b1a Author: Todd Poynor Date: Sun Aug 5 13:07:42 2018 -0700 staging: gasket: apex: enable/disable gasket device from apex Gasket framework now places device drivers in charge of calling APIs to enable and disable gasket device operations. Make the appropriate calls from the apex driver. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 39091410d0d8eeb07f3b08ff4e44400ccd434762 Author: Todd Poynor Date: Sun Aug 5 13:07:41 2018 -0700 staging: gasket: core: let device driver enable/disable gasket device Move gasket device enable/disable functions from internal calls to external calls from the gasket device drivers. The device driver will call these functions at appropriate times in its processing, placing the device driver in control of this sequence and reducing the need for callbacks from framework back to the device drivers during the enable/disable sequences. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 2f649036fa66b1494da6ecf8bd4d53167e10e36f Author: Todd Poynor Date: Sun Aug 5 13:07:40 2018 -0700 staging: gasket: apex: remove device enable and disable callbacks These are not implemented for apex, and are now being removed from the gasket framework. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 1b25e6e81aab048107ed20c218c2b04261fd94ec Author: Todd Poynor Date: Sun Aug 5 13:07:39 2018 -0700 staging: gasket: core: remove device enable and disable callbacks Device enable/disable operations are moving from being initiated through the gasket framework to being initiated by the gasket device driver. The driver can perform any processing needed for these operations before or after the calls into the framework. Neither of these callbacks are implemented for the only gasket driver upstream today, apex. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit c75e2bb32fd04ebcdeaa907144027c0b9c416f05 Author: Todd Poynor Date: Sun Aug 5 13:07:38 2018 -0700 staging: gasket: core: convert remaining info logs to debug Remaining info-level logs in gasket core converted to debug-level; the information is not needed during normal system operation. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 1453e90cc40e0b6660b872a573755f8f28c17593 Author: Todd Poynor Date: Sun Aug 5 13:07:37 2018 -0700 staging: gasket: apex: move PCI core calls to apex driver Apex driver moves PCI core calls like probe, enable, and remove from gasket to apex. Call new functions in gasket to register apex as a PCI device to the gasket framework. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit b7072b24fa61f42c356ffdfaa0544065d6f1c23b Author: Todd Poynor Date: Sun Aug 5 13:07:36 2018 -0700 staging: gasket: core: move core PCI calls to device drivers Remove gasket wrapping of PCI probe, enable, disable, and remove functions. Replace with calls to add and remove PCI gasket devices, to be called by the gasket device drivers. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit a81d678949471d5b7f399cfcf2e48e0382427805 Author: Todd Poynor Date: Sun Aug 5 13:07:35 2018 -0700 staging: gasket: sysfs: clean up state if ENOMEM removing mapping If kcalloc() returns NULL in put_mapping(), continue to clean up state, including dropping the reference on the struct device and free attribute memory. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 04c532a1cdc7e423656c07937aa4b5c1c2b064f9 Author: Ralf Goebel Date: Mon Aug 6 17:00:36 2018 +0200 iommu/omap: Fix cache flushes on L2 table entries The base address used for DMA operations on the second-level table did incorrectly include the offset for the table entry. The offset was then added again which lead to incorrect behavior. Operations on the L1 table are not affected. The calculation of the base address is changed to point to the beginning of the L2 table. Fixes: bfee0cf0ee1d ("iommu/omap: Use DMA-API for performing cache flushes") Acked-by: Suman Anna Signed-off-by: Ralf Goebel Signed-off-by: Joerg Roedel commit d88e61faad526a5850e9330c846641b91cf971e7 Author: Christoph Hellwig Date: Mon Jul 30 09:36:26 2018 +0200 iommu: Remove the ->map_sg indirection All iommu drivers use the default_iommu_map_sg implementation, and there is no good reason to ever override it. Just expose it as iommu_map_sg directly and remove the indirection, specially in our post-spectre world where indirect calls are horribly expensive. Signed-off-by: Christoph Hellwig Signed-off-by: Joerg Roedel commit 128f38041035001276e964cda1cf951f218d965d Author: Sherry Yang Date: Tue Aug 7 12:57:13 2018 -0700 android: binder: Rate-limit debug and userspace triggered err msgs Use rate-limited debug messages where userspace can trigger excessive log spams. Acked-by: Arve Hjønnevåg Signed-off-by: Sherry Yang Signed-off-by: Greg Kroah-Hartman commit 7c27a26e1ed5a7dd709aa19685d2c98f64e1cf0c Author: Breno Leitao Date: Tue Aug 7 11:15:39 2018 -0300 selftests/powerpc: Kill child processes on SIGINT There are some powerpc selftests, as tm/tm-unavailable, that run for a long period (>120 seconds), and if it is interrupted, as pressing CRTL-C (SIGINT), the foreground process (harness) dies but the child process and threads continue to execute (with PPID = 1 now) in background. In this case, you'd think the whole test exited, but there are remaining threads and processes being executed in background. Sometimes these zombies processes are doing annoying things, as consuming the whole CPU or dumping things to STDOUT. This patch fixes this problem by attaching an empty signal handler to SIGINT in the harness process. This handler will interrupt (EINTR) the parent process waitpid() call, letting the code to follow through the normal flow, which will kill all the processes in the child process group. This patch also fixes a typo. Signed-off-by: Breno Leitao Signed-off-by: Gustavo Romero Signed-off-by: Michael Ellerman commit 958f79b9ee55dfaf00c8106ed1c22a2919e0028b Author: Andi Kleen Date: Tue Aug 7 15:09:39 2018 -0700 x86/mm/pat: Make set_memory_np() L1TF safe set_memory_np() is used to mark kernel mappings not present, but it has it's own open coded mechanism which does not have the L1TF protection of inverting the address bits. Replace the open coded PTE manipulation with the L1TF protecting low level PTE routines. Passes the CPA self test. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner commit 0768f91530ff46683e0b372df14fd79fe8d156e5 Author: Andi Kleen Date: Tue Aug 7 15:09:37 2018 -0700 x86/speculation/l1tf: Make pmd/pud_mknotpresent() invert Some cases in THP like: - MADV_FREE - mprotect - split mark the PMD non present for temporarily to prevent races. The window for an L1TF attack in these contexts is very small, but it wants to be fixed for correctness sake. Use the proper low level functions for pmd/pud_mknotpresent() to address this. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner commit f22cc87f6c1f771b57c407555cfefd811cdd9507 Author: Andi Kleen Date: Tue Aug 7 15:09:36 2018 -0700 x86/speculation/l1tf: Invert all not present mappings For kernel mappings PAGE_PROTNONE is not necessarily set for a non present mapping, but the inversion logic explicitely checks for !PRESENT and PROT_NONE. Remove the PROT_NONE check and make the inversion unconditional for all not present mappings. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner commit 6d33b3069ed84be9b8430ccc7705d0e747542a4f Merge: a39284ae9d2a 15e2a7218c27 Author: Greg Kroah-Hartman Date: Wed Aug 8 08:37:53 2018 +0200 Merge tag 'fsi-updates-2018-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/linux-fsi into char-misc-next Ben writes: FSI Updates for 4.19 This adds two FSI fixes: - Fix a NULL dereference in the scom driver - Fix a command buffer size issue in the sbefifo driver that breaks some operations with POWER system debugger (cronus) commit ee3d212d7c86703e765473a4b444d347aa2984af Merge: 854457d21485 640332d1a089 Author: Stephen Boyd Date: Tue Aug 7 22:53:37 2018 -0700 Merge tag 'v4.19-rockchip-clk2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip Pull one final rockchip update from Heiko Stuebner: pclk_rkpwm_pmu as critical clock, due to it supplying the pwm used to drive the logic supply of the rk3399 core. * tag 'v4.19-rockchip-clk2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 commit 15e2a7218c2788d79c5633336d17cb9428c221e7 Author: Benjamin Herrenschmidt Date: Tue Aug 7 11:51:52 2018 +1000 fsi: sbefifo: Bump max command length Otherwise cronus putmem fails istep and BML fails to upload skiboot To do that, we still use our one-page command buffer for small commands for speed, and for anything bigger, with a limit of 1MB plus a page, we vmalloc a temporary buffer. The limit was chosen because Cronus will break up any data transfer into 1M chunks (the extra page is for the command header). Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Andrew Jeffery commit e93dd8a1ac3141290936f174b81f4a9ba0c1c8a6 Author: Moritz Fischer Date: Tue Aug 7 16:35:20 2018 -0700 net: nixge: Get rid of unused struct member 'last_link' Get rid of unused struct member 'last_link' Signed-off-by: Moritz Fischer Signed-off-by: David S. Miller commit 3517c5b75df128087edb8281472f7dc52434631c Merge: 541ad323db3a e38c2e11ebcc Author: David S. Miller Date: Tue Aug 7 17:54:21 2018 -0700 Merge branch 'net-ethernet-Mark-expected-switch-fall-throughs' Gustavo A. R. Silva says: ==================== net: ethernet: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, this patchset aims to add some annotations in order to mark switch cases where we are expecting to fall through. ==================== Signed-off-by: David S. Miller commit e38c2e11ebcc2bd13aa8220bc4ccce5228030526 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:32:19 2018 -0500 net: ethernet: ti: cpts: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114813 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 681685a1ce060c4fd69b0a1124ef40baadb330a4 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:31:46 2018 -0500 net: tlan: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 141440 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 5683a7a6972059611ea164be0529fdb8db28938c Author: Gustavo A. R. Silva Date: Tue Aug 7 18:31:16 2018 -0500 net: sfc: falcon: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1384500 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 4e50ffcf1fb65375bed0cdb44ee369f33ee3729d Author: Gustavo A. R. Silva Date: Tue Aug 7 18:30:22 2018 -0500 net: ethernet: sxgbe: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1357414 ("Missing break in switch") Addresses-Coverity-ID: 1357415 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 201e894570b182ab6e49097ed3b3fcc1a7e3cf3c Author: Gustavo A. R. Silva Date: Tue Aug 7 18:29:12 2018 -0500 qlge: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114811 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit d19911ca0521623bcc306738f7a1298f9f56d3c9 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:28:20 2018 -0500 qlcnic: Mark expected switch fall-througs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1410181 ("Missing break in switch") Addresses-Coverity-ID: 1410184 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit b84ad65a75f36abfe20b3c9386e8377982ca8eaa Author: Gustavo A. R. Silva Date: Tue Aug 7 18:27:36 2018 -0500 qede: qede_fp: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1384501 ("Missing break in switch") Addresses-Coverity-ID: 1398869 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit fd3da12dba0d91d817adc4a6037513906bb4e8e9 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:26:49 2018 -0500 netxen_nic: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1410182 ("Missing break in switch") Addresses-Coverity-ID: 1410183 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 53a42286f29f88663d7b40922eca978c88e69709 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:25:57 2018 -0500 qed: qed_dev: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced the code comments with a proper "fall through" annotation, which is what GCC is expecting to find. Addresses-Coverity-ID: 114809 ("Missing break in switch") Addresses-Coverity-ID: 114810 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit e77f02b812ccb10396d9e5a9a23db14983a344a9 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:25:26 2018 -0500 net/mlx5e: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114808 ("Missing break in switch") Addresses-Coverity-ID: 114802 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 9d81e6a3f64315fa3af3e8f880bbfda35be04188 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:24:38 2018 -0500 vxge: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114796 ("Missing break in switch") Addresses-Coverity-ID: 114804 ("Missing break in switch") Addresses-Coverity-ID: 114806 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 76df93b1779563cda9d38237e5b6422df9ebd2e5 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:24:04 2018 -0500 igbvf: netdev: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114801 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit eed05a094a0dd03f181d3fd65e4be375d88a582c Author: Gustavo A. R. Silva Date: Tue Aug 7 18:23:31 2018 -0500 igb: e1000_phy: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114800 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit b9e0e23f918bafddaaf3b91b099f027679a77467 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:22:57 2018 -0500 igb: e1000_82575: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114799 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 7e9660ff6ff1c154f2590ade0ac3ad563f1522ab Author: Gustavo A. R. Silva Date: Tue Aug 7 18:22:22 2018 -0500 igb_main: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 200521 ("Missing break in switch") Addresses-Coverity-ID: 114797 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit c8581f2bb5dd02d14be61ed9faa052a693a3960e Author: Gustavo A. R. Silva Date: Tue Aug 7 18:21:40 2018 -0500 net/mlx4/en_rx: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114794 ("Missing break in switch") Addresses-Coverity-ID: 114795 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 49a9776fe5d62fd4ff87406efa390a5de9f5f07d Author: Gustavo A. R. Silva Date: Tue Aug 7 18:21:05 2018 -0500 net/mlx4/mcg: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114792 ("Missing break in switch") Addresses-Coverity-ID: 114793 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit f7c3ca2da4640143f04fc50dba74804be02c16ac Author: Gustavo A. R. Silva Date: Tue Aug 7 18:20:27 2018 -0500 i40e_txrx: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114791 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 1e84374f1c3c233c64be6122742c85446c774689 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:19:42 2018 -0500 i40e_main: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114790 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit be44b3afa98205607a7930b155557ccda9efd1e2 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:18:30 2018 -0500 net: hns3: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114789 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 1e14ef19fb49ed6f822129ce7bc819a462b88e11 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:17:50 2018 -0500 net: hns: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114788 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 40f99eda21bd14c7bbc62caee42c9b604ea24f6e Author: Gustavo A. R. Silva Date: Tue Aug 7 18:17:08 2018 -0500 be2net: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114787 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 8fc85c25c1f3f05ccc147af4c470c911afc54998 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:16:07 2018 -0500 net: tulip: de4x5: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114784 ("Missing break in switch") Addresses-Coverity-ID: 114785 ("Missing break in switch") Addresses-Coverity-ID: 114786 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 10c7666e70d979d78bf6b8c1b6ab6dd68cd0d96b Author: Gustavo A. R. Silva Date: Tue Aug 7 18:15:35 2018 -0500 net: tulip_core: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114782 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 6da5ae5f00e84b469ba52e734c856b707eac90a6 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:15:32 2018 -0500 net: thunderx: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114781 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 92072679a8036215b9ef8fd68d7ef9eef786a9e9 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:14:18 2018 -0500 cxgb3/l2t: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114780 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit d135955f550df5d61bf973a71b758384b32fe638 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:13:44 2018 -0500 cxgb4/t4_hw: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114777 ("Missing break in switch") Addresses-Coverity-ID: 114778 ("Missing break in switch") Addresses-Coverity-ID: 114779 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 20e4fb12b146cab4ca9c4f1e10c04fcd67823f43 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:13:12 2018 -0500 cxgb4/l2t: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114910 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 19aa45d447002798ec006faddd4f491a5839bebe Author: Gustavo A. R. Silva Date: Tue Aug 7 18:13:05 2018 -0500 liquidio: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 143135 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit b4bc39a3f666c3e93590aefbc00d94b95f80567f Author: Gustavo A. R. Silva Date: Tue Aug 7 18:11:26 2018 -0500 net: macb: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit bc171e87a7e29a41b119fdfccd378f7179b39c23 Author: Gustavo A. R. Silva Date: Tue Aug 7 18:11:14 2018 -0500 bnx2x: Mark expected switch fall-thoughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114878 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 8ea34505060486010f27e323c741eeca5af7980e Author: Gustavo A. R. Silva Date: Tue Aug 7 18:09:19 2018 -0500 alteon: acenic: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114891 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 497e0049b6c8b1923ba6ccb58f3ccf840a32be7e Author: Gustavo A. R. Silva Date: Tue Aug 7 18:09:09 2018 -0500 8390: axnet_cs: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114889 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit f7ecb1b109da1006a08d5675debe60990e824432 Author: Bart Van Assche Date: Tue Aug 7 16:17:29 2018 -0700 cfq: Suppress compiler warnings about comparisons This patch does not change any functionality but avoids that gcc reports the following warnings when building with W=1: block/cfq-iosched.c: In function ?cfq_back_seek_max_store?: block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (__data < (MIN)) \ ^ block/cfq-iosched.c:4756:1: note: in expansion of macro ?STORE_FUNCTION? STORE_FUNCTION(cfq_back_seek_max_store, &cfqd->cfq_back_max, 0, UINT_MAX, 0); ^~~~~~~~~~~~~~ block/cfq-iosched.c: In function ?cfq_slice_idle_store?: block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (__data < (MIN)) \ ^ block/cfq-iosched.c:4759:1: note: in expansion of macro ?STORE_FUNCTION? STORE_FUNCTION(cfq_slice_idle_store, &cfqd->cfq_slice_idle, 0, UINT_MAX, 1); ^~~~~~~~~~~~~~ block/cfq-iosched.c: In function ?cfq_group_idle_store?: block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (__data < (MIN)) \ ^ block/cfq-iosched.c:4760:1: note: in expansion of macro ?STORE_FUNCTION? STORE_FUNCTION(cfq_group_idle_store, &cfqd->cfq_group_idle, 0, UINT_MAX, 1); ^~~~~~~~~~~~~~ block/cfq-iosched.c: In function ?cfq_low_latency_store?: block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (__data < (MIN)) \ ^ block/cfq-iosched.c:4765:1: note: in expansion of macro ?STORE_FUNCTION? STORE_FUNCTION(cfq_low_latency_store, &cfqd->cfq_latency, 0, 1, 0); ^~~~~~~~~~~~~~ block/cfq-iosched.c: In function ?cfq_slice_idle_us_store?: block/cfq-iosched.c:4775:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (__data < (MIN)) \ ^ block/cfq-iosched.c:4782:1: note: in expansion of macro ?USEC_STORE_FUNCTION? USEC_STORE_FUNCTION(cfq_slice_idle_us_store, &cfqd->cfq_slice_idle, 0, UINT_MAX); ^~~~~~~~~~~~~~~~~~~ block/cfq-iosched.c: In function ?cfq_group_idle_us_store?: block/cfq-iosched.c:4775:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (__data < (MIN)) \ ^ block/cfq-iosched.c:4783:1: note: in expansion of macro ?USEC_STORE_FUNCTION? USEC_STORE_FUNCTION(cfq_group_idle_us_store, &cfqd->cfq_group_idle, 0, UINT_MAX); ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Bart Van Assche Signed-off-by: Jens Axboe commit 9b4f43460dd0ee461f5dd65ee1efa152f2e52559 Author: Bart Van Assche Date: Tue Aug 7 16:17:28 2018 -0700 cfq: Annotate fall-through in a switch statement This patch avoids that gcc complains about fall-through when building with W=1. Signed-off-by: Bart Van Assche Signed-off-by: Jens Axboe commit 2f0025675fe51a353e308c38fc7ee0ad75151ef2 Author: Paul Burton Date: Tue Aug 7 16:09:56 2018 -0700 MIPS: VDSO: Force link endianness When building the VDSO with clang it appears to invoke ld without specifying endianness, even though clang itself was provided with a -EB or -EL flag. This results in the build failing due to a mismatch between the objects that are the input to ld, and the output it is attempting to create: VDSO arch/mips/vdso/vdso.so.dbg.raw mips-linux-ld: arch/mips/vdso/elf.o: compiled for a big endian system and target is little endian mips-linux-ld: arch/mips/vdso/elf.o: endianness incompatible with that of the selected emulation mips-linux-ld: failed to merge target specific data of file arch/mips/vdso/elf.o ... Work around this problem by explicitly specifying the link endianness using -Wl,-EB or -Wl,-EL when -EB or -EL are part of KBUILD_CFLAGS. This resolves the build failure when using clang, and doesn't have any negative effect on gcc. Signed-off-by: Paul Burton commit c6d6f4c55f5cda5a7fa5a08eede0eb289937c328 Author: Paul Burton Date: Tue Aug 7 16:06:41 2018 -0700 MIPS: Always specify -EB or -EL when using clang When building using clang, always specify -EB or -EL in order to ensure we target the desired endianness. Since clang cross compiles using a single compiler build with multiple targets, our -dumpmachine tests which don't specify clang's --target argument check output based upon the build machine rather than the machine our build will target. This means our detection of whether to specify -EB fails miserably & we never do. Providing the endianness flag unconditionally for clang resolves this issue & simplifies the clang path somewhat. Signed-off-by: Paul Burton commit 541ad323db3a692a80c276785a15790ba52da24b Author: Nir Dotan Date: Tue Aug 7 19:41:55 2018 +0300 selftests: forwarding: gre_multipath: Update next-hop statistics match criteria gre_multipath test was using egress vlan_id matching on flows, for the purpose of collecting next-hops statistics, later to be compared against configured weights. As matching on vlan_id on egress direction is not supported on all HW devices, change the match criteria to use destination IP. Signed-off-by: Nir Dotan Acked-by: Petr Machata Signed-off-by: David S. Miller commit 736ac8146404560215e7aaf4e28fc2d8746a72d1 Author: Keara Leibovitz Date: Tue Aug 7 15:18:43 2018 -0400 tc-tests: initial version of nat action unit tests Initial set of nat action unit tests. Signed-off-by: Keara Leibovitz Signed-off-by: David S. Miller commit 4df9085b012d40db92a9e08e9ed891ddeed78af1 Merge: 7116983174ff 6fdecfe32f90 Author: David S. Miller Date: Tue Aug 7 15:48:38 2018 -0700 Merge branch 'brcm-omega' Arun Parameswaran says: ==================== Add Broadcom Omega SoC internal switch and phy The patchset is based on David Miller's "net-next" repo. The patches add support for the Broadcom Omega SoC's internal ethernet switch and the internal gphy. The internal ethernet switch in the Omega is a b53 srab based switch. The support for the switch is added to the b53 driver in the dsa framework. The gphy support is added to the bcm7xxx driver. ==================== Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6fdecfe32f903d9f5f35ee4464fd32ede470dcad Author: Arun Parameswaran Date: Tue Aug 7 10:02:44 2018 -0700 net: phy: Add support for Broadcom Omega internal Combo GPHY Add support for the Broadcom Omega SoC internal Combo Ethernet GPHY to the bcm7xxx phy driver. Signed-off-by: Arun Parameswaran Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ae7a03bbcf08737957c66c0e75238c97cc221e44 Author: Arun Parameswaran Date: Tue Aug 7 10:02:43 2018 -0700 net: dsa: b53: Add support for Broadcom Omega SoC internal switch Add support for the Broadcom Omega SoC internal ethernet switch to the b53 srab driver in the DSA framework. Signed-off-by: Arun Parameswaran Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit b0a0962519e3bf03bfc5e14c1dc4c21f00f69861 Author: Arun Parameswaran Date: Tue Aug 7 10:02:42 2018 -0700 dt-bindings: net: dsa: Add compatibility strings for Broadcom Omega Add compatibility strings for the internal switch in the Broadcom Omega SoC family (BCM5831X/BCM1140X) to B53. Signed-off-by: Arun Parameswaran Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 7116983174ff8cfa2342c201f70e676c4fac93c8 Merge: ee3444e42f5c 333e2f2cea6c Author: David S. Miller Date: Tue Aug 7 15:43:12 2018 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 40GbE Intel Wired LAN Driver Updates 2018-08-07 This series contains updates to i40e and i40evf only. Sergey cleans up a duplicate call to i40e_prep_for_reset() during shutdown. YueHaibing cleans up i40evf by removing code that was never being used or called within the driver. Jake updates the ethtool statistics to use a helper function since many of the statistics use the same basic logic for copying strings into the supplied buffer. Cleaned up the use of a local variable that is no longer needed or used. Fixed additional stats issues, including the failure to update the data pointer which was causing stats to be reported incorrectly. Mariusz fixes a bug where there was an oversight in configuring FEC when link settings were forced which was causing 25G link to be configured incorrectly. Piotr adds a missing return code for when the firmware returns a busy state. Also added the process to command firmware to start rearrangement when switching between old NVM structure to the new flat NVM. ==================== Signed-off-by: David S. Miller commit 16a3fe634f6a568c6234b8747e5d50487fed3526 Author: Joerg Roedel Date: Tue Aug 7 12:24:31 2018 +0200 x86/mm/pti: Clone kernel-image on PTE level for 32 bit On 32 bit the kernel sections are not huge-page aligned. When we clone them on PMD-level we unevitably map some areas that are normal kernel memory and may contain secrets to user-space. To prevent that we need to clone the kernel-image on PTE-level for 32 bit. Also make the page-table cloning code more general so that it can handle PMD and PTE level cloning. This can be generalized further in the future to also handle clones on the P4D-level. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1533637471-30953-4-git-send-email-joro@8bytes.org commit 30514effc9206d4e084ec32239ae221db157d43a Author: Joerg Roedel Date: Tue Aug 7 12:24:30 2018 +0200 x86/mm/pti: Don't clear permissions in pti_clone_pmd() The function sets the global-bit on cloned PMD entries, which only makes sense when the permissions are identical between the user and the kernel page-table. Further, only write-permissions are cleared for entry-text and kernel-text sections, which are not writeable at the end of the boot process. The reason why this RW clearing exists is that in the early PTI implementations the cloned kernel areas were set up during early boot before the kernel text is set to read only and not touched afterwards. This is not longer true. The cloned areas are still set up early to get the entry code working for interrupts and other things, but after the kernel text has been set RO the clone is repeated which copies the RO PMD/PTEs over to the user visible clone. That means the initial clearing of the writable bit can be avoided. [ tglx: Amended changelog ] Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Acked-by: Dave Hansen Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1533637471-30953-3-git-send-email-joro@8bytes.org commit 7e4237faa7213c1cc1d0aa65a44c67ba4729ce9f Author: nixiaoming Date: Sun Aug 5 17:10:36 2018 +0800 selinux: cleanup dentry and inodes on error in selinuxfs If the resource requested by d_alloc_name is not added to the linked list through d_add, then dput needs to be called to release the subsequent abnormal branch to avoid resource leakage. Add missing dput to selinuxfs.c Signed-off-by: nixiaoming [PM: tweak the subject line] Signed-off-by: Paul Moore commit 2887e41b910bb14fd847cf01ab7a5993db989d88 Author: Anchal Agarwal Date: Tue Aug 7 14:40:49 2018 -0600 blk-wbt: Avoid lock contention and thundering herd issue in wbt_wait I am currently running a large bare metal instance (i3.metal) on EC2 with 72 cores, 512GB of RAM and NVME drives, with a 4.18 kernel. I have a workload that simulates a database workload and I am running into lockup issues when writeback throttling is enabled,with the hung task detector also kicking in. Crash dumps show that most CPUs (up to 50 of them) are all trying to get the wbt wait queue lock while trying to add themselves to it in __wbt_wait (see stack traces below). [ 0.948118] CPU: 45 PID: 0 Comm: swapper/45 Not tainted 4.14.51-62.38.amzn1.x86_64 #1 [ 0.948119] Hardware name: Amazon EC2 i3.metal/Not Specified, BIOS 1.0 10/16/2017 [ 0.948120] task: ffff883f7878c000 task.stack: ffffc9000c69c000 [ 0.948124] RIP: 0010:native_queued_spin_lock_slowpath+0xf8/0x1a0 [ 0.948125] RSP: 0018:ffff883f7fcc3dc8 EFLAGS: 00000046 [ 0.948126] RAX: 0000000000000000 RBX: ffff887f7709ca68 RCX: ffff883f7fce2a00 [ 0.948128] RDX: 000000000000001c RSI: 0000000000740001 RDI: ffff887f7709ca68 [ 0.948129] RBP: 0000000000000002 R08: 0000000000b80000 R09: 0000000000000000 [ 0.948130] R10: ffff883f7fcc3d78 R11: 000000000de27121 R12: 0000000000000002 [ 0.948131] R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000 [ 0.948132] FS: 0000000000000000(0000) GS:ffff883f7fcc0000(0000) knlGS:0000000000000000 [ 0.948134] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.948135] CR2: 000000c424c77000 CR3: 0000000002010005 CR4: 00000000003606e0 [ 0.948136] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 0.948137] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 0.948138] Call Trace: [ 0.948139] [ 0.948142] do_raw_spin_lock+0xad/0xc0 [ 0.948145] _raw_spin_lock_irqsave+0x44/0x4b [ 0.948149] ? __wake_up_common_lock+0x53/0x90 [ 0.948150] __wake_up_common_lock+0x53/0x90 [ 0.948155] wbt_done+0x7b/0xa0 [ 0.948158] blk_mq_free_request+0xb7/0x110 [ 0.948161] __blk_mq_complete_request+0xcb/0x140 [ 0.948166] nvme_process_cq+0xce/0x1a0 [nvme] [ 0.948169] nvme_irq+0x23/0x50 [nvme] [ 0.948173] __handle_irq_event_percpu+0x46/0x300 [ 0.948176] handle_irq_event_percpu+0x20/0x50 [ 0.948179] handle_irq_event+0x34/0x60 [ 0.948181] handle_edge_irq+0x77/0x190 [ 0.948185] handle_irq+0xaf/0x120 [ 0.948188] do_IRQ+0x53/0x110 [ 0.948191] common_interrupt+0x87/0x87 [ 0.948192] .... [ 0.311136] CPU: 4 PID: 9737 Comm: run_linux_amd64 Not tainted 4.14.51-62.38.amzn1.x86_64 #1 [ 0.311137] Hardware name: Amazon EC2 i3.metal/Not Specified, BIOS 1.0 10/16/2017 [ 0.311138] task: ffff883f6e6a8000 task.stack: ffffc9000f1ec000 [ 0.311141] RIP: 0010:native_queued_spin_lock_slowpath+0xf5/0x1a0 [ 0.311142] RSP: 0018:ffffc9000f1efa28 EFLAGS: 00000046 [ 0.311144] RAX: 0000000000000000 RBX: ffff887f7709ca68 RCX: ffff883f7f722a00 [ 0.311145] RDX: 0000000000000035 RSI: 0000000000d80001 RDI: ffff887f7709ca68 [ 0.311146] RBP: 0000000000000202 R08: 0000000000140000 R09: 0000000000000000 [ 0.311147] R10: ffffc9000f1ef9d8 R11: 000000001a249fa0 R12: ffff887f7709ca68 [ 0.311148] R13: ffffc9000f1efad0 R14: 0000000000000000 R15: ffff887f7709ca00 [ 0.311149] FS: 000000c423f30090(0000) GS:ffff883f7f700000(0000) knlGS:0000000000000000 [ 0.311150] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.311151] CR2: 00007feefcea4000 CR3: 0000007f7016e001 CR4: 00000000003606e0 [ 0.311152] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 0.311153] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 0.311154] Call Trace: [ 0.311157] do_raw_spin_lock+0xad/0xc0 [ 0.311160] _raw_spin_lock_irqsave+0x44/0x4b [ 0.311162] ? prepare_to_wait_exclusive+0x28/0xb0 [ 0.311164] prepare_to_wait_exclusive+0x28/0xb0 [ 0.311167] wbt_wait+0x127/0x330 [ 0.311169] ? finish_wait+0x80/0x80 [ 0.311172] ? generic_make_request+0xda/0x3b0 [ 0.311174] blk_mq_make_request+0xd6/0x7b0 [ 0.311176] ? blk_queue_enter+0x24/0x260 [ 0.311178] ? generic_make_request+0xda/0x3b0 [ 0.311181] generic_make_request+0x10c/0x3b0 [ 0.311183] ? submit_bio+0x5c/0x110 [ 0.311185] submit_bio+0x5c/0x110 [ 0.311197] ? __ext4_journal_stop+0x36/0xa0 [ext4] [ 0.311210] ext4_io_submit+0x48/0x60 [ext4] [ 0.311222] ext4_writepages+0x810/0x11f0 [ext4] [ 0.311229] ? do_writepages+0x3c/0xd0 [ 0.311239] ? ext4_mark_inode_dirty+0x260/0x260 [ext4] [ 0.311240] do_writepages+0x3c/0xd0 [ 0.311243] ? _raw_spin_unlock+0x24/0x30 [ 0.311245] ? wbc_attach_and_unlock_inode+0x165/0x280 [ 0.311248] ? __filemap_fdatawrite_range+0xa3/0xe0 [ 0.311250] __filemap_fdatawrite_range+0xa3/0xe0 [ 0.311253] file_write_and_wait_range+0x34/0x90 [ 0.311264] ext4_sync_file+0x151/0x500 [ext4] [ 0.311267] do_fsync+0x38/0x60 [ 0.311270] SyS_fsync+0xc/0x10 [ 0.311272] do_syscall_64+0x6f/0x170 [ 0.311274] entry_SYSCALL_64_after_hwframe+0x42/0xb7 In the original patch, wbt_done is waking up all the exclusive processes in the wait queue, which can cause a thundering herd if there is a large number of writer threads in the queue. The original intention of the code seems to be to wake up one thread only however, it uses wake_up_all() in __wbt_done(), and then uses the following check in __wbt_wait to have only one thread actually get out of the wait loop: if (waitqueue_active(&rqw->wait) && rqw->wait.head.next != &wait->entry) return false; The problem with this is that the wait entry in wbt_wait is define with DEFINE_WAIT, which uses the autoremove wakeup function. That means that the above check is invalid - the wait entry will have been removed from the queue already by the time we hit the check in the loop. Secondly, auto-removing the wait entries also means that the wait queue essentially gets reordered "randomly" (e.g. threads re-add themselves in the order they got to run after being woken up). Additionally, new requests entering wbt_wait might overtake requests that were queued earlier, because the wait queue will be (temporarily) empty after the wake_up_all, so the waitqueue_active check will not stop them. This can cause certain threads to starve under high load. The fix is to leave the woken up requests in the queue and remove them in finish_wait() once the current thread breaks out of the wait loop in __wbt_wait. This will ensure new requests always end up at the back of the queue, and they won't overtake requests that are already in the wait queue. With that change, the loop in wbt_wait is also in line with many other wait loops in the kernel. Waking up just one thread drastically reduces lock contention, as does moving the wait queue add/remove out of the loop. A significant drop in lockdep's lock contention numbers is seen when running the test application on the patched kernel. Signed-off-by: Anchal Agarwal Signed-off-by: Frank van der Linden Signed-off-by: Jens Axboe commit 824da016fde1de98ab92c5b9df1b52433edd1594 Merge: 8dd931f46eea 3237c0dbe21f Author: Dave Airlie Date: Wed Aug 8 06:26:09 2018 +1000 Merge tag 'drm-intel-next-fixes-2018-08-06' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Fix gvt compilation broken on a silent conflict on fixes vs next merge - Fix runtime PM for LPE audio - Revert on ICL workaround - Interactive RPS mode - Fix for PSR sink status report Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180806233034.GA20655@intel.com commit 8dd931f46eea1a7971a700ec9eb99b879871a059 Merge: 940fbcb73fd2 2ead1be54b22 Author: Dave Airlie Date: Wed Aug 8 06:22:56 2018 +1000 Merge tag 'drm-misc-next-fixes-2018-08-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Fixes an oops on the DP CEC code and a memory leak on the vkms driver. Signed-off-by: Dave Airlie From: Gustavo Padovan Link: https://patchwork.freedesktop.org/patch/msgid/20180802111728.GA27945@juma commit 940fbcb73fd25b517fa10c5a9cc96ca0ce1a2fc4 Merge: 569f0a8694d0 df36b2fb8390 Author: Dave Airlie Date: Wed Aug 8 06:09:08 2018 +1000 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next Fixes for 4.19: - Fix UVD 7.2 instance handling - Fix UVD 7.2 harvesting - GPU scheduler fix for when a process is killed - TTM cleanups - amdgpu CS bo_list fixes - Powerplay fixes for polaris12 and CZ/ST - DC fixes for link training certain HMDs - DC fix for vega10 blank screen in certain cases From: Alex Deucher Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180801222906.1016-1-alexander.deucher@amd.com commit ee3444e42f5ccb6875936f9a577bb62ca102ac5a Merge: 5941923da29e 61be82b087e2 Author: David S. Miller Date: Tue Aug 7 13:22:11 2018 -0700 Merge branch 'qed-Add-Multi-TC-RoCE-support' Denis Bolotin says: ==================== qed: Add Multi-TC RoCE support This patch series adds support for multiple concurrent traffic classes for RoCE. The first three patches enable the required parts of the driver to learn the TC configuration, and the last one makes use of it to enable the feature. Please consider applying this to net-next. V1->V2: ------- Avoid allocation in qed_dcbx_get_priority_tc(). Move qed_dcbx_get_priority_tc() out of CONFIG_DCB section since it doesn't call qed_dcbx_query_params() anymore. v2->V3: ------- patch 1/3: qed_dcbx_get_priority_tc() always returns a valid TC by value. In error cases, it returns QED_DCBX_DEFAULT_TC (currently defined 0). patch 3/3: Cosmetic changes in qed_dev.c. ==================== Signed-off-by: David S. Miller commit 61be82b087e201511bc53cf614f733dee1f47344 Author: Denis Bolotin Date: Tue Aug 7 15:48:10 2018 +0300 qed: Add Multi-TC RoCE support RoCE qps use a pair of physical queues (pq) received from the Queue Manager (QM) - an offload queue (OFLD) and a low latency queue (LLT). The QM block creates a pq for each TC, and allows RoCE qps to ask for a pq with a specific TC. As a result, qps with different VLAN priorities can be mapped to different TCs, and employ features such as PFC and ETS. Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior Signed-off-by: Denis Bolotin Signed-off-by: David S. Miller commit c4259dda171920bf25f92756aa5a5fd17bf7e19e Author: Denis Bolotin Date: Tue Aug 7 15:48:09 2018 +0300 qed: Add a flag which indicates if offload TC is set Distinguish not set offload_tc from offload_tc 0 and add getters and setters. Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior Signed-off-by: Denis Bolotin Signed-off-by: David S. Miller commit 2a1cb1bf439f6703f82f61d0424b41f42544e3ff Author: Denis Bolotin Date: Tue Aug 7 15:48:08 2018 +0300 qed: Add DCBX API - qed_dcbx_get_priority_tc() The API receives a priority and looks for the TC it is mapped to in the operational DCBX configuration. The API returns QED_DCBX_DEFAULT_TC (0) when DCBX is disabled. Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior Signed-off-by: Denis Bolotin Signed-off-by: David S. Miller commit 5941923da29e84bc9e2a1abb2c14fffaf8d71e2f Author: YueHaibing Date: Tue Aug 7 19:34:16 2018 +0800 RDS: IB: fix 'passing zero to ERR_PTR()' warning Fix a static code checker warning: net/rds/ib_frmr.c:82 rds_ib_alloc_frmr() warn: passing zero to 'ERR_PTR' The error path for ib_alloc_mr failure should set err to PTR_ERR. Fixes: 1659185fb4d0 ("RDS: IB: Support Fastreg MR (FRMR) memory registration mode") Signed-off-by: YueHaibing Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit 6f705733b7d0d55e854e05d5883b89f19b381a95 Merge: 334b126fc944 653e92a9175e Author: David S. Miller Date: Tue Aug 7 13:18:50 2018 -0700 Merge branch 'macb-add-pad-and-fcs-support' Claudiu Beznea says: ==================== net: macb: add pad and fcs support In [1] it was reported that UDP checksum is offloaded to hardware no mather it was previously computed in software or not. The proposal on [1] was to disable TX checksum offload. This series (mostly patch 3/3) address the issue described at [1] by setting NOCRC bit to TX buffer descriptor for SKBs that arrived from networking stack with checksum computed. For these packets padding and FCS need to be added (hardware doesn't compute them if NOCRC bit is set). The minimum packet size that hardware expects is 64 bytes (including FCS). This feature could not be used in case of GSO, so, it was used only for no GSO SKBs. For SKBs wich requires padding and FCS computation macb_pad_and_fcs() checks if there is enough headroom and tailroom in SKB to avoid copying SKB structure. Since macb_pad_and_fcs() may change SKB the macb_pad_and_fcs() was places in macb_start_xmit() b/w macb_csum_clear() and skb_headlen() calls. This patch was tested with pktgen in kernel tool in a script like this: (pktgen_sample01_simple.sh is at [2]): minSize=1 maxSize=1500 for i in `seq $minSize $maxSize` ; do copy="$(shuf -i 1-2000 -n 1)" ./pktgen_sample01_simple.sh -i eth0 \ -m -d -x -s $i -c $copy done minStep=1 maxStep=200 for i in `seq $minStep $maxStep` ; do copy="$(shuf -i 1-2000 -n 1)" size="$(shuf -i 1-1500 -n 1)" ./pktgen_sample01_simple.sh -i eth0 \ -m -d -x -s $size -c $copy done Changes since RFC: - in patch 3/3 order local variables by their lenght (reverse christmas tree format) [1] https://www.spinics.net/lists/netdev/msg505065.html [2] https://github.com/netoptimizer/network-testing/blob/master/pktgen/pktgen_sample01_simple.sh ==================== Signed-off-by: David S. Miller commit 653e92a9175ea7ed67efe209c725222051a3713d Author: Claudiu Beznea Date: Tue Aug 7 12:25:14 2018 +0300 net: macb: add support for padding and fcs computation For packets with computed IP/TCP/UDP checksum there is no need to tell hardware to recompute it. For such kind of packets hardware expects the packet to be at least 64 bytes and FCS to be computed. Signed-off-by: Claudiu Beznea Signed-off-by: David S. Miller commit 33729f25a31e84e665b5441181bf98a514740fcf Author: Claudiu Beznea Date: Tue Aug 7 12:25:13 2018 +0300 net: macb: move checksum clearing outside of spinlock Move checksum clearing outside of spinlock. The SKB is protected by networking lock (HARD_TX_LOCK()). Signed-off-by: Claudiu Beznea Signed-off-by: David S. Miller commit d1c38957aaf3defe029f11761f3a4ae4c83ad690 Author: Claudiu Beznea Date: Tue Aug 7 12:25:12 2018 +0300 net: macb: use netdev_tx_t return type for ndo_start_xmit functions Use netdev_tx_t return type for ndo_start_xmit function of macb driver. Signed-off-by: Claudiu Beznea Signed-off-by: David S. Miller commit 5800dc5c19f34e6e03b5adab1282535cb102fafd Author: Peter Zijlstra Date: Fri Aug 3 16:41:39 2018 +0200 x86/paravirt: Fix spectre-v2 mitigations for paravirt guests Nadav reported that on guests we're failing to rewrite the indirect calls to CALLEE_SAVE paravirt functions. In particular the pv_queued_spin_unlock() call is left unpatched and that is all over the place. This obviously wrecks Spectre-v2 mitigation (for paravirt guests) which relies on not actually having indirect calls around. The reason is an incorrect clobber test in paravirt_patch_call(); this function rewrites an indirect call with a direct call to the _SAME_ function, there is no possible way the clobbers can be different because of this. Therefore remove this clobber check. Also put WARNs on the other patch failure case (not enough room for the instruction) which I've not seen trigger in my (limited) testing. Three live kernel image disassemblies for lock_sock_nested (as a small function that illustrates the problem nicely). PRE is the current situation for guests, POST is with this patch applied and NATIVE is with or without the patch for !guests. PRE: (gdb) disassemble lock_sock_nested Dump of assembler code for function lock_sock_nested: 0xffffffff817be970 <+0>: push %rbp 0xffffffff817be971 <+1>: mov %rdi,%rbp 0xffffffff817be974 <+4>: push %rbx 0xffffffff817be975 <+5>: lea 0x88(%rbp),%rbx 0xffffffff817be97c <+12>: callq 0xffffffff819f7160 <_cond_resched> 0xffffffff817be981 <+17>: mov %rbx,%rdi 0xffffffff817be984 <+20>: callq 0xffffffff819fbb00 <_raw_spin_lock_bh> 0xffffffff817be989 <+25>: mov 0x8c(%rbp),%eax 0xffffffff817be98f <+31>: test %eax,%eax 0xffffffff817be991 <+33>: jne 0xffffffff817be9ba 0xffffffff817be993 <+35>: movl $0x1,0x8c(%rbp) 0xffffffff817be99d <+45>: mov %rbx,%rdi 0xffffffff817be9a0 <+48>: callq *0xffffffff822299e8 0xffffffff817be9a7 <+55>: pop %rbx 0xffffffff817be9a8 <+56>: pop %rbp 0xffffffff817be9a9 <+57>: mov $0x200,%esi 0xffffffff817be9ae <+62>: mov $0xffffffff817be993,%rdi 0xffffffff817be9b5 <+69>: jmpq 0xffffffff81063ae0 <__local_bh_enable_ip> 0xffffffff817be9ba <+74>: mov %rbp,%rdi 0xffffffff817be9bd <+77>: callq 0xffffffff817be8c0 <__lock_sock> 0xffffffff817be9c2 <+82>: jmp 0xffffffff817be993 End of assembler dump. POST: (gdb) disassemble lock_sock_nested Dump of assembler code for function lock_sock_nested: 0xffffffff817be970 <+0>: push %rbp 0xffffffff817be971 <+1>: mov %rdi,%rbp 0xffffffff817be974 <+4>: push %rbx 0xffffffff817be975 <+5>: lea 0x88(%rbp),%rbx 0xffffffff817be97c <+12>: callq 0xffffffff819f7160 <_cond_resched> 0xffffffff817be981 <+17>: mov %rbx,%rdi 0xffffffff817be984 <+20>: callq 0xffffffff819fbb00 <_raw_spin_lock_bh> 0xffffffff817be989 <+25>: mov 0x8c(%rbp),%eax 0xffffffff817be98f <+31>: test %eax,%eax 0xffffffff817be991 <+33>: jne 0xffffffff817be9ba 0xffffffff817be993 <+35>: movl $0x1,0x8c(%rbp) 0xffffffff817be99d <+45>: mov %rbx,%rdi 0xffffffff817be9a0 <+48>: callq 0xffffffff810a0c20 <__raw_callee_save___pv_queued_spin_unlock> 0xffffffff817be9a5 <+53>: xchg %ax,%ax 0xffffffff817be9a7 <+55>: pop %rbx 0xffffffff817be9a8 <+56>: pop %rbp 0xffffffff817be9a9 <+57>: mov $0x200,%esi 0xffffffff817be9ae <+62>: mov $0xffffffff817be993,%rdi 0xffffffff817be9b5 <+69>: jmpq 0xffffffff81063aa0 <__local_bh_enable_ip> 0xffffffff817be9ba <+74>: mov %rbp,%rdi 0xffffffff817be9bd <+77>: callq 0xffffffff817be8c0 <__lock_sock> 0xffffffff817be9c2 <+82>: jmp 0xffffffff817be993 End of assembler dump. NATIVE: (gdb) disassemble lock_sock_nested Dump of assembler code for function lock_sock_nested: 0xffffffff817be970 <+0>: push %rbp 0xffffffff817be971 <+1>: mov %rdi,%rbp 0xffffffff817be974 <+4>: push %rbx 0xffffffff817be975 <+5>: lea 0x88(%rbp),%rbx 0xffffffff817be97c <+12>: callq 0xffffffff819f7160 <_cond_resched> 0xffffffff817be981 <+17>: mov %rbx,%rdi 0xffffffff817be984 <+20>: callq 0xffffffff819fbb00 <_raw_spin_lock_bh> 0xffffffff817be989 <+25>: mov 0x8c(%rbp),%eax 0xffffffff817be98f <+31>: test %eax,%eax 0xffffffff817be991 <+33>: jne 0xffffffff817be9ba 0xffffffff817be993 <+35>: movl $0x1,0x8c(%rbp) 0xffffffff817be99d <+45>: mov %rbx,%rdi 0xffffffff817be9a0 <+48>: movb $0x0,(%rdi) 0xffffffff817be9a3 <+51>: nopl 0x0(%rax) 0xffffffff817be9a7 <+55>: pop %rbx 0xffffffff817be9a8 <+56>: pop %rbp 0xffffffff817be9a9 <+57>: mov $0x200,%esi 0xffffffff817be9ae <+62>: mov $0xffffffff817be993,%rdi 0xffffffff817be9b5 <+69>: jmpq 0xffffffff81063ae0 <__local_bh_enable_ip> 0xffffffff817be9ba <+74>: mov %rbp,%rdi 0xffffffff817be9bd <+77>: callq 0xffffffff817be8c0 <__lock_sock> 0xffffffff817be9c2 <+82>: jmp 0xffffffff817be993 End of assembler dump. Fixes: 63f70270ccd9 ("[PATCH] i386: PARAVIRT: add common patching machinery") Fixes: 3010a0663fd9 ("x86/paravirt, objtool: Annotate indirect calls") Reported-by: Nadav Amit Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Juergen Gross Cc: Konrad Rzeszutek Wilk Cc: Boris Ostrovsky Cc: David Woodhouse Cc: stable@vger.kernel.org commit 569f0a8694d0ff13c5d296a594c7d8cec8d6f35f Merge: a7ccc5a43b82 5b1474655323 Author: Dave Airlie Date: Wed Aug 8 06:07:06 2018 +1000 Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next From: Lucas Stach "not much to de-stage this time. Changes from Philipp and Souptick to use memset32 more and switch the fault handler to the new vm_fault_t and two small fixes for issues that can be hit in rare corner cases from me." Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/1533563808.2809.7.camel@pengutronix.de commit a7ccc5a43b829a96b4c62c0de71fc8c6fbd17b8a Merge: 253265902121 926a299c42e3 Author: Dave Airlie Date: Wed Aug 8 05:52:15 2018 +1000 Merge branch 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next From: Russell King As per the patches posted, discussed and tested by Peter Rosin, this converts TDA998x to a bridge driver, while still allowing Armada and TI LCDC to continue using it as they always have done. It also gets rid of the private .fill_modes function, and tweaks the TMDS divider calculation to be more correct to the available information. [airlied: fixed two conflicts] Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180802093421.GA29670@rmk-PC.armlinux.org.uk commit 2532659021213f3604615add95c095a2f3bde748 Merge: 15da09500a70 d664b851eb2b Author: Dave Airlie Date: Wed Aug 8 05:51:16 2018 +1000 Merge branch 'for-upstream/hdlcd' of git://linux-arm.org/linux-ld into drm-next From: Liviu Dudau "I managed to loose track of a few patches for HDLCD while focusing on Mali DP and found them again when investigating an issue with the way HDLCD behaves on teardown. They can go into drm-next for one of the v4.19-rcX if you're not going to do another pull request before the merge window." Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180731170831.GF17455@e110455-lin.cambridge.arm.com commit 334b126fc9441a2ceb1e905aa4db5d462d35c0d2 Merge: 7395a8845588 c9008d339bc4 Author: David S. Miller Date: Tue Aug 7 12:46:28 2018 -0700 Merge branch 'ibmvnic-next' Thomas Falcon says: ==================== ibmvnic: Update firmware error reporting This patch set cleans out a lot of dead code from the ibmvnic driver and adds some more. The error ID field of the descriptor is not filled in by firmware, so do not print it and do not use it to query for more detailed information. Remove the unused code written for this. Finally, update the message to print a string explainng the error cause instead of just the error code. ==================== Signed-off-by: David S. Miller commit c9008d339bc40301a486ea62f36f106c4b2aad0e Author: Thomas Falcon Date: Mon Aug 6 21:39:59 2018 -0500 ibmvnic: Update firmware error reporting with cause string Print a string instead of the error code. Since there is a possibility that the driver can recover, classify it as a warning instead of an error. Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller commit 79dabbb7161f43ed29ca888a2488f59e47171aee Author: Thomas Falcon Date: Mon Aug 6 21:39:58 2018 -0500 ibmvnic: Remove code to request error information When backing device firmware reports an error, it provides an error ID, which is meant to be queried for more detailed error information. Currently, however, an error ID is not provided by the Virtual I/O server and there are not any plans to do so. For now, it is always unfilled or zero, so request_error_information will never be called. Remove it. Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller commit 7395a8845588ebdf170f4d3796d44142458741be Author: Intiyaz Basha Date: Mon Aug 6 13:09:40 2018 -0700 liquidio: avoided acquiring post_lock for data only queues All control commands (soft commands) goes through only Queue 0 (control and data queue). So only queue-0 needs post_lock, other queues are only data queues and does not need post_lock Added a flag to indicate the queue can be used for soft commands. If this flag is set, post_lock must be acquired before posting a command to the queue. If this flag is clear, post_lock is invalid for the queue. Signed-off-by: Intiyaz Basha Signed-off-by: Felix Manlunas Signed-off-by: David S. Miller commit 3789cabaab1a939eb56edd76bbde2c2e49f081da Author: Shmulik Ladkani Date: Mon Aug 6 15:00:59 2018 +0300 ip6_tunnel: collect_md xmit: Use ip_tunnel_key's provided src address When using an ip6tnl device in collect_md mode, the xmit methods ignore the ipv6.src field present in skb_tunnel_info's key, both for route calculation purposes (flowi6 construction) and for assigning the packet's final ipv6h->saddr. This makes it impossible specifying a desired ipv6 local address in the encapsulating header (for example, when using tc action tunnel_key). This is also not aligned with behavior of ipip (ipv4) in collect_md mode, where the key->u.ipv4.src gets used. Fix, by assigning fl6.saddr with given key->u.ipv6.src. In case ipv6.src is not specified, ip6_tnl_xmit uses existing saddr selection code. Fixes: 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") Signed-off-by: Shmulik Ladkani Reviewed-by: Eyal Birger Signed-off-by: David S. Miller commit 7d2eb6de6e6315ad5b93b848ba14360b2370ac4d Author: Sean Wang Date: Wed Aug 8 01:52:49 2018 +0800 MAINTAINERS: add an entry for MediaTek Bluetooth driver Add an entry for the MediaTek Bluetooth driver. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 9ca6163005e6abdf2a39eb581abc6060f677a2d7 Author: Vlad Buslov Date: Mon Aug 6 11:27:10 2018 +0300 net: sched: cls_flower: set correct offload data in fl_reoffload fl_reoffload implementation sets following members of struct tc_cls_flower_offload incorrectly: - masked key instead of mask - key instead of masked key Fix fl_reoffload to provide correct data to offload callback. Fixes: 31533cba4327 ("net: sched: cls_flower: implement offload tcf_proto_op") Signed-off-by: Vlad Buslov Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 7237c4c9ec92e1a4f6ef1f712bf9105d7b392c6a Author: Sean Wang Date: Wed Aug 8 01:52:48 2018 +0800 Bluetooth: mediatek: Add protocol support for MediaTek serial devices This adds a driver based on serdev driver for the MediaTek serial protocol based on running H:4, which can enable the built-in Bluetooth device inside MT7622 SoC. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 819731596aec45012ebc1185b4276a4a0bbc95ac Author: Sean Wang Date: Wed Aug 8 01:52:47 2018 +0800 dt-bindings: net: bluetooth: Add mediatek-bluetooth Add binding document for a SoC built-in device using MediaTek protocol. Which could be found on MT7622 SoC or other similar MediaTek SoCs. Signed-off-by: Sean Wang Reviewed-by: Rob Herring Signed-off-by: Marcel Holtmann commit 468d677954c0d94fec59275d91222257fe8b4416 Author: Steve French Date: Sat Aug 4 05:24:34 2018 -0500 smb3: display stats counters for number of slow commands When CONFIG_CIFS_STATS2 is enabled keep counters for slow commands (ie server took longer than 1 second to respond) by SMB2/SMB3 command code. This can help in diagnosing whether performance problems are on server (instead of client) and which commands are causing the problem. Sample output (the new lines contain words "slow responses ...") $ cat /proc/fs/cifs/Stats Resources in use CIFS Session: 1 Share (unique mount targets): 2 SMB Request/Response Buffer: 1 Pool size: 5 SMB Small Req/Resp Buffer: 1 Pool size: 30 Total Large 10 Small 490 Allocations Operations (MIDs): 0 0 session 0 share reconnects Total vfs operations: 67 maximum at one time: 2 4 slow responses from localhost for command 5 1 slow responses from localhost for command 6 1 slow responses from localhost for command 14 1 slow responses from localhost for command 16 1) \\localhost\test SMBs: 243 Bytes read: 1024000 Bytes written: 104857600 TreeConnects: 1 total 0 failed TreeDisconnects: 0 total 0 failed Creates: 40 total 0 failed Closes: 39 total 0 failed ... Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky Reviewed-by: Aurelien Aptel commit a5c62f4833c2c8e6e0f35367b99b717b78f5c029 Author: Aurelien Aptel Date: Thu Aug 2 16:39:52 2018 +0200 CIFS: fix uninitialized ptr deref in smb2 signing server->secmech.sdeschmacsha256 is not properly initialized before smb2_shash_allocate(), set shash after that call. also fix typo in error message Fixes: 8de8c4608fe9 ("cifs: Fix validation of signed data in smb2") Signed-off-by: Aurelien Aptel Reviewed-by: Paulo Alcantara Reported-by: Xiaoli Feng Signed-off-by: Steve French CC: Stable commit fd09b7d3b352105f08b8e02f7afecf7e816380ef Author: Steve French Date: Thu Aug 2 20:28:18 2018 -0500 smb3: Do not send SMB3 SET_INFO if nothing changed An earlier commit had a typo which prevented the optimization from working: commit 18dd8e1a65dd ("Do not send SMB3 SET_INFO request if nothing is changing") Thank you to Metze for noticing this. Also clear a reserved field in the FILE_BASIC_INFO struct we send that should be zero (all the other fields in that struct were set or cleared explicitly already in cifs_set_file_info). Reviewed-by: Pavel Shilovsky CC: Stable # 4.9.x+ Reported-by: Stefan Metzmacher Signed-off-by: Steve French commit d258650004617fbd5dfe97d77d26fb37187d06e9 Author: Steve French Date: Wed Aug 1 22:34:04 2018 -0500 smb3: fix minor debug output for CONFIG_CIFS_STATS CONFIG_CIFS_STATS is now always enabled (to simplify the code and since the STATS are important for some common customer use cases and also debugging), but needed one minor change so that STATS shows as enabled in the debug output in /proc/fs/cifs/DebugData, otherwise it could get confusing with STATS no longer showing up in the "Features" list in /proc/fs/cifs/DebugData when basic stats were in fact available. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit 020eec5f712ffb4254233490076cc21600b810db Author: Steve French Date: Wed Aug 1 16:38:07 2018 -0500 smb3: add tracepoint for slow responses If responses take longer than one second from the server, we can optionally log them to dmesg in current cifs.ko code (CONFIG_CIFS_STATS2 must be configured and a /proc/fs/cifs/cifsFYI flag must be set), but can be more useful to log these via ftrace (tracepoint is smb3_slow_rsp) which is easier and more granular (still requires CONFIG_CIFS_STATS2 to be configured in the build though). Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit e0bba0b8548179b696e86c158ea8f45f2ef6ad14 Author: Ronnie Sahlberg Date: Wed Aug 1 09:26:13 2018 +1000 cifs: add compound_send_recv() Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 1f3a8f5f7ac3de4abae9d2c118ffaeed1676fe1c Author: Ronnie Sahlberg Date: Wed Aug 1 09:26:12 2018 +1000 cifs: make smb_send_rqst take an array of requests Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit d5082b27edf4cc653529c38ac531cf7a7d261a6f Merge: 50ee42b9ccb3 0a22b17a6b1d Author: David S. Miller Date: Tue Aug 7 12:22:15 2018 -0700 Merge branch 'nfp-ttl-tos-geneve' Simon Horman says: ==================== nfp: flower: tunnel TTL & TOS, and Geneve options set & match support this series contains updates for the TC Flower classifier and the offload facility for it in the NFP driver. * Patches 1 & 2: update the NFP driver to allow offload of matching and setting tunnel ToS/TTL of flows using the TC Flower classifier and tun_key action * Patches 3 & 4: enhance the flow dissector and TC Flower classifier to allow match on Geneve options * Patch 5 & 6: update the NFP driver to allow offload of matching and setting Geneve options of flows using the TC Flower classifier and tun_key action ==================== Signed-off-by: David S. Miller commit 0a22b17a6b1ddb161fae7452faa892ba4d77ebe9 Author: Pieter Jansen van Vuuren Date: Tue Aug 7 17:36:03 2018 +0200 nfp: flower: add geneve option match offload Introduce a new layer for matching on geneve options. This allows offloading filters configured to match geneve with options. Signed-off-by: Pieter Jansen van Vuuren Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 9e7c32fe44248b5101173b1184707bc5506e00f3 Author: Pieter Jansen van Vuuren Date: Tue Aug 7 17:36:02 2018 +0200 nfp: flower: add geneve option push action offload Introduce new push geneve option action. This allows offloading filters configured to entunnel geneve with options. Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 0a6e77784f490912d81b92cfd48424541c04691e Author: Pieter Jansen van Vuuren Date: Tue Aug 7 17:36:01 2018 +0200 net/sched: allow flower to match tunnel options Allow matching on options in Geneve tunnel headers. This makes use of existing tunnel metadata support. The options can be described in the form CLASS:TYPE:DATA/CLASS_MASK:TYPE_MASK:DATA_MASK, where CLASS is represented as a 16bit hexadecimal value, TYPE as an 8bit hexadecimal value and DATA as a variable length hexadecimal value. e.g. # ip link add name geneve0 type geneve dstport 0 external # tc qdisc add dev geneve0 ingress # tc filter add dev geneve0 protocol ip parent ffff: \ flower \ enc_src_ip 10.0.99.192 \ enc_dst_ip 10.0.99.193 \ enc_key_id 11 \ geneve_opts 0102:80:1122334421314151/ffff:ff:ffffffffffffffff \ ip_proto udp \ action mirred egress redirect dev eth1 This patch adds support for matching Geneve options in the order supplied by the user. This leads to an efficient implementation in the software datapath (and in our opinion hardware datapaths that offload this feature). It is also compatible with Geneve options matching provided by the Open vSwitch kernel datapath which is relevant here as the Flower classifier may be used as a mechanism to program flows into hardware as a form of Open vSwitch datapath offload (sometimes referred to as OVS-TC). The netlink Kernel/Userspace API may be extended, for example by adding a flag, if other matching options are desired, for example matching given options in any order. This would require an implementation in the TC software datapath. And be done in a way that drivers that facilitate offload of the Flower classifier can reject or accept such flows based on hardware datapath capabilities. This approach was discussed and agreed on at Netconf 2017 in Seoul. Signed-off-by: Simon Horman Signed-off-by: Pieter Jansen van Vuuren Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 92e2c4053623f21d61a683f7ef7bd61c8300ac7d Author: Simon Horman Date: Tue Aug 7 17:36:00 2018 +0200 flow_dissector: allow dissection of tunnel options from metadata Allow the existing 'dissection' of tunnel metadata to 'dissect' options already present in tunnel metadata. This dissection is controlled by a new dissector key, FLOW_DISSECTOR_KEY_ENC_OPTS. This dissection only occurs when skb_flow_dissect_tunnel_info() is called, currently only the Flower classifier makes that call. So there should be no impact on other users of the flow dissector. This is in preparation for allowing the flower classifier to match on Geneve options. Signed-off-by: Simon Horman Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit d7ff7ec573860dc654fa4c8641684ba3db03004e Author: John Hurley Date: Tue Aug 7 17:35:59 2018 +0200 nfp: flower: allow matching on ipv4 UDP tunnel tos and ttl The addition of FLOW_DISSECTOR_KEY_ENC_IP to TC flower means that the ToS and TTL of the tunnel header can now be matched on. Extend the NFP tunnel match function to include these new fields. Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 2a43747147699c6187d8508b40a28a50f42b0ee5 Author: John Hurley Date: Tue Aug 7 17:35:58 2018 +0200 nfp: flower: set ip tunnel ttl from encap action The TTL for encapsulating headers in IPv4 UDP tunnels is taken from a route lookup. Modify this to first check if a user has specified a TTL to be used in the TC action. Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit b2c96de7fe3cd306df039c89727cb137b89d82ef Author: Ronnie Sahlberg Date: Wed Aug 1 09:26:11 2018 +1000 cifs: update init_sg, crypt_message to take an array of rqst These are used for SMB3 encryption and compounded requests. Update these functions and the other functions related to SMB3 encryption to take an array of requests. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 333e2f2cea6cbffd75aa4969afad7409d7fad74c Author: Jacob Keller Date: Tue Jul 31 03:41:48 2018 -0700 i40e: fix i40e_add_queue_stats data pointer update This function accidentally failed to update the data pointer, which caused the reported stats to be incorrect. Additionally, statistics which follow queue stats in the output would potentially read non-zeroed garbage data from the ethtool buffer. This occurred because the data double pointer was not dereferenced before incrementing the size. Additionally, make sure this issue is more visible by adding a WARN_ONCE to the i40e_get_ethtool_stats function. This warning will trigger whenever the data pointer is not at the expected address, similar to the check that we make in the i40e_get_stat_strings() function. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit f05798b4ff82d919e94e5060d1e9993a3e025361 Author: Piotr Azarewicz Date: Tue Jul 31 03:41:47 2018 -0700 i40e: Add AQ command for rearrange NVM structure During switching between old NVM structure approach (called structured NVM) to new one (called flat NVM) or backward flash needs to be rearranged to required NVM structure. This is a part of transition from one NVM structure to another. The function is introduced to command firmware to start rearrangement process. Signed-off-by: Piotr Azarewicz Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit b2b57b29588c36920fe1364f3f24bebfbe8bf321 Author: Piotr Azarewicz Date: Tue Jul 31 03:41:46 2018 -0700 i40e: Add additional return code to i40e_asq_send_command Firmware can return a busy state, so the function return I40E_ERR_NOT_READY. Signed-off-by: Piotr Azarewicz Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 3de5e974ba65fd1629fb6ea0cb5222c78b1580ec Author: Steve French Date: Wed Aug 1 01:13:55 2018 -0500 smb3: update readme to correct information about /proc/fs/cifs/Stats Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit c281bc0c7412308c7ec0888904f7c99353da4796 Author: Steve French Date: Wed Aug 1 00:56:12 2018 -0500 smb3: fix reset of bytes read and written stats echo 0 > /proc/fs/cifs/Stats is supposed to reset the stats but there were four (see example below) that were not reset (bytes read and witten, total vfs ops and max ops at one time). ... 0 session 0 share reconnects Total vfs operations: 100 maximum at one time: 2 1) \\localhost\test SMBs: 0 Bytes read: 502092 Bytes written: 31457286 TreeConnects: 0 total 0 failed TreeDisconnects: 0 total 0 failed ... This patch fixes cifs_stats_proc_write to properly reset those four. Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit 52ce1ac4298309d76859307967c58835c0b2ce3e Author: Steve French Date: Tue Jul 31 01:46:47 2018 -0500 smb3: display bytes_read and bytes_written in smb3 stats We were only displaying bytes_read and bytes_written in cifs stats, fix smb3 stats to also display them. Sample output with this patch: cat /proc/fs/cifs/Stats: CIFS Session: 1 Share (unique mount targets): 2 SMB Request/Response Buffer: 1 Pool size: 5 SMB Small Req/Resp Buffer: 1 Pool size: 30 Operations (MIDs): 0 0 session 0 share reconnects Total vfs operations: 94 maximum at one time: 2 1) \\localhost\test SMBs: 214 Bytes read: 502092 Bytes written: 31457286 TreeConnects: 1 total 0 failed TreeDisconnects: 0 total 0 failed Creates: 52 total 3 failed Closes: 48 total 0 failed Flushes: 0 total 0 failed Reads: 17 total 0 failed Writes: 31 total 0 failed ... Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit fcabb89299d79010eb923afdd26de04afcc0527f Author: Steve French Date: Tue Jul 31 01:21:37 2018 -0500 cifs: simple stats should always be enabled CONFIG_CIFS_STATS should always be enabled as Pavel recently noted. Simple statistics are not a significant performance hit, and removing the ifdef simplifies the code slightly. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Reviewed-by: Pavel Shilovsky commit 9da6ec7775d2cd76df53fbf4f1f35f6d490204f5 Author: Ronnie Sahlberg Date: Tue Jul 31 08:48:22 2018 +1000 cifs: use a refcount to protect open/closing the cached file handle Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky Cc: commit bf1fdeb7899a86adfbe0b521bee5cf78bb870a14 Author: Steve French Date: Mon Jul 30 19:23:09 2018 -0500 smb3: add reconnect tracepoints Add tracepoints for reconnecting an smb3 session Example output (from trace-cmd) with the patch (showing the session marked for reconnect, the stat failing, and then the subsequent SMB3 commands after the server comes back up). The "smb3_reconnect" event is the new one. cifsd-25993 [000] .... 29635.368265: smb3_reconnect: server=localhost current_mid=0x1e stat-26200 [001] .... 29638.516403: smb3_enter: cifs_revalidate_dentry_attr: xid=22 stat-26200 [001] .... 29648.723296: smb3_exit_err: cifs_revalidate_dentry_attr: xid=22 rc=-112 kworker/0:1-22830 [000] .... 29653.850947: smb3_cmd_done: sid=0x0 tid=0x0 cmd=0 mid=0 kworker/0:1-22830 [000] .... 29653.851191: smb3_cmd_err: sid=0x8ae4683c tid=0x0 cmd=1 mid=1 status=0xc0000016 rc=-5 kworker/0:1-22830 [000] .... 29653.855254: smb3_cmd_done: sid=0x8ae4683c tid=0x0 cmd=1 mid=2 kworker/0:1-22830 [000] .... 29653.855482: smb3_cmd_done: sid=0x8ae4683c tid=0x8084f30d cmd=3 mid=3 Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Reviewed-by: Aurelien Aptel commit 6e2feaa344e651bc1a1ec224018827e36192c039 Author: Jacob Keller Date: Tue Jul 31 03:41:45 2018 -0700 i40e: fix warning about shadowed ring parameter In commit 147e81ec7568 ("i40e: Test memory before ethtool alloc succeeds") code was added to handle ring allocation on systems with low memory. It shadowed the ring parameter pointer by introducing a local ring pointer inside the for loop. Most of the code in the loop already just accessed the ring via &rx_rings[i]. Since most of the code already does this, just remove the local variable. If someone considers it worth keeping a local around, they should use it for the whole section instead of just a couple of accesses. This fixes a warning when -Wshadow is enabled Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 4d9768237c19d7bcea8b284ec98c04a5846977be Author: Jacob Keller Date: Tue Jul 31 03:41:44 2018 -0700 i40e: remove unnecessary i variable causing -Wshadow warning Commit c61c8fe1d592 ("i40e: Implement an ethtool private flag to stop LLDP in FW") added an extra for-loop which added a shadowing 'i' variable as the index. However, the local variable i already exists, and we already use it as a loop index. Additionally, at this point, there is no further use of the variable, so it's safe to simply overwrite the variable contents. This fixes a -Wshadow warning which has started being enabled on some distributions Signed-off-by: Jacob Keller Reviewed-by: Patryk Malek Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit e68a932b0b8e38eaa2111fc3aab31ff66988f1c4 Author: Steve French Date: Mon Jul 30 14:23:58 2018 -0500 smb3: add tracepoint for session expired or deleted In debugging reconnection problems, want to be able to more easily trace cases in which the server has marked the SMB3 session expired or deleted (to distinguish from timeout cases). Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit 06188fcf9c068a2a8e82ad1e2510a008373150e2 Author: Steve French Date: Sun Jul 29 17:13:39 2018 -0500 cifs: remove unused stats These timers were a good idea but weren't used in current code, and the idea was cifs specific. Future patch will add similar timers for SMB2/SMB3, but no sense using memory for cifs timers that aren't used in current code. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit 22783155f4bf956c346a81624ec9258930a6fe06 Author: Steve French Date: Fri Jul 27 22:01:49 2018 -0500 smb3: don't request leases in symlink creation and query Fixes problem pointed out by Pavel in discussions about commit 729c0c9dd55204f0c9a823ac8a7bfa83d36c7e78 Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg CC: Stable # 3.18.x+ commit 1995d28f84b3d2a8f586fcd271207f798b80ccd8 Author: Steve French Date: Fri Jul 27 15:14:04 2018 -0500 smb3: remove per-session operations from per-tree connection stats Remove counters from the per-tree connection /proc/fs/cifs/Stats output that will always be zero (since they are not per-tcon ops) ie SMB3 Negotiate, SessionSetup, Logoff, Echo, Cancel. Also clarify "sent" to be "total" per-Pavel's suggestion (since this "total" includes total for all operations that we try to send whether or not succesffully sent). Sample output below: Resources in use CIFS Session: 1 Share (unique mount targets): 2 SMB Request/Response Buffer: 1 Pool size: 5 SMB Small Req/Resp Buffer: 1 Pool size: 30 Operations (MIDs): 0 1 session 2 share reconnects Total vfs operations: 23 maximum at one time: 2 1) \\localhost\test SMBs: 45 TreeConnects: 2 total 0 failed TreeDisconnects: 0 total 0 failed Creates: 13 total 2 failed Closes: 9 total 0 failed Flushes: 0 total 0 failed Reads: 0 total 0 failed Writes: 1 total 0 failed Locks: 0 total 0 failed IOCTLs: 3 total 1 failed QueryDirectories: 4 total 2 failed ChangeNotifies: 0 total 0 failed QueryInfos: 10 total 0 failed SetInfos: 3 total 0 failed OplockBreaks: 0 sent 0 failed Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky commit 289131e1f1e6ad8c661ec05e176b8f0915672059 Author: Steve French Date: Mon Jul 23 09:15:18 2018 -0500 SMB3: Number of requests sent should be displayed for SMB3 not just CIFS For SMB2/SMB3 the number of requests sent was not displayed in /proc/fs/cifs/Stats unless CONFIG_CIFS_STATS2 was enabled (only number of failed requests displayed). As with earlier dialects, we should be displaying these counters if CONFIG_CIFS_STATS is enabled. They are important for debugging. e.g. when you cat /proc/fs/cifs/Stats (before the patch) Resources in use CIFS Session: 1 Share (unique mount targets): 2 SMB Request/Response Buffer: 1 Pool size: 5 SMB Small Req/Resp Buffer: 1 Pool size: 30 Operations (MIDs): 0 0 session 0 share reconnects Total vfs operations: 690 maximum at one time: 2 1) \\localhost\test SMBs: 975 Negotiates: 0 sent 0 failed SessionSetups: 0 sent 0 failed Logoffs: 0 sent 0 failed TreeConnects: 0 sent 0 failed TreeDisconnects: 0 sent 0 failed Creates: 0 sent 2 failed Closes: 0 sent 0 failed Flushes: 0 sent 0 failed Reads: 0 sent 0 failed Writes: 0 sent 0 failed Locks: 0 sent 0 failed IOCTLs: 0 sent 1 failed Cancels: 0 sent 0 failed Echos: 0 sent 0 failed QueryDirectories: 0 sent 63 failed Signed-off-by: Steve French Reviewed-by: Aurelien Aptel Reviewed-by: Pavel Shilovsky commit 8a69e96e610b3ec8a55f6fd4e44363452838caa7 Author: Steve French Date: Fri Jun 29 16:06:15 2018 -0500 smb3: snapshot mounts are read-only and make sure info is displayable about the mount snapshot mounts were not marked as read-only and did not display the snapshot time (in /proc/mounts) specified on mount With this patch - note that can not write to the snapshot mount (see "ro" in /proc/mounts line) and also the missing snapshot timewarp token time is dumped. Sample line from /proc/mounts with the patch: //127.0.0.1/scratch /mnt2 smb3 ro,relatime,vers=default,cache=strict,username=testuser,domain=,uid=0,noforceuid,gid=0,noforcegid,addr=127.0.0.1,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,noperm,rsize=1048576,wsize=1048576,echo_interval=60,snapshot=1234567,actimeo=1 0 0 Signed-off-by: Steve French Reviewed-by: Paulo Alcantara commit c3ed44026cd07fda5976ecb79225759901a160b4 Author: Steve French Date: Thu Jun 28 22:53:39 2018 -0500 smb3: remove noisy warning message on mount Some servers, like Samba, don't support the fsctl for query_network_interface_info so don't log a noisy warning message on mount for this by default unless the error is more serious. Lower the error to an FYI level so it does not get logged by default. Reviewed-by: Ronnie Sahlberg Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 0fdfef9aa7ee68ddd508aef7c98630cfc054f8d6 Author: Steve French Date: Thu Jun 28 19:30:23 2018 -0500 smb3: simplify code by removing CONFIG_CIFS_SMB311 We really, really want to be encouraging use of secure dialects, and SMB3.1.1 offers useful security features, and will soon be the recommended dialect for many use cases. Simplify the code by removing the CONFIG_CIFS_SMB311 ifdef so users don't disable it in the build, and create compatibility and/or security issues with modern servers - many of which have been supporting this dialect for multiple years. Also clarify some of the Kconfig text for cifs.ko about SMB3.1.1 and current supported features in the module. Signed-off-by: Steve French Acked-by: Aurelien Aptel Reviewed-by: Ronnie Sahlberg commit 950132afd59385caf6e2b84e5235d069fa10681d Author: Steve French Date: Thu Jun 28 18:46:40 2018 -0500 cifs: add missing debug entries for kconfig options /proc/fs/cifs/DebugData displays the features (Kconfig options) used to build cifs.ko but it was missing some, and needed comma separator. These can be useful in debugging certain problems so we know which optional features were enabled in the user's build. Also clarify them, by making them more closely match the corresponding CONFIG_CIFS_* parm. Old format: Features: dfs fscache posix spnego xattr acl New format: Features: DFS,FSCACHE,SMB_DIRECT,STATS,DEBUG2,ALLOW_INSECURE_LEGACY,CIFS_POSIX,UPCALL(SPNEGO),XATTR,ACL Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Reviewed-by: Pavel Shilovsky Reviewed-by: Paulo Alcantara CC: Stable commit 876fe8870dcebdfa7dbd03075f111065f47aef38 Author: Steve French Date: Thu Jun 28 17:52:03 2018 -0500 documentation update - remove old out of date feature info Following up on a suggestion by Matthew Wilcox ... The cifs CHANGES documentation file is out of date, and more current information is in the wiki. Delete the old version information that is of little use to make this documentation file more readable. CC: Matthew Wilcox Reviewed-by: Ronnie Sahlberg Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 2d304217832ea720337e7a6aa012aa828a77f9d4 Author: Steve French Date: Sun Jun 24 23:28:12 2018 -0500 smb3: add support for statfs for smb3.1.1 posix extensions Output now matches expected stat -f output for all fields except for Namelen and ID which were addressed in a companion patch (which retrieves them from existing SMB3 mechanisms and works whether POSIX enabled or not) Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit 21ba3845b59c733a79ed4fe1c4f3732e7ece9df7 Author: Steve French Date: Sun Jun 24 23:18:52 2018 -0500 smb3: fill in statfs fsid and correct namelen Fil in the correct namelen (typically 255 not 4096) in the statfs response and also fill in a reasonably unique fsid (in this case taken from the volume id, and the creation time of the volume). In the case of the POSIX statfs all fields are now filled in, and in the case of non-POSIX mounts, all fields are filled in which can be. Signed-off-by: Steve French CC: Stable Reviewed-by: Aurelien Aptel commit a12d0c590cc7ae01892f06c5ad6d19580ecdd0de Author: Paulo Alcantara Date: Sat Jun 23 14:52:25 2018 -0300 cifs: Make sure all data pages are signed correctly Check if every data page is signed correctly in sigining helper. Signed-off-by: Paulo Alcantara Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 256b4c3f03d77d8c0dc69e3a6ceb3afd0d1810bd Author: Aurelien Aptel Date: Tue Jun 19 15:18:48 2018 -0700 CIFS: fix memory leak and remove dead code also fixes error code in smb311_posix_mkdir() (where the error assignment needs to go before the goto) a typo that Dan Carpenter and Paulo and Gustavo pointed out. Signed-off-by: Aurelien Aptel Signed-off-by: Dan Carpenter Signed-off-by: Gustavo A. R. Silva Reviewed-by: Paulo Alcantara Signed-off-by: Steve French commit 7420451f6a109f7f8f1bf283f34d08eba3259fb3 Author: Steve French Date: Tue Jun 19 14:34:08 2018 -0500 cifs: allow disabling insecure dialects in the config allow disabling cifs (SMB1 ie vers=1.0) and vers=2.0 in the config for the build of cifs.ko if want to always prevent mounting with these less secure dialects. Signed-off-by: Steve French Reviewed-by: Aurelien Aptel Reviewed-by: Jeremy Allison commit 8505c8bfd85a260c9dc5c47e15bd8c5357fcbcd2 Author: Steve French Date: Mon Jun 18 14:01:59 2018 -0500 smb3: if server does not support posix do not allow posix mount option If user specifies "posix" on an SMB3.11 mount, then fail the mount if server does not return the POSIX negotiate context indicating support for posix. Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit cbedeadf9c44a1a135293717d501882f2933a534 Author: Arnd Bergmann Date: Tue Jun 19 17:27:59 2018 +0200 cifs: use 64-bit timestamps for fscache In the fscache, we just need the timestamps as cookies to check for changes, so we don't really care about the overflow, but it's better to stop using the deprecated timespec so we don't have to go through explicit conversion functions. To avoid comparing uninitialized padding values that are copied while assigning the timespec values, this rearranges the members of cifs_fscache_inode_auxdata to avoid padding, and assigns them individually. Signed-off-by: Arnd Bergmann Reviewed-by: Paulo Alcantara Signed-off-by: Steve French commit 95390201e7d8dd1eb764a3cbd50ae538a17fcd02 Author: Arnd Bergmann Date: Tue Jun 19 17:27:58 2018 +0200 cifs: use timespec64 internally In cifs, the timestamps are stored in memory in the cifs_fattr structure, which uses the deprecated 'timespec' structure. Now that the VFS code has moved on to 'timespec64', the next step is to change over the fattr as well. This also makes 32-bit and 64-bit systems behave the same way, and no longer overflow the 32-bit time_t in year 2038. Signed-off-by: Arnd Bergmann Reviewed-by: Paulo Alcantara Signed-off-by: Steve French commit ff361fda55fda55031252aca1f8afef735fe057c Author: Dan Carpenter Date: Tue Jun 19 15:25:30 2018 +0300 cifs: Silence uninitialized variable warning This is not really a runtime issue but Smatch complains that: fs/cifs/smb2ops.c:1740 smb2_query_symlink() error: uninitialized symbol 'resp_buftype'. The warning is right that it can be uninitialized... Also "err_buf" would be NULL at this point and we're not supposed to pass NULLs to free_rsp_buf() or it might trigger some extra output if we turn on debugging. Signed-off-by: Dan Carpenter Reviewed-by: Paulo Alcantara Signed-off-by: Steve French commit 50ee42b9ccb39c7a5c41eaae3199675a6ced9d49 Merge: 1ba982806ce5 bb9051a2b230 Author: David S. Miller Date: Tue Aug 7 12:15:03 2018 -0700 Merge branch 'WoL-filters' Florian Fainelli says: ==================== net: Support Wake-on-LAN using filters This is technically a v2, but this patch series builds on your feedback and defines the following: - a new WAKE_* bit: WAKE_FILTER which can be enabled alongside other type of Wake-on-LAN to support waking up on a programmed filter (match + action) - a new RX_CLS_FLOW_WAKE flow action which can be specified by an user when inserting a flow using ethtool::rxnfc, similar to the existing RX_CLS_FLOW_DISC The bcm_sf2 and bcmsysport drivers are updated accordingly to work in concert to allow matching packets at the switch level, identified by their filter location to be used as a match by the SYSTEM PORT (CPU/management controller) during Wake-on-LAN. Let me know if this looks better than the previous incarnation of the patch series. Attached is also the ethtool patch that I would be submitting once the uapi changes are committed. Thank you! Changes in v2: - bail out earlier in bcm_sf2_cfp's get_rxnfc if an error is encountered (Andrew) ==================== Signed-off-by: David S. Miller commit bb9051a2b23005a18826a2c33c98e5d977332352 Author: Florian Fainelli Date: Tue Aug 7 10:50:23 2018 -0700 net: systemport: Add support for WAKE_FILTER The SYSTEMPORT MAC allows up to 8 filters to be programmed to wake-up from LAN. Verify that we have up to 8 filters and program them to the appropriate RXCHK entries to be matched (along with their masks). We need to update the entry and exit to Wake-on-LAN mode to keep the RXCHK engine running to match during suspend, but this is otherwise fairly similar to Magic Packet detection. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 8a75f4f2acd78adfaf4b96939322d8a1de97d378 Author: Florian Fainelli Date: Tue Aug 7 10:50:22 2018 -0700 net: dsa: bcm_sf2: Propagate ethtool::rxnfc to CPU port Allow propagating ethtool::rxnfc programming to the CPU/management port such that it is possible for such a CPU to perform e.g: Wake-on-LAN using filters configured by the switch. We need a tiny bit of cooperation between the switch drivers which is able to do the full flow matching, whereas the CPU/management port might not. The CPU/management driver needs to return -EOPNOTSUPP to indicate an non critical error, any other error code otherwise. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 6cfef793b558eee47bac720574aff0d36b89d20a Author: Florian Fainelli Date: Tue Aug 7 10:50:20 2018 -0700 ethtool: Add WAKE_FILTER and RX_CLS_FLOW_WAKE Add the ability to specify through ethtool::rxnfc that a rule location is special and will be used to participate in Wake-on-LAN, by e.g: having a specific pattern be matched. When this is the case, fs->ring_cookie must be set to the special value RX_CLS_FLOW_WAKE. We also define an additional ethtool::wolinfo flag: WAKE_FILTER which can be used to configure an Ethernet adapter to allow Wake-on-LAN using previously programmed filters. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 58796e67d5d529e2010f6985fae7a5cef02f19a8 Author: Parav Pandit Date: Mon Aug 6 07:45:51 2018 +0300 IB/ucm: Initialize sgid request GID attribute pointer sgid_attr is uninitialized on the stack, initialize it to NULL. Fixes: 398391071f25 ("IB/cm: Replace members of sa_path_rec with 'struct sgid_attr *'") Signed-off-by: Parav Pandit Reviewed-by: Yossi Itigin Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit fd2fa95416188a767a63979296fa3e169a9ef5ec Author: Mike Snitzer Date: Thu Aug 2 16:08:52 2018 -0400 dm cache metadata: save in-core policy_hint_size to on-disk superblock policy_hint_size starts as 0 during __write_initial_superblock(). It isn't until the policy is loaded that policy_hint_size is set in-core (cmd->policy_hint_size). But it never got recorded in the on-disk superblock because __commit_transaction() didn't deal with transfering the in-core cmd->policy_hint_size to the on-disk superblock. The in-core cmd->policy_hint_size gets initialized by metadata_open()'s __begin_transaction_flags() which re-reads all superblock fields. Because the superblock's policy_hint_size was never properly stored, when the cache was created, hints_array_available() would always return false when re-activating a previously created cache. This means __load_mappings() always considered the hints invalid and never made use of the hints (these hints served to optimize). Another detremental side-effect of this oversight is the cache_check utility would fail with: "invalid hint width: 0" Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer commit 75294442d896f2767be34f75aca7cc2b0d01301f Author: Hou Tao Date: Thu Aug 2 16:18:24 2018 +0800 dm thin: stop no_space_timeout worker when switching to write-mode Now both check_for_space() and do_no_space_timeout() will read & write pool->pf.error_if_no_space. If these functions run concurrently, as shown in the following case, the default setting of "queue_if_no_space" can get lost. precondition: * error_if_no_space = false (aka "queue_if_no_space") * pool is in Out-of-Data-Space (OODS) mode * no_space_timeout worker has been queued CPU 0: CPU 1: // delete a thin device process_delete_mesg() // check_for_space() invoked by commit() set_pool_mode(pool, PM_WRITE) pool->pf.error_if_no_space = \ pt->requested_pf.error_if_no_space // timeout, pool is still in OODS mode do_no_space_timeout // "queue_if_no_space" config is lost pool->pf.error_if_no_space = true pool->pf.mode = new_mode Fix it by stopping no_space_timeout worker when switching to write mode. Fixes: bcc696fac11f ("dm thin: stay in out-of-data-space mode once no_space_timeout expires") Cc: stable@vger.kernel.org Signed-off-by: Hou Tao Signed-off-by: Mike Snitzer commit a3cfcecdb38b2f562fd6608ad4b1f8c1115cddd0 Author: Michal Vokáč Date: Fri Jul 27 14:15:15 2018 +0200 dt-bindings: Add Y Soft Corporation vendor prefix Y Soft is headquartered in the Czech Republic and it is a worldwide provider of enterprise office solutions for print management. Signed-off-by: Michal Vokáč Signed-off-by: Rob Herring commit da653130a9faaf5df18c5f84e7bf5cb5f5d256e4 Author: Michael Ellerman Date: Fri Jul 27 15:35:55 2018 +1000 of/fdt: Remove PPC32 longtrail hack in memory scan When the OF code was originally made common by Grant in commit 51975db0b733 ("of/flattree: merge early_init_dt_scan_memory() common code") (Feb 2010), the common code inherited a hack to handle PPC "longtrail" machines, which had a "memory@0" node with no device_type. That check was then made to only apply to PPC32 in b44aa25d20e2 ("of: Handle memory@0 node on PPC32 only") (May 2014). But according to Paul Mackerras the "longtrail" machines are long dead, if they were ever seen in the wild at all. If someone does still have one, we can handle this firmware wart in powerpc platform code. So remove the hack once and for all. Signed-off-by: Michael Ellerman Signed-off-by: Rob Herring commit 1ba982806ce58baac44c52e6c7812245afad27c8 Merge: c5d99d2b35da 85fc4b16aaf0 Author: David S. Miller Date: Tue Aug 7 11:02:05 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2018-08-07 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Add cgroup local storage for BPF programs, which provides a fast accessible memory for storing various per-cgroup data like number of transmitted packets, etc, from Roman. 2) Support bpf_get_socket_cookie() BPF helper in several more program types that have a full socket available, from Andrey. 3) Significantly improve the performance of perf events which are reported from BPF offload. Also convert a couple of BPF AF_XDP samples overto use libbpf, both from Jakub. 4) seg6local LWT provides the End.DT6 action, which allows to decapsulate an outer IPv6 header containing a Segment Routing Header. Adds this action now to the seg6local BPF interface, from Mathieu. 5) Do not mark dst register as unbounded in MOV64 instruction when both src and dst register are the same, from Arthur. 6) Define u_smp_rmb() and u_smp_wmb() to their respective barrier instructions on arm64 for the AF_XDP sample code, from Brian. 7) Convert the tcp_client.py and tcp_server.py BPF selftest scripts over from Python 2 to Python 3, from Jeremy. 8) Enable BTF build flags to the BPF sample code Makefile, from Taeung. 9) Remove an unnecessary rcu_read_lock() in run_lwt_bpf(), from Taehee. 10) Several improvements to the README.rst from the BPF documentation to make it more consistent with RST format, from Tobin. 11) Replace all occurrences of strerror() by calls to strerror_r() in libbpf and fix a FORTIFY_SOURCE build error along with it, from Thomas. 12) Fix a bug in bpftool's get_btf() function to correctly propagate an error via PTR_ERR(), from Yue. ==================== Signed-off-by: David S. Miller commit 73971b172a435079340007bee12b4944cc599a8a Author: Brian Foster Date: Tue Aug 7 10:57:13 2018 -0700 xfs: remove dead error handling code in xfs_dquot_disk_alloc() Colin Ian King reports that commit 82ff27bc52 ("xfs: automatic dfops buffer relogging") leaves around some dead error handling code in xfs_dquot_disk_alloc(). This was discovered via Coverity scan. Since the associated commit eliminates the act of joining a buffer to a dfops, this intermediate error state is no longer possible and the error handling code can be removed. Since the caller cancels the transaction on error, which cancels the dfops, eliminate the unnecessary xfs_defer_cancel() call and error handling labels. Fixes: 82ff27bc52 ("xfs: automatic dfops buffer relogging") Reported-by: Colin Ian King Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2ba090d521c5e09f32316c179d25bb6f699d3568 Author: Christoph Hellwig Date: Tue Aug 7 10:57:12 2018 -0700 xfs: use WRITE_ONCE to update if_seq This adds ordering of the updates and makes sure we always see the if_seq update before the extent tree is modified. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 36dc5b20e31db5cd470eb1934815320e7a0434c3 Author: Paul Burton Date: Tue Aug 7 10:15:04 2018 -0700 MIPS: Use dins to simplify __write_64bit_c0_split() The code in __write_64bit_c0_split() is used by MIPS32 kernels running on MIPS64 CPUs to write a 64-bit value to a 64-bit coprocessor 0 register using a single 64-bit dmtc0 instruction. It does this by combining the 2x 32-bit registers used to hold the 64-bit value into a single register, which in the existing code involves three steps: 1) Zero extend register A which holds bits 31:0 of our data, since it may have previously held a sign-extended value. 2) Shift register B which holds bits 63:32 of our data in bits 31:0 left by 32 bits, such that the bits forming our data are in the position they'll be in the final 64-bit value & bits 31:0 of the register are zero. 3) Or the two registers together to form the 64-bit value in one 64-bit register. From MIPS r2 onwards we have a dins instruction which can effectively perform all 3 of those steps using a single instruction. Add a path for MIPS r2 & beyond which uses dins to take bits 31:0 from register B & insert them into bits 63:32 of register A, giving us our full 64-bit value in register A with one instruction. Since we know that MIPS r2 & above support the sel field for the dmtc0 instruction, we don't bother special casing sel==0. Omiting the sel field would assemble to exactly the same instruction as when we explicitly specify that it equals zero. Signed-off-by: Paul Burton commit 08eeb44b2466feb1cf98fb0e8e6a1cf932ece6df Author: Paul Burton Date: Mon Aug 6 18:29:51 2018 -0700 MIPS: Use read-write output operand in __write_64bit_c0_split() Commit c22c80431055 ("MIPS: Fix input modify in __write_64bit_c0_split()") modified __write_64bit_c0_split() constraints such that we have both an input & an output which we hope to assign to the same registers, and modify the output rather than incorrectly clobbering an input. The way in which we use both an output & an input parameter with the input constrained to share the output registers is a little convoluted & also problematic for clang, which complains if the input & output values have different widths. For example: In file included from kernel/fork.c:98: ./arch/mips/include/asm/mmu_context.h:149:19: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'unsigned long long' write_c0_entryhi(cpu_asid(cpu, next)); ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ ./arch/mips/include/asm/mmu_context.h:93:2: note: expanded from macro 'cpu_asid' (cpu_context((cpu), (mm)) & cpu_asid_mask(&cpu_data[cpu])) ^ ./arch/mips/include/asm/mipsregs.h:1617:65: note: expanded from macro 'write_c0_entryhi' #define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ./arch/mips/include/asm/mipsregs.h:1430:39: note: expanded from macro '__write_ulong_c0_register' __write_64bit_c0_register(reg, sel, val); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ./arch/mips/include/asm/mipsregs.h:1400:41: note: expanded from macro '__write_64bit_c0_register' __write_64bit_c0_split(register, sel, value); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ ./arch/mips/include/asm/mipsregs.h:1498:13: note: expanded from macro '__write_64bit_c0_split' : "r,0" (val)); \ ^~~ We can both fix this build failure & simplify the code somewhat by assigning the __tmp variable with the input value in C prior to our inline assembly, and then using a single read-write output operand (ie. a constraint beginning with +) to provide this value to our assembly. Signed-off-by: Paul Burton commit 88c6f8a3977cc35997b47e2f99f080a15559c1eb Author: Joerg Roedel Date: Tue Aug 7 12:24:29 2018 +0200 x86/mm/pti: Fix 32 bit PCID check The check uses the wrong operator and causes false positive warnings in the kernel log on some systems. Fixes: 5e8105950a8b3 ('x86/mm/pti: Add Warning when booting on a PCID capable CPU') Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1533637471-30953-2-git-send-email-joro@8bytes.org commit 484a84f25ca7817c3662001316ba7d1e06b74ae2 Author: Michael Larabel Date: Tue Aug 7 09:54:54 2018 -0400 hwmon: (k10temp) 27C Offset needed for Threadripper2 For at least the Threadripper 2950X and Threadripper 2990WX, it's confirmed a 27 degree offset is needed. Signed-off-by: Michael Larabel Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck commit c5d99d2b35dadebab2408bb10dcd50364eaaf9f4 Author: Alexander Aring Date: Tue Aug 7 10:34:44 2018 -0400 ieee802154: hwsim: fix rcu address annotation This patch fixes the following sparse warning about mismatch rcu attribute for address space annotation: ... error: incompatible types in comparison expression (different modifiers) error: incompatible types in comparison expression (different address spaces) ... Some __rcu annotation was at non-pointers list head structures and one was missing in edge information which is used by rcu_assign_pointer() to update edge setting information. Cc: Stefan Schmidt Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb") Signed-off-by: Alexander Aring Signed-off-by: Stefan Schmidt Signed-off-by: David S. Miller commit cd9139220b87f40ea83858de1d6436c639376ce7 Author: Juergen Gross Date: Wed Jun 13 11:58:06 2018 +0200 xen: don't use privcmd_call() from xen_mc_flush() Using privcmd_call() for a singleton multicall seems to be wrong, as privcmd_call() is using stac()/clac() to enable hypervisor access to Linux user space. Even if currently not a problem (pv domains can't use SMAP while HVM and PVH domains can't use multicalls) things might change when PVH dom0 support is added to the kernel. Reported-by: Jan Beulich Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: Boris Ostrovsky commit f25848d4cdf2c5db5c506ca6553c79f97db19975 Author: Jacob Keller Date: Tue Jul 31 03:41:42 2018 -0700 i40e: convert priority flow control stats to use helpers The priority flow control statistics are laid out in the stats structure using arrays. This made it unwieldy to use as part of an i40e_stats array. Add a new structure type, i40e_pfc_stats, and a helper function i40e_get_pfc_stats which can return the stats for a given priority value as an i40e_pfc_stats structure. Use this to create an i40e_stats array, which we'll use to format and copy the strings and stats into the supplied buffers. This reduces even more boiler plate code in i40e_get_ethtool_stats and i40e_get_stat_strings. An alternative would be to modify the structure definition for the pfc stats, but this is more invasive to the rest of the code base. Note that a macro was used to setup the copy of stats from the pf->stats, as this reduces the chance of typos in the code names. It will produce a checkpatch.pl warning due to re-use of a macro argument. In this case, it should be safe, as the macro will fail to compile in cases where the argument is not a simple structure member name, and thus arguments with side effects should not be an issue. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1510ae0be2a4d4630823752235c41f8a0e06f37a Author: Jacob Keller Date: Tue Jul 31 03:41:41 2018 -0700 i40e: convert VEB TC stats to use an i40e_stats array The VEB TC stats are currently implemented with separate parsing, instead of using the i40e_stats array and associated helper functions. This is likely because the stats rely on embedding the TC number into the stat name. Update i40e_add_stat_strings to take variadic arguments, and use these to vsnprintf the i40e_stats string as a string containing format specifiers. Create a stats array for the VEB TC related stats, i40e_gstrings_veb_tc_stats, and use this along with the helper functions to remove the specialized boiler plate code. Always call i40e_add_ethtool_stats for both this array and the general VEB stats array. This ensures that we zero out any memory in case it was not zero-allocated for us. This ultimately results in less boiler plate code for the i40e_get_stat_strings and i40e_get_ethtool_stats. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1ac2ee231f922d46cc7bb4c9f02eeb841b3e4b47 Author: Mariusz Stachura Date: Tue Jul 31 03:41:40 2018 -0700 i40e: Set fec_config when forcing link state This patch configures FEC setting in i40e_force_link_state(). For some reason setting this field was overlooked thus causing 25G link to be configured incorrectly. Signed-off-by: Mariusz Stachura Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit f303048067a78d95947c1748ce1e55940ab2100b Author: Jacob Keller Date: Tue Jul 31 03:41:39 2018 -0700 i40e: add helper to copy statistic values into ethtool buffer Similar to the helper function to copy the ethtool stats strings, add and use a helper function for copying the ethtool stats into the supplied buffer. Just like before, we use a macro to avoid having to pass ARRAY_SIZE manually, so as to reduce chance of bugs. Some of the stats, especially queue stats, are a bit trickier, and will be handled in future patches. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 91f0654461f615247fb6cef6fc9de57f6607a677 Author: Jacob Keller Date: Tue Jul 31 03:41:38 2018 -0700 i40e: add helper function for copying strings from stat arrays Many of the ethtool statistics use the same basic logic for copying strings into the supplied buffer. A set of stats are stored in a const array of i40e_stats structures, and we apply these all together. Simplify the stats code by introducing a helper function which can take a stats array and copy the strings into the buffer, updating the buffer pointer as we go. We use a macro to implement i40e_add_stat_strings so that ARRAY_SIZE can be used on the array passed in. This ensures that we always use the matching size in __i40e_add_stat_strings. More complex stats currently do not use i40e_stats arrays, usually due to custom formatted strings, or because the stats are not laid out in the expected way. These stats will be updated to use the helper function in separate future patches. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1b4b6f3a2a653cb9131664deed3f1e44f60a6e14 Author: YueHaibing Date: Thu Jul 26 14:37:36 2018 +0800 i40e/i40evf: remove redundant functions i40evf_aq_{set/get}_phy_register There are no in-tree callers. Signed-off-by: YueHaibing Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit e661414c98dfbdcf8666a058a6278cd7a2f20c95 Author: Sergey Nemov Date: Thu Jul 19 13:25:22 2018 +0200 i40e: Remove duplicated prepare call in i40e_shutdown Function call to i40e_prep_for_reset() is duplicated in i40e_shutdown routine and gets called before i40e_enable_mc_magic_wake() which blocks it from being executed correctly on system reboot or shutdown because adminq is already disabled by first i40e_prep_for_reset() call. Two register write calls are also duplicated. Signed-off-by: Sergey Nemov Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit f699edb12a25a3dc8ecf72fe0a9b2fa42bd6a5da Author: Pablo Neira Ayuso Date: Tue Aug 7 17:14:27 2018 +0200 netfilter: nft_ct: enable conntrack for helpers Enable conntrack if the user defines a helper to be used from the ruleset policy. Fixes: 1a64edf54f55 ("netfilter: nft_ct: add helper set support") Signed-off-by: Pablo Neira Ayuso commit 7e0b2b57f01d183e1c84114f1f2287737358d748 Author: Harsha Sharma Date: Tue Aug 7 17:14:23 2018 +0200 netfilter: nft_ct: add ct timeout support This patch allows to add, list and delete connection tracking timeout policies via nft objref infrastructure and assigning these timeout via nft rule. %./libnftnl/examples/nft-ct-timeout-add ip raw cttime tcp Ruleset: table ip raw { ct timeout cttime { protocol tcp; policy = {established: 111, close: 13 } } chain output { type filter hook output priority -300; policy accept; ct timeout set "cttime" } } %./libnftnl/examples/nft-rule-ct-timeout-add ip raw output cttime %conntrack -E [NEW] tcp 6 111 ESTABLISHED src=172.16.19.128 dst=172.16.19.1 sport=22 dport=41360 [UNREPLIED] src=172.16.19.1 dst=172.16.19.128 sport=41360 dport=22 %nft delete rule ip raw output handle %./libnftnl/examples/nft-ct-timeout-del ip raw cttime Joint work with Pablo Neira. Signed-off-by: Harsha Sharma Signed-off-by: Pablo Neira Ayuso commit ad83f2a9ce37a264202f48f4fd8889ee9056b703 Author: Pablo Neira Ayuso Date: Tue Aug 7 17:14:19 2018 +0200 netfilter: remove ifdef around cttimeout in struct nf_conntrack_l4proto Simplify this, include it inconditionally in this structure layout as we do with ctnetlink. Signed-off-by: Pablo Neira Ayuso commit 6c1fd7dc489d9bf64196f5b0fa33e059f64460c8 Author: Pablo Neira Ayuso Date: Tue Aug 7 17:14:15 2018 +0200 netfilter: cttimeout: decouple timeout policy from nfnetlink_cttimeout object The timeout policy is currently embedded into the nfnetlink_cttimeout object, move the policy into an independent object. This allows us to reuse part of the existing conntrack timeout extension from nf_tables without adding dependencies with the nfnetlink_cttimeout object layout. Signed-off-by: Pablo Neira Ayuso commit 4e665afbd7bee29b44b5d22821b56207f8459e39 Author: Harsha Sharma Date: Tue Aug 7 17:14:10 2018 +0200 netfilter: cttimeout: move ctnl_untimeout to nf_conntrack As, ctnl_untimeout is required by nft_ct, so move ctnl_timeout from nfnetlink_cttimeout to nf_conntrack_timeout and rename as nf_ct_timeout. Signed-off-by: Harsha Sharma Signed-off-by: Pablo Neira Ayuso commit 35a8a3bd1c2e29bb6baec501c6f56abaaa10a48a Author: Fernando Fernandez Mancera Date: Tue Aug 7 11:43:02 2018 +0200 netfilter: nft_osf: use NFT_OSF_MAXGENRELEN instead of IFNAMSIZ As no "genre" on pf.os exceed 16 bytes of length, we reduce NFT_OSF_MAXGENRELEN parameter to 16 bytes and use it instead of IFNAMSIZ. Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit dffe12a82826082d2129ef91b17b257254cb60fc Author: Bob Peterson Date: Tue Aug 7 10:07:00 2018 -0500 gfs2: Fix gfs2_testbit to use clone bitmaps Function gfs2_testbit is called in three places. Two of those places, gfs2_alloc_extent and gfs2_unaligned_extlen, should be using the clone bitmaps, not the "real" bitmaps. Function gfs2_unaligned_extlen is used by the block reservations scheme to determine the length of an extent of free blocks. Before this patch, it wasn't using the clone bitmap, which means recently-freed blocks were treated as free blocks for the purposes of an allocation. This patch adds a new parameter to gfs2_testbit to indicate whether or not the clone bitmaps should be used (if available). Signed-off-by: Bob Peterson Reviewed-by: Andreas Gruenbacher commit 77b5f703dcc859915f0f20d92bc538e4a99ef149 Author: Benjamin Herrenschmidt Date: Tue Apr 10 17:16:10 2018 +1000 powerpc/powernv/opal: Use standard interrupts property when available For (bad) historical reasons, OPAL used to create a non-standard pair of properties "opal-interrupts" and "opal-interrupts-names" for representing the list of interrupts it wants Linux to request on its behalf. Among other issues, the opal-interrupts doesn't have a way to carry the type of interrupts, and they were assumed to be all level sensitive. This is wrong on some recent systems where some of them are edge sensitive causing warnings in the XIVE code and possible misbehaviours if they need to be retriggered (typically the NPU2 TCE error interrupts). This makes Linux switch to using the standard "interrupts" and "interrupt-names" properties instead when they are available, using standard of_irq helpers, which can carry all the desired type information. Newer versions of OPAL will generate those properties in addition to the legacy ones. Signed-off-by: Benjamin Herrenschmidt [mpe: Fixup prefix logic to check strlen(r->name). Reinstate setting of start = 0 in opal_event_shutdown() to avoid double free warnings] Signed-off-by: Michael Ellerman commit d6690b1a9b0dd95a6fbd166d9657e0cc80afbf99 Author: Christophe Leroy Date: Thu Jun 7 10:10:22 2018 +0000 powerpc: Allow CPU selection of e300core variants GCC supports -mcpu=e300c2 and -mcpu=e300c3 This patch gives the opportunity to tune kernel to one of those two types. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 0e00a8c9fd92409afa107aaa05f8465a76856080 Author: Christophe Leroy Date: Thu Jun 7 10:10:20 2018 +0000 powerpc: Allow CPU selection also on PPC32 This patch extends to PPC32 the capability to select the exact CPU type. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit cc62d20ce4ca4fe73a09d571144b29d43478cb9c Author: Christophe Leroy Date: Thu Jun 7 10:10:18 2018 +0000 powerpc: Make CPU selection logic generic in Makefile At the time being, when adding a new CPU for selection, both Kconfig.cputype and Makefile have to be modified. This patch moves into Kconfig.cputype the name of the CPU to me passed to the -mcpu= argument. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin [mpe: Rename the option to TARGET_CPU to echo the gcc documentation] Signed-off-by: Michael Ellerman commit badf436f6fa5dc864d579d73fe75386b743470c0 Author: Rodrigo R. Galvao Date: Mon Aug 6 13:42:03 2018 -0300 powerpc/Makefiles: Convert ifeq to ifdef where possible In Makefiles if we're testing a CONFIG_FOO symbol for equality with 'y' we can instead just use ifdef. The latter reads easily, so convert to it where possible. Signed-off-by: Rodrigo R. Galvao Reviewed-by: Mauro S. M. Rodrigues Signed-off-by: Michael Ellerman commit f8db2007ff5838aff696bd4297eefcc77af2cf46 Author: Paul Mackerras Date: Fri Aug 3 20:13:06 2018 +1000 powerpc/64: Copy as much as possible in __copy_tofrom_user In __copy_tofrom_user, if we encounter an exception on a store, we stop copying and return the number of bytes not copied. However, if the store is wider than one byte and is to an unaligned address, it is possible that the store operand overlaps a page boundary and the exception occurred on the latter part of the store operand, meaning that it would be possible to copy a few more bytes. Since copy_to_user is generally expected to copy as much as possible, it would be better to copy those extra few bytes. This adds code to do that. Since this edge case is not performance-critical, the code has been written to be compact rather than as fast as possible. Signed-off-by: Paul Mackerras Signed-off-by: Michael Ellerman commit 2679f63fe5e4bb1459a0c20859a99c70c15d5ea1 Author: Michael Ellerman Date: Fri Aug 3 20:13:05 2018 +1000 selftests/powerpc/64: Test exception cases in copy_tofrom_user This adds a set of test cases to test the behaviour of copy_tofrom_user when exceptions are encountered accessing the source or destination. Currently, copy_tofrom_user does not always copy as many bytes as possible when an exception occurs on a store to the destination, and that is reflected in failures in these tests. Based on a test program from Anton Blanchard. [paulus@ozlabs.org - test all three paths, wrote commit description, made EX_TABLE create an exception table.] Signed-off-by: Paul Mackerras Signed-off-by: Michael Ellerman commit 98c45f51f767bfdd71d773cceaceb403352e51ae Author: Paul Mackerras Date: Fri Aug 3 20:13:04 2018 +1000 selftests/powerpc/64: Test all paths through copy routines The hand-coded assembler 64-bit copy routines include feature sections that select one code path or another depending on which CPU we are executing on. The self-tests for these copy routines end up testing just one path. This adds a mechanism for selecting any desired code path at compile time, and makes 2 or 3 versions of each test, each using a different code path, so as to cover all the possible paths. Signed-off-by: Paul Mackerras [mpe: Add -mcpu=power4 to CFLAGS for older compilers] Signed-off-by: Michael Ellerman commit a7c81ce398e2ad304f61d6167155f3ef65a96524 Author: Paul Mackerras Date: Fri Aug 3 20:13:03 2018 +1000 powerpc/64: Make exception table clearer in __copy_tofrom_user_base This aims to make the generation of exception table entries for the loads and stores in __copy_tofrom_user_base clearer and easier to verify. Instead of having a series of local labels on the loads and stores, with a series of corresponding labels later for the exception handlers, we now use macros to generate exception table entries at the point of each load and store that could potentially trap. We do this with the macros lex (load exception) and stex (store exception). These macros are used right before the load or store to which they apply. Some complexity is introduced by the fact that we have some more work to do after hitting an exception, because we need to calculate and return the number of bytes not copied. The code uses r3 as the current pointer into the destination buffer, that is, the address of the first byte of the destination that has not been modified. However, at various points in the copy loops, r3 can be 4, 8, 16 or 24 bytes behind that point. To express this offset in an understandable way, we define a symbol r3_offset which is updated at various points so that it equal to the difference between the address of the first unmodified byte of the destination and the value in r3. (In fact it only needs to be accurate at the point of each lex or stex macro invocation.) The rules for updating r3_offset are as follows: * It starts out at 0 * An addi r3,r3,N instruction decreases r3_offset by N * A store instruction (stb, sth, stw, std) to N(r3) increases r3_offset by the width of the store (1, 2, 4, 8) * A store with update instruction (stbu, sthu, stwu, stdu) to N(r3) sets r3_offset to the width of the store. There is some trickiness to the way that the lex and stex macros and the associated exception handlers work. I would have liked to use the current value of r3_offset in the name of the symbol used as the exception handler, as in ".Lld_exc_$(r3_offset)" and then have symbols .Lld_exc_0, .Lld_exc_8, .Lld_exc_16 etc. corresponding to the offsets that needed to be added to r3. However, I couldn't see a way to do that with gas. Instead, the exception handler address is .Lld_exc - r3_offset or .Lst_exc - r3_offset, that is, the distance ahead of .Lld_exc/.Lst_exc that we start executing is equal to the amount that we need to add to r3. This works because r3_offset is always a small multiple of 4, and our instructions are 4 bytes long. This means that before .Lld_exc and .Lst_exc, we have a sequence of instructions that increments r3 by 4, 8, 16 or 24 depending on where we start. The sequence increments r3 by 4 per instruction (on average). We also replace the exception table for the 4k copy loop by a macro per load or store. These loads and stores all use exactly the same exception handler, which simply resets the argument registers r3, r4 and r5 to there original values and re-does the whole copy using the slower loop. Signed-off-by: Paul Mackerras Signed-off-by: Michael Ellerman commit 81d7b08b3cec79a43411e7175401b369090dba29 Author: zhong jiang Date: Sat Aug 4 22:25:00 2018 +0800 powerpc/powermac: of_node_put() is not needed after iterator for_each_node_by_name() iterators only exit normally when the loop cursor is NULL, So there is no need to call of_node_put(). Signed-off-by: zhong jiang Reviewed-by: Tyrel Datwyler Signed-off-by: Michael Ellerman commit 656ecc16e8fc2ab44b3d70e3fcc197a7020d0ca5 Author: Haren Myneni Date: Wed Jun 13 00:32:40 2018 -0700 crypto/nx: Initialize 842 high and normal RxFIFO control registers NX increments readOffset by FIFO size in receive FIFO control register when CRB is read. But the index in RxFIFO has to match with the corresponding entry in FIFO maintained by VAS in kernel. Otherwise NX may be processing incorrect CRBs and can cause CRB timeout. VAS FIFO offset is 0 when the receive window is opened during initialization. When the module is reloaded or in kexec boot, readOffset in FIFO control register may not match with VAS entry. This patch adds nx_coproc_init OPAL call to reset readOffset and queued entries in FIFO control register for both high and normal FIFOs. Signed-off-by: Haren Myneni [mpe: Fixup uninitialized variable warning] Signed-off-by: Michael Ellerman commit 6e708000ec2c93c2bde6a46aa2d6c3e80d4eaeb9 Author: Haren Myneni Date: Wed Jun 13 00:28:57 2018 -0700 powerpc/powernv: Export opal_check_token symbol Export opal_check_token symbol for modules to check the availability of OPAL calls before using them. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman commit f5daf77a55ef0e695cc90c440ed6503073ac5e07 Author: Randy Dunlap Date: Sun Jul 15 10:34:46 2018 -0700 powerpc/platforms/85xx: fix t1042rdb_diu.c build errors & warning Fix build errors and warnings in t1042rdb_diu.c by adding header files and MODULE_LICENSE(). ../arch/powerpc/platforms/85xx/t1042rdb_diu.c:152:1: warning: data definition has no type or storage class early_initcall(t1042rdb_diu_init); ../arch/powerpc/platforms/85xx/t1042rdb_diu.c:152:1: error: type defaults to 'int' in declaration of 'early_initcall' [-Werror=implicit-int] ../arch/powerpc/platforms/85xx/t1042rdb_diu.c:152:1: warning: parameter names (without types) in function declaration and WARNING: modpost: missing MODULE_LICENSE() in arch/powerpc/platforms/85xx/t1042rdb_diu.o Signed-off-by: Randy Dunlap Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Scott Wood Cc: Kumar Gala Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Michael Ellerman commit 7ccc4fe5ff9e3a134e863beed0dba18a5e511659 Author: Anju T Sudhakar Date: Fri May 18 13:05:25 2018 +0530 powerpc/perf: Remove sched_task function defined for thread-imc Call trace observed while running perf-fuzzer: CPU: 43 PID: 9088 Comm: perf_fuzzer Not tainted 4.13.0-32-generic #35~lp1746225 task: c000003f776ac900 task.stack: c000003f77728000 NIP: c000000000299b70 LR: c0000000002a4534 CTR: c00000000029bb80 REGS: c000003f7772b760 TRAP: 0700 Not tainted (4.13.0-32-generic) MSR: 900000000282b033 CR: 24008822 XER: 00000000 CFAR: c000000000299a70 SOFTE: 0 GPR00: c0000000002a4534 c000003f7772b9e0 c000000001606200 c000003fef858908 GPR04: c000003f776ac900 0000000000000001 ffffffffffffffff 0000003fee730000 GPR08: 0000000000000000 0000000000000000 c0000000011220d8 0000000000000002 GPR12: c00000000029bb80 c000000007a3d900 0000000000000000 0000000000000000 GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20: 0000000000000000 0000000000000000 c000003f776ad090 c000000000c71354 GPR24: c000003fef716780 0000003fee730000 c000003fe69d4200 c000003f776ad330 GPR28: c0000000011220d8 0000000000000001 c0000000014c6108 c000003fef858900 NIP [c000000000299b70] perf_pmu_sched_task+0x170/0x180 LR [c0000000002a4534] __perf_event_task_sched_in+0xc4/0x230 Call Trace: perf_iterate_sb+0x158/0x2a0 (unreliable) __perf_event_task_sched_in+0xc4/0x230 finish_task_switch+0x21c/0x310 __schedule+0x304/0xb80 schedule+0x40/0xc0 do_wait+0x254/0x2e0 kernel_wait4+0xa0/0x1a0 SyS_wait4+0x64/0xc0 system_call+0x58/0x6c Instruction dump: 3beafea0 7faa4800 409eff18 e8010060 eb610028 ebc10040 7c0803a6 38210050 eb81ffe0 eba1ffe8 ebe1fff8 4e800020 <0fe00000> 4bffffbc 60000000 60420000 ---[ end trace 8c46856d314c1811 ]--- The context switch call-backs for thread-imc are defined in sched_task function. So when thread-imc events are grouped with software pmu events, perf_pmu_sched_task hits the WARN_ON_ONCE condition, since software PMUs are assumed not to have a sched_task defined. Patch to move the thread_imc enable/disable opal call back from sched_task to event_[add/del] function Fixes: f74c89bd80fb ("powerpc/perf: Add thread IMC PMU support") Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan Tested-by: Joel Stanley Signed-off-by: Michael Ellerman commit 4231aba000f5a4583dd9f67057aadb68c3eca99d Author: Nicholas Piggin Date: Fri Jul 27 21:48:17 2018 +1000 powerpc/64s: Fix page table fragment refcount race vs speculative references The page table fragment allocator uses the main page refcount racily with respect to speculative references. A customer observed a BUG due to page table page refcount underflow in the fragment allocator. This can be caused by the fragment allocator set_page_count stomping on a speculative reference, and then the speculative failure handler decrements the new reference, and the underflow eventually pops when the page tables are freed. Fix this by using a dedicated field in the struct page for the page table fragment allocator. Fixes: 5c1f6ee9a31c ("powerpc: Reduce PTE table memory wastage") Cc: stable@vger.kernel.org # v3.10+ Reviewed-by: Aneesh Kumar K.V Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit a0ac3687fb404d59296ecba4642071424d153569 Author: Parth Y Shah Date: Fri Aug 3 15:50:38 2018 +0530 misc: cxl: changed asterisk position Resolved <"foo* bar" should be "foo *bar"> error Signed-off-by: Parth Y Shah Signed-off-by: Michael Ellerman commit e13606d7321c0c08d4ac2d74a1102680a40cfdee Author: Darren Stevens Date: Fri Aug 3 21:15:10 2018 +1000 powerpc/pasemi: Use pr_err/pr_warn... for kernel messages Pasemi code still uses printk(KERN_ERR/KERN_WARN ... change these to pr_err(, pr_warn(... to match other powerpc arch code. No functional changes. Signed-off-by: Darren Stevens [mpe: Unsplit some strings while we're at it] Signed-off-by: Michael Ellerman commit a99b9c5ed43ecfff5c47c558cc0fcbf8c6503f4c Author: Murilo Opsfelder Araujo Date: Wed Aug 1 18:33:20 2018 -0300 powerpc/traps: Show instructions on exceptions Call show_user_instructions() in arch/powerpc/kernel/traps.c to dump instructions at faulty location, useful to debugging. Before this patch, an unhandled signal message looked like: pandafault[10524]: segfault (11) at 100007d0 nip 1000061c lr 7fffbd295100 code 2 in pandafault[10000000+10000] After this patch, it looks like: pandafault[10524]: segfault (11) at 100007d0 nip 1000061c lr 7fffbd295100 code 2 in pandafault[10000000+10000] pandafault[10524]: code: 4bfffeec 4bfffee8 3c401002 38427f00 fbe1fff8 f821ffc1 7c3f0b78 3d22fffe pandafault[10524]: code: 392988d0 f93f0020 e93f0020 39400048 <99490000> 39200000 7d234b78 383f0040 Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Michael Ellerman commit 88b0fe17573592a8e3196bf143f865da460178e7 Author: Murilo Opsfelder Araujo Date: Wed Aug 1 18:33:19 2018 -0300 powerpc: Add show_user_instructions() show_user_instructions() is a slightly modified version of show_instructions() that allows userspace instruction dump. This will be useful within show_signal_msg() to dump userspace instructions of the faulty location. Here is a sample of what show_user_instructions() outputs: pandafault[10850]: code: 4bfffeec 4bfffee8 3c401002 38427f00 fbe1fff8 f821ffc1 7c3f0b78 3d22fffe pandafault[10850]: code: 392988d0 f93f0020 e93f0020 39400048 <99490000> 39200000 7d234b78 383f0040 The current->comm and current->pid printed can serve as a glue that links the instructions dump to its originator, allowing messages to be interleaved in the logs. Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Michael Ellerman commit 0f642d616b8b15647ca34786877b298ff2970713 Author: Murilo Opsfelder Araujo Date: Wed Aug 1 18:33:18 2018 -0300 powerpc/traps: Print VMA for unhandled signals This adds VMA address in the message printed for unhandled signals, similarly to what other architectures, like x86, print. Before this patch, a page fault looked like: pandafault[61470]: unhandled signal 11 at 100007d0 nip 1000061c lr 7fff8d185100 code 2 After this patch, a page fault looks like: pandafault[6303]: segfault 11 at 100007d0 nip 1000061c lr 7fff93c55100 code 2 in pandafault[10000000+10000] Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Michael Ellerman commit 49d8f2011dddac642a20491a698ad07059ed6096 Author: Murilo Opsfelder Araujo Date: Wed Aug 1 18:33:17 2018 -0300 powerpc/traps: Use %lx format in show_signal_msg() Use %lx format to print registers. This avoids having two different formats and avoids checking for MSR_64BIT, improving readability of the function. Even though we could have used %px, which is functionally equivalent to %lx as per Documentation/core-api/printk-formats.rst, it is not semantically correct because the data printed are not pointers. And using %px requires casting data to (void *). Besides that, %lx matches the format used in show_regs(). Before this patch: pandafault[4808]: unhandled signal 11 at 0000000010000718 nip 0000000010000574 lr 00007fff935e7a6c code 2 After this patch: pandafault[4732]: unhandled signal 11 at 10000718 nip 10000574 lr 7fff86697a6c code 2 Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Michael Ellerman commit 35a52a10c3ac5b425ff85c12913458b4741ab866 Author: Murilo Opsfelder Araujo Date: Wed Aug 1 18:33:16 2018 -0300 powerpc/traps: Use an explicit ratelimit state for show_signal_msg() Replace printk_ratelimited() by printk() and a default rate limit burst to limit displaying unhandled signals messages. This will allow us to call print_vma_addr() in a future patch, which does not work with printk_ratelimited(). Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Michael Ellerman commit 658b0f92bc7003bc734471f61bf7cd56339eb8c3 Author: Murilo Opsfelder Araujo Date: Wed Aug 1 18:33:15 2018 -0300 powerpc/traps: Print unhandled signals in a separate function Isolate the logic of printing unhandled signals out of _exception_pkey(). No functional change, only code rearrangement. Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Michael Ellerman commit 8e4bdc699bf32c58bfff7b2bfac204a6bf5efb69 Author: Michael Ellerman Date: Tue Jul 31 22:08:42 2018 +1000 selftests/powerpc: Add more version checks to alignment_handler test The alignment_handler is documented to only work on Power8/Power9, but we can make it run on older CPUs by guarding more of the tests with feature checks. Signed-off-by: Michael Ellerman Reviewed-by: Andrew Donnellan commit edba42cd14dbb0cc8b48cf786b006ac5da4cd9a7 Author: Michael Ellerman Date: Tue Jul 31 22:08:41 2018 +1000 selftests/powerpc: Skip earlier in alignment_handler test Currently the alignment_handler test prints "Can't open /dev/fb0" about 80 times per run, which is a little annoying. Refactor it to check earlier if it can open /dev/fb0 and skip if not, this results in each test printing something like: test: test_alignment_handler_vsx_206 tags: git_version:v4.18-rc3-134-gfb21a48904aa [SKIP] Test skipped on line 291 skip: test_alignment_handler_vsx_206 Signed-off-by: Michael Ellerman Acked-by: Andrew Donnellan commit 78ee9946371f5848ddfc88ab1a43867df8f17d83 Author: Michael Ellerman Date: Thu Jul 26 22:42:44 2018 +1000 powerpc/64s: Make rfi_flush_fallback a little more robust Because rfi_flush_fallback runs immediately before the return to userspace it currently runs with the user r1 (stack pointer). This means if we oops in there we will report a bad kernel stack pointer in the exception entry path, eg: Bad kernel stack pointer 7ffff7150e40 at c0000000000023b4 Oops: Bad kernel stack pointer, sig: 6 [#1] LE SMP NR_CPUS=32 NUMA PowerNV Modules linked in: CPU: 0 PID: 1246 Comm: klogd Not tainted 4.18.0-rc2-gcc-7.3.1-00175-g0443f8a69ba3 #7 NIP: c0000000000023b4 LR: 0000000010053e00 CTR: 0000000000000040 REGS: c0000000fffe7d40 TRAP: 4100 Not tainted (4.18.0-rc2-gcc-7.3.1-00175-g0443f8a69ba3) MSR: 9000000002803031 CR: 44000442 XER: 20000000 CFAR: c00000000000bac8 IRQMASK: c0000000f1e66a80 GPR00: 0000000002000000 00007ffff7150e40 00007fff93a99900 0000000000000020 ... NIP [c0000000000023b4] rfi_flush_fallback+0x34/0x80 LR [0000000010053e00] 0x10053e00 Although the NIP tells us where we were, and the TRAP number tells us what happened, it would still be nicer if we could report the actual exception rather than barfing about the stack pointer. We an do that fairly simply by loading the kernel stack pointer on entry and restoring the user value before returning. That way we see a regular oops such as: Unrecoverable exception 4100 at c00000000000239c Oops: Unrecoverable exception, sig: 6 [#1] LE SMP NR_CPUS=32 NUMA PowerNV Modules linked in: CPU: 0 PID: 1251 Comm: klogd Not tainted 4.18.0-rc3-gcc-7.3.1-00097-g4ebfcac65acd-dirty #40 NIP: c00000000000239c LR: 0000000010053e00 CTR: 0000000000000040 REGS: c0000000f1e17bb0 TRAP: 4100 Not tainted (4.18.0-rc3-gcc-7.3.1-00097-g4ebfcac65acd-dirty) MSR: 9000000002803031 CR: 44000442 XER: 20000000 CFAR: c00000000000bac8 IRQMASK: 0 ... NIP [c00000000000239c] rfi_flush_fallback+0x3c/0x80 LR [0000000010053e00] 0x10053e00 Call Trace: [c0000000f1e17e30] [c00000000000b9e4] system_call+0x5c/0x70 (unreliable) Note this shouldn't make the kernel stack pointer vulnerable to a meltdown attack, because it should be flushed from the cache before we return to userspace. The user r1 value will be in the cache, because we load it in the return path, but that is harmless. Signed-off-by: Michael Ellerman Reviewed-by: Nicholas Piggin commit 99d54754d3d5f896a8f616b0b6520662bc99d66b Author: Michael Ellerman Date: Tue Jul 24 01:07:56 2018 +1000 powerpc/powernv: Query firmware for count cache flush settings Look for fw-features properties to determine the appropriate settings for the count cache flush, and then call the generic powerpc code to set it up based on the security feature flags. Signed-off-by: Michael Ellerman commit ba72dc171954b782a79d25e0f4b3ed91090c3b1e Author: Michael Ellerman Date: Tue Jul 24 01:07:55 2018 +1000 powerpc/pseries: Query hypervisor for count cache flush settings Use the existing hypercall to determine the appropriate settings for the count cache flush, and then call the generic powerpc code to set it up based on the security feature flags. Signed-off-by: Michael Ellerman commit ee13cb249fabdff8b90aaff61add347749280087 Author: Michael Ellerman Date: Tue Jul 24 01:07:54 2018 +1000 powerpc/64s: Add support for software count cache flush Some CPU revisions support a mode where the count cache needs to be flushed by software on context switch. Additionally some revisions may have a hardware accelerated flush, in which case the software flush sequence can be shortened. If we detect the appropriate flag from firmware we patch a branch into _switch() which takes us to a count cache flush sequence. That sequence in turn may be patched to return early if we detect that the CPU supports accelerating the flush sequence in hardware. Add debugfs support for reporting the state of the flush, as well as runtime disabling it. And modify the spectre_v2 sysfs file to report the state of the software flush. Signed-off-by: Michael Ellerman commit dc8c6cce9a26a51fc19961accb978217a3ba8c75 Author: Michael Ellerman Date: Tue Jul 24 01:07:53 2018 +1000 powerpc/64s: Add new security feature flags for count cache flush Add security feature flags to indicate the need for software to flush the count cache on context switch, and for the presence of a hardware assisted count cache flush. Signed-off-by: Michael Ellerman commit 06d0bbc6d0f56dacac3a79900e9a9a0d5972d818 Author: Michael Ellerman Date: Tue Jul 24 01:07:52 2018 +1000 powerpc/asm: Add a patch_site macro & helpers for patching instructions Add a macro and some helper C functions for patching single asm instructions. The gas macro means we can do something like: 1: nop patch_site 1b, patch__foo Which is less visually distracting than defining a GLOBAL symbol at 1, and also doesn't pollute the symbol table which can confuse eg. perf. These are obviously similar to our existing feature sections, but are not automatically patched based on CPU/MMU features, rather they are designed to be manually patched by C code at some arbitrary point. Signed-off-by: Michael Ellerman commit 26cb1f36c43ee6e89d2a9f48a5a7500d5248f836 Author: Diana Craciun Date: Sat Jul 28 09:06:39 2018 +1000 Documentation: Add nospectre_v1 parameter Currently only supported on powerpc. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit c28218d4abbf4f2035495334d8bfcba64bda4787 Author: Diana Craciun Date: Sat Jul 28 09:06:38 2018 +1000 powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms Used barrier_nospec to sanitize the syscall table. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit ebcd1bfc33c7a90df941df68a6e5d4018c022fba Author: Diana Craciun Date: Sat Jul 28 09:06:37 2018 +1000 powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E Implement the barrier_nospec as a isync;sync instruction sequence. The implementation uses the infrastructure built for BOOK3S 64. Signed-off-by: Diana Craciun [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman commit 406d2b6ae3420f5bb2b3db6986dc6f0b6dbb637b Author: Diana Craciun Date: Sat Jul 28 09:06:36 2018 +1000 powerpc/64: Make meltdown reporting Book3S 64 specific In a subsequent patch we will enable building security.c for Book3E. However the NXP platforms are not vulnerable to Meltdown, so make the Meltdown vulnerability reporting PPC_BOOK3S_64 specific. Signed-off-by: Diana Craciun [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman commit af375eefbfb27cbb5b831984e66d724a40d26b5c Author: Michael Ellerman Date: Sat Jul 28 09:06:35 2018 +1000 powerpc/64: Call setup_barrier_nospec() from setup_arch() Currently we require platform code to call setup_barrier_nospec(). But if we add an empty definition for the !CONFIG_PPC_BARRIER_NOSPEC case then we can call it in setup_arch(). Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit 179ab1cbf883575c3a585bcfc0f2160f1d22a149 Author: Michael Ellerman Date: Sat Jul 28 09:06:34 2018 +1000 powerpc/64: Add CONFIG_PPC_BARRIER_NOSPEC Add a config symbol to encode which platforms support the barrier_nospec speculation barrier. Currently this is just Book3S 64 but we will add Book3E in a future patch. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit 6453b532f2c8856a80381e6b9a1f5ea2f12294df Author: Diana Craciun Date: Sat Jul 28 09:06:33 2018 +1000 powerpc/64: Make stf barrier PPC_BOOK3S_64 specific. NXP Book3E platforms are not vulnerable to speculative store bypass, so make the mitigations PPC_BOOK3S_64 specific. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit e33e5c85763e8ac1899ec382c1ebc4603d8c52ae Author: Christoph Hellwig Date: Tue Aug 7 09:42:22 2018 +0200 target/loop: depend on SCSI The target loopback driver is a low-level driver for the SCSI subsystem, and as such needs to depend on it. Fixes: 8a39a047 ("target: don't depend on SCSI") Signed-off-by: Christoph Hellwig Reported-by: Randy Dunlap Signed-off-by: Jens Axboe commit 0b0722e191757ca6851382d78c15277ca9c5c211 Author: Srinivas Kandagatla Date: Fri Aug 3 13:30:03 2018 +0100 ASoC: compress: make BE and FE order inline with dpcm For some reason order of startup/hw_params/prepare are reversed in dynamic compress usecase when compared to dpcm usecase. This is a issue with platforms like QCOM where it expects the BE to be initialized before FE. Interestingly the compress trigger callback order is inline with dpcm. Am not 100% sure why the compress audio case has been reversed. This patch is making the order inline with dpcm. If the reverse ordering is just co-incendental then this change makes sense and will avoid inventing some new mechanism to cope with ordering. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 8f220c418d070a097f7d292cf6b37f88d67845ad Author: Hannes Reinecke Date: Tue Aug 7 12:43:42 2018 +0200 nvme: fixup crash on failed discovery When the initial discovery fails the subsystem hasn't been setup yet in nvme_mpath_stop, and we can't dereference ctrl->subsys. Fixes: 0d0b660f ("nvme: add ANA support") Signed-off-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 0004438a165b18d4a611745f12e328e65f46c8f2 Author: Masahiro Yamada Date: Sat Aug 4 13:47:03 2018 +0900 um: clean up archheaders recipe Now that '%asm-generic' is added to no-dot-config-targets, 'make asm-generic' does not include the kernel configuration. You can simply do 'make asm-generic' in the recursed top Makefile without bothering syncconfig. Signed-off-by: Masahiro Yamada Tested-by: Randy Dunlap Acked-by: Richard Weinberger commit 63e31a67f12855129740943a4f826f05ddd0a2d0 Author: Masahiro Yamada Date: Sat Aug 4 13:47:02 2018 +0900 kbuild: add %asm-generic to no-dot-config-targets asm-generic and uapi-asm-generic do not depend on the kernel configuration. In fact, uapi-asm-generic is the prerequisite of headers_{install,check}, hence it should not require the .config file. Signed-off-by: Masahiro Yamada Tested-by: Randy Dunlap Acked-by: Richard Weinberger commit 13d3d01e26b942ada7cfced68ccb6db49597874a Author: Masahiro Yamada Date: Sat Aug 4 13:47:01 2018 +0900 um: fix parallel building with O= option Randy Dunlap reports UML occasionally fails to build with -j and O= options. make[1]: Entering directory '/home/rdunlap/mmotm-2018-0802-1529/UM64' UPD include/generated/uapi/linux/version.h WRAP arch/x86/include/generated/asm/dma-contiguous.h WRAP arch/x86/include/generated/asm/export.h WRAP arch/x86/include/generated/asm/early_ioremap.h WRAP arch/x86/include/generated/asm/mcs_spinlock.h WRAP arch/x86/include/generated/asm/mm-arch-hooks.h WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h WRAP arch/x86/include/generated/uapi/asm/poll.h GEN ./Makefile make[2]: *** No rule to make target 'archheaders'. Stop. arch/um/Makefile:119: recipe for target 'archheaders' failed make[1]: *** [archheaders] Error 2 make[1]: *** Waiting for unfinished jobs.... UPD include/config/kernel.release make[1]: *** wait: No child processes. Stop. Makefile:146: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 The cause of the problem is the use of '$(MAKE) KBUILD_SRC=', which recurses to the top Makefile via the $(objtree)/Makefile generated by scripts/mkmakefile. When you run "make -j O= ARCH=um", Make can execute 'archheaders' and 'outputmakefile' targets simultaneously because there is no dependency between them. If it happens, $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders ... tries to run $(objtree)/Makefile that is being updated. The correct way for the recursion is $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders ..., which does not rely on the generated Makefile. Reported-by: Randy Dunlap Signed-off-by: Masahiro Yamada Tested-by: Randy Dunlap Acked-by: Richard Weinberger commit 85fc4b16aaf05fc8978d242c556a1711dce15cf8 Author: Roman Gushchin Date: Mon Aug 6 14:27:28 2018 -0700 bpf: introduce update_effective_progs() __cgroup_bpf_attach() and __cgroup_bpf_detach() functions have a good amount of duplicated code, which is possible to eliminate by introducing the update_effective_progs() helper function. The update_effective_progs() calls compute_effective_progs() and then in case of success it calls activate_effective_progs() for each descendant cgroup. In case of failure (OOM), it releases allocated prog arrays and return the error code. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit cf175dc315f90185128fb061dc05b6fbb211aa2f Author: Diana Craciun Date: Sat Jul 28 09:06:32 2018 +1000 powerpc/64: Disable the speculation barrier from the command line The speculation barrier can be disabled from the command line with the parameter: "nospectre_v1". Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit 0b924de4f650c9544cd3d0a8228145a622a37630 Author: Michael Ellerman Date: Thu Jul 26 23:07:17 2018 +1000 powerpc/64s: Don't use __MASKABLE_EXCEPTION unnecessarily We only need to use __MASKABLE_EXCEPTION in one of the four cases for hardware interrupt, so use the helper macros in the other cases. Signed-off-by: Michael Ellerman commit b536da7c2d7dfa015ea36e78185ad74e6d775c96 Author: Michael Ellerman Date: Thu Jul 26 23:07:16 2018 +1000 powerpc/64s: Drop unused loc parameter to MASKABLE_EXCEPTION macros We pass the "loc" (location) parameter to MASKABLE_EXCEPTION and friends, but it's not used, so drop it. Signed-off-by: Michael Ellerman commit 0a55c2418500ba82a3a371b04471e3694e3ee168 Author: Michael Ellerman Date: Thu Jul 26 23:07:15 2018 +1000 powerpc/64s: Remove PSERIES naming from the MASKABLE macros Signed-off-by: Michael Ellerman commit 6adc6e9c0730d87953e1a0f15d7c23bce1e5d874 Author: Michael Ellerman Date: Thu Jul 26 23:07:14 2018 +1000 powerpc/64s: Drop _MASKABLE_RELON_EXCEPTION_PSERIES() _MASKABLE_RELON_EXCEPTION_PSERIES() does nothing useful, update all callers to use __MASKABLE_RELON_EXCEPTION_PSERIES() directly. Signed-off-by: Michael Ellerman commit 9bf2877ac128631f80cc9e85bfdf4dbd08abb225 Author: Michael Ellerman Date: Thu Jul 26 23:07:13 2018 +1000 powerpc/64s: Drop _MASKABLE_EXCEPTION_PSERIES() _MASKABLE_EXCEPTION_PSERIES() does nothing useful, update all callers to use __MASKABLE_EXCEPTION_PSERIES() directly. Signed-off-by: Michael Ellerman commit bdf08e1da0590f16eb255cda20db2a77bfdb349b Author: Michael Ellerman Date: Thu Jul 26 23:07:12 2018 +1000 powerpc/64s: Rename EXCEPTION_PROLOG_PSERIES to EXCEPTION_PROLOG Signed-off-by: Michael Ellerman commit 270373f14f0fc55c3326eeab10e5468184a27ff1 Author: Michael Ellerman Date: Thu Jul 26 23:07:11 2018 +1000 powerpc/64s: Rename EXCEPTION_RELON_PROLOG_PSERIES To just EXCEPTION_RELON_PROLOG(). Signed-off-by: Michael Ellerman commit 6ebb939740d5141358a42a98de516d179df0ad9e Author: Michael Ellerman Date: Thu Jul 26 23:07:10 2018 +1000 powerpc/64s: Rename EXCEPTION_RELON_PROLOG_PSERIES_1 The EXCEPTION_RELON_PROLOG_PSERIES_1() macro does the same job as EXCEPTION_PROLOG_2 (which we just recently created), except for "RELON" (relocation on) exceptions. So rename it as such. Signed-off-by: Michael Ellerman commit 94f3cc8e361c3e4a4689a7e5d4fe06bdb2c0961f Author: Michael Ellerman Date: Thu Jul 26 23:07:09 2018 +1000 powerpc/64s: Remove PSERIES from the NORI macros Signed-off-by: Michael Ellerman commit cb58a4a4b370b6e92e3f2654b2468a565fee9d87 Author: Michael Ellerman Date: Thu Jul 26 23:07:08 2018 +1000 powerpc/64s: Rename EXCEPTION_PROLOG_PSERIES_1 to EXCEPTION_PROLOG_2 As with the other patches in this series, we are removing the "PSERIES" from the name as it's no longer meaningful. In this case it's not simply a case of removing the "PSERIES" as that would result in a clash with the existing EXCEPTION_PROLOG_1. Instead we name this one EXCEPTION_PROLOG_2, as it's usually used in sequence after 0 and 1. Signed-off-by: Michael Ellerman commit b706f42362c3601271dd0fcd4fd9acb45fe7cd86 Author: Michael Ellerman Date: Thu Jul 26 23:07:07 2018 +1000 powerpc/64s: Rename STD_RELON_EXCEPTION_PSERIES_OOL to STD_RELON_EXCEPTION_OOL Signed-off-by: Michael Ellerman commit e42389c5f19fed0a7c578769b00edc2cf23ee319 Author: Michael Ellerman Date: Thu Jul 26 23:07:06 2018 +1000 powerpc/64s: Rename STD_RELON_EXCEPTION_PSERIES to STD_RELON_EXCEPTION Signed-off-by: Michael Ellerman commit 75e8bef3d6b5c8d25d56f0c0b804ec97e9736645 Author: Michael Ellerman Date: Thu Jul 26 23:07:05 2018 +1000 powerpc/64s: Rename STD_EXCEPTION_PSERIES_OOL to STD_EXCEPTION_OOL Signed-off-by: Michael Ellerman commit e899fce509f527e7e8efd5dd8fff22fcc0c05013 Author: Michael Ellerman Date: Thu Jul 26 23:07:04 2018 +1000 powerpc/64s: Rename STD_EXCEPTION_PSERIES to STD_EXCEPTION The "PSERIES" in STD_EXCEPTION_PSERIES is to differentiate the macros from the legacy iSeries versions, which are called STD_EXCEPTION_ISERIES. It is not anything to do with pseries vs powernv or powermac etc. We removed the legacy iSeries code in 2012, in commit 8ee3e0d69623x ("powerpc: Remove the main legacy iSerie platform code"). So remove "PSERIES" from the macros. Signed-off-by: Michael Ellerman commit 92b6d65c079450b7eb6a59ceb4d9855640914007 Author: Michael Ellerman Date: Thu Jul 26 23:07:03 2018 +1000 powerpc/64s: Move SET_SCRATCH0() into EXCEPTION_RELON_PROLOG_PSERIES() EXCEPTION_RELON_PROLOG_PSERIES() only has two users, STD_RELON_EXCEPTION_PSERIES() and STD_RELON_EXCEPTION_HV() both of which "call" SET_SCRATCH0(), so just move SET_SCRATCH0() into EXCEPTION_RELON_PROLOG_PSERIES(). Signed-off-by: Michael Ellerman commit 4a7a0a8444ba4cebb3a6744e9c14fc6391d7f266 Author: Michael Ellerman Date: Thu Jul 26 23:07:02 2018 +1000 powerpc/64s: Move SET_SCRATCH0() into EXCEPTION_PROLOG_PSERIES() EXCEPTION_PROLOG_PSERIES() only has two users, STD_EXCEPTION_PSERIES() and STD_EXCEPTION_HV() both of which "call" SET_SCRATCH0(), so just move SET_SCRATCH0() into EXCEPTION_PROLOG_PSERIES(). Signed-off-by: Michael Ellerman commit 250a93501d6265bbb9ddf06af25ac9ae64782297 Author: Darren Stevens Date: Wed Jul 25 21:55:18 2018 +0100 powerpc/pasemi: Search for PCI root bus by compatible property Pasemi arch code finds the root of the PCI-e bus by searching the device-tree for a node called 'pxp'. But the root bus has a compatible property of 'pasemi,rootbus' so search for that instead. Signed-off-by: Darren Stevens Acked-by: Olof Johansson Signed-off-by: Michael Ellerman commit 396ab6ab284a9fff4154e9bd491372f43de8284c Author: Christophe Leroy Date: Wed Aug 1 09:01:16 2018 +0000 selftests/powerpc: Update strlen() test to test the new assembly function for PPC32 This patch adds a test for testing the new assembly strlen() for PPC32 Signed-off-by: Christophe Leroy [mpe: Fix 64-bit build] Signed-off-by: Michael Ellerman commit 9412b234501eef1d273cc759387a232f0027c574 Author: Christophe Leroy Date: Wed Aug 1 09:01:14 2018 +0000 powerpc/lib: Implement strlen() in assembly for PPC32 The generic implementation of strlen() reads strings byte per byte. This patch implements strlen() in assembly based on a read of entire words, in the same spirit as what some other arches and glibc do. On a 8xx the time spent in strlen is reduced by 3/4 for long strings. strlen() selftest on an 8xx provides the following values: Before the patch (ie with the generic strlen() in lib/string.c): len 256 : time = 1.195055 len 016 : time = 0.083745 len 008 : time = 0.046828 len 004 : time = 0.028390 After the patch: len 256 : time = 0.272185 ==> 78% improvment len 016 : time = 0.040632 ==> 51% improvment len 008 : time = 0.033060 ==> 29% improvment len 004 : time = 0.029149 ==> 2% degradation On a 832x: Before the patch: len 256 : time = 0.236125 len 016 : time = 0.018136 len 008 : time = 0.011000 len 004 : time = 0.007229 After the patch: len 256 : time = 0.094950 ==> 60% improvment len 016 : time = 0.013357 ==> 26% improvment len 008 : time = 0.010586 ==> 4% improvment len 004 : time = 0.008784 Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit f0abbfd89fed4abd8301b35fbf65a26d85b16e7f Author: Christophe Leroy Date: Wed Aug 1 09:01:12 2018 +0000 selftests/powerpc: Add test for strlen() This patch adds a test for strlen() string.c contains a copy of strlen() from lib/string.c The test first tests the correctness of strlen() by comparing the result with libc strlen(). It tests all cases of alignment. It them tests the duration of an aligned strlen() on a 4 bytes string, on a 16 bytes string and on a 256 bytes string. Signed-off-by: Christophe Leroy [mpe: Drop change log from copy of string.c] Signed-off-by: Michael Ellerman commit 1bb07b593adc1934a526eb04acfe8bf786decfd2 Author: Christophe Leroy Date: Wed Aug 1 09:01:10 2018 +0000 selftests/powerpc: Add test for 32 bits memcmp This patch renames memcmp test to memcmp_64 and adds a memcmp_32 test for testing the 32 bits version of memcmp() Signed-off-by: Christophe Leroy [mpe: Fix 64-bit build by adding build_32bit test] Signed-off-by: Michael Ellerman commit 94675cceacaec27a30eefb142c4c59a9d3131742 Author: Mahesh Salgaonkar Date: Wed Jul 4 23:27:21 2018 +0530 powerpc/pseries: Defer the logging of rtas error to irq work queue. rtas_log_buf is a buffer to hold RTAS event data that are communicated to kernel by hypervisor. This buffer is then used to pass RTAS event data to user through proc fs. This buffer is allocated from vmalloc (non-linear mapping) area. On Machine check interrupt, register r3 points to RTAS extended event log passed by hypervisor that contains the MCE event. The pseries machine check handler then logs this error into rtas_log_buf. The rtas_log_buf is a vmalloc-ed (non-linear) buffer we end up taking up a page fault (vector 0x300) while accessing it. Since machine check interrupt handler runs in NMI context we can not afford to take any page fault. Page faults are not honored in NMI context and causes kernel panic. Apart from that, as Nick pointed out, pSeries_log_error() also takes a spin_lock while logging error which is not safe in NMI context. It may endup in deadlock if we get another MCE before releasing the lock. Fix this by deferring the logging of rtas error to irq work queue. Current implementation uses two different buffers to hold rtas error log depending on whether extended log is provided or not. This makes bit difficult to identify which buffer has valid data that needs to logged later in irq work. Simplify this using single buffer, one per paca, and copy rtas log to it irrespective of whether extended log is provided or not. Allocate this buffer below RMA region so that it can be accessed in real mode mce handler. Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt") Cc: stable@vger.kernel.org # v4.14+ Reviewed-by: Nicholas Piggin Signed-off-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman commit 74e96bf44f430cf7a01de19ba6cf49b361cdfd6e Author: Mahesh Salgaonkar Date: Wed Jul 4 23:27:02 2018 +0530 powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX. The global mce data buffer that used to copy rtas error log is of 2048 (RTAS_ERROR_LOG_MAX) bytes in size. Before the copy we read extended_log_length from rtas error log header, then use max of extended_log_length and RTAS_ERROR_LOG_MAX as a size of data to be copied. Ideally the platform (phyp) will never send extended error log with size > 2048. But if that happens, then we have a risk of buffer overrun and corruption. Fix this by using min_t instead. Fixes: d368514c3097 ("powerpc: Fix corruption when grabbing FWNMI data") Reported-by: Michal Suchanek Signed-off-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman commit e27e0a94651e30912443e88642e698240e01cd57 Author: Benjamin Herrenschmidt Date: Wed Apr 11 15:18:01 2018 +1000 powerpc/xive: Remove xive_kexec_teardown_cpu() It's identical to xive_teardown_cpu() so just use the latter Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Michael Ellerman commit dbc5740247961d6b060737620520dc5435926ffe Author: Benjamin Herrenschmidt Date: Wed Apr 11 15:18:00 2018 +1000 powerpc/xive: Remove now useless pr_debug statements Those overly verbose statement in the setup of the pool VP aren't particularly useful (esp. considering we don't actually use the pool, we configure it bcs HW requires it only). So remove them which improves the code readability. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Michael Ellerman commit 34c604d27590fdc9a2c944be8c50ae1fc80f5f25 Author: Nicholas Piggin Date: Wed Jul 25 19:54:28 2018 +1000 powerpc/64s: free page table caches at exit_mmap time The kernel page table caches are tied to init_mm, so there is no more need for them after userspace is finished. destroy_context() gets called when we drop the last reference for an mm, which can be much later than the task exit due to other lazy mm references to it. We can free the page table cache pages on task exit because they only cache the userspace page tables and kernel threads should not access user space addresses. The mapping for kernel threads itself is maintained in init_mm and page table cache for that is attached to init_mm. Signed-off-by: Nicholas Piggin Reviewed-by: Aneesh Kumar K.V [mpe: Merge change log additions from Aneesh] Signed-off-by: Michael Ellerman commit 5a6099346c41792f1ba23aea6f74ad816e7fecd4 Author: Nicholas Piggin Date: Wed Jul 25 23:58:06 2018 +1000 powerpc/64s/radix: tlb do not flush on page size when fullmm When the mm is being torn down there will be a full PID flush so there is no need to flush the TLB on page size changes. Signed-off-by: Nicholas Piggin Reviewed-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit d97e7f198b10ea9d17ea64606f18102260870782 Author: Michael Ellerman Date: Thu Jul 26 22:24:59 2018 +1000 selftests/powerpc: Give some tests longer to run Some of these long running tests can time out on heavily loaded systems, give them longer to run. Signed-off-by: Michael Ellerman commit 1cdc6c14b0ddef699c947babd93992a8c0e874ed Author: Michael Ellerman Date: Thu Jul 26 22:24:58 2018 +1000 selftests/powerpc: Only run some tests on ppc64le These tests are currently failing on (some) big endian systems. Until we can fix that, skip them unless we're on ppc64le. Signed-off-by: Michael Ellerman commit 95f9b3af401f5b4daeb908a2c658e820e969f4e3 Author: Michael Ellerman Date: Thu Jul 26 22:24:57 2018 +1000 selftests/powerpc: Add a helper for checking if we're on ppc64le Some of our selftests have only been tested on ppc64le and crash or behave weirdly on ppc64/ppc32. So add a helper for checking the UTS machine. Signed-off-by: Michael Ellerman commit 7cd129b4b5370030a5c0b8031a54b2d1d92fa546 Author: Michael Ellerman Date: Wed Jul 25 00:03:46 2018 +1000 powerpc: Add a checkpatch wrapper with our preferred settings This makes it easy to run checkpatch with settings that I like. Usage is eg: $ ./arch/powerpc/tools/checkpatch.sh -g origin/master.. To check all commits since origin/master. Signed-off-by: Michael Ellerman Reviewed-by: Russell Currey commit 4da1f79227ad42550e3e70e7b4812ec019be3b6e Author: Michael Ellerman Date: Mon Aug 6 20:30:49 2018 +1000 powerpc/64: Disable irq restore warning for now We recently added a warning in arch_local_irq_restore() to check that the soft masking state matches reality. Unfortunately it trips in a few places, which are not entirely trivial to fix. The key problem is if we're doing function_graph tracing of restore_math(), the warning pops and then seems to recurse. It's not entirely clear because the system continuously oopses on all CPUs, with the output interleaved and unreadable. It's also been observed on a G5 coming out of idle. Until we can fix those cases disable the warning for now. Signed-off-by: Michael Ellerman commit 26f843848bae973817b3587780ce6b7b0200d3e4 Author: Martin Schwidefsky Date: Mon Aug 6 14:26:39 2018 +0200 s390: fix br_r1_trampoline for machines without exrl For machines without the exrl instruction the BFP jit generates code that uses an "br %r1" instruction located in the lowcore page. Unfortunately there is a cut & paste error that puts an additional "larl %r1,.+14" instruction in the code that clobbers the branch target address in %r1. Remove the larl instruction. Cc: # v4.17+ Fixes: de5cb6eb51 ("s390: use expoline thunks in the BPF JIT") Signed-off-by: Martin Schwidefsky commit 5eda25b10297684c1f46a14199ec00210f3c346e Author: Martin Schwidefsky Date: Mon Aug 6 13:49:47 2018 +0200 s390/lib: use expoline for all bcr instructions The memove, memset, memcpy, __memset16, __memset32 and __memset64 function have an additional indirect return branch in form of a "bzr" instruction. These need to use expolines as well. Cc: # v4.17+ Fixes: 97489e0663 ("s390/lib: use expoline for indirect branches") Reviewed-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit bc2d8d262cba5736332cbc866acb11b1c5748aa9 Author: Thomas Gleixner Date: Tue Aug 7 08:19:57 2018 +0200 cpu/hotplug: Fix SMT supported evaluation Josh reported that the late SMT evaluation in cpu_smt_state_init() sets cpu_smt_control to CPU_SMT_NOT_SUPPORTED in case that 'nosmt' was supplied on the kernel command line as it cannot differentiate between SMT disabled by BIOS and SMT soft disable via 'nosmt'. That wreckages the state and makes the sysfs interface unusable. Rework this so that during bringup of the non boot CPUs the availability of SMT is determined in cpu_smt_allowed(). If a newly booted CPU is not a 'primary' thread then set the local cpu_smt_available marker and evaluate this explicitely right after the initial SMP bringup has finished. SMT evaulation on x86 is a trainwreck as the firmware has all the information _before_ booting the kernel, but there is no interface to query it. Fixes: 73d5e2b47264 ("cpu/hotplug: detect SMT disabled by BIOS") Reported-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner commit 51be5a2b43f86af40b3fb78d7e4a22b5357fbc0d Author: Mauro Carvalho Chehab Date: Tue Aug 7 06:13:36 2018 -0400 media: sta2x11: add a missing parameter description Fixes this warning: drivers/media/pci/sta2x11/sta2x11_vip.c:156: warning: Function parameter or member 'v4l_lock' not described in 'sta2x11_vip' Fixes: cd63c0288fd7 ("media: sta2x11: Add video_device and vb2_queue locks") Signed-off-by: Mauro Carvalho Chehab commit b07b684930fe0b8032bddba5aa60686011932019 Author: Mauro Carvalho Chehab Date: Tue Aug 7 06:06:17 2018 -0400 media: v4l2-mem2mem: add descriptions to MC fields drivers/media/v4l2-core/v4l2-mem2mem.c:90: warning: Function parameter or member 'source_pad' not described in 'v4l2_m2m_dev' drivers/media/v4l2-core/v4l2-mem2mem.c:90: warning: Function parameter or member 'sink' not described in 'v4l2_m2m_dev' drivers/media/v4l2-core/v4l2-mem2mem.c:90: warning: Function parameter or member 'sink_pad' not described in 'v4l2_m2m_dev' drivers/media/v4l2-core/v4l2-mem2mem.c:90: warning: Function parameter or member 'proc' not described in 'v4l2_m2m_dev' drivers/media/v4l2-core/v4l2-mem2mem.c:90: warning: Function parameter or member 'proc_pads' not described in 'v4l2_m2m_dev' drivers/media/v4l2-core/v4l2-mem2mem.c:90: warning: Function parameter or member 'intf_devnode' not described in 'v4l2_m2m_dev' Fixes: be2fff656322 ("media: add helpers for memory-to-memory media controller") Signed-off-by: Mauro Carvalho Chehab commit 4effa8bfe4f6bacd041f98775f49cdc550502dc2 Author: Jasmin Jessich Date: Sat Jul 28 09:54:49 2018 -0400 media: i2c: fix warning in Aptina MT9V111 This fixes the "'idx' may be used uninitialized in this function" warning: drivers/media/i2c/mt9v111.c: In function 'mt9v111_set_format': drivers/media/i2c/mt9v111.c:887:15: warning: 'idx' may be used uninitialized in this function [-Wmaybe-uninitialized] unsigned int idx; ^~~ Signed-off-by: Jasmin Jessich Acked-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit 132f3c7bb98673f713be9511de16b7622803df36 Author: Mauro Carvalho Chehab Date: Tue Aug 7 05:52:36 2018 -0400 media: imx: shut up a false positive warning With imx, gcc produces a false positive warning: drivers/staging/media/imx/imx-media-csi.c: In function 'csi_idmac_setup_channel': drivers/staging/media/imx/imx-media-csi.c:457:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (passthrough) { ^ drivers/staging/media/imx/imx-media-csi.c:464:2: note: here default: ^~~~~~~ That's because the regex it uses for fall trough is not good enough. So, rearrange the fall through comment in a way that gcc will recognize. Signed-off-by: Mauro Carvalho Chehab commit 22240df7ac6d76a271197571a7be45addef2ba15 Author: Ard Biesheuvel Date: Sat Aug 4 20:46:25 2018 +0200 crypto: arm64/ghash-ce - implement 4-way aggregation Enhance the GHASH implementation that uses 64-bit polynomial multiplication by adding support for 4-way aggregation. This more than doubles the performance, from 2.4 cycles per byte to 1.1 cpb on Cortex-A53. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 8e492eff7de955e6ed1dc2989b17c41cd862aa28 Author: Ard Biesheuvel Date: Sat Aug 4 20:46:24 2018 +0200 crypto: arm64/ghash-ce - replace NEON yield check with block limit Checking the TIF_NEED_RESCHED flag is disproportionately costly on cores with fast crypto instructions and comparatively slow memory accesses. On algorithms such as GHASH, which executes at ~1 cycle per byte on cores that implement support for 64 bit polynomial multiplication, there is really no need to check the TIF_NEED_RESCHED particularly often, and so we can remove the NEON yield check from the assembler routines. However, unlike the AEAD or skcipher APIs, the shash/ahash APIs take arbitrary input lengths, and so there needs to be some sanity check to ensure that we don't hog the CPU for excessive amounts of time. So let's simply cap the maximum input size that is processed in one go to 64 KB. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 8418cf54df0c22332e0cd855b9e1e7aac3fab20e Author: kbuild test robot Date: Sat Aug 4 06:21:01 2018 +0800 crypto: hisilicon - sec_send_request() can be static Fixes: 915e4e8413da ("crypto: hisilicon - SEC security accelerator driver") Signed-off-by: kbuild test robot Signed-off-by: Herbert Xu commit 6122bbbdc65630d202e5494d5b9678676f2883f8 Author: Colin Ian King Date: Mon Jul 30 09:59:36 2018 +0100 lib/mpi: remove redundant variable esign Variable esign is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'esign' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Herbert Xu commit 30f1a9f53e77e4c9ddf55ebfda8a9d7666e46964 Author: Ard Biesheuvel Date: Mon Jul 30 23:06:42 2018 +0200 crypto: arm64/aes-ce-gcm - don't reload key schedule if avoidable Squeeze out another 5% of performance by minimizing the number of invocations of kernel_neon_begin()/kernel_neon_end() on the common path, which also allows some reloads of the key schedule to be optimized away. The resulting code runs at 2.3 cycles per byte on a Cortex-A53. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit e0bd888dc487e0c444ee5f3bf55020862d16a225 Author: Ard Biesheuvel Date: Mon Jul 30 23:06:41 2018 +0200 crypto: arm64/aes-ce-gcm - implement 2-way aggregation Implement a faster version of the GHASH transform which amortizes the reduction modulo the characteristic polynomial across two input blocks at a time. On a Cortex-A53, the gcm(aes) performance increases 24%, from 3.0 cycles per byte to 2.4 cpb for large input sizes. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 71e52c278c54db10e368c54687234390357b08d6 Author: Ard Biesheuvel Date: Mon Jul 30 23:06:40 2018 +0200 crypto: arm64/aes-ce-gcm - operate on two input blocks at a time Update the core AES/GCM transform and the associated plumbing to operate on 2 AES/GHASH blocks at a time. By itself, this is not expected to result in a noticeable speedup, but it paves the way for reimplementing the GHASH component using 2-way aggregation. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 3465893d274e21c18bfffdf758403d5c7b5af515 Merge: d6e43798b3d9 f10dc56c64bb Author: Herbert Xu Date: Tue Aug 7 17:37:10 2018 +0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Merge crypto-2.6 to pick up NEON yield revert. commit 926a299c42e38bbe8bb909eae0146e676b66afe4 Author: Russell King Date: Thu Aug 2 10:27:15 2018 +0100 drm/i2c: tda998x: correct PLL divider calculation The serializer PLL divider is a power-of-two divider, so our calculation which assumes that it's a numerical divider is incorrect. Replace it with one that results in a power-of-two divider value instead. Tested with all supported modes with a Samsung S24C750. Tested-by: Peter Rosin Signed-off-by: Russell King commit a3d335f5de7cdd714737a9f8bdcc7b205b0f8d5e Author: Russell King Date: Thu Aug 2 10:27:15 2018 +0100 drm/i2c: tda998x: get rid of private fill_modes function We can achieve the same effect via the get_modes() method, rather than wrapping the fill_modes helper. Tested-by: Peter Rosin Signed-off-by: Russell King commit b073a70ecd37bc6e7c25a47315cd8d65e7b313fd Author: Russell King Date: Thu Aug 2 10:27:15 2018 +0100 drm/i2c: tda998x: move mode_valid() to bridge Move the mode_valid() implementation to the bridge instead of the connector, as we're checking the bridge's capabilities. Tested-by: Peter Rosin Signed-off-by: Russell King commit 5a03f5346fedc8b5f1a8601aa46a0930ba56a7ae Author: Russell King Date: Thu Aug 2 10:25:19 2018 +0100 drm/i2c: tda998x: register bridge outside of component helper Register the bridge outside of the component helper as we have drivers that wish to use the tda998x without its encoder. Tested-by: Peter Rosin Signed-off-by: Russell King commit 76767fdabadbea7dec2cdd741c0177e4fab3c75a Author: Russell King Date: Thu Aug 2 10:25:19 2018 +0100 drm/i2c: tda998x: cleanup from previous changes Cleanup the code a little from the effects of the previous changes: - Move tda998x_destroy() to be above tda998x_create() - Use 'dev' directly in tda998x_create() where appropriate. Tested-by: Peter Rosin Signed-off-by: Russell King commit 2143adb04b357e192a9717a42554b1fd65c60fd2 Author: Russell King Date: Thu Aug 2 10:25:19 2018 +0100 drm/i2c: tda998x: allocate tda998x_priv inside tda998x_create() Move the tda998x_priv allocation inside tda998x_create() and simplify the tda998x_create()'s arguments. Pass the same to tda998x_destroy(). Tested-by: Peter Rosin Signed-off-by: Russell King commit 30bd8b862f5466fe5aee9a9fcdaea5a4fad83f91 Author: Russell King Date: Thu Aug 2 10:25:19 2018 +0100 drm/i2c: tda998x: convert to bridge driver Convert tda998x to a bridge driver with built-in encoder support for compatibility with existing component drivers. Tested-by: Peter Rosin Signed-off-by: Russell King commit 554ec508653688c21d9b8024af73a1ffaa0164b9 Author: Bart Van Assche Date: Mon Aug 6 15:34:21 2018 -0700 lib/vsprintf: Do not handle %pO[^F] as %px This patch avoids that gcc reports the following when building with W=1: lib/vsprintf.c:1941:3: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt[1]) { ^~~~~~ Fixes: 7b1924a1d930eb2 ("vsprintf: add printk specifier %px") Link: http://lkml.kernel.org/r/20180806223421.11995-1-bart.vanassche@wdc.com Cc: linux-kernel@vger.kernel.org Cc: Bart Van Assche Cc: Pantelis Antoniou Cc: Joe Perches Cc: Rob Herring Cc: v4.15+ Signed-off-by: Bart Van Assche Signed-off-by: Petr Mladek commit 13bdff337e4ea467a547df771a825dd9b4ed6dd9 Author: Dan Carpenter Date: Thu Jul 19 11:19:21 2018 +0300 drm/i915/kvmgt: fix an error code in gvt_dma_map_page() The dma_mapping_error() returns true on error but we want to return -ENOMEM here. Fixes: 79e542f5af79 ("drm/i915/kvmgt: Support setting dma map for huge pages") Signed-off-by: Dan Carpenter Signed-off-by: Zhenyu Wang commit da5b3ebb4527733299661229a8d035d64a4f0b1a Author: Joel Fernandes (Google) Date: Sun Aug 5 20:40:49 2018 -0700 tracing: irqsoff: Account for additional preempt_disable Recently we tried to make the preemptirqsoff tracer to use irqsoff tracepoint probes. However this causes issues as reported by Masami: [2.271078] Testing tracer preemptirqsoff: .. no entries found ..FAILED! [2.381015] WARNING: CPU: 0 PID: 1 at /home/mhiramat/ksrc/linux/kernel/ trace/trace.c:1512 run_tracer_selftest+0xf3/0x154 This is due to the tracepoint code increasing the preempt nesting count by calling an additional preempt_disable before calling into the preemptoff tracer which messes up the preempt_count() check in tracer_hardirqs_off. To fix this, make the irqsoff tracer probes balance the additional outer preempt_disable with a preempt_enable_notrace. The other way to fix this is to just use SRCU for all tracepoints. However we can't do that because we can't use NMIs from RCU context. Link: http://lkml.kernel.org/r/20180806034049.67949-1-joel@joelfernandes.org Fixes: c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") Fixes: e6753f23d961 ("tracepoint: Make rcuidle tracepoint callers use SRCU") Reported-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit b023a9396062df289399c6c4eab1f78c73199751 Author: Paul Burton Date: Mon Aug 6 18:18:52 2018 -0700 MIPS: Avoid using array as parameter to write_c0_kpgd() Passing an array (swapper_pg_dir) as the argument to write_c0_kpgd() in setup_pw() will become problematic if we modify __write_64bit_c0_split() to cast its val argument to unsigned long long, because for 32-bit kernel builds the size of a pointer will differ from the size of an unsigned long long. This would fall foul of gcc's pointer-to-int-cast diagnostic. Cast the value to a long, which should be the same width as the pointer that we ultimately want & will be sign extended if required to the unsigned long long that __write_64bit_c0_split() ultimately needs. Signed-off-by: Paul Burton commit ee67855ecd9d02da348af11ec8474698b886a0e6 Author: Paul Burton Date: Mon Aug 6 15:24:27 2018 -0700 MIPS: vdso: Allow clang's --target flag in VDSO cflags The MIPS VDSO code filters out a subset of known-good flags from KBUILD_CFLAGS to use when building VDSO libraries. When we build using clang we need to allow the --target flag through, otherwise we'll generally attempt to build the VDSO for the architecture of the build machine rather than for MIPS. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20154/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 4467f7ad7dbb0af5136fadb32dba37bc0388194f Author: Paul Burton Date: Mon Aug 6 15:24:25 2018 -0700 MIPS: genvdso: Remove GOT checks Our genvdso tool performs some rather paranoid checking that the VDSO library isn't attempting to make use of a GOT by constraining the number of entries that the GOT is allowed to contain to the minimum 2 entries that are always generated by binutils. Unfortunately lld prior to revision 334390 generates a third entry, which is unused & thus harmless but falls foul of genvdso's checks & causes the build to fail. Since we already check that the VDSO contains no relocations it seems reasonable to presume that it also doesn't contain use of a GOT, which would involve relocations. Thus rather than attempting to work around this issue by allowing 3 GOT entries when using lld, simply remove the GOT checks which seem overly paranoid. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20152/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit f8ad8aa551af812adf2ba49a554c73cc9daa8d36 Author: Andy Shevchenko Date: Mon Jul 30 15:38:37 2018 +0300 gpio: vr41xx: Bail out on gpiochip_lock_as_irq() error gpiochip_lock_as_irq() may return a few error codes, bail out if it fails with corresponding returned code. Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit d124339da78d1f3b97d1dfa01dc4b52fca2f28e0 Author: Andy Shevchenko Date: Mon Jul 30 15:38:36 2018 +0300 gpio: uniphier: Bail out on gpiochip_lock_as_irq() error gpiochip_lock_as_irq() may return a few error codes, bail out if it fails with corresponding returned code. Signed-off-by: Andy Shevchenko Acked-by: Masahiro Yamada Signed-off-by: Linus Walleij commit 6d7a2b8b559e5682167187d4413d5f11251fcb01 Author: Andy Shevchenko Date: Mon Jul 30 15:38:35 2018 +0300 gpio: xgene-sb: Don't shadow error code of gpiochip_lock_as_irq() gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -ENOSPC and let caller to decide. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 41d69087fd75f7288378082ee45c850109d9d289 Author: Andy Shevchenko Date: Mon Jul 30 15:38:34 2018 +0300 gpio: em: Don't shadow error code of gpiochip_lock_as_irq() gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 10ed35399ab0a46c2ff07b35977e0d423bde48f2 Author: Andy Shevchenko Date: Mon Jul 30 15:38:33 2018 +0300 gpio: dwapb: Don't shadow error code of gpiochip_lock_as_irq() gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Cc: Hoan Tran Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 9b073332dd12553751951b08f78d7d1416f5bee2 Author: Andy Shevchenko Date: Mon Jul 30 15:38:32 2018 +0300 gpio: bcm-kona: Don't shadow error code of gpiochip_lock_as_irq() gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Cc: Ray Jui Cc: Scott Branden Signed-off-by: Andy Shevchenko Reviewed-by: Florian Fainelli Signed-off-by: Linus Walleij commit 3a2f335c418fed18fc3e4b3d0ee0955e8b2c5f21 Author: Andy Shevchenko Date: Mon Jul 30 15:38:31 2018 +0300 gpiolib: Don't shadow error code of gpiochip_lock_as_irq() gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit cf2ff877a4eea5f5ad959050284eb93d5d2f803a Author: Levin Du Date: Tue Jul 31 13:59:19 2018 +0800 gpio: syscon: rockchip: add GRF GPIO support for rk3328 In Rockchip RK3328, the output only GPIO_MUTE pin, originally for codec mute control, can also be used for general purpose. It is manipulated by the GRF_SOC_CON10 register in GRF. Aside from the GPIO_MUTE pin, the HDMI pins can also be set in the same way. Currently this GRF GPIO controller only supports the mute pin. If needed in the future, the HDMI pins support can also be added. Signed-off-by: Levin Du Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner Signed-off-by: Linus Walleij commit 442af1403a2886f8f6d43f2f67f8a8b001e048d8 Author: Janusz Krzysztofik Date: Thu Jul 19 01:57:08 2018 +0200 gpio: omap: Add get/set_multiple() callbacks This should make applications utilizing whole banks work faster. Signed-off-by: Janusz Krzysztofik Acked-by: Grygorii Strashko Signed-off-by: Linus Walleij commit 640332d1a089909df08bc9f3e42888a2019c66e2 Author: Levin Du Date: Sat Aug 4 15:31:02 2018 +0800 clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 PWM2 is commonly used to control voltage of PWM regulator of VDD_LOG in RK3399. On the Firefly-RK3399 board, PWM2 outputs 40 KHz square wave from power on and the VDD_LOG is about 0.9V. When the kernel boots normally into the system, the PWM2 keeps outputing PWM signal. But the kernel hangs randomly after "Starting kernel ..." line on that board. When it happens, PWM2 outputs high level which causes VDD_LOG drops to 0.4V below the normal operating voltage. By adding "pclk_rkpwm_pmu" to the rk3399_pmucru_critical_clocks array, PWM clock is ensured to be prepared at startup and the PWM2 output is normal. After repeated tests, the early boot hang is gone. This patch works on both Firefly-RK3399 and ROC-RK3399-PC boards. Signed-off-by: Levin Du Signed-off-by: Heiko Stuebner commit 2224f2ff9670b899983ff1b42d85530e889cfea1 Author: Kitone Elvis Peter Date: Mon Aug 6 20:27:59 2018 +0300 leds: ns2: Change unsigned to unsigned int Use unsigned int, because it's preferred to unsigned. Signed-off-by: Kitone Elvis Peter Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 4823e5da2ea9061011242db81334d6ebbd2ed0a5 Author: Lucas Stach Date: Mon Aug 6 15:12:48 2018 +0200 drm/scheduler: fix timeout worker setup for out of order job completions drm_sched_job_finish() is a work item scheduled for each finished job on a unbound system workqueue. This means the workers can execute out of order with regard to the real hardware job completions. If this happens queueing a timeout worker for the first job on the ring mirror list is wrong, as this may be a job which has already finished executing. Fix this by reorganizing the code to always queue the worker for the next job on the list, if this job hasn't finished yet. This is robust against a potential reordering of the finish workers. Also move out the timeout worker cancelling, so that we don't need to take the job list lock twice. As a small optimization list_del is used to remove the job from the ring mirror list, as there is no need to reinit the list head in the job we are about to free. Signed-off-by: Lucas Stach Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1e1dbd6fd10031bf46d9e44b6ad423e2ee39e2a7 Author: Hersen Wu Date: Fri Jul 27 14:52:37 2018 -0400 drm/amd/display: display connected to dp-1 does not light up [why] for vega, dp set_panel_mode is handled by psp firmware. dal should not program the register again. [how] dal does not program panel mode. Signed-off-by: Hersen Wu Reviewed-by: Charlene Liu Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 81aca8e75c1b046865fb2badef95a0dcff6f73de Author: Mikita Lipski Date: Fri Jul 13 09:07:35 2018 -0400 drm/amd/display: update clk for various HDMI color depths [why] When programming tonga's connector's backend we didn't take in account that HDMI's colour depth might be more than 8bpc therefore we need to add a switch statement that would adjust the pixel clock accordingly. [how] Add a switch statement updating clock by its appropriate coefficient. Signed-off-by: Mikita Lipski Reviewed-by: Charlene Liu Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 99326ee3624b90d176a8f7e2aa3d15dfaa59c8f1 Author: Dmytro Laktyushkin Date: Thu Jul 26 12:17:58 2018 -0400 drm/amd/display: program display clock on cache match [Why] We seem to have an issue where high enough display clock will not get set properly during S3 resume if we only call vbios once [How] Expand condition of display clock programming to happen even when cached display clock matches requested display clock Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit fb7b11e1633e50b9a6b3fffe5cd151474aee9802 Author: Nicholas Kazlauskas Date: Mon Jul 30 12:27:23 2018 -0400 drm/amd/display: Add NULL check for enabling dp ss [Why] The pointer for integrated_info can be NULL which causes the system to do a null pointer deference and hang on boot. [How] Add a check to ensure that integrated_info is not null before enabling DP ss. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Sun peng Li Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit ad830e7ab1847f4a014c04496b2581a7497b204f Author: Dmytro Laktyushkin Date: Wed Jul 18 15:25:34 2018 -0400 drm/amd/display: add vbios table check for enabling dp ss Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 405c018a25fe464dc68057bbc8014a58f2bd4422 Author: M. Vefa Bicakci Date: Tue Jul 24 08:45:47 2018 -0400 xen/pv: Call get_cpu_address_sizes to set x86_virt/phys_bits Commit d94a155c59c9 ("x86/cpu: Prevent cpuinfo_x86::x86_phys_bits adjustment corruption") has moved the query and calculation of the x86_virt_bits and x86_phys_bits fields of the cpuinfo_x86 struct from the get_cpu_cap function to a new function named get_cpu_address_sizes. One of the call sites related to Xen PV VMs was unfortunately missed in the aforementioned commit. This prevents successful boot-up of kernel versions 4.17 and up in Xen PV VMs if CONFIG_DEBUG_VIRTUAL is enabled, due to the following code path: enlighten_pv.c::xen_start_kernel mmu_pv.c::xen_reserve_special_pages page.h::__pa physaddr.c::__phys_addr physaddr.h::phys_addr_valid phys_addr_valid uses boot_cpu_data.x86_phys_bits to validate physical addresses. boot_cpu_data.x86_phys_bits is no longer populated before the call to xen_reserve_special_pages due to the aforementioned commit though, so the validation performed by phys_addr_valid fails, which causes __phys_addr to trigger a BUG, preventing boot-up. Signed-off-by: M. Vefa Bicakci Reviewed-by: Thomas Gleixner Reviewed-by: Boris Ostrovsky Cc: "Kirill A. Shutemov" Cc: Andy Lutomirski Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: xen-devel@lists.xenproject.org Cc: x86@kernel.org Cc: stable@vger.kernel.org # for v4.17 and up Fixes: d94a155c59c9 ("x86/cpu: Prevent cpuinfo_x86::x86_phys_bits adjustment corruption") Signed-off-by: Boris Ostrovsky commit de7de576eca204de9a38e2f6dafe6b7c1ddc85c1 Merge: 70837ffe3085 be10d5d1c2d1 Author: David S. Miller Date: Mon Aug 6 13:17:48 2018 -0700 Merge branch 'ieee802154-for-davem-2018-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next Stefan Schmidt says: ==================== pull-request: ieee802154-next 2018-08-06 An update from ieee802154 for *net-next* Romuald added a socket option to get the LQI value of the received datagram. Alexander added a new hardware simulation driver modelled after hwsim of the wireless people. It allows runtime configuration for new nodes and edges over a netlink interface (a config utlity is making its way into wpan-tools). We also have three fixes in here. One from Colin which is more of a cleanup and two from Alex fixing tailroom and single frame space problems. I would normally put the last two into my fixes tree, but given we are already in -rc8 I simply put them here and added a cc: stable to them. ==================== Signed-off-by: David S. Miller commit 70837ffe3085c9a91488b52ca13ac84424da1042 Author: Dan Carpenter Date: Mon Aug 6 22:17:35 2018 +0300 ipv4: frags: precedence bug in ip_expire() We accidentally removed the parentheses here, but they are required because '!' has higher precedence than '&'. Fixes: fa0f527358bd ("ip: use rb trees for IP frag queue.") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 673bb2dfc36488abfdbbfc2ce2631204eaf682f2 Author: Ben Hutchings Date: Sun Aug 5 17:41:09 2018 +0100 scripts/kernel-doc: Escape all literal braces in regexes Commit 701b3a3c0ac4 ("PATCH scripts/kernel-doc") fixed the two instances of literal braces that Perl 5.28 warns about, but there are still more than it doesn't warn about. Escape all left braces that are treated as literal characters. Also escape literal right braces, for consistency and to avoid confusing bracket-matching in text editors. Signed-off-by: Ben Hutchings Signed-off-by: Jonathan Corbet commit d2f884612c42850db0b3521b74a05636a5fc035f Author: Colin Ian King Date: Wed Aug 1 11:47:42 2018 +0100 ALSA: intel_hdmi: remove redundant variable cfg_val Variable cfg_val is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'cfg_val' set but not used [-Wunused-but-set-variable] [ Background info about val_bit field from alsa-devel ML thread: tiwai: Actually this made me wonder what is the definition of val_bit. It seems always 1 in the current code after the commit 964ca8083c02. Pierre? pbossart: This val_bit is only there for debug/test, it should be set to one by default and has nothing to do with the lpcm_id. This variable was set even in patches before upstream submission and was never needed, I guess it must be a 9-yr old issue. Good catch! ] Signed-off-by: Colin Ian King Acked-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit 3e27e10e2ecee0d3a0083f8ae76354ac9c6ad15c Author: Mikita Lipski Date: Thu Jul 12 16:44:05 2018 -0400 drm/amd/display: Don't share clk source between DP and HDMI [why] Prevent clock source sharing between HDMI and DP connectors. DP shouldn't be sharing its ref clock with phy clock, which caused an issue of older ASICS booting up with multiple diplays plugged in. [how] Add an extra check that would prevent HDMI and DP sharing clk. Signed-off-by: Mikita Lipski Reviewed-by: Hersen Wu Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 9315e2399a2cdc236e8d42c1a21fb1071cdad03d Author: Hersen Wu Date: Mon Jul 16 11:21:12 2018 -0400 drm/amd/display: Fix DP HBR2 Eye Diagram Pattern on Carrizo [why] dp hbr2 eye diagram pattern for raven asic is not stabled. workaround is to use tp4 pattern. But this should not be applied to asic before raven. [how] add new bool varilable in asic caps. for raven asic, use the workaround. for carrizo, vega, do not use workaround. Signed-off-by: Hersen Wu Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher commit 5ae6fe572929587a304471bf4a641361a45152b5 Author: Nicholas Kazlauskas Date: Mon Jul 23 14:13:23 2018 -0400 drm/amd/display: Use calculated disp_clk_khz value for dce110 [Why] The calculated values for actual disp_clk_khz were ignored when notifying pplib of the new display requirements. In order to honor DFS bypass clocks from the hardware, the calculated value should be used. [How] The return value for set_dispclk is now assigned back into new_clocks and correctly carried through into dccg->clks.phyclk_khz. When notifying pplib of new display requirements dccg->clks.phyclk_khz is used instead of dce.dispclk_khz. The value of dce.dispclk_khz was never explicitly set to anything before. A 15% higher display clock value than calculated is no longer requested for dce110 since it now makes use of the calculated value. Since dce112 makes use of dce110's set_bandwidth but not its update_clocks it needs to have the value correctly carried through. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Harry Wentland Reviewed-by: Dmytro Laktyushkin Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 78e4405cec6cb0780b27b222685dde33934b38e4 Author: David Francis Date: Thu Jul 12 15:46:41 2018 -0400 drm/amd/display: Implement custom degamma lut on dcn [Why] Custom degamma lut functions are a feature we would like to support on compatible hardware [How] In atomic check, convert from array of drm_color_lut to dc_transfer_func. On hardware commit, allow for possibility of custom degamma. Both are based on the equivalent regamma pipeline. Signed-off-by: David Francis Reviewed-by: Krunoslav Kovac Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit d90e9a3bf5e747f0e3b0c8bec96d8699493f63ab Author: David Francis Date: Thu Jul 19 15:48:24 2018 -0400 drm/amd/display: Destroy aux_engines only once [Why] In the dce112 function to destroy the resource pool, engines (the aux engines) is destroyed twice. This has no ill effects but is a tad redundant. [How] Remove the redundant call Signed-off-by: David Francis Reviewed-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 53a53f8687faf492df2644d8c18ff0217fc18730 Author: David Francis Date: Wed Jul 18 16:03:30 2018 -0400 drm/amd/display: Read back max backlight value at boot [Why] If there is no program explicitly setting the backlight brightness (for example, during a minimal install of linux), the hardware defaults to maximum brightness but the backlight_device defaults to 0 value. Thus, settings displays the wrong brightness value. [How] When creating the backlight device, set brightness to max Signed-off-by: David Francis Reviewed-by: Harry Wentland Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 620a0d27b211aa03d3f99accfdd58b88e6e0504c Author: David Francis Date: Thu Jul 19 11:25:05 2018 -0400 drm/amd/display: Implement backlight_ops.get_brightness [Why] This hook that is supposed to read the actual backlight value is used in a few places throughout the kernel to setup or force update on backlight [How] Create a dc function that calls the existing abm function, and call that function from amdgpu Signed-off-by: David Francis Reviewed-by: Harry Wentland Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 0301ccbaf67d3d9aea97156c5eb85233bb5a5178 Author: abdoulaye berthe Date: Thu Jul 19 15:39:55 2018 -0400 drm/amd/display: DP Compliance 400.1.1 failure [Why] 400.1.1 is failing because we are not performing link training when we get an HPD pulse for the same display. This is breaking DP compliance [How] Always perform link training after HPD pulse if the detection reason is not DETECT_REASON_HPDRX. Signed-off-by: abdoulaye berthe Reviewed-by: Wenjing Liu Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit e11d41472a50742c16d53c968e143fb498fa482f Author: Leo (Sunpeng) Li Date: Thu Jul 19 08:22:16 2018 -0400 drm/amd/display: Use requested HDMI aspect ratio [Why] The DRM mode's HDMI picture aspect ratio field was never saved in dc_stream's timing struct. This causes us to mistake a new stream to have the same timings as the old, even though the user has requested a different aspect ratio. [How] Save DRM's aspect ratio field within dc_stream's timing struct. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107153 Signed-off-by: Leo (Sunpeng) Li Reviewed-by: Mikita Lipski Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit ce29af2a505627cc8f1deddb84bcbaf186b0bfd5 Author: Bjorn Helgaas Date: Wed Jul 25 14:53:42 2018 -0500 PCI: Remove unnecessary include of Several PCI core files include pci-aspm.h even though they don't need anything provided by that file. Remove the unnecessary includes of it. Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya commit 2b2654b8922a46aeabc9bf13e0361a96110317e7 Author: Bjorn Helgaas Date: Wed Jul 25 14:53:41 2018 -0500 iwlwifi: Remove unnecessary include of This part of the iwlwifi driver doesn't need anything provided by pci-aspm.h, so remove the unnecessary include of it. Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Acked-by: Luca Coelho commit a78613c08267107e3ffaa40290a269be79386fce Author: Bjorn Helgaas Date: Wed Jul 25 14:53:40 2018 -0500 ath9k: Remove unnecessary include of The ath9k driver doesn't need anything provided by pci-aspm.h, so remove the unnecessary include of it. Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Acked-by: Kalle Valo commit f5ddcf71e66eac681500ab94df0f9e33c4f2b4a7 Author: Bjorn Helgaas Date: Wed Jul 25 14:53:40 2018 -0500 igb: Remove unnecessary include of The igb driver doesn't need anything provided by pci-aspm.h, so remove the unnecessary include of it. Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Acked-by: Alexander Duyck Acked-by: Jeff Kirsher commit 36131ce9a0b23ed6feb04f8a3ffaa44b804abd5e Author: Andy Shevchenko Date: Mon Aug 6 14:30:34 2018 -0500 PCI/ASPM: Convert to use sysfs_match_string() helper The sysfs_match_string() helper returns index of the matching string in an array. Use it in pcie_aspm_set_policy() to simplify the code. Signed-off-by: Andy Shevchenko [bhelgaas: squash sysfs_match_string() fix into original patch for issue Reported-by: Heiner Kallweit ] Signed-off-by: Bjorn Helgaas commit 315706049c343794ad0d3e5b6f6b60b900457b11 Merge: 706d51681d63 c40a56a7818c Author: Thomas Gleixner Date: Mon Aug 6 20:56:34 2018 +0200 Merge branch 'x86/pti-urgent' into x86/pti Integrate the PTI Global bit fixes which conflict with the 32bit PTI support. Signed-off-by: Thomas Gleixner commit c40a56a7818cfe735fc93a69e1875f8bba834483 Author: Dave Hansen Date: Thu Aug 2 15:58:31 2018 -0700 x86/mm/init: Remove freed kernel image areas from alias mapping The kernel image is mapped into two places in the virtual address space (addresses without KASLR, of course): 1. The kernel direct map (0xffff880000000000) 2. The "high kernel map" (0xffffffff81000000) We actually execute out of #2. If we get the address of a kernel symbol, it points to #2, but almost all physical-to-virtual translations point to Parts of the "high kernel map" alias are mapped in the userspace page tables with the Global bit for performance reasons. The parts that we map to userspace do not (er, should not) have secrets. When PTI is enabled then the global bit is usually not set in the high mapping and just used to compensate for poor performance on systems which lack PCID. This is fine, except that some areas in the kernel image that are adjacent to the non-secret-containing areas are unused holes. We free these holes back into the normal page allocator and reuse them as normal kernel memory. The memory will, of course, get *used* via the normal map, but the alias mapping is kept. This otherwise unused alias mapping of the holes will, by default keep the Global bit, be mapped out to userspace, and be vulnerable to Meltdown. Remove the alias mapping of these pages entirely. This is likely to fracture the 2M page mapping the kernel image near these areas, but this should affect a minority of the area. The pageattr code changes *all* aliases mapping the physical pages that it operates on (by default). We only want to modify a single alias, so we need to tweak its behavior. This unmapping behavior is currently dependent on PTI being in place. Going forward, we should at least consider doing this for all configurations. Having an extra read-write alias for memory is not exactly ideal for debugging things like random memory corruption and this does undercut features like DEBUG_PAGEALLOC or future work like eXclusive Page Frame Ownership (XPFO). Before this patch: current_kernel:---[ High Kernel Mapping ]--- current_kernel-0xffffffff80000000-0xffffffff81000000 16M pmd current_kernel-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd current_kernel-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte current_kernel-0xffffffff81e11000-0xffffffff82000000 1980K RW NX pte current_kernel-0xffffffff82000000-0xffffffff82600000 6M ro PSE GLB NX pmd current_kernel-0xffffffff82600000-0xffffffff82c00000 6M RW PSE NX pmd current_kernel-0xffffffff82c00000-0xffffffff82e00000 2M RW NX pte current_kernel-0xffffffff82e00000-0xffffffff83200000 4M RW PSE NX pmd current_kernel-0xffffffff83200000-0xffffffffa0000000 462M pmd current_user:---[ High Kernel Mapping ]--- current_user-0xffffffff80000000-0xffffffff81000000 16M pmd current_user-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd current_user-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte current_user-0xffffffff81e11000-0xffffffff82000000 1980K RW NX pte current_user-0xffffffff82000000-0xffffffff82600000 6M ro PSE GLB NX pmd current_user-0xffffffff82600000-0xffffffffa0000000 474M pmd After this patch: current_kernel:---[ High Kernel Mapping ]--- current_kernel-0xffffffff80000000-0xffffffff81000000 16M pmd current_kernel-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd current_kernel-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte current_kernel-0xffffffff81e11000-0xffffffff82000000 1980K pte current_kernel-0xffffffff82000000-0xffffffff82400000 4M ro PSE GLB NX pmd current_kernel-0xffffffff82400000-0xffffffff82488000 544K ro NX pte current_kernel-0xffffffff82488000-0xffffffff82600000 1504K pte current_kernel-0xffffffff82600000-0xffffffff82c00000 6M RW PSE NX pmd current_kernel-0xffffffff82c00000-0xffffffff82c0d000 52K RW NX pte current_kernel-0xffffffff82c0d000-0xffffffff82dc0000 1740K pte current_user:---[ High Kernel Mapping ]--- current_user-0xffffffff80000000-0xffffffff81000000 16M pmd current_user-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd current_user-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte current_user-0xffffffff81e11000-0xffffffff82000000 1980K pte current_user-0xffffffff82000000-0xffffffff82400000 4M ro PSE GLB NX pmd current_user-0xffffffff82400000-0xffffffff82488000 544K ro NX pte current_user-0xffffffff82488000-0xffffffff82600000 1504K pte current_user-0xffffffff82600000-0xffffffffa0000000 474M pmd [ tglx: Do not unmap on 32bit as there is only one mapping ] Fixes: 0f561fce4d69 ("x86/pti: Enable global pages for shared areas") Signed-off-by: Dave Hansen Signed-off-by: Thomas Gleixner Cc: Kees Cook Cc: Andrea Arcangeli Cc: Juergen Gross Cc: Josh Poimboeuf Cc: Greg Kroah-Hartman Cc: Peter Zijlstra Cc: Hugh Dickins Cc: Linus Torvalds Cc: Borislav Petkov Cc: Andy Lutomirski Cc: Andi Kleen Cc: Joerg Roedel Link: https://lkml.kernel.org/r/20180802225831.5F6A2BFC@viggo.jf.intel.com commit 3237c0dbe21f8d2ca2feaa3891aff3619873cd30 Author: Michał Winiarski Date: Thu Jul 12 17:53:30 2018 +0200 drm/i915/kvmgt: Fix compilation error gvt_pin_guest_page extracted some of the gvt_dma_map_page functionality: commit 79e542f5af79 ("drm/i915/kvmgt: Support setting dma map for huge pages") And yet, part of it was reintroduced in: commit 39b4cbadb9a9 ("drm/i915/kvmgt: Check the pfn got from vfio_pin_pages") Causing kvmgt part to no longer build. Let's remove it. Reported-by: Tomasz Lis Signed-off-by: Michał Winiarski Cc: Changbin Du Cc: Zhenyu Wang Acked-by: Zhenyu Wang Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180712155330.32055-1-michal.winiarski@intel.com (cherry picked from commit 4eaf317a60fbea0555b936035002ca9bd9b9105d) Signed-off-by: Rodrigo Vivi commit e4cc5a1873ac1297615962185f94adbbfaf6456b Author: Marcel Holtmann Date: Mon Aug 6 17:58:40 2018 +0200 Bluetooth: btqca: Introduce HCI_EV_VENDOR and use it Using HCI_VENDOR_PKT for vendor specific events does work since it has also the value 0xff, but it is actually the packet type indicator constant and not the event constant. So introduce HCI_EV_VENDOR and use it. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 0dd0e297f0ec780b6b3484ba38b27d18c8ca7af9 Author: Alex Williamson Date: Thu Jul 12 16:33:04 2018 -0600 vfio-pci: Disable binding to PFs with SR-IOV enabled We expect to receive PFs with SR-IOV disabled, however some host drivers leave SR-IOV enabled at unbind. This puts us in a state where we can potentially assign both the PF and the VF, leading to both functionality as well as security concerns due to lack of managing the SR-IOV state as well as vendor dependent isolation from the PF to VF. If we were to attempt to actively disable SR-IOV on driver probe, we risk VF bound drivers blocking, potentially risking live lock scenarios. Therefore simply refuse to bind to PFs with SR-IOV enabled with a warning message indicating the issue. Users can resolve this by re-binding to the host driver and disabling SR-IOV before attempting to use the device with vfio-pci. Reviewed-by: David Gibson Reviewed-by: Peter Xu Signed-off-by: Alex Williamson commit 544c05a60aef7de34ef60eebaf46582ca2bf05f9 Author: Gustavo A. R. Silva Date: Mon Jul 9 17:53:09 2018 -0500 vfio: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Alex Williamson commit a69508c2847d26869e85daadc9f74abaf1253a52 Author: Wolfram Sang Date: Wed Jul 25 21:16:55 2018 +0200 ata: sata_rcar: Add r8a77965 support Update the binding docs for Renesas R-Car M3-N. No driver changes are needed. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Tejun Heo commit 75eef0f1ed478284911b8723a5bdb659499a7aac Author: Chris Wilson Date: Thu Aug 2 15:04:16 2018 +0100 drm/i915/lpe: Mark LPE audio runtime pm as "no callbacks" The LPE audio is a child device of i915, it is powered up and down alongside the igfx and presents no independent runtime interface. This aptly fulfils the description of a "No-Callback" Device, so mark it thus. Fixes: 183c00350ccd ("drm/i915: Fix runtime PM for LPE audio") Testcase: igt/pm_rpm/basic-pci-d3-state Testcase: igt/pm_rpm/basic-rte Signed-off-by: Chris Wilson Cc: Takashi Iwai Cc: Pierre-Louis Bossart Cc: Ville Syrjälä Cc: stable@vger.kernel.org Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180802140416.6062-1-chris@chris-wilson.co.uk (cherry picked from commit 46e831abe864a6b59fa3de253a681c0f2ee1bf2f) Signed-off-by: Rodrigo Vivi commit 497bfb706844892d07495f2ed5dff977fede5e25 Author: Mika Kuoppala Date: Mon Jul 30 15:06:36 2018 +0300 Revert "drm/i915/icl: WaEnableFloatBlendOptimization" The register for 0xe420 is unable to hold any value, including this bit. The documentation is also mixed between having a register bit for toggle and having a state command setup for it. Apparently the register toggle is deprecated. Remove the register toggle as evidence shows it's futile. The thing remaining is an apology and humble request for Mesa folks to resurrect their state setup for this as they were on right track from start. This reverts commit 0bf059f3532bb39c52d917142206a8554fc2f1c5. Fixes: 0bf059f3532b ("drm/i915/icl: WaEnableFloatBlendOptimization") References: HSDES#1406393558 Cc: Oscar Mateo Cc: Anuj Phogat Cc: Chris Wilson Cc: Lionel Landwerlin Signed-off-by: Mika Kuoppala Acked-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180730120636.26958-1-mika.kuoppala@linux.intel.com (cherry picked from commit c358514ba8da9e235876db1628cedd19a35803c6) Signed-off-by: Rodrigo Vivi commit 027063b1606fea6df15c270e5f2a072d1dfa8fef Author: Chris Wilson Date: Tue Jul 31 14:26:29 2018 +0100 drm/i915: Interactive RPS mode RPS provides a feedback loop where we use the load during the previous evaluation interval to decide whether to up or down clock the GPU frequency. Our responsiveness is split into 3 regimes, a high and low plateau with the intent to keep the gpu clocked high to cover occasional stalls under high load, and low despite occasional glitches under steady low load, and inbetween. However, we run into situations like kodi where we want to stay at low power (video decoding is done efficiently inside the fixed function HW and doesn't need high clocks even for high bitrate streams), but just occasionally the pipeline is more complex than a video decode and we need a smidgen of extra GPU power to present on time. In the high power regime, we sample at sub frame intervals with a bias to upclocking, and conversely at low power we sample over a few frames worth to provide what we consider to be the right levels of responsiveness respectively. At low power, we more or less expect to be kicked out to high power at the start of a busy sequence by waitboosting. Prior to commit e9af4ea2b9e7 ("drm/i915: Avoid waitboosting on the active request") whenever we missed the frame or stalled, we would immediate go full throttle and upclock the GPU to max. But in commit e9af4ea2b9e7, we relaxed the waitboosting to only apply if the pipeline was deep to avoid over-committing resources for a near miss. Sadly though, a near miss is still a miss, and perceptible as jitter in the frame delivery. To try and prevent the near miss before having to resort to boosting after the fact, we use the pageflip queue as an indication that we are in an "interactive" regime and so should sample the load more frequently to provide power before the frame misses it vblank. This will make us more favorable to providing a small power increase (one or two bins) as required rather than going all the way to maximum and then having to work back down again. (We still keep the waitboosting mechanism around just in case a dramatic change in system load requires urgent uplocking, faster than we can provide in a few evaluation intervals.) v2: Reduce rps_set_interactive to a boolean parameter to avoid the confusion of what if they wanted a new power mode after pinning to a different mode (which to choose?) v3: Only reprogram RPS while the GT is awake, it will be set when we wake the GT, and while off warns about being used outside of rpm. v4: Fix deferred application of interactive mode v5: s/state/interactive/ v6: Group the mutex with its principle in a substruct Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107111 Fixes: e9af4ea2b9e7 ("drm/i915: Avoid waitboosting on the active request") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: Radoslaw Szwichtenberg Cc: Ville Syrjälä Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180731132629.3381-1-chris@chris-wilson.co.uk (cherry picked from commit 60548c554be2830d29d2533dad0ac8133347ee51) Signed-off-by: Rodrigo Vivi commit 656921a51244b72cd1105df61b0af15825bddb72 Author: Rodrigo Vivi Date: Thu Jul 19 17:31:55 2018 -0700 drm/i915: Fix psr sink status report. First of all don't try to read dpcd if PSR is not even supported. But also, if read failed return -EIO instead of reporting via a backchannel. v2: fix dev_priv: At this level m->private is the connector. (CI/DK) don't convert dpcd read errors to EIO. (DK) Fixes: 5b7b30864d1d ("drm/i915/psr: Split sink status into a separate debugfs node") Cc: Chris Wilson Cc: Dhinakaran Pandiyan Cc: José Roberto de Souza Signed-off-by: Rodrigo Vivi Reviewed-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180720003155.16290-1-rodrigo.vivi@intel.com (cherry picked from commit 7a72c78bdd0a1ea1d879610542679cc680398220) Signed-off-by: Rodrigo Vivi commit 74c05a33cb02e75888771bc39e22e438195d6427 Author: Yangbo Lu Date: Mon Aug 6 12:39:11 2018 +0800 ptp_qoriq: use div_u64/div_u64_rem for 64-bit division This is a fix-up patch for below build issue with multi_v7_defconfig. drivers/ptp/ptp_qoriq.o: In function `qoriq_ptp_probe': ptp_qoriq.c:(.text+0xd0c): undefined reference to `__aeabi_uldivmod' Fixes: 91305f281262 ("ptp_qoriq: support automatic configuration for ptp timer") Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit 9dae34978d83df06fc59aff5cf0d88ce41b80643 Author: Yafang Shao Date: Mon Aug 6 11:57:02 2018 +0800 net: avoid unnecessary sock_flag() check when enable timestamp The sock_flag() check is alreay inside sock_enable_timestamp(), so it is unnecessary checking it in the caller. void sock_enable_timestamp(struct sock *sk, int flag) { if (!sock_flag(sk, flag)) { ... } } Signed-off-by: Yafang Shao Signed-off-by: David S. Miller commit 429711aec282c4b5fe5bbd7b2f0bbbff4110ffb2 Author: Jason Wang Date: Mon Aug 6 11:17:47 2018 +0800 vhost: switch to use new message format We use to have message like: struct vhost_msg { int type; union { struct vhost_iotlb_msg iotlb; __u8 padding[64]; }; }; Unfortunately, there will be a hole of 32bit in 64bit machine because of the alignment. This leads a different formats between 32bit API and 64bit API. What's more it will break 32bit program running on 64bit machine. So fixing this by introducing a new message type with an explicit 32bit reserved field after type like: struct vhost_msg_v2 { __u32 type; __u32 reserved; union { struct vhost_iotlb_msg iotlb; __u8 padding[64]; }; }; We will have a consistent ABI after switching to use this. To enable this capability, introduce a new ioctl (VHOST_SET_BAKCEND_FEATURE) for userspace to enable this feature (VHOST_BACKEND_F_IOTLB_V2). Fixes: 6b1e6cc7855b ("vhost: new device IOTLB API") Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit 9c2e955c48363a6a000a684aa49be7f4ac1120ad Author: zhong jiang Date: Mon Aug 6 11:07:23 2018 +0800 net/bridge/br_multicast: remove redundant variable "err" The err is not modified after initalization, So remove it and make it to be void function. Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit be1459de2eea3619dbbb8f1f9a420e103a85986a Author: Al Viro Date: Sat Aug 4 21:41:27 2018 +0100 mellanox: fix the dport endianness in call of __inet6_lookup_established() __inet6_lookup_established() expect th->dport passed in host-endian, not net-endian. The reason is microoptimization in __inet6_lookup(), but if you use the lower-level helpers, you have to play by their rules... Signed-off-by: Al Viro Signed-off-by: David S. Miller commit 96b954895470fa1f64232fd9b1e31f445b8a3c35 Author: Masaharu Hayakawa Date: Mon Aug 6 12:42:00 2018 +0200 ata: sata_rcar: exclude setting of PHY registers in Gen3 According to documentation, setting of PHY registers is unnecessary with R-Car Gen3. The registers are not even described. So, don't initialize them. Signed-off-by: Masaharu Hayakawa [wsa: updated commit message] Signed-off-by: Wolfram Sang Reviewed-by: Sergei Shtylyov Signed-off-by: Tejun Heo commit e207610fffbc339d14c663a6966454b8e9b2deff Author: Wolfram Sang Date: Mon Aug 6 12:40:05 2018 +0200 ata: sata_rcar: really mask all interrupts on Gen2 and later Since R-Car Gen2, a new bit has been introduced to the interrupt mask register. Update the code to handle it properly as well. Signed-off-by: Wolfram Sang Reviewed-by: Sergei Shtylyov Signed-off-by: Tejun Heo commit eac7e072d7e99fad1b6e817c608b03c48205241e Author: Tejun Heo Date: Mon Aug 6 10:22:35 2018 -0700 Revert "ata: ahci_platform: allow disabling of hotplug to save power" This reverts commit aece27a2f01be4bb7683790f69cd1bed3a0929a2. Causes boot failure on some devices. http://lore.kernel.org/r/CA+G9fYuKW_jCFZPqG4tz=QY9ROfHO38KiCp9XTA+KaDOFVtcqQ@mail.gmail.com Signed-off-by: Tejun Heo commit 96c25b777442d3a875b1921b1f047ea00d96c8ea Author: Jeff Layton Date: Sun Jun 17 05:31:17 2018 -0400 mailmap: remap some of my email addresses to kernel.org address Signed-off-by: Jeff Layton commit c883da313ebf459efd33d262ca963e3a5f0ac024 Author: Jeff Layton Date: Mon Jul 30 07:54:56 2018 -0400 locks: add tracepoint in flock codepath Signed-off-by: Jeff Layton commit 7dc084d62591bd5d7d09b4801fd4ec4ea3c59dca Author: Robert P. J. Day Date: Mon Aug 6 12:26:48 2018 -0400 MIPS: Remove obsolete MIPS checks for DST node "chosen@0" As there is precious little left in any DTS files referring to the node "/chosen@0" as opposed to "/chosen", remove the two checks for the former node name. [paul.burton@mips.com: The modified yamon-dt code only operates on arch/mips/boot/dts/mti/sead3.dts right now, and that uses chosen rather than chosen@0 anyway, so this should have no behavioural effect.] Signed-off-by: Robert P. J. Day Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20131/ Cc: linux-mips@linux-mips.org commit fd8ca6dac9b45db8503cf508880edd63e039e2f2 Author: Uros Bizjak Date: Mon Aug 6 16:42:49 2018 +0200 KVM/x86: Use CC_SET()/CC_OUT in arch/x86/kvm/vmx.c Remove open-coded uses of set instructions to use CC_SET()/CC_OUT() in arch/x86/kvm/vmx.c. Signed-off-by: Uros Bizjak [Mark error paths as unlikely while touching this. - Paolo] Signed-off-by: Paolo Bonzini commit c21c834adb5bc81e7081aa93ac50619c6d060506 Author: Akshu Agrawal Date: Mon Aug 6 12:57:16 2018 +0530 ASoC: AMD: Set delay value for the capture case ACP->SYSMEM DMA happens at every I2S->SYSMEM period completion. Thus, there is delay of x frames till I2S->SYSMEM reaches a period length. This delay is communicated to user space. Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit 662fb3efe7ee835f0eeba6bc63b81e82a97fc312 Author: Mukunda, Vijendar Date: Mon Aug 6 12:57:15 2018 +0530 ASoC: AMD: Modified DMA pointer for capture Give position on ACP->SYSMEM DMA channel for the number of bytes that have been transferred on the basis of current descriptor under service. Signed-off-by: Vijendar Mukunda Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit bbdb7012b0736cda0b9b00a2949e9207cf2f892f Author: Akshu Agrawal Date: Mon Aug 6 12:57:14 2018 +0530 ASoC: AMD: Make ACP->SYSMEM DMA non circular In capture case we don't want ACP to SYSMEM dma to be circular. This is because if an in place DSP filter is applied to captured output then circular DMA can overwrite the filter value with stale data. Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit aaffcfd1e82d3378538408d0310b7424b98d8f81 Author: Wanpeng Li Date: Mon Jul 23 14:39:52 2018 +0800 KVM: X86: Implement PV IPIs in linux guest Implement paravirtual apic hooks to enable PV IPIs for KVM if the "send IPI" hypercall is available. The hypercall lets a guest send IPIs, with at most 128 destinations per hypercall in 64-bit mode and 64 vCPUs per hypercall in 32-bit mode. Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Vitaly Kuznetsov Signed-off-by: Wanpeng Li Signed-off-by: Paolo Bonzini commit d63bae079b6426afc998c5ea76d9cde8d8c98303 Author: Wanpeng Li Date: Mon Jul 23 14:39:51 2018 +0800 KVM: X86: Add kvm hypervisor init time platform setup callback Add kvm hypervisor init time platform setup callback which will be used to replace native apic hooks by pararvirtual hooks. Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Vitaly Kuznetsov Signed-off-by: Wanpeng Li Signed-off-by: Paolo Bonzini commit 4180bf1b655a791a0a6ef93a2ffffc762722c782 Author: Wanpeng Li Date: Mon Jul 23 14:39:54 2018 +0800 KVM: X86: Implement "send IPI" hypercall Using hypercall to send IPIs by one vmexit instead of one by one for xAPIC/x2APIC physical mode and one vmexit per-cluster for x2APIC cluster mode. Intel guest can enter x2apic cluster mode when interrupt remmaping is enabled in qemu, however, latest AMD EPYC still just supports xapic mode which can get great improvement by Exit-less IPIs. This patchset lets a guest send multicast IPIs, with at most 128 destinations per hypercall in 64-bit mode and 64 vCPUs per hypercall in 32-bit mode. Hardware: Xeon Skylake 2.5GHz, 2 sockets, 40 cores, 80 threads, the VM is 80 vCPUs, IPI microbenchmark(https://lkml.org/lkml/2017/12/19/141): x2apic cluster mode, vanilla Dry-run: 0, 2392199 ns Self-IPI: 6907514, 15027589 ns Normal IPI: 223910476, 251301666 ns Broadcast IPI: 0, 9282161150 ns Broadcast lock: 0, 8812934104 ns x2apic cluster mode, pv-ipi Dry-run: 0, 2449341 ns Self-IPI: 6720360, 15028732 ns Normal IPI: 228643307, 255708477 ns Broadcast IPI: 0, 7572293590 ns => 22% performance boost Broadcast lock: 0, 8316124651 ns x2apic physical mode, vanilla Dry-run: 0, 3135933 ns Self-IPI: 8572670, 17901757 ns Normal IPI: 226444334, 255421709 ns Broadcast IPI: 0, 19845070887 ns Broadcast lock: 0, 19827383656 ns x2apic physical mode, pv-ipi Dry-run: 0, 2446381 ns Self-IPI: 6788217, 15021056 ns Normal IPI: 219454441, 249583458 ns Broadcast IPI: 0, 7806540019 ns => 154% performance boost Broadcast lock: 0, 9143618799 ns Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Vitaly Kuznetsov Signed-off-by: Wanpeng Li Signed-off-by: Paolo Bonzini commit 74fec5b9dbaa5e6fe776f6c73e6c00fb23dca844 Author: Tianyu Lan Date: Mon Jul 23 12:31:21 2018 +0000 KVM/x86: Move X86_CR4_OSXSAVE check into kvm_valid_sregs() X86_CR4_OSXSAVE check belongs to sregs check and so move into kvm_valid_sregs(). Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit ee6268ba3a6861b2806e569bff7fe91fbdf846dd Author: Liang Chen Date: Wed Jul 25 16:32:14 2018 +0800 KVM: x86: Skip pae_root shadow allocation if tdp enabled Considering the fact that the pae_root shadow is not needed when tdp is in use, skip the pae_root shadow page allocation to allow mmu creation even not being able to obtain memory from DMA32 zone when particular cgroup cpuset.mems or mempolicy control is applied. Signed-off-by: Liang Chen Signed-off-by: Paolo Bonzini commit c2a4eadf7747a1359a80ede64e4ae0e0ba64ca08 Author: Tianyu Lan Date: Tue Jul 24 08:17:07 2018 +0000 KVM/MMU: Combine flushing remote tlb in mmu_set_spte() mmu_set_spte() flushes remote tlbs for drop_parent_pte/drop_spte() and set_spte() separately. This may introduce redundant flush. This patch is to combine these flushes and check flush request after calling set_spte(). Signed-off-by: Lan Tianyu Reviewed-by: Junaid Shahid Reviewed-by: Xiao Guangrong Signed-off-by: Paolo Bonzini commit 5e079c7ece1060491ef4a45414823162cce91b3d Author: Sean Christopherson Date: Mon Jul 23 12:32:50 2018 -0700 KVM: vmx: skip VMWRITE of HOST_{FS,GS}_BASE when possible The host's FS.base and GS.base rarely change, e.g. ~0.1% of host/guest swaps on my system. Cache the last value written to the VMCS and skip the VMWRITE to the associated VMCS fields when loading host state if the value hasn't changed since the last VMWRITE. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 8f21a0bbf36f58334695ae6e46c0cf906a217154 Author: Sean Christopherson Date: Mon Jul 23 12:32:49 2018 -0700 KVM: vmx: skip VMWRITE of HOST_{FS,GS}_SEL when possible On a 64-bit host, FS.sel and GS.sel are all but guaranteed to be 0, which in turn means they'll rarely change. Skip the VMWRITE for the associated VMCS fields when loading host state if the selector hasn't changed since the last VMWRITE. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit f3bbc0dcedf50d29d2d6fdfb16c5ec3e2368837f Author: Sean Christopherson Date: Mon Jul 23 12:32:48 2018 -0700 KVM: vmx: always initialize HOST_{FS,GS}_BASE to zero during setup The HOST_{FS,GS}_BASE fields are guaranteed to be written prior to VMENTER, by way of vmx_prepare_switch_to_guest(). Initialize the fields to zero for 64-bit kernels instead of pulling the base values from their respective MSRs. In addition to eliminating two RDMSRs, vmx_prepare_switch_to_guest() can safely assume the initial value of the fields is zero in all cases. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit d7ee039e2bab6341cdabf42d3036063cf91b40ea Author: Sean Christopherson Date: Mon Jul 23 12:32:47 2018 -0700 KVM: vmx: move struct host_state usage to struct loaded_vmcs Make host_state a property of a loaded_vmcs so that it can be used as a cache of the VMCS fields, e.g. to lazily VMWRITE the corresponding VMCS field. Treating host_state as a cache does not work if it's not VMCS specific as the cache would become incoherent when switching between vmcs01 and vmcs02. Move vmcs_host_cr3 and vmcs_host_cr4 into host_state. Explicitly zero out host_state when allocating a new VMCS for a loaded_vmcs. Unlike the pre-existing vmcs_host_cr{3,4} usage, the segment information is not guaranteed to be (re)initialized when running a new nested VMCS, e.g. HOST_FS_BASE is not written in vmx_set_constant_host_state(). Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit e920de8507c6c8760c775cd718627e7cbf57c3b7 Author: Sean Christopherson Date: Mon Jul 23 12:32:46 2018 -0700 KVM: vmx: compute need to reload FS/GS/LDT on demand Remove fs_reload_needed and gs_ldt_reload_needed from host_state and instead compute whether we need to reload various state at the time we actually do the reload. The state that is tracked by the *_reload_needed variables is not any more volatile than the trackers themselves. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit fd1ec7723fbd560f924769b43cbdfe82dfd6a98e Author: Sean Christopherson Date: Mon Jul 23 12:32:45 2018 -0700 KVM: nVMX: remove a misleading comment regarding vmcs02 fields prepare_vmcs02() has an odd comment that says certain fields are "not in vmcs02". AFAICT the intent of the comment is to document that various VMCS fields are not handled by prepare_vmcs02(), e.g. HOST_{FS,GS}_{BASE,SELECTOR}. While technically true, the comment is misleading, e.g. it can lead the reader to think that KVM never writes those fields to vmcs02. Remove the comment altogether as the handling of FS and GS is not specific to nested VMX, and GUEST_PML_INDEX has been written by prepare_vmcs02() since commit "4e59516a12a6 (kvm: vmx: ensure VMCS is current while enabling PML)" Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 6d6095bd2c915f4c2ba6f25e7d16e38b06c904de Author: Sean Christopherson Date: Mon Jul 23 12:32:44 2018 -0700 KVM: vmx: rename __vmx_load_host_state() and vmx_save_host_state() Now that the vmx_load_host_state() wrapper is gone, i.e. the only time we call the core functions is when we're actually about to switch between guest/host, rename the functions that handle lazy state switching to vmx_prepare_switch_to_{guest,host}_state() to better document the full extent of their functionality. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 678e315e78a780dbef384b92339c8414309dbc11 Author: Sean Christopherson Date: Mon Jul 23 12:32:43 2018 -0700 KVM: vmx: add dedicated utility to access guest's kernel_gs_base When lazy save/restore of MSR_KERNEL_GS_BASE was introduced[1], the MSR was intercepted in all modes and was only restored for the host when the guest is in 64-bit mode. So at the time, going through the full host restore prior to accessing MSR_KERNEL_GS_BASE was necessary to load host state and was not a significant waste of cycles. Later, MSR_KERNEL_GS_BASE interception was disabled for a 64-bit guest[2], and then unconditionally saved/restored for the host[3]. As a result, loading full host state is overkill for accesses to MSR_KERNEL_GS_BASE, and completely unnecessary when the guest is not in 64-bit mode. Add a dedicated utility to read/write the guest's MSR_KERNEL_GS_BASE (outside of the save/restore flow) to minimize the overhead incurred when accessing the MSR. When setting EFER, only decache the MSR if the new EFER will disable long mode. Removing out-of-band usage of vmx_load_host_state() also eliminates, or at least reduces, potential corner cases in its usage, which in turn will (hopefuly) make it easier to reason about future changes to the save/restore flow, e.g. optimization of saving host state. [1] commit 44ea2b1758d8 ("KVM: VMX: Move MSR_KERNEL_GS_BASE out of the vmx autoload msr area") [2] commit 5897297bc228 ("KVM: VMX: Don't intercept MSR_KERNEL_GS_BASE") [3] commit c8770e7ba63b ("KVM: VMX: Fix host userspace gsbase corruption") Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit bd9966de4e14fb559e89a06f7f5c9aab2cc028b9 Author: Sean Christopherson Date: Mon Jul 23 12:32:42 2018 -0700 KVM: vmx: track host_state.loaded using a loaded_vmcs pointer Using 'struct loaded_vmcs*' to track whether the CPU registers contain host or guest state kills two birds with one stone. 1. The (effective) boolean host_state.loaded is poorly named. It does not track whether or not host state is loaded into the CPU registers (which most readers would expect), but rather tracks if host state has been saved AND guest state is loaded. 2. Using a loaded_vmcs pointer provides a more robust framework for the optimized guest/host state switching, especially when consideration per-VMCS enhancements. To that end, WARN_ONCE if we try to switch to host state with a different VMCS than was last used to save host state. Resolve an occurrence of the new WARN by setting loaded_vmcs after the call to vmx_vcpu_put() in vmx_switch_vmcs(). Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit e368b875a8a91125f1bd0ffac1100c305c0bdff4 Author: Sean Christopherson Date: Mon Jul 23 12:32:41 2018 -0700 KVM: vmx: refactor segmentation code in vmx_save_host_state() Use local variables in vmx_save_host_state() to temporarily track the selector and base values for FS and GS, and reorganize the code so that the 64-bit vs 32-bit portions are contained within a single #ifdef. This refactoring paves the way for future patches to modify the updating of VMCS state with minimal changes to the code, and (hopefully) simplifies resolving a likely conflict with another in-flight patch[1] by being the whipping boy for future patches. [1] https://www.spinics.net/lists/kvm/msg171647.html Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit e49fcb8b9ef26dfb2d02b173d790e1ef41177121 Author: Jim Mattson Date: Fri Jul 27 13:44:45 2018 -0700 kvm: nVMX: Fix fault priority for VMX operations When checking emulated VMX instructions for faults, the #UD for "IF (not in VMX operation)" should take precedence over the #GP for "ELSIF CPL > 0." Suggested-by: Eric Northup Signed-off-by: Jim Mattson Reviewed-by: David Hildenbrand Signed-off-by: Paolo Bonzini commit 36090bf43a6b835a42f515cb515ff6fa293a25fe Author: Jim Mattson Date: Fri Jul 27 09:18:50 2018 -0700 kvm: nVMX: Fix fault vector for VMX operation at CPL > 0 The fault that should be raised for a privilege level violation is #GP rather than #UD. Fixes: 727ba748e110b4 ("kvm: nVMX: Enforce cpl=0 for VMX instructions") Signed-off-by: Jim Mattson Reviewed-by: David Hildenbrand Signed-off-by: Paolo Bonzini commit b9b33da2aa7429b0f61bcd218d34e1a277459fb4 Author: Paolo Bonzini Date: Fri Jul 27 17:44:41 2018 +0200 KVM: try __get_user_pages_fast even if not in atomic context We are currently cutting hva_to_pfn_fast short if we do not want an immediate exit, which is represented by !async && !atomic. However, this is unnecessary, and __get_user_pages_fast is *much* faster because the regular get_user_pages takes pmd_lock/pte_lock. In fact, when many CPUs take a nested vmexit at the same time the contention on those locks is visible, and this patch removes about 25% (compared to 4.18) from vmexit.flat on a 16 vCPU nested guest. Suggested-by: Andrea Arcangeli Signed-off-by: Paolo Bonzini commit 877ad952be3d51445f6a74dd63708a9327c8f19d Author: Tianyu Lan Date: Thu Jul 19 08:40:23 2018 +0000 KVM: vmx: Add tlb_remote_flush callback support Register tlb_remote_flush callback for vmx when hyperv capability of nested guest mapping flush is detected. The interface can help to reduce overhead when flush ept table among vcpus for nested VM. The tradition way is to send IPIs to all affected vcpus and executes INVEPT on each vcpus. It will trigger several vmexits for IPI and INVEPT emulation. Hyper-V provides such hypercall to do flush for all vcpus and call the hypercall when all ept table pointers of single VM are same. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit b08660e59dbdb600c55953787ed2265a0b510f77 Author: Tianyu Lan Date: Thu Jul 19 08:40:17 2018 +0000 KVM: x86: Add tlb remote flush callback in kvm_x86_ops. This patch is to provide a way for platforms to register hv tlb remote flush callback and this helps to optimize operation of tlb flush among vcpus for nested virtualization case. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit 60cfce4c4f6f6741882032ee6f895e835533a16b Author: Tianyu Lan Date: Thu Jul 19 08:40:12 2018 +0000 X86/Hyper-V: Add hyperv_nested_flush_guest_mapping ftrace support This patch is to add hyperv_nested_flush_guest_mapping support to trace hvFlushGuestPhysicalAddressSpace hypercall. Signed-off-by: Lan Tianyu Acked-by: K. Y. Srinivasan Signed-off-by: Paolo Bonzini commit eb914cfe72f4c948b2318b1381f6d2e08d43b63c Author: Tianyu Lan Date: Thu Jul 19 08:40:06 2018 +0000 X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support Hyper-V supports a pv hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. This patch is to implement it. Signed-off-by: Lan Tianyu Acked-by: K. Y. Srinivasan Signed-off-by: Paolo Bonzini commit 3553ae5690a84a5baae5baa329467b3df2d99f72 Author: Waiman Long Date: Tue Jul 17 17:59:27 2018 -0400 x86/kvm: Don't use pvqspinlock code if only 1 vCPU On a VM with only 1 vCPU, the locking fast path will always be successful. In this case, there is no need to use the the PV qspinlock code which has higher overhead on the unlock side than the native qspinlock code. Signed-off-by: Waiman Long Signed-off-by: Paolo Bonzini commit 450917b654c12075bd2b07d1e375dfed1bc9ca1e Author: Tianyu Lan Date: Wed Jul 18 06:12:04 2018 +0000 KVM/MMU: Simplify __kvm_sync_page() function Merge check of "sp->role.cr4_pae != !!is_pae(vcpu))" and "vcpu-> arch.mmu.sync_page(vcpu, sp) == 0". kvm_mmu_prepare_zap_page() is called under both these conditions. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit 208320ba103e01fd2f3a7b81e97c9c5bc85f0612 Author: Junaid Shahid Date: Wed Jun 27 14:59:21 2018 -0700 kvm: x86: Remove CR3_PCID_INVD flag It is a duplicate of X86_CR3_PCID_NOFLUSH. So just use that instead. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit b94742c958f0b97d304d4aecb4603a20ee9a2df3 Author: Junaid Shahid Date: Wed Jun 27 14:59:20 2018 -0700 kvm: x86: Add multi-entry LRU cache for previous CR3s Adds support for storing multiple previous CR3/root_hpa pairs maintained as an LRU cache, so that the lockless CR3 switch path can be used when switching back to any of them. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit faff87588d8bfd9e56e9203412f0bb80455da7b9 Author: Junaid Shahid Date: Fri Jun 29 13:10:05 2018 -0700 kvm: x86: Flush only affected TLB entries in kvm_mmu_invlpg* This needs a minor bug fix. The updated patch is as follows. Thanks, Junaid ------------------------------------------------------------------------------ kvm_mmu_invlpg() and kvm_mmu_invpcid_gva() only need to flush the TLB entries for the specific guest virtual address, instead of flushing all TLB entries associated with the VM. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 956bf3531fba53c0501eda4fbc67950b0f7b913f Author: Junaid Shahid Date: Wed Jun 27 14:59:18 2018 -0700 kvm: x86: Skip shadow page resync on CR3 switch when indicated by guest When the guest indicates that the TLB doesn't need to be flushed in a CR3 switch, we can also skip resyncing the shadow page tables since an out-of-sync shadow page table is equivalent to an out-of-sync TLB. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 08fb59d8a47d5e1f9de08659603a47f117fe60d5 Author: Junaid Shahid Date: Wed Jun 27 14:59:17 2018 -0700 kvm: x86: Support selectively freeing either current or previous MMU root kvm_mmu_free_roots() now takes a mask specifying which roots to free, so that either one of the roots (active/previous) can be individually freed when needed. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 7eb77e9f5fcf652a21b2d12bff1cd509b6b14f21 Author: Junaid Shahid Date: Wed Jun 27 14:59:16 2018 -0700 kvm: x86: Add a root_hpa parameter to kvm_mmu->invlpg() This allows invlpg() to be called using either the active root_hpa or the prev_root_hpa. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit ade61e2824443a208bb3aaafd8b345ce878298cd Author: Junaid Shahid Date: Wed Jun 27 14:59:15 2018 -0700 kvm: x86: Skip TLB flush on fast CR3 switch when indicated by guest When PCIDs are enabled, the MSb of the source operand for a MOV-to-CR3 instruction indicates that the TLB doesn't need to be flushed. This change enables this optimization for MOV-to-CR3s in the guest that have been intercepted by KVM for shadow paging and are handled within the fast CR3 switch path. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit eb4b248e152d3ecf189b9d32c04961360dbd938a Author: Junaid Shahid Date: Wed Jun 27 14:59:14 2018 -0700 kvm: vmx: Support INVPCID in shadow paging mode Implement support for INVPCID in shadow paging mode as well. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit c9470a2e28479e97eb44d926ea7bbb5709ad9d6b Author: Junaid Shahid Date: Wed Jun 27 14:59:13 2018 -0700 kvm: x86: Propagate guest PCIDs to host PCIDs When using shadow paging mode, propagate the guest's PCID value to the shadow CR3 in the host instead of always using PCID 0. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit afe828d1de4047d26eb0cd0c0154f5ac3722bf63 Author: Junaid Shahid Date: Wed Jun 27 14:59:12 2018 -0700 kvm: x86: Add ability to skip TLB flush when switching CR3 Remove the implicit flush from the set_cr3 handlers, so that the callers are able to decide whether to flush the TLB or not. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 50c28f21d045dde8c52548f8482d456b3f0956f5 Author: Junaid Shahid Date: Wed Jun 27 14:59:11 2018 -0700 kvm: x86: Use fast CR3 switch for nested VMX Use the fast CR3 switch mechanism to locklessly change the MMU root page when switching between L1 and L2. The switch from L2 to L1 should always go through the fast path, while the switch from L1 to L2 should go through the fast path if L1's CR3/EPTP for L2 hasn't changed since the last time. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 1c53da3fa3a333eb15ee5a154700e75d135c21c8 Author: Junaid Shahid Date: Wed Jun 27 14:59:10 2018 -0700 kvm: x86: Support resetting the MMU context without resetting roots This adds support for re-initializing the MMU context in a different mode while preserving the active root_hpa and the prev_root. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 0aab33e4f9459fc80378bc2a089d5784fe8ccd3b Author: Junaid Shahid Date: Wed Jun 27 14:59:09 2018 -0700 kvm: x86: Add support for fast CR3 switch across different MMU modes This generalizes the lockless CR3 switch path to be able to work across different MMU modes (e.g. nested vs non-nested) by checking that the expected page role of the new root page matches the page role of the previously stored root page in addition to checking that the new CR3 matches the previous CR3. Furthermore, instead of loading the hardware CR3 in fast_cr3_switch(), it is now done in vcpu_enter_guest(), as by that time the MMU context would be up-to-date with the VCPU mode. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 6e42782f516f05c8030f63308f2457681b1c9919 Author: Junaid Shahid Date: Wed Jun 27 14:59:08 2018 -0700 kvm: x86: Introduce KVM_REQ_LOAD_CR3 The KVM_REQ_LOAD_CR3 request loads the hardware CR3 using the current root_hpa. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 9fa72119b24db78d665a4034b5a0d349b0289b08 Author: Junaid Shahid Date: Wed Jun 27 14:59:07 2018 -0700 kvm: x86: Introduce kvm_mmu_calc_root_page_role() These functions factor out the base role calculation from the corresponding kvm_init_*_mmu() functions. The new functions return what would be the role assigned to a root page in the current VCPU state. This can be masked with mmu_base_role_mask to derive the base role. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 7c390d350f8b677df3236afef4ced80dba6c3201 Author: Junaid Shahid Date: Wed Jun 27 14:59:06 2018 -0700 kvm: x86: Add fast CR3 switch code path When using shadow paging, a CR3 switch in the guest results in a VM Exit. In the common case, that VM exit doesn't require much processing by KVM. However, it does acquire the MMU lock, which can start showing signs of contention under some workloads even on a 2 VCPU VM when the guest is using KPTI. Therefore, we add a fast path that avoids acquiring the MMU lock in the most common cases e.g. when switching back and forth between the kernel and user mode CR3s used by KPTI with no guest page table changes in between. For now, this fast path is implemented only for 64-bit guests and hosts to avoid the handling of PDPTEs, but it can be extended later to 32-bit guests and/or hosts as well. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 578e1c4db22135d91bad6c79585c4d19252b8d81 Author: Junaid Shahid Date: Wed Jun 27 14:59:05 2018 -0700 kvm: x86: Avoid taking MMU lock in kvm_mmu_sync_roots if no sync is needed kvm_mmu_sync_roots() can locklessly check whether a sync is needed and just bail out if it isn't. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 5ce4786f75d16504223c7a65a42b200c2550fa29 Author: Junaid Shahid Date: Wed Jun 27 14:59:04 2018 -0700 kvm: x86: Make sync_page() flush remote TLBs once only sync_page() calls set_spte() from a loop across a page table. It would work better if set_spte() left the TLB flushing to its callers, so that sync_page() can aggregate into a single call. Signed-off-by: Junaid Shahid Signed-off-by: Paolo Bonzini commit 42522d08cdba6d8be4247e4f0770f39f4708b71f Author: Peter Xu Date: Wed Jul 18 15:57:50 2018 +0800 KVM: MMU: drop vcpu param in gpte_access It's never used. Drop it. Signed-off-by: Peter Xu Signed-off-by: Paolo Bonzini commit abfc52c612ddb101549846688bc87dfedbbfd4f4 Author: Liran Alon Date: Sat Jun 23 02:35:13 2018 +0300 KVM: nVMX: Separate logic allocating shadow vmcs to a function No functionality change. This is done as a preparation for VMCS shadowing virtualization. Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 491a6038458fc07ec307447dd5e6722e34d67c04 Author: Liran Alon Date: Sat Jun 23 02:35:12 2018 +0300 KVM: VMX: Mark vmcs header as shadow in case alloc_vmcs_cpu() allocate shadow vmcs No functionality change. Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 32c7acf044873c8782be45a03e46cf0ac579a459 Author: Liran Alon Date: Sat Jun 23 02:35:11 2018 +0300 KVM: nVMX: Expose VMCS shadowing to L1 guest Expose VMCS shadowing to L1 as a VMX capability of the virtual CPU, whether or not VMCS shadowing is supported by the physical CPU. (VMCS shadowing emulation) Shadowed VMREADs and VMWRITEs from L2 are handled by L0, without a VM-exit to L1. Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit a7cde481b6e8506ee147cf5031ad1917fcc8bf9b Author: Liran Alon Date: Sat Jun 23 02:35:10 2018 +0300 KVM: nVMX: Do not forward VMREAD/VMWRITE VMExits to L1 if required so by vmcs12 vmread/vmwrite bitmaps This is done as a preparation for VMCS shadowing emulation. Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 6d894f498f5d121b57a231315b0b459e185abed1 Author: Liran Alon Date: Sat Jun 23 02:35:09 2018 +0300 KVM: nVMX: vmread/vmwrite: Use shadow vmcs12 if running L2 This is done as a preparation to VMCS shadowing emulation. Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 9a78bdf31da79a2a58585474598afcf44b14b245 Author: Paolo Bonzini Date: Sun Jul 29 00:14:11 2018 +0200 KVM: selftests: add tests for shadow VMCS save/restore This includes setting up the shadow VMCS and the secondary execution controls in lib/vmx.c. Signed-off-by: Paolo Bonzini commit fa58a9fa74979f845fc6c94a58501e67f3abb6de Author: Paolo Bonzini Date: Wed Jul 18 19:45:51 2018 +0200 KVM: nVMX: include shadow vmcs12 in nested state The shadow vmcs12 cannot be flushed on KVM_GET_NESTED_STATE, because at that point guest memory is assumed by userspace to be immutable. Capture the cache in vmx_get_nested_state, adding another page at the end if there is an active shadow vmcs12. Signed-off-by: Paolo Bonzini commit 61ada7488ffdef0c0f83da14a12629870abb9e97 Author: Liran Alon Date: Sat Jun 23 02:35:08 2018 +0300 KVM: nVMX: Cache shadow vmcs12 on VMEntry and flush to memory on VMExit This is done is done as a preparation to VMCS shadowing emulation. Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit f145d90d97bab0e11b78da1739e5db742575037c Author: Liran Alon Date: Sat Jun 23 02:35:07 2018 +0300 KVM: nVMX: Verify VMCS shadowing VMCS link pointer Intel SDM considers these checks to be part of "Checks on Guest Non-Register State". Note that it is legal for vmcs->vmcs_link_pointer to be -1ull when VMCS shadowing is enabled. In this case, any VMREAD/VMWRITE to shadowed-field sets the ALU flags for VMfailInvalid (i.e. CF=1). Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit a8a7c02bf7b70cda6face6321a45de56519c24bf Author: Liran Alon Date: Sat Jun 23 02:35:06 2018 +0300 KVM: nVMX: Verify VMCS shadowing controls Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit f792d2743ed4db9e96eff43bdc1e15dd441f19bf Author: Liran Alon Date: Sat Jun 23 02:35:05 2018 +0300 KVM: nVMX: Introduce nested_cpu_has_shadow_vmcs() Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit a6192d40d52f6b86997a71449e2ebc3d7f5ca103 Author: Liran Alon Date: Sat Jun 23 02:35:04 2018 +0300 KVM: nVMX: Fail VMLAUNCH and VMRESUME on shadow VMCS Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit fa97d7dba7538adf174c3984e726c0537ab553a4 Author: Liran Alon Date: Wed Jul 18 14:07:59 2018 +0200 KVM: nVMX: Allow VMPTRLD for shadow VMCS if vCPU supports VMCS shadowing Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit e253674227328575084cf7454d22749b9be11d52 Author: Liran Alon Date: Sat Jun 23 02:35:02 2018 +0300 KVM: VMX: Change vmcs12_{read,write}_any() to receive vmcs12 as parameter No functionality change. This is done as a preparation for VMCS shadowing emulation. Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit 392b2f25aa415c0222b348f95875409be49a1201 Author: Liran Alon Date: Sat Jun 23 02:35:01 2018 +0300 KVM: VMX: Create struct for VMCS header No functionality change. Signed-off-by: Liran Alon Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini commit cb5476379f0718046f3c6b3195d18838c5b25ea2 Author: Paolo Bonzini Date: Sat Jul 28 21:56:09 2018 +0200 kvm: selftests: add test for nested state save/restore Signed-off-by: Paolo Bonzini commit 8fcc4b5923af5de58b80b53a069453b135693304 Author: Jim Mattson Date: Tue Jul 10 11:27:20 2018 +0200 kvm: nVMX: Introduce KVM_CAP_NESTED_STATE For nested virtualization L0 KVM is managing a bit of state for L2 guests, this state can not be captured through the currently available IOCTLs. In fact the state captured through all of these IOCTLs is usually a mix of L1 and L2 state. It is also dependent on whether the L2 guest was running at the moment when the process was interrupted to save its state. With this capability, there are two new vcpu ioctls: KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE. These can be used for saving and restoring a VM that is in VMX operation. Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Thomas Gleixner Cc: Ingo Molnar Cc: H. Peter Anvin Cc: x86@kernel.org Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jim Mattson [karahmed@ - rename structs and functions and make them ready for AMD and address previous comments. - handle nested.smm state. - rebase & a bit of refactoring. - Merge 7/8 and 8/8 into one patch. ] Signed-off-by: KarimAllah Ahmed Signed-off-by: Paolo Bonzini commit 7f7f1ba33cf2c21d001821313088c231db42ff40 Author: Paolo Bonzini Date: Wed Jul 18 18:49:01 2018 +0200 KVM: x86: do not load vmcs12 pages while still in SMM If the vCPU enters system management mode while running a nested guest, RSM starts processing the vmentry while still in SMM. In that case, however, the pages pointed to by the vmcs12 might be incorrectly loaded from SMRAM. To avoid this, delay the handling of the pages until just before the next vmentry. This is done with a new request and a new entry in kvm_x86_ops, which we will be able to reuse for nested VMX state migration. Extracted from a patch by Jim Mattson and KarimAllah Ahmed. Signed-off-by: Paolo Bonzini commit fa3899add1056f209c5b61d0c60cec34775a6781 Author: Paolo Bonzini Date: Thu Jul 26 13:19:23 2018 +0200 kvm: selftests: add basic test for state save and restore The test calls KVM_RUN repeatedly, and creates an entirely new VM with the old memory and vCPU state on every exit to userspace. The kvm_util API is expanded with two functions that manage the lifetime of a kvm_vm struct: the first closes the file descriptors and leaves the memory allocated, and the second opens the file descriptors and reuses the memory from the previous incarnation of the kvm_vm struct. For now the test is very basic, as it does not test for example XSAVE or vCPU events. However, it will test nested virtualization state starting with the next patch. Signed-off-by: Paolo Bonzini commit 0a505fe6f272c5c1ceebbd266535ad79d9ca6920 Author: Paolo Bonzini Date: Thu Jul 26 13:02:24 2018 +0200 kvm: selftests: ensure vcpu file is released The selftests were not munmap-ing the kvm_run area from the vcpu file descriptor. The result was that kvm_vcpu_release was not called and a reference was left in the parent "struct kvm". Ultimately this was visible in the upcoming state save/restore test as an error when KVM attempted to create a duplicate debugfs entry. Signed-off-by: Paolo Bonzini commit 87ccb7dbb25b28c0003fe4be88ed02289b651f96 Author: Paolo Bonzini Date: Sat Jul 28 18:45:38 2018 +0200 kvm: selftests: actually use all of lib/vmx.c The allocation of the VMXON and VMCS is currently done twice, in lib/vmx.c and in vmx_tsc_adjust_test.c. Reorganize the code to provide a cleaner and easier to use API to the tests. lib/vmx.c now does the complete setup of the VMX data structures, but does not create the VM or set CPUID. This has to be done by the caller. Signed-off-by: Paolo Bonzini commit 2305339ee7129d9d56af3bdd4d59aff4d29ed390 Author: Paolo Bonzini Date: Sat Jul 28 18:09:44 2018 +0200 kvm: selftests: create a GDT and TSS The GDT and the TSS base were left to zero, and this has interesting effects when the TSS descriptor is later read to set up a VMCS's TR_BASE. Basically it worked by chance, and this patch fixes it by setting up all the protected mode data structures properly. Because the GDT and TSS addresses are virtual, the page tables now always exist at the time of vcpu setup. Signed-off-by: Paolo Bonzini commit 44883f01fe6ae436a8604c47d8435276fef369b0 Author: Paolo Bonzini Date: Thu Jul 26 13:01:52 2018 +0200 KVM: x86: ensure all MSRs can always be KVM_GET/SET_MSR'd Some of the MSRs returned by GET_MSR_INDEX_LIST currently cannot be sent back to KVM_GET_MSR and/or KVM_SET_MSR; either they can never be sent back, or you they are only accepted under special conditions. This makes the API a pain to use. To avoid this pain, this patch makes it so that the result of the get-list ioctl can always be used for host-initiated get and set. Since we don't have a separate way to check for read-only MSRs, this means some Hyper-V MSRs are ignored when written. Arguably they should not even be in the result of GET_MSR_INDEX_LIST, but I am leaving there in case userspace is using the outcome of GET_MSR_INDEX_LIST to derive the support for the corresponding Hyper-V feature. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit cf81a7e580ac0d598d3e7e9c06864168b2b4073d Author: Sean Christopherson Date: Wed Jul 11 09:54:30 2018 -0700 KVM: vmx: remove save/restore of host BNDCGFS MSR Linux does not support Memory Protection Extensions (MPX) in the kernel itself, thus the BNDCFGS (Bound Config Supervisor) MSR will always be zero in the KVM host, i.e. RDMSR in vmx_save_host_state() is superfluous. KVM unconditionally sets VM_EXIT_CLEAR_BNDCFGS, i.e. BNDCFGS will always be zero after VMEXIT, thus manually loading BNDCFGS is also superfluous. And in the event the MPX kernel support is added (unlikely given that MPX for userspace is in its death throes[1]), BNDCFGS will likely be common across all CPUs[2], and at the least shouldn't change on a regular basis, i.e. saving the MSR on every VMENTRY is completely unnecessary. WARN_ONCE in hardware_setup() if the host's BNDCFGS is non-zero to document that KVM does not preserve BNDCFGS and to serve as a hint as to how BNDCFGS likely should be handled if MPX is used in the kernel, e.g. BNDCFGS should be saved once during KVM setup. [1] https://lkml.org/lkml/2018/4/27/1046 [2] http://www.openwall.com/lists/kernel-hardening/2017/07/24/28 Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 86dafed50e2b9b18198cc663775ece819ff113ba Author: KarimAllah Ahmed Date: Tue Jul 10 11:27:19 2018 +0200 KVM: Switch 'requests' to be 64-bit (explicitly) Switch 'requests' to be explicitly 64-bit and update BUILD_BUG_ON check to use the size of "requests" instead of the hard-coded '32'. That gives us a bit more room again for arch-specific requests as we already ran out of space for x86 due to the hard-coded check. The only exception here is ARM32 as it is still 32-bits. Cc: Paolo Bonzini Cc: Radim KrÄmář Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Jim Mattson Signed-off-by: KarimAllah Ahmed Signed-off-by: Paolo Bonzini commit ca359066889f753ca6d54bb333b783e7a784c0d1 Author: Wei Huang Date: Mon Jun 25 23:41:57 2018 -0400 kvm: selftests: add cr4_cpuid_sync_test KVM is supposed to update some guest VM's CPUID bits (e.g. OSXSAVE) when CR4 is changed. A bug was found in KVM recently and it was fixed by Commit c4d2188206ba ("KVM: x86: Update cpuid properly when CR4.OSXAVE or CR4.PKE is changed"). This patch adds a test to verify the synchronization between guest VM's CR4 and CPUID bits. Signed-off-by: Wei Huang Signed-off-by: Paolo Bonzini commit d2ce98ca0a192e1bcb89068adfe6cb736f5e351c Merge: 85eae57bbb06 d72e90f33aa4 Author: Paolo Bonzini Date: Mon Aug 6 17:31:36 2018 +0200 Merge tag 'v4.18-rc6' into HEAD Pull bug fixes into the KVM development tree to avoid nasty conflicts. commit 12aea518a202bc7c947553840f1d93f8129b41b2 Author: Johannes Thumshirn Date: Fri Aug 3 18:35:17 2018 +0200 watchdog: fix dependencies of menz69_wdt.o Currently menz69_wdt.ko has a dependency on MCB or COMPILE_TEST. But it actually needs symbols exported by MCB so the || COMPILE_TEST is wrong. Signed-off-by: Johannes Thumshirn Reported-by: Randy Dunlap Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit dc0e4a3bb7dcd087e9d338acbe6ef3f3667b278b Author: Srinath Mannam Date: Thu Jul 26 10:28:42 2018 +0530 watchdog: sp805: Add clock-frequency property Use clock-frequency property given in _DSD object of ACPI device to calculate Watchdog rate as binding clock devices are not available as device tree. Note: There is no formal review process for _DSD properties Signed-off-by: Srinath Mannam Reviewed-by: Guenter Roeck Reviewed-by: Ray Jui Reviewed-by: Scott Branden Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit bf06bad958c4536ee5ac3461a18976ea3e896f26 Author: Gustavo A. R. Silva Date: Sat Aug 4 19:50:14 2018 -0500 xen/biomerge: Use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit f87c30c96cd9b5baa28bc63900f16e04e8c7cbb2 Author: Gustavo A. R. Silva Date: Mon Aug 6 08:14:55 2018 -0600 xen-blkfront: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Acked-by: Roger Pau Monné Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jens Axboe commit ad3e0b2f3c9483fa79bb4148464dba52ce33ae46 Author: YueHaibing Date: Mon Aug 6 19:08:51 2018 +0800 Bluetooth: remove redundant variables 'adv_set' and 'cp' Variables 'adv_set' and 'cp' are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: net/bluetooth/hci_event.c:1135:29: warning: variable 'adv_set' set but not used [-Wunused-but-set-variable] net/bluetooth/mgmt.c:3359:39: warning: variable 'cp' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Signed-off-by: Johan Hedberg commit 5b147465532365dc4e2fee8499d6ca1f52dd0d16 Author: Lucas Stach Date: Mon Jul 23 14:27:23 2018 +0200 drm/etnaviv: fix crash in GPU suspend when init failed due to buffer placement When the suballocator was unable to provide a suitable buffer for the MMUv1 linear window, we roll back the GPU initialization. As the GPU is runtime resumed at that point we need to clear the kernel cmdbuf suballoc entry to properly skip any attempt to manipulate the cmdbuf when the GPU gets shut down in the runtime suspend later on. Signed-off-by: Lucas Stach commit cfad05a24dcb2bf09ba6438e0843c6a0ed90381c Author: Souptick Joarder Date: Tue May 29 19:17:27 2018 +0530 drm/etnaviv: change return type to vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref- commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_page() returns err which driver mapped into VM_FAULT_* type. The new function vmf_insert_page() will replace this inefficiency by returning VM_FAULT_* type. vmf_error() is the newly introduce inline function in 4.17-rc6. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Lucas Stach commit a0780bb1df60f00e4573db7bd53e7039e9eee1cb Author: Lucas Stach Date: Fri May 25 16:51:25 2018 +0200 drm/etnaviv: protect sched job submission with fence mutex The documentation of drm_sched_job_init and drm_sched_entity_push_job has been clarified. Both functions should be called under a shared lock, to avoid jobs getting pushed into the scheduler queue in a different order than their sched_fence seqnos, which will confuse checks that are looking at the seqnos to infer information about completion order. Signed-off-by: Lucas Stach commit 6ae9c84ff249f2756086e71405375fd06124cf1f Author: Philipp Zabel Date: Tue May 15 16:09:15 2018 +0200 drm/etnaviv: mmuv2: use memset32 to init scratch page Replace the open-coded scratch page initialization loop with memset32 Signed-off-by: Philipp Zabel Signed-off-by: Lucas Stach commit ad0eaee6195db1db1749dd46b9e6f4466793d178 Author: Gustavo A. R. Silva Date: Mon Aug 6 07:14:51 2018 -0500 ASoC: wm8994: Fix missing break in switch Add missing break statement in order to prevent the code from falling through to the default case. Addresses-Coverity-ID: 115050 ("Missing break in switch") Reported-by: Valdis Kletnieks Signed-off-by: Gustavo A. R. Silva Acked-by: Charles Keepax Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 0961503412e3e13d82f885f9fb3af527edd58e47 Author: Srinivas Kandagatla Date: Mon Aug 6 11:12:09 2018 +0100 ASoC: qdsp6: q6afe-dai: add SLIM tx AIF_IN dapm Add missing AIF_IN dapm for slim tx ports. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit d72117d0c89a3f5657ef91d5eef31337964e3cb2 Author: Srinivas Kandagatla Date: Mon Aug 6 11:12:08 2018 +0100 ASoC: qcom: remove unused header files from common.h This patch removes unused header files from common.h. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 846b2c96808cc7cdf4e0619d00604b3edd15b35a Author: Srinivas Kandagatla Date: Mon Aug 6 11:12:07 2018 +0100 ASoC: sdm845: remove unused header files This patch removes unused header files from the driver. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit e9d244b14dd5cf9a78ab256a4463d946e580ca63 Author: Srinivas Kandagatla Date: Mon Aug 6 11:12:06 2018 +0100 ASoC: apq8096: remove unused header files This patch removes unused header files from the driver. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 8e3684f66e15c354dba5544c2af8ce973ed40cf6 Author: Srinivas Kandagatla Date: Mon Aug 6 11:12:05 2018 +0100 ASoC: qcom: make common.c as proper module This patch converts common helper functions in to proper module and also fixes below warning. WARNING: sound/soc/qcom/snd-soc-sdm845: 'qcom_snd_parse_of' exported twice. Previous export was in sound/soc/qcom/snd-soc-apq8096.ko Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit d7a4303b8d1fa6f60b73ed91317a51764a2a412c Author: Viresh Kumar Date: Thu Jul 5 10:39:23 2018 +0530 dt-bindings: thermal: Allow multiple devices to share cooling map Allow cooling devices sharing same trip point with same contribution value to share the cooling map as well. Otherwise the same information will be duplicated for each device sharing the trip point. Signed-off-by: Viresh Kumar Reviewed-by: Rob Herring Signed-off-by: Zhang Rui commit bee7d3c9f89a1bbe3d5f88ac9d6946de4705731b Author: Gustavo A. R. Silva Date: Sat Aug 4 16:56:02 2018 -0500 ASoC: wm8903: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Acked-by: Charles Keepax Signed-off-by: Mark Brown commit e1ec62b147c2f2deae66e69ee4f7347dc80123ae Author: Gustavo A. R. Silva Date: Sat Aug 4 16:55:28 2018 -0500 ASoC: da9055: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 380ae4ec420304aa59adb36776eaf78aef37192c Author: Gustavo A. R. Silva Date: Sat Aug 4 16:54:54 2018 -0500 ASoC: wm5100-tables: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Acked-by: Charles Keepax Signed-off-by: Mark Brown commit 1752a35acd8e837463fb7b7d9492b18e2a2ed5e3 Author: Gustavo A. R. Silva Date: Sat Aug 4 16:54:10 2018 -0500 ASoC: da7213: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit bc94c8884e5a94914ec950dfc615563a1253e3f3 Author: Gustavo A. R. Silva Date: Sat Aug 4 16:53:38 2018 -0500 ASoC: twl6040: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 965afd3c1dbaf293bfa9452aaf0a7e53d78d07f3 Author: Gustavo A. R. Silva Date: Sat Aug 4 16:53:10 2018 -0500 ASoC: da7219: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit eb086306bc6b42dc2c538ec2350d44a82d1a835b Author: Gustavo A. R. Silva Date: Sat Aug 4 16:52:35 2018 -0500 ASoC: wm8996: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Acked-by: Charles Keepax Signed-off-by: Mark Brown commit c34c4515286f27e7e99d8a0011b4322d1de6c9bc Author: Gustavo A. R. Silva Date: Sat Aug 4 16:52:01 2018 -0500 ASoC: cs4270: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 064ee5a370150534e12e5bac4ff81f86528e27ca Author: Gustavo A. R. Silva Date: Sat Aug 4 16:51:01 2018 -0500 ASoC: wm8990: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Acked-by: Charles Keepax Signed-off-by: Mark Brown commit 10754bfc051256ab922b818de3ddd11391862a5f Author: Gustavo A. R. Silva Date: Sat Aug 4 16:50:27 2018 -0500 ASoC: tda7419: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 508e8641f89cc89554adbec3ce59bcd28a4ced4b Author: Gustavo A. R. Silva Date: Sat Aug 4 16:49:55 2018 -0500 ASoC: rt5631: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 038541dae968dbef99edca4b22bbb2a7b4afdc83 Author: Gustavo A. R. Silva Date: Sat Aug 4 16:49:02 2018 -0500 ASoC: max9850: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 39379faaad79e3cf403a6904a08676b7850043ae Author: Naohiro Aota Date: Fri Jul 27 09:04:55 2018 +0900 btrfs: revert fs_devices state on error of btrfs_init_new_device When btrfs hits error after modifying fs_devices in btrfs_init_new_device() (such as btrfs_add_dev_item() returns error), it leaves everything as is, but frees allocated btrfs_device. As a result, fs_devices->devices and fs_devices->alloc_list contain already freed btrfs_device, leading to later use-after-free bug. Error path also messes the things like ->num_devices. While they go back to the original value by unscanning btrfs devices, it is safe to revert them here. Fixes: 79787eaab461 ("btrfs: replace many BUG_ONs with proper error handling") Signed-off-by: Naohiro Aota Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit 64f64f43c89aca1782aa672e0586f6903c5d8979 Author: Qu Wenruo Date: Wed Aug 1 10:37:20 2018 +0800 btrfs: Exit gracefully when chunk map cannot be inserted to the tree It's entirely possible that a crafted btrfs image contains overlapping chunks. Although we can't detect such problem by tree-checker, it's not a catastrophic problem, current extent map can already detect such problem and return -EEXIST. We just only need to exit gracefully and fail the mount. Reported-by: Xu Wen Link: https://bugzilla.kernel.org/show_bug.cgi?id=200409 Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit cf90d884b347c50a1e8c1effc4093e497dd68b4b Author: Qu Wenruo Date: Wed Aug 1 10:37:19 2018 +0800 btrfs: Introduce mount time chunk <-> dev extent mapping check This patch will introduce chunk <-> dev extent mapping check, to protect us against invalid dev extents or chunks. Since chunk mapping is the fundamental infrastructure of btrfs, extra check at mount time could prevent a lot of unexpected behavior (BUG_ON). Reported-by: Xu Wen Link: https://bugzilla.kernel.org/show_bug.cgi?id=200403 Link: https://bugzilla.kernel.org/show_bug.cgi?id=200407 Signed-off-by: Qu Wenruo Reviewed-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7ef49515fa6727cb4b6f2f5b0ffbc5fc20a9f8c6 Author: Qu Wenruo Date: Wed Aug 1 10:37:17 2018 +0800 btrfs: Verify that every chunk has corresponding block group at mount time If a crafted image has missing block group items, it could cause unexpected behavior and breaks the assumption of 1:1 chunk<->block group mapping. Although we have the block group -> chunk mapping check, we still need chunk -> block group mapping check. This patch will do extra check to ensure each chunk has its corresponding block group. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199847 Reported-by: Xu Wen Signed-off-by: Qu Wenruo Reviewed-by: Gu Jinxiang Reviewed-by: David Sterba Signed-off-by: David Sterba commit 514c7dca85a0bf40be984dab0b477403a6db901f Author: Qu Wenruo Date: Wed Aug 1 10:37:16 2018 +0800 btrfs: Check that each block group has corresponding chunk at mount time A crafted btrfs image with incorrect chunk<->block group mapping will trigger a lot of unexpected things as the mapping is essential. Although the problem can be caught by block group item checker added in "btrfs: tree-checker: Verify block_group_item", it's still not sufficient. A sufficiently valid block group item can pass the check added by the mentioned patch but could fail to match the existing chunk. This patch will add extra block group -> chunk mapping check, to ensure we have a completely matching (start, len, flags) chunk for each block group at mount time. Here we reuse the original helper find_first_block_group(), which is already doing the basic bg -> chunk checks, adding further checks of the start/len and type flags. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199837 Reported-by: Xu Wen Signed-off-by: Qu Wenruo Reviewed-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit 22d3151c2c4cb517a309154d1e828a28106508c7 Author: Filipe Manana Date: Mon Jul 30 12:39:58 2018 +0100 Btrfs: send, fix incorrect file layout after hole punching beyond eof When doing an incremental send, if we have a file in the parent snapshot that has prealloc extents beyond EOF and in the send snapshot it got a hole punch that partially covers the prealloc extents, the send stream, when replayed by a receiver, can result in a file that has a size bigger than it should and filled with zeroes past the correct EOF. For example: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ xfs_io -f -c "falloc -k 0 4M" /mnt/foobar $ xfs_io -c "pwrite -S 0xea 0 1M" /mnt/foobar $ btrfs subvolume snapshot -r /mnt /mnt/snap1 $ btrfs send -f /tmp/1.send /mnt/snap1 $ xfs_io -c "fpunch 1M 2M" /mnt/foobar $ btrfs subvolume snapshot -r /mnt /mnt/snap2 $ btrfs send -f /tmp/2.send -p /mnt/snap1 /mnt/snap2 $ stat --format %s /mnt/snap2/foobar 1048576 $ md5sum /mnt/snap2/foobar d31659e82e87798acd4669a1e0a19d4f /mnt/snap2/foobar $ umount /mnt $ mkfs.btrfs -f /dev/sdc $ mount /dev/sdc /mnt $ btrfs receive -f /mnt/1.snap /mnt $ btrfs receive -f /mnt/2.snap /mnt $ stat --format %s /mnt/snap2/foobar 3145728 # --> should be 1Mb and not 3Mb (which was the end offset of hole # punch operation) $ md5sum /mnt/snap2/foobar 117baf295297c2a995f92da725b0b651 /mnt/snap2/foobar # --> should be d31659e82e87798acd4669a1e0a19d4f as in the original fs This issue actually happens only since commit ffa7c4296e93 ("Btrfs: send, do not issue unnecessary truncate operations"), but before that commit we were issuing a write operation full of zeroes (to "punch" a hole) which was extending the file size beyond the correct value and then immediately issue a truncate operation to the correct size and undoing the previous write operation. Since the send protocol does not support fallocate, for extent preallocation and hole punching, fix this by not even attempting to send a "hole" (regular write full of zeroes) if it starts at an offset greater then or equals to the file's size. This approach, besides being much more simple then making send issue the truncate operation, adds the benefit of avoiding the useless pair of write of zeroes and truncate operations, saving time and IO at the receiver and reducing the size of the send stream. A test case for fstests follows soon. Fixes: ffa7c4296e93 ("Btrfs: send, do not issue unnecessary truncate operations") CC: stable@vger.kernel.org # 4.17+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 672d599041c862dd61a1576c32e946ef0d77aa34 Author: Misono Tomohiro Date: Thu Aug 2 16:19:07 2018 +0900 btrfs: Use wrapper macro for rcu string to remove duplicate code Cleanup patch and no functional changes. Signed-off-by: Misono Tomohiro Reviewed-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit f5b3a4173ff624b766c56936bb315e1517603891 Author: Al Viro Date: Sun Jul 29 23:04:51 2018 +0100 btrfs: simplify btrfs_iget Don't open-code iget_failed(), don't bother with btrfs_free_path(NULL), move handling of positive return values of btrfs_lookup_inode() from btrfs_read_locked_inode() to btrfs_iget() and kill now obviously pointless ASSERT() in there. Signed-off-by: Al Viro Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9bc2ceff660580454f971ed3f891a2c82085433a Author: Al Viro Date: Sun Jul 29 23:04:50 2018 +0100 btrfs: lift make_bad_inode into btrfs_iget We don't need to check is_bad_inode() after the call of btrfs_read_locked_inode() - it's exactly the same as checking return value for being non-zero. Signed-off-by: Al Viro Reviewed-by: David Sterba Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 8d9e220ca0844bf75b98cb5b8e2c25d203c0d0f6 Author: Al Viro Date: Sun Jul 29 23:04:46 2018 +0100 btrfs: simplify IS_ERR/PTR_ERR checks IS_ERR(p) && PTR_ERR(p) == n is a weird way to spell p == ERR_PTR(n). Signed-off-by: Al Viro Reviewed-by: David Sterba Reviewed-by: Nikolay Borisov [ update changelog ] Signed-off-by: David Sterba commit 2e19f1f9d31b3515356710b8bdfb655f47a98448 Author: Al Viro Date: Sun Jul 29 23:04:45 2018 +0100 btrfs: btrfs_iget never returns an is_bad_inode inode Just get rid of pointless checks. Signed-off-by: Al Viro Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1e7e1f9e3aba00c9b9c323bfeeddafe69ff21ff6 Author: Misono Tomohiro Date: Tue Jul 31 16:20:21 2018 +0900 btrfs: replace: Reset on-disk dev stats value after replace on-disk devs stats value is updated in btrfs_run_dev_stats(), which is called during commit transaction, if device->dev_stats_ccnt is not zero. Since current replace operation does not touch dev_stats_ccnt, on-disk dev stats value is not updated. Therefore "btrfs device stats" may return old device's value after umount/mount (Example: See "btrfs ins dump-t -t DEV $DEV" after btrfs/100 finish). Fix this by just incrementing dev_stats_ccnt in btrfs_dev_replace_finishing() when replace is succeeded and this will update the values. Signed-off-by: Misono Tomohiro Reviewed-by: David Sterba Signed-off-by: David Sterba commit 85c39548199b966062578fb99d4d4ecdeae2afae Author: Misono Tomohiro Date: Thu Jul 26 11:40:54 2018 +0900 btrfs: extent-tree: Remove unused __btrfs_free_block_rsv There is no user of this function anymore. This was forgotten to be removed in commit a575ceeb1338 ("Btrfs: get rid of unused orphan infrastructure"). Signed-off-by: Misono Tomohiro Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit afc6961ffd96ee7e2a86e70e9691a008eadf2926 Author: Misono Tomohiro Date: Thu Jul 26 10:22:58 2018 +0900 btrfs: backref: Use ERR_CAST to return error code Use ERR_CAST() instead of void * to make meaning clear. Signed-off-by: Misono Tomohiro Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5b7d687ad5913a56b6a8788435d7a53990b4176d Author: Lu Fengqi Date: Wed Aug 1 11:32:31 2018 +0800 btrfs: Remove redundant btrfs_release_path from btrfs_unlink_subvol Although it is safe to call this on already released paths with no locks held or extent buffers, removing the redundant btrfs_release_path is reasonable. Signed-off-by: Lu Fengqi Reviewed-by: David Sterba Signed-off-by: David Sterba commit 401b3b19d592391b718b7a17295ae34eace973dd Author: Lu Fengqi Date: Wed Aug 1 11:32:30 2018 +0800 btrfs: Remove root parameter from btrfs_unlink_subvol All callers pass the root tree of dir, we can push that down to the function itself. Signed-off-by: Lu Fengqi Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6025c19fb208e93b99eafc304e7f16160e49fc88 Author: Lu Fengqi Date: Wed Aug 1 11:32:29 2018 +0800 btrfs: Remove fs_info from btrfs_add_root_ref It can be referenced from the passed transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 3ee1c5530e649182e602eb2f81193289c4d2e655 Author: Lu Fengqi Date: Wed Aug 1 11:32:28 2018 +0800 btrfs: Remove fs_info from btrfs_del_root_ref It can be referenced from the passed transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit ab9ce7d42bf66f0750a4ca4a228a2db238376afb Author: Lu Fengqi Date: Wed Aug 1 11:32:27 2018 +0800 btrfs: Remove fs_info from btrfs_del_root It can be referenced from the passed transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 9add29457ac124e846cde4b875c632edaa722c08 Author: Lu Fengqi Date: Wed Aug 1 11:32:26 2018 +0800 btrfs: Remove fs_info from btrfs_delete_delayed_dir_index It can be referenced from the passed transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 4465c8b4229de50f17b6780677ce068b3582a55d Author: Lu Fengqi Date: Wed Aug 1 11:32:25 2018 +0800 btrfs: Remove fs_info from btrfs_insert_delayed_dir_index It can be referenced from the passed transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit b5851021f1ea0e099543fa125744368de7e9b865 Author: David Sterba Date: Tue Jul 24 17:19:48 2018 +0200 btrfs: extent-tree: remove unused member walk_control::for_reloc Leftover after fix e339a6b097c5 ("Btrfs: __btrfs_mod_ref should always use no_quota"), that removed it from the function calls but not the structure. Signed-off-by: David Sterba commit 46b2f4590aab71d31088a265c86026b1e96c9de4 Author: Filipe Manana Date: Tue Jul 24 11:54:04 2018 +0100 Btrfs: fix send failure when root has deleted files still open The more common use case of send involves creating a RO snapshot and then use it for a send operation. In this case it's not possible to have inodes in the snapshot that have a link count of zero (inode with an orphan item) since during snapshot creation we do the orphan cleanup. However, other less common use cases for send can end up seeing inodes with a link count of zero and in this case the send operation fails with a ENOENT error because any attempt to generate a path for the inode, with the purpose of creating it or updating it at the receiver, fails since there are no inode reference items. One use case it to use a regular subvolume for a send operation after turning it to RO mode or turning a RW snapshot into RO mode and then using it for a send operation. In both cases, if a file gets all its hard links deleted while there is an open file descriptor before turning the subvolume/snapshot into RO mode, the send operation will encounter an inode with a link count of zero and then fail with errno ENOENT. Example using a full send with a subvolume: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ btrfs subvolume create /mnt/sv1 $ touch /mnt/sv1/foo $ touch /mnt/sv1/bar # keep an open file descriptor on file bar $ exec 73> /mnt/sv1/bar $ btrfs subvolume snapshot -r /mnt/sv1 /mnt/snap2 # Turn the second snapshot to RW mode and delete file foo while # holding an open file descriptor on it. $ btrfs property set /mnt/snap2 ro false $ exec 73 Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0d836392cadd5535f4184d46d901a82eb276ed62 Author: Filipe Manana Date: Fri Jul 20 10:59:06 2018 +0100 Btrfs: fix mount failure after fsync due to hard link recreation If we end up with logging an inode reference item which has the same name but different index from the one we have persisted, we end up failing when replaying the log with an errno value of -EEXIST. The error comes from btrfs_add_link(), which is called from add_inode_ref(), when we are replaying an inode reference item. Example scenario where this happens: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ touch /mnt/foo $ ln /mnt/foo /mnt/bar $ sync # Rename the first hard link (foo) to a new name and rename the second # hard link (bar) to the old name of the first hard link (foo). $ mv /mnt/foo /mnt/qwerty $ mv /mnt/bar /mnt/foo # Create a new file, in the same parent directory, with the old name of # the second hard link (bar) and fsync this new file. # We do this instead of calling fsync on foo/qwerty because if we did # that the fsync resulted in a full transaction commit, not triggering # the problem. $ touch /mnt/bar $ xfs_io -c "fsync" /mnt/bar $ mount /dev/sdb /mnt mount: mount /dev/sdb on /mnt failed: File exists So fix this by checking if a conflicting inode reference exists (same name, same parent but different index), removing it (and the associated dir index entries from the parent inode) if it exists, before attempting to add the new reference. A test case for fstests follows soon. CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 4559b0a71749c442d34f7cfb9e72c9e58db83948 Author: Josef Bacik Date: Thu Jul 19 10:49:51 2018 -0400 btrfs: don't leak ret from do_chunk_alloc If we're trying to make a data reservation and we have to allocate a data chunk we could leak ret == 1, as do_chunk_alloc() will return 1 if it allocated a chunk. Since the end of the function is the success path just return 0. CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Josef Bacik Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 84db5ccf4262894852e0d178d250678945d9b0b8 Author: David Sterba Date: Fri Jul 20 16:30:25 2018 +0200 btrfs: merge free_fs_root helpers The exported helper just calls the static one. There's no obvious reason to have them separate eg. for performance reasons where the static one could be better optimized in the same unit. There's a slight decrease in code size and stack consumption. Signed-off-by: David Sterba commit 2ffad70ed3b6fbc946bc102f9d11c0e7c1cd380f Author: David Sterba Date: Fri Jul 20 16:30:23 2018 +0200 btrfs: constify strings passed to assertion helper Signed-off-by: David Sterba commit e9539cff04728e31e150b41000b828745fc0c2b3 Author: David Sterba Date: Fri Jul 20 16:30:20 2018 +0200 btrfs: dev-replace: remove unused members of btrfs_dev_replace Lock owner and nesting level have been unused since day 1, probably copy&pasted from the extent_buffer locking scheme without much thinking. The locking of device replace is simpler and does not need any lock nesting. Signed-off-by: David Sterba commit e17385ca2960177da402d6f4d80bdc5b53c29bc4 Author: David Sterba Date: Fri Jul 20 16:30:18 2018 +0200 btrfs: remove unused member btrfs_root::name Added in 58176a9604c ("Btrfs: Add per-root block accounting and sysfs entries") in 2007, the roots had names exported in sysfs. The code was commented out in 4df27c4d5cc1dda54ed ("Btrfs: change how subvolumes are organized") and cleaned by 182608c8294b5fe9 ("btrfs: remove old unused commented out code"). Signed-off-by: David Sterba commit 616d374efa23cb699074ea02b301254ad64d224a Author: Adam Borowski Date: Wed Jul 18 00:08:59 2018 +0200 btrfs: allow defrag on a file opened read-only that has rw permissions Requiring a read-write descriptor conflicts both ways with exec, returning ETXTBSY whenever you try to defrag a program that's currently being run, or causing intermittent exec failures on a live system being defragged. As defrag doesn't change the file's contents in any way, there's no reason to consider it a rw operation. Thus, let's check only whether the file could have been opened rw. Such access control is still needed as currently defrag can use extra disk space, and might trigger bugs. We return EINVAL when the request is invalid; here it's ok but merely the user has insufficient privileges. Thus, the EPERM return value reflects the error better -- as discussed in the identical case for dedupe. According to codesearch.debian.net, no userspace program distinguishes these values beyond strerror(). Signed-off-by: Adam Borowski Reviewed-by: David Sterba [ fold the EPERM patch from Adam ] Signed-off-by: David Sterba commit 3c4276936f6fbe52884b4ea4e6cc120b890a0f9f Author: Josef Bacik Date: Fri Jul 20 11:46:10 2018 -0700 Btrfs: fix btrfs_write_inode vs delayed iput deadlock We recently ran into the following deadlock involving btrfs_write_inode(): [ +0.005066] __schedule+0x38e/0x8c0 [ +0.007144] schedule+0x36/0x80 [ +0.006447] bit_wait+0x11/0x60 [ +0.006446] __wait_on_bit+0xbe/0x110 [ +0.007487] ? bit_wait_io+0x60/0x60 [ +0.007319] __inode_wait_for_writeback+0x96/0xc0 [ +0.009568] ? autoremove_wake_function+0x40/0x40 [ +0.009565] inode_wait_for_writeback+0x21/0x30 [ +0.009224] evict+0xb0/0x190 [ +0.006099] iput+0x1a8/0x210 [ +0.006103] btrfs_run_delayed_iputs+0x73/0xc0 [ +0.009047] btrfs_commit_transaction+0x799/0x8c0 [ +0.009567] btrfs_write_inode+0x81/0xb0 [ +0.008008] __writeback_single_inode+0x267/0x320 [ +0.009569] writeback_sb_inodes+0x25b/0x4e0 [ +0.008702] wb_writeback+0x102/0x2d0 [ +0.007487] wb_workfn+0xa4/0x310 [ +0.006794] ? wb_workfn+0xa4/0x310 [ +0.007143] process_one_work+0x150/0x410 [ +0.008179] worker_thread+0x6d/0x520 [ +0.007490] kthread+0x12c/0x160 [ +0.006620] ? put_pwq_unlocked+0x80/0x80 [ +0.008185] ? kthread_park+0xa0/0xa0 [ +0.007484] ? do_syscall_64+0x53/0x150 [ +0.007837] ret_from_fork+0x29/0x40 Writeback calls: btrfs_write_inode btrfs_commit_transaction btrfs_run_delayed_iputs If iput() is called on that same inode, evict() will wait for writeback forever. btrfs_write_inode() was originally added way back in 4730a4bc5bf3 ("btrfs_dirty_inode") to support O_SYNC writes. However, ->write_inode() hasn't been used for O_SYNC since 148f948ba877 ("vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode"), so btrfs_write_inode() is actually unnecessary (and leads to a bunch of unnecessary commits). Get rid of it, which also gets rid of the deadlock. CC: stable@vger.kernel.org # 3.2+ Signed-off-by: Josef Bacik [Omar: new commit message] Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 97aff912a2fa75555641303d42bd4c723a98df5d Author: Nikolay Borisov Date: Fri Jul 20 19:37:53 2018 +0300 btrfs: Remove fs_info from btrfs_finish_chunk_alloc It can be referenced from the passed transaction handle. Signed-off-by: Nikolay Borisov Reviewed-by: Lu Fengqi Signed-off-by: David Sterba commit f4208794d02e74f16e5744fe2fe294d7f71fa0f9 Author: Nikolay Borisov Date: Fri Jul 20 19:37:52 2018 +0300 btrfs: Remove fs_info form btrfs_free_chunk It can be referenced from the passed transaction handle. Signed-off-by: Nikolay Borisov Reviewed-by: Lu Fengqi Signed-off-by: David Sterba commit 4f5ad7bd6315528ed50a11d53c66854a5d16425b Author: Nikolay Borisov Date: Fri Jul 20 19:37:51 2018 +0300 btrfs: Remove fs_info from btrfs_destroy_dev_replace_tgtdev This function is always passed a well-formed tgtdevice so the fs_info can be referenced from there. Signed-off-by: Nikolay Borisov Reviewed-by: Lu Fengqi Signed-off-by: David Sterba commit d6507cf1e2dfa4f6888cd90e4c9a307f7ac9b383 Author: Nikolay Borisov Date: Fri Jul 20 19:37:50 2018 +0300 btrfs: Remove fs_info from btrfs_assign_next_active_device It can be referenced from the passed 'device' argument which is always a well-formed device. Signed-off-by: Nikolay Borisov Reviewed-by: Lu Fengqi Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5495f195fc5b246d8b0b8a2e0fbbc9c94b3ebf24 Author: Nikolay Borisov Date: Fri Jul 20 19:37:49 2018 +0300 btrfs: remove fs_info argument from update_dev_stat_item It can be referenced from the passed transaction handle. Signed-off-by: Nikolay Borisov Reviewed-by: Lu Fengqi Signed-off-by: David Sterba commit 68a9db5f2395cdef98b387bbb816604f6f298056 Author: Nikolay Borisov Date: Fri Jul 20 19:37:48 2018 +0300 btrfs: Remove fs_info from btrfs_rm_dev_replace_remove_srcdev It can be referenced from the passed srcdev argument. Signed-off-by: Nikolay Borisov Reviewed-by: Lu Fengqi Signed-off-by: David Sterba commit 8e87e8562744e23e10afea98d610cc6b7f4ba9bb Author: Nikolay Borisov Date: Fri Jul 20 19:37:47 2018 +0300 btrfs: Remove fs_info argument from btrfs_add_dev_item It can be referenced form the passed transaction handle. Signed-off-by: Nikolay Borisov Reviewed-by: Lu Fengqi Signed-off-by: David Sterba commit 5e23a6fea6189d1f9d6e6ca5cb3290b4a0fe2d48 Author: Qu Wenruo Date: Mon Jul 23 14:47:29 2018 +0800 btrfs: extent-tree: Remove dead alignment check In find_free_extent() under checks: label, we have the following code: search_start = ALIGN(offset, fs_info->stripesize); /* move on to the next group */ if (search_start + num_bytes > block_group->key.objectid + block_group->key.offset) { btrfs_add_free_space(block_group, offset, num_bytes); goto loop; } if (offset < search_start) btrfs_add_free_space(block_group, offset, search_start - offset); BUG_ON(offset > search_start); However ALIGN() is rounding up, thus @search_start >= @offset and that BUG_ON() will never be triggered. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit ca5d2ba1ae2dfd651b798218d56c3277784fa499 Author: Filipe Manana Date: Mon Jul 23 09:10:09 2018 +0100 Btrfs: remove unused key assignment when doing a full send At send.c:full_send_tree() we were setting the 'key' variable in the loop while never using it later. We were also using two btrfs_key variables to store the initial key for search and the key found in every iteration of the loop. So remove this useless key assignment and use the same btrfs_key variable to store the initial search key and the key found in each iteration. This was introduced in the initial send commit but was never used (commit 31db9f7c23fb ("Btrfs: introduce BTRFS_IOC_SEND for btrfs send/receive"). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5cdc84bfde22dc17b11ee7cb18cebd48f4a09f70 Author: David Sterba Date: Wed Jul 18 20:32:52 2018 +0200 btrfs: drop extent_io_ops::set_range_writeback callback The data and metadata callback implementation both use the same function. We can remove the call indirection and intermediate helper completely. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 00032d38eaa89c76de7d9c1ae6de8c48c14edd74 Author: David Sterba Date: Wed Jul 18 19:28:09 2018 +0200 btrfs: drop extent_io_ops::merge_bio_hook callback The data and metadata callback implementation both use the same function. We can remove the call indirection completely. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 05912a3c04ebca217507b4323b679c60eda4ac11 Author: David Sterba Date: Wed Jul 18 19:23:45 2018 +0200 btrfs: drop extent_io_ops::tree_fs_info callback All implementations of the callback are trivial and do the same and there's only one user. Merge everything together. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit e288c080dddd1fdc3b7e0165cebd7af51a52d016 Author: David Sterba Date: Wed Jul 18 17:36:24 2018 +0200 btrfs: unify end_io callbacks of async_submit_bio The end_io callbacks passed to btrfs_wq_submit_bio (btrfs_submit_bio_done and btree_submit_bio_done) are effectively the same code, there's no point to do the indirection. Export btrfs_submit_bio_done and call it directly. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit d7cbfafc4bc37ed21351cdedbc6f9d979545dbf3 Author: David Sterba Date: Wed Jul 18 17:31:10 2018 +0200 btrfs: remove unused member async_submit_bio::bio_flags After splitting the start and end hooks in a758781d4b76c3 ("btrfs: separate types for submit_bio_start and submit_bio_done"), some of the function arguments were dropped but not removed from the structure. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit d7e8555b1dd493c809e56e359974eecabe7d3fde Author: David Sterba Date: Wed Jul 18 17:31:19 2018 +0200 btrfs: remove unused member async_submit_bio::fs_info Introduced by c6100a4b4e3d1 ("Btrfs: replace tree->mapping with tree->private_data") to be used in run_one_async_done where it got unused after 736cd52e0c720103 ("Btrfs: remove nr_async_submits and async_submit_draining"). Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 315409b0098fb2651d86553f0436b70502b29bb2 Author: Gu Jinxiang Date: Wed Jul 4 18:16:39 2018 +0800 btrfs: validate type when reading a chunk Reported in https://bugzilla.kernel.org/show_bug.cgi?id=199839, with an image that has an invalid chunk type but does not return an error. Add chunk type check in btrfs_check_chunk_valid, to detect the wrong type combinations. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199839 Reported-by: Xu Wen Reviewed-by: Qu Wenruo Signed-off-by: Gu Jinxiang Signed-off-by: David Sterba commit b0132a3be5daf84116833542717ff5692f51640e Author: Nikolay Borisov Date: Wed Jun 27 16:38:24 2018 +0300 btrfs: Rename EXTENT_BUFFER_DUMMY to EXTENT_BUFFER_UNMAPPED EXTENT_BUFFER_DUMMY is an awful name for this flag. Buffers which have this flag set are not in any way dummy. Rather, they are private in the sense that are not mapped and linked to the global buffer tree. This flag has subtle implications to the way free_extent_buffer works for example, as well as controls whether page->mapping->private_lock is held during extent_buffer release. Pages for an unmapped buffer cannot be under io, nor can they be written by a 3rd party so taking the lock is unnecessary. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba [ EXTENT_BUFFER_UNMAPPED, update changelog ] Signed-off-by: David Sterba commit 07e21c4dad42be8d2a6b8cd0b98cf8e6931e12fd Author: Nikolay Borisov Date: Wed Jun 27 16:38:23 2018 +0300 btrfs: Document locking requirement via lockdep_assert_held Remove stale comment since there is no longer an eb->eb_lock and document the locking expectation with a lockdep_assert_held statement. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 55ac01396ae8cfc0616e85bb4b49a130144633c2 Author: David Sterba Date: Thu Jul 19 17:24:32 2018 +0200 btrfs: rename btrfs_release_extent_buffer_page The function used to release one page (and always the first one), but not anymore since a50924e3a4d7fccb0ecfbd4 ("btrfs: drop constant param from btrfs_release_extent_buffer_page"). Update the name and comment. Signed-off-by: David Sterba commit d64766fdf9cd172f8416d898cc9d5219ed933b96 Author: Nikolay Borisov Date: Wed Jun 27 16:38:22 2018 +0300 btrfs: Refactor loop in btrfs_release_extent_buffer_page The purpose of the function is to free all the pages comprising an extent buffer. This can be achieved with a simple for loop rather than the slightly more involved 'do {} while' construct. So rewrite the loop using a 'for' construct. Additionally we can never have an extent_buffer that has 0 pages so remove the check for index == 0. No functional changes. The reversed order used to have a meaning in the past where the first page served as a blocking point for several callers. See eg 4f2de97acee6532b36dd6e99 ("Btrfs: set page->private to the eb"). Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit b16d011e79fb353abff70b2ef35b22ed90dc8db5 Author: Nikolay Borisov Date: Wed Jul 4 10:24:52 2018 +0300 btrfs: Reword dodgy comments in alloc_extent_buffer Commit eb14ab8ed24a ("Btrfs: fix page->private races") fixed a genuine race between extent buffer initialisation and btree_releasepage. Unfortunately as the code has evolved the comments weren't changed which made them slightly wrong and they weren't very clear in the fist place. Fix this by (hopefully) rewording them in a more approachable manner. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 28187ae569e8a6c34eb7ac8871f479d94be31e16 Author: Nikolay Borisov Date: Wed Jul 4 10:24:51 2018 +0300 btrfs: Simplify page unlocking in alloc_extent_buffer Current version of the page unlocking code was added in 727011e07cbd ("Btrfs: allow metadata blocks larger than the page size") but even in this commit that particular flag was never used per-se. In fact, btrfs only uses PageChecked for data pages to identify pages which have been dirtied but don't have ORDERED bit set. For more information see 247e743cbe6e ("Btrfs: Use async helpers to deal with pages that have been improperly dirtied"). However, this doesn't apply to extent buffer pages. The important bit here is that the pages are unlocked AFTER the extent buffer has been properly recorded in the radix tree to avoid races with btree_releasepage. Let's exploit this fact and simplify the page unlocking sequence by unlocking the pages in-order and removing the redundant PageChecked flag setting/clearing. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8b9b6f255485a4354da5474b16e79c447222e9ed Author: Qu Wenruo Date: Wed Jul 11 13:41:22 2018 +0800 btrfs: scrub: cleanup the remaining nodatasum fixup code Remove the remaining code that misused the page cache pages during device replace and could cause data corruption for compressed nodatasum extents. Such files do not normally exist but there's a bug that allows this combination and the corruption was exposed by device replace fixup code. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 46df06b85e28eaf430aa5c8f8aa26120fa746b72 Author: David Sterba Date: Fri Jul 13 20:46:30 2018 +0200 btrfs: refactor block group replication factor calculation to a helper There are many places that open code the duplicity factor of the block group profiles, create a common helper. This can be easily extended for more copies. Signed-off-by: David Sterba commit 321a4bf72b251319aa456ea542161729442b6f61 Author: Anand Jain Date: Mon Jul 16 22:58:09 2018 +0800 btrfs: use the assigned fs_devices instead of the dereference We have assigned the %fs_info->fs_devices in %fs_devices as its not modified just use it for the mutex_lock(). Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 62088ca7427d23ec1a5def9143098ca9c41c5302 Author: Lu Fengqi Date: Wed Jul 18 14:45:42 2018 +0800 btrfs: qgroup: Drop fs_info parameter from qgroup_rescan_leaf It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit a937742250199a37358a4da0a990744b92c8623c Author: Lu Fengqi Date: Wed Jul 18 14:45:41 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_inherit It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 280f8bd2cbe0b4b578c217b8fa504294c30abde1 Author: Lu Fengqi Date: Wed Jul 18 14:45:40 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_run_qgroups It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 8696d76045579c9611fe1cfc064e48ada32bb796 Author: Lu Fengqi Date: Wed Jul 18 14:45:39 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_account_extent It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit deb406274339f386836313af7eeb8001cca6c33f Author: Lu Fengqi Date: Wed Jul 18 14:45:38 2018 +0800 btrfs: qgroup: Drop root parameter from btrfs_qgroup_trace_subtree The fs_info can be fetched from the transaction handle directly. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 8d38d7eb7bb60a7a441cec3ba92784d9f1e20d5f Author: Lu Fengqi Date: Wed Jul 18 14:45:37 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_leaf_items It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit a95f3aafd6a2d0e8de834c95e91066825e3e7787 Author: Lu Fengqi Date: Wed Jul 18 16:28:03 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_qgroup_trace_extent It can be fetched from the transaction handle. In addition, remove the WARN_ON(trans == NULL) because it's not possible to hit this condition. Signed-off-by: Lu Fengqi Reviewed-by: David Sterba Signed-off-by: David Sterba commit f0042d5e92b66969a12166d1deb5a979250d6c25 Author: Lu Fengqi Date: Wed Jul 18 14:45:35 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_limit_qgroup It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 3efbee1d006a97eaec5f070430c75010ef8746f1 Author: Lu Fengqi Date: Wed Jul 18 14:45:34 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_remove_qgroup It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 49a05ecde3f130ae9d69ab619e3ea125cf1f32c9 Author: Lu Fengqi Date: Wed Jul 18 14:45:33 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_create_qgroup It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 39616c2735ad04ecf4874519b64556decb73d968 Author: Lu Fengqi Date: Wed Jul 18 14:45:32 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_del_qgroup_relation It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 6b36f1aa5cda39acac50f6f80c81776a31fccd24 Author: Lu Fengqi Date: Wed Jul 18 14:45:31 2018 +0800 btrfs: qgroup: Drop fs_info parameter from __del_qgroup_relation It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 9f8a6ce6ba8ebeb86de59b1adfdc64087049f76f Author: Lu Fengqi Date: Wed Jul 18 14:45:30 2018 +0800 btrfs: qgroup: Drop fs_info parameter from btrfs_add_qgroup_relation It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 2e980acdd829742966c6a7e565ef3382c0717295 Author: Lu Fengqi Date: Wed Jul 18 14:45:29 2018 +0800 btrfs: qgroup: Drop quota_root and fs_info parameters from update_qgroup_status_item They can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 3e07e9a09f27868dbc63d07db8677fcd256e3bbc Author: Lu Fengqi Date: Wed Jul 18 14:45:28 2018 +0800 btrfs: qgroup: Drop root parameter from update_qgroup_info_item It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit ac8a866af17edc692b50cbdd2aec612de4205c8f Author: Lu Fengqi Date: Wed Jul 18 14:45:27 2018 +0800 btrfs: qgroup: Drop root parameter from update_qgroup_limit_item It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 69104618f4b9dd445109e8dd755406427bd75b76 Author: Lu Fengqi Date: Wed Jul 18 14:45:26 2018 +0800 btrfs: qgroup: Drop quota_root parameter from del_qgroup_item It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 99d7f09ac01cbea28767a84d4d34dd5b1922a245 Author: Lu Fengqi Date: Wed Jul 18 14:45:25 2018 +0800 btrfs: qgroup: Drop quota_root parameter from del_qgroup_relation_item It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 711169c40f908df6df91ba2672d05b44243833e4 Author: Lu Fengqi Date: Wed Jul 18 14:45:24 2018 +0800 btrfs: qgroup: Drop quota_root parameter from add_qgroup_relation_item It can be fetched from the transaction handle. Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit fa59f27c8c35bbe00af8eff23de446a7f4b048b0 Author: Anand Jain Date: Mon Jul 16 22:18:07 2018 +0800 btrfs: rename btrfs_parse_early_options Rename btrfs_parse_early_options() to btrfs_parse_device_options(). As btrfs_parse_early_options() parses the -o device options and scan the device provided. So this rename specifies its action. Also the function name is in line with btrfs_parse_subvol_options(). No functional changes. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit c8389d4c0d6eb7c0b7f8b8a98620874f9123cd20 Author: Lu Fengqi Date: Tue Jul 17 16:58:22 2018 +0800 btrfs: qgroup: cleanup the unused srcroot from btrfs_qgroup_inherit Since commit 0b246afa62b0 ("btrfs: root->fs_info cleanup, add fs_info convenience variables"), the srcroot is no longer used to get fs_info::nodesize. In fact, it can be dropped after commit 707e8a071528 ("btrfs: use nodesize everywhere, kill leafsize"). Signed-off-by: Lu Fengqi Reviewed-by: David Sterba Signed-off-by: David Sterba commit 031f24da2c8a7b611331c368d7bfabccafda09fa Author: Qu Wenruo Date: Tue May 22 16:43:47 2018 +0800 btrfs: Use btrfs_mark_bg_unused to replace open code Introduce a small helper, btrfs_mark_bg_unused(), to acquire locks and add a block group to unused_bgs list. No functional modification, and only 3 callers are involved. Signed-off-by: Qu Wenruo Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 2556fbb0bead7929ddf67f8b4184f434cee4e7d7 Author: Nikolay Borisov Date: Wed Apr 18 10:27:57 2018 +0300 btrfs: Rewrite retry logic in do_chunk_alloc do_chunk_alloc implements logic to detect whether there is currently pending chunk allocation (by means of space_info->chunk_alloc being set) and if so it loops around to the 'again' label. Additionally, based on the state of the space_info (e.g. whether it's full or not) and the return value of should_alloc_chunk() it decides whether this is a "hard" error (ENOSPC) or we can just return 0. This patch refactors all of this: 1. Put order to the scattered ifs handling the various cases in an easy-to-read if {} else if{} branches. This makes clear the various cases we are interested in handling. 2. Call should_alloc_chunk only once and use the result in the if/else if constructs. All of this is done under space_info->lock, so even before multiple calls of should_alloc_chunk were unnecessary. 3. Rewrite the "do {} while()" loop currently implemented via label into an explicit loop construct. 4. Move the mutex locking for the case where the caller is the one doing the allocation. For the case where the caller needs to wait a concurrent allocation, introduce a pair of mutex_lock/mutex_unlock to act as a barrier and reword the comment. 5. Switch local vars to bool type where pertinent. All in all this shouldn't introduce any functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit dec59fa3a760952fc71f2e122e66a7291109670a Author: Ethan Lien Date: Fri Jul 13 16:50:42 2018 +0800 btrfs: use customized batch size for total_bytes_pinned In commit b150a4f10d878 ("Btrfs: use a percpu to keep track of possibly pinned bytes") we use total_bytes_pinned to track how many bytes we are going to free in this transaction. When we are close to ENOSPC, we check it and know if we can make the allocation by commit the current transaction. For every data/metadata extent we are going to free, we add total_bytes_pinned in btrfs_free_extent() and btrfs_free_tree_block(), and release it in unpin_extent_range() when we finish the transaction. So this is a variable we frequently update but rarely read - just the suitable use of percpu_counter. But in previous commit we update total_bytes_pinned by default 32 batch size, making every update essentially a spin lock protected update. Since every spin lock/unlock operation involves syncing a globally used variable and some kind of barrier in a SMP system, this is more expensive than using total_bytes_pinned as a simple atomic64_t. So fix this by using a customized batch size. Since we only read total_bytes_pinned when we are close to ENOSPC and fail to allocate new chunk, we can use a really large batch size and have nearly no penalty in most cases. [Test] We tested the patch on a 4-cores x86 machine: 1. fallocate a 16GiB size test file 2. take snapshot (so all following writes will be COW) 3. run a 180 sec, 4 jobs, 4K random write fio on test file We also added a temporary lockdep class on percpu_counter's spin lock used by total_bytes_pinned to track it by lock_stat. [Results] unpatched: lock_stat version 0.4 ----------------------------------------------------------------------- class name con-bounces contentions waittime-min waittime-max waittime-total waittime-avg acq-bounces acquisitions holdtime-min holdtime-max holdtime-total holdtime-avg total_bytes_pinned_percpu: 82 82 0.21 0.61 29.46 0.36 298340 635973 0.09 11.01 173476.25 0.27 patched: lock_stat version 0.4 ----------------------------------------------------------------------- class name con-bounces contentions waittime-min waittime-max waittime-total waittime-avg acq-bounces acquisitions holdtime-min holdtime-max holdtime-total holdtime-avg total_bytes_pinned_percpu: 1 1 0.62 0.62 0.62 0.62 13601 31542 0.14 9.61 11016.90 0.35 [Analysis] Since the spin lock only protects a single in-memory variable, the contentions (number of lock acquisitions that had to wait) in both unpatched and patched version are low. But when we see acquisitions and acq-bounces, we get much lower counts in patched version. Here the most important metric is acq-bounces. It means how many times the lock gets transferred between different cpus, so the patch can really reduce cacheline bouncing of spin lock (also the global counter of percpu_counter) in a SMP system. Fixes: b150a4f10d878 ("Btrfs: use a percpu to keep track of possibly pinned bytes") Signed-off-by: Ethan Lien Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit d814a49198eafa6163698bdd93961302f3a877a4 Author: Ethan Lien Date: Mon Jul 2 15:44:58 2018 +0800 btrfs: use correct compare function of dirty_metadata_bytes We use customized, nodesize batch value to update dirty_metadata_bytes. We should also use batch version of compare function or we will easily goto fast path and get false result from percpu_counter_compare(). Fixes: e2d845211eda ("Btrfs: use percpu counter for dirty metadata count") CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Ethan Lien Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 36350e95a2b1feed6382fe38cc80f79ec35a1323 Author: Gu Jinxiang Date: Thu Jul 12 14:23:16 2018 +0800 btrfs: return device pointer from btrfs_scan_one_device Return device pointer (with the IS_ERR semantics) from btrfs_scan_one_device so we don't have to return in through pointer. And since btrfs_fs_devices can be obtained from btrfs_device, return that. Signed-off-by: Gu Jinxiang Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba [ fixed conflics after recent changes to btrfs_scan_one_device ] Signed-off-by: David Sterba commit d64dcbd183abab251beb0fa0acd81a772a09887e Author: Gu Jinxiang Date: Thu Jul 12 14:23:15 2018 +0800 btrfs: make fs_devices a local variable in btrfs_parse_early_options fs_devices is always passed to btrfs_scan_one_device which overrides it. In the call stack below fs_devices is passed to btrfs_scan_one_device from btrfs_mount_root. In btrfs_mount_root the output fs_devices of this call stack is not used. btrfs_mount_root btrfs_parse_early_options btrfs_scan_one_device So, it is not necessary to pass fs_devices from btrfs_mount_root, using a local variable in btrfs_parse_early_options is enough. Signed-off-by: Gu Jinxiang Reviewed-by: Anand Jain Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 81ffd56b5745355b70d54ca4e1bdd0d64a66ff9f Author: David Sterba Date: Tue Jun 19 18:04:07 2018 +0200 btrfs: fix mount and ioctl device scan ioctl race Technically this extends the critical section covered by uuid_mutex to: - parse early mount options -- here we can call device scan on paths that can be passed as 'device=/dev/...' - scan the device passed to mount - open the devices related to the fs_devices -- this increases fs_devices::opened The race can happen when mount calls one of the scans and there's another one called eg. by mkfs or 'btrfs dev scan': Mount Scan ----- ---- scan_one_device (dev1, fsid1) scan_one_device (dev2, fsid1) add the device free stale devices fsid1 fs_devices::opened == 0 find fsid1:dev1 free fsid1:dev1 if it's the last one, free fs_devices of fsid1 too open_devices (dev1, fsid1) dev1 not found When fixed, the uuid mutex will make sure that mount will increase fs_devices::opened and this will not be touched by the racing scan ioctl. Reported-and-tested-by: syzbot+909a5177749d7990ffa4@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+ceb2606025ec1cc3479c@syzkaller.appspotmail.com Reviewed-by: Anand Jain Signed-off-by: David Sterba commit 399f7f4c42e8a58c8456264d5112287aefe44cf4 Author: David Sterba Date: Tue Jun 19 18:01:24 2018 +0200 btrfs: reorder initialization before the mount locks uuid_mutex In preparation to take a big lock, move resource initialization before the critical section. It's not obvious from the diff, the desired order is: - initialize mount security options - allocate temporary fs_info - allocate superblock buffers Reviewed-by: Anand Jain Signed-off-by: David Sterba commit 5139cff598d42b1e531f40c84691a7e945f04553 Author: David Sterba Date: Tue Jun 19 17:50:25 2018 +0200 btrfs: lift uuid_mutex to callers of btrfs_parse_early_options Prepartory work to fix race between mount and device scan. btrfs_parse_early_options calls the device scan from mount and we'll need to let mount completely manage the critical section. Reviewed-by: Anand Jain Signed-off-by: David Sterba commit f5194e34cabaddd348a90f950e0a8188dd26cdc0 Author: David Sterba Date: Tue Jun 19 17:09:47 2018 +0200 btrfs: lift uuid_mutex to callers of btrfs_open_devices Prepartory work to fix race between mount and device scan. The callers will have to manage the critical section, eg. mount wants to scan and then call btrfs_open_devices without the ioctl scan walking in and modifying the fs devices in the meantime. Reviewed-by: Anand Jain Signed-off-by: David Sterba commit 899f9307c33ce4758c30a076b10ed54d5c91c6e7 Author: David Sterba Date: Tue Jun 19 16:37:36 2018 +0200 btrfs: lift uuid_mutex to callers of btrfs_scan_one_device Prepartory work to fix race between mount and device scan. The callers will have to manage the critical section, eg. mount wants to scan and then call btrfs_open_devices without the ioctl scan walking in and modifying the fs devices in the meantime. Reviewed-by: Anand Jain Signed-off-by: David Sterba commit 7bcb8164ad9435068d9bc3b83b8a002c64d63ff6 Author: Anand Jain Date: Tue May 29 17:23:20 2018 +0800 btrfs: use device_list_mutex when removing stale devices btrfs_free_stale_devices() finds a stale (not opened) device matching path in the fs_uuid list. We are already under uuid_mutex so when we check for each fs_devices, hold the device_list_mutex too. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit fa6d2ae540a200a17bb7ee769f9df22d411c9404 Author: Anand Jain Date: Tue May 29 15:33:08 2018 +0800 btrfs: rename local devices for fs_devices in btrfs_free_stale_devices( Over the years we named %fs_devices and %devices to represent the struct btrfs_fs_devices and the struct btrfs_device. So follow the same scheme here too. No functional changes. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 9c6d173ea6e4c8c939ae6c257c7fc18f7b320316 Author: Anand Jain Date: Tue May 29 14:10:20 2018 +0800 btrfs: extend locked section when adding a new device in device_list_add Make sure the device_list_lock is held the whole time: * when the device is being looked up * new device is initialized and put to the list * the list counters are updated (fs_devices::opened, fs_devices::total_devices) Signed-off-by: Anand Jain [ update changelog ] Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4306a97449f9a0f9e5229af7889d4401315355aa Author: Anand Jain Date: Tue May 29 12:28:37 2018 +0800 btrfs: do btrfs_free_stale_devices outside of device_list_add btrfs_free_stale_devices() looks for device path reused for another filesystem, and deletes the older fs_devices::device entry. In preparation to handle locking in device_list_add, move btrfs_free_stale_devices outside as these two functions serve a different purpose. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 959b1c04675735aa51b9a7b3e28963c4141bf3e7 Author: Nikolay Borisov Date: Fri Jun 29 08:26:05 2018 +0300 btrfs: close devices without offloading to a temporary list Since commit 88c14590cdd6 ("btrfs: use RCU in btrfs_show_devname for device list traversal") btrfs_show_devname no longer takes device_list_mutex. As such the deadlock that 0ccd05285e7f ("btrfs: fix a possible umount deadlock") aimed to fix no longer exists, we can free the devices immediatelly and remove the code that does the pending work. Signed-off-by: Nikolay Borisov Reviewed-by: Anand Jain [ update changelog ] Reviewed-by: David Sterba Signed-off-by: David Sterba commit 621567a28ce081424bdcaaef7763a34b204d5be0 Author: Qu Wenruo Date: Mon Jul 9 14:52:54 2018 +0800 btrfs: Remove unused function btrfs_account_dev_extents_size This function is not used since the alloc_start parameter has been obsoleted in commit 0d0c71b317207082856 ("btrfs: obsolete and remove mount option alloc_start"). Signed-off-by: Qu Wenruo Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 93b9bcdf9fbcb683d4e8c44ee8cec0989053d4de Author: Gu Jinxiang Date: Mon Jul 9 14:39:15 2018 +0800 btrfs: remove unused parameter from btrfs_parse_subvol_options Since parameter flags is no more used since commit d7407606564c ("btrfs: split parse_early_options() in two"), remove it. Signed-off-by: Gu Jinxiang Reviewed-by: David Sterba Signed-off-by: David Sterba commit b4993e64f78a9605b45252fa9ba385c88a1f4ce9 Author: Anand Jain Date: Tue Jul 3 17:07:23 2018 +0800 btrfs: fix in-memory value of total_devices after seed device deletion In case of deleting the seed device the %cur_devices (seed) and the %fs_devices (parent) are different. Now, as the parent fs_devices::total_devices also maintains the total number of devices including the seed device, so decrement its in-memory value for the successful seed delete. We are already updating its corresponding on-disk btrfs_super_block::number_devices value. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 340f1aa27f367e0c3d2662d44f356b05087fea05 Author: Nikolay Borisov Date: Thu Jul 5 14:50:48 2018 +0300 btrfs: qgroups: Move transaction management inside btrfs_quota_enable/disable Commit 5d23515be669 ("btrfs: Move qgroup rescan on quota enable to btrfs_quota_enable") not only resulted in an easier to follow code but it also introduced a subtle bug. It changed the timing when the initial transaction rescan was happening: - before the commit: it would happen after transaction commit had occured - after the commit: it might happen before the transaction was committed This results in failure to correctly rescan the quota since there could be data which is still not committed on disk. This patch aims to fix this by moving the transaction creation/commit inside btrfs_quota_enable, which allows to schedule the quota commit after the transaction has been committed. Fixes: 5d23515be669 ("btrfs: Move qgroup rescan on quota enable to btrfs_quota_enable") Reported-by: Misono Tomohiro Link: https://marc.info/?l=linux-btrfs&m=152999289017582 Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba commit c7b562c5480322ffaf591f45a4ff7ee089340ab4 Author: David Sterba Date: Fri Jun 29 10:57:10 2018 +0200 btrfs: raid56: catch errors from full_stripe_write Add fall-back code to catch failure of full_stripe_write. Proper error handling from inside run_plug would need more code restructuring as it's called at arbitrary points by io scheduler. Signed-off-by: David Sterba commit 176571a1f64f7670c87c3f8d3b50c11cc836110e Author: David Sterba Date: Fri Jun 29 10:57:05 2018 +0200 btrfs: raid56: merge rbio_is_full helpers There's only one call site of the unlocked helper so it can be folded into the caller. Signed-off-by: David Sterba commit a81b747d0f6efc01506fbd5335e91607dc013b8d Author: David Sterba Date: Fri Jun 29 10:57:03 2018 +0200 btrfs: raid56: use new helper for async_scrub_parity Signed-off-by: David Sterba commit e66d8d5a41c1e3c560fc7aba4edcb53caf4f26c8 Author: David Sterba Date: Fri Jun 29 10:57:00 2018 +0200 btrfs: raid56: use new helper for async_read_rebuild Signed-off-by: David Sterba commit cf6a4a7587dc997b29359e29cf14079e1931715b Author: David Sterba Date: Fri Jun 29 10:56:58 2018 +0200 btrfs: raid56: use new helper for async_rmw_stripe Signed-off-by: David Sterba commit ac63885907ee25bf277fa39ba66a0d85dec20786 Author: David Sterba Date: Fri Jun 29 10:56:56 2018 +0200 btrfs: raid56: add new helper for starting async work Add helper that schedules a given function to run on the rmw workqueue. This will replace several standalone helpers. Signed-off-by: David Sterba commit ebcc326316f3d798e9715e5ca1451c3e457b95dd Author: David Sterba Date: Fri Jun 29 10:56:53 2018 +0200 btrfs: open-code bio_set_op_attrs The helper is trivial and marked as deprecated. Signed-off-by: David Sterba commit cc5e31a4775d0d6b98139fdee51868a270bda42f Author: David Sterba Date: Thu Mar 1 18:20:27 2018 +0100 btrfs: switch types to int when counting eb pages The loops iterating eb pages use unsigned long, that's an overkill as we know that there are at most 16 pages (64k / 4k), and 4 by default (with nodesize 16k). Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 8791d43207966f40d8ffba18c663514aca5a6f3e Author: David Sterba Date: Wed Jul 4 17:49:31 2018 +0200 btrfs: use round_up wrapper in num_extent_pages Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 65ad010488a5cc0f123a9924f7ad26a1b3f6a4f6 Author: David Sterba Date: Fri Jun 29 10:56:49 2018 +0200 btrfs: pass only eb to num_extent_pages Almost all callers pass the start and len as 2 arguments but this is not necessary, all the information is provided by the eb. By reordering the calls to num_extent_pages, we don't need the local variables with start/len. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit d7f663fa3ff906247a979c1115bc92cbabfb19ba Author: David Sterba Date: Fri Jun 29 10:56:47 2018 +0200 btrfs: prune unused includes Remove includes if none of the interfaces and exports is used in the given source file. Signed-off-by: David Sterba commit 69d2480456d1baf027a86e530989d7bedd698d5f Author: David Sterba Date: Fri Jun 29 10:56:44 2018 +0200 btrfs: use copy_page for copying pages instead of memcpy Use the helper that's possibly optimized for full page copies. Signed-off-by: David Sterba commit 3ffbd68c48320730ef64ebfb5e639220f1f65483 Author: David Sterba Date: Fri Jun 29 10:56:42 2018 +0200 btrfs: simplify pointer chasing of local fs_info variables Functions that get btrfs inode can simply reach the fs_info by dereferencing the root and this looks a bit more straightforward compared to the btrfs_sb(...) indirection. If the transaction handle is available and not NULL it's used instead. Signed-off-by: David Sterba commit 37508515621551538addaf826ab4b8a9aaf0a382 Author: David Sterba Date: Fri Jun 29 10:56:40 2018 +0200 btrfs: simplify some assignments of inode numbers There are several places when the btrfs inode is converted to the generic inode, back to btrfs and then passed to btrfs_ino. We can remove the extra back and forth conversions. Signed-off-by: David Sterba commit 8f6c72a9e08c2a74d2159d2fc986fa9b29ceb851 Author: Zhihui Zhang Date: Mon Jul 2 20:00:54 2018 -0400 Btrfs: free space cache: make sure there is always room for generation number io_ctl_set_generation() assumes that the generation number shares the same page with inline CRCs. Let's make sure this is always true. Signed-off-by: Zhihui Zhang Reviewed-by: David Sterba Signed-off-by: David Sterba commit 694c51fb2eb6b6d7c9552af78ba646023a843366 Author: Anand Jain Date: Tue Jul 3 13:14:51 2018 +0800 btrfs: drop unnecessary variable in btrfs_init_new_device There is only usage of the declared devices variable, instead use its value directly. Signed-off-by: Anand Jain Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 5da54bc13801d378bf2e868beb623fc13ba40a83 Author: Anand Jain Date: Tue Jul 3 13:14:50 2018 +0800 btrfs: use a temporary variable for fs_devices in btrfs_init_new_device There are many instances of the %fs_info->fs_devices pointer dereferences, use a temporary variable instead. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 389305b2aa68723c754f88d9dbd268a400e10664 Author: Qu Wenruo Date: Tue Jul 3 17:10:07 2018 +0800 btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized Invalid reloc tree can cause kernel NULL pointer dereference when btrfs does some cleanup of the reloc roots. It turns out that fs_info::reloc_ctl can be NULL in btrfs_recover_relocation() as we allocate relocation control after all reloc roots have been verified. So when we hit: note, we haven't called set_reloc_control() thus fs_info::reloc_ctl is still NULL. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199833 Reported-by: Xu Wen Signed-off-by: Qu Wenruo Tested-by: Gu Jinxiang Reviewed-by: David Sterba Signed-off-by: David Sterba commit ba480dd4db9f1798541eb2d1c423fc95feee8d36 Author: Qu Wenruo Date: Tue Jul 3 17:10:06 2018 +0800 btrfs: tree-checker: Detect invalid and empty essential trees A crafted image has empty root tree block, which will later cause NULL pointer dereference. The following trees should never be empty: 1) Tree root Must contain at least root items for extent tree, device tree and fs tree 2) Chunk tree Or we can't even bootstrap as it contains the mapping. 3) Fs tree At least inode item for top level inode (.). 4) Device tree Dev extents for chunks 5) Extent tree Must have corresponding extent for each chunk. If any of them is empty, we are sure the fs is corrupted and no need to mount it. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199847 Reported-by: Xu Wen Signed-off-by: Qu Wenruo Tested-by: Gu Jinxiang Reviewed-by: David Sterba Signed-off-by: David Sterba commit fce466eab7ac6baa9d2dcd88abcf945be3d4a089 Author: Qu Wenruo Date: Tue Jul 3 17:10:05 2018 +0800 btrfs: tree-checker: Verify block_group_item A crafted image with invalid block group items could make free space cache code to cause panic. We could detect such invalid block group item by checking: 1) Item size Known fixed value. 2) Block group size (key.offset) We have an upper limit on block group item (10G) 3) Chunk objectid Known fixed value. 4) Type Only 4 valid type values, DATA, METADATA, SYSTEM and DATA|METADATA. No more than 1 bit set for profile type. 5) Used space No more than the block group size. This should allow btrfs to detect and refuse to mount the crafted image. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199849 Reported-by: Xu Wen Signed-off-by: Qu Wenruo Reviewed-by: Gu Jinxiang Reviewed-by: Nikolay Borisov Tested-by: Gu Jinxiang Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6d8ff4e4584cd84093b751671351c8103ead551d Author: David Sterba Date: Tue Jun 26 16:20:59 2018 +0200 btrfs: annotate unlikely branches after V0 extent type removal The v0 extent type checks are the right case for the unlikely annotations as we don't expect to ever see them, so let's give the compiler some hint. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit ba3c2b196bf59ba8574808fe6f8fd88d0fed7510 Author: Nikolay Borisov Date: Tue Jun 26 16:57:36 2018 +0300 btrfs: Add graceful handling of V0 extents Following the removal of the v0 handling code let's be courteous and print an error message when such extents are handled. In the cases where we have a transaction just abort it, otherwise just call btrfs_handle_fs_error. Both cases result in the FS being re-mounted RO. In case the error handling would be too intrusive, leave the BUG_ON in place, like extent_data_ref_count, other proper handling would catch that earlier. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit a79865c680d81220a1355cd13098e75227dc2994 Author: Nikolay Borisov Date: Thu Jun 21 09:45:00 2018 +0300 btrfs: Remove V0 extent support The v0 compat code was introduced in commit 5d4f98a28c7d ("Btrfs: Mixed back reference (FORWARD ROLLING FORMAT CHANGE)") 9 years ago, which was merged in 2.6.31. This means that the code is there to support filesystems which are _VERY_ old and if you are using btrfs on such an old kernel, you have much bigger problems. This coupled with the fact that no one is likely testing/maintining this code likely means it has bugs lurking. All things considered I think 43 kernel releases later it's high time this remnant of the past got removed. This patch removes all code wrapped in #ifdefs but leaves the BUG_ONs in case we have a v0 with no support intact as a sort of safety-net. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4de426cd394e4de4d3039aff7d20724d7d988dcf Author: Chengguang Xu Date: Wed Jun 27 12:16:38 2018 +0800 btrfs: remove unnecessary curly braces in btrfs_get_acl It's only coding style fix not functinal change. When if/else has only one statement then the braces are not needed. Signed-off-by: Chengguang Xu Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit dc7789ef8785ea996ecf302a89415439ccf10faa Author: Chengguang Xu Date: Wed Jun 27 12:16:37 2018 +0800 btrfs: avoid error code override in btrfs_get_acl It's not good to override the error code when failing from btrfs_getxattr() in btrfs_get_acl() because it hides the real reason of the failure. Signed-off-by: Chengguang Xu Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5ee552da503961e6df785b8495bcfc98eb30eb2a Author: Chengguang Xu Date: Wed Jun 27 12:16:36 2018 +0800 btrfs: remove unnecessary -ERANGE check in btrfs_get_acl There is no chance to get into -ERANGE error condition because we first call btrfs_getxattr to get the length of the attribute, then we do a subsequent call with the size from the first call. Between the 2 calls the size shouldn't change. So remove the unnecessary -ERANGE error check. Signed-off-by: Chengguang Xu Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7e35eab958e30d15743b1f9928d15b559a6e432d Author: Chengguang Xu Date: Wed Jun 27 12:16:35 2018 +0800 btrfs: replace empty string with NULL when getting attribute length in btrfs_get_acl In btrfs_get_acl() the first call of btr_getxattr() is for getting the length of attribute, the value buffer is never used in this case. So it's better to replace empty string with NULL. Signed-off-by: Chengguang Xu Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit ab3629ed86ec43e7d95cf087d0b5a9d403fcd822 Author: Chengguang Xu Date: Wed Jun 27 12:16:34 2018 +0800 btrfs: return error instead of crash when detecting unexpected type in btrfs_get_acl The caller of btrfs_get_acl() checks error condition so there is no impact from this change. In practice there is no chance to get into default case of switch statement because VFS has already checked the type. Signed-off-by: Chengguang Xu Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit af431dcb249ffff20b16e08adaa4b624405a046b Author: Su Yue Date: Fri Jun 22 16:18:01 2018 +0800 btrfs: return EUCLEAN if extent_inline_ref type is invalid If type of extent_inline_ref found is not expected, filesystem may have been corrupted, should return EUCLEAN instead of EINVAL. Signed-off-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit e4af400a9c5081e7d2b703e4c479cb9831cc1117 Author: Goldwyn Rodrigues Date: Sun Jun 17 12:39:47 2018 -0500 btrfs: Use iocb to derive pos instead of passing a separate parameter struct kiocb carries the ki_pos, so there is no need to pass it as a separate function parameter. generic_file_direct_write() increments ki_pos, so we now assign pos after the function. Signed-off-by: Goldwyn Rodrigues Reviewed-by: Misono Tomohiro [ rename to btrfs_buffered_write ] Signed-off-by: David Sterba commit 893bf4b115c713738df05bb557f8fba14f07c077 Author: Su Yue Date: Fri Jun 22 09:52:15 2018 +0800 btrfs: print more details when checking tree block finds a problem For easier debugging, print eb->start if level is invalid. Also make clear if bytenr found is not expected. Signed-off-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7b4284de93c51b1d78699bf06bccee892699aa4e Author: Nikolay Borisov Date: Wed Jun 20 18:43:12 2018 +0300 btrfs: Streamline memory allocation failure handling in btrfs_add_delayed_tree_ref Currently the function uses 2 goto labels to properly handle allocation failures. This could be simplified by simply re-arranging the code so that allocations are the in the beginning of the function. This allows to use simple return statements. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Su Yue Signed-off-by: David Sterba commit 43794446548730ac8461be30bbe47d5d027d1d16 Author: Qu Wenruo Date: Fri Jun 22 12:35:00 2018 +0800 btrfs: Don't remove block group that still has pinned down bytes [BUG] Under certain KVM load and LTP tests, it is possible to hit the following calltrace if quota is enabled: BTRFS critical (device vda2): unable to find logical 8820195328 length 4096 BTRFS critical (device vda2): unable to find logical 8820195328 length 4096 WARNING: CPU: 0 PID: 49 at ../block/blk-core.c:172 blk_status_to_errno+0x1a/0x30 CPU: 0 PID: 49 Comm: kworker/u2:1 Not tainted 4.12.14-15-default #1 SLE15 (unreleased) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014 Workqueue: btrfs-endio-write btrfs_endio_write_helper [btrfs] task: ffff9f827b340bc0 task.stack: ffffb4f8c0304000 RIP: 0010:blk_status_to_errno+0x1a/0x30 Call Trace: submit_extent_page+0x191/0x270 [btrfs] ? btrfs_create_repair_bio+0x130/0x130 [btrfs] __do_readpage+0x2d2/0x810 [btrfs] ? btrfs_create_repair_bio+0x130/0x130 [btrfs] ? run_one_async_done+0xc0/0xc0 [btrfs] __extent_read_full_page+0xe7/0x100 [btrfs] ? run_one_async_done+0xc0/0xc0 [btrfs] read_extent_buffer_pages+0x1ab/0x2d0 [btrfs] ? run_one_async_done+0xc0/0xc0 [btrfs] btree_read_extent_buffer_pages+0x94/0xf0 [btrfs] read_tree_block+0x31/0x60 [btrfs] read_block_for_search.isra.35+0xf0/0x2e0 [btrfs] btrfs_search_slot+0x46b/0xa00 [btrfs] ? kmem_cache_alloc+0x1a8/0x510 ? btrfs_get_token_32+0x5b/0x120 [btrfs] find_parent_nodes+0x11d/0xeb0 [btrfs] ? leaf_space_used+0xb8/0xd0 [btrfs] ? btrfs_leaf_free_space+0x49/0x90 [btrfs] ? btrfs_find_all_roots_safe+0x93/0x100 [btrfs] btrfs_find_all_roots_safe+0x93/0x100 [btrfs] btrfs_find_all_roots+0x45/0x60 [btrfs] btrfs_qgroup_trace_extent_post+0x20/0x40 [btrfs] btrfs_add_delayed_data_ref+0x1a3/0x1d0 [btrfs] btrfs_alloc_reserved_file_extent+0x38/0x40 [btrfs] insert_reserved_file_extent.constprop.71+0x289/0x2e0 [btrfs] btrfs_finish_ordered_io+0x2f4/0x7f0 [btrfs] ? pick_next_task_fair+0x2cd/0x530 ? __switch_to+0x92/0x4b0 btrfs_worker_helper+0x81/0x300 [btrfs] process_one_work+0x1da/0x3f0 worker_thread+0x2b/0x3f0 ? process_one_work+0x3f0/0x3f0 kthread+0x11a/0x130 ? kthread_create_on_node+0x40/0x40 ret_from_fork+0x35/0x40 BTRFS critical (device vda2): unable to find logical 8820195328 length 16384 BTRFS: error (device vda2) in btrfs_finish_ordered_io:3023: errno=-5 IO failure BTRFS info (device vda2): forced readonly BTRFS error (device vda2): pending csums is 2887680 [CAUSE] It's caused by race with block group auto removal: - There is a meta block group X, which has only one tree block The tree block belongs to fs tree 257. - In current transaction, some operation modified fs tree 257 The tree block gets COWed, so the block group X is empty, and marked as unused, queued to be deleted. - Some workload (like fsync) wakes up cleaner_kthread() Which will call btrfs_delete_unused_bgs() to remove unused block groups. So block group X along its chunk map get removed. - Some delalloc work finished for fs tree 257 Quota needs to get the original reference of the extent, which will read tree blocks of commit root of 257. Then since the chunk map gets removed, the above warning gets triggered. [FIX] Just let btrfs_delete_unused_bgs() skip block group which still has pinned bytes. However there is a minor side effect: currently we only queue empty blocks at update_block_group(), and such empty block group with pinned bytes won't go through update_block_group() again, such block group won't be removed, until it gets new extent allocated and removed. Signed-off-by: Qu Wenruo Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit bc931c0ef8f9e21ed5732ea148aeea9d0fffd3f8 Author: Geert Uytterhoeven Date: Fri Jun 22 09:18:29 2018 +0200 btrfs: Refactor count handling in btrfs_unpin_free_ino With gcc 4.1.2: fs/btrfs/inode-map.c: In function ‘btrfs_unpin_free_ino’: fs/btrfs/inode-map.c:241: warning: ‘count’ may be used uninitialized in this function While this warning is a false-positive, it can easily be killed by refactoring the code. Signed-off-by: Geert Uytterhoeven Reviewed-by: David Sterba Signed-off-by: David Sterba commit d3c6be6fdab48dd26af3d3e01c5972ffe20985b9 Author: Arnd Bergmann Date: Thu Jun 21 18:04:06 2018 +0200 btrfs: use timespec64 for i_otime While the regular inode timestamps all use timespec64 now, the i_otime field is btrfs specific and still needs to be converted to correctly represent times beyond 2038. Signed-off-by: Arnd Bergmann Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit afd48513f0019a2048afed0d98904d3fec7e05dd Author: Arnd Bergmann Date: Thu Jun 21 18:04:05 2018 +0200 btrfs: use monotonic time for transaction handling The transaction times were changed to ktime_get_real_seconds to avoid the y2038 overflow, but they still have a minor problem when they go backwards or jump due to settimeofday() or leap seconds. This changes the transaction handling to instead use ktime_get_seconds(), which returns a CLOCK_MONOTONIC timestamp that has neither of those problems. Signed-off-by: Arnd Bergmann Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit e41ca5897489b1c18af75ff0cc8f5c80260b3281 Author: Qu Wenruo Date: Wed Jun 6 15:41:49 2018 +0800 btrfs: Get rid of the confusing btrfs_file_extent_inline_len We used to call btrfs_file_extent_inline_len() to get the uncompressed data size of an inlined extent. However this function is hiding evil, for compressed extent, it has no choice but to directly read out ram_bytes from btrfs_file_extent_item. While for uncompressed extent, it uses item size to calculate the real data size, and ignoring ram_bytes completely. In fact, for corrupted ram_bytes, due to above behavior kernel btrfs_print_leaf() can't even print correct ram_bytes to expose the bug. Since we have the tree-checker to verify all EXTENT_DATA, such mismatch can be detected pretty easily, thus we can trust ram_bytes without the evil btrfs_file_extent_inline_len(). Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit bc877d285ca3dba24c52406946a4a69847cc7422 Author: Nikolay Borisov Date: Mon Jun 18 14:13:19 2018 +0300 btrfs: Deduplicate extent_buffer init code When a new extent buffer is allocated there are a few mandatory fields which need to be set in order for the buffer to be sane: level, generation, bytenr, backref_rev, owner and FSID/UUID. Currently this is open coded in the callers of btrfs_alloc_tree_block, meaning it's fairly high in the abstraction hierarchy of operations. This patch solves this by simply moving this init code in btrfs_init_new_buffer, since this is the function which initializes a newly allocated extent buffer. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9912bbf6440ba0555e91d3306520da01872c7c1d Author: Qu Wenruo Date: Wed Jun 20 15:38:58 2018 +0800 btrfs: check-integrity: Fix NULL pointer dereference for degraded mount Commit f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t") changed how btrfsic indexes device state. Now we need to access device->bdev->bd_dev, while for degraded mount it's completely possible to have device->bdev as NULL, thus it will trigger a NULL pointer dereference at mount time. Fix it by checking if the device is degraded before accessing device->bdev->bd_dev. There are a lot of other places accessing device->bdev->bd_dev, however the other call sites have either checked device->bdev, or the device->bdev is passed from btrfsic_map_block(), so it won't cause harm. Fixes: f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t") Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 43a7e99db6788110fb2bd97bdad5aa5c0c004aff Author: Nikolay Borisov Date: Wed Jun 20 15:49:15 2018 +0300 btrfs: Remove fs_info from btrfs_force_chunk_alloc It can be referenced from the passed transaction handle. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit c83488afc5a772e424d8f159236bcf805b3c249c Author: Nikolay Borisov Date: Wed Jun 20 15:49:14 2018 +0300 btrfs: Remove fs_info from btrfs_inc_block_group_ro It can be referenced from the passed bg cache. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 61da2abfcad9c7e1a9c2f74ae7af8637d9fba36e Author: Nikolay Borisov Date: Wed Jun 20 15:49:13 2018 +0300 btrfs: Remove fs_info from btrfs_alloc_logged_file_extent It can be referenced from trans since the function is always called within a valid transaction. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 87cc7a8a2afbe806bb18ef440277c4f2e58224fa Author: Nikolay Borisov Date: Wed Jun 20 15:49:12 2018 +0300 btrfs: Remove fs_info from remove_extent_backref It can be referenced directly from the transaction handle since it's always valid. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 5fac7f9ee142a3f498137669931265bc7207135d Author: Nikolay Borisov Date: Wed Jun 20 15:49:11 2018 +0300 btrfs: Remove fs_info from run_one_delayed_ref It can be referenced from the passed transaction handle, since it's always valid. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit a639cdeba3486883be9f016c96d03bbb31063f11 Author: Nikolay Borisov Date: Wed Jun 20 15:49:10 2018 +0300 btrfs: Remove fs_info from insert_inline_extent_backref It can be referenced from the passed transaction handle, since it's always valid. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 3c4da6574e7749353be6d5e9f06d17388c241469 Author: Nikolay Borisov Date: Wed Jun 20 15:49:09 2018 +0300 btrfs: Remove fs_info from exclude_super_stripes It can be referenced from the passed block group. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 9e715da86001cdbb2d802f1ac8eb5e12c6eb0d08 Author: Nikolay Borisov Date: Wed Jun 20 15:49:08 2018 +0300 btrfs: Remove fs_info from free_excluded_extents It can be referenced from the passed block group. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 451a2c130342125ca44dbbf3b62521c3f0041cfb Author: Nikolay Borisov Date: Wed Jun 20 15:49:07 2018 +0300 btrfs: Remove fs_info from check_system_chunk It can be referenced from trans since the function is always called within a transaction. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit c216b2039aa06f9be23a9f385cb2d2f6434927d7 Author: Nikolay Borisov Date: Wed Jun 20 15:49:06 2018 +0300 btrfs: Remove fs_info from btrfs_alloc_chunk It can be referenced from trans since the function is always called within a transaction. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 01458828bb420d6a8f9aa09af2376caab71660b3 Author: Nikolay Borisov Date: Wed Jun 20 15:49:05 2018 +0300 btrfs: Remove fs_info from do_chunk_alloc This function is always called with a valid transaction handle from where fs_info can be referenced. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit f97806f2eefdd762304e078fdbb2f8b994942ea6 Author: Nikolay Borisov Date: Wed Jun 20 15:49:04 2018 +0300 btrfs: Remove fs_info from run_delayed_tree_ref It can always be referneced from the passed transaction handle since it's always valid. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit f9871eddd9cb1acff770e03344a4cf12c343546f Author: Nikolay Borisov Date: Wed Jun 20 15:49:03 2018 +0300 btrfs: Remove fs_info from cleanup_ref_head fs_info can be refenreced from the transaction handle, since it's always valid. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit c4d56d4a1688e9cb926fd4abb428e5a9c1f963b9 Author: Nikolay Borisov Date: Wed Jun 20 15:49:02 2018 +0300 btrfs: Remove unused fs_info from cleanup_extent_op The argument is no longer used so remove it. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 20b9a2d670fa9f06d9f682cc414f3d1cb0adf440 Author: Nikolay Borisov Date: Wed Jun 20 15:49:01 2018 +0300 btrfs: Remove fs_info from run_delayed_extent_op This function is always called with a valid transaction handle so fs_info can be referenced from there. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 2bf98ef35f7fd4b5222b0d82e3abd3a27eb49a50 Author: Nikolay Borisov Date: Wed Jun 20 15:49:00 2018 +0300 btrfs: Remove fs_info from run_delayed_data_ref This function is always called with a valid transaction from where fs_info can be referenced. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 2590d0f155c7c133b0c05048526ccc0a8dd5e9e4 Author: Nikolay Borisov Date: Wed Jun 20 15:48:59 2018 +0300 btrfs: Remove fs_info argument from __btrfs_inc_extent_ref This function already takes a transaction which holds a reference to the fs_info struct. Use that reference and remove the extra arg. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit ef89b8245bc77a29f31cad2dec5be5f50d3a7c2b Author: Nikolay Borisov Date: Wed Jun 20 15:48:58 2018 +0300 btrfs: Remove fs_info from alloc_reserved_file_extent fs_info can be referenced from the transaction handle, which is always valid. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit e72cb9235d26e5b7360a38a702e644a24d8975e6 Author: Nikolay Borisov Date: Wed Jun 20 15:48:57 2018 +0300 btrfs: Remove fs_info from __btrfs_free_extent This function is always called with a valid transaction handle so we can reference the fs_info from there. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 5a98ec0141805a0ff9adb18fd18834a906637f2f Author: Nikolay Borisov Date: Wed Jun 20 15:48:56 2018 +0300 btrfs: Remove fs_info from btrfs_remove_block_group This function is always called with a valid transaction handle from where we can reference fs_info. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit e7e02096d98388a003323c4223630d011ba1b382 Author: Nikolay Borisov Date: Wed Jun 20 15:48:55 2018 +0300 btrfs: Remove fs_info from btrfs_make_block_group This function is always called with a valid transaction handle from where we can reference the fs_info. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 88a979c615d0d9da19498b3b7692e725fb2f387e Author: Nikolay Borisov Date: Wed Jun 20 15:48:54 2018 +0300 btrfs: Remove fs_info from btrfs_add_delayed_data_ref This function is always called with a valid transaction handle from where fs_info can be referenced. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 44e1c47d5c3f31a9f5c883834eb9e29d0b165ea8 Author: Nikolay Borisov Date: Wed Jun 20 15:48:53 2018 +0300 btrfs: Remove fs_info from btrfs_add_delayed_tree_ref This function is always called with a valid transaction handle from where fs_info can be referenced. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit fbe4801b26c3ca4192e679f04c0cf0dda32a6cda Author: Nikolay Borisov Date: Wed Jun 20 15:48:52 2018 +0300 btrfs: Remove fs_info from lookup_extent_backref This argument is unused. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit bd1d53ef358d584a0aa9dbd304c807fcc5e3dd5f Author: Nikolay Borisov Date: Wed Jun 20 15:48:51 2018 +0300 btrfs: Remove fs_info argument from lookup_extent_data_ref This function is always called with a valid transaction handle from where fs_info can be referenced. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit b8582eeabb727f24ad0f128141558e4eb0928aec Author: Nikolay Borisov Date: Wed Jun 20 15:48:50 2018 +0300 btrfs: Remove fs_info argument from lookup_tree_block_ref This function is always called with a valid transaction handle from where the fs_info can be referenced. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 61a18f1c66636c3226598719935eca06e81976ca Author: Nikolay Borisov Date: Wed Jun 20 15:48:49 2018 +0300 btrfs: Remove fs_info argument from update_inline_extent_backref This function always uses the leaf's extent_buffer which already contains a reference to the fs_info. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 867cc1fbebea7029ee5f95ea7e54f927ef7972b6 Author: Nikolay Borisov Date: Wed Jun 20 15:48:48 2018 +0300 btrfs: Remove fs_info from lookup_inline_extent_backref This function is always called with a valid transaction handle from where the fs_info can be referenced. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit b167fa9152015c91fef9489d059e9dd80d1032fd Author: Nikolay Borisov Date: Wed Jun 20 15:48:47 2018 +0300 btrfs: Remove fs_info from fixup_low_keys This argument is unused. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit e9f6290d593a8b2f6a3cf90e4ffd446ca25faea9 Author: Nikolay Borisov Date: Wed Jun 20 15:48:46 2018 +0300 btrfs: Remove fs_info from remove_extent_data_ref This function is always called with a valid transaction from where the fs_info can be referenced. No functional change. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 375934105c97476f88eefe5f836808dd0cfc3eeb Author: Nikolay Borisov Date: Wed Jun 20 15:48:45 2018 +0300 btrfs: Remove fs_info argument from insert_extent_backref This function is always called with a valid transaction handle from where fs_info can be referenced. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 62b895af4022017c11855087801b0575a442ccc6 Author: Nikolay Borisov Date: Wed Jun 20 15:48:44 2018 +0300 btrfs: Remove fs_info from insert_extent_data_ref This function is always called with a valid transaction handle from where fs_info can be referenced. So remove the redundant argument. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 10728404c6f64a570f5be95cd5b237c69d94d818 Author: Nikolay Borisov Date: Wed Jun 20 15:48:43 2018 +0300 btrfs: Remove fs_info from insert_tree_block_ref This function is always called with a valid transaction so there is no need to duplicate the fs_info, we can reference it directly from the trans handle. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit edf57cbf2b030781885e339f32e35a470d2f8eba Author: Bart Van Assche Date: Wed Jun 20 10:03:33 2018 -0700 btrfs: Fix a C compliance issue The C programming language does not allow to use preprocessor statements inside macro arguments (pr_info() is defined as a macro). Hence rework the pr_info() statement in btrfs_print_mod_info() such that it becomes compliant. This patch allows tools like sparse to analyze the BTRFS source code. Fixes: 62e855771dac ("btrfs: convert printk(KERN_* to use pr_* calls") Signed-off-by: Bart Van Assche Reviewed-by: David Sterba Signed-off-by: David Sterba commit acd43e3cdffcb2e361e8b481c72e057d34fcd780 Author: Bart Van Assche Date: Wed Jun 20 10:03:32 2018 -0700 btrfs: Annotate fall-through when parsing mount option This patch avoids that the compiler complains that a fall-through annotation is missing when building with W=1. Signed-off-by: Bart Van Assche Signed-off-by: David Sterba commit bece2e8239331d382f98b381f90e425a11157653 Author: Bart Van Assche Date: Wed Jun 20 10:03:31 2018 -0700 btrfs: Fix misleading indentation reported by smatch This patch avoids that building the BTRFS source code with smatch triggers complaints about inconsistent indenting. Signed-off-by: Bart Van Assche Signed-off-by: David Sterba commit a9ecb653b0ac9ed95671aa494015bbb705bf3eae Author: Nikolay Borisov Date: Wed Jun 20 17:26:42 2018 +0300 btrfs: Streamline log_extent_csums a bit Currently this function takes the root as an argument only to get the log_root from it. Simplify this by directly passing the log root from the caller. Also eliminate the fs_info local variable, since it's used only once, so directly reference it from the transaction handle. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit ca5788aba3e8153da38cf99ca3ce2294f032fb51 Author: David Sterba Date: Thu Jul 19 15:27:46 2018 +0200 btrfs: remove remaing full_sync logic from btrfs_sync_file The logic to check if the inode is already in the log can now be simplified since we always wait for the ordered extents to complete before deciding whether the inode needs to be logged. The big comment about it can go away too. CC: Filipe Manana Suggested-by: Filipe Manana [ code and changelog copied from mail discussion ] Signed-off-by: David Sterba commit 5636cf7d6dc86f47fd66757dae088e35014da464 Author: Josef Bacik Date: Wed May 23 11:58:36 2018 -0400 btrfs: remove the logged extents infrastructure This is no longer used anywhere, remove all of it. Signed-off-by: Josef Bacik Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit a2120a473a80905e0275df9b0427fa7fa1187b72 Author: Josef Bacik Date: Wed May 23 11:58:35 2018 -0400 btrfs: clean up the left over logged_list usage We no longer use this list we've passed around so remove it everywhere. Also remove the extra checks for ordered/filemap errors as this is handled higher up now that we're waiting on ordered_extents before getting to the tree log code. Signed-off-by: Josef Bacik Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit e7175a692765940f3ac3f0c005b9a766a59303d7 Author: Josef Bacik Date: Wed May 23 11:58:34 2018 -0400 btrfs: remove the wait ordered logic in the log_one_extent path Since we are waiting on all ordered extents at the start of the fsync() path we don't need to wait on any logged ordered extents, and we don't need to look up the checksums on the ordered extents as they will already be on disk prior to getting here. Rework this so we're only looking up and copying the on-disk checksums for the extent range we care about. Signed-off-by: Josef Bacik Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit b5e6c3e170b77025b5f6174258c7ad71eed2d4de Author: Josef Bacik Date: Wed May 23 11:58:33 2018 -0400 btrfs: always wait on ordered extents at fsync time There's a priority inversion that exists currently with btrfs fsync. In some cases we will collect outstanding ordered extents onto a list and only wait on them at the very last second. However this "very last second" falls inside of a transaction handle, so if we are in a lower priority cgroup we can end up holding the transaction open for longer than needed, so if a high priority cgroup is also trying to fsync() it'll see latency. Signed-off-by: Josef Bacik Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit 16d1c062c7de2999ea7be61d31070fa4ce3d99c4 Author: Nikolay Borisov Date: Mon Jun 18 14:59:26 2018 +0300 btrfs: Fix comment in lookup_inline_extent_backref The comment wrongfully states that the owner parameter is the level of the parent block. In fact owner is the level of the current block and by adding 1 to it we can eventually get to the parent/root. Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba commit bd3c685ed9fd3763615a51a70e19ff08a456e3e1 Author: Nikolay Borisov Date: Mon Jun 18 14:59:25 2018 +0300 btrfs: Document __btrfs_inc_extent_ref Here is a doc-only patch which tires to deobfuscate the terra-incognita that arguments for delayed refs are. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 9bebe665c3e4f4af30add8602217938d8c17ee23 Author: Qu Wenruo Date: Wed Jun 6 13:13:12 2018 +0800 btrfs: scrub: Remove unused copy_nocow_pages and its callchain Since commit ac0b4145d662a3b9e340 ("btrfs: scrub: Don't use inode pages for device replace") the function is not used and we can remove all functions down the call chain. There was an optimization that reused inode pages to speed up device replace, but broke when there was nodatasum and compressed page. The potential performance gain is small so we don't loose much by removing it and using scrub_pages same as the other pages. Signed-off-by: Qu Wenruo [ update changelog ] Signed-off-by: David Sterba commit a944442c2b8a420301e7830f976bab8cc86a2b4d Author: Allen Pais Date: Tue Jun 12 17:18:25 2018 +0530 btrfs: replace get_seconds with new 64bit time API The get_seconds() function is deprecated as it truncates the timestamp to 32 bits. Change it to or ktime_get_real_seconds(). Signed-off-by: Allen Pais Reviewed-by: David Sterba [ update changelog ] Signed-off-by: David Sterba commit be36abb71d878f3320412a84e6bbec8dd796010c Author: Quentin Schulz Date: Wed Jul 25 14:26:21 2018 +0200 pinctrl: ocelot: add support for interrupt controller This GPIO controller can serve as an interrupt controller as well on the GPIOs it handles. An interrupt is generated whenever a GPIO line changes and the interrupt for this GPIO line is enabled. This means that both the changes from low to high and high to low generate an interrupt. For some use cases, it makes sense to ignore the high to low change and not generate an interrupt. Such a use case is a line that is hold in a level high/low manner until the event holding the line gets acked. This can be achieved by making sure the interrupt on the GPIO controller side gets acked and masked only after the line gets hold in its default state, this is what's done with the fasteoi functions. Only IRQ_TYPE_EDGE_BOTH and IRQ_TYPE_LEVEL_HIGH are supported for now. Signed-off-by: Quentin Schulz Signed-off-by: Linus Walleij commit 9e90c7985229430428dc9ba0ec7fe422901b456d Merge: 4f7799d96e66 a8db74564b0c Author: Thomas Gleixner Date: Mon Aug 6 12:45:42 2018 +0200 Merge tag 'irqchip-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - GICv3 ITS LPI allocation revamp - GICv3 support for hypervisor-enforced LPI range - GICv3 ITS conversion to raw spinlock commit 34dbc9c6584d28d307690e13af882d159562581f Author: Christoph Hellwig Date: Sat Aug 4 12:14:02 2018 +0200 PCI/xilinx: Depend on OF instead of the ARCH There isn't a hard dependency of the Xilinx AXI-PCIe host bridge on any architecture. For example: at SiFive we map RISC-V cores to Xilinx FPGAs and connect the Xilinx IP via a TileLink adapter, so the RISC-V Linux port will need to be able to enable PCIE_XILINX in order to have PCIe support. This patch decouples the PCIE_XILINX support from ARCH. Instead it just depends on OF, which is the only true dependency. Signed-off-by: Palmer Dabbelt [hch: switch to OF instead of OF_PCI now that the latter is gone] Signed-off-by: Christoph Hellwig [lorenzo.pieralisi@arm.com: trimmed the commit log] Signed-off-by: Lorenzo Pieralisi commit 55f2503c3b69328735e88031ff8d6ba291bd952b Author: Pingfan Liu Date: Tue Jul 31 16:51:32 2018 +0800 PM / reboot: Eliminate race between reboot and suspend At present, "systemctl suspend" and "shutdown" can run in parrallel. A system can suspend after devices_shutdown(), and resume. Then the shutdown task goes on to power off. This causes many devices are not really shut off. Hence replacing reboot_mutex with system_transition_mutex (renamed from pm_mutex) to achieve the exclusion. The renaming of pm_mutex as system_transition_mutex can be better to reflect the purpose of the mutex. Signed-off-by: Pingfan Liu Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki commit 33c740411adad674b31444787a9b4e46c193ab67 Merge: 981467033a37 1bb38e8bb81e Author: Kalle Valo Date: Mon Aug 6 12:34:43 2018 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for 4.19. Major changes: ath10k * add debugfs file warm_hw_reset wil6210 * add debugfs files tx_latency, link_stats and link_stats_global * add 3-MSI support * allow scan on AP interface * support max aggregation window size 64 commit be10d5d1c2d15252624e965202508f30a218a46a Author: Alexander Aring Date: Sat Jul 14 12:33:06 2018 -0400 ieee802154: fakelb: add deprecated msg while probe Since mac802154_hwsim the fakelb driver will get deprecated. This patch will notifier all users of fakelb to switch to the new mac802154_hwsim driver. Signed-off-by: Alexander Aring Signed-off-by: Stefan Schmidt commit f25da51fdc381ca2863248c7060b3662632f0872 Author: Alexander Aring Date: Sat Jul 14 12:33:05 2018 -0400 ieee802154: hwsim: add replacement for fakelb This patch adds a new virtual driver mac802154_hwsim which is based on the fakelb driver. The fakelb driver will get deprecated and hopefully removed someday. The main reason for doing this step is to rename the driver to mac802154_hwsim to have a similar naming scheme as mac80211_hwsim, which is more popular in the 802.11 wireless word and the idea is the same behind this driver. The new features of this driver are to have knowledge about connected edges, which can be changed during runtime. This offers a testing environment for routing protocols e.g. RPL. The default behaviour is still as fakelb: two radios connected to each other. New added radios during runtime will not be connected to other wpan_hwsim instances. The netlink api is not namespace aware on purpose, only the registered wpan_phy's can be moved to namespaces. The physical layer according to wiresless "air" communication can be handled across namespaces. Furthermore the edges can be weighted with the LQI value according IEEE 802.15.4 which offers additional handling to mark bad or good connection indicators to other connected virtual phys. Signed-off-by: Alexander Aring Signed-off-by: Stefan Schmidt commit 4e54acb2022099e41231271b5a8ec58ca8ac2d86 Author: Colin Ian King Date: Tue Jul 31 16:45:07 2018 +0100 net: ieee802154: 6lowpan: remove redundant pointers 'fq' and 'net' Pointers fq and net are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'fq' set but not used [-Wunused-but-set-variable] warning: variable 'net' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Stefan Schmidt commit f9c52831133050c6b82aa8b6831c92da2bbf2a0b Author: Alexander Aring Date: Mon Jul 2 16:32:03 2018 -0400 net: mac802154: tx: expand tailroom if necessary This patch is necessary if case of AF_PACKET or other socket interface which I am aware of it and didn't allocated the necessary room. Reported-by: David Palma Reported-by: Rabi Narayan Sahoo Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: Stefan Schmidt commit ac74f87c789af40936a80131c4759f3e72579c3a Author: Alexander Aring Date: Sat Jul 14 12:52:10 2018 -0400 net: 6lowpan: fix reserved space for single frames This patch fixes patch add handling to take care tail and headroom for single 6lowpan frames. We need to be sure we have a skb with the right head and tailroom for single frames. This patch do it by using skb_copy_expand() if head and tailroom is not enough allocated by upper layer. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195059 Reported-by: David Palma Reported-by: Rabi Narayan Sahoo Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: Stefan Schmidt commit 82837ad5bda79cd13d64b9abad92e7872a06bc65 Author: Gustavo A. R. Silva Date: Sat Aug 4 21:12:00 2018 -0500 PM / hibernate: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This addresses Coverity-ID: 114713 ("Missing break in switch"). Signed-off-by: Gustavo A. R. Silva Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki commit e8693bcfa0b4a56268946f0756153d942cb66cf7 Author: Christoph Hellwig Date: Mon Jul 16 12:25:17 2018 +0200 aio: allow direct aio poll comletions for keyed wakeups If we get a keyed wakeup for a aio poll waitqueue and wake can acquire the ctx_lock without spinning we can just complete the iocb straight from the wakeup callback to avoid a context switch. Signed-off-by: Christoph Hellwig Tested-by: Avi Kivity commit bfe4037e722ec672c9dafd5730d9132afeeb76e9 Author: Christoph Hellwig Date: Mon Jul 16 09:08:20 2018 +0200 aio: implement IOCB_CMD_POLL Simple one-shot poll through the io_submit() interface. To poll for a file descriptor the application should submit an iocb of type IOCB_CMD_POLL. It will poll the fd for the events specified in the the first 32 bits of the aio_buf field of the iocb. Unlike poll or epoll without EPOLLONESHOT this interface always works in one shot mode, that is once the iocb is completed, it will have to be resubmitted. Signed-off-by: Christoph Hellwig Tested-by: Avi Kivity commit 9018ccc453af063d16b3b6b5dfa2ad0635390371 Author: Christoph Hellwig Date: Tue Jul 24 11:36:37 2018 +0200 aio: add a iocb refcount This is needed to prevent races caused by the way the ->poll API works. To avoid introducing overhead for other users of the iocbs we initialize it to zero and only do refcount operations if it is non-zero in the completion path. Signed-off-by: Christoph Hellwig Tested-by: Avi Kivity commit 7dda712818373d4d8ecc5dca2293664fcd3b0158 Author: Christoph Hellwig Date: Mon Jul 16 12:25:50 2018 +0200 timerfd: add support for keyed wakeups This prepares timerfd for use with aio poll. Signed-off-by: Christoph Hellwig Tested-by: Avi Kivity commit d3264f752a1aedac98aa90e50853df149d1346f2 Author: Srinivas Pandruvada Date: Wed Aug 1 17:26:06 2018 -0700 cpufreq: intel_pstate: Ignore turbo active ratio in HWP When HWP is active turbo active ratio is not used, so we should allow policy max frequency above turbo activation ratio to be set. When HWP is not active, then any policy max frequency above turbo activation ratio can result upto max one-core turbo frequency. This fix helps better thermal control in turbo region when other methods like "Running Average Power Limit" is not available to use. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit a8db74564b0c634667e1722264bde303d296f566 Author: Sebastian Andrzej Siewior Date: Wed Jul 18 17:42:04 2018 +0200 irqchip/gic-v3-its: Make its_lock a raw_spin_lock_t The its_lock lock is held while a new device is added to the list and during setup while the CPU is booted. Even on -RT the CPU-bootup is performed with disabled interrupts. Make its_lock a raw_spin_lock_t. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Marc Zyngier commit b047c62e24418b9f62b721be017ec5c0364166a5 Author: Aaron Ma Date: Tue Jul 31 18:52:39 2018 +0800 ACPI / EC: Use ec_no_wakeup on ThinkPad X1 Yoga 3rd Like on X1C6, on X1Y3 EC interrupts constantly wake up system from s2idle, the power consumption is extremely high. So make ec_no_wakeup be true as default to keep system in s2idle mode and reduce power consumption. Power button works when ec_no_wakeup=true. Signed-off-by: Aaron Ma Signed-off-by: Rafael J. Wysocki commit 6ccbe1dcdd17c9b76cc9f63e2dc600b381cb2378 Merge: 01e61a42a5d3 5a4c996764da Author: Rafael J. Wysocki Date: Mon Aug 6 10:09:52 2018 +0200 Merge back cpufreq changes for 4.19. commit 398404d8372ce0428abc49d059487e3f83d45249 Merge: 460a53106ac3 2a61e9f60b2b Author: Rafael J. Wysocki Date: Mon Aug 6 10:09:02 2018 +0200 Merge back ACPICA material for 4.19. commit 627661ced8246c8e833f3bc3817070e934cd79ba Author: Takashi Sakamoto Date: Mon Aug 6 16:14:06 2018 +0900 ALSA: dice: fix wrong copy to rx parameters for Alesis iO26 A commit 28b208f600a3 ('ALSA: dice: add parameters of stream formats for models produced by Alesis') adds wrong copy to rx parameters instead of tx parameters for Alesis iO26. This commit fixes the bug for v4.18-rc8. Fixes: 28b208f600a3 ('ALSA: dice: add parameters of stream formats for models produced by Alesis') Signed-off-by: Takashi Sakamoto Cc: # v4.18 Signed-off-by: Takashi Iwai commit ef0075280cfe09ef076ce1b85f0a2294c5ed86f3 Author: Gustavo A. R. Silva Date: Sat Aug 4 15:13:26 2018 -0500 ALSA: echoaudio: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115156 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 9d5a289a86a15a1a4248022f9338517f7e62832b Author: Gustavo A. R. Silva Date: Sat Aug 4 15:12:09 2018 -0500 ALSA: emu10k1: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced the code comment with a proper "fall through" annotation, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit ac69c2f578bf51a3804c5e96467571ea5be0e882 Author: Gustavo A. R. Silva Date: Sat Aug 4 15:11:03 2018 -0500 ALSA: mixart: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit a30461080366214b690a367225a48c95d7a6a189 Merge: 811e299f4645 981467033a37 Author: Stefan Schmidt Date: Mon Aug 6 09:04:48 2018 +0200 Merge remote-tracking branch 'net-next/master' commit aa1221b2584f06066d1e6b22ef7950fb12d94864 Author: Benjamin Herrenschmidt Date: Mon Aug 6 12:22:37 2018 +1000 fsi: scom: Fix NULL dereference The chardev conversion forgot to copy the fsi_dev, silly mistake, compounded by a testing mistake on my side, this specific driver wasn't being tested properly. Fixes: d8f4587655f9 "fsi: scom: Convert to use the new chardev" Signed-off-by: Benjamin Herrenschmidt commit f10fe9d85dc0802b54519c917716e6f0092b4ce7 Author: Matias Bjørling Date: Sun Aug 5 08:25:19 2018 -0600 lightnvm: remove minor version check for 2.0 A minor version number increase should not break backwards compatibility. Fixes: 3cb98f84d368b ("lightnvm: add minor version to generic geometry") Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit f87b0f0dfa5496fc4a701c071fa3ce7ad7ca5152 Merge: 05b9ba4b550f b369b30cf510 Author: Jens Axboe Date: Sun Aug 5 19:34:09 2018 -0600 Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-4.19/block2 Pull NVMe changes from Christoph: "This contains the support for TP4004, Asymmetric Namespace Access, which makes NVMe multipathing usable in practice." * 'nvme-4.19' of git://git.infradead.org/nvme: nvmet: use Retain Async Event bit to clear AEN nvmet: support configuring ANA groups nvmet: add minimal ANA support nvmet: track and limit the number of namespaces per subsystem nvmet: keep a port pointer in nvmet_ctrl nvme: add ANA support nvme: remove nvme_req_needs_failover nvme: simplify the API for getting log pages nvme.h: add ANA definitions nvme.h: add support for the log specific field Signed-off-by: Jens Axboe commit 05b9ba4b550ff67d7362608828405f9e389e8988 Merge: 704f83928c8e d72e90f33aa4 Author: Jens Axboe Date: Sun Aug 5 19:32:09 2018 -0600 Merge tag 'v4.18-rc6' into for-4.19/block2 Pull in 4.18-rc6 to get the NVMe core AEN change to avoid a merge conflict down the line. Signed-of-by: Jens Axboe commit 981467033a37d916649647fa3afe1fe99bba1817 Author: Vlad Buslov Date: Sun Aug 5 22:37:09 2018 +0300 tc-testing: remove duplicate spaces in skbedit match patterns Match patterns for some skbedit tests contain duplicate whitespace that is not present in actual tc output. This causes tests to fail because they can't match required action, even when it was successfully created. Signed-off-by: Vlad Buslov Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 757a9a39d483ae415a712388c33d4042a98b751f Author: Vlad Buslov Date: Sun Aug 5 22:36:44 2018 +0300 tc-testing: remove duplicate spaces in connmark match patterns Match patterns for some connmark tests contain duplicate whitespace that is not present in actual tc output. This causes tests to fail because they can't match required action, even when it was successfully created. Fixes: 1dad0f9ffff7 ("tc-testing: add connmark action tests") Signed-off-by: Vlad Buslov Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 0c62f8a820b7fdeacf5ad9f9e24b53043d372c97 Author: Vlad Buslov Date: Sun Aug 5 22:36:25 2018 +0300 tc-testing: flush gact actions on test teardown Test 6fb4 creates one mirred and one pipe action, but only flushes mirred on teardown. Leaking pipe action causes failures in other tests. Add additional teardown command to also flush gact actions. Signed-off-by: Vlad Buslov Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 64f61cddf1934277e9fbb77d3d67308ffbfd4fa3 Author: Vlad Buslov Date: Sun Aug 5 22:35:56 2018 +0300 tc-testing: fix ip address in u32 test Fix expected ip address to actually match configured ip address. Fix test to expect single matched filter. Signed-off-by: Vlad Buslov Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit b9a7f2ee569296656a3debdabf3c5473a3923f8a Merge: 6277547f33ec e800a333135b Author: David S. Miller Date: Sun Aug 5 17:36:01 2018 -0700 Merge tag 'wireless-drivers-next-for-davem-2018-08-05' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.19 This time a bigger pull request as we have two new Mediatek drivers MT76x2u (CONFIG_MT76x2U) and MT76x0U (CONFIG_MT76x0U). Also iwlwifi got support for the new IEEE 802.11ax standard, the successor for 802.11ac. And naturally smaller new features and bugfixes all over. Major changes: wcn36xx * fix WEP in client mode wil6210 * add support for Talyn-MB (Talyn ver 2.0) device * add support for enhanced DMA firmware feature iwlwifi * implement 802.11ax D2.0 * support for the new 22560 device family * new PCI IDs for 22000 and 22560 qtnfmac * implement cfg80211 power management callback * enable multiple SSIDs scan support * qtnfmac: implement basic WoWLAN support mt7601u * fall back to software encryption for hw unsupported ciphers * enable 802.11 Management Frame Protection (MFP) mt76 * support setting RTS threshold * add USB support * add support for MT76x2u devices * add support for MT76x0U devices mwifiex * allow user space to set all other IEs except WMM IE rsi * add firmware support for AP+BT dual mode ==================== Signed-off-by: David S. Miller commit 6277547f33ecd6beaca373cb0858df69706e466a Merge: add0decc46a0 6c3711ec64fd Author: David S. Miller Date: Sun Aug 5 17:29:27 2018 -0700 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2018-08-05 Here's the main bluetooth-next pull request for the 4.19 kernel. - Added support for Bluetooth Advertising Extensions - Added vendor driver support to hci_h5 HCI driver - Added serdev support to hci_h5 driver - Added support for Qualcomm wcn3990 controller - Added support for RTL8723BS and RTL8723DS controllers - btusb: Added new ID for Realtek 8723DE - Several other smaller fixes & cleanups Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller commit add0decc46a061069a9f9fd90eff95e590339039 Merge: b633d4405bb2 7b8195306694 Author: David S. Miller Date: Sun Aug 5 17:28:22 2018 -0700 Merge branch 'mlxsw-Enable-MC-aware-mode-for-mlxsw-ports' Ido Schimmel says: ==================== mlxsw: Enable MC-aware mode for mlxsw ports Petr says: Due to an issue in Spectrum chips, when unicast traffic shares the same queue as BUM traffic, and there is a congestion, the BUM traffic is admitted to the queue anyway, thus pushing out all UC traffic. In order to give unicast traffic precedence over BUM traffic, configure multicast-aware mode on all ports. Under multicast-aware regime, when assigning traffic class to a packet, the switch doesn't merely take the value prescribed by the QTCT register. For BUM traffic, it instead assigns that value plus 8. That limits the number of available TCs, but since mlxsw currently only uses the lower eight anyway, it is no real loss. The two TCs (UC and MC one) are then mapped to the same subgroup and strictly prioritized so that UC traffic is preferred in case of congestion. In patch #1, introduce a new register, QTCTM, which enables the multicast-aware mode. In patch #2, fix a typo in related code. In patch #3, set up TCs and QTCTM to enable multicast-aware mode. ==================== Signed-off-by: David S. Miller commit 7b819530669458c3af6d44edfc9cb34958492bca Author: Petr Machata Date: Sun Aug 5 09:03:08 2018 +0300 mlxsw: spectrum: Configure MC-aware mode on mlxsw ports In order to give unicast traffic precedence over BUM traffic, configure multicast-aware mode on all ports. Under multicast-aware regime, when assigning traffic class to a packet, the switch doesn't merely take the value prescribed by the QTCT register. For BUM traffic, it instead assigns that value plus 8. ETS elements for TCs 8..15 thus need to be configured as well. Extend mlxsw_sp_port_ets_init() so that it maps each of them to the same subgroup as their corresponding TC from the range 0..7, such that TCs X and X+8 map to the same subgroup. The existing code configures TCs with strict priority. So far this was immaterial, because each TC had its own subgroup. Now that two TCs share a subgroup it becomes important. TCs are prioritized in order of 7, 6, ..., 0, 15, 14, ..., 8: the higher TCs used for BUM traffic end up being deprioritized. Since that's what's needed, keep that configuration as it is, and configure the new TCs likewise. Finally in mlxsw_sp_port_create(), invoke configuration of QTCTM to enable MC-aware mode on each port. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d0a07d6ada004ddaf010888a66d72ef606336bf4 Author: Petr Machata Date: Sun Aug 5 09:03:07 2018 +0300 mlxsw: spectrum: Fix a typo Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 671ae8af05d58a74e58c39a7243836ec836baf2d Author: Petr Machata Date: Sun Aug 5 09:03:06 2018 +0300 mlxsw: reg: Add QoS Switch Traffic Class Table is Multicast-Aware Register This register configures if the Switch Priority to Traffic Class mapping is based on Multicast packet indication. If so, then multicast packets will get a Traffic Class that is plus (cap_max_tclass_data/2) the value configured by QTCT. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b633d4405bb276518812fbc20a5c61ce4cef25ae Author: Gustavo A. R. Silva Date: Sat Aug 4 21:42:05 2018 -0500 virtio-net: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1402059 ("Missing break in switch") Addresses-Coverity-ID: 1402060 ("Missing break in switch") Addresses-Coverity-ID: 1402061 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 1cbc36a53b60d43daa686280385b1ddbe51d5809 Author: Dan Carpenter Date: Fri Aug 3 22:27:55 2018 +0300 net: sched: cls_flower: Fix an error code in fl_tmplt_create() We forgot to set the error code on this path, so we return NULL instead of an error pointer. In the current code kzalloc() won't fail for small allocations so this doesn't really affect runtime. Fixes: b95ec7eb3b4d ("net: sched: cls_flower: implement chain templates") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit a6bcfc89694ed8cb482a82cdc8b93aae63a8b691 Author: Li RongQing Date: Fri Aug 3 15:45:21 2018 +0800 net: check extack._msg before print dev_set_mtu_ext is able to fail with a valid mtu value, at that condition, extack._msg is not set and random since it is in stack, then kernel will crash when print it. Fixes: 7a4c53bee3324a ("net: report invalid mtu value via netlink extack") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing Signed-off-by: David S. Miller commit 0ed4229b08c13c84a3c301a08defdc9e7f4467e6 Author: Florian Westphal Date: Fri Aug 3 02:22:20 2018 +0200 ipv6: defrag: drop non-last frags smaller than min mtu don't bother with pathological cases, they only waste cycles. IPv6 requires a minimum MTU of 1280 so we should never see fragments smaller than this (except last frag). v3: don't use awkward "-offset + len" v2: drop IPv4 part, which added same check w. IPV4_MIN_MTU (68). There were concerns that there could be even smaller frags generated by intermediate nodes, e.g. on radio networks. Cc: Peter Oskolkov Cc: Eric Dumazet Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit c30f1fc041b74ecdb072dd44f858750414b8b19f Merge: cfb4099fb4c1 fa0f527358bd Author: David S. Miller Date: Sun Aug 5 17:16:46 2018 -0700 Merge branch 'ip-Use-rb-trees-for-IP-frag-queue' Peter Oskolkov says: ==================== ip: Use rb trees for IP frag queue. This patchset * changes IPv4 defrag behavior to match that of IPv6: overlapping fragments now cause the whole IP datagram to be discarded (suggested by David Miller): there are no legitimate use cases for overlapping fragments; * changes IPv4 defrag queue from a list to a rb tree (suggested by Eric Dumazet): this change removes a potential attach vector. Upcoming patches will contain similar changes for IPv6 frag queue, as well as a comprehensive IP defrag self-test (temporarily delayed). ==================== Signed-off-by: David S. Miller commit fa0f527358bd900ef92f925878ed6bfbd51305cc Author: Peter Oskolkov Date: Thu Aug 2 23:34:39 2018 +0000 ip: use rb trees for IP frag queue. Similar to TCP OOO RX queue, it makes sense to use rb trees to store IP fragments, so that OOO fragments are inserted faster. Tested: - a follow-up patch contains a rather comprehensive ip defrag self-test (functional) - ran neper `udp_stream -c -H -F 100 -l 300 -T 20`: netstat --statistics Ip: 282078937 total packets received 0 forwarded 0 incoming packets discarded 946760 incoming packets delivered 18743456 requests sent out 101 fragments dropped after timeout 282077129 reassemblies required 944952 packets reassembled ok 262734239 packet reassembles failed (The numbers/stats above are somewhat better re: reassemblies vs a kernel without this patchset. More comprehensive performance testing TBD). Reported-by: Jann Horn Reported-by: Juha-Matti Tilli Suggested-by: Eric Dumazet Signed-off-by: Peter Oskolkov Signed-off-by: Eric Dumazet Cc: Florian Westphal Signed-off-by: David S. Miller commit 385114dec8a49b5e5945e77ba7de6356106713f4 Author: Peter Oskolkov Date: Thu Aug 2 23:34:38 2018 +0000 net: modify skb_rbtree_purge to return the truesize of all purged skbs. Tested: see the next patch is the series. Suggested-by: Eric Dumazet Signed-off-by: Peter Oskolkov Signed-off-by: Eric Dumazet Cc: Florian Westphal Signed-off-by: David S. Miller commit 7969e5c40dfd04799d4341f1b7cd266b6e47f227 Author: Peter Oskolkov Date: Thu Aug 2 23:34:37 2018 +0000 ip: discard IPv4 datagrams with overlapping segments. This behavior is required in IPv6, and there is little need to tolerate overlapping fragments in IPv4. This change simplifies the code and eliminates potential DDoS attack vectors. Tested: ran ip_defrag selftest (not yet available uptream). Suggested-by: David S. Miller Signed-off-by: Peter Oskolkov Signed-off-by: Eric Dumazet Cc: Florian Westphal Acked-by: Stephen Hemminger Signed-off-by: David S. Miller commit cfb4099fb4c101dad283a163c9525240ef4a1a99 Author: Vakul Garg Date: Thu Aug 2 20:43:10 2018 +0530 net/tls: Mark the end in scatterlist table Function zerocopy_from_iter() unmarks the 'end' in input sgtable while adding new entries in it. The last entry in sgtable remained unmarked. This results in KASAN error report on using apis like sg_nents(). Before returning, the function needs to mark the 'end' in the last entry it adds. Signed-off-by: Vakul Garg Acked-by: Dave Watson Signed-off-by: David S. Miller commit 5f379ef51bc967567bbddacdcdecb772d4d7c3b3 Author: Georg Kohmann Date: Thu Aug 2 13:56:58 2018 +0200 ipv6: icmp: Updating pmtu for link local route When a ICMPV6_PKT_TOOBIG is received from a link local address the pmtu will be updated on a route with an arbitrary interface index. Subsequent packets sent back to the same link local address may therefore end up not considering the updated pmtu. Current behavior breaks TAHI v6LC4.1.4 Reduce PMTU On-link. Referring to RFC 1981: Section 3: "Note that Path MTU Discovery must be performed even in cases where a node "thinks" a destination is attached to the same link as itself. In a situation such as when a neighboring router acts as proxy [ND] for some destination, the destination can to appear to be directly connected but is in fact more than one hop away." Using the interface index from the incoming ICMPV6_PKT_TOOBIG when updating the pmtu. Signed-off-by: Georg Kohmann Signed-off-by: David S. Miller commit 91305f2812624c0cf7ccbb44133b66d3b24676e4 Author: Yangbo Lu Date: Wed Aug 1 18:05:54 2018 +0800 ptp_qoriq: support automatic configuration for ptp timer This patch is to support automatic configuration for ptp timer. If required ptp dts properties are not provided, driver could try to calculate a set of default configurations to initialize the ptp timer. This makes the driver work for many boards which don't have the required ptp dts properties in current kernel. Also the users could set dts properties by themselves according to their requirement. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit a16b5da54d1f3a06df642b866779358fc64d00e2 Author: Yangbo Lu Date: Wed Aug 1 18:05:53 2018 +0800 powerpc/mpc85xx: add clocks property for fman ptp timer node This patch is to add clocks property for fman ptp timer node. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit f63421a70f9e7d6dac6ec06b4d9f7cf516f8a885 Author: Yangbo Lu Date: Wed Aug 1 18:05:52 2018 +0800 arm64: dts: fsl: add clocks property for fman ptp timer node This patch is to add clocks property for fman ptp timer node. Signed-off-by: Yangbo Lu Signed-off-by: David S. Miller commit c595be94c7b93ffdd2ed635b115dd2e6e8472f4c Merge: 074fb8801667 aabfc016e9a6 Author: David S. Miller Date: Sun Aug 5 17:08:27 2018 -0700 Merge branch 'bnxt_en-Updates-for-net-next' Michael Chan says: ==================== bnxt_en: Updates for net-next. This series includes the usual firmware spec update. The driver has added external phy loopback test and phy setup retry logic that is needed during hotplug. In the SRIOV space, the driver has added a new VF resource allocation mode that requires the VF driver to reserve resources during IFUP. IF state changes are now propagated to firmware so that firmware can release some resources during IFDOWN. ethtool method to get firmware core dump and hwmon temperature reading have been added. DSCP to user priority support has been added to the driver's DCBNL interface, and the CoS queue logic has been refined to make sure that the special RDMA Congestion Notification hardware CoS queue will not be used for networking traffic. ==================== Signed-off-by: David S. Miller commit aabfc016e9a6db2a8c2da815fc84bfd5a2e8d221 Author: Michael Chan Date: Sun Aug 5 16:51:58 2018 -0400 bnxt_en: Do not use the CNP CoS queue for networking traffic. The CNP CoS queue is reserved for internal RDMA Congestion Notification Packets (CNP) and should not be used for a TC. Modify the CoS queue discovery code to skip over the CNP CoS queue and to reduce bp->max_tc accordingly. However, if RDMA is disabled in NVRAM, the the CNP CoS queue can be used for a TC. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit afdc8a84844a2163e25ad735f9f69d220ae02529 Author: Michael Chan Date: Sun Aug 5 16:51:57 2018 -0400 bnxt_en: Add DCBNL DSCP application protocol support. Expand the .ieee_setapp() and ieee_delapp() DCBNL methods to support DSCP. This allows DSCP values to user priority mappings instead of using VLAN priorities. Each DSCP mapping is added or deleted one entry at a time using the firmware API. The firmware call can only be made from a PF. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit cde49a42a9bbba18d7f33550fd70037930c14e97 Author: Vasundhara Volam Date: Sun Aug 5 16:51:56 2018 -0400 bnxt_en: Add hwmon sysfs support to read temperature Export temperature sensor reading via hwmon sysfs. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 25e1acd6b92bde36c03273d883c44c4d0e8995e6 Author: Michael Chan Date: Sun Aug 5 16:51:55 2018 -0400 bnxt_en: Notify firmware about IF state changes. Use latest firmware API to notify firmware about IF state changes. Firmware has the option to clean up resources during IF down and to require the driver to reserve resources again during IF up. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 97381a1831124c95801fbfaba8436b4abc7d03f5 Author: Michael Chan Date: Sun Aug 5 16:51:54 2018 -0400 bnxt_en: Move firmware related flags to a new fw_cap field in struct bnxt. The flags field is almost getting full. Move firmware capability flags to a new fw_cap field to better organize these firmware flags. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit f1ca94de0d8760726dc615e8b4f9801f7ad9cf3b Author: Michael Chan Date: Sun Aug 5 16:51:53 2018 -0400 bnxt_en: Add BNXT_NEW_RM() macro. The BNXT_FLAG_NEW_RM flag is checked a lot in the code to determine if the new resource manager is in effect. Define a macro to perform this check. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 6c5657d085ae8c13a8565b98e6a23fe68f0bede4 Author: Vasundhara Volam Date: Sun Aug 5 16:51:52 2018 -0400 bnxt_en: Add support for ethtool get dump. Add support to collect live firmware coredump via ethtool. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 50f011b63d8caab7f40de52ca6cf4807aea7a941 Author: Michael Chan Date: Sun Aug 5 16:51:51 2018 -0400 bnxt_en: Update RSS setup and GRO-HW logic according to the latest spec. Set the default hash mode flag in HWRM_VNIC_RSS_CFG to signal to the firmware that the driver is compliant with the latest spec. With that, the firmware can return expanded RSS profile IDs that the driver checks to setup the proper gso_type for GRO-HW packets. But instead of checking for the new profile IDs, we check the IP_TYPE flag in TPA_START which is more straight forward than checking a list of profile IDs. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit bf82736da3c376c03a42c74ea6fa971e89740d7a Author: Michael Chan Date: Sun Aug 5 16:51:50 2018 -0400 bnxt_en: Add new VF resource allocation strategy mode. The new mode is "minimal-static" to be used when resources are more limited to support a large number of VFs, for example The PF driver will provision guaranteed minimum resources of 0. Each VF has no guranteed resources until it tries to reserve resources during device open. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit a1ef4a7920549d015128a8a49d7c9e654d197c98 Author: Michael Chan Date: Sun Aug 5 16:51:49 2018 -0400 bnxt_en: Add PHY retry logic. During hotplug, the driver's open function can be called almost immediately after power on reset. The PHY may not be ready and the firmware may return failure when the driver tries to update PHY settings. Add retry logic fired from the driver's timer to retry the operation for 5 seconds. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 55fd0cf320c3051f8dcb88c07ddd1e4c54b82cba Author: Michael Chan Date: Sun Aug 5 16:51:48 2018 -0400 bnxt_en: Add external loopback test to ethtool selftest. Add code to detect firmware support for external loopback and the extra test entry for external loopback. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit e795892e93b6ccbda7e0f0fc476d0d4629b44f84 Author: Michael Chan Date: Sun Aug 5 16:51:47 2018 -0400 bnxt_en: Adjust timer based on ethtool stats-block-usecs settings. The driver gathers statistics using 2 mechanisms. Some stats are DMA'ed directly from hardware and others are polled from the driver's timer. Currently, we only adjust the DMA frequency based on the ethtool stats-block-usecs setting. This patch adjusts the driver's timer frequency as well to make everything consistent. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 6fc92c33854b7844745ce424e1cb8029c06d1cf1 Author: Michael Chan Date: Sun Aug 5 16:51:46 2018 -0400 bnxt_en: Update firmware interface version to 1.9.2.25. New interface has firmware core dump support, new extended port statistics, and IF state change notifications to the firmware. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 074fb8801667add0b63083af90a3af6edca9532c Merge: c1c8626fcebe 483f3fdcc70b Author: David S. Miller Date: Sun Aug 5 16:25:22 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for your net-next tree: 1) Support for transparent proxying for nf_tables, from Mate Eckl. 2) Patchset to add OS passive fingerprint recognition for nf_tables, from Fernando Fernandez. This takes common code from xt_osf and place it into the new nfnetlink_osf module for codebase sharing. 3) Lightweight tunneling support for nf_tables. 4) meta and lookup are likely going to be used in rulesets, make them direct calls. From Florian Westphal. A bunch of incremental updates: 5) use PTR_ERR_OR_ZERO() from nft_numgen, from YueHaibing. 6) Use kvmalloc_array() to allocate hashtables, from Li RongQing. 7) Explicit dependencies between nfnetlink_cttimeout and conntrack timeout extensions, from Harsha Sharma. 8) Simplify NLM_F_CREATE handling in nf_tables. 9) Removed unused variable in the get element command, from YueHaibing. 10) Expose bridge hook priorities through uapi, from Mate Eckl. And a few fixes for previous Netfilter batch for net-next: 11) Use per-netns mutex from flowtable event, from Florian Westphal. 12) Remove explicit dependency on iptables CT target from conntrack zones, from Florian. 13) Fix use-after-free in rmmod nf_conntrack path, also from Florian. ==================== Signed-off-by: David S. Miller commit 379d98ddf41344273d9718556f761420f4dc80b3 Author: Alistair Strachan Date: Fri Aug 3 10:39:31 2018 -0700 x86: vdso: Use $LD instead of $CC to link The vdso{32,64}.so can fail to link with CC=clang when clang tries to find a suitable GCC toolchain to link these libraries with. /usr/bin/ld: arch/x86/entry/vdso/vclock_gettime.o: access beyond end of merged section (782) This happens because the host environment leaked into the cross compiler environment due to the way clang searches for suitable GCC toolchains. Clang is a retargetable compiler, and each invocation of it must provide --target= --gcc-toolchain= to allow it to find the correct binutils for cross compilation. These flags had been added to KBUILD_CFLAGS, but the vdso code uses CC and not KBUILD_CFLAGS (for various reasons) which breaks clang's ability to find the correct linker when cross compiling. Most of the time this goes unnoticed because the host linker is new enough to work anyway, or is incompatible and skipped, but this cannot be reliably assumed. This change alters the vdso makefile to just use LD directly, which bypasses clang and thus the searching problem. The makefile will just use ${CROSS_COMPILE}ld instead, which is always what we want. This matches the method used to link vmlinux. This drops references to DISABLE_LTO; this option doesn't seem to be set anywhere, and not knowing what its possible values are, it's not clear how to convert it from CC to LD flag. Signed-off-by: Alistair Strachan Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Cc: "H. Peter Anvin" Cc: Greg Kroah-Hartman Cc: kernel-team@android.com Cc: joel@joelfernandes.org Cc: Andi Kleen Link: https://lkml.kernel.org/r/20180803173931.117515-1-astrachan@google.com commit 208cbb32558907f68b3b2a081ca2337ac3744794 Author: Nick Desaulniers Date: Fri Aug 3 10:05:50 2018 -0700 x86/irqflags: Provide a declaration for native_save_fl It was reported that the commit d0a8d9378d16 is causing users of gcc < 4.9 to observe -Werror=missing-prototypes errors. Indeed, it seems that: extern inline unsigned long native_save_fl(void) { return 0; } compiled with -Werror=missing-prototypes produces this warning in gcc < 4.9, but not gcc >= 4.9. Fixes: d0a8d9378d16 ("x86/paravirt: Make native_save_fl() extern inline"). Reported-by: David Laight Reported-by: Jean Delvare Signed-off-by: Nick Desaulniers Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Cc: jgross@suse.com Cc: kstewart@linuxfoundation.org Cc: gregkh@linuxfoundation.org Cc: boris.ostrovsky@oracle.com Cc: astrachan@google.com Cc: mka@chromium.org Cc: arnd@arndb.de Cc: tstellar@redhat.com Cc: sedat.dilek@gmail.com Cc: David.Laight@aculab.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180803170550.164688-1-ndesaulniers@google.com commit 6ea2738e0ca0e626c75202fb051c1e88d7a950fa Author: Dave Hansen Date: Thu Aug 2 15:58:29 2018 -0700 x86/mm/init: Add helper for freeing kernel image pages When chunks of the kernel image are freed, free_init_pages() is used directly. Consolidate the three sites that do this. Also update the string to give an incrementally better description of that memory versus what was there before. Signed-off-by: Dave Hansen Signed-off-by: Thomas Gleixner Cc: keescook@google.com Cc: aarcange@redhat.com Cc: jgross@suse.com Cc: jpoimboe@redhat.com Cc: gregkh@linuxfoundation.org Cc: peterz@infradead.org Cc: hughd@google.com Cc: torvalds@linux-foundation.org Cc: bp@alien8.de Cc: luto@kernel.org Cc: ak@linux.intel.com Cc: Kees Cook Cc: Andrea Arcangeli Cc: Juergen Gross Cc: Josh Poimboeuf Cc: Greg Kroah-Hartman Cc: Peter Zijlstra Cc: Hugh Dickins Cc: Linus Torvalds Cc: Borislav Petkov Cc: Andy Lutomirski Cc: Andi Kleen Link: https://lkml.kernel.org/r/20180802225829.FE0E32EA@viggo.jf.intel.com commit 9f515cdb411ef34f1aaf4c40bb0c932cf6db5de1 Author: Dave Hansen Date: Thu Aug 2 15:58:28 2018 -0700 x86/mm/init: Pass unconverted symbol addresses to free_init_pages() The x86 code has several places where it frees parts of kernel image: 1. Unused SMP alternative 2. __init code 3. The hole between text and rodata 4. The hole between rodata and data We call free_init_pages() to do this. Strangely, we convert the symbol addresses to kernel direct map addresses in some cases (#3, #4) but not others (#1, #2). The virt_to_page() and the other code in free_reserved_area() now works fine for for symbol addresses on x86, so don't bother converting the addresses to direct map addresses before freeing them. Signed-off-by: Dave Hansen Signed-off-by: Thomas Gleixner Cc: keescook@google.com Cc: aarcange@redhat.com Cc: jgross@suse.com Cc: jpoimboe@redhat.com Cc: gregkh@linuxfoundation.org Cc: peterz@infradead.org Cc: hughd@google.com Cc: torvalds@linux-foundation.org Cc: bp@alien8.de Cc: luto@kernel.org Cc: ak@linux.intel.com Cc: Kees Cook Cc: Andrea Arcangeli Cc: Juergen Gross Cc: Josh Poimboeuf Cc: Greg Kroah-Hartman Cc: Peter Zijlstra Cc: Hugh Dickins Cc: Linus Torvalds Cc: Borislav Petkov Cc: Andy Lutomirski Cc: Andi Kleen Link: https://lkml.kernel.org/r/20180802225828.89B2D0E2@viggo.jf.intel.com commit 0d83432811f26871295a9bc24d3c387924da6071 Author: Dave Hansen Date: Thu Aug 2 15:58:26 2018 -0700 mm: Allow non-direct-map arguments to free_reserved_area() free_reserved_area() takes pointers as arguments to show which addresses should be freed. However, it does this in a somewhat ambiguous way. If it gets a kernel direct map address, it always works. However, if it gets an address that is part of the kernel image alias mapping, it can fail. It fails if all of the following happen: * The specified address is part of the kernel image alias * Poisoning is requested (forcing a memset()) * The address is in a read-only portion of the kernel image The memset() fails on the read-only mapping, of course. free_reserved_area() *is* called both on the direct map and on kernel image alias addresses. We've just lucked out thus far that the kernel image alias areas it gets used on are read-write. I'm fairly sure this has been just a happy accident. It is quite easy to make free_reserved_area() work for all cases: just convert the address to a direct map address before doing the memset(), and do this unconditionally. There is little chance of a regression here because we previously did a virt_to_page() on the address for the memset, so we know these are not highmem pages for which virt_to_page() would fail. Signed-off-by: Dave Hansen Signed-off-by: Thomas Gleixner Cc: keescook@google.com Cc: aarcange@redhat.com Cc: jgross@suse.com Cc: jpoimboe@redhat.com Cc: gregkh@linuxfoundation.org Cc: peterz@infradead.org Cc: hughd@google.com Cc: torvalds@linux-foundation.org Cc: bp@alien8.de Cc: luto@kernel.org Cc: ak@linux.intel.com Cc: Kees Cook Cc: Andrea Arcangeli Cc: Juergen Gross Cc: Josh Poimboeuf Cc: Greg Kroah-Hartman Cc: Peter Zijlstra Cc: Hugh Dickins Cc: Linus Torvalds Cc: Borislav Petkov Cc: Andy Lutomirski Cc: Andi Kleen Link: https://lkml.kernel.org/r/20180802225826.1287AE3E@viggo.jf.intel.com commit eac7073aa69aa1cac819aa712146284f53f642b1 Author: Dave Hansen Date: Thu Aug 2 15:58:25 2018 -0700 x86/mm/pti: Clear Global bit more aggressively The kernel image starts out with the Global bit set across the entire kernel image. The bit is cleared with set_memory_nonglobal() in the configurations with PCIDs where the performance benefits of the Global bit are not needed. However, this is fragile. It means that we are stuck opting *out* of the less-secure (Global bit set) configuration, which seems backwards. Let's start more secure (Global bit clear) and then let things opt back in if they want performance, or are truly mapping common data between kernel and userspace. This fixes a bug. Before this patch, there are areas that are unmapped from the user page tables (like like everything above 0xffffffff82600000 in the example below). These have the hallmark of being a wrong Global area: they are not identical in the 'current_kernel' and 'current_user' page table dumps. They are also read-write, which means they're much more likely to contain secrets. Before this patch: current_kernel:---[ High Kernel Mapping ]--- current_kernel-0xffffffff80000000-0xffffffff81000000 16M pmd current_kernel-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd current_kernel-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte current_kernel-0xffffffff81e11000-0xffffffff82000000 1980K RW GLB NX pte current_kernel-0xffffffff82000000-0xffffffff82600000 6M ro PSE GLB NX pmd current_kernel-0xffffffff82600000-0xffffffff82c00000 6M RW PSE GLB NX pmd current_kernel-0xffffffff82c00000-0xffffffff82e00000 2M RW GLB NX pte current_kernel-0xffffffff82e00000-0xffffffff83200000 4M RW PSE GLB NX pmd current_kernel-0xffffffff83200000-0xffffffffa0000000 462M pmd current_user:---[ High Kernel Mapping ]--- current_user-0xffffffff80000000-0xffffffff81000000 16M pmd current_user-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd current_user-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte current_user-0xffffffff81e11000-0xffffffff82000000 1980K RW GLB NX pte current_user-0xffffffff82000000-0xffffffff82600000 6M ro PSE GLB NX pmd current_user-0xffffffff82600000-0xffffffffa0000000 474M pmd After this patch: current_kernel:---[ High Kernel Mapping ]--- current_kernel-0xffffffff80000000-0xffffffff81000000 16M pmd current_kernel-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd current_kernel-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte current_kernel-0xffffffff81e11000-0xffffffff82000000 1980K RW NX pte current_kernel-0xffffffff82000000-0xffffffff82600000 6M ro PSE GLB NX pmd current_kernel-0xffffffff82600000-0xffffffff82c00000 6M RW PSE NX pmd current_kernel-0xffffffff82c00000-0xffffffff82e00000 2M RW NX pte current_kernel-0xffffffff82e00000-0xffffffff83200000 4M RW PSE NX pmd current_kernel-0xffffffff83200000-0xffffffffa0000000 462M pmd current_user:---[ High Kernel Mapping ]--- current_user-0xffffffff80000000-0xffffffff81000000 16M pmd current_user-0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd current_user-0xffffffff81e00000-0xffffffff81e11000 68K ro GLB x pte current_user-0xffffffff81e11000-0xffffffff82000000 1980K RW NX pte current_user-0xffffffff82000000-0xffffffff82600000 6M ro PSE GLB NX pmd current_user-0xffffffff82600000-0xffffffffa0000000 474M pmd Fixes: 0f561fce4d69 ("x86/pti: Enable global pages for shared areas") Reported-by: Hugh Dickins Signed-off-by: Dave Hansen Signed-off-by: Thomas Gleixner Cc: keescook@google.com Cc: aarcange@redhat.com Cc: jgross@suse.com Cc: jpoimboe@redhat.com Cc: gregkh@linuxfoundation.org Cc: peterz@infradead.org Cc: torvalds@linux-foundation.org Cc: bp@alien8.de Cc: luto@kernel.org Cc: ak@linux.intel.com Cc: Kees Cook Cc: Andrea Arcangeli Cc: Juergen Gross Cc: Josh Poimboeuf Cc: Greg Kroah-Hartman Cc: Peter Zijlstra Cc: Linus Torvalds Cc: Borislav Petkov Cc: Andy Lutomirski Cc: Andi Kleen Link: https://lkml.kernel.org/r/20180802225825.A100C071@viggo.jf.intel.com commit c1c8626fcebed467184ffd8de0ab5c9f9d9c3594 Merge: d89d41556141 1ffaddd029c8 Author: David S. Miller Date: Sun Aug 5 13:04:31 2018 -0700 Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net Lots of overlapping changes, mostly trivial in nature. The mlxsw conflict was resolving using the example resolution at: https://github.com/jpirko/linux_mlxsw/blob/combined_queue/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c Signed-off-by: David S. Miller commit cfd355145c32bb7ccb65fccbe2d67280dc2119e1 Author: Prasad Sodagudi Date: Fri Aug 3 13:56:06 2018 -0700 stop_machine: Atomically queue and wake stopper threads When cpu_stop_queue_work() releases the lock for the stopper thread that was queued into its wake queue, preemption is enabled, which leads to the following deadlock: CPU0 CPU1 sched_setaffinity(0, ...) __set_cpus_allowed_ptr() stop_one_cpu(0, ...) stop_two_cpus(0, 1, ...) cpu_stop_queue_work(0, ...) cpu_stop_queue_two_works(0, ..., 1, ...) -grabs lock for migration/0- -spins with preemption disabled, waiting for migration/0's lock to be released- -adds work items for migration/0 and queues migration/0 to its wake_q- -releases lock for migration/0 and preemption is enabled- -current thread is preempted, and __set_cpus_allowed_ptr has changed the thread's cpu allowed mask to CPU1 only- -acquires migration/0 and migration/1's locks- -adds work for migration/0 but does not add migration/0 to wake_q, since it is already in a wake_q- -adds work for migration/1 and adds migration/1 to its wake_q- -releases migration/0 and migration/1's locks, wakes migration/1, and enables preemption- -since migration/1 is requested to run, migration/1 begins to run and waits on migration/0, but migration/0 will never be able to run, since the thread that can wake it is affine to CPU1- Disable preemption in cpu_stop_queue_work() before queueing works for stopper threads, and queueing the stopper thread in the wake queue, to ensure that the operation of queueing the works and waking the stopper threads is atomic. Fixes: 0b26351b910f ("stop_machine, sched: Fix migrate_swap() vs. active_balance() deadlock") Signed-off-by: Prasad Sodagudi Signed-off-by: Isaac J. Manjarres Signed-off-by: Thomas Gleixner Cc: peterz@infradead.org Cc: matt@codeblueprint.co.uk Cc: bigeasy@linutronix.de Cc: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1533329766-4856-1-git-send-email-isaacm@codeaurora.org Co-Developed-by: Isaac J. Manjarres commit 7964410fcf135d7e76deef4e475816ec02482f7b Author: Gustavo A. R. Silva Date: Wed Aug 1 19:39:05 2018 -0500 fs: dcache: Use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Al Viro commit 808aa6c5e34a25213bff4d80d3cdb588752879dd Merge: 1401a0fc2d47 e876c445df40 Author: Al Viro Date: Sun Aug 5 15:51:10 2018 -0400 Merge branch 'work.hpfs' into work.lookup commit 1401a0fc2d47988677dc1dbfd56ff89daa323717 Author: Al Viro Date: Sun Jun 24 10:45:44 2018 -0400 afs_try_auto_mntpt(): return NULL instead of ERR_PTR(-ENOENT) simpler logics in callers that way Acked-by: David Howells Signed-off-by: Al Viro commit 34b2a88fb4aa4de34e1d5f9fc2761b746980f9b1 Author: Al Viro Date: Sun Jun 24 10:43:51 2018 -0400 afs_lookup(): switch to d_splice_alias() ->lookup() methods can (and should) use d_splice_alias() instead of d_add(). Even if they are not going to be hit by open_by_handle(), code does get copied around; besides, d_splice_alias() has better calling conventions for use in ->lookup(), so the code gets simpler. Acked-by: David Howells Signed-off-by: Al Viro commit 855371bd01b4cd8cf0e2b8ca172a5c30a481f963 Author: Al Viro Date: Sat Jun 23 20:48:31 2018 -0400 afs: switch dynroot lookups to d_splice_alias() ->lookup() methods can (and should) use d_splice_alias() instead of d_add(). Even if they are not going to be hit by open_by_handle(), code does get copied around... Acked-by: David Howells Signed-off-by: Al Viro commit 2bc7596438aba6d9eacc4fdfac8dd8b22ae4a267 Author: Kristaps Čivkulis Date: Sun Aug 5 18:21:01 2018 +0300 staging: erofs: fix if assignment style issue Fix coding style issue "do not use assignment in if condition" detected by checkpatch.pl. Signed-off-by: Kristaps Čivkulis Reviewed-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 56e40eb6d656194e55ce2012fee9d5a496270aaa Author: Alexandru Gagniuc Date: Sat Aug 4 11:44:44 2018 -0500 ALSA: hda/realtek - Add mute LED quirk for HP Spectre x360 This device has the same issues as the HP x360 wrt the MUTE LED and the front speakers not working. This patch fixes the MUTE LED issue, but doesn't touch the HDA verbs. The fix for the x360 does not work on the Spectre. Signed-off-by: Alexandru Gagniuc Signed-off-by: Takashi Iwai commit 5b76a3cff011df2dcb6186c965a2e4d809a05ad4 Author: Paolo Bonzini Date: Sun Aug 5 16:07:47 2018 +0200 KVM: VMX: Tell the nested hypervisor to skip L1D flush on vmentry When nested virtualization is in use, VMENTER operations from the nested hypervisor into the nested guest will always be processed by the bare metal hypervisor, and KVM's "conditional cache flushes" mode in particular does a flush on nested vmentry. Therefore, include the "skip L1D flush on vmentry" bit in KVM's suggested ARCH_CAPABILITIES setting. Add the relevant Documentation. Signed-off-by: Paolo Bonzini Signed-off-by: Thomas Gleixner commit 8e0b2b916662e09dd4d09e5271cdf214c6b80e62 Author: Paolo Bonzini Date: Sun Aug 5 16:07:46 2018 +0200 x86/speculation: Use ARCH_CAPABILITIES to skip L1D flush on vmentry Bit 3 of ARCH_CAPABILITIES tells a hypervisor that L1D flush on vmentry is not needed. Add a new value to enum vmx_l1d_flush_state, which is used either if there is no L1TF bug at all, or if bit 3 is set in ARCH_CAPABILITIES. Signed-off-by: Paolo Bonzini Signed-off-by: Thomas Gleixner commit ea156d192f5257a5bf393d33910d3b481bf8a401 Author: Paolo Bonzini Date: Sun Aug 5 16:07:45 2018 +0200 x86/speculation: Simplify sysfs report of VMX L1TF vulnerability Three changes to the content of the sysfs file: - If EPT is disabled, L1TF cannot be exploited even across threads on the same core, and SMT is irrelevant. - If mitigation is completely disabled, and SMT is enabled, print "vulnerable" instead of "vulnerable, SMT vulnerable" - Reorder the two parts so that the main vulnerability state comes first and the detail on SMT is second. Signed-off-by: Paolo Bonzini Signed-off-by: Thomas Gleixner commit 58331136136935c631c2b5f06daf4c3006416e91 Author: Thomas Gleixner Date: Sun Aug 5 17:06:12 2018 +0200 Documentation/l1tf: Remove Yonah processors from not vulnerable list Dave reported, that it's not confirmed that Yonah processors are unaffected. Remove them from the list. Reported-by: ave Hansen Signed-off-by: Thomas Gleixner commit f2701b77bbd992f3df4631de8493f21db0830452 Merge: 18b57ce2eb8c acb1872577b3 Author: Thomas Gleixner Date: Sun Aug 5 16:39:29 2018 +0200 Merge 4.18-rc7 into master to pick up the KVM dependcy Signed-off-by: Thomas Gleixner commit a39284ae9d2ad09975c8ae33f1bd0f05fbfbf6ee Author: Dan Carpenter Date: Thu Aug 2 11:42:22 2018 +0300 misc: mic: SCIF Fix scif_get_new_port() error handling There are only 2 callers of scif_get_new_port() and both appear to get the error handling wrong. Both treat zero returns as error, but it actually returns negative error codes and >= 0 on success. Fixes: e9089f43c9a7 ("misc: mic: SCIF open close bind and listen APIs") Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 0171114210c7a3181f64118b0372b0eae2b57649 Author: Parth Y Shah Date: Fri Aug 3 15:50:38 2018 +0530 misc: cxl: changed asterisk position Resolved <"foo* bar" should be "foo *bar"> error Signed-off-by: Parth Y Shah Signed-off-by: Greg Kroah-Hartman commit 7a92719356cac8fef100a8a92e64b583f39368d2 Author: Gustavo A. R. Silva Date: Sat Aug 4 19:37:03 2018 -0500 genwqe: card_base: Use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman commit b83a4141f025388fd1edeaa48789e3e166e95c7a Author: Parth Y Shah Date: Fri Aug 3 14:50:43 2018 +0530 misc: eeprom: assignment outside the if statement Assignment of any variable should be kept outside the if statement Signed-off-by: Parth Y Shah Reviewed-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman commit 1061bdba2fc395e4738315782655dd9b477b1f9f Author: Michael Straube Date: Sat Aug 4 16:35:43 2018 +0200 staging: rtl8188eu: remove unnecessary includes In the header rtw_iol.h there is only one function declared. Remove the include of rtw_iol.h from files that do not use this function. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit b5c7af4139f45495779257588ee87aaea6c1a60a Author: Michael Straube Date: Sat Aug 4 16:35:42 2018 +0200 staging: rtl8188eu: remove redundant include The header osdep_service.h is included from drv_types.h, so remove the redundant include. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 5eb438c9d23622595f6d599e33b11f179d50c3a6 Author: Michael Straube Date: Sat Aug 4 16:35:41 2018 +0200 staging: rtl8188eu: remove unnecessary parentheses Remove unnecessary parentheses from if conditions. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit ac588ce4b5163199455b3dd8fa589f5e4eb56152 Author: Michael Straube Date: Sat Aug 4 16:35:40 2018 +0200 staging: rtl8188eu: rename rtw_IOL_applied Rename rtw_IOL_applied to be all lowercase. rtw_IOL_applied -> rtw_iol_applied Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 8e0c18d3a114d4ea37140b8245a0543392743ba7 Author: John Whitmore Date: Sat Aug 4 10:18:59 2018 +0100 staging:rtl8192u: Replace magic number with defined constant - Style Replace the magic number '8' with defined constant which is normally used 'MAX_DEV_ADDR_SIZE'. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3750985c8d365618612fa191035b0fb2641b8c68 Author: John Whitmore Date: Sat Aug 4 10:18:57 2018 +0100 staging:rtl8192u: Remove comments - Style Removal of three comments. The comments in question do not add anything to the understanding of the code, and if they are necessary it would imply that the structure and its member variables are badly named. This is a simple style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4651fb4c4098ce9093db3f6ebcf9373267329436 Author: John Whitmore Date: Sat Aug 4 10:18:56 2018 +0100 staging:rtl8192u: Remove blank line - Style Removal of a blank like which causes a checkpatch issue. This is a simple coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 51606f72a837d3886dab8a77efe1f6d4b291116c Author: John Whitmore Date: Sat Aug 4 10:18:55 2018 +0100 staging:rtl8192u: Rename multiple variables - Style All of the variables used within the structures of the union qos_tclas cause checkpatch issue due to CamelCase naming. As none the member variables are used in code all have been changed on one patch. These changes are coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit e8ac237d4854072c34fc069c8e59b586e31e945c Author: John Whitmore Date: Sat Aug 4 10:18:54 2018 +0100 staging:rtl8192u: Rename types in QOS_TCLAS union - Style Whilst none of the structures inside the qos_tclas union are used, their names conflict with the coding standard being named in uppercase. The names of all five have been changed to lowercase. This is a style change, and since none of the structures are referenced, these changes should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f1c3b4880bdf4f64c3bfb6d122e33b54b17231cd Author: John Whitmore Date: Sat Aug 4 10:18:53 2018 +0100 staging:rtl8192u: Remove typedef and rename QOS_TCLAS - Style Remove the typedef from the union QOS_TCLAS, which causes a checkpatch issue with defining new types. In addition, as a type, the name should be in lowercase so has been changed. These are coding style changes and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 0f79619d70bb1c1fa85f1a2b7dc54080b11532cb Author: John Whitmore Date: Fri Aug 3 01:02:11 2018 +0100 staging:rtl8192u: Clean up of spacing - Style Multiple blank line, which cause an issue with checkpath, have been removed and the spacing of definitions have been aligned to look cleaner. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 1bb6d9b95025c2f86d237fc3504b0dd837a3b0f8 Author: John Whitmore Date: Fri Aug 3 01:02:10 2018 +0100 staging:rtl8192u: Rename Register Constants - Style The four register constants, 'Current_Tx_Rate_Reg', 'Initial_Tx_Rate_Reg', 'Tx_Retry_Count_Reg' and 'RegC38_TH' all cause checkpatch issue with CamelCase naming. The three have been renamed to 'CURRENT_TX_RATE_REG', 'INITIAL_TX_RATE_REG', 'TX_RETRY_COUNT_REG' and 'REG_C38_TH' respectively. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 070c1ce978916b4434b63cb7bb881aaeaa58f2ef Author: John Whitmore Date: Fri Aug 3 01:02:09 2018 +0100 staging:rtl8192u: Rename constants - Style The constants 'VeryLowRSSI' and 'CTSToSelfTHVal' generate warnings from checkpatch due to the use of CamelCase naming. The two constants have been renamed to 'VERY_LOW_RSSI' and 'CTS_TO_SELF_TH_VAL' respectively. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c972be9a7525db60dbc500658ef4d532c70eb3d7 Author: John Whitmore Date: Fri Aug 3 01:02:08 2018 +0100 staging:rtl8192u: Rename constants RateAdaptiveTH_Low_* - Style The two constants, RateAdaptiveTH_Low_20M and RateAdaptiveTH_Low_40M generate a checkpatch warning about CamelCase naming. The two have been renamed to clear this issue. RATE_ADAPTIVE_TH_LOW_20M and RATE_ADAPTIVE_TH_LOW_40M This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 0395a9aad5832a218322cd610afc511b6244decb Author: John Whitmore Date: Fri Aug 3 01:02:07 2018 +0100 staging:rtl8192u: Rename RateAdaptiveTH_High - Style The constant RateAdaptiveTH_High causes a checkpatch issue with respect to CamelCase naming. As a result the constant has been renamed to RATE_ADAPTIVE_TH_HIGH. This is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a7a014961548ba7f33788fad9d54c65c9d970c24 Author: John Whitmore Date: Fri Aug 3 01:02:06 2018 +0100 staging:rtl8192u: Rename DM_DIG_MIN_Netcore - Style The constant DM_DIG_MIN_Netcore causes a checkpatch issue with CamelCase naming so has been renamed to DM_DIG_MIN_NETCORE. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit d3c90eff9c4ed66a9f16db2ef99b75455a850e7b Author: John Whitmore Date: Fri Aug 3 01:02:05 2018 +0100 staging:rtl8192u: Refactor DCMD_TXCMD_T structure - Style The structure DCMD_TXCMD_T is declared with a typedef, which causes a checkpatch issue with defining new types. As a result the typedef has been removed. The structure's name DCMD_TXCMD_T, as a type, is meant to be lowercase so has been renamed to tx_config_cmd. The structures three members, (Op, Length, and Value) are all violating the coding standard policy on CamelCase naming, so have all been renamed. They have been renamed with longer names, (cmd_op, cmd_length and cmd_value), to make the variable names easier to search for in code. The magic numbers '4' and '12' have both been replaced with sizeof() calls, as they both represent the size of data elements. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 447558d26ebb5dde7a368d3ed001915141e77a07 Author: John Whitmore Date: Fri Aug 3 01:02:04 2018 +0100 staging:rtl8192u: Remove member reserved - Style The structure dynamic_rx_path_sel contains a u8 member variable called reserved. This member variable is never actually used in the code. The naming suggests that the sizeof the structure is significant but the only use of the structure is a local static in r8192U_dm.c: static struct dynamic_rx_path_sel DM_RxPathSelTable; There is no apparent significance to the sizeof the declared structure DM_RxPathSelTable. As a result the reserved member variable has been removed from the structure. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 68d84843665cc9d53e08f90537d7be267da7b442 Author: John Whitmore Date: Fri Aug 3 01:02:03 2018 +0100 staging:rtl8192u: Rename member disabledRF - Style Rename the member variable disabledRF to disabled_rf. This change resolves the checkpatch issue with CamelCase naming. The change is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 2a2271e4ac8792e54989fe2109a63bf34914d0f3 Author: John Whitmore Date: Fri Aug 3 01:02:02 2018 +0100 staging:rtl8192u: Remove member diff_TH - Style The member variable diff_TH is assigned a constant value and then used in a comparison. The variable is never changed so the comparison can as easily be performed directly with the defined constant. The member variable has been removed and the defined constant RxPathSelection_diff_TH renamed to RX_PATH_SELECTION_DIFF_TH, to clear the checkpatch issue with CamelCase naming. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f793836c16a56596d4501f87fec85b7dc6366fb5 Author: John Whitmore Date: Fri Aug 3 01:02:01 2018 +0100 staging:rtl8192u: Remove SS_TH_low - Style The member variable SS_TH_low is assigned a constant and then used in a comparison. This member variable is redundant as the constant can be used directly for the comparison. In addition the constant RxPathSelection_SS_TH_low has been renamed to RX_PATH_SELECTION_SS_TH_LOW, to clear the checkpatch issue with CamelCase naming. These changes are coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f19a08e76d09bd12b15faedf1eeacd33c7862dbd Author: John Whitmore Date: Fri Aug 3 01:02:00 2018 +0100 staging:rtl8192u: Rename cck_Rx_path - Style Rename the member variable cck_Rx_path to cck_rx_path. This clears the checkpatch issue with CamelCase naming. This is a coding style change which should have no impact one runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 863108d5a06bb896c8a9912fc669ec13176b306d Author: John Whitmore Date: Fri Aug 3 01:01:59 2018 +0100 staging:rtl8192u: Remove member variable Enable - Style The structure dynamic_rx_path_sel defines a member variable 'Enable' which is initialised and later tested. The variable is however never changed to the test is redundant and the member variable is then never used. The member variable, initialisation and test have all been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 916501c8047c5420f57ff87a41c120007c8a76e7 Author: John Whitmore Date: Fri Aug 3 01:01:58 2018 +0100 staging:rtl8192u: Remove unused extern DM_RxPathSelTable - Style The file r8192U_dm.h defines the structure DM_RxPathSelTable as being external. The structure is however declared in r8192U_dm.c and only used locally in that file. As a result the external definition has been removed and the declaration in r8192U_dm.c changed to being of type static. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f835f4b38300b4798a90c90bfed73b6a4f05053e Author: John Whitmore Date: Fri Aug 3 01:01:57 2018 +0100 staging:rtl8192u: Rename enum constants - Style Rename the two constants defined in the enumerated type enum cck_rx_path_method so that they are both uppercase, as suggested by the coding style. This is purely a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 976a4b90931ff929255652bdfba12eb32ef48b7f Author: John Whitmore Date: Fri Aug 3 01:01:56 2018 +0100 staging:rtl8192u: Remove member initialgain_lowerbound_state - Style The structure 'dig' defines a member variable 'initialgain_lowerbound_state', which although initialised to false, is never used in the code. As a result this unused member variable has been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a2351af9f562a77480ca91c970ea151ceba47c36 Author: John Whitmore Date: Fri Aug 3 01:01:55 2018 +0100 staging:rtl8192u: Remove member variable rx_gain_range_max - Style The structure 'dig' defines a member variable, (rx_gain_range_max) which is initialised to the value 'DM_DIG_MAX', (a defined constant). The variable is then used to test and set another variable. Since the member rx_gain_range_max is never assigned any other value then the constant 'DM_DIG_MAX' the code might as well simply use that constant, rather the a member variable set to that constant. The member variable has been removed and the constant used directly in the code. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8add1eb548d2867d6c82863823ac37f84bf6952d Author: John Whitmore Date: Fri Aug 3 01:01:54 2018 +0100 staging:rtl8192u: Remove debug member from structures - Style Two structures, (struct dig and struct dynamic_rx_path_sel) contain a u8 member variable representing debug setting. In the file r8192U_dm.c these member variables, for both structures, are initialised to an enumerated constant 'DM_DBG_OFF'. The member variables are never assigned another value, other then off. Later in code the member variables are tested to for equality to 'DM_DBG_OFF' and if that is the case an assignment statement is executed. Since the value of the variables is always off the test is redundant and the conditional branch can just be executed without the test. Since the member variables are then actually used both have been removed, along with the enumerated type which defines debug status, on/off. These are coding style changes to remove unused or redundant code, there should be no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5751e4f164c3bc64a7e632b13b14da1d5330853c Author: Ajay Singh Date: Fri Aug 3 16:26:15 2018 +0530 staging: wilc1000: remove TODO item for comments and code style Remove below item from TODO as these changes were included as part of previous submitted patch series. 'rework comments and function headers(also coding style)' Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 2345ef30ea30cdb91f08e54eff3b5e807a0d4cc9 Author: Ajay Singh Date: Fri Aug 3 16:26:14 2018 +0530 staging: wilc1000: replace ISWILC1000() macro with inline function Cleanup patch to avoid below checkpatch issue by replacing the macro with inline function. Macro argument 'id' may be better as '(id)' to avoid precedence issues. Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit e61c7a1caa97b5e90e7dee927231cdd4cc71d434 Author: Ajay Singh Date: Fri Aug 3 16:26:13 2018 +0530 staging: wilc1000: added Microchip copyright notice header Cleanup the copyright notice header from the WILC1000 files. Replace copyright header of 'Atmel' & 'NewportMedia' with 'Microchip & its subsidiaries'. Also added the same copyright notice header for all wilc1000 driver source and header files. Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 515bc432e4a5b597e36d915df9fb3194c7083078 Author: Todd Poynor Date: Thu Aug 2 18:49:52 2018 -0700 Revert "staging: gasket: core: hold reference to pci_dev while used" There's no need to take an additional reference on the pci_dev structure for the pointer copy saved in gasket data structures. This reverts commit: 8dd8a48b9a7d ("staging: gasket: core: hold reference to pci_dev while used") Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit a43a98da75ff2821e484e5cb2a7f3ad0354255c8 Author: Todd Poynor Date: Thu Aug 2 18:49:51 2018 -0700 staging: gasket: core: add subsystem and device info to logs Identify gasket as the subsystem printing various messages. Add the driver name to appropriate messages to indicate which driver has a problem. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 8445a07db8784cfc5b11d7ceebfe698d1ee086ea Author: Todd Poynor Date: Thu Aug 2 18:49:50 2018 -0700 staging: gasket: core: device register debug log cleanups At device/driver registration time, convert a not-very-informative info message to a more informative debug message, drop some not overly helpful debug messages. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 5bf553b671cfab548185ee0b75cc80eda816f81c Author: Todd Poynor Date: Thu Aug 2 18:49:49 2018 -0700 staging: gasket: core: remove registration logs Remove logs for loading gasket drivers. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit a13bb977bca68b2c15a505c60ed6382398ef656d Author: Tim Collier Date: Fri Aug 3 08:44:37 2018 +0100 staging: wlan-ng: remove unused definitions from p80211types.h Remove the following unused definitions from p80211types.h: * struct p80211enum * struct p80211enumpair * struct catlistitem declaration and associated function pointer typedefs (along with preceding block comment) Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit ae3b4ed1a23fc197716c4bcf1e32be37f2472d3b Author: Michael Straube Date: Sun Aug 5 14:11:54 2018 +0200 staging: rtl8188eu: use phydm_regdefine11n.h from rtlwifi Use rtlwifi/phydm/phydm_regdefine11n.h instead of odm_RegDefine11N.h and remove the now unused odm_RegDefine11N.h. The defines from odm_RegDefine11N.h are defined with the same values in rtlwifi/phydm/phydm_regdefine11n.h. There is one define that is named different, but that one is not used in the rtl8188eu code. rtl8188eu: #define ODM_REG_RX_PATH_11N 0xC04 rtlwifi: #defnie ODM_REG_BB_RX_PATH_11N 0xC04 Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit a9df8cd5e3fcd046c20e036073b1f90854b3e863 Author: Sohil Ladhani Date: Sun Aug 5 16:59:55 2018 +0530 Staging: rtlwifi: base: Modified the line ending with a parenthesis This patch fixes the "Lines should not end with a '('" warning reported by checkpatch.pl script. The line containing 'rtl_mrate_idx_to_arfr_id' function previously ended with '(', which did not conform to the linux kernel coding style. Signed-off-by: Sohil Ladhani Signed-off-by: Greg Kroah-Hartman commit 2ec34a4393f1799f1c0fd49afb930e877de27452 Author: Ioana Radulescu Date: Thu Aug 2 12:24:42 2018 -0500 staging: fsl-dpaa2/eth: Use named arguments in function definition Checkpatch complains about unnamed arguments in a function prototype, so fix it. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit bec2dd69696cb163fe31dd40ac7752056e1bcb97 Author: Kees Cook Date: Fri Jun 29 11:48:18 2018 -0700 drm/msm/adreno: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this switches to using a kasprintf()ed buffer. Return paths are updated to free the allocation. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Rob Clark commit 18b57ce2eb8c8b9a24174a89250cf5f57c76ecdc Author: Nicolai Stange Date: Sun Jul 22 13:38:18 2018 +0200 x86/KVM/VMX: Don't set l1tf_flush_l1d from vmx_handle_external_intr() For VMEXITs caused by external interrupts, vmx_handle_external_intr() indirectly calls into the interrupt handlers through the host's IDT. It follows that these interrupts get accounted for in the kvm_cpu_l1tf_flush_l1d per-cpu flag. The subsequently executed vmx_l1d_flush() will thus be aware that some interrupts have happened and conduct a L1d flush anyway. Setting l1tf_flush_l1d from vmx_handle_external_intr() isn't needed anymore. Drop it. Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner commit ffcba43ff66c7dab34ec700debd491d2a4d319b4 Author: Nicolai Stange Date: Sun Jul 29 13:06:04 2018 +0200 x86/irq: Let interrupt handlers set kvm_cpu_l1tf_flush_l1d The last missing piece to having vmx_l1d_flush() take interrupts after VMEXIT into account is to set the kvm_cpu_l1tf_flush_l1d per-cpu flag on irq entry. Issue calls to kvm_set_cpu_l1tf_flush_l1d() from entering_irq(), ipi_entering_ack_irq(), smp_reschedule_interrupt() and uv_bau_message_interrupt(). Suggested-by: Paolo Bonzini Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner commit 447ae316670230d7d29430e2cbf1f5db4f49d14c Author: Nicolai Stange Date: Sun Jul 29 12:15:33 2018 +0200 x86: Don't include linux/irq.h from asm/hardirq.h The next patch in this series will have to make the definition of irq_cpustat_t available to entering_irq(). Inclusion of asm/hardirq.h into asm/apic.h would cause circular header dependencies like asm/smp.h asm/apic.h asm/hardirq.h linux/irq.h linux/topology.h linux/smp.h asm/smp.h or linux/gfp.h linux/mmzone.h asm/mmzone.h asm/mmzone_64.h asm/smp.h asm/apic.h asm/hardirq.h linux/irq.h linux/irqdesc.h linux/kobject.h linux/sysfs.h linux/kernfs.h linux/idr.h linux/gfp.h and others. This causes compilation errors because of the header guards becoming effective in the second inclusion: symbols/macros that had been defined before wouldn't be available to intermediate headers in the #include chain anymore. A possible workaround would be to move the definition of irq_cpustat_t into its own header and include that from both, asm/hardirq.h and asm/apic.h. However, this wouldn't solve the real problem, namely asm/harirq.h unnecessarily pulling in all the linux/irq.h cruft: nothing in asm/hardirq.h itself requires it. Also, note that there are some other archs, like e.g. arm64, which don't have that #include in their asm/hardirq.h. Remove the linux/irq.h #include from x86' asm/hardirq.h. Fix resulting compilation errors by adding appropriate #includes to *.c files as needed. Note that some of these *.c files could be cleaned up a bit wrt. to their set of #includes, but that should better be done from separate patches, if at all. Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner commit 45b575c00d8e72d69d75dd8c112f044b7b01b069 Author: Nicolai Stange Date: Fri Jul 27 13:22:16 2018 +0200 x86/KVM/VMX: Introduce per-host-cpu analogue of l1tf_flush_l1d Part of the L1TF mitigation for vmx includes flushing the L1D cache upon VMENTRY. L1D flushes are costly and two modes of operations are provided to users: "always" and the more selective "conditional" mode. If operating in the latter, the cache would get flushed only if a host side code path considered unconfined had been traversed. "Unconfined" in this context means that it might have pulled in sensitive data like user data or kernel crypto keys. The need for L1D flushes is tracked by means of the per-vcpu flag l1tf_flush_l1d. KVM exit handlers considered unconfined set it. A vmx_l1d_flush() subsequently invoked before the next VMENTER will conduct a L1d flush based on its value and reset that flag again. Currently, interrupts delivered "normally" while in root operation between VMEXIT and VMENTER are not taken into account. Part of the reason is that these don't leave any traces and thus, the vmx code is unable to tell if any such has happened. As proposed by Paolo Bonzini, prepare for tracking all interrupts by introducing a new per-cpu flag, "kvm_cpu_l1tf_flush_l1d". It will be in strong analogy to the per-vcpu ->l1tf_flush_l1d. A later patch will make interrupt handlers set it. For the sake of cache locality, group kvm_cpu_l1tf_flush_l1d into x86' per-cpu irq_cpustat_t as suggested by Peter Zijlstra. Provide the helpers kvm_set_cpu_l1tf_flush_l1d(), kvm_clear_cpu_l1tf_flush_l1d() and kvm_get_cpu_l1tf_flush_l1d(). Make them trivial resp. non-existent for !CONFIG_KVM_INTEL as appropriate. Let vmx_l1d_flush() handle kvm_cpu_l1tf_flush_l1d in the same way as l1tf_flush_l1d. Suggested-by: Paolo Bonzini Suggested-by: Peter Zijlstra Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner Reviewed-by: Paolo Bonzini commit 9aee5f8a7e30330d0a8f4c626dc924ca5590aba5 Author: Nicolai Stange Date: Fri Jul 27 12:46:29 2018 +0200 x86/irq: Demote irq_cpustat_t::__softirq_pending to u16 An upcoming patch will extend KVM's L1TF mitigation in conditional mode to also cover interrupts after VMEXITs. For tracking those, stores to a new per-cpu flag from interrupt handlers will become necessary. In order to improve cache locality, this new flag will be added to x86's irq_cpustat_t. Make some space available there by shrinking the ->softirq_pending bitfield from 32 to 16 bits: the number of bits actually used is only NR_SOFTIRQS, i.e. 10. Suggested-by: Paolo Bonzini Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner Reviewed-by: Paolo Bonzini commit 5b6ccc6c3b1a477fbac9ec97a0b4c1c48e765209 Author: Nicolai Stange Date: Sat Jul 21 22:35:28 2018 +0200 x86/KVM/VMX: Move the l1tf_flush_l1d test to vmx_l1d_flush() Currently, vmx_vcpu_run() checks if l1tf_flush_l1d is set and invokes vmx_l1d_flush() if so. This test is unncessary for the "always flush L1D" mode. Move the check to vmx_l1d_flush()'s conditional mode code path. Notes: - vmx_l1d_flush() is likely to get inlined anyway and thus, there's no extra function call. - This inverts the (static) branch prediction, but there hadn't been any explicit likely()/unlikely() annotations before and so it stays as is. Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner commit 427362a142441f08051369db6fbe7f61c73b3dca Author: Nicolai Stange Date: Sat Jul 21 22:25:00 2018 +0200 x86/KVM/VMX: Replace 'vmx_l1d_flush_always' with 'vmx_l1d_flush_cond' The vmx_l1d_flush_always static key is only ever evaluated if vmx_l1d_should_flush is enabled. In that case however, there are only two L1d flushing modes possible: "always" and "conditional". The "conditional" mode's implementation tends to require more sophisticated logic than the "always" mode. Avoid inverted logic by replacing the 'vmx_l1d_flush_always' static key with a 'vmx_l1d_flush_cond' one. There is no change in functionality. Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner commit 379fd0c7e6a391e5565336a646f19f218fb98c6c Author: Nicolai Stange Date: Sat Jul 21 22:16:56 2018 +0200 x86/KVM/VMX: Don't set l1tf_flush_l1d to true from vmx_l1d_flush() vmx_l1d_flush() gets invoked only if l1tf_flush_l1d is true. There's no point in setting l1tf_flush_l1d to true from there again. Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner commit d89d41556141a527030a15233135ba622ba3350d Author: Florian Fainelli Date: Sat Aug 4 14:20:40 2018 -0700 ethtool: Remove trailing semicolon for static inline Android's header sanitization tool chokes on static inline functions having a trailing semicolon, leading to an incorrectly parsed header file. While the tool should obviously be fixed, also fix the header files for the two affected functions: ethtool_get_flow_spec_ring() and ethtool_get_flow_spec_ring_vf(). Fixes: 8cf6f497de40 ("ethtool: Add helper routines to pass vf to rx_flow_spec") Reporetd-by: Blair Prescott Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 863c37fcb14f8b66ea831b45fb35a53ac4a8d69e Author: zhong jiang Date: Sat Aug 4 17:34:07 2018 -0400 ext4: remove unneeded variable "err" in ext4_mb_release_inode_pa() The err is not used after initalization. So just remove the variable. Signed-off-by: zhong jiang Signed-off-by: Theodore Ts'o commit 7957c2e276ee73e6c6cb1ab69e2372bd095c097a Author: Wolfram Sang Date: Mon Jul 23 22:26:16 2018 +0200 i2c: sh_mobile: use core to detect 'no zero length read' quirk And don't reimplement in the driver. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Signed-off-by: Wolfram Sang commit 6e6664700d2712ca75aecebf8399b2ebc05d505d Author: Wolfram Sang Date: Mon Jul 23 22:26:15 2018 +0200 i2c: xlr: use core to detect 'no zero length' quirk And don't reimplement in the driver. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 3ef3e5cd72aa3b8e31e06825f9ff90f3d1b6a378 Author: Wolfram Sang Date: Mon Jul 23 22:26:14 2018 +0200 i2c: rcar: use core to detect 'no zero length' quirk And don't reimplement in the driver. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Signed-off-by: Wolfram Sang commit 5314355a916aea235968d4c51710a65b7c9811ef Author: Wolfram Sang Date: Mon Jul 23 22:26:11 2018 +0200 i2c: stu300: use core to detect 'no zero length' quirk And don't reimplement in the driver. Signed-off-by: Wolfram Sang Reviewed-by: Linus Walleij Signed-off-by: Wolfram Sang commit 22dda3e4f8219bc502c439277df3a15e9235a7ec Author: Wolfram Sang Date: Mon Jul 23 22:26:09 2018 +0200 i2c: pmcmsp: use core to detect 'no zero length' quirk And don't reimplement in the driver. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit aa14b124702c02154f5719605fe2d8e57e52f383 Author: Wolfram Sang Date: Mon Jul 23 22:26:07 2018 +0200 i2c: mxs: use core to detect 'no zero length' quirk And don't reimplement in the driver. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 40fce5217055317898e7c2f959bf0aee5ebc4351 Author: Wolfram Sang Date: Mon Jul 23 22:26:06 2018 +0200 i2c: designware-master: use core to detect 'no zero length' quirk And don't reimplement in the driver. Signed-off-by: Wolfram Sang Reviewed-by: Andy Shevchenko Tested-by: Jarkko Nikula Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit d9cfe2ce246845b9cca0ec1b881e826965893c58 Author: Wolfram Sang Date: Mon Jul 23 22:26:05 2018 +0200 i2c: quirks: add zero length checks Some adapters do not support a message length of 0. Add this as a quirk so drivers don't have to open code it. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Reviewed-by: Andy Shevchenko Tested-by: Jarkko Nikula Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 6c3711ec64fd23a9abc8aaf59a9429569a6282df Author: Johan Hedberg Date: Sat Aug 4 23:40:26 2018 +0300 Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV This driver was recently updated to use serdev, so add the appropriate dependency. Without this one can get compiler warnings like this if CONFIG_SERIAL_DEV_BUS is not enabled: CC [M] drivers/bluetooth/hci_h5.o drivers/bluetooth/hci_h5.c:934:36: warning: ‘h5_serdev_driver’ defined but not used [-Wunused-variable] static struct serdev_device_driver h5_serdev_driver = { ^~~~~~~~~~~~~~~~ Signed-off-by: Johan Hedberg Signed-off-by: Marcel Holtmann commit 5799c4b2f1dbc0166d9b1d94443deaafc6e7a070 Author: Jae Hyun Yoo Date: Tue Jul 24 13:36:15 2018 -0700 i2c: aspeed: Add an explicit type casting for *get_clk_reg_val This commit fixes this sparse warning: drivers/i2c/busses/i2c-aspeed.c:875:38: warning: incorrect type in assignment (different modifiers) drivers/i2c/busses/i2c-aspeed.c:875:38: expected unsigned int ( *get_clk_reg_val )( ... ) drivers/i2c/busses/i2c-aspeed.c:875:38: got void const *const data Reported-by: Wolfram Sang Signed-off-by: Jae Hyun Yoo Reviewed-by: Brendan Higgins Signed-off-by: Wolfram Sang commit 2f471d90249551d4b2dab3c7f0527640a3395f2e Merge: d211e62af466 6856909ce542 Author: Wolfram Sang Date: Sat Aug 4 23:05:11 2018 +0200 Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into i2c/for-4.19 Simplify the probe function of the pca954x driver commit d211e62af46693f90f6386085817e22239e3fe79 Author: Manivannan Sadhasivam Date: Wed Aug 1 23:32:31 2018 +0530 i2c: Add Actions Semiconductor Owl family S900 I2C driver Add Actions Semiconductor Owl family S900 I2C driver. Signed-off-by: Manivannan Sadhasivam Acked-by: Peter Rosin Signed-off-by: Wolfram Sang commit 5344cbf95b0f32a01c8b95b5190bf0448e86e026 Author: Manivannan Sadhasivam Date: Wed Aug 1 23:32:27 2018 +0530 dt-bindings: i2c: Add binding for Actions Semiconductor Owl I2C controller Add devicetree binding for Actions Semiconductor Owl I2C controller Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit 12e5e452aec3520f7a66718600eaa991b54098ad Merge: f13b546847ff 31ba191bf5ab Author: David S. Miller Date: Sat Aug 4 13:23:15 2018 -0700 Merge branch 'net-ARRAY_SIZE' zhong jiang says: ==================== Use ARRAY_SIZE to replace computing the size zhong jiang (2): net:usb: Use ARRAY_SIZE instead of calculating the array size include/net/bond_3ad: Simplify the code by using the ARRAY_SIZE ==================== Signed-off-by: David S. Miller commit 31ba191bf5ab2975c1955f1adf771a5a0b57afaa Author: zhong jiang Date: Fri Aug 3 14:53:15 2018 +0800 include/net/bond_3ad: Simplify the code by using the ARRAY_SIZE We prefer to ARRAY_SIZE rather than the open code to calculate size. Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit bf37afceaf549ce9ef50e3042f64d257a3d4be80 Author: zhong jiang Date: Fri Aug 3 14:53:14 2018 +0800 net:usb: Use ARRAY_SIZE instead of calculating the array size We use ARRAY_SIZE to replace open code sizeof(lan78xx_regs) / sizeof(u32). It make the code concise. Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit f13b546847ff5862ea313f3e79010c52c3fe32b4 Author: Li RongQing Date: Fri Aug 3 15:50:02 2018 +0800 tun: not use hardcoded mask value 0x3ff in tun_hashfn is mask of TUN_NUM_FLOW_ENTRIES, instead of hardcode, define a macro to setup the relationship with TUN_NUM_FLOW_ENTRIES Signed-off-by: Li RongQing Signed-off-by: David S. Miller commit 039b1d5e5862375b0da534bb75fc580eaa547d53 Author: Jia-Ju Bai Date: Sat Aug 4 08:40:09 2018 +0800 net: cisco: enic: Replace GFP_ATOMIC with GFP_KERNEL vnic_dev_register(), vnic_rq_alloc_bufs() and vnic_wq_alloc_bufs() are never called in atomic context. They call kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Acked-by: Govindarajulu Varadarajan Signed-off-by: David S. Miller commit 07d53ae4fbdf7458f4d51249aa24d75c76fe52a8 Author: zhong jiang Date: Sat Aug 4 19:41:41 2018 +0800 net: Remove some unneeded semicolon These semicolons are not needed. Just remove them. Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit 0c26159352ba1cdc5a8c8d74131cc19cdfdf9371 Author: Jakub Kicinski Date: Fri Aug 3 22:06:00 2018 -0700 nfp: bpf: xdp_adjust_tail support Add support for adjust_tail. There are no FW changes needed but add a FW capability just in case there would be any issue with previously released FW, or we will have to change the ABI in the future. The helper is trivial and shouldn't be used too often so just inline the body of the function. We add the delta to locally maintained packet length register and check for overflow, since add of negative value must overflow if result is positive. Note that if delta of 0 would be allowed in the kernel this trick stops working and we need one more instruction to compare lengths before and after the change. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit afd3e3dad6761ddf08119afe121bfbe096c0844b Merge: 4f53a4a76cdf cda676b5c93f Author: Olof Johansson Date: Sat Aug 4 11:02:54 2018 -0700 Merge tag 'qcom-arm64-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/dt Qualcomm ARM64 Updates for v4.19 - Part 2 * Add thermal nodes for MSM8996 and SDM845 * tag 'qcom-arm64-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: (21 commits) arm64: dts: sdm845: Add tsens nodes arm64: dts: msm8996: thermal: Initialise via DT and add second controller soc: qcom: rmtfs-mem: fix memleak in probe error paths soc: qcom: llc-slice: Add missing MODULE_LICENSE() drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() drivers: qcom: rpmh-rsc: fix the loop index check in get_req_from_tcs firmware: qcom: scm: add a dummy qcom_scm_assign_mem() drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children drivers: qcom: rpmh-rsc: allow active requests from wake TCS drivers: qcom: rpmh: add support for batch RPMH request drivers: qcom: rpmh: allow requests to be sent asynchronously drivers: qcom: rpmh: cache sleep/wake state requests drivers: qcom: rpmh-rsc: allow invalidation of sleep/wake TCS drivers: qcom: rpmh-rsc: write sleep/wake requests to TCS drivers: qcom: rpmh: add RPMH helper functions drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE dt-bindings: introduce RPMH RSC bindings for Qualcomm SoCs drivers: qcom: rpmh-rsc: add RPMH controller for QCOM SoCs drivers: soc: Add LLCC driver dt-bindings: Documentation for qcom, llcc ... commit eb2caeb88c181904110f8e74995c7b0bb7fd39f6 Author: Gustavo A. R. Silva Date: Fri Aug 3 15:53:54 2018 -0500 ALSA: seq_oss: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 2f3b94e539a46052f8eba1f295ff5646e227578a Author: Gustavo A. R. Silva Date: Fri Aug 3 15:52:33 2018 -0500 ALSA: seq: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced the code comment with a proper "fall through" annotation, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit e800a333135bef633ffb21bdd471b8ffc491db7b Author: Stanislaw Gruszka Date: Fri Aug 3 13:44:40 2018 +0200 mt76x0: rename trace symbols Rename trace symbols that conflict with mt7601u and remove some definitions that are not used. Patch fixes build errors like this: ld: drivers/net/wireless/mediatek/mt76/mt76x0/trace.o:(__tracepoints+0x0): multiple definition of `__tracepoint_set_shared_key'; drivers/net/wireless/mediatek/mt7601u/trace.o:(__tracepoints+0x0): first defined here Reported-by: Stephen Rothwell Fixes: 7b4859026ccd ("mt76x0: core files") Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 909da6e4b577be65432ba4bcede3e036db2d1dc8 Author: Stanislaw Gruszka Date: Fri Aug 3 13:44:39 2018 +0200 mt76x0: rename mt76_* functions mt76_* functions conflicts with mt7601u driver what prevents to build those drivers in the kernel or use both drivers modules at once. Patch fixes build errors like this: ld: drivers/net/wireless/mediatek/mt76/mt76x0/mac.o:(.opd+0x30): multiple definition of `mt76_mac_tx_rate_val'; drivers/net/wireless/mediatek/mt7601u/mac.o:(.opd+0x30): first defined here Reported-by: Stephen Rothwell Fixes: 7b4859026ccd ("mt76x0: core files") Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 924de3b8c9410c404c6eda7abffd282b97b3ff7f Author: Eric W. Biederman Date: Mon Jul 23 13:38:00 2018 -0500 fork: Have new threads join on-going signal group stops There are only two signals that are delivered to every member of a signal group: SIGSTOP and SIGKILL. Signal delivery requires every signal appear to be delivered either before or after a clone syscall. SIGKILL terminates the clone so does not need to be considered. Which leaves only SIGSTOP that needs to be considered when creating new threads. Today in the event of a group stop TIF_SIGPENDING will get set and the fork will restart ensuring the fork syscall participates in the group stop. A fork (especially of a process with a lot of memory) is one of the most expensive system so we really only want to restart a fork when necessary. It is easy so check to see if a SIGSTOP is ongoing and have the new thread join it immediate after the clone completes. Making it appear the clone completed happened just before the SIGSTOP. The calculate_sigpending function will see the bits set in jobctl and set TIF_SIGPENDING to ensure the new task takes the slow path to userspace. V2: The call to task_join_group_stop was moved before the new task is added to the thread group list. This should not matter as sighand->siglock is held over both the addition of the threads, the call to task_join_group_stop and do_signal_stop. But the change is trivial and it is one less thing to worry about when reading the code. Signed-off-by: "Eric W. Biederman" commit 1021bcf44d0e876b10f8739594ad7e6e9c746026 Author: Geliang Tang Date: Wed Aug 1 19:23:37 2018 +0800 pstore: add zstd compression support This patch added the 6th compression algorithm support for pstore: zstd. Signed-off-by: Geliang Tang Signed-off-by: Kees Cook commit 4390e9eadbbb6774b7ba03fde0a0fdf3f07db4cd Author: Eric W. Biederman Date: Fri Aug 3 20:10:54 2018 -0500 fork: Skip setting TIF_SIGPENDING in ptrace_init_task The code in calculate_sigpending will now handle this so it is just redundant and possibly a little confusing to continue setting TIF_SIGPENDING in ptrace_init_task. Suggested-by: Oleg Nesterov Signed-off-by: "Eric W. Biederman" commit 088fe47ce952542389e604e83f533811750aaf7c Author: Eric W. Biederman Date: Mon Jul 23 17:26:49 2018 -0500 signal: Add calculate_sigpending() Add a function calculate_sigpending to test to see if any signals are pending for a new task immediately following fork. Signals have to happen either before or after fork. Today our practice is to push all of the signals to before the fork, but that has the downside that frequent or periodic signals can make fork take much much longer than normal or prevent fork from completing entirely. So we need move signals that we can after the fork to prevent that. This updates the code to set TIF_SIGPENDING on a new task if there are signals or other activities that have moved so that they appear to happen after the fork. As the code today restarts if it sees any such activity this won't immediately have an effect, as there will be no reason for it to set TIF_SIGPENDING immediately after the fork. Adding calculate_sigpending means the code in fork can safely be changed to not always restart if a signal is pending. The new calculate_sigpending function sets sigpending if there are pending bits in jobctl, pending signals, the freezer needs to freeze the new task or the live kernel patching framework need the new thread to take the slow path to userspace. I have verified that setting TIF_SIGPENDING does make a new process take the slow path to userspace before it executes it's first userspace instruction. I have looked at the callers of signal_wake_up and the code paths setting TIF_SIGPENDING and I don't see anything else that needs to be handled. The code probably doesn't need to set TIF_SIGPENDING for the kernel live patching as it uses a separate thread flag as well. But at this point it seems safer reuse the recalc_sigpending logic and get the kernel live patching folks to sort out their story later. V2: I have moved the test into schedule_tail where siglock can be grabbed and recalc_sigpending can be reused directly. Further as the last action of setting up a new task this guarantees that TIF_SIGPENDING will be properly set in the new process. The helper calculate_sigpending takes the siglock and uncontitionally sets TIF_SIGPENDING and let's recalc_sigpending clear TIF_SIGPENDING if it is unnecessary. This allows reusing the existing code and keeps maintenance of the conditions simple. Oleg Nesterov suggested the movement and pointed out the need to take siglock if this code was going to be called while the new task is discoverable. Signed-off-by: "Eric W. Biederman" commit a01512b14d4faa9f6f7501201d7033216d2e563a Author: YueHaibing Date: Fri Aug 3 16:28:48 2018 +0800 tcp: remove unneeded variable 'err' variable 'err' is unmodified after initalization, so simply cleans up it and returns 0. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 51f7e95187f127d5eadf50541943813ff57f12ba Author: Jason Baron Date: Fri Aug 3 17:24:53 2018 -0400 af_unix: ensure POLLOUT on remote close() for connected dgram socket Applications use -ECONNREFUSED as returned from write() in order to determine that a socket should be closed. However, when using connected dgram unix sockets in a poll/write loop, a final POLLOUT event can be missed when the remote end closes. Thus, the poll is stuck forever: thread 1 (client) thread 2 (server) connect() to server write() returns -EAGAIN unix_dgram_poll() -> unix_recvq_full() is true close() ->unix_release_sock() ->wake_up_interruptible_all() unix_dgram_poll() (due to the wake_up_interruptible_all) -> unix_recvq_full() still is true ->free all skbs Now thread 1 is stuck and will not receive anymore wakeups. In this case, when thread 1 gets the -EAGAIN, it has not queued any skbs otherwise the 'free all skbs' step would in fact cause a wakeup and a POLLOUT return. So the race here is probably fairly rare because it means there are no skbs that thread 1 queued and that thread 1 schedules before the 'free all skbs' step. This issue was reported as a hang when /dev/log is closed. The fix is to signal POLLOUT if the socket is marked as SOCK_DEAD, which means a subsequent write() will get -ECONNREFUSED. Reported-by: Ian Lance Taylor Cc: David Rientjes Cc: Rainer Weikusat Cc: Eric Dumazet Signed-off-by: Jason Baron Signed-off-by: David S. Miller commit 483f3fdcc70b3c3a1f314235ab0066f3dbd4cfbe Author: Pablo Neira Ayuso Date: Sat Aug 4 00:31:48 2018 +0200 netfilter: nft_tunnel: fix sparse errors [...] net/netfilter/nft_tunnel.c:117:25: expected unsigned int [unsigned] [usertype] flags net/netfilter/nft_tunnel.c:117:25: got restricted __be16 [usertype] [...] net/netfilter/nft_tunnel.c:246:33: expected restricted __be16 [addressable] [assigned] [usertype] tp_dst net/netfilter/nft_tunnel.c:246:33: got int Fixes: af308b94a2a4 ("netfilter: nf_tables: add tunnel support") Reported-by: kbuild test robot Signed-off-by: Pablo Neira Ayuso commit 1e506464a4d5c5d7482fda1f745b9ec79e44ad4f Author: Colin Ian King Date: Fri Aug 3 10:35:58 2018 -0400 media: au0828: fix spelling mistake: "completition" -> "completion" Trivial fix to spelling mistake in au0828_isocdbg debug message Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit 854bb4ec126320046afd2e299c8dd070946d2410 Author: Colin Ian King Date: Fri Aug 3 10:35:59 2018 -0400 media: cx231xx: fix spelling mistake: "completition" -> "completion" Trivial fix to spelling mistake in dev_dbg debug messages Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit 3c8496e5d0595cec6e463b35b7ad87eefabc531f Author: Colin Ian King Date: Fri Aug 3 10:36:00 2018 -0400 media: dvb-usb-v2: fix spelling mistake: "completition" -> "completion" Trivial fix to spelling mistake in dev_dbg and dev_err messages Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit 16200248f48dded48f7c79a0d20d18b8c6b02605 Author: Colin Ian King Date: Fri Aug 3 10:36:01 2018 -0400 media: dvb-usb: fix spelling mistake: "completition" -> "completion" Trivial fix to spelling mistake in debug and error messages Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit 12f336c88090fb8004736fd4329184326a49673b Author: Kuninori Morimoto Date: Wed Jul 25 22:37:11 2018 -0400 media: sh_mobile_ceu: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Mauro Carvalho Chehab commit 7b381978c8563672e19d90db00119d74ed2221b3 Author: Kuninori Morimoto Date: Wed Jul 25 22:36:55 2018 -0400 media: sh_vou: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Mauro Carvalho Chehab commit d81469d2b77553b281b9b59eadd995309728f506 Author: Kuninori Morimoto Date: Wed Jul 25 22:36:36 2018 -0400 media: sh_veu: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Mauro Carvalho Chehab commit 88352b163c839277be367ddcf13ef5971ce9df2a Author: Kuninori Morimoto Date: Wed Jul 25 22:36:21 2018 -0400 media: rcar_jpu: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Mauro Carvalho Chehab commit 7c1d62e455ab934ab3fdf86e03bc2a1fa550aa23 Author: Kuninori Morimoto Date: Wed Jul 25 22:36:04 2018 -0400 media: rcar_fdp1: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Acked-by: Kieran Bingham Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Mauro Carvalho Chehab commit adeb6970568256e4208b1b131f710f544c58d5c8 Author: Kuninori Morimoto Date: Wed Jul 25 22:35:49 2018 -0400 media: rcar_drif: convert to SPDX identifiers As original license mentioned, it is GPL-2.0+ in SPDX. Then, MODULE_LICENSE() should be "GPL" instead of "GPL v2". See ${LINUX}/include/linux/module.h "GPL" [GNU Public License v2 or later] "GPL v2" [GNU Public License v2] Signed-off-by: Kuninori Morimoto Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Acked-by: Ramesh Shanmugasundaram Signed-off-by: Mauro Carvalho Chehab commit 58c708f64aee6a0adf4e7ca00589c0bf1dd69fe6 Author: Kuninori Morimoto Date: Wed Jul 25 22:35:23 2018 -0400 media: rcar-fcp: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Mauro Carvalho Chehab commit aa7b827878f06876c32b050d1737c3a1a3816af1 Author: Kuninori Morimoto Date: Wed Jul 25 22:35:06 2018 -0400 media: rcar-vin: convert to SPDX identifiers Kconfig and Makefile doesn't have license line, thus, these are GPL-2.0 as default. All ohter files are GPL-2.0+ as original license. Signed-off-by: Kuninori Morimoto Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Acked-by: Niklas Söderlund Signed-off-by: Mauro Carvalho Chehab commit c7b15a8657da7f8d11269c7cc3d8beef10d26b43 Author: Al Viro Date: Sat Jun 30 14:32:04 2018 -0400 jfs: don't bother with make_bad_inode() in ialloc() We hit that when inumber allocation has failed. In that case the in-core inode is not hashed and since its ->i_nlink is 1 the only place where jfs checks is_bad_inode() won't be reached. Signed-off-by: Al Viro commit d8e78da8682028ad53d040339a2b9d6fb6092d63 Author: Al Viro Date: Sat Jun 30 03:15:49 2018 -0400 adfs: don't put inodes into icache We never look them up in there; inode_fake_hash() will make them appear hashed for mark_inode_dirty() purposes. And don't leave them around until memory pressure kicks them out - we never look them up again. Signed-off-by: Al Viro commit 5bef915104f32c9d0bb5df6e86a98e31cb524e9a Author: Al Viro Date: Fri Jun 29 19:36:57 2018 -0400 new helper: inode_fake_hash() open-coded in a quite a few places... Signed-off-by: Al Viro commit e950564b97fd0f541b02eb207685d0746f5ecf29 Author: Miklos Szeredi Date: Tue Jul 24 15:01:55 2018 +0200 vfs: don't evict uninitialized inode iput() ends up calling ->evict() on new inode, which is not yet initialized by owning fs. So use destroy_inode() instead. Add to sb->s_inodes list only if inode is not in I_CREATING state (meaning that it wasn't allocated with new_inode(), which already does the insertion). Reported-by: Al Viro Signed-off-by: Miklos Szeredi Fixes: 80ea09a002bf ("vfs: factor out inode_insert5()") Signed-off-by: Al Viro commit a6cbedfa8783b42b9272c05297865bdb501005cb Author: Al Viro Date: Fri Jun 29 11:59:37 2018 -0400 jfs: switch to discard_new_inode() we don't want open-by-handle to pick an in-core inode that has failed setup halfway through. Signed-off-by: Al Viro commit 2e5afe54e0cd6fce79b51ca547caf08a990ad56d Author: Al Viro Date: Wed May 16 18:29:56 2018 -0400 ext2: make sure that partially set up inodes won't be returned by ext2_iget() Signed-off-by: Al Viro commit 5c1a68a358f94b9ac2e33183327bc04f207feed2 Author: Al Viro Date: Wed May 16 12:25:39 2018 -0400 udf: switch to discard_new_inode() we don't want open-by-handle to pick an in-core inode that has failed setup halfway through. Signed-off-by: Al Viro commit dd54992776ebb44519ba4cd69145c4f19d166ddb Author: Al Viro Date: Wed May 16 12:22:50 2018 -0400 ufs: switch to discard_new_inode() we don't want open-by-handle to pick an in-core inode that has failed setup halfway through. Signed-off-by: Al Viro commit 32955c5422a8a5460bbefe2a6fc51eadcafff4c9 Author: Al Viro Date: Wed May 16 12:20:05 2018 -0400 btrfs: switch to discard_new_inode() Make sure that no partially set up inodes can be returned by open-by-handle. Signed-off-by: Al Viro commit 4679b79f217550f2f4c83101eb8149c5e552a93a Author: Kuninori Morimoto Date: Wed Jul 25 22:34:42 2018 -0400 media: soc_camera_platform: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Mauro Carvalho Chehab commit e90561d40f830f1266d9531ae95eae8252dd8fa1 Author: Kieran Bingham Date: Fri Aug 3 07:37:29 2018 -0400 media: vsp1: Support Interlaced display pipelines Calculate the top and bottom fields for the interlaced frames and utilise the extended display list command feature to implement the auto-field operations. This allows the DU to update the VSP2 registers dynamically based upon the currently processing field. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit f3b98e3c4d2e16bb7c99fc75d652559bd591070f Author: Kieran Bingham Date: Fri Aug 3 07:37:28 2018 -0400 media: vsp1: Provide support for extended command pools VSPD and VSP-DL devices can provide extended display lists supporting extended command display list objects. These extended commands require their own dma memory areas for a header and body specific to the command type. Implement a command pool to allocate all necessary memory in a single DMA allocation to reduce pressure on the TLB, and provide convenient re-usable command objects for the entities to utilise. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 7d630c4924d82c4679e2df4bf55c2fd94e668e91 Author: Kieran Bingham Date: Fri Aug 3 07:37:27 2018 -0400 media: vsp1: Add support for extended display list headers Extended display list headers allow pre and post command lists to be executed by the VSP pipeline. This provides the base support for features such as AUTO_FLD (for interlaced support) and AUTO_DISP (for supporting continuous camera preview pipelines. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 08e41f6219c717d16bb22b53010ee7401c27fb11 Author: Kieran Bingham Date: Fri Aug 3 07:37:26 2018 -0400 media: vsp1: Use header display lists for all WPF outputs linked to the DU Header mode display lists are now supported on all WPF outputs. To support extended headers and auto-fld capabilities for interlaced mode handling only header mode display lists can be used. Disable the headerless display list configuration, and remove the dead code. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 177fb098b89644b1f1143482a87587a6ed7de578 Author: Kieran Bingham Date: Fri Aug 3 07:37:25 2018 -0400 media: vsp1: Provide VSP1 feature helper macro The VSP1 devices define their specific capabilities through features marked in their device info structure. Various parts of the code read this info structure to infer if the features are available. Wrap this into a more readable vsp1_feature(vsp1, f) macro to ensure that usage is consistent throughout the driver. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 8a3a0797dedd39a6ee7a52c3749d31f8104aafa7 Author: Kieran Bingham Date: Fri Aug 3 07:37:24 2018 -0400 media: vsp1: Clean up DLM objects on error If there is an error allocating a display list within a DLM object the existing display lists are not free'd, and neither is the DL body pool. Use the existing vsp1_dlm_destroy() function to clean up on error. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit b6ee44d1ea189cf0872b48e4fa56d648dec10fa2 Author: Kieran Bingham Date: Fri Aug 3 07:37:23 2018 -0400 media: vsp1: Remove unused display list structure field The vsp1 reference in the vsp1_dl_body structure is not used. Remove it. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 2ca72570b934e820f9a5b645cfb9b5df93e3c139 Author: Kieran Bingham Date: Fri Aug 3 07:37:22 2018 -0400 media: vsp1: Rename dl_child to dl_next Both vsp1_dl_list_commit() and __vsp1_dl_list_put() walk the display list chain referencing the nodes as children, when in reality they are siblings. Update the terminology to 'dl_next' to be consistent with the vsp1_video_pipeline_run() usage. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 3e737e394329564b70ceff8eb0c5f587904aa396 Author: Kieran Bingham Date: Fri Aug 3 07:37:21 2018 -0400 media: vsp1: use kernel __packed for structures The kernel provides a __packed definition to abstract away from the compiler specific attributes tag. Convert all packed structures in VSP1 to use it. The GCC documentation [0] describes this attribute as "the structure or union is placed to minimize the memory required". The Keil compiler documentation at [1] warns that the use of this attribute can cause a performance penalty in the event that the compiler can not deduce the allignment of each field. Careful examination of the object code generated both with and without this attribute shows that these structures are accessed identically and are not affected by any performance penalty. The structures are correctly aligned and padded to match the needs of the hardware already. This patch does not serve to make a decision as to the use of the attribute, but purely to clean up the code to use the kernel defined abstraction as per [2]. [0] https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-packed-type-attribute [1] http://www.keil.com/support/man/docs/armcc/armcc_chr1359124230195.htm [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/compiler-gcc.h?h=v4.16-rc5#n92 Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit c2b6d621c4ffe9936adf7a55c8b1c769672c306f Author: Al Viro Date: Thu Jun 28 15:53:17 2018 -0400 new primitive: discard_new_inode() We don't want open-by-handle picking half-set-up in-core struct inode from e.g. mkdir() having failed halfway through. In other words, we don't want such inodes returned by iget_locked() on their way to extinction. However, we can't just have them unhashed - otherwise open-by-handle immediately *after* that would've ended up creating a new in-core inode over the on-disk one that is in process of being freed right under us. Solution: new flag (I_CREATING) set by insert_inode_locked() and removed by unlock_new_inode() and a new primitive (discard_new_inode()) to be used by such halfway-through-setup failure exits instead of unlock_new_inode() / iput() combinations. That primitive unlocks new inode, but leaves I_CREATING in place. iget_locked() treats finding an I_CREATING inode as failure (-ESTALE, once we sort out the error propagation). insert_inode_locked() treats the same as instant -EBUSY. ilookup() treats those as icache miss. [Fix by Dan Carpenter folded in] Signed-off-by: Al Viro commit a394b3af206c211b80b02e47c19aab763fd33b3d Author: Kees Cook Date: Fri Aug 3 09:37:45 2018 -0700 ppp: mppe: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this removes the discouraged use of AHASH_REQUEST_ON_STACK (and associated VLA) by switching to shash directly and keeping the associated descriptor allocated with the regular state on the heap. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Arnd Bergmann Signed-off-by: David S. Miller commit 3c56b2cccbd1d66ab394ca73f4de48d8c98d923d Author: Kieran Bingham Date: Fri Aug 3 07:37:20 2018 -0400 media: vsp1: drm: Fix minor grammar error The pixel format is 'unsupported'. Fix the small debug message which incorrectly declares this. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit eb9950eb31f56e57582a61c92073336d04a26542 Author: David Howells Date: Fri Aug 3 17:06:56 2018 +0100 rxrpc: Push iov_iter up from rxrpc_kernel_recv_data() to caller Push iov_iter up from rxrpc_kernel_recv_data() to its caller to allow non-contiguous iovs to be passed down, thereby permitting file reading to be simplified in the AFS filesystem in a future patch. Signed-off-by: David Howells Signed-off-by: David S. Miller commit 020f6cc5f75511c5974cfd454f224365bc0c2df4 Author: Florian Westphal Date: Fri Aug 3 18:40:21 2018 +0200 netfilter: conntrack: avoid use-after free on rmmod When the conntrack module is removed, we call nf_ct_iterate_destroy via nf_ct_l4proto_unregister(). Problem is that nf_conntrack_proto_fini() gets called after the conntrack hash table has already been freed. Just remove the l4proto unregister call, its unecessary as the nf_ct_protos[] array gets free'd right after anyway. v2: add comment wrt. missing unreg call. Fixes: a0ae2562c6c4b2 ("netfilter: conntrack: remove l3proto abstraction") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7bdfcea875ad42b6fd00413882fbc657c751f13a Author: Florian Westphal Date: Fri Aug 3 17:56:12 2018 +0200 netfilter: kconfig: remove ct zone/label dependencies connection tracking zones currently depend on the xtables CT target. The reasoning was that it makes no sense to support zones if they can't be configured (which needed CT target). Nowadays zones can also be used by OVS and configured via nftables, so remove the dependency. connection tracking labels are handled via hidden dependency that gets auto-selected by the connlabel match. Make it a visible knob, as labels can be attached via ctnetlink or via nftables rules (nft_ct expression) too. This allows to use conntrack labels and zones with nftables-only build. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 445509eb9b00278b31c92f16b05260176a41c27f Author: Pablo Neira Ayuso Date: Fri Aug 3 13:35:36 2018 +0200 netfilter: nf_tables: simplify NLM_F_CREATE handling * From nf_tables_newchain(), codepath provides context that allows us to infer if we are updating a chain (in that case, no module autoload is required) or adding a new one (then, module autoload is indeed needed). * We only need it in one single spot in nf_tables_newrule(). * Not needed for nf_tables_newset() at all. Signed-off-by: Pablo Neira Ayuso commit 94276fa8a2a4c08ccb2e9d55e88b95dc972ccea3 Author: Máté Eckl Date: Fri Aug 3 13:36:13 2018 +0200 netfilter: bridge: Expose nf_tables bridge hook priorities through uapi Netfilter exposes standard hook priorities in case of ipv4, ipv6 and arp but not in case of bridge. This patch exposes the hook priority values of the bridge family (which are different from the formerly mentioned) via uapi so that they can be used by user-space applications just like the others. Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit aaecfdb5c5dd8bac2dfd112166844a9f2d5711f0 Author: Pablo Neira Ayuso Date: Thu Aug 2 20:51:46 2018 +0200 netfilter: nf_tables: match on tunnel metadata This patch allows us to match on the tunnel metadata that is available of the packet. We can use this to validate if the packet comes from/goes to tunnel and the corresponding tunnel ID. Signed-off-by: Pablo Neira Ayuso commit af308b94a2a4a5a27bec9028354c4df444a7c8ba Author: Pablo Neira Ayuso Date: Thu Aug 2 20:51:39 2018 +0200 netfilter: nf_tables: add tunnel support This patch implements the tunnel object type that can be used to configure tunnels via metadata template through the existing lightweight API from the ingress path. Signed-off-by: Pablo Neira Ayuso commit 3424b700225c2f76d599abc8e5ea03064790618b Merge: 723a00436adc 54226116add4 Author: David S. Miller Date: Fri Aug 3 12:11:43 2018 -0700 Merge branch 'dsa-systemport-WoL' Florian Fainelli says: ==================== net: dsa and systemport WoL changes This patch series extracts what was previously submitted as part of the "WAKE_FILTER" Wake-on-LAN patch series into patches that do not. Changes in this series: - properly align the dsa_is_cpu_port() check in first patch ==================== Signed-off-by: David S. Miller commit 54226116add4dcfe6391ffb810225f78c9c3d245 Author: Florian Fainelli Date: Fri Aug 3 11:08:44 2018 -0700 net: systemport: Create helper to set MPD Create a helper function to turn on/off MPD, this will be used to avoid duplicating code as we are going to add additional types of wake-up types. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 9e85e22713d6fed4873057493d6307c08b1d86a6 Author: Florian Fainelli Date: Fri Aug 3 11:08:43 2018 -0700 net: systemport: Do not re-configure upon WoL interrupt We already properly resume from Wake-on-LAN whether such a condition occured or not, no need to process the WoL interrupt for functional changes since that could race with other settings. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit c0e6820b7e4175171f302df6cc4706b818f4a691 Author: Florian Fainelli Date: Fri Aug 3 11:08:42 2018 -0700 net: dsa: bcm_sf2: Disable learning while in WoL When we are in Wake-on-LAN, we operate with the host sofware not running a network stack, so we want to the switch to flood packets in order to cause a system wake-up when matching specific filters (unicast or multicast). This was not necessary before since we supported Magic Packet which are targeting a broadcast MAC address which the switch already floods. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2104bc0ab0eee8a4768dd80df8ed42eb591543bc Author: Florian Fainelli Date: Fri Aug 3 11:08:41 2018 -0700 net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rules ds->enabled_port_mask only contains a bitmask of user-facing enabled ports, we also need to allow programming CFP rules that target CPU ports (e.g: ports 5 and 8). Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 033eab53fff7acc0f5718dee6fda641734b94416 Author: Máté Eckl Date: Thu Aug 2 21:18:31 2018 +0200 netfilter: nft_tproxy: Add missing config check A config check was missing form the code when using nf_defrag_ipv6_enable with NFT_TPROXY != n and NF_DEFRAG_IPV6 = n and this caused the following error: ../net/netfilter/nft_tproxy.c: In function 'nft_tproxy_init': ../net/netfilter/nft_tproxy.c:237:3: error: implicit declaration of function +'nf_defrag_ipv6_enable' [-Werror=implicit-function-declaration] err = nf_defrag_ipv6_enable(ctx->net); This patch adds a check for NF_TABLES_IPV6 when NF_DEFRAG_IPV6 is selected by Kconfig. Reported-by: Randy Dunlap Fixes: 4ed8eb6570a4 ("netfilter: nf_tables: Add native tproxy support") Signed-off-by: Máté Eckl Acked-by: Randy Dunlap Signed-off-by: Pablo Neira Ayuso commit cb85d2b04b408ba8328eb5fa1e184cc538ba8c6a Author: Andy Shevchenko Date: Mon Jul 30 15:38:30 2018 +0300 pinctrl: intel: Don't shadow error code of gpiochip_lock_as_irq() gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Cc: Heikki Krogerus Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit b5031b7db77dc47f474f0efc2b2552c32b7bb59d Author: YueHaibing Date: Wed Aug 1 13:10:49 2018 +0800 pinctrl: berlin: fix 'pctrl->functions' allocation in berlin_pinctrl_build_state fixes following Smatch static check warning: drivers/pinctrl/berlin/berlin.c:237 berlin_pinctrl_build_state() warn: passing devm_ allocated variable to kfree. 'pctrl->functions' As we will be calling krealloc() on pointer 'pctrl->functions', which means kfree() will be called in there, devm_kzalloc() shouldn't be used with the allocation in the first place. Fix the warning by calling kcalloc() and managing the free procedure in error path on our own. Fixes: 3de68d331c24 ("pinctrl: berlin: add the core pinctrl driver for Marvell Berlin SoCs") Signed-off-by: YueHaibing Reviewed-by: Jisheng Zhang Signed-off-by: Linus Walleij commit 40b25bce0adbe641a744d1291bc0e51fb7f3c3d8 Author: Dmitry Osipenko Date: Thu Aug 2 14:11:44 2018 +0300 gpio: tegra: Move driver registration to subsys_init level There is a bug in regards to deferred probing within the drivers core that causes GPIO-driver to suspend after its users. The bug appears if GPIO-driver probe is getting deferred, which happens after introducing dependency on PINCTRL-driver for the GPIO-driver by defining "gpio-ranges" property in device-tree. The bug in the drivers core is old (more than 4 years now) and is well known, unfortunately there is no easy fix for it. The good news is that we can workaround the deferred probe issue by changing GPIO / PINCTRL drivers registration order and hence by moving PINCTRL driver registration to the arch_init level and GPIO to the subsys_init. Signed-off-by: Dmitry Osipenko Acked-by: Stefan Agner Signed-off-by: Linus Walleij commit 1e0813ee5599932c856bda64a568895ed7a33d3a Author: Dmitry Osipenko Date: Thu Aug 2 14:11:43 2018 +0300 pinctrl: tegra: Move drivers registration to arch_init level There is a bug in regards to deferred probing within the drivers core that causes GPIO-driver to suspend after its users. The bug appears if GPIO-driver probe is getting deferred, which happens after introducing dependency on PINCTRL-driver for the GPIO-driver by defining "gpio-ranges" property in device-tree. The bug in the drivers core is old (more than 4 years now) and is well known, unfortunately there is no easy fix for it. The good news is that we can workaround the deferred probe issue by changing GPIO / PINCTRL drivers registration order and hence by moving PINCTRL driver registration to the arch_init level and GPIO to the subsys_init. Signed-off-by: Dmitry Osipenko Acked-by: Stefan Agner Signed-off-by: Linus Walleij commit 973232e2a327cbf30b50b678af081426ca403088 Author: Alexander Stein Date: Thu Aug 2 12:53:18 2018 +0200 pinctrl: baytrail: actually print the apparently misconfigured pin For further investigation the actual result in interrupt status register is needed. Signed-off-by: Alexander Stein Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit 723a00436adc2ab474a2501c18a8e72ea1fc73f1 Merge: f3184645cb04 e9697e2effad Author: David S. Miller Date: Fri Aug 3 10:03:57 2018 -0700 Merge branch 'l2tp-mtu' Guillaume Nault says: ==================== l2tp: sanitise MTU handling on sessions Most of the code handling sessions' MTU has no effect. The ->mtu field in struct l2tp_session might be used at session creation time, but neither PPP nor Ethernet pseudo-wires take updates into account. L2TP sessions don't have a concept of MTU, which is the reason why ->mtu is mostly ignored. MTU should remain a network device thing. Therefore this patch set does not try to propagate/update ->mtu to/from the device. That would complicate the code unnecessarily. Instead this field and the associated ioctl commands and netlink attributes are removed. Patch #1 defines l2tp_tunnel_dst_mtu() in order to simplify the following patches. Then patches #2 and #3 remove MTU handling from PPP and Ethernet pseudo-wires respectively. ==================== Signed-off-by: David S. Miller commit e9697e2effad50c0081b3c72002d3975f8ab4347 Author: Guillaume Nault Date: Fri Aug 3 12:38:39 2018 +0200 l2tp: ignore L2TP_ATTR_MTU This attribute's handling is broken. It can only be used when creating Ethernet pseudo-wires, in which case its value can be used as the initial MTU for the l2tpeth device. However, when handling update requests, L2TP_ATTR_MTU only modifies session->mtu. This value is never propagated to the l2tpeth device. Dump requests also return the value of session->mtu, which is not synchronised anymore with the device MTU. The same problem occurs if the device MTU is properly updated using the generic IFLA_MTU attribute. In this case, session->mtu is not updated, and L2TP_ATTR_MTU will report an invalid value again when dumping the session. It does not seem worthwhile to complexify l2tp_eth.c to synchronise session->mtu with the device MTU. Even the ip-l2tp manpage advises to use 'ip link' to initialise the MTU of l2tpeth devices (iproute2 does not handle L2TP_ATTR_MTU at all anyway). So let's just ignore it entirely. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 789141b215fc509defdd0f0978e4bf1bb5b31fc2 Author: Guillaume Nault Date: Fri Aug 3 12:38:37 2018 +0200 l2tp: simplify MTU handling in l2tp_ppp The value of the session's .mtu field, as defined by pppol2tp_connect() or pppol2tp_session_create(), is later overwritten by pppol2tp_session_init() (unless getting the tunnel's socket PMTU fails). This field is then only used when setting the PPP channel's MTU in pppol2tp_connect(). Furthermore, the SIOC[GS]IFMTU ioctls only act on the session's .mtu without propagating this value to the PPP channel, making them useless. This patch initialises the PPP channel's MTU directly and ignores the session's .mtu entirely. MTU is still computed by subtracting the PPPOL2TP_HEADER_OVERHEAD constant. It is not optimal, but that doesn't really matter: po->chan.mtu is only used when the channel is part of a multilink PPP bundle. Running multilink PPP over packet switched networks is certainly not going to be efficient, so not picking the best MTU does not harm (in the worst case, packets will just be fragmented by the underlay). The SIOC[GS]IFMTU ioctls are removed entirely (as opposed to simply ignored), because these ioctls commands are part of the requests that should be handled generically by the socket layer. PX_PROTO_OL2TP was the only socket type abusing these ioctls. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 1f5cd2a0107d4ed95cbd9118e6a5f7ccd3d4d12a Author: Guillaume Nault Date: Fri Aug 3 12:38:34 2018 +0200 l2tp: define l2tp_tunnel_dst_mtu() Consolidate retrieval of tunnel's socket mtu in order to simplify l2tp_eth and l2tp_ppp a bit. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 5019027a566de4986a7f66017cf0d6d794fc155f Author: Gustavo A. R. Silva Date: Fri Aug 3 11:33:57 2018 -0500 ASoC: samsung: i2s: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1381093 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit a773c3b6be185d171e2755ac715e8b1ea099ebbc Author: Gustavo A. R. Silva Date: Fri Aug 3 11:31:48 2018 -0500 ASoC: omap-dmic: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1468847 ("Missing break in switch") Addresses-Coverity-ID: 1468849 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 16bbeb2b43c3f5d69e1348477e75a24ae6d55d5a Author: Gustavo A. R. Silva Date: Fri Aug 3 11:29:53 2018 -0500 ASoC: fsl_esai: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1222121 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit f3184645cb0409d4ab0e63d65a0adcb565f55df4 Merge: 54424d389196 375dd5e43212 Author: David S. Miller Date: Fri Aug 3 09:53:24 2018 -0700 Merge branch 'hns3-next' Salil Mehta says: ==================== Some important fixes for HNS3 driver This patch presents some important fixes related to MSIX allocation in HNS3 driver. ==================== Signed-off-by: David S. Miller commit 375dd5e432128ee071227e3ab0071ca11d01ac8c Author: Jian Shen Date: Fri Aug 3 10:56:31 2018 +0100 net: hns3: Refine the MSIX allocation for PF The offset of msix number for roce is different between different revision id. We should get it from firmware, instead of a fix value. This patch refines the msix allocation, make it compatible. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 07acf909ee33983fe22334446dd5c2adf0fdca26 Author: Jian Shen Date: Fri Aug 3 10:56:30 2018 +0100 net: hns3: Fix MSIX allocation issue for VF The msix number for vf is different, depends on the max vf number. Futherly if the vf supports roce, the offset of msix is not fixed. It's incorrect to fix the msix number to 33. This patch fixes it by querying the msix number from firmware, and adjusting it with roce support. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit c75303269009667cc2b7ddee274bc9e96e840f57 Author: Harsha Sharma Date: Thu Aug 2 09:26:24 2018 +0530 netfilter: cttimeout: Make NF_CT_NETLINK_TIMEOUT depend on NF_CONNTRACK_TIMEOUT With this, remove ifdef for CONFIG_NF_CONNTRACK_TIMEOUT in nfnetlink_cttimeout. This is also required for moving ctnl_untimeout from nfnetlink_cttimeout to nf_conntrack_timeout. Signed-off-by: Harsha Sharma Signed-off-by: Pablo Neira Ayuso commit 1974d2453fa7bfea5574d09332df3cc7fb0d909a Author: YueHaibing Date: Wed Aug 1 10:14:00 2018 +0800 netfilter: nf_tables: remove unused variable Variable 'ext' is being assigned but are never used hence they are unused and can be removed. Cleans up clang warnings: net/netfilter/nf_tables_api.c:4032:28: warning: variable ‘ext’ set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Signed-off-by: Pablo Neira Ayuso commit 54424d3891967b83d707c9300a3509c2ae8f42ee Author: Kees Cook Date: Fri Aug 3 10:15:25 2018 +0100 rxrpc: Reuse SKCIPHER_REQUEST_ON_STACK buffer The use of SKCIPHER_REQUEST_ON_STACK() will trigger FRAME_WARN warnings (when less than 2048) once the VLA is no longer hidden from the check: net/rxrpc/rxkad.c:398:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] net/rxrpc/rxkad.c:242:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] This passes the initial SKCIPHER_REQUEST_ON_STACK allocation to the leaf functions for reuse. Two requests allocated on the stack is not needed when only one is used at a time. Signed-off-by: Kees Cook Acked-by: Arnd Bergmann Signed-off-by: David Howells Signed-off-by: David S. Miller commit 5ca8a25c144dbb04511147601943691baab0aaca Author: Jiri Pirko Date: Fri Aug 3 11:08:47 2018 +0200 net: sched: fix flush on non-existing chain User was able to perform filter flush on chain 0 even if it didn't have any filters in it. With the patch that avoided implicit chain 0 creation, this changed. So in case user wants filter flush on chain which does not exist, just return success. There's no reason for non-0 chains to behave differently than chain 0, so do the same for them. Reported-by: Ido Schimmel Fixes: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation") Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 1a12d5dc7dd1ffd985503f9770b736fb03db2e3f Author: Gustavo A. R. Silva Date: Fri Aug 3 11:34:30 2018 -0500 ASoC: core: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 146568 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 85c81941d5033fc8a68646823d3157840c9de8b3 Author: Gustavo A. R. Silva Date: Fri Aug 3 11:32:52 2018 -0500 ASoC: omap-mcpdm: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1369526 ("Missing break in switch") Addresses-Coverity-ID: 1369529 ("Missing break in switch") Addresses-Coverity-ID: 1451415 ("Missing break in switch") Addresses-Coverity-ID: 115103 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 3b7c88fcc2873eba64f9e8cef34c4af0cba20887 Author: Gustavo A. R. Silva Date: Fri Aug 3 11:28:24 2018 -0500 ASoC: davinci-i2s: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1364478 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 6fd544c897d98bc6f185da215f1585dc144218cc Author: YueHaibing Date: Fri Aug 3 16:48:56 2018 +0800 bnxt_en: combine 'else if' and 'else' into single branch The else-if branch and else branch set mac_ok to true similarly, so combine the two into single else branch. Also add comments to explain the two conditions, which from Michael Chan and Vasundhara Volam. Signed-off-by: YueHaibing Acked-by: Michael Chan Signed-off-by: David S. Miller commit 9e619d87b277bbcc4e0b64cc5963520c1cd99f18 Author: Florian Westphal Date: Tue Jul 31 17:24:45 2018 +0200 netfilter: nf_tables: flow event notifier must use transaction mutex Fixes: f102d66b335a4 ("netfilter: nf_tables: use dedicated mutex to guard transactions") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ddba40be59c9be4059288464f8e6f38fbba27495 Author: Fernando Fernandez Mancera Date: Tue Jul 31 20:25:01 2018 +0200 netfilter: nfnetlink_osf: rename nf_osf header file to nfnetlink_osf The first client of the nf_osf.h userspace header is nft_osf, coming in this batch, rename it to nfnetlink_osf.h as there are no userspace clients for this yet, hence this looks consistent with other nfnetlink subsystem. Suggested-by: Jan Engelhardt Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit 7cca1ed0bb248b8d5768d17f5afe297a832d66c0 Author: Fernando Fernandez Mancera Date: Tue Jul 31 20:25:00 2018 +0200 netfilter: nf_osf: move nf_osf_fingers to non-uapi header file All warnings (new ones prefixed by >>): >> ./usr/include/linux/netfilter/nf_osf.h:73: userspace cannot reference function or variable defined in the kernel Fixes: f9324952088f ("netfilter: nfnetlink_osf: extract nfnetlink_subsystem code from xt_osf.c") Reported-by: kbuild test robot Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit 285189c78eeb6f684a024b86fb5997d10c6aa564 Author: Li RongQing Date: Wed Jul 25 15:52:13 2018 +0800 netfilter: use kvmalloc_array to allocate memory for hashtable nf_ct_alloc_hashtable is used to allocate memory for conntrack, NAT bysrc and expectation hashtable. Assuming 64k bucket size, which means 7th order page allocation, __get_free_pages, called by nf_ct_alloc_hashtable, will trigger the direct memory reclaim and stall for a long time, when system has lots of memory stress so replace combination of __get_free_pages and vzalloc with kvmalloc_array, which provides a overflow check and a fallback if no high order memory is available, and do not retry to reclaim memory, reduce stall and remove nf_ct_free_hashtable, since it is just a kvfree Signed-off-by: Zhang Yu Signed-off-by: Wang Li Signed-off-by: Li RongQing Signed-off-by: Pablo Neira Ayuso commit a0e336ba3e3d1c7ec0f738a2e2e203434c00b08e Author: Huang Chong Date: Fri Aug 3 08:17:54 2018 -0700 xfs: fix a comment in xfs_log_reserve Fix the comment in xfs_log_reserve to avoid confusing. Signed-of-by: Huang Chong Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1f31c98d650ca342e2f54cb17c4554ad110c5a11 Author: Darrick J. Wong Date: Wed Aug 1 15:50:27 2018 -0700 xfs: only validate summary counts on primary superblock Skip the summary counter checks for secondary superblocks and inprogress primary superblocks because mkfs has always written those out with zeroed summary counters. Signed-off-by: Darrick J. Wong Reviewed-by: Carlos Maiolino commit 16196776185cb19bb8c2318ebd1dbbefb5350d6a Author: Harry Wentland Date: Thu Aug 2 15:32:01 2018 -0400 drm/amd/display: Only require EDID read for HDMI and DVI [Why] VGA sometimes has trouble retrieving the EDID on very long cables, KVM switches, or old displays. [How] Only require EDID read for HDMI and DVI and exempt other types (DP, VGA). We currently don't support VGA but if anyone adds support in the future this might get overlooked. Signed-off-by: Harry Wentland Suggested-by: Michel Dänzer Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 01dc285d5cd89b77686d8baef8482c58d7dc3ead Author: Harry Wentland Date: Wed Aug 1 10:48:23 2018 -0400 drm/amd/display: Report non-DP display as disconnected without EDID [Why] Some boards seem to have a problem where HPD is high on HDMI even though no display is connected. We don't want to report these as connected. DP spec still requires us to report DP displays as connected when HPD is high but we can't read the EDID in order to go to fail-safe mode. [How] If connector_signal is not DP abort detection if we can't retrieve the EDID. v2: Add Bugzilla and stable Bugzilla: https://bugs.freedesktop.org/107390 Bugzilla: https://bugs.freedesktop.org/106846 Cc: stable@vger.kernel.org Signed-off-by: Harry Wentland Acked-by: Alex Deucher Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 8530ebf1079ccc84ffa32d970cdcae168b2f3684 Author: Gustavo A. R. Silva Date: Fri Aug 3 08:42:11 2018 -0500 ASoC: smd845: fix memory leak In case memory resources for *card* were allocated, release them before return. Addresses-Coverity-ID: 1472244 ("Resource leak") Fixes: 6b1687bf76ef ("ASoC: qcom: add sdm845 sound card support") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 623a6143a845bd485b00ba684f0ccef11835edab Author: Houlong Wei Date: Wed Jul 25 09:26:40 2018 +0800 mailbox: mediatek: Add Mediatek CMDQ driver This patch is first version of Mediatek Command Queue(CMDQ) driver. The CMDQ is used to help write registers with critical time limitation, such as updating display configuration during the vblank. It controls Global Command Engine (GCE) hardware to achieve this requirement. Currently, CMDQ only supports display related hardwares, but we expect it can be extended to other hardwares for future requirements. Signed-off-by: Houlong Wei Signed-off-by: HS Liao Signed-off-by: CK Hu Signed-off-by: Jassi Brar commit 1c82407aa302774b24bf619e56973aa97cbf25bd Author: Houlong Wei Date: Wed Jul 25 09:26:39 2018 +0800 dt-bindings: soc: Add documentation for the MediaTek GCE unit This adds documentation for the MediaTek Global Command Engine (GCE) unit found in MT8173 SoCs. Signed-off-by: Houlong Wei Signed-off-by: HS Liao Reviewed-by: Rob Herring Signed-off-by: Jassi Brar commit c000c4f1d96534885bc7a8ef5185fd8c0de5e827 Author: Takashi Iwai Date: Fri Aug 3 15:48:54 2018 +0200 ALSA: synth: Remove empty init and exit For a sake of code simplification, remove the init and the exit entries that do nothing. Notes for readers: actually it's OK to remove *both* init and exit, but not OK to remove the exit entry. By removing only the exit while keeping init, the module becomes permanently loaded; i.e. you cannot unload it any longer! Signed-off-by: Takashi Iwai commit a7da09fecf35cc1b328f0229c019757f6582f6bb Author: Takashi Iwai Date: Fri Aug 3 15:48:41 2018 +0200 ALSA: pci: Remove empty init and exit For a sake of code simplification, remove the init and the exit entries that do nothing. Notes for readers: actually it's OK to remove *both* init and exit, but not OK to remove the exit entry. By removing only the exit while keeping init, the module becomes permanently loaded; i.e. you cannot unload it any longer! Signed-off-by: Takashi Iwai commit 3b23dc52da90c340c51273414f4e2d13e07e594c Author: Takashi Iwai Date: Fri Aug 3 15:48:26 2018 +0200 ALSA: i2c: Remove empty init and exit For a sake of code simplification, remove the init and the exit entries that do nothing. Notes for readers: actually it's OK to remove *both* init and exit, but not OK to remove the exit entry. By removing only the exit while keeping init, the module becomes permanently loaded; i.e. you cannot unload it any longer! Signed-off-by: Takashi Iwai commit 498aaa9152eef3e101ec897f9c9b51662f700830 Author: Takashi Iwai Date: Fri Aug 3 15:44:15 2018 +0200 ALSA: isa: Remove empty init and exit For a sake of code simplification, remove the init and the exit entries that do nothing. Notes for readers: actually it's OK to remove *both* init and exit, but not OK to remove the exit entry. By removing only the exit while keeping init, the module becomes permanently loaded; i.e. you cannot unload it any longer! Signed-off-by: Takashi Iwai commit 969686ee0e0ff62ece428e8e02b07f81ac88a84d Author: Takashi Iwai Date: Fri Aug 3 15:42:46 2018 +0200 ALSA: drivers: Remove empty init and exit For a sake of code simplification, remove the init and the exit entries that do nothing. Notes for readers: actually it's OK to remove *both* init and exit, but not OK to remove the exit entry. By removing only the exit while keeping init, the module becomes permanently loaded; i.e. you cannot unload it any longer! Signed-off-by: Takashi Iwai commit a6403299893982a2c0b0a6f43261976c43e1598e Author: Takashi Iwai Date: Fri Aug 3 15:40:25 2018 +0200 ALSA: compress: Remove empty init and exit For a sake of code simplification, remove the init and the exit entries that do nothing. Notes for readers: actually it's OK to remove *both* init and exit, but not OK to remove the exit entry. By removing only the exit while keeping init, the module becomes permanently loaded; i.e. you cannot unload it any longer! Signed-off-by: Takashi Iwai commit 9038820cef3c3824cdd846d69894746a73c053db Author: Colin Ian King Date: Fri Aug 3 14:47:56 2018 +0100 ALSA: gus: fix spelling mistake "acumulator" -> "accumulator" Trivial spelling mistake fix in debug message Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit a5f74ec7d3cb6278255f7bf2ffb28baa6ad6e157 Author: Souptick Joarder Date: Mon May 21 22:59:48 2018 +0530 gpu: drm: msm: Change return type to vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref- commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_mixed() returns err which driver mapped into VM_FAULT_* type. The new function vmf_insert_mixed() will replace this inefficiency by returning VM_FAULT_* type. vmf_error() is the newly introduce inline function in 4.17-rc6. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Rob Clark commit da25a672cf0e2c143bffb40acb507a342e25b4f4 Author: Joel Fernandes (Google) Date: Thu Aug 2 19:34:07 2018 -0700 trace: Use rcu_dereference_raw for hooks from trace-event subsystem Since we switched to using SRCU for tracepoints used in the idle path, we can no longer use rcu_dereference_sched for dereferencing points in trace-event hooks. Since tracepoints can now use either SRCU or sched-RCU, just use rcu_dereference_raw for traceevents just like we're doing when dereferencing the tracepoint table. This prevents an RCU warning reported by Masami: [ 282.060593] WARNING: can't dereference registers at 00000000f3c7f62b [ 282.063200] ============================= [ 282.064082] WARNING: suspicious RCU usage [ 282.064963] 4.18.0-rc6+ #15 Tainted: G W [ 282.066048] ----------------------------- [ 282.066923] /home/mhiramat/ksrc/linux/kernel/trace/trace_events.c:242 suspicious rcu_dereference_check() usage! [ 282.068974] [ 282.068974] other info that might help us debug this: [ 282.068974] [ 282.070770] [ 282.070770] RCU used illegally from idle CPU! [ 282.070770] rcu_scheduler_active = 2, debug_locks = 1 [ 282.072938] RCU used illegally from extended quiescent state! [ 282.074183] no locks held by swapper/0/0. [ 282.075071] [ 282.075071] stack backtrace: [ 282.076121] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W [ 282.077782] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) [ 282.079604] Call Trace: [ 282.080212] [ 282.080755] dump_stack+0x85/0xcb [ 282.081523] trace_event_ignore_this_pid+0x66/0x70 [ 282.082541] trace_event_raw_event_preemptirq_template+0xa2/0xb0 [ 282.083774] ? interrupt_entry+0xc4/0xe0 [ 282.084665] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 282.085669] trace_hardirqs_off_caller+0x90/0xd0 [ 282.086597] trace_hardirqs_off_thunk+0x1a/0x1c [ 282.087433] ? call_function_interrupt+0xa/0x20 [ 282.088201] interrupt_entry+0xc4/0xe0 [ 282.088848] ? call_function_interrupt+0xa/0x20 [ 282.089579] [ 282.090029] ? native_safe_halt+0x2/0x10 [ 282.090695] ? default_idle+0x1f/0x160 [ 282.091330] ? default_idle_call+0x24/0x40 [ 282.091997] ? do_idle+0x210/0x250 [ 282.092658] ? cpu_startup_entry+0x6f/0x80 [ 282.093338] ? start_kernel+0x49d/0x4bd [ 282.093987] ? secondary_startup_64+0xa5/0xb0 Link: http://lkml.kernel.org/r/20180803023407.225852-1-joel@joelfernandes.org Reported-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Fixes: e6753f23d961 ("tracepoint: Make rcuidle tracepoint callers use SRCU") Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit b96e6615cd197022017808a9fe82f1737e307875 Author: Thomas Richter Date: Thu Aug 2 09:46:20 2018 +0200 perf auxtrace: Support for perf report -D for s390 Add initial support for s390 auxiliary traces using the CPU-Measurement Sampling Facility. Support and ignore PERF_REPORT_AUXTRACE_INFO records in the perf data file. Later patches will show the contents of the auxiliary traces. Setup the auxtrace queues and data structures for s390. A raw dump of the perf.data file now does not show an error when an auxtrace event is encountered. Output before: [root@s35lp76 perf]# ./perf report -D -i perf.data.auxtrace 0x128 [0x10]: failed to process type: 70 Error: failed to process sample 0x128 [0x10]: event: 70 . . ... raw event: size 16 bytes . 0000: 00 00 00 46 00 00 00 10 00 00 00 00 00 00 00 00 ...F............ 0x128 [0x10]: PERF_RECORD_AUXTRACE_INFO type: 0 [root@s35lp76 perf]# Output after: # ./perf report -D -i perf.data.auxtrace |fgrep PERF_RECORD_AUXTRACE 0 0 0x128 [0x10]: PERF_RECORD_AUXTRACE_INFO type: 5 0 0 0x25a66 [0x30]: PERF_RECORD_AUXTRACE size: 0x40000 offset: 0 ref: 0 idx: 4 tid: -1 cpu: 4 .... Additional notes about the underlying hardware and software implementation, provided by Hendrik Brueckner (see Link: below). ============================================================================= The CPU-Measurement Facility (CPU-MF) provides a set of functions to obtain performance information on the mainframe. Basically, it was introduced with System z10 years ago for the z/Architecture, that means, 64-bit. For Linux, there are two facilities of interest, counter facility and sampling facility. The counter facility provides hardware counters for instructions, cycles, crypto-activities, and many more. The sampling facility is a hardware sampler that when started will write samples at a particular interval into a sampling buffer. At some point, for example, if a sample block is full, it generates an interrupt to collect samples (while the sampler continues to run). Few years ago, I started to provide the a perf PMU to use the counter and sampling facilities. Recently, the device driver was updated to also "export" the sampling buffer into the AUX area. Thomas now completed the related perf work to interpret and process these AUX data. If people are more interested in the sampling facility, they can have a look into: - The Load-Program-Parameter and the CPU-Measurement Facilities, SA23-2260-05 http://www-01.ibm.com/support/docview.wss?uid=isg26fcd1cc32246f4c8852574ce0044734a and to learn how-to use it for Linux on Z, have look at chapter 54, "Using the CPU-measurement facilities" in the: - Device Drivers, Features, and Commands, SC33-8411-34 http://public.dhe.ibm.com/software/dw/linux390/docu/l416dd34.pdf ============================================================================= Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Link: http://lkml.kernel.org/r/20180803100758.GA28475@linux.ibm.com Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180802074622.13641-2-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit a2b79838b891718dd4f0caf86dfa193af789245d Author: Nishanth Menon Date: Mon Jul 16 13:06:07 2018 -0500 mailbox: ti-msgmgr: Add support for Secure Proxy Secure Proxy is another communication scheme in Texas Instrument's devices intended to provide an unique communication path from various processors in the System on Chip(SoC) to a central System Controller. Secure proxy is, in effect, an evolution of current generation Message Manager hardware block found in K2G devices. However the following changes have taken place: Secure Proxy instance exposes "threads" or "proxies" which is primary representation of "a" communication channel. Each thread is preconfigured by System controller configuration based on SoC usage requirements. Secure proxy by itself represents a single "queue" of communication but allows the proxies to be independently operated. Each Secure proxy thread can uniquely have their own error and threshold interrupts allowing for more fine control of IRQ handling. Provide the driver support for Secure Proxy and thread instances. NOTE: Secure proxy configuration is only done by System Controller, hence these are assumed to be pre-configured instances. See AM65x Technical Reference Manual (SPRUID7, April 2018) for further details: http://www.ti.com/lit/pdf/spruid7 Signed-off-by: Nishanth Menon Signed-off-by: Jassi Brar commit 0f23a179746c10de8f8fe6ecc4767a0d6c824fa9 Author: Nishanth Menon Date: Mon Jul 16 13:06:06 2018 -0500 dt-bindings: mailbox: Add support for secure proxy threads Secure Proxy is another communication scheme in Texas Instrument's devices intended to provide an unique communication path from various processors in the System on Chip(SoC) to a central System Controller. Secure proxy is, in effect, an evolution of current generation Message Manager hardware block found in K2G devices. However the following changes have taken place: Secure Proxy instance exposes "threads" or "proxies" which is primary representation of "a" communication channel. Each thread is preconfigured by System controller configuration based on SoC usage requirements. Secure proxy by itself represents a single "queue" of communication but allows the proxies to be independently operated. Each Secure proxy thread can uniquely have their own error and threshold interrupts allowing for more fine control of IRQ handling. Provide an hardware description of the same for device tree representation. See AM65x Technical Reference Manual (SPRUID7, April 2018) for further details: http://www.ti.com/lit/pdf/spruid7 Reviewed-by: Rob Herring Signed-off-by: Nishanth Menon Signed-off-by: Jassi Brar commit 89c976c2f3fc02b95ae0a4a35dc3373ec8bfbdcb Author: Nishanth Menon Date: Mon Jul 16 13:06:05 2018 -0500 mailbox: ti-msgmgr: Move the memory region name to descriptor For newer generation of the hardware, the naming of the region is decided at integration level and there could be additional regions as well. Hence move the region naming to be described from compatible descriptor. Signed-off-by: Nishanth Menon Signed-off-by: Jassi Brar commit 8e56086292094290600edd7c526841df14b201ca Author: Nishanth Menon Date: Mon Jul 16 13:06:04 2018 -0500 mailbox: ti-msgmgr: Change message count mask to be descriptor based Change mask used to extract the message count to be descriptor based. This is to support changes for count location for various SoC solutions. Signed-off-by: Nishanth Menon Signed-off-by: Jassi Brar commit 5ab935e1942bdf8cab192478ac668b1589c47059 Author: Nishanth Menon Date: Mon Jul 16 13:06:03 2018 -0500 mailbox: ti-msgmgr: Allocate Rx channel resources only on request In a much bigger system SoCs, the number of Rx channels can be many and mostly unused based on the system of choice, and not all Rx channels need IRQs and allocating all memory at probe will be inefficient. Some SoCs could have total threads in the 100s and usage would be just 1 Rx thread. Thus, request and map the IRQs and allocate memory only when needed. Since these channels are requested by client drivers on need, our utilization will be optimal. Signed-off-by: Nishanth Menon Signed-off-by: Jassi Brar commit e7474ca1005768bddde2aad6fdd920245357377e Author: Nishanth Menon Date: Mon Jul 16 13:06:02 2018 -0500 mailbox: ti-msgmgr: Get rid of unused structure members Though q_proxies and q_slices do describe the hardware configuration, they are not necessary for operation given that the values are always default. Hence drop the same. Signed-off-by: Nishanth Menon Signed-off-by: Jassi Brar commit ea2ec1e80f78e5f1d6bd04315a2a0bf0646d8548 Author: Suman Anna Date: Wed Jul 11 18:42:12 2018 -0500 mailbox/omap: use of_device_get_match_data() to get match data The OMAP Mailbox driver is directly using an integer value as match data for distinguishing the interrupt register layout between OMAP2 and OMAP4+ SoCs. Introduce a dedicated structure for storing this match data, and simplify the probe function by using the of_device_get_match_data() function. This allows the driver to scale for 64-bit platforms by eliminating the unnecessary type-casting between a u32 and a void pointer types. Signed-off-by: Suman Anna Signed-off-by: Jassi Brar commit 2ad5157650b446f14a719280ba3670303bc4f439 Author: Suman Anna Date: Wed Jul 11 18:42:11 2018 -0500 mailbox/omap: switch to SPDX license identifier Use the appropriate SPDX license identifier in the OMAP Mailbox driver source files and drop the previous boilerplate license text. Signed-off-by: Suman Anna Signed-off-by: Jassi Brar commit 3512a18cbd8d09e22a790540cb9624c3c49827ba Author: Gustavo A. R. Silva Date: Thu Jul 26 12:11:39 2018 -0500 mailbox: xgene-slimpro: Fix potential NULL pointer dereference There is a potential execution path in which function platform_get_resource() returns NULL. If this happens, we will end up having a NULL pointer dereference. Fix this by replacing devm_ioremap with devm_ioremap_resource, which has the NULL check and the memory region request. This code was detected with the help of Coccinelle. Cc: stable@vger.kernel.org Fixes: f700e84f417b ("mailbox: Add support for APM X-Gene platform mailbox driver") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jassi Brar commit fa9ad876b8e0ebd2b4367ef1580f89be64ebd5d3 Author: Balakrishna Godavarthi Date: Fri Aug 3 17:46:32 2018 +0530 Bluetooth: hci_qca: Add support for Qualcomm Bluetooth chip wcn3990 Add support to set voltage/current of various regulators to power up/down Bluetooth chip wcn3990. Signed-off-by: Balakrishna Godavarthi Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit 4219d4686875fdd83df3da00fda5ff0551e0a2d7 Author: Balakrishna Godavarthi Date: Fri Aug 3 17:46:31 2018 +0530 Bluetooth: btqca: Add wcn3990 firmware download support. This patch enables the RAM and NV patch download for wcn3990. Signed-off-by: Balakrishna Godavarthi Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit be93a497fa7fea2302e0d35ad08dbed30e5791d3 Author: Balakrishna Godavarthi Date: Fri Aug 3 17:46:30 2018 +0530 Bluetooth: hci_qca: Enable 3.2 Mbps operating speed. Enable Qualcomm chips to operate at 3.2Mbps. Signed-off-by: Balakrishna Godavarthi Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit 83d9c5e56687a75cd75e537f97fb35009e9ba232 Author: Balakrishna Godavarthi Date: Fri Aug 3 17:46:29 2018 +0530 Bluetooth: hci_qca: Add wrapper functions for setting UART speed In function qca_setup, we set initial and operating speeds for Qualcomm Bluetooth SoC's. This block of code is common across different Qualcomm Bluetooth SoC's. Instead of duplicating the code, created a wrapper function to set the speeds. So that future coming SoC's can use these wrapper functions to set speeds. Signed-off-by: Balakrishna Godavarthi Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit aadebac4639d84ee51a12f2a1706fea1e4760b81 Author: Balakrishna Godavarthi Date: Fri Aug 3 17:46:28 2018 +0530 Bluetooth: btqca: Redefine qca_uart_setup() to generic function. Redefinition of qca_uart_setup will help future Qualcomm Bluetooth SoC, to use the same function instead of duplicating the function. Added new arguments soc_type and soc_ver to the functions. These arguments will help to decide type of firmware files to be loaded into Bluetooth chip. soc_type holds the Bluetooth chip connected to APPS processor. soc_ver holds the Bluetooth chip version. Signed-off-by: Balakrishna Godavarthi Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit ba493d4fbcb84bd14842c61cc077ffb5b3f7ecb1 Author: Balakrishna Godavarthi Date: Fri Aug 3 17:46:27 2018 +0530 Bluetooth: btqca: Rename ROME specific functions to generic functions Some of the QCA BTSoC ROME functions, are used for different versions or different make of BTSoC's. Instead of duplicating the same functions for new chip, update names of the functions that are used for both chips to keep this generic and would help in future when we would have new BT SoC. To have generic text in logs updated from ROME to QCA where ever possible. This avoids confusion to user, when using the future Qualcomm Bluetooth SoC's. Updated BT_DBG, BT_ERR and BT_INFO with bt_dev_dbg, bt_dev_err and bt_dev_info where ever applicable. Signed-off-by: Balakrishna Godavarthi Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit 505013555a47c8dfed11bd124d2f4ea71988c21e Author: Balakrishna Godavarthi Date: Fri Aug 3 17:46:26 2018 +0530 dt-bindings: net: bluetooth: Add device tree bindings for QTI chip wcn3990 This patch enables regulators for the Qualcomm Bluetooth wcn3990 controller. Signed-off-by: Balakrishna Godavarthi Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit 21e2156f3c4b2ad8b780a6d02342ca0e028a8acd Author: Andreas Gruenbacher Date: Fri Aug 3 10:57:52 2018 +0100 gfs2: Get rid of gfs2_ea_strlen Function gfs2_ea_strlen is only called from ea_list_i, so inline it there. Remove the duplicate switch statement and the creative use of memcpy to set a null byte. Signed-off-by: Andreas Gruenbacher Reviewed-by: Andrew Price Reviewed-by: Bob Peterson commit 4c79148970fbb3cfe078d4ad31a2c7a7722196a8 Author: Hans de Goede Date: Thu Aug 2 16:57:21 2018 +0200 Bluetooth: hci_h5: Add support for enable and device-wake GPIOs Add support for the enable and device-wake GPIOs used on ACPI enumerated RTL8723BS devices. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit b825d7c4052643a9b8a10d1c83213394f795c806 Author: Jeremy Cline Date: Thu Aug 2 16:57:20 2018 +0200 Bluetooth: hci_h5: Add support for the RTL8723BS Implement support for the RTL8723BS chip. Signed-off-by: Jeremy Cline [hdegoede@redhat.com: Port from bt3wire.c to hci_h5.c, drop broken GPIO code] Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 4eb3cbc4c4dbd3185c9e7595e38ed01a87bba80f Author: Jeremy Cline Date: Thu Aug 2 16:57:19 2018 +0200 Bluetooth: hci_h5: Add vendor setup, open, and close callbacks Allow vendor-specific setup, open, and close functions to be defined. Signed-off-by: Jeremy Cline [hdegoede@redhat.com: Port from bt3wire.c to hci_h5.c, drop dt support] Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit ce945552fde4a09f0bd4c0a33b8694b8515e2bd9 Author: Hans de Goede Date: Thu Aug 2 16:57:18 2018 +0200 Bluetooth: hci_h5: Add support for serdev enumerated devices Add basic support for serdev enumerated devices, note sine this does not (yet) declare any of / ACPI ids to bind to atm this is a nop. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 1cc194caaffbe07b8e08d464d8c309bc8e824618 Author: Hans de Goede Date: Thu Aug 2 16:57:17 2018 +0200 Bluetooth: btrtl: Add support for a config filename postfix The contents of the rtl_bt/rtlXXXX_config.bin file may be board specific allow the caller of btrtl_initialize to specify a postfix identifying the board, which if specified will make btrtl_initialize look for rtl_bt/rtlXXXX_config-.bin instead. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit c50903e3ee1b55d0d8a43eebed0c159e91986496 Author: Martin Blumenstingl Date: Thu Aug 2 16:57:16 2018 +0200 Bluetooth: btrtl: add support for the RTL8723BS and RTL8723DS chips The Realtek RTL8723BS and RTL8723DS chipsets are SDIO wifi chips. They also contain a Bluetooth module which is connected via UART to the host. Realtek's userspace initialization tool (rtk_hciattach) differentiates these two via the HCI version and revision returned by the HCI_OP_READ_LOCAL_VERSION command. Additionally we apply these checks only the for UART devices. Everything else is assumed to be a "RTL8723B" which was originally supported by the driver (communicating via USB). Signed-off-by: Martin Blumenstingl Signed-off-by: Jeremy Cline Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit b85b0ee1001b112a3dd4c4718d80b0c40551a2bb Author: Martin Blumenstingl Date: Thu Aug 2 16:57:15 2018 +0200 Bluetooth: btrtl: add support for retrieving the UART settings The UART settings are embedded in the config blob. This has to be parsed to successfully initialize the Bluetooth part of the RTL8723BS (which is an SDIO chip, but the Bluetooth part is connected via UART). The Realtek "rtl8723bs_bt" and "rtl8723ds_bt" userspace Bluetooth UART initialization tools (rtk_hciattach) use the following sequence: - send H5 sync pattern (already supported by hci_h5) - get LMP version (already supported by btrtl) - get ROM version (already supported by btrtl) - load the firmware and config for the current chipset (already supported by btrtl) - read UART settings from the config blob (part of this patch) - send UART settings via a vendor command to the device (which changes the baudrate of the device and enables or disables flow control depending on the config) - change the baudrate and flow control settings on the host - send the firmware and config blob to the device (already supported by btrtl) Sending the last firmware and config blob download command (rtl_download_cmd) fails if the UART settings are not updated beforehand. This is presumably because the device applies the config right after the firmware and config blob download - which means that at this point the host is using different UART settings than the device (which will obviously result in non-working communication). Signed-off-by: Martin Blumenstingl Signed-off-by: Jeremy Cline Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit a5c76e67ca82f12b6ba6d2cbc0d3ff5dc89c45af Author: Hans de Goede Date: Thu Aug 2 16:57:14 2018 +0200 Bluetooth: btrtl: Use rtl_dev_err and rtl_dev_info Consistently use rtl_dev_err and rtl_dev_info everywhere for messages. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 26503ad25de8c7c93a2037f919c2e49a62cf65f1 Author: Martin Blumenstingl Date: Thu Aug 2 16:57:13 2018 +0200 Bluetooth: btrtl: split the device initialization into smaller parts This prepares the btrtl code so it can be used to initialize Bluetooth modules connected via UART (these are found for example on the RTL8723BS and RTL8723DS SDIO chips, which come with an embedded UART Bluetooth module). The Realtek "rtl8723bs_bt" and "rtl8723ds_bt" userspace Bluetooth UART initialization tools (rtk_hciattach) use the following sequence: 1) send H5 sync pattern (already supported by hci_h5) 2) get LMP version (already supported by btrtl) 3) get ROM version (already supported by btrtl) 4) load the firmware and config for the current chipset (already supported by btrtl) 5) read UART settings from the config blob (currently not supported) 6) send UART settings via a vendor command to the device (which changes the baudrate of the device and enables or disables flow control depending on the config) 7) change the baudrate and flow control settings on the host 8) send the firmware and config blob to the device (already supported by btrtl) The main reason why the initialization has to be split is step #7. This requires changes to the underlying "bus", which should be kept outside of the "generic" btrtl driver. The idea for this split is borrowed from the btbcm driver but adjusted where needed (the btrtl driver for example needs two blobs: firmware and config, while the btbcm only needs one). This also prepares the code for step #5 (parsing the config blob) by centralizing the code which loads the firmware and config blobs and storing the result in the new struct btrtl_device_info. Signed-off-by: Martin Blumenstingl Signed-off-by: Jeremy Cline Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit f96dbd322a8f1368dc663c48c7dc3c66a086ec9f Author: Martin Blumenstingl Date: Thu Aug 2 16:57:12 2018 +0200 Bluetooth: btrtl: add MODULE_FIRMWARE declarations This makes the firmware names show up in modinfo. Signed-off-by: Martin Blumenstingl Signed-off-by: Jeremy Cline Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 85418feff6faa96b6f3cee29235821d9afd8a592 Author: Marcel Holtmann Date: Fri Aug 3 11:20:49 2018 +0200 Bluetooth: btusb: Use bt_dev_err for Intel firmware loading errors Replace the BT_ERR functions with bt_dev_err to get a consistent error printout that always prefixes the HCI device identifier. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 4a7a54a55e7237386cacc73f173e74329773ac93 Author: Thomas Gleixner Date: Fri Aug 3 13:06:35 2018 +0200 x86/intel_rdt: Disable PMU access Peter is objecting to the direct PMU access in RDT. Right now the PMU usage is broken anyway as it is not coordinated with perf. Until this discussion settled, disable the PMU mechanics by simply rejecting the type '2' measurement in the resctrl file. Reported-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Cc: Reinette Chatre Cc: Dave Hansen Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com CC: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: hpa@zytor.com commit 706d51681d636a0c4a5ef53395ec3b803e45ed4d Author: Sai Praneeth Date: Wed Aug 1 11:42:25 2018 -0700 x86/speculation: Support Enhanced IBRS on future CPUs Future Intel processors will support "Enhanced IBRS" which is an "always on" mode i.e. IBRS bit in SPEC_CTRL MSR is enabled once and never disabled. From the specification [1]: "With enhanced IBRS, the predicted targets of indirect branches executed cannot be controlled by software that was executed in a less privileged predictor mode or on another logical processor. As a result, software operating on a processor with enhanced IBRS need not use WRMSR to set IA32_SPEC_CTRL.IBRS after every transition to a more privileged predictor mode. Software can isolate predictor modes effectively simply by setting the bit once. Software need not disable enhanced IBRS prior to entering a sleep state such as MWAIT or HLT." If Enhanced IBRS is supported by the processor then use it as the preferred spectre v2 mitigation mechanism instead of Retpoline. Intel's Retpoline white paper [2] states: "Retpoline is known to be an effective branch target injection (Spectre variant 2) mitigation on Intel processors belonging to family 6 (enumerated by the CPUID instruction) that do not have support for enhanced IBRS. On processors that support enhanced IBRS, it should be used for mitigation instead of retpoline." The reason why Enhanced IBRS is the recommended mitigation on processors which support it is that these processors also support CET which provides a defense against ROP attacks. Retpoline is very similar to ROP techniques and might trigger false positives in the CET defense. If Enhanced IBRS is selected as the mitigation technique for spectre v2, the IBRS bit in SPEC_CTRL MSR is set once at boot time and never cleared. Kernel also has to make sure that IBRS bit remains set after VMEXIT because the guest might have cleared the bit. This is already covered by the existing x86_spec_ctrl_set_guest() and x86_spec_ctrl_restore_host() speculation control functions. Enhanced IBRS still requires IBPB for full mitigation. [1] Speculative-Execution-Side-Channel-Mitigations.pdf [2] Retpoline-A-Branch-Target-Injection-Mitigation.pdf Both documents are available at: https://bugzilla.kernel.org/show_bug.cgi?id=199511 Originally-by: David Woodhouse Signed-off-by: Sai Praneeth Prakhya Signed-off-by: Thomas Gleixner Cc: Tim C Chen Cc: Dave Hansen Cc: Ravi Shankar Link: https://lkml.kernel.org/r/1533148945-24095-1-git-send-email-sai.praneeth.prakhya@intel.com commit 301d328a6f8b53bb86c5ecf72db7bc178bcf1999 Author: Peter Feiner Date: Wed Aug 1 11:06:57 2018 -0700 x86/cpufeatures: Add EPT_AD feature bit Some Intel processors have an EPT feature whereby the accessed & dirty bits in EPT entries can be updated by HW. MSR IA32_VMX_EPT_VPID_CAP exposes the presence of this capability. There is no point in trying to use that new feature bit in the VMX code as VMX needs to read the MSR anyway to access other bits, but having the feature bit for EPT_AD in place helps virtualization management as it exposes "ept_ad" in /proc/cpuinfo/$proc/flags if the feature is present. [ tglx: Amended changelog ] Signed-off-by: Peter Feiner Signed-off-by: Peter Shier Signed-off-by: Thomas Gleixner Reviewed-by: Jim Mattson Cc: "H. Peter Anvin" Cc: Borislav Petkov Cc: Konrad Rzeszutek Wilk Cc: David Woodhouse Link: https://lkml.kernel.org/r/20180801180657.138051-1-pshier@google.com commit 13a01635823c409a0911304ee50987cb851317da Author: Gustavo A. R. Silva Date: Thu Aug 2 15:42:39 2018 -0500 ALSA: es18xx: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115075 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 734be97b967c7e2bab72b34da87534ccd854c72d Author: Gustavo A. R. Silva Date: Thu Aug 2 15:41:55 2018 -0500 ALSA: opti9xx: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 402016 ("Missing break in switch") Addresses-Coverity-ID: 1056542 ("Missing break in switch") Addresses-Coverity-ID: 1339579 ("Missing break in switch") Addresses-Coverity-ID: 1369526 ("Missing break in switch") Addresses-Coverity-ID: 1369529 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 3e313f34720ea1bb876636263e30a779ff65836e Author: Gustavo A. R. Silva Date: Thu Aug 2 15:41:21 2018 -0500 ALSA: opti92x: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1165394 ("Missing break in switch") Addresses-Coverity-ID: 1167851 ("Missing break in switch") Addresses-Coverity-ID: 402015 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit a9fe47e5e96be6401738f6c1e087edbcff6a5ceb Author: Gustavo A. R. Silva Date: Thu Aug 2 15:40:37 2018 -0500 ALSA: galaxy: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1468367 ("Missing break in switch") Addresses-Coverity-ID: 115037 ("Missing break in switch") Addresses-Coverity-ID: 115038 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 1b6266ebe3da8198e9a02fbad77bbb56e2f7ce2e Author: Sinan Kaya Date: Thu Aug 2 23:09:41 2018 -0700 watchdog: Reduce message verbosity Code is emitting the following error message during boot on systems without PMU hardware support while probing NMI capability. NMI watchdog: Perf event create on CPU 0 failed with -2 This error is emitted as the perf subsystem returns -ENOENT due to lack of PMUs in the system. It is followed by the warning that NMI watchdog is disabled: NMI watchdog: Perf NMI watchdog permanently disabled While NMI disabled information is useful for ordinary users, seeing a PERF event create failed with error code -2 is not. Reduce the message severity to debug so that if debugging is still possible in case the error code returned by perf is required for analysis. Signed-off-by: Sinan Kaya Signed-off-by: Thomas Gleixner Acked-by: Don Zickus Cc: Kate Stewart Cc: Greg Kroah-Hartman Cc: Colin Ian King Cc: Peter Zijlstra Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599368 Link: https://lkml.kernel.org/r/20180803060943.2643-1-okaya@kernel.org commit 4f7799d96e6621ce584df60739e1480a6fd89f0a Author: Palmer Dabbelt Date: Fri Jun 22 10:01:26 2018 -0700 genirq/irqchip: Remove MULTI_IRQ_HANDLER as it's now obselete Now that every user of MULTI_IRQ_HANDLER has been convereted over to use GENERIC_IRQ_MULTI_HANDLER remove the references to MULTI_IRQ_HANDLER. Signed-off-by: Palmer Dabbelt Signed-off-by: Thomas Gleixner Cc: linux@armlinux.org.uk Cc: catalin.marinas@arm.com Cc: Will Deacon Cc: jonas@southpole.se Cc: stefan.kristiansson@saunalahti.fi Cc: shorne@gmail.com Cc: jason@lakedaemon.net Cc: marc.zyngier@arm.com Cc: Arnd Bergmann Cc: nicolas.pitre@linaro.org Cc: vladimir.murzin@arm.com Cc: keescook@chromium.org Cc: jinb.park7@gmail.com Cc: yamada.masahiro@socionext.com Cc: alexandre.belloni@bootlin.com Cc: pombredanne@nexb.com Cc: Greg KH Cc: kstewart@linuxfoundation.org Cc: jhogan@kernel.org Cc: mark.rutland@arm.com Cc: ard.biesheuvel@linaro.org Cc: james.morse@arm.com Cc: linux-arm-kernel@lists.infradead.org Cc: openrisc@lists.librecores.org Link: https://lkml.kernel.org/r/20180622170126.6308-6-palmer@sifive.com commit c5ca4560de0f04a3c872bdd17ae3378762c66bd2 Author: Palmer Dabbelt Date: Fri Jun 22 10:01:25 2018 -0700 openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER It appears that openrisc copied arm64's GENERIC_IRQ_MULTI_HANDLER code (which came from arm). Cnvert it to use the generic version. Signed-off-by: Palmer Dabbelt Signed-off-by: Thomas Gleixner Acked-by: Stafford Horne Cc: linux@armlinux.org.uk Cc: catalin.marinas@arm.com Cc: Will Deacon Cc: jonas@southpole.se Cc: stefan.kristiansson@saunalahti.fi Cc: jason@lakedaemon.net Cc: marc.zyngier@arm.com Cc: Arnd Bergmann Cc: nicolas.pitre@linaro.org Cc: vladimir.murzin@arm.com Cc: keescook@chromium.org Cc: jinb.park7@gmail.com Cc: yamada.masahiro@socionext.com Cc: alexandre.belloni@bootlin.com Cc: pombredanne@nexb.com Cc: Greg KH Cc: kstewart@linuxfoundation.org Cc: jhogan@kernel.org Cc: mark.rutland@arm.com Cc: ard.biesheuvel@linaro.org Cc: james.morse@arm.com Cc: linux-arm-kernel@lists.infradead.org Cc: openrisc@lists.librecores.org Link: https://lkml.kernel.org/r/20180622170126.6308-5-palmer@sifive.com commit 78ae2e1cd845480caaa2f181fee64e51f679f5aa Author: Palmer Dabbelt Date: Fri Jun 22 10:01:24 2018 -0700 arm64: Use the new GENERIC_IRQ_MULTI_HANDLER It appears arm64 copied arm's GENERIC_IRQ_MULTI_HANDLER code, but made it unconditional. Converts the arm64 code to use the new generic code, which simply consists of deleting the arm64 code and setting MULTI_IRQ_HANDLER instead. Signed-off-by: Palmer Dabbelt Signed-off-by: Thomas Gleixner Reviewed-by: Christoph Hellwig Cc: linux@armlinux.org.uk Cc: catalin.marinas@arm.com Cc: Will Deacon Cc: jonas@southpole.se Cc: stefan.kristiansson@saunalahti.fi Cc: shorne@gmail.com Cc: jason@lakedaemon.net Cc: marc.zyngier@arm.com Cc: Arnd Bergmann Cc: nicolas.pitre@linaro.org Cc: vladimir.murzin@arm.com Cc: keescook@chromium.org Cc: jinb.park7@gmail.com Cc: yamada.masahiro@socionext.com Cc: alexandre.belloni@bootlin.com Cc: pombredanne@nexb.com Cc: Greg KH Cc: kstewart@linuxfoundation.org Cc: jhogan@kernel.org Cc: mark.rutland@arm.com Cc: ard.biesheuvel@linaro.org Cc: james.morse@arm.com Cc: linux-arm-kernel@lists.infradead.org Cc: openrisc@lists.librecores.org Link: https://lkml.kernel.org/r/20180622170126.6308-4-palmer@sifive.com commit 4c301f9b6a94bb383089bc847083e287e9bfc96e Author: Palmer Dabbelt Date: Fri Jun 22 10:01:23 2018 -0700 ARM: Convert to GENERIC_IRQ_MULTI_HANDLER Converts the ARM interrupt code to use the recently added GENERIC_IRQ_MULTI_HANDLER, which is essentially just a copy of ARM's existhing MULTI_IRQ_HANDLER. The only changes are: * handle_arch_irq is now defined in a generic C file instead of an arm-specific assembly file. * handle_arch_irq is now marked as __ro_after_init. Signed-off-by: Palmer Dabbelt Signed-off-by: Thomas Gleixner Cc: linux@armlinux.org.uk Cc: catalin.marinas@arm.com Cc: Will Deacon Cc: jonas@southpole.se Cc: stefan.kristiansson@saunalahti.fi Cc: shorne@gmail.com Cc: jason@lakedaemon.net Cc: marc.zyngier@arm.com Cc: Arnd Bergmann Cc: nicolas.pitre@linaro.org Cc: vladimir.murzin@arm.com Cc: keescook@chromium.org Cc: jinb.park7@gmail.com Cc: yamada.masahiro@socionext.com Cc: alexandre.belloni@bootlin.com Cc: pombredanne@nexb.com Cc: Greg KH Cc: kstewart@linuxfoundation.org Cc: jhogan@kernel.org Cc: mark.rutland@arm.com Cc: ard.biesheuvel@linaro.org Cc: james.morse@arm.com Cc: linux-arm-kernel@lists.infradead.org Cc: openrisc@lists.librecores.org Link: https://lkml.kernel.org/r/20180622170126.6308-3-palmer@sifive.com commit 08fb550cb3f8e1efff5586b938eeedddb3ba0506 Author: Palmer Dabbelt Date: Fri Jun 22 10:01:22 2018 -0700 irqchip: Port the ARM IRQ drivers to GENERIC_IRQ_MULTI_HANDLER GENERIC_IRQ_MULTI_HANDLER is incompatible with MULTI_IRQ_HANDLER because they define the same symbols. Multiple generic irqchip drivers select MULTI_IRQ_HANDLER, which is now defined on all architectures that provide set_handle_irq(). To solve this select GENERIC_IRQ_MULTI_HANDLER for all drivers that used to select MULTI_IRQ_HANDLER, but only when MULTI_IRQ_HANDLER doesn't exist. After that every architecture can be converted over from MULTI_IRQ_HANDLER to GENERIC_IRQ_MULTI_HANDLER before removing the extra MULTI_IRQ_HANDLER scaffolding. Signed-off-by: Palmer Dabbelt Signed-off-by: Thomas Gleixner Cc: linux@armlinux.org.uk Cc: catalin.marinas@arm.com Cc: Will Deacon Cc: jonas@southpole.se Cc: stefan.kristiansson@saunalahti.fi Cc: shorne@gmail.com Cc: jason@lakedaemon.net Cc: marc.zyngier@arm.com Cc: Arnd Bergmann Cc: nicolas.pitre@linaro.org Cc: vladimir.murzin@arm.com Cc: keescook@chromium.org Cc: jinb.park7@gmail.com Cc: yamada.masahiro@socionext.com Cc: alexandre.belloni@bootlin.com Cc: pombredanne@nexb.com Cc: Greg KH Cc: kstewart@linuxfoundation.org Cc: jhogan@kernel.org Cc: mark.rutland@arm.com Cc: ard.biesheuvel@linaro.org Cc: james.morse@arm.com Cc: linux-arm-kernel@lists.infradead.org Cc: openrisc@lists.librecores.org Cc: Shea Levy Link: https://lkml.kernel.org/r/20180622170126.6308-2-palmer@sifive.com commit 9eab9901b015f489199105c470de1ffc337cfabb Author: Reza Arbab Date: Thu Aug 2 23:03:36 2018 -0500 powerpc/powernv: Fix concurrency issue with npu->mmio_atsd_usage We've encountered a performance issue when multiple processors stress {get,put}_mmio_atsd_reg(). These functions contend for mmio_atsd_usage, an unsigned long used as a bitmask. The accesses to mmio_atsd_usage are done using test_and_set_bit_lock() and clear_bit_unlock(). As implemented, both of these will require a (successful) stwcx to that same cache line. What we end up with is thread A, attempting to unlock, being slowed by other threads repeatedly attempting to lock. A's stwcx instructions fail and retry because the memory reservation is lost every time a different thread beats it to the punch. There may be a long-term way to fix this at a larger scale, but for now resolve the immediate problem by gating our call to test_and_set_bit_lock() with one to test_bit(), which is obviously implemented without using a store. Fixes: 1ab66d1fbada ("powerpc/powernv: Introduce address translation services for Nvlink2") Signed-off-by: Reza Arbab Acked-by: Alistair Popple Signed-off-by: Michael Ellerman commit 06832fc004815b4b43628d21fc81715e8e7cadff Author: Christoph Hellwig Date: Mon Jul 30 09:37:21 2018 +0200 powerpc: Do not redefine NEED_DMA_MAP_STATE kernel/dma/Kconfig already defines NEED_DMA_MAP_STATE, just select it from CONFIG_PPC using the same condition as an if guard. Signed-off-by: Christoph Hellwig [mpe: Move it under PPC] Signed-off-by: Michael Ellerman commit 6e0495c2e8ac39b1aad0a4588fe64413ce9028c0 Author: Guenter Roeck Date: Mon Jul 30 18:44:14 2018 -0700 powerpc/4xx: Fix error return path in ppc4xx_msi_probe() An arbitrary error in ppc4xx_msi_probe() quite likely results in a crash similar to the following, seen after dma_alloc_coherent() returned an error. Unable to handle kernel paging request for data at address 0x00000000 Faulting instruction address: 0xc001bff0 Oops: Kernel access of bad area, sig: 11 [#1] BE Canyonlands Modules linked in: CPU: 0 PID: 1 Comm: swapper Tainted: G W 4.18.0-rc6-00010-gff33d1030a6c #1 NIP: c001bff0 LR: c001c418 CTR: c01faa7c REGS: cf82db40 TRAP: 0300 Tainted: G W (4.18.0-rc6-00010-gff33d1030a6c) MSR: 00029000 CR: 28002024 XER: 00000000 DEAR: 00000000 ESR: 00000000 GPR00: c001c418 cf82dbf0 cf828000 cf8de400 00000000 00000000 000000c4 000000c4 GPR08: c0481ea4 00000000 00000000 000000c4 22002024 00000000 c00025e8 00000000 GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a GPR24: 00029000 0000000c 00000000 cf8de410 c0494d60 c0494d60 cf8bebc0 00000001 NIP [c001bff0] ppc4xx_of_msi_remove+0x48/0xa0 LR [c001c418] ppc4xx_msi_probe+0x294/0x3b8 Call Trace: [cf82dbf0] [00029000] 0x29000 (unreliable) [cf82dc10] [c001c418] ppc4xx_msi_probe+0x294/0x3b8 [cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c [cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350 [cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac [cf82dcf0] [c0207e88] __device_attach+0xe8/0x160 [cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc [cf82dd40] [c02050c8] device_add+0x404/0x5c4 [cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8 [cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220 [cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220 [cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec [cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54 [cf82dea0] [c0002404] do_one_initcall+0x40/0x188 [cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0 [cf82df30] [c0002600] kernel_init+0x18/0x104 [cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c Instruction dump: 90010024 813d0024 2f890000 83c30058 41bd0014 48000038 813d0024 7f89f800 409d002c 813e000c 57ea103a 3bff0001 <7c69502e> 2f830000 419effe0 4803b26d ---[ end trace 8cf551077ecfc42a ]--- Fix it up. Specifically, - Return valid error codes from ppc4xx_setup_pcieh_hw(), have it clean up after itself, and only access hardware after all possible error conditions have been handled. - Use devm_kzalloc() instead of kzalloc() in ppc4xx_msi_probe() Signed-off-by: Guenter Roeck Reviewed-by: Christoph Hellwig Signed-off-by: Michael Ellerman commit d6e43798b3d9cb8c59e1fccfaeec7cb396dc0699 Author: Eric Biggers Date: Fri Jul 27 15:36:11 2018 -0700 crypto: dh - make crypto_dh_encode_key() make robust Make it return -EINVAL if crypto_dh_key_len() is incorrect rather than overflowing the buffer. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 35f7d5225ffcbf1b759f641aec1735e3a89b1914 Author: Eric Biggers Date: Fri Jul 27 15:36:10 2018 -0700 crypto: dh - fix calculating encoded key size It was forgotten to increase DH_KPP_SECRET_MIN_SIZE to include 'q_size', causing an out-of-bounds write of 4 bytes in crypto_dh_encode_key(), and an out-of-bounds read of 4 bytes in crypto_dh_decode_key(). Fix it, and fix the lengths of the test vectors to match this. Reported-by: syzbot+6d38d558c25b53b8f4ed@syzkaller.appspotmail.com Fixes: e3fe0ae12962 ("crypto: dh - add public key verification test") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit afb31cd2d1a1bc3ca055fb2519ec4e9ab969ffe0 Author: Tom Lendacky Date: Thu Jul 26 09:37:59 2018 -0500 crypto: ccp - Check for NULL PSP pointer at module unload Should the PSP initialization fail, the PSP data structure will be freed and the value contained in the sp_device struct set to NULL. At module unload, psp_dev_destroy() does not check if the pointer value is NULL and will end up dereferencing a NULL pointer. Add a pointer check of the psp_data field in the sp_device struct in psp_dev_destroy() and return immediately if it is NULL. Cc: # 4.16.x- Fixes: 2a6170dfe755 ("crypto: ccp: Add Platform Security Processor (PSP) device support") Signed-off-by: Tom Lendacky Acked-by: Gary R Hook Signed-off-by: Herbert Xu commit 4e34e51f48ab7f77a4022aa810a786daa3eb3e22 Author: Eric Biggers Date: Tue Jul 24 18:29:07 2018 -0700 crypto: arm/chacha20 - always use vrev for 16-bit rotates The 4-way ChaCha20 NEON code implements 16-bit rotates with vrev32.16, but the one-way code (used on remainder blocks) implements it with vshl + vsri, which is slower. Switch the one-way code to vrev32.16 too. Signed-off-by: Eric Biggers Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit f53ad3e1b35a558528f6d0041568016d1f623a9d Author: Gilad Ben-Yossef Date: Tue Jul 24 15:12:46 2018 +0100 crypto: ccree - allow bigger than sector XTS op The ccree driver had a sanity check that we are not asked to encrypt an XTS buffer bigger than a sane sector size since XTS IV needs to include the sector number in the IV so this is not expected in any real use case. Unfortunately, this breaks cryptsetup benchmark test which has a synthetic performance test using 64k buffer of data with the same IV. Remove the sanity check and allow the user to hang themselves and/or run benchmarks if they so wish. Reported-by: Geert Uytterhoeven Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit e30368f3f3ee72e20aa4b1fdb6ec2c5ddcd7e2d1 Author: Gilad Ben-Yossef Date: Tue Jul 24 15:12:45 2018 +0100 crypto: ccree - zero all of request ctx before use In certain error path req_ctx->iv was being freed despite not being allocated because it was not initialized to NULL. Rather than play whack a mole with the structure various field, zero it before use. This fixes a kernel panic that may occur if an invalid buffer size was requested triggering the bug above. Fixes: 63ee04c8b491 ("crypto: ccree - add skcipher support") Reported-by: Geert Uytterhoeven Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit f5c19df90ae7fc21d3dcf50af9d6b456aa6b3351 Author: Gilad Ben-Yossef Date: Tue Jul 24 15:12:44 2018 +0100 crypto: ccree - remove cipher ivgen left overs IV generation is not available via the skcipher interface. Remove the left over support of it from the ablkcipher days. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 76c9e53e633c8584f752effc4412d395ccf90547 Author: Gilad Ben-Yossef Date: Tue Jul 24 15:12:43 2018 +0100 crypto: ccree - drop useless type flag during reg Drop the explicit setting of CRYPTO_ALG_TYPE_AEAD or CRYPTO_ALG_TYPE_SKCIPHER flags during alg registration as they are set anyway by the framework. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 318abdfbe708aaaa652c79fb500e9bd60521f9dc Author: Eric Biggers Date: Mon Jul 23 10:54:58 2018 -0700 crypto: ablkcipher - fix crash flushing dcache in error path Like the skcipher_walk and blkcipher_walk cases: scatterwalk_done() is only meant to be called after a nonzero number of bytes have been processed, since scatterwalk_pagedone() will flush the dcache of the *previous* page. But in the error case of ablkcipher_walk_done(), e.g. if the input wasn't an integer number of blocks, scatterwalk_done() was actually called after advancing 0 bytes. This caused a crash ("BUG: unable to handle kernel paging request") during '!PageSlab(page)' on architectures like arm and arm64 that define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE, provided that the input was page-aligned as in that case walk->offset == 0. Fix it by reorganizing ablkcipher_walk_done() to skip the scatterwalk_advance() and scatterwalk_done() if an error has occurred. Reported-by: Liu Chao Fixes: bf06099db18a ("crypto: skcipher - Add ablkcipher_walk interfaces") Cc: # v2.6.35+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 0868def3e4100591e7a1fdbf3eed1439cc8f7ca3 Author: Eric Biggers Date: Mon Jul 23 10:54:57 2018 -0700 crypto: blkcipher - fix crash flushing dcache in error path Like the skcipher_walk case: scatterwalk_done() is only meant to be called after a nonzero number of bytes have been processed, since scatterwalk_pagedone() will flush the dcache of the *previous* page. But in the error case of blkcipher_walk_done(), e.g. if the input wasn't an integer number of blocks, scatterwalk_done() was actually called after advancing 0 bytes. This caused a crash ("BUG: unable to handle kernel paging request") during '!PageSlab(page)' on architectures like arm and arm64 that define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE, provided that the input was page-aligned as in that case walk->offset == 0. Fix it by reorganizing blkcipher_walk_done() to skip the scatterwalk_advance() and scatterwalk_done() if an error has occurred. This bug was found by syzkaller fuzzing. Reproducer, assuming ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE: #include #include #include int main() { struct sockaddr_alg addr = { .salg_type = "skcipher", .salg_name = "ecb(aes-generic)", }; char buffer[4096] __attribute__((aligned(4096))) = { 0 }; int fd; fd = socket(AF_ALG, SOCK_SEQPACKET, 0); bind(fd, (void *)&addr, sizeof(addr)); setsockopt(fd, SOL_ALG, ALG_SET_KEY, buffer, 16); fd = accept(fd, NULL, NULL); write(fd, buffer, 15); read(fd, buffer, 15); } Reported-by: Liu Chao Fixes: 5cde0af2a982 ("[CRYPTO] cipher: Added block cipher type") Cc: # v2.6.19+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 8088d3dd4d7c6933a65aa169393b5d88d8065672 Author: Eric Biggers Date: Mon Jul 23 10:54:56 2018 -0700 crypto: skcipher - fix crash flushing dcache in error path scatterwalk_done() is only meant to be called after a nonzero number of bytes have been processed, since scatterwalk_pagedone() will flush the dcache of the *previous* page. But in the error case of skcipher_walk_done(), e.g. if the input wasn't an integer number of blocks, scatterwalk_done() was actually called after advancing 0 bytes. This caused a crash ("BUG: unable to handle kernel paging request") during '!PageSlab(page)' on architectures like arm and arm64 that define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE, provided that the input was page-aligned as in that case walk->offset == 0. Fix it by reorganizing skcipher_walk_done() to skip the scatterwalk_advance() and scatterwalk_done() if an error has occurred. This bug was found by syzkaller fuzzing. Reproducer, assuming ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE: #include #include #include int main() { struct sockaddr_alg addr = { .salg_type = "skcipher", .salg_name = "cbc(aes-generic)", }; char buffer[4096] __attribute__((aligned(4096))) = { 0 }; int fd; fd = socket(AF_ALG, SOCK_SEQPACKET, 0); bind(fd, (void *)&addr, sizeof(addr)); setsockopt(fd, SOL_ALG, ALG_SET_KEY, buffer, 16); fd = accept(fd, NULL, NULL); write(fd, buffer, 15); read(fd, buffer, 15); } Reported-by: Liu Chao Fixes: b286d8b1a690 ("crypto: skcipher - Add skcipher walk interface") Cc: # v4.10+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 2a57c0be225f8c7140f8791819f5afbb6fb34c5a Author: Eric Biggers Date: Mon Jul 23 10:21:29 2018 -0700 crypto: skcipher - remove unnecessary setting of walk->nbytes Setting 'walk->nbytes = walk->total' in skcipher_walk_first() doesn't make sense because actually walk->nbytes needs to be set to the length of the first step in the walk, which may be less than walk->total. This is done by skcipher_walk_next() which is called immediately afterwards. Also walk->nbytes was already set to 0 in skcipher_walk_skcipher(), which is a better default value in case it's forgotten to be set later. Therefore, remove the unnecessary assignment to walk->nbytes. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 3dd8cc00c34ab9cde4bcc808ebc607e7b9861280 Author: Eric Biggers Date: Mon Jul 23 10:04:28 2018 -0700 crypto: scatterwalk - remove scatterwalk_samebuf() scatterwalk_samebuf() is never used. Remove it. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 8c30fbe63e4eff1b221f8db70ae5c48a9331eae0 Author: Eric Biggers Date: Mon Jul 23 10:01:33 2018 -0700 crypto: scatterwalk - remove 'chain' argument from scatterwalk_crypto_chain() All callers pass chain=0 to scatterwalk_crypto_chain(). Remove this unneeded parameter. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 0567fc9e90b9b1c8dbce8a5468758e6206744d4a Author: Eric Biggers Date: Mon Jul 23 09:57:50 2018 -0700 crypto: skcipher - fix aligning block size in skcipher_copy_iv() The ALIGN() macro needs to be passed the alignment, not the alignmask (which is the alignment minus 1). Fixes: b286d8b1a690 ("crypto: skcipher - Add skcipher walk interface") Cc: # v4.10+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit e4a1f7858ab834b2cdddfc51be2f5debae782029 Author: Jonathan Cameron Date: Mon Jul 23 16:49:55 2018 +0100 arm64: dts: hisi: add SEC crypto accelerator nodes for hip07 SoC Enable all 4 SEC units available on d05 boards. Signed-off-by: Jonathan Cameron Signed-off-by: Herbert Xu commit 915e4e8413dacc086efcef4de04fdfdca57e8b1c Author: Jonathan Cameron Date: Mon Jul 23 16:49:54 2018 +0100 crypto: hisilicon - SEC security accelerator driver This accelerator is found inside hisilicon hip06 and hip07 SoCs. Each instance provides a number of queues which feed a different number of backend acceleration units. The queues are operating in an out of order mode in the interests of throughput. The silicon does not do tracking of dependencies between multiple 'messages' or update of the IVs as appropriate for training. Hence where relevant we need to do this in software. Signed-off-by: Jonathan Cameron Signed-off-by: Herbert Xu commit 778bd9924dba13d4816cbf73f9ae1519fe445a25 Author: Jonathan Cameron Date: Mon Jul 23 16:49:53 2018 +0100 dt-bindings: Add bindings for Hisilicon SEC crypto accelerators. The hip06 and hip07 SoCs contain a number of these crypto units which accelerate AES and DES operations. Signed-off-by: Jonathan Cameron Reviewed-by: Rob Herring Signed-off-by: Herbert Xu commit 2af632996b898687d382f2b52e820141aba72d63 Author: Horia Geantă Date: Mon Jul 23 17:18:48 2018 +0300 crypto: tcrypt - reschedule during speed tests Avoid RCU stalls in the case of non-preemptible kernel and lengthy speed tests by rescheduling when advancing from one block size to another. Signed-off-by: Horia Geantă Signed-off-by: Herbert Xu commit f6adeef77e0724b695fa2b4a655936bb04df075c Author: Jia-Ju Bai Date: Mon Jul 23 16:43:46 2018 +0800 crypto: virtio - Replace GFP_ATOMIC with GFP_KERNEL in __virtio_crypto_ablkcipher_do_req() __virtio_crypto_ablkcipher_do_req() is never called in atomic context. __virtio_crypto_ablkcipher_do_req() is only called by virtio_crypto_ablkcipher_crypt_req(), which is only called by virtcrypto_find_vqs() that is never called in atomic context. __virtio_crypto_ablkcipher_do_req() calls kzalloc_node() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Herbert Xu commit 8e8c0386b1fdd495173f085c8f58926d2a181c1c Author: Jia-Ju Bai Date: Mon Jul 23 16:27:44 2018 +0800 crypto: qat/adf_aer - Replace GFP_ATOMIC with GFP_KERNEL in adf_dev_aer_schedule_reset() adf_dev_aer_schedule_reset() is never called in atomic context, as it calls wait_for_completion_timeout(). adf_dev_aer_schedule_reset() calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Herbert Xu commit 1c96dde100987149f42bd6dd97013f7c421f27c7 Author: Jia-Ju Bai Date: Mon Jul 23 16:14:26 2018 +0800 crypto: cavium/nitrox - Replace GFP_ATOMIC with GFP_KERNEL in crypto_alloc_context() crypto_alloc_context() is only called by nitrox_skcipher_init(), which is never called in atomic context. crypto_alloc_context() calls dma_pool_alloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Herbert Xu commit 43490e8046b5d273eb82710b04290c5997138adc Author: Stephan Müller Date: Fri Jul 20 19:42:01 2018 +0200 crypto: drbg - in-place cipher operation for CTR The cipher implementations of the kernel crypto API favor in-place cipher operations. Thus, switch the CTR cipher operation in the DRBG to perform in-place operations. This is implemented by using the output buffer as input buffer and zeroizing it before the cipher operation to implement a CTR encryption of a NULL buffer. The speed improvement is quite visibile with the following comparison using the LRNG implementation. Without the patch set: 16 bytes| 12.267661 MB/s| 61338304 bytes | 5000000213 ns 32 bytes| 23.603770 MB/s| 118018848 bytes | 5000000073 ns 64 bytes| 46.732262 MB/s| 233661312 bytes | 5000000241 ns 128 bytes| 90.038042 MB/s| 450190208 bytes | 5000000244 ns 256 bytes| 160.399616 MB/s| 801998080 bytes | 5000000393 ns 512 bytes| 259.878400 MB/s| 1299392000 bytes | 5000001675 ns 1024 bytes| 386.050662 MB/s| 1930253312 bytes | 5000001661 ns 2048 bytes| 493.641728 MB/s| 2468208640 bytes | 5000001598 ns 4096 bytes| 581.835981 MB/s| 2909179904 bytes | 5000003426 ns With the patch set: 16 bytes | 17.051142 MB/s | 85255712 bytes | 5000000854 ns 32 bytes | 32.695898 MB/s | 163479488 bytes | 5000000544 ns 64 bytes | 64.490739 MB/s | 322453696 bytes | 5000000954 ns 128 bytes | 123.285043 MB/s | 616425216 bytes | 5000000201 ns 256 bytes | 233.434573 MB/s | 1167172864 bytes | 5000000573 ns 512 bytes | 384.405197 MB/s | 1922025984 bytes | 5000000671 ns 1024 bytes | 566.313370 MB/s | 2831566848 bytes | 5000001080 ns 2048 bytes | 744.518042 MB/s | 3722590208 bytes | 5000000926 ns 4096 bytes | 867.501670 MB/s | 4337508352 bytes | 5000002181 ns Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit c5f5aeef9b55b362ad5a0e04e4b41cd63b208842 Merge: a47890899379 c7513c2a2714 Author: Herbert Xu Date: Fri Aug 3 17:55:12 2018 +0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux Merge mainline to pick up c7513c2a2714 ("crypto/arm64: aes-ce-gcm - add missing kernel_neon_begin/end pair"). commit 401c0d7712eb3189023efc9c0708a2ac984ed62e Author: Boris Brezillon Date: Fri Aug 3 11:50:39 2018 +0200 spi: spi-mem: Constify spi_mem->name There is no reason to make spi_mem->name modifiable. Moreover, spi_mem_ops->get_name() returns a const char *, which generates a gcc warning when assigning the value returned by spi_mem_ops->get_name() to spi_mem->name. Fixes: 5d27a9c8ea9e ("spi: spi-mem: Extend the SPI mem interface to set a custom memory name") Reported-by: Stephen Rothwell Signed-off-by: Boris Brezillon Signed-off-by: Mark Brown commit 26a6dce8ef99b0199e7682d1c203cf7d0b5fd5b0 Author: Yong Zhi Date: Thu Aug 2 18:21:31 2018 -0500 ASoC: Intel: bxt: Use refcap device for mono recording The refcap capture device supports mono recording only, this patch adds the channel constraints. Signed-off-by: Yong Zhi Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 3127692deba6eeb7ed6d416b25e91f179e17be8f Author: Nicholas Piggin Date: Fri Aug 3 01:39:51 2018 +1000 powernv/cpuidle: Fix idle states all being marked invalid Commit 9c7b185ab2fe ("powernv/cpuidle: Parse dt idle properties into global structure") parses dt idle states into structs, but never marks them valid. This results in all idle states being lost. Fixes: 9c7b185ab2fe ("powernv/cpuidle: Parse dt idle properties into global structure") Signed-off-by: Nicholas Piggin Acked-by: Akshay Adiga Signed-off-by: Michael Ellerman commit 07bf7908950a8b14e81aa1807e3c667eab39287a Author: Steffen Klassert Date: Wed Aug 1 13:45:11 2018 +0200 xfrm: Validate address prefix lengths in the xfrm selector. We don't validate the address prefix lengths in the xfrm selector we got from userspace. This can lead to undefined behaviour in the address matching functions if the prefix is too big for the given address family. Fix this by checking the prefixes and refuse SA/policy insertation when a prefix is invalid. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Air Icy Signed-off-by: Steffen Klassert commit 1313bccf00f6dfef99724d58e4416281b71e7189 Author: Amit K Bag Date: Fri Aug 3 12:43:20 2018 +0530 Bluetooth: btusb: Release RF resource on BT shutdown Issue description: Intel 7265 shares the same RF with Wifi and BT. In the shutdown scenario turn off BT, followed by turn WiFi off and on causing error in RF calibration in WiFi Module Solution: before shutdown BT ensure any RF activity to clear by HCI reset command. Reference Logs: ERR kernel: [ 386.193284] iwlwifi 0000:01:00.0: Failed to run INIT calibrations: -5 ERR kernel: [ 386.193298] iwlwifi 0000:01:00.0: Failed to run INIT ucode: -5 ERR kernel: [ 386.193309] iwlwifi 0000:01:00.0: Failed to start RT ucode: -5 Signed-off-by: Amit K Bag Singed-off-by: Chethan T N Signed-off-by: Marcel Holtmann commit 0069fb854364da79fd99236ea620affc8e1152d5 Author: Roman Gushchin Date: Thu Aug 2 15:47:10 2018 -0700 selftests/bpf: fix a typo in map in map test Commit fbeb1603bf4e ("bpf: verifier: MOV64 don't mark dst reg unbounded") revealed a typo in commit fb30d4b71214 ("bpf: Add tests for map-in-map"): BPF_MOV64_REG(BPF_REG_0, 0) was used instead of BPF_MOV64_IMM(BPF_REG_0, 0). I've noticed the problem by running bpf kselftests. Fixes: fb30d4b71214 ("bpf: Add tests for map-in-map") Signed-off-by: Roman Gushchin Cc: Martin KaFai Lau Cc: Arthur Fabre Cc: Daniel Borkmann Cc: Alexei Starovoitov Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit c2b6e1591b6b15e1dcd9c1596b0371b6abc48fed Author: Thomas Bianchi Date: Wed Aug 1 12:58:34 2018 -0700 xfs: substitute spaces with tabs Inside xfs_attr_shortform_list removes spaces at the beginnig of the line and replaces with tabs. Issue found by checkpatch. ERROR: code indent should use tabs where possible Signed-off-by: Thomas Bianchi Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9d9e6233859706875c392707efd6d516cfb764fb Author: Brian Foster Date: Wed Aug 1 07:20:35 2018 -0700 xfs: fold dfops into the transaction struct xfs_defer_ops has now been reduced to a single list_head. The external dfops mechanism is unused and thus everywhere a (permanent) transaction is accessible the associated dfops structure is as well. Remove the xfs_defer_ops structure and fold the list_head into the transaction. Also remove the last remnant of external dfops in xfs_trans_dup(). Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit c03edc9e49b6a3c1f4b27f505a04093ab333b245 Author: Brian Foster Date: Wed Aug 1 07:20:35 2018 -0700 xfs: always defer agfl block frees The AGFL fixup code conditionally defers block frees from the free list based on whether the current transaction has an associated xfs_defer_ops structure. Now that dfops is embedded in the transaction and the internal dfops is used unconditionally, this invariant is always true. Remove the now dead logic to check for ->t_dfops in xfs_alloc_fix_freelist() and unconditionally defer AGFL block frees. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 0f37d1780c3d864599fb377dcb47ad1aa0686b4e Author: Brian Foster Date: Wed Aug 1 07:20:34 2018 -0700 xfs: pass transaction to xfs_defer_add() The majority of remaining references to struct xfs_defer_ops in XFS are associated with xfs_defer_add(). At this point, there are no more external xfs_defer_ops users left. All instances of xfs_defer_ops are embedded in the transaction, which means we can safely pass the transaction down to the dfops add interface. Update xfs_defer_add() to receive the transaction as a parameter. Various subsystems implement wrappers to allocate and construct the context specific data structures for the associated deferred operation type. Update these to also carry the transaction down as needed and clean up unused dfops parameters along the way. This removes most of the remaining references to struct xfs_defer_ops throughout the code and facilitates removal of the structure. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig [darrick: fix unused variable warnings with ftrace disabled] Signed-off-by: Darrick J. Wong commit 1ae093cbea3d1ef04e1344b9e3996a9e1763a91b Author: Brian Foster Date: Wed Aug 1 07:20:34 2018 -0700 xfs: replace xfs_defer_ops ->dop_pending with on-stack list The xfs_defer_ops ->dop_pending list is used to track active deferred operations once intents are logged. These items must be aborted in the event of an error. The list is populated as intents are logged and items are removed as they complete (or are aborted). Now that xfs_defer_finish() cancels on error, there is no need to ever access ->dop_pending outside of xfs_defer_finish(). The list is only ever populated after xfs_defer_finish() begins and is either completed or cancelled before it returns. Remove ->dop_pending from xfs_defer_ops and replace it with a local list in the xfs_defer_finish() path. Pass the local list to the various helpers now that it is not accessible via dfops. Note that we have to check for NULL in the abort case as the final tx roll occurs outside of the scope of the new local list (once the dfops has completed and thus drained the list). Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9b1f4e9831df29776031e86e112e68784f1fc079 Author: Brian Foster Date: Wed Aug 1 07:20:33 2018 -0700 xfs: cancel dfops on xfs_defer_finish() error The current semantics of xfs_defer_finish() require the caller to call xfs_defer_cancel() on error. This is slightly inconsistent with transaction commit error handling where a failed commit cleans up the transaction before returning. More significantly, the only requirement for exposure of ->dop_pending outside of xfs_defer_finish() is so that xfs_defer_cancel() can drain it on error. Since the only recourse of xfs_defer_finish() errors is cancellation, mirror the transaction logic and cancel remaining dfops before returning from xfs_defer_finish() with an error. Beside simplifying xfs_defer_finish() semantics, this ensures that xfs_defer_finish() always returns with an empty ->dop_pending and thus facilitates removal of the list from xfs_defer_ops. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 60f31a609ed3d28791acb2bc24188cb7e2259176 Author: Brian Foster Date: Wed Aug 1 07:20:33 2018 -0700 xfs: clean out superfluous dfops dop params/vars The dfops code still passes around the xfs_defer_ops pointer superfluously in a few places. Clean this up wherever the transaction will suffice. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 7dbddbaccd189e63c39c9e22c728c4548b9893bb Author: Brian Foster Date: Wed Aug 1 07:20:32 2018 -0700 xfs: drop dop param from xfs_defer_op_type ->finish_item() callback The dfops infrastructure ->finish_item() callback passes the transaction and dfops as separate parameters. Since dfops is always part of a transaction, the latter parameter is no longer necessary. Remove it from the various callbacks. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit a8198666fb755e129c2fe92819774256ec26c79c Author: Brian Foster Date: Wed Aug 1 07:20:32 2018 -0700 xfs: automatic dfops inode relogging Inodes that are held across deferred operations are explicitly joined to the dfops structure to ensure appropriate relogging. While inodes are currently joined explicitly, we can detect the conditions that require relogging at dfops finish time by inspecting the transaction item list for inodes with ili_lock_flags == 0. Replace the xfs_defer_ijoin() infrastructure with such detection and automatic relogging of held inodes. This eliminates the need for the per-dfops inode list, replaced by an on-stack variant in xfs_defer_trans_roll(). Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 82ff27bc52a88cb5cc400bfa64e210d3ec8dfebd Author: Brian Foster Date: Wed Aug 1 07:20:32 2018 -0700 xfs: automatic dfops buffer relogging Buffers that are held across deferred operations are explicitly joined to the dfops structure to ensure appropriate relogging. While buffers are currently joined explicitly, we can detect the conditions that require relogging at dfops finish time by inspecting the transaction item list for held buffers. Replace the xfs_defer_bjoin() infrastructure with such detection and automatic relogging of held buffers. This eliminates the need for the per-dfops buffer list, replaced by an on-stack variant in xfs_defer_trans_roll(). Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 488c919a5bec3be4b8613898de6958043edbb8d9 Author: Brian Foster Date: Wed Aug 1 07:20:31 2018 -0700 xfs: add missing defer ijoins for held inodes Log items that require relogging during deferred operations processing are explicitly joined to the associated dfops via the xfs_defer_*join() helpers. These calls imply that the associated object is "held" by the transaction such that when rolled, the item can be immediately joined to a follow up transaction. For buffers, this means the buffer remains locked and held after each roll. For inodes, this means that the inode remains locked. Failure to join a held item to the dfops structure means the associated object pins the tail of the log while dfops processing completes, because the item never relogs and is not unlocked or released until deferred processing completes. Currently, all buffers that are held in transactions (XFS_BLI_HOLD) with deferred operations are explicitly joined to the dfops. This is not the case for inodes, however, as various contexts defer operations to transactions with held inodes without explicit joins to the associated dfops (and thus not relogging). While this is not a catastrophic problem, it is not ideal. Given that we want to eventually relog such items automatically during dfops processing, start by explicitly adding these missing xfs_defer_ijoin() calls. A call is added everywhere an inode is joined to a transaction without transferring lock ownership and said transaction runs deferred operations. All xfs_defer_ijoin() calls will eventually be replaced by automatic dfops inode relogging. This patch essentially implements the behavior change that would otherwise occur due to automatic inode dfops relogging. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 1214f1cf663b0939fbb8f1bccdc74c1d1e452d53 Author: Brian Foster Date: Wed Aug 1 07:20:31 2018 -0700 xfs: replace dop_low with transaction flag The dop_low field enables the low free space allocation mode when a previous allocation has detected difficulty allocating blocks. It has historically been part of the xfs_defer_ops structure, which means if enabled, it remains enabled across a set of transactions until the deferred operations have completed and the dfops is reset. Now that the dfops is embedded in the transaction, we can save a bit more space by using a transaction flag rather than a standalone boolean. Drop the ->dop_low field and replace it with a transaction flag that is set at the same points, carried across rolling transactions and cleared on completion of deferred operations. This essentially emulates the behavior of ->dop_low and so should not change behavior. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit ce356d64772f920f26cd6c1b02878a737a275638 Author: Brian Foster Date: Wed Aug 1 07:20:30 2018 -0700 xfs: pass transaction to dfops reset/move helpers All callers pass ->t_dfops of the associated transactions. Refactor the helpers to receive the transactions and facilitate further cleanups between xfs_defer_ops and xfs_trans. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit 7279aa13b8fb954f50073a672f912898198efd14 Author: Brian Foster Date: Wed Aug 1 07:20:30 2018 -0700 xfs: remove unused __xfs_defer_cancel() internal helper With no more external dfops users, there is no need for an xfs_defer_ops cancel wrapper. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong commit fbfa977d25dc8db92dbf5fcafb0e03fae0005be5 Author: Brian Foster Date: Wed Aug 1 07:20:29 2018 -0700 xfs: use transaction for intent recovery instead of raw dfops Log intent recovery is the last user of an external (on-stack) dfops. The pattern exists because the dfops is used to collect additional deferred operations queued during the whole recovery sequence. The dfops is finished with a new transaction after intent recovery completes. We already have a mechanism to create an empty, container-like transaction to support the scrub infrastructure. We can reuse that mechanism here to drop the final user of external dfops. This facilitates folding dfops state (i.e., dop_low) into the transaction, the elimination of now unused external dfops support and also eliminates the only caller of __xfs_defer_cancel(). Replace the on-stack dfops with an empty transaction and pass it around to the various helpers that queue and finish deferred operations during intent recovery. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 98719051e75ccf9eca18bd2b569de4ea637b4479 Author: Brian Foster Date: Wed Aug 1 07:20:29 2018 -0700 xfs: refactor internal dfops initialization The current transaction allocation code conditionally initializes the ->t_dfops indirection pointer. Transaction commit/cancel check the validity of the pointer to determine whether to finish/cancel the internal dfops. This disallows the ability to use the internal dfops list as a temporary container (via xfs_trans_alloc_empty()). Refactor transaction allocation to always initialize ->t_dfops and check permanent reservation state on transaction commit/cancel. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6534770d6f176093b50896961107b2d545ef38f0 Author: Jakub Kicinski Date: Thu Aug 2 19:30:27 2018 -0700 tools: bpf: fix BTF code added twice to different trees commit 38d5d3b3d5db ("bpf: Introduce BPF_ANNOTATE_KV_PAIR") added to the bpf and net trees what commit 92b57121ca79 ("bpf: btf: export btf types and name by offset from lib") has already added to bpf-next/net-next, but in slightly different location. Remove the duplicates (to fix build of libbpf). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 760109760455a0a35491cb02a3bc3e15f0c180f6 Author: Jason Gunthorpe Date: Sun Jul 29 11:35:00 2018 +0300 IB/ipoib: Consolidate checking of the proposed child interface Move all the checking for pkey and other validity to the __ipoib_vlan_add function. This removes the last difference from the control flow of the __ipoib_vlan_add to make the overall design simpler to understand. Signed-off-by: Jason Gunthorpe Signed-off-by: Erez Shitrit Signed-off-by: Leon Romanovsky commit 13476d35bba60b59521ff25d902fdb552b8bf2ac Author: Jason Gunthorpe Date: Sun Jul 29 11:34:59 2018 +0300 IB/ipoib: Maintain the child_intfs list from ndo_init/uninit This fixes a bug in the netlink path where the vlan_rwsem was not held around __ipoib_vlan_add causing the child_intfs to be manipulated unsafely. In the process this greatly simplifies the vlan_rwsem write side locking to only cover a single non-sleeping statement. This also further increases the safety of the removal ordering by holding the netdev of the parent while the child is active to ensure most bugs become either an oops on a NULL priv or a deadlock on the netdev refcount. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 25405d98a2aa0b9983bb9c36b0b00815d39394f4 Author: Jason Gunthorpe Date: Sun Jul 29 11:34:58 2018 +0300 IB/ipoib: Do not remove child devices from within the ndo_uninit Switching to priv_destructor and needs_free_netdev created a subtle ordering problem in ipoib_remove_one. Now that unregister_netdev frees the netdev and priv we must ensure that the children are unregistered before trying to unregister the parent, or child unregister will use after free. The solution is to unregister the children, then parent, in the same batch all while holding the rtnl_lock. This closes all the races where a new child could have been added and ensures proper ordering. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit ee190ab734ba4d3c7887bd193ce8124385738e44 Author: Jason Gunthorpe Date: Sun Jul 29 11:34:57 2018 +0300 IB/ipoib: Get rid of the sysfs_mutex This mutex was introduced to deal with the deadlock formed by calling unregister_netdev from within the sysfs callback of a netdev. Now that we have priv_destructor and needs_free_netdev we can switch to the more targeted solution of running the unregister from a work queue. This avoids the deadlock and gets rid of the mutex. The next patch in the series needs this mutex eliminated to create atomicity of unregisteration. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 9f49a5b5c21d58aa84e16cfdc5e99e49faefcb7a Author: Jason Gunthorpe Date: Sun Jul 29 11:34:56 2018 +0300 RDMA/netdev: Use priv_destructor for netdev cleanup Now that the unregister_netdev flow for IPoIB no longer relies on external code we can now introduce the use of priv_destructor and needs_free_netdev. The rdma_netdev flow is switched to use the netdev common priv_destructor instead of the special free_rdma_netdev and the IPOIB ULP adjusted: - priv_destructor needs to switch to point to the ULP's destructor which will then call the rdma_ndev's in the right order - We need to be careful around the error unwind of register_netdev as it sometimes calls priv_destructor on failure - ULPs need to use ndo_init/uninit to ensure proper ordering of failures around register_netdev Switching to priv_destructor is a necessary pre-requisite to using the rtnl new_link mechanism. The VNIC user for rdma_netdev should also be revised, but that is left for another patch. Signed-off-by: Jason Gunthorpe Signed-off-by: Denis Drozdov Signed-off-by: Leon Romanovsky commit eaeb398425089cb3c8edc81a406109db94b2705c Author: Jason Gunthorpe Date: Sun Jul 29 11:34:55 2018 +0300 IB/ipoib: Move init code to ndo_init Now that we have a proper ndo_uninit, move code that naturally pairs with the ndo_uninit into ndo_init. This allows the netdev core to natually handle ordering. This fixes the situation where register_netdev can fail before calling ndo_init, in which case it wouldn't call ndo_uninit either. Also move a bunch of duplicated init code that is shared between child and parent for clarity. Now the child and parent register functions look very similar. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 7cbee87c17965ede0eba2e7ba41d0a38ebd2249c Author: Jason Gunthorpe Date: Sun Jul 29 11:34:53 2018 +0300 IB/ipoib: Move all uninit code into ndo_uninit Currently uninit is sometimes done twice in error flows, and is sprinkled a bit all over the place. Improve the clarity of the design by moving all uninit only into ndo_uinit. Some duplication is removed: - Sometimes IPOIB_STOP_NEIGH_GC was done before unregister, but this duplicates the process in ipoib_neigh_hash_init - Flushing priv->wq was sometimes done before unregister, but that duplicates what has been done in ndo_uninit Uniniting the IB event queue must remain before unregister_netdev as it requires the RTNL lock to be dropped, this is moved to a helper to make that flow really clear and remove some duplication in error flows. If register_netdev fails (and ndo_init is NULL) then it almost always calls ndo_uninit, which lets us remove all the extra code from the error unwinds. The next patch in the series will close the 'almost always' hole by pairing a proper ndo_init with ndo_uninit. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit cda8daf17914a261986d6d4b7294599736d5a463 Author: Erez Shitrit Date: Sun Jul 29 11:34:52 2018 +0300 IB/ipoib: Use cancel_delayed_work_sync for neigh-clean task The neigh_reap_task is self restarting, but so long as we call cancel_delayed_work_sync() it will be guaranteed to not be running and never start again. Thus we don't need to have the racy IPOIB_STOP_NEIGH_GC bit, or the confusing mismatch of places sometimes calling flush_workqueue after the cancel. This fixes a situation where the GC work could have been left running in some rare situations. Signed-off-by: Erez Shitrit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 577e07ffbad9960551a6821b74af90a216ac10e2 Author: Jason Gunthorpe Date: Sun Jul 29 11:34:51 2018 +0300 IB/ipoib: Get rid of IPOIB_FLAG_GOING_DOWN This essentially duplicates the netdev's reg_state, so just use that directly. The reg_state is updated under the rntl_lock, and all places using GOING_DOWN already acquire the rtnl_lock so checking is safe. Since the only place we use GOING_DOWN is for the parent device this does not fix any bugs, but it is a step to tidy up the unregister flow so that after later patches the flow is uniform and sane. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 94245f4ad9e10c161affaa4763136d29fbe91cb9 Author: Potnuri Bharat Teja Date: Thu Aug 2 11:33:04 2018 +0530 iw_cxgb4: Support FW write completion WR To optimize NVME-oF READ IOPs, use a specialized WQE that combines the RDMA WRITE and SEND_INV WR chain submitted by the NVME-oF target driver. This reduces uP overhead per NVME-oF IO, and results in over 10% improvement in NVME-oF 4K READ IOPs. Signed-off-by: Potnuri Bharat Teja Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe commit b9855f4ca0fe582aabfdbd08f0d856b22486e157 Author: Potnuri Bharat Teja Date: Thu Aug 2 11:33:03 2018 +0530 iw_cxgb4: RDMA write with immediate support Adds iw_cxgb4 functionality to support RDMA_WRITE_WITH_IMMEDATE opcode. Signed-off-by: Potnuri Bharat Teja Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe commit 8001b717f09460d9e17457f6bade6699aa14604f Author: Dan Carpenter Date: Thu Aug 2 10:56:13 2018 +0300 rdma/cxgb4: fix some info leaks In c4iw_create_qp() there are several struct members which potentially aren't inintialized like uresp.rq_key. I've fixed this code before in in commit ae1fe07f3f42 ("RDMA/cxgb4: Fix stack info leak in c4iw_create_qp()") so this time I'm just going to take a big hammer approach and memset the whole struct to zero. Hopefully, it will stay fixed this time. In c4iw_create_srq() we don't clear uresp.reserved. Fixes: 6a0b6174d35a ("rdma/cxgb4: Add support for kernel mode SRQ's") Signed-off-by: Dan Carpenter Acked-by: Raju Rangoju Signed-off-by: Jason Gunthorpe commit 0425e3e6e0c7f92f2c2a396d902871b7a81da0eb Author: Yixian Liu Date: Thu Aug 2 10:38:05 2018 +0800 RDMA/hns: Support flush cqe for hip08 in kernel space According to IB protocol, there are some cases that work requests must return the flush error completion status through the completion queue. Due to hardware limitation, the driver needs to assist the flush process. This patch adds the support of flush cqe for hip08 in the cases that needed, such as poll cqe, post send, post recv and aeqe handle. The patch also considered the compatibility between kernel and user space. Signed-off-by: Yixian Liu Signed-off-by: Jason Gunthorpe commit 2c3449fb95c318920ca8dc645d918d408db219ac Author: Jia-Ju Bai Date: Mon Jul 30 05:33:20 2018 -0400 media: usb: hackrf: Replace GFP_ATOMIC with GFP_KERNEL hackrf_submit_urbs(), hackrf_alloc_stream_bufs() and hackrf_alloc_urbs() are never called in atomic context. They call usb_submit_urb(), usb_alloc_coherent() and usb_alloc_urb() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Mauro Carvalho Chehab commit 7a3369e8a78538e813e96294b8c7fce9feb76e0f Author: Jia-Ju Bai Date: Mon Jul 30 05:24:59 2018 -0400 media: usb: em28xx: Replace mdelay() with msleep() in em28xx_pre_card_setup() em28xx_pre_card_setup() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Mauro Carvalho Chehab commit 2453e60702e1a4d22720e3b6aac543e1a96fcd6b Author: Jia-Ju Bai Date: Mon Jul 30 05:25:07 2018 -0400 media: usb: em28xx: Replace GFP_ATOMIC with GFP_KERNEL in em28xx_init_usb_xfer() em28xx_init_usb_xfer() is never called in atomic context. It calls usb_submit_urb() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Mauro Carvalho Chehab commit 61e641f36ed81ae473177c085f0bfd83ad3b55ed Author: Anton Vasilyev Date: Fri Jul 27 07:52:20 2018 -0400 media: davinci: vpif_display: Mix memory leak on probe error path If vpif_probe() fails on v4l2_device_register() then memory allocated at initialize_vpif() for global vpif_obj.dev[i] become unreleased. The patch adds deallocation of vpif_obj.dev[i] on the error path and removes duplicated check on platform_data presence. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Mauro Carvalho Chehab commit b9f0f653ea2c214933b16884bd40baf26ff61895 Author: Anton Vasilyev Date: Fri Jul 27 07:47:59 2018 -0400 media: vimc: Remove redundant free Commit 4a29b7090749 ("[media] vimc: Subdevices as modules") removes vimc allocation from vimc_probe(), so corresponding deallocation on the error path tries to free static memory. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Acked-by: Helen Koike Signed-off-by: Mauro Carvalho Chehab commit 730129e9ba4dd668452371eba900e6e46f63b778 Author: Jia-Ju Bai Date: Thu Jul 26 22:52:49 2018 -0400 media: dvb-frontends: rtl2832_sdr: Replace GFP_ATOMIC with GFP_KERNEL rtl2832_sdr_submit_urbs(), rtl2832_sdr_alloc_stream_bufs(), and rtl2832_sdr_alloc_urbs() are never called in atomic context. They call usb_submit_urb(), usb_alloc_coherent() and usb_alloc_urb() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Mauro Carvalho Chehab commit f46bdacdc06a2256187f98d7d063d1bd5c318b12 Author: kbuild test robot Date: Wed Jul 25 13:57:00 2018 -0400 media: omap2: omapfb: fix bugon.cocci warnings drivers/video/fbdev/omap2/omapfb/dss/dss_features.c:895:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h) Use BUG_ON instead of a if condition followed by BUG. Semantic patch information: This makes an effort to find cases where BUG() follows an if condition on an expression and replaces the if condition and BUG() with a BUG_ON having the conditional expression of the if statement as argument. Generated by: scripts/coccinelle/misc/bugon.cocci Signed-off-by: kbuild test robot Signed-off-by: Mauro Carvalho Chehab commit 73fc60aa6386ecb4201908be42241dcbd790d556 Author: kbuild test robot Date: Wed Jul 25 13:57:00 2018 -0400 media: omap2: omapfb: fix boolreturn.cocci warnings drivers/video/fbdev/omap2/omapfb/omapfb-main.c:290:9-10: WARNING: return of 0/1 in function 'cmp_var_to_colormode' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Signed-off-by: kbuild test robot Signed-off-by: Mauro Carvalho Chehab commit ad1363c05a7d65ce6d4c5dca1fdec823b58d6e8b Author: kbuild test robot Date: Wed Jul 25 13:57:00 2018 -0400 media: omap2: omapfb: fix ifnullfree.cocci warnings drivers/video/fbdev/omap2/omapfb/dss/core.c:141:2-26: WARNING: NULL check before some freeing functions is not needed. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Signed-off-by: kbuild test robot Signed-off-by: Mauro Carvalho Chehab commit 0f408ce8941fcb1b6e8431272cfc9337a0407d73 Author: Katsuhiro Suzuki Date: Mon Jul 23 04:51:50 2018 -0400 media: dvb-frontends: add Socionext MN88443x ISDB-S/T demodulator driver This patch adds a frontend driver for the Socionext/Panasonic MN884434 and MN884433 ISDB-S/T demodulators. The maximum and minimum frequency of MN88443x comes from ISDB-S and ISDB-T so frequency range is the following: - ISDB-S (BS/CS110 IF frequency, Local freq 10.678GHz) - Min: BS-1: 1032MHz - Max: ND24: 2070MHz - ISDB-T - Min: ch13: 470MHz - Max: ch62: 770MHz Signed-off-by: Katsuhiro Suzuki Signed-off-by: Mauro Carvalho Chehab commit 65b40a986fc68cb3b362bb855303b73a2b8538c2 Author: Anton Vasilyev Date: Wed Jul 18 10:13:56 2018 -0400 media: dm1105: Limit number of cards to avoid buffer over read dm1105_probe() counts number of cards at dm1105_devcount, but missed bounds check before dereference a card array. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Mauro Carvalho Chehab commit 817dc4b579d897d3f645c11dc255f21642aa99df Author: Katsuhiro Suzuki Date: Tue Jul 17 21:06:42 2018 -0400 media: helene: add I2C device probe function This patch adds I2C probe function to use dvb_module_probe() with this driver. And also support multiple delivery systems at the same device. Signed-off-by: Katsuhiro Suzuki Signed-off-by: Mauro Carvalho Chehab commit 299c7007e93645067e1d2743f4e50156de78c4ff Author: Anton Vasilyev Date: Mon Jul 23 13:04:54 2018 -0400 media: dw2102: Fix memleak on sequence of probes Each call to dw2102_probe() allocates memory by kmemdup for structures p1100, s660, p7500 and s421, but there is no their deallocation. dvb_usb_device_init() copies the corresponding structure into dvb_usb_device->props, so there is no use of original structure after dvb_usb_device_init(). The patch moves structures from global scope to local and adds their deallocation. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Mauro Carvalho Chehab commit 82c018d734a7aa24a9ac8f33f610c55923fb6911 Merge: fbeb1603bf4e 28ba068760a7 Author: Daniel Borkmann Date: Fri Aug 3 00:47:33 2018 +0200 Merge branch 'bpf-cgroup-local-storage' Roman Gushchin says: ==================== This patchset implements cgroup local storage for bpf programs. The main idea is to provide a fast accessible memory for storing various per-cgroup data, e.g. number of transmitted packets. Cgroup local storage looks as a special type of map for userspace, and is accessible using generic bpf maps API for reading and updating of the data. The (cgroup inode id, attachment type) pair is used as a map key. A user can't create new entries or destroy existing entries; it happens automatically when a user attaches/detaches a bpf program to a cgroup. From a bpf program's point of view, cgroup storage is accessible without lookup using the special get_local_storage() helper function. It takes a map fd as an argument. It always returns a valid pointer to the corresponding memory area. To implement such a lookup-free access a pointer to the cgroup storage is saved for an attachment of a bpf program to a cgroup, if required by the program. Before running the program, it's saved in a special global per-cpu variable, which is accessible from the get_local_storage() helper. This patchset implement only cgroup local storage, however the API is intentionally made extensible to support other local storage types further: e.g. thread local storage, socket local storage, etc. v7->v6: - fixed a use-after-free bug, caused by not clearing prog->aux->cgroup_storage pointer after releasing the map v6->v5: - fixed an error with returning -EINVAL instead of a pointer v5->v4: - fixed an issue in verifier (test that flags == 0 properly) - added a corresponding test - added a note about synchronization, sync docs to tools/uapi/... - switched the cgroup test to use XADD - added a check for attr->max_entries to be 0, and atter->max_flags to be sane - use bpf_uncharge_memlock() in bpf_uncharge_memlock() - rebased to bpf-next v4->v3: - fixed a leak in cgroup attachment code (discovered by Daniel) - cgroup storage map will be released if the corresponding bpf program failed to load by any reason - introduced bpf_uncharge_memlock() helper v3->v2: - fixed more build and sparse issues - rebased to bpf-next v2->v1: - fixed build issues - removed explicit rlimit calls in patch 14 - rebased to bpf-next ==================== Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 28ba068760a7e136a7fe2783bca74e3f43affb9b Author: Roman Gushchin Date: Thu Aug 2 14:27:30 2018 -0700 samples/bpf: extend test_cgrp2_attach2 test to use cgroup storage The test_cgrp2_attach test covers bpf cgroup attachment code well, so let's re-use it for testing allocation/releasing of cgroup storage. The extension is pretty straightforward: the bpf program will use the cgroup storage to save the number of transmitted bytes. Expected output: $ ./test_cgrp2_attach2 Attached DROP prog. This ping in cgroup /foo should fail... ping: sendmsg: Operation not permitted Attached DROP prog. This ping in cgroup /foo/bar should fail... ping: sendmsg: Operation not permitted Attached PASS prog. This ping in cgroup /foo/bar should pass... Detached PASS from /foo/bar while DROP is attached to /foo. This ping in cgroup /foo/bar should fail... ping: sendmsg: Operation not permitted Attached PASS from /foo/bar and detached DROP from /foo. This ping in cgroup /foo/bar should pass... ### override:PASS ### multi:PASS Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 68cfa3ac6b8db2782300ad0d699da27aaa2ac9fb Author: Roman Gushchin Date: Thu Aug 2 14:27:29 2018 -0700 selftests/bpf: add a cgroup storage test Implement a test to cover the cgroup storage functionality. The test implements a bpf program which drops every second packet by using the cgroup storage as a persistent storage. The test also use the userspace API to check the data in the cgroup storage, alter it, and check that the loaded and attached bpf program sees the update. Expected output: $ ./test_cgroup_storage test_cgroup_storage:PASS Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit d4c9f573537506530019c505c8b6097a7d7a5fab Author: Roman Gushchin Date: Thu Aug 2 14:27:28 2018 -0700 selftests/bpf: add verifier cgroup storage tests Add the following verifier tests to cover the cgroup storage functionality: 1) valid access to the cgroup storage 2) invalid access: use regular hashmap instead of cgroup storage map 3) invalid access: use invalid map fd 4) invalid access: try access memory after the cgroup storage 5) invalid access: try access memory before the cgroup storage 6) invalid access: call get_local_storage() with non-zero flags For tests 2)-6) check returned error strings. Expected output: $ ./test_verifier #0/u add+sub+mul OK #0/p add+sub+mul OK #1/u DIV32 by 0, zero check 1 OK ... #280/p valid cgroup storage access OK #281/p invalid cgroup storage access 1 OK #282/p invalid cgroup storage access 2 OK #283/p invalid per-cgroup storage access 3 OK #284/p invalid cgroup storage access 4 OK #285/p invalid cgroup storage access 5 OK ... #649/p pass modified ctx pointer to helper, 2 OK #650/p pass modified ctx pointer to helper, 3 OK Summary: 901 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit f42ee093be2980f2689ea7a170d580364820f48b Author: Roman Gushchin Date: Thu Aug 2 14:27:27 2018 -0700 bpf/test_run: support cgroup local storage Allocate a temporary cgroup storage to use for bpf program test runs. Because the test program is not actually attached to a cgroup, the storage is allocated manually just for the execution of the bpf program. If the program is executed multiple times, the storage is not zeroed on each run, emulating multiple runs of the program, attached to a real cgroup. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 34a6bbb8131b75daeb3e9be026d39d6463762baf Author: Roman Gushchin Date: Thu Aug 2 14:27:26 2018 -0700 bpftool: add support for CGROUP_STORAGE maps Add BPF_MAP_TYPE_CGROUP_STORAGE maps to the list of maps types which bpftool recognizes. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Jakub Kicinski Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit c419cf52da77d0f0f01d4b75a75ae89406f0923f Author: Roman Gushchin Date: Thu Aug 2 14:27:25 2018 -0700 bpf: sync bpf.h to tools/ Sync cgroup storage related changes: 1) new BPF_MAP_TYPE_CGROUP_STORAGE map type 2) struct bpf_cgroup_sotrage_key definition 3) get_local_storage() helper Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit cd3394317653837e2eb5c5d0904a8996102af9fc Author: Roman Gushchin Date: Thu Aug 2 14:27:24 2018 -0700 bpf: introduce the bpf_get_local_storage() helper function The bpf_get_local_storage() helper function is used to get a pointer to the bpf local storage from a bpf program. It takes a pointer to a storage map and flags as arguments. Right now it accepts only cgroup storage maps, and flags argument has to be 0. Further it can be extended to support other types of local storage: e.g. thread local storage etc. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 7b5dd2bde72cd33313b63cf3ba1de6a9e443a65d Author: Roman Gushchin Date: Thu Aug 2 14:27:23 2018 -0700 bpf: don't allow create maps of cgroup local storages As there is one-to-one relation between a bpf program and cgroup local storage map, there is no sense in creating a map of cgroup local storage maps. Forbid it explicitly to avoid possible side effects. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 3e6a4b3e0289dc9540a2c1d8a20657f4707fbabb Author: Roman Gushchin Date: Thu Aug 2 14:27:22 2018 -0700 bpf/verifier: introduce BPF_PTR_TO_MAP_VALUE BPF_MAP_TYPE_CGROUP_STORAGE maps are special in a way that the access from the bpf program side is lookup-free. That means the result is guaranteed to be a valid pointer to the cgroup storage; no NULL-check is required. This patch introduces BPF_PTR_TO_MAP_VALUE return type, which is required to cause the verifier accept programs, which are not checking the map value pointer for being NULL. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 394e40a29788820c9c0526b1c3497c9e0ec2a126 Author: Roman Gushchin Date: Thu Aug 2 14:27:21 2018 -0700 bpf: extend bpf_prog_array to store pointers to the cgroup storage This patch converts bpf_prog_array from an array of prog pointers to the array of struct bpf_prog_array_item elements. This allows to save a cgroup storage pointer for each bpf program efficiently attached to a cgroup. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit d7bf2c10af053191e931b58704cd862fccb7f9de Author: Roman Gushchin Date: Thu Aug 2 14:27:20 2018 -0700 bpf: allocate cgroup storage entries on attaching bpf programs If a bpf program is using cgroup local storage, allocate a bpf_cgroup_storage structure automatically on attaching the program to a cgroup and save the pointer into the corresponding bpf_prog_list entry. Analogically, release the cgroup local storage on detaching of the bpf program. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit aa0ad5b0391e268bdecf6cda31268388844f8afd Author: Roman Gushchin Date: Thu Aug 2 14:27:19 2018 -0700 bpf: pass a pointer to a cgroup storage using pcpu variable This commit introduces the bpf_cgroup_storage_set() helper, which will be used to pass a pointer to a cgroup storage to the bpf helper. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit de9cbbaadba5adf88a19e46df61f7054000838f6 Author: Roman Gushchin Date: Thu Aug 2 14:27:18 2018 -0700 bpf: introduce cgroup storage maps This commit introduces BPF_MAP_TYPE_CGROUP_STORAGE maps: a special type of maps which are implementing the cgroup storage. >From the userspace point of view it's almost a generic hash map with the (cgroup inode id, attachment type) pair used as a key. The only difference is that some operations are restricted: 1) a user can't create new entries, 2) a user can't remove existing entries. The lookup from userspace is o(log(n)). Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 0a4c58f5702858822621fa1177c7d3475f181ccb Author: Roman Gushchin Date: Thu Aug 2 14:27:17 2018 -0700 bpf: add ability to charge bpf maps memory dynamically This commits extends existing bpf maps memory charging API to support dynamic charging/uncharging. This is required to account memory used by maps, if all entries are created dynamically after the map initialization. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 1b7369acc465ddf3d9c7604af3971753b9a548f2 Author: Arnd Bergmann Date: Mon Jul 9 11:19:02 2018 -0400 media: headers: fix linux/mod_devicetable.h inclusions A couple of drivers produced build errors after the mod_devicetable.h header was split out from the platform_device one, e.g. drivers/media/platform/davinci/vpbe_osd.c:42:40: error: array type has incomplete element type 'struct platform_device_id' drivers/media/platform/davinci/vpbe_venc.c:42:40: error: array type has incomplete element type 'struct platform_device_id' This adds the inclusion where needed. Fixes: ac3167257b9f ("headers: separate linux/mod_devicetable.h from linux/platform_device.h") Signed-off-by: Arnd Bergmann Acked-by: Michael S. Tsirkin Acked-by: Randy Dunlap Acked-by: Lad, Prabhakar Acked-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 6a2a1ca34ca68025df793a1bedfba658be2b1952 Author: Mauro Carvalho Chehab Date: Thu Jul 5 18:59:37 2018 -0400 media: dvb_frontend: ensure that the step is ok for both FE and tuner The frequency step should take into account the tuner step, as, if tuner step is bigger than frontend step, the zigzag algorithm won't be doing the right thing, as it will be tuning multiple times at the same frequency. Signed-off-by: Mauro Carvalho Chehab commit f1b1eabff0eb3fc46b06668de8174c0f23b271fd Author: Mauro Carvalho Chehab Date: Thu Jul 5 18:59:36 2018 -0400 media: dvb: represent min/max/step/tolerance freqs in Hz Right now, satellite frontend drivers specify frequencies in kHz, while terrestrial/cable ones specify in Hz. That's confusing for developers. However, the main problem is that universal frontends capable of handling both satellite and non-satelite delivery systems are appearing. We end by needing to hack the drivers in order to support such hybrid frontends. So, convert everything to specify frontend frequencies in Hz. Tested-by: Katsuhiro Suzuki Signed-off-by: Mauro Carvalho Chehab commit 6b431d50d2a8acd1c418b998b856a055252ebc3a Author: Matthieu Baerts Date: Thu Aug 2 18:14:33 2018 +0200 net/socket: remove duplicated init code This refactoring work has been started by David Howells in cdfbabfb2f0c (net: Work around lockdep limitation in sockets that use sockets) but the exact same day in 581319c58600 (net/socket: use per af lockdep classes for sk queues), Paolo Abeni added new classes. This reduces the amount of (nearly) duplicated code and eases the addition of new socket types. Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit e9340c9205c3b1cea8f1b799b5f8e034d6e3e000 Author: Andy Shevchenko Date: Tue Jul 31 17:37:16 2018 +0300 MAINTAINERS: Replace Heikki as maintainer of Intel pinctrl Heikki has another priorities and no time to maintain Intel pinctrl driver. As we decided off line I'm going to replace him. Signed-off-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit d3e2a25bcd0b24f0905554ef0762eb77cbca7ad5 Author: Gustavo A. R. Silva Date: Wed Aug 1 19:31:01 2018 -0500 xen-netback: use true and false for boolean values Return statements in functions returning bool should use true or false instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Acked-by: Wei Liu Signed-off-by: David S. Miller commit bd34389d4fdb4fe85a4c4a663dcf29c97ea2111a Author: YueHaibing Date: Wed Aug 1 18:16:47 2018 +0800 net: hns: remove redundant variables 'max_frm' and 'tmp_mac_key' Variables 'max_frm' and 'tmp_mac_key' are being assigned, but are never used,hence they are redundant and can be removed. fix fllowing warning: drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:461:6: warning: variable 'max_frm' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:1685:31: warning: variable 'tmp_mac_key' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:1855:41: warning: variable 'tmp_mac_key' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit fc389d1cb3855f6012093f741531a9ad0ec4ae9a Merge: 89b1698c93a9 2c7230446bc9 Author: David S. Miller Date: Thu Aug 2 14:36:57 2018 -0700 Merge branch 'Add--clock-config-and-pm-support-to-bcm-iProc-mdio-mux' Arun Parameswaran says: ==================== Add clock config and pm support to bcm iProc mdio mux The patchset extends the Broadcom iProc mdio mux to add support for suspend/resume and the ability to configure the internal clock divider. The patchset also sets the scan control register to disable external master access. The base address of the mdio-mux-bcm-iproc is modified to point to the start of the mdio block's address space, to be able to access all the mdio's registers. The missing registers are required to configure the internal clock divider registers in some of the Broadcom SoC's. Changes from v3: - Removed 'platform_set_drvdata(pdev, NULL)' call (in patch 5/8) - Fixed the return code handling for the devm_clk_get() call (in patch 7/8) - Added Reviewed-by tag to Patch 8/8 Changes from v2: - Addressed Andrew's comments: - Moved to using devm_mdiobus_alloc. Added this as a separate patch. - Changed to reverse christmas tree order for variable declaration in the clock patch - Addressed Florian's comments: - Removed null checks for the clock before calling unprepare in both clock and pm patches. - Added check for EPROBE_DEFER when fetching the clock in the clock patch. - The patch to use the devm API has been added before the clock & pm patches. This patch is now patch '5' in the series. - Added reviewed-by tags to commit messages of patches which remain unmodified from v2. - Modified PM patch to use platform_get_drvdata() in suspend/resume API's, similar to the recent fix that went in for the remove() api. Changes from v1: - Addressed Andrew's comments. - Reworked the patches to be based on 'net-next' - Removed 'fixes' from the commit messages, the changes are related to the new features being added. - Maintained backward compatibility to older dt-blob's specifying base addresse with an offset. The correction is applied in the driver and a message is printed to update the dt-blob. - Re-worked and re-ordered the last four patches (4-7). - Added setting of the scan control register as a new patch - Added a call to 'clk_prepare_enable()' in the patch that adds the clock config support, removed the debug message when clock is not passed. - Simplified the pm support patch (removed the array used for the save/restore logic). ==================== Signed-off-by: David S. Miller commit 2c7230446bc90bc883890007e2a5da60c399e88a Author: Arun Parameswaran Date: Wed Aug 1 17:53:53 2018 -0700 net: phy: Add pm support to Broadcom iProc mdio mux driver Add support for suspend and resume to the Broadcom iProc mdio mux driver. Signed-off-by: Arun Parameswaran Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 56aea577c8c08c9888d805a5ad81def62f89da55 Author: Arun Parameswaran Date: Wed Aug 1 17:53:52 2018 -0700 net: phy: Add support to configure clock in Broadcom iProc mdio mux Add support to configure the internal rate adjust register based on the core clock supplied through device tree in the Broadcom iProc mdio mux. The operating frequency of the mdio mux block is 11MHz. This is derrived by dividing the clock to the mdio mux with the rate adjust register. In some SoC's the default values of the rate adjust register do not yield 11MHz. These SoC's are required to specify the clock via the device tree for proper operation. Signed-off-by: Arun Parameswaran Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 0d5204abe527b28bd708d503c8116a0b627845b4 Author: Arun Parameswaran Date: Wed Aug 1 17:53:51 2018 -0700 dt-bindings: net: Add clock handle to Broadcom iProc mdio mux Add clock phandle, of the core clock driving the mdio block, as an optional property to the Broadcom iProc mdio mux. The clock, when specified, will be used to setup the rate adjust registers in the mdio to derrive the mdio's operating frequency. Signed-off-by: Arun Parameswaran Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit 0fe2cd564c35ce322830967e24693a36bf30cc7f Author: Arun Parameswaran Date: Wed Aug 1 17:53:50 2018 -0700 net: phy: Use devm api for mdio bus allocation in bcm iproc mdio mux Use devm_mdiobus_alloc() instead of mdiobus_alloc() in the Broadcom iProc mdio mux driver. Signed-off-by: Arun Parameswaran Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 5634cb2b376cef882435c3acce57d4f429405254 Author: Arun Parameswaran Date: Wed Aug 1 17:53:49 2018 -0700 net: phy: Disable external master access in bcm mdio mux driver Configure the scan control register in the Broadcom iProc mdio mux driver to disable access to external master. In some SoC's, the scan control register defaults to an incorrect value. Signed-off-by: Arun Parameswaran Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 18b872d854dc7256863755ece26828aa1856c13f Author: Arun Parameswaran Date: Wed Aug 1 17:53:48 2018 -0700 arm64: dts: Fix the base address of the Broadcom iProc mdio mux Modify the base address of the mdio mux driver to point to the start of the mdio mux block's register address space. Signed-off-by: Arun Parameswaran Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 77fefa93bfebe4df44f154f2aa5938e32630d0bf Author: Arun Parameswaran Date: Wed Aug 1 17:53:47 2018 -0700 net: phy: Fix the register offsets in Broadcom iProc mdio mux driver Modify the register offsets in the Broadcom iProc mdio mux to start from the top of the register address space. Earlier, the base address pointed to the end of the block's register space. The base address will now point to the start of the mdio's address space. The offsets have been fixed to match this. Signed-off-by: Arun Parameswaran Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 9b1dd818095fdec6e4952b8ff5c5da20553c4e09 Author: Arun Parameswaran Date: Wed Aug 1 17:53:46 2018 -0700 dt-bindings: net: Fix Broadcom iProc mdio mux driver base address Modify the base address of the Broadcom iProc MDIO mux driver to point to the start of the block's register address space. Signed-off-by: Arun Parameswaran Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit cda676b5c93fa3d1a1a1794a8ee8ae8860d06843 Author: Amit Kucheria Date: Wed Jul 18 12:13:13 2018 +0530 arm64: dts: sdm845: Add tsens nodes SDM845 has two tsens blocks, one with 13 sensors and the other with 8 sensors. It uses version 2 of the TSENS IP, so use the fallback property to allow more common code. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Andy Gross commit f35c11b03b44d68d7d0688e30f4a9a18a3a334d5 Author: Amit Kucheria Date: Wed Jul 18 12:13:10 2018 +0530 arm64: dts: msm8996: thermal: Initialise via DT and add second controller We also split up the regmap address space into two, for the TM and SROT registers. This was required to deal with different address offsets for the TM and SROT registers across different SoC families. 8996 has two TSENS IP blocks, initialise the second one too. Since tsens-common.c/init_common() currently only registers one address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Andy Gross commit 9a47249d444d344051c7c0e909fad0e88515a5c2 Author: Jason A. Donenfeld Date: Tue Jul 31 21:11:00 2018 +0200 random: Make crng state queryable It is very useful to be able to know whether or not get_random_bytes_wait / wait_for_random_bytes is going to block or not, or whether plain get_random_bytes is going to return good randomness or bad randomness. The particular use case is for mitigating certain attacks in WireGuard. A handshake packet arrives and is queued up. Elsewhere a worker thread takes items from the queue and processes them. In replying to these items, it needs to use some random data, and it has to be good random data. If we simply block until we can have good randomness, then it's possible for an attacker to fill the queue up with packets waiting to be processed. Upon realizing the queue is full, WireGuard will detect that it's under a denial of service attack, and behave accordingly. A better approach is just to drop incoming handshake packets if the crng is not yet initialized. This patch, therefore, makes that information directly accessible. Signed-off-by: Jason A. Donenfeld Signed-off-by: Theodore Ts'o commit ae61bac9c470cf546558ea525e7cf6b636f04046 Author: Wei Yongjun Date: Wed Aug 1 01:40:31 2018 +0000 gpio: pxa: remove set but not used variable 'gpio_offset' Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpio/gpio-pxa.c: In function "pxa_gpio_probe": drivers/gpio/gpio-pxa.c:629:35: warning: variable "gpio_offset" set but not used [-Wunused-but-set-variable] int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; ^ Signed-off-by: Wei Yongjun Acked-by: Robert Jarzmik Signed-off-by: Linus Walleij commit 7a0d5009dbb73bcecc199151e6a126aa3630d820 Merge: 0e8f31d78981 78ee559d7fc6 Author: Andy Gross Date: Thu Aug 2 16:27:10 2018 -0500 Merge tag 'qcom-drivers-for-4.19' into arm64-for-4.19-2 Qualcomm ARM Based Driver Updates for v4.19 * Add Qualcomm LLCC driver * Add Qualcomm RPMH controller * Fix memleak in Qualcomm RMTFS * Add dummy qcom_scm_assign_mem() * Fix check for global partition in SMEM commit 0e8f31d78981f5a3648d035b86c8fb920950865f Merge: ce397d215ccd e53db018315b Author: Andy Gross Date: Thu Aug 2 16:24:51 2018 -0500 Merge tag 'qcom-arm64-for-4.19' into arm64-for-4.19-2 Qualcomm ARM64 Updates for v4.19 * Add support for PM8005/PM8998 and related nodes * Add/fix nodes on SDM845 for I2c, SPI, UART, and RPMH * Fix BT LED trigger on DB410c * Drop legacy clock names on MSM8916 * Add gpio line names on DB820c commit 704f83928c8e7da6e06144569efb15dec73278e8 Author: Kees Cook Date: Tue Jul 31 12:51:54 2018 -0700 scsi: Check sense buffer size at build time To avoid introducing problems like those fixed in commit f7068114d45e ("sr: pass down correctly sized SCSI sense buffer"), this creates a macro wrapper for scsi_execute() that verifies the size of the sense buffer similar to what was done for command string sizes in commit 3756f6401c30 ("exec: avoid gcc-8 warning for get_task_comm"). Another solution could be to add a length argument to scsi_execute(), but this function already takes a lot of arguments and Jens was not fond of that approach. Additionally, this moves the SCSI_SENSE_BUFFERSIZE definition into scsi_device.h, and removes a redundant include for scsi_device.h from scsi_cmnd.h. Reviewed-by: Christoph Hellwig Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit 429296cc51c4cf145b240a78c8d68545e4d67e4c Author: Kees Cook Date: Tue Jul 31 12:51:53 2018 -0700 libata-scsi: Move sense buffers onto stack To support future compile-time sizeof() checks that will be able to validate the length of sense buffers, this removes the only dynamically allocated sense buffers in the tree by putting the 96 byte sense buffers on the stack. Reviewed-by: Christoph Hellwig Acked-by: Tejun Heo Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit 4e178c17cac07d58df7d31ef6fe10036cfa3883d Author: Kees Cook Date: Tue Jul 31 12:51:52 2018 -0700 cdrom: Use struct scsi_sense_hdr internally This removes more casts of struct request_sense and uses the standard struct scsi_sense_hdr instead. This also fixes any possible stale values since the prior code did not check the sense length. Reviewed-by: Christoph Hellwig Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit 7a6873be1b11517a0c55ab4534e4de54b3e228a3 Author: Kees Cook Date: Tue Jul 31 12:51:51 2018 -0700 ide-cd: Remove redundant sense buffer This is already able to process the sense buffer, so remove the redundant parsing during the failure path. This also fixes any possible stale values since the prior code did not check the sense length. Acked-by: David S. Miller Reviewed-by: Christoph Hellwig Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit e7d0748dd71695b94f3a35c8bdc05226a7f3d919 Author: Kees Cook Date: Thu Aug 2 15:22:13 2018 -0600 block: Switch struct packet_command to use struct scsi_sense_hdr There is a lot of needless struct request_sense usage in the CDROM code. These can all be struct scsi_sense_hdr instead, to avoid any confusion over their respective structure sizes. This patch is a lot of noise changing "sense" to "sshdr", but the final code is more readable to distinguish between "sense" meaning "struct request_sense" and "sshdr" meaning "struct scsi_sense_hdr". Reviewed-by: Christoph Hellwig Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit 8a39a0478355e9dfdd2f35038d07c4ebe3192441 Author: Christoph Hellwig Date: Tue Jul 31 12:51:49 2018 -0700 target: don't depend on SCSI The core target code only needs code from scsi_common.c, which is now separately selectable. Signed-off-by: Christoph Hellwig Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit ad80f9703a3de62c48c012af62899b754af087f1 Author: Christoph Hellwig Date: Tue Jul 31 12:51:48 2018 -0700 scsi: build scsi_common.o for all scsi passthrough request users Split scsi_common.o out of SCSI so that non-SCSI users can pull it in easily for future sense buffer helper usage. Signed-off-by: Christoph Hellwig Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit 1fd89e4ddcec0c8cae15ddd19980cb944b2baf5d Author: Kees Cook Date: Tue Jul 31 12:51:47 2018 -0700 scsi: cxlflash: Drop unused sense buffers This removes the unused sense buffer in read_cap16() and write_same16(). Reviewed-by: Christoph Hellwig Acked-by: Matthew R. Ochs Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit 54f8a7ae7c210382a3037887a9831462741ae0db Author: Kees Cook Date: Tue Jul 31 12:51:46 2018 -0700 ide-cd: Drop unused sense buffers This drops unused sense buffers from: cdrom_eject() cdrom_read_capacity() cdrom_read_tocentry() ide_cd_lockdoor() ide_cd_read_toc() Acked-by: David S. Miller Reviewed-by: Christoph Hellwig Signed-off-by: Kees Cook Signed-off-by: Jens Axboe commit dc0aa99258813b1e8b567e20bb50ed4a931a848a Author: Himanshu Madhani Date: Thu Aug 2 13:16:58 2018 -0700 scsi: qla2xxx: Update driver version to 10.00.00.08-k Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 8777e4314d397c4e3615dc02fe8537e571e3922f Author: Quinn Tran Date: Thu Aug 2 13:16:57 2018 -0700 scsi: qla2xxx: Migrate NVME N2N handling into state machine This patch fixes regression introduced for the N2N support for FC-NVMe. For FC-NVMe with N2N connection, instead of FW initiating the Login, Driver starts Login process. This patch migrates that new process from a standalone path into existing session management state machine. With this state change now driver will not wait for pull NPort ID from FW. Fixes: edd05de197592 ("scsi: qla2xxx: Changes to support N2N logins") Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 0eaaca4c1bd6349fff3a47228c4db8e9e5cf7cdf Author: Quinn Tran Date: Thu Aug 2 13:16:56 2018 -0700 scsi: qla2xxx: Save frame payload size from ICB Save frame payload size from init control block. This field/data is used to register with switch database. This allows the init control block temp buf to be reused. [mkp: remove unused variable] Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 15b6c3c9568765f0717b2dd3aa67a5f7eadd9734 Author: Himanshu Madhani Date: Thu Aug 2 13:16:55 2018 -0700 scsi: qla2xxx: Fix stalled relogin This patch sets and clears FCF_ASYNC_{SENT|ACTIVE} flags to prevent stalling of relogin attempt. Once flag are correctly set/cleared, relogin timer can retry relogin attempt for driver to continue login. Fixes: fa83e65885b9 ("scsi: qla2xxx: ensure async flags are reset correctly") Cc: stable@vger.kernel.org #4.17 Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit f6145e86d21fccd59bbb87bc1e1eb076658fd79a Author: Quinn Tran Date: Thu Aug 2 13:16:54 2018 -0700 scsi: qla2xxx: Fix race between switch cmd completion and timeout Fix race condition between switch cmd completion and timeout timer. Timer has popped triggers command free. On IOCB completion, stale sp point was reused. Instead, an abort will be sent to FW to nudge the command out of FW where the normal completion will take place. RIP: 0010:qla2x00_chk_ms_status+0xf3/0x1b0 [qla2xxx] Call Trace: qla24xx_els_ct_entry.isra.15+0x1d4/0x2b0 [qla2xxx] qla24xx_msix_rsp_q+0x39/0xf0 [qla2xxx] qla24xx_process_response_queue+0xbc/0x2b0 [qla2xxx] qla24xx_msix_rsp_q+0x8a/0xf0 [qla2xxx] __handle_irq_event_percpu+0xa0/0x1f0 Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit f6602f3befbb9979cdb031e32211358dd008d05e Author: Quinn Tran Date: Thu Aug 2 13:16:53 2018 -0700 scsi: qla2xxx: Fix Management Server NPort handle reservation logic After selecting the NPort handle/loop_id, set a bit in the loop_id_map to prevent others from selecting the same NPort handle. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit b2000805a9759d315f56eecaca7779aa9197a72f Author: Quinn Tran Date: Thu Aug 2 13:16:52 2018 -0700 scsi: qla2xxx: Flush mailbox commands on chip reset Flush pending mailbox commands on chip reset. Wake up command that's waiting for an interrupt and wait for mailbox counters to go to zero. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit cb97f2c2e8d9f8c71ddbf04ad57e163ee6d86474 Author: Quinn Tran Date: Thu Aug 2 13:16:51 2018 -0700 scsi: qla2xxx: Fix unintended Logout During normal IO, FW can return IO with 'port unavailble' status. Driver would send a LOGO to remote port for session resync. On an off chance, a PLOGI could arrive before sending the LOGO. This patch will skip sendiing LOGO if a PLOGI just came in. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 8fde6977ac478c00eeb2beccfdd4a6ad44219f6c Author: Quinn Tran Date: Thu Aug 2 13:16:50 2018 -0700 scsi: qla2xxx: Fix session state stuck in Get Port DB This patch sets discovery state back to GNL (Get Name List) when session is stuck at GPDB (Get Port DataBase). This will allow state machine to retry login and move session state ahead in discovery. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit b63d8b895a1038e5ff762e19b46e9fe9fa3a19a2 Author: Quinn Tran Date: Thu Aug 2 13:16:49 2018 -0700 scsi: qla2xxx: Fix redundant fc_rport registration Prevent multiple registrations with transport layer for the same remote port. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 3f915271b12e11183c606bed1c3dfff0983662d3 Author: Quinn Tran Date: Thu Aug 2 13:16:48 2018 -0700 scsi: qla2xxx: Silent erroneous message Driver uses shadow pointer instead of Mirror pointer for firmware dump collection. Skip those entries for Mirror pointers for Request/Response queue from firmware dump template reading. Following messages are printed in log messages: qla27xx_fwdt_entry_t268: unknown buffer 4 qla27xx_fwdt_entry_t268: unknown buffer 5 This patch fixes these error messages by adding skip_entry() to not read them from template. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 22ebde16f141a5602a5e7c090aac7d50eb05f475 Author: Quinn Tran Date: Thu Aug 2 13:16:47 2018 -0700 scsi: qla2xxx: Prevent sysfs access when chip is down Prevent user from sending commands through sysfs while firmware is not running or reset is in progress. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 7e84766c9bceb4fc687f483a4cc2bff06f89a563 Author: Quinn Tran Date: Thu Aug 2 13:16:46 2018 -0700 scsi: qla2xxx: Add longer window for chip reset qla2x00_reset_active only covers the window of turning the chip off. Add check to cover turning chip on. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 23dd98a6555897f65306c6937b428c8742fef610 Author: Quinn Tran Date: Thu Aug 2 13:16:45 2018 -0700 scsi: qla2xxx: Fix login retry count Login retry count was not properly decrementing which lead to endless retry. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 48acad099074984f6b0b6e4da011856ba25d12ba Author: Quinn Tran Date: Thu Aug 2 13:16:44 2018 -0700 scsi: qla2xxx: Fix N2N link re-connect In case of N2N connect, sg_reset for bus/device/host was causing driver and firmware state to go out of sync. This patch fixes this link instablity when reconnect is attempted after link flap. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 4ae5716b4188d20178fdcaa39561fa50f6e6b513 Author: Himanshu Madhani Date: Thu Aug 2 13:16:43 2018 -0700 scsi: qla2xxx: Cleanup for N2N code Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 67075b3cb8d509642ff09ef3134a3b2d30c45a32 Author: Kuninori Morimoto Date: Mon Jul 30 07:49:55 2018 +0000 clk: cs2000-cp: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Stephen Boyd commit 7a8655e19bdb3be43f6a3b4768c9b0928a2585fc Author: Amit Daniel Kachhap Date: Tue Jul 31 11:25:55 2018 +0530 clk: scmi: Fix the rounding of clock rate This fix rounds the clock rate properly by using quotient and not remainder in the calculation. This issue was found while testing HDMI in the Juno platform. Fixes: 6d6a1d82eaef7 ("clk: add support for clocks provided by SCMI") Acked-by: Sudeep Holla Signed-off-by: Amit Daniel Kachhap Signed-off-by: Stephen Boyd commit 75d6e175fc511e95ae3eb8f708680133bc211ed3 Author: Ming Lei Date: Thu Aug 2 18:23:26 2018 +0800 blk-mq: fix updating tags depth The passed 'nr' from userspace represents the total depth, meantime inside 'struct blk_mq_tags', 'nr_tags' stores the total tag depth, and 'nr_reserved_tags' stores the reserved part. There are two issues in blk_mq_tag_update_depth() now: 1) for growing tags, we should have used the passed 'nr', and keep the number of reserved tags not changed. 2) the passed 'nr' should have been used for checking against 'tags->nr_tags', instead of number of the normal part. This patch fixes the above two cases, and avoids kernel crash caused by wrong resizing sbitmap queue. Cc: "Ewan D. Milne" Cc: Christoph Hellwig Cc: Bart Van Assche Cc: Omar Sandoval Tested by: Marco Patalano Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit a89f4f1e5f56a3e595c1a87f43df68e22fabf479 Author: Colin Ian King Date: Wed Aug 1 15:58:41 2018 +0100 scsi: sym53c8xx: remove some redundant variables Variables scriptb0 and dp_sgmin are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'scriptb0' set but not used [-Wunused-but-set-variable] warning: variable 'dp_sgmin' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 46a75118d6fb93863abfa3723ea6a7ca921c928b Author: Arjun Vynipadath Date: Wed Aug 1 17:17:12 2018 +0530 scsi: csiostor: update csio_get_flash_params() - Updates csio_get_flash_params() to take care of ISSI, Macronix and Winbond FLASH parts. - Assume flash part size to be 4MB if it cannot be identified Signed-off-by: Arjun Vynipadath Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen commit a3f90c75b833caeff123499e13e0e31cbecf7d5b Author: Mauro Carvalho Chehab Date: Thu Jul 5 18:59:35 2018 -0400 media: dvb: convert tuner_info frequencies to Hz Right now, satellite tuner drivers specify frequencies in kHz, while terrestrial/cable ones specify in Hz. That's confusing for developers. However, the main problem is that universal tuners capable of handling both satellite and non-satelite delivery systems are appearing. We end by needing to hack the drivers in order to support such hybrid tuners. So, convert everything to specify tuner frequencies in Hz. Plese notice that a similar patch is also needed for frontends. Tested-by: Katsuhiro Suzuki Acked-by: Michael Büsch Signed-off-by: Mauro Carvalho Chehab commit 0ee223b2e1f67cb2de9c0e3247c510d846e74d63 Author: Bart Van Assche Date: Thu Aug 2 10:51:41 2018 -0700 scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock A long time ago the unfortunate decision was taken to add a self-deletion attribute to the sysfs SCSI device directory. That decision was unfortunate because self-deletion is really tricky. We can't drop that attribute because widely used user space software depends on it, namely the rescan-scsi-bus.sh script. Hence this patch that avoids that writing into that attribute triggers a deadlock. See also commit 7973cbd9fbd9 ("[PATCH] add sysfs attributes to scan and delete scsi_devices"). This patch avoids that self-removal triggers the following deadlock: ====================================================== WARNING: possible circular locking dependency detected 4.18.0-rc2-dbg+ #5 Not tainted ------------------------------------------------------ modprobe/6539 is trying to acquire lock: 000000008323c4cd (kn->count#202){++++}, at: kernfs_remove_by_name_ns+0x45/0x90 but task is already holding lock: 00000000a6ec2c69 (&shost->scan_mutex){+.+.}, at: scsi_remove_host+0x21/0x150 [scsi_mod] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&shost->scan_mutex){+.+.}: __mutex_lock+0xfe/0xc70 mutex_lock_nested+0x1b/0x20 scsi_remove_device+0x26/0x40 [scsi_mod] sdev_store_delete+0x27/0x30 [scsi_mod] dev_attr_store+0x3e/0x50 sysfs_kf_write+0x87/0xa0 kernfs_fop_write+0x190/0x230 __vfs_write+0xd2/0x3b0 vfs_write+0x101/0x270 ksys_write+0xab/0x120 __x64_sys_write+0x43/0x50 do_syscall_64+0x77/0x230 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (kn->count#202){++++}: lock_acquire+0xd2/0x260 __kernfs_remove+0x424/0x4a0 kernfs_remove_by_name_ns+0x45/0x90 remove_files.isra.1+0x3a/0x90 sysfs_remove_group+0x5c/0xc0 sysfs_remove_groups+0x39/0x60 device_remove_attrs+0x82/0xb0 device_del+0x251/0x580 __scsi_remove_device+0x19f/0x1d0 [scsi_mod] scsi_forget_host+0x37/0xb0 [scsi_mod] scsi_remove_host+0x9b/0x150 [scsi_mod] sdebug_driver_remove+0x4b/0x150 [scsi_debug] device_release_driver_internal+0x241/0x360 device_release_driver+0x12/0x20 bus_remove_device+0x1bc/0x290 device_del+0x259/0x580 device_unregister+0x1a/0x70 sdebug_remove_adapter+0x8b/0xf0 [scsi_debug] scsi_debug_exit+0x76/0xe8 [scsi_debug] __x64_sys_delete_module+0x1c1/0x280 do_syscall_64+0x77/0x230 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&shost->scan_mutex); lock(kn->count#202); lock(&shost->scan_mutex); lock(kn->count#202); *** DEADLOCK *** 2 locks held by modprobe/6539: #0: 00000000efaf9298 (&dev->mutex){....}, at: device_release_driver_internal+0x68/0x360 #1: 00000000a6ec2c69 (&shost->scan_mutex){+.+.}, at: scsi_remove_host+0x21/0x150 [scsi_mod] stack backtrace: CPU: 10 PID: 6539 Comm: modprobe Not tainted 4.18.0-rc2-dbg+ #5 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014 Call Trace: dump_stack+0xa4/0xf5 print_circular_bug.isra.34+0x213/0x221 __lock_acquire+0x1a7e/0x1b50 lock_acquire+0xd2/0x260 __kernfs_remove+0x424/0x4a0 kernfs_remove_by_name_ns+0x45/0x90 remove_files.isra.1+0x3a/0x90 sysfs_remove_group+0x5c/0xc0 sysfs_remove_groups+0x39/0x60 device_remove_attrs+0x82/0xb0 device_del+0x251/0x580 __scsi_remove_device+0x19f/0x1d0 [scsi_mod] scsi_forget_host+0x37/0xb0 [scsi_mod] scsi_remove_host+0x9b/0x150 [scsi_mod] sdebug_driver_remove+0x4b/0x150 [scsi_debug] device_release_driver_internal+0x241/0x360 device_release_driver+0x12/0x20 bus_remove_device+0x1bc/0x290 device_del+0x259/0x580 device_unregister+0x1a/0x70 sdebug_remove_adapter+0x8b/0xf0 [scsi_debug] scsi_debug_exit+0x76/0xe8 [scsi_debug] __x64_sys_delete_module+0x1c1/0x280 do_syscall_64+0x77/0x230 entry_SYSCALL_64_after_hwframe+0x49/0xbe See also https://www.mail-archive.com/linux-scsi@vger.kernel.org/msg54525.html. Fixes: ac0ece9174ac ("scsi: use device_remove_file_self() instead of device_schedule_callback()") Signed-off-by: Bart Van Assche Cc: Greg Kroah-Hartman Acked-by: Tejun Heo Cc: Johannes Thumshirn Cc: Signed-off-by: Martin K. Petersen commit 2afc9166f79b8f6da5f347f48515215ceee4ae37 Author: Bart Van Assche Date: Thu Aug 2 10:51:40 2018 -0700 scsi: sysfs: Introduce sysfs_{un,}break_active_protection() Introduce these two functions and export them such that the next patch can add calls to these functions from the SCSI core. Signed-off-by: Bart Van Assche Acked-by: Tejun Heo Acked-by: Greg Kroah-Hartman Cc: Signed-off-by: Martin K. Petersen commit 7fa8512330ab7cbb394b3e42ee092f4ad2e8f906 Author: James Smart Date: Tue Jul 31 17:23:25 2018 -0700 scsi: lpfc: update driver version to 12.0.0.6 Update the driver version to 12.0.0.6 Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 06b6fa38155ea3709f4d612ae71c201c3f179164 Author: James Smart Date: Tue Jul 31 17:23:24 2018 -0700 scsi: lpfc: Remove lpfc_enable_pbde as module parameter Enablement of the PBDE optimization brought out some incompatible behaviors under error scenarios. Best to disable and remove the PBDE optimization. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 24bc3119424ac163c2f67e072c956f50e153d034 Author: James Smart Date: Tue Jul 31 17:23:23 2018 -0700 scsi: lpfc: Correct LCB ACCept payload After memory allocation for the LCB response frame, the memory wasn't zero initialized, and not all fields are set. Thus garbage shows up in the payload. Fix by zeroing the memory at allocation. Also properly set the Capability field based on duration support. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 2a5b7d626ed2256fd0ef0e799ebc6ef47b7bd283 Author: James Smart Date: Tue Jul 31 17:23:22 2018 -0700 scsi: lpfc: Limit tracking of tgt queue depth in fast path Performance is affected when target queue depth is tracked. An atomic counter is incremented on the submission path which competes with it being decremented on the completion path. In addition, multiple CPUs can simultaniously be manipulating this counter for the same ndlp. Reduce the overhead by only performing the target increment/decrement when the target queue depth is less than the overall adapter depth, thus is actually meaningful. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 93a3922da428ec0752e8b2ab00c42dadbbf805a9 Author: James Smart Date: Tue Jul 31 17:23:21 2018 -0700 scsi: lpfc: Fix driver crash when re-registering NVME rports. During remote port loss fault testing, the driver crashed with the following trace: general protection fault: 0000 [#1] SMP RIP: ... lpfc_nvme_register_port+0x250/0x480 [lpfc] Call Trace: lpfc_nlp_state_cleanup+0x1b3/0x7a0 [lpfc] lpfc_nlp_set_state+0xa6/0x1d0 [lpfc] lpfc_cmpl_prli_prli_issue+0x213/0x440 lpfc_disc_state_machine+0x7e/0x1e0 [lpfc] lpfc_cmpl_els_prli+0x18a/0x200 [lpfc] lpfc_sli_sp_handle_rspiocb+0x3b5/0x6f0 [lpfc] lpfc_sli_handle_slow_ring_event_s4+0x161/0x240 [lpfc] lpfc_work_done+0x948/0x14c0 [lpfc] lpfc_do_work+0x16f/0x180 [lpfc] kthread+0xc9/0xe0 ret_from_fork+0x55/0x80 After registering a new remoteport, the driver is pulling an ndlp pointer from the lpfc rport associated with the private area of a newly registered remoteport. The private area is uninitialized, so it's garbage. Correct by pulling the the lpfc rport pointer from the entering ndlp point, then ndlp value from at rport. Note the entering ndlp may be replacing by the rport->ndlp due to an address change swap. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 8931c73bee077f5bc5710afebc0136363970cb2b Author: James Smart Date: Tue Jul 31 17:23:20 2018 -0700 scsi: lpfc: Fix list corruption on the completion queue. Enabling list_debug showed the drivers txcmplq was suffering list corruption. The systems will eventually crash because the iocb free list gets crossed linked with the prings txcmplq. Most systems will run for a while after the corruption, but will eventually crash when a scsi eh reset occurs and the txcmplq is attempted to be flushed. The flush gets stuck in an endless loop. The problem is the abort handler does not hold the sli4 ring lock while validating the IO so the IO could complete while the driver is still preping the abort. The erroneously generated abort, when it completes, has pointers to the original IO that has already completed, and the IO manipulation (for the second time) corrupts the list. Correct by taking the ring lock early in the abort handler so the erroneous abort won't be sent if the io has/is completing. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b615a20adf04cf3c8e9293851da3aac54792fb07 Author: James Smart Date: Tue Jul 31 17:23:19 2018 -0700 scsi: lpfc: Fix sysfs Speed value on CNA ports CNA ports were showing speed as "unknown" even if the link is up. Add speed decoding for FCOE-based adapters. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit faa832e97a0c0d79838c3a6521a473d870217053 Author: James Smart Date: Tue Jul 31 17:23:18 2018 -0700 scsi: lpfc: Fix ELS abort on SLI-3 adapters For ABORT_XRI_CN command, firmware identifies XRI to abort by IOTAG and RPI combination. For ELS aborts, driver specifies IOTAG correctly but RPI is not specified. Fix by setting RPI in WQE. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 8687a3e2c7a026c173ac2e0d65d869c98c154a3a Author: Chengguang Xu Date: Thu Jul 19 22:15:26 2018 +0800 ceph: add additional offset check in ceph_write_iter() If the offset is larger or equal to both real file size and max file size, then return -EFBIG. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 0671e9968dfb3f99a366df816c361b8e871dba1b Author: Chengguang Xu Date: Thu Jul 19 22:15:25 2018 +0800 ceph: add additional range check in ceph_fallocate() If the range is larger than both real file size and limit of max file size, then return -EFBIG. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 719784ba706cdbb47ef87483950f0a4594d36e87 Author: Chengguang Xu Date: Thu Jul 19 22:15:24 2018 +0800 ceph: add new field max_file_size in ceph_fs_client In order to not bother to VFS and other specific filesystems, we decided to do offset validation inside ceph kernel client, so just simply set sb->s_maxbytes to MAX_LFS_FILESIZE so that it can successfully pass VFS check. We add new field max_file_size in ceph_fs_client to store real file size limit and doing proper check based on it. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit f1d10e04637924f2b00a0fecdd2ca4565f5cfc3f Author: Ilya Dryomov Date: Fri Jul 27 19:45:36 2018 +0200 libceph: weaken sizeof check in ceph_x_verify_authorizer_reply() Allow for extending ceph_x_authorize_reply in the future. Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil commit 130f52f2b203aa0aec179341916ffb2e905f3afd Author: Ilya Dryomov Date: Fri Jul 27 19:40:30 2018 +0200 libceph: check authorizer reply/challenge length before reading Avoid scribbling over memory if the received reply/challenge is larger than the buffer supplied with the authorizer. Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil commit cc255c76c70f7a87d97939621eae04b600d9f4a1 Author: Ilya Dryomov Date: Fri Jul 27 19:25:32 2018 +0200 libceph: implement CEPHX_V2 calculation mode Derive the signature from the entire buffer (both AES cipher blocks) instead of using just the first half of the first block, leaving out data_crc entirely. This addresses CVE-2018-1129. Link: http://tracker.ceph.com/issues/24837 Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil commit 6daca13d2e72bedaaacfc08f873114c9307d5aea Author: Ilya Dryomov Date: Fri Jul 27 19:18:34 2018 +0200 libceph: add authorizer challenge When a client authenticates with a service, an authorizer is sent with a nonce to the service (ceph_x_authorize_[ab]) and the service responds with a mutation of that nonce (ceph_x_authorize_reply). This lets the client verify the service is who it says it is but it doesn't protect against a replay: someone can trivially capture the exchange and reuse the same authorizer to authenticate themselves. Allow the service to reject an initial authorizer with a random challenge (ceph_x_authorize_challenge). The client then has to respond with an updated authorizer proving they are able to decrypt the service's challenge and that the new authorizer was produced for this specific connection instance. The accepting side requires this challenge and response unconditionally if the client side advertises they have CEPHX_V2 feature bit. This addresses CVE-2018-1128. Link: http://tracker.ceph.com/issues/24836 Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil commit 149cac4a50b0b4081b38b2f38de6ef71c27eaa85 Author: Ilya Dryomov Date: Fri Jul 27 16:37:54 2018 +0200 libceph: factor out encrypt_authorizer() Will be used for encrypting both the initial and updated authorizers. Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil commit c571fe24d243bfe7017f0e67fe800b3cc2a1d1f7 Author: Ilya Dryomov Date: Thu Jul 26 18:05:43 2018 +0200 libceph: factor out __ceph_x_decrypt() Will be used for decrypting the server challenge which is only preceded by ceph_x_encrypt_header. Drop struct_v check to allow for extending ceph_x_encrypt_header in the future. Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil commit c0f56b483aa09c99bfe97409a43ad786f33b8a5a Author: Ilya Dryomov Date: Thu Jul 26 17:43:47 2018 +0200 libceph: factor out __prepare_write_connect() Will be used for sending ceph_msg_connect with an updated authorizer, after the server challenges the initial authorizer. Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil commit 262614c4294d33b1f19e0d18c0091d9c329b544a Author: Ilya Dryomov Date: Thu Jul 26 15:17:46 2018 +0200 libceph: store ceph_auth_handshake pointer in ceph_connection We already copy authorizer_reply_buf and authorizer_reply_buf_len into ceph_connection. Factoring out __prepare_write_connect() requires two more: authorizer_buf and authorizer_buf_len. Store the pointer to the handshake in con->auth rather than piling on. Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil commit 24e1dd6afde9e9cca405df8ca98be59419ea7229 Author: Stephen Hemminger Date: Tue Jul 24 12:29:07 2018 -0700 ceph: fix whitespace Remove blank lines at end of file and trailing whitespace. Signed-off-by: Stephen Hemminger Signed-off-by: Ilya Dryomov commit 24499847e4471b0aba8126cebd640084136fc2bb Author: Souptick Joarder Date: Mon Jul 23 21:32:24 2018 +0530 ceph: adding new return type vm_fault_t Use new return type vm_fault_t for page_mkwrite and fault handler. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Ilya Dryomov commit f7e52d8efe8588c5d4b4c78eb33da81d89486c1a Author: Ilya Dryomov Date: Mon Jul 23 14:11:40 2018 +0200 libceph: remove now unused ceph_{en,de}code_timespec() Signed-off-by: Ilya Dryomov commit 0ed1e90a09eb0e2863cab43e1ed5c5df89566772 Author: Arnd Bergmann Date: Fri Jul 13 22:18:38 2018 +0200 ceph: use timespec64 for r_stamp The ceph_mds_request stamp still uses the deprecated timespec structure, this converts it over as well. Signed-off-by: Arnd Bergmann Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit fac02ddf910814c24f5d9d969dfdab5227f6f3eb Author: Arnd Bergmann Date: Fri Jul 13 22:18:37 2018 +0200 libceph: use timespec64 for r_mtime The request mtime field is used all over ceph, and is currently represented as a 'timespec' structure in Linux. This changes it to timespec64 to allow times beyond 2038, modifying all users at the same time. [ Remove now redundant ts variable in writepage_nounlock(). ] Signed-off-by: Arnd Bergmann Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 3f285135bcff65c4817541edbee55e5b7f7917d2 Author: Ajay Singh Date: Thu Aug 2 16:57:02 2018 +0530 staging: wilc1000: fix compilation warning for ARCH PowerPC Fix below warning reported for PowerPC arch compilation include/uapi/linux/byteorder/big_endian.h:95:37: warning: passing argument 1 of '__swab32s' makes pointer from integer without a cast [-Wint-conversion] Fixes: 02211edc9a1f ("staging: wilc1000: fix endianness warnings reported by sparse") Reported-by: kbuild test robot Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 25b88550b7d57c6ae91b0e5f4b1be2aaa73a60df Author: Mike Christie Date: Thu Aug 2 12:12:27 2018 -0500 scsi: target: loop, usb, vhost, xen: use target_remove_session This converts drivers that were only calling transport_deregister_session to use target_remove_session. The calling of transport_deregister_session_configfs via target_remove_session for these types of drivers is ok, because they were not exporting info from fields like sess_acl_list, sess->se_tpg and sess->fabric_sess_ptr from configfs accessible functions, so they will see no difference. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Felipe Balbi Cc: Sebastian Andrzej Siewior Cc: Andrzej Pietrasiewicz Cc: Michael S. Tsirkin Cc: Juergen Gross Signed-off-by: Martin K. Petersen commit 60daca10065a13a133e88b738fdc5a40b3654575 Author: Mike Christie Date: Thu Aug 2 12:12:26 2018 -0500 scsi: tcm_fc: use target_remove_session This converts tcm_fc to use target_remove_session tcm_fc was calling transport_deregister_session_configfs then calling transport_deregister_session when commands have completed. It should be ok for it to call transport_deregister_session_configfs later via target_remove_session because transport_deregister_session_configfs only prevents access from configfs via tpg removal and its call to the close_session callback for that driver, and this is already protected by the ft_lport_lock and its port lookup handling. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit b287e3517ed5c76ad48afdfc4f11fadb58a0707e Author: Mike Christie Date: Thu Aug 2 12:12:25 2018 -0500 scsi: target: srp, vscsi, sbp, qla: use target_remove_session This converts the drivers that called transport_deregister_session_configfs and then immediately called transport_deregister_session to use target_remove_session. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Chris Boot Cc: Bryant G. Ly Cc: Michael Cyr Cc: Signed-off-by: Martin K. Petersen commit fb7c70f2d750a462c5a9757555bc23bf35360cec Author: Mike Christie Date: Thu Aug 2 12:12:24 2018 -0500 scsi: target: add session removal function This adds a function to remove a session which should be used by drivers that use target_setup_session. The next patches will convert the target drivers to use this new function. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Chris Boot Cc: Bryant G. Ly Cc: Michael Cyr Cc: Cc: Johannes Thumshirn Cc: Felipe Balbi Cc: Sebastian Andrzej Siewior Cc: Andrzej Pietrasiewicz Cc: Michael S. Tsirkin Cc: Juergen Gross Signed-off-by: Martin K. Petersen commit fa834287300ba6a89e0a590f520a3398527eb541 Author: Mike Christie Date: Thu Aug 2 12:12:23 2018 -0500 scsi: target: rename target_alloc_session Rename target_alloc_session to target_setup_session to avoid confusion with the other transport session allocation function that only allocates the session and because the target_alloc_session does so much more. It allocates the session, sets up the nacl and registers the session. The next patch will then add a remove function to match the setup in this one, so it should make sense for all drivers, except iscsi, to just call those 2 functions to setup and remove a session. iscsi will continue to be the odd driver. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Chris Boot Cc: Bryant G. Ly Cc: Michael Cyr Cc: Cc: Johannes Thumshirn Cc: Felipe Balbi Cc: Sebastian Andrzej Siewior Cc: Andrzej Pietrasiewicz Cc: Michael S. Tsirkin Cc: Juergen Gross Signed-off-by: Martin K. Petersen commit 3cd14285a1bb58eaa98c44aec0db4d914fdc8c13 Author: Mike Christie Date: Thu Aug 2 12:12:22 2018 -0500 scsi: target: make transport_init_session_tags static transport_init_session_tags is only called from target_core_transport.c so make it static. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit aeb502794b75f201d1df05f2f351346e0eb2eb83 Author: Mike Christie Date: Thu Aug 2 12:12:21 2018 -0500 scsi: iscsi target: have iscsit_start_nopin_timer call __iscsit_start_nopin_timer Just have iscsit_start_nopin_timer grab the lock and call __iscsit_start_nopin_timer. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 6a64f6e1591322beb8ce16e952a53582caf2a15c Author: Mike Christie Date: Thu Aug 2 12:12:20 2018 -0500 scsi: target: fix __transport_register_session locking When __transport_register_session is called from transport_register_session irqs will already have been disabled, so we do not want the unlock irq call to enable them until the higher level has done the final spin_unlock_irqrestore/ spin_unlock_irq. This has __transport_register_session use the save/restore call. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 9bbeab41ce50542624ef381e7852d70f2f39a2b1 Author: Arnd Bergmann Date: Fri Jul 13 22:18:36 2018 +0200 ceph: use timespec64 for inode timestamp Since the vfs structures are all using timespec64, we can now change the internal representation, using ceph_encode_timespec64 and ceph_decode_timespec64. In case of ceph_aux_inode however, we need to avoid doing a memcmp() on uninitialized padding data, so the members of the i_mtime field get copied individually into 64-bit integers. Signed-off-by: Arnd Bergmann Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 63ecae7e439f766e88c91da56955bca4db06802a Author: Arnd Bergmann Date: Fri Jul 13 22:18:35 2018 +0200 ceph: stop using current_kernel_time() ceph_mdsc_create_request() is one of the last callers of the deprecated current_kernel_time() as well as timespec_trunc(). This changes it to use the timespec64 based interfaces instead, though we still need to convert the result until we are ready to change over req->r_stamp. The output of the two functions, ktime_get_coarse_real_ts64() and current_kernel_time() is the same coarse-granular timestamp, the only difference here is that ktime_get_coarse_real_ts64() doesn't overflow in 2038. Signed-off-by: Arnd Bergmann Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 473bd2d780d1699d81b25f57c0ec4de633a28eb8 Author: Arnd Bergmann Date: Fri Jul 13 22:18:34 2018 +0200 libceph: use timespec64 in for keepalive2 and ticket validity ceph_con_keepalive_expired() is the last user of timespec_add() and some of the last uses of ktime_get_real_ts(). Replacing this with timespec64 based interfaces lets us remove that deprecated API. I'm introducing new ceph_encode_timespec64()/ceph_decode_timespec64() here that take timespec64 structures and convert to/from ceph_timespec, which is defined to have an unsigned 32-bit tv_sec member. This extends the range of valid times to year 2106, avoiding the year 2038 overflow. The ceph file system portion still uses the old functions for inode timestamps, this will be done separately after the VFS layer is converted. Signed-off-by: Arnd Bergmann Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 67fcd151400242757edbab710402161b2cd38989 Author: Chengguang Xu Date: Mon Jul 9 22:17:31 2018 +0800 ceph: add d_drop for some error cases in ceph_symlink() When file num exceeds quota limit, should call d_drop to drop dentry from cache as well. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 0459871c4995d0bd57d6b1694f0971ec5cabafc1 Author: Chengguang Xu Date: Mon Jul 9 22:17:30 2018 +0800 ceph: add d_drop for some error cases in ceph_mknod() When file num exceeds quota limit or fails from ceph_per_init_acls() should call d_drop to drop dentry from cache as well. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 61ad36d47dd273b7b8c3d63fc8359d96f7976c79 Author: Chengguang Xu Date: Mon Jul 9 22:48:07 2018 +0800 ceph: return errors from posix_acl_equiv_mode() correctly In order to return correct error code should replace variable ret using err in error case. Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit dfeb84d4adfda0448b013b8aae2cc5c95eb27ccd Author: Yan, Zheng Date: Mon Jul 2 15:55:23 2018 +0800 ceph: fix incorrect use of strncpy GCC8 prints following warning: fs/ceph/mds_client.c:3683:2: warning: ‘strncpy’ output may be truncated copying 64 bytes from a string of length 64 [-Wstringop-truncation] [ Change to strscpy() while at it. ] Signed-off-by: "Yan, Zheng" Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit b26c047b940003295d3896b7f633a66aab95bebd Author: Ilya Dryomov Date: Tue Jul 3 15:28:43 2018 +0200 rbd: support for images within namespaces Cloning across namespaces isn't supported yet -- for now both the parent and the clone have to live in the same namespace, whether the default (i.e. "") or a user-created namespace. Signed-off-by: Ilya Dryomov commit c300156bc734796e251fa31b07dff2af2f572889 Author: Ilya Dryomov Date: Tue Jul 3 15:28:43 2018 +0200 rbd: pass rbd_spec into parse_rbd_opts_token() In preparation for _pool_ns client option, make rbd_spec available inside parse_rbd_opts_token(). Signed-off-by: Ilya Dryomov commit 2f56b6bae73b2d65ef4816ca89341facc53d3361 Author: Ilya Dryomov Date: Wed Jun 27 16:38:13 2018 +0200 libceph: amend "bad option arg" error message Don't mention "mount" -- in the rbd case it is "mapping". Signed-off-by: Ilya Dryomov commit 17173c82e3daa28742bf7732520e9bc2e0cb977d Author: Chengguang Xu Date: Wed Jun 27 21:05:08 2018 +0800 libceph: stop parsing when a bad int arg is detected There is no reason to continue option parsing after detecting bad option. [ Return match_int() errors from ceph_parse_options() to match the behaviour of parse_rbd_opts_token() and parse_fsopt_token(). ] Signed-off-by: Chengguang Xu Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit c9ed51c9123ab5e8f79b7d53a9afd786b43d4fe6 Author: Ilya Dryomov Date: Wed Jun 27 16:42:51 2018 +0200 libceph: change ceph_pagelist_encode_string() to take u32 The wire format dictates that the length of string fits into 4 bytes. Take u32 instead of size_t to reflect that. We were already truncating len in ceph_pagelist_encode_32() -- this just pushes that truncation one level up. Signed-off-by: Ilya Dryomov commit 6d54228fd1f293d00576ab2c3d2e4992c7cce12f Author: Ilya Dryomov Date: Mon Jun 25 17:26:55 2018 +0200 libceph: make ceph_osdc_notify{,_ack}() payload_len u32 The wire format dictates that payload_len fits into 4 bytes. Take u32 instead of size_t to reflect that. All callers pass a small integer, so no changes required. Signed-off-by: Ilya Dryomov commit 93d35c754d97a57bda2a2c6c39dce9b67a9f3c99 Author: Chengguang Xu Date: Fri Jun 22 15:01:13 2018 +0800 ceph: restore ctime as well in the case of restoring old mode It's better to restore ctime as well in the case of restoring old mode in ceph_set_acl(). Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit f017754d6919f3bd9786710b07b4708293594f20 Author: Chengguang Xu Date: Wed Jun 20 15:42:55 2018 +0800 ceph: add retry logic for error -ERANGE in ceph_get_acl() When the size of acl extended attribution is larger than pre-allocated value buffer size, we will hit error '-ERANGE' and it's probabaly caused by concurrent get/set acl from different clients. In this case, current logic just sets acl to NULL so that we cannot get proper information but the operation looks successful. This patch adds retry logic for error -ERANGE and return -EIO if fail from the retry. Additionally, print real errno when failing from __ceph_getxattr(). Signed-off-by: Chengguang Xu Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 28b9188483908b2579fc4bbb2ec07e9ffdca69f7 Author: Sergey Matyukevich Date: Thu Aug 2 13:40:43 2018 +0300 qtnfmac: implement basic WoWLAN support This patch implements basic WoWLAN support in qtnfmac driver, including processing of WoWLAN features reported by firmware and implementation of cfg80211 suspend/resume/wakeup callbacks. Currently the following WoWLAN triggers are supported: disconnect, magic packet, custom pattern packet. Signed-off-by: Sergey Matyukevich Signed-off-by: Kalle Valo commit a33ce21e2afcdc29b749f74a5ec489595c417907 Author: Stanislaw Gruszka Date: Tue Jul 31 14:41:04 2018 +0200 mt76x0: load firmware from mediatek subdir Firmware blob will be located in mediatek subdirectory. Add "u" suffix to indicate this is USB device firmware. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 369bbecdbb2def6265c06512c44e1fbe6ad8e556 Author: Stanislaw Gruszka Date: Tue Jul 31 14:41:03 2018 +0200 mt76x0: disable HW before probe Disable HW before probe, otherwise after reboot we will fail to initialize MCU. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 52abb142baa0f35291ac2f12b56e56fa071b95d8 Author: Stanislaw Gruszka Date: Tue Jul 31 14:41:02 2018 +0200 mt76: Kconfig and Makefile for mt76x0 driver Add Kconfig and Makefiles for mt76x0 driver. Now the driver can be build. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 87e022de330a26ad792056ec8d2602c13481e4a2 Author: Stanislaw Gruszka Date: Tue Jul 31 14:41:01 2018 +0200 mt76: add more states Add states needed for mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 95e444098a7b9d42dee36c80b75fe4500e7cf1e5 Author: Stanislaw Gruszka Date: Tue Jul 31 14:41:00 2018 +0200 mt76x0: main file Add main file of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit b4d4d0644331f431bd9d3c28c26529c77b9dc452 Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:59 2018 +0200 mt76x0: dma and tx files Add dma and tx files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit a79e4638152f315aa24627da062b91f60665cf3b Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:58 2018 +0200 mt76x0: trace and debugfs files Add trace and debugfs files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit e87b5039511a7780f3483a7202b4e67a8493c181 Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:57 2018 +0200 mt76x0: eeprom files Add eeprom files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 134b2d0d1fcf8c228cdaa3bd959025518e5cf1c8 Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:56 2018 +0200 mt76x0: init files Add init files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 10de7a8b4ab992cf2348d97409109c9f4c7a565d Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:55 2018 +0200 mt76x0: phy files Add phy files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 55b13a04744594a7ba7f36ff95352d7d20fcff8c Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:54 2018 +0200 mt76x0: mcu files Add mcu files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit ff69c75ee5392320ab3a8dd01db46d3cd097eb46 Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:53 2018 +0200 mt76x0: usb files Add usb files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit a774434981372fc583dfdf39a4094b3f0e3c4677 Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:52 2018 +0200 mt76x0: mac files Add mac files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 7b4859026ccd47fb1fb48394123fda08d4f30bd6 Author: Stanislaw Gruszka Date: Tue Jul 31 14:40:51 2018 +0200 mt76x0: core files Core files of mt76x0 driver. mt76x0 driver adds support for Mediatek MT7610U based USB Wi-Fi dongles. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit ee676cd5017c5f71b8aac1f2d1016ba0f6e4f348 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:20 2018 +0200 mt76: add driver code for MT76x2u based devices MT76x2u is a 2x2 USB 802.11ac chipset by MediaTek. This driver currently support station mode Tested-by: Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit b40b15e1521f7764ea8c68d5a00ecc971b673d21 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:19 2018 +0200 mt76: add usb support to mt76 layer This will be used by drivers for MT76x2u based devices Tested-by: Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 037804002b8a547a757bd0dd38a842186130385d Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:18 2018 +0200 mt76: move mt76x2_debugfs in mt76-common module Move mt76x2_debugfs code in mt76-common module since it is shared between mt76x2 and mt76x2u Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 5f0d10ceee47530bf6ae860e8aee158523ec402d Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:17 2018 +0200 mt76: add mt76x2_phy_common to mt76x2-common module Move phy related code shared between mt76x2 and mt76x2u in mt76x2-common module Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 2de8c3eb7ed7a450e19b0edfa51f2acd6a81ec40 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:16 2018 +0200 mt76: add mt76x2_common to mt76x2-common module Move core related code shared between mt76x2 and mt76x2u in mt76x2-common module Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 43930193a8741a0b7ddcf64c6da1ed4630dcfc51 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:15 2018 +0200 mt76: add mt76x2_init_common to mt76x2-common module Move init related code shared between mt76x2 and mt76x2u in mt76x2-common module Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit b9c45e1c42b7d709ade99b6ae243065a832e87aa Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:14 2018 +0200 mt76: add mt76x2_mac_common to mt76x2-common module Move mac related code shared between mt76x2 and mt76x2u in mt76x2-common module Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 9367a9c7f956c02a696af111d46e155fb8f2412a Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:13 2018 +0200 mt76: add mt76x2_tx_common to mt76x2-common module Move tx related code shared between mt76x2 and mt76x2u in mt76x2-common module Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit d20ad58169629f2337e6876dfc30855c5c297cef Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:12 2018 +0200 mt76: introduce mt76x2-common module In order to remove usb dependency from pcie code, add mt76x2-common as a container of shared code between mt76x2 and mt76x2u. Add eeprom code to mt76x2-common module Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 469d48188625bbb5d1cf9bacdfeae8e8636f81d6 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:11 2018 +0200 mt76: introduce tx_queue_skb function pointer in mt76_bus_ops Add tx_queue_skb function pointer in mt76_bus_ops since mt76x2u based devices do not map mt76x2_txwi on dma buffers and it is not possible to reuse mt76_dma_tx_queue_skb() routine to enqueue tx frames to hw buffers Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit fcdd99ce7267f248980ae318af439a7ac1b111dc Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:10 2018 +0200 mt76: rename mt76_tx_queue_skb in mt76_dma_tx_queue_skb Move mt76_dma_tx_queue_skb routine in dma.c. Remove static qualifier from mt76_get_txwi definition Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit bbd89d948108217344556dc07beddca202fbd431 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:09 2018 +0200 mt76x2: add buffer len to mt76x2_mac_write_txwi signature Add frame length to mt76x2_mac_write_txwi routine signature and do not fetch it from skb since txwi data structure is added at the beginning of the skb for usb based devices and mt76x2_mac_write_txwi will be shared between pci and usb related code Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 81e850ef2625cb859d1ff8f0d81129bfb1e219fa Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:08 2018 +0200 mt76x2: add napi struct to mt76_rx_poll_complete/mt76_rx_complete signatures in order to reuse mt76_rx_complete routine supporting mt76x2u based devices add napi struct to mt76_rx_poll_complete and mt76_rx_complete routine signatures and do not fetch it according to the rx queue index Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit d3c94b40460b8786d55380abf5dbd42fc3be7dfb Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:07 2018 +0200 mt76x2: introduce mt76x2_mac_load_tx_status routine Add mt76x2_mac_load_tx_status routine since tx stats register map is shared between usb and pci based devices but usb devices do not have a tx stat irq line as pcie ones and it is necessary to load tx statistics using a workqueue Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 4681e0c79e4312c30a458ab87c8cea6b8f909b95 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:06 2018 +0200 mt76x2: move interface_modes definition in mt76x2_init Move wiphy interface_modes definition in mt76x2_init in order to reuse mt76_register_device routine supporting mt76x2u based chipsets since mt76x2u currently supports just sta mode Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 15fdb7a07bbe318320d2190e20bc87b66942114e Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:05 2018 +0200 mt76x2: introduce mt76x2_init_device routine Add mt76x2_init_device routine in order to reuse common pcie/usb mac80211 initialization code supporting mt76x2u based device Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 2edb2ae5e60a2520ce5dea19e4d967e5fdc366c5 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:04 2018 +0200 mt76x2: move utility routines in mt76x2.h In order to reuse them supporting mt76x2u based devices, move mt76x2_wait_for_mac, wait_for_wpdma and mt76x2_channel_silent in mt76x2.h Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 35ecee1f6755819f67c4360c2787cb4c27821886 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:03 2018 +0200 mt76x2: move mt76x2_fw_header and mt76x2_patch_header definitions in mcu.h move mt76x2_fw_header and mt76x2_patch_header definitions in mcu.h in order to reuse them in mt76x2u mcu related code Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 66fc44b71c59165597afd751c5b2825a4d8e1456 Author: Lorenzo Bianconi Date: Tue Jul 31 10:09:02 2018 +0200 mt76: move MT_TXD_INFO, MT_MCU_MSG and MT_RX_FCE_INFO defs in dma.h Since MT_TXD_INFO, MT_MCU_MSG and MT_RX_FCE_INFO definitions are in common between mt76x2u, mt76x2 and mt76x0u move them in dma.h in order to reuse usb code supporting mt76x2u and mt76x0u based devices Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 0bf1bd84f3657dc51acb9d30629c1967a6b91e76 Merge: d1634e1aedbc ae9d88454446 Author: Jonathan Corbet Date: Thu Aug 2 12:40:57 2018 -0600 Merge branch 'rppt' into docs-next This contains a set of early-boot memory-management docs from Mike Rapoport. It's been circulating on linux-mm for a long time; I finally picked it up even though it changes a lot of .c files under mm/ (comments only). commit ae9d88454446a314f9cda785a072a0c77a81591b Author: Mike Rapoport Date: Sat Jun 30 17:55:06 2018 +0300 docs/mm: add description of boot time memory management Both bootmem and memblock are have pretty good internal documentation coverage. With addition of some overview we get a nice description of the early memory management. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko Signed-off-by: Jonathan Corbet commit f3e40bec1ae7d3157a0fac84015696a907c3ca4c Merge: 24ebfcbdd1ba 45904e7edcd0 Author: Kalle Valo Date: Thu Aug 2 21:40:25 2018 +0300 Merge tag 'iwlwifi-next-for-kalle-2018-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next More iwlwifi patches for 4.19 * New PCI IDs for 22000 and 22560; * Some fixes and an improvement in debug dumps and recording; * Remove some old dead code; * Fix compilation when only IPv6 is not enabled; * Continued work on 22560 devices; commit f3acd8869b9badcfd91cf50a2b6242be7b9368e2 Author: Arnaldo Carvalho de Melo Date: Thu Aug 2 15:11:58 2018 -0300 perf trace: Use perf_evsel__sc_tp_{uint,ptr} for "id"/"args" handling syscalls:* events Now it looks just about the same as for the trace__sys_{enter,exit}. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-y59may7zx1eccnp4m3qm4u0b@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d32855fa35b94a066c5860c94adc3ebcac7d2c66 Author: Arnaldo Carvalho de Melo Date: Thu Aug 2 15:09:24 2018 -0300 perf trace: Setup struct syscall_tp for syscalls:sys_{enter,exit}_NAME events Mapping "__syscall_nr" to "id" and setting up "args" from the offset of "__syscall_nr" + sizeof(u64), as the payload for syscalls:* is the same as for raw_syscalls:*, just the fields have different names. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Steven Rostedt Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-ogeenrpviwcpwl3oy1l55f3m@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d63e2fc804c46e50eee825c5d3a7228e07048b47 Author: BingJing Chang Date: Wed Aug 1 17:08:36 2018 +0800 md/raid5: fix data corruption of replacements after originals dropped During raid5 replacement, the stripes can be marked with R5_NeedReplace flag. Data can be read from being-replaced devices and written to replacing spares without reading all other devices. (It's 'replace' mode. s.replacing = 1) If a being-replaced device is dropped, the replacement progress will be interrupted and resumed with pure recovery mode. However, existing stripes before being interrupted cannot read from the dropped device anymore. It prints lots of WARN_ON messages. And it results in data corruption because existing stripes write problematic data into its replacement device and update the progress. \# Erase disks (1MB + 2GB) dd if=/dev/zero of=/dev/sda bs=1MB count=2049 dd if=/dev/zero of=/dev/sdb bs=1MB count=2049 dd if=/dev/zero of=/dev/sdc bs=1MB count=2049 dd if=/dev/zero of=/dev/sdd bs=1MB count=2049 mdadm -C /dev/md0 -amd -R -l5 -n3 -x0 /dev/sd[abc] -z 2097152 \# Ensure array stores non-zero data dd if=/root/data_4GB.iso of=/dev/md0 bs=1MB \# Start replacement mdadm /dev/md0 -a /dev/sdd mdadm /dev/md0 --replace /dev/sda Then, Hot-plug out /dev/sda during recovery, and wait for recovery done. echo check > /sys/block/md0/md/sync_action cat /sys/block/md0/md/mismatch_cnt # it will be greater than 0. Soon after you hot-plug out /dev/sda, you will see many WARN_ON messages. The replacement recovery will be interrupted shortly. After the recovery finishes, it will result in data corruption. Actually, it's just an unhandled case of replacement. In commit (md/raid5: fix interaction of 'replace' and 'recovery'.), if a NeedReplace device is not UPTODATE then that is an error, the commit just simply print WARN_ON but also mark these corrupted stripes with R5_WantReplace. (it means it's ready for writes.) To fix this case, we can leverage 'sync and replace' mode mentioned in commit <9a3e1101b827> (md/raid5: detect and handle replacements during recovery.). We can add logics to detect and use 'sync and replace' mode for these stripes. Reported-by: Alex Chen Reviewed-by: Alex Wu Reviewed-by: Chung-Chiang Cheng Signed-off-by: BingJing Chang Signed-off-by: Shaohua Li commit 6706fe55af6fc2bcb069a77620ae38662bf09d1c Author: Dan Carpenter Date: Wed Jul 4 05:48:35 2018 -0400 media: dvb_ca_en50221: off by one in dvb_ca_en50221_io_do_ioctl() The > should be >= so we don't read one element beyond the end of the ca->slot_info[] array. The array is allocated in dvb_ca_en50221_init(). Signed-off-by: Dan Carpenter Acked-by: Jasmin Jessich Signed-off-by: Mauro Carvalho Chehab commit 3e039c5c0a070050172e0382f2d3f5396c759019 Author: Mike Rapoport Date: Sat Jun 30 17:55:05 2018 +0300 docs/mm: memblock: add overview documentation Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 9a0de1bfe191220cb0437865261ab2f95cbb13ef Author: Mike Rapoport Date: Sat Jun 30 17:55:04 2018 +0300 docs/mm: memblock: add kernel-doc description for memblock types Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 48a833cc74ce90ec7937b96bfcbb3e43ec34cf05 Author: Mike Rapoport Date: Sat Jun 30 17:55:03 2018 +0300 docs/mm: memblock: add kernel-doc comments for memblock_add[_node] Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 47cec4432ab06c4ba90c241b142a016f878ac6da Author: Mike Rapoport Date: Sat Jun 30 17:55:02 2018 +0300 docs/mm: memblock: update kernel-doc comments * make memblock_discard description kernel-doc compatible * add brief description for memblock_setclr_flag and describe its parameters * fixup return value descriptions Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit e1720fee27246dfb84f7c433e35367170a2d4436 Author: Mike Rapoport Date: Sat Jun 30 17:55:01 2018 +0300 mm/memblock: add a name for memblock flags enumeration Since kernel-doc does not like anonymous enums the name is required for adding documentation. While on it, I've also updated all the function declarations to use 'enum memblock_flags' instead of unsigned long. Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 58faef9328f7d66b377cb34a20331c4310cdbd5e Author: Mike Rapoport Date: Sat Jun 30 17:55:00 2018 +0300 docs/mm: bootmem: add overview documentation Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit a83c0ea79d8b5705d09a39c73224332f9170a903 Author: Mike Rapoport Date: Sat Jun 30 17:54:59 2018 +0300 docs/mm: bootmem: add kernel-doc description of 'struct bootmem_data' Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 7c757207faf4526acfa18b25c6e9fe75a7e0d922 Author: Mike Rapoport Date: Sat Jun 30 17:54:58 2018 +0300 docs/mm: bootmem: fix kernel-doc warnings Add descriptions of the return value where they were missing and fixup the syntax for present ones. Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 8108ad51fe29d06da7bc963ab32e78ae6d882d5d Author: Mike Rapoport Date: Sat Jun 30 17:54:57 2018 +0300 docs/mm: nobootmem: fixup kernel-doc comments * add kernel-doc marking to free_bootmem_late() description * add return value descriptions * mention that address parameter of free_bootmem{_node} is a physical address Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 04c450603fe4976e857099d15ba360b7cebb4e6d Author: Mike Rapoport Date: Sat Jun 30 17:54:56 2018 +0300 mm/bootmem: drop duplicated kernel-doc comments Parts of the bootmem interfaces are duplicated in nobootmem.c along with the kernel-doc comments. There is no point to keep two copies of the comments, so let's drop the bootmem.c copy. Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 320905baa1dbddd3991c287432176d536e1d5b79 Author: Sebastian Andrzej Siewior Date: Tue Jul 10 12:18:33 2018 -0400 media: usbtv: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Hans Verkuil Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Mauro Carvalho Chehab commit aa823f58f7abf42f181fbaef4fdbe76eccea1c29 Author: Arnaldo Carvalho de Melo Date: Thu Aug 2 15:03:02 2018 -0300 perf trace: Allow setting up a syscall_tp struct without a format_field To avoid having to ask libtraceevent to find a field by name when handling each tracepoint event, we setup a struct syscall_tp with a tp_field struct having an extractor function + the offset for the "id", "args" and "ret" raw_syscalls:sys_{enter,exit} tracepoints. Now that we want to do the same with syscalls:sys_{entry,exit}_NAME individual syscall tracepoints, where we have "id" as "__syscall_nr" and "args" as the actual series of per syscall parameters, we need more flexibility from the routines that set up these pre-looked up syscall tracepoint arg fields. The next cset will use it. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Steven Rostedt Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-v59q5e0jrlzkpl9a1c7t81ni@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 63f11c80e5dd4afae69ea2578addf896ddc06fee Author: Arnaldo Carvalho de Melo Date: Thu Aug 2 14:27:09 2018 -0300 perf trace: Rename some syscall_tp methods to raw_syscall Because raw_syscalls have the field for the syscall number as 'id' while the syscalls:sys_{enter,exit}_NAME have it as __syscall_nr... Since we want to support both for being able to enable just a syscalls:sys_{enter,exit}_name instead of asking for raw_syscalls:sys_{enter,exit} plus filters, make the method names for each kind of tracepoint more explicit. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Steven Rostedt Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-4rixbfzco6tsry0w9ghx3ktb@git.kernel.org Signef-off-by: Arnaldo Carvalho de Melo commit a98392bb1e169a04aad83ed28f2b7a63010104ec Author: Arnaldo Carvalho de Melo Date: Thu Aug 2 14:05:09 2018 -0300 perf trace: Use beautifiers on syscalls:sys_enter_ handlers We were using the beautifiers only when processing the raw_syscalls:sys_enter events, but we can as well use them for the syscalls:sys_enter_NAME events, as the layout is the same. Some more tweaking is needed as we're processing them straight away, i.e. there is no buffering in the sys_enter_NAME event to wait for things like vfs_getname to provide pointer contents and then flushing at sys_exit_NAME, so we need to state in the syscall_arg that this is unbuffered, just print the pointer values, beautifying just non-pointer syscall args. This just shows an alternative way of processing tracepoints, that we will end up using when creating "tracepoint" payloads that already copy pointer contents (or chunks of it, i.e. not the whole filename, but just the end of it, not all the bf for a read/write, but just the start, etc), directly in the kernel using eBPF. E.g.: # perf trace -e syscalls:*enter*sleep,*sleep sleep 1 0.303 ( ): syscalls:sys_enter_nanosleep:rqtp: 0x7ffc93d5ecc0 0.305 (1000.229 ms): sleep/8746 nanosleep(rqtp: 0x7ffc93d5ecc0) = 0 # perf trace -e syscalls:*_*sleep,*sleep sleep 1 0.288 ( ): syscalls:sys_enter_nanosleep:rqtp: 0x7ffecde87e40 0.289 ( ): sleep/8748 nanosleep(rqtp: 0x7ffecde87e40) ... 1000.479 ( ): syscalls:sys_exit_nanosleep:0x0 0.289 (1000.208 ms): sleep/8748 ... [continued]: nanosleep()) = 0 # Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Steven Rostedt Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-jehyd2zwhw00z3p7v7mg9632@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 89b1698c93a9dee043154f33d96bca9964e705f1 Merge: ffd7ce3cd9c2 e30cb13c5a09 Author: David S. Miller Date: Thu Aug 2 10:55:32 2018 -0700 Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net The BTF conflicts were simple overlapping changes. The virtio_net conflict was an overlap of a fix of statistics counter, happening alongisde a move over to a bonafide statistics structure rather than counting value on the stack. Signed-off-by: David S. Miller commit a4733b5248af10d5088ba06495e3faad9f7822b3 Author: Sebastian Andrzej Siewior Date: Tue Jul 10 12:18:31 2018 -0400 media: go7007: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Hans Verkuil Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Mauro Carvalho Chehab commit aa53bf0b03ae5e276c2714dc68e375d032bc9110 Author: Sebastian Andrzej Siewior Date: Tue Jul 10 12:18:29 2018 -0400 media: cx231xx: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Mauro Carvalho Chehab commit ffd7ce3cd9c294f1ff49ec02cdbd1bc7cb913db6 Author: Colin Ian King Date: Thu Aug 2 16:16:27 2018 +0100 be2net: fix spelling mistake "seqence" -> "sequence" Trivial fix to spelling mistake in dev_info message. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 9aba2f801eea5070f1d5588cd4052588437b9eea Author: Ganesh Goudar Date: Thu Aug 2 15:34:52 2018 +0530 net: Fix coding style in skb_push() Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 453e9dc48be466afa2adc25d072aa4c5b8774f8d Author: Stefan Agner Date: Thu Aug 2 10:42:50 2018 +0200 net: fec: check DMA addressing limitations Check DMA addressing limitations as suggested by the DMA API how-to. This does not fix a particular issue seen but is considered good style. Signed-off-by: Stefan Agner Acked-by: Fugang Duan Reviewed-by: Robin Murphy Signed-off-by: David S. Miller commit ca75e2fc7708c516e8e840eca29b326aae3819dd Author: Paul Burton Date: Thu Aug 2 09:23:30 2018 -0700 MIPS: generic: Remove input symbols from defconfig generic_defconfig explicitly disables CONFIG_INPUT_MOUSEDEV, CONFIG_INPUT_KEYBOARD & CONFIG_INPUT_MOUSE which results in warnings when merging board config fragments if any of them require these options. This is the case for the ranchu board, which means we've had the following warning when configuring for generic platform targets since commit f2d0b0d5c171 ("MIPS: ranchu: Add Ranchu as a new generic-based board"): $ make ARCH=mips 32r2el_defconfig Using ./arch/mips/configs/generic_defconfig as base Merging arch/mips/configs/generic/32r2.config Merging arch/mips/configs/generic/el.config Merging ./arch/mips/configs/generic/board-sead-3.config Merging ./arch/mips/configs/generic/board-ranchu.config Value of CONFIG_INPUT_KEYBOARD is redefined by fragment ./arch/mips/configs/generic/board-ranchu.config: Previous value: # CONFIG_INPUT_KEYBOARD is not set New value: CONFIG_INPUT_KEYBOARD=y Merging ./arch/mips/configs/generic/board-ni169445.config Merging ./arch/mips/configs/generic/board-boston.config Merging ./arch/mips/configs/generic/board-ocelot.config Merging ./arch/mips/configs/generic/board-xilfpga.config scripts/kconfig/conf --olddefconfig Kconfig # # configuration written to .config # Resolve this by removing mention of the CONFIG_INPUT_* Kconfig symbols from generic_defconfig, allowing them to take their default values & allowing board config fragments to enable them without warnings. This may be problematic if CONFIG_ARCH_MIGHT_HAVE_PC_SERIO is ever enabled for CONFIG_MIPS_GENERIC=y configurations, but for now that isn't the case so we can worry about that if & when it happens. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20109/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 770b26de1eca97142218de3b2829a790f2ff8803 Author: Wei Yongjun Date: Thu Aug 2 09:13:33 2018 +0100 rxrpc: Remove set but not used variable 'nowj' Fixes gcc '-Wunused-but-set-variable' warning: net/rxrpc/proc.c: In function 'rxrpc_call_seq_show': net/rxrpc/proc.c:66:29: warning: variable 'nowj' set but not used [-Wunused-but-set-variable] unsigned long timeout = 0, nowj; ^ Signed-off-by: Wei Yongjun Signed-off-by: David Howells Signed-off-by: David S. Miller commit a3c0f84765bb429ba0fd23de1c57b5e1591c9389 Author: Russell King Date: Mon May 14 09:40:24 2018 +0100 ARM: spectre-v1: mitigate user accesses Spectre variant 1 attacks are about this sequence of pseudo-code: index = load(user-manipulated pointer); access(base + index * stride); In order for the cache side-channel to work, the access() must me made to memory which userspace can detect whether cache lines have been loaded. On 32-bit ARM, this must be either user accessible memory, or a kernel mapping of that same user accessible memory. The problem occurs when the load() speculatively loads privileged data, and the subsequent access() is made to user accessible memory. Any load() which makes use of a user-maniplated pointer is a potential problem if the data it has loaded is used in a subsequent access. This also applies for the access() if the data loaded by that access is used by a subsequent access. Harden the get_user() accessors against Spectre attacks by forcing out of bounds addresses to a NULL pointer. This prevents get_user() being used as the load() step above. As a side effect, put_user() will also be affected even though it isn't implicated. Also harden copy_from_user() by redoing the bounds check within the arm_copy_from_user() code, and NULLing the pointer if out of bounds. Acked-by: Mark Rutland Signed-off-by: Russell King commit b1cd0a14806321721aae45f5446ed83a3647c914 Author: Russell King Date: Mon Jul 9 10:28:12 2018 +0100 ARM: spectre-v1: use get_user() for __get_user() Fixing __get_user() for spectre variant 1 is not sane: we would have to add address space bounds checking in order to validate that the location should be accessed, and then zero the address if found to be invalid. Since __get_user() is supposed to avoid the bounds check, and this is exactly what get_user() does, there's no point having two different implementations that are doing the same thing. So, when the Spectre workarounds are required, make __get_user() an alias of get_user(). Acked-by: Mark Rutland Signed-off-by: Russell King commit d09fbb327d670737ab40fd8bbb0765ae06b8b739 Author: Russell King Date: Mon Jul 9 15:22:45 2018 +0100 ARM: use __inttype() in get_user() Borrow the x86 implementation of __inttype() to use in get_user() to select an integer type suitable to temporarily hold the result value. This is necessary to avoid propagating the volatile nature of the result argument, which can cause the following warning: lib/iov_iter.c:413:5: warning: optimization may eliminate reads and/or writes to register variables [-Wvolatile-register-var] Acked-by: Mark Rutland Signed-off-by: Russell King commit 8c8484a1c18e3231648f5ba7cc5ffb7fd70b3ca4 Author: Russell King Date: Mon Jul 9 10:20:06 2018 +0100 ARM: oabi-compat: copy semops using __copy_from_user() __get_user_error() is used as a fast accessor to make copying structure members as efficient as possible. However, with software PAN and the recent Spectre variant 1, the efficiency is reduced as these are no longer fast accessors. In the case of software PAN, it has to switch the domain register around each access, and with Spectre variant 1, it would have to repeat the access_ok() check for each access. Rather than using __get_user_error() to copy each semops element member, copy each semops element in full using __copy_from_user(). Acked-by: Mark Rutland Signed-off-by: Russell King commit 42019fc50dfadb219f9e6ddf4c354f3837057d80 Author: Russell King Date: Mon Jul 9 10:13:36 2018 +0100 ARM: vfp: use __copy_from_user() when restoring VFP state __get_user_error() is used as a fast accessor to make copying structure members in the signal handling path as efficient as possible. However, with software PAN and the recent Spectre variant 1, the efficiency is reduced as these are no longer fast accessors. In the case of software PAN, it has to switch the domain register around each access, and with Spectre variant 1, it would have to repeat the access_ok() check for each access. Use __copy_from_user() rather than __get_user_err() for individual members when restoring VFP state. Acked-by: Mark Rutland Signed-off-by: Russell King commit b233f127042dba991229e3882c6217c80492f6ef Author: Ming Lei Date: Mon Jul 30 20:02:19 2018 +0800 block: really disable runtime-pm for blk-mq Runtime PM isn't ready for blk-mq yet, and commit 765e40b675a9 ("block: disable runtime-pm for blk-mq") tried to disable it. Unfortunately, it can't take effect in that way since user space still can switch it on via 'echo auto > /sys/block/sdN/device/power/control'. This patch disables runtime-pm for blk-mq really by pm_runtime_disable() and fixes all kinds of PM related kernel crash. Cc: Tomas Janousek Cc: Przemek Socha Cc: Alan Stern Cc: Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Tested-by: Patrick Steinhardt Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 6bc6c77cfc6747292d5865d124cc31333b1b8536 Author: Masami Hiramatsu Date: Thu Aug 2 16:50:48 2018 +0900 tracing/kprobes: Fix within_notrace_func() to check only notrace functions Fix within_notrace_func() to check only notrace functions and to ignore the kprobe-event which can not solve symbol addresses. within_notrace_func() returns true if the given kprobe events probe point seems to be out-of-range. But that is not the correct place to check for it, it should be done in kprobes afterwards. kprobe-events allow users to define a probe point on "currently unloaded module" so that it can trace the event during module load. In this case, the user will put a probe on a symbol which is not in kallsyms yet and it hits the within_notrace_func(). As a result, kprobe-events always refuses if user defines a probe on a "currenly unloaded module". Fixes: commit 45408c4f9250 ("tracing: kprobes: Prohibit probing on notrace function") Link: http://lkml.kernel.org/r/153319624799.29007.13604430345640129926.stgit@devbox Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 611cbc8799b672f41b6ba7afed758ad9efb959a7 Author: Srinivas Kandagatla Date: Thu Aug 2 16:03:38 2018 +0100 ASoC: core: remove support for card rebind using component framework DRM based audio components get registered inside the component framework bind callback. However component framework has a big mutex lock taken for every call to component_add, component_del and bind, unbind callbacks. This can lead to deadlock situation if we are trying to add new/remove component within a bind/unbind callbacks. Which is what was happening with bcm2837 rpi 3. Revert this change till we sort out the mutex issue. Reported-by: Guillaume Tucker Reported-by: Stefan Wahren Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 62121debfb31a8700e387bd2987779b3a98bc520 Author: Srinivas Kandagatla Date: Thu Aug 2 16:03:37 2018 +0100 ASoC: smd845: remove auto rebinding Remove auto rebinding support, as component framework can deadlock in few usecases if we are trying to add new/remove component within a bind/unbind callbacks. Card rebinding is ASoC core feature so all the previous component framework stuff in q6dsp remains removed. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 1eb576881ff884dd6d10272b96cc336d156492c2 Author: Srinivas Kandagatla Date: Thu Aug 2 16:03:36 2018 +0100 ASoC: apq8096: remove auto rebinding Remove auto rebinding support, as component framework can deadlock in few usecases if we are trying to add new/remove component within a bind/unbind callbacks. Card rebinding is ASoC core feature so all the previous component framework stuff in q6dsp remains removed. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 9be936f4b3a2ec101f54cff9cf1a6abf67263c50 Author: zhong jiang Date: Wed Aug 1 00:56:17 2018 +0800 kernel/module: Use kmemdup to replace kmalloc+memcpy we prefer to the kmemdup rather than kmalloc+memcpy. so just replace them. Signed-off-by: zhong jiang Signed-off-by: Jessica Yu commit 99972f171bba19243999310154b7442198f0ab30 Author: Gustavo A. R. Silva Date: Wed Aug 1 17:30:20 2018 -0500 aoe: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114722 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jens Axboe commit c480bcf97b186a67ea6f0f6cab70ba430bcd5613 Author: Dennis Zhou (Facebook) Date: Wed Aug 1 23:15:41 2018 -0700 block: make iolatency avg_lat exponentially decay Currently, avg_lat is calculated by accumulating the mean of every window in a long running cumulative average. As time goes on, the metric becomes less and less useful due to the accumulated history. This patch reuses the same calculation done in load averages to make the avg_lat metric more lively. Unlike load averages, the avg only advances when a window elapses (due to an io). Idle periods extend the most recent window. Bucketing is used to limit the history of avg_lat by binding it to the window size. So, the window range for 1/exp (decay rate) is [1 min, 2.5 min) when windows elapse immediately. The current sample window size is exposed in the debug info to enable calculation of the window range. Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Acked-by: Johannes Weiner Acked-by: Josef Bacik Signed-off-by: Jens Axboe commit b5cdca7361d083638dc7f422fe8e1ae77860f6a6 Author: Dirk Gouders Date: Thu Aug 2 15:47:08 2018 +0200 Kbuild: Makefile.modbuiltin: include auto.conf and tristate.conf mandatory The files auto.conf and tristate.conf are mandatory for building modules.builtin files, therefore include them as such. Usually, the top-level Makefile ensures that those files exist but we want to make sure we get noticed if they are missing for whatever reason. Signed-off-by: Dirk Gouders Signed-off-by: Masahiro Yamada commit 5a5ba10f44fa1cd081cec38389e1b47f438fe25b Author: Alexandre Belloni Date: Thu Jul 26 15:40:56 2018 +0200 rtc: remove struct rtc_task Include rtc_task members directly in rtc_timer member. Signed-off-by: Alexandre Belloni commit f7430151d8a324b36850fa0edf41e538f28ddf61 Author: Alexandre Belloni Date: Thu Jul 26 15:40:55 2018 +0200 char: rtc: remove task handling Since commit 9e7002a70e42 ("char: rtc: remove unused rtc_control() API"), it is not possible to set a callback anymore, remove its handling from the interrupt handler. Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Alexandre Belloni Acked-by: Greg Kroah-Hartman Signed-off-by: Alexandre Belloni commit b02b17f55b2e789b9747cf4dd2eaaa110439a4cc Author: Frieder Schrempf Date: Thu Aug 2 14:53:54 2018 +0200 mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name By calling spi_mem_get_name(), the driver of the (Q)SPI controller can set a custom name for the memory device if necessary. This is useful to keep mtdparts compatible when controller drivers are ported from the MTD to the SPI layer. Suggested-by: Boris Brezillon Signed-off-by: Frieder Schrempf Acked-by: Boris Brezillon Signed-off-by: Mark Brown commit 5d27a9c8ea9e967d00b92a76d4bb242bf7692f2b Author: Frieder Schrempf Date: Thu Aug 2 14:53:53 2018 +0200 spi: spi-mem: Extend the SPI mem interface to set a custom memory name When porting (Q)SPI controller drivers from the MTD layer to the SPI layer, the naming scheme for the memory devices changes. To be able to keep compatibility with the old drivers naming scheme, a name field is added to struct spi_mem and a hook is added to let controller drivers set a custom name for the memory device. Example for the FSL QSPI driver: Name with the old driver: 21e0000.qspi, or with multiple devices: 21e0000.qspi-0, 21e0000.qspi-1, ... Name with the new driver without spi_mem_get_name: spi4.0 Suggested-by: Boris Brezillon Signed-off-by: Frieder Schrempf Reviewed-by: Boris Brezillon Signed-off-by: Mark Brown commit 06bcb5168d7d49aa3ed449ff13a6d13c30afc3f0 Author: Frieder Schrempf Date: Thu Aug 2 14:53:52 2018 +0200 spi: spi-mem: Fix a typo in the documentation of struct spi_mem Fix a typo in the @drvpriv description. Signed-off-by: Frieder Schrempf Acked-by: Boris Brezillon Signed-off-by: Mark Brown commit 81ceed41d0c2b2c9300de7bc30c1451680257f52 Author: Johannes Thumshirn Date: Mon Jul 16 09:25:10 2018 +0200 watchdog: add driver for the MEN 16z069 IP-Core Add a driver for the MEN 16z069 Watchdog and Reset Controller IP-Core. Signed-off-by: Johannes Thumshirn Reviewed-by: Michael Moese Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 28e65edd73f963e7a0838bf3a62106be55dcb925 Author: Wei Yongjun Date: Wed Jul 11 13:17:55 2018 +0000 watchdog: sprd_wdt: Remove redundant dev_err call in sprd_wdt_probe() There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 2671a3a31b7d6a933af240e574d0e6cfd2d13364 Author: Fabio Estevam Date: Tue Jul 10 11:21:23 2018 -0300 watchdog: stmp3xxx: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit cd6100fcebaf9ef5fc0f0f1c9f2afada35a71a91 Author: Fabio Estevam Date: Tue Jul 10 11:21:22 2018 -0300 watchdog: imx2_wdt: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit fa5072ed8f530df5a04511721d19b61a6cf8c96c Author: Ray Jui Date: Mon May 28 11:01:35 2018 -0700 watchdog: sp805: set WDOG_HW_RUNNING when appropriate If the watchdog hardware is already enabled during the boot process, when the Linux watchdog driver loads, it should reset the watchdog and tell the watchdog framework. As a result, ping can be generated from the watchdog framework, until the userspace watchdog daemon takes over control Signed-off-by: Ray Jui Reviewed-by: Vladimir Olovyannikov Reviewed-by: Scott Branden Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b800885888406f33edfec0eb1cb752292f23de83 Author: Ray Jui Date: Mon May 28 11:01:34 2018 -0700 watchdog: sp805: add 'timeout-sec' DT property support Add support for optional devicetree property 'timeout-sec'. 'timeout-sec' is used in the driver if specified in devicetree. Otherwise, fall back to driver default, i.e., 60 seconds Signed-off-by: Ray Jui Reviewed-by: Scott Branden Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 42bf5c4442badc524a92d66b0d881ea82396dfab Author: Ray Jui Date: Mon May 28 11:01:33 2018 -0700 dt-bindings: watchdog: Add optional 'timeout-sec' property for sp805 Update the SP805 binding document to add optional 'timeout-sec' devicetree property Signed-off-by: Ray Jui Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit fb18d30f86245e17d3b450abd6c7b73423781091 Author: Ray Jui Date: Mon May 28 11:01:32 2018 -0700 dt-bindings: watchdog: Consolidate SP805 binding docs Consolidate two SP805 binding documents "arm,sp805.txt" and "sp805-wdt.txt" into "arm,sp805.txt" that matches the naming of the desired compatible string to be used Signed-off-by: Ray Jui Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 2421cfd55a80af3272c261a28864cc5c3c67155c Author: Maxim Kochetkov Date: Thu Jun 7 16:54:37 2018 +0300 watchdog: orion_wdt: Mark watchdog as active when running at probe If the watchdog is fully enabled and running at probe, mark it as such so the watchdog core can handle it until the watchdog device is opened. Signed-off-by: Maxim Kochetkov Reviewed-by: Guenter Roeck [groeck: Updated subject and description] Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit c2cf466cca87e2072bd6616f751f4c385c2ab71e Author: Ludovic Barre Date: Mon Jun 25 17:43:00 2018 +0200 watchdog: stm32: add pclk feature for stm32mp1 This patch adds compatible data to manage pclk clock by compatible. Adds stm32mp1 support which requires pclk clock. Signed-off-by: Ludovic Barre Acked-by: Alexandre TORGUE Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e454652eb21535055337ae8908e164daed355ee7 Author: Ludovic Barre Date: Mon Jun 25 17:42:59 2018 +0200 dt-bindings: watchdog: add stm32mp1 support This patch adds support of stm32mp1. stm32mp1 requires 2 clocks lsi and pclk. Signed-off-by: Ludovic Barre Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Linux@roeck-us.net> Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 9b255782b58d8dfb683018761925bca597f80895 Author: Masaharu Hayakawa Date: Fri Jul 6 10:55:08 2018 +0200 dt-bindings: watchdog: renesas-wdt: Add support for the R8A77990 wdt Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car E3 (R8A77990) SoC. No driver update is needed. Signed-off-by: Masaharu Hayakawa Signed-off-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Acked-by: Rob Herring Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6a648b534d3d4f6532241fd9b97c0dab7b0c3f89 Author: Arnaldo Carvalho de Melo Date: Thu Aug 2 10:30:08 2018 -0300 perf trace: Associate vfs_getname()'ed pathname with fd returned from 'openat' When the vfs_getname() wannabe tracepoint is in place: # perf probe -l probe:vfs_getname (on getname_flags:73@acme/git/linux/fs/namei.c with pathname) # 'perf trace' will use it to get the pathname when it is copied from userspace to the kernel, right after syscalls:sys_enter_open, copied in the 'probe:vfs_getname', stash it somewhere and then, at syscalls:sys_exit_open time, if the 'open' return is not -1, i.e. a successfull open syscall, associate that pathname to this return, i.e. the fd. We were not doing this for the 'openat' syscall, which would cause 'perf trace' to fallback to using /proc to get the fd, change it so that we use what we got from probe:vfs_getname, reducing the 'openat' beautification process cost, ditching the syscalls performed to read procfs state and avoiding some possible races in the process. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-xnp44ao3bkb6ejeczxfnjwsh@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b80a2bfce85e1051056d98d04ecb2d0b55cbbc1c Author: Peter Zijlstra Date: Mon Jul 30 13:21:40 2018 +0200 stop_machine: Reflow cpu_stop_queue_two_works() The code flow in cpu_stop_queue_two_works() is a little arcane; fix this by lifting the preempt_disable() to the top to create more natural nesting wrt the spinlocks and make the wake_up_q() and preempt_enable() unconditional at the end. Furthermore, enable preemption in the -EDEADLK case, such that we spin-wait with preemption enabled. Suggested-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: isaacm@codeaurora.org Cc: matt@codeblueprint.co.uk Cc: psodagud@codeaurora.org Cc: gregkh@linuxfoundation.org Cc: pkondeti@codeaurora.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180730112140.GH2494@hirez.programming.kicks-ass.net commit fbfa9260085b5b578a049a90135e5c51928c5f7f Author: Sudeep Holla Date: Wed Jul 11 12:24:24 2018 +0100 clockevents: Warn if cpu_all_mask is used as cpumask Using cpu_all_mask in clockevents cpumask may result in issues while comparing multiple clockevent devices to choose the preferred one. On one of the platforms with 2 system (i.e. non per-CPU) timers with different ratings, having cpu_all_mask for one of the device resulted in a boot hang due to a endless loop in clockevents_notify_released() as both were clocksources were selected as preferred. In order to prevent such issues in the future, warn if any clockevent driver sets cpu_all_mask as it's cpumask and just override it to use cpu_possible_mask. All the existing occurrences of cpu_all_mask are already replaced with cpu_possible_mask. Signed-off-by: Sudeep Holla Signed-off-by: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Link: https://lkml.kernel.org/r/1531308264-24220-3-git-send-email-sudeep.holla@arm.com commit 234b3840d73430564a03f53973a311b7a83a95a9 Author: Sudeep Holla Date: Wed Jul 11 12:24:23 2018 +0100 tick/broadcast-hrtimer: Use cpu_possible_mask for ce_broadcast_hrtimer This is the last instance of cpu_all_mask usage in the core framework. Replace it with cpu_possible_mask like all other instances in the clockevent drivers. This makes it possible to add a warning in the core clockevents_register_device on usage of cpu_all_mask from any clockevent drivers in the future. Signed-off-by: Sudeep Holla Signed-off-by: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Link: https://lkml.kernel.org/r/1531308264-24220-2-git-send-email-sudeep.holla@arm.com commit 6777996d27dd4f0a569ed9593e78db68c6b659cd Author: Thomas Gleixner Date: Thu Aug 2 14:53:10 2018 +0200 clocksource/drivers/arm_arch_timer: Fix bogus cpu_all_mask usage Using cpu_all_mask as target mask for clockevents is wrong as it never can actually target not possible CPUs. Use cpu_possible_mask instead Signed-off-by: Thomas Gleixner Cc: Sudeep Holla Cc: Daniel Lezcano commit 988b3ae3e0e9374b6be3b4e58524cfa6f224d8d5 Author: Todor Tomov Date: Wed Jul 25 12:38:43 2018 -0400 media: camss: csid: Add support for events triggered by user controls Changing a user control value can trigger an event to other users. Add support for that. Signed-off-by: Todor Tomov Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e1cf4b2f1724bbbb7174d9d8d477e9320ee4a82e Author: Todor Tomov Date: Wed Jul 25 12:38:42 2018 -0400 media: doc: media/v4l-drivers: Update Qualcomm CAMSS driver document for 8x96 Update the document to describe the support of Camera Subsystem on MSM8996/APQ8096. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cc8fe07398e390d2047c30849f3055d5074ee833 Author: Todor Tomov Date: Wed Jul 25 12:38:41 2018 -0400 media: camss: Add support for 10-bit grayscale formats Add support for 10-bit packed V4L2_PIX_FMT_Y10P (on 8x16 and 8x96) and unpacked V4L2_PIX_FMT_Y10 (on 8x96 only) pixel formats. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0b2c1aec49ddb2260894df6c69ae7b34142ff936 Author: Zhong Jiang Date: Sat Jul 21 16:33:24 2018 +0800 x86/iommu: Use NULL instead of 0 Fixes the following sparse warning: arch/x86/kernel/pci-iommu_table.c:63:37: warning: Using plain integer as NULL pointer Signed-off-by: zhong jiang Signed-off-by: Thomas Gleixner Cc: Cc: Link: https://lkml.kernel.org/r/1532162004-24670-1-git-send-email-zhongjiang@huawei.com commit 216a37202f10b7d78f2f98e26a6681f367165f05 Author: Uros Bizjak Date: Fri Jun 29 16:28:44 2018 +0200 x86/boot: Use CC_SET()/CC_OUT() instead of open coding it Remove open-coded uses of set instructions with CC_SET()/CC_OUT(). Signed-off-by: Uros Bizjak Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180629142844.15200-1-ubizjak@gmail.com commit 765d28f136291f9639e3c031a1070fb76d6625c7 Author: Chengguang Xu Date: Tue Jun 12 19:48:52 2018 +0800 x86/mm: Remove redundant check for kmem_cache_create() The flag 'SLAB_PANIC' implies panic on failure, So there is no need to check the returned pointer for NULL. Signed-off-by: Chengguang Xu Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/1528804132-154948-1-git-send-email-cgxu519@gmx.com commit d79d024820f2e522ab30b5e6662c245f887c752b Author: Colin Ian King Date: Tue Jul 31 10:09:38 2018 +0100 x86/platform/UV: Remove redundant check of p == q The check for p == q is dead code because the proceeding switch statements jump to the end of the outer for-loop with continue statements. Remove the dead code. Detected by CoverityScan, CID#145071 ("Structurally dead code") Signed-off-by: Colin Ian King Signed-off-by: Thomas Gleixner Cc: "H . Peter Anvin" Cc: kernel-janitors@vger.kernel.org Link: https://lkml.kernel.org/r/20180731090938.11856-1-colin.king@canonical.com commit c7ba9f7cb55926605983187a68624999b93abb94 Author: zhong jiang Date: Wed Aug 1 00:08:06 2018 +0800 x86/platform/olpc: Use PTR_ERR_OR_ZERO() Replace the open coded equivalent with PTR_ERR_OR_ZERO(). Signed-off-by: zhong jiang Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/1533053286-34990-1-git-send-email-zhongjiang@huawei.com commit 8e82a728792bf66b9f0a29c9d4c4b0630f7b9c79 Author: Hans de Goede Date: Thu Aug 2 14:04:45 2018 +0200 ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry I added the subsys product-id for the HDMI HDA device rather then for the PCH one, this commit fixes this. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104 Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede Signed-off-by: Takashi Iwai commit 85eae57bbb0612387201635659be543aaac2109e Merge: 3a1174cd3edb 237584619366 Author: Paolo Bonzini Date: Thu Aug 2 13:57:29 2018 +0200 Merge tag 'kvm-s390-next-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Features for 4.19 - initial version for host large page support. Must be enabled with module parameter hpage=1 and will conflict with the nested=1 parameter. - enable etoken facility for guests - Fixes commit 3a1174cd3edbd6d822388ee1806669a9328872ce Merge: 6f0d349d922b b5c6f7607b90 Author: Paolo Bonzini Date: Thu Aug 2 13:57:26 2018 +0200 Merge tag 'kvm-ppc-next-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD PPC KVM update for 4.19. This update adds no new features; it just has some minor code cleanups and bug fixes, including a fix to allow us to create KVM_MAX_VCPUS vCPUs on POWER9 in all CPU threading modes. commit 6fa1d28e38cfa0c90f8d64c0cab37769e5337b85 Author: Christoph Hellwig Date: Fri May 11 08:36:53 2018 +0200 sh: use generic dma_noncoherent_ops Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig Acked-by: Yoshinori Sato commit 46bcde94cd02283535cb719666399f1c4cfb8f22 Author: Christoph Hellwig Date: Wed Jul 18 06:55:20 2018 -0700 sh: split arch/sh/mm/consistent.c Half of the file just contains platform device memory setup code which is required for all builds, and half contains helpers for dma coherent allocation, which is only needed if CONFIG_DMA_NONCOHERENT is enabled. Signed-off-by: Christoph Hellwig Acked-by: Yoshinori Sato commit a602915f5d0d9eff96a1d85b6f81e4921b52edfe Author: Christoph Hellwig Date: Tue Apr 17 22:02:10 2018 +0200 sh: use dma_direct_ops for the CONFIG_DMA_COHERENT case This is a slight change in behavior as we avoid the detour through the virtual mapping for the coherent allocator, but if this CPU really is coherent that should be the right thing to do. Signed-off-by: Christoph Hellwig Acked-by: Yoshinori Sato commit 47fcae0d2a5fc77123fc14b0db9fe0025a1a829a Author: Christoph Hellwig Date: Wed Apr 18 08:53:46 2018 +0200 sh: introduce a sh_cacheop_vaddr helper And use it in the maple bus code to avoid a dma API dependency. Signed-off-by: Christoph Hellwig Acked-by: Yoshinori Sato commit b2fcb677d4dd2aac3202365719733452b5512719 Author: Christoph Hellwig Date: Mon Apr 16 17:26:38 2018 +0200 sh: simplify get_arch_dma_ops Remove the indirection through the dma_ops variable, and just return nommu_dma_ops directly from get_arch_dma_ops. Signed-off-by: Christoph Hellwig Acked-by: Yoshinori Sato commit 3ff4f80a74fd38398ae1bd8a458ba9c51aa0dd44 Author: Zhong Jiang Date: Wed Aug 1 00:24:58 2018 +0800 debugobjects: Remove redundant NULL pointer check kmem_cache_destroy() has a built in NULL pointer check, so the one at the call can be removed. Signed-off-by: Zhong Jiang Signed-off-by: Thomas Gleixner Cc: Cc: Cc: Link: https://lkml.kernel.org/r/1533054298-35824-1-git-send-email-zhongjiang@huawei.com commit c77aee71bbc67c4b0e56f4ce10406b85d4c929c1 Author: Keerthy Date: Thu Aug 2 12:05:16 2018 +0530 clocksource: ti-32k: Remove CLOCK_SOURCE_SUSPEND_NONSTOP flag Since commit 39232ed5a179 ("time: Introduce one suspend clocksource to compensate the suspend time") suspend/resume fails on AM437x platforms as the clocksource actually stops in suspend. Hence remove the CLOCK_SOURCE_SUSPEND_NONSTOP flag. Suggested-by: Grygorii Strashko Signed-off-by: Keerthy Signed-off-by: Thomas Gleixner Cc: Cc: Cc: Cc: Cc: Cc: Link: https://lkml.kernel.org/r/1533191716-20476-1-git-send-email-j-keerthy@ti.com commit 50fa92594a2bc76265f4bb357f9a25dd3bdb2c0a Author: Anton Vasilyev Date: Wed Aug 1 14:26:51 2018 +0300 HID: intel_ish-hid: tx_buf memory leak on probe/remove ish_dev_init() allocates 512*176 bytes memory for tx_buf and stores it at &dev->wr_free_list_head.link list on ish_probe(). But there is no deallocation of this memory in ish_remove() and in ish_probe() error path. So current intel-ish-ipc provides 88 KB memory leak for each probe/release. The patch replaces kzalloc allocation by devm_kzalloc and removes ishtp_device *dev deallocation by kfree. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina commit a1e9a9c0dfe47a3f13734be489b7953a2f8bdd83 Author: Srinivas Pandruvada Date: Wed Jul 18 12:32:00 2018 -0700 HID: intel-ish-hid: Prevent loading of driver on Mehlow On Mehlow Xeon-E workstation, ISH PCI device is enabled but without ISH firmware. Here the ISH device PCI device id was reused for some non Linux storage drivers. So this was not done for enabling ISH. But this has a undesirable side effect for Linux. Here the ISH driver will be loaded via PCI enumeration and will try to do reset sequence. But reset sequence will wait till timeout as there is no real ISH firmware is present to take action. This delay will add to boot time of Linux (This platform will still continue to boot after this timeout). To avoid this boot delay we need to prevent loading of ISH drivers on this platform. So we need to have hack to avoid treating this device as ISH on this platform. To identify this workstation, we need some runtime method. Luckily there are special PCI id on this workstation to distinguish from the client version of this platform. On client version, the ISH is supported using same PCI device id. So this change look for the presence of PCI device IDs A309 and A30A and exit. Signed-off-by: Srinivas Pandruvada Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 363e934d8811d799c88faffc5bfca782fd728334 Author: Gaurav Kohli Date: Thu Aug 2 14:21:03 2018 +0530 timers: Clear timer_base::must_forward_clk with timer_base::lock held timer_base::must_forward_clock is indicating that the base clock might be stale due to a long idle sleep. The forwarding of the base clock takes place in the timer softirq or when a timer is enqueued to a base which is idle. If the enqueue of timer to an idle base happens from a remote CPU, then the following race can happen: CPU0 CPU1 run_timer_softirq mod_timer base = lock_timer_base(timer); base->must_forward_clk = false if (base->must_forward_clk) forward(base); -> skipped enqueue_timer(base, timer, idx); -> idx is calculated high due to stale base unlock_timer_base(timer); base = lock_timer_base(timer); forward(base); The root cause is that timer_base::must_forward_clk is cleared outside the timer_base::lock held region, so the remote queuing CPU observes it as cleared, but the base clock is still stale. This can cause large granularity values for timers, i.e. the accuracy of the expiry time suffers. Prevent this by clearing the flag with timer_base::lock held, so that the forwarding takes place before the cleared flag is observable by a remote CPU. Signed-off-by: Gaurav Kohli Signed-off-by: Thomas Gleixner Cc: john.stultz@linaro.org Cc: sboyd@kernel.org Cc: linux-arm-msm@vger.kernel.org Link: https://lkml.kernel.org/r/1533199863-22748-1-git-send-email-gkohli@codeaurora.org commit f476fb568f98bb6b2d2499ee7059504bf5203a91 Author: Todor Tomov Date: Wed Jul 25 12:38:40 2018 -0400 media: camss: Add support for RAW MIPI14 on 8x96 Add support for RAW MIPI14 format for RDI mode on 8x96. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5019d7c8209c539226f9e64c38eece7fce732e18 Author: Todor Tomov Date: Wed Jul 25 12:38:39 2018 -0400 media: camss: csid: MIPI10 to Plain16 format conversion Use the PRDI mode on 8x96 to allow to configure RAW MIPI10 to Plain16 format conversion. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7e37f47f3ae7b73648768d652b669ea23161db5a Author: Todor Tomov Date: Wed Jul 25 12:38:38 2018 -0400 media: camss: csid: Different format support on source pad Usually the format on the source pad is the same as on the sink pad. However the CSID is able to do some format conversions. To support this make the format on the source pad selectable amongst a list of formats. This list can be different for each sink pad format. This is still not used but will be when the format conversions are implemented. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 312e1c858a0f05e27812cd7de87114801fced508 Author: Todor Tomov Date: Wed Jul 25 12:38:37 2018 -0400 media: camss: vfe: Add support for UYVY output from VFE on 8x96 Add support to output UYVY formats from the VFE (via the PIX interface). A configuration for the realign module in the VFE is added. As the realign module is present on 8x96 but not on 8x16, this is supported on 8x96 only. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 07eeb342a1385bbe07d6cb846af05e0add0bbbc2 Author: Todor Tomov Date: Wed Jul 25 12:38:36 2018 -0400 media: camss: vfe: Different format support on source pad Rework the format selection on the source pad. Make the format on the source pad selectable amongst a list of formats. This list can be different for each sink pad format. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cba3819d1e93fb77a9323554ccf7b564276c089b Author: Todor Tomov Date: Wed Jul 25 12:38:35 2018 -0400 media: camss: Format configuration per hardware version As the 8x16 and 8x96 support different formats, separate the arrays which contain the supported formats. For the VFE also add separate arrays for RDI and PIX subdevices. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4e1abf66feba454b1dc3d4c7d86759346ec1f134 Author: Todor Tomov Date: Wed Jul 25 12:38:34 2018 -0400 media: camss: vfe: Add support for 8x96 Add VFE hardware dependent part for 8x96. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 051a01ac9cf141f0d555488fd0c060949bd4e8b6 Author: Todor Tomov Date: Wed Jul 25 12:38:33 2018 -0400 media: camss: vfe: Split to hardware dependent and independent parts This will allow to add support for different hardware. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e08c7f8696200a22b7f5a05f139231ad202efdc7 Author: Todor Tomov Date: Wed Jul 25 12:38:32 2018 -0400 media: camss: ispif: Add support for 8x96 ISPIF hardware modules on 8x16 and 8x96 are similar. However on 8x96 the ISPIF routes data to two VFE hardware modules. Add separate interrupt handler for 8x96 to handle the additional interrupts. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2a05493b5d549ee9a1ecea8772bcc7d9ec7f3d69 Author: Todor Tomov Date: Wed Jul 25 12:38:31 2018 -0400 media: camss: csid: Add support for 8x96 CSID hardware modules on 8x16 and 8x96 are similar. There is no need to duplicate the code by adding separate versions. Just update the register macros to return the correct register addresses. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4138a88b6093e1f8bf1b8a95c653bec6c854f119 Author: Todor Tomov Date: Wed Jul 25 12:38:30 2018 -0400 media: camss: csiphy: Add support for 8x96 Add CSIPHY hardware dependent part for 8x96. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 369f81f350b5c03599d8f82e31f9a916d7bfe80a Author: Todor Tomov Date: Wed Jul 25 12:38:29 2018 -0400 media: camss: csiphy: Unify lane handling Restructure lane configuration so it is simpler and will allow similar (although not the same) handling for different hardware versions. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 516e8f0f8912b3779e4259c824953a23c4108fe8 Author: Todor Tomov Date: Wed Jul 25 12:38:28 2018 -0400 media: camss: csiphy: Split to hardware dependent and independent parts This will allow to add support for different hardware. Signed-off-by: Todor Tomov [hans.verkuil@cisco.com: remove trailing empty line] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 02afa816dbbf0bc648d22a8472f17236df886af5 Author: Todor Tomov Date: Wed Jul 25 12:38:27 2018 -0400 media: camss: Add basic runtime PM support There is a PM domain for each of the VFE hardware modules. Add support for basic runtime PM support to be able to control the PM domains. When a PM domain needs to be powered on - a device link is created. When a PM domain needs to be powered off - its device link is removed. This allows separate and independent control of the PM domains. Suspend/Resume is still not supported. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9c3e59de6041f84294fbead39c85b5541ac7b361 Author: Todor Tomov Date: Wed Jul 25 12:38:26 2018 -0400 media: camss: Add 8x96 resources Add structs with 8x96 resources. As the number of CSIPHY, CSID and VFE hardware modules is different on 8x16 and 8x96 select the number at runtime and allocate needed structures dynamically. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 21a3f6e531cc5e0fecd26f8e3f0835750426b7ad Author: Todor Tomov Date: Wed Jul 25 12:38:25 2018 -0400 media: dt-bindings: media: qcom,camss: Add 8996 bindings Update binding document for MSM8996. CC: Rob Herring CC: Mark Rutland CC: devicetree@vger.kernel.org Signed-off-by: Todor Tomov Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dc273f67b274499093e3da236e9749e4c33e78b6 Author: Todor Tomov Date: Wed Jul 25 12:38:24 2018 -0400 media: dt-bindings: media: qcom,camss: Fix whitespaces Use tabs. CC: Rob Herring CC: Mark Rutland CC: devicetree@vger.kernel.org Signed-off-by: Todor Tomov Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 06d690f092db28a7c83c9524010c42136e2bb37f Author: Todor Tomov Date: Wed Jul 25 12:38:23 2018 -0400 media: camss: vfe: Do not disable CAMIF when clearing its status Use "no change" value when clearing CAMIF status and make sure this is done before configuring the new command. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a93e5f4fc8dfecd15df51ae176a77ce5b0db82b1 Author: Todor Tomov Date: Wed Jul 25 12:38:22 2018 -0400 media: camss: vfe: Get line pointer as container of video_out Simplify getting of the line pointer by using the container_of macro instead of traversing media controller links. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 156c3df8d4db4e693c062978186f44079413d74d Author: Chao Yu Date: Thu Aug 2 17:39:17 2018 +0800 staging: erofs: disable compiling temporarile As Stephen Rothwell reported: "After merging the staging tree, today's linux-next build (x86_64 allmodconfig) failed like this: drivers/staging/erofs/super.c: In function 'erofs_read_super': drivers/staging/erofs/super.c:343:17: error: 'MS_RDONLY' undeclared (first use in this function); did you mean 'IS_RDONLY'? sb->s_flags |= MS_RDONLY | MS_NOATIME; ^~~~~~~~~ IS_RDONLY drivers/staging/erofs/super.c:343:17: note: each undeclared identifier is reported only once for each function it appears in drivers/staging/erofs/super.c:343:29: error: 'MS_NOATIME' undeclared (first use in this function); did you mean 'S_NOATIME'? sb->s_flags |= MS_RDONLY | MS_NOATIME; ^~~~~~~~~~ S_NOATIME drivers/staging/erofs/super.c: In function 'erofs_mount': drivers/staging/erofs/super.c:501:10: warning: passing argument 5 of 'mount_bdev' makes integer from pointer without a cast [-Wint-conversion] &priv, erofs_fill_super); ^~~~~~~~~~~~~~~~ In file included from include/linux/buffer_head.h:12:0, from drivers/staging/erofs/super.c:14: include/linux/fs.h:2151:23: note: expected 'size_t {aka long unsigned int}' but argument is of type 'int (*)(struct super_block *, void *, int)' extern struct dentry *mount_bdev(struct file_system_type *fs_type, ^~~~~~~~~~ drivers/staging/erofs/super.c:500:9: error: too few arguments to function 'mount_bdev' return mount_bdev(fs_type, flags, dev_name, ^~~~~~~~~~ In file included from include/linux/buffer_head.h:12:0, from drivers/staging/erofs/super.c:14: include/linux/fs.h:2151:23: note: declared here extern struct dentry *mount_bdev(struct file_system_type *fs_type, ^~~~~~~~~~ drivers/staging/erofs/super.c: At top level: drivers/staging/erofs/super.c:518:20: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] .mount = erofs_mount, ^~~~~~~~~~~ drivers/staging/erofs/super.c:518:20: note: (near initialization for 'erofs_fs_type.mount') drivers/staging/erofs/super.c: In function 'erofs_remount': drivers/staging/erofs/super.c:630:12: error: 'MS_RDONLY' undeclared (first use in this function); did you mean 'IS_RDONLY'? *flags |= MS_RDONLY; ^~~~~~~~~ IS_RDONLY drivers/staging/erofs/super.c: At top level: drivers/staging/erofs/super.c:640:16: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] .remount_fs = erofs_remount, ^~~~~~~~~~~~~ Caused by various commits creating erofs in the staging tree interacting with various commits redoing the mount infrastructure in the vfs tree. I have disabed CONFIG_EROFS_FS for now:" The reason of compiling error is: Since -next collects and merges developing patches including common vfs stuff from multi-trees, but those patches didn't cover erofs, such as: ('vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled") https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=for-next&id=109b45090d7d3ce2797bb1ef7f70eead5bfe0ff3 ("vfs: Require specification of size of mount data for internal mounts") https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=for-next&id=0a191e4505a4f255e6513b49426213da69bf0e80 Above vfs related patches has not been merged in staging tree, if we submit those erofs patches to staging mailing list and after including them in staging-{test,nexts} tree, it can easily cause compiling error. We worked out some patches to adjust those vfs change, but now we just submit them to -next tree temporarily to avoid compiling error. For potentail conflict in between erofs and vfs changes in incoming merge window, Stephen suggested that we can disable CONFIG_EROFS_FS temporarily to pass merge window, and after that we can do restore by reenabling CONFIG_EROFS_FS and applying those fixing patches. Also Greg confirmed this solution. So, let's disable compiling erofs for a while. Suggested-by: Stephen Rothwell Signed-off-by: Gao Xiang Reviewed-by: Gao Xiang Signed-off-by: Chao Yu Signed-off-by: Greg Kroah-Hartman commit c9896b655177892cfaed2c0910fd55f44772ecad Author: Todor Tomov Date: Wed Jul 25 12:38:21 2018 -0400 media: camss: vfe: Fix to_vfe() macro member name Use the member name which is "line" instead of the pointer argument. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c628e78899ff8006b5f9d8206da54ed3bb994342 Author: Todor Tomov Date: Wed Jul 25 12:38:20 2018 -0400 media: camss: csid: Configure data type and decode format properly The CSID decodes the input data stream. When the input comes from the Test Generator the format of the stream is set on the source media pad. When the input comes from the CSIPHY the format is the one on the sink media pad. Use the proper format for each case. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7066647cdb4d3ea24fe6f34a9fc9812711eacba6 Author: Todor Tomov Date: Wed Jul 25 12:38:19 2018 -0400 media: camss: csiphy: Update settle count calculation Update settle count calculation as per specification. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 09a94865d4691726656909236b5d60b4e9dcc798 Author: Todor Tomov Date: Wed Jul 25 12:38:18 2018 -0400 media: camss: Unify the clock names Use more logical clock names - similar to the names in documentation. This will allow better handling of the clocks in the driver when support for more hardware versions is added - equivalent clocks on different hardware versions will have the same name. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d9707ae2721da2867a81255cdfae812c5bb07d2a Author: Todor Tomov Date: Tue Jul 31 02:19:43 2018 -0400 media: dt-bindings: media: qcom, camss: Unify the clock names Use more logical clock names - similar to the names in documentation. This will allow better handling of the clocks in the driver when support for more hardware versions is added - equivalent clocks on different hardware versions will have the same name. Note: No dts is using this device (and clock names) yet. CC: Rob Herring CC: Mark Rutland CC: devicetree@vger.kernel.org Signed-off-by: Todor Tomov Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5ba913b3fca8579d43c24d220d2f579cf3e992af Author: Todor Tomov Date: Wed Jul 25 12:38:16 2018 -0400 media: camss: csiphy: Ensure clock mux config is done before the rest Add a write memory barier after clock mux config and before the rest of the csiphy config. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2004fc09b34128182ed26ec7b8f28190e5189061 Author: Todor Tomov Date: Wed Jul 25 12:38:15 2018 -0400 media: camss: Fix OF node usage of_graph_get_next_endpoint increases the refcount of the returned node and decreases the refcount of the passed node. Take this into account and use of_node_put properly. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2d87e6c1b99c402360fdfe19ce4f579ab2f96adf Author: Philipp Zabel Date: Thu Jun 21 21:13:38 2018 +0200 gpu: ipu-v3: default to id 0 on missing OF alias This is better than storing -ENODEV in the id number. This fixes SoCs with only one IPU that don't specify an IPU alias in the device tree. Signed-off-by: Philipp Zabel commit b873663bd85fff5e43bcedb5cc5360f2aa992e05 Author: Todor Tomov Date: Wed Jul 25 12:38:14 2018 -0400 media: camss: Use SPDX license headers Use SPDX license headers for all files of the Qualcomm CAMSS driver. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ec6859b23f2212275fbd476df14d7a94839c2a35 Author: Todor Tomov Date: Wed Jul 25 12:38:13 2018 -0400 media: Rename CAMSS driver path Support for camera subsystem on QComm MSM8996/APQ8096 is to be added so remove hardware version from CAMSS driver's path. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 07ebbbe458790d3c75f4a2f3634d8e04f66b389b Author: Keiji Hayashibara Date: Thu Aug 2 13:42:43 2018 +0900 spi: uniphier: remove unnecessary include headers This commit removed include headers of linux/of.h and linux/of_platform.h, because they are not used. Signed-off-by: Keiji Hayashibara Signed-off-by: Mark Brown commit 6e15bec49f366511ec024a556505316222ef4ade Author: Todor Tomov Date: Wed Jul 25 12:38:12 2018 -0400 media: v4l: Add new 10-bit packed grayscale format The new format will be called V4L2_PIX_FMT_Y10P. It is similar to the V4L2_PIX_FMT_SBGGR10P family formats but V4L2_PIX_FMT_Y10P is a grayscale format. Signed-off-by: Todor Tomov Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 451af0bf04bd313bbaddd67a8be09d10210780bd Author: Todor Tomov Date: Wed Jul 25 12:38:11 2018 -0400 media: v4l: Add new 2X8 10-bit grayscale media bus code The code will be called MEDIA_BUS_FMT_Y10_2X8_PADHI_LE. It is similar to MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE but MEDIA_BUS_FMT_Y10_2X8_PADHI_LE describes grayscale data. Signed-off-by: Todor Tomov Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 83b15832ab91c9a4651decb6dc40075dd979d443 Author: Sakari Ailus Date: Wed Jul 25 12:38:10 2018 -0400 media: doc-rst: Add packed Bayer raw14 pixel formats These formats are compressed 14-bit raw bayer formats with four different pixel orders. They are similar to 10-bit variants. The formats added by this patch are V4L2_PIX_FMT_SBGGR14P V4L2_PIX_FMT_SGBRG14P V4L2_PIX_FMT_SGRBG14P V4L2_PIX_FMT_SRGGB14P Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fdec79c18b08c68cfa079f2d3ee23c5a120a2eda Author: Kuninori Morimoto Date: Thu Aug 2 01:47:30 2018 +0000 ASoC: fsi: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 73edbe42582207ff8f47168f05124376394aa643 Author: Rohit kumar Date: Thu Aug 2 12:32:59 2018 +0530 ASoC: qcom: Fix unmet dependency warning for SND_SOC_SDM845 Add DEPENDS_ON QCOM_APR for SND_SOC_SDM845 to fix the warning: unmet direct dependencies detected for SND_SOC_QDSP6. Reported-by: Stephen Rothwell Signed-off-by: Rohit kumar Signed-off-by: Mark Brown commit 9f0ba3d92fe63fa72f88238d9dde47a38a7d8f40 Author: Steve Longerbeam Date: Wed Aug 1 12:12:17 2018 -0700 gpu: ipu-v3: Fix U/V offset macros for planar 4:2:0 The U and V offset macros for planar 4:2:0 (U_OFFSET, V_OFFSET, and UV_OFFSET), are not correct. The height component to the offset was calculated as: (pix->width * y / 4) But this does not produce correct offsets for odd values of y (luma line #). The luma line # must be decimated by two to produce the correct U/V line #, so the correct formula is: (pix->width * (y / 2) / 2) Signed-off-by: Steve Longerbeam Signed-off-by: Philipp Zabel commit 2cea1542859bc812f1ec51ea71c06e927e5b922e Author: Gustavo A. R. Silva Date: Wed Aug 1 14:56:16 2018 -0500 ASoC: wm8994: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115050 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 7a2235ef507822679ac89007a6a37b23f30eed56 Author: Gustavo A. R. Silva Date: Wed Aug 1 14:55:26 2018 -0500 ASoC: wm9081: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1357430 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit af5d1d5d4ba71164711025e077511ad48d5690e9 Author: Gustavo A. R. Silva Date: Wed Aug 1 14:54:45 2018 -0500 ASoC: wm8995: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115045 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit a9531ab151117e976544e0dc74a9bc8cbd01145f Author: Gustavo A. R. Silva Date: Wed Aug 1 14:54:03 2018 -0500 ASoC: wm8962: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115043 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 42ef3c94ff6e8315377c04504f1bce50d1f21738 Author: Gustavo A. R. Silva Date: Wed Aug 1 14:53:19 2018 -0500 ASoC: wm8996: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 146354 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit da41787b9f319a7a23fcc8cf65c6ad646803962e Author: Gustavo A. R. Silva Date: Wed Aug 1 14:52:41 2018 -0500 ASoC: wm8904: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115042 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 3eb7dbc6d844d2033271434d02ff90ac9b19e393 Author: Gustavo A. R. Silva Date: Wed Aug 1 14:51:59 2018 -0500 ASoC: wm8960: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115041 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 85e7e77079f3201799467803f6c8533a9921e32d Author: Gustavo A. R. Silva Date: Wed Aug 1 14:51:18 2018 -0500 ASoC: wm8955: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115047 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 43a26bd026dab09a8b28c40e94ba534a52375b20 Author: Gustavo A. R. Silva Date: Wed Aug 1 14:50:20 2018 -0500 ASoC: rt5677: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1271174 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 065dcc270af66acb4226b49f635b41a054b663d4 Author: Gustavo A. R. Silva Date: Wed Aug 1 14:49:13 2018 -0500 ASoC: rt5640: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1056547 ("Missing break in switch") Addresses-Coverity-ID: 1056548 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 9a73f6a235c2351adc07471519d4980e2fb33bbc Author: Gustavo A. R. Silva Date: Wed Aug 1 14:47:09 2018 -0500 ASoC: wm8961: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1271173 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 5c41bb6071257ba668a2b8933a8654e69aea1cee Author: Philipp Zabel Date: Thu Aug 2 10:40:33 2018 +0200 gpu: ipu-v3: add support for XRGB32 and XBGR32 V4L2 pixel formats These should be used instead of the ill-defined deprecated RGB32 and BGR32 V4L2 pixel formats. Signed-off-by: Philipp Zabel commit 6c1187aaa2912fad40119140286160cfd9f4ac2f Author: Russell King Date: Thu Aug 2 10:25:19 2018 +0100 drm/i2c: tda998x: move tda998x_set_config() into tda998x_create() Move the non-DT configuration of the TDA998x into tda998x_create() so that we do all setup in one place. Tested-by: Peter Rosin Signed-off-by: Russell King commit 2c6e758332a4fdf0d2b1c76adba10961afdabc8a Author: Peter Rosin Date: Thu Aug 2 10:25:19 2018 +0100 drm/i2c: tda998x: split tda998x_encoder_dpms into enable/disable This fits better with the drm_bridge callbacks for when this driver becomes a drm_bridge. Suggested-by: Laurent Pinchart Signed-off-by: Peter Rosin [edited by rmk to just split the tda998x_encoder_dpms() function and restore the double-disable protection we originally had, preserving original behaviour.] Tested-by: Peter Rosin Signed-off-by: Russell King commit b1eb4f844f8c35e252eebfacacc438644d9f9ba8 Author: Peter Rosin Date: Thu Aug 2 10:25:19 2018 +0100 drm/i2c: tda998x: find the drm_device via the drm_connector This prepares for being a drm_bridge which will not register the encoder. That makes the connector the better choice. Reviewed-by: Laurent Pinchart Signed-off-by: Peter Rosin Signed-off-by: Russell King commit 025556d55d6edf3b3be1267a481be0890b96cc65 Author: Todd Poynor Date: Thu Aug 2 01:42:38 2018 -0700 staging: gasket: apex: enable power save mode by default Set default value of allow_power_save parameter to enable power save mode, which is expected to be the state usually desired. Signed-off-by: Marty Faltesek Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit d9da1cbd0ba61dca36b96e66194f3f2f5b2e63e8 Author: Todd Poynor Date: Thu Aug 2 01:42:44 2018 -0700 staging: gasket: apex: drop reset type param Apex doesn't implement different types of resets based on the reset type param passed through the gasket layer or from userspace via the gasket_reset ioctl. The reset type is dropped from the gasket framework in a previous patch due to a lack of present need and non-conforming use of this parameter by the framework. Drop the parameter from the apex driver as well. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 1c65a2e2f68eae5d73b41dee003b8135dfcf6928 Author: Todd Poynor Date: Thu Aug 2 01:42:43 2018 -0700 staging: gasket: remove "reset type" param from framework The "type of reset" parameter to the gasket device reset APIs isn't required by the only gasket device submitted upstream, apex. The framework documents the param as private to the device driver and a pass-through at the gasket layer, but the gasket core calls the device driver with a hardcoded reset type of zero, which is not documented as having a predefined meaning. In light of all this, remove the reset type parameter from the framework. Remove the reset ioctl reset type parameter, and bump the framework version number to reflect the interface change. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit f019f07ecf6a6b8bd6d7853bce70925d90af02d1 Author: Dan Carpenter Date: Thu Aug 2 11:24:47 2018 +0300 uio: potential double frees if __uio_register_device() fails The uio_unregister_device() function assumes that if "info->uio_dev" is non-NULL that means "info" is fully allocated. Setting info->uio_de has to be the last thing in the function. In the current code, if request_threaded_irq() fails then we return with info->uio_dev set to non-NULL but info is not fully allocated and it can lead to double frees. Fixes: beafc54c4e2f ("UIO: Add the User IO core code") Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit c01513b4b29953e6ba8a8d8de77fb5ca2f01c48f Author: Dan Carpenter Date: Thu Aug 2 11:27:21 2018 +0300 eeprom: idt_89hpesx: clean up an error pointer vs NULL inconsistency We check for IS_ERR_OR_NULL() here, but later we check the same thing for NULL only. It turns out that it can only be NULL so we can make the checking consistent by removing the ERR_PTR stuff. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 29c692c96b3a39cd1911fb79cd2505af8d070f07 Author: Movie Song Date: Thu Jul 19 02:20:48 2018 +0800 USB: serial: pl2303: add a new device id for ATEN Signed-off-by: Movie Song Cc: Johan Hovold Cc: stable Signed-off-by: Greg Kroah-Hartman commit 81ae962d7f180c0092859440c82996cccb254976 Author: Anton Vasilyev Date: Fri Jul 27 18:45:36 2018 +0300 misc: ti-st: Fix memory leak in the error path of probe() Free resources instead of direct return of the error code if kim_probe fails. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Greg Kroah-Hartman commit c8c64b39cf721404d47e7069d7f6d00d03b7f6b4 Author: Sherry Yang Date: Thu Jul 26 17:17:17 2018 -0700 android: binder: Show extra_buffers_size in trace Add extra_buffers_size to the binder_transaction_alloc_buf tracepoint. Acked-by: Arve Hjønnevåg Signed-off-by: Sherry Yang Signed-off-by: Greg Kroah-Hartman commit 45ca3f76de0507ecf143f770570af2942f263812 Author: Anton Vasilyev Date: Tue Jul 24 18:10:38 2018 +0300 firmware: vpd: Fix section enabled flag on vpd_section_destroy static struct ro_vpd and rw_vpd are initialized by vpd_sections_init() in vpd_probe() based on header's ro and rw sizes. In vpd_remove() vpd_section_destroy() performs deinitialization based on enabled flag, which is set to true by vpd_sections_init(). This leads to call of vpd_section_destroy() on already destroyed section for probe-release-probe-release sequence if first probe performs ro_vpd initialization and second probe does not initialize it. The patch adds changing enabled flag on vpd_section_destroy and adds cleanup on the error path of vpd_sections_init. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 9a481bdc16294414fa4d666ab4f4019224d880a5 Author: Roman Kiryanov Date: Tue Jul 31 17:38:50 2018 -0700 platform: goldfish: Retire pdev_bus Not used by goldfish. Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 68275680ea12e9f378e51ff525dacbb76f006764 Author: Roman Kiryanov Date: Mon Jul 23 15:47:27 2018 -0700 goldfish: Use dedicated macros instead of manual bit shifting There are dedicated macros (lower_32_bits and upper_32_bits) available to extract the lower and upper 32 bits. They provide better readability and could prevent some compilation warnings. Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 72755eed6c1c5312425ad3d78bf0b916769e6125 Author: Roman Kiryanov Date: Mon Jul 23 15:47:26 2018 -0700 goldfish: Add missing includes to goldfish.h goldfish.h refers to external symbols such as dma_addr_t and writel. This causes compilation errors if this file is included before other header files. The mentioned symbols are defined in types.h (dma_addr_t) and io.h (writel). Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 8b9ce6954c05e3e4115f54444c7eaf2aa2dd5e65 Author: Mircea Caprioru Date: Wed Aug 1 10:37:40 2018 +0200 mux: adgs1408: new driver for Analog Devices ADGS1408/1409 mux This patch adds basic support for Analog Device ADGS1408/09 SPI mux controller. The device is probed and set to a disabled state. It uses the new mux controller framework. Signed-off-by: Mircea Caprioru Signed-off-by: Peter Rosin Signed-off-by: Greg Kroah-Hartman commit 94aea0c6f7bdb5d224b1f48ab0e93f40bf447a4c Author: Mircea Caprioru Date: Wed Aug 1 10:37:39 2018 +0200 dt-bindings: mux: add adi,adgs1408 Adding documentation for adgs1408/1409 multiplexer. The bindings follow the standard SPI and mux bindings and do not require any additional custom properties. Signed-off-by: Mircea Caprioru Reviewed-by: Rob Herring [peda: reword idle-state to non-array for singular mux controller] Signed-off-by: Peter Rosin Signed-off-by: Greg Kroah-Hartman commit 572086325ce9a9e348b8748e830653f3959e88b6 Author: Michael Kelley Date: Thu Aug 2 03:08:25 2018 +0000 Drivers: hv: vmbus: Cleanup synic memory free path clk_evt memory is not being freed when the synic is shutdown or when there is an allocation error. Add the appropriate kfree() call, along with a comment to clarify how the memory gets freed after an allocation error. Make the free path consistent by removing checks for NULL since kfree() and free_page() already do the check. Signed-off-by: Michael Kelley Reported-by: Dan Carpenter Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 6ba34171bcbd10321c6cf554e0c1144d170f9d1a Author: Michael Kelley Date: Thu Aug 2 03:08:24 2018 +0000 Drivers: hv: vmbus: Remove use of slow_virt_to_phys() slow_virt_to_phys() is only implemented for arch/x86. Remove its use in arch independent Hyper-V drivers, and replace with test for vmalloc() address followed by appropriate v-to-p function. This follows the typical pattern of other drivers and avoids the need to implement slow_virt_to_phys() for Hyper-V on ARM64. Signed-off-by: Michael Kelley Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit d3b26dd7cb0e3433bfd3c1d4dcf74c6039bb49fb Author: Dexuan Cui Date: Thu Aug 2 03:08:23 2018 +0000 Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind() Before setting channel->rescind in vmbus_rescind_cleanup(), we should make sure the channel callback won't run any more, otherwise a high-level driver like pci_hyperv, which may be infinitely waiting for the host VSP's response and notices the channel has been rescinded, can't safely give up: e.g., in hv_pci_protocol_negotiation() -> wait_for_response(), it's unsafe to exit from wait_for_response() and proceed with the on-stack variable "comp_pkt" popped. The issue was originally spotted by Michael Kelley . In vmbus_close_internal(), the patch also minimizes the range protected by disabling/enabling channel->callback_event: we don't really need that for the whole function. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley Cc: stable@vger.kernel.org Cc: K. Y. Srinivasan Cc: Stephen Hemminger Cc: Michael Kelley Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 7026a5fd7f2cd36fee5ec40f3652f942700671b7 Author: Alexander Usyskin Date: Tue Jul 31 09:35:37 2018 +0300 mei: define dma ring buffer sizes for PCH12 HW and newer Define dma ring buffer sizes for PCH12 (CLN HW and newer) Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit c2bd9fc13d0ca1926bfd8b8e6d88f93d84a51f2a Author: Tomas Winkler Date: Tue Jul 31 09:35:36 2018 +0300 mei: restrict dma ring support to hbm version 2.1 Only a firmware with version 2.1 and above supports dma ring feature. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Signed-off-by: Greg Kroah-Hartman commit 9d89ddfc624649e200aeec57912635dbe259d07b Author: Tomas Winkler Date: Tue Jul 31 09:35:35 2018 +0300 mei: hbm: introduce dma bit in the message header Add dma_ring bit in the mei message header for conveying that the message data itself are on the dma ring. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Signed-off-by: Greg Kroah-Hartman commit ee7aba5aba70dd98fc05697723167ebb858e7aba Author: Tomas Winkler Date: Tue Jul 31 09:35:34 2018 +0300 mei: hbm: define dma ring setup protocol The protocol defines how to setup an I/O ring on top of host memory to utilize the device DMA engine for faster transport. Three memory buffers are allocated. A Host circular buffer for from the Host to Device communication. A Device circular buffer for from Device to the Host communication. And finally a Control block where the pointers for the both circular buffers are managed. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Signed-off-by: Greg Kroah-Hartman commit 98e70866aacb1fcaa7b710fc6bca9862bf47421a Author: Tomas Winkler Date: Tue Jul 31 09:35:33 2018 +0300 mei: add support for variable length mei headers. Remove header size knowledge from me and txe hw layers, this requires to change the write handler to accept header and its length as well as data and its length. HBM messages are fixed to use basic header, hence we add mei_hbm2slots() that converts HBM message length and mei message header, while mei_data2slots() converts data length directly to the slots. Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit b34e9a15b37b8ddbf06a4da142b0c39c74211eb4 Author: Xiubo Li Date: Mon Jul 30 03:11:48 2018 -0400 uio: fix possible circular locking dependency The call trace: XXX/1910 is trying to acquire lock: (&mm->mmap_sem){++++++}, at: [] might_fault+0x57/0xb0 but task is already holding lock: (&idev->info_lock){+.+...}, at: [] uio_write+0x46/0x130 [uio] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&idev->info_lock){+.+...}: [] lock_acquire+0x99/0x1e0 [] mutex_lock_nested+0x93/0x410 [] uio_mmap+0x2d/0x170 [uio] [] mmap_region+0x428/0x650 [] do_mmap+0x3b8/0x4e0 [] vm_mmap_pgoff+0xd3/0x120 [] SyS_mmap_pgoff+0x1f1/0x270 [] SyS_mmap+0x22/0x30 [] system_call_fastpath+0x1c/0x21 -> #0 (&mm->mmap_sem){++++++}: [] __lock_acquire+0xdac/0x15f0 [] lock_acquire+0x99/0x1e0 [] might_fault+0x84/0xb0 [] uio_write+0xb4/0x130 [uio] [] vfs_write+0xc3/0x1f0 [] SyS_write+0x8a/0x100 [] system_call_fastpath+0x1c/0x21 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&idev->info_lock); lock(&mm->mmap_sem); lock(&idev->info_lock); lock(&mm->mmap_sem); *** DEADLOCK *** 1 lock held by XXX/1910: #0: (&idev->info_lock){+.+...}, at: [] uio_write+0x46/0x130 [uio] stack backtrace: CPU: 0 PID: 1910 Comm: XXX Kdump: loaded Not tainted #1 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/19/2017 Call Trace: [] dump_stack+0x19/0x1b [] print_circular_bug+0x1f9/0x207 [] check_prevs_add+0x957/0x960 [] __lock_acquire+0xdac/0x15f0 [] ? mark_held_locks+0xb9/0x140 [] lock_acquire+0x99/0x1e0 [] ? might_fault+0x57/0xb0 [] might_fault+0x84/0xb0 [] ? might_fault+0x57/0xb0 [] uio_write+0xb4/0x130 [uio] [] vfs_write+0xc3/0x1f0 [] ? fget_light+0xfc/0x510 [] SyS_write+0x8a/0x100 [] system_call_fastpath+0x1c/0x21 Signed-off-by: Xiubo Li Signed-off-by: Greg Kroah-Hartman commit 95883676e34ab93f600787cc9831707bcdad4398 Author: Dan Carpenter Date: Thu Aug 2 10:15:58 2018 +0300 uio: pruss: fix error handling in probe There are two bugs here. First the error codes weren't set on several paths. And second, if the call to request_threaded_irq() inside uio_register_device() fails then it would lead to a double free when we call uio_unregister_device() inside pruss_cleanup(). Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 60ab0fafc4b652fcaf7cbc3bb8555a0cf1149c28 Author: Aaron Sierra Date: Tue Jul 24 14:23:46 2018 -0500 serial: 8250_exar: Read INT0 from slave device, too The sleep wake-up refactoring that I introduced in commit c7e1b4059075 ("tty: serial: exar: Relocate sleep wake-up handling") did not account for devices with a slave device on the expansion port. This patch pokes the INT0 register in the slave device, if present, in order to ensure that MSI interrupts don't get permanently "stuck" because of a sleep wake-up interrupt as described here: commit 2c0ac5b48a35 ("serial: exar: Fix stuck MSIs") This also converts an ioread8() to readb() in order to provide visual consistency with the MMIO-only accessors used elsewhere in the driver. Reported-by: Andy Shevchenko Signed-off-by: Aaron Sierra Fixes: c7e1b4059075 ("tty: serial: exar: Relocate sleep wake-up handling") Reviewed-by: Andy Shevchenko Cc: stable Signed-off-by: Greg Kroah-Hartman commit 0419056ec8fd01ddf5460d2dba0491aad22657dd Author: Anton Vasilyev Date: Fri Jul 27 16:39:31 2018 +0300 tty: rocket: Fix possible buffer overwrite on register_PCI If number of isa and pci boards exceed NUM_BOARDS on the path rp_init()->init_PCI()->register_PCI() then buffer overwrite occurs in register_PCI() on assign rcktpt_io_addr[i]. The patch adds check on upper bound for index of registered board in register_PCI. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Greg Kroah-Hartman commit 784c29eda5b4e28c3a56aa90b3815f9a1b0cfdc1 Author: Srinath Mannam Date: Sat Jul 28 20:55:15 2018 +0530 serial: 8250_dw: Add ACPI support for uart on Broadcom SoC Add ACPI identifier HID for UART DW 8250 on Broadcom SoCs to match the HID passed through ACPI tables to enable UART controller. Signed-off-by: Srinath Mannam Reviewed-by: Vladimir Olovyannikov Tested-by: Vladimir Olovyannikov Reviewed-by: Ray Jui Reviewed-by: Andy Shevchenko Cc: stable Signed-off-by: Greg Kroah-Hartman commit dfcab6ba573445c703235ab6c83758eec12d7f28 Author: Chen Hu Date: Fri Jul 27 18:32:41 2018 +0800 serial: 8250_dw: always set baud rate in dw8250_set_termios dw8250_set_termios() doesn't set baud rate if the arg "old ktermios" is NULL. This happens during resume. Call Trace: ... [ 54.928108] dw8250_set_termios+0x162/0x170 [ 54.928114] serial8250_set_termios+0x17/0x20 [ 54.928117] uart_change_speed+0x64/0x160 [ 54.928119] uart_resume_port ... So the baud rate is not restored after S3 and breaks the apps who use UART, for example, console and bluetooth etc. We address this issue by setting the baud rate irrespective of arg "old", just like the drivers for other 8250 IPs. This is tested with Intel Broxton platform. Signed-off-by: Chen Hu Fixes: 4e26b134bd17 ("serial: 8250_dw: clock rate handling for all ACPI platforms") Cc: Heikki Krogerus Cc: stable Reviewed-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit bfbf2de2c9f467219b472e99c303449634fc3186 Author: Shubhrajyoti Datta Date: Sat Jul 21 17:19:07 2018 +0530 dt-bindings: serial: Add binding for uartlite The uartlite devicetree binding was missed out. Add the binding documentation for uartlite that is already in use. Signed-off-by: Shubhrajyoti Datta Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit a3a10614ca0fce423f80821881cfeb088f152d24 Author: Shubhrajyoti Datta Date: Sat Jul 21 17:19:06 2018 +0530 tty: serial: uartlite: Add support for suspend and resume Add suspend and resume handlers for uartlite Signed-off-by: Shubhrajyoti Datta Signed-off-by: Greg Kroah-Hartman commit 14288befeb572b4d2155f3435dca5cdec799152c Author: Shubhrajyoti Datta Date: Sat Jul 21 17:19:05 2018 +0530 tty: serial: uartlite: Add clock adaptation Add support of Common Clock Framework for Uartlite driver. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Greg Kroah-Hartman commit da7bf20e7758042eb3931ff68fc96bdfaf94d881 Author: Shubhrajyoti Datta Date: Sat Jul 21 17:19:04 2018 +0530 tty: serial: uartlite: Add structure for private data Add struct uartlite_data, to store the private data of the Uartlite driver. Signed-off-by: Tanvi Desai Signed-off-by: Shubhrajyoti Datta Signed-off-by: Greg Kroah-Hartman commit 628c534ae73581fd21a09a27b7a4222b01a44d64 Author: Chris Brandt Date: Tue Jul 31 05:41:39 2018 -0500 serial: sh-sci: Improve support for separate TEI and DRI interrupts Some SCIF versions mux error and break interrupts together and then provide a separate interrupt ID for just TEI/DRI. Allow all 6 types of interrupts to be specified via platform data (or DT) and for any signals that are muxed together (have the same interrupt number) simply register one handler. Signed-off-by: Chris Brandt Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit 7acece71a517cad83a0842a94d94c13f271b680c Author: Chris Brandt Date: Tue Jul 31 05:41:38 2018 -0500 serial: sh-sci: Remove SCIx_RZ_SCIFA_REGTYPE There is no more need for SCIx_RZ_SCIFA_REGTYPE now that SCIx_SH4_SCIF_REGTYPE can provide the same register/address definitions. Also, R7S9210 no longer needs a special compatible since the standard "renesas,scif" will work just fine. Signed-off-by: Chris Brandt Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit 2d4dd0da45401c7ae7332b4d1eb7bbb1348edde9 Author: Chris Brandt Date: Tue Jul 31 05:41:37 2018 -0500 serial: sh-sci: Allow for compressed SCIF address Some devices with SCIx_SH4_SCIF_REGTYPE have no space between registers. Use the register area size to determine the spacing between register. Signed-off-by: Chris Brandt Signed-off-by: Greg Kroah-Hartman commit 70a15ff0ed1183a8879031d6014dd6dd159ea617 Author: Chris Brandt Date: Tue Jul 31 05:41:36 2018 -0500 serial: sh-sci: Improve interrupts description Describe interrupts property in more detail, especially when there are more than one interrupt. Signed-off-by: Chris Brandt Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit ec2cb7a526d49b65576301e183448fb51ee543a6 Merge: 16e0e6a83b77 b912885ab75c Author: Ingo Molnar Date: Thu Aug 2 09:59:41 2018 +0200 Merge tag 'perf-core-for-mingo-4.19-20180801' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: perf trace: (Arnaldo Carvalho de Melo) - Do not require --no-syscalls to suppress strace like output, i.e. # perf trace -e sched:*switch will show just sched:sched_switch events, not strace-like formatted syscall events, use --syscalls to get the previous behaviour. If instead: # perf trace is used, i.e. no events specified, then --syscalls is implied and system wide strace like formatting will be applied to all syscalls. The behaviour when just a syscall subset is used with '-e' is unchanged: # perf trace -e *sleep,sched:*switch will work as before: just the 'nanosleep' syscall will be strace-like formatted plus the sched:sched_switch tracepoint event, system wide. - Allow string table generators to use a default header dir, allowing use of them without parameters to see the table it generates on stdout, e.g.: $ tools/perf/trace/beauty/kvm_ioctl.sh static const char *kvm_ioctl_cmds[] = { [0x00] = "GET_API_VERSION", [0x01] = "CREATE_VM", [0x02] = "GET_MSR_INDEX_LIST", [0x03] = "CHECK_EXTENSION", [0xe0] = "CREATE_DEVICE", [0xe1] = "SET_DEVICE_ATTR", [0xe2] = "GET_DEVICE_ATTR", [0xe3] = "HAS_DEVICE_ATTR", }; $ See 'ls tools/perf/trace/beauty/*.sh' to see the available string table generators. - Add a generator for IPPROTO_ socket's protocol constants. perf record: (Kan Liang) - Fix error out while applying initial delay and using LBR, due to the use of a PERF_TYPE_SOFTWARE/PERF_COUNT_SW_DUMMY event to track PERF_RECORD_MMAP events while waiting for the initial delay. Such events fail when configured asking PERF_SAMPLE_BRANCH_STACK in perf_event_attr.sample_type. perf c2c: (Jiri Olsa) - Fix report crash for empty browser, when processing a perf.data file without events of interest, either because not asked for in 'perf record' or because the workload didn't triggered such events. perf list: (Michael Petlan) - Align metric group description format with PMU event description. perf tests: (Sandipan Das) - Fix indexing when invoking subtests, which caused BPF tests to get results for the next test in the list, with the last one reporting a failure. eBPF: - Fix installation directory for header files included from eBPF proggies, avoiding clashing with relative paths used to build other software projects such as glibc. (Thomas Richter) - Show better message when failing to load an object. (Arnaldo Carvalho de Melo) General: (Christophe Leroy) - Allow overriding MAX_NR_CPUS at compile time, to make the tooling usable in systems with less memory, in time this has to be changed to properly allocate based on _NPROCESSORS_ONLN. Architecture specific: - Update arm64's ThunderX2 implementation defined pmu core events (Ganapatrao Kulkarni) - Fix complex event name parsing in 'perf test' for PowerPC, where the 'umask' event modifier isn't present. (Sandipan Das) CoreSight ARM hardware tracing: (Leo Yan) - Fix start tracing packet handling. - Support dummy address value for CS_ETM_TRACE_ON packet. - Generate branch sample when receiving a CS_ETM_TRACE_ON packet. - Generate branch sample for CS_ETM_TRACE_ON packet. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit 16e0e6a83b778284ae9b3a57003eeea8d8090b55 Merge: 25a00ac7dc92 ce03b6d2b610 Author: Ingo Molnar Date: Thu Aug 2 09:59:20 2018 +0200 Merge branch 'perf/urgent' into perf/core, to pick up fixes Signed-off-by: Ingo Molnar commit 45904e7edcd08730d1888cb79071654e344774a7 Author: Sara Sharon Date: Wed Mar 14 11:27:36 2018 +0200 iwlwifi: pcie: split tx to amsdu and non amsdu The code is different enough to justify a split. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit ff932f61ed2fd52752974831f46a601ce5864a27 Author: Golan Ben Ami Date: Sun Feb 18 18:20:09 2018 +0200 iwlwifi: move some msix and rx functions to a common place We would like to allow other utlities to init msix and rx. Put their declarations in a place accessible to other utilities. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit f890269b29d71587bf223a99eb4939199a8fde40 Author: Luca Coelho Date: Wed Mar 14 16:02:01 2018 +0200 iwlwifi: pcie: include tcp.h implicitly If CONFIG_IPV6 is not enabled in the kernel, tcp.h is not included implicitly from other header files, causing compilation errors. To solve that, explicitly include it in tx-gen2.c. Signed-off-by: Luca Coelho commit 266ab689656bd640f85397eb49c16c2ec0a8ccff Author: Luca Coelho Date: Fri Jul 27 14:53:07 2018 +0300 iwlwifi: mvm: remove dead gscan code There was a bunch of code to support gscan which has never been used. Remove it all to cleanup and get rid of a lot of dead code. Signed-off-by: Luca Coelho commit f137c0979b96be86c14692c8e4e1f32d93b250da Author: Golan Ben Ami Date: Tue Mar 6 14:29:11 2018 +0200 iwlwifi: hard code power save mode to CAM for 22560 devices Balanced power save mode isn't supported in the fw for 22560 devices yet. Configure the power save mode to CAM until it gets implemented. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 07fb3299adc40b2e87bbe7047b7b1614deae0d05 Author: Sara Sharon Date: Tue Mar 13 13:49:25 2018 +0200 Revert "iwlwifi: implement fseq version mismatch warning" This reverts commit f2e66c8df0d0f10c70ed7f5e14a939714e9ee6a9. The firmware never implemented this, and they do not plan to. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit f98ad635c097c29339b7a7d6947173000485893d Author: Emmanuel Grumbach Date: Tue Mar 13 14:12:40 2018 +0200 iwlwifi: pcie: don't access periphery registers when not available The periphery can't be accessed before we set the INIT_DONE bit which initializes the device. A previous patch added a reconfiguration of the MSI-X tables upon resume, but at that point in the flow, INIT_DONE wasn't set. Since the reconfiguration of the MSI-X tables require periphery access, it failed. The difference between WoWLAN and without WoWLAN is that in WoWLAN, iwl_trans_pcie_d3_suspend clears the INIT_DONE without clearing the STATUS_DEVICE_ENABLED bit in the software status. Because of that, the resume code thinks that the device is enabled, but the INIT_DONE bit has been cleared. To fix this, don't reconfigure the MSI-X tables in case WoWLAN is enabled. It will be done in iwl_trans_pcie_d3_resume anyway. Fixes: 52848a79b9d2 ("iwlwifi: pcie: reconfigure MSI-X HW on resume") Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho commit 8edbfaa19835cf0bd2a9b3e5e328ba20a927d10b Author: Sara Sharon Date: Mon Feb 5 12:42:44 2018 +0200 iwlwifi: mvm: configure multi RX queue Currently multi-queue is disabled for 22000 devices. This was since driver isn't supposed to write to prph registers anymore, and FW needs to configure the RFH. Now that FW added support for the API - use it and remove the 22000 multi RX queue disablement. Bump min API version to avoid compatibility issues. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit e8a583f9afa882cf9b2c6122ba16921c0d6a9cba Author: Luca Coelho Date: Wed Mar 7 18:46:01 2018 +0200 iwlwifi: d3: disable dbg recording before entering D3 Currently the firmware does not stop recording debugging data when entering D3 and this causes trouble (e.g. sporadic wake ups). Fix that by stopping dbg recording when suspending. Signed-off-by: Luca Coelho commit 520f03eaaad7c4ede831f93995a0b0a916f369d8 Author: Shahar S Matityahu Date: Tue Feb 20 17:20:32 2018 +0200 iwlwifi: allow masking out memory areas from the fw dump Reading and dumping memory areas takes time, and sometimes dumping all of the areas isn't necessary. Allow choosing the memory areas which should be dumped. Signed-off-by: Shahar S Matityahu Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 92536c96159b62d73843af5702dd4e00d4bcffdf Author: Sara Sharon Date: Mon Feb 5 12:37:05 2018 +0200 iwlwifi: trans: add a new op for getting DMA data Op mode will need this data in order to feed FW with it. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit 1b4bbe8bf2eb631974c0688d7eeb350f86de25f8 Author: Sara Sharon Date: Sun Mar 4 13:22:27 2018 +0200 iwlwifi: pcie: move rxb retrieval to a helper function This makes code less indented and more readable. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit b2a58c9712bb1b8744944c0cc54168be27e217f7 Author: Sara Sharon Date: Sun Mar 4 13:09:01 2018 +0200 iwlwifi: pcie: unionize used bd and completion descriptor This allows less "dummy" declarations and casting. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit 18ead597daa17a557249cf4b2f494361d836ed52 Author: Golan Ben Ami Date: Mon Feb 5 12:54:36 2018 +0200 iwlwifi: support new rx_mpdu_desc api 22560 devices use a new rx_mpdu_desc api. Update the code to use the new api. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 0307c839613e17b052c53e2c80a6c76fd1cd0320 Author: Golan Ben Ami Date: Mon Feb 5 12:01:36 2018 +0200 iwlwifi: pcie: support rx structures for 22560 devices The rfh for 22560 devices has changed so it supports now the same arch of using used and free lists, but different structures to support the last. Use the new structures, hw dependent, to manage the lists. bd, the free list, uses the iwl_rx_transfer_desc, in which the vid is stored in the structs' rbid field, and the page address in the addr field. used_bd, the used list, uses the iwl_rx_completion_desc struct, in which the vid is stored in the structs' rbid field. rb_stts, the hw "write" pointer of rx is stored in a __le16 array, in which each entry represents the write pointer per queue. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit bfdbe1323253a3f829d59c2566bb3c9452b84651 Author: Luca Coelho Date: Thu Jul 26 16:10:18 2018 +0300 iwlwifi: pcie: add a bunch of PCI IDs for 22000 and 22560 Add some missing PCI IDs for 22000 and 22560 devices. Signed-off-by: Luca Coelho commit 84d979bc89e3a982940b85014aab357b25d32882 Author: John Whitmore Date: Tue Jul 31 22:00:05 2018 +0100 staging:rtl8192u: Change clock comment - Style A number of block comments have been changed to comply with the coding standard. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 0b0251ad9becfb96c78d10d2ff414274974f46a9 Author: John Whitmore Date: Tue Jul 31 22:00:04 2018 +0100 staging:rtl8192u: Rename IsACValid and add parenthesis - Style The macro IsACValid is renamed to resolve the checkpatch issue with CamelCase naming. In addition the parameter has parenthesis added to clear the checkpatch issue with precedence issues. These changes are coding style changes and as such should have not impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 9e86a12e7b968da44c22b5cf96fe960af88b98d6 Author: John Whitmore Date: Tue Jul 31 22:00:03 2018 +0100 staging:rtl8192u: Remove unused UP2AC - Style The macro UP2AC is commented out of the header file so the macro and its associated comment are removed. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4375c036ca0087641e61c3eae830261a10b51b5a Author: John Whitmore Date: Tue Jul 31 22:00:02 2018 +0100 staging:rtl8192u: Rename octet_string members - Style Rename the structure octet_string's member variables Octet to octet and Length to length. This change clears the checkpatch issue with CamelCase naming of variables. This is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4f698fc122e2aa0e5f0e0507a5a0022e82d253ce Author: John Whitmore Date: Tue Jul 31 22:00:01 2018 +0100 staging:rtl8192u: rename OCTET_STRING - Style Rename the structure OCTET_STRING to octet_string. This is to comply with the coding style of using lowercase for types. In addition the typedef directive is removed to clear the checkpatch issue with defining new types. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f40e50c33fa5d1c677509c991450faae12408212 Author: John Whitmore Date: Tue Jul 31 22:00:00 2018 +0100 staging:rtl8192u: Move QOS_TCLAS to rtl819x_TS.h - Style Move the union QOS_TCLAS from the header file rtl819x_Qos.h to header file rtl819x_TS.h, where the structure is actually used, as the member of another structure. This is a coding style change, which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c96dc9b905f21721b3cb191927880161b1190a99 Author: John Whitmore Date: Tue Jul 31 21:59:59 2018 +0100 staging:rtl8192u: Remove commented out code - Style A number of structures have been commented out of code. Obviously they are not used and as a result have been removed from the code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 7390ebe9e3d51db98b79c6737beef97ea94250b6 Author: John Whitmore Date: Tue Jul 31 21:59:58 2018 +0100 staging:rtl8192u: Rename tspec_body members - Style The member variables of the tspec_body have been renamed to clear the checkpatch issue with CamelCase naming. As these member variables are never used in the code the changes are combined into this single patch. These changes are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 73b068f56753fc01e4cfebdcc00c79ff8e7ff4a8 Author: John Whitmore Date: Tue Jul 31 21:59:57 2018 +0100 staging:rtl8192u: Rename TSInfo - Style Rename TSInfo, the memeber variable of struct tspec_body to ts_info. This change clears the checkpatch issue with CamelCase naming. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 9365607ac1c91e8ee4dbda7e1c015f3d2eca489a Author: John Whitmore Date: Tue Jul 31 21:59:56 2018 +0100 staging:rtl8192u: Refactor union TSPEC_BODY - Style The union TSPEC_BODY is never used as a union. The union comprises an array of bytes and a bitfield structure, both of which are 55 bytes in length, but the byte array is never used. As a result the union has been truncated to the bitfield struct, which is actually used. Additionally the typedef has been removed from the structure to clear the checkpatch issue with defining new types. Additionally the name has been changed to lowercase to comply with coding style. These changes are all coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 0a679b9359f6b8394e93007e0b530da6bd819355 Author: John Whitmore Date: Tue Jul 31 21:59:55 2018 +0100 staging:rtl8192u: Rename members of struct qos_tsinfo - Style The member variables of struct qos_tsinfo all cause checkpatch issues with CamelCase naming. As the variables are used in so few places the changes are combined into this single patch. Additionally the member variable usReserved is never used in code so has been removed. These are all coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 893ce9394b3cba7722f9ce01ecba84f35c0211a6 Author: John Whitmore Date: Tue Jul 31 21:59:54 2018 +0100 staging:rtl8192u: Remove union from qos_tsinfo - Style The union is never used as a union but only as a bitfield struct. One side of the union (u8 charData[3];) Only seems to be present to ensure that the structures size is 3 bytes in length. That length, of the structure is dictated by the largest element of the union, so the byte array only dictates size if it's the largest element of the union. The byte array and union add nothing. The union has therefore been removed and the structure and access to the structure simplified. Additionally since one of the bitfield variables (ucAccessPolicy) spans a byte boundary the base type of the bitfield has been changed from u8 to u16. Compilers have probably moved on from having an issue with this, call it OCD. The changes are coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit ab9a066577f9529fa112743078e60ce7afbc194e Author: John Whitmore Date: Tue Jul 31 21:59:53 2018 +0100 staging:rtl8192u: Remove union from aci_aifsn - Style The union aci_aifsn is not used as a union, but only as a struct. The union seems to have been used to ensure that the size of the structure was only a single byte. That size is set by the bitfield structure, adding a union with an unused byte adds nothing. The union has been removed. This is a coding style change and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 7f40eb132c470b8ee61c17d223edbb787befb184 Author: John Whitmore Date: Tue Jul 31 21:59:52 2018 +0100 staging:rtl8192u: Clean cmpk_counttxstatistic() comments - Style The only useful piece of information in the header comment of this static function was the name of the function and parameters. That is not useful information, given that they are in the C Source of the function declaration, a few lines below the comment. The block comment has been removed. This is a coding style change, there should be no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit d36255f14876063748094eef3eb3676496f69ffe Author: Michael Straube Date: Tue Jul 31 13:34:15 2018 +0200 staging: rtl8188eu: rename odm_RTL8188E - style Rename source and header file to avoid CamelCase. odm_RTL8188E.c -> odm_rtl8188e.c odm_RTL8188E.h -> odm_rtl8188e.h Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 1a5c3d83c009393c27451e265fe21310b218211c Author: Michael Straube Date: Tue Jul 31 13:34:14 2018 +0200 staging: rtl8188eu: remove unused rtw_remove_bcn_ie() The function rtw_remove_bcn_ie() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 96b0b75941183fc4101d46a38efbc639a5dc6cb3 Author: Michael Straube Date: Tue Jul 31 13:34:13 2018 +0200 staging: rtl8188eu: remove unused rtw_add_bcn_ie() The function rtw_add_bcn_ie() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit ee34b7cb0f0e6acbdc094786dba7ca1158175436 Author: Michael Straube Date: Tue Jul 31 13:34:12 2018 +0200 staging: rtl8188eu: remove unnecessary parentheses - style Remove unnecessary parentheses to improve readability. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 55e12d6451c9218d7e251241aa17bc3b6917a864 Author: Michael Straube Date: Tue Jul 31 13:34:11 2018 +0200 staging: rtl8188eu: fix comparsions to NULL - style Use x instead of x != NULL. Use !x instead of x == NULL. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 4235d7d88a5a823e217abb4e3a6dd9bf1f457ae6 Author: Michael Straube Date: Tue Jul 31 13:34:10 2018 +0200 staging: rtl8188eu: fix indentation - style Fix indentation to clear checkpatch warnings. WARNING: suspect code indent for conditional statements Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 8663b2e02c1b5d5767ebaa38f72128658b6da1e9 Author: Michael Straube Date: Tue Jul 31 13:34:09 2018 +0200 staging: rtl8188eu: use is_broadcast_ether_addr Use is_broadcast_ether_addr instead of checking each byte of the address array for 0xff. Shortens the code and improves readability. As required by is_broadcast_ether_addr, the address array sta_addr is properly aligned in all uses. Thanks to Joe Perches. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 328cf8e7790c852fc887ce067e53900f2c423afa Author: Michael Straube Date: Wed Aug 1 21:10:50 2018 +0200 staging: rtl8188eu: use is_multicast_ether_addr Use is_multicast_ether_addr instead of custom IS_MCAST. The variable for the result of IS_MCAST was only used in the if conditional. So remove the extra variable and move the call to is_multicast_ether_addr into the conditional. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c3e39b07f64d56992080f8f634632dcfa7dfc85d Author: Ioana Radulescu Date: Wed Aug 1 11:09:51 2018 -0500 staging: fsl-dpaa2/eth: Merge header files File net.h contains definitions that are exclusively used by the key generator/classification API. Merge its contents with dpkg.h in order to reduce the number of private headers. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit 0035698dcd7815d17b6c8c0f6c29fdf8d29fcaca Author: Ioana Radulescu Date: Wed Aug 1 11:09:50 2018 -0500 staging: fsl-dpaa2/eth: Use BIT() macro File net.h has several bitmask defines that could be implemented more clearly using the BIT() macro. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit d9cc92670b357a5bf2a507a7c8ebd59086a80865 Author: Ioana Radulescu Date: Wed Aug 1 11:09:49 2018 -0500 staging: fsl-dpaa2/eth: Remove dead code File net.h contains unused defines, so remove them. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit ef134e9c19797740c259cbd3834c31299580b740 Author: Ioana Radulescu Date: Wed Aug 1 11:09:48 2018 -0500 staging: fsl-dpaa2/eth: Cleanup comments Comments in file net.h are too fancy for their own good, so convert them to the regular format. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit 0bb29b25a008fe9d3a0f1ad3f9773225add35f08 Author: Ioana Ciornei Date: Tue Jul 31 12:02:47 2018 -0500 staging: fsl-dpaa2/eth: add SPDX license identifiers The DPAA2 Ethernet driver files use a GPL-2.0+ OR BSD-3-Clause license. Add SPDX tags and delete the full license text, keeping the existing licenses for each file. Add a GPL-2.0 tag for the Makefile. Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman commit 90615f9f173a3c796c1c07ca61e98381b9ad1d35 Author: Ioana Ciornei Date: Tue Jul 31 12:02:46 2018 -0500 staging: fsl-dpaa2/eth: convert documentation to .rst format Convert the DPAA2 Ethernet driver documentation to .rst format and rename the file accordingly. Also add a SPDX tag to the new rst file. Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman commit 02211edc9a1f71942a67d545614f8c7382230de7 Author: Ajay Singh Date: Wed Aug 1 16:41:00 2018 +0530 staging: wilc1000: fix endianness warnings reported by sparse This patch fixes the sparse warnings by making use of le32_to_cpus() & cpu_to_le32s() conversion API's. Remove the unnecessary byte-order conversion in wilc_wlan_parse_response_frame() as the data is copied using individual byte operation. Also added the byte-order conversion for 'header' in wilc_wfi_monitor_rx() & wilc_wfi_p2p_rx() as received in LE byte-order. The link [1] contains the details of discussion related to this patch. [1]. https://patchwork.kernel.org/patch/10436791/ Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 41203a451b6c9f6458195d9c0de964bf33c52e93 Author: Ajay Singh Date: Wed Aug 1 16:40:59 2018 +0530 staging: wilc1000: use 'u16' data type for config id parameter Cleanup patch to use the correct data type 'u16' for keeping the WID value in 'wilc_cfg_word' & 'wilc_cfg_str' structure. Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 7878abdec92040e8c20ff3f1b8f8ab35d8dafc5b Author: Ajay Singh Date: Wed Aug 1 10:33:41 2018 +0530 staging: wilc1000: refactor wilc_wlan_handle_isr_ext to avoid goto statement Refactor wilc_wlan_handle_isr_ext() to avoid the use of the goto label. Also avoid the unnecessary NULL check for 'wilc->rx_buffer' and calling wilc_wlan_handle_rxq() only after wilc_wlan_rxq_add() call. The link [1] contains details for discussion related to this changes. [1]. https://patchwork.kernel.org/patch/10533601/ Signed-off-by: Ajay Singh Suggested-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 49328076f6f93bae8376dfb7a19143f613da6f52 Author: Ajay Singh Date: Sun Jul 29 11:36:55 2018 +0530 staging: wilc1000: rename 'rcvd_ch_cnt' element in 'user_scan_req' struct Cleanup patch to use shorter name for 'rcvd_ch_cnt' to 'ch_cnt' to avoid line over 80 character issue reported by checkpatch. Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 97ed6d34e31275fef331c6520cc9b983b678d334 Author: Ajay Singh Date: Sun Jul 29 11:36:54 2018 +0530 staging: wilc1000: added comments for 'hif_cs' mutex lock Added comments for 'hif_cs' mutex to avoid checkpatch.pl reported issues. Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit a120adb8b6eddc1645a61a4e7a8daa0cc2f6ddd8 Author: Ajay Singh Date: Sun Jul 29 11:36:53 2018 +0530 staging: wilc1000: modified debug log messages description Cleanup patch to update the debug logs message to provide correct information. Also added the function name tag for same description log to help identify the place from where log was captured. Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit f131bbe556fb8c765d7b84c487b92b56e56dd0fa Author: Ajay Singh Date: Sun Jul 29 11:36:51 2018 +0530 staging: wilc1000: remove unnecessary comments and comments description Cleanup patch to remove the unnecessary comments and commented code. Also updated description for few of comments. Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 9abc44ba4e2f27c4d8db8cbe7e9b180c9f37e921 Author: Ajay Singh Date: Sun Jul 29 11:36:50 2018 +0530 staging: wilc1000: fix TODO to compile spi and sdio components in single module Changes to compile module component along with SPI and SDIO module. Previously 'wilc1000.ko' used to generate along with wilc-spi.ko or wilc1000-sdio.ko module. After these changes only wilc1000-spi.ko or wilc1000-sdio.ko modules are required for SPI and SDIO respectively. These changes are done to address below TODO item. - make SPI and SDIO components coexist in one build Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 2408898e3b6c99b3ec792760989e57026cd9909d Author: Steve Longerbeam Date: Fri Jul 20 10:17:31 2018 -0700 staging: vboxvideo: Add page-flip support Adds crtc page-flip support by passing the new requested framebuffer to vbox_crtc_do_set_base(). Note there is no attempt to support vblank interrupts, it's not not known how to do this in VBOX or if it is even possible. Since this page-flip implementation does not try to sync the page-flip to vertical blanking, tearing effects are possible. Signed-off-by: Steve Longerbeam Signed-off-by: Greg Kroah-Hartman commit ba67f54d911c3da6fc284b4a9cf30ca1a27591e6 Author: Steve Longerbeam Date: Fri Jul 20 10:17:30 2018 -0700 staging: vboxvideo: Pass a new framebuffer to vbox_crtc_do_set_base This modifies vbox_crtc_do_set_base() to take a new framebuffer to be activated, instead of the existing framebuffer attached to the crtc. This change allows the function to be given the new framebuffer from a page-flip request. Signed-off-by: Steve Longerbeam Signed-off-by: Greg Kroah-Hartman commit 548b9f03f007ae654055644cff844b2b4fd2b5d2 Author: Ivan Bornyakov Date: Wed Aug 1 21:37:44 2018 +0300 staging: gasket: sysfs: fix potential null dereference Add handling of possible allocation failure. Reported by smatch: drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential null dereference 'files_to_remove'. (kcalloc returns null) Signed-off-by: Ivan Bornyakov Signed-off-by: Greg Kroah-Hartman commit c0f460ffeb9545267c981895814af157e5dfc554 Merge: 799d8a8e0500 496fb59e1274 Author: Greg Kroah-Hartman Date: Thu Aug 2 08:07:54 2018 +0200 Merge tag 'iio-for-4.19c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Third set of IIO new device support, cleanups and features for the 4.19 cycle. This is a somewhat sneaky late pull request given Linus has announced a likely 1 week delay. If it is too late I'll resend after the merge window. I merged in the fixes branch as those are primarily around things queued for the merge window. Particulary good to see the output of our Himanshu Jha, a GSOC student who developed the bme680 driver. New device support: * bme680 gas sensor (with temperature, humidity and pressure) - new driver to support this device * vcn4000 - support vcnl4200 (lots of rework to allow this) - ids added for VCNL4010 and VCNL4020 sensors New features: * ad9523 - support the various external signal options via gpios. Cleanups and fixes * ad_sigma_delta - unsigned long for a timeout. * ad9523 - fix a wrong return value that was indicating successful write failed and might lead to an infinite loop. * si1133 - fix an impossible test. - fix an uninitialsed variable by reading from the device in all paths. * xilinx xadc - check for return values in clk related functions - limit the pcap clock frequency to supported ranges. - stash the irq to avoid calling platform_get_irq from the remove path. - ensure the irq is actually requested before we enable the hardware to output it. commit 789b7f43858f1c74a1c528e8b8f78c78624800d8 Author: Takashi Iwai Date: Thu Aug 2 07:40:19 2018 +0200 ALSA: sb: Fix a typo There was a typo of COPY_USER in the dead code (that is disabled as default). Fixes: 4b83eff81c81 ("ALSA: sb: Convert to the new PCM ops") Signed-off-by: Takashi Iwai commit 11175556eec58b27a1398e80f8b1302314f2242c Author: Wei Yongjun Date: Thu Aug 2 04:31:02 2018 +0000 ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes() sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Fixes: 7edf3b5e6a45 ("ALSA: usb-audio: AudioStreaming Power Domain parsing") Signed-off-by: Wei Yongjun Signed-off-by: Takashi Iwai commit bc716523462f98ea6bfef3e1a5926daadbf32e9e Author: Liu Song Date: Thu Aug 2 00:11:16 2018 -0400 ext4: improve code readability in ext4_iget() Merge the duplicated complex conditions to improve code readability. Signed-off-by: Liu Song Signed-off-by: Theodore Ts'o Reviewed-by: Jiang Biao commit 1a5d5e5d51e75a5bca67dadbcea8c841934b7b85 Author: Jeremy Cline Date: Thu Aug 2 00:03:40 2018 -0400 ext4: fix spectre gadget in ext4_mb_regular_allocator() 'ac->ac_g_ex.fe_len' is a user-controlled value which is used in the derivation of 'ac->ac_2order'. 'ac->ac_2order', in turn, is used to index arrays which makes it a potential spectre gadget. Fix this by sanitizing the value assigned to 'ac->ac2_order'. This covers the following accesses found with the help of smatch: * fs/ext4/mballoc.c:1896 ext4_mb_simple_scan_group() warn: potential spectre issue 'grp->bb_counters' [w] (local cap) * fs/ext4/mballoc.c:445 mb_find_buddy() warn: potential spectre issue 'EXT4_SB(e4b->bd_sb)->s_mb_offsets' [r] (local cap) * fs/ext4/mballoc.c:446 mb_find_buddy() warn: potential spectre issue 'EXT4_SB(e4b->bd_sb)->s_mb_maxs' [r] (local cap) Suggested-by: Josh Poimboeuf Signed-off-by: Jeremy Cline Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit c971e6a006175bd0f195c6346c4e8bc4089bec00 Author: Al Viro Date: Mon May 28 18:27:19 2018 -0400 kill d_instantiate_no_diralias() The only user is fuse_create_new_entry(), and there it's used to mitigate the same mkdir/open-by-handle race as in nfs_mkdir(). The same solution applies - unhash the mkdir argument, then call d_splice_alias() and if that returns a reference to preexisting alias, dput() and report success. ->mkdir() argument left unhashed negative with the preexisting alias moved in the right place is just fine from the ->mkdir() callers point of view. Cc: Miklos Szeredi Signed-off-by: Al Viro commit 44ec3ec01fb7d54d1a14c138cb43b90a0e934b89 Author: Gustavo A. R. Silva Date: Wed Aug 1 20:00:56 2018 -0500 ftrace: Use true and false for boolean values in ops_references_rec() Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Link: http://lkml.kernel.org/r/20180802010056.GA31012@embeddedor.com Signed-off-by: Gustavo A. R. Silva Signed-off-by: Steven Rostedt (VMware) commit d7224c0e128c7337c0b0f66ac20921fbbf4efc14 Author: Steven Rostedt (VMware) Date: Wed Aug 1 21:09:50 2018 -0400 ring-buffer: Make ring_buffer_record_is_set_on() return bool The value of ring_buffer_record_is_set_on() is either true or false, so have its return value be bool. Signed-off-by: Steven Rostedt (VMware) commit 3ebea280d7e9b610fa3d31c9cfd556b1705eeedf Author: Steven Rostedt (VMware) Date: Wed Aug 1 21:08:30 2018 -0400 ring-buffer: Make ring_buffer_record_is_on() return bool The value of ring_buffer_record_is_on() is either true or false, so have its return value be bool. Signed-off-by: Steven Rostedt (VMware) commit 6078091c9fa899b0fd7097ae2af933554c2d989f Author: Andy Shevchenko Date: Wed Aug 1 15:47:47 2018 -0700 Input: evdev - switch to bitmap API Switch to bitmap API, i.e. bitmap_alloc(), bitmap_zalloc(), to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. While here, replace memcpy() with bitmap_copy() for sake of consistency. Signed-off-by: Andy Shevchenko Signed-off-by: Dmitry Torokhov commit 4e2ec39ddbf3d78bc3b576a775fd5b4e4ff4af34 Author: Andy Shevchenko Date: Wed Aug 1 15:47:14 2018 -0700 Input: gpio-keys - switch to bitmap_zalloc() Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Signed-off-by: Dmitry Torokhov commit 5d81a787bd4d896238c0c8d73d514290abd1d0d2 Merge: 955c594ed1a7 c42b65e363ce Author: Dmitry Torokhov Date: Wed Aug 1 17:58:55 2018 -0700 Merge branch 'ib/4.17-bitmap' into next Bring in bitmap API improvements. commit 0b4e30f49aa44725cbaefa6e839bd82a768c385a Author: Vadim Pasternak Date: Thu Jul 26 22:41:04 2018 +0000 platform/x86: mlx-platform: Remove unused define Remove unused define MLXPLAT_CPLD_AGGR_MASK_MSN21XX. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit da80c7aece1619c2c299432d3d498885ca6d757b Author: Vadim Pasternak Date: Thu Jul 26 22:41:03 2018 +0000 platform/x86: mlx-platform: Change mlxreg-io configuration for MSN274x systems Change mlxreg-io platform driver configuration for MSN274x system types from the default to MSN21xx. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit a34e134314813c73409f44986b41e03ca57fce3c Author: Vadim Pasternak Date: Thu Jul 26 22:41:02 2018 +0000 Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces The systems of type MSN21xx, MSN201x have a slight difference from the default reset cause bits description, it uses reset_hotswap_or_halt instead of reset_hotswap_or_wd. New attribute is documented. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 2ac24d336c95fb2525574d4fd46f0673d27464e7 Author: Vadim Pasternak Date: Thu Jul 26 22:41:01 2018 +0000 platform/x86: mlx-platform: Allow mlxreg-io driver activation for more systems Allow mlxreg-io platform driver activation for more system types, in particular for MSN21xx, MSN201x types, which have reset causes bits slightly different from the default configuration. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 0404a0b2ca3b88eab1e44b7a1d80c2aeb37fb2f1 Author: Vadim Pasternak Date: Thu Jul 26 22:41:00 2018 +0000 platform/x86: mlx-platform: Add ASIC hotplug device configuration Add support for ASIC hotplug device events for the all system types. The ASIC hotplug event is sent in cases ASIC reaches the good health state or dropped to the bad health state. The health state is used to change, when device is reset or in case of some system failures. In such cases hwmon uevent notification will be sent. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 9272d2d1d3bf5b66242acaeffe442fcd6079624e Author: Vadim Pasternak Date: Thu Jul 26 22:40:59 2018 +0000 platform/mellanox: mlxreg-hotplug: Add hotplug hwmon uevent notification Notify user when hotplug device signal is received in order to allow user to handle such case, if it wishes to take some action on this matter. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 66342d1c9c2460fe7d2d9c75f7e88f14d88318f2 Author: Vadim Pasternak Date: Thu Jul 26 22:40:58 2018 +0000 platform/mellanox: mlxreg-hotplug: Improve mechanism of ASIC health discovery Simplify the logic of ASIC health discovery. ASIC device can indicate its health state as a good, booting or dormant. During ASIC reset the device is dropped to dormant state and should get to the stable good health state through the intermediate booting state. The sequence for getting to the steady state health after reset is: (dormant -> booting -> good)+. Initial implementation assumes that ?good? within this sequence is always repeated twice and device is getting steady state only after the second ?good?. This patch removes this dependency, since the second ?good? is received because of the noise on line and can be ignored. Device reaches steady state after the first ?good? is received. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 0378123c580091b4c2972a6e4fcb3dcb4686667a Author: Vadim Pasternak Date: Thu Jul 26 22:40:57 2018 +0000 platform/x86: mlx-platform: Add mlxreg-fan platform driver activation Add mlxreg-fan platform driver activation. FAN driver uses the same regmap infrastructure as others Mellanox platform drivers. Specific registers description for default FAN platform data configuration are added to mlx-platform. There are the registers for tachometers reading, PWM control and FAN ownership control. The last one has a default value, which is set at initialization time through the regmap infrastructure, which is necessary for moving FAN control ownership from hardware to software. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 59e0b520c75c8b4588395aea6170e551c4189fd8 Author: Christoph Hellwig Date: Tue Jul 31 13:39:35 2018 +0200 kconfig: add a Memory Management options" menu This moves all the options under a proper menu. Based on a patch from Randy Dunlap. Signed-off-by: Christoph Hellwig Tested-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: Masahiro Yamada commit 006477f40d2e79cd1ba655af94fbd9b2a585bfef Author: Christoph Hellwig Date: Tue Jul 31 13:39:34 2018 +0200 kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt No need to have this in the top-level Kconfig. Signed-off-by: Christoph Hellwig Tested-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: Masahiro Yamada commit 22471e1313f2b5ec698069206f3a310d6d35b1d4 Author: Randy Dunlap Date: Tue Jul 31 13:39:33 2018 +0200 kconfig: use a menu in arch/Kconfig to reduce clutter Put everything in arch/Kconfig into a General options menu so that they don't clutter up the main/major/primary list of menu options. Signed-off-by: Randy Dunlap Signed-off-by: Christoph Hellwig Signed-off-by: Masahiro Yamada commit 87a4c375995ed8eaa721b08825cf73d0b02b3145 Author: Christoph Hellwig Date: Tue Jul 31 13:39:32 2018 +0200 kconfig: include kernel/Kconfig.preempt from init/Kconfig Almost all architectures include it. Add a ARCH_NO_PREEMPT symbol to disable preempt support for alpha, hexagon, non-coldfire m68k and user mode Linux. Signed-off-by: Christoph Hellwig Signed-off-by: Masahiro Yamada commit 06ec64b84c357693e9a5540de8eedfc775dbae12 Author: Christoph Hellwig Date: Tue Jul 31 13:39:31 2018 +0200 Kconfig: consolidate the "Kernel hacking" menu Move the source of lib/Kconfig.debug and arch/$(ARCH)/Kconfig.debug to the top-level Kconfig. For two architectures that means moving their arch-specific symbols in that menu into a new arch Kconfig.debug file, and for a few more creating a dummy file so that we can include it unconditionally. Also move the actual 'Kernel hacking' menu to lib/Kconfig.debug, where it belongs. Signed-off-by: Christoph Hellwig Signed-off-by: Masahiro Yamada commit ce1d6f22fa69287f877aca37e275c776ed6e6eb5 Author: Julia Lawall Date: Wed Aug 1 15:57:43 2018 -0700 Input: elan_i2c_smbus - cast sizeof to int for comparison Comparing an int to a size, which is unsigned, causes the int to become unsigned, giving the wrong result. i2c_smbus_read_block_data can return the result of i2c_smbus_xfer, whih can return a negative error code. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ int x; expression e,e1; identifier f; @@ *x = f(...); ... when != x = e1 when != if (x < 0 || ...) { ... return ...; } *x < sizeof(e) // Signed-off-by: Julia Lawall Signed-off-by: Dmitry Torokhov commit 1572497cb0e6d2016078bc9d5a95786bb878389f Author: Christoph Hellwig Date: Tue Jul 31 13:39:30 2018 +0200 kconfig: include common Kconfig files from top-level Kconfig Instead of duplicating the source statements in every architecture just do it once in the toplevel Kconfig file. Note that with this the inclusion of arch/$(SRCARCH/Kconfig moves out of the top-level Kconfig into arch/Kconfig so that don't violate ordering constraits while keeping a sensible menu structure. Signed-off-by: Christoph Hellwig Signed-off-by: Masahiro Yamada commit 17c46a6aff5c423f406adfb06eb832f771c06bd1 Author: Christoph Hellwig Date: Tue Jul 31 13:39:29 2018 +0200 kconfig: remove duplicate SWAP symbol defintions microblaze and nios2 define their own always n SWAP symbols. Remove those and let the generic defintion do the right thing by adding a new symbol to disable swap entirely. Signed-off-by: Christoph Hellwig Signed-off-by: Masahiro Yamada commit 9bea18010f210dd24d2a4f2bd3df7b92132537ae Author: Christoph Hellwig Date: Tue Jul 31 13:39:28 2018 +0200 um: create a proper drivers Kconfig Merge arch/um/Kconfig.char and arch/um/Kconfig.net into a new arch/um/drivers/Kconfig. This fits the way Kconfig files are placed elsewhere in the kernel tree. Signed-off-by: Christoph Hellwig Acked-by: Richard Weinberger Signed-off-by: Masahiro Yamada commit f163977d21a2b380ef83c25df2f83740577dc564 Author: Christoph Hellwig Date: Tue Jul 31 13:39:27 2018 +0200 um: cleanup Kconfig files We can handle all not architecture specific UM configuration directly in the newly added arch/um/Kconfig. Do so by merging the Kconfig.common, Kconfig.rest and Kconfig.um files into arch/um/Kconfig, and move the main UML menu as well. Signed-off-by: Christoph Hellwig Acked-by: Richard Weinberger Signed-off-by: Masahiro Yamada commit 79b05c1f31e2ed3dbc4e1d098a29687f5c39c495 Author: Christoph Hellwig Date: Tue Jul 31 13:39:26 2018 +0200 um: stop abusing KBUILD_KCONFIG Instead create a arch/um/Kconfig file that just includes the actual per-arch Kconfig file. Note that we use HEADER_ARCH to find the per-arch Kconfig file as that variable already includes the normalization from i386 or x86_64 to x86. Signed-off-by: Christoph Hellwig Acked-by: Richard Weinberger Signed-off-by: Masahiro Yamada commit c42b65e363ce97a828f81b59033c3558f8fa7f70 Author: Andy Shevchenko Date: Wed Aug 1 15:42:56 2018 -0700 bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free() A lot of code become ugly because of open coding allocations for bitmaps. Introduce three helpers to allow users be more clear of intention and keep their code neat. Note, due to multiple circular dependencies we may not provide the helpers as inliners. For now we keep them exported and, perhaps, at some point in the future we will sort out header inclusion and inheritance. Signed-off-by: Andy Shevchenko Signed-off-by: Dmitry Torokhov commit e64e4018d572710c44f42c923d4ac059f0a23320 Author: Andy Shevchenko Date: Wed Aug 1 15:20:50 2018 -0700 md: Avoid namespace collision with bitmap API bitmap API (include/linux/bitmap.h) has 'bitmap' prefix for its methods. On the other hand MD bitmap API is special case. Adding 'md' prefix to it to avoid name space collision. No functional changes intended. Signed-off-by: Andy Shevchenko Acked-by: Shaohua Li Signed-off-by: Dmitry Torokhov commit 5cc9cdf631da804510d2d3ab1d97f3d9dd8d632d Author: Andy Shevchenko Date: Wed Aug 1 15:17:58 2018 -0700 dm: Avoid namespace collision with bitmap API bitmap API (include/linux/bitmap.h) has 'bitmap' prefix for its methods. On the other hand DM bitmap API is special case. Adding 'dm' prefix to it to avoid potential name space collision. No functional changes intended. Suggested-by: Mike Snitzer Signed-off-by: Andy Shevchenko Acked-by: Mike Snitzer Signed-off-by: Dmitry Torokhov commit df36b2fb8390d98453fff1aae3927095fe9ff36c Author: Huang Rui Date: Wed Aug 1 13:49:33 2018 +0800 drm/ttm: clean up non-x86 definitions on ttm_tt All non-x86 definitions are moved to ttm_set_memory header, so remove it from ttm_tt.c. Reviewed-by: Christian König Signed-off-by: Huang Rui Signed-off-by: Alex Deucher commit dceb219fc60766006bfe8e53afa62816b94fcb11 Author: Huang Rui Date: Wed Aug 1 13:49:32 2018 +0800 drm/ttm: Add ttm_set_pages_wc and ttm_set_pages_uc helper These two helpers will be used on set page caching. Reviewed-by: Christian König Signed-off-by: Huang Rui Signed-off-by: Alex Deucher commit fe710322b81343601ca1759a9f3d4b694ed72fca Author: Huang Rui Date: Wed Aug 1 13:49:31 2018 +0800 drm/ttm: fix missed conversion of set_pages_array_uc This patch fixed the error when do not configure CONFIG_X86, otherwise, below error will be encountered. All errors (new ones prefixed by >>): drivers/gpu/drm/ttm/ttm_page_alloc_dma.c: In function 'ttm_set_pages_caching': >> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c:272:7: error: implicit declaration of function 'set_pages_array_uc'; did you mean +'ttm_set_pages_array_uc'? [-Werror=implicit-function-declaration] r = set_pages_array_uc(pages, cpages); ^~~~~~~~~~~~~~~~~~ ttm_set_pages_array_uc cc1: some warnings being treated as errors Reported-by: kbuild test robot Reviewed-by: Christian König Signed-off-by: Huang Rui Signed-off-by: Alex Deucher commit 75da96067ade4e7854379ec2f7834f3497652b1a Author: Denis Drozdov Date: Sun Jul 29 11:42:28 2018 +0300 IB/IPoIB: Set ah valid flag in multicast send flow The change of ipoib_ah data structure with adding "valid" flag and checks of ah->valid in ipoib_start_xmit affected multicast packet flow. Since the multicast flow doesn't invoke path_rec_start, "ah->valid" flag remains unset, so that ipoib_start_xmit end up with neigh_refresh_path instead of sending the packet using neigh. "ah->valid" has to be set in multicast send flow. As a result IPoIB starts sending packets via neigh immediately and eliminates 60sec delay of neigh keep alive interval. The typical example of this issue are two sequential arpings: arping 11.134.208.9 -> got response (mcast_send) arping 11.134.208.9 -> no response (ah->valid = 0) Fixes: fa9391dbad4b ("RDMA/ipoib: Update paths on CLIENT_REREG/SM_CHANGE events") Signed-off-by: Denis Drozdov Reviewed-by: Erez Shitrit Reviewed-by: Feras Daoud Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 19da44cd33a3a6ff7c97fff0189999ff15b241e4 Author: Dan Carpenter Date: Fri Jul 13 17:55:15 2018 +0300 pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show() The info->groups[] array is allocated in imx1_pinctrl_parse_dt(). It has info->ngroups elements. Thus the > here should be >= to prevent reading one element beyond the end of the array. Cc: stable@vger.kernel.org Fixes: 30612cd90005 ("pinctrl: imx1 core driver") Signed-off-by: Dan Carpenter Reviewed-by: Uwe Kleine-König Acked-by: Dong Aisheng Signed-off-by: Linus Walleij commit 0f50d88a6e9ae6d9dd14ed1a7d6b309280a9c23b Author: Jason Gunthorpe Date: Wed Jul 25 21:40:20 2018 -0600 IB/uverbs: Allow all DESTROY commands to succeed after disassociate The disassociate function was broken by design because it failed all commands. This prevents userspace from calling destroy on a uobject after it has detected a device fatal error and thus reclaiming the resources in userspace is prevented. This fix is now straightforward, when anything destroys a uobject that is not the user the object remains on the IDR with a NULL context and object pointer. All lookup locking modes other than DESTROY will fail. When the user ultimately calls the destroy function it is simply dropped from the IDR while any related information is returned. Signed-off-by: Jason Gunthorpe commit a9b66d6453d70ee01f11bdae40d68996cee7474a Author: Jason Gunthorpe Date: Wed Jul 25 21:40:19 2018 -0600 IB/uverbs: Do not block disassociate during write() Now that all the callbacks are safe to run concurrently with disassociation this test can be eliminated. The ufile core infrastructure becomes entirely self contained and is not sensitive to disassociation. Signed-off-by: Jason Gunthorpe commit e83f0ecdc40f2c3d63ff0e7f17462a29d12684a2 Author: Jason Gunthorpe Date: Wed Jul 25 21:40:18 2018 -0600 IB/uverbs: Do not pass struct ib_device to the ioctl methods This does the same as the patch before, except for ioctl. The rules are the same, but for the ioctl methods the core code handles setting up the uobject. - Retrieve the ib_dev from the uobject->context->device. This is safe under ioctl as the core has already done rdma_alloc_begin_uobject and so CREATE calls are entirely protected by the rwsem. - Retrieve the ib_dev from uobject->object - Call ib_uverbs_get_ucontext() Signed-off-by: Jason Gunthorpe commit bbd51e881ff05aa6dccda025e335438f3b3a1dba Author: Jason Gunthorpe Date: Wed Jul 25 21:40:17 2018 -0600 IB/uverbs: Do not pass struct ib_device to the write based methods This is a step to get rid of the global check for disassociation. In this model, the ib_dev is not proven to be valid by the core code and cannot be provided to the method. Instead, every method decides if it is able to run after disassociation and obtains the ib_dev using one of three different approaches: - Call srcu_dereference on the udevice's ib_dev. As before, this means the method cannot be called after disassociation begins. (eg alloc ucontext) - Retrieve the ib_dev from the ucontext, via ib_uverbs_get_ucontext() - Retrieve the ib_dev from the uobject->object after checking under SRCU if disassociation has started (eg uobj_get) Largely, the code is all ready for this, the main work is to provide a ib_dev after calling uobj_alloc(). The few other places simply use ib_uverbs_get_ucontext() to get the ib_dev. This flexibility will let the next patches allow destroy to operate after disassociation. Signed-off-by: Jason Gunthorpe commit cc2e14e68004e6dec70842f990085f67c1f6fec7 Author: Jason Gunthorpe Date: Wed Jul 25 21:40:16 2018 -0600 IB/uverbs: Lower the test for ongoing disassociation Commands that are reading/writing to objects can test for an ongoing disassociation during their initial call to rdma_lookup_get_uobject. This directly prevents all of these commands from conflicting with an ongoing disassociation. Signed-off-by: Jason Gunthorpe commit 1e857e65d4bb76738d3fb3b15ce9b73a0ce550f8 Author: Jason Gunthorpe Date: Wed Jul 25 21:40:15 2018 -0600 IB/uverbs: Allow uobject allocation to work concurrently with disassociate After all the recent structural changes this is now straightforward, hold the hw_destroy_rwsem across the entire uobject creation. We already take this semaphore on the success path, so holding it a bit longer is not going to change the performance. After this change none of the create callbacks require the disassociate_srcu lock to be correct. Signed-off-by: Jason Gunthorpe commit 7452a3c745a2e7eb70d09dc5bb870759b1f26c91 Author: Jason Gunthorpe Date: Wed Jul 25 21:40:14 2018 -0600 IB/uverbs: Allow RDMA_REMOVE_DESTROY to work concurrently with disassociate After all the recent structural changes this is now straightfoward, hoist the hw_destroy_rwsem up out of rdma_destroy_explicit and wrap it around the uobject write lock as well as the destroy. This is necessary as obtaining a write lock concurrently with uverbs_destroy_ufile_hw() will cause malfunction. After this change none of the destroy callbacks require the disassociate_srcu lock to be correct. This requires introducing a new lookup mode, UVERBS_LOOKUP_DESTROY as the IOCTL interface needs to hold an unlocked kref until all command verification is completed. Signed-off-by: Jason Gunthorpe commit 9867f5c6695f0a17cde9a4dc140fe026b4e40d4a Author: Jason Gunthorpe Date: Wed Jul 25 21:40:13 2018 -0600 IB/uverbs: Convert 'bool exclusive' into an enum This is more readable, and future patches will need a 3rd lookup type. Signed-off-by: Jason Gunthorpe commit 87ad80abc70d2d5a4e383bc7e63867c9bc660838 Author: Jason Gunthorpe Date: Wed Jul 25 21:40:12 2018 -0600 IB/uverbs: Consolidate uobject destruction There are several flows that can destroy a uobject and each one is minimized and sprinkled throughout the code base, making it difficult to understand and very hard to modify the destroy path. Consolidate all of these into uverbs_destroy_uobject() and call it in all cases where a uobject has to be destroyed. This makes one change to the lifecycle, during any abort (eg when alloc_commit is not called) we always call out to alloc_abort, even if remove_commit needs to be called to delete a HW object. This also renames RDMA_REMOVE_DURING_CLEANUP to RDMA_REMOVE_ABORT to clarify its actual usage and revises some of the comments to reflect what the life cycle is for the type implementation. Signed-off-by: Jason Gunthorpe commit 32ed5c00ac5fdea49058fd49bf8707e101dc3dfe Author: Jason Gunthorpe Date: Wed Jul 25 21:40:11 2018 -0600 IB/uverbs: Make the write path destroy methods use the same flow as ioctl The ridiculous dance with uobj_remove_commit() is not needed, the write path can follow the same flow as ioctl - lock and destroy the HW object then use the data left over in the uobject to form the response to userspace. Two helpers are introduced to make this flow straightforward for the caller. Signed-off-by: Jason Gunthorpe commit aa72c9a5f986444f5e245767402ed1f3066fca2c Author: Jason Gunthorpe Date: Thu Jul 26 15:57:56 2018 -0600 IB/uverbs: Remove rdma_explicit_destroy() from the ioctl methods The core code will destroy the HW object on behalf of the method, if the method provides an implementation it must simply copy data from the stub uobj into the response. Destroy methods cannot touch the HW object. Signed-off-by: Jason Gunthorpe commit 93ce1b12966d9d60ee5583ffbde822a22909568e Author: Takashi Iwai Date: Wed Aug 1 16:43:56 2018 +0200 ALSA: seq: Drop unused 64bit division macros The old ugly macros remained in the code without usage. Rip them off. Signed-off-by: Takashi Iwai commit 04702e8d0092832eaeeacc6b1bfbf81a66f242c9 Author: Takashi Iwai Date: Wed Aug 1 16:42:29 2018 +0200 ALSA: seq: Use no intrruptible mutex_lock All usages of mutex in ALSA sequencer core would take too long, hence we don't have to care about the user interruption that makes things complicated. Let's replace them with simpler mutex_lock(). Signed-off-by: Takashi Iwai commit 00976ad5271999ba06d24319fd1031b178aff832 Author: Takashi Iwai Date: Wed Aug 1 16:37:02 2018 +0200 ALSA: seq: Fix leftovers at probe error path The sequencer core module doesn't call some destructors in the error path of the init code, which may leave some resources. This patch mainly fix these leaks by calling the destructors appropriately at alsa_seq_init(). Also the patch brings a few cleanups along with it, namely: - Expand the old "if ((err = xxx) < 0)" coding style - Get rid of empty seq_queue_init() and its caller - Change snd_seq_info_done() to void Last but not least, a couple of functions lose __exit annotation since they are called also in alsa_seq_init(). No functional changes but minor code cleanups. Signed-off-by: Takashi Iwai commit fc4bfd9a35f3d9cbf5ad6a20faedca71d1d9ed52 Author: Takashi Iwai Date: Wed Aug 1 14:59:07 2018 +0200 ALSA: seq: Remove dead codes There are a few functions that have been commented out for ages. And also there are functions that do nothing but placeholders. Let's kill them. Signed-off-by: Takashi Iwai commit ef965ad5a7697ff16e3be01954f5c57208e36c22 Author: Takashi Iwai Date: Wed Aug 1 14:38:18 2018 +0200 ALSA: seq: Minor cleanup of MIDI event parser helpers snd_midi_event_encode_byte() can never fail, and it can return rather true/false. Change the return type to bool, adjust the argument to receive a MIDI byte as unsigned char, and adjust the comment accordingly. This allows callers to drop error checks, which simplifies the code. Meanwhile, snd_midi_event_encode() helper is used only in seq_midi.c, and it can be better folded into it. This will reduce the total amount of lines in the end. Signed-off-by: Takashi Iwai commit db57dc7c7a5c42bb653425a01b6d73c49514b5db Author: Vincent Bernat Date: Wed Aug 1 22:05:10 2018 +0200 net: don't declare IPv6 non-local bind helper if CONFIG_IPV6 undefined Fixes: 83ba4645152d ("net: add helpers checking if socket can be bound to nonlocal address") Signed-off-by: Vincent Bernat Signed-off-by: David S. Miller commit 48ae93fdd133849cf8e0a46a525cb09229933c8b Author: Paul Burton Date: Wed Aug 1 13:15:18 2018 -0700 MIPS: Delete unused code in linux32.c The A() & AA() macros have been unused since commit 05e4396651ca ("[MIPS] Use SYSVIPC_COMPAT to fix various problems on N32"), which switched to the more standard compat_ptr(). RLIM_INFINITY32, RESOURCE32() & struct rlimit32 have been present but unused since the beginning of the git era. Remove the dead code. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20108/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 3a1c0fc5927f001d2c70998c08cad42ee5f64849 Author: Paul Burton Date: Wed Aug 1 13:15:17 2018 -0700 MIPS: Remove unused sys_32_mmap2 The sys_32_mmap2 function has been unused since we started using syscall wrappers in commit dbda6ac08976 ("MIPS: CVE-2009-0029: Enable syscall wrappers."), and is indeed identical to the sys_mips_mmap2 function that replaced it in sys32_call_table. Remove the dead code. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20107/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 96a68b14db358c310e1c5cc5229752845192c1fa Author: Paul Burton Date: Wed Aug 1 13:12:42 2018 -0700 MIPS: Remove nabi_no_regargs Our sigreturn functions make use of a macro named nabi_no_regargs to declare 8 dummy arguments to a function, forcing the compiler to expect a pt_regs structure on the stack rather than in argument registers. This is an ugly hack which unnecessarily causes these sigreturn functions to need to care about the calling convention of the ABI the kernel is built for. Although this is abstracted via nabi_no_regargs, it's still ugly & unnecessary. Remove nabi_no_regargs & the struct pt_regs argument from sigreturn functions, and instead use current_pt_regs() to find the struct pt_regs on the stack, which works cleanly regardless of ABI. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20106/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit ec57350883cd7fccd867b0d2260bac3a9bf6442d Author: Steven Rostedt (VMware) Date: Wed Aug 1 16:08:57 2018 -0400 tracing: Make tracer_tracing_is_on() return bool There's code that expects tracer_tracing_is_on() to be either true or false, not some random number. Currently, it should only return one or zero, but just in case, change its return value to bool, to enforce it. Signed-off-by: Steven Rostedt (VMware) commit 978defee11a5d54f8f546e79867d2aab1b50606b Author: Steven Rostedt (VMware) Date: Wed Aug 1 16:06:02 2018 -0400 tracing: Do a WARN_ON() if start_thread() in hwlat is called when thread exists The start function of the hwlat tracer should never be called when the hwlat thread already exists. If it is called, do a WARN_ON(). Signed-off-by: Steven Rostedt (VMware) commit 82fbc8c48adffd73297e7edbd7266a89d00cc52f Author: Erica Bugden Date: Wed Aug 1 12:45:54 2018 +0200 ftrace: Add missing check for existing hwlat thread The hwlat tracer uses a kernel thread to measure latencies. The function that creates this kernel thread, start_kthread(), can be called when the tracer is initialized and when the tracer is explicitly enabled. start_kthread() does not check if there is an existing hwlat kernel thread and will create a new one each time it is called. This causes the reference to the previous thread to be lost. Without the thread reference, the old kernel thread becomes unstoppable and continues to use CPU time even after the hwlat tracer has been disabled. This problem can be observed when a system is booted with tracing enabled and the hwlat tracer is configured like this: echo hwlat > current_tracer; echo 1 > tracing_on Add the missing check for an existing kernel thread in start_kthread() to prevent this problem. This function and the rest of the hwlat kernel thread setup and teardown are already serialized because they are called through the tracer core code with trace_type_lock held. [ Note, this only fixes the symptom. The real fix was not to call this function when tracing_on was already one. But this still makes the code more robust, so we'll add it. ] Link: http://lkml.kernel.org/r/1533120354-22923-1-git-send-email-erica.bugden@linutronix.de Signed-off-by: Erica Bugden Signed-off-by: Steven Rostedt (VMware) commit f143641bfef9a4a60c57af30de26c63057e7e695 Author: Steven Rostedt (VMware) Date: Wed Aug 1 15:40:57 2018 -0400 tracing: Do not call start/stop() functions when tracing_on does not change Currently, when one echo's in 1 into tracing_on, the current tracer's "start()" function is executed, even if tracing_on was already one. This can lead to strange side effects. One being that if the hwlat tracer is enabled, and someone does "echo 1 > tracing_on" into tracing_on, the hwlat tracer's start() function is called again which will recreate another kernel thread, and make it unable to remove the old one. Link: http://lkml.kernel.org/r/1533120354-22923-1-git-send-email-erica.bugden@linutronix.de Cc: stable@vger.kernel.org Fixes: 2df8f8a6a897e ("tracing: Fix regression with irqsoff tracer and tracing_on file") Reported-by: Erica Bugden Signed-off-by: Steven Rostedt (VMware) commit b912885ab75c7c8aa841c615108afd755d0b97f8 Author: Arnaldo Carvalho de Melo Date: Wed Aug 1 16:20:28 2018 -0300 perf trace: Do not require --no-syscalls to suppress strace like output So far the --syscalls option was the default, requiring explicit --no-syscalls when wanting to process just some other event, invert that and assume it only when no other event was specified, allowing its explicit enablement when wanting to see all syscalls together with some other event: E.g: The existing default is maintained for a single workload: # perf trace sleep 1 0.264 ( 0.003 ms): sleep/12762 mmap(len: 113045344, prot: READ, flags: PRIVATE, fd: 3) = 0x7f62cbf04000 0.271 ( 0.001 ms): sleep/12762 close(fd: 3) = 0 0.295 (1000.130 ms): sleep/12762 nanosleep(rqtp: 0x7ffd15194fd0) = 0 1000.469 ( 0.006 ms): sleep/12762 close(fd: 1) = 0 1000.480 ( 0.004 ms): sleep/12762 close(fd: 2) = 0 1000.502 ( ): sleep/12762 exit_group() # For a pid: # pidof ssh 7826 3961 3226 2628 2493 # perf trace -p 3961 ? ( ): ... [continued]: select()) = 1 0.023 ( 0.005 ms): clock_gettime(which_clock: BOOTTIME, tp: 0x7ffcc8fce870 ) = 0 0.036 ( 0.009 ms): read(fd: 5, buf: 0x7ffcc8fca7b0, count: 16384 ) = 3 0.060 ( 0.004 ms): getpid( ) = 3961 (ssh) 0.079 ( 0.004 ms): clock_gettime(which_clock: BOOTTIME, tp: 0x7ffcc8fce8e0 ) = 0 0.088 ( 0.003 ms): clock_gettime(which_clock: BOOTTIME, tp: 0x7ffcc8fce7c0 ) = 0 For system wide, threads, cgroups, user, etc when no event is specified, the existing behaviour is maintained, i.e. --syscalls is selected. When some event is specified, then --no-syscalls doesn't need to be specified: # perf trace -e tcp:tcp_probe ssh localhost 0.000 tcp:tcp_probe:src=[::1]:22 dest=[::1]:39074 mark=0 length=53 snd_nxt=0xb67ce8f7 snd_una=0xb67ce8f7 snd_cwnd=10 ssthresh=2147483647 snd_wnd=43776 srtt=18 rcv_wnd=43690 0.010 tcp:tcp_probe:src=[::1]:39074 dest=[::1]:22 mark=0 length=32 snd_nxt=0xa8f9ef38 snd_una=0xa8f9ef23 snd_cwnd=10 ssthresh=2147483647 snd_wnd=43690 srtt=31 rcv_wnd=43776 4.525 tcp:tcp_probe:src=[::1]:22 dest=[::1]:39074 mark=0 length=1240 snd_nxt=0xb67ce90c snd_una=0xb67ce90c snd_cwnd=10 ssthresh=2147483647 snd_wnd=43776 srtt=18 rcv_wnd=43776 7.242 tcp:tcp_probe:src=[::1]:22 dest=[::1]:39074 mark=0 length=80 snd_nxt=0xb67ced44 snd_una=0xb67ce90c snd_cwnd=10 ssthresh=2147483647 snd_wnd=43776 srtt=18 rcv_wnd=174720 The authenticity of host 'localhost (::1)' can't be established. ECDSA key fingerprint is SHA256:TKZS58923458203490asekfjaklskljmkjfgPMBfHzY. ECDSA key fingerprint is MD5:d8:29:54:40:71:fa:b8:44:89:52:64:8a:35:42:d0:e8. Are you sure you want to continue connecting (yes/no)? ^C # To get the previous behaviour just use --syscalls and get all syscalls formatted strace like + the specified extra events: # trace -e sched:*switch --syscalls sleep 1 0.160 ( 0.003 ms): sleep/12877 mprotect(start: 0x7fdfe2361000, len: 4096, prot: READ) = 0 0.164 ( 0.009 ms): sleep/12877 munmap(addr: 0x7fdfe2345000, len: 113155) = 0 0.211 ( 0.001 ms): sleep/12877 brk() = 0x55d3ce68e000 0.212 ( 0.002 ms): sleep/12877 brk(brk: 0x55d3ce6af000) = 0x55d3ce6af000 0.215 ( 0.001 ms): sleep/12877 brk() = 0x55d3ce6af000 0.219 ( 0.004 ms): sleep/12877 open(filename: 0xe1f07c00, flags: CLOEXEC) = 3 0.225 ( 0.001 ms): sleep/12877 fstat(fd: 3, statbuf: 0x7fdfe2138aa0) = 0 0.227 ( 0.003 ms): sleep/12877 mmap(len: 113045344, prot: READ, flags: PRIVATE, fd: 3) = 0x7fdfdb1b8000 0.234 ( 0.001 ms): sleep/12877 close(fd: 3) = 0 0.257 ( ): sleep/12877 nanosleep(rqtp: 0x7fffb36b6020) ... 0.260 ( ): sched:sched_switch:prev_comm=sleep prev_pid=12877 prev_prio=120 prev_state=D ==> next_comm=swapper/3 next_pid=0 next_prio=120 0.257 (1000.134 ms): sleep/12877 ... [continued]: nanosleep()) = 0 1000.428 ( 0.006 ms): sleep/12877 close(fd: 1) = 0 1000.440 ( 0.004 ms): sleep/12877 close(fd: 2) = 0 1000.461 ( ): sleep/12877 exit_group() # When specifiying just some syscalls, the behaviour doesn't change, i.e.: # trace -e nanosleep -e sched:*switch sleep 1 0.000 ( ): sleep/14974 nanosleep(rqtp: 0x7ffc344ba9c0 ) ... 0.007 ( ): sched:sched_switch:prev_comm=sleep prev_pid=14974 prev_prio=120 prev_state=D ==> next_comm=swapper/2 next_pid=0 next_prio=120 0.000 (1000.139 ms): sleep/14974 ... [continued]: nanosleep()) = 0 # Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-om2fulll97ytnxv40ler8jkf@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 82cf4f132e6d16dca6fc3bd955019246141bc645 Author: Chao Yu Date: Fri Jul 27 18:15:14 2018 +0800 f2fs: fix to active page in lru list for read path If config CONFIG_F2FS_FAULT_INJECTION is on, for both read or write path we will call find_lock_page() to get the page, but for read path, it missed to passing FGP_ACCESSED to allocator to active the page in LRU list, result in being reclaimed in advance incorrectly, fix it. Reported-by: Xianrong Zhou Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 18767e62639622554c3642a6e3f3b0ca19bc1d9d Author: Chao Yu Date: Fri Jul 27 18:15:13 2018 +0800 f2fs: don't keep meta pages used for block migration For migration of encrypted inode's block, we load data of encrypted block into meta inode's page cache, after checkpoint, those all intermediate pages should be clean, and no one will read them again, so let's just release them for more memory. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4ddc1b28aac57a90c6426d55e0dea3c1b5eb4782 Author: Chao Yu Date: Thu Jul 26 07:19:48 2018 +0800 f2fs: fix to restrict mount condition when without CONFIG_QUOTA Like quota_ino feature, we need to reject mounting RDWR with image which enables project_quota feature when there is no CONFIG_QUOTA be set in kernel. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 00960c2cd8f169e38700956d3e7ff07bfa4d7b3b Author: Sheng Yong Date: Tue Jul 24 20:17:52 2018 +0800 f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled If quota feature is enabled, quota is on by default. However, if CONFIG_QUOTA is not built in kernel, dquot entries will not get updated, which leads to quota inconsistency. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 76cf05d79c9ef02d5afa77abaf9b109afde794c4 Author: Sheng Yong Date: Thu Jul 26 19:24:25 2018 +0800 f2fs: quota: fix incorrect comments Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 955ac6e523444493298016523788bb7ec1a2f06e Author: Sheng Yong Date: Tue Jul 24 20:17:53 2018 +0800 f2fs: quota: decrease the lock granularity of statfs_project According to fs/quota/dquot.c, `dq_data_lock' protects mem_dqinfo structures and modifications of dquot pointers in the inode, and `dquot->dq_dqb_lock' protects data from dq_dqb. We should use dquot->dq_dqb_lock in statfs_project instead of dq_dat_lock. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 970e348d9829e9fc3091da2fe189ab34a07201e6 Author: Yunlong Song Date: Mon Jul 23 22:10:22 2018 +0800 f2fs: add proc entry to show victim_secmap bitmap This patch adds a new proc entry to show victim_secmap information in more detail, which is very helpful to know the get_victim candidate status clearly, and helpful to debug problems (e.g., some sections can not gc all of its blocks, since some blocks belong to atomic file, leaving victim_secmap with section bit setting, in extrem case, this will lead all bytes of victim_secmap setting with 0xff). Signed-off-by: Yunlong Song Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit fd8c8caf7e7c8261a92ce0f7f2cd0adb8afd9e0d Author: Chao Yu Date: Wed Jul 25 19:16:21 2018 +0800 f2fs: let checkpoint flush dnode page of regular Fsyncer will wait on all dnode pages of regular writeback before flushing, if there are async dnode pages blocked by IO scheduler, it may decrease fsync's performance. In this patch, we choose to let f2fs_balance_fs_bg() to trigger checkpoint to flush these dnode pages of regular, so async IO of dnode page can be elimitnated, making fsyncer only need to wait for sync IO. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ad6672bbc527727dc8968e8d92687f55ae928ce5 Author: Yunlong Song Date: Thu Jul 19 20:58:15 2018 +0800 f2fs: issue discard align to section in LFS mode For the case when sbi->segs_per_sec > 1 with lfs mode, take section:segment = 5 for example, if the section prefree_map is ...previous section | current section (1 1 0 1 1) | next section..., then the start = x, end = x + 1, after start = start_segno + sbi->segs_per_sec, start = x + 5, then it will skip x + 3 and x + 4, but their bitmap is still set, which will cause duplicated f2fs_issue_discard of this same section in the next write_checkpoint: round 1: section bitmap : 1 1 1 1 1, all valid, prefree_map: 0 0 0 0 0 then rm data block NO.2, block NO.2 becomes invalid, prefree_map: 0 0 1 0 0 write_checkpoint: section bitmap: 1 1 0 1 1, prefree_map: 0 0 0 0 0, prefree of NO.2 is cleared, and no discard issued round 2: rm data block NO.0, NO.1, NO.3, NO.4 all invalid, but prefree bit of NO.2 is set and cleared in round 1, then prefree_map: 1 1 0 1 1 write_checkpoint: section bitmap: 0 0 0 0 0, prefree_map: 0 0 0 1 1, no valid blocks of this section, so discard issued, but this time prefree bit of NO.3 and NO.4 is skipped due to start = start_segno + sbi->segs_per_sec; round 3: write_checkpoint: section bitmap: 0 0 0 0 0, prefree_map: 0 0 0 1 1 -> 0 0 0 0 0, no valid blocks of this section, so discard issued, this time prefree bit of NO.3 and NO.4 is cleared, but the discard of this section is sent again... To fix this problem, we can align the start and end value to section boundary for fstrim and real-time discard operation, and decide to issue discard only when the whole section is invalid, which can issue discard aligned to section size as much as possible and avoid redundant discard. Signed-off-by: Yunlong Song Signed-off-by: Chao Yu Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 455e3a5887ee7ebec5c885a8f398c2c3c0a33165 Author: Jaegeuk Kim Date: Fri Jul 27 18:15:11 2018 +0900 f2fs: don't allow any writes on aborted atomic writes In order to prevent abusing atomic writes by abnormal users, we've added a threshold, 20% over memory footprint, which disallows further atomic writes. Previously, however, SQLite doesn't know the files became normal, so that it could write stale data and commit on revoked normal database file. Once f2fs detects such the abnormal behavior, this patch tries to avoid further writes in write_begin(). Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 797c1cb56ba58bf42742e9446226345a6216d832 Author: Chao Yu Date: Thu Jul 19 23:57:54 2018 +0800 f2fs: restrict setting up inode.i_advise In order to give advise to f2fs to recognize hot/cold file, it is possible that we can set specific bit in inode.i_advise through setxattr(), but there are several bits which are used internally, such as encrypt_bit, keep_size_bit, they should never be changed through setxattr(). So that this patch 1) adds FADVISE_MODIFIABLE_BITS to filter modifiable bits user given, 2) supports to clear {hot,cold}_file bits. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e6b0b159cf2f62de69561f585fe8515d3d9189d4 Author: Yunlei He Date: Thu Jul 19 14:57:14 2018 +0800 f2fs: fix wrong kernel message when recover fsync data on ro fs This patch fix wrong message info for recover fsync data on readonly fs. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 059c0648c6aeb254f5258eb6b058949ef49cb993 Author: Chao Yu Date: Tue Jul 17 20:41:49 2018 +0800 f2fs: clean up ioctl interface naming Romve redundant prefix 'f2fs_' in the middle of f2fs_ioc_f2fs_write_checkpoint(). Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2079f115e7b6172eb65d2338136117c37a0e284f Author: Chao Yu Date: Tue Jul 17 20:41:48 2018 +0800 f2fs: clean up with f2fs_is_{atomic,volatile}_file() Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 5b72d5e0df787c38cbd9c3e31c5ed197928ef612 Author: Chao Yu Date: Tue Jul 17 20:41:47 2018 +0800 f2fs: clean up with f2fs_encrypted_inode() Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 80551d1773801d5ebe71803cd8c469b8337992e0 Author: Chao Yu Date: Tue Jul 17 20:41:46 2018 +0800 f2fs: clean up with get_current_nat_page Just cleanup, no logic change. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6122003a1a612a315c719c6418a527442684903d Author: Chao Yu Date: Tue Jul 17 20:41:45 2018 +0800 f2fs: kill EXT_TREE_VEC_SIZE Since commit 201ef5e080c9 ("f2fs: improve shrink performance of extent nodes"), there is no user of EXT_TREE_VEC_SIZE, just kill it for cleanup. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 5d3ce4f70172160625e9c18600fa3b929781c4fd Author: Hyunchul Lee Date: Thu Jul 19 09:23:57 2018 +0900 f2fs: avoid duplicated permission check for "trusted." xattrs Because xattr_permission already checks CAP_SYS_ADMIN capability, we don't need to check it. Signed-off-by: Hyunchul Lee Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 7735730d39d75e70476c1b01435b9b1f41637f0e Author: Chao Yu Date: Tue Jul 17 00:02:17 2018 +0800 f2fs: fix to propagate error from __get_meta_page() If caller of __get_meta_page() can handle error, let's propagate error from __get_meta_page(). Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 18dd6470c2d14d10f5a2dd926925dc80dbd3abfd Author: Chao Yu Date: Sun Jul 8 22:16:55 2018 +0800 f2fs: fix to do sanity check with i_extra_isize If inode.i_extra_isize was fuzzed to an abnormal value, when calculating inline data size, the result will overflow, result in accessing invalid memory area when operating inline data. Let's do sanity check with i_extra_isize during inode loading for fixing. https://bugzilla.kernel.org/show_bug.cgi?id=200421 - Reproduce - POC (poc.c) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void activity(char *mpoint) { char *foo_bar_baz; char *foo_baz; char *xattr; int err; err = asprintf(&foo_bar_baz, "%s/foo/bar/baz", mpoint); err = asprintf(&foo_baz, "%s/foo/baz", mpoint); err = asprintf(&xattr, "%s/foo/bar/xattr", mpoint); rename(foo_bar_baz, foo_baz); char buf2[113]; memset(buf2, 0, sizeof(buf2)); listxattr(xattr, buf2, sizeof(buf2)); removexattr(xattr, "user.mime_type"); } int main(int argc, char *argv[]) { activity(argv[1]); return 0; } - Kernel message Umount the image will leave the following message [ 2910.995489] F2FS-fs (loop0): Mounted with checkpoint version = 2 [ 2918.416465] ================================================================== [ 2918.416807] BUG: KASAN: slab-out-of-bounds in f2fs_iget+0xcb9/0x1a80 [ 2918.417009] Read of size 4 at addr ffff88018efc2068 by task a.out/1229 [ 2918.417311] CPU: 1 PID: 1229 Comm: a.out Not tainted 4.17.0+ #1 [ 2918.417314] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 2918.417323] Call Trace: [ 2918.417366] dump_stack+0x71/0xab [ 2918.417401] print_address_description+0x6b/0x290 [ 2918.417407] kasan_report+0x28e/0x390 [ 2918.417411] ? f2fs_iget+0xcb9/0x1a80 [ 2918.417415] f2fs_iget+0xcb9/0x1a80 [ 2918.417422] ? f2fs_lookup+0x2e7/0x580 [ 2918.417425] f2fs_lookup+0x2e7/0x580 [ 2918.417433] ? __recover_dot_dentries+0x400/0x400 [ 2918.417447] ? legitimize_path.isra.29+0x5a/0xa0 [ 2918.417453] __lookup_slow+0x11c/0x220 [ 2918.417457] ? may_delete+0x2a0/0x2a0 [ 2918.417475] ? deref_stack_reg+0xe0/0xe0 [ 2918.417479] ? __lookup_hash+0xb0/0xb0 [ 2918.417483] lookup_slow+0x3e/0x60 [ 2918.417488] walk_component+0x3ac/0x990 [ 2918.417492] ? generic_permission+0x51/0x1e0 [ 2918.417495] ? inode_permission+0x51/0x1d0 [ 2918.417499] ? pick_link+0x3e0/0x3e0 [ 2918.417502] ? link_path_walk+0x4b1/0x770 [ 2918.417513] ? _raw_spin_lock_irqsave+0x25/0x50 [ 2918.417518] ? walk_component+0x990/0x990 [ 2918.417522] ? path_init+0x2e6/0x580 [ 2918.417526] path_lookupat+0x13f/0x430 [ 2918.417531] ? trailing_symlink+0x3a0/0x3a0 [ 2918.417534] ? do_renameat2+0x270/0x7b0 [ 2918.417538] ? __kasan_slab_free+0x14c/0x190 [ 2918.417541] ? do_renameat2+0x270/0x7b0 [ 2918.417553] ? kmem_cache_free+0x85/0x1e0 [ 2918.417558] ? do_renameat2+0x270/0x7b0 [ 2918.417563] filename_lookup+0x13c/0x280 [ 2918.417567] ? filename_parentat+0x2b0/0x2b0 [ 2918.417572] ? kasan_unpoison_shadow+0x31/0x40 [ 2918.417575] ? kasan_kmalloc+0xa6/0xd0 [ 2918.417593] ? strncpy_from_user+0xaa/0x1c0 [ 2918.417598] ? getname_flags+0x101/0x2b0 [ 2918.417614] ? path_listxattr+0x87/0x110 [ 2918.417619] path_listxattr+0x87/0x110 [ 2918.417623] ? listxattr+0xc0/0xc0 [ 2918.417637] ? mm_fault_error+0x1b0/0x1b0 [ 2918.417654] do_syscall_64+0x73/0x160 [ 2918.417660] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 2918.417676] RIP: 0033:0x7f2f3a3480d7 [ 2918.417677] Code: f0 ff ff 73 01 c3 48 8b 0d be dd 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 c2 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 91 dd 2b 00 f7 d8 64 89 01 48 [ 2918.417732] RSP: 002b:00007fff4095b7d8 EFLAGS: 00000206 ORIG_RAX: 00000000000000c2 [ 2918.417744] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2f3a3480d7 [ 2918.417746] RDX: 0000000000000071 RSI: 00007fff4095b810 RDI: 000000000126a0c0 [ 2918.417749] RBP: 00007fff4095b890 R08: 000000000126a010 R09: 0000000000000000 [ 2918.417751] R10: 00000000000001ab R11: 0000000000000206 R12: 00000000004005e0 [ 2918.417753] R13: 00007fff4095b990 R14: 0000000000000000 R15: 0000000000000000 [ 2918.417853] Allocated by task 329: [ 2918.418002] kasan_kmalloc+0xa6/0xd0 [ 2918.418007] kmem_cache_alloc+0xc8/0x1e0 [ 2918.418023] mempool_init_node+0x194/0x230 [ 2918.418027] mempool_init+0x12/0x20 [ 2918.418042] bioset_init+0x2bd/0x380 [ 2918.418052] blk_alloc_queue_node+0xe9/0x540 [ 2918.418075] dm_create+0x2c0/0x800 [ 2918.418080] dev_create+0xd2/0x530 [ 2918.418083] ctl_ioctl+0x2a3/0x5b0 [ 2918.418087] dm_ctl_ioctl+0xa/0x10 [ 2918.418092] do_vfs_ioctl+0x13e/0x8c0 [ 2918.418095] ksys_ioctl+0x66/0x70 [ 2918.418098] __x64_sys_ioctl+0x3d/0x50 [ 2918.418102] do_syscall_64+0x73/0x160 [ 2918.418106] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 2918.418204] Freed by task 0: [ 2918.418301] (stack is not available) [ 2918.418521] The buggy address belongs to the object at ffff88018efc0000 which belongs to the cache biovec-max of size 8192 [ 2918.418894] The buggy address is located 104 bytes to the right of 8192-byte region [ffff88018efc0000, ffff88018efc2000) [ 2918.419257] The buggy address belongs to the page: [ 2918.419431] page:ffffea00063bf000 count:1 mapcount:0 mapping:ffff8801f2242540 index:0x0 compound_mapcount: 0 [ 2918.419702] flags: 0x17fff8000008100(slab|head) [ 2918.419879] raw: 017fff8000008100 dead000000000100 dead000000000200 ffff8801f2242540 [ 2918.420101] raw: 0000000000000000 0000000000030003 00000001ffffffff 0000000000000000 [ 2918.420322] page dumped because: kasan: bad access detected [ 2918.420599] Memory state around the buggy address: [ 2918.420764] ffff88018efc1f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 2918.420975] ffff88018efc1f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 2918.421194] >ffff88018efc2000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 2918.421406] ^ [ 2918.421627] ffff88018efc2080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 2918.421838] ffff88018efc2100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 2918.422046] ================================================================== [ 2918.422264] Disabling lock debugging due to kernel taint [ 2923.901641] BUG: unable to handle kernel paging request at ffff88018f0db000 [ 2923.901884] PGD 22226a067 P4D 22226a067 PUD 222273067 PMD 18e642063 PTE 800000018f0db061 [ 2923.902120] Oops: 0003 [#1] SMP KASAN PTI [ 2923.902274] CPU: 1 PID: 1231 Comm: umount Tainted: G B 4.17.0+ #1 [ 2923.902490] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 2923.902761] RIP: 0010:__memset+0x24/0x30 [ 2923.902906] Code: 90 90 90 90 90 90 66 66 90 66 90 49 89 f9 48 89 d1 83 e2 07 48 c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 f3 [ 2923.903446] RSP: 0018:ffff88018ddf7ae0 EFLAGS: 00010206 [ 2923.903622] RAX: 0000000000000000 RBX: ffff8801d549d888 RCX: 1ffffffffffdaffb [ 2923.903833] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88018f0daffc [ 2923.904062] RBP: ffff88018efc206c R08: 1ffff10031df840d R09: ffff88018efc206c [ 2923.904273] R10: ffffffffffffe1ee R11: ffffed0031df65fa R12: 0000000000000000 [ 2923.904485] R13: ffff8801d549dc98 R14: 00000000ffffc3db R15: ffffea00063bec80 [ 2923.904693] FS: 00007fa8b2f8a840(0000) GS:ffff8801f3b00000(0000) knlGS:0000000000000000 [ 2923.904937] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2923.910080] CR2: ffff88018f0db000 CR3: 000000018f892000 CR4: 00000000000006e0 [ 2923.914930] Call Trace: [ 2923.919724] f2fs_truncate_inline_inode+0x114/0x170 [ 2923.924487] f2fs_truncate_blocks+0x11b/0x7c0 [ 2923.929178] ? f2fs_truncate_data_blocks+0x10/0x10 [ 2923.933834] ? dqget+0x670/0x670 [ 2923.938437] ? f2fs_destroy_extent_tree+0xd6/0x270 [ 2923.943107] ? __radix_tree_lookup+0x2f/0x150 [ 2923.947772] f2fs_truncate+0xd4/0x1a0 [ 2923.952491] f2fs_evict_inode+0x5ab/0x610 [ 2923.957204] evict+0x15f/0x280 [ 2923.961898] __dentry_kill+0x161/0x250 [ 2923.966634] shrink_dentry_list+0xf3/0x250 [ 2923.971897] shrink_dcache_parent+0xa9/0x100 [ 2923.976561] ? shrink_dcache_sb+0x1f0/0x1f0 [ 2923.981177] ? wait_for_completion+0x8a/0x210 [ 2923.985781] ? migrate_swap_stop+0x2d0/0x2d0 [ 2923.990332] do_one_tree+0xe/0x40 [ 2923.994735] shrink_dcache_for_umount+0x3a/0xa0 [ 2923.999077] generic_shutdown_super+0x3e/0x1c0 [ 2924.003350] kill_block_super+0x4b/0x70 [ 2924.007619] deactivate_locked_super+0x65/0x90 [ 2924.011812] cleanup_mnt+0x5c/0xa0 [ 2924.015995] task_work_run+0xce/0xf0 [ 2924.020174] exit_to_usermode_loop+0x115/0x120 [ 2924.024293] do_syscall_64+0x12f/0x160 [ 2924.028479] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 2924.032709] RIP: 0033:0x7fa8b2868487 [ 2924.036888] Code: 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 c9 2b 00 f7 d8 64 89 01 48 [ 2924.045750] RSP: 002b:00007ffc39824d58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [ 2924.050190] RAX: 0000000000000000 RBX: 00000000008ea030 RCX: 00007fa8b2868487 [ 2924.054604] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 00000000008f4360 [ 2924.058940] RBP: 00000000008f4360 R08: 0000000000000000 R09: 0000000000000014 [ 2924.063186] R10: 00000000000006b2 R11: 0000000000000246 R12: 00007fa8b2d7183c [ 2924.067418] R13: 0000000000000000 R14: 00000000008ea210 R15: 00007ffc39824fe0 [ 2924.071534] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer joydev input_leds serio_raw snd soundcore mac_hid i2c_piix4 ib_iser rdma_cm iw_cm ib_cm ib_core configfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi btrfs zstd_decompress zstd_compress xxhash raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear 8139too qxl ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel psmouse aes_x86_64 8139cp crypto_simd cryptd mii glue_helper pata_acpi floppy [ 2924.098044] CR2: ffff88018f0db000 [ 2924.102520] ---[ end trace a8e0d899985faf31 ]--- [ 2924.107012] RIP: 0010:__memset+0x24/0x30 [ 2924.111448] Code: 90 90 90 90 90 90 66 66 90 66 90 49 89 f9 48 89 d1 83 e2 07 48 c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 f3 [ 2924.120724] RSP: 0018:ffff88018ddf7ae0 EFLAGS: 00010206 [ 2924.125312] RAX: 0000000000000000 RBX: ffff8801d549d888 RCX: 1ffffffffffdaffb [ 2924.129931] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88018f0daffc [ 2924.134537] RBP: ffff88018efc206c R08: 1ffff10031df840d R09: ffff88018efc206c [ 2924.139175] R10: ffffffffffffe1ee R11: ffffed0031df65fa R12: 0000000000000000 [ 2924.143825] R13: ffff8801d549dc98 R14: 00000000ffffc3db R15: ffffea00063bec80 [ 2924.148500] FS: 00007fa8b2f8a840(0000) GS:ffff8801f3b00000(0000) knlGS:0000000000000000 [ 2924.153247] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2924.158003] CR2: ffff88018f0db000 CR3: 000000018f892000 CR4: 00000000000006e0 [ 2924.164641] BUG: Bad rss-counter state mm:00000000fa04621e idx:0 val:4 [ 2924.170007] BUG: Bad rss-counter tate mm:00000000fa04621e idx:1 val:2 - Location https://elixir.bootlin.com/linux/v4.18-rc3/source/fs/f2fs/inline.c#L78 memset(addr + from, 0, MAX_INLINE_DATA(inode) - from); Here the length can be negative. Reported-by Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 66415cee3d341b19eb2766c118cb5f6fddda077c Author: Yunlong Song Date: Thu Jul 12 23:09:28 2018 +0800 f2fs: blk_finish_plug of submit_bio in lfs mode Expand the blk_finish_plug action from blkzoned to normal lfs mode, since plug will cause the out-of-order IO submission, which is not friendly to flash in lfs mode. Signed-off-by: Yunlong Song Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3611ce9911267cb93d364bd71ddea6821278d11f Author: Yunlong Song Date: Thu Jul 12 23:09:26 2018 +0800 f2fs: do not set free of current section For the case when sbi->segs_per_sec > 1, take section:segment = 5 for example, if segment 1 is just used and allocate new segment 2, and the blocks of segment 1 is invalidated, at this time, the previous code will use __set_test_and_free to free the free_secmap and free_sections++, this is not correct since it is still a current section, so fix it. Signed-off-by: Yunlong Song Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 36b877af7992893b6d1ddbe96971cab5ab9e50eb Author: Daniel Rosenberg Date: Mon Jul 9 20:32:42 2018 -0700 f2fs: Keep alloc_valid_block_count in sync If we attempt to request more blocks than we have room for, we try to instead request as much as we can, however, alloc_valid_block_count is not decremented to match the new value, allowing it to drift higher until the next checkpoint. This always decrements it when the requested amount cannot be fulfilled. Signed-off-by: Daniel Rosenberg Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 20ee4382322cd9cf6ecfcf4f429ed108c617fb4a Author: Chao Yu Date: Sun Jul 8 22:11:01 2018 +0800 f2fs: issue small discard by LBA order For small granularity discard which size is smaller than 64KB, if we issue those kind of discards orderly by size, their IOs will be spread into entire logical address, so that in FTL, L2P table will be updated randomly, result bad wear rate in the table. In this patch, we choose to issue small discard by LBA order, by this way, we can expect that L2P table updates from adjacent discard IOs can be merged in the cache, so it can reduce lifetime wearing of flash. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 522d1711d62c4fb87d7468ea1ef76ef5c510fd6e Author: Chao Yu Date: Sun Jul 8 22:08:09 2018 +0800 f2fs: stop issuing discard immediately if there is queued IO For background discard policy, even if there is queued user IO, still we will check max_requests times for next discard entry, it is unneeded, let's just stop this round submission immediately. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4c6b56c002caf0b3a9aaaeb493c59d53daeaff40 Author: Chao Yu Date: Sun Jul 8 22:16:54 2018 +0800 f2fs: clean up with IS_INODE() Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2482c4325dfe03b679a8bd7e0f1d14e230f019b3 Author: Chao Yu Date: Sun Jul 8 22:16:53 2018 +0800 f2fs: detect bug_on in f2fs_wait_discard_bios Add bug_on to detect potential non-empty discard wait list. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit cb15d1e43db0a6341c1e26ac6a2c74e61b74f1aa Author: Randy Dunlap Date: Fri Jul 6 20:50:57 2018 -0700 f2fs: fix defined but not used build warnings Fix build warnings in f2fs when CONFIG_PROC_FS is not enabled by marking the unused functions as __maybe_unused. ../fs/f2fs/sysfs.c:519:12: warning: 'segment_info_seq_show' defined but not used [-Wunused-function] ../fs/f2fs/sysfs.c:546:12: warning: 'segment_bits_seq_show' defined but not used [-Wunused-function] ../fs/f2fs/sysfs.c:570:12: warning: 'iostat_info_seq_show' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap Cc: Jaegeuk Kim Cc: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Jaegeuk Kim commit a39e5365835edcdb12140d423573c2b8ed39ebfb Author: Chao Yu Date: Thu Jul 5 14:24:11 2018 +0800 f2fs: enable real-time discard by default f2fs is focused on flash based storage, so let's enable real-time discard by default, if user don't want to enable it, 'nodiscard' mount option should be used on mount. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 82902c06bd17dbf6e8184299842ca5c68880970f Author: Chao Yu Date: Thu Jul 5 19:37:00 2018 +0800 f2fs: fix to detect looped node chain correctly Below dmesg was printed when testing generic/388 of fstest: F2FS-fs (zram1): find_fsync_dnodes: detect looped node chain, blkaddr:526615, next:526616 F2FS-fs (zram1): Cannot recover all fsync data errno=-22 F2FS-fs (zram1): Mounted with checkpoint version = 22300d0e F2FS-fs (zram1): find_fsync_dnodes: detect looped node chain, blkaddr:526615, next:526616 F2FS-fs (zram1): Cannot recover all fsync data errno=-22 The reason is that we initialize free_blocks with free blocks of filesystem, so if filesystem is full, free_blocks can be zero, below condition will be true, so that, it will fail recovery. if (++loop_cnt >= free_blocks || blkaddr == next_blkaddr_of_node(page)) To fix this issue, initialize free_blocks with correct value which includes over-privision blocks. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c9b60788fc760d136211853f10ce73dc152d1f4a Author: Chao Yu Date: Wed Aug 1 19:13:44 2018 +0800 f2fs: fix to do sanity check with block address in main area This patch add to do sanity check with below field: - cp_pack_total_block_count - blkaddr of data/node - extent info - Overview BUG() in verify_block_addr() when writing to a corrupted f2fs image - Reproduce (4.18 upstream kernel) - POC (poc.c) static void activity(char *mpoint) { char *foo_bar_baz; int err; static int buf[8192]; memset(buf, 0, sizeof(buf)); err = asprintf(&foo_bar_baz, "%s/foo/bar/baz", mpoint); int fd = open(foo_bar_baz, O_RDWR | O_TRUNC, 0777); if (fd >= 0) { write(fd, (char *)buf, sizeof(buf)); fdatasync(fd); close(fd); } } int main(int argc, char *argv[]) { activity(argv[1]); return 0; } - Kernel message [ 689.349473] F2FS-fs (loop0): Mounted with checkpoint version = 3 [ 699.728662] WARNING: CPU: 0 PID: 1309 at fs/f2fs/segment.c:2860 f2fs_inplace_write_data+0x232/0x240 [ 699.728670] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd mac_hid i2c_piix4 soundcore ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear 8139too crct10dif_pclmul crc32_pclmul qxl drm_kms_helper syscopyarea aesni_intel sysfillrect sysimgblt fb_sys_fops ttm drm aes_x86_64 crypto_simd cryptd 8139cp glue_helper mii pata_acpi floppy [ 699.729056] CPU: 0 PID: 1309 Comm: a.out Not tainted 4.18.0-rc1+ #4 [ 699.729064] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 699.729074] RIP: 0010:f2fs_inplace_write_data+0x232/0x240 [ 699.729076] Code: ff e9 cf fe ff ff 49 8d 7d 10 e8 39 45 ad ff 4d 8b 7d 10 be 04 00 00 00 49 8d 7f 48 e8 07 49 ad ff 45 8b 7f 48 e9 fb fe ff ff <0f> 0b f0 41 80 4d 48 04 e9 65 fe ff ff 90 66 66 66 66 90 55 48 8d [ 699.729130] RSP: 0018:ffff8801f43af568 EFLAGS: 00010202 [ 699.729139] RAX: 000000000000003f RBX: ffff8801f43af7b8 RCX: ffffffffb88c9113 [ 699.729142] RDX: 0000000000000003 RSI: dffffc0000000000 RDI: ffff8802024e5540 [ 699.729144] RBP: ffff8801f43af590 R08: 0000000000000009 R09: ffffffffffffffe8 [ 699.729147] R10: 0000000000000001 R11: ffffed0039b0596a R12: ffff8802024e5540 [ 699.729149] R13: ffff8801f0335500 R14: ffff8801e3e7a700 R15: ffff8801e1ee4450 [ 699.729154] FS: 00007f9bf97f5700(0000) GS:ffff8801f6e00000(0000) knlGS:0000000000000000 [ 699.729156] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 699.729159] CR2: 00007f9bf925d170 CR3: 00000001f0c34000 CR4: 00000000000006f0 [ 699.729171] Call Trace: [ 699.729192] f2fs_do_write_data_page+0x2e2/0xe00 [ 699.729203] ? f2fs_should_update_outplace+0xd0/0xd0 [ 699.729238] ? memcg_drain_all_list_lrus+0x280/0x280 [ 699.729269] ? __radix_tree_replace+0xa3/0x120 [ 699.729276] __write_data_page+0x5c7/0xe30 [ 699.729291] ? kasan_check_read+0x11/0x20 [ 699.729310] ? page_mapped+0x8a/0x110 [ 699.729321] ? page_mkclean+0xe9/0x160 [ 699.729327] ? f2fs_do_write_data_page+0xe00/0xe00 [ 699.729331] ? invalid_page_referenced_vma+0x130/0x130 [ 699.729345] ? clear_page_dirty_for_io+0x332/0x450 [ 699.729351] f2fs_write_cache_pages+0x4ca/0x860 [ 699.729358] ? __write_data_page+0xe30/0xe30 [ 699.729374] ? percpu_counter_add_batch+0x22/0xa0 [ 699.729380] ? kasan_check_write+0x14/0x20 [ 699.729391] ? _raw_spin_lock+0x17/0x40 [ 699.729403] ? f2fs_mark_inode_dirty_sync.part.18+0x16/0x30 [ 699.729413] ? iov_iter_advance+0x113/0x640 [ 699.729418] ? f2fs_write_end+0x133/0x2e0 [ 699.729423] ? balance_dirty_pages_ratelimited+0x239/0x640 [ 699.729428] f2fs_write_data_pages+0x329/0x520 [ 699.729433] ? generic_perform_write+0x250/0x320 [ 699.729438] ? f2fs_write_cache_pages+0x860/0x860 [ 699.729454] ? current_time+0x110/0x110 [ 699.729459] ? f2fs_preallocate_blocks+0x1ef/0x370 [ 699.729464] do_writepages+0x37/0xb0 [ 699.729468] ? f2fs_write_cache_pages+0x860/0x860 [ 699.729472] ? do_writepages+0x37/0xb0 [ 699.729478] __filemap_fdatawrite_range+0x19a/0x1f0 [ 699.729483] ? delete_from_page_cache_batch+0x4e0/0x4e0 [ 699.729496] ? __vfs_write+0x2b2/0x410 [ 699.729501] file_write_and_wait_range+0x66/0xb0 [ 699.729506] f2fs_do_sync_file+0x1f9/0xd90 [ 699.729511] ? truncate_partial_data_page+0x290/0x290 [ 699.729521] ? __sb_end_write+0x30/0x50 [ 699.729526] ? vfs_write+0x20f/0x260 [ 699.729530] f2fs_sync_file+0x9a/0xb0 [ 699.729534] ? f2fs_do_sync_file+0xd90/0xd90 [ 699.729548] vfs_fsync_range+0x68/0x100 [ 699.729554] ? __fget_light+0xc9/0xe0 [ 699.729558] do_fsync+0x3d/0x70 [ 699.729562] __x64_sys_fdatasync+0x24/0x30 [ 699.729585] do_syscall_64+0x78/0x170 [ 699.729595] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 699.729613] RIP: 0033:0x7f9bf930d800 [ 699.729615] Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 49 bf 2c 00 00 75 10 b8 4b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 be 78 01 00 48 89 04 24 [ 699.729668] RSP: 002b:00007ffee3606c68 EFLAGS: 00000246 ORIG_RAX: 000000000000004b [ 699.729673] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9bf930d800 [ 699.729675] RDX: 0000000000008000 RSI: 00000000006010a0 RDI: 0000000000000003 [ 699.729678] RBP: 00007ffee3606ca0 R08: 0000000001503010 R09: 0000000000000000 [ 699.729680] R10: 00000000000002e8 R11: 0000000000000246 R12: 0000000000400610 [ 699.729683] R13: 00007ffee3606da0 R14: 0000000000000000 R15: 0000000000000000 [ 699.729687] ---[ end trace 4ce02f25ff7d3df5 ]--- [ 699.729782] ------------[ cut here ]------------ [ 699.729785] kernel BUG at fs/f2fs/segment.h:654! [ 699.731055] invalid opcode: 0000 [#1] SMP KASAN PTI [ 699.732104] CPU: 0 PID: 1309 Comm: a.out Tainted: G W 4.18.0-rc1+ #4 [ 699.733684] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 699.735611] RIP: 0010:f2fs_submit_page_bio+0x29b/0x730 [ 699.736649] Code: 54 49 8d bd 18 04 00 00 e8 b2 59 af ff 41 8b 8d 18 04 00 00 8b 45 b8 41 d3 e6 44 01 f0 4c 8d 73 14 41 39 c7 0f 82 37 fe ff ff <0f> 0b 65 8b 05 2c 04 77 47 89 c0 48 0f a3 05 52 c1 d5 01 0f 92 c0 [ 699.740524] RSP: 0018:ffff8801f43af508 EFLAGS: 00010283 [ 699.741573] RAX: 0000000000000000 RBX: ffff8801f43af7b8 RCX: ffffffffb88a7cef [ 699.743006] RDX: 0000000000000007 RSI: dffffc0000000000 RDI: ffff8801e3e7a64c [ 699.744426] RBP: ffff8801f43af558 R08: ffffed003e066b55 R09: ffffed003e066b55 [ 699.745833] R10: 0000000000000001 R11: ffffed003e066b54 R12: ffffea0007876940 [ 699.747256] R13: ffff8801f0335500 R14: ffff8801e3e7a600 R15: 0000000000000001 [ 699.748683] FS: 00007f9bf97f5700(0000) GS:ffff8801f6e00000(0000) knlGS:0000000000000000 [ 699.750293] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 699.751462] CR2: 00007f9bf925d170 CR3: 00000001f0c34000 CR4: 00000000000006f0 [ 699.752874] Call Trace: [ 699.753386] ? f2fs_inplace_write_data+0x93/0x240 [ 699.754341] f2fs_inplace_write_data+0xd2/0x240 [ 699.755271] f2fs_do_write_data_page+0x2e2/0xe00 [ 699.756214] ? f2fs_should_update_outplace+0xd0/0xd0 [ 699.757215] ? memcg_drain_all_list_lrus+0x280/0x280 [ 699.758209] ? __radix_tree_replace+0xa3/0x120 [ 699.759164] __write_data_page+0x5c7/0xe30 [ 699.760002] ? kasan_check_read+0x11/0x20 [ 699.760823] ? page_mapped+0x8a/0x110 [ 699.761573] ? page_mkclean+0xe9/0x160 [ 699.762345] ? f2fs_do_write_data_page+0xe00/0xe00 [ 699.763332] ? invalid_page_referenced_vma+0x130/0x130 [ 699.764374] ? clear_page_dirty_for_io+0x332/0x450 [ 699.765347] f2fs_write_cache_pages+0x4ca/0x860 [ 699.766276] ? __write_data_page+0xe30/0xe30 [ 699.767161] ? percpu_counter_add_batch+0x22/0xa0 [ 699.768112] ? kasan_check_write+0x14/0x20 [ 699.768951] ? _raw_spin_lock+0x17/0x40 [ 699.769739] ? f2fs_mark_inode_dirty_sync.part.18+0x16/0x30 [ 699.770885] ? iov_iter_advance+0x113/0x640 [ 699.771743] ? f2fs_write_end+0x133/0x2e0 [ 699.772569] ? balance_dirty_pages_ratelimited+0x239/0x640 [ 699.773680] f2fs_write_data_pages+0x329/0x520 [ 699.774603] ? generic_perform_write+0x250/0x320 [ 699.775544] ? f2fs_write_cache_pages+0x860/0x860 [ 699.776510] ? current_time+0x110/0x110 [ 699.777299] ? f2fs_preallocate_blocks+0x1ef/0x370 [ 699.778279] do_writepages+0x37/0xb0 [ 699.779026] ? f2fs_write_cache_pages+0x860/0x860 [ 699.779978] ? do_writepages+0x37/0xb0 [ 699.780755] __filemap_fdatawrite_range+0x19a/0x1f0 [ 699.781746] ? delete_from_page_cache_batch+0x4e0/0x4e0 [ 699.782820] ? __vfs_write+0x2b2/0x410 [ 699.783597] file_write_and_wait_range+0x66/0xb0 [ 699.784540] f2fs_do_sync_file+0x1f9/0xd90 [ 699.785381] ? truncate_partial_data_page+0x290/0x290 [ 699.786415] ? __sb_end_write+0x30/0x50 [ 699.787204] ? vfs_write+0x20f/0x260 [ 699.787941] f2fs_sync_file+0x9a/0xb0 [ 699.788694] ? f2fs_do_sync_file+0xd90/0xd90 [ 699.789572] vfs_fsync_range+0x68/0x100 [ 699.790360] ? __fget_light+0xc9/0xe0 [ 699.791128] do_fsync+0x3d/0x70 [ 699.791779] __x64_sys_fdatasync+0x24/0x30 [ 699.792614] do_syscall_64+0x78/0x170 [ 699.793371] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 699.794406] RIP: 0033:0x7f9bf930d800 [ 699.795134] Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 49 bf 2c 00 00 75 10 b8 4b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 be 78 01 00 48 89 04 24 [ 699.798960] RSP: 002b:00007ffee3606c68 EFLAGS: 00000246 ORIG_RAX: 000000000000004b [ 699.800483] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9bf930d800 [ 699.801923] RDX: 0000000000008000 RSI: 00000000006010a0 RDI: 0000000000000003 [ 699.803373] RBP: 00007ffee3606ca0 R08: 0000000001503010 R09: 0000000000000000 [ 699.804798] R10: 00000000000002e8 R11: 0000000000000246 R12: 0000000000400610 [ 699.806233] R13: 00007ffee3606da0 R14: 0000000000000000 R15: 0000000000000000 [ 699.807667] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd mac_hid i2c_piix4 soundcore ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear 8139too crct10dif_pclmul crc32_pclmul qxl drm_kms_helper syscopyarea aesni_intel sysfillrect sysimgblt fb_sys_fops ttm drm aes_x86_64 crypto_simd cryptd 8139cp glue_helper mii pata_acpi floppy [ 699.817079] ---[ end trace 4ce02f25ff7d3df6 ]--- [ 699.818068] RIP: 0010:f2fs_submit_page_bio+0x29b/0x730 [ 699.819114] Code: 54 49 8d bd 18 04 00 00 e8 b2 59 af ff 41 8b 8d 18 04 00 00 8b 45 b8 41 d3 e6 44 01 f0 4c 8d 73 14 41 39 c7 0f 82 37 fe ff ff <0f> 0b 65 8b 05 2c 04 77 47 89 c0 48 0f a3 05 52 c1 d5 01 0f 92 c0 [ 699.822919] RSP: 0018:ffff8801f43af508 EFLAGS: 00010283 [ 699.823977] RAX: 0000000000000000 RBX: ffff8801f43af7b8 RCX: ffffffffb88a7cef [ 699.825436] RDX: 0000000000000007 RSI: dffffc0000000000 RDI: ffff8801e3e7a64c [ 699.826881] RBP: ffff8801f43af558 R08: ffffed003e066b55 R09: ffffed003e066b55 [ 699.828292] R10: 0000000000000001 R11: ffffed003e066b54 R12: ffffea0007876940 [ 699.829750] R13: ffff8801f0335500 R14: ffff8801e3e7a600 R15: 0000000000000001 [ 699.831192] FS: 00007f9bf97f5700(0000) GS:ffff8801f6e00000(0000) knlGS:0000000000000000 [ 699.832793] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 699.833981] CR2: 00007f9bf925d170 CR3: 00000001f0c34000 CR4: 00000000000006f0 [ 699.835556] ================================================================== [ 699.837029] BUG: KASAN: stack-out-of-bounds in update_stack_state+0x38c/0x3e0 [ 699.838462] Read of size 8 at addr ffff8801f43af970 by task a.out/1309 [ 699.840086] CPU: 0 PID: 1309 Comm: a.out Tainted: G D W 4.18.0-rc1+ #4 [ 699.841603] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 699.843475] Call Trace: [ 699.843982] dump_stack+0x7b/0xb5 [ 699.844661] print_address_description+0x70/0x290 [ 699.845607] kasan_report+0x291/0x390 [ 699.846351] ? update_stack_state+0x38c/0x3e0 [ 699.853831] __asan_load8+0x54/0x90 [ 699.854569] update_stack_state+0x38c/0x3e0 [ 699.855428] ? __read_once_size_nocheck.constprop.7+0x20/0x20 [ 699.856601] ? __save_stack_trace+0x5e/0x100 [ 699.857476] unwind_next_frame.part.5+0x18e/0x490 [ 699.858448] ? unwind_dump+0x290/0x290 [ 699.859217] ? clear_page_dirty_for_io+0x332/0x450 [ 699.860185] __unwind_start+0x106/0x190 [ 699.860974] __save_stack_trace+0x5e/0x100 [ 699.861808] ? __save_stack_trace+0x5e/0x100 [ 699.862691] ? unlink_anon_vmas+0xba/0x2c0 [ 699.863525] save_stack_trace+0x1f/0x30 [ 699.864312] save_stack+0x46/0xd0 [ 699.864993] ? __alloc_pages_slowpath+0x1420/0x1420 [ 699.865990] ? flush_tlb_mm_range+0x15e/0x220 [ 699.866889] ? kasan_check_write+0x14/0x20 [ 699.867724] ? __dec_node_state+0x92/0xb0 [ 699.868543] ? lock_page_memcg+0x85/0xf0 [ 699.869350] ? unlock_page_memcg+0x16/0x80 [ 699.870185] ? page_remove_rmap+0x198/0x520 [ 699.871048] ? mark_page_accessed+0x133/0x200 [ 699.871930] ? _cond_resched+0x1a/0x50 [ 699.872700] ? unmap_page_range+0xcd4/0xe50 [ 699.873551] ? rb_next+0x58/0x80 [ 699.874217] ? rb_next+0x58/0x80 [ 699.874895] __kasan_slab_free+0x13c/0x1a0 [ 699.875734] ? unlink_anon_vmas+0xba/0x2c0 [ 699.876563] kasan_slab_free+0xe/0x10 [ 699.877315] kmem_cache_free+0x89/0x1e0 [ 699.878095] unlink_anon_vmas+0xba/0x2c0 [ 699.878913] free_pgtables+0x101/0x1b0 [ 699.879677] exit_mmap+0x146/0x2a0 [ 699.880378] ? __ia32_sys_munmap+0x50/0x50 [ 699.881214] ? kasan_check_read+0x11/0x20 [ 699.882052] ? mm_update_next_owner+0x322/0x380 [ 699.882985] mmput+0x8b/0x1d0 [ 699.883602] do_exit+0x43a/0x1390 [ 699.884288] ? mm_update_next_owner+0x380/0x380 [ 699.885212] ? f2fs_sync_file+0x9a/0xb0 [ 699.885995] ? f2fs_do_sync_file+0xd90/0xd90 [ 699.886877] ? vfs_fsync_range+0x68/0x100 [ 699.887694] ? __fget_light+0xc9/0xe0 [ 699.888442] ? do_fsync+0x3d/0x70 [ 699.889118] ? __x64_sys_fdatasync+0x24/0x30 [ 699.889996] rewind_stack_do_exit+0x17/0x20 [ 699.890860] RIP: 0033:0x7f9bf930d800 [ 699.891585] Code: Bad RIP value. [ 699.892268] RSP: 002b:00007ffee3606c68 EFLAGS: 00000246 ORIG_RAX: 000000000000004b [ 699.893781] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9bf930d800 [ 699.895220] RDX: 0000000000008000 RSI: 00000000006010a0 RDI: 0000000000000003 [ 699.896643] RBP: 00007ffee3606ca0 R08: 0000000001503010 R09: 0000000000000000 [ 699.898069] R10: 00000000000002e8 R11: 0000000000000246 R12: 0000000000400610 [ 699.899505] R13: 00007ffee3606da0 R14: 0000000000000000 R15: 0000000000000000 [ 699.901241] The buggy address belongs to the page: [ 699.902215] page:ffffea0007d0ebc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0 [ 699.903811] flags: 0x2ffff0000000000() [ 699.904585] raw: 02ffff0000000000 0000000000000000 ffffffff07d00101 0000000000000000 [ 699.906125] raw: 0000000000000000 0000000000240000 00000000ffffffff 0000000000000000 [ 699.907673] page dumped because: kasan: bad access detected [ 699.909108] Memory state around the buggy address: [ 699.910077] ffff8801f43af800: 00 f1 f1 f1 f1 00 f4 f4 f4 f3 f3 f3 f3 00 00 00 [ 699.911528] ffff8801f43af880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 699.912953] >ffff8801f43af900: 00 00 00 00 00 00 00 00 f1 01 f4 f4 f4 f2 f2 f2 [ 699.914392] ^ [ 699.915758] ffff8801f43af980: f2 00 f4 f4 00 00 00 00 f2 00 00 00 00 00 00 00 [ 699.917193] ffff8801f43afa00: 00 00 00 00 00 00 00 00 00 f3 f3 f3 00 00 00 00 [ 699.918634] ================================================================== - Location https://elixir.bootlin.com/linux/v4.18-rc1/source/fs/f2fs/segment.h#L644 Reported-by Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b69ab96ab13ddaa28a506a2433ae5b12669615e8 Merge: 90d4c5bb98bf d0b35a42031a Author: David S. Miller Date: Wed Aug 1 11:50:55 2018 -0700 Merge tag 'rxrpc-next-20180801' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs David Howells says: ==================== rxrpc: Development Here are some patches that add some more tracepoints to AF_RXRPC and fix some issues therein. The most significant points are: (1) Display the call timeout information in /proc/net/rxrpc/calls. (2) Save the call's debug_id in the rxrpc_channel struct so that it can be used in traces after the rxrpc_call struct has been destroyed. (3) Increase the size of the kAFS Rx window from 32 to 63 to be about the same as the Auristor server. (4) Propose the terminal ACK for a client call after it has received all its data to be transmitted after a short interval so that it will get transmitted if not first superseded by a new call on the same channel. (5) Flush ACKs during the data reception if we detect that we've run out of data.[*] (6) Trace successful packet transmission and softirq to process context socket notification. [*] Note that on a uncontended gigabit network, rxrpc runs in to trouble with ACK packets getting batched together (up to ~32 at a time) somewhere between the IP transmit queue on the client and the ethernet receive queue on the server. I can see the kernel afs filesystem client and Auristor userspace server stalling occasionally on a 512MB single read. Sticking tracepoints in the network driver at either end seems to show that, although the ACK transmissions made by the client are reasonably spaced timewise, the received ACKs come in batches from the network card on the server. I'm not sure what, if anything, can be done about this. ==================== Signed-off-by: David S. Miller commit d5e77fca87e636dda510710689b4c2ca93765598 Author: Gustavo A. R. Silva Date: Wed Aug 1 11:14:16 2018 -0500 ALSA: usb: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115084 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 799d8a8e0500ec782fb9fe8c95ded67e80ad4346 Author: Todd Poynor Date: Tue Jul 31 13:24:48 2018 -0700 staging: gasket: page table: fix header file include guard symbol The include guard symbol for gasket_page_table.h is out-of-date. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit d29f6c19b0d4f71ee72e4e2b387c3d08666a6a18 Author: Todd Poynor Date: Tue Jul 31 13:24:47 2018 -0700 Revert "staging: gasket: page table: hold references to device and pci_dev" gasket_free_dev() is called only from driver PCI probe and remove function. It is guaranteed that that pci_dev structure is not going anywhere during that time; there is no need to take this additional reference. This reverts commit dd9d1502feea3c23d412f289aad79e1d4e86d45d. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e02fed16b3f430d89cdb9b2eda69906dafb507b3 Author: Todd Poynor Date: Tue Jul 31 13:24:46 2018 -0700 staging: gasket: core: use bool type for ns_capable result When gasket core was converted from using capable() to use ns_capable() instead, the type of the variable holding the result should have been converted from int to bool. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 4287dbaa7c3ef0db9d8258c9f505b4149c21a393 Author: Todd Poynor Date: Tue Jul 31 13:24:45 2018 -0700 staging: gasket: apex: move driver-private defines out of apex.h apex.h is supposed to contain kernel-userspace interface definitions, but has a number of defines that are only used by apex_driver.c or are not used at all. Move driver implementation defines not shared with userspace to the driver source. Remove unused defines. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 953105453b1aeb45d15a4c053fdc911f039b097b Author: Todd Poynor Date: Tue Jul 31 13:24:44 2018 -0700 staging: gasket: TODO: remove entry for multi-line alignment style Multi-line alignment formatting issues fixed, remove the TODO entry for this. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 21cfa72cddee4cfd6a091968517fdbb4263f71d3 Author: Todd Poynor Date: Tue Jul 31 13:24:43 2018 -0700 staging: gasket: interrupt: fix function param line continuation style Fix multi-line alignment formatting to look like: int ret = long_function_name(device, VARIABLE1, VARIABLE2, VARIABLE3, VARIABLE4); Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 46b77a6b6922113add0a0b9711f5044b1e6aa6a1 Author: Todd Poynor Date: Tue Jul 31 13:24:42 2018 -0700 staging: gasket: sysfs: fix function param line continuation style Fix multi-line alignment formatting to look like: int ret = long_function_name(device, VARIABLE1, VARIABLE2, VARIABLE3, VARIABLE4); Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e8c7f19981dce9e8661b0b1e277bda4c322f9af7 Author: Todd Poynor Date: Tue Jul 31 13:24:41 2018 -0700 staging: gasket: page table: fix function param line continuation style Fix multi-line alignment formatting to look like: int ret = long_function_name(device, VARIABLE1, VARIABLE2, VARIABLE3, VARIABLE4); Many of these TODO items were previously cleaned up during the conversion to standard logging functions. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 3e845083131224934b6833642aa1c9a0754b4e61 Author: Todd Poynor Date: Tue Jul 31 13:24:40 2018 -0700 staging: gasket: ioctl: fix function param line continuation style Fix multi-line alignment formatting to look like: int ret = long_function_name(device, VARIABLE1, VARIABLE2, VARIABLE3, VARIABLE4); Many of these TODO items were previously cleaned up during the conversion to standard logging functions. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 88c8a377c00ff3a69bf5a4abfdf6fc5f041089e1 Author: Todd Poynor Date: Tue Jul 31 13:24:39 2018 -0700 staging: gasket: core: fix function param line continuation style Fix multi-line alignment formatting to look like: int ret = long_function_name(device, VARIABLE1, VARIABLE2, VARIABLE3, VARIABLE4); Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 6d2bd645cbae8feb252510bae627bb2e8d9e3286 Author: Todd Poynor Date: Tue Jul 31 13:24:38 2018 -0700 staging: gasket: TODO: remove entry for static function declarations The static function declarations are removed, remove the TODO file entry for this. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 00b60c8d9ed7e9505b70143af04497625d5ef019 Author: Todd Poynor Date: Tue Jul 31 13:24:37 2018 -0700 staging: gasket: pg tbl: remove static function forward declarations Remove forward declarations of static functions, move code to avoid forward references, for kernel style. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit d821f8eb92ef500cee280e9467e8d89c8de5da0b Author: Todd Poynor Date: Tue Jul 31 13:24:36 2018 -0700 staging: gasket: interrupt: remove static function forward declarations Remove forward declarations of static functions, move code to avoid forward references, for kernel style. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit ea174ccd2a1144c6bc02943220a916e4a556f5ff Author: Todd Poynor Date: Tue Jul 31 13:24:35 2018 -0700 staging: gasket: ioctl: remove static function forward declarations Remove forward declarations of static functions, move code to avoid forward references, for kernel style. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 80666096eb78f0eb54abb1991c23488a276fa1c6 Author: Todd Poynor Date: Tue Jul 31 13:24:34 2018 -0700 staging: gasket: core: remove static function forward declarations Remove forward declarations of static functions, move code to avoid forward references, for kernel style. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 496fb59e1274086d0c67681fb1369e9941660dd9 Author: Maxime Roussin-Bélanger Date: Tue Jul 31 16:13:21 2018 -0400 iio: light: si1133: fix uninitialized resp variable Read response register to detect any error. Signed-off-by: Maxime Roussin-Bélanger Reported-by: Dan Carpenter Signed-off-by: Jonathan Cameron commit 5298ff58c93e0d7b7d67b8525e7c18a9478cbd8d Author: zhong jiang Date: Wed Aug 1 22:10:15 2018 +0800 drivers/staging/mt7621-eth: Use dma_zalloc_coherent to replace dma_alloc_coherent+memset we prefer to use dma_zalloc_coherent rather than dam_alloc_coherent+memset Signed-off-by: zhong jiang Signed-off-by: Greg Kroah-Hartman commit 2b4ec22d36d46d03d01d1ec2436080d982284f36 Merge: 2fa03b92b629 1e96e93a3569 Author: Jonathan Cameron Date: Wed Aug 1 18:56:17 2018 +0100 Merge branch 'fixes-togreg' into togreg commit 500cc548c8ebe7494ba37673c3ec1faa342858c3 Author: Greg Kroah-Hartman Date: Wed Aug 1 19:56:17 2018 +0200 staging: comedi: drop serial2002 driver There's not been any work on this driver since it was originally merged, and it really needs to be rewritten to use the serdev layer instead if people really need/want it. Reported-by: Christoph Hellwig Cc: Ian Abbott Cc: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman commit 24daf6a3c97457174f5cc075e5a210d634cfa04f Author: Gao Xiang Date: Wed Aug 1 14:38:31 2018 +0800 staging: erofs: remove a redundant marco in xattr There is no need to '#if CONFIG_EROFS_FS_XATTR' in xattr.c, let's remove it. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit fc6152f4650394ee8d1afa32492f510d54f62e02 Author: Gao Xiang Date: Wed Aug 1 17:36:54 2018 +0800 staging: erofs: add the missing break in z_erofs_map_blocks_iter This patch adds a missing break after adding the default case. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 90d4c5bb98bf66653333266917edf0e16ccd35f9 Author: Ganesh Goudar Date: Wed Aug 1 18:15:32 2018 +0530 cxgb4: fix endian to test F_FW_PORT_CMD_DCBXDIS32 For FW_PORT_ACTION_GET_PORT_INFO32 messages, the u.info32.lstatus32_to_cbllen32 is 32-bit Big Endian. We need to translate that to CPU Endian in order to test F_FW_PORT_CMD_DCBXDIS32. Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit cef238d71de43efeb47c7d7d43da5e1b8e4a1d99 Merge: 4a62e252e888 290b1c8b1a90 Author: David S. Miller Date: Wed Aug 1 10:06:20 2018 -0700 Merge branch 'net-sched-cleanups' Jiri Pirko says: ==================== net: sched: couple of adjustments/fixes ==================== Signed-off-by: David S. Miller commit 290b1c8b1a902c0902df9ec05577ab209296f345 Author: Jiri Pirko Date: Wed Aug 1 12:36:57 2018 +0200 net: sched: make tcf_chain_{get,put}() static These are no longer used outside of cls_api.c so make them static. Move tcf_chain_flush() to avoid fwd declaration of tcf_chain_put(). Signed-off-by: Jiri Pirko v1->v2: - new patch Signed-off-by: David S. Miller commit 5368140730e4a67169303edd3a13e31fd9b9d355 Author: Jiri Pirko Date: Wed Aug 1 12:36:56 2018 +0200 net: sched: fix notifications for action-held chains Chains that only have action references serve as placeholders. Until a non-action reference is created, user should not be aware of the chain. Also he should not receive any notifications about it. So send notifications for the new chain only in case the chain gets the first non-action reference. Symmetrically to that, when the last non-action reference is dropped, send the notification about deleted chain. Reported-by: Cong Wang Signed-off-by: Jiri Pirko Acked-by: Cong Wang v1->v2: - made __tcf_chain_{get,put}() static as suggested by Cong Signed-off-by: David S. Miller commit 3d32f4c548bd8f3af58c59521bee9be127f3e87d Author: Jiri Pirko Date: Wed Aug 1 12:36:55 2018 +0200 net: sched: change name of zombie chain to "held_by_acts_only" As mentioned by Cong and Jakub during the review process, it is a bit odd to sometimes (act flow) create a new chain which would be immediately a "zombie". So just rename it to "held_by_acts_only". Signed-off-by: Jiri Pirko Suggested-by: Cong Wang Suggested-by: Jakub Kicinski Acked-by: Cong Wang Signed-off-by: David S. Miller commit 4a62e252e888f67cb87caf36f48338889b0b8a43 Author: Huazhong Tan Date: Wed Aug 1 18:27:03 2018 +0800 net: hns3: fix return value error while hclge_cmd_csq_clean failed While cleaning the command queue, the value of the HEAD register is not in the range of next_to_clean and next_to_use, meaning that this value is invalid. This also means that there is a hardware error and the hardware will trigger a reset soon. At this time we should return an error code instead of 0, and HCLGE_STATE_CMD_DISABLE needs to be set to prevent sending command again. Fixes: 3ff504908f95 ("net: hns3: fix a dead loop in hclge_cmd_csq_clean") Signed-off-by: Huazhong Tan Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 87f70132b08eadc19e5a78e43b814366f9929399 Author: YueHaibing Date: Wed Aug 1 15:14:07 2018 +0800 rds: remove redundant variable 'rds_ibdev' Variable 'rds_ibdev' is being assigned but never used, so can be removed. fix this clang warning: net/rds/ib_send.c:762:24: warning: variable ‘rds_ibdev’ set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit bd707f17efc9e5dfc0fd05370cb89d2ee41d3558 Author: YueHaibing Date: Wed Aug 1 15:10:37 2018 +0800 strparser: remove redundant variable 'rd_desc' Variable 'rd_desc' is being assigned but never used, so can be removed. fix this clang warning: net/strparser/strparser.c:411:20: warning: variable ‘rd_desc’ set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 1296ee8ffc74fea4350c756f722000211b38400d Author: YueHaibing Date: Wed Aug 1 10:04:02 2018 +0800 ip_gre: remove redundant variables t_hlen After commit ffc2b6ee4174 ("ip_gre: fix IFLA_MTU ignored on NEWLINK") variable t_hlen is assigned values that are never read, hence they are redundant and can be removed. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit ada953de4486a3e2a42c3b8146adb36d0dcbded2 Author: Wolfram Sang Date: Thu Apr 19 16:05:33 2018 +0200 auxdisplay: simplify getting .drvdata We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang Acked-by: Linus Walleij Signed-off-by: Miguel Ojeda commit 13dde04f5c436f3b9f50ccfd0784db6db13401f3 Author: Wei Yongjun Date: Wed Aug 1 01:59:56 2018 +0000 tcp: remove set but not used variable 'skb_size' Fixes gcc '-Wunused-but-set-variable' warning: net/ipv4/tcp_output.c: In function 'tcp_collapse_retrans': net/ipv4/tcp_output.c:2700:6: warning: variable 'skb_size' set but not used [-Wunused-but-set-variable] int skb_size, next_skb_size; ^ Signed-off-by: Wei Yongjun Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 84b64de597bcc26549a7cbfe2fa8022bbc142daa Author: Wei Yongjun Date: Mon Jul 30 07:07:03 2018 +0000 thermal: armada: fix copy-paste error in armada_thermal_probe() The return value from devm_kzalloc() is not checked correctly. The test is done against a wrong variable. Fix it. Fixes: e72f03ef2543 ("thermal: armada: use the resource managed registration helper alternative") Signed-off-by: Wei Yongjun Reviewed-by: Daniel Lezcano Reviewed-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit fab9593df10691b02da99b5ce9ed6930c020eedc Merge: 53dd9652b5f5 7ec65372ca53 Author: David S. Miller Date: Wed Aug 1 09:56:11 2018 -0700 Merge branch 'tcp-add-4-new-stats' Wei Wang says: ==================== tcp: add 4 new stats This patch series adds 3 RFC4898 stats: 1. tcpEStatsPerfHCDataOctetsOut 2. tcpEStatsPerfOctetsRetrans 3. tcpEStatsStackDSACKDups and an addtional stat to record the number of data packet reordering events seen: 4. tcp_reord_seen Together with the existing stats, application can use them to measure the retransmission rate in bytes, exclude spurious retransmissions reflected by DSACK, and keep track of the reordering events on live connections. In particular the networks with different MTUs make bytes-based loss stats more useful. Google servers have been using these stats for many years to instrument transport and network performance. Note: The first patch is a refactor to add a helper to calculate opt_stats size in order to make later changes cleaner. ==================== Signed-off-by: David S. Miller commit 7ec65372ca534217b53fd208500cf7aac223a383 Author: Wei Wang Date: Tue Jul 31 17:46:24 2018 -0700 tcp: add stat of data packet reordering events Introduce a new TCP stats to record the number of reordering events seen and expose it in both tcp_info (TCP_INFO) and opt_stats (SOF_TIMESTAMPING_OPT_STATS). Application can use this stats to track the frequency of the reordering events in addition to the existing reordering stats which tracks the magnitude of the latest reordering event. Note: this new stats tracks reordering events triggered by ACKs, which could often be fewer than the actual number of packets being delivered out-of-order. Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Acked-by: Soheil Hassas Yeganeh Acked-by: Yuchung Cheng Signed-off-by: David S. Miller commit 7e10b6554ff2ce7f86d5d3eec3af5db8db482caa Author: Wei Wang Date: Tue Jul 31 17:46:23 2018 -0700 tcp: add dsack blocks received stats Introduce a new TCP stat to record the number of DSACK blocks received (RFC4989 tcpEStatsStackDSACKDups) and expose it in both tcp_info (TCP_INFO) and opt_stats (SOF_TIMESTAMPING_OPT_STATS). Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Acked-by: Soheil Hassas Yeganeh Acked-by: Yuchung Cheng Signed-off-by: David S. Miller commit fb31c9b9f6c85b1bad569ecedbde78d9e37cd87b Author: Wei Wang Date: Tue Jul 31 17:46:22 2018 -0700 tcp: add data bytes retransmitted stats Introduce a new TCP stat to record the number of bytes retransmitted (RFC4898 tcpEStatsPerfOctetsRetrans) and expose it in both tcp_info (TCP_INFO) and opt_stats (SOF_TIMESTAMPING_OPT_STATS). Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Acked-by: Soheil Hassas Yeganeh Acked-by: Yuchung Cheng Signed-off-by: David S. Miller commit ba113c3aa79a7f941ac162d05a3620bdc985c58d Author: Wei Wang Date: Tue Jul 31 17:46:21 2018 -0700 tcp: add data bytes sent stats Introduce a new TCP stat to record the number of bytes sent (RFC4898 tcpEStatsPerfHCDataOctetsOut) and expose it in both tcp_info (TCP_INFO) and opt_stats (SOF_TIMESTAMPING_OPT_STATS). Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Acked-by: Soheil Hassas Yeganeh Acked-by: Yuchung Cheng Signed-off-by: David S. Miller commit 984988aa72188453f8c8a42dcf94bba1c57e73aa Author: Wei Wang Date: Tue Jul 31 17:46:20 2018 -0700 tcp: add a helper to calculate size of opt_stats This is to refactor the calculation of the size of opt_stats to a helper function to make the code cleaner and easier for later changes. Suggested-by: Stephen Hemminger Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Acked-by: Soheil Hassas Yeganeh Acked-by: Yuchung Cheng Signed-off-by: David S. Miller commit 171613926abc9980e58cb36d5d54fe60e58a03a5 Author: Jia-Ju Bai Date: Fri Jan 26 23:19:15 2018 +0800 auxdisplay: charlcd: delete mdelay in long_sleep The function long_sleep() calls mdelay() when in an interrupt handler. But only charlcd_clear_display() and charlcd_init_display calls long_sleep(), and my tool finds that the two functions are never called in an interrupt handler. Thus mdelay() and in_interrupt() are not necessary. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Acked-by: Willy Tarreau Signed-off-by: Miguel Ojeda commit 53dd9652b5f530da2739298025c8324b6a4d0f21 Merge: 83ba4645152d 9bae0451b7dc Author: David S. Miller Date: Wed Aug 1 09:52:31 2018 -0700 Merge branch 'ipv4-Control-SKB-reprioritization-after-forwarding' Petr Machata says: ==================== ipv4: Control SKB reprioritization after forwarding After IPv4 packets are forwarded, the priority of the corresponding SKB is updated according to the TOS field of IPv4 header. This overrides any prioritization done earlier by e.g. an skbedit action or ingress-qos-map defined at a vlan device. Such overriding may not always be desirable. Even if the packet ends up being routed, which implies this is an L3 network node, an administrator may wish to preserve whatever prioritization was done earlier on in the pipeline. Therefore this patch set introduces a sysctl that controls this behavior, net.ipv4.ip_forward_update_priority. It's value is 1 by default to preserve the current behavior. All of the above is implemented in patch #1. Value changes prompt a new NETEVENT_IPV4_FWD_UPDATE_PRIORITY_UPDATE notification, so that the drivers can hook up whatever logic may depend on this value. That is implemented in patch #2. In patches #3 and #4, mlxsw is adapted to recognize the sysctl. On initialization, the RGCR register that handles router configuration is set in accordance with the sysctl. The new notification is listened to and RGCR is reconfigured as necessary. In patches #5 to #7, a selftest is added to verify that mlxsw reflects the sysctl value as necessary. The test is expressed in terms of the recently-introduced ieee_setapp support, and works by observing how DSCP value gets rewritten depending on packet priority. For this reason, the test is added to the subdirectory drivers/net/mlxsw. Even though it's not particularly specific to mlxsw, it's not suitable for running on soft devices (which don't support the ieee_setapp et.al.). Changes from v1 to v2: - In patch #1, init sysctl_ip_fwd_update_priority to 1 instead of true. Changes from RFC to v1: - Fix wrong sysctl name in ip-sysctl.txt - Add notifications - Add mlxsw support - Add self test ==================== Signed-off-by: David S. Miller commit 9bae0451b7dcca54db376d2ea2cb8d9fc763a683 Author: Petr Machata Date: Wed Aug 1 00:39:29 2018 +0200 selftests: mlxsw: Add test for ip_forward_update_priority Verify that with that sysctl turned off, DSCP prioritization and rewrite works the same way as in qos_dscp_bridge test. However when the sysctl is charged, there should be a reprioritization after routing stage, which will be observed by a different DSCP rewrite on egress. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit cf60869814bcdfbeec02e92ce9e6b38562707edd Author: Petr Machata Date: Wed Aug 1 00:39:25 2018 +0200 selftests: forwarding: Move DSCP capture to lib.sh dscp_capture_install() and dscp_capture_uninstall() are going to be useful for a test added by a following patch, move them therefore to lib.sh together with related helpers. While doing so, change the rule preference from mere DSCP value to DSCP+100 in order to support adding captures of packets with DSCP of 0. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 989133bf7ff3fe6ebcb9c1e7b5e13bebac175d35 Author: Petr Machata Date: Wed Aug 1 00:38:59 2018 +0200 selftests: forwarding: Move lldpad waiting to lib.sh The function lldpad_wait() will be useful for a test added by a following patch. Likewise would the "sleep 5" with its extensive comment. Therefore move lldpad_wait() to lib.sh in order to allow reuse. Rename it to lldpad_app_wait_set() to recognize that what this is intended to wait on are the pending APP sets. For the sleeping, add a function lldpad_app_wait_del(). That will serve to hold the related explanatory comment (which edit for clarity), and as a token in the caller to identify the sites where this sort of waiting takes place. That will serve when/if a better way to handle this business is found. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 6495342365e859400023c09063c2b31a12d68261 Author: Petr Machata Date: Wed Aug 1 00:38:03 2018 +0200 mlxsw: spectrum_router: Handle sysctl_ip_fwd_update_priority This sysctl setting controls whether packet priority should be updated after forwarding. Configure RGCR.usp accordingly so that the device is in sync with the kernel handling. Note that RGCR doesn't allow changing arbitrary parameters mid-operation, however "usp" is exempt and can be reconfigured. Also react to NETEVENT_IPV4_FWD_UPDATE_PRIORITY_UPDATE notifications that signify change in this configuration. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 1f65a33fc7e22de96055778b0e4f214e005291e7 Author: Petr Machata Date: Wed Aug 1 00:37:36 2018 +0200 mlxsw: spectrum: Extract work-scheduling into a new function The boilerplate to schedule NETEVENT_IPV4_MPATH_HASH_UPDATE and NETEVENT_IPV6_MPATH_HASH_UPDATE handling is almost equivalent to that of NETEVENT_IPV4_FWD_UPDATE_PRIORITY_UPDATE that's coming in the next patch. The only difference is which actual worker function should be called. Extract this boilerplate into a named function in order to allow reuse. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit d18c5d1995aa322b722fa731397e28ebcd00b3c6 Author: Petr Machata Date: Wed Aug 1 00:36:42 2018 +0200 net: ipv4: Notify about changes to ip_forward_update_priority Drivers may make offloading decision based on whether ip_forward_update_priority is enabled or not. Therefore distribute netevent notifications to give them a chance to react to a change. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 432e05d328921c68c35bfdeff7d7b7400b8e3d1a Author: Petr Machata Date: Wed Aug 1 00:36:03 2018 +0200 net: ipv4: Control SKB reprioritization after forwarding After IPv4 packets are forwarded, the priority of the corresponding SKB is updated according to the TOS field of IPv4 header. This overrides any prioritization done earlier by e.g. an skbedit action or ingress-qos-map defined at a vlan device. Such overriding may not always be desirable. Even if the packet ends up being routed, which implies this is an L3 network node, an administrator may wish to preserve whatever prioritization was done earlier on in the pipeline. Therefore introduce a sysctl that controls this behavior. Keep the default value at 1 to maintain backward-compatible behavior. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 83ba4645152d1177c161750e1064e3a8e7cee19b Author: Vincent Bernat Date: Tue Jul 31 21:18:11 2018 +0200 net: add helpers checking if socket can be bound to nonlocal address The construction "net->ipv4.sysctl_ip_nonlocal_bind || inet->freebind || inet->transparent" is present three times and its IPv6 counterpart is also present three times. We introduce two small helpers to characterize these tests uniformly. Signed-off-by: Vincent Bernat Signed-off-by: David S. Miller commit d39db3b4d60c9bc4282b36753a7255d2a5ef0384 Author: Jon Mason Date: Tue Jul 31 11:56:19 2018 -0400 net: change Exar/Neterion menu items to be alphabetical Neterion was standalone for several years, then acquired by Exar and shutdown in 11 months without ever making any new Exar branded adapters. Users would probably think of them as Neterion and not Exar (as there have been no follow-on adapters and the vast majority ever sold were under the Neterion name). 6c541b4595a2 ("net: ethernet: Sort Kconfig sourcing alphabetically") sorted Kconfig sourcing based on directory names, but in a couple cases, the menu item text is quite different from the directory name and is not sorted correctly: drivers/net/ethernet/neterion/Kconfig => "Exar devices" To address that and clear up any confusion about the name, "Exar" was changed to "Neterion (Exar)" and the relevant entries in the Makefile and Kconfig were reordered to match the alphabetical organization. Inspired-by: Bjorn Helgaas Signed-off-by: Jon Mason Signed-off-by: David S. Miller commit 969d509003b8d64f5766a16143bf22d56c1b66fe Author: zhong jiang Date: Wed Aug 1 00:50:24 2018 +0800 net/tls: Use kmemdup to simplify the code Kmemdup is better than kmalloc+memcpy. So replace them. Signed-off-by: zhong jiang Signed-off-by: David S. Miller commit b053fcc4a1c3c8f9080e2904acee73481fb58c44 Author: Colin Ian King Date: Tue Jul 31 17:01:37 2018 +0100 net/tipc: remove redundant variables 'tn' and 'oport' Variables 'tn' and 'oport' are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'oport' set but not used [-Wunused-but-set-variable] warning: variable 'tn' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Acked-by: Ying Xue Signed-off-by: David S. Miller commit 16b7db4c8150ba12e7eb63a5de962e1b05b3b612 Author: Miguel Ojeda Date: Mon Jul 30 18:24:31 2018 +0200 MAINTAINERS: Add .clang-format entry As discussed in https://lkml.org/lkml/2018/6/25/877 Signed-off-by: Miguel Ojeda commit e5121207f0532694b1065e29088c78e609b41e20 Merge: 96d395020e87 40c0066412be Author: David S. Miller Date: Wed Aug 1 09:39:10 2018 -0700 Merge branch 'be2net-next' Suresh Reddy says: ==================== be2net: patch-set v1->v2 : Modified the subject line and commit log. Please consider applying these two patches to net-next. ==================== Signed-off-by: David S. Miller commit 40c0066412be25aa6a706ba5eae54db23ee8ade2 Author: Suresh Reddy Date: Tue Jul 31 11:39:43 2018 -0400 be2net: Update the driver version to 12.0.0.0 Signed-off-by: Suresh Reddy Signed-off-by: David S. Miller commit c1b3bdb2ffa9a343ded117e01d6b4b43b9df53f8 Author: Suresh Reddy Date: Tue Jul 31 11:39:42 2018 -0400 be2net: gather debug info and reset adapter (only for Lancer) on a tx-timeout This patch handles a TX-timeout as follows: 1) This patch gathers and prints the following info that can help in diagnosing the cause of a TX-timeout. a) TX queue and completion queue entries. b) SKB and TCP/UDP header details. 2) For Lancer NICs (TX-timeout recovery is not supported for BE3/Skyhawk-R NICs), it recovers from the TX timeout as follows: a) On a TX-timeout, driver sets the PHYSDEV_CONTROL_FW_RESET_MASK bit in the PHYSDEV_CONTROL register. Lancer firmware goes into an error state and indicates this back to the driver via a bit in a doorbell register. b) Driver detects this and calls be_err_recover(). DMA is disabled, all pending TX skbs are unmapped and freed (be_close()). All rings are destroyed (be_clear()). c) The driver waits for the FW to re-initialize and re-creates all rings along with other data structs (be_resume()) Signed-off-by: Suresh Reddy Signed-off-by: David S. Miller commit 7bee9bd21b404a2fa76c1a8e0ff68379aeef2b91 Author: Jason Gunthorpe Date: Mon Jun 25 16:44:30 2018 -0600 clang-format: Set IndentWrappedFunctionNames false The true option causes this indenting for functions: static struct something_very_very_long * function(void *arg) { While a quick survey suggests that the usual Linux fallback is the GNU style: static struct something_very_very_long * function(void *arg) { Eg as seen in: kernel/cpu.c kernel/fork.c etc Acked-by: Joe Perches Signed-off-by: Jason Gunthorpe Signed-off-by: Miguel Ojeda commit 96d395020e87607b3454edc2f49a03ddcfbef986 Author: Gustavo A. R. Silva Date: Tue Jul 31 09:21:57 2018 -0500 net/mlx5e: Fix uninitialized variable There is a potential execution path in which variable *err* is returned without being properly initialized previously. Fix this by initializing variable *err* to 0. Addresses-Coverity-ID: 1472116 ("Uninitialized scalar variable") Fixes: 0ec13877ce95 ("net/mlx5e: Gather all XDP pre-requisite checks in a single function") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed Signed-off-by: David S. Miller commit bf774d141a33ea13e8cd11034ada395d3f23ef51 Author: YueHaibing Date: Tue Jul 31 22:12:30 2018 +0800 qed: Make some functions static Fixes the following sparse warning: drivers/net/ethernet/qlogic/qed/qed_cxt.c:1534:6: warning: symbol 'qed_cm_init_pf' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_dev.c:233:4: warning: symbol 'qed_init_qm_get_num_tcs' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_dev.c:238:5: warning: symbol 'qed_init_qm_get_num_vfs' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_dev.c:246:5: warning: symbol 'qed_init_qm_get_num_pf_rls' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_dev.c:264:5: warning: symbol 'qed_init_qm_get_num_vports' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_dev.c:276:5: warning: symbol 'qed_init_qm_get_num_pqs' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_mcp.c:573:5: warning: symbol 'qed_mcp_nvm_wr_cmd' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_mcp.c:3012:1: warning: symbol '__qed_mcp_resc_lock' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_dcbx.c:870:6: warning: symbol 'qed_dcbx_aen' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_debug.c:7841:5: warning: symbol 'qed_dbg_nvm_image_length' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_debug.c:7857:5: warning: symbol 'qed_dbg_nvm_image' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_sriov.c:675:6: warning: symbol '_qed_iov_pf_sanity_check' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_sriov.c:690:6: warning: symbol 'qed_iov_pf_sanity_check' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_sriov.c:3982:6: warning: symbol 'qed_iov_pf_get_pending_events' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_vf.c:172:5: warning: symbol '_qed_vf_pf_release' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_rdma.c:137:5: warning: symbol 'qed_rdma_get_sb_id' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_rdma.c:709:5: warning: symbol 'qed_rdma_stop' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_ll2.c:161:6: warning: symbol 'qed_ll2b_complete_rx_packet' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_roce.c:160:6: warning: symbol 'qed_roce_free_cid_pair' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_iwarp.c:380:12: warning: symbol 'iwarp_state_names' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_iwarp.c:946:1: warning: symbol 'qed_iwarp_parse_private_data' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_iwarp.c:971:1: warning: symbol 'qed_iwarp_mpa_reply_arrived' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_iwarp.c:2504:1: warning: symbol 'qed_iwarp_ll2_slowpath' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_iwarp.c:2806:6: warning: symbol 'qed_iwarp_qp_in_error' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_iwarp.c:2827:6: warning: symbol 'qed_iwarp_exception_received' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_iwarp.c:2958:1: warning: symbol 'qed_iwarp_connect_complete' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_iscsi.c:876:6: warning: symbol 'qed_iscsi_free_connection' was not declared. Should it be static? Signed-off-by: YueHaibing Acked-by: Denis Bolotin Signed-off-by: David S. Miller commit 7d95178c77014dbd8dce36ee40bbbc5e6c121ff5 Author: Theodore Ts'o Date: Wed Aug 1 12:36:52 2018 -0400 ext4: check for NUL characters in extended attribute's name Extended attribute names are defined to be NUL-terminated, so the name must not contain a NUL character. This is important because there are places when remove extended attribute, the code uses strlen to determine the length of the entry. That should probably be fixed at some point, but code is currently really messy, so the simplest fix for now is to simply validate that the extended attributes are sane. https://bugzilla.kernel.org/show_bug.cgi?id=200401 Reported-by: Wen Xu Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit e65d4d96334e3ff4fe0064612a93a51c63de08de Author: Ka-Cheong Poon Date: Mon Jul 30 22:48:42 2018 -0700 rds: Remove IPv6 dependency This patch removes the IPv6 dependency from RDS. Signed-off-by: Ka-Cheong Poon Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit f394ad28feffbeebab77c8bf9a203bd49b957c9a Author: Ka-Cheong Poon Date: Mon Jul 30 22:48:41 2018 -0700 rds: rds_ib_recv_alloc_cache() should call alloc_percpu_gfp() instead Currently, rds_ib_conn_alloc() calls rds_ib_recv_alloc_caches() without passing along the gfp_t flag. But rds_ib_recv_alloc_caches() and rds_ib_recv_alloc_cache() should take a gfp_t parameter so that rds_ib_recv_alloc_cache() can call alloc_percpu_gfp() using the correct flag instead of calling alloc_percpu(). Signed-off-by: Ka-Cheong Poon Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit fea49f60c9b748abf4a1a9b2e9391d0c5b003848 Author: Ivan Khoronzhuk Date: Tue Jul 31 01:05:39 2018 +0300 net: ethernet: ti: cpsw: replace unnecessarily macroses on functions Replace ugly macroses on functions. Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 5a6cd13d4faef48bdcb7ae9c1e98175332ced7cd Author: Gustavo A. R. Silva Date: Wed Aug 1 10:58:25 2018 -0500 ALSA: pcm: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1357375 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 5ef2a69993676a0dfd49bf60ae1323eb8a288366 Author: Wang Shilong Date: Wed Aug 1 12:02:31 2018 -0400 ext4: use ext4_warning() for sb_getblk failure Out of memory should not be considered as critical errors; so replace ext4_error() with ext4_warnig(). Signed-off-by: Wang Shilong Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit 822c2621daadcf9e8fa8f11f7334e3c349434154 Author: Arnaldo Carvalho de Melo Date: Wed Aug 1 10:50:51 2018 -0300 perf bpf: Include uapi/linux/bpf.h from the 'perf trace' script's bpf.h The next example scripts need the definition for the BPF functions, i.e. things like BPF_FUNC_probe_read, and in time will require lots of other definitions found in uapi/linux/bpf.h, so include it from the bpf.h file included from the eBPF scripts build with clang via '-e bpf_script.c' like in this example: $ tail -8 tools/perf/examples/bpf/5sec.c #include int probe(hrtimer_nanosleep, rqtp->tv_sec)(void *ctx, int err, long sec) { return sec == 5; } license(GPL); $ That 'bpf.h' include in the 5sec.c eBPF example will come from a set of header files crafted for building eBPF objects, that in a end-user system will come from: /usr/lib/perf/include/bpf/bpf.h And will include either from the place where the kernel was built, or from a kernel-devel rpm package like: -working-directory /lib/modules/4.17.9-100.fc27.x86_64/build That is set up by tools/perf/util/llvm-utils.c, and can be overriden by setting the 'kbuild-dir' variable in the "llvm" ~/.perfconfig file, like: # cat ~/.perfconfig [llvm] kbuild-dir = /home/foo/git/build/linux This usually doesn't need any change, just documenting here my findings while working with this code. In the future we may want to instead just use what is in /usr/include/linux/bpf.h, that comes from the UAPI provided from the kernel sources, for now, to avoid getting the kernel's non-UAPI "linux/bpf.h" file, that will cause clang to fail and is not what we want anyway (no BPF function definitions, etc), do it explicitely by asking for "uapi/linux/bpf.h". Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-zd8zeyhr2sappevojdem9xxt@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 21b8732eb4479b579bda9ee38e62b2c312c2a0e5 Author: Christophe Leroy Date: Fri Sep 22 13:20:43 2017 +0200 perf tools: Allow overriding MAX_NR_CPUS at compile time After update of kernel, the perf tool doesn't run anymore on my 32MB RAM powerpc board, but still runs on a 128MB RAM board: ~# strace perf execve("/usr/sbin/perf", ["perf"], [/* 12 vars */]) = -1 ENOMEM (Cannot allocate memory) --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} --- +++ killed by SIGSEGV +++ Segmentation fault objdump -x shows that .bss section has a huge size of 24Mbytes: 27 .bss 016baca8 101cebb8 101cebb8 001cd988 2**3 With especially the following objects having quite big size: 10205f80 l O .bss 00140000 runtime_cycles_stats 10345f80 l O .bss 00140000 runtime_stalled_cycles_front_stats 10485f80 l O .bss 00140000 runtime_stalled_cycles_back_stats 105c5f80 l O .bss 00140000 runtime_branches_stats 10705f80 l O .bss 00140000 runtime_cacherefs_stats 10845f80 l O .bss 00140000 runtime_l1_dcache_stats 10985f80 l O .bss 00140000 runtime_l1_icache_stats 10ac5f80 l O .bss 00140000 runtime_ll_cache_stats 10c05f80 l O .bss 00140000 runtime_itlb_cache_stats 10d45f80 l O .bss 00140000 runtime_dtlb_cache_stats 10e85f80 l O .bss 00140000 runtime_cycles_in_tx_stats 10fc5f80 l O .bss 00140000 runtime_transaction_stats 11105f80 l O .bss 00140000 runtime_elision_stats 11245f80 l O .bss 00140000 runtime_topdown_total_slots 11385f80 l O .bss 00140000 runtime_topdown_slots_retired 114c5f80 l O .bss 00140000 runtime_topdown_slots_issued 11605f80 l O .bss 00140000 runtime_topdown_fetch_bubbles 11745f80 l O .bss 00140000 runtime_topdown_recovery_bubbles This is due to commit 4d255766d28b1 ("perf: Bump max number of cpus to 1024"), because many tables are sized with MAX_NR_CPUS This patch gives the opportunity to redefine MAX_NR_CPUS via $ make EXTRA_CFLAGS=-DMAX_NR_CPUS=1 Signed-off-by: Christophe Leroy Cc: Alexander Shishkin Cc: Peter Zijlstra Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/20170922112043.8349468C57@po15668-vm-win7.idsi0.si.c-s.fr Signed-off-by: Arnaldo Carvalho de Melo commit 2c323017e381c55c5ce2a603b8305bb18c1162cc Author: Josef Bacik Date: Tue Jul 31 12:39:04 2018 -0400 blk-cgroup: clear the throttle queue on fork We were hitting a panic in production where we put too many times on the request queue. This is because we'd get the throttle_queue of the parent if we fork()'ed while we needed to be throttled, but we didn't have a reference on it. Instead just clear these flags on fork so the child doesn't pay for the sins of its father. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit cc7ecc258562b065ef638c4b45e20953d57fb564 Author: Josef Bacik Date: Tue Jul 31 12:39:03 2018 -0400 blk-cgroup: hold the queue ref during throttling The blkg lifetime is protected by the queue lifetime, so we need to put the queue _after_ we're done using the blkg. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 52a1199ccd426ad583ade4eb678b3b5846c58f43 Author: Josef Bacik Date: Tue Jul 31 12:39:02 2018 -0400 blk-iolatency: fix blkg leak in timer_fn At this point we have a ref on the blkg, we need to drop it if we don't have a iolat. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 4725549192c9633b6a3740bf23770cb758bee4a0 Author: zhong jiang Date: Wed Aug 1 00:13:14 2018 +0800 block/bsg-lib: use PTR_ERR_OR_ZERO to simplify the flow path Simplify the code by using the PTR_ERR_OR_ZERO, instead of the open code. It is better. Reviewed-by: Johannes Thumshirn Signed-off-by: zhong jiang Signed-off-by: Jens Axboe commit 81351776c9fbbbd0de1dc1542f30aacfe68efc4e Author: Taniya Das Date: Mon Jul 23 16:24:35 2018 +0530 clk: qcom: Add display clock controller driver for SDM845 Add support for the display clock controller found on SDM845 based devices. This would allow display drivers to probe and control their clocks. Signed-off-by: Taniya Das [sboyd@kernel.org: Remove CLK_GET_RATE_NOCACHE everywhere] Signed-off-by: Stephen Boyd commit 56830d6cc114f76f656d5e65ab355b070d5a695e Author: Darrick J. Wong Date: Wed Aug 1 07:40:48 2018 -0700 xfs: check da node magic in _node_lookup_int Before we start processing what we /think/ is a da3 node block, actually check the magic to make sure that we're looking at a node block. This way we won't blow the asserts in _node_hdr_from_disk on corrupted metadata. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino commit 611995db2ce210d20d51c5270639b750476534e5 Author: Darrick J. Wong Date: Wed Aug 1 07:40:48 2018 -0700 xfs: use a local variable for magic number in xfs_da3_node_lookup_int Use a local variable for the block magic number checks instead of abusing blk->magic. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino commit 0c60d3aa0e2d007e7f79c96c118da25f594afe02 Author: Darrick J. Wong Date: Wed Aug 1 07:40:48 2018 -0700 xfs: refactor log recovery check Add a predicate to decide if the log is actively in recovery and use that instead of open-coding a pagf_init check in the attr leaf verifier. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino commit 4b859db2c60692560afbfef1b030d0ddef57b7ee Author: Lorenzo Bianconi Date: Sat Jul 28 10:19:14 2018 +0200 spi: spi-gpio: add SPI_3WIRE support Add SPI_3WIRE support to spi-gpio controller introducing set_line_direction function pointer in spi_bitbang data structure. Spi-gpio controller has been tested using hts221 temp/rh iio sensor running in 3wire mode and lsm6dsm running in 4wire mode Signed-off-by: Lorenzo Bianconi Signed-off-by: Mark Brown commit 304d34360b099020a12af2abb7e1ac506f4ba16d Author: Lorenzo Bianconi Date: Sat Jul 28 10:19:13 2018 +0200 spi: add flags parameter to txrx_word function pointers Add the capability to specify the flag parameter used in bitbang_txrx_be_cpha{0,1} through the txrx_word function pointers of spi_bitbang data structure. That feature will be used to add spi-3wire support to the spi-gpio controller Signed-off-by: Lorenzo Bianconi Signed-off-by: Mark Brown commit 9fb4c2bf130b922c77c16a8368732699799c40de Author: Akshu Agrawal Date: Wed Aug 1 15:37:33 2018 +0530 ASoC: soc-pcm: Use delay set in component pointer function Take into account the base delay set in pointer callback. There are cases where a pointer function populates runtime->delay, such as: ./sound/pci/hda/hda_controller.c ./sound/soc/intel/atom/sst-mfld-platform-pcm.c This delay was getting lost and was overwritten by delays from codec or cpu dai delay function if exposed. Now, Total delay = base delay + cpu_dai delay + codec_dai delay Signed-off-by: Akshu Agrawal Reviewed-by: Takashi Iwai Signed-off-by: Mark Brown commit b74fd69043262003c5b7ce545e59f5a7234ab290 Author: Mark Brown Date: Wed Aug 1 14:22:56 2018 +0100 ASoC: wcd9335: Fix build This reverts commit e57d4ca882e28 (ASoC: wcd9335: add support to wcd9335 codec) due to build failures caused by missing dependencies. Signed-off-by: Mark Brown commit b0a39d356ae1478a5876bb02ba08af155a3a5554 Author: Mark Brown Date: Wed Aug 1 14:18:50 2018 +0100 ASoC: wcd9335: Fix build due to CLASS-H Controller support This reverts commit c8cb5f775c8dac (ASoC: vert "ASoC: wcd9335: add CLASS-H Controller support) due to missing dependencies. Signed-off-by: Mark Brown commit d0b35a42031a3107a5735e0d0a605a68f530a96b Author: David Howells Date: Mon Jul 23 17:18:38 2018 +0100 rxrpc: Transmit more ACKs during data reception Immediately flush any outstanding ACK on entry to rxrpc_recvmsg_data() - which transfers data to the target buffers - if we previously had an Rx underrun (ie. we returned -EAGAIN because we ran out of received data). This lets the server know what we've managed to receive something. Also flush any outstanding ACK after calling the function if it hit -EAGAIN to let the server know we processed some data. It might be better to send more ACKs, possibly on a time-based scheme, but that needs some more consideration. With this and some additional AFS patches, it is possible to get large unencrypted O_DIRECT reads to be almost as fast as NFS over TCP. It looks like it might be theoretically possible to improve performance yet more for a server running a single operation as investigation of packet timestamps indicates that the server keeps stalling. The issue appears to be that rxrpc runs in to trouble with ACK packets getting batched together (up to ~32 at a time) somewhere between the IP transmit queue on the client and the ethernet receive queue on the server. However, this case isn't too much of a worry as even a lightly loaded server should be receiving sufficient packet flux to flush the ACK packets to the UDP socket. Signed-off-by: David Howells commit a71a2651bdd3ad9ccae7d8e8c6782727c7ecba98 Author: David Howells Date: Mon Jul 23 17:18:37 2018 +0100 rxrpc: Propose, but don't immediately transmit, the final ACK for a call The final ACK that closes out an rxrpc call needs to be transmitted by the client unless we're going to follow up with a DATA packet for a new call on the same channel (which implicitly ACK's the previous call, thereby saving an ACK). Currently, we don't do that, so if no follow on call is immediately forthcoming, the server will resend the last DATA packet - at which point rxrpc_conn_retransmit_call() will be triggered and will (re)send the final ACK. But the server has to hold on to the last packet until the ACK is received, thereby holding up its resources. Fix the client side to propose a delayed final ACK, to be transmitted after a short delay, assuming the call isn't superseded by a new one. Signed-off-by: David Howells commit 4075295ab87670e33eaf98389e319ce84c54c8e4 Author: David Howells Date: Mon Jul 23 17:18:37 2018 +0100 rxrpc: Increase the size of a call's Rx window Increase the size of a call's Rx window from 32 to 63 - ie. one less than the size of the ring buffer. This makes large data transfers perform better when the Tx window on the other side is around 64 (as is the case with Auristor's YFS fileserver). If the server window size is ~32 or smaller, this should make no difference. Signed-off-by: David Howells commit 4272d3034e69aea6e17085ba285d14f5824b430d Author: David Howells Date: Mon Jul 23 17:18:37 2018 +0100 rxrpc: Trace socket notification Trace notifications from the softirq side of the socket to the process-context side. Signed-off-by: David Howells commit 197445aff13c164794efb6d87a28762e843622d8 Author: David Howells Date: Mon Jul 23 17:18:37 2018 +0100 rxrpc: Fix ACK proposal tracepoint Fix the ACK proposal tracepoint outcomes list by making the one that's an empty string not an empty string - which gets rendered as a hex number string instead. Signed-off-by: David Howells commit 4764c0da69dc500791c840c88dfd940d13b452e7 Author: David Howells Date: Mon Jul 23 17:18:37 2018 +0100 rxrpc: Trace packet transmission Trace successful packet transmission (kernel_sendmsg() succeeded, that is) in AF_RXRPC. We can share the enum that defines the transmission points with the trace_rxrpc_tx_fail() tracepoint, so rename its constants to be applicable to both. Also, save the internal call->debug_id in the rxrpc_channel struct so that it can be used in retransmission trace lines. Signed-off-by: David Howells commit f3f8337c9e2a4964671c652469202ec485afddc0 Author: David Howells Date: Mon Jul 23 17:18:36 2018 +0100 rxrpc: Fix the trace for terminal ACK (re)transmission Fix the trace for terminal ACK (re)transmission to put in the right parameters. Signed-off-by: David Howells commit 6b97bd7a272cddc48adb384142db99a935834765 Author: David Howells Date: Mon Jul 23 17:18:36 2018 +0100 rxrpc: Show some more information through /proc files Show the four current call IDs in /proc/net/rxrpc/conns. Show the current packet Rx serial number in /proc/net/rxrpc/calls. Signed-off-by: David Howells commit 887763bbc34112f4126ec52d16072ba736c83a6f Author: David Howells Date: Mon Jul 23 17:18:36 2018 +0100 rxrpc: Display call expect-receive-by timeout in proc Display in /proc/net/rxrpc/calls the timeout by which a call next expects to receive a packet. This makes it easier to debug timeout issues. Signed-off-by: David Howells commit f597a5792ada511e3c69ecf7201fc178c574d822 Author: YueHaibing Date: Wed Aug 1 17:52:34 2018 +0800 rxrpc: remove redundant variables 'sp' and 'did_discard' Variables 'sp' and 'did_discard' are being assigned, but are never used, hence they are redundant and can be removed. fix following warning: net/rxrpc/call_event.c:165:25: warning: variable 'sp' set but not used [-Wunused-but-set-variable] net/rxrpc/conn_client.c:1054:7: warning: variable 'did_discard' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Signed-off-by: David Howells commit 7f38abf220e2c800a2c451372e9f07ed5fd0ea49 Author: Hongjie Fang Date: Tue Jul 31 10:55:09 2018 +0800 mmc: core: improve reasonableness of bus width setting for HS400es mmc_select_hs400es() calls mmc_select_bus_width() which will continue to set 4bit transfer mode if fail to set 8bit mode. The bus width should not be set to 4bit in HS400es. When fail to set 8bit mode, need return error directly for HS400es. Signed-off-by: Hongjie Fang Signed-off-by: Ulf Hansson commit d36455a38ed82e7d1e6807573935874f0b279f45 Author: Colin Ian King Date: Wed Aug 1 11:47:41 2018 +0100 ALSA: usb-audio: remove redundant pointer 'urb' Pointer 'urb' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'urb' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit 0d00085b905c904d6de4296aa6a1e3613d0a4d67 Author: Colin Ian King Date: Wed Aug 1 11:47:38 2018 +0100 ALSA: sonicvibes: remove redundant pointer 'dir' Pointer 'dir' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'dir' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit 3b0cbc7812d759ffb38d881e75c0318512283d00 Author: Colin Ian King Date: Wed Aug 1 11:47:37 2018 +0100 ALSA: ens137x: remove redundant array pcm_devs The array pcm_devs is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'pcm_devs' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit de42b4b96ebe29058ce1cb59a1f98d58b8abd132 Author: Colin Ian King Date: Wed Aug 1 11:47:36 2018 +0100 ALSA: emu10k1: remove redundant variable attn Variable attn is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'attn' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit 45bf41005ac0d7cae0c1caa85d06cb35976823fa Author: Colin Ian King Date: Wed Aug 1 11:47:35 2018 +0100 ALSA: cs5535audio: remove redundant pointer 'dma' Pointer 'dma' is being assigned but is never used hence it is redundant and can be removed. Cleans up two clang warnings: warning: variable 'dma' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit 96963dedd000605a0e84e2ac6e41263a50f05953 Author: Colin Ian King Date: Wed Aug 1 11:47:34 2018 +0100 ALSA: asihpi: remove redundant variable max_streams Variable max_streams is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'max_streams' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit 18127744cf446f113ca33f07e5cea893388f781a Author: Colin Ian King Date: Wed Aug 1 11:47:40 2018 +0100 ASoC: stm32: remove redundant pointers 'priv' and 'rtd' Pointer 'priv' is assigned and not used, removing this allows the removal of pointer 'rtd'. Cleans up clang warning: warning: variable 'priv' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Mark Brown commit d101f9b96ee08f0454989bc3adb10e6cf7f3f953 Author: Colin Ian King Date: Wed Aug 1 11:47:39 2018 +0100 ASoC: nau8540: remove redundant variable osrate Variable osrate is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'osrate' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Mark Brown commit 6b1687bf76ef84cb1e31386c4871a01fe66937bf Author: Rohit kumar Date: Wed Aug 1 14:31:09 2018 +0530 ASoC: qcom: add sdm845 sound card support This patch adds sdm845 audio machine driver support. Acked-by: Srinivas Kandagatla Signed-off-by: Rohit kumar Signed-off-by: Mark Brown commit c25e295cd77b37903ddc9ee27384e17aad08f27c Author: Rohit kumar Date: Wed Aug 1 14:31:08 2018 +0530 ASoC: qcom: Add support to parse common audio device nodes This adds support to parse cpu, platform and codec device nodes and add them in dai-links. Also, update apq8096 machine driver to use the common API. Acked-by: Srinivas Kandagatla Signed-off-by: Rohit kumar Signed-off-by: Mark Brown commit 0c901e8cea15ba1e318d8f4342f7dc27a80b5978 Author: Rohit kumar Date: Wed Aug 1 14:31:07 2018 +0530 ASoC: dt-bindings: Update dt binding name for apq8096 Remove qcom prefix from machine driver dt bindings of apq8096 SoC. Acked-by: Srinivas Kandagatla Reviewed-by: Rob Herring Signed-off-by: Rohit kumar Signed-off-by: Mark Brown commit 00bc22e3eea0346b594442331df53d0d1e7104dd Author: Rohit kumar Date: Wed Aug 1 14:31:06 2018 +0530 ASoC: qcom: dt-bindings: Add sdm845 machine bindings Add devicetree bindings documentation file for SDM845 sound card. Reviewed-by: Rob Herring Signed-off-by: Rohit kumar Signed-off-by: Mark Brown commit 1a3ea2d9837dc94897e4a5b2145bae12b0608341 Merge: a0b5031582c3 9fba738a53dd Author: Mark Brown Date: Wed Aug 1 11:43:52 2018 +0100 Merge tag 'clk-core-duty-cycle-for-mark' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux into asoc-4.19 Duty cycle support for the clk api and drivers. commit 5ba155a4d4cc8e4cdd3db6df7d03271a3bd91177 Author: Keiji Hayashibara Date: Wed Aug 1 16:29:12 2018 +0900 spi: add SPI controller driver for UniPhier SoC Add SPI controller driver implemented in Socionext UniPhier SoCs. UniPhier SoCs have two types SPI controllers; SCSSI supports a single channel, and MCSSI supports multiple channels. This driver supports SCSSI only. This controller has 32bit TX/RX FIFO with depth of eight entry, and supports the SPI master mode only. This commit is implemented in PIO transfer mode, not DMA transfer. Signed-off-by: Kunihiko Hayashi Signed-off-by: Keiji Hayashibara Reviewed-by: Andy Shevchenko Signed-off-by: Mark Brown commit e401bfdadd2dc0f59bf76220236285130f072190 Author: Masahiro Yamada Date: Wed Jul 25 17:46:14 2018 +0900 mmc: tmio: remove unneeded variable in tmio_mmc_start_command() Pass TMIO_MASK_CMD to tmio_mmc_enable_mmc_irqs() directly, and remove the variable, irq_mask. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang Signed-off-by: Ulf Hansson commit 5c99826b27d0afd4c05c2013385b17037f579cf9 Author: Niklas Söderlund Date: Tue Jul 24 16:51:38 2018 +0200 mmc: renesas_sdhi: Fix sampling clock position selecting When tuning each tap is issued CMD19 twice and the result of both runs recorded in host->taps. If the result is different between the two runs the wrong sampling clock position was selected. Fix this by merging the two runs and only keep the result for each tap if it was good in both sets. Signed-off-by: Niklas Söderlund Reviewed-by: Simon Horman Tested-by: Wolfram Sang Reviewed-by: Wolfram Sang Signed-off-by: Ulf Hansson commit a8f399f624e1ae902828ad788f3601ff7b3e0eed Author: Masaharu Hayakawa Date: Tue Jul 24 16:51:37 2018 +0200 mmc: tmio: Fix tuning flow If the return value of mmc_send_tuning() is error other than -EILSEQ, the tuning fails and process goes out of for_loop. The correct processing is to judge their TAP as not good (NG) and continue. Signed-off-by: Masaharu Hayakawa [Niklas: update commit message] Signed-off-by: Niklas Söderlund Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit 1389690be14601995f55417a129b89257c477997 Author: Andre Przywara Date: Mon Jul 23 16:34:31 2018 +0100 mmc: sunxi: remove output of virtual base address Recent Linux versions refuse to print actual virtual kernel addresses, to not give a hint about the location of the kernel in a randomized virtual address space. This affects the output of the sunxi MMC controller driver, which now produces the rather uninformative line: [ 1.482660] sunxi-mmc 1c0f000.mmc: base:0x(____ptrval____) irq:8 Since the virtual base address is not really interesting in the first place, let's just drop this value. The same applies to Linux' notion of the interrupt number, which is independent from the GIC SPI number. We have the physical address as part of the DT node name, which is way more useful for debugging purposes. To keep a success message in the driver, we make this purpose explicit with the word "initialized", plus print some information that is not too obvious and that we learned while probing the device: the maximum request size and whether it uses the new timing mode. So the output turns into: [ 1.750626] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB, uses new timings mode [ 1.786699] sunxi-mmc 1c11000.mmc: initialized, max. request size: 2048 KB Signed-off-by: Andre Przywara Acked-by: Maxime Ripard Signed-off-by: Ulf Hansson commit 3cc89c12fb2cc3a949465e69ed15e3ea7df8b22b Author: Liang Chen Date: Mon Jul 23 17:25:20 2018 +0800 dt-bindings: mmc: rockchip-dw-mshc: add description for px30 Add "rockchip,px30-dw-mshc", "rockchip,rk3288-dw-mshc" for dwmmc on px30 platform. Acked-by: Rob Herring Signed-off-by: Liang Chen Signed-off-by: Ulf Hansson commit e432e4207c3e76951947dd9a93a86025e075a905 Author: Wolfram Sang Date: Sat Jul 21 13:14:49 2018 +0200 mmc: renesas_sdhi: Add r8a77990 support This patch adds SDHI support for the R8A77990 SoC (R-Car E3). No driver changes needed for anything except HS400 which we will enable separately later. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Signed-off-by: Ulf Hansson commit 88023d43ffe114d4f8c35995151ef6f8633f234a Author: Icenowy Zheng Date: Sun Jul 22 20:54:07 2018 +0800 mmc: sunxi: allow 3.3V DDR when DDR is available Some Allwinner boards feature an on-board eMMC with fixed 3.3V voltage (e.g. Banana Pi M2+), and in this case both the eMMC and the SoC are capable of doing 3.3V DDR transmission. Add capability of 3.3V DDR when DDR is available (extra clock or new timing). Signed-off-by: Icenowy Zheng Acked-by: Maxime Ripard Signed-off-by: Ulf Hansson commit 29aba07aea0e36c996001ca3f8997316ebefe0e1 Author: Ulf Hansson Date: Mon Jul 16 13:08:18 2018 +0200 mmc: mmci: Add and implement a ->dma_setup() callback for qcom dml As a first step to improve the variant specific code for mmci, add a ->dma_setup() callback to the struct mmci_host_ops. To show its use, let's deploy the callback for the qcom dml, which involves also to the assign the mmci_host_ops pointer from the variant ->init() callback. Signed-off-by: Ulf Hansson Reviewed-by: Ludovic Barre commit a0b5031582c38f6e2685f7ab9bb0a4168e2a5d1b Merge: c8cb5f775c8d a57942bfdd61 Author: Mark Brown Date: Wed Aug 1 10:32:05 2018 +0100 Merge branch 'topic/drm_audio_component' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-4.19 commit 4dcd5c2781f3c5c7851800649047658956d590af Author: Kunihiko Hayashi Date: Wed Aug 1 16:29:11 2018 +0900 spi: add DT bindings for UniPhier SPI controller Add DT bindings for SPI controller implemented in UniPhier SoCs. Signed-off-by: Kunihiko Hayashi Signed-off-by: Keiji Hayashibara Reviewed-by: Rob Herring Signed-off-by: Mark Brown commit ed128e8b757b4e759e5585df720888b30a7f2196 Author: Miquel Raynal Date: Wed Jul 25 16:56:28 2018 +0200 MAINTAINERS: drop Wenyou Yang from Atmel NAND driver support Mails to wenyou.yang@microchip.com are not deliverable. Drop him as Microchip/Atmel NAND controller driver maintainer. Signed-off-by: Miquel Raynal Acked-by: Boris Brezillon Acked-by: Alexandre Belloni commit 3d3fe3c05d5a17ebdf55b936c51017c127c0ed44 Author: Miquel Raynal Date: Wed Jul 25 15:31:52 2018 +0200 mtd: rawnand: allocate dynamically ONFI parameters during detection Now that it is possible to do dynamic allocations during the identification phase, convert the onfi_params structure (which is only needed with ONFI compliant chips) into a pointer that will be allocated only if needed. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 64f2cafc3da77da7b176f2cdc3eb3fdb031c639f Author: Souptick Joarder Date: Wed Aug 1 00:58:33 2018 +0530 drm/imx: Convert drm_atomic_helper_suspend/resume() convert drm_atomic_helper_suspend/resume() to use drm_mode_config_helper_suspend/resume(). with this conversion, the remaining member of struct imx_drm_device, state, will be no more useful and it could be removed forever. Signed-off-by: Souptick Joarder Signed-off-by: Ajit Negi [p.zabel@pengutronix.de: rebased onto drm-next, updated commit message] Signed-off-by: Philipp Zabel commit bb276262e88dae52cc717bb636b7468f66bb234e Author: Brian Norris Date: Fri Jul 27 11:33:13 2018 -0700 mtd: spi-nor: only apply reset hacks to broken hardware Commit 59b356ffd0b0 ("mtd: m25p80: restore the status of SPI flash when exiting") is the latest from a long history of attempts to add reboot handling to handle stateful addressing modes on SPI flash. Some prior mostly-related discussions: http://lists.infradead.org/pipermail/linux-mtd/2013-March/046343.html [PATCH 1/3] mtd: m25p80: utilize dedicated 4-byte addressing commands http://lists.infradead.org/pipermail/barebox/2014-September/020682.html [RFC] MTD m25p80 3-byte addressing and boot problem http://lists.infradead.org/pipermail/linux-mtd/2015-February/057683.html [PATCH 2/2] m25p80: if supported put chip to deep power down if not used Previously, attempts to add reboot-time software reset handling were rejected, but the latest attempt was not. Quick summary of the problem: Some systems (e.g., boot ROM or bootloader) assume that they can read initial boot code from their SPI flash using 3-byte addressing. If the flash is left in 4-byte mode after reset, these systems won't boot. The above patch provided a shutdown/remove hook to attempt to reset the addressing mode before we reboot. Notably, this patch misses out on huge classes of unexpected reboots (e.g., crashes, watchdog resets). Unfortunately, it is essentially impossible to solve this problem 100%: if your system doesn't know how to reset the SPI flash to power-on defaults at initialization time, no amount of software can really rescue you -- there will always be a chance of some unexpected reset that leaves your flash in an addressing mode that your boot sequence didn't expect. While it is not directly harmful to perform hacks like the aforementioned commit on all 4-byte addressing flash, a properly-designed system should not need the hack -- and in fact, providing this hack may mask the fact that a given system is indeed broken. So this patch attempts to apply this unsound hack more narrowly, providing a strong suggestion to developers and system designers that this is truly a hack. With luck, system designers can catch their errors early on in their development cycle, rather than applying this hack long term. But apparently enough systems are out in the wild that we still have to provide this hack. Document a new device tree property to denote systems that do not have a proper hardware (or software) reset mechanism, and apply the hack (with a loud warning) only in this case. Signed-off-by: Brian Norris Reviewed-by: Guenter Roeck Signed-off-by: Boris Brezillon commit 3938c0d4cf60477ec776c9a7751226b06bb3c3c0 Author: Nicholas Mc Guire Date: Sat Jul 21 16:21:51 2018 +0200 mtd: spi-nor: cadence-quadspi: fix timeout handling wait_for_completion_timeout returns an unsigned long not an int, so let's check its return value directly instead of storing it in ret, and avoid checking for negative values since this cannot happen. Signed-off-by: Nicholas Mc Guire Signed-off-by: Boris Brezillon commit 261b354caf299a3ff54ba5b35636687c857a0075 Author: Boris Brezillon Date: Fri Jul 20 11:57:41 2018 +0200 mtd: spi-nor: atmel-quadspi: Include gpio/consumer.h instead of gpio.h GPIO consumers now include instead of if they can. Signed-off-by: Boris Brezillon commit 11edc1133e3023e6452d6934c3f22d65a9c05fe8 Author: Rafał Miłecki Date: Sat Jul 21 13:55:10 2018 +0200 mtd: spi-nor: intel-spi: use mtd_device_register() This driver doesn't specify parsers so it can use that little helper. Signed-off-by: Rafał Miłecki Signed-off-by: Boris Brezillon commit 5f0d02270d0a7a71dde2d4be3566733bba4d951e Author: Benjamin Gaignard Date: Fri Jul 6 15:05:25 2018 +0200 mtd: spi-nor: stm32-quadspi: replace "%p" with "%pK" The format specifier "%p" can leak kernel addresses. Use "%pK" instead. Signed-off-by: Benjamin Gaignard Signed-off-by: Boris Brezillon commit de217c1cca435a39f79cf9cb9279764688fc1cc4 Author: Claudiu Beznea Date: Mon Jun 4 11:46:33 2018 +0300 mtd: spi-nor: atmel-quadspi: add suspend/resume hooks Implement suspend/resume hooks. Signed-off-by: Claudiu Beznea Reviewed-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit 7992c18810e568b95c869b227137a2215702a805 Author: Mark Salyzyn Date: Tue Jul 31 15:02:13 2018 -0700 Bluetooth: hidp: buffer overflow in hidp_process_report CVE-2018-9363 The buffer length is unsigned at all layers, but gets cast to int and checked in hidp_process_report and can lead to a buffer overflow. Switch len parameter to unsigned int to resolve issue. This affects 3.18 and newer kernels. Signed-off-by: Mark Salyzyn Fixes: a4b1b5877b514b276f0f31efe02388a9c2836728 ("HID: Bluetooth: hidp: make sure input buffers are big enough") Cc: Marcel Holtmann Cc: Johan Hedberg Cc: "David S. Miller" Cc: Kees Cook Cc: Benjamin Tissoires Cc: linux-bluetooth@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: security@kernel.org Cc: kernel-team@android.com Acked-by: Kees Cook Signed-off-by: Marcel Holtmann commit fb7d7518b0d65955f91c7b875c36eae7694c69bd Author: Martin Schwidefsky Date: Tue Jul 31 16:14:18 2018 +0200 s390/numa: move initial setup of node_to_cpumask_map The numa_init_early initcall sets the node_to_cpumask_map[0] to the full cpu_possible_mask. Unfortunately this early_initcall is too late, the NUMA setup for numa=emu is done even earlier. The order of calls is numa_setup() -> emu_update_cpu_topology(), then the early_initcalls(), followed by sched_init_domains(). Starting with git commit 051f3ca02e46432c0965e8948f00c07d8a2f09c0 "sched/topology: Introduce NUMA identity node sched domain" the incorrect node_to_cpumask_map[0] really screws up the domain setup and the kernel panics with the follow oops: Cc: # v4.15+ Signed-off-by: Martin Schwidefsky commit 07d268f541dee9e58ded056fb6782942faa89a91 Merge: c8f8a0b50b82 365e660fc88d Author: Olof Johansson Date: Tue Jul 31 19:14:11 2018 -0700 Merge tag 'v4.19-rockchip-defconfig64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/defconfig Enablement of some more features relevant to rk3399-kevin (Chromebook Plus) * tag 'v4.19-rockchip-defconfig64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: defconfig: Enable more peripherals for Samsung Chromebook Plus. Signed-off-by: Olof Johansson commit 4f53a4a76cdff0c33f40a31785712da5911769fc Merge: 2dd207c91ab7 0fbfe10fa96b Author: Olof Johansson Date: Tue Jul 31 19:13:27 2018 -0700 Merge tag 'v4.19-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt A new board, the Vamrs Ficus using the rk3399 and followin the 96boards standard. LEDs and power button for the rk3399 firefly and removal of some deprecated type-c properties from the rk3399 devicetree. * tag 'v4.19-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: add led support for Firefly-RK3399 arm64: dts: rockchip: remove deprecated Type-C PHY properties on rk3399 arm64: dts: rockchip: add power button support for Firefly-RK3399 arm64: dts: rockchip: drop out-of-tree properties from rk3399-ficus regulator arm64: dts: rockchip: add voltage properties for vcc3v3_pcie on rk3399 ficus arm64: dts: rockchip: add USB 2.0 and 3.0 support on Ficus board arm64: dts: rockchip: add 96boards RK3399 Ficus board dt-bindings: Add vendor prefix for Vamrs Ltd. Signed-off-by: Olof Johansson commit 2dd207c91ab74b1b26b6926905a6be57508a872a Merge: 7f27a62267fe f2ac479f0da0 Author: Olof Johansson Date: Tue Jul 31 19:10:31 2018 -0700 Merge tag 'amlogic-dt64-3' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/dt Amlogic 64-bit DT updates for v4.19, round 3 - add DT support for AXG Audio * tag 'amlogic-dt64-3' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: arm64: dts: meson-axg: add spdif-dit codec arm64: dts: meson-axg: add lineout codec arm64: dts: meson-axg: add linein codec arm64: dts: meson-axg: add tdm interfaces arm64: dts: meson-axg: add tdmout formatters arm64: dts: meson-axg: add tdmin formatters arm64: dts: meson-axg: add spdifout arm64: dts: meson-axg: add audio arb reset controller arm64: dts: meson-axg: add usb power regulator arm64: dts: meson-axg: add vcc 5v regulator on the s400 arm64: dts: meson-axg: improve power supplies description Signed-off-by: Olof Johansson commit 7f27a62267fe5a2b9c5e305e70f36755b3246000 Merge: 61c22946ad43 c462f6c77e72 Author: Olof Johansson Date: Tue Jul 31 19:07:19 2018 -0700 Merge tag 'mvebu-dt64-4.19-2' of git://git.infradead.org/linux-mvebu into next/dt mvebu dt64 for 4.19 (part 2) Use more specific compatible for the Inside Secure SafeXcel on the Armada 37xx and the Armada 7K/8K SoCs. * tag 'mvebu-dt64-4.19-2' of git://git.infradead.org/linux-mvebu: arm64: dts: marvell: armada-37xx: update the crypto engine compatible arm64: dts: marvell: armada-cp110: update the crypto engine compatible Signed-off-by: Olof Johansson commit c8f8a0b50b82a9bb0527b65cc9a4814833ed8fa7 Author: Kunihiko Hayashi Date: Tue Mar 27 21:21:09 2018 +0900 ARM: multi_v7_defconfig: add CONFIG_UNIPHIER_THERMAL and CONFIG_SNI_AVE Enable the thermal monitor driver and the AVE ethernet driver implemented on UniPhier SoCs. Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada Signed-off-by: Olof Johansson commit f0fc40aff6fee100ffbed8328a0df88f8aa75fce Author: Masahiro Yamada Date: Mon Jun 25 12:34:44 2018 +0900 ARM: uniphier: select RESET_CONTROLLER The UniPhier platform highly relies on the reset controller. Select RESET_CONTROLLER to enable it forcibly. Signed-off-by: Masahiro Yamada Signed-off-by: Olof Johansson commit ab6ab445b9353a06df16e40506cf91fd437a4ddc Author: Masahiro Yamada Date: Mon Jun 25 12:34:45 2018 +0900 arm64: uniphier: select RESET_CONTROLLER The UniPhier platform highly relies on the reset controller. Select RESET_CONTROLLER to enable it forcibly. Signed-off-by: Masahiro Yamada Signed-off-by: Olof Johansson commit f61513f724001e7c51b83482496c23018814d88f Author: Masahiro Yamada Date: Thu Jul 19 06:50:05 2018 +0900 ARM: uniphier: remove empty Makefile arch/arm/mach-uniphier/Makefile has been unused for a long time. Signed-off-by: Masahiro Yamada Signed-off-by: Olof Johansson commit 61c22946ad43d4edd03663ab5ee92cd638c090a7 Merge: c1c0f486d966 2450ceaf2179 Author: Olof Johansson Date: Tue Jul 31 19:02:51 2018 -0700 Merge tag 'aspeed-4.19-devicetree-no-fsi' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed into next/dt ASPEED device tree updates for 4.19 - New support for the ASPEED USB host controller and USB vhub (device) support - Descriptions for the ColdFire processor that is part of the ASPEED SoC - Small fixes: * pwm/tach clock * tag 'aspeed-4.19-devicetree-no-fsi' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed: ARM: dts: aspeed: Add coprocessor interrupt controller ARM: dts: aspeed: Use 24MHz fixed clock for pwm ARM: dts: aspeed: Fix Romulus VGA frame buffer ARM: dts: aspeed: Enable vhub on port A of AST2500 EVB ARM: dts: aspeed: Add G5 USB Virtual Hub ARM: dts: aspeed: Add G4 USB Virtual Hub ARM: dts: aspeed: Add G5 USB host pinmux ARM: dts: aspeed: Add G4 USB pinmux Signed-off-by: Olof Johansson commit b7751410c180a05fdc21268f8661b1480169b0df Author: Stefan Hajnoczi Date: Tue Jul 31 15:32:46 2018 +0100 device-dax: avoid hang on error before devm_memremap_pages() dax_pmem_percpu_exit() waits for dax_pmem_percpu_release() to invoke the dax_pmem->cmp completion. Unfortunately this approach to cleaning up the percpu_ref only works after devm_memremap_pages() was successful. If devm_add_action_or_reset() or devm_memremap_pages() fails, dax_pmem_percpu_release() is not invoked. Therefore dax_pmem_percpu_exit() hangs waiting for the completion: rc = devm_add_action_or_reset(dev, dax_pmem_percpu_exit, &dax_pmem->ref); if (rc) return rc; dax_pmem->pgmap.ref = &dax_pmem->ref; addr = devm_memremap_pages(dev, &dax_pmem->pgmap); Avoid the hang by calling percpu_ref_exit() in the error paths instead of going through dax_pmem_percpu_exit(). Signed-off-by: Stefan Hajnoczi Signed-off-by: Dave Jiang commit b4d4702f30e09ed1311e560334eb25fc2015c8ce Author: Vishal Verma Date: Mon Jul 30 16:11:34 2018 -0600 tools/testing/nvdimm: improve emulation of smart injection The emulation for smart injection commands for nfit neglected to check the smart field validity flags before injecting to that field. This is required as a way to distinguish un-injection vs. leave-alone. The emulation was also missing support for un-injection entirely. To add this support, first, fix the above flags check. Second, use the 'enable' field in the injection command to determine injection vs un-injection. Third, move the smart initialization struct to be a global static structure for the nfit_test module. Reference this to get the smart 'defaults' when un-injecting a smart field. Signed-off-by: Vishal Verma Signed-off-by: Dave Jiang commit 546c596cf5491fda1516536e049c6a36836eb884 Author: Shunyong Yang Date: Wed Jul 18 09:40:35 2018 +0800 PCI: Unify PCI and normal DMA direction definitions Current DMA direction definitions in pci-dma-compat.h and dma-direction.h are mirrored in value. Unify them to enhance readability and avoid possible inconsistency. Signed-off-by: Shunyong Yang Signed-off-by: Bjorn Helgaas Cc: Joey Zheng commit 26e551c5aec572442c4ad7109ff4350f427cd39d Author: Kamal Heib Date: Tue Jul 31 09:02:36 2018 +0300 RDMA: Fix return code check in rdma_set_cq_moderation The proper return code is "-EOPNOTSUPP" when the modify_cq() callback is not supported, all drivers should generate this and all users should check for it when detecting not supported functionality. Signed-off-by: Kamal Heib Acked-by: Leon Romanovsky (for mlx5) Signed-off-by: Jason Gunthorpe commit 15da09500a7053612e4ab049ff998e99a77a8df0 Merge: f8f15c34ac94 aa595c00bcf5 Author: Dave Airlie Date: Wed Aug 1 09:02:12 2018 +1000 Merge branch 'drm-armada-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next This set of changes migrates Armada DRM from legacy modeset to atomic modeset. This is everything from the "Transition Armada DRM planes to atomic state" and "Finish Armada DRM transition to atomic modeset" patch sets as posted on drm-devel, excluding the "Finish Armada DRM DT support" series. These series did not evoke any comments - if there are any, these can be addressed via follow up patches. Developed and tested on Dove Cubox with xf86-video-armada including the overlay plane, and also tested with the tools in libdrm. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180730110543.GA30664@rmk-PC.armlinux.org.uk commit dd708e7b4541da1d61cdce2db1d9701444fdb317 Author: Bart Van Assche Date: Tue Jul 31 08:51:30 2018 -0700 rdma/cxgb4: Simplify a structure initialization This patch avoids that sparse reports the following warning: drivers/infiniband/hw/cxgb4/qp.c:2269:34: warning: Using plain integer as NULL pointer Signed-off-by: Bart Van Assche Acked-by: Steve Wise Acked-by: Raju Rangoju Signed-off-by: Jason Gunthorpe commit eb2463bab4bce46b0482a0e7e74575771a32fcf0 Author: Bart Van Assche Date: Tue Jul 31 08:25:41 2018 -0700 rdma/cxgb4: Fix SRQ endianness annotations This patch avoids that sparse complains about casts to restricted __be32. Fixes: a3cdaa69e4ae ("cxgb4: Adds CPL support for Shared Receive Queues") Signed-off-by: Bart Van Assche Acked-by: Steve Wise Signed-off-by: Jason Gunthorpe commit 7810e09bfba56bc0f2aff705ca7086e6c1f103f6 Author: Bart Van Assche Date: Tue Jul 31 08:08:15 2018 -0700 rdma/cxgb4: Remove a set-but-not-used variable This patch avoids that the following warning is reported when building with W=1: drivers/infiniband/hw/cxgb4/cm.c:1860:5: warning: variable 'status' set but not used [-Wunused-but-set-variable] u8 status; ^~~~~~ Fixes: 6a0b6174d35a ("rdma/cxgb4: Add support for kernel mode SRQ's") Signed-off-by: Bart Van Assche Acked-by: Steve Wise Signed-off-by: Jason Gunthorpe commit f8f15c34ac94563eb169ce95e97c200a00c15c35 Merge: caca1ff0de62 a7663a793436 Author: Dave Airlie Date: Wed Aug 1 08:52:15 2018 +1000 Merge tag 'drm-msm-next-2018-07-30' of git://people.freedesktop.org/~robclark/linux into drm-next A bit larger this time around, due to introduction of "dpu1" support for the display controller in sdm845 and beyond. This has been on list and undergoing refactoring since Feb (going from ~110kloc to ~30kloc), and all my review complaints have been addressed, so I'd be happy to see this upstream so further feature work can procede on top of upstream. Also includes the gpu coredump support, which should be useful for debugging gpu crashes. And various other misc fixes and such. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGv-8y3zguY0Mj1vh=o+vrv_bJ8AwZ96wBXYPvMeQT2XcA@mail.gmail.com commit ddf74e79a54070f277ae520722d3bab7f7a6c67a Author: Gustavo A. R. Silva Date: Mon Jul 23 11:32:32 2018 -0500 drm/amdgpu/pm: Fix potential Spectre v1 idx can be indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:408 amdgpu_set_pp_force_state() warn: potential spectre issue 'data.states' Fix this by sanitizing idx before using it to index data.states Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Signed-off-by: Alex Deucher commit 7ac7aebe85d3b3b57a58efefcdde2bd5d398550d Author: Colin Ian King Date: Tue Jul 31 11:42:54 2018 +0100 drm/amd/display: add missing void parameter to dc_create_transfer_func Add a missing void parameter to function dc_create_transfer_func, fixes sparse warning: warning: non-ANSI function declaration of function 'dc_create_transfer_func' Signed-off-by: Colin Ian King Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 77605e43701578892e98a39383071f1a8503ff8f Author: Thomas Zimmermann Date: Tue Jul 31 08:16:59 2018 +0200 drm/radeon: Replace ttm_bo_unref with ttm_bo_put The function ttm_bo_put releases a reference to a TTM buffer object. The function's name is more aligned to the Linux kernel convention of naming ref-counting function _get and _put. A call to ttm_bo_unref takes the address of the TTM BO object's pointer and clears the pointer's value to NULL. This is not necessary in most cases and sometimes even worked around by the calling code. A call to ttm_bo_put only releases the reference without clearing the pointer. The current behaviour of cleaning the pointer is kept in the calling code, but should be removed if not required in a later patch. Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 269a8b6e342501fa221a398dd2730b7af7e94a5d Author: Thomas Zimmermann Date: Tue Jul 31 08:16:58 2018 +0200 drm/radeon: Replace ttm_bo_reference with ttm_bo_get The function ttm_bo_get acquires a reference on a TTM buffer object. The function's name is more aligned to the Linux kernel convention of naming ref-counting function _get and _put. Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Signed-off-by: Alex Deucher commit fea872b279c8cd9433a3c9bb91949643cf645e07 Author: Thomas Zimmermann Date: Tue Jul 31 09:12:36 2018 +0200 drm/amdgpu: Replace ttm_bo_unref with ttm_bo_put The function ttm_bo_put releases a reference to a TTM buffer object. The function's name is more aligned to the Linux kernel convention of naming ref-counting function _get and _put. A call to ttm_bo_unref takes the address of the TTM BO object's pointer and clears the pointer's value to NULL. This is not necessary in most cases and sometimes even worked around by the calling code. A call to ttm_bo_put only releases the reference without clearing the pointer. The current behaviour of cleaning the pointer is kept in the calling code, but should be removed if not required in a later patch. v2: * set prefix to drm/amdgpu Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 71d5ef11273b3dbdb57be7d2940dcee70007ae84 Author: Thomas Zimmermann Date: Tue Jul 31 09:12:35 2018 +0200 drm/amdgpu: Replace ttm_bo_reference with ttm_bo_get The function ttm_bo_get acquires a reference on a TTM buffer object. The function's name is more aligned to the Linux kernel convention of naming ref-counting function _get and _put. v2: * changed prefix to drm/amdgpu Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Signed-off-by: Alex Deucher commit a875f58e237a0009c337dd140e4f92a7cffab7af Author: Christian König Date: Mon Jul 30 11:40:06 2018 +0200 drm/scheduler: stop setting rq to NULL We removed the redundancy of having an extra scheduler field, so we can't set the rq to NULL any more or otherwise won't know which scheduler to use for the cleanup. Just remove the entity from the scheduling list instead. Signed-off-by: Christian König Acked-by: Nayan Deshmukh Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107367 Signed-off-by: Alex Deucher commit 43bce41cf48eb51eab5ad9e0d40ed382a7bb61d7 Author: Christian König Date: Thu Jul 26 13:43:49 2018 +0200 drm/scheduler: only kill entity if last user is killed v2 Note which task is using the entity and only kill it if the last user of the entity is killed. This should prevent problems when entities are leaked to child processes. v2: add missing kernel doc Signed-off-by: Christian König Reviewed-by: Andrey Grodzovsky Acked-by: Nayan Deshmukh Signed-off-by: Alex Deucher commit 4a102ad4ba0daf886dcf0927ce2a7f6c3b3a615c Author: Christian König Date: Mon Jul 30 16:44:14 2018 +0200 drm/amdgpu: create an empty bo_list if no handle is provided Instead of having extra handling just create an empty bo_list when no handle is provided. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 920990cb080a44203bf6c8eb706e79ad23241ad3 Author: Christian König Date: Mon Jul 30 16:16:01 2018 +0200 drm/amdgpu: allocate the bo_list array after the list This avoids multiple allocations for the head and the array. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher commit 39f7f69a6054bb9777b47b6afdb5ce2fae30dbee Author: Christian König Date: Mon Jul 30 15:37:46 2018 +0200 drm/amdgpu: add bo_list iterators Add helpers to iterate over all entries in a bo_list. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Acked-by: Huang Rui Signed-off-by: Alex Deucher commit a0f208453b97565dab8c334ff013aa5ab3c66d0c Author: Christian König Date: Mon Jul 30 14:17:41 2018 +0200 drm/amdgpu: nuke amdgpu_bo_list_free The RCU grace period is harmless and avoiding it is not worth the effort of doubling the implementation. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 81c6dabcc990c341793368db985ee8aca5713b16 Author: Christian König Date: Mon Jul 30 13:46:04 2018 +0200 drm/amdgpu: always recreate bo_list The bo_list handle is allocated by OP_CREATE, so in OP_UPDATE here we just re-create the bo_list object and replace the handle. This way we don't need locking to protect the bo_list because it's always re-created when changed. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher commit 4a8c21a1e9b3c35b21c5a4a4c16a009a193389bd Author: Christian König Date: Mon Jul 30 13:27:09 2018 +0200 drm/amdgpu: move bo_list defines to amdgpu_bo_list.h Further demangle amdgpu.h Signed-off-by: Christian König Reviewed-by: Chunming Zhou Acked-by: Huang Rui Signed-off-by: Alex Deucher commit 8ab19ea619aeed8ca4a36c124e8edfd9b9491aba Author: Christian König Date: Fri Jul 27 16:56:34 2018 +0200 drm/amdgpu: add new amdgpu_vm_bo_trace_cs() function v2 This allows us to trace all VM ranges which should be valid inside a CS. v2: dump mappings without BO as well Signed-off-by: Christian König Reviewed-by: Chunming Zhou Reviewed-and-tested-by: Andrey Grodzovsky (v1) Reviewed-by: Huang Rui (v1) Signed-off-by: Alex Deucher commit 0cb7c1f03bfb3991120313c5927c1749041ef800 Author: Christian König Date: Mon Jul 30 16:18:54 2018 +0200 drm/amdgpu: return error if both BOs and bo_list handle is given Return -EINVAL when both the BOs as well as a list handle is provided in the IOCTL. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 275105ce7be37a2cc80eb1b60e6526355f54df94 Author: Christian König Date: Mon Jul 30 15:33:34 2018 +0200 drm/amdgpu: fix total size calculation long might only be 32bit in size and we can easily use more than 4GB here. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Acked-by: Huang Rui Signed-off-by: Alex Deucher commit ba7f47831ebdad141791be53a51049d6771156cd Author: Masahiro Yamada Date: Fri Jul 6 14:12:11 2018 +0900 drm/sched: remove unneeded -Iinclude/drm compiler flag I refactored the include directives under include/drm/ some time ago. This flag is unneeded. Signed-off-by: Masahiro Yamada Reviewed-by: Christian König Acked-by: Nayan Deshmukh Signed-off-by: Alex Deucher commit 52c054caf83012fe9fe858ee86d90b4ea2cc3cca Author: Christian König Date: Fri Jul 27 15:32:04 2018 +0200 drm/amdgpu: add proper error handling to amdgpu_bo_list_get Otherwise we silently don't use a BO list when the handle is invalid. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Reviewed-by: Huang Rui Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit ccf9ef0b0d10434dec5046bcfc4e834a7b1830fd Author: Rex Zhu Date: Wed Jul 25 11:51:46 2018 +0800 drm/amdgpu: fix a reversed condition This test was reversed so it would end up leading to vddnb value can't be read via hwmon on APU. Reviewed-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 8a50bb47a863c3cb8950a2e810448c9a82a9d446 Author: Rex Zhu Date: Wed Jul 25 11:45:03 2018 +0800 drm/amd/pp: Convert voltage unit in mV*4 to mV on CZ/ST the voltage showed in debugfs and hwmon should be in mV Reviewed-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 90983631a6486f68c1e95bf30713a179ac0a083f Author: Rex Zhu Date: Fri Jul 20 18:19:00 2018 +0800 drm/amd/pp: Delete unused temp variables Only delete the dead temp variables in Polaris. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 2d227ec2c11c568910299e8f913bac2dda47397c Author: Rex Zhu Date: Fri Jul 20 16:26:46 2018 +0800 drm/amd/pp/Polaris12: Fix a chunk of registers missed to program DIDTConfig_Polaris12[] table missed a big chunk of data. Pointed by aidan.fabius Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 7209049d40dc37791ce0f3738965296f30e26044 Author: Mike Snitzer Date: Tue Jul 31 17:27:02 2018 -0400 dm kcopyd: return void from dm_kcopyd_copy() dm_kcopyd_copy() only ever returns 0 so there is no need for callers to account for possible failure. Same goes for dm_kcopyd_zero(). Signed-off-by: Mike Snitzer commit 944d58595be02634cc295e341306ccda2365554d Author: Bjorn Helgaas Date: Tue Jul 31 16:26:09 2018 -0500 PCI/AER: Remove duplicate PCI_EXP_AER_FLAGS definition PCI_EXP_AER_FLAGS was defined twice (with identical definitions), once under #ifdef CONFIG_ACPI_APEI, and again at the top level. This looks like my merge error from these commits: fd3362cb73de ("PCI/AER: Squash aerdrv_core.c into aerdrv.c") 41cbc9eb1a82 ("PCI/AER: Squash ecrc.c into aerdrv.c") Remove the duplicate PCI_EXP_AER_FLAGS definition. Fixes: 41cbc9eb1a82 ("PCI/AER: Squash ecrc.c into aerdrv.c") Signed-off-by: Bjorn Helgaas Reviewed-by: Oza Pawandeep commit ff23f4af7efd86cbb1bda42fe2171e0790f9cb5a Author: Darrick J. Wong Date: Tue Jul 31 13:18:02 2018 -0700 xfs: move extent busy tree initialization to xfs_initialize_perag Move the per-AG busy extent tree initialization to the per-ag structure initialization since we don't want online repair to leak the old tree. We only deconstruct the tree at unmount time, so this should be safe. This also enables us to eliminate the commented out initialization in the xfsprogs libxfs. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino Reviewed-by: Christoph Hellwig commit e666aa37f4330cb93a5004a89b7a938312e74e36 Author: Christoph Hellwig Date: Tue Jul 17 16:51:52 2018 -0700 xfs: avoid COW fork extent lookups in writeback if the fork didn't change Used the per-fork sequence counter to avoid lookups in the writeback code unless the COW fork actually changed. Signed-off-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 745b3f76d1c889d738a1c4537a3c491bc1ecac4d Author: Christoph Hellwig Date: Tue Jul 17 16:51:51 2018 -0700 xfs: maintain a sequence count for inode fork manipulations Add a simple 32-bit unsigned integer as the sequence count for modifications to the extent list in the inode fork. This will be used to optimize away extent list lookups in the writeback code. Signed-off-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9e037cb7972fab5a9f55bca4ebe6e4dbf7e160bc Author: Darrick J. Wong Date: Mon Jul 30 16:45:35 2018 -0700 xfs: check for unknown v5 feature bits in superblock write verifier Make sure we never try to write the superblock with unknown feature bits set. We checked those at mount time, so if they're set now then memory is corrupt. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit 69775fd15dc78e0547af45fb3e375d5423cb21b1 Author: Darrick J. Wong Date: Thu Jul 26 10:10:42 2018 -0700 xfs: verify icount in superblock write Add a helper predicate to check the inode count for sanity, then use it in the superblock write verifier to inspect sb_icount. Signed-off-by: Darrick J. Wong Reviewed-by: Bill O'Donnell Reviewed-by: Eric Sandeen commit 8756a5af18191a471e670cc577aea60b652fea4c Author: Bill O'Donnell Date: Thu Jul 26 10:10:34 2018 -0700 libxfs: add more bounds checking to sb sanity checks Current sb verifier doesn't check bounds on sb_fdblocks and sb_ifree. Add sanity checks for these parameters. Signed-off-by: Bill O'Donnell [darrick: port to refactored sb validation predicates] Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit eca383fcd63b452cf533505154135da2a1f70227 Author: Darrick J. Wong Date: Sun Jul 29 13:10:44 2018 -0700 xfs: refactor superblock verifiers Split the superblock verifier into the common checks, the read-time checks, and the write-time check functions. No functional changes, but we're setting up to add more write-only checks. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit 86d969b425d7ecf774799b70142b957dc267575b Author: Darrick J. Wong Date: Mon Jul 30 11:18:13 2018 -0700 xfs: refactor the xrep_extent_list into xfs_bitmap As mentioned previously, the xrep_extent_list basically implements a bitmap with two functions: set and disjoint union. Rename all these functions to xfs_bitmap to shorten the name and make it more obvious what we're doing. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit fbeb1603bf4e9baa82da8f794de42949d0fe5e25 Author: Arthur Fabre Date: Tue Jul 31 18:17:22 2018 +0100 bpf: verifier: MOV64 don't mark dst reg unbounded When check_alu_op() handles a BPF_MOV64 between two registers, it calls check_reg_arg(DST_OP) on the dst register, marking it as unbounded. If the src and dst register are the same, this marks the src as unbounded, which can lead to unexpected errors for further checks that rely on bounds info. For example: BPF_MOV64_IMM(BPF_REG_2, 0), BPF_MOV64_REG(BPF_REG_2, BPF_REG_2), BPF_ALU64_REG(BPF_ADD, BPF_REG_1, BPF_REG_2), BPF_MOV64_IMM(BPF_REG_0, 0), BPF_EXIT_INSN(), Results in: "math between ctx pointer and register with unbounded min value is not allowed" check_alu_op() now uses check_reg_arg(DST_OP_NO_MARK), and MOVs that need to mark the dst register (MOVIMM, MOV32) do so. Added a test case for MOV64 dst == src, and dst != src. Signed-off-by: Arthur Fabre Acked-by: Edward Cree Signed-off-by: Daniel Borkmann commit e6476c21447c4b17c47e476aade6facf050f31e8 Author: Christoph Hellwig Date: Mon Jul 30 09:45:07 2018 +0200 net: remove bogus RCU annotations on socket.wq We never use RCU protection for it, just a lot of cargo-cult rcu_deference_protects calls. Note that we do keep the kfree_rcu call for it, as the references through struct sock are RCU protected and thus might require a grace period before freeing. Signed-off-by: Christoph Hellwig Reviewed-by: Eric Dumazet Acked-by: Paul E. McKenney Signed-off-by: David S. Miller commit 37692de5d5235304835f4fdd5b3e5d5bae72fc16 Author: Karthikeyan Ramasubramanian Date: Mon Jul 30 11:23:51 2018 -0600 i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller This bus driver supports the GENI based i2c hardware controller in the Qualcomm SOCs. The Qualcomm Generic Interface (GENI) is a programmable module supporting a wide range of serial interfaces including I2C. The driver supports FIFO mode and DMA mode of transfer and switches modes dynamically depending on the size of the transfer. Signed-off-by: Karthikeyan Ramasubramanian Signed-off-by: Sagar Dharia Signed-off-by: Girish Mahadevan Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Tested-by: Stephen Boyd [wsa: squashed the MAINTAINER addition and a RPM fix by Evan Green] Signed-off-by: Wolfram Sang commit 4e6a13356f1c1dc27ff48ff35576a478d73f8713 Author: Lukas Wunner Date: Sat Jul 28 07:22:00 2018 +0200 PCI: pciehp: Deduplicate presence check on probe & resume On driver probe and on resume from system sleep, pciehp checks the Presence Detect State bit in the Slot Status register to bring up an occupied slot or bring down an unoccupied slot. Both code paths are identical, so deduplicate them per Mika's request. On probe, an additional check is performed to disable power of an unoccupied slot. This can e.g. happen if power was enabled by BIOS. It cannot happen once pciehp has taken control, hence is not necessary on resume: The Slot Control register is set to the same value that it had on suspend by pci_restore_state(), so if the slot was occupied, power is enabled and if it wasn't, power is disabled. Should occupancy have changed during the system sleep transition, power is adjusted by bringing up or down the slot per the paragraph above. To allow for deduplication of the presence check, move the power check to pcie_init(). This seems safer anyway, because right now it is performed while interrupts are already enabled, and although I can't think of a scenario where pciehp_power_off_slot() and the IRQ thread collide, it does feel brittle. However this means that pcie_init() may now write to the Slot Control register before the IRQ is requested. If both the CCIE and HPIE bits happen to be set, pcie_wait_cmd() will wait for an interrupt (instead of polling the Command Completed bit) and eventually emit a timeout message. Additionally, if a level-triggered INTx interrupt is used, the user may see a spurious interrupt splat. Avoid by disabling interrupts before disabling power. (Normally the HPIE and CCIE bits should be clear on probe, but conceivably they may already have been set e.g. by BIOS.) Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 8bb46b079d05be4435892869dad23e9af23098ab Author: Lukas Wunner Date: Sat Jul 28 07:22:00 2018 +0200 PCI: pciehp: Avoid implicit fallthroughs in switch statements Per Mika's request, add an explicit break to the last case of switch statements everywhere in pciehp to be more defensive towards future amendments. Per Gustavo's request, mark all non-empty implicit fallthroughs with a comment to silence warnings triggered by -Wimplicit-fallthrough=2. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg Acked-by: Gustavo A. R. Silva commit 84a7f564fa14bf4713240f614c0b9a18730418fa Author: Alexandre Belloni Date: Tue Jul 31 16:38:55 2018 +0200 mips: dts: mscc: enable spi and NOR flash support on ocelot PCB123 Ocelot PCB123 has a SPI NOR connected on its SPI bus. Signed-off-by: Alexandre Belloni Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20103/ Cc: Mark Brown Cc: James Hogan Cc: linux-spi@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: Thomas Petazzoni Cc: Allan Nielsen commit 9eaf3ba5e0557eef9c3d9a64c72b9352cdc49d50 Author: Alexandre Belloni Date: Tue Jul 31 16:38:54 2018 +0200 mips: dts: mscc: Add spi on Ocelot Add support for the SPI controller Signed-off-by: Alexandre Belloni Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20101/ Cc: Mark Brown Cc: James Hogan Cc: linux-spi@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: Thomas Petazzoni Cc: Allan Nielsen commit c8cb5f775c8dacb605e628a320ded42be3bd9453 Author: Srinivas Kandagatla Date: Fri Jul 27 13:18:01 2018 +0100 ASoC: wcd9335: add CLASS-H Controller support CLASS-H controller/Amplifier is common accorss Qualcomm WCD codec series. This patchset adds basic CLASS-H controller apis for WCD codecs after wcd9335 to use. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Signed-off-by: Mark Brown commit e57d4ca882e289a2ddc844e82fa33ad1453e9871 Author: Srinivas Kandagatla Date: Fri Jul 27 13:18:00 2018 +0100 ASoC: wcd9335: add support to wcd9335 codec Qualcomm WCD9335 Codec is a standalone Hi-Fi audio codec IC, It supports both I2S/I2C and SLIMbus audio interfaces. On slimbus interface it supports two data lanes; 16 Tx ports and 8 Rx ports. It has Seven DACs and nine dedicated interpolators, Seven (six audio ADCs, and one VBAT ADC), Multibutton headset control (MBHC), Active noise cancellation and Sidetone paths and processing. This patchset adds very basic support for playback and capture via the 9 interpolators and ADC respectively. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Signed-off-by: Mark Brown commit 1877c9fda1b7ba2ee2d9b108b9c9298e69b5b488 Author: Srinivas Kandagatla Date: Fri Jul 27 13:17:57 2018 +0100 ASoC: dt-bindings: add dt bindings for wcd9335 audio codec This patch adds bindings for wcd9335 audio codec which can support both SLIMbus and I2S/I2C interface. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Signed-off-by: Mark Brown commit d46eeeaf99bcfab884e3d658e2ba1356939ea783 Author: Jason Wang Date: Tue Jul 31 17:43:39 2018 +0800 virtio-net: get rid of unnecessary container of rq stats We don't maintain tx counters in rx stats any more. There's no need for an extra container of rq stats. Cc: Toshiaki Makita Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit ca9e83b4a55bfa1cc1395b48c3bf70381833526b Author: Jason Wang Date: Tue Jul 31 17:43:38 2018 +0800 virtio-net: correctly update XDP_TX counters Commit 5b8f3c8d30a6 ("virtio_net: Add XDP related stats") tries to count TX XDP stats in virtnet_receive(). This will cause several issues: - virtnet_xdp_sq() was called without checking whether or not XDP is set. This may cause out of bound access when there's no enough txq for XDP. - Stats were updated even if there's no XDP/XDP_TX. Fixing this by reusing virtnet_xdp_xmit() for XDP_TX which can counts TX XDP counter itself and remove the unnecessary tx stats embedded in rx stats. Reported-by: syzbot+604f8271211546f5b3c7@syzkaller.appspotmail.com Fixes: 5b8f3c8d30a6 ("virtio_net: Add XDP related stats") Cc: Toshiaki Makita Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 2789e83c933d7da583e592d7958e87493c889605 Author: Colin Ian King Date: Tue Jul 31 15:02:25 2018 +0100 xen/gntdev: don't dereference a null gntdev_dmabuf on allocation failure Currently when the allocation of gntdev_dmabuf fails, the error exit path will call dmabuf_imp_free_storage and causes a null pointer dereference on gntdev_dmabuf. Fix this by adding an error exit path that won't free gntdev_dmabuf. Detected by CoverityScan, CID#1472124 ("Dereference after null check") Fixes: bf8dc55b1358 ("xen/gntdev: Implement dma-buf import functionality") Signed-off-by: Colin Ian King Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 8fdee4cc95d9d66c1378017cc2bef6e0069293a8 Author: Stephen Hemminger Date: Tue Jul 24 12:29:15 2018 -0700 sunrpc: whitespace fixes Remove trailing whitespace and blank line at EOF Signed-off-by: Stephen Hemminger Signed-off-by: Anna Schumaker commit 0f90be132cbf1537d87a6a8b9e80867adac892f6 Author: Bill Baker Date: Tue Jun 19 16:24:58 2018 -0500 NFSv4 client live hangs after live data migration recovery After a live data migration event at the NFS server, the client may send I/O requests to the wrong server, causing a live hang due to repeated recovery events. On the wire, this will appear as an I/O request failing with NFS4ERR_BADSESSION, followed by successful CREATE_SESSION, repeatedly. NFS4ERR_BADSSESSION is returned because the session ID being used was issued by the other server and is not valid at the old server. The failure is caused by async worker threads having cached the transport (xprt) in the rpc_task structure. After the migration recovery completes, the task is redispatched and the task resends the request to the wrong server based on the old value still present in tk_xprt. The solution is to recompute the tk_xprt field of the rpc_task structure so that the request goes to the correct server. Signed-off-by: Bill Baker Reviewed-by: Chuck Lever Tested-by: Helen Chao Fixes: fb43d17210ba ("SUNRPC: Use the multipath iterator to assign a ...") Cc: stable@vger.kernel.org # v4.9+ Signed-off-by: Anna Schumaker commit 32cd3ee511f4e07ca25d71163b50e704808d22f4 Author: Olga Kornievskaia Date: Thu Jul 26 16:04:47 2018 -0400 NFSv4.0 fix client reference leak in callback If there is an error during processing of a callback message, it leads to refrence leak on the client structure and eventually an unclean superblock. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 1a54c0cfcbb2d93b6c057b633984f0fd8b882555 Author: Dan Carpenter Date: Thu Jul 12 15:30:08 2018 +0300 sunrpc: kstrtoul() can also return -ERANGE Smatch complains that "num" can be uninitialized when kstrtoul() returns -ERANGE. It's true enough, but basically harmless in this case. Signed-off-by: Dan Carpenter Signed-off-by: Anna Schumaker commit 379ebf0796071210c61ea17ba3f08cbc5e260894 Author: Dan Carpenter Date: Thu Jul 12 15:29:29 2018 +0300 NFS: silence a harmless uninitialized variable warning kstrtoul() can return -ERANGE so Smatch complains that "num" can be uninitialized. We check that it's within bounds so it's not a huge deal. Signed-off-by: Dan Carpenter Signed-off-by: Anna Schumaker commit 016583d7030cec9b69e0d55269a5967f4ee871d2 Author: Dave Wysochanski Date: Tue Jul 31 10:10:51 2018 -0400 sunrpc: Change rpc_print_iostats to rpc_clnt_show_stats and handle rpc_clnt clones The existing rpc_print_iostats has a few shortcomings. First, the naming is not consistent with other functions in the kernel that display stats. Second, it is really displaying stats for an rpc_clnt structure as it displays both xprt stats and per-op stats. Third, it does not handle rpc_clnt clones, which is important for the one in-kernel tree caller of this function, the NFS client's nfs_show_stats function. Fix all of the above by renaming the rpc_print_iostats to rpc_clnt_show_stats and looping through any rpc_clnt clones via cl_parent. Once this interface is fixed, this addresses a problem with NFSv4. Before this patch, the /proc/self/mountstats always showed incorrect counts for NFSv4 lease and session related opcodes such as SEQUENCE, RENEW, SETCLIENTID, CREATE_SESSION, etc. These counts were always 0 even though many ops would go over the wire. The reason for this is there are multiple rpc_clnt structures allocated for any given NFSv4 mount, and inside nfs_show_stats() we callled into rpc_print_iostats() which only handled one of them, nfs_server->client. Fix these counts by calling sunrpc's new rpc_clnt_show_stats() function, which handles cloned rpc_clnt structs and prints the stats together. Note that one side-effect of the above is that multiple mounts from the same NFS server will show identical counts in the above ops due to the fact the one rpc_clnt (representing the NFSv4 client state) is shared across mounts. Signed-off-by: Dave Wysochanski Signed-off-by: Anna Schumaker commit 6293e4d674d0f6cb01cd19307dd477988776c521 Merge: 39c64d8c8766 84c6b86875e0 Author: David S. Miller Date: Tue Jul 31 09:48:22 2018 -0700 Merge branch 'xsk-improvements-to-RX-queue-check-and-replace' Jakub Kicinski says: ==================== xsk: improvements to RX queue check and replace First 3 patches of my recent RFC. The first one make the check against real_num_rx_queues slightly more reliable, while the latter two redefine XDP_QUERY_XSK_UMEM slightly to disallow replacing UMEM in the driver at the stack level. I'm not sure where this lays on the bpf vs net trees scale, but there should be no conflicts with either tree. ==================== Acked-by: Björn Töpel Acked-by: Daniel Borkmann Signed-off-by: David S. Miller commit 84c6b86875e01a08a0daa6fdd4a01b36bf0bf0b2 Author: Jakub Kicinski Date: Mon Jul 30 20:43:53 2018 -0700 xsk: don't allow umem replace at stack level Currently drivers have to check if they already have a umem installed for a given queue and return an error if so. Make better use of XDP_QUERY_XSK_UMEM and move this functionality to the core. We need to keep rtnl across the calls now. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Björn Töpel Signed-off-by: David S. Miller commit f734607e819b951bae3b436b026ec672082e9241 Author: Jakub Kicinski Date: Mon Jul 30 20:43:52 2018 -0700 xsk: refactor xdp_umem_assign_dev() Return early and only take the ref on dev once there is no possibility of failing. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Björn Töpel Signed-off-by: David S. Miller commit c29c2ebd2ae0066c026045a21aa33ccbfcd8bb3c Author: Jakub Kicinski Date: Mon Jul 30 20:43:51 2018 -0700 net: update real_num_rx_queues even when !CONFIG_SYSFS We used to depend on real_num_rx_queues as a upper bound for sanity checks. For AF_XDP socket validation it's useful if the check behaves the same regardless of CONFIG_SYSFS setting. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller commit 39c64d8c876622e766dd2112baf81151dd82da02 Author: Jesper Dangaard Brouer Date: Mon Jul 30 19:49:08 2018 +0200 mlx5: handle DMA mapping error case for XDP redirect Commit 58b99ee3e3eb ("net/mlx5e: Add support for XDP_REDIRECT in device-out side") forgot to return/free the xdp_frame in case the DMA mapping failed, correct this. Also DMA unmap the frame in case mlx5e_xmit_xdp_frame() fails. Fixes: 58b99ee3e3eb ("net/mlx5e: Add support for XDP_REDIRECT in device-out side") Signed-off-by: Jesper Dangaard Brouer Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller commit 47a8e237ed443c174f8f73402755c458c56eb611 Author: Lukas Wunner Date: Thu Jul 19 17:28:00 2018 -0500 PCI: Whitelist Thunderbolt ports for runtime D3 Thunderbolt controllers can be runtime suspended to D3cold to save ~1.5W. This requires that runtime D3 is allowed on its PCIe ports, so whitelist them. The 2015 BIOS cutoff that we've instituted for runtime D3 on PCIe ports is unnecessary on Thunderbolt because we know that even the oldest controller, Light Ridge (2010), is able to suspend its ports to D3 just fine -- specifically including its hotplug ports. And the power saving should be afforded to machines even if their BIOS predates 2015. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg Cc: Rafael J. Wysocki Cc: Andreas Noever commit eb3b5bf1a88d0cc1cd7acc7464eb211d69779808 Author: Lukas Wunner Date: Thu Jul 19 17:27:59 2018 -0500 PCI: Whitelist native hotplug ports for runtime D3 Previously we blacklisted PCIe hotplug ports for runtime D3 because: (a) Ports handled by the firmware must not be transitioned to D3 by the OS behind the firmware's back: https://bugzilla.kernel.org/show_bug.cgi?id=53811 (b) Ports handled natively by the OS lacked runtime D3 support in the pciehp driver. We've just rectified the latter, so allow users to manually enable and test it by passing pcie_port_pm=force on the command line. Vendors are thus put in a position to validate hotplug ports for runtime D3 and perhaps we can someday enable it by default, but with a BIOS cutoff date. Ashok Raj tested runtime D3 on hotplug ports of a SkyLake Xeon-SP in 2017 and encountered Hardware Error NMIs, so this feature clearly cannot be enabled for everyone yet: https://lkml.kernel.org/r/20170503180426.GA4058@otc-nc-03 While at it, remove an erroneous code comment I added with 97a90aee5dab ("PCI: Consolidate conditions to allow runtime PM on PCIe ports") which claims that parents of a hotplug port must stay awake lest interrupts cannot be delivered. That has turned out to be wrong at least for Thunderbolt hotplug ports. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Rafael J. Wysocki Cc: Mika Westerberg Cc: Ashok Raj Cc: Keith Busch Cc: Yinghai Lu commit 82c3fbff6ed3582f2b14b5548fb976c22d7a7255 Author: Lukas Wunner Date: Thu Jul 19 17:27:58 2018 -0500 PCI: sysfs: Resume to D0 on function reset When performing a function reset via sysfs, the device's config space is accessed in places such as pcie_flr() and its MMIO space is accessed e.g. in reset_ivb_igd(), so ensure accessibility by resuming the device to D0. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Rafael J. Wysocki Cc: Mika Westerberg Cc: Ashok Raj Cc: Keith Busch Cc: Yinghai Lu commit 4417aa45c185376ece278430e33b6a1891a1dc36 Author: Lukas Wunner Date: Thu Jul 19 17:27:57 2018 -0500 PCI: pciehp: Resume parent to D0 on config space access Ensure accessibility of a hotplug port's config space when accessed via sysfs by resuming its parent to D0. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Rafael J. Wysocki Cc: Mika Westerberg Cc: Ashok Raj Cc: Keith Busch Cc: Yinghai Lu commit 8350307454240abeebe52ff5a73810d9ba93dd60 Author: Lukas Wunner Date: Thu Jul 19 17:27:56 2018 -0500 PCI: pciehp: Resume to D0 on enable/disable pciehp's IRQ thread ensures accessibility of the port by runtime resuming its parent to D0. However when the slot is enabled/disabled, the port itself needs to be in D0 because its secondary bus is accessed in: pciehp_check_link_status(), pciehp_configure_device() (both called from board_added()) and pciehp_unconfigure_device() (called from remove_board()). Thus, acquire a runtime PM ref on enable/disablement of the slot. Yinghai Lu additionally discovered that some SkyLake servers feature a Power Controller for their PCIe hotplug ports (PCIe r3.1, sec 6.7.1.8) which requires the port to be in D0 when invoking pciehp_power_on_slot() (likewise called from board_added()). If slot power is turned on while in D3hot, link training later fails: https://lkml.kernel.org/r/20170205073454.GA253@wunner.de The spec is silent about such a requirement, but it seems prudent to assume that any hotplug port with a Power Controller may need this. The present commit holds a runtime PM ref whenever slot power is turned on and off, but it doesn't keep the port in D0 as long as slot power is on. If vendors determine that's necessary, they need to amend pciehp to acquire a runtime PM ref in pciehp_power_on_slot() and release one in pciehp_power_off_slot(). Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Rafael J. Wysocki Cc: Mika Westerberg Cc: Ashok Raj Cc: Keith Busch Cc: Yinghai Lu commit 6b08c3854cfdc5d13165880e2b54642c47edc405 Author: Lukas Wunner Date: Sat Jul 28 07:18:00 2018 +0200 PCI: pciehp: Support interrupts sent from D3hot If a hotplug port is able to send an interrupt, one would naively assume that it is accessible at that moment. After all, if it wouldn't be accessible, i.e. if its parent is in D3hot and the link to the hotplug port is thus down, how should an interrupt come through? It turns out that assumption is wrong at least for Thunderbolt: Even though its parents are in D3hot, a Thunderbolt hotplug port is able to signal interrupts. Because the port's config space is inaccessible and resuming the parents may sleep, the hard IRQ handler has to defer runtime resuming the parents and reading the Slot Status register to the IRQ thread. If the hotplug port uses a level-triggered INTx interrupt, it needs to be masked until the IRQ thread has cleared the signaled events. For simplicity, this commit also masks edge-triggered MSI/MSI-X interrupts. Note that if the interrupt is shared (which can only happen for INTx), other devices are starved from receiving interrupts until the IRQ thread is scheduled, has runtime resumed the hotplug port's parents and has read and cleared the Slot Status register. That delay is dominated by the 10 ms D3hot->D0 transition time of each parent port. The worst case is a Thunderbolt downstream port at the end of a daisy chain: There may be up to six Thunderbolt controllers in-between it and the root port, each comprising an upstream and downstream port, plus its own upstream port. That's 13 x 10 = 130 ms. Possible mitigations are polling the interrupt while it's disabled or reducing the d3_delay of Thunderbolt ports if possible. Open code masking of the interrupt instead of requesting it with the IRQF_ONESHOT flag to minimize the period during which it is masked. (IRQF_ONESHOT unmasks the IRQ only after the IRQ thread has finished.) PCIe r4.0 sec 6.7.3.4 states that "If wake generation is required by the associated form factor specification, a hotplug capable Downstream Port must support generation of a wakeup event (using the PME mechanism) on hotplug events that occur when the system is in a sleep state or the Port is in device state D1, D2, or D3Hot." This would seem to imply that PME needs to be enabled on the hotplug port when it is runtime suspended. pci_enable_wake() currently doesn't enable PME on bridges, it may be necessary to add an exemption for hotplug bridges there. On "Light Ridge" Thunderbolt controllers, the PME_Status bit is not set when an interrupt occurs while the hotplug port is in D3hot, even if PME is enabled. (I've tested this on a Mac and we hardcode the OSC_PCI_EXPRESS_PME_CONTROL bit to 0 on Macs in negotiate_os_control(), modifying it to 1 didn't change the behavior.) (Side note: Section 6.7.3.4 also states that "PME and Hot-Plug Event interrupts (when both are implemented) always share the same MSI or MSI-X vector". That would only seem to apply to Root Ports, however the section never mentions Root Ports, only Downstream Ports. This is explained in the definition of "Downstream Port" in the "Terms and Acronyms" section of the PCIe Base Spec: "The Ports on a Switch that are not the Upstream Port are Downstream Ports. All Ports on a Root Complex are Downstream Ports.") Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Thomas Gleixner Cc: Rafael J. Wysocki Cc: Mika Westerberg Cc: Ashok Raj Cc: Keith Busch Cc: Yinghai Lu commit 469e764c4a3c7260b353b7bc1bd56c283cb001da Author: Lukas Wunner Date: Thu Jul 19 17:27:54 2018 -0500 PCI: pciehp: Obey compulsory command delay after resume Upon resume from system sleep, the Slot Control register is written via: pci_pm_resume_noirq() pci_pm_default_resume_early() pci_restore_state() pci_restore_pcie_state() PCIe r4.0, sec 6.7.3.2 says that after "issuing a write transaction that targets any portion of the Port's Slot Control register, [...] software must wait for [the] command to complete before issuing the next command". pciehp currently fails to enforce that rule after the above-mentioned write. Fix it. (Moving restoration of the Slot Control register to pciehp doesn't seem to make sense because the other PCIe hotplug drivers may need it as well.) Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 7903782460ee1813d6779c968b28d0ac71b9b3ae Author: Lukas Wunner Date: Thu Jul 19 17:27:53 2018 -0500 PCI: pciehp: Clear spurious events earlier on resume Thunderbolt hotplug ports that were occupied before system sleep resume with their downstream link in "off" state. Only after the Thunderbolt controller has reestablished the PCIe tunnels does the link go up. As a result, a spurious Presence Detect Changed and/or Data Link Layer State Changed event occurs. The events are not immediately acted upon because tunnel reestablishment happens in the ->resume_noirq phase, when interrupts are still disabled. Also, notification of events may initially be disabled in the Slot Control register when coming out of system sleep and is reenabled in the ->resume_noirq phase through: pci_pm_resume_noirq() pci_pm_default_resume_early() pci_restore_state() pci_restore_pcie_state() It is not guaranteed that the events are acted upon at all: PCIe r4.0, sec 6.7.3.4 says that "a port may optionally send an MSI when there are hot-plug events that occur while interrupt generation is disabled, and interrupt generation is subsequently enabled." Note the "optionally". If an MSI is sent, pciehp will gratuitously turn the slot off and back on once the ->resume_early phase has commenced. If an MSI is not sent, the extant, unacknowledged events in the Slot Status register will prevent future notification of presence or link changes. Commit 13c65840feab ("PCI: pciehp: Clear Presence Detect and Data Link Layer Status Changed on resume") fixed the latter by clearing the events in the ->resume phase. Move this to the ->resume_noirq phase to also fix the gratuitous disable/enablement of the slot. The commit further restored the Slot Control register in the ->resume phase, but that's dispensable because as shown above it's already been done in the ->resume_noirq phase. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Mika Westerberg commit 6ccb127ba6dff251b75fa72e8c7777eaf12d9675 Author: Lukas Wunner Date: Thu Jul 19 17:27:52 2018 -0500 PCI: portdrv: Deduplicate PM callback iterator Replace suspend_iter() and resume_iter() with a single function pm_iter() to allow addition of port service callbacks for further power management phases without having to add another iterator each time. No functional change intended. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 5b3f7b7d062bc839fe0744bdfd0cfd7e8d1c4cd9 Author: Lukas Wunner Date: Sat Jul 28 07:18:00 2018 +0200 PCI: pciehp: Avoid slot access during reset The ->reset_slot callback introduced by commits: 2e35afaefe64 ("PCI: pciehp: Add reset_slot() method") and 06a8d89af551 ("PCI: pciehp: Disable link notification across slot reset") disables notification of Presence Detect Changed and Data Link Layer State Changed events for the duration of a secondary bus reset. However a bus reset not only triggers these events, but may also clear the Presence Detect State bit in the Slot Status register and the Data Link Layer Link Active bit in the Link Status register momentarily. According to Sinan Kaya: "I know for a fact that bus reset clears the Data Link Layer Active bit as soon as link goes down. It gets set again following link up. Presence detect depends on the HW implementation. QDT root ports don't change presence detect for instance since nobody actually removed the card. If an implementation supports in-band presence detect, the answer is yes. As soon as the link goes down, presence detect bit will get cleared until recovery." https://lkml.kernel.org/r/42e72f83-3b24-f7ef-e5bc-290fae99259a@codeaurora.org In-band presence detect is also covered in Table 4-15 in PCIe r4.0, sec 4.2.6. pciehp should therefore ensure that any parts of the driver that access those bits do not run concurrently to a bus reset. The only precaution the commits took to that effect was to halt interrupt polling. They made no effort to drain the slot workqueue, cancel an outstanding Attention Button work, or block slot enable/disable requests via sysfs and in the ->probe hook. Now that pciehp is converted to enable/disable the slot exclusively from the IRQ thread, the only places accessing the two above-mentioned bits are the IRQ thread and the ->probe hook. Add locking to serialize them with a bus reset. This obviates the need to halt interrupt polling. Do not add locking to the ->get_adapter_status sysfs callback to afford users unfettered access to that bit. Use an rw_semaphore in lieu of a regular mutex to allow parallel execution of the non-reset code paths accessing the critical bits, i.e. the IRQ thread and the ->probe hook. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Rajat Jain Cc: Alex Williamson Cc: Sinan Kaya commit 8cce437fbb5c1f2af2f63834fa05082596beca5d Author: Philipp Rudo Date: Thu Jul 19 11:13:45 2018 +0200 s390/kdump: Fix elfcorehdr size calculation Before the memory for the elfcorehdr is allocated the required size is estimated with alloc_size = 0x1000 + get_cpu_cnt() * 0x4a0 + mem_chunk_cnt * sizeof(Elf64_Phdr); Where 0x4a0 is used as size for the ELF notes to store the register contend. This size is 8 bytes too small. Usually this does not immediately cause a problem because the page reserved for overhead (Elf_Ehdr, vmcoreinfo, etc.) is pretty generous. So usually there is enough spare memory to counter the mis-calculated per cpu size. However, with growing overhead and/or a huge cpu count the allocated size gets too small for the elfcorehdr. Ultimately a BUG_ON is triggered causing the crash kernel to panic. Fix this by properly calculating the required size instead of relying on magic numbers. Fixes: a62bc07392539 ("s390/kdump: add support for vector extension") Signed-off-by: Philipp Rudo Signed-off-by: Martin Schwidefsky commit f7368a550275ee56da70fd4d603d5a3eb4b614e9 Author: Heiner Kallweit Date: Mon Jul 30 00:03:42 2018 +0200 PCI: Use IRQF_ONESHOT if pci_request_irq() called with no handler If we have a threaded interrupt with the handler being NULL, then request_threaded_irq() -> __setup_irq() will complain and bail out if the IRQF_ONESHOT flag isn't set. Therefore check for the handler being NULL and set IRQF_ONESHOT in this case. This change is needed to migrate the mei_me driver to pci_alloc_irq_vectors() and pci_request_irq(). Signed-off-by: Heiner Kallweit Signed-off-by: Bjorn Helgaas Reviewed-by: Thomas Gleixner commit 5248ee85603067e62a228402afd2fb68f957746b Author: Zubin Mithra Date: Wed Jul 25 10:19:01 2018 -0700 tracefs: Annotate tracefs_ops with __ro_after_init tracefs_ops is initialized inside tracefs_create_instance_dir and not modified after. tracefs_create_instance_dir allows for initialization only once, and is called from create_trace_instances(marked __init), which is called from tracer_init_tracefs(marked __init). Also, mark tracefs_create_instance_dir as __init. Link: http://lkml.kernel.org/r/20180725171901.4468-1-zsm@chromium.org Reviewed-by: Kees Cook Signed-off-by: Zubin Mithra Signed-off-by: Steven Rostedt (VMware) commit c3bc8fd637a9623f5c507bd18f9677effbddf584 Author: Joel Fernandes (Google) Date: Mon Jul 30 15:24:23 2018 -0700 tracing: Centralize preemptirq tracepoints and unify their usage This patch detaches the preemptirq tracepoints from the tracers and keeps it separate. Advantages: * Lockdep and irqsoff event can now run in parallel since they no longer have their own calls. * This unifies the usecase of adding hooks to an irqsoff and irqson event, and a preemptoff and preempton event. 3 users of the events exist: - Lockdep - irqsoff and preemptoff tracers - irqs and preempt trace events The unification cleans up several ifdefs and makes the code in preempt tracer and irqsoff tracers simpler. It gets rid of all the horrific ifdeferry around PROVE_LOCKING and makes configuration of the different users of the tracepoints more easy and understandable. It also gets rid of the time_* function calls from the lockdep hooks used to call into the preemptirq tracer which is not needed anymore. The negative delta in lines of code in this patch is quite large too. In the patch we introduce a new CONFIG option PREEMPTIRQ_TRACEPOINTS as a single point for registering probes onto the tracepoints. With this, the web of config options for preempt/irq toggle tracepoints and its users becomes: PREEMPT_TRACER PREEMPTIRQ_EVENTS IRQSOFF_TRACER PROVE_LOCKING | | \ | | \ (selects) / \ \ (selects) / TRACE_PREEMPT_TOGGLE ----> TRACE_IRQFLAGS \ / \ (depends on) / PREEMPTIRQ_TRACEPOINTS Other than the performance tests mentioned in the previous patch, I also ran the locking API test suite. I verified that all tests cases are passing. I also injected issues by not registering lockdep probes onto the tracepoints and I see failures to confirm that the probes are indeed working. This series + lockdep probes not registered (just to inject errors): [ 0.000000] hard-irqs-on + irq-safe-A/21: ok | ok | ok | [ 0.000000] soft-irqs-on + irq-safe-A/21: ok | ok | ok | [ 0.000000] sirq-safe-A => hirqs-on/12:FAILED|FAILED| ok | [ 0.000000] sirq-safe-A => hirqs-on/21:FAILED|FAILED| ok | [ 0.000000] hard-safe-A + irqs-on/12:FAILED|FAILED| ok | [ 0.000000] soft-safe-A + irqs-on/12:FAILED|FAILED| ok | [ 0.000000] hard-safe-A + irqs-on/21:FAILED|FAILED| ok | [ 0.000000] soft-safe-A + irqs-on/21:FAILED|FAILED| ok | [ 0.000000] hard-safe-A + unsafe-B #1/123: ok | ok | ok | [ 0.000000] soft-safe-A + unsafe-B #1/123: ok | ok | ok | With this series + lockdep probes registered, all locking tests pass: [ 0.000000] hard-irqs-on + irq-safe-A/21: ok | ok | ok | [ 0.000000] soft-irqs-on + irq-safe-A/21: ok | ok | ok | [ 0.000000] sirq-safe-A => hirqs-on/12: ok | ok | ok | [ 0.000000] sirq-safe-A => hirqs-on/21: ok | ok | ok | [ 0.000000] hard-safe-A + irqs-on/12: ok | ok | ok | [ 0.000000] soft-safe-A + irqs-on/12: ok | ok | ok | [ 0.000000] hard-safe-A + irqs-on/21: ok | ok | ok | [ 0.000000] soft-safe-A + irqs-on/21: ok | ok | ok | [ 0.000000] hard-safe-A + unsafe-B #1/123: ok | ok | ok | [ 0.000000] soft-safe-A + unsafe-B #1/123: ok | ok | ok | Link: http://lkml.kernel.org/r/20180730222423.196630-4-joel@joelfernandes.org Acked-by: Peter Zijlstra (Intel) Reviewed-by: Namhyung Kim Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit d664b851eb2bcdf84a3c063cf59457bb15bc6120 Author: Liviu Dudau Date: Mon Jul 23 12:05:53 2018 +0100 drm/arm/hdlcd: Reject atomic commits that disable only the plane The HDLCD engine needs an active plane while the CRTC is active, as it will start scanning out data from HDLCD_REG_FB_BASE once it gets enabled. Make sure that the only available plane doesn't get disabled while the CRTC remains active, as this will scanout invalid data. Signed-off-by: Liviu Dudau commit 9fd466f54f89fc3a2dc6f86fce2ea0b993ff83bd Author: Laurent Pinchart Date: Wed Jan 17 23:55:28 2018 +0200 drm: arm: hdlcd: Use drm_atomic_helper_shutdown() to disable planes on removal The plane cleanup handler currently calls drm_plane_helper_disable(), which is a legacy helper function. Replace it with a call to drm_atomic_helper_shutdown() at removal time. The plane .destroy() handler now consisting only of a call to drm_plane_cleanup(), replace it with direct calls to that function. Signed-off-by: Laurent Pinchart Signed-off-by: Liviu Dudau commit 8df24d57d34cd229e7094cfd1b927b585585202d Author: Laurent Pinchart Date: Wed Jan 17 23:55:27 2018 +0200 drm: arm: hdlcd: Don't destroy plane manually in hdlcd_setup_crtc() The top-level error handler calls drm_mode_config_cleanup() which will destroy all planes. There's no need to destroy them manually in lower error handlers. Signed-off-by: Laurent Pinchart Signed-off-by: Liviu Dudau commit 1785dbc412c257879274e8807afd6dfdfe06c47b Author: Noralf Trønnes Date: Fri Dec 8 20:37:35 2017 +0100 drm/arm/hdlcd: Use drm_fb_cma_fbdev_init/fini() Use drm_fb_cma_fbdev_init() and drm_fb_cma_fbdev_fini() which relies on the fact that drm_device holds a pointer to the drm_fb_helper structure. This means that the driver doesn't have to keep track of that. Also use the drm_fb_helper functions directly. Cc: Liviu Dudau Cc: Brian Starkey Signed-off-by: Noralf Trønnes Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit 5c7e5a22c126e4d7839e6bdcc05b3c4dfa945a72 Author: Noralf Trønnes Date: Fri Dec 8 20:37:34 2017 +0100 drm/arm/hdlcd: Use drm_mode_config_helper_suspend/resume() Replace driver's code with the generic helpers that do the same thing including the NULL check. Cc: Liviu Dudau Cc: Brian Starkey Signed-off-by: Noralf Trønnes Signed-off-by: Liviu Dudau commit 08fcf813281ebcf72c69487c1501ad91b7121cdb Author: Jens Axboe Date: Tue Jul 31 09:10:26 2018 -0600 t10-pi: provide empty t10_pi_complete() for !CONFIG_BLK_DEV_INTEGRITY Fixes a link failure whtn BLK_DEV_INTEGRITY isn't defined. Fixes: 10c41ddd6132 ("block: move dif_prepare/dif_complete functions to block layer") Signed-off-by: Jens Axboe commit 739e2edc848af30fefa66d6c422c00ca9a701c06 Author: Arnaldo Carvalho de Melo Date: Tue Jul 31 11:58:57 2018 -0300 perf bpf: Show better message when failing to load an object Before: libbpf: license of tools/perf/examples/bpf/etcsnoop.c is GPL libbpf: section(6) version, size 4, link 0, flags 3, type=1 libbpf: kernel version of tools/perf/examples/bpf/etcsnoop.c is 41200 libbpf: section(7) .symtab, size 120, link 1, flags 0, type=2 bpf: config program 'syscalls:sys_enter_openat' libbpf: load bpf program failed: Operation not permitted libbpf: failed to load program 'syscalls:sys_enter_openat' libbpf: failed to load object 'tools/perf/examples/bpf/etcsnoop.c' bpf: load objects failed After: (just the last line changes) bpf: load objects failed: err=-4009: (Incorrect kernel version) Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-wi44iid0yjfht3lcvplc75fm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f09757ab401ff332030f8e3a41cec6a44e6d9461 Author: Alexandre Belloni Date: Tue Jul 31 16:38:53 2018 +0200 spi: dw: document Microsemi integration The integration of the Designware SPI controller on Microsemi SoCs requires an extra register set to be able to give the IP control of the SPI interface. Cc: Rob Herring Signed-off-by: Alexandre Belloni Signed-off-by: Mark Brown commit 5788f77959110480486c441b912da5c2cc5fc4d2 Author: Damien Thébault Date: Wed Jul 18 12:06:01 2018 +0200 platform/x86: dell-laptop: Fix backlight detection Fix return code check for "max brightness" ACPI call. The Dell laptop ACPI video brightness control is not present on dell laptops anymore, but was present in older kernel versions. The code that checks the return value is incorrect since the SMM refactoring. The old code was: if (buffer->output[0] == 0) Which was changed to: ret = dell_send_request(...) if (ret) However, dell_send_request() will return 0 if buffer->output[0] == 0, so we must change the check to: if (ret == 0) This issue was found on a Dell M4800 laptop, and the fix tested on it as well. Fixes: 549b4930f057 ("dell-smbios: Introduce dispatcher for SMM calls") Signed-off-by: Damien Thébault Tested-by: Damien Thébault Reviewed-by: Pali Rohár Reviewed-by: Mario Limonciello Signed-off-by: Andy Shevchenko commit 95f04328e42dc7d1eb08f3cb38150c1f2ec09f57 Author: Michael Petlan Date: Mon Jul 30 17:35:04 2018 -0400 perf list: Unify metric group description format with PMU event description PMU event descriptions use 7 spaces + '[' or 8 spaces as indentation. Metric groups used a tab + '['. This patch unifies it to the way PMU event descriptions are indented. BEFORE: $ perf list [...] Metric Groups: DSB: DSB_Coverage [Fraction of Uops delivered by the DSB (aka Decoded Icache; or Uop Cache)] [...] AFTER: $ perf list [...] Metric Groups: DSB: DSB_Coverage [Fraction of Uops delivered by the DSB (aka Decoded Icache; or Uop Cache)] [...] Signed-off-by: Michael Petlan Acked-by: Jiri Olsa Cc: Kim Phillips LPU-Reference: 771439042.22924766.1532986504631.JavaMail.zimbra@redhat.com Link: https://lkml.kernel.org/n/tip-mlo850517m6u1rbjndvd1bwr@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b9b77222d4ff6b5bb8f5d87fca20de0910618bb9 Author: Ganapatrao Kulkarni Date: Tue Jul 31 15:32:51 2018 +0530 perf vendor events arm64: Update ThunderX2 implementation defined pmu core events Signed-off-by: Ganapatrao Kulkarni Cc: Alexander Shishkin Cc: Ganapatrao Kulkarni Cc: Jan Glauber Cc: Jayachandran C Cc: Jiri Olsa Cc: linux-arm-kernel@lists.infradead.org Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Richter Cc: Vadim Lomovtsev Cc: Will Deacon Link: http://lkml.kernel.org/r/20180731100251.23575-1-ganapatrao.kulkarni@cavium.com Signed-off-by: Arnaldo Carvalho de Melo commit 14a85b1eca348e00a9f209b522f94ec3ead94acb Author: Leo Yan Date: Wed Jul 11 15:45:45 2018 +0800 perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet CS_ETM_TRACE_ON packet itself can give the info that there have a discontinuity in the trace, this patch is to add branch sample for CS_ETM_TRACE_ON packet if it is inserted in the middle of CS_ETM_RANGE packets; as result we can have hint for the trace discontinuity. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1531295145-596-7-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit d603b4e9f9c3181f2dacb989bba60081b99befe4 Author: Leo Yan Date: Wed Jul 11 15:45:44 2018 +0800 perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet If one CS_ETM_TRACE_ON packet is inserted, we miss to generate branch sample for the previous CS_ETM_RANGE packet. This patch is to generate branch sample when receiving a CS_ETM_TRACE_ON packet, so this can save complete info for the previous CS_ETM_RANGE packet just before CS_ETM_TRACE_ON packet. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1531295145-596-6-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 6035b6804bdfd662c8ee6226dc90f3764060ec73 Author: Leo Yan Date: Wed Jul 11 15:45:43 2018 +0800 perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet For CS_ETM_TRACE_ON packet, its fields 'packet->start_addr' and 'packet->end_addr' equal to 0xdeadbeefdeadbeefUL which are emitted in the decoder layer as dummy value, but the dummy value is pointless for branch sample when we use 'perf script' command to check program flow. This patch is a preparation to support CS_ETM_TRACE_ON packet for branch sample, it converts the dummy address value to zero for more readable; this is accomplished by cs_etm__last_executed_instr() and cs_etm__first_executed_instr(). The later one is a new function introduced by this patch. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1531295145-596-5-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 3eb3e07bcfee0670d7142f839c76f33f3d265793 Author: Leo Yan Date: Wed Jul 11 15:45:42 2018 +0800 perf cs-etm: Fix start tracing packet handling Usually the start tracing packet is a CS_ETM_TRACE_ON packet, this packet is passed to cs_etm__flush(); cs_etm__flush() will check the condition 'prev_packet->sample_type == CS_ETM_RANGE' but 'prev_packet' is allocated by zalloc() so 'prev_packet->sample_type' is zero in initialization and this condition is false. So cs_etm__flush() will directly bail out without handling the start tracing packet. This patch is to introduce a new sample type CS_ETM_EMPTY, which is used to indicate the packet is an empty packet. cs_etm__flush() will swap packets when it finds the previous packet is empty, so this can record the start tracing packet into 'etmq->prev_packet'. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1531295145-596-4-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 83868bf71d2eb7700b37f1ea188007f0125e4ee4 Author: Thomas Richter Date: Tue Jul 31 09:32:54 2018 +0200 perf build: Fix installation directory for eBPF The perf tool build and install is controlled via a Makefile. The 'install' rule creates directories and copies files. Among them are header files installed in /usr/lib/include/perf/bpf/. However all listed examples are installing its header files in /usr/lib//...[/include]/header.h and not in /usr/lib/include//.../header.h. Background information: Building the Fedora 28 glibc RPM on s390x and s390 fails on s390 (gcc -m31) as gcc is not able to find header-files like stdbool.h. In the glibc.spec file, you can see that glibc is configured with "--with-headers". In this case, first -nostdinc is added to the CFLAGS and then further include paths are added via -isystem. One of those paths should contain header files like stdbool.h. In order to get this path, gcc is invoked with: - on Fedora 28 (with 4.18 kernel): $ gcc -print-file-name=include /usr/lib/gcc/s390x-redhat-linux/8/include $ gcc -m31 -print-file-name=include /usr/lib/gcc/s390x-redhat-linux/8/../../../../lib/include => If perf is installed, this is: /usr/lib/include On my machine this directory is only containing the directory "perf". If perf is not installed gcc returns: /usr/lib/gcc/s390x-redhat-linux/8/include - on Ubuntu 18.04 (with 4.15 kernel): $ gcc -print-file-name=include /usr/lib/gcc/s390x-linux-gnu/7/include $ gcc -m31 -print-file-name=include /usr/lib/gcc/s390x-linux-gnu/7/include => gcc returns the correct path even if perf is installed. In each case, the introduction of the subdirectory /usr/lib/include leads to the regression that one can not build the glibc RPM for s390 anymore as gcc can not find headers like stdbool.h. To remedy this install bpf.h to /usr/lib/perf/include/bpf/bpf.h Output before using the command 'perf test -Fv 40': echo '...[bpf-program-source]...' | /usr/bin/clang ... \ -I/root/lib/include/perf/bpf ... ^^^^^^^^^^^^ ... [root@p23lp27 perf]# perf test -F 40 40: BPF filter : 40.1: Basic BPF filtering : Ok 40.2: BPF pinning : Ok 40.3: BPF prologue generation : Ok 40.4: BPF relocation checker : Ok [root@p23lp27 perf]# Output after using command 'perf test -Fv 40': echo '...[bpf-program-source]...' | /usr/bin/clang ... \ -I/root/lib/perf/include/bpf ... ^^^^^^^^^^^^ ... [root@p23lp27 perf]# perf test -F 40 40: BPF filter : 40.1: Basic BPF filtering : Ok 40.2: BPF pinning : Ok 40.3: BPF prologue generation : Ok 40.4: BPF relocation checker : Ok [root@p23lp27 perf]# Committer testing: While the above 'perf test -F 40' (or 'perf test bpf') will allow us to see that the correct path is now added via -I, to actually test this we better try to use a bpf script that includes files in the changed directory. We have the files that now reside in /root/lib/perf/examples/bpf/ to do just that: # tail -8 /root/lib/perf/examples/bpf/5sec.c #include int probe(hrtimer_nanosleep, rqtp->tv_sec)(void *ctx, int err, long sec) { return sec == 5; } license(GPL); # perf trace -e *sleep -e /root/lib/perf/examples/bpf/5sec.c sleep 4 0.333 (4000.086 ms): sleep/9248 nanosleep(rqtp: 0x7ffc155f3300) = 0 # perf trace -e *sleep -e /root/lib/perf/examples/bpf/5sec.c sleep 5 0.287 ( ): sleep/9659 nanosleep(rqtp: 0x7ffeafe38200) ... 0.290 ( ): perf_bpf_probe:hrtimer_nanosleep:(ffffffff9911efe0) tv_sec=5 0.287 (5000.059 ms): sleep/9659 ... [continued]: nanosleep()) = 0 # perf trace -e *sleep -e /root/lib/perf/examples/bpf/5sec.c sleep 6 0.247 (5999.951 ms): sleep/10068 nanosleep(rqtp: 0x7fff2086d900) = 0 # perf trace -e *sleep -e /root/lib/perf/examples/bpf/5sec.c sleep 5.987 0.293 ( ): sleep/10489 nanosleep(rqtp: 0x7ffdd4fc10e0) ... 0.296 ( ): perf_bpf_probe:hrtimer_nanosleep:(ffffffff9911efe0) tv_sec=5 0.293 (5986.912 ms): sleep/10489 ... [continued]: nanosleep()) = 0 # Suggested-by: Stefan Liebler Suggested-by: Arnaldo Carvalho de Melo Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Martin Schwidefsky Fixes: 1b16fffa389d ("perf llvm-utils: Add bpf include path to clang command line") Link: http://lkml.kernel.org/r/20180731073254.91090-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 73978332572ccf5e364c31e9a70ba953f8202b46 Author: Jiri Olsa Date: Tue Jul 24 08:20:08 2018 +0200 perf c2c report: Fix crash for empty browser 'perf c2c' scans read/write accesses and tries to find false sharing cases, so when the events it wants were not asked for or ended up not taking place, we get no histograms. So do not try to display entry details if there's not any. Currently this ends up in crash: $ perf c2c report # then press 'd' perf: Segmentation fault $ Committer testing: Before: Record a perf.data file without events of interest to 'perf c2c report', then call it and press 'd': # perf record sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.001 MB perf.data (6 samples) ] # perf c2c report perf: Segmentation fault -------- backtrace -------- perf[0x5b1d2a] /lib64/libc.so.6(+0x346df)[0x7fcb566e36df] perf[0x46fcae] perf[0x4a9f1e] perf[0x4aa220] perf(main+0x301)[0x42c561] /lib64/libc.so.6(__libc_start_main+0xe9)[0x7fcb566cff29] perf(_start+0x29)[0x42c999] # After the patch the segfault doesn't take place, a follow up patch to tell the user why nothing changes when 'd' is pressed would be good. Reported-by: rodia@autistici.org Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Don Zickus Cc: Joe Mario Cc: Namhyung Kim Cc: Peter Zijlstra Fixes: f1c5fd4d0bb9 ("perf c2c report: Add TUI cacheline browser") Link: http://lkml.kernel.org/r/20180724062008.26126-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit aa90f9f9554616d5738f7bedb4a8f0e5e14d1bc6 Author: Sandipan Das Date: Thu Jul 26 22:47:33 2018 +0530 perf tests: Fix indexing when invoking subtests Recently, the subtest numbering was changed to start from 1. While it is fine for displaying results, this should not be the case when the subtests are actually invoked. Typically, the subtests are stored in zero-indexed arrays and invoked based on the index passed to the main test function. Since the index now starts from 1, the second subtest in the array (index 1) gets invoked instead of the first (index 0). This applies to all of the following subtests but for the last one, the subtest always fails because it does not meet the boundary condition of the subtest index being lesser than the number of subtests. This can be observed on powerpc64 and x86_64 systems running Fedora 28 as shown below. Before: # perf test "builtin clang support" 55: builtin clang support : 55.1: builtin clang compile C source to IR : Ok 55.2: builtin clang compile C source to ELF object : FAILED! # perf test "LLVM search and compile" 38: LLVM search and compile : 38.1: Basic BPF llvm compile : Ok 38.2: kbuild searching : Ok 38.3: Compile source for BPF prologue generation : Ok 38.4: Compile source for BPF relocation : FAILED! # perf test "BPF filter" 40: BPF filter : 40.1: Basic BPF filtering : Ok 40.2: BPF pinning : Ok 40.3: BPF prologue generation : Ok 40.4: BPF relocation checker : FAILED! After: # perf test "builtin clang support" 55: builtin clang support : 55.1: builtin clang compile C source to IR : Ok 55.2: builtin clang compile C source to ELF object : Ok # perf test "LLVM search and compile" 38: LLVM search and compile : 38.1: Basic BPF llvm compile : Ok 38.2: kbuild searching : Ok 38.3: Compile source for BPF prologue generation : Ok 38.4: Compile source for BPF relocation : Ok # perf test "BPF filter" 40: BPF filter : 40.1: Basic BPF filtering : Ok 40.2: BPF pinning : Ok 40.3: BPF prologue generation : Ok 40.4: BPF relocation checker : Ok Signed-off-by: Sandipan Das Reported-by: Arnaldo Carvalho de Melo Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Hendrik Brueckner Cc: Jiri Olsa Cc: Martin Schwidefsky Cc: Naveen N. Rao Cc: Ravi Bangoria Cc: Thomas Richter Fixes: 9ef0112442bd ("perf test: Fix subtest number when showing results") Link: http://lkml.kernel.org/r/20180726171733.33208-1-sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 162d3edbe591a97939516b546162b9ba05ec62cb Author: Arnaldo Carvalho de Melo Date: Thu Jul 26 09:26:13 2018 -0300 perf trace: Beautify the AF_INET & AF_INET6 'socket' syscall 'protocol' args For instance: $ trace -e socket* ssh sandy 0.000 ( 0.031 ms): ssh/19919 socket(family: LOCAL, type: STREAM|CLOEXEC|NONBLOCK ) = 3 0.052 ( 0.015 ms): ssh/19919 socket(family: LOCAL, type: STREAM|CLOEXEC|NONBLOCK ) = 3 1.568 ( 0.020 ms): ssh/19919 socket(family: LOCAL, type: STREAM|CLOEXEC|NONBLOCK ) = 3 1.603 ( 0.012 ms): ssh/19919 socket(family: LOCAL, type: STREAM|CLOEXEC|NONBLOCK ) = 3 1.699 ( 0.014 ms): ssh/19919 socket(family: LOCAL, type: STREAM|CLOEXEC|NONBLOCK ) = 3 1.724 ( 0.012 ms): ssh/19919 socket(family: LOCAL, type: STREAM|CLOEXEC|NONBLOCK ) = 3 1.804 ( 0.020 ms): ssh/19919 socket(family: INET, type: STREAM, protocol: TCP ) = 3 17.549 ( 0.098 ms): ssh/19919 socket(family: LOCAL, type: STREAM ) = 4 acme@sandy's password: Just like with other syscall args, the common bits are supressed so that the output is more compact, i.e. we use "TCP" instead of "IPPROTO_TCP", but we can make this show the original constant names if we like it by using some command line knob or ~/.perfconfig "[trace]" section variable. Also needed is to make perf's event parser accept things like: $ perf trace -e socket*/protocol=TCP/ By using both the tracefs event 'format' files and these tables built from the kernel sources. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-l39jz1vnyda0b6jsufuc8bz7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 03aeb6c818b608a2b344e21bb978030c41158045 Author: Arnaldo Carvalho de Melo Date: Thu Jul 26 09:26:13 2018 -0300 perf trace beauty: Add beautifiers for 'socket''s 'protocol' arg It'll be wired to 'perf trace' in the next cset. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-2i9vkvm1ik8yu4hgjmxhsyjv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bc972ada4f85450ebf20c4981ee84a1a4b060161 Author: Arnaldo Carvalho de Melo Date: Thu Jul 26 15:30:33 2018 -0300 perf trace beauty: Do not print NULL strarray entries We may have string tables where not all slots have values, in those cases its better to print the numeric value, for instance: In the table below we would show "protocol: (null)" for socket_ipproto[3] Where it would be better to show "protocol: 3". $ tools/perf/trace/beauty/socket_ipproto.sh static const char *socket_ipproto[] = { [0] = "IP", [103] = "PIM", [108] = "COMP", [12] = "PUP", [132] = "SCTP", [136] = "UDPLITE", [137] = "MPLS", [17] = "UDP", [1] = "ICMP", [22] = "IDP", [255] = "RAW", [29] = "TP", [2] = "IGMP", [33] = "DCCP", [41] = "IPV6", [46] = "RSVP", [47] = "GRE", [4] = "IPIP", [50] = "ESP", [51] = "AH", [6] = "TCP", [8] = "EGP", [92] = "MTP", [94] = "BEETPH", [98] = "ENCAP", }; $ Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-7djfak94eb3b9ltr79cpn3ti@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9849eec3a44c6f47948117c14d7afb8cf53bf0fb Author: Arnaldo Carvalho de Melo Date: Thu Jul 26 09:26:13 2018 -0300 perf beauty: Add a generator for IPPROTO_ socket's protocol constants It'll use tools/include copy of linux/in.h to generate a table to be used by tools, initially by the 'socket' and 'socketpair' beautifiers in 'perf trace', but that could also be used to translate from a string constant to the integer value to be used in a eBPF or tracefs tracepoint filter. When used without any args it produces: $ tools/perf/trace/beauty/socket_ipproto.sh static const char *socket_ipproto[] = { [0] = "IP", [103] = "PIM", [108] = "COMP", [12] = "PUP", [132] = "SCTP", [136] = "UDPLITE", [137] = "MPLS", [17] = "UDP", [1] = "ICMP", [22] = "IDP", [255] = "RAW", [29] = "TP", [2] = "IGMP", [33] = "DCCP", [41] = "IPV6", [46] = "RSVP", [47] = "GRE", [4] = "IPIP", [50] = "ESP", [51] = "AH", [6] = "TCP", [8] = "EGP", [92] = "MTP", [94] = "BEETPH", [98] = "ENCAP", }; $ Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-v9rafqh3qn6b9kp9vfvj9f8s@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a4b2061242ecc024b1ee975e066b6e38db1c6b9e Author: Arnaldo Carvalho de Melo Date: Thu Jul 26 09:26:13 2018 -0300 tools include uapi: Grab a copy of linux/in.h We'll use it to create tables for the 'protocol' argument to the socket syscall when the 'family' arg is one of AF_INET or AF_INET6. Add it to check_headers.sh so that when a new protocol gets added we get a notification during the build process. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-2amnveu1ns4emjn70xuavpje@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a6f39cecf71537d105f4bf87b8d4760851960838 Author: Sandipan Das Date: Thu Jul 26 16:25:02 2018 +0530 perf tests: Fix complex event name parsing The 'umask' event parameter is unsupported on some architectures like powerpc64. This can be observed on a powerpc64le system running Fedora 27 as shown below. # perf test "Parse event definition strings" -v 6: Parse event definition strings : --- start --- test child forked, pid 45915 ... running test 3 'cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2,umask=0x3/ukp'Invalid event/parameter 'umask' Invalid event/parameter 'umask' failed to parse event 'cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2,umask=0x3/ukp', err 1, str 'unknown term' event syntax error: '..,event=0x2,umask=0x3/ukp' \___ unknown term valid terms: event,mark,pmc,cache_sel,pmcxsel,unit,thresh_stop,thresh_start,combine,thresh_sel,thresh_cmp,sample_mode,config,config1,config2,name,period,freq,branch_type,time,call-graph,stack-size,no-inherit,inherit,max-stack,no-overwrite,overwrite,driver-config mem_access -> cpu/event=0x10401e0/ running test 0 'config=10,config1,config2=3,umask=1' test child finished with 1 ---- end ---- Parse event definition strings: FAILED! Committer testing: After applying the patch these test passes and in verbose mode we get: # perf test -v "event definition" 6: Parse event definition strings: --- start --- test child forked, pid 11061 running test 0 'syscalls:sys_enter_openat'Using CPUID GenuineIntel-6-9E running test 53 'cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk' running test 0 'cpu/config=10,config1,config2=3,period=1000/u' running test 1 'cpu/config=1,name=krava/u,cpu/config=2/u' running test 2 'cpu/config=1,call-graph=fp,time,period=100000/,cpu/config=2,call-graph=no,time=0,period=2000/' running test 3 'cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2/ukp' test child finished with 0 ---- end ---- Parse event definition strings: Ok # Suggested-by: Ravi Bangoria Signed-off-by: Sandipan Das Tested-by: Arnaldo Carvalho de Melo Cc: Alexey Budankov Cc: Jiri Olsa Cc: Naveen N. Rao Fixes: 06dc5bf21f3f ("perf tests: Check that complex event name is parsed correctly") Link: http://lkml.kernel.org/r/20180726105502.31670-1-sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3e91a8b5c1585a8c4445ffe5bd0f0202c4582ab0 Author: Colin Ian King Date: Mon Jul 30 14:44:46 2018 +0100 drm/msm/disp/dpu: fix two spelling mistakes Trivial fix to spelling mistake in error messages "diable" -> "disable" "cliend" -> "client" Signed-off-by: Colin Ian King Reviewed-by: Sean Paul Signed-off-by: Rob Clark commit a0a4959eb4e94ce98ee5549dd7d1296d41162ca8 Author: Jorge Sanjuan Date: Tue Jul 31 13:28:45 2018 +0100 ALSA: usb-audio: Operate UAC3 Power Domains in PCM callbacks Make use of UAC3 Power Domains associated to an Audio Streaming path within the PCM's logic. This means, when there is no audio being transferred (pcm is closed), the host will set the Power Domain associated to that substream to state D1. When audio is being transferred (from hw_params onwards), the Power Domain will be set to D0 state. This is the way the host lets the device know which Terminal is going to be actively used and it is for the device to manage its own internal resources on that UAC3 Power Domain. Note the resume method now sets the Power Domain to D1 state as resuming the device doesn't mean audio streaming will occur. Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit 3f59aa11c6776da8d0f9f50c741ef02bfc4a8766 Author: Jorge Sanjuan Date: Tue Jul 31 13:28:44 2018 +0100 ALSA: usb-audio: Add UAC3 Power Domains to suspend/resume Set the UAC3 Power Domain state for an Audio Streaming interface to D2 state before suspending the device (usb_driver callback). This lets the device know there is no intention to use any of the Units in the Audio Function and that the host is not going to even listen for wake-up events (interrupts) on the units. When the usb_driver gets resumed, the state D0 (fully powered) will be set. This ties up the UAC3 Power Domains to the runtime PM. Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit 7edf3b5e6a4544b42d3572a7058f8ffe96349ee8 Author: Jorge Sanjuan Date: Tue Jul 31 13:28:43 2018 +0100 ALSA: usb-audio: AudioStreaming Power Domain parsing Power Domains in the UAC3 spec are mainly intended to be associated to an Input or Output Terminal so the host changes the power state of the entire capture or playback path within the topology. This patch adds support for finding Power Domains associated to an Audio Streaming Interface (bTerminalLink) and adds a reference to them in the usb audio substreams (snd_usb_substream). Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit 11785ef53228d23ec386f5fe4a34601536f0c891 Author: Jorge Sanjuan Date: Tue Jul 31 13:28:42 2018 +0100 ALSA: usb-audio: Initial Power Domain support Thee USB Audio Class 3 (UAC3) introduces Power Domains as a new feature to let a host turn individual parts of an audio function to different power states via USB requests. This lets the device get to know a bit amore about what the host is up to in order to optimize power consumption efficiently. The Power Domains are optional for UAC3 configuration but all UAC3 devices shall include at least one BADD configuration where the support for Power Domains is compulsory. This patch adds a set of features/helpers to parse these power domains and change their status. Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit 95035c5e167ae6e740b1ddd30210ae0eaf39a5db Author: Kan Liang Date: Mon Jul 9 07:15:22 2018 -0700 perf evlist: Fix error out while applying initial delay and LBR 'perf record' will error out if both --delay and LBR are applied. For example: # perf record -D 1000 -a -e cycles -j any -- sleep 2 Error: dummy:HG: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat' # A dummy event is added implicitly for initial delay, which has the same configurations as real sampling events. The dummy event is a software event. If LBR is configured, perf must error out. The dummy event will only be used to track PERF_RECORD_MMAP while perf waits for the initial delay to enable the real events. The BRANCH_STACK bit can be safely cleared for the dummy event. After applying the patch: # perf record -D 1000 -a -e cycles -j any -- sleep 2 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.054 MB perf.data (828 samples) ] # Reported-by: Sunil K Pandey Signed-off-by: Kan Liang Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1531145722-16404-1-git-send-email-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 61b229ce2c152e7700ca603c7b86cdd99619db01 Author: Arnaldo Carvalho de Melo Date: Wed Jul 25 14:24:02 2018 -0300 perf trace beauty: Default header_dir to cwd to work without parms Useful when checking the effects of header synchs for the files it uses as a input to generate string tables, in retrospect this is how it should've been done from day 1, not requiring the header_dir to be set on the Makefile, will change everything later, so that the only parm, common to all generators will be $(srctree) and $(beauty_outdir). So, to see what it generates, just call it without any parameters: $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh static const char *vhost_virtio_ioctl_cmds[] = { [0x00] = "SET_FEATURES", [0x01] = "SET_OWNER", [0x02] = "RESET_OWNER", [0x03] = "SET_MEM_TABLE", [0x04] = "SET_LOG_BASE", [0x07] = "SET_LOG_FD", [0x10] = "SET_VRING_NUM", [0x11] = "SET_VRING_ADDR", [0x12] = "SET_VRING_BASE", [0x13] = "SET_VRING_ENDIAN", [0x14] = "GET_VRING_ENDIAN", [0x20] = "SET_VRING_KICK", [0x21] = "SET_VRING_CALL", [0x22] = "SET_VRING_ERR", [0x23] = "SET_VRING_BUSYLOOP_TIMEOUT", [0x24] = "GET_VRING_BUSYLOOP_TIMEOUT", [0x30] = "NET_SET_BACKEND", [0x40] = "SCSI_SET_ENDPOINT", [0x41] = "SCSI_CLEAR_ENDPOINT", [0x42] = "SCSI_GET_ABI_VERSION", [0x43] = "SCSI_SET_EVENTS_MISSED", [0x44] = "SCSI_GET_EVENTS_MISSED", [0x60] = "VSOCK_SET_GUEST_CID", [0x61] = "VSOCK_SET_RUNNING", }; static const char *vhost_virtio_ioctl_read_cmds[] = { [0x00] = "GET_FEATURES", [0x12] = "GET_VRING_BASE", }; $ Or: $ tools/perf/trace/beauty/sndrv_pcm_ioctl.sh static const char *sndrv_pcm_ioctl_cmds[] = { [0x00] = "PVERSION", [0x01] = "INFO", [0x02] = "TSTAMP", [0x03] = "TTSTAMP", [0x04] = "USER_PVERSION", [0x10] = "HW_REFINE", [0x11] = "HW_PARAMS", [0x12] = "HW_FREE", [0x13] = "SW_PARAMS", [0x20] = "STATUS", [0x21] = "DELAY", [0x22] = "HWSYNC", [0x23] = "SYNC_PTR", [0x24] = "STATUS_EXT", [0x32] = "CHANNEL_INFO", [0x40] = "PREPARE", [0x41] = "RESET", [0x42] = "START", [0x43] = "DROP", [0x44] = "DRAIN", [0x45] = "PAUSE", [0x46] = "REWIND", [0x47] = "RESUME", [0x48] = "XRUN", [0x49] = "FORWARD", [0x50] = "WRITEI_FRAMES", [0x51] = "READI_FRAMES", [0x52] = "WRITEN_FRAMES", [0x53] = "READN_FRAMES", [0x60] = "LINK", [0x61] = "UNLINK", }; $ Etc. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-90am4vm8hh1osms894dp2otr@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c2586cfbb905939b79b49a9121fb0a59a5668fd6 Merge: 25a00ac7dc92 ce03b6d2b610 Author: Arnaldo Carvalho de Melo Date: Tue Jul 31 09:55:45 2018 -0300 Merge remote-tracking branch 'tip/perf/urgent' into perf/core To pick up fixes. Signed-off-by: Arnaldo Carvalho de Melo commit dcab90d90935f990407c86b671a7f1ac285d106c Author: Will Deacon Date: Tue Jul 31 12:09:03 2018 +0100 arm64: kexec: Add comment to explain use of __flush_icache_range() Now that we understand the deadlock arising from flush_icache_range() on the kexec crash kernel path, add a comment to justify the use of __flush_icache_range() here. Reported-by: Dave Kleikamp Signed-off-by: Will Deacon commit eab1cecc1223378fee700ab6acebf0f39fa6da81 Author: Will Deacon Date: Tue Jul 31 12:02:18 2018 +0100 arm64: sdei: Mark sdei stack helper functions as static The SDEI stack helper functions are only used by _on_sdei_stack() and refer to symbols (e.g. sdei_stack_normal_ptr) that are only defined if CONFIG_VMAP_STACK=y. Mark these functions as static, so we don't run into errors at link-time due to references to undefined symbols. Stick all the parameters onto the same line whilst we're passing through. Signed-off-by: Will Deacon commit 044e7ca20496b3c728c7ec87b778bf8cca8f012b Author: kbuild test robot Date: Tue Jul 31 13:06:58 2018 +0200 fbdev: omap2: omapfb: fix ifnullfree.cocci warnings drivers/video/fbdev/omap2/omapfb/dss/core.c:141:2-26: WARNING: NULL check before some freeing functions is not needed. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST") Signed-off-by: kbuild test robot Cc: Mauro Carvalho Chehab Cc: Laurent Pinchart Cc: Arnd Bergmann Signed-off-by: Bartlomiej Zolnierkiewicz commit 6e7f3997bd546c3b36bc7f9ecee0d54dac22a2b3 Author: kbuild test robot Date: Tue Jul 31 13:06:58 2018 +0200 fbdev: omap2: omapfb: fix bugon.cocci warnings drivers/video/fbdev/omap2/omapfb/dss/dss_features.c:895:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h) Use BUG_ON instead of a if condition followed by BUG. Semantic patch information: This makes an effort to find cases where BUG() follows an if condition on an expression and replaces the if condition and BUG() with a BUG_ON having the conditional expression of the if statement as argument. Generated by: scripts/coccinelle/misc/bugon.cocci Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST") Signed-off-by: kbuild test robot Cc: Mauro Carvalho Chehab Signed-off-by: Bartlomiej Zolnierkiewicz commit cb653fe849f9fdcf24ce3c612e3fb0da5e610241 Author: kbuild test robot Date: Tue Jul 31 13:06:58 2018 +0200 fbdev: omap2: omapfb: fix boolreturn.cocci warnings drivers/video/fbdev/omap2/omapfb/omapfb-main.c:290:9-10: WARNING: return of 0/1 in function 'cmp_var_to_colormode' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST") Signed-off-by: kbuild test robot Cc: Mauro Carvalho Chehab Cc: Dan Carpenter Signed-off-by: Bartlomiej Zolnierkiewicz commit 195197f408567b54b312c54518fbca653c5442c6 Author: Randy Dunlap Date: Tue Jul 31 13:06:58 2018 +0200 fb: amifb: fix build warnings when not builtin Fix build warning when built as a loadable module. amifb_setup() and amifb_setup_mcap() are only needed when the driver is builtin. This matches how the functions are called (using #ifndef MODULE). ../drivers/video/fbdev/amifb.c:2344:19: warning: 'amifb_setup' defined but not used [-Wunused-function] static int __init amifb_setup(char *options) ../drivers/video/fbdev/amifb.c:2307:20: warning: 'amifb_setup_mcap' defined but not used [-Wunused-function] static void __init amifb_setup_mcap(char *spec) Signed-off-by: Randy Dunlap Reviewed-by: Geert Uytterhoeven Signed-off-by: Bartlomiej Zolnierkiewicz commit 3f2ce54284a60500eb6dca1dca6fd615df8f9aa3 Author: Thomas Zimmermann Date: Tue Jul 31 13:06:58 2018 +0200 fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set If the console is unlocked during registration, the console subsystem generates significant amounts of warnings, which obfuscate actual debugging messages. Setting ignore_console_lock_warning while debugging console registration avoid the noise. v3: - manipulate ignore_console_lock_warning with atomic_{inc,dec} v2: - restore ignore_console_lock_warning if lock_fb_info() fails Signed-off-by: Thomas Zimmermann Acked-by: Hans de Goede Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Cc: Steven Rostedt (VMware) Cc: Andrew Morton Signed-off-by: Bartlomiej Zolnierkiewicz commit 56e6c104e4f151e19eb410004405ec52b4f8605a Author: Thomas Zimmermann Date: Tue Jul 31 13:06:57 2018 +0200 console: Replace #if 0 with atomic var 'ignore_console_lock_warning' The macro WARN_CONSOLE_UNLOCKED prints a warning when a thread enters the console's critical section without having acquired the console lock. The console lock can be ignored when debugging the console using printk, but this makes WARN_CONSOLE_UNLOCKED generate unnecessary warnings. The variable ignore_console_lock_warning temporarily disables WARN_CONSOLE_UNLOCKED. Developers interested in debugging the console's critical sections should increment it before entering the CS and decrement it after leaving the CS. Setting ignore_console_lock_warning is only for debugging. Regular operation should not manipulate it. Acknoledgements: This patch is based on an earlier version by Steven Rostedt. The use of atomic increment/decrement was suggested by Petr Mladek. Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a25696b5@suse.de Signed-off-by: Thomas Zimmermann Acked-by: Hans de Goede Acked-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Cc: Steven Rostedt (VMware) Cc: Andrew Morton [b.zolnierkie: use ] Signed-off-by: Bartlomiej Zolnierkiewicz commit b87b9cf4935325c98522823caeddd333022a1c62 Author: Sam Bobroff Date: Mon Jul 30 11:59:14 2018 +1000 powerpc/pseries: fix EEH recovery of some IOV devices EEH recovery currently fails on pSeries for some IOV capable PCI devices, if CONFIG_PCI_IOV is on and the hypervisor doesn't provide certain device tree properties for the device. (Found on an IOV capable device using the ipr driver.) Recovery fails in pci_enable_resources() at the check on r->parent, because r->flags is set and r->parent is not. This state is due to sriov_init() setting the start, end and flags members of the IOV BARs but the parent not being set later in pseries_pci_fixup_iov_resources(), because the "ibm,open-sriov-vf-bar-info" property is missing. Correct this by zeroing the resource flags for IOV BARs when they can't be configured (this is the same method used by sriov_init() and __pci_read_base()). VFs cleared this way can't be enabled later, because that requires another device tree property, "ibm,number-of-configurable-vfs" as well as support for the RTAS function "ibm_map_pes". These are all part of hypervisor support for IOV and it seems unlikely that a hypervisor would ever partially, but not fully, support it. (None are currently provided by QEMU/KVM.) Signed-off-by: Sam Bobroff Reviewed-by: Bryant G. Ly Signed-off-by: Michael Ellerman commit e0da99123f3c80f679d1b40a4321c1478bef14f7 Author: Shilpasri G Bhat Date: Tue Jul 24 14:43:09 2018 +0530 hwmon: (ibmpowernv) Add attributes to enable/disable sensor groups OPAL firmware provides the facility for some groups of sensors to be enabled/disabled at runtime to give the user the option of using the system resources for collecting these sensors or not. For example, on POWER9 systems, the On Chip Controller (OCC) gathers various system and chip level sensors and maintains their values in main memory. This patch provides support for enabling/disabling the sensor groups like power, temperature, current and voltage. Signed-off-by: Shilpasri G Bhat [stewart@linux.vnet.ibm.com: Commit message] Acked-by: Guenter Roeck Signed-off-by: Michael Ellerman commit 04baaf28f40c68c35a413cd9d0db7139c67e6caf Author: Shilpasri G Bhat Date: Tue Jul 24 14:43:08 2018 +0530 powerpc/powernv: Add support to enable sensor groups Adds support to enable/disable a sensor group at runtime. This can be used to select the sensor groups that needs to be copied to main memory by OCC. Sensor groups like power, temperature, current, voltage, frequency, utilization can be enabled/disabled at runtime. Signed-off-by: Shilpasri G Bhat Signed-off-by: Michael Ellerman commit 1961acad2f88559c2cdd2ef67c58c3627f1f6e54 Author: Akshay Adiga Date: Thu Jul 5 17:10:22 2018 +0530 powernv/cpuidle: Use parsed device tree values for cpuidle_init Export pnv_idle_states and nr_pnv_idle_states so that its accessible to cpuidle driver. Use properties from pnv_idle_states structure for powernv cpuidle_init. Signed-off-by: Akshay Adiga Reviewed-by: Nicholas Piggin Reviewed-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman commit 9c7b185ab2fe313b4426bf55da3624bef71f342b Author: Akshay Adiga Date: Thu Jul 5 17:10:21 2018 +0530 powernv/cpuidle: Parse dt idle properties into global structure Device-tree parsing happens twice, once while deciding idle state to be used for hotplug and once during cpuidle init. Hence, parsing the device tree and caching it will reduce code duplication. Parsing code has been moved to pnv_parse_cpuidle_dt() from pnv_probe_idle_states(). In addition to the properties in the device tree the number of available states is also required. Signed-off-by: Akshay Adiga Reviewed-by: Nicholas Piggin Reviewed-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman commit 6edc22fc9cbb80fdf929df3e5b912d8c42e0ff3a Author: Finn Thain Date: Mon Jul 2 04:21:19 2018 -0400 macintosh/via-pmu: Disambiguate interrupt statistics Some of the event counters are overloaded which makes it very difficult to interpret their values. Counter 0 is supposed to report CB1 interrupts but it can also count PMU_INT_WAITING_CHARGER events. Counter 1 is supposed to report GPIO interrupts but it can also count other events (depending upon the value of the PMU_INT_ADB bit). Disambiguate these statistics with dedicated counters for GPIO and CB1 interrupts. Comments in the MkLinux source code say that the type 0 and type 1 interrupts are model-specific. Label them as "unknown". This change to the contents of /proc/pmu/interrupts is by necessity visible in userland. However, packages which interact with the PMU (that is, pbbuttonsd, pmac-utils and pmud) don't open this file. AFAIK, user software has no need to poll these counters. Tested-by: Stan Johnson Signed-off-by: Finn Thain Signed-off-by: Michael Ellerman commit b5c7cccaacdfa8d707da3e65970b15070f56df5e Author: Finn Thain Date: Mon Jul 2 04:21:19 2018 -0400 macintosh/via-pmu: Clean up interrupt statistics Replace an open-coded ffs() with the function call. Simplify an if-else cascade using a switch statement. Correct a typo and an indentation issue. Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman commit ebd722275f9cfc6752e29d2412fa3816ca05764b Author: Finn Thain Date: Mon Jul 2 04:21:19 2018 -0400 macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver Now that the PowerMac via-pmu driver supports m68k PowerBooks, switch over to that driver and remove the via-pmu68k driver. Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman commit 54c990775f78113a708f24e15877f6b7bd9a1277 Author: Finn Thain Date: Mon Jul 2 04:21:19 2018 -0400 macintosh/via-pmu68k: Don't load driver on unsupported hardware Don't load the via-pmu68k driver on early PowerBooks. The M50753 PMU device found in those models was never supported by this driver. Attempting to load the driver usually causes a boot hang. Signed-off-by: Finn Thain Reviewed-by: Michael Schmitz Acked-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman commit c2f028b6a0b241d1b18d8d0ebcb13d21659dcfe7 Author: Finn Thain Date: Mon Jul 2 04:21:19 2018 -0400 macintosh/via-pmu: Explicitly specify CONFIG_PPC_PMAC dependencies At present, CONFIG_ADB_PMU depends on CONFIG_PPC_PMAC. When this gets relaxed to CONFIG_PPC_PMAC || CONFIG_MAC, those Kconfig symbols with implicit deps on PPC_PMAC will need explicit deps. Add them now. No functional change. Tested-by: Stan Johnson Signed-off-by: Finn Thain Signed-off-by: Michael Ellerman commit c16a85a5aad47d712860b42f0ca989b0cb62257a Author: Finn Thain Date: Mon Jul 2 04:21:19 2018 -0400 macintosh/via-pmu: Add support for m68k PowerBooks Put #ifdefs around the Open Firmware, xmon, interrupt dispatch, battery and suspend code. Add the necessary interrupt handling to support m68k PowerBooks. The pmu_kind value is available to userspace using the PMU_IOC_GET_MODEL ioctl. It is not clear yet what hardware classes are be needed to describe m68k PowerBook models, so pmu_kind is given the provisional value PMU_UNKNOWN. To find out about the hardware, user programs can use /proc/bootinfo or /proc/hardware, or send the PMU_GET_VERSION command using /dev/adb. Tested-by: Stan Johnson Signed-off-by: Finn Thain Signed-off-by: Michael Ellerman commit c70c35da52c064983199b1b1cbd4daa5a07ef60c Author: Finn Thain Date: Mon Jul 2 04:21:18 2018 -0400 macintosh/via-pmu: Replace via pointer with via1 and via2 pointers On most PowerPC Macs, the PMU driver uses the shift register and IO port B from a single VIA chip. On 68k and early PowerPC PowerBooks, the driver uses the shift register from one VIA chip together with IO port B from another. Replace via with via1 and via2 to accommodate this. For the CONFIG_PPC_PMAC case, set via1 = via2 so there is no change. Tested-by: Stan Johnson Signed-off-by: Finn Thain Signed-off-by: Michael Ellerman commit c57902d52e2d61299872ddc89645d3aa299f1b91 Author: Finn Thain Date: Mon Jul 2 04:21:18 2018 -0400 macintosh/via-pmu: Enhance state machine with new 'uninitialized' state On 68k Macs, the via/vias pointer can't be used to determine whether the PMU driver has been initialized. For portability, add a new state to indicate that via_find_pmu() succeeded. After via_find_pmu() executes, testing vias == NULL is equivalent to testing via == NULL. Replace these tests with pmu_state == uninitialized which is simpler and more consistent. No functional change. Tested-by: Stan Johnson Signed-off-by: Finn Thain Signed-off-by: Michael Ellerman commit 7ad94699a94b388780e40158e6954a22b68e9d20 Author: Finn Thain Date: Mon Jul 2 04:21:18 2018 -0400 macintosh/via-pmu: Don't clear shift register interrupt flag twice The shift register interrupt flag gets cleared in via_pmu_interrupt() and once again in pmu_sr_intr(). Fix this theoretical race condition. Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman commit 576d5290d678a651b9f36050fc1717e0573aca13 Author: Finn Thain Date: Mon Jul 2 04:21:18 2018 -0400 macintosh/via-pmu: Add missing mmio accessors Add missing in_8() accessors to init_pmu() and pmu_sr_intr(). This fixes several sparse warnings: drivers/macintosh/via-pmu.c:536:29: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:537:33: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:1455:17: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:1456:69: warning: dereference of noderef expression Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman commit 73f4447d43484224d7abfba0d9468de4982ef889 Author: Finn Thain Date: Mon Jul 2 04:21:18 2018 -0400 macintosh/via-pmu: Fix section mismatch warning The pmu_init() function has the __init qualifier, but the ops struct that holds a pointer to it does not. This causes a build warning. The driver works fine because the pointer is only dereferenced early. The function is so small that there's negligible benefit from using the __init qualifier. Remove it to fix the warning, consistent with the other ADB drivers. Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman commit e401b7c2c69008ad2fcdc154f7c5421281c90042 Author: Bhupesh Sharma Date: Mon Jul 30 11:54:43 2018 +0530 arm64, kaslr: export offset in VMCOREINFO ELF notes Include KASLR offset in arm64 VMCOREINFO ELF notes to assist in debugging. vmcore parsing in user-space already expects this value in the notes and we are providing it for portability of those existing tools with x86. Ideally we would like core code to do this (so that way this information won't be missed when an architecture adds KASLR support), but mips has CONFIG_RANDOMIZE_BASE, and doesn't provide kaslr_offset(), so I am not sure if this is needed for mips (and other such similar arch cases in future). So, lets keep this architecture specific for now. As an example of a user-space use-case, consider the makedumpfile user-space utility which will need fixup to use this KASLR offset to work with cases where we need to find a way to translate symbol address from vmlinux to kernel run time address in case of KASLR boot on arm64. I have already submitted the makedumpfile user-space patch upstream and the maintainer has suggested to wait for the kernel changes to be included (see [0]). I tested this on my qualcomm amberwing board both for KASLR and non-KASLR boot cases: Without this patch: # cat > scrub.conf << EOF [vmlinux] erase jiffies erase init_task.utime for tsk in init_task.tasks.next within task_struct:tasks erase tsk.utime endfor EOF # makedumpfile --split -d 31 -x vmlinux --config scrub.conf vmcore dumpfile_{1,2,3} readpage_elf: Attempt to read non-existent page at 0xffffa8a5bf180000. readmem: type_addr: 1, addr:ffffa8a5bf180000, size:8 vaddr_to_paddr_arm64: Can't read pgd readmem: Can't convert a virtual address(ffff0000092a542c) to physical address. readmem: type_addr: 0, addr:ffff0000092a542c, size:390 check_release: Can't get the address of system_utsname After this patch check_release() is ok, and also we are able to erase symbol from vmcore (I checked this with kernel 4.18.0-rc4+): # makedumpfile --split -d 31 -x vmlinux --config scrub.conf vmcore dumpfile_{1,2,3} The kernel version is not supported. The makedumpfile operation may be incomplete. Checking for memory holes : [100.0 %] \ Checking for memory holes : [100.0 %] | Checking foExcluding unnecessary pages : [100.0 %] \ Excluding unnecessary pages : [100.0 %] \ The dumpfiles are saved to dumpfile_1, dumpfile_2, and dumpfile_3. makedumpfile Completed. [0] https://www.spinics.net/lists/kexec/msg21195.html Cc: Ard Biesheuvel Cc: Will Deacon Cc: Mark Rutland Cc: Catalin Marinas Cc: James Morse Acked-by: James Morse Signed-off-by: Bhupesh Sharma Signed-off-by: Will Deacon commit 9d2dcc8fc66087d7fd365e07cd4292adc873e568 Author: Michael O'Farrell Date: Mon Jul 30 13:14:34 2018 -0700 arm64: perf: Add cap_user_time aarch64 It is useful to get the running time of a thread. Doing so in an efficient manner can be important for performance of user applications. Avoiding system calls in `clock_gettime` when handling CLOCK_THREAD_CPUTIME_ID is important. Other clocks are handled in the VDSO, but CLOCK_THREAD_CPUTIME_ID falls back on the system call. CLOCK_THREAD_CPUTIME_ID is not handled in the VDSO since it would have costs associated with maintaining updated user space accessible time offsets. These offsets have to be updated everytime the a thread is scheduled/descheduled. However, for programs regularly checking the running time of a thread, this is a performance improvement. This patch takes a middle ground, and adds support for cap_user_time an optional feature of the perf_event API. This way costs are only incurred when the perf_event api is enabled. This is done the same way as it is in x86. Ultimately this allows calculating the thread running time in userspace on aarch64 as follows (adapted from perf_event_open manpage): u32 seq, time_mult, time_shift; u64 running, count, time_offset, quot, rem, delta; struct perf_event_mmap_page *pc; pc = buf; // buf is the perf event mmaped page as documented in the API. if (pc->cap_usr_time) { do { seq = pc->lock; barrier(); running = pc->time_running; count = readCNTVCT_EL0(); // Read ARM hardware clock. time_offset = pc->time_offset; time_mult = pc->time_mult; time_shift = pc->time_shift; barrier(); } while (pc->lock != seq); quot = (count >> time_shift); rem = count & (((u64)1 << time_shift) - 1); delta = time_offset + quot * time_mult + ((rem * time_mult) >> time_shift); running += delta; // running now has the current nanosecond level thread time. } Summary of changes in the patch: For aarch64 systems, make arch_perf_update_userpage update the timing information stored in the perf_event page. Requiring the following calculations: - Calculate the appropriate time_mult, and time_shift factors to convert ticks to nano seconds for the current clock frequency. - Adjust the mult and shift factors to avoid shift factors of 32 bits. (possibly unnecessary) - The time_offset userspace should apply when doing calculations: negative the current sched time (now), because time_running and time_enabled fields of the perf_event page have just been updated. Toggle bits to appropriate values: - Enable cap_user_time Signed-off-by: Michael O'Farrell Signed-off-by: Will Deacon commit ce279d374ff315264efcbcef75cc21b9fef8b36f Author: Laura Abbott Date: Mon Jul 30 11:31:18 2018 -0700 efi/libstub: Only disable stackleak plugin for arm64 arm64 uses the full KBUILD_CFLAGS for building libstub as opposed to x86 which doesn't. This means that x86 doesn't pick up the gcc-plugins. We need to disable the stackleak plugin but doing this unconditionally breaks x86 build since it doesn't have any plugins. Switch to disabling the stackleak plugin for arm64 only. Reviewed-by: Kees Cook Signed-off-by: Laura Abbott Signed-off-by: Will Deacon commit d26de6c9f458f702b778731b7cb578ccd83623c9 Author: Ard Biesheuvel Date: Tue Jul 31 09:35:45 2018 +0200 arm64: drop unused kernel_neon_begin_partial() macro When kernel mode NEON was first introduced to the arm64 kernel, every call to kernel_neon_begin()/_end() stacked resp. unstacked the entire NEON register file, making it worthwile to reduce the number of used NEON registers to a bare minimum, and only stack those. kernel_neon_begin_partial() was introduced for this purpose, but after the refactoring for SVE and other changes, it no longer exists and was simply #define'd to kernel_neon_begin() directly. In the mean time, all users have been updated, so let's remove the fallback macro. Reviewed-by: Dave Martin Signed-off-by: Ard Biesheuvel Signed-off-by: Will Deacon commit 5223c671674c507cc9bcabdfc5a9b449c178330a Author: Hendrik Brueckner Date: Mon Jul 16 11:08:06 2018 +0200 s390/cpum_sf: save TOD clock base in SDBs for time conversion Processing the samples in the AUX-area by perf requires the computation of respective time stamps. The time stamps used by perf are based on the monotonic clock. To convert the TOD clock value contained in an SDB to a monotonic clock value, the TOD clock base is required. Hence, also save the TOD clock base in the SDB. Suggested-by: Thomas Richter Signed-off-by: Hendrik Brueckner Signed-off-by: Martin Schwidefsky commit 1bb38e8bb81e5c43bc1a2b44bc8e340783005f58 Author: Maya Erez Date: Tue Jul 24 10:44:40 2018 +0300 wil6210: fix eDMA RX chaining HW requires Rx buffers to be 4 bytes aligned. Modify the driver to meet this requirement. Enable OFU rdy valid bug fix, to prevent hang in oful34_rx while there is back-pressure from host during RX. Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit d554edcd972d46179bf10258379e80f609bb52e5 Author: Maya Erez Date: Tue Jul 24 10:44:39 2018 +0300 wil6210: prevent FW download if HW is configured for secured boot Currently the driver doesn't support secured boot flow, hence prevent FW download in case HW is configured for such a flow. Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit b698e2dfc24cd148ce32f622a20938037ebe06b7 Author: Ahmad Masri Date: Tue Jul 24 10:44:38 2018 +0300 wil6210: off channel transmit management frames in AP mode Currently wil6210 ignores the channel field in the cfg80211_mgmt_tx_params struct for wil_cfg80211_ops mgmt_tx operation and sends all management frames on the serving channel. Add support for off-channel transmission of management frames (WIPHY_FLAG_OFFCHAN_TX) in AP mode. This is useful in enterprise APs for sending custom probe request frames. Signed-off-by: Ahmad Masri Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 6a363e8aa3828621eb4bc5e506f35f6ca9016d57 Author: Ahmad Masri Date: Tue Jul 24 10:44:37 2018 +0300 wil6210: align to latest auto generated wmi.h Align to latest version of the auto generated wmi file describing the interface with FW. Signed-off-by: Ahmad Masri Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 7f10f8ba02207af13db0c33fa97e5904ec3ea39e Author: Alexei Avshalom Lazar Date: Tue Jul 24 10:44:36 2018 +0300 wil6210: set default 3-MSI Single MSI is the current default configuration. With multiple MSI interrupts configuration, Tx/Rx processing could run in parallel on different CPU cores and allow better balance between the cores. Signed-off-by: Alexei Avshalom Lazar Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 631d3b4f7eeb76ffb865ff7805b495b50ee623f8 Author: Maya Erez Date: Tue Jul 24 10:44:35 2018 +0300 wil6210: support Talyn specific board file FW file name for Talyn device can be different from the default name. In such a case use a corresponding board file name. If such a board file is not present FW download procedure will fail. Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 6ccae584014ef7074359eb4151086beef66ecfa9 Author: Hamad Kadmany Date: Tue Jul 24 10:44:34 2018 +0300 wil6210: increase firmware ready timeout Firmware ready event may take longer than current timeout in some scenarios, for example with multiple RFs connected where each requires an initial calibration. Increase the timeout to support these scenarios. Signed-off-by: Hamad Kadmany Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 1b99197dc00cbb34cb39be70ad5beb4a5a84be4b Author: Maya Erez Date: Tue Jul 24 10:44:33 2018 +0300 wil6210: support max aggregation window size 64 FW can support BACK window size 64 for performance improvements. A new FW capability is added for notifying the host on the increased max BACK win size support. Defining WIL_MAX_AGG_WSIZE_64 and WIL_MAX_AMPDU_SIZE_128 to be used in this case. Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit af2cd85e8dbd4241c21c0136d13e36b0043604ba Author: Ahmad Masri Date: Tue Jul 24 10:44:32 2018 +0300 wil6210: allow scan on AP interface Scan is allowed only on client interfaces (STA/P2P). Allow scan on AP interface so that the AP can discover rouge or unauthorized neighbor APs. Signed-off-by: Ahmad Masri Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 0c936b3c96337c3fd5ad4951ca7bdc54fa578a02 Author: Dedy Lansky Date: Tue Jul 24 10:44:31 2018 +0300 wil6210: add support for link statistics Driver can request FW to report link statistics using WMI_LINK_STATS_CMDID. FW will report statistics with WMI_LINK_STATS_EVENTID. Two categories of statistics defined: basic and global. New "link_stats" debugfs is used for requesting basic statistics report (write) and for reading the basic statistics (read). "link_stats_global" debugfs is used for requesting and reading the global statistics. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 65e6ffdcc4507cbdd38f374ae311263106ee46fe Author: Alexei Avshalom Lazar Date: Tue Jul 24 10:44:30 2018 +0300 wil6210: fix min() compilation errors With some tool chains compilation fails due to type mismatch of the arguments passed to min(). Use min_t() to solve these compilation errors. Signed-off-by: Alexei Avshalom Lazar Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit aea2f8b781b2a76fb0af4de2273d0c56c6d256a4 Author: Alexei Avshalom Lazar Date: Tue Jul 24 10:44:29 2018 +0300 wil6210: add 3-MSI support Extend MSI support to 3-MSI in order to load balance the tx\rx interrupts between different cores. use_msi module parameter has changed to n_msi. Usage: - Set n_msi to 0 for using INTx - Set n_msi to 1 for using single MSI - Set n_msi to 3 for using 3-MSI In 3-MSI configuration MSI 0 is used for TX interrupts, MSI 1 is used for RX interrupts and MSI 2 is used for MISC interrupts. Signed-off-by: Alexei Avshalom Lazar Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit b5aeff16b20f65e6bb9ebafd06c1c96c2b503089 Author: Dedy Lansky Date: Tue Jul 24 10:44:28 2018 +0300 wil6210: align to latest auto generated wmi.h Align to latest version of the auto generated wmi file describing the interface with FW. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 1c0dd5f5f3ad2af511b8e46392028e0f38f06aa1 Author: Maya Erez Date: Tue Jul 24 10:44:27 2018 +0300 wil6210: support Talyn specific FW file FW file name for Talyn device is different from the default name. This patch searches for Talyn specific FW file name and fallback to the default FW file in case it is not present. Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 0b8532102293b1abb70385232e88ea75d098c808 Author: Maya Erez Date: Tue Jul 24 10:44:26 2018 +0300 wil6210: fix RX checksum report to network stack Currently the driver sets CHECKSUM_UNNECESSARY only in case the HW doesn't report checksum error. As ip_summed value is not initialized it is not clear what the driver will report to the network stack in case of HW checksum error or in case HW doesn't calculate checksum. Initialize ip_summed to CHECKSUM_NONE to guarantee checksum calculation by the network stack in the above cases. Signed-off-by: Gidon Studinski Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 6d9eb7ebae3d7e951bc0999235ae7028eb4cae4f Author: Dedy Lansky Date: Tue Jul 24 10:44:25 2018 +0300 wil6210: fix temperature debugfs For negative temperatures, "temp" debugfs is showing wrong values. Use signed types so proper calculations is done for sub zero temperatures. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit a24a3d6abb978d4abc25d541e787981e7ef555c8 Author: Dedy Lansky Date: Tue Jul 24 10:44:24 2018 +0300 wil6210: add TX latency statistics Collect statistics of TX latency. The latency is measured from the time the HW gets aware of new SKB to transmit until the HW indicates tx complete for this SKB. The statistics are shown via new "tx_latency" debugfs. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit e15af41c05eda216a43b9e7a22c2399e0ad720ff Author: Dedy Lansky Date: Tue Jul 24 10:44:23 2018 +0300 wil6210: drop Rx packets with L2 error indication from HW Due to recent change in FW, driver will be notified of corrupted Rx packets (e.g. MIC error). Drop such packets before they are delivered to network stack. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 1bd82ee09aeae74c9f68e6f4147132a3e30e721e Author: Dedy Lansky Date: Tue Jul 24 10:44:22 2018 +0300 wil6210: Rx multicast packets duplicate detection Store the last received multicast sequence number (SN) part of the TID info. Drop Rx multicast packets with retry bit set which their SN is equal to the last received. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 52d7e0e5339b429171c032fbc03a45a47f6026a3 Author: Felix Fietkau Date: Mon Jul 30 21:31:30 2018 +0300 ath9k: fix more-data flag for buffered multicast packets The flag needs to be cleared for the last packet in the list, not the first one. Fixes some issues with multicast packet loss for powersave clients connected to an ath9k AP. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 461d8a6bb9879b0e619752d040292e67aa06f1d2 Author: Felix Fietkau Date: Mon Jul 30 21:31:28 2018 +0300 ath9k_hw: fix channel maximum power level test The tx power applied by set_txpower is limited by the CTL (conformance test limit) entries in the EEPROM. These can change based on the user configured regulatory domain. Depending on the EEPROM data this can cause the tx power to become too limited, if the original regdomain CTLs impose lower limits than the CTLs of the user configured regdomain. To fix this issue, set the initial channel limits without any CTL restrictions and only apply the CTL at run time when setting the channel and the real tx power. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 1226f9e1029637ebdab6bd80928213b8c1ad965c Author: Felix Fietkau Date: Mon Jul 30 21:31:26 2018 +0300 ath9k: fix block-ack window tracking issues Ensure that a buffer gets tracked as part of the block-ack window as soon as it's dequeued from the tid for the first time. Ensure that double calls to ath_tx_addto_baw (e.g. on retransmission) don't cause any issues. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 36e14a787dd0b459760de3622e9709edb745a6af Author: Felix Fietkau Date: Mon Jul 30 21:31:23 2018 +0300 ath9k: report tx status on EOSP Fixes missed indications of end of U-APSD service period to mac80211 Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit e20c7c91ef60cb3a3534f73d14007ec0728d1620 Author: Felix Fietkau Date: Mon Jul 30 21:31:21 2018 +0300 ath9k: clear potentially stale EOSP status bit in intermediate queues Prevents spurious ieee80211_sta_eosp calls. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 11f7f4f9c0d28a0742b238fdb851eb3698ad6d9a Author: Felix Fietkau Date: Mon Jul 30 21:31:19 2018 +0300 ath9k: fix moredata bit in PS buffered frame release Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 3a69dd366866b066b329f6074189a1a6eb056b93 Author: Felix Fietkau Date: Mon Jul 30 21:31:17 2018 +0300 ath9k: don't run periodic and nf calibation at the same time The checks already prevents periodic cal from being started while noise floor calibration runs. It is missing checks for the other way around. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit a2a49e86b325fa2e44b0b7407f07e6eab6cc3edd Author: Felix Fietkau Date: Mon Jul 30 21:31:15 2018 +0300 ath9k_hw: set spectral scan enable bit on trigger for AR9003+ AR9002 code and the QCA AR9003+ reference code do the same. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit bfc55fe65987743e534808a18217ccd5783e00bb Author: Jia-Ju Bai Date: Fri Jul 27 16:43:18 2018 +0800 ath6kl: replace GFP_ATOMIC with GFP_KERNEL in ath6kl_bmi_init() ath6kl_bmi_init() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Kalle Valo commit 3f259111583801013cb605bb4414aa529adccf1c Author: Sven Eckelmann Date: Thu Jul 26 15:59:48 2018 +0200 ath10k: prevent active scans on potential unusable channels The QCA4019 hw1.0 firmware 10.4-3.2.1-00050 and 10.4-3.5.3-00053 (and most likely all other) seem to ignore the WMI_CHAN_FLAG_DFS flag during the scan. This results in transmission (probe requests) on channels which are not "available" for transmissions. Since the firmware is closed source and nothing can be done from our side to fix the problem in it, the driver has to work around this problem. The WMI_CHAN_FLAG_PASSIVE seems to be interpreted by the firmware to not scan actively on a channel unless an AP was detected on it. Simple probe requests will then be transmitted by the STA on the channel. ath10k must therefore also use this flag when it queues a radar channel for scanning. This should reduce the chance of an active scan when the channel might be "unusable" for transmissions. Fixes: e8a50f8ba44b ("ath10k: introduce DFS implementation") Signed-off-by: Sven Eckelmann Signed-off-by: Kalle Valo commit 2023f1fa216f30b1877d65be2057fbaf0bbd49b3 Author: Miquel Raynal Date: Wed Jul 25 15:31:51 2018 +0200 mtd: rawnand: allocate model parameter dynamically Thanks to the migration of all drivers to use nand_scan() and the related nand_controller_ops, we can now allocate data during the detection phase. Let's do it first for the NAND model parameter which is allocated in nand_detect(). Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 98732da1a08ebb666983d469981a8b994e77d556 Author: Miquel Raynal Date: Wed Jul 25 15:31:50 2018 +0200 mtd: rawnand: do not export nand_scan_[ident|tail]() anymore Both nand_scan_ident() and nand_scan_tail() helpers used to be called directly from controller drivers that needed to tweak some ECC-related parameters before nand_scan_tail(). This separation prevented dynamic allocations during the phase of NAND identification, which was inconvenient. All controller drivers have been moved to use nand_scan(), in conjunction with the chip->ecc.[attach|detach]_chip() hooks that actually do the required tweaking sequence between both ident/tail calls, allowing programmers to use dynamic allocation as they need all across the scanning sequence. Declare nand_scan_[ident|tail]() statically now. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit ee1af8296dbc34c8198cbdd54cc244c19a10321e Author: Miquel Raynal Date: Wed Jul 25 15:31:49 2018 +0200 mtd: rawnand: txx9ndfmc: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit abe23d1c5cdf888639313bf87880d2692d0b8724 Author: Miquel Raynal Date: Wed Jul 25 15:31:48 2018 +0200 mtd: rawnand: txx9ndfmc: clarify ECC parameters assignation A comment in the probe declares that values are assigned to ecc.size and ecc.bytes, but these values will be overwritten. This is not entirely right as they are overwritten only if mtd->writesize >= 512. Let's clarify this by moving these assignations to txx9ndfmc_nand_scan(). Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 176fc2f28ee5ebd494c39d25dda3e0a71e0b649a Author: Miquel Raynal Date: Wed Jul 25 15:31:47 2018 +0200 mtd: rawnand: tegra: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit ccadc14975c9bbd17da3a4b0b443325a5bda0ba2 Author: Miquel Raynal Date: Wed Jul 25 15:31:46 2018 +0200 mtd: rawnand: jz4740: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 2f2173449b0350a206faf0d1aa71595602a40c98 Author: Miquel Raynal Date: Wed Jul 25 15:31:45 2018 +0200 mtd: rawnand: jz4740: group nand_scan_{ident, tail} calls Prepare the migration to nand_scan() by moving both calls to nand_scan_ident() and nand_scan_tail() in a single spot. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit f57bbfb9e3f47b6d4eecb1d8037dab1cda9996a4 Author: Miquel Raynal Date: Wed Jul 25 15:31:44 2018 +0200 mtd: rawnand: jz4740: fix probe function error path An error after nand_scan_tail() should trigger a nand_cleanup(), not a nand_release() as mtd_device_register() (or one of its variants) has not been called and there is no need to deregister any MTD device yet. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 66a38478dcc5b5a35e49055f2eb301f8ac594e3f Author: Miquel Raynal Date: Wed Jul 25 15:31:43 2018 +0200 mtd: rawnand: docg4: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 49aa76b166765188af6682cd22985cbda1bb39c2 Author: Miquel Raynal Date: Wed Jul 25 15:31:42 2018 +0200 mtd: rawnand: do not execute nand_scan_ident() if maxchips is zero Some driver (eg. docg4) will need to handle themselves the identification phase. As part of the migration to use nand_scan() everywhere (which will unconditionnaly call nand_scan_ident()), we add a condition at the start of nand_scan_with_ids() to jump over nand_scan_ident() if the maxchips parameters is zero, meaning that the driver does not want the core to handle this phase. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 577e010c24bceb80dbbc146b2a4bd7ff0527fa9b Author: Miquel Raynal Date: Wed Jul 25 15:31:41 2018 +0200 mtd: rawnand: atmel: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 7928225ffcb3d01c424983af30aba3c16ab5a585 Author: Miquel Raynal Date: Wed Jul 25 15:31:40 2018 +0200 mtd: rawnand: atmel: clarify NAND addition/removal paths No need for an atmel_nand_register() function, let's move the code in it directly where the function was called: in atmel_nand_controller_add_nand(). To make things consistent, also rename atmel_nand_unregister() into atmel_nand_controller_remove_nand(). Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit e1e6255c311bae4f89bf627fe54ced88bb5caa7e Author: Miquel Raynal Date: Wed Jul 25 15:31:39 2018 +0200 mtd: rawnand: omap2: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit c49f3bee8cb5435ad5832930829f913a391a8a58 Author: Miquel Raynal Date: Wed Jul 25 15:31:38 2018 +0200 mtd: rawnand: lpc32xx_mlc: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 73a27db8658125faadb857f1919559de8a5f71b0 Author: Miquel Raynal Date: Wed Jul 25 15:31:37 2018 +0200 mtd: rawnand: cafe: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 4918b905736fddc67f14618d5c82f7edc5944db8 Author: Miquel Raynal Date: Wed Jul 25 15:31:36 2018 +0200 mtd: rawnand: brcmnand: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 16909c81c6298c2db5587340106523e0a6c2bfe2 Author: Anders Roxell Date: Wed Jul 25 11:19:28 2018 +0200 drivers/memory/Kconfig: Add CONFIG_OF dependency JZ4780_NEMC doesn't depend on OF, and if OF isn't enabled we get this error: drivers/memory/jz4780-nemc.c: In function ‘jz4780_nemc_num_banks’: drivers/memory/jz4780-nemc.c:72:10: error: implicit declaration of function ‘of_read_number’; did you mean ‘down_read_nested’? [-Werror=implicit-function-declaration] bank = of_read_number(prop, 1); ^~~~~~~~~~~~~~ down_read_nested Make JZ4780_NEMC depend on OF. Fixes: ab99e11062c1 ("memory: jz4780-nemc: Allow selection of this driver when COMPILE_TEST=y") Reported-by: Randy Dunlap Signed-off-by: Anders Roxell Acked-by: Randy Dunlap Signed-off-by: Miquel Raynal commit 15280e8107e17a5ee40509e3d1384ad28d6fdcf4 Author: Arnd Bergmann Date: Wed Jul 25 11:18:34 2018 +0200 sparc64: add reads{b,w,l}/writes{b,w,l} Some drivers need these for compile-testing. On most architectures they come from asm-generic/io.h, but not on sparc64, which has its own definitions. Since we already have ioread*_rep()/iowrite*_rep() that have the same behavior on sparc64 (i.e. all PCI I/O space is memory mapped), we can rename the existing helpers and add macros to define them to the same implementation. Signed-off-by: Arnd Bergmann Acked-by: David S. Miller Tested-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 0bbf47eab4697557718fccc1ec9835c44c47fe7f Author: Arnd Bergmann Date: Wed Jul 25 11:17:20 2018 +0200 ia64: use asm-generic/io.h asm-generic/io.h provides a generic implementation of all I/O accessors, which the architectures can override. Since ia64 does not provide readsl/writesl etc, any driver using those fails to build, and including asm-generic/io.h will provide the missing interfaces, as well as any other future interfaces that get added there. We need to #define a couple of symbols to themselves in the ia64 to ensure that we use the ia64 specific version of those rather than the generic one. There should be no other effect than adding {read,write}s{b,w,l}() as well as {in,out}s{b,w,l}_p(), which were also not provided by ia64 but are provided by the generic header for historic reasons. Signed-off-by: Arnd Bergmann Tested-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 6a3cec64f18c118c776ee3185f026814e3fe45d4 Author: Miquel Raynal Date: Fri Jul 20 17:15:22 2018 +0200 mtd: rawnand: qcom: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit fe13ae02b07a1d14f47b0cbd63bc624b5f3cb890 Author: Miquel Raynal Date: Fri Jul 27 01:18:05 2018 +0200 mtd: rawnand: sm_common: convert driver to nand_scan_with_ids() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan_with_ids() (alternative to nand_scan() for passing a flash IDs table) instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 92aa292d2e47be6210c0ba6074fc0ddfc02f7856 Author: Miquel Raynal Date: Sun Feb 25 23:09:14 2018 +0100 mtd: rawnand: sm_common: fix the probe function error path nand_cleanup() should be called upon error after a successful nand_scan_tail(). Rework the error path to follow this rule . Signed-off-by: Miquel Raynal commit 962c35ef1e68346ae9c9691e14670f0ee96dcdbd Author: Miquel Raynal Date: Fri Jul 20 17:15:17 2018 +0200 mtd: rawnand: vf610: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Reviewed-by: Stefan Agner commit a001058a9aa291ee85ba5454891aa947658ae694 Author: Miquel Raynal Date: Fri Jul 20 17:15:15 2018 +0200 mtd: rawnand: txx9ndfmc: rename nand controller internal structure As already done in the core, calling a struct nand_controller 'hw_control' is misleading. Use the same name as in nand_base.c: 'controller'. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 6a9035ceb980ac7ded378fa83f73d9664128777c Author: Miquel Raynal Date: Fri Jul 20 17:15:14 2018 +0200 mtd: rawnand: tango: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 2a4d9c16e8d10ecee4422f90f6a47acf737e3447 Author: Miquel Raynal Date: Fri Jul 20 17:15:13 2018 +0200 mtd: rawnand: sunxi: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 5f20da0fe8af638266a5e8449ab5ebfe6112c2c0 Author: Miquel Raynal Date: Fri Jul 20 17:15:11 2018 +0200 mtd: rawnand: sh_flctl: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 127483187a4afc143d59cb2809ccdb9399f7d27e Author: Miquel Raynal Date: Fri Jul 20 17:15:10 2018 +0200 mtd: rawnand: s3c2410: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 5cbad9e3da60db9b3e5cf7e5b6a609578cbf93e0 Author: Miquel Raynal Date: Fri Jul 20 17:15:08 2018 +0200 mtd: rawnand: nandsim: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 96fa8e6e2619c0fe5b5935404d6cc18bae92c7ae Author: Miquel Raynal Date: Fri Jul 20 17:15:07 2018 +0200 mtd: rawnand: mxc: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 1ce7826d7f178ab683d40d280ca079cf281aecff Author: Miquel Raynal Date: Fri Jul 20 17:15:06 2018 +0200 mtd: rawnand: mtk: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Acked-by: Xiaolei Li commit 8831e48bad1425d237219dedde547f6061081807 Author: Miquel Raynal Date: Fri Jul 20 17:15:05 2018 +0200 mtd: rawnand: marvell: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit f4a48d7bf89e073fb76a1ef18935d36169a3b6b1 Author: Miquel Raynal Date: Fri Jul 20 17:15:04 2018 +0200 mtd: rawnand: lpc32xx_slc: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit eef2b13a33141aa49e17831937acd744cc049844 Author: Miquel Raynal Date: Fri Jul 20 17:15:02 2018 +0200 mtd: rawnand: jz4780: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Acked-by: Harvey Hunt Reviewed-by: Boris Brezillon commit 07c1a4b3d8231910424bffabff5c0d51c80e2f6b Author: Miquel Raynal Date: Fri Jul 20 17:15:01 2018 +0200 mtd: rawnand: hisi504: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 5f8374d9b8b564e3be3309205d4d02d285c8d64a Author: Miquel Raynal Date: Fri Jul 20 17:15:00 2018 +0200 mtd: rawnand: gpmi: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 3bbddfa3d292c5d228049ab09a94076286d9e906 Author: Miquel Raynal Date: Fri Jul 20 17:14:59 2018 +0200 mtd: rawnand: fsmc: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 37b0375d7398468b61c5e472e2634a4173f36627 Author: Miquel Raynal Date: Fri Jul 20 17:14:58 2018 +0200 mtd: rawnand: fsl_ifc: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 5bf3e76b0abf6f527ae2223a308b7decebcdd23e Author: Miquel Raynal Date: Wed Jul 25 10:37:40 2018 +0200 mtd: rawnand: fsl_elbc: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Notes: "pw 947037" commit 99dc9d95ec5a20dddb9f4462d576c63bfc06d8ad Author: Miquel Raynal Date: Wed Jul 25 10:35:57 2018 +0200 mtd: rawnand: fsl_elbc: return meaningful values Return -ENOTSUPP instead of -1 from ->chip_init_tail() before migrating this driver to use nand_scan() and transform this function to be a callback run by the core. Signed-off-by: Miquel Raynal commit d03af162bb09cdd321e422e375c2715f705c094b Author: Miquel Raynal Date: Fri Jul 20 17:14:56 2018 +0200 mtd: rawnand: denali: convert to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Acked-by: Masahiro Yamada commit b2342c1c80cebee38a2c219437f9382c2a2a1b5d Author: Miquel Raynal Date: Fri Jul 20 17:14:55 2018 +0200 mtd: rawnand: davinci: convert driver to nand_scan() Two helpers have been added to the core to do all kind of controller side configuration/initialization between the detection phase and the final NAND scan. Implement these hooks so that we can convert the driver to just use nand_scan() instead of the nand_scan_ident() + nand_scan_tail() pair. Also change the unused "struct device *dev" parameter of the driver structure into a platform device to reuse it in the ->attach_chip() hook. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit c1070db3839fb12513d0717e1e03d04eda1e2d93 Author: Boris Brezillon Date: Fri Jul 20 11:57:40 2018 +0200 mtd: rawnand: au1550nd: Remove unneeded gpio.h inclusion We don't use the GPIO API in this driver, let's just remove the inclusion. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 89956d118e5a95afc00f51c8f2757a453d8848b9 Author: Boris Brezillon Date: Fri Jul 20 11:57:39 2018 +0200 mtd: rawnand: atmel: Stop including gpio.h gpio/consumer.h defines everything we need, and it's clearly stated in gpio.h that GPIO consumers should directly stop including gpio.h if they can. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 49919d9c9e960c95712288ff08b96d4980464a5a Author: Boris Brezillon Date: Fri Jul 20 11:57:38 2018 +0200 mtd: rawnand: sunxi: Remove gpio.h and of_gpio.h inclusions Commit ddd5ed3a90e7 ("mtd: rawnand: sunxi: Remove support for GPIO-based Ready/Busy polling") removed GPIO-based RB polling. We no longer need to include gpio headers. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit d05a9524d7ec513648ad5e0fbd944e6ff3ddbd84 Author: Boris Brezillon Date: Fri Jul 20 00:38:13 2018 +0200 mtd: rawnand: jz4740: Include gpio/consumer.h instead of gpio.h GPIO consumers should no longer include , and instead include . Also, explicitly include since it seems to be missing after switching to . This fixes a build error when selecting the driver without selecting GPIOLIB, which can happen when COMPILE_TEST=y. Fixes: 6968e07e8169 ("mtd: rawnand: jz4740: Allow selection of this driver when COMPILE_TEST=y") Reported-by: Miquel Raynal Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 05b54c7bac906c443fd0b23ab8954e0560b33e5c Author: Miquel Raynal Date: Thu Jul 19 01:05:46 2018 +0200 mtd: rawnand: add hooks that may be called during nand_scan() In order to remove the limitation that forbids dynamic allocation in nand_scan_ident(), we must create a path that will be the same for all controller drivers. The idea is to use nand_scan() instead of the widely used nand_scan_ident()/nand_scan_tail() couple. In order to achieve this, controller drivers will need to adjust some parameters between these two functions depending on the NAND chip wired on them. This takes the form of two new hooks (->{attach,detach}_chip()) that are placed in a new nand_controller_ops structure, which is then attached to the nand_controller object at driver initialization time. ->attach_chip() is called between nand_scan_ident() and nand_scan_tail(), and ->detach_chip() is called in the error path of nand_scan() and in nand_cleanup(). Note that some NAND controller drivers don't have a dedicated nand_controller object and instead rely on the default/dummy one embedded in nand_chip. If you're in this case and still want to initialize the controller ops, you'll have to manipulate chip->dummy_controller directly. Last but not least, it's worth mentioning that we plan to move some of the controller related hooks placed in nand_chip into nand_controller_ops to make the separation between NAND chip and NAND controller methods clearer. Signed-off-by: Miquel Raynal Acked-by: Boris Brezillon commit 7da45139d264f3b7ead04e00ebb29b189cf9826e Author: Miquel Raynal Date: Tue Jul 17 09:08:02 2018 +0200 mtd: rawnand: better name for the controller structure In the raw NAND core, a NAND chip is described by a nand_chip structure, while a NAND controller is described with a nand_hw_control structure which is not very meaningful. Rename this structure nand_controller. As the structure gets renamed, it is logical to also rename the core function initializing it from nand_hw_control_init() to nand_controller_init(). Lastly, the 'hwcontrol' entry of the nand_chip structure is not meaningful neither while it has the role of fallback when no controller structure is provided by the driver (the controller driver is dumb and can only control a single chip). Thus, it is renamed dummy_controller. Signed-off-by: Miquel Raynal Acked-by: Boris Brezillon commit 110ab1582670392c1d8b805e701f5b7b7efcb120 Author: Boris Brezillon Date: Thu Jul 19 22:47:38 2018 +0200 mtd: rawnand: Remove unused caller_is_module() definition Commit 260e89a6e0d6 ("mtd: core: tone down suggestion that dev.parent should be set") removed the only user of caller_is_module() but forgot to remove the definition itself. Let's remove it now. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit bdc4e58d5395fb45e22a54e01312f1abb22523ef Author: Boris Brezillon Date: Thu Jul 19 22:53:50 2018 +0200 mtd: rawnand: s3c2410: Error out when ->nrsets < 0 or ->sets == NULL All of the code in the probe path assumes ->sets != NULL and ->nrsets > 0. Error out if that's not the case to avoid dereferencing a NULL pointer. Reported-by: Dan Carpenter Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 760c435e0f85ed19e48a90d746ce1de2cd02def7 Author: Miquel Raynal Date: Thu Jul 19 00:09:12 2018 +0200 mtd: rawnand: make subop helpers return unsigned values A report from Colin Ian King pointed a CoverityScan issue where error values on these helpers where not checked in the drivers. These helpers can error out only in case of a software bug in driver code, not because of a runtime/hardware error. Hence, let's WARN_ON() in this case and return 0 which is harmless anyway. Fixes: 8878b126df76 ("mtd: nand: add ->exec_op() implementation") Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit d166541e9031daff120cac212f1917eff93c07d3 Author: Boris Brezillon Date: Wed Jul 18 10:56:51 2018 +0200 mtd: rawnand: orion: Handle cases where __LINUX_ARM_ARCH__ is not defined Make sure __LINUX_ARM_ARCH__ is defined before testing its value. This is needed if we want to allow selection of this driver when COMPILE_TEST=y. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit c81d28ad4fe8899f3a17b204eeec6d37d698dd5b Author: Boris Brezillon Date: Wed Jul 18 10:56:50 2018 +0200 mtd: rawnand: orion: Avoid direct inclusion of asm headers Include linux/sizes.h instead of asm/sizes.h to make code completely arch independent. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit ebfac1d0c1663a47f6a0912930b9b8db4306e38b Author: Kalle Valo Date: Mon Jul 30 21:56:43 2018 +0300 ath10k: fix parenthesis alignment These were recently introduced and found by checkpatch: drivers/net/wireless/ath/ath10k/mac.c:6118: Alignment should match open parenthesis drivers/net/wireless/ath/ath10k/mac.c:6121: Alignment should match open parenthesis drivers/net/wireless/ath/ath10k/mac.c:6124: Alignment should match open parenthesis Signed-off-by: Kalle Valo commit 194db0d95802fb48d03034fb6bfead1235de3450 Author: Andrey Ignatov Date: Mon Jul 30 17:42:31 2018 -0700 selftests/bpf: Test for get_socket_cookie Add test to use get_socket_cookie() from BPF programs of types BPF_PROG_TYPE_SOCK_OPS and BPF_PROG_TYPE_CGROUP_SOCK_ADDR. The test attaches two programs to cgroup, runs TCP server and client in the cgroup and checks that two operations are done properly on client socket when user calls connect(2): 1. In BPF_CGROUP_INET6_CONNECT socket cookie is used as the key to write new value in a map for client socket. 2. In BPF_CGROUP_SOCK_OPS (BPF_SOCK_OPS_TCP_CONNECT_CB callback) the value written in "1." is found by socket cookie, since it's the same socket, and updated. Finally the test verifies the value in the map. Signed-off-by: Andrey Ignatov Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 0289a2cca0a5b75a0167243429d9163ec3fdf279 Author: Andrey Ignatov Date: Mon Jul 30 17:42:30 2018 -0700 selftests/bpf: Add bpf_get_socket_cookie to bpf_helpers.h Add missing helper to bpf_helpers.h that is used in tests and samples. Signed-off-by: Andrey Ignatov Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit a40b712e4c4d09f6fa234872384da9705443d4e9 Author: Andrey Ignatov Date: Mon Jul 30 17:42:29 2018 -0700 bpf: Sync bpf.h to tools/ Sync bpf_get_socket_cookie() related bpf UAPI changes to tools/. Signed-off-by: Andrey Ignatov Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit d692f1138a4bac2efd2c8656ca15556b63479e82 Author: Andrey Ignatov Date: Mon Jul 30 17:42:28 2018 -0700 bpf: Support bpf_get_socket_cookie in more prog types bpf_get_socket_cookie() helper can be used to identify skb that correspond to the same socket. Though socket cookie can be useful in many other use-cases where socket is available in program context. Specifically BPF_PROG_TYPE_CGROUP_SOCK_ADDR and BPF_PROG_TYPE_SOCK_OPS programs can benefit from it so that one of them can augment a value in a map prepared earlier by other program for the same socket. The patch adds support to call bpf_get_socket_cookie() from BPF_PROG_TYPE_CGROUP_SOCK_ADDR and BPF_PROG_TYPE_SOCK_OPS. It doesn't introduce new helpers. Instead it reuses same helper name bpf_get_socket_cookie() but adds support to this helper to accept `struct bpf_sock_addr` and `struct bpf_sock_ops`. Documentation in bpf.h is changed in a way that should not break automatic generation of markdown. Signed-off-by: Andrey Ignatov Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 240b74fde35293f718c6cdfa486b3a005c4243c9 Author: Jakub Kicinski Date: Mon Jul 30 20:33:15 2018 -0700 nfp: fix variable dereferenced before check in nfp_app_ctrl_rx_raw() 'app' is dereferenced before used for the devlink trace point. In case FW is buggy and sends a control message to a VF queue we should make sure app is not NULL. Reported-by: Dan Carpenter Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: Daniel Borkmann commit 24ebfcbdd1ba623daa1ba140067d7b6102bcfe0d Author: YueHaibing Date: Fri Jul 27 21:05:49 2018 +0800 rt2x00: remove redundant functions rt2x00mac_sta_{add/remove} Only rt2800 subdriver of rt2x00 implement sta_add() and sta_remove(), rt2x00mac_sta_add and rt2x00mac_sta_remove has no callers after commit 9c87758cf089 ("rt2x00: call sta_add/remove directly in rt2800"). So can be removed. Signed-off-by: YueHaibing Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 622e938240db71365958824cc91af1bb5c481f5e Author: Jia-Ju Bai Date: Fri Jul 27 16:50:45 2018 +0800 rtl818x: Replace mdelay() with msleep() in rtl8225se_rf_init rtl8225se_rf_init() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This patch only replaces the mdelay() that has >20ms time to wait. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Kalle Valo commit 1f821611f49a89d2258d256efedd618eda6344be Author: Taehee Yoo Date: Mon Jul 30 22:22:59 2018 +0900 lwt_bpf: remove unnecessary rcu_read_lock in run_lwt_bpf run_lwt_bpf is called by bpf_{input/output/xmit}. These functions are already protected by rcu_read_lock. because lwtunnel_{input/output/xmit} holds rcu_read_lock and then calls bpf_{input/output/xmit}. So that rcu_read_lock in the run_lwt_bpf is unnecessary. Signed-off-by: Taehee Yoo Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 5685bee313e9e8577faebcb349706e299f486db5 Author: Jia-Ju Bai Date: Fri Jul 27 16:45:35 2018 +0800 atmel: Replace mdelay() with msleep() in probe_atmel_card() probe_atmel_card() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Kalle Valo commit 37a634f60fd6dfbda2c312657eec7ef0750546e7 Author: Loic Poulain Date: Fri Jul 27 18:30:23 2018 +0200 wlcore: Set rx_status boottime_ns field on rx When receiving a beacon or probe response, we should update the boottime_ns field which is the timestamp the frame was received at. (cf mac80211.h) This fixes a scanning issue with Android since it relies on this timestamp to determine when the AP has been seen for the last time (via the nl80211 BSS_LAST_SEEN_BOOTTIME parameter). Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo commit 18dc5a4bbcc5c44be3062712f74180bae2c3c6b8 Author: H. Nikolaus Schaller Date: Wed Jul 25 07:55:04 2018 +0200 wlcore: remove duplicate \n for some warnings wl1271_warning() already appends a \n to the format, so adding one to the warning string gives empty lines in the log. Signed-off-by: H. Nikolaus Schaller Signed-off-by: Kalle Valo commit 486cdf21583e5b1fad488a3e4f0a5242a31c0ffa Author: Mathieu Xhonneux Date: Thu Jul 26 02:10:40 2018 +0000 bpf: add End.DT6 action to bpf_lwt_seg6_action helper The seg6local LWT provides the End.DT6 action, which allows to decapsulate an outer IPv6 header containing a Segment Routing Header (SRH), full specification is available here: https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-05 This patch adds this action now to the seg6local BPF interface. Since it is not mandatory that the inner IPv6 header also contains a SRH, seg6_bpf_srh_state has been extended with a pointer to a possible SRH of the outermost IPv6 header. This helps assessing if the validation must be triggered or not, and avoids some calls to ipv6_find_hdr. v3: s/1/true, s/0/false for boolean values v2: - changed true/false -> 1/0 - preempt_enable no longer called in first conditional block Signed-off-by: Mathieu Xhonneux Signed-off-by: Daniel Borkmann commit 1e591c56a65fbbcd5754a4210a0ef0402d5e5f33 Author: Rafał Miłecki Date: Mon Jul 9 06:55:43 2018 +0200 brcmfmac: specify some features per firmware version Some features supported by firmware aren't advertised and there is no way for a driver to query them. This includes e.g. monitor mode details. Most firmwares support monitor interface but only the latest ones /announce/ it with a "monitor" flag in the "cap" iovar. There isn't any reliable detection method for older firmwares (BRCMF_C_MONITOR was tried but "it only indicates the core part of the stack supports"). Similarly support for tagging monitor frames and building radiotap headers can't be reliably detected for all firmwares. This commit adds table that allows mapping features to firmware version. It adds mappings for 43602a1 and 4366b1 firmwares from linux-firmware.git. Both were confirmed to be passing monitor frames. Signed-off-by: Rafał Miłecki Reviewed-by: Arend van Spriel Signed-off-by: Kalle Valo commit 6ade689711eeedb7070944b0764024c936730c9f Author: YueHaibing Date: Fri Jul 13 15:03:17 2018 +0800 hostap: hide unused procfs helpers When CONFIG_PROC_FS isn't set, gcc warning this: drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function] static int prism2_registers_proc_show(struct seq_file *m, void *v) drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function] static int prism2_debug_proc_show(struct seq_file *m, void *v) ^ drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function] static int prism2_stats_proc_show(struct seq_file *m, void *v) ^ drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function] static int prism2_crypt_proc_show(struct seq_file *m, void *v) ^ fix this by adding #ifdef around them. hfa384x_read_reg is only used by prism2_registers_proc_show,so move it into #ifdef. Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit 8b8f3278d241658a7dcb95cefc9793ac85a43c3a Author: YueHaibing Date: Fri Jul 13 14:46:58 2018 +0800 atmel: hide unused procfs helpers When CONFIG_PROC_FS isn't set, gcc warning this: drivers/net/wireless/atmel/atmel.c:1402:12: warning: ‘atmel_proc_show’ defined but not used [-Wunused-function] static int atmel_proc_show(struct seq_file *m, void *v) ^ fix this by adding #ifdef around it. Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit f21bcefcf91cc4549966e67debd082a2cb14bf73 Author: Colin Ian King Date: Fri Jul 20 19:07:40 2018 +0100 ray_cs: remove redundant pointer 'p' Pointer 'p' is being assigned but is never used hence it is redundant and can be removed. Also re-work if statement to remove redundant assignment of p. Cleans up clang warning: warning: variable 'p' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit 454127ad36fb11ee212f487b2640dd82373f3b0c Author: Colin Ian King Date: Wed Jul 11 08:42:53 2018 +0100 iwlegacy: remove several redundant variables Variables id, unicast, write, conf, a_band, accum_tx and ucode are assigned a value but it is never read, hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'id' set but not used [-Wunused-but-set-variable] warning: variable 'unicast' set but not used [-Wunused-but-set-variable] warning: variable 'write' set but not used [-Wunused-but-set-variable] warning: variable 'conf' set but not used [-Wunused-but-set-variable] warning: variable 'a_band' set but not used [-Wunused-but-set-variable] warning: variable 'tx' set but not used [-Wunused-but-set-variable] warning: variable 'accum_tx' set but not used [-Wunused-but-set-variable] warning: variable 'ucode' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo commit 0e139e97f58e8f844fecd77461aaad128f43b734 Author: Colin Ian King Date: Wed Jul 11 08:12:12 2018 +0100 ipw2x00: remove redundant variables len, ret, reason and crypt Variables len, ret, reason and crypt are assigned values that are never read, hence they are redundant and can be removed. Note: For the variable ret, a return code is being assigned, but this is not returned and 0 is currently being returned, I believe this is OK. Cleans up clang warnings: warning: variable 'len' set but not used [-Wunused-but-set-variable] variable 'ret' set but not used [-Wunused-but-set-variable] warning: variable 'reason' set but not used [-Wunused-but-set-variable] warning: variable 'crypt' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit d01a4e04dab7fa1002722e5d09cfd9c037767348 Author: Colin Ian King Date: Mon Jul 9 14:38:43 2018 +0100 airo: remove unused variables len and dev and clean up formatting Variables len and dev assigned values but are never used hence they are redundant and can be removed. Also add in white space in for-loop and remove some { } braces on if statement. Cleans up clang warnings: warning: variable 'len' set but not used [-Wunused-but-set-variable] warning: variable 'dev' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit 2ddd82eef2ef900dd1505888348ef90ef51481a1 Author: Amol Hanwate Date: Mon Jul 16 19:09:37 2018 +0530 rsi: move init_done flag to end of rsi_91x_init(). common->init_done flag should set after basic initialization. Hence, moving init_done flag at end of rsi_91x_init(). Signed-off-by: Amol Hanwate Signed-off-by: Siva Rebbagondla Signed-off-by: Kalle Valo commit 160ee2a11ce03d7276501d2448bfe8b3cbdad3e1 Author: Amol Hanwate Date: Mon Jul 16 19:09:36 2018 +0530 rsi: fill rx_params only once. rx_params are getting updated two times in driver, which is not required. Hence, removing duplicate updation of rx_params from rsi_prepare_skb(). Signed-off-by: Amol Hanwate Signed-off-by: Siva Rebbagondla Signed-off-by: Kalle Valo commit abbe87d339bdd3315b145d9c03ab5ab578febee7 Author: Amol Hanwate Date: Mon Jul 16 19:09:35 2018 +0530 rsi: Correct RSI_NEEDED_HEADROOM in mac80211_attach. Currently, RSI_NEEDED_HEADROOM is '80' for rsi driver, which is wrong. As per rsi internal frame format, the RSI_NEEDED_HEADROOM shall be '84', which is 64(dword_align) + 4(extended_desc) + 16(frame_desc). Hence, corrected the needed headroom. Signed-off-by: Amol Hanwate Signed-off-by: Siva Rebbagondla Signed-off-by: Kalle Valo commit f5fbce65abcf08cb961ddb1bc8f159f461c1a9db Author: Siva Rebbagondla Date: Mon Jul 16 19:09:34 2018 +0530 rsi: add firmware support for AP+BT dual mode Currently, AP mode will work on only WLAN alone firmware. To give support for AP and BT dual mode, adding firmware entry in 'struct ta_metadata'. The firmware entry is based on what coex_mode is used in driver and coex mode '4' for all AP+BT related functionalities. Hence, added the same. Signed-off-by: Siva Rebbagondla Signed-off-by: Kalle Valo commit bae402920424e27faa44130507b654ab7beabaa4 Author: Siva Rebbagondla Date: Mon Jul 16 19:09:33 2018 +0530 rsi: remove redundant flash_content variable while cleaning up the driver, observed that flash_content pointer is not necessary in rsi_load_firmware(). Instead of this, driver can use 'fw_entry->data' directly.Hence, removed redundant flash_content pointer. Signed-off-by: Siva Rebbagondla Signed-off-by: Kalle Valo commit 5850874c28a477046e78f7336a47faaf9b5db11d Author: Siva Rebbagondla Date: Mon Jul 16 19:09:32 2018 +0530 rsi: remove redundant device ids Removing redundant device id's from both usb and sdio idtables, as rsi driver currently supporting only one module(RS9113). Also, replaced ids with specific defines. Signed-off-by: Siva Rebbagondla Signed-off-by: Kalle Valo commit 1d2194562112dc4e5b1077c1946dffd168a6c358 Author: Siva Rebbagondla Date: Thu Jul 5 18:08:22 2018 +0530 rsi: optimize virtual interfaces Due to multiple calls of add interface routine, vif is getting duplicated and at certain instance, we are out of vifs, causing the driver to behave abnormal. Fix: Every vif has a unique mac-id, when we got a vif with same mac-id as the previous id's, we will override the respective vif. Signed-off-by: Siva Rebbagondla Signed-off-by: Sushant Kumar Mishra Signed-off-by: Kalle Valo commit 4c837d8c9b0c7718dd9ff14ee77e4704c9be258d Author: Siva Rebbagondla Date: Thu Jul 5 18:08:21 2018 +0530 rsi: fix for WoWLAN wakeup in security mode. System is unable to wake-up through magic-packet in secured connections. Because key descriptor is getting corrupted and firmware is unable to decrypt the magic packet. Fixed the issue by properly preparing it before sending it to firmware. Signed-off-by: Siva Rebbagondla Signed-off-by: Sushant Kumar Mishra Signed-off-by: Kalle Valo commit 38709316d1c927ac639f916e6c6f49b5de6e78ca Author: Ganapathi Raju Date: Thu Jul 5 18:08:20 2018 +0530 rsi: fix for 40MHZ connection issue. Radio capabilities packet is not prepared properly for 40MHZ case, ppe_ack_rate is a two byte variable which is initialized wrongly, hence we are unable to connect, resolved by assigning it properly. Signed-off-by: Ganapathi Raju Signed-off-by: Sushant Kumar Mishra Signed-off-by: Kalle Valo commit 92e9712381383dd244a447b9e96a8065faaf3570 Author: Siva Rebbagondla Date: Thu Jul 5 18:08:19 2018 +0530 rsi: fix for low throughput issue observed low throughput rates during verification. This is because, QoS enable flag is overridden by sequence number in the data descriptor frame. Hence, added the fix for same. Signed-off-by: Siva Rebbagondla Signed-off-by: Sushant Kumar Mishra Signed-off-by: Kalle Valo commit bfc83ea196ad3e201eae7d156d1a95c403079b85 Author: Roman Stratiienko Date: Tue Jul 24 14:47:27 2018 +0300 mwifiex: Fix skipped vendor specific IEs Mwifiex firmware inserts only Microsoft information element Allow other vendor specific IEs to pass from userspace Signed-off-by: Roman Stratiienko Signed-off-by: Kalle Valo commit fc3a2fcaa1ba9b28f691a9977371d97fb33b8461 Author: Ganapathi Bhat Date: Fri Jul 13 17:56:35 2018 +0530 mwifiex: use atomic bitops to represent adapter status variables Driver is using boolean variables to maintain vairous status information of adapter. These status variables are accessed by multiple threads and there is a possibility of a race. To avoid this, convert these variables to a set of bitops flags, to be operated atomically. Below variables of mwifiex_adapter are converted to bitop flags: surprise_removed is_cmd_timedout is_suspended is_hs_configured hs_enabling Signed-off-by: Ganapathi Bhat Signed-off-by: Kalle Valo commit 5188d5453bc9380ccd4ae1086138dd485d13aef2 Author: Ganapathi Bhat Date: Wed Jun 27 11:43:39 2018 +0530 mwifiex: restructure rx_reorder_tbl_lock usage Driver must ensure that whenever it holds a pointer to the list entry mwifiex_rx_reorder_tbl, it must protect the same with rx_reorder_tbl_lock. At present there are many places where driver does not ensure this. To cover all cases, spinlocks in below funcions are moved out and made sure that the caller will hold the spinlock: mwifiex_11n_dispatch_pkt_until_start_win() mwifiex_11n_scan_and_dispatch() mwifiex_del_rx_reorder_entry() mwifiex_11n_get_rx_reorder_tbl() mwifiex_11n_find_last_seq_num() Signed-off-by: Ganapathi Bhat Signed-off-by: Kalle Valo commit 5631909364e1e74b6188ec860d2a4cf216150a26 Author: Ganapathi Bhat Date: Wed Jun 27 11:43:38 2018 +0530 mwifiex: replace rx_pkt_lock by rx_reorder_tbl_lock At present driver spinlock protects iteration of list rx_reorder_tbl_ptr with rx_reorder_tbl_lock. To protect the individual items in this list, it uses rx_pkt_lock. But, we can use a single rx_reorder_tbl_lock for both purposes. This patch replaces rx_pkt_lock by rx_reorder_tbl_lock. Signed-off-by: Ganapathi Bhat Signed-off-by: Kalle Valo commit 245715cbe83ca934af5d20e078fd85175c62995e Author: Christoffer Dall Date: Wed Jul 25 10:21:28 2018 +0100 KVM: arm/arm64: Fix lost IRQs from emulated physcial timer when blocked When the VCPU is blocked (for example from WFI) we don't inject the physical timer interrupt if it should fire while the CPU is blocked, but instead we just wake up the VCPU and expect kvm_timer_vcpu_load to take care of injecting the interrupt. Unfortunately, kvm_timer_vcpu_load() doesn't actually do that, it only has support to schedule a soft timer if the emulated phys timer is expected to fire in the future. Follow the same pattern as kvm_timer_update_state() and update the irq state after potentially scheduling a soft timer. Reported-by: Andre Przywara Cc: Stable # 4.15+ Fixes: bbdd52cfcba29 ("KVM: arm/arm64: Avoid phys timer emulation in vcpu entry/exit") Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 7afc4ddbf299a13aaf28406783d141a34c6b4f5a Author: Christoffer Dall Date: Wed Jul 25 10:21:27 2018 +0100 KVM: arm/arm64: Fix potential loss of ptimer interrupts kvm_timer_update_state() is called when changing the phys timer configuration registers, either via vcpu reset, as a result of a trap from the guest, or when userspace programs the registers. phys_timer_emulate() is in turn called by kvm_timer_update_state() to either cancel an existing software timer, or program a new software timer, to emulate the behavior of a real phys timer, based on the change in configuration registers. Unfortunately, the interaction between these two functions left a small race; if the conceptual emulated phys timer should actually fire, but the soft timer hasn't executed its callback yet, we cancel the timer in phys_timer_emulate without injecting an irq. This only happens if the check in kvm_timer_update_state is called before the timer should fire, which is relatively unlikely, but possible. The solution is to update the state of the phys timer after calling phys_timer_emulate, which will pick up the pending timer state and update the interrupt value. Note that this leaves the opportunity of raising the interrupt twice, once in the just-programmed soft timer, and once in kvm_timer_update_state. Since this always happens synchronously with the VCPU execution, there is no harm in this, and the guest ever only sees a single timer interrupt. Cc: Stable # 4.15+ Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 00b645e0b4e4a3e5f8d88a4e9acf7e80045c34b4 Author: Arun Kumar Neelakantam Date: Fri Jul 27 17:47:29 2018 +0530 rpmsg: Add compat ioctl for rpmsg char driver Add compat ioctl callback to support 32bit user space applications. Signed-off-by: Arun Kumar Neelakantam Signed-off-by: Bjorn Andersson commit 475452fca1ddd3fe196fb834d58ecfcb83d782a6 Author: Chris Lew Date: Fri Jul 27 17:47:22 2018 +0530 rpmsg: glink: Store edge name for glink device Channels may need to identify the edge their channel was probed for. Store the edge name by reading the label property from device tree or default to the node name. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam Signed-off-by: Bjorn Andersson commit 52cd7047006cb5a4473e569a4d650bc2b23557a9 Author: Chris Lew Date: Fri Jul 27 17:47:21 2018 +0530 dt-bindings: soc: qcom: Add label for GLINK bindings There are GLINK clients who open the same channel on multiple GLINK links. These clients need a way to distinguish which remoteproc they are communicating to. Add a label property to identify the edge this node represents. Reviewed-by: Rob Herring Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam Signed-off-by: Bjorn Andersson commit fe782affd0f440a4e60e2cc81b8f2eccb2923113 Author: Srinivas Kandagatla Date: Fri Jun 15 10:59:39 2018 +0100 rpmsg: core: add support to power domains for devices Some of the rpmsg devices need to switch on power domains to communicate with remote processor. For example on Qualcomm DB820c platform LPASS power domain needs to switched on for any kind of audio services. This patch adds the missing power domain support in rpmsg core. Without this patch attempting to play audio via QDSP on DB820c would reboot the system. Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson commit 4499665b323670b42ec4c0d223c1e482e4e0621d Author: Loic Pallardy Date: Fri Jul 6 14:38:44 2018 +0200 remoteproc: st_slim: replace "%p" with "%pK" The format specifier "%p" can leak kernel addresses. Use "%pK" instead. Signed-off-by: Loic Pallardy Signed-off-by: Bjorn Andersson commit 276ec9934231e86857f219cb2adca54ea3c98127 Author: Loic Pallardy Date: Fri Jul 6 14:38:27 2018 +0200 remoteproc: replace "%p" with "%pK" The format specifier "%p" can leak kernel addresses. Use "%pK" instead. This patch proposes changes for remoteproc core only. Acked-by: Suman Anna Signed-off-by: Loic Pallardy Signed-off-by: Bjorn Andersson commit 82eca590cf5bf6eb1d1f2a282f5eb0f80ec0e57c Author: Srinivas Kandagatla Date: Mon Jun 18 13:33:39 2018 +0100 rpmsg: smd: fix kerneldoc warnings This patch fixes below kerneldoc warnings qcom_smd.c:141: warning: Function parameter or member 'dev' not described in 'qcom_smd_edge' qcom_smd.c:141: warning: Function parameter or member 'name' not described in 'qcom_smd_edge' qcom_smd.c:141: warning: Function parameter or member 'new_channel_event' not described in 'qcom_smd_edge' qcom_smd.c:222: warning: Function parameter or member 'qsept' not described in 'qcom_smd_channel' qcom_smd.c:222: warning: Function parameter or member 'registered' not described in 'qcom_smd_channel' qcom_smd.c:222: warning: Function parameter or member 'state_change_event' not described in 'qcom_smd_channel' qcom_smd.c:222: warning: Function parameter or member 'drvdata' not described in 'qcom_smd_channel' qcom_smd.c:737: warning: Function parameter or member 'wait' not described in '__qcom_smd_send' Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson commit 6f0b9584275a5f7756182e0ac39af7bfde9fbf61 Author: Srinivas Kandagatla Date: Mon Jun 18 13:33:38 2018 +0100 rpmsg: glink: Fix various kerneldoc warnings. Fix below kerneldoc warnings while building with W=1 qcom_glink_native.c:53: warning: Function parameter or member 'data' not described in 'glink_defer_cmd' qcom_glink_native.c:75: warning: Function parameter or member 'data' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'id' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'size' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'reuse' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'in_use' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'offset' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'node' not described in 'glink_core_rx_intent' qcom_glink_native.c:116: warning: Function parameter or member 'features' not described in 'qcom_glink' qcom_glink_native.c:116: warning: Function parameter or member 'intentless' not described in 'qcom_glink' qcom_glink_native.c:524: warning: Function parameter or member 'version' not described in 'qcom_glink_receive_version' qcom_glink_native.c:524: warning: Function parameter or member 'features' not described in 'qcom_glink_receive_version' qcom_glink_native.c:524: warning: Excess function parameter 'r_version' description in 'qcom_glink_receive_version' qcom_glink_native.c:524: warning: Excess function parameter 'r_features' description in 'qcom_glink_receive_version' qcom_glink_native.c:551: warning: Function parameter or member 'version' not described in 'qcom_glink_receive_version_ack' qcom_glink_native.c:551: warning: Function parameter or member 'features' not described in 'qcom_glink_receive_version_ack' qcom_glink_native.c:551: warning: Excess function parameter 'r_version' description in 'qcom_glink_receive_version_ack' qcom_glink_native.c:551: warning: Excess function parameter 'r_features' description in 'qcom_glink_receive_version_ack' qcom_glink_native.c:570: warning: bad line: wire format and transmit qcom_glink_native.c:604: warning: Function parameter or member 'intent' not described in 'qcom_glink_advertise_intent' qcom_glink_native.c:604: warning: Excess function parameter 'size' description in 'qcom_glink_advertise_intent' qcom_glink_native.c:710: warning: Function parameter or member 'glink' not described in 'qcom_glink_handle_intent_req' qcom_glink_native.c:710: warning: Function parameter or member 'cid' not described in 'qcom_glink_handle_intent_req' qcom_glink_native.c:710: warning: Function parameter or member 'size' not described in 'qcom_glink_handle_intent_req' Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson commit 427613ee193b72eb4b74412db07f43a7508b2bee Author: Srinivas Kandagatla Date: Mon Jun 18 13:33:37 2018 +0100 rpmsg: glink: correctly annotate intent members As intent structure members are not correctly annotated, leading to below warnings qcom_glink_native.c:614:16: warning: incorrect type in assignment (different base types) qcom_glink_native.c:614:16: expected unsigned short [unsigned] [usertype] id qcom_glink_native.c:614:16: got restricted __le16 [usertype] qcom_glink_native.c:615:18: warning: incorrect type in assignment (different base types) qcom_glink_native.c:615:18: expected unsigned short [unsigned] [usertype] lcid qcom_glink_native.c:615:18: got restricted __le16 [usertype] qcom_glink_native.c:616:19: warning: incorrect type in assignment (different base types) qcom_glink_native.c:616:19: expected unsigned int [unsigned] [usertype] count qcom_glink_native.c:616:19: got restricted __le32 [usertype] qcom_glink_native.c:617:18: warning: incorrect type in assignment (different base types) qcom_glink_native.c:617:18: expected unsigned int [unsigned] [usertype] size qcom_glink_native.c:617:18: got restricted __le32 [usertype] qcom_glink_native.c:618:18: warning: incorrect type in assignment (different base types) qcom_glink_native.c:618:18: expected unsigned int [unsigned] [usertype] liid qcom_glink_native.c:618:18: got restricted __le32 [usertype] Fix this by correctly annotating them. Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson commit 955c594ed1a729fc8b0af24d6cbd93eea1f3f46b Author: Vinod Koul Date: Mon Jul 30 23:05:49 2018 -0700 Input: pm8941-pwrkey - add resin entry Since handling is abstracted in this driver, we need to add resin entry in id table along with pwrkey_data. Reviewed-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Dmitry Torokhov commit 2049a9e56a01ddedc2528ea42284e60d0e448cce Author: Vinod Koul Date: Mon Jul 30 22:57:33 2018 -0700 Input: pm8941-pwrkey - abstract register offsets and event code In order to support resin thru the pwrkey driver (they are very similar in nature) we need to abstract the handling in this driver. First we abstract pull_up_bit and status_bit along in driver data. The event code sent for key events is quiried from DT. Since the device can be child of pon lookup regmap and reg from parent if lookup fails (we are child). Reviewed-by: Bjorn Andersson Signed-off-by: Vinod Koul Reviewed-by: Rob Herring Signed-off-by: Dmitry Torokhov commit 03760d44b1d12df34422f61fc30846d334e03eac Merge: 6eedfaac712d a449938297e5 Author: Martin Schwidefsky Date: Tue Jul 31 07:14:19 2018 +0200 Merge tag 'hlp_stage1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into features Pull hlp_stage1 from Christian Borntraeger with the following changes: KVM: s390: initial host large page support - must be enabled via module parameter hpage=1 - cannot be used together with nested - does support migration - does support hugetlbfs - no THP yet commit 218c21043d0037f616bd8af406de55a01e3fa381 Author: Yoshihiro Shimoda Date: Wed Jul 25 17:27:04 2018 +0900 dmaengine: sh: rcar-dmac: Should not stop the DMAC by rcar_dmac_sync_tcr() rcar_dmac_chan_get_residue() should not stop the DMAC, because the commit 538603c6026c ("dmaengine: sh: rcar-dmac: avoid to write CHCR.TE to 1 if TCR is set to 0") had fixed unexpected re-transferring issue. But it had caused the next issue which might stop the cyclic mode transferring. Thus, for example R-Car sound might be stopped suddenly. According to the commit 73a47bd0da66 ("dmaengine: rcar-dmac: use TCRB instead of TCR for residue"), the purpose of clearing CHCR.DE bit is flushing buffered data to calculate the exact residue. Such the "exact" residue had been required by sh-sci driver. sh-sci driver is calling dmaengine_pause() to stop transferring, and get "exact" residue. Otherwise, it might receive extra data during getting residue without pausing. In rx_timer_fn() of sh-sci driver: dmaengine_tx_status(); /* For checking roughly */ dmaengine_pause(); dmaengine_tx_status(); /* For getting residue */ dmaengine_terminate_all(); But, unfortunately the rcar-dmac driver didn't support dmaengine_pause() at that time. So, the sh-sci driver cannot get the "exact" residue without stopping the transferring, because rcar-dmac is buffering data inside. Because of these backgrounds, rcar-dmac had been cleared/set CHCR.DE bit in rcar_dmac_chan_get_residue() to synchronizing data and getting "exact" residue. However, rcar-dmac driver has rcar_dmac_chan_pause() now, and clearing CHCR.DE bit in rcar_dmac_chan_get_residue() doesn't need anymore. So, this patch removes the rcar_dmac_sync_tcr(). Fixes: 73a47bd0da66 ("dmaengine: rcar-dmac: use TCRB instead of TCR for residue") Signed-off-by: Yoshihiro Shimoda Tested-by: Hiroyuki Yokoyama Reviewed-by: Geert Uytterhoeven Signed-off-by: Vinod Koul commit 12c2b509c0cb981b34771097e4769abc7faebcee Author: Arnd Bergmann Date: Wed Jul 18 13:16:26 2018 +0200 remoteproc: qcom: fix Q6V5_WCSS dependencies A new driver got added that depends on QCOM_SMD and fails to link as built-in with CONFIG_QCOM_SMD=m: drivers/remoteproc/qcom_common.o: In function `smd_subdev_stop': qcom_common.c:(.text+0x674): undefined reference to `qcom_smd_unregister_edge' drivers/remoteproc/qcom_common.o: In function `smd_subdev_start': qcom_common.c:(.text+0x700): undefined reference to `qcom_smd_register_edge' We've fixed the same thing several times before, so use the same dependency here. Fixes: 3a3d4163e0bf ("remoteproc: qcom: Introduce Hexagon V5 based WCSS driver") Acked-by: Sricharan R Signed-off-by: Arnd Bergmann Signed-off-by: Bjorn Andersson commit f68d51bd8a7141ba84f06e6207197817398e7f3a Author: Suman Anna Date: Thu Jul 26 20:15:35 2018 -0500 remoteproc: Reset table_ptr in rproc_start() failure paths Unwind the modified table_ptr and restore it to the local copy upon any subsequent failures in the rproc_start() function. This keeps the function to remain balanced on failures without the need to balance any modified variables elsewhere. While at this, do some minor cleanup of the extra lines between the failure labels as well. Signed-off-by: Suman Anna [bjorn: unconditionally set table_ptr to cached_table] Signed-off-by: Bjorn Andersson commit ddb34f480d1b8051bc18e6ff22e93a6c9a33f94f Author: Baolin Wang Date: Thu Jun 28 10:32:21 2018 +0800 hwspinlock: Fix incorrect return pointers The commit 4f1acd758b08 ("hwspinlock: Add devm_xxx() APIs to request/free hwlock") introduces one bug, that will return one error pointer if failed to request one hwlock, but we expect NULL pointer on error for consumers. This patch will fix this issue. Reported-by: Dan Carpenter Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson commit c8a75afbf72ee4c16dad5339f55f62095879f207 Author: Bart Van Assche Date: Thu Jul 26 10:20:37 2018 -0700 Revert "scsi: target/iscsi: Reduce number of __iscsit_free_cmd() callers" The cxgbit driver expects that __iscsit_free_cmd() is called before the target core frees the command page list. Since this patch breaks the cxgbit driver, revert it. Reported-by: Varun Prakash Fixes: ed88f055788a ("scsi: target/iscsi: Reduce number of __iscsit_free_cmd() callers") Signed-off-by: Bart Van Assche Cc: Varun Prakash Cc: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 0e0d75267107e6a557ea9314d55bcff05a6ede44 Author: Mike Christie Date: Mon Jul 23 14:07:51 2018 -0500 scsi: tcmu: use u64 for dev_size We use unsigned long, size_t and u64 for dev_size. This has us standardize on u64. Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit b60cb1f80157689d206b09affc43c2dc1cafcbc8 Author: Mike Christie Date: Mon Jul 23 14:07:50 2018 -0500 scsi: tcmu: use match_int for dev params Instead of doing strdup and kstrto* just use match_int for dev params. It will be ok to use int instead of unsigned long in tcmu_set_dev_attrib because that is only being used for max sectors and block size and the supported values for them are well under the max possible integer value. Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit c97840c84f5a4362a596a2751e9245a979377a16 Author: Mike Christie Date: Mon Jul 23 14:07:49 2018 -0500 scsi: tcmu: do not set max_blocks if data_bitmap has been setup This patch prevents a bug where data_bitmap is allocated in tcmu_configure_device, userspace changes the max_blocks setting, the device is mapped to a LUN, then we try to access the data_bitmap based on the new max_blocks limit which may now be out of range. To prevent this, we just check if data_bitmap has been setup. If it has then we fail the max_blocks update operation. Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit dc335a995527fb1ee9ec5649162b22cd1ce728ee Author: Mike Christie Date: Mon Jul 23 14:07:48 2018 -0500 scsi: tcmu: unmap if dev is configured The tcmu dev is added to the list of tcmu devices during configuration. At this time the tcmu setup has completed, but lio core has not completed its setup. The device is not yet usable so do not try to unmap blocks from it Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit a30b0473b62652f9b8ccb1e4f4a3a3c31d2b72b3 Author: Mike Christie Date: Mon Jul 23 14:07:47 2018 -0500 scsi: tcmu: check if dev is configured before block/reset Do not allow userspace to block or reset the ring until the device has been configured. This will prevent the bug where userspace can write to those files and access mb_addr before it has been setup. Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit 63d5be0f6a8053ba0c084dd6e2d5538e9376e7da Author: Mike Christie Date: Mon Jul 23 14:07:46 2018 -0500 scsi: tcmu: use lio core se_device configuration helper Use the lio core helper to check if the device is configured. Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit cb0f32e12cded06e12ff19104eaf90c6f8310558 Author: Mike Christie Date: Mon Jul 23 14:07:45 2018 -0500 scsi: target: add helper to check if dev is configured This just adds a helper function to check if a device is configured and it converts the target users to use it. The next patch will add a backend module user so those types of modules do not have to know the lio core details. Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit ff07e4a414d963d5b1ee1446f05a451e591256de Author: Mike Christie Date: Mon Jul 23 14:07:44 2018 -0500 scsi: tcmu: initialize list head Use INIT_LIST_HEAD to initialize node list head. Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit f0e89aae609bebd430ce7a96d2f642917d89ca57 Author: Mike Christie Date: Mon Jul 23 14:07:43 2018 -0500 scsi: target_core_user: fix double unlock The caller of queue_cmd_ring grabs and releases the lock, so the tcmu_setup_cmd_timer failure handling inside queue_cmd_ring should not call mutex_unlock. Signed-off-by: Mike Christie Reviewed-by: Xiubo Li Signed-off-by: Martin K. Petersen commit 807cf197fc9a3bc156523cb68786a9cb0ec396b4 Author: Bart Van Assche Date: Mon Jul 30 14:40:19 2018 -0700 scsi: libiscsi: Annotate fall-through This patch avoids that building with W=1 causes the compiler to complain about fall-through. Signed-off-by: Bart Van Assche Cc: Lee Duncan Cc: Chris Leech Signed-off-by: Martin K. Petersen commit 1360c58a348e4ec551b58b9f40c3222ff5d6270f Author: Bart Van Assche Date: Mon Jul 30 14:40:18 2018 -0700 scsi: libiscsi: Annotate locking assumptions This patch avoids that sparse reports the following: drivers/scsi/libiscsi.c:1844:23: warning: context imbalance in 'iscsi_exec_task_mgmt_fn' - unexpected unlock Signed-off-by: Bart Van Assche Signed-off-by: Lee Duncan Signed-off-by: Chris Leech Signed-off-by: Martin K. Petersen commit 7382f9d8dc0db271da32787fd8559f1ec9f3f4f9 Author: Douglas Gilbert Date: Sat Jul 21 01:10:04 2018 -0400 scsi: scsi_debug: add cmd abort option to every_nth This patch is motivated by a response in the thread: Re: [PATCH 0/5]stop normal completion path entering a timeout req by Jianchao Wang . It generalizes the error injection of blk_abort_request() to use scsi_debug's "every_nth" mechanism. Ref with original patch to scsi_debug: https://lore.kernel.org/lkml/a68ad043-26a1-d3d8-2009-504ba4230e0f@oracle.com/ Also convert two vmalloc/memset(0) to vzalloc() calls. Signed-off-by: Douglas Gilbert Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4dc98c1995482262e70e83ef029135247fafe0f2 Author: Anton Vasilyev Date: Fri Jul 27 16:51:57 2018 +0300 scsi: 3ware: fix return 0 on the error path of probe tw_probe() returns 0 in case of fail of tw_initialize_device_extension(), pci_resource_start() or tw_reset_sequence() and releases resources. twl_probe() returns 0 in case of fail of twl_initialize_device_extension(), pci_iomap() and twl_reset_sequence(). twa_probe() returns 0 in case of fail of tw_initialize_device_extension(), ioremap() and twa_reset_sequence(). The patch adds retval initialization for these cases. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Acked-by: Adam Radford Signed-off-by: Martin K. Petersen commit dcaa0c12661d862bc533239da22ddf2ed90595e7 Author: Jia-Ju Bai Date: Fri Jul 27 17:13:17 2018 +0800 scsi: atp870u: Replace mdelay() with msleep() tscam(), atp870_init(), atp880_init() and atp885_init() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Martin K. Petersen commit d6aec1ca7c7c69e5b83b2cb24a57e7860d15507f Author: Jia-Ju Bai Date: Fri Jul 27 17:09:13 2018 +0800 scsi: a100u2w: Replace mdelay() with msleep() wait_chip_ready() and wait_firmware_ready() are never called in atomic context. They call mdelay() to busy wait which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Martin K. Petersen commit 508385001c09ee648c46f3d2bf5584e366007fd7 Author: Jia-Ju Bai Date: Fri Jul 27 11:47:39 2018 +0800 scsi: message: fusion: Replace GFP_ATOMIC with GFP_KERNEL mpt_attach() and mptfc_probe() are never called in atomic context. They call kzalloc() and kcalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Martin K. Petersen commit cc74e31d4147f26ead6ea06e4649d63a14edc0fe Author: Colin Ian King Date: Fri Jul 13 09:39:54 2018 +0100 scsi: lpfc: remove null check on nvmebuf The null checks on nvmebuf are redundant as nvmebuf is always obtained from a container_of() and hence can never be null. Remove all the redundant null checks. This also cleans up a static analysis warning. Detected by CoverityScan, CID#1471753 ("Dereference before null check") Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit a544523887007ba2b6bd73419c4e2f0ab9bb3633 Author: Dominique Martinet Date: Fri Jul 13 03:25:56 2018 +0200 scsi: ibmvscsi: change strncpy+truncation to strlcpy Generated by scripts/coccinelle/misc/strncpy_truncation.cocci Signed-off-by: Dominique Martinet Signed-off-by: Martin K. Petersen commit 7bd1d615a57f3356f41b0079a3fb9ee77ae00a82 Author: Dominique Martinet Date: Fri Jul 13 03:25:37 2018 +0200 scsi: mptctl: change strncpy+truncation to strlcpy Generated by scripts/coccinelle/misc/strncpy_truncation.cocci Signed-off-by: Dominique Martinet Signed-off-by: Martin K. Petersen commit 854633165164d19832225ece148370bb9f3b0034 Author: Parav Pandit Date: Sun Jul 29 11:53:16 2018 +0300 RDMA/core: Prefix _ib to IB/RoCE specific functions In rdma cm module, functions which are common between IB and iWarp are named with cma_. iWarp specific functions are prefixed with cma_iw. IB specific functions are perfixed with cma_ib. However some functions in request processing path didn't follow cma_ib notion. Prefix them with _ib for better code clarity. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 79d684f026473c344ce32708687f16b2bd12aff4 Author: Parav Pandit Date: Sun Jul 29 11:53:15 2018 +0300 RDMA/core: Simplify gid type check in cma_acquire_dev() cma_add_one() initializes the default GID regardless of device type. listen_id is bound to a device and an IP address, its GID type is initialized by cma_acquire_dev(). Therefore a valid default GID type is always available, it is not needed to check port type during cma_acquire_dev(). Initialize gid type of a cm id when the cm_id is created instead of doing conditional checks during cma_acquire_dev() and trying to initialize to 0 during _cma_attach_to_dev(). Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7582df826734bad71522b442b8977e3dee63a77a Author: Parav Pandit Date: Sun Jul 29 11:53:14 2018 +0300 RDMA/core: Avoid holding lock while initializing fields on stack In various functions rdma_cm_event is zero initialized on stack using memset() while holding lock which is not necessary. Therefore, don't hold the lock while initializing on stack. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ca3a8ace2b128abb7f164de9e10b8431eaddc2ac Author: Parav Pandit Date: Sun Jul 29 11:53:13 2018 +0300 RDMA/core: Return bool instead of int Return bool for following internal and inline functions as their underlying APIs return bool too. 1. cma_zero_addr() 2. cma_loopback_addr() 3. cma_any_addr() 4. ib_addr_any() 5. ib_addr_loopback() While we are touching cma_loopback_addr(), remove extra white spaces in it. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 05e0b86c413dc09454229f070eb6d2016340f602 Author: Parav Pandit Date: Sun Jul 29 11:53:12 2018 +0300 RDMA/cma: Get rid of 1 bit boolean Arrange fields of cma_req_info structure for efficiency on stack and get rid of one bit boolean field. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e7ff98aefc9e532a2067d5a2112a23902726e9a3 Author: Parav Pandit Date: Sun Jul 29 11:53:11 2018 +0300 RDMA/cma: Constify path record, ib_cm_event, listen_id pointers Constify several pointers such as path_rec, ib_cm_event and listen_id pointers in several functions. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2df7dba855e10cca8eddcd38bca825446ea10e1d Author: Parav Pandit Date: Sun Jul 29 11:53:10 2018 +0300 RDMA/core: Constify dst_addr argument Following APIs are not supposed to modify addr or dest_addr contents. Therefore make those function argument const for better code readability. 1. rdma_resolve_ip() 2. rdma_addr_size() 3. rdma_resolve_addr() Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 219d2e9dfda9431b808c28d5efc74b404b95b638 Author: Parav Pandit Date: Sun Jul 29 11:53:09 2018 +0300 RDMA/cma: Simplify rdma_resolve_addr() error flow Currently dst address is first set and later on cleared on either of the 3 error conditions are met. However none of the APIs or checks are supposed to refer to the destination address of the cm_id. Therefore, set the destination address after necessary checks pass which simplifies the error flow. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e11fef9f8d442e6929dce6c80dacea6466e348b0 Author: Parav Pandit Date: Sun Jul 29 11:53:08 2018 +0300 RDMA/cma: Initialize resource type in __rdma_create_id() Currently rdma_cm_id's resource tracking fields such as owner task and kern_name and other non resource tracking fields are initialized in in single function __rdma_create_id(). Therefore, initialize rdma_cm_id's resource type also in same init function. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cdfa4ad5d65ececbff24d070f21549db3b4c9cd9 Author: Lijun Ou Date: Mon Jul 30 20:20:30 2018 +0800 RDMA/hns: Program the tclass and flow label into the hardware This was missed in a few places, and was just using 0. Also correct the spelling of HNS_ROCE_FLOW_LABEL_MASK Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 426c414619ab742f6cb97c648d06975aa82cd62e Author: Lijun Ou Date: Mon Jul 30 20:20:29 2018 +0800 RDMA/hns: Use macro instead of magic number This patch mainly uses CMD_CSQ_DESC_NUM instead of magic number in order to improve readability. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit ac7cbf96c20991dbeea0af04ca9ff25252af9e5f Author: Lijun Ou Date: Mon Jul 30 20:20:28 2018 +0800 RDMA/hns: Modify qp will return errno when qp type is illegal Set for ret was missing in the error path here, resulting in incorrect error code for modify_qp. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit c8e46f8d632c30e2b1cda0afa6697cfea16d57c0 Author: Lijun Ou Date: Mon Jul 30 20:20:27 2018 +0800 RDMA/hns: Assign the value for vlan field of qp context This patch mainly fills the correct value into the vlan id field of qp context as well as update the vlan field name according to the latest hardware user manual. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 610b89677f422e8a07b2343a0750a1b3faca7922 Author: Lijun Ou Date: Mon Jul 30 20:20:25 2018 +0800 RDMA/hns: Only assgin the fields of the av if IB_QP_AV bit is set Only when the IB_QP_AV flag of attr_mask is set is it valid to assign the related fields of the av into the qp context. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 1ffba6264268e3a3f32f963ef3f44006ea9ebd35 Author: Kamal Heib Date: Fri Jul 27 21:23:06 2018 +0300 RDMA/providers: Remove pointless functions The rdma core is taking care of return the right error code when the rdma device callbacks aren't supported. Signed-off-by: Kamal Heib Acked-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 0584c47bbc3b3149bfe544d4e090fb6d96addf6c Author: Kamal Heib Date: Fri Jul 27 21:23:05 2018 +0300 RDMA/core: Check for verbs callbacks before using them Make sure the providers implement the verbs callbacks before calling them, otherwise return -EOPNOTSUPP. Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7150c3d5544b12c96a053153db9e1cec07b0892d Author: Kamal Heib Date: Fri Jul 27 21:23:04 2018 +0300 RDMA/core: Remove {create,destroy}_ah from mandatory verbs {create,destroy}_ah aren't mandatory verbs, because not all providers are implementing them. Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit e586e1e1b73f3dc020b82e6fc42c7789b7d0e95d Author: Kamal Heib Date: Mon Jul 30 21:56:44 2018 +0300 RDMA/ipoib: Fix check for return code from ib_create_srq Make sure to check for "-EOPNOTSUPP" instead of "-ENOSYS" which is the return code from ib_create_srq() in case that it not supported. Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 8380b74e7d606c4e053d7eea623362fcd8d432c2 Author: Kamal Heib Date: Mon Jul 30 21:56:43 2018 +0300 RDMA/providers: Fix return value from create_srq callbacks The proper return code is "-EOPNOTSUPP" when the create_srq() callback is not supported. Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit f95ccffc715bf0fc6792fda52d24e0a92ad955e7 Author: Jack Morgenstein Date: Thu Jul 26 10:08:37 2018 +0300 IB/mlx4: Use 4K pages for kernel QP's WQE buffer In the current implementation, the driver tries to allocate contiguous memory, and if it fails, it falls back to 4K fragmented allocation. Once the memory is fragmented, the first allocation might take a lot of time, and even fail, which can cause connection failures. This patch changes the logic to always allocate with 4K granularity, since it's more robust and more likely to succeed. This patch was tested with Lustre and no performance degradation was observed. Note: This commit eliminates the "shrinking WQE" feature. This feature depended on using vmap to create a virtually contiguous send WQ. vmap use was abandoned due to problems with several processors (see the commit cited below). As a result, shrinking WQE was available only with physically contiguous send WQs. Allocating such send WQs caused the problems described above. Therefore, as a side effect of eliminating the use of large physically contiguous send WQs, the shrinking WQE feature became unavailable. Warning example: worker/20:1: page allocation failure: order:8, mode:0x80d0 CPU: 20 PID: 513 Comm: kworker/20:1 Tainted: G OE ------------ Workqueue: ib_cm cm_work_handler [ib_cm] Call Trace: [] dump_stack+0x19/0x1b [] warn_alloc_failed+0x110/0x180 [] __alloc_pages_nodemask+0x9b4/0xba0 [] alloc_pages_current+0x98/0x110 [] __get_free_pages+0xe/0x50 [] swiotlb_alloc_coherent+0x5e/0x150 [] x86_swiotlb_alloc_coherent+0x41/0x50 [] mlx4_buf_direct_alloc.isra.7+0xc4/0x180 [mlx4_core] [] mlx4_buf_alloc+0x1bb/0x260 [mlx4_core] [] create_qp_common+0x536/0x1000 [mlx4_ib] [] ? dma_pool_free+0xa7/0xd0 [] mlx4_ib_create_qp+0x3b1/0xdc0 [mlx4_ib] [] ? mlx4_ib_create_cq+0x2d2/0x430 [mlx4_ib] [] mlx4_ib_create_qp_wrp+0x10/0x20 [mlx4_ib] [] ib_create_qp+0x7a/0x2f0 [ib_core] [] rdma_create_qp+0x34/0xb0 [rdma_cm] [] kiblnd_create_conn+0xbf9/0x1950 [ko2iblnd] [] ? cfs_percpt_unlock+0x1a/0xb0 [libcfs] [] kiblnd_passive_connect+0xa99/0x18c0 [ko2iblnd] Fixes: 73898db04301 ("net/mlx4: Avoid wrong virtual mappings") Signed-off-by: Jack Morgenstein Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit bccd06223f21654eb268e153426a77deb117c1e8 Author: Jason Gunthorpe Date: Thu Jul 26 16:37:14 2018 -0600 IB/uverbs: Add UVERBS_ATTR_FLAGS_IN to the specs language This clearly indicates that the input is a bitwise combination of values in an enum, and identifies which enum contains the definition of the bits. Special accessors are provided that handle the mandatory validation of the allowed bits and enforce the correct type for bitwise flags. If we had introduced this at the start then the kabi would have uniformly used u64 data to pass flags, however today there is a mixture of u64 and u32 flags. All places are converted to accept both sizes and the accessor fixes it. This allows all existing flags to grow to u64 in future without any hassle. Finally all flags are, by definition, optional. If flags are not passed the accessor does not fail, but provides a value of zero. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky commit d34ac5cd3a73aacd11009c4fc3ba15d7ea62c411 Author: Bart Van Assche Date: Wed Jul 18 09:25:32 2018 -0700 RDMA, core and ULPs: Declare ib_post_send() and ib_post_recv() arguments const Since neither ib_post_send() nor ib_post_recv() modify the data structure their second argument points at, declare that argument const. This change makes it necessary to declare the 'bad_wr' argument const too and also to modify all ULPs that call ib_post_send(), ib_post_recv() or ib_post_srq_recv(). This patch does not change any functionality but makes it possible for the compiler to verify whether the ib_post_(send|recv|srq_recv) really do not modify the posted work request. To make this possible, only one cast had to be introduce that casts away constness, namely in rpcrdma_post_recvs(). The only way I can think of to avoid that cast is to introduce an additional loop in that function or to change the data type of bad_wr from struct ib_recv_wr ** into int (an index that refers to an element in the work request list). However, both approaches would require even more extensive changes than this patch. Signed-off-by: Bart Van Assche Reviewed-by: Chuck Lever Signed-off-by: Jason Gunthorpe commit 7bb1fafc2f163ad03a2007295bb2f57cfdbfb630 Author: Bart Van Assche Date: Wed Jul 18 09:25:15 2018 -0700 IB/mlx5, ib_post_send(), IB_WR_REG_SIG_MR: Do not modify the 'wr' argument Since the next patch will constify the wr pointer, do not modify the data that pointer points at. Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Cc: Saeed Mahameed Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f696bf6d64b195b83ca1bdb7cd33c999c9dcf514 Author: Bart Van Assche Date: Wed Jul 18 09:25:14 2018 -0700 RDMA: Constify the argument of the work request conversion functions When posting a send work request, the work request that is posted is not modified by any of the RDMA drivers. Make this explicit by constifying most ib_send_wr pointers in RDMA transport drivers. Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Reviewed-by: Steve Wise Reviewed-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 3e081b773e4c892c1ba2515184072327db9fb29a Author: Bart Van Assche Date: Wed Jul 18 09:25:13 2018 -0700 IB/iser: Inline two work request conversion functions Since the next patch will change the return type of these functions into a const pointer and since the iSER driver modifies the work request these functions return a pointer two, inline two work request conversion function calls. This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 60bc84e227d24fdb1ac2211c574a88ecd7c836a0 Author: 谢致邦 (XIE Zhibang) Date: Wed Jan 4 21:30:58 2017 +0800 MIPS: Loongson: Merge load addresses Systems based upon the Loongson 1B & 1C CPUs share the same load address, as do those based upon Loongson 1A. Unify the definition of this load address to reduce duplication & avoid the need for an extra Loongson 1A case in future. [paul.burton@mips.com: Rewrite commit message.] Signed-off-by: 谢致邦 (XIE Zhibang) Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/14927/ Cc: linux-mips@linux-mips.org commit 968dc5a0eaca707f8eb2fbad57d9fbbf3284541e Author: 谢致邦 (XIE Zhibang) Date: Thu Jun 1 18:41:34 2017 +0800 MIPS: Loongson: Set Loongson32 to MIPS32R1 LS232 (Loonson 2-issue 32-bit, also called GS232 (Godson 2-issue 32-bit)) is the CPU core (microarchitecture) of Loongson 1A/1B/1C. According to "LS232 用户手册 (LS232 User Manual)", LS232 implements the MIPS32 Release 1 instruction set, and part of the MIPS32 Release 2 instruction set. In the manual, LS232 implements all of the MIPS32R2 instruction set except the FPU instructions, and LS232 also implements 5 FPU instructions of the MIPS32R2 instruction set: CEIL.L.fmt, CVT.L.fmt, FLOOR.L.fmt, TRUNC.L.fmt, and ROUND.L.fmt. But a bug of the DI instruction has been found during tests, the DI instruction can not disable interrupts in arch_local_irq_disable() with CONFIG_PREEMPT_NONE=y and CFLAGS='-mno-branch-likely' in some cases. [paul.burton@mips.com: - Remove the _MIPS_ISA redefinition to match the change made for the generic MIPSr1 CPUs by commit 344ebf09949c ("MIPS: Always use -march=, not - shortcuts").] Signed-off-by: 谢致邦 (XIE Zhibang) Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/16155/ Cc: linux-mips@linux-mips.org Cc: ralf@linux-mips.org commit 5043f06ecec66410ba708e29ae0ab5333d2f15cb Author: Daniel Lezcano Date: Tue Jul 31 09:02:37 2018 +0800 MAINTAINERS: Add Daniel Lezcano as designated reviewer for thermal Add Daniel Lezcano as the reviewer for thermal as he would like to participate in the review process effort for the thermal framework, especially the SoC part. Signed-off-by: Daniel Lezcano Acked-by: Eduardo Valentin Signed-off-by: Zhang Rui commit 1ce6a9fc154935d9db771173ecde03fa9b42df4a Author: Thomas Richter Date: Mon Jul 30 10:53:23 2018 +0200 bpf: fix build error in libbpf with EXTRA_CFLAGS="-Wp, -D_FORTIFY_SOURCE=2 -O2" Commit 531b014e7a2f ("tools: bpf: make use of reallocarray") causes a compiler error when building the perf tool in the linux-next tree. Compile file tools/lib/bpf/libbpf.c on a FEDORA 28 installation with gcc compiler version: gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20) shows this error message: [root@p23lp27] # make V=1 EXTRA_CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -O2" [...] make -f /home6/tmricht/linux-next/tools/build/Makefile.build dir=./util/scripting-engines obj=libperf libbpf.c: In function ‘bpf_object__elf_collect’: libbpf.c:811:15: error: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Werror=unused-result] strerror_r(-err, errmsg, sizeof(errmsg)); ^ cc1: all warnings being treated as errors mv: cannot stat './.libbpf.o.tmp': No such file or directory /home6/tmricht/linux-next/tools/build/Makefile.build:96: recipe for target 'libbpf.o' failed Replace all occurrences of strerror() by calls to strerror_r(). To keep the compiler quiet also use the return value from strerror_r() otherwise a 'variable set but not use' warning which is treated as error terminates the compile. Fixes: 531b014e7a2f ("tools: bpf: make use of reallocarray") Suggested-by: Jakub Kicinski Suggested-by: Daniel Borkmann Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit e6753f23d961d601dbae50a2fc2a3975c9715b14 Author: Joel Fernandes (Google) Date: Mon Jul 30 15:24:22 2018 -0700 tracepoint: Make rcuidle tracepoint callers use SRCU In recent tests with IRQ on/off tracepoints, a large performance overhead ~10% is noticed when running hackbench. This is root caused to calls to rcu_irq_enter_irqson and rcu_irq_exit_irqson from the tracepoint code. Following a long discussion on the list [1] about this, we concluded that srcu is a better alternative for use during rcu idle. Although it does involve extra barriers, its lighter than the sched-rcu version which has to do additional RCU calls to notify RCU idle about entry into RCU sections. In this patch, we change the underlying implementation of the trace_*_rcuidle API to use SRCU. This has shown to improve performance alot for the high frequency irq enable/disable tracepoints. Test: Tested idle and preempt/irq tracepoints. Here are some performance numbers: With a run of the following 30 times on a single core x86 Qemu instance with 1GB memory: hackbench -g 4 -f 2 -l 3000 Completion times in seconds. CONFIG_PROVE_LOCKING=y. No patches (without this series) Mean: 3.048 Median: 3.025 Std Dev: 0.064 With Lockdep using irq tracepoints with RCU implementation: Mean: 3.451 (-11.66 %) Median: 3.447 (-12.22%) Std Dev: 0.049 With Lockdep using irq tracepoints with SRCU implementation (this series): Mean: 3.020 (I would consider the improvement against the "without this series" case as just noise). Median: 3.013 Std Dev: 0.033 [1] https://patchwork.kernel.org/patch/10344297/ [remove rcu_read_lock_sched_notrace as its the equivalent of preempt_disable_notrace and is unnecessary to call in tracepoint code] Link: http://lkml.kernel.org/r/20180730222423.196630-3-joel@joelfernandes.org Cleaned-up-by: Peter Zijlstra Acked-by: Peter Zijlstra Reviewed-by: Mathieu Desnoyers Signed-off-by: Joel Fernandes (Google) [ Simplified WARN_ON_ONCE() ] Signed-off-by: Steven Rostedt (VMware) commit 01f38497c6f6525f57eb445887b9ed1867dbd05c Author: Joel Fernandes (Google) Date: Mon Jul 30 15:24:21 2018 -0700 lockdep: Use this_cpu_ptr instead of get_cpu_var stats get_cpu_var disables preemption which has the potential to call into the preemption disable trace points causing some complications. There's also no need to disable preemption in uses of get_lock_stats anyway since preempt is already disabled. So lets simplify the code. Link: http://lkml.kernel.org/r/20180730222423.196630-2-joel@joelfernandes.org Suggested-by: Peter Zijlstra Acked-by: Peter Zijlstra Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit fdf82a7856b32d905c39afc85e34364491e46346 Author: Jiri Kosina Date: Thu Jul 26 13:14:55 2018 +0200 x86/speculation: Protect against userspace-userspace spectreRSB The article "Spectre Returns! Speculation Attacks using the Return Stack Buffer" [1] describes two new (sub-)variants of spectrev2-like attacks, making use solely of the RSB contents even on CPUs that don't fallback to BTB on RSB underflow (Skylake+). Mitigate userspace-userspace attacks by always unconditionally filling RSB on context switch when the generic spectrev2 mitigation has been enabled. [1] https://arxiv.org/pdf/1807.07940.pdf Signed-off-by: Jiri Kosina Signed-off-by: Thomas Gleixner Reviewed-by: Josh Poimboeuf Acked-by: Tim Chen Cc: Konrad Rzeszutek Wilk Cc: Borislav Petkov Cc: David Woodhouse Cc: Peter Zijlstra Cc: Linus Torvalds Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/nycvar.YFH.7.76.1807261308190.997@cbobk.fhfr.pm commit 6fc7c4110cbaff85b1f49fd70b77950384c3a201 Author: Masami Hiramatsu Date: Mon Jul 30 19:21:11 2018 +0900 selftests/ftrace: Fix kprobe string testcase to not probe notrace function Fix kprobe string argument testcase to not probe notrace function. Instead, it probes tracefs function which must be available with ftrace. Link: http://lkml.kernel.org/r/153294607107.32740.1664854684396589624.stgit@devbox Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit d899926f552bbd2e132b339fe40c06b9a1152e1a Author: Francis Deslauriers Date: Mon Jul 30 19:20:42 2018 +0900 selftest/ftrace: Move kprobe selftest function to separate compile unit Move selftest function to its own compile unit so it can be compiled with the ftrace cflags (CC_FLAGS_FTRACE) allowing it to be probed during the ftrace startup tests. Link: http://lkml.kernel.org/r/153294604271.32740.16490677128630177030.stgit@devbox Signed-off-by: Francis Deslauriers Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 45408c4f92506dbdfef1721f2613e1426de00894 Author: Masami Hiramatsu Date: Mon Jul 30 19:20:14 2018 +0900 tracing: kprobes: Prohibit probing on notrace function Prohibit kprobe-events probing on notrace functions. Since probing on a notrace function can cause a recursive event call. In most cases those are just skipped, but in some cases it falls into an infinite recursive call. This protection can be disabled by the kconfig CONFIG_KPROBE_EVENTS_ON_NOTRACE=y, but it is highly recommended to keep it "n" for normal kernel builds. Note that this is only available if "kprobes on ftrace" has been implemented on the target arch and CONFIG_KPROBES_ON_FTRACE=y. Link: http://lkml.kernel.org/r/153294601436.32740.10557881188933661239.stgit@devbox Signed-off-by: Masami Hiramatsu Tested-by: Francis Deslauriers [ Slight grammar and spelling fixes ] Signed-off-by: Steven Rostedt (VMware) commit caca1ff0de6212682f6000db53388800046db887 Merge: 3fce46182793 90991209837a Author: Dave Airlie Date: Tue Jul 31 08:24:02 2018 +1000 Merge branch 'drm-udl-next' of git://people.freedesktop.org/~airlied/linux into drm-next A set of cleanups and fixes for Mikulas for using udl on arm boards. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/CAPM=9twQNgrmfe0=Okq1NTgWHRQXy+AzeDy8A0p_-y856p4vtA@mail.gmail.com commit 90991209837ab619555a46a97a88dead7a960d2d Author: Mikulas Patocka Date: Sun Jun 3 16:41:03 2018 +0200 udl-kms: dont spam the syslog with debug messages The udl kms driver writes messages to the syslog whenever some application opens or closes /dev/fb0 and whenever the user switches between the Xserver and the console. This patch changes the priority of these messages to debug. Signed-off-by: Mikulas Patocka Signed-off-by: Dave Airlie commit c2f53119b410047e5d97de2a5ec74157d2e58986 Author: Mikulas Patocka Date: Sun Jun 3 16:41:02 2018 +0200 udl-kms: use spin_lock_irq instead of spin_lock_irqsave spin_lock_irqsave and spin_unlock_irqrestore is inteded to be called from a context where it is unknown if interrupts are enabled or disabled (such as interrupt handlers). From a process context, we should call spin_lock_irq and spin_unlock_irq, that avoids the costly pushf and popf instructions. Signed-off-by: Mikulas Patocka Signed-off-by: Dave Airlie commit 58cba7c222e8c87bb6b61fcba21d1536145221b0 Author: Mikulas Patocka Date: Sun Jun 3 16:41:01 2018 +0200 udl-kms: avoid prefetch Modern processors can detect linear memory accesses and prefetch data automatically, so there's no need to use prefetch. Signed-off-by: Mikulas Patocka Signed-off-by: Dave Airlie commit 91ba11fb7d7ca0a3bbe8a512e65e666e2ec1e889 Author: Mikulas Patocka Date: Sun Jun 3 16:41:00 2018 +0200 udl-kms: avoid division Division is slow, so it shouldn't be done by the pixel generating code. The driver supports only 2 or 4 bytes per pixel, so we can replace division with a shift. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie commit 09a00abe3a9941c2715ca83eb88172cd2f54d8fd Author: Mikulas Patocka Date: Sun Jun 3 16:40:57 2018 +0200 udl-kms: fix crash due to uninitialized memory We must use kzalloc when allocating the fb_deferred_io structure. Otherwise, the field first_io is undefined and it causes a crash. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie commit 542bb9788a1f485eb1a2229178f665d8ea166156 Author: Mikulas Patocka Date: Sun Jun 3 16:40:56 2018 +0200 udl-kms: handle allocation failure Allocations larger than PAGE_ALLOC_COSTLY_ORDER are unreliable and they may fail anytime. This patch fixes the udl kms driver so that when a large alloactions fails, it tries to do multiple smaller allocations. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie commit 8456b99c16d193c4c3b7df305cf431e027f0189c Author: Mikulas Patocka Date: Sun Jun 3 16:40:55 2018 +0200 udl-kms: change down_interruptible to down If we leave urbs around, it causes not only leak, but also memory corruption. This patch fixes the function udl_free_urb_list, so that it always waits for all urbs that are in progress. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie commit 2375846193663a1282c0ef7093640ed3210dc09f Merge: 57cb198cfdd2 a449938297e5 Author: Janosch Frank Date: Mon Jul 30 23:20:00 2018 +0200 Merge tag 'hlp_stage1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvms390/next KVM: s390: initial host large page support - must be enabled via module parameter hpage=1 - cannot be used together with nested - does support migration - does support hugetlbfs - no THP yet commit a449938297e55e7e8958f8b48583f7d342da1930 Author: Janosch Frank Date: Fri Jul 13 11:28:31 2018 +0100 KVM: s390: Add huge page enablement control General KVM huge page support on s390 has to be enabled via the kvm.hpage module parameter. Either nested or hpage can be enabled, as we currently do not support vSIE for huge backed guests. Once the vSIE support is added we will either drop the parameter or enable it as default. For a guest the feature has to be enabled through the new KVM_CAP_S390_HPAGE_1M capability and the hpage module parameter. Enabling it means that cmm can't be enabled for the vm and disables pfmf and storage key interpretation. This is due to the fact that in some cases, in upcoming patches, we have to split huge pages in the guest mapping to be able to set more granular memory protection on 4k pages. These split pages have fake page tables that are not visible to the Linux memory management which subsequently will not manage its PGSTEs, while the SIE will. Disabling these features lets us manage PGSTE data in a consistent matter and solve that problem. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand commit a9e00d8349c98e0973c8b0d671d69e838f7b5bcc Author: Janosch Frank Date: Fri Jul 13 11:28:37 2018 +0100 s390/mm: Add huge page gmap linking support Let's allow huge pmd linking when enabled through the KVM_CAP_S390_HPAGE_1M capability. Also we can now restrict gmap invalidation and notification to the cases where the capability has been activated and save some cycles when that's not the case. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand commit 7d735b9ae82d073e23ff7d2648e0aa8056049d16 Author: Dominik Dingel Date: Fri Jul 13 11:28:29 2018 +0100 s390/mm: hugetlb pages within a gmap can not be freed Guests backed by huge pages could theoretically free unused pages via the diagnose 10 instruction. We currently don't allow that, so we don't have to refault it once it's needed again. Signed-off-by: Dominik Dingel Reviewed-by: Martin Schwidefsky Reviewed-by: David Hildenbrand Signed-off-by: Janosch Frank commit a8651194f9f61406cb8926feeeb7829258295b2a Author: Christoph Hellwig Date: Mon Jul 30 09:38:42 2018 +0200 PCI: Call dma_debug_add_bus() for pci_bus_type from PCI core There is nothing arch-specific about PCI or dma-debug, so call dma_debug_add_bus() from the PCI core just after registering the bus type. Most of dma-debug is already generic; this just adds reporting of pending dma-allocations on driver unload for arches other than powerpc, sh, and x86. Signed-off-by: Christoph Hellwig Signed-off-by: Bjorn Helgaas Acked-by: Thomas Gleixner Acked-by: Michael Ellerman (powerpc) commit bef1fa6ea72bb885e0285d502e35cc01198bee6c Author: Robert Schlabbach Date: Mon Jun 25 06:33:58 2018 -0400 media: em28xx: disable null packet filter for WinTVdualHD This patch disables the null packet filter for the Hauppauge WinTV-dualHD. There are applications which require the unfiltered transport stream (e.g. DOCSIS segment load analyzers). Tests showed that the device is capable of delivering two unfiltered EuroDOCSIS 3.0 transport streams simultaneously, i.e. over 100 Mbit/s worth of data, without any losses. Signed-off-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab commit ca747d041adbf78d93bbea4d125c7ddc626effba Author: Daniel Scheller Date: Sun Jun 24 09:42:50 2018 -0400 media: dvb-frontends/tda18271c2dd: fix handling of DVB-T parameters Add a break statement in set_params() for the SYS_DVBT(2). As reported by gcc: drivers/media/dvb-frontends/tda18271c2dd.c:1144:3: warning: this statement may fall through [-Wimplicit-fallthrough=] There is a nested switch() inside the code with sets the tuner to the right standard. Without the break, the code will always set to DVB-C mode, with can be sub-optimal for DVB-T. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 875658af666fb171f2b61a203281fde608bab24a Author: Daniel Scheller Date: Sat Jun 23 11:36:15 2018 -0400 media: ddbridge/mci: add SX8 I/Q mode remark and remove DIAG CMD defines Take note that the SX8 IQ mode is only available on a single tuner, and remove the MCI/SX8 DIAG CMD defines. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit e1f84840fd13e5f7ef4c20e3e9d021a0d2f19e11 Author: Daniel Scheller Date: Sat Jun 23 11:36:14 2018 -0400 media: ddbridge/sx8: enable modulation selection in set_parameters() Allow for tuning to transponders with specific modulations in set_parameters(). Setting a specific modulation will also enable lower modulations. Picked up from the upstream dddvb GIT. Upstream also has support for APSK64/128/256 modulations which aren't supported yet by the DVB API, so comment them out until support for them is added. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 3153dfe2914bec728cab9a5c9d7b2ec71d714d9c Author: Daniel Scheller Date: Sat Jun 23 11:36:13 2018 -0400 media: ddbridge/sx8: disable automatic PLS code search The SX8 cards by default do an automatic search for the PLS code. This is not necessarily wanted as this can eventually be detected wrong, so disable this. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 8610326e39cc929dd6fa49161c3472e4babe6bbc Author: Daniel Scheller Date: Sat Jun 23 11:36:12 2018 -0400 media: ddbridge/mci: add more MCI status codes, improve MCI_SUCCESS macro The MCI can report the command status more finegrained, so, add more status code defines and update the MCI_SUCCESS macro. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit e552684809d601c9a6109a73322c816ce1de10bd Author: Daniel Scheller Date: Sat Jun 23 11:36:11 2018 -0400 media: ddbridge/mci: split MaxSX8 specific code off to ddbridge-sx8.c Split off all code specific to the MaxSX8 cards to a separate ddbridge-sx8 module and hook it up in the Makefile. This also adds evaluation of the mci_type to allow for using different attach handling for different cards. As different cards can implement things differently (ie. support differing frontend_ops, and have different base structs being put ontop of the common mci_base struct), this introduces the mci_cfg struct which is initially used to hold a few specifics to the -sx8 submodule. While at it, the handling of the i/q mode is adjusted slightly. Besides this and handling mci_base and sx8_base struct pointers where needed, all code is copied unmodified from ddbridge-mci.c. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 84409a95bbae75c5396c6db9ac43f1d1626d6b75 Author: Daniel Scheller Date: Sat Jun 23 11:36:10 2018 -0400 media: ddbridge/mci: make ddb_mci_cmd() and ddb_mci_config() public In preparation for splitting all MaxSX8 related code parts from the common MCI code, prefix both mci_cmd() and mci_config() functions with ddb_, remove the static marking and add matching function prototypes to ddbridge-mci.h so these functions can be reused from other files within the ddbridge driver. As this requires the mci-related structs to be defined in ddbridge-mci.h, move struct mci and struct mci_base there and clean them up. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 07b12de21258e1d96445572100961d1d42b1b7f7 Author: Daniel Scheller Date: Sat Jun 23 11:36:09 2018 -0400 media: ddbridge/mci: store mci type and number of ports in the hwinfo For better support for future MCI based cards, rename the mci struct member to mci_ports to carry the number of ports on the cards, and add a mci_type member to identify the card type to handle differing hardware. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 6094cbed4e7bee130f8b29c9a174bc336d19990b Author: Daniel Scheller Date: Sat Jun 23 11:36:08 2018 -0400 media: ddbridge/mci: extend mci_command and mci_result structs Recent FPGA firmware reports more data and values in sent command responses. Adjust the mci_command and mci_result structs including it's unions to match these changes and add a few comments explaining things. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 9b28ba016fc4a387ffefccbc6c390af3fdf37eb9 Author: Daniel Scheller Date: Sat Jun 23 11:36:07 2018 -0400 media: ddbridge/mci: rename defines and fix i/q var types Adjustments to match the FPGA firmware, and the signal I/Q values are reported as s16 types from the card firmware. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 3c7d591121c3f5cb97abb9c5dd2a9c2bd8532674 Author: Daniel Scheller Date: Sat Jun 23 11:36:06 2018 -0400 media: ddbridge/mci: read and report signal strength and SNR Implement querying signal statistics from the MCI and report this data in read_status() as DVBv5 statistics. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 3addf0fa820b3da34e0c0e532167afcee8089a3b Author: Daniel Scheller Date: Sat Jun 23 11:36:05 2018 -0400 media: ddbridge/mci: update copyright year in headers Update the copyright year information in the MCI headers to 2017-2018. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 9f269f1fd2397fe716468579b81a9cd0b2fed2ab Author: Daniel Scheller Date: Sat Jun 23 11:36:04 2018 -0400 media: ddbridge: change MCI base ID and define a SX8 ID Change the start of the MCI ID range (internally used only) to 48 and define an ID for the SX8 card type. Use this new ID to handle device attachment. This change is done in preparation for support of more MCI based cards. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 2957e53e57f2d8a791d5d56978e194440844f186 Author: Daniel Scheller Date: Sat Jun 23 11:36:03 2018 -0400 media: ddbridge: link structure access cosmetics in ddb_port_probe() Throughout the function, dev->link[l] is used several times. Unclutter this a bit by declaring a ddb_link var at the top of the function, assign the address of dev->link[l] to it and use that var to access the link[] struct member. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit 7b6b9b153ad0127ec031438e3538acdebd677b02 Author: Daniel Scheller Date: Sat Jun 23 11:36:02 2018 -0400 media: ddbridge: remove unused MDIO defines and hwinfo member ddbridge has a few MDIO related remainders (defines, hwinfo struct) which aren't of any use for the in-kernel driver at all (they're only used in conjunction with the OctoNet SAT>IP boxes which the kernel driver doesn't have any support for), so clean this up. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit d96eeee502cc5c75e0ab7d61468a3b906e609e98 Author: Daniel Scheller Date: Sat Jun 23 11:36:01 2018 -0400 media: ddbridge: report I2C bus errors The I2C_COMMAND response reports an error in the I2C bus communication using bit 17. Evaluate the response more thoroughly and log an error if an I2C problem was detected. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit ce2280fbe65f14ab13663e2174abe2575b977c32 Author: Daniel Scheller Date: Sat Jun 23 11:36:00 2018 -0400 media: ddbridge: evaluate the actual link when setting up the dummy tuner Devices supporting dummy tuner operation can exist on any link, not only on link 0, so fix this accordingly. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit d33be4327eea80b46701d2b71f15749ec793f92d Author: Daniel Scheller Date: Sat Jun 23 11:35:59 2018 -0400 media: ddbridge: probe for LNBH25 chips before attaching In demod_attach_stv0910(), the LNBH25 IC is being blindly attached and, if the result is bad, blindly attached on another possible I2C address. The LNBH25 uses it's set_voltage function to test for the IC and will print an error to the kernel log on failure. Prevent this by probing the possible I2C address and use this (and only this) to attach the LNBH25 I2C driver. This also allows the stv0910 attach function to be a bit cleaner. Picked up from the upstream dddvb GIT and adapted for the LNBH25 driver variant from the kernel tree. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit f9dc3af8212b626a62103e7ba8cb3c84482334b8 Author: Daniel Scheller Date: Sat Jun 23 11:35:58 2018 -0400 media: dvb-frontends/stv0910: cast the BER denominator shift exp to ULL To avoid miscalculations related to the BER denominator, the shift expression needs to be casted as ULL. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab commit d21c249b26311dd193b100e65fc9e7ae96233d40 Author: Mauro Carvalho Chehab Date: Wed May 30 11:07:04 2018 -0400 media: dvb/audio.h: get rid of unused APIs There are a number of other ioctls that aren't used anywhere inside the Kernel tree. Get rid of them. Signed-off-by: Mauro Carvalho Chehab commit b41e44b4cb230747d7ad56e38c9dc65369b1d381 Author: Mauro Carvalho Chehab Date: Wed May 30 11:07:03 2018 -0400 media: dvb/video.h: get rid of unused APIs There are a number of other ioctls that aren't used anywhere inside the Kernel tree. Get rid of them. Signed-off-by: Mauro Carvalho Chehab commit fc91a3c4c27acdca0bc13af6fbb68c35cfd519f2 Author: Joel Fernandes (Google) Date: Mon Jul 23 14:25:31 2018 -0700 debugobjects: Make stack check warning more informative While debugging an issue debugobject tracking warned about an annotation issue of an object on stack. It turned out that the issue was due to the object in concern being on a different stack which was due to another issue. Thomas suggested to print the pointers and the location of the stack for the currently running task. This helped to figure out that the object was on the wrong stack. As this is general useful information for debugging similar issues, make the error message more informative by printing the pointers. [ tglx: Massaged changelog ] Signed-off-by: Joel Fernandes (Google) Signed-off-by: Thomas Gleixner Acked-by: Waiman Long Acked-by: Yang Shi Cc: kernel-team@android.com Cc: Arnd Bergmann Cc: astrachan@google.com Link: https://lkml.kernel.org/r/20180723212531.202328-1-joel@joelfernandes.org commit 6ae746711263bd6da45f709fdb9f12e4f57e22bd Author: Yidong Ren Date: Mon Jul 30 17:09:45 2018 +0000 hv_netvsc: Add per-cpu ethtool stats for netvsc This patch implements following ethtool stats fields for netvsc: cpu_tx/rx_packets/bytes cpu_vf_tx/rx_packets/bytes Corresponding per-cpu counters already exist in current code. Exposing these counters will help troubleshooting performance issues. for_each_present_cpu() was used instead of for_each_possible_cpu(). for_each_possible_cpu() would create very long and useless output. It is still being used for internal buffer, but not for ethtool output. There could be an overflow if cpu was added between ethtool call netvsc_get_sset_count() and netvsc_get_ethtool_stats() and netvsc_get_strings(). (still safe if cpu was removed) ethtool makes these three function calls separately. As long as we use ethtool, I can't see any clean solution. Currently and in foreseeable short term, Hyper-V doesn't support cpu hot-plug. Plus, ethtool is for admin use. Unlikely the admin would perform such combo operations. Changes in v2: - Remove cpp style comment - Resubmit after freeze Changes in v3: - Reimplemented with kvmalloc instead of alloc_percpu Changes in v4: - Fixed inconsistent array size - Use kvmalloc_array instead of kvmalloc Signed-off-by: Yidong Ren Reviewed-by: Stephen Hemminger Signed-off-by: David S. Miller commit d018031f562b9c2eff038969ab1955a370c52d8f Author: Mukesh Ojha Date: Tue Jul 24 20:17:48 2018 +0530 cpu/hotplug: Clarify CPU hotplug step name for timers After commit 249d4a9b3246 ("timers: Reinitialize per cpu bases on hotplug") i.e. the introduction of state CPUHP_TIMERS_PREPARE instead of CPUHP_TIMERS_DEAD the step name "timers:dead" is not longer accurate. Rename it to "timers:prepare". [ tglx: Massaged changelog ] Signed-off-by: Mukesh Ojha Signed-off-by: Thomas Gleixner Cc: gkohli@codeaurora.org Cc: neeraju@codeaurora.org Cc: Peter Zijlstra Cc: Lai Jiangshan Cc: Brendan Jackman Cc: Mathieu Malaterre Link: https://lkml.kernel.org/r/1532443668-26810-1-git-send-email-mojha@codeaurora.org commit 1e96e93a3569fd7a4d3199d9d912345ad3b8ce4c Author: Colin Ian King Date: Mon Jul 30 13:59:18 2018 +0100 iio: light: si1133 fix test for val being not zero or not one. The current check on val always results in true and so the call to sii1133_update_adcsens never gets called. Fix this check so it returns with -EINVAL only when val is not zero and not one. Detected by CoverityScan, CID#1472099 ("Logically dead code") Fixes: e01e7eaf37d8 ("iio: light: introduce si1133") Signed-off-by: Colin Ian King Signed-off-by: Jonathan Cameron commit db251d7df4570c7d48df088edfa3d1d510cc67c2 Author: Maharaja Kennadyrajan Date: Wed Jul 18 19:04:20 2018 +0530 ath10k: add debugfs file warm_hw_reset Debugfs support to do hardware warm reset with WMI command WMI_PDEV_PARAM_PDEV_RESET for 10.4 and 10.2.4(if wmi service is enabled in the firmware for backward compatibility). This change is purely for debugging purpose when hardware hangs/mutes. This hardware reset won't affect the connectivity but there will be small pause in data traffic. Here we are doing BB/MAC level reset and hence whenever the BB/MAC watchdog is triggered, it does a hardware_chip_reset. So the target will be in the active state. Below command used to warm reset the hardware. echo 1 > /sys/kernel/debug/ieee80211/phyX/ath10k/warm_hw_reset Tested in QCA988X with firmware ver 10.2.4.70.45 Tested in QCA4019 with firmware ver 10.4-3.2.1.1-00011 Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo commit e82f57c8b9708baf4a58a9282636d9285b5aa2dd Author: Nicholas Mc Guire Date: Sat Jul 14 19:38:20 2018 +0200 ath10k: htt_tx: move lock into id_get function This is only code refactoring as all call sites of ath10k_htt_tx_alloc_msdu_id() take the same lock it can be moved into the id_get function and the assertion dropped. Signed-off-by: Nicholas Mc Guire Signed-off-by: Kalle Valo commit 619c9700a8fe017bdbe60e08c21213962b2de87a Author: Colin Ian King Date: Mon Jul 9 14:17:20 2018 +0100 ath6kl: remove redundant variables netlen, orig_buf, orig_len, dropped and stats Variables netlen, orig_buf, orig_len, dropped and stats are assigned values but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'netlen' set but not used [-Wunused-but-set-variable] warning: variable 'orig_buf' set but not used [-Wunused-but-set-variable] warning: variable 'orig_len' set but not used [-Wunused-but-set-variable] warning: variable 'dropped' set but not used [-Wunused-but-set-variable] warning: variable 'stats' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit 843c408905010fbc44a564d2de6a3cd68d986abf Author: Yi Wang Date: Fri Jul 27 14:15:03 2018 +0800 x86/apic: Trivial coding style fixes There is inconsistent indenting in calibrate_APIC_clock() and activate_managed(). Remove the surplus TAB. Signed-off-by: Yi Wang Signed-off-by: Thomas Gleixner Reviewed-by: Jiang Biao Acked-by: Steven Rostedt (VMware) Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: jgross@suse.com Cc: ville.syrjala@linux.intel.com Cc: len.brown@intel.com Cc: gregkh@linuxfoundation.org Cc: zhong.weidong@zte.com.cn Link: https://lkml.kernel.org/r/1532672103-32250-1-git-send-email-wang.yi59@zte.com.cn commit e8c38062efc6ffa38f602eb8ffb8c8b03bcf2b5f Author: Colin Ian King Date: Mon Jul 9 13:41:38 2018 +0100 ath5k: remove redundant pointer rf Pointer rf is being assigned but is never used hence it is redundant and can be removed. Cleans up two clang warnings: warning: variable 'rf' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit e6712aa1244fe7b53776858b73bfd1a94a198681 Author: Colin Ian King Date: Mon Jul 9 13:34:46 2018 +0100 ath10k: remove redundant pointers 'dev' and 'noa' Pointers dev and noa are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'dev' set but not used [-Wunused-but-set-variable] warning: variable 'noa' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit 24cfd8ca1d28331b9dad3b88d1958c976b2cfab6 Author: Dou Liyang Date: Mon Jul 30 15:59:47 2018 +0800 x86/platform/UV: Mark memblock related init code and data correctly parse_mem_block_size() and mem_block_size are only used during init. Mark them accordingly. Fixes: d7609f4210cb ("x86/platform/UV: Add kernel parameter to set memory block size") Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Cc: Mike Travis Cc: Andrew Banman Link: https://lkml.kernel.org/r/20180730075947.23023-1-douly.fnst@cn.fujitsu.com commit dc405152bb64d4ae01c9ac669de25b2d1fb6fc2d Author: Rakesh Pillai Date: Wed Jul 25 10:59:45 2018 +0300 ath10k: handle mgmt tx completion event WCN3990 transmits management frames via WMI with reference. Currently, with the management tx completion not being handled, these frames are not getting freed even after the transmission status is returned by the firmware. The transmitted management frames should be freed when the firmware sends the over-the-air tx status of the corresponding management frames. Handle the wmi mgmt tx completion event and free the corresponding management frame. Tested HW: WCN3990 Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 Signed-off-by: Rakesh Pillai Signed-off-by: Kalle Valo commit 673bc519c55843c68c3aecff71a4101e79d28d2b Author: Surabhi Vishnoi Date: Wed Jul 25 10:59:41 2018 +0300 ath10k: disable bundle mgmt tx completion event support The tx completion of multiple mgmt frames can be bundled in a single event and sent by the firmware to host, if this capability is not disabled explicitly by the host. If the host cannot handle the bundled mgmt tx completion, this capability support needs to be disabled in the wmi init cmd, sent to the firmware. Add the host capability indication flag in the wmi ready command, to let firmware know the features supported by the host driver. This field is ignored if it is not supported by firmware. Set the host capability indication flag(i.e. host_capab) to zero, for disabling the support of bundle mgmt tx completion. This will indicate the firmware to send completion event for every mgmt tx completion, instead of bundling them together and sending in a single event. Tested HW: WCN3990 Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 Signed-off-by: Surabhi Vishnoi Signed-off-by: Rakesh Pillai Signed-off-by: Kalle Valo commit cd93b83ad927b2c7979e0add0343ace59328b461 Author: Pradeep Kumar Chitrapu Date: Wed Jul 25 10:59:39 2018 +0300 ath10k: support for multicast rate control Issues a wmi command to firmware when multicast rate change is received with the new BSS_CHANGED_MCAST_RATE flag. Also fixes the incorrect fixed_rate setting for CCK rates which got introduced with addition of ath10k_rates_rev2 enum. Tested on QCA9984 with firmware ver 10.4-3.6-00104 Signed-off-by: Pradeep Kumar Chitrapu Signed-off-by: Kalle Valo commit 5db1b1e1ee34871b1965b3f890e3ccbdb185fa52 Author: zhong jiang Date: Mon Jul 30 21:44:33 2018 +0800 x86/boot/KASLR: Make local variable mem_limit static Fix the following sparse warning: arch/x86/boot/compressed/kaslr.c:102:20: warning: symbol 'mem_limit' was not declared. Should it be static? Signed-off-by: zhong jiang Signed-off-by: Thomas Gleixner Cc: Link: https://lkml.kernel.org/r/1532958273-47725-1-git-send-email-zhongjiang@huawei.com commit 1e3c43a7f111943fb6bb7cafa9d1e9834d6b2b0e Author: Kalle Valo Date: Wed Jul 25 10:59:37 2018 +0300 ath10k: fix open brace location in ath10k_wmi_tlv_op_gen_dbglog_cfg() Fixes a recently added checkpatch warning: wmi-tlv.c:2703: open brace '{' following function definitions go on the next line Signed-off-by: Kalle Valo commit 6386889ac23e2c1c8276a111765421577539dd7a Author: Quentin Schulz Date: Wed Jul 25 14:26:20 2018 +0200 MIPS: mscc: ocelot: add interrupt controller properties to GPIO controller The GPIO controller also serves as an interrupt controller for events on the GPIO it handles. An interrupt occurs whenever a GPIO line has changed. Signed-off-by: Quentin Schulz Acked-by: Alexandre Belloni Reviewed-by: Linus Walleij Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20015/ Cc: robh+dt@kernel.org Cc: mark.rutland@arm.com Cc: ralf@linux-mips.org Cc: jhogan@kernel.org Cc: linux-gpio@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: thomas.petazzoni@bootlin.com commit 1088c6eef261939bda8346ec35b513790a2111d5 Author: Dou Liyang Date: Mon Jul 30 15:54:21 2018 +0800 x86/kvmclock: Mark kvm_get_preset_lpj() as __init kvm_get_preset_lpj() is only called from kvmclock_init(), so mark it __init as well. Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Reviewed-by: Pavel Tatashin Cc: Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Cc: "H. Peter Anvin" Cc: "Radim Krčmář" Cc: kvm@vger.kernel.org Link: https://lkml.kernel.org/r/20180730075421.22830-3-douly.fnst@cn.fujitsu.com commit 608008a45798fe9e2aee04f99b5270ea57c1376f Author: Dou Liyang Date: Mon Jul 30 15:54:20 2018 +0800 x86/tsc: Consolidate init code Split out suplicated code from tsc_early_init() and tsc_init() into a common helper and fixup some comment typos. [ tglx: Massaged changelog and renamed function ] Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Reviewed-by: Pavel Tatashin Cc: Cc: Peter Zijlstra Cc: "H. Peter Anvin" Link: https://lkml.kernel.org/r/20180730075421.22830-2-douly.fnst@cn.fujitsu.com commit bd9f943e5d2a42d864f9692477a25034c9d47dcc Author: Pavel Tatashin Date: Mon Jul 30 09:52:52 2018 -0400 sched/clock: Disable interrupts when calling generic_sched_clock_init() sched_clock_init() used be called early during boot when interrupts were still disabled. After the recent changes to utilize sched clock early the sched_clock_init() call happens when interrupts are already enabled, which triggers the following warning: WARNING: CPU: 0 PID: 0 at kernel/time/sched_clock.c:180 sched_clock_register+0x44/0x278 [] (warn_slowpath_null) from [] (sched_clock_register+0x44/0x278) [] (sched_clock_register) from [] (generic_sched_clock_init+0x28/0x88) [] (generic_sched_clock_init) from [] (sched_clock_init+0x54/0x74) [] (sched_clock_init) from [] (start_kernel+0x310/0x3e4) [] (start_kernel) from [<00000000>] ( (null)) Disable IRQs for the duration of generic_sched_clock_init(). Fixes: 857baa87b642 ("sched/clock: Enable sched clock early") Signed-off-by: Pavel Tatashin Reported-by: Guenter Roeck Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Link: https://lkml.kernel.org/r/20180730135252.24599-1-pasha.tatashin@oracle.com commit 11c291461b6ea8d1195a96d6bba6673a94aacebc Author: Srinivas Pandruvada Date: Mon Jul 2 12:01:54 2018 -0700 ata: libahci: Allow reconfigure of DEVSLP register There are two modes in which DEVSLP can be entered. The OS initiated or hardware autonomous. In hardware autonomous mode, BIOS configures the AHCI controller and the device to enable DEVSLP. But they may not be ideal for all cases. So in this case, OS should be able to reconfigure DEVSLP register. Currently if the DEVSLP is already enabled, we can't set again as it will simply return. There are some systems where the firmware is setting high DITO by default, in this case we can't modify here to correct settings. With the default in several seconds, we are not able to transition to DEVSLP. This change will allow reconfiguration of devslp register if DITO is different. Signed-off-by: Srinivas Pandruvada Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit 2dbb3ec29a6c069035857a2fc4c24e80e5dfe3cc Author: Srinivas Pandruvada Date: Mon Jul 2 12:01:53 2018 -0700 ata: libahci: Correct setting of DEVSLP register We have seen that on some platforms, SATA device never show any DEVSLP residency. This prevent power gating of SATA IP, which prevent system to transition to low power mode in systems with SLP_S0 aka modern standby systems. The PHY logic is off only in DEVSLP not in slumber. Reference: https://www.intel.com/content/dam/www/public/us/en/documents/datasheets /332995-skylake-i-o-platform-datasheet-volume-1.pdf Section 28.7.6.1 Here driver is trying to do read-modify-write the devslp register. But not resetting the bits for which this driver will modify values (DITO, MDAT and DETO). So simply reset those bits before updating to new values. Signed-off-by: Srinivas Pandruvada Reviewed-by: Rafael J. Wysocki Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit 684ad537abff987886d63fb3c573eeca40d7f2db Author: Pavel Tatashin Date: Wed Jul 25 16:00:18 2018 -0400 timekeeping: Prevent false warning when persistent clock is not available On arches with no persistent clock a message like this is printed during boot: [ 0.000000] Persistent clock returned invalid value The value is not invalid: Zero means that no persistent clock is available and the absence of persistent clock should be quietly accepted. Fixes: 3eca993740b8 ("timekeeping: Replace read_boot_clock64() with read_persistent_wall_and_boot_offset()") Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: sboyd@kernel.org Cc: john.stultz@linaro.org Link: https://lkml.kernel.org/r/20180725200018.23722-1-pasha.tatashin@oracle.com commit df6b4e6608eebc2ff18113706f4e3b9d9a972e68 Merge: 87ea58433208 d66a8acbda92 Author: James Morris Date: Mon Jul 30 10:31:54 2018 -0700 Merge branch 'smack-for-4.19-a' of https://github.com/cschaufler/next-smack into next-smack From Casey Schaufler. commit 0211d49e5200554eb836c9a12a247d4c11fe571c Author: Paul Burton Date: Fri Jul 27 18:23:21 2018 -0700 MIPS: generic: Select MIPS_AUTO_PFN_OFFSET Enable CONFIG_MIPS_AUTO_PFN_OFFSET for the generic platform, allowing it to avoid wasted book-keeping for pages with addresses lower than the physical base address of memory. This has a minimal impact on kernel text size, with 64r6el_defconfig gaining 0.1% in size as reported by bloat-o-meter: add/remove: 4/1 grow/shrink: 345/13 up/down: 9017/-392 (8625) Function old new delta pcpu_setup_first_chunk 1444 1780 +336 pcpu_alloc_first_chunk 864 1136 +272 start_kernel 1064 1288 +224 initcall_blacklist 224 372 +148 try_fill_recv 2088 2184 +96 ... Total: Before=8457273, After=8465898, chg +0.10% The gain for systems with large offsets to physical memory & the ability to continue using generic kernels on such systems seems well worth this small cost. Signed-off-by: Paul Burton Suggested-by: Vladimir Kondratiev Patchwork: https://patchwork.linux-mips.org/patch/20049/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 6c359eb1dcdb721908f4336171ed8eb6d78190c5 Author: Paul Burton Date: Fri Jul 27 18:23:20 2018 -0700 MIPS: Allow auto-dection of ARCH_PFN_OFFSET & PHYS_OFFSET On systems where physical memory begins at a non-zero address, defining PHYS_OFFSET (which influences ARCH_PFN_OFFSET) can save us time & memory by avoiding book-keeping for pages from address zero to the start of memory. Some MIPS platforms already make use of this, but with the definition of PHYS_OFFSET being compile-time constant it hasn't been possible to enable this optimization for a kernel which may run on systems with varying physical memory base addresses. Introduce a new Kconfig option CONFIG_MIPS_AUTO_PFN_OFFSET which, when enabled, makes ARCH_PFN_OFFSET a variable & detects it from the boot memory map (which for example may have been populated from DT). The relationship with PHYS_OFFSET is reversed, with PHYS_OFFSET now being based on ARCH_PFN_OFFSET. This is because ARCH_PFN_OFFSET is used far more often, so avoiding the need for runtime calculation gives us a smaller impact on kernel text size (0.1% rather than 0.15% for 64r6el_defconfig). Signed-off-by: Paul Burton Suggested-by: Vladimir Kondratiev Patchwork: https://patchwork.linux-mips.org/patch/20048/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 0494d7ffdcebc6935410ea0719b24ab626675351 Author: Paul Burton Date: Fri Jul 27 18:23:19 2018 -0700 MIPS: Fix ISA virt/bus conversion for non-zero PHYS_OFFSET isa_virt_to_bus() & isa_bus_to_virt() claim to treat ISA bus addresses as being identical to physical addresses, but they fail to do so in the presence of a non-zero PHYS_OFFSET. Correct this by having them use virt_to_phys() & phys_to_virt(), which consolidates the calculations to one place & ensures that ISA bus addresses do indeed match physical addresses. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20047/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: Vladimir Kondratiev commit 0d0e14770d4487a7ede8df93d82305cbfac2d453 Author: Paul Burton Date: Fri Jul 27 18:23:18 2018 -0700 MIPS: Make (UN)CAC_ADDR() PHYS_OFFSET-agnostic Converting an address between cached & uncached (typically addresses in (c)kseg0 & (c)kseg1 or 2 xkphys regions) should not depend upon PHYS_OFFSET in any way - we're converting from a virtual address in one unmapped region to a virtual address in another unmapped region. For some reason our CAC_ADDR() & UNCAC_ADDR() macros make use of PAGE_OFFSET, which typically includes PHYS_OFFSET. This means that platforms with a non-zero PHYS_OFFSET typically have to workaround miscalculation by these 2 macros by also defining UNCAC_BASE to a value that isn't really correct. It appears that an attempt has previously been made to address this with commit 3f4579252aa1 ("MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET") which was later undone by commit ed3ce16c3d2b ("Revert "MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET"") which also introduced the ar7 workaround. That attempt at a fix was roughly equivalent, but essentially caused the CAC_ADDR() & UNCAC_ADDR() macros to cancel out PHYS_OFFSET by adding & then subtracting it again. In his revert Leonid is correct that using PHYS_OFFSET makes no sense in the context of these macros, but appears to have missed its inclusion via PAGE_OFFSET which means PHYS_OFFSET actually had an effect after the revert rather than before it. Here we fix this by modifying CAC_ADDR() & UNCAC_ADDR() to stop using PAGE_OFFSET (& thus PHYS_OFFSET), instead using __pa() & __va() along with UNCAC_BASE. For UNCAC_ADDR(), __pa() will convert a cached address to a physical address which we can simply use as an offset from UNCAC_BASE to obtain an address in the uncached region. For CAC_ADDR() we can undo the effect of UNCAC_ADDR() by subtracting UNCAC_BASE and using __va() on the result. With this change made, remove definitions of UNCAC_BASE from the ar7 & pic32 platforms which appear to have defined them only to workaround this problem. Signed-off-by: Paul Burton References: 3f4579252aa1 ("MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET") References: ed3ce16c3d2b ("Revert "MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET"") Patchwork: https://patchwork.linux-mips.org/patch/20046/ Cc: Florian Fainelli Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: Vladimir Kondratiev commit 189e1955677d6a704fed3dfbc33893836a48a700 Author: Dave Wysochanski Date: Tue Jul 10 14:59:24 2018 -0400 sunrpc: Add _add_rpc_iostats() to add rpc_iostats metrics Add a helper function to add the metrics in two rpc_iostats structures. Signed-off-by: Dave Wysochanski Signed-off-by: Anna Schumaker commit acdce5fb8ab47d0baf494d0fed4e9a222741eb38 Author: Dave Wysochanski Date: Tue Jul 10 14:59:23 2018 -0400 sunrpc: add _print_rpc_iostats() to output metrics for one RPC op Refactor the output of the metrics for one RPC op into an internal function. No functional change. Signed-off-by: Dave Wysochanski Signed-off-by: Anna Schumaker commit 82b98ca566ca2af170eb0ab50cef09dd7335fa55 Author: Sargun Dhillon Date: Thu Jul 5 16:48:50 2018 +0000 net/sunrpc: Make rpc_auth_create_args a const This turns rpc_auth_create_args into a const as it gets passed through the auth stack. Signed-off-by: Sargun Dhillon Signed-off-by: Anna Schumaker commit 0914bb965e38a055e9245637aed117efbe976e91 Author: Dan Carpenter Date: Wed Jul 4 12:59:58 2018 +0300 pnfs/blocklayout: off by one in bl_map_stripe() "dev->nr_children" is the number of children which were parsed successfully in bl_parse_stripe(). It could be all of them and then, in that case, it is equal to v->stripe.volumes_count. Either way, the > should be >= so that we don't go beyond the end of what we're supposed to. Fixes: 5c83746a0cf2 ("pnfs/blocklayout: in-kernel GETDEVICEINFO XDR parsing") Signed-off-by: Dan Carpenter Reviewed-by: Christoph Hellwig Cc: stable@vger.kernel.org # 3.17+ Signed-off-by: Anna Schumaker commit 23a88ade7131aa259c532ab17685c76de562242b Author: Calum Mackay Date: Thu Jul 5 17:08:08 2018 +0100 nfs: Referrals not inheriting proto setting from parent Commit 530ea4219231 ("nfs: Referrals should use the same proto setting as their parent") encloses the fix with #ifdef CONFIG_SUNRPC_XPRT_RDMA. CONFIG_SUNRPC_XPRT_RDMA is a tristate option, so it should be tested with #if IS_ENABLED(). Fixes: 530ea4219231 ("nfs: Referrals should use the same proto setting as their parent") Reported-by: Helen Chao Tested-by: Helen Chao Reviewed-by: Chuck Lever Reviewed-by: Bill Baker Signed-off-by: Calum Mackay Signed-off-by: Anna Schumaker commit 8b199e58d49beaae33eaf11b68b7183eb28f1681 Author: Jeff Layton Date: Thu Jul 5 05:48:14 2018 -0400 nfs: initiate returning delegation when reclaiming one that's been recalled When reclaiming a delegation via CLAIM_PREVIOUS open, the server can indicate that the delegation has been recalled since it was issued by setting the "recalled" flag in the delegation. Ensure that we respect the flag by initiating a delegation return when it is set. Signed-off-by: Jeff Layton Signed-off-by: Anna Schumaker commit 01a368441ff1c93a16fc69e147c5787da7798d38 Author: Souptick Joarder Date: Mon Jul 2 20:57:09 2018 +0530 fs: nfs: Adding new return type vm_fault_t Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. see commit 1c8f422059ae ("mm: change return type to vm_fault_t") for reference. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Anna Schumaker commit 12b289cfacac1f7b0a22ebb3d86def7198d26e47 Author: Chengguang Xu Date: Thu Jun 28 11:09:45 2018 +0800 nfs: add error check in nfs_idmap_prepare_message() Even though the caller of nfs_idmap_prepare_message() checks return code in their side but it's better to add an error check for match_int() so that we can avoid unnecessary operations when bad int arg is detected. Signed-off-by: Chengguang Xu Signed-off-by: Anna Schumaker commit 140aada48b5f1a8bed3ba4afb5fc59220651657f Author: Dave Kleikamp Date: Mon Jul 30 10:29:21 2018 -0500 arm64: kexec: machine_kexec should call __flush_icache_range machine_kexec flushes the reboot_code_buffer from the icache after stopping the other cpus. Commit 3b8c9f1cdfc5 ("arm64: IPI each CPU after invalidating the I-cache for kernel mappings") added an IPI call to flush_icache_range, which causes a hang here, so replace the call with __flush_icache_range Signed-off-by: Dave Kleikamp Cc: AKASHI Takahiro Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 494f2e765d4ae855455bb2488fd3796a4e6e1235 Merge: 778c4d5c5b96 541c6ce30f67 Author: David S. Miller Date: Mon Jul 30 09:47:22 2018 -0700 Merge branch 'selftests-mirror-to-gretap-with-team' Petr Machata says: ==================== A test for mirror-to-gretap with team in UL packet path This patchset adds a test for "tc action mirred mirror" where the mirrored-to device is a gretap, and underlay path contains a team device. In patch #1 require_command() is added, which should henceforth be used to declare dependence on a certain tool. In patch #2, two new functions, team_create() and team_destroy(), are added to lib.sh. The newly-added test uses arping, which isn't necessarily available. Therefore patch #3 introduces $ARPING, and a preexisting test is fixed to require_command $ARPING. In patches #4 and #5, two new tests are added. In both cases, a team device is on egress path of a mirrored packet in a mirror-to-gretap scenario. In the first one, the team device is in loadbalance mode, in the second one it's in lacp mode. (The difference in modes necessitates a different testing strategy, hence two test cases instead of just parameterizing one.) ==================== Signed-off-by: David S. Miller commit 541c6ce30f6738a05a869606f50c14dea89d12e2 Author: Petr Machata Date: Mon Jul 30 16:40:07 2018 +0200 selftests: forwarding: Test mirror-to-gretap w/ UL team LACP This tests mirror-to-gretap when an underlay packet path includes a team device which is not in loadbalance mode, but in LACP mode. The test manipulates LAG membership to achieve changes in txability, thus making sure that a driver that offloads mirror-to-gretap doesn't just consider upness of a device. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit a9b33b2001b6e2b2a0df266977472db497a5d1ca Author: Petr Machata Date: Mon Jul 30 16:40:02 2018 +0200 selftests: forwarding: Test mirror-to-gretap w/ UL team Test for "tc action mirred egress mirror" that mirrors to gretap when the underlay route points at a VLAN-aware bridge (802.1q), and the traffic egresses the bridge through a team device. Test upping and downing individual team device slaves and verify the traffic flows as expected. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit ca70a5623823841c179cf792b549d63b5fbe32ab Author: Petr Machata Date: Mon Jul 30 16:39:57 2018 +0200 selftests: forwarding: Introduce $ARPING Instead of relying on "arping" being installed everywhere under that name, introduce a variable $ARPING like the other tools do. Convert an existing test, mirror_gre_vlan_bridge_1q.sh to require_command $ARPING and then invoke arping through the variable. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 9d9e6bde3df4ec6af0cc7dac328f8d8555aa36f9 Author: Petr Machata Date: Mon Jul 30 16:39:52 2018 +0200 selftests: forwarding: lib: Support team devices Add team_create() and team_destroy() to manage team netdevices. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit e094574f9bf806fb89a285c0a0263a46a1d536f9 Author: Petr Machata Date: Mon Jul 30 16:39:46 2018 +0200 selftests: forwarding: lib: Add require_command() The logic for testing whether a certain command is available is used several times in the current code base. The tests in follow-up patches add more requirements like that. Therefore extract the logic into a named function, require_command(), that can be used directly from lib.sh as well as from any test that wishes to declare dependence on some command. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 778c4d5c5b96a61c7981ad6d841071326a713845 Author: YueHaibing Date: Mon Jul 30 21:07:24 2018 +0800 fib_rules: NULL check before kfree is not needed kfree(NULL) is safe,so this removes NULL check before freeing the mem Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit efd112353bf7c0f9d50f928b449ea9da0ee9554b Author: Will Deacon Date: Mon Jul 30 17:43:39 2018 +0100 arm64: svc: Ensure hardirq tracing is updated before return We always run userspace with interrupts enabled, but with the recent conversion of the syscall entry/exit code to C, we don't inform the hardirq tracing code that interrupts are about to become enabled by virtue of restoring the EL0 SPSR. This patch ensures that trace_hardirqs_on() is called on the syscall return path when we return to the assembly code with interrupts still disabled. Fixes: f37099b6992a ("arm64: convert syscall trace logic to C") Reported-by: Julien Grall Signed-off-by: Will Deacon commit 86ff73622a013ceac948390e5920b817e101e0b2 Author: Quentin Schulz Date: Mon Jul 30 14:53:13 2018 +0200 net: phy: mscc: the extended page access register is 16 bits The Extended Page Access is a 16-bit register, so change the page parameter of vsc85xx_phy_page_set to a u16. Signed-off-by: Quentin Schulz Reviewed-by: Andrew Lunn Reviewed-by: Alexandre Belloni Signed-off-by: David S. Miller commit ad13acce8dcd35cfc15281c1348beb70ca64091b Author: Vakul Garg Date: Mon Jul 30 16:08:33 2018 +0530 net/tls: Use socket data_ready callback on record availability On receipt of a complete tls record, use socket's saved data_ready callback instead of state_change callback. In function tls_queue(), the TLS record is queued in encrypted state. But the decryption happen inline when tls_sw_recvmsg() or tls_sw_splice_read() get invoked. So it should be ok to notify the waiting context about the availability of data as soon as we could collect a full TLS record. For new data availability notification, sk_data_ready callback is more appropriate. It points to sock_def_readable() which wakes up specifically for EPOLLIN event. This is in contrast to the socket callback sk_state_change which points to sock_def_wakeup() which issues a wakeup unconditionally (without event mask). Signed-off-by: Vakul Garg Signed-off-by: David S. Miller commit 86ed913b0e826da56aa780a3f5cfbbb02ed674a8 Author: Huaisheng Ye Date: Mon Jul 30 15:15:48 2018 +0800 filesystem-dax: Do not request kaddr and pfn when not required Some functions within fs/dax don't need to get local pointer kaddr or variable pfn from direct_access. Using NULL instead of having to pass in useless pointer or variable that caller then just throw away. Signed-off-by: Huaisheng Ye Reviewed-by: Ross Zwisler Signed-off-by: Dave Jiang commit f742267ae91faf241d2892878208dffc586ffe06 Author: Huaisheng Ye Date: Mon Jul 30 15:15:47 2018 +0800 md/dm-writecache: Don't request pointer dummy_addr when not required Function persistent_memory_claim doesn't need to get local pointer dummy_addr from direct_access. Using NULL instead of having to pass in a useless local pointer that caller then just throw away. Suggested-by: Ross Zwisler Signed-off-by: Huaisheng Ye Reviewed-by: Ross Zwisler Acked-by: Mike Snitzer Signed-off-by: Dave Jiang commit e0b401e3fef0f81fd87434793db1adb0d7568058 Author: Huaisheng Ye Date: Mon Jul 30 15:15:46 2018 +0800 dax/super: Do not request a pointer kaddr when not required Function __bdev_dax_supported doesn't need to get local pointer kaddr from direct_access. Using NULL instead of having to pass in a useless local pointer that caller then just throw away. Signed-off-by: Huaisheng Ye Reviewed-by: Ross Zwisler Signed-off-by: Dave Jiang commit 45df5d3dc0c7289c1e67afe6d2ba806ad5174314 Author: Huaisheng Ye Date: Mon Jul 30 15:15:45 2018 +0800 tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access() The mock / test version of pmem_direct_access() needs to check the validity of pointers kaddr and pfn for NULL assignment. If anyone equals to NULL, it doesn't need to calculate the value. If pointer equals to NULL, that is to say callers may have no need for kaddr or pfn, so this patch is prepared for allowing them to pass in NULL instead of having to pass in a local pointer or variable that they then just throw away. Suggested-by: Dan Williams Signed-off-by: Huaisheng Ye Reviewed-by: Ross Zwisler Signed-off-by: Dave Jiang commit 036a82ca90328960d66b7a5c0e1908475d534d62 Author: Huaisheng Ye Date: Mon Jul 30 15:15:44 2018 +0800 s390, dcssblk: kaddr and pfn can be NULL to ->direct_access() dcssblk_direct_access() needs to check the validity of pointers kaddr and pfn for NULL assignment. If anyone equals to NULL, it doesn't need to calculate the value. If either of them is equal to NULL, that is to say callers may have no need for kaddr or pfn, so this patch is prepared for allowing them to pass in NULL instead of having to pass in a pointer or local variable that they then just throw away. Signed-off-by: Huaisheng Ye Reviewed-by: Ross Zwisler Acked-by: Martin Schwidefsky Signed-off-by: Dave Jiang commit 46a590cde0bd17cc983e40e74c195311cc8ba555 Author: Huaisheng Ye Date: Mon Jul 30 15:15:43 2018 +0800 libnvdimm, pmem: kaddr and pfn can be NULL to ->direct_access() pmem_direct_access() needs to check the validity of pointers kaddr and pfn for NULL assignment. If anyone equals to NULL, it doesn't need to calculate the value. If pointer equals to NULL, that is to say callers may have no need for kaddr or pfn, so this patch is prepared for allowing them to pass in NULL instead of having to pass in a pointer or local variable that they then just throw away. Signed-off-by: Huaisheng Ye Reviewed-by: Ross Zwisler Signed-off-by: Dave Jiang commit 8f3f6500c74935bfe5a9067e3106b806f336facf Merge: c87fffc57adf e5cf1baf92cb Author: David S. Miller Date: Mon Jul 30 09:31:14 2018 -0700 Merge branch 'TC-refactor-act_mirred-packets-re-injection' Paolo Abeni says: ==================== TC: refactor act_mirred packets re-injection This series is aimed at improving the act_mirred redirect performances. Such action is used by OVS to represent TC S/W flows, and it's current largest bottle-neck is the need for a skb_clone() for each packet. The first 2 patches introduce some cleanup and safeguards to allow extending tca_result - we will use it to store RCU protected redirect information - and introduce a clear separation between user-space accessible tcfa_action values and internal values accessible only by the kernel. Then a new tcfa_action value is introduced: TC_ACT_REINJECT, similar to TC_ACT_REDIRECT, but preserving the mirred semantic. Such value is not accessible from user-space. The last patch exploits the newly introduced infrastructure in the act_mirred action, to avoid a skb_clone, when possible. Overall this the above gives a ~10% performance improvement in forwarding tput, when using the TC S/W datapath. v1 -> v2: - preserve the rcu lock in act_bpf - add and use a new action value to reinject the packets, preserving the mirred semantic v2 -> v3: - renamed to new action as TC_ACT_REINJECT - TC_ACT_REINJECT is not exposed to user-space v3 -> v4: - dropped the TC_ACT_REDIRECT patch - report failure via extack, too - rename the new action as TC_ACT_REINSERT - skip clone only if the control action don't touch tcf_result v4 -> v5: - fix a couple of build issue reported by kbuild bot - dont split messages ==================== Signed-off-by: David S. Miller commit e5cf1baf92cb785b90390db1c624948e70c8b8bd Author: Paolo Abeni Date: Mon Jul 30 14:30:45 2018 +0200 act_mirred: use TC_ACT_REINSERT when possible When mirred is invoked from the ingress path, and it wants to redirect the processed packet, it can now use the TC_ACT_REINSERT action, filling the tcf_result accordingly, and avoiding a per packet skb_clone(). Overall this gives a ~10% improvement in forwarding performance for the TC S/W data path and TC S/W performances are now comparable to the kernel openvswitch datapath. v1 -> v2: use ACT_MIRRED instead of ACT_REDIRECT v2 -> v3: updated after action rename, fixed typo into the commit message v3 -> v4: updated again after action rename, added more comments to the code (JiriP), skip the optimization if the control action need to touch the tcf_result (Paolo) v4 -> v5: fix sparse warning (kbuild bot) Signed-off-by: Paolo Abeni Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit cd11b164073b719203318227918f9510809d5e10 Author: Paolo Abeni Date: Mon Jul 30 14:30:44 2018 +0200 net/tc: introduce TC_ACT_REINSERT. This is similar TC_ACT_REDIRECT, but with a slightly different semantic: - on ingress the mirred skbs are passed to the target device network stack without any additional check not scrubbing. - the rcu-protected stats provided via the tcf_result struct are updated on error conditions. This new tcfa_action value is not exposed to the user-space and can be used only internally by clsact. v1 -> v2: do not touch TC_ACT_REDIRECT code path, introduce a new action type instead v2 -> v3: - rename the new action value TC_ACT_REINJECT, update the helper accordingly - take care of uncloned reinjected packets in XDP generic hook v3 -> v4: - renamed again the new action value (JiriP) v4 -> v5: - fix build error with !NET_CLS_ACT (kbuild bot) Signed-off-by: Paolo Abeni Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 7fd4b288ea6a3e45ad8afbcd5ec39554d57f1ae0 Author: Paolo Abeni Date: Mon Jul 30 14:30:43 2018 +0200 tc/act: remove unneeded RCU lock in action callback Each lockless action currently does its own RCU locking in ->act(). This allows using plain RCU accessor, even if the context is really RCU BH. This change drops the per action RCU lock, replace the accessors with the _bh variant, cleans up a bit the surrounding code and documents the RCU status in the relevant header. No functional nor performance change is intended. The goal of this patch is clarifying that the RCU critical section used by the tc actions extends up to the classifier's caller. v1 -> v2: - preserve rcu lock in act_bpf: it's needed by eBPF helpers, as pointed out by Daniel v3 -> v4: - fixed some typos in the commit message (JiriP) Signed-off-by: Paolo Abeni Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 802bfb19152c0fb4137c6ba72bcf042ee023e743 Author: Paolo Abeni Date: Mon Jul 30 14:30:42 2018 +0200 net/sched: user-space can't set unknown tcfa_action values Currently, when initializing an action, the user-space can specify and use arbitrary values for the tcfa_action field. If the value is unknown by the kernel, is implicitly threaded as TC_ACT_UNSPEC. This change explicitly checks for unknown values at action creation time, and explicitly convert them to TC_ACT_UNSPEC. No functional changes are introduced, but this will allow introducing tcfa_action values not exposed to user-space in a later patch. Note: we can't use the above to hide TC_ACT_REDIRECT from user-space, as the latter is already part of uAPI. v3 -> v4: - use an helper to check for action validity (JiriP) - emit an extack for invalid actions (JiriP) v4 -> v5: - keep messages on a single line, drop net_warn (Marcelo) Signed-off-by: Paolo Abeni Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 5da08f7d01693433ff6bea0c3462a5173d577540 Merge: 87ea58433208 ec403d8ed08c Author: James Morris Date: Mon Jul 30 09:30:19 2018 -0700 Merge tag 'tpmdd-next-20180728' of git://git.infradead.org/users/jjs/linux-tpmdd into next-tpm tpmdd updates for Linux 4.19 From Jarkko: * Migrated away from PM runtime as explicit cmdReady/goIdle trasactions for every command is a spec requirement. PM runtime adds only a layer of complexity on our case. * tpm_tis drivers can now specify the hwrng quality. * TPM 2.0 code uses now tpm_buf for constructing messages. I think Tomas Winkler has done the same for TPM 1.2. I'll start digging those changes from the patchwork in the near future. * Bug fixes and clean ups. commit c87fffc57adf7b772b3778a9521c3f2ff744ae82 Author: YueHaibing Date: Mon Jul 30 19:03:41 2018 +0800 liquidio: remove redundant function cn23xx_dump_iq_regs There are no in-tree callers of cn23xx_dump_iq_regs. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit b0a0381987dd2be9eb95f7415b110dbb0a7dbe4a Merge: 3f6bcc5162a1 a331de3bf0e6 Author: David S. Miller Date: Mon Jul 30 09:10:25 2018 -0700 Merge branch 'socket-poll-related-cleanups-v2' Christoph Hellwig says: ==================== socket poll related cleanups v2 A couple of cleanups I stumbled upon when studying the networking poll code. Changes since v1: - drop a dispute patch from this series (to be sent separately) ==================== Signed-off-by: David S. Miller commit a331de3bf0e66ab2437fc8c5b99bd3c0d9da3088 Author: Christoph Hellwig Date: Mon Jul 30 09:42:13 2018 +0200 net: remove sock_poll_busy_flag Fold it into the only caller to make the code simpler and easier to read. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit f641f13b992979b97e595b761a9ba1a64fed7c4e Author: Christoph Hellwig Date: Mon Jul 30 09:42:12 2018 +0200 net: remove sock_poll_busy_loop There is no point in hiding this logic in a helper. Also remove the useless events != 0 check and only busy loop once we know we actually have a poll method. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit d8bbd13beeaacd6494954bf5b945b54ccb2af309 Author: Christoph Hellwig Date: Mon Jul 30 09:42:11 2018 +0200 net: don not detour through struct sock to find the poll waitqueue For any open socket file descriptor sock->sk->sk_wq->wait will always point to sock->wq->wait. That means we can do the shorter dereference and removal a NULL check and don't have to not worry about any RCU protection. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit dd979b4df817e9976f18fb6f9d134d6bc4a3c317 Author: Christoph Hellwig Date: Mon Jul 30 09:42:10 2018 +0200 net: simplify sock_poll_wait The wait_address argument is always directly derived from the filp argument, so remove it. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller commit 63c8ecb6261abcb79191a264778e8dae222e67cf Author: Andy Grover Date: Fri Jul 27 15:51:57 2018 -0700 dm thin: include metadata_low_watermark threshold in pool status The metadata low watermark threshold is set by the kernel. But the kernel depends on userspace to extend the thinpool metadata device when the threshold is crossed. Since the metadata low watermark threshold is not visible to userspace, upon receiving an event, userspace cannot tell that the kernel wants the metadata device extended, instead of some other eventing condition. Making it visible (but not settable) enables userspace to affirmatively know the kernel is asking for a metadata device extension, by comparing metadata_low_watermark against nr_free_blocks_metadata, also reported in status. Current solutions like dmeventd have their own thresholds for extending the data and metadata devices, and both devices are checked against their thresholds on each event. This lessens the value of the kernel-set threshold, since userspace will either extend the metadata device sooner, when receiving another event; or will receive the metadata lowater event and do nothing, if dmeventd's threshold is less than the kernel's. (This second case is dangerous. The metadata lowater event will not be re-sent, so no further event will be generated before the metadata device is out if space, unless some other event causes userspace to recheck its thresholds.) Signed-off-by: Andy Grover Signed-off-by: Mike Snitzer commit 4e133828e2ca6de5b7563842817a65836a45f63f Author: Vincent Prince Date: Mon Jul 30 11:30:25 2018 +0200 gpio-it87: add support for IT8786E Super I/O From the datasheet, the GPIO interface is identical to IT8728 (same description), so just add it to the same case as the other chip. Signed-off-by: Vincent Prince Signed-off-by: Linus Walleij commit baec8eb323cd59d1bfe148a287610819d5897838 Author: Ionela Voinescu Date: Sun Jul 22 23:20:06 2018 +0200 spi: img-spfi: Set device select bits for SPFI port state Even if the chip select line is not controlled by the SPFI hardware, the device select bits need to be set to specify the chip select line in use for the hardware to know what parameters to use for the current transfer. Signed-off-by: Ionela Voinescu Signed-off-by: Andreas Färber Signed-off-by: Mark Brown commit 45e41bc5259242921da755c60c705ff368beb8ce Author: Colin Ian King Date: Mon Jul 30 15:45:46 2018 +0100 spi: omap2-mcspi: remove several redundant variables Variable count, l, mcspi and spi_cntrl are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'count' set but not used [-Wunused-but-set-variable] warning: variable 'l' set but not used [-Wunused-but-set-variable] warning: variable 'mcspi' set but not used [-Wunused-but-set-variable] warning: variable 'spi_cntrl' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Mark Brown commit 57cb198cfdd2e666a8dc2b7e5df6d2708191eddb Author: Janosch Frank Date: Fri Jul 20 13:51:21 2018 +0100 KVM: s390: Beautify skey enable check Let's introduce an explicit check if skeys have already been enabled for the vcpu, so we don't have to check the mm context if we don't have the storage key facility. This lets us check for enablement without having to take the mm semaphore and thus speedup skey emulation. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Acked-by: Farhan Ali Signed-off-by: Christian Borntraeger commit 51d626903083f7bd651d38b031775740ed41758c Author: Christoph Hellwig Date: Tue Jul 17 16:51:51 2018 -0700 xfs: introduce a new xfs_inode_has_cow_data helper We have a few places that already check if an inode has actual data in the COW fork to avoid work on reflink inodes that do not actually have outstanding COW blocks. There are a few more places that can avoid working if doing the same check, so add a documented helper for this condition and use it in all places where it makes sense. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3ba738df25239f877f6a98ce1cc925fa7e924cd3 Author: Christoph Hellwig Date: Tue Jul 17 16:51:50 2018 -0700 xfs: remove the xfs_ifork_t typedef We only have a few more callers left, so seize the opportunity and kill it off. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1216b58b353fbf5529454b442cebb3c8f14d93da Author: Christoph Hellwig Date: Tue Jul 17 16:51:50 2018 -0700 xfs: simplify xfs_idata_realloc Streamline the code and take advantage of the fact that kmem_realloc through krealloc will be have like a normal allocation if passing in a NULL old pointer. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fcacbc3f511338842dd177e2d53d457f9741543b Author: Christoph Hellwig Date: Tue Jul 17 16:51:50 2018 -0700 xfs: remove if_real_bytes The field is only used for asserts, and to track if we really need to do realloc when growing the inode fork data. But the krealloc function already performs this check internally, so there is no need to keep track of the real allocation size. This will free space in the inode fork for keeping a sequence counter of changes to the extent list. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d0db2f7a02e45dd4791b70404bd90874b20c38a4 Author: Lorenzo Bianconi Date: Thu Jul 12 10:50:01 2018 +0200 mt76x2: fix CCK protection control frame rate Use 11M as tx rate for CCK protection control frames Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e") Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit f24909ab394347e7a3f329ad5c93f470a1d238a9 Author: Lorenzo Bianconi Date: Wed Jul 11 22:02:22 2018 +0200 mt76x2: add frame protection support Introduce mac80211 rts threshold handler in order to add frame protection support to mt76x2 driver Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 53c2cb8df3278481006255660ffc571ff4c5e0f1 Author: Davide Caratti Date: Mon Jul 9 12:20:27 2018 +0200 mt7601u: expose 802.11w support Set MFP_CAPABLE bit in hw flag capabilities exported by the driver Signed-off-by: Davide Caratti Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 03d677c50ad7da146571504f25260da61f4158ad Author: Lorenzo Bianconi Date: Mon Jul 9 12:20:26 2018 +0200 mt7601u: use sw encryption for hw unsupported ciphers Fall back to software encryption for hw unsupported ciphers in order to enable 802.11w Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 54648cf1ec2d7f4b6a71767799c45676a138ca24 Author: xiao jin Date: Mon Jul 30 14:11:12 2018 +0800 block: blk_init_allocated_queue() set q->fq as NULL in the fail case We find the memory use-after-free issue in __blk_drain_queue() on the kernel 4.14. After read the latest kernel 4.18-rc6 we think it has the same problem. Memory is allocated for q->fq in the blk_init_allocated_queue(). If the elevator init function called with error return, it will run into the fail case to free the q->fq. Then the __blk_drain_queue() uses the same memory after the free of the q->fq, it will lead to the unpredictable event. The patch is to set q->fq as NULL in the fail case of blk_init_allocated_queue(). Fixes: commit 7c94e1c157a2 ("block: introduce blk_flush_queue to drive flush machinery") Cc: Reviewed-by: Ming Lei Reviewed-by: Bart Van Assche Signed-off-by: xiao jin Signed-off-by: Jens Axboe commit f7f1fc363aab4601786d373569c1ae802ea593d0 Author: Max Gurtovoy Date: Mon Jul 30 00:15:33 2018 +0300 nvme: use blk API to remap ref tags for IOs with metadata Also moved the logic of the remapping to the nvme core driver instead of implementing it in the nvme pci driver. This way all the other nvme transport drivers will benefit from it (in case they'll implement metadata support). Suggested-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Keith Busch Signed-off-by: Max Gurtovoy Signed-off-by: Jens Axboe commit 10c41ddd61323b27b447bc8e18296ac6c06107ad Author: Max Gurtovoy Date: Mon Jul 30 00:15:32 2018 +0300 block: move dif_prepare/dif_complete functions to block layer Currently these functions are implemented in the scsi layer, but their actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Also, use the tuple size from the integrity profile since it may vary between integrity types. Suggested-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Signed-off-by: Max Gurtovoy Signed-off-by: Jens Axboe commit ddd0bc756983dc4d19000a4fe021b4c7f9d59aab Author: Max Gurtovoy Date: Mon Jul 30 00:15:31 2018 +0300 block: move ref_tag calculation func to the block layer Currently this function is implemented in the scsi layer, but it's actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Suggested-by: Christoph Hellwig Cc: Martin K. Petersen Signed-off-by: Max Gurtovoy Signed-off-by: Jens Axboe commit c454edc21b12dd7d416de6c81555e87aaec9685c Author: Josef Bacik Date: Mon Jul 30 10:10:01 2018 -0400 block: don't account for split bio's size in cgroup stats We need to check in blkcg_bio_issue_check if the bio is flagged as QUEUE_ENTERED, because if it is then we've already accounted for the size of the IO in the cgroup stats. We can still however account for the extra IO since it'll be another request. Reported-by: Tejun Heo Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit ea8532daee31bc72abfbc9ca7a43cbec0f6c05af Author: Mauro Carvalho Chehab Date: Wed May 30 11:07:05 2018 -0400 media: videodev2: get rid of VIDIOC_RESERVED While this ioctl is there at least since Kernel 2.6.12-rc2, it was never used by any upstream driver. Get rid of it. Signed-off-by: Mauro Carvalho Chehab commit 8f1180e08ed436fcf3be290e9cf408e9bdb60664 Author: Andrey Shevchenko Date: Thu May 31 12:11:00 2018 +0300 qtnfmac: enable multiple SSIDs scan support Enable support for multiple SSIDs scans. Get max number of supported SSIDs from firmware and report to cfg80211 core. Signed-off-by: Andrey Shevchenko Signed-off-by: Kalle Valo commit 4775ad06b56a151a32b1006accb62f43698c0872 Author: Sergei Maksimenko Date: Thu May 31 12:10:59 2018 +0300 qtnfmac: implement cfg80211 power management callback Implement set_power_mgmt() callback that forwards power saving settings to the device firmware. Signed-off-by: Sergei Maksimenko Signed-off-by: Kalle Valo commit b1a9585cc396cac5a9e5a09b2721f3b8568e62d0 Author: Srinivas Pandruvada Date: Fri Jul 27 13:47:03 2018 -0700 ata: ahci: Enable DEVSLP by default on x86 with SLP_S0 One of the requirement for modern x86 system to enter lowest power mode (SLP_S0) is SATA IP block to be off. This is true even during when platform is suspended to idle and not only in opportunistic (runtime) suspend. Several of these system don't have traditional ACPI S3, so it is important that they enter SLP_S0 state, to avoid draining battery even during suspend. So it is important that out of the box Linux installation reach this state. SATA IP block doesn't get turned off till SATA is in DEVSLP mode. Here user has to either use scsi-host sysfs or tools like powertop to set the sata-host link_power_management_policy to min_power. This change sets by default link power management policy to min_power with partial (preferred) or slumber support on idle for some platforms. To avoid regressions, the following conditions are used: - User didn't override the policy from module parameter - The kernel config is already set to use med_power_with_dipm or deeper - System is a SLP_S0 capable using ACPI low power idle flag This combination will make sure that systems are fairly recent and since getting shipped with SLP_S0 support, the DEVSLP function is already validated. Signed-off-by: Srinivas Pandruvada Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit a5ec5a7bfd1f28d1905499641c9f589be36808c1 Author: Srinivas Pandruvada Date: Fri Jul 27 13:47:02 2018 -0700 ata: ahci: Support state with min power but Partial low power state Currently when min_power policy is selected, the partial low power state is not entered and link will try aggressively enter to only slumber state. Add a new policy which still enable DEVSLP but also try to enter partial low power state. This policy is presented as "min_power_with_partial". For information the difference between partial and slumber Partial – PHY logic is powered up, and in a reduced power state. The link PM exit latency to active state maximum is 10 ns. Slumber – PHY logic is powered up, and in a reduced power state. The link PM exit latency to active state maximum is 10 ms. Devslp – PHY logic is powered down. The link PM exit latency from this state to active state maximum is 20 ms, unless otherwise specified by DETO. Suggested-and-reviewed-by: Hans de Goede Signed-off-by: Srinivas Pandruvada Signed-off-by: Tejun Heo commit 157eb9a0b75e97ad390c6e50c7381b0a0e02fe97 Author: Robert Schlabbach Date: Sat Jun 16 15:04:22 2018 -0400 media: em28xx: explicitly disable TS packet filter The em28xx driver never touched the EM2874 register bits that control the transport stream packet filters, leaving them at whatever default the firmware has set. E.g. the Pinnacle 290e disables them by default, while the Hauppauge WinTV dualHD enables discarding NULL packets by default. However, some applications require NULL packets, e.g. to determine the load in DOCSIS segments, so discarding NULL packets is undesired for such applications. This patch simply extends the bit mask when starting or stopping the transport stream packet capture, so that the filter bits are cleared. It has been verified that this makes the Hauppauge WinTV dualHD pass an unfiltered DVB-C stream including NULL packets, which it didn't before. Signed-off-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab commit 0ad641919ce9f2f0c3b4bf0ce56646716bdec594 Merge: bf9b608e63df 1a4968d1230c Author: Kalle Valo Date: Mon Jul 30 16:36:13 2018 +0300 Merge tag 'iwlwifi-next-for-kalle-2018-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next First batch of iwlwifi patches for 4.19 * Implement 802.11ax D2.0; * Changes in the base code to support the new 22560 devices; * Support for the new 22560 device family; commit 6f2c73c124b14808d210722fd1c0c8938f9db3ba Author: Lorenzo Pieralisi Date: Mon Jul 30 13:09:56 2018 +0100 PCI: mobiveil: Add Kconfig/Makefile entries commit 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") did not add the configuration and build infrastructure to configure and build the mobiveil controller driver, so at present the driver code is in the kernel but cannot be compiled. Add the mobiveil controller driver Kconfig/Makefile infrastructure. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Subrahmanya Lingappa commit d3743012230f8dab30d47caba1f2ee9e382385e7 Author: Lorenzo Pieralisi Date: Mon Jul 30 13:24:33 2018 +0100 PCI: mobiveil: Add missing ../pci.h include PCI mobiveil host controller driver currently fails to compile with the following error: drivers/pci/controller/pcie-mobiveil.c: In function 'mobiveil_pcie_probe': drivers/pci/controller/pcie-mobiveil.c:788:8: error: implicit declaration of function 'devm_of_pci_get_host_bridge_resources'; did you mean 'pci_get_host_bridge_device'? [-Werror=implicit-function-declaration] ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pci_get_host_bridge_device Add the missing include file to pull in the required function declaration. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Subrahmanya Lingappa commit af3f606e0bbb6d811c50b7b90fe324b07fb7cab8 Author: Lorenzo Pieralisi Date: Mon Jul 30 13:24:12 2018 +0100 PCI: mobiveil: Fix struct mobiveil_pcie.pcie_reg_base address type The field pcie_reg_base in struct mobiveil_pcie represents a physical address so it should be of phys_addr_t type rather than void __iomem*; this results in the following compilation warnings: drivers/pci/controller/pcie-mobiveil.c: In function 'mobiveil_pcie_parse_dt': drivers/pci/controller/pcie-mobiveil.c:326:22: warning: assignment makes pointer from integer without a cast [-Wint-conversion] pcie->pcie_reg_base = res->start; ^ drivers/pci/controller/pcie-mobiveil.c: In function 'mobiveil_pcie_enable_msi': drivers/pci/controller/pcie-mobiveil.c:485:25: warning: initialization makes integer from pointer without a cast [-Wint-conversion] phys_addr_t msg_addr = pcie->pcie_reg_base; ^~~~ drivers/pci/controller/pcie-mobiveil.c: In function 'mobiveil_compose_msi_msg': drivers/pci/controller/pcie-mobiveil.c:640:21: warning: initialization makes integer from pointer without a cast [-Wint-conversion] phys_addr_t addr = pcie->pcie_reg_base + (data->hwirq * sizeof(int)); Fix the type and with it the compilation warnings. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Subrahmanya Lingappa commit 479af3216315b239eea87a859ece0d29d27b98f9 Author: Kuninori Morimoto Date: Mon Jul 30 07:58:55 2018 +0000 usb: renesas_usbhs: Kconfig: convert to SPDX identifiers By default all files without license information are under the default license of the kernel, which is GPL version 2. Signed-off-by: Kuninori Morimoto Signed-off-by: Greg Kroah-Hartman commit 410e8b4f5ca34e026ffc460a86e2354febe06fac Author: Matti Vaittinen Date: Mon Jul 30 14:50:08 2018 +0300 regulator: bd71837: adobt MFD changes to regulator driver MFD part for bd71837 was changed during the review. Clean regulator part to match changed MFD: - renamed header file => fix include - remove unused platdata as also type definition was removed - Kconfig option for MFD part was changed => fix depends on clause - Rename Kconfig option for regulators As Kconfig option for regulators gets now used (when dependency to MFD is satisfied) change it so that it won't require new change when support for bd71847 is added. Signed-off-by: Matti Vaittinen Signed-off-by: Mark Brown commit ed9067fd5f299db7110861a0434d0e2ffb961649 Author: Ulf Hansson Date: Fri Jul 13 13:15:23 2018 +0200 mmc: mmci: Initial support to manage variant specific callbacks To be able to better support different mmci variants, we need to be able to use variant specific callbacks, rather than continue to sprinkle the code with additional variant data. To move in this direction, let's add an optional ->init() callback to the variant data struct, which variants shall use to assign the mmci_host_ops pointer. Using an ->init() callback enables us to partition the code between different files. To allow separate mmci variant files to implement the variant specifics, let's also move the definition of the struct variant_data to the common mmci header file. Signed-off-by: Ulf Hansson Reviewed-by: Ludovic Barre Acked-by: Linus Walleij commit 57d1654ec96a49f5a093f9cbe40718c92ab5daa0 Author: Aapo Vienamo Date: Mon Jul 16 17:34:29 2018 +0300 mmc: tegra: Force correct divider calculation on DDR50/52 Tegra SDHCI controllers require the SDHCI clock divider to be configured to divide the clock by two in DDR50/52 modes. Incorrectly configured clock divider results in corrupted data. Prevent the possibility of incorrectly calculating the divider value due to clock rate rounding or low parent clock frequency by not assigning host->max_clk to clk_get_rate() on tegra_sdhci_set_clock(). See the comments for further details. Fixes: a8e326a ("mmc: tegra: implement module external clock change") Signed-off-by: Aapo Vienamo Acked-by: Jon Hunter Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 89b4ab213feb11a5bece544cfa12374f66c2c47c Author: Takashi Iwai Date: Mon Jul 30 14:48:29 2018 +0200 ALSA: seq: virmidi: Use READ_ONCE/WRITE_ONCE() macros The trigger flag in vmidi object can be referred in different contexts concurrently, hence it's better to be put with READ_ONCE() and WRITE_ONCE() macros to assure the accesses. Signed-off-by: Takashi Iwai commit 8d9404ad6a6dbcca36a788049f716675a1110da8 Author: Akihiro Tsukada Date: Sun Jun 10 10:59:31 2018 -0400 MAINTAINERS: add entries for several media drivers add entries for the following drivers: - earth_pt{1,3} DVB adapter drivers - mxl301rf DVB tuner drivers - qm1d1{b0004, c0042} DVB tuner drivers - tc90522 DVB demod driver Signed-off-by: Akihiro Tsukada Signed-off-by: Mauro Carvalho Chehab commit f7debfe54090d1a1c38e1f070be20d83bb70a8e0 Author: Takashi Iwai Date: Sun Jul 29 23:03:05 2018 +0200 ALSA: seq: virmidi: Offload the output event processing The virmidi sequencer stuff tries to translate the rawmidi bytes to sequencer events and deliver the packets at trigger callback. The amount of the whole process of these translations and deliveries depends on the incoming rawmidi bytes, and we have no limit for that; this was the cause of a CPU soft lockup that had been reported and fixed recently. Although we've fixed the soft lockup by putting the temporary unlock and cond_resched(), it's rather a quick band aid. In this patch, meanwhile, the event parsing and delivery process is offloaded to a dedicated work, and the trigger callback just kicks it off. It has three merits, at least: - The processing is always done in a sleepable context, which can assure the event delivery with non-atomic flag without hackish is_atomic() usage. - Other relevant codes can be simplified, reducing the lines - It makes me happier Signed-off-by: Takashi Iwai commit 44e2971f9e50aadb8d62eafbe31df014ef55d618 Author: Akihiro Tsukada Date: Sun Jun 10 10:58:02 2018 -0400 media: pci/pt1: suppress compiler warning in xtensa arch Found and reported by kbuild test robot: Message ID: <201805052003.MC007f9h%fengguang.wu@intel.com> and holding an address of an empty struct in .driver.pm does no harm when CONFIG_PM_SLEEP is not defined. Signed-off-by: Akihiro Tsukada Signed-off-by: Mauro Carvalho Chehab commit f917fc0e9b9988982a841b871655cc41bde1e10e Author: Akihiro Tsukada Date: Sun Jun 10 10:49:15 2018 -0400 media: dvb-frontends/dvb-pll: fix module ref-counting dvb-pll module was 'put' twice on exit: once by dvb_frontend_detach() and another by dvb_module_release(). Signed-off-by: Akihiro Tsukada Signed-off-by: Mauro Carvalho Chehab commit b30cc07de8a903685441f9770b1b21e1422d2468 Author: Akihiro Tsukada Date: Sun Jun 10 10:45:31 2018 -0400 media: dvb-usb/friio, dvb-usb-v2/gl861: decompose friio and merge with gl861 Friio device contains "gl861" bridge and "tc90522" demod, for which the separate drivers are already in the kernel. But friio driver was monolithic and did not use them, practically copying those features. This patch decomposes friio driver into sub drivers and re-uses existing ones, thus reduces some code. It adds some features to gl861, to support the friio-specific init/config of the devices and implement i2c communications to the tuner via demod with USB vendor requests. [mchehab+samsung@kernel.org: fix merge conflicts] Signed-off-by: Akihiro Tsukada Signed-off-by: Mauro Carvalho Chehab commit a7663a79343658f9362dc0655f1a06723c7014e3 Author: Jeykumar Sankaran Date: Fri Jul 20 16:43:09 2018 -0400 dt-bindings: msm/disp: Add bindings for Snapdragon 845 DPU Adds bindings for Snapdragon 845 display processing unit Changes in v2: - Use SoC specific compatibles for mdss and dpu (Rob Herring) - Use assigned-clocks to set initial clock frequency (Rob Herring) Changes in v3 (all suggested by Rob Herring): - Rename mdss_phys to mdss - Correct description for clocks/assigned-clocks - Rename mdp_phys to mdp - Rename vbif_phys to vbif - Remove redundant interrupt-parent from mdss_mdp - Fully specify 'ranges' and use relative reg address in mdss_mdp Cc: Rob Herring Signed-off-by: Jeykumar Sankaran Signed-off-by: Rajesh Yadav Signed-off-by: Sean Paul Reviewed-by: Rob Herring Signed-off-by: Rob Clark commit 6b0a180ede4884ea5cdd30ca939ddf43ef11cdac Author: Jeykumar Sankaran Date: Fri Jul 20 16:42:52 2018 -0400 dt-bindings: msm/dsi: Add mdp transfer time to msm dsi binding Adds mdp transfer time to msm dsi binding Changes in v3: - Added Rob's R-b Reviewed-by: Rob Herring Signed-off-by: Jeykumar Sankaran Signed-off-by: Rajesh Yadav Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit fba33cae6aa3eaa3627a603d62d4652f12308b8d Author: Jordan Crouse Date: Thu Jul 26 14:30:14 2018 -0600 drm/msm/disp/dpu: Mark a handful of functions as static Mark a number of static functions that are only unsed in the file that defines them and remove the prototypes from the headers where needed. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit f2c9a924c1acf42f692f2b5ac77531eea69460a3 Author: Jordan Crouse Date: Thu Jul 26 14:30:13 2018 -0600 drm/msm/disp/dpu: Remove unused functions from dpu_formats.c Remove dpu_format_get_block_size, dpu_format_get_framebuffer_size, dpu_set_scaler_v2 and dpu_copy_formats they are unused and unneeded. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit d9c7440dad0d85b29325d89956411e2c57e7d17a Author: Jordan Crouse Date: Thu Jul 26 14:30:12 2018 -0600 drm/msm/disp/dpu: Remove dpu_kms_utils None of the functions in dpu_kms_utils.c seem to be used so remove them all. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit c17aeda0b01cbcb8e334665fefa64a5148ecd18f Author: Jordan Crouse Date: Thu Jul 26 14:30:11 2018 -0600 drm/msm/disp/dpu: Remove unused code from drm_crtc.c Remove a chunk of unused code from drm_crtc.c, namely dpu_crtc_res_add, dpu_crtc_res_get, dpu_crtc_res_put and associated static functions. Also zap dpu_crtc_event_queue(), helper functions and members. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 2c7b48e7267adb0b79a0785563eaa69a35632155 Author: Jordan Crouse Date: Thu Jul 26 14:30:10 2018 -0600 drm/msm/disp/dpu: Remove unused code from drm_encoder.c Remove dpu_encoder_check_mode and dpu_encoder_helper_hw_release frmo drm_encoder.c as they appear to be unused. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit aff24cd1f531b0dd55e46f6a8f76cf44117f0a24 Author: Gustavo A. R. Silva Date: Mon Jul 23 13:46:55 2018 -0500 drm/msm: Replace PTR_RET with PTR_ERR_OR_ZERO PTR_RET is deprecated, use PTR_ERR_OR_ZERO instead. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Rob Clark commit 78918cd0eee346c43e2d9dc553fadfacad6cb488 Author: Arnd Bergmann Date: Tue Jul 24 17:35:37 2018 +0200 drm/msm: mark PM functions as __maybe_unused The suspend/resume functions are not referenced when power management is disabled: drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c:1288:12: error: 'dpu_runtime_resume' defined but not used [-Werror=unused-function] drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c:1261:12: error: 'dpu_runtime_suspend' defined but not used [-Werror=unused-function] This marks them as __maybe_unused to let the compiler drop the functions without complaining. Fixes: 591225291ca2 ("drm/msm: Add SDM845 DPU support") Signed-off-by: Arnd Bergmann Signed-off-by: Rob Clark commit f4b0f66daf77ac79807711310597e4c102f72bd8 Author: zhong jiang Date: Tue Jul 24 19:51:59 2018 +0800 drm/msm/dpu: fix mismatch in function argument. Fix the sparse error. the dpu_rm_init declaration is not consistent with the implement. Signed-off-by: zhong jiang [robclark un-typo'd subject line] Signed-off-by: Rob Clark commit 3530a17f4dc8f1f667fee14c16f229162daa79bb Author: Arnd Bergmann Date: Thu Jul 26 14:39:25 2018 +0200 drm/msm/gpu: avoid deprecated do_gettimeofday All users of do_gettimeofday() have been removed, but this one recently crept in, along with an incorrect printing of the microseconds portion. This converts it to using ktime_get_real_timespec64() as a direct replacement, and adds the leading zeroes. I considered using monotonic times (ktime_get()) instead, but as this timestamp appears to only be used for humans rather than compared with other timestamps, the real time domain is probably good enough. Fixes: e43b045e2c82 ("drm/msm/gpu: Capture the state of the GPU") Signed-off-by: Arnd Bergmann Signed-off-by: Rob Clark commit a6bcddbc2ee1b2797fce016775b9e3faf17a4d0e Author: Sean Paul Date: Wed Jul 25 16:34:45 2018 -0400 drm/msm: dsi: Handle dual-channel for 6G as well This fixes up a collision between introducing dual-channel support and the dsi refactors. This patch applies the same dual-channel considerations and pclk calculations to both v2 and 6G, with a bit of abstracting for good measure. Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 41a8e8865a82b4fd4ff62b43b7c6d3bc5831f93d Author: Sean Paul Date: Wed Jul 25 16:34:44 2018 -0400 drm/msm: dpu: Use clock-names instead of assigned-clock-names In these cases, we want to enumerate _all_ clocks, not just the ones that are assigned a rate. Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 2c1f748d00e0617799c5bdbe9daf3a6a887b1b84 Author: Sean Paul Date: Wed Jul 25 16:34:43 2018 -0400 drm/msm: dpu: Use 'vsync' instead of 'vsync_clk' in cmdmode encoder Should work with the legacy handling in of, but we shouldn't rely on that. Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit cdb95931dea32981545e34a3b1dfc9e172425d95 Author: Jordan Crouse Date: Tue Jul 24 10:33:31 2018 -0600 drm/msm/gpu: Add the buffer objects from the submit to the crash dump For hangs, dump copy out the contents of the buffer objects attached to the guilty submission and print them in the crash dump report. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 50f8d21863b9b774b198e631d2b14878f6a54b5b Author: Jordan Crouse Date: Tue Jul 24 10:33:30 2018 -0600 drm/msm/adreno: Add a5xx specific registers for the GPU state HLSQ, SP and TP registers are only accessible from a special aperture and to make matters worse the aperture is blocked from the CPU on targets that can support secure rendering. Luckily the GPU hardware has its own purpose built register dumper that can access the registers from the aperture. Add a5xx specific code to program the crashdumper and retrieve the wayward registers and dump them for the crash state. Also, remove a block of registers the regular CPU accessible list that aren't useful for debug which helps reduce the size of the crash state file by a goodly amount. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 43a56687d15db09f3cf7b9d53b182bdef86c17c0 Author: Jordan Crouse Date: Tue Jul 24 10:33:29 2018 -0600 drm/msm/adreno: Add ringbuffer data to the GPU state Add the contents of each ringbuffer to the GPU state and dump the data in the crash file encoded with ascii85. To save space only the used portions of the ringbuffer are dumped. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit bcf1d9fa5d03c1e86733411b5dc3a76ba7d75e6e Author: Jordan Crouse Date: Tue Jul 24 10:33:28 2018 -0600 drm/msm/adreno: Convert the show/crash file format Convert the format of the 'show' debugfs file and the crash dump to a format resembling YAML. This should be easier to parse and be more flexible for future changes and expansions. v2: Use a standard .rst for the msm crashdump documentation Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit c0fec7f562ec76404ef0f074a89113a703587f3d Author: Jordan Crouse Date: Tue Jul 24 10:33:27 2018 -0600 drm/msm/gpu: Capture the GPU state on a GPU hang Capture the GPU state on a GPU hang and store it for later playback via the devcoredump facility. Only one crash state is stored at a time on the assumption that the first hang is usually the most interesting. The existing crash state can be cleared after capturing it and then a new one will be captured on the next hang. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 65a3c2748e882da03102369edb6991e1dd88456e Author: Jordan Crouse Date: Tue Jul 24 10:33:26 2018 -0600 drm/msm/gpu: Rearrange the code that collects the task during a hang Do a bit of cleanup to prepare for upcoming changes to pass the hanging task comm and cmdline to the crash dump function. v2: Use GFP_ATOMIC while holding the rcu lock per Chris Wilson Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 4f776f4511c7f7b6576dfc38c609b168b9188d72 Author: Jordan Crouse Date: Tue Jul 24 10:33:25 2018 -0600 drm/msm/gpu: Convert the GPU show function to use the GPU state Convert the existing GPU show function to use the GPU state to dump the information rather than reading it directly from the hardware. This will require an additional step to capture the state before dumping it for the existing nodes but it will greatly facilitate reusing the same code for dumping a previously captured state from a GPU hang. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit e00e473d9817e03cddbaf181a491c42ae8373482 Author: Jordan Crouse Date: Tue Jul 24 10:33:24 2018 -0600 drm/msm/gpu: Capture the state of the GPU Add the infrastructure to capture the current state of the GPU and store it in memory so that it can be dumped later. For now grab the same basic ringbuffer information and registers that are provided by the debugfs 'gpu' node but obviously this should be extended to capture a much larger set of GPU information. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 5dc634bdbfd6dd9bdf98bce0d6f64878e1d47b1f Author: Jordan Crouse Date: Tue Jul 24 10:33:23 2018 -0600 drm: Add puts callback for the coredump printer Add a puts function for the coredump printer to bypass printf() for constant strings for a speed boost. Reorganize the coredump printf callback to share as much code as possible. v2: Try to reuse code between print and puts as suggested by Chris Wilson Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 4538d7324507fed892a18b79ad72c8501b6e7027 Author: Jordan Crouse Date: Tue Jul 24 10:33:22 2018 -0600 drm: Add a -puts() function for the seq_file printer Add a puts() function to use seq_puts() to help speed up up print time for constant strings. Reviewed-by: Daniel Vetter Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 63f4cc015b66dd265c2fd6e7c94be1b9a3b72267 Author: Jordan Crouse Date: Tue Jul 24 10:33:21 2018 -0600 drm: Add drm_puts() to complement drm_printf() Add drm_puts() for a much faster path to print constant strings into a drm_printer object with memcpy and friends. This can have seconds off of really large outputs such as GPU dumps. If the drm_printer object supports a custom puts function then use that otherwise fall back to the slower legacy printf call. v2: Add documentation for drm_puts() per Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Jordan Crouse [robclark fix minor htmldocs warning] Signed-off-by: Rob Clark commit cfc57a18a3c5dc95d06db80bddd30015162c57d2 Author: Jordan Crouse Date: Tue Jul 24 10:33:20 2018 -0600 drm: drm_printer: Add printer for devcoredump Add a drm printer suitable for use with the read callback for devcoredump or other suitable buffer based output format that isn't otherwise covered by seq_file. v2: Add improved documentation per Daniel Vetter Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 489cae632fc04927e8ef36ac8d8847193a41df3b Author: Jordan Crouse Date: Tue Jul 24 10:33:19 2018 -0600 include: Move ascii85 functions from i915 to linux/ascii85.h The i915 DRM driver very cleverly used ascii85 encoding for their GPU state file. Move the encode functions to a general header file to support other drivers that might be interested in the same functionality. v4: Make the return value const char * as suggested by Chris Wilson v3: Fix error_puts -> err_puts pointed out by the 01.org bot v2: Update API to be cleaner for the caller as suggested by Chris Wilson Reviewed-by: Chris Wilson Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit f7e2a152231f4a0308cc8f9c2296ba4e419ae945 Author: Alexey Spirkov Date: Thu Jul 26 12:52:50 2018 +0000 powerpc/44x: Mark mmu_init_secondary() as __init mmu_init_secondary() calls ppc44x_pin_tlb() which is marked __init, leading to a warning: The function mmu_init_secondary() references the function __init ppc44x_pin_tlb(). There's no CPU hotplug support on 44x so mmu_init_secondary() will only be called at boot. Therefore we should mark it as __init. Signed-off-by: Alexey Spirkov [mpe: Flesh out change log details] Signed-off-by: Michael Ellerman commit a984506c542e26b31cbb446438f8439fa2253b2e Author: Michael Ellerman Date: Fri Jul 20 00:33:16 2018 +1000 powerpc/mm: Don't report PUDs as memory leaks when using kmemleak Paul Menzel reported that kmemleak was producing reports such as: unreferenced object 0xc0000000f8b80000 (size 16384): comm "init", pid 1, jiffies 4294937416 (age 312.240s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000d997deb7>] __pud_alloc+0x80/0x190 [<0000000087f2e8a3>] move_page_tables+0xbac/0xdc0 [<00000000091e51c2>] shift_arg_pages+0xc0/0x210 [<00000000ab88670c>] setup_arg_pages+0x22c/0x2a0 [<0000000060871529>] load_elf_binary+0x41c/0x1648 [<00000000ecd9d2d4>] search_binary_handler.part.11+0xbc/0x280 [<0000000034e0cdd7>] __do_execve_file.isra.13+0x73c/0x940 [<000000005f953a6e>] sys_execve+0x58/0x70 [<000000009700a858>] system_call+0x5c/0x70 Indicating that a PUD was being leaked. However what's really happening is that kmemleak is not able to recognise the references from the PGD to the PUD, because they are not fully qualified pointers. We can confirm that in xmon, eg: Find the task struct for pid 1 "init": 0:mon> P task_struct ->thread.ksp PID PPID S P CMD c0000001fe7c0000 c0000001fe803960 1 0 S 13 systemd Dump virtual address 0 to find the PGD: 0:mon> dv 0 c0000001fe7c0000 pgd @ 0xc0000000f8b01000 Dump the memory of the PGD: 0:mon> d c0000000f8b01000 c0000000f8b01000 00000000f8b90000 0000000000000000 |................| c0000000f8b01010 0000000000000000 0000000000000000 |................| c0000000f8b01020 0000000000000000 0000000000000000 |................| c0000000f8b01030 0000000000000000 00000000f8b80000 |................| ^^^^^^^^^^^^^^^^ There we can see the reference to our supposedly leaked PUD. But because it's missing the leading 0xc, kmemleak won't recognise it. We can confirm it's still in use by translating an address that is mapped via it: 0:mon> dv 7fff94000000 c0000001fe7c0000 pgd @ 0xc0000000f8b01000 pgdp @ 0xc0000000f8b01038 = 0x00000000f8b80000 <-- pudp @ 0xc0000000f8b81ff8 = 0x00000000037c4000 pmdp @ 0xc0000000037c5ca0 = 0x00000000fbd89000 ptep @ 0xc0000000fbd89000 = 0xc0800001d5ce0386 Maps physical address = 0x00000001d5ce0000 Flags = Accessed Dirty Read Write The fix is fairly simple. We need to tell kmemleak to ignore PUD allocations and never report them as leaks. We can also tell it not to scan the PGD, because it will never find pointers in there. However it will still notice if we allocate a PGD and then leak it. Reported-by: Paul Menzel Signed-off-by: Michael Ellerman Tested-by: Paul Menzel Signed-off-by: Michael Ellerman commit 405cb4024e52b137685213b377ea3f0ce3f91735 Author: Christophe Leroy Date: Thu Jul 5 16:25:21 2018 +0000 powerpc: split asm/tlbflush.h Split asm/tlbflush.h into: asm/nohash/tlbflush.h asm/book3s/32/tlbflush.h asm/book3s/64/tlbflush.h (already existing) Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 45ef5992e06dcc3a4c7d34d23052289c7676d56c Author: Christophe Leroy Date: Thu Jul 5 16:25:19 2018 +0000 powerpc: remove unnecessary inclusion of asm/tlbflush.h asm/tlbflush.h is only needed for: - using functions xxx_flush_tlb_xxx() - using MMU_NO_CONTEXT - including asm-generic/pgtable.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 7bc396958cafba126078ad92480a4241599ae4ef Author: Christophe Leroy Date: Thu Jul 5 16:25:13 2018 +0000 powerpc/44x: remove page.h from mmu-44x.h mmu-44x.h doesn't need asm/page.h if PAGE_SHIFT are replaced by CONFIG_PPC_XX_PAGES Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 0c295d0e9c9f7a592f230bbcf51655bc6c9351ba Author: Christophe Leroy Date: Thu Jul 5 16:25:11 2018 +0000 powerpc/nohash: fix hash related comments in pgtable.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 62b8426578c414c918468ab4cc7517da7adc31d5 Author: Christophe Leroy Date: Thu Jul 5 16:25:09 2018 +0000 powerpc: fix includes in asm/processor.h Remove superflous includes and add missing ones Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 6b622669119e20a53a1983cd41115e6895bb85a2 Author: Christophe Leroy Date: Thu Jul 5 16:25:07 2018 +0000 powerpc/book3s: Remove PPC_PIN_SIZE PPC_PIN_SIZE is specific to the 44x and is defined in mmu.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit b5ac51d747122f8858bdcb3fc7a5c702ef06f6c5 Author: Christophe Leroy Date: Thu Jul 5 16:25:05 2018 +0000 powerpc: declare set_breakpoint() static set_breakpoint() is only used in process.c so make it static Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit e8cb7a55eb8dcf65838d0911dc7ba00b7d7accf5 Author: Christophe Leroy Date: Thu Jul 5 16:25:03 2018 +0000 powerpc: remove superflous inclusions of asm/fixmap.h Files not using fixmap consts or functions don't need asm/fixmap.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 2c86cd188f8a5631f3d75a1dea14d22df85189b4 Author: Christophe Leroy Date: Thu Jul 5 16:25:01 2018 +0000 powerpc: clean inclusions of asm/feature-fixups.h files not using feature fixup don't need asm/feature-fixups.h files using feature fixup need asm/feature-fixups.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 5c35a02c545a7bbe77f3a1ae337d9e29beed079b Author: Christophe Leroy Date: Thu Jul 5 16:24:59 2018 +0000 powerpc: clean the inclusion of stringify.h Only include linux/stringify.h is files using __stringify() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit ec0c464cdbf38bf6ddabec8bfa595bd421cab203 Author: Christophe Leroy Date: Thu Jul 5 16:24:57 2018 +0000 powerpc: move ASM_CONST and stringify_in_c() into asm-const.h This patch moves ASM_CONST() and stringify_in_c() into dedicated asm-const.h, then cleans all related inclusions. Signed-off-by: Christophe Leroy [mpe: asm-compat.h should include asm-const.h] Signed-off-by: Michael Ellerman commit 36a7eeaff7d06cef253c8df6dfe363bfc4a553f8 Author: Christophe Leroy Date: Thu Jul 5 16:24:55 2018 +0000 powerpc/405: move PPC405_ERR77 in asm-405.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 8c58259bba43084eb5876aeefa574e9344b85ae3 Author: Christophe Leroy Date: Thu Jul 5 16:24:53 2018 +0000 powerpc: remove unneeded inclusions of cpu_has_feature.h Files not using cpu_has_feature() don't need cpu_has_feature.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit db0a2b633da4216b767d7aed95ffe30d37409c7a Author: Christophe Leroy Date: Thu Jul 5 16:24:51 2018 +0000 powerpc: remove kdump.h from page.h page.h doesn't need kdump.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit f609e7a0f3956e3b03af735b83600a4eef2a04ec Author: Corentin Labbe Date: Thu Jun 7 15:55:25 2018 -0400 media: sii9234: remove unused header The include/linux/platform_data/media/sii9234.h header file is unused, let's remove it. Signed-off-by: Corentin Labbe Signed-off-by: Mauro Carvalho Chehab commit 02a3c0bd607402e4b7a5026f5a498291e8ade6f8 Author: ernest.zhang Date: Mon Jul 16 14:26:55 2018 +0800 mmc: sdhci: Add MSI interrupt support for O2 SD host Add MSI interrupt support if the SD host device can support MSI interrupt. Signed-off-by: ernest.zhang Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 0086fc217d5d7ac2939c500733d1d046b9ac5012 Author: ernest.zhang Date: Mon Jul 16 14:26:54 2018 +0800 mmc: sdhci: Add support for O2 hardware tuning Add hardware tuning function instead of software tuning because O2/Bayhub SD host controller support hardware tuning. Signed-off-by: ernest.zhang Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 6663c419a046cdfcf3598b6d0855817b5c6287ae Author: ernest.zhang Date: Mon Jul 16 14:26:53 2018 +0800 mmc: sdhci: Export sdhci tuning function symbol Export sdhci tuning function symbols which are used by other SD Host controller driver modules. Signed-off-by: ernest.zhang Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 3665ff03c16ee6436d45a699565ba08f7ebdebb5 Author: ernest.zhang Date: Mon Jul 16 14:26:52 2018 +0800 mmc: sdhci: Change O2 Host HS200 mode clock frequency to 200MHz O2 SD Host HS200 mode clock frequency current is 208MHz, should be changed to 200MHz to meet specification. Signed-off-by: ernest.zhang Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 57322d542ffe01076c9df10d38e3ec0a58f9d83a Author: ernest.zhang Date: Mon Jul 16 14:26:51 2018 +0800 mmc: sdhci: Add support for O2 eMMC HS200 mode When use eMMC as boot device, the eMMC signaling voltage is tied to 1.8v fixed output voltage, bios can set o2 sd host controller PCI configuration register 0x308 bit4 to 1 to let driver skip 3.3v signaling voltage and direct use 1.8v singling voltage in eMMC initialize process. Signed-off-by: ernest.zhang Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit b3cadaa485f0c20add1644a5c877b0765b285c0c Author: Marcel Holtmann Date: Mon Jul 30 13:57:41 2018 +0200 Bluetooth: hidp: Fix handling of strncpy for hid->name information This fixes two issues with setting hid->name information. CC net/bluetooth/hidp/core.o In function ‘hidp_setup_hid’, inlined from ‘hidp_session_dev_init’ at net/bluetooth/hidp/core.c:815:9, inlined from ‘hidp_session_new’ at net/bluetooth/hidp/core.c:953:8, inlined from ‘hidp_connection_add’ at net/bluetooth/hidp/core.c:1366:8: net/bluetooth/hidp/core.c:778:2: warning: ‘strncpy’ output may be truncated copying 127 bytes from a string of length 127 [-Wstringop-truncation] strncpy(hid->name, req->name, sizeof(req->name) - 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC net/bluetooth/hidp/core.o net/bluetooth/hidp/core.c: In function ‘hidp_setup_hid’: net/bluetooth/hidp/core.c:778:38: warning: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess] strncpy(hid->name, req->name, sizeof(req->name)); ^ Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg commit 4ed8eb6570a49931c705512060acd50058d61616 Author: Máté Eckl Date: Mon Jul 30 11:07:32 2018 +0200 netfilter: nf_tables: Add native tproxy support A great portion of the code is taken from xt_TPROXY.c There are some changes compared to the iptables implementation: - tproxy statement is not terminal here - Either address or port has to be specified, but at least one of them is necessary. If one of them is not specified, the evaluation will be performed with the original attribute of the packet (ie. target port is not specified => the packet's dport will be used). To make this work in inet tables, the tproxy structure has a family member (typically called priv->family) which is not necessarily equal to ctx->family. priv->family can have three values legally: - NFPROTO_IPV4 if the table family is ip OR if table family is inet, but an ipv4 address is specified as a target address. The rule only evaluates ipv4 packets in this case. - NFPROTO_IPV6 if the table family is ip6 OR if table family is inet, but an ipv6 address is specified as a target address. The rule only evaluates ipv6 packets in this case. - NFPROTO_UNSPEC if the table family is inet AND if only the port is specified. The rule will evaluate both ipv4 and ipv6 packets. Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit b96af92d6eaf9fadd77aa798c508a8a9d2e60020 Author: Fernando Fernandez Mancera Date: Wed Jul 25 01:32:46 2018 +0200 netfilter: nf_tables: implement Passive OS fingerprint module in nft_osf Add basic module functions into nft_osf.[ch] in order to implement OSF module in nf_tables. Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit f9324952088f1cd62ea4addf9ff532f1e6452a22 Author: Fernando Fernandez Mancera Date: Wed Jul 25 01:32:45 2018 +0200 netfilter: nfnetlink_osf: extract nfnetlink_subsystem code from xt_osf.c Move nfnetlink osf subsystem from xt_osf.c to standalone module so we can reuse it from the new nft_ost extension. Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit f6b7b5f4f3bcd7e1897c16dd65a10cbcc159cbde Author: Fernando Fernandez Mancera Date: Wed Jul 25 01:32:44 2018 +0200 netfilter: nf_osf: rename nf_osf.c to nfnetlink_osf.c Rename nf_osf.c to nfnetlink_osf.c as we introduce nfnetlink_osf which is the OSF infraestructure. Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit 33b78aaa4457ce5d531c6a06f461f8d402774cad Author: YueHaibing Date: Thu Jul 19 21:20:09 2018 +0800 netfilter: use PTR_ERR_OR_ZERO() Fix ptr_ret.cocci warnings: net/netfilter/xt_connlimit.c:96:1-3: WARNING: PTR_ERR_OR_ZERO can be used net/netfilter/nft_numgen.c:240:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: YueHaibing Signed-off-by: Pablo Neira Ayuso commit 51c23b47e6b8590ea7a6a6776ffb21810ece73bf Author: Pablo Neira Ayuso Date: Fri Jul 13 14:54:45 2018 +0200 netfilter: nf_osf: add nf_osf_find() This new function returns the OS genre as a string. Plan is to use to from the new nft_osf extension. Note that this doesn't yet support ttl options, but it could be easily extended to do so. Tested-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit 740011cfe94859df8d05f5400d589a8693b095e7 Author: Sean Wang Date: Fri Jul 20 13:12:28 2018 +0800 Bluetooth: Add new quirk for non-persistent setup settings Add a new quirk HCI_QUIRK_NON_PERSISTENT_SETUP allowing that a quirk that runs setup() after every open() and not just after the first open(). Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit ca38dc8f2724d101038b1205122c93a1c7f38f11 Author: Joerg Roedel Date: Wed Jul 25 17:48:03 2018 +0200 x86/kexec: Allocate 8k PGDs for PTI Fuzzing the PTI-x86-32 code with trinity showed unhandled kernel paging request oops-messages that looked a lot like silent data corruption. Lot's of debugging and testing lead to the kexec-32bit code, which is still allocating 4k PGDs when PTI is enabled. But since it uses native_set_pud() to build the page-table, it will unevitably call into __pti_set_user_pgtbl(), which writes beyond the allocated 4k page. Use PGD_ALLOCATION_ORDER to allocate PGDs in the kexec code to fix the issue. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: David H. Gutteridge Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1532533683-5988-4-git-send-email-joro@8bytes.org commit 0e664eee65337082be49fbbd2ee24aa0d111d0f2 Author: Joerg Roedel Date: Wed Jul 25 17:48:02 2018 +0200 Revert "perf/core: Make sure the ring-buffer is mapped in all page-tables" This reverts commit 77754cfa09a6c528c38cbca9ee4cc4f7cf6ad6f2. The patch was necessary to silence a WARN_ON_ONCE(in_nmi()) that triggered in the vmalloc_fault() function when PTI was enabled on x86-32. Faulting in an NMI handler turned out to be safe and the warning in vmalloc_fault() is gone now. So the above patch can be reverted. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: David H. Gutteridge Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1532533683-5988-3-git-send-email-joro@8bytes.org commit 6863ea0cda8725072522cd78bda332d9a0b73150 Author: Joerg Roedel Date: Wed Jul 25 17:48:01 2018 +0200 x86/mm: Remove in_nmi() warning from vmalloc_fault() It is perfectly okay to take page-faults, especially on the vmalloc area while executing an NMI handler. Remove the warning. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: David H. Gutteridge Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1532533683-5988-2-git-send-email-joro@8bytes.org commit 85a721a8b0b6880d8cf6b9def70404ade8563225 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:47 2018 +0530 Bluetooth: Implement secondary advertising on different PHYs This patch adds support for advertising in primary and secondary channel on different PHYs. User can add the phy preference in the flag based on which phy type will be added in extended advertising parameter would be set. @ MGMT Command: Add Advertising (0x003e) plen 11 Instance: 1 Flags: 0x00000200 Advertise in CODED on Secondary channel Duration: 0 Timeout: 0 Advertising data length: 0 Scan response length: 0 < HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 2 Extended advertising: Disabled (0x00) Number of sets: Disable all sets (0x00) > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2 Status: Success (0x00) < HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036) plen 25 Handle: 0x00 Properties: 0x0000 Min advertising interval: 1280.000 msec (0x0800) Max advertising interval: 1280.000 msec (0x0800) Channel map: 37, 38, 39 (0x07) Own address type: Random (0x01) Peer address type: Public (0x00) Peer address: 00:00:00:00:00:00 (OUI 00-00-00) Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00) TX power: 127 dbm (0x7f) Primary PHY: LE Coded (0x03) Secondary max skip: 0x00 Secondary PHY: LE Coded (0x03) SID: 0x00 Scan request notifications: Disabled (0x00) Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit acf0aeae431a0f1723385cd1cb50177e4cc10edd Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:46 2018 +0530 Bluetooth: Handle ADv set terminated event This event comes after connection complete event for incoming connections. Since we now have different random address for each instance, conn resp address is assigned from this event. As of now only connection part is handled as we are not enabling duration or max num of events while starting ext adv. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit a73c046a2869048430c332a871a5b169f192c6c3 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:45 2018 +0530 Bluetooth: Implement Set ADV set random address This basically sets the random address for the adv instance Random address can be set only if the instance is created which is done in Set ext adv param. Random address and rpa expire timer and flags have been added to adv instance which will be used when the respective instance is scheduled. This introduces a hci_get_random_address() which returns the own address type and random address (rpa or nrpa) based on the instance flags and hdev flags. New function is required since own address type should be known before setting adv params but address can be set only after setting params. < HCI Command: LE Set Advertising Set Random Address (0x08|0x0035) plen 7 Advertising handle: 0x00 Advertising random address: 3C:8E:56:9B:77:84 (OUI 3C-8E-56) > HCI Event: Command Complete (0x0e) plen 4 LE Set Advertising Set Random Address (0x08|0x0035) ncmd 1 Status: Success (0x00) Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 075e40b79f6d0aa1479701d2dd6dea3b78478d60 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:44 2018 +0530 Bluetooth: Use ext adv for directed adv This patch does extended advertising for directed advertising if the controller supportes. Instance 0 is used for directed advertising. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 45b7749f16aacd9ffab8e958caa77e2aa2358c0b Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:43 2018 +0530 Bluetooth: Implement disable and removal of adv instance If ext adv is enabled then use ext adv to disable as well. Also remove the adv set during LE disable. < HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 2 Extended advertising: Disabled (0x00) Number of sets: Disable all sets (0x00) > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2 Status: Success (0x00) Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit a0fb3726ba55138ef6fdd5dc67da6d9a70360696 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:42 2018 +0530 Bluetooth: Use Set ext adv/scan rsp data if controller supports This patch implements Set Ext Adv data and Set Ext Scan rsp data if controller support extended advertising. Currently the operation is set as Complete data and fragment preference is set as no fragment < HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 35 Handle: 0x00 Operation: Complete extended advertising data (0x03) Fragment preference: Minimize fragmentation (0x01) Data length: 0x15 16-bit Service UUIDs (complete): 2 entries Heart Rate (0x180d) Battery Service (0x180f) Name (complete): Test LE Company: Google (224) Data: 0102 > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Advertising Data (0x08|0x0037) ncmd 1 Status: Success (0x00) Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit de181e887ac27dadda127c7d4c3e89c6da8fb6d2 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:41 2018 +0530 Bluetooth: Impmlement extended adv enable This patch basically replaces legacy adv with extended adv based on the controller support. Currently there is no design change. ie only one adv set will be enabled at a time. This also adds tx_power in instance and store whatever returns from Set_ext_parameter, use the same in adv data as well. For instance 0 tx_power is stored in hdev only. < HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036) plen 25 Handle: 0x00 Properties: 0x0010 Use legacy advertising PDUs: ADV_NONCONN_IND Min advertising interval: 1280.000 msec (0x0800) Max advertising interval: 1280.000 msec (0x0800) Channel map: 37, 38, 39 (0x07) Own address type: Random (0x01) Peer address type: Public (0x00) Peer address: 00:00:00:00:00:00 (OUI 00-00-00) Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00) TX power: 127 dbm (0x7f) Primary PHY: LE 1M (0x01) Secondary max skip: 0x00 Secondary PHY: LE 1M (0x01) SID: 0x00 Scan request notifications: Disabled (0x00) > HCI Event: Command Complete (0x0e) plen 5 LE Set Extended Advertising Parameters (0x08|0x0036) ncmd 1 Status: Success (0x00) TX power (selected): 7 dbm (0x07) < HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6 Extended advertising: Enabled (0x01) Number of sets: 1 (0x01) Entry 0 Handle: 0x00 Duration: 0 ms (0x00) Max ext adv events: 0 > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2 Status: Success (0x00) Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 6b49bcb4bce2ed0f0aefe8e304a8b9cbaeeaa3f0 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:40 2018 +0530 Bluetooth: Read no of adv sets during init This patch reads the number of advertising sets in the controller during init and save it in hdev. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 4e6e99e9336ce863449c2570dc1d1d6c2c886ac0 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:39 2018 +0530 Bluetooth: Use selected PHYs in extended connect Use the selected PHYs by Set PHY Configuration management command in extended create connection. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit b2cc9761f144e8ef714be8c590603073b80ddc13 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:38 2018 +0530 Bluetooth: Handle extended ADV PDU types This patch defines the extended ADV types and handle it in ADV report. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 45bdd86eafc7d29e0b4b6681bec9c6ab8eddc6bf Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:37 2018 +0530 Bluetooth: Set Scan PHYs based on selected PHYs by user Use the PHYs selected in Set Phy Configuration management command while scanning. < HCI Command: LE Set Extended Scan Parameters (0x08|0x0041) plen 13 Own address type: Random (0x01) Filter policy: Accept all advertisement (0x00) PHYs: 0x05 Entry 0: LE 1M Type: Active (0x01) Interval: 11.250 msec (0x0012) Window: 11.250 msec (0x0012) Entry 1: LE Coded Type: Active (0x01) Interval: 11.250 msec (0x0012) Window: 11.250 msec (0x0012) > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Scan Parameters (0x08|0x0041) ncmd 1 Status: Success (0x00) < HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6 Extended scan: Enabled (0x01) Filter duplicates: Enabled (0x01) Duration: 0 msec (0x0000) Period: 0.00 sec (0x0000) > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Scan Enable (0x08|0x0042) ncmd 2 Status: Success (0x00) Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit b7c23df85b6a1c3bcfb591cfa938d341fc3a556e Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:36 2018 +0530 Bluetooth: Implement PHY changed event This defines and implement phy changed event and send it to user whenever selected PHYs changes using SET_PHY_CONFIGURATION. This will be also trigerred when BREDR pkt_type is changed using the legacy ioctl HCISETPTYPE. @ MGMT Command: Set PHY Configuration (0x0045) plen 4 Selected PHYs: 0x7fff BR 1M 1SLOT BR 1M 3SLOT BR 1M 5SLOT EDR 2M 1SLOT EDR 2M 3SLOT EDR 2M 5SLOT EDR 3M 1SLOT EDR 3M 3SLOT EDR 3M 5SLOT LE 1M TX LE 1M RX LE 2M TX LE 2M RX LE CODED TX LE CODED RX < HCI Command: LE Set Default PHY (0x08|0x0031) plen 3 All PHYs preference: 0x00 TX PHYs preference: 0x07 LE 1M LE 2M LE Coded RX PHYs preference: 0x07 LE 1M LE 2M LE Coded > HCI Event: Command Complete (0x0e) plen 4 LE Set Default PHY (0x08|0x0031) ncmd 1 Status: Success (0x00) @ MGMT Event: Command Complete (0x0001) plen 3 Set PHY Configuration (0x0045) plen 0 Status: Success (0x00) @ MGMT Event: PHY Configuration Changed (0x0026) plen 4 Selected PHYs: 0x7fff BR 1M 1SLOT BR 1M 3SLOT BR 1M 5SLOT EDR 2M 1SLOT EDR 2M 3SLOT EDR 2M 5SLOT EDR 3M 1SLOT EDR 3M 3SLOT EDR 3M 5SLOT LE 1M TX LE 1M RX LE 2M TX LE 2M RX LE CODED TX LE CODED RX Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 0314f2867fa0c46d0fc1c23c80e7fab9435079df Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:35 2018 +0530 Bluetooth: Implement Set PHY Confguration command This enables user to set phys which will be used in all subsequent connections. Also host will use the same in LE scanning as well. @ MGMT Command: Set PHY Configuration (0x0045) plen 4 Selected PHYs: 0x7fff BR 1M 1SLOT BR 1M 3SLOT BR 1M 5SLOT EDR 2M 1SLOT EDR 2M 3SLOT EDR 2M 5SLOT EDR 3M 1SLOT EDR 3M 3SLOT EDR 3M 5SLOT LE 1M TX LE 1M RX LE 2M TX LE 2M RX LE CODED TX LE CODED RX < HCI Command: LE Set Default PHY (0x08|0x0031) plen 3 All PHYs preference: 0x00 TX PHYs preference: 0x07 LE 1M LE 2M LE Coded RX PHYs preference: 0x07 LE 1M LE 2M LE Coded > HCI Event: Command Complete (0x0e) plen 4 LE Set Default PHY (0x08|0x0031) ncmd 1 Status: Success (0x00) @ MGMT Event: Command Complete (0x0001) plen 3 Set PHY Configuration (0x0045) plen 0 Status: Success (0x00) @ MGMT Event: PHY Configuration Changed (0x0026) plen 4 Selected PHYs: 0x7fff BR 1M 1SLOT BR 1M 3SLOT BR 1M 5SLOT EDR 2M 1SLOT EDR 2M 3SLOT EDR 2M 5SLOT EDR 3M 1SLOT EDR 3M 3SLOT EDR 3M 5SLOT LE 1M TX LE 1M RX LE 2M TX LE 2M RX LE CODED TX LE CODED RX Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 6244691fec4dd0adebca255e60e0ed7ac8155b2e Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:34 2018 +0530 Bluetooth: Implement Get PHY Configuration mgmt command This commands basically retrieve the supported packet types of BREDR and supported PHYs of the controller. BR_1M_1SLOT, LE_1M_TX and LE_1M_RX would be supported by default. Other PHYs are supported based on the local features. Also this sets PHY_CONFIGURATION bit in supported settings. @ MGMT Command: Get PHY Configuration (0x0044) plen 0 @ MGMT Event: Command Complete (0x0001) plen 15 Get PHY Configuration (0x0044) plen 12 Status: Success (0x00) Supported PHYs: 0x7fff BR 1M 1SLOT BR 1M 3SLOT BR 1M 5SLOT EDR 2M 1SLOT EDR 2M 3SLOT EDR 2M 5SLOT EDR 3M 1SLOT EDR 3M 3SLOT EDR 3M 5SLOT LE 1M TX LE 1M RX LE 2M TX LE 2M RX LE CODED TX LE CODED RX Configurable PHYs: 0x79fe BR 1M 3SLOT BR 1M 5SLOT EDR 2M 1SLOT EDR 2M 3SLOT EDR 2M 5SLOT EDR 3M 1SLOT EDR 3M 3SLOT EDR 3M 5SLOT LE 2M TX LE 2M RX LE CODED TX LE CODED RX Selected PHYs: 0x07ff BR 1M 1SLOT BR 1M 3SLOT BR 1M 5SLOT EDR 2M 1SLOT EDR 2M 3SLOT EDR 2M 5SLOT EDR 3M 1SLOT EDR 3M 3SLOT EDR 3M 5SLOT LE 1M TX LE 1M RX Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 5075b972f20ddad5bb19542ea4f5794d06673375 Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:33 2018 +0530 Bluetooth: Add defines for BREDR pkt_type and LE PHYs This also add macros for checking LMP support for different pkt_types Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 6decb5b45e70d6ffff6488cc8e8bad6b9ac7f99b Author: Jaganath Kanakkassery Date: Thu Jul 19 17:09:32 2018 +0530 Bluetooth: Define PHY flags in hdev and set 1M as default 1M is mandatory to be supported by LE controllers and the same would be set in power on. This patch defines hdev flags for LE PHYs and set 1M to default. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit b2ab472dc159b7f89e2bc2d305fbc52fc2241dd6 Merge: e5af5ff34cf0 156955754969 Author: Thomas Gleixner Date: Mon Jul 30 13:08:54 2018 +0200 Merge branch 'clockevents/4.19' of git://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull clockevent/source changes from Daniel Lezcano: - Add a less accurate but always-on clocksource for the sprd platform (Baoling Wang) - Add the system timer for the new mediatek platforms (Stanley Chu) - Change the cpumask to cpu_possible_mask (Sudeep Holla) commit d8504acca759ae672c6d34d49a33d54ace094cbb Author: Katsuhiro Suzuki Date: Fri Jul 27 11:37:44 2018 +0900 ASoC: uniphier: change functions to static This patch changes some functions that are not used by other objects to static. Signed-off-by: Katsuhiro Suzuki Signed-off-by: Mark Brown commit 8fc9983db199bb397d48e32a6400765b70f1995a Author: Katsuhiro Suzuki Date: Fri Jul 27 11:37:28 2018 +0900 ASoC: uniphier: add support for multichannel output This patch adds multichannel PCM output support for LD11/LD20. Currently driver tested and supported only 2ch, 6ch, and 8ch. Signed-off-by: Katsuhiro Suzuki Signed-off-by: Mark Brown commit ae1c696a480c67c45fb23b35162183f72c6be0e1 Author: Gustavo A. R. Silva Date: Thu Jul 26 15:49:10 2018 -0500 ASoC: sirf: Fix potential NULL pointer dereference There is a potential execution path in which function platform_get_resource() returns NULL. If this happens, we will end up having a NULL pointer dereference. Fix this by replacing devm_ioremap with devm_ioremap_resource, which has the NULL check and the memory region request. This code was detected with the help of Coccinelle. Cc: stable@vger.kernel.org Fixes: 2bd8d1d5cf89 ("ASoC: sirf: Add audio usp interface driver") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 4321723648b0abb456f7a9af51bb09a4ec60799d Author: Alexey Khoroshilov Date: Sat Jul 28 00:06:59 2018 +0300 ASoC: tegra_alc5632: fix device_node refcounting tegra_alc5632_probe() increments reference count of device nodes with of_parse_phandle(), but there is no code decrementing them in the driver. The patch adds of_node_put() to tegra_alc5632_remove() and to error handling paths in the probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Acked-by: Jon Hunter Signed-off-by: Mark Brown commit 7464d3faf62a5adcb99f4f8ea9baabda78aed4aa Author: Kuninori Morimoto Date: Mon Jul 30 08:00:22 2018 +0000 ASoC: sh: Kconfig: convert to SPDX identifiers By default all files without license information are under the default license of the kernel, which is GPL version 2. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit e028937c77f44bb38cdbc464afce2bf41d96006b Author: Kuninori Morimoto Date: Mon Jul 30 07:53:08 2018 +0000 ASoC: ak4613: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit c0ca5604d43233b0f5cfb793be9638af21f5535d Author: Kuninori Morimoto Date: Mon Jul 30 07:52:46 2018 +0000 ASoC: da7210: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 7a968dc66aecaaea3424ca2525b758687b39bc0e Author: Kuninori Morimoto Date: Mon Jul 30 07:52:15 2018 +0000 ASoC: ak4554: convert to SPDX identifiers As original license mentioned, it is GPL-2.0 in SPDX. Then, MODULE_LICENSE() should be "GPL v2" instead of "GPL". See ${LINUX}/include/linux/module.h "GPL" [GNU Public License v2 or later] "GPL v2" [GNU Public License v2] Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit fe209b97184f577b70ae0799c2b149be36092f84 Author: Kuninori Morimoto Date: Mon Jul 30 07:51:41 2018 +0000 ASoC: ak4642: convert to SPDX identifiers As original license mentioned, it is GPL-2.0 in SPDX. Then, MODULE_LICENSE() should be "GPL v2" instead of "GPL". See ${LINUX}/include/linux/module.h "GPL" [GNU Public License v2 or later] "GPL v2" [GNU Public License v2] Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 345a9ca37aa69bb3133c1a8390a71f993abcef0c Author: Takashi Iwai Date: Mon Jul 30 08:46:40 2018 +0200 ALSA: memalloc: Fix missing PAGE_SIZE definition The recent fix moved the inline snd_sgbuf_aligned_pages() outside the ifdef, and this triggered a build error on some architectures due to the undefined PAGE_SIZE, as spotted by 0day bot. Fix it by adding the missing header inclusion. Fixes: 4cae99d9b530 ("ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally") Reported-by: kbuild test robot Cc: Pierre-Louis Bossart Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit c2c25cc397026ec705e050248539df400d2563f8 Author: Alexandre Belloni Date: Fri Jul 27 21:53:56 2018 +0200 spi: dw-mmio: add MSCC Ocelot support Because the SPI controller deasserts the chip select when the TX fifo is empty (which may happen in the middle of a transfer), the CS should be handled by linux. Unfortunately, some or all of the first four chip selects are not muxable as GPIOs, depending on the SoC. There is a way to bitbang those pins by using the SPI boot controller so use it to set the chip selects. At init time, it is also necessary to give control of the SPI interface to the Designware IP. Signed-off-by: Alexandre Belloni Reviewed-by: Andy Shevchenko Signed-off-by: Mark Brown commit c79bdbb490a1d05c6169cbffd37c19f5aa96587a Author: Alexandre Belloni Date: Fri Jul 27 21:53:54 2018 +0200 spi: dw: export dw_spi_set_cs Export dw_spi_set_cs so it can be used from the various IP integration modules. Signed-off-by: Alexandre Belloni Reviewed-by: Andy Shevchenko Signed-off-by: Mark Brown commit aa595c00bcf5b6f2f394a98217f82c9402952ea9 Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: remove obsolete fb unreferencing kfifo and workqueue Remove the obsolete fb unreferencing system that is no longer used since we've transitioned to atomic modeset. Signed-off-by: Russell King commit 82c702cb0c041a9a1c69f489d1517235a633fc77 Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: remove unnecessary armada_plane structure We no longer require a private armada_plane structure, so eliminate it, and use the drm_plane structure directly. Signed-off-by: Russell King commit d701278ada5115c40cd4d58ce0fb1169479c0bf6 Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: remove unnecessary armada_ovl_plane structure We no longer need a private plane structure, so get rid of it. Use the drm_plane structure directly. Signed-off-by: Russell King commit dae2155bb07bb2063ce604049e9aa4e862b6db0a Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: update primary framebuffer parameters on mode change The framebuffer base address and toggling mode needs to be updated when the interlaced flag for mode changes is updated. Arrange to reprogram these parameters when only the mode has changed. Signed-off-by: Russell King commit 3cb13ac97bdfda5b301609256e3e0b59bc94f10a Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: update planes after the dumb frame is complete Write out the plane updates after the dumb frame has completed, but just before the blank period. This allows all the plane updates to be performed in a flicker-free non-tearing manner. Signed-off-by: Russell King commit b1ec9ed6aa985be432f9ba29696029dc6779258e Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: switch overlay plane to atomic modeset Switch the overlay plane away from the transitional helpers and legacy methods, and use atomic helpers instead to implement the legacy set_plane ioctl methods. Signed-off-by: Russell King commit 13c94d5349c9c0756131e7bf2e703ab36ea55c73 Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: switch primary plane to atomic modeset Switch the primary plane away from the transitional helpers, and use the atomic helpers instead to implement the legacy set_plane ioctl call for this plane. Signed-off-by: Russell King commit 6d2f864fdff5c73cb37069cd17b0f897d7995b62 Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: switch legacy modeset to atomic modeset Switch the legacy set_config() method to use the atomic modeset helper, which allows us to get rid of the legacy dpms, prepare, commit, mode_set, mode_set_base and disable helper methods. Signed-off-by: Russell King commit 6bd02908836ed00aa7fcdc759d490029137c2b30 Author: Russell King Date: Mon Jul 30 11:53:06 2018 +0100 drm/armada: enable atomic modeset support Enable atomic modeset helpers, and internal DRM use of atomic modeset with armada-drm. Signed-off-by: Russell King commit 34e25ed60ae2cdf91b953dd3772ae48a6bffbd4c Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: implement atomic_enable()/atomic_disable() methods Implement the atomic_enable()/atomic_disable() methods used by the atomic modeset helpers. atomic_disable() will need some transitional code during conversion to ensure proper ordering is maintained. Signed-off-by: Russell King commit a0f75d2468fe4510bb8d0d6c4e1a5fd5e262e7b5 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: unhook dpms state from armada_drm_crtc_update() Explicitly pass in the desired enable/disable state into armada_drm_crtc_update() rather than having it use the DPMS state stored in our crtc structure. Signed-off-by: Russell King commit a0fbb35ecde52aa5abf5975d117d29e3b30f7b91 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: push responsibility for clock management to backend Push responsibility for managing the clock during DPMS down into the variant backend, rather than the CRTC layer having knowledge of its state. Signed-off-by: Russell King commit dbb4ca8acae100b21946a9c6439af51bd606595e Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: handle atomic modeset crtc events Prepare handling for atomic modeset CRTC events. Currently, using the transition helpers, CRTC events do not exist, but once we switch to proper atomic modeset, they have to be handled. We queue an event for the next vblank in two places: - armada_drm_crtc_atomic_flush() provided we aren't doing an atomic modeset. - armada_drm_crtc_commit() if we are committing a modeset. This ensures that the event is sent at the correct time (after all updates have been written to the hardware and after the following vblank.) Signed-off-by: Russell King commit 4e4b3563ac006e47761341682de80528e2cf30ab Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: clean up SPU_ADV_REG Rather than writing all bits of SPU_ADV_REG on modeset, only write what we need to change, and initialise the register in the variant initialisation. Signed-off-by: Russell King commit a61c3922f6293ab5d58f64e2312981cc646c2fd8 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: update debug in armada_drm_crtc_mode_set_nofb() Update debug to use KMS level, and print the mode using the standard format for mode lines, but print the adjusted CRTC parameters as that's what we will be programming for. Signed-off-by: Russell King commit 155b8290f7635b31faa57ca38cb5ddfe78111c2d Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: move sync signal polarity to mode_set_nofb() method For atomic modeset, we need to set the sync signal polarities from the CRTC state structure rather than the legacy mode structure stored in CRTC. In any case, we should update this from our mode_set_nofb() method, rather than the commit() method. Move it there, and ensure that armada_drm_crtc_update() will not overwrite these bits. Signed-off-by: Russell King commit b5bae71a79d712681bdf48ee029f1953697924f7 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: push interlace calculation into armada_drm_plane_calc() Push the interlaced frame calculation down into armada_drm_plane_calc() which needs to apply the same correction for both the overlay and primary planes. Signed-off-by: Russell King commit 4aafe00e2f6bb43656d690b6241f80bb8c236168 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: provide pitches from armada_drm_plane_calc_addrs() Provide the framebuffer pitches from armada_drm_plane_calc_addrs() as well as the base addresses for each plane. Since this is now about more than just addresses, rename to armada_drm_plane_calc(). Signed-off-by: Russell King commit b4df3ba0d76823cb5e548505de104837d89aa5a9 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: pass plane state into armada_drm_plane_calc_addrs() armada_drm_plane_calc_addrs() gets all its information from the plane state, so it makes sense to pass the plane state pointer down into this function, rather than extracting the information in identical ways, sometimes a couple of layers up. Signed-off-by: Russell King commit 3382a6b999415d1f78cee3f483957651d7e1f8a4 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: move armada_drm_mode_config_funcs to armada_drv.c Move the armada_drm_mode_config_funcs to armada_drv.c, since this now has less to do with FBs than it does with general mode configuration. In doing so, we need to make armada_fb_create() visible to armada_drv.c, which reveals a function name clash with armada_fbdev.c. Rename the version in armada_fbdev.c. Signed-off-by: Russell King commit c29277d4e56388e805acc3ba428c9cff7df99fa7 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: add plane colorspace properties Use the DRM standard plane properties for specifying the YUV colour encoding parameter. Our colour range is fixed at limited range. Since we are transitioning to atomic modeset, we need to explicitly add handling of these properties to our atomic_set_property() method, but once the transition is complete, these will be removed. Signed-off-by: Russell King commit 240cf2b58eb0bdd3c59387ca0cfbd5657708b996 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: remove crtc YUV colourspace properties Remove the unused CRTC colourspace properties - userspace does not make use of these. In any case, these are not a property of the CRTC, since they demonstrably only affect the video (overlay) plane, irrespective of the format of the graphics (primary) plane. Signed-off-by: Russell King commit c96103b6c49ff9a8710e580da72c0f116d24a76c Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: move colorkey properties into overlay plane state Move the overlay plane colorkey properties into the plane state, keeping the existing driver behaviour to avoid breaking userspace. Signed-off-by: Russell King commit 61ba252705a6d5b8dd71bd2ccc544d33cb2af623 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: move CBSH properties into overlay plane state Move the contrast, brightness, and saturation properties to the overlay plane state structure, and call our overlay commit function to update the hardware via the planes atomic_update() method. Signed-off-by: Russell King commit 63b93c0834a0cb7d537b30f8e815a9f63d0da37f Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: move plane works to overlay Only overlay makes use of these now, so move these to the overlay code. Signed-off-by: Russell King commit d40af7b1ae23da718ba916fcd07f5b064efff921 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: move primary plane to separate file Split out the primary plane support; this is now entirely separate from the CRTC support. Signed-off-by: Russell King commit 3acea7b9b62c282ea3d4d0cd156ca8e35dfa8a8c Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: use old_state for update tracking in atomic_update() Rather than tracking the register state, we can now check the previous state and decide which registers need updating from that since the old plane state indicates the previous state which was programmed into the hardware. Signed-off-by: Russell King commit 9c41467c9aa5b3916ff559b8c2b3725d6290e5ec Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: remove temporary crtc state Now that we have the CRTC using the atomic modeset transitional helper, there is no need to build a temporary crtc state anymore - we can use the CRTC atomic state directly. Signed-off-by: Russell King commit 47dc413b0025e96eaa43bdd808233763e4080a10 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: convert overlay plane to atomic state The overlay plane support updates asynchronously to the request, but the drm_plane_helper_update() transitional helper waits for a vblank event before releasing the framebuffer. Using the transitional helper would make the call block, which would introduce a performance regression. Convert the overlay plane update to use the atomic state structures and methods for the plane, but implement our own legacy update method rather than the transitional helper. Signed-off-by: Russell King commit de503ddff86ed31cde5ec5ea74ec7bf60d3fecc5 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: convert page_flip to use primary plane atomic_update() page_flip requests happen asynchronously, so we can't wait on the vblank event before returning to userspace, as the transitional plane update helper would do. Craft our own implementation that keeps the asynchronous behaviour of this request, while making use of the atomic infrastructure for the primary plane update. Signed-off-by: Russell King commit c36045e17a0e9206078a3254385bf9258e32d5b8 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: convert primary plane to atomic state Convert the primary plane as a whole to use its atomic state and the transitional helpers. The CRTC is also switched to use the transitional helpers for mode_set() and mode_set_base(). Signed-off-by: Russell King commit 80c63aee8143d83743a9df6d09309d3d15b20680 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: reset all atomic state during driver initialisation Reset the atomic state of any converted components during driver initialisation to ensure that we have the atomic state initialised for any component converted to atomic modeset. Signed-off-by: Russell King commit ecf25d2380313139a2cc5f07e7ac2d910054b478 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: merge armada_drm_gra_plane_regs() into only caller armada_drm_gra_plane_regs() is now only ever called from within armada_drm_primary_update_state(), so merge it into this function. Signed-off-by: Russell King commit cfd1b63af78bfce8161e5f65a1d799a9c33b52c6 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: use core of primary update_plane for mode set Use the core of the update_plane method to configure the primary plane within mode_set() rather than duplicating this code. This moves us closer to the same code structure that the atomic modeset transitional helpers will use. Signed-off-by: Russell King commit f9a13bb3baf6009225e91f2b9748ed27f2db9c2c Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: move mode set vblank handling and disable/enable Move the mode set vblank handling and controller enable/disable to the prepare() and commit() callbacks. This will be needed when we move to mode_set_nofb() as we should not enable the controller without the plane coordinates and location having been properly updated. Signed-off-by: Russell King commit 0239520e0290e7d5f186f7fb7f7ce307c478a439 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: add rectangle helpers Add helpers to convert rectangle width/height and x/y to register values. Signed-off-by: Russell King commit 1729f56010a960f182a36e09ce8d6504fa637d76 Author: Russell King Date: Mon Jul 30 11:52:34 2018 +0100 drm/armada: clean up armada_drm_crtc_page_flip() drm_mode_page_flip_ioctl() already takes care of checking the framebuffer format, and also assigns primary->fb after a successful call to this handler. These are both redundant, and can be removed. Signed-off-by: Russell King commit 7794ec7774066eb12af67a0a756bddd66f2d50f8 Author: Souptick Joarder Date: Mon Jul 30 11:52:31 2018 +0100 drm/armada: Adding new typedef vm_fault_t Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_pfn() returns err which driver mapped into VM_FAULT_* type. The new function vmf_insert_pfn() will replace this inefficiency by returning VM_FAULT_* type. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Russell King commit 830aadceae20c08704562f0b83fdd0f0062d06c6 Author: Thomas Zimmermann Date: Mon Jul 30 11:52:31 2018 +0100 drm/armada: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Russell King commit 001a30c4d0e871b21d296e1bcafc6756a1b10607 Author: Nicolas Pitre Date: Wed Jul 25 04:38:54 2018 +0100 ARM: 8785/1: use compiler built-ins for ffs and fls On ARMv5 and above, it is beneficial to use compiler built-ins such as __builtin_ffs() and __builtin_ctzl() to implement ffs(), __ffs(), fls() and __fls(). The compiler does inline the clz instruction and even the rbit instruction when available, or provide a constant value when possible. On ARMv4 the compiler calls out to helper functions for those built-ins so it is best to keep the open coded versions in that case. Signed-off-by: Nicolas Pitre Signed-off-by: Russell King commit cbfc5619e0cc8dcdf3020e27426eec362307cc14 Author: Vladimir Murzin Date: Mon Jul 23 09:37:09 2018 +0100 ARM: 8784/1: NOMMU: Allow enter in Hyp mode ARMv8R adds support for virtualisation extension (with some deviation from v8A). With this patch hyp-unaware boot code can offload to kernel setting up HYP stuff in a sane state. Signed-off-by: Vladimir Murzin Signed-off-by: Russell King commit c803ce3f18bd93b3b4a15d1da0c5b5ebc60e0b85 Author: Vladimir Murzin Date: Mon Jul 23 09:36:18 2018 +0100 ARM: 8783/1: NOMMU: Extend check for VBAR support ARMv8R adds support for VBAR and updates ID_PFR1 with the new filed Sec_frac (bits [23:20]): Security fractional field. When the Security field is 0000, determines the support for features from the ARMv7 Security Extensions. Permitted values are: 0000 No features from the ARMv7 Security Extensions are implemented. This value is not supported in ARMv8 if ID_PFR1 bits [7:4] are zero. 0001 The implementation includes the VBAR, and the TCR.PD0 and TCR.PD1 bits. 0010 As for 0001, plus the ability to access Secure or Non-secure physical memory is supported. All other values are reserved. This field is only valid when ID_PFR1[7:4] == 0, otherwise it holds the value 0000. Signed-off-by: Vladimir Murzin Signed-off-by: Russell King commit 35f5a6acfb5be94e0b9df21c2a5ba934237c1ca3 Author: Masahiro Yamada Date: Wed Jul 18 02:07:47 2018 +0100 ARM: 8782/1: vfp: clean up arch/arm/vfp/Makefile Since commit 799c43415442 ("kbuild: thin archives make default for all archs"), $(AR) is used instead of $(LD) to combine object files. The following code in arch/arm/vfp/Makefile: LDFLAGS +=--no-warn-mismatch ... is no longer used. Also, arch/arm/Makefile already guards arch/arm/vfp/ by a boolean symbol, CONFIG_VFP, like this: core-$(CONFIG_VFP) += arch/arm/vfp/ So, $(CONFIG_VFP) is always evaluated to y in arch/arm/vfp/Makefile. There is no point to use pseudo object, vfp.o, which never becomes a module. Add all objects to obj-y directly. Signed-off-by: Masahiro Yamada Signed-off-by: Russell King commit bd096f6443194e57382686a3ac5f2ce4e82b55d7 Author: Janosch Frank Date: Wed Jul 18 13:40:22 2018 +0100 KVM: s390: Add skey emulation fault handling When doing skey emulation for huge guests, we now need to fault in pmds, as we don't have PGSTES anymore to store them when we do not have valid table entries. Signed-off-by: Janosch Frank commit 637ff9efe5eab419ea7f2bd6f2cf50f3cb69e322 Author: Janosch Frank Date: Fri Jul 13 11:28:28 2018 +0100 s390/mm: Add huge pmd storage key handling Storage keys for guests with huge page mappings have to be managed in hardware. There are no PGSTEs for PMDs that we could use to retain the guests's logical view of the key. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand commit 3afdfca69870963ae01e280732a5ee493a2fcbb3 Author: Janosch Frank Date: Fri Jul 13 11:28:26 2018 +0100 s390/mm: Clear skeys for newly mapped huge guest pmds Similarly to the pte skey handling, where we set the storage key to the default key for each newly mapped pte, we have to also do that for huge pmds. With the PG_arch_1 flag we keep track if the area has already been cleared of its skeys. Signed-off-by: Janosch Frank Reviewed-by: Martin Schwidefsky commit 964c2c05c9f3095a18387a57b289cf06de637521 Author: Dominik Dingel Date: Fri Jul 13 11:28:25 2018 +0100 s390/mm: Clear huge page storage keys on enable_skey When a guest starts using storage keys, we trap and set a default one for its whole valid address space. With this patch we are now able to do that for large pages. To speed up the storage key insertion, we use __storage_key_init_range, which in-turn will use sske_frame to set multiple storage keys with one instruction. As it has been previously used for debuging we have to get rid of the default key check and make it quiescing. Signed-off-by: Dominik Dingel Signed-off-by: Janosch Frank [replaced page_set_storage_key loop with __storage_key_init_range] Reviewed-by: Martin Schwidefsky Reviewed-by: David Hildenbrand commit 0959e168678d2d95648317e1e5e46bcb358272eb Author: Janosch Frank Date: Tue Jul 17 13:21:22 2018 +0100 s390/mm: Add huge page dirty sync support To do dirty loging with huge pages, we protect huge pmds in the gmap. When they are written to, we unprotect them and mark them dirty. We introduce the function gmap_test_and_clear_dirty_pmd which handles dirty sync for huge pages. Signed-off-by: Janosch Frank Acked-by: David Hildenbrand commit 6a3762778d1ba1a58ab473124790cd612d10eadc Author: Janosch Frank Date: Fri Jul 13 11:28:22 2018 +0100 s390/mm: Add gmap pmd invalidation and clearing If the host invalidates a pmd, we also have to invalidate the corresponding gmap pmds, as well as flush them from the TLB. This is necessary, as we don't share the pmd tables between host and guest as we do with ptes. The clearing part of these three new functions sets a guest pmd entry to _SEGMENT_ENTRY_EMPTY, so the guest will fault on it and we will re-link it. Flushing the gmap is not necessary in the host's lazy local and csp cases. Both purge the TLB completely. Signed-off-by: Janosch Frank Reviewed-by: Martin Schwidefsky Acked-by: David Hildenbrand commit 7c4b13a7c042fd6b71dc48d291208f8a97fad333 Author: Janosch Frank Date: Fri Jul 13 11:28:21 2018 +0100 s390/mm: Add gmap pmd notification bit setting Like for ptes, we also need invalidation notification for pmds, to make sure the guest lowcore pages are always accessible and later addition of shadowed pmds. With PMDs we do not have PGSTEs or some other bits we could use in the host PMD. Instead we pick one of the free bits in the gmap PMD. Every time a host pmd will be invalidated, we will check if the respective gmap PMD has the bit set and in that case fire up the notifier. Signed-off-by: Janosch Frank commit 58b7e200d2f1f9af9ef69a401a877791837a1c87 Author: Janosch Frank Date: Fri Jul 13 11:28:20 2018 +0100 s390/mm: Add gmap pmd linking Let's allow pmds to be linked into gmap for the upcoming s390 KVM huge page support. Before this patch we copied the full userspace pmd entry. This is not correct, as it contains SW defined bits that might be interpreted differently in the GMAP context. Now we only copy over all hardware relevant information leaving out the software bits. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand commit 2c46e974dd8b5316e65637af0ff6d4bc78554b2e Author: Janosch Frank Date: Fri Jul 13 11:28:18 2018 +0100 s390/mm: Abstract gmap notify bit setting Currently we use the software PGSTE bits PGSTE_IN_BIT and PGSTE_VSIE_BIT to notify before an invalidation occurs on a prefix page or a VSIE page respectively. Both bits are pgste specific, but are used when protecting a memory range. Let's introduce abstract GMAP_NOTIFY_* bits that will be realized into the respective bits when gmap DAT table entries are protected. Signed-off-by: Janosch Frank Reviewed-by: Christian Borntraeger Reviewed-by: David Hildenbrand commit 5a045bb9c44caebcf4e88bf78343166596c0014b Author: Janosch Frank Date: Fri Jul 13 11:28:16 2018 +0100 s390/mm: Make gmap_protect_range more modular This patch reworks the gmap_protect_range logic and extracts the pte handling into an own function. Also we do now walk to the pmd and make it accessible in the function for later use. This way we can add huge page handling logic more easily. Signed-off-by: Janosch Frank Reviewed-by: Christian Borntraeger Reviewed-by: Martin Schwidefsky commit c9c9780d8fa526a124933134a7e4041fa09662f6 Author: Ladislav Michl Date: Sat Jul 28 14:30:17 2018 +0200 ASoC: wm8988: fix typo in rate constraints Remove duplicated entry and add missing zero in rate constraints. Signed-off-by: Ladislav Michl Signed-off-by: Mark Brown commit 279fef50b607f9cee94f10bae84f6730e97ccd7c Author: Edward Cragg Date: Fri Jul 27 13:59:28 2018 +0100 ASoC: tegra: i2s: Fix typo/broken macro Fix typo in macro TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK. Signed-off-by: Edward Cragg Signed-off-by: Jorge Sanjuan Reviewed-by: Jon Hunter Signed-off-by: Mark Brown commit 222440b4e832059c0ddf18d1e409f0552ab53a7d Author: Florian Westphal Date: Wed Jul 4 12:48:04 2018 +0200 netfilter: nf_tables: handle meta/lookup with direct call Currently nft uses inlined variants for common operations such as 'ip saddr 1.2.3.4' instead of an indirect call. Also handle meta get operations and lookups without indirect call, both are builtin. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 5a4c996764da496afcc470a6e13dc23a8f55aca8 Merge: bafaf056e073 9b3d9bb3e4de Author: Rafael J. Wysocki Date: Mon Jul 30 11:27:01 2018 +0200 Merge back cpufreq material for 4.19. commit 1c58e9cc5b56d43b6121792c4b7f81b8dc4463cc Author: John Whitmore Date: Sun Jul 29 22:07:47 2018 +0100 staging:rtl8192u: Refactor enum DM_CCK_Rx_Path_Method - Style The enumerated type DM_CCK_Rx_Path_Method is used as a container for constant definitions, rather then an enumerated type enabling compiler type checking. To correct this, the variable which uses the constants, defined by the enumeration, has had its type changed from a u8 to the enumeration. Additionally the type has been moved above the structure where the type is used, to avoid compiler error. The typedef has been removed from the enumerated type to clear the checkpatch issue with defining new types. The name of the type has been changed to cck_rx_path_method to clear the checkpatch issue with CamelCase naming. And the enumerated constant CCK_Rx_Version_MAX has been removed, since it is never used in code. The changes are all coding style in nature and so should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit cff3d470010a74b96efc7790a7acc2e908761e64 Author: John Whitmore Date: Sun Jul 29 22:07:46 2018 +0100 staging:rtl8192u: Refactor enum dm_dig_cs_ratio_e - Style The enumerated type dm_dig_cs_ratio_e is never actually used as a type, but only as a collection of related constants. This is because the variables, which use the defined constant values, are defined as being of type u8 rather then tne enumerated type. This omission negates the possibility of taking advantage of compiler type checking. To enable the use of compiler type checking of the enumeration the two variables, (curcs_ratio_state & precs_ratio_state), which use the type's constants have their types changed from u8 to enum dig_cck_cs_ratio_state. Additionally the types declaration has been moved above the dig structure, where the type is used. The 'typedef' keyword has been removed from the type to clear the checkpatch issue with defining new types. And the constant DIG_CS_MAX has been removed since this is never used in the code. These changes are purely coding style changes and should not impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a48aa566becb1f15e123db3450289c7cdb9b1d5d Author: John Whitmore Date: Sun Jul 29 22:07:45 2018 +0100 staging:rtl8192u: Refactor enum dm_dig_pd_th_e - Style The enumerated type dm_dig_pd_th_e is never actually used as the type for the two variables which use the constants, which the enumeration defines. This omission removes the possibility of taking advantage of compiler type checking. To correct this the two member variables, (curpd_thstate & prepd_thstate) have been changed to use the type enum dig_pkt_detection_threshold rather then u8. Additionally the enum's declaration has been moved above the dig structure, where the type is used, the 'typedef' has been removed to clear the checkpatch issue with defining new types, and the value 'DIG_PD_MAX' has been removed from the enumeration, since it is never used in code. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c3575c7c564a89405d9c2632a74f89cc3aaa3973 Author: John Whitmore Date: Sun Jul 29 22:07:44 2018 +0100 staging:rtl8192u: Refactor dm_dig_connect_e - Style The enumerated type dm_dig_connect_e is only used to group constant values, as the actual type is never used as the type for the variables which use the defined constants (cur_connect_state and pre_connect_state). These two member variables have had there defined types changed to properly reflect there usage and to permit compiler type checks to be performed. In addition the definition of the enumerated type has been moved above the structure which uses the type. The typedef of the enumerated type has been removed to clear the checkpatch issue with defining new types and the enumerated value DIG_CONNECT_MAX has been removed since it is never used in code. The resulting changes are all coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 9888151133c8e6c9e5eefc62cd72239ed1a94454 Author: John Whitmore Date: Sun Jul 29 22:07:43 2018 +0100 staging:rtl8192u: Remove unused enum dm_dig_dbg_e - Style The enumerated type dm_dig_dbg_e is never used in code so has simply been removed from the source code. this is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit ebd0dcbd93b58bca8a07710eb8f2f4bc29b67e2e Author: John Whitmore Date: Sun Jul 29 22:07:42 2018 +0100 staging:rtl8192u: Refactor enum dm_dig_alg_e - Style The enumerated type dm_dig_alg_e is only used by one variable in the code, 'dig_algorithm', a member variable of the structure dig. That member variable was defined to be of type 'u8' thus negating any advantage of the use of an enumerated type, (compiler type-checking). The type of the variable 'dig_algorithm' has been change to reflect its use of the enumeration and the enumerated type moved in the file so that it appears before it is used in the file. Additionally the 'typedef' has been removed to clear the checkpatch issue with defining new types, and the type renamed to enum dig_algorithm. The enumerated constant DIG_ALGO_MAX has been removed from the type since it is never used in the code. These changes are all coding style in nature and as such should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit fb2a2729720f91866ed255dc19402a5ef1d561ad Author: John Whitmore Date: Sun Jul 29 22:07:41 2018 +0100 staging:rtl8192u: Remove enum dm_dig_op_e - Style Remove the enumerated type dm_dig_op_e. The type is only used as a parameter to the function dm_change_dynamic_initgain_thresh(), but that function is never referenced in the code at all. I would consider this to be a coding style change as the function is never referenced and as a result the enumeration is never used. In any case there should be no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 06761ce4290ebf3c4e770f7f5a9caec675697204 Author: John Whitmore Date: Sun Jul 29 22:07:40 2018 +0100 staging:rtl8192u: Refactor enum dm_ratr_sta_e usage - Style The enumerated type dm_ratr_sta_e was defined in the file drivers/staging/rtl8192u/r8192U_dm.h but never actually used in that file. The only variable which uses this enumerated type is 'ratr_state', a member variable of the _rate_adaptive structure defined in the file drivers/staging/rtl8192u/r8192U.h. To clarify and place the enumerated type close to where it is used the type was moved to the drivers/staging/rtl8192u/r8192U.h file. In addition the member variable 'ratr_state' which uses the enumerated constants was declared as being of type 'u8'. This negates any advantage of the enumerated type, compiler type-checking, so that member variable's type has been changed to being of the enumerated type. The typedef from the enumerated type has been removed to clear the checkpatch issue with defining new types. Additionally the name of the type has been left as enum dynamic_ratr_state This is a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit e0043d14fcb500c9feedb14aa83fe425a4d1d699 Author: John Whitmore Date: Sun Jul 29 22:07:39 2018 +0100 staging:rtl8192u: Refactor use of enum dm_dig_sta_e - Style Refactor the use of the enumerated type dm_dig_sta_e, which is not actually used for type checking by the compiler. The typedef of dm_dig_sta_e is removed to clear the checkpatch issue with defining new types, and the enumerated type is left with the name enum dynamic_init_gain_state The enumerated type defines values for the enumeration, which are used by both dig_state and dig_highpwr_state, (members of the struct dig). Both of those variables were defined as being of type u8. This negates any usefulness of the use of the enumeration, (compiler type checking). To make use of the compiler's type-checking the two member variables, dig_state and dig_highpwr_state have been changed to being of type enum dynamic_init_gain_state. The enumerated type has been moved above the struct dig definition so that the enumeration is already defined when the compiler reaches the two types using the enumerated type. These changes, whilst convoluted, are purely coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit e2102bc362a2ac518b5bddc5ef857f1e52103d79 Author: John Whitmore Date: Sun Jul 29 22:07:38 2018 +0100 staging:rtl8192u: Remove typedef of cmpk_set_cfg_t - Style Remove the typedef from cmpk_set_cfg_t, leaving the structure as struct cmd_pkt_set_configuration. This change clears the checkpatch issue with defining new types. The change is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 17a16b769466e2c44dc8ee8ea22442ac8bafa5eb Author: John Whitmore Date: Sun Jul 29 22:07:37 2018 +0100 staging:rtl8192u: Remove typedef of cmpk_intr_sta_t - Style Remove the typedef of struct cmpk_intr_sta_t, the name of the structure has been left as cmd_pkt_interrupt_status. This clears the checkpatch issue with creating new types in code. The change is purely a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 9989b9d131a1dedd6d3a9c4371408fb35c224e92 Author: John Whitmore Date: Sun Jul 29 22:07:36 2018 +0100 staging:rtl8192u: Correct spelling in comments - style Correct the spelling of a number of comments, which cause a checkpatch issue. This is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 171b51a9b710d4d8e9c33aafbbc5b09408153be6 Author: John Whitmore Date: Sun Jul 29 22:07:35 2018 +0100 staging:rtl8192u: Removed unused CMPK_RX_DBG_MSG_SIZE - Style Remove the unused macro definition CMPK_RX_DBG_MSG_SIZE. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit b14947da727c132878517f7387ccd6ee77acffec Author: John Whitmore Date: Sun Jul 29 22:07:34 2018 +0100 staging:rtl8192u: Remove unused CMPK_TX_SET_CONFIG_SIZE - Style Remove the unused macro CMPK_TX_SET_CONFIG_SIZE. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit ac2028a77dfc8fa2add5c308f2eb6de773f6a607 Author: John Whitmore Date: Sun Jul 29 22:07:33 2018 +0100 staging:rtl8192u: Remove typedef of struct cmpk_txfb_t - Style Remove the typedef of the structure cmpk_txfb_t. This clears the checkpatch issue with defining new types. Additionally the type is renamed from cmpk_txfb_t to cmd_pkt_tx_feedback removing the '_t' as the typedef has been removed. These changes are purely coding style in nature and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 24d1c2171f15bb6fad2ad69cfc2ee81dc4577b76 Author: Kunihiko Hayashi Date: Thu Jul 19 18:05:36 2018 +0900 pinctrl: uniphier: add spi pin-mux settings Add pin-mux settings for spi controller. Signed-off-by: Kunihiko Hayashi Signed-off-by: Keiji Hayashibara Acked-by: Masahiro Yamada Signed-off-by: Linus Walleij commit 8f0edc1125dd49a0af27d8a42406226f3effb18a Author: John Whitmore Date: Sun Jul 29 00:14:52 2018 +0100 staging:rtl8192u: Remove unused constants - Style Remove defined constants from code, since they are never actually used in code. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8e542c484c80ced3d849b2e5380deb8bc4329368 Author: John Whitmore Date: Sun Jul 29 00:14:51 2018 +0100 staging:rtl8192u: Rename union QOS_TSINFO - Style The union QOS_TSINFO, as a type, should have a lowercase name. The union has therefore been renamed to qos_tsinfo. Additionally the 'typedef' directive has been removed to clear the checkpatch issue with defining new types. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 489d5cd8046e6cd7db4123df57108ca52c2e49fe Author: John Whitmore Date: Sun Jul 29 00:14:50 2018 +0100 staging:rtl8192u: Rename enum DIRECTION_VALUE - Style The enumerated type DIRECTION_VALUE should be named in lowercase to comply with coding standard so is renamed to direction_value. In addition the 'typedef' directive has been removed to clear the checkpatch issue with defining new types. These changes are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 15321170f7e2fa1d010f021589c8f7168c5d23fa Author: John Whitmore Date: Sun Jul 29 00:14:49 2018 +0100 staging:rtl8192u: Remove unused union ECW -Style The union ECW is never used in code so has simply been removed. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit dd3c69e115a7637856ca6ba2396dbff1b811468a Author: John Whitmore Date: Sun Jul 29 00:14:48 2018 +0100 staging:rtl8192u: Remove unused union AC_PARAM - Style The union ACM_PARAM is never actually used in code so removed. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a7f4a9e21bd1ef4f0b70fc4c861dbbfb2308a748 Author: John Whitmore Date: Sun Jul 29 00:14:47 2018 +0100 staging:rtl8192u: Rename member variables - Style Rename the member variables of union aci_aifsn, which should be named in lowercase. The only member variable, of this union, which is actually used is 'acm'. This are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4116ad1d993cc72f84f0c4cf370ac314ad9f799e Author: John Whitmore Date: Sun Jul 29 00:14:46 2018 +0100 staging:rtl8192u: Rename ACI_AIFSN - Style Rename the union ACI_AIFSN to aci_aifsn and remove the typedef directive. The removal of the typedef clears the checkpatch issue with defining new types. The renaming is to adhere to the coding style where types are name in lower case. These changes are coding style changes which should have no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 2e8ce8efc9626cf1da0796df97d01fcb7b8b9ad2 Author: John Whitmore Date: Sun Jul 29 00:14:45 2018 +0100 staging:rtl8192u: Add spaces around operators - Style Add the required spaces around '+' and '*' operators. This is a coding style change to clear the checkpatch issue. There should be no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8d7430de9887c92847f2b7e608ba21a609254e47 Author: Michael Straube Date: Sun Jul 29 20:54:47 2018 +0200 staging: rtl8188eu: remove unnecessary parentheses Remove unnecessary parentheses, also clears checkpatch issues about missing spaces around '-'. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 47c8264e68e8a19de0d22ff4e336c4153a8717d4 Author: Michael Straube Date: Sun Jul 29 20:54:46 2018 +0200 staging: rtl8188eu: fix comparsion to true Use if(x) instead of if(x == true). Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 3da4a578ce610ffee188a765aca16a4be9ba2f94 Author: Michael Straube Date: Sun Jul 29 20:54:45 2018 +0200 staging: rtl8188eu: replace tabs with spaces Replace tabs with spaces in function definition and variable declarations. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 816f4a46e0b49b57da2c0e31e54a43cfd0afcd9f Author: Michael Straube Date: Sun Jul 29 20:54:44 2018 +0200 staging: rtl8188eu: remove redundant includes Both osdep_service.h and drv_types.h are included from hal_intf.h, so remove the redundant includes from hal_intf.c. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 30622c87c38e8a64a6b5a4e44c65079f6f2629a0 Author: Michael Straube Date: Sun Jul 29 20:54:42 2018 +0200 staging: rtl8188eu: remove unused should_forbid_n_rate() The function should_forbid_n_rate() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 0a837d1ba505c354fff1dfa8eef0c81e63fb38fb Author: Michael Straube Date: Sun Jul 29 20:54:41 2018 +0200 staging: rtl8188eu: remove unused dump_txrpt_ccx_88e() The function dump_txrpt_ccx_88e() is nerver used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 26fd80ead0fe4dec100d6c2f8ce28897f2e25f2c Author: Todd Poynor Date: Sun Jul 29 12:36:46 2018 -0700 staging: gasket: apex: fix function param line continuation style Fix multi-line alignment formatting to look like: int ret = long_function_name(device, VARIABLE1, VARIABLE2, VARIABLE3, VARIABLE4); Many of these TODO items were previously cleaned up during the conversion to standard logging functions. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit c76b15fe7b7b8c74aa49960ecbe1d44c5c0104ab Author: Todd Poynor Date: Sun Jul 29 12:36:45 2018 -0700 staging: gasket: apex: remove static function forward declarations Remove forward declarations of static functions, move code to avoid forward references, for kernel style. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 8b8a93885d578d252bcf7d8cd1771b5991ffc7fc Author: Todd Poynor Date: Sun Jul 29 12:36:44 2018 -0700 staging: gasket: TODO: remove entry for static function kernel docs Remove the TODO entry for simplifying kernel doc style comments for static functions, now that this has been addressed. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit cef7330217ac56d68b3658af84d1d5d9a5121316 Author: Todd Poynor Date: Sun Jul 29 12:36:43 2018 -0700 staging: gasket: sysfs: simplify comments for static functions Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e4c4afa8db90155ad1ed5c597a1bf63994961ca9 Author: Todd Poynor Date: Sun Jul 29 12:36:42 2018 -0700 staging: gasket: interrupt: simplify comments for static functions Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 480884860158a0942aa4147c40c56dc9a1d985af Author: Todd Poynor Date: Sun Jul 29 12:36:41 2018 -0700 staging: gasket: page table: simplify comments for static functions Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 73832cf08fdbd190782c011a5e34908f7acf0e71 Author: Todd Poynor Date: Sun Jul 29 12:36:40 2018 -0700 staging: gasket: ioctl: simplify comments for static functions Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit f975c995e76be54c14fd742b816bc1b2123e625d Author: Todd Poynor Date: Sun Jul 29 12:36:39 2018 -0700 staging: gasket: core: simplify comments for static functions Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 904bb9ccf3a908840f3d5e88b4cd07f30c49959a Author: Todd Poynor Date: Sun Jul 29 12:36:38 2018 -0700 staging: gasket: apex: simplify comments for static functions Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit f9a4963019291b8ea7f2bb473b2caa7ff2238633 Author: Todd Poynor Date: Sun Jul 29 12:36:37 2018 -0700 staging: gasket: core: allow root access based on user namespace Use user namespace to determine whether gasket device file opener is root, allowing root access to containers, if necessary. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit dd9d1502feea3c23d412f289aad79e1d4e86d45d Author: Todd Poynor Date: Sun Jul 29 12:36:36 2018 -0700 staging: gasket: page table: hold references to device and pci_dev Hold references to the struct device and the pci_dev for the page table while the data structures contian pointers to these. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 34cf3ea8dae7f0aa2ab544c1d30a803016af779e Author: Todd Poynor Date: Sun Jul 29 12:36:35 2018 -0700 staging: gasket: sysfs: hold reference to device while in use Hold a reference to the struct device while a gasket sysfs mapping exists for the device and a pointer to the struct is kept in the mapping data structures. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 8dd8a48b9a7dae5493494a8603adddfdf1914716 Author: Todd Poynor Date: Sun Jul 29 12:36:34 2018 -0700 staging: gasket: core: hold reference to pci_dev while used Hold a reference on the struct pci_dev while a pointer to it is held in the gasket data structures. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit c7346797f5fb7be8e139fbeb1324669e7cb2ef9a Author: Greg Kroah-Hartman Date: Mon Jul 30 10:46:03 2018 +0200 Revert "staging:r8188eu: Use lib80211 to encrypt (TKIP) tx frames" This reverts commit 0d4876f4e977798238db594321db9184704fcf5d as it breaks the build once 4.18-rc7 was merged into the staging-next tree. Cc: Ivan Safonov Signed-off-by: Greg Kroah-Hartman commit 4f919ca2bf6da826ba1a4316e1b8e9c94e5dbeb2 Author: Anton Vasilyev Date: Fri Jul 27 16:59:29 2018 +0300 regulator: tps65217: Fix NULL pointer dereference on probe There is no check that tps->strobes is allocated successfully in tps65217_regulator_probe(). The patch adds corresponding check. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Mark Brown commit 45dd7af410b71da511085b806c22caf8ecca87e4 Merge: 8a7b5d0f75f7 4ea438da76f4 Author: Greg Kroah-Hartman Date: Mon Jul 30 10:21:14 2018 +0200 Merge tag 'usb-for-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: changes for v4.19 Not a big pull request with only 37 non-merge commits, most of which are touching dwc2 (74% of the changes). The most important changes are dwc2's support for uframe scheduling and its endian-agnostic readl/writel wrappers. From dwc3 side we have a special new glue layer for Synopsys HAPS which will help Synopsys running FPGA validation using our upstream driver. We also have the beginnings of dual-role support for Intel Merrifield platform. Apart from these, just a series of non-critical changes. commit 6856909ce542ddea39f9dfc8429b26b3bb0a9e8b Author: Linus Walleij Date: Tue Jun 5 15:42:36 2018 +0200 i2c: mux: pca954x: use helper variable in probe This creates a struct device *dev helper variable in probe() which IMO makes the code less cluttered and easier to read. Also rename the of_node veriable to the common shortform "np" (node pointer). Signed-off-by: Linus Walleij [peda: slightly edited commit message and removed some surplus newlines] Signed-off-by: Peter Rosin commit c88b94a9f43cecdeae4fa3d30cadd9a3f604372f Merge: 38c6aa2175c3 acb1872577b3 Author: Greg Kroah-Hartman Date: Mon Jul 30 10:13:15 2018 +0200 Merge 4.18-rc7 into staging-next We want the staging changes in here for testing and merge issues. Signed-off-by: Greg Kroah-Hartman commit d2fc88a61b4ea99f574bde16e92718e22f312136 Merge: e16f4f3e0b7d acb1872577b3 Author: Greg Kroah-Hartman Date: Mon Jul 30 10:08:09 2018 +0200 Merge 4.18-rc7 into driver-core-next We need the driver core changes in here as well for testing. Signed-off-by: Greg Kroah-Hartman commit 8a7b5d0f75f757fa88b0d17c19523161b27b8e80 Merge: 7bab01ecc6c4 acb1872577b3 Author: Greg Kroah-Hartman Date: Mon Jul 30 10:04:58 2018 +0200 Merge 4.18-rc7 into usb-next We want the USB fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman commit 4ea438da76f4277627347147f6f7004affae07b9 Author: Thinh Nguyen Date: Fri Jul 27 18:52:41 2018 -0700 usb: dwc3: gadget: Check MaxPacketSize from descriptor endpoint->maxpacket is not updated after setting the usb_set_maxpacket_limit() on endpoint enable. The MaxPacketSize can be different than the endpoint->maxpacket_limit. DWC3 has been consistently using MaxPacketSize from the endpoint's descriptor, so let's keep it consistent and use the MaxPacketSize from the endpoint's descriptor instead. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit f8781d55099026061f8b03f2636c0b192f5093e2 Author: Douglas Anderson Date: Thu Jul 26 13:07:30 2018 -0700 usb: dwc2: Turn on uframe_sched on "stm32f4x9_fsotg" platforms There's no reason to have the uframe scheduler off on dwc2. Running with uframe_sched = False is equivalent to saying "I don't want to run the correct code, I want to run the old and incorrect code". The uframe scheduler has been off on stm32f4x9_fsotg since commit e35b135055e2 ("usb: dwc2: Add support for STM32F429/439/469 USB OTG HS/FS in FS mode (internal PHY)"). That commit is pretty recent, so it's unclear to me why the uframe scheduler was left off. Hopefully it's because someone copied it from other parameters and didn't think to try it? Presumably if everyone is good w/ the uframe_sched turned back on we can kill all the old and crufty non-uframe sched code. Reviewed-by: Minas Harutyunyan Signed-off-by: Douglas Anderson Signed-off-by: Felipe Balbi commit 3af0540ad39e0f4935c572ad94f57d5408e95cec Author: Douglas Anderson Date: Thu Jul 26 13:07:29 2018 -0700 usb: dwc2: Turn on uframe_sched on "amlogic" platforms There's no reason to have the uframe scheduler off on dwc2. Running with uframe_sched = False is equivalent to saying "I don't want to run the correct code, I want to run the old and incorrect code". The uframe scheduler has been off on Amlogic since commit f94310ac076e ("usb: dwc2: add support for Meson8b and GXBB SoCs"). While this was after most of the recent improvements, notably the commit 9f9f09b048f5 ("usb: dwc2: host: Totally redo the microframe scheduler"), presumably the parameters were copied from another platform and the uframe scheduler wasn't tried. Presumably if everyone is good w/ the uframe_sched turned back on we can kill all the old and crufty non-uframe sched code. Reviewed-by: Minas Harutyunyan Signed-off-by: Douglas Anderson Signed-off-by: Felipe Balbi commit aea8916702eecc76db3d8c111d61d8c78955fe92 Author: Douglas Anderson Date: Thu Jul 26 13:07:28 2018 -0700 usb: dwc2: Turn on uframe_sched on "his" platforms There's no reason to have the uframe scheduler off on dwc2. Running with uframe_sched = False is equivalent to saying "I don't want to run the correct code, I want to run the old and incorrect code". The uframe scheduler has been off on HiSilicon since commit 37dd9d65cc41 ("usb: dwc2: add support of hi6220"). Since then there have been many many improvements, notably the commit 9f9f09b048f5 ("usb: dwc2: host: Totally redo the microframe scheduler") Presumably if everyone is good w/ the uframe_sched turned back on we can kill all the old and crufty non-uframe sched code. Acked-by: Minas Harutyunyan Reviewed-by: Minas Harutyunyan Signed-off-by: Douglas Anderson Tested-by: John Stultz Signed-off-by: Felipe Balbi commit b6de7b8c38e99eee5d5ef673f2ff63c982ef608c Author: Douglas Anderson Date: Thu Jul 26 13:07:27 2018 -0700 usb: dwc2: Turn on uframe_sched on "bcm" platforms There's no reason to have the uframe scheduler off on dwc2. Running with uframe_sched = False is equivalent to saying "I don't want to run the correct code, I want to run the old and incorrect code". The uframe scheduler has been off on Broadcom since commit 58b179dcf28c ("staging: dwc2: disable uframe_sched on the bcm2835"). Since then there have been many many improvements, notably the commit 9f9f09b048f5 ("usb: dwc2: host: Totally redo the microframe scheduler") Presumably if everyone is good w/ the uframe_sched turned back on we can kill all the old and crufty non-uframe sched code. Reviewed-by: Minas Harutyunyan Signed-off-by: Douglas Anderson Tested-by: Stefan Wahren Signed-off-by: Felipe Balbi commit 4d4f1e79b800c80313280eec1af25a242a50dce5 Author: Minas Harutyunyan Date: Fri Jul 27 14:48:45 2018 +0400 usb: dwc2: gadget: ISOC's starting flow improvement To start ISOC transfers in handlers dwc2_gadget_handle_nak() and dwc2_gadget_handle_out_token_ep_disabled() driver reads current frame number, based on which, set target frame number to start first ISOC transfer. In case if system's high IRQ latency and multiple EP's asserted interrupt in same frame, there are high probability that when reading current frame number in EP's handlers, actual frame number can be increased. As result for bInterval > 1, starting target frame will be set wrongly and all ISOC packets will be dropped. In patch "usb: dwc2: Change reading of current frame number flow" reading of current frame number done ASAP in common interrupt handler. This frame number stored in frame_number variable which used as starting frame number for ISOC EP's in above mentioned handlers. Signed-off-by: Minas Harutyunyan Signed-off-by: Felipe Balbi commit fe369e1826b3efae11012ad07d1713223c37ec5d Author: Gevorg Sahakyan Date: Fri Jul 27 12:26:29 2018 +0400 usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic. Declared dwc2_check_core_endianness() function for dynamicly check core endianness. Added needs_byte_swap flag to hsotg structure, and depending on flag swap value inside dwc2_readl/writel functions. Signed-off-by: Gevorg Sahakyan Signed-off-by: Felipe Balbi commit b138e23d3dff90c0494925b4c1874227b81bddf7 Author: Anurag Kumar Vulisha Date: Fri Jul 27 13:11:20 2018 +0530 usb: dwc3: core: Enable AutoRetry feature in the controller By default when core sees any transaction error (CRC or overflow) it replies with terminating retry ACK (Retry=1 and Nump == 0). Enabling this Auto Retry feature in controller will make the core send a non-terminanting ACK upon such transaction errors. That is, ACK TP with Retry=1 and Nump != 0. Doing so will give controller a chance to recover from transient error conditions. Signed-off-by: Anurag Kumar Vulisha Signed-off-by: Felipe Balbi commit a77004681148f5773c20370812ca7d14443fb091 Author: Thinh Nguyen Date: Thu Jul 26 13:52:11 2018 -0700 usb: dwc3: Set default mode for dwc_usb31 dwc_usb31 does not support OTG mode. If the controller supports DRD but the dr_mode is not specified or set to OTG, then set the mode to peripheral. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 39facfa01c9fc64f90233d1734882f0a0cafe36a Author: Yoshihiro Shimoda Date: Fri Jul 27 10:50:40 2018 +0900 usb: gadget: udc: renesas_usb3: Add register of usb role switch This patch adds role switch support for R-Car SoCs into the USB 3.0 peripheral driver. Some R-Car SoCs (e.g. R-Car H3) have USB 3.0 dual-role device controller which has the USB 3.0 xHCI host and Renesas USB 3.0 peripheral. Unfortunately, the mode change register (DRD_CON) contains the USB 3.0 peripheral controller side only. So, this renesas_usb3 driver manages the DRD_CON now. However, in peripheral mode, the host should stop. Also the host hardware needs to reinitialize its own registers when the mode changes from peripheral to host mode. Otherwise, the host cannot work correctly (e.g. detect a device as high-speed). To achieve this reinitialization by a driver, this driver also registers a role switch driver to manage the DRD_CON and get a device pointer of usb 3.0 host from "companion" property of OF. Then, when the usb role is changed, renesas_usb3_role_switch_set() will attach/release the xhci-plat driver to reinitialize the host hardware. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Heikki Krogerus Signed-off-by: Felipe Balbi commit 342ccce173a5b95541c6ee712e1a7249b10db5cb Author: Gevorg Sahakyan Date: Thu Jul 26 18:00:41 2018 +0400 usb: dwc2: replace ioread32/iowrite32_rep with dwc2_readl/writel_rep dwc2_readl_rep/dwc2_writel_rep functions using readl/writel in a loop. Signed-off-by: Gevorg Sahakyan Signed-off-by: Felipe Balbi commit f25c42b8d604fbca6d8d3eff2365a73bbef076d3 Author: Gevorg Sahakyan Date: Thu Jul 26 18:00:13 2018 +0400 usb: dwc2: Modify dwc2_readl/writel functions prototype Added hsotg argument to dwc2_readl/writel function prototype, and also instead of address pass offset of register. hsotg will contain flag field for endianness. Also customized dwc2_set_bit and dwc2_clear_bit function for dwc2_readl/writel functions. Signed-off-by: Gevorg Sahakyan Signed-off-by: Felipe Balbi commit c31d983beaf04e6754918aa1073f053b12efb700 Author: Andy Shevchenko Date: Thu Jul 26 14:48:57 2018 +0300 usb: dwc3: pci: Intel Merrifield can be host On Intel Edison board the OTG function is enabled, thus, USB can switch to the host mode. Allow that by changing dr_mode property to "otg" for Intel Merrifield. Signed-off-by: Andy Shevchenko Signed-off-by: Felipe Balbi commit 1a7b12f69a9434a766e77c43d113826f0413b032 Author: Andy Shevchenko Date: Thu Jul 26 14:48:56 2018 +0300 usb: dwc3: pci: Supply device properties via driver data For now all PCI enumerated dwc3 devices require some properties to be present. This allows us to unconditionally append them and supply via driver_data. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Felipe Balbi commit 262c25d68e39e0f7e7619f715752c12e167644c3 Author: Pengbo Mu Date: Mon Jul 23 18:32:38 2018 +0800 arm64: dts: dwc3: description of incr burst type Add description of 'snps,incr-burst-type-adjustment' to binding so that configuring devicetree. Reviewed-by: Rob Herring Signed-off-by: Ran Wang Signed-off-by: Pengbo Mu Signed-off-by: Felipe Balbi commit d9612c2f0449e24983a8b689603210486a930c90 Author: Pengbo Mu Date: Mon Jul 23 18:32:37 2018 +0800 usb: dwc3: Enable undefined length INCR burst type Enable the undefined length INCR burst type and set INCRx. Different platform may has the different burst size type. In order to get best performance, we need to tune the burst size to one special value, instead of the default value. Signed-off-by: Changming Huang Signed-off-by: Ran Wang Signed-off-by: Pengbo Mu Signed-off-by: Felipe Balbi commit d635db5508b0b01142d44739717d7122469f59b1 Author: Pengbo Mu Date: Mon Jul 23 18:32:36 2018 +0800 usb: dwc3: add global soc bus configuration reg0 Add the macro definition for global soc bus configuration register 0 Signed-off-by: Changming Huang Signed-off-by: Ran Wang Signed-off-by: Pengbo Mu Signed-off-by: Felipe Balbi commit 87d852de94d606010faf283bf1df70e3e825e6d0 Author: Andy Shevchenko Date: Fri Jul 20 19:54:01 2018 +0300 usb: dwc3: Describe 'wakeup_work' field of struct dwc3_pci Describe 'wakeup_work' field of struct dwc3_pci to avoid a warning: drivers/usb/dwc3/dwc3-pci.c:59: warning: Function parameter or member 'wakeup_work' not described in 'dwc3_pci' Signed-off-by: Andy Shevchenko Signed-off-by: Felipe Balbi commit 38c6aa2175c35358d01c29266000d26c78af9e36 Author: Gao Xiang Date: Mon Jul 30 09:51:01 2018 +0800 staging: erofs: use the wrapped PTR_ERR_OR_ZERO instead of open code Just clean up and logic doesn't change. Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050766.html Fixes: d72d1ce60174 ("staging: erofs: add namei functions") Reported-by: kbuild test robot Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Greg Kroah-Hartman commit 9fe37714c13cd7bc35e8e335b626090306e5efa6 Author: Masahiro Yamada Date: Sun Jul 29 10:38:13 2018 +0900 microblaze: delete wrong comment about machine_early_init machine_early_init is defined in arch/microblaze/kernel/setup.c I do not see mach-* directory for MicroBlaze. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek commit bc270b53e6aa3b9723e26a548fa1a1688ea61361 Author: Darrick J. Wong Date: Sun Jul 29 22:37:09 2018 -0700 xfs: move the repair extent list into its own file Move the xrep_extent_list code into a separate file. Logically, this data structure is really just a clumsy bitmap, and in the next patch we'll make this more obvious. No functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit ebcbef3a61a6081ffe20b0b684f18ebbf23f1dfb Author: Darrick J. Wong Date: Sun Jul 29 22:37:08 2018 -0700 xfs: pass transaction lock while setting up agresv on cyclic metadata Pass a tranaction pointer through to all helpers that calculate the per-AG block reservation. Online repair will use this to reinitialize per-ag reservations while it still holds all the AG headers locked to the repair transaction. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit f6206f00d8c55a1beba9a4be96939353e632f939 Author: Huang Shijie Date: Thu Jul 26 14:45:54 2018 +0800 dmaengine: mic_x100_dma: use the new helper to simplify the code Use dmaenginem_async_device_register() to simplify the code: remove the mic_dma_unregister_dma_device() Signed-off-by: Huang Shijie Signed-off-by: Vinod Koul commit f39b948dbeaf9da0dfd17e68704f38fe4237788f Author: Huang Shijie Date: Thu Jul 26 14:45:53 2018 +0800 dmaengine: add a new helper dmaenginem_async_device_register This patch adds the dmaenginem_async_device_register for DMA code. Use the Devres to call the release for the DMA engine driver. Signed-off-by: Huang Shijie Signed-off-by: Vinod Koul commit 0f06c02755889a9595a0883c8f4b75b2af188408 Author: Robin Gong Date: Tue Jul 24 01:46:11 2018 +0800 dmaengine: imx-sdma: add memcpy interface Add MEMCPY capability for imx-sdma driver. Signed-off-by: Robin Gong Signed-off-by: Vinod Koul commit 4a6b2e8a9a0216697405560f3a14b5f33812f444 Author: Robin Gong Date: Tue Jul 24 01:46:10 2018 +0800 dmaengine: imx-sdma: add SDMA_BD_MAX_CNT to replace '0xffff' Add macro SDMA_BD_MAX_CNT to replace '0xffff'. Signed-off-by: Robin Gong Signed-off-by: Vinod Koul commit 3fce4618279373efc59a91adb16c11da46cd69e5 Merge: ecd7963f7cf9 acb1872577b3 Author: Dave Airlie Date: Mon Jul 30 10:39:22 2018 +1000 BackMerge v4.18-rc7 into drm-next rmk requested this for armada and I think we've had a few conflicts build up. Signed-off-by: Dave Airlie commit ecd7963f7cf967009882fd56eaee1e87a229bea2 Merge: 6d52aacd92c6 b5aa3f4aef72 Author: Dave Airlie Date: Mon Jul 30 10:23:40 2018 +1000 Merge tag 'drm-amdkfd-next-2018-07-28' of git://people.freedesktop.org/~gabbayo/linux into drm-next This is amdkfd pull for 4.19. The major changes are: - Add Raven support. Raven refers to Ryzen APUs with integrated GFXv9 GPU. - Integrate GPU reset support In addition, there are a couple of small fixes and improvements, such as: - Better handling and reporting to user of VM faults - Fix race upon context restore - Allow the user to use specific Compute Units - Basic power management Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180728122306.GA5235@ogabbay-vm commit 58064e1f46b174e108c11323c2b1011064fd3efe Author: Geert Uytterhoeven Date: Thu Jun 21 22:30:53 2018 +0200 m68knommu: Fix typos in Coldfire 5272 DMA debug code If DEBUG_DMA is defined: include/asm/dma.h: In function ‘set_dma_mode’: include/asm/dma.h:393: error: ‘dmabp’ undeclared (first use in this function) include/asm/dma.h:393: error: (Each undeclared identifier is reported only once include/asm/dma.h:393: error: for each function it appears in.) include/asm/dma.h: In function ‘set_dma_addr’: include/asm/dma.h:424: error: ‘dmawp’ undeclared (first use in this function) Reported-by: kbuild test robot Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Ungerer commit eec85fa9d98a889e372a5123384a264e2bce0d87 Author: Geert Uytterhoeven Date: Mon Jun 11 10:44:21 2018 +0200 m68k: coldfire: Normalize clk API Coldfire still provides its own variant of the clk API rather than using the generic COMMON_CLK API. This generally works, but it causes some link errors with drivers using the clk_round_rate(), clk_set_rate(), clk_set_parent(), or clk_get_parent() functions when a platform lacks those interfaces. This adds empty stub implementations for each of them, and I don't even try to do something useful here but instead just print a WARN() message to make it obvious what is going on if they ever end up being called. The drivers that call these won't be used on these platforms (otherwise we'd get a link error today), so the added code is harmless bloat and will warn about accidental use. Based on commit bd7fefe1f06ca6cc ("ARM: w90x900: normalize clk API"). Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Ungerer commit 0969a204bfdaf7470d2666736b90a8595ae671e9 Author: Andy Shevchenko Date: Fri Jul 27 17:47:01 2018 +0300 gpiolib: Use GPIOD_OUT_{LOW,HIGH} macros in open drain ones There should not be anything more than stated by the name of newly introduced constants, i.e. GPIOD_OUT_LOW_OPEN_DRAIN == GPIOD_OUT_LOW + open drain and nothing more. Make it better to read and slightly more robust by using GPIOD_OUT_LOW and GPIOD_OUT_HIGH constants with open drain flag. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 17ac526824a8b5544bc2545c76f489e49c6593a2 Author: Andy Shevchenko Date: Thu Jul 26 19:59:05 2018 +0300 pinctrl: cannonlake: Fix community ordering for H variant The driver was written based on an assumption that BIOS provides unordered communities in ACPI DSDT. Nevertheless, it seems that BIOS getting fixed before being provisioned to OxM:s. So does driver. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199911 Reported-by: Marc Landolt <2009@marclandolt.ch> Signed-off-by: Andy Shevchenko Fixes: a663ccf0fea1 ("pinctrl: intel: Add Intel Cannon Lake PCH-H pin controller support") Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit 0b07609ccd48a23103881a161e49eb7a282170e7 Author: Stefan Agner Date: Thu Jul 26 17:42:52 2018 +0200 gpio: tegra: drop tegra specific GPIO lockdep classes Since commit e45d1c80c0ee ("gpio: put GPIO IRQs into their own lock class") and commit a0a8bcf4670c ("gpiolib: irqchip: use different lockdep class for each gpio irqchip") GPIO lib takes care of lockdep classes. In fact, gpiochip_irq_map() overwrites the class anyway, so the lockdep class set by the driver is useless. Remove it. Signed-off-by: Stefan Agner Signed-off-by: Linus Walleij commit 3c94d2d08a032d911bbe34f2edb24cb63a63644a Author: Stefan Agner Date: Thu Jul 26 17:40:24 2018 +0200 pinctrl: tegra: define GPIO compatible node per SoC Tegra 2 uses a different GPIO controller which uses "tegra20-gpio" as compatible string. Make the compatible string the GPIO node is using a SoC specific property. This prevents the kernel from registering the GPIO range twice in case the GPIO range is specified in the device tree. Fixes: 9462510ce31e ("pinctrl: tegra: Only set the gpio range if needed") Signed-off-by: Stefan Agner Signed-off-by: Linus Walleij commit 23211b08c367bc9b22469c1460f5dbb67142e06d Author: zhong jiang Date: Tue Jul 24 19:57:43 2018 +0800 gpio: fix meaningless return expression Fix the following sparse error: drivers/gpio/gpio-ath79.c:54:16: error: return expression in void function Signed-off-by: zhong jiang Acked-by: Alban Bedel Signed-off-by: Linus Walleij commit 55aedef50d4d810670916d9fce4a40d5da2079e7 Author: Andy Shevchenko Date: Wed Jul 25 15:42:08 2018 +0300 pinctrl: intel: Do pin translation when lock IRQ Default GPIOLIB callbacks for request and release IRQ do not do a GPIO to pin translation which is necessary for Intel hardware, such as Intel Cannonlake. Absence of the translation prevents some pins to be locked as IRQ due to direction check. Introduce own callbacks to make translation possible to avoid above issue. Fixes: a60eac3239f0 ("pinctrl: intel: Allow custom GPIO base for pad groups") Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit 9af0b3d1257756394ebbd06b14937b557e3a756b Author: Wang Shilong Date: Sun Jul 29 17:27:45 2018 -0400 ext4: fix race when setting the bitmap corrupted flag Whenever we hit block or inode bitmap corruptions we set bit and then reduce this block group free inode/clusters counter to expose right available space. However some of ext4_mark_group_bitmap_corrupted() is called inside group spinlock, some are not, this could make it happen that we double reduce one block group free counters from system. Always hold group spinlock for it could fix it, but it looks a little heavy, we could use test_and_set_bit() to fix race problems here. Signed-off-by: Wang Shilong Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit b4859f3edb47825f62d1b2efdd75fe7945996f49 Author: Dan Carpenter Date: Thu Jul 19 11:16:48 2018 +0300 pinctrl: imx: off by one in imx_pinconf_group_dbg_show() The > should really be >= here. It's harmless because pinctrl_generic_get_group() will return a NULL if group is invalid. Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver") Reported-by: Dong Aisheng Signed-off-by: Dan Carpenter Signed-off-by: Linus Walleij commit 2bee9e067cad4446928cbdcdaf788be463e74240 Author: Fabio Estevam Date: Tue Jul 24 13:29:28 2018 -0300 gpio: mxs: Fit writel() into a single line There is no need for splitting the writel() call in two lines. Make it fit into a single line instead. Signed-off-by: Fabio Estevam Signed-off-by: Linus Walleij commit 9dabfdd84bdfa25f0df486dd3de43e53e79a1892 Author: Daniel Mack Date: Fri Jul 13 18:15:38 2018 +0200 gpio: pxa: disable pinctrl calls for PXA3xx The pxa3xx driver uses the pinctrl-single driver since a while which does not implement a .gpio_set_direction() callback. The pinmux core will simply return 0 in this case, and the pxa3xx gpio driver hence believes the pinctrl driver did its job and returns as well. This effectively makes pxa_gpio_direction_{input,output} no-ops. To fix this, do not call into the pinctrl subsystem for the PXA3xx platform for now. We can revert this once the pinctrl-single driver learned to support setting pin directions. Signed-off-by: Daniel Mack Acked-by: Robert Jarzmik Signed-off-by: Linus Walleij commit a8cfcf15c91455750ecb5213ad1cbe5d9b3ec2ef Author: Arnd Bergmann Date: Tue Jul 24 13:57:10 2018 +0200 pinctrl: mediatek: include chained_irq.h header Some randconfig builds fail in the mtk-eint driver: drivers/pinctrl/mediatek/mtk-eint.c: In function 'mtk_eint_irq_handler': drivers/pinctrl/mediatek/mtk-eint.c:324:2: error: implicit declaration of function 'chained_irq_enter'; did you mean 'rcu_irq_enter'? [-Werror=implicit-function-declaration] chained_irq_enter(chip, desc); ^~~~~~~~~~~~~~~~~ rcu_irq_enter drivers/pinctrl/mediatek/mtk-eint.c:367:2: error: implicit declaration of function 'chained_irq_exit'; did you mean 'rcu_irq_exit'? [-Werror=implicit-function-declaration] The functions are declared in linux/irqchip/chained_irq.h, and including that header makes it build in all configurations. Fixes: e46df235b4e6 ("pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit") Signed-off-by: Arnd Bergmann Signed-off-by: Linus Walleij commit f39b3f45dbcb0343822cce31ea7636ad66e60bc2 Author: Eric Sandeen Date: Sun Jul 29 17:13:42 2018 -0400 ext4: reset error code in ext4_find_entry in fallback When ext4_find_entry() falls back to "searching the old fashioned way" due to a corrupt dx dir, it needs to reset the error code to NULL so that the nonstandard ERR_BAD_DX_DIR code isn't returned to userspace. https://bugzilla.kernel.org/show_bug.cgi?id=199947 Reported-by: Anatoly Trosinenko Reviewed-by: Andreas Dilger Signed-off-by: Eric Sandeen Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit 4bf4eed44bfe288f459496eaf38089502ef91a79 Author: Anton Vasilyev Date: Mon Jul 23 19:53:30 2018 +0300 gpio: ml-ioh: Fix buffer underwrite on probe error path If ioh_gpio_probe() fails on devm_irq_alloc_descs() then chip may point to any element of chip_save array, so reverse iteration from pointer chip may become chip_save[-1] and gpiochip_remove() will operate with wrong memory. The patch fix the error path of ioh_gpio_probe() to correctly bypass chip_save array. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Linus Walleij commit 430657b6be896db57d974375cc499ca212c7f01d Author: Ross Zwisler Date: Sun Jul 29 17:00:22 2018 -0400 ext4: handle layout changes to pinned DAX mappings Follow the lead of xfs_break_dax_layouts() and add synchronization between operations in ext4 which remove blocks from an inode (hole punch, truncate down, etc.) and pages which are pinned due to DAX DMA operations. Signed-off-by: Ross Zwisler Signed-off-by: Theodore Ts'o Reviewed-by: Jan Kara Reviewed-by: Lukas Czerner commit cdbf8897cb09b7baf2b8a7e78051a35a872b01d5 Author: Ross Zwisler Date: Sun Jul 29 16:59:16 2018 -0400 dax: dax_layout_busy_page() warn on !exceptional Inodes using DAX should only ever have exceptional entries in their page caches. Make this clear by warning if the iteration in dax_layout_busy_page() ever sees a non-exceptional entry, and by adding a comment for the pagevec_release() call which only deals with struct page pointers. Signed-off-by: Ross Zwisler Signed-off-by: Theodore Ts'o Reviewed-by: Jan Kara commit 1777fc97302997f016b720fea9c4d0e1ad858f56 Author: Marcel Ziswiler Date: Fri Jul 20 09:54:49 2018 +0200 gpiolib: probe deferral error reporting Actually report the error code from devm_regulator_get() which may as well just be a probe deferral. This is e.g. what one gets upon booting a Colibri T20: gpiochip_add_data_with_key: GPIOs 0..223 (tegra-gpio) failed to register Signed-off-by: Marcel Ziswiler Signed-off-by: Linus Walleij commit 8bbed1eef001fdfc0ee9595f64cc4f769d265af4 Author: Daniel Kurtz Date: Mon Jul 16 18:57:18 2018 -0600 pinctrl/amd: only handle irq if it is pending and unmasked The AMD pinctrl driver demultiplexes GPIO interrupts and fires off their individual handlers. If one of these GPIO irqs is configured as a level interrupt, and its downstream handler is a threaded ONESHOT interrupt, the GPIO interrupt source is masked by handle_level_irq() until the eventual return of the threaded irq handler. During this time the level GPIO interrupt status will still report as high until the actual gpio source is cleared - both in the individual GPIO interrupt status bit (INTERRUPT_STS_OFF) and in its corresponding "WAKE_INT_STATUS_REG" bit. Thus, if another GPIO interrupt occurs during this time, amd_gpio_irq_handler() will see that the (masked-and-not-yet-cleared) level irq is still pending and incorrectly call its handler again. To fix this, have amd_gpio_irq_handler() check for both interrupts status and mask before calling generic_handle_irq(). Note: Is it possible that this bug was the source of the interrupt storm on Ryzen when using chained interrupts before commit ba714a9c1dea85 ("pinctrl/amd: Use regular interrupt instead of chained")? Signed-off-by: Daniel Kurtz Acked-by: Thomas Gleixner Signed-off-by: Linus Walleij commit 16c796e8fac353d736055322ca6a38ba3c49f5e2 Merge: f69548ffafcc f59cf9a0551d Author: Takashi Iwai Date: Sun Jul 29 22:38:54 2018 +0200 Merge branch 'for-linus' into topic/virmidi Pull the latest ALSA sequencer fixes for the further development of virmidi. Signed-off-by: Takashi Iwai commit f78709a5d4114edc21a5d86586ed5e56e284f2bd Author: Dmitry Osipenko Date: Tue Jul 17 19:10:38 2018 +0300 gpio: tegra: Fix tegra_gpio_irq_set_type() Commit 36b312792b97 ("gpiolib: Respect error code of ->get_direction()") broke tegra_gpio_irq_set_type() because requesting of GPIO direction must be done after enabling GPIO function for a pin. This patch fixes drivers probe failure like this: gpio gpiochip0: (tegra-gpio): gpiochip_lock_as_irq: cannot get GPIO direction tegra-gpio 6000d000.gpio: unable to lock Tegra GPIO 144 as IRQ Fixes: 36b312792b97 ("gpiolib: Respect error code of ->get_direction()") Signed-off-by: Dmitry Osipenko Acked-by: Jon Hunter Tested-by: Jon Hunter Signed-off-by: Linus Walleij commit 0694f8c39f113bcdb759a7f84981a69bf5d7161d Author: Theodore Ts'o Date: Sun Jul 29 16:35:23 2018 -0400 docs: fix up the obviously obsolete bits in the new ext4 documentation Signed-off-by: Theodore Ts'o commit c19fdaeea0aa1938cf6a35aa97f9ea6fd8b22476 Author: Anson Huang Date: Wed Jul 18 09:25:32 2018 +0800 gpio: mxc: add power management support GPIO registers could lose context on i.MX7D, when enter LPSR mode, the whole SoC will be powered off except LPSR domain, GPIO banks will lose context in this case, need to restore the context after resume from LPSR mode. This patch adds new compatible string for i.MX7D which supports GPIO power off feature in suspend, and adds the GPIO save/restore operations in noirq suspend/resume phase, since GPIO is fundamental module which could be used by other peripherals' resume phase. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Linus Walleij commit 3f6bcc5162a1ba4e99e867364919168c1d821308 Author: YueHaibing Date: Sat Jul 28 18:38:06 2018 +0800 act_bpf: Use kmemdup instead of duplicating it in tcf_bpf_init_from_ops Replace calls to kmalloc followed by a memcpy with a direct call to kmemdup. Signed-off-by: YueHaibing Acked-by: Daniel Borkmann Signed-off-by: David S. Miller commit 1766e4b7047acf44cdd15aaeb1d63ed76ee78492 Author: Daniel Kurtz Date: Mon Jul 16 19:07:41 2018 -0600 pinctrl/amd: fix gpio irq level in debugfs According to the AMD BKDG, the GPIO ActiveLevel bits (10:9) map to: 00 Active High 01 Active Low 10 Active on both edges iff LevelTrig (bit 8) == 0 11 Reserved The current code has a bug where it interprets 00 => Active Low, and 01 => Active High. Fix the bug, restrict "Active on both" to just the edge trigger case, and refactor a bit to make the logic more readable. Signed-off-by: Daniel Kurtz Signed-off-by: Linus Walleij commit f9562fa4a5750d097f4468c0a7fc9a4e0d2dfdc3 Author: YueHaibing Date: Sat Jul 28 18:35:15 2018 +0800 cls_bpf: Use kmemdup instead of duplicating it in cls_bpf_prog_from_ops Replace calls to kmalloc followed by a memcpy with a direct call to kmemdup. Signed-off-by: YueHaibing Acked-by: Daniel Borkmann Signed-off-by: David S. Miller commit 0a80848ec5cc1294984e648b9a71aecf69c4bb73 Author: YueHaibing Date: Sat Jul 28 18:29:01 2018 +0800 act_pedit: remove unnecessary semicolon net/sched/act_pedit.c:289:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit b23641fe731f035a6071a654fd64309fa2f12208 Author: YueHaibing Date: Sat Jul 28 18:23:36 2018 +0800 qed: remove redundant functions qed_get_cm_pq_idx_rl There are no in-tree callers of qed_get_cm_pq_idx_rl since it be there, so it can be removed. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit f5cb282d8b08c05ad70ebde9a8fd2decf32a6406 Author: Darrick J. Wong Date: Sun Jul 29 16:16:21 2018 -0400 docs: add new ext4 superblock time extension fields The superblock timestamp fields were enlarged by u8 to be 40 bits wide. Update the documentation to reflect this. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 2d14ba7228b0c2e43e97bd37be8bcf3b71725fff Author: Sean Wang Date: Sat Jul 28 13:35:56 2018 +0800 net-next: mediatek: cleanup unnecessary get chip id and its user Since driver is devicetree-based, all device type and charateristic can be determined by the compatible string and its data. It's unnecessary to create another dependent function to check chip ID and then decide whether the specific funciton is being supported on a certain device. It can be totally replaced by the existing flag, so a cleanup is made by removing the function and the only user, HWLRO. MT2701 also have a missing HWLRO support in old code, so add it the same patch. Signed-off-by: Sean Wang Signed-off-by: David S. Miller commit 6c21da204a90ceca73096bf1b91c4fdf43308c16 Author: Sean Wang Date: Sat Jul 28 13:35:55 2018 +0800 net-next: mediatek: improve more with using dma_zalloc_coherent Improve more in the existing code by reusing dma_zalloc_coherent instead of dma_alloc_coherent with __GFP_ZERO or superfluous zeroing buffer. Signed-off-by: Sean Wang Signed-off-by: David S. Miller commit 2e25a9cbdf8cc300baa8f5eb5130152a6c25dd0a Author: Ludovic Barre Date: Tue Jul 17 11:56:27 2018 +0200 pinctrl: stm32: add syscfg mask parameter This patch adds mask parameter to define IRQ mux field. This field could vary depend of IRQ mux selection register. To avoid backward compatibility, the drivers set the legacy value by default. Signed-off-by: Ludovic Barre Acked-by: Alexandre TORGUE Signed-off-by: Linus Walleij commit 6684874af0637c63f4c91e8c2120c64e6e8bb79e Author: Darrick J. Wong Date: Sun Jul 29 16:14:02 2018 -0400 docs: create filesystem internal section Create a new top-level section for documentation of filesystem usage, on-disk format information, and anything else. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit de1d08b229746fc650c56ce7ddff34b1c8e778df Author: Ludovic Barre Date: Tue Jul 17 11:56:26 2018 +0200 dt-bindings: pinctrl: add syscfg mask parameter This patch adds mask parameter to define IRQ mux field. This field could vary depend of IRQ mux selection register. This parameter is needed if the mask is different of 0xf. Signed-off-by: Ludovic Barre Acked-by: Alexandre TORGUE Signed-off-by: Linus Walleij commit 62bbdd9974678513fee113f09f6b672623521179 Author: Gustavo A. R. Silva Date: Sun Jul 29 16:11:59 2018 -0400 ext4: use swap macro in mext_page_double_lock Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Theodore Ts'o commit d1753390274f7760e5b593cb657ea34f0617e559 Author: Tyler Hicks Date: Fri Jul 27 21:33:27 2018 +0000 sysfs: Fix regression when adding a file to an existing group Commit 5f81880d5204 ("sysfs, kobject: allow creating kobject belonging to arbitrary users") incorrectly changed the argument passed as the parent parameter when calling sysfs_add_file_mode_ns(). This caused some sysfs attribute files to not be added correctly to certain groups. Fixes: 5f81880d5204 ("sysfs, kobject: allow creating kobject belonging to arbitrary users") Signed-off-by: Tyler Hicks Reported-by: Heiner Kallweit Tested-by: Heiner Kallweit Signed-off-by: David S. Miller commit ebe023a4248834f774d537898898ce7bcbec0958 Merge: eef6ab8b7d32 a3e673660bc3 Author: David S. Miller Date: Sun Jul 29 13:08:42 2018 -0700 Merge tag 'mlx5e-updates-2018-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5e-updates-2018-07-27 (Vxlan updates) This series from Gal and Saeed provides updates to mlx5 vxlan implementation. Gal, started with three cleanups to reflect the actual hardware vxlan state - reflect 4789 UDP port default addition to software database - check maximum number of vxlan UDP ports - cleanup an unused member in vxlan work Then Gal provides performance optimization by replacing the vxlan radix tree with a hash table. Measuring mlx5e_vxlan_lookup_port execution time: Radix Tree Hash Table --------------- ------------ ------------ Single Stream 161 ns 79 ns (51% improvement) Multi Stream 259 ns 136 ns (47% improvement) Measuring UDP stream packet rate, single fully utilized TX core: Radix Tree: 498,300 PPS Hash Table: 555,468 PPS (11% improvement) Next, from Saeed, vxlan refactoring to allow sharing the vxlan table between different mlx5 netdevice instances like PF and VF representors, this is done by making mlx5 vxlan interface more generic and decoupling it from PF netdevice structures and logic, then moving it into mlx5 core as a low level interface so it can be used by VF representors, which is illustrated in the last patch of the serious. ==================== Signed-off-by: David S. Miller commit 17cf082d6d0d1a662f4ff62608c18d3956b85bf6 Author: Alexandre Torgue Date: Mon Jul 16 14:57:37 2018 +0200 pinctrl: stm32: check node status before new gpio bank registering Register a new GPIO bank only if GPIO bank node is enabled. This patch also adds checks on ranges which are defined only if a bank is registered. Signed-off-by: Alexandre Torgue Signed-off-by: Linus Walleij commit 3b8283f007cbf09eee64804606af23af5f734d54 Author: Alexandre Torgue Date: Mon Jul 16 14:57:36 2018 +0200 pinctrl: stm32: fix bank io port number In case the exti line is not in line with the bank number (that is the case when there is an hole between two banks, for example GPIOK and then GPIOZ), use "st,bank-ioport" DT property to get the right exti line. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue Reviewed-by: Rob Herring Signed-off-by: Linus Walleij commit eef6ab8b7d3223e2ecd02a02f17523e93faba709 Author: Petr Machata Date: Sat Jul 28 00:48:13 2018 +0200 selftests: mlxsw: qos_dscp_bridge: Fix There are two problems in this test case: - When indexing in bash associative array, the subscript is interpreted as string, not as a variable name to be expanded. - The keys stored to t0s and t1s are not DSCP values, but priority + base (i.e. the logical DSCP value, not the full bitfield value). In combination these two bugs conspire to make the test just work, except it doesn't really test anything and always passes. Fix the above two problems in obvious manner. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 720516b17b9ef1d1e1770e6b86a8b0776d2d379c Merge: 4b09384aaa2a 7a4c53bee332 Author: David S. Miller Date: Sun Jul 29 12:57:26 2018 -0700 Merge branch 'mtu-related-changes' Stephen Hemminger says: ==================== mtu related changes While looking at other MTU issues, noticed a couple oppurtunties for improving user experience. ==================== Signed-off-by: David S. Miller commit 7a4c53bee3324ac00bf964aa2f82d15d279e86e4 Author: Stephen Hemminger Date: Fri Jul 27 13:43:23 2018 -0700 net: report invalid mtu value via netlink extack If an invalid MTU value is set through rtnetlink return extra error information instead of putting message in kernel log. For other cases where there is no visible API, keep the error report in the log. Example: # ip li set dev enp12s0 mtu 10000 Error: mtu greater than device maximum. # ifconfig enp12s0 mtu 10000 SIOCSIFMTU: Invalid argument # dmesg | tail -1 [ 2047.795467] enp12s0: mtu greater than device maximum Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 3e7a50ceb11ea75c27e944f1a01e478fd62a2d8d Author: Stephen Hemminger Date: Fri Jul 27 13:43:22 2018 -0700 net: report min and max mtu network device settings Report the minimum and maximum MTU allowed on a device via netlink so that it can be displayed by tools like ip link. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 3260155ac784ae9f4889c6d3e40b85f33e94d098 Author: Stephen Hemminger Date: Fri Jul 27 13:43:21 2018 -0700 failover: change mtu has RTNL When changing MTU, RTNL is held so use rtnl_dereference instead of rcu_dereference. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 40bb5d725e797ea140e5f83822bf2b5328a2d47f Author: Morten Hein Tiljeset Date: Mon Jul 16 14:43:39 2018 +0200 gpio-pisosr: add support for get_multiple Signed-off-by: Morten Hein Tiljeset Reviewed-by: Sean Nyekjaer Signed-off-by: Linus Walleij commit 4b09384aaa2a9b2ac09a584d7a9345cf003617f2 Author: Jakub Kicinski Date: Fri Jul 27 13:11:00 2018 -0700 net: dcb: add DSCP to comment about priority selector types Commit ee2059819450 ("net/dcb: Add dscp to priority selector type") added a define for the new DSCP selector type created by IEEE 802.1Qcd, but missed the comment enumerating all selector types. Update the comment. Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 21ac738ede0b49004b53b4a44fe3df7bb4a78280 Author: Chengguang Xu Date: Sun Jul 29 15:51:54 2018 -0400 ext4: check allocation failure when duplicating "data" in ext4_remount() There is no check for allocation failure when duplicating "data" in ext4_remount(). Check for failure and return error -ENOMEM in this case. Signed-off-by: Chengguang Xu Signed-off-by: Theodore Ts'o Reviewed-by: Andreas Dilger commit 7f144fd046d967ff2fbba59203b42b888ad5aae7 Author: Junichi Uekawa Date: Sun Jul 29 15:51:52 2018 -0400 ext4: fix warning message in ext4_enable_quotas() Output the warning message before we clobber type and be -1 all the time. The error message would now be [ 1.519791] EXT4-fs warning (device vdb): ext4_enable_quotas:5402: Failed to enable quota tracking (type=0, err=-3). Please run e2fsck to fix. Signed-off-by: Junichi Uekawa Signed-off-by: Theodore Ts'o Reviewed-by: Andreas Dilger commit 6a0678a79bb3a4e5fc1b680e7afc78727e21aff3 Author: Arnd Bergmann Date: Sun Jul 29 15:51:48 2018 -0400 ext4: super: extend timestamps to 40 bits The inode timestamps use 34 bits in ext4, but the various timestamps in the superblock are limited to 32 bits. If every user accesses these as 'unsigned', then this is good until year 2106, but it seems better to extend this a bit further in the process of removing the deprecated get_seconds() function. This adds another byte for each timestamp in the superblock, making them long enough to store timestamps beyond what is in the inodes, which seems good enough here (in ocfs2, they are already 64-bit wide, which is appropriate for a new layout). I did not modify e2fsprogs, which obviously needs the same change to actually interpret future timestamps correctly. Signed-off-by: Arnd Bergmann Signed-off-by: Theodore Ts'o commit b42d1d6b5b789c41dacbe2bc192c7b359d109d7b Author: Arnd Bergmann Date: Sun Jul 29 15:51:47 2018 -0400 jbd2: replace current_kernel_time64 with ktime equivalent jbd2 is one of the few callers of current_kernel_time64(), which is a wrapper around ktime_get_coarse_real_ts64(). This calls the latter directly for consistency with the rest of the kernel that is moving to the ktime_get_ family of time accessors. Reviewed-by: Andreas Dilger Reviewed-by: Jan Kara Signed-off-by: Arnd Bergmann Signed-off-by: Theodore Ts'o commit 193736c81788556811238690ed0048af18740a8d Author: Ivan Khoronzhuk Date: Fri Jul 27 19:54:39 2018 +0300 net: ethernet: ti: cpsw: add missed RX_CTAG feature for second slave Seems it was missed while adding for first net dev in dual-emac mode. Signed-off-by: Ivan Khoronzhuk Reviewed-by: Grygorii Strashko Signed-off-by: David S. Miller commit 7b62b293200ffaba5b281668ba7102cb4209774f Author: Arnd Bergmann Date: Sun Jul 29 15:51:00 2018 -0400 ext4: use timespec64 for all inode times This is the last missing piece for the inode times on 32-bit systems: now that VFS interfaces use timespec64, we just need to stop truncating the tv_sec values for y2038 compatibililty. Reviewed-by: Andreas Dilger Signed-off-by: Arnd Bergmann Signed-off-by: Theodore Ts'o commit 5ffff834322281f550b10c958fd9dd85679b8dbb Author: Arnd Bergmann Date: Sun Jul 29 15:50:00 2018 -0400 ext4: use ktime_get_real_seconds for i_dtime We only care about the low 32-bit for i_dtime as explained in commit b5f515735bea ("ext4: avoid Y2038 overflow in recently_deleted()"), so the use of get_seconds() is correct here, but that function is getting removed in the process of the y2038 fixes, so let's use the modern ktime_get_real_seconds() here. Reviewed-by: Andreas Dilger Signed-off-by: Arnd Bergmann Signed-off-by: Theodore Ts'o commit af123b3718592a66a24716ed4724dc214220492b Author: Arnd Bergmann Date: Sun Jul 29 15:49:00 2018 -0400 ext4: use 64-bit timestamps for mmp_time The mmp_time field is 64 bits wide, which is good, but calling get_seconds() results in a 32-bit value on 32-bit architectures. Using ktime_get_real_seconds() instead returns 64 bits everywhere. Reviewed-by: Andreas Dilger Reviewed-by: Jan Kara Signed-off-by: Arnd Bergmann Signed-off-by: Theodore Ts'o commit a4d2aadca184ece182418950d45ba4ffc7b652d2 Author: Arnd Bergmann Date: Sun Jul 29 15:48:00 2018 -0400 ext4: sysfs: print ext4_super_block fields as little-endian While working on extended rand for last_error/first_error timestamps, I noticed that the endianess is wrong; we access the little-endian fields in struct ext4_super_block as native-endian when we print them. This adds a special case in ext4_attr_show() and ext4_attr_store() to byteswap the superblock fields if needed. In older kernels, this code was part of super.c, it got moved to sysfs.c in linux-4.4. Cc: stable@vger.kernel.org Fixes: 52c198c6820f ("ext4: add sysfs entry showing whether the fs contains errors") Reviewed-by: Andreas Dilger Signed-off-by: Arnd Bergmann Signed-off-by: Theodore Ts'o commit 66d3239a4d8f0af7795f07159133bac75ed024bd Author: Darrick J. Wong Date: Sun Jul 29 15:47:00 2018 -0400 ext4: import extended attributes chapter from wiki page Import the chapter about extended attributes from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 60edae3a0424f084187eedd5386bfbeadd4ec1c7 Author: Darrick J. Wong Date: Sun Jul 29 15:46:00 2018 -0400 ext4: import directory layout chapter from wiki page Import the chapter about directory layout from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit b4becd48b7b548f564533a41e1cdeb8ae3bd1c70 Author: Darrick J. Wong Date: Sun Jul 29 15:45:00 2018 -0400 ext4: import inode data fork chapter from wiki page Import the chapter about inode data fork from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 46180558f17ec76b854b419c9322d6c0b5fec840 Author: Darrick J. Wong Date: Sun Jul 29 15:44:00 2018 -0400 ext4: import inodes chapter from wiki page Import the chapter about inodes from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 567d118a9843a20b72ecebec2719337bc2556229 Author: Darrick J. Wong Date: Sun Jul 29 15:43:00 2018 -0400 ext4: import journal chapter from wiki page Import the chapter about the journal from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 423ddc580b13633429ed17c1c3a3059f402a3660 Author: Jisheng Zhang Date: Wed Jul 18 14:00:30 2018 +0800 pinctrl: berlin: add the as370 SoC pinctrl driver Add the pin-controller driver for Synaptics AS370 SoC, with definition of its groups and functions. This uses the core Berlin pinctrl driver. Signed-off-by: Jisheng Zhang Signed-off-by: Linus Walleij commit 18ba5a45ce1f590b3a2460f8f4ad52daf88290c4 Author: Darrick J. Wong Date: Sun Jul 29 15:42:00 2018 -0400 ext4: import multi-mount protection chapter from wiki page Import the chapter about multi-mount protection from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 33dfadc747a88243d616d8cb5c59ec3031dc60dd Author: Darrick J. Wong Date: Sun Jul 29 15:41:00 2018 -0400 ext4: import bitmaps chapter from wiki page Import the chapter about bitmaps from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 3c6ba09dd3f8081c2da2878ee275c0c2213d2d43 Author: Darrick J. Wong Date: Sun Jul 29 15:40:00 2018 -0400 ext4: import group descriptors chapter from wiki page Import the chapter about group descriptors from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 3db42a2139f0355554087f82916fa88d7a365230 Author: Darrick J. Wong Date: Sun Jul 29 15:39:00 2018 -0400 ext4: import superblocks chapter from wiki page Import the chapter about superblocks from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit c09f3bac6d8c820b4b4ff0ffcff47e3a68b04e54 Author: Darrick J. Wong Date: Sun Jul 29 15:38:00 2018 -0400 ext4: import high level design chapter from wiki page Import the chapter about high level design from the on-disk format wiki page into the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit d05c1ce5d7fd66d9e1c64e799dcb78a0b2dd89cf Merge: d0c1f01138c4 40f98b9af943 Author: David S. Miller Date: Sun Jul 29 12:37:06 2018 -0700 Merge branch 'route-add-support-and-selftests-for-directed-broadcast-forwarding' Xin Long says: ==================== route: add support and selftests for directed broadcast forwarding Patch 1/2 is the feature and 2/2 is the selftest. Check the changelog on each of them to know the details. v1->v2: - fix a typo in changelog. - fix an uapi break that Davide noticed. - flush route cache when bc_forwarding is changed. - add the selftest for this patch as Ido's suggestion. v2->v3: - fix an incorrect 'if check' in devinet_conf_proc as David Ahern noticed. - extend the selftest after one David Ahern fix for vrf. v3->v4: - improve the output log in the selftest as David Ahern suggested. ==================== Signed-off-by: David S. Miller commit 40f98b9af943c3858958032ce1fb7bad449fac7b Author: Xin Long Date: Fri Jul 27 16:37:29 2018 +0800 selftests: add a selftest for directed broadcast forwarding As Ido's suggestion, this patch is to add a selftest for directed broadcast forwarding with vrf. It does the assertion by checking the src IP of the echo-reply packet in ping_test_from. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 5cbf777cfdf6e5a7b7149006e4881a255da78fdd Author: Xin Long Date: Fri Jul 27 16:37:28 2018 +0800 route: add support for directed broadcast forwarding This patch implements the feature described in rfc1812#section-5.3.5.2 and rfc2644. It allows the router to forward directed broadcast when sysctl bc_forwarding is enabled. Note that this feature could be done by iptables -j TEE, but it would cause some problems: - target TEE's gateway param has to be set with a specific address, and it's not flexible especially when the route wants forward all directed broadcasts. - this duplicates the directed broadcasts so this may cause side effects to applications. Besides, to keep consistent with other os router like BSD, it's also necessary to implement it in the route rx path. Note that route cache needs to be flushed when bc_forwarding is changed. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit b2e60723c1c14c7c9b79c82bb86d8e2a81051b5e Author: Darrick J. Wong Date: Sun Jul 29 15:37:00 2018 -0400 ext4: import on-disk layout book from wiki page Create the basic structure of the "new" data structures & algorithms book to be ported over from the on-disk format wiki, and then start by pulling in the introductory information. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit 489fcb912477e4f4ba5fb65b223331fb8d352a07 Author: Darrick J. Wong Date: Sun Jul 29 15:36:00 2018 -0400 ext4: convert ext4.rst to restructuredtext format Convert the existing ext4 documentation into rst format and link it in with the rest of the kernel documentation. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit a801e569970b9bdc2d1182266d559e610bfc0dc6 Author: Darrick J. Wong Date: Sun Jul 29 15:35:00 2018 -0400 ext4: move ext4.txt into its own directory Move Documentation/filesystems/ext4.txt into Documentation/filesystems/ext4/ext4.rst in preparation for adding more ext4 documentation. Note that the documentation isn't in rst format yet, but as it's not linked from anywhere it won't cause build errors. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o commit d0c1f01138c4b7e532889474e3f2a485546d7270 Author: Vincent Bernat Date: Wed Jul 25 13:19:13 2018 +0200 net/ipv6: allow any source address for sendmsg pktinfo with ip_nonlocal_bind When freebind feature is set of an IPv6 socket, any source address can be used when sending UDP datagrams using IPv6 PKTINFO ancillary message. Global non-local bind feature was added in commit 35a256fee52c ("ipv6: Nonlocal bind") for IPv6. This commit also allows IPv6 source address spoofing when non-local bind feature is enabled. Signed-off-by: Vincent Bernat Signed-off-by: David S. Miller commit 41627cdb02cdff8cb92a498bc3bcbef8abe8a752 Merge: 4be90c79d6de 1f6ed42c742e Author: David S. Miller Date: Sun Jul 29 08:35:03 2018 -0700 Merge tag 'linux-can-next-for-4.19-20180727' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2018-01-16 this is a pull request for net-next/master consisting of 38 patches. Dan Murphy's patch fixes the path to a file in the comment of the CAN Error Message Frame Mask structure. A patch by Colin Ian King fixes a typo in the cc770 driver. The next patch is by me an sorts the Kconfigand Makefile entries of the CAN-USB driver subdir alphabetically. The patch by Jakob Unterwurzacher adds support for the UCAN USB-CAN adapter. YueHaibing's patch replaces a open coded skb_put()+memset() by skb_put_zero() in the CAN-dev infrastructure. Zhu Yi provides a patch to enable multi-queue CAN devices. Three patches by Luc Van Oostenryck fix the return value of several driver's xmit function, I contribute a patch for the a fourth driver. Fabio Estevam's patch switches the flexcan driver to SPDX identifier. Two patches by Jia-Ju Bai replace the mdelay() by a usleep_range() in the sja1000 drivers. The next 6 patches are by Anssi Hannula and refactor the xilinx CAN driver and add support for the xilinx CAN FD core. A patch by Gustavo A. R. Silva adds fallthrough annotation to the peak_usb driver. 5 patches by Stephane Grosjean for the peak CANFD driver do some cleanups and provide more improvements for further firmware releases. The remaining 13 patches are by Jimmy Assarsson and the first clean up the kvaser_usb driver, so that the later patches add support for the Kvaser USB hydra family. ==================== Signed-off-by: David S. Miller commit 4be90c79d6de941216fdaeb0e76647c48877ffd5 Author: YueHaibing Date: Fri Jul 27 21:24:27 2018 +0800 qed: remove redundant functions qed_set_gft_event_id_cm_hdr There are no in-tree callers of qed_set_gft_event_id_cm_hdr. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 5ae42de56b5328eed5cf58eeb39c662a903d252d Author: YueHaibing Date: Fri Jul 27 19:57:24 2018 +0800 liquidio: remove redundant function cn23xx_dump_vf_iq_regs There are no in-tree callers. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit b9f13084580c9032ba7c505da2c6c075f176472a Author: kbuild test robot Date: Sun Jul 29 19:19:26 2018 +0800 staging: fix platform_no_drv_owner.cocci warnings drivers/staging/axis-fifo/axis-fifo.c:1081:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Fixes: 4a965c5f89de ("staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core") CC: Jacob Feder Signed-off-by: kbuild test robot Signed-off-by: Greg Kroah-Hartman commit 2fa03b92b62982c420c9c77a58bda52b96ed8ba4 Author: Manish Narani Date: Mon Jul 23 20:32:03 2018 +0530 iio: adc: xilinx: Move request_irq before enabling interrupts Enabling the Interrupts before registering the irq handler is a bad idea. This patch corrects the same for XADC driver. Signed-off-by: Manish Narani Signed-off-by: Jonathan Cameron commit 50e8e9f3096bd4e9ce2f42da11f3824358a826a7 Author: Manish Narani Date: Mon Jul 23 20:32:02 2018 +0530 iio: adc: xilinx: Remove platform_get_irq from xadc_remove function This patch avoids getting irq number in xadc_remove function. Instead store 'irq' in xadc struct and use xadc->irq wherever needed. This patch also resolves a warning reported by coverity where it asks to check return value of platform_get_irq() for any errors in xadc_remove. Signed-off-by: Manish Narani Signed-off-by: Jonathan Cameron commit 81f5471838c279c97f0b46f18e766c2ac0de8806 Author: Manish Narani Date: Mon Jul 23 20:32:01 2018 +0530 iio: adc: xilinx: limit pcap clock frequency value This patch limits the xadc pcap clock frequency value to be less than 200MHz. This fixes the issue when zynq is booted at higher frequency values, pcap crosses the maximum limit of 200MHz(Fmax) as it is derived from IOPLL. If this limit is crossed it is required to alter the WEDGE and REDGE bits of XADC_CFG register to make timings better in the interface. So to avoid alteration of these bits every time, the pcap value should not cross the Fmax limit. Signed-off-by: Manish Narani Signed-off-by: Jonathan Cameron commit 0a8460966fc28c3c25160c34da055e9a8a0c90a1 Author: Manish Narani Date: Mon Jul 23 20:32:00 2018 +0530 iio: adc: xilinx: Check for return values in clk related functions This patch adds check for return values from clock related functions. This was reported by static code analysis tool. Signed-off-by: Manish Narani Signed-off-by: Jonathan Cameron commit be38866fbb97f0ee2b144ab1de9ee2833a76e0fb Author: Tomas Novotny Date: Wed Jul 25 17:18:21 2018 +0200 iio: vcnl4000: add support for VCNL4200 VCNL4200 is an integrated long distance (up to 1500mm) proximity and ambient light sensor. The support is very basic. There is no configuration of proximity and ambient light sensing yet. Only the reading of both measured values is done. The reading of ambient light and proximity values is blocking. If you request a new value too early, the driver waits for new value to be ready. Signed-off-by: Tomas Novotny Signed-off-by: Jonathan Cameron commit b1d2b0a43d288836bce5e708b88981e2df0bf594 Merge: 3b770017b03a a2b3bf4846e5 Author: Wolfram Sang Date: Sun Jul 29 12:35:45 2018 +0200 Merge tag 'at24-4.19-updates-for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-4.19 at24: updates for v4.19 New property: 'address-width' which allows to specify the number of addressing bits. Up until now we only could choose one of the defined models and rely on the flags specified in its corresponding chip data structure. commit 2a61e9f60b2bd626e8c3dc428c782b812c878a0c Merge: 73c2a01c52b6 16c5b0857256 Author: Rafael J. Wysocki Date: Sun Jul 29 12:17:17 2018 +0200 Merge back ACPICA changes for 4.19. commit 58bf9ace8c91be9b3e75cb001dbc199fae89d106 Author: Tomas Novotny Date: Wed Jul 25 17:18:20 2018 +0200 iio: vcnl4000: warn on incorrectly specified device id We can detect incorrectly specified device id for some chips, so warn user in that case. Signed-off-by: Tomas Novotny Signed-off-by: Jonathan Cameron commit 71a896687b851477bfe2e7022cd4b597ab4f900d Author: Geert Uytterhoeven Date: Mon Jul 23 10:28:38 2018 +0200 m68k/defconfig: Update defconfigs for v4.18-rc6 Signed-off-by: Geert Uytterhoeven commit 1008a11590b966b469e60dc3756c9226a685ce12 Author: Mike Rapoport Date: Wed Jul 4 09:28:16 2018 +0300 m68k: switch to MEMBLOCK + NO_BOOTMEM In m68k the physical memory is described by [memory_start, memory_end] for !MMU variant and by m68k_memory array of memory ranges for the MMU version. This information is directly use to register the physical memory with memblock. The reserve_bootmem() calls are replaced with memblock_reserve() and the bootmap bitmap allocation is simply dropped. Since the MMU variant creates early mappings only for the small part of the memory we force bottom-up allocations in memblock. Signed-off-by: Mike Rapoport Acked-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven commit 9e09221957c5cc6b70596c888651af0c7b052bd9 Author: Mike Rapoport Date: Wed Jul 4 09:28:15 2018 +0300 m68k/page_no.h: force __va argument to be unsigned long Add explicit casting to unsigned long to the __va() parameter Signed-off-by: Mike Rapoport Acked-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven commit 384052e4ed274747fb96deb2df46a14d023a2986 Author: Mike Rapoport Date: Wed Jul 4 09:28:14 2018 +0300 m68k/bitops: convert __ffs to match generic declaration The generic bitops declare __ffs as static inline unsigned long __ffs(unsigned long word); Convert the m68k version to match the generic declaration. Signed-off-by: Mike Rapoport Acked-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven commit 781c4d6f5f278fc23687d6d224ddb452bb5ac368 Author: Geert Uytterhoeven Date: Thu Jun 28 11:18:53 2018 +0200 m68k/io: Switch mmu variant to The dummy functions defined in can be provided by . As nommu already uses , move its inclusion to , and add/adjust include guards where appropriate. This gets rid of lots of "statement with no effect" and "unused variable" warnings when compile-testing. Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer commit ab4d391d2756086e34568f0ff84bc4fc7596e685 Author: Geert Uytterhoeven Date: Thu Jun 28 10:54:35 2018 +0200 m68k/io: Move mem*io define guards to The mem*io define guards are applicable to all users of . Hence move them, and drop the #ifdef. Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer commit dae0c332b6b37bdb6eeed9df6fa168b10def8acc Author: Geert Uytterhoeven Date: Mon Jul 2 13:55:50 2018 +0200 Input: hilkbd - Add casts to HP9000/300 I/O accessors Internally, hilkbd uses "unsigned long" I/O addresses everywhere. This works fine as: - On PA-RISC, hilkbd uses the gsc_{read,write}b() I/O accessors, which take "unsigned long" addresses, - On m68k, hilkbd uses {read,write}b(), which are currently mapped to {in,out}_8(), and convert the passed addresses to pointers internally. However, the asm-generic version of {read,write}b() does not perform such conversions, and requires passing pointers instead. Hence add casts to prepare for switching m68k to the asm-generic version. Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer Acked-by: Dmitry Torokhov commit 4042cd756e193f49469d31a23d5b85c4dca2a3b6 Author: Geert Uytterhoeven Date: Tue Jun 26 20:32:22 2018 +0200 net: mac8390: Use standard memcpy_{from,to}io() The mac8390 driver defines its own variants of memcpy_fromio() and memcpy_toio(), using similar implementations, but different function signatures. Remove the custom definitions of memcpy_fromio() and memcpy_toio(), and adjust all callers to the standard signatures. Signed-off-by: Geert Uytterhoeven Acked-by: David S. Miller Acked-by: Greg Ungerer commit e295066f66a4fa78c39c29de7d7635e6957dd4f7 Author: Geert Uytterhoeven Date: Tue Jun 26 18:41:11 2018 +0200 m68k/io: Add missing ioremap define guards, fix typo - Add missing define guard for ioremap_wt(), - Move ARCH_HAS_IOREMAP_WT from to , as it is applicable to Coldfire with MMU, too, - Fix typo s/ioremap_fillcache/ioremap_fullcache/, - Add define guard for iounmap() for consistency with other architectures. Fixes: 9746882f547d2f00 ("m68k: group io mapping definitions and functions") Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer commit d7de1c3af18b1a638fc5211f8078ac427280d455 Author: Arnd Bergmann Date: Tue Jun 19 16:02:29 2018 +0200 m68k: Remove unused set_clock_mmss() helpers Commit 397ac99c6cef ("m68k: remove dead timer code") removed set_rtc_mmss() because it was unused in 2012. However, this was itself the only user of the mach_set_clock_mmss() callback and the many implementations of that callback, which are equally unused. This removes all of those as well. Signed-off-by: Arnd Bergmann Acked-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven commit 5b9bfb8ec467b2017f36d7675434822271ce3d29 Author: Arnd Bergmann Date: Tue Jun 19 16:02:28 2018 +0200 m68k: mac: Use time64_t in RTC handling The real-time clock on m68k (and powerpc) mac systems uses an unsigned 32-bit value starting in 1904, which overflows in 2040, about two years later than everyone else, but this gets wrapped around in the Linux code in 2038 already because of the deprecated usage of time_t and/or long in the conversion. Getting rid of the deprecated interfaces makes it work until 2040 as documented, and it could be easily extended by reinterpreting the resulting time64_t as a positive number. For the moment, I'm adding a WARN_ON() that triggers if we encounter a time before 1970 or after 2040 (the two are indistinguishable). This brings it in line with the corresponding code that we have on powerpc macintosh. Signed-off-by: Arnd Bergmann [fthain: Adopt __u32 for the union in via_read_time(), consistent with changes to via_write_time()] [fthain: Use lower_32_bits() in via_write_time(), consistent with changes to pmu_write_time() and cuda_write_time()] [fthain: Have via_read_time() return a time64_t, consistent with changes to pmu_read_time() and cuda_read_time()] [fthain: Drop the pointless wraparound conditional in via_read_time()] Signed-off-by: Finn Thain Reviewed-by: Arnd Bergmann [geert: Drop WARN_ON(), as it is reported to trigger on powermac] Signed-off-by: Geert Uytterhoeven commit 50c50b975d566e9384c3ae84fc37a997ea18eedd Author: Tomas Novotny Date: Wed Jul 25 17:18:19 2018 +0200 iio: vcnl4000: add VCNL4010 and VCNL4020 device id The driver already supports VCNL4010/20 devices. The currently supported features and detectable product id are the same, so add shared id for them. This is a groundwork to extend the driver by detecting incorrectly specified device id. Signed-off-by: Tomas Novotny Signed-off-by: Jonathan Cameron commit 8cc7be34c6385dc04e01bc7c25868782e4d2fbd0 Author: Michael Straube Date: Sat Jul 28 16:29:17 2018 +0200 staging: rtl8188eu: remove unused rtw_calculate_wlan_pkt_size_by_attribue() The function rtw_calculate_wlan_pkt_size_by_attribue() also defined as rtw_wlan_pkt_size() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 6da0bda8d7949abcddd1dc72befcb9cd40d53c07 Author: Michael Straube Date: Sat Jul 28 16:29:16 2018 +0200 staging: rtl8188eu: replace tabs with spaces Replace tabs with spaces, clears a checkpatch 'line over 80 characters' warning. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c39f4bb98ea48ff4c521fc5317ae65c490426098 Author: Michael Straube Date: Sat Jul 28 16:29:15 2018 +0200 staging: rtl8188eu: fix comparsions to NULL - coding style Use !x instead of x == NULL. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c225b00d012e28487414a82d07d7dee8959c579d Author: John Whitmore Date: Sat Jul 28 00:28:17 2018 +0100 staging:rtl8192u: Remove unused DM_check_fsync_time_interval - Style Remove the unused definition for DM_check_fsync_time_interval. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f164338121d78fb7344702e2a8726a89388e88dc Author: John Whitmore Date: Fri Jul 27 18:31:23 2018 +0100 staging:rtl8192u: Remove blank line - Style Remove a blank line to clear the checkpatch issue with use of multiple blank lines. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 99750726f9fafe7418c5f335803b1f55363c396e Author: John Whitmore Date: Fri Jul 27 18:31:22 2018 +0100 staging:rtl8192u: Rename RxLastFragNum - Style Rename the member variable RxLastFragNum to rx_last_frag_num. This change clears the checkpatch issue with CamelCase naming. The resulting edits are all coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 01eb0ce4a84b5045822e71d4312d4fb66190c6c1 Author: John Whitmore Date: Fri Jul 27 18:31:21 2018 +0100 staging:rtl8192u: Rename RxLastSeqNum - Style Rename the member variable RxLastSeqNum to rx_last_seq_num. This change clears the checkpatch issue with CamelCase naming. The resulting changes are purely coding style in nature so should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 02f2560cbedd1e222791c498a2878b45c1347b65 Author: John Whitmore Date: Fri Jul 27 18:31:20 2018 +0100 staging:rtl8192u: Rename RxAdmittedBARecord - Style Rename the member variable RxAdmittedBARecord to rx_admitted_ba_record. This change clears the checkpatch issue with CamelCase naming. The resulting changes are coding style in nature and as such should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5b76f8cbe23fc100e8447057e2dfcff4fb72617d Author: John Whitmore Date: Fri Jul 27 18:31:19 2018 +0100 staging:rtl8192u: Rename RxPktPendingTimer - Style Rename the member variable RxPktPendingTimer to rx_pkt_pending_timer. This change clears the checkpatch issue with CamelCase naming. The resulting changes are coding style changes in nature so should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a1ac7d1c470372089d5cec4c47db8a165c06bdb2 Author: John Whitmore Date: Fri Jul 27 18:31:18 2018 +0100 staging:rtl8192u: Rename RxPendingPktList - Style Rename the member variable RxPendingPktList to rx_pending_pkt_list. This change resolves the checkpatch issue with CamelCase naming. The resulting changes are purely coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 902efe070caf5d5a901c1d51bb4a5e0ebcb5c7c5 Author: John Whitmore Date: Fri Jul 27 18:31:17 2018 +0100 staging:rtl8192u: Rename RxTimeoutIndicateSeq _Style Rename member variable RxTimeoutIndicateSeq to rx_timeout_indicate_seq. This change clears the checkpatch issue with CamelCase naming. The resulting changes are purely coding style in nature and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit dfbb36f7173465e8e59eeef37e569caafc0cbaa4 Author: John Whitmore Date: Fri Jul 27 18:31:16 2018 +0100 staging:rtl8192u: Rename RxIndicateSeq - Style Rename the member variable RxIndicateSeq to rx_indicate_seq. This change clears the checkpatch issue with CamelCase naming. The resulting changes are purely coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 596a2ca3b48b4109cdf390dfd99f7e422bbe7b9f Author: John Whitmore Date: Fri Jul 27 18:31:15 2018 +0100 staging:rtl8192u: Remove unused timer values - Style Remove the unused timer constants TS_SETUP_TIMEOUT and TS_INACT_TIMEOUT as neither are used in code. This is a style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit b88668ace9fa31605bdcde7c9626142525419bcf Author: John Whitmore Date: Fri Jul 27 18:31:14 2018 +0100 staging:rtl8192u: Remove commented out code - Style Remove commented out sections of code, specifically for a structure, QOS_DL_RECORD, which no longer exists in the module. This change is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 80b6f0d45c76331861b696dfb65aeb218bd5e8b5 Author: John Whitmore Date: Fri Jul 27 18:31:13 2018 +0100 staging:rtl8192u: Remove typedef and rename RX_TS_RECORD - Style Remove the typedef from structure RX_TS_RECORD, this change clears the checkpatch issue with creation of new types. Additionally the structure is renamed from RX_TS_RECORD to rx_ts_record. Whilst this is not raised as a checkpatch error structures are meant to be named in lower case. These changes are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 1c194ce9fc1d3c0a712d57bd0e75b15dfcd89db1 Author: John Whitmore Date: Fri Jul 27 18:31:12 2018 +0100 staging:rtl8192u: Rename TsAddBaTimer - Style Rename the member variable TsAddBaTimer to ts_add_ba_timer. This change clears the checkpatch issue with CamelCase naming. The resulting changes are coding style in nature and as such should not have any impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5ef43de1d2ff68eea82d38caff741d662cea573c Author: John Whitmore Date: Fri Jul 27 18:31:11 2018 +0100 staging:rtl8192u: Rename bUsingBa - Style Rename the member variable bUsingBa to using_ba. This change clears the checkpatch issue with CamelCase naming. The resulting changes are purely coding style and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit df5d5bc8d095d1ad36d8b48e7323cb281761660e Author: John Whitmore Date: Fri Jul 27 18:31:10 2018 +0100 staging:rtl8192u: Rename bAddBaReqDelayed - Style Rename the member variable bAddBaReqDelayed to add_ba_req_delayed This change clears the checkpatch issue with CamelCase naming. The resulting changes are purely coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit e5afcc0f40b00ca349b0316700af63e9cfd9e549 Author: John Whitmore Date: Fri Jul 27 18:31:09 2018 +0100 staging:rtl8192u: Rename bAddBaReqInProgress - Style Rename the member variable bAddBaReqInProgress to add_ba_req_in_progress This change clears the checkpatch issue with CamelCase naming. Changes are purely coding style and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f57383bcdace3e7901957ecbbcc8c22bd15a7cf8 Author: John Whitmore Date: Fri Jul 27 18:31:08 2018 +0100 staging:rtl8192u: Rename TxAdmittedBARecord - Style Rename the member variable TxAdmittedBARecord to tx_admitted_ba_record This change clears the checkpatch issue with CamelCase naming. The resulting changes are purely coding style changes which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 43a420e31de5d1e2b1612ddb08d9ebd2cf9a4d24 Author: John Whitmore Date: Fri Jul 27 18:31:07 2018 +0100 staging:rtl8192u: Rename TxPendingBARecord - Style Rename the member variable TxPendingBARecord to tx_pending_ba_record. This change clears the checkpatch issue with CamelCase naming. The changes are purely coding style changes and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4925d4b76647cfade3fff9aa37bd605086ad439b Author: John Whitmore Date: Fri Jul 27 18:31:06 2018 +0100 staging:rtl8192u: Rename TxCurSeq - Style Rename the member variable TxCurSeq to tx_cur_seq. This change clears the checkpatch issue with CamelCase naming. The changes are coding style changes which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c1fdc5de69aa516a4ea25708188724b5208f54a2 Author: John Whitmore Date: Fri Jul 27 18:31:05 2018 +0100 staging:rtl8192u: Rename TsCommonInfo - Style Rename the member variable TsCommonInfo in two structures, both tx_ts_record and RX_TS_RECORD. This member variable is used in both structures and in both cases causes a checkpatch issue with CamelCase naming. The changes are purely coding style and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 1538be280259fb03ecda3a69cf308116d61698d6 Author: John Whitmore Date: Fri Jul 27 18:31:04 2018 +0100 staging:rtl8192u: Remove typedef and rename TX_TS_RECORD - Style Remove the typdef from structure TX_TS_RECORD and rename to tx_ts_record. The removal of the typedef clears the checkpatch issue with creating new types in code. The name change, whilst not specifically flagged by checkpatch, is an issue since types are meant to be named in lowercase. These changes are purely coding style changes and should have no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit cc29db86378e131d13859529b7285ae92ae3143f Author: John Whitmore Date: Thu Jul 26 20:24:26 2018 +0100 staging:rtl8192u: Rename eRFPath - Style Rename the variable eRFPath to e_rfpath. This change resolves a checkpatch issue with CamelCase naming. The variable name is used both as a parameter name in function definitions, function prototypes and as a local variable. This change is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 14c964a2d3707891bd20b1883fd339f41bba4068 Author: John Whitmore Date: Thu Jul 26 20:24:25 2018 +0100 staging:rtl8192u: Remove repeated definitions - Style Remove bit field masks which are defined in two files: r819xU_phy.h and r819xU_phyreg.h. Or in the case of bMaskByte3 defined but never used. The definitions have been removed from the file r819xU_phy.h. This is a coding style change, which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit fb37edcfcba7088d07a0ebb79f2991cd190d0a99 Author: John Whitmore Date: Thu Jul 26 20:24:24 2018 +0100 staging:rtl8192u: Rename RF90_RADIO_PATH_E - Style Rename the enumerated type RF90_RADIO_PATH_E to rf90_radio_path_e. Whilst it is not flagged as an issue by checkpatch, types are meant to be named in lowercase. This change is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit b714c8c0b0558406950fb936a47c8868a917c164 Author: John Whitmore Date: Thu Jul 26 20:24:23 2018 +0100 staging:rtl8192u: Rename HW90_BLOCK_E - Style Rename the enumerated type HW90_BLOCK_E to hw90_block_e. Whilst this is not flagged by checkpatch types are meant to be in lowercase. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a99d02401f2493fb0ddaa34b94e30e9437d2726f Author: John Whitmore Date: Thu Jul 26 20:24:22 2018 +0100 staging:rtl8192u: Remove proxy rtl819XRadioD_Array - Style Remove the array rtl819XRadioD_Array which is only acting as a proxy to the real array Rtl8192UsbRadioD_Array. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 281da5305b051ea5dd4a8a9dfec5a3b4b7688125 Author: John Whitmore Date: Thu Jul 26 20:24:21 2018 +0100 staging:rtl8192u: Remove proxy rtl819XRadioC_Array - Style Remove the array rtl819XRadioC_Array which is only serving as a proxy for the real array Rtl8192UsbRadioC_Array. This is a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 416599d096ae05b164b5112b064df91fdd9dd980 Author: John Whitmore Date: Thu Jul 26 20:24:20 2018 +0100 staging:rtl8192u: Remove proxy rtl819XRadioB_Array - Style Remove the array rtl819XRadioB_Array Rtl8192UsbRadioB_Array which acts as a proxy the actual array Rtl8192UsbRadioB_Array. The only purpose, I can see for this implementation is to obscure the actual array being used Rtl8192UsbRadioB_Array. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit be208c7695ffb0c873435048c849d7d8323a5a96 Author: John Whitmore Date: Thu Jul 26 20:24:19 2018 +0100 staging:rtl8192u: Remove proxy rtl819XRadioA_Array - Style The array rtl819XRadioA_Array serves as a proxy array for the actual array Rtl8192UsbRadioA_Array. This implementation seems to serve no other purpose then to obscure the actually array Rtl8192UsbRadioA_Array. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit def6b79f3f2d0439822a2eab5ddfe8696e999ad4 Author: John Whitmore Date: Thu Jul 26 20:24:18 2018 +0100 staging:rtl8192u: Remove proxy array rtl819XAGCTAB_Array - Style Remove the array rtl819XAGCTAB_Array which is only a proxy to the array Rtl8192UsbAGCTAB_Array. There appears to be no purpose served by this implementation, other then to obscure the Rtl8192UsbAGCTAB_Array structure, which is actually written to and read from. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 22be361aa9045a60c47fcd9b001e2d478f387989 Author: John Whitmore Date: Thu Jul 26 20:24:17 2018 +0100 staging:rtl8192u: Remove proxy struct rtl819XPHY_REG_1T2RArray - Style Remove the struct rtl819XPHY_REG_1T2RArray which is simply a proxy for the struct Rtl8192UsbPHY_REG_1T2RArray. There appears to be no purpose served by this implementation, other then to obscure the Rtl8192UsbPHY_REG_1T2RArray structure. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4531f1934bf6aefee296c783a42d8d4867800d99 Author: John Whitmore Date: Thu Jul 26 20:24:16 2018 +0100 staging:rtl8192u: Remove proxy struct rtl819XMACPHY_Array_PG - Style Remove the struct rtl819XMACPHY_Array_PG which is simply a proxy for the struct Rtl8192UsbMACPHY_Array_PG. There appears to be no purpose served by this implementation, other then to obscure the Rtl8192UsbMACPHY_Array_PG structure. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit e918443caf095387a8ccf57e8b38fc858e4b231f Author: John Whitmore Date: Thu Jul 26 20:24:15 2018 +0100 staging:rtl8192u: Rename msDelay to ms_delay - Style Rename the member variable msDelay to ms_delay. This change clears the checkpatch issue with CamelCase naming. The change is purely a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 21807031af7c9bd66d134787811677eb8b6ae50c Author: John Whitmore Date: Thu Jul 26 20:24:14 2018 +0100 staging:rtl8192u: Rename Para2 to para_2 - style Rename member variable Para2 to para_2. This change clears the checkpatch issue with CamelCase naming. The change is purely a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 33f28ab7a0b72c79c67b7c677fcadc5e63fa2282 Author: John Whitmore Date: Thu Jul 26 20:24:13 2018 +0100 staging:rtl8192u: Rename Para1 > para_1 - Style Rename the member variable Para1 to para_1. This change clears the checkpatch issue with CamelCase naming. The change is purely a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit d2a5c987e7f25461cbd87d679155d19047920898 Author: John Whitmore Date: Thu Jul 26 20:24:12 2018 +0100 staging:rtl8192u: Rename CmdID - Style Rename the member variable CmdId to cmd_id. This change clears the checkpatch issue with CamelCase naming. The change is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a1b34e427c5602f7e21ea449e6561165a0c4b7dc Author: John Whitmore Date: Thu Jul 26 20:24:11 2018 +0100 staging:rtl8192u: Rename SwChnlCmd - Style Rename the structure SwChnlCmd to sw_chnl_cmd. This change clears the checkpatch issue with CamelCase naming. The change is purely a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6b59fd408d1bc6bec8629ff49f55b96420bb6add Author: John Whitmore Date: Wed Jul 25 23:16:27 2018 +0100 staging:rtl8192u: Remove multiple blank lines - Style Remove multiple blank lines, raise a checkpatch issue. This is purely a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4434e159d064f41e138cd1c8a758f066043e9e09 Author: John Whitmore Date: Wed Jul 25 23:16:26 2018 +0100 staging:rtl8192u: Rename ISR_BcnTimerIntr - Style Rename the bit definition ISR_BcnTimerIntr to ISR_BCN_TIMER_INTR. This change clears the checkpatch issue with CamelCase naming. The change is purely a style change and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 85dc31eb8c49d6c2427b35b7cb58f91c67357f78 Author: John Whitmore Date: Wed Jul 25 23:16:25 2018 +0100 staging:rtl8192u: Rename ISR_TxBcnErr bit definition - Style Rename the bit definition ISR_TxBcnErr to ISR_TX_BCN_ERR. This change clears the checkpatch issue with CamelCase naming. The change is purely a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 66b19887fbaf054b74c1d9c37a2c20fcac756de6 Author: John Whitmore Date: Wed Jul 25 23:16:23 2018 +0100 staging:rtl8192u: Rename bit definition ISR_TxBcnOk - Style Rename the bit definition ISR_TxBcnOk to ISR_TX_BCN_OK. This change clears the checkpatch issue with CamelCase naming. The change is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 12f3ccfbc560cf62ea29a50dd6c6edd2fc75aa4c Author: Michael Straube Date: Wed Jul 25 21:37:58 2018 +0200 staging: rtl8188eu: remove unused rtw_get_oper_choffset() The function rtw_get_oper_choffset() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c60b03effc26a392107992cbc99c7d7e381c8f20 Author: Michael Straube Date: Wed Jul 25 21:37:57 2018 +0200 staging: rtl8188eu: remove unused rtw_get_oper_bw() The function rtw_get_oper_bw() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit b045b429151c40a00fece3318fcab4c5f9ab5ebc Author: Michael Straube Date: Wed Jul 25 21:37:56 2018 +0200 staging: rtl8188eu: remove unused CAM_empty_entry() The function CAM_empty_entry() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 891f6de39ced523544a5391608c088c015e738d2 Author: Michael Straube Date: Wed Jul 25 21:37:55 2018 +0200 staging: rtl8188eu: remove unused ODM_RASupport_Init() The function ODM_RASupport_Init() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit d47b10e6f90de6f0275eb3c9ffbc68c5534af9e4 Author: Tim Collier Date: Wed Jul 25 20:30:32 2018 +0100 staging: wlan-ng: correction to comment in hfa384x_usb The comment for hfa384x_docmd incorrectly states that usercb_data should be NULL for DOASYNC calls; in fact, it should be NULL for DOWAIT calls (this is consistent with the other similar functions and the rest of the comment text). Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit 318c66d456b81ce15b5e17b551d7db6ecc4aeac6 Author: Tim Collier Date: Wed Jul 25 20:30:31 2018 +0100 staging: wlan-ng: remove volatile from reapable field in hfa384x_usbctlx Fix checkpatch.pl warning: "Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rs" reapable is not used to access h/w directly, so volatile is not necessary. >From reading the code, the contexts in which the field may be updated/accessed across threads are protected by the hw->ctlxq.lock spinlock, where hw is the device struct, so appears thread-safe. Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit d3094361a91f21a5b6092b4d50c47be570ae02cf Author: Michael Straube Date: Thu Jul 26 21:46:59 2018 +0200 staging: rtl8188eu: remove unused sreset_get_wifi_status() The function sreset_get_wifi_status() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 910ca496b8dceac588adb85d81a9351f1cdf63d1 Author: Nishad Kamdar Date: Fri Jul 27 21:37:37 2018 +0530 staging: mt7621-mmc: Use BIT macro instead of explicit shifting in board.h Replace explicit shifting with BIT macro in board.h. Issue found by checkpatch. Signed-off-by: Nishad Kamdar Signed-off-by: Greg Kroah-Hartman commit 2f675c91eeb7f59d649825f931184becdc94b905 Author: Kees Cook Date: Tue Jul 24 09:49:32 2018 -0700 staging: rtl8192u: ieee80211: Convert from ahash to shash This is an identical change to the wireless/lib80211 of the same name. In preparing to remove all stack VLA usage from the kernel[1], this removes the discouraged use of AHASH_REQUEST_ON_STACK in favor of the smaller SHASH_DESC_ON_STACK by converting from ahash-wrapped-shash to direct shash. By removing a layer of indirection this both improves performance and reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman commit bd757b5d2e0b30939ba63b80af7355fe755fe2da Author: Kees Cook Date: Tue Jul 24 09:49:33 2018 -0700 staging: rtl8192e: ieee80211: Convert from ahash to shash This is an identical change to the wireless/lib80211 of the same name. In preparing to remove all stack VLA usage from the kernel[1], this removes the discouraged use of AHASH_REQUEST_ON_STACK in favor of the smaller SHASH_DESC_ON_STACK by converting from ahash-wrapped-shash to direct shash. By removing a layer of indirection this both improves performance and reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman commit 1ebc787ae5181c98060f25157b490cdad92728a7 Author: Tomas Novotny Date: Wed Jul 25 17:18:18 2018 +0200 iio: vcnl4000: make the driver extendable There are similar chips in the vcnl4xxx family. The initialization and communication is a bit different for members of the family, so this patch makes the driver extendable for different chips. There is no functional change. Signed-off-by: Tomas Novotny Signed-off-by: Jonathan Cameron commit f69548ffafcc4942022f16f2f192b24143de1dba Author: Takashi Iwai Date: Thu Jul 12 23:06:51 2018 +0200 ALSA: hda/hdmi: Use single mutex unlock in error paths Instead of calling mutex_unlock() at each error path multiple times, take the standard goto-and-a-single-unlock approach. This will simplify the code and make easier to find the unbalanced mutex locks. No functional changes, but only the code readability improvement as a preliminary work for further changes. Signed-off-by: Takashi Iwai commit 7ceb1c37533e2298797188087796dd44931d86af Author: Stephen Hemminger Date: Sat Jul 28 21:58:48 2018 +0000 Drivers: hv: vmbus: add numa_node to sysfs Being able to find the numa_node for a device is useful for userspace drivers (DPDK) and also for diagnosing performance issues. This makes vmbus similar to pci. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 9d9c9656871cd9fc1d03a2b4f47a278d54c6d03d Author: Sunil Muthuswamy Date: Sat Jul 28 21:58:47 2018 +0000 Drivers: hv: vmbus: Get rid of MSR access from vmbus_drv.c Get rid of ISA specific code from vmus_drv.c which is common code. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 8afc06dd75c06b9d6e70e4a72fdafbd4cab8d1df Author: Sunil Muthuswamy Date: Sat Jul 28 21:58:46 2018 +0000 Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr The check to free the Hyper-V control table header was reversed. This fixes it. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit ddcaf3ca4c3c87b955ad6f57952250030be77791 Author: Sunil Muthuswamy Date: Sat Jul 28 21:58:45 2018 +0000 Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer The code to support panic control message was checking the return was checking the return value from kmsg_dump_get_buffer as error value, which is not what the routine returns. This fixes it. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit bb8a14a3d8203f3af45f84c6169cc09ef56156a3 Author: Dmitriy Cherkasov Date: Sat Jul 28 22:55:24 2018 +0000 staging: gasket: use NULL instead of 0 for null pointer Fixes sparse warning: Using plain integer as NULL pointer Signed-off-by: Dmitriy Cherkasov Signed-off-by: Greg Kroah-Hartman commit 5b6e80cc9806a5cf78f68df2b6b64812b51d91c9 Author: Todd Poynor Date: Sat Jul 28 12:33:24 2018 -0700 staging: gasket: core: hold reference on device while in use Hold a reference on the struct device while a pointer to that device is in use by gasket. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 6caa58413692cf3d62c5cc57800a92166c37423b Author: Gao Xiang Date: Sun Jul 29 13:37:57 2018 +0800 staging: erofs: fix conditional uninitialized `pcn' in z_erofs_map_blocks_iter This patch adds error handling code for z_erofs_map_blocks_iter to fix the compiler blame. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 47e541a17ec7d64e19c11f59dfce314a89f1b228 Author: Gao Xiang Date: Sun Jul 29 13:34:58 2018 +0800 staging: erofs: fix compile error without built-in decompression support This patch fixes incorrect code snippets due to spilt code into small patches by mistake. Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050747.html Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050750.html Reported-by: kbuild test robot Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit d339377c0447b08cd207ff21f621d5e9460c9b9f Merge: 37b81dc5ed31 2da19ed3e4a8 Author: David S. Miller Date: Sat Jul 28 22:53:31 2018 -0700 Merge branch 'tls-Fix-improper-revert-in-zerocopy_from_iter' Doron Roberts-Kedes says: ==================== tls: Fix improper revert in zerocopy_from_iter This series fixes the improper iov_iter_revert introcded in "tls: Fix zerocopy_from_iter iov handling". ==================== Signed-off-by: David S. Miller commit 2da19ed3e4a87db16c0f69039da9f17a9596c350 Author: Doron Roberts-Kedes Date: Thu Jul 26 07:59:36 2018 -0700 tls: Fix improper revert in zerocopy_from_iter The current code is problematic because the iov_iter is reverted and never advanced in the non-error case. This patch skips the revert in the non-error case. This patch also fixes the amount by which the iov_iter is reverted. Currently, iov_iter is reverted by size, which can be greater than the amount by which the iter was actually advanced. Instead, only revert by the amount that the iter was advanced. Fixes: 4718799817c5 ("tls: Fix zerocopy_from_iter iov handling") Signed-off-by: Doron Roberts-Kedes Signed-off-by: David S. Miller commit 5a3611efe5b3095f348c892d040202b2ae969f4e Author: Doron Roberts-Kedes Date: Thu Jul 26 07:59:35 2018 -0700 tls: Remove dead code in tls_sw_sendmsg tls_push_record either returns 0 on success or a negative value on failure. This patch removes code that would only be executed if tls_push_record were to return a positive value. Signed-off-by: Doron Roberts-Kedes Signed-off-by: David S. Miller commit 37b81dc5ed31d497a6f1ab2bf8578f2343b349ef Merge: a0732548ba03 562e2f467e71 Author: David S. Miller Date: Sat Jul 28 22:12:55 2018 -0700 Merge branch 'mvneta-next' Gregory CLEMENT says: ==================== A fix and a few improvements on mvneta This series brings some improvements for the mvneta driver and also adds a fix. Compared to the v2, the main change is another patch fixing a bug in mtu_change. Changelog: v1 -> v2 - In patch 2, use EXPORT_SYMBOL_GPL for mvneta_bm_get and mvneta_bm_put to be used in module, reported by kbuild test robot. - In patch 4, add the counter to the driver's ethtool state, suggested by David Miller. - In patch 6, use a single if, suggested by Marcin Wojtas v2 -> v3 - Adding a patch fixing the mtu change issue - Removing the inline keyword for mvneta_rx_refill() and let the comiler decided, suggested by David Miller. ==================== Signed-off-by: David S. Miller commit 562e2f467e71f45f0400ebee5077eaa426d3e426 Author: Yelena Krivosheev Date: Wed Jul 18 18:10:57 2018 +0200 net: mvneta: Improve the buffer allocation method for SWBM With system having a small memory (around 256MB), the state "cannot allocate memory to refill with new buffer" is reach pretty quickly. By this patch we changed buffer allocation method to a better handling of this use case by avoiding memory allocation issues. Signed-off-by: Yelena Krivosheev [gregory: extract from a larger patch] Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit f945cec88cbd2f66251a9f5b2532ca10c4e87426 Author: Yelena Krivosheev Date: Wed Jul 18 18:10:56 2018 +0200 net: mvneta: Verify hardware checksum only when offload checksum feature is set If the checksum offload feature is not set, then there is no point to check the status of the hardware. [gregory: extract from a larger patch] Signed-off-by: Yelena Krivosheev Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit 7e47fd84b56bb37ff1c3d9ab49c2fff5ee4b3077 Author: Gregory CLEMENT Date: Wed Jul 18 18:10:55 2018 +0200 net: mvneta: Allocate page for the descriptor Instead of trying to allocate the exact amount of memory for each descriptor use a page for each of them, it allows to simplify the allocation management and increase the performance of the driver. Based on the work of Yelena Krivosheev Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit 17a96da627163d82776e2dc3198deef68cf077e0 Author: Gregory CLEMENT Date: Wed Jul 18 18:10:54 2018 +0200 net: mvneta: discriminate error cause for missed packet In order to improve the diagnostic in case of error, make the distinction between refill error and skb allocation error. Also make the information available through the ethtool state. Based on the work of Yelena Krivosheev Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit c307e2a895c9ce4040e68f034008c289209ce482 Author: Yelena Krivosheev Date: Wed Jul 18 18:10:53 2018 +0200 net: mvneta: increase number of buffers in RX and TX queue The initial values were too small leading to poor performance when using the software buffer management. Signed-off-by: Yelena Krivosheev [gregory: extract from a larger patch] Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit 965cbbec7f207fef969d268fdabbcb779ec294ab Author: Gregory CLEMENT Date: Wed Jul 18 18:10:52 2018 +0200 net: mvneta: remove data pointer usage from device_node structure On year ago Rob Herring wanted to remove the data pointer from the device_node structure[1]. The mvneta driver seemed to be the only one which used (abused ?) it. However, the proposal of Rob to remove this pointer from the driver introduced a regression, and I tested and fixed an alternative way, but it was never submitted as a proper patch. Now here it is: Instead of using the device_node structure ->data pointer, we store the BM private data as the driver data of the BM platform_device. The core mvneta code can retrieve it by doing a lookup on which platform_device corresponds to the BM device tree node using of_find_device_by_node(), and get its driver data [1]https://www.spinics.net/lists/netdev/msg445197.html Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit 8466baf788ec3e18836bd9c91ba0b1a07af25878 Author: Yelena Krivosheev Date: Wed Jul 18 18:10:51 2018 +0200 net: mvneta: fix mtu change on port without link It is incorrect to enable TX/RX queues (call by mvneta_port_up()) for port without link. Indeed MTU change for interface without link causes TX queues to stuck. Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP network unit") Signed-off-by: Yelena Krivosheev [gregory.clement: adding Fixes tags and rewording commit log] Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit 7a86f05faf112463cfbbdfd222012e247de461a1 Author: Andrew Lunn Date: Wed Jul 18 18:10:50 2018 +0200 net: ethernet: mvneta: Fix napi structure mixup on armada 3700 The mvneta Ethernet driver is used on a few different Marvell SoCs. Some SoCs have per cpu interrupts for Ethernet events. Some SoCs have a single interrupt, independent of the CPU. The driver handles this by having a per CPU napi structure when there are per CPU interrupts, and a global napi structure when there is a single interrupt. When the napi core calls mvneta_poll(), it passes the napi instance. This was not being propagated through the call chain, and instead the per-cpu napi instance was passed to napi_gro_receive() call. This breaks when there is a single global napi instance. Signed-off-by: Andrew Lunn Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC") Signed-off-by: Gregory CLEMENT Signed-off-by: David S. Miller commit ddc7c5721ae3554727f3e25e5c7510e278caf6be Author: Jeremy Cline Date: Sat Jul 28 10:48:33 2018 -0400 scripts: Add Python 3 support to tracing/draw_functrace.py Use the print function. This maintains Python 2 support and should have no functional change. Signed-off-by: Jeremy Cline Signed-off-by: Masahiro Yamada commit 10d255c3540239c7920f52d2eb223756e186af56 Author: Chao Yu Date: Wed Jul 4 21:20:05 2018 +0800 f2fs: fix to skip GC if type in SSA and SIT is inconsistent If segment type in SSA and SIT is inconsistent, we will encounter below BUG_ON during GC, to avoid this panic, let's just skip doing GC on such segment. The bug is triggered with image reported in below link: https://bugzilla.kernel.org/show_bug.cgi?id=200223 [ 388.060262] ------------[ cut here ]------------ [ 388.060268] kernel BUG at /home/y00370721/git/devf2fs/gc.c:989! [ 388.061172] invalid opcode: 0000 [#1] SMP [ 388.061773] Modules linked in: f2fs(O) bluetooth ecdh_generic xt_tcpudp iptable_filter ip_tables x_tables lp ttm drm_kms_helper drm intel_rapl sb_edac crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel fb_sys_fops ppdev aes_x86_64 syscopyarea crypto_simd sysfillrect parport_pc joydev sysimgblt glue_helper parport cryptd i2c_piix4 serio_raw mac_hid btrfs hid_generic usbhid hid raid6_pq psmouse pata_acpi floppy [ 388.064247] CPU: 7 PID: 4151 Comm: f2fs_gc-7:0 Tainted: G O 4.13.0-rc1+ #26 [ 388.065306] Hardware name: Xen HVM domU, BIOS 4.1.2_115-900.260_ 11/06/2015 [ 388.066058] task: ffff880201583b80 task.stack: ffffc90004d7c000 [ 388.069948] RIP: 0010:do_garbage_collect+0xcc8/0xcd0 [f2fs] [ 388.070766] RSP: 0018:ffffc90004d7fc68 EFLAGS: 00010202 [ 388.071783] RAX: ffff8801ed227000 RBX: 0000000000000001 RCX: ffffea0007b489c0 [ 388.072700] RDX: ffff880000000000 RSI: 0000000000000001 RDI: ffffea0007b489c0 [ 388.073607] RBP: ffffc90004d7fd58 R08: 0000000000000003 R09: ffffea0007b489dc [ 388.074619] R10: 0000000000000000 R11: 0052782ab317138d R12: 0000000000000018 [ 388.075625] R13: 0000000000000018 R14: ffff880211ceb000 R15: ffff880211ceb000 [ 388.076687] FS: 0000000000000000(0000) GS:ffff880214fc0000(0000) knlGS:0000000000000000 [ 388.083277] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 388.084536] CR2: 0000000000e18c60 CR3: 00000001ecf2e000 CR4: 00000000001406e0 [ 388.085748] Call Trace: [ 388.086690] ? find_next_bit+0xb/0x10 [ 388.088091] f2fs_gc+0x1a8/0x9d0 [f2fs] [ 388.088888] ? lock_timer_base+0x7d/0xa0 [ 388.090213] ? try_to_del_timer_sync+0x44/0x60 [ 388.091698] gc_thread_func+0x342/0x4b0 [f2fs] [ 388.092892] ? wait_woken+0x80/0x80 [ 388.094098] kthread+0x109/0x140 [ 388.095010] ? f2fs_gc+0x9d0/0x9d0 [f2fs] [ 388.096043] ? kthread_park+0x60/0x60 [ 388.097281] ret_from_fork+0x25/0x30 [ 388.098401] Code: ff ff 48 83 e8 01 48 89 44 24 58 e9 27 f8 ff ff 48 83 e8 01 e9 78 fc ff ff 48 8d 78 ff e9 17 fb ff ff 48 83 ef 01 e9 4d f4 ff ff <0f> 0b 66 0f 1f 44 00 00 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 [ 388.100864] RIP: do_garbage_collect+0xcc8/0xcd0 [f2fs] RSP: ffffc90004d7fc68 [ 388.101810] ---[ end trace 81c73d6e6b7da61d ]--- Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4b270a8cc5047682f0a3f3f9af3b498408dbd2bc Author: Chao Yu Date: Wed Jul 4 18:04:10 2018 +0800 f2fs: try grabbing node page lock aggressively in sync scenario In synchronous scenario, like in checkpoint(), we are going to flush dirty node pages to device synchronously, we can easily failed writebacking node page due to trylock_page() failure, especially in condition of intensive lock competition, which can cause long latency of checkpoint(). So let's use lock_page() in synchronous scenario to avoid this issue. Signed-off-by: Yunlei He Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit dc1328027b53586cc6b668c6654f9482e505699c Author: Sahitya Tummala Date: Mon Jul 2 11:37:40 2018 +0530 f2fs: show the fsync_mode=nobarrier mount option This patch shows the fsync_mode=nobarrier mount option in f2fs_show_options(). Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 68c43a235e8c8fa69322e8239762242cb3e752cb Author: Yunlei He Date: Mon Jul 2 10:40:19 2018 +0800 f2fs: check the right return value of memory alloc function This patch check the right return value of memory alloc function Signed-off-by: Yunlei He Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b1385478187a90d4273c328aa8dcad8d47c350a2 Author: Guenter Roeck Date: Sun Jul 1 13:57:06 2018 -0700 f2fs: Replace strncpy with memcpy gcc 8.1.0 complains: fs/f2fs/namei.c: In function 'f2fs_update_extension_list': fs/f2fs/namei.c:257:3: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length fs/f2fs/namei.c:249:3: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length Using strncpy() is indeed less than perfect since the length of data to be copied has already been determined with strlen(). Replace strncpy() with memcpy() to address the warning and optimize the code a little. Signed-off-by: Guenter Roeck Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2d3a58566f66465bbcd70afafbb66b001beb9d12 Author: Gao Xiang Date: Sat Jun 30 23:57:03 2018 +0800 f2fs: avoid the global name 'fault_name' Non-prefix global name 'fault_name' will pollute global namespace, fix it. Refer to: https://lists.01.org/pipermail/kbuild-all/2018-June/049660.html To: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Reported-by: kbuild test robot Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4dbe38dc386910c668c75ae616b99b823b59f3eb Author: Chao Yu Date: Sat Jun 30 18:13:40 2018 +0800 f2fs: fix to do sanity check with reserved blkaddr of inline inode As Wen Xu reported in bugzilla, after image was injected with random data by fuzzing, inline inode would contain invalid reserved blkaddr, then during inline conversion, we will encounter illegal memory accessing reported by KASAN, the root cause of this is when writing out converted inline page, we will use invalid reserved blkaddr to update sit bitmap, result in accessing memory beyond sit bitmap boundary. In order to fix this issue, let's do sanity check with reserved block address of inline inode to avoid above condition. https://bugzilla.kernel.org/show_bug.cgi?id=200179 [ 1428.846352] BUG: KASAN: use-after-free in update_sit_entry+0x80/0x7f0 [ 1428.846618] Read of size 4 at addr ffff880194483540 by task a.out/2741 [ 1428.846855] CPU: 0 PID: 2741 Comm: a.out Tainted: G W 4.17.0+ #1 [ 1428.846858] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 1428.846860] Call Trace: [ 1428.846868] dump_stack+0x71/0xab [ 1428.846875] print_address_description+0x6b/0x290 [ 1428.846881] kasan_report+0x28e/0x390 [ 1428.846888] ? update_sit_entry+0x80/0x7f0 [ 1428.846898] update_sit_entry+0x80/0x7f0 [ 1428.846906] f2fs_allocate_data_block+0x6db/0xc70 [ 1428.846914] ? f2fs_get_node_info+0x14f/0x590 [ 1428.846920] do_write_page+0xc8/0x150 [ 1428.846928] f2fs_outplace_write_data+0xfe/0x210 [ 1428.846935] ? f2fs_do_write_node_page+0x170/0x170 [ 1428.846941] ? radix_tree_tag_clear+0xff/0x130 [ 1428.846946] ? __mod_node_page_state+0x22/0xa0 [ 1428.846951] ? inc_zone_page_state+0x54/0x100 [ 1428.846956] ? __test_set_page_writeback+0x336/0x5d0 [ 1428.846964] f2fs_convert_inline_page+0x407/0x6d0 [ 1428.846971] ? f2fs_read_inline_data+0x3b0/0x3b0 [ 1428.846978] ? __get_node_page+0x335/0x6b0 [ 1428.846987] f2fs_convert_inline_inode+0x41b/0x500 [ 1428.846994] ? f2fs_convert_inline_page+0x6d0/0x6d0 [ 1428.847000] ? kasan_unpoison_shadow+0x31/0x40 [ 1428.847005] ? kasan_kmalloc+0xa6/0xd0 [ 1428.847024] f2fs_file_mmap+0x79/0xc0 [ 1428.847029] mmap_region+0x58b/0x880 [ 1428.847037] ? arch_get_unmapped_area+0x370/0x370 [ 1428.847042] do_mmap+0x55b/0x7a0 [ 1428.847048] vm_mmap_pgoff+0x16f/0x1c0 [ 1428.847055] ? vma_is_stack_for_current+0x50/0x50 [ 1428.847062] ? __fsnotify_update_child_dentry_flags.part.1+0x160/0x160 [ 1428.847068] ? do_sys_open+0x206/0x2a0 [ 1428.847073] ? __fget+0xb4/0x100 [ 1428.847079] ksys_mmap_pgoff+0x278/0x360 [ 1428.847085] ? find_mergeable_anon_vma+0x50/0x50 [ 1428.847091] do_syscall_64+0x73/0x160 [ 1428.847098] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1428.847102] RIP: 0033:0x7fb1430766ba [ 1428.847103] Code: 89 f5 41 54 49 89 fc 55 53 74 35 49 63 e8 48 63 da 4d 89 f9 49 89 e8 4d 63 d6 48 89 da 4c 89 ee 4c 89 e7 b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 56 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 00 [ 1428.847162] RSP: 002b:00007ffc651d9388 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 [ 1428.847167] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fb1430766ba [ 1428.847170] RDX: 0000000000000001 RSI: 0000000000001000 RDI: 0000000000000000 [ 1428.847173] RBP: 0000000000000003 R08: 0000000000000003 R09: 0000000000000000 [ 1428.847176] R10: 0000000000008002 R11: 0000000000000246 R12: 0000000000000000 [ 1428.847179] R13: 0000000000001000 R14: 0000000000008002 R15: 0000000000000000 [ 1428.847252] Allocated by task 2683: [ 1428.847372] kasan_kmalloc+0xa6/0xd0 [ 1428.847380] kmem_cache_alloc+0xc8/0x1e0 [ 1428.847385] getname_flags+0x73/0x2b0 [ 1428.847390] user_path_at_empty+0x1d/0x40 [ 1428.847395] vfs_statx+0xc1/0x150 [ 1428.847401] __do_sys_newlstat+0x7e/0xd0 [ 1428.847405] do_syscall_64+0x73/0x160 [ 1428.847411] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1428.847466] Freed by task 2683: [ 1428.847566] __kasan_slab_free+0x137/0x190 [ 1428.847571] kmem_cache_free+0x85/0x1e0 [ 1428.847575] filename_lookup+0x191/0x280 [ 1428.847580] vfs_statx+0xc1/0x150 [ 1428.847585] __do_sys_newlstat+0x7e/0xd0 [ 1428.847590] do_syscall_64+0x73/0x160 [ 1428.847596] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1428.847648] The buggy address belongs to the object at ffff880194483300 which belongs to the cache names_cache of size 4096 [ 1428.847946] The buggy address is located 576 bytes inside of 4096-byte region [ffff880194483300, ffff880194484300) [ 1428.848234] The buggy address belongs to the page: [ 1428.848366] page:ffffea0006512000 count:1 mapcount:0 mapping:ffff8801f3586380 index:0x0 compound_mapcount: 0 [ 1428.848606] flags: 0x17fff8000008100(slab|head) [ 1428.848737] raw: 017fff8000008100 dead000000000100 dead000000000200 ffff8801f3586380 [ 1428.848931] raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000 [ 1428.849122] page dumped because: kasan: bad access detected [ 1428.849305] Memory state around the buggy address: [ 1428.849436] ffff880194483400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 1428.849620] ffff880194483480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 1428.849804] >ffff880194483500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 1428.849985] ^ [ 1428.850120] ffff880194483580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 1428.850303] ffff880194483600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 1428.850498] ================================================================== Reported-by: Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e34438c903b653daca2b2a7de95aed46226f8ed3 Author: Chao Yu Date: Fri Jun 29 13:55:22 2018 +0800 f2fs: fix to do sanity check with node footer and iblocks This patch adds to do sanity check with below fields of inode to avoid reported panic. - node footer - iblocks https://bugzilla.kernel.org/show_bug.cgi?id=200223 - Overview BUG() triggered in f2fs_truncate_inode_blocks() when un-mounting a mounted f2fs image after writing to it - Reproduce - POC (poc.c) static void activity(char *mpoint) { char *foo_bar_baz; int err; static int buf[8192]; memset(buf, 0, sizeof(buf)); err = asprintf(&foo_bar_baz, "%s/foo/bar/baz", mpoint); // open / write / read int fd = open(foo_bar_baz, O_RDWR | O_TRUNC, 0777); if (fd >= 0) { write(fd, (char *)buf, 517); write(fd, (char *)buf, sizeof(buf)); close(fd); } } int main(int argc, char *argv[]) { activity(argv[1]); return 0; } - Kernel meesage [ 552.479723] F2FS-fs (loop0): Mounted with checkpoint version = 2 [ 556.451891] ------------[ cut here ]------------ [ 556.451899] kernel BUG at fs/f2fs/node.c:987! [ 556.452920] invalid opcode: 0000 [#1] SMP KASAN PTI [ 556.453936] CPU: 1 PID: 1310 Comm: umount Not tainted 4.18.0-rc1+ #4 [ 556.455213] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 556.457140] RIP: 0010:f2fs_truncate_inode_blocks+0x4a7/0x6f0 [ 556.458280] Code: e8 ae ea ff ff 41 89 c7 c1 e8 1f 84 c0 74 0a 41 83 ff fe 0f 85 35 ff ff ff 81 85 b0 fe ff ff fb 03 00 00 e9 f7 fd ff ff 0f 0b <0f> 0b e8 62 b7 9a 00 48 8b bd a0 fe ff ff e8 56 54 ae ff 48 8b b5 [ 556.462015] RSP: 0018:ffff8801f292f808 EFLAGS: 00010286 [ 556.463068] RAX: ffffed003e73242d RBX: ffff8801f292f958 RCX: ffffffffb88b81bc [ 556.464479] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff8801f3992164 [ 556.465901] RBP: ffff8801f292f980 R08: ffffed003e73242d R09: ffffed003e73242d [ 556.467311] R10: 0000000000000001 R11: ffffed003e73242c R12: 00000000fffffc64 [ 556.468706] R13: ffff8801f3992000 R14: 0000000000000058 R15: 00000000ffff8801 [ 556.470117] FS: 00007f8029297840(0000) GS:ffff8801f6f00000(0000) knlGS:0000000000000000 [ 556.471702] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 556.472838] CR2: 000055f5f57305d8 CR3: 00000001f18b0000 CR4: 00000000000006e0 [ 556.474265] Call Trace: [ 556.474782] ? f2fs_alloc_nid_failed+0xf0/0xf0 [ 556.475686] ? truncate_nodes+0x980/0x980 [ 556.476516] ? pagecache_get_page+0x21f/0x2f0 [ 556.477412] ? __asan_loadN+0xf/0x20 [ 556.478153] ? __get_node_page+0x331/0x5b0 [ 556.478992] ? reweight_entity+0x1e6/0x3b0 [ 556.479826] f2fs_truncate_blocks+0x55e/0x740 [ 556.480709] ? f2fs_truncate_data_blocks+0x20/0x20 [ 556.481689] ? __radix_tree_lookup+0x34/0x160 [ 556.482630] ? radix_tree_lookup+0xd/0x10 [ 556.483445] f2fs_truncate+0xd4/0x1a0 [ 556.484206] f2fs_evict_inode+0x5ce/0x630 [ 556.485032] evict+0x16f/0x290 [ 556.485664] iput+0x280/0x300 [ 556.486300] dentry_unlink_inode+0x165/0x1e0 [ 556.487169] __dentry_kill+0x16a/0x260 [ 556.487936] dentry_kill+0x70/0x250 [ 556.488651] shrink_dentry_list+0x125/0x260 [ 556.489504] shrink_dcache_parent+0xc1/0x110 [ 556.490379] ? shrink_dcache_sb+0x200/0x200 [ 556.491231] ? bit_wait_timeout+0xc0/0xc0 [ 556.492047] do_one_tree+0x12/0x40 [ 556.492743] shrink_dcache_for_umount+0x3f/0xa0 [ 556.493656] generic_shutdown_super+0x43/0x1c0 [ 556.494561] kill_block_super+0x52/0x80 [ 556.495341] kill_f2fs_super+0x62/0x70 [ 556.496105] deactivate_locked_super+0x6f/0xa0 [ 556.497004] deactivate_super+0x5e/0x80 [ 556.497785] cleanup_mnt+0x61/0xa0 [ 556.498492] __cleanup_mnt+0x12/0x20 [ 556.499218] task_work_run+0xc8/0xf0 [ 556.499949] exit_to_usermode_loop+0x125/0x130 [ 556.500846] do_syscall_64+0x138/0x170 [ 556.501609] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 556.502659] RIP: 0033:0x7f8028b77487 [ 556.503384] Code: 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 c9 2b 00 f7 d8 64 89 01 48 [ 556.507137] RSP: 002b:00007fff9f2e3598 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [ 556.508637] RAX: 0000000000000000 RBX: 0000000000ebd030 RCX: 00007f8028b77487 [ 556.510069] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000ec41e0 [ 556.511481] RBP: 0000000000ec41e0 R08: 0000000000000000 R09: 0000000000000014 [ 556.512892] R10: 00000000000006b2 R11: 0000000000000246 R12: 00007f802908083c [ 556.514320] R13: 0000000000000000 R14: 0000000000ebd210 R15: 00007fff9f2e3820 [ 556.515745] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd mac_hid i2c_piix4 soundcore ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear 8139too crct10dif_pclmul crc32_pclmul qxl drm_kms_helper syscopyarea aesni_intel sysfillrect sysimgblt fb_sys_fops ttm drm aes_x86_64 crypto_simd cryptd 8139cp glue_helper mii pata_acpi floppy [ 556.529276] ---[ end trace 4ce02f25ff7d3df5 ]--- [ 556.530340] RIP: 0010:f2fs_truncate_inode_blocks+0x4a7/0x6f0 [ 556.531513] Code: e8 ae ea ff ff 41 89 c7 c1 e8 1f 84 c0 74 0a 41 83 ff fe 0f 85 35 ff ff ff 81 85 b0 fe ff ff fb 03 00 00 e9 f7 fd ff ff 0f 0b <0f> 0b e8 62 b7 9a 00 48 8b bd a0 fe ff ff e8 56 54 ae ff 48 8b b5 [ 556.535330] RSP: 0018:ffff8801f292f808 EFLAGS: 00010286 [ 556.536395] RAX: ffffed003e73242d RBX: ffff8801f292f958 RCX: ffffffffb88b81bc [ 556.537824] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff8801f3992164 [ 556.539290] RBP: ffff8801f292f980 R08: ffffed003e73242d R09: ffffed003e73242d [ 556.540709] R10: 0000000000000001 R11: ffffed003e73242c R12: 00000000fffffc64 [ 556.542131] R13: ffff8801f3992000 R14: 0000000000000058 R15: 00000000ffff8801 [ 556.543579] FS: 00007f8029297840(0000) GS:ffff8801f6f00000(0000) knlGS:0000000000000000 [ 556.545180] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 556.546338] CR2: 000055f5f57305d8 CR3: 00000001f18b0000 CR4: 00000000000006e0 [ 556.547809] ================================================================== [ 556.549248] BUG: KASAN: stack-out-of-bounds in arch_tlb_gather_mmu+0x52/0x170 [ 556.550672] Write of size 8 at addr ffff8801f292fd10 by task umount/1310 [ 556.552338] CPU: 1 PID: 1310 Comm: umount Tainted: G D 4.18.0-rc1+ #4 [ 556.553886] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 556.555756] Call Trace: [ 556.556264] dump_stack+0x7b/0xb5 [ 556.556944] print_address_description+0x70/0x290 [ 556.557903] kasan_report+0x291/0x390 [ 556.558649] ? arch_tlb_gather_mmu+0x52/0x170 [ 556.559537] __asan_store8+0x57/0x90 [ 556.560268] arch_tlb_gather_mmu+0x52/0x170 [ 556.561110] tlb_gather_mmu+0x12/0x40 [ 556.561862] exit_mmap+0x123/0x2a0 [ 556.562555] ? __ia32_sys_munmap+0x50/0x50 [ 556.563384] ? exit_aio+0x98/0x230 [ 556.564079] ? __x32_compat_sys_io_submit+0x260/0x260 [ 556.565099] ? taskstats_exit+0x1f4/0x640 [ 556.565925] ? kasan_check_read+0x11/0x20 [ 556.566739] ? mm_update_next_owner+0x322/0x380 [ 556.567652] mmput+0x8b/0x1d0 [ 556.568260] do_exit+0x43a/0x1390 [ 556.568937] ? mm_update_next_owner+0x380/0x380 [ 556.569855] ? deactivate_super+0x5e/0x80 [ 556.570668] ? cleanup_mnt+0x61/0xa0 [ 556.571395] ? __cleanup_mnt+0x12/0x20 [ 556.572156] ? task_work_run+0xc8/0xf0 [ 556.572917] ? exit_to_usermode_loop+0x125/0x130 [ 556.573861] rewind_stack_do_exit+0x17/0x20 [ 556.574707] RIP: 0033:0x7f8028b77487 [ 556.575428] Code: Bad RIP value. [ 556.576106] RSP: 002b:00007fff9f2e3598 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [ 556.577599] RAX: 0000000000000000 RBX: 0000000000ebd030 RCX: 00007f8028b77487 [ 556.579020] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000ec41e0 [ 556.580422] RBP: 0000000000ec41e0 R08: 0000000000000000 R09: 0000000000000014 [ 556.581833] R10: 00000000000006b2 R11: 0000000000000246 R12: 00007f802908083c [ 556.583252] R13: 0000000000000000 R14: 0000000000ebd210 R15: 00007fff9f2e3820 [ 556.584983] The buggy address belongs to the page: [ 556.585961] page:ffffea0007ca4bc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0 [ 556.587540] flags: 0x2ffff0000000000() [ 556.588296] raw: 02ffff0000000000 0000000000000000 dead000000000200 0000000000000000 [ 556.589822] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 556.591359] page dumped because: kasan: bad access detected [ 556.592786] Memory state around the buggy address: [ 556.593753] ffff8801f292fc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 556.595191] ffff8801f292fc80: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 [ 556.596613] >ffff8801f292fd00: 00 00 f3 00 00 00 00 f3 f3 00 00 00 00 f4 f4 f4 [ 556.598044] ^ [ 556.598797] ffff8801f292fd80: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 [ 556.600225] ffff8801f292fe00: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f4 f4 f4 [ 556.601647] ================================================================== - Location https://elixir.bootlin.com/linux/v4.18-rc1/source/fs/f2fs/node.c#L987 case NODE_DIND_BLOCK: err = truncate_nodes(&dn, nofs, offset[1], 3); cont = 0; break; default: BUG(); <--- } Reported-by Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e15d54d5009688ccb2a5312f3b70d631615329c9 Author: Yunlei He Date: Wed Jun 27 14:46:21 2018 +0800 f2fs: Allocate and stat mem used by free nid bitmap more accurately This patch used f2fs_bitmap_size macro to calculate mem used by free nid bitmap, and stat used mem including aligned part. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 9dc956b2c8523aed39d1e6508438be9fea28c8fc Author: Chao Yu Date: Wed Jun 27 18:05:54 2018 +0800 f2fs: fix to do sanity check with user_block_count This patch fixs to do sanity check with user_block_count. - Overview Divide zero in utilization when mount() a corrupted f2fs image - Reproduce (4.18 upstream kernel) - Kernel message [ 564.099503] F2FS-fs (loop0): invalid crc value [ 564.101991] divide error: 0000 [#1] SMP KASAN PTI [ 564.103103] CPU: 1 PID: 1298 Comm: f2fs_discard-7: Not tainted 4.18.0-rc1+ #4 [ 564.104584] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 564.106624] RIP: 0010:issue_discard_thread+0x248/0x5c0 [ 564.107692] Code: ff ff 48 8b bd e8 fe ff ff 41 8b 9d 4c 04 00 00 e8 cd b8 ad ff 41 8b 85 50 04 00 00 31 d2 48 8d 04 80 48 8d 04 80 48 c1 e0 02 <48> f7 f3 83 f8 50 7e 16 41 c7 86 7c ff ff ff 01 00 00 00 41 c7 86 [ 564.111686] RSP: 0018:ffff8801f3117dc0 EFLAGS: 00010206 [ 564.112775] RAX: 0000000000000384 RBX: 0000000000000000 RCX: ffffffffb88c1e03 [ 564.114250] RDX: 0000000000000000 RSI: dffffc0000000000 RDI: ffff8801e3aa4850 [ 564.115706] RBP: ffff8801f3117f00 R08: 1ffffffff751a1d0 R09: fffffbfff751a1d0 [ 564.117177] R10: 0000000000000001 R11: fffffbfff751a1d0 R12: 00000000fffffffc [ 564.118634] R13: ffff8801e3aa4400 R14: ffff8801f3117ed8 R15: ffff8801e2050000 [ 564.120094] FS: 0000000000000000(0000) GS:ffff8801f6f00000(0000) knlGS:0000000000000000 [ 564.121748] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 564.122923] CR2: 000000000202b078 CR3: 00000001f11ac000 CR4: 00000000000006e0 [ 564.124383] Call Trace: [ 564.124924] ? __issue_discard_cmd+0x480/0x480 [ 564.125882] ? __sched_text_start+0x8/0x8 [ 564.126756] ? __kthread_parkme+0xcb/0x100 [ 564.127620] ? kthread_blkcg+0x70/0x70 [ 564.128412] kthread+0x180/0x1d0 [ 564.129105] ? __issue_discard_cmd+0x480/0x480 [ 564.130029] ? kthread_associate_blkcg+0x150/0x150 [ 564.131033] ret_from_fork+0x35/0x40 [ 564.131794] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd mac_hid i2c_piix4 soundcore ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear 8139too crct10dif_pclmul crc32_pclmul qxl drm_kms_helper syscopyarea aesni_intel sysfillrect sysimgblt fb_sys_fops ttm drm aes_x86_64 crypto_simd cryptd 8139cp glue_helper mii pata_acpi floppy [ 564.141798] ---[ end trace 4ce02f25ff7d3df5 ]--- [ 564.142773] RIP: 0010:issue_discard_thread+0x248/0x5c0 [ 564.143885] Code: ff ff 48 8b bd e8 fe ff ff 41 8b 9d 4c 04 00 00 e8 cd b8 ad ff 41 8b 85 50 04 00 00 31 d2 48 8d 04 80 48 8d 04 80 48 c1 e0 02 <48> f7 f3 83 f8 50 7e 16 41 c7 86 7c ff ff ff 01 00 00 00 41 c7 86 [ 564.147776] RSP: 0018:ffff8801f3117dc0 EFLAGS: 00010206 [ 564.148856] RAX: 0000000000000384 RBX: 0000000000000000 RCX: ffffffffb88c1e03 [ 564.150424] RDX: 0000000000000000 RSI: dffffc0000000000 RDI: ffff8801e3aa4850 [ 564.151906] RBP: ffff8801f3117f00 R08: 1ffffffff751a1d0 R09: fffffbfff751a1d0 [ 564.153463] R10: 0000000000000001 R11: fffffbfff751a1d0 R12: 00000000fffffffc [ 564.154915] R13: ffff8801e3aa4400 R14: ffff8801f3117ed8 R15: ffff8801e2050000 [ 564.156405] FS: 0000000000000000(0000) GS:ffff8801f6f00000(0000) knlGS:0000000000000000 [ 564.158070] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 564.159279] CR2: 000000000202b078 CR3: 00000001f11ac000 CR4: 00000000000006e0 [ 564.161043] ================================================================== [ 564.162587] BUG: KASAN: stack-out-of-bounds in from_kuid_munged+0x1d/0x50 [ 564.163994] Read of size 4 at addr ffff8801f3117c84 by task f2fs_discard-7:/1298 [ 564.165852] CPU: 1 PID: 1298 Comm: f2fs_discard-7: Tainted: G D 4.18.0-rc1+ #4 [ 564.167593] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 564.169522] Call Trace: [ 564.170057] dump_stack+0x7b/0xb5 [ 564.170778] print_address_description+0x70/0x290 [ 564.171765] kasan_report+0x291/0x390 [ 564.172540] ? from_kuid_munged+0x1d/0x50 [ 564.173408] __asan_load4+0x78/0x80 [ 564.174148] from_kuid_munged+0x1d/0x50 [ 564.174962] do_notify_parent+0x1f5/0x4f0 [ 564.175808] ? send_sigqueue+0x390/0x390 [ 564.176639] ? css_set_move_task+0x152/0x340 [ 564.184197] do_exit+0x1290/0x1390 [ 564.184950] ? __issue_discard_cmd+0x480/0x480 [ 564.185884] ? mm_update_next_owner+0x380/0x380 [ 564.186829] ? __sched_text_start+0x8/0x8 [ 564.187672] ? __kthread_parkme+0xcb/0x100 [ 564.188528] ? kthread_blkcg+0x70/0x70 [ 564.189333] ? kthread+0x180/0x1d0 [ 564.190052] ? __issue_discard_cmd+0x480/0x480 [ 564.190983] rewind_stack_do_exit+0x17/0x20 [ 564.192190] The buggy address belongs to the page: [ 564.193213] page:ffffea0007cc45c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0 [ 564.194856] flags: 0x2ffff0000000000() [ 564.195644] raw: 02ffff0000000000 0000000000000000 dead000000000200 0000000000000000 [ 564.197247] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 564.198826] page dumped because: kasan: bad access detected [ 564.200299] Memory state around the buggy address: [ 564.201306] ffff8801f3117b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 564.202779] ffff8801f3117c00: 00 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 [ 564.204252] >ffff8801f3117c80: f3 f3 f3 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 [ 564.205742] ^ [ 564.206424] ffff8801f3117d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 564.207908] ffff8801f3117d80: f3 f3 f3 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 [ 564.209389] ================================================================== [ 564.231795] F2FS-fs (loop0): Mounted with checkpoint version = 2 - Location https://elixir.bootlin.com/linux/v4.18-rc1/source/fs/f2fs/segment.h#L586 return div_u64((u64)valid_user_blocks(sbi) * 100, sbi->user_block_count); Missing checks on sbi->user_block_count. Reported-by: Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2ead1be54b22ccdc93d3030172993e363128f1b4 Author: Rodrigo Siqueira Date: Wed Jul 18 21:40:45 2018 -0300 drm/vkms: Fix connector leak at the module removal Currently, vkms shows an error message if the following steps occur: (1) load vkms, (2) perform any specific operation in the vkms (e.g., run an IGT test), and (3) unload the module. The following error message emerges: [drm:drm_mode_config_cleanup [drm]] *ERROR* connector Virtual-1 leaked! This commit fixes this error by calling drm_atomic_helper_shutdown() before drm_mode_config_cleanup, which turns off the whole display pipeline and remove a reference related to any connector. Signed-off-by: Rodrigo Siqueira Signed-off-by: Gustavo Padovan Link: https://patchwork.freedesktop.org/patch/msgid/20180719004045.hzepp565x5lfco3c@smtp.gmail.com commit ea5569ecd6b81232eb536017b627c417befc1acb Author: Hans Verkuil Date: Tue Jul 24 21:20:28 2018 +0200 drm_dp_cec.c: fix formatting typo: %pdH -> %phD This caused a kernel oops since %pdH interpreted the pointer as a struct file. Signed-off-by: Hans Verkuil Signed-off-by: Gustavo Padovan Link: https://patchwork.freedesktop.org/patch/msgid/f3720ddf-ec0f-cd22-46b6-720a5e2098f2@xs4all.nl commit f59cf9a0551dd954ad8b752461cf19d9789f4b1d Author: Park Ju Hyung Date: Sat Jul 28 03:16:42 2018 +0900 ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs On rare occasions, we are still noticing that the internal speaker spitting out spurious noises even after adding the problematic codec to the list. Adding a 10ms artificial delay before rebooting fixes the issue entirely. Patch for Realtek codecs also adds the same amount of delay after entering D3. Signed-off-by: Park Ju Hyung Cc: Signed-off-by: Takashi Iwai commit d77a4b4a5b0b2ebcbc9840995d91311ef28302ab Author: Park Ju Hyung Date: Sat Jul 28 03:16:21 2018 +0900 ALSA: hda - Turn CX8200 into D3 as well upon reboot As an equivalent codec with CX20724, CX8200 is also subject to the reboot bug. Late 2017 and 2018 LG Gram and some HP Spectre laptops are known victims to this issue, causing extremely loud noises upon reboot. Now that we know that this bug is subject to multiple codecs, fix the comment as well. Signed-off-by: Park Ju Hyung Cc: Signed-off-by: Takashi Iwai commit 55690c07b44a82cc3359ce0c233f4ba7d80ba145 Author: Jinbum Park Date: Sat Jul 28 13:20:44 2018 +0900 pktcdvd: Fix possible Spectre-v1 for pkt_devs User controls @dev_minor which to be used as index of pkt_devs. So, It can be exploited via Spectre-like attack. (speculative execution) This kind of attack leaks address of pkt_devs, [1] It leads an attacker to bypass security mechanism such as KASLR. So sanitize @dev_minor before using it to prevent attack. [1] https://github.com/jinb-park/linux-exploit/ tree/master/exploit-remaining-spectre-gadget/leak_pkt_devs.c Signed-off-by: Jinbum Park Signed-off-by: Jens Axboe commit 7bab01ecc6c43da882333c6db39741cb43677004 Author: Aleksander Morgado Date: Tue Jul 24 01:34:01 2018 +0200 USB: option: add support for DW5821e The device exposes AT, NMEA and DIAG ports in both USB configurations. The patch explicitly ignores interfaces 0 and 1, as they're bound to other drivers already; and also interface 6, which is a GNSS interface for which we don't have a driver yet. T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 18 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 2 P: Vendor=413c ProdID=81d7 Rev=03.18 S: Manufacturer=DELL S: Product=DW5821e Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 7 Cfg#= 2 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 2 P: Vendor=413c ProdID=81d7 Rev=03.18 S: Manufacturer=DELL S: Product=DW5821e Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#= 1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option Signed-off-by: Aleksander Morgado Cc: stable Signed-off-by: Greg Kroah-Hartman commit ec403d8ed08c8272cfeeeea154fdebcd289988c8 Author: Stefan Berger Date: Tue Jun 26 15:09:33 2018 -0400 ima: Get rid of ima_used_chip and use ima_tpm_chip != NULL instead Get rid of ima_used_chip and use ima_tpm_chip variable instead for determining whether to use the TPM chip. Signed-off-by: Stefan Berger Signed-off-by: Mimi Zohar Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 5c2a640aff73914e11ac0db310b32d3b7a1b87ad Author: Stefan Berger Date: Tue Jun 26 15:09:32 2018 -0400 ima: Use tpm_default_chip() and call TPM functions with a tpm_chip Rather than accessing the TPM functions by passing a NULL pointer for the tpm_chip, which causes a lookup for a suitable chip every time, get a hold of a tpm_chip and access the TPM functions using it. Signed-off-by: Stefan Berger Signed-off-by: Mimi Zohar Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 58bac8cc3010ccb845572a3512fc16c9aaa5e50e Author: Jarkko Sakkinen Date: Fri Jun 29 15:24:50 2018 +0300 tpm: replace TPM_TRANSMIT_RAW with TPM_TRANSMIT_NESTED As TPM_TRANSMIT_RAW always requires also not to take locks for obvious reasons (deadlock), this commit renames the flag as TPM_TRANSMIT_NESTED and prevents taking tpm_mutex when the flag is given to tpm_transmit(). Suggested-by: Tomas Winkler Signed-off-by: Jarkko Sakkinen commit eccc9bb844838b6b7a9691b31747416c4c34a83f Author: Stefan Berger Date: Tue Jun 26 15:09:31 2018 -0400 tpm: Convert tpm_find_get_ops() to use tpm_default_chip() Convert tpm_find_get_ops() to use tpm_default_chip() in case no chip is passed in. Signed-off-by: Stefan Berger Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit aaae81536351f831fe6719e5b4e6afbadc5e5f85 Author: Stefan Berger Date: Tue Jun 26 15:09:30 2018 -0400 tpm: Implement tpm_default_chip() to find a TPM chip Implement tpm_default_chip() to find the first TPM chip and return it to the caller while increasing the reference count on its device. This function can be used by other subsystems, such as IMA, to find the system's default TPM chip and use it for all subsequent TPM operations. Signed-off-by: Stefan Berger Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit fc1d52b745bae6108102096d85e743ac33b446f2 Author: Stefan Berger Date: Tue Jun 26 07:06:15 2018 -0400 tpm: rename tpm_chip_find_get() to tpm_find_get_ops() Rename tpm_chip_find_get() to tpm_find_get_ops() to more closely match the tpm_put_ops() counter part. Signed-off-by: Stefan Berger Tested-by: Jarkko Sakkinen Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 7a64c5597aa40403e9f8319c0664228a5580c121 Author: Louis Collard Date: Fri Jun 29 16:13:55 2018 +0800 tpm: Allow tpm_tis drivers to set hwrng quality. Adds plumbing required for drivers based on tpm_tis to set hwrng quality. Signed-off-by: Louis Collard Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 36a11029b07ee30bdc4553274d0efea645ed9d91 Author: Ricardo Schwarzmeier Date: Tue Jun 26 17:31:45 2018 +0200 tpm: Return the actual size when receiving an unsupported command The userpace expects to read the number of bytes stated in the header. Returning the size of the buffer instead would be unexpected. Cc: stable@vger.kernel.org Fixes: 095531f891e6 ("tpm: return a TPM_RC_COMMAND_CODE response if command is not implemented") Signed-off-by: Ricardo Schwarzmeier Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 627448e85c766587f6fdde1ea3886d6615081c77 Author: Tomas Winkler Date: Thu Jun 28 18:13:33 2018 +0300 tpm: separate cmd_ready/go_idle from runtime_pm Fix tpm ptt initialization error: tpm tpm0: A TPM error (378) occurred get tpm pcr allocation. We cannot use go_idle cmd_ready commands via runtime_pm handles as with the introduction of localities this is no longer an optional feature, while runtime pm can be not enabled. Though cmd_ready/go_idle provides a power saving, it's also a part of TPM2 protocol and should be called explicitly. This patch exposes cmd_read/go_idle via tpm class ops and removes runtime pm support as it is not used by any driver. When calling from nested context always use both flags: TPM_TRANSMIT_UNLOCKED and TPM_TRANSMIT_RAW. Both are needed to resolve tpm spaces and locality request recursive calls to tpm_transmit(). TPM_TRANSMIT_RAW should never be used standalone as it will fail on double locking. While TPM_TRANSMIT_UNLOCKED standalone should be called from non-recursive locked contexts. New wrappers are added tpm_cmd_ready() and tpm_go_idle() to streamline tpm_try_transmit code. tpm_crb no longer needs own power saving functions and can drop using tpm_pm_suspend/resume. This patch cannot be really separated from the locality fix. Fixes: 888d867df441 (tpm: cmd_ready command can be issued only after granting locality) Cc: stable@vger.kernel.org Fixes: 888d867df441 (tpm: cmd_ready command can be issued only after granting locality) Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 79e2472f99ab457417aaad98bf83ab565fa32bd0 Author: Peter Rosin Date: Wed Jun 20 07:17:54 2018 +0200 tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Reviewed-by: Jarkko Sakkinen Tested-by: Alexander Steffen Signed-off-by: Jarkko Sakkinen commit 1a339b658d9dbe1471f67b78237cf8fa08bbbeb5 Author: Linus Walleij Date: Fri Jun 8 09:09:07 2018 +0200 tpm_tis_spi: Pass the SPI IRQ down to the driver An SPI TPM device managed directly on an embedded board using the SPI bus and some GPIO or similar line as IRQ handler will pass the IRQn from the TPM device associated with the SPI device. This is already handled by the SPI core, so make sure to pass this down to the core as well. (The TPM core habit of using -1 to signal no IRQ is dubious (as IRQ 0 is NO_IRQ) but I do not want to mess with that semantic in this patch.) Cc: Mark Brown Signed-off-by: Linus Walleij Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit ce63c05b664e491b4cc79c713c68d8170bd0f581 Author: Jarkko Sakkinen Date: Mon Mar 26 15:14:06 2018 +0300 tpm: migrate tpm2_get_random() to use struct tpm_buf In order to make struct tpm_buf the first class object for constructing TPM commands, migrate tpm2_get_random() to use it. In addition, removed remaining references to struct tpm2_cmd. All of them use it to acquire the length of the response, which can be achieved by using tpm_buf_length(). Signed-off-by: Jarkko Sakkinen Tested-by: Nayna Jain commit 2ab3241161b3c340617063beea199e9966ee90c9 Author: Jarkko Sakkinen Date: Mon Mar 26 15:14:05 2018 +0300 tpm: migrate tpm2_get_tpm_pt() to use struct tpm_buf In order to make struct tpm_buf the first class object for constructing TPM commands, migrate tpm2_get_tpm_pt() to use it. Signed-off-by: Jarkko Sakkinen Reviewed-by: Nayna Jain Tested-by: Nayna Jain Reviewed-by: Jerry Snitselaar commit 94e266ba1fa344631dca424b7c83370c8c22983d Author: Jarkko Sakkinen Date: Mon Mar 26 15:14:04 2018 +0300 tpm: migrate tpm2_probe() to use struct tpm_buf In order to make struct tpm_buf the first class object for constructing TPM commands, migrate tpm2_probe() to use it. Signed-off-by: Jarkko Sakkinen Acked-by: Jay Freyensee Reviewed-by: Nayna Jain Tested-by: Nayna Jain Reviewed-by: Jerry Snitselaar commit cc26c6ef58c781473090ce45e17e4b5ff7bd8b2a Author: Jarkko Sakkinen Date: Tue Jun 5 22:22:58 2018 +0300 tpm: migrate tpm2_shutdown() to use struct tpm_buf In order to make struct tpm_buf the first class object for constructing TPM commands, migrated tpm2_shutdown() to use it. Signed-off-by: Jarkko Sakkinen Reviewed-by: Nayna Jain Tested-by: Nayna Jain Reviewed-by: Jerry Snitselaar commit a465c94eb355007d211750bd39ac02b40c2c3ecf Merge: 668aee263b82 ba0ab35a81de Author: Greg Kroah-Hartman Date: Sat Jul 28 14:55:31 2018 +0200 Merge tag 'usb-ci-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-next Peter writes: One patch to enable USB Ethernet gadget at Tegra platforms commit ec9cf1b7a6af2c0cffaa887351e7c7acced5290e Author: Alvin Šipraga Date: Sun Jul 15 23:31:53 2018 +0200 rtc: pcf85063: preserve control register value between stop and start Fix a bug that caused the Control_1 register to get zeroed whenever the RTC time is set. The problem occurred between stopping and starting the RTC clock, wherein the return value of a successful I2C write function would get written to the register. Also update variables of the start and stop functions to be more consistent with the rest of the driver. Signed-off-by: Alvin Šipraga Signed-off-by: Alexandre Belloni commit 668aee263b825b9551e7240c44c9894c889bf504 Merge: 60207c8ef2a3 ec14b83a1ee4 Author: Greg Kroah-Hartman Date: Sat Jul 28 14:42:18 2018 +0200 Merge tag 'phy-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next Kishon writes: phy: for 4.19 *) Add new PHY driver for GEN3 PCIe PHY on Renesas R-Car *) Add new PHY driver for PCIe PHY on Broadcom's Stingray SoC *) Enable battery charging in Mediatek T-PHY *) Switch to SPDX identifier in Marvell PHY drivers *) Fix compilation warning in phy-qcom-usb-hs.c Signed-off-by: Kishon Vijay Abraham I commit cebc4585f6ac01c3ea8fa8a8dd22848747f24d05 Author: Nicholas Mc Guire Date: Mon Jul 23 11:18:38 2018 +0200 iio: ad_sigma_delta: use unsigned long for timeout wait_for_completion_timeout returns unsigned long not int so an appropriate variable is declared and the assignment and check fixed up. Signed-off-by: Nicholas Mc Guire Reviewed-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 1b3bd8592780c87c5eddabbe98666b086bbaee36 Author: Himanshu Jha Date: Thu Jul 26 17:05:10 2018 +0530 iio: chemical: Add support for Bosch BME680 sensor Bosch BME680 is a 4-in-1 sensor with temperature, pressure, humidity and gas sensing capability. It supports both I2C and SPI communication protocol for effective data communication. The device supports two modes: 1. Sleep mode 2. Forced mode The measurements only takes place when forced mode is triggered and a single TPHG cycle is performed by the sensor. The sensor automatically goes to sleep after afterwards. The device has various calibration constants/parameters programmed into devices' non-volatile memory(NVM) during production and can't be altered by the user. These constants are used in the compensation functions to get the required compensated readings along with the raw data. The compensation functions/algorithms are provided by Bosch Sensortec GmbH via their API[1]. As these don't change during the measurement cycle, therefore we read and store them at the probe. The default configs supplied by Bosch are also set at probe. 0-day tested with build success. GSoC-2018: https://summerofcode.withgoogle.com/projects/#6691473790074880 Mentor: Daniel Baluta [1] https://github.com/BoschSensortec/BME680_driver Datasheet: https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME680-DS001-00.pdf Note from Jonathan: The compensation functions are 'interesting' and could do with a tidy up in future. However, they work so we can leave that for another day. Cc: Daniel Baluta Signed-off-by: Himanshu Jha Signed-off-by: Jonathan Cameron commit 6431975789fc3c480cb6344256f72d85889df3b2 Author: Michael Hennerich Date: Fri Jul 27 09:41:09 2018 +0300 iio: ad9523: support for external signals via gpios The AD9523 supports external signals for power-down mode, resetting the device and sync timing. This change add support for specifying values for these signals via the gpios and initializing them default values. For the reset signal, the GPIO is toggled during probing to re-initialize the device to a known state. Signed-off-by: Michael Hennerich Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit 9a5094ca29ea9b1da301b31fd377c0c0c4c23034 Author: Lars-Peter Clausen Date: Fri Jul 27 09:42:45 2018 +0300 iio: ad9523: Fix return value for ad952x_store() A sysfs write callback function needs to either return the number of consumed characters or an error. The ad952x_store() function currently returns 0 if the input value was "0", this will signal that no characters have been consumed and the function will be called repeatedly in a loop indefinitely. Fix this by returning number of supplied characters to indicate that the whole input string has been consumed. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Fixes: cd1678f96329 ("iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator") Cc: Signed-off-by: Jonathan Cameron commit 6d4abf1c0e265d8e99c155b91c1cf44e37793e53 Author: Wei Yongjun Date: Fri Jul 27 07:15:15 2018 +0000 staging: axis-fifo: fix return value check in axis_fifo_probe() In case of error, the function device_create() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 4a965c5f89de ("staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core") Signed-off-by: Wei Yongjun Signed-off-by: Greg Kroah-Hartman commit 758c579ec631ce5efd8de3d3d35483416ae2cad1 Author: Todd Poynor Date: Fri Jul 27 22:21:59 2018 -0700 staging: gasket: page table: remove code for "no dma_ops" Remove code with TODOs on it for working around apparent problems previously seen in a qemu environment where dma_ops was not set correctly. There is no user of this in the current code. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 14d70229777f17fe3c22deb559821038663bae78 Author: Todd Poynor Date: Fri Jul 27 22:21:58 2018 -0700 staging: gasket: sysfs: remove unnecessary NULL check on device ptr The device pointer passed into get_mapping() will never be NULL; the check is unnecessary. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit f390d08d8b872a0f71db45bc970a238475679fac Author: Todd Poynor Date: Fri Jul 27 22:21:57 2018 -0700 staging: gasket: apex: fixup undefined PCI class Apex chips with class 0 (PCI_CLASS_NOT_DEFINED) fixed up to PCI_CLASS_SYSTEM_OTHER to enable PCI resource assignments. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e7cffa03b34265e17de55d5ef8983c91482643a0 Author: Todd Poynor Date: Fri Jul 27 22:21:56 2018 -0700 staging: gasket: sysfs: remove check for refcount already zero Remove the check for refcount already zero, which shouldn't be necessary. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 81edee7ac83c5782859db4053a866fc0c29f982f Author: Gao Xiang Date: Sat Jul 28 15:10:32 2018 +0800 staging: erofs: fix a compile warning of Z_EROFS_VLE_VMAP_ONSTACK_PAGES There is a type mismatch in the definition of Z_EROFS_VLE_VMAP_ONSTACK_PAGES, let's fix it. Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050707.html Reported-by: kbuild test robot Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 28ec2238f37e72a3a40a7eb46893e7651bcc40a6 Author: Nicholas Mc Guire Date: Wed Jul 11 20:32:45 2018 +0200 MIPS: generic: fix missing of_node_put() of_find_compatible_node() returns a device_node pointer with refcount incremented and must be decremented explicitly. As this code is using the result only to check presence of the interrupt controller (!NULL) but not actually using the result otherwise the refcount can be decremented here immediately again. Signed-off-by: Nicholas Mc Guire Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19820/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit b1259519e618d479ede8a0db5474b3aff99f5056 Author: Nicholas Mc Guire Date: Sat Jun 16 09:06:33 2018 +0200 MIPS: Octeon: add missing of_node_put() The call to of_find_node_by_name returns a node pointer with refcount incremented thus it must be explicitly decremented here after the last usage. Signed-off-by: Nicholas Mc Guire Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19558/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit 351fdddd366245c0fb4636f32edfb4198c8d6b8c Author: Paul Burton Date: Tue Dec 12 09:57:47 2017 +0000 MIPS: VDSO: Prevent use of smp_processor_id() VDSO code should not be using smp_processor_id(), since it is executed in user mode. Introduce a VDSO-specific path which will cause a compile-time or link-time error (depending upon support for __compiletime_error) if the VDSO ever incorrectly attempts to use smp_processor_id(). [Matt Redfearn : Move before change to smp_processor_id in series] Signed-off-by: Paul Burton Signed-off-by: Matt Redfearn Patchwork: https://patchwork.linux-mips.org/patch/17932/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org commit 24babe69d7ff8d3845fac49b741b7257fb03f906 Author: Alban Bedel Date: Tue Feb 14 00:10:37 2017 +0100 MIPS: ath79: Use the IRQ based GPIO key driver for the buttons Now that the GPIO driver support interrupts we don't need to poll the buttons. Signed-off-by: Alban Bedel Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/15283/ Cc: linux-mips@linux-mips.org Cc: Rob Herring Cc: Mark Rutland Cc: Ralf Baechle Cc: Antony Pavlov Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org commit 79a85b55e39e65d6f20c753c4ae8bcd6f4cd7007 Author: Ben Hutchings Date: Thu Jul 26 11:22:54 2018 +0100 builddeb: Add automatic support for sh{3,4}{,eb} architectures Different generations of the SH architecture are not very compatible, so there are/were separate Debian ports for SH3 and SH4. Move the fallback out of the "case" statement, so that it will also be used in case we find some SH architecture version without a known mapping. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 75ebcee7699739c0f6c63abcb9f5754538107c62 Author: Ben Hutchings Date: Thu Jul 26 11:22:47 2018 +0100 builddeb: Add automatic support for riscv* architectures Debian currently only defines "riscv64", but it seems safe to assume that any 32-bit port will now be called "riscv32", also matching $UTS_MACHINE. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 60ca40a0649b462c7b398c6c603433faa0f56e26 Author: Ben Hutchings Date: Thu Jul 26 11:22:42 2018 +0100 builddeb: Add automatic support for m68k architecture Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 822f44fb5bf456f7032c2b428158d51b5fda1e99 Author: Ben Hutchings Date: Thu Jul 26 11:22:34 2018 +0100 builddeb: Add automatic support for or1k architecture Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit a27ae285d5efb6d41f70f504dddadaca560de476 Author: Ben Hutchings Date: Thu Jul 26 11:22:27 2018 +0100 builddeb: Add automatic support for sparc64 architecture We currently label 64-bit kernel packages as sparc (32-bit), mostly because it was officially supported while sparc64 was not. Now neither is officially supported, so label these packages as sparc64. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 679caaf3f79f0adad3b6b6b02539b868a963f46d Author: Ben Hutchings Date: Thu Jul 26 11:22:20 2018 +0100 builddeb: Add automatic support for mips{,64}r6{,el} architectures MIPS R6 is not fully backward-compatible, so Debian has separate architecture names for userland built for R6. Label kernel packages accordingly. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 159b37942286b32aa1c08620b3a1ed2dace7d047 Author: Ben Hutchings Date: Thu Jul 26 11:21:16 2018 +0100 builddeb: Add automatic support for mips64el architecture We currently label 64-bit little-endian kernel packages as mipsel (32-bit little-endian), mostly it was officially supported while mips64el (64-bit little-endian) was not. Now both are officially supported, so label these packages as mips64el. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 50d511ba6246c46654857b8ef64aefe76a87e455 Author: Ben Hutchings Date: Thu Jul 26 11:21:09 2018 +0100 builddeb: Add automatic support for ppc64 and powerpcspe architectures We currently label 64-bit big-endian kernel packages as powerpc (32-bit), mostly because it was officially supported while ppc64 (64-bit big-endian) was not. Now neither is officially supported, so label these packages as ppc64. Debian also has a powerpcspe (32-bit with SPE) architecture. Label packages with a suitable configuration as powerpcspe. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 08d3892cdcea7e918106bd78be5471d05b000b30 Author: Ben Hutchings Date: Thu Jul 26 11:21:01 2018 +0100 builddeb: Introduce functions to simplify kconfig tests in set_debarch We now have many repetitive greps over the kernel config. Refactor them into functions. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 4260ecd0ad8c10cef8ff6551267bb351e10f70c9 Author: Ben Hutchings Date: Thu Jul 26 11:20:54 2018 +0100 builddeb: Drop check for 32-bit s390 s390 now only supports 64-bit configurations. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 091d30aefc8a4d76ffa139a6e51dc237ea1cd599 Author: Ben Hutchings Date: Thu Jul 26 11:20:45 2018 +0100 builddeb: Change architecture detection fallback to use dpkg-architecture We currently use dpkg --print-architecture, which reports the architecture of the build machine. We can make a better guess than this by asking dpkg-architecture what the host architecture, i.e. the default architecture for building packages, is. This is sensitive to environment variables such as CC and DEB_HOST_ARCH, which should already be set in a cross-build environment. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit f2abcc13e4a1b3139f1e3a0ca71bf4db8b7dfe72 Author: Ben Hutchings Date: Thu Jul 26 11:20:28 2018 +0100 builddeb: Skip architecture detection when KBUILD_DEBARCH is set If KBUILD_DEBARCH is set then we will not use the result of architecture detection, and we may also warn unnecessarily. Move the check for KBUILD_DEBARCH further up to avoid this. Signed-off-by: Ben Hutchings Signed-off-by: Masahiro Yamada commit 43fee2b238959a7b46e2e8c0cd3305c7c044ded8 Author: Masahiro Yamada Date: Wed Jul 25 14:16:11 2018 +0900 kbuild: do not redirect the first prerequisite for filechk Currently, filechk unconditionally opens the first prerequisite and redirects it as the stdin of a filechk_* rule. Hence, every target using $(call filechk,...) must list something as the first prerequisite even if it is unneeded. '< $<' is actually unneeded in most cases. Each rule can explicitly adds it if necessary. Signed-off-by: Masahiro Yamada commit 6b0709f5a50a98df5919ade32fd131dde10bdcb0 Author: Masahiro Yamada Date: Wed Jul 25 14:16:10 2018 +0900 ARM: at91: remove unused duplicated filechk_offsets The filechk_offsets in arch/arm/mach-at91/Makefile is never used because it is always overridden by the equivalent one in scripts/Makefile.lib Signed-off-by: Masahiro Yamada Acked-by: Alexandre Belloni commit 542cdf4068049458e1411b120bd5a4bbe3ddc49a Author: Simon Horman Date: Tue Jul 24 13:14:13 2018 +0200 thermal: rcar_thermal: avoid NULL dereference in absence of IRQ resources Ensure that the base address used by a call to rcar_thermal_common_write() may be NULL if the SOC supports interrupts for use with the thermal device but none are defined in DT as is the case for R-Car H1 (r8a7779). Guard against this condition to prevent a NULL dereference when the device is probed. Tested on: * R-Mobile APE6 (r8a73a4) / APE6EVM * R-Car H1 (r8a7779) / Marzen * R-Car H2 (r8a7790) / Lager * R-Car M2-W (r8a7791) / Koelsch * R-Car M2-N (r8a7793) / Gose * R-Car D3 ES1.0 (r8a77995) / Draak Fixes: 1969d9dc2079 ("thermal: rcar_thermal: add r8a77995 support") Signed-off-by: Simon Horman Reviewed-by: Geert Uytterhoeven Signed-off-by: Eduardo Valentin commit c0c04707033c71d0490a412b0a941d87011949a3 Author: Krzysztof Kozlowski Date: Tue Jul 17 17:46:17 2018 +0200 thermal: samsung: Remove Exynos5440 clock handling left-overs Commit 8014220d48e7 ("thermal: samsung: Remove support for Exynos5440") removed the Exynos5440 specific part of code for accessing TMU interrupt registers but the surrounding clock handling was left. Clean it up. Signed-off-by: Krzysztof Kozlowski Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Eduardo Valentin commit a3e673660bc3fca3e9e0cbab871b2fb100e9ed64 Author: Saeed Mahameed Date: Sat May 19 05:34:48 2018 -0700 net/mlx5e: Issue direct lookup on vxlan ports by vport representors Remove uplink representor netdevice private structure lookup, and use mlx5 core handle directly from representor private structure to lookup vxlan ports. Signed-off-by: Saeed Mahameed Reviewed-by: Or Gerlitz commit 358aa5ce288aa1085f0f3ef9f315119563fa6541 Author: Saeed Mahameed Date: Wed May 9 13:28:00 2018 -0700 net/mlx5e: Vxlan, move vxlan logic to core driver Move vxlan logic and objects to mlx5 core dirver. Since it going to be used from different mlx5 interfaces. e.g. mlx5e PF NIC netdev and mlx5e E-Switch representors. Signed-off-by: Saeed Mahameed Reviewed-by: Or Gerlitz commit aec4eab9af9606e8a6a1ceab3ec5a15030751876 Author: Saeed Mahameed Date: Tue May 8 16:17:06 2018 -0700 net/mlx5e: Vxlan, add sync lock for add/del vxlan port Vxlan API can and will be called from different mlx5 modules, we should not count on mlx5e private state lock only, hence we introduce a vxlan private mutex to sync between add/del vxlan port operations. Signed-off-by: Saeed Mahameed Reviewed-by: Or Gerlitz commit 1b318a92f3ddaed6c91d5027dfd42549f87602f6 Author: Saeed Mahameed Date: Tue May 8 14:33:19 2018 -0700 net/mlx5e: Vxlan, return values for add/del port For a better API mlx5_vxlan_{add/del}_port can fail, make them return error values. Signed-off-by: Saeed Mahameed Reviewed-by: Or Gerlitz commit a3c785d73cf280a023684dc6c7bbeff25b8b8163 Author: Saeed Mahameed Date: Tue May 8 02:51:23 2018 -0700 net/mlx5e: Vxlan, rename from mlx5e to mlx5 Rename vxlan functions from mlx5e_vxlan_* to mlx5_vxlan_*. Rename mlx5e_vxlan_db to mlx5_vxlan and move it from en.h to vxlan.c since it is not related to mlx5e anymore. Allocate mlx5_vxlan structure dynamically in order to make it easier to move later to core driver and to make it private in vxlan.c. This is in preparation to move vxlan API to mlx5 core. Signed-off-by: Saeed Mahameed Reviewed-by: Or Gerlitz commit 5006eb221e6c1680067134f5de83d52bc5c2e1b6 Author: Saeed Mahameed Date: Tue May 8 02:23:49 2018 -0700 net/mlx5e: Vxlan, rename struct mlx5e_vxlan to mlx5_vxlan_port The name mlx5e_vxlan will be used in downstream patch to describe mlx5 vxlan structure that will replace mlx5e_vxlan_db. Hence we rename struct mlx5e_vxlan to mlx5_vxlan_port which describes a mlx5 vxlan port. Signed-off-by: Saeed Mahameed Reviewed-by: Or Gerlitz commit dccea6bf384c853f4a3ca60cb3d729dc41971602 Author: Saeed Mahameed Date: Tue May 8 01:49:43 2018 -0700 net/mlx5e: Vxlan, move netdev only logic to en_main.c Create a direct vxlan API to add and delete vxlan ports from HW. +void mlx5e_vxlan_add_port(struct mlx5e_priv *priv, u16 port); +void mlx5e_vxlan_del_port(struct mlx5e_priv *priv, u16 port); And move vxlan_add/del_work to en_main.c since they are netdev only logic. Signed-off-by: Saeed Mahameed Reviewed-by: Or Gerlitz commit 0f647bfcd05cb072f952badd7ea4b6b496b64892 Author: Saeed Mahameed Date: Mon May 7 18:06:26 2018 -0700 net/mlx5e: Vxlan, add direct delete function Add direct vxlan delete function to be called from vxlan_delete_work. Needed in downstream patch. Signed-off-by: Saeed Mahameed Reviewed-by: Or Gerlitz commit 278d7f3dc0a65bf0135e28164adaf86fb39ac308 Author: Gal Pressman Date: Tue Feb 13 10:31:26 2018 +0200 net/mlx5e: Vxlan, cleanup an unused member in vxlan work Cleanup the sa_family member of the vxlan work, it is unused/needed anywhere in the code. Signed-off-by: Gal Pressman Signed-off-by: Saeed Mahameed commit cc3d3458d46f702b1d118fca8647dc9157887d9b Author: Dave Jiang Date: Fri Jul 27 09:04:17 2018 -0700 acpi/nfit: queue issuing of ars when an uc error notification comes in When the ACPI UC error notifier gets called and ARS_REQ bit is set with the passed in flag, we can receive -EBUSY if ARS_REQ bit is already set for the nfit_spa->ars_state. When that happens, the ARS request is dropped. That can potentially cause us to miss the unreported errors that the on going ARS request does not receive. Add an ARS_REQ_REDO state that will request short ARS upon ARS completion to grab any errors we missed. Signed-off-by: Dave Jiang Reviewed-by: Vishal Verma commit 0b64fa0a0ee31501d546c775a88922f3cf51fef3 Author: Tim Schumacher Date: Fri Jul 27 15:21:47 2018 -0700 Input: iforce - reorganize joystick configuration lists * btn_avb_pegasus and btn_avb_tw are the same. Unify them into btn_joystick_avb. * btn_wheel is an exact copy of btn_joystick, so remove it. Rename btn_avb_wheel into btn_wheel since it is the only sane configuration for a wheel. * Assign the (new) btn_wheel configuration to the "AVB Top Shot Force Feedback Racing Wheel", because the previous configuration was meant for a joystick. Signed-off-by: Tim Schumacher Signed-off-by: Dmitry Torokhov commit a999933db9ed44f8501e0241f7f1fbdf36554396 Author: Christoph Hellwig Date: Fri Jul 27 19:26:06 2018 +0200 MIPS: remove mips_swiotlb_ops mips_swiotlb_ops differs from the generic swiotlb_dma_ops only in that it contains a mb() barrier after each operations that maps or syncs dma memory to the device. The dma operations are defined to not be memory barriers, but instead the write* operations to kick the DMA off are supposed to contain them. For mips this handled by war_io_reorder_wmb(), which evaluates to the stronger wmb() instead of the pure compiler barrier barrier() for just those platforms that use swiotlb, so I think we are covered properly. [paul.burton@mips.com: - Include linux/swiotlb.h to fix build failures for configs with CONFIG_SWIOTLB=y.] Signed-off-by: Christoph Hellwig Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20038/ Cc: David Daney Cc: Huacai Chen Cc: linux-mips@linux-mips.org Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org commit 432121adf5e880240237bd9b15ec0ab995d7ea1f Author: Amit Kucheria Date: Thu Jul 26 16:03:10 2018 +0530 thermal: tsens: Fix negative temperature reporting The current code will always return 0xffffffff in case of negative temperatures due to a bug in how the binary sign extension is being done. Use sign_extend32() instead. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Signed-off-by: Eduardo Valentin commit faa590baf8dfe5ad877e062f18de4419e4d174f7 Author: Amit Kucheria Date: Thu Jul 26 16:03:09 2018 +0530 thermal: tsens: switch from of_iomap() to devm_ioremap_resource() devm_ioremap_resources() automatically requests resources (so that the I/O region shows up in /proc/iomem) and devm_ wrappers do better error handling and unmapping of the I/O region when needed. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Signed-off-by: Eduardo Valentin commit e0fe01426c50f54d06b6ff69de2be536ec0a3256 Author: Amit Kucheria Date: Thu Jul 26 16:03:08 2018 +0530 thermal: tsens: Rename variable We're actually reading the temperature from the status register. Fix the variable name to reflect that. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Signed-off-by: Eduardo Valentin commit 191dc74bad60e1462094b2e25321479e7eb17cdc Author: Amit Kucheria Date: Wed Jul 18 12:13:12 2018 +0530 thermal: tsens: Add generic support for TSENS v2 IP SDM845 uses v2 of the TSENS IP block but the get_temp() function appears to be identical across v2.x.y in code seen so far. We use the generic get_temp() function defined as part of ops_generic_v2. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Eduardo Valentin commit 770324a4bf2ffbcab5692d473c3f3f0e36b5a289 Author: Amit Kucheria Date: Wed Jul 18 12:13:11 2018 +0530 thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse The TSENS block inside the 8996 is internally classified as version 2 of the IP. Several other SoC families use this block and can share this code. We rename get_temp() to reflect that it can be used across the v2 family. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Eduardo Valentin commit 5b1283984fa39933e094d237387ad8fd39527fc1 Author: Amit Kucheria Date: Wed Jul 18 12:13:09 2018 +0530 thermal: tsens: Add support to split up register address space into two There are two banks of registers for v2 TSENS IPs: SROT and TM. On older SoCs these were contiguous, leading to DTs mapping them as one register address space of size 0x2000. In newer SoCs, these two banks are not contiguous anymore. Add logic to init_common() to differentiate between old and new DTs and adjust associated offsets for the TM register bank so that the old DTs will continue to function correctly. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Eduardo Valentin commit 518eeca05c08347f0a69966b4459cc2d152af959 Author: kbuild test robot Date: Fri Jul 13 21:14:52 2018 +0800 tracing: preemptirq_delay_run() can be static Automatically found by kbuild test robot. Fixes: ffdc73a3b2ad ("lib: Add module for testing preemptoff/irqsoff latency tracers") Signed-off-by: kbuild test robot Signed-off-by: Steven Rostedt (VMware) commit 4ce6dcfd0d38169d9067c768fcce8e0d49f60fac Author: Amit Kucheria Date: Wed Jul 18 12:13:08 2018 +0530 dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP We want to create common code for v2 of the TSENS IP block that is used in a large number of Qualcomm SoCs. "qcom,tsens-v2" should be able to handle most of the common functionality start with a common get_temp() function. It is also necessary to split out the memory regions for the TM and SROT register banks because their offsets are not constant across SoC families. Signed-off-by: Amit Kucheria Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Eduardo Valentin commit 5834edde914b042faedb9179386335927315767b Author: Amit Kucheria Date: Wed Jul 18 12:13:07 2018 +0530 thermal: tsens: Get rid of unused fields in structure status_field and trdy are unused in any of the tsens drivers. Remove them. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Acked-by: Rajendra Nayak Tested-by: Matthias Kaehlcke Signed-off-by: Eduardo Valentin commit f6b6b52ef7a54160c0a4d2b56a58f84a2e5b33c5 Author: Marc Zyngier Date: Tue Jul 10 16:40:35 2018 +0100 thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info When registering the hwmon device, we pass NULL as the device. While this doesn't result in any immediate breakage, it leaves the hwmon device at the root of the virtual devices, rather than attached to the thermal zone hierarchy. Instead, let's pass the actual device, which is part of the thermal_zone_device structure. This also avoids the rather unpleasant ""NULL device *" which can be generated by dev_{err,info} in the hwmon subsystem. Signed-off-by: Marc Zyngier Tested-by: Enric Balletbo i Serra Signed-off-by: Eduardo Valentin commit 409ef0bacacf72c51cc876349ae3fdf7cf726d47 Author: Marc Zyngier Date: Tue Jul 10 16:40:34 2018 +0100 thermal_hwmon: Sanitize attribute name passed to hwmon My Chromebook Plus (kevin) is spitting the following at boot time: (NULL device *): hwmon: 'sbs-9-000b' is not a valid name attribute, please fix Clearly, __hwmon_device_register is unhappy about the property name. Some investigation reveals that thermal_add_hwmon_sysfs doesn't sanitize the name of the attribute. In order to keep it quiet, let's replace '-' with '_' in hwmon->type This is consistent with what iio-hwmon does since b92fe9e3379c8. Signed-off-by: Marc Zyngier Tested-by: Enric Balletbo i Serra Signed-off-by: Eduardo Valentin commit 59d7f4a7fa9821a4ce0ea5870c367f9d8adb2619 Author: Miquel Raynal Date: Mon Jul 16 16:42:02 2018 +0200 dt-bindings: thermal: armada: add reference to new bindings New bindings (using a syscon) are available for AP806 and CP110 compatibles. Add a reference to these files from the original documentation. Signed-off-by: Miquel Raynal Acked-by: Rob Herring Signed-off-by: Eduardo Valentin commit c3ab5dfff1e088e163aa2f866dd66e5a55af463f Author: Miquel Raynal Date: Mon Jul 16 16:42:01 2018 +0200 dt-bindings: cp110: add the thermal node in the syscon file Explain the thermal bindings now that the thermal IP is described being inside of a system controller. Add a reference to the thermal-zone node. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Eduardo Valentin commit e1ea68beaf539a1872debd749c62025cde0e2430 Author: Miquel Raynal Date: Mon Jul 16 16:42:00 2018 +0200 dt-bindings: cp110: update documentation since DT de-duplication CP110 master/slave DT files have been merged in a DT de-duplication work merged in v4.16. Update the syscon documentation accordingly to match the current state of the DT nodes. Signed-off-by: Miquel Raynal Acked-by: Rob Herring Signed-off-by: Eduardo Valentin commit afa544a2fb6827b5ea8547a69b28115439e14533 Author: Miquel Raynal Date: Mon Jul 16 16:41:59 2018 +0200 dt-bindings: ap806: add the thermal node in the syscon file Explain the thermal bindings now that the thermal IP is described being inside of a system controller. Add a reference to the thermal-zone node. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Eduardo Valentin commit ab0156c50d7986aacbc9b8bd9abc59bb29869d81 Author: Miquel Raynal Date: Mon Jul 16 16:41:58 2018 +0200 dt-bindings: cp110: prepare the syscon file to list other syscons nodes There are multiple system controllers in CP110. Because all syscon nodes use the same compatible, it is pertinent to use this same file to list IPs inside it. Thus, change the header to be more generic, and align with AP806 file. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Eduardo Valentin commit 2cefabe03f5ef6ff2c6c3faf949b05db63fda2a5 Author: Miquel Raynal Date: Mon Jul 16 16:41:57 2018 +0200 dt-bindings: ap806: prepare the syscon file to list other syscons nodes There are multiple system controllers in AP806. Because all syscon nodes use the same compatible, it is pertinent to use this same file to list IPs inside it. Thus, change the header to be more generic. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Eduardo Valentin commit 4aa5496980e4c099ede8815d0672809efd8e226a Author: Miquel Raynal Date: Mon Jul 16 16:41:56 2018 +0200 dt-bindings: cp110: rename cp110 syscon file There is no need to give numbers to system controllers inside the documentation as the syscons use the same compatibles. Furthermore, this approach does not scale very well and would force the creation of a new file each time a new syscon is added in the device tree. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Eduardo Valentin commit 8c0e64ac4075b7ca870098ed2ad6089868f5fa7b Author: Miquel Raynal Date: Mon Jul 16 16:41:55 2018 +0200 thermal: armada: get rid of the ->is_valid() pointer The implementation of armada_is_valid() is very simple and is the same across all the versions of the IP since the ->is_valid_bit has been introduced. Simplify the structure by getting rid of the function pointer and calling directly the function. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 68b14828ca102630e721d10b2e5dedc9c9b38095 Author: Miquel Raynal Date: Mon Jul 16 16:41:54 2018 +0200 thermal: armada: move validity check out of the read function Sensor selection when using multiple sensors already checks for the sensor validity. Move it to the legacy ->get_temp() hook, where it is still needed. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 00707e4c9618949d492f685c324326f39f08ea9c Author: Miquel Raynal Date: Mon Jul 16 16:41:53 2018 +0200 thermal: armada: remove sensors validity from the IP initialization When using new bindings with multiple sensors, sensor validity is checked twice because sensor selection also checks for the validity. Remove the redundant call from the IP initialization helper and move it to the legacy probe section where it is still needed. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit f7c2068a1728c1b2aed9416b071a3e2f8f887786 Author: Miquel Raynal Date: Mon Jul 16 16:41:52 2018 +0200 thermal: armada: add multi-channel sensors support MVEBU thermal IP supports multiple channels. Each channel may have several sensors but for now each channel is wired to only one thermal sensor. The first channel always points to the so called internal sensor, within the thermal IP. There is usually one more channel (with one sensor each time) per CPU. The code has been written to support possible evolutions of the ap806 IP that would embed more CPUs and thus more channels to select. Each channel should be referenced in the device tree as an independent thermal zone. Add the possibility to read each of these sensors through sysfs by registering all the sensors (translated in "thermal_zone"). Also add a mutex on these accesses to avoid read conflicts (only one channel/sensor may be selected and read at a time). Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit c9899c183921f919e10fe821be7de9fea876ba65 Author: Miquel Raynal Date: Mon Jul 16 16:41:51 2018 +0200 thermal: armada: use the resource managed registration helper alternative Current use of thermal_zone_device_register() triggers a warning at boot and should be replaced by devm_thermal_zone_of_sensor_register(). This allows better handling of multiple thermal zones for later multi-sensors support. Also change the driver data to embed a new structure to make the difference between legacy data (which needs to be cleaned) and syscon-related data. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 3d4e51844a4eb3c86e568bdcc9408602b46dc638 Author: Miquel Raynal Date: Mon Jul 16 16:41:50 2018 +0200 thermal: armada: convert driver to syscon register accesses Until recently, only one register was referenced in MVEBU thermal IP node. Recent changes added a second entry pointing to another register right next to it. We cannot know for sure that we will not have to access other registers. That will be actually the case when overheat interrupt feature will come, where it will be needed to access DFX registers in the same area. This approach is not scalable so instead of adding consinuously memory areas in the DT (and change the DT bindings, while keeping backward compatibility), move the thermal node into a wider syscon from which it will be possible to also configure the thermal interrupt. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit a9fae794e4c581bbe460106609ce88dec8b00973 Author: Miquel Raynal Date: Mon Jul 16 16:41:49 2018 +0200 thermal: armada: average over samples to avoid glitches Configure the sample frequency and number of averaged samples. This is needed for two reasons: 1/ To be bootloader independent. 2/ To prepare the introduction of multi-sensors support by preventing inconsistencies when reading temperatures that could be a mean of samples took from different sensors. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 5b5e17a182e14316ab4369fd9e8173207cf42130 Author: Miquel Raynal Date: Mon Jul 16 16:41:48 2018 +0200 thermal: armada: dissociate a380 and cp110 ->init() hooks Until now, Armada 380 and CP110 could share the same ->init() function because their use was identical. Prepare the support of multi-sensors support and overheat interrupt feature by separating the initialization paths before they actually diverge. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 8b4c2712cd7cbf9f83b8032550c7cbdfcdf970eb Author: Miquel Raynal Date: Mon Jul 16 16:41:47 2018 +0200 thermal: armada: rename the initialization routine Calling a hook ->init_sensor() while what is initialized is the IP itself and not the sensors is misleading. Rename the hook ->init() to avoid any confusion in later work bringing multi-sensors support. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit c5d7d57e6892e1613157c89c22b13441f9d2ddf5 Author: Miquel Raynal Date: Mon Jul 16 16:41:46 2018 +0200 thermal: armada: remove misleading comments On older versions of this thermal IP, TSEN referred as the internal sensor in the thermal IP while EXT_TSEN referred as sensors outside of this IP, ie in the CPUs most of the time. The bit names in the specifications do not follow this rule anymore, so remove these comments that are misleading. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 931d3c5db42c935c7fcf119e844176ca5dcae326 Author: Miquel Raynal Date: Mon Jul 16 16:41:45 2018 +0200 thermal: armada: remove useless register accesses Prepare the migration to use regmaps by first simplifying the initialization functions: avoid unnecessary write/read cycles on configuration registers. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 8d98761a6fc1eeee7232471c5285665fc7ecaa23 Author: Miquel Raynal Date: Mon Jul 16 16:41:44 2018 +0200 thermal: armada: add a function that sanitizes the thermal zone name Thermal zone names must follow certain rules imposed by the framework. They are limited in length and shall not have any hyphen '-'. This is done in a separate function for future use in another location. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 9bebf3485c6a365ef0b7e83443a707eda2abc78b Author: Bartlomiej Zolnierkiewicz Date: Wed May 2 15:20:35 2018 +0200 thermal: ti-soc-thermal: remove dead code Majority of this code (i.e. functions from ti-bandgap.c) has been introduced in May 2013 by commit eb982001dbd8 ("thermal: introduce TI SoC thermal driver"). Just remove it altogether (in case it is needed it can be easily resurrected from git repo). While at it fix incorrect "not used" comments. Tested-by: Keerthy Acked-by: Keerthy Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Eduardo Valentin commit d30d8cde19726f177be7615f2e12700d994f6d7f Author: Gal Pressman Date: Tue Dec 26 18:27:08 2017 +0200 net/mlx5e: Vxlan, replace ports radix-tree with hash table The VXLAN database is accessed in the data path for each VXLAN TX skb in order to check whether the UDP port is being offloaded or not. The number of elements in the database is relatively small, we can simplify the radix-tree to a hash table and speedup the lookup process. Measuring mlx5e_vxlan_lookup_port execution time: Radix Tree Hash Table --------------- ------------ ------------ Single Stream 161 ns 79 ns (51% improvement) Multi Stream 259 ns 136 ns (47% improvement) Measuring UDP stream packet rate, single fully utilized TX core: Radix Tree: 498,300 PPS Hash Table: 555,468 PPS (11% improvement) Signed-off-by: Gal Pressman Signed-off-by: Saeed Mahameed commit 22a65aa8b1a84ca429c0fc8415dee5681ab36eb3 Author: Gal Pressman Date: Mon Dec 25 18:40:52 2017 +0200 net/mlx5e: Vxlan, check maximum number of UDP ports The NIC has a limited number of offloaded VXLAN UDP ports (usually 4). Instead of letting the firmware fail when trying to add more ports than it can handle, let the driver check it on its own. Signed-off-by: Gal Pressman Signed-off-by: Saeed Mahameed commit a082c4f4f022ac5c05c7f26f2dab2982d11d6adb Author: Gal Pressman Date: Wed Jan 17 11:02:31 2018 +0200 net/mlx5e: Vxlan, reflect 4789 UDP port default addition to software database The hardware offloads 4789 UDP port (default VXLAN port) automatically. Add it to the software database as well in order to reflect the hardware state appropriately. Signed-off-by: Gal Pressman Signed-off-by: Saeed Mahameed commit a0732548ba03c27fb42da4cf8e1eecc205760f12 Author: Jia-Ju Bai Date: Fri Jul 27 17:31:35 2018 +0800 net: tipc: bcast: Replace GFP_ATOMIC with GFP_KERNEL in tipc_bcast_init() tipc_bcast_init() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 04b9ce48ef19e09d8c65eb506b7982e99db212d7 Author: Jia-Ju Bai Date: Fri Jul 27 17:28:25 2018 +0800 net: tipc: name_table: Replace GFP_ATOMIC with GFP_KERNEL in tipc_nametbl_init() tipc_nametbl_init() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit ba23dc642dffd1a97dc08480acc788fdb8632425 Author: Jia-Ju Bai Date: Fri Jul 27 16:41:04 2018 +0800 net: usb: sr9700: Replace mdelay() with msleep() in sr9700_bind() sr9700_bind() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 6dff5add089f2cedd597937a3e39a01ebba8b7c8 Author: Jia-Ju Bai Date: Fri Jul 27 16:36:29 2018 +0800 net: usb: pegasus: Replace mdelay() with msleep() in setup_pegasus_II() setup_pegasus_II() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 0df125d05d19ea71678842289647f35cec6d3314 Author: Jia-Ju Bai Date: Fri Jul 27 16:34:25 2018 +0800 net: phy: marvell: Replace mdelay() with msleep() in m88e1116r_config_init() m88e1116r_config_init() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6ae5cbc418459c119d211cc3102602b2ec8bc11f Author: Jia-Ju Bai Date: Fri Jul 27 16:29:31 2018 +0800 net: nvidia: forcedeth: Replace GFP_ATOMIC with GFP_KERNEL in nv_probe() nv_probe() is never called in atomic context. It calls dma_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit d818c59a8f490ed8d07bdb4cc175dec97030df26 Author: Jia-Ju Bai Date: Fri Jul 27 16:25:07 2018 +0800 net: jme: Replace mdelay() with msleep() and usleep_range() in jme_wait_link() jme_wait_link() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 89036f233a45d8d17c2de94850bd5e63f185da3d Author: Jia-Ju Bai Date: Fri Jul 27 16:01:41 2018 +0800 net: hisilicon: hns: Replace mdelay() with msleep() hns_ppe_common_init_hw() and hns_xgmac_init() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 2bcd619e6e7b992ddaa1caaeafd3eea6990de75c Author: Jia-Ju Bai Date: Fri Jul 27 15:57:58 2018 +0800 net: amd: pcnet32: Replace GFP_ATOMIC with GFP_KERNEL in pcnet32_alloc_ring() pcnet32_alloc_ring() is never called in atomic context. It calls kcalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 39a212ad15f34cebf6d785114c0776a318024ba3 Author: Bjorn Helgaas Date: Tue Jun 26 17:45:34 2018 -0500 PCI: Document ACPI description of PCI host bridges Add a writeup about how PCI host bridges should be described in ACPI using PNP0A03/PNP0A08 devices, PNP0C02 devices, and the MCFG table. Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Rafael J. Wysocki commit 2db6dc2662bab14e59517ab4b86a164cc4d2db42 Author: Dave Taht Date: Thu Jul 26 19:45:10 2018 -0700 sch_cake: Make gso-splitting configurable from userspace This patch restores cake's deployed behavior at line rate to always split gso, and makes gso splitting configurable from userspace. running cake unlimited (unshaped) at 1gigE, local traffic: no-split-gso bql limit: 131966 split-gso bql limit: ~42392-45420 On this 4 stream test splitting gso apart results in halving the observed interpacket latency at no loss in throughput. Summary of tcp_nup test run 'gso-split' (at 2018-07-26 16:03:51.824728): Ping (ms) ICMP : 0.83 0.81 ms 341 TCP upload avg : 235.43 235.39 Mbits/s 301 TCP upload sum : 941.71 941.56 Mbits/s 301 TCP upload::1 : 235.45 235.43 Mbits/s 271 TCP upload::2 : 235.45 235.41 Mbits/s 289 TCP upload::3 : 235.40 235.40 Mbits/s 288 TCP upload::4 : 235.41 235.40 Mbits/s 291 verses Summary of tcp_nup test run 'no-split-gso' (at 2018-07-26 16:37:23.563960): avg median # data pts Ping (ms) ICMP : 1.67 1.73 ms 348 TCP upload avg : 234.56 235.37 Mbits/s 301 TCP upload sum : 938.24 941.49 Mbits/s 301 TCP upload::1 : 234.55 235.38 Mbits/s 285 TCP upload::2 : 234.57 235.37 Mbits/s 286 TCP upload::3 : 234.58 235.37 Mbits/s 274 TCP upload::4 : 234.54 235.42 Mbits/s 288 Signed-off-by: David S. Miller commit 27defe9d8f6a548e26cd8d9029e5d002163ba854 Author: Rahul Lakkireddy Date: Fri Jul 27 14:29:22 2018 +0530 cxgb4: print ULD queue information managed by LLD Signed-off-by: Rahul Lakkireddy Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 1d4b016f02f63885e79ad47ebc812fff0fff7908 Merge: 3e4e36436047 92ea4a7eec72 Author: David S. Miller Date: Fri Jul 27 13:34:54 2018 -0700 Merge branch 'l2tp-remove-unused-session-fields' Guillaume Nault says: ==================== l2tp: remove unused session fields Several fields of the session structures can be set, but remain unused otherwise. This series removes these fields and explicitely ignores the associated ioctls and netlink attributes. ==================== Signed-off-by: David S. Miller commit 92ea4a7eec7289468ac8de5386f4b13d9c210cb5 Author: Guillaume Nault Date: Fri Jul 27 11:00:00 2018 +0200 l2tp: drop ->mru from struct l2tp_session This field is not used. Treat PPPIOC*MRU the same way as PPPIOC*FLAGS: "get" requests return 0, while "set" requests vadidate the user supplied pointer but discard its value. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 1998b5ed9c9bba5369e7c3659fc8a2e468e62bea Author: Guillaume Nault Date: Fri Jul 27 10:59:59 2018 +0200 l2tp: drop ->flags from struct pppol2tp_session This field is not used. Keep validating user input in PPPIOCSFLAGS. Even though we discard the value, it would look wrong to succeed if an invalid address was passed from userspace. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit ae51a7c6d54876c47ae53c455434023df2c19801 Author: Guillaume Nault Date: Fri Jul 27 10:59:58 2018 +0200 l2tp: ignore L2TP_ATTR_VLAN_ID netlink attribute The value of this attribute is never used. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 3ae5536b808dced0af5b2e6768a41862620c779d Author: Guillaume Nault Date: Fri Jul 27 10:59:57 2018 +0200 l2tp: ignore L2TP_ATTR_DATA_SEQ netlink attribute The value of this attribute is never used. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 3e4e36436047155f67eafffe3062a09db1dff8df Author: Anders Roxell Date: Fri Jul 27 15:18:49 2018 +0200 net/rds/Kconfig: Correct the RDS depends Remove prefix 'CONFIG_' from CONFIG_IPV6 Fixes: ba7d7e2677c0 ("net/rds/Kconfig: RDS should depend on IPV6") Reported-by: Eric Dumazet Signed-off-by: Anders Roxell Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 2e279c930990930953baefb0665ac7dbd16b9aa7 Merge: 1f3ed383fb9a d159261f3662 Author: David S. Miller Date: Fri Jul 27 13:17:50 2018 -0700 Merge branch 'mlxsw-Support-DSCP-prioritization-and-rewrite' Ido Schimmel says: ==================== mlxsw: Support DSCP prioritization and rewrite Petr says: On ingress, a network device such as a switch assigns to packets priority based on various criteria. Common options include interpreting PCP and DSCP fields according to user configuration. When a packet egresses the switch, a reverse process may rewrite PCP and/or DSCP headers according to packet priority. So far, mlxsw has supported prioritization based on PCP (802.1p priority tag). This patch set introduces support for prioritization based on DSCP, and DSCP rewrite. To configure the DSCP-to-priority maps, the user is expected to invoke ieee_setapp and ieee_delapp DCBNL ops, e.g. by using lldptool: To decide whether or not to pay attention to DSCP values, the Spectrum switch recognize a per-port configuration of trust level. Until the first APP rule is added for a given port, this port's trust level stays at PCP, meaning that PCP is used for packet prioritization. With the first DSCP APP rule, the port is configured to trust DSCP instead, and it stays there until all DSCP APP rules are removed again. Besides the DSCP (value 5) selector, another selector that plays into packet prioritization is Ethernet type (value 1) with PID of 0. Such APP entries denote default priority[1]: With this patch set, mlxsw uses these values to configure priority for DSCP values not explicitly specified in DSCP APP map. In the future we expect to also use this to configure default port priority for untagged packets. Access to DSCP-to-priority map, priority-to-DSCP map, and default priority for a port is exposed through three new DCB helpers. Like the already-existing dcb_ieee_getapp_mask() helper, these helpers operate in terms of bitmaps, to support the arbitrary M:N mapping that the APP rules allow. Such interface presents all the relevant information from the APP database without necessitating exposition of iterators, locking or other complex primitives. It is up to the driver to then digest the mapping in a way that the device supports. In this patch set, mlxsw resolves conflicts by favoring higher-numbered DSCP values and priorities. In this patchset: - Patch #1 fixes a bug in DCB APP database management. - Patch #2 adds the getters described above. - Patches #3-#6 add Spectrum configuration registers. - Patch #7 adds the mlxsw logic that configures the device according to APP rules. - Patch #8 adds a self-test. The test is added to the subdirectory drivers/net/mlxsw. Even though it's not particularly specific to mlxsw, it's not suitable for running on soft devices (which don't support the ieee_getapp et.al.), and thus isn't a good fit for the general net/forwarding directory. [1] 802.1Q-2014, Table D-9 ==================== Signed-off-by: David S. Miller commit d159261f3662a89a5cd4fae041107ee511d9552e Author: Petr Machata Date: Fri Jul 27 15:27:02 2018 +0300 selftests: mlxsw: Add test for trust-DSCP Add a test that exercises the new code. Send DSCP-tagged packets, and observe how they are prioritized in the switch and the DSCP is updated on egress again. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b2b1dab6884e39c9cea2650b0c399e1990cd855a Author: Petr Machata Date: Fri Jul 27 15:27:01 2018 +0300 mlxsw: spectrum: Support ieee_setapp, ieee_delapp The APP TLVs are used for communicating priority-to-protocol ID maps for a given netdevice. Support the following APP TLVs: - DSCP (selector 5) to configure priority-to-DSCP code point maps. Use these maps to configure packet priority on ingress, and DSCP code point rewrite on egress. - Default priority (selector 1, PID 0) to configure priority for the DSCP code points that don't have one assigned by the DSCP selector. In future this could also be used for assigning default port priority when a packet arrives without DSCP tagging. Besides setting up the maps themselves, also configure port trust level and rewrite bits. Port trust level determines whether, for a packet arriving through a certain port, the priority should be determined based on PCP or DSCP header fields. So far, mlxsw kept the device default of trust-PCP. Now, as soon as the first DSCP APP TLV is configured, switch to trust-DSCP. Only when all DSCP APP TLVs are removed, switch back to trust-PCP again. Note that the default priority APP TLV doesn't impact the trust level configuration. Rewrite bits determine whether DSCP and PCP fields of egressing packets should be updated according to switch priority. When port trust is switched to DSCP, enable rewrite of DSCP field. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 55fb71f481aac930ba87dc0f99a3060ced0326d3 Author: Petr Machata Date: Fri Jul 27 15:27:00 2018 +0300 mlxsw: reg: Add QoS Priority to DSCP Mapping Register This register controls mapping from Priority to DSCP for purposes of rewrite. Note that rewrite happens as the packet is transmitted provided that the DSCP rewrite bit is enabled for the packet. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e67131d9b861eb753b077961e291fc21a59daa28 Author: Petr Machata Date: Fri Jul 27 15:26:59 2018 +0300 mlxsw: reg: Add QoS ReWrite Enable Register This register configures the rewrite enable (whether PCP or DSCP value in packet should be updated according to packet priority) per receive port. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 746da42a1f60728fc0f3ba7818ffe8d1aa69cacd Author: Petr Machata Date: Fri Jul 27 15:26:58 2018 +0300 mlxsw: reg: Add QoS Priority Trust State Register The QPTS register controls the port policy to calculate the switch priority and packet color based on incoming packet fields. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 02837d726721cbc87629741e6b2570580ce47fae Author: Petr Machata Date: Fri Jul 27 15:26:57 2018 +0300 mlxsw: reg: Add QoS Port DSCP to Priority Mapping Register The QPDPM register controls the mapping from DSCP field to Switch Priority for IP packets. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b67c540b8a987e365dc548e5b2ddf023946e3d63 Author: Petr Machata Date: Fri Jul 27 15:26:56 2018 +0300 net: dcb: Add priority-to-DSCP map getters On ingress, a network device such as a switch assigns to packets priority based on various criteria. Common options include interpreting PCP and DSCP fields according to user configuration. When a packet egresses the switch, a reverse process may rewrite PCP and/or DSCP values according to packet priority. The following three functions support a) obtaining a DSCP-to-priority map or vice versa, and b) finding default-priority entries in APP database. The DCB subsystem supports for APP entries a very generous M:N mapping between priorities and protocol identifiers. Understandably, several (say) DSCP values can map to the same priority. But this asymmetry holds the other way around as well--one priority can map to several DSCP values. For this reason, the following functions operate in terms of bitmaps, with ones in positions that match some APP entry. - dcb_ieee_getapp_dscp_prio_mask_map() to compute for a given netdevice a map of DSCP-to-priority-mask, which gives for each DSCP value a bitmap of priorities related to that DSCP value by APP, along the lines of dcb_ieee_getapp_mask(). - dcb_ieee_getapp_prio_dscp_mask_map() similarly to compute for a given netdevice a map from priorities to a bitmap of DSCPs. - dcb_ieee_getapp_default_prio_mask() which finds all default-priority rules for a given port in APP database, and returns a mask of priorities allowed by these default-priority rules. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 08193d1a893c802c4b807e4d522865061f4e9f4f Author: Petr Machata Date: Fri Jul 27 15:26:55 2018 +0300 net: dcb: For wild-card lookups, use priority -1, not 0 The function dcb_app_lookup walks the list of specified DCB APP entries, looking for one that matches a given criteria: ifindex, selector, protocol ID and optionally also priority. The "don't care" value for priority is set to 0, because that priority has not been allowed under CEE regime, which predates the IEEE standardization. Under IEEE, 0 is a valid priority number. But because dcb_app_lookup considers zero a wild card, attempts to add an APP entry with priority 0 fail when other entries exist for a given ifindex / selector / PID triplet. Fix by changing the wild-card value to -1. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 2e603d0429a4e7cba93a4bc4fcdbdf830adaa472 Author: Huang Rui Date: Thu Jul 26 14:08:03 2018 +0800 drm/amdgpu: clean up the superfluous space and align the comment text for amdgpu_ttm This patch cleans up spaces and align the text to refine the comment for amdgpu_ttm. Signed-off-by: Huang Rui Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 204029e1979959ea6150c2a5c3e961800f52d0d4 Author: Junwei Zhang Date: Thu Jul 26 18:00:13 2018 +0800 drm/amdgpu: correct evict flag for bo move pass the evict flag instead of hard code Signed-off-by: Junwei Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 610b399f1ff269e4b9ec85cfdffb06f9befd0c41 Author: Bas Nieuwenhuizen Date: Wed Jul 25 22:29:50 2018 +0200 drm/ttm: Merge hugepage attr changes in ttm_dma_page_put. (v2) Every set_pages_array_wb call resulted in cross-core interrupts and TLB flushes. Merge more of them for less overhead. This reduces the time needed to free a 1.6 GiB GTT WC buffer as part of Vulkan CTS from ~2 sec to < 0.25 sec. (Allocation still takes more than 2 sec though) (v2): use set_pages_wb instead of set_memory_wb. Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Huang Rui Reviewed-by: Christian König Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit d55f9b87428f4732472ec7e9ccb7b4135751996c Author: Huang Rui Date: Thu Jul 26 16:49:36 2018 +0800 drm/ttm: clean up non-x86 definitions on ttm_page_alloc All non-x86 definitions are moved to ttm_set_memory header, so remove it from ttm_page_alloc.c. Suggested-by: Christian König Signed-off-by: Huang Rui Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c7bb1e57e20a7f43b52df183d1a5a1aa936acc2d Author: Huang Rui Date: Thu Jul 26 16:48:54 2018 +0800 drm/ttm: clean up non-x86 definitions on ttm_page_alloc_dma All non-x86 definitions are moved to ttm_set_memory header, so remove it from ttm_page_alloc_dma.c. Suggested-by: Christian König Signed-off-by: Huang Rui Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2ac305b7c8d7f93a6ef0018391e9865ea4ac0d65 Author: Huang Rui Date: Thu Jul 26 16:32:08 2018 +0800 drm/ttm: add ttm_set_memory header (v2) This patch moves all non-x86 abstraction to the ttm_set_memory header. It is to make function calling more clearly. (v2): add ttm_ prefix. Suggested-by: Christian König Signed-off-by: Huang Rui Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 9ff07e7d634cb005e7c5dc5e2c28a06508eb4fbf Author: Mikulas Patocka Date: Wed Jul 25 02:34:06 2018 -0400 dm writecache: report start_sector in status line Fixes: d284f8248c7 ("dm writecache: support optional offset for start of device") Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit c07c88f54f2323516e8038aa9301ab0db4812c81 Author: Kees Cook Date: Sun Jul 15 20:59:12 2018 -0700 dm crypt: convert essiv from ahash to shash In preparing to remove all stack VLA usage from the kernel[1], remove the discouraged use of AHASH_REQUEST_ON_STACK in favor of the smaller SHASH_DESC_ON_STACK by converting from ahash-wrapped-shash to direct shash. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Reviewed-by: Eric Biggers Signed-off-by: Mike Snitzer commit c7329eff72aa237d6bedef6dc57c93dc048d2a16 Author: Mikulas Patocka Date: Wed Jul 11 12:10:51 2018 -0400 dm crypt: use wake_up_process() instead of a wait queue This is a small simplification of dm-crypt - use wake_up_process() instead of a wait queue in a case where only one process may be waiting. dm-writecache uses a similar pattern. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit a3fcf7253139609bf9ff901fbf955fba047e75dd Author: Mikulas Patocka Date: Tue Jul 3 20:13:33 2018 +0200 dm integrity: recalculate checksums on creation When using external metadata device and internal hash, recalculate the checksums when the device is created - so that dm-integrity doesn't have to overwrite the device. The superblock stores the last position when the recalculation ended, so that it is properly restarted. Integrity tags that haven't been recalculated yet are ignored. Also bump the target version. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 747829a8e6c6a65e096ce8dd79506cbcf83951ad Author: Mikulas Patocka Date: Tue Jul 3 20:13:32 2018 +0200 dm integrity: flush journal on suspend when using separate metadata device Flush the journal on suspend when using separate data and metadata devices, so that the metadata device can be discarded and the table can be reloaded with a linear target pointing to the data device. NOTE: the journal is deliberately not flushed when using the same device for metadata and data, so that the journal replay code is tested. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 1f9fc0b826119f8d76d33c3bf60b7426be6dc19e Author: Mikulas Patocka Date: Tue Jul 3 20:13:31 2018 +0200 dm integrity: use version 2 for separate metadata Use version "2" in the superblock when data and metadata devices are separate, so that the device is not accidentally read by older kernel version. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 356d9d52e1221ba0c9f10b8b38652f78a5298329 Author: Mikulas Patocka Date: Tue Jul 3 20:13:30 2018 +0200 dm integrity: allow separate metadata device Add the ability to store DM integrity metadata on a separate device. This feature is activated with the option "meta_device:/dev/device". Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 71e9ddbcb99e9bf1f968906b395e172ea8328365 Author: Mikulas Patocka Date: Tue Jul 3 20:13:29 2018 +0200 dm integrity: add ic->start in get_data_sector() A small refactoring. Add the variable ic->start to the result returned by get_data_sector() and not in the callers. This is a prerequisite for the commit that adds the ability to use an external metadata device. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit f84fd2c98480fa0e3c0b43996c4e235bdf4a9527 Author: Mikulas Patocka Date: Tue Jul 3 20:13:28 2018 +0200 dm integrity: report provided data sectors in the status Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 724376a04d1a63d145fdfe7b24c0b13128a3ffd6 Author: Mikulas Patocka Date: Tue Jul 3 20:13:27 2018 +0200 dm integrity: implement fair range locks dm-integrity locks a range of sectors to prevent concurrent I/O or journal writeback. These locks were not fair - so that many small overlapping I/Os could starve a large I/O indefinitely. Fix this by making the range locks fair. The ranges that are waiting are added to the list "wait_list". If a new I/O overlaps some of the waiting I/Os, it is not dispatched, but it is also added to that wait list. Entries on the wait list are processed in first-in-first-out order, so that an I/O can't starve indefinitely. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 518748b1a744c496a657a5a7923e49e002a6f259 Author: Mikulas Patocka Date: Tue Jul 3 20:13:26 2018 +0200 dm integrity: decouple common code in dm_integrity_map_continue() Decouple how dm_integrity_map_continue() responds to being out of free sectors and when add_new_range() fails. This has no functional change, but helps prepare for the next commit. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit c21b16392701543d61e366dca84e15fe7f0cf0cf Author: Mikulas Patocka Date: Tue Jul 3 20:13:25 2018 +0200 dm integrity: change 'suspending' variable from bool to int Early alpha processors can't write a byte or short atomically - they read 8 bytes, modify the byte or two bytes in registers and write back 8 bytes. The modification of the variable "suspending" may race with modification of the variable "failed". Fix this by changing "suspending" to an int. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit cda6b5ab7f5935565ed5b9bbc385bd1d0a3feb75 Author: Mikulas Patocka Date: Tue Apr 17 00:33:14 2018 +0200 dm delay: add flush as a third class of IO Add a new class for dm-delay that delays flush requests. Previously, flushes were delayed as writes, but it caused problems if the user needed to create a device with one or a few slow sectors for the purpose of testing - all flushes would be forwarded to this device and delayed, and that skews the test results. Fix this by allowing to select 0 delay for flushes. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 3876ac76f02ac2a7b3d96f813c0ee1070e7a8c8e Author: Mikulas Patocka Date: Tue Apr 17 00:33:13 2018 +0200 dm delay: refactor repetitive code dm-delay has a lot of code that is repeated for delaying read and write bios. Repetitive code is generally bad; refactor out the repetitive code in preperation for adding another delay class for flush bios. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit af9313c32c0fa2a0ac3b113669273833d60cc9de Author: John Pittman Date: Thu Jun 21 17:35:33 2018 -0400 dm cache: only allow a single io_mode cache feature to be requested More than one io_mode feature can be requested when creating a dm cache device (as is: last one wins). The io_mode selections are incompatible with one another, we should force them to be selected exclusively. Add a counter to check for more than one io_mode selection. Fixes: 629d0a8a1a10 ("dm cache metadata: add "metadata2" feature") Signed-off-by: John Pittman Signed-off-by: Mike Snitzer commit 6c7413c0f5ab61d2339cf516d25bb44d71f4bad4 Author: Mike Snitzer Date: Mon Jul 23 09:46:45 2018 -0400 dm thin: update stale "Status" Documentation Documentation/device-mapper-/thin-provisioning.txt's "Status" section no longer reflected the current fitness level of DM thin-provisioning. That is, DM thinp is no longer "EXPERIMENTAL". It has since seen considerable improvement, has been fairly widely deployed and has performed in a robust manner. Update Documentation to dispel concern raised by potential DM thinp users. Reported-by: Drew Hastings Signed-off-by: Mike Snitzer commit 19a7121e5ec6cb26988253c1fbc900de838df70f Author: Nick Dyer Date: Fri Jul 27 11:49:29 2018 -0700 Input: atmel_mxt_ts - move completion to after config crc is updated Signed-off-by: Nick Dyer Signed-off-by: Dmitry Torokhov commit 2ca3ba0ae4cf0bf9c17f1a04298c3acca24be5e0 Author: Nick Dyer Date: Fri Jul 27 11:49:10 2018 -0700 Input: atmel_mxt_ts - don't report zero pressure from T9 If T9.CTRL DISAMP is set, then pressure is reported as zero. This means some app layers (eg tslib) will ignore the contact. Signed-off-by: Nick Dyer Signed-off-by: Dmitry Torokhov commit a4891f10583748933a9985fac7aa7c073cc59c85 Author: Nick Dyer Date: Fri Jul 27 11:46:46 2018 -0700 Input: atmel_mxt_ts - zero terminate config firmware file We use sscanf to parse the configuration file, so it's necessary to zero terminate the configuration otherwise a truncated file can cause the parser to run off into uninitialised memory. Signed-off-by: Nick Dyer Signed-off-by: Dmitry Torokhov commit f865df7364c3be0aa1e6f708d246af97c134893f Author: Nick Dyer Date: Fri Jul 27 11:46:29 2018 -0700 Input: atmel_mxt_ts - refactor config update code to add context struct Signed-off-by: Nick Dyer Signed-off-by: Dmitry Torokhov commit 15082bdbd9fa94179868cdb60ae5d62677739412 Author: Nick Dyer Date: Fri Jul 27 11:45:47 2018 -0700 Input: atmel_mxt_ts - config CRC may start at T71 On devices with the T71 object, the config CRC will start there, rather than at T7. Signed-off-by: Nick Dyer Signed-off-by: Dmitry Torokhov commit 01cc75f93e1aa88b881e08294b7b3180e3848081 Author: Nick Dyer Date: Fri Jul 27 11:45:30 2018 -0700 Input: atmel_mxt_ts - remove unnecessary debug on ENOMEM Signed-off-by: Nick Dyer Signed-off-by: Dmitry Torokhov commit e9326857f437dd83392d80a4820aa2b030c5a666 Author: Nick Dyer Date: Fri Jul 27 11:45:20 2018 -0700 Input: atmel_mxt_ts - remove duplicate setup of ABS_MT_PRESSURE Signed-off-by: Nick Dyer Signed-off-by: Dmitry Torokhov commit 204b4eae0cb092703ce7c8c79f0f5192683b8a7c Author: Nick Dyer Date: Fri Jul 27 11:44:41 2018 -0700 Input: atmel_mxt_ts - use BIT() macro everywhere Signed-off-by: Nick Dyer Signed-off-by: Dmitry Torokhov commit 36f5d9ef26e52edff046b4b097855db89bf0cd4a Author: Nick Dyer Date: Fri Jul 27 11:44:20 2018 -0700 Input: atmel_mxt_ts - only use first T9 instance The driver only registers one input device, which uses the screen parameters from the first T9 instance. The first T63 instance also uses those parameters. It is incorrect to send input reports from the second instances of these objects if they are enabled: the input scaling will be wrong and the positions will be mashed together. This also causes problems on Android if the number of slots exceeds 32. In the future, this could be handled by looking for enabled touch object instances and creating an input device for each one. Signed-off-by: Nick Dyer Acked-by: Benson Leung Acked-by: Yufeng Shen Signed-off-by: Dmitry Torokhov commit 53fddb6618db53779d96f6a29a98e2a9c5d05877 Author: Jia-Ju Bai Date: Fri Jul 27 11:35:17 2018 -0700 Input: aiptek - replace GFP_ATOMIC with GFP_KERNEL in aiptek_probe() aiptek_probe() is never called in atomic context. It calls usb_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Dmitry Torokhov commit 7a082a24cf9f727868ab4b9ca2b7cd8ce46fa8e6 Author: Jia-Ju Bai Date: Fri Jul 27 11:34:26 2018 -0700 Input: appletouch - replace GFP_ATOMIC with GFP_KERNEL atp_open(), atp_recover() and atp_resume() are never called in atomic context. They call usb_submit_urb() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Dmitry Torokhov commit 434ca100cfa50de354d88329d7c0a10b80241f10 Author: Jia-Ju Bai Date: Fri Jul 27 11:34:13 2018 -0700 Input: yealink - replace GFP_ATOMIC with GFP_KERNEL in usb_probe() usb_probe() is never called in atomic context. It calls usb_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Dmitry Torokhov commit 1f25d9c60cfe28524f1650912bc13d72854206b5 Author: Jia-Ju Bai Date: Fri Jul 27 11:33:45 2018 -0700 Input: powermate - replace GFP_ATOMIC with GFP_KERNEL in powermate_alloc_buffers() powermate_alloc_buffers() is never called in atomic context. It calls usb_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Dmitry Torokhov commit 673831da643c31756622963585fc9d6dbb5d3a37 Author: Jia-Ju Bai Date: Fri Jul 27 11:32:36 2018 -0700 Input: keyspan_remote - replace GFP_ATOMIC with GFP_KERNEL in keyspan_probe() keyspan_probe() is never called in atomic context. It calls usb_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Dmitry Torokhov commit e58650b57ee0078ac8986650febeb55263f9ebdf Author: Jia-Ju Bai Date: Fri Jul 27 11:29:56 2018 -0700 Input: wdt87xx_i2c - replace mdelay() with msleep() in wdt87xx_resume() wdt87xx_resume() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Dmitry Torokhov commit 6c6212aa22978abb6eba8b9d9f0478ede14fc39b Author: Tim Schumacher Date: Fri Jul 27 11:56:34 2018 -0700 Input: iforce - assign BTN_DEAD only for specific devices Move BTN_DEAD into the arrays with the specific button sets instead of assigning it for every iforce device. BTN_DEAD represents an optical sensor which detects if the user is interacting with the device. On devices without that optical sensor BTN_DEAD is repeatedly causing false inputs on every status update of the joystick. Signed-off-by: Tim Schumacher Signed-off-by: Dmitry Torokhov commit b369b30cf510fe94d8884837039362e2ec223cec Author: Chaitanya Kulkarni Date: Thu Jul 26 14:00:41 2018 -0700 nvmet: use Retain Async Event bit to clear AEN In the current implementation, we clear the AEN bit when we get the "get log page" command if given log page is associated with AEN. This patch allows optionally retaining the AEN for the ctrl under consideration when Retain Asynchronous Event (RAE) bit is set as a part of "get log page" command. This allows the host to read the Log page and optionally retaining the AEN associated with this log page when using userspace tools like nvme-cli. Signed-off-by: Chaitanya Kulkarni [hch: also use the new helper in the just merged ANA code] Signed-off-by: Christoph Hellwig commit 62ac0d32f74ea511d5813be728dc589d03f866a3 Author: Christoph Hellwig Date: Fri Jun 1 08:59:25 2018 +0200 nvmet: support configuring ANA groups Allow creating non-default ANA groups (group ID > 1). Groups are created either by assigning the group ID to a namespace, or by creating a configfs group object under a specific port. All namespaces assigned to a group that doesn't have a configfs object for a given port are marked as inaccessible. Allow changing the ANA state on a per-port basis by creating an ana_groups directory under each port, and another directory with an ana_state file in it. The default ANA group 1 directory is created automatically for each port. For all changes in ANA configuration the ANA change AEN is sent. We only keep a global changecount instead of additional per-group changecounts to keep the implementation as simple as possible. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn commit 72efd25dcf4f6310e9e6fa85620aa443b27c23fe Author: Christoph Hellwig Date: Thu Jul 19 07:35:20 2018 -0700 nvmet: add minimal ANA support Add support for Asynchronous Namespace Access as specified in NVMe 1.3 TP 4004. Just add a default ANA group 1 that is optimized on all ports. This is (and will remain) the default assignment for any namespace not epxlicitly assigned to another ANA group. The ANA state can be manually changed through the configfs interface, including the change state. Includes fixes and improvements from Hannes Reinecke. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn commit 793c7cfce02ce88b7bd67d43834c052d16c096e3 Author: Christoph Hellwig Date: Sun May 13 19:00:13 2018 +0200 nvmet: track and limit the number of namespaces per subsystem TP 4004 introduces a new 'Maximum Number of Allocated Namespaces' field in the Identify controller data to help the host size resources. Put an upper limit on the supported namespaces to be able to support this value as supporting 32-bits worth of namespaces would lead to very large buffers. The limit is completely arbitrary at this point. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn commit 4ee43280488b0f6cbd74702725a32f47d03d690b Author: Christoph Hellwig Date: Thu Jun 7 15:09:50 2018 +0200 nvmet: keep a port pointer in nvmet_ctrl This will be needed for the ANA AEN code. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn commit 0d0b660f214dc4905db7b6bc998bad0c16dfb1ba Author: Christoph Hellwig Date: Mon May 14 08:48:54 2018 +0200 nvme: add ANA support Add support for Asynchronous Namespace Access as specified in NVMe 1.3 TP 4004. With ANA each namespace attached to a controller belongs to an ANA group that describes the characteristics of accessing the namespaces through this controller. In the optimized and non-optimized states namespaces can be accessed regularly, although in a multi-pathing environment we should always prefer to access a namespace through a controller where an optimized relationship exists. Namespaces in Inaccessible, Permanent-Loss or Change state for a given controller should not be accessed. The states are updated through reading the ANA log page, which is read once during controller initialization, whenever the ANA change notice AEN is received, or when one of the ANA specific status codes that signal a state change is received on a command. The ANA state is kept in the nvme_ns structure, which makes the checks in the fast path very simple. Updating the ANA state when reading the log page is also very simple, the only downside is that finding the initial ANA state when scanning for namespaces is a bit cumbersome. The gendisk for a ns_head is only registered once a live path for it exists. Without that the kernel would hang during partition scanning. Includes fixes and improvements from Hannes Reinecke. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Martin K. Petersen Reviewed-by: Johannes Thumshirn commit 8decf5d5b9f3f72b802a017b0b035f7db0592acf Author: Christoph Hellwig Date: Mon Jun 4 08:43:00 2018 +0200 nvme: remove nvme_req_needs_failover Now that we just call out to blk_path_error there isn't really any good reason to not merge it into the only caller. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn commit 0e98719b0e4b48b61965e1d1cba037c2005d01d7 Author: Christoph Hellwig Date: Wed Jun 6 14:39:00 2018 +0200 nvme: simplify the API for getting log pages Merge nvme_get_log and nvme_get_log_ext into a single helper, which takes a plain nsid instead of the nvme_ns pointer. Also add support for the log specific field while we're at it. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn commit 1a37621658fe06b10cf8bac02c32304d2a1c888c Author: Christoph Hellwig Date: Sun May 13 18:53:57 2018 +0200 nvme.h: add ANA definitions Add various defintions from NVMe 1.3 TP 4004. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn commit 9b89bc3857a6c0dfda18ddae2a42c114ecc32753 Author: Christoph Hellwig Date: Sat May 12 18:18:12 2018 +0200 nvme.h: add support for the log specific field NVMe 1.3 added a new log specific field to the get log page CQ defintion, add it to our get_log_page SQ structure. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn commit 4faeaf9c0f4581667ce5826f9c90c4fd463ef086 Author: Sylwester Nawrocki Date: Tue Jun 5 09:33:59 2018 -0400 media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions Look up of buffers in s5p_mfc_handle_frame_new, s5p_mfc_handle_frame_copy_time functions is not working properly for DMA addresses above 2 GiB. As a result flags and timestamp of returned buffers are not set correctly and it breaks operation of GStreamer/OMX plugins which rely on the CAPTURE buffer queue flags. Due to improper return type of the get_dec_y_adr, get_dspl_y_adr callbacks and sign bit extension these callbacks return incorrect address values, e.g. 0xfffffffffefc0000 instead of 0x00000000fefc0000. Then the statement: "if (vb2_dma_contig_plane_dma_addr(&dst_buf->b->vb2_buf, 0) == dec_y_addr)" is always false, which breaks looking up capture queue buffers. To ensure proper matching by address u32 type is used for the DMA addresses. This should work on all related SoCs, since the MFC DMA address width is not larger than 32-bit. Changes done in this patch are minimal as there is a larger patch series pending refactoring the whole driver. Signed-off-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab commit 4d8bde883bfba3e8dd3335f91b640e5a70ec0aa6 Author: Robin Murphy Date: Mon Jul 23 23:16:12 2018 +0100 OF: Don't set default coherent DMA mask Now that we can track upstream DMA constraints properly with bus_dma_mask instead of trying (and failing) to maintain it in coherent_dma_mask, it doesn't make much sense for the firmware code to be touching the latter at all. It's merely papering over bugs wherein a driver has failed to call dma_set_coherent_mask() *and* the bus code has not initialised any default value. We don't really want to encourage more drivers coercing dma_mask so we'll continue to fix that up if necessary, but add a warning to help flush out any such buggy bus code that remains. Signed-off-by: Robin Murphy Acked-by: Ard Biesheuvel Signed-off-by: Christoph Hellwig commit 6757cdae44449dec2af68cd4db0a5f9a30e66b38 Author: Robin Murphy Date: Mon Jul 23 23:16:11 2018 +0100 ACPI/IORT: Don't set default coherent DMA mask Now that we can track upstream DMA constraints properly with bus_dma_mask instead of trying (and failing) to maintain it in coherent_dma_mask, it doesn't make much sense for the firmware code to be touching the latter at all. It's merely papering over bugs wherein a driver has failed to call dma_set_coherent_mask() *and* the bus code has not initialised any default value. We don't really want to encourage more drivers coercing dma_mask so we'll continue to fix that up if necessary, but add a warning to help flush out any such buggy bus code that remains. Signed-off-by: Robin Murphy Acked-by: Ard Biesheuvel Acked-by: Lorenzo Pieralisi Signed-off-by: Christoph Hellwig commit 03bfdc31176cbe21e456f889ccbbf67568831149 Author: Robin Murphy Date: Mon Jul 23 23:16:10 2018 +0100 iommu/dma: Respect bus DMA limit for IOVAs Take the new bus limit into account (when present) for IOVA allocations, to accommodate those SoCs which integrate off-the-shelf IP blocks with narrower interconnects such that the link between a device output and an IOMMU input can truncate DMA addresses to even fewer bits than the native size of either block's interface would imply. Eventually it might make sense for the DMA core to apply this constraint up-front in dma_set_mask() and friends, but for now this seems like the least risky approach. Signed-off-by: Robin Murphy Acked-by: Ard Biesheuvel Acked-by: Joerg Roedel Signed-off-by: Christoph Hellwig commit 6c2fb2ea76361da9b420a8e23a2a19e7842cbdda Author: Robin Murphy Date: Mon Jul 23 23:16:09 2018 +0100 of/device: Set bus DMA mask as appropriate When an explicit DMA limit is described by firmware, we need to remember it regardless of how drivers might subsequently update their devices' masks. The new bus_dma_mask field does that. Signed-off-by: Robin Murphy Acked-by: Ard Biesheuvel Signed-off-by: Christoph Hellwig commit d74ea7100b0d065f2008c4e1ddf637483bc3d28c Author: Robin Murphy Date: Mon Jul 23 23:16:08 2018 +0100 ACPI/IORT: Set bus DMA mask as appropriate When an explicit DMA limit is described by firmware, we need to remember it regardless of how drivers might subsequently update their devices' masks. The new bus_dma_mask field does that. Signed-off-by: Robin Murphy Acked-by: Ard Biesheuvel Acked-by: Lorenzo Pieralisi Signed-off-by: Christoph Hellwig commit f07d141fe9430cdf9f8a65a87c4136bd83b8ab2e Author: Robin Murphy Date: Mon Jul 23 23:16:07 2018 +0100 dma-mapping: Generalise dma_32bit_limit flag Whilst the notion of an upstream DMA restriction is most commonly seen in PCI host bridges saddled with a 32-bit native interface, a more general version of the same issue can exist on complex SoCs where a bus or point-to-point interconnect link from a device's DMA master interface to another component along the path to memory (often an IOMMU) may carry fewer address bits than the interfaces at both ends nominally support. In order to properly deal with this, the first step is to expand the dma_32bit_limit flag into an arbitrary mask. To minimise the impact on existing code, we'll make sure to only consider this new mask valid if set. That makes sense anyway, since a mask of zero would represent DMA not being wired up at all, and that would be better handled by not providing valid ops in the first place. Signed-off-by: Robin Murphy Acked-by: Ard Biesheuvel Signed-off-by: Christoph Hellwig commit 5ac65e8c89410892189ef778f567da4adafb2e2f Author: Robin Murphy Date: Mon Jul 23 23:16:06 2018 +0100 ACPI/IORT: Support address size limit for root complexes IORT revision D allows PCI root complex nodes to specify a memory address size limit equivalently to named components, to help describe straightforward integrations which don't really warrant a full-blown _DMA method. Now that our headers are up-to-date, plumb it in. If both _DMA and an address size limit are present, we would always expect the former to be a more specific subset of the latter (since it makes little sense for a _DMA range to involve bits which IORT says aren't wired up), thus we can save calculating an explicit intersection of the two effective masks and simply use short-circuit logic instead. Reviewed-by: Hanjun Guo Signed-off-by: Robin Murphy Acked-by: Ard Biesheuvel Acked-by: Will Deacon Acked-by: Lorenzo Pieralisi Signed-off-by: Christoph Hellwig commit a5516219b10218a87abb3352c82248ce3088e94a Author: Robin Murphy Date: Fri Jul 27 15:14:15 2018 +0100 of/platform: Initialise default DMA masks When of_dma_configure() was first born in 591c1ee465ce ("of: configure the platform device dma parameters"), everything DMA-related was factored out of of_platform_device_create_pdata() as seemed appropriate at the time. However, now that of_dma_configure() has grown into the generic handler for processing DMA-related properties from DT for all kinds of devices, it is no longer an appropriate place to be doing OF-platform-specific business. Since there are still plenty of platform drivers not setting their own masks and depending on the bus default, let's reinstate that inialisation in the OF-platform code itself, and restore the long-standing status quo from 0589342c2794 ("of: set dma_mask to point to coherent_dma_mask") Signed-off-by: Robin Murphy Acked-by: Rob Herring Signed-off-by: Christoph Hellwig commit 9db3bbf58be59ab496ccd1c7528f4b0e8835c5b1 Author: Ezequiel Garcia Date: Wed Jul 25 13:15:12 2018 -0400 media: v4l2-mem2mem: Fix missing v4l2_m2m_try_run call Commit 34dbb848d5e4 ("media: mem2mem: Remove excessive try_run call") removed a redundant call to v4l2_m2m_try_run but instead introduced a bug. Consider the following case: 1) Context A schedules, queues and runs job A. 2) While the m2m device is running, context B schedules and queues job B. Job B cannot run, because it has to wait for job A. 3) Job A completes, calls v4l2_m2m_job_finish, and tries to queue a job for context A, but since the context is empty it won't do anything. In this scenario, queued job B will never run. Fix this by calling v4l2_m2m_try_run from v4l2_m2m_try_schedule. While here, add more documentation to these functions. Fixes: 34dbb848d5e4 ("media: mem2mem: Remove excessive try_run call") Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil [hans.verkuil@cisco.com: split >80 cols line] Signed-off-by: Mauro Carvalho Chehab commit 39dd23dc9d4c512954ec511d22d93ea854cf0265 Author: Luca Ceresoli Date: Wed Jul 25 12:24:55 2018 -0400 media: imx274: add cropping support via SELECTION API Currently this driver does not support cropping. The supported modes are the following, all capturing the entire area: - 3840x2160, 1:1 binning (native sensor resolution) - 1920x1080, 2:1 binning - 1280x720, 3:1 binning The VIDIOC_SUBDEV_S_FMT ioctl chooses among these 3 configurations the one that matches the requested format. Add cropping support via VIDIOC_SUBDEV_S_SELECTION: with target V4L2_SEL_TGT_CROP to choose the captured area, with V4L2_SEL_TGT_COMPOSE to choose the output resolution. To maintain backward compatibility we also allow setting the compose format via VIDIOC_SUBDEV_S_FMT. To obtain this, compose rect and output format are computed in the common helper function __imx274_change_compose(), which sets both to the same width/height values. Cropping also calls __imx274_change_compose() whenever cropping rect size changes in order to reset the compose rect (and output format size) for 1:1 binning. Also rename enum imx274_mode to imx274_binning (and its values from IMX274_MODE_BINNING_* to IMX274_BINNING_*). Without cropping, the two naming are equivalent. With cropping, the resolution could be different, e.g. using 2:1 binning mode to crop 1200x960 and output a 600x480 format. Using binning in the names avoids any misunderstanding. For the same reason, replace the 'size' field in struct imx274_frmfmt with 'bin_ratio'. [Sakari Ailus: Remove leftover condition in imx274_apply_trimming] Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8927c27b32703e28041ae19bf25ea53461be83a1 Author: Anders Roxell Date: Fri Jul 27 00:27:21 2018 +0200 clk: mvebu: armada-37xx-periph: Remove unused var num_parents When building armada-37xx-periph, num_parents isn't used in function clk_pm_cpu_get_parent: drivers/clk/mvebu/armada-37xx-periph.c: In function ‘clk_pm_cpu_get_parent’: drivers/clk/mvebu/armada-37xx-periph.c:419:6: warning: unused variable ‘num_parents’ [-Wunused-variable] int num_parents = clk_hw_get_num_parents(hw); ^~~~~~~~~~~ Remove the declaration of num_parents to dispose the warning. Fixes: 616bf80d381d ("clk: mvebu: armada-37xx-periph: Fix wrong return value in get_parent") Signed-off-by: Anders Roxell Signed-off-by: Stephen Boyd commit 279b4b9aaa3d04ea8de960e39e54e38aafe93e62 Author: Luca Ceresoli Date: Wed Jul 25 12:24:54 2018 -0400 media: imx274: use regmap_bulk_write to write multybyte registers Currently 2-bytes and 3-bytes registers are set by very similar functions doing the needed shift & mask manipulation, followed by very similar for loops setting one byte at a time over I2C. Replace all of this code by a unique helper function that calls regmap_bulk_write(), which has two advantages: - sets all the bytes in a unique I2C transaction - removes lots of now unused code. Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3ee47cad3e6955147882f1a24a9465704d8eddd2 Author: Rui Miguel Silva Date: Tue Jul 3 10:08:03 2018 -0400 media: ov2680: Add Omnivision OV2680 sensor driver This patch adds V4L2 sub-device driver for OV2680 image sensor. The OV2680 is a 1/5" CMOS color sensor from Omnivision. Supports output format: 10-bit Raw RGB. The OV2680 has a single lane MIPI interface. The driver exposes following V4L2 controls: - auto/manual exposure, - exposure, - auto/manual gain, - gain, - horizontal/vertical flip, - test pattern menu. Supported resolution are only: QUXGA, 720P, UXGA. [Sakari Ailus: Drop "-level" from Kconfig help text] Signed-off-by: Rui Miguel Silva Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 1f3ed383fb9a073ae2e408cd7a0717b04c7c3a21 Author: Jiri Pirko Date: Fri Jul 27 09:45:05 2018 +0200 net: sched: don't dump chains only held by actions In case a chain is empty and not explicitly created by a user, such chain should not exist. The only exception is if there is an action "goto chain" pointing to it. In that case, don't show the chain in the dump. Track the chain references held by actions and use them to find out if a chain should or should not be shown in chain dump. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 1434e3b34816bede31400f9d2bc0c8bc6850459a Author: Rui Miguel Silva Date: Tue Jul 3 10:08:02 2018 -0400 media: ov2680: dt: Add bindings for OV2680 Add device tree binding documentation for the OV2680 camera sensor. [Sakari Ailus: Squash MAINTAINERS entry from Rui] CC: devicetree@vger.kernel.org Signed-off-by: Rui Miguel Silva Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit aab7ed1c392703604fbdc5bd5005dfb61a0b32f9 Author: Jacopo Mondi Date: Wed Jul 25 09:44:31 2018 -0400 media: i2c: Add driver for Aptina MT9V111 Add V4L2 sensor driver for Aptina MT9V111 CMOS image sensor. The MT9V111 is a 1/4-Inch CMOS image sensor based on MT9V011 with an integrated Image Flow Processor. Reviewed-by: Kieran Bingham Signed-off-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7c98c5ad80021cc0bc0d072da120441ce9190261 Author: Jacopo Mondi Date: Wed Jul 25 09:44:30 2018 -0400 media: dt-bindings: media: i2c: Document MT9V111 bindings Add documentation for Aptina MT9V111 image sensor. Reviewed-by: Rob Herring Signed-off-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7a49d3d4ea42fe15db0d36e042df14a645d1fdce Merge: ecbcd689d74a c6f5e017df9d Author: David S. Miller Date: Fri Jul 27 09:33:37 2018 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2018-07-27 1) Extend the output_mark to also support the input direction and masking the mark values before applying to the skb. 2) Add a new lookup key for the upcomming xfrm interfaces. 3) Extend the xfrm lookups to match xfrm interface IDs. 4) Add virtual xfrm interfaces. The purpose of these interfaces is to overcome the design limitations that the existing VTI devices have. The main limitations that we see with the current VTI are the following: VTI interfaces are L3 tunnels with configurable endpoints. For xfrm, the tunnel endpoint are already determined by the SA. So the VTI tunnel endpoints must be either the same as on the SA or wildcards. In case VTI tunnel endpoints are same as on the SA, we get a one to one correlation between the SA and the tunnel. So each SA needs its own tunnel interface. On the other hand, we can have only one VTI tunnel with wildcard src/dst tunnel endpoints in the system because the lookup is based on the tunnel endpoints. The existing tunnel lookup won't work with multiple tunnels with wildcard tunnel endpoints. Some usecases require more than on VTI tunnel of this type, for example if somebody has multiple namespaces and every namespace requires such a VTI. VTI needs separate interfaces for IPv4 and IPv6 tunnels. So when routing to a VTI, we have to know to which address family this traffic class is going to be encapsulated. This is a lmitation because it makes routing more complex and it is not always possible to know what happens behind the VTI, e.g. when the VTI is move to some namespace. VTI works just with tunnel mode SAs. We need generic interfaces that ensures transfomation, regardless of the xfrm mode and the encapsulated address family. VTI is configured with a combination GRE keys and xfrm marks. With this we have to deal with some extra cases in the generic tunnel lookup because the GRE keys on the VTI are actually not GRE keys, the GRE keys were just reused for something else. All extensions to the VTI interfaces would require to add even more complexity to the generic tunnel lookup. So to overcome this, we developed xfrm interfaces with the following design goal: It should be possible to tunnel IPv4 and IPv6 through the same interface. No limitation on xfrm mode (tunnel, transport and beet). Should be a generic virtual interface that ensures IPsec transformation, no need to know what happens behind the interface. Interfaces should be configured with a new key that must match a new policy/SA lookup key. The lookup logic should stay in the xfrm codebase, no need to change or extend generic routing and tunnel lookups. Should be possible to use IPsec hardware offloads of the underlying interface. 5) Remove xfrm pcpu policy cache. This was added after the flowcache removal, but it turned out to make things even worse. From Florian Westphal. 6) Allow to update the set mark on SA updates. From Nathan Harold. 7) Convert some timestamps to time64_t. From Arnd Bergmann. 8) Don't check the offload_handle in xfrm code, it is an opaque data cookie for the driver. From Shannon Nelson. 9) Remove xfrmi interface ID from flowi. After this pach no generic code is touched anymore to do xfrm interface lookups. From Benedict Wong. 10) Allow to update the xfrm interface ID on SA updates. From Nathan Harold. 11) Don't pass zero to ERR_PTR() in xfrm_resolve_and_create_bundle. From YueHaibing. 12) Return more detailed errors on xfrm interface creation. From Benedict Wong. 13) Use PTR_ERR_OR_ZERO instead of IS_ERR + PTR_ERR. From the kbuild test robot. ==================== Signed-off-by: David S. Miller commit e6c17ada3188e0deb43652b0eed249f37e0d44b0 Author: Sakari Ailus Date: Fri Jul 20 17:07:15 2018 -0400 media: dw9807-vcm: Recognise this is just the VCM bit of the device The dw9807 contains a voice coil lens driver as well as an EEPROM. This driver is just for the VCM. Reflect this in the driver's name --- this is already the case for the compatible string, for instance. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7aaa1807e698f73094b78f0ef25b1a37a4409a55 Author: Jason Gunthorpe Date: Fri Jul 27 09:48:30 2018 -0600 IB/cache: Restore compatibility for ib_query_gid Code changes in smc have become so complicated this cycle that the RDMA patches to remove ib_query_gid in smc create too complex merge conflicts. Allow those conflicts to be resolved by using the net/smc hunks by providing a compatibility wrapper. During the second phase of the merge window this wrapper will be deleted and smc updated to use the new API. Reported-by: Stephen Rothwell Reviewed-by: Parav Pandit Signed-off-by: Jason Gunthorpe commit 8856541557f3626beec43aa0821b2e0f031f0153 Author: Anders Roxell Date: Fri Jul 27 17:10:15 2018 +0200 rtc: sh: remove unused variable rtc_dev When building rtc-sh, rtc_dev isn't used in function __sh_rtc_periodic. drivers/rtc/rtc-sh.c: In function ‘__sh_rtc_periodic’: drivers/rtc/rtc-sh.c:146:21: warning: unused variable ‘rtc_dev’ [-Wunused-variable] struct rtc_device *rtc_dev = rtc->rtc_dev; ^~~~~~~ Remove the declaration of rtc_dev to dispose the warning. Fixes: ec623ff014c4 ("rtc: sh: remove dead code") Signed-off-by: Anders Roxell Signed-off-by: Alexandre Belloni commit 27cce7bc2f8154f3a3bebcf7f9923cd22477aef8 Author: Gao Xiang Date: Thu Jul 26 20:22:08 2018 +0800 staging: erofs: add a TODO and update MAINTAINERS for staging This patch adds a TODO to list the things to be done, and the relevant info to MAINTAINERS so we can take all the blame :) Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 105d4ad857dcbf3dc1288f339c5b09dafbc8f923 Author: Gao Xiang Date: Thu Jul 26 20:22:07 2018 +0800 staging: erofs: introduce cached decompression This patch adds an optional choice which can be enabled by users in order to cache both incomplete ends of compressed clusters as a complement to the in-place decompression in order to boost random read, but it costs more memory than the in-place decompression only. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 3883a79abd02272222a214a5f84395d41eecdc84 Author: Gao Xiang Date: Thu Jul 26 20:22:06 2018 +0800 staging: erofs: introduce VLE decompression support This patch introduces the basic in-place VLE decompression implementation for the erofs file system. Compared with fixed-sized input compression, it implements what we call 'the variable-length extent compression' which specifies the same output size for each compression block to make the full use of IO bandwidth (which means almost all data from block device can be directly used for decomp- ression), improve the real (rather than just via data caching, which costs more memory) random read and keep the relatively lower compression ratios (it saves more storage space than fixed-sized input compression which is also configured with the same input block size), as illustrated below: |--- variable-length extent ---|------ VLE ------|--- VLE ---| /> clusterofs /> clusterofs /> clusterofs /> clusterofs ++---|-------++-----------++---------|-++-----------++-|---------++-| ...|| | || || | || || | || | ... original data ++---|-------++-----------++---------|-++-----------++-|---------++-| ++->cluster<-++->cluster<-++->cluster<-++->cluster<-++->cluster<-++ size size size size size \ / / / \ / / / \ / / / ++-----------++-----------++-----------++ ... || || || || ... compressed clusters ++-----------++-----------++-----------++ ++->cluster<-++->cluster<-++->cluster<-++ size size size The main point of 'in-place' refers to the decompression mode: Instead of allocating independent compressed pages and data structures, it reuses the allocated file cache pages at most to store its compressed data and the corresponding pagevec in a time-sharing approach by default, which will be useful for low memory scenario. In the end, unlike the other filesystems with (de)compression support using a relatively large compression block size, which reads and decompresses >= 128KB at once, and gains a more good-looking random read (In fact it collects small random reads into large sequential reads and caches all decompressed data in memory, but it is unacceptable especially for embedded devices with limited memory, and it is not the real random read), we select a universal small-sized 4KB compressed cluster, which is the smallest page size for most architectures, and all compressed clusters can be read and decompressed independently, which ensures random read number for all use cases. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit e7e9a307be9d75ecc3bf20b362af88140dfb4304 Author: Gao Xiang Date: Thu Jul 26 20:22:05 2018 +0800 staging: erofs: introduce workstation for decompression This patch introduces another concept used by the unzip subsystem called 'workstation'. It can be seen as a sparse array that stores pointers pointed to data structures related to the corresponding physical blocks. All lookup cases are protected by RCU read lock. Besides, reference count and spin_lock are also introduced to manage its lifetime and serialize all update operations. 'workstation' is currently implemented on the in-kernel radix tree approach for backward compatibility. With the evolution of linux kernel, it could be migrated into XArray implementation in the future. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit a15813126272e5f81311e5e1330162baa40e5b0a Author: Gao Xiang Date: Thu Jul 26 20:22:04 2018 +0800 staging: erofs: introduce erofs shrinker This patch adds a dedicated shrinker targeting to free unneeded memory consumed by a number of erofs in-memory data structures. Like F2FS and UBIFS, it also adds: - sbi->umount_mutex to avoid races on shrinker and put_super - sbi->shrinker_run_no to not revisit recently scaned objects Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 2497ee41295c769dc74cb8bac7e03842bc51d331 Author: Gao Xiang Date: Thu Jul 26 20:22:03 2018 +0800 staging: erofs: introduce superblock registration In order to introducing shrinker solution for erofs, let's manage all mounted erofs instances at first. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 0d40d6e399c12c662eda395fe4f0602327d0d01f Author: Gao Xiang Date: Thu Jul 26 20:22:02 2018 +0800 staging: erofs: add a generic z_erofs VLE decompressor Currently, this patch only simply implements LZ4 decompressor due to its development priority. In the future, erofs will support more compression algorithm and format other than LZ4, thus a generic decompressor interface will be needed. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 366c96a3a8681c90d0663f580ebc4dd077df2152 Author: Gao Xiang Date: Thu Jul 26 20:22:01 2018 +0800 staging: erofs: introduce a customized LZ4 decompression We have to reduce the memory cost as much as possible, so we don't want to decompress more data beyond the output buffer size, however "LZ4_decompress_safe_partial" doesn't guarantee to stop at the arbitary end position, but stop just after its current LZ4 "sequence" is completed. Link: https://groups.google.com/forum/#!topic/lz4c/_3kkz5N6n00 Therefore, I hacked the LZ4 decompression logic by hand, probably NOT the fastest approach, and hope for better implementation. Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 55441958bb8d1a7b5509f1332ce98b0a733231da Author: Gao Xiang Date: Thu Jul 26 20:22:00 2018 +0800 staging: erofs: globalize prepare_bio and __submit_bio The unzip subsystem also uses these functions, let's export them to internal.h. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit b29e64d8798018c3e82a426ec34b39b825ac68dc Author: Gao Xiang Date: Thu Jul 26 20:21:59 2018 +0800 staging: erofs: add erofs_allocpage This patch introduces an temporary _on-stack_ page pool to reuse the freed page directly as much as it can for better performance and release all pages at a time, it also slightly reduces the possibility of the potential memory allocation failure. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 02827e1796b33f1794966f5c3101f8da2dfa9c1d Author: Gao Xiang Date: Thu Jul 26 20:21:58 2018 +0800 staging: erofs: add erofs_map_blocks_iter This patch introduces an iterable L2P mapping operation 'erofs_map_blocks_iter'. Compared with 'erofs_map_blocks', it avoids a number of redundant 'release and regrab' processes if they request the same meta page. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 5eb20ec3e52496dfd0a2cf6a817993dd01ab2067 Author: Gao Xiang Date: Thu Jul 26 20:21:57 2018 +0800 staging: erofs: introduce pagevec for unzip subsystem For each compressed cluster, there is a straight-forward way of allocating a fixed or variable-sized (for VLE) array to record the corresponding file pages for its decompression if we decide to decompress these pages asynchronously (eg. read-ahead case), however it could take much extra on-heap memory compared with traditional uncompressed filesystems. This patch introduces a pagevec solution to reuse some allocated file page in the time-sharing approach storing parts of the array itself in order to minimize the extra memory overhead, thus only a constant and small-sized array used for booting the whole array itself up will be needed. Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit b8b58b3280b376d55f4e90f8d28904deb2dc1d5c Author: Gao Xiang Date: Thu Jul 26 20:21:56 2018 +0800 staging: erofs: : introduce tagged pointer Currently kernel has scattered tagged pointer usages hacked by hand in plain code, without a unique and portable functionset to highlight the tagged pointer itself and wrap these hacked code in order to clean up all over meaningless magic masks. Therefore, this patch introduces simple generic methods to fold tags into a pointer integer. It currently supports the last n bits of the pointer for tags, which can be selected by users. In addition, it will also be used for the upcoming EROFS filesystem, which heavily uses tagged pointer approach for high performance and reducing extra memory allocation. Link: https://en.wikipedia.org/wiki/Tagged_pointer Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 13f06f48f7bf8ebfa443e9496d382fa3d20b9ff3 Author: Chao Yu Date: Thu Jul 26 20:21:55 2018 +0800 staging: erofs: support tracepoint Add basic tracepoints for ->readpage{,s}, ->lookup, ->destroy_inode, fill_inode and map_blocks. Reviewed-by: Gao Xiang Signed-off-by: Chao Yu Signed-off-by: Greg Kroah-Hartman commit 9c07b3b39dc7720a9427e5561cc730fa28b92cc2 Author: Chao Yu Date: Thu Jul 26 20:21:54 2018 +0800 staging: erofs: introduce error injection infrastructure This patch introduces error injection infrastructure, with it, we can inject error in any kernel exported common functions which erofs used, so that it can force erofs running into error paths, it turns out that tests can cover real rare paths more easily to find bugs. Reviewed-by: Gao Xiang Signed-off-by: Chao Yu Signed-off-by: Greg Kroah-Hartman commit d5beb31b6b1c0a3f7b30611c6d4b888f8d4137dd Author: Chao Yu Date: Thu Jul 26 20:21:53 2018 +0800 staging: erofs: support special inode This patch adds to support special inode, such as block dev, char, socket, pipe inode. Reviewed-by: Gao Xiang Signed-off-by: Chao Yu Signed-off-by: Greg Kroah-Hartman commit b17500a0fdbae10a8ce274dd523106f16d114339 Author: Gao Xiang Date: Thu Jul 26 20:21:52 2018 +0800 staging: erofs: introduce xattr & acl support This implements xattr and acl functionalities. Inline and shared xattrs are introduced for flexibility. Specifically, if the same xattr occurs for many times in a large number of inodes or the value of a xattr is so large that it isn't suitable to be inlined, a shared xattr kept in the xattr meta will be used instead. Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit fd68c6a20fcfac78b70465ec2e858403dc200056 Author: Gao Xiang Date: Thu Jul 26 20:21:51 2018 +0800 staging: erofs: update Kconfig and Makefile This commit adds Makefile and Kconfig for erofs, and updates Makefile and Kconfig files in the fs directory. Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit d72d1ce601743deed322ad5b74e960a2fd8ff205 Author: Gao Xiang Date: Thu Jul 26 20:21:50 2018 +0800 staging: erofs: add namei functions This commit adds functions that transfer names to inodes. Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 3aa8ec716e52c02360457fa018296629b4d0becf Author: Gao Xiang Date: Thu Jul 26 20:21:49 2018 +0800 staging: erofs: add directory operations This adds functions for directory, mainly readdir. Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 431339ba90423a038914c6032bfd71f0ba7ef2f2 Author: Gao Xiang Date: Thu Jul 26 20:21:48 2018 +0800 staging: erofs: add inode operations This adds core functions to get, read an inode. Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 81781b02f9845b44603d75f5b60c3af351415efa Author: Gao Xiang Date: Thu Jul 26 20:21:47 2018 +0800 staging: erofs: add raw address_space operations This commit adds functions for meta and raw data, and also provides address_space_operations for raw data access. Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit ba2b77a8202287d9a3b58e7a98fd647601e0ab57 Author: Gao Xiang Date: Thu Jul 26 20:21:46 2018 +0800 staging: erofs: add super block operations This commit adds erofs super block operations, including (u)mount, remount_fs, show_options, statfs, in addition to some private icache management functions. Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit bfb8674dc0447da3ab65665dd21086475abb8e4c Author: Gao Xiang Date: Thu Jul 26 20:21:45 2018 +0800 staging: erofs: add erofs in-memory stuffs - erofs_sb_info: contains erofs-specific in-memory information. - erofs_vnode: contains vfs_inode and other fs-specific information. same as super block, the only one in-memory definition exists. - erofs_map_blocks plays a role in the file L2P mapping Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit aea1286dcbbb87cf33595c2ac8b153c29a4611cb Author: Gao Xiang Date: Thu Jul 26 20:21:44 2018 +0800 staging: erofs: add on-disk layout This commit adds the on-disk layout header file of erofs. Note that the on-disk layout is still WIP, and some fields are reserved for the future use by design. Any comments are welcome. Thanks-to: Li Guifu Thanks-to: Sun Qiuyang Signed-off-by: Miao Xie Signed-off-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit a89bac0a2ca45c9a44f2a35523252d9d8082aa03 Author: Ioana Ciornei Date: Fri Jul 27 17:43:18 2018 +0300 staging: fsl-dpaa2/ethsw: document nested structs as per kernel-doc Document nested structs per kernel-doc requirements by moving all comments before the actual struct. Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman commit f970bec3cf9ab59ae5ae1ad03c76a912d0f72418 Author: Ioana Ciornei Date: Fri Jul 27 17:43:17 2018 +0300 staging: fsl-dpaa2/eth: document nested structs as per kernel-doc Document nested structs per kernel-doc requirements by moving all comments before the actual struct. Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman commit 5b91b73b8c4eacd24cb354f1eb20824b0b8cde55 Author: Ioana Radulescu Date: Fri Jul 27 09:13:00 2018 -0500 staging: fsl-dpaa2/eth: Remove unused driver version We never really used the driver version, so no point in keeping it around. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit 227686b65256c550865bc7630684548fe079830b Author: Ioana Radulescu Date: Fri Jul 27 09:12:59 2018 -0500 staging: fsl-dpaa2/eth: Update default hash key In our documentation, we claim to use a 5-tuple key for Rx hash distribution of flows. The code however configures a key composed of all supported header fields. Update the Rx hash key to contain only the documented fields: {IP src, IP dst, IP nextproto, L4 src, L4 dst}, which was the original intention and makes most sense as a default. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit ff5c37987b112d09352b16a28943c149ca90afb2 Author: Ioana Radulescu Date: Wed Jul 25 09:29:47 2018 -0500 staging: fsl-dpaa2/ethsw: Fix error message Error message was referencing wrong function, fix it. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit 4e336dff0dcc250175f0068e45fdebf526f45b91 Author: Georgios Tsotsos Date: Thu Jul 26 18:41:51 2018 +0300 Staging: octeon-usb: Adding SPDX license identifier Adding appropriate SPDX-License-Identifier (GPL-2) that were missing from code, header and make files. Signed-off-by: Georgios Tsotsos Signed-off-by: Greg Kroah-Hartman commit d43fdae7bac2def8c4314b5a49822cb7f08a45f1 Author: Mauricio Faria de Oliveira Date: Wed Jul 25 22:46:29 2018 -0300 partitions/aix: append null character to print data from disk Even if properly initialized, the lvname array (i.e., strings) is read from disk, and might contain corrupt data (e.g., lack the null terminating character for strings). So, make sure the partition name string used in pr_warn() has the null terminating character. Fixes: 6ceea22bbbc8 ("partitions: add aix lvm partition support files") Suggested-by: Daniel J. Axtens Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Jens Axboe commit 14cb2c8a6c5dae57ee3e2da10fa3db2b9087e39e Author: Mauricio Faria de Oliveira Date: Wed Jul 25 22:46:28 2018 -0300 partitions/aix: fix usage of uninitialized lv_info and lvname structures The if-block that sets a successful return value in aix_partition() uses 'lvip[].pps_per_lv' and 'n[].name' potentially uninitialized. For example, if 'numlvs' is zero or alloc_lvn() fails, neither is initialized, but are used anyway if alloc_pvd() succeeds after it. So, make the alloc_pvd() call conditional on their initialization. This has been hit when attaching an apparently corrupted/stressed AIX LUN, misleading the kernel to pr_warn() invalid data and hang. [...] partition (null) (11 pp's found) is not contiguous [...] partition (null) (2 pp's found) is not contiguous [...] partition (null) (3 pp's found) is not contiguous [...] partition (null) (64 pp's found) is not contiguous Fixes: 6ceea22bbbc8 ("partitions: add aix lvm partition support files") Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Jens Axboe commit 75cbb3f1d840429e6aa67b351332f38b29e6292c Author: Arnd Bergmann Date: Thu Jul 26 12:17:41 2018 +0800 bcache: stop using the deprecated get_seconds() The get_seconds function is deprecated now since it returns a 32-bit value that will eventually overflow, and we are replacing it throughout the kernel with ktime_get_seconds() or ktime_get_real_seconds() that return a time64_t. bcache uses get_seconds() to read the current system time and store it in the superblock as well as in uuid_entry structures that are user visible. Unfortunately, the two structures in are still limited to 32 bits, so this won't fix any real problems but will still overflow in year 2106. Let's at least document that properly, in case we get an updated format in the future it can be fixed. We still have a long time before the overflow and checking the tools at https://github.com/koverstreet/bcache-tools reveals no access to any of them. Signed-off-by: Arnd Bergmann Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 9b4e9f5abb94b671f998ffc0efebd1582852fee3 Author: Florian Schmaus Date: Thu Jul 26 12:17:40 2018 +0800 bcache: do not assign in if condition in bcache_device_init() Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 16c1fdf4cfd6c0091e59b93ec2cb7e99973f8244 Author: Florian Schmaus Date: Thu Jul 26 12:17:39 2018 +0800 bcache: do not assign in if condition in bcache_init() Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 6268dc2c4703aabfb0b35681be709acf4c2826c6 Author: Shenghui Wang Date: Thu Jul 26 12:17:38 2018 +0800 bcache: free heap cache_set->flush_btree in bch_journal_free Free the cache_set->flush_bree heap memory on journal free. Signed-off-by: Wang Sheng-Hui Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit a56489d4b3c914eb30b724ff25debc2e59c7950e Author: Florian Schmaus Date: Thu Jul 26 12:17:37 2018 +0800 bcache: do not assign in if condition register_bcache() Fixes an error condition reported by checkpatch.pl which is caused by assigning a variable in an if condition. Signed-off-by: Florian Schmaus Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 94f71c16062e86069fb87dfa9b6683e2f1c21232 Author: Tang Junhui Date: Thu Jul 26 12:17:36 2018 +0800 bcache: fix I/O significant decline while backend devices registering I attached several backend devices in the same cache set, and produced lots of dirty data by running small rand I/O writes in a long time, then I continue run I/O in the others cached devices, and stopped a cached device, after a mean while, I register the stopped device again, I see the running I/O in the others cached devices dropped significantly, sometimes even jumps to zero. In currently code, bcache would traverse each keys and btree node to count the dirty data under read locker, and the writes threads can not get the btree write locker, and when there is a lot of keys and btree node in the registering device, it would last several seconds, so the write I/Os in others cached device are blocked and declined significantly. In this patch, when a device registering to a ache set, which exist others cached devices with running I/Os, we get the amount of dirty data of the device in an incremental way, and do not block other cached devices all the time. Patch v2: Rename some variables and macros name as Coly suggested. Signed-off-by: Tang Junhui Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 7f4a59de28137aae4316a58f501b599ac3b87395 Author: Tang Junhui Date: Thu Jul 26 12:17:35 2018 +0800 bcache: calculate the number of incremental GC nodes according to the total of btree nodes This patch base on "[PATCH] bcache: finish incremental GC". Since incremental GC would stop 100ms when front side I/O comes, so when there are many btree nodes, if GC only processes constant (100) nodes each time, GC would last a long time, and the front I/Os would run out of the buckets (since no new bucket can be allocated during GC), and I/Os be blocked again. So GC should not process constant nodes, but varied nodes according to the number of btree nodes. In this patch, GC is divided into constant (100) times, so when there are many btree nodes, GC can process more nodes each time, otherwise GC will process less nodes each time (but no less than MIN_GC_NODES). Signed-off-by: Tang Junhui Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 5c25c4fc74af40657606dd01df27cc5eb9efb26c Author: Tang Junhui Date: Thu Jul 26 12:17:34 2018 +0800 bcache: finish incremental GC In GC thread, we record the latest GC key in gc_done, which is expected to be used for incremental GC, but in currently code, we didn't realize it. When GC runs, front side IO would be blocked until the GC over, it would be a long time if there is a lot of btree nodes. This patch realizes incremental GC, the main ideal is that, when there are front side I/Os, after GC some nodes (100), we stop GC, release locker of the btree node, and go to process the front side I/Os for some times (100 ms), then go back to GC again. By this patch, when we doing GC, I/Os are not blocked all the time, and there is no obvious I/Os zero jump problem any more. Patch v2: Rename some variables and macros name as Coly suggested. Signed-off-by: Tang Junhui Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 99a27d59bd7b2ce1a82a4e826e8e7881f4d4954d Author: Tang Junhui Date: Thu Jul 26 12:17:33 2018 +0800 bcache: simplify the calculation of the total amount of flash dirty data Currently we calculate the total amount of flash only devices dirty data by adding the dirty data of each flash only device under registering locker. It is very inefficient. In this patch, we add a member flash_dev_dirty_sectors in struct cache_set to record the total amount of flash only devices dirty data in real time, so we didn't need to calculate the total amount of dirty data any more. Signed-off-by: Tang Junhui Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit dc30b96ab6d569060741572cf30517d3179429a8 Author: Markus Stockhausen Date: Fri Jul 27 09:09:53 2018 -0600 readahead: stricter check for bdi io_pages ondemand_readahead() checks bdi->io_pages to cap the maximum pages that need to be processed. This works until the readit section. If we would do an async only readahead (async size = sync size) and target is at beginning of window we expand the pages by another get_next_ra_size() pages. Btrace for large reads shows that kernel always issues a doubled size read at the beginning of processing. Add an additional check for io_pages in the lower part of the func. The fix helps devices that hard limit bio pages and rely on proper handling of max_hw_read_sectors (e.g. older FusionIO cards). For that reason it could qualify for stable. Fixes: 9491ae4a ("mm: don't cap request size based on read-ahead setting") Cc: stable@vger.kernel.org Signed-off-by: Markus Stockhausen stockhausen@collogia.de Signed-off-by: Jens Axboe commit 330e5f2425ad6857eb2505b0ca435057c8310c9a Author: Todd Poynor Date: Thu Jul 26 20:07:37 2018 -0700 staging: gasket: don't print device addresses as kernel pointers Print device addresses as unsigned long, not as kernel pointers. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e8742fc322ab699862cfe585afbce5dbc59aa4f0 Author: Todd Poynor Date: Thu Jul 26 20:07:36 2018 -0700 staging: gasket: TODO: remove entry for convert to standard logging Gasket/apex drivers now use standard logging, remove TODO entry for this. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 76fe4ae0e758fd20ea732b85c1733c4fb2d1745a Author: Todd Poynor Date: Thu Jul 26 20:07:35 2018 -0700 staging: gasket: remove gasket logging header Gasket logging functions no longer used. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 3ed768ea90ec270d26d9da81bcc6798cddb87343 Author: Todd Poynor Date: Thu Jul 26 20:07:34 2018 -0700 staging: gasket: apex: convert to standard logging Drop gasket logging calls in favor of standard logging. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 0f647805c070c5d74b91ae1f914d7fabc485cbc8 Author: Todd Poynor Date: Thu Jul 26 20:07:33 2018 -0700 staging: gasket: sysfs: convert to standard logging Drop gasket logging calls in favor of standard logging. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit c423d3447874929fd8ec0211a54085b1f1446b45 Author: Todd Poynor Date: Thu Jul 26 20:07:32 2018 -0700 staging: gasket: page table: convert to standard logging Replace gasket logging calls with standard logging calls. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e25bed80b618c41bcb3ec1db38f373f91aed2550 Author: Todd Poynor Date: Thu Jul 26 20:07:31 2018 -0700 staging: gasket: ioctl: convert to standard logging Replace gasket logging calls with standard logging calls. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 952b02a281764f41491759e529e62a59628133b5 Author: Todd Poynor Date: Thu Jul 26 20:07:30 2018 -0700 staging: gasket: interrupt: convert to standard logging Convert gasket logging calls to standard functions. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 803ff424e46260d058daa998cc474639ca017f38 Author: Todd Poynor Date: Thu Jul 26 20:07:29 2018 -0700 staging: gasket: core: convert to standard logging Use standard logging functions, drop use of gasket log functions. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 6cefe675f12f1b53f963f6b867d40aa4237a35d9 Author: Todd Poynor Date: Thu Jul 26 20:07:28 2018 -0700 staging: gasket: save struct device for a gasket device Save the struct device pointer to a gasket device in gasket's metadata, to facilitate use of standard logging calls and in anticipation of non-PCI gasket devices in the future. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit f1e582ebfd703ea01dc4caf4d339b7c84ec3ff29 Author: Alex Deucher Date: Wed Jul 25 15:11:34 2018 -0500 drm/amdgpu: implement harvesting support for UVD 7.2 (v3) Properly handle cases where one or more instance of the IP block may be harvested. v2: make sure ip_num_rings is initialized amdgpu_queue_mgr.c v3: rebase on Christian's UVD changes, drop unused var Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit d04cc604a66b07eff8fce824fb6c0fdc0875d2e3 Author: Harry Wentland Date: Wed Jul 25 09:45:47 2018 -0400 drm/amd: Add missing fields in atom_integrated_system_info_v1_11 This structure needs to align with structure in atomfirmware table. Update it. Signed-off-by: Harry Wentland Acked-by: Alex Deucher Reviewed-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit 116f451c90a94de6203757c117278b99a837d3b5 Author: Harry Wentland Date: Mon Jul 9 17:26:34 2018 -0400 drm/amd/display: DC 3.1.59 Signed-off-by: Harry Wentland Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 9907704174e0ad4ed02766fac4049971e583323d Author: Anthony Koo Date: Tue Jul 17 09:43:44 2018 -0400 drm/amd/display: Prevent PSR from being enabled if initialization fails [Why] PSR_SET command is sent to the microcontroller in order to initialize parameters needed for PSR feature, such as telling the microcontroller which pipe is driving the PSR supported panel. When this command is skipped or fails, the microcontroller may program the wrong thing if driver tries to enable PSR. [How] If PSR_SET fails, do not set psr_enable flag to indicate the feature is not yet initialized. Signed-off-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit f358b39d187500717b4bc8633cef45d87eff0a3e Author: Jerry (Fangzhi) Zuo Date: Tue Jul 17 11:53:54 2018 -0400 drm/amd/display: Fix Vega10 black screen after mode change [Why] The sequence is slightly changed when bring .set_bandwidth out from the end of programming backend to the end of programming surface. Vega10 doesn't like to get clocks updated if stream_count is zero in the current context (Atomic Reset). [How] Do not update clocks if no stream is showing up in the context. Fixes 1b2b130192 "dc: Remove 300Mhz minimum disp clk limit." Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Tony Cheng Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 65c78961b30005447a0d9b285de93354d8308f34 Author: Bhawanpreet Lakha Date: Thu Jun 28 17:50:05 2018 -0400 drm/amd/display: flatten aux_engine and engine [Why] engine and aux_engine are unnecessary layers we want to remove this layer. [How] flatten engine and aux engine structs into one struct called aux_engine and remove all references to the engine struct. Signed-off-by: Bhawanpreet Lakha Reviewed-by: Harry Wentland Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 824474ba38e27ccacc9d2dd066f780e9b3c2ad78 Author: Bhawanpreet Lakha Date: Fri Jul 13 18:00:06 2018 -0400 drm/amd/display: Retry link training again [Why] Some receivers seem to fail the first link training but are good on subsequent tries. We want to retry link training again. This fixes HTC vive pro not lighting up after being disabled. [How] Check if the link training passed without fall back if this is not the case then we retry link training. Signed-off-by: Bhawanpreet Lakha Reviewed-by: Harry Wentland Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher commit 66c28d6df2d8292098839d365b82a1e30b567211 Author: Christian König Date: Wed Jul 18 14:52:42 2018 +0200 drm/amdgpu: patch the IBs for the second UVD instance v2 Patch the IBs for the second UVD instance so that userspace don't need to care about the instance they submit to. v2: use direct IB patching Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-and-tested-by: James Zhu Signed-off-by: Alex Deucher commit 9d248517d4bd807c7690d55d0b6f54618fc60942 Author: Christian König Date: Mon Jul 23 16:01:39 2018 +0200 drm/amdgpu: add support for inplace IB patching for MM engines v2 We are going to need that for the second UVD instance on Vega20. v2: rename to patch_cs_in_place Signed-off-by: Christian König Reviewed-and-tested-by: James Zhu Signed-off-by: Alex Deucher commit ba70ffa7d20d771ae47a1597799da84980aafe15 Merge: c5157101e779 809092dc3e60 Author: Will Deacon Date: Fri Jul 27 14:39:04 2018 +0100 Merge branch 'for-next/perf' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into aarch64/for-next/core Pull in arm perf updates, including support for 64-bit (chained) event counters and some non-critical fixes for some of the system PMU drivers. Signed-off-by: Will Deacon commit 87107a25a2f857693156f075da6e2a1438f4b4a0 Author: Steven Rostedt (VMware) Date: Thu Jul 26 12:07:32 2018 -0400 tracing/kprobes: Simplify the logic of enable_trace_kprobe() The function enable_trace_kprobe() performs slightly differently if the file parameter is passed in as NULL on non-NULL. Instead of checking file twice, move the code between the two tests into a static inline helper function to make the code easier to follow. Link: http://lkml.kernel.org/r/20180725224728.7b1d5db2@vmware.local.home Link: http://lkml.kernel.org/r/20180726121152.4dd54330@gandalf.local.home Reviewed-by: Josh Poimboeuf Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 4070fc9ade52f7d0ad1397fe74f564ae95e68a4f Author: Niklas Söderlund Date: Thu Jul 26 18:36:57 2018 -0400 media: rcar-csi2: update stream start for V3M Latest errata document updates the start procedure for V3M. This change in addition to adhering to the datasheet update fixes capture on early revisions of V3M. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d81dc82e0f19a3155935e10b752967335e6cbbef Merge: d72e90f33aa4 b63b3439b856 Author: Joerg Roedel Date: Fri Jul 27 14:49:40 2018 +0200 Merge branch 'for-joerg/arm-smmu/updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into arm/smmu commit 5bfffa0c86915e5afbfe56d9790457b2a9887f2d Author: Jia-Ju Bai Date: Thu Jul 26 23:44:24 2018 -0400 media: pci: ivtv: Replace GFP_ATOMIC with GFP_KERNEL ivtv_probe() and ivtvfb_init_card() are never called in atomic context. They call kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9d08ba6de0c52d87b1f9619df3f6faacde2134b7 Author: Jia-Ju Bai Date: Thu Jul 26 23:41:50 2018 -0400 media: pci: cx88: Replace mdelay() with msleep() in dvb_register() dvb_register() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dddaf754cb3af9fe779be1f6e117dc76e36cfdc2 Author: Jia-Ju Bai Date: Thu Jul 26 23:38:23 2018 -0400 media: pci: cx88: Replace mdelay() with msleep() in cx88_card_setup_pre_i2c() cx88_card_setup_pre_i2c() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 65155a9bbc18e4312a989a13c137c7410e1568dd Author: Jia-Ju Bai Date: Thu Jul 26 23:22:09 2018 -0400 media: pci: cx25821: Replace mdelay() with msleep() cx25821_gpio_init(), cx25821_initialize() and cx25821_registers_init() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 71be8dee6bf13a00bab0f568ce403b3c28c5295f Author: Jia-Ju Bai Date: Thu Jul 26 23:18:46 2018 -0400 media: pci: cx23885: Replace mdelay() with msleep() in cx23885_reset() cx23885_reset() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9095b23fc2a1f64b774368a12cc91b941e200512 Author: Jia-Ju Bai Date: Thu Jul 26 23:15:34 2018 -0400 media: pci: cx23885: Replace mdelay() with msleep() and usleep_range() in cx23885_gpio_setup() cx23885_gpio_setup() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ccb2ca78a7278ec0024f281fdc2155b32f995cef Author: Jia-Ju Bai Date: Thu Jul 26 23:09:46 2018 -0400 media: pci: cx23885: Replace mdelay() with msleep() and usleep_range() in altera_ci_slot_reset() altera_ci_slot_reset() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c5157101e7793b42a56e07368c7f4cb73fb58008 Author: Ben Hutchings Date: Thu Jul 12 00:18:22 2018 +0100 arm64: mm: Export __sync_icache_dcache() for xen-privcmd The xen-privcmd driver, which can be modular, calls set_pte_at() which in turn may call __sync_icache_dcache(). The call to __sync_icache_dcache() may be optimised out because it is conditional on !pte_special(), and xen-privcmd calls pte_mkspecial(). But it seems unwise to rely on this optimisation. Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE") Acked-by: Catalin Marinas Signed-off-by: Ben Hutchings Signed-off-by: Will Deacon commit da27ef68751f804dbe6c2b84a49848f90ae48fd0 Author: Jia-Ju Bai Date: Thu Jul 26 23:07:04 2018 -0400 media: pci: cobalt: Replace GFP_ATOMIC with GFP_KERNEL in cobalt_probe() cobalt_probe() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a8a4d304b1a41105568c1408e4276cd6f32be787 Author: Jia-Ju Bai Date: Thu Jul 26 23:02:40 2018 -0400 media: i2c: vs6624: Replace mdelay() with msleep() and usleep_range() in vs6624_probe() vs6624_probe() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2b5c5798750180a34cb1f39cf648d8a8bceec287 Author: Jia-Ju Bai Date: Thu Jul 26 22:58:43 2018 -0400 media: i2c: adv7842: Replace mdelay() with msleep() and usleep_range() in adv7842_ddr_ram_test() adv7842_ddr_ram_test() is never called in atomic context. It only calls from: adv7842_ddr_ram_test() <- adv7842_command_ram_test() <- adv7842_ioctl() adv7842_ddr_ram_test() calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 17f330ce9e434333a98b0fbc7b6d5ddbe0cc6770 Author: Matt Ranostay Date: Thu Jul 26 21:47:24 2018 -0400 media: video-i2c: hwmon: fix return value from amg88xx_hwmon_init() PTR_ERR was making any pointer passed an error pointer, and should be replaced with PTR_ERR_OR_ZERO which checks if is an actual error condition. Signed-off-by: Matt Ranostay Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 38566d28ea9114f9019e7f9804d6db5cd98bf6dd Author: Niklas Söderlund Date: Thu Jul 26 06:27:16 2018 -0400 media: adv7180: add g_frame_interval support Implement g_frame_interval to return the current standard's frame interval. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6457b6263f0f11a9bff4e03a0141820ae9c81460 Author: Niklas Söderlund Date: Thu Jul 26 06:27:15 2018 -0400 media: adv7180: fix field type to V4L2_FIELD_ALTERNATE The ADV7180 and ADV7182 transmit whole fields, bottom field followed by top (or vice-versa, depending on detected video standard). So for chips that do not have support for explicitly setting the field mode via I2P, set the field mode to V4L2_FIELD_ALTERNATE. I2P converts fields into frames using an edge adaptive algorithm. The frame rate is the same as the 'field rate': e.g. X fields per second are now X frames per second. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ddc5c1f799123224a8e02c49d992f962bed225f3 Author: Ezequiel Garcia Date: Wed Jul 25 17:01:23 2018 -0400 media: rockchip/rga: Fix bad dma_free_attrs() parameter In rga_remove(), dma_free_attrs is being passed the wrong cpu address, which triggers an exception if the driver is removed. Fix it. Tested on a RK3399 platform, with a bind/unbind cycle. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 87e1a881e1fe3bfd89903c54ae0d6d6adedb76f1 Author: Hans Verkuil Date: Wed Jul 25 08:51:39 2018 -0400 media: media.h: remove linux/version.h include The media.h public header is one of only three public headers that include linux/version.h. Drop it from media.h. It was only used for an obsolete define. It has to be added to media-device.c, since that source relied on media.h to include it. Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 43bd1dce39cea87a75e8691aad4ce11a9b457d8e Author: Nicolas Dufresne Date: Fri Jul 20 10:09:16 2018 -0400 media: vivid: Fix V4L2_FIELD_ALTERNATE new frame check The vivid driver will overlay stream time on generated frames. Though, in interlacing mode V4L2_FIELD_ALTERNATE, each field is separate and must have the same time to ensure proper render. Though, this time was only updated every 2 frames as the code was checking against the wrong counter (frame counter rather then field counter). Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a4789089937941959be6c18fa53e1fc0189257fd Author: Gustavo A. R. Silva Date: Wed Jul 18 12:19:08 2018 -0500 crypto: rmd320 - use swap macro in rmd320_transform Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Herbert Xu commit d75f482eaface11dd30e73977c245fab5e07c3aa Author: Gustavo A. R. Silva Date: Wed Jul 18 12:12:00 2018 -0500 crypto: rmd256 - use swap macro in rmd256_transform Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Herbert Xu commit 6b0daa78207b622d768cce2a8251c830256bade9 Author: Eric Biggers Date: Tue Jul 17 10:09:26 2018 -0700 crypto: arm64/sha256 - increase cra_priority of scalar implementations Commit b73b7ac0a774 ("crypto: sha256_generic - add cra_priority") gave sha256-generic and sha224-generic a cra_priority of 100, to match the convention for generic implementations. But sha256-arm64 and sha224-arm64 also have priority 100, so their order relative to the generic implementations became ambiguous. Therefore, increase their priority to 125 so that they have higher priority than the generic implementations but lower priority than the NEON implementations which have priority 150. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit faa16bc404d72a5afb857c924c83a5f691f83386 Author: Krzysztof Kozlowski Date: Tue Jul 17 18:05:41 2018 +0200 lib: Use existing define with polynomial Do not define again the polynomial but use header with existing define. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 9ecdb984195378be87e185c2dee80129c5cbf140 Author: Krzysztof Kozlowski Date: Tue Jul 17 18:05:40 2018 +0200 staging: rtl: Use existing define with polynomial Do not define again the polynomial but use header with existing define. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 5d258b48efbd0e28d9d0b5dc31de21050608e351 Author: Krzysztof Kozlowski Date: Tue Jul 17 18:05:39 2018 +0200 net: ethernet: Use existing define with polynomial Do not define again the polynomial but use header with existing define. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit f7aee87822fdb7c43b9510e196cb74cc1bb9bb1e Author: Krzysztof Kozlowski Date: Tue Jul 17 18:05:38 2018 +0200 crypto: stm32_crc32 - Use existing define with polynomial Do not define again the polynomial but use header with existing define. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit e37f2f93afe594682702439ca34eb8130598cdf2 Author: Krzysztof Kozlowski Date: Tue Jul 17 18:05:37 2018 +0200 lib/crc: Use consistent naming for CRC-32 polynomials Header was defining CRCPOLY_LE/BE and CRC32C_POLY_LE but in fact all of them are CRC-32 polynomials so use consistent naming. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 1fb2e3f276ddafee81073d884f599cd2574c31e2 Author: Krzysztof Kozlowski Date: Tue Jul 17 18:05:36 2018 +0200 lib/crc: Move polynomial definition to separate header Allow other drivers and parts of kernel to use the same define for CRC32 polynomial, instead of duplicating it in many places. This code does not bring any functional changes, except moving existing code. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit d96542ac1020ecd47d2a1668384694789b65cb91 Author: Timur Tabi Date: Mon Jul 16 11:20:27 2018 +0530 crypto: qcom-rng - Add ACPI support Add support for probing on ACPI systems, with ACPI HID QCOM8160. On ACPI systems, clocks are always enabled, the PRNG should already be enabled, and the register region is read-only. The driver only verifies that the hardware is already enabled never tries to disable or configure it. Signed-off-by: Timur Tabi Tested-by: Jeffrey Hugo [port to crypto API] Signed-off-by: Vinod Koul Signed-off-by: Herbert Xu commit ba3ab6371cdda214bf3d416edae62809a68d0b73 Author: Vinod Koul Date: Mon Jul 16 11:20:26 2018 +0530 crypto: qcom-rng - Add support for prng-ee Qcom 8996 and later chips features multiple Execution Environments (EE) and secure world is typically responsible for configuring the prng. Add driver data for qcom,prng as 0 and qcom,prng-ee as 1 and use that to skip initialization routine. Signed-off-by: Vinod Koul Signed-off-by: Herbert Xu commit 3be36ce13c9276eb045a55184ff5c08511adb30b Author: Vinod Koul Date: Mon Jul 16 11:20:25 2018 +0530 dt-bindings: crypto: Add new compatible qcom, prng-ee Later qcom chips support v2 of the prng, which exposes an EE (Execution Environment) for OS to use so add new compatible qcom,prng-ee for this. Signed-off-by: Vinod Koul Signed-off-by: Herbert Xu commit ceec5f5b59882b871a722ca4d49b767a09a4bde9 Author: Vinod Koul Date: Mon Jul 16 11:20:24 2018 +0530 crypto: qcom-rng - Add Qcom prng driver This ports the Qcom prng from older hw_random driver. No change of functionality and move from hw_random to crypto APIs is done. Reviewed-by: Linus Walleij Signed-off-by: Vinod Koul Signed-off-by: Herbert Xu commit d978b031c5886f18341cb4b609b150d81ad0faf4 Author: Vinod Koul Date: Mon Jul 16 11:20:23 2018 +0530 dt-bindings: crypto: Move prng binding to crypto Now that we are adding new driver for prng in crypto, move the binding as well. Signed-off-by: Vinod Koul Signed-off-by: Herbert Xu commit 5a2c3a395ab3c3f4f9e3c7864603478bc22dc344 Author: Vinod Koul Date: Mon Jul 16 11:20:22 2018 +0530 hwrng: msm - remove msm hw_random driver This driver is for a psedo-rng so should not be added in hwrng. Remove it so that it's replacement can be added. Signed-off-by: Vinod Koul Signed-off-by: Herbert Xu commit 915ffab02193371e99453ac94160d69ef58273bc Author: Mauro Carvalho Chehab Date: Fri Jul 27 07:01:03 2018 -0400 media: media.h.rst.exceptions: ignore MEDIA-ENT-F-DTV-DECODER This was kept just for backward compatibility. Solves this warning: media.h.rst:6: WARNING: undefined label: media-ent-f-dtv-decoder (if the link has no caption the label must precede a section header) Signed-off-by: Mauro Carvalho Chehab commit 0dff710d1f939c3ca42960769431cf20c095dbce Author: Philipp Zabel Date: Thu Jul 19 06:45:10 2018 -0400 media: coda: add SPS fixup code for frame sizes that are not multiples of 16 The CODA7541 firmware does not set the SPS frame cropping fields to properly describe coded h.264 streams with frame sizes that are not a multiple of the macroblock size. This adds RBSP parsing code and a SPS fixup routine to manually replace the cropping information in the headers produced by the firmware with the correct values. Signed-off-by: Philipp Zabel [hans.verkuil@cisco.com: added explanation of SPS RBSP to comment] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7988b2532aca7463149eea701530d9bafc64619e Author: Philipp Zabel Date: Thu Jul 19 06:42:28 2018 -0400 media: coda: let CODA960 firmware set frame cropping in SPS header When encoding h.264, if visible resolution is not aligned to macroblock size, frame cropping has to be set in the SPS header to produce correct streams. The CODA960 firmware can do this on its own if asked to. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 06b168aeb5096530c1dde1804a076d85f01bd122 Author: Hans Verkuil Date: Fri Jul 27 06:40:45 2018 -0400 media: media-types.rst: fix doc warnings Fix these warnings when building the documentation: media.h.rst:6: WARNING: undefined label: media-ent-f-dv-decoder (if the link has no caption the label must precede a section header) media.h.rst:6: WARNING: undefined label: media-ent-f-dv-encoder (if the link has no caption the label must precede a section header) media.h.rst:6: WARNING: undefined label: media-ent-f-dv-decoder (if the link has no caption the label must precede a section header) Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a00e5f074b3f3cd39d1ccdc53d4d805b014df3f3 Author: Katsuhiro Suzuki Date: Mon May 28 21:09:20 2018 -0400 media: helene: fix xtal frequency setting at power on This patch fixes crystal frequency setting when power on this device. Signed-off-by: Katsuhiro Suzuki Acked-by: Abylay Ospan Signed-off-by: Mauro Carvalho Chehab commit 3976d8d8f9b1f67ee21c5e583ec768b50605f547 Author: Kieran Bingham Date: Mon May 28 06:24:20 2018 -0400 media: vsp1: Document vsp1_dl_body refcnt In commit 2d9445db0ee9 ("media: vsp1: Use reference counting for bodies"), a new field was introduced to the vsp1_dl_body structure to account for usage tracking of the body. Document the newly added field in the kerneldoc. Signed-off-by: Kieran Bingham Reviewed-by: Simon Horman Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit d0dd962d8a4ef4df9b710c4e3a975e6bfd9f0225 Author: Mauro Carvalho Chehab Date: Mon May 28 10:32:41 2018 -0400 media: dvb: get rid of VIDEO_SET_SPU_PALETTE No upstream drivers use it. It doesn't make any sense to have a compat32 code for something that nobody uses upstream. Reported-by: Alexander Viro Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Christoph Hellwig Signed-off-by: Mauro Carvalho Chehab commit e5225c820c057537dc780244760e2e24c7d27366 Author: Guennadi Liakhovetski Date: Thu Jul 26 04:17:53 2018 -0400 media: uvcvideo: Send a control event when a Control Change interrupt arrives UVC defines a method of handling asynchronous controls, which sends a USB packet over the interrupt pipe. This patch implements support for such packets by sending a control event to the user. Since this can involve USB traffic and, therefore, scheduling, this has to be done in a work queue. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 8e7a1dbc7b0ae048bf3f4b9707fe1a845e69aab7 Author: Guennadi Liakhovetski Date: Tue May 8 11:07:44 2018 -0400 media: uvcvideo: Handle control pipe protocol STALLs When a command ends up in a STALL on the control pipe, use the Request Error Code control to provide a more precise error information to the user. For example, if a camera is still busy processing a control, when the same or an interrelated control set request arrives, the camera can react with a STALL and then return the "Not ready" status in response to a UVC_VC_REQUEST_ERROR_CODE_CONTROL command. With this patch the user would then get an EBUSY error code instead of a generic EPIPE. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 222964eaf2472053221341c331eb81e87c8b04f2 Author: Guennadi Liakhovetski Date: Tue May 8 11:07:42 2018 -0400 media: uvcvideo: Remove a redundant check Event subscribers cannot have a NULL file handle. They are only added at a single location in the code, and the .fh pointer is used without checking there. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 95f5cbff90b9e4324839a5c28ee3153a3c9921a5 Author: Nicolas Dufresne Date: Mon Jun 4 20:24:15 2018 -0400 media: uvcvideo: Also validate buffers in BULK mode Just like for ISOC, validate the decoded BULK buffer size when possible. This avoids sending corrupted or partial buffers to userspace, which may lead to application crash or run-time failure. Signed-off-by: Nicolas Dufresne [laurent.pinchart@ideasonboard.com: Move uvc_video_validate_buffer() call to uvc_video_next_buffers()] Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 557a5c7fe6503230f6a3a41441981aed6e897d17 Author: Laurent Pinchart Date: Wed Mar 21 05:16:40 2018 -0400 media: uvcvideo: Add KSMedia 8-bit IR format support Add support for the 8-bit IR format GUID defined in the Microsoft Kernel Streaming Media API. Reported-by: Paul Menzel Signed-off-by: Laurent Pinchart Tested-by: Paul Menzel Signed-off-by: Mauro Carvalho Chehab commit ec55cdba4168d665670335e13697fc01a69f2785 Author: Kieran Bingham Date: Tue Mar 20 11:43:08 2018 -0400 media: uvcvideo: Fix minor spelling Provide the missing 't' from straightforward. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 0900dc319245774ce5f0abcf0484df53457c36b7 Author: Mauro Carvalho Chehab Date: Thu Jun 28 14:43:21 2018 -0400 media: em28xx-cards: disable V4L2 mode for dual tuners Right now, the code that calculates alternate modes is not ready for devices with dual tuners. That's ok, as we currently don't have any such devices, but better to add a warning for such case, as, if anyone adds such device, the logic will need to be reviewed. Signed-off-by: Mauro Carvalho Chehab Acked-by: Brad Love Reviewed-by: Michael Ira Krufky Signed-off-by: Mauro Carvalho Chehab commit 5871f8bc08bc68f7d69820d40f5a0cd50c573cf6 Author: Brad Love Date: Wed Jun 27 11:32:00 2018 -0400 media: em28xx: Remove duplicate PID Half-revert: commit 5b1a270d224b ("media: dvb: add alternative USB PID for Hauppauge WinTV-soloHD")' The PID already exists on the line above. Signed-off-by: Brad Love Signed-off-by: Michael Ira Krufky Signed-off-by: Mauro Carvalho Chehab commit 20cdcaf903298d54b834daedf65a2ddef70cae0a Author: Brad Love Date: Wed Jun 27 11:32:01 2018 -0400 media: em28xx: Fix DualHD disconnect oops During the duplication of em28xx state for the second tuner pair a pointer to alt_max_pkt_size_isoc is copied. During tear down the second tuner is destroyed first and kfrees alt_max_pkt_size_isoc, then the first tuner is destroyed and kfrees it again. The property should only be kfree'd if the tuner is PRIMARY_TS. [ 354.888560] ------------[ cut here ]------------ [ 354.888562] kernel BUG at mm/slub.c:296! [ 354.888574] invalid opcode: 0000 [#1] SMP NOPTI [ 354.888869] CPU: 1 PID: 19 Comm: kworker/1:0 Not tainted 4.18.0-rc1+ #20 [ 354.889140] Hardware name: MSI MS-7A39/B350M GAMING PRO (MS-7A39), BIOS 2.G0 04/27/2018 [ 354.889408] Workqueue: usb_hub_wq hub_event [ 354.889679] RIP: 0010:__slab_free+0x217/0x370 [ 354.889942] Code: bb c0 e8 07 41 38 c7 72 39 48 83 c4 70 5b 41 5a 41 5c 41 5d 41 5e 41 5f 5d 49 8d 62 f8 c3 f3 90 49 8b 04 24 a8 01 75 f6 eb 82 <0f> 0b 44 89 45 80 48 89 4d 88 e8 aa fa ff ff 85 c0 74 cc e9 b7 fe [ 354.890598] RSP: 0018:ffffb84c41a4fad0 EFLAGS: 00010246 [ 354.890934] RAX: ffff948646e85150 RBX: ffff948646e85150 RCX: ffff948646e85150 [ 354.891280] RDX: 00000000820001d9 RSI: fffffa8fd01ba140 RDI: ffff94865e807c00 [ 354.891649] RBP: ffffb84c41a4fb70 R08: 0000000000000001 R09: ffffffffc059ce21 [ 354.892025] R10: ffff948646e85150 R11: 0000000000000001 R12: fffffa8fd01ba140 [ 354.892403] R13: ffff948646e85150 R14: ffff94865e807c00 R15: ffff94864c92e0a0 [ 354.892780] FS: 0000000000000000(0000) GS:ffff94865ec40000(0000) knlGS:0000000000000000 [ 354.893150] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 354.893530] CR2: 00007f4e476da950 CR3: 000000040112c000 CR4: 00000000003406e0 [ 354.893917] Call Trace: [ 354.894315] ? __dev_printk+0x3c/0x80 [ 354.894695] ? _dev_info+0x64/0x80 [ 354.895082] ? em28xx_free_device+0x41/0x50 [em28xx] [ 354.895464] kfree+0x17a/0x190 [ 354.895852] ? kfree+0x17a/0x190 [ 354.896310] em28xx_free_device+0x41/0x50 [em28xx] [ 354.896698] em28xx_usb_disconnect+0xfa/0x110 [em28xx] [ 354.897083] usb_unbind_interface+0x7a/0x270 [ 354.897475] device_release_driver_internal+0x17c/0x250 [ 354.897864] device_release_driver+0x12/0x20 [ 354.898252] bus_remove_device+0xec/0x160 [ 354.898639] device_del+0x13d/0x320 [ 354.899018] ? usb_remove_ep_devs+0x1f/0x30 [ 354.899392] usb_disable_device+0x9e/0x270 [ 354.899772] usb_disconnect+0x92/0x2a0 [ 354.900149] hub_event+0x98e/0x1650 [ 354.900519] ? sched_clock_cpu+0x11/0xa0 [ 354.900890] process_one_work+0x167/0x3f0 [ 354.901251] worker_thread+0x4d/0x460 [ 354.901610] kthread+0x105/0x140 [ 354.901964] ? rescuer_thread+0x360/0x360 [ 354.902318] ? kthread_associate_blkcg+0xa0/0xa0 [ 354.902672] ret_from_fork+0x22/0x40 [ 354.903024] Modules linked in: rc_hauppauge em28xx_rc rc_core si2157 lgdt3306a i2c_mux em28xx_dvb dvb_core videobuf2_vmalloc videobuf2_memops videobuf2_common snd_hda_codec_hdmi nls_iso8859_1 edac_mce_amd kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_seq_midi aesni_intel snd_seq_midi_event aes_x86_64 snd_rawmidi crypto_simd em28xx cryptd glue_helper asix tveeprom usbnet snd_seq v4l2_common mii videodev snd_seq_device media input_leds snd_timer joydev ccp k10temp wmi_bmof snd soundcore mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables vfio_pci vfio_virqfd irqbypass vfio_iommu_type1 vfio nouveau mxm_wmi video i2c_algo_bit ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops i2c_piix4 drm ahci libahci [ 354.905129] wmi gpio_amdpt gpio_generic hid_generic usbhid hid [ 354.908140] ---[ end trace c230d02716298c34 ]--- [ 354.908145] RIP: 0010:__slab_free+0x217/0x370 [ 354.908147] Code: bb c0 e8 07 41 38 c7 72 39 48 83 c4 70 5b 41 5a 41 5c 41 5d 41 5e 41 5f 5d 49 8d 62 f8 c3 f3 90 49 8b 04 24 a8 01 75 f6 eb 82 <0f> 0b 44 89 45 80 48 89 4d 88 e8 aa fa ff ff 85 c0 74 cc e9 b7 fe [ 354.908183] RSP: 0018:ffffb84c41a4fad0 EFLAGS: 00010246 [ 354.908186] RAX: ffff948646e85150 RBX: ffff948646e85150 RCX: ffff948646e85150 [ 354.908189] RDX: 00000000820001d9 RSI: fffffa8fd01ba140 RDI: ffff94865e807c00 [ 354.908191] RBP: ffffb84c41a4fb70 R08: 0000000000000001 R09: ffffffffc059ce21 [ 354.908193] R10: ffff948646e85150 R11: 0000000000000001 R12: fffffa8fd01ba140 [ 354.908195] R13: ffff948646e85150 R14: ffff94865e807c00 R15: ffff94864c92e0a0 [ 354.908198] FS: 0000000000000000(0000) GS:ffff94865ec40000(0000) knlGS:0000000000000000 [ 354.908201] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 354.908203] CR2: 00007f4e476da950 CR3: 000000016b20a000 CR4: 00000000003406e0 Signed-off-by: Brad Love Signed-off-by: Michael Ira Krufky Signed-off-by: Mauro Carvalho Chehab commit a7853c257a3ea0907467a1750ff45de4d9ba1915 Author: Brad Love Date: Thu Jun 28 13:29:09 2018 -0400 media: em28xx: Fix dual transport stream operation Addresses the following, which introduced a regression itself: Commit 509f89652f83 ("media: em28xx: fix a regression with HVR-950") The regression fix breaks dual transport stream support. Currently, when a tuner starts streaming it sets alt mode on the USB interface. The problem is, in a dual tuner model, both tuners share the same USB interface, so when the second tuner becomes active and sets alt mode on the interface it kills streaming on the other port. This patch addresses the regression by only setting alt mode on the USB interface during em28xx_start_streaming, if the device is not a dual tuner model. This allows all older and single tuner devices to explicitly set alt mode during stream startup. Testers report both isoc and bulk DualHD models work correctly with the alt mode set only once, in em28xx_dvb_init. Fixes: 509f89652f83 ("media: em28xx: fix a regression with HVR-950") Signed-off-by: Brad Love Signed-off-by: Michael Ira Krufky Signed-off-by: Mauro Carvalho Chehab commit 64004337d0d8842b8993107c8427b80d6e36646c Author: Hans Verkuil Date: Thu Jul 26 03:11:01 2018 -0400 media: vicodec: current -> cur 'current' is also defined in asm-generic/current.h. When compiling this driver for older kernels with the media_build system, this header is included via compat.h and it no longer compiles. Rename current to cur. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b094e64fbd88dfcde137c2235b58c904ccac00ea Author: Gustavo A. R. Silva Date: Tue May 22 12:20:01 2018 -0400 media: dib0700: add code comment Add FIXME code comment: /* FIXME: check if it is fe_adap[1] */ It is likely that it should be adap->fe_adap[1].fe in the second clause, but this has never been verified. Suggested-by: Mauro Carvalho Chehab Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mauro Carvalho Chehab commit f2047d6044e530c05a618a33d1be09b1498f9e0b Author: Gustavo A. R. Silva Date: Tue May 22 12:04:59 2018 -0400 media: dvb-bt8xx: remove duplicate code The same code is executed regardless of whether c->frequency < 600000000 or c->frequency < 730000000 is true. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mauro Carvalho Chehab commit ada19043e5c6fd66d2b8e11c49e27c55c48f3b7c Author: Wolfram Sang Date: Sun May 20 02:50:34 2018 -0400 media: cx231xx: don't check number of messages in the driver Since commit 1eace8344c02 ("i2c: add param sanity check to i2c_transfer()"), the I2C core does this check now. We can remove it from drivers. Signed-off-by: Wolfram Sang Signed-off-by: Mauro Carvalho Chehab commit a6e65c2ce8970db5a8d0536774ccb9346e69b064 Author: Wolfram Sang Date: Sun May 20 02:50:33 2018 -0400 media: si4713: don't check number of messages in the driver Since commit 1eace8344c02 ("i2c: add param sanity check to i2c_transfer()"), the I2C core does this check now. We can remove it from drivers. Signed-off-by: Wolfram Sang Signed-off-by: Mauro Carvalho Chehab commit 4e4ddfd8e3123cdac71c6f97c35427cc5daeb1bf Author: Wolfram Sang Date: Sun May 20 02:50:35 2018 -0400 media: em28xx: don't check number of messages in the driver Since commit 1eace8344c02 ("i2c: add param sanity check to i2c_transfer()"), the I2C core does this check now. We can remove it from drivers. Signed-off-by: Wolfram Sang Signed-off-by: Mauro Carvalho Chehab commit 0eaddd7cc0ad8a6165345c08cfa62a6833c05830 Author: Wolfram Sang Date: Sun May 20 02:50:36 2018 -0400 media: hdpvr: don't check number of messages in the driver Since commit 1eace8344c02 ("i2c: add param sanity check to i2c_transfer()"), the I2C core does this check now. We can remove it from drivers. Signed-off-by: Wolfram Sang Signed-off-by: Mauro Carvalho Chehab commit decb9f225efda830f2193edcce6b750b7be18150 Author: Wolfram Sang Date: Sun May 20 02:50:38 2018 -0400 media: dvb-usb: don't check number of messages in the driver Since commit 1eace8344c02 ("i2c: add param sanity check to i2c_transfer()"), the I2C core does this check now. We can remove it from drivers. Signed-off-by: Wolfram Sang Signed-off-by: Mauro Carvalho Chehab commit a27c0cad9e658dbc548e6731d9416b793fa68f03 Author: Wolfram Sang Date: Sun May 20 02:50:37 2018 -0400 media: tm6000: don't check number of messages in the driver Since commit 1eace8344c02 ("i2c: add param sanity check to i2c_transfer()"), the I2C core does this check now. We can remove it from drivers. Signed-off-by: Wolfram Sang Signed-off-by: Mauro Carvalho Chehab commit 8f2240cc4e4f2ae564f9235560fca3e2115d77e0 Author: Wolfram Sang Date: Sun May 20 02:50:32 2018 -0400 media: netup_unidvb: don't check number of messages in the driver Since commit 1eace8344c02 ("i2c: add param sanity check to i2c_transfer()"), the I2C core does this check now. We can remove it from drivers. Signed-off-by: Wolfram Sang Signed-off-by: Mauro Carvalho Chehab commit 48db0089bff6f9154f6bd98ce7a6ae3786fa8ebe Author: Mika Båtsman Date: Wed May 16 16:32:19 2018 -0400 media: gl861: fix probe of dvb_usb_gl861 Probe of dvb_usb_gl861 was working at least with v4.4. Noticed the issue with v4.13 but according to similar issues the problem started with v4.9. [ 15.288065] transfer buffer not dma capable [ 15.288090] WARNING: CPU: 2 PID: 493 at drivers/usb/core/hcd.c:1595 usb_hcd_map_urb_for_dma+0x4e2/0x640 ...CUT... [ 15.288791] dvb_usb_gl861: probe of 3-7:1.0 failed with error -5 Tested with MSI Mega Sky 580 DVB-T Tuner [GL861] [mchehab+samsung@kernel.org: rebased on the top of upstream] Cc: stable@vger.kernel.org Signed-off-by: Mika Båtsman Signed-off-by: Mauro Carvalho Chehab commit 443eaa359be191f407bcfd52242cf3ce126d906a Author: Hans Verkuil Date: Wed Jul 25 09:26:04 2018 -0400 media: media-types.rst: codec entities can have more than one source pad Some decoders and encoders can potentially have more than one source pad, so update the description to say 'at least one source pad'. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b63b3439b85609338e4faabd5d2588dbda137e5c Author: Will Deacon Date: Wed Jul 25 15:58:43 2018 +0100 iommu/arm-smmu-v3: Abort all transactions if SMMU is enabled in kdump kernel If we find that the SMMU is enabled during probe, we reset it by re-initialising its registers and either enabling translation or placing it into bypass based on the disable_bypass commandline option. In the case of a kdump kernel, the SMMU won't have been shutdown cleanly by the previous kernel and there may be concurrent DMA through the SMMU. Rather than reset the SMMU to bypass, which would likely lead to rampant data corruption, we can instead configure the SMMU to abort all incoming transactions when we find that it is enabled from within a kdump kernel. Reported-by: Sameer Goel Signed-off-by: Will Deacon commit a71792dee2a33d2e935d4b67dd63924f5ceb203d Author: Zhen Lei Date: Thu Jul 12 17:28:43 2018 +0800 iommu/arm-smmu-v3: Prevent any devices access to memory without registration Stream bypass is a potential security hole since a malicious device can be hotplugged in without matching any drivers, yet be granted the ability to access all of physical memory. Now that we attach devices to domains by default, we can toggle the disable_bypass default to "on", preventing DMA from unknown devices. Signed-off-by: Zhen Lei Signed-off-by: Will Deacon commit fad56c895f1f33f9063da558067307b00d44d40d Author: Jia-Ju Bai Date: Fri Jul 27 17:01:43 2018 +0800 ALSA: ctxfi: cthw20k2: Replace mdelay() with msleep() and usleep_range() hw_pll_init(), hw_dac_stop(), hw_dac_start() and hw_adc_init() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Takashi Iwai commit 08fd8325d94eeddfe49ef8191337e5f54553f6b0 Author: Jia-Ju Bai Date: Fri Jul 27 16:57:56 2018 +0800 ALSA:: ctxfi: cthw20k1: Replace mdelay() with msleep() hw_pll_init(), hw_reset_dac() and hw_card_init() are never called in atomic context. They calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Takashi Iwai commit df3f0347fd856272ca9fdbb6e691b7b512b7acb4 Author: Jia-Ju Bai Date: Fri Jul 27 16:55:28 2018 +0800 ALSA: usb-audio: quirks: Replace mdelay() with msleep() and usleep_range() snd_usb_select_mode_quirk(), snd_usb_set_interface_quirk() and snd_usb_ctl_msg_quirk() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Takashi Iwai commit 76d56d4ab4f2a9e4f085c7d77172194ddaccf7d2 Author: Chao Yu Date: Mon Jun 25 23:29:49 2018 +0800 f2fs: fix to do sanity check with extra_attr feature If FI_EXTRA_ATTR is set in inode by fuzzing, inode.i_addr[0] will be parsed as inode.i_extra_isize, then in __recover_inline_status, inline data address will beyond boundary of page, result in accessing invalid memory. So in this condition, during reading inode page, let's do sanity check with EXTRA_ATTR feature of fs and extra_attr bit of inode, if they're inconsistent, deny to load this inode. - Overview Out-of-bound access in f2fs_iget() when mounting a corrupted f2fs image - Reproduce The following message will be got in KASAN build of 4.18 upstream kernel. [ 819.392227] ================================================================== [ 819.393901] BUG: KASAN: slab-out-of-bounds in f2fs_iget+0x736/0x1530 [ 819.395329] Read of size 4 at addr ffff8801f099c968 by task mount/1292 [ 819.397079] CPU: 1 PID: 1292 Comm: mount Not tainted 4.18.0-rc1+ #4 [ 819.397082] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 819.397088] Call Trace: [ 819.397124] dump_stack+0x7b/0xb5 [ 819.397154] print_address_description+0x70/0x290 [ 819.397159] kasan_report+0x291/0x390 [ 819.397163] ? f2fs_iget+0x736/0x1530 [ 819.397176] check_memory_region+0x139/0x190 [ 819.397182] __asan_loadN+0xf/0x20 [ 819.397185] f2fs_iget+0x736/0x1530 [ 819.397197] f2fs_fill_super+0x1b4f/0x2b40 [ 819.397202] ? f2fs_fill_super+0x1b4f/0x2b40 [ 819.397208] ? f2fs_commit_super+0x1b0/0x1b0 [ 819.397227] ? set_blocksize+0x90/0x140 [ 819.397241] mount_bdev+0x1c5/0x210 [ 819.397245] ? f2fs_commit_super+0x1b0/0x1b0 [ 819.397252] f2fs_mount+0x15/0x20 [ 819.397256] mount_fs+0x60/0x1a0 [ 819.397267] ? alloc_vfsmnt+0x309/0x360 [ 819.397272] vfs_kern_mount+0x6b/0x1a0 [ 819.397282] do_mount+0x34a/0x18c0 [ 819.397300] ? lockref_put_or_lock+0xcf/0x160 [ 819.397306] ? copy_mount_string+0x20/0x20 [ 819.397318] ? memcg_kmem_put_cache+0x1b/0xa0 [ 819.397324] ? kasan_check_write+0x14/0x20 [ 819.397334] ? _copy_from_user+0x6a/0x90 [ 819.397353] ? memdup_user+0x42/0x60 [ 819.397359] ksys_mount+0x83/0xd0 [ 819.397365] __x64_sys_mount+0x67/0x80 [ 819.397388] do_syscall_64+0x78/0x170 [ 819.397403] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 819.397422] RIP: 0033:0x7f54c667cb9a [ 819.397424] Code: 48 8b 0d 01 c3 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ce c2 2b 00 f7 d8 64 89 01 48 [ 819.397483] RSP: 002b:00007ffd8f46cd08 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 [ 819.397496] RAX: ffffffffffffffda RBX: 0000000000dfa030 RCX: 00007f54c667cb9a [ 819.397498] RDX: 0000000000dfa210 RSI: 0000000000dfbf30 RDI: 0000000000e02ec0 [ 819.397501] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 [ 819.397503] R10: 00000000c0ed0000 R11: 0000000000000202 R12: 0000000000e02ec0 [ 819.397505] R13: 0000000000dfa210 R14: 0000000000000000 R15: 0000000000000003 [ 819.397866] Allocated by task 139: [ 819.398702] save_stack+0x46/0xd0 [ 819.398705] kasan_kmalloc+0xad/0xe0 [ 819.398709] kasan_slab_alloc+0x11/0x20 [ 819.398713] kmem_cache_alloc+0xd1/0x1e0 [ 819.398717] dup_fd+0x50/0x4c0 [ 819.398740] copy_process.part.37+0xbed/0x32e0 [ 819.398744] _do_fork+0x16e/0x590 [ 819.398748] __x64_sys_clone+0x69/0x80 [ 819.398752] do_syscall_64+0x78/0x170 [ 819.398756] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 819.399097] Freed by task 159: [ 819.399743] save_stack+0x46/0xd0 [ 819.399747] __kasan_slab_free+0x13c/0x1a0 [ 819.399750] kasan_slab_free+0xe/0x10 [ 819.399754] kmem_cache_free+0x89/0x1e0 [ 819.399757] put_files_struct+0x132/0x150 [ 819.399761] exit_files+0x62/0x70 [ 819.399766] do_exit+0x47b/0x1390 [ 819.399770] do_group_exit+0x86/0x130 [ 819.399774] __x64_sys_exit_group+0x2c/0x30 [ 819.399778] do_syscall_64+0x78/0x170 [ 819.399782] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 819.400115] The buggy address belongs to the object at ffff8801f099c680 which belongs to the cache files_cache of size 704 [ 819.403234] The buggy address is located 40 bytes to the right of 704-byte region [ffff8801f099c680, ffff8801f099c940) [ 819.405689] The buggy address belongs to the page: [ 819.406709] page:ffffea0007c26700 count:1 mapcount:0 mapping:ffff8801f69a3340 index:0xffff8801f099d380 compound_mapcount: 0 [ 819.408984] flags: 0x2ffff0000008100(slab|head) [ 819.409932] raw: 02ffff0000008100 ffffea00077fb600 0000000200000002 ffff8801f69a3340 [ 819.411514] raw: ffff8801f099d380 0000000080130000 00000001ffffffff 0000000000000000 [ 819.413073] page dumped because: kasan: bad access detected [ 819.414539] Memory state around the buggy address: [ 819.415521] ffff8801f099c800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 819.416981] ffff8801f099c880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 819.418454] >ffff8801f099c900: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 819.419921] ^ [ 819.421265] ffff8801f099c980: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 819.422745] ffff8801f099ca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 819.424206] ================================================================== [ 819.425668] Disabling lock debugging due to kernel taint [ 819.457463] F2FS-fs (loop0): Mounted with checkpoint version = 3 The kernel still mounts the image. If you run the following program on the mounted folder mnt, (poc.c) static void activity(char *mpoint) { char *foo_bar_baz; int err; static int buf[8192]; memset(buf, 0, sizeof(buf)); err = asprintf(&foo_bar_baz, "%s/foo/bar/baz", mpoint); int fd = open(foo_bar_baz, O_RDONLY, 0); if (fd >= 0) { read(fd, (char *)buf, 11); close(fd); } } int main(int argc, char *argv[]) { activity(argv[1]); return 0; } You can get kernel crash: [ 819.457463] F2FS-fs (loop0): Mounted with checkpoint version = 3 [ 918.028501] BUG: unable to handle kernel paging request at ffffed0048000d82 [ 918.044020] PGD 23ffee067 P4D 23ffee067 PUD 23fbef067 PMD 0 [ 918.045207] Oops: 0000 [#1] SMP KASAN PTI [ 918.046048] CPU: 0 PID: 1309 Comm: poc Tainted: G B 4.18.0-rc1+ #4 [ 918.047573] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 918.049552] RIP: 0010:check_memory_region+0x5e/0x190 [ 918.050565] Code: f8 49 c1 e8 03 49 89 db 49 c1 eb 03 4d 01 cb 4d 01 c1 4d 8d 63 01 4c 89 c8 4d 89 e2 4d 29 ca 49 83 fa 10 7f 3d 4d 85 d2 74 32 <41> 80 39 00 75 23 48 b8 01 00 00 00 00 fc ff df 4d 01 d1 49 01 c0 [ 918.054322] RSP: 0018:ffff8801e3a1f258 EFLAGS: 00010202 [ 918.055400] RAX: ffffed0048000d82 RBX: ffff880240006c11 RCX: ffffffffb8867d14 [ 918.056832] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff880240006c10 [ 918.058253] RBP: ffff8801e3a1f268 R08: 1ffff10048000d82 R09: ffffed0048000d82 [ 918.059717] R10: 0000000000000001 R11: ffffed0048000d82 R12: ffffed0048000d83 [ 918.061159] R13: ffff8801e3a1f390 R14: 0000000000000000 R15: ffff880240006c08 [ 918.062614] FS: 00007fac9732c700(0000) GS:ffff8801f6e00000(0000) knlGS:0000000000000000 [ 918.064246] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 918.065412] CR2: ffffed0048000d82 CR3: 00000001df77a000 CR4: 00000000000006f0 [ 918.066882] Call Trace: [ 918.067410] __asan_loadN+0xf/0x20 [ 918.068149] f2fs_find_target_dentry+0xf4/0x270 [ 918.069083] ? __get_node_page+0x331/0x5b0 [ 918.069925] f2fs_find_in_inline_dir+0x24b/0x310 [ 918.070881] ? f2fs_recover_inline_data+0x4c0/0x4c0 [ 918.071905] ? unwind_next_frame.part.5+0x34f/0x490 [ 918.072901] ? unwind_dump+0x290/0x290 [ 918.073695] ? is_bpf_text_address+0xe/0x20 [ 918.074566] __f2fs_find_entry+0x599/0x670 [ 918.075408] ? kasan_unpoison_shadow+0x36/0x50 [ 918.076315] ? kasan_kmalloc+0xad/0xe0 [ 918.077100] ? memcg_kmem_put_cache+0x55/0xa0 [ 918.077998] ? f2fs_find_target_dentry+0x270/0x270 [ 918.079006] ? d_set_d_op+0x30/0x100 [ 918.079749] ? __d_lookup_rcu+0x69/0x2e0 [ 918.080556] ? __d_alloc+0x275/0x450 [ 918.081297] ? kasan_check_write+0x14/0x20 [ 918.082135] ? memset+0x31/0x40 [ 918.082820] ? fscrypt_setup_filename+0x1ec/0x4c0 [ 918.083782] ? d_alloc_parallel+0x5bb/0x8c0 [ 918.084640] f2fs_find_entry+0xe9/0x110 [ 918.085432] ? __f2fs_find_entry+0x670/0x670 [ 918.086308] ? kasan_check_write+0x14/0x20 [ 918.087163] f2fs_lookup+0x297/0x590 [ 918.087902] ? f2fs_link+0x2b0/0x2b0 [ 918.088646] ? legitimize_path.isra.29+0x61/0xa0 [ 918.089589] __lookup_slow+0x12e/0x240 [ 918.090371] ? may_delete+0x2b0/0x2b0 [ 918.091123] ? __nd_alloc_stack+0xa0/0xa0 [ 918.091944] lookup_slow+0x44/0x60 [ 918.092642] walk_component+0x3ee/0xa40 [ 918.093428] ? is_bpf_text_address+0xe/0x20 [ 918.094283] ? pick_link+0x3e0/0x3e0 [ 918.095047] ? in_group_p+0xa5/0xe0 [ 918.095771] ? generic_permission+0x53/0x1e0 [ 918.096666] ? security_inode_permission+0x1d/0x70 [ 918.097646] ? inode_permission+0x7a/0x1f0 [ 918.098497] link_path_walk+0x2a2/0x7b0 [ 918.099298] ? apparmor_capget+0x3d0/0x3d0 [ 918.100140] ? walk_component+0xa40/0xa40 [ 918.100958] ? path_init+0x2e6/0x580 [ 918.101695] path_openat+0x1bb/0x2160 [ 918.102471] ? __save_stack_trace+0x92/0x100 [ 918.103352] ? save_stack+0xb5/0xd0 [ 918.104070] ? vfs_unlink+0x250/0x250 [ 918.104822] ? save_stack+0x46/0xd0 [ 918.105538] ? kasan_slab_alloc+0x11/0x20 [ 918.106370] ? kmem_cache_alloc+0xd1/0x1e0 [ 918.107213] ? getname_flags+0x76/0x2c0 [ 918.107997] ? getname+0x12/0x20 [ 918.108677] ? do_sys_open+0x14b/0x2c0 [ 918.109450] ? __x64_sys_open+0x4c/0x60 [ 918.110255] ? do_syscall_64+0x78/0x170 [ 918.111083] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 918.112148] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 918.113204] ? f2fs_empty_inline_dir+0x1e0/0x1e0 [ 918.114150] ? timespec64_trunc+0x5c/0x90 [ 918.114993] ? wb_io_lists_depopulated+0x1a/0xc0 [ 918.115937] ? inode_io_list_move_locked+0x102/0x110 [ 918.116949] do_filp_open+0x12b/0x1d0 [ 918.117709] ? may_open_dev+0x50/0x50 [ 918.118475] ? kasan_kmalloc+0xad/0xe0 [ 918.119246] do_sys_open+0x17c/0x2c0 [ 918.119983] ? do_sys_open+0x17c/0x2c0 [ 918.120751] ? filp_open+0x60/0x60 [ 918.121463] ? task_work_run+0x4d/0xf0 [ 918.122237] __x64_sys_open+0x4c/0x60 [ 918.123001] do_syscall_64+0x78/0x170 [ 918.123759] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 918.124802] RIP: 0033:0x7fac96e3e040 [ 918.125537] Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 09 27 2d 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 7e e0 01 00 48 89 04 24 [ 918.129341] RSP: 002b:00007fff1b37f848 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 [ 918.130870] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fac96e3e040 [ 918.132295] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000122d080 [ 918.133748] RBP: 00007fff1b37f9b0 R08: 00007fac9710bbd8 R09: 0000000000000001 [ 918.135209] R10: 000000000000069d R11: 0000000000000246 R12: 0000000000400c20 [ 918.136650] R13: 00007fff1b37fab0 R14: 0000000000000000 R15: 0000000000000000 [ 918.138093] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd mac_hid i2c_piix4 soundcore ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear 8139too crct10dif_pclmul crc32_pclmul qxl drm_kms_helper syscopyarea aesni_intel sysfillrect sysimgblt fb_sys_fops ttm drm aes_x86_64 crypto_simd cryptd 8139cp glue_helper mii pata_acpi floppy [ 918.147924] CR2: ffffed0048000d82 [ 918.148619] ---[ end trace 4ce02f25ff7d3df5 ]--- [ 918.149563] RIP: 0010:check_memory_region+0x5e/0x190 [ 918.150576] Code: f8 49 c1 e8 03 49 89 db 49 c1 eb 03 4d 01 cb 4d 01 c1 4d 8d 63 01 4c 89 c8 4d 89 e2 4d 29 ca 49 83 fa 10 7f 3d 4d 85 d2 74 32 <41> 80 39 00 75 23 48 b8 01 00 00 00 00 fc ff df 4d 01 d1 49 01 c0 [ 918.154360] RSP: 0018:ffff8801e3a1f258 EFLAGS: 00010202 [ 918.155411] RAX: ffffed0048000d82 RBX: ffff880240006c11 RCX: ffffffffb8867d14 [ 918.156833] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff880240006c10 [ 918.158257] RBP: ffff8801e3a1f268 R08: 1ffff10048000d82 R09: ffffed0048000d82 [ 918.159722] R10: 0000000000000001 R11: ffffed0048000d82 R12: ffffed0048000d83 [ 918.161149] R13: ffff8801e3a1f390 R14: 0000000000000000 R15: ffff880240006c08 [ 918.162587] FS: 00007fac9732c700(0000) GS:ffff8801f6e00000(0000) knlGS:0000000000000000 [ 918.164203] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 918.165356] CR2: ffffed0048000d82 CR3: 00000001df77a000 CR4: 00000000000006f0 Reported-by: Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 01f9cf6db70f97d92d5e601ad397921014a999ca Author: Chao Yu Date: Mon Jun 25 20:33:24 2018 +0800 f2fs: fix to correct return value of f2fs_trim_fs We should account trimmed block number from __wait_all_discard_cmd in __issue_discard_cmd_range, otherwise trimmed blocks returned by f2fs_trim_fs will be wrong, this patch fixes it. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c77ec61ca0a49544ca81881cc5d5529858f7e196 Author: Chao Yu Date: Sat Jun 23 11:25:19 2018 +0800 f2fs: fix to do sanity check with {sit,nat}_ver_bitmap_bytesize This patch adds to do sanity check with {sit,nat}_ver_bitmap_bytesize during mount, in order to avoid accessing across cache boundary with this abnormal bitmap size. - Overview buffer overrun in build_sit_info() when mounting a crafted f2fs image - Reproduce - Kernel message [ 548.580867] F2FS-fs (loop0): Invalid log blocks per segment (8201) [ 548.580877] F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock [ 548.584979] ================================================================== [ 548.586568] BUG: KASAN: use-after-free in kmemdup+0x36/0x50 [ 548.587715] Read of size 64 at addr ffff8801e9c265ff by task mount/1295 [ 548.589428] CPU: 1 PID: 1295 Comm: mount Not tainted 4.18.0-rc1+ #4 [ 548.589432] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 548.589438] Call Trace: [ 548.589474] dump_stack+0x7b/0xb5 [ 548.589487] print_address_description+0x70/0x290 [ 548.589492] kasan_report+0x291/0x390 [ 548.589496] ? kmemdup+0x36/0x50 [ 548.589509] check_memory_region+0x139/0x190 [ 548.589514] memcpy+0x23/0x50 [ 548.589518] kmemdup+0x36/0x50 [ 548.589545] f2fs_build_segment_manager+0x8fa/0x3410 [ 548.589551] ? __asan_loadN+0xf/0x20 [ 548.589560] ? f2fs_sanity_check_ckpt+0x1be/0x240 [ 548.589566] ? f2fs_flush_sit_entries+0x10c0/0x10c0 [ 548.589587] ? __put_user_ns+0x40/0x40 [ 548.589604] ? find_next_bit+0x57/0x90 [ 548.589610] f2fs_fill_super+0x194b/0x2b40 [ 548.589617] ? f2fs_commit_super+0x1b0/0x1b0 [ 548.589637] ? set_blocksize+0x90/0x140 [ 548.589651] mount_bdev+0x1c5/0x210 [ 548.589655] ? f2fs_commit_super+0x1b0/0x1b0 [ 548.589667] f2fs_mount+0x15/0x20 [ 548.589672] mount_fs+0x60/0x1a0 [ 548.589683] ? alloc_vfsmnt+0x309/0x360 [ 548.589688] vfs_kern_mount+0x6b/0x1a0 [ 548.589699] do_mount+0x34a/0x18c0 [ 548.589710] ? lockref_put_or_lock+0xcf/0x160 [ 548.589716] ? copy_mount_string+0x20/0x20 [ 548.589728] ? memcg_kmem_put_cache+0x1b/0xa0 [ 548.589734] ? kasan_check_write+0x14/0x20 [ 548.589740] ? _copy_from_user+0x6a/0x90 [ 548.589744] ? memdup_user+0x42/0x60 [ 548.589750] ksys_mount+0x83/0xd0 [ 548.589755] __x64_sys_mount+0x67/0x80 [ 548.589781] do_syscall_64+0x78/0x170 [ 548.589797] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 548.589820] RIP: 0033:0x7f76fc331b9a [ 548.589821] Code: 48 8b 0d 01 c3 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ce c2 2b 00 f7 d8 64 89 01 48 [ 548.589880] RSP: 002b:00007ffd4f0a0e48 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 [ 548.589890] RAX: ffffffffffffffda RBX: 000000000146c030 RCX: 00007f76fc331b9a [ 548.589892] RDX: 000000000146c210 RSI: 000000000146df30 RDI: 0000000001474ec0 [ 548.589895] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 [ 548.589897] R10: 00000000c0ed0000 R11: 0000000000000206 R12: 0000000001474ec0 [ 548.589900] R13: 000000000146c210 R14: 0000000000000000 R15: 0000000000000003 [ 548.590242] The buggy address belongs to the page: [ 548.591243] page:ffffea0007a70980 count:0 mapcount:0 mapping:0000000000000000 index:0x0 [ 548.592886] flags: 0x2ffff0000000000() [ 548.593665] raw: 02ffff0000000000 dead000000000100 dead000000000200 0000000000000000 [ 548.595258] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 548.603713] page dumped because: kasan: bad access detected [ 548.605203] Memory state around the buggy address: [ 548.606198] ffff8801e9c26480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 548.607676] ffff8801e9c26500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 548.609157] >ffff8801e9c26580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 548.610629] ^ [ 548.612088] ffff8801e9c26600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 548.613674] ffff8801e9c26680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 548.615141] ================================================================== [ 548.616613] Disabling lock debugging due to kernel taint [ 548.622871] WARNING: CPU: 1 PID: 1295 at mm/page_alloc.c:4065 __alloc_pages_slowpath+0xe4a/0x1420 [ 548.622878] Modules linked in: snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd mac_hid i2c_piix4 soundcore ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear 8139too crct10dif_pclmul crc32_pclmul qxl drm_kms_helper syscopyarea aesni_intel sysfillrect sysimgblt fb_sys_fops ttm drm aes_x86_64 crypto_simd cryptd 8139cp glue_helper mii pata_acpi floppy [ 548.623217] CPU: 1 PID: 1295 Comm: mount Tainted: G B 4.18.0-rc1+ #4 [ 548.623219] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 548.623226] RIP: 0010:__alloc_pages_slowpath+0xe4a/0x1420 [ 548.623227] Code: ff ff 01 89 85 c8 fe ff ff e9 91 fc ff ff 41 89 c5 e9 5c fc ff ff 0f 0b 89 f8 25 ff ff f7 ff 89 85 8c fe ff ff e9 d5 f2 ff ff <0f> 0b e9 65 f2 ff ff 65 8b 05 38 81 d2 47 f6 c4 01 74 1c 65 48 8b [ 548.623281] RSP: 0018:ffff8801f28c7678 EFLAGS: 00010246 [ 548.623284] RAX: 0000000000000000 RBX: 00000000006040c0 RCX: ffffffffb82f73b7 [ 548.623287] RDX: 1ffff1003e518eeb RSI: 000000000000000c RDI: 0000000000000000 [ 548.623290] RBP: ffff8801f28c7880 R08: 0000000000000000 R09: ffffed0047fff2c5 [ 548.623292] R10: 0000000000000001 R11: ffffed0047fff2c4 R12: ffff8801e88de040 [ 548.623295] R13: 00000000006040c0 R14: 000000000000000c R15: ffff8801f28c7938 [ 548.623299] FS: 00007f76fca51840(0000) GS:ffff8801f6f00000(0000) knlGS:0000000000000000 [ 548.623302] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 548.623304] CR2: 00007f19b9171760 CR3: 00000001ed952000 CR4: 00000000000006e0 [ 548.623317] Call Trace: [ 548.623325] ? kasan_check_read+0x11/0x20 [ 548.623330] ? __zone_watermark_ok+0x92/0x240 [ 548.623336] ? get_page_from_freelist+0x1c3/0x1d90 [ 548.623347] ? _raw_spin_lock_irqsave+0x2a/0x60 [ 548.623353] ? warn_alloc+0x250/0x250 [ 548.623358] ? save_stack+0x46/0xd0 [ 548.623361] ? kasan_kmalloc+0xad/0xe0 [ 548.623366] ? __isolate_free_page+0x2a0/0x2a0 [ 548.623370] ? mount_fs+0x60/0x1a0 [ 548.623374] ? vfs_kern_mount+0x6b/0x1a0 [ 548.623378] ? do_mount+0x34a/0x18c0 [ 548.623383] ? ksys_mount+0x83/0xd0 [ 548.623387] ? __x64_sys_mount+0x67/0x80 [ 548.623391] ? do_syscall_64+0x78/0x170 [ 548.623396] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 548.623401] __alloc_pages_nodemask+0x3c5/0x400 [ 548.623407] ? __alloc_pages_slowpath+0x1420/0x1420 [ 548.623412] ? __mutex_lock_slowpath+0x20/0x20 [ 548.623417] ? kvmalloc_node+0x31/0x80 [ 548.623424] alloc_pages_current+0x75/0x110 [ 548.623436] kmalloc_order+0x24/0x60 [ 548.623442] kmalloc_order_trace+0x24/0xb0 [ 548.623448] __kmalloc_track_caller+0x207/0x220 [ 548.623455] ? f2fs_build_node_manager+0x399/0xbb0 [ 548.623460] kmemdup+0x20/0x50 [ 548.623465] f2fs_build_node_manager+0x399/0xbb0 [ 548.623470] f2fs_fill_super+0x195e/0x2b40 [ 548.623477] ? f2fs_commit_super+0x1b0/0x1b0 [ 548.623481] ? set_blocksize+0x90/0x140 [ 548.623486] mount_bdev+0x1c5/0x210 [ 548.623489] ? f2fs_commit_super+0x1b0/0x1b0 [ 548.623495] f2fs_mount+0x15/0x20 [ 548.623498] mount_fs+0x60/0x1a0 [ 548.623503] ? alloc_vfsmnt+0x309/0x360 [ 548.623508] vfs_kern_mount+0x6b/0x1a0 [ 548.623513] do_mount+0x34a/0x18c0 [ 548.623518] ? lockref_put_or_lock+0xcf/0x160 [ 548.623523] ? copy_mount_string+0x20/0x20 [ 548.623528] ? memcg_kmem_put_cache+0x1b/0xa0 [ 548.623533] ? kasan_check_write+0x14/0x20 [ 548.623537] ? _copy_from_user+0x6a/0x90 [ 548.623542] ? memdup_user+0x42/0x60 [ 548.623547] ksys_mount+0x83/0xd0 [ 548.623552] __x64_sys_mount+0x67/0x80 [ 548.623557] do_syscall_64+0x78/0x170 [ 548.623562] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 548.623566] RIP: 0033:0x7f76fc331b9a [ 548.623567] Code: 48 8b 0d 01 c3 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ce c2 2b 00 f7 d8 64 89 01 48 [ 548.623632] RSP: 002b:00007ffd4f0a0e48 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 [ 548.623636] RAX: ffffffffffffffda RBX: 000000000146c030 RCX: 00007f76fc331b9a [ 548.623639] RDX: 000000000146c210 RSI: 000000000146df30 RDI: 0000000001474ec0 [ 548.623641] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 [ 548.623643] R10: 00000000c0ed0000 R11: 0000000000000206 R12: 0000000001474ec0 [ 548.623646] R13: 000000000146c210 R14: 0000000000000000 R15: 0000000000000003 [ 548.623650] ---[ end trace 4ce02f25ff7d3df5 ]--- [ 548.623656] F2FS-fs (loop0): Failed to initialize F2FS node manager [ 548.627936] F2FS-fs (loop0): Invalid log blocks per segment (8201) [ 548.627940] F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock [ 548.635835] F2FS-fs (loop0): Failed to initialize F2FS node manager - Location https://elixir.bootlin.com/linux/v4.18-rc1/source/fs/f2fs/segment.c#L3578 sit_i->sit_bitmap = kmemdup(src_bitmap, bitmap_size, GFP_KERNEL); Buffer overrun happens when doing memcpy. I suspect there is missing (inconsistent) checks on bitmap_size. Reported by Wen Xu (wen.xu@gatech.edu) from SSLab, Gatech. Reported-by: Wen Xu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 42bf546c1fe3f3654bdf914e977acbc2b80a5be5 Author: Chao Yu Date: Sat Jun 23 00:12:36 2018 +0800 f2fs: fix to do sanity check with secs_per_zone As Wen Xu reported in below link: https://bugzilla.kernel.org/show_bug.cgi?id=200183 - Overview Divide zero in reset_curseg() when mounting a crafted f2fs image - Reproduce - Kernel message [ 588.281510] divide error: 0000 [#1] SMP KASAN PTI [ 588.282701] CPU: 0 PID: 1293 Comm: mount Not tainted 4.18.0-rc1+ #4 [ 588.284000] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 [ 588.286178] RIP: 0010:reset_curseg+0x94/0x1a0 [ 588.298166] RSP: 0018:ffff8801e88d7940 EFLAGS: 00010246 [ 588.299360] RAX: 0000000000000014 RBX: ffff8801e1d46d00 RCX: ffffffffb88bf60b [ 588.300809] RDX: 0000000000000000 RSI: dffffc0000000000 RDI: ffff8801e1d46d64 [ 588.305272] R13: 0000000000000000 R14: 0000000000000014 R15: 0000000000000000 [ 588.306822] FS: 00007fad85008840(0000) GS:ffff8801f6e00000(0000) knlGS:0000000000000000 [ 588.308456] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 588.309623] CR2: 0000000001705078 CR3: 00000001f30f8000 CR4: 00000000000006f0 [ 588.311085] Call Trace: [ 588.311637] f2fs_build_segment_manager+0x103f/0x3410 [ 588.316136] ? f2fs_commit_super+0x1b0/0x1b0 [ 588.317031] ? set_blocksize+0x90/0x140 [ 588.319473] f2fs_mount+0x15/0x20 [ 588.320166] mount_fs+0x60/0x1a0 [ 588.320847] ? alloc_vfsmnt+0x309/0x360 [ 588.321647] vfs_kern_mount+0x6b/0x1a0 [ 588.322432] do_mount+0x34a/0x18c0 [ 588.323175] ? strndup_user+0x46/0x70 [ 588.323937] ? copy_mount_string+0x20/0x20 [ 588.324793] ? memcg_kmem_put_cache+0x1b/0xa0 [ 588.325702] ? kasan_check_write+0x14/0x20 [ 588.326562] ? _copy_from_user+0x6a/0x90 [ 588.327375] ? memdup_user+0x42/0x60 [ 588.328118] ksys_mount+0x83/0xd0 [ 588.328808] __x64_sys_mount+0x67/0x80 [ 588.329607] do_syscall_64+0x78/0x170 [ 588.330400] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 588.331461] RIP: 0033:0x7fad848e8b9a [ 588.336022] RSP: 002b:00007ffd7c5b6be8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 [ 588.337547] RAX: ffffffffffffffda RBX: 00000000016f8030 RCX: 00007fad848e8b9a [ 588.338999] RDX: 00000000016f8210 RSI: 00000000016f9f30 RDI: 0000000001700ec0 [ 588.340442] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 [ 588.341887] R10: 00000000c0ed0000 R11: 0000000000000206 R12: 0000000001700ec0 [ 588.343341] R13: 00000000016f8210 R14: 0000000000000000 R15: 0000000000000003 [ 588.354891] ---[ end trace 4ce02f25ff7d3df5 ]--- [ 588.355862] RIP: 0010:reset_curseg+0x94/0x1a0 [ 588.360742] RSP: 0018:ffff8801e88d7940 EFLAGS: 00010246 [ 588.361812] RAX: 0000000000000014 RBX: ffff8801e1d46d00 RCX: ffffffffb88bf60b [ 588.363485] RDX: 0000000000000000 RSI: dffffc0000000000 RDI: ffff8801e1d46d64 [ 588.365213] RBP: ffff8801e88d7968 R08: ffffed003c32266f R09: ffffed003c32266f [ 588.366661] R10: 0000000000000001 R11: ffffed003c32266e R12: ffff8801f0337700 [ 588.368110] R13: 0000000000000000 R14: 0000000000000014 R15: 0000000000000000 [ 588.370057] FS: 00007fad85008840(0000) GS:ffff8801f6e00000(0000) knlGS:0000000000000000 [ 588.372099] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 588.373291] CR2: 0000000001705078 CR3: 00000001f30f8000 CR4: 00000000000006f0 - Location https://elixir.bootlin.com/linux/latest/source/fs/f2fs/segment.c#L2147 curseg->zone = GET_ZONE_FROM_SEG(sbi, curseg->segno); If secs_per_zone is corrupted due to fuzzing test, it will cause divide zero operation when using GET_ZONE_FROM_SEG macro, so we should do more sanity check with secs_per_zone during mount to avoid this issue. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 67fce70ba341f772073cac9c3044aa98c69b24fb Author: Chao Yu Date: Fri Jun 22 16:06:59 2018 +0800 f2fs: disable f2fs_check_rb_tree_consistence If there is millions of discard entries cached in rb tree, each sanity check of it can cause very long latency as held cmd_lock blocking other lock grabbers. In other aspect, we have enabled the check very long time, as we see, there is no such inconsistent condition caused by bugs. But still we do not choose to kill it directly, instead, adding an flag to disable the check now, if there is related code change, we can reuse it to detect bugs. Signed-off-by: Yunlei He Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e1da7872f6eda977bd812346bf588c35e4495a1e Author: Chao Yu Date: Tue Jun 5 17:44:11 2018 +0800 f2fs: introduce and spread verify_blkaddr This patch introduces verify_blkaddr to check meta/data block address with valid range to detect bug earlier. In addition, once we encounter an invalid blkaddr, notice user to run fsck to fix, and let the kernel panic. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 24b81dfcb73f2dc21c61502512d1422f15a579dc Author: Arnd Bergmann Date: Wed Jun 20 10:02:19 2018 +0200 f2fs: use timespec64 for inode timestamps The on-disk representation and the vfs both use 64-bit tv_sec values, so let's change the last missing piece in the middle. Signed-off-by: Arnd Bergmann Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6aead1617b3adf2b7e2c56f0f13e4e0ee42ebb4a Author: Chao Yu Date: Thu Jun 21 22:38:28 2018 +0800 f2fs: fix to wait on page writeback before updating page In error path of f2fs_move_rehashed_dirents, inode page could be writeback state, so we should wait on inode page writeback before updating it. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e2e59414aae2c8036dfaa57cf6a578e1694945e8 Author: Jaegeuk Kim Date: Thu Jun 21 11:29:43 2018 -0700 f2fs: assign REQ_RAHEAD to bio for ->readpages As Jens reported, we'd better assign REQ_RAHEAD to bio by the fact that ->readpages is called only from read-ahead. In Documentation/filesystems/vfs.txt, readpages: called by the VM to read pages associated with the address_space object. This is essentially just a vector version of readpage. Instead of just one page, several pages are requested. readpages is only used for read-ahead, so read errors are ignored. If anything goes wrong, feel free to give up. Signed-off-by: Jens Axboe Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2a63531a612f776ea754fee6272fc8f16a06b9d6 Author: Yunlei He Date: Thu Jun 21 14:49:06 2018 +0800 f2fs: fix a hungtask problem caused by congestion_wait This patch fix hungtask problem which can be reproduced as follow: Thread 0~3: while true do touch /xxx/test/file_xxx done Thread 4 write a new checkpoint every three seconds. In the meantime, fio start 16 threads for randwrite. With my debug info, cycles num will exceed 1000 in function f2fs_sync_dirty_inodes, and most of cycle will be dropped into congestion_wait() and sleep more than 20ms. Cycles num reduced to 3 with this patch. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2a96d8ad94ce57cb0072f7a660b1039720c47716 Author: Dan Carpenter Date: Wed Jun 20 13:39:53 2018 +0300 f2fs: Fix uninitialized return in f2fs_ioc_shutdown() "ret" can be uninitialized on the success path when "in == F2FS_GOING_DOWN_FULLSYNC". Fixes: 60b2b4ee2bc0 ("f2fs: Fix deadlock in shutdown ioctl") Signed-off-by: Dan Carpenter Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 5a6154920faf9d3d5a39de1da49c66af9831d270 Author: Jaegeuk Kim Date: Wed Jun 20 21:27:21 2018 -0700 f2fs: don't issue discard commands in online discard is on Actually, we don't need to issue discard commands, if discard is on, as mentioned in the comment. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e2374015f27fe5ee5d5c37966e2faf396cdaaa65 Author: Chao Yu Date: Fri Jun 15 14:45:57 2018 +0800 f2fs: fix to propagate return value of scan_nat_page() As Anatoly Trosinenko reported in bugzilla: How to reproduce: 1. Compile the 73fcb1a370c76 version of the kernel using the config attached 2. Unpack and mount the attached filesystem image as F2FS 3. The kernel will BUG() on mount (BUGs are explicitly enabled in config) [ 2.233612] F2FS-fs (sda): Found nat_bits in checkpoint [ 2.248422] ------------[ cut here ]------------ [ 2.248857] kernel BUG at fs/f2fs/node.c:1967! [ 2.249760] invalid opcode: 0000 [#1] SMP NOPTI [ 2.250219] Modules linked in: [ 2.251848] CPU: 0 PID: 944 Comm: mount Not tainted 4.17.0-rc5+ #1 [ 2.252331] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 2.253305] RIP: 0010:build_free_nids+0x337/0x3f0 [ 2.253672] RSP: 0018:ffffae7fc0857c50 EFLAGS: 00000246 [ 2.254080] RAX: 00000000ffffffff RBX: 0000000000000123 RCX: 0000000000000001 [ 2.254638] RDX: ffff9aa7063d5c00 RSI: 0000000000000122 RDI: ffff9aa705852e00 [ 2.255190] RBP: ffff9aa705852e00 R08: 0000000000000001 R09: ffff9aa7059090c0 [ 2.255719] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9aa705852e00 [ 2.256242] R13: ffff9aa7063ad000 R14: ffff9aa705919000 R15: 0000000000000123 [ 2.256809] FS: 00000000023078c0(0000) GS:ffff9aa707800000(0000) knlGS:0000000000000000 [ 2.258654] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2.259153] CR2: 00000000005511ae CR3: 0000000005872000 CR4: 00000000000006f0 [ 2.259801] Call Trace: [ 2.260583] build_node_manager+0x5cd/0x600 [ 2.260963] f2fs_fill_super+0x66a/0x17c0 [ 2.261300] ? f2fs_commit_super+0xe0/0xe0 [ 2.261622] mount_bdev+0x16e/0x1a0 [ 2.261899] mount_fs+0x30/0x150 [ 2.262398] vfs_kern_mount.part.28+0x4f/0xf0 [ 2.262743] do_mount+0x5d0/0xc60 [ 2.263010] ? _copy_from_user+0x37/0x60 [ 2.263313] ? memdup_user+0x39/0x60 [ 2.263692] ksys_mount+0x7b/0xd0 [ 2.263960] __x64_sys_mount+0x1c/0x20 [ 2.264268] do_syscall_64+0x43/0xf0 [ 2.264560] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 2.265095] RIP: 0033:0x48d31a [ 2.265502] RSP: 002b:00007ffc6fe60a08 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 [ 2.266089] RAX: ffffffffffffffda RBX: 0000000000008000 RCX: 000000000048d31a [ 2.266607] RDX: 00007ffc6fe62fa5 RSI: 00007ffc6fe62f9d RDI: 00007ffc6fe62f94 [ 2.267130] RBP: 00000000023078a0 R08: 0000000000000000 R09: 0000000000000000 [ 2.267670] R10: 0000000000008000 R11: 0000000000000246 R12: 0000000000000000 [ 2.268192] R13: 0000000000000000 R14: 00007ffc6fe60c78 R15: 0000000000000000 [ 2.268767] Code: e8 5f c3 ff ff 83 c3 01 41 83 c7 01 81 fb c7 01 00 00 74 48 44 39 7d 04 76 42 48 63 c3 48 8d 04 c0 41 8b 44 06 05 83 f8 ff 75 c1 <0f> 0b 49 8b 45 50 48 8d b8 b0 00 00 00 e8 37 59 69 00 b9 01 00 [ 2.270434] RIP: build_free_nids+0x337/0x3f0 RSP: ffffae7fc0857c50 [ 2.271426] ---[ end trace ab20c06cd3c8fde4 ]--- During loading NAT entries, we will do sanity check, once the entry info is corrupted, it will cause BUG_ON directly to protect user data from being overwrited. In this case, it will be better to just return failure on mount() instead of panic, so that user can get hint from kmsg and try fsck for recovery immediately rather than after an abnormal reboot. https://bugzilla.kernel.org/show_bug.cgi?id=199769 Reported-by: Anatoly Trosinenko Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 54c55c4e4fc7ec35f96a3b6a626314b0b7256137 Author: Weichao Guo Date: Fri Mar 9 23:10:21 2018 +0800 f2fs: support in-memory inode checksum when checking consistency Enable in-memory inode checksum to protect metadata blocks from in-memory scribbles when checking consistency, which has no performance requirements. Signed-off-by: Weichao Guo Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4e423832a675af671eab9d8a3d96636aa63faa9e Author: Chao Yu Date: Mon Jun 11 18:02:02 2018 +0800 f2fs: fix error path of fill_super In fill_super, if root inode's attribute is incorrect, we need to call f2fs_destroy_stats to release stats memory. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4cac90d5491c9a157909b9d45128997d35624e01 Author: Chao Yu Date: Mon Jun 11 18:02:01 2018 +0800 f2fs: relocate readdir_ra configure initialization readdir_ra is sysfs configuration instead of mount option, so it should not be initialized in default_options(), otherwise after remount, it can be reset to be enabled which may not as user wish, so let's move it to f2fs_tuning_parameters(). Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 0aa7e0f8c0a0246ea7f407e32b7277ec9c084c15 Author: Chao Yu Date: Wed Jun 6 23:55:02 2018 +0800 f2fs: move s_res{u,g}id initialization to default_options() Let default_options() initialize s_res{u,g}id with default value like other options. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 76a45e3c45002836b2ea0711a130403dcd7d8f52 Author: Chao Yu Date: Wed Jun 6 23:55:01 2018 +0800 f2fs: don't acquire orphan ino during recovery During orphan inode recovery, checkpoint should never succeed due to SBI_POR_DOING flag, so we don't need acquire orphan ino which only be used by checkpoint. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a1933c09ef84c2fd187e05b560ddc6e1267d6508 Author: Jaegeuk Kim Date: Sun Jul 15 09:58:08 2018 +0900 f2fs: avoid potential deadlock in f2fs_sbi_store [ 155.018460] ====================================================== [ 155.021431] WARNING: possible circular locking dependency detected [ 155.024339] 4.18.0-rc3+ #5 Tainted: G OE [ 155.026879] ------------------------------------------------------ [ 155.029783] umount/2901 is trying to acquire lock: [ 155.032187] 00000000c4282f1f (kn->count#130){++++}, at: kernfs_remove+0x1f/0x30 [ 155.035439] [ 155.035439] but task is already holding lock: [ 155.038892] 0000000056e4307b (&type->s_umount_key#41){++++}, at: deactivate_super+0x33/0x50 [ 155.042602] [ 155.042602] which lock already depends on the new lock. [ 155.042602] [ 155.047465] [ 155.047465] the existing dependency chain (in reverse order) is: [ 155.051354] [ 155.051354] -> #1 (&type->s_umount_key#41){++++}: [ 155.054768] f2fs_sbi_store+0x61/0x460 [f2fs] [ 155.057083] kernfs_fop_write+0x113/0x1a0 [ 155.059277] __vfs_write+0x36/0x180 [ 155.061250] vfs_write+0xbe/0x1b0 [ 155.063179] ksys_write+0x55/0xc0 [ 155.065068] do_syscall_64+0x60/0x1b0 [ 155.067071] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 155.069529] [ 155.069529] -> #0 (kn->count#130){++++}: [ 155.072421] __kernfs_remove+0x26f/0x2e0 [ 155.074452] kernfs_remove+0x1f/0x30 [ 155.076342] kobject_del.part.5+0xe/0x40 [ 155.078354] f2fs_put_super+0x12d/0x290 [f2fs] [ 155.080500] generic_shutdown_super+0x6c/0x110 [ 155.082655] kill_block_super+0x21/0x50 [ 155.084634] kill_f2fs_super+0x9c/0xc0 [f2fs] [ 155.086726] deactivate_locked_super+0x3f/0x70 [ 155.088826] cleanup_mnt+0x3b/0x70 [ 155.090584] task_work_run+0x93/0xc0 [ 155.092367] exit_to_usermode_loop+0xf0/0x100 [ 155.094466] do_syscall_64+0x162/0x1b0 [ 155.096312] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 155.098603] [ 155.098603] other info that might help us debug this: [ 155.098603] [ 155.102418] Possible unsafe locking scenario: [ 155.102418] [ 155.105134] CPU0 CPU1 [ 155.107037] ---- ---- [ 155.108910] lock(&type->s_umount_key#41); [ 155.110674] lock(kn->count#130); [ 155.113010] lock(&type->s_umount_key#41); [ 155.115608] lock(kn->count#130); Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 83a3bfdb5a8a086290dff2c13409c7380b683a96 Author: Jaegeuk Kim Date: Thu Jun 21 13:46:23 2018 -0700 f2fs: indicate shutdown f2fs to allow unmount successfully Once we shutdown f2fs, we have to flush stale pages in order to unmount the system. In order to make stable, we need to stop fault injection as well. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit af697c0f5c5b8798832e651baf23460d588393de Author: Jaegeuk Kim Date: Wed Jul 11 18:30:42 2018 -0700 f2fs: keep meta pages in cp_error state It turns out losing meta pages in shutdown period makes f2fs very unstable so that I could see many unexpected error conditions. Let's keep meta pages for fault injection and sudden power-off tests. Signed-off-by: Jaegeuk Kim commit 30800b3a1fb14c6f143db5616a4aaea9fef94af3 Author: Marc Zyngier Date: Thu May 31 16:21:43 2018 +0100 irqchip/gic-v3-its: Reduce minimum LPI allocation to 1 for PCI devices Allocating a minimum of 32 LPIs per PCI device, let's reduce it to be just 1, as most devices do not need that many interrupts. We still have to special-case DevID 0, as there is plenty of broken HW around where the PCI RID is not presented as a DevID to the ITS, and all the devices are presented as DevID 0. In this case, we keep the 32 minimal allocation. Signed-off-by: Marc Zyngier commit 1f6ed42c742e8d1cfd3811ef7a134eaa75a511d6 Author: Jimmy Assarsson Date: Fri Feb 16 14:41:06 2018 +0100 can: kvaser_usb: Simplify struct kvaser_cmd_cardinfo serial_number_high can be removed from the struct since it is never used in the USBcan II firmware. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit aec5fb2268b700f3c4e8481ab431eefcd33893f6 Author: Jimmy Assarsson Date: Wed Jul 18 23:29:29 2018 +0200 can: kvaser_usb: Add support for Kvaser USB hydra family This patch adds support for a new Kvaser USB family, denoted hydra. The hydra family currently contains USB devices with one CAN channel up to five. There are devices with and without CAN FD support. Signed-off-by: Jimmy Assarsson Signed-off-by: Christer Beskow Signed-off-by: Nicklas Johansson Signed-off-by: Martin Henriksson Signed-off-by: Marc Kleine-Budde commit 7259124eac7d1b76b41c7a9cb2511a30556deebe Author: Jimmy Assarsson Date: Wed Jul 18 23:29:28 2018 +0200 can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.c First part of adding support for Kvaser USB device family "hydra". Split kvaser_usb.c into kvaser_usb/kvaser_usb{.h,_core.c,_leaf.c}. kvaser_usb_core.c contains common functionality, such as USB writing/reading and allocation of netdev. kvaser_usb_leaf.c contains device specific code, used in kvaser_usb_core.c. struct kvaser_usb_dev_ops contains device specific functions that are common for all devices in the family. While, struct kvaser_usb_dev_cfg describes the device configurations in terms of CAN clock frequency, timestamp frequency and CAN controller bittiming constants. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit e0543f2479f811e431005906462c04a9b582caee Author: Jimmy Assarsson Date: Wed Jul 18 23:29:27 2018 +0200 can: kvaser_usb: Add SPDX GPL-2.0 license identifier Add SPDX GPL-2.0 license identifier to kvaser_usb.c. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 2b049c1500803081e26be46cf5a02d63a3eb13a4 Author: Jimmy Assarsson Date: Wed Jul 18 23:29:26 2018 +0200 can: kvaser_usb: Fix typos Fix some typos. Change can to CAN, when referring to Controller Area Network. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 6ba0b9294bca0fca727198a9660771d06823cf1a Author: Jimmy Assarsson Date: Wed Jul 18 23:29:25 2018 +0200 can: kvaser_usb: Improve logging messages Replace dev->udev->dev.parent with &dev->intf->dev, when it is the first argument passed to dev_* logging function call. This will result in: kvaser_usb 1-2:1.0: Format error compared to usb 1-2: Format error Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 7c47801461777c8cb473cca65202a60b99657313 Author: Jimmy Assarsson Date: Wed Jul 18 23:29:24 2018 +0200 can: kvaser_usb: Refactor kvaser_usb_init_one() Replace first parameter in kvaser_usb_init_one() with a pointer to struct kvaser_usb. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 99ce1bc1746266a20e91417b600533e82d57734d Author: Jimmy Assarsson Date: Wed Jul 18 23:29:23 2018 +0200 can: kvaser_usb: Refactor kvaser_usb_get_endpoints() Replace parameters with struct kvaser_usb pointer. Rename the function from kvaser_usb_get_endpoints() to kvaser_usb_setup_endpoints(). Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 0e30619fd6fae62c58d76e739b8ba7a14c52c4bd Author: Jimmy Assarsson Date: Wed Jul 18 23:29:22 2018 +0200 can: kvaser_usb: Add pointer to struct usb_interface into struct kvaser_usb Add pointer to struct usb_interface into struct kvaser_usb. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 75d2b4c3e399ff8a59dc6e22dc6d281345d51374 Author: Jimmy Assarsson Date: Wed Jul 18 23:29:21 2018 +0200 can: kvaser_usb: Replace USB timeout constants with one define Replace USB timeout constants used when sending and receiving, with a single constant. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit f741f938556da50fda3b74905d65ddd71ee9abc5 Author: Jimmy Assarsson Date: Wed Jul 18 23:29:20 2018 +0200 can: kvaser_usb: Rename message/msg to command/cmd Rename message to command and msg to cmd, where appropriate. To make the code more readable and to better match Kvaser's Linux drivers. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 23757222012170a8b18caba7cf4dfeeee1e2917b Author: Jimmy Assarsson Date: Wed Jul 18 23:29:19 2018 +0200 can: kvaser_usb: Remove unused commands and defines Remove unused commands: struct kvaser_msg_cardinfo2 struct leaf_msg_tx_acknowledge struct usbcan_msg_tx_acknowledge Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit deaa1c984be7c2aa6ae96c6b23a103a25692c543 Author: Jimmy Assarsson Date: Wed Jul 18 23:29:18 2018 +0200 can: kvaser_usb: Remove unnecessary return Remove unnecessary return at end of void function. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 5592cd0390741e6fecfc7908baaeadb4682f3c48 Author: Stephane Grosjean Date: Thu Jun 21 15:23:30 2018 +0200 can: peak_canfd: rearrange the way resources are released This patch improves the sequence the resources are released by, first, - disabling the IRQ in the controller, then by - resetting the DMA logic, and finally, by - adding a read cycle to ensure that the above commands have been received before freeing the system interrupt. Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit d31f8513f252e25be3d4e64fe99d1efd5da3c83a Author: Stephane Grosjean Date: Thu Jun 21 15:23:29 2018 +0200 can: peak_canfd: fix typo in error message This patch fixes a typo in the error message in pciefd_can_probe(). Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit cc5f9bb02ea5891980b532fec7519c90e909c3e0 Author: Stephane Grosjean Date: Thu Jun 21 15:23:28 2018 +0200 can: peak_canfd: use ndev irq instead of pci_dev one This cosmetic change should facilitate in the future the use of MSI rather than legacy INTx interrupts. Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit f6c740f592ac878cb7c19e650c88c29f6b25e761 Author: Stephane Grosjean Date: Thu Jun 21 15:23:27 2018 +0200 can: peak_canfd: remove useless defined symbols CANFD_IRQ_SET as well as CANFD_TX_PATH_SET are not used. Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit 0cccf0abf2daeff3c97c3912049ed175d17df559 Author: Stephane Grosjean Date: Thu Jun 21 15:23:26 2018 +0200 can: peak_canfd: improves 32-bit alignment The embedded firmware aligns its messages on 32-bit boundaries. This patch makes sure to browse through the list of received messages while respecting 32-bit alignment. Signed-off-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde commit f805ed84895abc56e20328ccfe340d4ff74a3983 Author: Gustavo A. R. Silva Date: Thu Jun 28 12:41:42 2018 -0500 can: peak_usb: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Marc Kleine-Budde commit 9e5f1b273e6abdd7f17b15a65ff5414c6c94384b Author: Anssi Hannula Date: Tue Feb 27 10:06:51 2018 +0200 can: xilinx_can: add support for Xilinx CAN FD core Add support for Xilinx CAN FD core. The major difference from the previously supported cores is that there are TX mailboxes instead of a TX FIFO and the RX FIFO access method is different. We only transmit one frame at a time to prevent the HW from reordering frames (it uses CAN ID priority order). Support for CAN FD protocol is not added yet. v2: Removed unnecessary "rx-mode" DT property and wrapped some long lines. Signed-off-by: Anssi Hannula Cc: Michal Simek Signed-off-by: Marc Kleine-Budde commit 1598efe57b3e768056e4ca56cb9cf33111e68d1c Author: Anssi Hannula Date: Mon Feb 26 15:56:51 2018 +0200 can: xilinx_can: refactor code in preparation for CAN FD support Xilinx CAN FD cores are different enough from the previous Zynq and AXI CAN cores that some refactoring of the driver is needed. This commit contains most of the required refactoring to existing code and should not alter behavior on existing supported HW. The changes are: - Reading and writing to frame registers is parametrized to allow reading/writing a different frame in the future. - Slightly misleading (as it did not specify *all* the interrupts supported by the HW) XCAN_INTR_ALL is replaced with specifying the interrupts inline in interrupt enabling code. - xcan_devtype_data.caps is renamed to xcan_devtype_data.flags to allow for flags that define alternative functionality (e.g. mailboxes vs. FIFO) instead of purely additive capabilities. - can_bittiming_const is added to xcan_devtype_data as CAN FD cores will have wider setting ranges. - bus_clk clock name is now determined through xcan_devtype_data instead of comparing compatible string in probe(). - xcan_devtype_data is added to xcan_priv to allow flag checks after probe(). - XCAN_CAP_WATERMARK is now XCAN_FLAG_TXFEMP. CAN FD cores have watermark support but no TXFEMP interrupt, which is what we are actually interested in. - xcan_start_xmit() is split to in two parts to prepare for TX mailboxes instead of FIFO in CAN FD cores. v2: Wrapped some long lines in xcan_write_frame(). Signed-off-by: Anssi Hannula Cc: Michal Simek Signed-off-by: Marc Kleine-Budde commit 7cb0f17f5252874ba0ecbda964e7e01587bf828e Author: Anssi Hannula Date: Fri May 18 15:31:48 2018 +0300 dt-bindings: can: xilinx_can: add Xilinx CAN FD bindings Add compatible string and new attributes to support the Xilinx CAN FD core. Unlike the previously documented Xilinx CAN cores, the CAN FD core has TX mailboxes instead of TX FIFO, and optionally RX mailboxes instead of RX FIFO (selected at core generation time, not switchable at runtime). Add "tx-mailbox-count" and "rx-mailbox-count" to specify the mailbox counts instead of reusing "tx-fifo-depth" and "rx-fifo-depth". The RX FIFO depth is constant 32, but allow it to be specified via "rx-fifo-depth" to match DT usage with Zynq CAN (which has constant RX FIFO of depth of 64). v2: Remove unnecessary "rx-mode" DT property. Signed-off-by: Anssi Hannula Cc: Michal Simek Reviewed-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit 11ee5fcd6af37b1107aa0e8980a40f8e17703c0b Author: Anssi Hannula Date: Mon Feb 26 14:50:35 2018 +0200 can: xilinx_can: update stats.tx_bytes after transmission The driver updates stats.tx_bytes in start_xmit() even though it could do so in TX interrupt handler. Change the code to update tx_bytes in the interrupt handler, using the return value of can_get_echo_skb(). Signed-off-by: Anssi Hannula Cc: Michal Simek Signed-off-by: Marc Kleine-Budde commit 6181dbc02b6c73fd2e07d06bb8766867bb96ebbe Author: Anssi Hannula Date: Mon Jan 29 17:28:24 2018 +0200 can: xilinx_can: use can_change_state() Replace some custom code with a call to can_change_state(). This subtly changes the error reporting behavior when both RX and TX error counters indicate the same state. Previously, if both RX and TX counters indicated the same state: - if overall state is PASSIVE, report CAN_ERR_CRTL_RX_PASSIVE - if overall state is WARNING, report CAN_ERR_CRTL_TX_WARNING or CAN_ERR_CRTL_RX_WARNING depending on which counter is higher, or CAN_ERR_CRTL_RX_WARNING if the counters have the same value. After this commit: - report RX_* or TX_* depending on which counter is higher, or both if the counters have exactly the same value. This behavior is consistent with many other CAN drivers that use this same code pattern. Tested with the integrated CAN on Zynq-7000 SoC. v2: Simplify resolving states as suggested by Andri Yngvason. Signed-off-by: Anssi Hannula Signed-off-by: Marc Kleine-Budde commit 7e2804aae1288643f3d3d5c018feefc98c098509 Author: Anssi Hannula Date: Wed Feb 8 13:32:43 2017 +0200 can: xilinx_can: only report warning and passive states on state changes The xilinx_can driver currently increments error-warning and error-passive statistics on every error interrupt regardless of whether the interface was already in the same state. Similarly, the error frame sent on error interrupts is always sent with CAN_ERR_CRTL_(RX|TX)_(PASSIVE|WARNING) bit set. To make the error-warning and error-passive statistics more useful, add a check to only set the error state when the state has actually been changed. Tested with the integrated CAN on Zynq-7000 SoC. Signed-off-by: Anssi Hannula Signed-off-by: Marc Kleine-Budde commit c8d4dea2a82b0e1c695646aaabdada130ab71f79 Author: Jia-Ju Bai Date: Wed Apr 11 09:43:26 2018 +0800 can: sja1000: Replace mdelay with usleep_range in pcan_add_channels pcan_add_channels() is never called in atomic context. pcan_add_channels() is only called by pcan_probe(), which is only set as ".probe" in struct pcmcia_driver. Despite never getting called from atomic context, pcan_add_channels() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marc Kleine-Budde commit 276b7361bb1be3dccbc10b5be93cfee4bef2249c Author: Jia-Ju Bai Date: Wed Apr 11 09:42:58 2018 +0800 can: sja1000: Replace mdelay with usleep_range in peak_pci_probe peak_pci_probe() is never called in atomic context. peak_pci_probe() is set as ".probe" in struct pci_driver. Despite never getting called from atomic context, peak_pci_probe() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marc Kleine-Budde commit 5b749be31d4ce674c013fb0620fddbce89a0d85f Author: Fabio Estevam Date: Fri Jul 6 14:35:12 2018 -0300 can: flexcan: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Marc Kleine-Budde commit fb1e13e6daf443b5b0bd37f5390961c49e0bb280 Author: Marc Kleine-Budde Date: Thu Apr 26 23:13:38 2018 +0200 can: flexcan: fix flexcan_start_xmit()'s return type The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Marc Kleine-Budde commit 97f2a5893ca539bfc308c8abf0a36d678305c854 Author: Luc Van Oostenryck Date: Thu Apr 26 23:13:38 2018 +0200 can: xilinx: fix xcan_start_xmit()'s return type The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck Acked-by: Michal Simek Signed-off-by: Marc Kleine-Budde commit 79b110bb0b608a4f7d03d6d6a0d8eb03453d65cc Author: Luc Van Oostenryck Date: Thu Apr 26 23:13:37 2018 +0200 can: sun4i: fix sun4ican_start_xmit()'s return type The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck Signed-off-by: Marc Kleine-Budde commit 67c2eef22e2b5cdc45dad51bb36277362c04bccc Author: Luc Van Oostenryck Date: Thu Apr 26 23:13:36 2018 +0200 can: janz-ican3: fix ican3_xmit()'s return type The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck Signed-off-by: Marc Kleine-Budde commit 038709071328ff68a936c6b8c33a24a805eea3c5 Author: Zhu Yi Date: Wed Jun 13 16:37:17 2018 +0200 can: dev: enable multi-queue for SocketCAN devices The existing SocketCAN implementation provides alloc_candev() to allocate a CAN device using a single Tx and Rx queue. This can lead to priority inversion in case the single Tx queue is already full with low priority messages and a high priority message needs to be sent while the bus is fully loaded with medium priority messages. This problem can be solved by using the existing multi-queue support of the network subsytem. The commit makes it possible to use multi-queue in the CAN subsystem in the same way it is used in the Ethernet subsystem by adding an alloc_candev_mqs() call and accompanying macros. With this support a CAN device can use multi-queue qdisc (e.g. mqprio) to avoid the aforementioned priority inversion. The exisiting functionality of alloc_candev() is the same as before. CAN devices need to have prioritized multiple hardware queues or are able to abort waiting for arbitration to make sensible use of multi-queues. Signed-off-by: Zhu Yi Signed-off-by: Mark Jonas Reviewed-by: Heiko Schocher Signed-off-by: Marc Kleine-Budde commit 8551e71d1063edfaab03585e5f78077ec1c85da3 Author: YueHaibing Date: Sat Apr 28 15:49:57 2018 +0800 can: dev: use skb_put_zero to simplfy code use helper skb_put_zero to replace the pattern of skb_put() && memset() Signed-off-by: YueHaibing Signed-off-by: Marc Kleine-Budde commit 9f2d3eae88d26c29d96e42983b755940d9169cd9 Author: Jakob Unterwurzacher Date: Wed Apr 11 18:06:42 2018 +0200 can: ucan: add driver for Theobroma Systems UCAN devices The UCAN driver supports the microcontroller-based USB/CAN adapters from Theobroma Systems. There are two form-factors that run essentially the same firmware: * Seal: standalone USB stick ( https://www.theobroma-systems.com/seal ) * Mule: integrated on the PCB of various System-on-Modules from Theobroma Systems like the A31-µQ7 and the RK3399-Q7 ( https://www.theobroma-systems.com/rk3399-q7 ) The USB wire protocol has been designed to be as generic and hardware-indendent as possible in the hope of being useful for implementation on other microcontrollers. Signed-off-by: Martin Elshuber Signed-off-by: Jakob Unterwurzacher Signed-off-by: Philipp Tomsich Acked-by: Wolfgang Grandegger Signed-off-by: Marc Kleine-Budde commit ffbdd9172ee2f53020f763574b4cdad8d9760a4f Author: Marc Kleine-Budde Date: Wed Apr 25 17:42:00 2018 +0200 can: usb: Kconfig/Makefile: sort alphabetically This patch sorts the entries in the Kconfig and Makefile alphabetically, so that further contributors can generate patches more easily. Signed-off-by: Marc Kleine-Budde commit b7cc4f3e127d1134677ce2e829ddae78ca50ebec Author: Colin Ian King Date: Sat Apr 28 23:16:00 2018 +0100 can: cc770: fix spelling mistake: "comptibility" -> "compatibility" Trivial fix to spelling mistake in module parameter description text Signed-off-by: Colin Ian King Signed-off-by: Marc Kleine-Budde commit 3570a00841fb8a5d2f56ac7c59ccc6c91ea35944 Author: Dan Murphy Date: Tue May 29 15:26:12 2018 -0500 can: uapi: can.h: Fix can error class mask dir path The CAN error masks header file is in the include/uapi directory. Fix the path in the header to the correct location. Signed-off-by: Dan Murphy Signed-off-by: Marc Kleine-Budde commit 2d8bc61952270adab57d84dac8abc8166aee608b Merge: 2d8ff0b586fb 9840fcd8cc43 Author: Greg Kroah-Hartman Date: Fri Jul 27 10:37:08 2018 +0200 Merge tag 'fsi-updates-2018-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/linux-fsi into char-misc-next Ben writes: Last round of FSI updates for 4.19 This adds a few fixes for things reported since the last merge, and the latch batch of changes pending for FSI for 4.19. That batch is a rather mechanical conversion of the misc devices into proper char devices. The misc devices were ill suited, the minor space for them is limited and we can have a lot of chips in a system creating FSI devices. This also allows us to better control (and fix) object lifetime getting rid of the bad devm_kzalloc() of the structures containing the devices etc... Finally, we add a chardev to the core FSI that provides raw CFAM access to FSI slaves as a replacement for the current "raw" binary sysfs file which will be ultimately deprecated and removed. commit fe8166c92a5f154c60fb2741afd247ae7716a6d3 Author: Krzysztof Kozlowski Date: Wed Jul 25 17:53:02 2018 +0200 mfd: sec-core: Export OF module alias table In case of Device Tree platforms, even though the Samsung PMIC sec device is instantiated from DT, the driver is still matched through I2C module alias. That is because I2C core always reports an I2C module alias instead of DT one. This could change in the future so export DT module alias. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Lee Jones commit 5c5c87411488af3cd082221e567498d813d0fe83 Author: Dmitry Osipenko Date: Fri Jul 27 00:19:16 2018 +0300 iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA This fixes kernel crashing on NVIDIA Tegra if kernel is compiled in a multiplatform configuration and IPMMU-VMSA driver is enabled. Cc: # v3.20+ Signed-off-by: Dmitry Osipenko Signed-off-by: Joerg Roedel commit 15021d364d17b658f489aa654d96a4c81a71f386 Author: Geert Uytterhoeven Date: Wed Jul 25 15:10:29 2018 +0200 iommu/ipmmu-vmsa: Clarify supported platforms The Renesas IPMMU-VMSA driver supports not just R-Car H2 and M2 SoCs, but also other R-Car Gen2 and R-Car Gen3 SoCs. Drop a superfluous "Renesas" while at it. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Joerg Roedel commit 46583e8c48c5a094ba28060615b3a7c8c576690f Author: Geert Uytterhoeven Date: Fri Jul 20 18:16:59 2018 +0200 iommu/ipmmu-vmsa: Fix allocation in atomic context When attaching a device to an IOMMU group with CONFIG_DEBUG_ATOMIC_SLEEP=y: BUG: sleeping function called from invalid context at mm/slab.h:421 in_atomic(): 1, irqs_disabled(): 128, pid: 61, name: kworker/1:1 ... Call trace: ... arm_lpae_alloc_pgtable+0x114/0x184 arm_64_lpae_alloc_pgtable_s1+0x2c/0x128 arm_32_lpae_alloc_pgtable_s1+0x40/0x6c alloc_io_pgtable_ops+0x60/0x88 ipmmu_attach_device+0x140/0x334 ipmmu_attach_device() takes a spinlock, while arm_lpae_alloc_pgtable() allocates memory using GFP_KERNEL. Originally, the ipmmu-vmsa driver had its own custom page table allocation implementation using GFP_ATOMIC, hence the spinlock was fine. Fix this by replacing the spinlock by a mutex, like the arm-smmu driver does. Fixes: f20ed39f53145e45 ("iommu/ipmmu-vmsa: Use the ARM LPAE page table allocator") Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Signed-off-by: Joerg Roedel commit 58d1131777a4b7c228267b809bd88f7be66edcfb Author: Olof Johansson Date: Fri Jul 20 11:02:23 2018 -0700 iommu: Add config option to set passthrough as default This allows the default behavior to be controlled by a kernel config option instead of changing the commandline for the kernel to include "iommu.passthrough=on" or "iommu=pt" on machines where this is desired. Likewise, for machines where this config option is enabled, it can be disabled at boot time with "iommu.passthrough=off" or "iommu=nopt". Also corrected iommu=pt documentation for IA-64, since it has no code that parses iommu= at all. Signed-off-by: Olof Johansson Signed-off-by: Joerg Roedel commit c52c72d3dee81af893cee0414444818ed91e2e11 Author: Olof Johansson Date: Wed Jul 11 13:59:36 2018 -0700 iommu: Add sysfs attribyte for domain type While we could print it at setup time, this is an easier way to match each device to their default IOMMU allocation type. Signed-off-by: Olof Johansson Signed-off-by: Joerg Roedel commit c8fda5bfa9972dc1175b898dfdaa3a375dca6022 Author: Marcel Ziswiler Date: Tue Jul 3 17:04:11 2018 +0200 mfd: as3722: Disable auto-power-on when AC OK On ams AS3722, power on when AC OK is enabled by default. Making this option as disable by default and enable only when platform need this explicitly. Signed-off-by: Laxman Dewangan Reviewed-by: Bibek Basu Tested-by: Bibek Basu Signed-off-by: Marcel Ziswiler Acked-by: Rob Herring Signed-off-by: Lee Jones commit 99e19b7c48f852acd8341de4390931a9da699ee3 Author: Chen-Yu Tsai Date: Fri Jul 13 00:04:50 2018 +0800 mfd: axp20x: Support AXP806 in I2C mode The Pine64 H64 board uses an AXP806 PMIC in I2C and self-working mode. The H64 SoC does not have the usual RSB controller. This patch adds AXP806 to the list of devices supported in I2C mode. In theory, all RSB-based PMICs can also be used in I2C mode. Signed-off-by: Chen-Yu Tsai Reviewed-by: Icenowy Zheng Tested-by: Icenowy Zheng Acked-by: Maxime Ripard Signed-off-by: Lee Jones commit 06f4901092c26c24575dd0aa1f55cdf9a83434e8 Author: Chen-Yu Tsai Date: Fri Jul 13 00:04:49 2018 +0800 mfd: axp20x: Add self-working mode support for AXP806 The AXP806 can operate in a standalone "self-working" mode, in which it is also responsible for power control of the overall system. This mode is similar to the master mode, but the EN/PWRON pin functions as a power button, instead of a level-triggered enable switch. This patch adds code checking for the new "x-powers,self-working-mode" property, and a separate mfd_cell list that includes the power button (PEK) sub-device. Signed-off-by: Chen-Yu Tsai Reviewed-by: Icenowy Zheng Tested-by: Icenowy Zheng Acked-by: Maxime Ripard Signed-off-by: Lee Jones commit c26b633ee3dd295996006a47543af3759ca677ec Author: Chen-Yu Tsai Date: Fri Jul 13 00:04:48 2018 +0800 dt-bindings: mfd: axp20x: Add "self-working" mode for AXP806 The AXP806 has three operation modes: - master mode: The PMIC is the first or only AXP PMIC in the system, but is not in charge of power management, i.e. only provides regulator functions. - slave mode: The PMIC is the second AXP PMIC in the system, chained to the first, or master, one. - self-working mode: The PMIC is the only AXP PMIC in the system, and is in charge of power sequencing. The functional differences between these modes can be found in the "Control and Operation" chapter of the AXP806 (in Chinese) and AXP805 (in English) datasheets. These include how the PMIC responds to external signals, whether it takes an external voltage reference or uses its own, and whether the EN/PWRON pin functions as an enable switch or power button. We already support both slave and master mode. This patch adds a property for describing the self-working mode, and reworks the description for the mode properties. Signed-off-by: Chen-Yu Tsai Reviewed-by: Rob Herring Reviewed-by: Icenowy Zheng Tested-by: Icenowy Zheng Acked-by: Maxime Ripard Signed-off-by: Lee Jones commit 4d3e55bc7690b289eeae0c7e994db965cb2a993d Author: Alberto Panizzo Date: Mon Jul 9 19:46:46 2018 +0200 mfd: wm8994: Allow to configure CS/ADDR Pulldown from dts For designs where CS/ADDR pin is floating, it is useful to allow dts to define whether to keep internal pull down or not. Signed-off-by: Alberto Panizzo Signed-off-by: Anthony Brandon Acked-by: Charles Keepax Signed-off-by: Lee Jones commit 102370fb048a223df4054157d795924928537d11 Author: Alberto Panizzo Date: Mon Jul 9 19:46:44 2018 +0200 mfd: wm8994: Allow to configure Speaker Mode Pullup from dts Configuring Speaker Mode Pullup was already supported in pdata, but not in the dts. Signed-off-by: Alberto Panizzo Signed-off-by: Anthony Brandon Acked-by: Charles Keepax Signed-off-by: Lee Jones commit 80d139b8638f01ec5e048e546aba6f2b6704079b Author: Andrey Smirnov Date: Fri Jul 6 19:41:08 2018 -0700 mfd: rave-sp: Emulate CMD_GET_STATUS on device that don't support it CMD_GET_STATUS is not supported by some devices implementing RDU2-compatible ICD as well as "legacy" devices. To account for that fact, add code that obtains the same information (app/bootloader FW version) using several different commands. Signed-off-by: Andrey Smirnov Signed-off-by: Lee Jones commit 405dfd489921379fc4d44c58e7b84f5d7a39b5e1 Author: Andrey Smirnov Date: Fri Jul 6 19:41:07 2018 -0700 mfd: rave-sp: Add legacy watchdog ping command translation This is needed to make rave-sp-wdt driver to properly ping the watchdog on "legacy" firmware. Signed-off-by: Andrey Smirnov Signed-off-by: Lee Jones commit 2b8de8a832add91a4e522536078b505283d3979f Author: Andrey Smirnov Date: Fri Jul 6 19:41:06 2018 -0700 mfd: rave-sp: Add legacy EEPROM access command translation This is needed to make rave-sp-eeprom driver work on "legacy" firmware. Signed-off-by: Andrey Smirnov Signed-off-by: Lee Jones commit 6c450bdf13ebe110821a74960936cec936edae49 Author: Andrey Smirnov Date: Fri Jul 6 19:41:05 2018 -0700 mfd: rave-sp: Initialize flow control and parity of the port Relying on serial port defaults for flow control and parity can result in complete breakdown of communication with RAVE SP on some platforms where defaults are not what we need them to be. One such case is VF610-base ZII SPU3 board (not supported upstream). To avoid this problem in the future, add code to explicitly configure both. Signed-off-by: Andrey Smirnov Signed-off-by: Lee Jones commit a6e3bb0288e1112d03f6bdea68c18d87e6683a03 Author: Andrey Smirnov Date: Fri Jul 6 19:41:04 2018 -0700 mfd: rave-sp: Fix incorrectly specified checksum type RAVE SP firmware covered by "legacy" variant uses 16-bit CCITT checksum algorithm. Change the code to correctly reflect that. Signed-off-by: Andrey Smirnov Signed-off-by: Lee Jones commit 763c43f6a03c1565ceb1045889a621ed6c54784d Author: Andrey Smirnov Date: Fri Jul 6 19:41:03 2018 -0700 mfd: rave-sp: Remove unused defines Remove unusded defines that are a leftover from earlier iterations of the driver. Signed-off-by: Andrey Smirnov Signed-off-by: Lee Jones commit 6afebb70ee7a4bde106dc1a875e7ac7997248f84 Author: Rafael David Tinoco Date: Fri Jul 6 14:28:33 2018 -0300 mfd: hi655x: Fix regmap area declared size for hi655x Fixes https://bugs.linaro.org/show_bug.cgi?id=3903 LTP Functional tests have caused a bad paging request when triggering the regmap_read_debugfs() logic of the device PMIC Hi6553 (reading regmap/f8000000.pmic/registers file during read_all test): Unable to handle kernel paging request at virtual address ffff0 [ffff00000984e000] pgd=0000000077ffe803, pud=0000000077ffd803,0 Internal error: Oops: 96000007 [#1] SMP ... Hardware name: HiKey Development Board (DT) ... Call trace: regmap_mmio_read8+0x24/0x40 regmap_mmio_read+0x48/0x70 _regmap_bus_reg_read+0x38/0x48 _regmap_read+0x68/0x170 regmap_read+0x50/0x78 regmap_read_debugfs+0x1a0/0x308 regmap_map_read_file+0x48/0x58 full_proxy_read+0x68/0x98 __vfs_read+0x48/0x80 vfs_read+0x94/0x150 SyS_read+0x6c/0xd8 el0_svc_naked+0x30/0x34 Code: aa1e03e0 d503201f f9400280 8b334000 (39400000) Investigations have showed that, when triggered by debugfs read() handler, the mmio regmap logic was reading a bigger (16k) register area than the one mapped by devm_ioremap_resource() during hi655x-pmic probe time (4k). This commit changes hi655x's max register, according to HW specs, to be the same as the one declared in the pmic device in hi6220's dts, fixing the issue. Cc: #v4.9 #v4.14 #v4.16 #v4.17 Signed-off-by: Rafael David Tinoco Signed-off-by: Lee Jones commit c2b1509c77a99a0dcea0a9051ca743cb88385f50 Author: Zumeng Chen Date: Wed Jul 4 12:35:29 2018 +0800 mfd: ti_am335x_tscadc: Fix struct clk memory leak Use devm_elk_get() to let Linux manage struct clk memory to avoid the following memory leakage report: unreferenced object 0xdd75efc0 (size 64): comm "systemd-udevd", pid 186, jiffies 4294945126 (age 1195.750s) hex dump (first 32 bytes): 61 64 63 5f 74 73 63 5f 66 63 6b 00 00 00 00 00 adc_tsc_fck..... 00 00 00 00 92 03 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmemleak_alloc+0x40/0x74 [] __kmalloc_track_caller+0x198/0x388 [] kstrdup+0x40/0x5c [] kstrdup_const+0x30/0x3c [] __clk_create_clk+0x60/0xac [] clk_get_sys+0x74/0x144 [] clk_get+0x5c/0x68 [] ti_tscadc_probe+0x260/0x468 [ti_am335x_tscadc] [] platform_drv_probe+0x60/0xac [] driver_probe_device+0x214/0x2dc [] __driver_attach+0x94/0xc0 [] bus_for_each_dev+0x90/0xa0 [] driver_attach+0x28/0x30 [] bus_add_driver+0x184/0x1ec [] driver_register+0xb0/0xf0 [] __platform_driver_register+0x40/0x54 Signed-off-by: Zumeng Chen Signed-off-by: Lee Jones commit 2d8175ad7d519596149b32c6cd8f9fb970ca2677 Author: Christoph Fritz Date: Tue Jun 5 11:26:49 2018 +0200 dt-bindings: mfd: Fix documentation of tps65911 This patch fixes documentation of tps65911 because its list of compatible regulators contains wrongly vdd3 instead of vdd2. Signed-off-by: Christoph Fritz Acked-by: Rob Herring Signed-off-by: Lee Jones commit 50d44f82c7f1b0d2676a7c5c11feb321e4ea6c44 Author: Sebastian Andrzej Siewior Date: Mon Jul 2 09:31:32 2018 +0200 mfd: dln2: Use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Reviewed-by: Johan Hovold Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Lee Jones commit f99fea949736b6a79cddaaaec7e3b8830fd81c93 Author: Charles Keepax Date: Thu Jun 28 16:49:35 2018 +0100 mfd: arizona: Don't use regmap_read_poll_timeout Some Arizona CODECs have a small timing window where they will NAK an I2C transaction if it happens before the boot done bit is set. This can cause the read of the register containing the boot done bit to fail until it is set. Since regmap_read_poll_timeout will abort polling if a read fails it can't be reliably used to poll the boot done bit over I2C. Do a partial revert of ef84f885e037 ("mfd: arizona: Refactor arizona_poll_reg"), removing the regmap_read_poll_timeout but leaving the refactoring to make the arizona_poll_reg take more sensible arguments. Fixes: ef84f885e037 ("mfd: arizona: Refactor arizona_poll_reg") Signed-off-by: Charles Keepax Signed-off-by: Lee Jones commit a13c93b3a5db87a173b2cdc6c2f2122d9d677808 Author: Mika Westerberg Date: Wed Jun 27 23:48:08 2018 +0300 mfd: intel-lpss: Add Ice Lake PCI IDs Intel Ice Lake has the same LPSS than Intel Cannon Lake. Add the new IDs to the list of supported devices. Signed-off-by: Mika Westerberg Signed-off-by: Andy Shevchenko Signed-off-by: Lee Jones commit df47df55911b31863bcbed93df163cb27298e311 Author: Anthony Brandon Date: Thu Jun 14 13:57:14 2018 +0200 mfd: wm8994-core: Fix error path in wm8994_device_init For some errors, the wm8994_device_init function was returning or jumping to the wrong point in the error path. Signed-off-by: Anthony Brandon Reviewed-by: Richard Fitzgerald Signed-off-by: Lee Jones commit bf1cafa18be3b73ad30a3bbf2c3dae5ef333189a Author: Julia Lawall Date: Wed Jun 13 06:48:09 2018 +0200 mfd: kempld-core: Constify variables that point to const structure Add const to the declaration of various local variables of type kempld_platform_data for which the referenced value is always only dereferenced or passed to a const parameter, to record the fact that kempld_platform_data_generic is declared as const. The semantic match that finds this issue is as follows: (http://coccinelle.lip6.fr/) // @r@ identifier i,j; @@ const struct i j = { ... }; @ok@ identifier r.i; position p; @@ const struct i@p * @@ identifier r.i; position p != ok.p; @@ * struct i@p * // Signed-off-by: Julia Lawall Signed-off-by: Lee Jones commit e5ff19cf75f33a4654fc54631577146a1162d527 Merge: 3144dce72b7c aca429ff9d14 cd70de2d356e c287572b739a 413c94469a9d Author: Lee Jones Date: Fri Jul 27 08:11:37 2018 +0100 Merge branches 'ib-mfd-4.19', 'ib-mfd-gpio-pinctrl-4.19', 'ib-mfd-i915-media-platform-4.19' and 'ib-mfd-regulator-4.19', tag 'ib-platform-chrome-mfd-move-cros-ec-transport-for-4.19' into ibs-for-mfd-merged Immutable branch (mfd, chrome) due for the v4.19 window Immutable Branch which moves the cros_ec_i2c and cros_ec_spi transport drivers from mfd to platform/chrome. Changes in arm are a simple rename in defconfigs. Change in input is a rename in help text. commit 13e9a3edb4b702b701b5a9553b830aa3d2a3e3e9 Author: Takashi Iwai Date: Wed Jul 25 23:24:14 2018 +0200 ALSA: sb: Proper endian notations The data types defined in SB CSP driver code are all in little-endian, hence the proper type like __le32 should be used. Spotted by sparse, a warning like: sound/isa/sb/sb16_csp.c:330:14: warning: cast to restricted __le32 Signed-off-by: Takashi Iwai commit 7e49aadf64992c138b354a2e9ae35a3ae0399415 Author: Takashi Iwai Date: Wed Jul 25 23:24:13 2018 +0200 ALSA: atiixp_modem: Proper endian notations The DMA address table in atiixp modem driver is in little-endian, hence we should define it with __le32 properly. Spotted by sparse, a warning like: sound/pci/atiixp_modem.c:360:28: warning: incorrect type in assignment (different base types) Signed-off-by: Takashi Iwai commit c44a81a40af0e1aa52b88d1c60682e30c411fb23 Author: Takashi Iwai Date: Wed Jul 25 23:24:12 2018 +0200 ALSA: atiixp: Proper endian notations The DMA address table in atiixp driver is in little-endian, hence we should define it with __le32 properly. Spotted by sparse, a warning like: sound/pci/atiixp.c:393:28: warning: incorrect type in assignment (different base types) Signed-off-by: Takashi Iwai commit 58578d1894490c62bf64c3293cb06e0fcdc86a31 Author: Takashi Iwai Date: Wed Jul 25 23:24:11 2018 +0200 ALSA: bt87x: Proper endian notations The RISC data in bt87x is in little-endian, hence we should define it with __le32 properly. Spotted by sparse, a warning like: sound/pci/bt87x.c:240:17: warning: incorrect type in assignment (different base types) Signed-off-by: Takashi Iwai commit 2a833a02a12b1dbb605739d589d11b4400c2078c Author: Takashi Iwai Date: Wed Jul 25 23:24:10 2018 +0200 ALSA: echoaudio: Proper endian notations Many data fields defined in echoaudio drivers are in little-endian, hence they should be defined with __le16 or __le32. This makes it easier to catch the forgotten conversions. Spotted by sparse, a warning like: sound/pci/echoaudio/echoaudio_dsp.c:990:36: warning: incorrect type in assignment (different base types) Signed-off-by: Takashi Iwai commit 8c0ab942e05941ade5f1fca59d29b7034fdf164c Author: Takashi Iwai Date: Wed Jul 25 23:24:09 2018 +0200 ALSA: maestro3: Proper endian notations The ASSP data passed to maestro3 driver is in little-endian format, hence the data pointer should be with __le16. Spotted by sparse, warnings like: sound/pci/maestro3.c:2128:35: warning: cast to restricted __le16 Signed-off-by: Takashi Iwai commit 7752a7de2596097c8f702fd652cba05118f83bcc Author: Takashi Iwai Date: Wed Jul 25 23:24:08 2018 +0200 ALSA: intel8x0m: Proper endian notations The BD address tables in intel8x0m driver are in little-endian, hence they should be represented as __le32 instead u32. Spotted by sparse, warnings like: sound/pci/intel8x0m.c:406:40: warning: incorrect type in assignment (different base types) Signed-off-by: Takashi Iwai commit 3c164e2ce601bd7abf76d9f37b7f4afa6fa988a1 Author: Takashi Iwai Date: Wed Jul 25 23:24:07 2018 +0200 ALSA: intel8x0: Proper endian notations The BD address tables in intel8x0 driver are in little-endian, hence they should be represented as __le32 instead u32. Spotted by sparse, warnings like: sound/pci/intel8x0.c:688:40: warning: incorrect type in assignment (different base types) Signed-off-by: Takashi Iwai commit 0d9a26fc74578289e0edeac36c6d562596f8a72e Author: Takashi Iwai Date: Wed Jul 25 23:24:06 2018 +0200 ALSA: lola: Proper endian notations The BDL entries in lola driver are little-endian while we code them as u32. This leads to sparse warnings like: sound/pci/lola/lola.c:105:40: warning: incorrect type in assignment (different base types) sound/pci/lola/lola.c:105:40: expected unsigned int [unsigned] [usertype] sound/pci/lola/lola.c:105:40: got restricted __le32 [usertype] This patch fixes the declarations to the proper __le32 type. Also, there was a typo in the original code, where __user was used that was intended as __iomem. This was caused also by sparse: sound/pci/lola/lola_mixer.c:132:27: warning: incorrect type in assignment (different address spaces) Fixed in this patch as well. Signed-off-by: Takashi Iwai commit 0e7ca66a97c3bbf0b7665010d1b1d6a8c8e3811e Author: Takashi Iwai Date: Wed Jul 25 23:24:05 2018 +0200 ALSA: mixart: Proper endian notations The miXart driver deals with big-endian values as raw data, while it declares most of variables as u32. This leads to sparse warnings like sound/pci/mixart/mixart.c:1203:23: warning: cast to restricted __be32 Fix them by properly defining the structs and add the explicit cast to macros. Signed-off-by: Takashi Iwai commit be05e3de3a933156d472127f659d4473c461dcc5 Author: Takashi Iwai Date: Wed Jul 25 23:24:04 2018 +0200 ALSA: riptide: Properly endian notations The SG descriptor of Riptide contains the little-endian values, hence we need to define with __le32 properly. This fixes sparse warnings like: sound/pci/riptide/riptide.c:1112:40: warning: cast to restricted __le32 Signed-off-by: Takashi Iwai commit 7362b0fca5de9570b5ba7bce5034105028daa599 Author: Takashi Iwai Date: Wed Jul 25 23:24:03 2018 +0200 ALSA: hda: Proper endian notations for BDL pointers The BDL pointer used in snd_hdac_dsp_prepare() should be declared as __le32, as warned by sparse: sound/hda/hdac_stream.c:655:47: warning: incorrect type in argument 4 (different base types) sound/hda/hdac_stream.c:655:47: expected restricted __le32 [usertype] **bdlp sound/hda/hdac_stream.c:655:47: got unsigned int [usertype] ** Signed-off-by: Takashi Iwai commit 752089fea357b36ba9dd477db594bdc677110579 Author: Takashi Iwai Date: Wed Jul 25 23:24:02 2018 +0200 ALSA: trident: Proper endian notations The TLB entries in Trident driver are represented in little-endian, hence they should be declared as __le32. This patch fixes the sparse warnings like: sound/pci/trident/trident_memory.c:226:17: warning: incorrect type in assignment (different base types) Signed-off-by: Takashi Iwai commit d3c637632da95d7646053c64b855641cd917960e Author: Takashi Iwai Date: Wed Jul 25 23:24:01 2018 +0200 ALSA: ymfpci: Proper endian notations The bank values are all little-endians, so they should be defined with __le32. This fixes lots of sparse warnings like: sound/pci/ymfpci/ymfpci_main.c:315:23: warning: cast to restricted __le32 sound/pci/ymfpci/ymfpci_main.c:342:32: warning: incorrect type in assignment (different base types) Signed-off-by: Takashi Iwai commit 3ac14b3960185d4c8a2f14b84042aa1aa8531d88 Author: Takashi Iwai Date: Wed Jul 25 23:19:45 2018 +0200 ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits The open codes with the bit shift in xen_snd_front_alsa.c give sparse warnings as the PCM format type is with __bitwise. There is already a standard macro to get the format bits, so let's use it instead. This fixes sparse warnings like: sound/xen/xen_snd_front_alsa.c:191:47: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai commit e5d3765b6c4cb3ba64295a4205a2f68a4e8fe083 Author: Takashi Iwai Date: Wed Jul 25 23:19:44 2018 +0200 ALSA: sb: Fix sparse warning wrt PCM format type The PCM format type is with __bitwise, and it can't be converted from integer implicitly. Instead of an ugly cast, declare the function argument of snd_sb_csp_autoload() with the proper snd_pcm_format_t type. This fixes the sparse warnings like: sound/isa/sb/sb16_csp.c:743:22: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai commit 55ff2d1ea5487fe131cce399baf4503dcf5cc8e1 Author: Takashi Iwai Date: Wed Jul 25 23:19:43 2018 +0200 ALSA: sb: Fix PCM format bit calculation The PCM format type in snd_pcm_format_t can't be treated as integer implicitly since it's with __bitwise. We have already a helper function to get the bit index of the given type, and use it in each place instead. This fixes sparse warnings like: sound/isa/sb/sb16_main.c:61:44: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai commit 6be9a60efb401487a4d658ef23d652a9e6860b34 Author: Takashi Iwai Date: Wed Jul 25 23:19:42 2018 +0200 ALSA: wss: Fix sparse warning wrt PCM format type The PCM format type is with __bitwise, and it can't be converted from integer implicitly. Instead of an ugly cast, declare the function argument of snd_wss_get_format() with the proper snd_pcm_format_t type. This fixes the sparse warnings like: sound/isa/wss/wss_lib.c:551:14: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai commit a91a0e774984aa57090c39dc3269a812417737ed Author: Takashi Iwai Date: Wed Jul 25 23:19:41 2018 +0200 ALSA: asihpi: Fix PCM format notations asihpi driver treats -1 as an own invalid PCM format, but this needs a proper cast with __force prefix since PCM format type is __bitwise. Define a constant with the proper type and use it allover. This fixes sparse warnings like: sound/pci/asihpi/asihpi.c:315:9: warning: incorrect type in initializer (different base types) Signed-off-by: Takashi Iwai commit 10d3d91e3bc4e152a580bf523e4fd6bf279ae532 Author: Takashi Iwai Date: Wed Jul 25 23:19:40 2018 +0200 ALSA: au88x0: Fix sparse warning wrt PCM format type The PCM format type is with __bitwise, and it can't be converted from integer implicitly. Instead of an ugly cast, declare the function argument of vortex_alsafmt_aspfmt() with the proper snd_pcm_format_t type. This fixes the sparse warning like: sound/pci/au88x0/au88x0_core.c:2778:14: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai commit d63f33d3f083bdb3a7c2dfd623f4d811b2a8d772 Author: Takashi Iwai Date: Wed Jul 25 23:19:39 2018 +0200 ALSA: ad1816a: Fix sparse warning wrt PCM format type The PCM format type is with __bitwise, and it can't be converted from integer implicitly. Instead of an ugly cast, declare the function argument of snd_ad1816a_get_format() with the proper snd_pcm_format_t type. This fixes the sparse warning like: sound/isa/ad1816a/ad1816a_lib.c:93:14: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai commit f8b6c0cfbdd7359db9bb4da38dd54217296f9264 Author: Takashi Iwai Date: Wed Jul 25 23:19:38 2018 +0200 ALSA: pcm: Fix sparse warning wrt PCM format type The PCM format type is with __bitwise, hence it needs the explicit cast with __force. It's ugly, but there is a reason for that cost... This fixes the sparse warning: sound/core/oss/pcm_oss.c:1854:55: warning: incorrect type in argument 1 (different base types) Signed-off-by: Takashi Iwai commit 94dfee0c1a33baa974cba0bd8b83021b1d801297 Author: Takashi Iwai Date: Wed Jul 25 23:19:37 2018 +0200 ALSA: riptide: Fix PCM format type conversion The PCM format type is with __bitwise, hence it needs to be explicitly declared as snd_pcm_format_t, as warned by sparse: sound/pci/riptide/riptide.c:1028:34: warning: incorrect type in argument 1 (different base types) sound/pci/riptide/riptide.c:1028:34: expected restricted snd_pcm_format_t [usertype] format sound/pci/riptide/riptide.c:1028:34: got unsigned char [unsigned] format Signed-off-by: Takashi Iwai commit a6ea5fe95ab4a1a7af6d57429fe3ecde9acf5b5a Author: Takashi Iwai Date: Wed Jul 25 23:19:36 2018 +0200 ALSA: hda: Fix implicit PCM format type conversion The PCM format type is defined with __bitwise, hence it can't be passed as integer but needs an explicit cast. In this patch, instead of the messy cast flood, define the format argument of snd_hdac_calc_stream_format() to be the proper snd_pcm_format_t type. This fixes sparse warnings like: sound/hda/hdac_device.c:760:38: warning: incorrect type in argument 1 (different base types) Signed-off-by: Takashi Iwai commit 50e9ffb1996a5d11ff5040a266585bad4ceeca0a Author: Takashi Iwai Date: Thu Jul 26 14:27:59 2018 +0200 ALSA: virmidi: Fix too long output trigger loop The virmidi output trigger tries to parse the all available bytes and process sequencer events as much as possible. In a normal situation, this is supposed to be relatively short, but a program may give a huge buffer and it'll take a long time in a single spin lock, which may eventually lead to a soft lockup. This patch simply adds a workaround, a cond_resched() call in the loop if applicable. A better solution would be to move the event processor into a work, but let's put a duct-tape quickly at first. Reported-and-tested-by: Dae R. Jeong Reported-by: syzbot+619d9f40141d826b097e@syzkaller.appspotmail.com Cc: Signed-off-by: Takashi Iwai commit 2e96187b6967227f5b58a2ae599014274e21935e Merge: 54b757592fdf 6919bcc8aa27 Author: Daniel Borkmann Date: Fri Jul 27 07:23:49 2018 +0200 Merge branch 'bpf-docs-rst-improvements' Tobin C. Harding says: ==================== Recently BPF docs were converted to RST format. A couple of things were missed: - Use 'index.rst' instead of 'README.rst'. Although README.rst will work just fine it is more typical to keep the subdirectory indices in a file called 'index.rst'. - Integrate files Documentation/bpf/*.rst into build system using toctree in Documentation/bpf/index.rst - Include bpf/index in top level toctree so bpf is indexed in the main kernel docs. - Make anal change to heading format (inline with rest of Documentation/). ==================== Signed-off-by: Daniel Borkmann commit 6919bcc8aa2755be934d38bb7d8d7aee14b27e1d Author: Tobin C. Harding Date: Thu Jul 26 15:03:05 2018 +1000 docs: bpf: Capitalise document heading The majority of files in the kernel documentation index use capitalisation for all words, especially the shorter ones. BPF docs better fit in with the rest of the documentation if the heading is all capitalised. Capitalise document heading. Signed-off-by: Tobin C. Harding Signed-off-by: Daniel Borkmann commit 3209570da7a2dc80e3123dd837ced461f786e6dc Author: Tobin C. Harding Date: Thu Jul 26 15:03:04 2018 +1000 docs: Add bpf/index to top level index Recently bpf docs were converted to RST format. The new files were not added to the top level toctree. This causes build system to emit a warning of type WARNING: document isn't included in any toctree Add bpf/index.rst to Documentation/index.rst Signed-off-by: Tobin C. Harding Signed-off-by: Daniel Borkmann commit b3d40f63d20bbaf78c6b6e9112cde604135e30e0 Author: Tobin C. Harding Date: Thu Jul 26 15:03:03 2018 +1000 docs: bpf: Add toctree to index Recently bpf/ docs were converted to us RST format. bp/index.rst was created out of README but toctree was not added to include files within Documentation/bpf/ Add toctree to Documentation/bpf/index.rst Signed-off-by: Tobin C. Harding Signed-off-by: Daniel Borkmann commit d9b9170a26536e9bfe2994d60925e10d16d411dc Author: Tobin C. Harding Date: Thu Jul 26 15:03:02 2018 +1000 docs: bpf: Rename README.rst to index.rst Recently bpf/ docs were converted to use RST format. 'README.rst' was created but in order to fit in with the Sphinx build system this file should be named 'index.rst'. Rename file, fixes to integrate into Sphinx build system in following patches. docs: Rename Documentation/bpf/README.rst to Documentation/bpf/index.rst Signed-off-by: Tobin C. Harding Signed-off-by: Daniel Borkmann commit 54b757592fdf310c9b8b3a8ea6cc0ce7cf9af983 Merge: 2367bd99f62b 6748182c2d18 Author: Daniel Borkmann Date: Fri Jul 27 07:18:45 2018 +0200 Merge branch 'bpf-convert-more-samples' Jakub Kicinski says: ==================== This set converts xdpsock_user.c and xdp_fwd_user.c to use libbpf instead of bpf_load.o. First two patches are minor improvements to libbpf to make the conversion (and use of libbpf in general) nicer. ==================== Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 6748182c2d1850811a577fe060387f83d5fa0fe4 Author: Jakub Kicinski Date: Thu Jul 26 14:32:21 2018 -0700 samples: bpf: convert xdpsock_user.c to libbpf Convert xdpsock_user.c to use libbpf instead of bpf_load.o. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit e1a40ef418ca2d0ffb6d22f84a13cb0df66cf83c Author: Jakub Kicinski Date: Thu Jul 26 14:32:20 2018 -0700 samples: bpf: convert xdp_fwd_user.c to libbpf Convert xdp_fwd_user.c to use libbpf instead of bpf_load.o. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 6d4b198b0b23ca2a75785173a9b27afd1eee7040 Author: Jakub Kicinski Date: Thu Jul 26 14:32:19 2018 -0700 tools: libbpf: add bpf_object__find_program_by_title() Allow users to find programs by section names. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 1e960043e8ae65d6f53b3414586a3fb634461908 Author: Jakub Kicinski Date: Thu Jul 26 14:32:18 2018 -0700 tools: libbpf: handle NULL program gracefully in bpf_program__nth_fd() bpf_map__fd() handles NULL map gracefully and returns -EINVAL. bpf_program__fd() and bpf_program__nth_fd() crash in this case. Make the behaviour more consistent by validating prog pointer as well. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 2367bd99f62bd952fea5c534eeb1d84c113da38e Merge: 9778cfdfc9d9 17082566a9d2 Author: Daniel Borkmann Date: Fri Jul 27 07:14:36 2018 +0200 Merge branch 'bpf-nfp-perf-event-improvements' Jakub Kicinski says: ==================== This set is focused on improving the performance of perf events reported from BPF offload. Perf events can now be received on packet data queues, which significantly improves the performance (from total of 0.5 Msps to 5Msps per core). To get to this performance we need a fast path for control messages which will operate on raw buffers and recycle them immediately. Patch 5 replaces the map pointers for perf maps with map IDs. We look the pointers up in a hashtable, anyway, to validate they are correct, so there is no performance difference. Map IDs have the advantage of being easier to understand for users in case of errors (we no longer print raw pointers to the logs). Last patch improves info messages about map offload. ==================== Signed-off-by: Daniel Borkmann commit 17082566a9d2d05eefa3a5d6d968aa1d4b87c73d Author: Jakub Kicinski Date: Wed Jul 25 19:53:35 2018 -0700 nfp: bpf: improve map offload info messages FW can put constraints on map element size to maximize resource use and efficiency. When user attempts offload of a map which does not fit into those constraints an informational message is printed to kernel logs to inform user about the reason offload failed. Map offload does not have access to any advanced error reporting like verifier log or extack. There is also currently no way for us to nicely expose the FW capabilities to user space. Given all those constraints we should make sure log messages are as informative as possible. Improve them. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: Daniel Borkmann commit ab01f4ac5faf6a0ea532fa65cf6b1c9b2019e49b Author: Jakub Kicinski Date: Wed Jul 25 19:53:34 2018 -0700 nfp: bpf: remember maps by ID Record perf maps by map ID, not raw kernel pointer. This helps with debug messages, because printing pointers to logs is frowned upon, and makes debug easier for the users, as map ID is something they should be more familiar with. Note that perf maps are offload neutral, therefore IDs won't be orphaned. While at it use a rate limited print helper for the error message. Reported-by: Kees Cook Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 0958762748e4cfeb19d881aa8d3fe5ba8b5bc50b Author: Jakub Kicinski Date: Wed Jul 25 19:53:33 2018 -0700 nfp: bpf: allow receiving perf events on data queues Control queue is fairly low latency, and requires SKB allocations, which means we can't even reach 0.5Msps with perf events. Allow perf events to be delivered to data queues. This allows us to not only use multiple queues, but also receive and deliver to user space more than 5Msps per queue (Xeon E5-2630 v4 2.20GHz, no retpolines). Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 20c54204219987d620ca9da567dd54e569863dad Author: Jakub Kicinski Date: Wed Jul 25 19:53:32 2018 -0700 nfp: bpf: pass raw data buffer to nfp_bpf_event_output() In preparation for SKB-less perf event handling make nfp_bpf_event_output() take buffer address and length, not SKB as parameters. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 79ca38e80c4588adeb11a0abd116d72ab6fe0ecc Author: Jakub Kicinski Date: Wed Jul 25 19:53:31 2018 -0700 nfp: allow control message reception on data queues Port id 0xffffffff is reserved for control messages. Allow reception of messages with this id on data queues. Hand off a raw buffer to the higher layer code, without allocating SKB for max efficiency. The RX handle can't modify or keep the buffer, after it returns buffer is handed back over to the NIC RX free buffer list. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: Daniel Borkmann commit 78a8b760e40881c883c5552db991664727a91868 Author: Jakub Kicinski Date: Wed Jul 25 19:53:30 2018 -0700 nfp: move repr handling on RX path Representor packets are received on PF queues with special metadata tag for demux. There is no reason to resolve the representor ID -> netdev after the skb has been allocated. Move the code, this will allow us to handle special FW messages without SKB allocation overhead. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: Daniel Borkmann commit c6f5e017df9dfa9f6cbe70da008e7d716d726f1b Author: kbuild test robot Date: Thu Jul 26 15:09:52 2018 +0800 xfrm: fix ptr_ret.cocci warnings net/xfrm/xfrm_interface.c:692:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Fixes: 44e2b838c24d ("xfrm: Return detailed errors from xfrmi_newlink") CC: Benedict Wong Signed-off-by: kbuild test robot Signed-off-by: Steffen Klassert commit ecbcd689d74a394b711d2360aef7e5d007ec9d98 Merge: f61b6db37853 8ee482335666 Author: David S. Miller Date: Thu Jul 26 21:33:24 2018 -0700 Merge tag 'mlx5e-updates-2018-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5e-updates-2018-07-26 (XDP redirect) This series from Tariq adds the support for device-out XDP redirect. Start with a simple RX and XDP cleanups: - Replace call to MPWQE free with dealloc in interface down flow - Do not recycle RX pages in interface down flow - Gather all XDP pre-requisite checks in a single function - Restrict the combination of large MTU and XDP Since now XDP logic is going to be called from TX side as well, generic XDP TX logic is not RX only anymore, for that Tariq creates a new xdp.c file and moves XDP related code into it, and generalizes the code to support XDP TX for XDP redirect, such as the xdp tx sq structures and xdp counters. XDP redirect support: Add implementation for the ndo_xdp_xmit callback. Dedicate a new set of XDP-SQ instances to satisfy the XDP_REDIRECT requests. These instances are totally separated from the existing XDP-SQ objects that satisfy local XDP_TX actions. Performance tests: xdp_redirect_map from ConnectX-5 to ConnectX-5. CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz Packet-rate of 64B packets. Single queue: 7 Mpps. Multi queue: 55 Mpps. ==================== Signed-off-by: David S. Miller commit f61b6db378539e69d8525a1b5001637df1e13040 Author: Jakub Kicinski Date: Thu Jul 26 14:25:26 2018 -0700 netdevsim: make debug dirs' dentries static The root directories of netdevsim should only be used by the core to create per-device subdirectories, so limit their visibility to the core file. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: David S. Miller commit 472f5975f70d6424f64868e66a8a02da4cfcff47 Merge: d8ad2f31f88d 287f4fa99a52 Author: David S. Miller Date: Thu Jul 26 21:27:54 2018 -0700 Merge branch 'docs-net-Convert-netdev-FAQ-to-RST' Tobin C. Harding says: ==================== docs: net: Convert netdev-FAQ to RST Jon answered all the tree questions on v1 so if you will please take this through your tree that would be awesome. v2: - Fix typo 'canonical_path_format' (thanks Edward) - Add patch fixing references netdev-FAQ ==================== Signed-off-by: David S. Miller commit 287f4fa99a5281d9dc3b431eaa7403e948eb1e22 Author: Tobin C. Harding Date: Thu Jul 26 15:02:26 2018 +1000 docs: Update references to netdev-FAQ File 'Documentation/networking/netdev-FAQ.txt' has been converted to RST format. We should update all links/references to point to the new file. Update references to netdev-FAQ Signed-off-by: Tobin C. Harding Signed-off-by: David S. Miller commit 96398ddf63ff47833bc5f847a6e83778899058b6 Author: Tobin C. Harding Date: Thu Jul 26 15:02:25 2018 +1000 docs: net: Convert netdev-FAQ to restructured text Preferred kernel docs format is now restructured text. Convert netdev-FAQ.txt to restructured text. - Add SPDX license identifier. - Change file heading 'Information you need to know about netdev' to 'netdev FAQ' to better suit displayed index (in HTML). - Change question/answer layout to suit rst. Copy format in Documentation/bpf/bpf_devel_QA.rst - Fix indentation of code snippets - If multiple consecutive URLs appear put them in a list (to maintain whitespace). - Use uniform spelling of 'bug fix' throughout document (not bugfix or bug-fix). - Add double back ticks to 'net' and 'net-next' when referring to the trees. - Use rst references for Documentation/ links. - Add rst label 'netdev-FAQ' for referencing by other docs files. - Remove stale entry from Documentation/networking/00-INDEX Signed-off-by: Tobin C. Harding Signed-off-by: David S. Miller commit f58252cdc04cc4b2d512b2a3a41e4d9d1dc04e2e Author: Tobin C. Harding Date: Thu Jul 26 15:02:24 2018 +1000 docs: Add rest label the_canonical_patch_format In preparation to convert Documentation/network/netdev-FAQ.rst to restructured text format. We would like to be able to reference 'the canonical patch format' section. Add rest label: 'the_canonical_patch_format'. Signed-off-by: Tobin C. Harding Signed-off-by: David S. Miller commit d8ad2f31f88d609e0f8e4a34f6aeeb482ee5423b Author: Jia-Ju Bai Date: Fri Jul 27 11:51:06 2018 +0800 net: adaptec: Replace mdelay() with msleep() in starfire_init_one() starfire_init_one() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 055d624facda577d3168951a1d6e2519e4fc30f7 Author: Jia-Ju Bai Date: Fri Jul 27 10:48:28 2018 +0800 isdn: hisax: config: Replace GFP_ATOMIC with GFP_KERNEL hisax_cs_new() and hisax_cs_setup() are never called in atomic context. They call kmalloc() and kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 87935aa776caae9c8346797271d19fa710b65a6a Author: Jia-Ju Bai Date: Fri Jul 27 10:45:30 2018 +0800 isdn: hisax: callc: Replace GFP_ATOMIC with GFP_KERNEL in init_PStack() init_PStack() is never called in atomic context. It calls kmalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 9d8009dee92cc97f866403da1b306e6e29fc12cc Author: Jia-Ju Bai Date: Fri Jul 27 10:41:09 2018 +0800 isdn: mISDN: netjet: Replace GFP_ATOMIC with GFP_KERNEL in nj_probe() nj_probe() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 8c957d66d2edb3293ff6a45d660bdaec45f7a5d0 Author: Jia-Ju Bai Date: Fri Jul 27 10:39:06 2018 +0800 isdn: mISDN: hfcpci: Replace GFP_ATOMIC with GFP_KERNEL in hfc_probe() hfc_probe() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit ff7b91262b3ad31dfe1461dace0314a773b0fa55 Author: YueHaibing Date: Fri Jul 27 09:53:12 2018 +0800 net: hns: make hns_dsaf_roce_reset non static hns_dsaf_roce_reset is exported and used in hns_roce_hw_v1.c In commit 336a443bd9dd ("net: hns: Make many functions static") I make it static wrongly. drivers/infiniband/hw/hns/hns_roce_hw_v1.o: In function `hns_roce_v1_reset': hns_roce_hw_v1.c:(.text+0x37ac): undefined reference to `hns_dsaf_roce_reset' hns_roce_hw_v1.c:(.text+0x37cc): undefined reference to `hns_dsaf_roce_reset' Fixes: 336a443bd9dd ("net: hns: Make many functions static") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 47b428d14f06dbeab23dd5c7e424e15283841765 Author: Waiman Long Date: Thu Jul 19 17:39:57 2018 -0400 xen/spinlock: Don't use pvqspinlock if only 1 vCPU On a VM with only 1 vCPU, the locking fast paths will always be successful. In this case, there is no need to use the the PV qspinlock code which has higher overhead on the unlock side than the native qspinlock code. The xen_pvspin veriable is also turned off in this 1 vCPU case to eliminate unneeded pvqspinlock initialization in xen_init_lock_cpu() which is run after xen_init_spinlocks(). Signed-off-by: Waiman Long Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit bf8dc55b135873d8bc58bb8fbc91c52f3a902eea Author: Oleksandr Andrushchenko Date: Fri Jul 20 12:01:50 2018 +0300 xen/gntdev: Implement dma-buf import functionality 1. Import a dma-buf with the file descriptor provided and export granted references to the pages of that dma-buf into the array of grant references. 2. Add API to close all references to an imported buffer, so it can be released by the owner. This is only valid for buffers created with IOCTL_GNTDEV_DMABUF_IMP_TO_REFS. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit a240d6e42e28c34fdc34b3a98ca838a31c939901 Author: Oleksandr Andrushchenko Date: Fri Jul 20 12:01:49 2018 +0300 xen/gntdev: Implement dma-buf export functionality 1. Create a dma-buf from grant references provided by the foreign domain. By default dma-buf is backed by system memory pages, but by providing GNTDEV_DMA_FLAG_XXX flags it can also be created as a DMA write-combine/coherent buffer, e.g. allocated with corresponding dma_alloc_xxx API. Export the resulting buffer as a new dma-buf. 2. Implement waiting for the dma-buf to be released: block until the dma-buf with the file descriptor provided is released. If within the time-out provided the buffer is not released then -ETIMEDOUT error is returned. If the buffer with the file descriptor does not exist or has already been released, then -ENOENT is returned. For valid file descriptors this must not be treated as error. 3. Make gntdev's common code and structures available to dma-buf. [boris: added 'args.fd = -1' to dmabuf_exp_from_refs() to avoid an unnecessary warning about it not being initialized on i386 with gcc 8.1.1] Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 932d6562179efe8e2460a0343dbe0fcacf288a9e Author: Oleksandr Andrushchenko Date: Fri Jul 20 12:01:48 2018 +0300 xen/gntdev: Add initial support for dma-buf UAPI Add UAPI and IOCTLs for dma-buf grant device driver extension: the extension allows userspace processes and kernel modules to use Xen backed dma-buf implementation. With this extension grant references to the pages of an imported dma-buf can be exported for other domain use and grant references coming from a foreign domain can be converted into a local dma-buf for local export. Implement basic initialization and stubs for Xen DMA buffers' support. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 1d314567553883d9f606cc59e8e66f465a4b6ccd Author: Oleksandr Andrushchenko Date: Fri Jul 20 12:01:47 2018 +0300 xen/gntdev: Make private routines/structures accessible This is in preparation for adding support of DMA buffer functionality: make map/unmap related code and structures, used privately by gntdev, ready for dma-buf extension, which will re-use these. Rename corresponding structures as those become non-private to gntdev now. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 975ef7ff81bb000af6e6c8e63e81f89f3468dcf7 Author: Oleksandr Andrushchenko Date: Fri Jul 20 12:01:46 2018 +0300 xen/gntdev: Allow mappings for DMA buffers Allow mappings for DMA backed buffers if grant table module supports such: this extends grant device to not only map buffers made of balloon pages, but also from buffers allocated with dma_alloc_xxx. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 9bdc7304f536f3f77f0a69e7c3a8f5afda561a68 Author: Oleksandr Andrushchenko Date: Fri Jul 20 12:01:45 2018 +0300 xen/grant-table: Allow allocating buffers suitable for DMA Extend grant table module API to allow allocating buffers that can be used for DMA operations and mapping foreign grant references on top of those. The resulting buffer is similar to the one allocated by the balloon driver in that proper memory reservation is made by ({increase|decrease}_reservation and VA mappings are updated if needed). This is useful for sharing foreign buffers with HW drivers which cannot work with scattered buffers provided by the balloon driver, but require DMAable memory instead. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit ae4c51a50c990d6feba7058c181dc8f22ca5f1d8 Author: Oleksandr Andrushchenko Date: Fri Jul 20 12:01:44 2018 +0300 xen/balloon: Share common memory reservation routines Memory {increase|decrease}_reservation and VA mappings update/reset code used in balloon driver can be made common, so other drivers can also re-use the same functionality without open-coding. Create a dedicated file for the shared code and export corresponding symbols for other kernel modules. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 8c3799ee25e1fda159099af09f5f2e86091e41d4 Author: Oleksandr Andrushchenko Date: Fri Jul 20 12:01:43 2018 +0300 xen/grant-table: Make set/clear page private code shared Make set/clear page private code shared and accessible to other kernel modules which can re-use these instead of open-coding. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 6d52aacd92c60331ec8c3117522f4301b5195e28 Merge: daa9897560e2 586092ab4b76 Author: Dave Airlie Date: Fri Jul 27 12:31:07 2018 +1000 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next Updates for 4.19. Mostly bug fixes and cleanups. Highlights: - Internal API cleanup in GPU scheduler - Decouple i2c and aux abstractions in DC - Update maintainers - Misc cleanups - Misc bug fixes Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180725215326.2709-1-alexander.deucher@amd.com commit daa9897560e20f397af602b7384a014546fc422c Merge: 52ea6a115f59 3f2b78d630b4 Author: Dave Airlie Date: Fri Jul 27 12:26:33 2018 +1000 Merge tag 'exynos-drm-next-for-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Cleanups - Change g2d driver to component based driver . g2d driver was last customed sub driver so this patch series changes it to component based driver, which also makes gem handling to be more simplify. - Cleanup of Exynos DRM suspend/resume . Register exynos drm core suspend/resume functions to prepare/complete callbacks of dev_pm_ops instead of suspend/resume callbacks to ensure exynos_drm_suspend() is called before any suspend callback from the real devices to avoid some issues on boards with complex pipelines. . Also Add pm_runtime_furce_suspend/resume as SYSTEM_SLEEP_PM_OPS to ensure that resources of each devices will be released for the system PM suspend/resume cycle. - Remove local value not used. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/1532505748-10025-1-git-send-email-inki.dae@samsung.com commit 52ea6a115f59e645b5267c2e830d7d6356b031a9 Merge: a6f6cdefd408 2e012e76ad59 Author: Dave Airlie Date: Fri Jul 27 12:20:43 2018 +1000 Merge branch 'for-upstream/malidp-fixes' of git://linux-arm.org/linux-ld into drm-next I have a couple of small patches for malidp to be applied in drm-next. They have arisen from the decision to switch the writeback connectors to always connected. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180723145302.GA28052@e110455-lin.cambridge.arm.com commit a6f6cdefd408f4ab74060538931241a95fc2362b Merge: 500775074f88 81f2b25addde Author: Dave Airlie Date: Fri Jul 27 12:20:04 2018 +1000 Merge tag 'imx-drm-next-2018-07-20' of git://git.pengutronix.de/git/pza/linux into drm-next drm/imx: cleanup and csi improvements - Remove the unused struct imx_drm_crtc and the unused pipes field from imx_drm_device and replace drm_dev_unref with drm_dev_put. - Extend CSI configuration to support RGB888 and BGR888 capture, as well as 16-bit RGB565 capture via a parallel bus. - Add CPMEM support for negative interlace offsets, which is necessary to support writing captured bottom-top interlaced fields to memory with interleaved lines. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/1532100583.3438.9.camel@pengutronix.de commit df0651079380c5646bc0d0f3a4aa7621ef1c2b7c Author: Lijun Ou Date: Wed Jul 25 15:29:41 2018 +0800 RDMA/hns: Enable modify_cq for uverbs. The driver implements the modify_cq callback, but did not set the bit to expose it to userspace. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 0c4a0e2987a51415de73180ce9f389a99b3dddd1 Author: Lijun Ou Date: Wed Jul 25 15:29:40 2018 +0800 RDMA/hns: Update the data type of immediate data Because the data structure of hip08 is little endian, it needs to fix the immediate field of wqe and cqe into __le32. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 9778cfdfc9d94396d1464630073d696cdea84037 Author: Taeung Song Date: Thu Jul 26 19:13:44 2018 +0900 samples/bpf: Add BTF build flags to Makefile To smoothly test BTF supported binary on samples/bpf, let samples/bpf/Makefile probe llc, pahole and llvm-objcopy for BPF support and use them like tools/testing/selftests/bpf/Makefile changed from the commit c0fa1b6c3efc ("bpf: btf: Add BTF tests"). Signed-off-by: Taeung Song Acked-by: Martin KaFai Lau Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 598135e7444c121f11c8c16495ba1e6ab122678f Author: Brian Brooks Date: Wed Jul 25 16:08:19 2018 -0500 samples/bpf: xdpsock: order memory on AArch64 Define u_smp_rmb() and u_smp_wmb() to respective barrier instructions. This ensures the processor will order accesses to queue indices against accesses to queue ring entries. Signed-off-by: Brian Brooks Acked-by: Björn Töpel Signed-off-by: Daniel Borkmann commit 305180bc05019b60ff7aea0b1d68ddbac205ca1f Author: Tim Schumacher Date: Tue Jul 24 10:46:47 2018 -0700 Input: iforce - reformat the packet dump output Previously, packets that have been dumped are shown in the kernel log like this: drivers/input/joystick/iforce/iforce-packets.c: info cmd = ff04, data = 56 02 04 00 Use dev_dbg to dump the packages only when requested and to list the parent device as well. Use printf logic to generate the hexdump instead of looping through every char that needs to be printed (which in turn fixes the unnecessary newlines and looks more clean in general). The resulting package dump output does now look like this: usb 2-8: iforce_dump_packet info cmd = ff04, data = 56 02 04 00 Signed-off-by: Tim Schumacher Signed-off-by: Dmitry Torokhov commit 179909ecafc3bae1f34289e88bacd45e391f0554 Author: Dmitry Torokhov Date: Tue Jul 24 11:38:14 2018 -0700 Input: stop telling users to snail-mail Vojtech I do not think Vojtech wants snail mail these days (and he mentioned that nobody has ever sent him snail mail), and the address is not even valid anymore, so let's remove snail-mail instructions from the sources. Acked-by: Vojtech Pavlik Signed-off-by: Dmitry Torokhov commit 9840fcd8cc43bfba486a53b4461044f1a1189cdc Author: Benjamin Herrenschmidt Date: Thu Jun 21 18:00:05 2018 +1000 fsi: Prevent multiple concurrent rescans The bus scanning process isn't terribly good at parallel attempts at rescanning the same bus. Let's have a per-master mutex protecting the scanning process. Signed-off-by: Benjamin Herrenschmidt commit d1dcd678257603e71cf3f3d84c70e2b6f0f14bb8 Author: Benjamin Herrenschmidt Date: Thu Jun 21 12:34:22 2018 +1000 fsi: Add cfam char devices This aims to deprecate the "raw" sysfs file used for directly accessing the CFAM and instead use a char device like the other sub drivers. Since it reworks the slave creation code and adds a cfam device type, we also use the opportunity to convert the attributes to attribute groups and add a couple more. Signed-off-by: Benjamin Herrenschmidt commit d8f4587655f9682127351a9dc3fca61e70744294 Author: Benjamin Herrenschmidt Date: Wed Jun 20 15:33:03 2018 +1000 fsi: scom: Convert to use the new chardev This converts FSI scom to use the new fsi-core controlled chardev allocator and use a real cdev instead of a miscdev. Signed-off-by: Benjamin Herrenschmidt commit 8b052dd64f998c7c8e0a0fd1d9feabc0e9bcfe42 Author: Benjamin Herrenschmidt Date: Tue Jul 24 14:39:55 2018 +1000 fsi: sbefifo: Convert to use the new chardev This converts FSI sbefifo to use the new fsi-core controlled chardev allocator and use a real cdev instead of a miscdev. One side effect is to fix the object lifetime by removing the use of devm_kzalloc() for something that contains kobjects, and using proper reference counting. Signed-off-by: Benjamin Herrenschmidt commit 0ab5fe5374743d5a279b1ff6297ef2c54d06cd5f Author: Benjamin Herrenschmidt Date: Wed Jun 20 15:22:52 2018 +1000 fsi: Add new central chardev support The various FSI devices (sbefifo, occ, scom, more to come) currently use misc devices. This is problematic as the minor device space for misc is limited and there can be a lot of them. Also it limits our ability to move them to a dedicated /dev/fsi directory or to be smart about device naming and numbering. It also means we have IDAs on every single of these drivers This creates a common fsi "device_type" for the optional /dev/fsi grouping and a dev_t allocator for all FSI devices. "Legacy" devices get to use a backward compatible numbering scheme (as long as chip id <16 and there's only one copy of a given unit type per chip). A single major number and a single IDA are shared for all FSI devices. This doesn't convert the FSI device drivers to use the new scheme yet, they will be converted individually. Signed-off-by: Benjamin Herrenschmidt commit 73b4e1f4c04e76b19fca296d09b97555bfb35202 Author: Lijun Ou Date: Wed Jul 25 15:29:38 2018 +0800 RDMA/hns: Use delay instead of usleep In order to avoid using usleep function in lock function, we use delay function instead of it. Besides, it also use brackets for standardized the computed order. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 26f63b9c33ceda12fb9136a1d0c80e03c9ebb514 Author: Lijun Ou Date: Wed Jul 25 15:29:37 2018 +0800 RDMA/hns: Add illegal hop_num judgement When hop_num is more than three, it need to return -EINVAL. This patch fixes it. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit dedf63506a8e55235edf902fa7455cd2974e462d Author: Lijun Ou Date: Wed Jul 25 15:29:36 2018 +0800 RDMA/hns: Return correct error code from hns_roce_v1_rsv_lp_qp() When create loop qp fail, it will return the correct result when modify_qp() fails. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit aaa31567799dbce55a1b780355dabf83556018d0 Author: Lijun Ou Date: Wed Jul 25 15:29:33 2018 +0800 RDMA/hns: Add 50GE type of hnae3 device match This patch adds PCI matching for the hns 50GE NIC. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 3635ac020842d37d207570891cb901afa653e55d Author: Lijun Ou Date: Wed Jul 25 15:29:31 2018 +0800 RDMA/hns: Do not overwrite the error code during error unwind in hns_roce_init When init cmq fail in initial flow of RoCE, it should return the errno of cmq_init function, not of the rest call. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit d1634e1aedbc7c30fbba819f8f4fb37df076f49c Author: Prashant Dhamdhere Date: Fri Jul 20 19:05:00 2018 +0530 Documentation: vm.txt: Adding 'nr_hugepages_mempolicy' parameter description. This patch adds 'nr_hugepages_mempolicy' parameter which is currently missing in 'vm.txt' file. It also contains a short description of 'nr_hugepages_mempolicy' parameter. Signed-off-by: Prashant Dhamdhere Signed-off-by: Jonathan Corbet commit 8ee48233566624826d185bf63735cc01d7113fce Author: Tariq Toukan Date: Mon Nov 20 13:34:15 2017 +0200 net/mlx5e: TX, Use function to access sq_dma object in fifo Use designated function mlx5e_dma_get() to get the mlx5e_sq_dma object to be pushed into fifo. Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 9a3956da1c0a59b5853594d9a498289d9773df63 Author: Tariq Toukan Date: Tue May 22 17:06:38 2018 +0300 net/mlx5e: TX, Move DB fields in TXQ-SQ struct Pointers in DB are static, move them to read-only area so they do not share a cacheline with fields modified in datapath. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit d3398a4f1887eee46c22b37f6245faa6c51b130b Author: Tariq Toukan Date: Wed May 16 10:46:57 2018 +0300 net/mlx5e: RX, Prefetch the xdp_frame data area A loaded XDP program might write to the xdp_frame data area, prefetchw() it to avoid a potential cache miss. Performance tests: ConnectX-5, XDP_TX packet rate, single ring. CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz Before: 13,172,976 pps After: 13,456,248 pps 2% gain. Fixes: 22f453988194 ("net/mlx5e: Support XDP over Striding RQ") Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 58b99ee3e3ebecfaccc5641a4014d92a818494a5 Author: Tariq Toukan Date: Tue May 22 16:48:48 2018 +0300 net/mlx5e: Add support for XDP_REDIRECT in device-out side Add implementation for the ndo_xdp_xmit callback. Dedicate a new set of XDP-SQ instances to satisfy the XDP_REDIRECT requests. These instances are totally separated from the existing XDP-SQ objects that satisfy local XDP_TX actions. Performance tests: xdp_redirect_map from ConnectX-5 to ConnectX-5. CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz Packet-rate of 64B packets. Single queue: 7 Mpps. Multi queue: 55 Mpps. Signed-off-by: Tariq Toukan Signed-off-by: Eugenia Emantayev Signed-off-by: Saeed Mahameed commit dac0d15fff6f825e93aafa6ba8bf24fd77ecb2ae Author: Tariq Toukan Date: Tue May 22 16:43:54 2018 +0300 net/mlx5e: Re-order fields of struct mlx5e_xdpsq In the downstream patch that adds support to XDP_REDIRECT-out, the XDP xmit frame function doesn't share the same run context as the NAPI that polls the XDP-SQ completion queue. Hence, need to re-order the XDP-SQ fields to avoid cacheline false-sharing. Take redirect_flush and doorbell out of DB, into separated cachelines. Add a cacheline breaker within the stats struct. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 890388ad6f6b3740265173fa5296ece5d945e977 Author: Tariq Toukan Date: Tue May 22 16:29:31 2018 +0300 net/mlx5e: Refactor XDP counters Separate the XDP counters into two sets: (1) One set reside in the RQ stats, and they monitor XDP stats in the RQ side. (2) Another set is per XDP-SQ, and they monitor XDP stats that are related to XDP transmit flow. Signed-off-by: Tariq Toukan Signed-off-by: Eugenia Emantayev Signed-off-by: Saeed Mahameed commit c94e4f117e473dec11c7b9395b4d88cae2ba27c9 Author: Tariq Toukan Date: Sun Jul 15 10:34:39 2018 +0300 net/mlx5e: Make XDP xmit functions more generic Convert the XDP xmit functions to use the generic xdp_frame API in XDP_TX flow. Same functions will be used later in this series to transmit the XDP redirect-out packets as well. Signed-off-by: Tariq Toukan Signed-off-by: Eugenia Emantayev Signed-off-by: Saeed Mahameed commit 86690b4b4a5127b912348201f4f5880bb75a6621 Author: Tariq Toukan Date: Wed May 16 10:16:30 2018 +0300 net/mlx5e: Add counter for XDP redirect in RX Add per-ring and total stats for received packets that goes into XDP redirection. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 159d21313423b5ffe301834273cba79e915c65ee Author: Tariq Toukan Date: Sun Jul 15 10:28:44 2018 +0300 net/mlx5e: Move XDP related code into new XDP files Take XDP code out of the general EN header and RX file into new XDP files. Currently, XDP-SQ resides only within an RQ and used from a single flow (XDP_TX) triggered upon RX completions. In a downstream patch, additional type of XDP-SQ instances will be presented and used for the XDP_REDIRECT flow, totally unrelated to the RX context. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit a26a5bdf3ee2da419ba2c2baa54f467103dc8cc5 Author: Tariq Toukan Date: Sun Dec 31 15:50:13 2017 +0200 net/mlx5e: Restrict the combination of large MTU and XDP Add checks in control path upon an MTU change or an XDP program set, to prevent reaching cases where large MTU and XDP are set simultaneously. This is to make sure we allow XDP only with the linear RX memory scheme, i.e. a received packet is not scattered to different pages. Change mlx5e_rx_get_linear_frag_sz() accordingly, so that we make sure the XDP configuration can really be set, instead of assuming that it is. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 0ec13877ce95c00737ff4f71a96cd90533b12b48 Author: Tariq Toukan Date: Mon Mar 12 18:26:51 2018 +0200 net/mlx5e: Gather all XDP pre-requisite checks in a single function Dedicate a function to all checks done when setting an XDP program. Take indications from priv instead of netdev features. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit cb5189d173097af805ff74c88191aba25fc60a55 Author: Tariq Toukan Date: Tue Jun 12 10:09:24 2018 +0300 net/mlx5e: Do not recycle RX pages in interface down flow Keep all page-pool recycle calls within NAPI context. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit afab995e06ee1fb76de195a4fba9d03267f8dbe3 Author: Tariq Toukan Date: Tue Jun 12 10:08:43 2018 +0300 net/mlx5e: Replace call to MPWQE free with dealloc in interface down flow No need to expose the MPWQE free function to control path. The dealloc function already exposed, use it. Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 1497624fffab130608a8f2825f47fb8231a90355 Author: Federico Vaga Date: Sat Jul 7 00:05:17 2018 +0200 doc:it_IT: translation for kernel-hacking This patch includes the kernel-hacking translation in Italian (both hacking.rst and locking.rst). It adds also the anchors for the english kernel-hacking documents. Signed-off-by: Federico Vaga Signed-off-by: Jonathan Corbet commit c8cce10a62aaaca33bbdbe7356bde20a47790290 Author: Jonathan Corbet Date: Thu Jul 26 16:17:55 2018 -0600 docs: Fix the reference labels in Locking.rst Two jump tags were misspelled, leading to non-working cross-reference links. Reported-by: Federico Vaga Signed-off-by: Jonathan Corbet commit 2577188edcf3e235b4f060a350fad84510eb7680 Author: Qing Huang Date: Mon Jul 23 14:15:08 2018 -0700 IB/mlx5: avoid excessive warning msgs when creating VFs on 2nd port When a CX5 device is configured in dual-port RoCE mode, after creating many VFs against port 1, creating the same number of VFs against port 2 will flood kernel/syslog with something like "mlx5_*:mlx5_ib_bind_slave_port:4266:(pid 5269): port 2 already affiliated." So basically, when traversing mlx5_ib_dev_list, mlx5_ib_add_slave_port() repeatedly attempts to bind the new mpi structure to every device on the list until it finds an unbound device. Change the log level from warn to dbg to avoid log flooding as the warning should be harmless. Signed-off-by: Qing Huang Reviewed-by: Daniel Jurgens Signed-off-by: Jason Gunthorpe commit cdcdcaae8450a975e7d07e1bfec21f9b8c016d0c Author: Greg Edwards Date: Thu Jul 26 15:52:54 2018 -0400 scsi: virtio_scsi: fix pi_bytes{out,in} on 4 KiB block size devices When the underlying device is a 4 KiB logical block size device with a protection interval exponent of 0, i.e. 4096 bytes data + 8 bytes PI, the driver miscalculates the pi_bytes{out,in} by a factor of 8x (64 bytes). This leads to errors on all reads and writes on 4 KiB logical block size devices when CONFIG_BLK_DEV_INTEGRITY is enabled and the VIRTIO_SCSI_F_T10_PI feature bit has been negotiated. Fixes: e6dc783a38ec0 ("virtio-scsi: Enable DIF/DIX modes in SCSI host LLD") Acked-by: Martin K. Petersen Signed-off-by: Greg Edwards Signed-off-by: Jens Axboe commit 359f642700f2ff05d9c94cd9216c97af7b8e9553 Author: Greg Edwards Date: Wed Jul 25 10:22:58 2018 -0400 block: move bio_integrity_{intervals,bytes} into blkdev.h This allows bio_integrity_bytes() to be called from drivers instead of open coding it. Acked-by: Martin K. Petersen Signed-off-by: Greg Edwards Signed-off-by: Jens Axboe commit 1fee4f77523a3e5a44fa33c9aa76de8c6c42a632 Author: Masami Hiramatsu Date: Thu Jul 26 21:43:36 2018 +0900 doc: tracing: Fix a typo of trace_stat The name of the directory for per-cpu function statistics is trace_stat, not trace_stats. Signed-off-by: Masami Hiramatsu Acked-by: Steven Rostedt (VMware) Signed-off-by: Jonathan Corbet commit 6a8fab17940d4934293d4145abce00e178393bec Merge: c921d7db3d12 1918e937ca3b Author: David S. Miller Date: Thu Jul 26 14:14:01 2018 -0700 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 10GbE Intel Wired LAN Driver Updates 2018-07-26 This series contains updates to ixgbe and igb. Tony fixes ixgbe to add checks to ensure jumbo frames or LRO get enabled after an XDP program is loaded. Shannon Nelson adds the missing security configuration registers to the ixgbe register dump, which will help in debugging. Christian Grönke fixes an issue in igb that occurs on SGMII based SPF mdoules, by reverting changes from 2 previous patches. The issue was that initialization would fail on the fore mentioned modules because the driver would try to reset the PHY before obtaining the PHY address of the SGMII attached PHY. Venkatesh Srinivas replaces wmb() with dma_wmb() for doorbell writes, which avoids SFENCEs before the doorbell writes. Alex cleans up and refactors ixgbe Tx/Rx shutdown to reduce time needed to stop the device. The code refactor allows us to take the completion time into account when disabling queues, so that on some platforms with higher completion times, would not result in receive queues disabled messages. ==================== Signed-off-by: David S. Miller commit c921d7db3d1248c9091af070a7fdce2e55baa86a Author: Jiri Pirko Date: Thu Jul 26 18:27:58 2018 +0200 net: sched: unmark chain as explicitly created on delete Once user manually deletes the chain using "chain del", the chain cannot be marked as explicitly created anymore. Signed-off-by: Jiri Pirko Fixes: 32a4f5ecd738 ("net: sched: introduce chain object to uapi") Signed-off-by: David S. Miller commit 0a26cf3ff47d9e70fbed2fa79b0678ee70e25113 Author: Doron Roberts-Kedes Date: Wed Jul 25 14:48:21 2018 -0700 tls: Skip zerocopy path for ITER_KVEC The zerocopy path ultimately calls iov_iter_get_pages, which defines the step function for ITER_KVECs as simply, return -EFAULT. Taking the non-zerocopy path for ITER_KVECs avoids the unnecessary fallback. See https://lore.kernel.org/lkml/20150401023311.GL29656@ZenIV.linux.org.uk/T/#u for a discussion of why zerocopy for vmalloc data is not a good idea. Discovered while testing NBD traffic encrypted with ktls. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Doron Roberts-Kedes Signed-off-by: David S. Miller commit 2ed9db3074fcd8d12709fe40ff0e691d74229818 Author: Gustavo A. R. Silva Date: Wed Jul 25 09:07:24 2018 -0500 net: sched: cls_api: fix dead code in switch Code at line 1850 is unreachable. Fix this by removing the break statement above it, so the code for case RTM_GETCHAIN can be properly executed. Addresses-Coverity-ID: 1472050 ("Structurally dead code") Fixes: 32a4f5ecd738 ("net: sched: introduce chain object to uapi") Signed-off-by: Gustavo A. R. Silva Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 2b139e6b1ec86e1d3646039965dd79ad05d8dca4 Author: Guillaume Nault Date: Wed Jul 25 14:53:33 2018 +0200 l2tp: remove ->recv_payload_hook The tunnel reception hook is only used by l2tp_ppp for skipping PPP framing bytes. This is a session specific operation, but once a PPP session sets ->recv_payload_hook on its tunnel, all frames received by the tunnel will enter pppol2tp_recv_payload_hook(), including those targeted at Ethernet sessions (an L2TPv3 tunnel can multiplex PPP and Ethernet sessions). So this mechanism is wrong, and uselessly complex. Let's just move this functionality to the pppol2tp rx handler and drop ->recv_payload_hook. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 63135ee0a6e5f5a5ad1345e48099e62d3d617a81 Author: YueHaibing Date: Wed Jul 25 18:00:49 2018 +0800 tipc: add missing dev_put() on error in tipc_enable_l2_media when tipc_own_id failed to obtain node identity,dev_put should be call before return -EINVAL. Fixes: 682cd3cf946b ("tipc: confgiure and apply UDP bearer MTU on running links") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 201876b33c09edcb6c2914f0ced798437a102648 Author: Vakul Garg Date: Tue Jul 24 16:54:27 2018 +0530 net/tls: Removed redundant checks for non-NULL Removed checks against non-NULL before calling kfree_skb() and crypto_free_aead(). These functions are safe to be called with NULL as an argument. Signed-off-by: Vakul Garg Acked-by: Dave Watson Signed-off-by: David S. Miller commit 990e35ecba1cb8ebee4ad4a028735e24f4615417 Author: Vinicius Costa Gomes Date: Mon Jul 23 17:08:00 2018 -0700 cbs: Add support for the graft function This will allow to install a child qdisc under cbs. The main use case is to install ETF (Earliest TxTime First) qdisc under cbs, so there's another level of control for time-sensitive traffic. Signed-off-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit a61246c96195fc5f7500f6842e883b9eb1567d8d Author: Lance Shelton Date: Mon Jul 16 13:05:36 2018 -0400 Fix error code in nfs_lookup_verify_inode() Return -ESTALE to force a lookup when the file has no more links Signed-off-by: Lance Shelton Signed-off-by: Trond Myklebust commit 3825827ebf9973600347b16e848f3de52262ab6b Author: Trond Myklebust Date: Tue Jul 24 14:27:11 2018 -0400 NFS: More excessive attribute revalidation in nfs_execute_ok() execute_ok() will only check the mode bits if the object is not a directory, so we don't need to revalidate the attributes in that case. Signed-off-by: Trond Myklebust commit cf8340277f1128c4760976d0574359e6d765893c Author: Trond Myklebust Date: Fri Jul 20 16:19:35 2018 -0400 NFS: Fix excessive attribute revalidation in nfs_execute_ok() When nfs_update_inode() sets NFS_INO_INVALID_ACCESS it is a sign that we want to revalidate the access cache, not the inode attributes. In fact we only want to revalidate here if we see that the mode bits are invalid, so check for NFS_INO_INVALID_OTHER instead. Reported-by: Olga Kornievskaia Signed-off-by: Trond Myklebust commit 7be7b3ca16a59b8335ef2877f4696cf74f646d20 Author: Trond Myklebust Date: Wed Jul 4 21:01:16 2018 -0400 NFS: Ensure we immediately start writeback on rescheduled writes If the writes are being rescheduled due to a pNFS error, then we really want to immediately start a new flush. The O_DIRECT code already does this, so we only need to worry about buffered writes. Signed-off-by: Trond Myklebust commit bd3d16a887b0c19a2a20d35ffed499e3a3637feb Author: Trond Myklebust Date: Thu Jul 12 14:19:03 2018 -0400 NFSv4.1: Fix a potential layoutget/layoutrecall deadlock If the client is sending a layoutget, but the server issues a callback to recall what it thinks may be an outstanding layout, then we may find an uninitialised layout attached to the inode due to the layoutget. In that case, it is appropriate to return NFS4ERR_NOMATCHING_LAYOUT rather than NFS4ERR_DELAY, as the latter can end up deadlocking. Signed-off-by: Trond Myklebust commit af9b6d7570ca9afbbc6076ab7920d8f00f7e55c1 Author: Trond Myklebust Date: Fri Jun 29 12:45:53 2018 -0400 pNFS: Parse the results of layoutget on open even if permissions checks fail Even if the results of the permissions checks failed, we should parse the results of the layout on open call so that we can return the layout if required. Note that we also want to ignore the sequence counter for whether or not a layout recall occurred. If the recall pertained to our OPEN, then the callback will know, and will attempt to wait for us to finih processing anyway. Signed-off-by: Trond Myklebust commit b2b1ff3da6b27285c725eeb6f4c274da0a8e6a60 Author: Trond Myklebust Date: Wed Jun 27 16:25:40 2018 -0400 NFS: Allow optimisation of lseek(fd, SEEK_CUR, 0) on directories There should be no need to grab the inode lock if we're only reading the file offset. Signed-off-by: Trond Myklebust commit 411ae722d10a6d4eece758877eb5f395b35f6e9d Author: Trond Myklebust Date: Sat Jun 23 22:54:33 2018 -0400 pNFS: Wait for stale layoutget calls to complete in pnfs_update_layout() If the old layout was recalled, and we returned NFS4ERR_NOMATCHINGLAYOUT then we need to wait for all outstanding layoutget calls to complete before we can send a new one. Signed-off-by: Trond Myklebust commit 056f9ad62ed2776c80fdddb2eec7f709888618b7 Author: Trond Myklebust Date: Sat Jun 23 11:42:36 2018 -0400 pNFS/flexfiles: Ensure we always return a layout if it has layoutstats If a layout segment is carrying layoutstats or layout error information, then we always want to return it rather than using a forgetful model. Signed-off-by: Trond Myklebust commit f0b429819b5fbcedd1be15da7277292a0431ddd0 Author: Trond Myklebust Date: Sat Jun 23 16:55:37 2018 -0400 pNFS: Ignore non-recalled layouts in pnfs_layout_need_return() If a layout has been recalled, then we should fire off a layoutreturn as soon as all the layout segments that match the recall have been retired. Signed-off-by: Trond Myklebust commit 00bcbe119f915dec256f211f9dbfc93cb64773bc Author: Trond Myklebust Date: Sat Jun 23 13:35:28 2018 -0400 pNFS: Don't update the stateid when replying NFS4ERR_DELAY to a layout recall RFC5661 doesn't state directly that the client should update the layout stateid if it returns NFS4ERR_NOMATCHING_LAYOUT in response to a recall, however it does state that this error will "cleanly indicate completion" on par with returning the layout. For this reason, we assume that the client should update the layout stateid. The Linux pNFS server definitely does expect this behaviour. However, if the client replies NFS4ERR_DELAY, then it is stating that the recall was not processed, so it would be very wrong to update the layout stateid. Signed-off-by: Trond Myklebust commit e0b7d420f72a66b5299da025be8e8a17e019a557 Author: Trond Myklebust Date: Sat Jun 23 10:28:40 2018 -0400 pNFS: Don't discard layout segments that are marked for return If there are layout segments that are marked for return, then we need to ensure that pnfs_mark_matching_lsegs_return() does not just silently discard them, but it should tell the caller that there is a layoutreturn scheduled. Signed-off-by: Trond Myklebust commit 29ed45fff05899f6f39d05fe1c32b1bc51f8926b Merge: 692b12c75667 00673189b8b9 Author: Olof Johansson Date: Thu Jul 26 13:08:01 2018 -0700 Merge tag 'v4.18-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into next/drivers - add pmic wrapper support for mt6797 - pmic wrapper fix chiper init - add support for pmic mt6351 * tag 'v4.18-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: pwrap: add mt6351 driver for mt6797 SoCs soc: mediatek: pwrap: add pwrap driver for mt6797 SoCs soc: mediatek: pwrap: fix cipher init setting error dt-bindings: pwrap: mediatek: add pwrap support for MT6797 Signed-off-by: Olof Johansson commit c1c0f486d96663b309aedc537319118b06c79378 Merge: 34fbee109b0b a87399692129 Author: Olof Johansson Date: Thu Jul 26 13:06:14 2018 -0700 Merge tag 'v4.18-next-dts64' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into next/dt - mt7622: - add EINT support - add gpio-ranges property to pinctrl - add earlycon to rfb1 to find boot errros more easily - fix uart clock - add iommu and smi bindings - mt6797: - add support for the 96 board x20 development board - fix cooling-cells of mt7622 and mt8173 * tag 'v4.18-next-dts64' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm64: dts: Add Mediatek X20 Development Board support dt-bindings: arm: mediatek: Document Mediatek X20 Development Board dt-bindings: mediatek: Add binding for mt2712 IOMMU and SMI arm64: dts: mt7622: update a clock property for UART0 arm64: dts: mt7622: add earlycon to mt7622-rfb1 board arm64: dts: mt7622: use gpio-ranges to pinctrl device arm64: dts: mediatek: Add missing cooling device properties for CPUs arm64: dts: mt7622: add EINT support to pinctrl Signed-off-by: Olof Johansson commit 34fbee109b0bfab10d97a6ea48224e992cc6627b Merge: 31342a2150eb 11a20c5601c5 Author: Olof Johansson Date: Thu Jul 26 13:04:44 2018 -0700 Merge tag 'v4.18-next-dts32' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into next/dt - mt7623 - delete unsupported reference board - fix pio leds - add missing cooling device * tag 'v4.18-next-dts32' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: dt-bindings: arm: mediatek: cleanup MT7623N reference boards arm: dts: mt7623: cleanup MT7623N NAND dts file arm: dts: mediatek: Fix pio-leds for Bananapi-R2 arm: dts: mediatek: Add missing cooling device properties for CPUs Signed-off-by: Olof Johansson commit 3f30f929bb17877ebc1653c6f3ff41863f1ba524 Author: Bob Peterson Date: Thu Jul 26 12:59:13 2018 -0500 gfs2: cleanup: call gfs2_rgrp_ondisk2lvb from gfs2_rgrp_out Before this patch gfs2_rgrp_ondisk2lvb was called after every call to gfs2_rgrp_out. This patch just calls it directly from within gfs2_rgrp_out, and moves the function to be before it so we don't need a function prototype. Signed-off-by: Bob Peterson Reviewed-by: Andreas Gruenbacher commit 02c8547ca25db63d3375adbf488de711f48a7311 Merge: 8b0c9a98104f 90708adcd3ea Author: Olof Johansson Date: Thu Jul 26 12:22:10 2018 -0700 Merge tag 'aspeed-4.19-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed into next/defconfig ASPEED defconfig updates for 4.19 - Refresh the multi ARMv5 defconfig, and add AST2400 related drivers - Enable new ASPEED hardware that we've merged in the past few cycles. There are about 14 different drivers since we last refreshed the defconfig - Turn on features required by systemd, and other bits of OpenBMC userspace - Enable security related options * tag 'aspeed-4.19-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed: ARM: config: aspeed: Enable new FSI drivers ARM: config: multi_v5: Enable ASPEED drivers ARM: config: multi_v5: Refresh configuration ARM: config: aspeed: Update defconfig arm: configs: Add USB gadget to Aspeed G5 defconfig arm: configs: Add USB gadget to Aspeed G4 defconfig Signed-off-by: Olof Johansson commit d4da0e97baea8768b3d66ccef3967bebd50dfc3b Author: Paul Burton Date: Fri Nov 25 18:46:09 2016 +0000 MIPS: WARN_ON invalid DMA cache maintenance, not BUG_ON If a driver causes DMA cache maintenance with a zero length then we currently BUG and kill the kernel. As this is a scenario that we may well be able to recover from, WARN & return in the condition instead. Signed-off-by: Paul Burton Acked-by: Florian Fainelli Patchwork: https://patchwork.linux-mips.org/patch/14623/ Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 5bdd5fbb35ab0fe21bf2263106f51c5bee466a07 Author: Alban Bedel Date: Mon Feb 13 23:25:46 2017 +0100 MIPS: ath79: Fix the USB PHY reset names The binding for the USB PHY went thru before the driver. However the new version of the driver now use the PHY core support for reset, and this expect the reset to be named "phy". So remove the "usb-" prefix from the the reset names. Signed-off-by: Alban Bedel Acked-by: Rob Herring Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/15282/ Cc: linux-kernel@vger.kernel.org Cc: Rob Herring Cc: Mark Rutland Cc: Ralf Baechle Cc: Antony Pavlov Cc: devicetree@vger.kernel.org Cc: linux-mips@linux-mips.org commit 7cfcc71eb0e50f191983d714223c169c47437021 Author: Bart Van Assche Date: Mon Jul 23 15:37:01 2018 -0700 RDMA/usnic: Suppress a compiler warning This patch avoids that the following compiler warning is reported when building with gcc 8 and W=1: drivers/infiniband/hw/usnic/usnic_fwd.c:95:2: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20 [-Wstringop-truncation] strncpy(ufdev->name, netdev_name(ufdev->netdev), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sizeof(ufdev->name) - 1); ~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 5d85a822fae2b484f26ddb09815063a88962a0cb Author: Jason Gunthorpe Date: Thu Jul 26 11:36:50 2018 -0600 net/xprtrdma: Restore needed argument to ib_post_send The call in svc_rdma_post_chunk_ctxt() does actually use bad_wr. Fixes: ed288d74a9e5 ("net/xprtrdma: Simplify ib_post_(send|recv|srq_recv)() calls") Reported-by: Stephen Rothwell Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit a0553e01f85bb27fb7bbd32f6168f9592e9dc575 Author: Quentin Schulz Date: Wed Jul 25 14:22:41 2018 +0200 MIPS: mscc: ocelot: add MIIM1 bus There is an additional MIIM (MDIO) bus in this SoC so let's declare it in the dtsi. This bus requires GPIO 14 and 15 pins that need to be muxed. There is no support for internal PHY reset on this bus on the contrary of MIIM0 so there is only one register address space and not two. Signed-off-by: Quentin Schulz Acked-by: Alexandre Belloni Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20014/ Cc: robh+dt@kernel.org Cc: mark.rutland@arm.com Cc: ralf@linux-mips.org Cc: jhogan@kernel.org Cc: linux-mips@linux-mips.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: thomas.petazzoni@bootlin.com commit 49e5bb13adc11fe6e2e40f65c04f3a461aea1fec Author: Quentin Schulz Date: Wed Jul 25 14:21:32 2018 +0200 MIPS: mscc: ocelot: fix length of memory address space for MIIM The length of memory address space for MIIM0 is from 0x7107009c to 0x710700bf included which is 36 bytes long in decimal, or 0x24 bytes in hexadecimal and not 0x36. Fixes: 49b031690abe ("MIPS: mscc: Add switch to ocelot") Signed-off-by: Quentin Schulz Acked-by: Alexandre Belloni Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20013/ Cc: robh+dt@kernel.org Cc: mark.rutland@arm.com Cc: ralf@linux-mips.org Cc: jhogan@kernel.org Cc: linux-mips@linux-mips.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: thomas.petazzoni@bootlin.com commit 74a2c0c466284dd537fe467e4c5e3cb8db52a4b2 Author: Alexandre Belloni Date: Thu Jul 26 18:40:54 2018 +0200 MIPS: TXx9: remove useless RTC definitions The RTC definitions were moved to the driver, remove them from the platform header. [paul.burton@mips.com: - Also remove the unused tx4939_rtcptr which would use struct tx4939_rtc_reg if it were ever expanded.] Signed-off-by: Alexandre Belloni Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20024/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org commit 1c02d502c20809a2a5f71ec16a930a61ed779b81 Author: Eric Sandeen Date: Thu Jul 26 09:11:27 2018 -0700 xfs: remove deprecated barrier/nobarrier mount The barrier mount options have been no-ops and deprecated since 4cf4573 xfs: deprecate barrier/nobarrier mount option i.e. kernel 4.10 / December 2016, with a stated deprecation schedule after v4.15. Should be fair game to remove them now. Signed-off-by: Eric Sandeen Reviewed-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 44a8736bd20a08e1adbf479d11f8198a1243958d Author: Darrick J. Wong Date: Wed Jul 25 12:52:32 2018 -0700 xfs: clean up IRELE/iput callsites Replace the IRELE macro with a proper function so that we can do proper typechecking and so that we can stop open-coding iput in scrub, which means that we'll be able to ftrace inode lifetimes going through scrub correctly. Signed-off-by: Darrick J. Wong Reviewed-by: Carlos Maiolino Reviewed-by: Brian Foster commit 89c3e8cf3c266d61347abcc412b9330d81da794b Author: Darrick J. Wong Date: Wed Jul 25 12:51:48 2018 -0700 xfs: kill IHOLD Nobody uses this macro, get rid of it. Signed-off-by: Darrick J. Wong Reviewed-by: Carlos Maiolino commit b277c37f43dd387f7430a2186deda0e58c943087 Author: Brian Foster Date: Tue Jul 24 13:43:15 2018 -0700 xfs: bypass final dfops roll in trans commit path Once xfs_defer_finish() has completed all deferred operations, it checks the dirty state of the transaction and rolls it once more to return a clean transaction for the caller. This primarily to cover the case where repeated xfs_defer_finish() calls are made in a loop and we need to make sure that the caller starts the next iteration with a clean transaction. Otherwise we risk transaction reservation overrun. This final transaction roll is not required in the transaction commit path, however, because the transaction is immediately committed and freed after dfops completion. Refactor the final roll into a separate helper such that we can avoid it in the transaction commit path. Lift the dfops reset as well so dfops remains valid until after the last call to xfs_defer_trans_roll(). The reset is also unnecessary in the transaction commit path because the transaction is about to complete. This eliminates unnecessary regrants of transactions where the associated transaction roll can be replaced by a transaction commit. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9e28a242be65b8274742425ca5d146f366205a90 Author: Brian Foster Date: Tue Jul 24 13:43:15 2018 -0700 xfs: drop unnecessary xfs_defer_finish() dfops parameter Every caller of xfs_defer_finish() now passes the transaction and its associated ->t_dfops. The xfs_defer_ops parameter is therefore no longer necessary and can be removed. Since most xfs_defer_finish() callers also have to consider xfs_defer_cancel() on error, update the latter to also receive the transaction for consistency. The log recovery code contains an outlier case that cancels a dfops directly without an available transaction. Retain an internal wrapper to support this outlier case for the time being. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d5cca7eb244d276177a57e42494d479742bbba37 Author: Brian Foster Date: Tue Jul 24 13:43:14 2018 -0700 xfs: remove unnecessary dfops init calls in xattr code Each xfs_defer_init() call in the xattr code uses the internal dfops reference. In addition, a successful xfs_defer_finish() always returns with a reset xfs_defer_ops structure. Given that along with the fact that every xfs_defer_init() call in the xattr code is followed up by an xfs_defer_finish(), the former calls are no longer necessary and can be removed. Note that the xfs_defer_init() call in the remote value copy loop of xfs_attr_rmtval_set() is not followed by a finish, but the dfops is unused in this instance. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c8eac49ef798a7d00240847f63902caa1388241a Author: Brian Foster Date: Tue Jul 24 13:43:13 2018 -0700 xfs: remove all boilerplate defer init/finish code At this point, the transaction subsystem completely manages deferred items internally such that the common and boilerplate xfs_trans_alloc() -> xfs_defer_init() -> xfs_defer_finish() -> xfs_trans_commit() sequence can be replaced with a simple transaction allocation and commit. Remove all such boilerplate deferred ops code. In doing so, we change each case over to use the dfops in the transaction and specifically eliminate: - The on-stack dfops and associated xfs_defer_init() call, as the internal dfops is initialized on transaction allocation. - xfs_bmap_finish() calls that precede a final xfs_trans_commit() of a transaction. - xfs_defer_cancel() calls in error handlers that precede a transaction cancel. The only deferred ops calls that remain are those that are non-deterministic with respect to the final commit of the associated transaction or are open-coded due to special handling. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 91ef75b6572498face47746c253926e733a4da3b Author: Brian Foster Date: Tue Jul 24 13:43:13 2018 -0700 xfs: use internal dfops during [b|c]ui recovery bmap and refcount intent processing associates a dfops from the caller with a local transaction to collect all deferred items for post-processing. Use the internal dfops in both of these functions and move the deferred items to the parent dfops before the transaction commits. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9c6bb0cf7ba318767107328f39aac880344ddd2e Author: Brian Foster Date: Tue Jul 24 13:43:12 2018 -0700 xfs: use internal dfops in attr code Remove the unnecessary on-stack dfops structure and use the internal transaction dfops instead. The lower level xattr code already appropriately accesses ->t_dfops throughout. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1e5ae1995a44f2b7a03f08a10504568a96040a8c Author: Brian Foster Date: Tue Jul 24 13:43:12 2018 -0700 xfs: use internal dfops in cow blocks cancel All callers either explicitly initialize a dfops or pass a transaction with an internal dfops. Drop the hacky old dfops replacement logic and use the one associated with the transaction. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e021a2e5fc520d930f949f303e7307038e258645 Author: Brian Foster Date: Tue Jul 24 13:43:11 2018 -0700 xfs: support embedded dfops in transaction The dfops structure used by multi-transaction operations is typically stored on the stack and carried around by the associated transaction. The lifecycle of dfops does not quite match that of the transaction, but they are tightly related in that the former depends on the latter. The relationship of these objects is tight enough that we can avoid the cumbersome boilerplate code required in most cases to manage them separately by just embedding an xfs_defer_ops in the transaction itself. This means that a transaction allocation returns with an initialized dfops, a transaction commit finishes pending deferred items before the tx commit, a transaction cancel cancels the dfops before the transaction and a transaction dup operation transfers the current dfops state to the new transaction. The dup operation is slightly complicated by the fact that we can no longer just copy a dfops pointer from the old transaction to the new transaction. This is solved through a dfops move helper that transfers the pending items and other dfops state across the transactions. This also requires that transaction rolling code always refer to the transaction for the current dfops reference. Finally, to facilitate incremental conversion to the internal dfops and continue to support the current external dfops mode of operation, create the new ->t_dfops_internal field with a layer of indirection. On allocation, ->t_dfops points to the internal dfops. This state is overridden by callers who re-init a local dfops on the transaction. Once ->t_dfops is overridden, the external dfops reference is maintained as the transaction rolls. This patch adds the fundamental ability to support an internal dfops. All codepaths that perform deferred processing continue to override the internal dfops until they are converted over in subsequent patches. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 44fd294681de73990da656294e3dacaa7878f577 Author: Brian Foster Date: Tue Jul 24 13:43:11 2018 -0700 xfs: pack holes in xfs_defer_ops and xfs_trans Both structures have holes due to member alignment. Move dop_low to the end of xfs_defer ops to sanitize the cache line alignment and move t_flags to save 8 bytes in xfs_trans. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 509308b413c9e4e3140b4bc524522255d126787e Author: Brian Foster Date: Tue Jul 24 13:43:10 2018 -0700 xfs: reset dfops to initial state after finish xfs_defer_init() is currently used in two particular situations. The first and most obvious case is raw initialization of an xfs_defer_ops struct. The other case is partial reinit of xfs_defer_ops on reuse due to iteration. Most instances of the first case will be replaced by a single init of a dfops embedded in the transaction. Init calls are still technically required for the second case because the dfops may have low space mode enabled or have joined items that need to be reset before the dfops should be reused. Since the current dfops usage expects either a final transaction commit after xfs_defer_finish() or xfs_defer_init() if dfops is to be reused, we can shift some of the init logic into xfs_defer_finish() such that the latter returns with a reinitialized dfops. This eliminates the second dependency noted above such that a dfops is immediately ready for reuse after an xfs_defer_finish() without the need to change any calling code. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 83200bfac6082a46cc962366478d050052e50450 Author: Brian Foster Date: Tue Jul 24 13:43:09 2018 -0700 xfs: remove unused deferred ops committed field dop_committed is set when deferred item processing rolls the transaction at least once, but is only ever accessed in tracepoints. The transaction roll/commit events are already available via independent tracepoints, so remove the otherwise unused field. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 03f4e4b26cd5f6eed728f82d90039a19d1b51ce3 Author: Brian Foster Date: Tue Jul 24 13:43:09 2018 -0700 xfs: make deferred processing safe for embedded dfops xfs_defer_finish() has a couple quirks that are not safe with respect to the upcoming internal dfops functionality. First, xfs_defer_finish() attaches the passed in dfops structure to ->t_dfops and caches and restores the original value. Second, it continues to use the initial dfops reference before and after the transaction roll. These behaviors assume that dop is an independent memory allocation from the transaction itself, which may not always be true once transactions begin to use an embedded dfops structure. In the latter model, dfops processing creates a new xfs_defer_ops structure with each transaction and the associated state is migrated across to the new transaction. Fix up xfs_defer_finish() to handle the possibility of the current dfops changing after a transaction roll. Since ->t_dfops is used unconditionally in this path, it is no longer necessary to attach/restore ->t_dfops and pass it explicitly down to xfs_defer_trans_roll(). Update dop in the latter function and the caller to ensure that it always refers to the current dfops structure. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit dcbd44f79986e55691600b969c14db004d741883 Author: Brian Foster Date: Tue Jul 24 13:43:08 2018 -0700 xfs: fix transaction leak on remote attr set/remove failure The xattr remote value set/remove handlers both clear args.trans in the error path without having cancelled the transaction. This leaks the transaction, causes warnings around returning to userspace with locks held and leads to system lockups or other general problems. The higher level xfs_attr_[set|remove]() functions already detect and cancel args.trans when set in the error path. Drop the NULL assignments from the rmtval handlers and allow the callers to clean up the transaction correctly. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a61acc3c78df14bb9b7bfefb2cc771fcda15b8fe Author: Brian Foster Date: Tue Jul 24 13:43:08 2018 -0700 xfs: use ->t_dfops in log recovery intent processing xlog_finish_defer_ops() processes the deferred operations collected over the entire intent recovery sequence. We can't xfs_defer_init() here because the dfops is already populated. Attach it manually and eliminate the last caller of xfs_defer_finish() that doesn't pass ->t_dfops. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 02dff7bf81685b6770a082243060e0b5aac348cf Author: Brian Foster Date: Tue Jul 24 13:43:07 2018 -0700 xfs: pull up dfops from xfs_itruncate_extents() xfs_itruncate_extents[_flags]() uses a local dfops with a transaction provided by the caller. It uses hacky ->t_dfops replacement logic to avoid stomping over an already populated ->t_dfops. The latter never occurs for current callers and the logic itself is not really appropriate. Clean this up by updating all callers to initialize a dfops and to use that down in xfs_itruncate_extents(). This more closely resembles the upcoming logic where dfops will be embedded within the transaction. We can also replace the xfs_defer_init() in the xfs_itruncate_extents_flags() loop with an assert. Both dfops and firstblock should be in a valid state after xfs_defer_finish() and the inode joined to the dfops is fixed throughout the loop. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 336a443bd9ddca319b99b5375e7756724a5545dd Author: YueHaibing Date: Thu Jul 26 21:19:58 2018 +0800 net: hns: Make many functions static Fixes the following sparse warning: drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:73:20: warning: symbol 'hns_ae_get_handle' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:332:6: warning: symbol 'hns_ae_stop' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:360:6: warning: symbol 'hns_ae_toggle_ring_irq' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:580:6: warning: symbol 'hns_ae_update_stats' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:663:6: warning: symbol 'hns_ae_get_stats' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:695:6: warning: symbol 'hns_ae_get_strings' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:728:5: warning: symbol 'hns_ae_get_sset_count' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:774:6: warning: symbol 'hns_ae_update_led_status' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:786:5: warning: symbol 'hns_ae_cpld_set_led_id' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:798:6: warning: symbol 'hns_ae_get_regs' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c:823:5: warning: symbol 'hns_ae_get_regs_len' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c:342:6: warning: symbol 'hns_gmac_update_stats' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:934:12: warning: symbol 'hns_mac_get_vaddr' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:953:5: warning: symbol 'hns_mac_get_cfg' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:343:6: warning: symbol 'hns_dsaf_srst_chns' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:366:1: warning: symbol 'hns_dsaf_srst_chns_acpi' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:373:6: warning: symbol 'hns_dsaf_roce_srst' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:387:6: warning: symbol 'hns_dsaf_roce_srst_acpi' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:571:5: warning: symbol 'hns_mac_get_sfp_prsnt' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:589:5: warning: symbol 'hns_mac_get_sfp_prsnt_acpi' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:31:12: warning: symbol 'g_dsaf_mode_match' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:45:5: warning: symbol 'hns_dsaf_get_cfg' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:962:6: warning: symbol 'hns_dsaf_tcam_addr_get' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:2087:6: warning: symbol 'hns_dsaf_port_work_rate_cfg' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:2837:5: warning: symbol 'hns_dsaf_roce_reset' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:76:5: warning: symbol 'hns_ppe_common_get_cfg' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:107:6: warning: symbol 'hns_ppe_common_free_cfg' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c:340:6: warning: symbol 'hns_ppe_uninit_ex' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c:708:5: warning: symbol 'hns_rcb_get_ring_num' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c:744:14: warning: symbol 'hns_rcb_common_get_vaddr' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c:314:6: warning: symbol 'hns_xgmac_update_stats' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_enet.c:1303:6: warning: symbol 'hns_nic_update_stats' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_enet.c:1585:6: warning: symbol 'hns_nic_poll_controller' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_enet.c:1938:6: warning: symbol 'hns_set_multicast_list' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_enet.c:1960:6: warning: symbol 'hns_nic_set_rx_mode' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:661:6: warning: symbol 'hns_get_ringparam' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:811:6: warning: symbol 'hns_get_channels' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:828:6: warning: symbol 'hns_get_ethtool_stats' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:886:6: warning: symbol 'hns_get_strings' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:976:5: warning: symbol 'hns_get_sset_count' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:1010:5: warning: symbol 'hns_phy_led_set' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:1032:5: warning: symbol 'hns_set_phys_id' was not declared. Should it be static? drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:1106:6: warning: symbol 'hns_get_regs' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit eb91f42ef074467e0c441a9789dc1fc0519a25ad Author: Anders Roxell Date: Thu Jul 26 11:53:58 2018 +0200 selftests/net: add tls to .gitignore Add the tls binary to .gitignore Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets") Signed-off-by: Anders Roxell Signed-off-by: David S. Miller commit 5a967512bb812d7a4b7e9f3930f49d6d88533dc3 Author: Jiri Pirko Date: Thu Jul 26 11:38:34 2018 +0200 selftests: forwarding: add tests for TC chain get and dump operations Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 8adf3df4156345f1edcdfa8c7f7beeb0de351ce2 Author: Takashi Iwai Date: Wed Jul 25 23:17:22 2018 +0200 ASoC: dmaengine: Use standard pcm_format_to_bits() macro The conversion from PCM format type to bits needs an explicit cast, and it'll be uglier. Since we have a standard macro for that, let's use it instead. This patch fixes the sparse warning: sound/soc/soc-generic-dmaengine-pcm.c:200:63: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit 79b8a50813a80ac15fdcdc96674098dee15eaaf5 Author: Takashi Iwai Date: Wed Jul 25 23:17:21 2018 +0200 ASoC: pcm186x: Declare PCM format with snd_pcm_format_t The PCM format type is with __bitwise, so we should use the dedicated snd_pcm_format_t instead of int. This fixes the sparse warning like: sound/soc/codecs/pcm186x.c:268:44: warning: incorrect type in initializer (different base types) Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit ebc22af0c9268dc4032326c20b02f2f227203330 Author: Takashi Iwai Date: Wed Jul 25 23:17:20 2018 +0200 ASoC: fsl: Use snd_mask_set_format() Use the new helper function snd_mask_set_format() for avoiding the ugly cast with __force prefix. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit b5453e8ca311fdb6003c6583ad101d2b9131b994 Author: Takashi Iwai Date: Wed Jul 25 23:17:19 2018 +0200 ASoC: intel: Fix snd_pcm_format_t handling As sparse warns, the PCM format type can't be dealt as integer as found in Intel SST driver codes. Fix them in the following two ways: - The open code with snd_mask_set() and params->masks reference is replaced with params_set_format() - The rest codes with snd_mask_set(fmt, SNDRV_PCM_FORMAT_XXX) are replaced with the new helper, snd_mask_set_format(). Reported-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit 533a9274850b041b32fbe6d1df58a5c5b0b9e652 Author: Takashi Iwai Date: Wed Jul 25 23:17:18 2018 +0200 ASoC: doc: Replace open code with params_set_format() The example code in dpcm.rst contains an open code calling snd_mask_set(), and this can be better represented with params_set_format() instead. This automatically fixes the sparse warning about snd_pcm_format_t handling, too. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit 0b62834e73e332fea76a340d62aaf50c732b17e0 Author: Takashi Iwai Date: Wed Jul 25 23:17:17 2018 +0200 ALSA: pcm: Add snd_mask_set_format() helper for standard usages Many drivers calling snd_mask_set() need to do ugly cast with __force for shutting up the sparse warnings. Actually almost all of them are about setting the format, so it's far better to provide a common helper snd_mask_set_format() to pass SNDRV_PCM_FORMAT_* directly without the cast. There are a few other calls of snd_mask_set(), but they are in the PCM core code, so we leave them for now. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit fd56361177a3c10133c272eb130e3c11f0bcd9a9 Merge: 3ba66feb5981 4cae99d9b530 Author: Mark Brown Date: Thu Jul 26 17:08:39 2018 +0100 Merge tag 'alsa-add-snd-sgbuf-aligned-pages' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-4.19 ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined. commit 4cae99d9b5305ab8cccc839fccceb81ec9e5abda Author: Pierre-Louis Bossart Date: Wed Jul 25 15:15:56 2018 -0500 ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined. Reported-by: kbuild test robot Signed-off-by: Pierre-Louis Bossart Reviewed-by: Takashi Iwai Signed-off-by: Mark Brown commit 1918e937ca3b4270181e6f05734d5240306bd2cf Author: Alexander Duyck Date: Fri Jul 20 18:29:34 2018 -0400 ixgbe: Refactor queue disable logic to take completion time into account This change is meant to allow us to take completion time into account when disabling queues. Previously we were just working with hard coded values for how long we should wait. This worked fine for the standard case where completion timeout was operating in the 50us to 50ms range, however on platforms that have higher completion timeout times this was resulting in Rx queues disable messages being displayed as we weren't waiting long enough for outstanding Rx DMA completions. Signed-off-by: Alexander Duyck Tested-by: Don Buchholz Signed-off-by: Jeff Kirsher commit 3b5f14b50ee2079190ae6cfe7477e74676651665 Author: Alexander Duyck Date: Fri Jul 20 18:29:29 2018 -0400 ixgbe: Reorder Tx/Rx shutdown to reduce time needed to stop device This change is meant to help reduce the time needed to shutdown the transmit and receive paths for the device. Specifically what we now do after this patch is disable the transmit path first at the netdev level, and then work on disabling the Rx. This way while we are waiting on the Rx queues to be disabled the Tx queues have an opportunity to drain out. In addition I have dropped the 10ms timeout that was left in the ixgbe_down function that seems to have been carried through from back in e1000 as far as I can tell. We shouldn't need it since we don't actually disable the Tx until much later and we have additional logic in place for verifying the Tx queues have been disabled. Signed-off-by: Alexander Duyck Tested-by: Don Buchholz Signed-off-by: Jeff Kirsher commit 73017f4e051c86985cf4647eceee34de7c13b1b1 Author: Venkatesh Srinivas Date: Fri May 25 00:13:21 2018 -0400 igb: Use dma_wmb() instead of wmb() before doorbell writes igb writes to doorbells to post transmit and receive descriptors; after writing descriptors to memory but before writing to doorbells, use dma_wmb() rather than wmb(). wmb() is more heavyweight than necessary before doorbell writes. On x86, this avoids SFENCEs before doorbell writes in both the tx and rx refill paths. Signed-off-by: Venkatesh Srinivas Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 2a83fba6cae89dd9c0625e68ff8ffff791c67ac0 Author: Christian Grönke Date: Tue Jun 26 10:12:18 2018 +0000 igb: Remove superfluous reset to PHY and page 0 selection This patch reverts two previous applied patches to fix an issue that appeared when using SGMII based SFP modules. In the current state the driver will try to reset the PHY before obtaining the phy_addr of the SGMII attached PHY. That leads to an error in e1000_write_phy_reg_sgmii_82575. Causing the initialization to fail: igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k igb: Copyright (c) 2007-2014 Intel Corporation. igb: probe of ????:??:??.? failed with error -3 The patches being reverted are: commit 182785335447957409282ca745aa5bc3968facee Author: Aaron Sierra Date: Tue Nov 29 10:03:56 2016 -0600 igb: reset the PHY before reading the PHY ID commit 440aeca4b9858248d8f16d724d9fa87a4f65fa33 Author: Matwey V Kornilov Date: Thu Nov 24 13:32:48 2016 +0300 igb: Explicitly select page 0 at initialization The first reverted patch directly causes the problem mentioned above. In case of SGMII the phy_addr is not known at this point and will only be obtained by 'igb_get_phy_id_82575' further down in the code. The second removed patch selects forces selection of page 0 in the PHY. Something that the reset tries to address as well. As pointed out by Alexander Duzck, the patch below fixes the same issue but in the proper location: commit 4e684f59d760a2c7c716bb60190783546e2d08a1 Author: Chris J Arges Date: Wed Nov 2 09:13:42 2016 -0500 igb: Workaround for igb i210 firmware issue Reverts: 440aeca4b9858248d8f16d724d9fa87a4f65fa33. Reverts: 182785335447957409282ca745aa5bc3968facee. Signed-off-by: Christian Grönke Reviewed-by: Alexander Duyck Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 7f6cdbdafbd19191ef88ca148747a213f422be43 Author: Shannon Nelson Date: Mon Jul 2 17:09:30 2018 -0700 ixgbe: add ipsec security registers into ethtool register dump Add the ixgbe's security configuration registers into the register dump. Signed-off-by: Shannon Nelson Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 38b7e7f8ae821bbed28a13b3ac7a7a58aa7cdb95 Author: Tony Nguyen Date: Wed May 30 16:14:23 2018 -0700 ixgbe: Do not allow LRO or MTU change with XDP XDP does not support jumbo frames or LRO. These checks are being made outside the driver when an XDP program is loaded, however, there is nothing preventing these from changing after an XDP program is loaded. Add the checks so that while an XDP program is loaded, do not allow MTU to be changed or LRO to be enabled. Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit c32cd419d6650e42b9cdebb83c672ec945e6bd7e Author: Russell King Date: Mon Jul 9 10:05:22 2018 +0100 ARM: signal: copy registers using __copy_from_user() __get_user_error() is used as a fast accessor to make copying structure members in the signal handling path as efficient as possible. However, with software PAN and the recent Spectre variant 1, the efficiency is reduced as these are no longer fast accessors. In the case of software PAN, it has to switch the domain register around each access, and with Spectre variant 1, it would have to repeat the access_ok() check for each access. It becomes much more efficient to use __copy_from_user() instead, so let's use this for the ARM integer registers. Acked-by: Mark Rutland Signed-off-by: Russell King commit 643d213a9a034fa04f5575a40dfc8548e33ce04f Author: Parav Pandit Date: Mon Jul 16 11:50:13 2018 +0300 RDMA/cma: Do not ignore net namespace for unbound cm_id Currently if the cm_id is not bound to any netdevice, than for such cm_id, net namespace is ignored; which is incorrect. Regardless of cm_id bound to a netdevice or not, net namespace must match. When a cm_id is bound to a netdevice, in such case net namespace and netdevice both must match. Fixes: 4c21b5bcef73 ("IB/cma: Add net_dev and private data checks to RDMA CM") Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d274e45ce1ed0bc5750f4d3f066bfc164843216b Author: Parav Pandit Date: Mon Jul 16 11:50:12 2018 +0300 RDMA/cma: Consider netdevice for RoCE ports When netdevice is not found for a request, and if it for RoCE port, currently it allows matching the listener as long as port number matches by ignoring the netdevice. Now that we always prefer to have netdevice associated with RoCE, when netdevice is not found, don't consider RoCE ports. In other words, a NULL netdevice with RoCE is not acceptable. Therefore, remove this confusing RoCE port ignorance check. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cee104334c98dd04e9dd4d9a4fa4784f7f6aada9 Author: Parav Pandit Date: Mon Jul 16 11:50:11 2018 +0300 IB/core: Introduce and use sgid_attr in CM requests For RoCE, when CM requests are received for RC and UD connections, netdevice of the incoming request is unavailable. Because of that CM requests are always forwarded to init_net namespace. Now that we have the GID attribute available, introduce SGID attribute in incoming CM requests and refer to the netdevice of it. This is similar to existing SGID attribute field in outgoing CM requests for RC and UD transports. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 72809cbf6748830ae4a59a45bcb2367a6c24d74d Author: Masami Hiramatsu Date: Thu Jul 26 21:44:32 2018 +0900 tracing: Remove orphaned function ftrace_nr_registered_ops() Remove ftrace_nr_registered_ops() because it is no longer used. ftrace_nr_registered_ops() has been introduced by commit ea701f11da44 ("ftrace: Add selftest to test function trace recursion protection"), but its caller has been removed by commit 05cbbf643b8e ("tracing: Fix selftest function recursion accounting"). So it is not called anymore. Link: http://lkml.kernel.org/r/153260907227.12474.5234899025934963683.stgit@devbox Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 7b144b6c795a380beae6f7b40dcfb21014c4afb8 Author: Masami Hiramatsu Date: Thu Jul 26 21:44:04 2018 +0900 tracing: Remove orphaned function using_ftrace_ops_list_func(). Remove using_ftrace_ops_list_func() since it is no longer used. Using ftrace_ops_list_func() has been introduced by commit 7eea4fce0246 ("tracing/stack_trace: Skip 4 instead of 3 when using ftrace_ops_list_func") as a helper function, but its caller has been removed by commit 72ac426a5bb0 ("tracing: Clean up stack tracing and fix fentry updates"). So it is not called anymore. Link: http://lkml.kernel.org/r/153260904427.12474.9952096317439329851.stgit@devbox Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit f6b7425cfb92cbf0d04de816bec1bd8cb9a79d0f Author: Steven Rostedt (VMware) Date: Tue Jul 24 18:55:58 2018 -0400 tracing: Make unregister_trigger() static Nothing uses unregister_trigger() outside of trace_events_trigger.c file, thus it should be static. Not sure why this was ever converted, because its counter part, register_trigger(), was always static. Signed-off-by: Steven Rostedt (VMware) commit 8bd1369b4c2b532865b706c97f1a8ae4c6a36a71 Author: Joel Fernandes (Google) Date: Tue Jul 10 23:35:40 2018 -0700 kselftests: Add tests for the preemptoff and irqsoff tracers Here we add unit tests for the preemptoff and irqsoff tracer by using a kernel module introduced previously to trigger long preempt or irq disabled sections in the kernel. Link: http://lkml.kernel.org/r/20180711063540.91101-3-joel@joelfernandes.org Reviewed-by: Masami Hiramatsu Acked-by: Masami Hiramatsu Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit f96e8577da1026c344e49c75111303888d225389 Author: Joel Fernandes (Google) Date: Thu Jul 12 14:36:11 2018 -0700 lib: Add module for testing preemptoff/irqsoff latency tracers Here we introduce a test module for introducing a long preempt or irq disable delay in the kernel which the preemptoff or irqsoff tracers can detect. This module is to be used only for test purposes and is default disabled. Following is the expected output (only briefly shown) that can be parsed to verify that the tracers are working correctly. We will use this from the kselftests in future patches. For the preemptoff tracer: echo preemptoff > /d/tracing/current_tracer sleep 1 insmod ./preemptirq_delay_test.ko test_mode=preempt delay=500000 sleep 1 bash-4.3# cat /d/tracing/trace preempt -1066 2...2 0us@: preemptirq_delay_run <-preemptirq_delay_run preempt -1066 2...2 500002us : preemptirq_delay_run <-preemptirq_delay_run preempt -1066 2...2 500004us : tracer_preempt_on <-preemptirq_delay_run preempt -1066 2...2 500012us : => kthread => ret_from_fork For the irqsoff tracer: echo irqsoff > /d/tracing/current_tracer sleep 1 insmod ./preemptirq_delay_test.ko test_mode=irq delay=500000 sleep 1 bash-4.3# cat /d/tracing/trace irq dis -1069 1d..1 0us@: preemptirq_delay_run irq dis -1069 1d..1 500001us : preemptirq_delay_run irq dis -1069 1d..1 500002us : tracer_hardirqs_on <-preemptirq_delay_run irq dis -1069 1d..1 500005us : => ret_from_fork Link: http://lkml.kernel.org/r/20180712213611.GA8743@joelaf.mtv.corp.google.com Cc: Boqun Feng Cc: Byungchul Park Cc: Ingo Molnar Cc: Julia Cartwright Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Namhyung Kim Cc: Paul McKenney Cc: Peter Zijlstra Cc: Shuah Khan Cc: Thomas Glexiner Cc: Todd Kjos Cc: Tom Zanussi Cc: Andy Shevchenko Reviewed-by: Andy Shevchenko [ Erick is a co-developer of this commit ] Signed-off-by: Erick Reyes Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 2b27ece6c50c7f0a1db372786731be1a17c5b606 Author: Joel Fernandes (Google) Date: Thu Jun 28 11:21:45 2018 -0700 tracing/irqsoff: Split reset into separate functions Split reset functions into seperate functions in preparation of future patches that need to do tracer specific reset. Link: http://lkml.kernel.org/r/20180628182149.226164-4-joel@joelfernandes.org Reviewed-by: Namhyung Kim Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 0b764a6e4e19dc254caca636002eaa47b1d0b0af Author: Joel Fernandes (Google) Date: Thu Jun 28 11:21:44 2018 -0700 srcu: Add notrace variant of srcu_dereference In the last patch in this series, we are making lockdep register hooks onto the irq_{disable,enable} tracepoints. These tracepoints use the _rcuidle tracepoint variant. In this series we switch the _rcuidle tracepoint callers to use SRCU instead of sched-RCU. Inorder to dereference the pointer to the probe functions, we could call srcu_dereference, however this API will call back into lockdep to check if the lock is held *before* the lockdep probe hooks have a chance to run and annotate the IRQ enabled/disabled state. For this reason we need a notrace variant of srcu_dereference since otherwise we get lockdep splats. This patch adds the needed srcu_dereference_notrace variant. Link: http://lkml.kernel.org/r/20180628182149.226164-3-joel@joelfernandes.org Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 1f45a4db3657c5ecafb7d3331536c987e6d18311 Author: Paul McKenney Date: Thu Jun 28 11:21:43 2018 -0700 srcu: Add notrace variants of srcu_read_{lock,unlock} This is needed for a future tracepoint patch that uses srcu, and to make sure it doesn't call into lockdep. tracepoint code already calls notrace variants for rcu_read_lock_sched so this patch does the same for srcu which will be used in a later patch. Keeps it consistent with rcu-sched. [Joel: Added commit message] Link: http://lkml.kernel.org/r/20180628182149.226164-2-joel@joelfernandes.org Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Paul McKenney Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 3ba66feb59810e2ce616da0c4f1a5230c74768a8 Author: Takashi Iwai Date: Wed Jul 25 22:43:26 2018 +0200 ASoC: dapm: Use int for format bit position fmt in snd_soc_dai_link_event() contains the format bit position, not the format bit itself. Hence it can be a simple integer instead of the explicit u64. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit 40d1299f87bf915931970c8e6ea3852acacd1889 Author: Takashi Iwai Date: Wed Jul 25 22:42:08 2018 +0200 ASoC: dmaengine: Fix missing __user prefix in copy_user callback It seems that __user prefix was forgotten to be added to dmaengine_copy_user callback while we refactored the user-copy PCM core. This patch adds the missing prefix, remove the superfluous cast, and add the needed cast (__force is needed for downgrading from user pointer to kernel pointer), too. Spotted by a sparse warning like: sound/soc/soc-generic-dmaengine-pcm.c:397:27: warning: incorrect type in initializer (incompatible argument 4 (different address spaces)) Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit c889a45d229938a94b50aadb819def8bb11a6a54 Author: Takashi Iwai Date: Wed Jul 25 22:40:49 2018 +0200 ASoC: zte: Fix incorrect PCM format bit usages zx-tdm driver sets the DAI driver definitions with the format bits wrongly set with SNDRV_PCM_FORMAT_*, instead of SNDRV_PCM_FMTBIT_*. This patch corrects the definitions. Spotted by a sparse warning: sound/soc/zte/zx-tdm.c:363:35: warning: restricted snd_pcm_format_t degrades to integer Fixes: 870e0ddc4345 ("ASoC: zx-tdm: add zte's tdm controller driver") Cc: Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit 150a6dc8fc764c1912fa2a46e18d1505dfd3536f Author: Hiroyuki Yokoyama Date: Thu Jul 26 05:40:15 2018 +0900 ASoC: rsnd: Document R-Car M3-N support Document support for the sound modules in the Renesas M3-N (r8a77965) SoC. No driver update is needed. Signed-off-by: Hiroyuki Yokoyama Signed-off-by: Yoshihiro Kaneko Acked-by: Kuninori Morimoto Reviewed-by: Simon Horman Signed-off-by: Mark Brown commit 435857e015dc7b337c5f21d195ac2e4ffd694283 Author: Jerome Brunet Date: Thu Jul 26 14:45:44 2018 +0200 ASoC: meson: align axg card driver with DT bindings documentation Drop amlogic prefix in front of the generic DT properties and change property "name" to "model". Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit d9e81048127604fe6373fb76181fefcf218965f4 Author: Jerome Brunet Date: Thu Jul 26 14:45:43 2018 +0200 ASoC: meson: update axg sound card bindings Remove the amlogic prefix in front of the generic properties and change the card 'name' property to 'model' Suggested-by: Rob Herring Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 036e4963bfb2d4513c30efd80e4bd50ff6c79e3e Author: Jerome Brunet Date: Thu Jul 26 14:45:42 2018 +0200 ASoC: meson: use IRQ_RETVAL in the fifo irq handler Use IRQ_RETVAL instead of the open coded ternary operation. Suggested-by: Takashi Iwai Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 2f2eb723b50b4da887a34570ff15a3c23d966b85 Author: Rajesh Yadav Date: Fri Jul 13 18:27:23 2018 +0530 drm/msm: rework vblank event handling in dpu_crtc The vblank on/off calls were missing in dpu_crtc leading to "driver forgot to call drm_crtc_vblank_off()" warning while entering suspend state. Also handle the state update completion event for a crtc being disabled in current atomic commit. This patch depends on https://www.spinics.net/lists/dri-devel/msg182402.html Signed-off-by: Rajesh Yadav Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 25fdd5933e4c0f5fe2ea5cd59994f8ac5fbe90ef Author: Jeykumar Sankaran Date: Wed Jun 27 15:26:09 2018 -0400 drm/msm: Add SDM845 DPU support SDM845 SoC includes the Mobile Display Sub System (MDSS) which is a top level wrapper consisting of Display Processing Unit (DPU) and display peripheral modules such as Display Serial Interface (DSI) and DisplayPort (DP). MDSS functions essentially as a back-end composition engine. It blends video and graphic images stored in the frame buffers and scans out the composed image to a display sink (over DSI/DP). The following diagram represents hardware blocks for a simple pipeline (two planes are present on a given crtc which is connected to a DSI connector): MDSS +---------------------------------+ | +-----------------------------+ | | | DPU | | | | +--------+ +--------+ | | | | | SSPP | | SSPP | | | | | +----+---+ +----+---+ | | | | | | | | | | +----v-----------v---+ | | | | | Layer Mixer (LM) | | | | | +--------------------+ | | | | +--------------------+ | | | | | PingPong (PP) | | | | | +--------------------+ | | | | +--------------------+ | | | | | INTERFACE (VIDEO) | | | | | +---+----------------+ | | | +------|----------------------+ | | | | | +------|---------------------+ | | | | DISPLAY PERIPHERALS | | | | +---v-+ +-----+ | | | | | DSI | | DP | | | | | +-----+ +-----+ | | | +----------------------------+ | +---------------------------------+ The number of DPU sub-blocks (i.e. SSPPs, LMs, PP blocks and INTFs) depends on SoC capabilities. Overview of DPU sub-blocks: --------------------------- * Source Surface Processor (SSPP): Refers to any of hardware pipes like ViG, DMA etc. Only ViG pipes are capable of performing format conversion, scaling and quality improvement for source surfaces. * Layer Mixer (LM): Blend source surfaces together (in requested zorder) * PingPong (PP): This block controls frame done interrupt output, EOL and EOF generation, overflow/underflow control. * Display interface (INTF): Timing generator and interface connecting the display peripherals. DRM components mapping to DPU architecture: ------------------------------------------ PLANEs maps to SSPPs CRTC maps to LMs Encoder maps to PPs, INTFs Data flow setup: --------------- MDSS hardware can support various data flows (e.g.): - Dual pipe: Output from two LMs combined to single display. - Split display: Output from two LMs connected to two separate interfaces. The hardware capabilities determine the number of concurrent data paths possible. Any control path (i.e. pipeline w/i DPU) can be routed to any of the hardware data paths. A given control path can be triggered, flushed and controlled independently. Changes in v3: - Move msm_media_info.h from uapi to dpu/ subdir - Remove preclose callback dpu (it's handled in core) - Fix kbuild warnings with parent_ops - Remove unused functions from dpu_core_irq - Rename mdss_phys to mdss - Rename mdp_phys address space to mdp - Drop _phys from vbif and regdma binding names Signed-off-by: Abhinav Kumar Signed-off-by: Archit Taneja Signed-off-by: Chandan Uddaraju Signed-off-by: Jeykumar Sankaran Signed-off-by: Jordan Crouse Signed-off-by: Rajesh Yadav Signed-off-by: Sravanthi Kollukuduru Signed-off-by: Sean Paul [robclark minor rebase] Signed-off-by: Rob Clark commit 516ddd79068dc02b9101bf9551a9ef7dce217b5b Author: Tiago Brusamarello Date: Thu Jul 26 11:12:11 2018 -0300 spi: spi-fsl-espi: Log fifo counters on error Log RX and TX fifo counters when a transfer is done and these are not zero. Signed-off-by: Tiago Brusamarello Signed-off-by: Mark Brown commit 036bfeb33b89578ab924fa198213260659e08dc8 Author: Jeykumar Sankaran Date: Wed Jun 27 15:24:17 2018 -0400 drm/msm: Add pm_suspend/resume callbacks to msm_kms Used by the dpu driver for custom suspend/resume. Changes in v3: - None Signed-off-by: Jeykumar Sankaran [seanpaul split this out of the megapatch] Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 2b7ac1a8989829b085fae9750817ca3304047c04 Author: Jeykumar Sankaran Date: Wed Jun 27 13:49:23 2018 -0400 drm/msm: Add .commit() callback to msm_kms functions Called right before wait_for_commit_done() to perform kickoff for active crtcs. Changes in v3: - None Signed-off-by: Jeykumar Sankaran [seanpaul split this out of the megapatch] Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 7305a0ceec78f34ce328845cdd6980d8eda99485 Author: Jeykumar Sankaran Date: Wed Jun 27 14:55:25 2018 -0400 drm/msm: #define MAX_ in msm_drv.h dpu uses these elsewhere in the driver (in addition to increasing MAX_PLANES, that'll come later), so pull them out into #define. Changes in v3: - None Signed-off-by: Jeykumar Sankaran [seanpaul pulled this out of the dpu megapatch] Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 77050c3febb1808ed6a0f7e9f0994278f06967ca Author: Jeykumar Sankaran Date: Wed Jun 27 14:35:28 2018 -0400 drm/msm: Use labels for unwinding in the error path This simplifies cleanup, to make sure nothing drops out in case of error. Changes in v3: - None Signed-off-by: Jeykumar Sankaran [seanpaul split out of dpu megapatch and renamed labels] Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit aaded2e3a1f6b776a5afd7c1168610d51f9a6a15 Author: Jeykumar Sankaran Date: Wed Jun 27 14:26:24 2018 -0400 drm/msm: #define MDP version numbers Useful for incoming DPU support Changes in v3: - None Signed-off-by: Jeykumar Sankaran [seanpaul split this from the dpu megapatch] Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 74312fc7343efbfd95fc5e75c5c7547e9f751c22 Author: Sean Paul Date: Wed Jun 27 15:15:49 2018 -0400 drm/msm: Clean up dangling atomic_wq I missed this during the atomic conversion Changes in v3: - None Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 2d0b10fc5111bb4a902e9be378496d04c401ab81 Author: Abhinav Kumar Date: Thu Jun 7 13:50:29 2018 -0700 drm/msm: higher values of pclk can exceed 32 bits when multiplied by a factor Make the pclk_rate u64 to accommodate higher pixel clock rates. Changes in v3: - Converted pclk_rate to u32 (Archit) - Rebase on dsi cleanup set in msm-next Cc: Sibi Sankar Cc: Archit Taneja Signed-off-by: Abhinav Kumar Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit bb676df12b5e81cab57d1a212a6e9cfc343875a7 Author: Jeykumar Sankaran Date: Mon Jun 11 14:13:20 2018 -0700 drm/msm: enable zpos normalization Enable drm core zpos normalization for planes. Changes in v3: - None Signed-off-by: Jeykumar Sankaran Reviewed-by: Sean Paul Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit bc3220be22577e199452edbb6a24a980a4ab5c73 Author: Rajesh Yadav Date: Thu Jun 21 16:06:10 2018 -0400 drm/msm/mdp5: subclass msm_mdss for mdp5 SoCs having mdp5 or dpu have identical tree like device hierarchy where MDSS top level wrapper manages common power resources for all child devices. Subclass msm_mdss so that msm_mdss includes common defines and mdp5/dpu mdss derivations to include any extensions. Add mdss helper interface (msm_mdss_funcs) to msm_mdss base for mdp5/dpu mdss specific implementation calls. This change subclasses msm_mdss for mdp5, dpu specific changes will be done separately. Changes in v3: - Added Archit's R-b Reviewed-by: Archit Taneja Reviewed-by: Sean Paul Signed-off-by: Rajesh Yadav [seanpaul rebased on msm-next and resolved conflicts] Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit a5c6b59904222ffe2eee37e5951d1f57ac1e530f Author: Sean Paul Date: Fri Apr 13 10:09:11 2018 -0400 drm/msm: Move wait_for_vblanks into mdp complete_commit() hooks DPU doesn't use this, so push it into the mdp drivers. Changes in v3: - None Signed-off-by: Sean Paul Signed-off-by: Rajesh Yadav Signed-off-by: Rob Clark commit 425a2d24d5b3ee9efc7f490440bfa20ba9166548 Author: Abhinav Kumar Date: Fri Jun 15 22:56:59 2018 -0700 drm/msm/dsi: set encoder mode for DRM bridge explicitly Currently, DRM bridge for DPU relies on the default video mode setting to set the encoder mode. Add an explicit call to set the encoder mode for bridges. Changes in v3: - None Reviewed-by: Archit Taneja Signed-off-by: Abhinav Kumar Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 7a296796fd0b28dc229d65dd90a6b392852d9631 Author: Rajesh Yadav Date: Mon Jun 25 19:12:03 2018 +0530 drm/msm/dsi: initialize postdiv_lock before use for 10nm pll postdiv_lock spinlock was used before initialization for 10nm pll. It causes following spin_bug: "BUG: spinlock bad magic on CPU#0". Initialize spinlock before its usage. Changes in v3: - Added Archit's R-b Reviewed-by: Archit Taneja Signed-off-by: Rajesh Yadav Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 8b03ad30e314691f7bfccc0f9fae0dffd498b667 Author: Chandan Uddaraju Date: Wed Apr 18 12:45:15 2018 -0700 drm/msm/dsi: Use one connector for dual DSI mode Current DSI driver uses two connectors for dual DSI case even though we only have one panel. Fix this by implementing one connector/bridge for dual DSI use case. Use master DSI controllers to register one connector/bridge. Changes in v3: - None Reviewed-by: Archit Taneja Signed-off-by: Chandan Uddaraju [seanpaul removed unused local var causing a build warning] Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit ed9976a09b486d85ae537b5cd73e947d7dfbb136 Author: Chandan Uddaraju Date: Wed Apr 18 12:45:14 2018 -0700 drm/msm/dsi: adjust dsi timing for dual dsi mode For dual dsi mode, the horizontal timing needs to be divided by half since both the dsi controllers will be driving this panel. Adjust the pixel clock and DSI timing accordingly. Changes in v3: - Added Archit's R-b - Rebase on dsi cleanup set in msm-next Cc: Sibi Sankar Reviewed-by: Archit Taneja Signed-off-by: Chandan Uddaraju Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 2a8536f6e8464b8988baa7db881f30721616b0da Author: Jeykumar Sankaran Date: Tue Jun 5 19:00:54 2018 -0700 drm: add msm compressed format modifiers Qualcomm Snapdragon chipsets uses compressed format to optimize BW across multiple IP's. This change adds needed modifier support in drm for a simple 4x4 tile based compressed variants of base formats. Changes in v3: - Removed duplicate entry for DRM_FORMAT_MOD_QCOM_COMPRESSED (Rob Clark) Changes in v4: - Remove all modifiers aside from COMPRESSED, this includes tiled and 10-bit Signed-off-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 9635453572028134b0f997afca8a6ad9ece2c515 Author: Andrey Ryabinin Date: Tue Jul 17 19:00:35 2018 +0300 fuse: reduce allocation size for splice_write The 'bufs' array contains 'pipe->buffers' elements, but the fuse_dev_splice_write() uses only 'pipe->nrbufs' elements. So reduce the allocation size to 'pipe->nrbufs' elements. Signed-off-by: Andrey Ryabinin Signed-off-by: Miklos Szeredi commit d6d931adce1193ef54d06fa9bbf58e5780ca516c Author: Andrey Ryabinin Date: Tue Jul 17 19:00:34 2018 +0300 fuse: use kvmalloc to allocate array of pipe_buffer structs. The amount of pipe->buffers is basically controlled by userspace by fcntl(... F_SETPIPE_SZ ...) so it could be large. High order allocations could be slow (if memory is heavily fragmented) or may fail if the order is larger than PAGE_ALLOC_COSTLY_ORDER. Since the 'bufs' doesn't need to be physically contiguous, use the kvmalloc_array() to allocate memory. If high order page isn't available, the kvamalloc*() will fallback to 0-order. Signed-off-by: Andrey Ryabinin Signed-off-by: Miklos Szeredi commit a64ba10f65bfe2bead4693ef7fda9f7978dfa162 Author: Arnd Bergmann Date: Fri Jul 13 16:35:10 2018 +0200 fuse: convert last timespec use to timespec64 All of fuse uses 64-bit timestamps with the exception of the fuse_change_attributes(), so let's convert this one as well. Signed-off-by: Arnd Bergmann Signed-off-by: Miklos Szeredi commit 46fb504a7145a8f0a82d92c2f1aba6f7215005e1 Author: Souptick Joarder Date: Sat May 12 10:25:37 2018 +0530 fs: fuse: Adding new return type vm_fault_t Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. commit 1c8f422059ae ("mm: change return type to vm_fault_t") Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Miklos Szeredi commit 75f3ee4c288d92d022481b4d9d56599714ca0ce3 Author: Miklos Szeredi Date: Thu Jul 26 16:13:12 2018 +0200 fuse: simplify fuse_abort_conn() Signed-off-by: Miklos Szeredi commit 109728ccc5933151c68d1106e4065478a487a323 Author: Kirill Tkhai Date: Thu Jul 19 15:49:39 2018 +0300 fuse: Add missed unlock_page() to fuse_readpages_fill() The above error path returns with page unlocked, so this place seems also to behave the same. Fixes: f8dbdf81821b ("fuse: rework fuse_readpages()") Signed-off-by: Kirill Tkhai Signed-off-by: Miklos Szeredi commit a2477b0e67c52f4364a47c3ad70902bc2a61bd4c Author: Andrey Ryabinin Date: Tue Jul 17 19:00:33 2018 +0300 fuse: Don't access pipe->buffers without pipe_lock() fuse_dev_splice_write() reads pipe->buffers to determine the size of 'bufs' array before taking the pipe_lock(). This is not safe as another thread might change the 'pipe->buffers' between the allocation and taking the pipe_lock(). So we end up with too small 'bufs' array. Move the bufs allocations inside pipe_lock()/pipe_unlock() to fix this. Fixes: dd3bb14f44a6 ("fuse: support splice() writing to fuse device") Signed-off-by: Andrey Ryabinin Cc: # v2.6.35 Signed-off-by: Miklos Szeredi commit 63576c13bd17848376c8ba4a98f5d5151140c4ac Author: Miklos Szeredi Date: Thu Jul 26 16:13:11 2018 +0200 fuse: fix initial parallel dirops If parallel dirops are enabled in FUSE_INIT reply, then first operation may leave fi->mutex held. Reported-by: syzbot Fixes: 5c672ab3f0ee ("fuse: serialize dirops by default") Cc: # v4.7 Signed-off-by: Miklos Szeredi commit e8f3bd773d22f488724dffb886a1618da85c2966 Author: Miklos Szeredi Date: Thu Jul 26 16:13:11 2018 +0200 fuse: Fix oops at process_init_reply() syzbot is hitting NULL pointer dereference at process_init_reply(). This is because deactivate_locked_super() is called before response for initial request is processed. Fix this by aborting and waiting for all requests (including FUSE_INIT) before resetting fc->sb. Original patch by Tetsuo Handa . Reported-by: syzbot Fixes: e27c9d3877a0 ("fuse: fuse: add time_gran to INIT_OUT") Cc: # v3.19 Signed-off-by: Miklos Szeredi commit b8f95e5d13f5f0191dcb4b9113113d241636e7cb Author: Miklos Szeredi Date: Thu Jul 26 16:13:11 2018 +0200 fuse: umount should wait for all requests fuse_abort_conn() does not guarantee that all async requests have actually finished aborting (i.e. their ->end() function is called). This could actually result in still used inodes after umount. Add a helper to wait until all requests are fully done. This is done by looking at the "num_waiting" counter. When this counter drops to zero, we can be sure that no more requests are outstanding. Fixes: 0d8e84b0432b ("fuse: simplify request abort") Cc: # v4.2 Signed-off-by: Miklos Szeredi commit 45ff350bbd9d0f0977ff270a0d427c71520c0c37 Author: Miklos Szeredi Date: Thu Jul 26 16:13:11 2018 +0200 fuse: fix unlocked access to processing queue fuse_dev_release() assumes that it's the only one referencing the fpq->processing list, but that's not true, since fuse_abort_conn() can be doing the same without any serialization between the two. Fixes: c3696046beb3 ("fuse: separate pqueue for clones") Cc: # v4.2 Signed-off-by: Miklos Szeredi commit 87114373ea507895a62afb10d2910bd9adac35a8 Author: Miklos Szeredi Date: Thu Jul 26 16:13:11 2018 +0200 fuse: fix double request_end() Refcounting of request is broken when fuse_abort_conn() is called and request is on the fpq->io list: - ref is taken too late - then it is not dropped Fixes: 0d8e84b0432b ("fuse: simplify request abort") Cc: # v4.2 Signed-off-by: Miklos Szeredi commit c842697c741e9dbf825e07d4c2724685d6464bd0 Author: Alexandre Belloni Date: Wed Jul 25 16:19:41 2018 +0200 rtc: unexport rtc_irq_set_* Make the rtc_irq_set interface internale to the RTC subsystem. Signed-off-by: Alexandre Belloni commit 8719d3c9188b38db462a77ecd8c7a8e25e7e8c4c Author: Alexandre Belloni Date: Wed Jul 25 15:07:09 2018 +0200 rtc: simplify rtc_irq_set_state/rtc_irq_set_freq The PIE doesn't handle tasks anymore, remove the pointer from the interface. Signed-off-by: Alexandre Belloni commit acecb3ad8b21a519ce4ad728106d45d4e978bb56 Author: Alexandre Belloni Date: Wed Jul 25 14:58:10 2018 +0200 rtc: remove irq_task and irq_task_lock There is no way to set a periodic task anymore, remove task pointer and lock. Signed-off-by: Alexandre Belloni commit 1560d0848a1a84db6c1d9b17c14273c0dae41828 Author: Alexandre Belloni Date: Wed Jul 25 14:34:29 2018 +0200 rtc: remove rtc_irq_register/rtc_irq_unregister The rtc_irq_* interface is not used from outside the RTC subsytem since 2016. Signed-off-by: Alexandre Belloni commit ec623ff014c4e9c52d8ebf068d9801f5f9ab7348 Author: Alexandre Belloni Date: Wed Jul 25 16:45:39 2018 +0200 rtc: sh: remove dead code Since commit 80d4bb515b78 ("RTC: Cleanup rtc_class_ops->irq_set_state") and commit 696160fec162 ("RTC: Cleanup rtc_class_ops->irq_set_freq()"), sh_rtc_irq_set_state and sh_rtc_irq_set_freq are never called. Remove them along with task handling. Signed-off-by: Alexandre Belloni commit 7699676081ded2e149e798f9205f1f089aa3a6bc Author: Akshu Agrawal Date: Thu Jul 26 14:04:08 2018 +0800 ASoC: AMD: Fix build warning Fixes sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_probe': sound/soc/amd/acp-da7219-max98357a.c:367:3: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret); Reported-by: Stephen Rothwell Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit c183fec10ae6b3d1dfb77471d4158e576f6b43ae Author: Akshu Agrawal Date: Wed Jul 25 17:00:59 2018 +0800 ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002 DA7219 for our platform need to be configured for 1.8V. Hence, we add a volatge regulator with supplies of 1.8V in the machine driver. Signed-off-by: Adam Thomson Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit d6b340d7cb33c816ef4abe8143764ec5ab14a5cc Author: Takashi Iwai Date: Thu Jul 26 14:58:03 2018 +0200 ALSA: trident: Suppress gcc string warning The meddlesome gcc warns about the possible shortname string in trident driver code: sound/pci/trident/trident.c: In function ‘snd_trident_probe’: sound/pci/trident/trident.c:126:2: warning: ‘strcat’ accessing 17 or more bytes at offsets 36 and 20 may overlap 1 byte at offset 36 [-Wrestrict] strcat(card->shortname, card->driver); It happens since gcc calculates the possible string size from card->driver, but this can't be true since we did set the string just before that, and they are much shorter. For shutting it up, use the exactly same string set to card->driver for strcat() to card->shortname, too. Signed-off-by: Takashi Iwai commit 809092dc3e606f3508b53baa624b27bfff8f0e7f Author: Sudeep Holla Date: Thu Jul 26 12:23:31 2018 +0100 drivers/perf: arm-ccn: Use devm_ioremap_resource() to map memory Instead of checking the return value of platform_get_resource(), we can use devm_ioremap_resource() which has the NULL pointer check and the memory region requesting. devm_ioremap_resource is designed to replace calls to devm_request_mem_region followed by devm_ioremap, so let's use the same. Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Sudeep Holla Signed-off-by: Will Deacon commit 9a7faac3650216112e034b157289bf1a48a99e2d Author: Erich E. Hoover Date: Thu Jul 19 17:26:24 2018 -0600 usb: dwc3: change stream event enable bit back to 13 Commit ff3f0789b3dc ("usb: dwc3: use BIT() macro where possible") changed DWC3_DEPCFG_STREAM_EVENT_EN from bit 13 to bit 12. Spotted this cleanup typo while looking at diffs between 4.9.35 and 4.14.16 for a separate issue. Fixes: ff3f0789b3dc ("usb: dwc3: use BIT() macro where possible") Signed-off-by: Erich E. Hoover Signed-off-by: Felipe Balbi commit 76251db8656194d27629300c852b53c471e9b586 Author: Enric Balletbo i Serra Date: Mon Jul 16 12:25:47 2018 +0200 usb: dwc3: of-simple: reset host controller at suspend/resume If we power off the SoC logic rail in S3, we can find that the Type-C PHY can't initialize correctly after system resume. We need to toggle the USB3-OTG reset before trying to initialize the PHY, or else it times out. phy phy-ff800000.phy.9: phy poweron failed --> -110 dwc3 fe900000.dwc3: failed to initialize core dwc3: probe of fe900000.dwc3 failed with error -110 Note that the RK3399 TRM suggests that we should keep the whole usb3 controller in reset for the duration of the Type-C PHY initialization. However, it's hard to assert the reset in the current framework of reset. We're still skeptical about that, and we haven't yet found a case where this seems to have mattered. This approach is much easier, it simply holds the USB3-OTG reset while device is supended. The dwc3 core is going to reinitialize the controller at suspend/resume anyway (including a "soft reset"), so it should be safe to do this. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Felipe Balbi commit 1fcba97e35696b7cc5662fe704ada540b49f5601 Author: Jaejoong Kim Date: Wed Jul 4 13:51:28 2018 +0900 usb: gadget: storage: Remove reference counting The kref used to be needed because sharing of fsg_common among multiple USB function instances was handled by fsg. Now this is managed by configfs, we don't need it anymore. So let's eliminate kref from this driver. Acked-by: Alan Stern Acked-by: Michal Nazarewicz Signed-off-by: Jaejoong Kim Signed-off-by: Felipe Balbi commit 7a051e8de3010c2f5f52e0bf305ef96c1f1f19d5 Author: Jaejoong Kim Date: Wed Jul 4 13:51:27 2018 +0900 usb: gadget: storage: Add error handling for no memory fsg_common_set_num_buffers() may fail due to ENOMEM. So add error handling for fail case. Acked-by: Alan Stern Acked-by: Michal Nazarewicz Signed-off-by: Jaejoong Kim Signed-off-by: Felipe Balbi commit 211f658b7b40fd3355a0920481132645e24ffb16 Author: Hans de Goede Date: Sun Jun 10 16:01:22 2018 +0200 usb: dwc3: pci: Use devm functions to get the phy GPIOs Even though we only use them once, it is better to not put/release the GPIOs immediately after use, so that others cannot claim them. Use devm functions to get the phy GPIOs, so that they will be automatically released when were unbound from the device and remove the gpio_put calls. Signed-off-by: Hans de Goede Signed-off-by: Felipe Balbi commit 7740d04d901db7fe631b89dc4f695093327e2124 Author: Hans de Goede Date: Sun Jun 10 16:01:21 2018 +0200 usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does not On some Bay Trail (BYT) systems the firmware does not enable the ULPI Refclk. This commit adds a helper which checks and if necessary enabled the Refclk and calls this helper for BYT machines. Signed-off-by: Hans de Goede Signed-off-by: Felipe Balbi commit 5741022cbdf3616a9def13b15ab5667a36c65706 Author: Hans de Goede Date: Sun Jun 10 16:01:20 2018 +0200 usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources Bay Trail / BYT SoCs do not have a builtin device-mode phy, instead they require an external ULPI phy for device-mode. Only some BYT devices have an external phy, but even on those devices device-mode is not working because the dwc3 does not see the phy. The problem is that the ACPI fwnode for the dwc3 does not contain the expected GPIO resources for the GPIOs connected to the chip-select and reset pins of the phy. I've found the workaround which some Android x86 kernels use for this: https://github.com/BORETS24/Kernel-for-Asus-Zenfone-2/blob/master/arch/x86/platform/intel-mid/device_libs/pci/platform_usb_otg.c Which boils down to hardcoding the GPIOs for these devices. The good news it that all boards (*) use the same GPIOs. This commit fixes the ULPI phy not woring by adding a gpiod_lookup_table call which adds a hardcoded mapping for BYT devices. Note that the mapping added by gpiod_add_lookup_table is a fallback mapping, so boards which properly provide GPIO resources in the ACPI firmware-node resources will not use this. *) Except for the first revision of the evalulation-kit, which normal users don't have Signed-off-by: Hans de Goede Signed-off-by: Felipe Balbi commit ee9a4ae7dcf19bfe13eb7ae5696ea0405de1f089 Author: Sebastian Andrzej Siewior Date: Sun Jul 1 17:35:44 2018 +0200 usb: usbtest: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Acked-by: Alan Stern Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Felipe Balbi commit bf594c1070f5c34a2576a725eef69cba2686b98d Author: Alan Stern Date: Fri Jun 29 13:52:20 2018 -0400 USB: gadget: Document that certain ep operations can be called in interrupt context This documentation patch specifies that certain USB gadget endpoint operations may be called in interrupt context: usb_ep_queue, usb_ep_dequeue, usb_ep_set_halt, usb_ep_clear_halt, usb_ep_set_wedge, usb_ep_fifo_status, and usb_ep_fifo_flush; while others must be called in process context: usb_ep_enable and usb_ep_disable. Signed-off-by: Alan Stern Signed-off-by: Felipe Balbi commit ad22a6663c6312825876fed25fd6d010d4b46db1 Author: Parth Y Shah Date: Thu Jun 14 12:02:46 2018 +0530 usb: gadget: configfs: avoid spaces for indentation This fixes the following checkpatch error: ERROR: code indent should use tabs where possible Here, spaces are replaced by a tab in 2 lines. Signed-off-by: Parth Y Shah Signed-off-by: Felipe Balbi commit 3fe314ca8c970aefc2d2a96dd93df6de1f4f1a4b Author: Thinh Nguyen Date: Tue Jun 12 14:26:43 2018 -0700 usb: dwc3: Add a glue driver for Synopsys HAPS platform This driver is to be used for Synopsys PCIe-base HAPS platform. Move the the HAPS support from dwc3-pci to this driver. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi commit 014562071c96524b518d4d3513fcde072c8e63b5 Author: Dan Carpenter Date: Thu Jul 5 12:45:39 2018 +0300 PCI: mobiveil: Integer overflow in IB_WIN_SIZE IB_WIN_SIZE is larger than INT_MAX so we need to cast it to u64. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Dan Carpenter Signed-off-by: Lorenzo Pieralisi commit e610257e462f6104792d22fbb0927724df3bc401 Author: Jerry Zhang Date: Mon Apr 16 18:17:40 2018 -0700 usb: gadget: f_fs: Only return delayed status when len is 0 Commit 1b9ba000 ("Allow function drivers to pause control transfers") states that USB_GADGET_DELAYED_STATUS is only supported if data phase is 0 bytes. It seems that when the length is not 0 bytes, there is no need to explicitly delay the data stage since the transfer is not completed until the user responds. However, when the length is 0, there is no data stage and the transfer is finished once setup() returns, hence there is a need to explicitly delay completion. This manifests as the following bugs: Prior to 946ef68ad4e4 ('Let setup() return USB_GADGET_DELAYED_STATUS'), when setup is 0 bytes, ffs would require user to queue a 0 byte request in order to clear setup state. However, that 0 byte request was actually not needed and would hang and cause errors in other setup requests. After the above commit, 0 byte setups work since the gadget now accepts empty queues to ep0 to clear the delay, but all other setups hang. Fixes: 946ef68ad4e4 ("Let setup() return USB_GADGET_DELAYED_STATUS") Signed-off-by: Jerry Zhang Signed-off-by: Felipe Balbi commit d7af78b9245545908c90bce2206f200a4250b5db Author: Kieran Bingham Date: Thu May 24 17:16:12 2018 +0100 usb: gadget: uvc: Expose configuration name through video node When utilising multiple instantiations of a UVC gadget on a composite device, there is no clear method to link a particular configuration to its respective video node. Provide a means for identifying the correct video node by exposing the name of the function configuration through sysfs. Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham Signed-off-by: Felipe Balbi commit c728effd56d35c12774210f0732b8eb8b7ce7cd9 Author: Laurent Pinchart Date: Wed May 23 18:49:43 2018 +0300 usb: gadget: uvc: configfs: Move function to avoid forward declaration The to_f_uvc_opts() function is forward-declared without needing to, as its definition can simply be moved up in the file. Fix it. Signed-off-by: Laurent Pinchart Signed-off-by: Felipe Balbi commit 0f548098af0f1a7e58e2bb9d8e1e994312c13a0f Author: Gevorg Sahakyan Date: Wed May 23 11:57:27 2018 +0400 usb: dwc2: Move dwc2_readl/writel functions after hsotg structure Moved dwc2_readl/writel functions after hsotg declaration for adding hsotg structure to dwc2_readl/writel function prototypes. Acked-by: Minas Harutyunyan Signed-off-by: Gevorg Sahakyan Signed-off-by: Felipe Balbi commit 0b3e336601b82c6afa0e9cf21db9cb8793e25399 Author: Laura Abbott Date: Fri Jul 20 14:41:54 2018 -0700 arm64: Add support for STACKLEAK gcc plugin This adds support for the STACKLEAK gcc plugin to arm64 by implementing stackleak_check_alloca(), based heavily on the x86 version, and adding the two helpers used by the stackleak common code: current_top_of_stack() and on_thread_stack(). The stack erasure calls are made at syscall returns. Additionally, this disables the plugin in hypervisor and EFI stub code, which are out of scope for the protection. Acked-by: Alexander Popov Reviewed-by: Mark Rutland Reviewed-by: Kees Cook Signed-off-by: Laura Abbott Signed-off-by: Will Deacon commit 8a1ccfbc9e0256baafbbce85ccdb72ec89af2aab Author: Laura Abbott Date: Fri Jul 20 14:41:53 2018 -0700 arm64: Add stack information to on_accessible_stack In preparation for enabling the stackleak plugin on arm64, we need a way to get the bounds of the current stack. Extend on_accessible_stack to get this information. Acked-by: Alexander Popov Reviewed-by: Mark Rutland Signed-off-by: Laura Abbott [will: folded in fix for allmodconfig build breakage w/ sdei] Signed-off-by: Will Deacon commit 8c45fbcd1f14f472f1da1ae72a5b8354c03f373a Author: Colin Ian King Date: Tue May 22 10:05:05 2018 +0100 usb: gadget: tcm: fix spelling mistake: "Manufactor" -> "Manufacturer" Trivial fix to spelling mistake in usbg_us_strings array Signed-off-by: Colin Ian King Signed-off-by: Felipe Balbi commit 0d535967ac658966c6ade8f82b5799092f7d5441 Author: Miao Zhong Date: Mon Jul 23 20:56:58 2018 +0800 iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register When PRI queue occurs overflow, driver should update the OVACKFLG to the PRIQ consumer register, otherwise subsequent PRI requests will not be processed. Cc: Will Deacon Cc: Robin Murphy Signed-off-by: Miao Zhong Signed-off-by: Will Deacon commit d1e20222d5372e951bbb2fd3f6489ec4a6ea9b11 Author: Vivek Gautam Date: Thu Jul 19 23:23:56 2018 +0530 iommu/arm-smmu: Error out only if not enough context interrupts Currently we check if the number of context banks is not equal to num_context_interrupts. However, there are booloaders such as, one on sdm845 that reserves few context banks and thus kernel views less than the total available context banks. So, although the hardware definition in device tree would mention the correct number of context interrupts, this number can be greater than the number of context banks visible to smmu in kernel. We should therefore error out only when the number of context banks is greater than the available number of context interrupts. Signed-off-by: Vivek Gautam Suggested-by: Tomasz Figa Cc: Robin Murphy Cc: Will Deacon [will: drop useless printk] Signed-off-by: Will Deacon commit 29859aeb8a6ea17ba207933a81b6b77b4d4df81a Author: Jean-Philippe Brucker Date: Tue Jun 19 13:52:24 2018 +0100 iommu/io-pgtable-arm-v7s: Abort allocation when table address overflows the PTE When run on a 64-bit system in selftest, the v7s driver may obtain page table with physical addresses larger than 32-bit. Level-2 tables are 1KB and are are allocated with slab, which doesn't accept the GFP_DMA32 flag. Currently map() truncates the address written in the PTE, causing iova_to_phys() or unmap() to access invalid memory. Kasan reports it as a use-after-free. To avoid any nasty surprise, test if the physical address fits in a PTE before returning a new table. 32-bit systems, which are the main users of this page table format, shouldn't see any difference. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Will Deacon commit fac83d29d95471ad6a104f8c0d21669a3d59097b Author: Jean-Philippe Brucker Date: Mon Jun 18 12:27:54 2018 +0100 iommu/io-pgtable-arm: Fix pgtable allocation in selftest Commit 4b123757eeaa ("iommu/io-pgtable-arm: Make allocations NUMA-aware") added a NUMA hint to page table allocation, but the pgtable selftest doesn't provide an SMMU device parameter. Since dev_to_node doesn't accept a NULL argument, add a special case for selftest. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Will Deacon commit 20970d823a17f87aa4105febc181e5ee823dbe25 Author: Laurent Pinchart Date: Mon May 21 11:28:53 2018 +0300 usb: gadget: uvc: Move trace parameter to function module The trace module parameter controls output of debugging messages in the UVC function driver. Move it from the webcam module to the UVC function module where it belongs. This allows ConfigFS-based UVC gadgets to control tracing. Signed-off-by: Laurent Pinchart Signed-off-by: Felipe Balbi commit 284eb1663bed1fe0934d60755443504aeea011f8 Author: Laurent Pinchart Date: Mon May 21 11:28:52 2018 +0300 usb: gadget: uvc: Minimize #include in headers In order to speed up compilation, only include the headers that are strictly required within other headers. To that end, use forward structure declaration and move #include statements to .c file as appropriate. While at it, sort headers alphabetically, and remove unneeded __KERNEL__ guards. Signed-off-by: Laurent Pinchart Signed-off-by: Felipe Balbi commit d396e47fb558a819226955ce5db0149fde88da0f Author: Laurent Pinchart Date: Mon May 21 11:28:51 2018 +0300 usb: gadget: uvc: Move userspace API definition to public header The UVC gadget userspace API (V4L2 events and custom ioctls) is defined in a header internal to the kernel. Move it to a new public header to make it accessible to userspace. The UVC_INTF_CONTROL and UVC_INTF_STREAMING macros are not used, so remove them in the process. Signed-off-by: Laurent Pinchart Signed-off-by: Felipe Balbi commit 1a4968d1230c9233f50a89abb3b32d94f81146d0 Author: Golan Ben Ami Date: Sun Feb 4 17:41:51 2018 +0200 iwlwifi: pcie: support 2k rx buffers The smallest rb size supported today is 4k rx buffers. 22560 devices use 2k rxb's, so allow using 2k buffers. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit d0158235f44e1e8a7db89380e77c3520386267b7 Author: Golan Ben Ami Date: Sun Feb 4 17:04:31 2018 +0200 iwlwifi: update registers changed for 22560 devices In 22560 devices the firmware will do all the hw configurations, but that's not ready yet. Update the correct registers in the driver until the FW is ready and does it by itself. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit cf495496b688cd4672bf87aaaf0c833bda8825f3 Author: Golan Ben Ami Date: Sun Feb 4 16:38:10 2018 +0200 iwlwifi: introduce new rx structures used by 22560 RFH 22560 devices RFH uses different structures, which act similar to the legacy rxq management lists - free and used list. The iwl_rx_transfer_desc struct is part of the free list, and consists of pointers to the empty rb's the driver wants to pass to the fw. The iwl_rx_completion_desc struct is part of the used list, and consists of pointers to the buffer the fw filled up with new rx, both commands and data, for the host. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit a0ec0169b7a9e0e6050e1699276801dee8c6ca84 Author: Golan Ben Ami Date: Sun Feb 4 15:46:17 2018 +0200 iwlwifi: support new tx api 22560 devices use a new tx cmd api. Update the code to use the new api. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 7b3e42ea2eadd41cc9d6363a9813b8ba8ab6f0e6 Author: Golan Ben Ami Date: Sun Feb 4 12:51:45 2018 +0200 iwlwifi: support multiple tfd queue max sizes for different devices 22560 devices tfd queue max size is 2^16. Allow a configurable max size in the driver for supporting different devices. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit f5955a6cc3862a02d46f50b723c3172d24d749a5 Author: Golan Ben Ami Date: Sun Feb 4 10:50:05 2018 +0200 iwlwifi: cancel the injective function between hw pointers to tfd entry index Nowadays, the tfd queue max size is 2^8, and the reserved size in the command header sequence field for the tfd entry index is 8 bits, allowing an injective function from the hw pointers to the tfd entry index in the sequence field. In 22560 devices the tfd queue max size is 2^16, meaning that the hw pointers are 16 bit long (allowing to point to each entry in the tfd queue). However, the reserved space in the sequence field for the tfd entry doesn't change, and we are limited to 8 bit. This requires cancelling the injective function from hw pointer to tfd entry in the sequence number. Use iwl_pcie_get_cmd_index to wrap the hw pointer's to the n_window size, which is maximum 256 in tx queues, and so, keep the injective function between the window wrapped hw pointers to tfd entry index in the sequence. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 9b58419e511a8b7c3ae1cebe1926fc3a7c59a31c Author: Golan Ben Ami Date: Thu Feb 1 17:54:48 2018 +0200 iwlwifi: update gen3 interrupts - sw error and image response In 22560 devices the ROM sendis an interrupt to the host once the IML reading is done. Handle this interrupt, and indicate sw error in case the value is fail. Additionally, the cause for sw error in 22560 devices have been changed, so update the cause list. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 9f358c1716ba2d4da15aa09835d0a86bc504963a Author: Golan Ben Ami Date: Tue Dec 26 14:49:30 2017 +0200 iwlwifi: pcie: start early debug for 22560 devices In 22560 devices we can start debug using context info gen3. Configure the fw to start collecting logs to the dram before init. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 2a182fbb29607249244dda0a85131e249799c904 Author: Golan Ben Ami Date: Tue Jan 2 12:08:31 2018 +0200 iwlwifi: pcie: update bytes in the byte count table For devices which use the image loader image, the length of the frame must be updated in the byte count in bytes, and not dwords as today. Avoid dividing the input length by 4. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 2ee824026288eb7068e6327c5f34b8ddbea74094 Author: Golan Ben Ami Date: Sun Feb 11 10:57:18 2018 +0200 iwlwifi: pcie: support context information for 22560 devices Context information structure was added to 22000 devices for firmware self init. In the next generation of devices the context information changes significantly, and the original context information is divided roughly to three data structures: context information gen3, prph information and prph scratch. In addition, the init flow changes so the firmware is loaded by the IML, and so we must allocate the IML on the DRAM and give the ROM the IML's address before kicking the firmware's self init. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 1b493e30a19540438a9944683aa9310b8077bc80 Author: Golan Ben Ami Date: Sun Feb 11 10:48:32 2018 +0200 iwlwifi: pcie: allocate and free rx cr's and tr's tails The hw now refers to two new blocks: * rx tr tail - The Tail index on the free buffers queue TR, which is update by the device after reading the free buffer from the tr. * rx cr tail - Updated by the driver when completing processing a new completion descriptor in the cr. Add these two new struct to the rxq, allocate and free them when needed. In addition, the register for rx write pointer had been changed to HBUS_TARG_WRPTR. The way to differentiate tx from rx is the queue number. TX range is 0-511, and RX's is 512-527. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 5f01df3f58ab25cffb6b2577339fde1dfe696bf2 Author: Golan Ben Ami Date: Wed Feb 7 20:08:56 2018 +0200 iwlwifi: introduce device family 22560 Device 22560 have many different hw and sw features than 22000 family, so introduce a new family of devices - 22560. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit c8f1b51e506dec74e671ed61f67e639754da322f Author: Golan Ben Ami Date: Sun Oct 22 15:58:26 2017 +0300 iwlwifi: allow different csr flags for different device families Different device families may have different flag values for passing a message to the fw (i.e. SW_RESET). In order to keep the code readable, and avoid conditioning upon the family, store a value for each flag, which indicates the bit that needs to be enabled. Additionally, support 22560 device csr flags and addresses. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 33708052993ceed27a67669a5badf2efb2841bd0 Author: Luca Coelho Date: Sun Jun 24 11:36:52 2018 +0300 iwlwifi: add support for 22560 devices Add support for the new 22560 family of devices and, while at it, reorganize the 22000 family so it fits better with the new one. Signed-off-by: Golan Ben Ami Signed-off-by: Luca Coelho commit 2693de9f82f1f3b47b55d383ddcee63e3927571f Author: Johannes Berg Date: Thu Sep 28 14:15:20 2017 +0200 iwlwifi: 22000 devices: restrict to HT A-MPDU size Our current HE devices don't support BlockAck with the large bitmap, so can't do TX aggregation with 256 frames. Restrict to the lower HT size. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho commit e5721e3f770f0ca527c6232c7d19e8cabd1f79b8 Author: Luca Coelho Date: Tue Jun 26 10:03:04 2018 +0300 iwlwifi: mvm: add radiotap data for HE Add HE information to the radiotap data. Signed-off-by: Luca Coelho commit 230ba6c5a9df33bbd6ad5980a3f8dc446c3e881f Author: Luca Coelho Date: Sun Jun 24 12:07:28 2018 +0300 iwlwifi: add module parameter to disable 802.11ax Add a module parameter to disable 802.11ax features in supported devices. This is useful for testing or if there are interoperability issues with some APs. Signed-off-by: Luca Coelho commit 514c30696fbc2598a088f8c5e201d305d157b99a Author: Luca Coelho Date: Sun Jun 24 11:59:54 2018 +0300 iwlwifi: add support for IEEE802.11ax Add support for the HE in the iwlwifi driver conforming with P802.11ax_D2.0. Signed-off-by: Luca Coelho commit 8a6171a7b601e37596d543efadae1d3913ac084e Author: Luca Coelho Date: Tue Jun 26 10:13:20 2018 +0300 iwlwifi: fw: add FW APIs for HE Add the FW API definitions for HE support. Signed-off-by: Luca Coelho commit 1569557549697207e52310cc5b7dbc8e64bef504 Author: Baolin Wang Date: Tue Jul 17 15:55:17 2018 +0800 clocksource/drivers/sprd: Register one always-on timer to compensate suspend time Since the clocksource framework has introduced one suspend clocksource to compensate the suspend time, this patch registers one always-on timer as the suspend clocksource. Signed-off-by: Baolin Wang Signed-off-by: Daniel Lezcano commit e3af677607d9daca9825bc98edfb5cedda5718a9 Author: Stanley Chu Date: Fri Jul 6 07:11:28 2018 +0800 clocksource/drivers/timer-mediatek: Add support for system timer This patch adds a new "System Timer" on the Mediatek SoCs. The System Timer is introduced as an always-on timer being clockevent device for tick-broadcasting. For clock, it is driven by 13 MHz system clock. The implementation uses the system clock with no clock source divider. For interrupt, the clock event timer can be used by all cores. Signed-off-by: Stanley Chu Signed-off-by: Daniel Lezcano commit a0858f937960d24e05cedf43d5cbcb95cf088434 Author: Stanley Chu Date: Fri Jul 6 07:11:27 2018 +0800 clocksource/drivers/timer-mediatek: Convert the driver to timer-of Convert the driver to use the timer_of helpers. This allows to remove custom proprietary structure, factors out and simplifies the code. Signed-off-by: Stanley Chu Signed-off-by: Daniel Lezcano commit 56d52d3f56192049221105efa6ee76251a949c0e Author: Stanley Chu Date: Fri Jul 6 07:11:26 2018 +0800 clocksource/drivers/timer-mediatek: Use specific prefix for GPT Use specific prefix to specify the name of supported timer hardware: "General Purpose Timer (GPT)". Signed-off-by: Stanley Chu Signed-off-by: Daniel Lezcano commit 7ec58e5244b7a7aa41f792968208239a43e5ade7 Author: Stanley Chu Date: Fri Jul 6 07:11:25 2018 +0800 clocksource/drivers/timer-mediatek: Rename mtk_timer to timer-mediatek Rename mtk_timer to timer-mediatek to apply new naming convention in clocksource folder. Signed-off-by: Stanley Chu Signed-off-by: Daniel Lezcano commit 59311b19d7f632397a98e8194de8e871867069db Author: Stanley Chu Date: Fri Jul 6 07:11:24 2018 +0800 clocksource/drivers/timer-mediatek: Add system timer bindings This patch adds bindings of new "System Timer" on Mediatek SoCs. Remove RTC clock in the same time because it is not used by both "General Purpose Timer" and "System Timer" now. Signed-off-by: Stanley Chu Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano commit f8f5fe86f7e10ecc784b53537edbe3fcf0c00884 Author: Sudeep Holla Date: Wed Jul 11 12:24:22 2018 +0100 clocksource/drivers: Set clockevent device cpumask to cpu_possible_mask Currently, quite a few clockevent devices have cpumask set to cpu_all_mask which should be fine. However, cpu_possible_mask is more accurate and if there are any other clockevent devices in the system which have cpumask set to cpu_possible_mask, then having cpu_all_mask may result in issues (mostly boot hang with forever loops in clockevents_notify_released). So, lets replace all the clockevent device cpu_all_mask to cpu_possible_mask in order to prevent above mentioned possible issue. Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Thierry Reding Cc: Jonathan Hunter Cc: Santosh Shilimkar Signed-off-by: Sudeep Holla Signed-off-by: Daniel Lezcano commit 9b3d9bb3e4deef41095e513c2ffbebab20f9a982 Author: Waiman Long Date: Tue Jul 24 14:26:05 2018 -0400 cpufreq: Fix a circular lock dependency problem With lockdep turned on, the following circular lock dependency problem was reported: [ 57.470040] ====================================================== [ 57.502900] WARNING: possible circular locking dependency detected [ 57.535208] 4.18.0-0.rc3.1.el8+7.x86_64+debug #1 Tainted: G [ 57.577761] ------------------------------------------------------ [ 57.609714] tuned/1505 is trying to acquire lock: [ 57.633808] 00000000559deec5 (cpu_hotplug_lock.rw_sem){++++}, at: store+0x27/0x120 [ 57.672880] [ 57.672880] but task is already holding lock: [ 57.702184] 000000002136ca64 (kn->count#118){++++}, at: kernfs_fop_write+0x1d0/0x410 [ 57.742176] [ 57.742176] which lock already depends on the new lock. [ 57.742176] [ 57.785220] [ 57.785220] the existing dependency chain (in reverse order) is: : [ 58.932512] other info that might help us debug this: [ 58.932512] [ 58.973344] Chain exists of: [ 58.973344] cpu_hotplug_lock.rw_sem --> subsys mutex#5 --> kn->count#118 [ 58.973344] [ 59.030795] Possible unsafe locking scenario: [ 59.030795] [ 59.061248] CPU0 CPU1 [ 59.085377] ---- ---- [ 59.108160] lock(kn->count#118); [ 59.124935] lock(subsys mutex#5); [ 59.156330] lock(kn->count#118); [ 59.186088] lock(cpu_hotplug_lock.rw_sem); [ 59.208541] [ 59.208541] *** DEADLOCK *** In the cpufreq_register_driver() function, the lock sequence is: cpus_read_lock --> kn->count For the cpufreq sysfs store method, the lock sequence is: kn->count --> cpus_read_lock These sequences are actually safe as they are taking a share lock on cpu_hotplug_lock. However, the current lockdep code doesn't check for share locking when detecting circular lock dependency. Fixing that could be a substantial effort. Instead, we can work around this problem by using cpus_read_trylock() in the store method which is much simpler. The chance of not getting the read lock is very small. If that happens, the userspace application that writes the sysfs file will get an error. Signed-off-by: Waiman Long Signed-off-by: Rafael J. Wysocki commit 6f4ceee9305dc3fe74099159b460f4b56b506f1d Author: Waiman Long Date: Tue Jul 24 14:26:04 2018 -0400 cpu/hotplug: Add a cpus_read_trylock() function There are use cases where it can be useful to have a cpus_read_trylock() function to work around circular lock dependency problem involving the cpu_hotplug_lock. Signed-off-by: Waiman Long Signed-off-by: Rafael J. Wysocki commit c2cd0b08e1efd9ee58d09049a6c77e5efa0ef627 Author: Kees Cook Date: Tue Jul 24 09:49:28 2018 -0700 x86/power/hibernate_64: Remove VLA usage In the quest to remove all stack VLA usage from the kernel [1], this removes the discouraged use of AHASH_REQUEST_ON_STACK by switching to shash directly and allocating the descriptor in heap memory (which should be fine: the tfm has already been allocated there too). Link: https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com # [1] Signed-off-by: Kees Cook Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki commit 601b218568a107370086dc5c7a1b283f8d463268 Author: Ruchi Kandoi Date: Tue Jul 24 10:35:44 2018 -0700 cpufreq: trace frequency limits change systrace used for tracing for Android systems has carried a patch for many years in the Android tree that traces when the cpufreq limits change. With the help of this information, systrace can know when the policy limits change and can visually display the data. Lets add upstream support for the same. Signed-off-by: Ruchi Kandoi Signed-off-by: Joel Fernandes (Google) Acked-by: Viresh Kumar Acked-by: Steven Rostedt (VMware) Signed-off-by: Rafael J. Wysocki commit 54c5848c214922e2c3bf07df6c5789767ff93893 Author: Hans de Goede Date: Sat Jun 2 22:16:38 2018 +0200 Thermal: Intel SoC DTS: Translate IO-APIC GSI number to linux irq number The Intel SoC DTS uses a hardcoded GSI number, before this commit it was passing it to request_irq as if it were a linux irq number, but there is no 1:1 mapping so in essence it was requesting a random interrupt. Besides this causing the DTS driver to not actually get an interrupt if the thermal thresholds are exceeded this also is causing an interrupt conflict on some devices since the linux irq 86 which is being requested is already in use, leading to oopses like this: genirq: Flags mismatch irq 86. 00002001 (soc_dts) vs. 00000083 (volume_down) CPU: 0 PID: 601 Comm: systemd-udevd Tainted: G C OE 4.17.0-rc6+ #45 Hardware name: Insyde i86/Type2 - Board Product Name, BIOS CHUWI.D86JLBNR03 01/14/2015 Call Trace: dump_stack+0x5c/0x80 __setup_irq.cold.50+0x4e/0xac ? request_threaded_irq+0xad/0x160 request_threaded_irq+0xf5/0x160 ? 0xffffffffc0a93000 intel_soc_thermal_init+0x74/0x1000 [intel_soc_dts_thermal] This commit makes the intel_soc_dts_thermal.c code call acpi_register_gsi() to translate the hardcoded IO-APIC GSI number (86) to a linux irq, so that the dts code uses the right interrupt and we no longer get an oops about an irq conflict. Signed-off-by: Hans de Goede Signed-off-by: Zhang Rui commit 96455f734b2f6491b07a9a5b0c94513f0f4c9144 Author: Krzysztof Kozlowski Date: Wed Jul 18 21:56:20 2018 +0200 clk: samsung: Remove unused mout_user_aclk400_mcuisp_p4x12 variable Remove unused 'mout_user_aclk400_mcuisp_p4x12' variable to fix GCC warning: drivers/clk/samsung/clk-exynos4412-isp.c:40:27: warning: 'mout_user_aclk400_mcuisp_p4x12' defined but not used [-Wunused-const-variable=] Signed-off-by: Krzysztof Kozlowski Signed-off-by: Stephen Boyd commit 5acdc77014ac7a7d8ba87d6e3e0e66ef141e3c04 Merge: f0ad84123011 cd4806911cee Author: Olof Johansson Date: Thu Jul 26 00:18:25 2018 -0700 Merge tag 'samsung-soc-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/soc Samsung mach/soc changes for v4.19 Minor cleanups and fixes. * tag 'samsung-soc-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: exynos: Clear global variable on init error path ARM: exynos: Remove outdated maintainer information ARM: s3c24xx: Fix typo in guard macro of s3c2412.h Signed-off-by: Olof Johansson commit 692b12c75667bb1541808736c276b9e66e1b00b7 Merge: 7401056de5f8 c708e462e90e Author: Olof Johansson Date: Thu Jul 26 00:17:51 2018 -0700 Merge tag 'samsung-drivers-exynos5440-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/drivers Exynos5440 drivers removal The Exynos5440 (quad-core A15 with GMAC, PCIe, SATA) was targeting server platforms but it did not make it to the market really. There are no development boards with it and probably there are no real products neither. The development for Exynos5440 ended in 2013 and since then the platform is in maintenance mode. Removing Exynos5440 makes our life slightly easier: less maintenance, smaller code, reduced number of quirks, no need to preserve DTB backward-compatibility. The Device Tree sources and some of the drivers for Exynos5440 were already removed. This removes remaining drivers. * tag 'samsung-drivers-exynos5440-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: usb: host: exynos: Remove support for Exynos5440 clk: samsung: Remove support for Exynos5440 cpufreq: exynos: Remove support for Exynos5440 ata: ahci-platform: Remove support for Exynos5440 Signed-off-by: Olof Johansson commit 7401056de5f8d4eabe71a4c4aa80d0e278856e07 Author: Sudeep Holla Date: Wed Jul 25 11:48:09 2018 +0100 drivers/firmware: psci_checker: stash and use topology_core_cpumask for hotplug tests Commit 7f9545aa1a91 ("arm64: smp: remove cpu and numa topology information when hotplugging out CPU") updates the cpu topology when the CPU is hotplugged out. However the PSCI checker code uses the topology_core_cpumask pointers for some of the cpu hotplug testing. Since the pointer to the core_cpumask of the first CPU in the group is used, which when that CPU itself is hotpugged out is just set to itself, the testing terminates after that particular CPU is tested out. But the intention of this tests is to cover all the CPU in the group. In order to support that, we need to stash the topology_core_cpumask before the start of the test and use that value instead of pointer to a cpumask which will be updated on CPU hotplug. Fixes: 7f9545aa1a91a9a4 ("arm64: smp: remove cpu and numa topology information when hotplugging out CPU") Reported-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Cc: Mark Rutland Acked-by: Lorenzo Pieralisi Signed-off-by: Sudeep Holla Signed-off-by: Olof Johansson commit 1ca8c0a763418d7f15f5d1d13c3005b6d3a083db Merge: 92f06c384b49 462521089909 Author: Olof Johansson Date: Thu Jul 26 00:12:56 2018 -0700 Merge tag 'soc-fsl-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into next/drivers Various updates to soc/fsl for 4.19 Moves DPAA2 DPIO driver from staging to fsl/soc Adds multiple-pin support to QE gpio driver * tag 'soc-fsl-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux: soc: fsl: cleanup Kconfig menu soc: fsl: dpio: Convert DPIO documentation to .rst staging: fsl-mc: Remove remaining files staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl staging: fsl-dpaa2: eth: move generic FD defines to DPIO soc: fsl: qe: gpio: Add qe_gpio_set_multiple Signed-off-by: Olof Johansson commit 92f06c384b4950d1fc9e7177dd722a45c28a07f9 Merge: d7e832304366 7377330a1ed2 Author: Olof Johansson Date: Thu Jul 26 00:09:43 2018 -0700 Merge tag 'sunxi-drivers-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/drivers Allwinner drivers changes for 4.19 There's been work for this release cycles in both the SRAM controller driver in order to support more SoCs, as part of our VPU work, but also to enable the EMAC on the A64 (that needs to poke at registers within the same register space). Some work has been needed too to represent the bus to the display engine controllers that all need an SRAM to be mapped to the CPU to be able to access those controllers' registers. * tag 'sunxi-drivers-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: soc: sunxi: Add the A13, A23 and H3 system control compatibles drivers: soc: sunxi: Add support for the C1 SRAM region dt-bindings: sram: sunxi: Populate valid sections compatibles dt-bindings: sram: sunxi: Add A13, A20, A23 and H3 dedicated bindings soc: sunxi: sram: Add dt match for the A10 system-control compatible dt-bindings: sram: sunxi: Introduce new A10 binding for system-control bus: add bus driver for accessing Allwinner A64 DE2 dt-bindings: add binding for the Allwinner A64 DE2 bus soc: sunxi: sram: Add updated compatible string for A64 system control dt-bindings: sram: Rename A64 SRAM controller compatible soc: sunxi: export a regmap for EMAC clock reg on A64 Signed-off-by: Olof Johansson commit d7e832304366b8bd53b5e855d5169c38b93e587b Merge: 1df88c683ea3 78ee559d7fc6 Author: Olof Johansson Date: Thu Jul 26 00:03:25 2018 -0700 Merge tag 'qcom-drivers-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/drivers Qualcomm ARM Based Driver Updates for v4.19 * Add Qualcomm LLCC driver * Add Qualcomm RPMH controller * Fix memleak in Qualcomm RMTFS * Add dummy qcom_scm_assign_mem() * Fix check for global partition in SMEM * tag 'qcom-drivers-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: soc: qcom: rmtfs-mem: fix memleak in probe error paths soc: qcom: llc-slice: Add missing MODULE_LICENSE() drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() drivers: qcom: rpmh-rsc: fix the loop index check in get_req_from_tcs firmware: qcom: scm: add a dummy qcom_scm_assign_mem() drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children drivers: qcom: rpmh-rsc: allow active requests from wake TCS drivers: qcom: rpmh: add support for batch RPMH request drivers: qcom: rpmh: allow requests to be sent asynchronously drivers: qcom: rpmh: cache sleep/wake state requests drivers: qcom: rpmh-rsc: allow invalidation of sleep/wake TCS drivers: qcom: rpmh-rsc: write sleep/wake requests to TCS drivers: qcom: rpmh: add RPMH helper functions drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE dt-bindings: introduce RPMH RSC bindings for Qualcomm SoCs drivers: qcom: rpmh-rsc: add RPMH controller for QCOM SoCs drivers: soc: Add LLCC driver dt-bindings: Documentation for qcom, llcc soc: qcom: smem: Correct check for global partition Signed-off-by: Olof Johansson commit 31342a2150eb2f77636a6dd2f185b2d919048e88 Merge: ee57dd5af743 8fb147322a8f Author: Olof Johansson Date: Thu Jul 26 00:02:45 2018 -0700 Merge tag 'sunxi-h3-h5-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt Allwinner H3/H5 changes for 4.19 Our usual bunch of changes shared between arm and arm64. This time, we have: - eMMC support for the ALL-H3-CC boards - EMAC support for the Beelink X2 * tag 'sunxi-h3-h5-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: ARM: dts: sunxi-h3-h5: Remove unused address-cells/size-cells of dwmac-sun8i ARM: dts: sunxi: libretech-all-h3-cc: Enable eMMC module ARM: sun8i: h3: add SY8113B regulator on Banana Pi M2 Zero board ARM: dts: sun8i: h3: Enable dwmac-sun8i on the Beelink X2 ARM: dts: sun8i-h3: Add missing cooling device properties for CPUs Signed-off-by: Olof Johansson commit 8b0c9a98104fe207be4496fedd4e8815800faa6c Merge: 6672e8d50c5b b036e6420b9a Author: Olof Johansson Date: Wed Jul 25 23:59:13 2018 -0700 Merge tag 'renesas-arm-defconfig-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/defconfig Renesas ARM Based SoC Defconfig Updates for v4.19 - Enable new RZN1D-DB board in multi_v7_defconfig and shmobile_defconfig - shmobile_defconfig: + Drop NET_VENDOR_=n + Disable long deprecated /sbin/hotplug helper + Enable reset controller support * tag 'renesas-arm-defconfig-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: multi_v7_defconfig: Enable support for RZN1D-DB ARM: shmobile: defconfig: Disable /sbin/hotplug fork-bomb ARM: shmobile: defconfig: Enable support for RZN1D-DB ARM: shmobile: defconfig: Enable reset controller support ARM: shmobile: defconfig: Drop NET_VENDOR_=n Signed-off-by: Olof Johansson commit 6672e8d50c5b49e0b559e372116627d980d42c1d Merge: 46c9f4716d20 c5d0cad11d3e Author: Olof Johansson Date: Wed Jul 25 23:58:32 2018 -0700 Merge tag 'qcom-defconfig-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/defconfig Qualcomm ARM Based defconfig Updates for v4.19 * Enable Qualcomm NAND config * tag 'qcom-defconfig-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: ARM: qcom_defconfig: Enable QCOM NAND related configs Signed-off-by: Olof Johansson commit 46c9f4716d2021ae784851d412362cc8a37996e1 Merge: fb5c81931a2b f8120d61ceb7 Author: Olof Johansson Date: Wed Jul 25 23:58:05 2018 -0700 Merge tag 'qcom-arm64-defconfig-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/defconfig Qualcomm ARM64 Based defconfig Updates for v4.19 * Enable Qualcomm NAND driver * tag 'qcom-arm64-defconfig-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: arm64: defconfig: Enable CONFIG_MTD_NAND_QCOM for IPQ8074 Signed-off-by: Olof Johansson commit ee57dd5af74394266fdf571168201eaeb09ddff0 Merge: 74e828c8913c 965228d33cd2 Author: Olof Johansson Date: Wed Jul 25 23:57:24 2018 -0700 Merge tag 'samsung-dt-4.19-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/dt Samsung DTS ARM changes for v4.19, part 2 1. Add missing interrupts to PWM nodes on Exynos5. 2. Add missing interrupt pin pull up/down configuration on Exynos4412 Midas boards. The interrupts were mostly working thanks to initial configuration by bootloader. * tag 'samsung-dt-4.19-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: exynos: Configure Midas SD card CD pin ARM: dts: exynos: Configure max77686 IRQ pin on Midas ARM: dts: exynos: Add pinctrl for Midas fuelgauge IRQ pin ARM: dts: exynos: Add pinctrl config for Midas keys ARM: dts: exynos: Add max77693 pinctrl config for Midas ARM: dts: exynos: Add missing interrupts for pwm node on Exynos5 Signed-off-by: Olof Johansson commit 74e828c8913c4390b751232f33bf9bfeb0bacf95 Merge: ba8e2b94d9a7 ecbd611882a1 Author: Olof Johansson Date: Wed Jul 25 23:56:06 2018 -0700 Merge tag 'sunxi-dt64-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt Allwinner arm64 DT changes for 4.19 Some interesting changes, especially: - MMC support for the H6 - PMIC support for the PineH64 - HDMI simplefb support for the A64 - PWM support for the A64 - New board: Pinebook, Amarula A64-Relic * tag 'sunxi-dt64-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: (22 commits) arm64: allwinner: h6: enable MMC0/2 on Pine H64 arm64: allwinner: h6: add device tree nodes for MMC controllers dt-binding: mmc: sunxi: add H6 compatible (with A64 fallback) arm64: dts: allwinner: a64: Remove unused address-cells/size-cells of dwmac-sun8i arm64: dts: allwinner: h6: enable AXP805 PMIC on Pine H64 arm64: dts: allwinner: h6: Use macros for R_CCU clock and reset indices arm64: dts: allwinner: a64: add HDMI regulator to all DTs' simplefb_hdmi arm64: dts: allwinner: a64: add device tree node for HDMI simplefb arm64: dts: allwinner: a64: add necessary device tree nodes for DE2 CCU arm64: dts: allwinner: h6: Add LED device nodes for Pine H64 arm64: allwinner: a64: allow laptops to wake up from lid arm64: allwinner: a64: change TERES-I DLDO3's name to start with "vdd" arm64: allwinner: a64-sopine: Add cd-gpios to mmc0 node arm64: dts: allwinner: a64: add SRAM controller device tree node arm64: dts: allwinner: add support for Pinebook arm64: dts: allwinner: a64: Add PWM controllers arm64: dts: allwinner: a64: add R_I2C controller arm64: allwinner: a64-amarula-relic: Enable AP6330 WiFi support arm64: allwinner: a64: Add RTC clock to phandle 32kHz external oscillator arm64: allwinner: a64: Add Amarula A64-Relic initial support ... Signed-off-by: Olof Johansson commit ba8e2b94d9a74d28d662f8f8a03169ffd92bf54e Merge: 9604ff923cee c0476a31fb38 Author: Olof Johansson Date: Wed Jul 25 23:55:23 2018 -0700 Merge tag 'sunxi-dt-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt Allwinner DT changes for 4.19 There's a number of additions for the ARMv7 SoCs for this merge window, and especially: - Addition of the system controller for a number of SoCs, as part of the VPU effort - Addition of the R40 HDMI support - Addition of the Mali GPU node for the A10 * tag 'sunxi-dt-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: (21 commits) ARM: dts: sun4i: Add GPU node ARM: dts: sun5i: Fix the SRAM A3-A4 declaration ARM: dts: sun8i: r40: Remove unused address-cells/size-cells of dwmac-sun8i ARM: dts: sun8i: a83t: Remove unused address-cells/size-cells of dwmac-sun8i dt-bindings: net: dwmac-sun8i: Remove unused address-cells/size-cells ARM: dts: sun8i: h3: Add SRAM controller node and C1 SRAM region ARM: dts: sun8i: a23-a33: Add SRAM controller node and C1 SRAM region ARM: dts: sun7i: Add support for the C1 SRAM region with the SRAM controller ARM: dts: sun5i: Add support for the C1 SRAM region with the SRAM controller ARM: dts: sun7i: Use most-qualified system control compatibles ARM: dts: sun5i: Use most-qualified system control compatibles ARM: dts: sun4i: Switch to new system control compatible string ARM: dts: sun8i: r40: Disable TCONs by default. ARM: dts: sun8i: r40: Add missing TCON-TOP - TCON connections ARM: dts: sun8i: r40: Remove fallback compatible for TCON TV ARM: dts: sun8i: r40: Add mixer ids to TCON TOP ARM: dts: sun8i: r40: Remove fallback display engine compatible ARM: dts: sun8i: a83t: Add CPU regulator supplies for A83T boards ARM: dts: sun8i: r40: Enable HDMI output on BananaPi M2 Ultra ARM: dts: sun8i: r40: Add HDMI pipeline ... Signed-off-by: Olof Johansson commit 9604ff923ceea350eb32b91bf1e90ada2487856a Merge: ea537363c7b9 ab8b1fdd012f Author: Olof Johansson Date: Wed Jul 25 23:54:31 2018 -0700 Merge tag 'omap-for-v4.19/dt-pt3-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt Start using ti-sysc with device tree data for omap4 l4 devices With ti-sysc driver working for most use cases, we can start converting the omap variant SoCs to use device tree data for the interconnect target modules instead of the legacy hwmod platform data. We start with omap4 l4 devices excluding the ones that still depend on a reset controller driver like DSP MMU. And we don't yet convert the l4 ABE instance as that needs a bit more work. We also add a proper interconnect hierarchy for the devices while at it to make further work on genpd easier and to avoid most deferred probe issues. At this point we are not dropping any platform data, and we initially still use it to validate the dts data. Then in later merge cycles we can start dropping the related platform data. * tag 'omap-for-v4.19/dt-pt3-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: omap4: Add l4 ranges for 4460 ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc ARM: dts: omap4: Probe watchdog 3 with ti-sysc ARM: dts: omap4: Add l4 interconnect hierarchy and ti-sysc data dt-bindings: Update omap l4 binding for optional registers Signed-off-by: Olof Johansson commit ea537363c7b9a528b9885812d265b400e4036f4b Merge: 295d44ae7897 aaa080fa7e0f Author: Olof Johansson Date: Wed Jul 25 23:53:39 2018 -0700 Merge tag 'amlogic-dt64-2-1' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/dt Amlogic 64-bit DT changes for v4.19, round 2 - new SoC: S905W - new boards: based on S905W: Amlogic P281, Oranth Tanix TX3 Mini - AXG: add DT for new audio clock controller * tag 'amlogic-dt64-2-1' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: ARM64: dts: meson-gxl: add support for the Oranth Tanix TX3 Mini ARM64: dts: meson-gxl: add support for the S905W SoC and the P281 board dt-bindings: arm: amlogic: Add support for the Oranth Tanix TX3 Mini dt-bindings: arm: amlogic: Add support for GXL S905W and the P281 board dt-bindings: add vendor prefix for Shenzhen Oranth Technology Co., Ltd. ARM64: dts: meson-axg: add the audio clock controller clk: meson: expose GEN_CLK clkid clk: meson-axg: add pcie and mipi clock bindings dt-bindings: clock: add meson axg audio clock controller bindings Signed-off-by: Olof Johansson commit 295d44ae7897d487e75cd10966699da6f5db4903 Merge: bcdd22084987 c03e2f12a296 Author: Olof Johansson Date: Wed Jul 25 23:53:02 2018 -0700 Merge tag 'renesas-arm-dt-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt Renesas ARM Based SoC DT Updates for v4.19 * RZ/G1C (r8a77470) SoC: Use r8a77470-cpg-mssr binding definitions * Add GR-Peach audio camera shield support with MT9V111 image sensor * Add initial support for RZ/N1D (r9a06g032) SoC and its RZN1D-DB board * Use SPDX identifiers in DT for all SoCs and boards * Add missing OPP properties for all CPUs on various SoCs * Add missing PMIC nodes to R-Car Gen2 M2-W (r8a7791) based porter board * tag 'renesas-arm-dt-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: dts: r8a77470: Use r8a77470-cpg-mssr binding definitions ARM: dts: gr-peach: Add GR-Peach audiocamerashield support ARM: dts: Renesas R9A06G032 SMP enable method ARM: dts: Renesas RZN1D-DB Board base file ARM: dts: Renesas R9A06G032 base device tree file ARM: dts: convert to SPDX identifier for Renesas boards ARM: dts: r8a77(43|9[013]): Add missing OPP properties for CPUs ARM: dts: porter: Add missing PMIC nodes Signed-off-by: Olof Johansson commit bcdd2208498751fce2d5d44d64f79677e6d23e5b Merge: 3f0f096bf064 b2d94b3ff063 Author: Olof Johansson Date: Wed Jul 25 23:52:20 2018 -0700 Merge branch 'sprd/dt' into next/dt * sprd/dt: arm64: dts: sprd: Add one suspend timer arm64: dts: sprd: Add SC27XX ADC device arm64: dts: sprd: Add SC27XX eFuse device arm64: dts: sprd: Add SC27XX vibrator device arm64: dts: sprd: Add SC27XX breathing light controller device Signed-off-by: Olof Johansson commit b2d94b3ff0638441460ce1fb23258cbd3374fd8e Author: Baolin Wang Date: Mon Jul 23 14:10:20 2018 +0800 arm64: dts: sprd: Add one suspend timer On Spreadtrum platform, the current clocksource for timekeeping will be stopped in suspend state, thus add one always-on timer to calculate the suspend time. Signed-off-by: Baolin Wang Signed-off-by: Olof Johansson commit fc8e565f201853c22dfc75c873db9108488111bc Author: Baolin Wang Date: Mon Jul 23 14:10:19 2018 +0800 arm64: dts: sprd: Add SC27XX ADC device Add the Spreadtrum SC27XX PMICs ADC device node which contains 32 channels. Signed-off-by: Baolin Wang Signed-off-by: Olof Johansson commit 17a376c0b53a18975c71ebfc7cee71c3760de913 Author: Baolin Wang Date: Mon Jul 23 14:10:18 2018 +0800 arm64: dts: sprd: Add SC27XX eFuse device This patch adds the eFuse device node for Spreadtrum SC27XX PMICs. The SC27XX eFuse contains 32 blocks and each block's data width is 16 bits. Signed-off-by: Baolin Wang Signed-off-by: Olof Johansson commit f94cd003c2c0d9fba5f9a86d2cac06edbd0dbf4d Author: Baolin Wang Date: Mon Jul 23 14:10:17 2018 +0800 arm64: dts: sprd: Add SC27XX vibrator device This patch adds the vibrator device node for Spreadtrum SC27XX PMICs. Signed-off-by: Baolin Wang Signed-off-by: Olof Johansson commit 02c2455e92613864fdc516a1773dfa0f0a06db6e Author: Baolin Wang Date: Mon Jul 23 14:10:16 2018 +0800 arm64: dts: sprd: Add SC27XX breathing light controller device The SC27xx breathing light controller can support 3 outputs: red LED, green LED and blue LED. Signed-off-by: Baolin Wang Signed-off-by: Olof Johansson commit 3f0f096bf064dd0562058e118c98b6e97225c5f3 Merge: 9be6a940ec0f b0c28f276581 Author: Olof Johansson Date: Wed Jul 25 23:40:51 2018 -0700 Merge tag 'qcom-dts-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/dt Qualcomm Device Tree Changes for v4.19 * Add missing OPPs on IPQ4019 * Fix sdhci l20 load on Hammerhead * Use proper IRQ macros for IPQ8064 interrupts * tag 'qcom-dts-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: ARM: dts: qcom: Add missing OPP properties for CPUs ARM: dts: qcom: msm8974-hammerhead: increase load on l20 for sdhci ARM: dts: qcom: Fix 'interrupts = <>' property to use proper macros Signed-off-by: Olof Johansson commit 9be6a940ec0fdbe384995de8f2829edc5a1fdedc Merge: 94dee3861fd2 e53db018315b Author: Olof Johansson Date: Wed Jul 25 23:39:59 2018 -0700 Merge tag 'qcom-arm64-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/dt Qualcomm ARM64 Updates for v4.19 * Add support for PM8005/PM8998 and related nodes * Add/fix nodes on SDM845 for I2c, SPI, UART, and RPMH * Fix BT LED trigger on DB410c * Drop legacy clock names on MSM8916 * Add gpio line names on DB820c * tag 'qcom-arm64-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: arm64: dts: qcom: db410c: Fix Bluetooth LED trigger arm64: dts: sdm845: Default qupv3_id_0 as "disabled" like _id_1 arm64: dts: msm8916: drop legacy suffix for clocks used by MSM DRM driver arm64: dts: qcom: db820c: Add gpio-line-names property arm64: dts: sdm845: Add rpmh-clk node arm64: dts: sdm845: Add rpmh-rsc node arm64: dts: qcom: sdm845: Enable debug UART and I2C10 on sdm845-mtp arm64: dts: qcom: sdm845: Add I2C, SPI, and UART9 nodes arm64: dts: qcom: Add pm8005 and pm8998 support arm64: dts: qcom: Add pmu node to sdm845 Signed-off-by: Olof Johansson commit 63623646a06358833766016d8c1fe14d6576b3d0 Author: Takashi Iwai Date: Wed Jul 25 23:00:57 2018 +0200 ALSA: emu10k1: Fix missing __force annotation for user/kernel pointer cast The cast between user-space and kernel-space needs an explicit __force prefix, but it's missing in many places in emu10k1 driver code. Spotted by sparse as a warning like: sound/pci/emu10k1/emufx.c:529:33: warning: cast removes address space of expression Signed-off-by: Takashi Iwai commit 0701492c86ac0446a834da35ef4991bcf8adb6c4 Author: Takashi Iwai Date: Wed Jul 25 23:00:56 2018 +0200 ALSA: korg1212: Add __force annotation to cast in user-copy callbacks The user-copy callbacks in korg1212 driver contain the explicit cast from a user pointer to a kernel pointer, but they missed __force prefix. It's mandatory for converting between them. Spotted by sparse, a warning like: sound/pci/korg1212/korg1212.c:1329:33: warning: cast removes address space of expression Signed-off-by: Takashi Iwai commit 191bb51e72c3b2b1ed1b2bd7ac30dd9f7ccea306 Author: Takashi Iwai Date: Wed Jul 25 23:00:55 2018 +0200 ALSA: pcm: Use standard lower_32_bits() and upper_32_bits() Instead of open codes, use the standard macros for obtaining the lower and upper 32bit values. Signed-off-by: Takashi Iwai commit 95a48b7d4459948b6bacf809809cf01a7dc06d1d Author: Takashi Iwai Date: Wed Jul 25 23:00:54 2018 +0200 ALSA: pcm: Add __force to cast in snd_pcm_lib_read/write() The snd_pcm_lib_read() and snd_pcm_lib_write() inline functions have the explicit cast from a user pointer to a kernel pointer, but they lacks of __force prefix. This fixes sparse warnings like: ./include/sound/pcm.h:1093:47: warning: cast removes address space of expression Fixes: 68541213720d ("ALSA: pcm: Direct in-kernel read/write support") Signed-off-by: Takashi Iwai commit 00966dcdf0e324e10ab79d505732c339f72417d9 Author: Takashi Iwai Date: Wed Jul 25 23:00:53 2018 +0200 ALSA: usb-audio: Declare the common variable in header file Declare snd_usb_feature_unit_ctl properly in mixer.h. Otherwise it's error-prone. This fixes the sparse warning: sound/usb/mixer.c:1464:25: warning: symbol 'snd_usb_feature_unit_ctl' was not declared. Should it be static? Signed-off-by: Takashi Iwai commit 7e9c20f40304a16d5f69dbdc44a551cc48252266 Author: Takashi Iwai Date: Wed Jul 25 23:00:52 2018 +0200 ALSA: opl3: Declare common variables properly Move the declarations of common variables into opl3_voice.h instead of declaring at each file multiple times, which was error-prone. This fixes sparse warnings like: sound/drivers/opl3/opl3_synth.c:51:6: warning: symbol 'snd_opl3_regmap' was not declared. Should it be static? Signed-off-by: Takashi Iwai commit ebd836edfc4324da016ce0c09f809f882a133f50 Author: Takashi Iwai Date: Wed Jul 25 23:00:51 2018 +0200 ALSA: hda - Fix a sparse warning about snd_ctl_elem_iface_t The knew->iface field is in snd_ctl_elem_iface_t, which is with __bitwise, hence it can't be converted implicitly from integer. Give an explicit cast for the invalid type. Spotted by sparse: sound/pci/hda/hda_codec.c:3280:25: warning: restricted snd_ctl_elem_iface_t degrades to integer Signed-off-by: Takashi Iwai commit dcda6f7853c52c42d242b474bfbd1d17d02c8870 Author: Takashi Iwai Date: Wed Jul 25 23:00:50 2018 +0200 ALSA: msnd: Use NULL instead of 0 Fix a sparse warning: sound/isa/msnd/msnd_pinnacle.c:813:1: warning: Using plain integer as NULL pointer Signed-off-by: Takashi Iwai commit bb86124c80780d9d2a2d9bef7f0840e61007ebb7 Author: Takashi Iwai Date: Wed Jul 25 23:00:49 2018 +0200 ALSA: hda/ca0132 - Use NULL instead of 0 Use NULL for initializing the snd_kcontrol_new.tlv field, instead of 0, as warned by sparse: sound/pci/hda/patch_ca0132.c:5519:22: warning: Using plain integer as NULL pointer Also, the driver does the same initialization twice, once for knew.tlv.c and another for knew.tlv.p while both point to the same address (these are union). Drop the latter superfluous one. Signed-off-by: Takashi Iwai commit 7c500f9ea139d0c9b80fdea5a9c911db3166ea54 Author: Takashi Iwai Date: Wed Jul 25 23:00:48 2018 +0200 ALSA: msnd: Fix the default sample sizes The default sample sizes set by msnd driver are bogus; it sets ALSA PCM format, not the actual bit width. Signed-off-by: Takashi Iwai commit ab647a2d62f70cf45d7c64bf9f1574b8c52406e4 Author: Takashi Iwai Date: Wed Jul 25 23:00:47 2018 +0200 ALSA: msnd: Add missing __iomem annotations The io-mapped buffers used in msnd drivers need __iomem annotations. This fixes sparse warnings like: sound/isa/msnd/msnd_pinnacle.c:172:45: warning: incorrect type in initializer (different address spaces) Signed-off-by: Takashi Iwai commit bd1cd0eb2ce9141100628d476ead4de485501b29 Author: Takashi Iwai Date: Wed Jul 25 23:00:46 2018 +0200 ALSA: usb-audio: Fix multiple definitions in AU0828_DEVICE() macro AU0828_DEVICE() macro in quirks-table.h uses USB_DEVICE_VENDOR_SPEC() for expanding idVendor and idProduct fields. However, the latter macro adds also match_flags and bInterfaceClass, which are different from the values AU0828_DEVICE() macro sets after that. For fixing them, just expand idVendor and idProduct fields manually in AU0828_DEVICE(). This fixes sparse warnings like: sound/usb/quirks-table.h:2892:1: warning: Initializer entry defined twice Signed-off-by: Takashi Iwai commit b080dc5bd0dfc0b33c6cfc31f909c93d5e63c186 Author: Jeff Crukley Date: Wed Jul 25 15:05:01 2018 -0400 ALSA: usb-audio: Add support for Encore mDSD USB DAC This patch adds native DSD playback support for the Encore mDSD USB DAC by specifying the vendor and product ID's Signed-off-by: Jeff Crukley Signed-off-by: Takashi Iwai commit 69756930f2de0457d51db7d505a1e4f40e9fd116 Author: Takashi Iwai Date: Wed Jul 25 17:59:26 2018 +0200 ALSA: cs5535audio: Fix invalid endian conversion One place in cs5535audio_build_dma_packets() does an extra conversion via cpu_to_le32(); namely jmpprd_addr is passed to setup_prd() ops, which writes the value via cs_writel(). That is, the callback does the conversion by itself, and we don't need to convert beforehand. This patch fixes that bogus conversion. Cc: Signed-off-by: Takashi Iwai commit 3acd3e3bab95ec3622ff98da313290ee823a0f68 Author: Takashi Iwai Date: Wed Jul 25 17:11:38 2018 +0200 ALSA: vxpocket: Fix invalid endian conversions The endian conversions used in vxp_dma_read() and vxp_dma_write() are superfluous and even wrong on big-endian machines, as inw() and outw() already do conversions. Kill them. Cc: Signed-off-by: Takashi Iwai commit fff71a4c050ba46e305d910c837b99ba1728135e Author: Takashi Iwai Date: Wed Jul 25 17:10:11 2018 +0200 ALSA: vx222: Fix invalid endian conversions The endian conversions used in vx2_dma_read() and vx2_dma_write() are superfluous and even wrong on big-endian machines, as inl() and outl() already do conversions. Kill them. Spotted by sparse, a warning like: sound/pci/vx222/vx222_ops.c:278:30: warning: incorrect type in argument 1 (different base types) Cc: Signed-off-by: Takashi Iwai commit a49a71f6e25da2acc637fcd31e73debd96ca18f8 Author: Takashi Iwai Date: Wed Jul 25 16:34:12 2018 +0200 ALSA: seq: Fix poll() error return The sanity checks in ALSA sequencer and OSS sequencer emulation codes return falsely -ENXIO from poll callback. They should be EPOLLERR instead. This was caught thanks to the recent change to the return value. Cc: Signed-off-by: Takashi Iwai commit b5c6f7607b908b1445f2556c8d2f3b1ec5fc5aa8 Author: Paul Mackerras Date: Thu Jul 26 15:38:41 2018 +1000 KVM: PPC: Book3S HV: Read kvm->arch.emul_smt_mode under kvm->lock Commit 1e175d2 ("KVM: PPC: Book3S HV: Pack VCORE IDs to access full VCPU ID space", 2018-07-25) added code that uses kvm->arch.emul_smt_mode before any VCPUs are created. However, userspace can change kvm->arch.emul_smt_mode at any time up until the first VCPU is created. Hence it is (theoretically) possible for the check in kvmppc_core_vcpu_create_hv() to race with another userspace thread changing kvm->arch.emul_smt_mode. This fixes it by moving the test that uses kvm->arch.emul_smt_mode into the block where kvm->lock is held. Signed-off-by: Paul Mackerras commit dc66fe43b7ebdb53628dcbc1f8f15de3e000aacf Author: Gustavo A. R. Silva Date: Wed Jul 25 10:22:27 2018 -0500 rds: send: Fix dead code in rds_sendmsg Currently, code at label *out* is unreachable. Fix this by updating variable *ret* with -EINVAL, so the jump to *out* can be properly executed instead of directly returning from function. Addresses-Coverity-ID: 1472059 ("Structurally dead code") Fixes: 1e2b44e78eea ("rds: Enable RDS IPv6 support") Signed-off-by: Gustavo A. R. Silva Acked-by: Sowmini Varadhan Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit ba7d7e2677c0953b251c36588b15f5f442e59c84 Author: Anders Roxell Date: Thu Jul 26 00:20:08 2018 +0200 net/rds/Kconfig: RDS should depend on IPV6 Build error, implicit declaration of function __inet6_ehashfn shows up When RDS is enabled but not IPV6. net/rds/connection.c: In function ‘rds_conn_bucket’: net/rds/connection.c:67:9: error: implicit declaration of function ‘__inet6_ehashfn’; did you mean ‘__inet_ehashfn’? [-Werror=implicit-function-declaration] hash = __inet6_ehashfn(lhash, 0, fhash, 0, rds_hash_secret); ^~~~~~~~~~~~~~~ __inet_ehashfn Current code adds IPV6 as a depends on in config RDS. Fixes: eee2fa6ab322 ("rds: Changing IP address internal representation to struct in6_addr") Signed-off-by: Anders Roxell Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit b9a9ad782f9db64daccc66a490e157f9c499a480 Merge: f53753058488 0d18a0cb4b15 Author: David S. Miller Date: Wed Jul 25 22:25:54 2018 -0700 Merge branch 'smc-next' Ursula Braun says: ==================== net/smc: patches 2018-07-25 here are 4 more patches for SMC: The first one is just a small code cleanup in preparation for patch 2. Patch 2 switches to the use of the vlan-gid for VLAN traffic. Patch 3 improves diagnosis when creating SMC connections. Patch 4 improves synchronization between local and remote link groups. ==================== Signed-off-by: David S. Miller commit 0d18a0cb4b1585d9e5a3b300d5df9ed866561ffb Author: Karsten Graul Date: Wed Jul 25 16:35:33 2018 +0200 net/smc: improve delete link processing Send an orderly DELETE LINK request before termination of a link group, add support for client triggered DELETE LINK processing. And send a disorderly DELETE LINK before module is unloaded. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 603cc1498455cf57f5ca4483b600efb37ea2c56c Author: Karsten Graul Date: Wed Jul 25 16:35:32 2018 +0200 net/smc: provide fallback reason code Remember the fallback reason code and the peer diagnosis code for smc sockets, and provide them in smc_diag.c to the netlink interface. And add more detailed reason codes. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 7005ada68d1774d7c1109deaba0c2cd8e46f5091 Author: Ursula Braun Date: Wed Jul 25 16:35:31 2018 +0200 net/smc: use correct vlan gid of RoCE device SMC code uses the base gid for VLAN traffic. The gids exchanged in the CLC handshake and the gid index used for the QP have to switch from the base gid to the appropriate vlan gid. When searching for a matching IB device port for a certain vlan device, it does not make sense to return an IB device port, which is not enabled for the used vlan_id. Add another check whether a vlan gid exists for a certain IB device port. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 947541f36c561b5e0ca639ffc450a8c5221de467 Author: Ursula Braun Date: Wed Jul 25 16:35:30 2018 +0200 net/smc: fewer parameters for smc_llc_send_confirm_link() Link confirmation will always be sent across the new link being confirmed. This allows to shrink the parameter list. No functional change. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit f53753058488295344e7fcdba3da4c33a49b70ac Merge: b24dbfe9ce03 5ea14712d7a2 Author: David S. Miller Date: Wed Jul 25 22:17:45 2018 -0700 Merge branch 'nfp-protect-from-theoretical-size-overflows-and-SR-IOV-errors' Jakub Kicinski says: ==================== nfp: protect from theoretical size overflows and SR-IOV errors This small set changes the handling of pci_sriov_set_totalvfs() errors. nfp is the only driver which fails probe on pci_sriov_set_totalvfs() errors. It turns out some BIOS configurations may break SR-IOV and users who don't use that feature should not suffer. Remaining patches makes sure we use overflow-safe function for ring allocation, even though ring sizes are limited. It won't hurt and we can also enable fallback to vmalloc() if memory is tight while at it. ==================== Signed-off-by: David S. Miller commit 5ea14712d7a22703645217c5296e72cb5adba0a6 Author: Jakub Kicinski Date: Wed Jul 25 19:40:37 2018 -0700 nfp: protect from theoretical size overflows on HW descriptor ring Use array_size() and store the size as full size_t to protect from theoretical size overflow when handling HW descriptor rings. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit e76c1d3d2a8313040d8316f760e9476028a27758 Author: Jakub Kicinski Date: Wed Jul 25 19:40:36 2018 -0700 nfp: restore correct ordering of fields in rx ring structure Commit 7f1c684a8966 ("nfp: setup xdp_rxq_info") mixed the cache cold and cache hot data in the nfp_net_rx_ring structure (ignoring the feedback), to try to fit the structure into 2 cache lines after struct xdp_rxq_info was added. Now that we are about to add a new field the structure will grow back to 3 cache lines, so order the members correctly. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit 4662717038679520af832fcb8c4fefadb97facf8 Author: Jakub Kicinski Date: Wed Jul 25 19:40:35 2018 -0700 nfp: use kvcalloc() to allocate SW buffer descriptor arrays Use kvcalloc() instead of tmp variable + kzalloc() when allocating SW buffer information to allow falling back to vmalloc and to protect from theoretical integer overflow. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit 5b0ced17edc5710d4e946392d0f2934a9e07b37f Author: Jakub Kicinski Date: Wed Jul 25 19:40:34 2018 -0700 nfp: don't fail probe on pci_sriov_set_totalvfs() errors On machines with buggy ACPI tables or when SR-IOV is already enabled we may not be able to set the SR-IOV VF limit in sysfs, it's not fatal because the limit is imposed by the driver anyway. Only the sysfs 'sriov_totalvfs' attribute will be too high. Print an error to inform user about the failure but allow probe to continue. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit 44e2b838c24d883dae8496dc7b6ddac7956ba53c Author: Benedict Wong Date: Wed Jul 25 13:45:29 2018 -0700 xfrm: Return detailed errors from xfrmi_newlink Currently all failure modes of xfrm interface creation return EEXIST. This change improves the granularity of errnos provided by also returning ENODEV or EINVAL if failures happen in looking up the underlying interface, or a required parameter is not provided. This change has been tested against the Android Kernel Networking Tests, with additional xfrmi_newlink tests here: https://android-review.googlesource.com/c/kernel/tests/+/715755 Signed-off-by: Benedict Wong Signed-off-by: Steffen Klassert commit 934ffce1343f22ed5e2d0bd6da4440f4848074de Author: YueHaibing Date: Wed Jul 25 16:54:33 2018 +0800 xfrm: fix 'passing zero to ERR_PTR()' warning Fix a static code checker warning: net/xfrm/xfrm_policy.c:1836 xfrm_resolve_and_create_bundle() warn: passing zero to 'ERR_PTR' xfrm_tmpl_resolve return 0 just means no xdst found, return NULL instead of passing zero to ERR_PTR. Fixes: d809ec895505 ("xfrm: do not assume that template resolving always returns xfrms") Signed-off-by: YueHaibing Signed-off-by: Steffen Klassert commit 1ebe6b81ebdba8faf377d1d7d84ad9368e7a0bae Author: Paul Mackerras Date: Thu Jul 26 14:53:54 2018 +1000 KVM: PPC: Book3S HV: Allow creating max number of VCPUs on POWER9 Commit 1e175d2 ("KVM: PPC: Book3S HV: Pack VCORE IDs to access full VCPU ID space", 2018-07-25) allowed use of VCPU IDs up to KVM_MAX_VCPU_ID on POWER9 in all guest SMT modes and guest emulated hardware SMT modes. However, with the current definition of KVM_MAX_VCPU_ID, a guest SMT mode of 1 and an emulated SMT mode of 8, it is only possible to create KVM_MAX_VCPUS / 2 VCPUS, because threads_per_subcore is 4 on POWER9 CPUs. (Using an emulated SMT mode of 8 is useful when migrating VMs to or from POWER8 hosts.) This increases KVM_MAX_VCPU_ID to 8 * KVM_MAX_VCPUS when HV KVM is configured in, so that a full complement of KVM_MAX_VCPUS VCPUs can be created on POWER9 in all guest SMT modes and emulated hardware SMT modes. Signed-off-by: Paul Mackerras commit 537052df223408b25bdd77dbb9bf40080f514d3c Author: Benjamin Herrenschmidt Date: Thu Jul 26 14:49:50 2018 +1000 fsi: master-ast-cf: Rename dump_trace() to avoid name collision s390 defines a global dump_trace() symbol. Rename ours to dump_ucode_trace() to avoid a collision in build tests. Signed-off-by: Benjamin Herrenschmidt commit b24dbfe9ce03d9f83306616f22fb0e04e8960abe Author: YueHaibing Date: Thu Jul 26 09:51:27 2018 +0800 amd-xgbe: use dma_mapping_error to check map errors The dma_mapping_error() returns true or false, but we want to return -ENOMEM if there was an error. Fixes: 174fd2597b0b ("amd-xgbe: Implement split header receive support") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 90708adcd3ead258d4c2185da6acbe748eb0cc32 Author: Joel Stanley Date: Thu Jul 26 13:25:56 2018 +0930 ARM: config: aspeed: Enable new FSI drivers This turns on the FSI-attached I2C bus driver, and the ColdFire offloaded FSI master which are new to 4.19. Signed-off-by: Joel Stanley commit d238ca09810a02e9224c698094afda0e8003f419 Author: Jason Gunthorpe Date: Tue Jul 24 14:37:52 2018 -0600 IB/usnic: usnic should not select INFINIBAND_USER_ACCESS This driver doesn't provide any kernel services, it only provides an interface via uverbs, so it should depend on, not select, uverbs support. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1e175d2e07c71d9574f5b1c74523abca54e2654f Author: Sam Bobroff Date: Wed Jul 25 16:12:02 2018 +1000 KVM: PPC: Book3S HV: Pack VCORE IDs to access full VCPU ID space It is not currently possible to create the full number of possible VCPUs (KVM_MAX_VCPUS) on Power9 with KVM-HV when the guest uses fewer threads per core than its core stride (or "VSMT mode"). This is because the VCORE ID and XIVE offsets grow beyond KVM_MAX_VCPUS even though the VCPU ID is less than KVM_MAX_VCPU_ID. To address this, "pack" the VCORE ID and XIVE offsets by using knowledge of the way the VCPU IDs will be used when there are fewer guest threads per core than the core stride. The primary thread of each core will always be used first. Then, if the guest uses more than one thread per core, these secondary threads will sequentially follow the primary in each core. So, the only way an ID above KVM_MAX_VCPUS can be seen, is if the VCPUs are being spaced apart, so at least half of each core is empty, and IDs between KVM_MAX_VCPUS and (KVM_MAX_VCPUS * 2) can be mapped into the second half of each core (4..7, in an 8-thread core). Similarly, if IDs above KVM_MAX_VCPUS * 2 are seen, at least 3/4 of each core is being left empty, and we can map down into the second and third quarters of each core (2, 3 and 5, 6 in an 8-thread core). Lastly, if IDs above KVM_MAX_VCPUS * 4 are seen, only the primary threads are being used and 7/8 of the core is empty, allowing use of the 1, 5, 3 and 7 thread slots. (Strides less than 8 are handled similarly.) This allows the VCORE ID or offset to be calculated quickly from the VCPU ID or XIVE server numbers, without access to the VCPU structure. [paulus@ozlabs.org - tidied up comment a little, changed some WARN_ONCE to pr_devel, wrapped line, fixed id check.] Signed-off-by: Sam Bobroff Signed-off-by: Paul Mackerras commit 6a0b6174d35a141dfa30a32c848a3903e2d7f495 Author: Raju Rangoju Date: Wed Jul 25 21:22:14 2018 +0530 rdma/cxgb4: Add support for kernel mode SRQ's This patch implements the srq specific verbs such as create/destroy/modify and post_srq_recv. And adds srq specific structures and defines to t4.h and uapi. Also updates the cq poll logic to deal with completions that are associated with the SRQ's. This patch also handles kernel mode SRQ_LIMIT events as well as flushed SRQ buffers Signed-off-by: Raju Rangoju Reviewed-by: Steve Wise Signed-off-by: Jason Gunthorpe commit 7fc7a7cffab6b94cb5e47148e6852ba633078ea1 Author: Raju Rangoju Date: Wed Jul 25 21:22:13 2018 +0530 rdma/cxgb4: Add support for srq functions & structs This patch adds kernel mode t4_srq structures and support functions, uapi structures and defines, as well as firmware work request structures. Signed-off-by: Raju Rangoju Reviewed-by: Steve Wise Signed-off-by: Jason Gunthorpe commit 08a852528e9678f0854af331f19747f2b2a73c06 Author: Taeung Song Date: Wed Jul 25 15:36:51 2018 +0900 tools/bpftool: ignore build products For untracked things of tools/bpf, add this. Reviewed-by: Jakub Kicinski Signed-off-by: Taeung Song Signed-off-by: Daniel Borkmann commit 502defbb476bca222ddb5a78f2cc19c12c4e42f3 Author: Gustavo A. R. Silva Date: Wed Jul 25 08:38:32 2018 -0500 fsi: master-ast-cf: Fix memory leak In case memory resources for *fw* were allocated, release them before return. Addresses-Coverity-ID: 1472044 ("Resource leak") Fixes: 6a794a27daca ("fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Benjamin Herrenschmidt commit 756cd36626f773e9a72a39c1dd12da4deacfacdf Merge: 41147bb18a38 a0a777b9409f Author: David S. Miller Date: Wed Jul 25 16:46:02 2018 -0700 Merge branch 'mlxsw-Introduce-algorithmic-TCAM-support' Ido Schimmel says: ==================== mlxsw: Introduce algorithmic TCAM support The Spectrum-2 ASIC uses an algorithmic TCAM (A-TCAM) where multiple exact matches lookups are performed instead of a single lookup as with standard circuit TCAM (C-TCAM) memory. This allows for higher scale and reduced power consumption. The lookups are performed by masking a packet using different masks (e.g., {dst_ip/24, ethtype}) defined for the region and looking for an exact match. Eventually, the rule with the highest priority will be picked. Since the number of masks per-region is limited, the ASIC includes a C-TCAM that can be used as a spill area for rules that do not fit into the A-TCAM. The driver currently uses a C-TCAM only mode which is similar to Spectrum-1. However, this mode severely limits both the number of supported ACL rules and the performance of the ACL lookup. This patch set introduces initial support for the A-TCAM mode where the C-TCAM is only used for rule spillage. The first five patches add the registers and ASIC resources needed in order to make use of the A-TCAM. Next three patches are the "meat" and add the eRP core which is used to manage the masks used by each ACL region. The individual commit messages are lengthy and aim to thoroughly explain the subject. The next seven patches perform small adjustments in the code and the related data structures and are meant to prepare the code base to the introduction of the A-TCAM in the last two patches. Various A-TCAM optimization will be the focus of follow-up patch sets: * Pruning - Used to reduce the number of lookups. Each rule will include a prune vector that indicates which masks should not be considered for further lookups as they cannot result in a higher priority match * Bloom filter - Used to reduce the number of lookups. Before performing a lookup with a given mask the ASIC will consult a bloom filter (managed by the driver) that indicates whether a match might exist using the considered mask * Masks aggregation - Used to increase scale and reduce lookups. Masks that only differ by up to eight consecutive bits (delta bits) can be aggregated into a single mask. The delta bits then become a part of the rule's key. For example, dst_ip/16 and dst_ip/17 can be represented as dst_ip/16 with a delta bit of one. Rules using the aggregated mask then specify whether the 17-th bit should be masked or not and its value ==================== Signed-off-by: David S. Miller commit a0a777b9409fdb61ec4a752f8f9e88f5916e0a70 Author: Ido Schimmel Date: Wed Jul 25 09:24:06 2018 +0300 mlxsw: spectrum_acl: Start using A-TCAM Now that all the pieces are in place we can start using the A-TCAM instead of only using the C-TCAM. This allows for much higher scale and better performance (to be improved further by follow-up patch sets). Perform the integration with the A-TCAM and the eRP core by reverting the changes introduced by "mlxsw: spectrum_acl: Enable C-TCAM only mode in eRP core" and add calls from the C-TCAM code into the eRP core. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit a8758b67bf37ceb50e5b8c2b9138231c76461d20 Author: Ido Schimmel Date: Wed Jul 25 09:24:05 2018 +0300 mlxsw: spectrum_acl: Add A-TCAM rule insertion and deletion Implement rule insertion and deletion into the A-TCAM before we flip the driver to start using the A-TCAM. Rule insertion into the A-TCAM is very similar to C-TCAM, but there are subtle differences between regions of different sizes (i.e., different number of key blocks). Specifically, as explained in "mlxsw: spectrum_acl: Allow encoding a partial key", in 12 key blocks regions a rule is split into two and the two halves of the rule are linked using a "large entry key ID". Such differences are abstracted away by using different region operations per region type. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit a20ff8eb3f15c8adcae60fc467697b442f6267eb Author: Ido Schimmel Date: Wed Jul 25 09:24:04 2018 +0300 mlxsw: spectrum_acl: Pass C-TCAM region and entry to insert function When A-TCAM will be used together with C-TCAM, the C-TCAM code will need to call into the eRP core in order to get an eRP for an inserted entry. The eRP core takes an A-TCAM region as one of its arguments, so pass the C-TCAM region to the insertion function which will later allow us to derive the A-TCAM region, given it contains the C-TCAM one. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 6d240650bcfdba2860ab2691b5fd4352105d95a0 Author: Ido Schimmel Date: Wed Jul 25 09:24:03 2018 +0300 mlxsw: spectrum_acl: Add A-TCAM region initialization Before we start using the A-TCAM we need to make sure the region is properly initialized. This includes the setting of its type (which affects the size of its eRP table, for example) and its registration with the eRP core. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit f58df510f899e4560c4e2d397f05a53f0d343fc0 Author: Ido Schimmel Date: Wed Jul 25 09:24:02 2018 +0300 mlxsw: spectrum_acl: Make global TCAM resources available to regions Each TCAM region currently uses its own resources and there is no sharing between the different regions. This is going to change with A-TCAM as each region will need to allocate an eRP table from the global eRP tables array. Make the global TCAM resources available to each region by passing the TCAM private data to the region initialization routine. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 57e56d369914996ed81581da04af7b04a256a20a Author: Ido Schimmel Date: Wed Jul 25 09:24:01 2018 +0300 mlxsw: spectrum_acl: Encapsulate C-TCAM region in A-TCAM region In Spectrum-2 the C-TCAM is only used for rules that can't fit in the A-TCAM due to a limited number of masks per A-TCAM region. In addition, rules inserted into the C-TCAM may affect rules residing in the A-TCAM, by clearing their C-TCAM prune bit. The two regions are thus closely related and can be thought of as if the C-TCAM region is encapsulated in the A-TCAM one. Change the data structures to reflect that before introducing A-TCAM support and make C-TCAM region initialization part of the A-TCAM region initialization sequence. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 174c0adb69a56bf098d9eb50cd3a78ec14657817 Author: Ido Schimmel Date: Wed Jul 25 09:24:00 2018 +0300 mlxsw: spectrum_acl: Add A-TCAM initialization Initialize the A-TCAM as part of the driver's initialization routine. Specifically, initialize the eRP tables so that A-TCAM regions will be able to perform allocations of eRP tables upon rule insertion in subsequent patches. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit ca49544ed6ace7a1aee942a9f8e2553f9b1ddf2b Author: Ido Schimmel Date: Wed Jul 25 09:23:59 2018 +0300 mlxsw: spectrum_acl: Allow encoding a partial key When working with 12 key blocks in the A-TCAM, rules are split into two records, which constitute two lookups. The two records are linked using a "large entry key ID". The ID is assigned to key blocks 6 to 11 and resolved during the first lookup. The second lookup is performed using the ID and the remaining key blocks. Allow encoding a partial key so that it can be later used to check if an ID can be reused. This is done by adding two arguments to the existing encode function that specify the range of the block indexes we would like to encode. The key and mask arguments become optional, as we will not need to encode both of them all the time. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit befc7747df2071845ae2c3b97c759a4df032ae5e Author: Ido Schimmel Date: Wed Jul 25 09:23:58 2018 +0300 mlxsw: spectrum_acl: Extend Spectrum-2 region struct In a similar fashion to Spectrum-1's region struct, Spectrum-2's struct needs to store a pointer to the common region struct. The pointer will be used in follow-up patches that implement rules insertion and deletion. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit b17b113e0c38e94c2f8c0763926c6a2168293201 Author: Ido Schimmel Date: Wed Jul 25 09:23:57 2018 +0300 mlxsw: spectrum_acl: Add support for C-TCAM eRPs The number of eRPs that can be used by a single A-TCAM region is limited to 16. When more eRPs are needed, an ordinary circuit TCAM (C-TCAM) can be used to hold the extra eRPs. Unlike the A-TCAM, only a single (last) lookup is performed in the C-TCAM and not a lookup per-eRP. However, modeling the C-TCAM as extra eRPs will allow us to easily introduce support for pruning in a follow-up patch set and is also logically correct. The following diagram depicts the relation between both TCAMs: C-TCAM +-------------------+ +--------------------+ +-----------+ | | | | | | | eRP #1 (A-TCAM) +----> ... +----+ eRP #16 (A-TCAM) +----+ eRP #17 | | | | | | ... | +-------------------+ +--------------------+ | eRP #N | | | +-----------+ Lookup order is from left to right. Extend the eRP core APIs with a C-TCAM parameter which indicates whether the requested eRP is to be used with the C-TCAM or not. Since the C-TCAM is only meant to absorb rules that can't fit in the A-TCAM due to exceeded number of eRPs or key collision, an error is returned when a C-TCAM eRP needs to be created when the eRP state machine is in its initial state (i.e., 'no masks'). This should only happen in the face of very unlikely errors when trying to push rules into the A-TCAM. In order not to perform unnecessary lookups, the eRP core will only enable a C-TCAM lookup for a given region if it knows there are C-TCAM eRPs present. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit c19df1d88d83f42d916cfd39230730b3b8c719a9 Author: Ido Schimmel Date: Wed Jul 25 09:23:56 2018 +0300 mlxsw: spectrum_acl: Enable C-TCAM only mode in eRP core Currently, no calls are performed into the eRP core, but in order to make review easier we would like to gradually add these calls. Have the eRP core initialize a region's master mask to all ones and allow it to use an empty eRP table. This directs the lookup to the C-TCAM and allows the C-TCAM only mode to continue working. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit f465261aa1052bbcb5d1fdba3e9168f2ad86858f Author: Ido Schimmel Date: Wed Jul 25 09:23:55 2018 +0300 mlxsw: spectrum_acl: Implement common eRP core When rules are inserted into the A-TCAM they are associated with a mask, which is part of the lookup key: { masked key, mask ID, region ID }. These masks are called rule patterns (RP) and the aggregation of several masks into one (to be introduced in follow-up patch sets) is called an extended RP (eRP). When a packet undergoes a lookup in an ACL region it is masked by the current set of eRPs used by the region, looking for an exact match. Eventually, the rule with the highest priority is picked. These eRPs are stored in several global banks to allow for lookup to occur using several eRPs simultaneously. At first, an ACL region will only require a single mask - upon the insertion of the first rule. In this case, the region can use the "master RP" which is composed by OR-ing all the masks used by the region. This mask is a property of the region and thus there is no need to use the above mentioned banks. At some point, a second mask will be needed. In this case, the region will need to allocate an eRP table from the above mentioned banks and insert its masks there. >From now on, upon lookup, the eRP table used by the region will be fetched from the eRP banks - using {eRP bank, Index within the bank} - and the eRPs present in the table will be used to mask the packet. Note that masks with consecutive indexes are inserted into consecutive banks. When rules are deleted and a region only needs a single mask once again it can free its eRP table and use the master RP. The above logic is implemented in the eRP core and represented using the following state machine: +------------+ create mask - as master RP +---------------+ | +--------------------------------> | | no masks | | single mask | | <--------------------------------+ | +------------+ delete mask +-----+--^------+ | | | | create mask - | | delete mask - create mask transition to use eRP | | transition to +--------+ table | | use master RP | | | | | | | | +----v--------+----+ create mask +----v--+-----+ | <-------------------------------+ | | multiple masks | | two masks | | +-------------------------------> | +------------------+ delete mask - if two +-------------+ remaining The code that actually configures rules in the A-TCAM will interface with the eRP core by getting or putting an eRP based on the required mask used by the rule. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 489142eca9b530219dab77e86c0545e93ebf606a Author: Ido Schimmel Date: Wed Jul 25 09:23:54 2018 +0300 mlxsw: resources: Add Spectrum-2 eRP resources Add the following resources to be used by A-TCAM code: * Maximum number of eRP banks * Maximum size of eRP bank * Number of eRP entries required for a 2/4/8/12 key blocks mask Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 541e249cdcc4d305c39a3cbc6bb6fe0eaaa6cf07 Author: Ido Schimmel Date: Wed Jul 25 09:23:53 2018 +0300 mlxsw: resources: Add Spectrum-2 maximum large key ID resource Add a resource to make sure we do not exceed the maximum number of supported large key IDs in a region. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 8c0d1cdd052a4469cf7a53553299bd38596947dc Author: Ido Schimmel Date: Wed Jul 25 09:23:52 2018 +0300 mlxsw: reg: Add Policy-Engine eRP Table Register The register is used to add and delete eRPs from the eRP table. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit aecefac903ce3c7cb09e88a1f628778b47eb069e Author: Ido Schimmel Date: Wed Jul 25 09:23:51 2018 +0300 mlxsw: reg: Add Policy-Engine TCAM Entry Register Version 3 The register is used to configure rules in the A-TCAM. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 91329e27f36d7008402fb4d5e853e731a200f19b Author: Ido Schimmel Date: Wed Jul 25 09:23:50 2018 +0300 mlxsw: reg: Prepare PERERP register for A-TCAM usage Before introducing A-TCAM support we need to make sure all the necessary fields are configurable and not hard coded to values that worked for the C-TCAM only use case. This includes - for example - the ability to configure the eRP table used by the TCAM region. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit d47317ca4ade1a9a1c69c596defb273f29e263b3 Author: Saravanan Sekar Date: Thu Jul 19 11:06:47 2018 +0200 clk: actions: Add S700 SoC clock support Add Actions Semi S700 SoC clock support Signed-off-by: Parthiban Nallathambi Signed-off-by: Saravanan Sekar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Stephen Boyd commit d0e45d686a3ef18a20d4eac6675b76d3656c4727 Author: Saravanan Sekar Date: Thu Jul 19 11:06:46 2018 +0200 dt-bindings: clock: Add S700 support for Actions Semi Soc's Add clock bindings constants for action S700 Maintain common clock dt-bindings for Actions Semi SoC's S700 and S900. Signed-off-by: Parthiban Nallathambi Signed-off-by: Saravanan Sekar Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit d017c1f16a798397ebc79be57f7a5e5ea788f837 Author: Saravanan Sekar Date: Thu Jul 19 11:06:45 2018 +0200 clk: actions: Add missing REGMAP_MMIO dependency Add REGMAP_MMIO as dependency to avoid undefined reference to regmap symbols. Fixes: d85d20053e19 ("clk: actions: Add S900 SoC clock support") Signed-off-by: Saravanan Sekar Reviewed-by: Andreas Färber Reviewed-by: Manivannan Sadhasivam Signed-off-by: Stephen Boyd commit 41147bb18a38a9c9e805dac3d82cef7f1cb24eef Author: Wei Yongjun Date: Wed Jul 25 06:11:16 2018 +0000 lan743x: Make symbol lan743x_pm_ops static Fixes the following sparse warning: drivers/net/ethernet/microchip/lan743x_main.c:2944:25: warning: symbol 'lan743x_pm_ops' was not declared. Should it be static? Signed-off-by: Wei Yongjun Acked-by: Bryan Whitehead Signed-off-by: David S. Miller commit 55477206f15cf725178be23344179bd83f773c7b Author: Wei Yongjun Date: Wed Jul 25 06:06:07 2018 +0000 tcp: make function tcp_retransmit_stamp() static Fixes the following sparse warnings: net/ipv4/tcp_timer.c:25:5: warning: symbol 'tcp_retransmit_stamp' was not declared. Should it be static? Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 158abbf170ecfc6d56abeddd0c66da753b3435df Author: Jianbo Liu Date: Wed Jul 25 02:31:25 2018 +0000 net/sched: cls_flower: Use correct inline function for assignment of vlan tpid This fixes the following sparse warning: net/sched/cls_flower.c:1356:36: warning: incorrect type in argument 3 (different base types) net/sched/cls_flower.c:1356:36: expected unsigned short [unsigned] [usertype] value net/sched/cls_flower.c:1356:36: got restricted __be16 [usertype] vlan_tpid Signed-off-by: Jianbo Liu Reported-by: Or Gerlitz Reviewed-by: Or Gerlitz Signed-off-by: David S. Miller commit 7cc77bf4c29c88af8d3d02d6dc88a71f85ecb1b6 Author: Tariq Toukan Date: Tue Jul 24 14:31:45 2018 +0300 net/mlx4_core: Allow MTTs starting at any index Allow obtaining MTTs starting at any index, thus give a better cache utilization. For this, allow setting log_mtts_per_seg to 0, and use this in default. Signed-off-by: Tariq Toukan Signed-off-by: Eli Cohen Signed-off-by: Anaty Rahamim Bar Kat Reviewed-by: Jack Morgenstein Signed-off-by: David S. Miller commit e8886643a6c975f10f53a810e7350d48c2d25057 Merge: bc510d59cf17 bcef735c59f2 Author: David S. Miller Date: Wed Jul 25 16:28:58 2018 -0700 Merge branch 'mlx5-Offload-setting-matching-on-tunnel-tos-ttl' Or Gerlitz says: ==================== net/mlx5: Offload setting/matching on tunnel tos/ttl This series enables mlx5 offloading of tc eswitch rules that set tos/ttl (encap) or match on them (decap) for tunnels. ==================== Signed-off-by: David S. Miller commit bcef735c59f2e46897bd9fd144bdbc0a237dec78 Author: Or Gerlitz Date: Tue Jul 24 13:59:35 2018 +0300 net/mlx5e: Offload TC matching on tos/ttl for ip tunnels Enable offloading of TC matching on tos/ttl for ipv4/6 tunnels. Signed-off-by: Or Gerlitz Reviewed-by: Roi Dayan Signed-off-by: David S. Miller commit f35f800d3591e163bbc9df062081b403f7071b56 Author: Or Gerlitz Date: Tue Jul 24 13:59:34 2018 +0300 net/mlx5e: Support setup of tos and ttl for tunnel key TC action offload Use the values provided by user-space for the encapsulation headers. Signed-off-by: Or Gerlitz Reviewed-by: Roi Dayan Signed-off-by: David S. Miller commit 6360cd625e88a557f823001a796ca9e6065b3f0e Author: Or Gerlitz Date: Tue Jul 24 13:59:33 2018 +0300 net/mlx5e: Use ttl from route lookup on tc encap offload only if needed Currnetly, the ttl for the encapsulation headers is taken from the route lookup result. As a pre-step to allow for an offload case when the user specifies the ttl, take it from the route lookup only if not zero. While here, also move to use u8 instead int for the ttl. Signed-off-by: Or Gerlitz Reviewed-by: Roi Dayan Signed-off-by: David S. Miller commit ff388ee3651642d7fdc837b4434a1c7d80b243e4 Author: Kunihiko Hayashi Date: Thu Jul 19 14:23:48 2018 +0900 clk: uniphier: add clock frequency support for SPI Add clock control for SPI controller on UniPhier SoCs. Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada Signed-off-by: Stephen Boyd commit 9d222574ef72216bd8332708750bbe743db9bea3 Author: Masahiro Yamada Date: Fri Jul 20 17:37:36 2018 +0900 clk: uniphier: add more USB3 PHY clocks Add USB3 PHY clocks where missing. Use fixed-factor clocks for those without gating. For clarification, prefix clock names with 'ss' or 'hs'. Signed-off-by: Masahiro Yamada Signed-off-by: Stephen Boyd commit 0316c018c5a84d4e0b43123057adada3cddb3e00 Author: Masahiro Yamada Date: Fri Jul 20 17:37:35 2018 +0900 clk: uniphier: add NAND 200MHz clock The Denali NAND controller IP needs three clocks: - clk: controller core clock - clk_x: bus interface clock - ecc_clk: clock at which ECC circuitry is run Currently, only the first one (50MHz) is provided. The rest of the two clock ports must be connected to the 200MHz clock line. Add this. Signed-off-by: Masahiro Yamada Signed-off-by: Stephen Boyd commit cec5dfa4e49c62e3e662a98abdba631422a76b82 Merge: ce397d215ccd 0195156340d3 Author: Stephen Boyd Date: Wed Jul 25 15:37:33 2018 -0700 Merge tag 'sunxi-clk-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner Pull Allwinner clock changes for 4.19 from Maxime Ripard: Our usual bunch of clock patches, this time to enable the A64 display engine clocks controller mostly. * tag 'sunxi-clk-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: add A64 compatible string dt-bindings: add compatible string for the A64 DE2 CCU clk: sunxi-ng: r40: Export video PLLs clk: sunxi-ng: r40: Allow setting parent rate to display related clocks clk: sunxi-ng: r40: Add minimal rate for video PLLs commit c76a69e477b88f259bcc118129874011abcaae86 Author: Peter De-Schrijver Date: Thu Jul 12 14:53:02 2018 +0300 clk: tegra: make sdmmc2 and sdmmc4 as sdmmc clocks These clocks have low jitter paths to certain parents. To model these correctly, use the sdmmc mux divider clock type. Signed-off-by: Peter De-Schrijver Signed-off-by: Aapo Vienamo Acked-by: Peter De Schrijver Signed-off-by: Stephen Boyd commit 1e687220ef2d95a582e13d8de79932bfe32fdfa8 Author: Keith Busch Date: Tue Jul 24 15:07:58 2018 -0600 libnvdimm: Export max available extent The 'available_size' attribute showing the combined total of all unallocated space isn't always useful to know how large of a namespace a user may be able to allocate if the region is fragmented. This patch will export the largest extent of unallocated space that may be allocated to create a new namespace. Signed-off-by: Keith Busch Reviewed-by: Vishal Verma Signed-off-by: Dave Jiang commit 12e3129e29b406c41bc89231092a20d79dbf802c Author: Keith Busch Date: Tue Jul 24 15:07:57 2018 -0600 libnvdimm: Use max contiguous area for namespace size This patch will find the max contiguous area to determine the largest pmem namespace size that can be created. If the requested size exceeds the largest available, ENOSPC error will be returned. This fixes the allocation underrun error and wrong error return code that have otherwise been observed as the following kernel warning: WARNING: CPU: PID: at drivers/nvdimm/namespace_devs.c:913 size_store Fixes: a1f3e4d6a0c3 ("libnvdimm, region: update nd_region_available_dpa() for multi-pmem support") Cc: Signed-off-by: Keith Busch Reviewed-by: Vishal Verma Signed-off-by: Dave Jiang commit 776125785a87ff05d49938bd5b9f336f2a05bff6 Author: Andreas Gruenbacher Date: Wed Jul 25 18:45:08 2018 +0100 gfs2: Special-case rindex for gfs2_grow To speed up the common case of appending to a file, gfs2_write_alloc_required presumes that writing beyond the end of a file will always require additional blocks to be allocated. This assumption is incorrect for preallocates files, but there are no negative consequences as long as *some* space is still left on the filesystem. One special file that always has some space preallocated beyond the end of the file is the rindex: when growing a filesystem, gfs2_grow adds one or more new resource groups and appends records describing those resource groups to the rindex; the preallocated space ensures that this is always possible. However, when a filesystem is completely full, gfs2_write_alloc_required will indicate that an additional allocation is required, and appending the next record to the rindex will fail even though space for that record has already been preallocated. To fix that, skip the incorrect optimization in gfs2_write_alloc_required, but for the rindex only. Other writes to preallocated space beyond the end of the file are still allowed to fail on completely full filesystems. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit bc510d59cf173d9b239173580fc9f44523256135 Author: Bjorn Helgaas Date: Mon Jul 23 15:59:46 2018 -0500 vxge: Remove unnecessary include of The vxge driver doesn't need anything provided by pci_hotplug.h, so remove the unnecessary include of it. Signed-off-by: Bjorn Helgaas Acked-by: Jon Mason Signed-off-by: David S. Miller commit 8c17dee1706d3bc5861513145b762d1a63abda9f Merge: 238262af08a2 b3793159249b Author: Linus Walleij Date: Wed Jul 25 22:47:03 2018 +0200 Merge tag 'samsung-pinctrl-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel Samsung pinctrl drivers changes for v4.19 1. Add handling of external wakeup interrupts mask inside the pin controller driver. Existing solution is spread between the driver and machine code. The machine code writes the mask but its value is taken from pin controller driver. This moves everything into pin controller driver allowing later to remove the cross-subsystem interaction. Also this is a necessary step for implementing later Suspend to RAM on ARMv8 Exynos5433. 2. Bring necessary suspend/resume callbacks for Exynos542x and Exynos5260. 3. Document hidden requirement about one external wakeup interrupts device node. 4. Minor documentation cleanups. commit 633e79650b4f0ed8cd26076a376b5372c413b0f8 Author: Peter De-Schrijver Date: Thu Jul 12 14:53:01 2018 +0300 clk: tegra: Add sdmmc mux divider clock Add a clock type to model the sdmmc switch divider clocks which have paths to source clocks bypassing the divider (Low Jitter paths). These are handled by selecting the lj path when the divider is 1 (ie the rate is the parent rate), otherwise the normal path with divider will be selected. Otherwise this clock behaves as a normal peripheral clock. Signed-off-by: Peter De-Schrijver Signed-off-by: Aapo Vienamo Acked-by: Peter De Schrijver Acked-by: Jon Hunter Signed-off-by: Stephen Boyd commit cb3ac5947afb3bb7e2f89c1b59f61dcf3e115fe1 Author: Peter De Schrijver Date: Thu Jul 12 14:53:00 2018 +0300 clk: tegra: Refactor fractional divider calculation Move this to a separate file so it can be used to calculate the sdmmc clock dividers. Signed-off-by: Peter De-Schrijver Signed-off-by: Aapo Vienamo Acked-by: Peter De Schrijver Acked-by: Jon Hunter Signed-off-by: Stephen Boyd commit 0cbb61a313979b53d6b2dc838a92f07471440708 Author: Aapo Vienamo Date: Thu Jul 12 14:52:59 2018 +0300 clk: tegra: Fix includes required by fence_udelay() Add the missing linux/delay.h include statement for udelay() used by fence_udelay() macro. Signed-off-by: Aapo Vienamo Acked-by: Peter De Schrijver Acked-by: Jon Hunter Signed-off-by: Stephen Boyd commit 3c507b8af638c67d4a80d70091d2057ecb01e8a6 Author: Heiner Kallweit Date: Mon Jul 23 21:40:07 2018 +0200 net: phy: add helper phy_polling_mode Add a helper for checking whether polling is used to detect PHY status changes. Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit d805f6a8682937d7f8136fe7561659b13f5aaa49 Author: Krzysztof Kozlowski Date: Mon Jul 23 18:20:20 2018 +0200 net: ethernet: fs-enet: Use generic CRC32 implementation Use generic kernel CRC32 implementation because it: 1. Should be faster (uses lookup tables), 2. Removes duplicated CRC generation code, 3. Uses well-proven algorithm instead of coding it one more time. Suggested-by: Eric Biggers Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 16f6e9835bcd33adac49bc2cad2ec7bbf5dfa356 Author: Krzysztof Kozlowski Date: Mon Jul 23 18:19:14 2018 +0200 net: ethernet: freescale: Use generic CRC32 implementation Use generic kernel CRC32 implementation because it: 1. Should be faster (uses lookup tables), 2. Removes duplicated CRC generation code, 3. Uses well-proven algorithm instead of coding it one more time. Suggested-by: Eric Biggers Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 076dd53be52b729acc1e24e50669dbd761d8ee06 Author: Varsha Rao Date: Wed Jul 25 20:43:56 2018 +0200 IB/core: Remove extra parentheses Remove unnecessary parentheses to fix the clang warning of extraneous parentheses. Signed-off-by: Varsha Rao Signed-off-by: Jason Gunthorpe commit 9491a1edbae39d1fb1c88289d327e33916b98a1e Author: Bart Van Assche Date: Wed Jul 18 09:01:35 2018 -0700 RDMA/ocrdma: Suppress a compiler warning This patch avoids that the following compiler warning is reported when building with gcc 8 and W=1: In function 'ocrdma_mbx_get_ctrl_attribs', inlined from 'ocrdma_init_hw' at drivers/infiniband/hw/ocrdma/ocrdma_hw.c:3224:11: drivers/infiniband/hw/ocrdma/ocrdma_hw.c:1368:3: warning: 'strncpy' output may be truncated copying 31 bytes from a string of length 31 [-Wstringop-truncation] strncpy(dev->model_number, ^~~~~~~~~~~~~~~~~~~~~~~~~~ hba_attribs->controller_model_number, 31); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Bart Van Assche Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 7f5eac5934d747535f9ffc997792a0a6eb289374 Author: Nicholas Mc Guire Date: Fri Jul 13 18:40:04 2018 +0200 clk: imx6sll: fix missing of_node_put() of_find_compatible_node() is returning a device node with refcount incremented and must be explicitly decremented after the last use which is right after the us in of_iomap() here. Signed-off-by: Nicholas Mc Guire Fixes: 4a5f720b6542 ("clk: imx: add clock driver for imx6sll") Signed-off-by: Stephen Boyd commit 11177e7a7aaef95935592072985526ebf0a3df43 Author: Nicholas Mc Guire Date: Fri Jul 13 13:13:20 2018 +0200 clk: imx6ul: fix missing of_node_put() of_find_compatible_node() is returning a device node with refcount incremented and must be explicitly decremented after the last use which is right after the us in of_iomap() here. Signed-off-by: Nicholas Mc Guire Fixes: 787b4271a6a0 ("clk: imx: add imx6ul clk tree support") Signed-off-by: Stephen Boyd commit 25a00ac7dc92912f0b1e5e533bf077255c828b02 Merge: a38b0ba1b7d2 9ef0112442bd Author: Ingo Molnar Date: Wed Jul 25 22:31:00 2018 +0200 Merge tag 'perf-core-for-mingo-4.19-20180725' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf/cores fixes and improvements from Arnaldo Carvalho de Melo: Tools: top: - Fix 'struct comm_str' removal crash race, detected with refcount_t debugging (Jiri Olsa) - Use last_match threads cache only in single threaded mode, fixing a crash (Jiri Olsa) record: - Synthesize GROUP_DESC feature in pipe mode fixing display of event groups (Jiri Olsa) stat: - Get rid of extra clock display function (Jiri Olsa) perf script: - Show correct offsets for DWARF-based unwinding (Sandipan Das) test: - Check that complex event name is parsed correctly (Alexey Budankov) - Fix subtest number when showing results (Thomas Richter) Arch specific: arm64: - Generate syscall table from the kernel sources (asm/unistd.h) like other arches do, speeding up the support for new system calls in tools such as 'perf trace' (Kim Phillips) arm: - Bail out immediatelly on CoreSight hardware tracing instruction sample failure (Leo Yan) PowerPC: - Fix record+probe_libc_inet_pton.sh 'perf test' entry (Sandipan Das) - Callchain IP filtering fixes (Sandipan Das) S/390: - Add support for detailed S/390 PMU event description in 'perf list' (Thomas Richter) - Add transaction flag (-T) support in 'perf stat' for S/390 (Thomas Richter) - Fix 'perf kvm' S/390 subcommands (Thomas Richter) Infrastructure: hists: - Clarify callchain disabling when available (Arnaldo Carvalho de Melo) evsel: - Use perf_evsel__match instead of open coded equivalent (Jiri Olsa) Documentation: - Add missing documentation for 'perf list' --desc and --debug options (Sangwon Hong) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit 22fa27fbc64d01cbbe1e4da751e64cc22d24a6e4 Author: Jason Gunthorpe Date: Tue Jul 10 13:43:06 2018 -0600 IB/uverbs: Fix locking around struct ib_uverbs_file ucontext We have a parallel unlocked reader and writer with ib_uverbs_get_context() vs everything else, and nothing guarantees this works properly. Audit and fix all of the places that access ucontext to use one of the following locking schemes: - Call ib_uverbs_get_ucontext() under SRCU and check for failure - Access the ucontext through an struct ib_uobject context member while holding a READ or WRITE lock on the uobject. This value cannot be NULL and has no race. - Hold the ucontext_lock and check for ufile->ucontext !NULL This also re-implements ib_uverbs_get_ucontext() in a way that is safe against concurrent ib_uverbs_get_context() and disassociation. As a side effect, every access to ucontext in the commands is via ib_uverbs_get_context() with an error check, or via the uobject, so there is no longer any need for the core code to check ucontext on every command call. These checks are also removed. Signed-off-by: Jason Gunthorpe commit c36ee46dafaea1bb525c4e34d3e35dd9a6768a47 Author: Jason Gunthorpe Date: Tue Jul 10 20:55:22 2018 -0600 IB/mlx5: Use the ucontext from the uobj, not the file This approach matches the standard flow of the typical write method that relies on the HW object to store the device and the uobject to access the ucontext. Avoids the use of the devx_ufile2uctx in several places will make revising the semantics of ib_uverbs_get_ucontext() in the next patch simpler. Signed-off-by: Jason Gunthorpe commit aba94548c9e49939fafc92bb406a7f8e7ed87643 Author: Jason Gunthorpe Date: Tue Jul 10 20:55:21 2018 -0600 IB/uverbs: Move the FD uobj type struct file allocation to alloc_commit Allocating the struct file during alloc_begin creates this strange asymmetry with IDR, where the FD has two krefs pointing at it during the pre-commit phase. In particular this makes the abort process for FD very strange and confusing. For instance abort currently calls the type's destroy_object twice, and the fops release once if abort is done. This is very counter intuitive. No fops should be called until alloc_commit succeeds, and destroy_object should only ever be called once. Moving the struct file allocation to the alloc_commit is now simple, as we already support failure of rdma_alloc_commit_uobject, with all the required rollback pieces. This creates an understandable symmetry with IDR and simplifies/fixes the abort handling for FD types. Signed-off-by: Jason Gunthorpe commit 2c96eb7d62de5048aa08e9ee4fbb607f29e2638c Author: Jason Gunthorpe Date: Tue Jul 10 20:55:20 2018 -0600 IB/uverbs: Always propagate errors from rdma_alloc_commit_uobject() The ioctl framework already does this correctly, but the write path did not. This is trivially fixed by simply using a standard pattern to return uobj_alloc_commit() as the last statement in every function. Signed-off-by: Jason Gunthorpe commit e951747a087a8655f467833bb367ebf53d57527c Author: Jason Gunthorpe Date: Tue Jul 10 20:55:19 2018 -0600 IB/uverbs: Rework the locking for cleaning up the ucontext The locking here has always been a bit crazy and spread out, upon some careful analysis we can simplify things. Create a single function uverbs_destroy_ufile_hw() that internally handles all locking. This pulls together pieces of this process that were sprinkled all over the places into one place, and covers them with one lock. This eliminates several duplicate/confusing locks and makes the control flow in ib_uverbs_close() and ib_uverbs_free_hw_resources() extremely simple. Unfortunately we have to keep an extra mutex, ucontext_lock. This lock is logically part of the rwsem and provides the 'down write, fail if write locked, wait if read locked' semantic we require. Signed-off-by: Jason Gunthorpe commit 87064277c4d3b0ddb251a91324f2525048027ee2 Author: Jason Gunthorpe Date: Tue Jul 10 20:55:18 2018 -0600 IB/uverbs: Revise and clarify the rwsem and uobjects_lock Rename 'cleanup_rwsem' to 'hw_destroy_rwsem' which is held across any call to the type destroy function (aka 'hw' destroy). The main purpose of this lock is to prevent normal add and destroy from running concurrently with uverbs_cleanup_ufile() Since the uobjects list is always manipulated under the 'hw_destroy_rwsem' we can eliminate the uobjects_lock in the cleanup function. This allows converting that lock to a very simple spinlock with a narrow critical section. Signed-off-by: Jason Gunthorpe commit e6d5d5ddd0869cf44a554289cd213007ccc0afde Author: Jason Gunthorpe Date: Tue Jul 10 20:55:17 2018 -0600 IB/uverbs: Clarify and revise uverbs_close_fd The locking requirements here have changed slightly now that we can rely on the ib_uverbs_file always existing and containing all the necessary locking infrastructure. That means we can get rid of the cleanup_mutex usage (this was protecting the check on !uboj->context). Otherwise, follow the same pattern that IDR uses for destroy, acquire exclusive write access, then call destroy and the undo the 'lookup'. Signed-off-by: Jason Gunthorpe commit 5671f79b42da197466bf0908bce6f7ab4e35488f Author: Jason Gunthorpe Date: Tue Jul 10 20:55:16 2018 -0600 IB/uverbs: Revise the placement of get/puts on uobject This wasn't wrong, but the placement of two krefs didn't make any sense. Follow some simple rules. - A kref is held inside uobjects_list - A kref is held inside the IDR - A kref is held inside file->private - A stack based kref is passed bettwen alloc_begin and alloc_abort/alloc_commit Any place we destroy one of the above pointers, we stick a put, or 'move' the kref into another pointer. The key functions have sensible semantics: - alloc_uobj fully initializes the common members in uobj, including the list - Get rid of the uverbs_idr_remove_uobj helper since IDR remove does require put, but it depends on the situation. Later patches will re-consolidate this differently. - alloc_abort always consumes the passed kref, done in the type - alloc_commit always consumes the passed kref, done in the type - rdma_remove_commit_uobject always pairs with a lookup_get After it is all done the only control flow change is to: - move a get from alloc_commit_fd_uobject to rdma_alloc_commit_uobject - add a put to remove_commit_idr_uobject - Consistenly use rdma_lookup_put in rdma_remove_commit_uobject at the right place Signed-off-by: Jason Gunthorpe commit c561c288463102b12c9089a42c6c2a9f55c4fb53 Author: Jason Gunthorpe Date: Tue Jul 10 20:55:15 2018 -0600 IB/uverbs: Clarify the kref'ing ordering for alloc_commit The alloc_commit callback makes the uobj visible to other threads, and it does so using a 'move' semantic of the uobj kref on the stack into the public storage (eg the IDR, uobject list and file_private_data) Once this is done another thread could start up and trigger deletion of the kref. Fortunately cleanup_rwsem happens to prevent this from being a bug, but that is a fantastically unclear side effect. Re-organize things so that alloc_commit is that last thing to touch the uobj, get rid of the sneaky implicit dependency on cleanup_rwsem, and add a comment reminding that uobj is no longer kref'd after alloc_commit. Signed-off-by: Jason Gunthorpe commit 1250c3048cf1632f5dbb99a0242410baff67955d Author: Jason Gunthorpe Date: Tue Jul 10 20:55:14 2018 -0600 IB/uverbs: Handle IDR and FD types without truncation Our ABI for write() uses a s32 for FDs and a u32 for IDRs, but internally we ended up implicitly casting these ABI values into an 'int'. For ioctl() we use a s64 for FDs and a u64 for IDRs, again casting to an int. The various casts to int are all missing range checks which can cause userspace values that should be considered invalid to be accepted. Fix this by making the generic lookup routine accept a s64, which does not truncate the write API's u32/s32 or the ioctl API's s64. Then push the detailed range checking down to the actual type implementations to be shared by both interfaces. Finally, change the copy of the uobj->id to sign extend into a s64, so eg, if we ever wish to return a negative value for a FD it is carried properly. This ensures that userspace values are never weirdly interpreted due to the various trunctations and everything that is really out of range gets an EINVAL. Signed-off-by: Jason Gunthorpe commit 3df593bfe6455f28cda879be8299b30b8601ce3b Author: Jason Gunthorpe Date: Tue Jul 10 20:55:13 2018 -0600 IB/uverbs: Get rid of null_obj_type If the method fails after calling rdma_explicit_destroy (eg if copy_to_user faults) then it will trigger a kernel oops: BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 800000000548d067 P4D 800000000548d067 PUD 54a0067 PMD 0 SMP PTI CPU: 0 PID: 359 Comm: ibv_rc_pingpong Not tainted 4.18.0-rc1+ #28 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014 RIP: 0010: (null) Code: Bad RIP value. RSP: 0018:ffffc900001a3bf0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff88000603bd00 RCX: 0000000000000003 RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff88000603bd00 RBP: 0000000000000001 R08: ffffc900001a3cf8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffc900001a3cf0 R13: 0000000000000000 R14: ffffc900001a3cf0 R15: 0000000000000000 FS: 00007fb00dda8700(0000) GS:ffff880007c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 000000000548e004 CR4: 00000000003606b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? rdma_lookup_put_uobject+0x22/0x50 [ib_uverbs] ? uverbs_finalize_object+0x3b/0x60 [ib_uverbs] ? uverbs_finalize_attrs+0x128/0x140 [ib_uverbs] ? ib_uverbs_cmd_verbs+0x698/0x7c0 [ib_uverbs] ? find_held_lock+0x2d/0x90 ? __might_fault+0x39/0x90 ? ib_uverbs_ioctl+0x111/0x1f0 [ib_uverbs] ? do_vfs_ioctl+0xa0/0x6d0 ? trace_hardirqs_on_caller+0xed/0x180 ? _raw_spin_unlock_irq+0x24/0x40 ? syscall_trace_enter+0x138/0x1d0 ? ksys_ioctl+0x35/0x60 ? __x64_sys_ioctl+0x11/0x20 ? do_syscall_64+0x5b/0x1c0 ? entry_SYSCALL_64_after_hwframe+0x49/0xbe This is because the type was replaced with the null_type during explicit destroy that cannot complete the destruction. One of the side effects of replacing the type is to make the object handle totally unreachable - so no other command could attempt to use it, even though it remains on the uboject list. We can get the same end result by just fully destroying the object inside rdma_explicit_destroy and leaving the caller the residual kref for the uobj with no attached HW object, and no presence in the ubojects list. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky commit 791d3ef2e11100449837dc0b6fe884e60ca3a484 Author: Rob Herring Date: Mon Jul 23 15:59:44 2018 -0600 dt-bindings: remove 'interrupt-parent' from bindings 'interrupt-parent' is often documented as part of define bindings, but it is really outside the scope of a device binding. It's never required in a given node as it is often inherited from a parent node. Or it can be implicit if a parent node is an 'interrupt-controller' node. So remove it from all the binding files. Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit 13d6753f1d250885749386867c4a4e8c06c905da Author: Marcel Ziswiler Date: Fri Jul 20 10:22:57 2018 +0200 pinctrl: tegra: fix spelling in devicetree binding document This fixes a spelling mistake. Signed-off-by: Marcel Ziswiler Acked-by: Jon Hunter Signed-off-by: Rob Herring commit 586092ab4b768b01b3184d9a2541e2cf9a8d9740 Author: Jia-Ju Bai Date: Mon Jul 23 22:29:56 2018 +0800 gpu: drm: amdgpu: Replace mdelay with msleep in cik_pcie_gen3_enable() cik_pcie_gen3_enable() is only called by cik_common_hw_init(), which is never called in atomic context. cik_pcie_gen3_enable() calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Alex Deucher commit 6cdf4e87b454d1f26ef557307345dadce71d1f94 Author: Alex Deucher Date: Tue Jul 24 11:52:58 2018 -0500 drm/amdgpu/gmc9: clarify GPUVM fault error message The address printed is the actual address, not the page. Reviewed-by: Junwei Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 068c330419ffb3422a43cb7d34351f1ef033950f Author: Nayan Deshmukh Date: Fri Jul 20 17:51:06 2018 +0530 drm/scheduler: remove sched field from the entity The scheduler of the entity is decided by the run queue on which it is queued. This patch avoids us the effort required to maintain a sync between rq and sched field when we start shifting entites among different rqs. Signed-off-by: Nayan Deshmukh Reviewed-by: Christian König Reviewed-by: Eric Anholt Signed-off-by: Alex Deucher commit cdc50176597cb44ce25eb7331c450058775b8d2a Author: Nayan Deshmukh Date: Fri Jul 20 17:51:05 2018 +0530 drm/scheduler: modify API to avoid redundancy entity has a scheduler field and we don't need the sched argument in any of the functions where entity is provided. Signed-off-by: Nayan Deshmukh Reviewed-by: Christian König Reviewed-by: Eric Anholt Signed-off-by: Alex Deucher commit bf314ca3f10d4ba4335808dc678631908881db8b Author: Christian König Date: Wed Jul 18 11:16:35 2018 +0200 drm/amdgpu: reduce the number of placements for a BO Make struct amdgpu_bo a bit smaller. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c704ab18e0a26a5dc7e947af6e8e01585380518b Author: Christian König Date: Mon Jul 16 16:12:24 2018 +0200 drm/amdgpu: consistenly name amdgpu_bo_ functions Just rename functions, no functional change. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6beccb15c447356c40972da825e0c1ed803cfb10 Author: Christian König Date: Thu Jul 19 11:39:37 2018 +0200 MAINTAINERS: add entry for AMD PP code Add separate entry for the power managent code on AMD GPUs. Signed-off-by: Christian König Reviewed-by: Rex Zhu Reviewed-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit dbae59466f3737acbdecaa565faf3edb8c8c4f67 Author: Christian König Date: Wed Jul 18 13:16:06 2018 +0200 MAINTAINERS: Add separate section for DC Note that Harry and Leo Li are maintainers for that stuff. Signed-off-by: Christian König Reviewed-by: Michel Dänzer Reviewed-by: Harry Wentland Reviewed-by: Leo Li Signed-off-by: Alex Deucher commit 122b5a05987c8bcc0f88df2fdfa39397b6002737 Author: Christian König Date: Wed Jul 18 13:06:02 2018 +0200 MAINTAINERS: add new TTM maintainers Roger unfortunately doesn't work for AMD any longer. So add Rui and Jerry as co-maintainer as well. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 4d4831a3dae3161ab5a96694462eff708dfefc71 Author: Christian König Date: Wed Jul 18 14:17:59 2018 +0200 drm/amdgpu: expose only the first UVD instance for now Going to completely rework the context to ring mapping with Nayan's GSoC work, but for now just stopping to expose the second UVD instance should do it. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f8a91d45553ab581964f40b1e46bdf3d0974d339 Author: Christian König Date: Wed Jul 18 13:58:16 2018 +0200 drm/amdgpu: clean up coding style a bit No need to bitcast a boolean and even if we should use "!!" instead. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 34786005eca3b53cffa95d686bf3b7da1305867c Author: Camelia Groza Date: Mon Jul 23 18:06:15 2018 +0300 net: phy: prevent PHYs w/o Clause 22 regs from calling genphy_config_aneg genphy_config_aneg() should be called only by PHYs that implement the Clause 22 register set. Prevent Clause 45 PHYs that don't implement the register set from calling the genphy function. Signed-off-by: Camelia Groza Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 7e50b2a51d3c40558e4f3f56827e5909d7a723e6 Merge: 19725496da56 461f03dc99cf Author: David S. Miller Date: Wed Jul 25 12:53:38 2018 -0700 Merge branch 'virtio_net-Add-ethtool-stat-items' Toshiaki Makita says: ==================== virtio_net: Add ethtool stat items Add some ethtool stat items useful for performance analysis. ==================== Signed-off-by: Toshiaki Makita Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 461f03dc99cf6afcc3c70aaac56c4a7eee5a62bd Author: Toshiaki Makita Date: Mon Jul 23 23:36:09 2018 +0900 virtio_net: Add kick stats So we can infer the number of VM-Exits. Signed-off-by: Toshiaki Makita Signed-off-by: David S. Miller commit 5b8f3c8d30a6176c6be35c6ac75e22b0a60a3c43 Author: Toshiaki Makita Date: Mon Jul 23 23:36:08 2018 +0900 virtio_net: Add XDP related stats Add counters below: * Tx - xdp_tx: frames sent by ndo_xdp_xmit or XDP_TX. - xdp_tx_drops: dropped frames out of xdp_tx ones. * Rx - xdp_packets: frames went through xdp program. - xdp_tx: XDP_TX frames. - xdp_redirects: XDP_REDIRECT frames. - xdp_drops: any dropped frames out of xdp_packets ones. Signed-off-by: Toshiaki Makita Signed-off-by: David S. Miller commit 2a43565c06465323e33b117bcf2ce604c0594659 Author: Toshiaki Makita Date: Mon Jul 23 23:36:07 2018 +0900 virtio_net: Factor out the logic to determine xdp sq Make sure to use the same logic in all places to determine xdp sq. This is useful for xdp counters which the following commit will introduce as well. Signed-off-by: Toshiaki Makita Signed-off-by: David S. Miller commit 2c4a2f7d826329966e8ab86f842a95d3234c64da Author: Toshiaki Makita Date: Mon Jul 23 23:36:06 2018 +0900 virtio_net: Make drop counter per-queue Since when XDP was introduced, drop counter has been able to be updated much more frequently than before, as XDP_DROP increments the counter. Thus for performance analysis per-queue drop counter would be useful. Also this avoids cache contention and race on updating the counter. It is currently racy because napi handlers read-modify-write it without any locks. There are more counters in dev->stats that are racy, but I left them per-device, because they are rarely updated and does not worth being per-queue counters IMHO. To fix them we need atomic ops or some kind of locks. Signed-off-by: Toshiaki Makita Signed-off-by: David S. Miller commit a0929a44c2065da33c17b1b8015a88401d71ca7b Author: Toshiaki Makita Date: Mon Jul 23 23:36:05 2018 +0900 virtio_net: Use temporary storage for accounting rx stats The purpose is to keep receive_buf arguments simple when more per-queue counter items are added later. Also XDP_TX related sq counters will be updated in the following changes so create a container struct virtnet_rx_stats which will includes both rq and sq statistics. For now it only covers rq stats. Signed-off-by: Toshiaki Makita Signed-off-by: David S. Miller commit 7d9d60fd4ab69604015b094c07ad8490039bb2a4 Author: Toshiaki Makita Date: Mon Jul 23 23:36:04 2018 +0900 virtio_net: Fix incosistent received bytes counter When received packets are dropped in virtio_net driver, received packets counter is incremented but bytes counter is not. As a result, for instance if we drop all packets by XDP, only received is counted and bytes stays 0, which looks inconsistent. IMHO received packets/bytes should be counted if packets are produced by the hypervisor, like what common NICs on physical machines are doing. So fix the bytes counter. Signed-off-by: Toshiaki Makita Signed-off-by: David S. Miller commit 76336b41bdd141e05e39f3e80cdbd5918cdb9028 Author: Dmitry Torokhov Date: Wed Jul 18 18:37:47 2018 +0000 Input: pxrc - flatten probe code Instead of splitting probe code into separate USB and input setup, flatten it. This allows for easier inspection of order of set up steps, since the probe code is reasonably small. Move input-related initialization (phys) from USB block to input block. Reviewed-by: Marcus Folkesson Tested-by: Marcus Folkesson Signed-off-by: Dmitry Torokhov commit c8783d3930338323bd65f8043a8fd5ea22026824 Author: Dmitry Torokhov Date: Wed Jul 18 18:24:27 2018 +0000 Input: pxrc - do not store unneeded data in driver structure There is no need to store data buffer size, pointer to the buffer, or endpoint address in pxrc structure, as they are either only needed during setup, or are available from elsewhere. Reviewed-by: Marcus Folkesson Tested-by: Marcus Folkesson Signed-off-by: Dmitry Torokhov commit ce55f75f039479fc67ab978560067717fa26e1c8 Author: Dmitry Torokhov Date: Wed Jul 18 18:12:12 2018 +0000 Input: pxrc - move module device table closer to where it is used There is no need to have the device table first in the file. Reviewed-by: Marcus Folkesson Tested-by: Marcus Folkesson Signed-off-by: Dmitry Torokhov commit 34dad2cf1104869ce2db2bddb34f8e6780c2ddaa Author: Dmitry Torokhov Date: Wed Jul 18 18:03:36 2018 +0000 Input: pxrc - fix freeing URB on device teardown URB is the only resource that is not managed, and thus is destroyed too early, before we unregister input device and stop URB in pxrc_close(). To fix it let's install custom devm handler to free the URB at the right time in devm unwind sequence. Reviewed-by: Marcus Folkesson Tested-by: Marcus Folkesson Signed-off-by: Dmitry Torokhov commit 9730f60888d4b35be0f2d7316cb9e227d071cdda Author: Marcus Folkesson Date: Wed Jul 18 17:57:31 2018 +0000 Input: pxrc - do not store USB device in private struct The USB device is only needed during setup, so put it back after initialization and do not store it in our private struct. Also, the USB device is a parent of USB interface so our driver model rules ensure that USB device should not disappear while interface device is still there; there is no need to take reference to the USB device. Reported-by: Alexey Khoroshilov Signed-off-by: Marcus Folkesson Signed-off-by: Dmitry Torokhov commit d7b7c00dad79f7cc78dac87a3ff2f06358518384 Author: Anson Huang Date: Wed Jul 11 08:58:58 2018 +0800 clk: imx: add ocram_s clock for i.mx6sx i.MX6SX has a 16KB always-on ocram bank called ocram_s, and its clock gate in CCM CCGR1 CG14 needs to be enabled before access, add it to clock tree. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Stephen Boyd commit 616bf80d381da13fbb392ebff06f46f946e3ee84 Author: Gregory CLEMENT Date: Fri Jul 13 12:27:26 2018 +0200 clk: mvebu: armada-37xx-periph: Fix wrong return value in get_parent The return value of the get_parent operation is a u8, whereas a -EINVAL was returned. This wrong value was return if the value was bigger that the number of parent but this case was already handled by the core. So we can just remove this chunk of code to fix the issue. Reported-by: Dan Carpenter Fixes: 9818a7a4fd10 ("clk: mvebu: armada-37xx-periph: prepare cpu clk to be used with DVFS") Signed-off-by: Gregory CLEMENT Signed-off-by: Stephen Boyd commit f6dab4233d6b64d719109040503b567f71fbfa01 Author: Rajan Vaja Date: Tue Jul 17 06:17:00 2018 -0700 clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure Fixed factor clock has two initializations at of_clk_init() time and during platform driver probe. Before of_clk_init() call, node is marked as populated and so its probe never gets called. During of_clk_init() fixed factor clock registration may fail if any of its parent clock is not registered. In this case, it doesn't get chance to retry registration from probe. Clear OF_POPULATED flag if fixed factor clock registration fails so that clock registration is attempted again from probe. Signed-off-by: Rajan Vaja Signed-off-by: Stephen Boyd commit fe65324e3f5205072a2d55ac9c63ec77155fa528 Author: Rakesh Ughreja Date: Tue Jul 24 19:50:48 2018 -0500 ASoC: Intel: Skylake: fix widget handling include DAPM Mux and output widgets into the list. Signed-off-by: Rakesh Ughreja Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 365f7a89c881e84f1ebc925f65f899d5d7ce547e Author: Mikko Perttunen Date: Wed Jul 11 11:21:04 2018 +0300 clk: core: Potentially free connection id Patch "clk: core: Copy connection id" made it so that the connector id 'con_id' is kstrdup_const()ed to cater to drivers that pass non-constant connection ids. The patch added the corresponding kfree_const to __clk_free_clk(), but struct clk's can be freed also via __clk_put(). Add the kfree_const call to __clk_put() and add comments to both functions to remind that the logic in them should be kept in sync. Fixes: 253160a8ad06 ("clk: core: Copy connection id") Signed-off-by: Mikko Perttunen Reviewed-by: Leonard Crestez Signed-off-by: Stephen Boyd commit f9419783a6b45a7198ea22f2997cf1a85fda8458 Author: Taniya Das Date: Mon Jul 16 11:24:32 2018 +0530 clk: qcom: Update SPDX headers for common files SPDX headers updated for common/branch/pll/regmap files. Signed-off-by: Taniya Das Signed-off-by: Stephen Boyd commit 9a0daaab31e9e39047ced79409313c34dae4635a Author: Pierre-Louis Bossart Date: Tue Jul 24 16:12:48 2018 -0500 ASoC: Intel: Atom: fix inversion between __iowrite32 and __ioread32 This looks like a copy/paste issue, but clearly there is an inversion that is obvious when checking the arguments. Detected with Sparse - now that we have fewer warnings this one was easy to find. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit ce1cfe295abaa7436f9049bcb2562c843089abfc Author: Pierre-Louis Bossart Date: Tue Jul 24 16:12:47 2018 -0500 ASoC: Intel: Atom: simplify iomem address and casts Simplify code and add relevant casts to make Sparse warnings go away Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit ef3cb7423358ff0cadacb76f26e3e1f4da8be4ce Author: Pierre-Louis Bossart Date: Tue Jul 24 16:12:46 2018 -0500 ASoC: Intel: common: make sst_dma functions static sst_dma_new and sst_dma_free are not used in any other file and don't have a prototype. Move to static functions and remove EXPORT_SYMBOL_GPL statement. Reported by sparse warnings. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 86efd35ec1e34094914494dacb83077e5df2d1b8 Author: Pierre-Louis Bossart Date: Tue Jul 24 16:12:45 2018 -0500 ASoC: Intel: Skylake: BDL definitions should be __le32 Make sure definitions are consistent with usage. Detected with Sparse. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 92beb0a26975c6459794d885d27f48357c1aefd0 Author: Pierre-Louis Bossart Date: Tue Jul 24 16:12:44 2018 -0500 ASoC: Intel: Haswell: fix endianness handling Make all Sparse warnings go away by using le16/32_to_cpu. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit d77a760842751eb620a7e74f74e5a5ad6b3d6cef Author: Bard Liao Date: Fri Jul 20 09:48:20 2018 +0800 ASoC: rt5631: add Volume to the name of volume control add Volume to the name of volume control. Signed-off-by: Bard Liao Signed-off-by: Mark Brown commit d3df0ac09654e9db82a882031ccae010f1b7575b Author: Juergen Gross Date: Wed Jul 25 09:42:07 2018 +0200 xen/blkfront: remove unused macros Remove some macros not used anywhere. Acked-by: Roger Pau Monné Signed-off-by: Juergen Gross Signed-off-by: Jens Axboe commit eca53cb63f1dc36c49806c6927e5fef47e526868 Merge: 42c9cdfe1e11 1b0d274523df Author: Jens Axboe Date: Wed Jul 25 08:43:30 2018 -0600 Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-4.19/block Pull NVMe updates from Christoph: "Highlights: - massively improved tracepoints (Keith Busch) - support for larger inline data in the RDMA host and target (Steve Wise) - RDMA setup/teardown path fixes and refactor (Sagi Grimberg) - Command Supported and Effects log support for the NVMe target (Chaitanya Kulkarni) - buffered I/O support for the NVMe target (Chaitanya Kulkarni) plus the usual set of cleanups and small enhancements." * 'nvme-4.19' of git://git.infradead.org/nvme: nvmet: don't use uuid_le type nvmet: check fileio lba range access boundaries nvmet: fix file discard return status nvme-rdma: centralize admin/io queue teardown sequence nvme-rdma: centralize controller setup sequence nvme-rdma: unquiesce queues when deleting the controller nvme-rdma: mark expected switch fall-through nvme: add disk name to trace events nvme: add controller name to trace events nvme: use hw qid in trace events nvme: cache struct nvme_ctrl reference to struct nvme_request nvmet-rdma: add an error flow for post_recv failures nvmet-rdma: add unlikely check in the fast path nvmet-rdma: support max(16KB, PAGE_SIZE) inline data nvme-rdma: support up to 4 segments of inline data nvmet: add buffered I/O support for file backed ns nvmet: add commands supported and effects log page nvme: move init of keep_alive work item to controller initialization nvme.h: resync with nvme-cli commit 2063945fdc3d4c0ac8f9319d942eda720d02aabe Author: Masahiro Yamada Date: Fri Jul 20 16:46:36 2018 +0900 kbuild: remove auto.conf from prerequisite of phony targets The top-level Makefile adds include/config/auto.conf as prerequisites of 'scripts', 'prepare1', etc. They were needed to terminate the build when include/config/auto.conf is missing. Now that the inclusion of include/config/auto.conf is mandatory in the top-level Makefile if dot-config is 1 (Note 'include' directive is used instead of '-include'). Make terminates the build by itself if it fails to create or update include/config/auto.conf so we are sure that include/config/auto.conf exists in the very first stage of make. I am still keeping include/config/auto.conf as the prerequisite of %/modules.builtin because modules.builtin is a real file. According to commit a6c366324cac ("kbuild: Do not unnecessarily regenerate modules.builtin"), it is intentional to compare time-stamps between %/modules.builtin and include/config/auto.conf . I moved tristate.conf here because it is only included from scripts/Makefile.modbuiltin. Signed-off-by: Masahiro Yamada commit a29d4d8c5669a658b5a091b38205c13084967ce7 Author: Masahiro Yamada Date: Fri Jul 20 16:46:35 2018 +0900 kbuild: do not update config for 'make kernelrelease' 'make kernelrelease' depends on CONFIG_LOCALVERSION(_AUTO), but for the same reason as install targets, we do not want to update the configuration just for printing the kernelrelease string. This is likely to happen when you compiled the kernel with CROSS_COMPILE, but forget to pass it to 'make kernelrelease'. Signed-off-by: Masahiro Yamada commit d79424137a7312d381d131d707a462440c0e8df9 Author: Masahiro Yamada Date: Fri Jul 20 16:46:34 2018 +0900 kbuild: do not update config when running install targets "make syncconfig" is automatically invoked when any of the following happens: - .config is updated - any of Kconfig files is updated - any of environment variables referenced in Kconfig is changed Then, it updates configuration files such as include/config/auto.conf include/generated/autoconf.h, etc. Even install targets (install, modules_install, etc.) are no exception. However, they should never ever modify the source tree. Install targets are often run with root privileges. Once those configuration files are owned by root, "make mrproper" would end up with permission error. Install targets should just copy things blindly. They should not care whether the configuration is up-to-date or not. This makes more sense because we are interested in the configuration that was used in the previous kernel building. This issue has existed since before, but rarely happened. I expect more chance where people are hit by this; with the new Kconfig syntax extension, the .config now contains the compiler information. If you cross-compile the kernel with CROSS_COMPILE, but forget to pass it for "make install", you meet "any of environment variables referenced in Kconfig is changed" because $(CC) is referenced in Kconfig. Another scenario is the compiler upgrade before the installation. Install targets need the configuration. "make modules_install" refer to CONFIG_MODULES etc. "make dtbs_install" also needs CONFIG_ARCH_* to decide which dtb files to install. However, the auto-update of the configuration files should be avoided. We already do this for external modules. Now, Make targets are categorized into 3 groups: [1] Do not need the kernel configuration at all help, coccicheck, headers_install etc. [2] Need the latest kernel configuration If new config options are added, Kconfig will show prompt to ask user's selection. Build targets such as vmlinux, in-kernel modules are the cases. [3] Need the kernel configuration, but do not want to update it Install targets except headers_install, and external modules are the cases. Signed-off-by: Masahiro Yamada commit 9c2af1c7377a8a6ef86e5cabf80978f3dbbb25c0 Author: Masahiro Yamada Date: Fri Jul 20 16:46:33 2018 +0900 kbuild: add .DELETE_ON_ERROR special target If Make gets a fatal signal while a shell is executing, it may delete the target file that the recipe was supposed to update. This is needed to make sure that it is remade from scratch when Make is next run; if Make is interrupted after the recipe has begun to write the target file, it results in an incomplete file whose time stamp is newer than that of the prerequisites files. Make automatically deletes the incomplete file on interrupt unless the target is marked .PRECIOUS. The situation is just the same as when the shell fails for some reasons. Usually when a recipe line fails, if it has changed the target file at all, the file is corrupted, or at least it is not completely updated. Yet the file’s time stamp says that it is now up to date, so the next time Make runs, it will not try to update that file. However, Make does not cater to delete the incomplete target file in this case. We need to add .DELETE_ON_ERROR somewhere in the Makefile to request it. scripts/Kbuild.include seems a suitable place to add it because it is included from almost all sub-makes. Please note .DELETE_ON_ERROR is not effective for phony targets. The external module building should never ever touch the kernel tree. The following recipe fails if include/generated/autoconf.h is missing. However, include/config/auto.conf is not deleted since it is a phony target. PHONY += include/config/auto.conf include/config/auto.conf: $(Q)test -e include/generated/autoconf.h -a -e $@ || ( \ echo >&2; \ echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or $@ are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo >&2 ; \ /bin/false) Signed-off-by: Masahiro Yamada commit 0a16d2e8cb7e6310debc208d42ff725361ae1911 Author: Masahiro Yamada Date: Fri Jul 20 16:46:32 2018 +0900 kbuild: use 'include' directive to load auto.conf from top Makefile When you build targets that require the kernel configuration, dot-config is set to 1, then the top-level Makefile includes auto.conf. However, Make considers its inclusion is optional because the '-include' directive is used here. If a necessary configuration file is missing for the external module building, the following error message is displayed: ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. However, Make still continues building; /bin/false let the creation of 'include/config/auto.config' fail, but Make can ignore the error since it is included by the '-include' directive. I guess the reason of using '-include' directive was to suppress the warning when you build the kernel from a pristine source tree: Makefile:605: include/config/auto.conf: No such file or directory The previous commit made sure include/config/auto.conf exists after the 'make *config' stage. Now, we can use the 'include' directive without showing the warning. Signed-off-by: Masahiro Yamada commit 00c864f8903dd357471e8ee48f4d57aaa9a1a0de Author: Masahiro Yamada Date: Fri Jul 20 16:46:31 2018 +0900 kconfig: allow all config targets to write auto.conf if missing Currently, only syncconfig creates or updates include/config/auto.conf and some other files. Other config targets create or update only the .config file. When you configure and build the kernel from a pristine source tree, any config target is followed by syncconfig in the build stage since include/config/auto.conf is missing. We are moving compiler tests from Makefile to Kconfig. It means that parsing Kconfig files will be more costly since Kconfig invokes the compiler commands internally. Thus, we want to avoid invoking Kconfig twice (one for *config to create the .config, and one for syncconfig to synchronize the auto.conf). If auto.conf does not exist, we can generate all configuration files in the first configuration stage, which will save the syncconfig in the build stage. Please note this should be done only when auto.conf is missing. If *config blindly did this, time stamp files under include/config/ would be unnecessarily touched, triggering unneeded rebuild of objects. I assume a scenario like this: 1. You have a source tree that has already been built with CONFIG_FOO disabled 2. Run "make menuconfig" to enable CONFIG_FOO 3. CONFIG_FOO turns out to be unnecessary. Run "make menuconfig" again to disable CONFIG_FOO 4. Run "make" In this case, include/config/foo.h should not be touched since there is no change in CONFIG_FOO. The sync process should be delayed until the user really attempts to build the kernel. This commit has another motivation; I want to suppress the 'No such file or directory' warning from the 'include' directive. The top-level Makefile includes auto.conf with '-include' directive, like this: ifeq ($(dot-config),1) -include include/config/auto.conf endif This looks strange because auto.conf is mandatory when dot-config is 1. I guess only the reason of using '-include' is to suppress the warning 'include/config/auto.conf: No such file or directory' when building from a clean tree. However, this has a side-effect; Make considers the files included by '-include' are optional. Hence, Make continues to build even if it fails to generate include/config/auto.conf. I will change this in the next commit, but the warning message is annoying. (At least, kbuild test robot reports it as a regression.) With this commit, Kconfig will generate all configuration files together with the .config and I guess it is a solution good enough to suppress the warning. Note: GNU Make 4.2 or later does not display the warning from the 'include' directive if include files are successfully generated. See GNU Make commit 87a5f98d248f ("[SV 102] Don't show unnecessary include file errors.") However, older GNU Make versions are still widely used. Signed-off-by: Masahiro Yamada commit 16952b77d8b542fe5f3d73065a50842885b2ba0b Author: Masahiro Yamada Date: Fri Jul 20 16:46:30 2018 +0900 kconfig: make syncconfig update .config regardless of sym_change_count syncconfig updates the .config only when sym_change_count > 0, i.e. any change in config symbols has been detected. Not only symbols but also comments are contained in the .config file. If only comments are updated, they are not fed back to the .config, then the stale comments are left-over. Of course, this is just a matter of comments, but why not fix it. I see some scenarios where this happens. Scenario A: 1. You have a source tree that has already been configured. 2. Linus increments the version number in the top-level Makefile (i.e. he commits a new release) 3. You pull it, and run 'make' 4. syncconfig is invoked because the environment variable, KERNELVERSION is updated, but the .config is not updated since no config symbol is changed. 5. The .config file contains a kernel version in the top line: # Automatically generated file; DO NOT EDIT. # Linux/arm64 4.18.0-rc2 Kernel Configuration ... which points to a previous version. Scenario B: 1. You have a source tree that has already been configured. 2. You upgrade the compiler, but it still has the same version number. This may happen if you regularly build the latest compiler from the source code. 3. You run 'make' 4. syncconfig is invoked because the environment variable, CC_VERSION_TEXT is updated, but the .config is not updated since no config symbol is changed. 5. The .config file contains the version string of the compiler: # # Compiler: aarch64-linux-gcc (GCC) 9.0.0 20180628 (experimental) # ... which carries the information of the old compiler. If KCONFIG_NOSILENTUPDATE is set, syncconfig is not allowed to update the .config file. Otherwise, it is fine to update it regardless of sym_change_count. Signed-off-by: Masahiro Yamada commit 79123b1389cc775d8e60cb026256f79f0daef173 Author: Masahiro Yamada Date: Fri Jul 20 16:46:29 2018 +0900 kconfig: create directories needed for syncconfig by itself 'make syncconfig' creates some files such as include/config/auto.conf, include/generate/autoconf.h, etc. but the necessary directory creation relies on scripts/kconfig/Makefile. To make Kconfig self-contained, create directories as needed in conf_write_autoconf(). This change allows scripts/kconfig/Makefile cleanups; syncconfig can be merged into simple-targets. Signed-off-by: Masahiro Yamada commit adc18acf42a1e738c4c58090e0efe7977e812779 Author: Masahiro Yamada Date: Fri Jul 20 16:46:28 2018 +0900 kconfig: remove unneeded directory generation from local*config Commit 17263baf958b ("kconfig: Create include/generated for localmodconfig") added the 'mkdir' line because local{yes,mod}config ran streamline_config.pl followed by silentoldconfig at that time. Since commit 81d2bc227305 ("kconfig: invoke oldconfig instead of silentoldconfig from local*config"), no sub-directory is required. Signed-off-by: Masahiro Yamada commit 0608182ad54293f6f617c1cc9fb34467db5515c7 Author: Masahiro Yamada Date: Fri Jul 20 16:46:27 2018 +0900 kconfig: split out useful helpers in confdata.c Split out helpers: is_present() - check if the given path exists is_dir() - check if the given path exists and it is a directory make_parent_dir() - create the parent directories of the given path These helpers will be reused in later commits. Signed-off-by: Masahiro Yamada commit a2ff4040151ace5be20e4de34220468b9e842e4d Author: Masahiro Yamada Date: Fri Jul 20 16:46:26 2018 +0900 kconfig: rename file_write_dep and move it to confdata.c file_write_dep() is called only from conf_write_autoconf(). Move it from util.c to confdata.c to make it static. Also, rename it to conf_write_dep() since it should belong to the group of conf_write* functions. Signed-off-by: Masahiro Yamada commit 08b220b37ffe9ae8f2f0fe4618d03f7c25805fb3 Author: Randy Dunlap Date: Wed Jul 18 22:46:36 2018 -0700 kconfig: fix typos in description of "choice" in kconfig-language.txt Fix a couple of punctuation "typos" in the description of the "choice" keyword. Signed-off-by: Randy Dunlap Signed-off-by: Masahiro Yamada commit 5accd7f3360e891bd552312515387dbaa2bb4bf3 Author: Masahiro Yamada Date: Thu Jul 5 11:46:12 2018 +0900 kconfig: handle format string before calling conf_message_callback() As you see in mconf.c and nconf.c, conf_message_callback() hooks are likely to end up with the boilerplate of vsnprintf(). Process the string format before calling conf_message_callback() so that it receives a simple string. Signed-off-by: Masahiro Yamada Reviewed-by: Dirk Gouders commit cb782a3fa952478177341e67275885ae52340f99 Author: Mikulas Patocka Date: Wed Jul 25 15:41:57 2018 +0200 udlfb: use spin_lock_irq instead of spin_lock_irqsave spin_lock_irqsave and spin_unlock_irqrestore is inteded to be called from a context where it is unknown if interrupts are enabled or disabled (such as interrupt handlers). From a process context, we should call spin_lock_irq and spin_unlock_irq, that avoids the costly pushf and popf instructions. Signed-off-by: Mikulas Patocka Signed-off-by: Bartlomiej Zolnierkiewicz commit 037dde4113b5d1f886cb621d538438e7af7b6967 Author: Mikulas Patocka Date: Wed Jul 25 15:41:57 2018 +0200 udlfb: avoid prefetch Modern processors can detect linear memory accesses and prefetch data automatically, so there's no need to use prefetch. Signed-off-by: Mikulas Patocka Signed-off-by: Bartlomiej Zolnierkiewicz commit 8f3c39b8565df2504d727be2ed6d2643bae2b317 Author: Mikulas Patocka Date: Wed Jul 25 15:41:56 2018 +0200 udlfb: optimization - test the backing buffer Currently, the udlfb driver only tests for identical bytes at the beginning or at the end of a page and renders anything between the first and last mismatching pixel. But pages are not the same as lines, so this is quite suboptimal - if there is something modified at the beginning of a page and at the end of a page, the whole page is rendered, even if most of the page is not modified. This patch makes it test for identical pixels at the beginning and end of each rendering command. This patch improves identical byte detection by 41% when playing video in a window. This patch also fixes a possible screen corruption if the user is writing to the framebuffer while dlfb_render_hline is in progress - the pixel data that is copied to the backbuffer with memcpy may be different from the pixel data that is actually rendered to the hardware (because the content of the framebuffer may change between memcpy and the rendering command). We must make sure that we copy exactly the same pixel as the pixel that is being rendered. Signed-off-by: Mikulas Patocka [b.zolnierkie: fix code indent] Signed-off-by: Bartlomiej Zolnierkiewicz commit 7433914efd584b22bb49d3e1eee001f5d0525ecd Author: Mikulas Patocka Date: Wed Jul 25 15:41:56 2018 +0200 udlfb: allow reallocating the framebuffer This patch changes udlfb so that it may reallocate the framebuffer when setting higher-resolution mode. If we boot the system without monitor attached, udlfb creates a framebuffer with the size 800x600. This patch makes it possible to select higher videomode with the fbset command when a monitor is attached. Note that there is no reliable way to prevent the system from touching the old framebuffer, so we must not free it. We add it to the list dlfb->deferred_free and free it when the driver is unloaded. Signed-off-by: Mikulas Patocka [b.zolnierkie: sparse fixes] Signed-off-by: Bartlomiej Zolnierkiewicz commit 0ac319b7af1bb24a33365d0ec82a2f56a59b2a78 Author: Mikulas Patocka Date: Wed Jul 25 15:41:56 2018 +0200 udlfb: set line_length in dlfb_ops_set_par Set the variable "line_length" in the function dlfb_ops_set_par. Without this, we get garbage if we select different videomode with fbset. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz commit 080fb5240bdcabed7387b814139c3ea172d59fc5 Author: Mikulas Patocka Date: Wed Jul 25 15:41:56 2018 +0200 udlfb: handle allocation failure Allocations larger than PAGE_ALLOC_COSTLY_ORDER are unreliable and they may fail anytime. This patch fixes the udlfb driver so that when a large alloactions fails, it tries to do multiple smaller allocations. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz commit bb24153a3f13dd0dbc1f8055ad97fe346d598f66 Author: Mikulas Patocka Date: Wed Jul 25 15:41:55 2018 +0200 udlfb: set optimal write delay The default delay 5 jiffies is too much when the kernel is compiled with HZ=100 - it results in jumpy cursor in Xwindow. In order to find out the optimal delay, I benchmarked the driver on 1280x720x30fps video. I found out that with HZ=1000, 10ms is acceptable, but with HZ=250 or HZ=300, we need 4ms, so that the video is played without any frame skips. This patch changes the delay to this value. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz commit 2c29cfc3eaf11779176bf41475cfca49bccba11c Author: Mikulas Patocka Date: Wed Jul 25 15:41:55 2018 +0200 udlfb: make a local copy of fb_ops The defio subsystem overwrites the method fb_osp->mmap. That method is stored in module's static data - and that means that if we have multiple diplaylink adapters, they will over write each other's method. In order to avoid interference between multiple adapters, we copy the fb_ops structure to a device-local memory. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz commit 564f1807379298dfdb12ed0d5b25fcb89c238527 Author: Mikulas Patocka Date: Wed Jul 25 15:41:55 2018 +0200 udlfb: don't switch if we are switching to the same videomode The udlfb driver reprograms the hardware everytime the user switches the console, that makes quite unusable when working on the console. This patch makes the driver remember the videomode we are in and avoid reprogramming the hardware if we switch to the same videomode. We mask the "activate" field and the "FB_VMODE_SMOOTH_XPAN" flag when comparing the videomode, because they cause spurious switches when switching to and from the Xserver. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz commit 4e705e17ce3409a1f492cfd5dadcf6a4f6075842 Author: Mikulas Patocka Date: Wed Jul 25 15:41:54 2018 +0200 udlfb: fix display corruption of the last line The displaylink hardware has such a peculiarity that it doesn't render a command until next command is received. This produces occasional corruption, such as when setting 22x11 font on the console, only the first line of the cursor will be blinking if the cursor is located at some specific columns. When we end up with a repeating pixel, the driver has a bug that it leaves one uninitialized byte after the command (and this byte is enough to flush the command and render it - thus it fixes the screen corruption), however whe we end up with a non-repeating pixel, there is no byte appended and this results in temporary screen corruption. This patch fixes the screen corruption by always appending a byte 0xAF at the end of URB. It also removes the uninitialized byte. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz commit 9d0aa601e4cd9c0892f90d36e8488d79b72f4073 Author: Mikulas Patocka Date: Wed Jul 25 15:41:54 2018 +0200 udlfb: fix semaphore value leak I observed that the performance of the udl fb driver degrades over time. On a freshly booted machine, it takes 6 seconds to do "ls -la /usr/bin"; after some time of use, the same operation takes 14 seconds. The reason is that the value of "limit_sem" decays over time. The udl driver uses a semaphore "limit_set" to specify how many free urbs are there on dlfb->urbs.list. If the count is zero, the "down" operation will sleep until some urbs are added to the freelist. In order to avoid some hypothetical deadlock, the driver will not call "up" immediately, but it will offload it to a workqueue. The problem is that if we call "schedule_delayed_work" on the same work item multiple times, the work item may only be executed once. This is happening: * some urb completes * dlfb_urb_completion adds it to the free list * dlfb_urb_completion calls schedule_delayed_work to schedule the function dlfb_release_urb_work to increase the semaphore count * as the urb is on the free list, some other task grabs it and submits it * the submitted urb completes, dlfb_urb_completion is called again * dlfb_urb_completion calls schedule_delayed_work, but the work is already scheduled, so it does nothing * finally, dlfb_release_urb_work is called, it increases the semaphore count by 1, although it should increase it by 2 So, the semaphore count is decreasing over time, and this causes gradual performance degradation. Note that in the current kernel, the "up" function may be called from interrupt and it may race with the "down" function called by another thread, so we don't have to offload the call of "up" to a workqueue at all. This patch removes the workqueue code. The patch also changes "down_interruptible" to "down" in dlfb_free_urb_list, so that we will clean up the driver properly even if a signal arrives. With this patch, the performance of udlfb no longer degrades. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org [b.zolnierkie: fix immediatelly -> immediately typo] Signed-off-by: Bartlomiej Zolnierkiewicz commit 8c5b044299951acd91e830a688dd920477ea1eda Author: Mikulas Patocka Date: Wed Jul 25 15:41:54 2018 +0200 fb: fix lost console when the user unplugs a USB adapter I have a USB display adapter using the udlfb driver and I use it on an ARM board that doesn't have any graphics card. When I plug the adapter in, the console is properly displayed, however when I unplug and re-plug the adapter, the console is not displayed and I can't access it until I reboot the board. The reason is this: When the adapter is unplugged, dlfb_usb_disconnect calls unlink_framebuffer, then it waits until the reference count drops to zero and then it deallocates the framebuffer. However, the console that is attached to the framebuffer device keeps the reference count non-zero, so the framebuffer device is never destroyed. When the USB adapter is plugged again, it creates a new device /dev/fb1 and the console is not attached to it. This patch fixes the bug by unbinding the console from unlink_framebuffer. The code to unbind the console is moved from do_unregister_framebuffer to a function unbind_console. When the console is unbound, the reference count drops to zero and the udlfb driver frees the framebuffer. When the adapter is plugged back, a new framebuffer is created and the console is attached to it. Signed-off-by: Mikulas Patocka Cc: Dave Airlie Cc: Bernie Thompson Cc: Ladislav Michl Cc: stable@vger.kernel.org [b.zolnierkie: preserve old behavior for do_unregister_framebuffer()] Signed-off-by: Bartlomiej Zolnierkiewicz commit 1f28231c66b5381c07b4ff0ca919387d060d6f1b Author: Alexandre Belloni Date: Wed Jul 25 15:17:44 2018 +0200 rtc: sa1100: don't set PIE frequency It doesn't make sense to set the PIE frequency from the driver. Let userspace do its job. Signed-off-by: Alexandre Belloni commit 1fb9a6055561c1e77e1660aba51b1075a4a06475 Author: Stanimir Varbanov Date: Thu Jul 5 09:04:01 2018 -0400 media: venus: add HEVC codec support This add HEVC codec support for venus versions 3xx and 4xx. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0e8954a415b862f8fb4a9f9e6689c8ea5522aa47 Author: Stanimir Varbanov Date: Thu Jul 5 09:04:00 2018 -0400 media: venus: core: add sdm845 DT compatible and resource data This adds sdm845 DT compatible string with it's resource data table. Signed-off-by: Stanimir Varbanov Reviewed-by: Rob Herring Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f012b23d64e9879eca987627d9b9da3d9de56746 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:59 2018 -0400 media: venus: implementing multi-stream support This is implementing multi-stream decoder support. The multi-stream will be used to enable/disable the primary/secondary decoder outputs. Depending on formats on both decoder outputs we could implement downscale, dithering and supporting UBWC (universal bandwidth compression) formats. The UBWC compressed raw format is used to optimize interconnect bandwidth for bigger resolutions like 4K and hence we will get some power-saving benefits as well. Both decoder outputs are distinguished by buffer_type field in the HFI packets. For example HFI_BUFFER_OUTPUT is the buffer type for primary decoder output and HFI_BUFFER_OUTPUT2 is for secondary decoder output. Starting from Venus 4xx the DPB buffers format must be UBWC, so the multi-stream becomes mandatory for this Venus version. That means that we need to allocate internally in the driver a set of DPB buffers (with UBWC NV12 format) and give them to the firmware. The other decoder output (we called it OPB) format will be NV12 linear format and with the same resolution (or smaller in case the user wants to downscale). The DPB buffers are used for decoder reference frames and those have to be in a specific format (UBWC). So one decoder output is used to fill those reference buffers while the other output is used to fill the userspace buffers with the user requested format. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e1cb72de702ad56bf0eb79264d9e95313d34b407 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:58 2018 -0400 media: venus: helpers: move frame size calculations on common place This move the calculations of raw and compressed buffer sizes on common helper and make it identical for encoder and decoder. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ea8ce23513afec48c690b408ac06a6fd695d057a Author: Stanimir Varbanov Date: Thu Jul 5 09:03:57 2018 -0400 media: venus: vdec: a new function for output configuration Make a new function vdec_output_conf() for decoder output configuration. vdec_output_conf() will set properties via HFI interface related to the output configuration, and keep vdec_set_properties() which will set properties related to decoding parameters. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7094af54c5167990a46abd26c83891188e8934b8 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:56 2018 -0400 media: venus: vdec: get required input buffers as well Rework and rename vdec_cap_num_buffers() to get the number of input buffers too. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 130c0117e853a3561d083fd4039b630ca35ce167 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:55 2018 -0400 media: venus: helpers: add a helper to return opb buffer sizes Add a helper function to return current output picture buffer size. OPB sizes can vary depending on the selected decoder output(s). Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1eb04b2ef4dc27f465325892bcbd19274775108e Author: Stanimir Varbanov Date: Thu Jul 5 09:03:54 2018 -0400 media: venus: helpers: extend set_num_bufs helper with one more argument Extend venus_helper_set_num_bufs() helper function with one more argument to set number of output buffers for the secondary decoder output. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 01165b8484973da047fecd082a9c67da9c988ebe Author: Stanimir Varbanov Date: Thu Jul 5 09:03:53 2018 -0400 media: venus: helpers, vdec, venc: add helpers to set work mode and core usage These are new properties applicable to Venus version 4xx. Add the helpers and call them from decoder and encoder drivers. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ab97a3fb904d7f50855d707c89529d8d50193dcb Author: Stanimir Varbanov Date: Thu Jul 5 09:03:52 2018 -0400 media: venus: helpers: add a new helper to set raw format The new helper will has one more argument for buffer type, that way the decoder can configure the format on it's secondary output. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 404054e1777a01ac93d9767b300f6ffb41bf5972 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:51 2018 -0400 media: venus: helpers: add buffer type argument to a helper This adds one more function argument to pass buffer type to set_output_resolution() helper function. That is a preparation to support secondary decoder output. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bf26670aeae8f7f407e05f5da044e48cf9854a1b Author: Stanimir Varbanov Date: Thu Jul 5 09:03:50 2018 -0400 media: venus: core: delete not used buffer mode flags Delete not used flag for capture buffer allocation mode and no longer used cap_bufs_mode_dynamic from instance structure. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d4a5b0a6657bab12408b792cc111bc3b7c17b39b Author: Stanimir Varbanov Date: Thu Jul 5 09:03:49 2018 -0400 media: venus: helpers: add helper function to set actual buffer size Add and use a helper function to set actual buffer size for particular buffer type. This is also preparation to use the second decoder output. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2b0a8517fbfdbd8a2080404a5fe19ff0eb17e2e0 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:48 2018 -0400 media: venus: helpers: add a helper function to set dynamic buffer mode Adds a new helper function to set dynamic buffer mode if it is supported by current HFI version. The dynamic buffer mode is set unconditionally for both decoder outputs. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f03835204f7085a18777c1419fd5b3b6217b00ad Author: Stanimir Varbanov Date: Thu Jul 5 09:03:47 2018 -0400 media: venus: helpers: rename a helper function and use buffer mode from caps Rename is_reg_unreg_needed() to better name is_dynamic_bufmode() and use buffer mode from enumerated per codec capabilities. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1a73374a04e555103e5369429a30999114001dda Author: Stanimir Varbanov Date: Fri Jul 6 08:47:58 2018 -0400 media: venus: hfi_parser: add common capability parser This adds common capability parser for all supported Venus versions. Having it will help to enumerate better the supported raw formats and codecs and also the capabilities for every codec like max/min width/height, framerate, bitrate and so on. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit aa3a8414ccea5b9412419db11f5d76ae9a4997a4 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:45 2018 -0400 media: venus: core, helpers: add two more clocks found in Venus 4xx Add two more clocks for Venus 4xx in core structure and create a new power enable function to handle it for 3xx/4xx versions. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 17cd3d1d2e5249c58510b0c8689c45cacc201480 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:44 2018 -0400 media: venus: hfi_venus: add suspend functionality for Venus 4xx This adds suspend (power collapse) functionality by reusing the suspend function for Venus 3xx and also enables idle indicator property for Venus 4xx (where it is disabled by default). Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4dde81d720dcd68e439081092035a24ee20fa09c Author: Stanimir Varbanov Date: Thu Jul 5 09:03:43 2018 -0400 media: venus: hfi_venus: move set of default properties to core init This moves setting of default properties (firmware debug, idle indicator and low power mode) from session init to core init. All of those properties are need to be enabled/disabled early so that they could be used before the clients are even initialized. The other reason is to set idle indicator property early before we enter into venus_suspend function where we need to check for ARM9 WFI. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bc897723467a7d56f1da81accc703429dcee5632 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:42 2018 -0400 media: venus: hfi_venus: fix suspend function for venus 3xx versions This fixes the suspend function for Venus 3xx versions by add a check for WFI (wait for interrupt) bit. This bit is on when the ARM9 is idle and entered in low power mode. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit eb72356e7de23d744d89e8c9408607c0fd71368c Author: Stanimir Varbanov Date: Thu Jul 5 09:03:41 2018 -0400 media: venus: hfi_venus: add halt AXI support for Venus 4xx Add AXI halt support for version 4xx by using venus wrapper registers. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5f43f90a99ade6db0c05e2bb45883256649c9164 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:40 2018 -0400 media: venus: hfi: handle buffer output2 type as well This adds handling of buffers of type OUTPUT2 which is needed to support Venus 4xx version. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2074b9bed635ce96f16847d75f653f3bdb9905a6 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:39 2018 -0400 media: venus: hfi: support session continue for 4xx version This makes possible to handle session_continue for 4xx as well. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6b183680dd8b9ce0aca9ad5d4dd18b5861dcf59d Author: Stanimir Varbanov Date: Thu Jul 5 09:03:38 2018 -0400 media: venus: hfi_cmds: add set_properties for 4xx version Adds set_properties method to handle newer 4xx properties and fall-back to 3xx for the rest. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9eb2146ecb5f1617c8a2946f7a7d02968f4c01a2 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:37 2018 -0400 media: venus: hfi: update sequence event to handle more properties HFI version 4xx can pass more properties in the sequence change event, extend the event structure with them. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f04997bdca34221c5e953df40999c4c92edb4e0b Author: Stanimir Varbanov Date: Thu Jul 5 09:03:36 2018 -0400 media: venus: hfi: preparation to support venus 4xx This covers the differences between 1xx,3xx and 4xx. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ea8afbabc25ade9aa34da01ffbba8085ab46ca48 Author: Stanimir Varbanov Date: Thu Jul 5 09:03:35 2018 -0400 media: venus: hfi_msgs: correct pointer increment Data pointer should be incremented by size of the structure not the size of a pointer, correct the mistake. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bf7b70482704bb0785e6b65ee30a6383ab22bbc6 Author: Baruch Siach Date: Thu Jul 5 05:38:00 2018 -0400 media: v4l2-ctrls.h: fix v4l2_ctrl field description typos Signed-off-by: Baruch Siach Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d4de804e02a3bff973a91b13784ecd5376baf9c1 Author: Hugues Fruchet Date: Thu Jul 5 05:01:42 2018 -0400 media: MAINTAINERS: Add entry for STM32 DCMI media driver Add an entry to make myself a maintainer of STM32 DCMI media driver. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2e3134caf63694bf1dbb2e68829871e14d543613 Author: Julia Lawall Date: Sun Jul 1 13:32:05 2018 -0400 media: gspca_kinect: cast sizeof to int for comparison Comparing an int to a size, which is unsigned, causes the int to become unsigned, giving the wrong result. kinect_read returns the result of usb_control_msg, which can return a negtive error code. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ int x; expression e,e1; identifier f; @@ *x = f(...); ... when != x = e1 when != if (x < 0 || ...) { ... return ...; } *x < sizeof(e) // Signed-off-by: Julia Lawall Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5a1a2f63d840dc2631505b607e11ff65ac1b7d3c Author: Krzysztof Ha?asa Date: Thu Jun 28 17:45:07 2018 -0400 media: tw686x: Fix oops on buffer alloc failure The error path currently calls tw686x_video_free() which requires vc->dev to be initialized, causing a NULL dereference on uninitizalized channels. Fix this by setting the vc->dev fields for all the channels first. Fixes: f8afaa8dbc0d ("[media] tw686x: Introduce an interface to support multiple DMA modes") Signed-off-by: Krzysztof Ha?asa Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ec8ca8e3b4809bf603814a8834bfd3891e1ccf74 Author: Peter Ujfalusi Date: Wed Jul 18 12:29:57 2018 +0300 dmaengine: dma_request_chan_by_mask() to handle deferred probing If there are no DMA devices registered yet, return with EPROBE_DEFER similarly to the case when requesting a slave channel. Signed-off-by: Peter Ujfalusi Signed-off-by: Vinod Koul commit acbea6798955e92eefa5fb84ecaa677a763c8762 Author: Matt Ranostay Date: Thu Jun 28 14:11:04 2018 -0400 media: video-i2c: add hwmon support for amg88xx AMG88xx has an on-board thermistor which is used for more accurate processing of its temperature readings from the 8x8 thermopile array Cc: linux-hwmon@vger.kernel.org Signed-off-by: Matt Ranostay Acked-by: Guenter Roeck Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 22fb5f0f8604a1e5b7d66637e5e85c195cc85cde Author: Philipp Zabel Date: Thu Jun 28 07:01:47 2018 -0400 media: coda: add missing h.264 levels This enables reordering support for h.264 main profile level 4.2, 5.0, and 5.1 streams. Even though we likely can't play back such streams at full speed, we should still recognize them correctly. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 40fa8df63ce48d43f229d4dc6d43b3b9105abb20 Author: Philipp Zabel Date: Thu Jun 28 06:57:54 2018 -0400 media: coda: use encoder crop rectangle to set visible width and height Allow to set a crop rectangle on the encoder output queue to set the visible resolution as required by the V4L2 codec API. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e49756544a21f5625b379b3871d27d8500764670 Author: John Keeping Date: Tue Jul 17 11:48:16 2018 +0100 dmaengine: pl330: fix irq race with terminate_all In pl330_update() when checking if a channel has been aborted, the channel's lock is not taken, only the overall pl330_dmac lock. But in pl330_terminate_all() the aborted flag (req_running==-1) is set under the channel lock and not the pl330_dmac lock. With threaded interrupts, this leads to a potential race: pl330_terminate_all pl330_update ------------------- ------------ lock channel entry lock pl330 _stop channel unlock pl330 lock pl330 check req_running != -1 req_running = -1 _start channel Signed-off-by: John Keeping Signed-off-by: Vinod Koul commit 9e49ca530eebd6775410317aac8a68f88171f89c Author: Philipp Zabel Date: Thu Jun 28 06:57:53 2018 -0400 media: coda: streamline framebuffer size calculation a bit Remove the intermediate width and height variables, the calculation is simple enough. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5c9072e8458f937a9c0a38736989d128ef990fc5 Author: Philipp Zabel Date: Thu Jun 28 06:57:52 2018 -0400 media: coda: move framebuffer size calculation out of loop All internal YCbCr frame buffers are the same size, calculate ycbcr_size once before the allocation loop. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4bcde3a53edd9444dcfbf17b0dbc999fd5b781bf Author: Vinod Koul Date: Wed Jul 25 17:54:08 2018 +0530 dmaengine: Revert "dmaengine: mv_xor_v2: enable COMPILE_TEST" This reverts commit 31d5e6b72439: ("dmaengine: mv_xor_v2: enable COMPILE_TEST") as enabling causing bunch of build failures. Signed-off-by: Vinod Koul commit ac7b06ba3125d54e2104545c302cb9894eff166d Author: Hanna Hawa Date: Tue Jul 24 16:40:30 2018 +0300 dmaengine: mv_xor_v2: use {lower,upper}_32_bits to configure HW descriptor address >> drivers/dma/mv_xor_v2.c:647:36: sparse: constant 0xFFFF00000000 is so big it is long include/linux/device.h:678:13: sparse: undefined identifier '__builtin_mul_overflow' include/linux/device.h:678:13: sparse: call with no type! Use lower_32_bits and upper_32_bits to set the hw_desq address, instead of using constant. Signed-off-by: Hanna Hawa Reported-by: kbuild test robot Signed-off-by: Vinod Koul commit 256bf813ba39f7f9277a5cd05b5c152dbbaf4aae Author: Hans Verkuil Date: Fri Jul 20 03:52:50 2018 -0400 media: vicodec: add the virtual codec driver Add the virtual codec driver that uses the Fast Walsh Hadamard Transform. Keiichi Watanabe contributed the multiplanar support. Signed-off-by: Hans Verkuil Co-Developed-by: Keiichi Watanabe Signed-off-by: Keiichi Watanabe Signed-off-by: Mauro Carvalho Chehab commit 251d6fe9a6753f8d2b5b7565c7044dbd82d63d62 Author: Hans Verkuil Date: Fri Jul 20 03:49:21 2018 -0400 media: vicodec: add the FWHT software codec Add a software codec based on the Fast Walsh Hadamard Transform. The original FWHT codec was developed by Tom aan de Wiel, and it was turned into 'proper' kernel code by Hans Verkuil, with a lot of performance and memory improvements. Signed-off-by: Tom aan de Wiel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ee1228cca15ce097b7badebfdd0fef23a2cca9e1 Author: Hans Verkuil Date: Tue Jun 26 09:26:52 2018 -0400 media: v4l2-mem2mem: add v4l2_m2m_last_buf() This can be used to mark the last queued source buffer as the last buffer. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 62c3fce04154777e6a3ce3a27f123b645d36dcff Author: Hans Verkuil Date: Wed Jul 4 10:13:47 2018 -0400 media: videodev.h: add PIX_FMT_FWHT for use with vicodec Add a new pixelformat for the vicodec software codec using the Fast Walsh Hadamard Transform. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 45841a977391f24b9bf713548c588d148a576d22 Author: Hans Verkuil Date: Wed Jul 4 10:13:47 2018 -0400 media: media.h: add encoder/decoder functions for codecs Add MEDIA_ENT_F_PROC_VIDEO_EN/DECODER to be used for the encoder and decoder entities of codec hardware. [mchehab+samsung@kernel.org: split description on two senteces by adding dots] Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8601494e0ec0a7697230b2abca25d786b793341b Author: Hans Verkuil Date: Fri Jun 29 07:31:20 2018 -0400 media: media-ioc-enum-entities.rst/-g-topology.rst: clarify ID/name usage Mention that IDs should not be hardcoded in applications and that the entity name must be unique within the media topology. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit e5def285688f8935b3ad208459abb384f7912f34 Author: Hans Verkuil Date: Fri Jun 29 07:29:52 2018 -0400 media: media-ioc-enum-links.rst: improve pad index description Make it clearer that the index starts at 0. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 173bf6e51ba5845fbfcbdd281b837870fb033bc2 Author: Hans Verkuil Date: Mon Jun 18 05:10:28 2018 -0400 media: media/i2c: add missing entity functions Several drivers in media/i2c do not set the entity function. Correct this. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit ca0fa5f04f33eea010fc1f9dfc87ff58f3a2433f Author: Hans Verkuil Date: Mon Jun 18 05:09:45 2018 -0400 media: adv7180/tvp514x/tvp7002: fix entity function The entity function was ORed with the flags field instead of assigned to the function field. Correct this. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit a20a82b8642145a8d8decc6cd71e68f04647ed23 Author: Hans Verkuil Date: Mon Jun 18 05:08:20 2018 -0400 media: ad9389b/adv7511: set proper media entity function These two drivers both have function MEDIA_ENT_F_DV_ENCODER. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit ea107a183be1d6e69448d7100121c479e24b7c1d Author: vkorjani Date: Tue Apr 10 10:12:45 2018 -0400 drm: Add support for pps and compression mode command packet After enabling DSC we need to send compression mode command packet and pps data packet, for which 2 new data types are added 07h Compression Mode Data Type Write , short write, 2 parameters 0Ah PPS Long Write (word count determines number of bytes) This patch adds support to send these packets. Cc: David Airlie Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: linux-fbdev@vger.kernel.org Changes in v3: - None Signed-off-by: vkorjani [seanpaul removed pps_write_buffer fn, added types to packet_format helpers] Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit f2399f7522ac2a255f6502537609a51974be84be Author: Hans Verkuil Date: Thu Jun 28 09:03:42 2018 -0400 media: media.h: reorder video en/decoder functions Keep the function defines in numerical order: 0x6000 comes after 0x2000, so move it back. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 23f9455157f62e2fc7fbe7654717bcb70eee543d Author: Carsten Behling Date: Mon Jul 16 19:49:56 2018 +0200 drm/msm/mdp5: negative x/y in cursor move modesetting X11 driver may provide negative x/y cordinates in mdp5_crtc_cursor_move call when rotation is enabled. Cursor buffer can overlap down to its negative width/height. ROI has to be recalculated for negative x/y indicating using the lower/right corner of the cursor buffer and hotspot must be set in MDP5_LM_CURSOR_XY_SRC_Y MDP5_LM_CURSOR_XY_SRC_X. Signed-off-by: Carsten Behling Signed-off-by: Rob Clark commit 8f7ca5409063ade228a8ea0cc77b5fe9877f8cf0 Author: Sibi Sankar Date: Tue May 29 19:50:33 2018 +0530 drm/msm/dsi: replace version checks with helper functions Replace version checks with the helper functions bound to cfg_handler for DSI v2, DSI 6G 1.x and DSI 6G v2.0+ controllers Signed-off-by: Sibi Sankar Signed-off-by: Rob Clark commit c4d8cfe516dc54bac8837bc90ccbd878ad26c59e Author: Sibi Sankar Date: Tue May 29 19:50:32 2018 +0530 drm/msm/dsi: add implementation for helper functions Add dsi host helper function implementation for DSI v2 DSI 6G 1.x and DSI 6G v2.0+ controllers Signed-off-by: Sibi Sankar Signed-off-by: Rob Clark commit e18177cc572939ad9526bae141fc4c8f5f006de4 Author: Sibi Sankar Date: Tue May 29 19:50:31 2018 +0530 drm/msm/dsi: add dsi host helper functions support Add dsi host helper functions support for DSI v2 and DSI 6G 1.x controllers that are under version checks Signed-off-by: Sibi Sankar Signed-off-by: Rob Clark commit 6e8bed6a3e2fd6f1e82ea9b1f705bbc82060a2b7 Author: Rob Clark Date: Tue Jul 3 08:14:32 2018 -0400 drm/msm/mdp5: fix missing CTL flush f9cb8d8d836e fixed various race conditions with CTL flush, in particular flushing and sending the START signal before encoder state was updated. But it did this a little too well in some cases that don't trigger encoder->enable(), and CTL[n].FLUSH would never be set. When page flips happen it would paper over the bug, since the first plag flip would flush out the state to the hardware. The issue could be reproduced with, for example, modetest (without the '-v' argument). Fixes: f9cb8d8d836e drm/msm/mdp5: rework CTL START signal handling Signed-off-by: Rob Clark Reviewed-by: Sean Paul commit 64709686dbb38f32045e117ec5a1aaf2e3a0a3c4 Author: Jordan Crouse Date: Mon May 7 16:47:50 2018 -0600 drm/msm/gpu: Increase the pm runtime autosuspend for 5xx Experimentation shows that resuming power quickly after suspending ends up forcing a system hang for unknown reasons on 5xx targets. To avoid cycling the power too much (especially during init) turn up the autosuspend time for a5xx to 250ms and use pm_runtime_put_autosuspend() when applicable. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 6666e1a66f92988e8c85a7ac0c34f47dc7d412a0 Author: Daniel Mack Date: Mon May 28 21:53:39 2018 +0200 drm/msm/adreno: Add power management functions for system sleep When a msm8016 based system is woken up from suspend, the firmware in the adreno device hangs. [ 83.903416] qcom-iommu-ctx 1f09000.iommu-ctx: Unhandled context fault: fsr=0x202, iova=0x0000000000000000, fsynr=0x2, cb=1 [ 85.853633] msm 1a00000.mdss: A306: hangcheck detected gpu lockup rb 0! [ 85.853661] msm 1a00000.mdss: A306: completed fence: 370 [ 85.859073] msm 1a00000.mdss: A306: submitted fence: 372 [ 85.865113] msm 1a00000.mdss: A306: hangcheck recover! Fix this by adding pm_runtime_force_suspend/pm_runtime_force_resume as sleep ops. Signed-off-by: Daniel Mack Signed-off-by: Rob Clark commit ec446d09366cea199214b30810e368c5178841cd Author: Daniel Mack Date: Mon May 28 21:53:38 2018 +0200 drm/msm: call drm_atomic_helper_suspend() and drm_atomic_helper_resume() To make suspend and resume work on msm8916 platforms, call into the generic helpers and preserve the state across suspends. Signed-off-by: Daniel Mack Signed-off-by: Rob Clark commit 7c8362c4b9eb7e4e9cbebc71ab529dc455c21b6b Author: Hans Verkuil Date: Mon Jun 18 05:07:43 2018 -0400 media: media.h: add MEDIA_ENT_F_DV_ENCODER Add a new function for digital video encoders such as HDMI transmitters. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit d272bc92c4a4fcec4102c011eaa85630bd2d8d38 Author: Hans Verkuil Date: Thu Jun 28 08:56:02 2018 -0400 media: rename MEDIA_ENT_F_DTV_DECODER to MEDIA_ENT_F_DV_DECODER The use of 'DTV' is very confusing since it normally refers to Digital TV e.g. DVB etc. Instead use 'DV' (Digital Video), which nicely corresponds to the DV Timings API used to configure such receivers and transmitters. We keep an alias to avoid breaking userspace applications. Since this alias is only available if __KERNEL__ is *not* defined (i.e. it is only available for userspace, not kernelspace), any drivers that use it also have to be converted to the new define. These drivers are adv7604, adv7842 and tda1997x. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d2dc644adf81f3f5bbebda81e378cf250b03ed52 Author: Hans Verkuil Date: Mon Mar 19 11:17:17 2018 -0400 media: media-ioc-g-topology.rst: document new 'flags' field Document the new struct media_v2_entity 'flags' field. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 588f4ee7e6fc5c9a0fb07c7051cdd341949e0feb Author: Hans Verkuil Date: Wed Feb 28 05:41:11 2018 -0500 media: add flags field to struct media_v2_entity The v2 entity structure never exposed the entity flags, which made it impossible to detect connector or default entities. It is really trivial to just expose this information, so implement this. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b0549006263efd59e22518eda230040ffee71b93 Author: Hans Verkuil Date: Mon Mar 19 11:11:10 2018 -0400 media: media-ioc-g-topology.rst: document new 'index' field Document the new struct media_v2_pad 'index' field. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 30b914c8d825da7d4c651ade34667cef05e3ee27 Author: Hans Verkuil Date: Tue Feb 27 07:24:09 2018 -0500 media: add 'index' to struct media_v2_pad The v2 pad structure never exposed the pad index, which made it impossible to call the MEDIA_IOC_SETUP_LINK ioctl, which needs that information. It is really trivial to just expose this information, so implement this. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2754435d4c820875412785da9bfa017a74fe51a7 Author: Dmitry Rozhkov Date: Tue Jul 24 14:27:34 2018 +0300 ACPI / battery: get rid of negations in conditions Simple conditions without negations inflict less cognitive load on readers. Rework conditional branches not to use negations. Also add braces around single statement branches where their counterpart else-branches consist of more than one statement as suggested in the paragraph 3 of the coding style. Suggested-by: Andy Shevchenko Signed-off-by: Dmitry Rozhkov Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit dd1fca9e6cd4c5c179f4e854ceddbc22890109ce Author: Dmitry Rozhkov Date: Tue Jul 24 14:27:33 2018 +0300 ACPI / battery: use specialized print macros The kernel provides specialized macros for printing info and warning messages which make the code shorter. Use the specialized macros instead of bare printk()'s. Also format one user visible string literal into a searchable one line string. Suggested-by: Andy Shevchenko Signed-off-by: Dmitry Rozhkov Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 53dd200a2eed1413f2ef980dd5a193a3d45cc9a9 Author: Dmitry Rozhkov Date: Tue Jul 24 14:27:32 2018 +0300 ACPI / battery: reorder headers alphabetically Headers ordered alphabetically as easier to maintain. Suggested-by: Andy Shevchenko Signed-off-by: Dmitry Rozhkov Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 3461dfbabcc40d48c7b4b3ebb26a4ec927303e16 Author: Dmitry Rozhkov Date: Tue Jul 24 14:27:31 2018 +0300 ACPI / battery: drop inclusion of init.h The driver can be built as a module thus inclusion of init.h is redundant in battery.c since it's always included by module.h. Suggested-by: Andy Shevchenko Signed-off-by: Dmitry Rozhkov Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit f2ac479f0da046097258c68ef834af01b568436a Author: Jerome Brunet Date: Tue Jul 24 14:52:36 2018 +0200 arm64: dts: meson-axg: add spdif-dit codec Add the SPDIF playback codec to the axg s400 board Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit 154b912c01b6669b58f13fb9cc5fd34569acbce4 Author: Jerome Brunet Date: Tue Jul 24 14:52:35 2018 +0200 arm64: dts: meson-axg: add lineout codec Add the es7154 digital to analog converter which supplies the lienout jack of the s400 Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit cfc34f041b2d643373310bb05acd6ac113a0b73b Author: Jerome Brunet Date: Tue Jul 24 14:52:34 2018 +0200 arm64: dts: meson-axg: add linein codec Add the es7241 analog to digital converter which is fed by the lienin jack of the s400 Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit 08307aabe0fb6d498228fd70c1397b8813701110 Author: Jerome Brunet Date: Tue Jul 24 14:52:33 2018 +0200 arm64: dts: meson-axg: add tdm interfaces Add the devices reponsible for managing the i2s/tdm clocks and pads Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit fd91673926c99a8533e40787c79a1ef77c6b0e73 Author: Jerome Brunet Date: Tue Jul 24 14:52:32 2018 +0200 arm64: dts: meson-axg: add tdmout formatters Add the tdm devices responsible for serializing audio samples for i2s/tdm interfaces Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit bf8e47900326fb09ebcba94fb6cbb57bb5b2f76a Author: Jerome Brunet Date: Tue Jul 24 14:52:31 2018 +0200 arm64: dts: meson-axg: add tdmin formatters Add the tdm devices responsible for decoding the data provided through audio serial interface. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit f08c52de81b2bb10486fdb30cc4d53207d32b916 Author: Jerome Brunet Date: Tue Jul 24 14:52:30 2018 +0200 arm64: dts: meson-axg: add spdifout Add the SPDIF output device of the axg audio subsystem Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit 25622e045a6aed45c9b12d1977fcb3fc3b349a73 Author: Christoph Hellwig Date: Mon Apr 16 19:27:22 2018 +0200 nios2: use generic dma_noncoherent_ops Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig Acked-by: Ley Foon Tan Tested-by: Ley Foon Tan commit 7d63fb3af87aa67aa7d24466e792f9d7c57d8e79 Author: Kees Cook Date: Tue Jul 10 16:22:22 2018 -0700 swiotlb: clean up reporting This removes needless use of '%p', and refactors the printk calls to use pr_*() helpers instead. Signed-off-by: Kees Cook Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Christoph Hellwig commit d27fb99f62af7b79c542d161aa5155ed57271ddc Author: Robin Murphy Date: Mon Jul 23 22:42:48 2018 +0100 dma-mapping: relax warning for per-device areas The reasons why dma_free_attrs() should not be called from IRQ context are not necessarily obvious and somewhat buried in the development history, so let's start by documenting the warning itself to help anyone who does happen to hit it and wonder what the deal is. However, this check turns out to be slightly over-restrictive for the way that per-device memory has been spliced into the general API, since for that case we know that dma_declare_coherent_memory() has created an appropriate CPU mapping for the entire area and nothing dynamic should be happening. Given that the usage model for per-device memory is often more akin to streaming DMA than 'real' coherent DMA (e.g. allocating and freeing space to copy short-lived packets in and out), it is also somewhat more reasonable for those operations to happen in IRQ handlers for such devices. Therefore, let's move the irqs_disabled() check down past the per-device area hook, so that that gets a chance to resolve the request before we reach definite "you're doing it wrong" territory. Reported-by: Fredrik Noring Tested-by: Fredrik Noring Signed-off-by: Robin Murphy Signed-off-by: Christoph Hellwig commit 6e926363fc0071e6dc33349dedd97f28e9a2e464 Merge: 95d6c0857e54 eea033d07543 Author: Rafael J. Wysocki Date: Wed Jul 25 13:28:01 2018 +0200 Merge back cpufreq material for 4.19. commit 76e464888b1c367fddaf67f23ee3e0aa4ca8cef4 Author: Hans Verkuil Date: Thu Jun 28 07:44:03 2018 -0400 media: cec-gpio: support 5v testing Add support for the new (optional) 5V gpio in order to debug 5V changes. Some displays turn off CEC if the 5V is not detected, so it is useful to be able to monitor this line. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4786b0d6f3ca6da8db02b0a58cd2b785cb0b80ab Author: Hans Verkuil Date: Thu Jun 28 07:43:46 2018 -0400 media: cec: add support for 5V signal testing Add support for the new 5V CEC events Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f48a534adbd321362c3199140008c9e2f2a81b3a Author: Hans Verkuil Date: Thu Jun 28 07:43:26 2018 -0400 media: uapi/linux/cec.h: add 5V events Add two new events to signal when the 5V line goes high or low. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5105b484cc0be4ba34d49ed054863e16bc85edd2 Author: Hans Verkuil Date: Thu Jun 28 10:07:41 2018 -0400 media: cec-ioc-dqevent.rst: document the new 5V events Document the two new 5V events. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fbf8ad7ef40aeb4cd8ee70503cd7cbeb4144051f Author: Hans Verkuil Date: Thu Jun 28 07:42:57 2018 -0400 media: cec-gpio.txt: add v5-gpios for testing the 5V line In order to debug the HDMI 5V line we need to add a new v5-gpios property. Signed-off-by: Hans Verkuil Reviewed-by: Rob Herring Signed-off-by: Mauro Carvalho Chehab commit 286d9b8c7d2e5c5df4c5d01b385668665e355678 Author: Andy Shevchenko Date: Wed Jul 25 13:42:02 2018 +0300 serial: 8250: Use cached port name directly in messages Since we have port name stored in struct uart_port, we better to use that one instead of open coding. This will make it one place source for easier maintenance or modifications. While here, replace printk_ratelimited(KERN_INFO ) by pr_info_ratelimited(). It seems last printk() call in 8250_port.c. Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit 0fbfe10fa96b8df44cfb140a6672f9418e16a2a6 Author: Shohei Maruyama Date: Wed Jul 18 14:58:23 2018 +0000 arm64: dts: rockchip: add led support for Firefly-RK3399 This commit adds led support for the Firefly-RK3399. The board has two leds, this commit enables them. Signed-off-by: Shohei Maruyama Signed-off-by: Heiko Stuebner commit 5b64d06133853ba3cd59fe53a1591943c6e310c3 Author: Enric Balletbo i Serra Date: Mon Jul 9 22:57:54 2018 +0200 arm64: dts: rockchip: remove deprecated Type-C PHY properties on rk3399 Commit 0fbc47d9e426 ("phy: rockchip-typec: deprecate some DT properties for various register fields.") deprecates some Rockchip Type-C properties. As these are now not needed, remove from the device tree file. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Heiko Stuebner commit 24e5b85a1c86686c9f6345399f16f666b44a9ace Author: Shohei Maruyama Date: Wed Jul 18 14:58:21 2018 +0000 arm64: dts: rockchip: add power button support for Firefly-RK3399 This commit adds power button support for the Firefly-RK3399. Signed-off-by: Shohei Maruyama Signed-off-by: Heiko Stuebner commit 063daa8129f94d651c4d30a8333b577c5bbf8090 Author: Anders Roxell Date: Wed Jul 25 11:55:57 2018 +0200 arm/asm/tlb.h: Fix build error implicit func declaration Building on arm 32 with LPAE enabled we don't include asm-generic/tlb.h, where we have tlb_flush_remove_tables_local and tlb_flush_remove_tables defined. The build fails with: mm/memory.c: In function ‘tlb_remove_table_smp_sync’: mm/memory.c:339:2: error: implicit declaration of function ‘tlb_flush_remove_tables_local’; did you mean ‘tlb_remove_table’? [-Werror=implicit-function-declaration] ... This bug got introduced in: 2ff6ddf19c0e ("x86/mm/tlb: Leave lazy TLB mode at page table free time") To fix this issue we define them in arm 32's specific asm/tlb.h file as well. Signed-off-by: Anders Roxell Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: dave.hansen@intel.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux@armlinux.org.uk Cc: riel@surriel.com Cc: songliubraving@fb.com Fixes: 2ff6ddf19c0e ("x86/mm/tlb: Leave lazy TLB mode at page table free time") Link: http://lkml.kernel.org/r/20180725095557.19668-1-anders.roxell@linaro.org Signed-off-by: Ingo Molnar commit fd2efaa4eb5317c3a86357a83a7d456a1b86a0ac Author: Mark Rutland Date: Mon Jul 16 12:30:11 2018 +0100 locking/atomics: Rework ordering barriers Currently architectures can override __atomic_op_*() to define the barriers used before/after a relaxed atomic when used to build acquire/release/fence variants. This has the unfortunate property of requiring the architecture to define the full wrapper for the atomics, rather than just the barriers they care about, and gets in the way of generating atomics which can be easily read. Instead, this patch has architectures define an optional set of barriers: * __atomic_acquire_fence() * __atomic_release_fence() * __atomic_pre_full_fence() * __atomic_post_full_fence() ... which uses to build the wrappers. It would be nice if we could undef these, along with the __atomic_op_*() wrappers, but that would break the cmpxchg() wrappers, which are written in preprocessor. Undefs would have been nice, but alas. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Cc: Andrea Parri Cc: Boqun Feng Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: andy.shevchenko@gmail.com Cc: arnd@arndb.de Cc: aryabinin@virtuozzo.com Cc: catalin.marinas@arm.com Cc: dvyukov@google.com Cc: glider@google.com Cc: linux-arm-kernel@lists.infradead.org Cc: peter@hurleysoftware.com Link: http://lkml.kernel.org/r/20180716113017.3909-7-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 4d2b25f630c731218d04f72580b4de68cb7a6e00 Author: Mark Rutland Date: Mon Jul 16 12:30:10 2018 +0100 locking/atomics: Instrument cmpxchg_double*() We currently don't instrument cmpxchg_double() and cmpxchg_double_local() due to compilation issues reported in the past, which are supposedly related to GCC bug 72873 [1], reported when GCC 7 was not yet released. This bug only applies to x86-64, and does not apply to other architectures. While the test case for GCC bug 72873 triggers issues with released versions of GCC, the instrumented kernel code compiles fine for all configurations I have tried, and it is unclear how the two cases are/were related. As we can't reproduce the kernel build failures, let's instrument cmpxchg_double*() again. We can revisit the issue if build failures reappear. Signed-off-by: Mark Rutland Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Cc: Arnd Bergmann Cc: Boqun Feng Cc: Dmitry Vyukov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: andy.shevchenko@gmail.com Cc: aryabinin@virtuozzo.com Cc: catalin.marinas@arm.com Cc: glider@google.com Cc: linux-arm-kernel@lists.infradead.org Cc: parri.andrea@gmail.com Cc: peter@hurleysoftware.com Link: http://lkml.kernel.org/r/20180716113017.3909-6-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit f9881cc43b118efc6f82fef2d121166113ee9f8e Author: Mark Rutland Date: Mon Jul 16 12:30:09 2018 +0100 locking/atomics: Instrument xchg() While we instrument all of the (non-relaxed) atomic_*() functions and cmpxchg(), we missed xchg(). Let's add instrumentation for xchg(), fixing up x86 to implement arch_xchg(). Signed-off-by: Mark Rutland Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Cc: Boqun Feng Cc: Dmitry Vyukov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: andy.shevchenko@gmail.com Cc: arnd@arndb.de Cc: aryabinin@virtuozzo.com Cc: catalin.marinas@arm.com Cc: glider@google.com Cc: linux-arm-kernel@lists.infradead.org Cc: parri.andrea@gmail.com Cc: peter@hurleysoftware.com Link: http://lkml.kernel.org/r/20180716113017.3909-5-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit df79ed2c064363cdc7d2d896923c1885d4e30520 Author: Mark Rutland Date: Mon Jul 16 12:30:08 2018 +0100 locking/atomics: Simplify cmpxchg() instrumentation Currently we define some fairly verbose wrappers for the cmpxchg() family so that we can pass a pointer and size into kasan_check_write(). The wrappers duplicate the size-switching logic necessary in arch code, and only work for scalar types. On some architectures, (cmp)xchg are used on non-scalar types, and thus the instrumented wrappers need to be able to handle this. We could take the type-punning logic from {READ,WRITE}_ONCE(), but this makes the wrappers even more verbose, and requires several local variables in the macros. Instead, let's simplify the wrappers into simple macros which: * snapshot the pointer into a single local variable, called __ai_ptr to avoid conflicts with variables in the scope of the caller. * call kasan_check_write() on __ai_ptr. * invoke the relevant arch_*() function, passing the original arguments, bar __ai_ptr being substituted for ptr. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Cc: Boqun Feng Cc: Dmitry Vyukov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: andy.shevchenko@gmail.com Cc: arnd@arndb.de Cc: aryabinin@virtuozzo.com Cc: catalin.marinas@arm.com Cc: glider@google.com Cc: linux-arm-kernel@lists.infradead.org Cc: parri.andrea@gmail.com Cc: peter@hurleysoftware.com Link: http://lkml.kernel.org/r/20180716113017.3909-4-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 00d5551cc4eec0fc39c3871c25c613553acfb866 Author: Mark Rutland Date: Mon Jul 16 12:30:07 2018 +0100 locking/atomics/x86: Reduce arch_cmpxchg64*() instrumentation Currently x86's arch_cmpxchg64() and arch_cmpxchg64_local() are instrumented twice, as they call into instrumented atomics rather than their arch_ equivalents. A call to cmpxchg64() results in: cmpxchg64() kasan_check_write() arch_cmpxchg64() cmpxchg() kasan_check_write() arch_cmpxchg() Let's fix this up and call the arch_ equivalents, resulting in: cmpxchg64() kasan_check_write() arch_cmpxchg64() arch_cmpxchg() Signed-off-by: Mark Rutland Acked-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Cc: Boqun Feng Cc: Dmitry Vyukov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: andy.shevchenko@gmail.com Cc: arnd@arndb.de Cc: aryabinin@virtuozzo.com Cc: catalin.marinas@arm.com Cc: glider@google.com Cc: linux-arm-kernel@lists.infradead.org Cc: parri.andrea@gmail.com Cc: peter@hurleysoftware.com Link: http://lkml.kernel.org/r/20180716113017.3909-3-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit a38b0ba1b7d2e7a6d19877540240e8a4352fc93c Author: Kan Liang Date: Thu Mar 8 18:15:42 2018 -0800 perf/x86/intel: Support Extended PEBS for Goldmont Plus Enable the extended PEBS for Goldmont Plus. There is no specific PEBS constrains for Goldmont Plus. Removing the pebs_constraints for Goldmont Plus. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: acme@kernel.org Link: http://lkml.kernel.org/r/20180309021542.11374-4-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar commit ec71a398c1bf6d8188cb24ebab6f5202523d95e1 Author: Kan Liang Date: Thu Mar 8 18:15:41 2018 -0800 perf/x86/intel/ds: Handle PEBS overflow for fixed counters The pebs_drain() need to support fixed counters. The DS Save Area now include "counter reset value" fields for each fixed counters. Extend the related variables (e.g. mask, counters, error) to support fixed counters. There is no extended PEBS in PEBS v2 and earlier PEBS format. Only need to change the code for PEBS v3 and later PEBS format. Extend the pebs_event_reset[] logic to support new "counter reset value" fields. Increase the reserve space for fixed counters. Based-on-code-from: Andi Kleen Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: acme@kernel.org Link: http://lkml.kernel.org/r/20180309021542.11374-3-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar commit 4f08b6255adb1e379b4fcc8d304ec1263d465677 Author: Kan Liang Date: Thu Mar 8 18:15:40 2018 -0800 perf/x86/intel: Support PEBS on fixed counters The Extended PEBS feature supports PEBS on fixed-function performance counters as well as all four general purpose counters. It has to change the order of PEBS and fixed counter enabling to make sure PEBS is enabled for the fixed counters. The change of the order doesn't impact the behavior of current code on other platforms which don't support extended PEBS. Because there is no dependency among those enable/disable functions. Don't enable IRQ generation (0x8) for MSR_ARCH_PERFMON_FIXED_CTR_CTRL. The PEBS ucode will handle the interrupt generation. Based-on-code-from: Andi Kleen Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: acme@kernel.org Link: http://lkml.kernel.org/r/20180309021542.11374-2-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar commit 3196234039155a33c80e52d7aa41a29dce9a5c51 Author: Kan Liang Date: Thu Mar 8 18:15:39 2018 -0800 perf/x86/intel: Introduce PMU flag for Extended PEBS The Extended PEBS feature, introduced in the Goldmont Plus microarchitecture, supports all events as "Extended PEBS". Introduce flag PMU_FL_PEBS_ALL to indicate the platforms which support extended PEBS. To support all events, it needs to support all constraints for PEBS. To avoid duplicating all the constraints in the PEBS table, making the PEBS code search the normal constraints too. Based-on-code-from: Andi Kleen Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: acme@kernel.org Link: http://lkml.kernel.org/r/20180309021542.11374-1-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar commit 93081caaaed6a40a4f6d9b7ba3f581a4bb1d4404 Merge: 788faab70d5a 7f635ff187ab Author: Ingo Molnar Date: Wed Jul 25 11:47:02 2018 +0200 Merge branch 'perf/urgent' into perf/core, to pick up fixes Signed-off-by: Ingo Molnar commit b6a60cf36d497e7fbde9dd5b86fabd96850249f6 Author: Srikar Dronamraju Date: Wed Jun 20 22:33:00 2018 +0530 sched/numa: Move task_numa_placement() closer to numa_migrate_preferred() numa_migrate_preferred() is called periodically or when task preferred node changes. Preferred node evaluations happen once per scan sequence. If the scan completion happens just after the periodic NUMA migration, then we try to migrate to the preferred node and the preferred node might change, needing another node migration. Avoid this by checking for scan sequence completion only when checking for periodic migration. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25862.6 26158.1 1.14258 1 74357 72725 -2.19482 Running SPECjbb2005 on a 16 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 8 117019 113992 -2.58 1 179095 174947 -2.31 (numbers from v1 based on v4.17-rc5) Testcase Time: Min Max Avg StdDev numa01.sh Real: 449.46 770.77 615.22 101.70 numa01.sh Sys: 132.72 208.17 170.46 24.96 numa01.sh User: 39185.26 60290.89 50066.76 6807.84 numa02.sh Real: 60.85 61.79 61.28 0.37 numa02.sh Sys: 15.34 24.71 21.08 3.61 numa02.sh User: 5204.41 5249.85 5231.21 17.60 numa03.sh Real: 785.50 916.97 840.77 44.98 numa03.sh Sys: 108.08 133.60 119.43 8.82 numa03.sh User: 61422.86 70919.75 64720.87 3310.61 numa04.sh Real: 429.57 587.37 480.80 57.40 numa04.sh Sys: 240.61 321.97 290.84 33.58 numa04.sh User: 34597.65 40498.99 37079.48 2060.72 numa05.sh Real: 392.09 431.25 414.65 13.82 numa05.sh Sys: 229.41 372.48 297.54 53.14 numa05.sh User: 33390.86 34697.49 34222.43 556.42 Testcase Time: Min Max Avg StdDev %Change numa01.sh Real: 424.63 566.18 498.12 59.26 23.50% numa01.sh Sys: 160.19 256.53 208.98 37.02 -18.4% numa01.sh User: 37320.00 46225.58 42001.57 3482.45 19.20% numa02.sh Real: 60.17 62.47 60.91 0.85 0.607% numa02.sh Sys: 15.30 22.82 17.04 2.90 23.70% numa02.sh User: 5202.13 5255.51 5219.08 20.14 0.232% numa03.sh Real: 823.91 844.89 833.86 8.46 0.828% numa03.sh Sys: 130.69 148.29 140.47 6.21 -14.9% numa03.sh User: 62519.15 64262.20 63613.38 620.05 1.740% numa04.sh Real: 515.30 603.74 548.56 30.93 -12.3% numa04.sh Sys: 459.73 525.48 489.18 21.63 -40.5% numa04.sh User: 40561.96 44919.18 42047.87 1526.85 -11.8% numa05.sh Real: 396.58 454.37 421.13 19.71 -1.53% numa05.sh Sys: 208.72 422.02 348.90 73.60 -14.7% numa05.sh User: 33124.08 36109.35 34846.47 1089.74 -1.79% Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-20-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit f35678b6a17063f3b0d391af5ab8f8c83cf31b0c Author: Srikar Dronamraju Date: Wed Jun 20 22:32:56 2018 +0530 sched/numa: Use group_weights to identify if migration degrades locality On NUMA_BACKPLANE and NUMA_GLUELESS_MESH systems, tasks/memory should be consolidated to the closest group of nodes. In such a case, relying on group_fault metric may not always help to consolidate. There can always be a case where a node closer to the preferred node may have lesser faults than a node further away from the preferred node. In such a case, moving to node with more faults might avoid numa consolidation. Using group_weight would help to consolidate task/memory around the preferred_node. While here, to be on the conservative side, don't override migrate thread degrades locality logic for CPU_NEWLY_IDLE load balancing. Note: Similar problems exist with should_numa_migrate_memory and will be dealt separately. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25645.4 25960 1.22 1 72142 73550 1.95 Running SPECjbb2005 on a 16 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 8 110199 120071 8.958 1 176303 176249 -0.03 (numbers from v1 based on v4.17-rc5) Testcase Time: Min Max Avg StdDev numa01.sh Real: 490.04 774.86 596.26 96.46 numa01.sh Sys: 151.52 242.88 184.82 31.71 numa01.sh User: 41418.41 60844.59 48776.09 6564.27 numa02.sh Real: 60.14 62.94 60.98 1.00 numa02.sh Sys: 16.11 30.77 21.20 5.28 numa02.sh User: 5184.33 5311.09 5228.50 44.24 numa03.sh Real: 790.95 856.35 826.41 24.11 numa03.sh Sys: 114.93 118.85 117.05 1.63 numa03.sh User: 60990.99 64959.28 63470.43 1415.44 numa04.sh Real: 434.37 597.92 504.87 59.70 numa04.sh Sys: 237.63 397.40 289.74 55.98 numa04.sh User: 34854.87 41121.83 38572.52 2615.84 numa05.sh Real: 386.77 448.90 417.22 22.79 numa05.sh Sys: 149.23 379.95 303.04 79.55 numa05.sh User: 32951.76 35959.58 34562.18 1034.05 Testcase Time: Min Max Avg StdDev %Change numa01.sh Real: 493.19 672.88 597.51 59.38 -0.20% numa01.sh Sys: 150.09 245.48 207.76 34.26 -11.0% numa01.sh User: 41928.51 53779.17 48747.06 3901.39 0.059% numa02.sh Real: 60.63 62.87 61.22 0.83 -0.39% numa02.sh Sys: 16.64 27.97 20.25 4.06 4.691% numa02.sh User: 5222.92 5309.60 5254.03 29.98 -0.48% numa03.sh Real: 821.52 902.15 863.60 32.41 -4.30% numa03.sh Sys: 112.04 130.66 118.35 7.08 -1.09% numa03.sh User: 62245.16 69165.14 66443.04 2450.32 -4.47% numa04.sh Real: 414.53 519.57 476.25 37.00 6.009% numa04.sh Sys: 181.84 335.67 280.41 54.07 3.327% numa04.sh User: 33924.50 39115.39 37343.78 1934.26 3.290% numa05.sh Real: 408.30 441.45 417.90 12.05 -0.16% numa05.sh Sys: 233.41 381.60 295.58 57.37 2.523% numa05.sh User: 33301.31 35972.50 34335.19 938.94 0.661% Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mel Gorman Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-16-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 30619c89b17d46808b4cdf5b3f81b6a01ade1473 Author: Srikar Dronamraju Date: Wed Jun 20 22:32:55 2018 +0530 sched/numa: Update the scan period without holding the numa_group lock The metrics for updating scan periods are local or task specific. Currently this update happens under the numa_group lock, which seems unnecessary. Hence move this update outside the lock. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25355.9 25645.4 1.141 1 72812 72142 -0.92 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rik van Riel Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-15-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 2d4056fafa196e1ab4e7161bae4df76f9602d56d Author: Srikar Dronamraju Date: Wed Jun 20 22:32:53 2018 +0530 sched/numa: Remove numa_has_capacity() task_numa_find_cpu() helps to find the CPU to swap/move the task to. It's guarded by numa_has_capacity(). However node not having capacity shouldn't deter a task swapping if it helps NUMA placement. Further load_too_imbalanced(), which evaluates possibilities of move/swap, provides similar checks as numa_has_capacity. Hence remove numa_has_capacity() to enhance possibilities of task swapping even if load is imbalanced. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25657.9 25804.1 0.569 1 74435 73413 -1.37 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rik van Riel Cc: Linus Torvalds Cc: Mel Gorman Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-13-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 0ad4e3dfe6cf3f207e61cbd8e3e4a943f8c1ad20 Author: Srikar Dronamraju Date: Wed Jun 20 22:32:50 2018 +0530 sched/numa: Modify migrate_swap() to accept additional parameters There are checks in migrate_swap_stop() that check if the task/CPU combination is as per migrate_swap_arg before migrating. However atleast one of the two tasks to be swapped by migrate_swap() could have migrated to a completely different CPU before updating the migrate_swap_arg. The new CPU where the task is currently running could be a different node too. If the task has migrated, numa balancer might end up placing a task in a wrong node. Instead of achieving node consolidation, it may end up spreading the load across nodes. To avoid that pass the CPUs as additional parameters. While here, place migrate_swap under CONFIG_NUMA_BALANCING. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25377.3 25226.6 -0.59 1 72287 73326 1.437 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rik van Riel Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-10-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 10864a9e222048a862da2c21efa28929a4dfed15 Author: Srikar Dronamraju Date: Wed Jun 20 22:32:49 2018 +0530 sched/numa: Remove unused task_capacity from 'struct numa_stats' The task_capacity field in 'struct numa_stats' is redundant. Also move nr_running for better packing within the struct. No functional changes. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25308.6 25377.3 0.271 1 72964 72287 -0.92 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mel Gorman Acked-by: Rik van Riel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-9-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 0ee7e74dc0dc64d9900751d03c5c22dfdd173fb8 Author: Srikar Dronamraju Date: Wed Jun 20 22:32:48 2018 +0530 sched/numa: Skip nodes that are at 'hoplimit' When comparing two nodes at a distance of 'hoplimit', we should consider nodes only up to 'hoplimit'. Currently we also consider nodes at 'oplimit' distance too. Hence two nodes at a distance of 'hoplimit' will have same groupweight. Fix this by skipping nodes at hoplimit. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25375.3 25308.6 -0.26 1 72617 72964 0.477 Running SPECjbb2005 on a 16 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 8 113372 108750 -4.07684 1 177403 183115 3.21979 (numbers from v1 based on v4.17-rc5) Testcase Time: Min Max Avg StdDev numa01.sh Real: 478.45 565.90 515.11 30.87 numa01.sh Sys: 207.79 271.04 232.94 21.33 numa01.sh User: 39763.93 47303.12 43210.73 2644.86 numa02.sh Real: 60.00 61.46 60.78 0.49 numa02.sh Sys: 15.71 25.31 20.69 3.42 numa02.sh User: 5175.92 5265.86 5235.97 32.82 numa03.sh Real: 776.42 834.85 806.01 23.22 numa03.sh Sys: 114.43 128.75 121.65 5.49 numa03.sh User: 60773.93 64855.25 62616.91 1576.39 numa04.sh Real: 456.93 511.95 482.91 20.88 numa04.sh Sys: 178.09 460.89 356.86 94.58 numa04.sh User: 36312.09 42553.24 39623.21 2247.96 numa05.sh Real: 393.98 493.48 436.61 35.59 numa05.sh Sys: 164.49 329.15 265.87 61.78 numa05.sh User: 33182.65 36654.53 35074.51 1187.71 Testcase Time: Min Max Avg StdDev %Change numa01.sh Real: 414.64 819.20 556.08 147.70 -7.36% numa01.sh Sys: 77.52 205.04 139.40 52.05 67.10% numa01.sh User: 37043.24 61757.88 45517.48 9290.38 -5.06% numa02.sh Real: 60.80 63.32 61.63 0.88 -1.37% numa02.sh Sys: 17.35 39.37 25.71 7.33 -19.5% numa02.sh User: 5213.79 5374.73 5268.90 55.09 -0.62% numa03.sh Real: 780.09 948.64 831.43 63.02 -3.05% numa03.sh Sys: 104.96 136.92 116.31 11.34 4.591% numa03.sh User: 60465.42 73339.78 64368.03 4700.14 -2.72% numa04.sh Real: 412.60 681.92 521.29 96.64 -7.36% numa04.sh Sys: 210.32 314.10 251.77 37.71 41.74% numa04.sh User: 34026.38 45581.20 38534.49 4198.53 2.825% numa05.sh Real: 394.79 439.63 411.35 16.87 6.140% numa05.sh Sys: 238.32 330.09 292.31 38.32 -9.04% numa05.sh User: 33456.45 34876.07 34138.62 609.45 2.741% While there is a regression with this change, this change is needed from a correctness perspective. Also it helps consolidation as seen from perf bench output. Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rik van Riel Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-8-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 67d9f6c256cd66e15f85c92670f52a7ad4689cff Author: Srikar Dronamraju Date: Wed Jun 20 22:32:47 2018 +0530 sched/debug: Reverse the order of printing faults Fix the order in which the private and shared numa faults are getting printed. No functional changes. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25215.7 25375.3 0.63 1 72107 72617 0.70 Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rik van Riel Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-7-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit f03bb6760b8e5e2bcecc88d2a2ef41c09adcab39 Author: Srikar Dronamraju Date: Wed Jun 20 22:32:46 2018 +0530 sched/numa: Use task faults only if numa_group is not yet set up When numa_group faults are available, task_numa_placement only uses numa_group faults to evaluate preferred node. However it still accounts task faults and even evaluates the preferred node just based on task faults just to discard it in favour of preferred node chosen on the basis of numa_group. Instead use task faults only if numa_group is not set. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25549.6 25215.7 -1.30 1 73190 72107 -1.47 Running SPECjbb2005 on a 16 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 8 113437 113372 -0.05 1 196130 177403 -9.54 (numbers from v1 based on v4.17-rc5) Testcase Time: Min Max Avg StdDev numa01.sh Real: 506.35 794.46 599.06 104.26 numa01.sh Sys: 150.37 223.56 195.99 24.94 numa01.sh User: 43450.69 61752.04 49281.50 6635.33 numa02.sh Real: 60.33 62.40 61.31 0.90 numa02.sh Sys: 18.12 31.66 24.28 5.89 numa02.sh User: 5203.91 5325.32 5260.29 49.98 numa03.sh Real: 696.47 853.62 745.80 57.28 numa03.sh Sys: 85.68 123.71 97.89 13.48 numa03.sh User: 55978.45 66418.63 59254.94 3737.97 numa04.sh Real: 444.05 514.83 497.06 26.85 numa04.sh Sys: 230.39 375.79 316.23 48.58 numa04.sh User: 35403.12 41004.10 39720.80 2163.08 numa05.sh Real: 423.09 460.41 439.57 13.92 numa05.sh Sys: 287.38 480.15 369.37 68.52 numa05.sh User: 34732.12 38016.80 36255.85 1070.51 Testcase Time: Min Max Avg StdDev %Change numa01.sh Real: 478.45 565.90 515.11 30.87 16.29% numa01.sh Sys: 207.79 271.04 232.94 21.33 -15.8% numa01.sh User: 39763.93 47303.12 43210.73 2644.86 14.04% numa02.sh Real: 60.00 61.46 60.78 0.49 0.871% numa02.sh Sys: 15.71 25.31 20.69 3.42 17.35% numa02.sh User: 5175.92 5265.86 5235.97 32.82 0.464% numa03.sh Real: 776.42 834.85 806.01 23.22 -7.47% numa03.sh Sys: 114.43 128.75 121.65 5.49 -19.5% numa03.sh User: 60773.93 64855.25 62616.91 1576.39 -5.36% numa04.sh Real: 456.93 511.95 482.91 20.88 2.930% numa04.sh Sys: 178.09 460.89 356.86 94.58 -11.3% numa04.sh User: 36312.09 42553.24 39623.21 2247.96 0.246% numa05.sh Real: 393.98 493.48 436.61 35.59 0.677% numa05.sh Sys: 164.49 329.15 265.87 61.78 38.92% numa05.sh User: 33182.65 36654.53 35074.51 1187.71 3.368% Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-6-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 8cd45eee43bd46b933158b25aa7c742e0f3e811f Author: Srikar Dronamraju Date: Wed Jun 20 22:32:45 2018 +0530 sched/numa: Set preferred_node based on best_cpu Currently preferred node is set to dst_nid which is the last node in the iteration whose group weight or task weight is greater than the current node. However it doesn't guarantee that dst_nid has the numa capacity to move. It also doesn't guarantee that dst_nid has the best_cpu which is the CPU/node ideal for node migration. Lets consider faults on a 4 node system with group weight numbers in different nodes being in 0 < 1 < 2 < 3 proportion. Consider the task is running on 3 and 0 is its preferred node but its capacity is full. Consider nodes 1, 2 and 3 have capacity. Then the task should be migrated to node 1. Currently the task gets moved to node 2. env.dst_nid points to the last node whose faults were greater than current node. Modify to set the preferred node based of best_cpu. Earlier setting preferred node was skipped if nr_active_nodes is 1. This could result in the task being moved out of the preferred node to a random node during regular load balancing. Also while modifying task_numa_migrate(), use sched_setnuma to set preferred node. This ensures out numa accounting is correct. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25122.9 25549.6 1.698 1 73850 73190 -0.89 Running SPECjbb2005 on a 16 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 8 105930 113437 7.08676 1 178624 196130 9.80047 (numbers from v1 based on v4.17-rc5) Testcase Time: Min Max Avg StdDev numa01.sh Real: 435.78 653.81 534.58 83.20 numa01.sh Sys: 121.93 187.18 145.90 23.47 numa01.sh User: 37082.81 51402.80 43647.60 5409.75 numa02.sh Real: 60.64 61.63 61.19 0.40 numa02.sh Sys: 14.72 25.68 19.06 4.03 numa02.sh User: 5210.95 5266.69 5233.30 20.82 numa03.sh Real: 746.51 808.24 780.36 23.88 numa03.sh Sys: 97.26 108.48 105.07 4.28 numa03.sh User: 58956.30 61397.05 60162.95 1050.82 numa04.sh Real: 465.97 519.27 484.81 19.62 numa04.sh Sys: 304.43 359.08 334.68 20.64 numa04.sh User: 37544.16 41186.15 39262.44 1314.91 numa05.sh Real: 411.57 457.20 433.29 16.58 numa05.sh Sys: 230.05 435.48 339.95 67.58 numa05.sh User: 33325.54 36896.31 35637.84 1222.64 Testcase Time: Min Max Avg StdDev %Change numa01.sh Real: 506.35 794.46 599.06 104.26 -10.76% numa01.sh Sys: 150.37 223.56 195.99 24.94 -25.55% numa01.sh User: 43450.69 61752.04 49281.50 6635.33 -11.43% numa02.sh Real: 60.33 62.40 61.31 0.90 -0.195% numa02.sh Sys: 18.12 31.66 24.28 5.89 -21.49% numa02.sh User: 5203.91 5325.32 5260.29 49.98 -0.513% numa03.sh Real: 696.47 853.62 745.80 57.28 4.6339% numa03.sh Sys: 85.68 123.71 97.89 13.48 7.3347% numa03.sh User: 55978.45 66418.63 59254.94 3737.97 1.5323% numa04.sh Real: 444.05 514.83 497.06 26.85 -2.464% numa04.sh Sys: 230.39 375.79 316.23 48.58 5.8343% numa04.sh User: 35403.12 41004.10 39720.80 2163.08 -1.153% numa05.sh Real: 423.09 460.41 439.57 13.92 -1.428% numa05.sh Sys: 287.38 480.15 369.37 68.52 -7.964% numa05.sh User: 34732.12 38016.80 36255.85 1070.51 -1.704% Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-5-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 5f95ba7a43057f28a349ea1f03ee8d04e0f445ea Author: Srikar Dronamraju Date: Wed Jun 20 22:32:44 2018 +0530 sched/numa: Simplify load_too_imbalanced() Currently load_too_imbalance() cares about the slope of imbalance. It doesn't care of the direction of the imbalance. However this may not work if nodes that are being compared have dissimilar capacities. Few nodes might have more cores than other nodes in the system. Also unlike traditional load balance at a NUMA sched domain, multiple requests to migrate from the same source node to same destination node may run in parallel. This can cause huge load imbalance. This is specially true on a larger machines with either large cores per node or more number of nodes in the system. Hence allow move/swap only if the imbalance is going to reduce. Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25058.2 25122.9 0.25 1 72950 73850 1.23 (numbers from v1 based on v4.17-rc5) Testcase Time: Min Max Avg StdDev numa01.sh Real: 516.14 892.41 739.84 151.32 numa01.sh Sys: 153.16 192.99 177.70 14.58 numa01.sh User: 39821.04 69528.92 57193.87 10989.48 numa02.sh Real: 60.91 62.35 61.58 0.63 numa02.sh Sys: 16.47 26.16 21.20 3.85 numa02.sh User: 5227.58 5309.61 5265.17 31.04 numa03.sh Real: 739.07 917.73 795.75 64.45 numa03.sh Sys: 94.46 136.08 109.48 14.58 numa03.sh User: 57478.56 72014.09 61764.48 5343.69 numa04.sh Real: 442.61 715.43 530.31 96.12 numa04.sh Sys: 224.90 348.63 285.61 48.83 numa04.sh User: 35836.84 47522.47 40235.41 3985.26 numa05.sh Real: 386.13 489.17 434.94 43.59 numa05.sh Sys: 144.29 438.56 278.80 105.78 numa05.sh User: 33255.86 36890.82 34879.31 1641.98 Testcase Time: Min Max Avg StdDev %Change numa01.sh Real: 435.78 653.81 534.58 83.20 38.39% numa01.sh Sys: 121.93 187.18 145.90 23.47 21.79% numa01.sh User: 37082.81 51402.80 43647.60 5409.75 31.03% numa02.sh Real: 60.64 61.63 61.19 0.40 0.637% numa02.sh Sys: 14.72 25.68 19.06 4.03 11.22% numa02.sh User: 5210.95 5266.69 5233.30 20.82 0.608% numa03.sh Real: 746.51 808.24 780.36 23.88 1.972% numa03.sh Sys: 97.26 108.48 105.07 4.28 4.197% numa03.sh User: 58956.30 61397.05 60162.95 1050.82 2.661% numa04.sh Real: 465.97 519.27 484.81 19.62 9.385% numa04.sh Sys: 304.43 359.08 334.68 20.64 -14.6% numa04.sh User: 37544.16 41186.15 39262.44 1314.91 2.478% numa05.sh Real: 411.57 457.20 433.29 16.58 0.380% numa05.sh Sys: 230.05 435.48 339.95 67.58 -17.9% numa05.sh User: 33325.54 36896.31 35637.84 1222.64 -2.12% Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rik van Riel Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-4-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 305c1fac3225dfa7eeb89bfe91b7335a6edd5172 Author: Srikar Dronamraju Date: Wed Jun 20 22:32:43 2018 +0530 sched/numa: Evaluate move once per node task_numa_compare() helps choose the best CPU to move or swap the selected task. To achieve this task_numa_compare() is called for every CPU in the node. Currently it evaluates if the task can be moved/swapped for each of the CPUs. However the move evaluation is mostly independent of the CPU. Evaluating the move logic once per node, provides scope for simplifying task_numa_compare(). Running SPECjbb2005 on a 4 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 16 25705.2 25058.2 -2.51 1 74433 72950 -1.99 Running SPECjbb2005 on a 16 node machine and comparing bops/JVM JVMS LAST_PATCH WITH_PATCH %CHANGE 8 96589.6 105930 9.670 1 181830 178624 -1.76 (numbers from v1 based on v4.17-rc5) Testcase Time: Min Max Avg StdDev numa01.sh Real: 440.65 941.32 758.98 189.17 numa01.sh Sys: 183.48 320.07 258.42 50.09 numa01.sh User: 37384.65 71818.14 60302.51 13798.96 numa02.sh Real: 61.24 65.35 62.49 1.49 numa02.sh Sys: 16.83 24.18 21.40 2.60 numa02.sh User: 5219.59 5356.34 5264.03 49.07 numa03.sh Real: 822.04 912.40 873.55 37.35 numa03.sh Sys: 118.80 140.94 132.90 7.60 numa03.sh User: 62485.19 70025.01 67208.33 2967.10 numa04.sh Real: 690.66 872.12 778.49 65.44 numa04.sh Sys: 459.26 563.03 494.03 42.39 numa04.sh User: 51116.44 70527.20 58849.44 8461.28 numa05.sh Real: 418.37 562.28 525.77 54.27 numa05.sh Sys: 299.45 481.00 392.49 64.27 numa05.sh User: 34115.09 41324.02 39105.30 2627.68 Testcase Time: Min Max Avg StdDev %Change numa01.sh Real: 516.14 892.41 739.84 151.32 2.587% numa01.sh Sys: 153.16 192.99 177.70 14.58 45.42% numa01.sh User: 39821.04 69528.92 57193.87 10989.48 5.435% numa02.sh Real: 60.91 62.35 61.58 0.63 1.477% numa02.sh Sys: 16.47 26.16 21.20 3.85 0.943% numa02.sh User: 5227.58 5309.61 5265.17 31.04 -0.02% numa03.sh Real: 739.07 917.73 795.75 64.45 9.776% numa03.sh Sys: 94.46 136.08 109.48 14.58 21.39% numa03.sh User: 57478.56 72014.09 61764.48 5343.69 8.813% numa04.sh Real: 442.61 715.43 530.31 96.12 46.79% numa04.sh Sys: 224.90 348.63 285.61 48.83 72.97% numa04.sh User: 35836.84 47522.47 40235.41 3985.26 46.26% numa05.sh Real: 386.13 489.17 434.94 43.59 20.88% numa05.sh Sys: 144.29 438.56 278.80 105.78 40.77% numa05.sh User: 33255.86 36890.82 34879.31 1641.98 12.11% Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-3-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 6e30396767508101eacec8b93b068e8905e660dc Author: Srikar Dronamraju Date: Wed Jun 20 22:32:42 2018 +0530 sched/numa: Remove redundant field 'numa_entry' is a struct list_head defined in task_struct, but never used. No functional change. Signed-off-by: Srikar Dronamraju Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rik van Riel Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1529514181-9842-2-git-send-email-srikar@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 3d6c50c27bd6418dceb51642540ecfcb8ca708c2 Author: Yun Wang Date: Wed Jul 4 11:27:27 2018 +0800 sched/debug: Show the sum wait time of a task group Although we can rely on cpuacct to present the CPU usage of task groups, it is hard to tell how intense the competition is between these groups on CPU resources. Monitoring the wait time or sched_debug of each process could be very expensive, and there is no good way to accurately represent the conflict with these info, we need the wait time on group dimension. Thus we introduce group's wait_sum to represent the resource conflict between task groups, which is simply the sum of the wait time of the group's cfs_rq. The 'cpu.stat' is modified to show the statistic, like: nr_periods 0 nr_throttled 0 throttled_time 0 wait_sum 2035098795584 Now we can monitor the changes of wait_sum to tell how much a a task group is suffering in the fight of CPU resources. For example: (wait_sum - last_wait_sum) * 100 / (nr_cpu * period_ns) == X% means the task group paid X percentage of period on waiting for the CPU. Signed-off-by: Michael Wang Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/ff7dae3b-e5f9-7157-1caa-ff02c6b23dc1@linux.alibaba.com Signed-off-by: Ingo Molnar commit 2e62c4743adc4c7bfcbc1f45118fc7bec58cf30a Author: Vincent Guittot Date: Thu Jul 19 14:00:06 2018 +0200 sched/fair: Remove #ifdefs from scale_rt_capacity() Reuse cpu_util_irq() that has been defined for schedutil and set irq util to 0 when !CONFIG_IRQ_TIME_ACCOUNTING. But the compiler is not able to optimize the sequence (at least with aarch64 GCC 7.2.1): free *= (max - irq); free /= max; when irq is fixed to 0 Add a new inline function scale_irq_capacity() that will scale utilization when irq is accounted. Reuse this funciton in schedutil which applies similar formula. Suggested-by: Ingo Molnar Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Acked-by: Viresh Kumar Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: rjw@rjwysocki.net Link: http://lkml.kernel.org/r/1532001606-6689-1-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 4765096f4f7829d933354ddffedfad32cf063467 Merge: af0fffd9300b f3d133ee0a17 Author: Ingo Molnar Date: Wed Jul 25 11:29:58 2018 +0200 Merge branch 'sched/urgent' into sched/core, to pick up fixes Signed-off-by: Ingo Molnar commit 190bd6e98afc512fb16d4a471acd488e36141637 Author: Masayoshi Mizuma Date: Tue Jul 24 15:02:13 2018 -0400 EDAC, sb_edac: Add support for systems with segmented PCI buses Extend the driver to check whether segment number and bus number matches when deciding how to group memory controller PCI devices to CPU sockets. Signed-off-by: Masayoshi Mizuma Reviewed-by: Tony Luck Cc: Mauro Carvalho Chehab Cc: linux-edac Link: http://lkml.kernel.org/r/20180724190213.26359-1-msys.mizuma@gmail.com [ Cleanup commit message. ] Signed-off-by: Borislav Petkov commit 2d8ff0b586fb1c5bd81a3ab286dcc6bbc432044e Author: Mika Westerberg Date: Wed Jul 25 11:48:39 2018 +0300 thunderbolt: Add support for runtime PM When Thunderbolt host controller is set to RTD3 mode (Runtime D3) it is present all the time. Because of this it is important to runtime suspend the controller whenever possible. In case of ICM we have following rules which all needs to be true before the host controller can be put to D3: - The controller firmware reports to support RTD3 - All the connected devices announce support for RTD3 - There is no active XDomain connection Implement this using standard Linux runtime PM APIs so that when all the children devices are runtime suspended, the Thunderbolt host controller PCI device is runtime suspended as well. The ICM firmware then starts powering down power domains towards RTD3 but it can prevent this if it detects that there is an active Display Port stream (this is not visible to the software, though). The Thunderbolt host controller will be runtime resumed either when there is a remote wake event (device is connected or disconnected), or when there is access from userspace that requires hardware access. Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit fa3af1cb1ec073265c9c87ec44faf006f2f12d96 Author: Colin Ian King Date: Wed Jul 25 11:03:21 2018 +0300 thunderbolt: Remove redundant variable 'approved' Variable 'approved' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'approved' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit d04522fa08905907d2b5ccf28b7793353646754b Author: Mika Westerberg Date: Wed Jul 25 11:03:19 2018 +0300 thunderbolt: Use correct ICM commands in system suspend The correct way to put the ICM into suspend state is to send it NHI_MAILBOX_DRV_UNLOADS mailbox command. NHI_MAILBOX_SAVE_DEVS is not needed on Intel Titan Ridge so we can skip it. Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit 84db68587651d453a9b5e901c787a49866e34b1e Author: Mika Westerberg Date: Wed Jul 25 11:03:18 2018 +0300 thunderbolt: No need to take tb->lock in domain suspend/complete If the connection manager implementation needs to touch the domain structures it ought to take the lock itself. Currently only ICM implements these hooks and it does not need the lock because we there will be no notifications before driver ready message is sent to it. Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit fdd92e89a492142a113f270dcd7e490805922b71 Author: Mika Westerberg Date: Wed Jul 25 11:03:17 2018 +0300 thunderbolt: Do not unnecessarily call ICM get route This command is not really fast and can make resume time slower. We only need to get route again if the link was changed and during initial device connected message. Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit dba3caf6210397635714c7f46129d8c0c9af2512 Author: Mika Westerberg Date: Wed Jul 25 11:03:16 2018 +0300 thunderbolt: Use 64-bit DMA mask if supported by the platform PCI defaults to 32-bit DMA mask but this device is capable of full 64-bit addressing, so make sure we first try 64-bit DMA mask before falling back to the default 32-bit. Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit c356915ebc9ddb8303feeab1e3465170285558b5 Author: Nathan Ciobanu Date: Wed Jul 25 11:03:15 2018 +0300 thunderbolt: Fix small typo in variable name Fixes small variable name typo and the associated checkpatch spelling warning. Signed-off-by: Nathan Ciobanu Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman commit 3ceefa3ffd17daacef3e09f895f67721fb1f6b79 Merge: 4a965c5f89de c5b974bee9d2 Author: Greg Kroah-Hartman Date: Wed Jul 25 10:12:07 2018 +0200 Merge tag 'iio-for-4.19b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of IIO new device support, features and cleanups. There are also a couple of fixes that can wait for the coming merge window. Core new features * Support for phase channels (used in time of flight sensors amongst other things) * Support for deep UV light channel modifier. New Device Support * AD4758 DAC - New driver and dt bindings. * adxl345 - Support the adxl375 +-200g part which is register compatible. * isl29501 Time of flight sensor. - New driver * meson-saradc - Support the Meson8m2 Socs - right now this is just an ID, but there will be additional difference in future. * mpu6050 - New ID for 6515 variant. * si1133 UV sensor. - New driver * Spreadtrum SC27xx PMIC ADC - New driver and dt bindings. Features * adxl345 - Add calibration offset readback and writing. - Add sampling frequency control. Fixes and Cleanups * ad5933 - Use a macro for the channel definition to reduce duplication. * ad9523 - Replace use of core mlock with a local lock. Part of ongoing efforts to avoid confusing the purpose of mlock which is only about iio core state changes. - Fix displayed phase which was out by a factor of 10. * adxl345 - Add a link to the datasheet. - Rework the use of the address field in the chan_spec structures to allow addition of more per channel information. * adis imu - Mark switch fall throughs. * at91-sama5d2 - Fix some casting on big endian systems. * bmp280 - Drop some DT elements that aren't used and should mostly be done from userspace rather than in DT. * hx711 - add clock-frequency dt binding and resulting delay to deal with capacitance issue on some boards. - fix a spurious unit-address in the example. * ina2xx - Avoid a possible kthread_stop with a stale task_struct. * ltc2632 - Remove some unused local variables (assigned but value never used). * max1363 - Use device_get_match_data to remove some boilerplate. * mma8452 - Mark switch fall throughs. * sca3000 - Fix a missing return in a switch statement (a bad fallthrough previously!) * sigma-delta-modulator - Drop incorrect unit address from the DT example. * st_accel - Use device_get_match_data to drop some boiler plate. - Move to probe_new for i2c driver as second parameter not used. * st_sensors library - Use a strlcpy (safe in this case). * st_lsm6dsx - Add some error logging. * ti-ads7950 - SPDX - Allow simultaneous buffered and polled reads. Needed on a Lego Mindstorms EV3 where some channels are used for power supply monitoring at a very low rate. * ti-dac5571 - Remove an unused variable. * xadc - Drop some dead code. commit 633786736ed53a53b8d0a630cc3ff57381027081 Author: Daniel Thompson Date: Wed Jul 25 08:38:30 2018 +0100 backlight: pwm_bl: Fix uninitialized variable Currently, if the DT does not define num-interpolated-steps then num_steps is undefined and the interpolation code will deploy randomly. Fix with a simple initialize to zero. Fixes: 573fe6d1c25c ("backlight: pwm_bl: Linear interpolation between brightness-levels") Reported-by: Marcel Ziswiler Signed-off-by: Daniel Thompson Tested-by: Marcel Ziswiler Reviewed-by: Douglas Anderson Signed-off-by: Lee Jones commit 2450ceaf21798183f51bfdbd7d314635dbb62f4c Author: Benjamin Herrenschmidt Date: Tue Jul 24 14:24:02 2018 +1000 ARM: dts: aspeed: Add coprocessor interrupt controller Add a node for the CVIC (the coprocessor interrupt controller) and add a label to the SRAM node so it can be referenced from the board device-tree file. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Joel Stanley commit bf9b608e63dfd71ab225c9d4211eb6d8dc582a3b Merge: aea5f654e6b7 f0eea2772a6b Author: Kalle Valo Date: Wed Jul 25 10:50:54 2018 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for 4.19. Major changes: wcn36xx * fix WEP in client mode wil6210 * add support for Talyn-MB (Talyn ver 2.0) device * add support for enhanced DMA firmware feature commit a2b3bf4846e5eed62ea6abb096af2c950961033c Author: Alan Chiang Date: Wed Jul 25 11:20:22 2018 +0800 eeprom: at24: Add support for address-width property Provide a flexible way to determine the addressing bits of eeprom. Pass the addressing bits to driver through address-width property. Signed-off-by: Alan Chiang Signed-off-by: Andy Yeh Signed-off-by: Bartosz Golaszewski commit 21d04054501fb27b56e995b54ac74e39aee79a46 Author: Alan Chiang Date: Wed Jul 25 11:20:21 2018 +0800 dt-bindings: at24: Add address-width property Currently the only way to use a variant of a supported model with a different address width is to define a new compatible string and the corresponding chip data structure. Provide a flexible way to specify the size of the address pointer by defining a new property: address-width. Signed-off-by: Alan Chiang Signed-off-by: Andy Yeh Acked-by: Sakari Ailus Reviewed-by: Rob Herring [Bartosz: fixed the commit message] Signed-off-by: Bartosz Golaszewski commit 0fbe9a245c60bedebb6dd329966f463bb724450a Author: Masahiro Yamada Date: Tue Jul 3 10:22:01 2018 +0900 microblaze: add endianness options to LDFLAGS instead of LD With the recent syntax extension, Kconfig is now able to evaluate the compiler / toolchain capability. However, accumulating flags to 'LD' is not compatible with the way it works; 'LD' must be passed to Kconfig to call $(ld-option,...) from Kconfig files. If you tweak 'LD' in arch Makefile depending on CONFIG_CPU_BIG_ENDIAN, this would end up with circular dependency between Makefile and Kconfig. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek commit 6eedfaac712d7a1ebcfa34085fbae91f19d33bf3 Author: Martin Schwidefsky Date: Tue Jul 24 08:23:29 2018 +0200 s390: reenable gcc plugins Now that the early boot rework is upstream we can enable the gcc plugins again. See git commit 72f108b308707f21499e0ac05bf7370360cf06d8 "s390: disable gcc plugins" for reference. Signed-off-by: Martin Schwidefsky commit 2a6777a118406858ad02bce8e4dc8302cba5a290 Author: Martin Schwidefsky Date: Tue Jul 24 07:55:18 2018 +0200 s390: disable gcc plugins The s390 build currently fails with the latent entropy plugin: arch/s390/kernel/als.o: In function `verify_facilities': als.c:(.init.text+0x24): undefined reference to `latent_entropy' als.c:(.init.text+0xae): undefined reference to `latent_entropy' make[3]: *** [arch/s390/boot/compressed/vmlinux] Error 1 make[2]: *** [arch/s390/boot/compressed/vmlinux] Error 2 make[1]: *** [bzImage] Error 2 This will be fixed with the early boot rework from Vasily, which is planned for the 4.19 merge window. For 4.18 the simplest solution is to disable the gcc plugins and reenable them after the early boot rework is upstream. Reported-by: Guenter Roeck Signed-off-by: Martin Schwidefsky (cherry picked from commit 2fba3573f1cf876ad94992c256c5c410039e60b4) commit b0ddc9106cdec156aa9eea4a76e7d468b8ce829e Author: Joel Stanley Date: Wed Jul 18 23:23:02 2018 +0930 ARM: config: multi_v5: Enable ASPEED drivers This enables the devices used in the AST2400 family of BMC SoCs: - VUART - SPI NOR - LPC controller - LPC snoop (port 80) - Ethernet - GPIO - ADC - I2C - Random number generator - IPMI KCS - IPMI BT - Fan/Tach Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit fc2a325bbc9a37c9e2898acc7eb7d7cd6904b121 Author: Joel Stanley Date: Wed Jul 18 23:23:01 2018 +0930 ARM: config: multi_v5: Refresh configuration This is the result of a make mutli_v5_defconfig && make savedefconfig. Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 20c90af9ea6a6fd650e1e0961a84926603f18079 Author: Joel Stanley Date: Wed Jul 18 23:23:00 2018 +0930 ARM: config: aspeed: Update defconfig - Enable new support: hardware random number generator FSI and client drivers DRM GFX driver - Disable unwanted features: ARM_APPENDED_DTB ARM_ATAG_DTB_COMPAT BLK_DEV_RAM - Sync G4 and G5 with OpenBMC configurations BLK_DEV_LOOP, for updater mechanic CRYPTO_HMAC, for libsdbus features CRYPTO_SHA256 CRYPTO_USER_API_HASH - Enable security related features: SLAB_FREELIST_RANDOM STRICT_KERNEL_RW CC_STACKPROTECTOR_STRONG HARDENED_USERCOPY FORTIFY_SOURCE - Increase kernel log buffer size Reviewed-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 375cac70100b58ce8f4737ec530bfbdcb3086964 Author: Benjamin Herrenschmidt Date: Wed Jul 25 14:57:21 2018 +1000 fsi: master-ast-cf: Mask unused bits in RTAG/RCRC Then reading the RTAG/RCRC "registers" from the coprocessor after a command is complete, mask out the top bits, only keep the relevant bits. Microcode v5 will leave garbage in those top bits as a result of a performance optimization. Signed-off-by: Benjamin Herrenschmidt --- commit e66565f3bee141748d2c3b2ed0d4ecd455f634fa Author: Jeremy Cline Date: Tue Jul 24 15:53:34 2018 -0400 bpf: Add Python 3 support to selftests scripts for bpf Adjust tcp_client.py and tcp_server.py to work with Python 3 by using the print function, marking string literals as bytes, and using the newer exception syntax. This should be functionally equivalent and supports Python 3+. Signed-off-by: Jeremy Cline Signed-off-by: Daniel Borkmann commit 2cc512c1fa1ee99879d55d1cb4e3fd0e6eab35b3 Author: YueHaibing Date: Tue Jul 24 10:55:24 2018 +0800 bpf: btf: fix inconsistent IS_ERR and PTR_ERR Fix inconsistent IS_ERR and PTR_ERR in get_btf, the proper pointer to be passed as argument is '*btf' This issue was detected with the help of Coccinelle. Fixes: 2d3feca8c44f ("bpf: btf: print map dump and lookup with btf info") Signed-off-by: YueHaibing Acked-by: David S. Miller Acked-by: Jakub Kicinski Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 19725496da5602b401eae389736ab00d1817e264 Merge: aea5f654e6b7 9981b4fb8684 Author: David S. Miller Date: Tue Jul 24 19:21:58 2018 -0700 Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net commit 0316b05311e777f8044c72a88b966ebae7c7a39f Author: Mathias Kresin Date: Fri Jul 20 13:58:25 2018 +0200 MIPS: ath79: get PCIe controller out of reset The ar724x pci driver expects the PCIe controller to be brought out of reset by the bootloader. At least the AVM Fritz 300E bootloader doesn't take care of releasing the different PCIe controller related resets which causes an endless hang as soon as either the PCIE Reset register (0x180f0018) or the PCI Application Control register (0x180f0000) is read from. Do the full "PCIE Root Complex Initialization Sequence" if the PCIe host controller is still in reset during probing. The QCA u-boot sleeps 10ms after the PCIE Application Control bit is set to ready. It has been shown that 10ms might not be enough time if PCIe should be used right after setting the bit. During my tests it took up to 20ms till the link was up. Giving the link up to 100ms should work for all cases. Signed-off-by: Mathias Kresin Signed-off-by: John Crispin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19916/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit ffc2058189223a2625ff55dfe1676df86ed03ee3 Author: Gabor Juhos Date: Fri Jul 20 13:58:24 2018 +0200 MIPS: ath79: enable uart during early_prink This patch ensures, that the pinmux register is properly setup for the boot console UART when early_printk is enabled. [paul.burton@mips.com: - s/poinmux/pinmux/ - s/uart/UART/ - Drop extraneous parentheses.] Signed-off-by: Gabor Juhos Signed-off-by: John Crispin Signed-off-by: Paul Burton Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit e16343708eec32cb331f6c0dc71e5c52af741385 Author: Felix Fietkau Date: Fri Jul 20 13:58:23 2018 +0200 MIPS: ath79: finetune cpu-overrides This patch adds a few additional cpu feature overrides so that they do not need to be probed at runtime. Signed-off-by: Felix Fietkau Signed-off-by: John Crispin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19914/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit f8a7bfe1cb2c1ebfa07775c9c8ac0ad3ba8e5ff5 Author: Felix Fietkau Date: Fri Jul 20 13:58:22 2018 +0200 MIPS: ath79: fix system restart This patch disables irq on reboot to fix hang issues that were observed due to pending interrupts. Signed-off-by: Felix Fietkau Signed-off-by: John Crispin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19913/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit a08227a206b8df79c2a6dd7f62796ccf35c578de Author: John Crispin Date: Fri Jul 20 13:58:20 2018 +0200 MIPS: ath79: select the PINCTRL subsystem The pinmux on QCA SoCs is controlled by a single register. The "pinctrl-single" driver can be used but requires the target to select PINCTRL. Signed-off-by: John Crispin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19909/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit af2d1b521bfbc57560e63602575265c0e0f62f04 Author: Matthias Schiffer Date: Fri Jul 20 13:58:19 2018 +0200 MIPS: ath79: add support for QCA953x QCA956x TP9343 This patch adds support for 2 new types of QCA silicon. TP9343 is essentially the same as the QCA956X but is licensed by TPLink. Signed-off-by: Weijie Gao Signed-off-by: Matthias Schiffer Signed-off-by: John Crispin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19911/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit a95f4b1c28932ca4194d81db60ecdf59152bb808 Author: Gabor Juhos Date: Fri Jul 20 13:58:18 2018 +0200 MIPS: ath79: add lots of missing registers This patch adds many new registers for various QCA MIPS SoCs. The patch is an aggragate of many contributions made to OpenWrt. Signed-off-by: Gabor Juhos Signed-off-by: Henryk Heisig Signed-off-by: Matthias Schiffer Signed-off-by: Weijie Gao Signed-off-by: Felix Fietkau Signed-off-by: Julien Dusser Signed-off-by: John Crispin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19910/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit d5be4aeb5b36ba9cecd6ddbcce972e5d842c5df6 Author: Alexandre Belloni Date: Tue Jun 26 13:57:11 2018 +0200 mips: mscc: build FIT image for Ocelot Ocelot now has a u-boot port, allow building FIT images instead of relying on the legacy detection and builtin DTB. Signed-off-by: Alexandre Belloni Reviewed-by: James Hogan Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19632/ Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit 840267e4466c72d48ca951a9678f48a322fade35 Author: Steven J. Hill Date: Tue Jun 5 00:24:51 2018 -0500 MIPS: Octeon: Remove extern declarations. Get rid of extern declarations in .c functions and included the necessary header file. Also remove unused UART declares. Signed-off-by: Steven J. Hill Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19477/ Cc: linux-mips@linux-mips.org commit 6312455a0437a64059bdeee5696b375593a09947 Author: Matt Redfearn Date: Wed May 23 14:39:59 2018 +0100 MIPS: memset.S: Add comments to fault fixup handlers It is not immediately obvious what the expected inputs to these fault handlers is and how they calculate the number of unset bytes. Having stared deeply at this in order to fix some corner cases, add some comments to assist those who follow. Signed-off-by: Matt Redfearn Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19339/ Cc: James Hogan Cc: Ralf Baechle Cc: Cc: commit b1c03f1ef48d36ff28afb06e8f0c1233ef072f1d Author: Matt Redfearn Date: Wed May 23 14:39:58 2018 +0100 MIPS: memset.S: Fix byte_fixup for MIPSr6 The __clear_user function is defined to return the number of bytes that could not be cleared. From the underlying memset / bzero implementation this means setting register a2 to that number on return. Currently if a page fault is triggered within the MIPSr6 version of setting of initial unaligned bytes, the value loaded into a2 on return is meaningless. During the MIPSr6 version of the initial unaligned bytes block, register a2 contains the number of bytes to be set beyond the initial unaligned bytes. The t0 register is initally set to the number of unaligned bytes - STORSIZE, effectively a negative version of the number of unaligned bytes. This is then incremented before each byte is saved. The label .Lbyte_fixup\@ is jumped to on page fault. Currently the value in a2 is incorrectly replaced by 0 - t0 + 1, effectively the number of unaligned bytes remaining. This leads to the failures being reported by the following test code: static int __init test_clear_user(void) { int j, k; pr_info("\n\n\nTesting clear_user\n"); for (j = 0; j < 512; j++) { if ((k = clear_user(NULL+3, j)) != j) { pr_err("clear_user (NULL %d) returned %d\n", j, k); } } return 0; } late_initcall(test_clear_user); Which reports: [ 3.965439] Testing clear_user [ 3.973169] clear_user (NULL 8) returned 6 [ 3.976782] clear_user (NULL 9) returned 6 [ 3.980390] clear_user (NULL 10) returned 6 [ 3.984052] clear_user (NULL 11) returned 6 [ 3.987524] clear_user (NULL 12) returned 6 Fix this by subtracting t0 from a2 (rather than $0), effectivey giving: unset_bytes = (#bytes - (#unaligned bytes)) - (-#unaligned bytes remaining + 1) + 1 a2 = a2 - t0 + 1 This fixes the value returned from __clear user when the number of bytes to set is > LONGSIZE and the address is invalid and unaligned. Unfortunately, this breaks the fixup handling for unaligned bytes after the final long, where register a2 still contains the number of bytes remaining to be set and the t0 register is to 0 - the number of unaligned bytes remaining. Because t0 is now is now subtracted from a2 rather than 0, the number of bytes unset is reported incorrectly: static int __init test_clear_user(void) { char *test; int j, k; pr_info("\n\n\nTesting clear_user\n"); test = vmalloc(PAGE_SIZE); for (j = 256; j < 512; j++) { if ((k = clear_user(test + PAGE_SIZE - 254, j)) != j - 254) { pr_err("clear_user (%px %d) returned %d\n", test + PAGE_SIZE - 254, j, k); } } return 0; } late_initcall(test_clear_user); [ 3.976775] clear_user (c00000000000df02 256) returned 4 [ 3.981957] clear_user (c00000000000df02 257) returned 6 [ 3.986425] clear_user (c00000000000df02 258) returned 8 [ 3.990850] clear_user (c00000000000df02 259) returned 10 [ 3.995332] clear_user (c00000000000df02 260) returned 12 [ 3.999815] clear_user (c00000000000df02 261) returned 14 Fix this by ensuring that a2 is set to 0 during the set of final unaligned bytes. Signed-off-by: Matt Redfearn Signed-off-by: Paul Burton Fixes: 8c56208aff77 ("MIPS: lib: memset: Add MIPS R6 support") Patchwork: https://patchwork.linux-mips.org/patch/19338/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org # v4.0+ commit 45d9a1e3cc45efee6c0ef82b77269d6944d9d8a5 Author: Alexander Popov Date: Wed Jul 11 23:36:35 2018 +0300 gcc-plugins: Clean up the cgraph_create_edge* macros Drop useless redefinitions of cgraph_create_edge* macros. Drop the unused nest argument. Also support gcc-8, which doesn't have freq argument. Signed-off-by: Alexander Popov Signed-off-by: Kees Cook commit 7ccb95e8fe9131b8fa14b947c60dfb30044fa002 Author: Kees Cook Date: Wed Jul 11 17:38:52 2018 -0700 gcc-plugins: Regularize Makefile.gcc-plugins The layout of Makefile.gcc-plugins had uneven tabs, and the long names of things made this file a bit hard to quickly visually parse. This breaks lines and moves options to the same tab depth. While we're at it, this also adds some comments about the various sections. Signed-off-by: Kees Cook commit 45332b1bdfdc8d63ae4a9d32cbb10e11bc20baab Author: Masahiro Yamada Date: Thu Jul 5 15:24:12 2018 +0900 gcc-plugins: split out Kconfig entries to scripts/gcc-plugins/Kconfig Collect relevant code into the scripts/gcc-plugins directory. Signed-off-by: Masahiro Yamada Signed-off-by: Kees Cook commit 66d58a8f57bf8aa886d3dab728c74873fa361868 Author: Jerome Brunet Date: Tue Jul 24 14:52:28 2018 +0200 arm64: dts: meson-axg: add audio arb reset controller Add the audio memory arbiter which control the access of the audio fifos to the DDR. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit fd1a3b7e51ddf2eae1ae98232fc038cddb4cec38 Author: Jerome Brunet Date: Tue Jul 24 14:52:27 2018 +0200 arm64: dts: meson-axg: add usb power regulator The usb power regulator is supplied by the vcc 5v regulator and controlled by a GPIO. This will be needed to enable usb. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit ff36932e0325763663a67a718190456dd21bf915 Author: Jerome Brunet Date: Tue Jul 24 14:52:26 2018 +0200 arm64: dts: meson-axg: add vcc 5v regulator on the s400 This regulator is controlled by a GPIO and supplies various devices on the board, such as the lineout codec, the usb supply or the lcd controller. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit 9f2619d5f569e7e20c3ebc84bcd6d4aec6c25232 Author: Jerome Brunet Date: Tue Jul 24 14:52:25 2018 +0200 arm64: dts: meson-axg: improve power supplies description Add the parent supply of the s400 power supplies. Also add 'regulator-always-on' property on the regulators which can't be disabled Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit f6753df35c32f17b7abf0de37aa52850ca9733c9 Author: Bob Peterson Date: Wed May 30 14:05:15 2018 -0500 GFS2: rgrp free blocks used incorrectly Before this patch, several functions in rgrp.c checked the value of rgd->rd_free_clone. That does not take into account blocks that were reserved by a multi-block reservation. This causes a problem when space gets tight in the file system. For example, when function gfs2_inplace_reserve checks to see if a rgrp has enough blocks to satisfy the request, it can accept a rgrp that it should reject because, although there are enough blocks to satisfy the request _now_, those blocks may be reserved for another running process. A second problem with this occurs when we've reserved the remaining blocks in an rgrp: function rg_mblk_search() can reject an rgrp improperly because it calculates: u32 free_blocks = rgd->rd_free_clone - rgd->rd_reserved; But rd_reserved includes blocks that the current process just reserved in its own call to inplace_reserve. For example, it can reserve the last 128 blocks of an rgrp, then reject that same rgrp because the above calculates out to free_blocks = 0; Consequences include, but are not limited to, (1) leaving holes, and thus increasing file system fragmentation, and (2) reporting file system is full long before it actually is. This patch introduces a new function, rgd_free, which returns the number of clone-free blocks (blocks that are truly free as opposed to blocks that are still being used because an unlinked file is still open) minus the number of blocks reserved by processes, but not counting the blocks we ourselves reserved (because obviously we need to allocate them). Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit d1b0cb933c8e638947ea72f3ab4e3dad4325bb96 Author: Colin Ian King Date: Tue Jul 17 15:59:28 2018 +0100 gfs2: remove redundant variable 'moved' Variable 'moved' s being assigned but is never used hence it is redundant and can be removed. This has been the case ever since commit c752666c. Cleans up clang warning: warning: variable 'moved' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Andreas Gruenbacher commit f95cbb44abf9d6545769147d5abec4770c89872d Author: Andreas Gruenbacher Date: Wed Jun 6 20:30:38 2018 +0100 gfs2: use iomap_readpage for blocksize == PAGE_SIZE We only use iomap_readpage for pages that don't have buffer heads attached yet: iomap_readpage would otherwise read pages from disk that are marked buffer_uptodate() but not PageUptodate(). Those pages may actually contain data more recent than what's on disk. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit 1d45bb7f9d2a5cbae1e5d9a5f72adad84db4d318 Author: Andreas Gruenbacher Date: Wed Jun 27 01:59:18 2018 +0100 gfs2: Use iomap for stuffed direct I/O reads Remove the fallback code from direct to buffered I/O for stuffed reads. For stuffed writes, we must keep the fallback code: the deferred glock we are holding under direct I/O doesn't allow to write to the inode or change the file size. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit 0ed91eca1130e6c0fe66e01fa6ea92965e81900c Merge: c25892827c79 806a1477b10a Author: Andreas Gruenbacher Date: Wed Jul 25 00:06:59 2018 +0200 Merge branch 'iomap-4.19-merge' into linux-gfs2/for-next Merge xfs branch 'iomap-4.19-merge' into linux-gfs2/for-next. This brings in readpage and direct I/O support for inline data. The IOMAP_F_BUFFER_HEAD flag introduced in commit "iomap: add initial support for writes without buffer heads" needs to be set for gfs2 as well, so do that in the merge. Signed-off-by: Andreas Gruenbacher commit c25892827c7996eb19ca2a5b1cf596218122e994 Author: Andreas Gruenbacher Date: Fri Jul 6 23:05:41 2018 +0100 gfs2: fallocate_chunk: Always initialize struct iomap In fallocate_chunk, always initialize the iomap before calling gfs2_iomap_get_alloc: future changes could otherwise cause things like iomap.flags to leak across calls. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit ed288d74a9e5d9ff869350906ad35eb231c55388 Author: Bart Van Assche Date: Wed Jul 18 09:25:31 2018 -0700 net/xprtrdma: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Reviewed-by: Chuck Lever Acked-by: Anna Schumaker Signed-off-by: Jason Gunthorpe commit 2e3bbe46b4a18d16314dab0c0efdba0c079a5ed0 Author: Bart Van Assche Date: Wed Jul 18 09:25:30 2018 -0700 net/smc: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Acked-by: Ursula Braun Signed-off-by: Jason Gunthorpe commit 12c36dcfd6f48ece2fce4dc8e6ce68224d005d37 Author: Bart Van Assche Date: Wed Jul 18 09:25:29 2018 -0700 net/smc: Remove a WARN_ON() statement Remove a WARN_ON() statement that verifies something that is guaranteed by the RDMA API, namely that the failed_wr pointer is not touched if an ib_post_send() call succeeds and that it points at the failed wr if an ib_post_send() call fails. Signed-off-by: Bart Van Assche Acked-by: Ursula Braun Signed-off-by: Jason Gunthorpe commit f112d53b435692331a50a3780e3ad365b66b1a69 Author: Bart Van Assche Date: Wed Jul 18 09:25:28 2018 -0700 net/rds: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Acked-by: Santosh Shilimkar Signed-off-by: Jason Gunthorpe commit 197c782e3a18cc2de8766dc30a56f37b9b7a9eec Author: Bart Van Assche Date: Wed Jul 18 09:25:27 2018 -0700 net/rds: Remove two WARN_ON() statements Remove two WARN_ON() statements that verify something that is guaranteed by the RDMA API, namely that the failed_wr pointer is not touched if an ib_post_send() call succeeds and that it points at the failed wr if an ib_post_send() call fails. Signed-off-by: Bart Van Assche Acked-by: Santosh Shilimkar Signed-off-by: Jason Gunthorpe commit 72bc4d375d89d0ecb0df491c1eada201a995c471 Author: Bart Van Assche Date: Wed Jul 18 09:25:26 2018 -0700 net/9p: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 73930595066c0996f39ab750cf9fc0963149a1e0 Author: Bart Van Assche Date: Wed Jul 18 09:25:25 2018 -0700 fs/cifs: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 23f96d1f15a70e2e8ba5449d1c77b634426c4b80 Author: Bart Van Assche Date: Wed Jul 18 09:25:24 2018 -0700 nvmet-rdma: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 45e3cc1a88bff18bbfe7d8bf4812ff56d9b21e5e Author: Bart Van Assche Date: Wed Jul 18 09:25:23 2018 -0700 nvme-rdma: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 9b32a59687f5c4752eb64562edd62c20fa222187 Author: Bart Van Assche Date: Wed Jul 18 09:25:22 2018 -0700 IB/srpt: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 71347b0c645c47c2d5970060768b9ecc97029342 Author: Bart Van Assche Date: Wed Jul 18 09:25:21 2018 -0700 IB/srp: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit e01a76743a9e44ae5bb37d9019bea4a888708588 Author: Bart Van Assche Date: Wed Jul 18 09:25:20 2018 -0700 IB/isert: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 604dbdc4a72d77f26cb637a2f196836c04098ffd Author: Bart Van Assche Date: Wed Jul 18 09:25:19 2018 -0700 IB/iser: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 4b4671a0f26917a85085020ed47a0c6e41edf128 Author: Bart Van Assche Date: Wed Jul 18 09:25:18 2018 -0700 IB/IPoIB: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 1fec77bf8fcd95cf7b2feb1e29763d6cd4448912 Author: Bart Van Assche Date: Wed Jul 18 09:25:17 2018 -0700 RDMA/core: Simplify ib_post_(send|recv|srq_recv)() calls Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL as third argument to ib_post_(send|recv|srq_recv)(). Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit bb039a870c0593a4deaa72c2693d02a87723305c Author: Bart Van Assche Date: Wed Jul 18 09:25:16 2018 -0700 IB/core: Allow ULPs to specify NULL as the third ib_post_(send|recv|srq_recv)() argument This patch does not change the behavior of the modified functions. Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 4a7727725dc7d73769c5ab24c566df454093285f Author: Bob Peterson Date: Thu Jul 5 14:40:46 2018 -0500 GFS2: Fix recovery issues for spectators This patch fixes a couple problems dealing with spectators who remain with gfs2 mounts after the last non-spectator node fails. Before this patch, spectator mounts would try to acquire the dlm's mounted lock EX as part of its normal recovery sequence. The mounted lock is only used to determine whether the node is the first mounter, the first node to mount the file system, for the purposes of file system recovery and journal replay. It's not necessary for spectators: they should never do journal recovery. If they acquire the lock it will prevent another "real" first-mounter from acquiring the lock in EX mode, which means it also cannot do journal recovery because it doesn't think it's the first node to mount the file system. This patch checks if the mounter is a spectator, and if so, avoids grabbing the mounted lock. This allows a secondary mounter who is really the first non-spectator mounter, to do journal recovery: since the spectator doesn't acquire the lock, it can grab it in EX mode, and therefore consider itself to be the first mounter both as a "real" first mount, and as a first-real-after-spectator. Note that the control lock still needs to be taken in PR mode in order to fetch the lvb value so it has the current status of all journal's recovery. This is used as it is today by a first mounter to replay the journals. For spectators, it's merely used to fetch the status bits. All recovery is bypassed and the node waits until recovery is completed by a non-spectator node. I also improved the cryptic message given by control_mount when a spectator is waiting for a non-spectator to perform recovery. It also fixes a problem in gfs2_recover_set whereby spectators were never queueing recovery work for their own journal. They cannot do recovery themselves, but they still need to queue the work so they can check the recovery bits and clear the DFL_BLOCK_LOCKS bit once the recovery happens on another node. When the work queue runs on a spectator, it bypasses most of the work so it won't print a bunch of annoying messages. All it will print is a bunch of messages that look like this until recovery completes on the non-spectator node: GFS2: fsid=mycluster:scratch.s: recover generation 3 jid 0 GFS2: fsid=mycluster:scratch.s: recover jid 0 result busy These continue every 1.5 seconds until the recovery is done by the non-spectator, at which time it says: GFS2: fsid=mycluster:scratch.s: recover generation 4 done Then it proceeds with its mount. If the file system is mounted in spectator node and the last remaining non-spectator is fenced, any IO to the file system is blocked by dlm and the spectator waits until recovery is performed by a non-spectator. If a spectator tries to mount the file system before any non-spectators, it blocks and repeatedly gives this kernel message: GFS2: fsid=mycluster:scratch: Recovery is required. Waiting for a non-spectator to mount. GFS2: fsid=mycluster:scratch: Recovery is required. Waiting for a non-spectator to mount. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 231783073ebfc4acf02a45cb78a52ffa16e4e6d3 Author: Laurent Pinchart Date: Wed Jul 11 10:23:32 2018 -0400 media: v4l: rcar_fdp1: Enable compilation on Gen2 platforms Commit 1d3897143815 ("[media] v4l: rcar_fdp1: add FCP dependency") fixed a compilation breakage when the optional VIDEO_RENESAS_FCP dependency is compiled as a module while the rcar_fdp1 driver is built in. As a side effect it disabled compilation on Gen2 by disallowing the valid combination ARCH_RENESAS && !VIDEO_RENESAS_FCP. Fix it by handling the dependency the same way the vsp1 driver did in commit 199946731fa4 ("[media] vsp1: clarify FCP dependency"). Fixes: 1d3897143815 ("[media] v4l: rcar_fdp1: add FCP dependency") Signed-off-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6479aa888222b344dfb087303e2f9e8d8394ef13 Author: Neil Armstrong Date: Tue Jul 10 09:44:57 2018 -0400 media: platform: meson-ao-cec: make busy TX warning silent Switch to dev_dbg for the busy TX message to avoid having a flood of: [ 228.064570] meson-ao-cec c8100100.cec: meson_ao_cec_transmit: busy TX: aborting [ 230.368489] meson-ao-cec c8100100.cec: meson_ao_cec_transmit: busy TX: aborting [ 234.208655] meson-ao-cec c8100100.cec: meson_ao_cec_transmit: busy TX: aborting [ 236.512558] meson-ao-cec c8100100.cec: meson_ao_cec_transmit: busy TX: aborting This message is only a debug hint and not an error. Fixes: 7ec2c0f72cb1 ("media: platform: Add Amlogic Meson AO CEC Controller driver") Signed-off-by: Neil Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b509d733d337417bcb7fa4a35be3b9a49332b724 Author: Hans Verkuil Date: Thu Jul 5 04:25:19 2018 -0400 media: videobuf2-core: check for q->error in vb2_core_qbuf() The vb2_core_qbuf() function didn't check if q->error was set. It is checked in __buf_prepare(), but that function isn't called if the buffer was already prepared before with VIDIOC_PREPARE_BUF. So check it at the start of vb2_core_qbuf() as well. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a50c7738e8ae3276a4b224e321bbd40aee88e8fe Author: Jacopo Mondi Date: Wed Jul 4 06:15:46 2018 -0400 media: sh: migor: Remove stale soc_camera include Remove a stale inclusion for the soc_camera header. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5525b8314389a0c558d15464e86f438974b94e32 Author: Ezequiel Garcia Date: Mon Jun 18 00:38:52 2018 -0400 media: mem2mem: Make .job_abort optional Implementing job_abort() does not make sense on some drivers. This is not a problem, as the abort is not required to wait for the job to finish. Quite the opposite, drivers are encouraged not to wait. Demote v4l2_m2m_ops.job_abort from required to optional, and clean all drivers with dummy implementations. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit aea5f654e6b78a0c976f7a25950155932c77a53f Author: Nishanth Devarajan Date: Mon Jul 23 19:37:41 2018 +0530 net/sched: add skbprio scheduler Skbprio (SKB Priority Queue) is a queueing discipline that prioritizes packets according to their skb->priority field. Under congestion, already-enqueued lower priority packets will be dropped to make space available for higher priority packets. Skbprio was conceived as a solution for denial-of-service defenses that need to route packets with different priorities as a means to overcome DoS attacks. v5 *Do not reference qdisc_dev(sch)->tx_queue_len for setting limit. Instead set default sch->limit to 64. v4 *Drop Documentation/networking/sch_skbprio.txt doc file to move it to tc man page for Skbprio, in iproute2. v3 *Drop max_limit parameter in struct skbprio_sched_data and instead use sch->limit. *Reference qdisc_dev(sch)->tx_queue_len only once, during initialisation for qdisc (previously being referenced every time qdisc changes). *Move qdisc's detailed description from in-code to Documentation/networking. *When qdisc is saturated, enqueue incoming packet first before dequeueing lowest priority packet in queue - improves usage of call stack registers. *Introduce and use overlimit stat to keep track of number of dropped packets. v2 *Use skb->priority field rather than DS field. Rename queueing discipline as SKB Priority Queue (previously Gatekeeper Priority Queue). *Queueing discipline is made classful to expose Skbprio's internal priority queues. Signed-off-by: Nishanth Devarajan Reviewed-by: Sachin Paryani Reviewed-by: Cody Doucette Reviewed-by: Michel Machado Acked-by: Cong Wang Signed-off-by: David S. Miller commit 774f1c912776330ece84540fac370ec201c878b4 Author: Ezequiel Garcia Date: Mon Jun 18 00:38:51 2018 -0400 media: s5p-g2d: Remove unrequired wait in .job_abort As per the documentation, job_abort is not required to wait until the current job finishes. It is redundant to do so, as the core will perform the wait operation. Remove the wait infrastructure completely. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7a0167fb68e3c9ec2386f8abb326a4643ee8ef42 Author: Ezequiel Garcia Date: Mon Jun 18 00:38:50 2018 -0400 media: rcar_jpu: Remove unrequired wait in .job_abort As per the documentation, job_abort is not required to wait until the current job finishes. It is redundant to do so, as the core will perform the wait operation. Remove the wait infrastructure completely. Signed-off-by: Ezequiel Garcia Acked-by: Mikhail Ulyanov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b8f8c8eb408b36ad55dd41a616b3f51998880fb6 Author: Heiner Kallweit Date: Sat Jul 21 15:48:47 2018 +0200 net: phy: add GBit master / slave error detection Certain PHY's have issues when operating in GBit slave mode and can be forced to master mode. Examples are RTL8211C, also the Micrel PHY driver has a DT setting to force master mode. If two such chips are link partners the autonegotiation will fail. Standard defines a self-clearing on read, latched-high bit to indicate this error. Check this bit to inform the user. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit efe1958ec41baba26e47a271b992b2bb524af61e Author: Philipp Zabel Date: Thu May 24 10:50:44 2018 -0400 media: video-mux: fix compliance failures Limit frame sizes to the [1, 65536] interval, media bus formats to the available list of formats, and initialize pad and try formats. Reported-by: Rui Miguel Silva Signed-off-by: Philipp Zabel Tested-by: Rui Miguel Silva Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 56ab8cdbc1438507d79085fcc7e511327d84aeb8 Author: Niklas Söderlund Date: Thu May 17 10:30:16 2018 -0400 media: v4l: Add support for STD ioctls on subdev nodes There is no way to control the standard of subdevices which are part of a media device. The ioctls which exists all target video devices explicitly and the idea is that the video device should talk to the subdevice. For subdevices part of a media graph this is not possible and the standard must be controlled on the subdev device directly. Add four new ioctls to be able to directly interact with subdevices and control the video standard; VIDIOC_SUBDEV_ENUMSTD, VIDIOC_SUBDEV_G_STD, VIDIOC_SUBDEV_S_STD and VIDIOC_SUBDEV_QUERYSTD. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 536ca245c512aedfd84cde072d7b3ca14b6e1792 Author: Zhu Yanjun Date: Fri Jul 13 03:10:20 2018 -0400 IB/rxe: Drop QP0 silently According to "Annex A16: RDMA over Converged Ethernet (RoCE)": A16.4.3 MANAGEMENT INTERFACES As defined in the base specification, a special Queue Pair, QP0 is defined solely for communication between subnet manager(s) and subnet management agents. Since such an IB-defined subnet management architecture is outside the scope of this annex, it follows that there is also no requirement that a port which conforms to this annex be associated with a QP0. Thus, for end nodes designed to conform to this annex, the concept of QP0 is undefined and unused for any port connected to an Ethernet network. CA16-8: A packet arriving at a RoCE port containing a BTH with the destination QP field set to QP0 shall be silently dropped. Signed-off-by: Zhu Yanjun Acked-by: Moni Shoua Reviewed-by: Yuval Shaia Signed-off-by: Jason Gunthorpe commit 4625210899095195600062ff8542f37a1c9f5dd4 Author: Li Yang Date: Tue Jul 24 16:14:33 2018 -0500 soc: fsl: cleanup Kconfig menu Put NXP/Freescale QorIQ SoC drivers under a menu and make the item naming more aligned. Signed-off-by: Li Yang commit d8e516bac73f2eb512c11308cb860c8ad3eacaa8 Author: Roy Pledge Date: Tue Jul 24 09:21:31 2018 -0500 soc: fsl: dpio: Convert DPIO documentation to .rst Convert the Datapath I/O documentation to .rst format and move to the Documation/networking/dpaa2 directory Signed-off-by: Roy Pledge Reviewed-by: Horia Geantă Reviewed-by: Ioana Radulescu Signed-off-by: Li Yang commit 2940882f65e07f5eacbb7d35d52379a54f567a59 Author: Roy Pledge Date: Tue Jul 24 09:21:30 2018 -0500 staging: fsl-mc: Remove remaining files Remove the staging/drivers/fsl-mc directory from the staging area now that all the components have been moved to the main kernel areas. Signed-off-by: Roy Pledge Reviewed-by: Horia Geantă Reviewed-by: Ioana Radulescu Signed-off-by: Li Yang commit c89105c9b39037bbf2aca0614e39afe176e867c5 Author: Roy Pledge Date: Tue Jul 24 09:21:29 2018 -0500 staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl Move the NXP DPIO (Datapath I/O Driver) out of the drivers/staging directory and into the drivers/soc/fsl directory. The DPIO driver enables access to Queue and Buffer Manager (QBMAN) hardware on NXP DPAA2 devices. This is a prerequisite to moving the DPAA2 Ethernet driver out of staging. Signed-off-by: Roy Pledge Reviewed-by: Horia Geantă Reviewed-by: Ioana Radulescu Signed-off-by: Li Yang commit 58ad0d0263c5bb5d907b05b4cf5d875eb8487221 Author: Horia Geantă Date: Tue Jul 24 09:21:28 2018 -0500 staging: fsl-dpaa2: eth: move generic FD defines to DPIO Previous commits: commit 6e2387e8f19e ("staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver") commit 39163c0ce0f4 ("staging: fsl-dpaa2/eth: Errors checking update") have added bits that are not specific to the WRIOP accelerator. Move these where they belong (in DPIO) such that other accelerators can make use of them. Signed-off-by: Horia Geantă Acked-by: Ioana Radulescu Signed-off-by: Li Yang commit 1c0b7df5d333b0bf7159ded5fa8dec49cde715fc Author: Joakim Tjernlund Date: Tue Jun 19 18:22:16 2018 +0200 soc: fsl: qe: gpio: Add qe_gpio_set_multiple This cousin to gpio-mpc8xxx was lacking a multiple pins method, add one. Signed-off-by: Joakim Tjernlund Reviewed-by: Qiang Zhao Signed-off-by: Li Yang commit 7836899c34a514a741bd8e471fede61df798345b Merge: 8dd30201ce66 e446a2760f1e Author: David S. Miller Date: Tue Jul 24 14:10:43 2018 -0700 Merge branch 'net-whitespace-cleanups' Stephen Hemminger says: ==================== net whitespace cleanups Ran script that I use to check for trailing whitespace and blank lines at end of files across all files in net/ directory. These are errors that checkpatch reports and git flags. These are the resulting fixes broken up mostly by subsystem. ==================== Signed-off-by: David S. Miller commit e446a2760f1e265192accd7ddebd3ca5ff1d57bb Author: Stephen Hemminger Date: Tue Jul 24 12:29:18 2018 -0700 net: remove blank lines at end of file Several files have extra line at end of file. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit c2df5603678b5b0d47ca70469934d1c146b29d9b Author: Stephen Hemminger Date: Tue Jul 24 12:29:17 2018 -0700 l2tp: remove trailing newline Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit a17922def7ca6dba9f40b09a8b36f9cbe3b8bbf3 Author: Stephen Hemminger Date: Tue Jul 24 12:29:16 2018 -0700 bpfilter: remove trailing newline Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 19c198d9c130d9a6f1427a2e50f1ed1779202f73 Author: Stephen Hemminger Date: Tue Jul 24 12:29:14 2018 -0700 decnet: whitespace fixes Remove trailing whitespace and extra lines at EOF Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 27782f403fbfe531442b80f59e7e42ccbe00eb9c Author: Stephen Hemminger Date: Tue Jul 24 12:29:13 2018 -0700 x25: remove blank lines at EOF Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 9d82a1cdd391e84bfe5d70702ad4efe5be7d2236 Author: Stephen Hemminger Date: Tue Jul 24 12:29:12 2018 -0700 ax25: remove blank line at EOF Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 543de8881dfe759b304bbbcac8c360d1af52c6b3 Author: Stephen Hemminger Date: Tue Jul 24 12:29:11 2018 -0700 atm: remove blank lines at EOF Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit ed976ea7307876a8557b4c069edf9314ed7459d0 Author: Stephen Hemminger Date: Tue Jul 24 12:29:09 2018 -0700 ila: remove blank lines at EOF Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit aa46225235efc687d971351a309b734549ca5718 Author: Stephen Hemminger Date: Tue Jul 24 12:29:08 2018 -0700 sctp: whitespace fixes Remove blank line at EOF and trailing whitespace. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 2e13b580691cf1a3c4bafd723453dbbd7236a428 Author: Stephen Hemminger Date: Tue Jul 24 12:29:06 2018 -0700 xfrm: remove blank lines at EOF Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 04c6a3a40a22cff4e25d36eeda0ad590717022f0 Author: Stephen Hemminger Date: Tue Jul 24 12:29:05 2018 -0700 mpls: remove trailing whitepace Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit a87e87dbf3926ab43b862cd90ec122ebf7d5aad3 Author: Stephen Hemminger Date: Tue Jul 24 12:29:04 2018 -0700 llc: fix whitespace issues Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 1cb1d977b41ad9fbcbd57ba24b203d6cb2f79952 Author: Stephen Hemminger Date: Tue Jul 24 12:29:03 2018 -0700 rds: remove trailing whitespace and blank lines Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit bf9b5567da548ec56c263e210f958fa923a79503 Author: Stephen Hemminger Date: Tue Jul 24 12:29:02 2018 -0700 wimax: remove blank lines at EOF Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 50f699b1f8462959482251a6cd1b7bc6bbd20796 Author: Stephen Hemminger Date: Tue Jul 24 12:29:01 2018 -0700 sched: fix trailing whitespace Remove trailing whitespace and blank lines at EOF Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 93e01942a6eb1ce730b42158d0d6c6531fe29ca0 Author: Paul Burton Date: Mon Jun 12 11:54:23 2017 -0700 MIPS: Hardcode cpu_has_* where known at compile time due to ISA Many architectural features have over time moved from being optional to either be required or removed by newer architecture releases. This means that in many cases we can know at compile time whether a feature will be supported or not purely due to the knowledge we have about the ISA the kernel build is targeting. This patch introduces a bunch of utility macros for checking for supported options, ASEs & combinations of those with ISA revisions. It then makes use of these in the default definitions of cpu_has_* macros. The result is that many of the macros become compile-time constant, allowing more optimisation opportunities for the compiler - particularly with kernels built for later ISA revisions. To demonstrate the effect of this patch, the following table shows the size in bytes of the kernel binary as reported by scripts/bloat-o-meter for v4.12-rc4 maltasmvp_defconfig kernels with & without this patch. A variant of maltasmvp_defconfig with CONFIG_CPU_MIPS32_R6 selected is also shown, to demonstrate that MIPSr6 systems benefit more due to extra features becoming required by that architecture revision. Builds of pistachio_defconfig are also shown, as although this is a MIPSr2 platform it doesn't hardcode any features in a machine-specific cpu-feature-overrides.h, which allows it to gain more from this patch than the equivalent Malta r2 build. Config | Before | After | Change ----------------|---------|---------|--------- maltasmvp | 7248316 | 7247714 | -602 maltasmvp + r6 | 6955595 | 6950777 | -4818 pistachio | 8650977 | 8363898 | -287079 Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/16360/ Cc: Joshua Kinard Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 76a832254ab05502c9394cc51ded6f0abe0e0bee Author: Rafał Miłecki Date: Fri Jul 13 16:32:21 2018 +0200 mtd: partitions: use DT info for parsing partitions with "compatible" prop So far only flash devices could be described in DT regarding partitions parsing. That could be done with "partitions" subnode and a proper "compatible" string. Some devices may use hierarchical (multi-level) layouts and may mix used layouts (fixed and dynamic). Describing that in DT is done by specifying "compatible" for DT-represented partition plus optionally more properties and/or subnodes. To support such layouts each DT partition has to be checked for additional description. Please note this implementation will work in parallel with support for partition type specified for non-DT setups. That already works since commit 1a0915be1926 ("mtd: partitions: add support for partition parsers"). Signed-off-by: Rafał Miłecki Signed-off-by: Boris Brezillon commit d2ad00eb78792b396a6d012f15d6297a1701b8bc Author: Rafał Miłecki Date: Fri Jul 13 16:32:20 2018 +0200 dt-bindings: mtd: explicitly document nesting partitions descriptions Documentation was already saying that fixed and dynamic partitioning can be mixed but was missing a clear description and examples. This commit adds a proper documentation of how descriptions can be nested and how layouts can be mixed. This addition is important for partitions that contain subpartitions. In such cases partitions have to be properly described in order to let system handle them correctly. Depending on situation, nesting descriptions may provide more accurate logic/structure and/or allow mixing partitioning types (various "compatible" values). Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Boris Brezillon commit 99a7e2bf704d64c966dfacede1ba2d9b47cb676e Author: Wei Yongjun Date: Wed Jul 11 13:15:42 2018 +0000 IB/ipoib: Fix error return code in ipoib_dev_init() Fix to return a negative error code from the ipoib_neigh_hash_init() error handling case instead of 0, as done elsewhere in this function. Fixes: 515ed4f3aab4 ("IB/IPoIB: Separate control and data related initializations") Signed-off-by: Wei Yongjun Reviewed-by: Yuval Shaia Signed-off-by: Jason Gunthorpe commit 42c9cdfe1e11e083dceb0f0c4977b758cf7403b9 Author: Mike Snitzer Date: Fri Jul 20 14:57:38 2018 -0400 block: allow max_discard_segments to be stacked Set max_discard_segments to USHRT_MAX in blk_set_stacking_limits() so that blk_stack_limits() can stack up this limit for stacked devices. before: $ cat /sys/block/nvme0n1/queue/max_discard_segments 256 $ cat /sys/block/dm-0/queue/max_discard_segments 1 after: $ cat /sys/block/nvme0n1/queue/max_discard_segments 256 $ cat /sys/block/dm-0/queue/max_discard_segments 256 Fixes: 1e739730c5b9e ("block: optionally merge discontiguous discard bios into a single request") Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit c24f5762d374b7f2aae31b7a393bdfa66ed06d8b Author: Mathieu Malaterre Date: Wed Jun 6 21:37:30 2018 +0200 MIPS: jz4780: DTS: Probe the spi-gpio driver from devicetree Make use of the spi-gpio driver to provide SPI support on the Ingenic JZ4780 SoC using the pins that can be used with the SSI0 device as GPIOs, until such time as we have support for the Ingenic SPI/SSI controller. [paul.burton@mips.com: Rewrite commit message.] Signed-off-by: Mathieu Malaterre Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19489/ Cc: James Hogan Cc: Rob Herring Cc: Mark Rutland Cc: Ralf Baechle Cc: devicetree@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit 2e90396ad999327c153a6a129b3b683215e1ddea Author: Mathieu Malaterre Date: Wed Jun 6 21:37:29 2018 +0200 MIPS: Ci20: Enable SPI/GPIO driver Enable CONFIG_SPI_GPIO in ci20_defconfig, in order to make use of the spi-gpio driver in a further commit. [paul.burton@mips.com: Rewrite commit message.] Signed-off-by: Mathieu Malaterre Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19488/ Cc: James Hogan Cc: Rob Herring Cc: Mark Rutland Cc: Ralf Baechle Cc: devicetree@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit c55183c9aaa00d2bbb578169a480e31aff3d397c Author: Christoph Hellwig Date: Tue Jul 24 09:52:34 2018 +0200 block: unexport bio_clone_bioset Now only used by the bounce code, so move it there and mark the function static. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit 3ed122e68bb2dcab36b48109431341736e37ce85 Author: Christoph Hellwig Date: Tue Jul 24 09:52:33 2018 +0200 md: remove a bogus comment The function name mentioned doesn't exist, and the code next to it doesn't match the description either. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit 071f52fbce6161706d070ceada5accb81630bf02 Author: Christoph Hellwig Date: Tue Jul 24 09:52:32 2018 +0200 block: remove bio_clone_kmalloc Unused now. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit 076ff2f0b877df4ace6604480f9b1278e61719b8 Author: Christoph Hellwig Date: Tue Jul 24 09:52:31 2018 +0200 exofs: use bio_clone_fast in _write_mirror The mirroring code never changes the bio data or biovecs. This means we can reuse the biovec allocation easily instead of duplicating it. Signed-off-by: Christoph Hellwig Acked-by Boaz Harrosh Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit c8b27acc775990bbd01f067ee7616f7abf2c98a1 Author: Christoph Hellwig Date: Tue Jul 24 09:52:30 2018 +0200 bcache: don't clone bio in bch_data_verify We immediately overwrite the biovec array, so instead just allocate a new bio and copy over the disk, setor and size. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Acked-by: Coly Li Signed-off-by: Jens Axboe commit 1d25e3eeed1d987404e2d2e451eebac8c15cecc1 Author: Randy Dunlap Date: Tue Jul 24 11:29:01 2018 -0700 mtd/maps: fix solutionengine.c printk format warnings Fix 2 printk format warnings (this driver is currently only used by arch/sh/) by using "%pap" instead of "%lx". Fixes these build warnings: ../drivers/mtd/maps/solutionengine.c: In function 'init_soleng_maps': ../include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] ../drivers/mtd/maps/solutionengine.c:62:54: note: format string is defined here printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n", ~~~~^ %08x ../include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] ../drivers/mtd/maps/solutionengine.c:62:72: note: format string is defined here printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n", ~~~~^ %08x Cc: David Woodhouse Cc: Brian Norris Cc: Boris Brezillon Cc: Marek Vasut Cc: Richard Weinberger Cc: linux-mtd@lists.infradead.org Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Cc: Sergei Shtylyov Signed-off-by: Randy Dunlap Signed-off-by: Boris Brezillon commit 3bb5098310317ca62304bd21af6ccea57d799b06 Author: Christoph Hellwig Date: Tue Jul 24 14:04:13 2018 +0200 block: bio_set_pages_dirty can't see NULL bv_page in a valid bio_vec So don't bother handling it. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit 24d5493f207ce0ce38df80ce86c907417e04594a Author: Christoph Hellwig Date: Tue Jul 24 14:04:12 2018 +0200 block: simplify bio_check_pages_dirty bio_check_pages_dirty currently inviolates the invariant that bv_page of a bio_vec inside bi_vcnt shouldn't be zero, and that is going to become really annoying with multpath biovecs. Fortunately there isn't any all that good reason for it - once we decide to defer freeing the bio to a workqueue holding onto a few additional pages isn't really an issue anymore. So just check if there is a clean page that needs dirtying in the first path, and do a second pass to free them if there was none, while the cache is still hot. Also use the chance to micro-optimize bio_dirty_fn a bit by not saving irq state - we know we are called from a workqueue. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit cb80fb189270e7b2c32fa470d40e951852614eb2 Author: Yishai Hadas Date: Mon Jul 23 15:25:12 2018 +0300 IB/mlx5: Enable driver uapi commands for flow steering Expose the mlx5 flow steering parsing trees, exposing the functionality to user space. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit bb805f2b20e2200753bf0a69b3ef5332b37eb781 Author: Harry Wentland Date: Mon Jul 9 17:25:42 2018 -0400 drm/amd/display: DC 3.1.58 Signed-off-by: Harry Wentland Reviewed-by: Aric Cyr Acked-by: Leo Li Signed-off-by: Alex Deucher commit cfd84fd36531b2f1de01b3530b6953ed34ed2c95 Author: Jun Lei Date: Thu Jul 12 10:35:01 2018 -0400 drm/amd/display: separate dc_debug into dc_debug_options and dc_debug data [why] confusing as to which part of debug is informational, and which part causes behavioral change Signed-off-by: Jun Lei Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit 5c6ac7112fb2b73a5e4e7ac1648cdaceb558f268 Author: Bhawanpreet Lakha Date: Tue Jul 10 17:20:17 2018 -0400 drm/amd/display: Decouple aux from i2c [Why] Aux engine is created from i2caux layer. We want to remove this layer and use the engine directly. [How] Decouple aux engine from i2caux. Move aux engine related code to dce folder and use dc resource pool to manage the engine. And use the engine functions directly Signed-off-by: Bhawanpreet Lakha Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher commit 3fc9fc4cf5a1a8219ab5d9ab10dac26db78c38f4 Author: vikrant mhaske Date: Thu Jul 12 16:04:43 2018 +0800 drm/amd/display: DPP CM ICSC AYCRCB8888 format support [why] Diags has POR to run the video workload using AYCRCB8888 through DCN; capture it through DWB and send it to VCN hardware to encode [how] added the code to support this format so that DPP ICSC will be able to convert it from YUV444 to internal RGB and DWB OCSC will be able to convert from internal RGB to YUV420 Signed-off-by: vikrant mhaske Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit 278ca8d677cf7bcecd2b2f287838e5f344f5911e Author: David Francis Date: Wed Jul 11 16:20:13 2018 -0400 drm/amd/display: On dce100, set clocks to 0 on suspend [Why] When a dce100 asic was suspended, the clocks were not set to 0. Upon resume, the new clock was compared to the existing clock, they were found to be the same, and so the clock was not set. This resulted in a pernicious blackscreen. [How] In atomic commit, check to see if there are any active pipes. If no, set clocks to 0 Signed-off-by: David Francis Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit aafded888514ba2c6b613548081dedf289a71287 Author: Tony Cheng Date: Wed Jul 11 15:31:24 2018 -0400 drm/amd/display: allow diags to skip initial link training [why] diag specify what the full config and is only concerned about pass/fail at the end having inter-op code like verifiying we can actually train at reported link rate slows down diag test and add complexity we don't need [how] add dc_debug option to skip capability link trianing also remove hbr in function name as verify is not specific to hbr Signed-off-by: Tony Cheng Reviewed-by: Ken Chalmers Acked-by: Leo Li Signed-off-by: Alex Deucher commit 85344e75d0d18094789ce84f88e1c5762c74115d Author: Mikita Lipski Date: Wed Jul 4 11:19:53 2018 -0400 drm/amd/display: Remove unnecessary warning [why] The warning message floods the dmesg log on Tonga even though it is expected to have a pix_clk set to zero, when the pipe is not active. [how] remove the assert Signed-off-by: Mikita Lipski Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher commit 5f8181733f6e5f8a4447f844efe4bdab5ed6a30e Author: Shirish S Date: Mon Jul 23 15:11:51 2018 +0530 drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up This patch moves amdgpu_fbdev_set_suspend() to the beginning of suspend sequence. This is to ensure fbcon does not to write to the VRAM after GPU is powerd down. Signed-off-by: Shirish S Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 456607d816d89a442a3d5ec98b02c8bc950b5228 Author: Michel Dänzer Date: Thu Jul 19 17:38:18 2018 +0200 drm/amdgpu: Don't warn on destroying a pinned BO The warning turned out to be not so useful, as BO destruction tends to be deferred to a workqueue. Also, we should be preventing any damage from this now, so not really important anymore to fix code doing this. Acked-by: Alex Deucher Tested-by: Mike Lothian Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 92859e0d5ce558df44eb05f7d5872edc96646b24 Author: Evan Quan Date: Mon Jul 16 17:25:30 2018 +0800 drm/amd/powerplay: allow slow switch only if NBPState enabled v2 Otherwise there may be potential SMU performance issues. v2: fix commit description and coding style Signed-off-by: Evan Quan Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit f132d56162e670d2338902753b88ecbf29ca46a0 Author: Evan Quan Date: Mon Jul 16 17:23:19 2018 +0800 drm/amd/powerplay: correct the argument for PPSMC_MSG_SetUclkFastSwitch The argument was set wrongly. Fast/slow switch was asked when there is actually a slow/fast switch needed. Signed-off-by: Evan Quan Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 59a8348fc5b363a0c19be73bc9f5790e0f8f803a Author: Evan Quan Date: Fri Jul 20 10:13:19 2018 +0800 drm/amd/powerplay: slow UCLK switch when multiple displays not in sync Slow switch for UCLK when there is multiple displays and they are not in sync. Signed-off-by: Evan Quan Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 226127a67e31a9518d9516d3e4890759b379d874 Author: Michel Dänzer Date: Thu Jul 19 18:33:39 2018 +0200 drm/amdgpu: Fix RLC safe mode test in gfx_v9_0_enter_rlc_safe_mode We were testing the register offset, instead of the value stored in the register, therefore always timing out the loop. This reduces suspend time of the system in the bug report below by ~600 ms. Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/107277 Tested-by: Paul Menzel Reviewed-by: Alex Deucher Reviewed-by: Junwei Zhang Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 6346f0bfa07b3a4ed55b8630cf20b6f43d277b51 Author: Yishai Hadas Date: Mon Jul 23 15:25:11 2018 +0300 IB/mlx5: Add support for a flow table destination for driver flow steering Add support to set a destination that is a flow table, this can come from the DEVX destination. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d4be3f4466b8a770ea2c3b57b942efd057fe1c19 Author: Yishai Hadas Date: Mon Jul 23 15:25:10 2018 +0300 IB/mlx5: Support adding flow steering rule by raw description Add support to set a public flow steering rule when its destination is a TIR by using raw specification data. The logic follows the verbs API but instead of using ib_spec(s) the raw, device specific, description is used. This allows supporting specialty matchers without having to define new matches in the verbs struct based language. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 32269441240064c7475241ae28fee787fcdf55b9 Author: Yishai Hadas Date: Mon Jul 23 15:25:09 2018 +0300 IB/mlx5: Introduce driver create and destroy flow methods Introduce driver create and destroy flow methods on the uverbs flow object. This allows the driver to get its specific device attributes to match the underlay specification while still using the generic ib_flow object for cleanup and code sharing. The IB object's attributes are set via the ib_set_flow() helper function. The specific implementation for the given specification is added in downstream patches. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b3793159249bb091efce4b1515ce18cdfc4c6e41 Author: Krzysztof Kozlowski Date: Wed Jul 18 22:03:50 2018 +0200 dt-bindings: pinctrl: samsung: Add SPDX license identifier Replace GPL license statement with SPDX license identifier (GPL-2.0). Signed-off-by: Krzysztof Kozlowski commit a8be2af0218cf037704dc2e733bf56d6560fa324 Author: Krzysztof Kozlowski Date: Mon Jul 23 19:52:58 2018 +0200 pinctrl: samsung: Write external wakeup interrupt mask The pinctrl driver defines an IRQ chip which handles external wakeup interrupts, therefore from logical point of view, it is the owner of external interrupt mask. The register controlling the mask belongs to Power Management Unit address space so it has to be accessed with PMU syscon regmap handle. This mask should be written to hardware during system suspend. Till now ARMv7 machine code was responsible for this which created a dependency between pin controller driver and arch/arm/mach code. Try to rework this dependency so the pinctrl driver will write external wakeup interrupt mask during late suspend. Impact on ARMv7 designs (S5Pv210 and Exynos) ============================================ This duplicates setting mask with existing machine code arch/arm/mach-exynos/suspend.c and arch/arm/mach-s5pv210/pm.c but it is not a problem - the wakeup mask register will be written twice. The machine code will be cleaned up later. The difference between implementation here and ARMv7 machine code (arch/arm/mach-*) is the time of writing the mask: 1. The machine code is writing the mask quite late during system suspend path, after offlining secondary CPUs and just before doing actual suspend. 2. The implementation in pinctrl driver uses late suspend ops, therefore it will write the mask much earlier. Hopefully late enough, after all drivers will enable or disable their interrupt wakeups (enable_irq_wake() etc). Impact on ARMv8 designs (Exynos5433 and Exynos7) ================================================ The Suspend to RAM was not supported and external wakeup interrupt mask was not written to HW. This change brings us one step closer to supporting Suspend to RAM. Signed-off-by: Krzysztof Kozlowski Cc: Tomasz Figa Cc: Sylwester Nawrocki Acked-by: Tomasz Figa Tested-by: Marek Szyprowski commit e5cda42c16d89720c29678f51d95a119490ef7d8 Author: Krzysztof Kozlowski Date: Mon Jul 23 19:52:57 2018 +0200 ARM: exynos: Define EINT_WAKEUP_MASK registers for S5Pv210 and Exynos5433 S5Pv210 and Exynos5433/Exynos7 have different address of EINT_WAKEUP_MASK register. Rename existing S5P_EINT_WAKEUP_MASK to avoid confusion and add new ones. Signed-off-by: Krzysztof Kozlowski Cc: Tomasz Figa Cc: Sylwester Nawrocki Acked-by: Tomasz Figa Tested-by: Marek Szyprowski commit bb928dfd06e5e5cef0b090ba23e894b2f37ee14e Author: Krzysztof Kozlowski Date: Mon Jul 23 19:52:56 2018 +0200 pinctrl: samsung: Add dedicated compatible for S5Pv210 wakeup interrupts The S5Pv210 external wakeup interrupts differ from Exynos therefore separate compatible is needed. Duplicate existing flavor specific data from exynos4210_wkup_irq_chip and add new compatible for S5Pv210. At this point this new compatible does not bring anything new and works exactly as existing "samsung,exynos4210-wakeup-eint". Signed-off-by: Krzysztof Kozlowski Cc: Tomasz Figa Cc: Sylwester Nawrocki Acked-by: Tomasz Figa Tested-by: Marek Szyprowski commit b34fbaa9289328c7aec67d2b8b8b7d02bc61c67d Author: Ingo Molnar Date: Sun Jul 22 10:51:50 2018 -0400 random: remove preempt disabled region No need to keep preemption disabled across the whole function. mix_pool_bytes() uses a spin_lock() to protect the pool and there are other places like write_pool() whhich invoke mix_pool_bytes() without disabling preemption. credit_entropy_bits() is invoked from other places like add_hwgenerator_randomness() without disabling preemption. Before commit 95b709b6be49 ("random: drop trickle mode") the function used __this_cpu_inc_return() which would require disabled preemption. The preempt_disable() section was added in commit 43d5d3018c37 ("[PATCH] random driver preempt robustness", history tree). It was claimed that the code relied on "vt_ioctl() being called under BKL". Cc: "Theodore Ts'o" Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner [bigeasy: enhance the commit message] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Theodore Ts'o commit 615a673ce9a99122a3a44e5dee2f61bae82a757c Author: Krzysztof Kozlowski Date: Mon Jul 23 19:52:55 2018 +0200 pinctrl: samsung: Document hidden requirement about one external wakeup ARMv7 hardware (S5Pv210 and Exynos SoCs) provides only 32 external interrupts which can wakeup device from deep sleep modes. On S5Pv210 these are gph0-gph3. On all ARMv7 Exynos designs these are gpx0-gpx3. There is only one 32-bit register for controlling the external wakeup interrupt mask (masking and unmasking waking capability of these interrupts). This lead to implementation in pinctrl driver and machine code which was using static memory for storing the mask value and not caring about multiple devices of pin controller... because only one pin controller device will be handling this. Since each pin controller node in Device Tree maps onto one device, this corresponds to hidden assumption in parsing the Device Tree: external wakeup interrupts can be defined only once. Make this assumption an explicit requirement. ARMv8 Exynos5433 and Exynos7 bring additional 32 external wakeup interrupts (up to 64 total, banks gpa0-gpa3 and gpf1-gpf5) and another 32-bit wide register for controlling them. Existing code does not support it but anyway these additional interrupts will be belonging to the same pin controller device/node. Signed-off-by: Krzysztof Kozlowski Cc: Tomasz Figa Cc: Sylwester Nawrocki Acked-by: Tomasz Figa Tested-by: Marek Szyprowski commit 39a8883a2b989d1d21bd8dd99f5557f0c5e89694 Author: Theodore Ts'o Date: Tue Jul 17 18:24:27 2018 -0400 random: add a config option to trust the CPU's hwrng This gives the user building their own kernel (or a Linux distribution) the option of deciding whether or not to trust the CPU's hardware random number generator (e.g., RDRAND for x86 CPU's) as being correctly implemented and not having a back door introduced (perhaps courtesy of a Nation State's law enforcement or intelligence agencies). This will prevent getrandom(2) from blocking, if there is a willingness to trust the CPU manufacturer. Signed-off-by: Theodore Ts'o commit 00d6fff37066e96814796d05e1c6e8131f38576a Author: Krzysztof Kozlowski Date: Mon Jul 23 19:52:54 2018 +0200 pinctrl: samsung: Document suspend and resume members Add missing documentation for suspend and resume members of struct samsung_pin_ctrl and samsung_pinctrl_drv_data. Signed-off-by: Krzysztof Kozlowski Cc: Tomasz Figa Cc: Sylwester Nawrocki Acked-by: Tomasz Figa Tested-by: Marek Szyprowski commit cafec5a7e0cb6df1adff515e6ec69911d3362f89 Author: Krzysztof Kozlowski Date: Mon Jul 23 19:52:53 2018 +0200 pinctrl: samsung: Define suspend and resume callbacks for all banks and SoCs Suspend and resume callbacks in Exynos/S5Pv210 pin controller drivers, save and restore state of registers. This operations should be done for all banks which have external interrupts (as denoted by using EXYNOS_PIN_BANK_EINTG/EINTW macros). Add all banks of Exynos5260 and Exynos5420. This is necessary step for supporting suspend to RAM on these SoCs. Signed-off-by: Krzysztof Kozlowski Cc: Tomasz Figa Cc: Sylwester Nawrocki Acked-by: Tomasz Figa Tested-by: Marek Szyprowski commit 6cd080a674a7adce97c0189c4579cf40782c2770 Author: Yishai Hadas Date: Mon Jul 23 15:25:08 2018 +0300 IB: Support ib_flow creation in drivers This patch considers the case that ib_flow is created by some device driver with its specific parameters using the KABI infrastructure. In that case both QP and ib_uflow_resources might not be applicable. Downstream patches from this series use the above functionality. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit fd44e3853c0155fa82314f341f476d4793415cd2 Author: Yishai Hadas Date: Mon Jul 23 15:25:07 2018 +0300 IB/mlx5: Introduce flow steering matcher uapi object Introduce flow steering matcher object and its create and destroy methods. This matcher object holds some mlx5 specific driver properties that matches the underlay device specification when an mlx5 flow steering group is created. It will be used in downstream patches to be part of mlx5 specific create flow method. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit eda98779f7d318cf96f030bbc5b23f034b69b80a Merge: 4fca03778351 664000b6bb43 Author: Jason Gunthorpe Date: Tue Jul 24 13:10:23 2018 -0600 Merge branch 'mellanox/mlx5-next' into rdma.git for-next From git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git This is required to resolve dependencies of the next series of RDMA patches. * branch 'mellanox/mlx5-next': net/mlx5: Add support for flow table destination number net/mlx5: Add forward compatible support for the FTE match data net/mlx5: Fix tristate and description for MLX5 module net/mlx5: Better return types for CQE API net/mlx5: Use ERR_CAST() instead of coding it net/mlx5: Add missing SET_DRIVER_VERSION command translation net/mlx5: Add XRQ commands definitions net/mlx5: Add core support for double vlan push/pop steering action net/mlx5: Expose MPEGC (Management PCIe General Configuration) structures net/mlx5: FW tracer, add hardware structures net/mlx5: fix uaccess beyond "count" in debugfs read/write handlers Signed-off-by: Jason Gunthorpe commit be9543ec9e7423894473ec9314023e505e26fc52 Author: Sakari Ailus Date: Mon Jul 16 11:20:33 2018 -0400 media: v4l: i2c: Replace "sensor-level" by "sensor" A lot of sensor drivers are labelled as "sensor-level" drivers. That's odd and somewhat confusing as the term isn't used elsewhere: these are just sensor drivers. Call them such. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 09a48f74e4e379af07aef7e2eb48a9be482aa8ff Author: Jacopo Mondi Date: Thu May 31 13:35:03 2018 -0400 media: i2c: ov7670: Put ep fwnode after use The just parsed endpoint fwnode has to be put after use. Currently this is done only in error handling path. Fix that by putting node unconditionally after use. Fixes: 01b8444828fc ("media: v4l2: i2c: ov7670: Implement OF mbus configuration") Signed-off-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4adb0a0432f489c5eb802b33dae7737f69e6fd7a Author: Todor Tomov Date: Mon Jun 18 04:06:58 2018 -0400 media: ov5645: Supported external clock is 24MHz The external clock frequency was set to 23.88MHz by mistake because of a platform which cannot get closer to 24MHz. The supported by the driver external clock is 24MHz so set it correctly and also fix the values of the pixel clock and link clock. However allow 1% tolerance to the external clock as this difference is small enough to be insignificant. Signed-off-by: Todor Tomov Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 53cf3100dd3af5f4ffbbe272e34f2150157aa425 Author: Jacopo Mondi Date: Mon Jul 9 10:19:21 2018 -0400 media: rcar-vin: Handle data-enable polarity Handle data-enable signal polarity. If the polarity is not specifically requested to be active low, use the active high default. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d9b3c77a145e1754e93c49b6f494498f7b49dd09 Author: Jacopo Mondi Date: Mon Jul 9 10:19:20 2018 -0400 media: dt-bindings: media: rcar-vin: Add 'data-enable-active' Describe optional endpoint property 'data-enable-active' for R-Car VIN. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Reviewed-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9b04fcc1d8a9b5480f9e7ec93072c3a1bc517256 Author: Jacopo Mondi Date: Mon Jul 9 10:19:19 2018 -0400 media: v4l2-fwnode: parse 'data-enable-active' prop Parse the newly defined 'data-enable-active' property in parallel endpoint parsing function. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 75571ee0e50da56ea45a9cea3a540dd0955fa7ce Author: Jacopo Mondi Date: Mon Jul 9 10:19:18 2018 -0400 media: dt-bindings: media: Document data-enable-active property Add 'data-enable-active' property to endpoint node properties list. The property allows to specify the polarity of the data-enable signal, which when in active state determinates when data lines have to sampled for valid pixel data. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Acked-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3ab7801dfab998a2d1fba38b578bcaede4c9fcf3 Author: Jacopo Mondi Date: Mon Jul 9 10:19:17 2018 -0400 media: dt-bindings: media: rcar-vin: Describe optional ep properties Describe the optional endpoint properties for endpoint nodes of the R-Car VIN interface device tree bindings documentation. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4c471ffe2c5cb7f899cc8352d3d8fd9b6d58853b Author: Jacopo Mondi Date: Mon Jul 9 10:19:16 2018 -0400 media: dt-bindings: media: rcar-vin: Align Gen2 and Gen3 Align description of the Gen2 and Gen3 bindings for parallel input. This commit prepares for description of optional endpoint properties in ports subnodes accepting parallel video connections. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Acked-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 18d6a9b831985c7c646abd751509f52079420104 Author: Luca Ceresoli Date: Thu Jul 5 10:41:11 2018 -0400 media: smiapp: fix debug message ask_h gets printed here instead of ask_w. Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6949d864776ef295ddc8f840d7d6a2dbe51bd9d1 Author: Hugues Fruchet Date: Wed Jul 4 09:04:38 2018 -0400 media: ov5640: do not change mode if format or frame interval is unchanged Save load of mode registers array when V4L2 client sets a format or a frame interval which selects the same mode than the current one. Signed-off-by: Hugues Fruchet Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b5f6ec535f8f7ca3516adc0f34f2c3a5a388ad58 Author: Sakari Ailus Date: Tue Jul 3 09:54:39 2018 -0400 media: smiapp: Set correct MODULE_LICENSE The smiapp driver is licensed under GNU GPL v2 only, as stated by the header. Reflect this in the MODULE_LICENSE macro. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8dd30201ce66f2c81077e06056f4a865e512e854 Author: Tariq Toukan Date: Tue Jul 24 13:53:00 2018 +0300 net: remove redundant input checks in SIOCSIFTXQLEN case of dev_ifsioc The cited patch added a call to dev_change_tx_queue_len in SIOCSIFTXQLEN case. This obsoletes the new len comparison check done before the function call. Remove it here. For the desicion of keep/remove the negative value check, we examine the range check in dev_change_tx_queue_len. On 64-bit we will fail with -ERANGE. The 32-bit int ifr_qlen will be sign extended to 64-bits when it is passed into dev_change_tx_queue_len(). And then for negative values this test triggers: if (new_len != (unsigned int)new_len) return -ERANGE; because: if (0xffffffffWHATEVER != 0x00000000WHATEVER) On 32-bit the signed value will be accepted, changing behavior. Therefore, the negative value check is kept. Fixes: 3f76df198288 ("net: use dev_change_tx_queue_len() for SIOCSIFTXQLEN") Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Cc: Cong Wang Signed-off-by: David S. Miller commit a3479c7fc096a1a7a2dccbfbdc6fcf86b805711a Merge: 109dbb1e6f27 025d0e7f73c6 Author: Andreas Gruenbacher Date: Tue Jul 24 20:02:40 2018 +0200 Merge branch 'iomap-write' into linux-gfs2/for-next Pull in the gfs2 iomap-write changes: Tweak the existing code to properly support iomap write and eliminate an unnecessary special case in gfs2_block_map. Implement iomap write support for buffered and direct I/O. Simplify some of the existing code and eliminate code that is no longer used: gfs2: Remove gfs2_write_{begin,end} gfs2: iomap direct I/O support gfs2: gfs2_extent_length cleanup gfs2: iomap buffered write support gfs2: Further iomap cleanups This is based on the following changes on the xfs 'iomap-4.19-merge' branch: iomap: add private pointer to struct iomap iomap: add a page_done callback iomap: generic inline data handling iomap: complete partial direct I/O writes synchronously iomap: mark newly allocated buffer heads as new fs: factor out a __generic_write_end helper Signed-off-by: Andreas Gruenbacher commit 109dbb1e6f27fb8f80ee61953485c7c3b1717951 Author: Souptick Joarder Date: Mon Jul 2 22:16:13 2018 +0530 fs: gfs2: Adding new return type vm_fault_t Use new return type vm_fault_t for gfs2_page_mkwrite handler. see commit 1c8f422059ae ("mm: change return type to vm_fault_t") for reference. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Andreas Gruenbacher commit 910f3d58d0d40691534b77cc01588ffa22ee7dee Author: Chengguang Xu Date: Fri Jun 22 09:51:43 2018 +0800 gfs2: using posix_acl_xattr_size instead of posix_acl_to_xattr It seems better to get size by calling posix_acl_xattr_size() instead of calling posix_acl_to_xattr() with NULL buffer argument. posix_acl_xattr_size() never returns 0, so remove the unnecessary check. Signed-off-by: Chengguang Xu Signed-off-by: Andreas Gruenbacher commit e79e0e1428188b24c3b57309ffa54a33c4ae40c4 Author: Bob Peterson Date: Mon Jun 18 13:24:13 2018 -0500 gfs2: Don't reject a supposedly full bitmap if we have blocks reserved Before this patch, you could get into situations like this: 1. Process 1 searches for X free blocks, finds them, makes a reservation 2. Process 2 searches for free blocks in the same rgrp, but now the bitmap is full because process 1's reservation is skipped over. So it marks the bitmap as GBF_FULL. 3. Process 1 tries to allocate blocks from its own reservation, but since the GBF_FULL bit is set, it skips over the rgrp and searches elsewhere, thus not using its own reservation. This patch adds an additional check to allow processes to use their own reservations. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 9ef0112442bdddef5fb55adf20b3a5464b33de75 Author: Thomas Richter Date: Tue Jul 24 15:48:58 2018 +0200 perf test: Fix subtest number when showing results Perf test 40 for example has several subtests numbered 1-4 when displaying the start of the subtest. When the subtest results are displayed the subtests are numbered 0-3. Use this command to generate trace output: [root@s35lp76 perf]# ./perf test -Fv 40 2>/tmp/bpf1 Fix this by adjusting the subtest number when show the subtest result. Output before: [root@s35lp76 perf]# egrep '(^40\.[0-4]| subtest [0-4]:)' /tmp/bpf1 40.1: Basic BPF filtering : BPF filter subtest 0: Ok 40.2: BPF pinning : BPF filter subtest 1: Ok 40.3: BPF prologue generation : BPF filter subtest 2: Ok 40.4: BPF relocation checker : BPF filter subtest 3: Ok [root@s35lp76 perf]# Output after: root@s35lp76 ~]# egrep '(^40\.[0-4]| subtest [0-4]:)' /tmp/bpf1 40.1: Basic BPF filtering : BPF filter subtest 1: Ok 40.2: BPF pinning : BPF filter subtest 2: Ok 40.3: BPF prologue generation : BPF filter subtest 3: Ok 40.4: BPF relocation checker : BPF filter subtest 4: Ok [root@s35lp76 ~]# Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180724134858.100644-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 0aa802a79469a86ebe143019144cd4df8ae852e4 Author: Jiri Olsa Date: Fri Jul 20 13:00:34 2018 +0200 perf stat: Get rid of extra clock display function There's no reason to have separate function to display clock events. It's only purpose was to convert the nanosecond value into microseconds. We do that now in generic code, if the unit and scale values are properly set, which this patch do for clock events. The output differs in the unit field being displayed in its columns rather than having it added as a suffix of the event name. Plus the value is rounded into 2 decimal numbers as for any other event. Before: # perf stat -e cpu-clock,task-clock -C 0 sleep 3 Performance counter stats for 'CPU(s) 0': 3001.123137 cpu-clock (msec) # 1.000 CPUs utilized 3001.133250 task-clock (msec) # 1.000 CPUs utilized 3.001159813 seconds time elapsed Now: # perf stat -e cpu-clock,task-clock -C 0 sleep 3 Performance counter stats for 'CPU(s) 0': 3,001.05 msec cpu-clock # 1.000 CPUs utilized 3,001.05 msec task-clock # 1.000 CPUs utilized 3.001077794 seconds time elapsed There's a small difference in csv output, as we now output the unit field, which was empty before. It's in the proper spot, so there's no compatibility issue. Before: # perf stat -e cpu-clock,task-clock -C 0 -x, sleep 3 3001.065177,,cpu-clock,3001064187,100.00,1.000,CPUs utilized 3001.077085,,task-clock,3001077085,100.00,1.000,CPUs utilized # perf stat -e cpu-clock,task-clock -C 0 -x, sleep 3 3000.80,msec,cpu-clock,3000799026,100.00,1.000,CPUs utilized 3000.80,msec,task-clock,3000799550,100.00,1.000,CPUs utilized Add perf_evsel__is_clock to replace nsec_counter. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180720110036.32251-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2d6cae13f10d5d8b370038dbfdf60317c22b9f52 Author: Jiri Olsa Date: Fri Jul 20 13:00:33 2018 +0200 perf tools: Use perf_evsel__match instead of open coded equivalent Use perf_evsel__match() helper in perf_evsel__is_bpf_output(). Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180720110036.32251-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 46b3722cc7765582354488da633aafffcb138458 Author: Jiri Olsa Date: Fri Jul 20 12:17:40 2018 +0200 perf tools: Fix struct comm_str removal crash We occasionaly hit following assert failure in 'perf top', when processing the /proc info in multiple threads. perf: ...include/linux/refcount.h:109: refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed. The gdb backtrace looks like this: [Switching to Thread 0x7ffff11ba700 (LWP 13749)] 0x00007ffff50839fb in raise () from /lib64/libc.so.6 (gdb) #0 0x00007ffff50839fb in raise () from /lib64/libc.so.6 #1 0x00007ffff5085800 in abort () from /lib64/libc.so.6 #2 0x00007ffff507c0da in __assert_fail_base () from /lib64/libc.so.6 #3 0x00007ffff507c152 in __assert_fail () from /lib64/libc.so.6 #4 0x0000000000535373 in refcount_inc (r=0x7fffdc009be0) at ...include/linux/refcount.h:109 #5 0x00000000005354f1 in comm_str__get (cs=0x7fffdc009bc0) at util/comm.c:24 #6 0x00000000005356bd in __comm_str__findnew (str=0x7fffd000b260 ":2", root=0xbed5c0 ) at util/comm.c:72 #7 0x000000000053579e in comm_str__findnew (str=0x7fffd000b260 ":2", root=0xbed5c0 ) at util/comm.c:95 #8 0x000000000053582e in comm__new (str=0x7fffd000b260 ":2", timestamp=0, exec=false) at util/comm.c:111 #9 0x00000000005363bc in thread__new (pid=2, tid=2) at util/thread.c:57 #10 0x0000000000523da0 in ____machine__findnew_thread (machine=0xbfde38, threads=0xbfdf28, pid=2, tid=2, create=true) at util/machine.c:457 #11 0x0000000000523eb4 in __machine__findnew_thread (machine=0xbfde38, ... The failing assertion is this one: REFCOUNT_WARN(!refcount_inc_not_zero(r), ... The problem is that we keep global comm_str_root list, which is accessed by multiple threads during the 'perf top' startup and following 2 paths can race: thread 1: ... thread__new comm__new comm_str__findnew down_write(&comm_str_lock); __comm_str__findnew comm_str__get thread 2: ... comm__override or comm__free comm_str__put refcount_dec_and_test down_write(&comm_str_lock); rb_erase(&cs->rb_node, &comm_str_root); Because thread 2 first decrements the refcnt and only after then it removes the struct comm_str from the list, the thread 1 can find this object on the list with refcnt equls to 0 and hit the assert. This patch fixes the thread 1 __comm_str__findnew path, by ignoring objects that already dropped the refcnt to 0. For the rest of the objects we take the refcnt before comparing its name and release it afterwards with comm_str__put, which can also release the object completely. Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Kan Liang Cc: Lukasz Odzioba Cc: Peter Zijlstra Cc: Wang Nan Cc: kernel-team@lge.com Link: http://lkml.kernel.org/r/20180720101740.GA27176@krava Signed-off-by: Arnaldo Carvalho de Melo commit b57334b9453949bf81281321d14d86d60aee6fde Author: Jiri Olsa Date: Thu Jul 19 16:33:44 2018 +0200 perf machine: Use last_match threads cache only in single thread mode There's an issue with using threads::last_match in multithread mode which is enabled during the perf top synthesize. It might crash with following assertion: perf: ...include/linux/refcount.h:109: refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed. The gdb backtrace looks like this: 0x00007ffff50839fb in raise () from /lib64/libc.so.6 (gdb) #0 0x00007ffff50839fb in raise () from /lib64/libc.so.6 #1 0x00007ffff5085800 in abort () from /lib64/libc.so.6 #2 0x00007ffff507c0da in __assert_fail_base () from /lib64/libc.so.6 #3 0x00007ffff507c152 in __assert_fail () from /lib64/libc.so.6 #4 0x0000000000535ff9 in refcount_inc (r=0x7fffe8009a70) at ...include/linux/refcount.h:109 #5 0x0000000000536771 in thread__get (thread=0x7fffe8009a40) at util/thread.c:115 #6 0x0000000000523cd0 in ____machine__findnew_thread (machine=0xbfde38, threads=0xbfdf28, pid=2, tid=2, create=true) at util/machine.c:432 #7 0x0000000000523eb4 in __machine__findnew_thread (machine=0xbfde38, pid=2, tid=2) at util/machine.c:489 #8 0x0000000000523f24 in machine__findnew_thread (machine=0xbfde38, pid=2, tid=2) at util/machine.c:499 #9 0x0000000000526fbe in machine__process_fork_event (machine=0xbfde38, ... The failing assertion is this one: REFCOUNT_WARN(!refcount_inc_not_zero(r), ... the problem is that we don't serialize access to threads::last_match. We serialize the access to the threads tree, but we don't care how's threads::last_match being accessed. Both locked/unlocked paths use that data and can set it. In multithreaded mode we can end up with invalid object in thread__get call, like in following paths race: thread 1 ... machine__findnew_thread down_write(&threads->lock); __machine__findnew_thread ____machine__findnew_thread th = threads->last_match; if (th->tid == tid) { thread__get thread 2 ... machine__find_thread down_read(&threads->lock); __machine__findnew_thread ____machine__findnew_thread th = threads->last_match; if (th->tid == tid) { thread__get thread 3 ... machine__process_fork_event machine__remove_thread __machine__remove_thread threads->last_match = NULL thread__put thread__put Thread 1 and 2 might got stale last_match, before thread 3 clears it. Thread 1 and 2 then race with thread 3's thread__put and they might trigger the refcnt == 0 assertion above. The patch is disabling the last_match cache for multiple thread mode. It was originally meant for single thread scenarios, where it's common to have multiple sequential searches of the same thread. In multithread mode this does not make sense, because top's threads processes different /proc entries and so the 'struct threads' object is queried for various threads. Moreover we'd need to add more locks to make it work. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Kan Liang Cc: Lukasz Odzioba Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/20180719143345.12963-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 67fda0f32cd9428cb9a3166796162097d7fcbcbf Author: Jiri Olsa Date: Thu Jul 19 16:33:43 2018 +0200 perf machine: Add threads__set_last_match function Separating threads::last_match cache set into separate threads__set_last_match function. This will be useful in following patch. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Kan Liang Cc: Lukasz Odzioba Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/20180719143345.12963-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f8b2ebb532e0553b60ae5ad1b84d1d4f0c285752 Author: Jiri Olsa Date: Thu Jul 19 16:33:42 2018 +0200 perf machine: Add threads__get_last_match function Separating threads::last_match cache read/check into separate threads__get_last_match function. This will be useful in following patch. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Kan Liang Cc: Lukasz Odzioba Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/20180719143345.12963-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e8fedff1cc729fd227924305152ccc6f580e8c83 Author: Jiri Olsa Date: Thu Jul 12 15:52:02 2018 +0200 perf tools: Synthesize GROUP_DESC feature in pipe mode Stephan reported, that pipe mode does not carry the group information and thus the piped report won't display the grouped output for following command: # perf record -e '{cycles,instructions,branches}' -a sleep 4 | perf report It has no idea about the group setup, so it will display events separately: # Overhead Command Shared Object ... # ........ ............... ....................... # 6.71% swapper [kernel.kallsyms] 2.28% offlineimap libpython2.7.so.1.0 0.78% perf [kernel.kallsyms] ... Fix GROUP_DESC feature record to be synthesized in pipe mode, so the report output is grouped if there are groups defined in record: # Overhead Command Shared ... # ........................ ............... ....... # 7.57% 0.16% 0.30% swapper [kernel 1.87% 3.15% 2.46% offlineimap libpyth 1.33% 0.00% 0.00% perf [kernel ... Reported-by: Stephane Eranian Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Tested-by: Stephane Eranian Cc: Alexander Shishkin Cc: David Ahern Cc: David Carrillo-Cisneros Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180712135202.14774-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2a9d5050dc84fa2060f08a52f632976923e0fa7e Author: Sandipan Das Date: Tue Jul 3 17:35:55 2018 +0530 perf script: Show correct offsets for DWARF-based unwinding When perf/data is recorded with the dwarf call-graph option, the callchain shown by 'perf script' still shows the binary offsets of the userspace symbols instead of their virtual addresses. Since the symbol offset calculation is based on using virtual address as the ip, we see incorrect offsets as well. The use of virtual addresses affects the ability to find out the line number in the corresponding source file to which an address maps to as described in commit 67540759151a ("perf unwind: Use addr_location::addr instead of ip for entries"). This has also been addressed by temporarily converting the virtual address to the correponding binary offset so that it can be mapped to the source line number correctly. This is a follow-up for commit 19610184693c ("perf script: Show virtual addresses instead of offsets"). This can be verified on a powerpc64le system running Fedora 27 as shown below: # perf probe -x /usr/lib64/libc-2.26.so -a inet_pton # perf record -e probe_libc:inet_pton --call-graph=dwarf ping -6 -c 1 ::1 Before: # perf report --stdio --no-children -s sym,srcline -g address # Samples: 1 of event 'probe_libc:inet_pton' # Event count (approx.): 1 # # Overhead Symbol Source:Line # ........ .................... ........... # 100.00% [.] __GI___inet_pton inet_pton.c | ---gaih_inet getaddrinfo.c:537 (inlined) __GI_getaddrinfo getaddrinfo.c:2304 (inlined) main ping.c:519 generic_start_main libc-start.c:308 (inlined) __libc_start_main libc-start.c:102 ... # perf script -F comm,ip,sym,symoff,srcline,dso ping 15af28 __GI___inet_pton+0xffff000099160008 (/usr/lib64/libc-2.26.so) libc-2.26.so[ffff80004ca0af28] 10fa53 gaih_inet+0xffff000099160f43 libc-2.26.so[ffff80004c9bfa53] (inlined) 1105b3 __GI_getaddrinfo+0xffff000099160163 libc-2.26.so[ffff80004c9c05b3] (inlined) 2d6f main+0xfffffffd9f1003df (/usr/bin/ping) ping[fffffffecf882d6f] 2369f generic_start_main+0xffff00009916013f libc-2.26.so[ffff80004c8d369f] (inlined) 23897 __libc_start_main+0xffff0000991600b7 (/usr/lib64/libc-2.26.so) libc-2.26.so[ffff80004c8d3897] After: # perf report --stdio --no-children -s sym,srcline -g address # Samples: 1 of event 'probe_libc:inet_pton' # Event count (approx.): 1 # # Overhead Symbol Source:Line # ........ .................... ........... # 100.00% [.] __GI___inet_pton inet_pton.c | ---gaih_inet.constprop.7 getaddrinfo.c:537 getaddrinfo getaddrinfo.c:2304 main ping.c:519 generic_start_main.isra.0 libc-start.c:308 __libc_start_main libc-start.c:102 ... # perf script -F comm,ip,sym,symoff,srcline,dso ping 7fffb38aaf28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so) inet_pton.c:68 7fffb385fa53 gaih_inet.constprop.7+0xf43 (/usr/lib64/libc-2.26.so) getaddrinfo.c:537 7fffb38605b3 getaddrinfo+0x163 (/usr/lib64/libc-2.26.so) getaddrinfo.c:2304 130782d6f main+0x3df (/usr/bin/ping) ping.c:519 7fffb377369f generic_start_main.isra.0+0x13f (/usr/lib64/libc-2.26.so) libc-start.c:308 7fffb3773897 __libc_start_main+0xb7 (/usr/lib64/libc-2.26.so) libc-start.c:102 Signed-off-by: Sandipan Das Acked-by: Jiri Olsa Cc: Milian Wolff Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Ravi Bangoria Fixes: 67540759151a ("perf unwind: Use addr_location::addr instead of ip for entries") Link: http://lkml.kernel.org/r/20180703120555.32971-1-sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit a7f660d6576a5f4504c8ab4f4956bba03d48bf52 Author: Kim Phillips Date: Fri Jul 6 16:34:54 2018 -0500 perf trace arm64: Use generated syscall table This should speed up accessing new system calls introduced with the kernel rather than waiting for libaudit updates to include them. It also enables users to specify wildcards, for example, perf trace -e 'open*', just like was already possible on x86, s390, and powerpc, which means arm64 can now pass the "Check open filename arg using perf trace + vfs_getname" test. Signed-off-by: Kim Phillips Reviewed-by: Hendrik Brueckner Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Michael Ellerman Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Thomas Richter Link: http://lkml.kernel.org/r/20180706163454.f714b9ab49ecc8566a0b3565@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 2b5882435606c209ebc052230f03505ea477a252 Author: Kim Phillips Date: Fri Jul 6 16:34:43 2018 -0500 perf arm64: Generate system call table from asm/unistd.h This should speed up accessing new system calls introduced with the kernel rather than waiting for libaudit updates to include them. Using the existing other arch scripts resulted in this error: tools/perf/arch/arm64/entry/syscalls//mksyscalltbl: 25: printf: __NR3264_ftruncate: expected numeric value because, unlike other arches, asm-generic's unistd.h does things like: #define __NR_ftruncate __NR3264_ftruncate Turning the scripts printf's %d into a %s resulted in this in the generated syscalls.c file: static const char *syscalltbl_arm64[] = { [__NR3264_ftruncate] = "ftruncate", So we use the host C compiler to fold the macros, and print them out from within a temporary C program, in order to get the correct output: static const char *syscalltbl_arm64[] = { [46] = "ftruncate", Committer notes: Testing this with a container with an old toolchain breaks because it ends up using the system's /usr/include/asm-generic/unistd.h, included from tools/arch/arm64/include/uapi/asm/unistd.h when what is desired is for it to include tools/include/uapi/asm-generic/unistd.h. Since all that tools/arch/arm64/include/uapi/asm/unistd.h is to set a define and then include asm-generic/unistd.h, do that directly and use tools/include/uapi/asm-generic/unistd.h as the file to get the syscall definitions to expand. Testing it: tools/perf/arch/arm64/entry/syscalls/mksyscalltbl /gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc gcc tools/include/uapi/asm-generic/unistd.h Now works and generates in the syscall string table. Before it ended up as: $ tools/perf/arch/arm64/entry/syscalls/mksyscalltbl /gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc gcc tools/arch/arm64/include/uapi/asm/unistd.h static const char *syscalltbl_arm64[] = { : In function 'main': :257:38: error: '__NR_getrandom' undeclared (first use in this function) :257:38: note: each undeclared identifier is reported only once for each function it appears in :258:41: error: '__NR_memfd_create' undeclared (first use in this function) :259:32: error: '__NR_bpf' undeclared (first use in this function) :260:37: error: '__NR_execveat' undeclared (first use in this function) tools/perf/arch/arm64/entry/syscalls/mksyscalltbl: 47: tools/perf/arch/arm64/entry/syscalls/mksyscalltbl: /tmp/create-table-60liya: Permission denied }; $ Signed-off-by: Kim Phillips Reviewed-by: Hendrik Brueckner Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Michael Ellerman Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Thomas Richter Link: http://lkml.kernel.org/r/20180706163443.22626f5e9e10e5bab5e5c662@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 34b009cfde2b8ce20a69c7bfd6bad4ce0e7cd970 Author: Kim Phillips Date: Fri Jul 6 16:34:34 2018 -0500 tools include: Grab copies of arm64 dependent unistd.h files Will be used for generating the syscall id/string translation table. The arm64 unistd.h file simply #includes the asm-generic/unistd.h, so, since we will want to know whether either change, we grab both: arch/arm64/include/uapi/asm/unistd.h and include/uapi/asm-generic/unistd.h Signed-off-by: Kim Phillips Cc: Alexander Shishkin Cc: Hendrik Brueckner Cc: Jiri Olsa Cc: Michael Ellerman Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Thomas Richter Link: http://lkml.kernel.org/r/20180706163434.1b64ffbcc0284fb79982f53b@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 60089e42d38438772e2f83334e3e5b7497009366 Author: Sandipan Das Date: Tue Jul 10 19:28:17 2018 +0530 perf tests: Fix record+probe_libc_inet_pton.sh when event exists If the event 'probe_libc:inet_pton' already exists, this test fails and deletes the existing event before exiting. This will then pass for any subsequent executions. Instead of skipping to deleting the existing event because of failing to add a new event, a duplicate event is now created and the script continues with the usual checks. Only the new duplicate event that is created at the beginning of the test is deleted as a part of the cleanups in the end. All existing events remain as it is. This can be observed on a powerpc64 system running Fedora 27 as shown below. # perf probe -x /usr/lib64/power8/libc-2.26.so -a inet_pton Added new event: probe_libc:inet_pton (on inet_pton in /usr/lib64/power8/libc-2.26.so) Before: # perf test -v "probe libc's inet_pton & backtrace it with ping" 62: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 21302 test child finished with -1 ---- end ---- probe libc's inet_pton & backtrace it with ping: FAILED! # perf probe --list After: # perf test -v "probe libc's inet_pton & backtrace it with ping" 62: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 21490 ping 21513 [035] 39357.565561: probe_libc:inet_pton_1: (7fffa4c623b0) 7fffa4c623b0 __GI___inet_pton+0x0 (/usr/lib64/power8/libc-2.26.so) 7fffa4c190dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/libc-2.26.so) 7fffa4c19c4c getaddrinfo+0x15c (/usr/lib64/power8/libc-2.26.so) 111d93c20 main+0x3e0 (/usr/bin/ping) test child finished with 0 ---- end ---- probe libc's inet_pton & backtrace it with ping: Ok # perf probe --list probe_libc:inet_pton (on __inet_pton@resolv/inet_pton.c in /usr/lib64/power8/libc-2.26.so) Signed-off-by: Sandipan Das Cc: Jiri Olsa Cc: Kim Phillips Cc: Naveen N. Rao Cc: Ravi Bangoria Link: http://lkml.kernel.org/r/e11fecff96e6cf4c65cdbd9012463513d7b8356c.1530724939.git.sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 83e3b6d73e66a10088f362b08b99c36fec3a14e7 Author: Sandipan Das Date: Tue Jul 10 19:28:16 2018 +0530 perf tests: Fix record+probe_libc_inet_pton.sh to ensure cleanups If there is a mismatch in the perf script output, this test fails and exits before the event and temporary files created during its execution are cleaned up. This can be observed on a powerpc64 system running Fedora 27 as shown below. # perf test -v "probe libc's inet_pton & backtrace it with ping" 62: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 18655 ping 18674 [013] 24511.496995: probe_libc:inet_pton: (7fffa6b423b0) 7fffa6b423b0 __GI___inet_pton+0x0 (/usr/lib64/power8/libc-2.26.so) 7fffa6af90dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/libc-2.26.so) FAIL: expected backtrace entry "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/power8/libc-2.26.so\)$" got "7fffa6af90dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/libc-2.26.so)" test child finished with -1 ---- end ---- probe libc's inet_pton & backtrace it with ping: FAILED! # ls /tmp/expected.* /tmp/perf.data.* /tmp/perf.script.* /tmp/expected.u31 /tmp/perf.data.Pki /tmp/perf.script.Bhs # perf probe --list probe_libc:inet_pton (on __inet_pton@resolv/inet_pton.c in /usr/lib64/power8/libc-2.26.so) Cleanup of the event and the temporary files are now ensured by allowing the cleanup code to be executed even if the lines from the backtrace do not match their expected patterns instead of simply exiting from the point of failure. Signed-off-by: Sandipan Das Cc: Jiri Olsa Cc: Kim Phillips Cc: Naveen N. Rao Cc: Ravi Bangoria Link: http://lkml.kernel.org/r/ce9fb091dd3028fba8749a1a267cfbcb264bbfb1.1530724939.git.sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3eae52f842329a95f8549124079518231c0daba8 Author: Sandipan Das Date: Tue Jul 10 19:28:15 2018 +0530 perf tests: Fix record+probe_libc_inet_pton.sh for powerpc64 For powerpc64, this test currently fails due to a mismatch in the expected output. This can be observed on a powerpc64le system running Fedora 27 as shown below. # perf test -v "probe libc's inet_pton & backtrace it with ping" Before: 62: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 23948 ping 23965 [003] 71136.075084: probe_libc:inet_pton: (7fff996aaf28) 7fff996aaf28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so) 7fff9965fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so) FAIL: expected backtrace entry 2 "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/libc-2.26.so\)$" got "7fff9965fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so)" test child finished with -1 ---- end ---- probe libc's inet_pton & backtrace it with ping: FAILED! After: 62: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 24638 ping 24655 [001] 71208.525396: probe_libc:inet_pton: (7fffa245af28) 7fffa245af28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so) 7fffa240fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so) 7fffa24105b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so) 138d52d70 main+0x3e0 (/usr/bin/ping) test child finished with 0 ---- end ---- probe libc's inet_pton & backtrace it with ping: Ok Signed-off-by: Sandipan Das Cc: Jiri Olsa Cc: Kim Phillips Cc: Maynard Johnson Cc: Naveen N. Rao Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Fixes: e07d585e2454 ("perf tests: Switch trace+probe_libc_inet_pton to use record") Link: http://lkml.kernel.org/r/49621ec5f37109f0655e5a8c32287ad68d85a1e5.1530724939.git.sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 9068533e4f470daf2b0f29c71d865990acd8826e Author: Sandipan Das Date: Tue Jul 10 19:28:14 2018 +0530 perf powerpc: Fix callchain ip filtering when return address is in a register For powerpc64, perf will filter out the second entry in the callchain, i.e. the LR value, if the return address of the function corresponding to the probed location has already been saved on its caller's stack. The state of the return address is determined using debug information. At any point within a function, if the return address is already saved somewhere, a DWARF expression can tell us about its location. If the return address in still in LR only, no DWARF expression would exist. Typically, the instructions in a function's prologue first copy the LR value to R0 and then pushes R0 on to the stack. If LR has already been copied to R0 but R0 is yet to be pushed to the stack, we can still get a DWARF expression that says that the return address is in R0. This is indicating that getting a DWARF expression for the return address does not guarantee the fact that it has already been saved on the stack. This can be observed on a powerpc64le system running Fedora 27 as shown below. # objdump -d /usr/lib64/libc-2.26.so | less ... 000000000015af20 : 15af20: 0b 00 4c 3c addis r2,r12,11 15af24: e0 c1 42 38 addi r2,r2,-15904 15af28: a6 02 08 7c mflr r0 15af2c: f0 ff c1 fb std r30,-16(r1) 15af30: f8 ff e1 fb std r31,-8(r1) 15af34: 78 1b 7f 7c mr r31,r3 15af38: 78 23 83 7c mr r3,r4 15af3c: 78 2b be 7c mr r30,r5 15af40: 10 00 01 f8 std r0,16(r1) 15af44: c1 ff 21 f8 stdu r1,-64(r1) 15af48: 28 00 81 f8 std r4,40(r1) ... # readelf --debug-dump=frames-interp /usr/lib64/libc-2.26.so | less ... 00027024 0000000000000024 00027028 FDE cie=00000000 pc=000000000015af20..000000000015af88 LOC CFA r30 r31 ra 000000000015af20 r1+0 u u u 000000000015af34 r1+0 c-16 c-8 r0 000000000015af48 r1+64 c-16 c-8 c+16 000000000015af5c r1+0 c-16 c-8 c+16 000000000015af78 r1+0 u u ... # perf probe -x /usr/lib64/libc-2.26.so -a inet_pton+0x18 # perf record -e probe_libc:inet_pton -g ping -6 -c 1 ::1 # perf script Before: ping 2829 [005] 512917.460174: probe_libc:inet_pton: (7fff7e2baf38) 7fff7e2baf38 __GI___inet_pton+0x18 (/usr/lib64/libc-2.26.so) 7fff7e2705b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so) 12f152d70 _init+0xbfc (/usr/bin/ping) 7fff7e1836a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so) 7fff7e183898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so) 0 [unknown] ([unknown]) After: ping 2829 [005] 512917.460174: probe_libc:inet_pton: (7fff7e2baf38) 7fff7e2baf38 __GI___inet_pton+0x18 (/usr/lib64/libc-2.26.so) 7fff7e26fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so) 7fff7e2705b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so) 12f152d70 _init+0xbfc (/usr/bin/ping) 7fff7e1836a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so) 7fff7e183898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so) 0 [unknown] ([unknown]) Reported-by: Ravi Bangoria Signed-off-by: Sandipan Das Cc: Jiri Olsa Cc: Maynard Johnson Cc: Naveen N. Rao Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Link: http://lkml.kernel.org/r/66e848a7bdf2d43b39210a705ff6d828a0865661.1530724939.git.sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit c715fcfda5a08edabaa15508742be926b7ee51db Author: Sandipan Das Date: Tue Jul 10 19:28:13 2018 +0530 perf powerpc: Fix callchain ip filtering For powerpc64, redundant entries in the callchain are filtered out by determining the state of the return address and the stack frame using DWARF debug information. For making these filtering decisions we must analyze the debug information for the location corresponding to the program counter value, i.e. the first entry in the callchain, and not the LR value; otherwise, perf may filter out either the second or the third entry in the callchain incorrectly. This can be observed on a powerpc64le system running Fedora 27 as shown below. Case 1 - Attaching a probe at inet_pton+0x8 (binary offset 0x15af28). Return address is still in LR and a new stack frame is not yet allocated. The LR value, i.e. the second entry, should not be filtered out. # objdump -d /usr/lib64/libc-2.26.so | less ... 000000000010eb10 : ... 10fa48: 78 bb e4 7e mr r4,r23 10fa4c: 0a 00 60 38 li r3,10 10fa50: d9 b4 04 48 bl 15af28 10fa54: 00 00 00 60 nop 10fa58: ac f4 ff 4b b 10ef04 ... 0000000000110450 : ... 1105a8: 54 00 ff 38 addi r7,r31,84 1105ac: 58 00 df 38 addi r6,r31,88 1105b0: 69 e5 ff 4b bl 10eb18 1105b4: 78 1b 71 7c mr r17,r3 1105b8: 50 01 7f e8 ld r3,336(r31) ... 000000000015af20 : 15af20: 0b 00 4c 3c addis r2,r12,11 15af24: e0 c1 42 38 addi r2,r2,-15904 15af28: a6 02 08 7c mflr r0 15af2c: f0 ff c1 fb std r30,-16(r1) 15af30: f8 ff e1 fb std r31,-8(r1) ... # perf probe -x /usr/lib64/libc-2.26.so -a inet_pton+0x8 # perf record -e probe_libc:inet_pton -g ping -6 -c 1 ::1 # perf script Before: ping 4507 [002] 514985.546540: probe_libc:inet_pton: (7fffa7dbaf28) 7fffa7dbaf28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so) 7fffa7d705b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so) 13fb52d70 _init+0xbfc (/usr/bin/ping) 7fffa7c836a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so) 7fffa7c83898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so) 0 [unknown] ([unknown]) After: ping 4507 [002] 514985.546540: probe_libc:inet_pton: (7fffa7dbaf28) 7fffa7dbaf28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so) 7fffa7d6fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so) 7fffa7d705b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so) 13fb52d70 _init+0xbfc (/usr/bin/ping) 7fffa7c836a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so) 7fffa7c83898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so) 0 [unknown] ([unknown]) Case 2 - Attaching a probe at _int_malloc+0x180 (binary offset 0x9cf10). Return address in still in LR and a new stack frame has already been allocated but not used. The caller's caller, i.e. the third entry, is invalid and should be filtered out and not the second one. # objdump -d /usr/lib64/libc-2.26.so | less ... 000000000009cd90 <_int_malloc>: 9cd90: 17 00 4c 3c addis r2,r12,23 9cd94: 70 a3 42 38 addi r2,r2,-23696 9cd98: 26 00 80 7d mfcr r12 9cd9c: f8 ff e1 fb std r31,-8(r1) 9cda0: 17 00 e4 3b addi r31,r4,23 9cda4: d8 ff 61 fb std r27,-40(r1) 9cda8: 78 23 9b 7c mr r27,r4 9cdac: 1f 00 bf 2b cmpldi cr7,r31,31 9cdb0: f0 ff c1 fb std r30,-16(r1) 9cdb4: b0 ff c1 fa std r22,-80(r1) 9cdb8: 78 1b 7e 7c mr r30,r3 9cdbc: 08 00 81 91 stw r12,8(r1) 9cdc0: 11 ff 21 f8 stdu r1,-240(r1) 9cdc4: 4c 01 9d 41 bgt cr7,9cf10 <_int_malloc+0x180> 9cdc8: 20 00 a4 2b cmpldi cr7,r4,32 ... 9cf08: 00 00 00 60 nop 9cf0c: 00 00 42 60 ori r2,r2,0 9cf10: e4 06 ff 7b rldicr r31,r31,0,59 9cf14: 40 f8 a4 7f cmpld cr7,r4,r31 9cf18: 68 05 9d 41 bgt cr7,9d480 <_int_malloc+0x6f0> ... 000000000009e3c0 : ... 9e420: 40 02 80 38 li r4,576 9e424: 78 fb e3 7f mr r3,r31 9e428: 71 e9 ff 4b bl 9cd98 <_int_malloc+0x8> 9e42c: 00 00 a3 2f cmpdi cr7,r3,0 9e430: 78 1b 7e 7c mr r30,r3 ... 000000000009f7a0 <__libc_malloc>: ... 9f8f8: 00 00 89 2f cmpwi cr7,r9,0 9f8fc: 1c ff 9e 40 bne cr7,9f818 <__libc_malloc+0x78> 9f900: c9 ea ff 4b bl 9e3c8 9f904: 00 00 00 60 nop 9f908: e8 90 22 e9 ld r9,-28440(r2) ... # perf probe -x /usr/lib64/libc-2.26.so -a _int_malloc+0x180 # perf record -e probe_libc:_int_malloc -g ./test-malloc # perf script Before: test-malloc 6554 [009] 515975.797403: probe_libc:_int_malloc: (7fffa6e6cf10) 7fffa6e6cf10 _int_malloc+0x180 (/usr/lib64/libc-2.26.so) 7fffa6dd0000 [unknown] (/usr/lib64/libc-2.26.so) 7fffa6e6f904 malloc+0x164 (/usr/lib64/libc-2.26.so) 7fffa6e6f9fc malloc+0x25c (/usr/lib64/libc-2.26.so) 100006b4 main+0x38 (/home/testuser/test-malloc) 7fffa6df36a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so) 7fffa6df3898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so) 0 [unknown] ([unknown]) After: test-malloc 6554 [009] 515975.797403: probe_libc:_int_malloc: (7fffa6e6cf10) 7fffa6e6cf10 _int_malloc+0x180 (/usr/lib64/libc-2.26.so) 7fffa6e6e42c tcache_init.part.4+0x6c (/usr/lib64/libc-2.26.so) 7fffa6e6f904 malloc+0x164 (/usr/lib64/libc-2.26.so) 7fffa6e6f9fc malloc+0x25c (/usr/lib64/libc-2.26.so) 100006b4 main+0x38 (/home/sandipan/test-malloc) 7fffa6df36a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so) 7fffa6df3898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so) 0 [unknown] ([unknown]) Signed-off-by: Sandipan Das Cc: Jiri Olsa Cc: Maynard Johnson Cc: Naveen N. Rao Cc: Ravi Bangoria Cc: Sukadev Bhattiprolu Fixes: a60335ba3298 ("perf tools powerpc: Adjust callchain based on DWARF debug info") Link: http://lkml.kernel.org/r/24bb726d91ed173aebc972ec3f41a2ef2249434e.1530724939.git.sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6feb3fec519ed112f7a77af4e51e51a35148d01c Author: Sangwon Hong Date: Tue Jul 17 20:07:38 2018 +0900 perf list: Add missing documentation for --desc and --debug options Add missing documentation for --desc and --debug options to the 'perf list' man page. Signed-off-by: Sangwon Hong Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20180717110738.10779-1-qpakzk@gmail.com [ Clarify that --desc is by default active ] Signed-off-by: Arnaldo Carvalho de Melo commit 8a95c8994509c55abf1e38c0cc037b1205725e21 Author: Thomas Richter Date: Thu Jul 12 09:09:36 2018 +0200 perf kvm: Fix subcommands on s390 With commit eca0fa28cd0d ("perf record: Provide detailed information on s390 CPU") s390 platform provides detailed type/model/capacity information in the CPU identifier string instead of just "IBM/S390". This breaks 'perf kvm' support which uses hard coded string IBM/S390 to compare with the CPU identifier string. Fix this by changing the comparison. Reported-by: Stefan Raspl Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Tested-by: Stefan Raspl Acked-by: Christian Borntraeger Cc: Heiko Carstens Cc: Martin Schwidefsky Cc: stable@vger.kernel.org Fixes: eca0fa28cd0d ("perf record: Provide detailed information on s390 CPU") Link: http://lkml.kernel.org/r/20180712070936.67547-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 742d92ff219f3aa7a67c184a57acfa8d88936cd6 Author: Thomas Richter Date: Tue Jun 26 09:17:01 2018 +0200 perf stat: Add transaction flag (-T) support for s390 The 'perf stat' command line flag -T to display transaction counters is currently supported for x86 only. Add support for s390. It is based on the metrics flag -M transaction using the architecture dependent JSON files. This requires a metric named "transaction" in the JSON files for the platform. Introduce a new function metricgroup__has_metric() to check for the existence of a metric_name transaction. As suggested by Andi Kleen, this is the new approach to support transactions counters. Other architectures will follow. Output before: [root@p23lp27 perf]# ./perf stat -T -- sleep 1 Cannot set up transaction events [root@p23lp27 perf]# Output after: [root@s35lp76 perf]# ./perf stat -T -- ~/mytesttx 1 >/tmp/111 Performance counter stats for '/root/mytesttx 1': 1 tx_c_tend # 13.0 transaction 1 tx_nc_tend 11 tx_nc_tabort 0 tx_c_tabort_special 0 tx_c_tabort_no_special 0.001070109 seconds time elapsed [root@s35lp76 perf]# Suggested-by: Andi Kleen Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Acked-by: Andi Kleen Acked-by: Jiri Olsa Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180626071701.58190-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 83eb383e942bba7aab465a334d2c365d3f47a0ae Author: Thomas Richter Date: Thu Jun 21 10:04:51 2018 +0200 perf json: Add s390 transaction counter definition 'perf stat' displays transactional counters using flag -T on x86. On s390 use a JSON file defined metric named transaction to achieve the same result. Output before: none Output after: [root@s35lp76 perf]# ./perf stat -M transaction -- \ ~/mytesttx 1 >/tmp/111 Performance counter stats for '/root/mytesttx 1': 1 tx_c_tend # 13.0 transaction 1 tx_nc_tend 11 tx_nc_tabort 0 tx_c_tabort_special 0 tx_c_tabort_no_special 0.001061232 seconds time elapsed [root@s35lp76 perf]# Suggested-by: Andi Kleen Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180621080452.61012-3-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 9bacbced0e32204deb8b9d011279f9beddd8c2ef Author: Thomas Richter Date: Thu Jun 21 10:04:50 2018 +0200 perf list: Add s390 support for detailed PMU event description Correct the support of detailed/verbose PMU event description by using the "Unit": keyword in the json files to address event names refering to the /sys/devices/cpum_[cs]f devices. Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180621080452.61012-2-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit b8b5ab52bc3a0423080783ae563801077f7ea400 Author: Thomas Richter Date: Thu Jun 21 10:04:49 2018 +0200 Revert "perf list: Add s390 support for detailed/verbose PMU event description" This reverts commit 038586c34301578e538f6c5aa79ca82bce1b9152. Fix the support of detailed/verbose PMU event description by using the "Unit": keyword in the json files to address event names refering to the /sys/devices/cpum_[cs]f devices. Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Heiko Carstens Cc: Hendrik Brueckner Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180621080452.61012-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6cd4ac6a02c9bc6560faf567ac013902ab9cd039 Author: Leo Yan Date: Mon Jun 18 13:09:55 2018 +0800 perf cs-etm: Bail out immediately for instruction sample failure If the instruction sample failure has happened, it isn't necessary to execute to the end of the function cs_etm__flush(). This commit is to bail out immediately and return the error code. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1529298599-3876-3-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 6abf0f451087176caf0f9ad0cc2a79bcc5ebb443 Author: Leo Yan Date: Mon Jun 18 13:09:54 2018 +0800 perf cs-etm: Introduce invalid address macro This patch introduces invalid address macro and uses it to replace dummy value '0xdeadbeefdeadbeefUL'. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1529298599-3876-2-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 491ec1553e0075f345fbe476a93775eabcbc40b6 Author: Alexander Sverdlin Date: Tue Jul 24 14:32:00 2018 +0200 MIPS: Octeon: Select HAS_RAPIDIO All Octeons starting with Octeon II have RAPIDIO controller which can function even with PCI disabled. Signed-off-by: Alexander Sverdlin Acked-by: Alexandre Bounine Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19988/ Cc: linux-mips@linux-mips.org Cc: Ralf Baechle Cc: James Hogan Cc: Matt Porter commit e9de7e2f7e22989fefc760cf0920062c58b2b2b1 Author: Arnaldo Carvalho de Melo Date: Wed Jun 20 15:58:20 2018 -0300 perf hists: Clarify callchain disabling when available We want to allow having mixed events with/without callchains, not using a global flag to show callchains, but allowing supressing callchains when they are present. So invert the logic of the last parameter to hists__fprint() to that effect. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-ohqyisr6qge79qa95ojslptx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 06dc5bf21f3f90750fcc073fbc6ce2a0324df051 Author: Alexey Budankov Date: Tue Jun 19 11:45:40 2018 +0300 perf tests: Check that complex event name is parsed correctly Extend regression testing to cover case of complex event names enabled by the cset f92da71280fb ("perf record: Enable arbitrary event names thru name= modifier"). Testing it: # perf test 1: vmlinux symtab matches kallsyms : Skip 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok <===! 7: Simple expression parser : Ok ... Committer testing: # perf test "event definition" 6: Parse event definition strings : Ok # perf test -v 6 2> /tmp/before # perf test -v 6 2> /tmp/after # diff -u /tmp/before /tmp/after --- /tmp/before 2018-06-19 10:50:21.485572638 -0300 +++ /tmp/after 2018-06-19 10:50:40.886572896 -0300 @@ -1,6 +1,6 @@ 6: Parse event definition strings : --- start --- -test child forked, pid 24259 +test child forked, pid 24904 running test 0 'syscalls:sys_enter_openat'Using CPUID GenuineIntel-6-3D registering plugin: /root/.traceevent/plugins/plugin_kvm.so registering plugin: /root/.traceevent/plugins/plugin_hrtimer.so @@ -136,9 +136,11 @@ running test 50 '4:0x6530160/name=numpmu/' running test 51 'L1-dcache-misses/name=cachepmu/' running test 52 'intel_pt//u' +running test 53 'cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk' running test 0 'cpu/config=10,config1,config2=3,period=1000/u' running test 1 'cpu/config=1,name=krava/u,cpu/config=2/u' running test 2 'cpu/config=1,call-graph=fp,time,period=100000/,cpu/config=2,call-graph=no,time=0,period=2000/' +running test 3 'cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2,umask=0x3/ukp' el-capacity -> cpu/event=0x54,umask=0x2/ el-conflict -> cpu/event=0x54,umask=0x1/ el-start -> cpu/event=0xc8,umask=0x1/ # Signed-off-by: Alexey Budankov Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/ad30b774-219b-7b80-c610-4e9e298cf8a7@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit fc5d988878942e9b42a4de5204bdd452f3f1ce47 Author: Alexander Sverdlin Date: Tue Jul 24 14:31:59 2018 +0200 MIPS: Introduce HAS_RAPIDIO Kconfig option Introduce the same option as PPC and ARM already have because RAPIDIO can function in the absence of PCI. Signed-off-by: Alexander Sverdlin Acked-by: Alexandre Bounine Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19987/ Cc: linux-mips@linux-mips.org Cc: Ralf Baechle Cc: James Hogan Cc: Matt Porter commit 1d59d16e9b4d5be80c9786a8b129c0f2af0e9522 Merge: 788faab70d5a 4799f6856fdd Author: Arnaldo Carvalho de Melo Date: Tue Jul 24 14:34:32 2018 -0300 Merge remote-tracking branch 'tip/perf/urgent' into perf/core To pick up fixes. Signed-off-by: Arnaldo Carvalho de Melo commit c5b974bee9d2ceae4c441ae5a01e498c2674e100 Author: Gustavo A. R. Silva Date: Sat Jul 7 12:44:01 2018 -0500 iio: sca3000: Fix missing return in switch The IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY case is missing a return and will fall through to the default case and errorenously return -EINVAL. Fix this by adding in missing *return ret*. Fixes: 626f971b5b07 ("staging:iio:accel:sca3000 Add write support to the low pass filter control") Reported-by: Jonathan Cameron Signed-off-by: Gustavo A. R. Silva Cc: Signed-off-by: Jonathan Cameron commit 5a4e33c1c53ae7d4425f7d94e60e4458a37b349e Author: Lars-Peter Clausen Date: Mon Jun 25 11:03:07 2018 +0300 iio: ad9523: Fix displayed phase Fix the displayed phase for the ad9523 driver. Currently the most significant decimal place is dropped and all other digits are shifted one to the left. This is due to a multiplication by 10, which is not necessary, so remove it. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Fixes: cd1678f9632 ("iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator") Cc: Signed-off-by: Jonathan Cameron commit c4ef85da7818e2027f8b6e885e364bb9defcc488 Merge: 6eb5e652bcc3 ae2a922fae02 Author: David S. Miller Date: Tue Jul 24 10:12:22 2018 -0700 Merge branch 'cxgb4-collect-free-Tx-Rx-pages-and-page-pointers' Rahul Lakkireddy says: ==================== cxgb4: collect free Tx/Rx pages and page pointers Patch 1 collects number of free PSTRUCT page pointers in context memory. Patch 2 moves the collection logic for Tx/Rx free pages to common code, since this information needs to be collected in vmcore device dump as well. ==================== Signed-off-by: David S. Miller commit ae2a922fae023164b3e0de62db3a2e6e93305c2e Author: Rahul Lakkireddy Date: Tue Jul 24 20:17:10 2018 +0530 cxgb4: move Tx/Rx free pages collection to common code This information needs to be collected in vmcore device dump as well. So, move to common code. Fixes: fa145d5dfd61 ("cxgb4: display number of rx and tx pages free") Signed-off-by: Rahul Lakkireddy Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 9d0f180cd509aec0172ae15bf1aed54de34d1132 Author: Rahul Lakkireddy Date: Tue Jul 24 20:17:09 2018 +0530 cxgb4: collect number of free PSTRUCT page pointers Signed-off-by: Rahul Lakkireddy Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 88fe4ceb2447773f6d0c6e3642dc46fcd6a4cdd1 Author: Hans de Goede Date: Tue Jul 24 19:11:28 2018 +0200 efifb: BGRT: Do not copy the boot graphics for non native resolutions On x86 some firmwares use a low non native resolution for the display when they have shown some text messages. While keeping the bgrt filled with info for the native resolution. If the bgrt image intended for the native resolution still fits, it will be displayed very close to the right edge of the display looking quite bad. This commits adds a (heuristics based) checks for this and makes efifb not show the boot graphics when this is the case. Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit 93de35c92a06f97f2f7c5d43170db10f8b774981 Author: Randy Dunlap Date: Tue Jul 24 19:11:28 2018 +0200 fbdev: fix omap2/omapfb/dss/ indentation warning Fix indentation warning (from gcc 8.1.0) in omap2/omapfb: ../drivers/video/fbdev/omap2/omapfb/dss/dispc.c: In function 'pixinc': ../drivers/video/fbdev/omap2/omapfb/dss/dispc.c:1859:2: warning: this 'else' clause does not guard... [-Wmisleading-indentation] else ^~~~ ../drivers/video/fbdev/omap2/omapfb/dss/dispc.c:1861:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else' return 0; ^~~~~~ Signed-off-by: Randy Dunlap Signed-off-by: Bartlomiej Zolnierkiewicz commit f406a464cd87f907c3470273d922562b15aafd77 Author: Colin Ian King Date: Tue Jul 24 19:11:28 2018 +0200 omapfb: encoder-tpd12s015: remove redundant pointer 'in' Pointer 'in' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'in' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Bartlomiej Zolnierkiewicz commit 8974b76ddc933151395db6085bf49fad8cd0346b Author: Colin Ian King Date: Tue Jul 24 19:11:28 2018 +0200 video: fbdev: tridentfb: remove deadcode on unreachable case statement The value of tmp being used in the switch statement has the range of just 0..3 hence the case 4 statement can never be reached and is deadcode and can be removed. Detected by CoverityScan, CID#744384 ("Logically dead code") Signed-off-by: Colin Ian King Signed-off-by: Bartlomiej Zolnierkiewicz commit 5ec1ec35b2979b59d0b33381e7c9aac17e159d16 Author: Dan Carpenter Date: Tue Jul 24 19:11:28 2018 +0200 fbdev: omapfb: off by one in omapfb_register_client() The omapfb_register_client[] array has OMAPFB_PLANE_NUM elements so the > should be >= or we are one element beyond the end of the array. Fixes: 8b08cf2b64f5 ("OMAP: add TI OMAP framebuffer driver") Signed-off-by: Dan Carpenter Cc: Imre Deak Signed-off-by: Bartlomiej Zolnierkiewicz commit 12382ad98ca06afb7ce4dce53aebf115b5f6b948 Author: Gustavo A. R. Silva Date: Tue Jul 24 19:11:28 2018 +0200 video: fbdev: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Cc: Florian Tobias Schandinat Signed-off-by: Bartlomiej Zolnierkiewicz commit 2968b5265f00c14fbb44daa2721cf07ff7a917d9 Author: Gustavo A. R. Silva Date: Tue Jul 24 19:11:27 2018 +0200 omapfb: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Bartlomiej Zolnierkiewicz commit 810180fc8e63f75e8bdaba42057781a50925aa06 Author: Gustavo A. R. Silva Date: Tue Jul 24 19:11:27 2018 +0200 fbdev: fbmem: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Bartlomiej Zolnierkiewicz commit b6566b47a67e07fdca44cf51abb14e2fbe17d3eb Author: Randy Dunlap Date: Tue Jul 24 19:11:27 2018 +0200 fbdev/via: fix defined but not used warning Fix a build warning in viafbdev.c when CONFIG_PROC_FS is not enabled by marking the unused function as __maybe_unused. ../drivers/video/fbdev/via/viafbdev.c:1471:12: warning: 'viafb_sup_odev_proc_show' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap Cc: Florian Tobias Schandinat Signed-off-by: Bartlomiej Zolnierkiewicz commit 4bcd8c90ac0f27d3d76fcfc50582ff3685059de9 Author: Arnd Bergmann Date: Tue Jul 24 19:11:27 2018 +0200 omapfb: rename omap2 module to omap2fb.ko In a kernel configuration with both CONFIG_FB_OMAP=m and CONFIG_FB_OMAP2=m, Kbuild fails to point out that we have two modules with the same name (omapfb.ko), but instead fails with a cryptic error message like: ERROR: "omapfb_register_panel" [drivers/video/fbdev/omap/lcd_osk.ko] undefined! This can now happen when building a randconfig kernel with CONFIG_ARCH_OMAP1, as the omap1 fbdev driver depends on that, whiel the omap2 fbdev driver can now be built anywhere with CONFIG_COMPILE_TEST. The solution is to rename one of the two modules, so for consistency with the directory naming I decided to rename the omap2 version to omap2fb.ko. Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST") Signed-off-by: Arnd Bergmann Acked-by: Tony Lindgren Cc: Mauro Carvalho Chehab Signed-off-by: Bartlomiej Zolnierkiewicz commit 5958fde72d04e7b8c6de3669d1f794a90997e3eb Author: Anton Vasilyev Date: Tue Jul 24 19:11:27 2018 +0200 video: goldfishfb: fix memory leak on driver remove goldfish_fb_probe() allocates memory for fb, but goldfish_fb_remove() does not have deallocation of fb, which leads to memory leak on probe/remove. The patch adds deallocation into goldfish_fb_remove(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Cc: Aleksandar Markovic Cc: Miodrag Dinic Cc: Goran Ferenc Signed-off-by: Bartlomiej Zolnierkiewicz commit e32e2fe64a534ccd3ab8d9dbc5f7d5d302dfba50 Author: Daniel Vetter Date: Tue Jul 24 19:11:27 2018 +0200 fbdev: fix modedb docs in fb_find_mode Fix up the indenting that confused sphinx. To make sure we don't have to make the examples unreadable with escaping just put them in as block quotes, that seems the simplest solution. Signed-off-by: Daniel Vetter [b.zolnierkie: ported over fbdev changes] Signed-off-by: Bartlomiej Zolnierkiewicz commit 5c820b80640508d34b2294b5fe8f78e0c20f3e3e Author: Dan Carpenter Date: Tue Jul 24 19:11:26 2018 +0200 video: fbdev: metronomefb: fix some off by one bugs The "mem" buffer has "size" bytes. The ">" should be ">=" to prevent reading one character beyond the end of the array. Signed-off-by: Dan Carpenter Signed-off-by: Bartlomiej Zolnierkiewicz commit ff459c2dc0b51e5041af65dae44e44233ff26b48 Author: Lyude Paul Date: Tue Jul 24 19:11:26 2018 +0200 video/console/vgacon: Print big fat warning with nomodeset It's been a pretty good while since kernel modesetting was introduced. It has almost entirely replaced previous solutions which required userspace modesetting, and I can't even recall any drivers off the top of my head for modern day hardware that don't only support one or the other. Even nvidia's ugly blob does not require the use of nomodeset, and only requires that nouveau be blacklisted. Effectively, the only thing nomodeset does in the year 2018 is disable your graphics drivers. Since VESA is a thing, this will give many users the false impression that they've actually fixed an issue they were having with their machine simply because the laptop will boot up to a degraded GUI. This of course, is never actually the case. Things get even worse when you consider that there's still an enormous amount of tutorials users find on the internet that still suggest adding nomodeset, along with various users who have been around long enough to still suggest it. There really isn't any legitimate reason I can see for this to be an option that's used by anyone else other then developers, or properly informed users. So, let's end the confusion and start printing warnings whenever it's enabled. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Acked-by: Jani Nikula Cc: Kees Cook Cc: "Jan H. Schönherr" Cc: Bjorn Helgaas Signed-off-by: Bartlomiej Zolnierkiewicz commit 3d910ef71732d15f251ca9b679da634adca72f5a Author: Yisheng Xie Date: Tue Jul 24 19:11:26 2018 +0200 fbdev: fix typo in comment Change beeng to being and occured to occurred. Signed-off-by: Yisheng Xie Acked-by: Hans de Goede Cc: Kees Cook Cc: David Lechner Cc: Andy Shevchenko Signed-off-by: Bartlomiej Zolnierkiewicz commit 10ac86884b4d7642a235f9da61367c3f8d2ab2ff Author: Yisheng Xie Date: Tue Jul 24 19:11:26 2018 +0200 fbcon: introduce for_each_registered_fb() helper Following pattern is often used: for (i = 0; i < FB_MAX; i++) { if (registered_fb[i]) { ... } } Therefore, as Andy's suggestion, for_each_registered_fb() helper can be introduced to make the code easier to read and write by reducing indentation level. It also saves few lines of code in each occurrence. This patch convert all part here at the same time. Suggested-by: Andy Shevchenko Signed-off-by: Yisheng Xie Acked-by: Hans de Goede Reviewed-by: Andy Shevchenko Cc: Kees Cook Cc: David Lechner Signed-off-by: Bartlomiej Zolnierkiewicz commit 4a1208c5b46a711d7d8bb2b327ae5c2b144a8e72 Author: Kees Cook Date: Tue Jul 24 19:11:26 2018 +0200 video: fbdev: fsl-diu-fb: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this moves the buffer off the stack (since it could be as much as 1024 bytes), and uses a new area in the cursor data structure. Additionally adds missed documentation and removes redundant assignments. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Timur Tabi Signed-off-by: Bartlomiej Zolnierkiewicz commit 31e1391af210fdbf177966579a83d14e6a4cd828 Author: Daniel Mack Date: Tue Jul 24 19:11:26 2018 +0200 video: fbdev: pxafb: Add support for lcd-supply regulator Optionally obtain a lcd-supply regulator during probe and use it in __pxafb_lcd_power() to switch the power supply of LCD panels. This helps boards booted from DT to control such voltages without callbacks. Signed-off-by: Daniel Mack Reviewed-by: Robert Jarzmik Signed-off-by: Bartlomiej Zolnierkiewicz commit a2f2058e3d295fbaa5f681c1651cb5a8df840966 Author: Daniel Mack Date: Tue Jul 24 19:11:25 2018 +0200 video: fbdev: pxafb: handle errors from pxafb_init_fbinfo() correctly pxafb_init_fbinfo() can not only report errors caused by failed allocations but also when the clock can't be found. To fix this, return an error pointer instead of NULL in case of errors, and up-chain the result. Signed-off-by: Daniel Mack Reviewed-by: Robert Jarzmik Signed-off-by: Bartlomiej Zolnierkiewicz commit c8f96304ec8b49f361c2ede3b3a73a2291e0f687 Author: Daniel Mack Date: Tue Jul 24 19:11:25 2018 +0200 video: fbdev: pxafb: switch to devm_* API This helps us clean up the probe() and remove() implementations. Signed-off-by: Daniel Mack Reviewed-by: Robert Jarzmik Signed-off-by: Bartlomiej Zolnierkiewicz commit b951d80aaf224b1f774e10def672f5e37488e4ee Author: Daniel Mack Date: Tue Jul 24 19:11:25 2018 +0200 video: fbdev: pxafb: clear allocated memory for video modes When parsing the video modes from DT properties, make sure to zero out memory before using it. This is important because not all fields in the mode struct are explicitly initialized, even though they are used later on. Fixes: 420a488278e86 ("video: fbdev: pxafb: initial devicetree conversion") Reviewed-by: Robert Jarzmik Signed-off-by: Daniel Mack Signed-off-by: Bartlomiej Zolnierkiewicz commit aa45ee8e5430b943acedc41cc08d26ada9088d32 Author: Daniel Mack Date: Tue Jul 24 19:11:25 2018 +0200 video: fbdev: pxa3xx_gcu: add devicetree bindings Add a device tree match table for this hardware graphics acceleration driver so it can be used by pxa3xx boards booted with a devicetree. Signed-off-by: Daniel Mack Reviewed-by: Robert Jarzmik Cc: Rob Herring Cc: David Airlie Cc: Mark Rutland Signed-off-by: Bartlomiej Zolnierkiewicz commit cf925575d292b2cd5ada0499be22107cc2331878 Author: Daniel Mack Date: Tue Jul 24 19:11:24 2018 +0200 dt-bindings: display: add devicetree bindings for pxa300-gcu This patch adds the binding documentation for the pxa300 gcu. Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Cc: David Airlie Cc: Mark Rutland Cc: Robert Jarzmik Signed-off-by: Bartlomiej Zolnierkiewicz commit 1ba0a59cea41ea05fda92daaf2a2958a2246b9cf Author: Fredrik Noring Date: Tue Jul 24 19:11:24 2018 +0200 fbdev: Distinguish between interlaced and progressive modes I discovered the problem when developing a frame buffer driver for the PlayStation 2 (not yet merged), using the following video modes for the PlayStation 3 in drivers/video/fbdev/ps3fb.c: }, { /* 1080if */ "1080if", 50, 1920, 1080, 13468, 148, 484, 36, 4, 88, 5, FB_SYNC_BROADCAST, FB_VMODE_INTERLACED }, { /* 1080pf */ "1080pf", 50, 1920, 1080, 6734, 148, 484, 36, 4, 88, 5, FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED }, In ps3fb_probe, the mode_option module parameter is used with fb_find_mode but it can only select the interlaced variant of 1920x1080 since the loop matching the modes does not take the difference between interlaced and progressive modes into account. In short, without the patch, progressive 1920x1080 cannot be chosen as a mode_option parameter since fb_find_mode (falsely) thinks interlace is a perfect match. Signed-off-by: Fredrik Noring Cc: "Maciej W. Rozycki" [b.zolnierkie: updated patch description] Signed-off-by: Bartlomiej Zolnierkiewicz commit 6eb5e652bcc35d3cd2ed3f30b1a19c983ec91c02 Merge: 3730cf4dd70b 27c203cd1489 Author: David S. Miller Date: Tue Jul 24 10:10:33 2018 -0700 Merge branch 'mlxsw-Add-extack-messages-for-tc-flower' Ido Schimmel says: ==================== mlxsw: Add extack messages for tc flower Nir says: This patch set adds extack messages support to tc flower part of mlxsw. The messages provide clear reasoning to failures, as some of the available actions and keys are not supported in driver or HW and resources may get exhausted. The first patch deals with propagation of the extack pointer among the functions dealing with key parsing and action sets handling. Following patches 2-4 add appropriate messages across the different layers of mlxsw tc flower implementation. ==================== Signed-off-by: David S. Miller commit 27c203cd148921618260cbbe3061ec290733d384 Author: Nir Dotan Date: Tue Jul 24 17:13:14 2018 +0300 mlxsw: spectrum_flower: Add extack messages Return extack messages in order to explain failures of unsupported actions, keys and invalid user input. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit af1fe786436ae03f28d5797fc1e261f5f65a28cf Author: Nir Dotan Date: Tue Jul 24 17:13:13 2018 +0300 mlxsw: spectrum_acl: Add extack messages Return extack messages for failures in action set creation. Messages provide reasons for not being able to implement the action in HW. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 9c10812afe3ad45325145787973bcf863d51b057 Author: Nir Dotan Date: Tue Jul 24 17:13:12 2018 +0300 mlxsw: core_acl_flex_actions: Add extack messages Return extack messages for failures in action set creation. Errors may occur when action is not currently supported or due to lack of resources. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ad7769ca2d80c379f7441185a7a04de7511aeab1 Author: Nir Dotan Date: Tue Jul 24 17:13:11 2018 +0300 mlxsw: spectrum_acl: Propagate extack pointer Propagate extack pointer in order to add extack messages for ACL. In the follow-up patches, appropriate messages will be added in various points. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 3730cf4dd70b6a36e48d58a862120311411b77f5 Author: Florian Westphal Date: Tue Jul 24 12:47:56 2018 +0200 netlink: do not store start function in netlink_cb ->start() is called once when dump is being initialized, there is no need to store it in netlink_cb. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 34a4399f196c0dd72d1c0fef87bddb81938e3cfb Author: Thomas Petazzoni Date: Tue Jul 24 13:52:08 2018 +0200 mips: use asm-generic version of msi.h This is necessary to be able to include when CONFIG_GENERIC_MSI_IRQ_DOMAIN is enabled. Without this, a build with CONFIG_GENERIC_MSI_IRQ_DOMAIN fails with: In file included from include/linux/kvm_host.h:20:0, from arch/mips/kernel/asm-offsets.c:24: >> include/linux/msi.h:197:10: fatal error: asm/msi.h: No such file or directory #include ^~~~~~~~~~~ compilation terminated. make[2]: *** [arch/mips/kernel/asm-offsets.s] Error 1 make[2]: Target '__build' not remade because of errors. make[1]: *** [prepare0] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [sub-make] Error 2 Signed-off-by: Thomas Petazzoni Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19986/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Cc: Marc Zyngier Cc: Hanna Hawa commit c93622b53e7ab41baab2563df0ac425afd1b45c3 Merge: a527d3f728bf 133bf90dbb8b Author: David S. Miller Date: Tue Jul 24 10:00:54 2018 -0700 Merge tag 'mac80211-next-for-davem-2018-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== Only a few things: * HE (802.11ax) support in HWSIM * bypass TXQ with NDP frames as they're special * convert ahash -> shash in lib80211 TKIP * avoid playing with tailroom counter defer unless needed to avoid issues in some cases ==================== Signed-off-by: David S. Miller commit cd4806911cee3901bc2b5eb95603cf1958720b57 Author: Krzysztof Kozlowski Date: Tue Jul 24 18:48:14 2018 +0200 ARM: exynos: Clear global variable on init error path For most of Exynos SoCs, Power Management Unit (PMU) address space is mapped into global variable 'pmu_base_addr' very early when initializing PMU interrupt controller. A lot of other machine code depends on it so when doing iounmap() on this address, clear the global as well to avoid usage of invalid value (pointing to unmapped memory region). Properly mapped PMU address space is a requirement for all other machine code so this fix is purely theoretical. Boot will fail immediately in many other places after following this error path. Signed-off-by: Krzysztof Kozlowski commit e89549a596b3b039e8fbac487452d0988943444c Author: Krzysztof Kozlowski Date: Tue Jul 24 18:48:07 2018 +0200 ARM: exynos: Remove outdated maintainer information The current maintainers are specified in MAINTAINERS file, so remove in-sources information with outdated e-mail address (Thomas Abraham's email does not work, Kukjin Kim uses @kernel.org). Signed-off-by: Krzysztof Kozlowski commit 04ba9488199e3ee9971769cee585ec6847013ed2 Author: Corentin Labbe Date: Tue Jul 17 10:49:35 2018 +0000 Revert "ata: ahci_platform: convert kcalloc to devm_kcalloc" Since ahci_platform_put_resources() use target_pwrs after "devm_" freed it, we cannot use devm_kcalloc for allocating target_pwrs. This reverts commit bd0038b1b4f499d814d8f33a55b1df5ea6cf3b85. Reported-and-reviwed-by: Mikko Perttunen Tested-by: Marcel Ziswiler Tested-by: Jon Hunter Signed-off-by: Corentin Labbe Signed-off-by: Tejun Heo commit c708e462e90e04afb7634e1f27f60cd6869936db Author: Krzysztof Kozlowski Date: Tue Apr 24 22:11:49 2018 +0200 usb: host: exynos: Remove support for Exynos5440 The Exynos5440 is not actively developed, there are no development boards available and probably there are no real products with it. Remove wide-tree support for Exynos5440. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Greg Kroah-Hartman commit fb174b27e8267776bf8c20ca178e82b27c5b2444 Author: Krzysztof Kozlowski Date: Tue Apr 24 22:08:11 2018 +0200 clk: samsung: Remove support for Exynos5440 The Exynos5440 is not actively developed, there are no development boards available and probably there are no real products with it. Remove wide-tree support for Exynos5440. Signed-off-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Acked-by: Stephen Boyd Acked-by: Sylwester Nawrocki commit 73d5e2b472640b1fcdb61ae8be389912ef211bda Author: Josh Poimboeuf Date: Tue Jul 24 18:17:40 2018 +0200 cpu/hotplug: detect SMT disabled by BIOS If SMT is disabled in BIOS, the CPU code doesn't properly detect it. The /sys/devices/system/cpu/smt/control file shows 'on', and the 'l1tf' vulnerabilities file shows SMT as vulnerable. Fix it by forcing 'cpu_smt_control' to CPU_SMT_NOT_SUPPORTED in such a case. Unfortunately the detection can only be done after bringing all the CPUs online, so we have to overwrite any previous writes to the variable. Reported-by: Joe Mario Tested-by: Jiri Kosina Fixes: f048c399e0f7 ("x86/topology: Provide topology_smt_supported()") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra commit 6b24e03ecf1ce188071d142115233b10ed8767b2 Author: Fabio Estevam Date: Tue Jul 24 09:48:33 2018 -0300 ASoC: imx-sgtl5000: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown commit ad47191a72ca0a95327e8bb16155e5e216f1d97d Author: Fabio Estevam Date: Tue Jul 24 09:48:32 2018 -0300 ASoC: fsl_utils: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown commit 2ba28053686334075c8c8bff6c4f6e3fc9ac51ae Author: Fabio Estevam Date: Tue Jul 24 09:48:31 2018 -0300 ASoC: fsl_asrc: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown commit aa624a0a9243460b9037889a05663d3b9a9e8f99 Author: Fabio Estevam Date: Tue Jul 24 09:48:30 2018 -0300 ASoC: fsl-asoc-card: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown commit 76f17d8ba1cbc3d2786955b2f15e071da93527cd Author: Bart Van Assche Date: Mon Jul 23 14:18:33 2018 -0700 block: Rename the null_blk_mod kernel module back into null_blk Commit ca4b2a011948 ("null_blk: add zone support") breaks several blktests scripts because it renamed the null_blk kernel module into null_blk_mod. Hence rename null_blk_mod back into null_blk. Fixes: ca4b2a011948 ("null_blk: add zone support") Signed-off-by: Bart Van Assche Cc: Matias Bjorling Cc: Christoph Hellwig Cc: Ming Lei Cc: Damien Le Moal Signed-off-by: Jens Axboe commit 2ca300ac6e7b5143e0c03cfc91bb064dcad376f4 Author: Maxime Chevallier Date: Tue Jul 17 16:31:54 2018 +0200 spi: imx: Use the longuest possible burst size when in dynamic_burst Dynamic burst mode allows to group together multiple words and send them in one continuous burst. When the number of bytes to be sent is not a strict multiple of the FIFO entry size (32 bits), the controller expects the non aligned bits to be sent first. This commit adds support for this particular constraint, avoiding the need to send the non-aligned bytes one by one at the end of the transfer, speeding-up transfer speed in that case. With this method, a transfer is divided into multiple bursts, limited in size by the maximum amount of data that the controller can transfer in one continuous burst (which is 512 bytes). The non-512 byte part of the transfer is sent first. The remaining bytes to be transferred in the current burst is stored in the 'remainder' field. With this method, the read_u32 field is no longer necessary, and is removed. This was tested on imx6 solo and imx6 quad. Signed-off-by: Maxime Chevallier Signed-off-by: Mark Brown commit 0486dd4d6111b969a81b9ce63bfaf22e414839a4 Author: Maxime Chevallier Date: Tue Jul 17 16:31:53 2018 +0200 spi: imx: remove unnecessary check in spi_imx_can_dma The spi_imx_can_dma function computes the watermark level so that the transfer will fit in exactly N bursts (without a remainder). The smallest watermark level possible being one FIFO entry per burst, we can't never have a case where the transfer size isn't divsiible by 1. Remove the extra check for the wml being different than 0. Signed-off-by: Maxime Chevallier Signed-off-by: Mark Brown commit afb27208146af82b249e0cdc40142b4ffd211887 Author: Maxime Chevallier Date: Tue Jul 17 16:31:52 2018 +0200 spi: imx: Use correct number of bytes per words The SPI core enforces that we always use the next power-of-two number of bytes to store words. As a result, a 24 bits word will be stored in 4 bytes. This commit fixes the spi_imx_bytes_per_word function to return the correct number of bytes. This also allows to get rid of unnecessary checks in the can_dma function, since the SPI core validates that we always have a transfer length that is a multiple of the number of bytes per word. Signed-off-by: Maxime Chevallier Signed-off-by: Mark Brown commit 2801b2f5fad3d1e9ea0ac8484584051071065645 Author: Maxime Chevallier Date: Tue Jul 17 16:31:51 2018 +0200 spi: imx: Use dynamic bursts only when bits_per_word is 8, 16 or 32 The dynamic bursts mode allows to group together multiple words into a single burst. To do so, it's necessary that words can be packed into the 32-bits FIFO entries, so we can't allow using this mode with bit_per_words different to 8, 16 or 32. This prevents shitfing out extra clock ticks for transfers with bit_per_word values not aligned on 8 bits. With that , we are sure that only the correct number of bits is shifted out at each transfer, so we don't need to mask out the remaining parts of the words. Signed-off-by: Maxime Chevallier Signed-off-by: Mark Brown commit a021cac420f8a3bd1c36c91af9dd3143c44101d7 Author: Maxime Chevallier Date: Tue Jul 17 16:31:50 2018 +0200 spi: imx: Remove duplicate variable assignments Some fields in struct spi_imx_data are assigned a different value twice in a row, in spi_imx_setupxfer. Signed-off-by: Maxime Chevallier Signed-off-by: Mark Brown commit 06060ea7fb5b6b9b4c3251e0dcabbcca8ad91674 Author: Shaokun Zhang Date: Thu Jul 19 19:26:40 2018 +0800 drivers/perf: hisi: update the sccl_id/ccl_id when MT is supported MT bit in MPIDR_EL1 is now supported in certain HiSilicon platforms, so the mapping between sccl_id/ccl_id and affinity level needs to be updated from the generic encoding we originally used. Cc: John Garry Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Shaokun Zhang [will: fixed comment] Signed-off-by: Will Deacon commit 6576bf009aab00f8376efeb24628dd2b86f68200 Author: Fabio Estevam Date: Tue Jul 24 10:04:02 2018 -0300 spi: spi-fsl-dspi: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown commit 6c0b319c0306accd92dc1601f8bf42adc147d4bf Author: Peter Geis Date: Tue Jul 24 09:25:41 2018 -0400 regulator: Add support for CPCAP regulators on Motorola Xoom devices. Added support for the CPCAP power management regulator functions on Tegra based Motorola Xoom devices. Added sw2_sw4 value tables, which provide power to the Tegra core and aux devices. Added the Xoom init tables and device tree compatibility match. Signed-off-by: Peter Geis Signed-off-by: Mark Brown commit ad66225dff3f30fece4f5133ea14058c95f4e29a Author: Peter Geis Date: Tue Jul 24 09:25:40 2018 -0400 regulator: Add sw2_sw4 voltage table to cpcap regulator. SW2 and SW4 use a shared table to provide voltage to the cpu core and devices on Tegra hardware. Added this table to the cpcap regulator driver as the first step to supporting this device on Tegra. Signed-off-by: Peter Geis Signed-off-by: Mark Brown commit 1b0d274523df5ef1caedc834da055ff721e4d4f0 Author: Andy Shevchenko Date: Tue Jul 17 17:17:36 2018 +0300 nvmet: don't use uuid_le type Don't use sizeof(uuid_le) where none of the parameters is type of uuid_le. Since both arguments are u8 [16], use size of destination there. Moreover, uuid_le is a deprecated type, and nvmet is using uuid_t already. Signed-off-by: Andy Shevchenko Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig commit 9c891c139894ce2ec0ca585a00e0bec5e6b4ccab Author: Sagi Grimberg Date: Wed Jul 11 16:13:04 2018 +0300 nvmet: check fileio lba range access boundaries Fail out-of-bounds with a proper status code. Fixes: d5eff33ee6f8 ("nvmet: add simple file backed ns support") Signed-off-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 1b72b71faccee986e2128a271125177dfe91f7b7 Author: Sagi Grimberg Date: Wed Jul 11 12:43:16 2018 +0300 nvmet: fix file discard return status If nvmet_copy_from_sgl failed, we falsly return successful completion status. Fixes: d5eff33ee6f8 ("nvmet: add simple file backed ns support") Signed-off-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 75862c72323e222656792370e2f240bc4029ff96 Author: Sagi Grimberg Date: Mon Jul 9 12:49:07 2018 +0300 nvme-rdma: centralize admin/io queue teardown sequence We follow the same queue teardown sequence in delete, reset and error recovery. Centralize the logic. This patch does not change any functionality. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit c66e2998c8ca4d5da85d4915612dca29e054ad21 Author: Sagi Grimberg Date: Mon Jul 9 12:49:06 2018 +0300 nvme-rdma: centralize controller setup sequence Centralize controller sequence to a single routine that correctly cleans up after failures instead of having multiple apperances in several flows (create, reset, reconnect). One thing that we also gain here are the sanity/boundary checks also when connecting back to a dynamic controller. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 90140624e8face94207003ac9a9d2a329b309d68 Author: Sagi Grimberg Date: Mon Jul 9 12:49:05 2018 +0300 nvme-rdma: unquiesce queues when deleting the controller If the controller is going away, we need to unquiesce the IO queues so that all pending request can fail gracefully before moving forward with controller deletion. Do that before we destroy the IO queues so blk_cleanup_queue won't block in freeze. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 249090f9016b7d68a18fc4c79c42accca18d6961 Author: Gustavo A. R. Silva Date: Thu Jul 5 08:14:00 2018 -0500 nvme-rdma: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Christoph Hellwig commit 6268953e8977a23ca7512a2921e82a5d9252ec01 Author: Keith Busch Date: Fri Jun 29 16:50:03 2018 -0600 nvme: add disk name to trace events This will print the disk name to the nvme event trace for io requests so a user can better distinguish traffic to different disks. This can be used to create disk based filters. For example, to see only nvme0n2 traffic: echo "disk == \"nvme0n2\"" > /sys/kernel/debug/tracing/events/nvme/filter Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Johannes Thumshirn [hch: turned __assign_disk_name into an inline function] Signed-off-by: Christoph Hellwig commit b80a55e246a1b817cb254d79d077f364a2419578 Author: Keith Busch Date: Mon Jul 2 09:15:03 2018 -0600 nvme: add controller name to trace events This appends the controller instance to the nvme trace buffer to distinguish which controller is dispatching and completing a command. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig commit 6b8b9a48545e08345b8ff77c9fd51b1aebdbefb3 Author: Mark Rutland Date: Tue Jul 10 19:01:23 2018 +0100 KVM: arm/arm64: vgic: Fix possible spectre-v1 write in vgic_mmio_write_apr() It's possible for userspace to control n. Sanitize n when using it as an array index, to inhibit the potential spectre-v1 write gadget. Note that while it appears that n must be bound to the interval [0,3] due to the way it is extracted from addr, we cannot guarantee that compiler transformations (and/or future refactoring) will ensure this is the case, and given this is a slow path it's better to always perform the masking. Found by smatch. Signed-off-by: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu Signed-off-by: Marc Zyngier commit c0476a31fb381e02637549bfe45632a4140dd201 Author: Steven Vanden Branden Date: Mon Jul 23 18:09:54 2018 +0200 ARM: dts: sun4i: Add GPU node Add mali gpu node to sun4i a10 platforms. Tested with offscreen rendering with lima mesa (freedesktop gitlab) Signed-off-by: Steven Vanden Branden Signed-off-by: Maxime Ripard commit f371a7c17aaa47dd7aedc89ef3cd1d5638c03f5e Author: Guenter Roeck Date: Mon Jul 23 14:41:38 2018 -0700 android: binder: Include asm/cacheflush.h after linux/ include files If asm/cacheflush.h is included first, the following build warnings are seen with sparc32 builds. In file included from arch/sparc/include/asm/cacheflush.h:11:0, from drivers/android/binder.c:54: arch/sparc/include/asm/cacheflush_32.h:40:37: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration Moving the asm/ include after linux/ includes solves the problem. Suggested-by: Linus Torvalds Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 1e81c57b598307c5611410fd357554ffacc6290d Author: Guenter Roeck Date: Mon Jul 23 14:47:23 2018 -0700 android: binder_alloc: Include asm/cacheflush.h after linux/ include files If asm/cacheflush.h is included first, the following build warnings are seen with sparc32 builds. In file included from ./arch/sparc/include/asm/cacheflush.h:11:0, from drivers/android/binder_alloc.c:20: ./arch/sparc/include/asm/cacheflush_32.h:40:37: warning: 'struct page' declared inside parameter list Moving the asm/ include after linux/ includes fixes the problem. Suggested-by: Linus Torvalds Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit a1c4d08b6b95a0e296285ee53cc1438b3f168f98 Author: Tomas Winkler Date: Mon Jul 23 13:21:24 2018 +0300 mei: add mei_msg_hdr_init wrapper. Wrap the mei header boilerplate initialization code in mei_msg_hdr_init function. On the way remove 'completed' field from mei_cl_cb structure as this information is already included in the header and is local to particular fragment. Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 8c8d964ce90f16877b76c3f00b27165bf865af69 Author: Tomas Winkler Date: Mon Jul 23 13:21:23 2018 +0300 mei: move hbuf_depth from the mei device to the hw modules The host buffer depth is hardware specific so it's better to handle it inside the me and txe hw modules. In me the depth is read from register in txe it's a constant number. The value is now retrieved via mei_hbuf_depth accessor, while it replaces mei_hbuf_max_len. Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 9fc5f0f8ad28405145b30fd3b905e368063ee14c Author: Tomas Winkler Date: Mon Jul 23 13:21:22 2018 +0300 mei: cleanup slots to data conversions Cleanup conversions between slots and data. Define MEI_SLOT_SIZE instead of using 4 or sizeof(u32) across the source code. Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 4a965c5f89decd636129cddc47e5f2c61e8f13e6 Author: Jacob Feder Date: Sun Jul 22 21:27:37 2018 -0400 staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core This IP core has read and write AXI-Stream FIFOs, the contents of which can be accessed from the AXI4 memory-mapped interface. This is useful for transferring data from a processor into the FPGA fabric. The driver creates a character device that can be read/written to with standard open/read/write/close. See Xilinx PG080 document for IP details. https://www.xilinx.com/support/documentation/ip_documentation/axi_fifo_mm_s/v4_1/pg080-axi-fifo-mm-s.pdf The driver currently supports only store-forward mode with a 32-bit AXI4 Lite interface. DOES NOT support: - cut-through mode - AXI4 (non-lite) Signed-off-by: Jacob Feder Signed-off-by: Greg Kroah-Hartman commit cca3d5290ede73b01144aa522910c88b1e02fcef Author: Nicholas Piggin Date: Tue May 1 00:55:52 2018 +1000 tty: hvc: remove unexplained "just in case" spin delay This delay was in the very first OPAL console commit 6.5 years ago, and came from the vio hvc driver. The firmware console has hardened sufficiently to remove it. Reviewed-by: Benjamin Herrenschmidt Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 17cc1dd4924391b54fb179d0868b89dc96f2ee80 Author: Nicholas Piggin Date: Tue May 1 00:55:51 2018 +1000 powerpc/powernv: implement opal_put_chars_atomic The RAW console does not need writes to be atomic, so relax opal_put_chars to be able to do partial writes, and implement an _atomic variant which does not take a spinlock. This API is used in xmon, so the less locking that is used, the better chance there is that a crash can be debugged. Cc: Benjamin Herrenschmidt Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit ac4ac788fdadc6b703ff3322de07dee442e08e1c Author: Nicholas Piggin Date: Tue May 1 00:55:50 2018 +1000 powerpc/powernv: move opal console flushing to udbg OPAL console writes do not have to synchronously flush firmware / hardware buffers unless they are going through the udbg path. Remove the unconditional flushing from opal_put_chars. Flush if there was no space in the buffer as an optimisation (callers loop waiting for success in that case). udbg flushing is moved to udbg_opal_putc. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit b74d2807ae0cdb17ccc45d22260fc151a1b2d46b Author: Nicholas Piggin Date: Tue May 1 00:55:49 2018 +1000 powerpc/powernv: Remove OPALv1 support from opal console driver opal_put_chars deals with partial writes because in OPALv1, opal_console_write_buffer_space did not work correctly. That firmware is not supported. This reworks the opal_put_chars code to no longer deal with partial writes by turning them into full writes. Partial write handling is still supported in terms of what gets returned to the caller, but it may not go to the console atomically. A warning message is printed in this case. This allows console flushing to be moved out of the opal_write_lock spinlock. That could cause the lock to be held for long periods if the console is busy (especially if it was being spammed by firmware), which is dangerous because the lock is taken by xmon to debug the system. Flushing outside the lock improves the situation a bit. Cc: Benjamin Herrenschmidt Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit d2a2262e686ce7a27776add27751f925ceda856f Author: Nicholas Piggin Date: Tue May 1 00:55:48 2018 +1000 powerpc/powernv: Implement and use opal_flush_console A new console flushing firmware API was introduced to replace event polling loops, and implemented in opal-kmsg with affddff69c55e ("powerpc/powernv: Add a kmsg_dumper that flushes console output on panic"), to flush the console in the panic path. The OPAL console driver has other situations where interrupts are off and it needs to flush the console synchronously. These still use a polling loop. So move the opal-kmsg flush code to opal_flush_console, and use the new function in opal-kmsg and opal_put_chars. Cc: Benjamin Herrenschmidt Reviewed-by: Russell Currey Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit e00da0f2db91b90e990cc05088f03adbc58af895 Author: Nicholas Piggin Date: Tue May 1 00:55:47 2018 +1000 powerpc/powernv: opal-kmsg use flush fallback from console code Use the more refined and tested event polling loop from opal_put_chars as the fallback console flush in the opal-kmsg path. This loop is used by the console driver today, whereas the opal-kmsg fallback is not likely to have been used for years. Use WARN_ONCE rather than a printk when the fallback is invoked to prepare for moving the console flush into a common function. Reviewed-by: Russell Currey Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 3a80bfc7ea96d253be0e7d869c059b1976c19809 Author: Nicholas Piggin Date: Tue May 1 00:55:46 2018 +1000 powerpc/powernv: opal-kmsg standardise OPAL_BUSY handling OPAL_CONSOLE_FLUSH is documented as being able to return OPAL_BUSY, so implement the standard OPAL_BUSY handling for it. Reviewed-by: Russell Currey Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 36d2dabc8762f1f4118f80d85049958390f061a8 Author: Nicholas Piggin Date: Tue May 1 00:55:45 2018 +1000 powerpc/powernv: Fix OPAL console driver OPAL_BUSY loops The OPAL console driver does not delay in case it gets OPAL_BUSY or OPAL_BUSY_EVENT from firmware. It can't yet be made to sleep because it is called under spinlock, but it can be changed to the standard OPAL_BUSY loop form, and a delay added to keep it from hitting the firmware too frequently. Cc: Benjamin Herrenschmidt Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit bd90284cc6c1c9e8e48c8eadd0c79574fcce0b81 Author: Nicholas Piggin Date: Tue May 1 00:55:44 2018 +1000 powerpc/powernv: opal_put_chars partial write fix The intention here is to consume and discard the remaining buffer upon error. This works if there has not been a previous partial write. If there has been, then total_len is no longer total number of bytes to copy. total_len is always "bytes left to copy", so it should be added to written bytes. This code may not be exercised any more if partial writes will not be hit, but this is a small bugfix before a larger change. Reviewed-by: Benjamin Herrenschmidt Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 670c6365c91e345582bf905e946ed35fb684891e Author: John Whitmore Date: Mon Jul 23 21:50:31 2018 +0100 staging:rtl8192u: Remove unused definition of sQoSCtlLng - Style Remove sQoSCtlLng. The constant sQoSCtlLng is never used in code so has been removed. This is a coding style change so should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 1026e4aa828e7a03790e241a319b19cbad0edf9e Author: John Whitmore Date: Mon Jul 23 21:50:30 2018 +0100 staging:rtl8192u: Remove unused AC_UAPSD definitions - Style Remove the definitions associated with AC_UAPSD. These definitions are not used in code so have simply been removed. This is a coding style change and should have no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 90c7dbf0bb38941989bee70eaedf6c7e5955490e Author: John Whitmore Date: Mon Jul 23 21:50:29 2018 +0100 staging:rtl8192u: Remove unused structure ACM - Style Remove the structure ACM as it is unused in code. This change is a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5f155b1de5339be2a4667ac245b996e2705a63f4 Author: John Whitmore Date: Mon Jul 23 21:50:28 2018 +0100 staging:rtl8192u: Remove unused enumerated type ACM_METHOD - Style Remove the enumerated type ACM_METHOD as it is unused in code. This is a coding style change and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 2f20e918e84de3def6c41e5745315fc676d5ea92 Author: John Whitmore Date: Mon Jul 23 21:50:27 2018 +0100 staging:rtl8192u: Remove unused structure WMM_TSPEC - Style Remove the structure WMM_TSPEC as it is unused. This change is a coding style change and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8d2314368f2469b1ec89817ee04db6b2d3e2e680 Author: John Whitmore Date: Mon Jul 23 21:50:26 2018 +0100 staging:rtl8192u: Remove unused structure QOS_TSTREAM - Style The structure QOS_TSTREAM is unused in code so has simply been removed. This change is a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 1a59f17aa3d4c82a5e0187aac118b05c435e1696 Author: John Whitmore Date: Mon Jul 23 21:50:25 2018 +0100 staging:rtl8192u: Remove unused enumerated type QOS_ELE_SUBTYPE - Style The enumerated type QOS_ELE_SUBTYPE is unused in code so has been removed from code. This is a coding style change which should have not impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f3bbec3bb77f6c64b70aa0fe69a4905a50624d10 Author: John Whitmore Date: Mon Jul 23 21:50:24 2018 +0100 staging:rtl8192u: Remove the unused AC_CODING definitions - Style The AC_CODING definitions are unused in code, so have simply been removed from source. This is a coding style change and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 28598fbe6fe00f2cf5d5925b9953af544c7876aa Author: John Whitmore Date: Mon Jul 23 21:50:23 2018 +0100 staging:rtl8192u: Remove unused union QOS_INFO_FIELD - Style The union QOS_INFO_FIELD is unused in code so has been removed from source. This change is a coding style change so should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 31bd6754f4bc9f31608e58b1ee94c86484009ac9 Author: John Whitmore Date: Mon Jul 23 21:50:22 2018 +0100 staging:rtl8192u: Remove unused structure QOS_CTRL_FIELD - Style The structure QOS_CTRL_FIELD is unused in code so has simply been removed from source. This is a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 7b877cef67e8f1e75d865019619d9edee0d025d3 Author: John Whitmore Date: Mon Jul 23 21:50:21 2018 +0100 staging:rtl8192u: Remove unused structure STA_QOS - Style Remove structure STA_QOS as it is unused in code. This change is a coding style change so should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit a61c15e653f83444fa1a26297a90683315d80a65 Author: John Whitmore Date: Mon Jul 23 21:50:20 2018 +0100 staging:rtl8192u: Removed unused structure BSS_QOS - Style The structure BSS_QOS is not used in code so has simply been removed. The change is a coding style change and should not impact runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5a2e242f6758496a38f1433e25b2fa45ba00a96c Author: John Whitmore Date: Mon Jul 23 21:50:19 2018 +0100 staging:rtl8192u: Remove unused QOS definitions - Style Remove the unused QOS related types. Since definitions are not used simply remove from code. This change is a coding style change and should not impact runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3171b2ced26f6a2581deb1355123f84b8881a772 Author: John Whitmore Date: Mon Jul 23 21:50:18 2018 +0100 staging:rtl8192u: Remove unused enumerated type ACK_POLICY - Style The enumerated type ACK_POLICY is not used in code so it has been removed from the source code. This is a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c808e16d17b7f30aa02a8daccffc3f0b41b42300 Author: John Whitmore Date: Mon Jul 23 21:50:17 2018 +0100 staging:rtl8192u: Remove typedef of u32 to QOS_MODE - Style The typedef of QOS_MODE as a u32 is contrary to coding standard and fails the checkpatch tests for defining new types in code. Definitions of type QOS_MODE have simply been replaced with a u32 type. This is a coding style change which should not impact runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8faf8e9c9f428fb027bed7d438b0c9738315fae2 Author: John Whitmore Date: Sun Jul 22 23:10:35 2018 +0100 staging:rtl8192u: Remove unused RTL8258 bit mask definitions - Style Remove the unused 'RTL8258' bit mask definitions. These definitions fail the checkpatch CamelCase naming tests. Since the definitions are unused in code they have been removed, rather then renaming. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 2e7394899f3ecdc8c31f34821ba9c4a1471db640 Author: John Whitmore Date: Sun Jul 22 23:10:34 2018 +0100 staging:rtl8192u: Remove unused Zebra4 bit mask definitions - Style Remove the unused 'Zebra4' bit mask definitions. These definitions fail the checkpatch CamelCase naming tests. Rather then renaming, as the definitions are unused they have simply been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 946fb23dc751f9fbe449b7fc56e88a8cab4d4b58 Author: John Whitmore Date: Sun Jul 22 23:10:33 2018 +0100 staging:rtl8192u: Remove unused RF Zebra1 Bit Mask definitions - Style Remove the unused 'RF Zebra1' bit mask definitions. These definitions fail the checkpatch CamelCase naming tests. Since the definitions are unused in code they have simply been removed, rather then renaming. This is a coding style change which will have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit ac21097a65c2053b0b617d70de7e33548524c5a0 Author: John Whitmore Date: Sun Jul 22 23:10:32 2018 +0100 staging:rtl8192u: Remove unused Rx Pseduo noise Bit Mask defs - Style Remove the unused 'Rx Pseduo noise' Bit Mask definitions. These definitions will fail the checkpatch CamelCase naming test. Since the definitions are unused in code they have simply been removed, rather then renaming. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8e5aad33b7218e395aa3d672da19af5c213cfde3 Author: John Whitmore Date: Sun Jul 22 23:10:31 2018 +0100 staging:rtl8192u: Remove unused page e Bit Mask definitions - Style Remove the unused 'page e' Bit Mask definitions. These definitions will fail the checkpatch CamelCase naming tests. As they are unused in code they have simply been removed rather then renaming. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit b544d0f31d145951976a89faa2bd9e3ba25a073b Author: John Whitmore Date: Sun Jul 22 23:10:30 2018 +0100 staging:rtl8192u: Remove unused page d Bit Mask definitions - Style Remove the unused 'page d' Bit Mask definitions. These definitions will fail the checkpatch CamelCase naming test. Since the definitions are unused in code they have been removed, rather then renaming. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3e4361f3e21dd2c5a8b8828a7adef61de7949592 Author: John Whitmore Date: Sun Jul 22 23:10:29 2018 +0100 staging:rtl8192u: Remove unused page c Bit Mask definitions - Style Remove the unused 'page c' Bit Mask definitions. These definitions will fail the checkpatch CamelCase naming test. Rather then renaming, as the definitions are unused in code, they have simply been removed. The change is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit d7486940c76d2a3c908fe6bc03ec8341d8428d03 Author: John Whitmore Date: Sun Jul 22 23:10:28 2018 +0100 staging:rtl8192u: Remove unused page-a Bit Mask definitions - Style Remove the unused 'page-a' Bit Mask definitions. These definitions will fail the checkpatch CamelCase naming tests, rather then renaming, as the definitions are unused, they have simply been removed. This is a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5a894c757f44fa0a96927f20c68a5ed495ade0b8 Author: John Whitmore Date: Sun Jul 22 23:10:27 2018 +0100 staging:rtl8192u: Remove unused page-9 Bit Mask definitions - Style Remove the unused page-9 Bit Mask definitions. These definitions fail the checkpatch CamelCase naming tests. Since the definitions are unused in code they have simply been removed, rather then renaming. The change is purely a coding style change and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit bd632154fa068d1183df1f684dfe65e01920ab93 Author: John Whitmore Date: Sun Jul 22 23:10:26 2018 +0100 staging:rtl8192u: Remove unused page-8 Bit Mask definitions - Style Remove unused 'page-8' Bit Mask definitions. These definitions fail the checkpatch CamelCase naming test, since they are unused in code they have simply been removed from code, rather then renamed. This is a coding style change which should not impact runtime code execution. * page-8 */ Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 531db6558984f9147aeb286de1dd22117063f2bd Author: John Whitmore Date: Sun Jul 22 23:10:25 2018 +0100 staging:rtl8192u: Remove unused page-1 Bit Masks - Style Remove the unused 'page-1' Bit Masks. These definitions fail the checkpatch CamelCase naming test. To avoid renaming the definitions have simply been removed. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 93860840b67c77a2f6a59e0bbb9710d4d00e4bf1 Author: John Whitmore Date: Sun Jul 22 23:10:24 2018 +0100 staging:rtl8192u: Remove unused RTL8258 definitions - Style Remove the unused RTL8258 definitions. These definitions fail the checkpatch CamelCase naming test, rather then renaming, as the definitions are unused they have simply been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6820978513fed595e5ab9b643ade7c45950de62d Author: John Whitmore Date: Sun Jul 22 23:10:23 2018 +0100 staging:rtl8192u: Remove unused Zebra4 definitions - Style Remove the unused 'Zebra4' definitions. These definitions fail the checkpatch CamelCase naming test, rather then rename as they are unused definitions they have simply been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 18eacf127ddb01662fdef1c10b864ea11f46294e Author: John Whitmore Date: Sun Jul 22 23:10:22 2018 +0100 staging:rtl8192u: Remove unused Zebra1 definitions - Style Remove unused 'Zebra1' definitions. These definitions fail the checkpatch CamelCase test, rather then rename, these unused definitions have simply been removed. This is a coding style change which should have not impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 7225444a94f5a314e0f9405defec9aa001a49cc0 Author: John Whitmore Date: Sun Jul 22 23:10:21 2018 +0100 staging:rtl8192u: Remove unused page d definitions - Style Remove the unused 'page d' definitions. These definitions fail the checkpatch CamelCase naming test. Rather then renaming unused definitions they have simply been removed. This change is a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5c9b63a4aeb87ae9b27fae7ee51eeaaba88fb06c Author: John Whitmore Date: Sun Jul 22 23:10:20 2018 +0100 staging:rtl8192u: Remove unused page c definitions - Style Remove unused 'page c' definitions. These definitions fail the checkpatch CamelCase test, to save renaming, these unused definitions have simply been removed. This is a coding style change which should not have an impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3527392f5aca429841e9d8389b197f1b066baff5 Author: John Whitmore Date: Sun Jul 22 23:10:19 2018 +0100 staging:rtl8192u: Remove unused page a definitions - Style Remove unused 'page a' definitions. These definitions fail the checkpatch CamelCase naming test, rather then renaming these unused definitions they have simply been removed. This is a coding style change only, and should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit bf94a343846faf71c1c5f30cf1a0ed7087668203 Author: John Whitmore Date: Sun Jul 22 23:10:18 2018 +0100 staging:rtl8192u: Remove unused page 9 definitions - Style Remove the unused definitions from page 9 section. These definitions will fail the checkpatch CamelCase test, to save renaming these unused definitions they have simply been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 590bb44e864d228de18d8587515f1867b6a45f0a Author: John Whitmore Date: Sun Jul 22 23:10:17 2018 +0100 staging:rtl8192u: Remove unused page 8 definitions - Style Remove page 8 definitions which are never used in code. Many of these definitions, if not all, fail the checkpatch CamelCase checks. To avoid the effort of renaming unused definitions they have been removed. This is a style change which should have no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6464a50993a4ba922a6f350050d1923a4267233b Author: John Whitmore Date: Sun Jul 22 23:10:16 2018 +0100 staging:rtl8192u: Remove unused page 1 definitions - Style Remove all the "page 1" definitions as they are not used in code. A lot of these definitions, if not all, fail checkpatch because of CamelCase issues. Rather then change the names of unused constants simply remove. This is a coding style change which should have no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 2aa608bc48bcff19a42f652fcbd5917d69a009ee Author: John Whitmore Date: Sat Jul 21 20:25:52 2018 +0100 staging:rtl8192u: Rename variable State > state - Style Rename the variable State to state, this clears the checkpatch issue with CamelCase naming. The change is purely coding style and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6da23bfd735cfff039aa3083706596c1f4d6670e Author: John Whitmore Date: Sat Jul 21 20:25:51 2018 +0100 staging:rtl8192u: Rename MaxTxPwrDbmList > max_tx_pwr_dbm_list - Style Rename the member variable MaxTxPwrDbmList to max_tx_pwr_dbm_list. This change clears the checkpatch issue with CamelCase naming. The change is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6963fe9935ef01e70b24b2bfc02689b3cb04eedd Author: John Whitmore Date: Sat Jul 21 20:25:50 2018 +0100 staging:rtl8192u: Rename CountryIeWatchdog > country_ie_watchdog - Style Rename the member variable CountryIeWatchdog to country_ie_watchdog, this change clears the checkpatch issue with CamelCase naming of variables. The change is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4655d4f041d1a251cccf6465b2753c1b928d326b Author: John Whitmore Date: Sat Jul 21 20:25:49 2018 +0100 staging:rtl8192u: Rename variable CountryIeSrcAddr - Style Rename the member variable CountryIeSrcAddr to country_ie_src_addr, this clears the checkpatch issue with CamelCase naming. The change is purely a coding style change and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 18ee7be97e1895a0b52843bd5bb733c2383af465 Author: John Whitmore Date: Sat Jul 21 20:25:48 2018 +0100 staging:rtl8192u: Rename CountryIeBuf to country_ie_buf - Style Rename the member variable CountryIeBuf to country_ie_buf. This change clears the checkpatch issue with CamelCase. The change is purely coding style and should not impact runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 9e1c8eb6ed602fdc0359454849910d1c799dbf16 Author: John Whitmore Date: Sat Jul 21 20:25:47 2018 +0100 staging:rtl8192u: Rename CountryIeLen > country_ie_len - Style Rename CountryIeLen to country_ie_len, coding style change to clear checkpatch issue with CamelCase naming. The change should have no impact on runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit b34db7f48ab6bd7308112da330c49ef06b56c164 Author: John Whitmore Date: Sat Jul 21 20:25:46 2018 +0100 staging:rtl8192u: Rename bEnabled > enabled - Style Rename the member variable bEnabled to enabled. This change clears the checkpatch issue with CamelCase. Purely a coding style change which should not impact runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3c22fbaf3bc685ac5691852fb25e0ff6d3510f24 Author: John Whitmore Date: Sat Jul 21 20:25:45 2018 +0100 staging:rtl8192u: Remove typedef and rename struct RT_DOT11D_INFO - Style Removed the typedef from structure RT_DOT11D_INFO. This change clears the checkpatch issue with declaring new types. Rename the structure from RT_DOT11D_INFO to rt_dot11d_info. Coding style changes which should not impact runtime execution of code. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 32cb4d731a9fb2385cc2638f69416e31435261a4 Author: John Whitmore Date: Sat Jul 21 20:25:44 2018 +0100 staging:rtl8192u: Rename TClasNum > t_clas_num - Style Rename the struct TS_COMMON_INFO member variable TClasNum to t_clas_num. This change clears the checkpatch issue with CamelCase naming. There should be no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit cb72b2f6dfa954d5c18df69cf789190310a0c545 Author: John Whitmore Date: Sat Jul 21 20:25:43 2018 +0100 staging:rtl8192u: Rename TClasProc > t_clas_proc - Style Rename the struct TS_COMMON_INFO member variable TClasProc to t_clas_proc. This change clears the checkpatch issue with CamelCase variable names. There should be no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit b29336c0e1785a28bc40a9fd47c2321671e9792e Author: Mukesh Ojha Date: Mon Feb 20 18:52:11 2017 +0530 powerpc/powernv/opal-dump : Use IRQ_HANDLED instead of numbers in interrupt handler Fixes: 8034f715f ("powernv/opal-dump: Convert to irq domain") Converts all the return explicit number to a more proper IRQ_HANDLED, which looks proper incase of interrupt handler returning case. Here, It also removes error message like "nobody cared" which was getting unveiled while returning -1 or 0 from handler. Signed-off-by: Mukesh Ojha Reviewed-by: Vasant Hegde Signed-off-by: Michael Ellerman commit a5bbe8fd29f7e42fe5d26371adbad97c76884355 Author: Mukesh Ojha Date: Mon Feb 20 18:52:10 2017 +0530 powerpc/powernv/opal-dump : Handles opal_dump_info properly Moves the return value check of 'opal_dump_info' to a proper place which was previously unnecessarily filling all the dump info even on failure. Signed-off-by: Mukesh Ojha Acked-by: Stewart Smith Acked-by: Jeremy Kerr Signed-off-by: Michael Ellerman commit edd00b830731be468fd3caf7f9154d13228f4a93 Author: Cyril Bur Date: Thu Feb 1 12:07:46 2018 +1100 powerpc/tm: Remove struct thread_info param from tm_reclaim_thread() Since commit dc3106690b20 ("powerpc: tm: Always use fp_state and vr_state to store live registers") tm_reclaim_thread() doesn't use the parameter anymore, both callers have to bother getting it as they have no need for a struct thread_info either. Just remove it and adjust the callers. Signed-off-by: Cyril Bur Signed-off-by: Michael Ellerman commit a596a7e91710d26fd862e3b7031c4012974583f2 Author: Cyril Bur Date: Mon Feb 5 16:17:16 2018 +1100 powerpc/tm: Update function prototype comment In commit eb5c3f1c8647 ("powerpc: Always save/restore checkpointed regs during treclaim/trecheckpoint") __tm_recheckpoint was modified to no longer take the second parameter 'unsigned long orig_msr' as part of a TM rewrite to simplify the reclaiming/recheckpointing process. There is a comment in the asm file where the function is delcared which has an incorrect prototype with the 'orig_msr' parameter. This patch corrects the comment. Signed-off-by: Cyril Bur Signed-off-by: Michael Ellerman commit c827ac450d379f113b92663cbe5562643635c6b9 Author: Simon Guo Date: Thu Jun 7 09:57:55 2018 +0800 selftests/powerpc: Update memcmp_64 selftest for VMX implementation This patch reworked selftest memcmp_64 so that memcmp selftest can cover more test cases. It adds testcases for: - memcmp over 4K bytes size. - s1/s2 with different/random offset on 16 bytes boundary. - enter/exit_vmx_ops pairness. Signed-off-by: Simon Guo [mpe: Add -maltivec to fix build on some toolchains] Signed-off-by: Michael Ellerman commit c2a4e54e8b6a89dde574608c47e460a0371e44be Author: Simon Guo Date: Thu Jun 7 09:57:54 2018 +0800 powerpc/64: add 32 bytes prechecking before using VMX optimization on memcmp() This patch is based on the previous VMX patch on memcmp(). To optimize ppc64 memcmp() with VMX instruction, we need to think about the VMX penalty brought with: If kernel uses VMX instruction, it needs to save/restore current thread's VMX registers. There are 32 x 128 bits VMX registers in PPC, which means 32 x 16 = 512 bytes for load and store. The major concern regarding the memcmp() performance in kernel is KSM, who will use memcmp() frequently to merge identical pages. So it will make sense to take some measures/enhancement on KSM to see whether any improvement can be done here. Cyril Bur indicates that the memcmp() for KSM has a higher possibility to fail (unmatch) early in previous bytes in following mail. https://patchwork.ozlabs.org/patch/817322/#1773629 And I am taking a follow-up on this with this patch. Per some testing, it shows KSM memcmp() will fail early at previous 32 bytes. More specifically: - 76% cases will fail/unmatch before 16 bytes; - 83% cases will fail/unmatch before 32 bytes; - 84% cases will fail/unmatch before 64 bytes; So 32 bytes looks a better choice than other bytes for pre-checking. The early failure is also true for memcmp() for non-KSM case. With a non-typical call load, it shows ~73% cases fail before first 32 bytes. This patch adds a 32 bytes pre-checking firstly before jumping into VMX operations, to avoid the unnecessary VMX penalty. It is not limited to KSM case. And the testing shows ~20% improvement on memcmp() average execution time with this patch. And note the 32B pre-checking is only performed when the compare size is long enough (>=4K currently) to allow VMX operation. The detail data and analysis is at: https://github.com/justdoitqd/publicFiles/blob/master/memcmp/README.md Signed-off-by: Simon Guo Signed-off-by: Michael Ellerman commit d58badfb7cf1792ab4f1d0cd7896d733b85d650f Author: Simon Guo Date: Thu Jun 7 09:57:53 2018 +0800 powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision This patch add VMX primitives to do memcmp() in case the compare size is equal or greater than 4K bytes. KSM feature can benefit from this. Test result with following test program(replace the "^>" with ""): ------ ># cat tools/testing/selftests/powerpc/stringloops/memcmp.c >#include >#include >#include >#include >#include "utils.h" >#define SIZE (1024 * 1024 * 900) >#define ITERATIONS 40 int test_memcmp(const void *s1, const void *s2, size_t n); static int testcase(void) { char *s1; char *s2; unsigned long i; s1 = memalign(128, SIZE); if (!s1) { perror("memalign"); exit(1); } s2 = memalign(128, SIZE); if (!s2) { perror("memalign"); exit(1); } for (i = 0; i < SIZE; i++) { s1[i] = i & 0xff; s2[i] = i & 0xff; } for (i = 0; i < ITERATIONS; i++) { int ret = test_memcmp(s1, s2, SIZE); if (ret) { printf("return %d at[%ld]! should have returned zero\n", ret, i); abort(); } } return 0; } int main(void) { return test_harness(testcase, "memcmp"); } ------ Without this patch (but with the first patch "powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp()." in the series): 4.726728762 seconds time elapsed ( +- 3.54%) With VMX patch: 4.234335473 seconds time elapsed ( +- 2.63%) There is ~+10% improvement. Testing with unaligned and different offset version (make s1 and s2 shift random offset within 16 bytes) can archieve higher improvement than 10%.. Signed-off-by: Simon Guo Signed-off-by: Michael Ellerman commit f1ecbaf466be5a7a5c666b41eede6991caff8646 Author: Simon Guo Date: Thu Jun 7 09:57:52 2018 +0800 powerpc: add vcmpequd/vcmpequb ppc instruction macro Some old tool chains don't know about instructions like vcmpequd. This patch adds .long macro for vcmpequd and vcmpequb, which is a preparation to optimize ppc64 memcmp with VMX instructions. Signed-off-by: Simon Guo Signed-off-by: Michael Ellerman commit 2d9ee327adce5f6becea2dd51d282a6183e40b0f Author: Simon Guo Date: Thu Jun 7 09:57:51 2018 +0800 powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp() Currently memcmp() 64bytes version in powerpc will fall back to .Lshort (compare per byte mode) if either src or dst address is not 8 bytes aligned. It can be opmitized in 2 situations: 1) if both addresses are with the same offset with 8 bytes boundary: memcmp() can compare the unaligned bytes within 8 bytes boundary firstly and then compare the rest 8-bytes-aligned content with .Llong mode. 2) If src/dst addrs are not with the same offset of 8 bytes boundary: memcmp() can align src addr with 8 bytes, increment dst addr accordingly, then load src with aligned mode and load dst with unaligned mode. This patch optmizes memcmp() behavior in the above 2 situations. Tested with both little/big endian. Performance result below is based on little endian. Following is the test result with src/dst having the same offset case: (a similar result was observed when src/dst having different offset): (1) 256 bytes Test with the existing tools/testing/selftests/powerpc/stringloops/memcmp: - without patch 29.773018302 seconds time elapsed ( +- 0.09% ) - with patch 16.485568173 seconds time elapsed ( +- 0.02% ) -> There is ~+80% percent improvement (2) 32 bytes To observe performance impact on < 32 bytes, modify tools/testing/selftests/powerpc/stringloops/memcmp.c with following: ------- #include #include "utils.h" -#define SIZE 256 +#define SIZE 32 #define ITERATIONS 10000 int test_memcmp(const void *s1, const void *s2, size_t n); -------- - Without patch 0.244746482 seconds time elapsed ( +- 0.36%) - with patch 0.215069477 seconds time elapsed ( +- 0.51%) -> There is ~+13% improvement (3) 0~8 bytes To observe <8 bytes performance impact, modify tools/testing/selftests/powerpc/stringloops/memcmp.c with following: ------- #include #include "utils.h" -#define SIZE 256 -#define ITERATIONS 10000 +#define SIZE 8 +#define ITERATIONS 1000000 int test_memcmp(const void *s1, const void *s2, size_t n); ------- - Without patch 1.845642503 seconds time elapsed ( +- 0.12% ) - With patch 1.849767135 seconds time elapsed ( +- 0.26% ) -> They are nearly the same. (-0.2%) Signed-off-by: Simon Guo Signed-off-by: Michael Ellerman commit ca42d8d2d6c55822fa8f1d230ffa3b78824fb60c Author: Aneesh Kumar K.V Date: Fri Jun 29 14:09:04 2018 +0530 powerpc/pseries/mm: Improve error reporting on HCALL failures This patch adds error reporting to H_ENTER and H_READ hcalls. A failure for both these hcalls are mostly fatal and it would be good to log the failure reason. Signed-off-by: Aneesh Kumar K.V [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman commit 65471d763e9178a8dc6f05db1c9c09c292f75c28 Author: Aneesh Kumar K.V Date: Fri Jun 29 14:09:04 2018 +0530 powerpc/pseries: Use pr_xxx() in lpar.c Switch from printk to pr_fmt() / pr_xxx(). Signed-off-by: Aneesh Kumar K.V [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman commit 27d8959da712771e2038ec77318fe8b2b8591e28 Author: Aneesh Kumar K.V Date: Fri Jun 29 14:06:31 2018 +0530 powerpc/mm/hash: Reduce contention on hpte lock We do this in some part. This patch make sure we always try to search for hpte without holding lock and redo the compare with lock held once match found. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit a833280b4aeeb3152369a3d5bcdc09447fea8358 Author: Aneesh Kumar K.V Date: Fri Jun 29 14:06:30 2018 +0530 powerpc/mm/hash: Add hpte_get_old_v and use that instead of opencoding No functional change Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit 1531cff44b5bb30c899404c044805ec60b2f3620 Author: Aneesh Kumar K.V Date: Fri Jun 29 14:06:29 2018 +0530 powerpc/mm/hash: Remove the superfluous bitwise operation when find hpte group When computing the starting slot number for a hash page table group we used to do this hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; Multiplying with 8 (HPTES_PER_GROUP) imply the last three bits are 0. Hence we really don't need to clear then separately. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit 7d4340bb92a9df78e6e28152f3dd89d9bd82146b Author: Aneesh Kumar K.V Date: Thu Jun 21 14:01:58 2018 +0530 powerpc/mm: Increase MAX_PHYSMEM_BITS to 128TB with SPARSEMEM_VMEMMAP config We do this only with VMEMMAP config so that our page_to_[nid/section] etc are not impacted. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit 6aba0c84ec474534bbae3675e95464958a6c5713 Author: Aneesh Kumar K.V Date: Thu Jun 21 14:01:57 2018 +0530 powerpc/mm: Check memblock_add against MAX_PHYSMEM_BITS range With SPARSEMEM config enabled, we make sure that we don't add sections beyond MAX_PHYSMEM_BITS range. This results in not building vmemmap mapping for range beyond max range. But our memblock layer looks the device tree and create mapping for the full memory range. Prevent this by checking against MAX_PHSYSMEM_BITS when doing memblock_add. We don't do similar check for memeblock_reserve_range. If reserve range is beyond MAX_PHYSMEM_BITS we expect that to be configured with 'nomap'. Any other reserved range should come from existing memblock ranges which we already filtered while adding. This avoids crash as below when running on a system with system ram config above MAX_PHSYSMEM_BITS Unable to handle kernel paging request for data at address 0xc00a001000000440 Faulting instruction address: 0xc000000001034118 cpu 0x0: Vector: 300 (Data Access) at [c00000000124fb30] pc: c000000001034118: __free_pages_bootmem+0xc0/0x1c0 lr: c00000000103b258: free_all_bootmem+0x19c/0x22c sp: c00000000124fdb0 msr: 9000000002001033 dar: c00a001000000440 dsisr: 40000000 current = 0xc00000000120dd00 paca = 0xc000000001f60000^I irqmask: 0x03^I irq_happened: 0x01 pid = 0, comm = swapper [c00000000124fe20] c00000000103b258 free_all_bootmem+0x19c/0x22c [c00000000124fee0] c000000001010a68 mem_init+0x3c/0x5c [c00000000124ff00] c00000000100401c start_kernel+0x298/0x5e4 [c00000000124ff90] c00000000000b57c start_here_common+0x1c/0x520 Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit 64de5d8d0457c325e2226c9c7efb37b1f772076c Author: Michael Ellerman Date: Tue Jul 10 00:24:26 2018 +1000 powerpc: Add ppc64le and ppc64_book3e allmodconfig targets Similarly as we just did for 32-bit, add phony targets for generating a little endian and Book3E allmodconfig. These aren't covered by the regular allmodconfig, which is big endian and Book3S due to the way the Kconfig symbols are structured. Signed-off-by: Michael Ellerman commit 8db0c9d416f26018cb7cabfb0b144f5108e29735 Author: Michael Ellerman Date: Tue Jul 10 00:24:25 2018 +1000 powerpc: Add ppc32_allmodconfig defconfig target Because the allmodconfig logic just sets every symbol to M or Y, it has the effect of always generating a 64-bit config, because CONFIG_PPC64 becomes Y. So to make it easier for folks to test 32-bit code, provide a phony defconfig target that generates a 32-bit allmodconfig. The 32-bit port has several mutually exclusive CPU types, we choose the Book3S variants as that's what the help text in Kconfig says is most common. Signed-off-by: Michael Ellerman commit 6d44acae1937b81cf8115ada8958e04f601f3f2e Author: Michael Ellerman Date: Mon Jul 9 16:25:21 2018 +1000 powerpc64s: Show ori31 availability in spectre_v1 sysfs file not v2 When I added the spectre_v2 information in sysfs, I included the availability of the ori31 speculation barrier. Although the ori31 barrier can be used to mitigate v2, it's primarily intended as a spectre v1 mitigation. Spectre v2 is mitigated by hardware changes. So rework the sysfs files to show the ori31 information in the spectre_v1 file, rather than v2. Currently we display eg: $ grep . spectre_v* spectre_v1:Mitigation: __user pointer sanitization spectre_v2:Mitigation: Indirect branch cache disabled, ori31 speculation barrier enabled After: $ grep . spectre_v* spectre_v1:Mitigation: __user pointer sanitization, ori31 speculation barrier enabled spectre_v2:Mitigation: Indirect branch cache disabled Fixes: d6fbe1c55c55 ("powerpc/64s: Wire up cpu_show_spectre_v2()") Cc: stable@vger.kernel.org # v4.17+ Signed-off-by: Michael Ellerman commit 5b73151fff63fb019db8171cb81c6c978533844b Author: Nicholas Piggin Date: Wed Apr 25 15:17:59 2018 +1000 powerpc: NMI IPI make NMI IPIs fully sychronous There is an asynchronous aspect to smp_send_nmi_ipi. The caller waits for all CPUs to call in to the handler, but it does not wait for completion of the handler. This is a needless complication, so remove it and always wait synchronously. The synchronous wait allows the caller to easily time out and clear the wait for completion (zero nmi_ipi_busy_count) in the case of badly behaved handlers. This would have prevented the recent smp_send_stop NMI IPI bug from causing the system to hang. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 9b81c0211c249c1bc8caec2ddbc86e36c550ce0f Author: Nicholas Piggin Date: Sun Jun 3 22:24:32 2018 +1000 powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely When the masked interrupt handler clears MSR[EE] for an interrupt in the PACA_IRQ_MUST_HARD_MASK set, it does not set PACA_IRQ_HARD_DIS. This makes them get out of synch. With that taken into account, it's only low level irq manipulation (and interrupt entry before reconcile) where they can be out of synch. This makes the code less surprising. It also allows the IRQ replay code to rely on the IRQ_HARD_DIS value and not have to mtmsrd again in this case (e.g., for an external interrupt that has been masked). The bigger benefit might just be that there is not such an element of surprise in these two bits of state. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 29e8131cd77ae49750e7e2f9f596afa5812435f2 Author: Ram Pai Date: Tue Jul 17 06:51:10 2018 -0700 selftests/powerpc: Fix ptrace-pkey for default execute permission change The test case assumes execute-permissions of unallocated keys are enabled by default, which is incorrect. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Ram Pai Signed-off-by: Michael Ellerman commit 5db26e8903deb111b303bd6e0cf304215e0b4fd9 Author: Ram Pai Date: Tue Jul 17 06:51:09 2018 -0700 selftests/powerpc: Fix core-pkey for default execute permission change Only when the key is allocated, its permission are enabled. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Ram Pai Signed-off-by: Michael Ellerman commit 9a3620800edeb35d00e33fafdc3eec215fc8c1f5 Author: Michael Straube Date: Sat Jul 21 20:57:42 2018 +0200 staging: rtl8188eu: fix lines over 80 characters Fix two lines over 80 characters by removing unnecessary parentheses. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 9f95c49e56c421d9287346aefb986845135fc466 Author: Michael Straube Date: Sat Jul 21 20:57:41 2018 +0200 staging: rtl8188eu: replace tabs with spaces Replace tabs with spaces or just remove tabs where appropriate. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 4964e934a66dae049c643b56cab1f9659d0f7e89 Author: Michael Straube Date: Sat Jul 21 20:57:40 2018 +0200 staging: rtl8188eu: remove unnecessary parentheses Remove unnecessary parentheses. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 8c438b738e476f875ab362bea550ae2db8d9c31a Author: Michael Straube Date: Sat Jul 21 20:57:39 2018 +0200 staging: rtl8188eu: fix comparsions to true Use if(x) instead of if(x == true). Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit a0cec709e17ae6d357c742bac0cbd6f7f84af998 Author: Michael Straube Date: Sat Jul 21 20:57:38 2018 +0200 staging: rtl8188eu: change return type to bool Both rtw_is_cckrates_included() and rtw_is_cckratesonly_included() return true or false. Change the return type from uint to bool. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 2c93b22aaafb7e2fb9c0bee69f5068d720d09d33 Author: Michael Straube Date: Sat Jul 21 20:57:37 2018 +0200 staging: rtl8188eu: refactor rtw_is_cckratesonly_included() Refactor rtw_is_cckratesonly_included() to improve readability and slightly reduce object file size. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 0f3e250f2efc9232e381de97fa7764adafce8975 Author: Michael Straube Date: Sat Jul 21 20:57:36 2018 +0200 staging: rtl8188eu: refactor rtw_is_cckrates_included() Refactor rtw_is_cckrates_included() to improve readability and slightly reduce object file size. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit e360c0ea438fc4fff86f0a709f411f4385aa8af6 Author: Michael Straube Date: Sat Jul 21 20:57:35 2018 +0200 staging: rtl8188eu: remove blank lines Remove unrequired blank lines reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit b7afce51d95726a619743aaad8870db66dfa1479 Author: Nicholas Mc Guire Date: Sat Jul 21 15:20:28 2018 +0200 staging: bcm2835-camera: fix timeout handling in wait_for_completion_timeout wait_for_completion_timeout returns unsigned long not int so a variable of proper type is introduced. Further the check for <= 0 is ambiguous and should be == 0 here indicating timeout which is the only error case so no additional check needed here. Signed-off-by: Nicholas Mc Guire Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.") Signed-off-by: Greg Kroah-Hartman commit 1ef5c96081d849a00dc973733cde3b595fc38442 Author: Nishad Kamdar Date: Mon Jul 23 00:18:01 2018 +0530 staging: dgnc: dgnc_tty.c: Avoid '(' at the end of line Bring the first argument to the previous line, remove a superfluous () in the second argument by using !, and align the lines to match open parenthesis. Issue found by checkpatch. Signed-off-by: Nishad Kamdar Signed-off-by: Greg Kroah-Hartman commit 5b70084f6cbcd53f615433f9d216e01bd71de0bb Author: Nicholas Mc Guire Date: Sat Jul 21 13:31:24 2018 +0200 staging: bcm2835-camera: handle wait_for_completion_timeout return properly wait_for_completion_timeout returns unsigned long not int so a variable of proper type is introduced. Further the check for <= 0 is ambiguous and should be == 0 here indicating timeout. Signed-off-by: Nicholas Mc Guire Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.") Signed-off-by: Greg Kroah-Hartman commit 24b9bdff8d0848029dba1c80b196b43e80b39463 Author: Ivan Bornyakov Date: Mon Jul 23 21:30:25 2018 +0300 staging: gasket: use vzalloc instead of vmalloc/memset Use vzalloc instead of vmalloc followed by memset with 0. Signed-off-by: Ivan Bornyakov Signed-off-by: Greg Kroah-Hartman commit afa9e31818a00b5a519429df343b1406488cd5a6 Author: Todd Poynor Date: Sat Jul 21 06:35:07 2018 -0700 staging: gasket: apex: convert various logs to debug level Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 0322bad3b507a74e9fed302c875bc3371df0dca8 Author: Todd Poynor Date: Sat Jul 21 06:35:06 2018 -0700 staging: gasket: page table: remove unnecessary logs Some error logs in page table handling code could only be hit in cases of programming errors not expected in the current code base, and aren't likely to be useful on their own. Remove these. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 37d7b0efabc56338370ca37a77ce69387b0a4373 Author: Todd Poynor Date: Sat Jul 21 06:35:05 2018 -0700 staging: gasket: page table: convert various logs to debug level Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 1d079f20d5aaab58ac6ccc3afd849f7ccebf28a1 Author: Todd Poynor Date: Sat Jul 21 06:35:04 2018 -0700 staging: gasket: ioctl common: convert various logs to debug level Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 040c626008e9e2f332caf16f25f2ca708cfcc480 Author: Todd Poynor Date: Sat Jul 21 06:35:03 2018 -0700 staging: gasket: interrupts: convert various logs to debug level Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 6b18580bad320fe96e32216bd91ba9f036119d25 Author: Todd Poynor Date: Sat Jul 21 06:35:02 2018 -0700 staging: gasket: core: convert various logs to debug level Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit b0e66fb7ba060243f71f6871c988846d74bac0ac Author: Todd Poynor Date: Sat Jul 21 06:35:01 2018 -0700 staging: gasket: apex return error on sysfs show of missing attribute Apex sysfs show function return -ENODEV if the attribute is not present, rather than silently failing from the standpoint of the userspace accessor. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e2f00f0b9876387e38849e7b1338ac684a7a6562 Author: Todd Poynor Date: Sat Jul 21 06:35:00 2018 -0700 staging: gasket: gasket_get_device drop check for NULL pci_dev The pci_dev field of a struct gasket_dev can never be NULL, there's no need to check for this in gasket_get_device(). Reported-by: Guenter Roeck Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 99ccddf5af6f32f501e719024e5e699565c6552e Author: Todd Poynor Date: Sat Jul 21 06:34:59 2018 -0700 staging: gasket: remove unnecessary NULL checks on calls from VFS Remove unneeded checks for NULL pointers in struct file pointers passed from the VFS layer or the private_data that must have been properly set at file open time. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit a1978fa2d632c9001d1d68dac3926177af96c64e Author: Todd Poynor Date: Sat Jul 21 06:34:58 2018 -0700 staging: gasket: print mmap starting address as unsigned long Page alignment error log should print the offending value as an unsigned long, not as a kernel pointer. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 5c4a5d3ddd724d1c4f27c3b52ad0980c4c750999 Author: Todd Poynor Date: Sat Jul 21 06:34:57 2018 -0700 staging: gasket: avoid copy to user on error in coherent alloc config gasket_config_coherent_allocator() on error return the error to caller without copying a possibly-update DMA address back to userspace. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 8fc1cb4cef287fd61391adcc48f4a6bdc369bf49 Author: Todd Poynor Date: Sat Jul 21 06:34:56 2018 -0700 staging: gasket: gasket_handle_ioctl fix ioctl exit trace param Pass the return value from the device ioctl permissions callback to the tracepoint when the callback returns an error. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 996e650030857e791416af81d7d9171d9652bd9d Author: Todd Poynor Date: Sat Jul 21 06:34:55 2018 -0700 staging: gasket: remove duplicate call to retrieve device callback gasket_handle_ioctl() calls gasket_get_ioctl_permissions_cb() twice; simplify the code and avoid duplicated work by fetching the callback pointer only once. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 59ab5af731565762189d2f923887933fc1e84bcf Author: Todd Poynor Date: Sat Jul 21 06:34:54 2018 -0700 staging: gasket: fix check_and_invoke_callback log param The message should be passed the callback function pointer, not the pointer to the gasket device. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 51a2ee0a4e62961131879f8f315052c48265829d Author: Arnd Bergmann Date: Tue Jul 24 13:13:28 2018 +0200 staging: rtl8188eu/rtl8723bs: fix character encoding drivers/staging/rtl8188eu/include/odm.h uses an incorrect encoding for the '...' character in two comments, which makes it one of the few non-UTF-8 source files. This removes the odd characters and uses the same ASCII representation that we have in the regular rtlwifi driver. The second instance of drivers/staging/rtl8723bs/hal/odm.h is garbled in a different way, so I change it to be the same as well even though it is already plain ASCII. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 367b955907b1123f8374025f02f579306886697e Author: Ajay Singh Date: Fri Jul 20 17:31:38 2018 +0530 staging: wilc1000: use descriptor-based interface for GPIO Now making use of descriptor-based interface instead of integer-based interface for IRQ GPIO. Added device tree binding reference for WILC SDIO and SPI interface module. Also moved the code to free gpio descriptor in module remove as the reference was fetched in probe function. Updated the TODO file Signed-off-by: Ajay Singh Reviewed-by: Linus Walleij Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 8dfaf8594e9754a3681af10118f5b9a8b6c40f52 Author: Ajay Singh Date: Fri Jul 20 17:31:37 2018 +0530 staging: wilc1000: change compatible string from atmel to microchip Use 'microchip' in compatible string instead of 'atmel', also replace '_' with '-' before the module. Remove 'wilc1000' prefix from device table name. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 4b6cfa87b1373a597be8fea19d6de90d92516096 Author: Ajay Singh Date: Fri Jul 20 17:31:36 2018 +0530 staging: wilc1000: rename variable from 'gpio' to 'gpio_irq' Rename from 'gpio' to 'gpio_irq', so its inlcude the information about the purpose of GPIO. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 847794a1a7380ca9301f3e09d4dc41f59a170bd7 Author: Ajay Singh Date: Fri Jul 20 17:31:35 2018 +0530 staging: wilc1000: remove gpio parameter from wilc_netdev_init() Instead of passing the gpio as parameter to wilc_netdev_init() now setting its value after finishing wilc_netdev_init() call. Avoided passing of extra parameter to wilc_netdev_init(). Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 60207c8ef2a3a971567dd1207daa234aaa856faa Author: Guido Kiener Date: Tue Jul 24 11:05:28 2018 +0200 usb: usbtmc: Add support for 32 bit compat applications 32 bit applications can only call ioctl functions on 64 bit systems when the field .compat_ioctl is defined for file operations. Tested-by: Dave Penkler Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless Signed-off-by: Greg Kroah-Hartman commit 07f522d203242b359624a284b61977600eebfd5a Author: Ram Pai Date: Tue Jul 17 06:51:08 2018 -0700 powerpc/pkeys: make protection key 0 less special Applications need the ability to associate an address-range with some key and latter revert to its initial default key. Pkey-0 comes close to providing this function but falls short, because the current implementation disallows applications to explicitly associate pkey-0 to the address range. Lets make pkey-0 less special and treat it almost like any other key. Thus it can be explicitly associated with any address range, and can be freed. This gives the application more flexibility and power. The ability to free pkey-0 must be used responsibily, since pkey-0 is associated with almost all address-range by default. Even with this change pkey-0 continues to be slightly more special from the following point of view. (a) it is implicitly allocated. (b) it is the default key assigned to any address-range. (c) its permissions cannot be modified by userspace. NOTE: (c) is specific to powerpc only. pkey-0 is associated by default with all pages including kernel pages, and pkeys are also active in kernel mode. If any permission is denied on pkey-0, the kernel running in the context of the application will be unable to operate. Tested on powerpc. Signed-off-by: Ram Pai [mpe: Drop #define PKEY_0 0 in favour of plain old 0] Signed-off-by: Michael Ellerman commit a4fcc877d4e18b5efe26e93f08f0cfd4e278c7d9 Author: Ram Pai Date: Tue Jul 17 06:51:07 2018 -0700 powerpc/pkeys: Preallocate execute-only key execute-only key is allocated dynamically. This is a problem. When a thread implicitly creates an execute-only key, and resets the UAMOR for that key, the UAMOR value does not percolate to all the other threads. Any other thread may ignorantly change the permissions on the key. This can cause the key to be not execute-only for that thread. Preallocate the execute-only key and ensure that no thread can change the permission of the key, by resetting the corresponding bit in UAMOR. Fixes: 5586cf61e108 ("powerpc: introduce execute-only pkey") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Ram Pai Signed-off-by: Michael Ellerman commit fe6a2804e65969a574377bdb3605afb79e6091a9 Author: Ram Pai Date: Tue Jul 17 06:51:06 2018 -0700 powerpc/pkeys: Fix calculation of total pkeys. Total number of pkeys calculation is off by 1. Fix it. Fixes: 4fb158f65ac5 ("powerpc: track allocation status of all pkeys") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Ram Pai Signed-off-by: Michael Ellerman commit 2c870e61132c082a03769d2ac0a2849ba33c10e3 Author: Arnd Bergmann Date: Tue Jul 24 11:48:45 2018 +0200 arm64: fix ACPI dependencies Kconfig reports a warning on x86 builds after the ARM64 dependency was added. drivers/acpi/Kconfig:6:error: recursive dependency detected! drivers/acpi/Kconfig:6: symbol ACPI depends on EFI This rephrases the dependency to keep the ARM64 details out of the shared Kconfig file, so Kconfig no longer gets confused by it. For consistency, all three architectures that support ACPI now select ARCH_SUPPORTS_ACPI in exactly the configuration in which they allow it. We still need the 'default x86', as each one wants a different default: default-y on x86, default-n on arm64, and always-y on ia64. Fixes: 5bcd44083a08 ("drivers: acpi: add dependency of EFI for arm64") Reviewed-by: Rafael J. Wysocki Acked-by: Will Deacon Signed-off-by: Arnd Bergmann Signed-off-by: Will Deacon commit c76662e825f507b98938dc3bb141c4505bd4968c Author: Ram Pai Date: Tue Jul 17 06:51:05 2018 -0700 powerpc/pkeys: Save the pkey registers before fork When a thread forks the contents of AMR, IAMR, UAMOR registers in the newly forked thread are not inherited. Save the registers before forking, for content of those registers to be automatically copied into the new thread. Fixes: cf43d3b26452 ("powerpc: Enable pkey subsystem") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Ram Pai Signed-off-by: Michael Ellerman commit 4a4a5e5d2aadc793be95024f454cf511d115b62d Author: Ram Pai Date: Tue Jul 17 06:51:04 2018 -0700 powerpc/pkeys: key allocation/deallocation must not change pkey registers Key allocation and deallocation has the side effect of programming the UAMOR/AMR/IAMR registers. This is wrong, since its the responsibility of the application and not that of the kernel, to modify the permission on the key. Do not modify the pkey registers at key allocation/deallocation. This patch also fixes a bug where a sys_pkey_free() resets the UAMOR bits of the key, thus making its permissions unmodifiable from user space. Later if the same key gets reallocated from a different thread this thread will no longer be able to change the permissions on the key. Fixes: cf43d3b26452 ("powerpc: Enable pkey subsystem") Cc: stable@vger.kernel.org # v4.16+ Reviewed-by: Thiago Jung Bauermann Signed-off-by: Ram Pai Signed-off-by: Michael Ellerman commit de113256f8c1c24d8c79ae388bf2a5abd70f7577 Author: Ram Pai Date: Tue Jul 17 06:51:03 2018 -0700 powerpc/pkeys: Deny read/write/execute by default Deny all permissions on all keys, with some exceptions. pkey-0 must allow all permissions, or else everything comes to a screaching halt. Execute-only key must allow execute permission. Fixes: cf43d3b26452 ("powerpc: Enable pkey subsystem") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Ram Pai Signed-off-by: Michael Ellerman commit a57a04c76e06822e4377831611364c846b7202ca Author: Ram Pai Date: Tue Jul 17 06:51:02 2018 -0700 powerpc/pkeys: Give all threads control of their key permissions Currently in a multithreaded application, a key allocated by one thread is not usable by other threads. By "not usable" we mean that other threads are unable to change the access permissions for that key for themselves. When a new key is allocated in one thread, the corresponding UAMOR bits for that thread get enabled, however the UAMOR bits for that key for all other threads remain disabled. Other threads have no way to set permissions on the key, and the current default permissions are that read/write is enabled for all keys, which means the key has no effect for other threads. Although that may be the desired behaviour in some circumstances, having all threads able to control their permissions for the key is more flexible. The current behaviour also differs from the x86 behaviour, which is problematic for users. To fix this, enable the UAMOR bits for all keys, at process creation (in start_thread(), ie exec time). Since the contents of UAMOR are inherited at fork, all threads are capable of modifying the permissions on any key. This is technically an ABI break on powerpc, but pkey support is fairly new on powerpc and not widely used, and this brings us into line with x86. Fixes: cf43d3b26452 ("powerpc: Enable pkey subsystem") Cc: stable@vger.kernel.org # v4.16+ Tested-by: Florian Weimer Signed-off-by: Ram Pai [mpe: Reword some of the changelog] Signed-off-by: Michael Ellerman commit 467b061f1ac80f323bedb56d20a24f7bc0d2cec5 Author: Srinivas Kandagatla Date: Mon Jul 23 16:54:03 2018 +0100 ASoC: core: add support to snd_soc_dai_get_channel_map() On Qualcomm platforms, specifically with SLIMbus interfaced codecs, the codec slim channel numbers are passed to DSP while configuring the slim audio path. Having get_channel_map() would allow dais to share such information across multiple dais. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit a70a4694ed38fb68407c142db0f53722553bedea Author: Wei Yongjun Date: Tue Jul 24 06:32:59 2018 +0000 regulator: bd9571mwv: Make symbol 'dev_attr_backup_mode' static Fixes the following sparse warning: drivers/regulator/bd9571mwv-regulator.c:220:1: warning: symbol 'dev_attr_backup_mode' was not declared. Should it be static? Signed-off-by: Wei Yongjun Reviewed-by: Geert Uytterhoeven Signed-off-by: Mark Brown commit d96f8bd28cd0bae3e6702ae90df593628ef6906f Author: Oder Chiou Date: Tue Jul 24 15:49:23 2018 +0800 ASoC: rt5514: Fix the issue of the delay volume applied The patch fixes the issue of the delay volume applied. Signed-off-by: Oder Chiou Signed-off-by: Mark Brown commit a241c3d95b8b985834d218eedde3923ed683e862 Author: Arnd Bergmann Date: Tue Jul 24 11:36:45 2018 +0200 ASoC: meson: axg-spdifout: select SND_PCM_IEC958 When CONFIG_SND_PCM_IEC958 is disabled, we get a link error for the new driver: sound/soc/meson/axg-spdifout.o: In function `axg_spdifout_hw_params': axg-spdifout.c:(.text+0x650): undefined reference to `snd_pcm_create_iec958_consumer_hw_params' The other users use 'select', so we should do the same here. Fixes: 53eb4b7aaa04 ("ASoC: meson: add axg spdif output") Signed-off-by: Arnd Bergmann Acked-by: Jerome Brunet Signed-off-by: Mark Brown commit f9b54e1961c7052e7d7817d707826eb2b9a1ca09 Author: Takashi Iwai Date: Wed Jul 11 15:05:06 2018 +0200 ALSA: hda/i915: Allow delayed i915 audio component binding Currently HD-audio i915 audio binding doesn't support any delayed binding, and supposes that the i915 driver registers the component immediately. This has been OK, so far, but the work-in-progress change in i915 may introduce the asynchronous binding, which effectively delays the component registration. For addressing it, implement a completion to be synced with the master binding. The timeout is set to 10 seconds which should be long enough and hopefully be not too annoying if anyone boots up a debugging session with i915 KMS turned off. Signed-off-by: Takashi Iwai commit 3d779180c69261f5c713832e46763e38589c18d3 Author: Liu Xiang Date: Sun Jul 22 17:58:24 2018 +0800 power: supply: bq27xxx: Update comments The URL of bq27441-g1 and bq27426 are missing and bq27520-g4 is duplicated. Signed-off-by: Liu Xiang Reviewed-by: Pali Rohár Acked-by: Andrew F. Davis Signed-off-by: Sebastian Reichel commit 82f2d30570b7ecdf1ce7e6376805f063ae86a7e5 Author: Lucas Rangit Magasweran Date: Sat Jul 14 15:40:18 2018 -0700 ACPI: battery: remove redundant old_present check on insertion On removal battery_present changes from 1 to 0 after calling acpi_battery_get_status() and battery->update_time is set to 0 before returning. On insertion battery_present changes from 0 to 1 after calling acpi_battery_get_status() and acpi_battery_get_info() is called because battery->update_time is 0. The old_present condition is therefore redundant. This was added in the commit below when there was a path without sysfs that would skip getting the newly inserted battery info. commit 50b178512b7d ("Newly inserted battery might differ from one just removed, so update of battery info fields is required.") Signed-off-by: Lucas Rangit Magasweran Signed-off-by: Rafael J. Wysocki commit 387048f51aecaa083e660fe0f15ad339354b116e Author: zhong jiang Date: Sat Jul 21 15:55:32 2018 +0800 x86/mm/tlb: Make clear_asid_other() static Fixes the following sparse warning: arch/x86/mm/tlb.c:38:6: warning: symbol 'clear_asid_other' was not declared. Should it be static? Signed-off-by: zhong jiang Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: dave.hansen@linux.intel.com Cc: kirill.shutemov@linux.intel.com Cc: tim.c.chen@linux.intel.com Link: http://lkml.kernel.org/r/1532159732-22939-1-git-send-email-zhongjiang@huawei.com Signed-off-by: Ingo Molnar commit 2397134ce2d73dcf1d4846579f594c9f3880b2ec Author: YueHaibing Date: Fri Jul 20 15:32:13 2018 +0800 x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to fix ptr_ret.cocci warning The ptr_ret.cocci script generates the following warning: arch/x86/kernel/pcspeaker.c:12:8-14: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO() rather than an open-coded version to fix this. Signed-off-by: YueHaibing Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: gregkh@linuxfoundation.org Cc: kstewart@linuxfoundation.org Cc: pombredanne@nexb.com Link: http://lkml.kernel.org/r/20180720073213.14996-1-yuehaibing@huawei.com Signed-off-by: Ingo Molnar commit 3f2b78d630b46c7921cb415be35f686e5293c3a4 Author: Krzysztof Kozlowski Date: Wed Jul 18 21:55:20 2018 +0200 drm/exynos/mixer: Remove unused local variable priv Remove local variable 'priv' to fix GCC warning: drivers/gpu/drm/exynos/exynos_mixer.c: In function 'mixer_initialize': drivers/gpu/drm/exynos/exynos_mixer.c:840:29: warning: variable 'priv' set but not used [-Wunused-but-set-variable] Signed-off-by: Krzysztof Kozlowski Signed-off-by: Inki Dae commit 7e915746de03e0e62d58491f22805cc5a80a581a Author: Marek Szyprowski Date: Mon Jun 11 14:25:00 2018 +0200 drm/exynos: Ensure suspended runtime PM state during system suspend Add calls to pm_runtime_force_{suspend,resume} as SYSTEM_SLEEP_PM_OPS for all drivers for the real Exynos DRM hardware modules. This ensures that the resources will be released for the system PM suspend/resume cycle. Exynos DRM core already takes care of suspending the whole display pipeline before PM callbacks of the real devices are called. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit dc684af6fc8d3b9be7fda67e380e91bfdc773aa5 Author: Marek Szyprowski Date: Mon Jun 11 14:24:59 2018 +0200 drm/exynos: Suspend/resume display pipeline as early/late as possible In the current code, exynos_drm_suspend() function is called after all real devices (CRTCs, Encoders, etc) are suspended, because Exynos DRM virtual platform device is created as last device in the system (as a part of DRM registration). None of the devices for real hardware modules has its own system suspend/resume callbacks, so it doesn't change any order of the executed code, but it has a side-effect: runtime PM callbacks for real devices are not executed, because those devices are considered by PM core as already suspended. This might cause issues on boards with complex pipelines, where something depends on the runtime PM state of the given device. To ensure that exynos_drm_suspend() is called before any suspend callback from the real devices, assign it to .prepare callback. Same for exynos_drm_resume(), using .complete callback ensures that all real devices have been resumed when calling it. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit 133bf90dbb8b873286f8ec2e81ba26e863114b8c Author: Manikanta Pubbisetty Date: Tue Jul 10 16:48:27 2018 +0530 mac80211: restrict delayed tailroom needed decrement As explained in ieee80211_delayed_tailroom_dec(), during roam, keys of the old AP will be destroyed and new keys will be installed. Deletion of the old key causes crypto_tx_tailroom_needed_cnt to go from 1 to 0 and the new key installation causes a transition from 0 to 1. Whenever crypto_tx_tailroom_needed_cnt transitions from 0 to 1, we invoke synchronize_net(); the reason for doing this is to avoid a race in the TX path as explained in increment_tailroom_need_count(). This synchronize_net() operation can be slow and can affect the station roam time. To avoid this, decrementing the crypto_tx_tailroom_needed_cnt is delayed for a while so that upon installation of new key the transition would be from 1 to 2 instead of 0 to 1 and thereby improving the roam time. This is all correct for a STA iftype, but deferring the tailroom_needed decrement for other iftypes may be unnecessary. For example, let's consider the case of a 4-addr client connecting to an AP for which AP_VLAN interface is also created, let the initial value for tailroom_needed on the AP be 1. * 4-addr client connects to the AP (AP: tailroom_needed = 1) * AP will clear old keys, delay decrement of tailroom_needed count * AP_VLAN is created, it takes the tailroom count from master (AP_VLAN: tailroom_needed = 1, AP: tailroom_needed = 1) * Install new key for the station, assume key is plumbed in the HW, there won't be any change in tailroom_needed count on AP iface * Delayed decrement of tailroom_needed count on AP (AP: tailroom_needed = 0, AP_VLAN: tailroom_needed = 1) Because of the delayed decrement on AP iface, tailroom_needed count goes out of sync between AP(master iface) and AP_VLAN(slave iface) and there would be unnecessary tailroom created for the packets going through AP_VLAN iface. Also, WARN_ONs were observed while trying to bring down the AP_VLAN interface: (warn_slowpath_common) (warn_slowpath_null+0x18/0x20) (warn_slowpath_null) (ieee80211_free_keys+0x114/0x1e4) (ieee80211_free_keys) (ieee80211_del_virtual_monitor+0x51c/0x850) (ieee80211_del_virtual_monitor) (ieee80211_stop+0x30/0x3c) (ieee80211_stop) (__dev_close_many+0x94/0xb8) (__dev_close_many) (dev_close_many+0x5c/0xc8) Restricting delayed decrement to station interface alone fixes the problem and it makes sense to do so because delayed decrement is done to improve roam time which is applicable only for client devices. Signed-off-by: Manikanta Pubbisetty Signed-off-by: Johannes Berg commit eebdc3b49abbfc7ab574eaddebfec64df27a5cf4 Author: Marek Szyprowski Date: Mon Jun 11 14:24:58 2018 +0200 drm/exynos: Drop useless check from exynos_drm_{suspend,resume} The virtual Exynos DRM device has no runtime PM enabled, so checking for its runtime suspended state is useless. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit d17504b16ea270ad858ce117447a8f4aa5a2de73 Author: Kees Cook Date: Sun Jul 15 20:52:26 2018 -0700 wireless/lib80211: Convert from ahash to shash In preparing to remove all stack VLA usage from the kernel[1], this removes the discouraged use of AHASH_REQUEST_ON_STACK in favor of the smaller SHASH_DESC_ON_STACK by converting from ahash-wrapped-shash to direct shash. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Johannes Berg commit e978de54957f49333266f0212bb3c27e61f0bceb Author: Marek Szyprowski Date: Mon Jul 9 15:44:32 2018 +0200 drm/exynos: Use common exynos_drm_gem_get()/put() functions for GEM lookup Use recently introduced common helpers to unify GEM handling code. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit 3aa2a5c14076e212fb3220d827c2e83806e7ce30 Author: Marek Szyprowski Date: Mon Jul 9 15:44:31 2018 +0200 drm/exynos: gem: Simplify access to exynos GEM objects Replace all calls to exynos_drm_gem_get_{dma_addr,size}, by a simpler function exynos_drm_gem_get(). This lets the caller to get access to exynos_drm_gem object and extract any information about GEM object without searching object tree for getting each parameter. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit eb4d9796fa340495b519c75d0be44ae583e67ec3 Author: Marek Szyprowski Date: Mon Jul 9 15:44:30 2018 +0200 drm/exynos: g2d: Convert to driver component API Exynos G2D driver is the last client of the custom Exynos 'sub-driver' framework. In the current state it doesn't really resolve any of the issues it has been designed for, as Exynos DRM is already built only as a single kernel module. Remove the custom 'sub-driver' framework and simply use generic component framework also in G2D driver. Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit d0cff240b83babe72f5ba28044268b86aaa91d53 Author: Benjamin Herrenschmidt Date: Tue Jul 24 16:35:03 2018 +1000 fsi: master-ast-cf: Fix build warnings on 64-bit platforms A couple of places forgot the 'z' qualifier for dev_dbg when printing a size_t Signed-off-by: Benjamin Herrenschmidt commit 2d3bda7071a713fa4ecf9d0acb7faede6d59100a Merge: 500775074f88 aab109b340ea Author: Inki Dae Date: Tue Jul 24 15:28:44 2018 +0900 Merge tag 'exynos-drm-fixes-for-v4.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into exynos-drm-next Fixups - Fix several problems to IPPv2 merged to mainline recentely. . An align problem of width size that IPP driver incorrectly calculated the real buffer size. . Horizontal and vertical flip problem. . Per-plane global alpha for XRGB modes. . Incorrect variant of the YUV modes. - Fix plane overlapping problem. . The stange order of overlapping planes on XRGB modes by setting global alpha value to maximum value. Cleanup - Rename a enum type, drm_ipp_size_id, to one specific to Exynos, drm_exynos_ipp_limit_type. - Replace {un/reference} with {put,get} functions. . it replaces several reference/unreference functions with Linux kernel nameing standard. commit 670d198b61ebfb4c9b13e50dccbd904a62ae593c Merge: bce5c2ea350f 0a213777d1dd Author: Greg Kroah-Hartman Date: Tue Jul 24 08:00:13 2018 +0200 Merge tag 'fsi-updates-2018-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/linux-fsi into char-misc-testing Ben writes: This adds support for offloading the FSI low level bitbanging to the ColdFire coprocessor of the Aspeed SoCs. All the pre-requisites have already been merged, this is the final piece in the puzzle. This branch also pull gpio/ib-aspeed which is a topic branch already in gpio/for-next (and thus in next) whic contains pre-requisites. Finally, there's also a bug fix to the sbefifo driver for some inconsistent use of a mutex in the error handling code. commit 664000b6bb4352295dc774108a1fc87c4a1ad0e3 Author: Yishai Hadas Date: Tue Jun 19 15:23:36 2018 +0300 net/mlx5: Add support for flow table destination number Add support to set a destination from a flow table number. This functionality will be used in downstream patches from this series by the DEVX stuff. Signed-off-by: Yishai Hadas Acked-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 2aada6c0c96e55e3b3f5024d164b9575382de6b8 Author: Yishai Hadas Date: Tue Jun 19 15:09:48 2018 +0300 net/mlx5: Add forward compatible support for the FTE match data Use the PRM size including the reserved when working with the FTE match data. This comes to support forward compatibility for cases that current reserved data will be exposed by the firmware by an application that uses the DEVX API without changing the kernel. Also drop some driver checks around the match criteria leaving the work for firmware to enable forward compatibility for future bits there. Signed-off-by: Yishai Hadas Acked-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 8c15e21c3508f48c291591fefa9beee0a08a3447 Author: Rafał Miłecki Date: Sat Jul 21 13:55:09 2018 +0200 mtd: lpddr: use mtd_device_register() This driver doesn't specify parsers so it can use that little helper. Signed-off-by: Rafał Miłecki Signed-off-by: Boris Brezillon commit ec14b83a1ee40a9a72d84f0af356eccc948b24c4 Author: Antoine Tenart Date: Fri Jul 13 16:53:10 2018 +0200 phy: mvebu-cp110-comphy: switch to SPDX identifier Use the appropriate SPDX license identifier and drop the license text. This patch is only cosmetic. Signed-off-by: Antoine Tenart Signed-off-by: Kishon Vijay Abraham I commit 5a78671309e029d8e3427a5b9ec440c0d9ba9bde Author: Yoshihiro Shimoda Date: Wed Jun 6 15:42:28 2018 +0900 dt-bindings: rcar-gen3-phy-usb2: Add bindings for r8a77990 This patch adds suuport for r8a77990 (R-Car E3). Signed-off-by: Yoshihiro Shimoda Signed-off-by: Kishon Vijay Abraham I commit a527d3f728bfdb6c30c8ecc0b58e695d05d42fc8 Merge: 176bd861ff5a 4a07ed51cae1 Author: David S. Miller Date: Mon Jul 23 21:30:03 2018 -0700 Merge tag 'wireless-drivers-next-for-davem-2018-07-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.19 The first set of patches for 4.19. Only smaller features and bug fixes, not really anything major. Also included are changes to include/linux/bitfield.h, we agreed with Johannes that it makes sense to apply them via wireless-drivers-next. Major changes: ath10k * support channel 173 * fix spectral scan for QCA9984 and QCA9888 chipsets ath6kl * add support for Dell Wireless 1537 ti wlcore * add support for runtime PM * enable runtime PM autosuspend support qtnfmac * support changing MAC address * enable source MAC address randomization support libertas * fix suspend and resume for SDIO cards mt76 * add software DFS radar pattern detector for mt76x2 based devices ==================== Signed-off-by: David S. Miller commit 176bd861ff5affe4a54bcd00266279542142170c Merge: a6c90dd321bf b7ff8b1036f0 Author: David S. Miller Date: Mon Jul 23 21:17:44 2018 -0700 Merge branch 'rds-ipv6' Ka-Cheong Poon says: ==================== rds: IPv6 support This patch set adds IPv6 support to the kernel RDS and related modules. Existing RDS apps using IPv4 address continue to run without any problem. New RDS apps which want to use IPv6 address can do so by passing the address in struct sockaddr_in6 to bind(), connect() or sendmsg(). And those apps also need to use the new IPv6 equivalents of some of the existing socket options as the existing options use a 32 bit integer to store IP address. All RDS code now use struct in6_addr to store IP address. IPv4 address is stored as an IPv4 mapped address. Header file changes There are many data structures (RDS socket options) used by RDS apps which use a 32 bit integer to store IP address. To support IPv6, struct in6_addr needs to be used. To ensure backward compatibility, a new data structure is introduced for each of those data structures which use a 32 bit integer to represent an IP address. And new socket options are introduced to use those new structures. This means that existing apps should work without a problem with the new RDS module. For apps which want to use IPv6, those new data structures and socket options can be used. IPv4 mapped address is used to represent IPv4 address in the new data structures. Internally, all RDS data structures which contain an IP address are changed to use struct in6_addr to store the address. IPv4 address is stored as an IPv4 mapped address. All the functions which take an IP address as argument are also changed to use struct in6_addr. RDS/RDMA/IB uses a private data (struct rds_ib_connect_private) exchange between endpoints at RDS connection establishment time to support RDMA. This private data exchange uses a 32 bit integer to represent an IP address. This needs to be changed in order to support IPv6. A new private data struct rds6_ib_connect_private is introduced to handle this. To ensure backward compatibility, an IPv6 capable RDS stack uses another RDMA listener port (RDS_CM_PORT) to accept IPv6 connection. And it continues to use the original RDS_PORT for IPv4 RDS connections. When it needs to communicate with an IPv6 peer, it uses the RDS_TCP_PORT to send the connection set up request. RDS/TCP changes TCP related code is changed to support IPv6. Note that only an IPv6 TCP listener on port RDS_TCP_PORT is created as it can accept both IPv4 and IPv6 connection requests. IB/RDMA changes The initial private data exchange between IB endpoints using RDMA is changed to support IPv6 address instead, if the peer address is IPv6. To ensure backward compatibility, annother RDMA listener port (RDS_CM_PORT) is used to accept IPv6 connection. An IPv6 capable RDS module continues to use the original RDS_PORT for IPv4 RDS connections. When it needs to communicate with an IPv6 peer, it uses the RDS_CM_PORT to send the connection set up request. ==================== Signed-off-by: David S. Miller commit b7ff8b1036f0b0df1390ba6b5e9bc7ec458e857a Author: Ka-Cheong Poon Date: Mon Jul 23 20:51:23 2018 -0700 rds: Extend RDS API for IPv6 support There are many data structures (RDS socket options) used by RDS apps which use a 32 bit integer to store IP address. To support IPv6, struct in6_addr needs to be used. To ensure backward compatibility, a new data structure is introduced for each of those data structures which use a 32 bit integer to represent an IP address. And new socket options are introduced to use those new structures. This means that existing apps should work without a problem with the new RDS module. For apps which want to use IPv6, those new data structures and socket options can be used. IPv4 mapped address is used to represent IPv4 address in the new data structures. v4: Revert changes to SO_RDS_TRANSPORT Signed-off-by: Ka-Cheong Poon Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit 1e2b44e78eead7bcadfbf96f70d95773191541c9 Author: Ka-Cheong Poon Date: Mon Jul 23 20:51:22 2018 -0700 rds: Enable RDS IPv6 support This patch enables RDS to use IPv6 addresses. For RDS/TCP, the listener is now an IPv6 endpoint which accepts both IPv4 and IPv6 connection requests. RDS/RDMA/IB uses a private data (struct rds_ib_connect_private) exchange between endpoints at RDS connection establishment time to support RDMA. This private data exchange uses a 32 bit integer to represent an IP address. This needs to be changed in order to support IPv6. A new private data struct rds6_ib_connect_private is introduced to handle this. To ensure backward compatibility, an IPv6 capable RDS stack uses another RDMA listener port (RDS_CM_PORT) to accept IPv6 connection. And it continues to use the original RDS_PORT for IPv4 RDS connections. When it needs to communicate with an IPv6 peer, it uses the RDS_CM_PORT to send the connection set up request. v5: Fixed syntax problem (David Miller). v4: Changed port history comments in rds.h (Sowmini Varadhan). v3: Added support to set up IPv4 connection using mapped address (David Miller). Added support to set up connection between link local and non-link addresses. Various review comments from Santosh Shilimkar and Sowmini Varadhan. v2: Fixed bound and peer address scope mismatched issue. Added back rds_connect() IPv6 changes. Signed-off-by: Ka-Cheong Poon Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit eee2fa6ab3225192d6d894c54a6fb02ac9efdff6 Author: Ka-Cheong Poon Date: Mon Jul 23 20:51:21 2018 -0700 rds: Changing IP address internal representation to struct in6_addr This patch changes the internal representation of an IP address to use struct in6_addr. IPv4 address is stored as an IPv4 mapped address. All the functions which take an IP address as argument are also changed to use struct in6_addr. But RDS socket layer is not modified such that it still does not accept IPv6 address from an application. And RDS layer does not accept nor initiate IPv6 connections. v2: Fixed sparse warnings. Signed-off-by: Ka-Cheong Poon Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit a6c90dd321bfeb5e48fc2eb6623b7b976106f6d7 Merge: d3585edf8749 d159b381795b Author: David S. Miller Date: Mon Jul 23 20:44:13 2018 -0700 Merge branch 'sched-introduce-chain-templates-support-with-offloading-to-mlxsw' Jiri Pirko says: ==================== sched: introduce chain templates support with offloading to mlxsw For the TC clsact offload these days, some of HW drivers need to hold a magic ball. The reason is, with the first inserted rule inside HW they need to guess what fields will be used for the matching. If later on this guess proves to be wrong and user adds a filter with a different field to match, there's a problem. Mlxsw resolves it now with couple of patterns. Those try to cover as many match fields as possible. This aproach is far from optimal, both performance-wise and scale-wise. Also, there is a combination of filters that in certain order won't succeed. Most of the time, when user inserts filters in chain, he knows right away how the filters are going to look like - what type and option will they have. For example, he knows that he will only insert filters of type flower matching destination IP address. He can specify a template that would cover all the filters in the chain. This patchset is providing the possibility to user to provide such template to kernel and propagate it all the way down to device drivers. See the examples below. Create dummy device with clsact first: There is no chain present by by default: Add chain number 11 by explicit command: chain parent ffff: chain 11 Add filter to chain number 12 which does not exist. That will create implicit chain 12: chain parent ffff: chain 11 chain parent ffff: chain 12 Delete both chains: Add a chain with template of type flower allowing to insert rules matching on last 2 bytes of destination mac address: The chain with template is now showed in the list: chain parent ffff: flower chain 0 dst_mac 00:00:00:00:00:00/00:00:00:00:ff:ff eth_type ipv4 Add another chain (number 22) with template: chain parent ffff: flower chain 0 dst_mac 00:00:00:00:00:00/00:00:00:00:ff:ff eth_type ipv4 chain parent ffff: flower chain 22 eth_type ipv4 dst_ip 0.0.0.0/16 Add a filter that fits the template: Addition of filters that does not fit the template would fail: Error: cls_flower: Mask does not fit the template. We have an error talking to the kernel, -1 Error: cls_flower: Mask does not fit the template. We have an error talking to the kernel, -1 Additions of filters to chain 22: Error: cls_flower: Mask does not fit the template. We have an error talking to the kernel, -1 Error: cls_flower: Mask does not fit the template. We have an error talking to the kernel, -1 --- v3->v4: - patch 2: - new patch - patch 3: - new patch, derived from the previous v3 chaintemplate obj patch - patch 4: - only templates part as chains creation/deletion is now a separate patch - don't pass template priv as arg of "change" op - patch 6: - rebased on top of flower cvlan patch and ip tos/ttl patch - patch 7: - templave priv is no longer passed as an arg to "change" op - patch 11: - split from the originally single patch - patch 12: - split from the originally single patch v2->v3: - patch 7: - rebase on top of the reoffload patchset - patch 8: - rebase on top of the reoffload patchset v1->v2: - patch 8: - remove leftover extack arg in fl_hw_create_tmplt() ==================== Signed-off-by: David S. Miller commit d159b381795b138532436cce1229f5305c6f1a21 Author: Jiri Pirko Date: Mon Jul 23 09:24:07 2018 +0200 selftests: forwarding: add tests for TC chain templates Add basic sanity tests for TC chain templates. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 2d73c8871fae2da72f4717c15d4256ec6ba208c4 Author: Jiri Pirko Date: Mon Jul 23 09:24:06 2018 +0200 selftests: forwarding: add tests for TC chains creation adn destruction Add basic sanity tests for TC chains. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 7f333cbf2b5bb48045e4f31de1c33fb701ffa45a Author: Jiri Pirko Date: Mon Jul 23 09:24:05 2018 +0200 selftests: forwarding: move shblock tc support check to a separate helper The shared block support is only needed for tc_shblock.sh. No need to require that for other test. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit e2f2a1fd5b2ceadc1182fb20809664076d75beb2 Author: Jiri Pirko Date: Mon Jul 23 09:23:12 2018 +0200 mlxsw: spectrum: Implement chain template hinting Since cld_flower provides information about the filter template for specific chain, use this information in order to prepare a region. Use the template to find out what elements are going to be used and pass that down to mlxsw_sp_acl_tcam_group_add(). Later on, when the first filter is inserted, the mlxsw_sp_acl_tcam_group_use_patterns() function would use this element usage information instead of looking up a pattern. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 34738452739069947e528123810533f28dd8332b Author: Jiri Pirko Date: Mon Jul 23 09:23:11 2018 +0200 net: sched: cls_flower: propagate chain teplate creation and destruction to drivers Introduce a couple of flower offload commands in order to propagate template creation/destruction events down to device drivers. Drivers may use this information to prepare HW in an optimal way for future filter insertions. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit b95ec7eb3b4d2f158dd15c912cf670b546f09571 Author: Jiri Pirko Date: Mon Jul 23 09:23:10 2018 +0200 net: sched: cls_flower: implement chain templates Use the previously introduced template extension and implement callback to create, destroy and dump chain template. The existing parsing and dumping functions are re-used. Also, check if newly added filters fit the template if it is set. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 33fb5cba11ff639c32f4f0104b04b2415fcd9ecc Author: Jiri Pirko Date: Mon Jul 23 09:23:09 2018 +0200 net: sched: cls_flower: change fl_init_dissector to accept mask and dissector This function is going to be used for templates as well, so we need to pass the pointer separately. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit f5749081f0d48ae585233232df6cfc4c7c9642f9 Author: Jiri Pirko Date: Mon Jul 23 09:23:08 2018 +0200 net: sched: cls_flower: move key/mask dumping into a separate function Push key/mask dumping from fl_dump() into a separate function fl_dump_key(), that will be reused for template dumping. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 9f407f1768d3e1a5ddd7bd49fa4d1f5a26e10ed2 Author: Jiri Pirko Date: Mon Jul 23 09:23:07 2018 +0200 net: sched: introduce chain templates Allow user to set a template for newly created chains. Template lock down the chain for particular classifier type/options combinations. The classifier needs to support templates, otherwise kernel would reply with error. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 32a4f5ecd7381f30ae3bb36dea77a150ba68af2e Author: Jiri Pirko Date: Mon Jul 23 09:23:06 2018 +0200 net: sched: introduce chain object to uapi Allow user to create, destroy, get and dump chain objects. Do that by extending rtnl commands by the chain-specific ones. User will now be able to explicitly create or destroy chains (so far this was done only automatically according the filter/act needs and refcounting). Also, the user will receive notification about any chain creation or destuction. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit f71e0ca4db187af7c44987e9d21e9042c3046070 Author: Jiri Pirko Date: Mon Jul 23 09:23:05 2018 +0200 net: sched: Avoid implicit chain 0 creation Currently, chain 0 is implicitly created during block creation. However that does not align with chain object exposure, creation and destruction api introduced later on. So make the chain 0 behave the same way as any other chain and only create it when it is needed. Since chain 0 is somehow special as the qdiscs need to hold pointer to the first chain tp, this requires to move the chain head change callback infra to the block structure. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit f34e8bff58f071e1a3452a5a6e29dac218c83f69 Author: Jiri Pirko Date: Mon Jul 23 09:23:04 2018 +0200 net: sched: push ops lookup bits into tcf_proto_lookup_ops() Push all bits that take care of ops lookup, including module loading outside tcf_proto_create() function, into tcf_proto_lookup_ops() Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit d3585edf8749e151760fc914912a4fee5aa1a2ac Merge: b19c7bb1ac67 ae62372f275c Author: David S. Miller Date: Mon Jul 23 20:34:36 2018 -0700 Merge branch 'cpsw-add-MQPRIO-and-CBS-Qdisc-offload' Ivan Khoronzhuk says: ==================== net: ethernet: ti: cpsw: add MQPRIO and CBS Qdisc offload This series adds MQPRIO and CBS Qdisc offload for TI cpsw driver. It potentially can be used in audio video bridging (AVB) and time sensitive networking (TSN). Patchset was tested on AM572x EVM and BBB boards. Last patch from this series adds detailed description of configuration with examples. For consistency reasons, in role of talker and listener, tools from patchset "TSN: Add qdisc based config interface for CBS" were used and can be seen here: https://www.spinics.net/lists/netdev/msg460869.html Based on net-next/master v5..v4: - corrected typo of "am57xx" board name, no functional changes v4..v3: - nothing, just rebase v3..v2: - corrected typo of "shaper" word, no functional changes v2..v1: - changed name cpsw.txt on ti-cpsw.txt - changed name cpsw_set_tc() on cpsw_set_mqprio() ==================== Signed-off-by: David S. Miller commit ae62372f275c444b8363ddb6367684c573214c13 Author: Ivan Khoronzhuk Date: Tue Jul 24 00:26:34 2018 +0300 Documentation: networking: cpsw: add MQPRIO & CBS offload examples This document describes MQPRIO and CBS Qdisc offload configuration for cpsw driver based on examples. It potentially can be used in audio video bridging (AVB) and time sensitive networking (TSN). Reviewed-by: Ilias Apalodimas Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 4b4255ed068fd9e52eff01e1d90137222cce0e61 Author: Ivan Khoronzhuk Date: Tue Jul 24 00:26:33 2018 +0300 net: ethernet: ti: cpsw: restore shaper configuration while down/up Need to restore shapers configuration after interface was down/up. This is needed as appropriate configuration is still replicated in kernel settings. This only shapers context restore, so vlan configuration should be restored by user if needed, especially for devices with one port where vlan frames are sent via ALE. Reviewed-by: Ilias Apalodimas Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 57d901482546c0698ef8e11a6f7193432db6ec1c Author: Ivan Khoronzhuk Date: Tue Jul 24 00:26:32 2018 +0300 net: ethernet: ti: cpsw: add CBS Qdisc offload The cpsw has up to 4 FIFOs per port and upper 3 FIFOs can feed rate limited queue with shaping. In order to set and enable shaping for those 3 FIFOs queues the network device with CBS qdisc attached is needed. The CBS configuration is added for dual-emac/single port mode only, but potentially can be used in switch mode also, based on switchdev for instance. Despite the FIFO shapers can work w/o cpdma level shapers the base usage must be in combine with cpdma level shapers as described in TRM, that are set as maximum rates for interface queues with sysfs. One of the possible configuration with txq shapers and CBS shapers: Configured with echo RATE > /sys/class/net/eth0/queues/tx-0/tx_maxrate /--------------------------------------------------- / / cpdma level shapers +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ | c7 | | c6 | | c5 | | c4 | | c3 | | c2 | | c1 | | c0 | \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \/ \/ \/ \/ \/ \/ \/ \/ +---------|------|------|------|-------------------------------------+ | +----+ | | +---+ | | | +----+ | | | | v v v v | | +----+ +----+ +----+ +----+ p p+----+ +----+ +----+ +----+ | | | | | | | | | | o o| | | | | | | | | | | f3 | | f2 | | f1 | | f0 | r CPSW r| f3 | | f2 | | f1 | | f0 | | | | | | | | | | | t t| | | | | | | | | | \ / \ / \ / \ / 0 1\ / \ / \ / \ / | | \ X \ / \ / \ / \ / \ / \ / \ / | | \/ \ \/ \/ \/ \/ \/ \/ \/ | +-------\------------------------------------------------------------+ \ \ FIFO shaper, set with CBS offload added in this patch, \ FIFO0 cannot be rate limited ------------------------------------------------------ CBS shaper configuration is supposed to be used with root MQPRIO Qdisc offload allowing to add sk_prio->tc->txq maps that direct traffic to appropriate tx queue and maps L2 priority to FIFO shaper. The CBS shaper is intended to be used for AVB where L2 priority (pcp field) is used to differentiate class of traffic. So additionally vlan needs to be created with appropriate egress sk_prio->l2 prio map. If CBS has several tx queues assigned to it, the sum of their bandwidth has not overlap bandwidth set for CBS. It's recomended the CBS bandwidth to be a little bit more. The CBS shaper is configured with CBS qdisc offload interface using tc tool from iproute2 packet. For instance: $ tc qdisc replace dev eth0 handle 100: parent root mqprio num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 1 $ tc -g class show dev eth0 +---(100:ffe2) mqprio |    +---(100:3) mqprio |    +---(100:4) mqprio |     +---(100:ffe1) mqprio |    +---(100:2) mqprio |     +---(100:ffe0) mqprio     +---(100:1) mqprio $ tc qdisc add dev eth0 parent 100:1 cbs locredit -1440 \ hicredit 60 sendslope -960000 idleslope 40000 offload 1 $ tc qdisc add dev eth0 parent 100:2 cbs locredit -1470 \ hicredit 62 sendslope -980000 idleslope 20000 offload 1 The above code set CBS shapers for tc0 and tc1, for that txq0 and txq1 is used. Pay attention, the real set bandwidth can differ a bit due to discreteness of configuration parameters. Here parameters like locredit, hicredit and sendslope are ignored internally and are supposed to be set with assumption that maximum frame size for frame - 1500. It's supposed that interface speed is not changed while reconnection, not always is true, so inform user in case speed of interface was changed, as it can impact on dependent shapers configuration. For more examples see Documentation. Reviewed-by: Ilias Apalodimas Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 7929a66871a131f692145599b6cc11c571dfbd71 Author: Ivan Khoronzhuk Date: Tue Jul 24 00:26:31 2018 +0300 net: ethernet: ti: cpsw: add MQPRIO Qdisc offload That's possible to offload vlan to tc priority mapping with assumption sk_prio == L2 prio. Example: $ ethtool -L eth0 rx 1 tx 4 $ qdisc replace dev eth0 handle 100: parent root mqprio num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 1 $ tc -g class show dev eth0 +---(100:ffe2) mqprio |    +---(100:3) mqprio |    +---(100:4) mqprio |     +---(100:ffe1) mqprio |    +---(100:2) mqprio |     +---(100:ffe0) mqprio     +---(100:1) mqprio Here, 100:1 is txq0, 100:2 is txq1, 100:3 is txq2, 100:4 is txq3 txq0 belongs to tc0, txq1 to tc1, txq2 and txq3 to tc2 The offload part only maps L2 prio to classes of traffic, but not to transmit queues, so to direct traffic to traffic class vlan has to be created with appropriate egress map. Reviewed-by: Ilias Apalodimas Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 4bb6c356a0393fe7ff5741ede700ba99352640a0 Author: Ivan Khoronzhuk Date: Tue Jul 24 00:26:30 2018 +0300 net: ethernet: ti: cpdma: fit rated channels in backward order According to TRM tx rated channels should be in 7..0 order, so correct it. Reviewed-by: Ilias Apalodimas Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 79b3325d0d87a6b3af96485ff8029bcc26e070e3 Author: Ivan Khoronzhuk Date: Tue Jul 24 00:26:29 2018 +0300 net: ethernet: ti: cpsw: use cpdma channels in backward order for txq The cpdma channel highest priority is from hi to lo number. The driver has limited number of descriptors that are shared between number of cpdma channels. Number of queues can be tuned with ethtool, that allows to not spend descriptors on not needed cpdma channels. In AVB usually only 2 tx queues can be enough with rate limitation. The rate limitation can be used only for hi priority queues. Thus, to use only 2 queues the 8 has to be created. It's wasteful. So, in order to allow using only needed number of rate limited tx queues, save resources, and be able to set rate limitation for them, let assign tx cpdma channels in backward order to queues. Reviewed-by: Ilias Apalodimas Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit b19c7bb1ac675b3bb577e422b57fd59a0a201771 Merge: c9eaaa177398 3f44899ef2ce Author: David S. Miller Date: Mon Jul 23 20:22:33 2018 -0700 Merge tag 'mlx5e-updates-2018-07-18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5e-updates-2018-07-18 This series includes update for mlx5e net device driver. 1) From Feras Daoud, Added the support for firmware log tracing, first by introducing the firmware API needed for the task and then For each PF do the following: 1- Allocate memory for the tracer strings database and read it from the FW to the SW. 2- Allocate and dma map tracer buffers. Traces that will be written into the buffer will be parsed as a group of one or more traces, referred to as trace message. The trace message represents a C-like printf string. Once a new trace is available FW will generate an event indicates new trace/s are available and the driver will parse them and dump them using tracepoints event tracing Enable mlx5 fw tracing by: echo 1 > /sys/kernel/debug/tracing/events/mlx5/mlx5_fw/enable Read traces by: cat /sys/kernel/debug/tracing/trace 2) From Roi Dayan, Remove redundant WARN when we cannot find neigh entry 3) From Jianbo Liu, TC double vlan support - Support offloading tc double vlan headers match - Support offloading double vlan push/pop tc actions 4) From Boris, re-visit UDP GSO, remove the splitting of UDP_GSO_L4 packets in the driver, and exposes UDP_GSO_L4 as a PARTIAL_GSO feature. ==================== Signed-off-by: David S. Miller commit 97ab1bb4901cb5e1e43f6f7effd44e03d0e7427d Author: Huacai Chen Date: Sat Apr 28 11:21:26 2018 +0800 MIPS: Loongson64: Define and use some CP0 registers Defines CP0_CONFIG3, CP0_CONFIG6, CP0_PAGEGRAIN and use them in kernel-entry-init.h for Loongson64. Signed-off-by: Huacai Chen Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19264/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang Cc: Zhangjin Wu Cc: Huacai Chen commit 7cff3f168999fd1de4a41c5971363f42d49e961f Author: Huacai Chen Date: Sat Apr 28 11:21:25 2018 +0800 MIPS: Loongson: Add Loongson-3A R3.1 basic support Loongson-3A R3.1 is the bugfix revision of Loongson-3A R3. All Loongson-3 CPU family: Code-name Brand-name PRId Loongson-3A R1 Loongson-3A1000 0x6305 Loongson-3A R2 Loongson-3A2000 0x6308 Loongson-3A R3 Loongson-3A3000 0x6309 Loongson-3A R3.1 Loongson-3A3000 0x630d Loongson-3B R1 Loongson-3B1000 0x6306 Loongson-3B R2 Loongson-3B1500 0x6307 Signed-off-by: Huacai Chen Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19263/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang Cc: Zhangjin Wu Cc: Huacai Chen commit c6ea7e9747318e5a6774995f4f8e3e0f7c0fa8ba Author: Paul Cercueil Date: Sun Jul 8 17:07:12 2018 +0200 MIPS: jz4740: Bump zload address Having the zload address at 0x8060.0000 means the size of the uncompressed kernel cannot be bigger than around 6 MiB, as it is deflated at address 0x8001.0000. This limit is too small; a kernel with some built-in drivers and things like debugfs enabled will already be over 6 MiB in size, and so will fail to extract properly. To fix this, we bump the zload address from 0x8060.0000 to 0x8100.0000. This is fine, as all the boards featuring Ingenic JZ SoCs have at least 32 MiB of RAM, and use u-boot or compatible bootloaders which won't hardcode the load address but read it from the uImage's header. Signed-off-by: Paul Cercueil Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19787/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit cdf6b7362108708cea83dea347b9acf81a652d5f Author: Lukas Wunner Date: Thu Jul 19 17:27:50 2018 -0500 PCI: pciehp: Always enable occupied slot on probe Per PCIe r4.0, sec 6.7.3.4, a "port may optionally send an MSI when there are hot-plug events that occur while interrupt generation is disabled, and interrupt generation is subsequently enabled." On probe, we currently clear all event bits in the Slot Status register with the notable exception of the Presence Detect Changed bit. Thereby we seek to receive an interrupt for an already occupied slot once event notification is enabled. But because the interrupt is optional, users may have to specify the pciehp_force parameter on the command line, which is inconvenient. Moreover, now that pciehp's event handling has become resilient to missed events, a Presence Detect Changed interrupt for a slot which is powered on is interpreted as removal of the card. If the slot has already been brought up by the BIOS, receiving such an interrupt on probe causes the slot to be powered off and immediately back on, which is likewise undesirable. Avoid both issues by making the behavior of pciehp_force the default and clearing the Presence Detect Changed bit on probe. Note that the stated purpose of pciehp_force per the MODULE_PARM_DESC ("Force pciehp, even if OSHP is missing") seems nonsensical because the OSHP control method is only relevant for SHCP slots according to the PCI Firmware specification r3.0, sec 4.8. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Rafael J. Wysocki Cc: Mika Westerberg commit d331710ea78fea8b10624c87546d8bc0cd0389c9 Author: Lukas Wunner Date: Thu Jul 19 17:27:49 2018 -0500 PCI: pciehp: Become resilient to missed events A hotplug port's Slot Status register does not count how often each type of event occurred, it only records the fact *that* an event has occurred. Previously pciehp queued a work item for each event. But if it missed an event, e.g. removal of a card in-between two back-to-back insertions, it queued up the wrong work item or no work item at all. Commit fad214b0aa72 ("PCI: pciehp: Process all hotplug events before looking for new ones") sought to improve the situation by shrinking the window during which events may be missed. But Stefan Roese reports unbalanced Card present and Link Up events, suggesting that we're still missing events if they occur very rapidly. Bjorn Helgaas responds that he considers pciehp's event handling "baroque" and calls for its simplification and rationalization: https://lkml.kernel.org/r/20180202192045.GA53759@bhelgaas-glaptop.roam.corp.google.com It gets worse once a hotplug port is runtime suspended: The port can signal an interrupt while it and its parents are in D3hot, i.e. while it is inaccessible. By the time we've runtime resumed all parents to D0 and read the port's Slot Status register, we may have missed an arbitrary number of events. Event handling therefore needs to be reworked to become resilient to missed events. Assume that a Presence Detect Changed event has occurred. Consider the following truth table: - Slot is in OFF_STATE and is currently empty. => Do nothing. (The event is trailing a Link Down or we've missed an insertion and subsequent removal.) - Slot is in OFF_STATE and is currently occupied. => Turn the slot on. - Slot is in ON_STATE and is currently empty. => Turn the slot off. - Slot is in ON_STATE and is currently occupied. => Turn the slot off, (Be cautious and assume the card in then back on. the slot isn't the same as before.) This leads to the following simple algorithm: 1 If the slot is in ON_STATE, turn it off unconditionally. 2 If the slot is currently occupied, turn it on. Because those actions are now carried out synchronously, rather than by scheduled work items, pciehp reacts to the *current* situation and missed events no longer matter. Data Link Layer State Changed events can be handled identically to Presence Detect Changed events. Note that in the above truth table, a Link Up trailing a Card present event didn't have to be accounted for: It is filtered out by pciehp_check_link_status(). As for Attention Button Pressed events, PCIe r4.0, sec 6.7.1.5 says: "Once the Power Indicator begins blinking, a 5-second abort interval exists during which a second depression of the Attention Button cancels the operation." In other words, the user can only expect the system to react to a button press after it starts blinking. Missed button presses that occur in-between are irrelevant. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Stefan Roese Cc: Mayurkumar Patel Cc: Mika Westerberg Cc: Kenji Kaneshige commit 6c35a1ac3da63a7fe5b18b435a5a9d6b9fd3990a Author: Lukas Wunner Date: Thu Jul 19 17:27:49 2018 -0500 PCI: pciehp: Tolerate initially unstable link When a device is hotplugged, Presence Detect and Link Up events often do not occur simultaneously, but with a lag of a few milliseconds. Only the first event received is relevant, the other one can be disregarded. Moreover, Stefan Roese reports that on certain platforms, Link State and Presence Detect may flap for up to 100 ms before stabilizing, suggesting that such events should be disregarded for at least this long: https://lkml.kernel.org/r/20180130084121.18653-1-sr@denx.de On slot enablement, pciehp_check_link_status() waits for 100 ms per PCIe r4.0, sec 6.7.3.3, then probes the hotplugged device's vendor register for up to 1 second. If this succeeds, the link is definitely up, so ignore any Presence Detect or Link State events that occurred up to this point. pciehp_check_link_status() then checks the Link Training bit in the Link Status register. This is the final opportunity to detect inaccessibility of the device and abort slot enablement. Any link or presence change that occurs afterwards will cause the slot to be disabled again immediately after attempting to enable it. The astute reviewer may appreciate that achieving this behavior would be more complicated had pciehp not just been converted to enable/disable the slot exclusively from the IRQ thread: When the slot is enabled via sysfs, each link or presence flap would otherwise cause the IRQ thread to run and it would have to sense that those events are belonging to a concurrent slot enablement operation and disregard them. It would be much more difficult than this mere 3 line change. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Stefan Roese commit 25c83b84b110f50efe6fcf62e329f1db2af4454a Author: Lukas Wunner Date: Thu Jul 19 17:27:47 2018 -0500 PCI: pciehp: Declare pciehp_enable/disable_slot() static No callers of pciehp_enable/disable_slot() outside of pciehp_ctrl.c remain, so declare the functions static. For now this requires forward declarations. Those can be eliminated by reshuffling functions once the ongoing effort to refactor the driver has settled. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 1656716d45d0aae8c0a21a0553b9d27cd98fda61 Author: Lukas Wunner Date: Thu Jul 19 17:27:46 2018 -0500 PCI: pciehp: Drop enable/disable lock Previously slot enablement and disablement could happen concurrently. But now it's under the exclusive control of the IRQ thread, rendering the locking obsolete. Drop it. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 32a8cef274feacd00b748a4f13b84d60aa6d82ff Author: Lukas Wunner Date: Thu Jul 19 17:27:46 2018 -0500 PCI: pciehp: Enable/disable exclusively from IRQ thread Besides the IRQ thread, there are several other places in the driver which enable or disable the slot: - pciehp_probe() enables the slot if it's occupied and the pciehp_force module parameter is used. - pciehp_resume() enables or disables the slot after system sleep. - pciehp_queue_pushbutton_work() enables or disables the slot after the 5 second delay following an Attention Button press. - pciehp_sysfs_enable_slot() and pciehp_sysfs_disable_slot() enable or disable the slot on sysfs write. This requires locking and complicates pciehp's state machine. A simplification can be achieved by enabling and disabling the slot exclusively from the IRQ thread. Amend the functions listed above to request slot enable/disablement from the IRQ thread by either synthesizing a Presence Detect Changed event or, in the case of a disable user request (via sysfs or an Attention Button press), submitting a newly introduced force disable request. The latter is needed because the slot shall be forced off despite being occupied. For this force disable request, avoid colliding with Slot Status register bits by using a bit number greater than 16. For synchronous execution of requests (on sysfs write), wait for the request to finish and retrieve the result. There can only ever be one sysfs write in flight due to the locking in kernfs_fop_write(), hence there is no risk of returning the result of a different sysfs request to user space. The POWERON_STATE and POWEROFF_STATE is now no longer entered by the above-listed functions, but solely by the IRQ thread when it begins a power transition. Afterwards, it moves to STATIC_STATE. The same applies to canceling the Attention Button work, it likewise becomes an IRQ thread only operation. An immediate consequence is that the POWERON_STATE and POWEROFF_STATE is never observed by the IRQ thread itself, only by functions called in a different context, such as pciehp_sysfs_enable_slot(). So remove handling of these states from pciehp_handle_button_press() and pciehp_handle_link_change() which are exclusively called from the IRQ thread. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 9590192f2584c2cfc2fee88be22fe6e8921ed115 Author: Lukas Wunner Date: Thu Jul 19 17:27:45 2018 -0500 PCI: pciehp: Track enable/disable status handle_button_press_event() currently determines whether the slot has been turned on or off by looking at the Power Controller Control bit in the Slot Control register. This assumes that an attention button implies presence of a power controller even though that's not mandated by the spec. Moreover the Power Controller Control bit is unreliable when a power fault occurs (PCIe r4.0, sec 6.7.1.8). This issue has existed since the driver was introduced in 2004. Fix by replacing STATIC_STATE with ON_STATE and OFF_STATE and tracking whether the slot has been turned on or off. This is also a required ingredient to make pciehp resilient to missed events, which is the object of an upcoming commit. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 774d446b0f9222f46772dde8770d7c1c169c0284 Author: Lukas Wunner Date: Thu Jul 19 17:27:43 2018 -0500 PCI: pciehp: Publish to user space last on probe The PCI hotplug core has just been refactored to separate slot initialization for in-kernel use from publication to user space. Take advantage of it in pciehp by publishing to user space last on probe. This will allow enable/disablement of the slot exclusively from the IRQ thread because the IRQ is requested after initialization for in-kernel use (thereby getting its unique name needed by the IRQ thread) but before user space is able to submit enable/disable requests. On teardown, the order is the same in reverse: The user space interface is removed prior to freeing the IRQ and destroying the slot. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 51bbf9bee34ff5d4006d266f24a54dc9c1669eb5 Author: Lukas Wunner Date: Thu Jul 19 17:27:43 2018 -0500 PCI: hotplug: Demidlayer registration with the core When a hotplug driver calls pci_hp_register(), all steps necessary for registration are carried out in one go, including creation of a kobject and addition to sysfs. That's a problem for pciehp once it's converted to enable/disable the slot exclusively from the IRQ thread: The thread needs to be spawned after creation of the kobject (because it uses the kobject's name), but before addition to sysfs (because it will handle enable/disable requests submitted via sysfs). pci_hp_deregister() does offer a ->release callback that's invoked after deletion from sysfs and before destruction of the kobject. But because pci_hp_register() doesn't offer a counterpart, hotplug drivers' ->probe and ->remove code becomes asymmetric, which is error prone as recently discovered use-after-free bugs in pciehp's ->remove hook have shown. In a sense, this appears to be a case of the midlayer antipattern: "The core thesis of the "midlayer mistake" is that midlayers are bad and should not exist. That common functionality which it is so tempting to put in a midlayer should instead be provided as library routines which can [be] used, augmented, or ignored by each bottom level driver independently. Thus every subsystem that supports multiple implementations (or drivers) should provide a very thin top layer which calls directly into the bottom layer drivers, and a rich library of support code that eases the implementation of those drivers. This library is available to, but not forced upon, those drivers." -- Neil Brown (2009), https://lwn.net/Articles/336262/ The presence of midlayer traits in the PCI hotplug core might be ascribed to its age: When it was introduced in February 2002, the blessings of a library approach might not have been well known: https://git.kernel.org/tglx/history/c/a8a2069f432c For comparison, the driver core does offer split functions for creating a kobject (device_initialize()) and addition to sysfs (device_add()) as an alternative to carrying out everything at once (device_register()). This was introduced in October 2002: https://git.kernel.org/tglx/history/c/8b290eb19962 The odd ->release callback in the PCI hotplug core was added in 2003: https://git.kernel.org/tglx/history/c/69f8d663b595 Clearly, a library approach would not force every hotplug driver to implement a ->release callback, but rather allow the driver to remove the sysfs files, release its data structures and finally destroy the kobject. Alternatively, a driver may choose to remove everything with pci_hp_deregister(), then release its data structures. To this end, offer drivers pci_hp_initialize() and pci_hp_add() as a split-up version of pci_hp_register(). Likewise, offer pci_hp_del() and pci_hp_destroy() as a split-up version of pci_hp_deregister(). Eliminate the ->release callback and move its code into each driver's teardown routine. Declare pci_hp_deregister() void, in keeping with the usual kernel pattern that enablement can fail, but disablement cannot. It only returned an error if the caller passed in a NULL pointer or a slot which has never or is no longer registered or is sharing its name with another slot. Those would be bugs, so WARN about them. Few hotplug drivers actually checked the return value and those that did only printed a useless error message to dmesg. Remove that. For most drivers the conversion was straightforward since it doesn't matter whether the code in the ->release callback is executed before or after destruction of the kobject. But in the case of ibmphp, it was unclear to me whether setting slot_cur->ctrl and slot_cur->bus_on to NULL needs to happen before the kobject is destroyed, so I erred on the side of caution and ensured that the order stays the same. Another nontrivial case is pnv_php, I've found the list and kref logic difficult to understand, however my impression was that it is safe to delete the list element and drop the references until after the kobject is destroyed. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Acked-by: Andy Shevchenko # drivers/platform/x86 Cc: Rafael J. Wysocki Cc: Len Brown Cc: Scott Murray Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Gavin Shan Cc: Sebastian Ott Cc: Gerald Schaefer Cc: Corentin Chary Cc: Darren Hart Cc: Andy Shevchenko commit 55a6b7a6576d6cba77bb2ce2bfb2126df83df58a Author: Lukas Wunner Date: Thu Jul 19 17:27:42 2018 -0500 PCI: pciehp: Drop slot workqueue Previously the slot workqueue was used to handle events and enable or disable the slot. That's no longer the case as those tasks are done synchronously in the IRQ thread. The slot workqueue is thus merely used to handle a button press after the 5 second delay and only one such work item may be in flight at any given time. A separate workqueue isn't necessary for this simple task, so use the system workqueue instead. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 0e94916e6091f48391b65110e71c87c583021640 Author: Lukas Wunner Date: Thu Jul 19 17:27:41 2018 -0500 PCI: pciehp: Handle events synchronously Up until now, pciehp's IRQ handler schedules a work item for each event, which in turn schedules a work item to enable or disable the slot. This double indirection was necessary because sleeping wasn't allowed in the IRQ handler. However it is now that pciehp has been converted to threaded IRQ handling and polling, so handle events synchronously in pciehp_ist() and remove the work item infrastructure (with the exception of work items to handle a button press after the 5 second delay). For link or presence change events, move the register read to determine the current link or presence state behind acquisition of the slot lock to prevent it from becoming stale while the lock is contended. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit b0ccd9dd5dc8bf348112bb97e4f7eef6be5cf469 Author: Lukas Wunner Date: Thu Jul 19 17:27:40 2018 -0500 PCI: pciehp: Stop blinking on slot enable failure If the attention button is pressed to power on the slot AND the user powers on the slot via sysfs before 5 seconds have elapsed AND powering on the slot fails because either the slot is unoccupied OR the latch is open, we neglect turning off the green LED so it keeps on blinking. That's because the error path of pciehp_sysfs_enable_slot() doesn't call pciehp_green_led_off(), unlike pciehp_power_thread() which does. The bug has been present since 2004 when the driver was introduced. Fix by deduplicating common code in pciehp_sysfs_enable_slot() and pciehp_power_thread() into a wrapper function pciehp_enable_slot() and renaming the existing function to __pciehp_enable_slot(). Same for pciehp_disable_slot(). This will also simplify the upcoming rework of pciehp's event handling. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit ec07a4473072ff0607e3126ce26c31dbf81f9a15 Author: Lukas Wunner Date: Thu Jul 19 17:27:39 2018 -0500 PCI: pciehp: Convert to threaded polling We've just converted pciehp to threaded IRQ handling, but still cannot sleep in pciehp_ist() because the function is also called in poll mode, which runs in softirq context (from a timer). Convert poll mode to a kthread so that pciehp_ist() always runs in task context. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Thomas Gleixner commit 7b4ce26bcf697e3a4aa9ba2a5b456562e0fb7af4 Author: Lukas Wunner Date: Thu Jul 19 17:27:38 2018 -0500 PCI: pciehp: Convert to threaded IRQ pciehp's IRQ handler queues up a work item for each event signaled by the hardware. A more modern alternative is to let a long running kthread service the events. The IRQ handler's sole job is then to check whether the IRQ originated from the device in question, acknowledge its receipt to the hardware to quiesce the interrupt and wake up the kthread. One benefit is reduced latency to handle the IRQ, which is a necessity for realtime environments. Another benefit is that we can make pciehp simpler and more robust by handling events synchronously in process context, rather than asynchronously by queueing up work items. pciehp's usage of work items is a historic artifact, it predates the introduction of threaded IRQ handlers by two years. (The former was introduced in 2007 with commit 5d386e1ac402 ("pciehp: Event handling rework"), the latter in 2009 with commit 3aa551c9b4c4 ("genirq: add threaded interrupt handler support").) Convert pciehp to threaded IRQ handling by retrieving the pending events in pciehp_isr(), saving them for later consumption by the thread handler pciehp_ist() and clearing them in the Slot Status register. By clearing the Slot Status (and thereby acknowledging the events) in pciehp_isr(), we can avoid requesting the IRQ with IRQF_ONESHOT, which would have the unpleasant side effect of starving devices sharing the IRQ until pciehp_ist() has finished. pciehp_isr() does not count how many times each event occurred, but merely records the fact *that* an event occurred. If the same event occurs a second time before pciehp_ist() is woken, that second event will not be recorded separately, which is problematic according to commit fad214b0aa72 ("PCI: pciehp: Process all hotplug events before looking for new ones") because we may miss removal of a card in-between two back-to-back insertions. We're about to make pciehp_ist() resilient to missed events. The present commit regresses the driver's behavior temporarily in order to separate the changes into reviewable chunks. This doesn't affect regular slow-motion hotplug, only plug-unplug-plug operations that happen in a timespan shorter than wakeup of the IRQ thread. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Thomas Gleixner Cc: Mayurkumar Patel Cc: Kenji Kaneshige commit 4aed1cd6fb957fa8de5a9416a9adab98775878e9 Author: Lukas Wunner Date: Thu Jul 19 17:27:36 2018 -0500 PCI: pciehp: Document struct slot and struct controller Document the driver's data structures to lower the barrier to entry for contributors. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 1d2e2673dc5b9b374513fd58d5909f0332b47407 Author: Lukas Wunner Date: Thu Jul 19 17:27:36 2018 -0500 PCI: pciehp: Declare pciehp_unconfigure_device() void Since commit 0f4bd8014db5 ("PCI: hotplug: Drop checking of PCI_BRIDGE_ CONTROL in *_unconfigure_device()"), pciehp_unconfigure_device() can no longer fail, so declare it and its sole caller remove_board() void, in keeping with the usual kernel pattern that enablement can fail, but disablement cannot. No functional change intended. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Mika Westerberg commit 6641311df92d171648faeede6ec9ec612d32d15b Author: Lukas Wunner Date: Thu Jul 19 17:27:35 2018 -0500 PCI: pciehp: Drop unnecessary NULL pointer check pciehp_disable_slot() checks if the ctrl attribute of the slot is NULL and bails out if so. However the function is not called prior to the attribute being set in pcie_init_slot(), and pcie_init_slot() is not called if ctrl is NULL. So the check is unnecessary. Drop it. It has been present ever since the driver was introduced in 2004, but it was already unnecessary back then: https://git.kernel.org/tglx/history/c/c16b4b14d980 Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas commit 1204e35bedf4e5015cda559ed8c84789a6dae24e Author: Lukas Wunner Date: Thu Jul 19 17:27:34 2018 -0500 PCI: pciehp: Fix unprotected list iteration in IRQ handler Commit b440bde74f04 ("PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device") iterates over the devices on a hotplug port's subordinate bus in pciehp's IRQ handler without acquiring pci_bus_sem. It is thus possible for a user to cause a crash by concurrently manipulating the device list, e.g. by disabling slot power via sysfs on a different CPU or by initiating a remove/rescan via sysfs. This can't be fixed by acquiring pci_bus_sem because it may sleep. The simplest fix is to avoid the list iteration altogether and just check the ignore_hotplug flag on the port itself. This works because pci_ignore_hotplug() sets the flag both on the device as well as on its parent bridge. We do lose the ability to print the name of the device blocking hotplug in the debug message, but that's probably bearable. Fixes: b440bde74f04 ("PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device") Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 281e878eab191cce4259abbbf1a0322e3adae02c Author: Lukas Wunner Date: Thu Jul 19 17:27:32 2018 -0500 PCI: pciehp: Fix use-after-free on unplug When pciehp is unbound (e.g. on unplug of a Thunderbolt device), the hotplug_slot struct is deregistered and thus freed before freeing the IRQ. The IRQ handler and the work items it schedules print the slot name referenced from the freed structure in various informational and debug log messages, each time resulting in a quadruple dereference of freed pointers (hotplug_slot -> pci_slot -> kobject -> name). At best the slot name is logged as "(null)", at worst kernel memory is exposed in logs or the driver crashes: pciehp 0000:10:00.0:pcie204: Slot((null)): Card not present An attacker may provoke the bug by unplugging multiple devices on a Thunderbolt daisy chain at once. Unplugging can also be simulated by powering down slots via sysfs. The bug is particularly easy to trigger in poll mode. It has been present since the driver's introduction in 2004: https://git.kernel.org/tglx/history/c/c16b4b14d980 Fix by rearranging teardown such that the IRQ is freed first. Run the work items queued by the IRQ handler to completion before freeing the hotplug_slot struct by draining the work queue from the ->release_slot callback which is invoked by pci_hp_deregister(). Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v2.6.4 commit 4ce6435820d1f1cc2c2788e232735eb244bcc8a3 Author: Lukas Wunner Date: Thu Jul 19 17:27:31 2018 -0500 PCI: hotplug: Don't leak pci_slot on registration failure If addition of sysfs files fails on registration of a hotplug slot, the struct pci_slot as well as the entry in the slot_list is leaked. The issue has been present since the hotplug core was introduced in 2002: https://git.kernel.org/tglx/history/c/a8a2069f432c Perhaps the idea was that even though sysfs addition fails, the slot should still be usable. But that's not how drivers use the interface, they abort probe if a non-zero value is returned. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v2.4.15+ Cc: Greg Kroah-Hartman commit b4efce5c4715ae9b82e5314d7324a412f06a6a5a Author: Lukas Wunner Date: Tue Jun 19 16:26:50 2018 +0200 PCI: hotplug: Delete skeleton driver Ten years ago, commit 58319b802a61 ("PCI: Hotplug core: remove 'name'") dropped the name element from struct hotplug_slot but neglected to update the skeleton driver. That same year, commit f46753c5e354 ("PCI: introduce pci_slot") raised the number of arguments to pci_hp_register() from one to four. Fourteen years ago, historic commit 7ab60fc1b8e7 ("PCI Hotplug skeleton: final cleanups") removed all usages of the retval variable from pcihp_skel_init() but not the variable itself, provoking a compiler warning: https://git.kernel.org/tglx/history/c/7ab60fc1b8e7 It seems fair to assume the driver hasn't been used as a template for a new driver in a while. Per Bjorn's and Christoph's preference, delete it. Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: Christoph Hellwig commit 3f44899ef2ce0c9da49feb0d6f08098a08cb96ae Author: Boris Pismenny Date: Sat Jun 30 22:14:27 2018 +0300 net/mlx5e: Use PARTIAL_GSO for UDP segmentation This patch removes the splitting of UDP_GSO_L4 packets in the driver, and exposes UDP_GSO_L4 as a PARTIAL_GSO feature. Thus, the network stack is not responsible for splitting the packet into two. Signed-off-by: Boris Pismenny Signed-off-by: Saeed Mahameed commit cc495188a8ff0d169ad7c0182acd9c08b90e29ea Author: Jianbo Liu Date: Wed Apr 25 09:57:26 2018 +0000 net/mlx5e: Support offloading double vlan push/pop tc actions As we can configure two push/pop actions in one flow table entry, add support to offload those double vlan actions in a rule to HW. Signed-off-by: Jianbo Liu Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 1482bd3d50d77d28961999ade98854b31b342156 Author: Jianbo Liu Date: Tue Jul 3 05:46:13 2018 +0000 net/mlx5e: Refactor tc vlan push/pop actions offloading Extract actions offloading code to a new function, and also extend data structures for double vlan actions. Signed-off-by: Jianbo Liu Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 699e96ddf47fe67e28522e511f6e1bce8a20b4e1 Author: Jianbo Liu Date: Tue May 1 08:48:03 2018 +0000 net/mlx5e: Support offloading tc double vlan headers match We can match on both outer and inner vlan tags, add support for offloading that. Signed-off-by: Jianbo Liu Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit c7f7ba8df872018054967d052f3368e13de72b73 Author: Roi Dayan Date: Mon Dec 4 16:46:30 2017 +0200 net/mlx5e: Remove redundant WARN when we cannot find neigh entry It is possible for neigh entry not to exist if it was cleaned already. When we bring down an interface the neigh gets deleted but it could be that our listener for neigh event to clear the encap valid bit didn't start yet and the neigh update last used work is started first. In this scenario the encap entry has valid bit set but the neigh entry doesn't exist. Signed-off-by: Roi Dayan Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed commit 3101d1fc6b8678f45f703293441715a9b5b86cad Author: Saeed Mahameed Date: Thu May 3 16:44:46 2018 -0700 net/mlx5: FW tracer, Add debug prints Signed-off-by: Saeed Mahameed commit 244069532fa25183c37305e002d6e26396dadeb0 Author: Feras Daoud Date: Thu Feb 22 10:01:35 2018 +0200 net/mlx5: FW tracer, Enable tracing Add the tracer file to the makefile and add the init function to the load one flow. Signed-off-by: Feras Daoud Signed-off-by: Saeed Mahameed commit 70dd6fdb8987b14f7b6105f6be0617299e459398 Author: Feras Daoud Date: Sun Feb 18 10:06:35 2018 +0200 net/mlx5: FW tracer, parse traces and kernel tracing support For each message the driver should do the following: 1- Find the message string in the strings database 2- Count the param number of each message 3- Wait for the param events and accumulate them 4- Calculate the event timestamp using the local event timestamp and the first timestamp event following it. 5- Print message to trace log Enable the tracing by: echo 1 > /sys/kernel/debug/tracing/events/mlx5/mlx5_fw/enable Read traces by: cat /sys/kernel/debug/tracing/trace Signed-off-by: Feras Daoud Signed-off-by: Erez Shitrit Signed-off-by: Saeed Mahameed commit c71ad41ccb0c29fce95149b74786574b354c9dda Author: Feras Daoud Date: Wed Feb 7 11:08:56 2018 +0200 net/mlx5: FW tracer, events handling The tracer has one event, event 0x26, with two subtypes: - Subtype 0: Ownership change - Subtype 1: Traces available An ownership change occurs in the following cases: 1- Owner releases his ownership, in this case, an event will be sent to inform others to reattempt acquire ownership. 2- Ownership was taken by a higher priority tool, in this case the owner should understand that it lost ownership, and go through tear down flow. The second subtype indicates that there are traces in the trace buffer, in this case, the driver polls the tracer buffer for new traces, parse them and prepares the messages for printing. The HW starts tracing from the first address in the tracer buffer. Driver receives an event notifying that new trace block exists. HW posts a timestamp event at the last 8B of every 256B block. Comparing the timestamp to the last handled timestamp would indicate that this is a new trace block. Once the new timestamp is detected, the entire block is considered valid. Block validation and parsing, should be done after copying the current block to a different location, in order to avoid block overwritten during processing. Signed-off-by: Feras Daoud Signed-off-by: Saeed Mahameed commit e9cad2cea7f0b2bea253e2681a0a3f5d3940af3c Author: Saeed Mahameed Date: Tue May 1 16:04:45 2018 -0700 net/mlx5: FW tracer, register log buffer memory key Create a memory key and protection domain for the tracer log buffer. Signed-off-by: Saeed Mahameed commit 48967ffdeb210266423be11f395c5dc26d3e4eda Author: Feras Daoud Date: Tue Feb 6 17:45:57 2018 +0200 net/mlx5: FW tracer, create trace buffer and copy strings database For each PF do the following: 1- Allocate memory for the tracer strings database and read the strings from the FW to the SW. These strings will be used later for parsing traces. 2- Allocate and dma map tracer buffers. Traces that will be written into the buffer will be parsed as a group of one or more traces, referred to as trace message. The trace message represents a C-like printf string. First trace of a message holds the pointer to the correct string in strings database. The following traces holds the variables of the message. Signed-off-by: Feras Daoud Signed-off-by: Saeed Mahameed commit f53aaa31cce7b543e407da7e97690a700206f7b9 Author: Feras Daoud Date: Mon Jul 16 15:22:01 2018 -0700 net/mlx5: FW tracer, implement tracer logic Implement FW tracer logic and registers access, initialization and cleanup flows. Initializing the tracer will be part of load one flow, as multiple PFs will try to acquire ownership but only one will succeed and will be the tracer owner. Signed-off-by: Feras Daoud Signed-off-by: Saeed Mahameed commit 7854ac44fe86548f8a6c6001938a1a2593b255e4 Merge: c9eaaa177398 048f31437ac5 Author: Saeed Mahameed Date: Mon Jul 23 14:58:46 2018 -0700 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux mlx5 core infrastructure updates and fixes. From Eran: - Add MPEGC (Management PCIe General Configuration) registers and btis - Fix tristate and description for MLX5 module rom Feras: - Add hardware structures for the firmware tracer From Jainbo: - Core support for double vlan push/pop steering action From Max: - Add XRQ commands definitions From Noa: - Add missing SET_DRIVER_VERSION command translation From Roi: - Use ERR_CAST() instead of coding it From Tariq: - Better return types for CQE API Signed-off-by: Saeed Mahameed commit 4fca037783512cedfb23a116c66727ce40c8558a Author: Jason Gunthorpe Date: Wed Jul 11 16:20:44 2018 -0600 IB/uverbs: Move ib_access_flags and ib_read_counters_flags to uapi These constants are used in the ioctl interface so they are part of the uapi, place them in the correct header for clarity. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky commit 2bd2e98a783adfb7ddc5400657499216490d1b12 Author: Bart Van Assche Date: Wed Jul 18 09:14:36 2018 -0700 MAINTAINERS: Remove Dave Goodell from the usnic RDMA driver maintainer list The e-mail address dgoodell@exch.cisco.com no longer exists. Additionally, according to https://www.linkedin.com/in/goodell/ Dave is an Amazon employee since December 2017. Hence remove his Cisco e-mail address from the usnic maintainer list. Signed-off-by: Bart Van Assche Acked-by: Christian Benvenuti Signed-off-by: Jason Gunthorpe commit acd4307a21b5a9a7761aa55a5f5ca46cbd43f108 Author: Bart Van Assche Date: Wed Jul 18 08:58:02 2018 -0700 RDMA/bnxt_re: Modify a fall-through annotation This patch avoids that gcc reports the following warning when building with W=1: drivers/infiniband/hw/bnxt_re/ib_verbs.c:2404:4: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit aa09ea6e6b1279a2031cbdaa7605e2ec297e63ae Author: Kamal Heib Date: Thu Jul 19 00:05:32 2018 +0300 RDMA/mlx5: Remove set but not used variables Remove "uctx" and "pa" variables that were set but not used. Fixes: a8b92ca1b0e5 ("IB/mlx5: Introduce DEVX") Fixes: 8f0622873358 ("RDMA/mlx5: Remove debug prints of VMA pointers") Signed-off-by: Kamal Heib Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c9eaaa1773982e30fcb6e9f2e2db878490c0f730 Merge: 8760c4d6d5f7 43e8fe9b844b Author: David S. Miller Date: Mon Jul 23 14:09:19 2018 -0700 Merge branch 'lan743x-Add-features-to-lan743x-driver' Bryan Whitehead says: ==================== lan743x: Add features to lan743x driver This patch series adds extra features to the lan743x driver. Updates for v4: Patch 6/8 - Modified get/set_wol to use super set of MAC and PHY driver support. Patch 7/9 - In set_eee, return the return value from phy_ethtool_set_eee. Updates for v3: Removed patch 9 from this series, regarding PTP support Patch 6/8 - Add call to phy_ethtool_get_wol to lan743x_ethtool_get_wol Patch 7/8 - Add call to phy_ethtool_set_eee on (!eee->eee_enabled) Updates for v2: Patch 3/9 - Used ARRAY_SIZE macro in lan743x_ethtool_get_ethtool_stats. Patch 5/9 - Used MAX_EEPROM_SIZE in lan743x_ethtool_set_eeprom. Patch 6/9 - Removed unnecessary read of PMT_CTL. Used CRC algorithm from lib. Removed PHY interrupt settings from lan743x_pm_suspend Change "#if CONFIG_PM" to "#ifdef CONFIG_PM" ==================== Signed-off-by: David S. Miller commit 43e8fe9b844bcecbf2916a599dd744c1018c08cb Author: Bryan Whitehead Date: Mon Jul 23 16:16:33 2018 -0400 lan743x: Add RSS support Implement RSS support Signed-off-by: Bryan Whitehead Signed-off-by: David S. Miller commit c9cf96bb5ff8004219c0df0426fe4d70f0cf3842 Author: Bryan Whitehead Date: Mon Jul 23 16:16:32 2018 -0400 lan743x: Add EEE support Implement EEE support Signed-off-by: Bryan Whitehead Signed-off-by: David S. Miller commit 4d94282afd957a31bce51778cc31fc3b32099e79 Author: Bryan Whitehead Date: Mon Jul 23 16:16:31 2018 -0400 lan743x: Add power management support Implement power management Supports suspend, resume, and Wake on LAN Signed-off-by: Bryan Whitehead Signed-off-by: David S. Miller commit 695846047aa9b4bb387473a9fd227a51ae7de5e9 Author: Bryan Whitehead Date: Mon Jul 23 16:16:30 2018 -0400 lan743x: Add support for ethtool eeprom access Implement ethtool eeprom access Also provides access to OTP (One Time Programming) Signed-off-by: Bryan Whitehead Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2958337d686cdcc0940a3ab38cea2b3aaebea9da Author: Bryan Whitehead Date: Mon Jul 23 16:16:29 2018 -0400 lan743x: Add support for ethtool message level Implement ethtool message level Signed-off-by: Bryan Whitehead Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8114e8a2f1dbad34804e0de6ab15728cf3566578 Author: Bryan Whitehead Date: Mon Jul 23 16:16:28 2018 -0400 lan743x: Add support for ethtool statistics Implement ethtool statistics Signed-off-by: Bryan Whitehead Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 63b92a91a49f23728721e95a363d8dbaf526e4ed Author: Bryan Whitehead Date: Mon Jul 23 16:16:27 2018 -0400 lan743x: Add support for ethtool link settings Use default link setting functions Signed-off-by: Bryan Whitehead Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 0cf632265d6753e9bcdf2bc196999ea40c02f2dd Author: Bryan Whitehead Date: Mon Jul 23 16:16:26 2018 -0400 lan743x: Add support for ethtool get_drvinfo Implement ethtool get_drvinfo Signed-off-by: Bryan Whitehead Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 259e19145e1fa9bb9e502f625f7bce1a0c078fa0 Author: Jan Dakinevich Date: Mon Jul 9 16:51:03 2018 +0300 IPoIB: use kvzalloc to allocate an array of bucket pointers This table by default takes 32KiB which is 3rd memory order. Meanwhile, this memory is not aimed for DMA operation and could be safely allocated by vmalloc. Signed-off-by: Jan Dakinevich Reviewed-by: Håkon Bugge Signed-off-by: Jason Gunthorpe commit d66a8acbda926fa2398ae930f50787e8663bce96 Author: Piotr Sawicki Date: Thu Jul 19 11:47:31 2018 +0200 Smack: Inform peer that IPv6 traffic has been blocked In this patch we're sending an ICMPv6 message to a peer to immediately inform it that making a connection is not possible. In case of TCP connections, without this change, the peer will be waiting until a connection timeout is exceeded. Signed-off-by: Piotr Sawicki Signed-off-by: Casey Schaufler commit a07ef9516477aef2d052d75129a48f9f94d3b3f3 Author: Piotr Sawicki Date: Thu Jul 19 11:45:16 2018 +0200 Smack: Check UDP-Lite and DCCP protocols during IPv6 handling The smack_socket_sock_rcv_skb() function is checking smack labels only for UDP and TCP frames carried in IPv6 packets. From now on, it is able also to handle UDP-Lite and DCCP protocols. Signed-off-by: Piotr Sawicki Signed-off-by: Casey Schaufler commit 129a99890936766f4b69b9da7ed88366313a9210 Author: Piotr Sawicki Date: Thu Jul 19 11:42:58 2018 +0200 Smack: Fix handling of IPv4 traffic received by PF_INET6 sockets A socket which has sk_family set to PF_INET6 is able to receive not only IPv6 but also IPv4 traffic (IPv4-mapped IPv6 addresses). Prior to this patch, the smk_skb_to_addr_ipv6() could have been called for socket buffers containing IPv4 packets, in result such traffic was allowed. Signed-off-by: Piotr Sawicki Signed-off-by: Casey Schaufler commit 8760c4d6d5f7e5920edc34ee0785aeeda766842b Merge: fd800f646402 51459d4c76e5 Author: David S. Miller Date: Mon Jul 23 12:34:51 2018 -0700 Merge branch 'sh_eth-clean-up-the-TSU-register-accessors' Sergei Shtylyov says: ==================== sh_eth: clean up the TSU register accessors Here's a set of 5 patches against DaveM's 'net-next.git' repo. They do a final clean up of the TSU register accessors... ==================== Signed-off-by: David S. Miller commit 51459d4c76e551d006a7e22ce54ba4039480cd19 Author: Sergei Shtylyov Date: Mon Jul 23 21:15:47 2018 +0300 sh_eth: make sh_eth_tsu_{read|write}_entry() prototypes symmetric sh_eth_tsu_read_entry() is still asymmetric with sh_eth_tsu_write_entry() WRT their prototypes -- make them symmetric by passing to the former a TSU register offset instead of its address and also adding the (now necessary) 'ndev' parameter... Signed-off-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 7a54c867bad601406d71f375362048d8ccfb5fae Author: Sergei Shtylyov Date: Mon Jul 23 21:14:38 2018 +0300 sh_eth: make sh_eth_tsu_write_entry() take 'offset' parameter We can add the TSU register base address to a TSU register offset right in sh_eth_tsu_write_entry(), no need to do it in its callers... Signed-off-by: Sergei Shtylyov Signed-off-by: David S. Miller commit ecbecb0a90fbc318163dd1747bd325e08aee4b12 Author: Sergei Shtylyov Date: Mon Jul 23 21:12:38 2018 +0300 sh_eth: call sh_eth_tsu_get_offset() from TSU register accessors With sh_eth_tsu_get_offset() now actually returning TSU register's offset, we can at last use it in sh_eth_tsu_{read|write}(). Somehow this saves 248 bytes of object code with AArch64 gcc 4.8.5... :-) Signed-off-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 41414f0a8568d1f395d823bc65e68ee0805d794f Author: Sergei Shtylyov Date: Mon Jul 23 21:11:19 2018 +0300 sh_eth: make sh_eth_tsu_get_offset() match its name sh_eth_tsu_get_offset(), despite its name, returns a TSU register's address, not its offset. Make this function match its name and return a register's offset from the TSU registers base address instead. Signed-off-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 388c4bb4dc1fc861dff425d37b0d6438f0e694bb Author: Sergei Shtylyov Date: Mon Jul 23 21:10:02 2018 +0300 sh_eth: uninline sh_eth_tsu_get_offset() sh_eth_tsu_get_offset() is called several times by the driver, remove *inline* and move that function from the header to the driver itself to let gcc decide whether to expand it inline or not... Signed-off-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 2f562a4739602d96928de0b040ce46b00d8d3adc Author: Liang Chen Date: Mon Jul 23 17:25:21 2018 +0800 ASoC: rockchip-i2s: add description for px30 Add "rockchip,px30-i2s", "rockchip,rk3066-i2s" for i2s on px30 platform. Acked-by: Rob Herring Signed-off-by: Liang Chen Signed-off-by: Mark Brown commit 9d2fd4f0ddfbc4aa1135000df34caebc02793a26 Author: Marco Felsch Date: Mon Jul 23 09:47:47 2018 +0200 regulator: pfuze100: add support to en-/disable switch regulators Add enable/disable support for switch regulators on pfuze100. Based on commit 5fe156f1cab4 ("regulator: pfuze100: add enable/disable for switch") which is reverted due to boot regressions by commit 464a5686e6c9 ("regulator: Revert "regulator: pfuze100: add enable/disable for switch""). Disabling the switch regulators will only be done if the user specifies "fsl,pfuze-support-disable-sw" in its device tree to keep backward compatibility with current dtb's [1]. [1] https://patchwork.kernel.org/patch/10490381/ Signed-off-by: Marco Felsch Signed-off-by: Mark Brown commit 78170811a2048de8e77a27a053be8b3eb3d4e556 Author: Marco Felsch Date: Mon Jul 23 09:47:46 2018 +0200 regulator: pfuze100: add optional disable switch-regulators binding This binding is used to keep the backward compatibility with the current dtb's [1]. The binding informs the driver that the unused switch regulators can be disabled. If it is not specified, the driver doesn't disable the switch regulators. [1] https://patchwork.kernel.org/patch/10490381/ Signed-off-by: Marco Felsch Signed-off-by: Mark Brown commit 12005ec33f3a7eac0d508dde52cc9eeea2595ee9 Author: Maxime Roussin-Bélanger Date: Sun Jul 22 23:33:29 2018 -0400 hwmon: (iio_hwmon) Use devm functions Use devm_iio_channel_get_all() to automatically release channels. Use devm_hwmon_device_register_with_groups() to automatically unregister the device. Signed-off-by: Maxime Roussin-Bélanger [groeck: Dropped now unnecessary platform_set_drvdata() and hwmon_dev] Signed-off-by: Guenter Roeck commit f62800992e5917f2bed143dbcdce2501bc6933a9 Author: Mike Rapoport Date: Mon Jul 23 08:56:58 2018 +0300 ia64: switch to NO_BOOTMEM Since ia64 already uses memblock to register available physical memory it is only required to move the calls to register_active_ranges() that wrap memblock_add_node() earlier and replace bootmem memory reservations with memblock_reserve(). Of course, all the code that find the place to put the bootmem bitmap is removed. Signed-off-by: Mike Rapoport Signed-off-by: Tony Luck commit ffc0d638c838ff670fee2eb43d3884d05cb86faa Author: Martin Blumenstingl Date: Sat Jul 21 21:40:49 2018 +0200 iio: adc: meson-saradc: add support for the Meson8m2 SoCs The SAR ADC on Meson8m2 behaves identical to the one found in the Meson8b SoCs. Add a separate compatible string because the temperature sensor logic (not supported yet) differs between Meson8 and Meson8m2 (however, it's the same for Meson8b and Meson8m2). Signed-off-by: Martin Blumenstingl Signed-off-by: Jonathan Cameron commit 439ba65b8b4f3788d55a90356fe25dc214721106 Author: Martin Blumenstingl Date: Sat Jul 21 21:40:48 2018 +0200 dt-bindings: iio: adc: add Meson8m2 support The Amlogic Meson SAR ADC implementation on the Meson8m2 SoC is identical to the Meson8b variant. Add a compatible string to indicate that we support the SAR ADC on the Meson8m2 SoC. Signed-off-by: Martin Blumenstingl Signed-off-by: Jonathan Cameron commit 8134b613b05dd27fc718fbe3785ccc9c5da10e02 Author: David Lechner Date: Sat Jul 21 14:37:34 2018 -0500 iio: adc: ti-ads7950: allow simultaneous use of buffer and direct mode This modifies the TI ADS7950 A/DC driver to allow the simultaneous use of both the triggered buffer and reading channels directly (via in- kernel API or sysfs). The use case for this is on LEGO MINDSTORMS EV3. Two of the voltage channels are used in-kernel by a power supply driver, which reads the values using iio_read_channel_processed(). These channels are only read at a slow rate (<= 1Hz). However, we want to be able to read 12 other channels at the same time using the triggered buffer at a high rate (>= 100Hz). Signed-off-by: David Lechner Signed-off-by: Jonathan Cameron commit 7d7209f0c467ba8b86229dbd4e1aa2f3d9b0c5bb Author: David Lechner Date: Sat Jul 21 14:37:33 2018 -0500 iio: adc: ti-ads7950: use SPDX-License-Identifier This updates the ti-ads7950.c file to use SPDX-License-Identifier instead of more verbose license text. Signed-off-by: David Lechner Signed-off-by: Jonathan Cameron commit a176ba37e6282207be3f012fb58b77c6f51d55d9 Author: Dan Carpenter Date: Mon Jul 9 14:06:59 2018 +0300 iio: adc: at91-sama5d2_adc: fix up casting in at91_adc_read_info_raw() This code is problematic because we're supposed to be writing an int but we instead write to only the high 16 bits. This doesn't work on big endian systems, and there is a potential that the bottom 16 bits are used without being initialized. Fixes: 23ec2774f1cc ("iio: adc: at91-sama5d2_adc: add support for position and pressure channels") Signed-off-by: Dan Carpenter Tested-by: Eugen Hristev Acked-by: Ludovic Desroches Signed-off-by: Jonathan Cameron commit 69f894c3f3185d3826ea6573afb282386b797acf Author: Lars-Peter Clausen Date: Thu Jul 5 15:34:22 2018 +0300 iio: ad9523: replace core mlock with local lock This is also part of a long term effort to make the use of mlock opaque and single purpose. This lock is required for accessing device registers. The device may be accessed by multiple processes at the same time, and this can result in inconsistent data, where one device reads data before the other one has finished writing. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron commit c344a327baefc372b7f4b7d0c17ac8b417ceaf94 Author: Manish Narani Date: Wed Jul 18 16:42:09 2018 +0530 iio: adc: xilinx: Remove dead code from xadc_zynq_setup This patch removes dead code from xadc_zynq_setup. The condition "if (tck_rate > XADC_ZYNQ_TCK_RATE_MAX)" cannot be true at any point of time. There is also an incompatible parameter used in the code. This patch fixes the same reported by coverity. Signed-off-by: Manish Narani Signed-off-by: Jonathan Cameron commit 39e27533cdb4affdec79a89308ab9133a6e0e5c7 Author: Fabrice Gasnier Date: Thu Jul 19 16:51:50 2018 +0200 dt-bindings: iio: sigma-delta-modulator: fix unit-address in example Device tree compiler gives a warning if a device node has "@" but no reg property. Fix the example in iio: adc: sigma-delta-modulator. Signed-off-by: Fabrice Gasnier Signed-off-by: Jonathan Cameron commit e01e7eaf37d865c72e2501a7b09e7a61317ce2d4 Author: Maxime Roussin-Bélanger Date: Thu Jul 19 16:26:25 2018 -0400 iio: light: introduce si1133 e-mail received from Silicon Lab to confirm that the licensing isn't a problem. " Dear Maxime Roussin-Belanger, The LUX calculation code only works with Si1133. As long as the software is used with Silicon Lab's sensor product, I don't see any problem. Regards, Tony " Signed-off-by: Maxime Roussin-Bélanger Reviewed-by: Jean-Francois Dagenais Signed-off-by: Jonathan Cameron commit c0e4e0fd952b73bf6aae67e92b9a496a52837eb9 Author: Maxime Roussin-Bélanger Date: Thu Jul 19 16:26:24 2018 -0400 iio: Add modifier for DUV light Signed-off-by: Maxime Roussin-Bélanger Signed-off-by: Jonathan Cameron commit 1c28799257bca28cd5ba715e33157500d6239333 Author: Mathieu Othacehe Date: Fri Jul 20 19:34:26 2018 +0200 iio: light: isl29501: Add support for the ISL29501 ToF sensor. This patch adds support for the ISL29501 Time of Flight sensor. Signed-off-by: Mathieu Othacehe Signed-off-by: Jonathan Cameron commit 3b770017b03a4cdfde0b61a49b4801dc8cca9f69 Author: Wolfram Sang Date: Thu Jun 28 22:45:38 2018 +0200 i2c: rcar: handle RXDMA HW behaviour on Gen3 On Gen3, we can only do RXDMA once per transfer reliably. For that, we must reset the device, then we can have RXDMA once. This patch implements this. When there is no reset controller or the reset fails, RXDMA will be blocked completely. Otherwise, it will be disabled after the first RXDMA transfer. Based on a commit from the BSP by Hiromitsu Yamasaki, yet completely refactored to handle multiple read messages within one transfer. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit fd800f646402c0f85547166b59ca065175928b7b Author: YueHaibing Date: Mon Jul 23 22:12:33 2018 +0800 wan/fsl_ucc_hdlc: use IS_ERR_VALUE() to check return value of qe_muram_alloc qe_muram_alloc return a unsigned long integer,which should not compared with zero. check it using IS_ERR_VALUE() to fix this. Fixes: c19b6d246a35 ("drivers/net: support hdlc function for QE-UCC") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 2b5c49131fc4e709910c07444f0befd21ad28bcf Author: Hauke Mehrtens Date: Sun Jul 22 01:30:57 2018 +0200 MIPS: lantiq: Use dma_zalloc_coherent() in dma code Instead of using dma_alloc_coherent() and memset() directly use dma_zalloc_coherent(). Signed-off-by: Hauke Mehrtens Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19962/ Cc: ralf@linux-mips.org Cc: jhogan@kernel.org Cc: john@phrozen.org Cc: linux-mips@linux-mips.org Cc: dev@kresin.me commit 6a525818b135d72f3706b5114174e5215c217054 Merge: 9a2ad3623868 48bf5231771c Author: David S. Miller Date: Mon Jul 23 10:57:14 2018 -0700 Merge branch 'smc-next' Ursula Braun says: ==================== net/smc: patches 2018-07-23 here are some small patches for SMC: Just the first patch contains a functional change. It allows to differ between the modes SMCR and SMCD on s390 when monitoring SMC sockets. The remaining patches are cleanups without functional changes. ==================== Signed-off-by: David S. Miller commit 48bf5231771c7e3961c8326353b6027b1bed6eb5 Author: Ursula Braun Date: Mon Jul 23 13:53:12 2018 +0200 net/smc: remove local variable page in smc_rx_splice() The page map address is already stored in the RMB descriptor. There is no need to derive it from the cpu_addr value. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 144ce4b9b5a788953b5373162a1921267497fb38 Author: Ursula Braun Date: Mon Jul 23 13:53:11 2018 +0200 net/smc: use DECLARE_BITMAP for rtokens_used_mask Link group field tokens_used_mask is a bitmap. Use macro DECLARE_BITMAP for its definition. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 00e5fb263f9f5f2af60754b79b7dcec0d5e88154 Author: Stefan Raspl Date: Mon Jul 23 13:53:10 2018 +0200 net/smc: add function to get link group from link Replace a frequently used construct with a more readable variant, reducing the code. Also might come handy when we start to support more than a single per link group. Signed-off-by: Stefan Raspl Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit bac6de7b637018f4caacfdf2b4ad8c8749de7420 Author: Stefan Raspl Date: Mon Jul 23 13:53:09 2018 +0200 net/smc: eliminate cursor read and write calls The functions to read and write cursors are exclusively used to copy cursors. Therefore switch to a respective function instead. Signed-off-by: Stefan Raspl Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit c601171d7a60b5b09d7c2fe0579953323a80744e Author: Karsten Graul Date: Mon Jul 23 13:53:08 2018 +0200 net/smc: provide smc mode in smc_diag.c Rename field diag_fallback into diag_mode and set the smc mode of a connection explicitly. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 6100e34b2526e1dc3dbcc47fea2677974d6aaea5 Author: Dan Williams Date: Fri Jul 13 21:50:21 2018 -0700 mm, memory_failure: Teach memory_failure() about dev_pagemap pages mce: Uncorrected hardware memory error in user-access at af34214200 {1}[Hardware Error]: It has been corrected by h/w and requires no further action mce: [Hardware Error]: Machine check events logged {1}[Hardware Error]: event severity: corrected Memory failure: 0xaf34214: reserved kernel page still referenced by 1 users [..] Memory failure: 0xaf34214: recovery action for reserved kernel page: Failed mce: Memory error not recovered In contrast to typical memory, dev_pagemap pages may be dax mapped. With dax there is no possibility to map in another page dynamically since dax establishes 1:1 physical address to file offset associations. Also dev_pagemap pages associated with NVDIMM / persistent memory devices can internal remap/repair addresses with poison. While memory_failure() assumes that it can discard typical poisoned pages and keep them unmapped indefinitely, dev_pagemap pages may be returned to service after the error is cleared. Teach memory_failure() to detect and handle MEMORY_DEVICE_HOST dev_pagemap pages that have poison consumed by userspace. Mark the memory as UC instead of unmapping it completely to allow ongoing access via the device driver (nd_pmem). Later, nd_pmem will grow support for marking the page back to WB when the error is cleared. Cc: Jan Kara Cc: Christoph Hellwig Cc: Jérôme Glisse Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: Ross Zwisler Signed-off-by: Dan Williams Signed-off-by: Dave Jiang commit c2a7d2a115525d3501d38e23d24875a79a07e15e Author: Dan Williams Date: Fri Jul 13 21:50:16 2018 -0700 filesystem-dax: Introduce dax_lock_mapping_entry() In preparation for implementing support for memory poison (media error) handling via dax mappings, implement a lock_page() equivalent. Poison error handling requires rmap and needs guarantees that the page->mapping association is maintained / valid (inode not freed) for the duration of the lookup. In the device-dax case it is sufficient to simply hold a dev_pagemap reference. In the filesystem-dax case we need to use the entry lock. Export the entry lock via dax_lock_mapping_entry() that uses rcu_read_lock() to protect against the inode being freed, and revalidates the page->mapping association under xa_lock(). Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Ross Zwisler Cc: Jan Kara Signed-off-by: Dan Williams Signed-off-by: Dave Jiang commit ae1139ece126b8eb6d0770094fbac43ea928d9d9 Author: Dan Williams Date: Fri Jul 13 21:50:11 2018 -0700 mm, memory_failure: Collect mapping size in collect_procs() In preparation for supporting memory_failure() for dax mappings, teach collect_procs() to also determine the mapping size. Unlike typical mappings the dax mapping size is determined by walking page-table entries rather than using the compound-page accounting for THP pages. Acked-by: Naoya Horiguchi Signed-off-by: Dan Williams Signed-off-by: Dave Jiang commit 23e7b5c2e2715947cf1ff57124dd3e96caf48521 Author: Dan Williams Date: Fri Jul 13 21:50:06 2018 -0700 mm, madvise_inject_error: Let memory_failure() optionally take a page reference The madvise_inject_error() routine uses get_user_pages() to lookup the pfn and other information for injected error, but it does not release that pin. The assumption is that failed pages should be taken out of circulation. However, for dax mappings it is not possible to take pages out of circulation since they are 1:1 physically mapped as filesystem blocks, or device-dax capacity. They also typically represent persistent memory which has an error clearing capability. In preparation for adding a special handler for dax mappings, shift the responsibility of taking the page reference to memory_failure(). I.e. drop the page reference and do not specify MF_COUNT_INCREASED to memory_failure(). Cc: Michal Hocko Cc: Naoya Horiguchi Signed-off-by: Dan Williams Acked-by: Naoya Horiguchi Signed-off-by: Dave Jiang commit 2fa147bdbf672c53386a8f5f2c7fe358004c3ef8 Author: Dan Williams Date: Fri Jul 13 21:50:01 2018 -0700 mm, dev_pagemap: Do not clear ->mapping on final put MEMORY_DEVICE_FS_DAX relies on typical page semantics whereby ->mapping is only ever cleared by truncation, not final put. Without this fix dax pages may forget their mapping association at the end of every page pin event. Move this atypical behavior that HMM wants into the HMM ->page_free() callback. Cc: Cc: Jan Kara Cc: Jérôme Glisse Cc: Andrew Morton Cc: Ross Zwisler Fixes: d2c997c0f145 ("fs, dax: use page->mapping...") Signed-off-by: Dan Williams Acked-by: Jérôme Glisse Signed-off-by: Dave Jiang commit 06cb081a92e4b66c1ad3bf8d7b5830378e857eda Author: Ross Zwisler Date: Thu Jul 19 12:47:22 2018 -0600 MAINTAINERS: Add Jan Kara for filesystem DAX Jan has been developing and reviewing filesystem DAX related changes for quite a while now, and has agreed to help maintain this code going forward. Thanks, Jan! Signed-off-by: Ross Zwisler Cc: Jan Kara Signed-off-by: Dave Jiang commit 61e9ea32a7180bb6f5da8f08eb5c0220bf49ac62 Author: Ross Zwisler Date: Thu Jul 19 12:47:21 2018 -0600 MAINTAINERS: update Ross Zwisler's email address Redirect email to my @kernel.org account. Signed-off-by: Ross Zwisler Signed-off-by: Dave Jiang commit fb63fbee423afc6fa6f982d31c6894bb2da8f7ef Author: Mike Rapoport Date: Mon Jul 23 08:56:57 2018 +0300 ia64: use mem_data to detect nodes' minimal and maximal PFNs When EFI memory map is traversed to determine the extents of each node, the minimal and maximal PFNs are stored in the bootmem_data structures. The same information ls later stored in the mem_data array of 'struct early_node_data'. Switch to using mem_data from the very beginning. Signed-off-by: Mike Rapoport Signed-off-by: Tony Luck commit 0617c50a081262f8d515a62f062c0c5bc9c10630 Author: Mike Rapoport Date: Mon Jul 23 08:56:56 2018 +0300 ia64: remove unused num_dma_physpages member from 'struct early_node_data' Since commit 05e0caad3b7b ("[PATCH] Have ia64 use add_active_range() and free_area_init_nodes") the num_dma_physpages member of 'struct early_node_data' is calculated but never used. Remove it. Signed-off-by: Mike Rapoport Signed-off-by: Tony Luck commit 1ecd64abb5e462cfbb675d71a6d33fa1463945ea Author: Mike Rapoport Date: Mon Jul 23 08:56:55 2018 +0300 ia64: contig/paging_init: reduce code duplication The FLATMEM version of paging_init has calls to free_area_init_nodes() in the end of every branch of 'if' and 'ifdef' statements. Let's call this function outside the 'ifdef' and 'if' statements instead. Signed-off-by: Mike Rapoport Signed-off-by: Tony Luck commit a30718868915fbb991a9ae9e45594b059f28e9ae Author: Huacai Chen Date: Fri Jul 13 15:37:57 2018 +0800 MIPS: Change definition of cpu_relax() for Loongson-3 Linux expects that if a CPU modifies a memory location, then that modification will eventually become visible to other CPUs in the system. Loongson 3 CPUs include a Store Fill Buffer (SFB) which sits between a core & its L1 data cache, queueing memory accesses & allowing for faster forwarding of data from pending stores to younger loads from the core. Unfortunately the SFB prioritizes loads such that a continuous stream of loads may cause a pending write to be buffered indefinitely. This is problematic if we end up with 2 CPUs which each perform a store that the other polls for - one or both CPUs may end up with their stores buffered in the SFB, never reaching cache due to the continuous reads from the poll loop. Such a deadlock condition has been observed whilst running qspinlock code. This patch changes the definition of cpu_relax() to smp_mb() for Loongson-3, forcing a flush of the SFB on SMP systems which will cause any pending writes to make it as far as the L1 caches where they will become visible to other CPUs. If the kernel is not compiled for SMP support, this will expand to a barrier() as before. This workaround matches that currently implemented for ARM when CONFIG_ARM_ERRATA_754327=y, which was introduced by commit 534be1d5a2da ("ARM: 6194/1: change definition of cpu_relax() for ARM11MPCore"). Although the workaround is only required when the Loongson 3 SFB functionality is enabled, and we only began explicitly enabling that functionality in v4.7 with commit 1e820da3c9af ("MIPS: Loongson-3: Introduce CONFIG_LOONGSON3_ENHANCEMENT"), existing or future firmware may enable the SFB which means we may need the workaround backported to earlier kernels too. [paul.burton@mips.com: - Reword commit message & comment. - Limit stable backport to v3.15+ where we support Loongson 3 CPUs.] Signed-off-by: Huacai Chen Signed-off-by: Paul Burton References: 534be1d5a2da ("ARM: 6194/1: change definition of cpu_relax() for ARM11MPCore") References: 1e820da3c9af ("MIPS: Loongson-3: Introduce CONFIG_LOONGSON3_ENHANCEMENT") Patchwork: https://patchwork.linux-mips.org/patch/19830/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang Cc: Zhangjin Wu Cc: Huacai Chen Cc: stable@vger.kernel.org # v3.15+ commit 965228d33cd2b47adb493bb1864761420c632e41 Author: Simon Shields Date: Sat Jul 21 22:50:53 2018 +1000 ARM: dts: exynos: Configure Midas SD card CD pin This pin is externally pulled up, so we need to disable the SoC's internal pull down resistor to allow it to function properly. Signed-off-by: Simon Shields Signed-off-by: Krzysztof Kozlowski commit 73d2f79471f85bd9931e5e88307049e490f10970 Author: Simon Shields Date: Sat Jul 21 22:50:52 2018 +1000 ARM: dts: exynos: Configure max77686 IRQ pin on Midas This pin is externally pulled up, so we need to disable the SoC's internal pull-down. Signed-off-by: Simon Shields Signed-off-by: Krzysztof Kozlowski commit e2bae133b5c41af3fd82f26edfa3222242a7ae6e Author: Simon Shields Date: Sat Jul 21 22:50:51 2018 +1000 ARM: dts: exynos: Add pinctrl for Midas fuelgauge IRQ pin This pin is externally pulled up, so we should disable the SoC's pull down resistor in order for the interrupt to function properly. Signed-off-by: Simon Shields Signed-off-by: Krzysztof Kozlowski commit 492413dd6d19448c40e2ac946b65f8e60dd306e1 Author: Simon Shields Date: Sat Jul 21 22:50:50 2018 +1000 ARM: dts: exynos: Add pinctrl config for Midas keys This pins are externally pulled up, and so we should explicitly configure them to disable the SoC-internal pull-downs. Previously we relied on the bootloader doing this in order to allow the buttons to function properly. Signed-off-by: Simon Shields Signed-off-by: Krzysztof Kozlowski commit 43efe4fab743149df2310c3293c8f7f4fb3a53e1 Author: Simon Shields Date: Sat Jul 21 22:50:49 2018 +1000 ARM: dts: exynos: Add max77693 pinctrl config for Midas Currently, we assume that the bootloader has correctly configured the interrupt pin for max77693. This might not actually be the case - so it's better to configure it explicitly. Signed-off-by: Simon Shields Signed-off-by: Krzysztof Kozlowski commit 75eb3a67a29e9f87c07c8bd184a7ed4274a58ef0 Author: Akinobu Mita Date: Mon Jul 23 00:45:46 2018 +0900 regmap: sccb: fix typo and sort headers alphabetically Fix typos 's/wit/with/' in the comments and sort headers alphabetically in order to avoid duplicate includes in future. Fixes: bcf7eac3d97f ("regmap: add SCCB support") Reported-by: Wolfram Sang Signed-off-by: Akinobu Mita Reviewed-by: Wolfram Sang Signed-off-by: Mark Brown commit 0afdd676f6e575478634d961286094169adbc50d Merge: e594a0636b02 eef5ba1aa148 Author: Mark Brown Date: Mon Jul 23 18:02:28 2018 +0100 Merge branch 'i2c/smbus_xfer_unlock-immutable' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into regmap-4.19 for sccb dependency commit 08edaaa6d6fa5f6ac9be2adcc71f80b4083b6494 Author: Anna-Maria Gleixner Date: Tue Jul 3 22:01:37 2018 +0200 drivers/md/raid5: Do not disable irq on release_inactive_stripe_list() call There is no need to invoke release_inactive_stripe_list() with interrupts disabled. All call sites, except raid5_release_stripe(), unlock ->device_lock and enable interrupts before invoking the function. Make it consistent. Cc: Shaohua Li Cc: linux-raid@vger.kernel.org Acked-by: Peter Zijlstra (Intel) Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Shaohua Li commit 9a2ad3623868752e4f4d0a04a4dc43d5fcde07ce Author: Petr Machata Date: Mon Jul 23 12:33:08 2018 +0200 selftests: forwarding: gre_multipath: Drop IPv6 tests Support for device-only IPv6 multipath next hops was dropped in commit 33bd5ac54dc4 ("net/ipv6: Revert attempt to simplify route replace and append") and as of commit b5d2d75e079a ("net/ipv6: Do not allow device only routes via the multipath API"), attempts to add a next hop like that yield an explicit diagnostic. Correspondingly, drop the IPv6 parts of GRE multipath test that are supposed to test that code. Signed-off-by: Petr Machata Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 7fa41efac14ffbe8db7660ad2da3928969d10caf Author: YueHaibing Date: Mon Jul 23 16:33:19 2018 +0800 ipv6: sr: Use kmemdup instead of duplicating it in parse_nla_srh Replace calls to kmalloc followed by a memcpy with a direct call to kmemdup. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit f8b2990fd91ecf66ee030da26de8336b28d3e1aa Merge: 0a78c3803d19 2756f68c3149 Author: David S. Miller Date: Mon Jul 23 09:32:15 2018 -0700 Merge branch 'net-bridge-add-support-for-backup-port' Nikolay Aleksandrov says: ==================== net: bridge: add support for backup port This set introduces a new bridge port option that allows any port to have any other port (in the same bridge of course) as its backup and traffic will be forwarded to the backup port when the primary goes down. This is mainly used in MLAG and EVPN setups where we have peerlink path which is a backup of many (or even all) ports and is a participating bridge port itself. There's more detailed information in patch 02. Patch 01 just prepares the port sysfs code for options that take raw value. The main issues that this set solves are scalability and fallback latency. We have used similar code for over 6 months now to bring the fallback latency of the backup peerlink down and avoid fdb notification storms. Also due to the nature of master devices such setup is currently not possible, and last but not least having tens of thousands of fdbs require thousands of calls to switch. I've also CCed our MLAG experts that have been using similar option. Roopa also adds: "Two switches acting in a MLAG pair are connected by the peerlink interface which is a bridge port. the config on one of the switches looks like the below. The other switch also has a similar config. eth0 is connected to one port on the server. And the server is connected to both switches. br0 -- team0---eth0 | -- switch-peerlink switch-peerlink becomes the failover/backport port when say team0 to the server goes down. Today, when team0 goes down, control plane has to withdraw all the fdb entries pointing to team0 and re-install the fdb entries pointing to switch-peerlink...and restore the fdb entries when team0 comes back up again. and this is the problem we are trying to solve. This also becomes necessary when multihoming is implemented by a standard like E-VPN https://tools.ietf.org/html/rfc8365#section-8 where the 'switch-peerlink' is an overlay vxlan port (like nikolay mentions in his patch commit). In these implementations, the fdb scale can be much larger. On why bond failover cannot be used here ?: the point that nikolay was alluding to is, switch-peerlink in the above example is a bridge port and is a failover/backport port for more than one or all ports in the bridge br0. And you cannot enslave switch-peerlink into a second level team with other bridge ports. Hence a multi layered team device is not an option (FWIW, switch-peerlink is also a teamed interface to the peer switch)." v3: Added Roopa's explanation and diagram v2: In patch 01 use kstrdup/kfree to avoid casting the const buf. In order to avoid using GFP_ATOMIC or always allocating I kept the spinlock inside each branch. ==================== Signed-off-by: David S. Miller commit 2756f68c314917d03eb348084edb08bb929139d9 Author: Nikolay Aleksandrov Date: Mon Jul 23 11:16:59 2018 +0300 net: bridge: add support for backup port This patch adds a new port attribute - IFLA_BRPORT_BACKUP_PORT, which allows to set a backup port to be used for known unicast traffic if the port has gone carrier down. The backup pointer is rcu protected and set only under RTNL, a counter is maintained so when deleting a port we know how many other ports reference it as a backup and we remove it from all. Also the pointer is in the first cache line which is hot at the time of the check and thus in the common case we only add one more test. The backup port will be used only for the non-flooding case since it's a part of the bridge and the flooded packets will be forwarded to it anyway. To remove the forwarding just send a 0/non-existing backup port. This is used to avoid numerous scalability problems when using MLAG most notably if we have thousands of fdbs one would need to change all of them on port carrier going down which takes too long and causes a storm of fdb notifications (and again when the port comes back up). In a Multi-chassis Link Aggregation setup usually hosts are connected to two different switches which act as a single logical switch. Those switches usually have a control and backup link between them called peerlink which might be used for communication in case a host loses connectivity to one of them. We need a fast way to failover in case a host port goes down and currently none of the solutions (like bond) cannot fulfill the requirements because the participating ports are actually the "master" devices and must have the same peerlink as their backup interface and at the same time all of them must participate in the bridge device. As Roopa noted it's normal practice in routing called fast re-route where a precalculated backup path is used when the main one is down. Another use case of this is with EVPN, having a single vxlan device which is backup of every port. Due to the nature of master devices it's not currently possible to use one device as a backup for many and still have all of them participate in the bridge (which is master itself). More detailed information about MLAG is available at the link below. https://docs.cumulusnetworks.com/display/DOCS/Multi-Chassis+Link+Aggregation+-+MLAG Further explanation and a diagram by Roopa: Two switches acting in a MLAG pair are connected by the peerlink interface which is a bridge port. the config on one of the switches looks like the below. The other switch also has a similar config. eth0 is connected to one port on the server. And the server is connected to both switches. br0 -- team0---eth0 | -- switch-peerlink Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit a5f3ea54f3ccd881562d47f34b4a83441796bf19 Author: Nikolay Aleksandrov Date: Mon Jul 23 11:16:58 2018 +0300 net: bridge: add support for raw sysfs port options This patch adds a new alternative store callback for port sysfs options which takes a raw value (buf) and can use it directly. It is needed for the backup port sysfs support since we have to pass the device by its name. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit f467cad95f5e3814fda408dea76eb962ab19685d Author: Darrick J. Wong Date: Fri Jul 20 09:28:40 2018 -0700 xfs: force summary counter recalc at next mount Use the "bad summary count" mount flag from the previous patch to skip writing the unmount record to force log recovery at the next mount, which will recalculate the summary counters for us. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 53235f22151ea7229e1251e46e68098bcf74922d Author: Darrick J. Wong Date: Fri Jul 20 09:28:39 2018 -0700 xfs: refactor unmount record write Refactor the writing of the unmount record into a separate helper. No functionality changes. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 2e9e6481e2a78de3a85083beccfbf6eda2689922 Author: Darrick J. Wong Date: Thu Jul 19 12:29:13 2018 -0700 xfs: detect and fix bad summary counts at mount Filippo Giunchedi complained that xfs doesn't even perform basic sanity checks of the fs summary counters at mount time. Therefore, recalculate the summary counters from the AGFs after log recovery if the counts were bad (or we had to recover the fs). Enhance the recalculation routine to fail the mount entirely if the new values are also obviously incorrect. We use a mount state flag to record the "bad summary count" state so that the (subsequent) online fsck patches can detect subtlely incorrect counts and set the flag; clear it userspace asks for a repair; or force a recalculation at the next mount if nobody fixes it by unmount time. Reported-by: Filippo Giunchedi Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 032d91f9820f6d241dc5584c27a668cfd377aaf0 Author: Darrick J. Wong Date: Thu Jul 19 12:29:12 2018 -0700 xfs: fix indentation and other whitespace problems in scrub/repair Now that we've shortened everything, fix up all the indentation and whitespace problems. There are no functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit 1d8a748a8aa94a7da8f3d4fac1892037890d3cff Author: Darrick J. Wong Date: Thu Jul 19 12:29:12 2018 -0700 xfs: shorten struct xfs_scrub_context to struct xfs_scrub Shorten the name of the online fsck context structure. Whitespace damage will be fixed by a subsequent patch. There are no functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit b5e2196e9c7217387bab2ab4231ad9f4585f55c5 Author: Darrick J. Wong Date: Thu Jul 19 12:29:11 2018 -0700 xfs: shorten xfs_repair_ prefix to xrep_ Shorten all the metadata repair xfs_repair_* symbols to xrep_. Whitespace damage will be fixed by a subsequent patch. There are no functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit c517b3aa02cff1dd688aa783b748e06c8aee1285 Author: Darrick J. Wong Date: Thu Jul 19 12:29:11 2018 -0700 xfs: shorten xfs_scrub_ prefix Shorten all the metadata checking xfs_scrub_ prefixes to xchk_. After this, the only xfs_scrub* symbols are the ones that pertain to both scrub and repair. Whitespace damage will be fixed in a subsequent patch. There are no functional changes. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit ef97ef26d263fb65f0c7446a10cf93201dc0388c Author: Darrick J. Wong Date: Thu Jul 19 12:29:10 2018 -0700 xfs: clean up xfs_btree_del_cursor callers Less trivial cleanups of the error argument to xfs_btree_del_cursor; these require some minor code refactoring. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino Reviewed-by: Christoph Hellwig commit 0b04b6b875b32f2b32263ba46d54d001e05724f9 Author: Darrick J. Wong Date: Thu Jul 19 12:26:31 2018 -0700 xfs: trivial xfs_btree_del_cursor cleanups The error argument to xfs_btree_del_cursor already understands the "nonzero for error" semantics, so remove pointless error testing in the callers and pass it directly. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino Reviewed-by: Christoph Hellwig commit 81b549aa626b650bbf00423c084c0fd5581169b9 Author: Darrick J. Wong Date: Thu Jul 19 12:25:47 2018 -0700 xfs: return from _defer_finish with a clean transaction The following assertion was seen on generic/051: XFS: Assertion failed: tp->t_firstblock == NULLFSBLOCK, file: fs/xfs/libxfs5 ------------[ cut here ]------------ kernel BUG at fs/xfs/xfs_message.c:102! invalid opcode: 0000 [#1] SMP PTI CPU: 2 PID: 20757 Comm: fsstress Not tainted 4.18.0-rc4+ #3969 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1 04/01/4 RIP: 0010:assfail+0x23/0x30 Code: c3 66 0f 1f 44 00 00 48 89 f1 41 89 d0 48 c7 c6 88 e0 8c 82 48 89 fa RSP: 0018:ffff88012dc43c08 EFLAGS: 00010202 RAX: 0000000000000000 RBX: ffff88012dc43ca0 RCX: 0000000000000000 RDX: 00000000ffffffc0 RSI: 000000000000000a RDI: ffffffff828480eb RBP: ffff88012aa92758 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: f000000000000000 R12: 0000000000000000 R13: ffff88012dc43d48 R14: ffff88013092e7e8 R15: 0000000000000014 FS: 00007f8d689b8e80(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8d689c7000 CR3: 000000012ba6a000 CR4: 00000000000006e0 Call Trace: xfs_defer_init+0xff/0x160 xfs_reflink_remap_extent+0x31b/0xa00 xfs_reflink_remap_blocks+0xec/0x4a0 xfs_reflink_remap_range+0x3a1/0x650 xfs_file_dedupe_range+0x39/0x50 vfs_dedupe_file_range+0x218/0x260 do_vfs_ioctl+0x262/0x6a0 ? __se_sys_newfstat+0x3c/0x60 ksys_ioctl+0x35/0x60 __x64_sys_ioctl+0x11/0x20 do_syscall_64+0x4b/0x190 entry_SYSCALL_64_after_hwframe+0x49/0xbe The root cause of the assertion failure is that xfs_defer_finish doesn't roll the transaction after processing all the deferred items. Therefore it returns a dirty transaction to the caller, which leaves the caller at risk of exceeding the transaction reservation if it logs more items. Brian Foster's patchset to move the defer_ops firstblock into the transaction requires t_firstblock == NULLFSBLOCK upon defer_ops initialization, which is how this was noticed at all. Reported-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig commit 65cfcc3897d7715a878b9f59736e7527ca27514f Author: Darrick J. Wong Date: Thu Jul 19 12:24:55 2018 -0700 xfs: check leaf attribute block freemap in verifier Check the leaf attribute freemap when we're verifying the block. Signed-off-by: Darrick J. Wong Reviewed-by: Carlos Maiolino Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig commit 25a13e382de2b0f844cd6303e45f2b33c8fbabac Author: Jia-Ju Bai Date: Mon Jul 23 11:56:51 2018 +0800 bluetooth: hci_qca: Replace GFP_ATOMIC with GFP_KERNEL qca_open() and qca_set_baudrate() are never called in atomic context. They call kzalloc() and bt_skb_alloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marcel Holtmann commit f6ebfc24e78d99ebfa0f8d1761b1d77b733dcbb9 Author: Jia-Ju Bai Date: Mon Jul 23 11:53:21 2018 +0800 bluetooth: hci_intel: Replace GFP_ATOMIC with GFP_KERNEL in inject_cmd_complete() inject_cmd_complete() is only called by intel_dequeue(), which is never called in atomic context. inject_cmd_complete() calls bt_skb_alloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marcel Holtmann commit cf07e3412668ac1d7a346a9b86c8a21e5cffd6b6 Author: Jia-Ju Bai Date: Mon Jul 23 11:38:51 2018 +0800 bluetooth: btusb: Replace GFP_ATOMIC with GFP_KERNEL in inject_cmd_complete() inject_cmd_complete() is only called by btusb_send_frame_intel(), which is set to hdev->send, and hdev->send() is never called in atomic context. inject_cmd_complete() calls bt_skb_alloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marcel Holtmann commit 436018eee5eaf1891793efca38ed9455fa21e16c Author: Jia-Ju Bai Date: Mon Jul 23 11:30:03 2018 +0800 bluetooth: btmrvl_sdio: Replace GFP_ATOMIC with GFP_KERNEL in btmrvl_sdio_card_to_host() btmrvl_sdio_card_to_host() is never called in atomic context. It calls bt_skb_alloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marcel Holtmann commit 478113e43162e409bbc6d79e87c2301728f26db2 Author: Jia-Ju Bai Date: Mon Jul 23 11:24:02 2018 +0800 bluetooth: bpa10x: Replace GFP_ATOMIC with GFP_KERNEL in bpa10x_send_frame() bpa10x_send_frame() is only set to hdev->send, and hdev->send() is never called in atomic context. bpa10x_send_frame() calls usb_alloc_urb(), kmalloc() and usb_submit_urb() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marcel Holtmann commit 5f9c6580f6324e279417fc66e80ade0c42bfa9d9 Author: Jia-Ju Bai Date: Mon Jul 23 11:17:35 2018 +0800 bluetooth: bluecard_cs: Replace GFP_ATOMIC with GFP_KERNEL in bluecard_hci_set_baud_rate() bluecard_hci_set_baud_rate() is never called in atomic context. bluecard_hci_set_baud_rate() is only by bluecard_hci_open(), which is set to hdev->open, and hdev->open() is never called in atomic context. bluecard_hci_set_baud_rate() calls bt_skb_alloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marcel Holtmann commit 6709514f266e9163f9f579006496fbc8bc986d80 Author: Jia-Ju Bai Date: Mon Jul 23 11:09:00 2018 +0800 bluetooth: bfusb: Replace GFP_ATOMIC with GFP_KERNEL in bfusb_send_frame() bfusb_send_frame() is only set to hdev->send, and hdev->send() is never called in atomic context. bfusb_send_frame() calls bt_skb_alloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai Signed-off-by: Marcel Holtmann commit fe3136f441411c2aeb4ffe29ef44b1a87c116775 Author: Souptick Joarder Date: Sun Jul 22 18:31:34 2018 +0530 mm: Introduce new type vm_fault_t We have introduce a new return type vm_fault_t for fault, page_mkwrite and pfn_mkwrite handlers. Update the document for the same Signed-off-by: Souptick Joarder Signed-off-by: Jonathan Corbet commit 203b400ee24ef11153651b6c4580896a99de412e Author: Marcel Ziswiler Date: Fri Jul 20 09:53:33 2018 +0200 mtd: nand: correct documentation for NAND_ECC_HW8_512 The documentation for this parameter said "6 bytes" when "8 bytes" was intended; correct it. Signed-off-by: Marcel Ziswiler Signed-off-by: Jonathan Corbet commit 9e7c758ec4768cf47779dea3cc8452f871f8d07e Author: Siddaraju DH Date: Thu Jul 19 22:06:51 2018 +0530 timekeeping.txt: Correct maxCount of n-bit binary counter A n-bit binary counter can count a maximum of 2^n events and the count value ranges from 0 to (2^n)-1 Signed-off-by: Siddaraju DH Signed-off-by: Jonathan Corbet commit 701b3a3c0ac42630f74a5efba8545d61ac0e3293 Author: valdis.kletnieks@vt.edu Date: Tue Jul 17 12:57:29 2018 -0400 PATCH scripts/kernel-doc Fix a warning whinge from Perl introduced by "scripts: kernel-doc: parse next structs/unions" Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/({ <-- HERE [^\{\}]*})/ at ./scripts/kernel-doc line 1155. Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/({ <-- HERE )/ at ./scripts/kernel-doc line 1179. Signed-off-by: Valdis Kletnieks Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet commit 31130c8ec8cc03dec563b8e1317be508d4268225 Author: Andreas Ziegler Date: Mon Jul 16 13:05:58 2018 +0200 Documentation: kprobetrace: document 'trigger' file As the other files are documented explicitly, let's add a short description for 'trigger' as well. Signed-off-by: Andreas Ziegler Signed-off-by: Jonathan Corbet commit e50891d6eff5bc446ecf5d4c04906a19d2eb8424 Author: Andreas Ziegler Date: Mon Jul 16 13:05:57 2018 +0200 Documentation: {u,k}probes: fix filename for event enabling The per-event files to enable or disable kprobes and uprobes are named 'enable', not 'enabled'. Fix the corresponding documentation. Signed-off-by: Andreas Ziegler Signed-off-by: Jonathan Corbet commit 655c75a206e65058c50abe731c0518fae5e25c73 Author: Prashant Dhamdhere Date: Fri Jul 13 22:58:06 2018 +0530 Documentation: proc.txt: Adding 'HardwareCorrupted' field and description. Fill in missing documentation for the HardwareCorrupted field in proc.txt. Signed-off-by: Prashant Dhamdhere Signed-off-by: Jonathan Corbet commit 1ecd34ddf63ef1d4015da5e5de6881e6845a6b0a Author: Geert Uytterhoeven Date: Fri Jul 20 14:27:39 2018 +0200 ata: sata_rcar: Add rudimentary Runtime PM support Replace the explicit clock handling to enable/disable the SATA module by calls to Runtime PM. This makes the driver independent of actual SoC clock/power hierarchies, and is needed to support virtualization, where the guest is not in full control of power management. Signed-off-by: Geert Uytterhoeven Reviewed-by: Sergei Shtylyov Signed-off-by: Tejun Heo commit c01e229f24eb133ca85453597447477974b07f20 Author: Geert Uytterhoeven Date: Fri Jul 20 14:27:38 2018 +0200 ata: sata_rcar: Provide a short-hand for &pdev->dev No functional changes. Signed-off-by: Geert Uytterhoeven Reviewed-by: Sergei Shtylyov Signed-off-by: Tejun Heo commit 0e3fd810c4f41dbd63fb7caddc11684959176727 Author: Arnd Bergmann Date: Tue Jul 10 16:46:41 2018 +0200 Documentation: document ktime_get_*() APIs As Dave Chinner points out, we don't have a proper documentation for the ktime_get() family of interfaces, making it rather unclear which of the over 30 (!) interfaces one should actually use in a driver or elsewhere in the kernel. I wrote up an explanation from how I personally see the interfaces, documenting what each of the functions do and hopefully making it a bit clearer which should be used where. This is the first time I tried writing .rst format documentation, so in addition to any mistakes in the content, I probably also introduce nonstandard formatting ;-) I first tried to add an extra section to Documentation/timers/timekeeping.txt, but this is currently not included in the generated API, and it seems useful to have the API docs as part of what gets generated in https://www.kernel.org/doc/html/latest/core-api/index.html#core-utilities instead, so I started a new file there. I also considered adding the documentation inline in the include/linux/timekeeping.h header, but couldn't figure out how to do that in a way that would result both in helpful inline comments as well as readable html output, so I settled for the latter, with a small note pointing to it from the header. Cc: Dave Chinner Cc: John Stultz Cc: Thomas Gleixner Cc: Stephen Boyd Tested-by: Randy Dunlap Reviewed-by: Randy Dunlap Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann Signed-off-by: Jonathan Corbet commit b965746306bcb058a6876d3a61b502d3dbb9fe91 Author: Will Deacon Date: Wed Jun 20 17:17:47 2018 +0100 rseq/selftests: Add support for arm64 Hook up arm64 support to the rseq selftests. Acked-by: Mathieu Desnoyers Signed-off-by: Will Deacon commit 2e012e76ad59edb4a5a175c0957a44337dc39d87 Author: Alexandru Gheorghe Date: Fri Jul 13 16:11:00 2018 +0100 drm: mali-dp: Set encoder possible_clones Set possible_clones field to report that the writeback connector and the one driving the display could be enabled at the same time. Signed-off-by: Alexandru Gheorghe Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit 7749a57a285342ff5664c80236a63c7fa53cbdfc Author: Alexandru Gheorghe Date: Fri Jul 13 16:10:59 2018 +0100 drm: mali-dp: Report writeback connector as connected Older version of this patch series reported writeback as disconnected to avoid confusing userspace not aware of writeback connectors. However, the version that got merged uses a special cap (DRM_CLIENT_CAP_WRITEBACK_CONNECTORS) for this purpose. This helps us avoid some special handling of writeback connector in drm_helper_probe_single_connector_modes, see [1]. https://lists.freedesktop.org/archives/dri-devel/2018-July/183144.html Signed-off-by: Alexandru Gheorghe Reviewed-by: Sean Paul Signed-off-by: Liviu Dudau commit 09ffcb0d718a0b100f0bed029b830987ecf53fab Author: AKASHI Takahiro Date: Mon Jul 23 10:57:32 2018 +0900 arm64: acpi: fix alignment fault in accessing ACPI This is a fix against the issue that crash dump kernel may hang up during booting, which can happen on any ACPI-based system with "ACPI Reclaim Memory." (kernel messages after panic kicked off kdump) (snip...) Bye! (snip...) ACPI: Core revision 20170728 pud=000000002e7d0003, *pmd=000000002e7c0003, *pte=00e8000039710707 Internal error: Oops: 96000021 [#1] SMP Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.0-rc6 #1 task: ffff000008d05180 task.stack: ffff000008cc0000 PC is at acpi_ns_lookup+0x25c/0x3c0 LR is at acpi_ds_load1_begin_op+0xa4/0x294 (snip...) Process swapper/0 (pid: 0, stack limit = 0xffff000008cc0000) Call trace: (snip...) [] acpi_ns_lookup+0x25c/0x3c0 [] acpi_ds_load1_begin_op+0xa4/0x294 [] acpi_ps_build_named_op+0xc4/0x198 [] acpi_ps_create_op+0x14c/0x270 [] acpi_ps_parse_loop+0x188/0x5c8 [] acpi_ps_parse_aml+0xb0/0x2b8 [] acpi_ns_one_complete_parse+0x144/0x184 [] acpi_ns_parse_table+0x48/0x68 [] acpi_ns_load_table+0x4c/0xdc [] acpi_tb_load_namespace+0xe4/0x264 [] acpi_load_tables+0x48/0xc0 [] acpi_early_init+0x9c/0xd0 [] start_kernel+0x3b4/0x43c Code: b9008fb9 2a000318 36380054 32190318 (b94002c0) ---[ end trace c46ed37f9651c58e ]--- Kernel panic - not syncing: Fatal exception Rebooting in 10 seconds.. (diagnosis) * This fault is a data abort, alignment fault (ESR=0x96000021) during reading out ACPI table. * Initial ACPI tables are normally stored in system ram and marked as "ACPI Reclaim memory" by the firmware. * After the commit f56ab9a5b73c ("efi/arm: Don't mark ACPI reclaim memory as MEMBLOCK_NOMAP"), those regions are differently handled as they are "memblock-reserved", without NOMAP bit. * So they are now excluded from device tree's "usable-memory-range" which kexec-tools determines based on a current view of /proc/iomem. * When crash dump kernel boots up, it tries to accesses ACPI tables by mapping them with ioremap(), not ioremap_cache(), in acpi_os_ioremap() since they are no longer part of mapped system ram. * Given that ACPI accessor/helper functions are compiled in without unaligned access support (ACPI_MISALIGNMENT_NOT_SUPPORTED), any unaligned access to ACPI tables can cause a fatal panic. With this patch, acpi_os_ioremap() always honors memory attribute information provided by the firmware (EFI) and retaining cacheability allows the kernel safe access to ACPI tables. Signed-off-by: AKASHI Takahiro Reviewed-by: James Morse Reviewed-by: Ard Biesheuvel Reported-by and Tested-by: Bhupesh Sharma Signed-off-by: Will Deacon commit 20d12cf990618845e76d3f24daaebd15d65a5e46 Author: AKASHI Takahiro Date: Mon Jul 23 10:57:31 2018 +0900 efi/arm: map UEFI memory map even w/o runtime services enabled Under the current implementation, UEFI memory map will be mapped and made available in virtual mappings only if runtime services are enabled. But in a later patch, we want to use UEFI memory map in acpi_os_ioremap() to create mappings of ACPI tables using memory attributes described in UEFI memory map. See the following commit: arm64: acpi: fix alignment fault in accessing ACPI tables So, as a first step, arm_enter_runtime_services() is modified, alongside Ard's patch[1], so that UEFI memory map will not be freed even if efi=noruntime. [1] https://marc.info/?l=linux-efi&m=152930773507524&w=2 Signed-off-by: AKASHI Takahiro Reviewed-by: Ard Biesheuvel Signed-off-by: Will Deacon commit 3ea86495aef2f6de26b7cb1599ba350dd6a0c521 Author: Ard Biesheuvel Date: Mon Jul 23 10:57:30 2018 +0900 efi/arm: preserve early mapping of UEFI memory map longer for BGRT The BGRT code validates the contents of the table against the UEFI memory map, and so it expects it to be mapped when the code runs. On ARM, this is currently not the case, since we tear down the early mapping after efi_init() completes, and only create the permanent mapping in arm_enable_runtime_services(), which executes as an early initcall, but still leaves a window where the UEFI memory map is not mapped. So move the call to efi_memmap_unmap() from efi_init() to arm_enable_runtime_services(). Signed-off-by: Ard Biesheuvel [will: fold in EFI_MEMMAP attribute check from Ard] Signed-off-by: Will Deacon commit 5bcd44083a082f314032969cd6db1eb8275ac77a Author: AKASHI Takahiro Date: Mon Jul 23 10:57:29 2018 +0900 drivers: acpi: add dependency of EFI for arm64 As Ard suggested, CONFIG_ACPI && !CONFIG_EFI doesn't make sense on arm64, while CONFIG_ACPI and CONFIG_CPU_BIG_ENDIAN doesn't make sense either. As CONFIG_EFI already has a dependency of !CONFIG_CPU_BIG_ENDIAN, it is good enough to add a dependency of CONFIG_EFI to avoid any useless combination of configuration. This bug, reported by Will, will be revealed when my patch series, "arm64: kexec,kdump: fix boot failures on acpi-only system," is applied and the kernel is built under allmodconfig. Signed-off-by: AKASHI Takahiro Suggested-by: Ard Biesheuvel Signed-off-by: Will Deacon commit 50d7ba36b916d0fd4687149ec143bf49c326523f Author: James Morse Date: Mon Jul 23 10:57:28 2018 +0900 arm64: export memblock_reserve()d regions via /proc/iomem There has been some confusion around what is necessary to prevent kexec overwriting important memory regions. memblock: reserve, or nomap? Only memblock nomap regions are reported via /proc/iomem, kexec's user-space doesn't know about memblock_reserve()d regions. Until commit f56ab9a5b73ca ("efi/arm: Don't mark ACPI reclaim memory as MEMBLOCK_NOMAP") the ACPI tables were nomap, now they are reserved and thus possible for kexec to overwrite with the new kernel or initrd. But this was always broken, as the UEFI memory map is also reserved and not marked as nomap. Exporting both nomap and reserved memblock types is a nuisance as they live in different memblock structures which we can't walk at the same time. Take a second walk over memblock.reserved and add new 'reserved' subnodes for the memblock_reserved() regions that aren't already described by the existing code. (e.g. Kernel Code) We use reserve_region_with_split() to find the gaps in existing named regions. This handles the gap between 'kernel code' and 'kernel data' which is memblock_reserve()d, but already partially described by request_standard_resources(). e.g.: | 80000000-dfffffff : System RAM | 80080000-80ffffff : Kernel code | 81000000-8158ffff : reserved | 81590000-8237efff : Kernel data | a0000000-dfffffff : Crash kernel | e00f0000-f949ffff : System RAM reserve_region_with_split needs kzalloc() which isn't available when request_standard_resources() is called, use an initcall. Reported-by: Bhupesh Sharma Reported-by: Tyler Baicar Suggested-by: Akashi Takahiro Signed-off-by: James Morse Fixes: d28f6df1305a ("arm64/kexec: Add core kexec support") Reviewed-by: Ard Biesheuvel CC: Mark Rutland Signed-off-by: Will Deacon commit c931d34ea0853d41349e93f871bd3f17f1c03a6b Author: Olof Johansson Date: Fri Jul 13 08:30:33 2018 -0700 arm64: build with baremetal linker target instead of Linux when available Not all toolchains have the baremetal elf targets, RedHat/Fedora ones in particular. So, probe for whether it's available and use the previous (linux) targets if it isn't. Reported-by: Laura Abbott Tested-by: Laura Abbott Acked-by: Masahiro Yamada Cc: Paul Kocialkowski Signed-off-by: Olof Johansson Signed-off-by: Will Deacon commit 14d6e289a89780377f8bb09de8926d3c62d763cd Author: Mark Rutland Date: Tue Jul 10 19:01:22 2018 +0100 arm64: fix possible spectre-v1 write in ptrace_hbp_set_event() It's possible for userspace to control idx. Sanitize idx when using it as an array index, to inhibit the potential spectre-v1 write gadget. Found by smatch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 9eb8be602bf8d550a33b4e1f9fac543bd5c89f4d Author: Christoph Hellwig Date: Wed Jun 20 10:19:45 2018 +0200 m68k: Use generic dma_noncoherent_ops Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Ungerer Tested-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven commit a8c5cb994341d4af6d75286fcb66684e53295135 Author: Finn Thain Date: Mon Jun 25 21:46:11 2018 +1000 nubus: Set default dma mask for nubus_board devices A 32-bit mask is used by default because a NuBus slot has 32 address/data lines and a NuBus board is free to use all of them. Cc: Greg Kroah-Hartman Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Christoph Hellwig Signed-off-by: Geert Uytterhoeven commit cf85d89562f39cc7ae73de54639f1915a9195b7a Author: Finn Thain Date: Fri May 25 17:34:36 2018 +1000 m68k/mac: Enable PDMA for PowerBook 500 series I can confirm that mac_scsi PDMA now works on these machines. This increases sequential read throughput by a factor of 4.5. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven commit 7673bf553b2732a00f7644fb2adadda69389ab37 Author: Eric W. Biederman Date: Mon Jul 23 08:01:10 2018 -0500 fork: Unconditionally exit if a fatal signal is pending In practice this does not change anything as testing for fatal_signal_pending and exiting for with an error code duplicates the work of the next clause which recalculates pending signals and then exits fork if any are pending. In both cases the pending signal will trigger the slow path when existing to userspace, and the fatal signal will cause do_exit to be called. The advantage of making this a separate test is that it makes it clear processing the fatal signal will terminate the fork, and it allows the rest of the signal logic to be updated without fear that this important case will be lost. Signed-off-by: "Eric W. Biederman" commit 4ca1d3ee46130e9b939c02a93e3970dad151fed6 Author: Eric W. Biederman Date: Fri Jul 13 15:30:33 2018 -0500 fork: Move and describe why the code examines PIDNS_ADDING Normally this would be something that would be handled by handling signals that are sent to a group of processes but in this case the forking process is not a member of the group being signaled. Thus special code is needed to prevent a race with pid namespaces exiting, and fork adding new processes within them. Move this test up before the signal restart just in case signals are also pending. Fatal conditions should take presedence over restarts. Signed-off-by: "Eric W. Biederman" commit b340cbbea5b876b9051d88afc712411a65750cf1 Author: Andy Shevchenko Date: Mon Jul 23 12:02:10 2018 +0300 serial: 8250_exar: Drop unused variable in pci_xr17v35x_setup() After removal has_slave use the variable board becomes unused. Remove it to avoid a warning: drivers/tty/serial/8250/8250_exar.c: In function 'pci_xr17v35x_setup': drivers/tty/serial/8250/8250_exar.c:380:31: warning: unused variable 'board' [-Wunused-variable] const struct exar8250_board *board = priv->board; ^~~~~ Fixes: 328c11f24b57 ("serial: 8250_exar: Remove useless has_slave member") Reported-by: Stephen Rothwell Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit ef4b891f7924aca43147928532ea729f290ca38e Author: Souptick Joarder Date: Sun Jul 22 19:11:09 2018 +0530 s390: vdso_fault return type Use new return type vm_fault_t for fault handler vdso_fault. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Martin Schwidefsky commit d1de8633d96ac48d59e91775a17b828760bebc62 Author: Thomas Richter Date: Tue Jul 3 11:21:06 2018 +0200 s390 cio: Rewrite trace point class s390_class_schib Tools like 'perf stat' parse the trace point format files defined in /sys/kernel/debug/tracing/events/s390/.../format to handle the print fmt: statement. The kernel provides a library in directory linux/tools/lib/traceevent/* for this reason. This library can not handle structures or unions defined in the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro. There is no possibility to extract a structure member (which might be a bit field) since there is no packing information nor bit field offset by parsing the printf fmt line. Therefore rewrite the TRACE_EVENT macro and add the __field macro for the necessary members. Keep the __fieldstruct macro to extract the complete structure when dumps are analysed. Note that the same information is displayed, this is no interface change. Signed-off-by: Thomas Richter Reviewed-by: Peter Oberparleiter Acked-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit 933df441e771bb8b39e1d90f868bfbdae2ed2b40 Author: Thomas Richter Date: Mon Jul 9 10:30:34 2018 +0200 s390 cio: Rewrite trace point in s390_cio_tsch Tools like 'perf stat' parse the trace point format files defined in /sys/kernel/debug/tracing/events/s390/.../format to handle the print fmt: statement. The kernel provides a library in directory linux/tools/lib/traceevent/* for this reason. This library can not handle structures or unions defined in the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro. There is no possibility to extract a structure member (which might be a bit field) since there is no packing information nor bit field offset by parsing the printf fmt line. Therefore rewrite the TRACE_EVENT macro and add the __field macro for the necessary members. Keep the __fieldstruct macro to extract the complete structure when dumps are analysed. Note that the same information is displayed, this is no interface change. Signed-off-by: Thomas Richter Reviewed-by: Peter Oberparleiter Acked-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit 27c0620ce94798688a425cb04db0e7f568e44d52 Author: Thomas Richter Date: Tue Jul 3 10:38:16 2018 +0200 s390 cio: Rewrite trace point in s390_cio_adapter_int Tools like 'perf stat' parse the trace point format files defined in /sys/kernel/debug/tracing/events/s390/.../format to handle the print fmt: statement. The kernel provides a library in directory linux/tools/lib/traceevent/* for this reason. This library can not handle structures or unions defined in the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro. There is no possibility to extract a structure member (which might be a bit field) since there is no packing information nor bit field offset by parsing the printf fmt line. Therefore rewrite the TRACE_EVENT macro and add the __field macro for the necessary members. Keep the __fieldstruct macro to extract the complete structure when dumps are analysed. Note that the same information is displayed, this is no interface change. Signed-off-by: Thomas Richter Reviewed-by: Peter Oberparleiter Acked-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit 67faae15675aac8327b094677a830fdffb7dd68d Author: Thomas Richter Date: Wed Jul 11 10:27:12 2018 +0200 s390 cio: Rewrite trace point in s390_cio_stcrw Tools like 'perf stat' parse the trace point format files defined in /sys/kernel/debug/tracing/events/s390/.../format to handle the print fmt: statement. The kernel provides a library in directory linux/tools/lib/traceevent/* for this reason. This library can not handle structures or unions defined in the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro. There is no possibility to extract a structure member (which might be a bit field) since there is no packing information nor bit field offset by parsing the printf fmt line. Therefore rewrite the TRACE_EVENT macro and add the the __field macro for the missing members. Keep the __fieldstruct macro to extract the complete structure when dumps are analysed. Note that the same information is displayed, this is no interface change. Signed-off-by: Thomas Richter Reviewed-by: Peter Oberparleiter Acked-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit 5925e819274260bb48e10a2fc6d22b996d1e135f Author: Thomas Richter Date: Tue Jul 3 10:15:10 2018 +0200 s390 cio: Rewrite trace point in s390_cio_tpi Tools like 'perf stat' parse the trace point format files defined in /sys/kernel/debug/tracing/events/s390/.../format to handle the print fmt: statement. The kernel provides a library in directory linux/tools/lib/traceevent/* for this reason. This library can not handle structures or unions defined in the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro. There is no possibility to extract a structure member (which might be a bit field) since there is no packing information nor bit field offset by parsing the printf fmt line. Therefore rewrite the TRACE_EVENT macro and add the __field macro for the members adapter_IO, isc and type of struct tpi_info. Note that the same information is displayed, this is no interface change. Signed-off-by: Thomas Richter Reviewed-by: Peter Oberparleiter Acked-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit 661c959bae317bf3c61e438ffffec92fc9ad38e2 Author: Thomas Richter Date: Tue Jul 3 09:41:12 2018 +0200 s390 cio: Rewrite trace point in s390_cio_interrupt Tools like 'perf stat' parse the trace point format files defined in /sys/kernel/debug/tracing/events/s390/.../format to handle the print fmt: statement. The kernel provides a library in directory linux/tools/lib/traceevent/* for this reason. This library can not handle structures or unions defined in the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro. There is no possibility to extract a structure member (which might be a bit field) since there is no packing information nor bit field offset by parsing the printf fmt line. Therefore rewrite the TRACE_EVENT macro and add the __field macro for the necessary fields. Keep the __fieldstruct macro to extract the complete structure when dumps are analysed. Note that the same information is displayed, this is no interface change. Signed-off-by: Thomas Richter Reviewed-by: Peter Oberparleiter Acked-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit b036e6420b9aed3498cbd0429f12300139cc5a28 Author: Geert Uytterhoeven Date: Wed Jul 11 16:31:23 2018 +0200 ARM: multi_v7_defconfig: Enable support for RZN1D-DB Enable support for the Renesas RZN1D-DB Board: - RZ/N1D (R9A06G032) base SoC support. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit c03e2f12a2967f1639ee53299b72922ee3472528 Author: Geert Uytterhoeven Date: Tue Jul 17 15:25:49 2018 +0200 ARM: dts: r8a77470: Use r8a77470-cpg-mssr binding definitions Replace the hardcoded clock indices by R8A77470_CLK_* symbols. Signed-off-by: Geert Uytterhoeven Reviewed-by: Biju Das Signed-off-by: Simon Horman commit c85aabb841f5ed544b492544e8280f2a9c1cc647 Author: Jacopo Mondi Date: Tue Jul 3 22:41:09 2018 +0200 ARM: dts: gr-peach: Add GR-Peach audiocamerashield support Add device tree header for GR-Peach's audiocamerashield with MT9V111 image sensor. Signed-off-by: Jacopo Mondi Reviewed-by: Simon Horman Signed-off-by: Simon Horman commit f8fc94dbcf2d166b865991afb6c827aa56dc0de2 Author: Michel Pollet Date: Thu Jun 28 09:17:14 2018 +0100 ARM: dts: Renesas R9A06G032 SMP enable method Add a special enable method for the second CA7 of the R9A06G032 as well as the default value for the "cpu-release-addr" property. Signed-off-by: Michel Pollet Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit df7112c9461458c2a2069e9a4a7962fd16bf62bf Author: Michel Pollet Date: Thu Jun 14 11:56:33 2018 +0100 ARM: dts: Renesas RZN1D-DB Board base file This adds a base device tree file for the RZN1-DB board, with only the basic support allowing the system to boot to a prompt. Only one UART is used, with only a single CPU running. Signed-off-by: Michel Pollet Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 769d7248a7aae5dace1c5c776c98b352d3d93617 Author: Michel Pollet Date: Thu Jun 14 11:56:32 2018 +0100 ARM: dts: Renesas R9A06G032 base device tree file This adds the Renesas R9A06G032 bare bone support. This currently only handles the SYSCTRL block note, generic parts (gic, architected timer) and a UART. Signed-off-by: Michel Pollet Reviewed-by: Geert Uytterhoeven [simon: updated MAINTAINERS file [simon: do not use r9a06g032-sysctrl.h as it is not in the renesas tree yet] Signed-off-by: Simon Horman commit cdbfaf640a23334a7bd2d8a8689051711a4e23c2 Author: Wolfram Sang Date: Mon Jun 11 23:49:36 2018 +0900 ARM: dts: convert to SPDX identifier for Renesas boards Signed-off-by: Wolfram Sang Acked-by: Yoshihiro Shimoda Acked-by: Kuninori Morimoto Signed-off-by: Simon Horman commit 8199e49ff1f654bbe8bed90fd6710bc097a89d02 Author: Viresh Kumar Date: Wed May 30 10:16:58 2018 +0530 ARM: dts: r8a77(43|9[013]): Add missing OPP properties for CPUs The OPP properties, like "operating-points", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can create an OPP table. Add such missing properties. Fix other missing properties (like, clock latency, voltage tolerance, etc) as well to make it all work. Signed-off-by: Viresh Kumar Reviewed-by: Simon Horman Signed-off-by: Simon Horman commit bbb94a120136c4d8e0076d107f39fda14666ea65 Author: Geert Uytterhoeven Date: Wed Jul 4 13:43:32 2018 +0200 ARM: shmobile: defconfig: Disable /sbin/hotplug fork-bomb No recent mainstream system uses the /sbin/hotplug fork-bomb any more. Commit 7934779a69f1184f29d786b89e77dd14519bd226 ("Driver-Core: disable /sbin/hotplug by default") disabled it in Kconfig, but the various defconfigs weren't updated. According to the systemd requirements, this option must be disabled, as it slows down the system and confuses udev. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit b540eba16fd0b0150774b0129fe7a150f10fed3d Author: Geert Uytterhoeven Date: Wed Jul 4 13:43:31 2018 +0200 ARM: shmobile: defconfig: Enable support for RZN1D-DB Enable support for the Renesas RZN1D-DB Board: - RZ/N1D (R9A06G032) base SoC support, - Synopsys DesignWare 8250 serial port support. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 9efd6903620f51011f3a8595ab33b9491cc3b57f Author: Geert Uytterhoeven Date: Wed Jul 4 13:43:30 2018 +0200 ARM: shmobile: defconfig: Enable reset controller support R-Car Gen2 and RZ/G1 SoCs can make use of the optional reset controller support in the Renesas CPG/MSSR driver. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 49141c8248505bd45e77dd7673a952a14f8fd390 Author: Geert Uytterhoeven Date: Wed Jul 4 13:43:29 2018 +0200 ARM: shmobile: defconfig: Drop NET_VENDOR_=n Enabling NET_VENDOR_* Kconfig options does not directly affect the kernel, so there is no need to explicitly disable them. The individual network drivers under them are still disabled. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 26fce0557fa639fb7bbc33e31a57cff7df25c3a0 Author: Leonard Crestez Date: Fri Jul 20 15:47:43 2018 +0300 reset: imx7: Fix always writing bits as 0 Right now the only user of reset-imx7 is pci-imx6 and the reset_control_assert and deassert calls on pciephy_reset don't toggle the PCIEPHY_BTN and PCIEPHY_G_RST bits as expected. Fix this by writing 1 or 0 respectively. The reference manual is not very clear regarding SRC_PCIEPHY_RCR but for other registers like MIPIPHY and HSICPHY the bits are explicitly documented as "1 means assert, 0 means deassert". The values are still reversed for IMX7_RESET_PCIE_CTRL_APPS_EN. Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach Signed-off-by: Philipp Zabel commit a4138e7c12287268348cc2dcad414a62c515d77a Author: Sakari Ailus Date: Tue Jul 17 17:19:21 2018 +0300 ACPI: property: graph: Update graph documentation to use generic references Instead of port and endpoint properties for representing ports and endpoints, use the keys of the hierarchical data extension references when referring to the port and endpoint nodes. Additionally, use "reg" properties as in Device Tree to specify the number of the port or the endpoint. The keys of the port nodes begin with "port" and the keys of the endpoint nodes begin with "endpoint", both followed by "@" character and the number of the port or the endpoint. These changes have the advantage that no ACPI specific properties need to be added to refer to non-device nodes. Additionally, using the name of the node instead of an integer property inside the node is easier to parse in code and easier for humans to understand. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit e49363e96fd2ee3fd5259fd2a6f9050cb4af82c8 Author: Sakari Ailus Date: Tue Jul 17 17:19:20 2018 +0300 ACPI: property: graph: Improve graph documentation for port/ep numbering Document that if a port has a single endpoint only, its value shall be zero. Similarly, if a device object only has a single port, its value shlla be zero. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit e58b1c6a9422b97b30838e77b7d1d2bbed121e96 Author: Sakari Ailus Date: Tue Jul 17 17:19:19 2018 +0300 ACPI: property: graph: Fix graph documentation Address a few issues in the ACPI _DSD properties graph documentation: - the extension for port nodes is a data extension (and not property extension), - clean up language in port hierarchical data extension definition, - add examples of port and endpoint packages, - port property value is the number of the "port" and not the number of the "port node", - remove word "individual" from endpoint data node description, it was redundant, - remove the extra "The" in the endpoint property description, - refer to hierarchical data extension keys and targets instead of first and second package list entries. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit e4702b2ca7b4aa81cc067c1b8e7aaa1350239fa2 Author: Sakari Ailus Date: Tue Jul 17 17:19:18 2018 +0300 ACPI: property: Update documentation for hierarchical data extension 1.1 Hierarchical data extension 1.1 allows using references as the second entries of the hierearchical data extension packages. Update the references and the examples. The quotes are left in documentation for clarity. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 2285e6d9f68912c786cfc46f798be42ef9800ae8 Author: Sakari Ailus Date: Tue Jul 17 17:19:17 2018 +0300 ACPI: property: Document key numbering for hierarchical data extension refs As part of the hierarchical data extension key naming, introduce numbering scheme for the nodes that may be referred to using hierarchical data extension references. This allows iterating over particular kind of nodes recognised by the node name whilst allowing numbering the nodes, bringing ACPI to feature parity with DT in this respect. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 18f1e58d1536f69d4e35f6eabaa07e57eb317314 Author: Sakari Ailus Date: Tue Jul 17 17:19:16 2018 +0300 ACPI: property: Use data node name and reg property for graphs Instead of using the port and endpoint properties, rely on the names of the port and endpoint nodes as well as the reg property, as on DT. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 6561eb3d3a23c4d38ba428396b7a14e184804535 Author: Sakari Ailus Date: Tue Jul 17 17:19:15 2018 +0300 ACPI: property: Allow direct graph endpoint references By using device and further data node references, allow direct references to endpoints. These are of form Package() { \DEV, "portX", "endpointY" } where X is the number of the port and Y is the number of the endpoint. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 0ef7478639c5165a672f01b4024aacfffa951813 Author: Sakari Ailus Date: Tue Jul 17 17:19:14 2018 +0300 ACPI: property: Make the ACPI graph API private The fwnode graph API is preferred over the ACPI graph API. Therefore make the ACPI graph API private, and use it as a back-end for the fwnode graph API only. Unused functionality is removed while the functionality actually used remains the same. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit b10134a3643dced57976f9346764144203cfb302 Author: Sakari Ailus Date: Tue Jul 17 17:19:13 2018 +0300 ACPI: property: Document hierarchical data extension references Add documentation on how to refer to hierarchical data nodes in a generic way. This brings ACPI to feature parity with Device Tree in terms of being able to refer to any node in the tree. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 4eb0c3bf5ee52ffc88500763d80ba01393879794 Author: Sakari Ailus Date: Tue Jul 17 17:19:12 2018 +0300 ACPI: property: Allow making references to non-device nodes Implement references to non-device nodes using the first package entry in the hierarchical data extension reference, the second one being the name of the referred object. The data node references are parsed just after the device arguments before the integer arguments. If there are no strings after the device arguments, the parsing works exactly as it used to be. Referring to a data node called "node" under device DEV, with integer arguments 0, 2 would thus look like: Package() { DEV, "node", 0, 2 } Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 977d5ad39f3ea12ac0bd51d75020cea5ecdca235 Author: Sakari Ailus Date: Tue Jul 17 17:19:11 2018 +0300 ACPI: Convert ACPI reference args to generic fwnode reference args Convert all users of struct acpi_reference_args to more generic fwnode_reference_args. This will 1) avoid an ACPI specific references to device nodes with integer arguments as well as 2) allow making references to nodes other than device nodes in ACPI. As a by-product, convert the fwnode interger arguments to u64. The arguments were 64-bit integers on ACPI but the fwnode arguments were just 32-bit. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 365e660fc88d6b8bbff13e61114cfb7b57e8a23d Author: Enric Balletbo i Serra Date: Tue Jul 17 18:06:06 2018 +0200 arm64: defconfig: Enable more peripherals for Samsung Chromebook Plus. Enable the Rockchip sound driver with MAX98357A/RT5514/DA7219 codecs, Infineon TPM security chip (compliant with TCG TIS 1.2 TPM specification), vctrl regulators for dynamic CPU voltages, UVC camera support and SBS- compliant gas gauges needed for the Samsung Chromebook Plus. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Heiko Stuebner commit 9f65b81f36e31563c5a5e4df3b3b8bc7550b6030 Author: Nicholas Piggin Date: Tue May 1 00:55:57 2018 +1000 tty: hvc: introduce the hv_ops.flush operation for hvc drivers Use .flush to wait for drivers to flush their console outside of the spinlock, to reduce lock/irq latencies. Flush the hvc console driver after each write, which can help messages make it out to the console after a crash. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 550ddadcc7580ec2a6c22d4ed04291bc6e2428fb Author: Nicholas Piggin Date: Tue May 1 00:55:56 2018 +1000 tty: hvc: hvc_write() may sleep Rework the hvc_write loop to drop and re-take the spinlock on each iteration, add a cond_resched. Don't bother with an initial hvc_push initially, which makes the logic simpler -- just do a hvc_push on each time around the loop. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit cfb5946b55f1dfd19e042feae1fbff6041e25a98 Author: Nicholas Piggin Date: Tue May 1 00:55:55 2018 +1000 tty: hvc: hvc_poll() may sleep Introduce points where hvc_poll drops the lock, enables interrupts, and reschedules. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit 6e9df95b76cad18f7b217bdad7bb8a26d63b8c47 Author: Kamalesh Babulal Date: Fri Jul 20 15:16:42 2018 +0530 livepatch: Validate module/old func name length livepatch module author can pass module name/old function name with more than the defined character limit. With obj->name length greater than MODULE_NAME_LEN, the livepatch module gets loaded but waits forever on the module specified by obj->name to be loaded. It also populates a /sys directory with an untruncated object name. In the case of funcs->old_name length greater then KSYM_NAME_LEN, it would not match against any of the symbol table entries. Instead loop through the symbol table comparing them against a nonexisting function, which can be avoided. The same issues apply, to misspelled/incorrect names. At least gatekeep the modules with over the limit string length, by checking for their length during livepatch module registration. Cc: stable@vger.kernel.org Signed-off-by: Kamalesh Babulal Acked-by: Josh Poimboeuf Signed-off-by: Jiri Kosina commit ec97eaad1383ab2500fcf9a07ade6044fbcc67f5 Author: Nicholas Piggin Date: Tue May 1 00:55:54 2018 +1000 tty: hvc: hvc_poll() break hv read loop Avoid looping with the spinlock held while there is read data being returned from the hv driver. Instead note if the entire size returned by tty_buffer_request_room was read, and request another read poll. This limits the critical section lengths, and provides more even service to other consoles in case there is a pathological condition. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit a9bf5c8a271b9a954709b7ada1bd258f5cadf7ff Author: Nicholas Piggin Date: Tue May 1 00:55:53 2018 +1000 tty: hvc: use mutex instead of spinlock for hvc_structs lock This allows hvc operations to sleep under the lock. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit b8e759b8f6dab1c473c30ac12709095d0b81078e Author: Daniel M. Lambea Date: Tue Jul 17 22:35:37 2018 +0100 HID: cougar: Add support for the Cougar 500k Gaming Keyboard Cougar 500k Gaming Keyboard have some special function keys that make the keyboard stop responding once pressed. Implement the custom vendor interface that deals with the extended keypresses to fix. The bug can be reproduced by plugging in the keyboard, then pressing the rightmost part of the spacebar. Signed-off-by: Daniel M. Lambea Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 1a8861f117608e269647fb09658ce77bd5899d42 Author: Daniel M. Lambea Date: Tue Jul 17 22:35:36 2018 +0100 HID: cougar: make compare_device_paths reusable The function compare_device_paths from wacom_sys.c is generic and useful for other drivers. Move the function to hid-core and rename it as hid_compare_device_paths. Signed-off-by: Daniel M. Lambea Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 1ea0358ecb848058b35b6da13d7f4c08610a73a8 Author: Yue Wang Date: Mon Jul 23 01:56:46 2018 -0700 ALSA: usb-audio: Generic DSD detection for Thesycon-based implementations Thesycon provides solutions to XMOS chips, and has its own device vendor id. In this patch, we use generic method to detect DSD capability of Thesycon-based UAC2 implementations in order to support a wide range of current and future devices. The patch will enable the SNDRV_PCM_FMTBIT_DSD_U32_BE bit for the DAC hence enable native DSD playback up to DSD512 format. Signed-off-by: Yue Wang Signed-off-by: Takashi Iwai commit 5d87eb94d9ba13e5e2d5ceb56ac6fe0948259ffa Author: Keith Busch Date: Fri Jun 29 16:50:01 2018 -0600 nvme: use hw qid in trace events We can not match a command to its completion based on the command id alone. We need the submitting queue identifier to pair with the completion, so this patch adds that to the trace buffer. This patch is also collapsing the admin and IO submission traces into a single one so we don't need to duplicate this and creating unnecessary code branches: we know if the command is an admin vs IO based on the qid. And since we're here, the patch fixes code formatting in the area. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Johannes Thumshirn [hch: move the qid helper to nvme.h and made it an inline function] Signed-off-by: Christoph Hellwig commit 59e29ce66bc52ebd6d0cb450f13079c7e913430d Author: Sagi Grimberg Date: Fri Jun 29 16:50:00 2018 -0600 nvme: cache struct nvme_ctrl reference to struct nvme_request We will need to reference the controller in the setup and completion time for tracing and future traffic based keep alive support. Reviewed-by: Johannes Thumshirn Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 202093848cac2da7d92ae666b51b7109bbab633c Author: Max Gurtovoy Date: Sun Jul 1 12:20:24 2018 +0300 nvmet-rdma: add an error flow for post_recv failures Posting receive buffer operation can fail, thus we should make sure to have an error flow during initialization phase. While we're here, add a debug print in case of a failure. Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit 2fc464e2162c2b2f7faf7404fa9c35d1cf70aa00 Author: Max Gurtovoy Date: Wed Jun 27 14:58:02 2018 +0300 nvmet-rdma: add unlikely check in the fast path ib_post_send operation should succeed unless something unusual happened to the ib device. Signed-off-by: Max Gurtovoy Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 0d5ee2b2ab4f6776c361bc975c2323bc8b5cf349 Author: Steve Wise Date: Wed Jun 20 07:15:10 2018 -0700 nvmet-rdma: support max(16KB, PAGE_SIZE) inline data The patch enables inline data sizes using up to 4 recv sges, and capping the size at 16KB or at least 1 page size. So on a 4K page system, up to 16KB is supported, and for a 64K page system 1 page of 64KB is supported. We avoid > 0 order page allocations for the inline buffers by using multiple recv sges, one for each page. If the device cannot support the configured inline data size due to lack of enough recv sges, then log a warning and reduce the inline size. Add a new configfs port attribute, called param_inline_data_size, to allow configuring the size of inline data for a given nvmf port. The maximum size allowed is still enforced by nvmet-rdma with NVMET_RDMA_MAX_INLINE_DATA_SIZE, which is now max(16KB, PAGE_SIZE). And the default size, if not specified via configfs, is still PAGE_SIZE. This preserves the existing behavior, but allows larger inline sizes for small page systems. If the configured inline data size exceeds NVMET_RDMA_MAX_INLINE_DATA_SIZE, a warning is logged and the size is reduced. If param_inline_data_size is set to 0, then inline data is disabled for that nvmf port. Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Steve Wise Signed-off-by: Christoph Hellwig commit 64a741c1eaa83e34a8846c7196feb8e45785bebc Author: Steve Wise Date: Wed Jun 20 07:15:05 2018 -0700 nvme-rdma: support up to 4 segments of inline data Allow up to 4 segments of inline data for NVMF WRITE operations. This reduces latency for small WRITEs by removing the need for the target to issue a READ WR for IB, or a REG_MR + READ WR chain for iWarp. Also cap the inline segments used based on the limitations of the device. Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Steve Wise Signed-off-by: Christoph Hellwig commit 55eb942eda2ccbbbea61db4c1a774ba22b618046 Author: Chaitanya Kulkarni Date: Wed Jun 20 00:01:41 2018 -0400 nvmet: add buffered I/O support for file backed ns Add a new "buffered_io" attribute, which disabled direct I/O and thus enables page cache based caching when enabled. The attribute can only be changed when the namespace is disabled as the file has to be reopend for the change to take effect. The possibly blocking read/write are deferred to a newly introduced global workqueue. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 0866bf0c3778661e65f68a5c93df8e0a1e9e43cc Author: Chaitanya Kulkarni Date: Mon Jun 11 13:40:07 2018 -0400 nvmet: add commands supported and effects log page This patch adds support for Commands Supported and Effects log page (Log Identifier 05h) for NVMeOF. This also makes it easier to find which commands are supported, e.g. :- subnqn : testnqn1 Admin Command Set ACS2 [Get Log Page ] 00000001 ACS6 [Identify ] 00000001 ACS8 [Abort ] 00000001 ACS9 [Set Features ] 00000001 ACS10 [Get Features ] 00000001 ACS12 [Asynchronous Event Request ] 00000001 ACS24 [Keep Alive ] 00000001 NVM Command Set IOCS0 [Flush ] 00000001 IOCS1 [Write ] 00000001 IOCS2 [Read ] 00000001 IOCS8 [Write Zeroes ] 00000001 IOCS9 [Dataset Management ] 00000001 This partticular functionality can be used from the host side to examine the NVMeOF ctrl commands supported. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig commit 230f1f9e04e2abee34b1478b3bcc2d947b7cc2a0 Author: James Smart Date: Tue Jun 12 16:28:24 2018 -0700 nvme: move init of keep_alive work item to controller initialization Currently, the code initializes the keep alive work item whenever nvme_start_keep_alive() is called. However, this routine is called several times while reconnecting, etc. Although it's hoped that keep alive is always disabled and not scheduled when start is called, re-initing if it were scheduled or completing can have very bad side effects. There's no need for re-initialization. Move the keep_alive work item and cmd struct initialization to controller init. Signed-off-by: James Smart Signed-off-by: Christoph Hellwig commit 40c6f9c28ef03f2f2c3ee58c2447a6e6b9a713f2 Author: Revanth Rajashekar Date: Fri Jun 15 12:39:27 2018 -0600 nvme.h: resync with nvme-cli Added some feature ids present in nvme-cli but not kernel. Signed-off-by: Revanth Rajashekar Signed-off-by: Christoph Hellwig commit dfef01e150824b0e6da750cacda8958188d29aea Author: Takashi Iwai Date: Thu Jul 19 11:01:04 2018 +0200 ALSA: memalloc: Don't exceed over the requested size snd_dma_alloc_pages_fallback() tries to allocate pages again when the allocation fails with reduced size. But the first try actually *increases* the size to power-of-two, which may give back a larger chunk than the requested size. This confuses the callers, e.g. sgbuf assumes that the size is equal or less, and it may result in a bad loop due to the underflow and eventually lead to Oops. The code of this function seems incorrectly assuming the usage of get_order(). We need to decrease at first, then align to power-of-two. Reported-and-tested-by: he, bo Reported-by: zhang jun Cc: Signed-off-by: Takashi Iwai commit 0a213777d1dd879092225a7aa847b6e9b3a1c267 Author: Benjamin Herrenschmidt Date: Wed Jun 20 15:16:31 2018 +1000 fsi: Add support for device-tree provided chip IDs They get retrieved from the device-tree and exposed as an attribute in sysfs Signed-off-by: Benjamin Herrenschmidt commit e13c542d5227481836e91f7b3a025e2c9092bc04 Author: Benjamin Herrenschmidt Date: Wed Jun 20 15:15:00 2018 +1000 dt-bindings: fsi: Add optional chip-id to CFAMs This represents a physical chip in the system and allows a stable numbering scheme to be passed to udev for userspace to recognize which chip is which. Signed-off-by: Benjamin Herrenschmidt Acked-by: Rob Herring commit 4fcdc2d1b0c615331eb68b50da8e499223fac724 Author: Benjamin Herrenschmidt Date: Mon Jul 23 16:27:21 2018 +1000 fsi: sbefifo: Fix inconsistent use of ffdc mutex Some of the exit path missed the unlock. Move the mutex to an outer function to avoid the problem completely Signed-off-by: Benjamin Herrenschmidt commit 6a794a27daca9c5a39de13c03b0748bb2d4a7a70 Author: Benjamin Herrenschmidt Date: Tue Jun 12 09:55:04 2018 +1000 fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire The Aspeed AST2x00 can contain a ColdFire v1 coprocessor which is currently unused on OpenPower systems. This adds an alternative to the fsi-master-gpio driver that uses that coprocessor instead of bit banging from the ARM core itself. The end result is about 4 times faster. The firmware for the coprocessor and its source code can be found at https://github.com/ozbenh/cf-fsi and is system specific. Signed-off-by: Benjamin Herrenschmidt commit 2be5263c5df45bbd5ad49ea8c394aca6e709d204 Author: Benjamin Herrenschmidt Date: Wed Jun 13 21:28:38 2018 +1000 dt-bindings: fsi: Document binding for the fsi-master-ast-cf "device" This isn't per-se a real device, it's a pseudo-device that represents the use of the Aspeed built-in ColdFire to implement the FSI protocol by bitbanging the GPIOs instead of doing it from the ARM core. Thus it's a drop-in replacement for the existing fsi-master-gpio pseudo-device for use on systems based on the Aspeed chips. It has most of the same properties, plus some more needed to operate the coprocessor. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Rob Herring commit d5e838275c80aeb96d4c0b81442a851dfef2e948 Author: Benjamin Herrenschmidt Date: Tue Jun 5 13:21:26 2018 +1000 devres: Add devm_of_iomap() There are still quite a few cases where a device might want to get to a different node of the device-tree, obtain the resources and map them. We have of_iomap() and of_io_request_and_map() but they both have shortcomings, such as not returning the size of the resource found (which can be useful) and not being "managed". This adds a devm_of_iomap() that provides all of these and should probably replace uses of the above in most drivers. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Linus Walleij Reviewed-by: Joel Stanley commit d5e748ff2b996d83489ac76c072e8b99f9ecef13 Merge: fea9cf321c91 a7ca13826e47 Author: Benjamin Herrenschmidt Date: Mon Jul 23 15:21:39 2018 +1000 Merge remote-tracking branch 'gpio/ib-aspeed' into upstream-ready Merge the GPIO tree "ib-aspeed" topic branch which contains pre-requisites for subsequent changes. This branch is also in gpio "next". commit 0a78c3803d1924845ded22a379b66f897ba647a3 Author: YueHaibing Date: Mon Jul 23 11:16:47 2018 +0800 net: mediatek: use dma_zalloc_coherent instead of allocator/memset Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 8824f62246bef288173a6624a363352f0d4d3b09 Author: Ming Lei Date: Sun Jul 22 14:10:15 2018 +0800 blk-mq: fail the request in case issue failure Inside blk_mq_try_issue_list_directly(), if the request is issued as failed, we shouldn't try to do it again, otherwise the warning in blk_mq_start_request() will be triggered. This change is aligned to behaviour of other ways of request issue & dispatch. Fixes: 6ce3dd6eec1 ("blk-mq: issue directly if hw queue isn't busy in case of 'none'") Cc: Kashyap Desai Cc: Laurence Oberman Cc: Omar Sandoval Cc: Christoph Hellwig Cc: Bart Van Assche Cc: Hannes Reinecke Cc: Kashyap Desai Cc: kernel test robot Cc: LKP Reported-by: kernel test robot Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit cc44ba91166beb78f9cb29d5e3d41c0a2d0a7329 Author: Gustavo A. R. Silva Date: Tue Jul 17 16:47:39 2018 -0500 power: supply: max77693_charger: fix unintentional fall-through It seems that a *break* is missing in order to avoid a fall-through. Otherwise, the calculation of *data* makes no sense. Addresses-Coverity-ID: 1271172 ("Missing break in switch") Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit 37bab356f86b85f3bba85d3c82323a01255902bc Author: Gustavo A. R. Silva Date: Tue Jul 17 16:28:46 2018 -0500 power: supply: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1394724 ("Missing break in switch") Addresses-Coverity-ID: 114958 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Sebastian Reichel commit 9c7272412bc556f6af2a89e0f1660dacb44e3b1d Author: David Lechner Date: Fri Jul 20 15:19:44 2018 -0500 power: supply: lego_ev3_battery: fix Vce offset This fixes the value that accounts for the Vce of a transistor in the LEGO MINDSTORMS EV3 power supply driver. The old value (200mV) was the max value from the data sheet. After testing, the actual value has been found to be 50mV. By using 50mV we get a more accurate voltage indication. Signed-off-by: David Lechner Signed-off-by: Sebastian Reichel commit 6e92cecb1e1b073c0cbd1e0e0f338803e0df1924 Author: David Lechner Date: Fri Jul 20 15:19:43 2018 -0500 power: supply: lego_ev3_battery: Don't ignore iio_read_channel_processed() return value This changes the LEGO MINDSTORMS EV3 power supply driver to return an error if iio_read_channel_processed() fails. Signed-off-by: David Lechner Signed-off-by: Sebastian Reichel commit 0d949905271daed53f1fa3f31db178f987217605 Merge: 89b135ba1b73 efdafd6895b2 Author: Sebastian Reichel Date: Sun Jul 22 23:33:24 2018 +0200 Merge tag 'ds2760-for-v4.19-signed' into psy-next Immutable branch for moving ds2760 driver from w1 to power supply Signed-off-by: Sebastian Reichel commit 3dd0f18c70d94ca2432c78c5735744429f071b0b Author: Wei Yongjun Date: Wed Jul 11 13:28:40 2018 +0000 EVM: fix return value check in evm_write_xattrs() In case of error, the function audit_log_start() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: fa516b66a1bf ("EVM: Allow runtime modification of the set of verified xattrs") Signed-off-by: Wei Yongjun Acked-by: Serge Hallyn Signed-off-by: Mimi Zohar commit 07300f774fec9519663a597987a4083225588be4 Author: Jakub Kicinski Date: Fri Jul 20 21:14:39 2018 -0700 nfp: avoid buffer leak when FW communication fails After device is stopped we reset the rings by moving all free buffers to positions [0, cnt - 2], and clear the position cnt - 1 in the ring. We then proceed to clear the read/write pointers. This means that if we try to reset the ring again the code will assume that the next to fill buffer is at position 0 and swap it with cnt - 1. Since we previously cleared position cnt - 1 it will lead to leaking the first buffer and leaving ring in a bad state. This scenario can only happen if FW communication fails, in which case the ring will never be used again, so the fact it's in a bad state will not be noticed. Buffer leak is the only problem. Don't try to move buffers in the ring if the read/write pointers indicate the ring was never used or have already been reset. nfp_net_clear_config_and_disable() is now fully idempotent. Found by code inspection, FW communication failures are very rare, and reconfiguring a live device is not common either, so it's unlikely anyone has ever noticed the leak. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit 042f8825569d628517784d558aefe23c212f0fb2 Author: Jakub Kicinski Date: Fri Jul 20 21:14:38 2018 -0700 nfp: bring back support for offloading shared blocks Now that we have offload replay infrastructure added by commit 326367427cc0 ("net: sched: call reoffload op on block callback reg") and flows are guaranteed to be removed correctly, we can revert commit 951a8ee6def3 ("nfp: reject binding to shared blocks"). Signed-off-by: Jakub Kicinski Reviewed-by: John Hurley Signed-off-by: David S. Miller commit 22f17952c7873a427e6e4280d723c0f686d75fb9 Author: Josef Bacik Date: Thu Jul 19 21:42:13 2018 -0400 blk-rq-qos: make depth comparisons unsigned With the change to use UINT_MAX I broke the depth check as any value of inflight (ie 0) would be less than (int)UINT_MAX. Fix this by changing everything to unsigned int to match the depth. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 2d408c0d4574b01b9ed45e02516888bf925e11a9 Author: Vitaly Kuznetsov Date: Fri Jul 20 18:33:59 2018 +0200 xen-netfront: fix queue name setting Commit f599c64fdf7d ("xen-netfront: Fix race between device setup and open") changed the initialization order: xennet_create_queues() now happens before we do register_netdev() so using netdev->name in xennet_init_queue() is incorrect, we end up with the following in /proc/interrupts: 60: 139 0 xen-dyn -event eth%d-q0-tx 61: 265 0 xen-dyn -event eth%d-q0-rx 62: 234 0 xen-dyn -event eth%d-q1-tx 63: 1 0 xen-dyn -event eth%d-q1-rx and this looks ugly. Actually, using early netdev name (even when it's already set) is also not ideal: nowadays we tend to rename eth devices and queue name may end up not corresponding to the netdev name. Use nodename from xenbus device for queue naming: this can't change in VM's lifetime. Now /proc/interrupts looks like 62: 202 0 xen-dyn -event device/vif/0-q0-tx 63: 317 0 xen-dyn -event device/vif/0-q0-rx 64: 262 0 xen-dyn -event device/vif/0-q1-tx 65: 17 0 xen-dyn -event device/vif/0-q1-rx Fixes: f599c64fdf7d ("xen-netfront: Fix race between device setup and open") Signed-off-by: Vitaly Kuznetsov Reviewed-by: Ross Lagerwall Signed-off-by: David S. Miller commit be5a8ffa9cdb14833c64a7ef40e76ce7fd265d9f Author: Randy Dunlap Date: Fri Jul 20 09:16:02 2018 -0700 net/dsa/realtek: add MODULE_LICENSE() Add MODULE_LICENSE() to net/dsa/realtek.o to fix build warning message. WARNING: modpost: missing MODULE_LICENSE() in drivers/net/dsa/realtek.o Signed-off-by: Randy Dunlap Cc: Linus Walleij Reviewed-by: Linus Walleij Signed-off-by: David S. Miller commit 5b3df177233ef4413ffc2c1a7647736ba89d4df1 Author: Nikolay Aleksandrov Date: Sun Jul 22 11:37:31 2018 +0300 bonding: don't cast const buf in sysfs store As was recently discussed [1], let's avoid casting the const buf in bonding_sysfs_store_option and use kstrndup/kfree instead. [1] http://lists.openwall.net/netdev/2018/07/22/25 Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit fb42c838b641d3da55dd17d8fa587a6c9c88e5e0 Merge: 0ae0d60a379c 4afb52c2af44 Author: David S. Miller Date: Sun Jul 22 09:43:31 2018 -0700 Merge branch 'TX-used-ring-batched-updating-for-vhost' Jason Wang says: ==================== TX used ring batched updating for vhost This series implement batch updating of used ring for TX. This help to reduce the cache contention on used ring. The idea is first split datacopy path from zerocopy, and do only batching for datacopy. This is because zercopy had already supported its own batching. TX PPS was increased 25.8% and Netperf TCP does not show obvious differences. The split of datapath will also be helpful for future implementation like in order completion. ==================== Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 4afb52c2af44ac761e829d4cd511a20b577959fa Author: Jason Wang Date: Fri Jul 20 08:15:21 2018 +0800 vhost_net: batch update used ring for datacopy TX Like commit e2b3b35eb989 ("vhost_net: batch used ring update in rx"), this patches implements batch used ring update for datacopy TX (zerocopy has already done some kind of batching). Testpmd transmission from guest to host (XDP_DROP on tap) shows 25.8% improvement (from ~3.1Mpps to ~3.9Mpps) on Broadwell i7-5600U CPU @ 2.60GHz machine. Netperf TCP tests does not show obvious differences. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit d0d869718754da534719be32f2c28b1210c3955d Author: Jason Wang Date: Fri Jul 20 08:15:20 2018 +0800 vhost_net: rename VHOST_RX_BATCH to VHOST_NET_BATCH A more generic name which could be used for TX as well. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit 09c3248938c3e3b0ef870c8f1b3f13d6dcbf67ce Author: Jason Wang Date: Fri Jul 20 08:15:19 2018 +0800 vhost_net: rename vhost_rx_signal_used() to vhost_net_signal_used() Rename for reusing this for TX. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit 0d20bdf34dc7d6aeaa04f762be3e313bc4fa1b02 Author: Jason Wang Date: Fri Jul 20 08:15:18 2018 +0800 vhost_net: split out datacopy logic Instead of mixing zerocopy and datacopy logics, this patch tries to split datacopy logic out. This results for a more compact code and ad-hoc optimization could be done on top more easily. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit c92a8a8cb7d499a352ebb625667a780bfc99ba77 Author: Jason Wang Date: Fri Jul 20 08:15:17 2018 +0800 vhost_net: introduce tx_can_batch() Introduce tx_can_batch() to determine whether TX could be batched. This will help to reduce the code duplication in the future. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit a2a91a137ad4e9c538c9b63b2bfcf7a105924143 Author: Jason Wang Date: Fri Jul 20 08:15:16 2018 +0800 vhost_net: introduce get_tx_bufs() Factor out logic of getting tx buffer and iov iter initialization. This will be used for reducing codes duplication in the future. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit 272f35cba53d088085e5952fd81d7a133ab90789 Author: Jason Wang Date: Fri Jul 20 08:15:15 2018 +0800 vhost_net: introduce vhost_exceeds_weight() Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit b0d0ea50e7827b1d71c8ea466ff8b4b358f9548d Author: Jason Wang Date: Fri Jul 20 08:15:14 2018 +0800 vhost_net: introduce helper to initialize tx iov iter Introduce init_iov_iter() in order to be reused by future patch. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit 652e4f3e82a144500f17af772503b6e216441f9f Author: Jason Wang Date: Fri Jul 20 08:15:13 2018 +0800 vhost_net: drop unnecessary parameter Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit eac058068107152ca176ec04c28e84499e596a49 Author: Anand Moon Date: Wed Jul 18 12:59:27 2018 +0000 ARM: dts: exynos: Add missing interrupts for pwm node on Exynos5 Add missing GIC interrupts property for pwm nodes. Signed-off-by: Anand Moon Signed-off-by: Krzysztof Kozlowski commit c4326563d9abe86ad54474f9e9142bd2663eede5 Author: Andy Shevchenko Date: Fri Jul 20 10:47:26 2018 +0900 efivars: Call guid_parse() against guid_t type of variable uuid_le_to_bin() is deprecated API and take into consideration that variable, to where we store parsed data, is type of guid_t we switch to guid_parse() for sake of consistency. While here, add error checking to it. Signed-off-by: Andy Shevchenko Signed-off-by: Ard Biesheuvel Cc: Hans de Goede Cc: Linus Torvalds Cc: Lukas Wunner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-10-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit e8f4194d9b98aa13f9f567a0056bbf683d2b1ab8 Author: Andy Shevchenko Date: Fri Jul 20 10:47:25 2018 +0900 efi/cper: Use consistent types for UUIDs The commit: 2f74f09bce4f ("efi: parse ARM processor error") ... brought inconsistency in UUID types which are used across the CPER. Fix this by moving to use guid_t API everywhere. Signed-off-by: Andy Shevchenko Signed-off-by: Ard Biesheuvel Cc: Hans de Goede Cc: Linus Torvalds Cc: Lukas Wunner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tyler Baicar Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-9-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit aab9593c0cb4454f9d261a8c87a3361f3186c4ec Author: Ard Biesheuvel Date: Fri Jul 20 10:47:24 2018 +0900 efi/x86: Replace references to efi_early->is64 with efi_is_64bit() There are a couple of places in the x86 EFI stub code where we select between 32-bit and 64-bit versions of the support routines based on the value of efi_early->is64. Referencing that field directly is a bad idea, since it prevents the compiler from inferring that this field can never be true on a 32-bit build, and can only become false on a 64-bit build if support for mixed mode is compiled in. This results in dead code to be retained in the uncompressed part of the kernel image, which is wasteful. So switch to the efi_is_64bit() helper, which will resolve to a constant boolean unless building for 64-bit with mixed mode support. Tested-by: Hans de Goede Signed-off-by: Ard Biesheuvel Cc: Andy Shevchenko Cc: Linus Torvalds Cc: Lukas Wunner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-8-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit c4db9c1e8c70bc60e392da8a485bcfb035d559c2 Author: Lukas Wunner Date: Fri Jul 20 10:47:23 2018 +0900 efi: Deduplicate efi_open_volume() There's one ARM, one x86_32 and one x86_64 version of efi_open_volume() which can be folded into a single shared version by masking their differences with the efi_call_proto() macro introduced by commit: 3552fdf29f01 ("efi: Allow bitness-agnostic protocol calls"). To be able to dereference the device_handle attribute from the efi_loaded_image_t table in an arch- and bitness-agnostic manner, introduce the efi_table_attr() macro (which already exists for x86) to arm and arm64. No functional change intended. Signed-off-by: Lukas Wunner Signed-off-by: Ard Biesheuvel Cc: Andy Shevchenko Cc: Hans de Goede Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-7-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 093174f52553532b9eb0e63cbbb254f6990d46d5 Author: Ard Biesheuvel Date: Fri Jul 20 10:47:22 2018 +0900 efi/x86: Add missing NULL initialization in UGA draw protocol discovery The UGA draw protocol discovery routine looks for a EFI handle that has both the UGA draw protocol and the PCI I/O protocol installed. It checks for the latter by calling handle_protocol() and pass it a PCI I/O protocol pointer variable by reference, but fails to initialize it to NULL, which means the non-NULL check later on in the code could produce false positives, given that the return code of the handle_protocol() call is ignored entirely. So add the missing initialization. Tested-by: Hans de Goede Signed-off-by: Ard Biesheuvel Cc: Andy Shevchenko Cc: Linus Torvalds Cc: Lukas Wunner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-6-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 290084c2fa13e9aaa7f856ed1ab30760327dd9f8 Author: Ard Biesheuvel Date: Fri Jul 20 10:47:21 2018 +0900 efi/x86: Merge 32-bit and 64-bit UGA draw protocol setup routines The two versions of setup_uga##() are mostly identical, with the exception of the size of EFI_HANDLE. So let's merge the two, and pull the implementation into the calling function setup_uga(). Note that the 32-bit version was only mixed-mode safe by accident: it only calls the get_mode() method of the UGA draw protocol, which happens to be the first member, and so truncating the 64-bit void* at offset 0 to 32 bits happens to produce the correct value. But let's not rely on that, and use the proper API instead. Tested-by: Hans de Goede Signed-off-by: Ard Biesheuvel Cc: Andy Shevchenko Cc: Linus Torvalds Cc: Lukas Wunner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-5-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 0b767b16d7b634dd62667f224425cef3c78e031c Author: Ard Biesheuvel Date: Fri Jul 20 10:47:20 2018 +0900 efi/x86: Align efi_uga_draw_protocol typedef names to convention The linux-efi subsystem uses typedefs with the _t suffix to declare data structures that originate in the UEFI spec. Our type mangling for mixed mode depends on this convention, so rename the UGA drawing protocols to allow efi_call_proto() to be used with them in a subsequent patch. Tested-by: Hans de Goede Signed-off-by: Ard Biesheuvel Cc: Andy Shevchenko Cc: Linus Torvalds Cc: Lukas Wunner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-4-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 75c5a713ab4b774c7d990ec748dddba714034436 Author: Ard Biesheuvel Date: Fri Jul 20 10:47:19 2018 +0900 efi/x86: Merge the setup_efi_pci32() and setup_efi_pci64() routines After merging the 32-bit and 64-bit versions of the code that invokes the PCI I/O protocol methods to preserve PCI ROM images in commit: 2c3625cb9fa2 ("efi/x86: Fold __setup_efi_pci32() and __setup_efi_pci64() ...") there are still separate code paths for 32-bit and 64-bit, where the only difference is the size of a EFI_HANDLE. So let's parameterize a single implementation for that difference only, and get rid of the two copies of the code. While at it, rename __setup_efi_pci() to preserve_pci_rom_image() to better reflect its purpose. Tested-by: Hans de Goede Signed-off-by: Ard Biesheuvel Cc: Andy Shevchenko Cc: Linus Torvalds Cc: Lukas Wunner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 83a0a2ea0b991927e42984be220329e776ce7137 Author: Ard Biesheuvel Date: Fri Jul 20 10:47:18 2018 +0900 efi/x86: Prevent reentrant firmware calls in mixed mode The UEFI spec does not permit runtime services to be called reentrantly, and so it is up to the OS to provide proper locking around such calls. For the native case, this was fixed a long time ago, but for the mixed mode case, no locking is done whatsoever. Note that the calls are made with preemption and interrupts disabled, so only SMP configurations are affected by this issue. So add a spinlock and grab it when invoking a UEFI runtime service in mixed mode. We will also need to provide non-blocking versions of SetVariable() and QueryVariableInfo(), so add those as well. Tested-by: Hans de Goede Signed-off-by: Ard Biesheuvel Cc: Andy Shevchenko Cc: Linus Torvalds Cc: Lukas Wunner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180720014726.24031-2-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit d10ee9c542365bdc0a7497306e21ff6c7f2172b0 Author: Srikanth K H Date: Fri Jul 20 11:13:51 2018 +0530 ALSA: timer: catch invalid timer object creation A timer object for the classes SNDRV_TIMER_CLASS_CARD and SNDRV_TIMER_CLASS_PCM has to be associated with a card object, but we have no check at creation time. Such a timer object with NULL card causes various unexpected problems, e.g. NULL dereference at reading the sound timer proc file. So as preventive measure while the creating the sound timer object is created the card information availability is checked for the mentioned entries and returned error if its NULL. Signed-off-by: Srikanth K H Signed-off-by: Takashi Iwai commit 0ae0d60a379c11d6f3b11d9b9e8dbdd1fc683a1a Author: Hangbin Liu Date: Fri Jul 20 14:07:42 2018 +0800 multicast: remove useless parameter for group add Remove the mode parameter for igmp/igmp6_group_added as we can get it from first parameter. Fixes: 6e2059b53f988 (ipv4/igmp: init group mode as INCLUDE when join source group) Fixes: c7ea20c9da5b9 (ipv6/mcast: init as INCLUDE when join SSM INCLUDE group) Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit ef32477971b50c1fa11f52f5ed44cfbc98075030 Author: Mark Railton Date: Fri Jul 20 00:11:46 2018 +0100 net: wimax: stack: fixed multi line comment issue Moved end of comment to it's own line per guide Signed-off-by: Mark Railton Signed-off-by: David S. Miller commit b5293443de89460047aad7d94b8e6ff783c29e0c Author: Guenter Roeck Date: Thu Jul 19 09:41:39 2018 -0700 net: phy: sfp: Do not use "imply HWMON" "imply HWMON" was supposed to ensure that the SFP phy code can be built with HWMON enabled or disabled while at the same time ensuring that HWMON is not built as module if SFP is built into the kernel. Unfortunately, that does not work as intended. With "allmodconfig", it results in several unrelated HWMON drivers to be disabled instead of being built as module as expected. Let's use the old "depends on HWMON || HWMON=n" instead. This is slightly different (it enforces SFP to be built as module if HWMON is built as module), but it is better than the alternative of using "IS_REACHABLE()" in the driver since that would disable sensor support if HWMON is built as module and SFP is built into the kernel. Fixes: 1323061a018a ("net: phy: sfp: Add HWMON support for module sensors") Cc: Andrew Lunn Signed-off-by: Guenter Roeck Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 4c303373497015773234e455fafa5c7c6386d19d Author: YueHaibing Date: Thu Jul 19 22:18:27 2018 +0800 libcxgb: replace vmalloc and memset with vzalloc Use vzalloc instead of the vmalloc, memset combo Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit c1907e53ab91495346c2a6fbff92478a6804c9bd Author: YueHaibing Date: Thu Jul 19 21:57:11 2018 +0800 net: hix5hd2_gmac: use dma_zalloc_coherent instead of allocator/memset Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit e064cce130497023806e2ae6a4114f1fed28eacd Author: YueHaibing Date: Thu Jul 19 17:16:59 2018 +0800 tipc: make some functions static Fixes the following sparse warnings: net/tipc/link.c:376:5: warning: symbol 'link_bc_rcv_gap' was not declared. Should it be static? net/tipc/link.c:823:6: warning: symbol 'link_prepare_wakeup' was not declared. Should it be static? net/tipc/link.c:959:6: warning: symbol 'tipc_link_advance_backlog' was not declared. Should it be static? net/tipc/link.c:1009:5: warning: symbol 'tipc_link_retrans' was not declared. Should it be static? net/tipc/monitor.c:687:5: warning: symbol '__tipc_nl_add_monitor_peer' was not declared. Should it be static? net/tipc/group.c:230:20: warning: symbol 'tipc_group_find_member' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit baa2d2b17ee93e2a5b8accc2dd5328db17caf90e Author: Gustavo A. R. Silva Date: Wed Jul 18 23:14:17 2018 -0500 net: sched: use PTR_ERR_OR_ZERO macro in tcf_block_cb_register This line makes up what macro PTR_ERR_OR_ZERO already does. So, make use of PTR_ERR_OR_ZERO rather than an open-code version. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 94dee3861fd2e5bb6a3a3e7fb1585f6802db5012 Merge: f156d3a0b84a d0a064bec75e Author: Olof Johansson Date: Sat Jul 21 15:06:03 2018 -0700 Merge tag 'am654-for-v4.19-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt TI AM654 support for v4.19 merge window This branch adds initial support for new Texas Instruments AM654 quad core A53 ARMv8 SoC. It's the first device for TI K3 multicore SoC architecture. Initially only basic devices are configured, support for more devices will follow later on. And many of the internal devices familiar from earlier TI SoCs should work with existing kernel device drivers. * tag 'am654-for-v4.19-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: arm64: dts: ti: Add support for AM654 EVM base board soc: ti: Add Support for AM654 SoC config option arm64: dts: ti: Add Support for AM654 SoC arm64: Add support for TI's K3 Multicore SoC architecture dt-bindings: arm: ti: Add bindings for AM654 SoC Signed-off-by: Olof Johansson commit 1df88c683ea376a0499e195c2301eb8ce9668b77 Merge: 85a03fe92ce6 69c04aee3482 Author: Olof Johansson Date: Sat Jul 21 15:05:16 2018 -0700 Merge tag 'imx-drivers-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/drivers i.MX drivers update for 4.19: - Handle i.MX6SL chip errata ERR006287 in the safest possible way by keeping the DISP domain always-on, because Upon resuming from power gating, the modules in the display power domain (eLCDIF, EPDC, PXP and SPDC) might fail to perform register reads correctly. - Use GENPD_FLAG_ALWAYS_ON flag for i.MX6QP PU ERR009619 handling. It is functionally identical to the exsiting implementation but simpler and slightly faster. * tag 'imx-drivers-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx6qp: Use GENPD_FLAG_ALWAYS_ON for PU errata soc: imx: gpc: Disable 6sl display power gating for ERR006287 Signed-off-by: Olof Johansson commit 85a03fe92ce654d32442a59807fde2cd9fe177b0 Merge: 472624550507 6b39fd590aeb Author: Olof Johansson Date: Sat Jul 21 15:05:03 2018 -0700 Merge tag 'reset-for-4.19' of git://git.pengutronix.de/git/pza/linux into next/drivers Reset controller changes for v4.19 This adds new drivers and bindings for the SDM845 AOSS (always on subsystem) reset controller and for the Uniphier USB3 core reset. SPI controller resets are added to the Uniphier reset driver. * tag 'reset-for-4.19' of git://git.pengutronix.de/git/pza/linux: reset: uniphier: add reset control support for SPI reset: uniphier: add USB3 core reset control dt-bindings: reset: uniphier: add USB3 core reset support reset: simple: export reset_simple_ops to be referred from modules reset: qcom: AOSS (always on subsystem) reset controller dt-bindings: reset: Add AOSS reset bindings for SDM845 SoCs Signed-off-by: Olof Johansson commit fb5c81931a2be3fabe1db9c38e58c6b6f694c173 Merge: f19446ca1f50 83c05e98f732 Author: Olof Johansson Date: Sat Jul 21 14:58:40 2018 -0700 Merge tag 'renesas-arm64-defconfig-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/defconfig Renesas ARM64 Based SoC Defconfig Updates for v4.19 * Enable BD9571MWV regulator in ARM64 defconfig This is to allow wider testing of the BD9571 PMIC which is present on boards with Renesas R-Car Gen3 SoCs * tag 'renesas-arm64-defconfig-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: arm64: defconfig: Enable BD9571MWV regulator Signed-off-by: Olof Johansson commit f19446ca1f500aebedb37d88e7ced38a12ccb1a3 Merge: 3de0a6b986d5 eaed0291c62f Author: Olof Johansson Date: Sat Jul 21 14:57:14 2018 -0700 Merge tag 'imx-defconfig-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/defconfig i.MX defconfig update for 4.19: - Enable ISL29018 sensor and MMA8452 accelerometer driver support for imx6qdl-sabreauto board. - Enable DMATEST support which is useful for DMA driver development testing. - Use the DRM driver for MXSFB LCD controller found on i.MX23, i.MX28, i.MX6SX and i.MX7 SoCs. * tag 'imx-defconfig-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx_v6_v7_defconfig: add DMATEST support ARM: imx_v6_v7_defconfig: use MXSFB DRM driver ARM: mxs_defconfig: use MXSFB DRM driver ARM: imx_v6_v7_defconfig: Enable imx6qdl-sabreauto sensors Signed-off-by: Olof Johansson commit f156d3a0b84afcb37570b8a0789202fc2b5df607 Merge: 278b1c8e0840 346f5976cc32 Author: Olof Johansson Date: Sat Jul 21 14:56:39 2018 -0700 Merge tag 'imx-dt64-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt Freescale arm64 device tree update for 4.19: - Update device tree sources to use SPDX identifiers for license. - Add cooling device property '#cooling-cells' for all CPUs of a cluster. * tag 'imx-dt64-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: freescale: Add missing cooling device properties for CPUs arm64: dts: freescale: Update to use SPDX identifiers Signed-off-by: Olof Johansson commit 278b1c8e0840afc4844fcc128573b75978efea74 Merge: 3c34a84544c2 33a8d5a595dd Author: Olof Johansson Date: Sat Jul 21 14:55:45 2018 -0700 Merge tag 'imx-dt-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt i.MX device tree update for 4.19: - Add device tree support for i.MX6SLL SoC. - New board support: ConnectCore 6UL System-On-Module and SBC Express; ZII SCU2 Mezz, SCU3 ESB, SSMB SPU3 and CFU1 board; i.MX6SLL EVK board; Engicam i.CoreM6 1.5 Quad/Dual MIPI; LogicPD MX31Lite board; i.MX53 HSC/DDC boards from K+P. - Remove fake regulator bus container node and enable USB OTG support for i.MX6 wandboard and riotboard. - Populate RAVE SP EEPROM, backlight, power button and watchdog devices for ZII boards. - Add cooling-cells for cpufreq cooling device, and add OPP properties for all CPUs. - A series from Anson Huang to enable LCD panel and backlight support for imx6sll-evk board. - Make pfuze100 sw4 regulator always-on for for a few Freescale/NXP development boards, because the regulator is critical there and cannot be turned off. - Add more device support for i.MX5: AIPSTZ, SAHARA Crypto, M4IF, Tigerp, PMU, CodaHx4 VPU. - Enable PMU secure-reg-access for imx51-babbage, imx51-zii-rdu1 and imx53-ppd board. - Switch more device tree license to use SPDX identifier. - Switch to use OF graph to describe the display for imx7d-nitrogen7. - Add chosen/stdout-path for more boards, so that earlycon can be enabled more easily on kernel cmdline. - Convert GPC to new device tree bindings and add Vivante gpu nodes for i.MX6SL SoC. - Add more device support for imx6dl-mamoj board: parallel display, WiFi and USB. - A series from Stefan Agner to update i.MX6 apalis/colibri boards on various aspects: SD/MMC card detection, regulators, etc. * tag 'imx-dt-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (96 commits) ARM: dts: imx7d: remove "operating-points" property for cpu1 ARM: dts: vf610-zii-ssmb-spu3: Fix W=1 level warnings ARM: dts: vf610: Add ZII CFU1 board ARM: dts: imx6dl-mamoj: Add usb host and device support ARM: dts: imx6dl-mamoj: Add Wifi support ARM: dts: imx6dl-mamoj: Add parallel display support ARM: dts: vf610: Add ZII SSMB SPU3 board ARM: dts: imx6ul-pico-hobbit: Do not hardcode the memory size ARM: dts: imx6sl-evk: make pfuze100 sw4 always on ARM: dts: imx6sll-evk: make pfuze100 sw4 always on ARM: dts: imx6sx-sdb-reva: make pfuze100 sw4 always on ARM: dts: imx6qdl-sabresd: make pfuze100 sw4 always on ARM: dts: imx6sl-evk: add missing GPIO iomux setting ARM: dts: imx51-zii-scu3-esb: Fix RAVE SP watchdog compatible string ARM: dts: imx51-zii-scu3-esb: Add switch IRQ line pinumx config ARM: dts: imx6sx-nitrogen6sx: remove obsolete display configuration ARM: dts: imx7d-nitrogen7: use OF graph to describe the display ARM: dts: imx: Switch Boundary Devices boards to SPDX identifier ARM: dts: imx6sl: Add vivante gpu nodes ARM: dts: imx6sll-evk: enable SEIKO 43WVF1G lcdif panel ... Signed-off-by: Olof Johansson commit 3c34a84544c2c21dcd918cee59d317cedc7f5f7c Merge: 88657e9012fa bc36b2aac4f5 Author: Olof Johansson Date: Sat Jul 21 14:54:42 2018 -0700 Merge tag 'imx-dt-clkdep-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt i.MX device tree changes with clock dependency: - Add clock for i.MX6UL GPIO blocks * tag 'imx-dt-clkdep-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: dts: imx6ul: add GPIO clocks clk: imx6ul: remove clks_init_on array clk: imx6ul: add GPIO clock gates dt-bindings: clock: imx6ul: Do not change the clock definition order Signed-off-by: Olof Johansson commit 88657e9012fa907252512cfc8bd289da0ea599eb Merge: 2ec46892382a 89803e8b2656 Author: Olof Johansson Date: Sat Jul 21 14:49:25 2018 -0700 Merge tag 'amlogic-dt64-1' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/dt Amlogic 64-bit DT updates for v4.19 - new SoC: S805x - new board: S805x-based P241 board from Amlogic - AXG: add ADC support w/buttons, add pins for PDM, SPDIF - AXG: s400 board: preliminary support for audio - GX: nanopi-k2: add HDMI, CEC, CVBS support * tag 'amlogic-dt64-1' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: ARM64: dts: meson-axg: add pdm pins ARM64: dts: meson-axg: add spdif input pins ARM64: dts: meson-axg: remove spdif out from gpio a7 ARM64: dts: meson-axg: add adc buttons the S400 ARM64: dts: meson-axg: remove vddio_ao18 from SoC dtsi ARM64: dts: meson-axg: add saradc support ARM64: dts: add S805X based P241 board dt-bindings: amlogic: Add support for GXL S805X and the P241 board ARM64: dts: amlogic: Add missing cooling device properties for CPUs ARM64: dts: meson-axg: add spdif output pins ARM64: dts: meson-axg: add s400 speaker amplifier ARM64: dts: meson-axg: add s400 main 12v supply ARM64: dts: meson-axg: add s400 microphone card leds ARM64: dts: meson-gxbb-nanopi-k2: Add HDMI, CEC and CVBS nodes ARM64: dts: meson-gx-p23x-q20x: move the wifi node to each board's .dts ARM64: dts: meson: enable the saradc node in meson-gx-p23x-q20x.dtsi Signed-off-by: Olof Johansson commit 2ec46892382a82c232cc1e3efcd26b5b9dd95306 Merge: 1bf935046003 a7eaad7f7517 Author: Olof Johansson Date: Sat Jul 21 14:48:09 2018 -0700 Merge tag 'renesas-dt-bindings-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt Renesas ARM Based SoC DT Bindings Updates for v4.19 Bindings relating to initial support for RZ/N1D (R9A06G032) SoC and its RZN1D-DB board: * Add Renesas R9A06G032 SMP enable method * Document SoC and Board bindings * tag 'renesas-dt-bindings-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: dt-bindings: cpu: Add Renesas R9A06G032 SMP enable method. dt-bindings: arm: Document the RZN1D-DB board Signed-off-by: Olof Johansson commit 1bf935046003de32cd6bbc5f7457b83e35cb0dfe Merge: d15d9e323cd4 9a6c158f62cc Author: Olof Johansson Date: Sat Jul 21 14:35:40 2018 -0700 Merge tag 'renesas-arm64-dt2-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt Second Round of Renesas ARM64 Based SoC DT Updates for v4.19 Corrections: * Remove non-existing STBE region from Ether-AVB node in DT of R-Car E3 (r8a77990) SoC Cleanups: * Consistently use rwdt as label for Renesas Watchdog Timer devices * Add second port to rcar_sound placeholder in DT of R-Car M3-N (r8a77965) SoC * Fix adv7482 decimal unit addresses in DT of Salvator-X and -XS boards Enhancements: * Describe in DT: - INTC-EX of R-Car V3H (r8a77980) SoC - USB3.0 of R-Car E3 (r8a77980) SoC - All SCIF and HSCIF devices of R-Car D3 (r8a77995) SoC. Previously only SCIF2, used as the debug consile, was described. - All IPMMU devicesof R-Car M3-N (r8a77965), V3H (r8a77980) and E3 (r8a77990) SoCs * Enable USB3.0 in DT of R-Car E3 (r8a77980) based Ebisu board * Prefer HSCIF1 over SCIF1 in DT of Salvator-X and -XS boards * tag 'renesas-arm64-dt2-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: arm64: dts: renesas: r8a77980: add INTC-EX support arm64: dts: renesas: r8a77990: Enable USB3.0 host for Ebisu board arm64: dts: renesas: r8a77995: Add SCIF {0,1,3,4,5} and all HSCIF device nodes arm64: dts: renesas: r8a779{65,80,90}: Add IPMMU devices nodes arm64: dts: renesas: Unify the labels for RWDT arm64: dts: renesas: salvator-common: Prefer HSCIF1 over SCIF1 arm64: dts: renesas: r8a77965: Add second port to rcar_sound placeholder arm64: dts: renesas: salvator-common: Fix adv7482 decimal unit addresses arm64: dts: renesas: r8a77990: Remove non-existing STBE region Signed-off-by: Olof Johansson commit d15d9e323cd4c6418efab83d2d83ea99e31e9dee Merge: 945d00478831 c8cbc1c20c29 Author: Olof Johansson Date: Sat Jul 21 14:30:08 2018 -0700 Merge tag 'at91-ab-4.19-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux into next/dt AT91 DT for 4.19: - New boards from Laird: WB45N, WB50N, SOM60 modules and DVK, Gatwick - fix the PMC compatibles * tag 'at91-ab-4.19-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: ARM: dts: at91: fix typos for SSC TD functions ARM: dts: add support for Laird SOM60 module and DVK boards ARM: dts: add support for Gatwick board based on WB50N ARM: dts: add support for Laird WB50N cpu module and DVK ARM: dts: add support for Laird WB45N cpu module and DVK ARM: dts: at91: add labels to soc dtsi for derivative boards dt-bindings: add laird and giantec vendor prefix ARM: dts: fix PMC compatible ARM: at91: fix USB clock detection handling dt-bindings: clk: at91: Document all the PMC compatibles dt-bindings: arm: remove PMC bindings Signed-off-by: Olof Johansson commit 945d004788319fb5863de3b2e4831064902dd10c Author: Viresh Kumar Date: Fri Jul 20 18:11:50 2018 +0800 ARM: dts: berlin: Add missing OPP properties for CPUs The OPP properties, like "operating-points", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can create an OPP table. Add such missing properties. Fix other missing properties (clocks, clock latency) as well to make it all work. Signed-off-by: Viresh Kumar Signed-off-by: Jisheng Zhang Signed-off-by: Olof Johansson commit 4d4ef9c422904b3057cd443999decd17b5b3e398 Merge: 4fc116f395e4 4d4585c21f53 Author: Olof Johansson Date: Sat Jul 21 14:28:31 2018 -0700 Merge tag 'hisi-arm64-dt-for-4.19v2' of git://github.com/hisilicon/linux-hisi into next/dt ARM64: DT: Hisilicon SoC DT updates for 4.19v2 - Tidy up MMC properties for hi3660 - Remove keep-power-in-suspend on hikey and hikey960 to avoid keeping wifi power during suspend and let the user enable it if required - Update idle states for hikey960 - Add missing cooling device properties for cpus on hi6220 * tag 'hisi-arm64-dt-for-4.19v2' of git://github.com/hisilicon/linux-hisi: arm64: dts: hisilicon: Add missing cooling device properties for CPUs arm64: hikey960: update idle-states arm64: dts: hikey: Remove keep-power-in-suspend property arm64: dts: hikey960: Remove keep-power-in-suspend property arm64: dts: hikey960: Clean up MMC properties and move to proper file arm64: dts: hikey960: Remove deprecated MMC properties Signed-off-by: Olof Johansson commit 4fc116f395e4ee4bf5ecc17c70478f5c8af31b3f Merge: b68f95a5ecf2 9153bf9fb529 Author: Olof Johansson Date: Sat Jul 21 14:27:56 2018 -0700 Merge tag 'zynq-dt-for-v4.19-v2' of https://github.com/Xilinx/linux-xlnx into next/dt ARM: dts: zynq: DT changes for v4.19 - Add Z-turn board - Add mmc aliases - Fix model information - Sort out documentatio - Update Zybo Z7 - Fix gpio-keys * tag 'zynq-dt-for-v4.19-v2' of https://github.com/Xilinx/linux-xlnx: ARM: dts: zynq: Remove #address/#size-cells from gpio-keys ARM: dts: zynq: Add LEDs to the Zybo Z7 board ARM: dts: zynq: Use gpio constants for the Zybo Z7 board ARM: dts: zynq: Fix memory size on the Zybo Z7 board dt-bindings: xilinx: zynq: Add missing boards dt-bindings: xilinx: zynq: Move Paralella board to Xilinx dt-bindings: xilinx: zynq: Sort entries alphabetically dt-bindings: xilinx: zynq: Improve boards description ARM: dts: zynq: correct and improve the model property of dt files ARM: dts: zynq: Set correct manufacturer for ZedBoard and MicroZed boards ARM: dts: zynq: Add mmc alias for zc702/zc706/zed/zybo ARM: dts: zynq: Add support for Z-turn board Signed-off-by: Olof Johansson commit b68f95a5ecf296246bc5940c7597c3300d574137 Merge: 7f502f8b3409 41ee3e388305 Author: Olof Johansson Date: Sat Jul 21 14:27:26 2018 -0700 Merge tag 'zynqmp-dt-for-v4.19-v2' of https://github.com/Xilinx/linux-xlnx into next/dt arm: dts: zynqmp: DT changes for v4.19 - Use serdev for BT in zcu100 - Remove ep108 - Fix gpio-keys binding - Add suport for Ultra96 * tag 'zynqmp-dt-for-v4.19-v2' of https://github.com/Xilinx/linux-xlnx: arm64: dts: zynqmp: Add support for Avnet Ultra96 rev1 board arm64: dts: zynqmp: Remove #address/#size-cells from gpio-keys arm64: dts: zynqmp: Remove ep108 board arm64: dts: zynqmp: Use serdev for zcu100 BT Signed-off-by: Olof Johansson commit 7f502f8b34091565ec3cd7d4255f10623f99c616 Merge: 952a6f1326f2 1470075d5e35 Author: Olof Johansson Date: Sat Jul 21 14:26:49 2018 -0700 Merge tag 'uniphier-dt64-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into next/dt UniPhier ARM64 SoC DT updates for v4.19 - Add missing #cooling-cells properties - Add hp-det-gpio property to detect headphone via GPIO * tag 'uniphier-dt64-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier: arm64: dts: uniphier: add headphone detect gpio for LD11 global board arm64: dts: uniphier: add headphone detect gpio for LD20 global board arm64: dts: uniphier: Add missing cooling device properties for CPUs Signed-off-by: Olof Johansson commit 952a6f1326f2add1451383c9bbb694959ed66150 Merge: 3f0213de1170 38dc27c85e64 Author: Olof Johansson Date: Sat Jul 21 14:26:15 2018 -0700 Merge tag 'uniphier-dt-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into next/dt UniPhier ARM SoC DT updates for v4.19 - Add missing #cooling-cells properties * tag 'uniphier-dt-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier: ARM: dts: uniphier: Add missing cooling device properties for CPUs Signed-off-by: Olof Johansson commit 3f0213de1170943be5bc5113a9e7b6e6d6affba1 Merge: f54440e41b62 91f6278bfa39 Author: Olof Johansson Date: Sat Jul 21 14:25:39 2018 -0700 Merge tag 'omap-for-v4.19/dt-pt2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt Few more beaglebone variants for v4.19 merge window This adds dts files for two new beaglebone variants for Octavo Systems OSD3358-SM-RED and Sancloud am335x-sancloud-bbe. * tag 'omap-for-v4.19/dt-pt2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: am335x: add am335x-sancloud-bbe board support dt-bindings: Add vendor prefix for Sancloud ARM: dts: Add DT support for Octavo Systems OSD3358-SM-RED based on TI AM335x Signed-off-by: Olof Johansson commit f0ad84123011d845baa7eea621d1fb21ae88cf73 Merge: b598b3aaf9ad 26b754f99402 Author: Olof Johansson Date: Sat Jul 21 14:21:03 2018 -0700 Merge tag 'imx-soc-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc i.MX SoC update for 4.19: - A series from Anson Huang to add power management for i.MX6SLL, including standby and mem mode suspend, cpuidle support, and bus clock auto gating function, etc. - A couple of fix-ups on i.MX6SLL cpuidle random build issues. - A couple of cleanups on stale EPIT timer initialization and RNGA platform device registration function. - Configure i.MX51 SoC M4IF to avoid visual artifacts during video playback. - Set up i.MX51 and i.MX53 DBGEN bit of ARM_GPC register, so that clocks within the debug system can be activated. - Add a Cortex-M4 platform support which will be useful for running a Linux instance on Cortex-M4 core integrated in i.MX7D SoC. - Flag of_iomap failure in imx_aips_allow_unprivileged_access() function by giving a warning in there. * tag 'imx-soc-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: mx5: Set the DBGEN bit in ARM_GPC register ARM: imx51: Configure M4IF to avoid visual artifacts ARM: imx: call imx6sx_cpuidle_init() conditionally for 6sll ARM: imx: fix i.MX6SLL build ARM: imx: flag failure of of_iomap ARM: i.MX31: remove rnga registration as a platform device ARM: imx: Provide support for NXP i.MX7D Cortex-M4 ARM: imx: enable bus auto clock gating function for i.mx6sll ARM: imx: remove i.MX6SLL support in i.MX6SL cpu idle driver ARM: imx: add cpu idle support for i.MX6SLL ARM: imx: add L2 page power control for GPC ARM: imx: add mem mode suspend for i.MX6SLL ARM: imx: add standby mode suspend for i.MX6SLL ARM: imx: remove inexistant EPIT timer init Signed-off-by: Olof Johansson commit b598b3aaf9ad2871d215295055c266e87cc501e4 Merge: 10567c49b974 54f464e0c91f Author: Olof Johansson Date: Sat Jul 21 14:19:37 2018 -0700 Merge tag 'renesas-arm-soc2-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc Second Round of Renesas ARM Based SoC Updates for v4.19 * Always enable ARCH_TIMER on SoCs with A7 or A15 All such SoCs have ARCH_TIMER so there is no need for it to be optional. This allows clean-up which is included in this change. * Do not compile r8a7779_platform_cpu_kill when it is unused This avoids a warning by shuffling code into an existing #ifdef r8a7779 is the R-Car H1 SoC * Add SMP enabler driver for the RZ/N1D (r9a06g032) SoC This is to allow SMP to be enabled via DT on the r9a06g032 * Stop compiling headsmp-apmu for non-SMP configs This is a minor clean-up allowing removal of an #ifdef * tag 'renesas-arm-soc2-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: Always enable ARCH_TIMER on SoCs with A7 and/or A15 ARM: shmobile: r8a7779: hide unused r8a7779_platform_cpu_kill soc: r9a06g032: don't build SMP files for non-SMP config ARM: shmobile: Add the R9A06G032 SMP enabler driver ARM: shmobile: rcar-gen2: Stop compiling headsmp-apmu on !SMP Signed-off-by: Olof Johansson commit 10567c49b974766c279c81af8ceb507f5ce700bf Merge: 484a033bf07a d7484f5c6b3b Author: Olof Johansson Date: Sat Jul 21 14:18:29 2018 -0700 Merge tag 'at91-ab-4.19-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux into next/soc AT91 SoC for 4.19: - New low power mode for sama5d2: ULP1 * tag 'at91-ab-4.19-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: ARM: at91: pm: configure wakeup sources for ULP1 mode ARM: at91: pm: add PMC fast startup registers defines ARM: at91: pm: Add ULP1 mode support ARM: at91: pm: Use ULP0 naming instead of slow clock MAINTAINERS: Remove the AT91 clk driver entry Signed-off-by: Olof Johansson commit b0c28f2765813e816740028dd85e64e46eee15a0 Author: Viresh Kumar Date: Fri May 25 16:02:00 2018 +0530 ARM: dts: qcom: Add missing OPP properties for CPUs The OPP properties, like "operating-points", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can create an OPP table. Add such missing properties. Fix other missing property (clock latency) as well to make it all work. Signed-off-by: Viresh Kumar Reviewed-by: Amit Kucheria Signed-off-by: Andy Gross commit 484a033bf07a83274377afda1ad4a5cdc6235c80 Merge: 07167d8a4ec8 d396cb185c03 Author: Olof Johansson Date: Sat Jul 21 14:16:18 2018 -0700 Merge tag 'hisi-armv7-soc-for-4.19' of git://github.com/hisilicon/linux-hisi into next/soc ARM: mach-hisi: Hisilicon SoC updates for 4.19 - check of_iomap and add missing of_node_put since of_find_compatible_node is invoked on hisilicon SoCs like hip01, hix5hd2 and hi3xxx. * tag 'hisi-armv7-soc-for-4.19' of git://github.com/hisilicon/linux-hisi: ARM: hisi: handle of_iomap and fix missing of_node_put ARM: hisi: check of_iomap and fix missing of_node_put ARM: hisi: fix error handling and missing of_node_put Signed-off-by: Olof Johansson commit e53db018315b7660bb7000a29e79faff2496c2c2 Author: Loic Poulain Date: Wed Jul 11 14:18:23 2018 +0200 arm64: dts: qcom: db410c: Fix Bluetooth LED trigger Current LED trigger, 'bt', is not known/used by any existing driver. Fix this by renaming it to 'bluetooth-power' trigger which is controlled by the Bluetooth subsystem. Fixes: 9943230c8860 ("arm64: dts: qcom: Add apq8016-sbc board LED's related device nodes") Signed-off-by: Loic Poulain Signed-off-by: Andy Gross commit 499ff1165df172c6da56ff2dccfec0a58dfaf7b3 Author: Douglas Anderson Date: Fri Jun 29 11:45:27 2018 -0700 arm64: dts: sdm845: Default qupv3_id_0 as "disabled" like _id_1 In commit 8e4947ee477d ("arm64: dts: qcom: sdm845: Add I2C, SPI, and UART9 nodes") I accidentally forgot to add the line: status = "disabled"; to qupv3_id_0 to match qupv3_id_1. Add it now. NOTE: right now the only sdm845 board with a device tree in mainline is MTP and that board currently doesn't have any peripherals under qupv3_id_0. If any board was currently using peripherals under qupv3_id_0 then that board would need to add this snippet to their board dts file: &qupv3_id_0 { status = "okay"; }; Signed-off-by: Douglas Anderson Signed-off-by: Andy Gross commit 619205235098064141e1e76eb8aa3d9048b4a84a Author: Niklas Cassel Date: Thu Jul 19 13:12:34 2018 +0200 arm64: dts: msm8916: drop legacy suffix for clocks used by MSM DRM driver Drop legacy suffix for clocks used by MSM DRM driver. The _clk suffix has been deprecated since commit 20c3bb80235 ("drm/msm: drop _clk suffix from clk names"). Fixes: 720c3bb80235 (drm/msm: drop _clk suffix from clk names) The following warnings during boot have been seen since the referenced fixes commit: msm_dsi_phy 1a98300.dsi-phy: Using legacy clk name binding. Use "iface" instead of "iface_clk" msm 1a00000.mdss: Using legacy clk name binding. Use "iface" instead of "iface_clk" msm 1a00000.mdss: Using legacy clk name binding. Use "bus" instead of "bus_clk" msm 1a00000.mdss: Using legacy clk name binding. Use "vsync" instead of "vsync_clk" msm_mdp 1a01000.mdp: Using legacy clk name binding. Use "bus" instead of "bus_clk" msm_mdp 1a01000.mdp: Using legacy clk name binding. Use "iface" instead of "iface_clk" msm_mdp 1a01000.mdp: Using legacy clk name binding. Use "core" instead of "core_clk" msm_mdp 1a01000.mdp: Using legacy clk name binding. Use "vsync" instead of "vsync_clk" msm_dsi 1a98000.dsi: Using legacy clk name binding. Use "mdp_core" instead of "mdp_core_clk" msm_dsi 1a98000.dsi: Using legacy clk name binding. Use "iface" instead of "iface_clk" msm_dsi 1a98000.dsi: Using legacy clk name binding. Use "bus" instead of "bus_clk" msm_dsi 1a98000.dsi: Using legacy clk name binding. Use "byte" instead of "byte_clk" msm_dsi 1a98000.dsi: Using legacy clk name binding. Use "pixel" instead of "pixel_clk" msm_dsi 1a98000.dsi: Using legacy clk name binding. Use "core" instead of "core_clk" Signed-off-by: Niklas Cassel Reviewed-by: Nicolas Dechesne Signed-off-by: Andy Gross commit f8120d61ceb7c016e5a450a98b8d08ae69d82e22 Author: Abhishek Sahu Date: Fri Jul 6 14:50:30 2018 +0530 arm64: defconfig: Enable CONFIG_MTD_NAND_QCOM for IPQ8074 QCOM IPQ8074 boards contain NAND flash memory for which this config needs to be enabled. Signed-off-by: Abhishek Sahu Signed-off-by: Andy Gross commit c5d0cad11d3ec1c1810dfb69a6fc3ae6339b2fb6 Author: Abhishek Sahu Date: Fri Jul 6 14:44:16 2018 +0530 ARM: qcom_defconfig: Enable QCOM NAND related configs IPQ8064 and IPQ4019 boards contain NAND flash memory for which these configs need to be enabled. Signed-off-by: Abhishek Sahu Signed-off-by: Andy Gross commit 03864e57770a9541e7ff3990bacf2d9a2fffcd5d Author: Bhushan Shah Date: Mon Jul 9 14:46:28 2018 +0530 ARM: dts: qcom: msm8974-hammerhead: increase load on l20 for sdhci The kernel would not boot on the hammerhead hardware due to the following error: mmc0: Timeout waiting for hardware interrupt. mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== mmc0: sdhci: Sys addr: 0x00000200 | Version: 0x00003802 mmc0: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000200 mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000023 mmc0: sdhci: Present: 0x03e80000 | Host ctl: 0x00000034 mmc0: sdhci: Power: 0x00000001 | Blk gap: 0x00000000 mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007 mmc0: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 mmc0: sdhci: Int enab: 0x02ff900b | Sig enab: 0x02ff100b mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000 mmc0: sdhci: Caps: 0x642dc8b2 | Caps_1: 0x00008007 mmc0: sdhci: Cmd: 0x00000c1b | Max curr: 0x00000000 mmc0: sdhci: Resp[0]: 0x00000c00 | Resp[1]: 0x00000000 mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 mmc0: sdhci: Host ctl2: 0x00000008 mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x70040220 mmc0: sdhci: ============================================ mmc0: Card stuck in wrong state! mmcblk0 card_busy_detect status: 0xe00 mmc0: cache flush error -110 mmc0: Reset 0x1 never completed. This patch increases the load on l20 to 0.2 amps for the sdhci and allows the device to boot normally. Signed-off-by: Bhushan Shah Signed-off-by: Brian Masney Suggested-by: Bjorn Andersson Tested-by: Brian Masney Signed-off-by: Andy Gross commit eea7f21b1e2dc0c0ea5e9719b1b31320661d5dfe Author: Sricharan R Date: Wed Jun 20 14:53:39 2018 +0530 ARM: dts: qcom: Fix 'interrupts = <>' property to use proper macros Fix all nodes to use proper GIC_* macros for the interrupt type and the interrupt trigger settings to avoid the boot warnings. Signed-off-by: Sricharan R Tested-by: Abhishek Sahu Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit 78ee559d7fc65e37670a46cfbeaaa62cb014af67 Author: Johan Hovold Date: Tue Jun 12 14:41:41 2018 +0200 soc: qcom: rmtfs-mem: fix memleak in probe error paths Make sure to set the mem device release callback before calling put_device() in a couple of probe error paths so that the containing object also gets freed. Fixes: d1de6d6c639b ("soc: qcom: Remote filesystem memory driver") Cc: stable # 4.15 Cc: Bjorn Andersson Signed-off-by: Johan Hovold Signed-off-by: Andy Gross commit 4da3b0452bc66af8feca71b176668faf3d0e750d Author: Niklas Cassel Date: Fri Jun 29 17:44:47 2018 +0200 soc: qcom: llc-slice: Add missing MODULE_LICENSE() Add missing MODULE_LICENSE(). According to the SPDX-License-Identifier, the license is GPL v2. Fixes the following warning: WARNING: modpost: missing MODULE_LICENSE() in drivers/soc/qcom/llcc-slice.o Fixes: a3134fb ("drivers: soc: Add LLCC driver") Signed-off-by: Niklas Cassel Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit f63d609b602b7123778a304483c04430f082dd63 Author: Manivannan Sadhasivam Date: Wed Apr 18 19:16:01 2018 +0530 arm64: dts: qcom: db820c: Add gpio-line-names property Add gpio-line-names property for Dragonboard820c based on APQ8096 SoC. There are 4 gpio-controllers present on this board, including the APQ8096 SoC, PM8994 (GPIO and MPP) and PMI8994 (GPIO). Lines names are derived from 96Boards CE Specification 1.0, Appendix "Expansion Connector Signal Description". Line names for PMI8994 MPP pins are not added due to the absence of the gpio-controller support. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Andy Gross commit 6c805adf17d491ea66d3cf80db3ada75b7180268 Author: Raju P.L.S.S.S.N Date: Fri Jul 13 19:15:46 2018 +0530 drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type() The patch fixes the bug reported by Dan Carpenter. It removes the unnecessary err check for ‘tcs’ reported by static checker warning: drivers/soc/qcom/rpmh-rsc.c:111 tcs_invalidate() warn: 'tcs' isn't an ERR_PTR See also: drivers/soc/qcom/rpmh-rsc.c:178 get_tcs_for_msg() warn: 'tcs' isn't an ERR_PTR drivers/soc/qcom/rpmh-rsc.c:180 get_tcs_for_msg() warn: 'tcs' isn't an ERR_PTR https://www.spinics.net/lists/linux-soc/msg04624.html Fixes: 9a3afcf ("drivers: qcom: rpmh-rsc: allow invalidation of sleep/wake TCS") Reported-by: Dan Carpenter Signed-off-by: Raju P.L.S.S.S.N Reviewed-by: Lina Iyer Signed-off-by: Andy Gross commit efa1c257b3fc7ef2a1db604b260784cc8bcdfd23 Author: Raju P.L.S.S.S.N Date: Thu Jul 19 12:43:02 2018 +0530 drivers: qcom: rpmh-rsc: fix the loop index check in get_req_from_tcs get_req_from_tcs introduced in patch[1] returns tcs_request from tcs_group. The size of tcs (of type - tcs_group) array in rsc_drv is TCS_TYPE_NR. So the loop index needs to be iterated up to TCS_TYPE_NR only. [1] https://patchwork.kernel.org/patch/10477547/ Signed-off-by: Raju P.L.S.S.S.N Signed-off-by: Andy Gross commit a0b1561f846191a1967e8f5a26d8ef59c1b9162a Author: Niklas Cassel Date: Tue Jun 12 15:23:13 2018 +0200 firmware: qcom: scm: add a dummy qcom_scm_assign_mem() Add a dummy qcom_scm_assign_mem() to enable building drivers when CONFIG_COMPILE_TEST=y && CONFIG_QCOM_SCM=n. All other qcom_scm_* functions already have a dummy version. Signed-off-by: Niklas Cassel Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit fdd102b52cfd9aa34b078b2b6f1a9aeafef04537 Author: Douglas Anderson Date: Mon Jun 18 11:36:52 2018 -0700 drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children Children of RPMh will need access to cmd_db. Rather than having each child have code to check if cmd_db is ready let's add the check to RPMh. With this we'll be able to remove this boilerplate code from clk-rpmh.c and qcom-rpmh-regulator.c. Neither of these files has landed upstream yet but patches are pretty far along. === This code is based upon v11 of Lina and Raju's RPMh series. Suggested-by: Stephen Boyd Signed-off-by: Douglas Anderson Acked-by: Lina Iyer Signed-off-by: Andy Gross commit 2de4b8d33eab86a6d9653041f8543f6f5f882a25 Author: Lina Iyer Date: Wed Jun 20 18:57:07 2018 +0530 drivers: qcom: rpmh-rsc: allow active requests from wake TCS Some RSCs may only have sleep and wake TCS, i.e, there is no dedicated TCS for active mode request, but drivers may still want to make active requests from these RSCs. In such cases re-purpose the wake TCS to send active state requests. The requirement for this is that the driver is aware that the wake TCS is being repurposed to send active request, hence the sleep and wake TCSes be invalidated before the active request is sent. Signed-off-by: Lina Iyer Signed-off-by: Raju P.L.S.S.S.N Reviewed-by: Matthias Kaehlcke Signed-off-by: Andy Gross commit c8790cb6da58d3fa09dfa707aa486fe6769c23bc Author: Lina Iyer Date: Wed Jun 20 18:57:06 2018 +0530 drivers: qcom: rpmh: add support for batch RPMH request Platform drivers need make a lot of resource state requests at the same time, say, at the start or end of an usecase. It can be quite inefficient to send each request separately. Instead they can give the RPMH library a batch of requests to be sent and wait on the whole transaction to be complete. rpmh_write_batch() is a blocking call that can be used to send multiple RPMH command sets. Each RPMH command set is set asynchronously and the API blocks until all the command sets are complete and receive their tx_done callbacks. Signed-off-by: Lina Iyer Signed-off-by: Raju P.L.S.S.S.N Reviewed-by: Matthias Kaehlcke Signed-off-by: Andy Gross commit 564b5e24ccd4c840a7f84dfd952e5715dd9b3966 Author: Lina Iyer Date: Wed Jun 20 18:57:05 2018 +0530 drivers: qcom: rpmh: allow requests to be sent asynchronously Platform drivers that want to send a request but do not want to block until the RPMH request completes have now a new API - rpmh_write_async(). The API allocates memory and send the requests and returns the control back to the platform driver. The tx_done callback from the controller is handled in the context of the controller's thread and frees the allocated memory. This API allows RPMH requests from atomic contexts as well. Signed-off-by: Lina Iyer Signed-off-by: Raju P.L.S.S.S.N Signed-off-by: Andy Gross commit 600513dfeef33cb05c694d1b13d319b9e8cde536 Author: Lina Iyer Date: Wed Jun 20 18:57:04 2018 +0530 drivers: qcom: rpmh: cache sleep/wake state requests Active state requests are sent immediately to the RSC controller, while sleep and wake state requests are cached in this driver to avoid taxing the RSC controller repeatedly. The cached values will be sent to the controller when the rpmh_flush() is called. Generally, flushing is a system PM activity and may be called from the system PM drivers when the system is entering suspend or deeper sleep modes during cpuidle. Also allow invalidating the cached requests, so they may be re-populated again. Signed-off-by: Lina Iyer [rplsssn: remove unneeded semicolon, address line over 80chars error] Signed-off-by: Raju P.L.S.S.S.N Reviewed-by: Evan Green Reviewed-by: Matthias Kaehlcke Signed-off-by: Andy Gross commit 9a3afcfbc0cc9af5e18ff53bb0d41a30e0d3d896 Author: Lina Iyer Date: Wed Jun 20 18:57:03 2018 +0530 drivers: qcom: rpmh-rsc: allow invalidation of sleep/wake TCS Allow sleep and wake commands to be cleared from the respective TCSes, so that they can be re-populated. Signed-off-by: Lina Iyer Signed-off-by: Raju P.L.S.S.S.N Signed-off-by: Andy Gross commit fa460e453a83af0054dc3d3d210a6617db333a20 Author: Lina Iyer Date: Wed Jun 20 18:57:02 2018 +0530 drivers: qcom: rpmh-rsc: write sleep/wake requests to TCS Sleep and wake requests are sent when the application processor subsystem of the SoC is entering deep sleep states like in suspend. These requests help lower the system power requirements when the resources are not in use. Sleep and wake requests are written to the TCS slots but are not triggered at the time of writing. The TCS are triggered by the firmware after the last of the CPUs has executed its WFI. Since these requests may come in different batches of requests, it is the job of this controller driver to find and arrange the requests into the available TCSes. Signed-off-by: Lina Iyer Signed-off-by: Raju P.L.S.S.S.N Reviewed-by: Evan Green Reviewed-by: Matthias Kaehlcke Signed-off-by: Andy Gross commit c1038456b02b86cc4445441a8d33c5aca0ac103e Author: Lina Iyer Date: Wed Jun 20 18:57:01 2018 +0530 drivers: qcom: rpmh: add RPMH helper functions Sending RPMH requests and waiting for response from the controller through a callback is common functionality across all platform drivers. To simplify drivers, add a library functions to create RPMH client and send resource state requests. rpmh_write() is a synchronous blocking call that can be used to send active state requests. Signed-off-by: Lina Iyer Signed-off-by: Raju P.L.S.S.S.N Signed-off-by: Andy Gross commit fc087fe5a45e7210be89fe015505e1bb3746395c Author: Lina Iyer Date: Wed Jun 20 18:57:00 2018 +0530 drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE Log sent RPMH requests and interrupt responses in FTRACE. Signed-off-by: Lina Iyer Reviewed-by: Steven Rostedt (VMware) [rplsssn@codeaurora.org: rebase to v4.18-rc1 & fix merge conflict] Signed-off-by: Raju P.L.S.S.S.N Signed-off-by: Andy Gross commit 2e4690a09fca9a8314e22ff98702c52a30211e25 Author: Lina Iyer Date: Wed Jun 20 18:56:59 2018 +0530 dt-bindings: introduce RPMH RSC bindings for Qualcomm SoCs Add device binding documentation for Qualcomm Technology Inc's RPMH RSC driver. The driver is used for communicating resource state requests for shared resources. Cc: devicetree@vger.kernel.org Signed-off-by: Lina Iyer Reviewed-by: Rob Herring [rplsssn@codeaurora.org: minor order correction for TCS type] Signed-off-by: Raju P.L.S.S.S.N Signed-off-by: Andy Gross commit 658628e7ef78e875cfe13064387c1a7a287d6338 Author: Lina Iyer Date: Wed Jun 20 18:56:58 2018 +0530 drivers: qcom: rpmh-rsc: add RPMH controller for QCOM SoCs Add controller driver for QCOM SoCs that have hardware based shared resource management. The hardware IP known as RSC (Resource State Coordinator) houses multiple Direct Resource Voter (DRV) for different execution levels. A DRV is a unique voter on the state of a shared resource. A Trigger Control Set (TCS) is a bunch of slots that can house multiple resource state requests, that when triggered will issue those requests through an internal bus to the Resource Power Manager Hardened (RPMH) blocks. These hardware blocks are capable of adjusting clocks, voltages, etc. The resource state request from a DRV are aggregated along with state requests from other processors in the SoC and the aggregate value is applied on the resource. Some important aspects of the RPMH communication - - Requests are with some header information - Multiple requests (upto 16) may be sent through a TCS, at a time - Requests in a TCS are sent in sequence - Requests may be fire-n-forget or completion (response expected) - Multiple TCS from the same DRV may be triggered simultaneously - Cannot send a request if another request for the same addr is in progress from the same DRV - When all the requests from a TCS are complete, an IRQ is raised - The IRQ handler needs to clear the TCS before it is available for reuse - TCS configuration is specific to a DRV - Platform drivers may use DRV from different RSCs to make requests Resource state requests made when CPUs are active are called 'active' state requests. Requests made when all the CPUs are powered down (idle state) are called 'sleep' state requests. They are matched by a corresponding 'wake' state requests which puts the resources back in to previously requested active state before resuming any CPU. TCSes are dedicated for each type of requests. Active mode TCSes (AMC) are used to send requests immediately to the resource, while control TCS are used to provide specific information to the controller. Sleep and Wake TCS send sleep and wake requests, after and before the system halt respectively. Signed-off-by: Lina Iyer Signed-off-by: Raju P.L.S.S.S.N Signed-off-by: Andy Gross commit a3134fb09e0bc5bee76e13bf863173b86f21cf87 Author: Rishabh Bhatnagar Date: Wed May 23 17:35:21 2018 -0700 drivers: soc: Add LLCC driver LLCC (Last Level Cache Controller) provides additional cache memory in the system. LLCC is partitioned into multiple slices and each slice gets its own priority, size, ID and other config parameters. LLCC driver programs these parameters for each slice. Clients that are assigned to use LLCC need to get information such size & ID of the slice they get and activate or deactivate the slice as needed. LLCC driver provides API for the clients to perform these operations. Signed-off-by: Channagoud Kadabi Signed-off-by: Rishabh Bhatnagar Reviewed-by: Evan Green Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit 7e5700ae64f6a8921c130f34946af4de4483bb7c Author: Rishabh Bhatnagar Date: Wed May 23 17:35:20 2018 -0700 dt-bindings: Documentation for qcom, llcc Documentation for last level cache controller device tree bindings, client bindings usage examples. Signed-off-by: Channagoud Kadabi Signed-off-by: Rishabh Bhatnagar Reviewed-by: Evan Green Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit 0b65c59e3a5475895c93ea5f130597db16b8abf6 Author: Bjorn Andersson Date: Mon Jun 25 13:06:13 2018 -0700 soc: qcom: smem: Correct check for global partition The moved check for the global partition ended up in the wrong place and I failed to spot this in my review. This moves it to the correct place. Fixes: 11d2e7edac6a ("soc: qcom: smem: check sooner in qcom_smem_set_global_partition()") Signed-off-by: Bjorn Andersson Reviewed-by: Alex Elder Signed-off-by: Andy Gross commit 717f2013a402b72e46e32012b7e8f1edc9e2e060 Author: Douglas Anderson Date: Mon Jun 18 14:50:51 2018 -0700 arm64: dts: sdm845: Add rpmh-clk node This adds the rpmh-clk node to sdm845 based on the examples in the bindings. Signed-off-by: Douglas Anderson Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit c83545d95376c2249c7990ce2dd76f387ce68bef Author: Douglas Anderson Date: Mon Jun 18 14:50:50 2018 -0700 arm64: dts: sdm845: Add rpmh-rsc node This adds the rpmh-rsc node to sdm845 based on the examples in the bindings. Signed-off-by: Douglas Anderson Reviewed-by: Lina Iyer Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit 994356cfa950041a41edb60481fccfa4b8290f04 Author: Douglas Anderson Date: Wed Jun 13 09:53:52 2018 -0700 arm64: dts: qcom: sdm845: Enable debug UART and I2C10 on sdm845-mtp The debug UART is very useful to have. I2C10 is enabled as an example of a I2C port we can talk on for now. Eventually we'll want to put peripherals under it. Signed-off-by: Douglas Anderson Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson Signed-off-by: Andy Gross commit 897cf34e7305470bedc71bc682beeda5fa8e3cad Author: Douglas Anderson Date: Wed Jun 13 09:53:51 2018 -0700 arm64: dts: qcom: sdm845: Add I2C, SPI, and UART9 nodes This adds nodes to SDM845-dtsi for all the I2C ports, all the SPI ports, and UART9. Note that I2C / SPI / UART are a bit strange on sdm845 because each "serial engine" has 4 pins associated with it and depending on which firmware has been loaded into the serial engine (loaded by the BIOS) the serial engine can behave like an I2C port, a SPI port, or a UART. As per the landed bindings that means that we need to create one node for each possible mode that the port could be in. With 16 serial engines that means 16 x 3 = 48 nodes. We get away with only creating 33 nodes for now because it seems very likely that SDM845-based boards will actually all use the same UART (UART 9) for debug purposes. While another UART could be used for something like Bluetooth communication we can cross that path when we come to it. Some documentation that I saw implied that using a UART for "high speed" communications actually needs yet another different serial engine firmware anyway. Note that quick measurements adding all these nodes adds <10k of extra space per dtb that they're included with. If this becomes a problem we may need to think of a different way to structure this so that boards only get the nodes they need (or figure out how to get dtc to strip 'disabled' nodes). For now it seems OK. These nodes were programmatically generated with a fairly dumb python script. See http://crosreview.com/1091631 for the source. NOTE: at the moment SPI chip select doesn't appear to work in my tests with the latest posted SPI driver. All testing of SPI with this patch has been done by hacking SPI to GPIO chip select. Signed-off-by: Douglas Anderson Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit 8ea4ffca89820520b571907e85154c6618444d5d Author: Stephen Boyd Date: Wed Jun 13 08:20:54 2018 -0700 arm64: dts: qcom: Add pm8005 and pm8998 support Add basic support for the pm8005 and pm8998 PMICs. For now just support the GPIO controllers. Signed-off-by: Stephen Boyd Reviewed-by: Evan Green Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit 0729614992c946f6e8ccb9ef260aea1f06993df0 Author: Eric W. Biederman Date: Fri Jul 13 21:39:13 2018 -0500 signal: Push pid type down into complete_signal. This is the bottom and by pushing this down it simplifies the callers and otherwise leaves things as is. This is in preparation for allowing fork to implement better handling of signals set to groups of processes. Signed-off-by: "Eric W. Biederman" commit 5a883cee7442a5fd72e18eae895113fbd7b16110 Author: Eric W. Biederman Date: Fri Jul 13 19:26:27 2018 -0500 signal: Push pid type down into __send_signal This information is already available in the callers and by pushing it down it makes the code a little clearer, and allows implementing better handling of signales set to a group of processes in fork. Signed-off-by: "Eric W. Biederman" commit b213984bd3987e6f5bf96b7847d151b7b42e1efd Author: Eric W. Biederman Date: Fri Jul 20 15:49:17 2018 -0500 signal: Push pid type down into send_signal This information is already available in the callers and by pushing it down it makes the code a little clearer, and allows better group signal behavior in fork. Signed-off-by: "Eric W. Biederman" commit 40b3b02535621027f56d248139e0e467573c3098 Author: Eric W. Biederman Date: Sat Jul 21 10:45:15 2018 -0500 signal: Pass pid type into do_send_sig_info This passes the information we already have at the call sight into do_send_sig_info. Ultimately allowing for better handling of signals sent to a group of processes during fork. Signed-off-by: "Eric W. Biederman" commit 9c2db007787ef1aac6728c5e03d37b0ae935d122 Author: Eric W. Biederman Date: Sat Jul 21 08:17:29 2018 -0500 signal: Pass pid type into send_sigio_to_task & send_sigurg_to_task This information is already present and using it directly simplifies the logic of the code. Signed-off-by: "Eric W. Biederman" commit 0102498083d58d8b17759642c602b525215e1a54 Author: Eric W. Biederman Date: Fri Jul 13 18:40:57 2018 -0500 signal: Pass pid type into group_send_sig_info This passes the information we already have at the call sight into group_send_sig_info. Ultimatelly allowing for to better handle signals sent to a group of processes. Signed-off-by: "Eric W. Biederman" commit d1afdc51399c53791ad9affbef67ba3aa206c379 Merge: 975cd350c270 b701a99e431d Author: David S. Miller Date: Sat Jul 21 10:28:55 2018 -0700 Merge branch 'tcp-improve-setsockopt-TCP_USER_TIMEOUT-accuracy' Jon Maxwell says: ==================== tcp: improve setsockopt() TCP_USER_TIMEOUT accuracy The patch was becoming bigger based on feedback therefore I have implemented a series of 3 commits instead in V4. This series is a continuation based on V3 here and associated feedback: https://patchwork.kernel.org/patch/10516195/ Suggestions by Neal Cardwell: 1) Fix up units mismatch regarding msec/jiffies. 2) Address possiblility of time_remaining being negative. 3) Add a helper routine tcp_clamp_rto_to_user_timeout() to do the rto calculation. 4) Move start_ts logic into helper routine tcp_retrans_stamp() to validate tcp_sk(sk)->retrans_stamp. 5) Some u32 declation and return refactoring. 6) Return 0 instead of false in tcp_retransmit_stamp(), it's not a bool. Suggestions by David Laight: 1) Don't cache rto in tcp_clamp_rto_to_user_timeout(). Suggestions by Eric Dumazet: 1) Make u32 declartions consistent. 2) Use patch series for easier review. 3) Convert icsk->icsk_user_timeout to millisconds to avoid jiffie to msec dance. 4) Use seperate titles for each commit in the series. 5) Fix fuzzy indentation and line wrap issues. 6) Make commit titles descriptive. Changes: 1) Call tcp_clamp_rto_to_user_timeout(sk) as an argument to inet_csk_reset_xmit_timer() to save on rto declaration. Every time the TCP retransmission timer fires. It checks to see if there is a timeout before scheduling the next retransmit timer. The retransmit interval between each retransmission increases exponentially. The issue is that in order for the timeout to occur the retransmit timer needs to fire again. If the user timeout check happens after the 9th retransmit for example. It needs to wait for the 10th retransmit timer to fire in order to evaluate whether a timeout has occurred or not. If the interval is large enough then the timeout will be inaccurate. For example with a TCP_USER_TIMEOUT of 10 seconds without patch: 1st retransmit: 22:25:18.973488 IP host1.49310 > host2.search-agent: Flags [.] Last retransmit: 22:25:26.205499 IP host1.49310 > host2.search-agent: Flags [.] Timeout: send: Connection timed out Sun Jul 1 22:25:34 EDT 2018 We can see that last retransmit took ~7 seconds. Which pushed the total timeout to ~15 seconds instead of the expected 10 seconds. This gets more inaccurate the larger the TCP_USER_TIMEOUT value. As the interval increases. Add tcp_clamp_rto_to_user_timeout() to determine if the user rto has expired. Or whether the rto interval needs to be recalculated. Use the original interval if user rto is not set. Test results with the patch is the expected 10 second timeout: 1st retransmit: 01:37:59.022555 IP host1.49310 > host2.search-agent: Flags [.] Last retransmit: 01:38:06.486558 IP host1.49310 > host2.search-agent: Flags [.] Timeout: send: Connection timed out Mon Jul 2 01:38:09 EDT 2018 ==================== Signed-off-by: David S. Miller commit b701a99e431db784714c32fc6b68123045714679 Author: Jon Maxwell Date: Thu Jul 19 11:14:44 2018 +1000 tcp: Add tcp_clamp_rto_to_user_timeout() helper to improve accuracy Create the tcp_clamp_rto_to_user_timeout() helper routine. To calculate the correct rto, so that the TCP_USER_TIMEOUT socket option is more accurate. Taking suggestions and feedback into account from Eric Dumazet, Neal Cardwell and David Laight. Due to the 1st commit we can avoid the msecs_to_jiffies() and jiffies_to_msecs() dance. Signed-off-by: Jon Maxwell Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit a7fa37703d495310819d0a6747e5b32362305374 Author: Jon Maxwell Date: Thu Jul 19 11:14:43 2018 +1000 tcp: Add tcp_retransmit_stamp() helper routine Create a seperate helper routine as per Neal Cardwells suggestion. To be used by the final commit in this series and retransmits_timed_out(). Signed-off-by: Jon Maxwell Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 9bcc66e1983d10861deb6920fb0c151c5b01772a Author: Jon Maxwell Date: Thu Jul 19 11:14:42 2018 +1000 tcp: convert icsk_user_timeout from jiffies to msecs This is a preparatory commit. Part of this series that improves the socket TCP_USER_TIMEOUT option accuracy. Implement Eric Dumazets idea to convert icsk->icsk_user_timeout from jiffies to msecs. To eliminate the msecs_to_jiffies() and jiffies_to_msecs() dance in future. Signed-off-by: Jon Maxwell Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 975cd350c270328b784326d124b7a6607542e053 Merge: d528114bd398 5f89eca57777 Author: David S. Miller Date: Sat Jul 21 10:12:30 2018 -0700 Merge branch 's390-qeth-updates' Julian Wiedmann says: ==================== s390/qeth: updates 2018-07-19 please apply one more round of qeth patches to net-next. This brings additional performance improvements for the transmit code, and some refactoring to pave the way for using netdev_priv. Also, two minor fixes for rare corner cases. ==================== Signed-off-by: David S. Miller commit 5f89eca577776952325ee35da54786d26de1120a Author: Julian Wiedmann Date: Thu Jul 19 12:43:58 2018 +0200 s390/qeth: speed up L2 IQD xmit Modify the L2 OSA xmit path so that it also supports L2 IQD devices (in particular, their HW header requirements). This allows IQD devices to advertise NETIF_F_SG support, and eliminates the allocation overhead for the HW header. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit a7c2f4a33290fbad615a0c4e977f317f37d7a057 Author: Julian Wiedmann Date: Thu Jul 19 12:43:57 2018 +0200 s390/qeth: add support for constrained HW headers Some transmit modes require that the HW header is located in the same page as the initial protocol headers in skb->data. Let callers specify the size of this contiguous header range, and enforce it when building the HW header. While at it, apply some gentle renaming to the relevant L2 code so that it matches the L3 code. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit ba86ceee9d1b5aa71fe3db75b2ec5452c9a48307 Author: Julian Wiedmann Date: Thu Jul 19 12:43:56 2018 +0200 s390/qeth: merge linearize-check into HW header construction When checking whether an skb needs to be linearized to fit into an IO buffer, it's desirable to consider the skb's final size and layout (ie. after the HW header was added). But a subsequent linearization can then cause the re-positioned HW header to violate its alignment restrictions. Dealing with this situation in two different code paths is quite tricky. This patch integrates a) linearize-check and b) HW header construction into one 3 step-sequence: 1. evaluate how the HW header needs to be added (to identify if it takes up an additional buffer element), then 2. check if the required buffer elements exceed the device's limit. Linearize when necessary and re-evaluate the HW header placement. 3. Add the HW header in the best-possible way: a) push, without taking up an additional buffer element b) push, but consume another buffer element c) allocate a header object from the cache. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit d2a274b25be7218f8400037868a756640e8a4b0d Author: Julian Wiedmann Date: Thu Jul 19 12:43:55 2018 +0200 s390/qeth: add statistics for consumed buffer elements Nowadays an skb fragment typically spans over multiple pages. So replace the obsolete, SG-only 'fragments' counter with one that tracks the consumed buffer elements. This is what actually matters for performance. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 72f219da79d22384bbc809fc67ed305dbe824e39 Author: Julian Wiedmann Date: Thu Jul 19 12:43:54 2018 +0200 s390/qeth: use core MTU range checking qeth's ndo_change_mtu() only applies some trivial bounds checking. Set up dev->min_mtu properly, so that dev_set_mtu() can do this for us. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 8ce7a9e064db4a31e9d9d08300e2f3e9679eaffe Author: Julian Wiedmann Date: Thu Jul 19 12:43:53 2018 +0200 s390/qeth: simplify max MTU handling When the MPC initialization code discovers the HW-specific max MTU, apply the resulting changes straight to the netdevice. If this is the device's first initialization, also set its MTU (HiperSockets: the max MTU; else: a layer-specific default value). Then cap the current MTU by the new max MTU. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 92d2720969bc741c8aa7269cb3561c49227cd04f Author: Julian Wiedmann Date: Thu Jul 19 12:43:52 2018 +0200 s390/qeth: don't cache HW port number The netdevice is always available now, so get the portno from there. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit d3d1b205e89f1e4194b9f8924022c77ea749d113 Author: Julian Wiedmann Date: Thu Jul 19 12:43:51 2018 +0200 s390/qeth: allocate netdevice early Allocation of the netdevice is currently delayed until a qeth card first goes online. This complicates matters in several places, where we need to cache values instead of applying them straight to the netdevice. Improve on this by moving the allocation up to where the qeth card itself is created. This is also one step in direction of eventually placing the qeth card into netdev_priv(). In all subsequent code, remove the now redundant checks whether card->dev is valid. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit addc5ee87242a3592fdc9134ddff54c7aa372805 Author: Julian Wiedmann Date: Thu Jul 19 12:43:50 2018 +0200 s390/qeth: remove redundant netif_carrier_ok() checks netif_carrier_off() does its own checking. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 70551dc46ffa3555a0b5f3545b0cd87ab67fd002 Author: Julian Wiedmann Date: Thu Jul 19 12:43:49 2018 +0200 s390/qeth: reset layer2 attribute on layer switch After the subdriver's remove() routine has completed, the card's layer mode is undetermined again. Reflect this in the layer2 field. If qeth_dev_layer2_store() hits an error after remove() was called, the card _always_ requires a setup(), even if the previous layer mode is requested again. But qeth_dev_layer2_store() bails out early if the requested layer mode still matches the current one. So unless we reset the layer2 field, re-probing the card back to its previous mode is currently not possible. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit a702349a4099cd5a7bab0904689d8e0bf8dcd622 Author: Julian Wiedmann Date: Thu Jul 19 12:43:48 2018 +0200 s390/qeth: fix race in used-buffer accounting By updating q->used_buffers only _after_ do_QDIO() has completed, there is a potential race against the buffer's TX completion. In the unlikely case that the TX completion path wins, qeth_qdio_output_handler() would decrement the counter before qeth_flush_buffers() even incremented it. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit c2e2a618eb7104e18fdcf739d4d911563812a81c Author: Randy Dunlap Date: Fri Jul 6 20:53:09 2018 -0700 platform/x86: toshiba_acpi: Fix defined but not used build warnings Fix a build warning in toshiba_acpi.c when CONFIG_PROC_FS is not enabled by marking the unused function as __maybe_unused. ../drivers/platform/x86/toshiba_acpi.c:1685:12: warning: 'version_proc_show' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap Cc: Azael Avalos Cc: platform-driver-x86@vger.kernel.org Cc: Andy Shevchenko Signed-off-by: Darren Hart (VMware) commit d528114bd398b4edaeed370a96f874dff88c10f5 Merge: eae249b27f04 d71d8381c5b7 Author: David S. Miller Date: Sat Jul 21 08:44:24 2018 -0700 Merge branch 'hns3-misc-cleanups' Salil Mehta says: ==================== Misc. cleanups for HNS3 ethernet driver This patch-set presents some cleanups for HNS3 Ethernet Driver. ==================== Signed-off-by: David S. Miller commit d71d8381c5b7f5edbc154d8ce586a747a01c3b0c Author: Jian Shen Date: Thu Jul 19 15:47:06 2018 +0100 net: hns3: Add SPDX tags to HNS3 PF driver Add the SPDX identifiers to HNS3 PF driver. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 584b464f83a1f6fcc21a201ea46c889647ed3255 Author: Jian Shen Date: Thu Jul 19 15:47:05 2018 +0100 net: hns3: Remove unused struct member and definition The struct hclge_desc_cb and hclge_desc_cb are never used in anywhere. This patch removes them. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit ef0c5009619c90646211a576f280339e4151e39d Author: Jian Shen Date: Thu Jul 19 15:47:04 2018 +0100 net: hns3: Fix misleading parameter name The input parameter "dev" of hns3_irq_handle() is indeed used as a tqp vector, it is misleadin. The struct member "flag" is used to indicate ring type, so rename it. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit c79301d8d985a3f40c233bd744338eafdc57e51a Author: Jian Shen Date: Thu Jul 19 15:47:03 2018 +0100 net: hns3: Modify inconsistent bit mask macros Use BIT() and GENMASK() to convert the bit mask, modify the inconsistent ones, and remove useless ones. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit f8a91784a13e083862b7ec325dda6bea1d25645e Author: Jian Shen Date: Thu Jul 19 15:47:02 2018 +0100 net: hns3: Use decimal for bit offset macros Using hex for bit offsets is inconsistent with the rest of the file. Change them to decimal. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit fdace1bc4a1e427e77683d8ada782056022faed4 Author: Jian Shen Date: Thu Jul 19 15:47:01 2018 +0100 net: hns3: Correct unreasonable code comments This patch fixes some comment spelling errors, removes redundant comments, rewrites misleading comments, and adds some necessary comments. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit a10829c4aeab1fd837129537a4d44f6a79a18202 Author: Jian Shen Date: Thu Jul 19 15:47:00 2018 +0100 net: hns3: Remove extra space and brackets Remove extra space and brackets. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 3f639907e02e5a63ef5cca6aa5ddf87e93c40510 Author: Jian Shen Date: Thu Jul 19 15:46:59 2018 +0100 net: hns3: Standardize the handle of return value Apply the standard minor cleanup by returning ret outside the brackets. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 646cb51228d497b1c56b1d8ee18bb2b1bd87c93c Author: Jian Shen Date: Thu Jul 19 15:46:58 2018 +0100 net: hns3: Remove some redundant assignments Remove some redundant assignments, because they have been set to zero when allocate hdev. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 24122c7f4969adeeaeca3fb1656a31569e9aa59b Author: Eric W. Biederman Date: Fri Jul 20 14:30:23 2018 -0500 signal: Pass pid and pid type into send_sigqueue Make the code more maintainable by performing more of the signal related work in send_sigqueue. A quick inspection of do_timer_create will show that this code path does not lookup a thread group by a thread's pid. Making it safe to find the task pointed to by it_pid with "pid_task(it_pid, type)"; This supports the changes needed in fork to tell if a signal was sent to a single process or a group of processes. Having the pid to task transition in signal.c will also make it easier to sort out races with de_thread and and the thread group leader exiting when it comes time to address that. Signed-off-by: "Eric W. Biederman" commit 2118e1f53f6f0973a1d9a6a7dc9296959bf39ec0 Author: Eric W. Biederman Date: Sat Jul 21 00:00:29 2018 -0500 posix-timers: Noralize good_sigevent In good_sigevent directly compute the default return value as "task_tgid(current)". This is exactly the same as "task_pid(current->group_leader)" but written more clearly. In the thread case first compute the thread's pid. Then veify that attached to that pid is a thread of the current thread group. This has the net effect of making the code a little clearer, and making it obvious that posix timers never look up a process by a the pid of a thread. Signed-off-by: "Eric W. Biederman" commit 019191342fecce4a461978a7191a43f313e19e86 Author: Eric W. Biederman Date: Sun Jul 16 22:05:57 2017 -0500 signal: Use PIDTYPE_TGID to clearly store where file signals will be sent When f_setown is called a pid and a pid type are stored. Replace the use of PIDTYPE_PID with PIDTYPE_TGID as PIDTYPE_TGID goes to the entire thread group. Replace the use of PIDTYPE_MAX with PIDTYPE_PID as PIDTYPE_PID now is only for a thread. Update the users of __f_setown to use PIDTYPE_TGID instead of PIDTYPE_PID. For now the code continues to capture task_pid (when task_tgid would really be appropriate), and iterate on PIDTYPE_PID (even when type == PIDTYPE_TGID) out of an abundance of caution to preserve existing behavior. Oleg Nesterov suggested using the test to ensure we use PIDTYPE_PID for tgid lookup also be used to avoid taking the tasklist lock. Suggested-by: Oleg Nesterov Signed-off-by: "Eric W. Biederman" commit 6883f81aac6f44e7df70a6af189b3689ff52cbfb Author: Eric W. Biederman Date: Sun Jun 4 04:32:13 2017 -0500 pid: Implement PIDTYPE_TGID Everywhere except in the pid array we distinguish between a tasks pid and a tasks tgid (thread group id). Even in the enumeration we want that distinction sometimes so we have added __PIDTYPE_TGID. With leader_pid we almost have an implementation of PIDTYPE_TGID in struct signal_struct. Add PIDTYPE_TGID as a first class member of the pid_type enumeration and into the pids array. Then remove the __PIDTYPE_TGID special case and the leader_pid in signal_struct. The net size increase is just an extra pointer added to struct pid and an extra pair of pointers of an hlist_node added to task_struct. The effect on code maintenance is the removal of a number of special cases today and the potential to remove many more special cases as PIDTYPE_TGID gets used to it's fullest. The long term potential is allowing zombie thread group leaders to exit, which will remove a lot more special cases in the code. Signed-off-by: "Eric W. Biederman" commit 2c4704756cab7cfa031ada4dab361562f0e357c0 Author: Eric W. Biederman Date: Tue Sep 26 13:06:43 2017 -0500 pids: Move the pgrp and session pid pointers from task_struct to signal_struct To access these fields the code always has to go to group leader so going to signal struct is no loss and is actually a fundamental simplification. This saves a little bit of memory by only allocating the pid pointer array once instead of once for every thread, and even better this removes a few potential races caused by the fact that group_leader can be changed by de_thread, while signal_struct can not. Signed-off-by: "Eric W. Biederman" commit 71dbc8a96953aa91c50181a526acb7f80af74f67 Author: Eric W. Biederman Date: Sun Jul 16 21:39:32 2017 -0500 kvm: Don't open code task_pid in kvm_vcpu_ioctl Signed-off-by: "Eric W. Biederman" commit 7a36094d61bfe9843de5484ff0140227983ac5d5 Author: Eric W. Biederman Date: Tue Sep 26 12:45:33 2017 -0500 pids: Compute task_tgid using signal->leader_pid The cost is the the same and this removes the need to worry about complications that come from de_thread and group_leader changing. __task_pid_nr_ns has been updated to take advantage of this change. Signed-off-by: "Eric W. Biederman" commit 1fb53567a3633740aac8761eb7023dc5671f0edb Author: Eric W. Biederman Date: Fri May 5 13:45:14 2017 -0500 pids: Move task_pid_type into sched/signal.h The function is general and inline so there is no need to hide it inside of exit.c Signed-off-by: "Eric W. Biederman" commit 2896b0f09f2617f953b8038978106cc4cbb4c52b Author: Eric W. Biederman Date: Fri May 5 13:31:23 2017 -0500 pids: Initialize leader_pid in init_task This is cheap and no cost so we might as well. Signed-off-by: "Eric W. Biederman" commit b0960b9569db6b2fe8a75967d47b9dcdeb44016b Author: James Morse Date: Thu Jul 19 16:24:25 2018 +0100 KVM: arm: Add 32bit get/set events support arm64's new use of KVMs get_events/set_events API calls isn't just or RAS, it allows an SError that has been made pending by KVM as part of its device emulation to be migrated. Wire this up for 32bit too. We only need to read/write the HCR_VA bit, and check that no esr has been provided, as we don't yet support VDFSR. Signed-off-by: James Morse Reviewed-by: Dongjiu Geng Signed-off-by: Marc Zyngier commit 539aee0edb9fdc8f465e3843c261acc88c47d8ee Author: James Morse Date: Thu Jul 19 16:24:24 2018 +0100 KVM: arm64: Share the parts of get/set events useful to 32bit The get/set events helpers to do some work to check reserved and padding fields are zero. This is useful on 32bit too. Move this code into virt/kvm/arm/arm.c, and give the arch code some underscores. This is temporarily hidden behind __KVM_HAVE_VCPU_EVENTS until 32bit is wired up. Signed-off-by: James Morse Reviewed-by: Dongjiu Geng Signed-off-by: Marc Zyngier commit be26b3a73413c2ebf14d5e76a66ad964e6458080 Author: Dongjiu Geng Date: Thu Jul 19 16:24:23 2018 +0100 arm64: KVM: export the capability to set guest SError syndrome For the arm64 RAS Extension, user space can inject a virtual-SError with specified ESR. So user space needs to know whether KVM support to inject such SError, this interface adds this query for this capability. KVM will check whether system support RAS Extension, if supported, KVM returns true to user space, otherwise returns false. Signed-off-by: Dongjiu Geng Reviewed-by: James Morse [expanded documentation wording] Signed-off-by: James Morse Signed-off-by: Marc Zyngier commit b7b27facc7b50a5fce0afaa3df56157136ce181a Author: Dongjiu Geng Date: Thu Jul 19 16:24:22 2018 +0100 arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS For the migrating VMs, user space may need to know the exception state. For example, in the machine A, KVM make an SError pending, when migrate to B, KVM also needs to pend an SError. This new IOCTL exports user-invisible states related to SError. Together with appropriate user space changes, user space can get/set the SError exception state to do migrate/snapshot/suspend. Signed-off-by: Dongjiu Geng Reviewed-by: James Morse [expanded documentation wording] Signed-off-by: James Morse Signed-off-by: Marc Zyngier commit 327432c2469e0069679009886556d15eeddeb0cc Author: Christoffer Dall Date: Mon Jul 16 15:06:27 2018 +0200 KVM: arm/arm64: vgic: Update documentation of the GIC devices wrt IIDR Update the documentation to reflect the ordering requirements of restoring the GICD_IIDR register before any other registers and the effects this has on restoring the interrupt groups for an emulated GICv2 instance. Also remove some outdated limitations in the documentation while we're at it. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 32f8777ed92d73e504840a955a9dc92617826b69 Author: Christoffer Dall Date: Mon Jul 16 15:06:26 2018 +0200 KVM: arm/arm64: vgic: Let userspace opt-in to writable v2 IGROUPR Simply letting IGROUPR be writable from userspace would break migration from old kernels to newer kernels, because old kernels incorrectly report interrupt groups as group 1. This would not be a big problem if userspace wrote GICD_IIDR as read from the kernel, because we could detect the incompatibility and return an error to userspace. Unfortunately, this is not the case with current userspace implementations and simply letting IGROUPR be writable from userspace for an emulated GICv2 silently breaks migration and causes the destination VM to no longer run after migration. We now encourage userspace to write the read and expected value of GICD_IIDR as the first part of a GIC register restore, and if we observe a write to GICD_IIDR we know that userspace has been updated and has had a chance to cope with older kernels (VGICv2 IIDR.Revision == 0) incorrectly reporting interrupts as group 1, and therefore we now allow groups to be user writable. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit d53c2c29ae0dfac1e062939afeaeaa1a45cc47a3 Author: Christoffer Dall Date: Mon Jul 16 15:06:25 2018 +0200 KVM: arm/arm64: vgic: Allow configuration of interrupt groups Implement the required MMIO accessors for GICv2 and GICv3 for the IGROUPR distributor and redistributor registers. This can allow guests to change behavior compared to running on previous versions of KVM, but only to align with the architecture and hardware implementations. This also allows userspace to configure the interrupts groups for GICv3. We don't allow userspace to write the groups on GICv2 just yet, because that would result in GICv2 guests not receiving interrupts after migrating from an older kernel that exposes GICv2 interrupts as group 1. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit b489edc36169938e955c748eb83eb707bd53436e Author: Christoffer Dall Date: Mon Jul 16 15:06:24 2018 +0200 KVM: arm/arm64: vgic: Return error on incompatible uaccess GICD_IIDR writes If userspace attempts to write a GICD_IIDR that does not match the kernel version, return an error to userspace. The intention is to allow implementation changes inside KVM while avoiding silently breaking migration resulting in guests not running without any clear indication of what went wrong. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit c6e0917b67fc006f3785b79bfdacdf9eef2f4816 Author: Christoffer Dall Date: Mon Jul 16 15:06:23 2018 +0200 KVM: arm/arm64: vgic: Permit uaccess writes to return errors Currently we do not allow any vgic mmio write operations to fail, which makes sense from mmio traps from the guest. However, we should be able to report failures to userspace, if userspace writes incompatible values to read-only registers. Rework the internal interface to allow errors to be returned on the write side for userspace writes. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 87322099052b6a534cecd3d303fc097d4560b7d0 Author: Christoffer Dall Date: Mon Jul 16 15:06:22 2018 +0200 KVM: arm/arm64: vgic: Signal IRQs using their configured group Now when we have a group configuration on the struct IRQ, use this state when populating the LR and signaling interrupts as either group 0 or group 1 to the VM. Depending on the model of the emulated GIC, and the guest's configuration of the VMCR, interrupts may be signaled as IRQs or FIQs to the VM. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 8df3c8f33f46adbaa811c0d57fb1d7eb421b88a9 Author: Christoffer Dall Date: Mon Jul 16 15:06:21 2018 +0200 KVM: arm/arm64: vgic: Add group field to struct irq In preparation for proper group 0 and group 1 support in the vgic, we add a field in the struct irq to store the group of all interrupts. We initialize the group to group 0 when emulating GICv2 and to group 1 when emulating GICv3, just like we treat them today. LPIs are always group 1. We also continue to ignore writes from the guest, preserving existing functionality, for now. Finally, we also add this field to the vgic debug logic to show the group for all interrupts. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit dd6251e463d3d8ea55ac2c5944e24bd6ed8f423b Author: Christoffer Dall Date: Mon Jul 16 15:06:20 2018 +0200 KVM: arm/arm64: vgic: GICv2 IGROUPR should read as zero We currently don't support grouping in the emulated VGIC, which is a known defect on KVM (not hurting any currently used guests as far as we're aware). This is currently handled by treating all interrupts as group 0 interrupts for an emulated GICv2 and always signaling interrupts as group 0 to the virtual CPU interface. However, when reading which group interrupts belongs to in the guest from the emulated VGIC, the VGIC currently reports group 1 instead of group 0, which is misleading. Fix this temporarily before introducing full group support by changing the hander to _raz instead of _rao. Fixes: fb848db39661a "KVM: arm/arm64: vgic-new: Add GICv2 MMIO handling framework" Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit aa075b0f30b53e397fd4d4162ebf4a3a236b9206 Author: Christoffer Dall Date: Mon Jul 16 15:06:19 2018 +0200 KVM: arm/arm64: vgic: Keep track of implementation revision As we are about to tweak implementation aspects of the VGIC emulation, while still preserving some level of backwards compatibility support, add a field to keep track of the implementation revision field which is reported to the VM and to userspace. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit a2dca217dae29c4ff6420e8c78d56b3f61ae0797 Author: Christoffer Dall Date: Mon Jul 16 15:06:18 2018 +0200 KVM: arm/arm64: vgic: Define GICD_IIDR fields for GICv2 and GIv3 Instead of hardcoding the shifts and masks in the GICD_IIDR register emulation, let's add the definition of these fields to the GIC header files and use them. This will make things more obvious when we're going to bump the revision in the IIDR when we'll make guest-visible changes to the implementation. Reviewed-by: Andrew Jones Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 9bc03f1df31a3228289d5046780071ab8e91aa1a Author: Marc Zyngier Date: Tue Jul 10 13:20:47 2018 +0100 arm64: KVM: Cleanup tpidr_el2 init on non-VHE When running on a non-VHE system, we initialize tpidr_el2 to contain the per-CPU offset required to reach per-cpu variables. Actually, we initialize it twice: the first time as part of the EL2 initialization, by copying tpidr_el1 into its el2 counterpart, and another time by calling into __kvm_set_tpidr_el2. It turns out that the first part is wrong, as it includes the distance between the kernel mapping and the linear mapping, while EL2 only cares about the linear mapping. This was the last vestige of the first per-cpu use of tpidr_el2 that came in with SDEI. The only caller then was hyp_panic(), and its now using the pc-relative get_host_ctxt() stuff, instead of kimage addresses from the literal pool. It is not a big deal, as we override it straight away, but it is slightly confusing. In order to clear said confusion, let's set this directly as part of the hyp-init code, and drop the ad-hoc HYP helper. Reviewed-by: James Morse Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier commit e294cb3a6d1a8967a83b5f083d4f463e2dc28b61 Author: Marc Zyngier Date: Fri Mar 23 15:18:26 2018 +0000 KVM: arm/arm64: vgic-debug: Show LPI status The vgic debugfs file only knows about SGI/PPI/SPI interrupts, and completely ignores LPIs. Let's fix that. Signed-off-by: Marc Zyngier commit 2326aceebc516fe5e7c5b8456f22ef05e2961264 Author: Kees Cook Date: Fri Jun 29 11:46:18 2018 -0700 KVM: arm64: vgic-its: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this switches to using a maximum size and adds sanity checks. Additionally cleans up some of the int-vs-u32 usage and adds additional bounds checking. As it currently stands, this will always be 8 bytes until the ABI changes. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Cc: Christoffer Dall Cc: Eric Auger Cc: Andre Przywara Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Signed-off-by: Kees Cook [maz: dropped WARN_ONs] Signed-off-by: Marc Zyngier commit 1d47191de7e15900f8fbfe7cccd7c6e1c2d7c31a Author: Christoffer Dall Date: Tue Jul 3 22:54:14 2018 +0200 KVM: arm/arm64: Fix vgic init race The vgic_init function can race with kvm_arch_vcpu_create() which does not hold kvm_lock() and we therefore have no synchronization primitives to ensure we're doing the right thing. As the user is trying to initialize or run the VM while at the same time creating more VCPUs, we just have to refuse to initialize the VGIC in this case rather than silently failing with a broken VCPU. Reviewed-by: Eric Auger Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit c73314e6ebb2651a70ca8a3ff08d4bd6b9f9ade1 Author: Mathieu Othacehe Date: Fri Jul 20 19:34:25 2018 +0200 iio: Add channel for Phase Add new channel type support for phase. This channel may be used by Time-of-flight sensors to express the phase difference between emitted and received signals. Those sensor will then use the phase shift of return signals to approximate the distance to objects. Signed-off-by: Mathieu Othacehe Signed-off-by: Jonathan Cameron commit bce5c2ea350f5a57353295534faba00b28cadf14 Author: Stephen Hemminger Date: Sat Jul 21 06:31:39 2018 -0700 uio: add SPDX license tags For those without any license text present or short reference to GPL, add SPDX tag. Signed-off-by: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman commit e16f4f3e0b7daecd48d4f944ab4147c1a6cb16a8 Author: Benjamin Gaignard Date: Mon Jul 16 13:37:44 2018 +0200 base: core: Remove WARN_ON from link dependencies check In some cases the link between between customer and supplier already exist, for example when a device use its parent as a supplier. Do not warn about already existing dependencies because device_link_add() takes care of this case. Link: http://lkml.kernel.org/r/20180709111753eucas1p1f32e66fb2f7ea3216097cd72a132355d~-rzycA5Rg0378203782eucas1p1C@eucas1p1.samsung.com Reported-by: Marek Szyprowski Reviewed-by: Mark Brown Signed-off-by: Benjamin Gaignard Reviewed-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 3297c8fc65af5d40501ea7cddff1b195cae57e4e Author: Pingfan Liu Date: Thu Jul 19 13:14:58 2018 +0800 drivers/base: stop new probing during shutdown There is a race window in device_shutdown(), which may cause -1. parent device shut down before child or -2. no shutdown on a new probing device. For 1st, taking the following scenario: device_shutdown new plugin device list_del_init(parent_dev); spin_unlock(list_lock); device_add(child) probe child shutdown parent_dev --> now child is on the tail of devices_kset For 2nd, taking the following scenario: device_shutdown new plugin device device_add(dev) device_lock(dev); ... device_unlock(dev); probe dev --> now, the new occurred dev has no opportunity to shutdown To fix this race issue, just prevent the new probing request. With this logic, device_shutdown() is more similar to dpm_prepare(). Signed-off-by: Pingfan Liu Reviewed-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit f4c6fbc96eb187d6432fbba1f9c0c2db598cdf29 Author: Adam Borowski Date: Wed Jul 18 05:03:22 2018 +0200 vt: drop unused struct vt_struct Hasn't been ever used within historic (ie, git) times. Signed-off-by: Adam Borowski Signed-off-by: Greg Kroah-Hartman commit d541ae4e76ae35b76490206ef946a9124b993e32 Author: Nicolas Pitre Date: Thu Jul 19 00:05:25 2018 -0400 vt: avoid a VLA in the unicode screen scroll function The nr argument is typically small: most often nr == 1. However this could be abused with a very large explicit scroll in a resized screen. Make the code scroll lines by performing an array rotation operation to avoid the need for a large temporary space. Requested-by: Kees Cook Suggested-by: Adam Borowski Signed-off-by: Nicolas Pitre Signed-off-by: Greg Kroah-Hartman commit 13aa0a12183f804d95c4c5c4d09df19ea74eb424 Author: Nicolas Pitre Date: Tue Jul 17 21:02:42 2018 -0400 vt: add /dev/vcsu* to devices.txt Also mention that the traditional devices provide glyph values whereas /dev/vcsu* is unicode based. Suggested-by: Geert Uytterhoeven Signed-off-by: Nicolas Pitre Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit 0224080fc878f8b1f3317fa0ba3728df6bb9d53e Author: Nicolas Pitre Date: Tue Jul 17 21:02:41 2018 -0400 vt: coherence validation code for the unicode screen buffer Make sure the unicode screen buffer matches the video screen content. This is provided for debugging convenience and disabled by default. Signed-off-by: Nicolas Pitre Signed-off-by: Greg Kroah-Hartman commit 9bfdc2611d417be453c3deb7a7ef2ffc718febfa Author: Adam Borowski Date: Wed Jul 18 04:10:44 2018 +0200 vt: selection: take screen contents from uniscr if available This preserves whatever was written even if we can't currently display the given glyph. Mouse paste won't corrupt any character of wcwidth() == 1 anymore. Note that for now uniscr doesn't get allocated until something reads /dev/vcsuN for that console, making this code dormant for most users. Signed-off-by: Adam Borowski Acked-by: Nicolas Pitre Signed-off-by: Greg Kroah-Hartman commit df155d2d8cbfe83073bad818b26c28eb3e1a6c91 Author: Adam Borowski Date: Wed Jul 18 04:10:43 2018 +0200 vt: selection: handle storing of characters above U+FFFF Those above U+10FFFF get replaced with U+FFFD. Signed-off-by: Adam Borowski Acked-by: Nicolas Pitre Signed-off-by: Greg Kroah-Hartman commit 9ca7f2499845f3898598d84ad6522631aa7357f5 Author: Adam Borowski Date: Wed Jul 18 04:10:42 2018 +0200 vt: don't reinvent min() All the helper function saved us was a cast. Signed-off-by: Adam Borowski Acked-by: Nicolas Pitre Signed-off-by: Greg Kroah-Hartman commit 36ecc1481dc8d8c52d43ba18c6b642c1d2fde789 Author: Matthijs van Duin Date: Thu Jul 19 10:43:46 2018 +0200 pty: fix O_CLOEXEC for TIOCGPTPEER It was being ignored because the flags were not passed to fd allocation. Fixes: 54ebbfb16034 ("tty: add TIOCGPTPEER ioctl") Signed-off-by: Matthijs van Duin Acked-by: Aleksa Sarai Cc: stable Signed-off-by: Greg Kroah-Hartman commit 9005feae4785436db61837e26a391015da7401d9 Author: Colin Ian King Date: Fri Jul 20 19:32:29 2018 +0100 staging: rtl8712: remove redundant pointer 'nic' Pointer 'nic' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'nic' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 6bcba96e8543a2c7edaf3fb7c0673680b7de92bf Author: Ajay Singh Date: Thu Jul 19 04:15:19 2018 +0530 staging: wilc1000: move variable assignment along with its declaration Cleanup patch to club the variable assignment along with the variable declaration especially for private data. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit cd46d1b11433d92bcbecaccd48ba4860ed5f4c25 Author: Ajay Singh Date: Thu Jul 19 04:15:18 2018 +0530 staging: wilc1000: remove unnecessary 'NULL' check from cfg80211_ops callbacks Cleanup patch to remove the unnecessary 'NULL' check used in 'cfg80211_ops' callback functions. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 82120ec7afc3d6d36fe47e11007637048d1dd6f6 Author: Ajay Singh Date: Thu Jul 19 04:15:17 2018 +0530 staging: wilc1000: use 'int' inplace of 's32' date type Cleanup patch to use 'int' instead of 's32' to have the same data type based on its usage. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit d241877a1aca7e48f8da7ed3e8191e98c9675ebf Author: Ajay Singh Date: Thu Jul 19 04:15:16 2018 +0530 staging: wilc1000: avoid setting default value for variable at declaration Cleanup patch to avoid setting default value for local variables and also clubbed similar variables together. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 448d078449b70f73a6caabd804099e51801483d9 Author: Ajay Singh Date: Thu Jul 19 04:15:15 2018 +0530 staging: wilc1000: avoid forward declaration of host_int_parse_join_bss_param() Reorder the functions position in host interface to avoid forward declaration of host_int_parse_join_bss_param(). Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 8bdc6bbc0996886afd5b400b42fa654b518da58f Author: Ajay Singh Date: Thu Jul 19 04:15:14 2018 +0530 staging: wilc1000: avoid host_int_get_assoc_res_info() forward declaration Reorder the function position in host interface to avoid forward declaration of host_int_get_assoc_res_info(). Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 2653aade480741c38e0aacbf1fc21e5662d63ae6 Author: Ajay Singh Date: Thu Jul 19 04:15:13 2018 +0530 staging: wilc1000: avoid forward declaration for handle_scan_done() Reorder the function position in host interface to avoid forward declaration of handle_scan_done(). Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 674650fd643ed551e78af047381b6e30508b0f12 Author: Ajay Singh Date: Thu Jul 19 04:15:12 2018 +0530 staging: wilc1000: remove unnecessary type used for wid id Cleanup patch to remove unnecessary typecast used while assigning the WID ID. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 74cffafb668404daffb0ee46b711f0712a6823fa Author: Ajay Singh Date: Thu Jul 19 04:15:11 2018 +0530 staging: wilc1000: use single space before opening brances '{' Cleanup patch to use single space instead of multiple space before the '{'. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 9542c441a71454d00a876d8f870af33671424ab9 Author: Ajay Singh Date: Thu Jul 19 04:15:10 2018 +0530 staging: wilc1000: remove unnecessary blank line between variable declaration Cleanup patch to remove the unnecessary blank line between variables declaration inside the function. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 742a48699ea65c196865560a7240d5fda3e1fc63 Author: Ajay Singh Date: Thu Jul 19 04:15:09 2018 +0530 staging: wilc1000: use lowercase for 'IFC_UP' struct element name Cleanup patch to use lowercase for structure element name to follow linux coding style. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit e3da5d9d255f3d6919be5db8c0e7c80743e65be7 Author: Ajay Singh Date: Thu Jul 19 04:15:08 2018 +0530 staging: wilc1000: remove the mutliple #define used for same macro Moved the same #define in common header file instead of having their declartion in different files. Below macros are moved to header file: TCP_ACK_FILTER_LINK_SPEED_THRESH DEFAULT_LINK_SPEED GET_PKT_OFFSET Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit cf15e3dc8fbec6d91a77ed858a538ba924c819de Author: Ajay Singh Date: Thu Jul 19 04:15:07 2018 +0530 staging: wilc1000: removed unused element from wilc_cfg_frame struct Cleanup up patch to remove the unused structure elements in 'wilc_cfg_frame' struct. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 37d1a6dbb49248b5e9fb8c007736bc4351a90633 Author: Ajay Singh Date: Thu Jul 19 04:15:06 2018 +0530 staging: wilc1000: remove unnecessary elements from 'wilc_priv' struct Remove unused elements from 'wilc_priv' structure. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 9fdc7420f2824c7b00887aaaea767975c7eadf4d Author: Ajay Singh Date: Thu Jul 19 04:15:05 2018 +0530 staging: wilc1000: remove unused elements in 'wilc' struct Cleanup patch to remove unused elements from 'wilc' struct. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit ecba6b7477b2c52ea319a22f0c772196a1904812 Author: Ajay Singh Date: Thu Jul 19 04:15:04 2018 +0530 staging: wilc1000: rename enum AUTHTYPE to use lowercase Cleanup patch to rename enum AUTHTYPE to lowercase. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 90824b7cdfd517295b5db532cb27c5f25b081470 Author: Ajay Singh Date: Thu Jul 19 04:15:03 2018 +0530 staging: wilc1000: rename enum SITESURVEY to use lowercase Cleanup patch to have enum in lowercase as per linux coding style. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 05b9eaa7fc656a5612e3a0bdbe680e291402241e Author: Ajay Singh Date: Thu Jul 19 04:15:02 2018 +0530 staging: wilc1000: rename enum CURRENT_TXRATE to use lowercase Cleanup patch to rename enums in lowercase to follow linux coding style. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 18da9e4ad2cb02291b3f2d2c4f53790b50286557 Author: Ajay Singh Date: Thu Jul 19 04:15:01 2018 +0530 staging: wilc1000: rename goto to avoid leading '_' in label name Cleanup patch to avoid use of leading '_' in goto label name. Also used proper string for lable names. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 8c67e814fadc84e38ff6873081b0859ae2eb8025 Author: Ajay Singh Date: Thu Jul 19 04:15:00 2018 +0530 staging: wilc1000: remove extra enums defined for ieee80211_eid Cleanup patch to make use of existing enum 'ieee80211_eid' instead of adding new enum in WILC for element ID's. The below mapping is same to remove extra enum in WILC. SUPP_RATES_IE -> WLAN_EID_SUPP_RATES EXT_SUPP_RATES_IE -> WLAN_EID_EXT_SUPP_RATES HT_CAPABILITY_IE -> WLAN_EID_HT_CAPABILITY RSN_IE -> WLAN_EID_RSN WPA_IE -> WLAN_EID_VENDOR_SPECIFIC WMM_IE -> WLAN_EID_VENDOR_SPECIFIC P2P_IE -> WLAN_EID_VENDOR_SPECIFIC Also remove enum 'info_element_id' as its same as 'ieee80211_eid', below the mapping of elements of enums which are used. ITIM -> WLAN_EID_TIM IDSPARMS -> WLAN_EID_DS_PARAMS Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit b69845eaef2c5044d6e49ecfb11021cdfe6ffe1f Author: Ajay Singh Date: Thu Jul 19 04:14:59 2018 +0530 staging: wilc1000: remove extra enum defined for data rates Cleanup patch to remove extra enum defined to handle data rates. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit d300da185096353a45e76cd8faebc311a7ab4026 Author: Ajay Singh Date: Thu Jul 19 04:14:58 2018 +0530 staging: wilc1000: remove enum connect_status instead use ieee80211_statuscode Cleanup patch to remove the use of enum 'connect_status' and instead use predefined 'ieee80211_statuscode' for error code values. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit c3bfe9f186a57f7eca7e9846c4a68666228e40d5 Author: Ajay Singh Date: Thu Jul 19 04:14:57 2018 +0530 staging: wilc1000: remove unused enum declaration Cleanup patch to remove unused enums. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit e24411b3a099faa8ca7efcda589a08e3d60698f9 Author: John Whitmore Date: Fri Jul 20 21:21:34 2018 +0100 staging:rtl8192u: Remove typedef and rename DOT11D_STATE - Style Remove typedef from enumerated type DOT11D_STATE to clear checkpatch issue with declaring new types. Rename the enumertion from DOT11D_STATE to dot11d_state. These changes are coding style changes which should not effect runtime execution of code. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8132962a11a5747dd75641f4a5766f9ae311a419 Author: John Whitmore Date: Fri Jul 20 21:21:33 2018 +0100 staging:rtl8192u: Rename variable MaxTxPowerInDbm - Style Rename the variable MaxTxPowerInDbm to max_tx_pwr_dbm. This change clears a checkpatch issue with CamelCase naming. This coding style change should not impact runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 321639a74a9a9a03285c426c5a6a688f1df83572 Author: John Whitmore Date: Fri Jul 20 21:21:32 2018 +0100 staging:rtl8192u: Rename variable NumChnls - Style Rename the member variable NumChnls to num_channels. This change clears the checkpatch issue with CamelCase naming. The change should not impact runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 85f24df0b4ef85318951411189b917c1aced6b3d Author: John Whitmore Date: Fri Jul 20 21:21:31 2018 +0100 staging:rtl8192u: Rename structure member FirstChnl - Style Rename structure member FirstChnl to first_channel. This coding style change clears a checkpatch issue with CamelCase naming. This change should not impact the runtime code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 1f1590f25efda14dabdade01149f39b0bca37237 Author: John Whitmore Date: Fri Jul 20 21:21:30 2018 +0100 staging:rtl8192u: Remove typedef from structure - Style Remove the typedef directive from struct _CHNL_TXPOWER_TRIPLE. This is a coding style change which clears a checkpatch issue with declaring new types. There should be no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit b613aac2dc0eb6d3c4372e6255549931f1823134 Author: John Whitmore Date: Fri Jul 20 21:21:29 2018 +0100 staging:rtl8192u: Remove multiple blank lines - Style Remove multiple blank lines which cause checkpatch issues. These are purely coding style changes which should not impact execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit eae249b27f0447a92b3f8c72cc45fcc4609ae00d Merge: c59e18b876da 8ae71e76cf1f Author: David S. Miller Date: Fri Jul 20 23:58:30 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2018-07-20 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Add sharing of BPF objects within one ASIC: this allows for reuse of the same program on multiple ports of a device, and therefore gains better code store utilization. On top of that, this now also enables sharing of maps between programs attached to different ports of a device, from Jakub. 2) Cleanup in libbpf and bpftool's Makefile to reduce unneeded feature detections and unused variable exports, also from Jakub. 3) First batch of RCU annotation fixes in prog array handling, i.e. there are several __rcu markers which are not correct as well as some of the RCU handling, from Roman. 4) Two fixes in BPF sample files related to checking of the prog_cnt upper limit from sample loader, from Dan. 5) Minor cleanup in sockmap to remove a set but not used variable, from Colin. ==================== Signed-off-by: David S. Miller commit 288e0a7c22ee7fb210d93ed7a9a7c9563c8eb02e Author: John Whitmore Date: Mon Jul 16 20:04:52 2018 +0100 staging:rtl8192u: Rename TClass > t_class - Style Rename the struct TS_COMMON_INFO member variable from TClass to t_class. This change clears the checkpatch issue with CamelCase Variable names. There should be no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 912a9e0230bb20c4cfd5c537864acfd7c517f547 Author: John Whitmore Date: Mon Jul 16 20:04:51 2018 +0100 staging:rtl8192u: Rename TSpec > t_spec - Style Rename the TS_COMMON_INFO structure's member TSpec to t_spec. This change clears the checkpatch issue with CamelCase naming of variables. There should be no impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 12a540c3f41153bbaf26eb831316c4c81c4654fe Author: John Whitmore Date: Mon Jul 16 20:04:50 2018 +0100 staging:rtl8192u: Rename Addr > addr - Style Rename the TX_COMMON_INFO structure's member Addr to addr. This change clears the checkpatch issue with CamelCase naming. This is a coding style change only and should not impact runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 27c4a9bb9628e7d892de0b5fa80def9cc1894608 Author: John Whitmore Date: Mon Jul 16 20:04:49 2018 +0100 staging:rtl8192u: Rename InactTimer > inact_timer - Style Rename the struct TS_COMMON_INFO member InactTimer to inact_timer. This change clears the checkpatch issue with CamelCase naming. The change should not have any impact on runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 36cf191fd45047cd30083c7e3aa4d3f7cd3f604a Author: John Whitmore Date: Mon Jul 16 20:04:48 2018 +0100 staging:rtl8192u: rename SetupTimer > setup_timer - Style Rename the struct TS_COMMON_INFO member SetupTimer to setup_timer. This clears the checkpatch issue with CamelCase variable names. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit d48cc3c3981165303b8d3d7a3c1ede9ffe17a3df Author: John Whitmore Date: Mon Jul 16 20:04:47 2018 +0100 staging:rtl8192u: Rename List > list - Coding style In struct TS_COMMON_INFO rename the member List to list. This clears the checkpatch issue concerning CamelCase naming of variables. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6ae62698ee42ac1a368d33b0d95d38335c0d0e2f Author: John Whitmore Date: Mon Jul 16 20:04:46 2018 +0100 staging:rtl8192u: remove typedef of struct TS_COMMON_INFO - Style To clear a checkpatch issue removed the typedef of the structure TS_COMMON_INFO. This change removes the previous declaration, which defined two types, both TS_COMMON_INFO and a pointer type PTS_COMMON_INFO: typedef struct _TS_COMMON_INFO { ... } TS_COMMON_INFO, *PTS_COMMON_INFO; The pointer type has been completely removed from the code, as: "(so-called Hungarian notation) is brain damaged" according to the coding standard. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 336b25773c4efe83dbbde2453cad6c76ba35a551 Author: John Whitmore Date: Mon Jul 16 20:04:45 2018 +0100 staging:rtl8192u: remove typedef of enumeration TR_SELECT - Style To clear a checkpatch issue removed the typedef of the enumeration TR_SELECT this should not impact runtime code as it's only a coding style change. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 67e6ee898e4bde9be275ed02399eac1fafe686f9 Author: Ali Aminian Date: Fri Jul 20 08:32:04 2018 +0430 staging: rts5208: xd.c fixed a brace coding style issue Fixing a coding style issue Signed-off-by: Ali Aminian Signed-off-by: Greg Kroah-Hartman commit 0a31edbbf886752544e3a9800c7c37e26d27022c Author: Michael Straube Date: Mon Jul 16 17:04:49 2018 +0200 staging: rtl8188eu: remove blank lines Remove unrequired blank lines as reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 11790bbdf359f633cb48ba8c77f696c03505c3c7 Author: Michael Straube Date: Mon Jul 16 16:23:03 2018 +0200 staging: rtl8188eu: use is_multicast_ether_addr Use is_multicast_ether_addr instead of IS_MCAST. By definition the broadcast address is also a multicast address, so checking for !multicast in the conditional is sufficient. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit cfd645643496d4b66cde42070e7f879d2a738ebc Author: Michael Straube Date: Mon Jul 16 16:23:02 2018 +0200 staging: rtl8188eu: remove MacAddr_isBcst macro Use is_broadcast_ether_addr instead of the MacAddr_isBcst macro. The macro is not used anywhere else, so remove it. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 56edc4e3f909cf8d37e9aa16ce0b5dbc66734995 Author: Todd Poynor Date: Thu Jul 19 20:49:20 2018 -0700 staging: gasket: common ioctls add __user annotations Add __user annotation to gasket common ioctl pointer arguments for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit de3690d025fced530a587b820f00f67cd964289e Author: Todd Poynor Date: Thu Jul 19 20:49:19 2018 -0700 staging: gasket: common ioctl dispatcher add __user annotations Add __user annotation to gasket core common ioctl pointer arguments for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit c13435deaadca078ce5651c43ed8d7561215b20a Author: Todd Poynor Date: Thu Jul 19 20:49:18 2018 -0700 staging: gasket: apex ioctl add __user annotations Add __user annotation to ioctl pointer argument, for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 761d8db71436d8c67bcac85aa62860cb5848fecf Author: Todd Poynor Date: Thu Jul 19 20:49:17 2018 -0700 staging: gasket: top ioctl handler add __user annotations Add __user annotation to gasket_core top-level ioctl handling pointer arguments, for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit ed74277bd80a47ec552ccf3581583421c3a4df5d Author: Todd Poynor Date: Thu Jul 19 20:49:16 2018 -0700 staging: gasket: always allow root open for write Always allow root to open device for writing. Drop special-casing of ioctl permissions for root vs. owner. Convert to bool types as appropriate. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 563f3bb51f59e288879c099b2e8ee1496b7c3234 Author: Todd Poynor Date: Thu Jul 19 20:49:15 2018 -0700 staging: gasket: fix multi-line comment syntax in gasket_core.h Use consistent kernel-style multi-line comment syntax. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 40eb35023179e90b123f8c4b0bc5e1a412ff2d21 Author: Todd Poynor Date: Thu Jul 19 20:49:14 2018 -0700 staging: gasket: remove extra parens in gasket_write_mappable_regions Remove unneeded parentheses around subexpressions. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit fd5d76ab69a565ebcab94f11f185ea3dc5588249 Author: Todd Poynor Date: Thu Jul 19 20:49:13 2018 -0700 staging: gasket: gasket_mmap use PAGE_MASK gasket_mmap use PAGE_MASK, instead of performing math on PAGE_SIZE, for simplicity and clarity. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 0b184cc86542cf6938e82c61b0951e799ceceb9b Author: Todd Poynor Date: Thu Jul 19 20:49:12 2018 -0700 staging: gasket: remove unnecessary parens in page table code gasket_alloc_coherent_memory() extra parentheses in statement. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 4e48c29fe086a14c9a15381562d1f79dbbfb10d8 Author: Todd Poynor Date: Thu Jul 19 20:49:11 2018 -0700 staging: gasket: fix comment syntax in apex.h Use kernel-style multi-line comment syntax. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 6d8a1d564bc01b1f3402d229acb98f779440c5e3 Author: Todd Poynor Date: Thu Jul 19 20:49:10 2018 -0700 staging: gasket: remove else clause after return in if clause Else after return is unnecessary and may cause static code checkers to complain. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit c5172a29d7386753e19f4860351b0fda06863d47 Author: Todd Poynor Date: Thu Jul 19 20:49:09 2018 -0700 staging: gasket: gasket page table functions use bool return type Convert from int to bool return type for gasket page table functions that return values used as booleans. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 9116223b84da485735b495bda6c35b43f005d222 Author: Todd Poynor Date: Thu Jul 19 20:49:08 2018 -0700 staging: gasket: apex_clock_gating simplify logic, reduce indentation Collapse together two checks and return immediately, avoid conditional indentation for most of function code. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e80d8afc97fb243833d9939b5098a89379433b3c Author: Todd Poynor Date: Thu Jul 19 20:49:07 2018 -0700 staging: gasket: gasket_mmap return error instead of valid BAR index When offset to be mapped matches both a BAR region and a coherent mapped region return an error as intended, not the BAR index. Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit ec45f01668e42f3dc3f18e11fa8655ad150ca250 Author: Todd Poynor Date: Thu Jul 19 20:49:06 2018 -0700 staging: gasket: don't treat no device reset callback as an error It is not an error for a device to not have a reset callback registered. Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit ed6e96c7951b85bb5c6a50503baa2fd9bfbb0510 Author: Todd Poynor Date: Thu Jul 19 20:49:05 2018 -0700 staging: gasket: remove unnecessary code in coherent allocator Remove extraneous statement in gasket_config_coherent_allocator() Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit ae27b2f9f76afc7bf77ef6001ba47fad43a9fce3 Author: Todd Poynor Date: Thu Jul 19 20:49:04 2018 -0700 staging: gasket: fix class create bug handling class_create() never returns NULL, and this driver should never return PTR_ERR(NULL) anyway. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Reviewed-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman commit b6fdbbb743ce86030d0898b53d64ff009fd50faa Author: Todd Poynor Date: Thu Jul 19 20:49:03 2018 -0700 staging: gasket: remove code for no physical device gasket_enable_dev code for enabling a gasket device with no physical PCI device registered shouldn't be necessary. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 7a013c5026df8fea863c13f414b5bda93039a906 Author: Todd Poynor Date: Thu Jul 19 20:49:02 2018 -0700 staging: gasket: gasket_enable_dev remove unnecessary variable Remove unnecessary variable, pass constant param instead. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit ec54d1abef2ccef6dde1028c0666717d6b636611 Author: Todd Poynor Date: Thu Jul 19 20:49:01 2018 -0700 staging: gasket: allow compile for ARM64 in Kconfig The gasket and apex drivers are also to be used on ARM64 architectures. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e7de2590f18a272e63732b9d519250d1b522b2c4 Author: Hailong Liu Date: Fri Jul 20 08:31:56 2018 +0800 uio: fix wrong return value from uio_mmap() uio_mmap has multiple fail paths to set return value to nonzero then goto out. However, it always returns *0* from the *out* at end, and this will mislead callers who check the return value of this function. Fixes: 57c5f4df0a5a0ee ("uio: fix crash after the device is unregistered") CC: Xiubo Li Signed-off-by: Hailong Liu Cc: stable Signed-off-by: Jiang Biao Signed-off-by: Greg Kroah-Hartman commit c59e18b876da3e466abe5fa066aa69050f5be17c Merge: 7c4ec749a3bd 705e0dea4d52 Author: David S. Miller Date: Fri Jul 20 23:44:36 2018 -0700 Merge branch 'Make-sys-class-net-per-net-namespace-objects-belong-to-container' Tyler Hicks says: ==================== Make /sys/class/net per net namespace objects belong to container This is a revival of an older patch set from Dmitry Torokhov: https://lore.kernel.org/lkml/1471386795-32918-1-git-send-email-dmitry.torokhov@gmail.com/ My submission of v2 is here: https://lore.kernel.org/lkml/1531497949-1766-1-git-send-email-tyhicks@canonical.com/ Here's Dmitry's description: There are objects in /sys hierarchy (/sys/class/net/) that logically belong to a namespace/container. Unfortunately all sysfs objects start their life belonging to global root, and while we could change ownership manually, keeping tracks of all objects that come and go is cumbersome. It would be better if kernel created them using correct uid/gid from the beginning. This series changes kernfs to allow creating object's with arbitrary uid/gid, adds get_ownership() callback to ktype structure so subsystems could supply their own logic (likely tied to namespace support) for determining ownership of kobjects, and adjusts sysfs code to make use of this information. Lastly net-sysfs is adjusted to make sure that objects in net namespace are owned by the root user from the owning user namespace. Note that we do not adjust ownership of objects moved into a new namespace (as when moving a network device into a container) as userspace can easily do it. I'm reviving this patch set because we would like this feature for system containers. One specific use case that we have is that libvirt is unable to configure its bridge device inside of a system container due to the bridge files in /sys/class/net/ being owned by init root instead of container root. The last two patches in this set are patches that I've added to Dmitry's original set to allow such configuration of the bridge device. Eric had previously provided feedback that he didn't favor these changes affecting all layers of the stack and that most of the changes could remain local to drivers/base/core.c. That feedback is certainly sensible but I wanted to send out v2 of the patch set without making that large of a change since quite a bit of time has passed and the bridge changes in the last patch of this set shows that not all of the changes will be local to drivers/base/core.c. I'm happy to make the changes if the original request still stands. * Changes since v2: - Added my Co-Developed-by and Signed-off-by tags to all of Dmitry's patches that I've modified - Patch 1 received build failure fixes in arch/x86/kernel/cpu/intel_rdt_rdtgroup.c - Patch 2 was updated to drop the declaration of sysfs_add_file() from sysfs.h since the patch removed all other uses of the function - Patch 5 is a new patch that prevents tx_maxrate from being written to from inside of a container + Maybe I'm being too cautious here but the restriction can always be loosened up later - Patches 6 and 7 were updated to make net_ns_get_ownership() always initialize uid and gid, even when the network namespace is NULL, so that it isn't a dangerous function to reuse + Requested by Christian Brauner - I've looked at all sysfs attributes affected by this patch set and feel comfortable about the changes. There are quite a few affected attributes that don't have any capable()/ns_capable() checks in their store operations (per_bond_attrs, at91_sysfs_attrs, sysfs_grcan_attrs, ican3_sysfs_attrs, cdc_ncm_sysfs_attrs, qmi_wwan_sysfs_attrs) but I think this is acceptable. It means that container root, rather than specifically CAP_NET_ADMIN inside of the network namespace that the device belongs to, can write to those device attributes. It's the same situation that those devices have today in that init root is able to write to the attributes without necessarily having CAP_NET_ADMIN. I think that this should probably be fixed in order to be consistent with what netdev_store() does by verifying CAP_NET_ADMIN in the network namespace but that it doesn't need to happen in this patch set. ==================== Signed-off-by: David S. Miller commit 705e0dea4d52ef420a7d37fd9cc6725092e5e1ff Author: Tyler Hicks Date: Fri Jul 20 21:56:54 2018 +0000 bridge: make sure objects belong to container's owner When creating various bridge objects in /sys/class/net/... make sure that they belong to the container's owner instead of global root (if they belong to a container/namespace). Signed-off-by: Tyler Hicks Signed-off-by: David S. Miller commit fbdeaed408cf2728c62640c10848ddb1b67e63d3 Author: Tyler Hicks Date: Fri Jul 20 21:56:53 2018 +0000 net: create reusable function for getting ownership info of sysfs inodes Make net_ns_get_ownership() reusable by networking code outside of core. This is useful, for example, to allow bridge related sysfs files to be owned by container root. Add a function comment since this is a potentially dangerous function to use given the way that kobject_get_ownership() works by initializing uid and gid before calling .get_ownership(). Signed-off-by: Tyler Hicks Signed-off-by: David S. Miller commit b0e37c0d8a6abed0cd1b611314a7ebf50b0a8ed4 Author: Dmitry Torokhov Date: Fri Jul 20 21:56:52 2018 +0000 net-sysfs: make sure objects belong to container's owner When creating various objects in /sys/class/net/... make sure that they belong to container's owner instead of global root (if they belong to a container/namespace). Co-Developed-by: Tyler Hicks Signed-off-by: Dmitry Torokhov Signed-off-by: Tyler Hicks Signed-off-by: David S. Miller commit 3033fced2f689d4a870b3ba6a8a676db1261d262 Author: Tyler Hicks Date: Fri Jul 20 21:56:51 2018 +0000 net-sysfs: require net admin in the init ns for setting tx_maxrate An upcoming change will allow container root to open some /sys/class/net files for writing. The tx_maxrate attribute can result in changes to actual hardware devices so err on the side of caution by requiring CAP_NET_ADMIN in the init namespace in the corresponding attribute store operation. Signed-off-by: Tyler Hicks Signed-off-by: David S. Miller commit 9944e894c1266dc8515c82d1ff752d681215526b Author: Dmitry Torokhov Date: Fri Jul 20 21:56:50 2018 +0000 driver core: set up ownership of class devices in sysfs Plumb in get_ownership() callback for devices belonging to a class so that they can be created with uid/gid different from global root. This will allow network devices in a container to belong to container's root and not global root. Signed-off-by: Dmitry Torokhov Reviewed-by: Tyler Hicks Signed-off-by: David S. Miller commit d028b6f703209dbe96201b2714ff46625877128e Author: Dmitry Torokhov Date: Fri Jul 20 21:56:49 2018 +0000 kobject: kset_create_and_add() - fetch ownership info from parent This change implements get_ownership() for ksets created with kset_create_and_add() call by fetching ownership data from parent kobject. This is done mostly for benefit of "queues" attribute of net devices so that corresponding directory belongs to container's root instead of global root for network devices in a container. Signed-off-by: Dmitry Torokhov Reviewed-by: Tyler Hicks Signed-off-by: David S. Miller commit 5f81880d5204ee2388fd9a75bb850ccd526885b7 Author: Dmitry Torokhov Date: Fri Jul 20 21:56:48 2018 +0000 sysfs, kobject: allow creating kobject belonging to arbitrary users Normally kobjects and their sysfs representation belong to global root, however it is not necessarily the case for objects in separate namespaces. For example, objects in separate network namespace logically belong to the container's root and not global root. This change lays groundwork for allowing network namespace objects ownership to be transferred to container's root user by defining get_ownership() callback in ktype structure and using it in sysfs code to retrieve desired uid/gid when creating sysfs objects for given kobject. Co-Developed-by: Tyler Hicks Signed-off-by: Dmitry Torokhov Signed-off-by: Tyler Hicks Signed-off-by: David S. Miller commit 488dee96bb62f0b3d9e678cf42574034d5b033a5 Author: Dmitry Torokhov Date: Fri Jul 20 21:56:47 2018 +0000 kernfs: allow creating kernfs objects with arbitrary uid/gid This change allows creating kernfs files and directories with arbitrary uid/gid instead of always using GLOBAL_ROOT_UID/GID by extending kernfs_create_dir_ns() and kernfs_create_file_ns() with uid/gid arguments. The "simple" kernfs_create_file() and kernfs_create_dir() are left alone and always create objects belonging to the global root. When creating symlinks ownership (uid/gid) is taken from the target kernfs object. Co-Developed-by: Tyler Hicks Signed-off-by: Dmitry Torokhov Signed-off-by: Tyler Hicks Signed-off-by: David S. Miller commit fbb5858c1467ef8feccc910ac9e9f529186a9f9d Author: Stephen Hemminger Date: Fri Jul 20 15:11:26 2018 -0700 uio: add SPDX license tag Replace short statement in comment with proper SPDX license tag. Signed-off-by: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman commit 3bae8cea04c6db58e5e694e708bd33dac924bf30 Author: Geert Uytterhoeven Date: Fri Jul 20 14:19:40 2018 +0200 serial: sh-sci: Document that serial aliases became optional Serial aliases are optional since commit 7678f4c20fa7670f ("serial: sh-sci: Add support for dynamic instances"). Update the DT bindings to reflect this. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit ac8a103e695c500acc83eb5cd816d25d7a6da52f Author: Geert Uytterhoeven Date: Fri Jul 20 14:18:26 2018 +0200 serial: sh-sci: Drop superfluous assignment in sci_request_dma() No later code uses the assigned value, so it can be dropped. Reported-by: Simon Horman Fixes: 2c4ee23530ffc022 ("serial: sh-sci: Postpone DMA release when falling back to PIO") Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit 26f22d5748b4bebb2ab719a39ca185398b92aa14 Author: Andy Shevchenko Date: Wed Jul 18 18:20:49 2018 +0300 serial: 8250_exar: Describe all members in struct exar8250_board Describe all memebers in struct exar8250_board, otherwise we get a warning: drivers/tty/serial/8250/8250_exar.c:122: warning: Function parameter or member 'has_slave' not described in 'exar8250_board' drivers/tty/serial/8250/8250_exar.c:122: warning: Function parameter or member 'setup' not described in 'exar8250_board' drivers/tty/serial/8250/8250_exar.c:122: warning: Function parameter or member 'exit' not described in 'exar8250_board' No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit 328c11f24b5702d37b6a8e8d9836d964257e7d41 Author: Andy Shevchenko Date: Wed Jul 18 18:20:48 2018 +0300 serial: 8250_exar: Remove useless has_slave member Exar UARTs by default supports only up to 8 channels, all above go as extension. Thus, there is no need to have an additional property to distinguish them from first ones. Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit 2ff5fa7f742ab0c6902f799adb9a5a912b9f03a5 Author: Phil Edworthy Date: Fri Jul 13 10:33:49 2018 +0100 serial: 8250_dw: Add compatible string for Renesas RZ/N1 UART The Renesas RZ/N1 UART is based on the Synopsys DW UART, but has additional registers for DMA. This patch does not address the changes required for DMA support, it simply adds the compatible string. Signed-off-by: Phil Edworthy Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman commit 72b0505f0830df9531cffa5e22cebb8a551f5ba8 Author: Phil Edworthy Date: Fri Jul 13 10:33:48 2018 +0100 dt: serial: Add Renesas RZ/N1 binding documentation The RZ/N1 UART is a modified Synopsys DesignWare UART. The modifications only relate to DMA so you could actually use the controller with the Synopsys compatible string if you are not using DMA, but you should not do so. Signed-off-by: Phil Edworthy Reviewed-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman commit 1481ecf1941a35a3e82d0f3e8fe9a2bdce28ee6f Author: Geert Uytterhoeven Date: Tue Jul 17 10:58:10 2018 +0200 serial: sh-sci: Fix use-after-free on subsequent port startup sci_request_irq() checks port->irqstr[j] for a NULL pointer, to decide if a fallback interrupt name string should be allocated or not. While this string is freed during port shutdown, the pointer is not zeroed. Hence on a subsequent startup of the port, it will still be pointing to the freed memory, leading to e.g. WARNING: CPU: 0 PID: 404 at fs/proc/generic.c:388 __proc_create+0xbc/0x260 name len 0 or to a crash (the latter is more likely with CONFIG_DEBUG_SLAB=y, due to the poisoning of freed memory). Instead of zeroeing the pointer at multiple places, preinitialize port->irqstr[j] to zero to fix this. Fixes: 8b0bbd956228ae87 ("serial: sh-sci: Add support for R7S9210") Signed-off-by: Geert Uytterhoeven Reviewed-by: Ulrich Hecht Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman commit 7c4ec749a3bd89237d7195ccd621bf5d4124d6b5 Author: David S. Miller Date: Fri Jul 20 23:37:55 2018 -0700 net: Init backlog NAPI's gro_hash. Based upon a patch by Sean Tranchetti. Fixes: d4546c2509b1 ("net: Convert GRO SKB handling to list_head.") Signed-off-by: David S. Miller commit 12dcaeb77e67c1162a2604f6b589266baec2d1ef Author: Guido Kiener Date: Wed Jul 18 10:45:39 2018 +0200 usb: usbtmc: Add ioctl for termination character add USBTMC_IOCTL_CONFIG_TERMCHAR to control TermChar handling for next read(). Controls field 'TermChar' and Bit 1 of field 'bmTransferAttributes' of REQUEST_DEV_DEP_MSG_IN BULK-OUT header. Allows enabling/disabling of terminating a read on reception of term_char individually for each read request. Reviewed-by: Steve Bayless Tested-by: Dave Penkler Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener Signed-off-by: Greg Kroah-Hartman commit fbd83971f9429849dd3a105b663822d15b7b992b Author: Guido Kiener Date: Wed Jul 18 10:45:38 2018 +0200 usb: usbtmc: Add ioctl for EOM bit add USBTMC_IOCTL_EOM_ENABLE to specify EOM bit for next write() call. Sets Bit 0 of field 'bmTransferAttributes' of DEV_DEP_MSG_OUT Bulk-OUT Header. Allows fine grained control over end of message handling on a per file descriptor basis. Reviewed-by: Steve Bayless Tested-by: Dave Penkler Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener Signed-off-by: Greg Kroah-Hartman commit fe78a7c637057070f20ac9460608a18d775e6349 Author: Guido Kiener Date: Wed Jul 18 10:45:37 2018 +0200 usb: usbtmc: Add ioctl for trigger add USBTMC488_IOCTL_TRIGGER to send TRIGGER Bulk-OUT header according to Subclass USB488 Specification The usbtmc trigger command is equivalent to the IEEE 488 GET (Group Execute Trigger) action. While the "*TRG" command can be sent as data to perform the same operation, in some situations an instrument will be busy and unable to process the data immediately in which case the USBTMC488_IOCTL_TRIGGER can be used to trigger the instrument with lower latency. Reviewed-by: Steve Bayless Tested-by: Dave Penkler Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener Signed-off-by: Greg Kroah-Hartman commit 048c6d88a0214757926f264823829e79154fcd4f Author: Guido Kiener Date: Wed Jul 18 10:45:36 2018 +0200 usb: usbtmc: Add ioctls to set/get usb timeout Add ioctls USBTMC_IOCTL_GET_TIMEOUT / USBTMC_IOCTL_SET_TIMEOUT to get/set I/O timeout for specific file handle. Different operations on an instrument can take different lengths of time thus it is important to be able to set the timeout slightly longer than the expected duration of each operation to optimise the responsiveness of the application. As the instrument may be shared by multiple applications the timeout should be settable on a per file descriptor basis. Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener Signed-off-by: Greg Kroah-Hartman commit 19e6c57e96169cb3275fd40b7898454560b9ebba Author: Guido Kiener Date: Wed Jul 18 10:45:35 2018 +0200 usb: usbtmc: use consistent timeout error - use consistent error value ETIMEOUT instead of ETIME Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Guido Kiener Signed-off-by: Greg Kroah-Hartman commit 4f3c8d6eddc272b386464524235440a418ed2029 Author: Guido Kiener Date: Wed Jul 18 10:45:34 2018 +0200 usb: usbtmc: Support Read Status Byte with SRQ per file Add 'struct usbtmc_file_data' for each file handle to cache last srq_byte (=Status Byte with SRQ) received by usbtmc_interrupt(..) usbtmc488_ioctl_read_stb returns cached srq_byte when available for each file handle to avoid race conditions of concurrent applications. SRQ now sets EPOLLPRI instead of EPOLLIN since EPOLLIN is now reserved for asynchronous reads Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Guido Kiener Signed-off-by: Greg Kroah-Hartman commit 04b453c859d3be8f3f992f929bfa2957db184e4b Author: Randy Dunlap Date: Sun Jul 15 10:37:37 2018 -0700 usb/phy: fix PPC64 build errors in phy-fsl-usb.c Fix build errors when built for PPC64: These variables are only used on PPC32 so they don't need to be initialized for PPC64. ../drivers/usb/phy/phy-fsl-usb.c: In function 'usb_otg_start': ../drivers/usb/phy/phy-fsl-usb.c:865:3: error: '_fsl_readl' undeclared (first use in this function); did you mean 'fsl_readl'? _fsl_readl = _fsl_readl_be; ../drivers/usb/phy/phy-fsl-usb.c:865:16: error: '_fsl_readl_be' undeclared (first use in this function); did you mean 'fsl_readl'? _fsl_readl = _fsl_readl_be; ../drivers/usb/phy/phy-fsl-usb.c:866:3: error: '_fsl_writel' undeclared (first use in this function); did you mean 'fsl_writel'? _fsl_writel = _fsl_writel_be; ../drivers/usb/phy/phy-fsl-usb.c:866:17: error: '_fsl_writel_be' undeclared (first use in this function); did you mean 'fsl_writel'? _fsl_writel = _fsl_writel_be; ../drivers/usb/phy/phy-fsl-usb.c:868:16: error: '_fsl_readl_le' undeclared (first use in this function); did you mean 'fsl_readl'? _fsl_readl = _fsl_readl_le; ../drivers/usb/phy/phy-fsl-usb.c:869:17: error: '_fsl_writel_le' undeclared (first use in this function); did you mean 'fsl_writel'? _fsl_writel = _fsl_writel_le; and the sysfs "show" function return type should be ssize_t, not int: ../drivers/usb/phy/phy-fsl-usb.c:1042:49: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types] static DEVICE_ATTR(fsl_usb2_otg_state, S_IRUGO, show_fsl_usb2_otg_state, NULL); Signed-off-by: Randy Dunlap Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman commit 64ce7e9de7739cad574a965f27f6477c1342479f Merge: 555e7943f281 8a9dbb779fe8 Author: Greg Kroah-Hartman Date: Sat Jul 21 08:13:02 2018 +0200 Merge tag 'extcon-next-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon for 4.19 Detailed description for this pull request: 1. Release locking when sending the connector state in extcon_sync() - Previously, extcon used the spinlock before calling the notifier_call_chain to prevent the scheduled out of task and to prevent the notification delay. When spinlock is locked for sending the notification, deadlock issue occured on the side of extcon consumer device. To fix this issue on extcon consumer device, release locking when sending the connector state. 2. Fix minor issues of extcon provider driver - extcon-intel-int3496.c uses 'linux/gpio/consumer.h' instead of 'linux/gpio.h' - extcon-usbc-cors-ec.c adds SPDX license and fix the wrong license information commit 000c4662ab3ef70789f724d44c55f69476fe6aa8 Author: Stephen Boyd Date: Mon May 21 23:23:52 2018 -0700 arm64: dts: qcom: Add pmu node to sdm845 Add the CPU PMU on sdm845 to get perf support for hardware events. Signed-off-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross commit 99d20a461c43556242a4e1b65e309f1c1fadea4f Merge: c4c5551df136 24c458c485c8 Author: David S. Miller Date: Fri Jul 20 22:28:28 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next Pablo Neira Ayuso says: ==================== Netfilter/IPVS updates for net-next The following patchset contains Netfilter/IPVS updates for your net-next tree: 1) No need to set ttl from reject action for the bridge family, from Taehee Yoo. 2) Use a fixed timeout for flow that are passed up from the flowtable to conntrack, from Florian Westphal. 3) More preparation patches for tproxy support for nf_tables, from Mate Eckl. 4) Remove unnecessary indirection in core IPv6 checksum function, from Florian Westphal. 5) Use nf_ct_get_tuplepr() from openvswitch, instead of opencoding it. From Florian Westphal. 6) socket match now selects socket infrastructure, instead of depending on it. From Mate Eckl. 7) Patch series to simplify conntrack tuple building/parsing from packet path and ctnetlink, from Florian Westphal. 8) Fetch timeout policy from protocol helpers, instead of doing it from core, from Florian Westphal. 9) Merge IPv4 and IPv6 protocol trackers into conntrack core, from Florian Westphal. 10) Depend on CONFIG_NF_TABLES_IPV6 and CONFIG_IP6_NF_IPTABLES respectively, instead of IPV6. Patch from Mate Eckl. 11) Add specific function for garbage collection in conncount, from Yi-Hung Wei. 12) Catch number of elements in the connlimit list, from Yi-Hung Wei. 13) Move locking to nf_conncount, from Yi-Hung Wei. 14) Series of patches to add lockless tree traversal in nf_conncount, from Yi-Hung Wei. 15) Resolve clash in matching conntracks when race happens, from Martynas Pumputis. 16) If connection entry times out, remove template entry from the ip_vs_conn_tab table to improve behaviour under flood, from Julian Anastasov. 17) Remove useless parameter from nf_ct_helper_ext_add(), from Gao feng. 18) Call abort from 2-phase commit protocol before requesting modules, make sure this is done under the mutex, from Florian Westphal. 19) Grab module reference when starting transaction, also from Florian. 20) Dynamically allocate expression info array for pre-parsing, from Florian. 21) Add per netns mutex for nf_tables, from Florian Westphal. 22) A couple of patches to simplify and refactor nf_osf code to prepare for nft_osf support. 23) Break evaluation on missing socket, from Mate Eckl. 24) Allow to match socket mark from nft_socket, from Mate Eckl. 25) Remove dependency on nf_defrag_ipv6, now that IPv6 tracker is built-in into nf_conntrack. From Florian Westphal. ==================== Signed-off-by: David S. Miller commit ab8b1fdd012f41b27f85a6bb271389fd7ff349ea Merge: 91f6278bfa39 770368961767 Author: Tony Lindgren Date: Fri Jul 20 22:22:08 2018 -0700 Merge branch 'omap-for-v4.19/dt-sysc-v2' into omap-for-v4.19/dt commit 770368961767aa8116ca44a9bd3f90c11ca4c30b Author: Tony Lindgren Date: Fri Jul 6 00:44:29 2018 -0700 ARM: dts: omap4: Add l4 ranges for 4460 Compared to 4430, 4460 and 4470 just have slightly different l4 cfg ranges. Signed-off-by: Tony Lindgren commit 84badc5ec5fc01e7cb16f5e1628b2fe8d8965a57 Author: Tony Lindgren Date: Thu Jul 5 23:19:37 2018 -0700 ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc With l4 interconnect hierarchy and ti-sysc interconnect target module data in place, we can simply move all the related child devices to their proper location and enable probing using ti-sysc. In general the first child device address range starts at range 0 from the ti-sysc interconnect target so the move involves adjusting the child device reg properties for that. And we cannot yet move mmu_dsp until we have a proper reset controller driver for rstctrl registers. In case of any regressions, problem devices can be reverted to probe with legacy platform data as needed by moving them back and removing the related interconnect target module node. Signed-off-by: Tony Lindgren commit 4bce678624227b5f5e020a3ff05205d40f6677c0 Author: Tony Lindgren Date: Fri Jul 6 02:55:34 2018 -0700 ARM: dts: omap4: Probe watchdog 3 with ti-sysc Before updating wdt2 to probe with ti-sysc we want to have wdt3 probed with ti-sysc to avoid having them unnecessarily swap order. With ti-sysc, we probe child devices at module_init time while and until l4 abe interconnect is converted to use ti-sysc, wdt3 will probe earlier with legacy platform data. Cc: Peter Ujfalusi Signed-off-by: Tony Lindgren commit 8f42cb7f64c7ffcb2168305ea6e9724cd82562ef Author: Tony Lindgren Date: Thu Jul 5 23:04:31 2018 -0700 ARM: dts: omap4: Add l4 interconnect hierarchy and ti-sysc data Let's add proper interconnect hierarchy for l4 interconnect instances with the related ti-sysc interconnect module data as documented in Documentation/devicetree/bindings/bus/ti-sysc.txt. Using ti-sysc driver binding allows us to start dropping legacy platform data in arch/arm/mach-omap2/omap*hwmod*data.c files later on in favor of ti-sysc dts data. For setting up a proper hierarchy for the interconnect and ti-sysc data, there are multiple reasons: 1. We can use dts ranges to protect registers from being ioremapped from other devices and prevent hard to track issues with failed flush of posted write between modules 2. Some of the ranges may not be accessible to operating systems at all if configured so on high-security devices 3. The interconnect hierarchy provides proper clockdomain hierarchy that can be used for genpd later on 4. We can avoid almost all deferred probe related issues simply by probing the resource providing interconnect instance first for l4 wkup instance 5. With deferred probe issues gone, we can probe everything later at module_init time except for system timer and interrupt controller and their clocks. This data is generated based on platform data from a booted system and the interconnect acces protection registers for ranges. To avoid regressions, we initially validate the device tree provided data against the existing platform data on boot. Each interconnect instance is typically divided into segments to avoid powering up the whole interconnect. And each segment has one or more ranges TI specific interconnect target modules connected to it. Some devices can also have a separate data access port directly to the parent L3 interconnect for DMA that can be set up as a separate range. Note that we cannot yet include this file from omap4.dtsi until child devices are moved to their proper locations in the interconnect hierarchy in the following patch. Otherwise we would have the each module probed twice. Also note that this does not yet add l4 abe instance, that will be added separately later on. Signed-off-by: Tony Lindgren commit 5600779ea5f3d29fadc62208e21feb0bb9b813aa Author: Christoph Hellwig Date: Thu Jul 19 06:02:32 2018 -0700 openrisc: use generic dma_noncoherent_ops Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig Signed-off-by: Stafford Horne commit 2c1de929aef31afbff0dad81de9cc26056d3d01b Author: Christoph Hellwig Date: Thu Jul 19 06:02:31 2018 -0700 openrisc: fix cache maintainance the the sync_single_for_device DMA operation The cache maintaince in the sync_single_for_device operation should be equivalent to the map_page operation to facilitate reusing buffers. Fix the openrisc implementation by moving the cache maintaince performed in map_page into the sync_single method, and calling that from map_page. Signed-off-by: Christoph Hellwig Signed-off-by: Stafford Horne commit dcc9c91944129c9541cafe3112e69c1bdd328701 Author: Christoph Hellwig Date: Thu Jul 19 06:02:30 2018 -0700 openrisc: remove the no-op unmap_page and unmap_sg DMA operations Signed-off-by: Christoph Hellwig Signed-off-by: Stafford Horne commit 1902cbcc8ba16b5481bd7d3d7759f471a6829842 Author: Christoph Hellwig Date: Thu Jul 19 06:02:29 2018 -0700 openrisc: remove the sync_single_for_cpu DMA operation openrisc does all the required cache maintainance at dma map time, and none at unmap time. It thus has to implement sync_single_for_device to match the map cace for buffer reuse, but there is no point in doing another invalidation in the sync_single_cpu_case, which in terms of cache maintainance is equivalent to the unmap case. Signed-off-by: Christoph Hellwig Signed-off-by: Stafford Horne commit c4c5551df136a7c4edd7c2f433d9a296b39826a2 Merge: 40999f11ce67 48e5aee81f32 Author: David S. Miller Date: Fri Jul 20 14:45:10 2018 -0700 Merge ra.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux All conflicts were trivial overlapping changes, so reasonably easy to resolve. Signed-off-by: David S. Miller commit eaed0291c62f7b513ad9483b02efdccd4ae4e9fc Author: Robin Gong Date: Fri Jul 13 21:08:47 2018 +0800 ARM: imx_v6_v7_defconfig: add DMATEST support Add DMATEST support and remove invalid options, such as CONFIG_BT_HCIUART_H4 is default enabled and CONFIG_SND_SOC_IMX_WM8962 is out of date and not appear in any config file. Please refer to Documentation/driver-api/dmaengine/dmatest.rst to test MEMCPY feature of imx-sdma. Signed-off-by: Robin Gong Signed-off-by: Shawn Guo commit 33a8d5a595dd0f9b7f801c1cddb26dc05bc33a73 Author: Anson Huang Date: Thu Jul 19 16:24:19 2018 +0800 ARM: dts: imx7d: remove "operating-points" property for cpu1 Commit b97872d4eb22 ("ARM: dts: imx: Add missing OPP properties for CPUs") added "operating-points" property for all CPUs, but i.MX7D already has "operating-points-v2" property on both CPUs, so no need to add "operating-points" property again, this patch removes it. Fixes: b97872d4eb22 ("ARM: dts: imx: Add missing OPP properties for CPUs") Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 55e20919709878d2391eab20252a0a0b9d1fe20a Author: Andrey Smirnov Date: Thu Jul 19 13:00:02 2018 -0700 ARM: dts: vf610-zii-ssmb-spu3: Fix W=1 level warnings Fix a couple of things that were causing warning when building DTB with W=1. Cc: Fabio Estevam Cc: cphealy@gmail.com Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Signed-off-by: Shawn Guo commit 19fddda14765dc72b0a5ed9ce9ea5940587c6403 Author: Andrey Smirnov Date: Thu Jul 19 12:57:24 2018 -0700 ARM: dts: vf610: Add ZII CFU1 board Add support for the Zodiac Inflight Innovations CFU1 board (VF610-based). Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrew Lunn Signed-off-by: Andrey Smirnov Tested-by: Chris Healy Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 788654285da76dc853ebd25a5ecb4043de22d0e5 Author: Serge Semin Date: Fri Jul 20 23:14:27 2018 +0300 mips: mm: Discard ioremap_cacheable_cow() method This macro substitution is the shortcut to map cacheable IO memory with coherent and write-back attributes. Since it is entirely unused by kernel, lets just remove it. Signed-off-by: Serge Semin Signed-off-by: Paul Burton Suggested-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19937/ CC: Paul Burton Cc: James Hogan Cc: Ralf Baechle Cc: Sinan Kaya Cc: Huacai Chen Cc: Sergey.Semin@t-platforms.ru Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit 263fe5d45dcd0c610e41d1662f83cdd43b881cc5 Author: Jae Hyun Yoo Date: Mon Jul 2 14:40:11 2018 -0700 i2c: aspeed: Adjust spinlock scope in the irq handler This patch adjusts spinlock scope to make it wrap the whole irq handler using a single lock/unlock which covers both master and slave handlers. Signed-off-by: Jae Hyun Yoo Reviewed-by: Brendan Higgins Signed-off-by: Wolfram Sang commit 517fde0eb5a8f46c54ba6e2c36e32563b23cb14f Author: Jae Hyun Yoo Date: Mon Jul 2 14:20:28 2018 -0700 i2c: aspeed: Fix initial values of master and slave state This patch changes the order of enum aspeed_i2c_master_state and enum aspeed_i2c_slave_state defines to make their initial value to ASPEED_I2C_MASTER_INACTIVE and ASPEED_I2C_SLAVE_STOP respectively. In case of multi-master use, if a slave data comes ahead of the first master xfer, master_state starts from an invalid state so this change fixes the issue. Signed-off-by: Jae Hyun Yoo Reviewed-by: Brendan Higgins Signed-off-by: Wolfram Sang commit 6bc33c51976cd94362265bdf59fcdc73c941a226 Author: Jae Hyun Yoo Date: Mon Jul 2 14:13:59 2018 -0700 i2c: aspeed: Add newline characters into message printings. There are some log printing without a newline character. This patch adds the missing newline characters. Signed-off-by: Jae Hyun Yoo Reviewed-by: Brendan Higgins Signed-off-by: Wolfram Sang commit eebfd44399e93c171aefef057cd79dfd9276cc22 Author: Krzysztof Kozlowski Date: Wed Jul 18 21:54:04 2018 +0200 i2c: exynos5: Describe the hardware variant for readability The driver supports multiple hardware variants of Exynos I2C controller which differ in FIFO depth, handling of interrupts and bus recovery in HSI2C_MASTER_ST_LOSE state. The difference in variant was a single bit set for Exynos7 variants and implicit lack of this bit for other variants. Make each variant explicit which also fixes the GCC warning about documentation: drivers/i2c/busses/i2c-exynos5.c:223: warning: Function parameter or member 'hw' not described in 'exynos_hsi2c_variant' No change in functionality. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Andrzej Hajda Signed-off-by: Wolfram Sang commit c4ae05b976b2a67fb24f35d21731b4da2c235bbf Author: Wolfram Sang Date: Tue Jul 17 11:00:05 2018 +0200 i2c: recovery: make pin init look like STOP When we initialize the pins, make sure it looks like STOP by dividing the delay into halves. It shouldn't matter because SDA is expected to be held low by a device, but for super-safety, let's do it. Signed-off-by: Wolfram Sang Reviewed-by: Ulrich Hecht Reviewed-by: Peter Rosin Signed-off-by: Wolfram Sang commit ea3cfbd896fd25b2a9ddfcd685858461335f7435 Author: Hiromitsu Yamasaki Date: Fri Jul 20 12:00:24 2018 +0200 i2c: rcar: Add compatible support for r8a77990 (R-Car E3) This patch adds compatible string support for the Renesas R-Car E3 (r8a77990) SoC. Signed-off-by: Hiromitsu Yamasaki Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 3911025e86083db0379533e5e49913af2e727ef2 Author: Eddie James Date: Tue Jul 17 10:31:06 2018 -0500 MAINTAINERS: Add Eddie as the maintainer for the FSI-attached I2C driver Signed-off-by: Eddie James Acked-by: Joel Stanley Signed-off-by: Wolfram Sang commit 720d5ce9309d5503b2c29b621f5490e961f5953c Author: Eddie James Date: Tue Jul 17 10:31:05 2018 -0500 i2c: fsi: Add bus recovery Bus recovery should reset the bus with the standard i2c recovery procedure. Populate the necessary fields so that the standard procedure can perform the reset. Signed-off-by: Eddie James Tested-by: Joel Stanley Signed-off-by: Wolfram Sang commit f4cdc319cff88eb83564a5466c15af8128dd8284 Author: Eddie James Date: Tue Jul 17 10:31:04 2018 -0500 i2c: fsi: Add I2C master locking Since there are many ports per master, each with it's own adapter and chardev, we need some locking to prevent transfers from changing the master state while other transfers are in progress. Signed-off-by: Eddie James Reviewed-by: Andy Shevchenko Tested-by: Joel Stanley Signed-off-by: Wolfram Sang commit 504b82773c074e88423e17b9a069ac9a07df02d6 Author: Eddie James Date: Tue Jul 17 10:31:03 2018 -0500 i2c: fsi: Add transfer implementation Execute I2C transfers from the FSI-attached I2C master. Use polling instead of interrupts as we have no hardware IRQ over FSI. Signed-off-by: Eddie James Reviewed-by: Andy Shevchenko Tested-by: Joel Stanley Signed-off-by: Wolfram Sang commit 6cdf5e397a0b863fcc3f703c7619e628a63664ee Author: Eddie James Date: Tue Jul 17 10:31:02 2018 -0500 i2c: fsi: Add abort and hardware reset procedures Add abort procedure for failed transfers. Add engine reset procedure that is executed during the abort to recover from various fault conditions. Signed-off-by: Eddie James Tested-by: Joel Stanley Signed-off-by: Wolfram Sang commit 19b4887af7155a224b7d07301463ea32349b9965 Author: Eddie James Date: Tue Jul 17 10:31:01 2018 -0500 i2c: fsi: Add port structures Add and initialize I2C adapters for each port on the FSI-attached I2C master. Ports for each master are defined in the devicetree. Signed-off-by: Eddie James Tested-by: Joel Stanley Signed-off-by: Wolfram Sang commit d6ffb63001167053cc7af889543ca8284beee0dd Author: Eddie James Date: Tue Jul 17 10:31:00 2018 -0500 i2c: Add FSI-attached I2C master algorithm Add register definitions for FSI-attached I2C master and functions to access those registers over FSI. Add an FSI driver so that our I2C bus is probed up during an FSI scan. Signed-off-by: Eddie James Reviewed-by: Andy Shevchenko Tested-by: Joel Stanley Signed-off-by: Wolfram Sang commit 82d41d09743938e5bc399725ad64e12fa968e8ed Author: Eddie James Date: Tue Jul 17 10:30:59 2018 -0500 dt-bindings: i2c: Add FSI-attached I2C master dt binding documentation Document the bindings. Signed-off-by: Eddie James Acked-by: Rob Herring Signed-off-by: Wolfram Sang commit eef5ba1aa148ca5e6deb1e0aa1de797fa4e12cb7 Author: Peter Rosin Date: Wed Jun 20 10:51:53 2018 +0200 i2c: smbus: add unlocked __i2c_smbus_xfer variant Removes all locking from i2c_smbus_xfer and renames it to __i2c_smbus_xfer, then adds a new i2c_smbus_xfer function that simply grabs the lock while calling the unlocked variant. This is not perfectly equivalent, since i2c_smbus_xfer was callable from atomic/irq context if you happened to end up emulating SMBus with an I2C transfer, and that is no longer the case with this patch. It is unknown (to me) if anything depends on that quirk, but it seems fragile enough to simply break those cases and require them to call i2c_transfer directly instead. While at it, for consistency rename the 2nd to last argument (size) of the i2c_smbus_xfer declaration to protocol and remove the surplus extern marker. Signed-off-by: Peter Rosin Signed-off-by: Wolfram Sang commit bb81955fd4a49fffdd86d50afd0c1f2eea044c05 Author: Dirk Gouders Date: Wed Jul 18 11:13:36 2018 +0200 kbuild: if_changed: document single use per target limitation Users of if_changed could easily feel invited to use it to divide a recipe into parts like: a: prereq FORCE $(call if_changed,do_a) $(call if_changed,do_b) But this is problematic, because if_changed should not be used more than once per target: in the above example, if_changed stores the command-line of the given command in .a.cmd and when a is up-to-date with respect to prereq, the file .a.cmd contains the command-line for the last command executed, i.e. do_b. When the recipe is then executed again, without any change of prerequisites, the command-line check for do_a will fail, do_a will be executed and stored in .a.cmd. The next check, however, will still see the old content (the file isn't re-read) and if_changed will skip do_b, because the command-line test will not recognize a change. On the next execution of the recipe the roles will flip: do_a is OK but do_b not and it will be executed. And so on... Signed-off-by: Dirk Gouders Signed-off-by: Masahiro Yamada commit d5e84c21dbf5ea458897f88346dc979909eed913 Author: Joerg Roedel Date: Fri Jul 20 18:22:23 2018 +0200 x86/entry/32: Check for VM86 mode in slow-path check The SWITCH_TO_KERNEL_STACK macro only checks for CPL == 0 to go down the slow and paranoid entry path. The problem is that this check also returns true when coming from VM86 mode. This is not a problem by itself, as the paranoid path handles VM86 stack-frames just fine, but it is not necessary as the normal code path handles VM86 mode as well (and faster). Extend the check to include VM86 mode. This also makes an optimization of the paranoid path possible. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: "David H . Gutteridge" Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1532103744-31902-3-git-send-email-joro@8bytes.org commit 77754cfa09a6c528c38cbca9ee4cc4f7cf6ad6f2 Author: Joerg Roedel Date: Fri Jul 20 18:22:22 2018 +0200 perf/core: Make sure the ring-buffer is mapped in all page-tables The ring-buffer is accessed in the NMI handler, so it's better to avoid faulting on it. Sync the vmalloc range with all page-tables in system to make sure everyone has it mapped. This fixes a WARN_ON_ONCE() that can be triggered with PTI enabled on x86-32: WARNING: CPU: 4 PID: 0 at arch/x86/mm/fault.c:320 vmalloc_fault+0x220/0x230 This triggers because with PTI enabled on an PAE kernel the PMDs are no longer shared between the page-tables, so the vmalloc changes do not propagate automatically. Note: Andy said rightfully that we should try to fix the vmalloc code for that case, but that's not a hot fix for the issue at hand. Fixes: 7757d607c6b3 ("x86/pti: Allow CONFIG_PAGE_TABLE_ISOLATION for x86_32") Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: Pavel Machek Cc: "David H . Gutteridge" Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1532103744-31902-2-git-send-email-joro@8bytes.org commit 89e1f5cb1ecc1cd509a196f4e79d12a1e39410b6 Author: Oza Pawandeep Date: Thu Jul 19 17:58:10 2018 -0500 PCI/portdrv: Remove pcie_portdrv_err_handler.slot_reset The pci_error_handlers.slot_reset() callback is only used for non-bridge devices (see broadcast_error_message()). Since portdrv only binds to bridges, we don't need pcie_portdrv_slot_reset(), so remove it. Signed-off-by: Oza Pawandeep [bhelgaas: changelog, remove pcie_portdrv_slot_reset() completely] Signed-off-by: Bjorn Helgaas commit 10d790d99d3b42ec07d54178b291708f14af886d Author: Oza Pawandeep Date: Thu Jul 19 17:58:09 2018 -0500 PCI/AER: Clear device status bits during ERR_COR handling In case of correctable error, the Correctable Error Detected bit in the Device Status register is set. Clear it after handling the error. Signed-off-by: Oza Pawandeep Signed-off-by: Bjorn Helgaas commit ec752f5d54d723af3df03959637f963079643cd8 Author: Oza Pawandeep Date: Thu Jul 19 17:58:09 2018 -0500 PCI/AER: Clear device status bits during ERR_FATAL and ERR_NONFATAL Clear the device status bits while handling both ERR_FATAL and ERR_NONFATAL cases. Signed-off-by: Oza Pawandeep [bhelgaas: rename to pci_aer_clear_device_status(), declare internal to PCI core instead of exposing it everywhere] Signed-off-by: Bjorn Helgaas commit 43ec03a9e5f382ff70fdef35b4ea813263cd8270 Author: Oza Pawandeep Date: Thu Jul 19 17:58:07 2018 -0500 PCI/AER: Remove ERR_FATAL code from ERR_NONFATAL path broadcast_error_message() is only used for ERR_NONFATAL events, when the state is always pci_channel_io_normal, so remove the unused alternate path. Signed-off-by: Oza Pawandeep [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas commit 5b6c09660da8779dd545fa717c2b0cc79d477c9e Author: Oza Pawandeep Date: Thu Jul 19 17:58:06 2018 -0500 PCI/AER: Factor out ERR_NONFATAL status bit clearing aer_error_resume() clears all ERR_NONFATAL error status bits. This is exactly what pci_cleanup_aer_uncorrect_error_status(), so use that instead of duplicating the code. Signed-off-by: Oza Pawandeep [bhelgaas: split to separate patch] Signed-off-by: Bjorn Helgaas commit e7b0b847de6db161e3917732276e425bc92a2feb Author: Oza Pawandeep Date: Thu Jul 19 17:58:05 2018 -0500 PCI/AER: Clear only ERR_NONFATAL bits during non-fatal recovery pci_cleanup_aer_uncorrect_error_status() is called by driver .slot_reset() methods when handling ERR_NONFATAL errors. Previously this cleared *all* the bits, including ERR_FATAL bits. Since we're only handling ERR_NONFATAL errors, clear only the ERR_NONFATAL error status bits. Signed-off-by: Oza Pawandeep [bhelgaas: split to separate patch] Signed-off-by: Bjorn Helgaas commit 7ab92e89bf8b0a93f0d53b6d83270e4cd0f7c563 Author: Bjorn Helgaas Date: Thu Jul 19 17:55:58 2018 -0500 PCI/AER: Clear only ERR_FATAL status bits during fatal recovery During recovery from fatal errors, we previously called pci_cleanup_aer_uncorrect_error_status(), which cleared *all* uncorrectable error status bits (both ERR_FATAL and ERR_NONFATAL). Instead, call a new pci_aer_clear_fatal_status() that clears only the ERR_FATAL bits (as indicated by the PCI_ERR_UNCOR_SEVER register). Based-on-patch-by: Oza Pawandeep Signed-off-by: Bjorn Helgaas commit 78fbe864c32ce90e81f95f3a0f388a2aa40d55d2 Merge: 500f0716b5f7 c8acfe0aadbe Author: Greg Kroah-Hartman Date: Fri Jul 20 21:47:15 2018 +0200 Merge tag 'usb-serial-4.19-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for v4.19-rc1 Here are the USB-serial updates for 4.19-rc1, including: - gpio support for CP2102N devices - improved line-speed handling for cp210x - conversion to spin_lock_irqsave() in completion handlers - dropped kl5kusb105 support from the kl5kusb105 driver (sic!) Included are also various lower-priority fixes and clean ups. All but the final commit have been in linux-next, and with no reported issues. Signed-off-by: Johan Hovold commit 40999f11ce677ce3c5d0e8f5f76c40192a26b479 Author: Jon Maloy Date: Wed Jul 18 19:50:06 2018 +0200 tipc: make link capability update thread safe The commit referred to below introduced an update of the link capabilities field that is not safe. Given the recently added feature to remove idle node and link items after 5 minutes, there is a small risk that the update will happen at the very moment the targeted link is being removed. To avoid this we have to perform the update inside the node item's write lock protection. Fixes: 9012de508956 ("tipc: add sequence number check for link STATE messages") Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit f91a0effcaa6a2eec647cdc53d0d16bff5144c10 Merge: eecd6857709e 5761917a1aac Author: David S. Miller Date: Fri Jul 20 12:33:38 2018 -0700 Merge branch 'constify-nla_policy' Stephen Hemminger says: ==================== constify nla_policy Almost all places that use nla_policy declare it const. A couple of drivers didn't but that is fixable. ==================== Signed-off-by: David S. Miller commit 5761917a1aac77f40885ec17a3e1d50ab0c737c4 Author: Stephen Hemminger Date: Wed Jul 18 09:32:44 2018 -0700 gtp: constify nla_policy The netlink policy structure can be constant like other drivers. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit a86c4120528f0c87b10837abbe3eada542791177 Author: Stephen Hemminger Date: Wed Jul 18 09:32:43 2018 -0700 nbd: constify nla_policy The netlink policy should be const like other drivers. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit fe1053b7859dcbe830212de43befe6c7e4f089a8 Author: Alex Deucher Date: Thu Jul 19 13:24:33 2018 -0500 drm/amdgpu: rework suspend and resume to deal with atomic changes Use the newly split ip suspend functions to do suspend displays first (to deal with atomic so that FBs can be unpinned before attempting to evict vram), then evict vram, then suspend the other IPs. Also move the non-DC pinning code to only be called in the non-DC cases since atomic should take care of DC. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107065 Fixes: e00fb85 drm: Stop updating plane->crtc/fb/old_fb on atomic drivers Acked-by: Harry Wentland Reviewed-and-tested-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit e7854a038015122538df4777b8c192e03b4eb6c2 Author: Alex Deucher Date: Thu Jul 19 13:10:07 2018 -0500 drm/amdgpu: split ip suspend into 2 phases We need to do some IPs earlier to deal with ordering issues similar to how resume is split into two phases. Do DCE first to deal with atomic, then do the rest. Acked-by: Harry Wentland Reviewed-and-tested-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 5b8eb0edba15b1685acbb76751fbb189de4ca310 Author: Alex Deucher Date: Thu Jul 19 09:28:23 2018 -0500 drm/amdgpu/acpi: skip backlight events for DC No change in behavior, just bail sooner. Reviewed-by: Jim Qu Signed-off-by: Alex Deucher commit 9e7204beae8cbb75939acd640829e10979f2c920 Author: Alex Deucher Date: Thu Jul 19 09:17:02 2018 -0500 drm/amdgpu/apci: don't call sbios request function if it's not supported Check the supported functions mask before calling the bios requests method. Reviewed-by: Jim Qu Signed-off-by: Alex Deucher commit 7766484b4a18373ac557ce6ea442ef28517c8224 Author: Andrey Grodzovsky Date: Fri Jul 20 11:42:24 2018 -0400 drm/amdgpu: Fix warning in dma_fence_is_later on resume from S3. Problem: amdgpu_ttm_set_buffer_funcs_status destroys adev->mman.entity on suspend without releasing adev->mman.bdev.man[TTM_PL_VRAM].move fence so on resume the new drm_sched_entity.fence_context causes the warning against the old fence context which is different. Fix: When destroying sched_entity in amdgpu_ttm_set_buffer_funcs_status release man->move and set the pointer to NULL. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ecb8c50382e2e8bfd60483e3edf8cb883f7bde62 Author: Shirish S Date: Fri Jul 20 17:26:50 2018 +0530 drm/amdgpu: use drm_fb helper for console_(un)lock This patch removes the usage of console_(un)lock by replacing drm_fb_helper_set_suspend() to drm_fb_helper_set_suspend_unlocked() which locks and unlocks the console instead of locking ourselves. Signed-off-by: Shirish S Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 3dbd823e53b572df1c84d73e85c518212fcdaddb Author: Rex Zhu Date: Tue Jul 17 20:18:04 2018 +0800 drm/amd/display: Convert 10kHz clks from PPLib into kHz Except special naming as *_in_khz, The default clock unit in powerplay is in 10KHz. so need to * 10 as expecting clock frequency in display is in kHz. Reviewed-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 97e8f102f5a9123d30258e196c6c1ea29cf52e83 Author: Rex Zhu Date: Tue Jul 17 18:31:50 2018 +0800 drm/amd/pp: Set Max clock level to display by default avoid the error in dmesg: [drm:dm_pp_get_static_clocks] *ERROR* DM_PPLIB: invalid powerlevel state: 0! Reviewed-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit a0c3bf0ff40d6c482d381fe2c577a4e6c50f522f Author: Rex Zhu Date: Thu Jul 19 16:32:05 2018 +0800 drm/amd/pp: Update clk with od setting when set power state This can fix the issue resume from S3, the user's OD setting were reverted to default. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 88de542e421ac86b8148b232f822de306004e5a0 Author: Rex Zhu Date: Thu Jul 19 16:21:42 2018 +0800 drm/amd/pp: Read vbios vddc limit before use them Use the vddc limit before read them from vbios Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 4d3b9ae50ea03d3295fc9b5f5c88f49fcd0e99f9 Author: Shirish S Date: Wed Jul 18 13:36:26 2018 +0530 drm/amdgpu: lock and unlock console only for amdgpu_fbdev_set_suspend [V5] [Why] While the console_lock is held, console output will be buffered, till its unlocked it wont be emitted, hence its ideal to unlock sooner to enable debugging/detecting/fixing of any issue in the remaining sequence of events in resume path. The concern here is about consoles other than fbcon on the device, e.g. a serial console [How] This patch restructures the console_lock, console_unlock around amdgpu_fbdev_set_suspend() and moves this new block appropriately. V2: Kept amdgpu_fbdev_set_suspend after pci_set_power_state V3: Updated the commit message to clarify the real concern that this patch addresses. V4: code clean-up. V5: fixed return value Signed-off-by: Shirish S Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 1bc460a45b9746db4b0e6be46c122c377120aace Author: Harry Wentland Date: Tue Jul 17 10:51:23 2018 -0400 drm/amd/display: Honor pplib stutter mask for all ASICs in DC [Why] We were only setting this mask for DCN, but should really use it universally for all ASICs. [How] Move the assignment out of the Raven switch statement for all ASICs other than Stoney and Carrizo. v2: Keep stutter always on for Carrizo and Stoney (Alex) Cc: Rex.Zhu@amd.com Cc: Feifei.Xu@amd.com Cc: Kenneth.Feng@amd.com Cc: Evan.Quan@amd.com Cc: Bhawanpreet.Lakha@amd.com Cc: Jordan.Lazare@amd.com Signed-off-by: Harry Wentland Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 7b42573bb8a084175500eb62c4da9d46319e3d7e Author: Harry Wentland Date: Thu Jul 19 14:17:30 2018 -0400 drm/amd/display: Drop unused backlight functions in DM These are only ever called for non-DC code. Signed-off-by: Harry Wentland Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 3f48c6813fc62af183660fbf04edaac7e3615205 Author: Colin Ian King Date: Tue Jul 17 10:29:29 2018 +0100 drm/amdgpu: fix spelling mistake "successed" -> "succeeded" Trivial fix to spelling mistake in dev_err error message. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit eecd6857709e08781e41f3eb0e0c669d9ca07d87 Author: Gustavo A. R. Silva Date: Wed Jul 18 08:27:41 2018 -0500 tls: Fix copy-paste error in tls_device_reencrypt It seems that the proper structure to use in this particular case is *skb_iter* instead of skb. Addresses-Coverity-ID: 1471906 ("Copy-paste error") Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 86a66810baa87e5d1c93a51f71d36c7f71fe3113 Author: Dan Williams Date: Fri Jul 13 21:49:56 2018 -0700 mm, madvise_inject_error: Disable MADV_SOFT_OFFLINE for ZONE_DEVICE pages Given that dax / device-mapped pages are never subject to page allocations remove them from consideration by the soft-offline mechanism. Reported-by: Naoya Horiguchi Signed-off-by: Dan Williams Acked-by: Naoya Horiguchi Signed-off-by: Dave Jiang commit 73449daf8f0db2697fb9f3f60b3a6d5c76a3c5fc Author: Dan Williams Date: Fri Jul 13 21:49:50 2018 -0700 filesystem-dax: Set page->index In support of enabling memory_failure() handling for filesystem-dax mappings, set ->index to the pgoff of the page. The rmap implementation requires ->index to bound the search through the vma interval tree. The index is set and cleared at dax_associate_entry() and dax_disassociate_entry() time respectively. Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Ross Zwisler Reviewed-by: Jan Kara Signed-off-by: Dan Williams Signed-off-by: Dave Jiang commit 35de299547d1c3300e078f9f7c6eb01dadae47f9 Author: Dan Williams Date: Fri Jul 13 21:49:45 2018 -0700 device-dax: Set page->index In support of enabling memory_failure() handling for device-dax mappings, set ->index to the pgoff of the page. The rmap implementation requires ->index to bound the search through the vma interval tree. The ->index value is never cleared. There is no possibility for the page to become associated with another pgoff while the device is enabled. When the device is disabled the 'struct page' array for the device is destroyed and ->index is reinitialized to zero. Reviewed-by: Jan Kara Signed-off-by: Dan Williams Signed-off-by: Dave Jiang commit 2232c6382a453db73d2e723df1b52030066e135e Author: Dan Williams Date: Fri Jul 13 21:49:40 2018 -0700 device-dax: Enable page_mapping() In support of enabling memory_failure() handling for device-dax mappings, set the ->mapping association of pages backing device-dax mappings. The rmap implementation requires page_mapping() to return the address_space hosting the vmas that map the page. The ->mapping pointer is never cleared. There is no possibility for the page to become associated with another address_space while the device is enabled. When the device is disabled the 'struct page' array for the device is destroyed / later reinitialized to zero. Reviewed-by: Jan Kara Signed-off-by: Dan Williams Signed-off-by: Dave Jiang commit 226ab561075f6f8f3cd5f7b3b7544f3997aab51f Author: Dan Williams Date: Fri Jul 13 21:49:34 2018 -0700 device-dax: Convert to vmf_insert_mixed and vm_fault_t Use new return type vm_fault_t for fault and huge_fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_mixed() returned an error code which driver mapped into VM_FAULT_* type. The new function vmf_insert_mixed() will replace this inefficiency by returning VM_FAULT_* type. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Reviewed-by: Ross Zwisler Signed-off-by: Dan Williams Signed-off-by: Dave Jiang commit a8e43c21a8a32a3af4abc605b6ebcab039f28e00 Author: Daniel Mack Date: Mon Jul 16 08:24:45 2018 +0200 ASoC: pxa: remove clock divider and pll setup from zylonite and magician The SSP DAI now handles the clocking setup itself, all it needs is the master clock frequency. Remove the code from Zylonite and Magician platforms. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 37164571fb25adef80ae2aaf55840b0105c15b22 Author: Niklas Cassel Date: Mon Jul 16 15:32:54 2018 +0200 regulator: qcom_spmi: Indent with tabs instead of spaces Fix the following checkpatch error: ERROR: code indent should use tabs where possible + { }$ Fixes: ca5cd8c9400c ("regulator: qcom_spmi: Add support for pmi8994") Signed-off-by: Niklas Cassel Signed-off-by: Mark Brown commit 9689ca0af345b82d06a02e45cc214c1b8bad9e8d Author: Niklas Cassel Date: Mon Jul 16 15:32:53 2018 +0200 regulator: qcom_spmi: Do not initialise static to NULL Fix the following checkpatch error: ERROR: do not initialise statics to NULL +static struct regmap *saw_regmap = NULL; Fixes: 0caecaa87202 ("regulator: qcom_spmi: Add support for SAW") Signed-off-by: Niklas Cassel Signed-off-by: Mark Brown commit 85046a15529606466bc778e1205f4cab8e3724d1 Author: Niklas Cassel Date: Mon Jul 16 15:32:52 2018 +0200 regulator: qcom_spmi: Use correct regmap when checking for error Since we have just assigned saw_regmap, and since the error message refers to saw_regmap, it feels safe to assume that it is saw_regmap, and not regmap, that should be checked for errors. Fixes: 0caecaa87202 ("regulator: qcom_spmi: Add support for SAW") Signed-off-by: Niklas Cassel Signed-off-by: Mark Brown commit fffe7f52eb5db41eedadba9a8038e982dcfaee0c Author: Niklas Cassel Date: Mon Jul 16 15:32:51 2018 +0200 regulator: qcom_spmi: Fix warning Bad of_node_put() For of_find_node_by_name(), you typically pass what the previous call returned. Therefore, of_find_node_by_name() increases the refcount of the returned node, and decreases the refcount of the node passed as the first argument. of_find_node_by_name() is incorrectly used, and produces a warning. Fix the warning by using the more suitable function of_get_child_by_name(). Also add a missing of_node_put() for the returned value, since this was previously being leaked. OF: ERROR: Bad of_node_put() on /soc/qcom,spmi@400f000/pmic@3/regulators CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.18.0-rc4-00223-gefd7b360b70e #12 Hardware name: Qualcomm Technologies, Inc. DB820c (DT) Call trace: dump_backtrace+0x0/0x1a8 show_stack+0x14/0x20 dump_stack+0x90/0xb4 of_node_release+0x74/0x78 kobject_put+0x90/0x1f0 of_node_put+0x14/0x20 of_find_node_by_name+0x80/0xd8 qcom_spmi_regulator_probe+0x30c/0x508 Fixes: 0caecaa87202 ("regulator: qcom_spmi: Add support for SAW") Signed-off-by: Niklas Cassel Signed-off-by: Mark Brown commit 7864a79f37b55769b817d5e6c5ae0ca4bfdba93b Author: Jerome Brunet Date: Tue Jul 17 17:43:04 2018 +0200 ASoC: meson: add axg sound card support Add the axg sound card to handle the specifities of the axg audio sub system. This card is required to: * setup the dpcm links specific to the AXG (with a cpu sound dai) * handle the 4 lanes masks of the tdm interfaces * add the loopback link when a tdm pad interface has a playback stream * handle multi-codec links Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 2a05c71ea17b09c88a212e8fa6be1ccddd4613ab Author: Jerome Brunet Date: Tue Jul 17 17:43:03 2018 +0200 ASoC: meson: add axg sound card DT bindings documentation Add the DT bindings documentation for axg sound card Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit cbdfab3b675f4c34258b0ec9e4707de44e1f6989 Author: Jerome Brunet Date: Tue Jul 17 17:43:02 2018 +0200 ASoC: export snd_soc_of_get_slot_mask Amlogic's axg card driver can't use snd_soc_of_parse_tdm_slot() directly because it needs to handle 4 mask for each direction. Yet the parsing of each mask is the same, so export snd_soc_of_get_slot_mask() to reuse the the existing code. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 13a22e6a98f8b47d61948fcd095d862377b3b143 Author: Jerome Brunet Date: Tue Jul 17 17:43:01 2018 +0200 ASoC: meson: add tdm input driver Add Amlogic's axg TDM input driver which take the TDM signal of 4 input lanes and push the decoded audio samples to TODDR fifo Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit c41c2a355b86368608377eaf3df442ec0f342f1e Author: Jerome Brunet Date: Tue Jul 17 17:43:00 2018 +0200 ASoC: meson: add tdm output driver Add Amlogic's axg tdm output driver which pulls data from FRDDR fifo and produce the TDM signals for 4 output lanes. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit d60e4f1e4be5e2dfb55fb084b119aed094227a35 Author: Jerome Brunet Date: Tue Jul 17 17:42:59 2018 +0200 ASoC: meson: add tdm interface driver Add Amlogic's axg TDM interface driver. This driver manages the format and clocks provided on the pads. On this SoC, each stream direction provides 4 serial lanes. This makes a maximum of 8 channels in i2s modes and 128 channels in DSP modes. While each lanes operate on the same slot number (same bit clock), they may have different TDM masks. This requires to provide a function to let the card set the 4 masks, in lieu of the usual set_tdm_slots() callback of the dai driver. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 1a11d88f499ceb69e9b4098ddc36866820335a54 Author: Jerome Brunet Date: Tue Jul 17 17:42:58 2018 +0200 ASoC: meson: add tdm formatter base driver Add Amlogic's axg TDM core driver. On this SoC, tdm is bit more complex than usual, mainly because the different TDM input decoders can be attached to any of TDM pad interface, including the output pads. For the this, TDM on this SoC is modeled like this: - TDM interface provides the DAIs the codecs will be attached to. The main responsibility of this driver is to manage the pad format and the TDM clock rates. - TDM Formatters: These are the entities which are actually dealing with the TDM signal. TDMOUT produce a TDM signal from the audio sample provided by FRDDR using the clocks provided the TDM interface. TDMIN feeds TODDR with audio sample using the clocks and TDM signal provided by the TDM Interface. - TDM Streams: This provides the link between 1 DAI stream of the TDM interface and one (or more) TDM formatters. This driver provides the TDM formatter and TDM stream operations. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 9e960c0298b5811e5a2c1ebceea6aa3b7bbc61c6 Author: Jerome Brunet Date: Tue Jul 17 17:42:57 2018 +0200 ASoC: meson: add axg tdm interface DT bindings documentation Add the DT bindings documentation for axg's TDM interfaces Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit c8acfe0aadbeb78f65826959891be15cc0a709a3 Author: Karoly Pados Date: Fri Jul 20 12:52:40 2018 +0200 USB: serial: cp210x: implement GPIO support for CP2102N This patch adds GPIO support for CP2102N devices. It introduces new generic code to support emulating separate input and outputs directions even though these devices only know output modes (open-drain and pushpull). Existing GPIO support for CP2105 has been migrated over to the new code structure. Only limitation is that for the QFN28 variant, only 4 out of 7 GPIOs are supported. This is because the config array locations of the last 3 pins are not documented, and reverse engineering revealed offsets that conflicted with other documented functions. Hence we'll play it safe instead until somebody clears this up further. Signed-off-by: Karoly Pados [ johan: fix style issues and a couple of minor bugs; use Karoly's updated commit message ] Acked-by: Martyn Welch Signed-off-by: Johan Hovold commit d903779b58be442f3afd2c51c46c7cf19c97684e Author: Jerome Brunet Date: Fri Jul 20 17:26:33 2018 +0200 reset: meson: add meson audio arb driver The Amlogic Audio ARB is a simple device which enables or disables the access of Audio FIFOs to DDR on AXG based SoC. Signed-off-by: Jerome Brunet Signed-off-by: Philipp Zabel commit aaa080fa7e0f01f7cd8eb22a7385a4d8106c7478 Author: Martin Blumenstingl Date: Sat Jul 14 21:37:25 2018 +0200 ARM64: dts: meson-gxl: add support for the Oranth Tanix TX3 Mini The Tanix TX3 Mini is a TV box based on the Amlogic S905W chipset. There are two variants: - 1 GiB or 2 GiB of DDR3 memory - 8 GB or 16 GB eMMC flash Both variants come with: - 802.11 b/g/n wifi (Silicon Valley Microelectronics SSV6051, does not support Bluetooth) - an LED 7 segment display with an FD628 controller - HDMI and AV (CVBS) output - 2x USB (utilizing both USB ports provided by the SoC) - micro SD card slot - serial console (uart_AO) has to be soldered after opening the case The board seems to be very similar to the P23x and Q20x reference boards, which is why it includes meson-gx-p23x-q20x.dtsi: - eMMC reset routed to BOOT_9 - the SDIO wifi chip's reset line is routed to GPIOX_6 and the reference clock is 32.768KHz on PWM_E - SD card detection is routed to CARD_6 - vqmmc of all MMC controllers is hard-wired to 1.8V (VDDIO_BOOT) - uart_AO can be accessed after opening the case and soldering RX, TX and GND lines onto the exposed solder points (marked with RX, TX and GND) Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Kevin Hilman commit e3b8b7d49e3d7bb5e3b3e6126bc81d1c1e0d7119 Author: Martin Blumenstingl Date: Sat Jul 14 21:37:24 2018 +0200 ARM64: dts: meson-gxl: add support for the S905W SoC and the P281 board S905W is a new SoC from the GXL series. It is a cost-reduced version of the S905X. The P281 development board from Amlogic uses the same layout as the P231 (S905D development board). Thus the new P281 board inherits meson-gx-p23x-q20x.dtsi to avoid code-duplication. Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Kevin Hilman commit d6996e3cbd16751b7518d7061ad4710d78bc0646 Author: Martin Blumenstingl Date: Sat Jul 14 21:37:23 2018 +0200 dt-bindings: arm: amlogic: Add support for the Oranth Tanix TX3 Mini The Tanix TX3 Mini is a TV box based on the Amlogic S905W chipset. It comes with: - 1 GiB or 2 GiB of DDR3 memory depending on the model - 8 GB or 16 GB eMMC flash depending on the model - 802.11 b/g/n wifi (Silicon Valley Microelectronics SSV6051, does not support Bluetooth, not supported by any mailine driver) - an LED 7 segment display with an FD628 controller (not supported by any mainline driver) - HDMI and AV (CVBS) output - 2x USB (utilizing both USB ports provided by the SoC) - micro SD card slot The board seems to be very similar to the P23x and Q20x reference boards: - eMMC reset routed to BOOT_9 - the SDIO wifi chip's reset line is routed to GPIOX_6 and the reference clock is 32.768KHz on PWM_E - SD card detection is routed to CARD_6 - vqmmc of all MMC controllers is hard-wired to 1.8V (VDDIO_BOOT) - uart_AO can be accessed after opening the case and soldering RX, TX and GND lines onto the exposed solder points (marked with RX, TX and GND) Signed-off-by: Martin Blumenstingl Reviewed-by: Rob Herring Reviewed-by: Neil Armstrong Signed-off-by: Kevin Hilman commit 580f1f41bf090755a32c229e2ea2c2db86f6eab1 Author: Martin Blumenstingl Date: Sat Jul 14 21:37:22 2018 +0200 dt-bindings: arm: amlogic: Add support for GXL S905W and the P281 board S905W SoC is another SoC from the GXL family. It is a cost-reduced version of the S905X SoC. The following differences are known: - S905W supports HDMI resolutions up to 4k@30fps (while S905X support resolutions up to 4k@60fps) - the built-in video decoders of S905W decode up to 4k@30fps (while S905X supports decoding up to 4k@60fps) - CPU speed on S905W is limited to 1.2GHz (compared to 1.5GHz on S905X, this is handled in the SCPI firmware) - the DRAM interface on S905W is limited to 16-bit (GXL supports both, 16-bit and 32-bit) Notes based on Amlogic's GPL kernel sources: - the P281 is a development board from Amlogic which uses the S905W SoC. Amlogic's GPL kernel sources indicate that it uses the same PCB layout as the "P231" board (and simply replaces the S905D from the original P231 board with a S905W SoC). - it is assumed that the S905W SoC is pin-compatible with the S905X SoC since Amlogic's GPL kernel sources use the same driver for both SoCs. - gxl_p281_1g.dts contains a comment which mentions that "max gp pll for gpu is 650M, temporarily disabled". However, it seems to boot fine with 744MHz (as used on GXBB and the other GXL SoCs). Signed-off-by: Martin Blumenstingl Reviewed-by: Rob Herring Reviewed-by: Neil Armstrong Signed-off-by: Kevin Hilman commit 405f69b4492772951390ea8708101ba963dc471a Author: Martin Blumenstingl Date: Sat Jul 14 21:37:21 2018 +0200 dt-bindings: add vendor prefix for Shenzhen Oranth Technology Co., Ltd. According to their website (http://www.oranth.com/about-oranth/) Shenzhen Oranth Technology Co., Ltd. (or simply "Oranth") "is a professional Design House & Manufacturer for Android TV Box established in 2014". One of their brands is Tanix (sometimes also spelled "TANIX"). One of their most popular devices is the "Tanix TX3 Mini" TV box (which uses the Amlogic S905W chipset). Signed-off-by: Martin Blumenstingl Reviewed-by: Rob Herring Signed-off-by: Kevin Hilman commit 8909e72270f20ff53c9c3de86e7b69c2a5e20074 Author: Jerome Brunet Date: Mon Jul 16 12:11:51 2018 +0200 ARM64: dts: meson-axg: add the audio clock controller Add the audio clock controller which is part of the audio bus This controller takes 8 input plls, and the usual clock gate, from the main clock controller. It provides the clocs for the all the devices of the audio subsystem, such as tdms, spdif, pdm, etc. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit 7382913e230329cd5a5c08c3a4cac31221672426 Merge: 89803e8b2656 de3c1e71d412 Author: Kevin Hilman Date: Fri Jul 20 09:01:26 2018 -0700 Merge tag 'meson-clk-dt-for-v4.19' of https://github.com/BayLibre/clk-meson into v4.19/dt64-2 * Add pcie, mipi and gen_clk clk ids * Add audio clk controller clock bindings * tag 'meson-clk-dt-for-v4.19' of https://github.com/BayLibre/clk-meson: clk: meson: expose GEN_CLK clkid clk: meson-axg: add pcie and mipi clock bindings dt-bindings: clock: add meson axg audio clock controller bindings commit 5338073561bea23363e5552b647dad75bc7d0f11 Author: Jerome Brunet Date: Fri Jul 20 17:26:32 2018 +0200 reset: meson: add dt-bindings for meson-axg audio arb Add dt-bindings for the audio memory arbiter found on Amlogic's A113 based SoCs Reviewed-by: Rob Herring Signed-off-by: Jerome Brunet Signed-off-by: Philipp Zabel commit a873996921296ad74941017bf00884f14e10dffd Author: Manivannan Sadhasivam Date: Thu Jul 19 16:24:50 2018 +0530 arm64: dts: Add Mediatek X20 Development Board support Add initial device tree support for Mediatek X20 Development Board based on MT6797 Deca core SoC. This board is one of the 96Boards Consumer Edition platform. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Matthias Brugger commit e6bffe44b5a05fc651b1870ae050250625f77315 Author: Manivannan Sadhasivam Date: Thu Jul 19 16:24:49 2018 +0530 dt-bindings: arm: mediatek: Document Mediatek X20 Development Board Document Mediatek X20 Development Board which is a 96Boards Consumer Edition platform based on MT6797 SoC. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Signed-off-by: Matthias Brugger commit 89803e8b26569bdf5798f8745a4c708bf9360ee6 Author: Jerome Brunet Date: Mon Jul 16 12:11:50 2018 +0200 ARM64: dts: meson-axg: add pdm pins Add pdm input pin definitions to meson AXG Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit c67ee0a88aeaef32ce1c7aaa457ea92a705a655c Author: Jerome Brunet Date: Mon Jul 16 12:11:49 2018 +0200 ARM64: dts: meson-axg: add spdif input pins Add spdif input pin definitions to meson AXG Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit 399ac14ba5ec671c8b5779ce3566c5c1452a2747 Author: Jerome Brunet Date: Mon Jul 16 12:11:48 2018 +0200 ARM64: dts: meson-axg: remove spdif out from gpio a7 Spdif out in not multiplexed on gpio A7 (spdif in is) Remove this entry to fix the problem. Fixes: 53c03b0aff36 ("ARM64: dts: meson-axg: add spdif output pins") Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit aabe5d2d4fa8ab01eaf2ff6fe2161991c1e41e1a Author: Jerome Brunet Date: Mon Jul 16 12:11:47 2018 +0200 ARM64: dts: meson-axg: add adc buttons the S400 Add the 6 adc buttons of the amlogic S400 Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit 65b7591a1ef2eca26c9b7c9c39062590ab565f34 Author: Jerome Brunet Date: Mon Jul 16 12:11:46 2018 +0200 ARM64: dts: meson-axg: remove vddio_ao18 from SoC dtsi Regulator should not be defined inside the SoC dtsi file. vddio_ao18 is already defined in the S400 board dts anyway. Fixes: bb8a2ebd0498 ("ARM64: dts: meson-axg: add saradc support") Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit a51b74ea78ac11b7e632bb3ccfec469213177d6d Author: Xingyu Chen Date: Mon Jul 2 22:25:15 2018 +0000 ARM64: dts: meson-axg: add saradc support Add the DT info for SAR ADC of the Amlogic's Meson-AXG SoC. Signed-off-by: Xingyu Chen Signed-off-by: Yixun Lan Signed-off-by: Kevin Hilman commit fd47716479f50091c7e4b081e34198e770ccd9e8 Author: Neil Armstrong Date: Thu Jul 5 11:50:43 2018 +0200 ARM64: dts: add S805X based P241 board The Amlogic P241 board is the Reference Design board for the S805X variant of the Amlogic Meson GXL SoC family. The P241 board has the following features : - 1GiB DDR4 Memory - HDMI Connector with CEC - A/V jack with Stereo Audio and CVBS - 10/100 Ethernet - 2x USB2.0 Type-A - On-board WiFi SDIO Module - On-board eMMC storage - Infraread Received - Factory Reset button - UART connector Signed-off-by: Neil Armstrong Acked-by: Jerome Brunet Signed-off-by: Kevin Hilman commit d3d1ae57585f5f6bba16945b728cda44a4be71aa Author: Neil Armstrong Date: Thu Jul 5 11:50:42 2018 +0200 dt-bindings: amlogic: Add support for GXL S805X and the P241 board The S805X is a variant of the Amlogic Meson GXL SoC family with the following physical limitations : - No SDCard interface - No GPIOCLK pins - No USB OTG ID pin (but Gadget feature can stil be forced) - No 5V regulator - Reduced ADC inputs (only ADC0 and ADC1) - GPIODV_26, GPIOAO_3, GPIOAO_4, GPIOAO_5, GPIOAO_6, GPIOX_14, GPIOX_15, GPIOH_3 are no more exposed on the package Amlogic exposes the following SW limitations : - HDMI max resolution should be 1080p60, VPU clock should be downgraded - Video Decoding should be limited to 1080p60, VDEC clock should be downgraded - CPU speed should be limited by SCPI OPP table to 1.2GHz - DRAM interface is limited to DDR4 16bit up to 1GiB Signed-off-by: Neil Armstrong Acked-by: Jerome Brunet Signed-off-by: Kevin Hilman commit e3128cea8b3eb9876ada643869837fb36ee53903 Author: Viresh Kumar Date: Fri May 25 11:10:01 2018 +0530 ARM64: dts: amlogic: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Signed-off-by: Viresh Kumar [khilman: s/arm64/ARM64/ in Subject] Signed-off-by: Kevin Hilman commit 70d4b64f6c2deef8391d7d6a611db7cf45977780 Author: Jerome Brunet Date: Wed Jul 4 19:04:09 2018 +0200 ARM64: dts: meson-axg: add spdif output pins Add the different pin configurations for the spdif output Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit a90193b9a0e7dd91d12869577afebc0b47828df0 Author: Jerome Brunet Date: Thu Jun 28 11:50:54 2018 +0200 ARM64: dts: meson-axg: add s400 speaker amplifier Add the first of the two tas5707 power amplifier present on the speaker daughter board. According to the schematics of the S400 v3, only I2SB_DIN3 and I2SC_DOUT2 will be available to the speaker board. 9R83, 9R84 and 9R18 are not connected so no audio signal will be provided to the second amplifier. There is no point in enabling it even if it is visible on the i2c bus. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit e120289cc094b11e8729fe97cafe7a7738212de6 Author: Jerome Brunet Date: Thu Jun 28 11:50:53 2018 +0200 ARM64: dts: meson-axg: add s400 main 12v supply Add a fixed regulator for the main 12v which is the main power supply of the board. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit 6279f6669db51f02360951155dd9d44c32e11fb0 Author: Jerome Brunet Date: Thu Jun 28 11:50:52 2018 +0200 ARM64: dts: meson-axg: add s400 microphone card leds The microphone card connected to the s400 has 6 leds controlled through an additional i2c gpio controller. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit d1b5a0a8ff5de9f3b41a641e52556744a1ecd58a Author: Neil Armstrong Date: Tue Jun 26 09:40:55 2018 +0200 ARM64: dts: meson-gxbb-nanopi-k2: Add HDMI, CEC and CVBS nodes The Amlogic Meson GXBB based Nanopi-K2 board has an HDMI connector with CEC and CVBS available on the 40pin header. This patch adds the nodes to enable HDMI, CEC and CVBS functionnalities. Signed-off-by: Neil Armstrong Signed-off-by: Kevin Hilman commit 1b2b1e752de4372a74bda01141adaf77e68a328f Author: Martin Blumenstingl Date: Sat Jun 23 21:38:28 2018 +0200 ARM64: dts: meson-gx-p23x-q20x: move the wifi node to each board's .dts meson-gx-p23x-q20x.dtsi is currently used by five boards: - Amlogic P230 and P231 (which should be identical, apart from the external RGMII PHY on P230 whereas P231 can only use the internal PHY) - Amlogic Q200 (identical to P230 but with an S912 GXM SoC instead of a GXL S905D SoC) and Q201 (identical to P231 but with an S912 GXM SoC instead of a GXL S905D SoC) - NEXBOX A1 (based on the S912 GXM SoC) The Amlogic P230 board uses a Broadcom BCM4356 SDIO wifi chip. Since the other Amlogic reference design boards are very similar it's safe to assume that these also use a Broadcom based SDIO wifi chip (which is also how it was configured in meson-gx-p23x-q20x.dtsi). However, NEXBOX A1 comes with a "longsys LTM8830" SDIO wifi module, which is based on the "Qualcomm Atheros QCA9377-3(QCA1023-0)" chipset. Thus move the wifi node from meson-gx-p23x-q20x.dtsi to each of the four Amlogic reference board's .dts files. There are no devicetree bindings for the QCA9377 SDIO wifi module yet, so nothing is added to meson-gxm-nexbox-a1.dts. Fixes: f51b454549b812 ("ARM64: dts: meson-gxm: Add support for the Nexbox A1") Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Kevin Hilman commit 41ed2e0db48c1a92442774f99e82fee5cd905021 Author: Martin Blumenstingl Date: Sat Jun 23 16:59:59 2018 +0200 ARM64: dts: meson: enable the saradc node in meson-gx-p23x-q20x.dtsi meson-gxl-s905d-p230.dts and meson-gxm-q200.dts enable the saradc node (and configure it's vref-supply "VDDIO_AO18") in their corresponding .dts file. Move both (the saradc node as well as the VDDIO_AO18 regulator) to remove some duplicate code. As a positive side-effect this enables the saradc also for the P231 (GXL S905D) and Q201 (GXM S912) development boards which are similar to the P230/Q200 boards (P231 and Q201 use the internal 100Mbit/s PHY, while P230 and Q200 have an external RGMII PHY). Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Signed-off-by: Kevin Hilman commit ebfee0309d496d89279d612ee99023f9bbf4f34e Author: Enric Balletbo i Serra Date: Tue Jul 10 14:58:48 2018 +0200 usb: dwc3: rockchip: Fix PHY documentation links. Commit 34962fb8070c ("docs: Fix more broken references") replaced the broken reference to rockchip,dwc3-usb-phy.txt binding for the Qualcomm DWC3 binding (qcom-dwc3-usb-phy.txt). That's wrong, so replace that reference for the correct ones. Fixes: 34962fb8070c ("docs: Fix more broken references") Signed-off-by: Enric Balletbo i Serra Reviewed-by: Heiko Stuebner Signed-off-by: Rob Herring commit d9737953d85131436b09668b5e8d3389c37c1f28 Author: Lu Baolu Date: Sat Jul 14 15:47:02 2018 +0800 iommu/vt-d: Remove the obsolete per iommu pasid tables The obsolete per iommu pasid tables are no longer used. Hence, clean up them. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L Signed-off-by: Joerg Roedel commit 4774cc5245700b8f4414123908c3a7a1c78e5cbb Author: Lu Baolu Date: Sat Jul 14 15:47:01 2018 +0800 iommu/vt-d: Apply per pci device pasid table in SVA This patch applies the per pci device pasid table in the Shared Virtual Address (SVA) implementation. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L Signed-off-by: Joerg Roedel commit a7fc93fed94b173e2f9815d50f4024161b0a39ae Author: Lu Baolu Date: Sat Jul 14 15:47:00 2018 +0800 iommu/vt-d: Allocate and free pasid table This patch allocates a PASID table for a PCI device at the time when the dmar dev_info is attached to dev->archdata.iommu, and free it in the opposite case. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L Signed-off-by: Joerg Roedel commit cc580e41260dbf1a46269235f1f2b572137d9d03 Author: Lu Baolu Date: Sat Jul 14 15:46:59 2018 +0800 iommu/vt-d: Per PCI device pasid table interfaces This patch adds the interfaces for per PCI device pasid table management. Currently we allocate one pasid table for all PCI devices under the scope of an IOMMU. It's insecure in some cases where multiple devices under one single IOMMU unit support PASID features. With per PCI device pasid table, we can achieve finer protection and isolation granularity. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Suggested-by: Ashok Raj Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L Signed-off-by: Joerg Roedel commit 85319dcc8955f8f31828dc8bafff29f6aa011d93 Author: Lu Baolu Date: Sat Jul 14 15:46:58 2018 +0800 iommu/vt-d: Add for_each_device_domain() helper This adds a helper named for_each_device_domain() to iterate over the elements in device_domain_list and invoke a callback against each element. This allows to search the device_domain list in other source files. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L Signed-off-by: Joerg Roedel commit 9ddbfb42138d84bb326023616c40a3dc30ea2837 Author: Lu Baolu Date: Sat Jul 14 15:46:57 2018 +0800 iommu/vt-d: Move device_domain_info to header This allows the per device iommu data and some helpers to be used in other files. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Liu Yi L Signed-off-by: Joerg Roedel commit af39507305fb83a5d3c475c2851f4d59545d8a18 Author: Lu Baolu Date: Sat Jul 14 15:46:56 2018 +0800 iommu/vt-d: Apply global PASID in SVA This patch applies the global pasid name space in the shared virtual address (SVA) implementation. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Reviewed-by: Liu Yi L Reviewed-by: Peter Xu Signed-off-by: Joerg Roedel commit 51261aac51a05c791ef880a100ac2ceed201ef72 Author: Lu Baolu Date: Sat Jul 14 15:46:55 2018 +0800 iommu/vt-d: Avoid using idr_for_each_entry() idr_for_each_entry() is used to iteratte over idr elements of a given type. It isn't suitable for the globle pasid idr since the pasid idr consumer could specify different types of pointers to bind with a pasid. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Reviewed-by: Liu Yi L Reviewed-by: Peter Xu Signed-off-by: Joerg Roedel commit 562831747f6299abd481b5b00bd4fa19d5c8a259 Author: Lu Baolu Date: Sat Jul 14 15:46:54 2018 +0800 iommu/vt-d: Global PASID name space This adds the system wide PASID name space for the PASID allocation. Currently we are using per IOMMU PASID name spaces which are not suitable for some use cases. For an example, one application (associated with a PASID) might talk to two physical devices simultaneously while the two devices could reside behind two different IOMMU units. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Suggested-by: Ashok Raj Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Reviewed-by: Liu Yi L Reviewed-by: Peter Xu Signed-off-by: Joerg Roedel commit f1a066fcc9725960a73c00267afe7e346cc9fc6f Author: Anna-Maria Gleixner Date: Fri Jul 20 10:45:45 2018 +0200 iommu/amd: Remove redundant WARN_ON() The WARN_ON() was introduced in commit 272e4f99e966 ("iommu/amd: WARN when __[attach|detach]_device are called with irqs enabled") to ensure that the domain->lock is taken in proper irqs disabled context. This is required, because the domain->lock is taken as well in irq context. The proper context check by the WARN_ON() is redundant, because it is already covered by LOCKDEP. When working with locks and changing context, a run with LOCKDEP is required anyway and would detect the wrong lock context. Furthermore all callers for those functions are within the same file and all callers acquire another lock which already disables interrupts. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Joerg Roedel commit ed207a743444aca63a4a71eadf6ae19e99ee1534 Author: Christoph Hellwig Date: Thu Jul 19 05:54:40 2018 -0700 microblaze: remove consistent_sync and consistent_sync_page Both unused. Signed-off-by: Christoph Hellwig Signed-off-by: Michal Simek commit 5411ad27dba1e59923f3865f90ab756fd6b9ab3c Author: Christoph Hellwig Date: Thu Jul 19 05:54:39 2018 -0700 microblaze: use generic dma_noncoherent_ops Switch to the generic noncoherent direct mapping implementation. This removes the direction-based optimizations in sync_{single,sg}_for_{cpu,device} which were marked untestested and do not match the usually very well tested {un,}map_{single,sg} implementations. Signed-off-by: Christoph Hellwig Signed-off-by: Michal Simek commit 2ec42486358f63c4a426514c395d13f4b9de5da8 Author: Marcel Ziswiler Date: Fri Jul 20 10:04:23 2018 +0200 ASoC: tegra: improve goto error label While the two error labels "err" and "err_clk_put" goto the same place it is rather confusing that the earlier one is certainly used later again. Signed-off-by: Marcel Ziswiler Signed-off-by: Mark Brown commit faa80b66c767ef4995e33835e9844a5df142c6cc Author: Arnaud Pouliquen Date: Fri Jul 20 10:02:51 2018 +0200 MAINTAINERS: add entry for STM32 audio drivers Add sound/soc/stm drivers entry for STM32 audio drivers from ST Microelectronics. Signed-off-by: Arnaud Pouliquen Signed-off-by: Mark Brown commit e1548b1ba1643d4b5015f7168c64f240ebe114c8 Author: Arnaud Pouliquen Date: Fri Jul 20 10:02:50 2018 +0200 MAINTAINERS: add entry for STI audio drivers Add sound/soc/sti drivers entry for STI audio drivers from ST Microelectronics. Signed-off-by: Arnaud Pouliquen Signed-off-by: Mark Brown commit 486c16f2b5d1eb12339fb7a020961ea1c40e619f Author: Marcel Ziswiler Date: Fri Jul 20 09:53:02 2018 +0200 ASoC: sgtl5000: fix spelling in devicetree binding document This fixes a spelling mistake. Signed-off-by: Marcel Ziswiler Signed-off-by: Mark Brown commit 2ae86955703e9e6a119af4bbe27f6b6dd7a43131 Author: Yoshihiro Shimoda Date: Mon Jul 9 11:53:31 2018 +0900 iommu/ipmmu-vmsa: IMUCTRn.TTSEL needs a special usage on R-Car Gen3 The TTSEL bit of IMUCTRn register of R-Car Gen3 needs to be set unused MMU context number even if uTLBs are disabled (The MMUEN bit of IMUCTRn register = 0). Since initial values of IMUCTRn.TTSEL on all IPMMU-domains are 0, this patch adds a new feature "reserved_context" to reserve IPMMU context number 0 as the unused MMU context. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Joerg Roedel commit 9a6c158f62ccdd37c921ec8b1484418bad5f7984 Author: Sergei Shtylyov Date: Tue Jul 17 23:08:27 2018 +0300 arm64: dts: renesas: r8a77980: add INTC-EX support Describe the INTC-EX interrupt controller in the R8A77980 device tree. Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit fe1bc94a275db82720c6055aa06f6ff87cbb8450 Author: Yoshihiro Shimoda Date: Wed Jul 18 13:54:14 2018 +0900 arm64: dts: renesas: r8a77990: Enable USB3.0 host for Ebisu board This patch adds and USB3.0 host device node and enable it for R-Car E3 Ebisu board. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 30316c4f7f0c903516fd03be4e303dcf70911a15 Author: Takeshi Kihara Date: Tue Jul 17 13:42:09 2018 +0200 arm64: dts: renesas: r8a77995: Add SCIF {0,1,3,4,5} and all HSCIF device nodes This patch adds the device nodes for SCIF {0,1,3,4,5} and all HSCIF serial ports, incl. clocks, power domain and DMAs. Signed-off-by: Takeshi Kihara Signed-off-by: Ulrich Hecht Signed-off-by: Simon Horman Reviewed-by: Geert Uytterhoeven commit 54f464e0c91f10212fa5699bfef1f104ee7d2213 Author: Geert Uytterhoeven Date: Thu Jul 12 18:08:57 2018 +0200 ARM: shmobile: Always enable ARCH_TIMER on SoCs with A7 and/or A15 R-Mobile APE6, R-Car Gen2, and RZ/G1 SoCs have Cortex-A7 and/or Cortex-A15 CPU cores, all of which have ARM architectured timers. Force use of the ARM architectured timer on these SoCs. This allows to: - Remove the calls to shmobile_init_delay() from the corresponding machine vectors, - Remove a check in timer setup specific to R-Car Gen2, - Remove a check in shmobile_init_delay(). Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 8fc0d470bc77fa07632b471cec8207baf9704e32 Author: Arnd Bergmann Date: Fri Jul 6 17:15:19 2018 +0200 ARM: shmobile: r8a7779: hide unused r8a7779_platform_cpu_kill After the cleanup in r8a7779_smp_prepare_cpus(), the only remaining caller of r8a7779_platform_cpu_kill() is in an ifdef, which leads to a build warning without CONFIG_HOTPLUG_CPU: arch/arm/mach-shmobile/smp-r8a7779.c:26:12: error: 'r8a7779_platform_cpu_kill' defined but not used [-Werror=unused-function] This moves the function inside of that #ifdef to avoid the warning. Fixes: 62f55ce683e3 ("ARM: shmobile: r8a7779: Stop powering down secondary CPUs during early boot") Signed-off-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit c83e9c4873d34aa8d9bbb90345fee0757b6233ef Author: Arnd Bergmann Date: Fri Jul 6 17:16:01 2018 +0200 soc: r9a06g032: don't build SMP files for non-SMP config Without CONFIG_SMP, we get a build failure: In file included from include/linux/byteorder/little_endian.h:5, from arch/arm/include/uapi/asm/byteorder.h:22, from include/asm-generic/bitops/le.h:6, from arch/arm/include/asm/bitops.h:342, from include/linux/bitops.h:18, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, from arch/arm/include/asm/bug.h:60, from include/linux/bug.h:5, from include/linux/io.h:23, from drivers/soc/renesas/r9a06g032-smp.c:11: drivers/soc/renesas/r9a06g032-smp.c: In function 'r9a06g032_smp_boot_secondary': drivers/soc/renesas/r9a06g032-smp.c:43:21: error: 'secondary_startup' undeclared (first use in this function) writel(__pa_symbol(secondary_startup), cpu_bootaddr); ^~~~~~~~~~~~~~~~~ This makes the compilation of that file conditional on SMP support. It would probably be better for consistency to leave that file in arch/arm/mach-shmobile/, matching what we do for all other smp operations. Fixes: cde4f86f9249 ("arm: shmobile: Add the R9A06G032 SMP enabler driver") Signed-off-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 7416d4411361c79e10667c571b15eed18e811f44 Author: Michel Pollet Date: Thu Jun 28 09:17:13 2018 +0100 ARM: shmobile: Add the R9A06G032 SMP enabler driver The Renesas R9A06G032 second CA7 is parked in a ROM pen at boot time, it equires a special enable method to get it started. Signed-off-by: Michel Pollet Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 24b87a16fee0ebd49b66e8523186ace7ea09ad12 Author: John Johansen Date: Fri Jul 20 03:25:25 2018 -0700 apparmor: Fix failure to audit context info in build_change_hat Cleans up clang warning: warning: variable 'info' set but not used [-Wunused-but-set-variable] Fixes: 89dbf1962aa63 ("apparmor: move change_hat mediation to using labels") Reported-by: Colin Ian King Signed-off-by: John Johansen commit 9407f5a7ee77c631d1e100436132437cf6237e45 Author: Peter Zijlstra Date: Fri Jul 20 10:09:11 2018 +0200 sched/clock: Close a hole in sched_clock_init() All data required for the 'unstable' sched_clock must be set-up _before_ enabling it -- setting sched_clock_running. This includes the __gtod_offset but also a recent scd stamp. Make the gtod-offset update also set the csd stamp -- it requires the same two clock reads _anyway_. This doesn't hurt in the sched_clock_tick_stable() case and ensures sched_clock_init() gets everything set-up before use. Also switch to unconditional IRQ-disable/enable because the static key stuff already requires this is not ran with IRQs disabled. Fixes: 857baa87b642 ("sched/clock: Enable sched clock early") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Cc: Pavel Tatashin Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180720080911.GM2494@hirez.programming.kicks-ass.net commit 31d5e6b72439c188ccf09c0b2ba5a7a6d4db9582 Author: Hanna Hawa Date: Tue Jul 17 13:30:03 2018 +0300 dmaengine: mv_xor_v2: enable COMPILE_TEST To get more coverage, enable COMPILE_TEST for this driver. Signed-off-by: Hanna Hawa Reviewed-by: Thomas Petazzoni Signed-off-by: Vinod Koul commit c3a272c7b0c8995bab2116436b03e0e44b480c73 Author: Hanna Hawa Date: Tue Jul 17 13:30:02 2018 +0300 dmaengine: mv_xor_v2: move unmap to before callback Completion callback should happen after dma_descriptor_unmap() has happened. This allow the cache invalidate to happen and ensure that the data accessed by the upper layer is in memory that was from DMA rather than stale data. On some architecture this is done by the hardware, however we should make the code consistent to not cause confusion. Signed-off-by: Hanna Hawa Reviewed-by: Thomas Petazzoni Signed-off-by: Vinod Koul commit 5a80aff92ad28c5e3045b542576c1d08260606db Author: Hanna Hawa Date: Tue Jul 17 13:30:01 2018 +0300 dmaengine: mv_xor_v2: convert callback to helper function This is in preparation of moving to a callback that provides results to the callback for the transaction. The conversion will maintain current behavior and the driver must convert to new callback mechanism at a later time in order to receive results. Signed-off-by: Hanna Hawa Signed-off-by: Vinod Koul commit 8bbafed8dd5cfa81071b50ead5cb60367fdef3a9 Author: Hanna Hawa Date: Tue Jul 17 13:30:00 2018 +0300 dmaengine: mv_xor_v2: kill the tasklets upon exit The mv_xor_v2 driver uses a tasklet, initialized during the probe() routine. However, it forgets to cleanup the tasklet using tasklet_kill() function during the remove() routine, which this patch fixes. This prevents the tasklet from potentially running after the module has been removed. Fixes: 19a340b1a820 ("dmaengine: mv_xor_v2: new driver") Signed-off-by: Hanna Hawa Reviewed-by: Thomas Petazzoni Signed-off-by: Vinod Koul commit 48c008b5914f9bca44fccce103627bcf39928f95 Author: Hanna Hawa Date: Tue Jul 17 13:29:59 2018 +0300 dmaengine: mv_xor_v2: explicitly freeup irq dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Hanna Hawa Signed-off-by: Vinod Koul commit 5baf4f9c0035f3e33bb693a1a1e87599f6e804e6 Author: Nathan Harold Date: Thu Jul 19 19:07:47 2018 -0700 xfrm: Allow xfrmi if_id to be updated by UPDSA Allow attaching an SA to an xfrm interface id after the creation of the SA, so that tasks such as keying which must be done as the SA is created, can remain separate from the decision on how to route traffic from an SA. This permits SA creation to be decomposed in to three separate steps: 1) allocation of a SPI 2) algorithm and key negotiation 3) insertion into the data path Signed-off-by: Nathan Harold Signed-off-by: Steffen Klassert commit bc56b33404599edc412b91933d74b36873e8ea25 Author: Benedict Wong Date: Thu Jul 19 10:50:44 2018 -0700 xfrm: Remove xfrmi interface ID from flowi In order to remove performance impact of having the extra u32 in every single flowi, this change removes the flowi_xfrm struct, prefering to take the if_id as a method parameter where needed. In the inbound direction, if_id is only needed during the __xfrm_check_policy() function, and the if_id can be determined at that point based on the skb. As such, xfrmi_decode_session() is only called with the skb in __xfrm_check_policy(). In the outbound direction, the only place where if_id is needed is the xfrm_lookup() call in xfrmi_xmit2(). With this change, the if_id is directly passed into the xfrm_lookup_with_ifid() call. All existing callers can still call xfrm_lookup(), which uses a default if_id of 0. This change does not change any behavior of XFRMIs except for improving overall system performance via flowi size reduction. This change has been tested against the Android Kernel Networking Tests: https://android.googlesource.com/kernel/tests/+/master/net/test Signed-off-by: Benedict Wong Signed-off-by: Steffen Klassert commit 887532ca7ca59fcf0547a79211756791128030a3 Author: Alex Hung Date: Wed Jul 18 11:46:55 2018 -0700 ACPI / OSI: Add OEM _OSI string to enable NVidia HDMI audio Some ThinkPad systems have a power-saving feature that turns off HDMI audio device in Windows, but NVidia Linux driver does not support this feature. As a result, HDMI audio will not work on Linux. A BIOS workaround is added with an OEM_OSI string "Linux-Lenovo-NV-HDMI-Audio" to power on NVidia HDMI audio when booting. The form of the OEM _OSI strings is defined by each OEMs and is discussed in Documentation/acpi/osi.txt. Signed-off-by: Alex Hung Signed-off-by: Rafael J. Wysocki commit ae976358cd7b0272ccfbd2517edaf0d46f2a356b Author: Kai Heng Feng Date: Thu Jul 19 19:00:30 2018 +0800 Revert "ACPI / bus: Parse tables as term_list for Dell XPS 9570 and Precision M5530" Reverts commit 36904703aeee (ACPI / bus: Parse tables as term_list for Dell XPS 9570 and Precision M5530). Since commit 5a8361f7ecce (ACPICA: Integrate package handling with module-level code), acpi_gbl_execute_tables_as_methods is always true, so we can remove the quirk for XPS 9570/Precision M5530. Signed-off-by: Kai-Heng Feng Signed-off-by: Rafael J. Wysocki commit c8cbc1c20c29697e7335a5044fe6c60aa5c6e922 Author: Claudiu Beznea Date: Tue Jul 17 17:03:53 2018 +0300 ARM: dts: at91: fix typos for SSC TD functions Fix typo for TD function of pins PIN_PB22 and PIN_PC14 Signed-off-by: Claudiu Beznea Signed-off-by: Alexandre Belloni commit ef8375bea216a91194d0aac041d5c38a5db089ce Author: Ben Whitten Date: Fri Jun 15 14:40:55 2018 +0100 ARM: dts: add support for Laird SOM60 module and DVK boards This adds support for Lairds upcoming SOM module, featuring Marvell WiFi and Bluetooth, 2Gb NAND / 1Gb LPDDR SDRAM, and an Atmel SAMA5D3 CPU. Signed-off-by: Ben Whitten Signed-off-by: Alexandre Belloni commit fd2c7ef94311791dd5cfbe9a099c96a9eedfab78 Author: Ben Whitten Date: Fri Jun 15 14:40:54 2018 +0100 ARM: dts: add support for Gatwick board based on WB50N Add support for the LoRa gateway from Laird, the RG1xx. This board houses the WB50NBT CPU module along with a Semtech SX1301 based concentrator card. https://www.lairdtech.com/products/rg1xx-lora-gateway Signed-off-by: Ben Whitten Signed-off-by: Alexandre Belloni commit e8274426b4b770123ee5bf3a3d5fc5f9c89cee66 Author: Ben Whitten Date: Fri Jun 15 14:40:53 2018 +0100 ARM: dts: add support for Laird WB50N cpu module and DVK This adds support for Lairds CPU module, featuring Atheros wifi, CSR Bluetooth and, Atmel SAMA5D3 CPU. https://www.lairdtech.com/products/wb50nbt-wi-fi-bluetooth-module Signed-off-by: Ben Whitten Signed-off-by: Alexandre Belloni commit 044565558639ebcd6bc6bc7dd97001792e43a671 Author: Ben Whitten Date: Fri Jun 15 14:40:52 2018 +0100 ARM: dts: add support for Laird WB45N cpu module and DVK This adds support for Lairds combo CPU module, featuring on board Atheros wifi, CSR Bluetooth radio and, Atmel CPU. https://www.lairdtech.com/products/wb45nbt Signed-off-by: Ben Whitten Signed-off-by: Alexandre Belloni commit fc37204432d218409400b1cf6abd4a650bd987eb Author: Ben Whitten Date: Fri Jun 15 14:40:51 2018 +0100 ARM: dts: at91: add labels to soc dtsi for derivative boards This adds labels to commonly used device-tree nodes so that derivative boards can avoid ahb/apb hierarchy. Signed-off-by: Ben Whitten Signed-off-by: Alexandre Belloni commit 989974c804574d250ac92d44e220081959ac8ac1 Author: Vivek Goyal Date: Fri May 11 11:49:33 2018 -0400 ovl: Enable metadata only feature All the bits are in patches before this. So it is time to enable the metadata only copy up feature. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 935a074f48675374a655456ae75fe6be9e8c2388 Author: Vivek Goyal Date: Fri May 11 11:49:33 2018 -0400 ovl: Do not do metacopy only for ioctl modifying file attr ovl_copy_up() by default will only do metadata only copy up (if enabled). That means when ovl_real_ioctl() calls ovl_real_file(), it will still get the lower file (as ovl_real_file() opens data file and not metacopy). And that means "chattr +i" will end up modifying lower inode. There seem to be two ways to solve this. A. Open metacopy file in ovl_real_ioctl() and do operations on that B. Force full copy up when FS_IOC_SETFLAGS is called. I am resorting to option B for now as it feels little safer option. If there are performance issues due to this, we can revisit it. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 997336f2c3053b74ec8c9d2d368ddd960f2fc8b6 Author: Vivek Goyal Date: Fri May 11 11:49:33 2018 -0400 ovl: Do not do metadata only copy-up for truncate operation truncate should copy up full file (and not do metacopy only), otherwise it will be broken. For example, use truncate to increase size of a file so that any read beyong existing size will return null bytes. If we don't copy up full file, then we end up opening lower file and read from it only reads upto the old size (and not new size after truncate). Hence to avoid such situations, copy up data as well when file size changes. So far it was being done by d_real(O_WRONLY) call in truncate() path. Now that patch has been reverted. So force full copy up in ovl_setattr() if size of file is changing. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit d1e6f6a94d6cefed2b6f7a222853ebcd2805b43b Author: Vivek Goyal Date: Fri May 11 11:49:33 2018 -0400 ovl: add helper to force data copy-up Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 0a2d0d3f2f291e3080721888a986ea52e43e1086 Author: Vivek Goyal Date: Fri May 11 11:49:32 2018 -0400 ovl: Check redirect on index as well Right now we seem to check redirect only if upperdentry is found. But it is possible that there is no upperdentry but later we found an index. We need to check redirect on index as well and set it in ovl_inode->redirect. Otherwise link code can assume that dentry does not have redirect and place a new one which breaks things. In my testing overlay/033 test started failing in xfstests. Following are the details. For example do following. $ mkdir lower upper work merged - Make lower dir with 4 links. $ echo "foo" > lower/l0.txt $ ln lower/l0.txt lower/l1.txt $ ln lower/l0.txt lower/l2.txt $ ln lower/l0.txt lower/l3.txt - Mount with index on and metacopy on. $ mount -t overlay -o lowerdir=lower,upperdir=upper,workdir=work,\ index=on,metacopy=on none merged - Link lower $ ln merged/l0.txt merged/l4.txt (This will metadata copy up of l0.txt and put an absolute redirect /l0.txt) $ echo 2 > /proc/sys/vm/drop/caches $ ls merged/l1.txt (Now l1.txt will be looked up. There is no upper dentry but there is lower dentry and index will be found. We don't check for redirect on index, hence ovl_inode->redirect will be NULL.) - Link Upper $ ln merged/l4.txt merged/l5.txt (Lookup of l4.txt will use inode from l1.txt lookup which is still in cache. It has ovl_inode->redirect NULL, hence link will put a new redirect and replace /l0.txt with /l4.txt - Drop caches. echo 2 > /proc/sys/vm/drop_caches - List l1.txt and it returns -ESTALE $ ls merged/l0.txt (It returns stale because, we found a metacopy of l0.txt in upper and it has redirect l4.txt but there is no file named l4.txt in lower layer. So lower data copy is not found and -ESTALE is returned.) So problem here is that we did not process redirect on index. Check redirect on index as well and then problem is fixed. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 4120fe64dce4f73d1a595253568d9f27674f2071 Author: Vivek Goyal Date: Fri May 11 11:49:32 2018 -0400 ovl: Set redirect on upper inode when it is linked When we create a hardlink to a metacopy upper file, first the redirect on that inode. Path based lookup will not work with newly created link and redirect will solve that issue. Also use absolute redirect as two hardlinks could be in different directores and relative redirect will not work. I have not put any additional locking around setting redirects while introducing redirects for non-dir files. For now it feels like existing locking is sufficient. If that's not the case, we will have add more locking. Following is my rationale about why do I think current locking seems ok. Basic problem for non-dir files is that more than on dentry could be pointing to same inode and in theory only relying on dentry based locks (d->d_lock) did not seem sufficient. We set redirect upon rename and upon link creation. In both the paths for non-dir file, VFS locks both source and target inodes (->i_rwsem). That means vfs rename and link operations on same source and target can't he happening in parallel (Even if there are multiple dentries pointing to same inode). So that probably means that at a time on an inode, only one call of ovl_set_redirect() could be working and we don't need additional locking in ovl_set_redirect(). ovl_inode->redirect is initialized only when inode is created new. That means it should not race with any other path and setting ovl_inode->redirect should be fine. Reading of ovl_inode->redirect happens in ovl_get_redirect() path. And this called only in ovl_set_redirect(). And ovl_set_redirect() already seemed to be protected using ->i_rwsem. That means ovl_set_redirect() and ovl_get_redirect() on source/target inode should not make progress in parallel and is mutually exclusive. Hence no additional locking required. Now, only case where ovl_set_redirect() and ovl_get_redirect() could race seems to be case of absolute redirects where ovl_get_redirect() has to travel up the tree. In that case we already take d->d_lock and that should be sufficient as directories will not have multiple dentries pointing to same inode. So given VFS locking and current usage of redirect, current locking around redirect seems to be ok for non-dir as well. Once we have the logic to remove redirect when metacopy file gets copied up, then we probably will need additional locking. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 7bb083837d1b5244a809ff1483408992c0e05ca6 Author: Vivek Goyal Date: Fri May 11 11:49:32 2018 -0400 ovl: Set redirect on metacopy files upon rename Set redirect on metacopy files upon rename. This will help find data dentry in lower dirs. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 60124877b9ec4fa5a34ddeeedba473820888d4b2 Author: Vivek Goyal Date: Fri May 11 11:49:32 2018 -0400 ovl: Do not set dentry type ORIGIN for broken hardlinks If a dentry has copy up origin, we set flag OVL_PATH_ORIGIN. So far this decision was easy that we had to check only for oe->numlower and if it is non-zero, we knew there is copy up origin. (For non-dir we installed origin dentry in lowerstack[0]). But we don't create ORGIN xattr for broken hardlinks (index=off). And with metacopy feature it is possible that we will install lowerstack[0] but ORIGIN xattr is not there. It is data dentry of upper metacopy dentry which has been found using regular name based lookup or using REDIRECT. So with addition of this new case, just presence of oe->numlower is not sufficient to guarantee that ORIGIN xattr is present. So to differentiate between two cases, look at OVL_CONST_INO flag. If this flag is set and upperdentry is there, that means it can be marked as type ORIGIN. OVL_CONST_INO is not set if lower hardlink is broken or will be broken over copy up. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit a00c2d59e914b8ec46f1637e2e283aa35583c455 Author: Vivek Goyal Date: Fri May 11 11:49:32 2018 -0400 ovl: Add an inode flag OVL_CONST_INO Add an ovl_inode flag OVL_CONST_INO. This flag signifies if inode number will remain constant over copy up or not. This flag does not get updated over copy up and remains unmodifed after setting once. Next patch in the series will make use of this flag. It will basically figure out if dentry is of type ORIGIN or not. And this can be derived by this flag. ORIGIN = (upperdentry && ovl_test_flag(OVL_CONST_INO, inode)). Suggested-by: Amir Goldstein Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 0b17c28af1b8814505fd4eafd96e6e7e05bba01d Author: Vivek Goyal Date: Fri May 11 11:49:32 2018 -0400 ovl: Treat metacopy dentries as type OVL_PATH_MERGE Right now OVL_PATH_MERGE is used only for merged directories. But conceptually, a metacopy dentry (backed by a lower data dentry) is a merged entity as well. So mark metacopy dentries as OVL_PATH_MERGE and ovl_rename() makes use of this property later to set redirect on a metacopy file. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit b8a8824ca011050b590a6353067e722a24a591fb Author: Vivek Goyal Date: Fri May 11 11:49:31 2018 -0400 ovl: Check redirects for metacopy files Right now we rely on path based lookup for data origin of metacopy upper. This will work only if upper has not been renamed. We solved this problem already for merged directories using redirect. Use same logic for metacopy files. This patch just goes on to check redirects for metacopy files. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 0618a816edab6cb46d6d456f2fdff6bb325a4c77 Author: Vivek Goyal Date: Fri May 11 11:49:31 2018 -0400 ovl: Move some dir related ovl_lookup_single() code in else block Move some directory related code in else block. This is pure code reorganization and no functionality change. Next patch enables redirect processing on metacopy files and needs this change. By keeping non-functional changes in a separate patch, next patch looks much smaller and cleaner. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 2c3d73589adc6d3450890a6f793e5e8a1ae894e0 Author: Vivek Goyal Date: Fri May 11 11:49:31 2018 -0400 ovl: Do not expose metacopy only dentry from d_real() Metacopy dentry/inode is internal to overlay and is never exposed outside of it. Exception is metacopy upper file used for fsync(). Modify d_real() to look for dentries/inode which have data, but also allow matching upper inode without data for the fsync case. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 8c444d2a971fdccda670e874f12443627f028fbc Author: Vivek Goyal Date: Fri May 11 11:49:31 2018 -0400 ovl: Open file with data except for the case of fsync ovl_open() should open file which contains data and not open metacopy inode. With the introduction of metacopy inodes, with current implementaion we will end up opening metacopy inode as well. But there can be certain circumstances like ovl_fsync() where we want to allow opening a metacopy inode instead. Hence, change ovl_open_realfile() and and add extra parameter which specifies whether to allow opening metacopy inode or not. If this parameter is false, we look for data inode and open that. This should allow covering both the cases. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 4823d49c26eaf269cd2c2723bed8249aaed80795 Author: Vivek Goyal Date: Fri May 11 11:49:31 2018 -0400 ovl: Add helper ovl_inode_realdata() Add an helper to retrieve real data inode associated with overlay inode. This helper will ignore all metacopy inodes and will return only the real inode which has data. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 2664bd0897c2889258472a1ee922ef9d4c5fa58f Author: Vivek Goyal Date: Fri May 11 11:49:30 2018 -0400 ovl: Store lower data inode in ovl_inode Right now ovl_inode stores inode pointer for lower inode. This helps with quickly getting lower inode given overlay inode (ovl_inode_lower()). Now with metadata only copy-up, we can have metacopy inode in middle layer as well and inode containing data can be different from ->lower. I need to be able to open the real file in ovl_open_realfile() and for that I need to quickly find the lower data inode. Hence store lower data inode also in ovl_inode. Also provide an helper ovl_inode_lowerdata() to access this field. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 67d756c27ac4f4576dee313579724bd8711bc75e Author: Vivek Goyal Date: Fri May 11 11:49:30 2018 -0400 ovl: Fix ovl_getattr() to get number of blocks from lower If an inode has been copied up metadata only, then we need to query the number of blocks from lower and fill up the stat->st_blocks. We need to be careful about races where we are doing stat on one cpu and data copy up is taking place on other cpu. We want to return stat->st_blocks either from lower or stable upper and not something in between. Hence, ovl_has_upperdata() is called first to figure out whether block reporting will take place from lower or upper. We now support metacopy dentries in middle layer. That means number of blocks reporting needs to come from lowest data dentry and this could be different from lower dentry. Hence we end up making a separate vfs_getxattr() call for metacopy dentries to get number of blocks. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 647d253fcd53fae185408b33ec5587a57cb3cc88 Author: Vivek Goyal Date: Fri May 11 11:49:30 2018 -0400 ovl: Add helper ovl_dentry_lowerdata() to get lower data dentry Now we have the notion of data dentry and metacopy dentry. ovl_dentry_lower() will return uppermost lower dentry, but it could be either data or metacopy dentry. Now we support metacopy dentries in lower layers so it is possible that lowerstack[0] is metacopy dentry while lowerstack[1] is actual data dentry. So add an helper which returns lowest most dentry which is supposed to be data dentry. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 4f93b426ab3930952eca6c5c456c2223a3adcbf5 Author: Vivek Goyal Date: Fri May 11 11:49:30 2018 -0400 ovl: Copy up meta inode data from lowest data inode So far lower could not be a meta inode. So whenever it was time to copy up data of a meta inode, we could copy it up from top most lower dentry. But now lower itself can be a metacopy inode. That means data copy up needs to take place from a data inode in metacopy inode chain. Find lower data inode in the chain and use that for data copy up. Introduced a helper called ovl_path_lowerdata() to find the lower data inode chain. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 9d3dfea3d35a3235f0f1e2ce719bb4f0b696caa2 Author: Vivek Goyal Date: Fri May 11 11:49:28 2018 -0400 ovl: Modify ovl_lookup() and friends to lookup metacopy dentry This patch modifies ovl_lookup() and friends to lookup metacopy dentries. It also allows for presence of metacopy dentries in lower layer. During lookup, check for presence of OVL_XATTR_METACOPY and if not present, set OVL_UPPERDATA bit in flags. We don't support metacopy feature with nfs_export. So in nfs_export code, we set OVL_UPPERDATA flag set unconditionally if upper inode exists. Do not follow metacopy origin if we find a metacopy only inode and metacopy feature is not enabled for that mount. Like redirect, this can have security implications where an attacker could hand craft upper and try to gain access to file on lower which it should not have to begin with. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 027065b726434d2a95a5cc516129be765e27ecf8 Author: Vivek Goyal Date: Fri May 11 11:49:28 2018 -0400 ovl: Use out_err instead of out_nomem Right now we use goto out_nomem which assumes error code is -ENOMEM. But there are other errors returned like -ESTALE as well. So instead of out_nomem, use out_err which will do ERR_PTR(err). That way one can put error code in err and jump to out_err. This just code reorganization and no change of functionality. I am about to add more code and this organization helps laying more code and error paths on top of it. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 0c2888749363645d62cc48852d0af98d5ceef332 Author: Vivek Goyal Date: Fri May 11 11:49:28 2018 -0400 ovl: A new xattr OVL_XATTR_METACOPY for file on upper Now we will have the capability to have upper inodes which might be only metadata copy up and data is still on lower inode. So add a new xattr OVL_XATTR_METACOPY to distinguish between two cases. Presence of OVL_XATTR_METACOPY reflects that file has been copied up metadata only and and data will be copied up later from lower origin. So this xattr is set when a metadata copy takes place and cleared when data copy takes place. We also use a bit in ovl_inode->flags to cache OVL_UPPERDATA which reflects whether ovl inode has data or not (as opposed to metadata only copy up). If a file is copied up metadata only and later when same file is opened for WRITE, then data copy up takes place. We copy up data, remove METACOPY xattr and then set the UPPERDATA flag in ovl_inode->flags. While all these operations happen with oi->lock held, read side of oi->flags can be lockless. That is another thread on another cpu can check if UPPERDATA flag is set or not. So this gives us an ordering requirement w.r.t UPPERDATA flag. That is, if another cpu sees UPPERDATA flag set, then it should be guaranteed that effects of data copy up and remove xattr operations are also visible. For example. CPU1 CPU2 ovl_open() acquire(oi->lock) ovl_open_maybe_copy_up() ovl_copy_up_data() open_open_need_copy_up() vfs_removexattr() ovl_already_copied_up() ovl_dentry_needs_data_copy_up() ovl_set_flag(OVL_UPPERDATA) ovl_test_flag(OVL_UPPERDATA) release(oi->lock) Say CPU2 is copying up data and in the end sets UPPERDATA flag. But if CPU1 perceives the effects of setting UPPERDATA flag but not the effects of preceding operations (ex. upper that is not fully copied up), it will be a problem. Hence this patch introduces smp_wmb() on setting UPPERDATA flag operation and smp_rmb() on UPPERDATA flag test operation. May be some other lock or barrier is already covering it. But I am not sure what that is and is it obvious enough that we will not break it in future. So hence trying to be safe here and introducing barriers explicitly for UPPERDATA flag/bit. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 2002df85367ca69961d39020f56d3d727897be01 Author: Vivek Goyal Date: Fri May 11 11:49:28 2018 -0400 ovl: Add helper ovl_already_copied_up() There are couple of places where we need to know if file is already copied up (in lockless manner). Right now its open coded and there are only two conditions to check. Soon this patch series will introduce another condition to check and Amir wants to introduce one more. So introduce a helper instead to check this so that code is easier to read. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 44d5bf109a73f4162d97ab714770fdf76a8dc685 Author: Vivek Goyal Date: Fri May 11 11:49:27 2018 -0400 ovl: Copy up only metadata during copy up where it makes sense If it makes sense to copy up only metadata during copy up, do it. This is done for regular files which are not opened for WRITE. Right now ->metacopy is set to 0 always. Last patch in the series will remove the hard coded statement and enable metacopy feature. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit bd64e57586d3722d2fc06093c3d7e3c4adb9e060 Author: Vivek Goyal Date: Fri May 11 11:49:27 2018 -0400 ovl: During copy up, first copy up metadata and then data Just a little re-ordering of code. This helps with next patch where after copying up metadata, we skip data copying step, if needed. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit d5791044d2e5749ef4de84161cec5532e2111540 Author: Vivek Goyal Date: Fri May 11 11:49:27 2018 -0400 ovl: Provide a mount option metacopy=on/off for metadata copyup By default metadata only copy up is disabled. Provide a mount option so that users can choose one way or other. Also provide a kernel config and module option to enable/disable metacopy feature. metacopy feature requires redirect_dir=on when upper is present. Otherwise, it requires redirect_dir=follow atleast. As of now, metacopy does not work with nfs_export=on. So if both metacopy=on and nfs_export=on then nfs_export is disabled. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit d6eac039133b31f9db1c63d2e51b88df61d075cc Author: Vivek Goyal Date: Fri May 11 11:49:27 2018 -0400 ovl: Move the copy up helpers to copy_up.c Right now two copy up helpers are in inode.c. Amir suggested it might be better to move these to copy_up.c. There will one more related function which will come in later patch. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 9cec54c83a8baba3099bb8b445a735b93ab9511f Author: Vivek Goyal Date: Fri May 11 11:49:27 2018 -0400 ovl: Initialize ovl_inode->redirect in ovl_get_inode() ovl_inode->redirect is an inode property and should be initialized in ovl_get_inode() only when we are adding a new inode to cache. If inode is already in cache, it is already initialized and we should not be touching ovl_inode->redirect field. As of now this is not a problem as redirects are used only for directories which don't share inode. But soon I want to use redirects for regular files also and there it can become an issue. Hence, move ->redirect initialization in ovl_get_inode(). Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 0c31d675aad949e5dfecf7a32813514423e6c766 Author: Miklos Szeredi Date: Wed Jul 18 15:44:44 2018 +0200 ovl: fix documentation of non-standard behavior We can now drop description of the ro/rw inconsistency from the documentation. Also clarify, that now fully standard compliant behavior can be enabled with kernel/module/mount options. Signed-off-by: Miklos Szeredi commit a3eed83a18954eb9433a8193c520619e21a028da Merge: 57dc2bfc334a 97df0d65623b Author: David S. Miller Date: Thu Jul 19 23:35:38 2018 -0700 Merge branch 'qed-Add-support-for-phy-module-query' Sudarsana Reddy Kalluru says: ==================== qed*: Add support for phy module query. The patch series adds driver support for querying the PHY module's eeprom data. Please consider applying it to 'net-next'. ==================== Signed-off-by: David S. Miller commit 97df0d65623b1a6e090df0a8298b8349d538c67e Author: Sudarsana Reddy Kalluru Date: Wed Jul 18 06:27:23 2018 -0700 qede: Add driver callbacks for eeprom module query. This patch implements the ethtool callbacks for querying sfp/eeprom module. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit b51dab46c6adfbb7e80cd0f59ae17b8a30d94b1a Author: Sudarsana Reddy Kalluru Date: Wed Jul 18 06:27:22 2018 -0700 qed: Add qed APIs for PHY module query. This patch adds qed APIs for reading the PHY module. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 57dc2bfc334aef84364d4939205fb86c6473b13a Merge: 3bc950c34b28 0e2c17b64d5c Author: David S. Miller Date: Thu Jul 19 23:26:02 2018 -0700 Merge branch 'tc-tunnel-ttl-tos' Or Gerlitz says ==================== set/match the tos/ttl fields of TC based IP tunnels This series comes to address the case to set (encap) and match (decap) also the tos and ttl fields of TC based IP tunnels. Example encap (1st one) and decap (2nd) that use the new fields tc filter add dev eth0_0 protocol ip parent ffff: prio 10 flower \ src_mac e4:11:22:33:44:50 dst_mac e4:11:22:33:44:70 \ action tunnel_key set src_ip 192.168.10.1 dst_ip 192.168.10.2 id 100 dst_port 4789 tos 0x30 \ action mirred egress redirect dev vxlan_sys_4789 tc filter add dev vxlan_sys_4789 protocol ip parent ffff: prio 10 flower \ enc_src_ip 192.168.10.2 enc_dst_ip 192.168.10.1 enc_key_id 100 enc_dst_port 4789 enc_tos 0x30 \ src_mac e4:11:22:33:44:70 dst_mac e4:11:22:33:44:50 \ action tunnel_key unset \ action mirred egress redirect dev eth0_0 ==================== Signed-off-by: David S. Miller commit 0e2c17b64d5c7f57bcd7054ef87797376dcdee26 Author: Or Gerlitz Date: Tue Jul 17 19:27:18 2018 +0300 net/sched: cls_flower: Support matching on ip tos and ttl for tunnels Allow users to set rules matching on ipv4 tos and ttl or ipv6 traffic-class and hoplimit of tunnel headers. Signed-off-by: Or Gerlitz Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 5544adb9707fda5d54494c37940701894c16b9a0 Author: Or Gerlitz Date: Tue Jul 17 19:27:17 2018 +0300 flow_dissector: Dissect tos and ttl from the tunnel info Add dissection of the tos and ttl from the ip tunnel headers fields in case a match is needed on them. Signed-off-by: Or Gerlitz Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 07a557f47d7e09b2c60ad4d51b1ac8b035b75f73 Author: Or Gerlitz Date: Tue Jul 17 19:27:16 2018 +0300 net/sched: tunnel_key: Allow to set tos and ttl for tc based ip tunnels Allow user-space to provide tos and ttl to be set for the tunnel headers. Signed-off-by: Or Gerlitz Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 0e7d4d932ffc23f75efb31a8c2ac2396c1b81c55 Author: Michael Müller Date: Sun Jul 15 00:27:06 2018 +0200 crypto: sharah - Unregister correct algorithms for SAHARA 3 This patch fixes two typos related to unregistering algorithms supported by SAHARAH 3. In sahara_register_algs the wrong algorithms are unregistered in case of an error. In sahara_unregister_algs the wrong array is used to determine the iteration count. Signed-off-by: Michael Müller Signed-off-by: Herbert Xu commit e5c8ee1f7cc2b090ecb44b34b1f7d22665526fdc Author: Antoine Tenart Date: Fri Jul 13 17:43:16 2018 +0200 crypto: inside-secure - initialize first_rdesc to make GCC happy In the cipher safexcel_send_req function, GCC warns that first_rdesc may be used uninitialized. While this should never happen, this patch removes the warning by initializing this variable to NULL to make GCC happy. This was reported by the kbuild test robot. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 301422e37782ba20371ee1d3cdb900f816c58e66 Author: Antoine Tenart Date: Fri Jul 13 16:51:37 2018 +0200 crypto: inside-secure - switch to SPDX identifiers Use the appropriate SPDX license identifiers and drop the license text. This patch is only cosmetic. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit aef66587f19c7ecc52717328a4c5484f1d2268e9 Author: Stephan Mueller Date: Wed Jul 11 20:36:23 2018 +0200 crypto: ecdh - fix typo of P-192 b value Fix the b value to be compliant with FIPS 186-4 D.1.2.1. This fix is required to make sure the SP800-56A public key test passes for P-192. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit c98fae5e29fad0a4990e20b14bf0a4526518c4ed Author: Stephan Mueller Date: Wed Jul 11 20:35:49 2018 +0200 crypto: dh - update test for public key verification By adding a zero byte-length for the DH parameter Q value, the public key verification test is disabled for the given test. Reported-by: Eric Biggers Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit cf862cbc831982a27f14a08adf82ad9ca8d86205 Author: Stephan Mueller Date: Tue Jul 10 17:56:33 2018 +0200 crypto: drbg - eliminate constant reinitialization of SGL The CTR DRBG requires two SGLs pointing to input/output buffers for the CTR AES operation. The used SGLs always have only one entry. Thus, the SGL can be initialized during allocation time, preventing a re-initialization of the SGLs during each call. The performance is increased by about 1 to 3 percent depending on the size of the requested buffer size. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 3fd8093b41e745448ffeb0a0d3becc2cd1f9d7ad Author: Gustavo A. R. Silva Date: Tue Jul 10 09:22:52 2018 -0500 crypto: dh - fix memory leak In case memory resources for *base* were allocated, release them before return. Addresses-Coverity-ID: 1471702 ("Resource leak") Fixes: e3fe0ae12962 ("crypto: dh - add public key verification test") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Stephan Müller Signed-off-by: Herbert Xu commit 8c934e01a7ce685d98e970880f5941d79272c654 Author: Jiang Biao Date: Fri Jul 20 08:06:32 2018 +0800 x86/pti: Check the return value of pti_user_pagetable_walk_pmd() pti_user_pagetable_walk_pmd() can return NULL, so the return value should be checked to prevent a NULL pointer dereference. Add the check and a warning when the PMD allocation fails. Signed-off-by: Jiang Biao Signed-off-by: Thomas Gleixner Cc: dave.hansen@linux.intel.com Cc: luto@kernel.org Cc: hpa@zytor.com Cc: albcamus@gmail.com Cc: zhong.weidong@zte.com.cn Link: https://lkml.kernel.org/r/1532045192-49622-2-git-send-email-jiang.biao2@zte.com.cn commit b2b7d986a89b6c94b1331a909de1217214fb08c1 Author: Jiang Biao Date: Fri Jul 20 08:06:31 2018 +0800 x86/pti: Check the return value of pti_user_pagetable_walk_p4d() pti_user_pagetable_walk_p4d() can return NULL, so the return value should be checked to prevent a NULL pointer dereference. Add the check and a warning when the P4D allocation fails. Signed-off-by: Jiang Biao Signed-off-by: Thomas Gleixner Cc: dave.hansen@linux.intel.com Cc: luto@kernel.org Cc: hpa@zytor.com Cc: albcamus@gmail.com Cc: zhong.weidong@zte.com.cn Link: https://lkml.kernel.org/r/1532045192-49622-1-git-send-email-jiang.biao2@zte.com.cn commit be0e16ce7c3bf9855f1ef5ae46cf889e1784ddea Author: K. Y. Srinivasan Date: Fri Jul 20 03:50:09 2018 +0000 x86/hyper-v: Fix wrong merge conflict resolution When the mapping betwween the Linux notion of CPU ID to the hypervisor's notion of CPU ID is not initialized, IPI must fall back to the non-enlightened path. The recent merge of upstream changes into the hyperv branch resolved a merge conflict wronly by returning success in that case, which results in the IPI not being sent at all. Fix it up. Fixes: 8f63e9230dec ("Merge branch 'x86/urgent' into x86/hyperv") Reported-by: Michael Kelley Signed-off-by: K. Y. Srinivasan Signed-off-by: Thomas Gleixner Cc: gregkh@linuxfoundation.org Cc: devel@linuxdriverproject.org Cc: olaf@aepfle.de Cc: apw@canonical.com Cc: jasowang@redhat.com Cc: hpa@zytor.com Cc: sthemmin@microsoft.com Cc: Michael.H.Kelley@microsoft.com Cc: vkuznets@redhat.com Link: https://lkml.kernel.org/r/20180720035009.3995-1-kys@linuxonhyperv.com commit 500775074f88d9cf5416bed2ca19592812d62c41 Merge: ef8e0ff97ae8 5c675bf2c67c Author: Dave Airlie Date: Fri Jul 20 14:30:18 2018 +1000 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next More features for 4.19: - Map processes to vmids for debugging GPUVM faults - Raven gfxoff fixes - Initial gfxoff support for vega12 - Use defines for interrupt sources rather than magic numbers - DC aux fixes - Finish DC logging TODO - Add more DC debugfs interfaces for conformance testing - Add CRC support for DCN - Scheduler rework in preparation for load balancing - Unify common smu9 code - Clean up UVD instancing support - ttm cleanups - Misc fixes and cleanups Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180719194001.3488-1-alexander.deucher@amd.com commit e5af5ff34cf037ac7bb70976161427dc40bf4a96 Merge: 30587589251a 39232ed5a179 Author: Thomas Gleixner Date: Fri Jul 20 06:43:05 2018 +0200 Merge tag 'fortglx/4.19/time-part2' of https://git.linaro.org/people/john.stultz/linux into timers/core Pull the second set of timekeeping things for 4.19 from John Stultz * NTP argument clenaups and constification from Ondrej Mosnacek * Fix to avoid RTC injecting sleeptime when suspend fails from Mukesh Ojha * Broading suspsend-timing to include non-stop clocksources that aren't currently used for timekeeping from Baolin Wang commit dbc3f77c2fea2875e4fd64e2dee57b9a2bda38e8 Author: Michael Ellerman Date: Wed Jul 11 17:10:17 2018 +1000 selftests/powerpc: Consolidate copy/paste test logic This logic was shared between multiple tests, but now that we have removed all but one of them we can just move it into that test. Signed-off-by: Michael Ellerman commit 525661ef8040e099d191f5f35defaed342e6859b Author: Michael Ellerman Date: Wed Jul 11 17:10:16 2018 +1000 selftests/powerpc: Remove Power9 paste tests Paste on POWER9 only works to accelerators and not on real memory. So these tests just generate a SIGILL. So just delete them. Signed-off-by: Michael Ellerman Acked-by: Michael Neuling Signed-off-by: Michael Ellerman commit 83039f22ba2f6aff935a2acbb6bf671374e8317d Author: Michael Ellerman Date: Wed Jul 11 17:10:15 2018 +1000 selftests/powerpc: Remove Power9 copy_unaligned test This is a test of the ISA 3.0 "copy" instruction. That instruction has an L field, which if set to 1 specifies that "the instruction identifies the beginning of a move group" (pp 858). That's also referred to as "copy first" vs "copy". In ISA 3.0B the copy instruction does not have an L field, and the corresponding bit in the instruction must be set to 1. This test is generating a "copy" instruction, not a "copy first", and so on Power9 (which implements 3.0B), this results in an illegal instruction. So just drop the test entirely. We still have copy_first_unaligned to test the "copy first" behaviour. Signed-off-by: Michael Ellerman Acked-by: Michael Neuling Signed-off-by: Michael Ellerman commit ec9336396a98f61290f45e8bb942458a1b2f299b Author: Murilo Opsfelder Araujo Date: Wed Jul 18 13:15:44 2018 -0300 powerpc/prom_init: Remove linux,stdout-package property This property was added in 2004 and the only use of it, which was already inside `#if 0`, was removed a month later. Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Michael Ellerman commit 48e91846865cd61bfdb701eb737de222d7f08c74 Author: Geoff Levand Date: Wed Jul 18 15:08:33 2018 -0700 powerpc/ps3: Set driver coherent_dma_mask Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices. Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine. Reported-by: Fredrik Noring Signed-off-by: Geoff Levand Acked-by: Greg Kroah-Hartman Acked-by: Alan Stern Signed-off-by: Michael Ellerman commit ef8e0ff97ae8168ffe1558a5726a8b348c8228a3 Merge: 294f96ae8aa5 ef821e3f14e8 Author: Dave Airlie Date: Fri Jul 20 12:29:23 2018 +1000 Merge tag 'drm-intel-next-2018-07-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-next On GEM side: - GuC related fixes (Chris, Michal) - GTT read-only pages support (Jon, Chris) - More selftests fixes (Chris) - More GPU reset improvements (Chris) - Flush caches after GGTT writes (Chris) - Handle recursive shrinker for vma->last_active allocation (Chris) - Other execlists fixes (Chris) On Display side: - GLK HDMI fix (Clint) - Rework and cleanup around HPD pin (Ville) - Preparation work for Display Stream Compression support coming on ICL (Anusha) - Nuke LVDS lid notification (Ville) - Assume eDP is always connected (Ville) - Kill intel panel detection (Ville) Signed-off-by: Dave Airlie # gpg: Signature made Fri 20 Jul 2018 01:51:45 AM AEST # gpg: using RSA key FA625F640EEB13CA # gpg: Good signature from "Rodrigo Vivi " # gpg: aka "Rodrigo Vivi " # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6D20 7068 EEDD 6509 1C2C E2A3 FA62 5F64 0EEB 13CA # Conflicts: # drivers/gpu/drm/i915/intel_lrc.c Link: https://patchwork.freedesktop.org/patch/msgid/20180719171257.GA12199@intel.com commit f4e34f2a5dd9c0db19baad3f015c3abd5f2e0343 Author: Xiang Chen Date: Wed Jul 18 22:14:33 2018 +0800 scsi: hisi_sas: Add SATA FIS check for v3 hw Add a check ERR bit of status to decide whether there is something wrong with initial register-D2H FIS. If error exist, PHY link reset the channel to restart OOB. Directly call work HISI_PHYE_LINK_RESET replacing disable_phy_vx_hw() and enable_phy_vx_hw(). Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 1c09b663168bb5fd8562234976b76115f2aebe91 Author: Xiaofei Tan Date: Wed Jul 18 22:14:32 2018 +0800 scsi: hisi_sas: add memory barrier in task delivery function In task start delivery function, we need to add a memory barrier to prevent re-ordering of reading memory by hardware. Because the slot data is set in task prepare function and it could be running in another CPU. This patch adds an memory barrier after s->ready is read in the task start delivery function, and uses WRITE_ONCE() in the places where s->ready is set to ensure that the compiler does not re-order. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 6cca51ee0aa2540d648ff8698c3889330d897f27 Author: Xiang Chen Date: Wed Jul 18 22:14:31 2018 +0800 scsi: hisi_sas: Tidy hisi_sas_task_prep() To decrease the usage of spinlock during delivery IO, relocate some code in hisi_sas_task_prep(). Also an invalid comment is removed. Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit e5ea48014adcb030b9d92743e87fbbcbbb2a1d70 Author: Xiaofei Tan Date: Wed Jul 18 22:14:30 2018 +0800 scsi: hisi_sas: Implement handlers of PCIe FLR for v3 hw This patch implements handlers of PCIe FLR for v3 hw, reset_prepare() and reset_done(). User can issue FLR through sysfs interface, as v3 hw support PCIe FLR. Then if we don't implement these two handlers, our SAS controller will not work after executing FLR. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit e8ce775e516957a8eb79890c4051796daa4c6f4b Author: Xiaofei Tan Date: Wed Jul 18 22:14:29 2018 +0800 scsi: hisi_sas: relocate some common code for v3 hw Much code of PM suspend function also exists in soft reset function. This is not concise. So, this patch relocates the common code of these two functions to a separate function. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 4522204ab218a8c1f4d3901276deb0a61e7ac9c0 Author: Xiaofei Tan Date: Wed Jul 18 22:14:28 2018 +0800 scsi: hisi_sas: tidy host controller reset function a bit This patch tidies host controller reset function by putting some code to two new functions, and exports these two functions out, so that they could be used by FLR feature to be realised. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 25908cac84b2ea18d4609fc237d6135d0037041d Author: Xiaofei Tan Date: Wed Jul 18 22:14:27 2018 +0800 scsi: hisi_sas: Fix the failure of recovering PHY from STP link timeout There is an issue that link reset can't recover PHY when STP link timeout. Because current process of enabling PHY for v3 hw will wait last transmission done. The time of one transmission depends IO size, disk model and so on. Normally, it should be shorter than 50ms. But the last transmission could be never done for some abnormal scenarios, such as STP link timeout. This patch is to fix the issue. Check PHY status after starting process of enabling PHY for 50ms. If the PHY is still active, we disable it forcibly by PHY reset. Of course, we need to clear the PHY reset bit when enable PHY. Besides, the function disable_phy_v3_hw() should not be suitable to call in interrupts for hilink bug for this 50ms delay. Then, we do link reset for hilink bug directly. The change is that we don't clear the invalid dword count register. This is better. Because we should not clear such error count while not saved. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit d9d51e0cf462cf12956cbc95b1fd55d90c7c9ac5 Author: Xiaofei Tan Date: Wed Jul 18 22:14:26 2018 +0800 scsi: hisi_sas: tidy channel interrupt handler for v3 hw The ISR of channel interrupt of v3 hw is a little long and messy. This patch tidies it by relocating CHL_INT1 and CHL_INT2 handling to new function separately. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 4e32b2f48427ea57743e4bdf9765076133b565ca Author: John Garry Date: Wed Jul 18 22:14:25 2018 +0800 scsi: hisi_sas: Drop hisi_sas_slot_abort() For some time now we have not used hisi_sas_slot_abort() to handle erroring slots, apart from in archaic v1 hw. As such, remove this function and associated code. For v1 hw, move error handling to same scheme as other hw revisions, where we allow erroring commands to timeout. Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit db67befa3d90e54e3dfd1b48926c0d833d9feea7 Author: Varun Prakash Date: Tue Jul 17 19:55:26 2018 +0530 scsi: csiostor: update ingress pack and pad boundary value T5/T6 can have different pack and pad boundary value. This patch sets packing boundary based on cache line size and PCI-E maximum payload size and sets smallest padding boundary value. Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen commit 7ee7ef24d02d1e3dfc33b30e4901be0a2b3847e8 Author: liwei Date: Tue Jul 17 17:36:59 2018 +0800 scsi: arm64: defconfig: enable configs for Hisilicon ufs Signed-off-by: Li Wei Signed-off-by: Zhangfei Gao Signed-off-by: Guodong Xu Tested-by: John Stultz Signed-off-by: Martin K. Petersen commit 360249d2ae5aa7dd31a81db2da5152f0b8bfae47 Author: liwei Date: Tue Jul 17 17:36:58 2018 +0800 scsi: arm64: dts: add ufs dts node arm64: dts: add ufs node for Hisilicon. Signed-off-by: Li Wei Reviewed-by: Rob Herring Tested-by: John Stultz Acked-by: Wei Xu Signed-off-by: Martin K. Petersen commit 8ee94ec065293f65f4f386f4cdfac92d32c3e71f Author: liwei Date: Tue Jul 17 17:36:57 2018 +0800 scsi: ufs: dt-bindings: add document for hisi-ufs add ufs node document for Hisilicon. Signed-off-by: Li Wei Reviewed-by: Rob Herring Tested-by: John Stultz Signed-off-by: Martin K. Petersen commit 8111b5e334861c4cd12e49e151e7e2f0e617d46a Author: liwei Date: Tue Jul 17 17:36:56 2018 +0800 scsi: ufs: add Hisilicon ufs driver code add Hisilicon ufs driver code. Signed-off-by: Li Wei Signed-off-by: Geng Jianfeng Signed-off-by: Zang Leigang Signed-off-by: Yu Jianfeng Tested-by: John Stultz Signed-off-by: Martin K. Petersen commit 294f96ae8aa53415272045649e3e7a1749cc0575 Merge: 090cbdd0735b 979c11ef39ce Author: Dave Airlie Date: Fri Jul 20 10:40:25 2018 +1000 Merge tag 'drm-misc-next-2018-07-18' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 4.19: Core Changes: - add support for DisplayPort CEC-Tunneling-over-AUX (Hans Verkuil) - more doc updates (Daniel Vetter) - fourcc: Add is_yuv field to drm_format_info (Ayan Kumar Halder) - dma-buf: correctly place BUG_ON (Michel Dänzer) Driver Changes: - more vkms support(Rodrigo Siqueira) - many fixes and small improments to all drivers Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180718200826.GA20165@juma commit 090cbdd0735b3752a9dd2e4008e585acd661c67d Merge: 539c475dadc4 d00ddd9da79a Author: Dave Airlie Date: Fri Jul 20 10:34:24 2018 +1000 Merge branch 'linux-4.19' of git://github.com/skeggsb/linux into drm-next misc fixes and cleanups for next. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv55CfRonQ0bo2XiitkCiWTjKwhsP=+ZFhoa-BaJ72Ryew@mail.gmail.com commit 39232ed5a1793f67b11430c43ed8a9ed6e96c6eb Author: Baolin Wang Date: Tue Jul 17 15:55:16 2018 +0800 time: Introduce one suspend clocksource to compensate the suspend time On some hardware with multiple clocksources, we have coarse grained clocksources that support the CLOCK_SOURCE_SUSPEND_NONSTOP flag, but which are less than ideal for timekeeping whereas other clocksources can be better candidates but halt on suspend. Currently, the timekeeping core only supports timing suspend using CLOCK_SOURCE_SUSPEND_NONSTOP clocksources if that clocksource is the current clocksource for timekeeping. As a result, some architectures try to implement read_persistent_clock64() using those non-stop clocksources, but isn't really ideal, which will introduce more duplicate code. To fix this, provide logic to allow a registered SUSPEND_NONSTOP clocksource, which isn't the current clocksource, to be used to calculate the suspend time. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Cc: Daniel Lezcano Reviewed-by: Thomas Gleixner Reviewed-by: Daniel Lezcano Suggested-by: Thomas Gleixner Signed-off-by: Baolin Wang [jstultz: minor tweaks to merge with previous resume changes] Signed-off-by: John Stultz commit f473e5f467f6049370575390b08dc42131315d60 Author: Mukesh Ojha Date: Tue Jul 17 12:01:29 2018 +0530 time: Fix extra sleeptime injection when suspend fails Currently, there exists a corner case assuming when there is only one clocksource e.g RTC, and system failed to go to suspend mode. While resume rtc_resume() injects the sleeptime as timekeeping_rtc_skipresume() returned 'false' (default value of sleeptime_injected) due to which we can see mismatch in timestamps. This issue can also come in a system where more than one clocksource are present and very first suspend fails. Success case: ------------ {sleeptime_injected=false} rtc_suspend() => timekeeping_suspend() => timekeeping_resume() => (sleeptime injected) rtc_resume() Failure case: ------------ {failure in sleep path} {sleeptime_injected=false} rtc_suspend() => rtc_resume() {sleeptime injected again which was not required as the suspend failed} Fix this by handling the boolean logic properly. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Originally-by: Thomas Gleixner Signed-off-by: Mukesh Ojha Signed-off-by: John Stultz commit 985e695074d35768cb04d65f58bca45f7bf1a99d Author: Ondrej Mosnacek Date: Fri Jul 13 14:06:42 2018 +0200 timekeeping/ntp: Constify some function arguments Add 'const' to some function arguments and variables to make it easier to read the code. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Signed-off-by: Ondrej Mosnacek [jstultz: Also fixup pre-existing checkpatch warnings for prototype arguments with no variable name] Signed-off-by: John Stultz commit f4585bc20fc785d94192cf780ee925e25891ddfd Author: Tyler Hicks Date: Fri Jul 6 05:25:01 2018 +0000 apparmor: Fully initialize aa_perms struct when answering userspace query Fully initialize the aa_perms struct in profile_query_cb() to avoid the potential of using an uninitialized struct member's value in a response to a query from userspace. Detected by CoverityScan CID#1415126 ("Uninitialized scalar variable") Fixes: 4f3b3f2d79a4 ("apparmor: add profile permission query ability") Signed-off-by: Tyler Hicks Acked-by: Serge Hallyn Signed-off-by: John Johansen commit 7f3ebcf2b1395e0248e56146041e1e5625fd2f23 Author: Tyler Hicks Date: Fri Jul 6 05:25:00 2018 +0000 apparmor: Check buffer bounds when mapping permissions mask Don't read past the end of the buffer containing permissions characters or write past the end of the destination string. Detected by CoverityScan CID#1415361, 1415376 ("Out-of-bounds access") Fixes: e53cfe6c7caa ("apparmor: rework perm mapping to a slightly broader set") Signed-off-by: Tyler Hicks Acked-by: Serge Hallyn Signed-off-by: John Johansen commit 97193702c6d353e12aefc0fb2f73a98ca421cd56 Author: Joerg Roedel Date: Wed Jul 18 11:41:16 2018 +0200 x86/entry/32: Add debug code to check entry/exit CR3 Add code to check whether the kernel is entered and left with the correct CR3 and make it depend on CONFIG_DEBUG_ENTRY. This is needed because there is no NX protection of user-addresses in the kernel-CR3 on x86-32 and that type of bug would not be detected otherwise. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-40-git-send-email-joro@8bytes.org commit 5e8105950a8b3e03e805299b4d05020ee4eda31a Author: Joerg Roedel Date: Wed Jul 18 11:41:15 2018 +0200 x86/mm/pti: Add Warning when booting on a PCID capable CPU Warn the user in case the performance can be significantly improved by switching to a 64-bit kernel. Suggested-by: Andy Lutomirski Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-39-git-send-email-joro@8bytes.org commit 7757d607c6b31867777de42e1fb0210b9c5d8b70 Author: Joerg Roedel Date: Wed Jul 18 11:41:14 2018 +0200 x86/pti: Allow CONFIG_PAGE_TABLE_ISOLATION for x86_32 Allow PTI to be compiled on x86_32. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-38-git-send-email-joro@8bytes.org commit 6df934b92a549cb3badb6d576f71aeb133e2f110 Author: Joerg Roedel Date: Wed Jul 18 11:41:13 2018 +0200 x86/ldt: Enable LDT user-mapping for PAE This adds the needed special case for PAE to get the LDT mapped into the user page-table when PTI is enabled. The big difference to the other paging modes is that on PAE there is no full top-level PGD entry available for the LDT, but only a PMD entry. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-37-git-send-email-joro@8bytes.org commit 9bae3197e15dd5e03ce8e237db6fe4486b08a775 Author: Joerg Roedel Date: Wed Jul 18 11:41:12 2018 +0200 x86/ldt: Split out sanity check in map_ldt_struct() This splits out the mapping sanity check and the actual mapping of the LDT to user-space from the map_ldt_struct() function in a way so that it is re-usable for PAE paging. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-36-git-send-email-joro@8bytes.org commit 8195d869d118bc30bf0be8d0c5d8849d6f58529b Author: Joerg Roedel Date: Wed Jul 18 11:41:11 2018 +0200 x86/ldt: Define LDT_END_ADDR It marks the end of the address-space range reserved for the LDT. The LDT-code will use it when unmapping the LDT for user-space. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-35-git-send-email-joro@8bytes.org commit f3e48e546c42e31c0c095a6f917a4ad64668608c Author: Joerg Roedel Date: Wed Jul 18 11:41:10 2018 +0200 x86/ldt: Reserve address-space range on 32 bit for the LDT Reserve 2MB/4MB of address-space for mapping the LDT to user-space on 32 bit PTI kernels. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-34-git-send-email-joro@8bytes.org commit f59dbe9ca6707eb7ffd0e24359085651c2d7df48 Author: Joerg Roedel Date: Wed Jul 18 11:41:09 2018 +0200 x86/pgtable/pae: Use separate kernel PMDs for user page-table When PTI is enabled, separate kernel PMDs in the user page-table are required to map the per-process LDT for user-space. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-33-git-send-email-joro@8bytes.org commit 4e8537e4a7a15402b87c424b22c25c9e59681d16 Author: Joerg Roedel Date: Wed Jul 18 11:41:08 2018 +0200 x86/mm/dump_pagetables: Define INIT_PGD Define INIT_PGD to point to the correct initial page-table for 32 and 64 bit and use it where needed. This fixes the build on 32 bit with CONFIG_PAGE_TABLE_ISOLATION enabled. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-32-git-send-email-joro@8bytes.org commit ba0364e260ab37c02975557dbecc014a26072236 Author: Joerg Roedel Date: Wed Jul 18 11:41:07 2018 +0200 x86/mm/pti: Clone entry-text again in pti_finalize() The mapping for entry-text might have changed in the kernel after it was cloned to the user page-table. Clone again to update the user page-table to bring the mapping in sync with the kernel again. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-31-git-send-email-joro@8bytes.org commit b976690f5db26fbc7c2be413bfa0fbd270547a94 Author: Joerg Roedel Date: Wed Jul 18 11:41:06 2018 +0200 x86/mm/pti: Introduce pti_finalize() Introduce a new function to finalize the kernel mappings for the userspace page-table after all ro/nx protections have been applied to the kernel mappings. Also move the call to pti_clone_kernel_text() to that function so that it will run on 32 bit kernels too. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-30-git-send-email-joro@8bytes.org commit 1ac228a7c87f697d1d01eb6362a6b5246705b0dd Author: Joerg Roedel Date: Wed Jul 18 11:41:05 2018 +0200 x86/mm/pti: Keep permissions when cloning kernel text in pti_clone_kernel_text() Mapping the kernel text area to user-space makes only sense if it has the same permissions as in the kernel page-table. If permissions are different this will cause a TLB reload when using the kernel page-table, which is as good as not mapping it at all. On 64-bit kernels this patch makes no difference, as the whole range cloned by pti_clone_kernel_text() is mapped RO anyway. On 32 bit there are writeable mappings in the range, so just keep the permissions as they are. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-29-git-send-email-joro@8bytes.org commit 39d668e04edad25abe184fb329ce35a131146ee5 Author: Joerg Roedel Date: Wed Jul 18 11:41:04 2018 +0200 x86/mm/pti: Make pti_clone_kernel_text() compile on 32 bit The pti_clone_kernel_text() function references __end_rodata_hpage_align, which is only present on x86-64. This makes sense as the end of the rodata section is not huge-page aligned on 32 bit. Nevertheless a symbol is required for the function that points at the right address for both 32 and 64 bit. Introduce __end_rodata_aligned for that purpose and use it in pti_clone_kernel_text(). Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-28-git-send-email-joro@8bytes.org commit f94560cd6b5117f8913f4c42f4d9a405c26ddc1c Author: Joerg Roedel Date: Wed Jul 18 11:41:03 2018 +0200 x86/mm/pti: Clone CPU_ENTRY_AREA on PMD level on x86_32 Cloning on the P4D level would clone the complete kernel address space into the user-space page-tables for PAE kernels. Cloning on PMD level is fine for PAE and legacy paging. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-27-git-send-email-joro@8bytes.org commit 2c1b9fbe83412598d2dccdd448147336b085e0c6 Author: Joerg Roedel Date: Wed Jul 18 11:41:02 2018 +0200 x86/mm/pti: Define X86_CR3_PTI_PCID_USER_BIT on x86_32 Move it out of the X86_64 specific processor defines so that its visible for 32bit too. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Reviewed-by: Andy Lutomirski Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-26-git-send-email-joro@8bytes.org commit 935232ce28dfabff1171e5a7113b2d865fa9ee63 Author: Joerg Roedel Date: Wed Jul 18 11:41:01 2018 +0200 x86/mm/pti: Add an overflow check to pti_clone_pmds() The addr counter will overflow if the last PMD of the address space is cloned, resulting in an endless loop. Check for that and bail out of the loop when it happens. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-25-git-send-email-joro@8bytes.org commit 1f40a46cf47c12d93a5ad9dccd82bd36ff8f956a Author: Joerg Roedel Date: Wed Jul 18 11:41:00 2018 +0200 x86/mm/legacy: Populate the user page-table with user pgd's Also populate the user-spage pgd's in the user page-table. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-24-git-send-email-joro@8bytes.org commit 9b7b8bbd7f6ba4ef7caa5a078ead70237e12d045 Author: Joerg Roedel Date: Wed Jul 18 11:40:59 2018 +0200 x86/mm/pae: Populate the user page-table with user pgd's When a PGD entry is populated, make sure to populate it in the user page-table too. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-23-git-send-email-joro@8bytes.org commit 6c0df8689494e1fefa685377676fa8192291a0eb Author: Joerg Roedel Date: Wed Jul 18 11:40:58 2018 +0200 x86/mm/pae: Populate valid user PGD entries Generic page-table code populates all non-leaf entries with _KERNPG_TABLE bits set. This is fine for all paging modes except PAE. In PAE mode only a subset of the bits is allowed to be set. Make sure to only set allowed bits by masking out the reserved bits. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-22-git-send-email-joro@8bytes.org commit 76e258add7b653b60037ee4b25ebc40da6a35c4a Author: Joerg Roedel Date: Wed Jul 18 11:40:57 2018 +0200 x86/pgtable: Move two more functions from pgtable_64.h to pgtable.h These two functions are required for PTI on 32 bit: * pgdp_maps_userspace() * pgd_large() Also re-implement pgdp_maps_userspace() so that it will work on 64 and 32 bit kernels. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-21-git-send-email-joro@8bytes.org commit fcbbd977572cfe5a3dcc97d663bf7480431a07ca Author: Joerg Roedel Date: Wed Jul 18 11:40:56 2018 +0200 x86/pgtable: Move pti_set_user_pgtbl() to pgtable.h There it is also usable from 32 bit code. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-20-git-send-email-joro@8bytes.org commit 8372d66865deb45ee3ec21401a9c80f231b728c8 Author: Joerg Roedel Date: Wed Jul 18 11:40:55 2018 +0200 x86/pgtable: Move pgdp kernel/user conversion functions to pgtable.h Make them available on 32 bit and clone_pgd_range() happy. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-19-git-send-email-joro@8bytes.org commit e3238faf20fb1b51a814497751398ab525a2c884 Author: Joerg Roedel Date: Wed Jul 18 11:40:54 2018 +0200 x86/pgtable/32: Allocate 8k page-tables when PTI is enabled Allocate a kernel and a user page-table root when PTI is enabled. Also allocate a full page per root for PAE because otherwise the bit to flip in CR3 to switch between them would be non-constant, which creates a lot of hassle. Keep that for a later optimization. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-18-git-send-email-joro@8bytes.org commit 7ffcf1497c8ab59a705bfafb7401876fd2f6f71e Author: Joerg Roedel Date: Wed Jul 18 11:40:53 2018 +0200 x86/pgtable/pae: Unshare kernel PMDs when PTI is enabled With PTI the per-process LDT must be mapped into the kernel address-space for each process, which requires separate kernel PMDs per PGD. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-17-git-send-email-joro@8bytes.org commit 23b772883d1ddcf7fdf883614b88b2a6205db4da Author: Joerg Roedel Date: Wed Jul 18 11:40:52 2018 +0200 x86/pgtable: Rename pti_set_user_pgd() to pti_set_user_pgtbl() The way page-table folding is implemented on 32 bit, these functions are not only setting, but also PUDs and even PMDs. Give the function a more generic name to reflect that. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-16-git-send-email-joro@8bytes.org commit 252e1a0526304f0f3f6888fc09e81cb220f957f3 Author: Joerg Roedel Date: Wed Jul 18 11:40:51 2018 +0200 x86/entry: Rename update_sp0 to update_task_stack The function does not update sp0 anymore but updates makes the task-stack visible for entry code. This is by either writing it to sp1 or by doing a hypercall. Rename the function to get rid of the misleading name. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-15-git-send-email-joro@8bytes.org commit b65bef400689ceee7108c2d47fb97ae91f4d1440 Author: Joerg Roedel Date: Wed Jul 18 11:40:50 2018 +0200 x86/entry/32: Add PTI CR3 switches to NMI handler code The NMI handler is special, as it needs to leave with the same CR3 as it was entered with. This is required because the NMI can happen within kernel context but with user CR3 already loaded, i.e. after switching to user CR3 but before returning to user space. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-14-git-send-email-joro@8bytes.org commit e464fb9f241ddf46815b31ca594af96f2699a78e Author: Joerg Roedel Date: Wed Jul 18 11:40:49 2018 +0200 x86/entry/32: Add PTI cr3 switch to non-NMI entry/exit points Add unconditional cr3 switches between user and kernel cr3 to all non-NMI entry and exit points. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-13-git-send-email-joro@8bytes.org commit 929b44eb5739bf11d4a9bce85d7346bd955fc24d Author: Joerg Roedel Date: Wed Jul 18 11:40:48 2018 +0200 x86/entry/32: Simplify debug entry point The common exception entry code now handles the entry-from-sysenter stack situation and makes sure to leave with the same stack as it entered the kernel. So there is no need anymore for the special handling in the debug entry code. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-12-git-send-email-joro@8bytes.org commit b92a165df17ee6e616e43107730f06bf6ecf5d8d Author: Joerg Roedel Date: Wed Jul 18 11:40:47 2018 +0200 x86/entry/32: Handle Entry from Kernel-Mode on Entry-Stack It is possible that the kernel is entered from kernel-mode and on the entry-stack. The most common way this happens is when an exception is triggered while loading the user-space segment registers on the kernel-to-userspace exit path. The segment loading needs to be done after the entry-stack switch, because the stack-switch needs kernel %fs for per_cpu access. When this happens, make sure to leave the kernel with the entry-stack again, so that the interrupted code-path runs on the right stack when switching to the user-cr3. Detect this condition on kernel-entry by checking CS.RPL and %esp, and if it happens, copy over the complete content of the entry stack to the task-stack. This needs to be done because once the exception handler is entereed, the task might be scheduled out or even migrated to a different CPU, so this cannot rely on the entry-stack contents. Leave a marker in the stack-frame to detect this condition on the exit path. On the exit path the copy is reversed, copy all of the remaining task-stack back to the entry-stack and switch to it. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-11-git-send-email-joro@8bytes.org commit 8b376fae0514dc7ee04786e2327169e39d12e51b Author: Joerg Roedel Date: Wed Jul 18 11:40:46 2018 +0200 x86/entry/32: Introduce SAVE_ALL_NMI and RESTORE_ALL_NMI These macros will be used in the NMI handler code and replace plain SAVE_ALL and RESTORE_REGS there. The NMI-specific CR3-switch will be added to these macros later. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-10-git-send-email-joro@8bytes.org commit e5862d0515ad970ccec6208ecf5bb0cffe291ea3 Author: Joerg Roedel Date: Wed Jul 18 11:40:45 2018 +0200 x86/entry/32: Leave the kernel via trampoline stack Switch back to the trampoline stack before returning to userspace. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-9-git-send-email-joro@8bytes.org commit 45d7b255747c21fc4b1f5043bee0754d39c3bdbf Author: Joerg Roedel Date: Wed Jul 18 11:40:44 2018 +0200 x86/entry/32: Enter the kernel via trampoline stack Use the entry-stack as a trampoline to enter the kernel. The entry-stack is already in the cpu_entry_area and will be mapped to userspace when PTI is enabled. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-8-git-send-email-joro@8bytes.org commit 0d2eb73b29996684d5bbb72f85c74b47b4c359f7 Author: Joerg Roedel Date: Wed Jul 18 11:40:43 2018 +0200 x86/entry/32: Split off return-to-kernel path Use a separate return path when returning to the kernel. This allows to put the PTI cr3-switch and the switch to the entry-stack into the return-to-user path without further checking. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-7-git-send-email-joro@8bytes.org commit 8e676ced31e9d1448d3ffc4159586a259cc67f30 Author: Joerg Roedel Date: Wed Jul 18 11:40:42 2018 +0200 x86/entry/32: Unshare NMI return path NMI will no longer use most of the shared return path, because NMI needs special handling when the CR3 switches for PTI are added. Prepare for that change. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-6-git-send-email-joro@8bytes.org commit 46eabca284f9f27fe94698a068a4a21ba93b4975 Author: Joerg Roedel Date: Wed Jul 18 11:40:41 2018 +0200 x86/entry/32: Put ESPFIX code into a macro This makes it easier to split up the shared iret code path. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-5-git-send-email-joro@8bytes.org commit a6b744f3ce9d017dd86b28355de2d8e0d36496d4 Author: Joerg Roedel Date: Wed Jul 18 11:40:40 2018 +0200 x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler x86_tss.sp0 will be used to point to the entry stack later to use it as a trampoline stack for other kernel entry points besides SYSENTER. So store the real task stack pointer in x86_tss.sp1, which is otherwise unused by the hardware, as Linux doesn't make use of Ring 1. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-4-git-send-email-joro@8bytes.org commit ae2e565bc6aaee3f3db420fec5fdd39755c9813e Author: Joerg Roedel Date: Wed Jul 18 11:40:39 2018 +0200 x86/entry/32: Rename TSS_sysenter_sp0 to TSS_entry2task_stack The stack address doesn't need to be stored in tss.sp0 if the stack is switched manually like on sysenter. Rename the offset so that it still makes sense when its location is changed in later patches. This stackk will also be used for all kernel-entry points, not just sysenter. Reflect that and the fact that it is the offset to the task-stack location in the name as well. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-3-git-send-email-joro@8bytes.org commit 9e97b73fdb235345a826519862a52a7398c89eb8 Author: Joerg Roedel Date: Wed Jul 18 11:40:38 2018 +0200 x86/asm-offsets: Move TSS_sp0 and TSS_sp1 to asm-offsets.c These offsets will be used in 32 bit assembly code as well, so make them available for all of x86 code. Signed-off-by: Joerg Roedel Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Reviewed-by: Andy Lutomirski Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-2-git-send-email-joro@8bytes.org commit c6a44ba950d147e15fe6dab6455a52f91d8fe625 Author: Sinan Kaya Date: Thu Jul 19 18:04:15 2018 -0500 PCI: Rename pci_try_reset_bus() to pci_reset_bus() Now that the old implementation of pci_reset_bus() is gone, replace pci_try_reset_bus() with pci_reset_bus(). Compared to the old implementation, new code will fail immmediately with -EAGAIN if object lock cannot be obtained. Signed-off-by: Sinan Kaya Signed-off-by: Bjorn Helgaas commit fe32e2fa656c29d5d25f959f8e6168ac405d9ab4 Author: Sinan Kaya Date: Thu Jul 19 18:04:14 2018 -0500 PCI: Deprecate pci_reset_bus() and pci_reset_slot() functions pci_reset_bus() and pci_reset_slot() functions are not being used by any code. Remove them from the kernel in favor of pci_try_reset_bus() and pci_try_reset_slot() functions. Signed-off-by: Sinan Kaya Signed-off-by: Bjorn Helgaas commit 811c5cb37df46b0cd714dbd053d19cdb97d08cff Author: Sinan Kaya Date: Thu Jul 19 18:04:12 2018 -0500 PCI: Unify try slot and bus reset API Drivers are expected to call pci_try_reset_slot() or pci_try_reset_bus() by querying if a system supports hotplug or not. A survey showed that most drivers don't do this and we are leaking hotplug capability to the user. Hide pci_try_slot_reset() from drivers and embed into pci_try_bus_reset(). Change pci_try_reset_bus() parameter from struct pci_bus to struct pci_dev. Signed-off-by: Sinan Kaya Signed-off-by: Bjorn Helgaas commit 381634cad15b711e033a2638d558232b60f753f6 Author: Sinan Kaya Date: Thu Jul 19 18:04:11 2018 -0500 PCI: Hide pci_reset_bridge_secondary_bus() from drivers Rename pci_reset_bridge_secondary_bus() to pci_bridge_secondary_bus_reset() and move the declaration from linux/pci.h to drivers/pci.h to be used internally in PCI directory only. Signed-off-by: Sinan Kaya Signed-off-by: Bjorn Helgaas commit 409888e0966e2753f8e272b89806738469c47e1d Author: Sinan Kaya Date: Thu Jul 19 18:04:10 2018 -0500 IB/hfi1: Use pci_try_reset_bus() for initiating PCI Secondary Bus Reset Getting ready to hide pci_reset_bridge_secondary_bus() from the drivers. pci_reset_bridge_secondary_bus() should only be used internally by the PCI code itself. Other drivers should rely on higher level pci_try_reset_bus() API. Signed-off-by: Sinan Kaya Signed-off-by: Bjorn Helgaas commit 1842623850d09b0b1147d4974573aa305658d97f Author: Sinan Kaya Date: Thu Jul 19 18:04:09 2018 -0500 PCI: Handle error return from pci_reset_bridge_secondary_bus() Commit 01fd61c0b9bd ("PCI: Add a return type for pci_reset_bridge_secondary_bus()") added a return value to the function to return if a device is accessible following a reset. Callers are not checking the value. Pass error code up high in the stack if device is not accessible. Fixes: 01fd61c0b9bd ("PCI: Add a return type for pci_reset_bridge_secondary_bus()") Signed-off-by: Sinan Kaya Signed-off-by: Bjorn Helgaas commit 1949f9f49792d65dba2090edddbe36a5f02e3ba3 Author: Tony Luck Date: Thu Jul 19 13:49:58 2018 -0700 Documentation/l1tf: Fix typos Fix spelling and other typos Signed-off-by: Tony Luck Signed-off-by: Thomas Gleixner commit 8dbe438589f373544a1af8b4a859e4da853c0f90 Author: Pavel Tatashin Date: Thu Jul 19 16:55:45 2018 -0400 x86/tsc: Make use of tsc_calibrate_cpu_early() During early boot enable tsc_calibrate_cpu_early() and switch to tsc_calibrate_cpu() only later. Do this unconditionally, because it is unknown what methods other cpus will use to calibrate once they are onlined. If by the time tsc_init() is called tsc frequency is still unknown do only pit_hpet_ptimer_calibrate_cpu() to calibrate, as this function contains the only methods wich have not been called and tried earlier. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-27-pasha.tatashin@oracle.com commit 03821f451d2d2d7599061244734245be139014ea Author: Pavel Tatashin Date: Thu Jul 19 16:55:44 2018 -0400 x86/tsc: Split native_calibrate_cpu() into early and late parts During early boot TSC and CPU frequency can be calibrated using MSR, CPUID, and quick PIT calibration methods. The other methods PIT/HPET/PMTIMER are available only after ACPI is initialized. Split native_calibrate_cpu() into early and late parts so they can be called separately during early and late tsc calibration. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-26-pasha.tatashin@oracle.com commit 46457ea464f5341d1f9dad8dd213805d45f7f117 Author: Pavel Tatashin Date: Thu Jul 19 16:55:43 2018 -0400 sched/clock: Use static key for sched_clock_running sched_clock_running may be read every time sched_clock_cpu() is called. Yet, this variable is updated only twice during boot, and never changes again, therefore it is better to make it a static key. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-25-pasha.tatashin@oracle.com commit 857baa87b6422bcfb84ed3631d6839920cb5b09d Author: Pavel Tatashin Date: Thu Jul 19 16:55:42 2018 -0400 sched/clock: Enable sched clock early Allow sched_clock() to be used before schec_clock_init() is called. This provides a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-24-pasha.tatashin@oracle.com commit 5d2a4e91a541cb04d20d11602f0f9340291322ac Author: Pavel Tatashin Date: Thu Jul 19 16:55:41 2018 -0400 sched/clock: Move sched clock initialization and merge with generic clock sched_clock_postinit() initializes a generic clock on systems where no other clock is provided. This function may be called only after timekeeping_init(). Rename sched_clock_postinit to generic_clock_inti() and call it from sched_clock_init(). Move the call for sched_clock_init() until after time_init(). Suggested-by: Peter Zijlstra Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-23-pasha.tatashin@oracle.com commit 4763f03d3d186ce8a1125844790152d76804ad60 Author: Pavel Tatashin Date: Thu Jul 19 16:55:40 2018 -0400 x86/tsc: Use TSC as sched clock early All prerequesites for enabling TSC as sched clock early in the boot process are available now: - Early attempt of TSC calibration - Early availablity of static branch patching If TSC frequency can be established in the early calibration, enable the static key which switches sched clock to use TSC. [ tglx: Massaged changelog ] Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-22-pasha.tatashin@oracle.com commit e2a9ca29b5edc89da2fddeae30e1070b272395c5 Author: Pavel Tatashin Date: Thu Jul 19 16:55:39 2018 -0400 x86/tsc: Initialize cyc2ns when tsc frequency is determined cyc2ns converts tsc to nanoseconds, and it is handled in a per-cpu data structure. Currently, the setup code for c2ns data for every possible CPU goes through the same sequence of calculations as for the boot CPU, but is based on the same tsc frequency as the boot CPU, and thus this is not necessary. Initialize the boot cpu when tsc frequency is determined. Copy the calculated data from the boot CPU to the other CPUs in tsc_init(). In addition do the following: - Remove unnecessary zeroing of c2ns data by removing cyc2ns_data_init() - Split set_cyc2ns_scale() into two functions, so set_cyc2ns_scale() can be called when system is up, and wraps around __set_cyc2ns_scale() that can be called directly when system is booting but avoids saving restoring IRQs and going and waking up from idle. Suggested-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-21-pasha.tatashin@oracle.com commit cf7a63ef4e0203f6f33284c69e8188d91422de83 Author: Pavel Tatashin Date: Thu Jul 19 16:55:38 2018 -0400 x86/tsc: Calibrate tsc only once During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), and the second time in tsc_init(). Rename tsc_early_delay_calibrate() to tsc_early_init(), and rework it so the calibration is done only early, and make tsc_init() to use the values already determined in tsc_early_init(). Sometimes it is not possible to determine tsc early, as the subsystem that is required is not yet initialized, in such case try again later in tsc_init(). Suggested-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-20-pasha.tatashin@oracle.com commit 227e3958a780499b3ec41c36d4752ac4f4962874 Author: Pavel Tatashin Date: Thu Jul 19 16:55:37 2018 -0400 ARM/time: Remove read_boot_clock64() read_boot_clock64() is deleted, and replaced with read_persistent_wall_and_boot_offset(). The default implementation of read_persistent_wall_and_boot_offset() provides a better fallback than the current stubs for read_boot_clock64() that arm has with no users, so remove the old code. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-19-pasha.tatashin@oracle.com commit 00067a6db2e95f3b9d9a017b3be3c715d54cc0de Author: Pavel Tatashin Date: Thu Jul 19 16:55:36 2018 -0400 s390/time: Remove read_boot_clock64() read_boot_clock64() was replaced by read_persistent_wall_and_boot_offset() so remove it. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-18-pasha.tatashin@oracle.com commit 4b1b7f8054896cee25669f6cea7cb6dd17f508f7 Author: Pavel Tatashin Date: Thu Jul 19 16:55:35 2018 -0400 timekeeping: Default boot time offset to local_clock() read_persistent_wall_and_boot_offset() is called during boot to read both the persistent clock and also return the offset between the boot time and the value of persistent clock. Change the default boot_offset from zero to local_clock() so architectures, that do not have a dedicated boot_clock but have early sched_clock(), such as SPARCv9, x86, and possibly more will benefit from this change by getting a better and more consistent estimate of the boot time without need for an arch specific implementation. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-17-pasha.tatashin@oracle.com commit 3eca993740b8eb40f514b90b1877a4dbcf0a6710 Author: Pavel Tatashin Date: Thu Jul 19 16:55:34 2018 -0400 timekeeping: Replace read_boot_clock64() with read_persistent_wall_and_boot_offset() If architecture does not support exact boot time, it is challenging to estimate boot time without having a reference to the current persistent clock value. Yet, it cannot read the persistent clock time again, because this may lead to math discrepancies with the caller of read_boot_clock64() who have read the persistent clock at a different time. This is why it is better to provide two values simultaneously: the persistent clock value, and the boot time. Replace read_boot_clock64() with: read_persistent_wall_and_boot_offset(wall_time, boot_offset) Where wall_time is returned by read_persistent_clock() And boot_offset is wall_time - boot time, which defaults to 0. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-16-pasha.tatashin@oracle.com commit be2e0e4257678408b0ab00ea9e743b9094e393e8 Author: Pavel Tatashin Date: Thu Jul 19 16:55:33 2018 -0400 s390/time: Add read_persistent_wall_and_boot_offset() read_persistent_wall_and_boot_offset() will replace read_boot_clock64() because on some architectures it is more convenient to read both sources as one may depend on the other. For s390, implementation is the same as read_boot_clock64() but also calling and returning value of read_persistent_clock64() Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Reviewed-by: Martin Schwidefsky Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-15-pasha.tatashin@oracle.com commit 38669ba205d178d2d38bfd194a196d65a44d5af2 Author: Pavel Tatashin Date: Thu Jul 19 16:55:32 2018 -0400 x86/xen/time: Output xen sched_clock time from 0 It is expected for sched_clock() to output data from 0, when system boots. Add an offset xen_sched_clock_offset (similarly how it is done in other hypervisors i.e. kvm_sched_clock_offset) to count sched_clock() from 0, when time is first initialized. Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-14-pasha.tatashin@oracle.com commit 7b25b9cb0dad8395b5cf5a02196d0e88ccda67d5 Author: Pavel Tatashin Date: Thu Jul 19 16:55:31 2018 -0400 x86/xen/time: Initialize pv xen time in init_hypervisor_platform() In every hypervisor except for xen pv time ops are initialized in init_hypervisor_platform(). Xen PV domains initialize time ops in x86_init.paging.pagetable_init(), by calling xen_setup_shared_info() which is a poor design, as time is needed prior to memory allocator. xen_setup_shared_info() is called from two places: during boot, and after suspend. Split the content of xen_setup_shared_info() into three places: 1. add the clock relavent data into new xen pv init_platform vector, and set clock ops in there. 2. move xen_setup_vcpu_info_placement() to new xen_pv_guest_late_init() call. 3. Re-initializing parts of shared info copy to xen_pv_post_suspend() to be symmetric to xen_pv_pre_suspend Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-13-pasha.tatashin@oracle.com commit fe9af81e524e8a86bdd59c0cc0d9e2b0ccaf840f Author: Pavel Tatashin Date: Thu Jul 19 16:55:30 2018 -0400 x86/tsc: Redefine notsc to behave as tsc=unstable Currently, the notsc kernel parameter disables the use of the TSC by sched_clock(). However, this parameter does not prevent the kernel from accessing tsc in other places. The only rationale to boot with notsc is to avoid timing discrepancies on multi-socket systems where TSC are not properly synchronized, and thus exclude TSC from being used for time keeping. But that prevents using TSC as sched_clock() as well, which is not necessary as the core sched_clock() implementation can handle non synchronized TSC based sched clocks just fine. However, there is another method to solve the above problem: booting with tsc=unstable parameter. This parameter allows sched_clock() to use TSC and just excludes it from timekeeping. So there is no real reason to keep notsc, but for compatibility reasons the parameter has to stay. Make it behave like 'tsc=unstable' instead. [ tglx: Massaged changelog ] Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Reviewed-by: Dou Liyang Reviewed-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-12-pasha.tatashin@oracle.com commit 9b3661cd7e5400689ed168a7275e75af333177e6 Author: Borislav Petkov Date: Thu Jul 19 16:55:29 2018 -0400 x86/CPU: Call detect_nopl() only on the BSP Make it use the setup_* variants and have it be called only on the BSP and drop the call in generic_identify() - X86_FEATURE_NOPL will be replicated to the APs through the forced caps. Helps to keep the mess at a manageable level. Signed-off-by: Borislav Petkov Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-11-pasha.tatashin@oracle.com commit 8990cac6e5ea7fa57607736019fe8dca961b998f Author: Pavel Tatashin Date: Thu Jul 19 16:55:28 2018 -0400 x86/jump_label: Initialize static branching early Static branching is useful to runtime patch branches that are used in hot path, but are infrequently changed. The x86 clock framework is one example that uses static branches to setup the best clock during boot and never changes it again. It is desired to enable the TSC based sched clock early to allow fine grained boot time analysis early on. That requires the static branching functionality to be functional early as well. Static branching requires patching nop instructions, thus, arch_init_ideal_nops() must be called prior to jump_label_init(). Do all the necessary steps to call arch_init_ideal_nops() right after early_cpu_init(), which also allows to insert a call to jump_label_init() right after that. jump_label_init() will be called again from the generic init code, but the code is protected against reinitialization already. [ tglx: Massaged changelog ] Suggested-by: Peter Zijlstra Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-10-pasha.tatashin@oracle.com commit 6fffacb30349e0903602d664f7ab6fc87e85162e Author: Pavel Tatashin Date: Thu Jul 19 16:55:27 2018 -0400 x86/alternatives, jumplabel: Use text_poke_early() before mm_init() It supposed to be safe to modify static branches after jump_label_init(). But, because static key modifying code eventually calls text_poke() it can end up accessing a struct page which has not been initialized yet. Here is how to quickly reproduce the problem. Insert code like this into init/main.c: | +static DEFINE_STATIC_KEY_FALSE(__test); | asmlinkage __visible void __init start_kernel(void) | { | char *command_line; |@@ -587,6 +609,10 @@ asmlinkage __visible void __init start_kernel(void) | vfs_caches_init_early(); | sort_main_extable(); | trap_init(); |+ { |+ static_branch_enable(&__test); |+ WARN_ON(!static_branch_likely(&__test)); |+ } | mm_init(); The following warnings show-up: WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:701 text_poke+0x20d/0x230 RIP: 0010:text_poke+0x20d/0x230 Call Trace: ? text_poke_bp+0x50/0xda ? arch_jump_label_transform+0x89/0xe0 ? __jump_label_update+0x78/0xb0 ? static_key_enable_cpuslocked+0x4d/0x80 ? static_key_enable+0x11/0x20 ? start_kernel+0x23e/0x4c8 ? secondary_startup_64+0xa5/0xb0 ---[ end trace abdc99c031b8a90a ]--- If the code above is moved after mm_init(), no warning is shown, as struct pages are initialized during handover from memblock. Use text_poke_early() in static branching until early boot IRQs are enabled and from there switch to text_poke. Also, ensure text_poke() is never invoked when unitialized memory access may happen by using adding a !after_bootmem assertion. Signed-off-by: Pavel Tatashin Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-9-pasha.tatashin@oracle.com commit 95a3d4454bb1cf5bfd666c27fdd2dc188e17c14d Author: Thomas Gleixner Date: Thu Jul 19 16:55:26 2018 -0400 x86/kvmclock: Switch kvmclock data to a PER_CPU variable The previous removal of the memblock dependency from kvmclock introduced a static data array sized 64bytes * CONFIG_NR_CPUS. That's wasteful on large systems when kvmclock is not used. Replace it with: - A static page sized array of pvclock data. It's page sized because the pvclock data of the boot cpu is mapped into the VDSO so otherwise random other data would be exposed to the vDSO - A PER_CPU variable of pvclock data pointers. This is used to access the pcvlock data storage on each CPU. The setup is done in two stages: - Early boot stores the pointer to the static page for the boot CPU in the per cpu data. - In the preparatory stage of CPU hotplug assign either an element of the static array (when the CPU number is in that range) or allocate memory and initialize the per cpu pointer. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Link: https://lkml.kernel.org/r/20180719205545.16512-8-pasha.tatashin@oracle.com commit e499a9b6dc488aff7f284bee51936f510ab7ad15 Author: Thomas Gleixner Date: Thu Jul 19 16:55:25 2018 -0400 x86/kvmclock: Move kvmclock vsyscall param and init to kvmclock There is no point to have this in the kvm code itself and call it from there. This can be called from an initcall and the parameter is cleared when the hypervisor is not KVM. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Link: https://lkml.kernel.org/r/20180719205545.16512-7-pasha.tatashin@oracle.com commit 42f8df935efefba51d0c5321b1325436523e3377 Author: Thomas Gleixner Date: Thu Jul 19 16:55:24 2018 -0400 x86/kvmclock: Mark variables __initdata and __ro_after_init The kvmclock parameter is init data and the other variables are not modified after init. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Link: https://lkml.kernel.org/r/20180719205545.16512-6-pasha.tatashin@oracle.com commit 146c394d0c3c8e88df433a179c2b0b85fd8cf247 Author: Thomas Gleixner Date: Thu Jul 19 16:55:23 2018 -0400 x86/kvmclock: Cleanup the code - Cleanup the mrs write for wall clock. The type casts to (int) are sloppy because the wrmsr parameters are u32 and aside of that wrmsrl() already provides the high/low split for free. - Remove the pointless get_cpu()/put_cpu() dance from various functions. Either they are called during early init where CPU is guaranteed to be 0 or they are already called from non preemptible context where smp_processor_id() can be used safely - Simplify the convoluted check for kvmclock in the init function. - Mark the parameter parsing function __init. No point in keeping it around. - Convert to pr_info() Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Link: https://lkml.kernel.org/r/20180719205545.16512-5-pasha.tatashin@oracle.com commit 7a5ddc8fe0ea9518cd7fb6a929cac7d864c6f300 Author: Thomas Gleixner Date: Thu Jul 19 16:55:22 2018 -0400 x86/kvmclock: Decrapify kvm_register_clock() The return value is pointless because the wrmsr cannot fail if KVM_FEATURE_CLOCKSOURCE or KVM_FEATURE_CLOCKSOURCE2 are set. kvm_register_clock() is only called locally so wants to be static. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Link: https://lkml.kernel.org/r/20180719205545.16512-4-pasha.tatashin@oracle.com commit 7ef363a39514ed8a6f2333fbae1875ac0953715a Author: Thomas Gleixner Date: Thu Jul 19 16:55:21 2018 -0400 x86/kvmclock: Remove page size requirement from wall_clock There is no requirement for wall_clock data to be page aligned or page sized. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Link: https://lkml.kernel.org/r/20180719205545.16512-3-pasha.tatashin@oracle.com commit 368a540e0232ad446931f5a4e8a5e06f69f21343 Author: Pavel Tatashin Date: Thu Jul 19 16:55:20 2018 -0400 x86/kvmclock: Remove memblock dependency KVM clock is initialized later compared to other hypervisor clocks because it has a dependency on the memblock allocator. Bring it in line with other hypervisors by using memory from the BSS instead of allocating it. The benefits: - Remove ifdef from common code - Earlier availability of the clock - Remove dependency on memblock, and reduce code The downside: - Static allocation of the per cpu data structures sized NR_CPUS * 64byte Will be addressed in follow up patches. [ tglx: Split out from larger series ] Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Acked-by: Paolo Bonzini Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Link: https://lkml.kernel.org/r/20180719205545.16512-2-pasha.tatashin@oracle.com commit 86b2dcd4f02b86f6b5927fc0adcac777825f4030 Author: Ondrej Mosnacek Date: Fri Jul 13 14:06:41 2018 +0200 ntp: Use kstrtos64 for s64 variable ...instead of kstrtol with a dirty cast. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Signed-off-by: Ondrej Mosnacek Signed-off-by: John Stultz commit 0f9987b63dcc68606b82a349bbb2016b392a2c34 Author: Ondrej Mosnacek Date: Fri Jul 13 14:06:40 2018 +0200 ntp: Remove redundant arguments The 'ts' argument of process_adj_status() and process_adjtimex_modes() is unused and can be safely removed. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Signed-off-by: Ondrej Mosnacek Signed-off-by: John Stultz commit 51259d0022f1965047bb61662f6f0d5a79a6ddb3 Author: Bjorn Helgaas Date: Fri May 25 08:51:50 2018 -0500 PCI/IOV: Tidy pci_sriov_set_totalvfs() Fix minor style issues in pci_sriov_set_totalvfs(). No functional change intended. Signed-off-by: Bjorn Helgaas commit f2df5da66262f429cbb0d5da0e72ada6a6345f28 Author: Al Viro Date: Thu Jul 19 17:35:51 2018 -0400 fold generic_readlink() into its only caller Signed-off-by: Al Viro commit e77b8216a2f9bec430ec46c34763567329ddafd9 Author: Keith Busch Date: Mon Jul 16 17:05:07 2018 -0500 PCI/DPC: Remove indirection waiting for inactive link Simplify waiting for the contained link to become inactive, removing the indirection to a unnecessary DPC-specific handler. Signed-off-by: Keith Busch Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Oza Pawandeep commit 738c4e411dadbe341f80f30d56518b68ae1e605f Author: Keith Busch Date: Mon Jul 16 17:05:06 2018 -0500 PCI/DPC: Use threaded IRQ for bottom half handling Remove the work struct that was being used to handle a DPC event and use a threaded IRQ instead. Signed-off-by: Keith Busch Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Oza Pawandeep commit 8aefa9b0d9105d70eb8799d2b4feffd784e22bae Author: Keith Busch Date: Mon Jul 16 17:05:05 2018 -0500 PCI/DPC: Print AER status in DPC event handling A DPC enabled device suppresses ERR_(NON)FATAL messages, preventing the AER handler from reporting error details. If the DPC trigger reason says the downstream port detected the error, collect the AER uncorrectable status for logging, then clear the status. Signed-off-by: Keith Busch Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Oza Pawandeep commit f1d16b17568e46f61cc59e2d0725b0fca856a34f Author: Keith Busch Date: Mon Jul 16 17:05:03 2018 -0500 PCI/DPC: Remove rp_pio_status from dpc struct We don't need to save the rp pio status across multiple contexts as all DPC event handling occurs in a single work queue context. Signed-off-by: Keith Busch Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Oza Pawandeep commit 0c27e28f77179548aa3d25a8f7a3dda22fd3e080 Author: Keith Busch Date: Mon Jul 16 17:05:02 2018 -0500 PCI/DPC: Defer event handling to work queue Move all event handling to the existing work queue, which will make it simpler to pass event information to the handler. Signed-off-by: Keith Busch Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Oza Pawandeep commit f8d46c89c86fa11c60c05e101a3a4c7458623103 Author: Keith Busch Date: Wed Jun 20 15:38:27 2018 -0600 PCI/DPC: Leave interrupts enabled while handling event Now that the DPC driver clears the interrupt status before exiting the IRQ handler, we don't need to abuse the DPC control register to know if a shared interrupt is for a new DPC event: a DPC port can not trigger a second interrupt until the host clears the trigger status later in the work queue handler. Signed-off-by: Keith Busch Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Oza Pawandeep commit 7af02fcd84c16801958936f88b848944c726ca07 Author: Alexandru Gagniuc Date: Tue Jul 3 18:27:43 2018 -0500 PCI/AER: Honor "pcie_ports=native" even if HEST sets FIRMWARE_FIRST According to the documentation, "pcie_ports=native", linux should use native AER and DPC services. While that is true for the _OSC method parsing, this is not the only place that is checked. Should the HEST list PCIe ports as firmware-first, linux will not use native services. This happens because aer_acpi_firmware_first() doesn't take 'pcie_ports' into account. This is wrong. DPC uses the same logic when it decides whether to load or not, so fixing this also fixes DPC not loading. Signed-off-by: Alexandru Gagniuc [bhelgaas: return "false" from bool function (from kbuild robot)] Signed-off-by: Bjorn Helgaas commit 12833017e581c384afa35fb85ce540082b2d59fc Author: Rajat Jain Date: Thu Jun 21 16:48:29 2018 -0700 PCI/AER: Add sysfs attributes for rootport cumulative stats Add sysfs attributes for rootport statistics (that are cumulative of all the ERR_* messages seen on this PCI hierarchy). Signed-off-by: Rajat Jain Signed-off-by: Bjorn Helgaas commit 81aa5206f9a7c9793e2f7971400351664e40b04f Author: Rajat Jain Date: Thu Jun 21 16:48:28 2018 -0700 PCI/AER: Add sysfs attributes to provide AER stats and breakdown Add sysfs attributes to provide total and breakdown of the AERs seen, into different type of correctable, fatal and nonfatal errors: /sys/bus/pci/devices//aer_dev_correctable /sys/bus/pci/devices//aer_dev_fatal /sys/bus/pci/devices//aer_dev_nonfatal Signed-off-by: Rajat Jain Signed-off-by: Bjorn Helgaas commit db89ccbe52c7885644ba578c7771e57620f879b1 Author: Rajat Jain Date: Sat Jun 30 15:07:17 2018 -0500 PCI/AER: Define aer_stats structure for AER capable devices Define a structure to hold the AER statistics. There are 2 groups of statistics: dev_* counters that are to be collected for all AER capable devices and rootport_* counters that are collected for all (AER capable) rootports only. Allocate and free this structure when device is added or released (thus counters survive the lifetime of the device). Signed-off-by: Rajat Jain Signed-off-by: Bjorn Helgaas commit 60ed982a4e78ff938824a750dbac8a10e5b472ef Author: Rajat Jain Date: Thu Jun 21 16:48:26 2018 -0700 PCI/AER: Move internal declarations to drivers/pci/pci.h Since pci_aer_init() and pci_no_aer() are used only internally, move their declarations to the PCI internal header file. Also, no one cares about return value of pci_aer_init(), so make it void. Signed-off-by: Rajat Jain Signed-off-by: Bjorn Helgaas commit bd237801fef230cea8f2a5ab550d500f19f856d8 Author: Tyler Baicar Date: Tue Jun 26 11:44:15 2018 -0400 PCI/AER: Adopt lspci names for AER error decoding lspci uses abbreviated naming for AER error strings. Adopt the same naming convention for the AER printing so they match. Signed-off-by: Tyler Baicar Signed-off-by: Bjorn Helgaas Reviewed-by: Oza Pawandeep commit 1e4511604dfaf6d1642603ff89effb9e93682716 Author: Keith Busch Date: Thu Jul 19 16:16:55 2018 -0500 PCI/AER: Expose internal API for obtaining AER information Export some common AER functions and structures for other PCI core drivers to use. Since this is making the function externally visible inside the PCI core, prepend "aer_" to the function name. Signed-off-by: Keith Busch [bhelgaas: move AER declarations from linux/aer.h to drivers/pci/pci.h] Signed-off-by: Bjorn Helgaas Reviewed-by: Sinan Kaya Reviewed-by: Oza Pawandeep commit 317c6d9b69eb2dcab2ca4759a2c1c04496ec1591 Author: Boris Brezillon Date: Wed Jul 18 10:42:21 2018 +0200 mtd: rawnand: micron: Make ECC activation stateful We currently don't store the on-die ECC state (enabled/disabled) which might force us to re-disable the engine even if it's already been disabled after we've read the page in raw mode to count the actual number of bitflips. Add an "enabled" field to struct micron_on_die_ecc to keep track of the ECC state. Signed-off-by: Boris Brezillon Tested-by: Chris Packham Signed-off-by: Miquel Raynal commit ef422e1ecd272d077efce64432907632758cf2e2 Author: Boris Brezillon Date: Wed Jul 18 10:42:20 2018 +0200 mtd: rawnand: micron: Avoid enabling/disabling ECC when it can't be disabled Some chips have their on-die ECC forcibly enabled, there's no point in trying to enable/disable the ECC engine in that case. Signed-off-by: Boris Brezillon Tested-by: Chris Packham Signed-off-by: Miquel Raynal commit 2301780711efc514a8bb183e853bda8decce746a Author: Boris Brezillon Date: Wed Jul 18 10:42:19 2018 +0200 mtd: rawnand: micron: Get the actual number of bitflips The MT29F2Gxxx chips with 4bits/512byte on-die ECC let us know when some bitflips were corrected by the on-die ECC, but they do not report the actual number of bitflips that were present in the data+ECC chunk. We initially decided to always return ecc->strength to avoid re-reading the page in raw mode + comparing it to the corrected buffer to extract the real number of bitflips, but this forces UBI to move data around as soon as one bitflip is present in a page. This not only wears the NAND out faster, but also degrades performances, since reading a full PEB + writing it back to a different PEB + erasing the old one is much more expensive than re-reading the faulty page in raw mode and comparing it to the corrected buffer. In most cases, the actual number of bitflips does not exceed the bitflips threshold, and UBI won't have to move data around. Otherwise, we can assume the time spent re-reading the page and doing the comparison is negligible compared to the time UBI spends moving a full PEB to another PEB. Note that this logic is not applied to chips with 8bits/512byte on-die ECC, because those chips provide fine-grained information (the maximum error is 1 bit, and it will not force UBI to move blocks around at the first bitflip). Suggested-by: Bean Huo Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit cb2bf403a462082a253fe0a94cfec020285ffbd8 Author: Chris Packham Date: Wed Jul 18 10:42:18 2018 +0200 mtd: rawnand: micron: allow forced on-die ECC Some Micron NAND chips have on-die ECC forceably enabled. Allow such chips to be used as long as the controller has set chip->ecc.mode to NAND_ECC_ON_DIE. Signed-off-by: Chris Packham Reviewed-by: Boris Brezillon Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 0d6030ac041f6835974deb88a1a9c299b4adc3ad Author: Boris Brezillon Date: Wed Jul 18 10:42:17 2018 +0200 mtd: rawnand: Expose _notsupp() helpers for raw page accessors Some implementations simply can't disable their ECC engine. Expose helpers returning -ENOTSUPP so that the caller knows that raw accesses are not supported instead of silently falling back to non-raw accessors. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 3ec7cb369eb22a5a06f9867e358bc55d40055168 Author: Chris Packham Date: Wed Jul 18 10:42:16 2018 +0200 mtd: rawnand: micron: support 8/512 on-die ECC Micron MT29F1G08ABAFAWP-ITE:F supports an on-die ECC with 8 bits per 512 bytes. Add support for this combination. Signed-off-by: Chris Packham Reviewed-by: Boris Brezillon Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit dbc44edbf8338d27639214be07fe7ab4f8a903e0 Author: Boris Brezillon Date: Wed Jul 18 10:42:15 2018 +0200 mtd: rawnand: micron: Fix on-die ECC detection logic Basing the "mandatory on-die" detection on ID byte 2 does not work, because Micron has plenty of NANDs using the same device ID code, and not all of them have forcibly enabled on-die ECC. Since the "Array Operation" feature does not provide the "ECC enabled/disabled" bit when the ECC can't be disabled, let's try to use the "ECC enabled/disabled" bit in the READ_ID bytes. It seems that this bit is dynamically updated on NANDs where on-die ECC can freely be enabled/disabled, so let's hope it stays at one when we have a NAND with on-die ECC forcibly enabled. Fixes: 51f3b3970a8c ("mtd: rawnand: micron: detect forced on-die ECC") Signed-off-by: Boris Brezillon Tested-by: Chris Packham Signed-off-by: Miquel Raynal commit 79e1ca37cc0c056f224cc1dd4a301b9dc2f94167 Author: Boris Brezillon Date: Wed Jul 18 10:28:14 2018 +0200 mtd: rawnand: fsmc: Stop using chip->read_buf() chip->read_buf is left unassigned since commit 4da712e70294 ("mtd: nand: fsmc: use ->exec_op()"), leading to a NULL pointer dereference when it's called from fsmc_read_page_hwecc(). Fix that by using the appropriate helper to read data out of the NAND. Fixes: 4da712e70294 ("mtd: nand: fsmc: use ->exec_op()") Cc: Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 7330fc505af4af262ef874a4fc4492393106fdce Author: Arnd Bergmann Date: Tue Jul 17 22:27:42 2018 +0200 mtd: rawnand: qcom: stop using phys_to_dma() Compile-testing this driver on x86 caused a link error: ERROR: "__phys_to_dma" [drivers/mtd/nand/raw/qcom_nandc.ko] undefined! The problem here is that the driver attempts to convert the physical address into the DMA controller as a dma_addr_t and calls phys_to_dma() to do the conversion. The correct way to do the conversion is using the dma mapping interfaces. Fixes: c76b78d8ec05 ("mtd: nand: Qualcomm NAND controller driver") Signed-off-by: Arnd Bergmann Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit d535934a9ad4dc435884958ac44a7d6ecb6278ce Author: Stefan Agner Date: Tue Jul 17 10:46:18 2018 +0200 mtd: rawnand: tegra: check bounds of die_nr properly The Tegra driver currently only support a single chip select, hence check boundaries accordingly. This fixes a off by one issue catched with Smatch: drivers/mtd/nand/raw/tegra_nand.c:476 tegra_nand_select_chip() warn: array off by one? 'nand->cs[die_nr]' Also warn in case the stack asks for a chip select we currently do not support. Reported-by: Dan Carpenter Signed-off-by: Stefan Agner Signed-off-by: Marcel Ziswiler Signed-off-by: Miquel Raynal commit 6a943386ee364155727f62711f6f3e898d824cdd Author: Miquel Raynal Date: Sat Jul 14 12:23:54 2018 +0200 mtd: rawnand: add default values for dynamic timings Some timings like tBERS (block erase time), tCCs (change column setup time), tPROG (page program time) and tR (page read time) are derived from the ONFI parameter page. They are set in the SDR interface only if the chip is ONFI compliant. It makes these timings unreliable and prevent the driver to use one of these four values with a non-ONFI chip. Fix this situation by taking the highest possible value (or a default one) value for each missing timing (stored as unsigned 16-bit entries in the parameter page). This makes tBERS and tPROG being ~65ms while typical values are at most a few milliseconds. As these are timeouts, it is not impacting at all the performances in nominal use. tR maximum time and tCCS minimum time (delay to wait after a change column) are set, according to the ONFI specification, to default 'slow' values; respectively 200us and 500ns. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit e8b0ac398f5ec16b249f5243d8011d490e3b91c0 Author: Rafał Miłecki Date: Fri Jul 13 11:27:32 2018 +0200 mtd: onenand: use mtd_device_register() where applicable If driver doesn't specify parsers it can use that little helper. Signed-off-by: Rafał Miłecki Signed-off-by: Miquel Raynal commit 29597ca14dee1611eafbc09ae0c6bd756687105f Author: Rafał Miłecki Date: Fri Jul 13 11:27:31 2018 +0200 mtd: rawnand: use mtd_device_register() where applicable If driver doesn't specify parsers it can use that little helper. Signed-off-by: Rafał Miłecki Acked-by: Xiaolei Li Signed-off-by: Miquel Raynal commit c2204734bb50899764129ed5568b8d5aa013c8fb Author: Arnd Bergmann Date: Wed Jul 11 10:39:44 2018 +0200 mtd: rawnand: MTD_NAND_BCM47XXNFLASH needs CONFIG_BCMA We already have a dependency on BCMA_NFLASH, which in turn depends on BCMA, but since BCMA is a tristate option and BCMA_NFLASH is bool, we can run into an invalid configuration with MTD_NAND_BCM47XXNFLASH=y and BCMA=m: drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.o: In function `bcm47xxnflash_ops_bcm4706_init': ops_bcm4706.c:(.text+0x790): undefined reference to `bcma_chipco_pll_read' Adding the dependency here forces MTD_NAND_BCM47XXNFLASH to only be configured =m here so it can link against the BCMA driver. Signed-off-by: Arnd Bergmann Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit ab99e11062c187533db08078ccae799faed8873e Author: Boris Brezillon Date: Mon Jul 9 22:09:45 2018 +0200 memory: jz4780-nemc: Allow selection of this driver when COMPILE_TEST=y It just makes maintainers' life easier by allowing them to compile-test this driver without having MACH_JZ4780 enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Acked-by: Paul Burton Signed-off-by: Miquel Raynal commit 72b77bb018b3e913504fdb0a0612135e5391521e Author: Boris Brezillon Date: Thu Jul 19 09:37:20 2018 +0200 mtd: rawnand: jz4740: Use the proper format specifier to print chipnr In jz_nand_detect_bank(), chipnr is a size_t argument. Use %zu instead of %i when printing it. Reported-by: Stephen Rothwell Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit d70420bcd447e5400a0116b20b9b6088bb32448e Author: Miquel Raynal Date: Wed Jul 18 22:33:02 2018 +0200 mtd: adapt misleading comment in mtd_oob_ops structure A comment in the kernel doc of the mtd_oob_ops structure tells that it is not possible to write more than one page with OOB. This is actually true for only a few MTD devices like 'onenand' but it is definitely not a general limitation. While this would benefit to be handled elsewhere either by the MTD layer or by the limited drivers, let's update this comment to reflect the reality. Signed-off-by: Miquel Raynal Signed-off-by: Boris Brezillon commit a8222a84cefa9d3595a14cf076bc8c09287bf16c Author: Boris Brezillon Date: Wed Jul 18 17:09:52 2018 +0200 mtd: Make Kconfig formatting consistent Fix indentation and replace '---help---' by 'help' to make things consistent. Signed-off-by: Boris Brezillon Reviewed-by: Miquel Raynal commit 73ab603f44149ff48889d5109ea9ab64bf38cc69 Merge: 41afb1dfad4d fb7d1bcf1602 Author: Thomas Gleixner Date: Thu Jul 19 23:11:52 2018 +0200 Merge branch 'linus' into x86/timers Pick up upstream changes to avoid conflicts commit 1ae22a0e35636efceab83728ba30b013df761592 Author: Maciej W. Rozycki Date: Tue May 15 23:40:18 2018 +0100 MIPS: Add FP_MODE regset support Define an NT_MIPS_FP_MODE core file note and implement a corresponding regset holding the state handled by PR_SET_FP_MODE and PR_GET_FP_MODE prctl(2) requests. This lets debug software correctly interpret the contents of floating-point general registers both in live debugging and in core files, and also switch floating-point modes of a live process. [paul.burton@mips.com: - Changed NT_MIPS_FP_MODE to 0x801 to match first nibble of NT_MIPS_DSP, which was also changed to avoid a conflict.] Signed-off-by: Maciej W. Rozycki Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19331/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit 44109c60176ae73924a42a6bef64ef151aba9095 Author: Maciej W. Rozycki Date: Tue May 15 23:34:28 2018 +0100 MIPS: Add DSP ASE regset support Define an NT_MIPS_DSP core file note type and implement a corresponding regset holding the DSP ASE register context, following the layout of the `mips_dsp_state' structure, except for the DSPControl register stored as a 64-bit rather than 32-bit quantity in a 64-bit note. The lack of DSP ASE register saving to core files can be considered a design flaw with commit e50c0a8fa60d ("Support the MIPS32 / MIPS64 DSP ASE."), leading to an incomplete state being saved. Consequently no DSP ASE regset has been created with commit 7aeb753b5353 ("MIPS: Implement task_user_regset_view."), when regset support was added to the MIPS port. Additionally there is no way for ptrace(2) to correctly access the DSP accumulator registers in n32 processes with the existing interfaces. This is due to 32-bit truncation of data passed with PTRACE_PEEKUSR and PTRACE_POKEUSR requests, which cannot be avoided owing to how the data types for ptrace(3) have been defined. This new NT_MIPS_DSP regset fills the missing interface gap. [paul.burton@mips.com: - Change NT_MIPS_DSP to 0x800 to avoid conflict with NT_VMCOREDD introduced by commit 2724273e8fd0 ("vmcore: add API to collect hardware dump in second kernel"). - Drop stable tag. Whilst I agree the lack of this functionality can be considered a flaw in earlier DSP ASE support, it's still new functionality which doesn't meet up to the requirements set out in Documentation/process/stable-kernel-rules.rst.] Signed-off-by: Maciej W. Rozycki Signed-off-by: Paul Burton References: 7aeb753b5353 ("MIPS: Implement task_user_regset_view.") Patchwork: https://patchwork.linux-mips.org/patch/19330/ Cc: Alexander Viro Cc: James Hogan Cc: Ralf Baechle Cc: linux-fsdevel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit f5958b4cf4fc38ed4583ab83fb7c4cd1ab05f47b Author: Maciej W. Rozycki Date: Tue May 15 23:33:26 2018 +0100 MIPS: Correct the 64-bit DSP accumulator register size Use the `unsigned long' rather than `__u32' type for DSP accumulator registers, like with the regular MIPS multiply/divide accumulator and general-purpose registers, as all are 64-bit in 64-bit implementations and using a 32-bit data type leads to contents truncation on context saving. Update `arch_ptrace' and `compat_arch_ptrace' accordingly, removing casts that are similarly not used with multiply/divide accumulator or general-purpose register accesses. Signed-off-by: Maciej W. Rozycki Signed-off-by: Paul Burton Fixes: e50c0a8fa60d ("Support the MIPS32 / MIPS64 DSP ASE.") Patchwork: https://patchwork.linux-mips.org/patch/19329/ Cc: Alexander Viro Cc: James Hogan Cc: Ralf Baechle Cc: linux-fsdevel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org # 2.6.15+ commit 2f819db565e82e5f73cd42b39925098986693378 Author: Maciej W. Rozycki Date: Tue May 15 23:32:45 2018 +0100 binfmt_elf: Respect error return from `regset->active' The regset API documented in defines -ENODEV as the result of the `->active' handler to be used where the feature requested is not available on the hardware found. However code handling core file note generation in `fill_thread_core_info' interpretes any non-zero result from the `->active' handler as the regset requested being active. Consequently processing continues (and hopefully gracefully fails later on) rather than being abandoned right away for the regset requested. Fix the problem then by making the code proceed only if a positive result is returned from the `->active' handler. Signed-off-by: Maciej W. Rozycki Signed-off-by: Paul Burton Fixes: 4206d3aa1978 ("elf core dump: notes user_regset") Patchwork: https://patchwork.linux-mips.org/patch/19332/ Cc: Alexander Viro Cc: James Hogan Cc: Ralf Baechle Cc: linux-fsdevel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit 5c675bf2c67c4efb36a78bebf44dc435db2daf16 Author: Christian König Date: Wed Jul 18 20:30:51 2018 +0200 drm/amdgpu: clean up UVD instance handling v2 The whole handle, filp and entity handling is superfluous here. We should have reviewed that more thoughtfully. It looks like somebody just made the code instance aware without knowing the background. v2: fix one more missed case in amdgpu_uvd_suspend Reviewed-by: Leo Liu Signed-off-by: Christian König Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit 58c24b7c893cb1739918c875ae3cf4bb5f86ebb7 Author: Christian König Date: Wed Jul 18 20:28:08 2018 +0200 drm/amdgpu: remove superflous UVD encode entity Not sure what that was every used for, but now it is completely unused. Reviewed-by: Leo Liu Signed-off-by: Christian König Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit 4841203102a337b4b627e6dd3a1dc8c88aec982b Author: Michel Dänzer Date: Tue Jul 17 12:37:45 2018 +0200 drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86 Allowing CONFIG_DRM_AMD_DC_DCN1_0 to be disabled on X86 was an opportunity for display with Raven Ridge accidentally not working. Reviewed-by: Harry Wentland Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 1ce0688f3f6a9e9d34ae66bf779d54855def7bec Author: Evan Quan Date: Thu Jul 19 13:21:43 2018 +0800 drm/amd/powerplay: fixed uninitialized value The 'result' is not initialized correctly. It causes the API return an error code even on success. Signed-off-by: Evan Quan Acked-by: Huang Rui Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit c64fb6dade1637e80ab316be42a271747ac4033b Author: Alex Deucher Date: Wed Jul 18 16:07:11 2018 -0500 drm/amdgpu/powerplay: use irq source defines for smu7 sources Use the newly added irq source defines rather than magic numbers for smu7 thermal interrupts. Rewiewed-by: Chunming Zhou Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 7abeb64da6deeffa52f74e3b1e19d2c9e2c3ae6b Merge: 58cabe8715f2 a57942bfdd61 Author: Takashi Iwai Date: Thu Jul 19 20:48:06 2018 +0200 Merge branch 'topic/drm_audio_component' into for-next Pull the generic drm_audio_component support, which will be used later for AMD/ATI and other HD-audio HDMI codec drivers. Signed-off-by: Takashi Iwai commit 9ee6f8a8cbbd203fb0a844f937007a9525422697 Author: Hans de Goede Date: Sun Jul 1 11:30:23 2018 +0200 ASoC: Intel: bytcr_rt5640: Add quirk for the "Connect Tablet 9" tablet Add a quirk for the "Connect Tablet 9" tablet, this tablet has a mono-speaker. Otherwise it works fine with the defaults. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 246b6472b7dafd839c8fc9d4484f00a0ba5ec4dc Merge: d91cfeb0aa79 d5fd14803573 Author: Thomas Gleixner Date: Thu Jul 19 18:16:01 2018 +0200 Merge tag 'irqchip-4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates for 4.18, take #3 from Marc Zyngier - DT binding updates for Renesas r8a77470 and r8a77980 SoCs - DT binding update for Ingenic JZ4725B SoC - Fix stm32mp1's exti0 pin routing commit ef821e3f14e868779505bf08f96afb4eade53652 Author: Rodrigo Vivi Date: Thu Jul 19 08:47:59 2018 -0700 drm/i915: Update DRIVER_DATE to 20180719 Signed-off-by: Rodrigo Vivi commit d81be4f379e732c29e50fbf8fbdbe15980320bf6 Author: Ville Syrjälä Date: Tue Jul 17 20:42:16 2018 +0300 drm/i915: Remove intel_panel_detect() With neither LVDS or eDP no longer using intel_panel_detect() we can kill it, and the accompanying modparam. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180717174216.22252-3-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit b93b41afcee272c13f4aa9df18b46ba40cce37e5 Author: Ville Syrjälä Date: Tue Jul 17 20:42:15 2018 +0300 drm/i915: Assume eDP is always connected We never registered any kind of lid notifier for eDP, so looking at the lid status is pretty much bonkers. Let's just consider eDP always connected instead. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180717174216.22252-2-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 05c72e77ccda89ff624108b1b59a0fc43843f343 Author: Ville Syrjälä Date: Tue Jul 17 20:42:14 2018 +0300 drm/i915: Nuke the LVDS lid notifier We broke the LVDS notifier resume thing in (presumably) commit e2c8b8701e2d ("drm/i915: Use atomic helpers for suspend, v2.") as we no longer duplicate the current state in the LVDS notifier and thus we never resume it properly either. Instead of trying to fix it again let's just kill off the lid notifier entirely. None of the machines tested thus far have apparently needed it. Originally the lid notifier was added to work around cases where the VBIOS was clobbering some of the hardware state behind the driver's back, mostly on Thinkpads. We now have a few report of Thinkpads working just fine without the notifier. So maybe it was misdiagnosed originally, or something else has changed (ACPI video stuff perhaps?). If we do end up finding a machine where the VBIOS is still causing problems I would suggest that we first try setting various bits in the VBIOS scratch registers. There are several to choose from that may instruct the VBIOS to steer clear. With the notifier gone we'll also stop looking at the panel status in ->detect(). v2: Nuke enum modeset_restore (Rodrigo) Cc: stable@vger.kernel.org Cc: Wolfgang Draxinger Cc: Vito Caputo Cc: kitsunyan Cc: Joonas Saarinen Tested-by: Vito Caputo # Thinkapd X61s Tested-by: kitsunyan # ThinkPad X200 Tested-by: Joonas Saarinen # Fujitsu Siemens U9210 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105902 References: https://lists.freedesktop.org/archives/intel-gfx/2018-June/169315.html References: https://bugs.freedesktop.org/show_bug.cgi?id=21230 Fixes: e2c8b8701e2d ("drm/i915: Use atomic helpers for suspend, v2.") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180717174216.22252-1-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit d5fd14803573e57941100d11dd9cf3e84d17e180 Author: Sergei Shtylyov Date: Tue Jul 17 22:23:17 2018 +0300 dt-bindings: irqchip: renesas-irqc: Document r8a77980 support Document R-Car V3H (AKA R8A77980) SoC bindings. Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Sergei Shtylyov Signed-off-by: Marc Zyngier commit dcbabbbd2618991d349b3b4f75e6b2eb4fad37df Author: Biju Das Date: Thu Mar 29 11:17:08 2018 +0100 dt-bindings: irqchip: renesas-irqc: Document r8a77470 support Renesas RZ/G SoC have the R-Car gen2 compatible IRQC interrupt controllers. Document RZ/G1C (also known as R8A77470) SoC bindings. Reviewed-by: Fabrizio Castro Reviewed-by: Simon Horman Reviewed-by: Geert Uytterhoeven Signed-off-by: Biju Das Signed-off-by: Marc Zyngier commit 1047557cb9574a5be889bd45c1b4aa85209080e7 Author: Paul Cercueil Date: Fri Jul 13 16:49:09 2018 +0200 irqchip/ingenic: Add support for the JZ4725B SoC The interrupt controller of the JZ4725B works the same way as the other JZ SoCs from Ingenic; so we just add a new compatible string. Signed-off-by: Paul Cercueil Signed-off-by: Marc Zyngier commit 6bdd0299cf76c38453c06b33cdb58636878aad0d Author: Ludovic Barre Date: Tue Jul 17 14:14:27 2018 +0200 irqchip/stm32: Add exti0 translation for stm32mp1 This patch fixes a datasheet issue, in the draft version the "exti0" was not connected whereas is it. Signed-off-by: Ludovic Barre Signed-off-by: Marc Zyngier commit 06aa6e51273c9ac458af0bb9be95603cfbad14ec Author: Hans de Goede Date: Wed Jul 18 22:55:42 2018 +0200 ASoC: Intel: bytcr_rt5651: Add quirk table entries for various devices Add quirk table entries for the following tablets: ITWorks TW701 Ployer Momo7w Trekstor win7 Yours 8" These all use the default settings, except that they only have a single speaker and thus need the mono-speaker quirk. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit a0d1d867c262f4ad5d8e4925e2212711ebdbf2b7 Author: Hans de Goede Date: Wed Jul 18 22:55:41 2018 +0200 ASoC: Intel: bytcr_rt5651: Add mono speaker quirk During my initial round of bytcr_rt5651 long-name patches I did not include a difference for mono vs stereo speaker setups in the longname because it seems that all 5651 devices with only a single speaker do some mixing of left + right on the PCB. However further testing has shown that while this works great when only playing audio on the left or right channel, the output becomes garbled when using both channels at once. Something which does not happen when using the Stereo DAC MIXL / MIXR switches to mix the channels together inside the codec and then only outputting on a single channel. So we need to have separate UCM profiles and thus separate long-names for devices with a mono speaker vs stereo speakers. Just as we already have for the bytcr_rt5640 case. This commit adds a new BYT_RT5651_MONO_SPEAKER quirk and adds "stereo-spk" or "mono-spk" to the long-name based on this and enables this mapping on devices with a mono speaker. Changing the long-name like this is ok for now, since I'm still working on the UCM profiles, so they are not in upstream alsa-lib yet. This brings the long-name naming scheme fully in sync with the bytcr_rt5640 case, which is good from a consistency pov. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit ac275ee5aa67abe9b65d66071ee333c6b0905b93 Author: Hans de Goede Date: Wed Jul 18 22:55:40 2018 +0200 ASoC: Intel: bytcr_rt5651: Add IN2 input mapping During the recent cleanup series 3 of the 6 input mappings where removed from the bytcr_rt5651 machine driver because testing showed that none of them were used. However some devices do actually have their internal mic on IN2 (and only IN2, not IN1 and IN2), this did not show during previous tests due to a bug in the userspace UCM input device switching code. This commit re-adds the IN2 mapping for devices with the internal mic. on IN2 and the headser mic on IN3 and enables this mapping on devices with their internal mic on IN2. This commit also changes the default internal mic input to IN2, because all my 7 test devices have their mic there. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 8627fb257e1673d2c2277494545642921097da86 Author: Hans de Goede Date: Wed Jul 18 22:55:39 2018 +0200 ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to 2000uA With the default over current detect limit of 1500uA headsets on often get detected as headphones on the VIOS LTH17 and even when detected as headset the OVCD current triggers often while plugged in, resulting in false-positive button press detection. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 0a3badd141f78535315cca9ff5062a7ebf414281 Author: Hans de Goede Date: Wed Jul 18 22:55:38 2018 +0200 ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the ext-amp on some boards Some boards have I2cSerialBusV2, GpioIo, GpioInt as ACPI resources, other boards may have I2cSerialBusV2, GpioInt, GpioIo instead. We want the GpioIo one for the ext-amp-enable-gpio. So far we've been assuming that the GpioIo one always comes first, this commit adds code to detect which one comes first and to add the right gpio-mapping. This fixes sound not working on the Vios LTH17 laptop. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit eea1662525bd4a158a67ac836b2a1fd9cf77cc81 Author: Hans de Goede Date: Wed Jul 18 22:55:37 2018 +0200 ASoC: rt5651: Add IN3 Boost volume control Add a mixer control for the IN3 Boost volume, IN3 is used for the headset mic on most devices, so this is necessary to control the headset mic volume. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown commit 30587589251a00974115e0815ac316980f48dbb5 Author: Yi Wang Date: Mon Jul 16 14:08:57 2018 +0800 timer: Fix coding style The call to wake_up_nohz_cpu() is incorrectly indented. Remove the surplus TAB. Signed-off-by: Yi Wang Signed-off-by: Thomas Gleixner Reviewed-by: Jiang Biao Cc: john.stultz@linaro.org Cc: sboyd@kernel.org Cc: zhong.weidong@zte.com.cn CC: Anna-Maria Gleixner Link: https://lkml.kernel.org/r/1531721337-30284-1-git-send-email-wang.yi59@zte.com.cn commit ecbd611882a18cc5e720e752cae92d1198b198ec Author: Icenowy Zheng Date: Thu Jul 19 12:28:10 2018 +0800 arm64: allwinner: h6: enable MMC0/2 on Pine H64 The Pine H64 board have a MicroSD slot connected to MMC0 controller of the H6 SoC and a eMMC slot connected to MMC2. Enable them in the device tree. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit 8f54bd1595b3efdc535f36fc59c71c70e8007df4 Author: Icenowy Zheng Date: Thu Jul 19 12:28:09 2018 +0800 arm64: allwinner: h6: add device tree nodes for MMC controllers The Allwinner H6 SoC have 3 MMC controllers. Add device tree nodes for them. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit 0a23f1ad88fc9385a3d78ec283da8700dbf2fdff Author: Icenowy Zheng Date: Thu Jul 19 12:28:08 2018 +0800 dt-binding: mmc: sunxi: add H6 compatible (with A64 fallback) The MMC controllers on H6 is similar to the ones on A64, but with some new features. Add compatible strings for them (with the A64 compatible strings as fallback, in order to make them to work with A64 drivers). Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit 8e974b3b8eddd42a8c43a18e8ea66a3e7b803a0d Author: Rasmus Villemoes Date: Thu Jul 19 23:07:58 2018 +0900 x86: Avoid pr_cont() in show_opcodes() If concurrent printk() messages are emitted, then pr_cont() is making it extremly hard to decode which part of the output belongs to what. See the convoluted example at: https://syzkaller.appspot.com/text?tag=CrashReport&x=139d342c400000 Avoid this by using a proper prefix for each line and by using %ph format in show_opcodes() which emits the 'Code:' line in one go. Signed-off-by: Rasmus Villemoes Signed-off-by: Tetsuo Handa Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: joe@perches.com Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Josh Poimboeuf Cc: Linus Torvalds Link: https://lkml.kernel.org/r/1532009278-5953-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp commit d1ed755dde8f14921deeb0cb0257ba8905dfc9fa Author: Maxime Ripard Date: Wed Jul 11 11:25:08 2018 +0200 ARM: dts: sun5i: Fix the SRAM A3-A4 declaration According to the system control bindings, the A3-A4 SRAM node should be a child node of the SRAM it belongs to. However, it was introduced at the same level, therefore breaking the binding. Fix this. Fixes: 85870196258f ("ARM: sun5i: a13: Merge common controllers into the common DTSI") Signed-off-by: Maxime Ripard commit 7377330a1ed2e9bb5a97758bdadcdb37e2201b2a Author: Maxime Ripard Date: Wed Jul 11 11:25:07 2018 +0200 soc: sunxi: Add the A13, A23 and H3 system control compatibles The A13, A23 and H3 have variations of the system controls, in part due to the SRAM that are available (and can be mapped) in the SoC. In order to make it future proof, let's add compatibles for these SoCs in the driver. Signed-off-by: Maxime Ripard commit cd0ed39dc9e8b10d469f53ae03310bca09296bdd Author: Gustavo A. R. Silva Date: Wed Jul 18 23:46:53 2018 -0500 s390/tape: replace PTR_RET with PTR_ERR_OR_ZERO PTR_RET is deprecated, use PTR_ERR_OR_ZERO instead. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin Schwidefsky commit 9fa6a659ca98c45a5c226d165adfed96a1e01564 Author: Gustavo A. R. Silva Date: Thu Jul 19 00:08:30 2018 -0500 s390/hypfs: Replace PTR_RET with PTR_ERR_OR_ZERO PTR_RET is deprecated, use PTR_ERR_OR_ZERO instead. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin Schwidefsky commit 757853ea19755c24609e122268145527b541a4d4 Author: Gustavo A. R. Silva Date: Wed Jul 18 23:50:50 2018 -0500 s390/dasd: replace PTR_RET with PTR_ERR_OR_ZERO PTR_RET is deprecated, use PTR_ERR_OR_ZERO instead. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin Schwidefsky commit 9c705206d0b5f834650c379d6cfbd07a597a0a1e Author: Gustavo A. R. Silva Date: Wed Jul 18 23:42:05 2018 -0500 s390/ap_bus: replace PTR_RET with PTR_ERR_OR_ZERO PTR_RET is deprecated, use PTR_ERR_OR_ZERO instead. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin Schwidefsky commit 054732837c312c6007994badbc86b0976b228f77 Author: Martin Schwidefsky Date: Thu Jul 19 10:27:33 2018 +0200 s390/keyboard: sanitize array index in do_kdsk_ioctl The kbd_ioctl uses two user controlled indexes for KDGKBENT/KDSKBENT. Use array_index_nospec to prevent any out of bounds speculation. Signed-off-by: Martin Schwidefsky commit 22f3d86f0d87bfe1d9a38f7650af620f0b4f953d Author: Corentin Labbe Date: Wed Jul 18 11:40:41 2018 +0000 arm64: dts: allwinner: a64: Remove unused address-cells/size-cells of dwmac-sun8i address-cells/size-cells is unnecessary for dwmac-sun8i node. It was in early days, but since a mdio node is used, it could be removed. This patch fix the following DT warning: Warning (avoid_unnecessary_addr_size): /soc/ethernet@1c50000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Signed-off-by: Corentin Labbe Signed-off-by: Maxime Ripard commit 8fb147322a8fdec96852d537affe9623d307edfb Author: Corentin Labbe Date: Wed Jul 18 11:40:38 2018 +0000 ARM: dts: sunxi-h3-h5: Remove unused address-cells/size-cells of dwmac-sun8i address-cells/size-cells is unnecessary for dwmac-sun8i node. It was in early days, but since a mdio node is used, it could be removed. This patch fix the following DT warning: Warning (avoid_unnecessary_addr_size): /soc/ethernet@1c50000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Signed-off-by: Corentin Labbe Signed-off-by: Maxime Ripard commit 24770a3160662be1161bc1255d36a963d84a0b0b Author: Corentin Labbe Date: Wed Jul 18 11:40:40 2018 +0000 ARM: dts: sun8i: r40: Remove unused address-cells/size-cells of dwmac-sun8i address-cells/size-cells is unnecessary for dwmac-sun8i node. It was in early days, but since a mdio node is used, it could be removed. This patch fix the following DT warning: Warning (avoid_unnecessary_addr_size): /soc/ethernet@1c50000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Signed-off-by: Corentin Labbe Signed-off-by: Maxime Ripard commit b689ea74a671be3fb32cbe228626bfee6fbdf02e Author: Corentin Labbe Date: Wed Jul 18 11:40:39 2018 +0000 ARM: dts: sun8i: a83t: Remove unused address-cells/size-cells of dwmac-sun8i ddress-cells/size-cells is unnecessary for dwmac-sun8i node. It was in early days, but since a mdio node is used, it could be removed. This patch fix the following DT warning: Warning (avoid_unnecessary_addr_size): /soc/ethernet@1c50000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Signed-off-by: Corentin Labbe Signed-off-by: Maxime Ripard commit 089d0f967eec4e30d8f51e2b8bb01bec0944ca54 Author: Corentin Labbe Date: Wed Jul 18 11:40:37 2018 +0000 dt-bindings: net: dwmac-sun8i: Remove unused address-cells/size-cells address-cells/size-cells is unnecessary for dwmac-sun8i node. It was in early days, but since a mdio node is used, it could be removed. Signed-off-by: Corentin Labbe Signed-off-by: Maxime Ripard commit d52ed4b0bc73c1c7816f5b7a36229a95acfc76c8 Author: Richard Fitzgerald Date: Thu Jul 19 11:50:39 2018 +0100 ASoC: wm_adsp: Parse HOST_BUFFER controls Currently the compressed streams in DSP firmwares are identified essentially by looking at a fixed location inside the firmware. This is fragile and also limits things to a single compressed stream. Here a new form of firmware parameter is added, the HOST_BUFFER which identifies a compressed stream from meta-data in the firmware file. This is more robust and allows for the possiblity of using multiple streams per core in the future. Currently the implementation is still limited to a single stream and will use the first HOST_BUFFER parameter encountered. If there aren't any HOST_BUFFER parameters it will fall back to the legacy way of finding the host buffer. Signed-off-by: Richard Fitzgerald Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit 3bbc2705a3d132b9a86a0e4083f82a2b3c9bfdfd Author: Richard Fitzgerald Date: Thu Jul 19 11:50:38 2018 +0100 ASoC: wm_adsp: Allow up to 8 channels for voice control Newer voice control firmwares can capture multiple audio channels. Allow up to 8 channels for future-proofing. Signed-off-by: Richard Fitzgerald Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit b7ede5af62ab6bfad0980fad58e82d3fb56866df Author: Charles Keepax Date: Thu Jul 19 11:50:36 2018 +0100 ASoC: wm_adsp: Take prefix into account in control name length Currently when creating ALSA control names for the DSP the length of any prefix applied to the CODEC is not taken into account. Whilst this is mostly harmless it does result in ALSA doing the truncation of the control names and printing a warning. It is better to have the driver do the truncation so it can truncate from the start of parameter name itself to give a greater chance of the result maintain a unique name. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit 517ee74e1b3124b696f293aa4e220418f8125b4c Author: Charles Keepax Date: Thu Jul 19 11:50:35 2018 +0100 ASoC: wm_adsp: Correct algorithm list allocation size Commit 6396bb221514 ("treewide: kzalloc() -> kcalloc()") was overlooked when doing some refactoring to the algorithm list handling, which lead to twice as much buffer being allocated as required for reading the algorithm list. A kcalloc is no longer appropriate since the allocation size is now in bytes not registers, as such change back to kzalloc. Fixes: 7f7cca08abf4 ("ASoC: wm_adsp: Simplify handling of alg offset and length") Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit 868e49a4a00afaca07d2c450a02e49581eaece6c Author: Stuart Henderson Date: Thu Jul 19 11:50:37 2018 +0100 ASoC: wm_adsp: Ensure DSP boot work complete before preloader_put return All controls derived from the loaded firmware should be created prior to returning from the preloader's put function, such that they are immediately available to user-space. Signed-off-by: Stuart Henderson Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit d78d3343dce7787a5f7fd0b3d522a3510fd26ef9 Author: Chris Wilson Date: Thu Jul 19 08:50:29 2018 +0100 drm/i915/execlists: Move the assertion we have the rpm wakeref down There's a race between idling the engine and finishing off the last tasklet (as we may kick the tasklets after declaring an individual engine idle). However, since we do not need to access the device until we try to submit to the ELSP register (processing the CSB just requires normal CPU access to the HWSP, and when idle we should not need to submit!) we can defer the assertion unto that point. The assertion is still useful as it does verify that we do hold the longterm GT wakeref taken from request allocation until request completion. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107274 Fixes: 9512f985c32d ("drm/i915/execlists: Direct submission of new requests (avoid tasklet/ksoftirqd)") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180719075029.28643-1-chris@chris-wilson.co.uk commit ef6cb5f1a048fdf91ccee6d63d2bfa293338502d Author: Vaibhav Jain Date: Wed Jul 4 20:58:33 2018 +0530 cxl: Fix wrong comparison in cxl_adapter_context_get() Function atomic_inc_unless_negative() returns a bool to indicate success/failure. However cxl_adapter_context_get() wrongly compares the return value against '>=0' which will always be true. The patch fixes this comparison to '==0' there by also fixing this compile time warning: drivers/misc/cxl/main.c:290 cxl_adapter_context_get() warn: 'atomic_inc_unless_negative(&adapter->contexts_num)' is unsigned Fixes: 70b565bbdb91 ("cxl: Prevent adapter reset if an active context exists") Cc: stable@vger.kernel.org # v4.9+ Reported-by: Dan Carpenter Signed-off-by: Vaibhav Jain Acked-by: Andrew Donnellan Acked-by: Frederic Barrat Signed-off-by: Michael Ellerman commit 99c3ce33a00bc40cb218af770ef00c82c8044c36 Author: Alistair Popple Date: Tue Apr 17 19:11:29 2018 +1000 powerpc/powernv/npu: Add a debugfs setting to change ATSD threshold The threshold at which it becomes more efficient to coalesce a range of ATSDs into a single per-PID ATSD is currently not well understood due to a lack of real-world work loads. This patch adds a debugfs parameter allowing the threshold to be altered at runtime in order to aid future development and refinement of the value. Signed-off-by: Alistair Popple Acked-by: Balbir Singh Signed-off-by: Michael Ellerman commit d69ccc00c497a4d81fca2dca9bda9f7799971b38 Author: Michael Hanselmann Date: Mon Jan 29 22:40:09 2018 +0000 MAINTAINERS: Remove the entry for the orphaned ams driver I no longer have any hardware with the Apple motion sensor and thus relinquish maintainership of the driver. Remove the maintainers entry entirely, meaning the code will now fall under "LINUX FOR POWER MACINTOSH". Signed-off-by: Michael Hanselmann [mpe: Drop the entry entirely, munge change log] Signed-off-by: Michael Ellerman commit fca7bf946e31688edce446fdaa571ccf77e24687 Author: Bharat Bhushan Date: Fri Jun 29 15:54:32 2018 +0530 powerpc/mpic: Pass first free vector number to mpic_setup_error_int() Update the comment to account for the spurious interrupt number. The code was already accounting for it, but that was unclear because it was achieved by mpic_setup_error_int() knowing that the number it was passed was the last used vector, rather than the first free vector. So change the meaning of the argument to the first free vector and update the caller to pass 13, instead of 12, to achieve the same result. Signed-off-by: Bharat Bhushan [mpe: Rewrite change log] Signed-off-by: Michael Ellerman commit 46b1063f91e5680eff2a6b9fe432f6aae3bef54e Author: Chris Wilson Date: Thu Jul 19 08:22:06 2018 +0100 drm/i915: Handle recursive shrinker for vma->last_active allocation If we call into the shrinker for direct relcaim inside kmalloc, it will retire the requests. If we retire the vma->last_active while processing a new i915_vma_move_to_active() we can upset the delicate bookkeeping required for the cache. After the possible invocation of the shrinker, we need to double check the vma->last_active is still valid. Fixes: 8b293eb53a7d ("drm/i915: Track the last-active inside the i915_vma") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105600#c39 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180719072206.16015-1-chris@chris-wilson.co.uk commit a3da7b4a3be51f37f434f14e11e60491f098b6ea Author: Christian Borntraeger Date: Thu Mar 8 16:08:49 2018 +0000 KVM: s390: add etoken support for guests We want to provide facility 156 (etoken facility) to our guests. This includes migration support (via sync regs) and VSIE changes. The tokens are being reset on clear reset. This has to be implemented by userspace (via sync regs). Signed-off-by: Christian Borntraeger Reviewed-by: David Hildenbrand Acked-by: Cornelia Huck commit eea033d07543a177fc2ab35a6d633b2aa9684b0f Author: Srinivas Pandruvada Date: Wed Jul 18 14:51:59 2018 -0700 cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP On HWP platforms with Turbo 3.0, the HWP capability max ratio shows the maximum ratio of that core, which can be different than other cores. If we show the correct maximum frequency in cpufreq sysfs via cpuinfo_max_freq and scaling_max_freq then, user can know which cores can run faster for pinning some high priority tasks. Currently the max turbo frequency is shown as max frequency, which is the max of all cores, even if some cores can't reach that frequency even for single threaded workload. But it is possible that max ratio in HWP capabilities is set as 0xFF or some high invalid value (E.g. One KBL NUC). Since the actual performance can never exceed 1 core turbo frequency from MSR TURBO_RATIO_LIMIT, we use this as a bound check. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 15c972dfb3954569e7d17ebadf1b10d0a0c3baa3 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:22 2018 +0200 PCI: endpoint: Add MSI set maximum restriction Add pci_epc_set_msi() maximum 32 interrupts validation. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit 0653217c180f0e5332ef75f7299220e644091b20 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:21 2018 +0200 tools: PCI: Add MSI-X support Add MSI-X support to pcitest tool. Modify pcitest.sh script to accommodate MSI-X interrupt tests. Update documentation accordingly. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit e03327122e2c8e6ae4565ef5b3d3cbe4364546a1 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:20 2018 +0200 pci_endpoint_test: Add 2 ioctl commands Add MSI-X support and update driver documentation accordingly. Add 2 new IOCTL commands: - Allow to reconfigure driver IRQ type in runtime. - Allow to retrieve current driver IRQ type configured. Add IRQ type validation before executing the READ/WRITE/COPY tests. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit c2e00e31087e58f6c49b90b4702fc3df4fad6a83 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:19 2018 +0200 pci-epf-test/pci_endpoint_test: Add MSI-X support Add MSI-X support and update driver documentation accordingly. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit 9133e394d5ed1c81c1141d611915e09e9f32330d Author: Gustavo Pimentel Date: Thu Jul 19 10:32:18 2018 +0200 pci-epf-test/pci_endpoint_test: Use irq_type module parameter Add new driver parameter to allow interruption type selection. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit e8817de7fbfca407f4f47da050d12b10fece5706 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:17 2018 +0200 pci-epf-test/pci_endpoint_test: Cleanup PCI_ENDPOINT_TEST memspace Cleanup PCI_ENDPOINT_TEST memspace (by moving the interrupt number away from command section). Add IRQ_TYPE register to identify the triggered ID interrupt required for the READ/WRITE/COPY tests and raise IRQ test commands. Update documentation accordingly. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit cb22d40b5f2bcf9d374ae92ea504df620daea342 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:16 2018 +0200 PCI: dwc: Add legacy interrupt callback handler Currently DesignWare IP does not handle legacy interrupts. Add a legacy interrupt callback handler. Signed-off-by: Gustavo Pimentel [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit 3920a5d7b24dc5229abe6fb8409e4c9de2c8c7a0 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:15 2018 +0200 PCI: dwc: Rework MSI callbacks handler Remove duplicate defines located on pcie-designware.h file already available on /include/uapi/linux/pci-regs.h file. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit beb4641a787df79a1423a8789d185b6b78fcbfea Author: Gustavo Pimentel Date: Thu Jul 19 10:32:14 2018 +0200 PCI: dwc: Add MSI-X callbacks handler Add PCIe config space capability search function. Add sysfs set/get interface to allow the change of EP MSI-X maximum number. Add EP MSI-X callback for triggering interruptions. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit d3c70a98d7d63cae02d50ebfafea04264a767401 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:13 2018 +0200 PCI: Update xxx_pcie_ep_raise_irq() and pci_epc_raise_irq() signatures Change {cdns, dra7xx, artpec6, dw, rockchip}_pcie_ep_raise_irq() and pci_epc_raise_irq() signature, namely the interrupt_num variable type from u8 to u16 to accommodate 2048 maximum MSI-X interrupts. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Alan Douglas Acked-by: Shawn Lin Acked-by: Jesper Nilsson Acked-by: Joao Pinto Acked-by: Kishon Vijay Abraham I commit 288d152c23dcf3c09da46c5c481903ca10ebfef7 Author: Nicolai Stange Date: Wed Jul 18 19:07:38 2018 +0200 x86/KVM/VMX: Initialize the vmx_l1d_flush_pages' content The slow path in vmx_l1d_flush() reads from vmx_l1d_flush_pages in order to evict the L1d cache. However, these pages are never cleared and, in theory, their data could be leaked. More importantly, KSM could merge a nested hypervisor's vmx_l1d_flush_pages to fewer than 1 << L1D_CACHE_ORDER host physical pages and this would break the L1d flushing algorithm: L1D on x86_64 is tagged by physical addresses. Fix this by initializing the individual vmx_l1d_flush_pages with a different pattern each. Rename the "empty_zp" asm constraint identifier in vmx_l1d_flush() to "flush_pages" to reflect this change. Fixes: a47dd5f06714 ("x86/KVM/VMX: Add L1D flush algorithm") Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner commit 8963106eabdc56911e9b65258eb5e9a6b7b3dfda Author: Gustavo Pimentel Date: Thu Jul 19 10:32:12 2018 +0200 PCI: endpoint: Add MSI-X interfaces Add PCI_EPC_IRQ_MSIX type. Add MSI-X callbacks signatures to the ops structure. Add sysfs interface for set/get MSI-X capability maximum number. Update documentation accordingly. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit 4e965ede1856ed62c7ac8b7ad905a4a285e4a9f3 Author: Gustavo Pimentel Date: Thu Jul 19 10:32:11 2018 +0200 PCI: dwc: Fix EP link notification implementation Move specific features settings from EP shared code (pcie-designware-ep.c) to the driver (pcie-designware-plat.c). Previous implementation disables the EP link notification by default for all SoCs that uses EP DesignWare IP, which affects directly the dra7xx and artpec6 SoCs. Signed-off-by: Gustavo Pimentel Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I commit d9f4426c73002957be5dd39936f44a09498f7560 Author: Jiang Biao Date: Wed Jul 18 08:03:14 2018 +0800 x86/speculation: Remove SPECTRE_V2_IBRS in enum spectre_v2_mitigation SPECTRE_V2_IBRS in enum spectre_v2_mitigation is never used. Remove it. Signed-off-by: Jiang Biao Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Cc: dwmw2@amazon.co.uk Cc: konrad.wilk@oracle.com Cc: bp@suse.de Cc: zhong.weidong@zte.com.cn Link: https://lkml.kernel.org/r/1531872194-39207-1-git-send-email-jiang.biao2@zte.com.cn commit d7db5843bc09c4d8a7d30c09b18c03a1dd5fd713 Author: Todd Poynor Date: Tue Jul 17 13:56:55 2018 -0700 staging: gasket: drop gasket_cdev_get_info, use container_of Remove gasket_cdev_get_info(), use container_of() directly instead, drop unnecessary NULL checks. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 45042402ae97682b965d88f2393f317f48bb0042 Author: Todd Poynor Date: Tue Jul 17 13:56:54 2018 -0700 staging: gasket: bail out of reset sequence on device callback error If device reset callback returns an error, error out at the gasket level. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 72a23054a95c5439b779930b6ffa129437178ac9 Author: Todd Poynor Date: Tue Jul 17 13:56:53 2018 -0700 staging: gasket: gasket_wait_with_reschedule use 32 bits of retry count Don't need a 64-bit retry counter. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit a42ea3d61c65946f7ccb1fbba7361e31eb367026 Author: Todd Poynor Date: Tue Jul 17 13:56:52 2018 -0700 staging: gasket: gasket_wait_with_reschedule simplify logic gasket_wait_with_reschedule() is a little more clear if we just return directly when the waited-for condition is hit. This also allows the following condition check to be removed and identation of the conditionally-executed code to be reduced. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit c17acfdf4ad544144bd1a9fa3d19725cad0b236d Author: Todd Poynor Date: Tue Jul 17 13:56:51 2018 -0700 staging: gasket: gasket_wait_with_reschedule use msleep Replace schedule_timeout() call with msleep() for simplicity. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 24dfee40e6c4b558437db1bdb3c4927cec1bda51 Author: Todd Poynor Date: Tue Jul 17 13:56:50 2018 -0700 staging: gasket: fix gasket_wait_with_reschedule timeout return code Return -ETIMEDOUT, not -EINVAL, on timeout, including callers. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit e24fbaf73f0541994ab3a947bcf6feb5258c9204 Author: Todd Poynor Date: Tue Jul 17 13:56:49 2018 -0700 staging: gasket: convert gasket_mmap_has_permissions to bool return gasket_mmap_has_permissions() should return a boolean value. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 03c25b3ad0405063f8e82871cfaef627dff4d26b Author: Todd Poynor Date: Tue Jul 17 13:56:48 2018 -0700 staging: gasket: Remove stale pointers on error allocating attr array If gasket_sysfs_create_mapping() hits errors allocating the attribute array, remove stale pointers to device info from the mapping object. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit cf2865a0c70c645c50d2665ca66228872e225ed0 Author: Todd Poynor Date: Tue Jul 17 13:56:47 2018 -0700 staging: gasket: Return EBUSY on mapping create when already in use gasket_sysfs_create_mapping() return EBUSY if sysfs mapping already in use, as a more appropriate error code than the current return of EINVAL, which would indicate invalid parameters. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 722c902aacfefcda4aa0517be82af5cfd2ec4bb0 Author: Todd Poynor Date: Tue Jul 17 13:56:46 2018 -0700 staging: gasket: hold mutex on gasket driver unregistration Take the global mutex on driver unregistration updates for proper ordering of updates and consistent access procedures. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit ba6585847ebc432e0c808c2bd194e620017b5901 Author: Todd Poynor Date: Tue Jul 17 13:56:45 2018 -0700 staging: gasket: remove driver registration on class creation failure If class_create() fails, remove the gasket driver from the global registration table. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit b17cef4d08ac9866f8996015d3bf396f51488a25 Author: Todd Poynor Date: Tue Jul 17 13:56:44 2018 -0700 staging: gasket: whitespace fix in gasket_page_table_init Tab replaced with space. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 920953ab4ed51fb2c971822dc593ca132913a4d2 Author: Todd Poynor Date: Tue Jul 17 13:56:43 2018 -0700 staging: gasket: fix typo in gasket_core.h comments Grammar fixup in gasket_core.h comments describing struct gasket_interrupt_desc. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 7e8a450aa0e62545af996db1f8b863d3e8c18220 Author: Todd Poynor Date: Tue Jul 17 13:56:42 2018 -0700 staging: gasket: fix typo in apex_enter_reset Fix typo in log message. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 6b39fd590aebca1a6a4c827f29f14d2b6df3939d Author: Kunihiko Hayashi Date: Thu Jul 19 15:18:53 2018 +0900 reset: uniphier: add reset control support for SPI Add reset control for SPI controller on UniPhier SoCs. Signed-off-by: Kunihiko Hayashi Acked-by: Masahiro Yamada Signed-off-by: Philipp Zabel commit 209b7955e59e361fe8ba1911fac68f46355ac0cf Author: Chris Wilson Date: Tue Jul 17 21:29:32 2018 +0100 drm/i915/guc: Keep guc submission permanently engaged We make a decision at module load whether to use the GuC backend or not, but lose that setup across set-wedge. Currently, the guc doesn't override the engine->set_default_submission hook letting execlists sneak back in temporarily on unwedging leading to an unbalanced park/unpark. v2: Remove comment about switching back temporarily to execlists on guc_submission_disable(). We currently only call disable on shutdown, and plan to also call disable before suspend and reset, in which case we will either restore guc submission or mark the driver as wedged, making the reset back to execlists pointless. v3: Move reset.prepare across Fixes: 63572937cebf ("drm/i915/execlists: Flush pending preemption events during reset") Testcase: igt/drv_module_reload/basic-reload-inject Testcase: igt/gem_eio Signed-off-by: Chris Wilson Cc: Michał Winiarski Cc: Michal Wajdeczko Reviewed-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/20180717202932.1423-1-chris@chris-wilson.co.uk commit fcb662deeb83bbc6df58b472a3bfe76981a8cc36 Author: Shannon Nelson Date: Tue Jun 26 14:19:10 2018 -0700 xfrm: don't check offload_handle for nonzero The offload_handle should be an opaque data cookie for the driver to use, much like the data cookie for a timer or alarm callback. Thus, the XFRM stack should not be checking for non-zero, because the driver might use that to store an array reference, which could be zero, or some other zero but meaningful value. We can remove the checks for non-zero because there are plenty other attributes also being checked to see if there is an offload in place for the SA in question. Signed-off-by: Shannon Nelson Signed-off-by: Steffen Klassert commit 9153bf9fb5290cd91deefa99f2983a851f2ca5da Author: Michal Simek Date: Tue Jul 17 16:53:32 2018 +0200 ARM: dts: zynq: Remove #address/#size-cells from gpio-keys dts reports incorrect usage of these properties in gpio-keys node. Warning (avoid_unnecessary_addr_size): /gpio-keys: unnecessary The patch is removing these useless properties. Signed-off-by: Michal Simek commit a2b7baf4abee17b28a4fff3d16575217da75cfa9 Author: Luis Araneda Date: Thu Jul 12 01:50:48 2018 -0400 ARM: dts: zynq: Add LEDs to the Zybo Z7 board Add an LED node, connected to the Processing System (PS) Signed-off-by: Luis Araneda Signed-off-by: Michal Simek commit edd62b9a98be2d60ff990874e488ba25a80280d0 Author: Luis Araneda Date: Thu Jul 12 01:50:47 2018 -0400 ARM: dts: zynq: Use gpio constants for the Zybo Z7 board Include GPIO dt-bindings and use GPIO_ACTIVE_* constants to improve readability Signed-off-by: Luis Araneda Signed-off-by: Michal Simek commit 7d90ca6f19199a54d3f8417c5f36c50dfa0accc8 Author: Luis Araneda Date: Thu Jul 12 01:50:46 2018 -0400 ARM: dts: zynq: Fix memory size on the Zybo Z7 board According to the reference manual, the board has two Micron MT41K256M16HA-125 DDR3L memory ICs, which have 512 MiB each Tested on a ZYBO-Z7-20 board Signed-off-by: Luis Araneda Signed-off-by: Michal Simek commit 3f8ef5b04d8062dac2c8204219e597bb93fc9827 Author: Luis Araneda Date: Thu Jul 12 00:10:24 2018 -0400 dt-bindings: xilinx: zynq: Add missing boards The bindings were missing when the device-tree files were added Signed-off-by: Luis Araneda Reviewed-by: Rob Herring Signed-off-by: Michal Simek commit d14fad09bd8d4ddf35ca1cea6f4bc4bafbe1f16a Author: Luis Araneda Date: Thu Jul 12 00:10:23 2018 -0400 dt-bindings: xilinx: zynq: Move Paralella board to Xilinx Move the Adapteva Parallela board to Xilinx dt-bindings, as it's based on a Zynq SoC from Xilinx Signed-off-by: Luis Araneda Reviewed-by: Rob Herring Signed-off-by: Michal Simek commit 17eb178741dbfe4013f5325077c9cbbf191b04c0 Author: Luis Araneda Date: Thu Jul 12 00:10:22 2018 -0400 dt-bindings: xilinx: zynq: Sort entries alphabetically Sort additional compatible strings (boards) alphabetically by their manufacturer and model number This will help when finding a board because they will be grouped by their manufacturer Signed-off-by: Luis Araneda Reviewed-by: Rob Herring Signed-off-by: Michal Simek commit affd195ed4e8d01d735a53389bc724eb5d2c0bca Author: Luis Araneda Date: Thu Jul 12 00:10:21 2018 -0400 dt-bindings: xilinx: zynq: Improve boards description Change the description of some boards to make it similar to the value of the model property from their respective device-tree, using the format " " Signed-off-by: Luis Araneda Reviewed-by: Rob Herring Signed-off-by: Michal Simek commit 28432332457b9f9380b8d85a9cd3adae2a59f469 Author: Luis Araneda Date: Thu Jul 12 00:10:20 2018 -0400 ARM: dts: zynq: correct and improve the model property of dt files Replace the current value of the model property by a more accurate description of each board (which includes the manufacturer), as some of the boards had the same value ("Xilinx Zynq") Signed-off-by: Luis Araneda Signed-off-by: Michal Simek commit ef4c422d167afcd15c8bae1f841ef59334c1f973 Author: Luis Araneda Date: Thu Jul 12 00:10:19 2018 -0400 ARM: dts: zynq: Set correct manufacturer for ZedBoard and MicroZed boards Both boards are made by Avnet, Inc. So add an additional value to the compatible property Signed-off-by: Luis Araneda Signed-off-by: Michal Simek commit 025ba1841e5de5d5a0980cafee8a93a87332d112 Author: Michal Simek Date: Thu Apr 7 11:23:34 2016 +0200 ARM: dts: zynq: Add mmc alias for zc702/zc706/zed/zybo Add missing mmc alias. Signed-off-by: Michal Simek commit c998911f525a53ca932f30717716bbb78e83a4ec Author: Anton Gerasimov Date: Wed Mar 28 16:17:34 2018 +0200 ARM: dts: zynq: Add support for Z-turn board Add a dts for MYIR Z-turn board and respective target in Makefile. Signed-off-by: Anton Gerasimov Signed-off-by: Michal Simek commit 41ee3e3883056f216bc1044c7ab1c8477b3384ad Author: Michal Simek Date: Wed May 2 13:14:35 2018 +0200 arm64: dts: zynqmp: Add support for Avnet Ultra96 rev1 board Avnet Ultra96 rev1 board is commercialized Xilinx zcu100 revC/D internal board. The patch is reusing zcu100 revC files but changing model description and compatible strings which are used for example by libmraa. Signed-off-by: Michal Simek commit e4c986bb46dffbad08a5f54d0a1a5553f0a5c6a6 Author: Michal Simek Date: Wed May 2 13:29:00 2018 +0200 arm64: dts: zynqmp: Remove #address/#size-cells from gpio-keys dts reports incorrect usage of these properties in gpio-keys node. Warning (avoid_unnecessary_addr_size): /gpio-keys: unnecessary The patch is removing these useless properties. Signed-off-by: Michal Simek commit d724778640785fe0cfa7309871ef24169d9031de Author: Michal Simek Date: Fri Mar 2 08:45:16 2018 +0100 arm64: dts: zynqmp: Remove ep108 board ZynqMP Emulation board is no longer tested and there is no reason to keep maintaining it. Signed-off-by: Michal Simek commit a5c2ed48299aeaa92cf297750fc89227d59fd05b Author: Michal Simek Date: Mon Mar 12 16:12:33 2018 +0100 arm64: dts: zynqmp: Use serdev for zcu100 BT Mainline started to use serdev interface for uart attached devices. Change description to reflect it. Signed-off-by: Michal Simek commit 58cabe8715f20b7fb33431bb1f2c5bd7a438b11b Author: Adam Goode Date: Wed Jul 18 16:41:05 2018 -0400 ALSA: usb-audio: Allow changing from a bad sample rate If the audio device is externally clocked and set to a rate that does not match the external clock, the clock will never be valid and we cannot set the rate successfully. To fix this, allow a rate change even if the clock is initially invalid, and validate again after the rate is changed. This fixes problems with MOTU UltraLite AVB hardware over USB. Signed-off-by: Adam Goode Signed-off-by: Takashi Iwai commit fdf743c5c51d5b45db4dada39109549d2e49eb62 Author: David Gibson Date: Tue Jul 17 14:24:30 2018 +1000 powerpc/hugetlbpage: Rmove unhelpful HUGEPD_*_SHIFT macros The HUGEPD_*_SHIFT macros are always defined to be PGDIR_SHIFT and PUD_SHIFT, and have to have those values to work properly. They once used to have different values, but that was really only because they were used to mean different things in different contexts. 6fa50483 "powerpc/mm/hugetlb: initialize the pagetable cache correctly for hugetlb" removed that double meaning, but left the now useless constants. Signed-off-by: David Gibson Signed-off-by: Michael Ellerman commit a8bf9e504a6a2bb058b4f020d4ccc54b4157eb4a Author: Randy Dunlap Date: Fri Jul 13 21:27:48 2018 -0700 chrp/nvram.c: add MODULE_LICENSE() Add MODULE_LICENSE() to the chrp nvram.c driver to fix the build warning message: WARNING: modpost: missing MODULE_LICENSE() in arch/powerpc/platforms/chrp/nvram.o Signed-off-by: Randy Dunlap Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Michael Ellerman commit 8c8c10b90d88bfaad41ea34df17bf6f18d00f09d Author: Christophe Leroy Date: Fri Jul 13 13:10:47 2018 +0000 powerpc/8xx: fix handling of early NULL pointer dereference NULL pointers are pointers to user memory space. So user pagetable has to be set in order to avoid random behaviour in case of NULL pointer dereference, otherwise we may encounter random memory access hence Machine Check Exception from TLB Miss handlers. Set user pagetable as early as possible in order to properly catch early kernel NULL pointer dereference. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit d00ddd9da79a868264997e192f9404aef1e46ba8 Author: Ben Skeggs Date: Wed Jul 18 09:33:39 2018 +1000 drm/nouveau/kms/nv50-: allocate push buffers in vidmem on pascal Workaround for issues seen on systems with large amounts of RAM, caused by display not supporting the same physical address limits as the other parts of the GPU. Signed-off-by: Ben Skeggs commit ce57c6610cc2d7cde61fc005a2d2090bce46fc73 Merge: 9c3250a12790 a68bd1267b72 Author: Michael Ellerman Date: Thu Jul 19 14:37:57 2018 +1000 Merge branch 'topic/ppc-kvm' into next Merge in some commits we're sharing with the KVM tree. I manually propagated the change from commit d3d4ffaae439 ("powerpc/powernv/ioda2: Reduce upper limit for DMA window size") into pci-ioda-tce.c. Conflicts: arch/powerpc/include/asm/cputable.h arch/powerpc/platforms/powernv/pci-ioda.c arch/powerpc/platforms/powernv/pci.h commit 685dbcaa25becfba864b72ec3f03470833b7f692 Author: Anna-Maria Gleixner Date: Tue Jul 3 22:01:36 2018 +0200 drivers/md/raid5: Use irqsave variant of atomic_dec_and_lock() The irqsave variant of atomic_dec_and_lock handles irqsave/restore when taking/releasing the spin lock. With this variant the call of local_irq_save is no longer required. Cc: Shaohua Li Cc: linux-raid@vger.kernel.org Acked-by: Peter Zijlstra (Intel) Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Shaohua Li commit af1cab82109c31a41a3d24bafea9e1e9bcd0f981 Author: Michael Trimarchi Date: Tue Jul 17 14:55:26 2018 +0530 ARM: dts: imx6dl-mamoj: Add usb host and device support Add USB host and device support for BTicino i.MX6DL Mamoj board. Signed-off-by: Simone CIANNI Signed-off-by: Raffaele RECALCATI Signed-off-by: Michael Trimarchi Signed-off-by: Jagan Teki Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit faed0d59c587615fb01b3729d03aea83b00ac1c2 Author: Jagan Teki Date: Tue Jul 17 14:55:25 2018 +0530 ARM: dts: imx6dl-mamoj: Add Wifi support Add TI WL18XX Wifi for BTicino i.MX6DL board. Signed-off-by: Simone CIANNI Signed-off-by: Raffaele RECALCATI Signed-off-by: Michael Trimarchi Signed-off-by: Jagan Teki Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit ea8f1d7af608a333989ef60cbe9d1edd84fe6080 Author: Jagan Teki Date: Tue Jul 17 14:55:24 2018 +0530 ARM: dts: imx6dl-mamoj: Add parallel display support This patch adds parallel display support for i.MX6DL Mamoj board along with relevant backlight through pwm. LCD power sequence is added by 'Michael Trimarchi'. Signed-off-by: Simone CIANNI Signed-off-by: Raffaele RECALCATI Signed-off-by: Michael Trimarchi Signed-off-by: Jagan Teki Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 56962b44a59a870b665dfa31f549fb37995a7624 Author: Andrey Smirnov Date: Mon Jul 16 21:06:51 2018 -0700 ARM: dts: vf610: Add ZII SSMB SPU3 board Add support for Zodiac Inflight Innovations SSMB SPU3 board (VF610-based). Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrew Lunn Signed-off-by: Andrey Smirnov Tested-by: Chris Healy Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit c7d2959f032ddb0cb3528df4cc08b6b78acb9a09 Author: Anusha Srivatsa Date: Tue Jul 17 14:11:01 2018 -0700 i915/dp/dsc: Add Rate Control Range Parameter Registers RC model has these parameters that correspond with each of 15 ranges of RC buffer threshold value in the RC model. The three elements are range_min_qp, range_max_qp and range_bpg_offset. Add the Rate Control range values for eDP/MIPI and DP case. The actual values are calculated usung a helper function. This patch adds the shifts to registers where the value will be written during atomic commit. v2: - Use _MMIO_PIPE() instead of _MMIO(_PICK()) (Manasi) - Combine shifts (Manasi) Cc: Jose Souza Cc: Jani Nikula Cc: Ville Syrjala Cc: Manasi Navare Signed-off-by: Anusha Srivatsa Reviewed-by: Manasi Navare Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/1531861861-10950-4-git-send-email-anusha.srivatsa@intel.com commit dbda5111e2d85ff67452e9f8b82fc9eee73a224c Author: Anusha Srivatsa Date: Tue Jul 17 14:11:00 2018 -0700 i915/dp/dsc: Add Rate Control Buffer Threshold Registers Add register defines and shifts that control the RC buffer threshold between encoder and decoder for eDP/MIPI and DP cases. The actual values are calculated usung a helper function. This patch adds the shifts to registers where the value will be written during atomic commit. v2: - Use _MMIO_PIPE() instead of _MMIO_(_PICK()) (Manasi) - Combine shifts (Manasi) Cc: Jani Nikula Cc: Ville Syrjala Cc: Manasi Navare Signed-off-by: Anusha Srivatsa Reviewed-by: Manasi Navare Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/1531861861-10950-3-git-send-email-anusha.srivatsa@intel.com commit 2efbb2f099fb75d95150bf2f4029b641ecbd1503 Author: Anusha Srivatsa Date: Tue Jul 17 14:10:59 2018 -0700 i915/dp/dsc: Add DSC PPS register definitions Display Stream Compression(DSC) has a set of Picture Parameter Set(PPS) components that the encoder must communicate to the decoder. This patch adds register definitions to the PPS parameters for eDP/MIPI case and Display Port. v2: - Use _MMIO_PIPE instead of _MMIO(_PICK()). (Manasi) - Use DSC constants as arguments. (Manasi) Cc: Lucas De Marchi Cc: Ville Syrjala Cc: Manasi Navare Signed-off-by: Anusha Srivatsa Reviewed-by: Manasi Navare Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/1531861861-10950-2-git-send-email-anusha.srivatsa@intel.com commit 7af2be6d54d4eda52603e87fbb99a8fb989ccdf0 Author: Anusha Srivatsa Date: Tue Jul 17 14:10:58 2018 -0700 drm/i915/icl: Add VIDEO_DIP registers The Picture Parameter Set metadata for DSC has to be sent to the panel through secondary data packets. Add the error correction registers, data registers and control registers for the same. The control registers for transcoders A and B are already defined and will be reused for Icelake purpose. This patch adds Control register for EDP and transcoder C apart from adding the PPS data and error registers. v2: reuse MMIO_TRANS2 for _PPS_DATA and _PPS_ECC. The _MMIO_TRANS2(pipe, reg) macro definition takes care of the eDp case Cc: Jani Nikula Cc: Ville Syrjala Cc: Manasi Navare Signed-off-by: Anusha Srivatsa Reviewed-by: Manasi Navare Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/1531861861-10950-1-git-send-email-anusha.srivatsa@intel.com commit 0df57d90bfd6bb94831e70f4bcb4b7af784066cf Author: Olof Johansson Date: Fri Jul 13 09:24:58 2018 -0700 kbuild: buildtar: add arm64 support Make 'make tar-pkg' work on arm64. Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Olof Johansson Signed-off-by: Masahiro Yamada commit 33c362bbc0748dec3a4d3c119a9a5f4b7f7062a7 Author: Olof Johansson Date: Fri Jul 13 09:24:57 2018 -0700 kbuild: buildtar: remove crufty vax pieces ARCH=vax isn't in mainline; it can be added back if/when it shows up. Signed-off-by: Olof Johansson Signed-off-by: Masahiro Yamada commit 2fb9279f2c3e021745d5c461894a0f6c3690db7b Author: Masahiro Yamada Date: Thu Jul 12 17:01:35 2018 +0900 kbuild: change ld_flags to contain LDFLAGS_$(@F) Put $(LDFLAGS_$(@F)) into ld_flags so that $(LDFLAGS_pcap.o) and $(LDFLAGS_vde.o) in arch/um/drivers/Makefile are absorbed. Signed-off-by: Masahiro Yamada Acked-by: Kirill A. Shutemov commit f60b992e30ffef82fd6cd317c6fba3ccaacbe921 Author: Masahiro Yamada Date: Thu Jul 12 17:01:34 2018 +0900 kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags) $(LDFLAGS) $(ldflags-y) is equivalent to $(ld_flags). Signed-off-by: Masahiro Yamada Acked-by: Kirill A. Shutemov commit ec33408a2279b7c72fc09eb4c7fba805e3ec5afe Author: Masahiro Yamada Date: Thu Jul 12 17:01:33 2018 +0900 kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile Since commit ce99d0bf312d ("kbuild: clear LDFLAGS in the top Makefile"), the top-level Makefile caters to this. Signed-off-by: Masahiro Yamada Acked-by: Kirill A. Shutemov commit 3a477d4efc57adeb3b2bfd6ccedf6f20d275ae1b Author: Masahiro Yamada Date: Thu Jul 12 17:01:31 2018 +0900 um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um This is already exported by the top-level Makefile. Signed-off-by: Masahiro Yamada Acked-by: Kirill A. Shutemov commit 3bc950c34b28b60f879ea0ef8d97e65a8c8f1d50 Merge: f15f084ff115 6b335f8205e9 Author: David S. Miller Date: Wed Jul 18 15:28:27 2018 -0700 Merge branch 'docs-Convert-alias-and-bridge-to-rst' Tobin C. Harding says: ==================== docs: Convert alias and bridge to rst Here is my first attempt at working on converting docs in Documentation/networking to rst format. I've picked a couple of trivial ones to start with. If there is anything extra I can do to make your life easier during documentation conversion please say. (Also if there is some reason that it would be preferable to _not_ embark on this task please say :) This set does not make any changes to the converted files apart from formatting. v2: - remove incorrect patch from set (changing 'Indices' indentation) ==================== Signed-off-by: David S. Miller commit 6b335f8205e9d47569ebb2db90ede2c4aa7615ce Author: Tobin C. Harding Date: Wed Jul 18 13:27:36 2018 +1000 docs: networking: Convert bridge.txt to rst The kernel documentation is now restructured text. Convert the Ethernet Bridge documentation and include it in the toplevel kernel documentation. - Fix heading adornments. - Add license identifier. Signed-off-by: Tobin C. Harding Signed-off-by: David S. Miller commit 735dadf894f091bc15c06aedf8c1e99f971d3962 Author: Tobin C. Harding Date: Wed Jul 18 13:27:35 2018 +1000 docs: networking: Convert alias.txt to rst The kernel documentation is now restructured text. Convert the IP aliasing documentation and include it in the toplevel kernel documentation. - Fix heading adornments. - Correctly indent code snippets. - Limit line length to 72 characters inline with kernel documentation standards. - Add license identifier. Signed-off-by: Tobin C. Harding Signed-off-by: David S. Miller commit f15f084ff11519172c67fac4dde61daf4e9ad345 Author: Jakub Kicinski Date: Tue Jul 17 14:32:24 2018 -0700 pktgen: convert safe uses of strncpy() to strcpy() to avoid string truncation warning GCC 8 complains: net/core/pktgen.c: In function ‘pktgen_if_write’: net/core/pktgen.c:1419:4: warning: ‘strncpy’ output may be truncated copying between 0 and 31 bytes from a string of length 127 [-Wstringop-truncation] strncpy(pkt_dev->src_max, buf, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ net/core/pktgen.c:1399:4: warning: ‘strncpy’ output may be truncated copying between 0 and 31 bytes from a string of length 127 [-Wstringop-truncation] strncpy(pkt_dev->src_min, buf, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ net/core/pktgen.c:1290:4: warning: ‘strncpy’ output may be truncated copying between 0 and 31 bytes from a string of length 127 [-Wstringop-truncation] strncpy(pkt_dev->dst_max, buf, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ net/core/pktgen.c:1268:4: warning: ‘strncpy’ output may be truncated copying between 0 and 31 bytes from a string of length 127 [-Wstringop-truncation] strncpy(pkt_dev->dst_min, buf, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There is no bug here, but the code is not perfect either. It copies sizeof(pkt_dev->/member/) - 1 from user space into buf, and then does a strcmp(pkt_dev->/member/, buf) hence assuming buf will be null-terminated and shorter than pkt_dev->/member/ (pkt_dev->/member/ is never explicitly null-terminated, and strncpy() doesn't have to null-terminate so the assumption must be on buf). The use of strncpy() without explicit null-termination looks suspicious. Convert to use straight strcpy(). strncpy() would also null-pad the output, but that's clearly unnecessary since the author calls memset(pkt_dev->/member/, 0, sizeof(..)); prior to strncpy(), anyway. While at it format the code for "dst_min", "dst_max", "src_min" and "src_max" in the same way by removing extra new lines in one case. Signed-off-by: Jakub Kicinski Reviewed-by: Jiong Wang Signed-off-by: David S. Miller commit 088cbac6bea4d383b9e01f042b50fe00898714f5 Author: Keara Leibovitz Date: Tue Jul 17 12:12:54 2018 -0400 tc-tests: initial version of fw filter unit tests Create initial unit tests for the tc fw filter. Signed-off-by: Keara Leibovitz Signed-off-by: David S. Miller commit 0015b80abccecca82622d9e9d48eb210572a0c3b Author: Salvatore Mesoraca Date: Mon Jul 16 21:10:34 2018 -0700 net: dsa: Remove VLA usage We avoid 2 VLAs by using a pre-allocated field in dsa_switch. We also try to avoid dynamic allocation whenever possible (when using fewer than bits-per-long ports, which is the common case). Link: http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Link: http://lkml.kernel.org/r/20180505185145.GB32630@lunn.ch Signed-off-by: Salvatore Mesoraca [kees: tweak commit subject and message slightly] Signed-off-by: Kees Cook Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 14260e91707a7844206aeac10daa462cd3b1538d Merge: 0725345e5f05 df31b74ce132 Author: David S. Miller Date: Wed Jul 18 15:05:39 2018 -0700 Merge branch 'PTP-support-for-mv88e6165-family' Andrew Lunn says: ==================== PTP support for mv88e6165 family The mv88e6165 family of switches supports PTP. It is however not fully compatible with the current PTP support in the mv88e6xxx driver. This patchset adds a level of abstraction to the PTP code, and then adds the code needed to support the mv88e6165 family. v2: Correctly cluster local variables in mv88e6xxx_ptp_setup() Added Acked-by: Richard Cochran ==================== Signed-off-by: David S. Miller commit df31b74ce132c20d309aaada8b2fb67c35da5fad Author: Andrew Lunn Date: Wed Jul 18 22:38:27 2018 +0200 net: dsa: mv88e6xxx: Longer timeout for PTP TX timestamp For slow processors using bit-banging MDIO, 20ms can be too short a timeout when waiting for the transmit timestamp to become available. Double it to 40ms. Signed-off-by: Andrew Lunn Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 2dbed245b408f3e458345b974c862447a73c73c0 Author: Andrew Lunn Date: Wed Jul 18 22:38:26 2018 +0200 net: dsa: mv88e6xxx: Set PTP Ethertype For the 6352 and newer switches, the PTP Ethertype defaults to ETH_P_1588. Hence it was not explicitly set. The 6165 however defaults to 0. So explicitly set the EtherType. Signed-off-by: Andrew Lunn Acked-by: Richard Cochran Signed-off-by: David S. Miller commit e2294a8bf52b8bf1bab52b4165ffdceec4a143e0 Author: Andrew Lunn Date: Wed Jul 18 22:38:25 2018 +0200 net: dsa: mv88e6xxx: Add hwtimestamp support for the 6165 The 6165 family supports a more restricted version of hardware time stamps. Only L2 PTP is supported. All ports have to use the same EtherType, and transport spec configuration. PTP can only be enabled/disabled globally, not per port. Signed-off-by: Andrew Lunn Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 48cb5e03d58b7179dd8e71c1e8e068630b440b1c Author: Andrew Lunn Date: Wed Jul 18 22:38:24 2018 +0200 net: dsa: mv88e6xxx: Abstract supported PTP filters The 6165 only supports layer L2 PTP, where as the more modern devices also support UDP and UDPv6, i.e. L4. Abstract the supported receive filters. Signed-off-by: Andrew Lunn Acked-by: Richard Cochran Signed-off-by: David S. Miller commit ffc705de86e28e7a6e6f8d2e0be73c4181b37b4b Author: Andrew Lunn Date: Wed Jul 18 22:38:23 2018 +0200 net: dsa: mv88e6xxx: Abstract HW timestamp setup The 6165 family does not have per port PTP control registers. Also, it places the timestamp data in different registers. Abstract the current implementation of 6352 compatible PTP devices so that 6165 can be added. Signed-off-by: Andrew Lunn Acked-by: Richard Cochran Signed-off-by: David S. Miller commit dfa543481034ef57cba55585e35eead113f50030 Author: Andrew Lunn Date: Wed Jul 18 22:38:22 2018 +0200 net: dsa: mv88e6xxx: Add mv88e6165 PTP support The mv88e6165 family has its global clock in the PTP global registers. It does not support any form of PTP events. Add a function to read the clock, fill in an ops structure, and register it with the two members of the family. Signed-off-by: Andrew Lunn Acked-by: Richard Cochran Signed-off-by: David S. Miller commit a469a61231e5f67de4289f2a7889f0665528b13b Author: Andrew Lunn Date: Wed Jul 18 22:38:21 2018 +0200 net: dsa: mv88e6xxx: Add MV88E6165 AVB register access The MV88E6165 PTP registers are all in AVB bank F, unlike newer generations which spread them over AVB bank E and F. Implement AVB ops for the MV88E6165 which hides this difference. Signed-off-by: Andrew Lunn Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 6d2ac8ee67d335983f1c9106fc8deebb89290505 Author: Andrew Lunn Date: Wed Jul 18 22:38:20 2018 +0200 net: dsa: mv88e6xxx: Abstract PTP operations The mv88e6165 family supports PTP, but its registers use a different layout to the currently supported devices. Abstract accessing the PTP registers into a set of ops, so making space for a second implementation. Signed-off-by: Andrew Lunn Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 1470075d5e354da8f46f5aa2e6956de794eb406a Author: Katsuhiro Suzuki Date: Mon Jun 25 12:45:05 2018 +0900 arm64: dts: uniphier: add headphone detect gpio for LD11 global board This patch adds GPIO for headphone detection on LD11 global board. Signed-off-by: Katsuhiro Suzuki Signed-off-by: Masahiro Yamada commit 97e10f5ae86e9d8df73152157c6499c955a6ce14 Author: Katsuhiro Suzuki Date: Mon Jun 25 12:45:04 2018 +0900 arm64: dts: uniphier: add headphone detect gpio for LD20 global board This patch adds GPIO for headphone detection on LD20 global board. Signed-off-by: Katsuhiro Suzuki Signed-off-by: Masahiro Yamada commit af0e09d0c6762e486b0eb5cc4737396964c34fad Author: Viresh Kumar Date: Fri May 25 11:10:06 2018 +0530 arm64: dts: uniphier: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Signed-off-by: Viresh Kumar Signed-off-by: Masahiro Yamada commit 38dc27c85e642cd6229f3a4b2c85128501852158 Author: Viresh Kumar Date: Fri May 25 16:01:51 2018 +0530 ARM: dts: uniphier: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Signed-off-by: Viresh Kumar Signed-off-by: Masahiro Yamada commit 048f31437ac5da336cf08e13f5fdc8add6a9bb16 Author: Eran Ben Elisha Date: Mon Jul 16 18:35:37 2018 -0700 net/mlx5: Fix tristate and description for MLX5 module Current description did not include new devices. Fix that by proving the correct generic description. Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit e2abdcf1d2dd59d7164cf975c50e1587b96b9d04 Author: Tariq Toukan Date: Mon Jul 16 18:35:36 2018 -0700 net/mlx5: Better return types for CQE API Reduce sizes of return types. Use bool for binary indication. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit d34c6efc59a0d714920100b2eba9565bfdcc438d Author: Roi Dayan Date: Mon Jul 16 18:35:35 2018 -0700 net/mlx5: Use ERR_CAST() instead of coding it This makes it more readable that rule is being used to return an err. Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 0f4039104ee61e14ac4771a2181c2a20572f4ec9 Author: Noa Osherovich Date: Mon Jul 16 18:35:34 2018 -0700 net/mlx5: Add missing SET_DRIVER_VERSION command translation When translating command opcodes to a string, SET_DRIVER_VERSION command was missing. Fixes: 42ca502e179d0 ('net/mlx5_core: Use a macro in mlx5_command_str()') Signed-off-by: Noa Osherovich Signed-off-by: Saeed Mahameed commit a451733909bcb78aeeecd3066a9411297b514a0f Author: Max Gurtovoy Date: Mon Jul 16 18:35:33 2018 -0700 net/mlx5: Add XRQ commands definitions Update mlx5 command list and error return function to handle XRQ commands. Signed-off-by: Max Gurtovoy Reviewed-by: Daniel Jurgens Reviewed-by: Artemy Kovalyov Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 8da6fe2a18505b9bd977e573d62d33f836c6903c Author: Jianbo Liu Date: Mon Jul 16 18:35:32 2018 -0700 net/mlx5: Add core support for double vlan push/pop steering action As newer firmware supports double push/pop in a single FTE, we add core bits and extend vlan action logic for it. Signed-off-by: Jianbo Liu Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 5e022dd353b74132bf216a77b169c43e39f5be9e Author: Eran Ben Elisha Date: Mon Jul 16 18:35:31 2018 -0700 net/mlx5: Expose MPEGC (Management PCIe General Configuration) structures This patch exposes PRM layout for handling MPEGC (Management PCIe General Configuration). This will be used in the downstream patch for configuring MPEGC via the driver. Signed-off-by: Eran Ben Elisha Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit eff8ea8f24eac76bc21c25e4ca4ac4ee2dade846 Author: Feras Daoud Date: Mon Jul 16 18:35:30 2018 -0700 net/mlx5: FW tracer, add hardware structures This change adds the infrastructure to mlx5 core fw tracer. It introduces the following 4 new registers: MLX5_REG_MTRC_CAP - Used to read tracer capabilities MLX5_REG_MTRC_CONF - Used to set tracer configurations MLX5_REG_MTRC_STDB - Used to query tracer strings database MLX5_REG_MTRC_CTRL - Used to control the tracer The capability of the tracing can be checked using mcam access register, therefore, the mcam access register interface will expose the tracer register. Signed-off-by: Feras Daoud Signed-off-by: Saeed Mahameed commit 4b4bd04898ad8a315b4a8740ff4909ea995f0c65 Author: Kees Cook Date: Wed Jun 20 11:26:47 2018 -0700 drm/amdgpu/pm: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this uses the maximum sane buffer size and removes copy/paste code. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Reviewed-by: Rex Zhu Signed-off-by: Kees Cook Signed-off-by: Alex Deucher commit 7eb80427746175530f03a00ad5281c4222f17238 Author: Huang Rui Date: Wed Jul 4 18:08:54 2018 +0800 drm/amdgpu: simplify the bo reference on amdgpu_bo_update BO ptr already be initialized at definition, we needn't use the complicated reference. v2: fix typo at subject line Signed-off-by: Huang Rui Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f3cdadb6fee9287d81d2dacd830bd5b439cb7331 Author: Sonny Jiang Date: Tue Jul 17 15:27:20 2018 -0400 drm/amdgpu: remove internal/unused kernel module parameters Remove internal/unused kernel module parameters Signed-off-by: Sonny Jiang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b5286801705b39e44b824520714d503f882fef1c Author: Christian König Date: Mon Jul 16 14:58:48 2018 +0200 drm/amdgpu: change ring priority after pushing the job (v2) Pushing a job can change the ring assignment of an entity. v2: squash in: "drm/amdgpu: fix job priority handling" (Christian) Signed-off-by: Christian König Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher commit 9d46f32bdd3e9d4bf435c5ae50f72fb475bf0620 Author: Christian König Date: Mon Jul 16 13:47:34 2018 +0200 drm/amdgpu: allow for more flexible priority handling Allow to call amdgpu_ring_priority_get() after pushing the ring to the scheduler. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher commit e6d5752080e2d069643d65b0db10c411f6b45412 Author: Feifei Xu Date: Tue Jul 17 14:54:23 2018 +0800 drm/amdgpu/gfx9: Update golden settings for vg10. Add some UTCL registers' golden settings. Signed-off-by: Feifei Xu Tested-by: Kevin Wang Signed-off-by: Alex Deucher commit 0725345e5f05688ae56ca706fcc7aaff9a77313e Merge: d81d25e66a0f 9aee398af347 Author: David S. Miller Date: Wed Jul 18 13:53:48 2018 -0700 Merge branch 'bcm-OF-deps' Florian Fainelli says: ==================== net: Drop OF dependency for some Broadcom drivers This patch series drops the CONFIG_OF dependency that some Broadcom drivers had, this is no longer necessary and goes against allowing build testing on more platforms. Let me know if kbuild or your own builds somehow fail. ==================== Signed-off-by: David S. Miller commit 9aee398af347a298497f1e686864ee00d97e2d1c Author: Florian Fainelli Date: Tue Jul 17 08:42:06 2018 -0700 net: dsa: Drop OF dependency for BCM_SF2 NET_DSA_BCM_SF2 does not need to depend on CONFIG_OF anymore since we have stubs when that option is disabled. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 7f7b7574555e2189135098885208821d0acd4850 Author: Florian Fainelli Date: Tue Jul 17 08:42:05 2018 -0700 net: ethernet: broadcom: Drop dependency on OF Both BCMGENET and SYSTEMPORT build just fine with CONFIG_OF=n, we do have a dependency on HAS_IOMEM that was not being reflected for SYSTEMPORT so add that. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 8be7d96e5b6caa93bf5ed43e4396c402f7cd282a Author: Florian Fainelli Date: Tue Jul 17 08:42:04 2018 -0700 net: phy: Drop OF dependency for MDIO_BCM_UNIMAC The driver builds fine even with CONFIG_OF=n since we now have stubs that are provided. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit d81d25e66a0f218e7d6b6d81b2d57dacf8924195 Author: YueHaibing Date: Tue Jul 17 22:11:23 2018 +0800 tipc: remove unused tipc_group_size After commit eb929a91b213 ("tipc: improve poll() for group member socket"), it is no longer used. Signed-off-by: YueHaibing Acked-by: Jon Maloy Signed-off-by: David S. Miller commit c94b1ac73244ff7eafb1a5df0b1e9c64f1b46113 Author: YueHaibing Date: Tue Jul 17 21:58:46 2018 +0800 tipc: remove unused tipc_link_is_active tipc_link_is_active is no longer used and can be removed. Signed-off-by: YueHaibing Acked-by: Jon Maloy Signed-off-by: David S. Miller commit 74525cc5f5f7c02f02ed356a37af5c0564ad9565 Author: Arnd Bergmann Date: Tue Jul 17 15:46:34 2018 +0200 net: cavium: add missing PCI dependencies While some of the cavium drivers don't require PCI support, most others do, as shown by these build failures: WARNING: unmet direct dependencies detected for MDIO_THUNDER Depends on [n]: NETDEVICES [=y] && MDIO_BUS [=y] && 64BIT [=y] && PCI [=n] Selected by [y]: - THUNDER_NIC_BGX [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_CAVIUM [=y] && 64BIT [=y] - THUNDER_NIC_RGX [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_CAVIUM [=y] && 64BIT [=y] drivers/net/ethernet/cavium/thunder/nicvf_main.c: In function 'nicvf_set_irq_affinity': drivers/net/ethernet/cavium/thunder/nicvf_main.c:1095:25: error: implicit declaration of function 'pci_irq_vector'; did you mean 'rcu_irq_enter'? [-Werror=implicit-function-declaration] drivers/net/ethernet/cavium/thunder/nic_main.c: In function 'nic_mbx_intr_handler': drivers/net/ethernet/cavium/thunder/nic_main.c:1135:13: error: implicit declaration of function 'pci_irq_vector'; did you mean 'rcu_irq_enter'? [-Werror=implicit-function-declaration] In file included from drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c:27: drivers/net/ethernet/cavium/liquidio/octeon_main.h: In function 'octeon_unmap_pci_barx': drivers/net/ethernet/cavium/liquidio/octeon_main.h:97:3: error: implicit declaration of function 'pci_release_region'; did you mean 'pci_release_regions'? [-Werror=implicit-function-declaration] drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c: In function 'octeon_mbox_process_cmd': drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c:263:3: error: implicit declaration of function 'pcie_capability_set_word'; did you mean 'has_capability_noaudit'? [-Werror=implicit-function-declaration] drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c: In function 'setup_cn23xx_octeon_pf_device': drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c:1315:22: error: 'data32' is used uninitialized in this function [-Werror=uninitialized] drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c: In function 'cn23xx_dump_vf_iq_regs': include/linux/dynamic_debug.h:135:3: error: 'regval' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/net/ethernet/cavium/liquidio/lio_core.c: In function 'octeon_setup_interrupt': drivers/net/ethernet/cavium/liquidio/lio_core.c:1067:17: error: invalid application of 'sizeof' to incomplete type 'struct msix_entry' drivers/net/ethernet/cavium/liquidio/octeon_main.h: In function 'octeon_unmap_pci_barx': drivers/net/ethernet/cavium/liquidio/octeon_main.h:97:3: error: implicit declaration of function 'pci_release_region'; did you mean 'pci_release_regions'? [-Werror=implicit-function-declaration] This adds back the minimum set of dependencies to get everything to build cleanly again, but leaving the ones that build cleanly. Fixes: 7e2bc7fb65d5 ("net: cavium: Drop dependency of NET_VENDOR_CAVIUM on PCI") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit a48d189ef53146a8df132a327a637c4182f50a16 Author: Stefano Brivio Date: Tue Jul 17 11:52:57 2018 +0200 net: Move skb decrypted field, avoid explicity copy Commit 784abe24c903 ("net: Add decrypted field to skb") introduced a 'decrypted' field that is explicitly copied on skb copy and clone. Move it between headers_start[0] and headers_end[0], so that we don't need to copy it explicitly as it's copied by the memcpy() in __copy_skb_header(). While at it, drop the assignment in __skb_clone(), it was already redundant. This doesn't change the size of sk_buff or cacheline boundaries. The 15-bits hole before tc_index becomes a 14-bits hole, and will be again a 15-bits hole when this change is merged with commit 8b7008620b84 ("net: Don't copy pfmemalloc flag in __copy_skb_header()"). v2: as reported by kbuild test robot (oops, I forgot to build with CONFIG_TLS_DEVICE it seems), we can't use CHECK_SKB_FIELD() on a bit-field member. Just drop the check for the moment being, perhaps we could think of some magic to also check bit-field members one day. Fixes: 784abe24c903 ("net: Add decrypted field to skb") Signed-off-by: Stefano Brivio Signed-off-by: David S. Miller commit bf20a5c1d56043a0ee4263fbd22ca0f70ba4d09a Author: YueHaibing Date: Tue Jul 17 17:27:13 2018 +0800 liquidio: Using NULL instead of plain integer Fixes the following sparse warnings: drivers/net/ethernet/cavium/liquidio/lio_main.c:3068:23: warning: Using plain integer as NULL pointer drivers/net/ethernet/cavium/liquidio/lio_main.c:2909:23: warning: Using plain integer as NULL pointer drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c:385:27: warning: Using plain integer as NULL pointer Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 6060d9d24e6d7c7959d0db8cd9f511cf43c409d9 Author: Arnd Bergmann Date: Tue Jul 17 15:49:48 2018 +0200 net/mlx5: fix an unused-function warning These dummy helpers are all intended to be inline functions, but one of them by accident came without the 'inline' keyword, causing a harmless warning: In file included from drivers/net/ethernet/mellanox/mlx5/core/main.c:63: drivers/net/ethernet/mellanox/mlx5/core/accel/tls.h:79:1: error: 'mlx5_accel_tls_add_flow' defined but not used [-Werror=unused-function] mlx5_accel_tls_add_flow(struct mlx5_core_dev *mdev, void *flow, Fixes: ab412e1dd7db ("net/mlx5: Accel, add TLS rx offload routines") Signed-off-by: Arnd Bergmann Acked-by: Saeed Mahameed Signed-off-by: David S. Miller commit 202aabe84a8fd809e8f401bc05e20f35a5102ece Author: Jakub Kicinski Date: Mon Jul 16 19:08:50 2018 -0700 xdp: fix uninitialized 'err' variable Smatch caught an uninitialized variable error which GCC seems to miss. Fixes: a25717d2b604 ("xdp: support simultaneous driver and hw XDP attachment") Signed-off-by: Jakub Kicinski Acked-by: Daniel Borkmann Signed-off-by: David S. Miller commit 5edb65a33710bbf10f38b42e0d497b35ec1ed908 Author: Johan Hovold Date: Wed Jul 18 14:25:01 2018 +0200 USB: serial: cp210x: improve line-speed handling for CP2104 and CP2105 CP2104 and the ECI interface of CP2105 support further baud rates than the ones specified in AN205 table 1, and we can use the same equations as for CP2102N to determine and report back the actual baud rates used. Note that this could eventually be generalised also to CP2108, which uses a different base clock. There appears to be an error in the CP2108 equations which needs to be confirmed on actual hardware first however (specifically, the subtraction of one from the divisor appears to be incorrect as it introduces larger errors). Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 7aecd7fc5d95f1447611ab5e14db5ab9549f979c Author: Johan Hovold Date: Wed Jul 18 14:25:00 2018 +0200 USB: serial: cp210x: generalise CP2102N line-speed handling The CP2102N equations for determining the actual baud rate can be used also for other device types, so let's factor it out. Note that this removes the now unused cp210x_is_cp2102n() helper. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 6f0bcf720ea81e90e6066d14d5506565049a2eb5 Author: Karoly Pados Date: Wed Jul 18 14:24:59 2018 +0200 USB: serial: cp210x: improve baudrate support for CP2102N CP2102N devices support a lot more baudrates than earlier chips by SiLabs. These devices are not constrained anymore by the table in AN205, and are able to generate almost any baudrate in the supported range with only minimal errors. This has also been verified with a scope on a physical device. This patch adds support for all baudrates supported by the CP2102N. Signed-off-by: Karoly Pados [johan: rework on top of an205 and max-speed patches ] Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit d4706c05c59d7afdadd8e7cfc1bf470356938c89 Author: Johan Hovold Date: Wed Jul 18 14:24:58 2018 +0200 USB: serial: cp210x: honour device-type maximum line speed Newer cp210x devices support higher line speeds than the older ones which supported a discrete set of speeds up to 921.6 kbaud. To support these higher speeds, we have for some time mapped speeds lower than 1 Mbaud to the speeds supported by older devices, while allowing the device to pick the closest possible rate for higher speeds (without trying to guess and report back what rate was actually chosen). As this implementation can lead to undefined behaviour for older devices which do not support the higher rates, let's use the later-added device-type detection to determine the maximum supported speed. This will also be useful when adding support for cp2102n which can handle rates up to 3 Mbaud. As per the data sheets the following maximum speeds are used cp2101 921.6 kbaud cp2102/3 1 Mbaud cp2104/8 2 Mbaud cp2105 - ECI port 2 Mbaud - SCI port 921.6 kbaud while keeping the maximum 2 Mbaud for unknown device types in order to avoid any regressions. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 95fd4f47c857cf887ec0f6718ffb6a6ec3b62bd6 Author: Johan Hovold Date: Wed Jul 18 14:24:57 2018 +0200 USB: serial: cp210x: make line-speed quantisation data driven Older cp210x devices only support a fixed set of line speeds to which a requested speed is mapped. Reimplement this mapping using a table instead of a long if-else construct. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 5fd9df6ac6eec9d6c7feaf114690bbeac7f13168 Author: Rodrigo Vivi Date: Thu Jul 5 12:25:28 2018 -0700 drm/i915: Kill sink_crc for good It was originally introduced following the VESA spec in order to validate PSR. However we found so many issues around sink_crc that instead of helping PSR development it only brought another layer of trouble to the table. So, sink_crc has been a black whole for us in question of time, effort and hope. First of the problems is that HW statement is clear: "Do not attempt to use aux communication with PSR enabled". So the main reason behind sink_crc is already compromised. For a while we had hope on the aux-mutex could workaround this problem on SKL+ platforms, but that mutex was not reliable, not tested, and we shouldn't use according to HW engineers. Also, nor source, nor sink designed and implemented the sink_crc to be used like we are trying to use here. Well, the sink side of things is also apparently not prepared for this case. Each panel that we tried seemed to have a different behavior with same code and same source. So, for all the time we lost on trying to ducktape all these different issues I believe it is now time to move PSR to a more reliable validation. Maybe not a perfect one as we dreamed for this sink_crc, but at least more reliable. Cc: Dhinakaran Pandiyan Cc: Daniel Vetter Signed-off-by: Rodrigo Vivi Reviewed-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180705192528.30515-1-rodrigo.vivi@intel.com commit 539c475dadc430bd0f1601902fcacc1e55ffe85a Merge: 0c2fd59ae315 82edc7e8b8c0 Author: Dave Airlie Date: Thu Jul 19 05:46:24 2018 +1000 Merge tag 'drm-intel-next-2018-07-09' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Higlights here goes to many PSR fixes and improvements; to the Ice lake work with power well support and begin of DSI support addition. Also there were many improvements on execlists and interrupts for minimal latency on command submission; and many fixes on selftests, mostly caught by our CI. General driver: - Clean-up on aux irq (Lucas) - Mark expected switch fall-through for dealing with static analysis tools (Gustavo) Gem: - Different fixes for GuC (Chris, Anusha, Michal) - Avoid self-relocation BIAS if no relocation (Chris) - Improve debugging cases in on EINVAL return and vma allocation (Chris) - Fixes and improvements on context destroying and freeing (Chris) - Wait for engines to idle before retiring (Chris) - Many improvements on execlists and interrupts for minimal latency on command submission (Chris) - Many fixes in selftests, specially on cases highlighted on CI (Chris) - Other fixes and improvements around GGTT (Chris) - Prevent background reaping of active objects (Chris) Display: - Parallel modeset cleanup to fix driver reset (Chris) - Get AUX power domain for DP main link (Imre) - Clean-up on PSR unused func pointers (Rodrigo) - Many PSR/PSR2 fixes and improvements (DK, Jose, Tarun) - Add a PSR1 live status (Vathsala) - Replace old drm_*_{un/reference} with put,get functions (Thomas) - FBC fixes (Maarten) - Abstract and document the usage of picking macros (Jani) - Remove unnecessary check for unsupported modifiers for NV12. (DK) - Interrupt fixes for display (Ville) - Clean up on sdvo code (Ville) - Clean up on current DSI code (Jani) - Remove support for legacy debugfs crc interface (Maarten) - Simplify get_encoder_power_domains (Imre) Icelake: - MG PLL fixes (Imre) - Add hw workaround for alpha blending (Vandita) - Add power well support (Imre) - Add Interrupt Support (Anusha) - Start to add support for DSI on Ice Lake (Madhav) Signed-off-by: Dave Airlie # gpg: Signature made Tue 10 Jul 2018 08:41:37 AM AEST # gpg: using RSA key FA625F640EEB13CA # gpg: Good signature from "Rodrigo Vivi " # gpg: aka "Rodrigo Vivi " # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6D20 7068 EEDD 6509 1C2C E2A3 FA62 5F64 0EEB 13CA Link: https://patchwork.freedesktop.org/patch/msgid/20180710234349.GA16562@intel.com commit 0c2fd59ae315e28f8868edf80df21a502f933fec Merge: 54c88a029a0a 57c7f5811180 Author: Dave Airlie Date: Thu Jul 19 05:33:44 2018 +1000 Merge branch 'mediatek-drm-next-4.19' of https://github.com/ckhu-mediatek/linux.git-tags into drm-next This include MT2712 SoC support and removing struct mtk_drm_fb. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/1531204482.14433.6.camel@mtksdaap41 commit 54c88a029a0a86fe00a0ee7d2a15ee08e6d04db9 Merge: b861686b1853 ae61f61fa802 Author: Dave Airlie Date: Thu Jul 19 05:13:14 2018 +1000 Merge tag 'drm-misc-next-2018-07-11' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 4.19: Cross-subsystem Changes: - many dt-bindings Doc changes Core Changes: - Encoder clean ups (Ville Syrjälä) - Connector Writeback improvements(Boris Brezillon) - Fake vblank support (Boris Brezillon) - API for in-kernel clients (Noralf Trønnes) - improvements to the path of finding panels(Boris Brezillon) Driver Changes: - initial support for the virtual display driver - vkms(Haneen Mohammed and Rodrigo Siqueira) - panel: add Rocktech RK070ER9427 LCD support (Jagan Teki) - panel: add support for the EDT ETM0700G0EDH6 and EDT ETM0700G0BDH6(Jan Tuerk) - panel: add DLC DLC0700YZG-1 (Philipp Zabel) - panel: add support for BOE HV070WSA-100 (Andrzej Hajda) - panel: add newhaven, nhd-4.3-480272ef-atxl LCD (Tomi Valkeinen) - panel: add support for Innolux G070Y2-L01 (Christoph Fritz) - panel: add support for DataImage SCF0700C48GGU18 (Michal Vokáč) - panel: add support for Sharp LQ035Q7DB03 (Vladimir Zapolskiy) - panel: p079zca: Refactor panel driver to support multiple panels (Lin Huang) - sun4i: Add R40 display engine compatible(Jernej Skrabec) Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180712011137.GA26620@juma commit d0a064bec75e20a526c7bc0d626912f2660b6e81 Author: Nishanth Menon Date: Tue Jun 26 11:26:15 2018 -0500 arm64: dts: ti: Add support for AM654 EVM base board The EValuation Module(EVM) platform for AM654 consists of a common Base board + one or more of daughter cards, which include: a) "Personality Modules", which can be specific to a profile, such as ICSSG enabled or Multi-media (including audio). b) SERDES modules, which may be 2 lane PCIe or two port PCIe + USB2 c) Camera daughter card d) various display panels Among other options. There are two basic configurations defined which include an "EVM" configuration and "IDK" (Industrial development kit) which differ in the specific combination of daughter cards that are used. To simplify support, we choose to support just the base board as the core device tree file and all daughter cards would be expected to be device tree overlays. Reviewed-by: Tony Lindgren Signed-off-by: Lokesh Vutla Signed-off-by: Nishanth Menon Signed-off-by: Tony Lindgren commit a869b7b30dac5a1a9bec21150c5fded3c2c62af7 Author: Nishanth Menon Date: Tue Jun 26 11:26:14 2018 -0500 soc: ti: Add Support for AM654 SoC config option Add option to build AM6 SoC specific components Reviewed-by: Tony Lindgren Signed-off-by: Benjamin Fair Signed-off-by: Nishanth Menon Signed-off-by: Tony Lindgren commit ea47eed33a3fe3d919e6e3cf4e4eb5507b817188 Author: Nishanth Menon Date: Tue Jun 26 11:26:13 2018 -0500 arm64: dts: ti: Add Support for AM654 SoC The AM654 SoC is a lead device of the K3 Multicore SoC architecture platform, targeted for broad market and industrial control with aim to meet the complex processing needs of modern embedded products. Some highlights of this SoC are: * Quad ARMv8 A53 cores split over two clusters * GICv3 compliant GIC500 * Configurable L3 Cache and IO-coherent architecture * Dual lock-step capable R5F uC for safety-critical applications * High data throughput capable distributed DMA architecture under NAVSS * Three Gigabit Industrial Communication Subsystems (ICSSG), each with dual PRUs and dual RTUs * Hardware accelerator block containing AES/DES/SHA/MD5 called SA2UL * Centralized System Controller for Security, Power, and Resource management. * Dual ADCSS, eQEP/eCAP, eHRPWM, dual CAN-FD * Flash subsystem with OSPI and Hyperbus interfaces * Multimedia capability with CAL, DSS7-UL, SGX544, McASP * Peripheral connectivity including USB3, PCIE, MMC/SD, GPMC, I2C, SPI, GPIO See AM65x Technical Reference Manual (SPRUID7, April 2018) for further details: http://www.ti.com/lit/pdf/spruid7 NOTE: 1. AM654 is the first of the device variants, hence we introduce a generic am65.dtsi. 2. We indicate the proper bus topology, the ranges are elaborated in each bus segment instead of using the top level ranges to make sure that peripherals in each segment use the address space accurately. 3. Peripherals in each bus segment is maintained in a separate dtsi allowing for reuse in different bus segment representation from a different core such as R5. This is also the reason for maintaining a 1-1 address map in the ranges. 4. Cache descriptions follow the ARM64 standard description. Further tweaks may be necessary as we introduce more complex devices, but can be introduced in context of the device introduction. Reviewed-by: Tony Lindgren Signed-off-by: Benjamin Fair Signed-off-by: Nishanth Menon Signed-off-by: Tony Lindgren commit c77245722fb47e45db22f053d449c030d3038dde Author: Nishanth Menon Date: Tue Jun 26 11:26:12 2018 -0500 arm64: Add support for TI's K3 Multicore SoC architecture Add support for Texas Instrument's K3 Multicore SoC architecture processors. Reviewed-by: Tony Lindgren Signed-off-by: Nishanth Menon Signed-off-by: Tony Lindgren commit ad527a91cb1d1a43734f51acd49e5a1f8ec67682 Author: Nishanth Menon Date: Tue Jun 26 11:26:11 2018 -0500 dt-bindings: arm: ti: Add bindings for AM654 SoC The AM654 SoC is a lead device of the K3 Multicore SoC architecture platform, targeted for broad market and industrial control with aim to meet the complex processing needs of modern embedded products. Some highlights of this SoC are: * Quad ARMv8 A53 cores split over two clusters * GICv3 compliant GIC500 * Configurable L3 Cache and IO-coherent architecture * Dual lock-step capable R5F uC for safety-critical applications * High data throughput capable distributed DMA architecture under NAVSS * Three Gigabit Industrial Communication Subsystems (ICSSG), each with dual PRUs and dual RTUs * Hardware accelerator block containing AES/DES/SHA/MD5 called SA2UL * Centralized System Controller for Security, Power, and Resource management. * Dual ADCSS, eQEP/eCAP, eHRPWM, dual CAN-FD * Flash subsystem with OSPI and Hyperbus interfaces * Multimedia capability with CAL, DSS7-UL, SGX544, McASP * Peripheral connectivity including USB3, PCIE, MMC/SD, GPMC, I2C, SPI, GPIO See AM65x Technical Reference Manual (SPRUID7, April 2018) for further details: http://www.ti.com/lit/pdf/spruid7 Reviewed-by: Tony Lindgren Signed-off-by: Nishanth Menon Reviewed-by: Rob Herring Signed-off-by: Tony Lindgren commit e146471f588e4b8dcd7994036c1b47cc52325f00 Author: Gustavo A. R. Silva Date: Wed Jul 18 08:08:46 2018 -0500 net: mvpp2: debugfs: fix incorrect bitwise operator The use of the | operator always leads to true, which looks rather suspect in this case. Fix this by using & instead. Addresses-Coverity-ID: 1471903 ("Wrong operator used") Fixes: dba1d918da02 ("net: mvpp2: debugfs: add entries for classifier flows") Signed-off-by: Gustavo A. R. Silva Acked-by: Maxime Chevallier Signed-off-by: David S. Miller commit fa145d5dfd612ac318a1eb4b443af55e0f5c8ba7 Author: Ganesh Goudar Date: Wed Jul 18 17:36:12 2018 +0530 cxgb4: display number of rx and tx pages free display free rx and tx page count in the meminfo of an adapter. Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 2b6e68119c474a62396b387130a984ad8240dce2 Author: Matti Vaittinen Date: Wed Jul 18 16:40:46 2018 +0000 Input: gpio_keys - add missing include to gpio_keys.h gpio_keys.h uses 'bool' - type which is defined in linux/types.h. Include this header. Signed-off-by: Matti Vaittinen Signed-off-by: Dmitry Torokhov commit 98e60dce4da1f51afb239e9fea8f3c4705193a97 Merge: c0b78038a847 c3ab435466d5 Author: David S. Miller Date: Thu Jul 19 02:13:14 2018 +0900 Merge branch 'mlxsw-Introduce-initial-Spectrum-2-support' Ido Schimmel says: ==================== mlxsw: Introduce initial Spectrum-2 support This patch set adds initial support for the Spectrum-2 ASIC. The first two patches add Spectrum-2 specific KVD linear (KVDL) manager. Unlike the Spectrum ASIC, there is no linear memory and instead the type of the entry (e.g., nexthop) and its index are hashed and the entry is placed in the computed address in the hash-based KVD memory. The third patch adds Spectrum-2 stubs in the multicast routing code. Support for multicast routing will be added later on. Patches 4-15 add ACL support. The Spectrum-2 ASIC includes an algorithmic TCAM (A-TCAM) and a regular circuit TCAM (C-TCAM) for rules that can't be inserted into the A-TCAM. This set does not make use of the A-TCAM and only places rules in the C-TCAM. This provides equivalent scale and performance to the Spectrum ASIC. A follow-up patch set will introduce A-TCAM support. The last patch extends the main driver file to work with both ASICs. ==================== Signed-off-by: David S. Miller commit c3ab435466d5109b2c7525a3b90107d4d9e918fc Author: Jiri Pirko Date: Wed Jul 18 11:14:45 2018 +0300 mlxsw: spectrum: Extend to support Spectrum-2 ASIC Extend existing driver for Spectrum ASIC to support Spectrum-2 ASIC. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 9912e6b8c256d0f08180e7d4f141c0c39d41f329 Author: Jiri Pirko Date: Wed Jul 18 11:14:44 2018 +0300 mlxsw: spectrum_acl: Add initial Spectrum-2 ACL implementation Utilize only C-TCAM for now. Do very minimal A-TCAM initialization in order to make C-TCAM work. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a6b9c87daf5d1de84d915edb9f240276269df1f2 Author: Ido Schimmel Date: Wed Jul 18 11:14:43 2018 +0300 mlxsw: spectrum_acl: Add region association callback In Spectrum-2, ACL regions that use 8 or 12 key blocks require several consecutive hardware regions. In order to allow defragmentation, the device stores a mapping from a logical region ID to an hardware region ID, which is similar to the page table that is used to translate virtual addresses to physical addresses. Add the region association callback to the region create sequence and implement it as a NOP in Spectrum which does not require it. Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 7a921a1e585a846e039239238aaec0a516477e14 Author: Ido Schimmel Date: Wed Jul 18 11:14:42 2018 +0300 mlxsw: spectrum_acl: Add support for Spectrum-2 block encoding Encode each flexible key block in the general block scheme according its block index. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a6d70a878ed862470e8c0f96f3f3cf41a47077af Author: Ido Schimmel Date: Wed Jul 18 11:14:41 2018 +0300 mlxsw: spectrum_acl: Prepare for Spectrum-2 block encoding In Spectrum the key (and mask) block layout is very straight forward and every block is 16 bytes aligned. However, in Spectrum-2 the blocks are not even byte aligned, which makes it difficult to encode them using current method. Instead, first encode each block and then encode the block in the general blocks layout. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 7050f439ef6a04daf16f20f8fe5d2d5a4d141992 Author: Ido Schimmel Date: Wed Jul 18 11:14:40 2018 +0300 mlxsw: reg: Add Policy-Engine General Configuration Register The PGCR register configures general Policy-Engine settings. Specifically, we are going to use it in order to set the default action base pointer, which determines where the default action (when there is no hit) is located for each region. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f1c7d9cce2a8ec3d6223a2d7b16c6a9c00c52deb Author: Ido Schimmel Date: Wed Jul 18 11:14:39 2018 +0300 mlxsw: reg: Add Policy-Engine Region eRP Register The PERERP register configures the region eRPs. It can be used, for example, to enable lookup in the C-TCAM in addition to the A-TCAM. To be able to perform a lookup in the C-TCAM we need to "use" the eRP table. This is done by marking the pointer as valid, but zeroing the eRP table vector. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 481662a8a33645cd0c6568c21759f9ce39266c7f Author: Ido Schimmel Date: Wed Jul 18 11:14:38 2018 +0300 mlxsw: reg: Add Policy-Engine Region Configuration Register The PERCR register configures the region parameters such as whether to consult the bloom filter before performing a lookup using a specific eRP. For C-TCAM only usage we don't need to accurately set the master mask. Instead, we can set all of its bits to make sure all the extracted keys are actually used. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 3390787b61d85bdc793bd5f42642525dc24684ad Author: Jiri Pirko Date: Wed Jul 18 11:14:37 2018 +0300 mlxsw: reg: Add Policy-Engine Region Association Register The PERAR register is used to associate a hw region for region_id's. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0f27e80aea6e51b69e618ac7d977d55007c13f7d Author: Jiri Pirko Date: Wed Jul 18 11:14:36 2018 +0300 mlxsw: acl: Introduce activity get operation for action block/set In Spectrum-2, activity cannot be find out by TCAM rule (PTCEv2 register), but rather by associated action set. For that purpose, extend action ops to allow query activity from PEFA register. Block activity is decided according to activity of the first set. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 2d186ed4ddfd3a20b529d7bec43c30a7a0bbdd3b Author: Jiri Pirko Date: Wed Jul 18 11:14:35 2018 +0300 mlxsw: reg: Add support for activity information from PEFA register In Spectrum-2, the PEFA register is extend to report if the action set was hit during processing of packets. Introduce this extension and adjust the code around this accordingly. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit dcdf01028efa4c72d442f029e9bde449d7e7bc4a Author: Jiri Pirko Date: Wed Jul 18 11:14:34 2018 +0300 mlxsw: spectrum: Introduce flex key blocks for Spectrum-2 Introduce key blocks for Spectrum-2 that contains the same elements used already for Spectrum1. Along with that, introduce encoder stub. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d55ece4b6e9ec39a9bcac82f1ae29a106c7bbbfb Author: Jiri Pirko Date: Wed Jul 18 11:14:33 2018 +0300 mlxsw: spectrum: Add Spectrum-2 variant of flex actions ops In Spectrum-2, no action set is stored directly in TCAM, all are located in KVD linear. So ask core to treat the first set as dummy empty one, to be just used for PTCEV2 purposes. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 18ce0e4e6616d0c8c15aad998e1bda42247e42f1 Author: Jiri Pirko Date: Wed Jul 18 11:14:32 2018 +0300 mlxsw: spectrum_mr_tcam: Add Spectrum-2 stubs Add dummy ops for now. The ops are going to be implemented later on. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 742f75a600cab552482f1b17449ba528584f65de Author: Jiri Pirko Date: Wed Jul 18 11:14:31 2018 +0300 mlxsw: spectrum: Add KVDL manager implementation for Spectrum-2 In Spectrum-2, KVD linear indexes are hashed into KVD hash. Therefore it is possible for multiple resource types to use same indexes. There are multiple index spaces. Also, the index space is bigger than the actual KVD hash area, which allows to have holes in the index space without any penalization. The HW has to be told in case the index for particular resource type is no longer used so it can be freed from KVD hash. IEDR register is used for that. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c33d0cb1922e2914de91a293f3aa253e9f9aa585 Author: Jiri Pirko Date: Wed Jul 18 11:14:30 2018 +0300 mlxsw: reg: Add Infrastructure Entry Delete Register The IEDR register is used for deleting entries from the entry tables. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a150c1fe3809d4487c6fa22fa882904a11ecf426 Author: Fabio Estevam Date: Tue Jul 17 04:06:00 2018 +0000 Input: egalax_ts - switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Dmitry Torokhov commit 979c11ef39cee79d6f556091a357890962be2580 Author: Ayan Kumar Halder Date: Tue Jul 17 18:13:46 2018 +0100 drm/sun4i: Substitute sun4i_backend_format_is_yuv() with format->is_yuv drm_format_info table has a field 'is_yuv' to denote if the format is yuv or not. The driver is expected to use this instead of having a function for the same purpose. Signed-off-by: Ayan Kumar halder Reviewed-by: Ville Syrjala Link: https://patchwork.freedesktop.org/patch/msgid/1531847626-22248-5-git-send-email-ayan.halder@arm.com commit d8bd23d9936bea7184a2bce1242ea646f4906d7d Author: Ayan Kumar Halder Date: Tue Jul 17 18:13:44 2018 +0100 drm/rockchip: Substitute is_yuv_support() with format->is_yuv drm_format_info table has a field 'is_yuv' to denote if the format is yuv or not. The driver is expected to use this instead of having a function for the same purpose. Signed-off-by: Ayan Kumar halder Reviewed-by: Ville Syrjala Link: https://patchwork.freedesktop.org/patch/msgid/1531847626-22248-3-git-send-email-ayan.halder@arm.com commit 9bace65934e74d47e467c44765e6a202c302fe7a Author: Ayan Kumar Halder Date: Tue Jul 17 18:13:43 2018 +0100 drm/i915: Substitute intel_format_is_yuv() with format->is_yuv drm_format_info table has a field 'is_yuv' to denote if the format is yuv or not. The driver is expected to use this instead of having a function for the same purpose. Signed-off-by: Ayan Kumar halder Reviewed-by: Ville Syrjala Link: https://patchwork.freedesktop.org/patch/msgid/1531847626-22248-2-git-send-email-ayan.halder@arm.com commit ce2d54619a10780a0d354e10d4c83ae4fad46f41 Author: Ayan Kumar Halder Date: Tue Jul 17 18:13:42 2018 +0100 drm/fourcc: Add is_yuv field to drm_format_info to denote if the format is yuv A lot of drivers duplicate the function to check if a format is yuv or not. If we add a field (to denote whether the format is yuv or not) in the drm_format_info table, all the drivers can use this field and it will prevent duplication of similar logic. Signed-off-by: Ayan Kumar halder Reviewed-by: Ville Syrjala Link: https://patchwork.freedesktop.org/patch/msgid/1531847626-22248-1-git-send-email-ayan.halder@arm.com commit 3de0a6b986d5b71984a3d81e848f375240b83aac Merge: 28f6f7295fe1 cc4493faf494 Author: Olof Johansson Date: Wed Jul 18 08:53:22 2018 -0700 Merge tag 'hisi-defconfig-for-4.19' of git://github.com/hisilicon/linux-hisi into next/defconfig ARM64: hisilicon: defconfig updates for 4.18 - Enable uncore pmu for some hisilicon SoCs * tag 'hisi-defconfig-for-4.19' of git://github.com/hisilicon/linux-hisi: arm64: defconfig: enable HiSilicon PMU driver Signed-off-by: Olof Johansson commit baa2a4fdd525c8c4b0f704d20457195b29437839 Author: Ronny Chevalier Date: Wed Jul 11 14:39:37 2018 +0200 audit: fix use-after-free in audit_add_watch audit_add_watch stores locally krule->watch without taking a reference on watch. Then, it calls audit_add_to_parent, and uses the watch stored locally. Unfortunately, it is possible that audit_add_to_parent updates krule->watch. When it happens, it also drops a reference of watch which could free the watch. How to reproduce (with KASAN enabled): auditctl -w /etc/passwd -F success=0 -k test_passwd auditctl -w /etc/passwd -F success=1 -k test_passwd2 The second call to auditctl triggers the use-after-free, because audit_to_parent updates krule->watch to use a previous existing watch and drops the reference to the newly created watch. To fix the issue, we grab a reference of watch and we release it at the end of the function. Signed-off-by: Ronny Chevalier Reviewed-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 67ece13ffe862f9d17a144c6cd3feef88a57db13 Merge: fa84cf094ef9 4aaf448fa975 Author: Takashi Iwai Date: Wed Jul 18 17:42:34 2018 +0200 Merge branch 'topic/vga_switcheroo' into for-next Pull the vga_switcheroo audio client fix. Signed-off-by: Takashi Iwai commit 28f6f7295fe14d5fb8a204881bd382edeb06401e Merge: 6783a9e0b417 b4645695a9dc Author: Olof Johansson Date: Wed Jul 18 08:38:53 2018 -0700 Merge tag 'mvebu-defconfig-4.19-1' of git://git.infradead.org/linux-mvebu into next/defconfig mvebu defconfig for 4.19 (part 1) - add NAND controller on multi_v7 - add SFP support on mvebu_v7 * tag 'mvebu-defconfig-4.19-1' of git://git.infradead.org/linux-mvebu: ARM: mvebu_v7_defconfig: enable SFP support ARM: mvebu_v7_defconfig: sync defconfig ARM: multi_v7_defconfig: Add Marvell NAND controller support Signed-off-by: Olof Johansson commit 07167d8a4ec89f8e140a6a3bf9e42d32ea10622f Merge: 380d68592351 77bc8c28ddac Author: Olof Johansson Date: Wed Jul 18 08:36:21 2018 -0700 Merge tag 'mvebu-arm-4.19-1' of git://git.infradead.org/linux-mvebu into next/soc mvebu arm for 4.19 (part 1) - remove potential call from invalid context in boot_secondary - allow using CONFIG_FORTIFY_SOURCE in pmsu.c * tag 'mvebu-arm-4.19-1' of git://git.infradead.org/linux-mvebu: ARM: mvebu: convert secondary CPU clock sync to hotplug state ARM: mvebu: declare asm symbols as character arrays in pmsu.c Signed-off-by: Olof Johansson commit b4645695a9dca5bbdcb9d6133731d661d2a3c4fb Author: Baruch Siach Date: Thu Jun 28 10:06:15 2018 +0300 ARM: mvebu_v7_defconfig: enable SFP support This enables support for SFP cages on SolidRun Armada 38x platforms. Signed-off-by: Baruch Siach Signed-off-by: Gregory CLEMENT commit 3aadb7f52dfc98832c11aa30db2e0cd8ff4c1057 Author: Baruch Siach Date: Thu Jun 28 10:06:14 2018 +0300 ARM: mvebu_v7_defconfig: sync defconfig Use savedefconfig to sync defconfig for current kernel. No change in generated configuration. Signed-off-by: Baruch Siach Signed-off-by: Gregory CLEMENT commit c841436dfabfadd31177e2fc570b16de95b97f0b Author: Gregory CLEMENT Date: Mon May 28 17:13:57 2018 +0200 ARM: multi_v7_defconfig: Add Marvell NAND controller support Add Marvell NAND controller support used by some Marvell Armada based boards. Signed-off-by: Gregory CLEMENT commit 50fa3cd33f9ddcd870dd367381c514a2ef038444 Author: Yong Wu Date: Thu May 24 20:35:31 2018 +0800 dt-bindings: mediatek: Add binding for mt2712 IOMMU and SMI This patch adds decriptions for mt2712 IOMMU and SMI. In order to balance the bandwidth, mt2712 has two M4Us, two smi-commons, 10 smi-larbs. and mt2712 is also MTK IOMMU gen2 which uses ARM Short-Descriptor translation table format. The mt2712 M4U-SMI HW diagram is as below: EMI | ------------------------------------ | | M4U0 M4U1 | | smi-common0 smi-common1 | | ------------------------- -------------------------------- | | | | | | | | | | | | | | | | | | | | larb0 larb1 larb2 larb3 larb6 larb4 larb5 larb7 larb8 larb9 disp0 vdec cam venc jpg mdp1/disp1 mdp2/disp2 mdp3 vdo/nr tvd All the connections are HW fixed, SW can NOT adjust it. Signed-off-by: Yong Wu Acked-by: Rob Herring Signed-off-by: Matthias Brugger commit 7c201ead1bfd19935f689fca69100c335028c047 Author: David Lechner Date: Mon Jul 16 22:20:49 2018 -0500 spi: spi-bitbang: change flags from u8 to u16 This changes the data type of the flags field in struct spi_bitbang from u8 to u16. This matches the size of the mode field of struct spi_device where these flags are also used. This is done in preparation of adding a new SPI mode flag that will be used with this field that would otherwise not fit in 8 bits. Signed-off-by: David Lechner Signed-off-by: Mark Brown commit 380d685923515ce75e90697539ee6b24b35350c0 Merge: ce8403d45543 cbc654c88178 Author: Olof Johansson Date: Wed Jul 18 07:50:50 2018 -0700 Merge tag 'pxa-for-4.19-v2' of https://github.com/rjarzmik/linux into next/soc This is the pxa changes for 4.19 cycle : - the pxa architecture is ported to dma slavemap - some minor AC97 fixes - some minor board fixes * tag 'pxa-for-4.19-v2' of https://github.com/rjarzmik/linux: net: smc91x: remove the dmaengine compat need net: smc911x: remove the dmaengine compat need ARM: pxa: zylonite: use the new ac97 bus support ARM: pxa: add the missing AC97 clocks ARM: pxa: mioa701 convert to the new AC97 bus ARM: pxa: hx4700: fix the usb client ARM: pxa: change SSP DMA channels allocation ARM: pxa: remove the DMA IO resources dmaengine: pxa: document pxad_param ata: pata_pxa: remove the dmaengine compat need mtd: rawnand: marvell: remove the dmaengine compat need media: pxa_camera: remove the dmaengine compat need mmc: pxamci: remove the dmaengine compat need dmaengine: pxa: add a default requestor policy ARM: pxa: add dma slave map dmaengine: pxa: use a dma slave map Signed-off-by: Olof Johansson commit e594a0636b0213d058aec2406e13f276b70791ed Merge: e76ad18b5677 bcf7eac3d97f Author: Mark Brown Date: Wed Jul 18 15:47:54 2018 +0100 Merge tag 'regmap-sccb' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-4.19 regmap: Add support for SCCB This is an I2C subset. commit 6c6bc9ea84d0008024606bf5ba10519e20d851bf Author: Jann Horn Date: Sat Jul 7 05:37:22 2018 +0200 mtdchar: fix overflows in adjustment of `count` The first checks in mtdchar_read() and mtdchar_write() attempt to limit `count` such that `*ppos + count <= mtd->size`. However, they ignore the possibility of `*ppos > mtd->size`, allowing the calculation of `count` to wrap around. `mtdchar_lseek()` prevents seeking beyond mtd->size, but the pread/pwrite syscalls bypass this. I haven't found any codepath on which this actually causes dangerous behavior, but it seems like a sensible change anyway. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jann Horn Signed-off-by: Boris Brezillon commit bcf7eac3d97f49d8400ba52c71bee5934bf20093 Author: Akinobu Mita Date: Tue Jul 17 00:47:48 2018 +0900 regmap: add SCCB support This adds Serial Camera Control Bus (SCCB) support for regmap API that is intended to be used by some of Omnivision sensor drivers. The ov772x and ov9650 drivers are going to use this SCCB regmap API. The ov772x driver was previously only worked with the i2c controller drivers that support I2C_FUNC_PROTOCOL_MANGLING, because the ov772x device doesn't support repeated starts. After commit 0b964d183cbf ("media: ov772x: allow i2c controllers without I2C_FUNC_PROTOCOL_MANGLING"), reading ov772x register is replaced with issuing two separated i2c messages in order to avoid repeated start. Using this SCCB regmap hides the implementation detail. The ov9650 driver also issues two separated i2c messages to read the registers as the device doesn't support repeated start. So it can make use of this SCCB regmap. Cc: Mark Brown Cc: Peter Rosin Cc: Sebastian Reichel Cc: Wolfram Sang Cc: Sylwester Nawrocki Cc: Jacopo Mondi Cc: Laurent Pinchart Cc: Hans Verkuil Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita Signed-off-by: Mark Brown commit 636620b66d5d4012c4a9c86206013964d3986c4f Author: Tejun Heo Date: Wed Jul 18 04:47:41 2018 -0700 blkcg: Track DISCARD statistics and output them in cgroup io.stat Add tracking of REQ_OP_DISCARD ios to the per-cgroup io.stat. Two fields, dbytes and dios, to respectively count the total bytes and number of discards are added. Signed-off-by: Tejun Heo Cc: Andy Newell Cc: Michael Callahan Signed-off-by: Jens Axboe commit bdca3c87fb7ad1cc61d231d37eb0d8f90d001e0c Author: Michael Callahan Date: Wed Jul 18 04:47:40 2018 -0700 block: Track DISCARD statistics and output them in stat and diskstat Add tracking of REQ_OP_DISCARD ios to the partition statistics and append them to the various stat files in /sys as well as /proc/diskstats. These are tracked with the same four stats as reads and writes: Number of discard ios completed. Number of discard ios merged Number of discard sectors completed Milliseconds spent on discard requests This is done via adding a new STAT_DISCARD define to genhd.h and then using it to index that stat field for discard requests. tj: Refreshed on top of v4.17 and other previous updates. Signed-off-by: Michael Callahan Signed-off-by: Tejun Heo Cc: Andy Newell Signed-off-by: Jens Axboe commit ddcf35d397976421a4ec1d0d00fbcc027a8cb034 Author: Michael Callahan Date: Wed Jul 18 04:47:39 2018 -0700 block: Add and use op_stat_group() for indexing disk_stat fields. Add and use a new op_stat_group() function for indexing partition stat fields rather than indexing them by rq_data_dir() or bio_data_dir(). This function works similarly to op_is_sync() in that it takes the request::cmd_flags or bio::bi_opf flags and determines which stats should et updated. In addition, the second parameter to generic_start_io_acct() and generic_end_io_acct() is now a REQ_OP rather than simply a read or write bit and it uses op_stat_group() on the parameter to determine the stat group. Note that the partition in_flight counts are not part of the per-cpu statistics and as such are not indexed via this function. It's now indexed by op_is_write(). tj: Refreshed on top of v4.17. Updated to pass around REQ_OP. Signed-off-by: Michael Callahan Signed-off-by: Tejun Heo Cc: Minchan Kim Cc: Dan Williams Cc: Joshua Morris Cc: Philipp Reisner Cc: Matias Bjorling Cc: Kent Overstreet Cc: Alasdair Kergon Signed-off-by: Jens Axboe commit dbae2c551377b6533a00c11fc7ede370100ab404 Author: Michael Callahan Date: Wed Jul 18 04:47:38 2018 -0700 block: Define and use STAT_READ and STAT_WRITE Add defines for STAT_READ and STAT_WRITE for indexing the partition stat entries. This clarifies some fs/ code which has hardcoded 1 for STAT_WRITE and will make it easier to extend the stats with additional fields. tj: Refreshed on top of v4.17. Signed-off-by: Michael Callahan Signed-off-by: Tejun Heo Cc: "Theodore Ts'o" Cc: Jaegeuk Kim Signed-off-by: Jens Axboe commit 59767fbd49d794b4499d30b314df6c0d4aca584b Author: Michael Callahan Date: Wed Jul 18 04:47:37 2018 -0700 block: Add part_stat_read_accum to read across field entries. Add a part_stat_read_accum macro to genhd.h to read and sum across field entries. For example to sum up the number read and write sectors completed. In addition to being ar reasonable cleanup by itself this will make it easier to add new stat fields in the future. tj: Refreshed on top of v4.17. Signed-off-by: Michael Callahan Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe commit 3f289dcb4b265416a57ca79cf4a324060bb09060 Author: Tejun Heo Date: Wed Jul 18 04:47:36 2018 -0700 block: make bdev_ops->rw_page() take a REQ_OP instead of bool c11f0c0b5bb9 ("block/mm: make bdev_ops->rw_page() take a bool for read/write") replaced @op with boolean @is_write, which limited the amount of information going into ->rw_page() and more importantly page_endio(), which removed the need to expose block internals to mm. Unfortunately, we want to track discards separately and @is_write isn't enough information. This patch updates bdev_ops->rw_page() to take REQ_OP instead but leaves page_endio() to take bool @is_write. This allows the block part of operations to have enough information while not leaking it to mm. Signed-off-by: Tejun Heo Cc: Mike Christie Cc: Minchan Kim Cc: Dan Williams Signed-off-by: Jens Axboe commit 89fd23efa0d7934ed9ec93c77486a047759d6543 Author: Miquel Raynal Date: Sat Jul 14 14:42:00 2018 +0200 mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing Some MTD sublayers/drivers are implementing ->_read/write() and not ->_read/write_oob(). While for NAND devices both are usually valid, for NOR devices, using the _oob variant has no real meaning. But, as the MTD layer is supposed to hide as much as possible the flash complexity to the user, there is no reason to error out while it is just a matter of rewritting things internally. Add a fallback on mtd->_read() (resp. mtd->_write()) when the user calls mtd_read_oob() (resp. mtd_write_oob()) while mtd->_read_oob() (resp. mtd->_write_oob) is not implemented. There is already a fallback on the _oob variant if the former is used. Signed-off-by: Miquel Raynal Signed-off-by: Boris Brezillon commit 5f7a01e222635cba7e4889ad4ebd891835e8b2eb Author: Arnd Bergmann Date: Fri Jul 13 16:47:17 2018 +0200 jffs2: use unsigned 32-bit timstamps consistently Most users of jffs2 are 32-bit systems that traditionally only support timestamps using a 32-bit signed time_t, in the range from years 1902 to 2038. On 64-bit systems, jffs2 however interpreted the same timestamps as unsigned values, reading back negative times (before 1970) as times between 2038 and 2106. Now that Linux supports 64-bit inode timestamps even on 32-bit systems, let's use the second interpretation everywhere to allow jffs2 to be used on 32-bit systems beyond 2038 without a fundamental change to the inode format. This has a slight risk of regressions, when existing files with timestamps before 1970 are present in file system images and are now interpreted as future time stamps. I considered moving the wraparound point a bit, e.g. to 1960, in order to deal with timestamps that ended up on Dec 31, 1969 due to incorrect timezone handling. However, this would complicate the implementation unnecessarily, so I went with the simplest possible method of extending the timestamps. Writing files with timestamps before 1970 or after 2106 now results in those times being clamped in the file system. Signed-off-by: Arnd Bergmann Signed-off-by: Boris Brezillon commit c4592b9c37889c2850b0edadcff063d5097f1cb9 Author: Arnd Bergmann Date: Fri Jul 13 16:47:16 2018 +0200 jffs2: use 64-bit intermediate timestamps The VFS now uses timespec64 timestamps consistently, but jffs2 still converts them to 32-bit numbers on the storage medium. As the helper functions for the conversion (get_seconds() and timespec_to_timespec64()) are now deprecated, let's change them over to the more modern replacements. This keeps the traditional interpretation of those values, where the on-disk 32-bit numbers are taken to be negative numbers, i.e. dates before 1970, on 32-bit machines, but future numbers past 2038 on 64-bit machines. Signed-off-by: Arnd Bergmann Signed-off-by: Boris Brezillon commit 39675caa06e77547cf0692f854dce015e1b5c36b Author: Rafał Miłecki Date: Fri Jul 13 11:27:34 2018 +0200 mtd: sst25l: use mtd_device_register() This driver doesn't specify parsers so it can use that little helper. Signed-off-by: Rafał Miłecki Signed-off-by: Boris Brezillon commit 4897015d2ffb78c3064eeffa2d4022c5be3ea18f Author: Rafał Miłecki Date: Fri Jul 13 11:27:33 2018 +0200 mtd: maps: use mtd_device_register() where applicable If driver doesn't specify parsers it can use that little helper. Signed-off-by: Rafał Miłecki Signed-off-by: Boris Brezillon commit 9ea97a7d689c55a5528bfaad499edf1a4ca02e2a Author: Rafał Miłecki Date: Fri Jul 13 10:15:59 2018 +0200 mtd: powernv_flash: set of_node in mtd's dev This enables some features implemented in mtd subsystem like reading label and partitioning info from DT. Reported-by: Timothy Pearson Signed-off-by: Rafał Miłecki Signed-off-by: Boris Brezillon commit 01f8f33e9986aed42a0366704f715cf30e7cb41c Author: Chris Wilson Date: Tue Jul 17 09:41:21 2018 +0100 drm/i915: Always retire residual requests before suspend If the driver is wedged, we skip idling the GPU. However, we may still have a few requests still not retired following the wedging (since they will be waiting for a background worker trying to acquire struct_mutex). As we hold the struct_mutex, always do a quick request retirement in order to flush the wedged path. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107257 Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180717084121.28185-1-chris@chris-wilson.co.uk commit 670c23248e15254e30990cbbe63056c0490190bc Author: Miklos Szeredi Date: Wed Jul 18 15:44:44 2018 +0200 ovl: obsolete "check_copy_up" module option This was provided for debugging the ro/rw inconsistecy. The inconsitency is now gone so this option is obsolete. Signed-off-by: Miklos Szeredi commit fb16043b46831a75c9b076a7262ae035290b0409 Author: Miklos Szeredi Date: Wed Jul 18 15:44:44 2018 +0200 vfs: remove open_flags from d_real() Opening regular files on overlayfs is now handled via ovl_open(). Remove the now unused "open_flags" argument from d_op->d_real() and the d_real() helper. Signed-off-by: Miklos Szeredi commit 573e1784817ca1f13d76a0df636929e983e5de3c Author: Miklos Szeredi Date: Wed Jul 18 15:44:44 2018 +0200 Revert "fsnotify: support overlayfs" This reverts commit f3fbbb079263bd29ae592478de6808db7e708267. Overlayfs now works correctly without adding hacks to fsnotify. Signed-off-by: Miklos Szeredi commit de2a4a501e716bbf5ff691ba16faf59a35320228 Author: Miklos Szeredi Date: Wed Jul 18 15:44:43 2018 +0200 Partially revert "locks: fix file locking on overlayfs" This partially reverts commit c568d68341be7030f5647def68851e469b21ca11. Overlayfs files will now automatically get the correct locks, no need to hack overlay support in VFS. It is a partial revert, because it leaves the locks_inode() calls in place and defines locks_inode() to file_inode(). We could revert those as well, but it would be unnecessary code churn and it makes sense to document that we are getting the inode for locking purposes. Don't revert MS_NOREMOTELOCK yet since that has been part of the userspace API for some time (though not in a useful way). Will try to remove internal flags later when the dust around the new mount API settles. Signed-off-by: Miklos Szeredi Acked-by: Jeff Layton commit 8cf9ee5061037accf61775f438ad7513576d4413 Author: Miklos Szeredi Date: Wed Jul 18 15:44:43 2018 +0200 Revert "vfs: do get_write_access() on upper layer of overlayfs" This reverts commit 4d0c5ba2ff79ef9f5188998b29fd28fcb05f3667. We now get write access on both overlay and underlying layers so this patch is no longer needed for correct operation. Signed-off-by: Miklos Szeredi commit 4ab30319fd7c691a1b3165325c647a5cd6d282ac Author: Miklos Szeredi Date: Wed Jul 18 15:44:43 2018 +0200 Revert "vfs: add flags to d_real()" This reverts commit 495e642939114478a5237a7d91661ba93b76f15a. No user of "flags" argument of d_real() remain. Signed-off-by: Miklos Szeredi commit c6718543463dbb78486ad259f884cb800df802b5 Author: Miklos Szeredi Date: Wed Jul 18 15:44:43 2018 +0200 Revert "vfs: update ovl inode before relatime check" This reverts commit 598e3c8f72f5b77c84d2cb26cfd936ffb3cfdbaa. Overlayfs no longer relies on the vfs correct atime handling. Signed-off-by: Miklos Szeredi commit 88059de155d4db817a3a78ba899cb3b7f4de0fb0 Author: Miklos Szeredi Date: Wed Jul 18 15:44:43 2018 +0200 Revert "ovl: fix relatime for directories" This reverts commit cd91304e7190b4c4802f8e413ab2214b233e0260. Overlayfs no longer relies on the vfs correct atime handling. Signed-off-by: Miklos Szeredi commit a6795a585929d94ca3e931bc8518f8deb8bbe627 Author: Miklos Szeredi Date: Wed Jul 18 15:44:43 2018 +0200 vfs: fix freeze protection in mnt_want_write_file() for overlayfs The underlying real file used by overlayfs still contains the overlay path. This results in mnt_want_write_file() calls by the filesystem getting freeze protection on the wrong inode (the overlayfs one instead of the real one). Fix by using file_inode(file)->i_sb instead of file->f_path.mnt->mnt_sb. Reported-by: Amir Goldstein Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit 6742cee04353231015ddbe7e8b404ac9c1eb4473 Author: Miklos Szeredi Date: Wed Jul 18 15:44:43 2018 +0200 Revert "ovl: don't allow writing ioctl on lower layer" This reverts commit 7c6893e3c9abf6a9676e060a1e35e5caca673d57. Overlayfs no longer relies on the vfs for checking writability of files. Signed-off-by: Miklos Szeredi commit d561f218564855f69791216882a2622af37e5776 Author: Miklos Szeredi Date: Wed Jul 18 15:44:43 2018 +0200 Revert "ovl: fix may_write_real() for overlayfs directories" This reverts commit 954c736f865d6c0c68ae4263a2f3502ee7c447a3. Overlayfs no longer relies on the vfs for checking writability of files. Signed-off-by: Miklos Szeredi commit a6518f73e60e5044656d1ba587e7463479a9381a Author: Miklos Szeredi Date: Fri Jul 6 23:57:06 2018 +0200 vfs: don't open real Let overlayfs do its thing when opening a file. This enables stacking and fixes the corner case when a file is opened for read, modified through a writable open, and data is read from the read-only file. After this patch the read-only open will not return stale data even in this case. Signed-off-by: Miklos Szeredi Signed-off-by: Al Viro commit 8ede205541ff05bd096749a9f00bde6d754b4e22 Author: Miklos Szeredi Date: Wed Jul 18 15:44:42 2018 +0200 ovl: add reflink/copyfile/dedup support Since set of arguments are so similar, handle in a common helper. Signed-off-by: Miklos Szeredi commit f7c72396d0de8847495f0ccb5853c711a7f91271 Author: Miklos Szeredi Date: Wed Jul 18 15:44:42 2018 +0200 ovl: add O_DIRECT support Signed-off-by: Miklos Szeredi commit 9e142c4102db44c3c7a2656de8a1e2ddda2fae71 Author: Miklos Szeredi Date: Wed Jul 18 15:44:42 2018 +0200 ovl: add ovl_fiemap() Implement stacked fiemap(). Need to split inode operations for regular file (which has fiemap) and special file (which doesn't have fiemap). Signed-off-by: Miklos Szeredi commit dab5ca8fd9ddd3c0768e14bc1524bd3e7b8aa430 Author: Miklos Szeredi Date: Wed Jul 18 15:44:42 2018 +0200 ovl: add lsattr/chattr support Implement FS_IOC_GETFLAGS and FS_IOC_SETFLAGS. Signed-off-by: Miklos Szeredi commit aab8848cee5eca1003fc146b35b0c3293830a660 Author: Miklos Szeredi Date: Wed Jul 18 15:44:42 2018 +0200 ovl: add ovl_fallocate() Implement stacked fallocate. Signed-off-by: Miklos Szeredi commit 2f502839e85ab265f03f25f30d6463154aee5473 Author: Miklos Szeredi Date: Wed Jul 18 15:44:42 2018 +0200 ovl: add ovl_mmap() Implement stacked mmap. Signed-off-by: Miklos Szeredi commit de30dfd629e2e07e2e9d672b2931bcd60f9a34c0 Author: Miklos Szeredi Date: Wed Jul 18 15:44:42 2018 +0200 ovl: add ovl_fsync() Implement stacked fsync(). Don't sync if lower (noticed by Amir Goldstein). Signed-off-by: Miklos Szeredi commit 2a92e07edc5edef44bb7a0b8ede3154476dbb50a Author: Miklos Szeredi Date: Wed Jul 18 15:44:41 2018 +0200 ovl: add ovl_write_iter() Implement stacked writes. Signed-off-by: Miklos Szeredi commit 16914e6fc7e1748a8bd667753a92af5e685c445b Author: Miklos Szeredi Date: Wed Jul 18 15:44:41 2018 +0200 ovl: add ovl_read_iter() Implement stacked reading. Signed-off-by: Miklos Szeredi commit 2ef66b8a03c02c4cef71bf1e8661317c7b9aa071 Author: Miklos Szeredi Date: Wed Jul 18 15:44:41 2018 +0200 ovl: add helper to return real file In the common case we can just use the real file cached in file->private_data. There are two exceptions: 1) File has been copied up since open: in this unlikely corner case just use a throwaway real file for the operation. If ever this becomes a perfomance problem (very unlikely, since overlayfs has been doing most fine without correctly handling this case at all), then we can deal with that by updating the cached real file. 2) File's f_flags have changed since open: no need to reopen the cached real file, we can just change the flags there as well. Signed-off-by: Miklos Szeredi commit d1d04ef8572bc8c22265057bd3d5a79f223f8f52 Author: Miklos Szeredi Date: Wed Jul 18 15:44:41 2018 +0200 ovl: stack file ops Implement file operations on a regular overlay file. The underlying file is opened separately and cached in ->private_data. It might be worth making an exception for such files when accounting in nr_file to confirm to userspace expectations. We are only adding a small overhead (248bytes for the struct file) since the real inode and dentry are pinned by overlayfs anyway. This patch doesn't have any effect, since the vfs will use d_real() to find the real underlying file to open. The patch at the end of the series will actually enable this functionality. AV: make it use open_with_fake_path(), don't mess with override_creds SzM: still need to mess with override_creds() until no fs uses current_cred() in their open method. Signed-off-by: Miklos Szeredi Signed-off-by: Al Viro commit e8c985bace1351c5f2d7a6f0d8ff3e677b58abb5 Author: Miklos Szeredi Date: Wed Jul 18 15:44:41 2018 +0200 ovl: deal with overlay files in ovl_d_real() Signed-off-by: Miklos Szeredi commit 46e5d0a3907ba489fda4f7b043439a3599184f91 Author: Miklos Szeredi Date: Wed Jul 18 15:44:41 2018 +0200 ovl: copy up file size as well Copy i_size of the underlying inode to the overlay inode in ovl_copyattr(). This is in preparation for stacking I/O operations on overlay files. This patch shouldn't have any observable effect. Remove stale comment from ovl_setattr() [spotted by Vivek Goyal]. Signed-off-by: Miklos Szeredi commit 5812160eb50925d19c54be979c72d335fee17dbd Author: Miklos Szeredi Date: Wed Jul 18 15:44:41 2018 +0200 Revert "Revert "ovl: get_write_access() in truncate"" This reverts commit 31c3a7069593b072bd57192b63b62f9a7e994e9a. Re-add functionality dealing with i_writecount on truncate to overlayfs. This patch shouldn't have any observable effects, since we just re-assert the writecout that vfs_truncate() already got for us. This is in preparation for moving overlay functionality out of the VFS. Signed-off-by: Miklos Szeredi commit 4f3572954a9d4cbf992072713af284d990b65d87 Author: Miklos Szeredi Date: Wed Jul 18 15:44:41 2018 +0200 ovl: copy up inode flags On inode creation copy certain inode flags from the underlying real inode to the overlay inode. This is in preparation for moving overlay functionality out of the VFS. Signed-off-by: Miklos Szeredi commit d9854c87f0ed1a5f32fec24bb5b5fb426ad79c26 Author: Miklos Szeredi Date: Wed Jul 18 15:44:40 2018 +0200 ovl: copy up times Copy up mtime and ctime to overlay inode after times in real object are modified. Be careful not to dirty cachelines when not necessary. This is in preparation for moving overlay functionality out of the VFS. This patch shouldn't have any observable effect. Signed-off-by: Miklos Szeredi commit f182536684d876afaf4627c36a16c4e15ea8a2b8 Author: Miklos Szeredi Date: Wed Jul 18 15:44:40 2018 +0200 vfs: export vfs_dedupe_file_range_one() to modules This is needed by the stacked dedupe implementation in overlayfs. Signed-off-by: Miklos Szeredi commit 9df6702ad0e85901450fe48a7b5f0f8975353eeb Author: Miklos Szeredi Date: Wed Jul 18 15:44:40 2018 +0200 vfs: export vfs_ioctl() to modules This is needed by the stacked ioctl implementation in overlayfs. Signed-off-by: Miklos Szeredi commit d3b1084dfd629ef89bc1c4bab95e5cb87e7d08c2 Author: Miklos Szeredi Date: Wed Jul 18 15:44:40 2018 +0200 vfs: make open_with_fake_path() not contribute to nr_files Stacking file operations in overlay will store an extra open file for each overlay file opened. The overhead is just that of "struct file" which is about 256bytes, because overlay already pins an extra dentry and inode when the file is open, which add up to a much larger overhead. For fear of breaking working setups, don't start accounting the extra file. Signed-off-by: Miklos Szeredi commit 51e6ce820bd43e51883eddf291bd830217bb6382 Merge: 9951934d76b0 1b4f42a1e33f Author: Miklos Szeredi Date: Wed Jul 18 15:39:29 2018 +0200 Merge branch 'dedupe-cleanup' into overlayfs-next Following series for stacking overlay files depends on this mini series. commit 007bf630c0111777738e2d1ad33cf779ad971ba0 Author: Benjamin Herrenschmidt Date: Fri Jun 29 13:51:05 2018 +1000 arm: configs: Add USB gadget to Aspeed G5 defconfig Now that the vhub driver is upstream and the device-trees updated, let's enable this by default. Signed-off-by: Benjamin Herrenschmidt Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 5dd487d8a5a37d8c5e17cc05478b08284e6641ec Author: Benjamin Herrenschmidt Date: Fri Jun 29 13:51:04 2018 +1000 arm: configs: Add USB gadget to Aspeed G4 defconfig Now that the vhub driver is upstream and the device-trees updated, let's enable this by default. Signed-off-by: Benjamin Herrenschmidt Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 8ae71e76cf1f7b8de5c75356a00840e54c93e7a5 Merge: c23e014a4ba1 7736b6ed665a Author: Daniel Borkmann Date: Wed Jul 18 15:10:35 2018 +0200 Merge branch 'bpf-offload-sharing' Jakub Kicinski says: ==================== This patchset adds support for sharing BPF objects within one ASIC. This will allow us to reuse of the same program on multiple ports of a device leading to better code store utilization. It also enables sharing maps between programs attached to different ports of a device. v2: - rename bpf_offload_match() to bpf_offload_prog_map_match(); - add split patches 7 into 5, 7 and 8. ==================== Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 7736b6ed665a8a339f6499f4b0f162386d46fd86 Author: Jakub Kicinski Date: Tue Jul 17 10:53:29 2018 -0700 selftests/bpf: add test for sharing objects between netdevs Add tests for sharing programs and maps between different netdevs. Use netdevsim's ability to pretend multiple netdevs belong to the same "ASIC". Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit b5faa20d6fb28144a71885720a436e2297e26e9b Author: Jakub Kicinski Date: Tue Jul 17 10:53:28 2018 -0700 nfp: bpf: allow program sharing within ASIC Allow program sharing between netdevs of the same NFP ASIC. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 9d1b66b8ae95a0b7c6a12e9d138d41f55e911fde Author: Jakub Kicinski Date: Tue Jul 17 10:53:27 2018 -0700 netdevsim: allow program sharing between devices Allow program sharing between devices which were linked together. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit fd4f227dea0f24d89f52f7c4eb3207f84ddcbcbd Author: Jakub Kicinski Date: Tue Jul 17 10:53:26 2018 -0700 bpf: offload: allow program and map sharing per-ASIC Allow programs and maps to be re-used across different netdevs, as long as they belong to the same struct bpf_offload_dev. Update the bpf_offload_prog_map_match() helper for the verifier and export a new helper for the drivers to use when checking programs at attachment time. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 602144c224604f1cbff02ee2d1cf46825269ecbd Author: Jakub Kicinski Date: Tue Jul 17 10:53:25 2018 -0700 bpf: offload: keep the offload state per-ASIC Create a higher-level entity to represent a device/ASIC to allow programs and maps to be shared between device ports. The extra work is required to make sure we don't destroy BPF objects as soon as the netdev for which they were loaded gets destroyed, as other ports may still be using them. When netdev goes away all of its BPF objects will be moved to other netdevs of the device, and only destroyed when last netdev is unregistered. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 9fd7c5559165f4c679b40c5e6ad442955832dfad Author: Jakub Kicinski Date: Tue Jul 17 10:53:24 2018 -0700 bpf: offload: aggregate offloads per-device Currently we have two lists of offloaded objects - programs and maps. Netdevice unregister notifier scans those lists to orphan objects associated with device being unregistered. This puts unnecessary (even if negligible) burden on all netdev unregister calls in BPF- -enabled kernel. The lists of objects may potentially get long making the linear scan even more problematic. There haven't been complaints about this mechanisms so far, but it is suboptimal. Instead of relying on notifiers, make the few BPF-capable drivers register explicitly for BPF offloads. The programs and maps will now be collected per-device not on a global list, and only scanned for removal when driver unregisters from BPF offloads. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 09728266b6f99ab57cd4f84f3eead65b7b65dbf7 Author: Jakub Kicinski Date: Tue Jul 17 10:53:23 2018 -0700 bpf: offload: rename bpf_offload_dev_match() to bpf_offload_prog_map_match() A set of new API functions exported for the drivers will soon use 'bpf_offload_dev_' as a prefix. Rename the bpf_offload_dev_match() which is internal to the core (used by the verifier) to avoid any confusion. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 4612bebfa379507a4793ef50846c0059aa75a043 Author: Jakub Kicinski Date: Tue Jul 17 10:53:22 2018 -0700 nfp: add .ndo_init() and .ndo_uninit() callbacks BPF code should unregister the offload capabilities from .ndo_uninit(), to make sure the operation is atomic with unlist_netdevice(). Plumb the init/uninit NDOs for vNICs and representors. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit d6d6071388e9fc81e11c6f4392666a9f072befe6 Author: Jakub Kicinski Date: Tue Jul 17 10:53:21 2018 -0700 netdevsim: associate bound programs with shared dev Move bound program information from netdevsim to shared sub-object, as programs will soon be shared between netdevs of the same ASIC. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit eeeaaf185eca5790529fa184c89452ead7c8c859 Author: Jakub Kicinski Date: Tue Jul 17 10:53:20 2018 -0700 netdevsim: add shared netdevsim devices Factor out sharable netdevsim sub-object and use IFLA_LINK to link netdevsims together at creation time. Sharable object will have its own DebugFS directory. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 5f07655b803eca4c215bac9aa61f4bf19f6ecd5e Author: Jakub Kicinski Date: Tue Jul 17 10:53:19 2018 -0700 netdevsim: add switch_id attribute Grouping netdevsim devices into "ASICs" will soon be supported. Add switch_id attribute to all netdevsims. For now each netdevsim will have its switch_id matching the device id. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit a2df75ab0aba98daf7fa4828cf8a669c636c6382 Author: Lei YU Date: Wed May 9 17:35:59 2018 +0800 ARM: dts: aspeed: Use 24MHz fixed clock for pwm The aspeed pwm driver always sets the clock source to 24MHz, specify the fixed clock in device tree to make sure the driver is using the correct clock frequency to calculate the fan speed. Signed-off-by: Lei YU Signed-off-by: Joel Stanley commit c23e014a4ba1a9448cbbd74916377f23a7da2fc2 Author: Colin Ian King Date: Tue Jul 17 09:38:59 2018 +0100 bpf: sockmap: remove redundant pointer sg Pointer sg is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'sg' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Daniel Borkmann commit 3960f4fd6585608e8cc285d9665821985494e147 Author: Roman Gushchin Date: Fri Jul 13 12:41:11 2018 -0700 bpf: fix rcu annotations in compute_effective_progs() The progs local variable in compute_effective_progs() is marked as __rcu, which is not correct. This is a local pointer, which is initialized by bpf_prog_array_alloc(), which also now returns a generic non-rcu pointer. The real rcu-protected pointer is *array (array is a pointer to an RCU-protected pointer), so the assignment should be performed using rcu_assign_pointer(). Fixes: 324bda9e6c5a ("bpf: multi program support for cgroup+bpf") Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Signed-off-by: Daniel Borkmann commit d29ab6e1fa21ebc2a8a771015dd9e0e5d4e28dc1 Author: Roman Gushchin Date: Fri Jul 13 12:41:10 2018 -0700 bpf: bpf_prog_array_alloc() should return a generic non-rcu pointer Currently the return type of the bpf_prog_array_alloc() is struct bpf_prog_array __rcu *, which is not quite correct. Obviously, the returned pointer is a generic pointer, which is valid for an indefinite amount of time and it's not shared with anyone else, so there is no sense in marking it as __rcu. This change eliminate the following sparse warnings: kernel/bpf/core.c:1544:31: warning: incorrect type in return expression (different address spaces) kernel/bpf/core.c:1544:31: expected struct bpf_prog_array [noderef] * kernel/bpf/core.c:1544:31: got void * kernel/bpf/core.c:1548:17: warning: incorrect type in return expression (different address spaces) kernel/bpf/core.c:1548:17: expected struct bpf_prog_array [noderef] * kernel/bpf/core.c:1548:17: got struct bpf_prog_array * kernel/bpf/core.c:1681:15: warning: incorrect type in assignment (different address spaces) kernel/bpf/core.c:1681:15: expected struct bpf_prog_array *array kernel/bpf/core.c:1681:15: got struct bpf_prog_array [noderef] * Fixes: 324bda9e6c5a ("bpf: multi program support for cgroup+bpf") Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Signed-off-by: Daniel Borkmann commit b86d77123c6e1ecc102aa49c2378999737092891 Merge: 5f8f80356ecc 62dbbae483b6 Author: Mark Brown Date: Wed Jul 18 13:24:54 2018 +0100 Merge tag 'spi-dw-set-cs' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-4.19 spi: dw: Allow custom set_cs_callback Allow platform specific drivers to provide their own set_cs callback when the IP integration requires it. commit 62dbbae483b6452e688b8e26c4d024d484117697 Author: Alexandre Belloni Date: Tue Jul 17 16:23:11 2018 +0200 spi: dw: allow providing own set_cs callback Allow platform specific drivers to provide their own set_cs callback when the IP integration requires it. Signed-off-by: Alexandre Belloni Signed-off-by: Mark Brown commit 66b19d762378785d1568b5650935205edfeb0503 Author: Alexandre Belloni Date: Tue Jul 17 16:23:10 2018 +0200 spi: dw: fix possible race condition It is possible to get an interrupt as soon as it is requested. dw_spi_irq does spi_controller_get_devdata(master) and expects it to be different than NULL. However, spi_controller_set_devdata() is called after request_irq(), resulting in the following crash: CPU 0 Unable to handle kernel paging request at virtual address 00000030, epc == 8058e09c, ra == 8018ff90 [...] Call Trace: [<8058e09c>] dw_spi_irq+0x8/0x64 [<8018ff90>] __handle_irq_event_percpu+0x70/0x1d4 [<80190128>] handle_irq_event_percpu+0x34/0x8c [<801901c4>] handle_irq_event+0x44/0x80 [<801951a8>] handle_level_irq+0xdc/0x194 [<8018f580>] generic_handle_irq+0x38/0x50 [<804c6924>] ocelot_irq_handler+0x104/0x1c0 Signed-off-by: Alexandre Belloni Reviewed-by: Andy Shevchenko Signed-off-by: Mark Brown commit b71c69c26b4916d11b8d403d8e667bbd191f1b8f Author: Philipp Puschmann Date: Tue Jul 17 13:41:12 2018 +0200 Bluetooth: Use lock_sock_nested in bt_accept_enqueue Fixes this warning that was provoked by a pairing: [60258.016221] WARNING: possible recursive locking detected [60258.021558] 4.15.0-RD1812-BSP #1 Tainted: G O [60258.027146] -------------------------------------------- [60258.032464] kworker/u5:0/70 is trying to acquire lock: [60258.037609] (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: [<87759073>] bt_accept_enqueue+0x3c/0x74 [60258.046863] [60258.046863] but task is already holding lock: [60258.052704] (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: [] l2cap_sock_new_connection_cb+0x1c/0x88 [60258.062905] [60258.062905] other info that might help us debug this: [60258.069441] Possible unsafe locking scenario: [60258.069441] [60258.075368] CPU0 [60258.077821] ---- [60258.080272] lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP); [60258.085510] lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP); [60258.090748] [60258.090748] *** DEADLOCK *** [60258.090748] [60258.096676] May be due to missing lock nesting notation [60258.096676] [60258.103472] 5 locks held by kworker/u5:0/70: [60258.107747] #0: ((wq_completion)%shdev->name#2){+.+.}, at: [<9460d092>] process_one_work+0x130/0x4fc [60258.117263] #1: ((work_completion)(&hdev->rx_work)){+.+.}, at: [<9460d092>] process_one_work+0x130/0x4fc [60258.126942] #2: (&conn->chan_lock){+.+.}, at: [<7877c8c3>] l2cap_connect+0x80/0x4f8 [60258.134806] #3: (&chan->lock/2){+.+.}, at: [<2e16c724>] l2cap_connect+0x8c/0x4f8 [60258.142410] #4: (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: [] l2cap_sock_new_connection_cb+0x1c/0x88 [60258.153043] [60258.153043] stack backtrace: [60258.157413] CPU: 1 PID: 70 Comm: kworker/u5:0 Tainted: G O 4.15.0-RD1812-BSP #1 [60258.165945] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [60258.172485] Workqueue: hci0 hci_rx_work [60258.176331] Backtrace: [60258.178797] [<8010c9fc>] (dump_backtrace) from [<8010ccbc>] (show_stack+0x18/0x1c) [60258.186379] r7:80e55fe4 r6:80e55fe4 r5:20050093 r4:00000000 [60258.192058] [<8010cca4>] (show_stack) from [<809864e8>] (dump_stack+0xb0/0xdc) [60258.199301] [<80986438>] (dump_stack) from [<8016ecc8>] (__lock_acquire+0xffc/0x11d4) [60258.207144] r9:5e2bb019 r8:630f974c r7:ba8a5940 r6:ba8a5ed8 r5:815b5220 r4:80fa081c [60258.214901] [<8016dccc>] (__lock_acquire) from [<8016f620>] (lock_acquire+0x78/0x98) [60258.222655] r10:00000040 r9:00000040 r8:808729f0 r7:00000001 r6:00000000 r5:60050013 [60258.230491] r4:00000000 [60258.233045] [<8016f5a8>] (lock_acquire) from [<806ee974>] (lock_sock_nested+0x64/0x88) [60258.240970] r7:00000000 r6:b796e870 r5:00000001 r4:b796e800 [60258.246643] [<806ee910>] (lock_sock_nested) from [<808729f0>] (bt_accept_enqueue+0x3c/0x74) [60258.255004] r8:00000001 r7:ba7d3c00 r6:ba7d3ea4 r5:ba7d2000 r4:b796e800 [60258.261717] [<808729b4>] (bt_accept_enqueue) from [<808aa39c>] (l2cap_sock_new_connection_cb+0x68/0x88) [60258.271117] r5:b796e800 r4:ba7d2000 [60258.274708] [<808aa334>] (l2cap_sock_new_connection_cb) from [<808a294c>] (l2cap_connect+0x190/0x4f8) [60258.283933] r5:00000001 r4:ba6dce00 [60258.287524] [<808a27bc>] (l2cap_connect) from [<808a4a14>] (l2cap_recv_frame+0x744/0x2cf8) [60258.295800] r10:ba6dcf24 r9:00000004 r8:b78d8014 r7:00000004 r6:bb05d000 r5:00000004 [60258.303635] r4:bb05d008 [60258.306183] [<808a42d0>] (l2cap_recv_frame) from [<808a7808>] (l2cap_recv_acldata+0x210/0x214) [60258.314805] r10:b78e7800 r9:bb05d960 r8:00000001 r7:bb05d000 r6:0000000c r5:b7957a80 [60258.322641] r4:ba6dce00 [60258.325188] [<808a75f8>] (l2cap_recv_acldata) from [<8087630c>] (hci_rx_work+0x35c/0x4e8) [60258.333374] r6:80e5743c r5:bb05d7c8 r4:b7957a80 [60258.338004] [<80875fb0>] (hci_rx_work) from [<8013dc7c>] (process_one_work+0x1a4/0x4fc) [60258.346018] r10:00000001 r9:00000000 r8:baabfef8 r7:ba997500 r6:baaba800 r5:baaa5d00 [60258.353853] r4:bb05d7c8 [60258.356401] [<8013dad8>] (process_one_work) from [<8013e028>] (worker_thread+0x54/0x5cc) [60258.364503] r10:baabe038 r9:baaba834 r8:80e05900 r7:00000088 r6:baaa5d18 r5:baaba800 [60258.372338] r4:baaa5d00 [60258.374888] [<8013dfd4>] (worker_thread) from [<801448f8>] (kthread+0x134/0x160) [60258.382295] r10:ba8310b8 r9:bb07dbfc r8:8013dfd4 r7:baaa5d00 r6:00000000 r5:baaa8ac0 [60258.390130] r4:ba831080 [60258.392682] [<801447c4>] (kthread) from [<801080b4>] (ret_from_fork+0x14/0x20) [60258.399915] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:801447c4 [60258.407751] r4:baaa8ac0 r3:baabe000 Signed-off-by: Philipp Puschmann Signed-off-by: Marcel Holtmann commit cf18fd01466d59263c615165341684a055206dd5 Author: Geert Uytterhoeven Date: Mon Jul 16 17:30:52 2018 +0200 regulator: bd9571mwv: Document "backup_mode" sysfs file Signed-off-by: Geert Uytterhoeven Acked-by: Pavel Machek Reviewed-by: Niklas Söderlund Signed-off-by: Mark Brown commit e436875f6f97708613976da75a92974f18998af9 Author: Geert Uytterhoeven Date: Mon Jul 16 17:30:51 2018 +0200 regulator: bd9571mwv: Add support for toggle power switches Extend the existing support for backup mode to toggle power switches. With a toggle power switch (or level signal), the following steps must be followed exactly: 1. Configure PMIC for backup mode, to change the role of the accessory power switch from a power switch to a wake-up switch, 2. Switch accessory power switch off, to prepare for system suspend, which is a manual step not controlled by software, 3. Suspend system, 4. Switch accessory power switch on, to resume the system. Hence the PMIC is configured for backup mode when "on" or "1" is written to the PMIC's "backup_mode" virtual file in sysfs. Conversely, writing "off" or "0" reverts the role of the accessory switch to a power switch. Unlike with momentary switches, backup mode is not enabled by default, as enabling it prevents the board from being powered off using the power switch, which may confuse the user. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Mark Brown commit 02b3a073c12edc8cbc18e07e8880a32e78c1aee0 Author: Geert Uytterhoeven Date: Mon Jul 16 17:30:50 2018 +0200 regulator: bd9571mwv: Use "backup_mode" sysfs file instead of "wake_up" Currently the BD9571MWV PMIC driver uses the standard "wake_up" sysfs file to control enablement of DDR Backup Mode. However, configuring DDR Backup Mode is not really equivalent to configuring the PMIC as a wake-up source. To avoid confusion, use a custom "backup_mode" attribute file in sysfs instead. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Mark Brown commit 7713a70034f2cb54168d134ac523fdfcdda92a13 Author: Jerome Brunet Date: Tue Jul 17 17:42:56 2018 +0200 ASoC: meson: add axg tdm formatters DT bindings documentation Add the DT bindings documentation for axg's TDM formatters: TDMIN and TDMOUT. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 53eb4b7aaa045e23b6e8edb0ae0d047a4a3612ef Author: Jerome Brunet Date: Tue Jul 17 17:42:55 2018 +0200 ASoC: meson: add axg spdif output Add support for the spdif output serializer of the axg SoC family Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit eb257e6607f96fd70a443750e9eaddbb49ba87ff Author: Jerome Brunet Date: Tue Jul 17 17:42:54 2018 +0200 ASoC: meson: add axg spdif output DT bindings documentation Add the DT bindings documentation for axg's SPDIF output. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 7ed4877b403c9343a8e2c7581d9bcfceef0f40cf Author: Jerome Brunet Date: Tue Jul 17 17:42:53 2018 +0200 ASoC: meson: add axg toddr driver Add the capture memory interface of Amlogic's axg SoCs. TDM, SPDIF or PDM input devices place audio samples inside this FIFO. The FIFO content is then pushed to DDR Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 57d552e3ea76003643b2e771042659ce71bac7c2 Author: Jerome Brunet Date: Tue Jul 17 17:42:52 2018 +0200 ASoC: meson: add axg frddr driver Add the playback memory interface of Amlogic's axg SoCs. This device pulls data from DDR to an internal FIFO. This FIFO is then used to feed TDM and SPDIF Output devices. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 6dc4fa179fb86d2c986b2bc8a8377fe4d8c0428d Author: Jerome Brunet Date: Tue Jul 17 17:42:51 2018 +0200 ASoC: meson: add axg fifo base driver Amlogic's axg SoCs have two types of fifos which are the memory interfaces of the audio subsystem. FRDDR provides the playback interface while TODDR provides the capture interface. The way these fifos operate is very similar. Only a few settings are specific to each. They implement the same pcm driver here and the specifics of each will be dealt with the related DAI driver. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit e32d99af6830c9a8f37b4f2637ef0cdc60fa79fb Author: Jerome Brunet Date: Tue Jul 17 17:42:50 2018 +0200 ASoC: meson: add axg fifos DT binding documentation Add the DT bindings documentation for axg's FIFOs: TODDR and FRDDR. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit bf270262b7b8bb7b48a846c613f74e800abba392 Author: Sriram Periyasamy Date: Mon Jul 16 15:32:34 2018 +0530 ASoC: hdac_hdmi: Add documentation for power management Add documentation for power management of HDAC HDMI codec device for various scenarios such as S0/S3, probe and playback use case. Signed-off-by: Sriram Periyasamy Signed-off-by: Sanyog Kale Signed-off-by: Mark Brown commit 90ae7105eaf19342bb11e554059d62b84e01da12 Author: Srinivas Kandagatla Date: Fri Jul 13 16:36:32 2018 +0100 ASoC: qcom: apq8096: remove component framework related code Now that the component framework is integrated into the ASoC core, remove any redundant code in this driver. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Signed-off-by: Mark Brown commit 791940779d651c2219e97702d2245b5420b0c8ae Author: Srinivas Kandagatla Date: Fri Jul 13 16:36:31 2018 +0100 ASoC: qdsp6: q6routing: remove component framework related code Now that the component framework is integrated into the ASoC core, remove any redundant code in this driver. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Signed-off-by: Mark Brown commit f924e4fd89659908107a5529f02c21edb4770dba Author: Srinivas Kandagatla Date: Fri Jul 13 16:36:30 2018 +0100 ASoC: qdsp6: q6asm-dai: remove component framework related code Now that the component framework is integrated into the ASoC core, remove any redundant code in this driver. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Signed-off-by: Mark Brown commit 605fcb69918528e1a448cba4d358cbd8ed532146 Author: Srinivas Kandagatla Date: Fri Jul 13 16:36:29 2018 +0100 ASoC: qdsp6: q6afe-dai: remove component fw related code Now that the component framework is integrated into the ASoC core, remove any redundant code in this driver. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Signed-off-by: Mark Brown commit bb4b894addb09a069c072a0a032f644cc470d17f Author: Srinivas Kandagatla Date: Fri Jul 13 16:36:28 2018 +0100 ASoC: core: add support to card re-bind using component framework This patch aims at achieving dynamic behaviour of audio card when the dependent components disappear and reappear. With this patch the card is removed if any of the dependent component is removed and card is added back if the dependent component comes back. All this is done using component framework and matching based on component name. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Signed-off-by: Mark Brown commit 6eb864c1d9dd1ef32b88e03c3f49d8be0dab7dcf Author: Mikhail Kurinnoi Date: Wed Jun 27 16:33:42 2018 +0300 integrity: prevent deadlock during digsig verification. This patch aimed to prevent deadlock during digsig verification.The point of issue - user space utility modprobe and/or it's dependencies (ld-*.so, libz.so.*, libc-*.so and /lib/modules/ files) that could be used for kernel modules load during digsig verification and could be signed by digsig in the same time. First at all, look at crypto_alloc_tfm() work algorithm: crypto_alloc_tfm() will first attempt to locate an already loaded algorithm. If that fails and the kernel supports dynamically loadable modules, it will then attempt to load a module of the same name or alias. If that fails it will send a query to any loaded crypto manager to construct an algorithm on the fly. We have situation, when public_key_verify_signature() in case of RSA algorithm use alg_name to store internal information in order to construct an algorithm on the fly, but crypto_larval_lookup() will try to use alg_name in order to load kernel module with same name. 1) we can't do anything with crypto module work, since it designed to work exactly in this way; 2) we can't globally filter module requests for modprobe, since it designed to work with any requests. In this patch, I propose add an exception for "crypto-pkcs1pad(rsa,*)" module requests only in case of enabled integrity asymmetric keys support. Since we don't have any real "crypto-pkcs1pad(rsa,*)" kernel modules for sure, we are safe to fail such module request from crypto_larval_lookup(). In this way we prevent modprobe execution during digsig verification and avoid possible deadlock if modprobe and/or it's dependencies also signed with digsig. Requested "crypto-pkcs1pad(rsa,*)" kernel module name formed by: 1) "pkcs1pad(rsa,%s)" in public_key_verify_signature(); 2) "crypto-%s" / "crypto-%s-all" in crypto_larval_lookup(). "crypto-pkcs1pad(rsa," part of request is a constant and unique and could be used as filter. Signed-off-by: Mikhail Kurinnoi Signed-off-by: Mimi Zohar include/linux/integrity.h | 13 +++++++++++++ security/integrity/digsig_asymmetric.c | 23 +++++++++++++++++++++++ security/security.c | 7 ++++++- 3 files changed, 42 insertions(+), 1 deletion(-) commit 5feeb61183dde9d4f4026fd0d5801388c21d61a2 Author: Matthew Garrett Date: Fri Jun 8 14:57:43 2018 -0700 evm: Allow non-SHA1 digital signatures SHA1 is reasonable in HMAC constructs, but it's desirable to be able to use stronger hashes in digital signatures. Modify the EVM crypto code so the hash type is imported from the digital signature and passed down to the hash calculation code, and return the digest size to higher layers for validation. Signed-off-by: Matthew Garrett Signed-off-by: Mimi Zohar commit e2861fa71641c6414831d628a1f4f793b6562580 Author: Matthew Garrett Date: Fri Jun 8 14:57:42 2018 -0700 evm: Don't deadlock if a crypto algorithm is unavailable When EVM attempts to appraise a file signed with a crypto algorithm the kernel doesn't have support for, it will cause the kernel to trigger a module load. If the EVM policy includes appraisal of kernel modules this will in turn call back into EVM - since EVM is holding a lock until the crypto initialisation is complete, this triggers a deadlock. Add a CRYPTO_NOLOAD flag and skip module loading if it's set, and add that flag in the EVM case in order to fail gracefully with an error message instead of deadlocking. Signed-off-by: Matthew Garrett Acked-by: Herbert Xu Signed-off-by: Mimi Zohar commit ac2409a521f7ec5978fd582567398d19f4a2fdbd Author: Sudeep Holla Date: Tue Jun 5 11:25:45 2018 +0100 integrity: silence warning when CONFIG_SECURITYFS is not enabled When CONFIG_SECURITYFS is not enabled, securityfs_create_dir returns -ENODEV which throws the following error: "Unable to create integrity sysfs dir: -19" However, if the feature is disabled, it can't be warning and hence we need to silence the error. This patch checks for the error -ENODEV which is returned when CONFIG_SECURITYFS is disabled to stop the error being thrown. Signed-off-by: Sudeep Holla Acked-by: Matthew Garrett Signed-off-by: Mimi Zohar commit dba31ee759417ef1a952e929524b0cca1751c036 Author: Stefan Berger Date: Mon Jun 4 16:54:55 2018 -0400 ima: Differentiate auditing policy rules from "audit" actions The AUDIT_INTEGRITY_RULE is used for auditing IMA policy rules and the IMA "audit" policy action. This patch defines AUDIT_INTEGRITY_POLICY_RULE to reflect the IMA policy rules. Since we defined a new message type we can now also pass the audit_context and get an associated SYSCALL record. This now produces the following records when parsing IMA policy's rules: type=UNKNOWN[1807] msg=audit(1527888965.738:320): action=audit \ func=MMAP_CHECK mask=MAY_EXEC res=1 type=UNKNOWN[1807] msg=audit(1527888965.738:320): action=audit \ func=FILE_CHECK mask=MAY_READ res=1 type=SYSCALL msg=audit(1527888965.738:320): arch=c000003e syscall=1 \ success=yes exit=17 a0=1 a1=55bcfcca9030 a2=11 a3=7fcc1b55fb38 \ items=0 ppid=1567 pid=1601 auid=0 uid=0 gid=0 euid=0 suid=0 \ fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty2 ses=2 comm="echo" \ exe="/usr/bin/echo" \ subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) Signed-off-by: Stefan Berger Acked-by: Paul Moore Signed-off-by: Mimi Zohar commit 2afd020aaeeefacb7711b47e3afb0cfb50db3f13 Author: Stefan Berger Date: Mon Jun 4 16:54:54 2018 -0400 ima: Do not audit if CONFIG_INTEGRITY_AUDIT is not set If Integrity is not auditing, IMA shouldn't audit, either. Signed-off-by: Stefan Berger Acked-by: Paul Moore Signed-off-by: Mimi Zohar commit 3d2859d5d4c33b12327764b887039bca15a37e57 Author: Stefan Berger Date: Mon Jun 4 16:54:53 2018 -0400 ima: Use audit_log_format() rather than audit_log_string() Remove the usage of audit_log_string() and replace it with audit_log_format(). Signed-off-by: Stefan Berger Suggested-by: Steve Grubb Acked-by: Paul Moore Signed-off-by: Mimi Zohar commit 8a3bcaf6ecd37fee326cd30732192ef2a09e5b07 Author: Stefan Berger Date: Mon Jun 4 16:54:52 2018 -0400 ima: Call audit_log_string() rather than logging it untrusted The parameters passed to this logging function are all provided by a privileged user and therefore we can call audit_log_string() rather than audit_log_untrustedstring(). Signed-off-by: Stefan Berger Suggested-by: Steve Grubb Acked-by: Paul Moore Signed-off-by: Mimi Zohar commit 1a32ebb26ba9adc9a3fe59079b79a82f6bbec34e Author: Jouke Witteveen Date: Wed Jul 11 11:45:36 2018 +0200 platform/x86: thinkpad_acpi: Support battery quirk Some Thinkpads have a single battery, but expose it as BAT1. Use the quirks engine to force these machines into always addressing the primary battery. Without this, the battery name would resolve to the non-existent secondary battery and ACPI calls would fail. Signed-off-by: Jouke Witteveen Acked-by: Henrique de Moraes Holschuh Signed-off-by: Andy Shevchenko commit 846a416b4630fc960c10500b4194ad504bc22d4b Author: Jouke Witteveen Date: Wed Jul 11 11:44:41 2018 +0200 platform/x86: thinkpad_acpi: Proper model/release matching Modern Thinkpads have three character model designators. Previously, they would be accepted, but recorded incompletely. Revision matching extracted the wrong bytes from the ID string. This made the use of quirks for modern machines impossible. Fixes: 1b0eb5bc2413 Signed-off-by: Jouke Witteveen Signed-off-by: Andy Shevchenko commit 309dca51c902d10267bbb120a8a2f3efc3491728 Author: Colin Ian King Date: Wed Jul 11 09:09:10 2018 +0100 platform/x86: intel_ips: remove redundant variables slope and offset Variables slope and offset are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'slope' set but not used [-Wunused-but-set-variable] warning: variable 'offset' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Andy Shevchenko commit e78fd3c3eead7cb71c4b3bbcefbaa26a9345c0ee Author: Kees Cook Date: Wed Jul 4 10:29:08 2018 -0700 platform/mellanox: Use 2-factor allocator calls As already done treewide, switch from open-coded multiplication to using 2-factor allocation helpers. Signed-off-by: Kees Cook Acked-by: Vadim Pasternak Signed-off-by: Andy Shevchenko commit 24c458c485c87eef97e91d2e180f222555528b11 Author: Fernando Fernandez Mancera Date: Sat Jul 14 16:50:59 2018 +0200 netfilter: nf_osf: add missing definitions to header file Add missing definitions from nf_osf.h in order to extract Passive OS fingerprint infrastructure from xt_osf. Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso commit 70b095c84326640eeacfd69a411db8fc36e8ab1a Author: Florian Westphal Date: Sat Jul 14 01:14:01 2018 +0200 ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module IPV6=m DEFRAG_IPV6=m CONNTRACK=y yields: net/netfilter/nf_conntrack_proto.o: In function `nf_ct_netns_do_get': net/netfilter/nf_conntrack_proto.c:802: undefined reference to `nf_defrag_ipv6_enable' net/netfilter/nf_conntrack_proto.o:(.rodata+0x640): undefined reference to `nf_conntrack_l4proto_icmpv6' Setting DEFRAG_IPV6=y causes undefined references to ip6_rhash_params ip6_frag_init and ip6_expire_frag_queue so it would be needed to force IPV6=y too. This patch gets rid of the 'followup linker error' by removing the dependency of ipv6.ko symbols from netfilter ipv6 defrag. Shared code is placed into a header, then used from both. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7d25f8851a2c03319bfa8e56bb40bde2c4621392 Author: Máté Eckl Date: Thu Jul 12 17:48:06 2018 +0200 netfilter: nft_socket: Expose socket mark Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit 365b5a36f352e9884e85c47aa33026fd4df18633 Author: Máté Eckl Date: Thu Jul 12 17:18:46 2018 +0200 netfilter: nft_socket: Break evaluation if no socket found Actual implementation stores 0 in the destination register if no socket is found by the lookup, but that is not intentional as it is not really a value of any socket metadata. This patch fixes this and breaks rule evaluation in this case. Fixes: 554ced0a6e29 ("netfilter: nf_tables: add support for native socket matching") Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit 31a9c29210e2d8129d2e81acb89babb56916c6c9 Author: Pablo Neira Ayuso Date: Fri Jul 13 14:54:44 2018 +0200 netfilter: nf_osf: add struct nf_osf_hdr_ctx Wrap context that allow us to guess the OS into a structure. Signed-off-by: Pablo Neira Ayuso commit 06ff4aa252303bd2a5d706008210bb49d9889b9d Author: Pablo Neira Ayuso Date: Fri Jul 13 14:54:43 2018 +0200 netfilter: nf_osf: add nf_osf_match_one() This new function allows us to check if there is TCP syn packet matching with a given fingerprint that can be reused from the upcoming new nf_osf_find() function. Signed-off-by: Pablo Neira Ayuso commit f102d66b335a417d4848da9441f585695a838934 Author: Florian Westphal Date: Wed Jul 11 13:45:14 2018 +0200 netfilter: nf_tables: use dedicated mutex to guard transactions Continue to use nftnl subsys mutex to protect (un)registration of hook types, expressions and so on, but force batch operations to do their own locking. This allows distinct net namespaces to perform transactions in parallel. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2a43ecf96ba6a6eed70dbcd99d0888fc0ad3b82b Author: Florian Westphal Date: Wed Jul 11 13:45:13 2018 +0200 netfilter: nf_tables: avoid global info storage This works because all accesses are currently serialized by nfnl nf_tables subsys mutex. If we want to have per-netns locking, we need to make this scratch area pernetns or allocate it on demand. This does the latter, its ~28kbyte but we can fallback to vmalloc so it should be fine. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit be2ab5b4d5c0bf041a34ec2e1397d50afbfb095e Author: Florian Westphal Date: Wed Jul 11 13:45:12 2018 +0200 netfilter: nf_tables: take module reference when starting a batch Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ca2f18be792fddd0db2bbf6cbe1ec12d1bb32dd7 Author: Florian Westphal Date: Wed Jul 11 13:45:11 2018 +0200 netfilter: nf_tables: make valid_genid callback mandatory always call this function, followup patch can use this to aquire a per-netns transaction log to guard the entire batch instead of using the nfnl susbsys mutex (which is shared among all namespaces). Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 452238e8d5ffd8b77f92387519513839d4ca7379 Author: Florian Westphal Date: Wed Jul 11 13:45:10 2018 +0200 netfilter: nf_tables: add and use helper for module autoload module autoload is problematic, it requires dropping the mutex that protects the transaction. Once the mutex has been dropped, another client can start a new transaction before we had a chance to abort current transaction log. This helper makes sure we first zap the transaction log, then drop mutex for module autoload. In case autload is successful, the caller has to reply entire message anyway. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 440534d3c56be04abfb26850ee882d19d223557a Author: Gao Feng Date: Mon Jul 9 18:06:33 2018 +0800 netfilter: Remove useless param helper of nf_ct_helper_ext_add The param helper of nf_ct_helper_ext_add is useless now, then remove it now. Signed-off-by: Gao Feng Signed-off-by: Pablo Neira Ayuso commit 762c40076684771c0efbce6490ded26086441ce6 Author: Julian Anastasov Date: Fri Jul 6 08:25:54 2018 +0300 ipvs: drop conn templates under attack Before now, connection templates were ignored by the random dropentry procedure. But Michal Koutný suggests that we should add exception for connections under SYN attack. He provided patch that implements it for TCP: IPVS includes protection against filling the ip_vs_conn_tab by dropping 1/32 of feasible entries every second. The template entries (for persistent services) are never directly deleted by this mechanism but when a picked TCP connection entry is being dropped (1), the respective template entry is dropped too (realized by expiring 60 seconds after the connection entry being dropped). There is another mechanism that removes connection entries when they time out (2), in this case the associated template entry is not deleted. Under SYN flood template entries would accumulate (due to their entry longer timeout). The accumulation takes place also with drop_entry being enabled. Roughly 15% ((31/32)^60) of SYN_RECV connections survive the dropping mechanism (1) and are removed by the timeout mechanism (2)(defaults to 60 seconds for SYN_RECV), thus template entries would still accumulate. The patch ensures that when a connection entry times out, we also remove the template entry from the table. To prevent breaking persistent services (since the connection may time out in already established state) we add a new entry flag to protect templates what spawned at least one established TCP connection. We already added ASSURED flag for the templates in previous patch, so that we can use it now to decide which connection templates should be dropped under attack. But we also have some cases that need special handling. We modify the dropentry procedure as follows: - Linux timers currently use LIFO ordering but we can not rely on this to drop controlling connections. So, set cp->timeout to 0 to indicate that connection was dropped and that on expiration we should try to drop our controlling connections. As result, we can now avoid the ip_vs_conn_expire_now call. - move the cp->n_control check above, so that it avoids restarting the timer for controlling connections when not needed. - drop unassured connection templates here if they are not referred by any connections. On connection expiration: if connection was dropped (cp->timeout=0) try to drop our controlling connection except if it is a template in assured state. In ip_vs_conn_flush change order of ip_vs_conn_expire_now calls according to the LIFO timer expiration order. It should work faster for controlling connections with single controlled one. Suggested-by: Michal Koutný Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit 275411430f892407b885be1de2548b2e632892c3 Author: Julian Anastasov Date: Fri Jul 6 08:25:53 2018 +0300 ipvs: add assured state for conn templates cp->state was not used for templates. Add support for state bits and for the first "assured" bit which indicates that some connection controlled by this template was established or assured by the real server. In a followup patch we will use it to drop templates under SYN attack. Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit ec1b28ca9674def4a158808a6493bdb87b993d81 Author: Julian Anastasov Date: Fri Jul 6 08:25:52 2018 +0300 ipvs: provide just conn to ip_vs_state_name In preparation for followup patches, provide just the cp ptr to ip_vs_state_name. Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit ed07d9a021df6da53456663a76999189badc432a Author: Martynas Pumputis Date: Mon Jul 2 16:52:14 2018 +0200 netfilter: nf_conntrack: resolve clash for matching conntracks This patch enables the clash resolution for NAT (disabled in "590b52e10d41") if clashing conntracks match (i.e. both tuples are equal) and a protocol allows it. The clash might happen for a connections-less protocol (e.g. UDP) when two threads in parallel writes to the same socket and consequent calls to "get_unique_tuple" return the same tuples (incl. reply tuples). In this case it is safe to perform the resolution, as the losing CT describes the same mangling as the winning CT, so no modifications to the packet are needed, and the result of rules traversal for the loser's packet stays valid. Signed-off-by: Martynas Pumputis Signed-off-by: Pablo Neira Ayuso commit 5c789e131cbb997a528451564ea4613e812fc718 Author: Yi-Hung Wei Date: Mon Jul 2 17:33:44 2018 -0700 netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search This patch is originally from Florian Westphal. This patch does the following 3 main tasks. 1) Add list lock to 'struct nf_conncount_list' so that we can alter the lists containing the individual connections without holding the main tree lock. It would be useful when we only need to add/remove to/from a list without allocate/remove a node in the tree. With this change, we update nft_connlimit accordingly since we longer need to maintain a list lock in nft_connlimit now. 2) Use RCU for the initial tree search to improve tree look up performance. 3) Add a garbage collection worker. This worker is schedule when there are excessive tree node that needed to be recycled. Moreover,the rbnode reclaim logic is moved from search tree to insert tree to avoid race condition. Signed-off-by: Yi-Hung Wei Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 34848d5c896ea1ab4e3c441b9c4fed39928ccbaf Author: Yi-Hung Wei Date: Mon Jul 2 17:33:43 2018 -0700 netfilter: nf_conncount: Split insert and traversal This patch is originally from Florian Westphal. When we have a very coarse grouping, e.g. by large subnets, zone id, etc, it's likely that we do not need to do tree rotation because we'll find a node where we can attach new entry. Based on this observation, we split tree traversal and insertion. Later on, we can make traversal lockless (tree protected by RCU), and add extra lock in the individual nodes to protect list insertion/deletion, thereby allowing parallel insert/delete in different tree nodes. Signed-off-by: Yi-Hung Wei Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2ba39118c10ae3a7d3411c073485bba9576684cd Author: Yi-Hung Wei Date: Mon Jul 2 17:33:42 2018 -0700 netfilter: nf_conncount: Move locking into count_tree() This patch is originally from Florian Westphal. This is a preparation patch to allow lockless traversal of the tree via RCU. Signed-off-by: Yi-Hung Wei Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 976afca1ceba53df6f4a543014e15d1c7a962571 Author: Yi-Hung Wei Date: Mon Jul 2 17:33:41 2018 -0700 netfilter: nf_conncount: Early exit in nf_conncount_lookup() and cleanup This patch is originally from Florian Westphal. This patch does the following three tasks. It applies the same early exit technique for nf_conncount_lookup(). Since now we keep the number of connections in 'struct nf_conncount_list', we no longer need to return the count in nf_conncount_lookup(). Moreover, we expose the garbage collection function nf_conncount_gc_list() for nft_connlimit. Signed-off-by: Yi-Hung Wei Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit cb2b36f5a97df76f547fcc4ab444a02522fb6c96 Author: Yi-Hung Wei Date: Mon Jul 2 17:33:40 2018 -0700 netfilter: nf_conncount: Switch to plain list Original patch is from Florian Westphal. This patch switches from hlist to plain list to store the list of connections with the same filtering key in nf_conncount. With the plain list, we can insert new connections at the tail, so over time the beginning of list holds long-running connections and those are expired, while the newly creates ones are at the end. Later on, we could probably move checked ones to the end of the list, so the next run has higher chance to reclaim stale entries in the front. Signed-off-by: Yi-Hung Wei Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2a406e8ac7c3e7e96b94d6c0765d5a4641970446 Author: Yi-Hung Wei Date: Mon Jul 2 17:33:39 2018 -0700 netfilter: nf_conncount: Early exit for garbage collection This patch is originally from Florian Westphal. We use an extra function with early exit for garbage collection. It is not necessary to traverse the full list for every node since it is enough to zap a couple of entries for garbage collection. Signed-off-by: Yi-Hung Wei Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 9951934d76b04570d4ccbc8d768530b6b7d69edf Merge: 67810693077a 2abc77af89e1 Author: Miklos Szeredi Date: Wed Jul 18 10:46:05 2018 +0200 Merge branch 'for-ovl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs into overlayfs-next This gives us the open_with_fake_path() helper that is needed for stacked open files in overlay and mmap in particular. commit 4d81b0f9e631f751bf231213893e202a51f76687 Author: Rafael J. Wysocki Date: Wed Jul 18 10:15:07 2018 +0200 cpufreq: pcc-cpufreq: Disable dynamic scaling on many-CPU systems The firmware interface used by the pcc-cpufreq driver is fundamentally not scalable and using it for dynamic CPU performance scaling on systems with many CPUs leads to degraded performance. For this reason, disable dynamic CPU performance scaling on systems with pcc-cpufreq where the number of CPUs present at the driver init time is greater than 4. Also make the driver print corresponding complaints to the kernel log. Reported-by: Andreas Herrmann Tested-by: Andreas Herrmann Signed-off-by: Rafael J. Wysocki commit f54ab690ad68e4c5a5b4d4b5dbb28a35018546c5 Author: Niklas Cassel Date: Tue Jul 17 22:48:21 2018 +0200 cpufreq: qcom-kryo: Silently error out on EPROBE_DEFER If of_nvmem_cell_get() fails due to probe deferal, we shouldn't print an error message. Just be silent in this case. Signed-off-by: Niklas Cassel Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 33477d84c26bbfa626da2c032e567a90dd70a528 Author: George Cherian Date: Wed Jul 11 23:07:55 2018 -0700 cpufreq / CPPC: Add cpuinfo_cur_freq support for CPPC Per Section 8.4.7.1.3 of ACPI 6.2, the platform provides performance feedback via set of performance counters. To determine the actual performance level delivered over time, OSPM may read a set of performance counters from the Reference Performance Counter Register and the Delivered Performance Counter Register. OSPM calculates the delivered performance over a given time period by taking a beginning and ending snapshot of both the reference and delivered performance counters, and calculating: delivered_perf = reference_perf X (delta of delivered_perf counter / delta of reference_perf counter). Implement the above and hook this up to the cpufreq->get method. Signed-off-by: George Cherian Acked-by: Viresh Kumar Acked-by: Prashanth Prakash Signed-off-by: Rafael J. Wysocki commit 1c3528232f4ba608cc2c31c7a8a55e0dbd6cb200 Author: Gregory CLEMENT Date: Tue Jun 19 14:44:01 2018 +0200 cpufreq: armada-37xx: Add AVS support Armada 37xx supports Adaptive Voltage Scaling and thanks to this patch a voltage is associated to each load level. Signed-off-by: Gregory CLEMENT Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit b8f0fadab208d87cab715b7599e0c15b4b2cc55f Author: Boris Brezillon Date: Mon Jul 9 22:09:44 2018 +0200 mtd: rawnand: jz4780: Drop the dependency on MACH_JZ4780 This MACH_JZ4780 dependency is taken care of by JZ4780_NEMC, no need to repeat it here. Signed-off-by: Boris Brezillon Acked-by: Paul Burton Signed-off-by: Miquel Raynal commit 6968e07e816906cd4b8150ef2e3af533664f734b Author: Boris Brezillon Date: Mon Jul 9 22:09:43 2018 +0200 mtd: rawnand: jz4740: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having MACH_JZ4740 enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Acked-by: Paul Burton Signed-off-by: Miquel Raynal commit e65e3a50702f4e7a01c0b36ff08d6ed8dde7ee7b Author: Boris Brezillon Date: Mon Jul 9 22:09:42 2018 +0200 MIPS: jz4740: Move jz4740_nand.h header to include/linux/platform_data/jz4740 This way we will be able to compile the jz4740_nand driver when COMPILE_TEST=y. Signed-off-by: Boris Brezillon Acked-by: Paul Burton Signed-off-by: Miquel Raynal commit eaea2e7300a23e9e40d15ff9b80c7407e3e7802c Author: Boris Brezillon Date: Mon Jul 9 22:09:41 2018 +0200 mtd: rawnand: txx9ndfmc: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having SOC_TX4938 or SOC_TX4939 enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Acked-by: Paul Burton Signed-off-by: Miquel Raynal commit dc2865ac3527d76fe04ee1f1a3ffc101a60faba0 Author: Boris Brezillon Date: Mon Jul 9 22:09:40 2018 +0200 MIPS: txx9: Move the ndfc.h header to include/linux/platform_data/txx9 This way we will be able to compile the ndfmc driver when COMPILE_TEST=y. Signed-off-by: Boris Brezillon Acked-by: Paul Burton Signed-off-by: Miquel Raynal commit a6be5051cdca8069abfe016a70ce9243ba1a2c0d Author: Boris Brezillon Date: Mon Jul 9 22:09:39 2018 +0200 mtd: rawnand: fsl_ifc: Allow selection of this driver when COMPILE_TEST=y It just makes maintainers' life easier by allowing them to compile-test this driver without having FSL_SOC, ARCH_LAYERSCAPE or SOC_LS1021A enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 62a316088dd07b31587e1874f2f9e4d096ef0da1 Author: Boris Brezillon Date: Mon Jul 9 22:09:38 2018 +0200 mtd: rawnand: fsl_ifc: Add an __iomem specifier on eccstat_regs The local eccstat_regs variable in fsl_ifc_run_command() is missing an __iomem specifier, and sparce complains about that. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit b30a2bd4ee9d3933ce397ab83a0b713e9423ec99 Author: Boris Brezillon Date: Mon Jul 9 22:09:37 2018 +0200 memory: fsl_ifc: Allow selection of this driver when COMPILE_TEST=y It just makes maintainers' life easier by allowing them to compile-test this driver without having FSL_SOC, ARCH_LAYERSCAPE or SOC_LS1021A enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 17c09ed706de451b7b449fd57198675349b58105 Author: Boris Brezillon Date: Mon Jul 9 22:09:36 2018 +0200 mtd: rawnand: fsmc: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having PLAT_SPEAR, ARCH_NOMADIK, ARCH_U8500 or MACH_U300 enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit f55824c6faef1df97439094a30b9f21fd2ce60a8 Author: Boris Brezillon Date: Mon Jul 9 22:09:35 2018 +0200 mtd: rawnand: fsmc: Use uintptr_t casts instead of unsigned ones uintptr_t should be used when casting a pointer to an unsigned int so that the code compiles without warnings even on 64-bit architectures. This is needed if we want to allow selection of this driver when COMPILE_TEST=y. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 8f3931ed975e1d775b87ce85d65ecacd54138359 Author: Boris Brezillon Date: Mon Jul 9 22:09:34 2018 +0200 mtd: rawnand: fscm: Avoid collision on PC def when compiling for MIPS We want to allow this driver to be selected when COMPILE_TEST=y, this means the driver can be compiled for any arch, including MIPS. When compiling this driver for MIPS, we end up with a collision on the 'PC' macro definition (also defined in arch/mips/include/asm/ptrace.h). Prefix the fsmc one with FSMC_ to avoid this problem. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit e37db6df41f5d45e43d5544b2cfadeed1710f086 Author: Boris Brezillon Date: Mon Jul 9 22:09:33 2018 +0200 mtd: rawnand: sunxi: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_SUNXI enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 06c8b5dc938117866460ee95b79318847dbde209 Author: Boris Brezillon Date: Mon Jul 9 22:09:32 2018 +0200 mtd: rawnand: sunxi: Make sure ret is initialized in sunxi_nfc_read_byte() Fixes the following smatch warning: drivers/mtd/nand/raw/sunxi_nand.c:551 sunxi_nfc_read_byte() error: uninitialized symbol 'ret'. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit cf3e3fd2e94f4648f17fbd5e0e26409d5d1face9 Author: Boris Brezillon Date: Mon Jul 9 22:09:31 2018 +0200 mtd: rawnand: sunxi: Add an U suffix to NFC_PAGE_OP definition Fixes the "warning: large integer implicitly truncated to unsigned type [-Woverflow]" warning when compiled for x86. This is needed in order to allow compiling this driver when COMPILE_TEST=y. Reported-by: Stephen Rothwell Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit b9221470b081c4dc52de859d47e2431e76b1fac2 Author: Boris Brezillon Date: Mon Jul 9 22:09:30 2018 +0200 mtd: rawnand: davinci: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_DAVINCI or ARCH_KEYSTONE enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit d3691813b05c654342fd01dfe3fff9a72828ebe7 Author: Miquel Raynal Date: Wed Jul 18 09:04:12 2018 +0200 mtd: rawnand: fix indentation in Kconfig Rules about Kconfig are simple but in the raw NAND directory indentation is somehow archaic. Fix the indentation in the whole file. Signed-off-by: Miquel Raynal commit cc53d5ca38c02e05efd20ba8af1759d1005aa454 Author: Boris Brezillon Date: Mon Jul 9 22:09:29 2018 +0200 mtd: rawnand: davinci: Use uintptr_t casts instead of unsigned ones uintptr_t should be used when casting a pointer to an unsigned int so that the code compiles without warnings even on 64-bit architectures. This is needed if we want to allow selection of this driver when COMPILE_TEST=y. Reported-by: Stephen Rothwell Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit c5b76d8dd2bf318d9e6b4b3a480b9e96c01b31c8 Author: Boris Brezillon Date: Mon Jul 9 22:09:28 2018 +0200 mtd: rawnand: davinci: Stop doing iomem pointer <-> u32 conversions There is no point in doing this sort of conversion since we can replace |= by += operations which are perfectly valid on pointers. This is done in preparation of COMPILE_TEST addition to the NAND_DAVINCI Kconfig entry, since building for x86 generates several warnings because of inappropriate u32 <-> void * conversions (pointers are 64-bit large on x86_64). Reported-by: Stephen Rothwell Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 88a40e7dca00fef96e4396c3e8c0077ab96b15a6 Author: Boris Brezillon Date: Mon Jul 9 22:09:24 2018 +0200 mtd: rawnand: atmel: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_AT91 enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit d28395c9083de4ee03e51b804d7acc591191bb00 Author: Boris Brezillon Date: Mon Jul 9 22:09:23 2018 +0200 mtd: rawnand: atmel: Add an __iomem cast on gen_pool_dma_alloc() call gen_pool_dma_alloc() return type is void *, while internally, the memory region exposed by the sram driver has been mapped with ioremap(). Add a void * to void __iomem * cast to make sparse happy. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit e6848511d06189cd28f83e5aef580510699fb2b4 Author: Boris Brezillon Date: Mon Jul 9 22:09:22 2018 +0200 mtd: rawnand: atmel: Use uintptr_t casts instead of unsigned int When casting a pointer to an unsigned int, uintptr_t should be used to cope with the pointer size differences between 32-bit and 64-bit architectures. This is needed if we want to allow compilation of this driver when COMPILE_TEST=y. Reported-by: Stephen Rothwell Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 20366e19e28f9954b25580c020d7a4e0db6055c4 Author: Boris Brezillon Date: Wed Jul 4 16:08:58 2018 +0200 mtd: rawnand: hynix: Use ->exec_op() in hynix_nand_reg_write_op() Modern NAND controller drivers implement ->exec_op() instead of ->cmdfunc(), make sure we don't end up with a NULL pointer dereference when hynix_nand_reg_write_op() is called. Fixes: 8878b126df76 ("mtd: nand: add ->exec_op() implementation") Cc: Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit f9e64d61042575960ce868fa974d9dbe4937c59a Author: Daniel Mack Date: Sun Jul 8 02:10:08 2018 +0200 mtd: rawnand: marvell: set reg_clk to NULL if it can't be obtained Don't keep an error-pointer around in the private struct. If this optional clock can't be obtained, simply set the pointer to NULL instead so we can use clk_prepare_enable() on it without further checks, Signed-off-by: Daniel Mack Signed-off-by: Miquel Raynal commit 7734a275a7eebf11878a923dc102908eff0f0657 Author: Daniel Mack Date: Sun Jul 8 02:10:07 2018 +0200 mtd: rawnand: marvell: remove bogus comment in marvell_nfc_select_chip() The comment in marvell_nfc_select_chip() about ndtr0 and ndtr1 didn't reflect what the driver was doing. The values of NDTR0 and NDTR1 are read from the registers at probe time and a copy is retained in 'struct marvell_nand_chip'. If keep-config is set in the DT properties, there are no other writers of these timing variables so they can safely be used when the chip is selected. As suggested by Miquel Raynal, simply remove the comment. Signed-off-by: Daniel Mack Signed-off-by: Miquel Raynal commit bd9c3f9b3c00da322b5e784e820533f1598f690a Author: Daniel Mack Date: Sun Jul 8 02:10:06 2018 +0200 mtd: rawnand: marvell: add suspend and resume hooks This patch restores the suspend and resume hooks that the old driver used to have. Apart from stopping and starting the clocks, the resume callback also nullifies the selected_chip pointer, so the next command that is issued will re-select the chip and thereby restore the timing registers. Factor out some code from marvell_nfc_init() into a new function marvell_nfc_reset() and also call it at resume time to reset some registers that don't retain their contents during low-power mode. Without this patch, a PXA3xx based system would cough up an error similar to the one below after resume. [ 44.660162] marvell-nfc 43100000.nand-controller: Timeout waiting for RB signal [ 44.671492] ubi0 error: ubi_io_write: error -110 while writing 2048 bytes to PEB 102:38912, written 0 bytes [ 44.682887] CPU: 0 PID: 1417 Comm: remote-control Not tainted 4.18.0-rc2+ #344 [ 44.691197] Hardware name: Marvell PXA3xx (Device Tree Support) [ 44.697111] Backtrace: [ 44.699593] [] (dump_backtrace) from [] (show_stack+0x18/0x1c) [ 44.708931] r7:00000800 r6:00009800 r5:00000066 r4:c6139000 [ 44.715833] [] (show_stack) from [] (dump_stack+0x20/0x28) [ 44.724206] [] (dump_stack) from [] (ubi_io_write+0x3d4/0x630) [ 44.732925] [] (ubi_io_write) from [] (ubi_eba_write_leb+0x690/0x6fc) ... Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver") Cc: stable@vger.kernel.org Signed-off-by: Daniel Mack Signed-off-by: Miquel Raynal commit c786bbcc1a2c15db29a2acb33d8a53e19a57d20d Author: Fabio Estevam Date: Sat Jul 7 14:25:21 2018 -0300 mtd: rawnand: mxc: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Miquel Raynal commit b04a3fe3143d23e8e450fe8b36868c6e99d5bdd0 Author: Fabio Estevam Date: Sat Jul 7 14:25:20 2018 -0300 mtd: rawnand: gpmi: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Miquel Raynal commit dc2d8856a758627d4f126d17bc113eedd72b2d60 Author: Boris Brezillon Date: Thu Jul 5 12:27:33 2018 +0200 mtd: rawnand: plat_nand: Kill pdata->ctrl.{hwcontrol, read_byte}() None of the board files are overloading those hooks, so let's drop them from struct platform_nand_ctrl. Signed-off-by: Boris Brezillon Acked-by: Robert Jarzmik Signed-off-by: Miquel Raynal commit f0f01838f76420988b50b23f315704c9a5cd2fa9 Author: Boris Brezillon Date: Thu Jul 5 12:27:32 2018 +0200 mtd: rawnand: orion_nand: Kill orion_nand_data.dev_ready() None of the boards seem to overload the ->dev_ready() hook, just drop this field from orion_nand_data. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit e80eba7581512625083ba540f120479b935425de Author: Boris Brezillon Date: Thu Jul 5 12:27:31 2018 +0200 mtd: rawnand: Kill the chip->scan_bbt() hook None of the existing drivers are overloading the ->scan_bbt() method, let's get rid of it and replace calls to ->scan_bbt() by nand_create_bbt() ones. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 2851b907091f2a04d19f50a5fc6a3aeed9e88dd3 Author: Gregory CLEMENT Date: Wed Jul 4 15:25:24 2018 +0200 dt-bindings: marvell: Add documentation for the Armada 3700 AVS binding Extend the documentation of the Armada 37xx SoC with the Adaptive Voltage Scaling (AVS) registers. Signed-off-by: Gregory CLEMENT Acked-by: Viresh Kumar Reviewed-by: Rob Herring Signed-off-by: Rafael J. Wysocki commit 44b07b921dea5ec997fb929ceaa82582a7415816 Author: Boris Brezillon Date: Thu Jul 5 12:27:30 2018 +0200 mtd: rawnand: Rename nand_default_bbt() into nand_create_bbt() Rename nand_default_bbt() into nand_create_bbt() and pass it a nand_chip object to prepare removal of the chip->scan_bbt() hook. We add a temporary nand_default_bbt() wrapper which will be dropped after the removal of ->scan_bbt(). Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 1c3ab61ebcf8cfb5308d2e68e03fd4b4df484e62 Author: Boris Brezillon Date: Thu Jul 5 12:27:29 2018 +0200 mtd: rawnand: Remove forward declaration of device_node struct device_node is defined in linux/of.h. Let's include this file instead of having a forward declaration of this struct. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 707329aca6e0cf5781ca7f62c39bdcb5f87e9c23 Author: Boris Brezillon Date: Thu Jul 5 12:27:28 2018 +0200 mtd: rawnand: Remove forward declaration of mtd_info struct mtd_info is defined in linux/mtd/mtd.h which is included at the beginning of nand_base.c, there's thus no need for the forward declaration of mtd_info. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit a4c025372d9d4756e7be98a98f5dde302c6df562 Author: Boris Brezillon Date: Thu Jul 5 12:27:27 2018 +0200 mtd: rawnand: Remove nand_do_read() prototype from rawnand.h nand_do_read() is a static function implemented in nand_base.c. There's no good reason to expose its prototype in rawnand.h. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 5dcddebb1b1f7638a2547d6729ca1ea501fb6834 Author: Boris Brezillon Date: Thu Jul 5 12:27:26 2018 +0200 mtd: rawnand: Kill cafe_nand_bug() Leaving a function pointer to NULL should be enough to trigger a NULL pointer exception, and anyway, if we want to BUG() when some missing hooks are called, this should be done in the core, so let's drop the cafe_nand_bug() dummy function. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit a58d0b4d512aceb06d8a968c1d19318c77faa6b0 Author: Boris Brezillon Date: Thu Jul 5 11:45:16 2018 +0200 bcma: Allow selection of this driver when COMPILE_TEST=y This allows us to increase compile-test coverage without having to build a kernel for MIPS. That's particularly interesting for subsystem maintainers that want to test as many drivers as possible in a single build. We also add a dependency on HAS_IOMEM in BCMA_HOST_SOC to make sure the driver is not selected when the arch does not implement IO accessors. Signed-off-by: Boris Brezillon Acked-by: Kalle Valo Signed-off-by: Miquel Raynal commit d4de09e5bb08138f06b6d27cd0246d32866b0c68 Author: Boris Brezillon Date: Thu Jul 5 11:45:13 2018 +0200 mtd: rawnand: nuc900: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_W90X900 enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit b2d55fe2ad5a47676292b1ef211fe4f9f14133ec Author: Boris Brezillon Date: Thu Jul 5 11:45:11 2018 +0200 mtd: rawnand: qcom: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_QCOM enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 434bc2e148aa5a6052cbc038f485fa3284a477d0 Author: Boris Brezillon Date: Thu Jul 5 11:45:08 2018 +0200 mtd: rawnand: mxc: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_MXC enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit c03f3cf37e54fee8c04c531dae1c81ebc8f58723 Author: Boris Brezillon Date: Thu Jul 5 11:45:07 2018 +0200 mtd: rawnand: mxc: Avoid inclusion of asm/mach headers asm/mach/flash.h does not seem to be needed, drop this #include to make the code completely machine and arch independent and allow one to compile it when COMPILE_TEST=y. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 0beb48724120ae13fe87d344a78fb430e077fed9 Author: Boris Brezillon Date: Thu Jul 5 11:45:04 2018 +0200 mtd: rawnand: brcmnand: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARM, ARM64 or MIPS enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit ee70e5e796ff30e486bef4800a633df8e14d6245 Author: Boris Brezillon Date: Thu Jul 5 11:45:03 2018 +0200 mtd: rawnand: lpc32xx: Allow selection of these drivers when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test these drivers without having ARCH_LPC32XX enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 18331b98102925f17be13421e153b050b8df01d3 Author: Boris Brezillon Date: Thu Jul 5 11:45:02 2018 +0200 mtd: rawnand: sharpsl: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_PXA enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit b22a8b075dbc755dd483e1d318c8f2933464583e Author: Boris Brezillon Date: Thu Jul 5 11:45:01 2018 +0200 mtd: rawnand: sharpsl: Remove inclusion of mach and asm headers We don't need mach/hardware.h and sm/mach-types.h, and asm/io.h can be replaced by linux/io.h. Now that we removed those inclusions, we're ready to allow selection of this driver when COMPILE_TEST=y. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 31ac1a53eb7f4407decbbbe65d8232311705029e Author: Boris Brezillon Date: Thu Jul 5 11:44:59 2018 +0200 mtd: rawnand: omap2: Allow selection of this driver when COMPILE_TEST=y It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_OMAP2PLUS or ARCH_KEYSTONE enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 45e9f40f466955c9880d59683531f6d1366b97cd Author: Boris Brezillon Date: Thu Jul 5 11:44:57 2018 +0200 mtd: rawnand: Add 'depends on HAS_IOMEM' where missing When COMPILE_TEST is allowed and the platform needs uses the iomem API we need to add an explicit dependency on HAS_IOMEM to avoid selection of these drivers when building for an arch that has no iomem support (this is the case of arch/um). Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 4d54df433558683236298cc15dbdfee9aa928dee Author: Boris Brezillon Date: Thu Jul 5 11:44:56 2018 +0200 mtd: rawnand: gpmi: Remove useless dependency on MTD_NAND The MTD_NAND_GPMI_NAND entry is already defined in an 'if MTD_NAND' block, no need to add an extra "depends on MTD_NAND". Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 9f43deee43511c2d70a8220f76854aab89f4e673 Author: Abhishek Sahu Date: Tue Jul 3 17:36:03 2018 +0530 mtd: rawnand: qcom: erased page bitflips detection NAND parts can have bitflips in an erased page due to the process technology used. In this case, QCOM NAND controller is not able to identify that page as an erased page. Currently the driver calls nand_check_erased_ecc_chunk() for identifying the erased pages but this won’t work always since the checking is being with ECC engine returned data. In case of bitflips, the ECC engine tries to correct the data and then it generates the uncorrectable error. Now, this data is not equal to original raw data. For erased CW identification, the raw data should be read again from NAND device and this nand_check_erased_ecc_chunk function() should be called for raw data only. Now following logic is being added to identify the erased codeword bitflips. 1. In most of the cases, not all the codewords will have bitflips and only single CW will have bitflips. So, there is no need to read the complete raw page data. The NAND raw read can be scheduled for any CW in page. The NAND controller works on CW basis and it will update the status register after each CW read. Maintain the bitmask for the CW which generated the uncorrectable error. 2. Do raw read for all the CW's which generated the uncorrectable error. 3. Both DATA and OOB need to be checked for number of 0. The top-level API can be called with only data buf or OOB buf so use chip->databuf if data buf is null and chip->oob_poi if OOB buf is null for copying the raw bytes temporarily. 4. For each CW, check the number of 0 in cw_data and usable oob bytes, The bbm and spare (unused) bytes bit flip won’t affect the ECC so don’t check the number of bitflips in this area. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit da8eb7d227c560a1557a16caee20d7be07b074f8 Author: Colin Ian King Date: Tue Jul 3 09:12:14 2018 +0100 mtd: rawnand: gpmi: remove redundant variable payload_virt Variable payload_virt is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'payload_virt' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Miquel Raynal commit 8604e6346e8db6dece741881d647606511ddafde Author: Miquel Raynal Date: Sun Feb 25 23:09:14 2018 +0100 mtd: rawnand: docg4: fix the probe function error path nand_release() should not be called on an MTD device that has not been registered. While it should work thanks to the checks done in mtd_device_unregister() it's a bad practice to cleanup/release something that has not previously been initialized/allocated. Rework the error path to follow this rule. Signed-off-by: Miquel Raynal commit 1dfac31a5a63ac04a9b5fbc3f5105a586560f191 Author: Masahiro Yamada Date: Sat Jun 23 01:06:38 2018 +0900 mtd: rawnand: denali: optimize timing parameters for data interface This commit improves the ->setup_data_interface() hook. The denali_setup_data_interface() needs the frequency of clk_x and the ratio of clk_x / clk. The latter is currently hardcoded in the driver, like this: #define DENALI_CLK_X_MULT 6 The IP datasheet requires that clk_x / clk be 4, 5, or 6. I just chose 6 because it is the most defensive value, but it is not optimal. By getting the clock rate of both "clk" and "clk_x", the driver can compute the timing values more precisely. To not break the existing platforms, the fallback value, 50 MHz is provided. It is true for all upstreamed platforms. Signed-off-by: Masahiro Yamada Reviewed-by: Richard Weinberger Tested-by: Richard Weinberger Signed-off-by: Miquel Raynal commit 6f1fe97bec349a1fd6c5a8c7c5998d759fe721d5 Author: Masahiro Yamada Date: Sat Jun 23 01:06:37 2018 +0900 mtd: rawnand: denali_dt: add more clocks based on IP datasheet Currently, denali_dt.c requires a single anonymous clock, but the Denali User's Guide requires three clocks for this IP: - clk: controller core clock - clk_x: bus interface clock - ecc_clk: clock at which ECC circuitry is run This commit supports these named clocks to represent the real hardware. For the backward compatibility, the driver still accepts a single clock just as before. The clk_x_rate is taken from the clock driver again if the named clock "clk_x" is available. This will happen only for future DT, hence the existing DT files are not affected. Signed-off-by: Masahiro Yamada Reviewed-by: Richard Weinberger Tested-by: Richard Weinberger Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit d91e8a3eec69a9767a6efa17543a12e1bfcbe099 Author: Masahiro Yamada Date: Sat Jun 23 01:06:36 2018 +0900 dt-binding: mtd: denali_dt: document clock property Commit 30f9f2fb7ba0 ("mtd: denali: add a DT driver") supported the clock enablement, but did not document it in the DT binding. In addition to the existing clock, this commit adds more clocks based on the IP specification. According to the Denali User's Guide, this IP needs three clocks: - clk: controller core clock - clk_x: bus interface clock - ecc_clk: clock at which ECC circuitry is run The driver should accept the current single clock for the backward compatibility, but the DT binding should represent the real hardware, and future platforms must follow this. Signed-off-by: Masahiro Yamada Reviewed-by: Boris Brezillon Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal commit cd1beffa83f680f3cb33be4e7cadfdf8399cef7e Author: Masahiro Yamada Date: Sat Jun 23 01:06:35 2018 +0900 mtd: rawnand: denali_dt: use dev as a shorthand of &pdev->dev The probe function references &pdev->dev many times, and I will add more soon. Add 'dev' as a shorthand. Signed-off-by: Masahiro Yamada Reviewed-by: Richard Weinberger Tested-by: Richard Weinberger Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 24f0ae995deb728076e3ea93fea1949a9775debf Author: Martin Kaiser Date: Wed Jun 27 22:47:44 2018 +0200 mtd: rawnand: mxc: remove __init qualifier from mxcnd_probe_dt Using the sysfs unbind, bind nodes, mxcnd_probe and mxcnd_probe_dt can potentially be called at any time. After the __init functions are cleaned, mxcnd_probe_dt is no longer available. Calling it anyway causes a crash. mxcnd_probe used to be marked as __init, this was removed years ago. Remove the __init qualifier from from mxcnd_probe_dt as well. Fixes: 06f255106923 ("mtd: remove use of __devinit") Signed-off-by: Martin Kaiser Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 3dfa025f890c4568adc9ba06ecc0da35718f4799 Author: Miquel Raynal Date: Fri Jun 22 14:28:28 2018 +0200 mtd: spinand: macronix: Add support for MX35LF2GE4AB MX35LF2GE4AB is almost identical to MX35LF1GE4AB except it has 2 times more eraseblocks per LUN and exposes 2 planes instead of 1. Signed-off-by: Miquel Raynal Signed-off-by: Boris Brezillon commit b02308af05e62c7d995f4fc75b0bc2ae3c3026f7 Author: Boris Brezillon Date: Fri Jun 22 14:28:27 2018 +0200 mtd: spinand: Add initial support for the MX35LF1GE4AB chip Add minimal support for the MX35LF1GE4AB SPI NAND chip. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 1075492bb9e26312bc8ddeec1a93e2de5f9c76b4 Author: Frieder Schrempf Date: Fri Jun 22 14:28:26 2018 +0200 mtd: spinand: Add initial support for Winbond W25M02GV Add support for the W25M02GV chip. Signed-off-by: Frieder Schrempf Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit a508e8875e135d7a1df26d8131b5443cb07005ff Author: Peter Pan Date: Fri Jun 22 14:28:25 2018 +0200 mtd: spinand: Add initial support for Micron MT29F2G01ABAGD Add a basic driver for Micron SPI NANDs. Only one device is supported right now, but the driver will be extended to support more devices afterwards. Signed-off-by: Peter Pan Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 5ef5640a27775f533c8c6ad85e06db4f37ead9c0 Author: Boris Brezillon Date: Fri Jun 22 14:28:24 2018 +0200 dt-bindings: Add bindings for SPI NAND devices Add bindings for SPI NAND chips. Signed-off-by: Boris Brezillon Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal commit 7529df4652482c33ae1a99ee8189401146f13cb7 Author: Peter Pan Date: Fri Jun 22 14:28:23 2018 +0200 mtd: nand: Add core infrastructure to support SPI NANDs Add a SPI NAND framework based on the generic NAND framework and the spi-mem infrastructure. In its current state, this framework supports the following features: - single/dual/quad IO modes - on-die ECC Signed-off-by: Peter Pan Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 0cf5c7dbaa392d11cfae532cedeaad0ac48b2165 Author: Abhishek Sahu Date: Wed Jun 20 12:57:42 2018 +0530 mtd: rawnand: provide only single helper function for ECC conf Function nand_ecc_choose_conf() will be help for all the cases, so other helper functions can be made static. nand_check_ecc_caps(): Invoke nand_ecc_choose_conf() with both chip->ecc.size and chip->ecc.strength value set. nand_maximize_ecc(): Invoke nand_ecc_choose_conf() with NAND_ECC_MAXIMIZE flag. nand_match_ecc_req(): Invoke nand_ecc_choose_conf() with either chip->ecc.size or chip->ecc.strength value set and without NAND_ECC_MAXIMIZE flag. CC: Masahiro Yamada Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 85632c17194e35e00871cfd80713c9acf087ac4f Author: Abhishek Sahu Date: Wed Jun 20 12:57:40 2018 +0530 mtd: rawnand: qcom: code reorganization for raw read Make separate function to perform raw read for one codeword and call this function multiple times for each codeword in case of raw page read. This separate function will help in subsequent patches related with erased codeword bitflip detection. It will decrease throughput for raw page read. Raw page read is used for debug purpose so it won't affect normal flash operations. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 5bc36b2bf6e2c8bff723ebcd9ae9bd38156d21c0 Author: Abhishek Sahu Date: Wed Jun 20 12:57:39 2018 +0530 mtd: rawnand: qcom: check for operation errors in case of raw read Currently there is no error checking for raw read. For raw reads, there won’t be any ECC failure but the operational failures are possible, so schedule the NAND_FLASH_STATUS read after each codeword. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 783b5bf9bd91a59717df38ec3ba7d65b1f441f32 Author: Abhishek Sahu Date: Wed Jun 20 12:57:38 2018 +0530 mtd: rawnand: qcom: fix return value for raw page read Fix value returned by ->read_page_raw() to be the actual operation status, instead of always 0. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 28eed9f6cab6ab28cdca4a43df4f8ed51dd5f8f8 Author: Abhishek Sahu Date: Wed Jun 20 12:57:37 2018 +0530 mtd: rawnand: qcom: modify write_oob to remove read codeword part QCOM NAND controller layout protects available OOB data bytes with ECC also so when ecc->write_oob() is being called then it can't update just OOB bytes. Currently, it first reads the last codeword which includes old OOB bytes. Then it updates the old OOB bytes with new ones and then again writes the codeword back. The reading codeword is unnecessary since user is responsible to have these bytes cleared to 0xFF. This patch removes the read part and updates the OOB bytes with data area padded with OxFF. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit add0cfa3c3e51149c2101765edf05c548ba5f2ee Author: Abhishek Sahu Date: Wed Jun 20 12:57:36 2018 +0530 mtd: rawnand: qcom: parse read errors for read oob also read_page and read_oob both calls the read_page_ecc function. The QCOM NAND controller protect the OOB available bytes with ECC so read errors should be checked for read_oob also. This patch moves the error checking code inside read_page_ecc so caller does not have to check explicitly for read errors. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 2f610386736d9e5dc69fa06374138f9712690921 Author: Abhishek Sahu Date: Wed Jun 20 12:57:35 2018 +0530 mtd: rawnand: qcom: fix null pointer access for erased page detection parse_read_errors can be called with only oob_buf in which case data_buf will be NULL. If data_buf is NULL, then don’t treat this page as completely erased in case of ECC uncorrectable error for RS ECC. For BCH ECC, the controller itself tells regarding erased page in status register. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 8eab72148808a74535c3322f6ca30aba77d2d4a9 Author: Abhishek Sahu Date: Wed Jun 20 12:57:34 2018 +0530 mtd: rawnand: qcom: erased page detection for uncorrectable errors only Following is the flow in the HW if controller tries to read erased page: 1. First ECC uncorrectable error will be generated from ECC engine since ECC engine first calculates the ECC with all 0xff and match the calculated ECC with ECC code in OOB (which is again all 0xff). 2. After getting ECC error, erased CW detection logic will be applied which is different for BCH and RS ECC a. For BCH, HW checks if all the bytes in page are 0xff and then it updates the status in separate register NAND_ERASED_CW_DETECT_STATUS. b. For RS ECC, the HW reports the same error when reading an erased CW, but it notifies that it is an erased CW by placing special characters at certain offsets in the buffer. So the erased CW detect status should be checked only if ECC engine generated the uncorrectable error. Currently for all other operational errors also (like TIMEOUT, MPU errors, etc.), the erased CW detect logic is being applied so fix this and return EIO for other operational errors. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 6f20070d51a20e489ef117603210264c6bcde8a5 Author: Abhishek Sahu Date: Wed Jun 20 12:57:33 2018 +0530 mtd: rawnand: qcom: wait for desc completion in all BAM channels The BAM has 3 channels - tx, rx and command. command channel is used for register read/writes, tx channel for data writes and rx channel for data reads. Currently, the driver assumes the transfer completion once it gets all the command descriptors completed. Sometimes, there is race condition between data channel (tx/rx) and command channel completion. In these cases, the data present in buffer is not valid during small window between command descriptor completion and data descriptor completion. This patch generates NAND transfer completion when both (Data and Command) DMA channels have completed all its DMA descriptors. It assigns completion callback in last DMA descriptors of that channel and wait for completion. Fixes: 8d6b6d7e135e ("mtd: nand: qcom: support for command descriptor formation") Cc: stable@vger.kernel.org Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 7ddb937f2c1dc79a9d35e6319b96e05ba7b04a8f Author: Abhishek Sahu Date: Wed Jun 20 12:57:32 2018 +0530 mtd: rawnand: qcom: use the ecc strength from device parameter Currently the driver uses the ECC strength specified in DT. The QPIC/EBI2 NAND supports 4 or 8-bit ECC correction. The same kind of board can have different NAND parts so use the ECC strength from device parameters if it is not specified in DT. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit 320bdb5fb9c4a6b67ceadab2d7ed74c21c957561 Author: Abhishek Sahu Date: Wed Jun 20 12:57:31 2018 +0530 mtd: rawnand: qcom: remove dt property nand-ecc-step-size QCOM NAND controller supports only one step size (512) so nand-ecc-step-size DT property is redundant. This property can be removed and ecc step size can be assigned with 512 value. Signed-off-by: Abhishek Sahu Signed-off-by: Miquel Raynal commit c168ac273ce34b8fb181b230544c4eac80f55b9f Author: Abhishek Sahu Date: Wed Jun 20 12:57:30 2018 +0530 dt-bindings: qcom_nandc: update for ECC strength and step size 1. If nand-ecc-strength specified in DT, then controller will use this ECC strength otherwise ECC strength will be calculated according to chip requirement and available OOB size. 2. QCOM NAND controller supports only one step size (512 bytes) but nand-ecc-step-size is required property in DT. This DT property can be removed and ecc step size can be assigned in driver with 512 bytes value. Signed-off-by: Abhishek Sahu Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal commit f9801fda963ec9d0f6521695d2b0158249d85c94 Author: Abhishek Sahu Date: Wed Jun 20 12:57:29 2018 +0530 mtd: rawnand: denali: use helper function for ecc setup Use the NAND core helper function nand_ecc_choose_conf to tune the ECC parameters instead of the function locally defined. Signed-off-by: Abhishek Sahu Acked-by: Masahiro Yamada Signed-off-by: Miquel Raynal commit 181ace9e1b2e1c5c2be590bc9603baa65f3a16d8 Author: Abhishek Sahu Date: Wed Jun 20 12:57:28 2018 +0530 mtd: rawnand: helper function for setting up ECC configuration commit 2c8f8afa7f92 ("mtd: nand: add generic helpers to check, match, maximize ECC settings") provides generic helpers which drivers can use for setting up ECC parameters. Since same board can have different ECC strength nand chips so following is the logic for setting up ECC strength and ECC step size, which can be used by most of the drivers. 1. If both ECC step size and ECC strength are already set (usually by DT) then just check whether this setting is supported by NAND controller. 2. If NAND_ECC_MAXIMIZE is set, then select maximum ECC strength supported by NAND controller. 3. Otherwise, try to match the ECC step size and ECC strength closest to the chip's requirement. If available OOB size can't fit the chip requirement then select maximum ECC strength which can be fit with available OOB size. This patch introduces nand_ecc_choose_conf function which calls the required helper functions for the above logic. The drivers can use this single function instead of calling the 3 helper functions individually. Signed-off-by: Abhishek Sahu Reviewed-by: Masahiro Yamada Signed-off-by: Miquel Raynal commit a33733fc4891499dc170f9cff6c53a513dce24db Merge: 9d3cce1e8b85 d6e98f3e6d82 Author: Rafael J. Wysocki Date: Wed Jul 18 09:01:42 2018 +0200 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq into pm-devfreq Pull devfreq fixes and documentation updates for v4.19 from MyungJoo Ham. * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq: PM / devfreq: rk3399_dmc: Fix duplicated opp table on reload. PM / devfreq: Init user limits from OPP limits, not viceversa PM / devfreq: rk3399_dmc: fix spelling mistakes. PM / devfreq: rk3399_dmc: do not print error when get supply and clk defer. dt-bindings: devfreq: rk3399_dmc: move interrupts to be optional. PM / devfreq: rk3399_dmc: remove wait for dcf irq event. dt-bindings: clock: add rk3399 DDR3 standard speed bins. dt-bindings: devfreq: rk3399_dmc: improve binding documentation. PM / devfreq: use put_device() instead of kfree() PM / devfreq: exynos-ppmu: Delete an error message for a failed memory allocation in exynos_ppmu_probe() commit aeaf7002a76c8da60c0f503badcbddc07650678c Author: Martin Schwidefsky Date: Tue May 8 15:14:48 2018 +0200 s390: detect etoken facility Detect and report the etoken facility. With spectre_v2=auto or CONFIG_EXPOLINE_AUTO=y automatically disable expolines and use the full branch prediction mode for the kernel. Signed-off-by: Martin Schwidefsky commit fa84cf094ef9667e2b91c104b0a788fd1896f482 Author: Takashi Iwai Date: Wed Jul 18 07:40:53 2018 +0200 ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc() snd_pcm_lib_mmap_vmalloc() was supposed to be implemented with somewhat special for vmalloc handling, but in the end, this turned to just the default handler, i.e. NULL. As the situation has never changed over decades, let's rip it off. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit ef4db239cda2d74f53120e223643b0f5bbf947c1 Author: Takashi Iwai Date: Tue Jul 17 23:12:33 2018 +0200 ALSA: rawmidi: Use kvmalloc() for buffers The size of in-kernel rawmidi buffers may be big up to 1MB, and it can be specified freely by user-space; which implies that user-space may trigger kmalloc() errors frequently. This patch replaces the buffer allocation via kvmalloc() for dealing with bigger buffers gracefully. Signed-off-by: Takashi Iwai commit c0b78038a8477bf0e3368988a3ff63f668cd27db Merge: fa52531eb440 993a4a5f7cd3 Author: David S. Miller Date: Wed Jul 18 14:46:57 2018 +0900 Merge tag 'batadv-next-for-davem-20180717' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This feature/cleanup patchset includes the following patches: - Don't call BATMAN_V experimental in Kconfig anymore, by Sven Eckelmann - Enable DAT by default at compile time, by Antonio Quartulli - Remove obsolete default n in Kconfig, by Sven Eckelmann - Fix checkpatch spelling errors, by Sven Eckelmann - Unify header guards style, by Sven Eckelmann - Consolidate batadv_purge_orig functions, by Sven Eckelmann - Replace type define with proper typedef, by Sven Eckelmann ==================== Signed-off-by: David S. Miller commit fa52531eb4409a1fc0cc11ac37e249088d3561c7 Author: Håkon Bugge Date: Mon Jul 16 15:06:39 2018 +0200 net/rds: Remove unnecessary variable Signed-off-by: Håkon Bugge Signed-off-by: David S. Miller commit bfd4271169176766343026bf324337e529d81fa4 Author: Håkon Bugge Date: Mon Jul 16 15:00:09 2018 +0200 net/rds: void function cannot return -1 Commit b6fb0df12db6 ("RDS/IB: Make ib_recv_refill return void") did not change the comment accordingly. Fixes: b6fb0df12db6 ("RDS/IB: Make ib_recv_refill return void") Signed-off-by: Håkon Bugge Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller commit db53770a3eaf37ae732888ba999c223ebb721348 Author: David S. Miller Date: Wed Jul 18 14:42:18 2018 +0900 dsa: rtl8366: Remove unused variable. drivers/net/dsa/rtl8366.c: In function ‘rtl8366_reset_vlan’: drivers/net/dsa/rtl8366.c:234:25: warning: unused variable ‘vlan4k’ [-Wunused-variable] Signed-off-by: David S. Miller commit abd709c7ee2a9d4541a47594605cf2d3d89272f3 Merge: 22a001e8544f e49b42faae0e Author: David S. Miller Date: Wed Jul 18 14:21:49 2018 +0900 Merge branch 'ravb-small-sparse-fixes' Niklas Söderlund says: ==================== ravb: small sparse fixes This are fixes that have bugged me whenever I run sparse to check my own changes to the driver. It's based on the latest net-next tree and tested on M3-N. ==================== Signed-off-by: David S. Miller commit e49b42faae0eec619ad96d877d5e463efd3ca12f Author: Niklas Söderlund Date: Mon Jul 16 14:19:27 2018 +0200 ravb: fix byte order for TX descriptor tag field lower bits The wrong helper is used to swap the bytes when adding the lower bits of the TX descriptors tag field in the shared ds_tagl variable. The variable contains the DS[11:0] field and then the TAG[3:0] bits. The mistake was highlighted by the sparse warning: ravb_main.c:1622:31: left side has type restricted __le16 ravb_main.c:1622:31: right side has type unsigned short ravb_main.c:1622:31: warning: invalid assignment: |= ravb_main.c:1622:34: warning: cast to restricted __le16 Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Acked-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 49f3303a6eaa86c64597c33323d03ab0cbdccbe5 Author: Niklas Söderlund Date: Mon Jul 16 14:19:26 2018 +0200 ravb: fix warning about memcpy length This fixes sparse warning: ravb_main.c:1257 ravb_get_strings() error: memcpy() '*ravb_gstrings_stats' too small (32 vs 960) Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Acked-by: Sergei Shtylyov Signed-off-by: David S. Miller commit c94f2fc4fc19a0ab29456b652975e08e0362c94a Author: Niklas Söderlund Date: Mon Jul 16 14:19:25 2018 +0200 ravb: fix shadowing of symbol 'stats' in ravb_get_ethtool_stats() Inside a loop in ravb_get_ethtool_stats() a variable 'stats' is declared resulting in the argument also named 'stats' to be shadowed. Fix this warning by renaming the unused argument 'stats' to 'estats'. This fixes the sparse warning: ravb_main.c:1225:36: originally declared here ravb_main.c:1233:41: warning: symbol 'stats' shadows an earlier one Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Acked-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 0abb75b7a16d21e2fb0d98634df44c37c184f186 Author: Nicholas Mc Guire Date: Sat Jul 7 11:07:25 2018 +0200 KVM: PPC: Book3S HV: Fix constant size warning The constants are 64bit but not explicitly declared UL resulting in sparse warnings. Fix this by declaring the constants UL. Signed-off-by: Nicholas Mc Guire Signed-off-by: Paul Mackerras commit 51eaa08f029c7343df846325d7cf047be8b96e81 Author: Nicholas Mc Guire Date: Sat Jul 7 08:53:07 2018 +0200 KVM: PPC: Book3S HV: Add of_node_put() in success path The call to of_find_compatible_node() is returning a pointer with incremented refcount so it must be explicitly decremented after the last use. As here it is only being used for checking of node presence but the result is not actually used in the success path it can be dropped immediately. Signed-off-by: Nicholas Mc Guire Fixes: commit f725758b899f ("KVM: PPC: Book3S HV: Use OPAL XICS emulation on POWER9") Signed-off-by: Paul Mackerras commit 76346cd93a5eca33700f82685d56172dd65d4c0a Author: Alexey Kardashevskiy Date: Wed Jun 20 18:42:58 2018 +1000 KVM: PPC: Book3S: Fix matching of hardware and emulated TCE tables When attaching a hardware table to LIOBN in KVM, we match table parameters such as page size, table offset and table size. However the tables are created via very different paths - VFIO and KVM - and the VFIO path goes through the platform code which has minimum TCE page size requirement (which is 4K but since we allocate memory by pages and cannot avoid alignment anyway, we align to 64k pages for powernv_defconfig). So when we match the tables, one might be bigger that the other which means the hardware table cannot get attached to LIOBN and DMA mapping fails. This removes the table size alignment from the guest visible table. This does not affect the memory allocation which is still aligned - kvmppc_tce_pages() takes care of this. This relaxes the check we do when attaching tables to allow the hardware table be bigger than the guest visible table. Ideally we want the KVM table to cover the same space as the hardware table does but since the hardware table may use multiple levels, and all levels must use the same table size (IODA2 design), the area it can actually cover might get very different from the window size which the guest requested, even though the guest won't map it all. Fixes: ca1fc489cf "KVM: PPC: Book3S: Allow backing bigger guest IOMMU pages with smaller physical pages" Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Paul Mackerras commit 4eeb85568e5653c71d901f7593d3f3e7e2a5414f Author: Simon Guo Date: Mon May 28 09:48:26 2018 +0800 KVM: PPC: Remove mmio_vsx_tx_sx_enabled in KVM MMIO emulation Originally PPC KVM MMIO emulation uses only 0~31#(5 bits) for VSR reg number, and use mmio_vsx_tx_sx_enabled field together for 0~63# VSR regs. Currently PPC KVM MMIO emulation is reimplemented with analyse_instr() assistance. analyse_instr() returns 0~63 for VSR register number, so it is not necessary to use additional mmio_vsx_tx_sx_enabled field any more. This patch extends related reg bits (expand io_gpr to u16 from u8 and use 6 bits for VSR reg#), so that mmio_vsx_tx_sx_enabled can be removed. Signed-off-by: Simon Guo Signed-off-by: Paul Mackerras commit d6e98f3e6d825380b566dc59359917a116090154 Author: Enric Balletbo i Serra Date: Fri Jun 15 17:12:17 2018 +0200 PM / devfreq: rk3399_dmc: Fix duplicated opp table on reload. The opp table is not removed when the driver is unloaded neither when there is an error within probe, so if the driver is reloaded the opp core shows the following warning: rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq: 200000000, volt: 900000, enabled: 1. New: freq: 200000000, volt: 900000, enabled: 1 rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq: 400000000, volt: 900000, enabled: 1. New: freq: 400000000, volt: 900000, enabled: 1 rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq: 666000000, volt: 900000, enabled: 1. New: freq: 666000000, volt: 900000, enabled: 1 rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq: 800000000, volt: 900000, enabled: 1. New: freq: 800000000, volt: 900000, enabled: 1 rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq: 928000000, volt: 900000, enabled: 1. New: freq: 928000000, volt: 900000, enabled: 1 This patch fixes the error path in the probe function and adds a .remove function to properly cleanup the opp table on unloading. Fixes: 5a893e31a636c (PM / devfreq: rockchip: add devfreq driver for rk3399 dmc) Signed-off-by: Enric Balletbo i Serra Reviewed-by: Chanwoo Choi Signed-off-by: MyungJoo Ham commit 2c2cb1e6b05b90d55b4b943646faa3cfbdf78f6e Author: Matthias Kaehlcke Date: Fri May 25 13:30:33 2018 -0700 PM / devfreq: Init user limits from OPP limits, not viceversa Commit ab8f58ad72c4 ("PM / devfreq: Set min/max_freq when adding the devfreq device") introduced the initialization of the user limits min/max_freq from the lowest/highest available OPPs. Later commit f1d981eaecf8 ("PM / devfreq: Use the available min/max frequency") added scaling_min/max_freq, which actually represent the frequencies of the lowest/highest available OPP. scaling_min/ max_freq are initialized with the values from min/max_freq, which is totally correct in the context, but a bit awkward to read. Swap the initialization and assign scaling_min/max_freq with the OPP freqs and then the user limts min/max_freq with scaling_min/ max_freq. Needless to say that this change is a NOP, intended to improve readability. Signed-off-by: Matthias Kaehlcke Reviewed-by: Chanwoo Choi Reviewed-by: Brian Norris Signed-off-by: MyungJoo Ham commit dfa7d764caf00b12da276ea473d7f1fd7fd40200 Author: Enric Balletbo i Serra Date: Wed May 9 14:57:48 2018 +0200 PM / devfreq: rk3399_dmc: fix spelling mistakes. Fix some spelling mistakes in error and debug messages. Signed-off-by: Enric Balletbo i Serra Signed-off-by: MyungJoo Ham commit 49edc52312c34c981722833b0d9344c2aa83892d Author: Lin Huang Date: Wed May 9 14:57:47 2018 +0200 PM / devfreq: rk3399_dmc: do not print error when get supply and clk defer. We just return -EPROBE_DEFER error code to caller and do not print error message when try to get center logic regulator and DMC clock defer. Signed-off-by: Lin Huang Signed-off-by: Enric Balletbo i Serra Reviewed-by: Chanwoo Choi Signed-off-by: MyungJoo Ham commit 77f2c2305decda26885f8b2307577267b78c468f Author: Enric Balletbo i Serra Date: Wed May 9 14:57:46 2018 +0200 dt-bindings: devfreq: rk3399_dmc: move interrupts to be optional. In ATF we already wait for DDR DVFS finish, so move the interrupts properties to be optional. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Chanwoo Choi Reviewed-by: Rob Herring Signed-off-by: MyungJoo Ham commit 90dd72e1290dd86c4b6e5c421fcd13e60e625782 Author: Enric Balletbo i Serra Date: Wed May 9 14:57:45 2018 +0200 PM / devfreq: rk3399_dmc: remove wait for dcf irq event. We have already wait dcf done in ATF, so don't need wait dcf irq in kernel, besides, clear dcf irq in kernel will import competiton between kernel and ATF, only handle dcf irq in ATF is a better way. Signed-off-by: Lin Huang Signed-off-by: Enric Balletbo i Serra Reviewed-by: Chanwoo Choi Signed-off-by: MyungJoo Ham commit 49502b23e0e45b57b776490cfdfd95ea7fecd7c7 Author: Enric Balletbo i Serra Date: Wed May 9 14:57:44 2018 +0200 dt-bindings: clock: add rk3399 DDR3 standard speed bins. DDR3 SDRAM Standard (JESD79-3F) defines some standard speed bins for DDR3 memories. The rk3399_dmc driver allows you to pass these values via the device tree. For that purpose the devfreq/rk3399_dmc.txt binding refers to a ddr.h file which does not exist. This patch adds the missing defines in a include file called rk3399-ddr.h with the definition of standard speed bins according to the ARM Trusted Firmware (ATF). Fixes: c1ceb8f7c167 (Documentation: bindings: add dt documentation for rk3399 dmc) Signed-off-by: Enric Balletbo i Serra Reviewed-by: Rob Herring Signed-off-by: MyungJoo Ham commit 2d2894c94a61930615cd1411cd8e0bf5b804e3a1 Author: Nick Milner Date: Wed May 9 14:57:43 2018 +0200 dt-bindings: devfreq: rk3399_dmc: improve binding documentation. There are several typos, references to non existent files, grammar and punctuation mistakes in the rk3399_dmc.txt binding. This patch tries to improve the binding documentation and fix these mistakes. Signed-off-by: Nick Milner Signed-off-by: Enric Balletbo i Serra Reviewed-by: Rob Herring - [1/5] Fix some attributes to match with the code s/_disb/_dis/ Signed-off-by: MyungJoo Ham commit 2d803dc8f7a5f622ac47c3b650834ada3a2659b9 Author: Arvind Yadav Date: Fri Mar 30 17:14:03 2018 +0530 PM / devfreq: use put_device() instead of kfree() Never directly free @dev after calling device_register() or device_unregister(), even if device_register() returned an error. Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav Reviewed-by: Chanwoo Choi Signed-off-by: MyungJoo Ham commit 12ba2c65f9d3d6996d1e909921151487b009dd30 Author: Markus Elfring Date: Tue Feb 13 22:10:42 2018 +0100 PM / devfreq: exynos-ppmu: Delete an error message for a failed memory allocation in exynos_ppmu_probe() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Chanwoo Choi Signed-off-by: MyungJoo Ham commit 22a001e8544fa9d89a1d3d7491ca1d8f9466b69d Author: Linus Walleij Date: Sat Jul 14 11:45:56 2018 +0200 ARM: dts: Add ethernet and switch to D-Link DIR-685 This adds the Ethernet and Realtek switch device to the D-Link DIR-685 Gemini-based device. Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit d8652956cf37c5caa8c19e0b99ce5ca235c6d5de Author: Linus Walleij Date: Sat Jul 14 11:45:55 2018 +0200 net: dsa: realtek-smi: Add Realtek SMI driver This adds a driver core for the Realtek SMI chips and a subdriver for the RTL8366RB. I just added this chip simply because it is all I can test. The code is a massaged variant of the code that has been sitting out-of-tree in OpenWRT for years in the absence of a proper switch subsystem. This creates a DSA driver for it. I have tried to credit the original authors wherever possible. The main changes I've done from the OpenWRT code: - Added an IRQ chip inside the RTL8366RB switch to demux and handle the line state IRQs. - Distributed the phy handling out to the PHY driver. - Added some RTL8366RB code that was missing in the driver at the time, such as setting up "green ethernet" with a funny jam table and forcing MAC5 (the CPU port) into 1 GBit. - Select jam table and add the default jam table from the vendor driver, also for ASIC "version 0" if need be. - Do not store jam tables in the device tree, store them in the driver. - Pick in the "initvals" jam tables from OpenWRT's driver and make those get selected per compatible for the whole system. It's apparently about electrical settings for this system and whatnot, not really configuration from device tree. - Implemented LED control: beware of bugs because there are no LEDs on the device I am using! We do not implement custom DSA tags. This is explained in a comment in the driver as well: this "tagging protocol" is not simply a few extra bytes tagged on to the ethernet frame as DSA is used to. Instead, enabling the CPU tags will make the switch start talking Realtek RRCP internally. For example a simple ping will make this kind of packets appear inside the switch: 0000 ff ff ff ff ff ff bc ae c5 6b a8 3d 88 99 a2 00 0010 08 06 00 01 08 00 06 04 00 01 bc ae c5 6b a8 3d 0020 a9 fe 01 01 00 00 00 00 00 00 a9 fe 01 02 00 00 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 As you can see a custom "8899" tagged packet using the protocol 0xa2. Norm RRCP appears to always have this protocol set to 0x01 according to OpenRRCP. You can also see that this is not a ping packet at all, instead the switch is starting to talk network management issues with the CPU port. So for now custom "tagging" is disabled. This was tested on the D-Link DIR-685 with initramfs and OpenWRT userspaces and works fine on all the LAN ports (lan0 .. lan3). The WAN port is yet not working. Cc: Antti Seppälä Cc: Roman Yeryomin Cc: Colin Leitner Cc: Gabor Juhos Cc: Florian Fainelli Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 3b3b6b460f78101294d7185a3eae8ed6ad920ab3 Author: Linus Walleij Date: Sat Jul 14 11:45:54 2018 +0200 net: dsa: Add bindings for Realtek SMI DSAs The Realtek SMI family is a set of DSA chips that provide switching in routers. This binding just follows the pattern set by other switches but with the introduction of an embedded irqchip to demux and handle the interrupts fired by the single line from the chip. This interrupt construction is similar to how we handle interrupt controllers inside PCI bridges etc. Cc: Antti Seppälä Cc: Roman Yeryomin Cc: Colin Leitner Cc: Gabor Juhos Cc: Florian Fainelli Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit d85458256ad2583df95deb0bb7a3403b74be177a Author: Linus Walleij Date: Sat Jul 14 11:45:53 2018 +0200 net: phy: realtek: Support RTL8366RB variant The RTL8366RB is an ASIC with five internal PHYs for LAN0..LAN3 and WAN. The PHYs are spawn off the main device so they can be handled in a distributed manner by the Realtek PHY driver. All that is really needed is the power save feature enablement and letting the PHY driver core pick up the IRQ from the switch chip. Cc: Antti Seppälä Cc: Roman Yeryomin Cc: Colin Leitner Cc: Gabor Juhos Cc: Florian Fainelli Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 87ea58433208d17295e200d56be5e2a4fe4ce7d6 Author: Eric Biggers Date: Tue Jul 17 10:36:04 2018 -0700 security: check for kstrdup() failure in lsm_append() lsm_append() should return -ENOMEM if memory allocation failed. Fixes: d69dece5f5b6 ("LSM: Add /sys/kernel/security/lsm") Signed-off-by: Eric Biggers Signed-off-by: James Morris commit 83a68a06795fa47e77ea758f293a5946e9e02e84 Author: Arnd Bergmann Date: Tue Jul 17 22:23:37 2018 +0200 security: export security_kernel_load_data function The firmware_loader can be built as a loadable module, which now fails when CONFIG_SECURITY is enabled, because a call to the security_kernel_load_data() function got added, and this is not exported to modules: ERROR: "security_kernel_load_data" [drivers/base/firmware_loader/firmware_class.ko] undefined! Add an EXPORT_SYMBOL_GPL() to make it available here. Fixes: 6e852651f28e ("firmware: add call to LSM hook before firmware sysfs fallback") Signed-off-by: Arnd Bergmann Signed-off-by: James Morris commit 3672476edaa0660eb833f54fa9edeb505417b75c Author: Tobin C. Harding Date: Fri Jun 22 09:15:34 2018 +1000 vsprintf: Add command line option debug_boot_weak_hash Currently printing [hashed] pointers requires enough entropy to be available. Early in the boot sequence this may not be the case resulting in a dummy string '(____ptrval____)' being printed. This makes debugging the early boot sequence difficult. We can relax the requirement to use cryptographically secure hashing during debugging. This enables debugging while keeping development/production kernel behaviour the same. If new command line option debug_boot_weak_hash is enabled use cryptographically insecure hashing and hash pointer value immediately. Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Tobin C. Harding Signed-off-by: Theodore Ts'o commit 1c4facb846c7f863bc65483394e80acdbacf671b Author: Tobin C. Harding Date: Fri Jun 22 09:15:33 2018 +1000 vsprintf: Use hw RNG for ptr_key Currently we must wait for enough entropy to become available before hashed pointers can be printed. We can remove this wait by using the hw RNG if available. Use hw RNG to get keying material. Reviewed-by: Steven Rostedt (VMware) Suggested-by: Kees Cook Signed-off-by: Tobin C. Harding Signed-off-by: Theodore Ts'o commit 753d433b586d1d43c487e3d660f5778c7c8d58ea Author: Tobin C. Harding Date: Fri Jun 22 09:15:32 2018 +1000 random: Return nbytes filled from hw RNG Currently the function get_random_bytes_arch() has return value 'void'. If the hw RNG fails we currently fall back to using get_random_bytes(). This defeats the purpose of requesting random material from the hw RNG in the first place. There are currently no intree users of get_random_bytes_arch(). Only get random bytes from the hw RNG, make function return the number of bytes retrieved from the hw RNG. Acked-by: Theodore Ts'o Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Tobin C. Harding Signed-off-by: Theodore Ts'o commit 8ddd6efa56c3fe23df9fe4cf5e2b49cc55416ef4 Author: Tobin C. Harding Date: Fri Jun 22 09:15:31 2018 +1000 random: Fix whitespace pre random-bytes work There are a couple of whitespace issues around the function get_random_bytes_arch(). In preparation for patching this function let's clean them up. Acked-by: Theodore Ts'o Signed-off-by: Tobin C. Harding Signed-off-by: Theodore Ts'o commit 07df5bd874f05fbbe694b75df12694f51c344311 Author: Heiner Kallweit Date: Tue Jul 17 21:21:37 2018 +0200 r8169: power down chip in probe The removed code would be called in two situations: 1. interface is brought up never or >10s after driver load 2. after close() Case 1 we can handle cleaner by ensuring chip is powered down when leaving probe(). open() callback will power up the chip. In case 2 we call rtl_pll_power_down() twice currently, from the close() callback and 10s later when entering runtime-suspend. This is avoided by this patch. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit fd3d96ae49c31088704501343463f6ee74d32314 Merge: 7c1fbfa7b2c8 1323061a018a Author: David S. Miller Date: Wed Jul 18 10:02:11 2018 +0900 Merge branch 'HWMON-support-for-SFP-modules' Andrew Lunn says: ==================== HWMON support for SFP modules This patchset adds HWMON support to SFP modules. The two patches add some attributes for temperature and power sensors which are currently missing from the hwmon core. The third patch adds a helper for filtering out characters in hwmon names which are invalid. The last patch then extends the core SFP code to export the sensors found in SFP modules. This code has been tested with two SFP modules: module OEM SFP-7000-85 rev 11.0 sn M1512220075 dc 160221 module FINISAR CORP. FTLF8524E2GNL rev A sn PW40MNN dc 160725 The anonymous module uses external calibration, while the FINISAR uses internal calibration. Thus both code paths have been tested. Due to the cross subsystem nature of these patches, as discussed with the RFC, it is hoped Guenter Roeck will ACK the patches, and then Dave Miller will merge them all via net-next. ==================== Signed-off-by: David S. Miller commit 1323061a018a7514287894a552c4ec2a5f0cb0cd Author: Andrew Lunn Date: Tue Jul 17 21:48:13 2018 +0200 net: phy: sfp: Add HWMON support for module sensors SFP modules can contain a number of sensors. The EEPROM also contains recommended alarm and critical values for each sensor, and indications of if these have been exceeded. Export this information via HWMON. Currently temperature, VCC, bias current, transmit power, and possibly receiver power is supported. The sensors in the modules can either return calibrate or uncalibrated values. Uncalibrated values need to be manipulated, using coefficients provided in the SFP EEPROM. Uncalibrated receive power values require floating point maths in order to calibrate them. Performing this in the kernel is hard. So if the SFP module indicates it uses uncalibrated values, RX power is not made available. With this hwmon device, it is possible to view the sensor values using lm-sensors programs: in0: +3.29 V (crit min = +2.90 V, min = +3.00 V) (max = +3.60 V, crit max = +3.70 V) temp1: +33.0°C (low = -5.0°C, high = +80.0°C) (crit low = -10.0°C, crit = +85.0°C) power1: 1000.00 nW (max = 794.00 uW, min = 50.00 uW) ALARM (LCRIT) (lcrit = 40.00 uW, crit = 1000.00 uW) curr1: +0.00 A (crit min = +0.00 A, min = +0.00 A) ALARM (LCRIT, MIN) (max = +0.01 A, crit max = +0.01 A) The scaling sensors performs on the bias current is not particularly good. The raw values are more useful: curr1: curr1_input: 0.000 curr1_min: 0.002 curr1_max: 0.010 curr1_lcrit: 0.000 curr1_crit: 0.011 curr1_min_alarm: 1.000 curr1_max_alarm: 0.000 curr1_lcrit_alarm: 1.000 curr1_crit_alarm: 0.000 In order to keep the I2C overhead to a minimum, the constant values, such as limits and calibration coefficients are read once at module insertion time. Thus only reading *_input and *_alarm properties requires i2c read operations. Signed-off-by: Andrew Lunn Acked-by: Guenter Roeck Signed-off-by: David S. Miller commit dcb5d0fcaa1ddd0af9c18ef51e6b05e38a6cec71 Author: Andrew Lunn Date: Tue Jul 17 21:48:12 2018 +0200 hwmon: Add helper to tell if a char is invalid in a name HWMON device names are not allowed to contain "-* \t\n". Add a helper which will return true if passed an invalid character. It can be used to massage a string into a hwmon compatible name by replacing invalid characters with '_'. Signed-off-by: Andrew Lunn Acked-by: Guenter Roeck Signed-off-by: David S. Miller commit aa7f29b07c8702127124d0522e3cd46850cdbc41 Author: Andrew Lunn Date: Tue Jul 17 21:48:11 2018 +0200 hwmon: Add support for power min, lcrit, min_alarm and lcrit_alarm Some sensors support reporting minimal and lower critical power, as well as alarms when these thresholds are reached. Add support for these attributes to the hwmon core. Signed-off-by: Andrew Lunn Acked-by: Guenter Roeck Signed-off-by: David S. Miller commit 2fe31e43124040a67495fa81f7ac67bc4c09ebc8 Author: Andrew Lunn Date: Tue Jul 17 21:48:10 2018 +0200 hwmon: Add missing HWMON_T_LCRIT_ALARM define The enum hwmon_temp_lcrit_alarm exists, but the BIT definition is missing. Signed-off-by: Andrew Lunn Acked-by: Guenter Roeck Signed-off-by: David S. Miller commit 7c1fbfa7b2c883bf9ae42c243ca53d93319c1bfa Merge: fcaccc829382 29a12b49536b Author: David S. Miller Date: Wed Jul 18 09:46:40 2018 +0900 Merge branch 'r8169-add-phylib-support' Heiner Kallweit says: ==================== r8169: add phylib support Now that all the basic refactoring has been done we can add phylib support. This patch series was successfully tested on: RTL8168h RTL8168evl RTL8169sb Changes in v2: - return error in mdio ops if phyaddr > 0 - advertise pause modes - added reviewed-by for several patches Changes in v3: - return ENODEV for unused phy addresses in mdio ops - remove unneeded PHY suspend in patch 2 - use recently added phy_speed_down and phy_speed_up in patch 7 - other minor changes based on review comments ==================== Signed-off-by: David S. Miller commit 29a12b49536bbf566c1ec4de0d4edfd5da8fe910 Author: Heiner Kallweit Date: Tue Jul 17 22:52:14 2018 +0200 r8169: don't read chip phy status register Instead of accessing the PHYstatus register we can use the information phylib stores in the phy_device structure. Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit f7ffa9ae2bb90fd948b514e2049ef3a904e66743 Author: Heiner Kallweit Date: Tue Jul 17 22:52:09 2018 +0200 r8169: remove mii_if_info member from struct rtl8169_private The only remaining usage of the struct mii_if_info member is to store the information whether the chip is GMII-capable. So we can replace it with a simple flag. Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a2965f12fde696d3754347bd48a7149b8de45b21 Author: Heiner Kallweit Date: Tue Jul 17 22:52:03 2018 +0200 r8169: remove rtl8169_set_speed_xmii We can remove rtl8169_set_speed_xmii() now that phylib handles all this. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 5b7ad4b75d1e89743137857123e67f1b37721264 Author: Heiner Kallweit Date: Tue Jul 17 22:51:57 2018 +0200 r8169: use phy_speed_down / phy_speed_up Use new phylib functions phy_speed_down() and phy_speed_up(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 69b3c59fe212ff0a90e52bef2073b0c3cc7eff91 Author: Heiner Kallweit Date: Tue Jul 17 22:51:53 2018 +0200 r8169: use phy_mii_ioctl Switch to using phy_mii_ioctl(). Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit dd84957eeeae61b60c692ff821c958464576604f Author: Heiner Kallweit Date: Tue Jul 17 22:51:48 2018 +0200 r8169: use phy_ethtool_nway_reset Switch to using phy_ethtool_nway_reset(). Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 4577243392ce36d90290c4101eb6ea6b5617026f Author: Heiner Kallweit Date: Tue Jul 17 22:51:44 2018 +0200 r8169: use phy_ethtool_(g|s)et_link_ksettings Use phy_ethtool_(g|s)et_link_ksettings() for the respective ethtool_ops callbacks. Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit f75222bce9b5e5a4af01100b949e056f12183c27 Author: Heiner Kallweit Date: Tue Jul 17 22:51:41 2018 +0200 r8169: replace open-coded PHY soft reset with genphy_soft_reset Use genphy_soft_reset() instead of open-coding a PHY soft reset. We have to do an explicit PHY soft reset because some chips use the genphy driver which uses a no-op as soft_reset callback. Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 242cd9b5866aa2caf9ff770283b85ddb35d52f90 Author: Heiner Kallweit Date: Tue Jul 17 22:51:33 2018 +0200 r8169: use phy_resume/phy_suspend Use phy_resume() / phy_suspend() instead of open coding this functionality. The chip version specific differences are handled by the respective PHY drivers. The call to r8168_phy_power_down() in r8168_pll_power_down() can be removed because phylib takes care now. The relevant scenarios are: - rtl8169_close(): phy_disconnect() powers down PHY - suspend: mdio_bus_phy_suspend() takes care - runtime-suspend: WoL is active, don't suspend PHY - rtl_shutdown(): no need to power down PHY Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit f1e911d5d0dfde489be38d9702a75964dfb42b28 Author: Heiner Kallweit Date: Tue Jul 17 22:51:26 2018 +0200 r8169: add basic phylib support Add basic phylib support to r8169. All now unneeded old PHY handling code will be removed in subsequent patches. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit ada94973f15f175283fd3b8f9bfcf9de6f2cc818 Author: RAGHU Halharvi Date: Tue Jul 17 22:32:12 2018 +0530 pktcdvd: remove assignment in if condition * Remove checkpatch errors caused due to assignment operation in if condition Signed-off-by: RAGHU Halharvi Signed-off-by: Jens Axboe commit 6ce3dd6eec114930cf2035a8bcb1e80477ed79a8 Author: Ming Lei Date: Tue Jul 10 09:03:31 2018 +0800 blk-mq: issue directly if hw queue isn't busy in case of 'none' In case of 'none' io scheduler, when hw queue isn't busy, it isn't necessary to enqueue request to sw queue and dequeue it from sw queue because request may be submitted to hw queue asap without extra cost, meantime there shouldn't be much request in sw queue, and we don't need to worry about effect on IO merge. There are still some single hw queue SCSI HBAs(HPSA, megaraid_sas, ...) which may connect high performance devices, so 'none' is often required for obtaining good performance. This patch improves IOPS and decreases CPU unilization on megaraid_sas, per Kashyap's test. Cc: Kashyap Desai Cc: Laurence Oberman Cc: Omar Sandoval Cc: Christoph Hellwig Cc: Bart Van Assche Cc: Hannes Reinecke Reported-by: Kashyap Desai Tested-by: Kashyap Desai Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 5089eafffba2ed444789e5d25c7c0dfd62595713 Author: Carlos Maiolino Date: Tue Jul 17 14:25:20 2018 -0700 libxfs: Fix a couple of sparse complaintis No significant changes, just silence a couple of sparse errors. Using cpu_to_be32(NULLAGINO), the NULLAGINO constant will be encoded in BE as a constant, avoiding a BE -> CPU conversion every iteraction of the loop, if be32_to_cpu(agi->agi_unlinked[i]) was used instead. Signed-off-by: Carlos Maiolino Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e4e542a683c16945533d700339a0aec261d39f34 Author: Gustavo A. R. Silva Date: Tue Jul 17 14:25:01 2018 -0700 xfs: use swap macro in xfs_dir2_leafn_rebalance Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain. Also, slightly refactor some code. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 897992b7e3505659fda57887223bd6bfe163c12f Author: Gustavo A. R. Silva Date: Wed Jul 11 22:26:38 2018 -0700 xfs_bmap_util: use swap macro Make use of the swap macro and remove some unnecessary variables. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1d5bebbafc73d82e5af003cdd2bf8ee5741cd1df Author: Gustavo A. R. Silva Date: Wed Jul 11 22:26:38 2018 -0700 xfs_attr_leaf: use swap macro in xfs_attr3_leaf_rebalance Make use of the swap macro and remove some unnecessary variables. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fa248de98a6beb9ceaec5059041d65f87ac438b4 Author: Darrick J. Wong Date: Tue Jul 17 14:24:11 2018 -0700 xfs: don't assume a left rmap when allocating a new rmap The original rmap code assumed that there would always be at least one rmap in the rmapbt (the AG sb/agf/agi) and so errored out if it didn't find one. This assumption isn't true for the rmapbt repair function (and it won't be true for realtime rmap either), so remove the check and just deal with the situation. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson commit f5beb598b0c4dd023833ae1a7c188ecd987b7125 Author: Takashi Iwai Date: Tue Jul 17 23:07:29 2018 +0200 ALSA: rawmidi: Minor code refactoring Unify a few open codes with helper functions to improve the readability. Minor behavior changes (rather fixes) are: - runtime->drain clearance is done within lock - active_sensing is updated before resizing buffer in SNDRV_RAWMIDI_IOCTL_PARAMS ioctl. Other than that, simply code cleanups. Signed-off-by: Takashi Iwai commit 631d2b490569118c5e4d4e35983efe36d9798cb5 Author: Eric Biggers Date: Tue Jul 17 10:43:56 2018 -0700 selinux: constify write_op[] write_op[] is never modified, so make it 'const'. Signed-off-by: Eric Biggers Signed-off-by: Paul Moore commit 7fdc9b08071b6a3fc85bf90b79e13f6e973a7e5e Author: Takashi Iwai Date: Tue Jul 17 22:45:50 2018 +0200 ALSA: rawmidi: Simplify error paths Apply the standard idiom: rewrite the multiple unlocks in error paths in the goto-error-and-single-unlock way. Just a code refactoring, and no functional changes. Signed-off-by: Takashi Iwai commit 5bed9139727f3bad06c9444bd092336a59397e9d Author: Takashi Iwai Date: Tue Jul 17 22:32:52 2018 +0200 ALSA: rawmidi: Tidy up coding styles Just minor coding style fixes like removal of superfluous white space, adding missing blank lines, etc. No actual code changes at all. Signed-off-by: Takashi Iwai commit ed6b83d2d190463c46a5e4a5b04c49d885c56439 Merge: 7373c2a99abf 39675f7a7c7e Author: Takashi Iwai Date: Tue Jul 17 22:26:54 2018 +0200 Merge branch 'for-linus' into for-next Back-merge for further cleanup / improvements on rawmidi and HD-audio stuff. Signed-off-by: Takashi Iwai commit a57942bfdd61b46df94021c9c33b8faaae5b65e1 Author: Takashi Iwai Date: Wed Jul 11 16:23:16 2018 +0200 ALSA: hda: Make audio component support more generic This is the final step for more generic support of DRM audio component. The generic audio component code is now moved to its own file, and the symbols are renamed from snd_hac_i915_* to snd_hdac_acomp_*, respectively. The generic code is enabled via the new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is kept as the super-class. Along with the split, three new callbacks are added to audio_ops: pin2port is for providing the conversion between the pin number and the widget id, and master_bind/master_unbin are called at binding / unbinding the master component, respectively. All these are optional, but used in i915 implementation and also other later implementations. A note about the new snd_hdac_acomp_init() function: there is a slight difference between this and the old snd_hdac_i915_init(). The latter (still) synchronizes with the master component binding, i.e. it assures that the relevant DRM component gets bound when it returns, or gives a negative error. Meanwhile the new function doesn't synchronize but just leaves as is. It's the responsibility by the caller's side to synchronize, or the caller may accept the asynchronous binding on the fly. v1->v2: Fix missing NULL check in master_bind/unbind Signed-off-by: Takashi Iwai commit 82887c0beb1ee6b33eed8318d8e8d41c5b3eddae Author: Takashi Iwai Date: Wed Jul 11 15:48:18 2018 +0200 ALSA: hda/i915: Associate audio component with devres The HD-audio i915 binding code contains a single pointer, hdac_acomp, for allowing the access to audio component from the master bind/unbind callbacks. This was needed because the callbacks pass only the device pointer and we can't guarantee the object type assigned to the drvdata (which is free for each controller driver implementation). And this implementation will be a problem if we support multiple components for different DRM drivers, not only i915. As a solution, allocate the audio component object via devres and associate it with the given device, so that the component callbacks can refer to it via devres_find(). The removal of the object is still done half-manually via devres_destroy() to make the code consistent (although it may work without the explicit call). Also, the snd_hda_i915_register_notifier() had the reference to hdac_acomp as well. In this patch, the corresponding code is removed by passing hdac_bus object to the function, too. Signed-off-by: Takashi Iwai commit ae891abe7c2ccf75b69ca8330225e37ecc06924e Author: Takashi Iwai Date: Wed Jul 11 15:17:22 2018 +0200 drm/i915: Split audio component to a generic type For allowing other drivers to use the DRM audio component, rename the i915_audio_component_* with drm_audio_component_*, and split the generic part into drm_audio_component.h. The i915 specific stuff remains in struct i915_audio_component, which contains drm_audio_component as the base. The license of drm_audio_component.h is kept to MIT as same as the the original i915_component.h. This is a preliminary change for further development, and no functional changes by this patch itself, merely code-split and renames. v1->v2: Use SPDX for drm_audio_component.h, fix remaining i915 argument in drm_audio_component.h Reviewed-by: Rodrigo Vivi Signed-off-by: Takashi Iwai commit f024e88343f712941f250f53ddb2652538ea7e95 Author: Christian König Date: Fri Jul 13 14:01:08 2018 +0200 drm/amdgpu: minor cleanup in amdgpu_job.c Remove superflous NULL check, fix coding style a bit, shorten error messages. Signed-off-by: Christian König Reviewed-by: Junwei Zhang Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit a1917b73d89e88a6ecdd076b9d6618682f1b0d08 Author: Christian König Date: Fri Jul 13 17:15:54 2018 +0200 drm/amdgpu: remove job->adev (v2) We can get that from the ring. v2: squash in "drm/amdgpu: always initialize job->base.sched" (Alex) Signed-off-by: Christian König Reviewed-by: Junwei Zhang Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit 290e44b7dd116cc61cf37b7ca0be13313bb11e37 Author: Paul Moore Date: Tue Jul 17 14:45:08 2018 -0400 audit: use ktime_get_coarse_real_ts64() for timestamps Commit c72051d5778a ("audit: use ktime_get_coarse_ts64() for time access") converted audit's use of current_kernel_time64() to the new ktime_get_coarse_ts64() function. Unfortunately this resulted in incorrect timestamps, e.g. events stamped with the year 1969 despite it being 2018. This patch corrects this by using ktime_get_coarse_real_ts64() just like the current_kernel_time64() wrapper. Fixes: c72051d5778a ("audit: use ktime_get_coarse_ts64() for time access") Reviewed-by: Arnd Bergmann Signed-off-by: Paul Moore commit 108019a7e6a34df91246365066bea7cf6faf6b02 Author: Gustavo A. R. Silva Date: Wed Jul 4 09:22:55 2018 -0500 drm/pl111: Use 64-bit arithmetic instead of 32-bit Add suffix ULL to constant 1000 in order to give the compiler complete information about the proper arithmetic to use. Notice that such constant is used in a context that expects an expression of type u64 (64 bits, unsigned) and the following expression is currently being evaluated using 32-bit arithmetic: mode->clock * 1000 Addresses-Coverity-ID: 1466139 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180704142255.GA8614@embeddedor.com commit f9760772d26560ec137fb1c768487c601b93dbc3 Author: Thomas Zimmermann Date: Tue Jul 17 10:36:57 2018 +0200 drm/pl111: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180717083657.16262-1-tzimmermann@suse.de commit a708edf13fb0b55d29a003b00251bccbfec74b20 Author: Thomas Zimmermann Date: Tue Jul 17 10:54:28 2018 +0200 drm/vc4: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180717085428.18500-1-tzimmermann@suse.de commit a443c1fc10599791f6aa6b377f48dcfb2a96d817 Author: Krzysztof Kozlowski Date: Tue Apr 24 22:08:44 2018 +0200 cpufreq: exynos: Remove support for Exynos5440 The Exynos5440 is not actively developed, there are no development boards available and probably there are no real products with it. Remove wide-tree support for Exynos5440. Signed-off-by: Krzysztof Kozlowski Acked-by: Viresh Kumar Reviewed-by: Chanwoo Choi Reviewed-by: Rob Herring commit 956698445d1beb9f7fdcd842bb829a0c2f05d86d Author: Krzysztof Kozlowski Date: Tue Apr 24 22:05:17 2018 +0200 ata: ahci-platform: Remove support for Exynos5440 The Exynos5440 is not actively developed, there are no development boards available and probably there are no real products with it. Remove wide-tree support for Exynos5440. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring commit cd87668d601f622e0ebcfea4f78d116d5f572f4d Author: Paul Burton Date: Mon Jul 16 08:26:36 2018 -0700 MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads The PCI_OHCI_INT_REG case in pci_ohci_read_reg() contains the following if statement: if ((lo & 0x00000f00) == CS5536_USB_INTR) CS5536_USB_INTR expands to the constant 11, which gives us the following condition which can never evaluate true: if ((lo & 0xf00) == 11) At least when using GCC 8.1.0 this falls foul of the tautoligcal-compare warning, and since the code is built with the -Werror flag the build fails. Fix this by shifting lo right by 8 bits in order to match the corresponding PCI_OHCI_INT_REG case in pci_ohci_write_reg(). Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19861/ Cc: Huacai Chen Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 5c93316c8c2276323af2d98e9676efda7d055bee Author: Alexander Sverdlin Date: Fri Jul 13 17:51:56 2018 +0200 mips: unify prom_putchar() declarations prom_putchar() is used centrally in early printk infrastructure therefore at least MIPS should agree on the function return type. [paul.burton@mips.com: - Include linux/types.h in asm/setup.h to gain the bool typedef before we start include asm/setup.h elsewhere. - Include asm/setup.h in all files that use or define prom_putchar(). - Also standardise on signed rather than unsigned char argument.] Signed-off-by: Alexander Sverdlin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19842/ Cc: linux-mips@linux-mips.org Cc: Ralf Baechle Cc: James Hogan Cc: Jonas Gorski Cc: Florian Fainelli Cc: Kate Stewart Cc: Philippe Ombredanne commit a8bd3b884dd79dcc9a89dedd0e24b7554de4fe79 Author: Chris Wilson Date: Tue Jul 17 10:26:55 2018 +0100 drm/i915: Flush chipset caches after GGTT writes Our I915g (early gen3, the oldest machine we have in the farm) is still reporting occasional incoherency performing the following operations: 1) write through GGTT (indirect write into memory) 2) write through either CPU or WC (direct write into memory) 3) read from GGTT (indirect read) Instead of reporting the value from (2), the read from GGTT reports the earlier value written via the GGTT. We have made sure that the writes are flushed from the CPU (commit 3a32497f0dbe ("drm/i915/selftests: Provide full mb() around clflush") and commit add00e6d896f ("drm/i915: Flush the WCB following a WC write")), but still see the error, just less frequently. The only remaining cache that might be affected here is a chipset cache, so flush that as well. Testcase: igt/drv_selftest/live_coherency #gdg Signed-off-by: Chris Wilson Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180717092655.28417-1-chris@chris-wilson.co.uk commit 693359f7ac9012778590a370d076b13db704255e Author: Dirk Gouders Date: Tue Jul 3 14:43:31 2018 +0200 kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE Over time, the use of the flag SYMBOL_AUTO changed from initially marking three automatically generated symbols ARCH, KERNELRELEASE and UNAME_RELEASE to today's effect of protecting symbols from being written out. Currently, only symbols of type CHOICE and those with option defconf_list set have that flag set. Reflect that change in semantics in the flag's name. Signed-off-by: Dirk Gouders Signed-off-by: Masahiro Yamada commit 4ab3b80159d4db63b902ef635d4b5e882911b2da Author: Randy Dunlap Date: Thu Jun 28 16:39:50 2018 -0700 kconfig: check for pkg-config on make {menu,n,g,x}config Each of 'make {menu,n,g,x}config' uses (needs) pkg-config to make sure that other required files are present and to determine build flags settings, but none of these check that pkg-config itself is present. Add a check for all 4 of these targets and update Documentation/process/changes.rst to mention 'pkg-config'. Fixes kernel bugzilla #77511: https://bugzilla.kernel.org/show_bug.cgi?id=77511 Signed-off-by: Randy Dunlap Cc: Bjørn Forsman Signed-off-by: Masahiro Yamada commit f92d19e0ef9bbbb2984845682e740934ad45473b Author: Laura Abbott Date: Mon Jul 9 17:46:02 2018 -0700 kbuild: Use HOST*FLAGS options from the command line Now that we have the rename in place, reuse the HOST*FLAGS options as something that can be set from the command line and included with the rest of the flags. Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit 8377bd2b9ee1be35b39b5523f640a2b75ddd7c4e Author: Laura Abbott Date: Mon Jul 9 17:46:01 2018 -0700 kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS In preparation for enabling command line LDLIBS, re-name HOST_LOADLIBES to KBUILD_HOSTLDLIBS as the internal use only flags. Also rename existing usage to HOSTLDLIBS for consistency. This should not have any visible effects. Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit b90a368000abe5e015e0b045ca2ff7c2173b94c0 Author: Laura Abbott Date: Mon Jul 9 17:46:00 2018 -0700 kbuild: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS In preparation for enabling command line LDFLAGS, re-name HOSTLDFLAGS to KBUILD_HOSTLDFLAGS as the internal use only flags. This should not have any visible effects. Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit 10844aebf44851a981ddaa714351ae61c4b29103 Author: Laura Abbott Date: Mon Jul 9 17:45:59 2018 -0700 kbuild: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS In preparation for enabling command line CXXFLAGS, re-name HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS as the internal use only flags. This should not have any visible effects. Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit 96f14fe738b69dd97a33efe3cc8ab330af5fd1f1 Author: Laura Abbott Date: Mon Jul 9 17:45:58 2018 -0700 kbuild: Rename HOSTCFLAGS to KBUILD_HOSTCFLAGS In preparation for enabling command line CFLAGS, re-name HOSTCFLAGS to KBUILD_HOSTCFLAGS as the internal use only flags. This should not have any visible effects. Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit efa75c4923be7fedc00b040116657101f20b3678 Author: Laura Abbott Date: Thu Jul 5 17:49:40 2018 -0700 arm64: Add build salt to the vDSO The vDSO needs to have a unique build id in a similar manner to the kernel and modules. Use the build salt macro. Acked-by: Will Deacon Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit b399baaaf7522750eab0c2a6b9f0dc511d878dd6 Author: Laura Abbott Date: Thu Jul 5 17:49:39 2018 -0700 powerpc: Add build salt to the vDSO The vDSO needs to have a unique build id in a similar manner to the kernel and modules. Use the build salt macro. Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit d623f60df03a1e44c823ed906ca8ddbd8d3a5983 Author: Laura Abbott Date: Thu Jul 5 17:49:38 2018 -0700 x86: Add build salt to the vDSO The vDSO needs to have a unique build id in a similar manner to the kernel and modules. Use the build salt macro. Acked-by: Andy Lutomirski Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit 9afb719e7046c4f2462278862ab3db2961cc141c Author: Laura Abbott Date: Thu Jul 5 17:49:37 2018 -0700 kbuild: Add build salt to the kernel and modules In Fedora, the debug information is packaged separately (foo-debuginfo) and can be installed separately. There's been a long standing issue where only one version of a debuginfo info package can be installed at a time. There's been an effort for Fedora for parallel debuginfo to rectify this problem. Part of the requirement to allow parallel debuginfo to work is that build ids are unique between builds. The existing upstream rpm implementation ensures this by re-calculating the build-id using the version and release as a seed. This doesn't work 100% for the kernel because of the vDSO which is its own binary and doesn't get updated when embedded. Fix this by adding some data in an ELF note for both the kernel and modules. The data is controlled via a Kconfig option so distributions can set it to an appropriate value to ensure uniqueness between builds. Suggested-by: Masahiro Yamada Signed-off-by: Laura Abbott Signed-off-by: Masahiro Yamada commit 934193a654c1f4d0643ddbf4b2529b508cae926e Author: Randy Dunlap Date: Sun Jul 1 19:46:06 2018 -0700 kbuild: verify that $DEPMOD is installed Verify that 'depmod' ($DEPMOD) is installed. This is a partial revert of commit 620c231c7a7f ("kbuild: do not check for ancient modutils tools"). Also update Documentation/process/changes.rst to refer to kmod instead of module-init-tools. Fixes kernel bugzilla #198965: https://bugzilla.kernel.org/show_bug.cgi?id=198965 Signed-off-by: Randy Dunlap Cc: Lucas De Marchi Cc: Lucas De Marchi Cc: Michal Marek Cc: Jessica Yu Cc: Chih-Wei Huang Cc: stable@vger.kernel.org # any kernel since 2012 Signed-off-by: Masahiro Yamada commit c417fbce98722ad7e384caa8ba6f2e7c5f8672d9 Author: Masahiro Yamada Date: Tue Jun 26 01:40:23 2018 +0900 kbuild: move bin2c back to scripts/ from scripts/basic/ Commit 8370edea81e3 ("bin2c: move bin2c in scripts/basic") moved bin2c to the scripts/basic/ directory, incorrectly stating "Kexec wants to use bin2c and it wants to use it really early in the build process. See arch/x86/purgatory/ code in later patches." Commit bdab125c9301 ("Revert "kexec/purgatory: Add clean-up for purgatory directory"") and commit d6605b6bbee8 ("x86/build: Remove unnecessary preparation for purgatory") removed the redundant purgatory build magic entirely. That means that the move of bin2c was unnecessary in the first place. fixdep is the only host program that deserves to sit in the scripts/basic/ directory. Signed-off-by: Masahiro Yamada commit b56e5355091d799d58ce8b40fdf62dc9c2159981 Author: Elena Reshetova Date: Fri Sep 1 12:40:20 2017 +0300 Coccinelle: add atomic_as_refcounter script atomic_as_refcounter.cocci script allows detecting cases when refcount_t type and API should be used instead of atomic_t. Signed-off-by: Elena Reshetova Acked-by: Julia Lawall Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada commit d8b3f454dab48bc40528aa5f19f7f27f2a6dc825 Author: Paul Kocialkowski Date: Tue Jul 17 14:25:22 2018 +0200 drm/sun4i: sun8i: Avoid clearing blending order at each atomic commit Blending order is set based on the z position of each DRM plane. The blending order register is currently cleared at each atomic DRM commit, with the intent that each committed plane will set the appropriate bits (based on its z-pos) when enabling the plane. However, it sometimes happens that a particular plane is left unchanged by an atomic commit and thus will not be configured again. In that scenario, blending order is cleared and only the bits relevant for the planes affected by the commit are set. This leaves the planes that did not change without their blending order set in the register, leading to that plane not being displayed. Instead of clearing the blending order register at every atomic commit, this change moves the register's initial clear at bind time and only clears the bits for a specific plane when disabling it or changing its zpos. This way, planes that are left untouched by a DRM atomic commit are no longer disabled. Signed-off-by: Paul Kocialkowski Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180717122522.11327-1-paul.kocialkowski@bootlin.com commit 7373c2a99abf2b11b5e8a226071331c0176253ff Author: Gustavo A. R. Silva Date: Tue Jul 17 10:06:10 2018 -0500 ALSA: emu8000: Use swap macro in snd_emu8000_sample_new Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit e2d2f240497c63a157f897c87567b93ed43a2213 Author: Gustavo A. R. Silva Date: Tue Jul 17 10:00:43 2018 -0500 ALSA: emu10k1_patch: Use swap macro in snd_emu10k1_sample_new Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 67810693077afc1ebf9e1646af300436cb8103c2 Author: Amir Goldstein Date: Tue Jul 17 16:05:38 2018 +0300 ovl: fix wrong use of impure dir cache in ovl_iterate() Only upper dir can be impure, but if we are in the middle of iterating a lower real dir, dir could be copied up and marked impure. We only want the impure cache if we started iterating a real upper dir to begin with. Aditya Kali reported that the following reproducer hits the WARN_ON(!cache->refcount) in ovl_get_cache(): docker run --rm drupal:8.5.4-fpm-alpine \ sh -c 'cd /var/www/html/vendor/symfony && \ chown -R www-data:www-data . && ls -l .' Reported-by: Aditya Kali Tested-by: Aditya Kali Fixes: 4edb83bb1041 ('ovl: constant d_ino for non-merge dirs') Cc: # v4.14 Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 7f342e9c61d7932b7b3dd8a0b9c2768fe7ca3436 Author: Colin Ian King Date: Mon Jul 2 10:40:28 2018 +0100 HID: intel-ish-hid: remove redundant variable num_frags Variable num_frags is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'num_frags' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Jiri Kosina commit 28a042a3b7ab3e28039d6309f0764a8e4c1b261d Author: Dmitry Torokhov Date: Fri Jul 13 16:13:54 2018 +0200 HID: multitouch: handle palm for touchscreens Usually, there is no palm rejection for touchscreens. You don't rest your palm on the touchscreen while interacting with it. However, some wacom devices do so because you can rest your palm while interacting with the stylus. Unfortunately, the spec for touchscreens[1] is less precise than the one for touchpads[2]. This leads to a situation where it's 'legitimate' for a touchscreen to provide both tipswitch off and confidence off in the same report. Work around that by keeping the slot active for one frame where we report MT_TOOL_PALM, and then synthesizing the release event in a separate frame. frame Acked-by: Peter Hutterer Signed-off-by: Dmitry Torokhov [rebased and new commit message] Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit f9024374592560ab7fac327fbacbc66aab9d6c63 Author: Dmitry Torokhov Date: Fri Jul 13 16:13:53 2018 +0200 HID: multitouch: touchscreens also use confidence reports According to [1] the confidence is used not only by touchpad devices, but also by touchscreens. [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchscreen-required-hid-top-level-collections Acked-by: Peter Hutterer Signed-off-by: Dmitry Torokhov [rebased] Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 9152c7d77d87e2b6b9ccc21bb52f8eea15744f50 Author: Dmitry Torokhov Date: Fri Jul 13 16:13:52 2018 +0200 HID: multitouch: report MT_TOOL_PALM for non-confident touches According to Microsoft specification [1] for Precision Touchpads (and Touchscreens) the devices use "confidence" reports to signal accidental touches, or contacts that are "too large to be a finger". Instead of simply marking contact inactive in this case (which causes issues if contact was originally proper and we lost confidence in it later, as this results in accidental clicks, drags, etc), let's report such contacts as MT_TOOL_PALM and let userspace decide what to do. [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection Signed-off-by: Dmitry Torokhov [splitted and rebased] Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 30576c5f490cb220ae8c1dcd918605ac1c4c103e Author: Benjamin Tissoires Date: Fri Jul 13 16:13:51 2018 +0200 HID: microsoft: support the Surface Dial The tool works nicely with hid-generic, but it ends up creating 9 different input nodes with most of them only having ABS_MISC set. Filter the axis out, which reduces the amount of devices to 2. One is the proper System Multi-axis collection, the other exported device seems to provide SLEEP and POWER Key, not sure how one can trigger those events though. Filtering the ABS_X and ABS_Y axes also prevents udev to detect this as a touchscreen. Acked-by: Peter Hutterer Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 08a8a7cf14595f95d5cbb28ef5c15c56a6255fb4 Author: Benjamin Tissoires Date: Fri Jul 13 16:13:50 2018 +0200 HID: core: do not upper bound the collection stack Looks like 4 was sufficient until now. However, the Surface Dial needs a stack of 5 and simply fails at probing. Dynamically add HID_COLLECTION_STACK_SIZE to the size of the stack if we hit the upper bound. Checkpatch complains about bare unsigned, so converting those to 'unsigned int' in struct hid_parser Acked-by: Peter Hutterer Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit ba6b055e0f3b4ff4942e4ab273260affcfad9bff Author: Benjamin Tissoires Date: Fri Jul 13 16:13:49 2018 +0200 HID: input: enable Totem on the Dell Canvas 27 The Dell Canvas 27 has a tool that can be put on the surface and acts as a dial. The firmware processes the detection of the tool and forward regular HID reports with X, Y, Azimuth, rotation, width/height. The firmware also exports Contact ID, Countact Count which may hint that several totems can be used at the same time (the FW only supports one). We can tell that MT_TOOL_DIAL will be reported by setting the min/max of ABS_MT_TOOL_TYPE to MT_TOOL_DIAL. This tool is aimed at being used by the system and not the applications, so the user space processing should not go through the regular touch inputs. We set INPUT_PROP_DIRECT which applies ID_INPUT_TOUCHSCREEN to this new type of devices, but we will counter this for the time being with the special udev hwdb entry mentioned above. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1511846 Acked-by: Peter Hutterer Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 01eaac7e57134cae4e75b36195a10d525939c7bf Author: Benjamin Tissoires Date: Fri Jul 13 16:13:48 2018 +0200 HID: multitouch: remove one copy of values The current way of handling multitouch data is not very straightforward: - in mt_event() we do nothing - in mt_report() we: - do some gym to fetch the scantime and the contact count - then iterate over the input fields where we copy the data to a temporary place - when we see the last field in a slot, we then use this data to emit the input data A more streamlined way is to first get all of the address in the report of all fields, and then just pick the fields we are interested in in mt_report() Acked-by: Peter Hutterer Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 8dfe14b3b47ff832cb638731f9fc696a3a84f804 Author: Benjamin Tissoires Date: Fri Jul 13 16:13:47 2018 +0200 HID: multitouch: ditch mt_report_id Now that the driver can handle more than one multitouch collection in a single HID device, ditch the last bit that contains us to use only one mt collection. Acked-by: Peter Hutterer Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 3ceb3826448d1ec4650a6c2b62baa9e0994ac7d3 Author: Benjamin Tissoires Date: Fri Jul 13 16:13:46 2018 +0200 HID: multitouch: store a per application quirks value If a device has more than one multitouch collection, there is a chance we need per tool quirks. This is the case for the Totem on the Dell Canvas. Note that thesysfs attribute quirks can now get out of sync, but there should not be much users of it as it's debugging only. Acked-by: Peter Hutterer Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit f146d1c4d7eafde96a33838e52ba7568d05bf1f7 Author: Benjamin Tissoires Date: Fri Jul 13 16:13:45 2018 +0200 HID: multitouch: Store per collection multitouch data Currently, hid-multitouch can only handle one multitouch collection at a time. This is an issue for the Dell Canvas, as the Totem (a dial tool) is also using a multitouch-like collection. Factor out the multitouch collection data in their own struct. Acked-by: Peter Hutterer Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit cf6d15d7b1f386905616912b2d450c8d7092a0f0 Author: Benjamin Tissoires Date: Fri Jul 13 16:13:44 2018 +0200 HID: multitouch: make sure the static list of class is not changed const is a magic keyword here :) Acked-by: Peter Hutterer Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit b875a5a529bedf73532000f4e2496c00a00f4765 Author: Benjamin Tissoires Date: Fri Jul 13 16:13:43 2018 +0200 input: add MT_TOOL_DIAL A dial is a tool you place on a multitouch surface which reports its orientation or a relative angle of rotation when rotating its knob. Some examples are the Dell Totem (on the Canvas 27"), the Microsoft Dial, or the Griffin Powermate, though the later can't be put on a touch surface. We give some extra space to account for other types of fingers if we need (MT_TOOL_THUMB) Slightly change the documentation to not make it mandatory to update each MT_TOOL we add. Reviewed-by: Peter Hutterer Acked-by: Dmitry Torokhov Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 5d400a4933e867dbc3706023c8ed55d364c233ed Author: Máté Eckl Date: Tue Jul 10 16:01:28 2018 +0200 netfilter: Kconfig: Change select IPv6 dependencies ... from IPV6 to NF_TABLES_IPV6 and IP6_NF_IPTABLES. In some cases module selects depend on IPV6, but this means that they select another module even if eg. NF_TABLES_IPV6 is not set in which case the selected module is useless due to the lack of IPv6 nf_tables functionality. The same applies for IP6_NF_IPTABLES and iptables. Joint work with: Arnd Bermann Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit a0ae2562c6c4b2721d9fddba63b7286c13517d9f Author: Florian Westphal Date: Fri Jun 29 07:46:51 2018 +0200 netfilter: conntrack: remove l3proto abstraction This unifies ipv4 and ipv6 protocol trackers and removes the l3proto abstraction. This gets rid of all l3proto indirect calls and the need to do a lookup on the function to call for l3 demux. It increases module size by only a small amount (12kbyte), so this reduces size because nf_conntrack.ko is useless without either nf_conntrack_ipv4 or nf_conntrack_ipv6 module. before: text data bss dec hex filename 7357 1088 0 8445 20fd nf_conntrack_ipv4.ko 7405 1084 4 8493 212d nf_conntrack_ipv6.ko 72614 13689 236 86539 1520b nf_conntrack.ko 19K nf_conntrack_ipv4.ko 19K nf_conntrack_ipv6.ko 179K nf_conntrack.ko after: text data bss dec hex filename 79277 13937 236 93450 16d0a nf_conntrack.ko 191K nf_conntrack.ko Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit e7ad3dc9f4a2a183f275c9a3becd0cdd5f69792e Author: Hans de Goede Date: Wed Jul 11 12:38:37 2018 +0200 HID: elan: Add support for touchpad on the Toshiba Click Mini L9W The Toshiba Click Mini L9W keyboard dock has a single i2c-hid Elan device for both the keyboard and the touchpad. Add support for the touchpad to the hid-elan driver, rather then relying on mouse emulation. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 6e5dd6324a4ce3438b4e8ae35e1a0fdd096a0418 Author: Hans de Goede Date: Wed Jul 11 12:38:36 2018 +0200 HID: elan: Add USB-id for HP x2 10-n000nd touchpad Now that we query all the parameters, adding support for new hardware is easy. This commit adds support for the touchpad found on the HP x2 10-n000nd touchpad 2-in-1. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 7ed3f281d8f36c19ca15fe7fcc52200668a73d72 Author: Hans de Goede Date: Wed Jul 11 12:38:35 2018 +0200 HID: elan: Add a flag for selecting if the touchpad has a LED Note all Elan touchpads have a LED make this configurable using a flag in hi_id.driver_data. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 19588bee0ea569bd6cc6bea5b284c34f1f526a59 Author: Hans de Goede Date: Wed Jul 11 12:38:34 2018 +0200 HID: elan: Query resolution from the touchpad Query the resolution from the touchpad and report it to userspace Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 79d11f2a2070613b63a620e4a8b87feb3e5543c3 Author: Hans de Goede Date: Wed Jul 11 12:38:33 2018 +0200 HID: elan: Query device max_x and max_y value from touchpad Query the device's max_x and max_y value from the touchpad rather then hardcoding it. This makes adding support for other USB ids a lot easier. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 314f04e85cabf0027f098866897db57fdaf6cf19 Author: Hans de Goede Date: Wed Jul 11 12:38:32 2018 +0200 HID: elan: Hardcode finger-count and usb-interface There is no need to have these configurable. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 2f612de2d67dca26191e6c3db544f4c30beb6838 Author: Hans de Goede Date: Wed Jul 11 12:38:31 2018 +0200 HID: elan: Correctly report MT_PRESSURE instead of TOOL_WIDTH Elan has given me a (GPL-ed) Android driver for their non HID-mt touchpads to help improve the upstream support. Acoording to Elan what we are currently reporting as tool-width really is a per-touch pressure. This always has a maximum of 255, so there is no need to make the max configurable. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit f109b43ad9af6b5a003b6619cb2242fde19009ce Author: Hans de Goede Date: Wed Jul 11 12:38:30 2018 +0200 HID: elan: Stop claiming we have TOUCH_MAJOR and then never reporting it We never report MT_TOUCH_MAJOR, so lets not claim that we do. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit c4cf2d8df1dd9061cdc873e0ddb41deafa228b9d Author: Hans de Goede Date: Wed Jul 11 12:38:29 2018 +0200 HID: elan: Remove unused max_area_x and max_area_y vatiables max_area_x and max_area_y are initialized but never used anywhere, drop them. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit cc57c07343bd071cdf1915a91a24ab7d40c9b590 Author: Mike Christie Date: Sun Jul 15 18:16:17 2018 -0500 configfs: fix registered group removal This patch fixes a bug where configfs_register_group had added a group in a tree, and userspace has done a rmdir on a dir somewhere above that group and we hit a kernel crash. The problem is configfs_rmdir will detach everything under it and unlink groups on the default_groups list. It will not unlink groups added with configfs_register_group so when configfs_unregister_group is called to drop its references to the group/items we crash when we try to access the freed dentrys. The patch just adds a check for if a rmdir has been done above us and if so just does the unlink part of unregistration. Sorry if you are getting this multiple times. I thouhgt I sent this to some of you and lkml, but I do not see it. Signed-off-by: Mike Christie Cc: Christoph Hellwig Cc: Joel Becker Signed-off-by: Christoph Hellwig commit d7484f5c6b3b0565d2395aece2862f183581e1c1 Author: Claudiu Beznea Date: Tue Jul 17 14:06:24 2018 +0300 ARM: at91: pm: configure wakeup sources for ULP1 mode Since for ULP1 PM mode of SAMA5D2 the wakeup sources are limited and well known add a method to check if these wakeup sources are defined by user (either via DT or filesystem). In case there are no wakeup sources defined for ULP1 the PM suspend will fail, otherwise these will be configured in fast startup registers of PMC. Since wakeup sources of ULP1 need also to be configured in SHDWC registers the code was a bit changed to map the SHDWC also in case ULP1 is requested by user (this was done in the initialization phase). In case the ULP1 initialization fails the ULP0 mode is used (this mode was also used in case backup mode initialization failed). Signed-off-by: Claudiu Beznea Signed-off-by: Alexandre Belloni commit 3abd729aa468d7346f12d7dfc8f81aba653f6c88 Author: Claudiu Beznea Date: Tue Jul 17 11:26:56 2018 +0300 ARM: at91: pm: add PMC fast startup registers defines Add PMC fast startup registers defines. Signed-off-by: Claudiu Beznea Signed-off-by: Alexandre Belloni commit 5b56c182edb1224bc1a97a1c74003eaa0eb59daf Author: Wenyou Yang Date: Tue Jul 17 11:26:55 2018 +0300 ARM: at91: pm: Add ULP1 mode support In the ULP1 mode, in order to achieve the lowest power consumption with the system in retention mode and be able to resume on the wake up events, all the clocks are shut off, inclusive the embedded 12MHz RC oscillator, and the number of wake up sources is limited as well. When the wake up event is asserted, the embedded 12MHz RC oscillator restarts automatically. The ULP1 (Ultra Low-power mode 1) is introduced by SAMA5D2. The previous size of pm_suspend.o was 2148 bytes. With the addition of ULP1 mode the new size of pm_suspend.o raised at 2456 bytes. Signed-off-by: Wenyou Yang Signed-off-by: Ludovic Desroches [claudiu.beznea@microchip.com: aligned with 4.18-rc1] Signed-off-by: Claudiu Beznea Signed-off-by: Alexandre Belloni commit 514e2a294aad435ce205c1c66d2abb89a292473c Author: Claudiu Beznea Date: Tue Jul 17 11:26:54 2018 +0300 ARM: at91: pm: Use ULP0 naming instead of slow clock Switch to use ULP0 naming instead of slow clock naming for power modes, to be as closed as possible to datasheet. This commit does the necessary renaming and macro addition to be as close as possible to the namings from [1]. [1] https://lore.kernel.org/lkml/1470650705-31418-3-git-send-email-wenyou.yang@atmel.com Signed-off-by: Claudiu Beznea Signed-off-by: Alexandre Belloni commit cc4493faf494bb8af2324b1b7cabd1f1457a76ca Author: Zhou Wang Date: Wed Jun 27 10:49:46 2018 +0800 arm64: defconfig: enable HiSilicon PMU driver Signed-off-by: Zhou Wang Signed-off-by: Wei Xu commit 4d4585c21f53c15a10c52b45e0392de79e07127e Author: Viresh Kumar Date: Fri May 25 11:10:03 2018 +0530 arm64: dts: hisilicon: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Do minor rearrangement as well to keep ordering consistent. Signed-off-by: Viresh Kumar Signed-off-by: Wei Xu commit 81f2b25adddeff2fc7fdd1f23f889d018ba65466 Author: Leonard Crestez Date: Tue Jul 17 15:11:28 2018 +0300 drm/imx: Remove unused field imx_drm_device.pipes This has been unused since commit 44b460cfe554 ("drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs") Signed-off-by: Leonard Crestez Signed-off-by: Philipp Zabel commit 4c2ae34f64c80991501ebd830b13dce5c7dc3621 Author: Thomas Zimmermann Date: Tue Jul 17 10:48:14 2018 +0200 drm/sun4i: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180717084814.18091-1-tzimmermann@suse.de commit 5f8f80356eccfaae1db8a827626ae4fc2eb62831 Author: Andrey Smirnov Date: Mon Jul 16 21:33:29 2018 -0700 spi: spi-fsl-dspi: Fill actual_length when doing DMA transfer Upper layer users of SPI device drivers may rely on 'actual_length', so it is important that information is correctly reported. One such example is spi_mem_exec_op() function that will fail if 'actual_length' of the data transferred is not what was requested. Add necessary code to populate 'actual_length. Cc: Mark Brown Cc: Sanchayan Maity Cc: Stefan Agner Cc: cphealy@gmail.com Cc: linux-spi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Signed-off-by: Mark Brown commit d91cfeb0aa79445fcfa9f523a5b57c5e9f4113ec Author: RAGHU Halharvi Date: Tue Jul 17 15:50:09 2018 +0530 genirq: Remove redundant NULL pointer check in __free_irq() The NULL pointer check in __free_irq() triggers a 'dereference before NULL pointer check' warning in static code analysis. It turns out that the check is redundant because all callers have a NULL pointer check already. Remove it. Signed-off-by: RAGHU Halharvi Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180717102009.7708-1-raghuhack78@gmail.com commit a5956defe5a537447a83de9b4bcd6a7c9aa1cc74 Author: Vincent Guittot Date: Wed Jul 11 10:34:46 2018 +0200 arm64: hikey960: update idle-states Update entry/exit latency and residency time of hikey960 to use more realistic figures based on unitary tests done on the platform. The complete results (in us) : big cluster cluster CPU max entry latency 800 400 max exit latency 2900 550 residency 903Mhz 5000 1500 residency 2363Mhz 0 1500 little cluster cluster CPU max entry latency 500 400 max exit latency 1600 650 residency 533Mhz 8000 4500 residency 1844Mhz 0 1500 We can see that the residency time depends of the running OPP which is not handled for now. Then we also have to take into account the constraint of a residency time shorter than the tick to get full advantage of idle loop reordering(tick is stopped if idle duration is higher than tick period). Finally the selected residency value are : big cluster cluster CPU residency 3700 1500 little cluster cluster CPU residency 3500 1500 A simple test with a task waking up every 11.111ms shows improvement: - 5% a lowest OPP - 22% at highest OPP The period has been chosen: - to be shorter than old cluster residency time and longer than new residency time of cluster off C-state - to prevent any sync with tick (4ms) when running tests that can add some variances between tests Signed-off-by: Vincent Guittot Acked-by: Daniel Lezcano Reviewed-by: Leo Yan Signed-off-by: Wei Xu commit 8883ac1db3e284e9ad48ddad37f5eb3c2730510d Author: oscardagrach Date: Fri Jul 13 11:02:31 2018 -0500 arm64: dts: hikey: Remove keep-power-in-suspend property Remove the keep-power-in-suspend property because it keeps wifi power on during suspend. This property is only required when enabling WoWLAN and should only be enabled based on need. Signed-off-by: Ryan Grachek Signed-off-by: Wei Xu commit 8a368657fe7efdaf8e5b0476ab422d7600d9ceaf Author: oscardagrach Date: Fri Jul 13 10:53:48 2018 -0500 arm64: dts: hikey960: Remove keep-power-in-suspend property Remove the keep-power-in-suspend property because it keeps wifi power on during suspend. This property is only required when enabling WoWLAN and should only be enabled based on need. Also remove dupplicate property Signed-off-by: Ryan Grachek Signed-off-by: Wei Xu commit f0ab786fad36940211b7e5e9b0a9cc977de2f01d Author: oscardagrach Date: Mon Jun 18 13:10:08 2018 -0500 arm64: dts: hikey960: Clean up MMC properties and move to proper file Certain properties should be moved to the board file to reflect the specific properties of the board, and not the SoC. Move these properties to proper location and organize properties in both files. Signed-off-by: Ryan Grachek Signed-off-by: Wei Xu commit 52ac6f2a8825116410bbe55fa3d1aea33774431b Author: oscardagrach Date: Mon Jun 18 13:08:25 2018 -0500 arm64: dts: hikey960: Remove deprecated MMC properties Remove deprecated MMC properties for hi3660 Signed-off-by: Ryan Grachek Signed-off-by: Wei Xu commit 504f2565a4f64a3cdd0a4e175a34ffc73297294a Author: Liang Chen Date: Tue Jul 17 15:49:03 2018 +0800 spi: rockchip: add description for px30 Add "rockchip,px30-spi", "rockchip,rk3066-spi" for spi on px30 platform. Signed-off-by: Liang Chen Signed-off-by: Mark Brown commit 1ef2917d1d9e6cce41c8794b2e3e81552b1668e4 Author: Thomas Zimmermann Date: Tue Jul 17 10:33:49 2018 +0200 drm/imx: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Philipp Zabel commit d778847208c016f66a44d4c40baa74ca3bf724fd Author: Chris Wilson Date: Tue Jul 17 09:23:34 2018 +0100 drm/i915/selftests: Free the backing store between iterations In the huge pages tests, we may have lots of objects being trapped on the freelist as we hold the struct_mutex allowing the free worker no opportunity to recover the backing store. We also have stricter requirements and the desire for large contiguous pages, further increasing the allocation pressure. To reduce the chance of running out of memory, we could either drop the mutex and flush the free worker, or we could release the backing store directly. We do the latter in this patch for simplicity. References: https://bugs.freedesktop.org/show_bug.cgi?id=107254 Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180717082334.18774-1-chris@chris-wilson.co.uk commit 4aaf448fa9754e2d5ee188d32327b24ffc15ca4d Author: Jim Qu Date: Tue Jul 17 16:20:50 2018 +0800 vga_switcheroo: set audio client id according to bound GPU id On modern laptop, there are more and more platforms have two GPUs, and each of them maybe have audio codec for HDMP/DP output. For some dGPU which is no output, audio codec usually is disabled. In currect HDA audio driver, it will set all codec as VGA_SWITCHEROO_DIS, the audio which is binded to UMA will be suspended if user use debugfs to contorl power In HDA driver side, it is difficult to know which GPU the audio has binded to. So set the bound gpu pci dev to vga_switcheroo. if the audio client is not the third registration, audio id will set in vga_switcheroo enable function. if the audio client is the last registration when vga_switcheroo _ready() get true, we should get audio client id from bound GPU directly. Signed-off-by: Jim Qu Reviewed-by: Lukas Wunner Signed-off-by: Takashi Iwai commit 238262af08a20e5f1932fcf606b8b84370ac8b77 Author: Sean Wang Date: Thu Jul 12 13:50:00 2018 +0800 pinctrl: mt7622: Fix probe fail by misuse the selector After the commit acf137951367 ("pinctrl: core: Return selector to the pinctrl driver") and the commit 47f1242d19c3 ("pinctrl: pinmux: Return selector to the pinctrl driver"), it's necessary to add the fixes needed for the pin controller drivers to use the appropriate returned selector for a negative error number returned in case of the fail at these functions. Otherwise, the driver would have a failed probe and that causes boot message cannot correctly output and devices fail to acquire their own pins. Cc: Kevin Hilman Fixes: acf137951367 ("pinctrl: core: Return selector to the pinctrl driver") Fixes: 47f1242d19c3 ("pinctrl: pinmux: Return selector to the pinctrl driver") Signed-off-by: Sean Wang Signed-off-by: Linus Walleij commit 673ba5a05ca14c2ddef038044768a4acd0ae0a53 Author: Wei Yongjun Date: Wed Jul 11 12:33:31 2018 +0000 pinctrl: single: Fix missing unlock on error path Add the missing unlock before return from function in the error handling case. Fixes: 0f5972033509 ("pinctrl: single: Fix group and function selector use") Signed-off-by: Wei Yongjun Acked-by: Tony Lindgren Signed-off-by: Linus Walleij commit 93639058b2af462a9871159be1afe60eab59431e Author: Tony Lindgren Date: Thu Jul 5 02:10:18 2018 -0700 pinctrl: core: Remove broken remove_last group and pinmux functions With no users left for these functions let's remove them. Reported-by: H. Nikolaus Schaller Cc: Christ van Willegen Cc: Haojian Zhuang Cc: Jacopo Mondi Cc: Paul Cercueil Cc: Sean Wang Signed-off-by: Tony Lindgren Tested-By: H. Nikolaus Schaller Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit dc4003d260594aa300028c3c5d040c5719abd19b Author: Tony Lindgren Date: Thu Jul 5 02:10:17 2018 -0700 pinctrl: rza1: Fix selector use for groups and functions We must use a mutex around the generic_add functions and save the function and group selector in case we need to remove them. Otherwise the selector use will be racy for deferred probe at least. Fixes: 5a49b644b307 ("pinctrl: Renesas RZ/A1 pin and gpio controller") Reported-by: H. Nikolaus Schaller Cc: Christ van Willegen Cc: Haojian Zhuang Cc: Paul Cercueil Cc: Sean Wang Acked-by: Jacopo Mondi Signed-off-by: Tony Lindgren Tested-By: H. Nikolaus Schaller Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit a4ab1086072365235864151bca57230afa8bcc93 Author: Tony Lindgren Date: Thu Jul 5 02:10:16 2018 -0700 pinctrl: single: Fix group and function selector use We must use a mutex around the generic_add functions and save the function and group selector in case we need to remove them. Otherwise the selector use will be racy for deferred probe at least. Note that struct device_node *np is unused in pcs_add_function() we remove that too and fix a checkpatch warning for bare unsigned while at it. Fixes: 571aec4df5b7 ("pinctrl: single: Use generic pinmux helpers for managing functions") Reported-by: H. Nikolaus Schaller Cc: Christ van Willegen Cc: Haojian Zhuang Cc: Jacopo Mondi Cc: Paul Cercueil Cc: Sean Wang Signed-off-by: Tony Lindgren Tested-By: H. Nikolaus Schaller Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit f913cfce4ee49a3382a9ff95696f49a46e56e974 Author: Tony Lindgren Date: Thu Jul 5 02:10:15 2018 -0700 pinctrl: pinmux: Return selector to the pinctrl driver We must return the selector from pinmux_generic_add_function() so pin controller device drivers can remove the right group if needed for deferred probe for example. And we now must make sure that a proper name is passed so we can use it to check if the entry already exists. Note that fixes are also needed for the pin controller drivers to use the selector value. Fixes: a76edc89b100 ("pinctrl: core: Add generic pinctrl functions for managing groups") Reported-by: H. Nikolaus Schaller Cc: Christ van Willegen Cc: Haojian Zhuang Cc: Jacopo Mondi Cc: Paul Cercueil Cc: Sean Wang Signed-off-by: Tony Lindgren Tested-By: H. Nikolaus Schaller Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit f7ff75e2a88f9246dace2195e9dedd98df41d416 Author: Wolfram Sang Date: Wed Jul 11 00:27:22 2018 +0200 i2c: recovery: rename variable for easier understanding While refactoring the routine before, it occurred to me that this will make the code much easier to understand. Signed-off-by: Wolfram Sang Acked-by: Peter Rosin Signed-off-by: Wolfram Sang commit a203728ac6bbbed2fdcf0a2e807c5473efcfdb30 Author: Tony Lindgren Date: Thu Jul 5 02:10:14 2018 -0700 pinctrl: core: Return selector to the pinctrl driver We must return the selector from pinctrl_generic_add_group() so pin controller device drivers can remove the right group if needed for deferred probe for example. And we now must make sure that a proper name is passed so we can use it to check if the entry already exists. Note that fixes are also needed for the pin controller drivers to use the selector value. Fixes: c7059c5ac70a ("pinctrl: core: Add generic pinctrl functions for managing groups") Reported-by: H. Nikolaus Schaller Cc: Christ van Willegen Cc: Haojian Zhuang Cc: Jacopo Mondi Cc: Paul Cercueil Cc: Sean Wang Signed-off-by: Tony Lindgren Tested-By: H. Nikolaus Schaller Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 4fe10de535ead365351d49e0ff625769b08f6eca Author: Wolfram Sang Date: Wed Jul 11 00:24:23 2018 +0200 i2c: rcar: use the new get_bus_free callback To break out of recovery as early as possible, feed back the bus_free logic state. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 7ca5f6be7900ca753ed01c0202dc5f998a41f4ee Author: Wolfram Sang Date: Wed Jul 11 00:24:22 2018 +0200 i2c: recovery: add get_bus_free callback Some IP cores have an internal 'bus free' logic which may be more advanced than just checking if SDA is high. Add a separate callback to get this status. Filling it is optional. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 0b71026c69caa10261218528326721828d29a481 Author: Wolfram Sang Date: Tue Jul 10 23:42:17 2018 +0200 i2c: recovery: refactor recovery function After exiting the while loop, we checked if recovery was successful and sent a STOP to the clients. Meanwhile however, we send a STOP after every pulse, so it is not needed after the loop. If we move the check for a free bus to the end of the while loop, we can shorten and simplify the logic. It is still ensured that at least one STOP will be sent to the wire even if SDA was not stuck low. Signed-off-by: Wolfram Sang Reviewed-by: Peter Rosin Signed-off-by: Wolfram Sang commit ffc59c496bf8498657321c59433f55bbcf2d9c38 Author: Wolfram Sang Date: Tue Jul 10 23:42:16 2018 +0200 i2c: recovery: require either get_sda or set_sda For bus recovery, we either need to bail out early if we can read SDA or we need to send STOP after every pulse. Otherwise recovery might be misinterpreted as an unwanted write. So, require one of those SDA handling functions to avoid this problem. Signed-off-by: Wolfram Sang Acked-by: Peter Rosin Signed-off-by: Wolfram Sang commit 91f6278bfa3966529c61808bd3cb8f05d7ed5dc6 Author: Koen Kooi Date: Tue Jul 17 08:51:49 2018 +0200 ARM: dts: am335x: add am335x-sancloud-bbe board support The "Beaglebone Enhanced" by Sancloud is based on the Beaglebone Black, but with the following differences: * Gigabit capable PHY * Extra USB hub, optional i2c control * lps3331ap barometer connected over i2c * MPU6050 6 axis MEMS accelerometer/gyro connected over i2c * 1GiB DDR3 RAM * RTL8723 Wifi/Bluetooth connected over USB Tested on a revision G board. Signed-off-by: Koen Kooi Signed-off-by: Tony Lindgren commit cf0a761a22beb63e2e73b19664b94010cfbd2166 Author: Koen Kooi Date: Tue Jul 17 09:40:58 2018 +0200 dt-bindings: Add vendor prefix for Sancloud Add vendor prefix for Sancloud Ltd. Signed-off-by: Koen Kooi Acked-by: Rob Herring Signed-off-by: Tony Lindgren commit 08948b75939f72bd013699963cc7187f25197653 Merge: fb2896a77989 9d3cce1e8b85 Author: Wolfram Sang Date: Tue Jul 17 10:03:42 2018 +0200 Merge tag 'v4.18-rc5' into i2c/for-4.19 Linux 4.18-rc5 commit 2b519747ae4859e886c37834d766fe0c7d8d82e2 Author: Ryder Lee Date: Mon Jul 16 22:59:09 2018 +0800 arm64: dts: mt7622: update a clock property for UART0 The input clock of UART0 should be CLK_PERI_UART0_PD. Fixes: 13f36c326cef ("arm64: dts: mt7622: turn uart0 clock to real ones") Signed-off-by: Ryder Lee Signed-off-by: Matthias Brugger commit e9d8c61557687b7126101e9550bdf243223f0d8f Author: Rik van Riel Date: Mon Jul 16 15:03:37 2018 -0400 x86/mm/tlb: Skip atomic operations for 'init_mm' in switch_mm_irqs_off() Song Liu noticed switch_mm_irqs_off() taking a lot of CPU time in recent kernels,using 1.8% of a 48 CPU system during a netperf to localhost run. Digging into the profile, we noticed that cpumask_clear_cpu and cpumask_set_cpu together take about half of the CPU time taken by switch_mm_irqs_off(). However, the CPUs running netperf end up switching back and forth between netperf and the idle task, which does not require changes to the mm_cpumask. Furthermore, the init_mm cpumask ends up being the most heavily contended one in the system. Simply skipping changes to mm_cpumask(&init_mm) reduces overhead. Reported-and-tested-by: Song Liu Signed-off-by: Rik van Riel Acked-by: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: efault@gmx.de Cc: kernel-team@fb.com Cc: luto@kernel.org Link: http://lkml.kernel.org/r/20180716190337.26133-8-riel@surriel.com Signed-off-by: Ingo Molnar commit 95b0e6357d3e4e05349668940d7ff8f3b7e7e11e Author: Rik van Riel Date: Mon Jul 16 15:03:36 2018 -0400 x86/mm/tlb: Always use lazy TLB mode Now that CPUs in lazy TLB mode no longer receive TLB shootdown IPIs, except at page table freeing time, and idle CPUs will no longer get shootdown IPIs for things like mprotect and madvise, we can always use lazy TLB mode. Tested-by: Song Liu Signed-off-by: Rik van Riel Acked-by: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: efault@gmx.de Cc: kernel-team@fb.com Cc: luto@kernel.org Link: http://lkml.kernel.org/r/20180716190337.26133-7-riel@surriel.com Signed-off-by: Ingo Molnar commit 64482aafe55fc7e84d0741c356f8176ee7bde357 Author: Rik van Riel Date: Mon Jul 16 15:03:35 2018 -0400 x86/mm/tlb: Only send page table free TLB flush to lazy TLB CPUs CPUs in !is_lazy have either received TLB flush IPIs earlier on during the munmap (when the user memory was unmapped), or have context switched and reloaded during that stage of the munmap. Page table free TLB flushes only need to be sent to CPUs in lazy TLB mode, which TLB contents might not yet be up to date yet. Tested-by: Song Liu Signed-off-by: Rik van Riel Acked-by: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: efault@gmx.de Cc: kernel-team@fb.com Cc: luto@kernel.org Link: http://lkml.kernel.org/r/20180716190337.26133-6-riel@surriel.com Signed-off-by: Ingo Molnar commit ac0315896970d8589291e9d8a1569fc65967b7f1 Author: Rik van Riel Date: Mon Jul 16 15:03:34 2018 -0400 x86/mm/tlb: Make lazy TLB mode lazier Lazy TLB mode can result in an idle CPU being woken up by a TLB flush, when all it really needs to do is reload %CR3 at the next context switch, assuming no page table pages got freed. Memory ordering is used to prevent race conditions between switch_mm_irqs_off, which checks whether .tlb_gen changed, and the TLB invalidation code, which increments .tlb_gen whenever page table entries get invalidated. The atomic increment in inc_mm_tlb_gen is its own barrier; the context switch code adds an explicit barrier between reading tlbstate.is_lazy and next->context.tlb_gen. Unlike the 2016 version of this patch, CPUs with cpu_tlbstate.is_lazy set are not removed from the mm_cpumask(mm), since that would prevent the TLB flush IPIs at page table free time from being sent to all the CPUs that need them. This patch reduces total CPU use in the system by about 1-2% for a memcache workload on two socket systems, and by about 1% for a heavily multi-process netperf between two systems. Tested-by: Song Liu Signed-off-by: Rik van Riel Acked-by: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: efault@gmx.de Cc: kernel-team@fb.com Cc: luto@kernel.org Link: http://lkml.kernel.org/r/20180716190337.26133-5-riel@surriel.com Signed-off-by: Ingo Molnar commit 61d0beb5796ab11f7f3bf38cb2eccc6579aaa70b Author: Rik van Riel Date: Mon Jul 16 15:03:33 2018 -0400 x86/mm/tlb: Restructure switch_mm_irqs_off() Move some code that will be needed for the lazy -> !lazy state transition when a lazy TLB CPU has gotten out of date. No functional changes, since the if (real_prev == next) branch always returns. Suggested-by: Andy Lutomirski Signed-off-by: Rik van Riel Acked-by: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: efault@gmx.de Cc: kernel-team@fb.com Link: http://lkml.kernel.org/r/20180716190337.26133-4-riel@surriel.com Signed-off-by: Ingo Molnar commit 2ff6ddf19c0ec40633bd14d8fe28a289816bd98d Author: Rik van Riel Date: Mon Jul 16 15:03:32 2018 -0400 x86/mm/tlb: Leave lazy TLB mode at page table free time Andy discovered that speculative memory accesses while in lazy TLB mode can crash a system, when a CPU tries to dereference a speculative access using memory contents that used to be valid page table memory, but have since been reused for something else and point into la-la land. The latter problem can be prevented in two ways. The first is to always send a TLB shootdown IPI to CPUs in lazy TLB mode, while the second one is to only send the TLB shootdown at page table freeing time. The second should result in fewer IPIs, since operationgs like mprotect and madvise are very common with some workloads, but do not involve page table freeing. Also, on munmap, batching of page table freeing covers much larger ranges of virtual memory than the batching of unmapped user pages. Tested-by: Song Liu Signed-off-by: Rik van Riel Acked-by: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: efault@gmx.de Cc: kernel-team@fb.com Cc: luto@kernel.org Link: http://lkml.kernel.org/r/20180716190337.26133-3-riel@surriel.com Signed-off-by: Ingo Molnar commit c1a2f7f0c06454387c2cd7b93ff1491c715a8c69 Author: Rik van Riel Date: Mon Jul 16 15:03:31 2018 -0400 mm: Allocate the mm_cpumask (mm->cpu_bitmap[]) dynamically based on nr_cpu_ids The mm_struct always contains a cpumask bitmap, regardless of CONFIG_CPUMASK_OFFSTACK. That means the first step can be to simplify things, and simply have one bitmask at the end of the mm_struct for the mm_cpumask. This does necessitate moving everything else in mm_struct into an anonymous sub-structure, which can be randomized when struct randomization is enabled. The second step is to determine the correct size for the mm_struct slab object from the size of the mm_struct (excluding the CPU bitmap) and the size the cpumask. For init_mm we can simply allocate the maximum size this kernel is compiled for, since we only have one init_mm in the system, anyway. Pointer magic by Mike Galbraith, to evade -Wstringop-overflow getting confused by the dynamically sized array. Tested-by: Song Liu Signed-off-by: Rik van Riel Signed-off-by: Mike Galbraith Signed-off-by: Rik van Riel Acked-by: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: kernel-team@fb.com Cc: luto@kernel.org Link: http://lkml.kernel.org/r/20180716190337.26133-2-riel@surriel.com Signed-off-by: Ingo Molnar commit 37c45b2354cb2270f246679bedd8bf798cca351c Merge: 5e0fb5df2ee8 9d3cce1e8b85 Author: Ingo Molnar Date: Tue Jul 17 09:31:30 2018 +0200 Merge tag 'v4.18-rc5' into x86/mm, to pick up fixes Signed-off-by: Ingo Molnar commit 71b7ff5ebc9b1d5aa95eb48d6388234f1304fd19 Author: Andrea Parri Date: Mon Jul 16 11:06:05 2018 -0700 tools/memory-model: Rename litmus tests to comply to norm7 norm7 produces the 'normalized' name of a litmus test, when the test can be generated from a single cycle that passes through each process exactly once. The commit renames such tests in order to comply to the naming scheme implemented by this tool. Signed-off-by: Andrea Parri Signed-off-by: Paul E. McKenney Acked-by: Alan Stern Cc: Akira Yokosawa Cc: Boqun Feng Cc: David Howells Cc: Jade Alglave Cc: Linus Torvalds Cc: Luc Maranget Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arch@vger.kernel.org Cc: parri.andrea@gmail.com Link: http://lkml.kernel.org/r/20180716180605.16115-14-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 0fcff1715bec7593a0ba86f3fef46cd89af37a8b Author: Yauheni Kaliuta Date: Mon Jul 16 11:06:04 2018 -0700 tools/memory-model/Documentation: Fix typo, smb->smp The tools/memory-model/Documentation/explanation.txt file says "For each other CPU C', smb_wmb() forces all po-earlier stores" This commit therefore replaces the "smb_wmb()" with "smp_wmb()". Signed-off-by: Yauheni Kaliuta Signed-off-by: Paul E. McKenney Acked-by: Alan Stern Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/20180716180605.16115-13-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 7696f9910a9a40b8a952f57d3428515fabd2d889 Author: Andrea Parri Date: Mon Jul 16 11:06:03 2018 -0700 sched/Documentation: Update wake_up() & co. memory-barrier guarantees Both the implementation and the users' expectation [1] for the various wakeup primitives have evolved over time, but the documentation has not kept up with these changes: brings it into 2018. [1] http://lkml.kernel.org/r/20180424091510.GB4064@hirez.programming.kicks-ass.net Also applied feedback from Alan Stern. Suggested-by: Peter Zijlstra Signed-off-by: Andrea Parri Signed-off-by: Paul E. McKenney Acked-by: Peter Zijlstra (Intel) Cc: Akira Yokosawa Cc: Alan Stern Cc: Boqun Feng Cc: Daniel Lustig Cc: David Howells Cc: Jade Alglave Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Luc Maranget Cc: Nicholas Piggin Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arch@vger.kernel.org Cc: parri.andrea@gmail.com Link: http://lkml.kernel.org/r/20180716180605.16115-12-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 3d85b2703783636366560c94842affd8608ec9d1 Author: Andrea Parri Date: Mon Jul 16 11:06:02 2018 -0700 locking/spinlock, sched/core: Clarify requirements for smp_mb__after_spinlock() There are 11 interpretations of the requirements described in the header comment for smp_mb__after_spinlock(): one for each LKMM maintainer, and one currently encoded in the Cat file. Stick to the latter (until a more satisfactory solution is available). This also reworks some snippets related to the barrier to illustrate the requirements and to link them to the idioms which are relied upon at its call sites. Suggested-by: Boqun Feng Signed-off-by: Andrea Parri Signed-off-by: Paul E. McKenney Acked-by: Peter Zijlstra Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Will Deacon Cc: akiyks@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: stern@rowland.harvard.edu Link: http://lkml.kernel.org/r/20180716180605.16115-11-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 76e079fefc8f62bd9b2cd2950814d1ee806e31a5 Author: Andrea Parri Date: Mon Jul 16 11:06:01 2018 -0700 sched/core: Use smp_mb() in wake_woken_function() wake_woken_function() synchronizes with wait_woken() as follows: [wait_woken] [wake_woken_function] entry->flags &= ~wq_flag_woken; condition = true; smp_mb(); smp_wmb(); if (condition) wq_entry->flags |= wq_flag_woken; break; This commit replaces the above smp_wmb() with an smp_mb() in order to guarantee that either wait_woken() sees the wait condition being true or the store to wq_entry->flags in woken_wake_function() follows the store in wait_woken() in the coherence order (so that the former can eventually be observed by wait_woken()). The commit also fixes a comment associated to set_current_state() in wait_woken(): the comment pairs the barrier in set_current_state() to the above smp_wmb(), while the actual pairing involves the barrier in set_current_state() and the barrier executed by the try_to_wake_up() in wake_woken_function(). Signed-off-by: Andrea Parri Signed-off-by: Paul E. McKenney Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: stern@rowland.harvard.edu Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/20180716180605.16115-10-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 70b83069f70d185356beba3202b9d167ee39f051 Author: Paul E. McKenney Date: Mon Jul 16 11:06:00 2018 -0700 tools/memory-model: Add informal LKMM documentation to MAINTAINERS The Linux-kernel memory model has been informal, with a number of text files documenting it. It would be good to make sure that these informal descriptions are kept up to date and/or pruned appropriately. This commit therefore brings more of those text files into the LKMM MAINTAINERS file entry. Signed-off-by: Paul E. McKenney Acked-by: Andrea Parri Cc: Akira Yokosawa Cc: Alan Stern Cc: Boqun Feng Cc: Daniel Lustig Cc: David Howells Cc: David S. Miller Cc: Jade Alglave Cc: Linus Torvalds Cc: Luc Maranget Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arch@vger.kernel.org Cc: parri.andrea@gmail.com Link: http://lkml.kernel.org/r/20180716180605.16115-9-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit c4081a46f38fd9917e0beb58de72391f27138d57 Author: Jonathan Neuschäfer Date: Mon Jul 16 11:05:59 2018 -0700 locking/atomics/Documentation: Describe atomic_set() as a write operation The atomic_set() and ATOMIC_INIT() operations are writes, so this commit changes their description from "reads" to "writes". Signed-off-by: Jonathan Neuschäfer Signed-off-by: Paul E. McKenney Reviewed-by: Andrea Parri Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: stern@rowland.harvard.edu Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/20180716180605.16115-8-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 24675bb554f9e3d0e2bd61f6a7d8da50d224c8ff Author: Paul E. McKenney Date: Mon Jul 16 11:05:58 2018 -0700 tools/memory-model: Make scripts executable This commit makes the scripts executable to avoid the need for everyone to do so manually in their archive. Signed-off-by: Paul E. McKenney Acked-by: Akira Yokosawa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: stern@rowland.harvard.edu Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/20180716180605.16115-7-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit af41db5ef7c7cf0fee860f65cab59d0d188098d2 Author: Mark Rutland Date: Mon Jul 16 11:05:57 2018 -0700 tools/memory-model: Remove ACCESS_ONCE() from model Since commit: b899a850431e2dd0 ("compiler.h: Remove ACCESS_ONCE()") ... there has been no definition of ACCESS_ONCE() in the kernel tree, and it has been necessary to use READ_ONCE() or WRITE_ONCE() instead. Correspondingly, let's remove ACCESS_ONCE() from the kernel memory model. Signed-off-by: Mark Rutland Signed-off-by: Paul E. McKenney Acked-by: Andrea Parri Cc: Akira Yokosawa Cc: Alan Stern Cc: Boqun Feng Cc: David Howells Cc: Jade Alglave Cc: Linus Torvalds Cc: Luc Maranget Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arch@vger.kernel.org Cc: parri.andrea@gmail.com Link: http://lkml.kernel.org/r/20180716180605.16115-6-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 5bde06b63af2af8c2326270aae041067eef89245 Author: Mark Rutland Date: Mon Jul 16 11:05:56 2018 -0700 tools/memory-model: Remove ACCESS_ONCE() from recipes Since commit: b899a850431e2dd0 ("compiler.h: Remove ACCESS_ONCE()") ... there has been no definition of ACCESS_ONCE() in the kernel tree, and it has been necessary to use READ_ONCE() or WRITE_ONCE() instead. Let's update the exmaples in recipes.txt likewise for consistency, using READ_ONCE() for reads. Signed-off-by: Mark Rutland Signed-off-by: Paul E. McKenney Acked-by: Andrea Parri Cc: Akira Yokosawa Cc: Alan Stern Cc: Boqun Feng Cc: David Howells Cc: Jade Alglave Cc: Linus Torvalds Cc: Luc Maranget Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arch@vger.kernel.org Cc: parri.andrea@gmail.com Link: http://lkml.kernel.org/r/20180716180605.16115-5-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 68ec3444b32158541f4bbd47ed9345634c56399d Author: SeongJae Park Date: Mon Jul 16 11:05:55 2018 -0700 locking/memory-barriers.txt/kokr: Update Korean translation to fix broken DMA vs. MMIO ordering example Translate this commit to Korean: 5846581e3563 ("locking/memory-barriers.txt: Fix broken DMA vs. MMIO ordering example") [ paulmck: Updated based on feedback from Byungchul Park. ] Signed-off-by: SeongJae Park Signed-off-by: Paul E. McKenney Acked-by: Byungchul Park Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: stern@rowland.harvard.edu Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/20180716180605.16115-4-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 2caf412dc46149b8714e0f52c8337e8eda035a83 Author: Palmer Dabbelt Date: Mon Jul 16 11:05:54 2018 -0700 MAINTAINERS: Add Daniel Lustig as an LKMM reviewer Dan runs the RISC-V memory model working group. I've been forwarding him LKMM emails that end up in my inbox, but I'm far from an expert in this stuff. He requested to be added as a reviewer, which seems sane to me as it'll take a human out of the loop. Signed-off-by: Palmer Dabbelt Signed-off-by: Paul E. McKenney Acked-by: Daniel Lustig Acked-by: Andrea Parri Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: stern@rowland.harvard.edu Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/20180716180605.16115-3-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit acb6c96c52ac0da6bb464173ad2cf5ada9049ad4 Author: Paul E. McKenney Date: Mon Jul 16 11:05:53 2018 -0700 tools/memory-model: Fix ISA2+pooncelock+pooncelock+pombonce name The names on the first line of the litmus tests are arbitrary, but the convention is that they be the filename without the trailing ".litmus". This commit therefore removes the stray trailing ".litmus" from ISA2+pooncelock+pooncelock+pombonce.litmus's name. Reported-by: Andrea Parri Signed-off-by: Paul E. McKenney Acked-by: Alan Stern Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/20180716180605.16115-2-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit b464818978d45cd4d78c8f13207891142c68bea9 Author: Paul E. McKenney Date: Mon Jul 16 11:05:52 2018 -0700 tools/memory-model: Add litmus test for full multicopy atomicity This commit adds a litmus test suggested by Alan Stern that is forbidden on fully multicopy atomic systems, but allowed on other-multicopy and on non-multicopy atomic systems. For reference, s390 is fully multicopy atomic, x86 and ARMv8 are other-multicopy atomic, and ARMv7 and powerpc are non-multicopy atomic. Suggested-by: Alan Stern Signed-off-by: Paul E. McKenney Acked-by: Alan Stern Acked-by: Andrea Parri Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/20180716180605.16115-1-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar commit 52b544bd386688177c41d53e748111c29d0ccc98 Merge: afed7bcf9487 9d3cce1e8b85 Author: Ingo Molnar Date: Tue Jul 17 09:27:43 2018 +0200 Merge tag 'v4.18-rc5' into locking/core, to pick up fixes Signed-off-by: Ingo Molnar commit 25cd17a2360ee285a314e55affcfb0d7fa6aac0d Author: Fabio Estevam Date: Mon Jul 16 23:08:45 2018 -0300 ARM: dts: imx6ul-pico-hobbit: Do not hardcode the memory size There are two variants of imx6ul-pico boards: one with 256MB and another one with 512MB of RAM. Do not hardcode the memory size in the device tree and let the bootloader fill the correct value instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0982a24f2401d8ac89e4694a21af3c118354f6ef Author: Robin Gong Date: Tue Jul 17 13:12:05 2018 +0800 ARM: dts: imx6sl-evk: make pfuze100 sw4 always on On i.MX6SL EVK board, pfuze100 sw4 supplies LPDDR2 which is critical for system, must be always on. Signed-off-by: Robin Gong Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 2afad1be58098e3f661428a0a70060f935f0b5dc Author: Anson Huang Date: Tue Jul 17 13:12:04 2018 +0800 ARM: dts: imx6sll-evk: make pfuze100 sw4 always on On i.MX6SLL EVK board, pfuze100 sw4 supplies LPDDR3 which is critical for system, must be always on. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 4de4238133f439790c3abd41523ae44dba826bd8 Author: Anson Huang Date: Tue Jul 17 13:12:03 2018 +0800 ARM: dts: imx6sx-sdb-reva: make pfuze100 sw4 always on On i.MX6SX SDB Rev-A board, pfuze100 sw4 supplies csi, audio codec and i2c etc., these modules do NOT implement power domain control, so pfuze100 sw4 needs to be always on to make sure these modules work normally. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 9896b67eaf4b72b31481aa17266790d28c9c0a6c Author: Anson Huang Date: Tue Jul 17 13:12:02 2018 +0800 ARM: dts: imx6qdl-sabresd: make pfuze100 sw4 always on On i.MX6QDL Sabre-SD board, pfuze100 sw4 supplies GPS, touch and RGMII etc., these modules do NOT implement power domain control, so pfuze100 sw4 needs to be always on to make sure these modules work normally. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit ea73a5c6929b9c7d30b7b424414645641cb7d1d9 Merge: 9d3cce1e8b85 18952651dae8 Author: Ingo Molnar Date: Tue Jul 17 09:16:02 2018 +0200 Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu Pull RCU updates from Paul E. McKenney: - An optimization and a fix for RCU expedited grace periods, with the fix being from Boqun Feng. - Miscellaneous fixes, including a lockdep-annotation fix from Boqun Feng. - SRCU updates. - Updates to rcutorture and associated scripting. - Introduce grace-period sequence numbers to the RCU-bh, RCU-preempt, and RCU-sched flavors, replacing the old ->gpnum and ->completed pair of fields. This change allows lockless code to obtain the complete grace-period state with a single READ_ONCE(), which is needed to maintain tolerable lock contention during the upcoming consolidation of the three RCU flavors. Note that grace-period sequence numbers are already used by rcu_barrier(), expedited RCU grace periods, and SRCU, and are thus already heavily used and well-tested. Joel Fernandes contributed a number of excellent fixes and improvements. - Clean up some grace-period-reporting loose ends, including improving the handling of quiescent states from offline CPUs and fixing some false-positive WARN_ON_ONCE() invocations. (Strictly speaking, the WARN_ON_ONCE() invocations were quite correct, but their invariants were (harmlessly) violated by the earlier sloppy handling of quiescent states from offline CPUs.) In addition, improve grace-period forward-progress guarantees so as to allow removal of fail-safe checks that required otherwise needless lock acquisitions. Finally, add more diagnostics to help debug the upcoming consolidation of the RCU-bh, RCU-preempt, and RCU-sched flavors. - Additional miscellaneous fixes, including those contributed by Byungchul Park, Mauro Carvalho Chehab, Joe Perches, Joel Fernandes, Steven Rostedt, Andrea Parri, and Neil Brown. - Additional torture-test changes, including several contributed by Arnd Bergmann and Joel Fernandes. Signed-off-by: Ingo Molnar commit 61f0d55569463a1af897117ff47d202b0ccb2e24 Author: Ard Biesheuvel Date: Mon Jul 16 23:25:07 2018 +0800 efi/esrt: Only call efi_mem_reserve() for boot services memory The following commit: 7e1550b8f208 ("efi: Drop type and attribute checks in efi_mem_desc_lookup()") refactored the implementation of efi_mem_desc_lookup() so that the type check is moved to the callers, one of which is the x86 version of efi_arch_mem_reserve(), where we added a modified check that only takes EFI_BOOT_SERVICES_DATA regions into account. This is reasonable, since it is the only memory type that requires this, but doing so uncovered some unexpected behavior in the ESRT code, which permits the ESRT table to reside in other types of memory than what the UEFI spec mandates (i.e., EFI_BOOT_SERVICES_DATA), and unconditionally calls efi_mem_reserve() on the region in question. This may result in errors such as esrt: Reserving ESRT space from 0x000000009c810318 to 0x000000009c810350. efi: Failed to lookup EFI memory descriptor for 0x000000009c810318 when the ESRT table is not in EFI_BOOT_SERVICES_DATA memory, but we try to reserve it nonetheless. So make the call to efi_mem_reserve() conditional on the memory type. Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Peter Jones Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit bb3e3fbbac862fa72951283e3632e1cf21a68223 Author: Neeraj Dantu Date: Fri Jul 13 16:33:14 2018 +0000 ARM: dts: Add DT support for Octavo Systems OSD3358-SM-RED based on TI AM335x OSD3358-SM-RED is a dev board for OSD335x System-in-Package(SiP) devices from Octavo Systems. This board family can be indentified by the A335BNLTOS00 in the at24 eeprom: A2: [aa 55 33 ee 41 33 33 35 42 4e 4c 54 4f 53 30 30 |.U3.A335BNLTOS00|] https://octavosystems.com/octavo_products/osd3358-sm-red/ Signed-off-by: Neeraj Dantu CC: Tony Lindgren CC: Robert Nelson CC: Jason Kridner Signed-off-by: Tony Lindgren commit 929d1b09cae21da94a1829f0f3032152f6ec0784 Author: Anson Huang Date: Sat Jul 14 09:53:58 2018 +0800 ARM: dts: imx6sl-evk: add missing GPIO iomux setting On i.MX6SL EVK board, the MX6SL_PAD_KEY_ROW5 pin is used as lcd 3v3 regulator control pin, need to make sure MX6SL_PAD_KEY_ROW5 is muxed as GPIO function for controlling lcd 3v3 regulator. Signed-off-by: Anson Huang Reviewed-by; Fabio Estevam Signed-off-by: Shawn Guo commit 129e96672f03cfd0181a0fb65446d61d05c2aa58 Author: Andrey Smirnov Date: Tue Jul 17 14:44:38 2018 +0800 ARM: dts: imx51-zii-scu3-esb: Fix RAVE SP watchdog compatible string It looks like I made a nasty typo in the original patch which resulted in missing watchdog device. Fix it. Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphealy@gmail.com Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Andrew Lunn Signed-off-by: Andrey Smirnov Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit a1a30f892894ff27b747a04d032fee72ade1bdca Author: Andrey Smirnov Date: Fri Jul 13 10:30:04 2018 -0700 ARM: dts: imx51-zii-scu3-esb: Add switch IRQ line pinumx config Instead of relying on default values, configure PAD_AUD3_BB_CK to be a GPIO explicitly. While at, it change the pad configuration to enable a 100K pull-down (the pin is used as IRQ_TYPE_LEVEL_HIGH). Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphealy@gmail.com Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Andrew Lunn Reviewed-by: Andrew Lunn Signed-off-by: Andrey Smirnov Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2da6b9ce6a634773d22f157461d1119cd69e2672 Author: Gary Bisson Date: Fri Jul 13 14:49:04 2018 +0200 ARM: dts: imx6sx-nitrogen6sx: remove obsolete display configuration This display configuration isn't working as-is as it depends on the tfp410 LCD to HDMI bridge. This will need to be updated later once the DRM MXSFB driver will be the default. Signed-off-by: Gary Bisson Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit ac270caa1c420cc57ad2ba37679c2cf52c450781 Author: Gary Bisson Date: Fri Jul 13 14:49:03 2018 +0200 ARM: dts: imx7d-nitrogen7: use OF graph to describe the display To make use of the new eLCDIF DRM driver OF graph description is required. Describe the display using OF graph nodes. Signed-off-by: Gary Bisson Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3221ceeede8af762d823fe7a9ae7883f89e4dfb2 Author: Gary Bisson Date: Fri Jul 13 14:49:02 2018 +0200 ARM: dts: imx: Switch Boundary Devices boards to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Gary Bisson Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 69c04aee3482415cff52061a3ccad4943662e81d Author: Leonard Crestez Date: Fri Jul 13 13:01:15 2018 +0300 soc: imx6qp: Use GENPD_FLAG_ALWAYS_ON for PU errata This is functionally identical but simpler and slightly faster. The PU domain is turned on at boot time and never turned off. In the current implementation the pm core will repeatedly call power_off when the domain is unused and get -EBUSY back. If the domain is marked as "always on" instead the pm core won't even attempt to turn it off. In theory on 6qp it is safe to turn PU off in suspend, however that is best accomplished with a new core flag. Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach Reviewed-by: Ulf Hansson Signed-off-by: Shawn Guo commit 282706a681634d5e42cfa4dde909be931d4105a4 Author: Leonard Crestez Date: Fri Jul 13 12:39:35 2018 +0300 ARM: dts: imx6sl: Add vivante gpu nodes The imx6sl soc has gpu_2d and gpu_vg, no 3d support: etnaviv-gpu 2200000.gpu: model: GC320, revision: 5007 etnaviv-gpu 2204000.gpu: model: GC355, revision: 1215 The IP blocks seem to be already supported. Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0ad26ef12f570e79871b9be9528ce4bb4ed173d1 Author: Anson Huang Date: Fri Jul 13 15:58:27 2018 +0800 ARM: dts: imx6sll-evk: enable SEIKO 43WVF1G lcdif panel Enable SEIKO 43WVF1G lcdif panel for DRM driver, add necessary properties according to SEIKO 43WVF1G driver's requirement, such as "dvdd-supply", "avdd-supply" and "backlight" etc.. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e449d3780368364507b19524f8c660dc0409c053 Author: Anson Huang Date: Fri Jul 13 15:58:26 2018 +0800 ARM: dts: imx6sll-evk: correct lcd regulator GPIO pin On i.MX6SLL EVK board, lcd regulator is controlled by GPIO4 IO03 using MX6SLL_PAD_KEY_ROW5__GPIO4_IO03 pin, NOT MX6SLL_PAD_ECSPI1_SCLK__GPIO4_IO08, correct it. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit a046e7662dcf2ddd28b84552e20baa03355d8423 Author: Anson Huang Date: Fri Jul 13 15:58:25 2018 +0800 ARM: dts: imx6sll-evk: enable PWM1 for backlight driver Enable pwm1 module on i.MX6SLL EVK board to make backlight driver really work with LCD panel connected. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit fcaccc829382aafaab640933e526b786791ae8e7 Author: Rick Farrington Date: Mon Jul 16 18:06:07 2018 -0700 liquidio: correct error msg text when removing VLAN ID Signed-off-by: Rick Farrington Signed-off-by: Felix Manlunas Signed-off-by: David S. Miller commit b4d5f09fbc00463cee21c28485080e9537c48508 Author: Fabio Estevam Date: Thu Jul 12 10:02:38 2018 -0300 ARM: dts: imx51-zii-rdu1: Enable secure-reg-access Add 'secure-reg-access' property to enable PMU and hardware counters so that they can be properly used with the 'perf' tool. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3ec14f5eb58f5c77713f39159e73422c187f9ca4 Author: Fabio Estevam Date: Thu Jul 12 10:02:37 2018 -0300 ARM: dts: imx51-babbage: Enable secure-reg-access Add 'secure-reg-access' property to enable PMU and hardware counters so that they can be properly used with the 'perf' tool. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit dd769b09003ec92f088fef1be96bfe90cf44d640 Author: Sebastian Reichel Date: Thu Jul 12 10:02:36 2018 -0300 ARM: dts: imx53-ppd: Enable secure-reg-access Add 'secure-reg-access' property to enable PMU and hardware counters so that they can be properly used with the 'perf' tool. Signed-off-by: Sebastian Reichel [fabio: kept the change only in imx53-ppd context] Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit ccaabeea02026e1fbf9274800e43d9135914cd72 Author: Sebastian Ott Date: Mon Jun 25 14:25:59 2018 +0200 s390/chsc: fix packed-not-aligned warnings Remove attribute packed where possible failing this add proper alignment information to fix warnings like the one below: drivers/s390/cio/chsc.c: In function 'chsc_siosl': drivers/s390/cio/chsc.c:1287:2: warning: alignment 1 of 'struct ' is less than 4 [-Wpacked-not-aligned] } __attribute__ ((packed)) *siosl_area; Note: this patch should be a nop since non of these structs use auto storage but allocated pages. However there are changes to the generated code because of additional padding at the end of some of the structs due to alignment when memset(foo, 0, sizeof(*foo)) is used. Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit d4f5d79e97ca6e903700d3d9455afb5694cc4833 Author: Sebastian Ott Date: Tue Jun 26 15:09:32 2018 +0200 s390/css: reduce stsch calls Both css_evaluate_new_subchannel and cio_validate_subchannel used stsch and css_sch_is_valid to check for a valid device. Reduce stsch calls during subchannel evaluation by re-using schib data. Also the type/devno valid information is only checked once. Signed-off-by: Sebastian Ott Reviewed-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky commit 05b217f4c5573f34f6799698f7d4162c702132bc Author: Sebastian Ott Date: Mon Jun 25 11:23:26 2018 +0200 s390/css: validate subchannel prior to allocation In css_alloc_subchannel we allocate the subchannel and do a validation of the subchannel (to decide if we should look for devices via this subchannel). On a typical LPAR we find lots of subchannels to be invalid (because there is no device attached or the device is blacklisted) leading to lots of useless kmalloc and kfree calls. This patch changes the order to only allocate the subchannels that have been found valid. Signed-off-by: Sebastian Ott Reviewed-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky commit 71aa11a40d1a1d80196b55d8dd95be2bc4c1649e Author: Sebastian Ott Date: Tue Jun 12 13:56:21 2018 +0200 s390/css: start the subchannel evaluation earlier The css bus code uses 2 initcalls: channel_subsystem_init to initialize internal data and channel_subsystem_init_sync to start scanning for devices and wait for it to finish. The start scanning for devices part is moved to the first initcall such that more work happens in parallel. Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit 87dc8a01281a4543ed25c367dace6e0f267e0dd1 Author: Sebastian Ott Date: Wed Jun 13 16:26:23 2018 +0200 s390/cio: ensure that a chpid is registered only once Improve locking in chp_new to make sure that we don't register the same chpid twice. Chpid registration was synchronized via the machine check handler thread but we also have codepaths to look for new chpids triggered independent of that thread (during IPL or resume from hibernate). Signed-off-by: Sebastian Ott Reviewed-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky commit aaeabc18a086d2b915ceb4eb070b9ad21276d39d Author: Stefan Agner Date: Thu Jul 12 12:59:42 2018 +0200 ARM: imx_v6_v7_defconfig: use MXSFB DRM driver Use the the DRM driver for MXSFB LCD controller (used in i.MX23/ i.MX28/i.MX6SX or i.MX7). Remove CONFIG_FB_MXS which will soon be removed. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit f13a7fe2826f84fe60d9883a4d697e86e520bdbf Author: Stefan Agner Date: Thu Jul 12 12:59:41 2018 +0200 ARM: mxs_defconfig: use MXSFB DRM driver Use the the DRM driver for MXSFB LCD controller (used in i.MX23/ i.MX28/i.MX6SX or i.MX7). Remove CONFIG_FB_MXS which will soon be removed. Note that this does not remove CONFIG_FB. CONFIG_FB gets selected implicity by CONFIG_DRM/CONFIG_DRM_KMS_FB_HELPER. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 8c7725829989d2711875f60356d22bc5af981ac0 Author: Alex Gonzalez Date: Thu Jul 12 10:20:36 2018 +0200 ARM: dts: imx6ul: Add DTS for ConnectCore 6UL SBC Express The ConnectCore 6UL Single Board Computer (SBC) Express contains the ConnectCore 6UL System-On-Module. Its hardware specifications are: * 256MB DDR3 memory * 256MB NAND flash * Single Ethernet * USB Host and USB-OTG * MicroSD external storage * Groove connectors and Raspberry Pi Hat compatible expansion header Signed-off-by: Alex Gonzalez Signed-off-by: Shawn Guo commit 0b9c89e213d227d3649a1cb77bb6b912fbd532f9 Author: Alex Gonzalez Date: Thu Jul 12 10:20:35 2018 +0200 ARM: dts: imx6ul: Add DTS for ConnectCore 6UL System-On-Module (SOM) The ConnectCore 6UL System-On-Module has the following hardware specification: * Based on a NXP i.MX6UL SoC * Industrial temperature ranges (-40ºC to +85ºC) * Up to 1GB DDR3 memory * Up to 2GB NAND flash * Dual Ethernet * On module 802.11 WiFi and Bluetooth 4.2 (QCA6564) * On module NXP Kinetis KL03 * On module Microchip ATECC508A crypto element Signed-off-by: Alex Gonzalez Signed-off-by: Shawn Guo commit 497f6ee16b05621bf118517dd4b7848836d9767e Author: Fabio Estevam Date: Wed Jul 11 18:34:27 2018 -0300 ARM: dts: imx51-zii-rdu1: Disable internal watchdog imx51-zii-rdu1 has an external watchdog in the environment microcontroller, so disable the internal one. This aligns with what was done in commit 7055f714032c ("ARM: dts: imx6: RDU2: disable internal watchdog") for imx6 rdu2 board. Signed-off-by: Fabio Estevam Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit eb28fb9e47666c372c73a8b601e9462640928961 Author: Icenowy Zheng Date: Fri Jul 13 00:04:52 2018 +0800 arm64: dts: allwinner: h6: enable AXP805 PMIC on Pine H64 Pine H64 board has an AXP805 PMIC on it, wired up in standalone, or self-working, mode. Enable it in the device tree. Signed-off-by: Icenowy Zheng Reviewed-by: Icenowy Zheng Tested-by: Icenowy Zheng Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit de2b5552ae5868b3dc9cdea3c0e1e375652b329e Author: Chen-Yu Tsai Date: Fri Jul 13 00:04:51 2018 +0800 arm64: dts: allwinner: h6: Use macros for R_CCU clock and reset indices Now that the device tree binding headers for the R_CCU have been merged, we can use the macros, instead of raw numbers. Switch to R_CCU macros for clock and reset indices. Reviewed-by: Icenowy Zheng Tested-by: Icenowy Zheng Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit ccdb51717ba3bdc9585998e4ffd41d70c04dedea Author: David S. Miller Date: Mon Jul 16 17:02:04 2018 -0700 net: Fix GRO_HASH_BUCKETS assertion. FIELD_SIZEOF() is in bytes, but we want bits. Fixes: d9f37d01e294 ("net: convert gro_count to bitmask") Suggested-by: Eric Dumazet Signed-off-by: David S. Miller commit dc989d2ce2c2bc4b5cdc92a9d2c8a5c857448475 Author: Jakub Kicinski Date: Mon Jul 16 10:57:16 2018 -0700 tools: bpftool: don't pass FEATURES_DUMP to libbpf bpftool does not export features it probed for, i.e. FEATURE_DUMP_EXPORT is always empty, so don't try to communicate the features to libbpf. It has no effect. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit b4b5bffd6c19b1005d2e4c90971bf562b8b4a55b Author: Jakub Kicinski Date: Mon Jul 16 10:57:15 2018 -0700 tools: libbpf: remove libelf-getphdrnum feature detection libbpf does not depend on libelf-getphdrnum feature, don't check it. $ git grep HAVE_ELF_GETPHDRNUM_SUPPORT tools/perf/Makefile.config: CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT tools/perf/util/symbol-elf.c:#ifndef HAVE_ELF_GETPHDRNUM_SUPPORT Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit b5aa3f4aef724e9c0f626dcf69948b22efcc5176 Author: Felix Kuehling Date: Mon Jul 16 19:10:37 2018 -0400 drm/amdkfd: Call kfd2kgd.set_compute_idle User mode queue submissions don't go through KFD. Therefore we don't know exactly when compute is idle or not idle. We use the existence of user mode queues on a device as an approximation. register_process is called when the first queue of a process is created. Conversely unregister_process is called when the last queue is destroyed. The first process that is registered takes compute out of idle. The last process that is unregisters sets compute back to idle. Signed-off-by: Felix Kuehling Reviewed-by: Eric Huang Reviewed-by: Alex Deucher Signed-off-by: Oded Gabbay commit 01c097dbfc03ac1357b9c8a1f52fd43d636bc7f7 Author: Felix Kuehling Date: Mon Jul 16 19:10:36 2018 -0400 drm/amdgpu: Add kfd2kgd.set_compute_idle interface This allows automatic switching to the compute power profile depending on compute activity. Signed-off-by: Felix Kuehling Reviewed-by: Eric Huang Reviewed-by: Alex Deucher Signed-off-by: Oded Gabbay commit ee583014a9d8cc48cb4969f87cc02c12b966fabc Author: Dan Carpenter Date: Fri Jul 13 18:05:37 2018 +0300 samples/bpf: test_cgrp2_sock2: fix an off by one "prog_cnt" is the number of elements which are filled out in prog_fd[] so the test should be >= instead of >. Signed-off-by: Dan Carpenter Reviewed-by: David Ahern Signed-off-by: Alexei Starovoitov commit b0294bc1ad19e9d2dd03df5faa1ccc395d4ddd4b Author: Dan Carpenter Date: Fri Jul 13 18:11:39 2018 +0300 samples: bpf: ensure that we don't load over MAX_PROGS programs I can't see that we check prog_cnt to ensure it doesn't go over MAX_PROGS. Signed-off-by: Dan Carpenter Signed-off-by: Alexei Starovoitov commit 301f935be9e09a1bf188bd8262a4db0aeeac2b50 Author: Toke Høiland-Jørgensen Date: Mon Jul 16 16:45:09 2018 +0200 sch_cake: Fix tin order when set through skb->priority In diffserv mode, CAKE stores tins in a different order internally than the logical order exposed to userspace. The order remapping was missing in the handling of 'tc filter' priority mappings through skb->priority, resulting in bulk and best effort mappings being reversed relative to how they are displayed. Fix this by adding the missing mapping when reading skb->priority. Fixes: 83f8fd69af4f ("sch_cake: Add DiffServ handling") Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 1eb94d441f1c6aff4a594662d11c183520ffe4f3 Author: Surendra Mobiya Date: Mon Jul 16 19:40:54 2018 +0530 cxgb4: collect ASIC LA dumps from ULP TX Signed-off-by: Surendra Mobiya Signed-off-by: Rahul Lakkireddy Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 7e580769b79f1df2ac67cf935ee95ac1d42b8144 Author: Giulio Benetti Date: Wed May 16 23:08:40 2018 +0200 rtc: ds1307: support m41t11 variant The m41t11 variant is very similar to the already supported m41t00 and m41t0, but it has also 56 bytes of NVRAM. Add it to driver taking into account NVRAM section. Signed-off-by: Giulio Benetti Reviewed-by: Rob Herring Signed-off-by: Alexandre Belloni commit 146a552c67b1adae50065d2c8f00169302f26c44 Author: Giulio Benetti Date: Wed May 16 23:08:39 2018 +0200 rtc: ds1307: fix data pointer to m41t0 data field points to m41t00, instead it should point to m41t0. Driver works correctly because on both cases(m41t0 and m41t00) chip_desc are equal. Point to right enum m41t0 instead of m41t00. Signed-off-by: Giulio Benetti Signed-off-by: Alexandre Belloni commit ee913fd9e166384aacc0aa70ffd4e93ca41d54b0 Author: Christian König Date: Fri Jul 13 16:29:10 2018 +0200 drm/amdgpu: add amdgpu_job_submit_direct helper Make sure that we properly initialize at least the sched member. Signed-off-by: Christian König Reviewed-by: Junwei Zhang Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit 3320b8d2acd3d480d0dd4835d970067354eac915 Author: Christian König Date: Fri Jul 13 15:08:44 2018 +0200 drm/amdgpu: remove job->ring We can easily get that from the scheduler. Signed-off-by: Christian König Reviewed-by: Junwei Zhang Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit 0e28b10ff1b8e65788040b51c30c9cc984060dcd Author: Christian König Date: Fri Jul 13 13:54:56 2018 +0200 drm/amdgpu: remove ring parameter from amdgpu_job_submit We know the ring through the entity anyway. Signed-off-by: Christian König Reviewed-by: Junwei Zhang Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit eb3961a57424a5c3dae44576d1c88e64a818d871 Author: Christian König Date: Fri Jul 13 09:58:49 2018 +0200 drm/amdgpu: remove fence context from the job Can be obtained directly from the fence as well. Signed-off-by: Christian König Reviewed-by: Junwei Zhang Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit 050d9d43a7d3847fd9726a675bf644b124518425 Author: Christian König Date: Fri Jul 13 09:50:08 2018 +0200 drm/amdgpu: cleanup job header Move job related defines, structure and function declarations to amdgpu_job.h Signed-off-by: Christian König Reviewed-by: Junwei Zhang Acked-by: Chunming Zhou Signed-off-by: Alex Deucher commit 9a6a8075bd439115b41468eaccdcb5e463196fb5 Author: Harry Wentland Date: Fri Jul 6 13:40:33 2018 -0400 drm/amd/display: Fix some checkpatch.pl errors and warnings in dc_link_dp.c [Why] Any Linux kernel code should pass checkpatch.pl with no errors and little, if any, warning. [How] Fixing some spacing errors and warnings. Signed-off-by: Harry Wentland Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit ddb85fcd839cab0ac46a44d47c4f345dad4c2cb1 Author: Krunoslav Kovac Date: Tue Jul 10 16:04:05 2018 -0400 drm/amd/display: Null ptr check for set_sdr_white_level [Why&How] Cursor boosting can only be done on DCN+ Check for nullptr since DCE doesn't implement it. Signed-off-by: Krunoslav Kovac Reviewed-by: Sivapiriyan Kumarasamy Acked-by: Leo Li Signed-off-by: Alex Deucher commit 4a7d1d123ddb8c0b57e9beacee03ffcc9b55555a Author: Harry Wentland Date: Mon Jul 9 17:25:15 2018 -0400 drm/amd/display: dal 3.1.56 Signed-off-by: Harry Wentland Reviewed-by: Steven Chiu Acked-by: Leo Li Signed-off-by: Alex Deucher commit d6e75df4e5e10362a140c5c6ce8ced3612296ae3 Author: Jun Lei Date: Fri Jun 22 16:51:47 2018 -0400 drm/amd/display: add new dc debug structure to track debug data [why] Some DTN tests still failing @ 2% Need to reduce. [how] add instrumentation code to driver so we can get more information from failed runs. Signed-off-by: Jun Lei Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit 68199bd16cb56d121ade83918d5858933d07ae8a Author: Tony Cheng Date: Sat Jul 7 15:43:07 2018 -0400 drm/amd/display: Move address tracking out of HUBP [Why] We sometime require remapping of FB address space to UMA [How] Move address tracking up a layer before we apply address translation Signed-off-by: Tony Cheng Reviewed-by: Charlene Liu Acked-by: Leo Li Signed-off-by: Alex Deucher commit 2068afe649ae36f422ced4ecf0efee79e2ff5154 Author: Nikola Cornij Date: Wed Jul 4 19:05:16 2018 -0400 drm/amd/display: Add hook for MST root branch info This allows DM to do any necessary updates before MST discovery starts. Signed-off-by: Nikola Cornij Reviewed-by: Nikola Cornij Acked-by: Leo Li Signed-off-by: Alex Deucher commit bf53769d9fc95c89d2f1588463c268c3af987748 Author: Gloria Li Date: Tue Jul 3 14:39:22 2018 -0400 drm/amd/display: add HDR visual confirm [Why] Testing team wants a way to tell if HDR is on or not [How] Program the overscan color to visually indicate the HDR state of the top-most plane Signed-off-by: Gloria Li Reviewed-by: Aric Cyr Acked-by: Leo Li Signed-off-by: Alex Deucher commit 6d92b5c2d5bea1b1d0859bd8f3080344e5e3960e Author: Krunoslav Kovac Date: Wed Jun 27 18:23:37 2018 -0400 drm/amd/display: Refactor SDR cursor boosting in HDR mode [Why] Cursor boosting is done via CNVC_CUR register which is DPP, not HUBP Previous commit was implementing it in HUBP functions, and also breaking diags tests. [How] 1. Undo original commit as well as Eric's diags test fix, almost completely 2. Move programming to DPP and call via new dc_stream function 3. Also removing cur_rom_en from dpp_cursor_attributes and programming as part of normal cursor attributes as it depends on cursor color format Signed-off-by: Krunoslav Kovac Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit 8d2bbe54d18906e456c1ba0e1b0aa9fd175cae97 Author: Vitaly Prosyak Date: Fri Jun 15 08:34:10 2018 -0500 drm/amd/display: Add headers for hardcoded 1d luts. Hard-coded luts are needed since complex algorithms are used for color and tone mapping. Add the headers for future use. Signed-off-by: Vitaly Prosyak Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit a6da48caf92b4b6119cae146259528bec0e48545 Author: Junwei Zhang Date: Mon Jul 16 10:53:43 2018 +0800 drm/scheduler: add NULL pointer check for run queue (v2) To check rq pointer before adding entity into it. That avoids NULL pointer access in some case. v2: move the check to caller Suggested-by: Christian König Signed-off-by: Junwei Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1222d15a01c7a3a76a5988df341998a647ff462c Author: Jiri Pirko Date: Sun Jul 15 10:45:42 2018 +0300 mlxsw: spectrum: Expose counters for various packet sizes Expose counters ASIC has in the group of RFC 2819 counters that count number of packets within specific size range. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ac13d6d8eaded15c67265eafc32f439ea3a0ac4a Author: Rick Farrington Date: Fri Jul 13 12:50:21 2018 -0700 liquidio: fix hang when re-binding VF host drv after running DPDK VF driver When configuring SLI_PKTn_OUTPUT_CONTROL, VF driver was assuming that IPTR mode was disabled by reset, which was not true. Since DPDK driver had set IPTR mode previously, the VF driver (which uses buf-ptr-only mode) was not properly handling DROQ packets (i.e. it saw zero-length packets). This represented an invalid hardware configuration which the driver could not handle. Signed-off-by: Rick Farrington Signed-off-by: Felix Manlunas Signed-off-by: David S. Miller commit 7e2bc7fb65d544bb8598a0ab64e40ee9c60ded6e Author: Alexander Sverdlin Date: Fri Jul 13 17:04:28 2018 +0200 net: cavium: Drop dependency of NET_VENDOR_CAVIUM on PCI Octeon Ethernet drivers work perfectly without PCI. Signed-off-by: Alexander Sverdlin Signed-off-by: David S. Miller commit 495083807f2007af7a29ea72768866f747021a98 Author: Antoine Tenart Date: Fri Jul 13 16:57:57 2018 +0200 net: mscc: simplify retrieving the tag type from the frame header The tag type in the frame extraction header is only a bit wide. There's no need to use GENMASK when retrieving the information. This patch simplify the code by dropping GENMASK and using BIT instead. Signed-off-by: Antoine Tenart Reviewed-by: Alexandre Belloni Signed-off-by: David S. Miller commit bc1b50309ce19bb2ccb1340fa83ab56ca6da8f96 Author: Ganesh Goudar Date: Fri Jul 13 17:56:55 2018 +0530 cxgb4: do not return DUPLEX_UNKNOWN when link is down We were returning DUPLEX_UNKNOWN in get_link_ksettings() when the link was down. Unfortunately, this causes a problem when "ethtool -s autoneg on" is issued for a link which is down because the ethtool code first reads the settings and then reapplies them with only the changes provided on the command line. Which results in us diving into set_link_ksettings() with DUPLEX_UNKNOWN which is not DUPLEX_FULL, so set_link_ksettings() throws an -EINVAL error. do not return DUPLEX_UNKNOWN to fix the issue. Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit d9f37d01e294e5338aa3e9d3b2eda61b59b619df Author: Li RongQing Date: Fri Jul 13 14:41:36 2018 +0800 net: convert gro_count to bitmask gro_hash size is 192 bytes, and uses 3 cache lines, if there is few flows, gro_hash may be not fully used, so it is unnecessary to iterate all gro_hash in napi_gro_flush(), to occupy unnecessary cacheline. convert gro_count to a bitmask, and rename it as gro_bitmask, each bit represents a element of gro_hash, only flush a gro_hash element if the related bit is set, to speed up napi_gro_flush(). and update gro_bitmask only if it will be changed, to reduce cache update Suggested-by: Eric Dumazet Signed-off-by: Li RongQing Cc: Stefano Brivio Signed-off-by: David S. Miller commit 48559af3454c262543fe28d4730a92234f887881 Author: YueHaibing Date: Fri Jul 13 11:02:04 2018 +0800 bnxt_en: remove redundant debug register dma mem allocation hwrm_dbg_resp_addr and hwrm_dbg_resp_dma_addr are never used and can be removed. Signed-off-by: YueHaibing Acked-by: Michael Chan Signed-off-by: David S. Miller commit 6e85d7a8bc6543fcf81b1b2af0901e5f3332d113 Author: Helge Deller Date: Thu Jul 12 22:36:29 2018 +0200 liquidio: Use %pad printk format for dma_addr_t values Use the existing %pad printk format to print dma_addr_t values. This avoids the following warnings when compiling on the parisc platform: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'dma_addr_t {aka unsigned int}' [-Wformat=] Signed-off-by: Helge Deller Acked-by: Felix Manlunas Signed-off-by: David S. Miller commit 04ecac8c12cdab87c44a98f0679079dd13d95a78 Author: Heiner Kallweit Date: Thu Jul 12 21:45:08 2018 +0200 net: phy: realtek: add missing entry for RTL8211C to mdio_device_id table Add missing entry for RTL8211C to mdio_device_id table. Signed-off-by: Heiner Kallweit Fixes: cf87915cb9f8 ("net: phy: realtek: add support for RTL8211C") Signed-off-by: David S. Miller commit ae85467cccba9b255bd91b583effb17a5b57a12f Author: Gustavo A. R. Silva Date: Thu Jul 12 14:43:20 2018 -0500 net: usb: hso: use swap macro in hso_kick_transmit Make use of the swap macro and remove unnecessary variable *temp*. This makes the code easier to read and maintain. Also, slightly refactor some code due to the removal of *temp*. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 2a6deb6a572e7b1c34ac8ab662346124c3c4d046 Merge: 7f657d5bf507 2b9672ddb6f3 Author: David S. Miller Date: Mon Jul 16 13:34:47 2018 -0700 Merge branch 'phy-helpers' Heiner Kallweit says: ==================== net: phy: add functionality to speed down PHY when waiting for WoL packet Some network drivers include functionality to speed down the PHY when suspending and just waiting for a WoL packet because this saves energy. This patch is based on our recent discussion about factoring out this functionality to phylib. First user will be the r8169 driver. v2: - add warning comment to phy_speed_down regarding usage of sync = false - remove sync parameter from phy_speed_up ==================== Signed-off-by: David S. Miller commit 2b9672ddb6f347467d7b33b86c5dfc4d5c0501a8 Author: Heiner Kallweit Date: Thu Jul 12 21:32:53 2018 +0200 net: phy: add phy_speed_down and phy_speed_up Some network drivers include functionality to speed down the PHY when suspending and just waiting for a WoL packet because this saves energy. This functionality is quite generic, therefore let's factor it out to phylib. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 762995807059dec20c926617415e0cdd52fd44e9 Author: Heiner Kallweit Date: Thu Jul 12 21:31:54 2018 +0200 net: phy: add helper phy_config_aneg This functionality will also be needed in subsequent patches of this series, therefore factor it out to a helper. Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 7f657d5bf507be0f059405306e860c4b3e40854b Author: Dave Watson Date: Thu Jul 12 10:59:20 2018 -0700 selftests: tls: add selftests for TLS sockets Add selftests for tls socket. Tests various iov and message options, poll blocking and nonblocking behavior, partial message sends / receives, and control message data. Tests should pass regardless of if TLS is enabled in the kernel or not, and print a warning message if not. Signed-off-by: Dave Watson Signed-off-by: David S. Miller commit 964d0fbf6301d3dc8dfad19ffab5a06d002d27f1 Author: Andrey Grodzovsky Date: Fri Jul 6 14:16:54 2018 -0400 drm/amdgpu: Allow to create BO lists in CS ioctl v3 This change is to support MESA performace optimization. Modify CS IOCTL to allow its input as command buffer and an array of buffer handles to create a temporay bo list and then destroy it when IOCTL completes. This saves on calling for BO_LIST create and destry IOCTLs in MESA and by this improves performance. v2: Avoid inserting the temp list into idr struct. v3: Remove idr alloation from amdgpu_bo_list_create. Remove useless argument from amdgpu_cs_parser_fini Minor cosmetic stuff. v4: Revert amdgpu_bo_list_destroy back to static Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher commit 8415afbd86ddd8a268a8450286bc58b2bb3b83d1 Author: Eric Huang Date: Fri Jul 13 15:05:10 2018 -0400 Revert "drm/amd/powerplay: fix performance drop on Vega10" This reverts commit b87079ec7b4d38efee015367315958ce5495ba93. SMU FW team ask to remove this version specific code. Signed-off-by: Eric Huang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 4f0496d8ffa3ed5956a2ddee5d84f0246977799d Author: Mimi Zohar Date: Fri Jul 13 14:06:03 2018 -0400 ima: based on policy warn about loading firmware (pre-allocated buffer) Some systems are memory constrained but they need to load very large firmwares. The firmware subsystem allows drivers to request this firmware be loaded from the filesystem, but this requires that the entire firmware be loaded into kernel memory first before it's provided to the driver. This can lead to a situation where we map the firmware twice, once to load the firmware into kernel memory and once to copy the firmware into the final resting place. To resolve this problem, commit a098ecd2fa7d ("firmware: support loading into a pre-allocated buffer") introduced request_firmware_into_buf() API that allows drivers to request firmware be loaded directly into a pre-allocated buffer. Do devices using pre-allocated memory run the risk of the firmware being accessible to the device prior to the completion of IMA's signature verification any more than when using two buffers? (Refer to mailing list discussion[1]). Only on systems with an IOMMU can the access be prevented. As long as the signature verification completes prior to the DMA map is performed, the device can not access the buffer. This implies that the same buffer can not be re-used. Can we ensure the buffer has not been DMA mapped before using the pre-allocated buffer? [1] https://lkml.org/lkml/2018/7/10/56 Signed-off-by: Mimi Zohar Cc: Luis R. Rodriguez Cc: Stephen Boyd Cc: Bjorn Andersson Cc: Ard Biesheuvel Reviewed-by: Kees Cook Signed-off-by: James Morris commit c77b8cdf745d91eca138e7bfa430dc6640b604a0 Author: Mimi Zohar Date: Fri Jul 13 14:06:02 2018 -0400 module: replace the existing LSM hook in init_module Both the init_module and finit_module syscalls call either directly or indirectly the security_kernel_read_file LSM hook. This patch replaces the direct call in init_module with a call to the new security_kernel_load_data hook and makes the corresponding changes in SELinux, LoadPin, and IMA. Signed-off-by: Mimi Zohar Cc: Jeff Vander Stoep Cc: Casey Schaufler Cc: Kees Cook Acked-by: Jessica Yu Acked-by: Paul Moore Acked-by: Kees Cook Signed-off-by: James Morris commit ef96837b0de4af47732e2a8ebf5c18e8a885ded6 Author: Mimi Zohar Date: Fri Jul 13 14:06:01 2018 -0400 ima: add build time policy IMA by default does not measure, appraise or audit files, but can be enabled at runtime by specifying a builtin policy on the boot command line or by loading a custom policy. This patch defines a build time policy, which verifies kernel modules, firmware, kexec image, and/or the IMA policy signatures. This build time policy is automatically enabled at runtime and persists after loading a custom policy. Signed-off-by: Mimi Zohar Reviewed-by: Kees Cook Signed-off-by: James Morris commit fed2512a7ccc8fc4b8e1de22925d127e4caac300 Author: Mimi Zohar Date: Fri Jul 13 14:06:00 2018 -0400 ima: based on policy require signed firmware (sysfs fallback) With an IMA policy requiring signed firmware, this patch prevents the sysfs fallback method of loading firmware. Signed-off-by: Mimi Zohar Reviewed-by: Kees Cook Cc: Luis R. Rodriguez Cc: Matthew Garrett Signed-off-by: James Morris commit 6e852651f28eee851069c7d40989281fae4bf9d2 Author: Mimi Zohar Date: Fri Jul 13 14:05:59 2018 -0400 firmware: add call to LSM hook before firmware sysfs fallback Add an LSM hook prior to allowing firmware sysfs fallback loading. Signed-off-by: Mimi Zohar Acked-by: Luis R. Rodriguez Reviewed-by: Kees Cook Signed-off-by: James Morris commit 16c267aac86b463b1fcccd43c89f4c8e5c5c86fa Author: Mimi Zohar Date: Fri Jul 13 14:05:58 2018 -0400 ima: based on policy require signed kexec kernel images The original kexec_load syscall can not verify file signatures, nor can the kexec image be measured. Based on policy, deny the kexec_load syscall. Signed-off-by: Mimi Zohar Cc: Eric Biederman Cc: Kees Cook Reviewed-by: Kees Cook Signed-off-by: James Morris commit a210fd32a46bae6d05b43860fe3b47732501d63b Author: Mimi Zohar Date: Fri Jul 13 14:05:57 2018 -0400 kexec: add call to LSM hook in original kexec_load syscall In order for LSMs and IMA-appraisal to differentiate between kexec_load and kexec_file_load syscalls, both the original and new syscalls must call an LSM hook. This patch adds a call to security_kernel_load_data() in the original kexec_load syscall. Signed-off-by: Mimi Zohar Cc: Eric Biederman Cc: Kees Cook Acked-by: Serge Hallyn Acked-by: Kees Cook Signed-off-by: James Morris commit 377179cd28cd417dcfb4396edb824533431e607e Author: Mimi Zohar Date: Fri Jul 13 14:05:56 2018 -0400 security: define new LSM hook named security_kernel_load_data Differentiate between the kernel reading a file specified by userspace from the kernel loading a buffer containing data provided by userspace. This patch defines a new LSM hook named security_kernel_load_data(). Signed-off-by: Mimi Zohar Cc: Eric Biederman Cc: Luis R. Rodriguez Cc: Kees Cook Cc: Casey Schaufler Acked-by: Serge Hallyn Acked-by: Kees Cook Signed-off-by: James Morris commit eb5f43d45b3b3c239b9ca0fde6eee11244a57346 Author: Chris Wilson Date: Mon Jul 16 14:40:09 2018 +0100 drm/i915/selftests: Exercise reset to break stuck GTT eviction We must be able to reset the GPU while we are waiting on it to perform an eviction (unbinding an active vma). So attach a spinning request to a target vma and try and it evict it from a thread to see if that blocks indefinitely. v2: Add a wait for the thread to start just in case that takes more than 10ms... v3: complete() not completion_done() to signal the completion. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180716134009.13143-1-chris@chris-wilson.co.uk commit 568a74d491124c720e604ed3265722f969a5fb38 Merge: 35edb56e94b9 2880984970dd Author: David S. Miller Date: Mon Jul 16 11:23:54 2018 -0700 Merge branch 'docs-Fix-failover-build-warnings' Tobin C. Harding says: ==================== docs: Fix failover build warnings This is my first patch set to net-next. Please shout loud and clear if I've botched anything. Recently failover and net_failover modules were added to the mainline. Documentation was included in rst format but they were not added to the toctree in `networking/index.rst`. Also building docs for net_failover is currently emitting a few warnings. Patch 1 adds failover and net_failover to the index toctree Patch 2 fixes the build warnings for net_failover I haven't been super active on netdev list so if there is some reason I missed why these files are not in the index please do say so. Has there been any discussion on preferred order for the toctree index list? I just added them to the bottom of the list. ==================== Signed-off-by: David S. Miller commit 2880984970ddf3f3a4600f1725621792352b8627 Author: Tobin C. Harding Date: Thu Jul 12 07:42:50 2018 +1000 docs: networking: Fix failover build warnings Currently building the net_failover docs causes a bunch of warnings to be emitted. These warnings are all related to indentation and correctly highlight missing '::' (for code sections). It looks, from other rst files in Documentation, that the first column should be indented 2 spaces. Add '::' before code snippets and indent all snippets uniformly starting with 2 spaces. Cc: Jonathan Corbet Signed-off-by: Tobin C. Harding Signed-off-by: David S. Miller commit d95768d3cccd0bfb258f04e0fa21768332b153a0 Author: Tobin C. Harding Date: Thu Jul 12 07:42:49 2018 +1000 docs: networking: Add failover docs to index Currently we have rst format docs for the failover and net_failover modules however these docs are not linked to within the index. Add `failover` and `net_failover` to the networking documentation index. Signed-off-by: Tobin C. Harding Signed-off-by: David S. Miller commit 35edb56e94b9e122e4324ff10756100e8e7844b2 Merge: aea06eb276d9 5550aa4d4771 Author: David S. Miller Date: Mon Jul 16 11:16:45 2018 -0700 Merge branch 'hns3-next' Salil Mehta says: ==================== Bug fixes and some minor changes to HNS3 driver This patch-set presents some fixes and minor changes to the HNS3 Ethernet Driver. ==================== Signed-off-by: David S. Miller commit 5550aa4d4771f61f5119b45e8de7dd6f66060817 Author: Fuyun Liang Date: Mon Jul 16 16:36:27 2018 +0100 net: hns3: Fix comments for hclge_get_ring_chain_from_mbx Actually, hclge_get_ring_chain_from_mbx is used to get ring type, tqp id, and int_gl index from mailbox message. So the comments is incorrect. This patch fixes it. Fixes: dde1a86e93ca ("net: hns3: Add mailbox support to PF driver") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit cf4103c699c2b3dd88bea169f47ad75d872b4a80 Author: Fuyun Liang Date: Mon Jul 16 16:36:26 2018 +0100 net: hns3: Fix for using wrong mask and shift in hclge_get_ring_chain_from_mbx HCLGE_INT_GL_IDX_M and HCLGE_INT_GL_IDX_S are used to set fireware cmd. When getting int_gl value from mailbox message, we should use HNAE3_RING_GL_IDX_M and HNAE3_RING_GL_IDX_S. Fixes: 79eee4108541 ("net: hns3: add int_gl_idx setup for VF") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 82b5321460005ac5d34996e17f5a51a4004a1e14 Author: Yunsheng Lin Date: Mon Jul 16 16:36:25 2018 +0100 net: hns3: Fix for reset_level default assignment probelm handle->reset_level is assigned to HNAE3_NONE_RESET when client is initialized, if a tx timeout happens right after initialization, then handle->reset_level is not resetted to HNAE3_FUNC_RESET in hclge_reset_event, which will cause reset event not properly handled problem. This patch fixes it by setting handle->reset_level properly when client is initialized. Fixes: 6d4c3981a8d8 ("net: hns3: Changes to make enet watchdog timeout func common for PF/VF") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit d62eccaed41db5d231c597e1b019b13d7c760d6e Author: Huazhong Tan Date: Mon Jul 16 16:36:24 2018 +0100 net: hns3: remove unnecessary ring configuration operation while resetting The configuration of the ring will be used to reinitialize the ring after the hardware reset is completed. So we should not release and reacquire this configuration during reset. Fixes: bb6b94a896d4 ("net: hns3: Add reset interface implementation in client") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 6b1385cc251ae9f26b720fa5c8c00bf19af336ae Author: Huazhong Tan Date: Mon Jul 16 16:36:23 2018 +0100 net: hns3: Fix return value error in hns3_reset_notify_down_enet When doing reset, netdev has not been brought up is not an error, it means that we do not need do the stop operation, so just return zero. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 9ca8d1a73c373c0f54e7ab6eaa37aea8de28cd3a Author: Huazhong Tan Date: Mon Jul 16 16:36:22 2018 +0100 net: hns3: Correct reset event status register According to hardware's description, driver should get reset event from VECTOR0_PF_OTHER_INT_ST(0x20800) instead of VECTOR0_PF_OTHER_INT_SRC(0x20700). Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 9de0b86f64444e5bddc0c4687e23c36ab52d1fcf Author: Huazhong Tan Date: Mon Jul 16 16:36:21 2018 +0100 net: hns3: Prevent to request reset frequently Netdevice reset should not be requested frequently, a new one must wait a moment since there may be some work not completed. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 6d4fab39533f1bcd933d82d1667ceea93e4de260 Author: Huazhong Tan Date: Mon Jul 16 16:36:20 2018 +0100 net: hns3: Reset net device with rtnl_lock Since current locking was not covering certain code where netdev was being accessed or manipulated, this patch fixes it. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 1b3725781a07f754d1b81065926495c79c2183e6 Author: Huazhong Tan Date: Mon Jul 16 16:36:19 2018 +0100 net: hns3: Modify the order of initializing command queue register According to hardware's description, the head pointer register should be written before the tail pointer register while doing command queue initialization. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 9c7e47025a6b9a2800eec127996ad58946e0cad4 Author: Taniya Das Date: Wed May 9 11:26:07 2018 +0530 clk: qcom: clk-rpmh: Add QCOM RPMh clock driver Add the RPMh clock driver to control the RPMh managed clock resources on some of the Qualcomm Technologies, Inc. SoCs. Signed-off-by: Taniya Das [sboyd@kernel.org: Clean up whitespace, indentation, remove cmd_db_ready check] Signed-off-by: Stephen Boyd commit 4f45c778352eff878757a21566d87fbbedd104fc Author: Lyude Paul Date: Mon Jul 16 13:17:11 2018 -0400 drm/connector: Fix typo in drm_connector_list_iter_next() Signed-off-by: Lyude Paul Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180716171711.413-1-lyude@redhat.com commit d3a537e9a77425c6a33954f6add69646808bf453 Author: Heiko Stuebner Date: Mon Jul 16 18:52:44 2018 +0200 arm64: dts: rockchip: drop out-of-tree properties from rk3399-ficus regulator The pwm-regulator for vdd_log uses additional unreviewed properties in the vendor kernel, which slipped in with the devicetree. As written, they are unreviewed and unused in all mainline implementations so drop them again. Signed-off-by: Heiko Stuebner commit 34e05c2ee5e27964bfd19b0e8d1e41dbe2256c9e Author: Enric Balletbo i Serra Date: Sat Jul 14 14:09:22 2018 -0300 arm64: dts: rockchip: add voltage properties for vcc3v3_pcie on rk3399 ficus The vcc3v3_pcie regulator supplies 3.3V so add voltage properties for it. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Ezequiel Garcia [split off from original patch] Signed-off-by: Heiko Stuebner commit 65abc845873a6a1b8923686e7e014167ac962c64 Author: Enric Balletbo i Serra Date: Sat Jul 14 14:09:22 2018 -0300 arm64: dts: rockchip: add USB 2.0 and 3.0 support on Ficus board The board exposes two types A ports, one is USB 3.0, up to 5.0Gbps and another one is USB 2.0 up to 480Mbps. Enable the USB PHYs and the USB controllers to enable theses devices. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Ezequiel Garcia Signed-off-by: Heiko Stuebner commit 59f20f5a0c9767a8b66688b84e72a345b4dc1bc1 Author: Alex Deucher Date: Thu Jul 12 14:59:22 2018 -0500 drm/amdgpu/pp: switch smu callback type for get_argument() return a uint32_t rather than an int to properly reflect what the function does. Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit ce7577a2194b58bf7faf303612a24b7cd5210afc Author: Alex Deucher Date: Thu Jul 12 14:47:30 2018 -0500 drm/amdgpu/pp: split out common smumgr smu9 code Split out the shared smumgr code for vega10 and 12 so we don't have duplicate code for both. Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 26094c02934e9aceee8f7386a8e28190262a69d3 Author: Alex Deucher Date: Wed Jul 11 17:30:25 2018 -0500 drm/amdgpu/pp: remove dead vega12 code Commented out. Reviewed-by: Rex Zhu Acked-by: Christian König Signed-off-by: Alex Deucher commit d396cb185c0337aae5664b250cdd9a73f6eb1503 Author: Nicholas Mc Guire Date: Thu Jul 12 11:28:24 2018 +0200 ARM: hisi: handle of_iomap and fix missing of_node_put Relying on an unchecked of_iomap() which can return NULL is problematic here, an explicit check seems mandatory. Also the call to of_find_compatible_node() returns a device node with refcount incremented therefor an explicit of_node_put() is needed here. Signed-off-by: Nicholas Mc Guire Fixes: commit 22bae4290457 ("ARM: hi3xxx: add hotplug support") Signed-off-by: Wei Xu commit 81646a3d39ef14749301374a3a0b8311384cd412 Author: Nicholas Mc Guire Date: Thu Jul 12 11:28:23 2018 +0200 ARM: hisi: check of_iomap and fix missing of_node_put of_find_compatible_node() returns a device node with refcount incremented and thus needs an explicit of_node_put(). Further relying on an unchecked of_iomap() which can return NULL is problematic here, after all ctrl_base is critical enough for hix5hd2_set_cpu() to call BUG() if not available so a check seems mandated here. Signed-off-by: Nicholas Mc Guire 0002 Fixes: commit 06cc5c1d4d73 ("ARM: hisi: enable hix5hd2 SoC") Signed-off-by: Wei Xu commit 9f30b5ae0585ca5234fe979294b8f897299dec99 Author: Nicholas Mc Guire Date: Thu Jul 12 11:28:22 2018 +0200 ARM: hisi: fix error handling and missing of_node_put of_iomap() can return NULL which seems critical here and thus should be explicitly flagged so that the cause of system halting can be understood. As of_find_compatible_node() is returning a device node with refcount incremented it must be explicitly decremented here. Signed-off-by: Nicholas Mc Guire Fixes: commit 7fda91e73155 ("ARM: hisi: enable smp for HiP01") Signed-off-by: Wei Xu commit 3a6372daddebbc34ef8dd51771da8f08f060b19d Author: Anthony Brandon Date: Mon Jul 9 19:46:45 2018 +0200 dt-bindings: sound: wm8994: document wlf,csnaddr-pd property Add the wlf,csnaddr-pd property to allow the CS/Addr pull-down to be controlled from the device tree. Signed-off-by: Anthony Brandon Acked-by: Charles Keepax Reviewed-by: Rob Herring Signed-off-by: Rob Herring commit 2d4bc57348e157dbb0a76f37a398ab32f60c2586 Author: Anthony Brandon Date: Mon Jul 9 19:46:43 2018 +0200 dt-bindings: sound: wm8994: document wlf,spkmode-pu property Add the wlf,spkmode-pu property to control the Speaker Mode pull-up from the device tree. Signed-off-by: Anthony Brandon Acked-by: Charles Keepax Acked-by: Charles Keepax Acked-by: Charles Keepax Reviewed-by: Rob Herring Signed-off-by: Rob Herring commit 0f6b79fa138d781b978bcff22680662fd351cd2d Author: Chris Wilson Date: Mon Jul 16 14:21:54 2018 +0100 drm/i915/selftests: Force a preemption hang Inject a failure into preemption completion to pretend as if the HW didn't successfully handle preemption and we are forced to do a reset in the middle. v2: Wait for preemption, to force testing with the missed preemption. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180716132154.12539-1-chris@chris-wilson.co.uk commit 0051163ab3d8090a08ea2ea5edbb738c0920000a Author: Chris Wilson Date: Mon Jul 16 13:54:24 2018 +0100 drm/i915/execlists: Always clear preempt status on cancelling all On reset/wedging, we cancel all pending replies from the HW and we also want to cancel an outstanding preemption event. Since we use the same function to cancel the pending replies for reset and for a preemption event, we can simply clear the active tracking for all. v2: Keep execlists_user_end() markup for wedging v3: Move assignment to inline to hide the bare assignment. Fixes: 60a943245413 ("drm/i915/execlists: Drop clear_gtiir() on GPU reset") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180716125424.5715-1-chris@chris-wilson.co.uk commit 71e9690b59e7349156025a514c29c29ef55b0175 Author: Josef Bacik Date: Mon Jul 16 12:12:23 2018 -0400 blk-iolatency: truncate our current time In our longer tests we noticed that some boxes would degrade to the point of uselessness. This is because we truncate the current time when saving it in our bio, but I was using the raw current time to subtract from. So once the box had been up a certain amount of time it would appear as if our IO's were taking several years to complete. Fix this by truncating the current time so it matches the issue time. Verified this worked by running with this patch for a week on our test tier. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit d607eefa3b55c7b8cd9902e9209fc1235f88ccd9 Author: Josef Bacik Date: Mon Jul 16 12:12:22 2018 -0400 blk-iolatency: don't change the latency window Early versions of these patches had us waiting for seconds at a time during submission, so we had to adjust the timing window we monitored for latency. Now we don't do things like that so this is unnecessary code. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 21279157efffe5e7258483809942d576cb802768 Author: Jiang Biao Date: Mon Jul 16 12:03:38 2018 +0800 x86/pti: Make pti_set_kernel_image_nonglobal() static pti_set_kernel_image_nonglobal() is only used in pti.c, make it static. Signed-off-by: Jiang Biao Signed-off-by: Thomas Gleixner Acked-by: Dave Hansen Cc: luto@kernel.org Cc: hpa@zytor.com Cc: albcamus@gmail.com Cc: zhong.weidong@zte.com.cn Link: https://lkml.kernel.org/r/1531713820-24544-4-git-send-email-jiang.biao2@zte.com.cn commit c779e849608a875448f6ffc2a5c2a15523bdcd00 Author: Florian Westphal Date: Fri Jun 29 07:46:50 2018 +0200 netfilter: conntrack: remove get_timeout() indirection Not needed, we can have the l4trackers fetch it themselvs. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 97e08caec33a0923385b1215c3386c9ee1d07982 Author: Florian Westphal Date: Fri Jun 29 07:46:49 2018 +0200 netfilter: conntrack: avoid l4proto pkt_to_tuple calls Handle common protocols (udp, tcp, ..), in the core and only do the call if needed by the l4proto tracker. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 8b3892ea8718920d29432328fe9544d89a429614 Author: Florian Westphal Date: Fri Jun 29 07:46:48 2018 +0200 netfilter: conntrack: avoid calls to l4proto invert_tuple Handle the common cases (tcp, udp, etc). in the core and only do the indirect call for the protocols that need it (GRE for instance). Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6816d931cab009024b68c11c4cf752f8bf9a1e32 Author: Florian Westphal Date: Fri Jun 29 07:46:47 2018 +0200 netfilter: conntrack: remove get_l4proto indirection from l3 protocol trackers Handle it in the core instead. ipv6_skip_exthdr() is built-in even if ipv6 is a module, i.e. this doesn't create an ipv6 dependency. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d1b6fe94941f43e4743d5fea953d16b0a001c2c6 Author: Florian Westphal Date: Fri Jun 29 07:46:46 2018 +0200 netfilter: conntrack: remove invert_tuple indirection from l3 protocol trackers Its simpler to just handle it directly in nf_ct_invert_tuple(). Also gets rid of need to pass l3proto pointer to resolve_conntrack(). Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 47a91b14de62e35d1466820cbb4c024b6c02dff1 Author: Florian Westphal Date: Fri Jun 29 07:46:45 2018 +0200 netfilter: conntrack: remove pkt_to_tuple indirection from l3 protocol trackers Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit f957be9d349a3800940f823b16e12b0405cc305b Author: Florian Westphal Date: Fri Jun 29 07:46:44 2018 +0200 netfilter: conntrack: remove ctnetlink callbacks from l3 protocol trackers handle everything from ctnetlink directly. After all these years we still only support ipv4 and ipv6, so it seems reasonable to remove l3 protocol tracker support and instead handle ipv4/ipv6 from a common, always builtin inet tracker. Step 1: Get rid of all the l3proto->func() calls. Start with ctnetlink, then move on to packet-path ones. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7414d929bc35b9a7c3eab98ef7bd32d5ae4c2981 Author: Máté Eckl Date: Thu Jun 28 20:01:02 2018 +0200 netfilter: Kconfig: Make NETFILTER_XT_MATCH_SOCKET select NF_SOCKET_IPV4/6 Instead of depending on it. Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit 60e3be94e6a1c5162a0763c9aafb5190b2b1fdce Author: Florian Westphal Date: Mon Jun 25 17:55:32 2018 +0200 openvswitch: use nf_ct_get_tuplepr, invert_tuplepr These versions deal with the l3proto/l4proto details internally. It removes only caller of nf_ct_get_tuple, so make it static. After this, l3proto->get_l4proto() can be removed in a followup patch. Signed-off-by: Florian Westphal Acked-by: Pravin B Shelar Signed-off-by: Pablo Neira Ayuso commit ebee5a50d0b7cdc576aa8081f05b86971880054d Author: Florian Westphal Date: Mon Jun 25 17:49:59 2018 +0200 netfilter: utils: move nf_ip6_checksum* from ipv6 to utils similar to previous change, this also allows to remove it from nf_ipv6_ops and avoid the indirection. It also removes the bogus dependency of nf_conntrack_ipv6 on ipv6 module: ipv6 checksum functions are built into kernel even if CONFIG_IPV6=m, but ipv6/netfilter.o isn't. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d7e5a9a50245b91f016c814b0f076f7e55cbb980 Author: Florian Westphal Date: Mon Jun 25 17:49:43 2018 +0200 netfilter: utils: move nf_ip_checksum* from ipv4 to utils allows to make nf_ip_checksum_partial static, it no longer has an external caller. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit f286586df68e7733a8e651098401f139dc2e17f4 Author: Máté Eckl Date: Mon Jun 18 15:12:52 2018 +0200 netfilter: nft_tproxy: Move nf_tproxy_assign_sock() to nf_tproxy.h This function is also necessary to implement nft tproxy support Fixes: 45ca4e0cf273 ("netfilter: Libify xt_TPROXY") Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso commit e97d9404d5e8aea1f91f4c00dbe7854008f3a1e1 Author: Florian Westphal Date: Fri Jun 15 23:46:42 2018 +0200 netfilter: flowtables: use fixed renew timeout on teardown This is one of the very few external callers of ->get_timeouts(), We can use a fixed timeout instead, conntrack core will refresh this in case a new packet comes within this period. Use of ESTABLISHED timeout seems way too huge anyway. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6542df2f8412a8a065e987aac940130884028715 Author: Taehee Yoo Date: Tue Jun 12 01:54:47 2018 +0900 netfilter: nft_reject_bridge: remove unnecessary ttl set In the nft_reject_br_send_v4_tcp_reset(), a ttl is set by the nf_reject_iphdr_put(). so, below code is unnecessary. Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit 1d98a69e5cef3aeb68bcefab0e67e342d6bb4dad Author: Kamalesh Babulal Date: Thu Jul 12 13:35:06 2018 +0530 livepatch: Remove reliable stacktrace check in klp_try_switch_task() Support for immediate flag was removed by commit d0807da78e11 ("livepatch: Remove immediate feature"). We bail out during patch registration for architectures, those don't support reliable stack trace. Remove the check in klp_try_switch_task(), as its not required. Signed-off-by: Kamalesh Babulal Reviewed-by: Petr Mladek Acked-by: Miroslav Benes Acked-by: Josh Poimboeuf Signed-off-by: Jiri Kosina commit a18b21929453af70390e14f8dee40acf00d428cb Author: Lyude Paul Date: Mon Jul 16 11:44:32 2018 -0400 drm/dp_helper: Add DP aux channel tracing This is something we've needed for a very long time now, as it makes debugging issues with faulty MST hubs along with debugging issues regarding us interfacing with hubs correctly vastly easier to debug. Currently this can actually be done if you trace the i2c devices for DP using ftrace but that's significantly less useful for a couple of reasons: - Tracing the i2c devices through ftrace means all of the traces are going to contain a lot of "garbage" output that we're sending over the i2c line. Most of this garbage comes from retrying transactions, DRM's helper library adding extra transactions to work around bad hubs, etc. - Having a user set up ftrace so that they can provide debugging information is a lot more difficult then being able to say "just boot with drm.debug=0x100" - We can potentially expand upon this tracing in the future to print debugging information in regards to other DP transactions like MST sideband transactions This is inspired by a patch Rob Clark sent to do this a long time back. Neither of us could find the patch however, so we both assumed it would probably just be easier to rewrite it anyway. Cc: Rob Clark Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180716154432.13433-1-lyude@redhat.com commit 71a5cb3eb758b5b3735709c7fca577522eda43d4 Author: Alexandru Gheorghe Date: Fri Jul 13 16:10:58 2018 +0100 drm: writeback: Fix doc that says connector should be disconnected During iteration process one of the proposed mechanism for not breaking existing userspace was to report writeback connectors as disconnected, however the final version used DRM_CLIENT_CAP_WRITEBACK_CONNECTORS for that purpose. Change-Id: I2319d099f7669094c8530f1521abdbca08e76486 Signed-off-by: Alexandru Gheorghe Reviewed-by: Sean Paul Acked-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/238399/ commit 63747bf73cf329d4bce9087067042241c5330a4a Author: Christian Borntraeger Date: Mon Jul 16 10:34:28 2018 +0200 KVM: s390/vsie: avoid sparse warning This is a non-functional change that avoids arch/s390/kvm/vsie.c:839:25: warning: context imbalance in 'do_vsie_run' - unexpected unlock Signed-off-by: Christian Borntraeger Reviewed-by: David Hildenbrand Signed-off-by: Christian Borntraeger commit 4e3c5d7e05be6c9c6de4f4da9116511428924997 Author: Philipp Zabel Date: Fri Jun 1 15:13:16 2018 +0200 gpu: ipu-v3: Allow negative offsets for interlaced scanning The IPU also supports interlaced buffers that start with the bottom field. To achieve this, the the base address EBA has to be increased by a stride length and the interlace offset ILO has to be set to the negative stride. Signed-off-by: Philipp Zabel Signed-off-by: Steve Longerbeam commit 1e6a1495c66947b289de9ba92b569b62ce68a979 Author: Jan Luebbe Date: Thu May 3 18:29:37 2018 +0200 gpu: ipu-v3: csi: support RGB565 on parallel bus The CSI_SENS_CONF_DATA_FMT_RGB565 configuration only works for MIPI CSI-2 sources. On the parallel bus, we need to use bayer (generic) mode instead. To handle this difference, we pass the mbus_type to mbus_code_to_bus_cfg(). Signed-off-by: Jan Luebbe [p.zabel@pengutronix.de - renamed rc to ret for consistency] Signed-off-by: Philipp Zabel commit d36d0e6309dd8137cf438cbb680e72eb63c81425 Author: Enrico Scholz Date: Thu May 3 18:29:36 2018 +0200 gpu: ipu-v3: csi: pass back mbus_code_to_bus_cfg error codes mbus_code_to_bus_cfg() can fail on unknown mbus codes; pass back the error to the caller. Signed-off-by: Enrico Scholz Signed-off-by: Jan Luebbe [p.zabel@pengutronix.de - renamed rc to ret for consistency] Signed-off-by: Philipp Zabel commit 7cc3bf3f08b5645d1d08439fea36e4148dc6d7d3 Author: Michael Grzeschik Date: Wed May 2 14:52:26 2018 +0200 gpu: ipu-csi: add rgb/bgr888 24bit support to mbus_code_to_bus_cfg The 24bit RGB format configuration is currently missing, we add it now. Signed-off-by: Michael Grzeschik Signed-off-by: Philipp Zabel commit 3cdba8018fd54a418480ded9c14df5436a5b743d Author: Leonard Crestez Date: Wed Mar 28 00:39:47 2018 +0300 drm/imx: Remove last traces of struct imx_drm_crtc When the definition of this struct was removed a forward declaration and an unused struct member were still left around. Remove them because they serve no purpose. Fixes 44b460cfe554 ("drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs") Signed-off-by: Leonard Crestez Reviewed-by: Fabio Estevam Signed-off-by: Philipp Zabel commit 7f43ef9f0d98abbc0eb5e697628ec06756bf60a9 Author: Michel Dänzer Date: Wed Jul 4 17:14:05 2018 +0200 dma-buf: Move BUG_ON from _add_shared_fence to _add_shared_inplace Fixes the BUG_ON spuriously triggering under the following circumstances: * reservation_object_reserve_shared is called with shared_count == shared_max - 1, so obj->staged is freed in preparation of an in-place update. * reservation_object_add_shared_fence is called with the first fence, after which shared_count == shared_max. * reservation_object_add_shared_fence is called with a follow-up fence from the same context. In the second reservation_object_add_shared_fence call, the BUG_ON triggers. However, nothing bad would happen in reservation_object_add_shared_inplace, since both fences are from the same context, so they only occupy a single slot. Prevent this by moving the BUG_ON to where an overflow would actually happen (e.g. if a buggy caller didn't call reservation_object_reserve_shared before). v2: * Fix description of breaking scenario (Christian König) * Add bugzilla reference Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/106418 Reviewed-by: Chris Wilson # v1 Reviewed-by: Christian König # v1 Signed-off-by: Michel Dänzer Signed-off-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/20180704151405.10357-1-michel@daenzer.net commit b6d7b3622b6e7685767a616bb663aed40d04fdc6 Author: Jim Qu Date: Mon Jul 16 14:06:34 2018 +0800 ALSA: hda: use PCI_BASE_CLASS_DISPLAY to replace PCI_CLASS_DISPLAY_VGA Except PCI_CLASS_DISPLAY_VGA, some PCI class is sometimes PCI_CLASS_DISPLAY_3D or PCI_CLASS_DISPLAY_OTHER. Signed-off-by: Jim Qu Signed-off-by: Takashi Iwai commit 55b8cb46a71137aa19eba2ae5a4be384500db89e Author: Jorge Sanjuan Date: Wed Jul 11 13:37:55 2018 +0100 ALSA: usb-audio: Tidy up logic for Processing Unit min/max values This patch refactors the processing units min/max calculation logic for the mixer controls and fixes an issue where the Mode Select checking of the Up/Down mixers doesn't differentiate between the UAC1 and UAC2 Control Selector (0x02) and the UAC3 one which is different (0x01). Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit 8b3a087f7f6580e685a4f1ac980d07f96ad250a5 Author: Jorge Sanjuan Date: Wed Jul 11 13:37:54 2018 +0100 ALSA: usb-audio: Unify virtual type units type to UAC3 values The Audio Control interface descriptor subtypes do not match across all the UAC versions. That makes reusability of the "virtual type" (Mixer, Processors, Selectors, etc) terminals difficult. It also makes the mixer get the default names for the virtual terminals wrong due to the overlap. This patch proposes an unified approach by always using the most comprehensive spec version to define them all (in this case UAC3). Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit 0f292f023ffcc67ec49d63dcb7fe388711cbb83a Author: Jorge Sanjuan Date: Wed Jul 11 13:37:53 2018 +0100 ALSA: usb-audio: Add support for Processing Units in UAC3 This patch adds support for the Processig Units defined in the UAC3 spec. The main difference with the previous specs is the lack of on/off switches in the controls for these units and the addiction of the new Multi Function Processing Unit. The current version of the UAC3 spec doesn't define any useful controls for the new Multi Function Processing Unit so no control will get created once this unit is parsed. Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit 4e887af31cedec0d3b24521a5c3c14c3a190422b Author: Jorge Sanjuan Date: Wed Jul 11 13:37:52 2018 +0100 ALSA: usb-audio: Processing Unit controls parsing in UAC2 Current support for UAC2 Processing Units does the parsing as one control per bit in the bitmap. However, the UAC2 spec defines the controls as bit pairs where b01 means read-only and b11 means read/write control. This patch fixes that and uses the helper functions for checking controls readability/writability when the control is defined as bit pairs (UAC2 and UAC3). Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit c77e1ef1cdf74dba09edfa706fecc9fddd7bd084 Author: Jorge Sanjuan Date: Wed Jul 11 13:37:51 2018 +0100 ALSA: usb-audio: Add support for Selector Units in UAC3 This patch add support for Selector Units and Clock Selector Units defined in the new UAC3 spec. Selector Units play a really important role in the new UAC3 spec as Processing Units do not define an on/off switch control anymore. This forces topology designers to add bypass paths in the topology to enable/dissable the Processing Units. Signed-off-by: Jorge Sanjuan Signed-off-by: Takashi Iwai commit 19e023e3befb4cb64b4a81b47a92a0c687672661 Author: Agrawal, Akshu Date: Mon Jul 16 15:02:41 2018 +0800 ASoC: AMD: For capture have interrupts on I2S->ACP channel Having interrupts enabled for ACP<->SYSMEM DMA transfer, we are in for an interrupt storm. For both playback and capture interrupts should be enabled for I2S<->ACP DMA. Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit fa9d2f17c23fb3ea6b659b1bfe4ca10551a19e56 Author: Agrawal, Akshu Date: Mon Jul 16 15:02:40 2018 +0800 ASoC: AMD: Send correct channel for configuring DMA descriptors Earlier, ch1 was used to define ACP-SYSMEM transfer and ch2 for ACP-I2S transfer. With recent patches ch1 is used to define channel order number 1 and ch2 as channel order number 2. Thus, Playback: ch1:SYSMEM->ACP ch2:ACP->I2S Capture: ch1:I2S->ACP ch1:ACP->SYSMEM Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit 8452112baac67c3235d15de67fb190d29bbba98f Author: Naveen Manohar Date: Wed Jul 11 16:05:36 2018 +0530 ASoC: Intel: Boards: Add GLK Realtek Maxim I2S machine driver Patch adds Geminilake I2S machine driver which uses following codecs: RT5682 and MAX98357A. Signed-off-by: Naveen Manohar Signed-off-by: Harsha Priya Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit d30e23d69981a4b665f5ce8711335df986576389 Author: Russell King Date: Sat Jul 14 16:01:06 2018 +0100 ASoC: hdmi-codec: fix routing Commit 943fa0228252 ("ASoC: hdmi-codec: Use different name for playback streams") broke hdmi-codec's routing between it's output "TX" widget and the S/PDIF or I2S streams by renaming the streams. Whether an error occurs or not is dependent on whether there is another widget called "Playback" registered by some other component - if there is, that widget will be (incorrectly) bound to the HDMI codec's "TX" output widget. If we end up connecting "TX" incorrectly, it can result in components not being started, causing no audio output. Since the I2S and S/PDIF streams now have different names, we can't use a static route at component level to describe the relationship, so arrange to dynamically create the route when the DAI driver is probed. Fixes: 943fa0228252 ("ASoC: hdmi-codec: Use different name for playback streams") Signed-off-by: Russell King Signed-off-by: Mark Brown commit 11a20c5601c5f0c685fa3a166348b7ffa830e123 Author: Ryder Lee Date: Tue Jul 10 13:09:26 2018 +0800 dt-bindings: arm: mediatek: cleanup MT7623N reference boards Cleanup binding document to get rid of unsupported reference boards for MT7623N. Cc: John Crispin Cc: Sean Wang Signed-off-by: Ryder Lee Acked-by: John Crispin Acked-by: Sean Wang Signed-off-by: Matthias Brugger commit 345058a4c5d96a61a06c2d32a61c172da8f0d366 Author: Ryder Lee Date: Tue Jul 10 13:09:25 2018 +0800 arm: dts: mt7623: cleanup MT7623N NAND dts file Normally, we didn't release this kind of baord to user. This specific board exists only in the early stage of development inside MediaTek - and that may confuse peoples. Hence this patch removes related files accordingly. Cc: John Crispin Cc: Sean Wang Signed-off-by: Ryder Lee Acked-by: John Crispin Acked-by: Sean Wang Signed-off-by: Matthias Brugger commit 00673189b8b971c00417632ffe4c90ba9b4f2568 Author: Argus Lin Date: Mon Jun 11 18:50:00 2018 +0800 soc: mediatek: pwrap: add mt6351 driver for mt6797 SoCs MT6351 is a new power management IC and it is used for mt6797 SoCs. To define mt6351_regs for pmic register mapping and pmic_mt6351 for accessing register. Signed-off-by: Argus Lin Signed-off-by: Matthias Brugger commit 8e62ac4bad3956536fc08e351454abc90dda1e9f Author: Argus Lin Date: Mon Jun 11 18:49:59 2018 +0800 soc: mediatek: pwrap: add pwrap driver for mt6797 SoCs mt6797 is a highly integrated SoCs, it uses mt6351 for power management. This patch adds pwrap driver to access mt6351. Pwrap of mt6797 support dynamic priority meichanism, sequence monitor and starvation mechanism to make transaction more reliable. A big change from V4 to V5 is we remove INT1 interrupt declaration since it is only for debug purpose. The PWRAP_RDDMY, RESET and DCM can use legacy setting, it is backwards compatible. The new caps flag declaration is not needed, just remove it. Signed-off-by: Argus Lin Signed-off-by: Matthias Brugger commit cd760b1cd703f0846362c171ec4c49dadbd7e0eb Author: Argus Lin Date: Mon Jun 11 18:49:58 2018 +0800 soc: mediatek: pwrap: fix cipher init setting error PWRAP_DEW_CIPHER_LOAD and PWRAP_DEW_CIPHER_START only exist at PMIC_mt6397 datasheet. We fix it before merge PMIC_mt6351 driver. Fixes: 5ae48040aa47 ("soc: mediatek: PMIC wrap: add mt6323 slave support") Signed-off-by: Argus Lin Signed-off-by: Matthias Brugger commit 7de7f9520e55ec4afa45928bc7c7c57c5aab4875 Author: Argus Lin Date: Mon Jun 11 18:49:57 2018 +0800 dt-bindings: pwrap: mediatek: add pwrap support for MT6797 Add binding document of pwrap for MT6797 SoCs. Signed-off-by: Argus Lin Signed-off-by: Matthias Brugger commit 306d6c49ac9ded11114cb53b0925da52f2c2ada1 Author: Claudio Imbrenda Date: Mon Jul 16 10:38:57 2018 +0200 s390/kvm: fix deadlock when killed by oom When the oom killer kills a userspace process in the page fault handler while in guest context, the fault handler fails to release the mm_sem if the FAULT_FLAG_RETRY_NOWAIT option is set. This leads to a deadlock when tearing down the mm when the process terminates. This bug can only happen when pfault is enabled, so only KVM clients are affected. The problem arises in the rare cases in which handle_mm_fault does not release the mm_sem. This patch fixes the issue by manually releasing the mm_sem when needed. Fixes: 24eb3a824c4f3 ("KVM: s390: Add FAULT_FLAG_RETRY_NOWAIT for guest fault") Cc: # 3.15+ Signed-off-by: Claudio Imbrenda Signed-off-by: Martin Schwidefsky commit ac4c4fc87d6beb6dd8287f24670e5e81c24b1de7 Author: Vasily Gorbik Date: Fri Jul 13 08:13:13 2018 +0200 s390/cmm: avoid add_timer on concurrently used timer cmm_set_timer could be called concurrently from cmm_thread, cmm proc handler, upon cmm smsg receive and timer function itself. To avoid potential race condition and hitting BUG_ON in add_timer on already pending timer simply reuse mod_timer which is according to documentation "the only safe way to modify the timeout" with multiple unserialized concurrent users. mod_timer can handle both active and inactive timers which allows to carry out minor code simplification as well. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit a09baa9543ef1ced2cc7c171a055712ec8af62a3 Author: Vasily Gorbik Date: Thu Jun 28 13:33:35 2018 +0200 s390/crypto: fix gcc 8 stringop-truncation warning Replace strncpy which is used to deliberately avoid string NUL-termination with memcpy. This allows to get rid of gcc 8 stringop-truncation warning: inlined from 'query_crypto_facility.constprop' at drivers/s390/crypto/pkey_api.c:702:2: ./include/linux/string.h:246:9: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation] Reviewed-by: Harald Freudenberger Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit d0ec2e9c10341001d648afdff0f42a22dafb044d Author: Jisheng Zhang Date: Fri Jul 13 17:46:38 2018 +0800 dt-binding: pinctrl: berlin: document AS370 SoC pinctrl Add as370 to existing berlin pinctrl device tree binding. Signed-off-by: Jisheng Zhang Signed-off-by: Linus Walleij commit 2b955b34c268af57e3002ece9fd2da70d19b1d5b Author: Bartosz Golaszewski Date: Mon Jul 16 10:34:24 2018 +0200 gpiolib: remove an unnecessary TODO It's actually fine to read values of output lines. This was also allowed by the legacy sysfs interface. Signed-off-by: Bartosz Golaszewski Signed-off-by: Linus Walleij commit e5332d5437764f775cf4e3b8ca3bf592af063a02 Author: Bartosz Golaszewski Date: Mon Jul 16 10:34:23 2018 +0200 gpiolib: don't allow userspace to set values of input lines User space can currently both read and set values of input lines using the character device. This was not allowed by the old sysfs interface nor is it a correct behavior. Check the first descriptor in the set for the OUT flag when asked to set values and return -EPERM if the line is input. Signed-off-by: Bartosz Golaszewski Signed-off-by: Linus Walleij commit c0d9f9ad4f7691f033e6e476300edc1fc9e2688e Author: Sean Wang Date: Fri Jun 22 11:49:10 2018 +0800 arm64: dts: mt7622: add earlycon to mt7622-rfb1 board Add earlycon to mt7622-rfb1 as to know what was going on when a certain fault is happening at the early initialization stage. Signed-off-by: Sean Wang Signed-off-by: Matthias Brugger commit aa54a84f835ae1b423be017f772ab851197de1ee Author: Sean Wang Date: Fri Jun 22 11:49:09 2018 +0800 arm64: dts: mt7622: use gpio-ranges to pinctrl device Using gpio-ranges property represent which GPIOs correspond to which pins on MT7622 pin controllers. For details, we can see section 2.1 of Documentation/devicetree/bindings/gpio/gpio.txt to know how to bind pinctrl and gpio drivers via the "gpio-ranges" property. Signed-off-by: Sean Wang Reviewed-by: Linus Walleij Signed-off-by: Matthias Brugger commit 12b2905af183c931bedcab4292c81d3a415e080f Author: Marc Zyngier Date: Thu May 31 09:01:59 2018 +0100 irqchip/gic-v3-its: Honor hypervisor enforced LPI range A recent extension to the GIC architecture allows a hypervisor to arbitrarily reduce the number of LPIs available to a guest, no matter what the GIC says about the valid range of IntIDs. Let's factor in this information when computing the number of available LPIs Signed-off-by: Marc Zyngier commit a4f9edb29d9c19f9f8dcd2df7ddfe4eb7ad58996 Author: Marc Zyngier Date: Wed May 30 17:29:52 2018 +0100 irqchip/gic-v3: Expose GICD_TYPER in the rdist structure Instead of exposing the GIC distributor IntID field in the rdist structure that is passed to the ITS, let's replace it with a copy of the whole GICD_TYPER register. We are going to need some of this information at a later time. No functionnal change. Signed-off-by: Marc Zyngier commit 38dd7c494cf604879e187e9b56690d25f876cf69 Author: Marc Zyngier Date: Sun May 27 17:03:03 2018 +0100 irqchip/gic-v3-its: Drop chunk allocation compatibility The chunk allocation system is now officially dead, so let's remove it. Signed-off-by: Marc Zyngier commit 147c8f376e5526ebfaf2827734916414db52a3c4 Author: Marc Zyngier Date: Sun May 27 16:39:55 2018 +0100 irqchip/gic-v3-its: Move minimum LPI requirements to individual busses At the moment, the core ITS driver imposes the allocation to be in chunks of 32. As we want to relax this on a per bus basis, let's move the the the allocation constraints to each bus. No functionnal change. Signed-off-by: Marc Zyngier commit fe8e93504ce870cb60b5dca97d13d861a53d7353 Author: Marc Zyngier Date: Sun May 27 16:15:22 2018 +0100 irqchip/gic-v3-its: Use full range of LPIs As we used to represent the LPI range using a bitmap, we were reducing the number of LPIs to at most 64k in order to preserve memory. With our new allocator, there is no such need, as dealing with 2^16 or 2^32 LPIs takes the same amount of memory. So let's use the number of IntID bits reported by the GIC instead of an arbitrary limit. Signed-off-by: Marc Zyngier commit 880cb3cddd164128522146d1c087fbd1811ed0cc Author: Marc Zyngier Date: Sun May 27 16:14:15 2018 +0100 irqchip/gic-v3-its: Refactor LPI allocator Our current LPI allocator relies on a bitmap, each bit representing a chunk of 32 LPIs, meaning that each device gets allocated LPIs in multiple of 32. It served us well so far, but new use cases now require much more finer grain allocations, down the the individual LPI. Given the size of the IntID space (up to 32bit), it isn't practical to continue using a bitmap, so let's use a different data structure altogether. We switch to a list, where each element represent a contiguous range of LPIs. On allocation, we simply grab the first group big enough to satisfy the allocation, and substract what we need from it. If the group becomes empty, we just remove it. On freeing interrupts, we insert a new group of interrupt in the list, sort it and fuse the adjacent groups. This makes freeing interrupt much more expensive than allocating them (an unusual behaviour), but that's fine as long as we consider that freeing interrupts is an extremely rare event. We still allocate interrupts in blocks of 32 for the time being, but subsequent patches will relax this. Signed-off-by: Marc Zyngier commit 4e1a720d0312fd510699032c7694a362a010170f Author: Sudip Mukherjee Date: Sun Jul 15 20:36:50 2018 +0100 Bluetooth: avoid killing an already killed socket slub debug reported: [ 440.648642] ============================================================================= [ 440.648649] BUG kmalloc-1024 (Tainted: G BU O ): Poison overwritten [ 440.648651] ----------------------------------------------------------------------------- [ 440.648655] INFO: 0xe70f4bec-0xe70f4bec. First byte 0x6a instead of 0x6b [ 440.648665] INFO: Allocated in sk_prot_alloc+0x6b/0xc6 age=33155 cpu=1 pid=1047 [ 440.648671] ___slab_alloc.constprop.24+0x1fc/0x292 [ 440.648675] __slab_alloc.isra.18.constprop.23+0x1c/0x25 [ 440.648677] __kmalloc+0xb6/0x17f [ 440.648680] sk_prot_alloc+0x6b/0xc6 [ 440.648683] sk_alloc+0x1e/0xa1 [ 440.648700] sco_sock_alloc.constprop.6+0x26/0xaf [bluetooth] [ 440.648716] sco_connect_cfm+0x166/0x281 [bluetooth] [ 440.648731] hci_conn_request_evt.isra.53+0x258/0x281 [bluetooth] [ 440.648746] hci_event_packet+0x28b/0x2326 [bluetooth] [ 440.648759] hci_rx_work+0x161/0x291 [bluetooth] [ 440.648764] process_one_work+0x163/0x2b2 [ 440.648767] worker_thread+0x1a9/0x25c [ 440.648770] kthread+0xf8/0xfd [ 440.648774] ret_from_fork+0x2e/0x38 [ 440.648779] INFO: Freed in __sk_destruct+0xd3/0xdf age=3815 cpu=1 pid=1047 [ 440.648782] __slab_free+0x4b/0x27a [ 440.648784] kfree+0x12e/0x155 [ 440.648787] __sk_destruct+0xd3/0xdf [ 440.648790] sk_destruct+0x27/0x29 [ 440.648793] __sk_free+0x75/0x91 [ 440.648795] sk_free+0x1c/0x1e [ 440.648810] sco_sock_kill+0x5a/0x5f [bluetooth] [ 440.648825] sco_conn_del+0x8e/0xba [bluetooth] [ 440.648840] sco_disconn_cfm+0x3a/0x41 [bluetooth] [ 440.648855] hci_event_packet+0x45e/0x2326 [bluetooth] [ 440.648868] hci_rx_work+0x161/0x291 [bluetooth] [ 440.648872] process_one_work+0x163/0x2b2 [ 440.648875] worker_thread+0x1a9/0x25c [ 440.648877] kthread+0xf8/0xfd [ 440.648880] ret_from_fork+0x2e/0x38 [ 440.648884] INFO: Slab 0xf4718580 objects=27 used=27 fp=0x (null) flags=0x40008100 [ 440.648886] INFO: Object 0xe70f4b88 @offset=19336 fp=0xe70f54f8 When KASAN was enabled, it reported: [ 210.096613] ================================================================== [ 210.096634] BUG: KASAN: use-after-free in ex_handler_refcount+0x5b/0x127 [ 210.096641] Write of size 4 at addr ffff880107e17160 by task kworker/u9:1/2040 [ 210.096651] CPU: 1 PID: 2040 Comm: kworker/u9:1 Tainted: G U O 4.14.47-20180606+ #2 [ 210.096654] Hardware name: , BIOS 2017.01-00087-g43e04de 08/30/2017 [ 210.096693] Workqueue: hci0 hci_rx_work [bluetooth] [ 210.096698] Call Trace: [ 210.096711] dump_stack+0x46/0x59 [ 210.096722] print_address_description+0x6b/0x23b [ 210.096729] ? ex_handler_refcount+0x5b/0x127 [ 210.096736] kasan_report+0x220/0x246 [ 210.096744] ex_handler_refcount+0x5b/0x127 [ 210.096751] ? ex_handler_clear_fs+0x85/0x85 [ 210.096757] fixup_exception+0x8c/0x96 [ 210.096766] do_trap+0x66/0x2c1 [ 210.096773] do_error_trap+0x152/0x180 [ 210.096781] ? fixup_bug+0x78/0x78 [ 210.096817] ? hci_debugfs_create_conn+0x244/0x26a [bluetooth] [ 210.096824] ? __schedule+0x113b/0x1453 [ 210.096830] ? sysctl_net_exit+0xe/0xe [ 210.096837] ? __wake_up_common+0x343/0x343 [ 210.096843] ? insert_work+0x107/0x163 [ 210.096850] invalid_op+0x1b/0x40 [ 210.096888] RIP: 0010:hci_debugfs_create_conn+0x244/0x26a [bluetooth] [ 210.096892] RSP: 0018:ffff880094a0f970 EFLAGS: 00010296 [ 210.096898] RAX: 0000000000000000 RBX: ffff880107e170e8 RCX: ffff880107e17160 [ 210.096902] RDX: 000000000000002f RSI: ffff88013b80ed40 RDI: ffffffffa058b940 [ 210.096906] RBP: ffff88011b2b0578 R08: 00000000852f0ec9 R09: ffffffff81cfcf9b [ 210.096909] R10: 00000000d21bdad7 R11: 0000000000000001 R12: ffff8800967b0488 [ 210.096913] R13: ffff880107e17168 R14: 0000000000000068 R15: ffff8800949c0008 [ 210.096920] ? __sk_destruct+0x2c6/0x2d4 [ 210.096959] hci_event_packet+0xff5/0x7de2 [bluetooth] [ 210.096969] ? __local_bh_enable_ip+0x43/0x5b [ 210.097004] ? l2cap_sock_recv_cb+0x158/0x166 [bluetooth] [ 210.097039] ? hci_le_meta_evt+0x2bb3/0x2bb3 [bluetooth] [ 210.097075] ? l2cap_ertm_init+0x94e/0x94e [bluetooth] [ 210.097093] ? xhci_urb_enqueue+0xbd8/0xcf5 [xhci_hcd] [ 210.097102] ? __accumulate_pelt_segments+0x24/0x33 [ 210.097109] ? __accumulate_pelt_segments+0x24/0x33 [ 210.097115] ? __update_load_avg_se.isra.2+0x217/0x3a4 [ 210.097122] ? set_next_entity+0x7c3/0x12cd [ 210.097128] ? pick_next_entity+0x25e/0x26c [ 210.097135] ? pick_next_task_fair+0x2ca/0xc1a [ 210.097141] ? switch_mm_irqs_off+0x346/0xb4f [ 210.097147] ? __switch_to+0x769/0xbc4 [ 210.097153] ? compat_start_thread+0x66/0x66 [ 210.097188] ? hci_conn_check_link_mode+0x1cd/0x1cd [bluetooth] [ 210.097195] ? finish_task_switch+0x392/0x431 [ 210.097228] ? hci_rx_work+0x154/0x487 [bluetooth] [ 210.097260] hci_rx_work+0x154/0x487 [bluetooth] [ 210.097269] process_one_work+0x579/0x9e9 [ 210.097277] worker_thread+0x68f/0x804 [ 210.097285] kthread+0x31c/0x32b [ 210.097292] ? rescuer_thread+0x70c/0x70c [ 210.097299] ? kthread_create_on_node+0xa3/0xa3 [ 210.097306] ret_from_fork+0x35/0x40 [ 210.097314] Allocated by task 2040: [ 210.097323] kasan_kmalloc.part.1+0x51/0xc7 [ 210.097328] __kmalloc+0x17f/0x1b6 [ 210.097335] sk_prot_alloc+0xf2/0x1a3 [ 210.097340] sk_alloc+0x22/0x297 [ 210.097375] sco_sock_alloc.constprop.7+0x23/0x202 [bluetooth] [ 210.097410] sco_connect_cfm+0x2d0/0x566 [bluetooth] [ 210.097443] hci_conn_request_evt.isra.53+0x6d3/0x762 [bluetooth] [ 210.097476] hci_event_packet+0x85e/0x7de2 [bluetooth] [ 210.097507] hci_rx_work+0x154/0x487 [bluetooth] [ 210.097512] process_one_work+0x579/0x9e9 [ 210.097517] worker_thread+0x68f/0x804 [ 210.097523] kthread+0x31c/0x32b [ 210.097529] ret_from_fork+0x35/0x40 [ 210.097533] Freed by task 2040: [ 210.097539] kasan_slab_free+0xb3/0x15e [ 210.097544] kfree+0x103/0x1a9 [ 210.097549] __sk_destruct+0x2c6/0x2d4 [ 210.097584] sco_conn_del.isra.1+0xba/0x10e [bluetooth] [ 210.097617] hci_event_packet+0xff5/0x7de2 [bluetooth] [ 210.097648] hci_rx_work+0x154/0x487 [bluetooth] [ 210.097653] process_one_work+0x579/0x9e9 [ 210.097658] worker_thread+0x68f/0x804 [ 210.097663] kthread+0x31c/0x32b [ 210.097670] ret_from_fork+0x35/0x40 [ 210.097676] The buggy address belongs to the object at ffff880107e170e8 which belongs to the cache kmalloc-1024 of size 1024 [ 210.097681] The buggy address is located 120 bytes inside of 1024-byte region [ffff880107e170e8, ffff880107e174e8) [ 210.097683] The buggy address belongs to the page: [ 210.097689] page:ffffea00041f8400 count:1 mapcount:0 mapping: (null) index:0xffff880107e15b68 compound_mapcount: 0 [ 210.110194] flags: 0x8000000000008100(slab|head) [ 210.115441] raw: 8000000000008100 0000000000000000 ffff880107e15b68 0000000100170016 [ 210.115448] raw: ffffea0004a47620 ffffea0004b48e20 ffff88013b80ed40 0000000000000000 [ 210.115451] page dumped because: kasan: bad access detected [ 210.115454] Memory state around the buggy address: [ 210.115460] ffff880107e17000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 210.115465] ffff880107e17080: fc fc fc fc fc fc fc fc fc fc fc fc fc fb fb fb [ 210.115469] >ffff880107e17100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 210.115472] ^ [ 210.115477] ffff880107e17180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 210.115481] ffff880107e17200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 210.115483] ================================================================== And finally when BT_DBG() and ftrace was enabled it showed: <...>-14979 [001] .... 186.104191: sco_sock_kill <-sco_sock_close <...>-14979 [001] .... 186.104191: sco_sock_kill <-sco_sock_release <...>-14979 [001] .... 186.104192: sco_sock_kill: sk ef0497a0 state 9 <...>-14979 [001] .... 186.104193: bt_sock_unlink <-sco_sock_kill kworker/u9:2-792 [001] .... 186.104246: sco_sock_kill <-sco_conn_del kworker/u9:2-792 [001] .... 186.104248: sco_sock_kill: sk ef0497a0 state 9 kworker/u9:2-792 [001] .... 186.104249: bt_sock_unlink <-sco_sock_kill kworker/u9:2-792 [001] .... 186.104250: sco_sock_destruct <-__sk_destruct kworker/u9:2-792 [001] .... 186.104250: sco_sock_destruct: sk ef0497a0 kworker/u9:2-792 [001] .... 186.104860: hci_conn_del <-hci_event_packet kworker/u9:2-792 [001] .... 186.104864: hci_conn_del: hci0 hcon ef0484c0 handle 266 Only in the failed case, sco_sock_kill() gets called with the same sock pointer two times. Add a check for SOCK_DEAD to avoid continue killing a socket which has already been killed. Signed-off-by: Sudip Mukherjee Signed-off-by: Marcel Holtmann commit a68bd1267b7286b1687905651b404e765046de25 Author: Alexey Kardashevskiy Date: Wed Jul 4 16:13:49 2018 +1000 powerpc/powernv/ioda: Allocate indirect TCE levels on demand At the moment we allocate the entire TCE table, twice (hardware part and userspace translation cache). This normally works as we normally have contigous memory and the guest will map entire RAM for 64bit DMA. However if we have sparse RAM (one example is a memory device), then we will allocate TCEs which will never be used as the guest only maps actual memory for DMA. If it is a single level TCE table, there is nothing we can really do but if it a multilevel table, we can skip allocating TCEs we know we won't need. This adds ability to allocate only first level, saving memory. This changes iommu_table::free() to avoid allocating of an extra level; iommu_table::set() will do this when needed. This adds @alloc parameter to iommu_table::exchange() to tell the callback if it can allocate an extra level; the flag is set to "false" for the realmode KVM handlers of H_PUT_TCE hcalls and the callback returns H_TOO_HARD. This still requires the entire table to be counted in mm::locked_vm. To be conservative, this only does on-demand allocation when the usespace cache table is requested which is the case of VFIO. The example math for a system replicating a powernv setup with NVLink2 in a guest: 16GB RAM mapped at 0x0 128GB GPU RAM window (16GB of actual RAM) mapped at 0x244000000000 the table to cover that all with 64K pages takes: (((0x244000000000 + 0x2000000000) >> 16)*8)>>20 = 4556MB If we allocate only necessary TCE levels, we will only need: (((0x400000000 + 0x400000000) >> 16)*8)>>20 = 4MB (plus some for indirect levels). Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit 9bc98c8a43c4900ee63b160f805c65051e35d917 Author: Alexey Kardashevskiy Date: Wed Jul 4 16:13:48 2018 +1000 powerpc/powernv: Rework TCE level allocation This moves actual pages allocation to a separate function which is going to be reused later in on-demand TCE allocation. While we are at it, remove unnecessary level size round up as the caller does this already. Reviewed-by: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 090bad39b237aad92d8e01baa033699cf0c81cbe Author: Alexey Kardashevskiy Date: Wed Jul 4 16:13:47 2018 +1000 powerpc/powernv: Add indirect levels to it_userspace We want to support sparse memory and therefore huge chunks of DMA windows do not need to be mapped. If a DMA window big enough to require 2 or more indirect levels, and a DMA window is used to map all RAM (which is a default case for 64bit window), we can actually save some memory by not allocation TCE for regions which we are not going to map anyway. The hardware tables alreary support indirect levels but we also keep host-physical-to-userspace translation array which is allocated by vmalloc() and is a flat array which might use quite some memory. This converts it_userspace from vmalloc'ed array to a multi level table. As the format becomes platform dependend, this replaces the direct access to it_usespace with a iommu_table_ops::useraddrptr hook which returns a pointer to the userspace copy of a TCE; future extension will return NULL if the level was not allocated. This should not change non-KVM handling of TCE tables and it_userspace will not be allocated for non-KVM tables. Reviewed-by: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 00a5c58d9499bd0c290b57205f43a70f2e69d3f6 Author: Alexey Kardashevskiy Date: Wed Jul 4 16:13:46 2018 +1000 KVM: PPC: Make iommu_table::it_userspace big endian We are going to reuse multilevel TCE code for the userspace copy of the TCE table and since it is big endian, let's make the copy big endian too. Reviewed-by: David Gibson Signed-off-by: Alexey Kardashevskiy Acked-by: Paul Mackerras Signed-off-by: Michael Ellerman commit 191c22879fbcfd98a7fe9a51786ef41253b1549b Author: Alexey Kardashevskiy Date: Wed Jul 4 16:13:45 2018 +1000 powerpc/powernv: Move TCE manupulation code to its own file Right now we have allocation code in pci-ioda.c and traversing code in pci.c, let's keep them toghether. However both files are big enough already so let's move this business to a new file. While we at it, move the code which links IOMMU table groups to IOMMU tables as it is not specific to any PNV PHB model. These puts exported symbols from the new file together. This fixes several warnings from checkpatch.pl like this: "WARNING: Prefer 'unsigned int' to bare use of 'unsigned'". As this is almost cut-n-paste, there should be no behavioral change. Reviewed-by: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit da2bb0da730c5c427f66ce501aa4367f6921779e Author: Alexey Kardashevskiy Date: Wed Jul 4 16:13:44 2018 +1000 powerpc/powernv: Remove useless wrapper This gets rid of a useless wrapper around pnv_pci_ioda2_table_free_pages(). Reviewed-by: David Gibson Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit aa0d8bda510865e06b56effc14c913b5af8142d8 Author: Wei Yongjun Date: Wed Jul 11 12:34:07 2018 +0000 pinctrl: at91-pio4: Remove redundant return value check Remove unneeded error handling on the result of a call to platform_get_resource() when the value is passed to devm_ioremap_resource(). Signed-off-by: Wei Yongjun Reviewed-by: Alexandre Belloni Acked-by: Ludovic Desroches Signed-off-by: Linus Walleij commit 17f790843cd77d69927ccd2f01a3bbd55067069e Author: Alexandre Belloni Date: Wed Jul 11 15:01:26 2018 +0200 pinctrl: ocelot: fix gpio4 twi function the TWI function on GPIO4 is actually a multiplexed SCL, not an original TWI SDA or SCL. Fix it. Signed-off-by: Alexandre Belloni Signed-off-by: Linus Walleij commit 45b85fca4598e4d4b881df1a482919d1df909016 Author: Lucas Stach Date: Mon Jul 2 14:59:06 2018 +0300 pinctrl: imx: add driver for i.MX8MQ The i.MX8MQ pincontrol works in a similar way to the earlier i.MX SoCs. This driver builds on top of the imx specific pinconf handling. Signed-off-by: Lucas Stach Signed-off-by: Abel Vesa Acked-by: Dong Aisheng Signed-off-by: Linus Walleij commit 95e7618b7ba1a0ddb05643712e21b3df413ffb8f Author: Abel Vesa Date: Mon Jul 2 14:59:05 2018 +0300 pinctrl: imx: Add DT binding for i.MX8MQ IOMUXC This adds the binding for the i.MX8MQ pin controller, in the same fashion as earlier i.MX SoCs. Signed-off-by: Abel Vesa Acked-by: Dong Aisheng Reviewed-by: Rob Herring Signed-off-by: Linus Walleij commit 399476bd40a5f3518d9ca8e809ca042028c41cea Author: Gustavo A. R. Silva Date: Thu Jul 5 10:51:27 2018 -0500 pinctrl: baytrail: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1292308 ("Missing break in switch") Addresses-Coverity-ID: 1292309 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit ff10e353a4c0c83a28c89c182462b3c8dc7f70cc Author: Ludovic Desroches Date: Fri Jun 29 10:15:33 2018 +0200 pinctrl: at91-pio4: add support for drive strength Add support for the drive strength configuration. Usually, this value is expressed in mA. Since the numeric value depends on VDDIOP voltage, a value we can't retrieve at runtime, the controller uses low, medium and high to define the drive strength. The PIO controller accepts two values for the low drive configuration: 0 and 1. Most of the time, we don't care about the drive strength. So we keep the default value which is 0. The drive strength is advertised through the sysfs only when it has been explicitly set in the device tree i.e. if its value is different from 0. Signed-off-by: Ludovic Desroches Acked-by: Rob Herring Signed-off-by: Linus Walleij commit e12fa73c97a4c5fbc77b28e6436277fdc4f9b3b5 Author: Gustavo A. R. Silva Date: Thu Jul 5 10:44:52 2018 -0500 pinctrl: mt7622: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Addresses-Coverity-ID: 1463284 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Linus Walleij commit a130af0162409fc8a118930255979d8be4adde5a Author: Jerome Brunet Date: Wed Jul 4 18:57:24 2018 +0200 pinctrl: meson: add gen_clk pins Add the pinctrl configuration for gen_clk on gxbb and axg. gen_clk allows to output and devide several internal clocks of SoC, including most of the plls. Signed-off-by: Jerome Brunet Signed-off-by: Linus Walleij commit a35f5c1ac2d4bdd777ffb8883961c10248da2aae Author: Takeshi Kihara Date: Tue Jul 3 19:53:28 2018 +0900 pinctrl: sh-pfc: r8a77990: Add USB3.0 pins, groups and functions This patch adds USB30_{PWEN,OVC} and USB3HS0_ID pins, groups and functions to the R8A77990 SoC. Signed-off-by: Takeshi Kihara Signed-off-by: Yoshihiro Shimoda Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit d7b535f99b39c808aa70faf23c4cfcee47b4abed Author: Takeshi Kihara Date: Wed Jun 6 15:43:05 2018 +0900 pinctrl: sh-pfc: r8a77990: Add USB2.0 pins, groups and functions This patch adds USB0_{PWEN,OVC}_{A,B} and USB0_ID pins, groups and functions to the R8A77990 SoC. Signed-off-by: Takeshi Kihara Signed-off-by: Yoshihiro Shimoda Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit 747c5417823d58aa494b04d4c329bb23c93bef92 Author: Yoshihiro Shimoda Date: Wed Jun 6 15:43:04 2018 +0900 pinctrl: sh-pfc: r8a77990: Revise USB ID pin name Since the datasheet Rev.1.00 has an error about the USB ID pin name, this patch revises it. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit 7628fa811b8af57192e02a52574412af316d60a9 Author: Takeshi Kihara Date: Thu Dec 14 13:04:55 2017 +0900 pinctrl: sh-pfc: r8a77965: Add HSCIF pins, groups, and functions This patch adds HSCIF{0,1,2,3,4} pins, groups and functions to the R8A77965 SoC. Signed-off-by: Takeshi Kihara Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit d6e08c7eabefc9b027d31d56024810eba76ce113 Author: Colin Ian King Date: Mon Jul 16 10:03:15 2018 +0100 ALSA: cs46xx: remove redundant pointer 'ins' Pointer 'ins' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'ins' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit c888443951949530b2eb9075cb24f6db00b8118d Author: Colin Ian King Date: Mon Jul 16 09:57:38 2018 +0100 ALSA: ali5451: remove redundant pointer 'codec' Pointer 'codec' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'codec' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit 7527cd209eb88ed03aeab9f4f9bde0923fd6b5d5 Author: Colin Ian King Date: Mon Jul 16 09:52:56 2018 +0100 ALSA: sb8: remove redundant pointer runtime Pointer runtime is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'runtime' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit 29fba9230de237312337fb7372a6ee2d5f2f893c Author: Colin Ian King Date: Mon Jul 16 09:49:38 2018 +0100 ALSA: gus: remove redundant pointer private_data Pointer private_data is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'private_data' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit a34e8aac49e6d2e3438998edba5f753bd5d5210f Author: Colin Ian King Date: Mon Jul 16 09:43:08 2018 +0100 ALSA: es1688: remove redundant pointer chip Pointer chip is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'chip' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit eeef847de593e2de4ddbf7ae3439c9fc9ebc8e84 Author: Colin Ian King Date: Mon Jul 16 09:34:51 2018 +0100 ALSA: opl3: remove redundant pointer opl3 Variable opl3 is being assigned but is never used hence it is redundant and can be removed. Cleans up several clang warnings: warning: variable 'opl3' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Takashi Iwai commit 3528651e89aa044347ca06db6e9a106aa9aff914 Author: Johan Hovold Date: Mon Jul 16 13:51:56 2018 +0200 USB: serial: iuu_phoenix: drop redundant input-speed re-encoding Drop redundant input-speed re-encoding at every open(). The output and input speeds are initialised to the same value and are kept in sync on termios updates. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit b8f6515445c170016014154f2e84cc863b4cc7a4 Author: Johan Hovold Date: Mon Jul 16 13:51:55 2018 +0200 USB: serial: iuu_phoenix: drop unused driver-data baud rate Drop unused driver-data baud rate. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 1e2ae1d7e43657f6d1a08a7e52ef85ed735cc538 Author: Colin Ian King Date: Fri Jul 13 11:08:31 2018 +0100 USB: serial: mos7720: remove redundant variables iflag, mask and serial Variables iflag, mask and serial are being assigned but are never used hence are redundant and can be removed. Cleans up clang warnings: warning: variable 'iflag' set but not used [-Wunused-but-set-variable] warning: variable 'mask' set but not used [-Wunused-but-set-variable] warning: variable 'serial' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Johan Hovold commit 726e41097920a73e4c7c33385dcc0debb1281e18 Author: Benjamin Herrenschmidt Date: Tue Jul 10 10:29:10 2018 +1000 drivers: core: Remove glue dirs from sysfs earlier For devices with a class, we create a "glue" directory between the parent device and the new device with the class name. This directory is never "explicitely" removed when empty however, this is left to the implicit sysfs removal done by kobject_release() when the object loses its last reference via kobject_put(). This is problematic because as long as it's not been removed from sysfs, it is still present in the class kset and in sysfs directory structure. The presence in the class kset exposes a use after free bug fixed by the previous patch, but the presence in sysfs means that until the kobject is released, which can take a while (especially with kobject debugging), any attempt at re-creating such as binding a new device for that class/parent pair, will result in a sysfs duplicate file name error. This fixes it by instead doing an explicit kobject_del() when the glue dir is empty, by keeping track of the number of child devices of the gluedir. This is made easy by the fact that all glue dir operations are done with a global mutex, and there's already a function (cleanup_glue_dir) called in all the right places taking that mutex that can be enhanced for this. It appears that this was in fact the intent of the function, but the implementation was wrong. Signed-off-by: Benjamin Herrenschmidt Acked-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman commit 46d3a03781ea70e25360660ac53bbb838de11c97 Author: Shaokun Zhang Date: Sun Jul 15 18:08:56 2018 +0800 driver core: remove unnecessary function extern declare device_private_init is called only in core.c, extern declare is unnecessary and make it static. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Shaokun Zhang Signed-off-by: Greg Kroah-Hartman commit 3ec78790ec9a1e23fd9b6c8681a7cd3b64d3ad23 Author: Randy Dunlap Date: Sun Jul 15 10:31:28 2018 -0700 sysfs.h: fix non-kernel-doc comment Don't use "/**" to begin this comment block since it is not a kernel-doc comment block. Also adjust comment line to fit in 80 characters. Signed-off-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman commit 555e7943f2818391c12aaa4b721b4f5ebb1fd036 Author: Sudeep Holla Date: Wed Jul 11 16:41:10 2018 +0100 misc: vexpress/syscfg: Use devm_ioremap_resource() to map memory Instead of checking the return value of platform_get_resource(), we can use devm_ioremap_resource() which has the NULL pointer check and the memory region requesting. devm_ioremap_resource is designed to replace calls to devm_request_mem_region followed by devm_ioremap, so let's use the same. Cc: Lorenzo Pieralisi Signed-off-by: Sudeep Holla Acked-by: Liviu Dudau Signed-off-by: Greg Kroah-Hartman commit 3772e5da445420543b25825ac2b5971f3743f6e8 Author: Robert Lippert Date: Fri Jul 6 11:25:32 2018 -0700 drivers/misc: Aspeed LPC snoop output using misc chardev Provides the data bytes snooped over the LPC snoop bus to userspace as a (blocking) misc character device. Bytes output from the host using LPC I/O transactions to the snooped port can be watched or retrieved from the character device using a simple command like this: ~# od -w1 -A n -t x1 /dev/aspeed-lpc-snoop0 10 de ad c0 ff ee Signed-off-by: Robert Lippert Signed-off-by: Patrick Venture Signed-off-by: Benjamin Fair Signed-off-by: Greg Kroah-Hartman commit 7f3838fb8c03d8ef52792ac3654a0b5f79a673e5 Author: Tomas Winkler Date: Sun Jul 15 14:41:18 2018 +0300 mei: bus: suppress sign-compare warnings Comparison between signed and unsigned warnings and associated type promotion may cause error condition not be detected. The type promotion issue in mei bus was addressed by two patches: commit b40b3e9358fb ("mei: bus: type promotion bug in mei_nfc_if_version()") commit cf1ed2c59b98 ("mei: bus: type promotion bug in mei_fwver()") Now it is possible to suppress the warning, by adding proper casting to move out of radar. Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit d9995a0fab40af333b08902ad43a387843ca0e17 Author: Dan Carpenter Date: Mon Jul 16 12:42:03 2018 +0200 gnss: fix potential error pointer dereference The gnss_allocate_device() function returns a mix of NULL and error pointers on error. It should only return one or the other. Since the callers both check for NULL, I've modified it to return NULL on error. Fixes: 2b6a44035143 ("gnss: add GNSS receiver subsystem") Signed-off-by: Dan Carpenter Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 55570f1a441787f67efe1aef3b5deae431ca7ee9 Author: Colin Ian King Date: Mon Jul 16 12:42:02 2018 +0200 gnss: ubx: make struct ubx_gserial_ops static The structure ubx_gserial_ops is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'ubx_gserial_ops' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit f1a498fa549e8e86895cda37e3fca867aae955b7 Author: Chris Wilson Date: Mon Jul 16 09:03:30 2018 +0100 drm/i915/execlists: Disable submission tasklet upon wedging If we declare the driver wedged before the GPU truly is, then we may see the GPU complete some CS events following our cancellation. This leaves us quite confused as we deleted all the bookkeeping and thus complain about the inconsistent state. We can just ignore the remaining events and let the GPU idle by not feeding it, and so avoid trying to racily overwrite shared state. We rely on there being a full GPU reset before unwedging, giving us the opportunity to reset the shared state. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188 Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180716080332.32283-4-chris@chris-wilson.co.uk commit 159b69bc0dcdb88ea5126a8f98e4caa31789326b Author: Chris Wilson Date: Mon Jul 16 09:03:31 2018 +0100 drm/i915: Remove pci private pointer after destroying the device private On an aborted module load, we unwind and free our device private - but we left a dangling pointer to our privates inside the pci_device. After the attempted aborted unload, we may still get a call to i915_pci_remove() when the module is removed, potentially chasing stale data. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180716080332.32283-5-chris@chris-wilson.co.uk commit 55e4b859a2e1952d3feb2e2ec1c520952cc8b660 Author: Chris Wilson Date: Mon Jul 16 09:03:32 2018 +0100 drm/i915/selftests: Downgrade igt_timeout message Give in, since CI continues to incorrectly insist that KERN_NOTICE is a warning and flags the timeout message as unwanted spam. At first, the intention was to use the message to indicate which tests might warrant an extended run, but virtually all tests require a timeout so it is simply not as interesting as first thought. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103667 Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180716080332.32283-6-chris@chris-wilson.co.uk commit 0f33bde8859b7746ecdd8af1d1e5dde0e9b899f9 Author: Benjamin Herrenschmidt Date: Mon Jun 18 14:58:59 2018 +1000 ARM: dts: aspeed: Fix Romulus VGA frame buffer The reserved memory for the VGA frame buffer is at the wrong address for this system. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Joel Stanley commit b35bbd3d71872d35df17c40b4e4423855d8c5e6f Author: Benjamin Herrenschmidt Date: Fri Jun 29 13:51:06 2018 +1000 ARM: dts: aspeed: Enable vhub on port A of AST2500 EVB This is an eval board, it makes sense to enable many functions by default. This changes the device-tree to set port A to be a USB device and leave port B as a host, along with a little comment explaining how to change it. (the vhub device can only exist on port A on this SoC) Signed-off-by: Benjamin Herrenschmidt Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 35578a85d981ffb434b7eb8cd2156388788dcaa0 Author: Benjamin Herrenschmidt Date: Fri Jun 29 13:51:03 2018 +1000 ARM: dts: aspeed: Add G5 USB Virtual Hub This adds the (disabled by default) device node for the Aspeed virtual hub,a long with clocks and pinmux. This also adds the missing pinmux definition for it (the kernel driver already knows about it). Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Joel Stanley commit 608d05c61cdcd42d0ecdf7ad2d865b54569f79d5 Author: Benjamin Herrenschmidt Date: Fri Jun 29 13:51:02 2018 +1000 ARM: dts: aspeed: Add G4 USB Virtual Hub This adds the (disabled by default) device node for the Aspeed virtual hub,a long with clocks and pinmux. Signed-off-by: Benjamin Herrenschmidt Acked-by: Andrew Jeffery Signed-off-by: Joel Stanley commit 112c5a640cfb03b532bea0179991895bbff25aa4 Author: Benjamin Herrenschmidt Date: Fri Jun 29 13:51:01 2018 +1000 ARM: dts: aspeed: Add G5 USB host pinmux Set the default pinmux for EHCIs so boards don't have to do it an document why it is not set for UHCI. Remove the properties from the AST2500 EVB board which are now redundant Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Andrew Jeffery Signed-off-by: Joel Stanley commit c282ea743bb617b9419398254308edfa70c3c64f Author: Benjamin Herrenschmidt Date: Fri Jun 29 13:51:00 2018 +1000 ARM: dts: aspeed: Add G4 USB pinmux Set the default pinmux for EHCI so boards don't have to do it, and document why it is not set for UHCI. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Joel Stanley commit 499fef09a3237497906084da3eede0185fc9abb8 Author: Kunihiko Hayashi Date: Tue Jul 10 10:14:17 2018 +0900 reset: uniphier: add USB3 core reset control Add a reset line to enable USB3 core implemented in UniPhier SoCs. This reuses only the reset operations in reset-simple, because the reset-simple doesn't handle any SoC-dependent clocks and resets. This reset line is included in the USB3 glue layer, and it's necessary to enable clocks and deassert resets of the layer before using this reset line. Signed-off-by: Kunihiko Hayashi Signed-off-by: Philipp Zabel commit ef8b023b230bfa3cf1f09ea1b8f1e47e37b389f2 Author: Kunihiko Hayashi Date: Tue Jul 10 10:14:16 2018 +0900 dt-bindings: reset: uniphier: add USB3 core reset support Add DT bindings for reset control of USB3 core implemented in UniPhier SoCs. The reset control belongs to USB3 glue layer. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Signed-off-by: Philipp Zabel commit 9ad39ab2807756ac9b0a3aca4457031ea814e658 Author: Kunihiko Hayashi Date: Wed Jul 4 19:13:56 2018 +0900 reset: simple: export reset_simple_ops to be referred from modules Allow reset_simple_ops to be referred from modules that use reset-simple framework by adding EXPORT_SYMBOL_GPL. Suggested-by: Masahiro Yamada Signed-off-by: Kunihiko Hayashi Signed-off-by: Philipp Zabel commit 5ecb065165b90a5745f3a6c3a8a847b530e3afbc Author: Sibi Sankar Date: Wed Jun 27 19:54:43 2018 +0530 reset: qcom: AOSS (always on subsystem) reset controller Add reset controller driver for Qualcomm SDM845 SoC to control reset signals provided by AOSS for Modem, Venus ADSP, GPU, Camera, Wireless, Display subsystem Reviewed-by: Bjorn Andersson Signed-off-by: Sibi Sankar Signed-off-by: Philipp Zabel commit b79df1ec22a3924a09028b98807fa71ea612af9d Author: Sibi Sankar Date: Wed Jun 27 19:54:42 2018 +0530 dt-bindings: reset: Add AOSS reset bindings for SDM845 SoCs Add SDM845 AOSS (always on subsystem) reset controller binding Signed-off-by: Sibi Sankar Reviewed-by: Bjorn Andersson Reviewed-by: Rob Herring Signed-off-by: Philipp Zabel commit 8d62fe9499b8eb027837892aad8fb52d83a52a41 Author: Tuomas Tynkkynen Date: Fri Jul 13 00:39:56 2018 +0300 virtio: virtconsole: Use seq_file for debugfs operations Simplifies the code and is more conventional to what's used in the rest of the kernel for debugfs ops. Signed-off-by: Tuomas Tynkkynen Reviewed-by: Amit Shah Signed-off-by: Greg Kroah-Hartman commit 566208494e4d7cc7bdac48d4c9b99d4fcb8fca48 Author: Colin Ian King Date: Sat Jul 14 17:33:32 2018 +0100 vme: ca91cx42: remove redundant variable i Variable i is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'i' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Reviewed-by: Martyn Welch Signed-off-by: Greg Kroah-Hartman commit fefe287e4bf6ee23a5d9422a0a49de5389acc712 Author: Johan Hovold Date: Sun Jul 15 15:39:35 2018 +0200 tty: support CIBAUD without BOTHER Since commit edc6afc54968 ("[PATCH] tty: switch to ktermios and new framework") arbitrary baud rates can be requested using BOTHER and input rates can be requested using the termios CIBAUD bits (CBAUD shifted IBSHIFT bits). This functionality has been conditionally compiled depending on whether an architecture defines BOTHER and IBSHIFT respectively, but would in fact fail to compile unless both symbols were defined due to cross dependencies. Relax the IBSHIFT => BOTHER dependency so that an architecture could theoretically support CIBAUD without the Linux-specific BOTHER, while hopefully making the current conditional-compilation directives a bit less confusing. Note that the long-term goal is still to have all architectures support both features, so an alternative could just be to have the lot depend on BOTHER. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 44350993d01c901cc201ef2663fd0fded2e03d06 Author: Aapo Vienamo Date: Fri Jul 13 16:17:45 2018 +0300 mmc: tegra: Add and use tegra_sdhci_get_max_clock() Implement and use tegra_sdhci_get_max_clock() which returns the true maximum host clock rate. The issue with tegra_sdhci_get_max_clock() is that it returns the current clock rate of the host instead of the maximum one, which can lead to unnecessarily small clock rates. This differs from the previous implementation of tegra_sdhci_get_max_clock() in that it doesn't divide the result by two. Signed-off-by: Aapo Vienamo Tested-by: Marcel Ziswiler Signed-off-by: Ulf Hansson commit 8312b97c7c08bd0fc489ee5db809dee9102a289f Merge: d47b0586ab31 3b1074bf9817 Author: Ulf Hansson Date: Mon Jul 16 11:58:21 2018 +0200 Merge branch 'fixes' into next commit 1cee38f0363a88db374e50b232ca17b9a4c12fa0 Author: Johan Hovold Date: Sun Jul 15 15:39:34 2018 +0200 tty: fix termios input-speed encoding when using BOTHER When the termios CIBAUD bits are left unset (i.e. B0), we use the same output and input speed and should leave CIBAUD unchanged. When the user requests a rate using BOTHER and c_ospeed which the driver cannot set exactly, the driver can report back the actual baud rate using tty_termios_encode_baud_rate(). If this rate is close enough to a standard rate however, we could end up setting CIBAUD to a Bfoo value despite the user having left it unset. This in turn could lead to an unexpected input rate being set on subsequent termios updates. Fix this by using a zero tolerance value also for the input rate when CIBAUD is clear so that the matching logic works as expected. Fixes: 78137e3b34e1 ("[PATCH] tty: improve encode_baud_rate logic") Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit fada18c48d774b9e837928ecdce6a5d5fdd11ee7 Author: Johan Hovold Date: Sun Jul 15 15:39:33 2018 +0200 tty: fix termios input-speed encoding Make sure to clear the CIBAUD bits before OR-ing the new mask when encoding the termios input baud rate. This could otherwise lead to an incorrect input rate being reported back and incidentally set on subsequent termios updates. Fixes: edc6afc54968 ("[PATCH] tty: switch to ktermios and new framework") Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 8a8a66a1a18a1dbd213bee460bcedb1361abc7ff Author: Girish Mahadevan Date: Fri Jul 13 16:17:35 2018 -0600 tty: serial: qcom_geni_serial: Add support for flow control Add support for flow control functionality in the GENI serial driver and also support for non-console higher baud rate(upto 4Mbps) usecases. Signed-off-by: Girish Mahadevan Signed-off-by: Mohammed Khajapasha Signed-off-by: Karthikeyan Ramasubramanian Signed-off-by: Greg Kroah-Hartman commit c58caaab3bf87a6470c1a4641ea7fa5192e12bdd Author: Alexander Sverdlin Date: Fri Jul 13 17:01:19 2018 +0200 serial: 8250: of: Defer probe on missing IRQ If the IRQ controller is not yet probed do not proceed with irq=0, try to defer the probe. Signed-off-by: Alexander Sverdlin Signed-off-by: Greg Kroah-Hartman commit b29330d829042512fabb2bfa3bbfa32df1115594 Author: Alexander Sverdlin Date: Fri Jul 13 16:58:54 2018 +0200 serial: 8250: of: Correct of_platform_serial_setup() error handling Don't dispose IRQ mapping before it has been created. Fixes: aa9594740 ("serial: 8250_of: Add IO space support") Signed-off-by: Alexander Sverdlin Signed-off-by: Greg Kroah-Hartman commit b819e4aba0f8456966dce137650b9421f5bf9be7 Author: Chris Brandt Date: Wed Jul 11 09:41:31 2018 -0500 serial: sh-sci: Document r7s9210 bindings Add R7S9210 (RZ/A2) support Signed-off-by: Chris Brandt Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit 8b0bbd956228ae87139673e5611c4c880ddb9529 Author: Chris Brandt Date: Wed Jul 11 09:41:30 2018 -0500 serial: sh-sci: Add support for R7S9210 Add support for a "RZ_SCIFA" which is different than a traditional SCIFA. It looks like a normal SCIF with FIFO data, but with a compressed address space. Also, the break out of interrupts are different then traditinal SCIF: ERI/BRI, RXI, TXI, TEI, DRI. The R7S9210 (RZ/A2) contains this type of SCIF. Signed-off-by: Chris Brandt Signed-off-by: Greg Kroah-Hartman commit 173a4906aebe14fccc6cd338efda618fd69d56de Author: Tobias Lindskog Date: Fri Jul 6 14:44:16 2018 -0700 staging: android: ashmem: Shrink directly through shmem_fallocate When ashmem_shrink is called from direct reclaim on a user thread, a call to do_fallocate will check for permissions against the security policy of that user thread. It can thus fail by chance if called on a thread that isn't permitted to modify the relevant ashmem areas. Because we know that we have a shmem file underneath, call the shmem implementation of fallocate directly instead of going through the user-space interface for fallocate. Signed-off-by: Tobias Lindskog Signed-off-by: Jeff Vander Stoep Signed-off-by: Joel Fernandes (Google) Signed-off-by: Greg Kroah-Hartman commit ab608b341b482f1ab5a6fd43ff853a7627107b19 Author: Matthias Wolf Date: Mon Jul 16 11:30:00 2018 +0200 staging: fbtft: Fix line continuation Fix checkpatch warning: avoid unnecessary line continuation to allow grepping of whole error message. Signed-off-by: Matthias Wolf Signed-off-by: Felix Siegel Signed-off-by: Tim Cofala Signed-off-by: Greg Kroah-Hartman commit 66558395e1bb4e02221a9a9c5c0cf5087cd4b0ba Author: Matthias Wolf Date: Mon Jul 16 11:29:59 2018 +0200 staging: fbtft: Fix line over 80 characters Fix checkpatch line over 80 characters where it seemed appropriate Signed-off-by: Matthias Wolf Signed-off-by: Felix Siegel Signed-off-by: Tim Cofala Signed-off-by: Greg Kroah-Hartman commit 642e0692bea6e7393c01e7074a55b491700f9e6e Author: Nishad Kamdar Date: Sat Jul 14 21:14:58 2018 +0530 staging: comedi: comedi_fops: Shift assignment operator '=' to previous line Shift '=' assignment operator to the end of previous line to conform to preferred kernel style line wrapping. Issue reported by checkpatch CHECK. Signed-off-by: Nishad Kamdar Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit d47b0586ab31771e49e6b1af049e09bf33fbe867 Author: Stefan Agner Date: Thu Jul 12 10:07:25 2018 +0200 mmc: sdhci-esdhc-imx: fix indent Fix indent. This also makes disable/enable clock blocks look alike. Signed-off-by: Stefan Agner Acked-by: Dong Aisheng Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 73e736f865780cf01652b863d2016dde480c0f6f Author: Stefan Agner Date: Thu Jul 12 10:07:24 2018 +0200 mmc: sdhci-esdhc-imx: disable clocks before changing frequency In the uSDHC case (e.g. i.MX 6) clocks only get disabled if frequency is set to 0. However, it could be that the stack asks for a frequency change while clocks are on. In that case the function clears the divider registers (by clearing ESDHC_CLOCK_MASK) while the clock is enabled! This causes a short period of time where the clock is undivided (on a i.MX 6DL a clock of 196MHz has been measured). For older IP variants the driver disables clock by clearing some bits in ESDHC_SYSTEM_CONTROL. Make sure to disable card clock before changing frequency for uSDHC IP variants too. Signed-off-by: Stefan Agner Acked-by: Dong Aisheng Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 726df1d5a62ec8241a2823f6b23728db61178eaa Author: Stefan Agner Date: Thu Jul 12 09:39:04 2018 +0200 mmc: tegra: prevent ACMD23 on Tegra 3 It seems that SD3.0 advertisement needs to be set for higher eMMC speed modes (namely DDR52) as well. The TRM states that the SD3.0 advertisement bit should be set for all controller instances, even for those not supporting UHS-I mode... When specifying vqmmc-supply as a fixed 1.8V regulator on a Tegra SD/MMC instance which is connected to a eMMC device, the stack enables SD3.0. However, enabling it has consequences: If SDHCI 3.0 support is advertised the stack enables Auto-CMD23. Unfortunately Auto-CMD23 seems not to work well with Tegra 3 currently. It leads to regular warnings: mmc2: Got command interrupt 0x00010000 even though no command operation was in progress. It is not entirely clear why those errors happens. It seems that a Linux 3.1 based downstream kernel which has Auto-CMD23 support does not show those warnings. Use quirk SDHCI_QUIRK2_ACMD23_BROKEN to prevent Auto-CMD23 being used for now. With this the eMMC works stable on high-speed mode while still announcing SD3.0. This allows to use mmc-ddr-1_8v to enables DDR52 mode. In DDR52 mode read speed improves from about 42MiB/s to 72MiB/s on an Apalis T30. Signed-off-by: Stefan Agner Tested-by: Marcel Ziswiler Signed-off-by: Ulf Hansson commit e300149e580863b00a736b534c7163dcf0813641 Author: Stefan Agner Date: Thu Jul 12 09:39:03 2018 +0200 mmc: tegra: fix eMMC DDR52 mode Make sure the clock is doubled when using eMMC DDR52 mode. Signed-off-by: Stefan Agner Tested-by: Marcel Ziswiler Signed-off-by: Ulf Hansson commit 127407e36f4fe3a1d5e8b9998b479956ce83a7dc Author: Stefan Agner Date: Thu Jul 12 09:39:02 2018 +0200 mmc: tegra: prevent HS200 on Tegra 3 The stack assumes that SDHC controller which support SD3.0 (SDR104) do support HS200. This is not the case for Tegra 3, which does support SD 3.0 but only supports eMMC spec 4.41. Use SDHCI_QUIRK2_BROKEN_HS200 to indicate that the controller does not support HS200. Note that commit 156e14b126ff ("mmc: sdhci: fix caps2 for HS200") added the tie between SD3.0 (SDR104) and HS200. I don't think that this is necessarly true. It is fully legitimate to support SD3.0 and not support HS200. The quirk naming suggests something is broken in the controller, but this is not the case: The controller simply does not support HS200. Fixes: 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes") Signed-off-by: Stefan Agner Tested-by: Marcel Ziswiler Signed-off-by: Ulf Hansson commit 152f8204ffcd7b64aa6b36f39ee86fbce3f650b8 Author: Prabu Thangamuthu Date: Wed Jul 11 13:26:17 2018 +0530 mmc: sdhci-pci-dwc-mshc: synopsys dwc mshc support Synopsys has DWC MSHC controller on HPAS-DX platform connected using PCIe interface with SD card slot and eMMC device slots. This patch is to enable SD cards connected on this platform. As Clock generation logic is implemented using MMCM module of HAPS-DX platform, we have separate functions to control the MMCM to generate required clocks with respect to speed mode. Signed-off-by: Prabu Thangamuthu Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit a6e7e407a68eee166c83e93c4ce8041aa00c2875 Author: Fabio Estevam Date: Fri Jul 6 14:40:07 2018 -0300 mmc: sdhci-esdhc-imx: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Ulf Hansson commit e438cf49b3053ee79ad802a72d4a27bff77c86d8 Author: Jisheng Zhang Date: Fri Jul 6 15:23:55 2018 +0800 mmc: sdhci-of-dwcmshc: add SDHCI OF Synopsys DWC MSHC driver Add a driver for SDHCI OF Synopsys DesignWare Cores Mobile Storage Signed-off-by: Jisheng Zhang Signed-off-by: Ulf Hansson Acked-by: Adrian Hunter commit aaadfa66908460bb4e29eb3904b3d386e6b1835f Author: Jisheng Zhang Date: Fri Jul 6 15:20:47 2018 +0800 dt: bindings: Add bindings for SDHCI Synopsys DWC MSHC Synopsys SDHCI compatible DesignWare Cores Mobile Storage Host Controller can support eMMC/SD/SDIO. Add the bindings. Signed-off-by: Jisheng Zhang Signed-off-by: Ulf Hansson commit 1b5190c2e74c47ebe4bcecf7a072358ad9f1feaa Author: Stefan Agner Date: Thu Jul 5 14:18:19 2018 +0200 mmc: sdhci: do not try to use 3.3V signaling if not supported For eMMC devices it is valid to only support 1.8V signaling. When vqmmc is set to a fixed 1.8V regulator the stack tries to set 3.3V initially and prints the following warning: mmc1: Switching to 3.3V signalling voltage failed Clear the MMC_SIGNAL_VOLTAGE_330 flag in case 3.3V is signaling is not available. This prevents the stack from even trying to use 3.3V signaling and avoids the above warning. Signed-off-by: Stefan Agner Signed-off-by: Ulf Hansson commit 5552d7ad596c3fea953f40fef74170ce0760c04d Author: Laurentiu Tudor Date: Wed Jul 4 14:34:20 2018 +0300 mmc: sdhci-of-esdhc: set proper dma mask for ls104x chips SDHCI controller in ls1043a and ls1046a generate 40-bit wide addresses when doing DMA. Make sure that the corresponding dma mask is correctly configured. Context: when enabling smmu on these chips the following problem is encountered: the smmu input address size is 48 bits so the dma mappings for sdhci end up 48-bit wide. However, on these chips sdhci only use 40-bits of that address size when doing dma. So you end up with a 48-bit address translation in smmu but the device generates transactions with clipped 40-bit addresses, thus smmu context faults are triggered. Setting up the correct dma mask fixes this situation. Signed-off-by: Laurentiu Tudor Signed-off-by: Ulf Hansson commit f01c3684cf048794dced60297c6fc4b805c6787c Author: weiyongjun (A) Date: Wed Jul 4 08:35:17 2018 +0000 mmc: sdhci-msm: Remove redundant dev_err call in sdhci_msm_probe() There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun Signed-off-by: Ulf Hansson commit 2061594c612c4535b14bcd062a5bcf308bdd2b98 Author: Gustavo A. R. Silva Date: Tue Jul 3 17:56:59 2018 -0500 mmc: sdhci-xenon: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Ulf Hansson commit 23f3ff72bc6f05116b27e3628868b4912dd9a2b2 Author: Daniel Mack Date: Tue Jul 3 22:10:27 2018 +0200 mmc: pxamci: provide a short-hand for &pdev->dev Just a cosmetic cleanup with no functional impact. Signed-off-by: Daniel Mack Signed-off-by: Ulf Hansson commit 38a8dda908683c30bcabe7e03a3418aaf2022f5f Author: Daniel Mack Date: Tue Jul 3 22:10:26 2018 +0200 mmc: pxamci: make GPIO lookups from pdata optional A recent commit introduced a call to mmc_of_parse() and removed the explicit assignment of GPIOs in the pdata structure. This will leave them set to 0, which is a valid GPIO per se, so the code that looks at these members will try to allocate them and fail. To fix this properly, make the following changes: a) Refrain from allocating and assiging a pdata struct from pxamci_of_init(). It's a hack to do it this way anyway. Instead, move the only remaining member of interest in 'struct pxamci_host' and assign the value from either the passed in pdata pointer or with the value read from DT. b) Let the only user of 'detect_delay_ms' look at the member of 'struct pxamci_host', not the pdata. c) Make more code in pxamci_probe() dependent on the presence of actual pdata. This will also ease the removal of pdata one day. Signed-off-by: Daniel Mack Signed-off-by: Ulf Hansson commit 61951fd6cb49593c57da22b780ab9114060032d4 Author: Daniel Mack Date: Sat Jun 30 20:14:05 2018 +0200 mmc: pxamci: let mmc core handle regulators Strip some code by letting the mmc core handle the regulators. The old .gpio_power pdata handling is kept around for now. This also set the voltage on the regulator and handles -EPROBE_DEFER correctly. Signed-off-by: Daniel Mack Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit f37216de6ecc306ff4acd186a88a99906babaf18 Author: Daniel Mack Date: Sat Jun 30 20:14:04 2018 +0200 mmc: pxamci: remove pxa-mmc, gpio-power from devicetree bindings Devicetree-enabled boards should use proper regulators to control the power of cards, not GPIOs, so let's remove this property. The regulator properties are supported by the MMC core and are described in the generic MMC document: Documentation/devicetree/bindings/mmc/mmc.txt Note that devicetree support for PXA platforms hasn't fully landed yet, so this binding does not have any users at this point. Signed-off-by: Daniel Mack Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit fa3a5115469c2d1fdb32ea08e8bc6e3b105630a6 Author: Daniel Mack Date: Sat Jun 30 20:14:03 2018 +0200 mmc: pxamci: call mmc_of_parse() Call into mmc_of_parse() from pxamci_of_init(). As it needs a pointer to a struct mmc_host, refactor the code a bit. This allows all generic MMC properties to be set that are described in Documentation/devicetree/bindings/mmc/mmc.txt. Reword the documentation a bit to make that clear. The "cd" and "wp" gpio lookups are removed as the lookup will now be done by mmc_of_parse(). Signed-off-by: Daniel Mack Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit 0da5358b29321c4f59cc7b3e00b536c5ec06a8bb Author: Daniel Mack Date: Sat Jun 30 20:14:02 2018 +0200 mmc: pxamci: fix indenting pxamci_of_init() had some weird indenting. Signed-off-by: Daniel Mack Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit 52c091868e787cd1fa10d43d343f9282860f4a18 Author: Daniel Mack Date: Sat Jun 30 20:14:01 2018 +0200 mmc: pxamci: remove dead code from pxamci_remove() These gpio assignments don't make sense, as they are not used anywhere. Remove the dead code. Signed-off-by: Daniel Mack Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit 140b7fe4d38aa2733b28d5a370c5e5796c508c06 Author: Daniel Mack Date: Sat Jun 30 20:14:00 2018 +0200 mmc: pxamci: remove dma resources from private context These members are no longer in use, so let's remove them. Signed-off-by: Daniel Mack Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit d92eaf57a85c27890a21cb0b417498b8e903db44 Author: Daniel Mack Date: Sat Jun 30 20:13:59 2018 +0200 mmc: pxamci: remove irq from private context This seems to be a left-over from times before the IRQ was handled by devm functions. Remove it. Signed-off-by: Daniel Mack Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit 86f495c57f7146bc5d363d27483957928bb9d1d8 Author: Stefan Agner Date: Thu Jun 28 10:13:29 2018 +0200 mmc: sdhci-esdhc-imx: get rid of support_vsel The field support_vsel is currently only used in the device tree case. Get rid of it. No change in behavior. Signed-off-by: Stefan Agner Signed-off-by: Ulf Hansson commit 09c8192be713a30ace01ac00a90bc3361b7fcd12 Author: Stefan Agner Date: Thu Jun 28 09:31:36 2018 +0200 mmc: sdhci-esdhc-imx: support eMMC DDR mode when running at 3.3V The uSDHC supports DDR modes for eMMC devices running at 3.3V. This allows to run eMMC with 3.3V signaling voltage at DDR52 mode: # cat /sys/kernel/debug/mmc1/ios clock: 52000000 Hz vdd: 21 (3.3 ~ 3.4 V) bus mode: 2 (push-pull) chip select: 0 (don't care) power mode: 2 (on) bus width: 3 (8 bits) timing spec: 8 (mmc DDR52) signal voltage: 0 (3.30 V) driver type: 0 (driver type B) Signed-off-by: Stefan Agner Signed-off-by: Ulf Hansson commit 29772f8a73d88a5de648177d9d822055ab7d1ba6 Author: Ulf Hansson Date: Tue Jun 26 16:51:31 2018 +0200 mmc: core: Drop the unused mmc_power_save|restore_host() The last user of mmc_power_save|restore_host() APIs is gone, hence let's drop them. Drop also the corresponding bus_ops callback, ->power_save|restore() as those becomes redundant. Cc: Tony Lindgren Cc: Eyal Reizer Signed-off-by: Ulf Hansson commit 67fdfbdf0115b39b4e9b9d96d240202fa3049b12 Author: yinbo.zhu Date: Mon Jun 25 16:46:24 2018 +0800 mmc: sdhci-of-esdhc: modify the sd clock in of_match_node way Convert to use of_match_node method to fix up eSDHC clock for ls1046a/ls1012a/p1010. Also add eSDHC clock fixup for ls1021a according to its datasheet. The maxmum speed for ls1021a eSDHC high speed mode is 46.5MHz. Signed-off-by: Yinbo Zhu Signed-off-by: Ulf Hansson commit 3f2c7d5d158d7df430b5763674be9e0b834dfd6f Author: Helmut Grohne Date: Wed Jun 20 13:33:00 2018 +0200 mmc: sdhci-of-arasan: Add quirk for unstable clocks Some controllers immediately report SDHCI_CLOCK_INT_STABLE after enabling the clock even when the clock is not stable. When used in conjunction with older/slower cards, this can result in: mmc0: error -84 whilst initialising SD card When the stable reporting is known to be broken, we simply wait for the maximum stabilization period. Signed-off-by: Helmut Grohne Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 26c312281336b55eba01ea1e7b85740d383076c6 Author: Helmut Grohne Date: Wed Jun 20 13:32:51 2018 +0200 dt-bindings: mmc: broken clock stable indicator on arasan controllers Some controllers immediately report that their internal clock is stable after activating it even when the clock is not stable. When used in conjunction with older/slower cards, this can result in: mmc0: error -84 whilst initialising SD card This flag allows documenting and thus working around such a hardware defect. Signed-off-by: Helmut Grohne Acked-by: Adrian Hunter Reviewed-by: Rob Herring Signed-off-by: Ulf Hansson commit 5637ffadf6719576fcba0e02026f80fd54466265 Author: Adrian Hunter Date: Wed Jun 20 09:23:13 2018 +0300 mmc: sdhci-pci: Add support for Intel ICP Add PCI Ids for Intel ICP. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit bc99266bbdd2fb302d2c85baae456577610db7b9 Author: Sayali Lokhande Date: Tue Jun 19 11:09:21 2018 +0530 mmc: host: Register changes for sdcc V5 Add support to use the new compatible string "qcom,sdhci-msm-v5". Based on the msm variant, pick the relevant variant data and use it for register read/write to msm specific registers. Signed-off-by: Sayali Lokhande Signed-off-by: Vijay Viswanath Reviewed-by: Evan Green Signed-off-by: Ulf Hansson commit e0e4eee21c700bf583fa9fa92be900cc0028323b Author: Sayali Lokhande Date: Tue Jun 19 11:09:20 2018 +0530 Documentation: sdhci-msm: Add new compatible string for SDCC v5 For SDCC version 5.0.0 and higher, new compatible string "qcom,sdhci-msm-v5" is added. Signed-off-by: Sayali Lokhande Signed-off-by: Vijay Viswanath Acked-by: Rob Herring Signed-off-by: Ulf Hansson commit 6ed4bb4387033a12694e7d766a3612e6cd42a4c0 Author: Vijay Viswanath Date: Tue Jun 19 11:09:19 2018 +0530 mmc: sdhci-msm: Add msm version specific ops and data structures In addition to offsets of certain registers changing, the registers in core_mem have been shifted to HC mem as well. To access these registers, define msm version specific functions. These functions can be loaded into the function pointers at the time of probe based on the msm version detected. Also defind new data structure to hold version specific Ops and register addresses. Signed-off-by: Sayali Lokhande Signed-off-by: Vijay Viswanath Reviewed-by: Evan Green Signed-off-by: Ulf Hansson commit f15358885dda65ed930885f9c19d37398fb06d48 Author: Sayali Lokhande Date: Tue Jun 19 11:09:18 2018 +0530 mmc: sdhci-msm: Define new Register address map For SDCC version 5.0.0, MCI registers are removed from SDCC interface and some registers are moved to HC. Define a new data structure where we can statically define the address offsets for the registers in different SDCC versions. Signed-off-by: Sayali Lokhande Signed-off-by: Vijay Viswanath Reviewed-by: Evan Green Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 26eb2607fa281d98eed28c8c3949f6786695bf7a Author: Masaharu Hayakawa Date: Mon Jun 18 14:57:51 2018 +0200 mmc: renesas_sdhi: add eMMC HS400 mode support This patch adds processing for selecting HS400 mode. Signed-off-by: Masaharu Hayakawa Signed-off-by: Simon Horman Signed-off-by: Ulf Hansson commit db924bba47c8031188545c84bf943f4058b659d0 Author: Masaharu Hayakawa Date: Mon Jun 18 14:57:50 2018 +0200 mmc: tmio: add eMMC HS400 mode support This patch adds processing for selecting HS400 mode. Signed-off-by: Masaharu Hayakawa Signed-off-by: Simon Horman Signed-off-by: Ulf Hansson commit ba6c7ac3a2f421635ae4446269526359d8bff721 Author: Simon Horman Date: Mon Jun 18 14:57:49 2018 +0200 mmc: core: more fine-grained hooks for HS400 tuning This adds two new HS400 tuning operations: * hs400_downgrade * hs400_complete These supplement the existing HS400 operation: * prepare_hs400_tuning This is motivated by a requirement of Renesas SDHI for the following: 1. Disabling SCC before selecting to HS if selection of HS400 has occurred. This can be done in an implementation of prepare_hs400_tuning_downgrade 2. Updating registers after switching to HS400 This can be done in an implementation of complete_hs400_tuning If hs400_downgrade or hs400_complete are not implemented then they are not called. Thus means there should be no affect for existing drivers as none implemt these ops. Signed-off-by: Simon Horman Signed-off-by: Ulf Hansson commit ecf7c7c5855aca18ddde534d7bfff111ce0cb26f Author: Marek Szyprowski Date: Tue Jun 12 12:55:23 2018 +0200 mmc: dw_mmc-exynos: fix potential external abort in resume_noirq() dw_mci_exynos_resume_noirq() performs DWMMC register access without ensuring that respective clocks are enabled. This might cause external abort on some systems (observed on Exynos5433 based boards). Fix this by forcing a PM runtime active state before register access. Using SET_NOIRQ_SYSTEM_SLEEP_PM_OPS allows also to cleanup conditional code a bit. Suggested-by: Ulf Hansson Signed-off-by: Marek Szyprowski Signed-off-by: Ulf Hansson commit 75067aba7afbeca2101f50f78ac1b7c036778c44 Author: Aapo Vienamo Date: Mon Jun 4 18:35:40 2018 +0300 mmc: tegra: Use sdhci_pltfm_clk_get_max_clock The sdhci get_max_clock callback is set to sdhci_pltfm_clk_get_max_clock and tegra_sdhci_get_max_clock is removed. It appears that the shdci-tegra specific callback was originally introduced due to the requirement that the host clock has to be twice the bus clock on DDR50 mode. As far as I can tell the only effect the removal has on DDR50 mode is in cases where the parent clock is unable to supply the requested clock rate, causing the DDR50 mode to run at a lower frequency. Currently the DDR50 mode isn't enabled on any of the SoCs and would also require configuring the SDHCI clock divider register to function properly. The problem with tegra_sdhci_get_max_clock is that it divides the clock rate by two and thus artificially limits the maximum frequency of faster signaling modes which don't have the host-bus frequency ratio requirement of DDR50 such as SDR104 and HS200. Furthermore, the call to clk_round_rate() may return an error which isn't handled by tegra_sdhci_get_max_clock. Signed-off-by: Aapo Vienamo Acked-by: Thierry Reding Tested-by: Thierry Reding Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit a94a7483a91cb6a0d15a4413e8fc853f33a4e1b9 Author: Shawn Lin Date: Wed May 30 10:11:43 2018 +0800 mmc: core: Adjust and reuse the macro of R1_STATUS(x) R1_STATUS(x) now is only used by ioctl_rpmb_card_status_poll(), which checks all bits as possible. But according to the spec, bit 17 and bit 18 should be ignored, as well bit 14 which is reserved(must be set to 0) quoting from the spec and these rule apply to all places checking the device status. So change its checking from 0xFFFFE000 to 0xFFF9A000. As a bonus, we reuse it for mmc_do_erase() as well as mmc_switch_status_error(). (1) Currently mmc_switch_status_error() doesn't check bit 25, but it means device is locked but not unlocked by CMD42 prior to any operations which need check busy, which is also not allowed. (2) mmc_do_erase() also forgot to to check bit 15, WP_ERASE_SKIP. The spec says "Only partial address space was erased due to existing write protected blocks.", which obviously means we should fail this I/O. Otherwise, the partial erased data stored in nonvalatile flash violates the data integrity from the view of I/O owner, which probably confuse it when further used. So reusing R1_STATUS for them not only improve the readability but also slove real problems. Signed-off-by: Shawn Lin Signed-off-by: Ulf Hansson commit 110d2a7fc39725d2c29d2fede4f34a35a4f98882 Author: Vitaly Kuznetsov Date: Mon Jul 9 19:40:12 2018 +0200 x86/hyper-v: Check for VP_INVAL in hyperv_flush_tlb_others() Commit 1268ed0c474a ("x86/hyper-v: Fix the circular dependency in IPI enlightenment") pre-filled hv_vp_index with VP_INVAL so it is now (theoretically) possible to observe hv_cpu_number_to_vp_number() returning VP_INVAL. We need to check for that in hyperv_flush_tlb_others(). Not checking for VP_INVAL on the first call site where we do if (hv_cpu_number_to_vp_number(cpumask_last(cpus)) >= 64) goto do_ex_hypercall; is OK, in case we're eligible for non-ex hypercall we'll catch the issue later in for_each_cpu() cycle and in case we'll be doing ex- hypercall cpumask_to_vpset() will fail. It would be nice to change hv_cpu_number_to_vp_number() return value's type to 'u32' but this will likely be a bigger change as all call sites need to be checked first. Fixes: 1268ed0c474a ("x86/hyper-v: Fix the circular dependency in IPI enlightenment") Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "Michael Kelley (EOSG)" Cc: devel@linuxdriverproject.org Cc: "H. Peter Anvin" Link: https://lkml.kernel.org/r/20180709174012.17429-3-vkuznets@redhat.com commit 0f0caa52cd4a48a44f6cdc77bf83272bbb450727 Author: Vitaly Kuznetsov Date: Mon Jul 9 19:40:11 2018 +0200 x86/hyper-v: Check cpumask_to_vpset() return value in hyperv_flush_tlb_others_ex() Commit 1268ed0c474a ("x86/hyper-v: Fix the circular dependency in IPI enlightenment") made cpumask_to_vpset() return '-1' when there is a CPU with unknown VP index in the supplied set. This needs to be checked before we pass 'nr_bank' to hypercall. Fixes: 1268ed0c474a ("x86/hyper-v: Fix the circular dependency in IPI enlightenment") Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "Michael Kelley (EOSG)" Cc: devel@linuxdriverproject.org Cc: "H. Peter Anvin" Link: https://lkml.kernel.org/r/20180709174012.17429-2-vkuznets@redhat.com commit 2fb166e50e2f1cbf07cbfa1385a7b4bc922813db Merge: 9d3cce1e8b85 399c4129eba6 Author: Ulf Hansson Date: Mon Jul 16 11:17:40 2018 +0200 Merge branch 'next_pxa_dma' into next commit 3273fc63e1ed4866fe10a582f4203f2aa142b216 Author: Neil Armstrong Date: Mon Jul 16 09:40:14 2018 +0200 drm/meson: Make DMT timings parameters and pixel clock generic Remove the modes timings tables for DMT modes and calculate the HW paremeters from the modes timings. Switch the DMT modes pixel clock calculation out of the static frequency list to a generic calculation from a range of possible PLL dividers. This patch is an intermediate step towards usage of the Common Clock Framwework for PLL setup, by reworking the code to have common sel_pll() function called by the CEA (HDMI) freq setup and the generic DMT frequencies setup, we should be able to simply call clk_set_rate() on the PLL clock handle in a near future. The CEA (HDMI) and CVBS modes needs very specific clock paths that CCF will never be able to determine by itself, so there is still some work to do for a full handoff to CCF handling the clocks. This setup permits setting non-CEA modes like : - 1600x900-60Hz - 1280x1024-75Hz - 1280x1024-60Hz - 1440x900-60Hz - 1366x768-60Hz - 1280x800-60Hz - 1152x864-75Hz - 1024x768-75Hz - 1024x768-70Hz - 1024x768-60Hz - 832x624-75Hz - 800x600-75Hz - 800x600-72Hz - 800x600-60Hz - 640x480-75Hz - 640x480-73Hz - 640x480-67Hz Signed-off-by: Neil Armstrong Acked-by: Jerome Brunet [narmstrong: fixed trivial checkpatch issues] Link: https://patchwork.freedesktop.org/patch/msgid/1531726814-14638-1-git-send-email-narmstrong@baylibre.com commit 2ca48895ba984c9b1fa0e725064decfed527811b Author: Frank Wunderlich Date: Mon Jun 25 11:57:13 2018 +0200 arm: dts: mediatek: Fix pio-leds for Bananapi-R2 Pio-leds (near GPIO-Header) are swapped and LOW-active. This patch restores the expected behaviour. Signed-off-by: Frank Wunderlich Reviewed-by: Sean Wang Signed-off-by: Matthias Brugger commit 65f3264177e4c131cc2904739bccb6db9e92c3dc Author: Michael Straube Date: Sat Jul 14 14:52:41 2018 +0200 staging: rtl8188eu: remove redundant header file Both functions declared in rtl8188e_led.h are also declared in rtw_led.h which is included from drv_types.h. Remove rtl8188e_led.h and it's includes. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit cfd707e2f79a1c8c116ae94756717daf960ddf5d Author: Michael Straube Date: Sat Jul 14 14:52:40 2018 +0200 staging: rtl8188eu: add spaces around '+' Add spaces around '+' to follow kernel coding style. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 3cedbfb8519960c56610d308bd3c8c13c71273cc Author: Michael Straube Date: Sat Jul 14 14:52:39 2018 +0200 staging: rtl8188eu: rename variable Rename variable to avoid CamelCase. tmpV16 -> tmpv16 Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit b5a870456fd73a378605332a9f8a2dd6f4932cce Author: Michael Straube Date: Sat Jul 14 14:52:38 2018 +0200 staging: rtl8188eu: rename function parameters Rename function parameters to avoid CamelCase. bWrite -> write PwrState -> pwrstate Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c7279e34cb8f19ffcd4d886dcb1898cccb23e4c4 Author: Michael Straube Date: Sat Jul 14 14:52:37 2018 +0200 staging: rtl8188eu: rename Efuse_PowerSwitch Rename function to avoid CamelCase. Efuse_PowerSwitch -> efuse_power_switch Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 8c6ade2e0c8b42d13d6dd7d4b0c30b11afea98a9 Author: Michael Straube Date: Sat Jul 14 14:52:36 2018 +0200 staging: rtl8188eu: do not line break function definition Do not line break function definition of Efuse_PowerSwitch(). Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 7d6bc56932de5c0b337b783dc837e9d92f24c45e Author: Oliver Hübers Date: Fri Jul 13 15:41:06 2018 +0200 staging: mt7621: Add SPDX license identifier Signed-off-by: Oliver Hübers Signed-off-by: Vanessa Borgmann Signed-off-by: Greg Kroah-Hartman commit 884d5ba53f22bf857cce790d2623dd4f1df34644 Author: Michael Straube Date: Fri Jul 13 20:05:08 2018 +0200 staging: rtl8188eu: remove is_{multicast,broadcast}_mac_addr Remove custom is_multicast_mac_addr() and is_broadcast_mac_addr(). Use is_multicast_ether_addr() instead. By definition the broadcast address is also a multicast address. is_multicast_ether_addr() returns true for broadcast addresses. Hence checking for multicast in the conditional is sufficient. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 16c5b08572565d27866ff6dea30b89184cbe6248 Merge: fa85015c0d95 e74770fb6823 Author: Rafael J. Wysocki Date: Mon Jul 16 10:21:35 2018 +0200 Merge back ACPICA material for v4.19. commit bb4e1ca9b2008c0dc124ec39b68e94964f45e8c0 Author: Oliver Hübers Date: Fri Jul 13 15:41:03 2018 +0200 staging: mt7621-pci: Include preferred headers This fixes the following checkpatch warnings: Use #include instead of Use #include instead of Signed-off-by: Oliver Hübers Signed-off-by: Vanessa Borgmann Signed-off-by: Greg Kroah-Hartman commit 9b59883c14267ccf2c3f9d260bd6fb0dc9478fa1 Author: Cristian Kubis Date: Sun Jul 15 00:25:41 2018 +0200 staging: olpc_dcon: add missing identifier names Add missing function argument identifier names as suggested by checkpatch.pl. Signed-off-by: Cristian Kubis Signed-off-by: Greg Kroah-Hartman commit 0b37913150c93002127e728925353b80677eb5f1 Author: Cristian Kubis Date: Sun Jul 15 00:25:40 2018 +0200 staging: olpc_dcon: prefer 'help' in KConfig Fix for a style warning reported by checkpatch.pl in KConfig suggesting to use 'help' instead of '---help---'. Signed-off-by: Cristian Kubis Signed-off-by: Greg Kroah-Hartman commit 515ce733e86ee2e1bea4dba76d2d4491013d0f73 Author: Ivan Safonov Date: Sat Jul 14 20:54:10 2018 +0300 staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames Put data to skb, decrypt with lib80211_crypt_ccmp, and place back to tx buffer. Signed-off-by: Ivan Safonov Signed-off-by: Greg Kroah-Hartman commit 0d4876f4e977798238db594321db9184704fcf5d Author: Ivan Safonov Date: Sat Jul 14 20:54:09 2018 +0300 staging:r8188eu: Use lib80211 to encrypt (TKIP) tx frames Put data to skb, decrypt with lib80211_crypt_tkip, and place back to tx buffer. MIC calculation will be replaced later. Signed-off-by: Ivan Safonov Signed-off-by: Greg Kroah-Hartman commit b59fb482b52269977ee5de205308e5b236a03917 Author: Thierry Reding Date: Wed May 30 16:06:25 2018 +0200 drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping Depending on the kernel configuration, early ARM architecture setup code may have attached the GPU to a DMA/IOMMU mapping that transparently uses the IOMMU to back the DMA API. Tegra requires special handling for IOMMU backed buffers (a special bit in the GPU's MMU page tables indicates the memory path to take: via the SMMU or directly to the memory controller). Transparently backing DMA memory with an IOMMU prevents Nouveau from properly handling such memory accesses and causes memory access faults. As a side-note: buffers other than those allocated in instance memory don't need to be physically contiguous from the GPU's perspective since the GPU can map them into contiguous buffers using its own MMU. Mapping these buffers through the IOMMU is unnecessary and will even lead to performance degradation because of the additional translation. One exception to this are compressible buffers which need large pages. In order to enable these large pages, multiple small pages will have to be combined into one large (I/O virtually contiguous) mapping via the IOMMU. However, that is a topic outside the scope of this fix and isn't currently supported. An implementation will want to explicitly create these large pages in the Nouveau driver, so detaching from a DMA/IOMMU mapping would still be required. Signed-off-by: Thierry Reding Acked-by: Christoph Hellwig Reviewed-by: Robin Murphy Tested-by: Nicolas Chauvet Signed-off-by: Ben Skeggs commit 1874619a7df4b14b23b14877e705ae15325773e3 Author: Thierry Reding Date: Wed May 30 16:06:24 2018 +0200 ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device() Instead of setting the DMA ops pointer to NULL, set the correct, non-IOMMU ops depending on the device's coherency setting. Signed-off-by: Thierry Reding Reviewed-by: Robin Murphy Acked-by: Russell King Acked-by: Christoph Hellwig Signed-off-by: Ben Skeggs commit 0d466901552a8b4e80cb3c0968e344751c2c9ac3 Author: Kees Cook Date: Thu May 24 10:24:36 2018 -0700 drm/nouveau/secboot/acr: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this allocates the working buffers before starting the writing so it won't abort in the middle. This needs an initial walk of the lists to figure out how large the buffer should be. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Ben Skeggs commit 94a0b8634f4ccb0a512702f96df67914b615d556 Author: Thomas Zimmermann Date: Mon Jun 18 14:53:12 2018 +0200 drm/nouveau: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Ben Skeggs commit 743e0f079a38182cb22e663b34e6a45ad3274b9e Author: Thomas Zimmermann Date: Mon Jun 18 14:53:11 2018 +0200 drm/nouveau: Replace drm_gem_object_unreference_unlocked with put function This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Ben Skeggs commit f066f7950708d889f59545c6c9f426885dcf3dcb Author: Thomas Zimmermann Date: Mon Jun 18 14:53:10 2018 +0200 drm/nouveau: Replace drm_framebuffer_{un/reference} with put, get functions This patch unifies the naming of DRM functions for reference counting of struct drm_framebuffer. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Ben Skeggs commit c9fb2cc84c31910e710cdd8d67a01473170ea67d Author: Nick Desaulniers Date: Fri Jun 15 16:00:42 2018 -0700 drm/nouveau/nvif: remove const attribute from nvif_mclass Similar to commit 0bf8bf50eddc ("module: Remove const attribute from alias for MODULE_DEVICE_TABLE") Fixes many -Wduplicate-decl-specifier warnings due to the combination of const typeof() of already const variables. Signed-off-by: Nick Desaulniers Reviewed-by: Matthias Kaehlcke Signed-off-by: Ben Skeggs commit da71f0efe714ecf71d450f882b94e2acd8e0c3c0 Author: Dan Carpenter Date: Wed Jul 11 11:02:28 2018 +0300 drm/nouveau/hwmon: potential uninitialized variables Smatch complains that "value" can be uninitialized when kstrtol() returns -ERANGE. Signed-off-by: Dan Carpenter Signed-off-by: Ben Skeggs commit 922a8c82fafdec99688bbaea6c5889f562a42cdc Author: Lyude Paul Date: Thu Jul 12 13:02:52 2018 -0400 drm/nouveau: Fix runtime PM leak in drm_open() Noticed this as I was skimming through, if we fail to allocate memory for cli we'll end up returning without dropping the runtime PM ref we got. Additionally, we'll even return the wrong return code! (ret most likely will == 0 here, we want -ENOMEM). Signed-off-by: Lyude Paul Reviewed-by: Lukas Wunner Signed-off-by: Ben Skeggs commit eaeb9010bb4bcdc20e58254fa42f3fe730a7f908 Author: Karol Herbst Date: Sat Jul 14 12:52:09 2018 +0200 drm/nouveau/debugfs: Wake up GPU before doing any reclocking Fixes various reclocking related issues on prime systems. Signed-off-by: Karol Herbst Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs commit f706037c4e135d322160e201872ee3567435035a Author: Karol Herbst Date: Sat Jul 14 12:52:08 2018 +0200 drm/nouveau/bios/vpstate: There are some fermi vbios with no boost or tdp entry If the entry size is too small, default to invalid values for both boost_id and tdp_id, so as to default to the base clock in both cases. Signed-off-by: Karol Herbst Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs commit 2ae4c5f6ff7310e4dcaca4378ddadd881d176693 Author: Mario Kleiner Date: Mon Jul 16 16:47:50 2018 +1000 drm/nouveau/kms/nv50-: Allow vblank_disable_immediate With instantaneous high precision vblank timestamping that updates at leading edge of vblank, the emulated "hw vblank counter" from vblank timestamping, which increments at leading edge of vblank, and reliable page flip execution and completion at leading edge of vblank, we should meet the requirements for fast/ immediate vblank irq disable/enable. This is only allowed on nv50+ gpu's, ie. the ones with atomic modesetting. One requirement for immediate vblank disable is that high precision vblank timestamping works reliably all the time on all connectors. This is not the case on all pre-nv50 parts for analog VGA outputs, where we currently don't always have support for scanout position queries and therefore fall back to vblank interrupt timestamping. The implementation in nv04_head_state() does not return valid values for vblanks, vtotal, hblanks, htotal for VGA outputs on all cards, but those are needed for scanout position queries. Testing on Linux-4.12-rc5 + drm-next on a GeForce 9500 GT (NV G96) with timing measurement equipment indicates this works fine, so allow immediate vblank disable for power saving. For debugging in case of unexpected trouble, booting with kernel cmdline option drm.vblankoffdelay=0 (or echo 0 > /sys/module/drm/parameters/vblankoffdelay) would keep vblank irqs permanently on to approximate old behavior. Signed-off-by: Mario Kleiner Signed-off-by: Ben Skeggs commit 6ec7aecf1f1080d058943d4c44edff470c67679b Author: Ben Skeggs Date: Mon Jun 18 17:53:12 2018 +1000 drm/nouveau/kms/nv50-: remove duplicate assignment Signed-off-by: Ben Skeggs commit 01981aeb4745e31e0842b6f9f98be9b99615db3c Author: kbuild test robot Date: Fri May 18 18:51:32 2018 +0200 drm/nouveau/kms/nv50-: fix drm-get-put.cocci warnings Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and drm_*_unreference() helpers. Generated by: scripts/coccinelle/api/drm-get-put.cocci Fixes: 30ed49b55b6e ("drm/nouveau/kms/nv50-: move code underneath dispnv50/") Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall Signed-off-by: Ben Skeggs commit 7a26c92367a7195277bf663eca69c55b863b4d7b Author: Ben Skeggs Date: Fri Jun 15 08:02:33 2018 +1000 drm/nouveau/disp/nv50-gp10x: fix coverity warning Change values to u32, there's no need for them to be 64-bit. Reported-by: Colin Ian King Suggested-by: Ilia Mirkin Signed-off-by: Ben Skeggs commit f7fbbf2ccaa0f557c4615a5cf3e1e5704585628a Author: Ben Skeggs Date: Fri Jun 15 07:59:28 2018 +1000 drm/nouveau/core: ERR_PTR vs NULL bug in nvkm_engine_info() Reported-by: Dan Carpenter Signed-off-by: Ben Skeggs commit f0fffeeb149e6d1fe05f2c8d6e385c5e82814cff Author: Jérôme Glisse Date: Thu Jun 7 14:18:24 2018 -0400 drm/nouveau/mmu/gp10b: remove ghost file This ghost file have been haunting us. Signed-off-by: Jérôme Glisse Signed-off-by: Ben Skeggs commit 3c9f27eeedb76fb65fc572adbb58d7f4ca154536 Author: Nicolas Chauvet Date: Sun Jun 10 13:01:31 2018 +0200 drm/nouveau/secboot/tegra: Enable gp20b/gp10b firmware tag when relevant This allows to have the related MODULE_FIRMWARE tag only on relevant arch (arm64). This will saves about 400k on initramfs when not relevant Signed-off-by: Nicolas Chauvet Acked-by: Thierry Reding Signed-off-by: Ben Skeggs commit 60cda665724a33af1486d0a84190b384f180bb0e Author: Ben Skeggs Date: Wed Jun 13 15:33:16 2018 +1000 drm/nouveau/fault/gv100: fix fault buffer initialisation Not sure how this happened, it worked last time I tested it! Signed-off-by: Ben Skeggs commit bdf4424dc3b180e40718034a30eced5c1eac8588 Author: Ben Skeggs Date: Wed May 30 15:36:42 2018 +1000 drm/nouveau/gr/gv100: handle multiple SM-per-TPC for shader exceptions Signed-off-by: Ben Skeggs commit 55697cbb44e4f7ea8369f19fa95115dbf066708c Author: Magnus Damm Date: Sun Jun 17 19:42:13 2018 +0900 arm64: dts: renesas: r8a779{65,80,90}: Add IPMMU devices nodes Add IPMMU device nodes for the R-Car M3-N (r8a77965), V3H (r8a77980) and E3 (r8a77990) SoCs. * The r8a77965 IPMMU is quite similar to r8a7796 however VP0 has been added and PV1 has been removed. Also the IMSSTR bit assignment has been reworked. * The r8a77980 IPMMU is quite similar to r8a77970 however VC0 has been added. The IMSSTR bit assignment has also been reworked. Power domains are also quite different however the the documentation is rather unclear about this topic. Until we know better VC0 gets assigned to R8A77980_PD_ALWAYS_ON. * The r8a77990 IPMMU is similar to r8a77995. Power domains are however different and the public documentation is still unclear. Based on preliminary information from the hardware team the R-Car E3 SoC comes with an IPMMU-VP0 device in an Always-on power domain and the IPMMU-VC0 is placed as expected in the A3VC power domain. Signed-off-by: Magnus Damm Signed-off-by: Simon Horman commit aea06eb276d99590f400c877ca2bd74b4db91330 Merge: cc98419a572c b3ccf978132e Author: David S. Miller Date: Mon Jul 16 00:13:40 2018 -0700 Merge branch 'TLS-offload-rx-netdev-and-mlx5' Boris Pismenny says: ==================== TLS offload rx, netdev & mlx5 The following series provides TLS RX inline crypto offload. v5->v4: - Remove the Kconfig to mutually exclude both IPsec and TLS v4->v3: - Remove the iov revert for zero copy send flow v2->v3: - Fix typo - Adjust cover letter - Fix bug in zero copy flows - Use network byte order for the record number in resync - Adjust the sequence provided in resync v1->v2: - Fix bisectability problems due to variable name changes - Fix potential uninitialized return value This series completes the generic infrastructure to offload TLS crypto to a network devices. It enables the kernel TLS socket to skip decryption and authentication operations for SKBs marked as decrypted on the receive side of the data path. Leaving those computationally expensive operations to the NIC. This infrastructure doesn't require a TCP offload engine. Instead, the NIC decrypts a packet's payload if the packet contains the expected TCP sequence number. The TLS record authentication tag remains unmodified regardless of decryption. If the packet is decrypted successfully and it contains an authentication tag, then the authentication check has passed. Otherwise, if the authentication fails, then the packet is provided unmodified and the KTLS layer is responsible for handling it. Out-Of-Order TCP packets are provided unmodified. As a result, in the slow path some of the SKBs are decrypted while others remain as ciphertext. The GRO and TCP layers must not coalesce decrypted and non-decrypted SKBs. At the worst case a received TLS record consists of both plaintext and ciphertext packets. These partially decrypted records must be reencrypted, only to be decrypted. The notable differences between SW KTLS and NIC offloaded TLS implementations are as follows: 1. Partial decryption - Software must handle the case of a TLS record that was only partially decrypted by HW. This can happen due to packet reordering. 2. Resynchronization - tls_read_size calls the device driver to resynchronize HW whenever it lost track of the TLS record framing in the TCP stream. The infrastructure should be extendable to support various NIC offload implementations. However it is currently written with the implementation below in mind: The NIC identifies packets that should be offloaded according to the 5-tuple and the TCP sequence number. If these match and the packet is decrypted and authenticated successfully, then a syndrome is provided to software. Otherwise, the packet is unmodified. Decrypted and non-decrypted packets aren't coalesced by the network stack, and the KTLS layer decrypts and authenticates partially decrypted records. The NIC provides an indication whenever a resync is required. The resync operation is triggered by the KTLS layer while parsing TLS record headers. Finally, we measure the performance obtained by running single stream iperf with two Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz machines connected back-to-back with Innova TLS (40Gbps) NICs. We compare TCP (upper bound) and KTLS-Offload running both in Tx and Rx. The results show that the performance of offload is comparable to TCP. | Bandwidth (Gbps) | CPU Tx (%) | CPU rx (%) TCP | 28.8 | 5 | 12 KTLS-Offload-Tx-Rx | 28.6 | 7 | 14 Paper: https://netdevconf.org/2.2/papers/pismenny-tlscrypto-talk.pdf ==================== Signed-off-by: David S. Miller commit b3ccf978132ed7d0add45ca56e810a36ce7febf3 Author: Boris Pismenny Date: Fri Jul 13 14:33:52 2018 +0300 net/mlx5e: IPsec, fix byte count in CQE This patch fixes the byte count indication in CQE for processed IPsec packets that contain a metadata header. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit 10e71acca28262a9db47ce9b0a10dcd8b38bbdeb Author: Boris Pismenny Date: Fri Jul 13 14:33:51 2018 +0300 net/mlx5: Accel, add common metadata functions This patch adds common functions to handle mellanox metadata headers. These functions are used by IPsec and TLS to process FPGA metadata. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit 790af90c00d277b7fc8bd2ba18fcfa40941bf134 Author: Boris Pismenny Date: Fri Jul 13 14:33:50 2018 +0300 net/mlx5e: TLS, build TLS netdev from capabilities This patch enables TLS Rx based on available HW capabilities. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit afd3baaa938ce85dc738cd9279716cdb684cc707 Author: Boris Pismenny Date: Fri Jul 13 14:33:49 2018 +0300 net/mlx5e: TLS, add software statistics This patch adds software statistics for TLS to count important events. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit 00aebab27c8752c7420dce286270ccedc70ac39a Author: Boris Pismenny Date: Fri Jul 13 14:33:48 2018 +0300 net/mlx5e: TLS, add Innova TLS rx data path Implement the TLS rx offload data path according to the requirements of the TLS generic NIC offload infrastructure. Special metadata ethertype is used to pass information to the hardware. When hardware loses synchronization a special resync request metadata message is used to request resync. Signed-off-by: Boris Pismenny Signed-off-by: Ilya Lesokhin Signed-off-by: David S. Miller commit ca942c78f3237e09567d80ac19dffe9690c74d79 Author: Boris Pismenny Date: Fri Jul 13 14:33:47 2018 +0300 net/mlx5e: TLS, add innova rx support Add the mlx5 implementation of the TLS Rx routines to add/del TLS contexts, also add the tls_dev_resync_rx routine to work with the TLS inline Rx crypto offload infrastructure. Signed-off-by: Boris Pismenny Signed-off-by: Ilya Lesokhin Signed-off-by: David S. Miller commit ab412e1dd7db132c2abeb9385b4bf0dc8e6c5a65 Author: Boris Pismenny Date: Fri Jul 13 14:33:46 2018 +0300 net/mlx5: Accel, add TLS rx offload routines In Innova TLS, TLS contexts are added or deleted via a command message over the SBU connection. The HW then sends a response message over the same connection. Complete the implementation for Innova TLS (FPGA-based) hardware by adding support for rx inline crypto offload. Signed-off-by: Boris Pismenny Signed-off-by: Ilya Lesokhin Signed-off-by: David S. Miller commit 0aadb2fc092910b6db0038b377e130b905ba17e0 Author: Boris Pismenny Date: Fri Jul 13 14:33:45 2018 +0300 net/mlx5e: TLS, refactor variable names For symmetry, we rename mlx5e_tls_offload_context to mlx5e_tls_offload_context_tx before we add mlx5e_tls_offload_context_rx. Signed-off-by: Boris Pismenny Reviewed-by: Aviad Yehezkel Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller commit 4718799817c5a30ae723eda21f3a6c7d8701b1a4 Author: Boris Pismenny Date: Fri Jul 13 14:33:44 2018 +0300 tls: Fix zerocopy_from_iter iov handling zerocopy_from_iter iterates over the message, but it doesn't revert the updates made by the iov iteration. This patch fixes it. Now, the iov can be used after calling zerocopy_from_iter. Fixes: 3c4d75591 ("tls: kernel TLS support") Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit 4799ac81e52a72a6404827bf2738337bb581a174 Author: Boris Pismenny Date: Fri Jul 13 14:33:43 2018 +0300 tls: Add rx inline crypto offload This patch completes the generic infrastructure to offload TLS crypto to a network device. It enables the kernel to skip decryption and authentication of some skbs marked as decrypted by the NIC. In the fast path, all packets received are decrypted by the NIC and the performance is comparable to plain TCP. This infrastructure doesn't require a TCP offload engine. Instead, the NIC only decrypts packets that contain the expected TCP sequence number. Out-Of-Order TCP packets are provided unmodified. As a result, at the worst case a received TLS record consists of both plaintext and ciphertext packets. These partially decrypted records must be reencrypted, only to be decrypted. The notable differences between SW KTLS Rx and this offload are as follows: 1. Partial decryption - Software must handle the case of a TLS record that was only partially decrypted by HW. This can happen due to packet reordering. 2. Resynchronization - tls_read_size calls the device driver to resynchronize HW after HW lost track of TLS record framing in the TCP stream. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit b190a587c634a8559e4ceabeb0468e93db49789a Author: Boris Pismenny Date: Fri Jul 13 14:33:42 2018 +0300 tls: Fill software context without allocation This patch allows tls_set_sw_offload to fill the context in case it was already allocated previously. We will use it in TLS_DEVICE to fill the RX software context. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit 39f56e1a78d647316db330c3b6f4c5637a895e3b Author: Boris Pismenny Date: Fri Jul 13 14:33:41 2018 +0300 tls: Split tls_sw_release_resources_rx This patch splits tls_sw_release_resources_rx into two functions one which releases all inner software tls structures and another that also frees the containing structure. In TLS_DEVICE we will need to release the software structures without freeeing the containing structure, which contains other information. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit dafb67f3bb4a58a45fe92c1e362ea6429831688a Author: Boris Pismenny Date: Fri Jul 13 14:33:40 2018 +0300 tls: Split decrypt_skb to two functions Previously, decrypt_skb also updated the TLS context. Now, decrypt_skb only decrypts the payload using the current context, while decrypt_skb_update also updates the state. Later, in the tls_device Rx flow, we will use decrypt_skb directly. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit d80a1b9d186057ddb0d384ba601cf2b7d214539c Author: Boris Pismenny Date: Fri Jul 13 14:33:39 2018 +0300 tls: Refactor tls_offload variable names For symmetry, we rename tls_offload_context to tls_offload_context_tx before we add tls_offload_context_rx. Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit 41ed9c04aac2f8c6ee922e29ce5e69f185c5125b Author: Boris Pismenny Date: Fri Jul 13 14:33:38 2018 +0300 tcp: Don't coalesce decrypted and encrypted SKBs Prevent coalescing of decrypted and encrypted SKBs in GRO and TCP layer. Signed-off-by: Boris Pismenny Signed-off-by: Ilya Lesokhin Signed-off-by: David S. Miller commit 16e4edc297ffc9b643b8dd3da6b0d579753ea2b3 Author: Boris Pismenny Date: Fri Jul 13 14:33:37 2018 +0300 net: Add TLS rx resync NDO Add new netdev tls op for resynchronizing HW tls context Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit 14136564c8ee94566945e85014019cbdb1716dca Author: Ilya Lesokhin Date: Fri Jul 13 14:33:36 2018 +0300 net: Add TLS RX offload feature This patch adds a netdev feature to configure TLS RX inline crypto offload. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Signed-off-by: David S. Miller commit 784abe24c903b093af04cf1a043140faa556cad7 Author: Boris Pismenny Date: Fri Jul 13 14:33:35 2018 +0300 net: Add decrypted field to skb The decrypted bit is propogated to cloned/copied skbs. This will be used later by the inline crypto receive side offload of tls. Signed-off-by: Boris Pismenny Signed-off-by: Ilya Lesokhin Signed-off-by: David S. Miller commit cc98419a572ccf625bbf6e6fdb8d5ce31f2a9470 Merge: 2aa4a3378ad0 f9d30d5bd57e Author: David S. Miller Date: Mon Jul 16 00:10:01 2018 -0700 Merge branch 'mvpp2-add-debugfs-interface' Maxime Chevallier says: ==================== net: mvpp2: add debugfs interface The PPv2 Header Parser and Classifier are not straightforward to debug, having easy access to some of the many lookup tables configuration is helpful during development and debug. This series adds a basic debugfs interface, allowing to read data from the Header Parser and some of the Classifier tables. For now, the interface is read-only, and contains only some basic info. This was actually used during RSS development, and might be useful to troubleshoot some issues we might find. The first patch of the series converts the mvpp2 files to SPDX, which eases adding the new debugfs dedicated file. The second patch adds the interface, and exposes basic Header Parser data. The 3rd patch adds a hit counter for the Header Parser TCAM. The 4th patch exposes classifier info. The 5th patch adds some hit counters for some of the classifier engines. Changes since V1: - Rebased on the lastest net-next - Made cls_flow_get non static so that it can be used in mvpp2_debugfs ==================== Signed-off-by: David S. Miller commit f9d30d5bd57e6451345b3e021b789f629719923b Author: Maxime Chevallier Date: Sat Jul 14 13:29:28 2018 +0200 net: mvpp2: debugfs: add classifier hit counters The classification operations that are used for RSS make use of several lookup tables. Having hit counters for these tables is really helpful to determine what flows were matched by ingress traffic, and see the path of packets among all the classifier tables. This commit adds hit counters for the 3 tables used at the moment : - The decoding table (also called lookup_id table), that links flows identified by the Header Parser to the flow table. There's one entry per flow, located at : .../mvpp2//flows/XX/dec_hits Note that there are 21 flows in the decoding table, whereas there are 52 flows in the Header Parser. That's because there are several kind of traffic that will match a given flow. Reading the hit counter from one sub-flow will clear all hit counter that have the same flow_id. This also applies to the flow_hits. - The flow table, that contains all the different lookups to be performed by the classifier for each packet of a given flow. The match is done on the first entry of the flow sequence. - The C2 engine entries, that are used to assign the default rx queue, and enable or disable RSS for a given port. There's one entry per flow, located at: .../mvpp2//flows/XX/flow_hits There is one C2 entry per port, so the c2 hit counter is located at : .../mvpp2//ethX/c2_hits All hit counter values are 16-bits clear-on-read values. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit dba1d918da025bf48f3aa004058e565db4d09886 Author: Maxime Chevallier Date: Sat Jul 14 13:29:27 2018 +0200 net: mvpp2: debugfs: add entries for classifier flows The classifier configuration for RSS is quite complex, with several lookup tables being used. This commit adds useful info in debugfs to see how the different tables are configured : Added 2 new entries in the per-port directory : - .../eth0/default_rxq : The default rx queue on that port - .../eth0/rss_enable : Indicates if RSS is enabled in the C2 entry Added the 'flows' directory : It contains one entry per sub-flow. a 'sub-flow' is a unique path from Header Parser to the flow table. Multiple sub-flows can point to the same 'flow' (each flow has an id from 8 to 29, which is its index in the Lookup Id table) : - .../flows/00/... /01/... ... /51/id : The flow id. There are 21 unique flows. There's one flow per combination of the following parameters : - L4 protocol (TCP, UDP, none) - L3 protocol (IPv4, IPv6) - L3 parameters (Fragmented or not) - L2 parameters (Vlan tag presence or not) .../type : The flow type. This is an even higher level flow, that we manipulate with ethtool. It can be : "udp4" "tcp4" "udp6" "tcp6" "ipv4" "ipv6" "other". .../eth0/... .../eth1/engine : The hash generation engine used for this flow on the given port .../hash_opts : The hash generation options indicating on what data we base the hash (vlan tag, src IP, src port, etc.) Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 1203341cc9e858376241b65c17cf6b414b6a0837 Author: Maxime Chevallier Date: Sat Jul 14 13:29:26 2018 +0200 net: mvpp2: debugfs: add hit counter stats for Header Parser entries One helpful feature to help debug the Header Parser TCAM filter in PPv2 is to be able to see if the entries did match something when a packet comes in. This can be done by using the built-in hit counter for TCAM entries. This commit implements reading the counter, and exposing its value on debugfs for each filter entry. The counter is a 16-bits clear-on-read value, located at: .../mvpp2//parser/XXX/hits Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 21da57a23125a072e6ab2bb6c9bea5e02e01d1f5 Author: Maxime Chevallier Date: Sat Jul 14 13:29:25 2018 +0200 net: mvpp2: add a debugfs interface for the Header Parser Marvell PPv2 Packer Header Parser has a TCAM based filter, that is not trivial to configure and debug. Being able to dump TCAM entries from userspace can be really helpful to help development of new features and debug existing ones. This commit adds a basic debugfs interface for the PPv2 driver, focusing on TCAM related features. /mvpp2/ --- f2000000.ethernet \- f4000000.ethernet --- parser --- 000 ... | \- 001 | \- ... | \- 255 --- ai | \- header_data | \- lookup_id | \- sram | \- valid \- eth1 ... \- eth2 --- mac_filter \- parser_entries \- vid_filter There's one directory per PPv2 instance, named after pdev->name to make sure names are uniques. In each of these directories, there's : - one directory per interface on the controller, each containing : - "mac_filter", which lists all filtered addresses for this port (based on TCAM, not on the kernel's uc / mc lists) - "parser_entries", which lists the indices of all valid TCAM entries that have this port in their port map - "vid_filter", which lists the vids allowed on this port, based on TCAM - one "parser" directory (the parser is common to all ports), containing : - one directory per TCAM entry (256 of them, from 0 to 255), each containing : - "ai" : Contains the 1 byte Additional Info field from TCAM, and - "header_data" : Contains the 8 bytes Header Data extracted from the packet - "lookup_id" : Contains the 4 bits LU_ID - "sram" : contains the raw SRAM data, which is the result of the TCAM lookup. This readonly at the moment. - "valid" : Indicates if the entry is valid of not. All entries are read-only, and everything is output in hex form. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit f1e37e3101ee74006a05a290af58a065a838549f Author: Antoine Tenart Date: Sat Jul 14 13:29:24 2018 +0200 net: mvpp2: switch to SPDX identifiers Use the appropriate SPDX license identifiers and drop the license text. This patch is only cosmetic. Signed-off-by: Antoine Tenart Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 500f0716b5f7fd6b0ff3d045588c7588ce2eee1d Merge: 4eb44f69e771 9d3cce1e8b85 Author: Greg Kroah-Hartman Date: Mon Jul 16 09:09:24 2018 +0200 Merge 4.18-rc5 into usb-next We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 956f004a044007ea3b8fb19a525535933bb4f2a4 Merge: bfd727f3a59c 9d3cce1e8b85 Author: Greg Kroah-Hartman Date: Mon Jul 16 09:06:57 2018 +0200 Merge 4.18-rc5 into staging-next We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 83cf9cd6d50ed4f7e6ae265e80e38b235c792f5f Merge: 34bcfdac8c92 9d3cce1e8b85 Author: Greg Kroah-Hartman Date: Mon Jul 16 09:04:54 2018 +0200 Merge 4.18-rc5 into char-misc-next We want the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 2bf1071a8d50928a4ae366bb3108833166c2b70c Author: Nicholas Piggin Date: Thu Jul 5 18:47:00 2018 +1000 powerpc/64s: Remove POWER9 DD1 support POWER9 DD1 was never a product. It is no longer supported by upstream firmware, and it is not effectively supported in Linux due to lack of testing. Signed-off-by: Nicholas Piggin Reviewed-by: Michael Ellerman [mpe: Remove arch_make_huge_pte() entirely] Signed-off-by: Michael Ellerman commit 38ac0287b7f4f3922e25fd8f81db67f2c13d16bb Author: Ard Biesheuvel Date: Wed Jul 11 11:40:40 2018 +0200 fbdev/efifb: Honour UEFI memory map attributes when mapping the FB If the framebuffer address provided by the Graphics Output Protocol (GOP) is covered by the UEFI memory map, it will tell us which memory attributes are permitted when mapping this region. In some cases, (KVM guest on ARM), violating this will result in loss of coherency, which means that updates sent to the framebuffer by the guest will not be observeable by the host, and the emulated display simply does not work. So if the memory map contains such a description, take the attributes field into account, and add support for creating WT or WB mappings of the framebuffer region. Tested-by: Laszlo Ersek Signed-off-by: Ard Biesheuvel Acked-by: Bartlomiej Zolnierkiewicz Cc: Linus Torvalds Cc: Peter Jones Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180711094040.12506-9-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 7e1550b8f2081cccdfa9f1cf1e54cbc4d720af7f Author: Ard Biesheuvel Date: Wed Jul 11 11:40:39 2018 +0200 efi: Drop type and attribute checks in efi_mem_desc_lookup() The current implementation of efi_mem_desc_lookup() includes the following check on the memory descriptor it returns: if (!(md->attribute & EFI_MEMORY_RUNTIME) && md->type != EFI_BOOT_SERVICES_DATA && md->type != EFI_RUNTIME_SERVICES_DATA) { continue; } This means that only EfiBootServicesData or EfiRuntimeServicesData regions are considered, or any other region type provided that it has the EFI_MEMORY_RUNTIME attribute set. Given what the name of the function implies, and the fact that any physical address can be described in the UEFI memory map only a single time, it does not make sense to impose this condition in the body of the loop, but instead, should be imposed by the caller depending on the value that is returned to it. Two such callers exist at the moment: - The BGRT code when running on x86, via efi_mem_reserve() and efi_arch_mem_reserve(). In this case, the region is already known to be EfiBootServicesData, and so the check is redundant. - The ESRT handling code which introduced this function, which calls it both directly from efi_esrt_init() and again via efi_mem_reserve() and efi_arch_mem_reserve() [on x86]. So let's move this check into the callers instead. This preserves the current behavior both for BGRT and ESRT handling, and allows the lookup routine to be reused by other [upcoming] users that don't have this limitation. In the ESRT case, keep the entire condition, so that platforms that deviate from the UEFI spec and use something other than EfiBootServicesData for the ESRT table will keep working as before. For x86's efi_arch_mem_reserve() implementation, limit the type to EfiBootServicesData, since it is the only type the reservation code expects to operate on in the first place. While we're at it, drop the __init annotation so that drivers can use it as well. Tested-by: Laszlo Ersek Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Peter Jones Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180711094040.12506-8-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 3d7ee348aa4127a7893c11261da9b76371a970e6 Author: Ard Biesheuvel Date: Wed Jul 11 11:40:38 2018 +0200 efi/libstub/arm: Add opt-in Kconfig option for the DTB loader There are various ways a platform can provide a device tree binary to the kernel, with different levels of sophistication: - ideally, the UEFI firmware, which is tightly coupled with the platform, provides a device tree image directly as a UEFI configuration table, and typically permits the contents to be manipulated either via menu options or via UEFI environment variables that specify a replacement image, - GRUB for ARM has a 'devicetree' directive which allows a device tree image to be loaded from any location accessible to GRUB, and supersede the one provided by the firmware, - the EFI stub implements a dtb= command line option that allows a device tree image to be loaded from a file residing in the same file system as the one the kernel image was loaded from. The dtb= command line option was never intended to be more than a development feature, to allow the other options to be implemented in parallel. So let's make it an opt-in feature that is disabled by default, but can be re-enabled at will. Note that we already disable the dtb= command line option when we detect that we are running with UEFI Secure Boot enabled. Signed-off-by: Ard Biesheuvel Reviewed-by: Alexander Graf Acked-by: Leif Lindholm Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180711094040.12506-7-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit f5dcc214aae29a68b37b2b4183f7171724e7b02d Author: Sai Praneeth Date: Wed Jul 11 11:40:37 2018 +0200 efi: Remove the declaration of efi_late_init() as the function is unused The following commit: 7b0a911478c74 ("efi/x86: Move the EFI BGRT init code to early init code") ... removed the implementation and all the references to efi_late_init() but the function is still declared at include/linux/efi.h. Hence, remove the unnecessary declaration. Signed-off-by: Sai Praneeth Prakhya Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180711094040.12506-6-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 7bb497092a34a2bbb16bad5385a0487dee18a769 Author: Arnd Bergmann Date: Wed Jul 11 11:40:36 2018 +0200 efi/cper: Avoid using get_seconds() get_seconds() is deprecated because of the 32-bit time overflow in y2038/y2106 on 32-bit architectures. The way it is used in cper_next_record_id() causes an overflow in 2106 when unsigned UTC seconds overflow, even on 64-bit architectures. This starts using ktime_get_real_seconds() to give us more than 32 bits of timestamp on all architectures, and then changes the algorithm to use 39 bits for the timestamp after the y2038 wrap date, plus an always-1 bit at the top. This gives us another 127 epochs of 136 years, with strictly monotonically increasing sequence numbers across boots. This is almost certainly overkill, but seems better than just extending the deadline from 2038 to 2106. Signed-off-by: Arnd Bergmann Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180711094040.12506-5-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 3eb420e70d879ce0e6bf752accf5cdedb0a59de8 Author: Sai Praneeth Date: Wed Jul 11 11:40:35 2018 +0200 efi: Use a work queue to invoke EFI Runtime Services Presently, when a user process requests the kernel to execute any UEFI runtime service, the kernel temporarily switches to a separate set of page tables that describe the virtual mapping of the UEFI runtime services regions in memory. Since UEFI runtime services are typically invoked with interrupts enabled, any code that may be called during this time, will have an incorrect view of the process's address space. Although it is unusual for code running in interrupt context to make assumptions about the process context it runs in, there are cases (such as the perf subsystem taking samples) where this causes problems. So let's set up a work queue for calling UEFI runtime services, so that the actual calls are made when the work queue items are dispatched by a work queue worker running in a separate kernel thread. Such threads are not expected to have userland mappings in the first place, and so the additional mappings created for the UEFI runtime services can never clash with any. The ResetSystem() runtime service is not covered by the work queue handling, since it is not expected to return, and may be called at a time when the kernel is torn down to the point where we cannot expect work queues to still be operational. The non-blocking variants of SetVariable() and QueryVariableInfo() are also excluded: these are intended to be used from atomic context, which obviously rules out waiting for a completion to be signalled by another thread. Note that these variants are currently only used for UEFI runtime services calls that occur very early in the boot, and for ones that occur in critical conditions, e.g., to flush kernel logs to UEFI variables via efi-pstore. Suggested-by: Andy Lutomirski Signed-off-by: Sai Praneeth Prakhya [ardb: exclude ResetSystem() from the workqueue treatment merge from 2 separate patches and rewrite commit log] Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180711094040.12506-4-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 5a58bc1b1edc18a9edff606ec99e6f6b723975f4 Author: Sai Praneeth Date: Wed Jul 11 11:40:34 2018 +0200 efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable() Presently, efi_delete_dummy_variable() uses set_variable() which might block, which the scheduler is rightfully upset about when used from the idle thread, producing this splat: "bad: scheduling from the idle thread!" So, make efi_delete_dummy_variable() use set_variable_nonblocking(), which, as the name suggests, doesn't block. Signed-off-by: Sai Praneeth Prakhya Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180711094040.12506-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit 90a2186b7df183c2fd35f724d0d16a0c10fac9b2 Author: Ingo Molnar Date: Wed Jul 11 11:40:33 2018 +0200 efi/x86: Clean up the eboot code Various small cleanups: - Standardize printk messages: 'alloc' => 'allocate' 'mem' => 'memory' also put variable names in printk messages between quotes. - Align mass-assignments vertically for better readability - Break multi-line function prototypes at the name where possible, not in the middle of the parameter list - Use a newline before return statements consistently. - Use curly braces in a balanced fashion. - Remove stray newlines. No change in functionality. Signed-off-by: Ingo Molnar Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Matt Fleming Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180711094040.12506-2-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar commit bdc9c3e5ed953441a46ef3acd81c783d591c9a96 Author: Masahiro Yamada Date: Mon Jul 9 21:07:21 2018 +0900 x86/build: Remove old -funit-at-a-time GCC quirk The following commit: e501ce957a78 ("x86: Force asm-goto") ... bumped the minimum GCC version to 4.5 for building the x86 kernel. arch/x86/Makefile no longer needs to take care of older GCC versions, such as this pre-4.0 -funit-at-a-time quirk. Signed-off-by: Masahiro Yamada Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: "H. Peter Anvin" Link: http://lkml.kernel.org/r/1531138041-24200-1-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Ingo Molnar commit 788faab70d5a882693286b8d5022779559c79904 Author: Tobias Tefke Date: Mon Jul 9 12:57:15 2018 +0200 perf, tools: Use correct articles in comments Some of the comments in the perf events code use articles incorrectly, using 'a' for words beginning with a vowel sound, where 'an' should be used. Signed-off-by: Tobias Tefke Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: acme@kernel.org Cc: alexander.shishkin@linux.intel.com Cc: jolsa@redhat.com Cc: namhyung@kernel.org Link: http://lkml.kernel.org/r/20180709105715.22938-1-tobias.tefke@tutanota.com [ Fix a few more perf related 'a event' typo fixes from all around the kernel and tooling tree. ] Signed-off-by: Ingo Molnar commit af0fffd9300b97d8875aa745bc78e2f6fdb3c1f0 Author: Sebastian Andrzej Siewior Date: Fri Jul 6 15:06:15 2018 +0200 sched/core: Remove get_cpu() from sched_fork() get_cpu() disables preemption for the entire sched_fork() function. This get_cpu() was introduced in commit: dd41f596cda0 ("sched: cfs core code") ... which also invoked sched_balance_self() and this function required preemption do be off. Today, sched_balance_self() seems to be moved to ->task_fork callback which is invoked while the ->pi_lock is held. set_load_weight() could invoke reweight_task() which then via $callchain might end up in smp_processor_id() but since `update_load' is false this won't happen. I didn't find any this_cpu*() or similar usage during the initialisation of the task_struct. The `cpu' value (from get_cpu()) is only used later in __set_task_cpu() while the ->pi_lock lock is held. Based on this it is possible to remove get_cpu() and use smp_processor_id() for the `cpu' variable without breaking anything. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180706130615.g2ex2kmfu5kcvlq6@linutronix.de Signed-off-by: Ingo Molnar commit 45f5519ec55e75af3565dd737586d3b041834f71 Author: Peter Zijlstra Date: Thu Jul 5 14:36:17 2018 +0200 sched/cpufreq: Clarify sugov_get_util() Add a few comments to (hopefully) clarifying some of the magic in sugov_get_util(). Signed-off-by: Peter Zijlstra (Intel) Acked-by: Viresh Kumar Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vincent Guittot Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Link: http://lkml.kernel.org/r/20180705123617.GM2458@hirez.programming.kicks-ass.net Signed-off-by: Ingo Molnar commit 5fd778915ad29184a5ff8eb82d1118f6916b79e4 Author: Vincent Guittot Date: Thu Jun 28 17:45:14 2018 +0200 sched/sysctl: Remove unused sched_time_avg_ms sysctl /proc/sys/kernel/sched_time_avg_ms entry is not used anywhere, remove it. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Luis R. Rodriguez Cc: Kees Cook Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Cc: viresh.kumar@linaro.org Link: http://lkml.kernel.org/r/1530200714-4504-12-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit bbb62c0b024a1c721232667fa1d625cf6b3a555b Author: Vincent Guittot Date: Thu Jun 28 17:45:13 2018 +0200 sched/core: Remove the rt_avg code rt_avg is not used anywhere anymore, so we can remove all related code. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Cc: viresh.kumar@linaro.org Link: http://lkml.kernel.org/r/1530200714-4504-11-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 523e979d31648112bad07f427c183525c0258c75 Author: Vincent Guittot Date: Thu Jun 28 17:45:12 2018 +0200 sched/core: Use PELT for scale_rt_capacity() The utilization of the CPU by RT, DL and IRQs are now tracked with PELT so we can use these metrics instead of rt_avg to evaluate the remaining capacity available for CFS class. scale_rt_capacity() behavior has been changed and now returns the remaining capacity available for CFS instead of a scaling factor because RT, DL and IRQ provide now absolute utilization value. The same formula as schedutil is used: IRQ util_avg + (1 - IRQ util_avg / max capacity ) * /Sum rq util_avg but the implementation is different because it doesn't return the same value and doesn't benefit of the same optimization. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Cc: viresh.kumar@linaro.org Link: http://lkml.kernel.org/r/1530200714-4504-10-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit dfa444dc2ff62edbaf1ff95ed22dd2ce8a5715da Author: Vincent Guittot Date: Thu Jun 28 17:45:11 2018 +0200 sched/cpufreq: Remove sugov_aggregate_util() There is no reason why sugov_get_util() and sugov_aggregate_util() were in fact separate functions. Signed-off-by: Vincent Guittot [ Rebased after adding irq tracking and fixed some compilation errors. ] Signed-off-by: Peter Zijlstra (Intel) Acked-by: Viresh Kumar Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Link: http://lkml.kernel.org/r/1530200714-4504-9-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 9033ea11889f88f243445495f72441e22256d5e9 Author: Vincent Guittot Date: Thu Jun 28 17:45:10 2018 +0200 cpufreq/schedutil: Take time spent in interrupts into account The time spent executing IRQ handlers can be significant but it is not reflected in the utilization of CPU when deciding to choose an OPP. Now that we have access to this metric, schedutil can take it into account when selecting the OPP for a CPU. RQS utilization don't see the time spend under interrupt context and report their value in the normal context time window. We need to compensate this when adding interrupt utilization The CPU utilization is: IRQ util_avg + (1 - IRQ util_avg / max capacity ) * /Sum rq util_avg A test with iperf on hikey (octo arm64) gives the following speedup: iperf -c server_address -r -t 5 w/o patch w/ patch Tx 276 Mbits/sec 304 Mbits/sec +10% Rx 299 Mbits/sec 328 Mbits/sec +9% 8 iterations stdev is lower than 1% Only WFI idle state is enabled (shallowest idle state). Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Acked-by: Viresh Kumar Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Link: http://lkml.kernel.org/r/1530200714-4504-8-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 91c27493e78df6849baaa21a9d66e26de8b875c0 Author: Vincent Guittot Date: Thu Jun 28 17:45:09 2018 +0200 sched/irq: Add IRQ utilization tracking interrupt and steal time are the only remaining activities tracked by rt_avg. Like for sched classes, we can use PELT to track their average utilization of the CPU. But unlike sched class, we don't track when entering/leaving interrupt; Instead, we take into account the time spent under interrupt context when we update rqs' clock (rq_clock_task). This also means that we have to decay the normal context time and account for interrupt time during the update. That's also important to note that because: rq_clock == rq_clock_task + interrupt time and rq_clock_task is used by a sched class to compute its utilization, the util_avg of a sched class only reflects the utilization of the time spent in normal context and not of the whole time of the CPU. The utilization of interrupt gives an more accurate level of utilization of CPU. The CPU utilization is: avg_irq + (1 - avg_irq / max capacity) * /Sum avg_rq Most of the time, avg_irq is small and neglictible so the use of the approximation CPU utilization = /Sum avg_rq was enough. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Cc: viresh.kumar@linaro.org Link: http://lkml.kernel.org/r/1530200714-4504-7-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 8cc90515a4fa419ccfc4703ff127699cdcb96839 Author: Vincent Guittot Date: Thu Jun 28 17:45:08 2018 +0200 cpufreq/schedutil: Use DL utilization tracking Now that we have both the DL class bandwidth requirement and the DL class utilization, we can detect when CPU is fully used so we should run at max. Otherwise, we keep using the DL bandwidth requirement to define the utilization of the CPU. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Acked-by: Viresh Kumar Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Link: http://lkml.kernel.org/r/1530200714-4504-6-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 3727e0e16340cbdf83818f5bf0113505c6876057 Author: Vincent Guittot Date: Thu Jun 28 17:45:07 2018 +0200 sched/dl: Add dl_rq utilization tracking Similarly to what happens with RT tasks, CFS tasks can be preempted by DL tasks and the CFS's utilization might no longer describes the real utilization level. Current DL bandwidth reflects the requirements to meet deadline when tasks are enqueued but not the current utilization of the DL sched class. We track DL class utilization to estimate the system utilization. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Cc: viresh.kumar@linaro.org Link: http://lkml.kernel.org/r/1530200714-4504-5-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 3ae117c6cd7c4783819a0766aa97b9493a8a0f62 Author: Vincent Guittot Date: Thu Jun 28 17:45:06 2018 +0200 cpufreq/schedutil: Use RT utilization tracking Add both CFS and RT utilization when selecting an OPP for CFS tasks as RT can preempt and steal CFS's running time. RT util_avg is used to take into account the utilization of RT tasks on the CPU when selecting OPP. If a RT task migrate, the RT utilization will not migrate but will decay over time. On an overloaded CPU, CFS utilization reflects the remaining utilization avialable on CPU. When RT task migrates, the CFS utilization will increase when tasks will start to use the newly available capacity. At the same pace, RT utilization will decay and both variations will compensate each other to keep unchanged overall utilization and will prevent any OPP drop. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Acked-by: Viresh Kumar Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Link: http://lkml.kernel.org/r/1530200714-4504-4-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 371bf42732694d142b0de026e152266c039b97d3 Author: Vincent Guittot Date: Thu Jun 28 17:45:05 2018 +0200 sched/rt: Add rt_rq utilization tracking schedutil governor relies on cfs_rq's util_avg to choose the OPP when CFS tasks are running. When the CPU is overloaded by CFS and RT tasks, CFS tasks are preempted by RT tasks and in this case util_avg reflects the remaining capacity but not what CFS want to use. In such case, schedutil can select a lower OPP whereas the CPU is overloaded. In order to have a more accurate view of the utilization of the CPU, we track the utilization of RT tasks. Only util_avg is correctly tracked but not load_avg and runnable_load_avg which are useless for rt_rq. rt_rq uses rq_clock_task and cfs_rq uses cfs_rq_clock_task but they are the same at the root group level, so the PELT windows of the util_sum are aligned. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Cc: viresh.kumar@linaro.org Link: http://lkml.kernel.org/r/1530200714-4504-3-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit c079629862b20c101e8336362a8b042ec7d942fe Author: Vincent Guittot Date: Thu Jun 28 17:45:04 2018 +0200 sched/pelt: Move PELT related code in a dedicated file We want to track rt_rq's utilization as a part of the estimation of the whole rq's utilization. This is necessary because rt tasks can steal utilization to cfs tasks and make them lighter than they are. As we want to use the same load tracking mecanism for both and prevent useless dependency between cfs and rt code, PELT code is moved in a dedicated file. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Cc: viresh.kumar@linaro.org Link: http://lkml.kernel.org/r/1530200714-4504-2-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 8fe5c5a937d0f4e84221631833a2718afde52285 Author: Quentin Perret Date: Tue Jun 12 12:22:15 2018 +0100 sched/fair: Fix util_avg of new tasks for asymmetric systems When a new task wakes-up for the first time, its initial utilization is set to half of the spare capacity of its CPU. The current implementation of post_init_entity_util_avg() uses SCHED_CAPACITY_SCALE directly as a capacity reference. As a result, on a big.LITTLE system, a new task waking up on an idle little CPU will be given ~512 of util_avg, even if the CPU's capacity is significantly less than that. Fix this by computing the spare capacity with arch_scale_cpu_capacity(). Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Acked-by: Vincent Guittot Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: dietmar.eggemann@arm.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Link: http://lkml.kernel.org/r/20180612112215.25448-1-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit be45bf5395e0886a93fc816bbe41a008ec2e42e2 Author: Peter Zijlstra Date: Fri Jul 13 12:42:08 2018 +0200 watchdog/softlockup: Fix cpu_stop_queue_work() double-queue bug When scheduling is delayed for longer than the softlockup interrupt period it is possible to double-queue the cpu_stop_work, causing list corruption. Cure this by adding a completion to track the cpu_stop_work's progress. Reported-by: kernel test robot Tested-by: Rong Chen Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: 9cf57731b63e ("watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work") Link: http://lkml.kernel.org/r/20180713104208.GW2494@hirez.programming.kicks-ass.net Signed-off-by: Ingo Molnar commit fdf2ceb7f58c28639a36f8895006828582a1f5b2 Merge: aef92a8bed25 9d3cce1e8b85 Author: Ingo Molnar Date: Sun Jul 15 23:33:26 2018 +0200 Merge tag 'v4.18-rc5' into sched/core, to pick up fixes Signed-off-by: Ingo Molnar commit 34bcfdac8c92cc7971254ba5856afd12047c50b2 Author: Gustavo A. R. Silva Date: Thu Jul 12 22:29:56 2018 +0100 parport: ieee1284: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman commit faa1a47388b33623e4d504c23569188907b039a0 Author: Julia Lawall Date: Thu Jul 12 22:29:55 2018 +0100 parport: sunbpp: fix error return code Return an error code on failure. Change leading spaces to tab on the first if. Problem found using Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman commit 45cd74cb5061781e793a098c420a7f548fdc9e7d Author: Greg Kroah-Hartman Date: Tue Jul 10 17:15:38 2018 +0200 eventpoll.h: wrap casts in () properly When importing the latest copy of the kernel headers into Bionic, Christpher and Elliott noticed that the eventpoll.h casts were not wrapped in (). As it is, clang complains about macros without surrounding (), so this makes it a pain for userspace tools. So fix it up by adding another () pair, and make them line up purty by using tabs. Fixes: 65aaf87b3aa2 ("add EPOLLNVAL, annotate EPOLL... and event_poll->event") Reported-by: Christopher Ferris Reported-by: Elliott Hughes Cc: stable Cc: Thomas Gleixner Cc: Al Viro Signed-off-by: Greg Kroah-Hartman commit 6da27821a6f5d7648509a37d7d808323e2277431 Author: Anson Huang Date: Wed Jul 11 11:20:43 2018 +0100 nvmem: imx-ocotp: add support for imx6sll i.MX6SLL is a new SoC of i.MX6 family, enable ocotp driver support for this SoC. Signed-off-by: Anson Huang Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit c6e9a33468249a6d47a31d732a54fa3a42129f90 Author: Anson Huang Date: Wed Jul 11 11:20:42 2018 +0100 dt-bindings: nvmem: imx-ocotp: add compatible string for imx6sll Add new compatible string for i.MX6SLL SOC. Signed-off-by: Anson Huang Acked-by: Rob Herring Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 19c54468f222d61f07ec83d13e46a4c78d326c80 Author: Freeman Liu Date: Wed Jul 11 11:20:41 2018 +0100 nvmem: Add Spreadtrum SC27XX efuse support This patch add the efuse driver which is embeded in Spreadtrum SC27XX series PMICs. The sc27xx efuse contains 32 blocks and each block's data width is 16 bits. Signed-off-by: Freeman Liu Signed-off-by: Baolin Wang Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 3eb93e0825abf76ddb7960506be71e6f1a63ad17 Author: Baolin Wang Date: Wed Jul 11 11:20:40 2018 +0100 dt-bindings: nvmem: Add Spreadtrum SC27XX efuse controller documentation This patch adds the binding documentation for Spreadtrum SC27XX series PMICs efuse controller device. Signed-off-by: Baolin Wang Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 5d6bd30cc9c3fca974d554bcd7bbf5f77fbe3238 Author: Wu Hao Date: Sat Jun 30 08:53:36 2018 +0800 MAINTAINERS: add entry for FPGA DFL drivers Add entry for FPGA Device Feature List (DFL) drivers. Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit fa8dda1edef9ebc3af467c644c5533ac97171e12 Author: Wu Hao Date: Sat Jun 30 08:53:35 2018 +0800 fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support DMA memory regions are required for Accelerated Function Unit (AFU) usage. These two ioctls allow user space applications to map user memory regions for dma, and unmap them after use. Iova is returned from driver to user space application via DFL_FPGA_PORT_DMA_MAP ioctl. Application needs to unmap it after use, otherwise, driver will unmap them in device file release operation. Each AFU has its own rb tree to keep track of its mapped DMA regions. Ioctl interfaces: * DFL_FPGA_PORT_DMA_MAP Do the dma mapping per user_addr and length provided by user. Return iova in provided struct dfl_fpga_port_dma_map. * DFL_FPGA_PORT_DMA_UNMAP Unmap the dma region per iova provided by user. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 857a26222ff75eecf7d701ef0e91e4fbf6efa663 Author: Xiao Guangrong Date: Sat Jun 30 08:53:34 2018 +0800 fpga: dfl: afu: add afu sub feature support User Accelerated Function Unit sub feature exposes the MMIO region of the AFU. After valid PR bitstream is programmed and the port is enabled, then this MMIO region could be accessed. This patch adds support to enumerate the AFU MMIO region and expose it to userspace via mmap file operation. Below interfaces are exposed to user: Sysfs interface: * /sys/class/fpga_region///afu_id Read-only. Indicate which PR bitstream is programmed to this AFU. Ioctl interfaces: * DFL_FPGA_PORT_GET_INFO Provide info to userspace on the number of supported region. Only UAFU region is supported now. * DFL_FPGA_PORT_GET_REGION_INFO Provide region information, including access permission, region size, offset from the start of device fd. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 6fd893c409e5939ea2145b27796c155535988734 Author: Wu Hao Date: Sat Jun 30 08:53:33 2018 +0800 fpga: dfl: afu: add DFL_FPGA_GET_API_VERSION/CHECK_EXTENSION ioctls support DFL_FPGA_GET_API_VERSION and DFL_FPGA_CHECK_EXTENSION ioctls are common ones which need to be supported by all feature devices drivers including FME and AFU. This patch implements above 2 ioctls in FPGA Accelerated Function Unit (AFU) driver. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit e4664c0ee4ac44993c62d10b048ab0a960691da5 Author: Wu Hao Date: Sat Jun 30 08:53:32 2018 +0800 fpga: dfl: afu: add header sub feature support The port header register set is always present for port, it is mainly for capability, control and status of the ports that AFU connected to. This patch implements header sub feature support. Below user interfaces are created by this patch. Sysfs interface: * /sys/class/fpga_region///id Read-only. Port ID. Ioctl interface: * DFL_FPGA_PORT_RESET Reset the FPGA Port and its AFU. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 47c1b19c160fe1641469c145dba78fbbe48b996a Author: Wu Hao Date: Sat Jun 30 08:53:31 2018 +0800 fpga: dfl: afu: add port ops support This patch registers the port ops into the global list in the DFL framework, and it allows other modules to use the port ops. And This patch includes the implementation of the get_id and enable_set ops too. Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 1a1527cf5ddacc6716a3cacfa232111d92ffd93b Author: Wu Hao Date: Sat Jun 30 08:53:30 2018 +0800 fpga: dfl: add FPGA Accelerated Function Unit driver basic framework On DFL FPGA devices, the Accelerated Function Unit (AFU), can be reprogrammed for different functions. It connects to the FPGA infrastructure (static FPGA region) via a Port. Port CSRs are implemented separately from the AFU CSRs to provide control and status of the Port. Once valid PR bitstream is programmed into the AFU, it allows access to the AFU CSRs in the AFU MMIO space. This patch only implements basic driver framework for AFU, including device file operation framework. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 7514a4249c479c0b56a112306496a9aa3bad312b Author: Wu Hao Date: Sat Jun 30 08:53:29 2018 +0800 fpga: dfl: fme-region: add support for compat_id This patch adds compat_id support, it reuses fme manager's compat id, as the per region compat id is actually from the fme manager's register. Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit bb61b9be3e6b001f1571b230316bf3867dc41df3 Author: Wu Hao Date: Sat Jun 30 08:53:28 2018 +0800 fpga: dfl: add fpga region platform driver for FME This patch adds fpga region platform driver for FPGA Management Engine. It register an fpga region with given fpga manager / bridge device. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit de892dff17b36d138ff41aeb46366d7c1ed4cd77 Author: Wu Hao Date: Sat Jun 30 08:53:27 2018 +0800 fpga: dfl: add fpga bridge platform driver for FME This patch adds fpga bridge platform driver for FPGA Management Engine. It implements the enable_set callback for fpga bridge. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit 5ebae801d960d46e39574cb83ec24ab44d1a6c2a Author: Wu Hao Date: Sat Jun 30 08:53:26 2018 +0800 fpga: dfl: fme-mgr: add compat_id support This patch adds compat_id support to fme manager driver, it reads the ID from the hardware register. And it could be used for compatibility check before partial reconfiguration. Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit af275ec6160ba68714371cfe0575f9aa478ce02f Author: Wu Hao Date: Sat Jun 30 08:53:25 2018 +0800 fpga: dfl: add fpga manager platform driver for FME This patch adds fpga manager driver for FPGA Management Engine (FME). It implements fpga_manager_ops for FPGA Partial Reconfiguration function. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Kang Luwei Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 29de76240e861d52b75405166337e94184f1875d Author: Kang Luwei Date: Sat Jun 30 08:53:24 2018 +0800 fpga: dfl: fme: add partial reconfiguration sub feature support Partial Reconfiguration (PR) is the most important function for FME. It allows reconfiguration for given Port/Accelerated Function Unit (AFU). It creates platform devices for fpga-mgr, fpga-regions and fpga-bridges, and invokes fpga-region's interface (fpga_region_program_fpga) for PR operation once PR request received via ioctl. Below user space interface is exposed by this sub feature. Ioctl interface: * DFL_FPGA_FME_PORT_PR Do partial reconfiguration per information from userspace, including target port(AFU), buffer size and address info. It returns error code to userspace if failed. For detailed PR error information, user needs to read fpga-mgr's status sysfs interface. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Kang Luwei Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 620e1902f6fe57ddacdabd9e33fadbd290be9652 Author: Wu Hao Date: Sat Jun 30 08:53:23 2018 +0800 fpga: dfl: fme: add DFL_FPGA_GET_API_VERSION/CHECK_EXTENSION ioctls support DFL_FPGA_GET_API_VERSION and DFL_FPGA_CHECK_EXTENSION ioctls are common ones which need to be supported by all feature devices drivers including FME and AFU. Userspace application can use these ioctl interfaces to get the API info and check if specific extension is supported or not in current driver. This patch implements above 2 ioctls in FPGA Management Engine (FME) driver. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit 0a27ff24d59662b1ca8b3f7721a965918f115074 Author: Kang Luwei Date: Sat Jun 30 08:53:22 2018 +0800 fpga: dfl: fme: add header sub feature support The Header Register set is always present for FPGA Management Engine (FME), this patch implements init and uinit function for header sub feature and introduces several read-only sysfs interfaces for the capability and status. Sysfs interfaces: * /sys/class/fpga_region///ports_num Read-only. Number of ports implemented * /sys/class/fpga_region///bitstream_id Read-only. Bitstream (static FPGA region) identifier number. It contains the detailed version and other information of this static FPGA region. * /sys/class/fpga_region///bitstream_metadata Read-only. Bitstream (static FPGA region) meta data. It contains the synthesis date, seed and other information of this static FPGA region. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Kang Luwei Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 322ddebe54ae2b18c86a3bffb2b76bc5e67762ac Author: Kang Luwei Date: Sat Jun 30 08:53:21 2018 +0800 fpga: dfl: add FPGA Management Engine driver basic framework The FPGA Management Engine (FME) provides power, thermal management, performance counters, partial reconfiguration and other functions. For each function, it is packaged into a private feature linked to the FME feature device in the 'Device Feature List'. It's a platform device created by DFL framework. This patch adds the basic framework of FME platform driver. It defines sub feature drivers to handle the different sub features, including init, uinit and ioctl. It also registers the file operations for the device file. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Kang Luwei Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit 968b8199e2585ac4435e2b73af81201e20859c36 Author: Wu Hao Date: Sat Jun 30 08:53:20 2018 +0800 fpga: dfl-pci: add enumeration for feature devices The Device Feature List (DFL) is implemented in MMIO and features are linked via the DFLs. This patch enables pcie driver to prepare enumeration information (e.g. locations of all device feature lists in MMIO) and use common APIs provided by the Device Feature List framework to enumerate each feature device linked. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Zhang Yi Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 72ddd9f34040a49a221c0d5d1754061e007a10e6 Author: Zhang Yi Date: Sat Jun 30 08:53:19 2018 +0800 fpga: add FPGA DFL PCIe device driver This patch implements the basic framework of the driver for FPGA PCIe device which implements the Device Feature List (DFL) in its MMIO space. This driver is verified on Intel(R) PCIe-based FPGA DFL devices, including both integrated (e.g. Intel Server Platform with In-package FPGA) and discrete (e.g. Intel FPGA PCIe Acceleration Cards) solutions. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Zhang Yi Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit d06b004b99c960828523e581a3b7d109dfc1329b Author: Wu Hao Date: Sat Jun 30 08:53:18 2018 +0800 fpga: dfl: add dfl_fpga_check_port_id function. This patch adds one common function in DFL framework. It uses port_ops get_id callback to get port id and compare it with given value. This function could be used as match function of the dfl_fpga_cdev_find_port function. Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 6e8fd6e493bfca83021cc6a8fd86d7f69bd14fc6 Author: Wu Hao Date: Sat Jun 30 08:53:17 2018 +0800 fpga: dfl: add dfl_fpga_port_ops support. In some cases, other DFL driver modules may need to access some port operations, e.g. disable / enable port for partial reconfiguration in FME module. In order to avoid dependency between port and FME modules, this patch introduces the dfl_fpga_port_ops support in DFL framework. A global dfl_fpga_port_ops list is added in the DFL framework, and it allows other DFL modules to use these port operations registered to this list, even in virtualization case, the port platform device is turned into VF / guest VM and hidden in host, the registered port_ops is still usable. It resolves the dependency issues between modules, but once get port ops API returns a valid port ops, that means related port driver module has been module_get to prevent from unexpected unload, and put port ops API must be invoked after use. These APIs introduced by this patch is listed below: * dfl_fpga_port_ops_add add one port ops to the global list. * dfl_fpga_port_ops_del del one port ops from the global list. * dfl_fpga_port_ops_get / dfl_fpga_port_ops_put get/put the port ops before/after use. Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 5b57d02a2f94bb04c6b36932412f7f3b1bb38518 Author: Xiao Guangrong Date: Sat Jun 30 08:53:16 2018 +0800 fpga: dfl: add feature device infrastructure This patch abstracts the common operations of the sub features and defines the feature_ops data structure, including init, uinit and ioctl function pointers. And this patch adds some common helper functions for FME and AFU drivers, e.g. dfl_feature_dev_use_begin/end which are used to ensure exclusive usage of the feature device file. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Kang Luwei Signed-off-by: Zhang Yi Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 5d56e117001996766c3dab5767663b0c43b76639 Author: Wu Hao Date: Sat Jun 30 08:53:15 2018 +0800 fpga: dfl: add dfl_fpga_cdev_find_port For feature devices, we need a method to find the port dedicated to the device. This patch adds a function dfl_fpga_cdev_find_port for this purpose. e.g. FPGA Management Engine (FME) Partial Reconfiguration sub feature, it uses this function to find dedicated port on the device for PR function implementation. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit b16c5147dc3b1a03405f58f6864b56f29ab7aaf9 Author: Wu Hao Date: Sat Jun 30 08:53:14 2018 +0800 fpga: dfl: add chardev support for feature devices For feature devices drivers, both the FPGA Management Engine (FME) and Accelerated Function Unit (AFU) driver need to expose user interfaces via the device file, for example, mmap and ioctls. This patch adds chardev support in the dfl driver for feature devices, FME and AFU. It reserves the chardev regions for FME and AFU and provide interfaces for FME and AFU driver to register their device file operations. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Zhang Yi Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 543be3d8c999b30e1e1c05d30c1ea3f2d922340b Author: Wu Hao Date: Sat Jun 30 08:53:13 2018 +0800 fpga: add device feature list support Device Feature List (DFL) defines a feature list structure that creates a linked list of feature headers within the MMIO space to provide an extensible way of adding features. This patch introduces a kernel module to provide basic infrastructure to support FPGA devices which implement the Device Feature List. Usually there will be different features and their sub features linked into the DFL. This code provides common APIs for feature enumeration, it creates a container device (FPGA base region), walks through the DFLs and creates platform devices for feature devices (Currently it only supports two different feature devices, FPGA Management Engine (FME) and Port which the Accelerator Function Unit (AFU) connected to). In order to enumerate the DFLs, the common APIs required low level driver to provide necessary enumeration information (e.g. address for each device feature list for given device) and fill it to the dfl_fpga_enum_info data structure. Please refer to below description for APIs added for enumeration. Functions for enumeration information preparation: *dfl_fpga_enum_info_alloc allocate enumeration information data structure. *dfl_fpga_enum_info_add_dfl add a device feature list to dfl_fpga_enum_info data structure. *dfl_fpga_enum_info_free free dfl_fpga_enum_info data structure and related resources. Functions for feature device enumeration: *dfl_fpga_feature_devs_enumerate enumerate feature devices and return container device. *dfl_fpga_feature_devs_remove remove feature devices under given container device. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Zhang Yi Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit 41a8b2c56470b7e4e3e2db93324d50bbbf60cdc4 Author: Wu Hao Date: Sat Jun 30 08:53:12 2018 +0800 fpga: region: add compat_id support This patch introduces a compat_id pointer member and sysfs interface for each fpga region, similar as compat_id for fpga manager, it allows applications to read the per region compat_id for compatibility checking before other actions on this fpga-region (e.g. PR). Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit 99a560bde313892f87ca81db568a829d3d205882 Author: Wu Hao Date: Sat Jun 30 08:53:11 2018 +0800 fpga: mgr: add compat_id support This patch introduces compat_id support to fpga manager, it adds a fpga_compat_id pointer to fpga manager data structure to allow fpga manager drivers to save the compatibility id. This compat_id could be used for compatibility checking before doing partial reconfiguration to associated fpga regions. Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit ecb5fbe299dfaad778033259f35bc696fa1fb743 Author: Wu Hao Date: Sat Jun 30 08:53:10 2018 +0800 fpga: mgr: add status for fpga-manager This patch adds status sysfs interface for fpga manager, it's a read only interface which allows user to get fpga manager status, including full/partial reconfiguration error and other status information. It adds a status callback to fpga_manager_ops too, allows each fpga_manager driver to define its own method to collect latest status from hardware. The following sysfs file is created: * /sys/class/fpga_manager//status Return status of fpga manager, including reconfiguration errors. Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman commit 571d78bd458a831cf51dff2afa1dda3309bd82b2 Author: Wu Hao Date: Sat Jun 30 08:53:09 2018 +0800 fpga: mgr: add region_id to fpga_image_info This patch adds region_id to fpga_image_info data structure, it allows driver to pass region id information to fpga-mgr via fpga_image_info for fpga reconfiguration function. Signed-off-by: Wu Hao Acked-by: Moritz Fischer Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit c73c9ad286ab01bdd23076e6751d463d9ea18f44 Author: Wu Hao Date: Sat Jun 30 08:53:08 2018 +0800 docs: fpga: add a document for FPGA Device Feature List (DFL) Framework Overview Add a document for FPGA Device Feature List (DFL) Framework Overview. Signed-off-by: Enno Luebbers Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Signed-off-by: Greg Kroah-Hartman commit ccff2dfaceaca4517432f5c149594215fe9098cc Author: Robin Murphy Date: Wed Jul 11 13:40:35 2018 -0600 coresight: tpiu: Fix disabling timeouts Probing the TPIU driver under UBSan triggers an out-of-bounds shift warning in coresight_timeout(): ... [ 5.677530] UBSAN: Undefined behaviour in drivers/hwtracing/coresight/coresight.c:929:16 [ 5.685542] shift exponent 64 is too large for 64-bit type 'long unsigned int' ... On closer inspection things are exponentially out of whack because we're passing a bitmask where a bit number should be. Amusingly, it seems that both calls will find their expected values by sheer luck and appear to succeed: 1 << FFCR_FON_MAN ends up at bit 64 which whilst undefined evaluates as zero in practice, while 1 << FFSR_FT_STOPPED finds bit 2 (TCPresent) which apparently is usually tied high. Following the examples of other drivers, define separate FOO and FOO_BIT macros for masks vs. indices, and put things right. CC: Robert Walker CC: Mike Leach CC: Mathieu Poirier Fixes: 11595db8e17f ("coresight: Fix disabling of CoreSight TPIU") Signed-off-by: Robin Murphy Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 434d611cddef1ceed32bf416a363992b01a3ff9a Author: Suzuki K Poulose Date: Wed Jul 11 13:40:34 2018 -0600 coresight: catu: Plug in CATU as a backend for ETR buffer Now that we can use a CATU with a scatter gather table, add support for the TMC ETR to make use of the connected CATU in translate mode. This is done by adding CATU as new buffer mode. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 8ed536b1e2838dad4f495347f0917b1cb6e3604f Author: Suzuki K Poulose Date: Wed Jul 11 13:40:33 2018 -0600 coresight: catu: Add support for scatter gather tables This patch adds the support for setting up a SG table for use by the CATU. We reuse the tmc_sg_table to represent the table/data pages, even though the table format is different. Similar to ETR SG table, CATU uses a 4KB page size for data buffers as well as page tables. All table entries are 64bit wide and have the following format: 63 12 1 0 x-----------------------------------x | Address [63-12] | SBZ | V | x-----------------------------------x Where [V] -> 0 - Pointer is invalid 1 - Pointer is Valid CATU uses only first half of the page for data page pointers. i.e, single table page will only have 256 page pointers, addressing upto 1MB of data. The second half of a table page contains only two pointers at the end of the page (i.e, pointers at index 510 and 511), which are used as links to the "Previous" and "Next" page tables respectively. The first table page has an "Invalid" previous pointer and the next pointer entry points to the second page table if there is one. Similarly the last table page has an "Invalid" next pointer to indicate the end of the table chain. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit a59e5ff928d2f909277017029117fd001207fed0 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:32 2018 -0600 dts: bindings: Document device tree binding for CATU Document CATU device-tree bindings. CATU augments the TMC-ETR by providing an improved Scatter Gather mechanism for streaming trace data to non-contiguous system RAM pages. Cc: devicetree@vger.kernel.org Cc: frowand.list@gmail.com Cc: Mark Rutland Cc: Mathieu Poirier Reviewed-by: Rob Herring Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit fcacb5c154baaeaee3d89b2a2b7cf6e4ce43f5f5 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:31 2018 -0600 coresight: Introduce support for Coresight Address Translation Unit Add the initial support for Coresight Address Translation Unit, which augments the TMC in Coresight SoC-600 by providing an improved Scatter Gather mechanism. CATU is always connected to a single TMC-ETR and converts the AXI address with a translated address (from a given SG table with specific format). The CATU should be programmed in pass through mode and enabled even if the ETR doesn't use the translation by CATU. This patch provides mechanism to enable/disable the CATU always in the pass through mode. We reuse the existing ports mechanism to link the TMC-ETR to the connected CATU. i.e, TMC-ETR:output_port0 -> CATU:input_port0 Reference manual for CATU component is avilable in version r2p0 of : "Arm Coresight System-on-Chip SoC-600 Technical Reference Manual". Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 8a091d847cecd1a3656172cb79b53a19e90b8c4f Author: Suzuki K Poulose Date: Wed Jul 11 13:40:30 2018 -0600 coresight: Add helper device type Add a new coresight device type, which do not belong to any of the existing types, i.e, source, sink, link etc. A helper device could be connected to a coresight device, which could augment the functionality of the coresight device. This is intended to cover Coresight Address Translation Unit (CATU) devices, which provide improved Scatter Gather mechanism for TMC ETR. The idea is that the helper device could be controlled by the driver of the device it is attached to (in this case ETR), transparent to the generic coresight driver (and paths). The operations include enable(), disable(), both of which could accept a device specific "data" which the driving device and the helper device could share. Since they don't appear in the coresight "path" tracked by software, we have to ensure that they are powered up/down whenever the master device is turned on. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 00b78e8b7b003c686a8570df7d231787f514226c Author: Suzuki K Poulose Date: Wed Jul 11 13:40:29 2018 -0600 coresight: Cleanup device subtype struct Clean up our struct a little bit by using a union instead of a struct for tracking the subtype of a device. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit fe470f5f7f684ed15bc49b6183a64237547910ff Author: Suzuki K Poulose Date: Wed Jul 11 13:40:28 2018 -0600 coresight: Handle errors in finding input/output ports If we fail to find the input / output port for a LINK component while enabling a path, we should fail gracefully rather than assuming port "0". Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 575694978247b7cc1588ec233bde3fbf66db9e50 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:27 2018 -0600 coresight: Cleanup platform description data Nobody uses the "clk" field in struct coresight_platform_data. Remove it. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 00ea1970298677e31ed8f962bda663cfc4848481 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:26 2018 -0600 coresight: Fix check in coresight_tmc_etr_buf_insert_barrier_packet We request for "CORESIGHT_BARRIER_PKT_SIZE" length and we should be happy when we get that size. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit a748ddd1132c79888390934216ef428e0b2f0ea8 Author: Arnd Bergmann Date: Wed Jul 11 13:40:25 2018 -0600 coresight: include vmalloc.h for vmap/vunmap The newly introduced code fails to build in some configurations unless we include the right headers: drivers/hwtracing/coresight/coresight-tmc-etr.c: In function 'tmc_free_table_pages': drivers/hwtracing/coresight/coresight-tmc-etr.c:206:3: error: implicit declaration of function 'vunmap'; did you mean 'iounmap'? [-Werror=implicit-function-declaration] Fixes: 79613ae8715a ("coresight: Add generic TMC sg table framework") Signed-off-by: Arnd Bergmann Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit c34cc23f1dcb77c66b5cd074f83dee61bfcbe567 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:24 2018 -0600 coresight: tmc: Add configuration support for trace buffer size Now that we can dynamically switch between contiguous memory and SG table depending on the trace buffer size, provide the support for selecting an appropriate buffer size. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Acked-by: Rob Herring Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit e8e3b771395d9b75ba5da409b7d20435ddb05a21 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:23 2018 -0600 coresight: tmc-etr buf: Add TMC scatter gather mode backend Add the support for Scatter-Gather mode to the etr-buf layer. Since we now have two different modes, we choose the backend based on a set of conditions, documented in the code. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 75f4e3619fe202c642080a798e84d05288522a22 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:22 2018 -0600 coresight: tmc-etr: Add transparent buffer management The TMC-ETR can use the target trace buffer in two different modes. Normal physically contiguous mode and a discontiguous list pages in Scatter-Gather mode. Also we have dedicated Coresight component, CATU (Coresight Address Translation Unit) to provide improved scatter-gather mode in Coresight SoC-600. This complicates the management of the buffer used for trace, depending on the mode in which ETR is configured. So, this patch adds a transparent layer for managing the ETR buffer which abstracts the basic operations on the buffer (alloc, free, sync and retrieve the data) and uses the mode specific helpers to do the actual operation. This also allows the ETR driver to choose the best mode for a given use case and adds the flexibility to fallback to a different mode, without duplicating the code. The patch also adds the "normal" flat memory mode and switches the sysfs driver to use the new layer. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 260ec24b31a596361b617e6993ee9a31c43f278c Author: Suzuki K Poulose Date: Wed Jul 11 13:40:21 2018 -0600 coresight: Add support for TMC ETR SG unit This patch adds support for setting up an SG table used by the TMC ETR inbuilt SG unit. The TMC ETR uses 4K page sized tables to hold pointers to the 4K data pages with the last entry in a table pointing to the next table with the entries, by kind of chaining. The 2 LSBs determine the type of the table entry, to one of : Normal - Points to a 4KB data page. Last - Points to a 4KB data page, but is the last entry in the page table. Link - Points to another 4KB table page with pointers to data. The code takes care of handling the system page size which could be different than 4K. So we could end up putting multiple ETR SG tables in a single system page, vice versa for the data pages. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 99443ea19e8bb0fee5fb6f4ed9cec11fd825061f Author: Suzuki K Poulose Date: Wed Jul 11 13:40:20 2018 -0600 coresight: Add generic TMC sg table framework This patch introduces a generic sg table data structure and associated operations. An SG table can be used to map a set of Data pages where the trace data could be stored by the TMC ETR. The information about the data pages could be stored in different formats, depending on the type of the underlying SG mechanism (e.g, TMC ETR SG vs Coresight CATU). The generic structure provides book keeping of the pages used for the data as well as the table contents. The table should be filled by the user of the infrastructure. A table can be created by specifying the number of data pages as well as the number of table pages required to hold the pointers, where the latter could be different for different types of tables. The pages are mapped in the appropriate dma data direction mode (i.e, DMA_TO_DEVICE for table pages and DMA_FROM_DEVICE for data pages). The framework can optionally accept a set of allocated data pages (e.g, perf ring buffer) and map them accordingly. The table and data pages are vmap'ed to allow easier access by the drivers. The framework also provides helpers to sync the data written to the pages with appropriate directions. This will be later used by the TMC ETR SG unit and CATU. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit ed2cfb2b3cd8f32419c0abea6cd4648ff99fca86 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:19 2018 -0600 dts: bindings: Restrict coresight tmc-etr scatter-gather mode We are about to add the support for ETR builtin scatter-gather mode for dealing with large amount of trace buffers. However, on some of the platforms, using the ETR SG mode can lock up the system due to the way the ETR is connected to the memory subsystem. In SG mode, the ETR performs READ from the scatter-gather table to fetch the next page and regular WRITE of trace data. If the READ operation doesn't complete(due to the memory subsystem issues, which we have seen on a couple of platforms) the trace WRITE cannot proceed leading to issues. So, we by default do not use the SG mode, unless it is known to be safe on the platform. We define a DT property for the TMC node to specify whether we have a proper SG mode. Cc: Mathieu Poirier Cc: Mike Leach Cc: Mark Rutland Cc: John Horley Cc: Robert Walker Cc: devicetree@vger.kernel.org Cc: frowand.list@gmail.com Reviewed-by: Rob Herring Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 6f755e85c332de532d1bbcf1c9769aad08e8cb41 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:18 2018 -0600 coresight: Add helper for inserting synchronization packets Right now we open code filling the trace buffer with synchronization packets when the circular buffer wraps around in different drivers. Move this to a common place. While at it, clean up the barrier_pkt array to strip off the trailing '\0'. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit ef32df53b73bd29d5bfa4af4fda287baa6dc6544 Author: Suzuki K Poulose Date: Wed Jul 11 13:40:17 2018 -0600 coresight: tmc-etr: Disallow perf mode We don't support ETR in perf mode yet. So, don't even try to enable the hardware, even by mistake. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 0f728a7f9f8fed5dfd86a628d871d572cb91942c Author: Suzuki K Poulose Date: Wed Jul 11 13:40:16 2018 -0600 coresight: tmc-etr: Do not clean trace buffer We zero out the entire trace buffer used for ETR before it is enabled, for helping with debugging. With the addition of scatter-gather mode, the buffer could be bigger and non-contiguous. Get rid of this step; if someone wants to debug, they can always add it as and when needed. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 3495722a0093c80f66c020f90161983b46a1f5ee Author: Suzuki K Poulose Date: Wed Jul 11 13:40:15 2018 -0600 coresight: tmc: Hide trace buffer handling for file read At the moment we adjust the buffer pointers for reading the trace data via misc device in the common code for ETF/ETB and ETR. Since we are going to change how we manage the buffer for ETR, let us move the buffer manipulation to the respective driver files, hiding it from the common code. We do so by adding type specific helpers for finding the length of data and the pointer to the buffer, for a given length at a file position. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 5cedd22370a0a460b663c06de1fc10b4ba3c5d0b Author: Suzuki K Poulose Date: Wed Jul 11 13:40:14 2018 -0600 coresight: ETM: Add support for Arm Cortex-A73 and Cortex-A35 Add ETM PIDs of the Arm cortex-A CPUs to the white list of ETMs. While at it add a helper macro to make it easier to add the new entries. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman commit 25b4a2b909dc9fdd141ee4239cf78d1617a9d91d Author: Mathieu Poirier Date: Wed Jul 11 13:40:13 2018 -0600 coresight: Remove function coresight_vpid_to_pid() Now that we prevent users from using contextID tracing when PID namespaces are involved there is no client for function coresight_vpid_to_pid(). As such simply remove it. Signed-off-by: Mathieu Poirier Reviewed-by: Kim Phillips Acked-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman commit 450367f06ef310af15f6424376ce9d5c7879c2d1 Author: Mathieu Poirier Date: Wed Jul 11 13:40:12 2018 -0600 coresight: etm4x: Don't use contextID with PID namespaces As with ETM3x, the ETM4x tracers can trigger trace acquisition based on contextID value, something that isn't useful when PID namespaces are enabled. Indeed the PID value of a process has a different representation in the kernel and the PID namespace, making the feature confusing and potentially leaking internal kernel information. As such simply return an error when the feature is being used from a PID namespace other than the default one. Signed-off-by: Mathieu Poirier Reviewed-by: Kim Phillips Acked-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman commit 7bd50ccf001f77db236af51797579359b09e2354 Author: Mathieu Poirier Date: Wed Jul 11 13:40:11 2018 -0600 coresight: etm3x: Don't use contextID with PID namespaces Tracers can trigger trace acquisition based on contextID value, something that isn't useful when PID namespaces are enabled. Indeed the PID value of a process has a different representation in the kernel and the PID namespace, making the feature confusing and potentially leaking internal kernel information. As such simply return an error when the feature is being used from a PID namespace other than the default one. Signed-off-by: Mathieu Poirier Reviewed-by: Kim Phillips Acked-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman commit cd570e6fa43a5ed061b91e64dc507a6ac54fac95 Author: Dominique Martinet Date: Fri Jul 13 03:25:34 2018 +0200 iio: change strncpy+truncation to strlcpy Generated by scripts/coccinelle/misc/strncpy_truncation.cocci Signed-off-by: Dominique Martinet Signed-off-by: Jonathan Cameron commit 76d8ca245c721c12f79779679699b229e361f4ac Author: Sean Wang Date: Mon Jul 9 23:56:58 2018 +0800 serdev: add dev_pm_domain_attach|detach() In order to open up the required power gate before any operation can be effectively performed over the serial bus between CPU and serdev, it's clearly essential to add common attach functions for PM domains to serdev at the probe phase. Similarly, the relevant dettach function for the PM domains should be properly and reversely added at the remove phase. Signed-off-by: Sean Wang Reviewed-by: Ulf Hansson Reviewed-by: Johan Hovold Cc: Rob Herring Cc: Ulf Hansson Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 6c26fcd2abfe0a56bbd95271fce02df2896cfd24 Author: Jiri Kosina Date: Sat Jul 14 21:56:13 2018 +0200 x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures pfn_modify_allowed() and arch_has_pfn_modify_check() are outside of the !__ASSEMBLY__ section in include/asm-generic/pgtable.h, which confuses assembler on archs that don't have __HAVE_ARCH_PFN_MODIFY_ALLOWED (e.g. ia64) and breaks build: include/asm-generic/pgtable.h: Assembler messages: include/asm-generic/pgtable.h:538: Error: Unknown opcode `static inline bool pfn_modify_allowed(unsigned long pfn,pgprot_t prot)' include/asm-generic/pgtable.h:540: Error: Unknown opcode `return true' include/asm-generic/pgtable.h:543: Error: Unknown opcode `static inline bool arch_has_pfn_modify_check(void)' include/asm-generic/pgtable.h:545: Error: Unknown opcode `return false' arch/ia64/kernel/entry.S:69: Error: `mov' does not fit into bundle Move those two static inlines into the !__ASSEMBLY__ section so that they don't confuse the asm build pass. Fixes: 42e4089c7890 ("x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings") Signed-off-by: Jiri Kosina Signed-off-by: Thomas Gleixner commit ef89f4b96a2ab8dc1a0a3815d9365240e4c3c06b Author: Lars-Peter Clausen Date: Fri Jul 13 14:50:44 2018 +0300 iio: adxl345: Add support for the ADXL375 The ADXL375 is fully register map compatible to the ADXL345 (including the device ID register returning the same value ...). The only difference is the resolution of the acceleration sensor. The ADXL375 can measure up to +-200g of acceleration. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL375.PDF Signed-off-by: Lars-Peter Clausen Signed-off-by: Mircea Caprioru Signed-off-by: Jonathan Cameron commit a42174983c7545055bd8375965e31b3c15b287dc Author: Lorenzo Bianconi Date: Thu Jul 12 00:15:12 2018 +0200 iio: imu: st_lsm6dsx: add error logs to st_lsm6dsx_read_fifo() Add debug info to error conditions in st_lsm6dsx_read_fifo routine Suggested-by: Jorge Ramirez-Ortiz Signed-off-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron commit d2b863baf1c7d92969c2a9dcada3c6b14e5dbbc4 Author: Brian Masney Date: Tue Jul 10 21:33:45 2018 -0400 iio: pressure: bmp280: remove unused options from device tree documentation There are several options in the device tree documentation that are no longer relevant for the current in-kernel bmp280 driver so this patch removes them. Signed-off-by: Brian Masney Signed-off-by: Jonathan Cameron commit de8df0b9c38d8f232f0df03220ff540a54eaf73d Author: Brian Masney Date: Tue Jul 10 21:09:30 2018 -0400 iio: imu: mpu6050: add support for 6515 variant This patch adds support for the MPU 6515 variant. Confirmed that the driver functions correctly on a LG Nexus 5 (hammerhead) phone. Signed-off-by: Brian Masney Signed-off-by: Jonathan Marek Signed-off-by: Jonathan Cameron commit 843429708e394a31d3298f9b6dfa8fca180f8bfa Author: Andreas Klinger Date: Tue Jul 10 20:19:37 2018 +0200 iio: hx711: fix spurious unit-address in example Device tree compiler (dtc) gives a warning if a device node has "@" with a following number as it's name but no reg property. Fix the example in the documentation of avia,hx711 to conform to dtc behavior. Signed-off-by: Andreas Klinger Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 461631face58054c72b1f1453f2d66d71b1974e7 Author: Andreas Klinger Date: Tue Jul 10 20:19:03 2018 +0200 iio: hx711: add delay until DOUT is ready On a system with parasitic capacitance it turned out that DOUT is not ready after 100 ns after PD_SCK has raised. A measurement showed almost 1000 ns until DOUT has reached its correct value. With this patch its now possible to wait until data is ready. The wait time should not be higher than the maximum PD_SCK high time which is corresponding to the datasheet 50000 ns. Signed-off-by: Andreas Klinger Signed-off-by: Jonathan Cameron commit 7f310e5d07112e0bae57ce63de954e6773a26f81 Author: Andreas Klinger Date: Tue Jul 10 20:18:31 2018 +0200 iio: hx711: add clock-frequency property in DT Add clock-frequency property for hx711 ADC. This is the frequency of PD_SCK. After PD_SCK goes high DOUT is read just before PD_SCK goes down again. This is necessary because of parasitic capacitance on the wiring. Signed-off-by: Andreas Klinger Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 382fa5812583b6c3a4d02a5830b70ec7ee2f07a3 Author: Akinobu Mita Date: Tue Jul 10 00:10:08 2018 +0900 iio: accel: adxl345: add sampling frequency support The ADXL345 provides selectable output data rate. This adds the iio channel information for the sampling frequency with that feature. Cc: Eva Rachel Retuya Cc: Andy Shevchenko Cc: Jonathan Cameron Signed-off-by: Akinobu Mita Signed-off-by: Jonathan Cameron commit f54440e41b627e8eddf9e003aa61447c21e82cfd Merge: 64cc2c4eb536 41043ec45bde Author: Olof Johansson Date: Sat Jul 14 22:47:22 2018 -0700 Merge tag 'gemini-dts-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into next/dt Gemini DTS updates for v4.19: - Add Vitesse switch chips - Add a new DT for a reference design * tag 'gemini-dts-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: Add devicetree for Storlink/Storm SL93512R ARM: dts: Add Vitesse G5e switch to the Gemini SQ201 ARM: dts: Add WAN ethernet port to the SQ201 Signed-off-by: Olof Johansson commit 1cb50f87e10696e8cc61fb62d0d948e11b0e6dc1 Author: Jaegeuk Kim Date: Fri Jul 6 16:47:34 2018 -0700 f2fs: do checkpoint in kill_sb When unmounting f2fs in force mode, we can get it stuck by io_schedule() by some pending IOs in meta_inode. io_schedule+0xd/0x30 wait_on_page_bit_common+0xc6/0x130 __filemap_fdatawait_range+0xbd/0x100 filemap_fdatawait_keep_errors+0x15/0x40 sync_inodes_sb+0x1cf/0x240 sync_filesystem+0x52/0x90 generic_shutdown_super+0x1d/0x110 kill_f2fs_super+0x28/0x80 [f2fs] deactivate_locked_super+0x35/0x60 cleanup_mnt+0x36/0x70 task_work_run+0x79/0xa0 exit_to_usermode_loop+0x62/0x70 do_syscall_64+0xdb/0xf0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 0xffffffffffffffff Signed-off-by: Jaegeuk Kim commit 8a56dd9685d6531d09b370ab22a61b9687131875 Author: Jaegeuk Kim Date: Fri Jun 29 18:55:12 2018 -0700 f2fs: allow wrong configured dio to buffered write This fixes to support dio having unaligned buffers as buffered writes. xfs_io -f -d -c "pwrite 0 512" $testfile -> okay xfs_io -f -d -c "pwrite 1 512" $testfile -> EINVAL Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2aa4a3378ad077d02131a23d22641ae8ae44cb28 Merge: f5c64e566c52 13f7432bdd8e Author: David S. Miller Date: Sat Jul 14 18:47:44 2018 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2018-07-15 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Various different arm32 JIT improvements in order to optimize code emission and make the JIT code itself more robust, from Russell. 2) Support simultaneous driver and offloaded XDP in order to allow for advanced use-cases where some work is offloaded to the NIC and some to the host. Also add ability for bpftool to load programs and maps beyond just the cgroup case, from Jakub. 3) Add BPF JIT support in nfp for multiplication as well as division. For the latter in particular, it uses the reciprocal algorithm to emulate it, from Jiong. 4) Add BTF pretty print functionality to bpftool in plain and JSON output format, from Okash. 5) Add build and installation to the BPF helper man page into bpftool, from Quentin. 6) Add a TCP BPF callback for listening sockets which is triggered right after the socket transitions to TCP_LISTEN state, from Andrey. 7) Add a new cgroup tree command to bpftool which iterates over the whole cgroup tree and prints all attached programs, from Roman. 8) Improve xdp_redirect_cpu sample to support parsing of double VLAN tagged packets, from Jesper. ==================== Signed-off-by: David S. Miller commit 41043ec45bdea5970e7c2d6766caf0793aeeb159 Author: Linus Walleij Date: Sat Jun 16 15:21:45 2018 +0200 ARM: dts: Add devicetree for Storlink/Storm SL93512R The Storlink Gemini324 EV-Board also known as Storm Semiconductor SL93512R_BRD is ground zero for the Gemini devices. We add a device tree so we can support it, it turns out to be pretty trivial. Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij commit fa35007f62b60d9234893688a17936ab8562d11a Author: Linus Walleij Date: Fri Jun 1 22:50:29 2018 +0200 ARM: dts: Add Vitesse G5e switch to the Gemini SQ201 This adds the Vitesse G5e ethernet switch to the Square One Itian SQ201 router device tree. Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij commit 423fbae3d04e29dfbfd909672ca1c76d1f7342ef Author: Linus Walleij Date: Wed May 30 22:35:39 2018 +0200 ARM: dts: Add WAN ethernet port to the SQ201 This sets up the ethernet interface and PHY for the WAN ethernet port which uses a Marvell PHY. Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij commit 39e7f331864d2b9e30d5f3fd2121e182b2c9c8a9 Author: Felix Kuehling Date: Sat Jul 14 19:05:59 2018 -0400 drm/amdkfd: Add CU-masking ioctl to KFD CU-masking allows a KFD client to control the set of CUs used by a user mode queue for executing compute dispatches. This can be used for optimizing the partitioning of the GPU and minimize conflicts between concurrent tasks. Signed-off-by: Flora Cui Signed-off-by: Kent Russell Signed-off-by: Eric Huang Signed-off-by: Felix Kuehling Acked-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a7fe68a1e8e4bce007505f729bc33e427c540386 Author: Felix Kuehling Date: Sat Jul 14 19:05:58 2018 -0400 drm/amd: Add CU-masking ioctl definition to kfd_ioctl.h Signed-off-by: Felix Kuehling Acked-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 64cc2c4eb536635661f75312cc2cfa7c8043c5fe Merge: ba62dc1126e8 cddb86833615 Author: Olof Johansson Date: Sat Jul 14 15:09:54 2018 -0700 Merge tag 'v4.18-rockchip-dts32fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt Fix for a new warning from dtc in graph node unit addresses. * tag 'v4.18-rockchip-dts32fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: fix graph node unit address error from dtc Signed-off-by: Olof Johansson commit 13f7432bdd8eb2eb55eed2af1469d37c0f667617 Merge: 2d3feca8c44f 78d8e26d46bc Author: Daniel Borkmann Date: Sun Jul 15 00:08:41 2018 +0200 Merge branch 'bpf-tcp-listen-cb' Andrey Ignatov says: ==================== This patchset adds TCP-BPF callback for listening sockets. Patch 0001 provides more details and is the main patch in the set. Patch 0006 adds selftest for the new callback. Other patches are bug fixes and improvements in TCP-BPF selftest to make it easier to extend in 0006. ==================== Acked-by: Lawrence Brakmo Signed-off-by: Daniel Borkmann commit 78d8e26d46bc2ed73ab6a0e369a342478fda4ce0 Author: Andrey Ignatov Date: Wed Jul 11 17:33:37 2018 -0700 selftests/bpf: Test case for BPF_SOCK_OPS_TCP_LISTEN_CB Cover new TCP-BPF callback in test_tcpbpf: when listen() is called on socket, set BPF_SOCK_OPS_STATE_CB_FLAG so that BPF_SOCK_OPS_STATE_CB callback can be called on future state transition, and when such a transition happens (TCP_LISTEN -> TCP_CLOSE), track it in the map and verify it in user space later. Signed-off-by: Andrey Ignatov Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 2044e4ef0be29f0154b078a956a3d8331315298a Author: Andrey Ignatov Date: Wed Jul 11 17:33:36 2018 -0700 selftests/bpf: Better verification in test_tcpbpf Reduce amount of copy/paste for debug info when result is verified in the test and keep that info together with values being checked so that they won't get out of sync. It also improves debug experience: instead of checking manually what doesn't match in debug output for all fields, only unexpected field is printed. Signed-off-by: Andrey Ignatov Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit c65267e5ff418c81d7fea7025850ed4f190a1289 Author: Andrey Ignatov Date: Wed Jul 11 17:33:35 2018 -0700 selftests/bpf: Switch test_tcpbpf_user to cgroup_helpers Switch to cgroup_helpers to simplify the code and fix cgroup cleanup: before cgroup was not cleaned up after the test. It also removes SYSTEM macro, that only printed error, but didn't terminate the test. Signed-off-by: Andrey Ignatov Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 04c13411151c220b41998020c32ac97f33b58683 Author: Andrey Ignatov Date: Wed Jul 11 17:33:34 2018 -0700 selftests/bpf: Fix const'ness in cgroup_helpers Lack of const in cgroup helpers signatures forces to write ugly client code. Fix it. Signed-off-by: Andrey Ignatov Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 060a7fccd394f1600be86536b1d3e8cdd66637c2 Author: Andrey Ignatov Date: Wed Jul 11 17:33:33 2018 -0700 bpf: Sync bpf.h to tools/ Sync BPF_SOCK_OPS_TCP_LISTEN_CB related UAPI changes to tools/. Signed-off-by: Andrey Ignatov Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit f333ee0cdb27ba201e6cc0c99c76b1364aa29b86 Author: Andrey Ignatov Date: Wed Jul 11 17:33:32 2018 -0700 bpf: Add BPF_SOCK_OPS_TCP_LISTEN_CB Add new TCP-BPF callback that is called on listen(2) right after socket transition to TCP_LISTEN state. It fills the gap for listening sockets in TCP-BPF. For example BPF program can set BPF_SOCK_OPS_STATE_CB_FLAG when socket becomes listening and track later transition from TCP_LISTEN to TCP_CLOSE with BPF_SOCK_OPS_STATE_CB callback. Before there was no way to do it with TCP-BPF and other options were much harder to work with. E.g. socket state tracking can be done with tracepoints (either raw or regular) but they can't be attached to cgroup and their lifetime has to be managed separately. Signed-off-by: Andrey Ignatov Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit ce8403d455430afb2317757bb755a0f27a2799db Merge: edc07c0012c1 4ea7bdc6b5b3 Author: Olof Johansson Date: Sat Jul 14 14:45:51 2018 -0700 Merge tag 'tegra-for-4.19-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/soc firmware: tegra: Changes for v4.19-rc1 This contains a single fix for the Trusted Foundations firmware implementation, used on some Tegra20 and Tegra30 platforms. * tag 'tegra-for-4.19-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: trusted_foundations: do not use naked function Signed-off-by: Olof Johansson commit edc07c0012c1b9a40f6dfd44d90f71717d97df50 Merge: 5306c6ad0e4b 8c5a916f4c88 Author: Olof Johansson Date: Sat Jul 14 14:45:14 2018 -0700 Merge tag 'omap-for-v4.19/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc SoC updates for omaps for v4.19 merge window These changes are mostly PM related changes for am335x and am437x to support RTC only suspend mode. Some of the clock and driver related chances are still pending so it's not yet fully functional. Also included is a change for PM debug sysfs entry to use DEFINE_SHOW_ATTRIBUTE. * tag 'omap-for-v4.19/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP2+: sleep33/43xx: Add RTC-Mode support ARM: OMAP2+: sleep33/43xx: Make sleep actions configurable ARM: OMAP2+: reuse DEFINE_SHOW_ATTRIBUTE() macro ARM: hwmod: RTC: Don't assume lock/unlock will be called with irq enabled Signed-off-by: Olof Johansson commit 5306c6ad0e4b10748849e98679d8ff788695fb44 Merge: 9f40beb2ceef d08605a64e67 Author: Olof Johansson Date: Sat Jul 14 14:44:34 2018 -0700 Merge tag 'omap-for-v4.19/omap1-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc SoC updates for omap1 for v4.19 merge window Mostly a series by Janusz Krzysztofik to clean up the GPIO and input handling for ams-delta. Because of the platform data changes, we decided that it's best to merge the related input changes also via the arm-soc tree so Dmitry Torokhov has acked the input changes. Also included is a change to constify gpio_leds from Arvind Yadav. * tag 'omap-for-v4.19/omap1-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP1: ams-delta: move late devices back to init_machine Input: ams_delta_serio: Get FIQ buffer from platform_data Input: ams_delta_serio: use IRQ resource ARM: OMAP1: Get rid of ARM: OMAP1: ams-delta FIQ: Keep serio input GPIOs requested ARM: OMAP1: ams-delta FIQ: don't use static GPIO numbers ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin Input: ams_delta_serio: Replace power GPIO with regulator Input: ams_delta_serio: use private structure Input: ams_delta_serio: convert to platform driver ARM: OMAP1: ams-delta: drop GPIO lookup table for serio device ARM: OMAP1: ams-delta: assign LED GPIO numbers from descriptors ARM: OMAP1: ams-delta: refactor late_init() ARM: OMAP1: constify gpio_led Signed-off-by: Olof Johansson commit 9f40beb2ceef0f9a5e0ca3e5b7c07aaad90457a7 Merge: f46ad023774a be9d6446c38c Author: Olof Johansson Date: Sat Jul 14 14:44:04 2018 -0700 Merge tag 'imx-maintainer-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc i.MX maintainers update for 4.19: - Add myself and Li Yang as maintainers for Freescale Layerscape ARM architecture. * tag 'imx-maintainer-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: MAINTAINERS: add Freescale Layerscape ARM architecture entry Signed-off-by: Olof Johansson commit 472624550507d80828d6c620be734329ad49280e Merge: 030f457a2378 cc4aecc5b724 Author: Olof Johansson Date: Sat Jul 14 14:43:05 2018 -0700 Merge tag 'vexpress-update-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/drivers ARMv7 Vexpress update/cleanup for v4.19 Just single cleanup patch to use devm_ioremap_resource in place of devm_request_mem_region and devm_ioremap. * tag 'vexpress-update-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: misc: vexpress/syscfg: Use devm_ioremap_resource() to map memory Signed-off-by: Olof Johansson commit 030f457a23788dc99bd41a464c6fd86da2598741 Merge: 7af239f0c984 23cae492b4ed Author: Olof Johansson Date: Sat Jul 14 14:42:36 2018 -0700 Merge tag 'scmi-update-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/drivers SCMI cleanup for v4.19 Single patch removing some unnecessary NULL pointer checks. * tag 'scmi-update-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: remove some unnecessary checks Signed-off-by: Olof Johansson commit 7af239f0c984dea5fb367a04c27712c61c43a121 Merge: 20d87a5114e7 1662dd641f59 Author: Olof Johansson Date: Sat Jul 14 14:39:55 2018 -0700 Merge tag 'tegra-for-4.19-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers memory: tegra: Changes for v4.19-rc1 This contains a single fix for the initialization order of the various parts of the Tegra memory controller driver. * tag 'tegra-for-4.19-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: memory: tegra: Correct driver probe order Signed-off-by: Olof Johansson commit 20d87a5114e7ab39d92798c680f034f9dcaa71db Merge: e541454a8f1c 596e7955692b Author: Olof Johansson Date: Sat Jul 14 14:39:28 2018 -0700 Merge tag 'omap-for-v4.19/ti-sysc-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/drivers ti-sysc driver changes for v4.19 merge window These changes add support for mcan controller found on dra7 to probe it with only dts changes with no need for legacy hwmod platform data. As it depends on the related clock change, the clock change is included here and acked by Stephen Boyd. * tag 'omap-for-v4.19/ti-sysc-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: bus: ti-sysc: Add support for software reset bus: ti-sysc: Add support for using ti-sysc for MCAN on dra76x clk: ti: dra7: Add clkctrl clock data for the mcan clocks bus: ti-sysc: Use 2-factor allocator arguments Signed-off-by: Olof Johansson commit ba62dc1126e85d408db02b91679bc3a780ec5ef0 Author: Linus Walleij Date: Wed Jul 11 22:27:49 2018 +0200 ARM: dts: nomadik: Cut FSMC timings After the work done by Thomas Petazzoni, the NAND chip timings can be read out from the chip instead of open coded in the device tree, so let's just remove the timing information. Cc: Thomas Petazzoni Signed-off-by: Linus Walleij Signed-off-by: Olof Johansson commit 6783a9e0b41756d8d3db87b4a6e6711a6dbcd4b7 Merge: e74f13313490 1b8a8589a3e1 Author: Olof Johansson Date: Sat Jul 14 14:38:11 2018 -0700 Merge tag 'stm32-defconfig-for-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into next/defconfig STM32 defconfig updates for v4.19, round 1 Highlights: ---------- In multi_v7_defconfig, add support of: -STM32 RTC -STM32 DMA, DMAMUX and MDMA -STM32 DCMI media * tag 'stm32-defconfig-for-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: ARM: multi_v7_defconfig: enable STM32 DCMI media support ARM: multi_v7_defconfig: enable STM32 DMAv2, DMAMUX and MDMA ARM: multi_v7_defconfig: enable STM32 RTC Signed-off-by: Olof Johansson commit e74f13313490a4c9f47ae1d99fb3a6681d252d24 Merge: 3bd1027b4904 24ede29d026a Author: Olof Johansson Date: Sat Jul 14 14:30:19 2018 -0700 Merge tag 'samsung-defconfig-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/defconfig Samsung defconfig changes for v4.19 Enable options needed for booting full system on S5Pv210-based Samsung Galaxy S mobile phones. * tag 'samsung-defconfig-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: s5pv210_defconfig: Enable options needed to boot typical Linux distro ARM: s5pv210_defconfig: Enable drivers for Samsung Aries based phones ARM: s5pv210_defconfig: Run make savedefconfig Signed-off-by: Olof Johansson commit 3bd1027b4904175f567282b8bf5c1acf5588c736 Merge: 9a90f4db4fe9 17b98aadcedc Author: Olof Johansson Date: Sat Jul 14 14:29:51 2018 -0700 Merge tag 'davinci-for-v4.19/defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/defconfig DaVinci defconfig updates for v4.19 ----------------------------------- * Enable support for PWM backight and bluetooth * Remove some vestiges of mach-davinci private clock implementation. * tag 'davinci-for-v4.19/defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: davinci_all_defconfig: Enable Bluetooth ARM: davinci_all_defconfig: remove CONFIG_DAVINCI_RESET_CLOCKS ARM: davinci_all_defconfig: set CONFIG_BACKLIGHT_PWM=m Signed-off-by: Olof Johansson commit 5ef28dcc16c256fb87e189f0ed2ed98f71213763 Merge: 96a63ce04018 c2888cc2e2b8 Author: Olof Johansson Date: Sat Jul 14 14:27:22 2018 -0700 Merge tag 'stm32-dt-for-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into next/dt STM32 DT updates for v4.19, round 1 Highlights: ---------- -MCU platforms update: -Update RTC syscfg bindings on stm32f746 and stm32f429 -Update IWDG node with LSI clock name on stm32f429 -MPU STM32MP157 platform update: -Add HASH support -Add m_can support and enable it on EV1 board -Add RTC suppoort and enable it on ED1 board -Add USB OTG HS support and enable it on EV1 board -Enable USB Host EHCI on EV1 board -Add DFSDM support -Add SPI support -Add ETH support and enable it on EV1 board -Add IWDG support and enable it on ED1 board -Fix useless GPIO aliases and reorder nodes * tag 'stm32-dt-for-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: (22 commits) ARM: dts: stm32: update iwdg with lsi clock name for stm32f429 ARM: dts: stm32: add iwdg2 support for stm32mp157c-ed1 ARM: dts: stm32: add iwdg2 support for stm32mp157c ARM: dts: stm32: Reorder nodes in stm32mp157c-ed1 ARM: dts: stm32: remove gpio aliases for stm32mp157c ARM: dts: stm32: add support of ethernet on stm32mp157c-ev1 ARM: dts: stm32: Add ethernet dwmac on stm32mp1 ARM: dts: stm32: Add syscfg on stm32mp1 ARM: dts: stm32: add SPI1 support on stm32mp157c-ev1 ARM: dts: stm32: add SPI support on stm32mp157c ARM: dts: stm32: Add DFSDM support to stm32mp157c ARM: dts: stm32: Add ADC support to stm32mp157c ARM: dts: stm32: enable USB OTG HS on stm32mp157c-ev1 ARM: dts: stm32: add USB OTG HS support for stm32mp157c SoC ARM: dts: stm32: enable USB Host (USBH) EHCI controller on stm32mp157c-ev1 ARM: dts: stm32: enable RTC on stm32mp157c-ed1 ARM: dts: stm32: add RTC support to stm32mp157c ARM: dts: stm32: m_can activation on stm32mp157c-ev1 ARM: dts: stm32: m_can support to stm32mp157c ARM: dts: stm32: Add HASH support on stm32mp157c ... Signed-off-by: Olof Johansson commit 96a63ce04018f1117c864c1e05b5fdde5fb233e4 Merge: efcd3bab9ba6 4436a3711e32 Author: Olof Johansson Date: Sat Jul 14 14:26:48 2018 -0700 Merge tag 'mvebu-dt64-4.19-1' of git://git.infradead.org/linux-mvebu into next/dt mvebu dt64 for 4.19 (part 1) Armada 3700 - Add default memory reservation for ATF - Add a node for AVS support Fix eth3 connector name on the Macchiatobin * tag 'mvebu-dt64-4.19-1' of git://git.infradead.org/linux-mvebu: arm64: dts: marvell: armada-37xx: reserve memory for ATF arm64: dts: marvell: armada-37xx: add the node allowing AVS support arm64: dts: marvell: mcbin: fix eth3 connector name Signed-off-by: Olof Johansson commit efcd3bab9ba69bd58c28d15e1a311feed4339d3b Merge: 1b6d73283560 96487173aaf6 Author: Olof Johansson Date: Sat Jul 14 14:26:17 2018 -0700 Merge tag 'mvebu-dt-4.19-1' of git://git.infradead.org/linux-mvebu into next/dt mvebu dt for 4.19 (part 1) - Add a new Armada 388 based board: helios4 - Enable SPI flash by default on SolidRun Armada 38x Microsom * tag 'mvebu-dt-4.19-1' of git://git.infradead.org/linux-mvebu: ARM: dts: armada388-clearfog: drop future changes disclaimer ARM: dts: armada388-clearfog: enable spi flash ARM: dts: armada388-helios4 Signed-off-by: Olof Johansson commit 1b6d73283560ea82da30da87d699a9ccb8b504ff Merge: eb3203ab9214 49e414c32053 Author: Olof Johansson Date: Sat Jul 14 14:24:28 2018 -0700 Merge tag 'pxa-dt-4.19' of https://github.com/rjarzmik/linux into next/dt This device-tree pxa update brings : - pxa3xx fixes and updates * tag 'pxa-dt-4.19' of https://github.com/rjarzmik/linux: arm: dts: pxa3xx: Add ssp ports to pxa3xx device tree arm: dts: pxa3xx: provide correct clk-names property for nand controller node ARM: dts: pxa: add label to lcd controller node Signed-off-by: Olof Johansson commit eb3203ab92147937f36fd43efcd744f44ff0d137 Merge: 85b40cf3a868 17aa1530f1ff Author: Olof Johansson Date: Sat Jul 14 14:23:15 2018 -0700 Merge tag 'samsung-dt64-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/dt Samsung DTS ARM64 changes for v4.19 Cleanup from old properties and code-style warnings. * tag 'samsung-dt64-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: exynos: Remove leading 0x from unit addresses in Exynos5433 arm64: dts: exynos: Remove no longer needed samsung thermal properties Signed-off-by: Olof Johansson commit 85b40cf3a868361fed3122a503469f3be7a38b97 Merge: 4167ff9fe90f 57f4e8bc1c3e Author: Olof Johansson Date: Sat Jul 14 14:22:29 2018 -0700 Merge tag 'samsung-dt-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/dt Samsung DTS ARM changes for v4.19 1. Add two new S5Pv210 boards: Samsung Galaxy S and Samsung Galaxy S 4G mobile phones.  Both are from family codenamed Aries.  The Samsung Galaxy S was released on the market in 2010 with Android operating system.  At that time, it was the Samsung's flagship model.    This brings support for storage (SD card and internal memory), PMIC, RTC, fuel-gauge, keys, USB (in peripherial mode) and WiFi. 2. Add missing secondary CPU properties. 3. Cleanup from old files and properties. * tag 'samsung-dt-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: samsung: Document bindings for SGH-T959P board dt-bindings: samsung: Document bindings for Samsung aries boards ARM: dts: s5pv210: Add initial DTS for SGH-T959P phone ARM: dts: s5pv210: Add initial DTS for Samsung Galaxy S phone ARM: dts: s5pv210: Add initial DTS for Samsung Aries based phones ARM: dts: s5pv210: Add missing interrupt-controller property to gph2 ARM: dts: exynos: remove no longer needed samsung thermal properties dt-bindings: arm: Remove obsolete insignal-boards.txt ARM: dts: exynos: Add missing CPU clocks to secondary CPUs on Exynos542x arm: dts: exynos: Add missing cooling device properties for CPUs Signed-off-by: Olof Johansson commit 4167ff9fe90fc4f469e292f787baf9bb35d1fe94 Merge: a4c43ba4964a 7780a03495e1 Author: Olof Johansson Date: Sat Jul 14 14:21:32 2018 -0700 Merge tag 'tegra-for-4.19-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/dt arm64: tegra: Device tree changes for v4.19-rc1 These changes enable the GPIO controllers on Tegra194 SoCs, which in turn allows the SD card detection and ethernet controllers to be enabled as well. The Tegra194 device tree is also extended with the list of CPUs and a PSCI node to inform the kernel about the presence of PSCI capable firmware. * tag 'tegra-for-4.19-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Add CPU nodes to Tegra194 device tree arm64: tegra: Add ethernet controller on Tegra194 arm64: tegra: Enable card detect for SD card on P2888 arm64: tegra: Add GPIO controller on Tegra194 Signed-off-by: Olof Johansson commit a4c43ba4964a6f096cfa52c85cea2ebbd706de6a Merge: 0775f498a723 5def854e370f Author: Olof Johansson Date: Sat Jul 14 14:20:50 2018 -0700 Merge tag 'tegra-for-4.19-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/dt ARM: tegra: Device tree changes for v4.19-rc1 This set of changes adds support for the memory client resets on Tegra20 and Tegra30, fixes a couple of issues on Cardhu and Tegra30 Apalis as well as adds a unit-address to the memory node to avoid warnings from DTC. To round things of, the NAND flash controller is enabled on the Tegra20 Colibri. * tag 'tegra-for-4.19-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: dts: tegra: enable NAND flash on Colibri T20 ARM: dts: tegra: add Tegra20 NAND flash controller node ARM: tegra: Work safely with 256 MB Colibri-T20 modules ARM: tegra: Fix unit_address_vs_reg and avoid_unnecessary_addr_size DTC warnings ARM: tegra: Fix unit_address_vs_reg DTC warnings for /memory ARM: tegra: Remove usage of deprecated skeleton.dtsi ARM: tegra: Fix can2 on Tegra30 Apalis ARM: tegra: Fix Tegra30 Cardhu PCA954x reset ARM: dts: tegra30: Add Memory Client reset to VDE ARM: dts: tegra20: Add Memory Client reset to VDE Signed-off-by: Olof Johansson commit 0775f498a723067a1fdabd9c03a2bd34a047f5fe Merge: 8291ca5d2a7f 29aa59efc6bf Author: Olof Johansson Date: Sat Jul 14 14:20:28 2018 -0700 Merge tag 'tegra-for-4.19-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/dt dt-bindings: tegra: Changes for v4.19-rc1 This contains a single update that adds the Carmel CPU found in Tegra194 SoCs to the arm/cpus.txt device tree bindings. * tag 'tegra-for-4.19-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: arm: Add compatible string for NVIDIA Carmel Signed-off-by: Olof Johansson commit 8291ca5d2a7f70cb541f596142849fee4e6566f0 Merge: 260cfb9ff883 0adbe832f21a Author: Olof Johansson Date: Sat Jul 14 14:20:03 2018 -0700 Merge tag 'omap-for-v4.19/dt-mcan-v2-signed-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt dts changes for mcan for omaps for v4.19 merge window These changes configure the mcan clock, interconnect target module and mcan device. These changes depend on the ti-sysc related driver changes and are based on those. Notably this is the first new driver that probes with ti-sysc driver with no legacy hwmod platform data for the interconnect target module. * tag 'omap-for-v4.19/dt-mcan-v2-signed-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: dra76x: Add MCAN node ARM: dts: Add generic interconnect target module node for MCAN ARM: dts: dra762: Add MCAN clock support bus: ti-sysc: Add support for software reset bus: ti-sysc: Add support for using ti-sysc for MCAN on dra76x clk: ti: dra7: Add clkctrl clock data for the mcan clocks bus: ti-sysc: Use 2-factor allocator arguments Signed-off-by: Olof Johansson commit 260cfb9ff88313054ab7586438724b3c5cf9816b Merge: b7b6be643572 792f98677d7f Author: Olof Johansson Date: Sat Jul 14 14:17:26 2018 -0700 Merge tag 'omap-for-v4.19/dt-signed-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt dts changes for omaps for v4.19 merge window Mostly updates to configure and improve the devices found on various SoCs and boards: - several patches to update support for am3517-evm to replace bogus fixed regulators with proper regulators and configure various devices such as wlan, bluetooth and usb1 - add missing cooling devices for omap5 and dra7 - configure dual role for usb ports for am57xx and dra7 - PM updates for omap4 devices to allow retention idle for minimal configurations - am335x-sl50 updates for various devices - update d-can alias names to not use undescore - configure pandaboard gpio button - a non-urgent change to fix dcan node address that i forgot to send a pull request for earlier * tag 'omap-for-v4.19/dt-signed-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (25 commits) ARM: dts: pandaboard: add gpio user button ARM: dts: am3517-evm: Add 'vdd_io_reg' regulator references ARM: dts: am3517-evm: Enable USB1 Host ARM: dts: am33xx: Fix syntax of alias names ARM: dts: am3517-som: Add builtin Bluetooth ARM: dts: am3517-som: Add WL127x Wifi ARM: dts: am335x-sl50: enable tsadc on SL50 board ARM: dts: am335x-sl50: fix label names for all LEDs ARM: dts: am335x-sl50: use audio-graph-card for sound ARM: dts: am335x-sl50: add support for DS1339 Real Time Clock ARM: dts: am335x-sl50: set dr_mode to otg ARM: dts: am335x-sl50: add a node for the LCD controller ARM: dts: am335x-sl50: use phy-phandle declarations ARM: dts: am335x-sl50: update backlight nodes ARM: dts: omap4-droid4: Use software debounce for gpio-keys ARM: dts: Configure duovero for to allow core retention during idle ARM: dts: Improve omap l4per idling with wlcore edge sensitive interrupt ARM: dts: dra76-evm: Add VBUS GPIO to USB1/USB2 extcon ARM: dts: dra71-evm: Add VBUS GPIO to USB1/USB2 extcon ARM: dts: dra7-evm: Add extcon to USB2 port ... Signed-off-by: Olof Johansson commit b7b6be6435727021b245779205ac63a051023394 Merge: f9228c38363a 3117c17301ed Author: Olof Johansson Date: Sat Jul 14 14:16:58 2018 -0700 Merge tag 'davinci-for-v4.19/dt' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/dt DaVinci Device-Tree updates for v4.19 ------------------------------------- * DA850 now uses clocks from device-tree * DA850 EVM gains LCD (with backlight) and SATA support * Lego Mindstorms gains bluetooth support * DSP reset control support on DA850 * tag 'davinci-for-v4.19/dt' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: dts: da850: Add power-domains to CPPI 4.1 node ARM: davinci: dts: add a reset control to the dsp node ARM: davinci: dts: make psc0 a reset provider ARM: dts: da850-lego-ev3: Add Bluetooth nodes ARM: dts: da850: Add power-domains to PWM nodes ARM: dts: da850: Add clocks dt-bindings: timer: new bindings for TI DaVinci timer ARM: dts: da850-evm: Enable LCD and backlight ARM: dts: da850-evm: Enable SATA port Signed-off-by: Olof Johansson commit f46ad023774a587db26b8798ea40e8c42d6bcdf4 Merge: dd8ba5232561 7f69ae7fadd9 Author: Olof Johansson Date: Sat Jul 14 14:16:26 2018 -0700 Merge tag 'davinci-for-v4.19/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc DaVinci SoC updates for v4.19 ----------------------------- * mach-davinci updates needed to finally move over to common clock framework * update to use the aemif driver from drivers/memory rather than the private implementation available in mach-davinci For the later item, I have included a branch from David Lechner which should also get merged through the clk tree. The clk dependencies are needed for aemif conversion. * tag 'davinci-for-v4.19/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: (34 commits) ARM: davinci: unduplicate aemif support ARM: davinci: mityomapl138: use aemif platform driver ARM: davinci: dm646x-evm: use aemif platform driver ARM: davinci: da830-evm: use aemif platform driver ARM: davinci: dm644x-evm: use aemif platform driver ARM: davinci: dm365-evm: use the ti-aemif soc driver ARM: davinci: da850-evm: use aemif platform driver in legacy mode ARM: davinci: omapl138-hawk: add aemif & nand support clk: davinci: psc-da830: add a lookup entry for aemif clock clk: davinci: psc-dm646x: use two lookup entries for the aemif clock clk: davinci: psc-dm644x: use two lookup entries for the aemif clock clk: davinci: psc-dm365: use two lookup entries for the aemif clock clk: davinci: psc-da850: remove the 'davinci_nand.0" lookup ARM: davinci: da8xx-dt: switch to device tree clocks ARM: davinci: add device tree support to timer ARM: davinci: remove legacy clocks ARM: davinci: da8xx: Remove legacy USB and SATA clock init ARM: davinci: dm646x: Remove legacy clock init ARM: davinci: dm644x: Remove legacy clock init ARM: davinci: dm365: Remove legacy clock init ... Signed-off-by: Olof Johansson commit e541454a8f1c0273809622c8cd4f5b3435bd8087 Merge: 872d6d96cd05 5773898b3b32 Author: Olof Johansson Date: Sat Jul 14 14:14:47 2018 -0700 Merge tag 'arm-soc/for-4.19/drivers' of https://github.com/Broadcom/stblinux into next/drivers This pull request contains Broadcom ARM/ARM64/MIPS SoCs drivers changes for 4.19, please pull the following: - Doug updates the low-level suspend/resume code for ARM SoCs to support the latest rev B3.0 memory controllers found on newer chips with an appropriate match structure to perform the correct entry sequencing - Florian updates the Device Tree binding document for these memory controllers to list all possible compatible strings that exist given the supported memory controllers. - Stefan adds the GET_THROTTLED firmware property value that is required for the Rasperry Pi voltage monitoring driver and updates the Raspberry Pi firmware driver accordingly to register such a device using the HWMON subsystem. Finally he adds support for reporting under voltage conditions using a specialized HWMON driver. * tag 'arm-soc/for-4.19/drivers' of https://github.com/Broadcom/stblinux: firmware: raspberrypi: Remove VLA usage firmware: raspberrypi: Register hwmon driver hwmon: Add support for RPi voltage sensor soc: bcm: brcmstb: Add missing DDR MEMC compatible strings soc: bcm: brcmstb: pm: Add support for newer rev B3.0 controllers ARM: bcm2835: Add GET_THROTTLED firmware property Signed-off-by: Olof Johansson commit dd8ba5232561d1a69a7bd3634f5a92f7f64d881d Merge: a67de8820943 f3f49e42c119 Author: Olof Johansson Date: Sat Jul 14 14:12:22 2018 -0700 Merge tag 'arm-soc/for-4.19/soc' of https://github.com/Broadcom/stblinux into next/soc This pull request contains Broadcom ARM-based SoCs platform changes for 4.19, please pull the following: - Clement re-orders the UART debug entries to be in ascending order and he also adds the iProc UART3 debug address since that is a common location for iProc based designs. * tag 'arm-soc/for-4.19/soc' of https://github.com/Broadcom/stblinux: ARM: debug: fix BCM2836 order entry ARM: debug: Add iProc UART3 debug addresses Signed-off-by: Olof Johansson commit f9228c38363a086b93854488494dbdc5db7fb7b8 Merge: c79306d5c427 e28e68163007 Author: Olof Johansson Date: Sat Jul 14 14:11:41 2018 -0700 Merge tag 'arm-soc/for-4.19/devicetree-arm64' of https://github.com/Broadcom/stblinux into next/dt This pull request contains Broadcom ARM64-based SoCs Device Tree changes for 4.19, please pull the following: - Scott does a bunch of updates to the Stingray DTS and DTS include files to better support the addition of new boards. Scott also adds the Stingray OTP Device Tree node - Pramod updates the Stingray clocks such that they match the latest revision of the ASIC and datasheets - Ray sets the Stingray initial watchdog timeout to 60 seconds to give sufficient time for the kernel to boot and then adds PAXC (internal PCIe) support to the Stingray base DTS files - Vladimir adds support for the Stingray smart NIC PS225 boards variants * tag 'arm-soc/for-4.19/devicetree-arm64' of https://github.com/Broadcom/stblinux: arm64: dts: stingray: add bcm958802a802x dts arm64: dts: stingray: add PAXC support arm64: dts: set initial SR watchdog timeout to 60 seconds arm64: dts: Update Stingray clock DT nodes arm64: dts: stingray: Add OTP device node arm64: dts: stingray: move common board components to stingray-board-base Signed-off-by: Olof Johansson commit c79306d5c427caf72cd07630244f1f2bc0a98066 Merge: 5665ab3ac559 3be77fe8c3f1 Author: Olof Johansson Date: Sat Jul 14 14:10:54 2018 -0700 Merge tag 'arm-soc/for-4.19/devicetree' of https://github.com/Broadcom/stblinux into next/dt This pull request contains Broadcom ARM-based SoCs Device Tree changes for 4.19, please pull the following: - Clement adds ethernet aliases to the Cygnus DTS include file such that a DT aware bootloader such as u-boot can properly insert MAC addresses - Mohamed adds a Device Tree node for the HWRNG found on Cygnus SoCs - Vivek migrates all the BCM5301x (Northstar) Device Tree sources to use the proper USB 3.0 PHY representation using its parent MDIO bus. Vivek also completes the Linksys EA9500 Device Tree by adding support for LEDs, internal and external switches. - Rafal adds the ARM architected timer to the BCM53573 Device Tree include file. - Eric adds the Performance Monitoring Unit to the BCM2837 DTS include file since it was absent before - Boris adds the BCM283x transposer block to the Device Tree - Stefan adds the Raspberry Pi Compute Module (CM1) Device Tree include and sources. * tag 'arm-soc/for-4.19/devicetree' of https://github.com/Broadcom/stblinux: ARM: dts: BCM5301X: Add support for Linksys EA9500 ARM: dts: BCM53573: Add architected timer ARM: dts: BCM5301X: Make USB 3.0 PHY use MDIO PHY driver ARM: dts: cygnus: enable iproc-hwrng ARM: dts: cygnus: add ethernet0 alias ARM: dts: bcm283x: Add Transposer block ARM: dts: bcm283x: Add the PMU to the devicetree. ARM: dts: add Raspberry Pi Compute Module and IO board Signed-off-by: Olof Johansson commit 9a90f4db4fe9e1a392dee0cbb61657f7843897ef Merge: 11d378ce5d74 163efb68d110 Author: Olof Johansson Date: Sat Jul 14 14:08:17 2018 -0700 Merge tag 'arm-soc/for-4.19/defconfig-arm64' of https://github.com/Broadcom/stblinux into next/defconfig This pull request contains Broadcom ARM64-based SoCs defconfig changes for 4.19, please pull the following changes: - Stefan enables the Raspberry Pi voltage sensor driver (HWMON) in the arm64 defconfig file - Ray enables the ARM SP805 watchdog driver in the arm64 defconfig file * tag 'arm-soc/for-4.19/defconfig-arm64' of https://github.com/Broadcom/stblinux: arm64: defconfig: add CONFIG_ARM_SP805_WATCHDOG arm64: defconfig: Enable RPi voltage sensor Signed-off-by: Olof Johansson commit 11d378ce5d744be5ef74a5663fdcff5da312e9fd Merge: 2d74fac5acd5 b0ba9fad81e4 Author: Olof Johansson Date: Sat Jul 14 14:07:48 2018 -0700 Merge tag 'arm-soc/for-4.19/defconfig' of https://github.com/Broadcom/stblinux into next/defconfig This pull request contains Broadcom ARM-based SoCs defconfig updates for 4.19, please pull the following: - Stefan enables the Raspberry Pi voltage sensor driver (HWMON) in both multi_v7_defconfig and bcm2835_defconfig * tag 'arm-soc/for-4.19/defconfig' of https://github.com/Broadcom/stblinux: ARM: multi_v7_defconfig: Enable RPi voltage sensor ARM: bcm2835_defconfig: Enable RPi voltage sensor Signed-off-by: Olof Johansson commit 5665ab3ac559af6c07391aca40b61ef25608bfa2 Merge: 9fcad3b634ef d0414fdd58eb Author: Olof Johansson Date: Sat Jul 14 14:06:42 2018 -0700 Merge tag 'v4.19-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt SPDX conversion for existing devicetree files. New board is Gru-Bob the Chromebook Flip C101PA which also got some stuff moved around to make room for Scarlet once its display pipeline makes some more advances. Also included are some general sound improvements for rk3399 including enabling hdmi-sound on the sapphire board and some misc fixes like missing cooling device properties and wrong clock-names for the uart1 on rk3328. * tag 'v4.19-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: corrected uart1 clock-names for rk3328 arm64: dts: rockchip: add Google Bob arm64: dts: rockchip: move core edp from rk3399-kevin to shared chromebook arm64: dts: rockchip: move Chromebook-specific Gru-parts to a separate file arm64: dts: rockchip: add phandles to some nodes on rk3399-gru arm64: dts: rockchip: add some common pin-settings to rk3399 arm64: dts: rockchip: generalize rk3399 #sound-dai-cells arm64: dts: rockchip: Add missing cooling device properties for CPUs arm64: dts: rockchip: enable hdmi sound on rk3399-sapphire arm64: dts: rockchip: connect hdmi sound in rk3399 arm64: dts: rockchip: use SPDX-License-Identifier Signed-off-by: Olof Johansson commit 9fcad3b634ef2bb8c5c49a503b8b08fd7beb2bce Merge: df054c15440d f999d76a0011 Author: Olof Johansson Date: Sat Jul 14 14:06:17 2018 -0700 Merge tag 'v4.19-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt SPDX conversion for existing Rockchip devicetree files as well as conversion of rk3288 to OPPv2 to facilitate the addition of missing cpu-cooling-device properties. * tag 'v4.19-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: Add missing cooling device properties for CPUs on rk3288 ARM: dts: rockchip: convert rk3288 to operating-points-v2 ARM: dts: rockchip: Add missing cooling device properties for CPUs on rk322x ARM: dts: rockchip: use SPDX-License-Identifier Signed-off-by: Olof Johansson commit f5c64e566c521456e9c34e3a7208dabab0eaf18b Merge: ff0432e5a802 c3a495409ade Author: David S. Miller Date: Sat Jul 14 11:23:26 2018 -0700 Merge branch 'mlxsw-VRRP' Ido Schimmel says: ==================== mlxsw: Add VRRP support When a router that is acting as the default gateway of a host stops functioning, the host will encounter packet loss until the router starts functioning again. To increase the reliability of the default gateway without performing reconfiguration on the host, a host can use a Virtual Router Redundancy Protocol (VRRP) Router. This virtual router is composed from several routers where only one is actually forwarding packets from the host (the master router) while the other routers act as backup routers. The election of the master router is determined by the VRRP protocol [1]. Packets addressed to the virtual router are always sent to the virtual router MAC address (IPv4: 00-00-5E-00-01-XX, IPv6: 00-00-5E-00-02-XX). Such packets can only be accepted by the master router and must be discarded by the backup routers. In Linux, VRRP is usually implemented by configuring a macvlan with the virtual router MAC on top of the router interface that is connected to the host / LAN. The macvlan on the master router is assigned the virtual IP (VIP) that the host uses as its gateway. In order to support VRRP in mlxsw, we first need to enable macvlan upper devices on top of mlxsw netdevs and their uppers. This is done by the first patch, which also takes care of sanitizing macvlan configurations that are not currently supported by the driver. The second patch directs packets with destination MAC addresses as the macvlans to the router so that they will undergo an L3 lookup. This is consistent with the kernel's behavior where the macvlan's Rx handler will re-inject such packets to the Rx path so that they will be picked up by the IPvX protocol handlers and undergo an L3 lookup. Note that the driver prevents the macvlans from being enslaved to other devices, to ensure the packets will be picked up by the protocol handler and not by another Rx handler. The third patch adds packet traps for VRRP control packets for both IPv4 and IPv6. Finally, the last patch optimizes the reception of VRRP MACs by potentially skipping one L2 lookup for them. ==================== Signed-off-by: David S. Miller commit c3a495409adeb677fa8b53f4cfe37cf9cfb7c751 Author: Ido Schimmel Date: Sat Jul 14 11:39:54 2018 +0300 mlxsw: spectrum_router: Optimize processing of VRRP MACs Hosts using a VRRP router send their packets with a destination MAC of the VRRP router which is of the following form [1]: IPv4 - 00-00-5E-00-01-{VRID} IPv6 - 00-00-5E-00-02-{VRID} Where VRID is the ID of the virtual router. Such packets are directed to the router block in the ASIC by an FDB entry that was added in the previous patch. However, in certain cases it is possible to skip this FDB lookup and send such packets directly to the router. This is accomplished by adding these special MAC addresses to the RIF cache. If the cache is hit, the packet will skip the L2 lookup and ingress the router with the RIF specified in the cache entry. 1. https://tools.ietf.org/html/rfc5798#section-7.3 Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 11566d34f8952a780d86e8a6e734006ed035aa6b Author: Ido Schimmel Date: Sat Jul 14 11:39:53 2018 +0300 mlxsw: spectrum: Add VRRP traps Virtual Router Redundancy Protocol packets are used to communicate the state of the Master router associated with the virtual router ID (VRID). These are link-local multicast packets sent with IP protocol 112 that are trapped in the router block in the ASIC. Add a trap for these packets and mark the trapped packets to prevent them from potentially being re-flooded by the bridge driver. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 2db9937804ac23dc45e35f47dbf93ded516e8b58 Author: Ido Schimmel Date: Sat Jul 14 11:39:52 2018 +0300 mlxsw: spectrum_router: Direct macvlans' MACs to router An IP packet received on a netdev with a macvlan upper whose MAC matches the packet's destination MAC will be re-injected to the Rx path as if it was received by the macvlan, and perform an L3 lookup. Reflect this functionality to the ASIC by programming FDB entries that will direct MACs of macvlan uppers to the router. In a similar fashion to router interfaces (RIFs) that are programmed upon the addition of the first IP address on an interface and destroyed upon the removal of the last IP address, the FDB entries for the macvlan are added and destroyed based on the addition of the first and removal of the last IP address on the macvlan. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit c55161852fe852edd9e615768835e59059695990 Author: Ido Schimmel Date: Sat Jul 14 11:39:51 2018 +0300 mlxsw: spectrum: Enable macvlan upper devices In order to allow more unicast MAC addresses (e.g., VRRP virtual MAC) to be directed to the router we need to enable macvlan uppers on top of mlxsw netdevs. Allow macvlan upper devices on top of mlxsw netdevs and sanitize configurations that can't work. For example, a macvlan can't be enslaved to a bridge as without ACLs the device doesn't take the destination MAC into account when classifying a packet to a bridge instance (i.e., a FID). Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit ff0432e5a8025df895813408325b2afdfa21f946 Author: Yafang Shao Date: Sat Jul 14 16:36:29 2018 +0800 tcp: remove redundant rcv_nxt update tcp_rcv_nxt_update() is already executed in tcp_data_queue(). This line is redundant. See bellow, tcp_queue_rcv tcp_rcv_nxt_update(tcp_sk(sk), TCP_SKB_CB(skb)->end_seq); tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq); <<<< redundant Signed-off-by: Yafang Shao Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e5cae659597811f8bacc4abc70135dffb48711d5 Author: Michał Winiarski Date: Sat Jul 14 18:37:03 2018 +0100 drm/i915/guc: Disable rpm wakeref asserts in GuC irq handler We're seeing "RPM wakelock ref not held during HW access" warning otherwise. Since IRQs are synced for runtime suspend we can just disable the wakeref asserts. Reported-by: Marta Löfstedt Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105710 Signed-off-by: Michał Winiarski Cc: Chris Wilson Cc: Michal Wajdeczko Link: https://patchwork.freedesktop.org/patch/msgid/20180714173703.7894-1-chris@chris-wilson.co.uk Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson commit e5d772fbe7685aae0dff99f3b54158a0ec32155e Author: Dan Williams Date: Wed Jun 13 14:31:18 2018 -0700 tools/testing/nvdimm: Fix support for emulating controller temperature In addition to populating the value the payload also needs to set the "controller temperature valid" flag. Fixes: cdd77d3e1930 ("nfit, libnvdimm: deprecate the generic SMART ioctl") Signed-off-by: Dan Williams commit 39611e83a28c880881f4927d7bb2f5ea4ddf4526 Author: Dan Williams Date: Wed Jun 13 20:08:54 2018 -0700 tools/testing/nvdimm: Make DSM failure code injection an override In order to emulate the behavior of the NVDIMM_FAMILY_INTEL DSMs nfit_test needs the ability to execute the DSM and then override the return code. Split the current return code injection from get_dimm() and apply at after the function has executed to override the return status. Signed-off-by: Dan Williams commit 099b07a25fff6ee1b37f3ca7f4d2b53186326db0 Author: Dan Williams Date: Wed Jun 13 09:06:52 2018 -0700 acpi, nfit: Prefer _DSM over _LSR for namespace label reads The _LSR method indicates locked status via error-code-3 returned in the _LSR payload. When any error is returned the payload of _LSR is truncated to a zero-length buffer. The _DSM path in comparison allows system software to retrieve the locked status *and* namespace label area contents. Signed-off-by: Dan Williams commit 08e6b3c6e3a054f566367740c94b8c1d18e52056 Author: Dan Williams Date: Wed Jun 13 09:08:36 2018 -0700 libnvdimm: Introduce locked DIMM capacity support When a DIMM is locked its namespace label area may not be. Introduce the distinction of locked namespaces to allow namespace enumeration while the capacity is locked. Signed-off-by: Dan Williams commit 14459ce2bd980f74bc9c36f3ef42e7ba645e5dfe Author: Russell King Date: Thu Mar 29 11:27:31 2018 +0100 ARM: tcm: ensure inline stub functions are marked static Ensure that the stubbed out tcm_init() is marked static, so we don't end up emitting the stub each time the header is included. Reviewed-by: Linus Walleij Signed-off-by: Russell King commit 2d3feca8c44f315624b7c0f5b8361e2f54405c12 Author: Okash Khawaja Date: Fri Jul 13 21:57:04 2018 -0700 bpf: btf: print map dump and lookup with btf info This patch augments the output of bpftool's map dump and map lookup commands to print data along side btf info, if the correspondin btf info is available. The outputs for each of map dump and map lookup commands are augmented in two ways: 1. when neither of -j and -p are supplied, btf-ful map data is printed whose aim is human readability. This means no commitments for json- or backward- compatibility. 2. when either -j or -p are supplied, a new json object named "formatted" is added for each key-value pair. This object contains the same data as the key-value pair, but with btf info. "formatted" object promises json- and backward- compatibility. Below is a sample output. $ bpftool map dump -p id 8 [{ "key": ["0x0f","0x00","0x00","0x00" ], "value": ["0x03", "0x00", "0x00", "0x00", ... ], "formatted": { "key": 15, "value": { "int_field": 3, ... } } } ] This patch calls btf_dumper introduced in previous patch to accomplish the above. Indeed, btf-ful info is only displayed if btf data for the given map is available. Otherwise existing output is displayed as-is. Signed-off-by: Okash Khawaja Acked-by: Martin KaFai Lau Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit b12d6ec09730b2646e85c348e599b592348dd0e3 Author: Okash Khawaja Date: Fri Jul 13 21:57:03 2018 -0700 bpf: btf: add btf print functionality This consumes functionality exported in the previous patch. It does the main job of printing with BTF data. This is used in the following patch to provide a more readable output of a map's dump. It relies on json_writer to do json printing. Below is sample output where map keys are ints and values are of type struct A: typedef int int_type; enum E { E0, E1, }; struct B { int x; int y; }; struct A { int m; unsigned long long n; char o; int p[8]; int q[4][8]; enum E r; void *s; struct B t; const int u; int_type v; unsigned int w1: 3; unsigned int w2: 3; }; $ sudo bpftool map dump id 14 [{ "key": 0, "value": { "m": 1, "n": 2, "o": "c", "p": [15,16,17,18,15,16,17,18 ], "q": [[25,26,27,28,25,26,27,28 ],[35,36,37,38,35,36,37,38 ],[45,46,47,48,45,46,47,48 ],[55,56,57,58,55,56,57,58 ] ], "r": 1, "s": 0x7ffd80531cf8, "t": { "x": 5, "y": 10 }, "u": 100, "v": 20, "w1": 0x7, "w2": 0x3 } } ] This patch uses json's {} and [] to imply struct/union and array. More explicit information can be added later. For example, a command line option can be introduced to print whether a key or value is struct or union, name of a struct etc. This will however come at the expense of duplicating info when, for example, printing an array of structs. enums are printed as ints without their names. Signed-off-by: Okash Khawaja Acked-by: Martin KaFai Lau Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 92b57121ca79b286bef4f304e887272f3f2d86bb Author: Okash Khawaja Date: Fri Jul 13 21:57:02 2018 -0700 bpf: btf: export btf types and name by offset from lib This patch introduces btf__resolve_type() function and exports two existing functions from libbpf. btf__resolve_type follows modifier types like const and typedef until it hits a type which actually takes up memory, and then returns it. This function follows similar pattern to btf__resolve_size but instead of computing size, it just returns the type. These functions will be used in the followig patch which parses information inside array of `struct btf_type *`. btf_name_by_offset is used for printing variable names. Signed-off-by: Okash Khawaja Acked-by: Martin KaFai Lau Acked-by: Song Liu Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit db42a21a1e8d11a30a06050281c2723ec78b63a7 Author: Jakub Kicinski Date: Fri Jul 13 19:08:59 2018 -0700 tools: include reallocarray feature test in FEATURE_TESTS_BASIC perf propagates its feature check results to libbpf. This means features for which perf probes must be a superset of libbpf's required features. perf depends on FEATURE_TESTS_BASIC for its list of features. commit 531b014e7a2f ("tools: bpf: make use of reallocarray") added reallocarray use to libbpf, make perf also perform the reallocarray feature check. Fixes: 531b014e7a2f ("tools: bpf: make use of reallocarray") Reported-by: Guenter Roeck Signed-off-by: Jakub Kicinski Tested-by: Guenter Roeck Signed-off-by: Daniel Borkmann commit bfd727f3a59c3696d6fbe086589376a16a5cdf05 Author: Greg Kroah-Hartman Date: Fri Jul 13 17:46:17 2018 +0200 staging: gasket: remove gasket_wait_sync() This function is not called anywhere, so just remove it. Also, as an added benifit, Arnd points out that it doesn't even work properly: This code won't work correct during leap seconds or a concurrent settimeofday() call, and it probably doesn't do what the author intended even for the normal case, as it passes a timeout in nanoseconds but reads the time using a jiffies-granularity accessor. Reported-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 2e008cd075ba8c2b2212b9e8f3c75d79fa1ee44b Author: Greg Kroah-Hartman Date: Fri Jul 13 10:29:04 2018 +0200 staging: gasket: sysfs: remove legacy_device field This field is only ever checked, never actually set, and looks to be left-over from some old interface of some sort. As it's not being used at all here, and is just adding to the complexity, delete it. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit 3adb0e35a4d86b442a55eabfa6ab7b67059e514f Author: Greg Kroah-Hartman Date: Fri Jul 13 10:29:03 2018 +0200 staging: gasket: remove gasket_sysfs_register_show() In an attempt to start to clean up the monstrosity of the sysfs abuse in the gasket driver, let's remove code that is not used at all. The gasket_sysfs_register_show() function is never used, so delete it. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit 11bab0e3e08b491c8cfcbb6fc6c206e08cf6aae8 Author: Greg Kroah-Hartman Date: Fri Jul 13 10:29:02 2018 +0200 staging: gasket: remove GASKET_SYSFS_REG() In an attempt to start to clean up the monstrosity of the sysfs abuse in the gasket driver, let's remove code that is not used at all. The GASKET_SYSFS_REG() macro is never used, so delete it. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit af3abc4414cb94929be4940f3d9c02fea3f0b5c8 Author: Greg Kroah-Hartman Date: Fri Jul 13 12:05:55 2018 +0200 staging: gasket: remove gasket_page_table_num_extended_entries() It is exported, yet no one calls it so just remove the dead code. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit 4c89a44dd907644743fe24ad92fdf1f15889fb60 Author: Greg Kroah-Hartman Date: Fri Jul 13 12:05:54 2018 +0200 staging: gasket: remove gasket_interrupt_get_msix_entries() No one calls it, it is claimed to be "legacy", whatever that means, so just remove the dead code. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit b19409549bffc4e5b4e3940d825cec5edb606959 Author: Greg Kroah-Hartman Date: Fri Jul 13 12:05:53 2018 +0200 staging: gasket: remove gasket_interrupt_trigger_eventfd() No one calls it, so just remove the dead code. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit f09b915b37ed827854d904b50dccd531da8dcc99 Author: Greg Kroah-Hartman Date: Fri Jul 13 12:05:52 2018 +0200 staging: gasket: remove gasket_interrupt_get_eventfd_ctxs() It is exported, yet no one calls it so just remove the dead code. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit 7faa7d57b2f0fe4e1f2ac3501d343e9429ce0a32 Author: Greg Kroah-Hartman Date: Fri Jul 13 12:05:51 2018 +0200 staging: gasket: remove pointless gasket_interrupt_pause() gasket_interrupt_pause() does nothing, and no one calls it, so remove it as it is dead-weight. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit 9cee8c4375431d5087466eacf6f8f436210e56ea Author: kbuild test robot Date: Sat Jul 14 09:27:35 2018 +0800 net: mvpp2: mvpp2_cls_flow_get() can be static Fixes: f9358e12a0af ("net: mvpp2: split ingress traffic into multiple flows") Signed-off-by: kbuild test robot Signed-off-by: David S. Miller commit 6eb9c9dafd02b6a0236074e3ee7acee9e2271308 Author: Linus Walleij Date: Wed Jul 11 19:45:11 2018 +0200 of: mdio: Support fixed links in of_phy_get_and_connect() By a simple extension of of_phy_get_and_connect() drivers that have a fixed link on e.g. RGMII can support also fixed links, so in addition to: ethernet-port { phy-mode = "rgmii"; phy-handle = <&foo>; }; This setup with a fixed-link node and no phy-handle will now also work just fine: ethernet-port { phy-mode = "rgmii"; fixed-link { speed = <1000>; full-duplex; pause; }; }; This is very helpful for connecting random ethernet ports to e.g. DSA switches that typically reside on fixed links. The phy-mode is still there as the fixes link in this case is still an RGMII link. Tested on the Cortina Gemini driver with the Vitesse DSA router chip on a fixed 1Gbit link. Suggested-by: Andrew Lunn Signed-off-by: Linus Walleij Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 01683a1469995cc7aaf833d6f8b3f1c1d2fc3b92 Author: Vlad Buslov Date: Mon Jul 9 13:29:11 2018 +0300 net: sched: refactor flower walk to iterate over idr Extend struct tcf_walker with additional 'cookie' field. It is intended to be used by classifier walk implementations to continue iteration directly from particular filter, instead of iterating 'skip' number of times. Change flower walk implementation to save filter handle in 'cookie'. Each time flower walk is called, it looks up filter with saved handle directly with idr, instead of iterating over filter linked list 'skip' number of times. This change improves complexity of dumping flower classifier from quadratic to linearithmic. (assuming idr lookup has logarithmic complexity) Reviewed-by: Jiri Pirko Signed-off-by: Vlad Buslov Reported-by: Simon Horman Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit d23b27c02f03438ac1867b4b6a484b92f536bd28 Author: Jesper Dangaard Brouer Date: Fri Jul 13 16:35:14 2018 +0200 samples/bpf: xdp_redirect_cpu handle parsing of double VLAN tagged packets People noticed that the code match on IEEE 802.1ad (ETH_P_8021AD) ethertype, and this implies Q-in-Q or double tagged VLANs. Thus, we better parse the next VLAN header too. It is even marked as a TODO. This is relevant for real world use-cases, as XDP cpumap redirect can be used when the NIC RSS hashing is broken. E.g. the ixgbe driver HW cannot handle double tagged VLAN packets, and places everything into a single RX queue. Using cpumap redirect, users can redistribute traffic across CPUs to solve this, which is faster than the network stacks RPS solution. It is left as an exerise how to distribute the packets across CPUs. It would be convenient to use the RX hash, but that is not _yet_ exposed to XDP programs. For now, users can code their own hash, as I've demonstrated in the Suricata code (where Q-in-Q is handled correctly). Reported-by: Florian Maury Reported-by: Marek Majkowski Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann commit 60a94324541361542f1ffb12844f4cb737695ba5 Author: Chris Wilson Date: Fri Jul 13 21:35:29 2018 +0100 drm/i915/execlists: Drop clear_gtiir() on GPU reset With the new CSB processing code, we are not vulnerable to delayed delivery of a pre-reset interrupt as we use the CSB status pointers in the HWSP to decide if we need to parse any CSB events and no longer need to wait for the first post-reset interrupt to be assured that the CSB mmio registers are valid. The new icl code to clear registers has a nasty lock inversion: [ 57.409776] ====================================================== [ 57.409779] WARNING: possible circular locking dependency detected [ 57.409783] 4.18.0-rc4-CI-CI_DII_1137+ #1 Tainted: G U W [ 57.409785] ------------------------------------------------------ [ 57.409788] swapper/6/0 is trying to acquire lock: [ 57.409790] 000000004f304ee5 (&engine->timeline.lock/1){-.-.}, at: execlists_submit_request+0x2b/0x1a0 [i915] [ 57.409841] but task is already holding lock: [ 57.409844] 00000000aad89594 (&(&rq->lock)->rlock#2){-.-.}, at: notify_ring+0x2b2/0x480 [i915] [ 57.409869] which lock already depends on the new lock. [ 57.409872] the existing dependency chain (in reverse order) is: [ 57.409876] -> #2 (&(&rq->lock)->rlock#2){-.-.}: [ 57.409900] notify_ring+0x2b2/0x480 [i915] [ 57.409922] gen8_cs_irq_handler+0x39/0xa0 [i915] [ 57.409943] gen11_irq_handler+0x2f0/0x420 [i915] [ 57.409949] __handle_irq_event_percpu+0x42/0x370 [ 57.409952] handle_irq_event_percpu+0x2b/0x70 [ 57.409956] handle_irq_event+0x2f/0x50 [ 57.409959] handle_edge_irq+0xe7/0x190 [ 57.409964] handle_irq+0x67/0x160 [ 57.409967] do_IRQ+0x5e/0x120 [ 57.409971] ret_from_intr+0x0/0x1d [ 57.409974] _raw_spin_unlock_irqrestore+0x4e/0x60 [ 57.409979] tasklet_action_common.isra.5+0x47/0xb0 [ 57.409982] __do_softirq+0xd9/0x505 [ 57.409985] irq_exit+0xa9/0xc0 [ 57.409988] do_IRQ+0x9a/0x120 [ 57.409991] ret_from_intr+0x0/0x1d [ 57.409995] cpuidle_enter_state+0xac/0x360 [ 57.409999] do_idle+0x1f3/0x250 [ 57.410004] cpu_startup_entry+0x6a/0x70 [ 57.410010] start_secondary+0x19d/0x1f0 [ 57.410015] secondary_startup_64+0xa5/0xb0 [ 57.410018] -> #1 (&(&dev_priv->irq_lock)->rlock){-.-.}: [ 57.410081] clear_gtiir+0x30/0x200 [i915] [ 57.410116] execlists_reset+0x6e/0x2b0 [i915] [ 57.410140] i915_reset_engine+0x111/0x190 [i915] [ 57.410165] i915_handle_error+0x11a/0x4a0 [i915] [ 57.410198] i915_hangcheck_elapsed+0x378/0x530 [i915] [ 57.410204] process_one_work+0x248/0x6c0 [ 57.410207] worker_thread+0x37/0x380 [ 57.410211] kthread+0x119/0x130 [ 57.410215] ret_from_fork+0x3a/0x50 [ 57.410217] -> #0 (&engine->timeline.lock/1){-.-.}: [ 57.410224] _raw_spin_lock_irqsave+0x33/0x50 [ 57.410256] execlists_submit_request+0x2b/0x1a0 [i915] [ 57.410289] submit_notify+0x8d/0x124 [i915] [ 57.410314] __i915_sw_fence_complete+0x81/0x250 [i915] [ 57.410339] dma_i915_sw_fence_wake+0xd/0x20 [i915] [ 57.410344] dma_fence_signal_locked+0x79/0x200 [ 57.410368] notify_ring+0x2ba/0x480 [i915] [ 57.410392] gen8_cs_irq_handler+0x39/0xa0 [i915] [ 57.410416] gen11_irq_handler+0x2f0/0x420 [i915] [ 57.410421] __handle_irq_event_percpu+0x42/0x370 [ 57.410425] handle_irq_event_percpu+0x2b/0x70 [ 57.410428] handle_irq_event+0x2f/0x50 [ 57.410432] handle_edge_irq+0xe7/0x190 [ 57.410436] handle_irq+0x67/0x160 [ 57.410439] do_IRQ+0x5e/0x120 [ 57.410445] ret_from_intr+0x0/0x1d [ 57.410449] cpuidle_enter_state+0xac/0x360 [ 57.410453] do_idle+0x1f3/0x250 [ 57.410456] cpu_startup_entry+0x6a/0x70 [ 57.410460] start_secondary+0x19d/0x1f0 [ 57.410464] secondary_startup_64+0xa5/0xb0 [ 57.410466] other info that might help us debug this: [ 57.410471] Chain exists of: &engine->timeline.lock/1 --> &(&dev_priv->irq_lock)->rlock --> &(&rq->lock)->rlock#2 [ 57.410481] Possible unsafe locking scenario: [ 57.410485] CPU0 CPU1 [ 57.410487] ---- ---- [ 57.410490] lock(&(&rq->lock)->rlock#2); [ 57.410494] lock(&(&dev_priv->irq_lock)->rlock); [ 57.410498] lock(&(&rq->lock)->rlock#2); [ 57.410503] lock(&engine->timeline.lock/1); [ 57.410506] *** DEADLOCK *** [ 57.410511] 4 locks held by swapper/6/0: [ 57.410514] #0: 0000000074575789 (&(&dev_priv->irq_lock)->rlock){-.-.}, at: gen11_irq_handler+0x8a/0x420 [i915] [ 57.410542] #1: 000000009b29b30e (rcu_read_lock){....}, at: notify_ring+0x1a/0x480 [i915] [ 57.410573] #2: 00000000aad89594 (&(&rq->lock)->rlock#2){-.-.}, at: notify_ring+0x2b2/0x480 [i915] [ 57.410601] #3: 000000009b29b30e (rcu_read_lock){....}, at: submit_notify+0x35/0x124 [i915] [ 57.410635] stack backtrace: [ 57.410640] CPU: 6 PID: 0 Comm: swapper/6 Tainted: G U W 4.18.0-rc4-CI-CI_DII_1137+ #1 [ 57.410644] Hardware name: Intel Corporation Ice Lake Client Platform/IceLake U DDR4 SODIMM PD RVP, BIOS ICLSFWR1.R00.2222.A01.1805300339 05/30/2018 [ 57.410650] Call Trace: [ 57.410652] [ 57.410657] dump_stack+0x67/0x9b [ 57.410662] print_circular_bug.isra.16+0x1c8/0x2b0 [ 57.410666] __lock_acquire+0x1897/0x1b50 [ 57.410671] ? lock_acquire+0xa6/0x210 [ 57.410674] lock_acquire+0xa6/0x210 [ 57.410706] ? execlists_submit_request+0x2b/0x1a0 [i915] [ 57.410711] _raw_spin_lock_irqsave+0x33/0x50 [ 57.410741] ? execlists_submit_request+0x2b/0x1a0 [i915] [ 57.410769] execlists_submit_request+0x2b/0x1a0 [i915] [ 57.410774] ? _raw_spin_unlock_irqrestore+0x39/0x60 [ 57.410804] submit_notify+0x8d/0x124 [i915] [ 57.410828] __i915_sw_fence_complete+0x81/0x250 [i915] [ 57.410854] dma_i915_sw_fence_wake+0xd/0x20 [i915] [ 57.410858] dma_fence_signal_locked+0x79/0x200 [ 57.410882] notify_ring+0x2ba/0x480 [i915] [ 57.410907] gen8_cs_irq_handler+0x39/0xa0 [i915] [ 57.410933] gen11_irq_handler+0x2f0/0x420 [i915] [ 57.410938] __handle_irq_event_percpu+0x42/0x370 [ 57.410943] handle_irq_event_percpu+0x2b/0x70 [ 57.410947] handle_irq_event+0x2f/0x50 [ 57.410951] handle_edge_irq+0xe7/0x190 [ 57.410955] handle_irq+0x67/0x160 [ 57.410958] do_IRQ+0x5e/0x120 [ 57.410962] common_interrupt+0xf/0xf [ 57.410965] [ 57.410969] RIP: 0010:cpuidle_enter_state+0xac/0x360 [ 57.410972] Code: 44 00 00 31 ff e8 84 93 91 ff 45 84 f6 74 12 9c 58 f6 c4 02 0f 85 31 02 00 00 31 ff e8 7d 30 98 ff e8 e8 0e 94 ff fb 4c 29 fb <48> ba cf f7 53 e3 a5 9b c4 20 48 89 d8 48 c1 fb 3f 48 f7 ea b8 ff [ 57.411015] RSP: 0018:ffffc90000133e90 EFLAGS: 00000216 ORIG_RAX: ffffffffffffffdd [ 57.411023] RAX: ffff8804ae748040 RBX: 000000000002a97d RCX: 0000000000000000 [ 57.411029] RDX: 0000000000000046 RSI: ffffffff82141263 RDI: ffffffff820f05a7 [ 57.411035] RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000 [ 57.411041] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff8229f078 [ 57.411045] R13: ffff8804ab2adfa8 R14: 0000000000000000 R15: 0000000d5de092e3 [ 57.411052] do_idle+0x1f3/0x250 [ 57.411055] cpu_startup_entry+0x6a/0x70 [ 57.411059] start_secondary+0x19d/0x1f0 [ 57.411064] secondary_startup_64+0xa5/0xb0 The easiest remedy is to remove the defunct code. Fixes: ff047a87cfac ("drm/i915/icl: Correctly clear lost ctx-switch interrupts across reset for Gen11") References: fd8526e50902 ("drm/i915/execlists: Trust the CSB") Signed-off-by: Chris Wilson Cc: Michel Thierry Cc: Oscar Mateo Cc: Tvrtko Ursulin Cc: Daniele Ceraolo Spurio Reviewed-by: Michel Thierry Link: https://patchwork.freedesktop.org/patch/msgid/20180713203529.1973-3-chris@chris-wilson.co.uk commit 9701975e851082d179faaab9c6306a7800d86c0f Author: Chris Wilson Date: Fri Jul 13 21:35:28 2018 +0100 drm/i915: Do not short-circuit tasklets during reset Inside intel_engine_is_idle(), we flush the tasklet to ensure that is being run in a timely fashion (ksoftirqd has taught us to expect the worst). However, if we are in the middle of reset, the HW may not yet be ready to execute the submission tasklet and so we must respect the disable flag. Fixes: dd0cf235d81f ("drm/i915: Speed up idle detection by kicking the tasklets") Testcase: igt/drv_selftest/live_hangcheck Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Reviewed-by: Michel Thierry Link: https://patchwork.freedesktop.org/patch/msgid/20180713203529.1973-2-chris@chris-wilson.co.uk commit 9dd1a981a22a6c5416e9a179912fb1215225235f Author: Chris Wilson Date: Fri Jul 13 21:35:27 2018 +0100 drm/i915/selftests: Include the start of each subtest in the GEM trace Knowing the boundary of each subtest can be instrumental in digesting the voluminous trace output and finding the critical piece of information. Signed-off-by: Chris Wilson Reviewed-by: Michel Thierry Link: https://patchwork.freedesktop.org/patch/msgid/20180713203529.1973-1-chris@chris-wilson.co.uk commit c921c2077b32081617789a645120148bc8b60c98 Author: Nikolay Aleksandrov Date: Fri Jul 13 12:16:43 2018 +0300 net: ipmr: add support for passing full packet on wrong vif This patch adds support for IGMPMSG_WRVIFWHOLE which is used to pass full packet and real vif id when the incoming interface is wrong. While the RP and FHR are setting up state we need to be sending the registers encapsulated with all the data inside otherwise we lose it. The RP then decapsulates it and forwards it to the interested parties. Currently with WRONGVIF we can only be sending empty register packets and will lose that data. This behaviour can be enabled by using MRT_PIM with val == IGMPMSG_WRVIFWHOLE. This doesn't prevent IGMPMSG_WRONGVIF from happening, it happens in addition to it, also it is controlled by the same throttling parameters as WRONGVIF (i.e. 1 packet per 3 seconds currently). Both messages are generated to keep backwards compatibily and avoid breaking someone who was enabling MRT_PIM with val == 4, since any positive val is accepted and treated the same. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 4d663df6588709e8763b976310117aa0f9825bc6 Author: Yong Zhao Date: Fri Jul 13 16:17:48 2018 -0400 drm/amdkfd: Enable Raven for KFD Add DID and kfd_device_info for Raven. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Oded Gabbay commit 359cecdd499783abcf4ba6589066db8d8cb58e88 Author: Yong Zhao Date: Fri Jul 13 16:17:47 2018 -0400 drm/amdkfd: Optimize out some duplicated code in kfd_signal_iommu_event() memory_exception_data is already initialized for not-present faults. It only needs to be overridden for permission faults. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Oded Gabbay commit 8725aecac331954e0827d6bed7be02eb7b8f1e9e Author: Yong Zhao Date: Fri Jul 13 16:17:46 2018 -0400 drm/amdkfd: Workaround to accommodate Raven too many PPR issue On Raven multiple PPRs can be queued up by the hardware. When the first of those requests is handled by the IOMMU driver, the memory access succeeds. After that the application may be done with the memory and unmap it. At that point the page table entries are invalidated, but there are still outstanding duplicate PPRs for those addresses. When the IOMMU driver processes those duplicate requests, it finds invalid page table entries and triggers an invalid PPR fault. As a workaround, don't signal invalid PPR faults on Raven to avoid segfaulting applications that haven't done anything wrong. As a side effect, real GPU memory access faults may go unnoticed by the application. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Oded Gabbay commit eab69801cf4388aeba2c730ce4db746ae164eada Author: Yong Zhao Date: Fri Jul 13 16:17:45 2018 -0400 drm/amdkfd: Avoid flooding dmesg on Raven due to IOMMU issues On Raven Invalid PPRs (peripheral page requests) can be reported because multiple PPRs can be still queued when memory is freed. Apply a rate limit to avoid flooding the log in this case. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Oded Gabbay commit 98bb92222eef6ac022f352aa4224f4c94a119199 Author: Yong Zhao Date: Fri Jul 13 16:17:44 2018 -0400 drm/amdkfd: Make SDMA engine number an ASIC-dependent variable On Raven there is only one SDMA engine instead of previously assumed two, so we need to adapt our code to this new scenario. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Oded Gabbay commit f3ed5df84c268235fb1d489ab8979af423da02de Author: Yong Zhao Date: Fri Jul 13 16:17:43 2018 -0400 drm/amdkfd: Consolidate duplicate memory banks info in topology If there are several memory banks that has the same properties in CRAT, we aggregate them into one memory bank. This cleans up memory banks on APUs (e.g. Raven) where the CRAT reports each memory channel as a separate bank. This only confuses user mode, which only deals with virtual memory. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Oded Gabbay commit ee15f7cdf0fcd605d521a55fca375fd87a965776 Merge: 9c48b1d116cd 5f4284015e29 Author: Daniel Borkmann Date: Fri Jul 13 20:26:36 2018 +0200 Merge branch 'bpf-xdp-driver-and-hw' Jakub Kicinski says: ==================== This set is adding support for loading driver and offload XDP at the same time. This enables advanced use cases where some of the work is offloaded to the NIC and some is done by the host. Separate netlink attributes are added for each mode of operation. Driver callbacks for offload are cleaned up a little, including removal of .prog_attached flag. ==================== Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit d92867122cd952485a4d209829bfa935689b14fe Author: Alex Deucher Date: Thu Jul 12 00:38:23 2018 -0500 drm/amdgpu/pp/smu7: cache smu firmware toc Rather than calculating it everytime we rebuild the toc buffer, calculate it once initially and then just copy the cached results to the vram buffer. Acked-by: Christian König Signed-off-by: Alex Deucher commit 82088d5d7de1ef3575206cc3284dc219d0bd8fab Author: Alex Deucher Date: Wed Jul 11 13:43:40 2018 -0500 drm/amdgpu/pp/smu7: remove local mc_addr variable use the structure member directly. Acked-by: Christian König Signed-off-by: Alex Deucher commit 2bce4be03738bc679c61f74fd42dd9e45c9a9959 Author: Alex Deucher Date: Wed Jul 11 13:24:53 2018 -0500 drm/amdgpu/pp/smu7: drop unused values in smu data structure use kaddr directly rather than secondary variable. Acked-by: Christian König Signed-off-by: Alex Deucher commit 3d75a8b689af2824dabe79d250b1ec535341109d Author: Alex Deucher Date: Thu Jul 12 08:38:09 2018 -0500 drm/amdgpu/pp/smu7: use a local variable for toc indexing Rather than using the index variable stored in vram. If the device fails to come back online after a resume cycle, reads from vram will return all 1s which will cause a segfault. Based on a patch from Thomas Martitz . This avoids the segfault, but we still need to sort out why the GPU does not come back online after a resume. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105760 Acked-by: Christian König Signed-off-by: Alex Deucher commit 3f2ddfa8875ce71a8c12723d1841647af8cbb0ba Author: Alex Deucher Date: Tue Jul 10 16:51:22 2018 -0500 drm/amdgpu/vi: fix mixed up state in smu clockgating setup Use the PP_STATE_SUPPORT_* rather than AMD_CG_SUPPORT_* when communicating with the SMU. Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit ec95213112dca6111eb7561ae6384f77017dfd1f Author: Dmytro Laktyushkin Date: Wed Jul 4 11:31:40 2018 -0400 drm/amd/display: properly turn autocal off [why] Currently we do not turn off autocal when scaling is in bypass. In case vbios enalbes auto scale and our first mode set is a non-scaled mode we have autocal on causing screen corruption. [how] moves turning autocal off to be first thing done during scaler setup Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 522e6b434a61f8be910560969386a2b3ce113c1b Author: Hugo Hu Date: Tue Jul 3 15:59:15 2018 -0400 drm/amd/display: Initialize data structure for DalMpVisualConfirm. [Why] Prevent unexpected color shows if DalMpVisualConfirm enable. [How] Zero out color configuration data for DalMpVisualConfirm when initiating. Signed-off-by: Hugo Hu Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit cc034fed70d2d41ac7726d1c9872a80f035f8692 Author: Tony Cheng Date: Tue Jun 5 09:15:41 2018 -0400 drm/amd/display: dal 3.1.55 Signed-off-by: Tony Cheng Reviewed-by: Anthony Koo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 5fbac0a5ff99071919976a5434b19e9cc792a2ca Author: Dmytro Laktyushkin Date: Thu Jun 28 11:31:13 2018 -0400 drm/amd/display: update dml to match DV dml DV updated their dml with an option to use max vstartup, this updates dc dml with the same option Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit dbcac9c8abb117b11728da44fcaffcdc0d2fcc81 Author: Dmytro Laktyushkin Date: Thu Jun 28 12:28:00 2018 -0400 drm/amd/display: add max scl ratio to soc bounding box Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit ece4147fea152fe0761d67b825fb4b4b9f94349b Author: Ken Chalmers Date: Wed Jun 27 12:48:21 2018 -0400 drm/amd/display: Fix new stream count check in dc_add_stream_to_ctx [Why] The previous code could allow through attempts to enable more streams than there are timing generators, in designs where the number of pipes is greater than the number of timing generators. [How] Compare the new stream count to the resource pool's timing generator count, instead of its pipe count. Also correct a typo in the error message. Signed-off-by: Ken Chalmers Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 245524d9b827e184de1a23aff24c7872fed04cdb Author: Hersen Wu Date: Wed Jun 27 13:03:04 2018 -0400 drm/amd/display: dp debugfs allow link rate lane count greater than dp rx reported caps [Why] when hw team does phy parameters tuning, there is need to force dp link rate or lane count grater than the values from dp receiver to check dp tx. current debufs limit link rate, lane count no more than rx caps. [How] remove force settings less than rx caps check v2: Fix typo in title Signed-off-by: Hersen Wu Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit aca3e9a49b200d56e4dd0a21bbb443e96a482fd9 Author: David Francis Date: Wed Jun 27 15:55:57 2018 -0400 drm/amd/display: Expose couple OPTC functions through header Signed-off-by: David Francis Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 99a100ae327c2d9c89740bd556cc128f666ba71b Author: David Francis Date: Tue Jun 26 14:58:15 2018 -0400 drm/amd/display: Add CRC support for DCN [Why] Regamma/CTM tests require CRC support [How] The CRC registers that were used in DCE exist under different names in DCN. The code was copied from DCE (in dc/dce110/dce110_timing_generator.c) into DCN, and changed to use the DCN register access helper functions. Signed-off-by: David Francis Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 4e18814eeec946fa864723423c9a607815ede5cb Author: Fatemeh Darbehani Date: Tue Jun 26 16:40:55 2018 -0400 drm/amd/display: Return out_link_loss from interrupt handler Signed-off-by: Fatemeh Darbehani Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 6c4fff068f7940993b3ec74a9996f4b514089d1a Author: Yue Hin Lau Date: Wed Jun 27 13:49:20 2018 -0400 drm/amd/display: Add NULL check for local sink in edp_power_control [WHY] PNP cause bsod regression fix [HOW] Add NULL check Signed-off-by: Yue Hin Lau Reviewed-by: Hugo Hu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit c2c09ed5cd1b7423b2d2bf372e4c62394264324d Author: Mikita Lipski Date: Tue Jun 26 09:52:29 2018 -0400 drm/amd/display: add pp to dc powerlevel enum translator [why] Add a switch statement to translate pp's powerlevel enum to dc powerlevel statement enum [how] Add a translator function Signed-off-by: Mikita Lipski Reviewed-by: Sun peng Li Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 8fc0a0d4a0a49ed148db2e484539516ad67b6321 Author: Charlene Liu Date: Tue Jun 26 18:49:32 2018 -0400 drm/amd/display: add DalEnableHDMI20 key support [why] "DalEnableHDMI20" set to 0, disallow HDMI YCbCr420 and pixel clock > 340Mhz Default is enabled. Signed-off-by: Charlene Liu Reviewed-by: Jun Lei Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit e0d85b20c74fc078862262da64b36e8e7b6663e7 Author: Charlene Liu Date: Mon Jun 25 19:28:54 2018 -0400 drm/amd/display: introduce concept of send_reset_length for i2c engines Signed-off-by: Charlene Liu Reviewed-by: Dmytro Laktyushkin Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit edf6ffe4f47e6749cfd45c1489feea2dbb0041c7 Author: Leo (Sunpeng) Li Date: Tue Jun 26 10:50:16 2018 -0400 drm/amd/display: Read AUX channel even if only status byte is returned [Why] get_channel_status() can return 0 in returned_bytes, and report a successful operation result. This is because it prunes the first status byte out. This was preventing read_channel_reply() from being called (due to the faulty condition), and consequently preventing the AUX reply status from being set. [How] Fix the conditional so that it accounts for when get_channel_status() returns 0 bytes read. [Fixes] Fixes possible edid read failures during S3 resume, where we are now relying on DRM's DP AUX handling. This was an regression introduced by: Author: Harry Wentland drm/amd/display: Return aux replies directly to DRM Signed-off-by: Leo (Sunpeng) Li Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 3092108904461dd50b1502f3a2977a4259d91044 Author: Leo (Sunpeng) Li Date: Tue Jun 26 10:44:05 2018 -0400 drm/amd/display: Right shift AUX reply value sooner than later [Why] There is no point in keeping the AUX reply value in the raw format as returned from reading the AUX_SW_DATA register. [How] Shift it within read_channel_reply(), where the register is read, before returning it. Signed-off-by: Leo (Sunpeng) Li Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit c2437b1f16d9b136c88b2c7c0254919a0e1311f6 Author: Eric Bernstein Date: Wed May 16 16:19:50 2018 -0400 drm/amd/display: Expose bunch of functions from dcn10_hw_sequencer v2: Remove spurious newline changes Signed-off-by: Eric Bernstein Reviewed-by: Dmytro Laktyushkin Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit e7baae1cfb7fd1a31fa8c968403cbc761cf999ff Author: Jerry (Fangzhi) Zuo Date: Fri Jun 22 17:12:47 2018 -0400 drm/amd/display: Add YCbCr420 only support for HDMI 4K@60 [Why] Some monitors mark 4K@60 capable HDMI port only have 300MHz TMDS maximum, but the edid includes 4K@60 mode in cea extension block. [How] To enable 4K@60, need to limit BW by allowing YCbCr420 ONLY mode. Add YCbCr420 only support for monitors that do not fully support HDMI2.0, e.g., ASUS PA328. The YCbCr420 only support applies to DCN, DCE112 or higher. Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 76fbdc63daaa216bdbd294e4d7ac6a35e1470126 Author: Tony Cheng Date: Tue Jun 5 09:15:15 2018 -0400 drm/amd/display: dal 3.1.54 Signed-off-by: Tony Cheng Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 53a599de5560b95bf76bc12d17b93406c33e9f75 Author: Hersen Wu Date: Fri Jun 22 13:06:01 2018 -0400 drm/amd/display: Linux hook test pattern through debufs bug fix: phy test PLTAT is special 80bit test pattern. The 80bit data should be hard coded within driver so that user does not need input the deata. previous driver does not have hard coded 80 bits pattern data for PLTPAT. Other than this PLTPAT, user has to input 80 bits pattern data. In case user input less than 10 bytes data, un-input data byte will be filled by 0x00. Signed-off-by: Hersen Wu Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit ac99243c8db70c9b5497a9c75c53f6bfd19b572a Author: Yongqiang Sun Date: Mon Jun 25 00:18:54 2018 +0800 drm/amd/display: expose dcn10_aux_initialize in header Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 08ed681c8453c2934136bcc3b30bca4dee8a5fca Author: Dmytro Laktyushkin Date: Thu Jun 21 13:33:41 2018 -0400 drm/amd/display: add dcn cursor hotsport rotation and mirror support Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 613cb725dc6cb6039b37d2b71c90a70d49780ce5 Author: Charlene Liu Date: Thu Jun 21 21:32:36 2018 -0400 drm/amd/display: set default GPIO_ID_HPD Signed-off-by: Charlene Liu Reviewed-by: Dmytro Laktyushkin Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit abfa99f4d2f1d1a0018f8f39fc1958eda6a48dde Author: Charlene Liu Date: Thu Jun 21 17:57:51 2018 -0400 drm/amd/display: add missing mask for dcn Signed-off-by: Charlene Liu Reviewed-by: Wesley Chalmers Reviewed-by: Duke Du Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 1a2eaed80a0bd19f69da880d87f037f5829fb664 Author: Leo (Sunpeng) Li Date: Mon Jun 18 12:23:03 2018 -0400 drm/amd/display: Fix compile error on older GCC versions GCC 4.9 reports a 'missing braces around initializer' error. This is a bug, documented here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 Fix it by adding another brace. Signed-off-by: Leo (Sunpeng) Li Reviewed-by: Mikita Lipski Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit f8ac2cf78f276b4d9fc0bc6b90f5e3560caa11de Author: Hersen Wu Date: Fri Jun 15 10:32:50 2018 -0400 drm/amd/display: Linux set/read lane settings through debugfs function: get current DP PHY settings: voltage swing, pre-emphasis, post-cursor2 (defined by VESA DP specification) valid values: voltage swing: 0,1,2,3 pre-emphasis : 0,1,2,3 post cursor2 : 0,1,2,3 debugfs file phy_setings is located at /sys/kernel/debug/dri/0/DP-x there will be directories, like DP-1, DP-2,DP-3, etc. for DP display --- to figure out which DP-x is the display for DP to be check, cd DP-x ls -ll There should be debugfs file, like link_settings, phy_settings. cat link_settings from lane_count, link_rate to figure which DP-x is for display to be worked on --- to get current DP PHY settings, cat phy_settings --- to change DP PHY settings, echo > phy_settings for examle, to change voltage swing to 2, pre-emphasis to 3, post_cursor2 to 0, echo 2 3 0 > phy_settings --- to check if change be applied, get current phy settings by cat phy_settings --- in case invalid values are set by user, like echo 1 4 0 > phy_settings HW will NOT be programmed by these settings. cat phy_settings will show the previous valid settings. Signed-off-by: Hersen Wu Reviewed-by: Harry Wentland Reviewed-by: Hersen Wu Signed-off-by: Alex Deucher commit ff58798725ba9c747cd934e2623f7a0610b3f0dd Author: Hugo Hu Date: Fri Jun 15 15:49:55 2018 -0400 drm/amd/display: Patch for extend time to panel poweron. [WHY] In eDP spec, the min duration in LCDVDD on-off-on sequence should be 500ms, some BOE panels need 700ms to pass. [HOW] Add patch to wait more time when eDP power on. Signed-off-by: Hugo Hu Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 39a9f4d89e123b62c8a5cc26696ea8afa98e0e88 Author: Dmytro Laktyushkin Date: Tue Jun 19 15:49:02 2018 -0400 drm/amd/display: add additional info for cursor position programming Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 793d4d087f9ff365031a62b30d6578686ae1765b Author: Dmytro Laktyushkin Date: Wed Jun 20 11:40:15 2018 -0400 drm/amd/display: drop unused register defines Signed-off-by: Dmytro Laktyushkin Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 05541913a97053e58669ea5817fa5000b836f834 Author: Dmytro Laktyushkin Date: Wed Jun 13 13:52:53 2018 -0400 drm/amd/display: remove dentist_vco_freq from resource_pool Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0a1d56599b9bb58464a8bf1243191eb32b36b694 Author: Hersen Wu Date: Tue Jun 19 12:14:29 2018 -0400 drm/amd/display: hook dp test pattern through debugfs set PHY layer or Link layer test pattern PHY test pattern is used for PHY SI check. Link layer test will not affect PHY SI. - normal video mode 0 = DP_TEST_PATTERN_VIDEO_MODE - PHY test pattern supported 1 = DP_TEST_PATTERN_D102 2 = DP_TEST_PATTERN_SYMBOL_ERROR 3 = DP_TEST_PATTERN_PRBS7 4 = DP_TEST_PATTERN_80BIT_CUSTOM 5 = DP_TEST_PATTERN_CP2520_1 6 = DP_TEST_PATTERN_CP2520_2 = DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE 7 = DP_TEST_PATTERN_CP2520_3 - DP PHY Link Training Patterns 8 = DP_TEST_PATTERN_TRAINING_PATTERN1 9 = DP_TEST_PATTERN_TRAINING_PATTERN2 0xa = DP_TEST_PATTERN_TRAINING_PATTERN3 0xb = DP_TEST_PATTERN_TRAINING_PATTERN4 - DP Link Layer Test pattern 0xc = DP_TEST_PATTERN_COLOR_SQUARES 0xd = DP_TEST_PATTERN_COLOR_SQUARES_CEA 0xe = DP_TEST_PATTERN_VERTICAL_BARS 0xf = DP_TEST_PATTERN_HORIZONTAL_BARS 0x10= DP_TEST_PATTERN_COLOR_RAMP debugfs phy_test_pattern is located at /syskernel/debug/dri/0/DP-x --- set test pattern echo > test_pattern - custom test pattern If test pattern # is not supported, NO HW programming will be done for DP_TEST_PATTERN_80BIT_CUSTOM, it needs extra 10 bytes of data for the user pattern. input 10 bytes data are separated by space echo 0x4 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 0x99 0xaa > test_pattern --- reset test pattern echo 0 > test_pattern --- HPD detection is disabled when set PHY test pattern when PHY test pattern (pattern # within [1,7]) is set, HPD pin of HW ASIC is disable. User could unplug DP display from DP connected and plug scope to check test pattern PHY SI. If there is need unplug scope and plug DP display back, do steps below: echo 0 > phy_test_pattern unplug scope plug DP display. "echo 0 > phy_test_pattern" will re-enable HPD pin again so that video sw driver could detect "unplug scope" and "plug DP display" Signed-off-by: Hersen Wu Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 30cdbfaa6aa469347db7fcda5949f1ccf7559ecf Author: Dmytro Laktyushkin Date: Wed Jun 13 13:58:14 2018 -0400 drm/amd/display: dcc always on for bw calculations on raven Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 4b99affbb30027c8414a9d583777ad5c6439ae12 Author: Alvin lee Date: Tue Jun 19 15:40:09 2018 -0400 drm/amd/display: read DP sink and DP branch hardware and firmware revision from DPCD - define new dpcd address in drm - implement new members in dpcd_caps to store values read from new dpcd address Signed-off-by: Alvin lee Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit e1cb3e4801e6896ba93d63222b1052199d2a8c9b Author: Nicholas Kazlauskas Date: Tue Jun 19 09:58:24 2018 -0400 drm/amd/display: Convert remaining loggers off dc_logger - Removed dal/dm/dc loggers from linux, switched to kernel prints - Modified functions that used these directly to use macros - dc_logger support is completely dropped from Linux Signed-off-by: Nicholas Kazlauskas Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 084b3765ec4baf8b7de57e7dc1e1ba1b6905e9d9 Author: Harry Wentland Date: Wed May 9 16:26:17 2018 -0400 drm/amd/display: Return aux replies directly to DRM Currently we still go through DC code that does error checking, retries, etc. There's no need for that since DRM already does that for us. This simplifies the code a bit and makes it easier to debug. This also ensures we correctly tell DRM how many bytes have actually been read, as we should. This allows DRM to correctly read the EDID on the Chamelium DP port. Signed-off-by: Harry Wentland Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 899e2aaddbfa0ff96fbaf31f0d9e91427e87dd88 Author: Harry Wentland Date: Tue May 8 16:28:31 2018 -0400 drm/amd/display: Break out function to simply read aux reply DRM's DP helpers take care of dealing with the error code for us. In order not to step on each other's toes we'll need to be able to simply read auch channel replies without further logic based on return values. Signed-off-by: Harry Wentland Reviewed-by: Sun peng Li Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit aac5db824d6f5997344101ae0e71fbb003b9692b Author: Harry Wentland Date: Tue May 29 13:11:55 2018 -0400 drm/amd/display: Serialize is_dp_sink_present Access to GPIO needs to be serialized. Aux transactions are already serialized in DRM but we also need to serialize access to the GPIO pin for purposes of DP dongle detection. Call is_dp_sink_present through DM so we can lock correctly. This follows the same pattern used for DPCD transactions. Signed-off-by: Harry Wentland Reviewed-by: Jun Lei Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 1bd493e37807c4bf7ee8c4809d2d83545379c04d Author: Tony Cheng Date: Mon Jun 18 18:32:43 2018 -0400 drm/amd/display: Expose configure_encoder for link_encoder Signed-off-by: Tony Cheng Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 8e8539c2fcdf65b6a2e6ceb93e56034896e47dd0 Author: Charlene Liu Date: Mon Jun 18 19:50:07 2018 -0400 drm/amd/display: Define couple extra DCN registers Signed-off-by: Charlene Liu Reviewed-by: Dmytro Laktyushkin Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0252c9425f20ade8bfcb5ad4f1e150940acbe39c Author: Eric Bernstein Date: Mon Jun 18 15:45:07 2018 -0400 drm/amd/display: Add Azalia registers to HW sequencer Signed-off-by: Eric Bernstein Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 93ed1814c668fb13f3b23b629528e90a2b0d5ea3 Author: Hugo Hu Date: Mon Jun 18 15:27:58 2018 -0400 drm/amd/display: Correct calculation of duration time. Signed-off-by: Hugo Hu Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit c9ff778b291b95f6f7c0aa764c714ca88cc49f7b Author: Tony Cheng Date: Tue Jun 5 09:14:56 2018 -0400 drm/amd/display: dal 3.1.53 Signed-off-by: Tony Cheng Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 41db5f1931ec73f2d909752e09ffb691fecdaaa1 Author: Hersen Wu Date: Fri Jun 15 14:25:48 2018 -0400 drm/amd/display: set-read link rate and lane count through debugfs function description get/ set DP configuration: lane_count, link_rate, spread_spectrum valid lane count value: 1, 2, 4 valid link rate value: 06h = 1.62Gbps per lane 0Ah = 2.7Gbps per lane 0Ch = 3.24Gbps per lane 14h = 5.4Gbps per lane 1Eh = 8.1Gbps per lane debugfs is located at /sys/kernel/debug/dri/0/DP-x/link_settings --- to get dp configuration xxd -l 300 phy_settings It will list current, verified, reported, preferred dp configuration. current -- for current video mode verified --- maximum configuration which pass link training reported --- DP rx report caps (DPCD register offset 0, 1 2) preferred --- user force settings --- set (or force) dp configuration echo for example, to force to 2 lane, 2.7GHz, echo 4 0xa > link_settings spread_spectrum could not be changed dynamically. in case invalid lane count, link rate are force, no hw programming will be done. please check link settings after force operation to see if HW get programming. xxd -l 300 link_settings check current and preferred settings. Signed-off-by: Hersen Wu Reviewed-by: Hersen Wu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 7a34057cb5ceb20756e30abc36c58c34be62eff9 Author: Tony Cheng Date: Sun Jun 17 13:26:27 2018 -0400 drm/amd/display: fix incorrect check for atom table size in case we have very few pins in the table, check fails and we can't boot Signed-off-by: Tony Cheng Reviewed-by: Yongqiang Sun Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 16aecfd4bf546907a6d7d06b4edfdbeea75b1839 Author: Tony Cheng Date: Sat Jun 16 19:43:41 2018 -0400 drm/amd/display: generic indirect register access add generic indirect register access following our register access pattern this will make it easier to review code and programming sequence, with all the complexity hidden in macro Signed-off-by: Tony Cheng Reviewed-by: Yongqiang Sun Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 4981a66144fa1e05c54164ea2ef4255451b62d78 Author: Tony Cheng Date: Fri Jun 15 17:53:35 2018 -0400 drm/amd/display: fix bug where we are creating bogus i2c aux [WHY] we were using 6 instances based on i2caux_dce110.c [HOW] pass in how many instances to ctor Signed-off-by: Tony Cheng Reviewed-by: Yongqiang Sun Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit b81e5aa39f66fa159beb449c47220cfb483f0d5f Author: Charlene Liu Date: Fri Jun 15 12:19:00 2018 -0400 drm/amd/display: Move common GPIO registers into a common define Signed-off-by: Charlene Liu Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 40dd6bd376a4b8617d7cfb1402bafd84bbd79bbd Author: Hersen Wu Date: Fri Jun 15 09:28:34 2018 -0400 drm/amd/display: Linux Set/Read link rate and lane count through debugfs expose dc function to be called by linux dm Signed-off-by: Hersen Wu Reviewed-by: Sun peng Li Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 1811a51f6a04adbaa4dba1e7bfe13201c04b9f94 Author: Krunoslav Kovac Date: Thu Jun 14 15:08:58 2018 -0400 drm/amd/display: Implement cursor multiplier DCN allows cursor multiplier when blending FP16 surface. Signed-off-by: Krunoslav Kovac Reviewed-by: Aric Cyr Reviewed-by: Anthony Koo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0a14544661fad1606cc96aece30b2950fd9c4c81 Author: Eric Yang Date: Tue Jun 12 18:37:12 2018 -0400 drm/amd/display: support access ddc for mst branch [Why] Megachip dockings accesses ddc line through display driver when installing FW. Previously, we would fail every transaction because link attached to mst branch did not have their ddc transaction type set. [How] Set ddc transaction type when mst branch is connected. Signed-off-by: Eric Yang Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 91f191c74e8da29360109acb97a20240bedbc355 Author: Tony Cheng Date: Thu Jun 14 16:06:10 2018 -0400 drm/amd/display: Add avoid_vbios_exec_table debug bit Signed-off-by: Tony Cheng Reviewed-by: Yongqiang Sun Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit a9962fb8e53aad86bc5c4147ecc209a214345f56 Author: Eric Bernstein Date: Fri Jun 8 15:01:59 2018 -0400 drm/amd/display: Separate HUBP surface size and rotation/mirror programming Separate HUBP surface size and rotation/mirror programming so that HUBP revision without mirror/rotation do not access those register fields. Signed-off-by: Eric Bernstein Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 013fc06ea4260574755541773ece1a76a8017de6 Author: Harry Wentland Date: Fri Jul 6 10:54:33 2018 -0400 Revert "drm/amd/display: make dm_dp_aux_transfer return payload bytes instead of size" This reverts commit cc195141133ac3e767d930bedd8294ceebf1f10b. This commit was problematic on other OSes. The real solution is to leave all the error checking to DRM and don't do it in DC, which is addressed by "Return aux replies directly to DRM" later in this patchset. v2: Add reason for revert. Signed-off-by: Harry Wentland Signed-off-by: Alex Deucher commit 37b5fcfde879652bac7fc4b18c5f242f2544e9ea Author: Harry Wentland Date: Fri Jul 6 10:54:18 2018 -0400 Revert "drm/amd/display: Don't return ddc result and read_bytes in same return value" This reverts commit 8a61bc085ffab3071c59efcbeff4044c034e7490. Need to revert "make dm_dp_aux_transfer return payload bytes instead of size", which this commit is based on. That commit was problematic on other OSes. The real solution is to leave all the error checking to DRM and don't do it in DC, which is addressed by "Return aux replies directly to DRM" later in this patchset. v2: Add reason for revert. Signed-off-by: Harry Wentland Signed-off-by: Alex Deucher commit 15e6b76880e65be24250e30986084b5569b7a06f Author: Michel Dänzer Date: Wed Jul 11 12:42:55 2018 +0200 drm/amdgpu: Warn and update pin_size values when destroying a pinned BO This shouldn't happen, but if it does, we'll get a backtrace of the caller, and update the pin_size values as needed. v2: * Check bo->pin_count instead of placement flags (Christian König) Reviewed-by: Christian König Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit a5ccfe5c20740f2fbf00291490cdf8d2373ec255 Author: Michel Dänzer Date: Wed Jul 11 12:00:40 2018 +0200 drm/amdgpu: Make pin_size values atomic Concurrent execution of the non-atomic arithmetic could result in completely bogus values. v2: * Rebased on v2 of the previous patch Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/106872 Reviewed-by: Christian König Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit ddc21af4d0f37f42b33c54cb69b215997fe5b082 Author: Michel Dänzer Date: Wed Jul 11 12:06:31 2018 +0200 drm/amdgpu: Keep track of amount of pinned CPU visible VRAM Instead of CPU invisible VRAM. Preparation for the following, no functional change intended. v2: * Also change amdgpu_vram_mgr_bo_invisible_size to amdgpu_vram_mgr_bo_visible_size, allowing further simplification (Christian König) Cc: stable@vger.kernel.org Reviewed-by: Christian König Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit aa16b6c6b4d979234f830a48add47d02c12bb569 Author: Nayan Deshmukh Date: Fri Jul 13 15:21:14 2018 +0530 drm/scheduler: modify args of drm_sched_entity_init replace run queue by a list of run queues and remove the sched arg as that is part of run queue itself Signed-off-by: Nayan Deshmukh Reviewed-by: Christian König Acked-by: Eric Anholt Signed-off-by: Alex Deucher commit 8dc9fbbf274b7b2a647e06141aee70ffabf6dbc0 Author: Nayan Deshmukh Date: Fri Jul 13 15:21:13 2018 +0530 drm/scheduler: add a pointer to scheduler in the rq This patch is in preparation for a better load balancing in scheduler. It allows us to associate entities with the run queues instead of binding them to a scheduler. Signed-off-by: Nayan Deshmukh Reviewed-by: Christian König Acked-by: Eric Anholt Signed-off-by: Alex Deucher commit b7d85e1db32ea85b09f58f416da48f44285ff41f Author: Christian König Date: Thu Jul 12 14:31:25 2018 +0200 drm/amdgpu: fix TTM move entity init order We are initializing the entity before the scheduler is actually initialized. This can lead to all kind of problem, but especially NULL pointer deref because of Nayan's scheduler work. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 44a99b65fc27474b66f7173b971bfbd67ca6ba74 Author: Andrey Grodzovsky Date: Fri May 25 10:45:34 2018 -0400 drm/amd: Use newly added interrupt source defs for SOC15. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ba61bb17496d1664bf7c5c2fd650d5fd78bd0a92 Author: Andrey Grodzovsky Date: Fri May 25 10:44:12 2018 -0400 drm/amd: Add interrupt source definitions for SOC15 v3. Stop using 'magic numbers' when registering interrupt sources. v2: Switch to kernel style comments. v3: Rebase. Signed-off-by: Andrey Grodzovsky Acked-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 091aec0b4e26c8d31b6c211b57a2ea2c5b985ca9 Author: Andrey Grodzovsky Date: Fri May 25 10:06:52 2018 -0400 drm/amd: Use newly added interrupt source defs for VI v3. v2: Rebase v3: Use defines for CP_SQ and CP_ECC_ERROR interrupts. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 530e7a660fb795452357b36cce26b839a9a187a9 Author: Andrey Grodzovsky Date: Wed Jul 11 17:34:35 2018 -0400 drm/amd: Add interrupt source definitions for VI v3. Stop using 'magic numbers' when registering interrupt sources. v2: Clean redundant comments. Switch to kernel style comments. v3: Add CP_ECC_ERROR define Signed-off-by: Andrey Grodzovsky Acked-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ed515ce2748007385347d70ec2779d6aef2cf5f0 Author: Evan Quan Date: Tue Jul 10 11:35:16 2018 +0800 drm/amd/powerplay: convert the sclk/mclk into Mhz for comparation Convert the clocks into right Mhz unit. Otherwise, it will miss the equal situation. Signed-off-by: Evan Quan Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 3f2e6bf89cab5f7c84dafc62f478874fdc08d161 Author: Evan Quan Date: Thu Jul 5 10:44:33 2018 +0800 drm/amd/powerplay: no need to mask workable gfxoff feature for vega12 Gfxoff feature for vega12 is workable. So, there is no need to mask it any more. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 991a6b32ce647e9827acc0c72a998e4ffed1d753 Author: Evan Quan Date: Wed Jul 4 16:44:07 2018 +0800 drm/amd/powerplay: add vega12 SMU gfxoff support v3 Export apis for enabling/disabling SMU gfxoff support. v2: fit the latest gfxoff support framework v3: add feature_mask control Signed-off-by: Evan Quan Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit a5aedc2d18bcb33816545f39f13a37a0c86b3b3d Author: Evan Quan Date: Thu Jul 5 10:30:36 2018 +0800 drm/amdgpu: reduce the idle period that RLC has to wait before request CGCG Gfxoff feature may depends on the CGCG(on vega12, that's the case). This change will help to enable gfxoff feature more frequently. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit c3693768174e90481b1b074fcc1dc68d36dd98d4 Author: Evan Quan Date: Thu Jul 5 10:26:48 2018 +0800 drm/amdgpu: no touch for the reserved bit of RLC_CGTT_MGCG_OVERRIDE On vega12, the bit0 of RLC_CGTT_MGCG_OVERRIDE is reserved. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit d26031c113acf8289d118bae9a8a293b2f9f6a34 Author: Evan Quan Date: Wed Jul 4 17:06:38 2018 +0800 drm/amdgpu: drop mmRLC_PG_CNTL clear v2 SMU owns this register so the driver should not set it to avoid breaking gfxoff. v2: update description Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit b58b65cf7ac09b3d9a979a6a9bbe41abfc425a2a Author: Evan Quan Date: Thu Jul 5 11:24:20 2018 +0800 drm/amdgpu: correct rlc save restore list initialization for v2_1 The save restore list initialization does not have to be pg guarded. And for some asic(e.g. Vega12), it does not have cntl/gpm/srm lists. Signed-off-by: Evan Quan Acked-by: Huang Rui Signed-off-by: Alex Deucher commit af356b6d32c8dd065393e4c8cd5576c15e48df4d Author: Evan Quan Date: Thu Jul 5 11:17:48 2018 +0800 drm/amdgpu: init CSIB regardless of rlc version and pg status CSIB init has no relation with rlc version and pg status. It should be needed regardless of them. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 137dc4b9060e99a22dce59b42ca71912cf0180f3 Author: Evan Quan Date: Wed Jul 4 16:21:52 2018 +0800 drm/amdgpu: pin the csb buffer on hw init v2 Without this pin, the csb buffer will be filled with inconsistent data after S3 resume. And that will causes gfx hang on gfxoff exit since this csb will be executed then. v2: fit amdgpu_bo_pin change(take one less argument) Signed-off-by: Evan Quan Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 5f4284015e29c2de501d83eb647c8ec8802b58ac Author: Jakub Kicinski Date: Wed Jul 11 20:36:44 2018 -0700 nfp: add support for simultaneous driver and hw XDP Split handling of offloaded and driver programs completely. Since offloaded programs always come with XDP_FLAGS_HW_MODE set in reality there could be no sharing, anyway, programs would only be installed in driver or in hardware. Splitting the handling allows us to install programs in HW and in driver at the same time. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 99dadb6e3ec130800d199ec42fff03242b1be1eb Author: Jakub Kicinski Date: Wed Jul 11 20:36:43 2018 -0700 selftests/bpf: add test for multiple programs Add tests for having an XDP program attached in the driver and another one attached in HW simultaneously. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 799e173d7125155c00e9492c8212c5e41333049f Author: Jakub Kicinski Date: Wed Jul 11 20:36:42 2018 -0700 netdevsim: add support for simultaneous driver and hw XDP Allow netdevsim to accept driver and offload attachment of XDP BPF programs at the same time. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit a25717d2b604347d9af8da81deea7b08e8c94220 Author: Jakub Kicinski Date: Wed Jul 11 20:36:41 2018 -0700 xdp: support simultaneous driver and hw XDP attachment Split the query of HW-attached program from the software one. Introduce new .ndo_bpf command to query HW-attached program. This will allow drivers to install different programs in HW and SW at the same time. Netlink can now also carry multiple programs on dump (in which case mode will be set to XDP_ATTACHED_MULTI and user has to check per-attachment point attributes, IFLA_XDP_PROG_ID will not be present). We reuse IFLA_XDP_PROG_ID skb space for second mode, so rtnl_xdp_size() doesn't need to be updated. Note that the installation side is still not there, since all drivers currently reject installing more than one program at the time. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 05296620f6d14dce0030b87e1e57891a770fb65c Author: Jakub Kicinski Date: Wed Jul 11 20:36:40 2018 -0700 xdp: factor out common program/flags handling from drivers Basic operations drivers perform during xdp setup and query can be moved to helpers in the core. Encapsulate program and flags into a structure and add helpers. Note that the structure is intended as the "main" program information source in the driver. Most drivers will additionally place the program pointer in their fast path or ring structures. The helpers don't have a huge impact now, but they will decrease the code duplication when programs can be installed in HW and driver at the same time. Encapsulating the basic operations in helpers will hopefully also reduce the number of changes to drivers which adopt them. Helpers could really be static inline, but they depend on definition of struct netdev_bpf which means they'd have to be placed in netdevice.h, an already 4500 line header. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 6b8675897338f874c41612655a85d8e10cdb23d8 Author: Jakub Kicinski Date: Wed Jul 11 20:36:39 2018 -0700 xdp: don't make drivers report attachment mode prog_attached of struct netdev_bpf should have been superseded by simply setting prog_id long time ago, but we kept it around to allow offloading drivers to communicate attachment mode (drv vs hw). Subsequently drivers were also allowed to report back attachment flags (prog_flags), and since nowadays only programs attached will XDP_FLAGS_HW_MODE can get offloaded, we can tell the attachment mode from the flags driver reports. Remove prog_attached member. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 4f91da26c81145f255cb153152ffed70014b1c41 Author: Jakub Kicinski Date: Wed Jul 11 20:36:38 2018 -0700 xdp: add per mode attributes for attached programs In preparation for support of simultaneous driver and hardware XDP support add per-mode attributes. The catch-all IFLA_XDP_PROG_ID will still be reported, but user space can now also access the program ID in a new IFLA_XDP__PROG_ID attribute. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit c012691508f5fcc09b0a777fd1747f266093fe1b Author: Jason Gunthorpe Date: Wed Jul 11 11:20:29 2018 +0300 IB/cm: Remove cma_multicast->igmp_joined This variable isn't read and written to with proper locking, so it is racy. Instead of using an unlocked bool use presence in the mc->list The caller could race rdma_join_multicast with rdma_leave_multicast which would leak a mc join and cause a use after free of mc. Instead, do not add the mc to the list until it has completed initialization, all mcs on the list require leaving. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 1215cb7c88ec888d599a249142a74dd93b8985ad Author: Leon Romanovsky Date: Tue Jul 10 13:31:49 2018 +0300 RDMA/umem: Refactor exit paths in ib_umem_get Simplify exit paths in ib_umem_get to use the standard goto unwind pattern. Signed-off-by: Leon Romanovsky Reviewed-by: Michael J. Ruhl Signed-off-by: Jason Gunthorpe commit 6710fcfca5ccb690e02d72376950c61b19570525 Author: Chris Wilson Date: Fri Jul 13 18:26:58 2018 +0100 drm/i915/guc: Protect against no desc-pool on premature shutdown Hopefully the final hack to get guc fault-injection happy before we can clean it up again, starting from a known good baseline... [ 383.017530] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0 [ 383.017556] Oops: 0000 [#1] PREEMPT SMP PTI [ 383.017566] CPU: 7 PID: 4725 Comm: drv_module_relo Tainted: G U 4.18.0-rc4-CI-CI_DRM_4485+ #1 [ 383.017581] Hardware name: Micro-Star International Co., Ltd. MS-7B54/Z370M MORTAR (MS-7B54), BIOS 1.10 12/28/2017 [ 383.017664] RIP: 0010:guc_stage_desc_pool_destroy+0x17/0xe0 [i915] [ 383.017674] Code: 59 a0 c6 05 02 59 18 00 01 e8 5e 01 c3 e0 eb b1 0f 1f 00 53 48 89 fb 48 81 c7 90 02 00 00 e8 60 64 45 e1 48 8b 83 80 02 00 00 <48> 8b 80 a0 00 00 00 48 8b 90 68 02 00 00 48 83 ea 01 48 81 fa ff [ 383.017771] RSP: 0018:ffffc900004bbdd0 EFLAGS: 00010282 [ 383.017782] RAX: 0000000000000000 RBX: ffff88012ff41300 RCX: 0000000000000000 [ 383.017794] RDX: 0000000000000000 RSI: ffffc900004bbd80 RDI: 0000000000000000 [ 383.017805] RBP: ffff88012ff40000 R08: 00000000d876ee11 R09: 0000000000000000 [ 383.017817] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88012ff47770 [ 383.017828] R13: ffff88012ff40068 R14: ffff880264392ef8 R15: ffffffffa0639950 [ 383.017840] FS: 00007fb9c18c8980(0000) GS:ffff8802663c0000(0000) knlGS:0000000000000000 [ 383.017853] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 383.017864] CR2: 00000000000000a0 CR3: 00000001df6cc003 CR4: 00000000003606e0 [ 383.017875] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 383.017887] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 383.017898] Call Trace: [ 383.017962] intel_uc_fini+0x34/0xd0 [i915] [ 383.018020] i915_gem_fini+0x5c/0x100 [i915] [ 383.018093] i915_driver_unload+0xd2/0x110 [i915] [ 383.018150] i915_pci_remove+0x10/0x20 [i915] [ 383.018165] pci_device_remove+0x36/0xb0 [ 383.018179] device_release_driver_internal+0x185/0x250 [ 383.018193] driver_detach+0x35/0x70 [ 383.018205] bus_remove_driver+0x53/0xd0 [ 383.018217] pci_unregister_driver+0x25/0xa0 [ 383.018232] __se_sys_delete_module+0x162/0x210 [ 383.018245] ? do_syscall_64+0xd/0x190 [ 383.018257] do_syscall_64+0x55/0x190 [ 383.018270] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 383.018282] RIP: 0033:0x7fb9c0f7c1b7 [ 383.018290] Code: 73 01 c3 48 8b 0d d1 8c 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 8c 2c 00 f7 d8 64 89 01 48 [ 383.018408] RSP: 002b:00007fffa01c2aa8 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0 [ 383.018425] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb9c0f7c1b7 [ 383.018440] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 0000560b96856d48 [ 383.018454] RBP: 0000560b96856ce0 R08: 0000560b96856d4c R09: 00007fffa01c2ae8 [ 383.018468] R10: 00007fffa01c1aa4 R11: 0000000000000206 R12: 0000560b954f7470 Testcase: igt/drv_module_reload/basic-reload-inject Signed-off-by: Chris Wilson Cc: Michał Winiarski Cc: Michal Wajdeczko Cc: Rodrigo Vivi Reviewed-by: Rodrigo Vivi Reviewed-by: Michal Wajdeczko Link: https://patchwork.freedesktop.org/patch/msgid/20180713172658.14070-1-chris@chris-wilson.co.uk commit 40ddacf2dda952e0f33b40d850bf5f7403bdbe0f Author: Leon Romanovsky Date: Tue Jul 10 13:31:48 2018 +0300 RDMA/umem: Don't hold mmap_sem for too long DMA mapping is time consuming operation and doesn't need to be performed with mmap_sem semaphore is held. The semaphore only needs to be held for accounting and get_user_pages related activities. Signed-off-by: Huy Nguyen Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6869e0004fe16184acd6488f0c637e0081a84a8a Author: Bart Van Assche Date: Tue Jul 10 10:31:59 2018 -0700 IB/srpt: Fix srpt_cm_req_recv() error path (2/2) If a login request was received through the RDMA/CM and if an error occurs during login, clear rdma_cm_id->context instead of ib_cm_id->context. Fixes: 63cf1a902c9d ("IB/srpt: Add RDMA/CM support") Signed-off-by: Bart Van Assche Cc: Signed-off-by: Jason Gunthorpe commit 847462de3a0aabc5343a1e338537f69a03bb61af Author: Bart Van Assche Date: Tue Jul 10 10:31:58 2018 -0700 IB/srpt: Fix srpt_cm_req_recv() error path (1/2) Once a target session has been allocated, if an error occurs, the session must be freed. Since it is not safe to call blocking code from the context of an connection manager callback, trigger target session release in this case by calling srpt_close_ch(). Fixes: db7683d7deb2 ("IB/srpt: Fix login-related race conditions") Signed-off-by: Bart Van Assche Cc: Signed-off-by: Jason Gunthorpe commit 05f58ceba123bdb420cf44c6ea04b6db467edd1c Author: Leon Romanovsky Date: Sun Jul 8 13:50:21 2018 +0300 RDMA/mlx5: Check that supplied blue flame index doesn't overflow User's supplied index is checked again total number of system pages, but this number already includes num_static_sys_pages, so addition of that value to supplied index causes to below error while trying to access sys_pages[]. BUG: KASAN: slab-out-of-bounds in bfregn_to_uar_index+0x34f/0x400 Read of size 4 at addr ffff880065561904 by task syz-executor446/314 CPU: 0 PID: 314 Comm: syz-executor446 Not tainted 4.18.0-rc1+ #256 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014 Call Trace: dump_stack+0xef/0x17e print_address_description+0x83/0x3b0 kasan_report+0x18d/0x4d0 bfregn_to_uar_index+0x34f/0x400 create_user_qp+0x272/0x227d create_qp_common+0x32eb/0x43e0 mlx5_ib_create_qp+0x379/0x1ca0 create_qp.isra.5+0xc94/0x22d0 ib_uverbs_create_qp+0x21b/0x2a0 ib_uverbs_write+0xc2c/0x1010 vfs_write+0x1b0/0x550 ksys_write+0xc6/0x1a0 do_syscall_64+0xa7/0x590 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x433679 Code: fd ff 48 81 c4 80 00 00 00 e9 f1 fe ff ff 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 3b 91 fd ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fff2b3d8e48 EFLAGS: 00000217 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00000000004002f8 RCX: 0000000000433679 RDX: 0000000000000040 RSI: 0000000020000240 RDI: 0000000000000003 RBP: 00000000006d4018 R08: 00000000004002f8 R09: 00000000004002f8 R10: 00000000004002f8 R11: 0000000000000217 R12: 0000000000000000 R13: 000000000040cb00 R14: 000000000040cb90 R15: 0000000000000006 Allocated by task 314: kasan_kmalloc+0xa0/0xd0 __kmalloc+0x1a9/0x510 mlx5_ib_alloc_ucontext+0x966/0x2620 ib_uverbs_get_context+0x23f/0xa60 ib_uverbs_write+0xc2c/0x1010 __vfs_write+0x10d/0x720 vfs_write+0x1b0/0x550 ksys_write+0xc6/0x1a0 do_syscall_64+0xa7/0x590 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 1: __kasan_slab_free+0x12e/0x180 kfree+0x159/0x630 kvfree+0x37/0x50 single_release+0x8e/0xf0 __fput+0x2d8/0x900 task_work_run+0x102/0x1f0 exit_to_usermode_loop+0x159/0x1c0 do_syscall_64+0x408/0x590 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff880065561100 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 2052 bytes inside of 4096-byte region [ffff880065561100, ffff880065562100) The buggy address belongs to the page: page:ffffea0001955800 count:1 mapcount:0 mapping:ffff88006c402480 index:0x0 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 ffffea0001a7c000 0000000200000002 ffff88006c402480 raw: 0000000000000000 0000000080070007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff880065561800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff880065561880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff880065561900: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff880065561980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff880065561a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc Cc: # 4.15 Fixes: 1ee47ab3e8d8 ("IB/mlx5: Enable QP creation with a given blue flame index") Reported-by: Noa Osherovich Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ffaf58def01ebdbf2669204e105c5a4f356ba276 Author: Leon Romanovsky Date: Sun Jul 8 13:50:20 2018 +0300 RDMA/mlx5: Melt consecutive calls to alloc_bfreg() in one call There is no need for three consecutive calls to alloc_bfreg(). It can be implemented with one function. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 65ca8d9670b70aa8076054c0c23be032c6ac5c77 Author: Raju Rangoju Date: Thu Jul 5 18:26:01 2018 +0530 rdma/cxgb4: Add support for 64Byte cqes This patch adds support for iw_cxb4 to extend cqes from existing 32Byte size to 64Byte. Also includes adds backward compatibility support (for 32Byte) to work with older libraries. Signed-off-by: Raju Rangoju Reviewed-by: Steve Wise Signed-off-by: Jason Gunthorpe commit 620eec75f35ce470cb59410b2ed91ad750b867a2 Author: Daniel Vetter Date: Mon Jul 9 10:40:15 2018 +0200 drm/doc: use inline kerneldoc style for drm_crtc_state Lots of added text here since I think the various control flow bits are worth explaining a bit better. v2: Fix conflict with Boris' no_vblank addition. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-15-daniel.vetter@ffwll.ch commit 7f9e7ec92be93e73ef552e6185a3ada72a90e1a9 Author: Daniel Vetter Date: Mon Jul 9 10:40:14 2018 +0200 drm/doc: Include drm_of.c helpers Fixes a dead link I spotted in the struct drm_crtc docs. Comments themselves are in a surprisingly good state. v2: Fix subject typo (Sean). Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-14-daniel.vetter@ffwll.ch commit 9bea6dd081d1f1411a37da8ff066caf4aeb5ab31 Author: Daniel Vetter Date: Mon Jul 9 10:40:13 2018 +0200 drm/doc: Group the fb gem helpers better Instead of spreading them all over the place. Cc: Noralf Trønnes Acked-by: Noralf Trønnes Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-13-daniel.vetter@ffwll.ch commit 15185aa20cbdf4404198b74f86a1ce9f6fe0fad7 Author: Daniel Vetter Date: Mon Jul 9 10:40:12 2018 +0200 drm/doc: move struct drm_crtc to in-line comments And clean them up a bit, as usual. v2: Fix nits (Sean). Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-12-daniel.vetter@ffwll.ch commit 268bc24e861efd6892d2911bf25a3d1192aa51f5 Author: Daniel Vetter Date: Mon Jul 9 10:40:10 2018 +0200 drm: switch drm_plane to inline comments And use that opportunity to polish the kernel doc all around: - Beef up some of the documentation. - Intro text for drm_plane and better links - Fix all the hyperlinks! v2: Fix linebreaks. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-10-daniel.vetter@ffwll.ch commit 2e784a91424892cc8c75853dd40b63c0d5855af9 Author: Daniel Vetter Date: Mon Jul 9 10:40:09 2018 +0200 drm: Switch drm_plane_state to inline kerneldoc style For consistency and to encourage more detailed documentation. While doing this also beefed up a few of the comments, linking at least to the setup function. Plus fixed all the hyperlinks. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-9-daniel.vetter@ffwll.ch commit 97e14fbeb53fe060c5f6a7a07e37fd24c087ed0c Author: Daniel Vetter Date: Mon Jul 9 10:40:08 2018 +0200 drm: drop _mode_ from remaining connector functions Since there's very few callers of these I've decided to do them all in one patch. With this the unecessarily long drm_mode_connector_ prefix is gone from the codebase! The only exception being struct drm_mode_connector_set_property, which is part of the uapi so can't be renamed. Again done with sed+some manual fixups for indent issues. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-8-daniel.vetter@ffwll.ch commit cde4c44d8769c1be16074c097592c46c7d64092b Author: Daniel Vetter Date: Mon Jul 9 10:40:07 2018 +0200 drm: drop _mode_ from drm_mode_connector_attach_encoder Again to align with the usual prefix of just drm_connector_. Again done with sed + manual fixup for indent issues. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-7-daniel.vetter@ffwll.ch commit c555f02371c338b06752577aebf738dbdb6907bd Author: Daniel Vetter Date: Mon Jul 9 10:40:06 2018 +0200 drm: drop _mode_ from update_edit_property() Just makes it longer, and for most things in drm_connector.[hc] we just use the drm_connector_ prefix. Done with sed + a bit of manual fixup for the indenting. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-6-daniel.vetter@ffwll.ch commit 92e1d26324e095252f3baf2c953615715c7c2a89 Author: Daniel Vetter Date: Mon Jul 9 10:40:05 2018 +0200 drm/doc: polish for sturct drm_connector - switch everything over to inline comments - add notes about locking, links to functions and other related stuff - also include a note about Ville's soon-to-be-merged drm_connector_for_each_possible_encoder(). Also check that all the hyperlinks in drm_connector.h work and fix them as needed. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-5-daniel.vetter@ffwll.ch commit aab999a66e4bc448a439733d60c83c86bee4c2be Author: Daniel Vetter Date: Mon Jul 9 10:40:04 2018 +0200 drm/doc: switch drm_connector_state to inline comments For consistency. Also spelled out the docs for ->best_encoder a bit more while at it. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-4-daniel.vetter@ffwll.ch commit 3479fc248bf383549ff629c607df0486813e14fd Author: Daniel Vetter Date: Mon Jul 9 10:40:02 2018 +0200 drm: move drv test macros out of drmP.h Last bit the prevented us from starting to delete the drmP.h monster includes from source files! Also add kernel-doc while moving them. A nice consistent drm_dev_ prefix would be cute for these, but since they're used everywhere I've figured I'll leave this bikeshed aside for now. Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-2-daniel.vetter@ffwll.ch commit ce6058039bca7f1f11f1723549eec1bc069dcb28 Author: Ayan Kumar Halder Date: Tue Jul 10 14:18:54 2018 +0100 drm/arm/malidp: Add modifier definitions for describing Arm Framebuffer Compression (AFBC). AFBC is a proprietary lossless image compression protocol and format. It provides fine-grained random access and minimizes the amount of data transferred between IP blocks. AFBC has several features which may be supported and/or used, which are represented using bits in the modifier. Not all combinations are valid, and different devices or use-cases may support different combinations. Changes from v2:- - Added ack by Maarten Lankhorst Signed-off-by: Rosen Zhelev Signed-off-by: Ayan Kumar halder Reviewed-by: Brian Starkey Reviewed-by: Liviu Dudau Reviewed-by: James (Qian) Wang Acked-by: Maarten Lankhorst Link: https://lkml.org/lkml/2018/7/10/360 commit 811e299f4645588cc7a1b78d97b6847c155324b9 Author: Romuald CARI Date: Thu Jun 7 16:08:02 2018 +0200 ieee802154: add rx LQI from userspace The Link Quality Indication data exposed by drivers could not be accessed from userspace. Since this data is per-datagram received, it makes sense to make it available to userspace application through the ancillary data mechanism in recvmsg rather than through ioctls. This can be activated using the socket option WPAN_WANTLQI under SOL_IEEE802154 protocol. This LQI data is available in the ancillary data buffer under the SOL_IEEE802154 level as the type WPAN_LQI. The value is an unsigned byte indicating the link quality with values ranging 0-255. Signed-off-by: Romuald Cari Signed-off-by: Clément Peron Signed-off-by: Stefan Schmidt commit 90a460d5dd205b1b39dae3dad041a37cf7c4241d Author: Sean Paul Date: Fri Jul 13 11:34:44 2018 -0400 drm: Fix kerneldoc for DRM_MODE_PROP_IMMUTABLE Noticed this while browsing the docs. Reviewed-by: Ville Syrjälä Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180713153444.95466-1-seanpaul@chromium.org commit 090345ce7265dd111299e3a63cdc79c3ef924481 Author: Dan Carpenter Date: Fri Jul 13 18:11:04 2018 +0300 ASoC: qdsp6: q6routing: off by one in routing_hw_params() The data->port_data[] array has AFE_MAX_PORTS elements so the check should be >= instead of > or we write one element beyond the end of the array. Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver") Signed-off-by: Dan Carpenter Signed-off-by: Mark Brown commit b8110a87b75f948d978c06e130cc68026645c4a1 Author: Dan Carpenter Date: Fri Jul 13 18:05:57 2018 +0300 ASoC: qdsp6: q6afe-dai: fix a range check in of_q6afe_parse_dai_data() The main thing is that the data->priv[] array has AFE_PORT_MAX elements so the > condition should be >=. But we may as well check for negative values as well just to be safe. Fixes: 24c4cbcfac09 ("ASoC: qdsp6: q6afe: Add q6afe dai driver") Signed-off-by: Dan Carpenter Signed-off-by: Mark Brown commit f88f047812c5977636a5c2ebb9c0b05fe788acf3 Author: Ville Syrjälä Date: Thu Jul 5 19:43:57 2018 +0300 drm/i915: Print the long_mask alongside the pin_mask We're printing out which pins got a hotplug, so why not also print out which pins detected the long pulse as opposed to a short pulse. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-9-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit af92058ff021d5d8b0523baf76e709fe2fc3aa0c Author: Ville Syrjälä Date: Thu Jul 5 19:43:55 2018 +0300 drm/i915: Pass hpd_pin to long_pulse_detect() We're doing a pointless translation from hpd_pin to port simply for passing the thing to long_pulse_detect(). Let's pass the hpd_pin directly instead. This removes the assumption that the hpd_pin and port always match. The only other place where we make that assumption anymore is intel_hpd_pin_default() and that's fine as it's what determines the relationship between the two. If we ever get hardware where the hpd pins are wired in more interesting ways it should be trivial to handle from now on. This should also fix the IS_CNL_WITH_PORT_F() case as that mapped pin E back to port F and passed that to spt_port_hotplug2_long_detect() which would always return false for port F. Now that we pass in pin E directly it'll actually do the right thing. Cc: Rodrigo Vivi Fixes: cf53902f48c3 ("drm/i915/cnl: Add HPD support for Port F.") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-7-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit e9be285051e1ff447f43d09da4102aa30d8645d7 Author: Ville Syrjälä Date: Thu Jul 5 19:43:54 2018 +0300 drm/i915: s/int i/enum hpd_pin pin/ Use the enum hpd_pin type when talking about HPD pins, and rename the variable from a very nondescript 'i' to 'pin', a name we already use in other parts of the code. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-6-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit b6ca3eee18ba1ec97cad54b7f476bcfaca50c17c Author: Ville Syrjälä Date: Thu Jul 5 19:43:53 2018 +0300 drm/i915: Nuke dev_priv->irq_port[] Instead of looping over ports and hpd_pins, let's loop over the encoders when doing hotplug processing. And instead of depending on dev_priv->irq_port[] to tell us whether the encoder has the ->hpd_pulse() hook or not, we can just check for that directly. So we can just nuke irq_port[] entirely. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-5-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 1a4313d13b69318d11e3418b7193be6add511f69 Author: Ville Syrjälä Date: Thu Jul 5 19:43:52 2018 +0300 drm/i915: Rewrite mst suspend/resume in terms of encoders Rather than looping over all the ports and picking the encoder based on the port, let's just loop over all the encoders instead. Gets rid of some irq_port[] usage, which is a bit of an eye sore. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-4-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 4ef03f8354f592b237cff1774cc50e4e4eb63652 Author: Ville Syrjälä Date: Thu Jul 5 19:43:51 2018 +0300 drm/i915: Introduce intel_encoder_is_dig_port() Add intel_encoder_is_dig_port() to match intel_encoder_is_dp(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-3-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 14aa521c5eb615c802d51e9e8884f2dbd35993a2 Author: Ville Syrjälä Date: Thu Jul 5 19:43:50 2018 +0300 drm/i915: Introduce for_each_intel_dp() Add a convenience macro for iterating DP encoders. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-2-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 0b100760e3e8cbb2b5d09c1c2bcb01d50201c142 Author: Chris Wilson Date: Thu Jul 12 20:14:30 2018 +0100 drm/i915/userptr: Enable read-only support on gen8+ On gen8 and onwards, we can mark GPU accesses through the ppGTT as being read-only, that is cause any GPU write onto that page to be discarded (not triggering a fault). This is all that we need to finally support the read-only flag for userptr! v2: Check default address space for read only support as a proxy for the user context/ppgtt. Testcase: igt/gem_userptr_blits/readonly* Signed-off-by: Chris Wilson Cc: Jon Bloomfield Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Reviewed-by: Matthew Auld Reviewed-by: Jon Bloomfield Link: https://patchwork.freedesktop.org/patch/msgid/20180712191430.9269-1-chris@chris-wilson.co.uk commit f8c1cce36ccb21b5e5ecc87fac65de0e29693f01 Author: Chris Wilson Date: Thu Jul 12 19:53:14 2018 +0100 drm/i915: Reject attempted pwrites into a read-only object If the user created a read-only object, they should not be allowed to circumvent the write protection using the pwrite ioctl. Signed-off-by: Chris Wilson Cc: Jon Bloomfield Cc: Joonas Lahtinen Cc: Matthew Auld Reviewed-by: Jon Bloomfield Reviewed-by: Joonas Lahtinen Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180712185315.3288-5-chris@chris-wilson.co.uk commit 3e977ac6179b39faa3c0eda5fce4f00663ae298d Author: Chris Wilson Date: Thu Jul 12 19:53:13 2018 +0100 drm/i915: Prevent writing into a read-only object via a GGTT mmap If the user has created a read-only object, they should not be allowed to circumvent the write protection by using a GGTT mmapping. Deny it. Also most machines do not support read-only GGTT PTEs, so again we have to reject attempted writes. Fortunately, this is known a priori, so we can at least reject in the call to create the mmap (with a sanity check in the fault handler). v2: Check the vma->vm_flags during mmap() to allow readonly access. v3: Remove VM_MAYWRITE to curtail mprotect() Testcase: igt/gem_userptr_blits/readonly_mmap* Signed-off-by: Chris Wilson Cc: Jon Bloomfield Cc: Joonas Lahtinen Cc: Matthew Auld Cc: David Herrmann Reviewed-by: Matthew Auld #v1 Reviewed-by: Jon Bloomfield Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180712185315.3288-4-chris@chris-wilson.co.uk commit c9e666880de5a1fed04dc412b046916d542b72dd Author: Chris Wilson Date: Thu Jul 12 19:53:12 2018 +0100 drm/i915/gtt: Disable read-only support under GVT GVT is not propagating the PTE bits, and is always setting the read-write bit, thus breaking read-only support. Signed-off-by: Chris Wilson Cc: Zhenyu Wang Cc: Jon Bloomfield Cc: Joonas Lahtinen Cc: Matthew Auld Reviewed-by: Jon Bloomfield Link: https://patchwork.freedesktop.org/patch/msgid/20180712185315.3288-3-chris@chris-wilson.co.uk commit 250f8c8140ac0a5e5acb91891d6813f12778b224 Author: Jon Bloomfield Date: Thu Jul 12 19:53:11 2018 +0100 drm/i915/gtt: Read-only pages for insert_entries on bdw+ Hook up the flags to allow read-only ppGTT mappings for gen8+ v2: Include a selftest to check that writes to a readonly PTE are dropped v3: Don't duplicate cpu_check() as we can just reuse it, and even worse don't wholesale copy the theory-of-operation comment from igt_ctx_exec without changing it to explain the intention behind the new test! v4: Joonas really likes magic mystery values Signed-off-by: Jon Bloomfield Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180712185315.3288-2-chris@chris-wilson.co.uk commit 25dda4dabeeb12af5209b0183c788ef2a88dabbe Author: Jon Bloomfield Date: Thu Jul 12 19:53:10 2018 +0100 drm/i915/gtt: Add read only pages to gen8_pte_encode We can set a bit inside the ppGTT PTE to indicate a page is read-only; writes from the GPU will be discarded. We can use this to protect pages and in particular support read-only userptr mappings (necessary for importing PROT_READ vma). Signed-off-by: Jon Bloomfield Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180712185315.3288-1-chris@chris-wilson.co.uk commit 39fbb88165b2bbbc77ea7acab5f10632a31526e6 Author: Sean Young Date: Wed Jul 4 10:57:58 2018 -0400 media: bpf: ensure bpf program is freed on detach Currently we are leaking bpf programs when they are detached from the lirc device; the refcount never reaches zero. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit aefba45539bc4868c1fae336410aec907ee0882a Author: Jerome Brunet Date: Fri Jul 13 14:50:43 2018 +0200 ASoC: allow soc-core to pick up name prefixes from component nodes When the component does not match the configuration table provided by the card, let soc-core check the component node for a name prefix Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit d5418ae3f9443f911d4324c0cade988ced39cfbe Author: Jerome Brunet Date: Fri Jul 13 14:50:42 2018 +0200 ASoC: add DT documentation for the sound-name-prefix property Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 69a8a1961c7bf59b70ec958f8a408ba448fe62a9 Author: Ville Syrjälä Date: Thu Jul 5 22:00:10 2018 +0300 drm: Skip __drm_mode_set_config_internal() on atomic drivers Everything (apart from the actual ->set_config() call) __drm_mode_set_config_internal() does is now useless on atomic drivers. So let's just skip all the foreplay. v2: Use drm_drv_uses_atomic_modeset() (Daniel) Signed-off-by: Ville Syrjälä Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180705190010.19836-1-ville.syrjala@linux.intel.com commit e7695eb6ea70ed143fafbcd12ce69886be3aa03d Author: Ville Syrjälä Date: Thu Jul 5 21:59:07 2018 +0300 drm: Introduce __setplane_atomic() All the plane->fb/old_fb/crtc dance of __setplane_internal() is pointless on atomic drivers. So let's just introduce a simpler version that skips all that. Ideally we could also skip the __setplane_check() as drm_atomic_plane_check() already checks for everything, but the legacy cursor/"async" .update_plane() tricks bypass that so we still need to call __setplane_check(). Toss in a FIXME to remind someone to clean this up later. v2: Use drm_drv_uses_atomic_modeset() (Daniel) Signed-off-by: Ville Syrjälä Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180705185907.9524-1-ville.syrjala@linux.intel.com commit 4dd4677c2d3d34a2bcd511c088da4535ea58e360 Author: Ville Syrjälä Date: Thu Jun 28 16:54:55 2018 +0300 drm: Extract __setplane_check() Pull all the error checking out from __set_plane_internal() to a helper function. We'll have another user of this soon. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180628135457.14647-1-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi Reviewed-by: Daniel Vetter commit 82e00d113639ac810568060b060462e0a7583c9d Author: Hans Verkuil Date: Wed Jul 11 15:29:09 2018 +0200 drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Implement support for this DisplayPort feature. Signed-off-by: Hans Verkuil Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180711132909.25409-4-hverkuil@xs4all.nl commit d2e2d265211cdb423406dd693c8f6fa4ca62674f Author: Hans Verkuil Date: Wed Jul 11 15:29:08 2018 +0200 drm-kms-helpers.rst: document the DP CEC helpers Document the Display Port CEC helper functions. Signed-off-by: Hans Verkuil Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180711132909.25409-3-hverkuil@xs4all.nl commit 2c6d1fffa1d9b0a5b5ac1a23be9ad64abe60910d Author: Hans Verkuil Date: Wed Jul 11 15:29:07 2018 +0200 drm: add support for DisplayPort CEC-Tunneling-over-AUX This adds support for the DisplayPort CEC-Tunneling-over-AUX feature that is part of the DisplayPort 1.3 standard. Unfortunately, not all DisplayPort/USB-C to HDMI adapters with a chip that has this capability actually hook up the CEC pin, so even though a CEC device is created, it may not actually work. Signed-off-by: Hans Verkuil Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180711132909.25409-2-hverkuil@xs4all.nl commit 3ec8ce5d866ec6a08a9cfab82b62acf4a830b35f Author: Thomas Gleixner Date: Fri Jul 13 16:23:26 2018 +0200 Documentation: Add section about CPU vulnerabilities Add documentation for the L1TF vulnerability and the mitigation mechanisms: - Explain the problem and risks - Document the mitigation mechanisms - Document the command line controls - Document the sysfs files Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Acked-by: Linus Torvalds Link: https://lkml.kernel.org/r/20180713142323.287429944@linutronix.de commit d90a7a0ec83fb86622cd7dae23255d3c50a99ec8 Author: Jiri Kosina Date: Fri Jul 13 16:23:25 2018 +0200 x86/bugs, kvm: Introduce boot-time control of L1TF mitigations Introduce the 'l1tf=' kernel command line option to allow for boot-time switching of mitigation that is used on processors affected by L1TF. The possible values are: full Provides all available mitigations for the L1TF vulnerability. Disables SMT and enables all mitigations in the hypervisors. SMT control via /sys/devices/system/cpu/smt/control is still possible after boot. Hypervisors will issue a warning when the first VM is started in a potentially insecure configuration, i.e. SMT enabled or L1D flush disabled. full,force Same as 'full', but disables SMT control. Implies the 'nosmt=force' command line option. sysfs control of SMT and the hypervisor flush control is disabled. flush Leaves SMT enabled and enables the conditional hypervisor mitigation. Hypervisors will issue a warning when the first VM is started in a potentially insecure configuration, i.e. SMT enabled or L1D flush disabled. flush,nosmt Disables SMT and enables the conditional hypervisor mitigation. SMT control via /sys/devices/system/cpu/smt/control is still possible after boot. If SMT is reenabled or flushing disabled at runtime hypervisors will issue a warning. flush,nowarn Same as 'flush', but hypervisors will not warn when a VM is started in a potentially insecure configuration. off Disables hypervisor mitigations and doesn't emit any warnings. Default is 'flush'. Let KVM adhere to these semantics, which means: - 'lt1f=full,force' : Performe L1D flushes. No runtime control possible. - 'l1tf=full' - 'l1tf-flush' - 'l1tf=flush,nosmt' : Perform L1D flushes and warn on VM start if SMT has been runtime enabled or L1D flushing has been run-time enabled - 'l1tf=flush,nowarn' : Perform L1D flushes and no warnings are emitted. - 'l1tf=off' : L1D flushes are not performed and no warnings are emitted. KVM can always override the L1D flushing behavior using its 'vmentry_l1d_flush' module parameter except when lt1f=full,force is set. This makes KVM's private 'nosmt' option redundant, and as it is a bit non-systematic anyway (this is something to control globally, not on hypervisor level), remove that option. Add the missing Documentation entry for the l1tf vulnerability sysfs file while at it. Signed-off-by: Jiri Kosina Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142323.202758176@linutronix.de commit fee0aede6f4739c87179eca76136f83210953b86 Author: Thomas Gleixner Date: Fri Jul 13 16:23:24 2018 +0200 cpu/hotplug: Set CPU_SMT_NOT_SUPPORTED early The CPU_SMT_NOT_SUPPORTED state is set (if the processor does not support SMT) when the sysfs SMT control file is initialized. That was fine so far as this was only required to make the output of the control file correct and to prevent writes in that case. With the upcoming l1tf command line parameter, this needs to be set up before the L1TF mitigation selection and command line parsing happens. Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142323.121795971@linutronix.de commit 8e1b706b6e819bed215c0db16345568864660393 Author: Jiri Kosina Date: Fri Jul 13 16:23:23 2018 +0200 cpu/hotplug: Expose SMT control init function The L1TF mitigation will gain a commend line parameter which allows to set a combination of hypervisor mitigation and SMT control. Expose cpu_smt_disable() so the command line parser can tweak SMT settings. [ tglx: Split out of larger patch and made it preserve an already existing force off state ] Signed-off-by: Jiri Kosina Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142323.039715135@linutronix.de commit 895ae47f9918833c3a880fbccd41e0692b37e7d9 Author: Thomas Gleixner Date: Fri Jul 13 16:23:22 2018 +0200 x86/kvm: Allow runtime control of L1D flush All mitigation modes can be switched at run time with a static key now: - Use sysfs_streq() instead of strcmp() to handle the trailing new line from sysfs writes correctly. - Make the static key management handle multiple invocations properly. - Set the module parameter file to RW Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142322.954525119@linutronix.de commit dd4bfa739a72508b75760b393d129ed7b431daab Author: Thomas Gleixner Date: Fri Jul 13 16:23:21 2018 +0200 x86/kvm: Serialize L1D flush parameter setter Writes to the parameter files are not serialized at the sysfs core level, so local serialization is required. Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142322.873642605@linutronix.de commit 4c6523ec59fe895ea352a650218a6be0653910b1 Author: Thomas Gleixner Date: Fri Jul 13 16:23:20 2018 +0200 x86/kvm: Add static key for flush always Avoid the conditional in the L1D flush control path. Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142322.790914912@linutronix.de commit 7db92e165ac814487264632ab2624e832f20ae38 Author: Thomas Gleixner Date: Fri Jul 13 16:23:19 2018 +0200 x86/kvm: Move l1tf setup function In preparation of allowing run time control for L1D flushing, move the setup code to the module parameter handler. In case of pre module init parsing, just store the value and let vmx_init() do the actual setup after running kvm_init() so that enable_ept is having the correct state. During run-time invoke it directly from the parameter setter to prepare for run-time control. Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142322.694063239@linutronix.de commit a7b9020b06ec6d7c3f3b0d4ef1a9eba12654f4f7 Author: Thomas Gleixner Date: Fri Jul 13 16:23:18 2018 +0200 x86/l1tf: Handle EPT disabled state proper If Extended Page Tables (EPT) are disabled or not supported, no L1D flushing is required. The setup function can just avoid setting up the L1D flush for the EPT=n case. Invoke it after the hardware setup has be done and enable_ept has the correct state and expose the EPT disabled state in the mitigation status as well. Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142322.612160168@linutronix.de commit 2f055947ae5e2741fb2dc5bba1033c417ccf4faa Author: Thomas Gleixner Date: Fri Jul 13 16:23:17 2018 +0200 x86/kvm: Drop L1TF MSR list approach The VMX module parameter to control the L1D flush should become writeable. The MSR list is set up at VM init per guest VCPU, but the run time switching is based on a static key which is global. Toggling the MSR list at run time might be feasible, but for now drop this optimization and use the regular MSR write to make run-time switching possible. The default mitigation is the conditional flush anyway, so for extra paranoid setups this will add some small overhead, but the extra code executed is in the noise compared to the flush itself. Aside of that the EPT disabled case is not handled correctly at the moment and the MSR list magic is in the way for fixing that as well. If it's really providing a significant advantage, then this needs to be revisited after the code is correct and the control is writable. Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142322.516940445@linutronix.de commit 72c6d2db64fa18c996ece8f06e499509e6c9a37e Author: Thomas Gleixner Date: Fri Jul 13 16:23:16 2018 +0200 x86/litf: Introduce vmx status variable Store the effective mitigation of VMX in a status variable and use it to report the VMX state in the l1tf sysfs file. Signed-off-by: Thomas Gleixner Tested-by: Jiri Kosina Reviewed-by: Greg Kroah-Hartman Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20180713142322.433098358@linutronix.de commit e28e681630079204d6d2cb3da1e2c067d21eff64 Author: Vladimir Olovyannikov Date: Tue Jul 10 14:25:31 2018 -0700 arm64: dts: stingray: add bcm958802a802x dts Add bcm958802a802x dts to be used on all Stingray smart NIC PS225 board variants Signed-off-by: Vladimir Olovyannikov Signed-off-by: Pramod Kumar Signed-off-by: Ray Jui Signed-off-by: Florian Fainelli commit 133de204e4741af76b101e101c58e0cd1676a887 Author: Ray Jui Date: Tue Jul 10 14:25:30 2018 -0700 arm64: dts: stingray: add PAXC support Add PAXC support to Broadcom Stingray SoC Signed-off-by: Ray Jui Signed-off-by: Peter Spreadborough Signed-off-by: Florian Fainelli commit f6352103d2e0ad2d2066725eb19bfdfb8763239b Author: Hans Holmberg Date: Fri Jul 13 10:48:45 2018 +0200 lightnvm: pblk: assume that chunks are closed on 1.2 devices We can't know if a block is closed or not on 1.2 devices, so assume closed state to make sure that blocks are erased before writing. Fixes: 32ef9412c114 ("lightnvm: pblk: implement get log report chunk") Signed-off-by: Hans Holmberg Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 11f6ad699a32f3be1232741e4bfa34abf6677cb8 Author: Heiner Litz Date: Fri Jul 13 10:48:44 2018 +0200 lightnvm: pblk: add asynchronous partial read In the read path, partial reads are currently performed synchronously which affects performance for workloads that generate many partial reads. This patch adds an asynchronous partial read path as well as the required partial read ctx. Signed-off-by: Heiner Litz Reviewed-by: Igor Konopko Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 884b031b288bae15397dd07b084a41ffb44f99e4 Author: Gustavo A. R. Silva Date: Fri Jul 13 10:48:43 2018 +0200 lightnvm: pblk: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 4e495a46b1039252f4af0c883e2cb31cc5f44145 Author: Matias Bjørling Date: Fri Jul 13 10:48:42 2018 +0200 lightnvm: pblk: expose generic disk name on pr_* msgs The error messages in pblk does not say which pblk instance that a message occurred from. Update each error message to reflect the instance it belongs to, and also prefix it with pblk, so we know the message comes from the pblk module. Signed-off-by: Matias Bjørling Reviewed-by: Javier González Signed-off-by: Jens Axboe commit 59a8f43b6341b6964a9956640bb0f21b083ccd66 Author: Matias Bjørling Date: Fri Jul 13 10:48:41 2018 +0200 lightnvm: limit get chunk meta request size For devices that does not specify a limit on its transfer size, the get_chk_meta command may send down a single I/O retrieving the full chunk metadata table. Resulting in large 2-4MB I/O requests. Instead, split up the I/Os to a maximum of 256KB and issue them separately to reduce memory requirements. Signed-off-by: Matias Bjørling Reviewed-by: Javier González Signed-off-by: Jens Axboe commit 921aebfac0871e8212913039d5241c0b3527eddb Author: Matias Bjørling Date: Fri Jul 13 10:48:40 2018 +0200 lightnvm: pblk: fix read_bitmap for 32bit archs If using pblk on a 32bit architecture, and there is a need to perform a partial read, the partial read bitmap will only have allocated 32 entries, where as 64 are needed. Make sure that the read_bitmap is initialized to 64bits on 32bit architectures as well. Signed-off-by: Matias Bjørling Reviewed-by: Igor Konopko Reviewed-by: Javier González Signed-off-by: Jens Axboe commit 242e461fb628bb63763e0bb2788d52ea054f8721 Author: Bart Van Assche Date: Fri Jul 13 10:48:39 2018 +0200 lightnvm: Remove redundant rq->__data_len initialization Since both blk_old_get_request() and blk_mq_alloc_request() initialize rq->__data_len to zero, it is not necessary to initialize that member in nvme_nvm_alloc_request(). Hence remove the rq->__data_len initialization from nvme_nvm_alloc_request(). Signed-off-by: Bart Van Assche Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 99b8dad1b6e52721904220322a947f7b75056303 Author: Matias Bjørling Date: Fri Jul 13 10:48:38 2018 +0200 lightnvm: pblk: enable line minor version detection When recovering a line, an extra check was added when debugging was active, such that minor version where also checked. Unfortunately, this used the ifdef NVM_DEBUG, which is not correct. Instead use the proper DEBUG def, and now that it compiles, also fix the variable. Signed-off-by: Matias Bjørling Fixes: d0ab0b1ab991f ("lightnvm: pblk: check data lines version on recovery") Reviewed-by: Javier González Signed-off-by: Jens Axboe commit 880eda544097a525b669df84533f439fb031684b Author: Matias Bjørling Date: Fri Jul 13 10:48:37 2018 +0200 lightnvm: move NVM_DEBUG to pblk There is no users of CONFIG_NVM_DEBUG in the LightNVM subsystem. All users are in pblk. Rename NVM_DEBUG to NVM_PBLK_DEBUG and enable only for pblk. Also fix up the CONFIG_NVM_PBLK entry to follow the code style for Kconfig files. Signed-off-by: Matias Bjørling Reviewed-by: Javier González Signed-off-by: Jens Axboe commit ffc03fb7a52a88f87910d2b2418fd4e3069698e1 Author: Marcin Dziegielewski Date: Fri Jul 13 10:48:36 2018 +0200 lightnvm: pblk: handle case when mw_cunits equals to 0 Some devices can expose mw_cunits equal to 0, it can cause the creation of too small write buffer and cause performance to drop on write workloads. Additionally, write buffer size must cover write data requirements, such as WS_MIN and MW_CUNITS - it must be greater than or equal to the larger one multiplied by the number of PUs. However, for performance reasons, use the WS_OPT value to calculation instead of WS_MIN. Because the place where buffer size is calculated was changed, this patch also removes pgs_in_buffer filed in pblk structure. Signed-off-by: Marcin Dziegielewski Signed-off-by: Igor Konopko Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 05814a10370b3252fe2b0898b6adac3cdd531096 Author: Vladimir Zapolskiy Date: Fri Jul 13 17:07:26 2018 +0300 block: remove blkdev_entry_to_request() macro Remove blkdev_entry_to_request() macro, which remained unused through the observable history, also note that it repeats list_entry_rq() macro verbatim. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Jens Axboe commit eb1e39f784e83321353314da1b2e8cbb2fceaba9 Author: Colin Ian King Date: Wed Jul 11 09:01:03 2018 +0100 PCI: pcie-cadence-ep: Remove redundant variable mmc Variable mmc is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'mmc' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King [lorenzo.pieralisi@arm.com: reworked commit log] Signed-off-by: Lorenzo Pieralisi Acked-by: Alan Douglas commit 4eb44f69e77141992e305d9e75e021b196071cdd Author: Yoshihiro Shimoda Date: Tue Jul 3 19:51:47 2018 +0900 dt-bindings: usb-xhci: Add r8a77990 support This patch adds r8a77990 xhci support. The driver will use the fallback compatible string "renesas,rcar-gen3-xhci". Signed-off-by: Yoshihiro Shimoda Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman commit de167752a889d19b9bb018f8eecbc1ebbfe07b2f Author: Shuah Khan (Samsung OSG) Date: Mon Jul 9 13:07:04 2018 -0600 selftests: usbip: remove test_bitmap noise Remove test_bitmap noise which is a result of cut and paste error. There is no need for this modprobe -q -r test_bitmap noise in this test. Signed-off-by: Shuah Khan (Samsung OSG) Signed-off-by: Greg Kroah-Hartman commit 8975a68d8cbe85da10e669a7addf92cffe7f5de2 Author: Peter Senna Tschudin Date: Tue Jul 10 16:01:45 2018 +0200 tools: usb: ffs-test: Fix build on big endian systems The tools/usb/ffs-test.c file defines cpu_to_le16/32 by using the C library htole16/32 function calls. However, cpu_to_le16/32 are used when initializing structures, i.e in a context where a function call is not allowed. It works fine on little endian systems because htole16/32 are defined by the C library as no-ops. But on big-endian systems, they are actually doing something, which might involve calling a function, causing build failures, such as: ffs-test.c:48:25: error: initializer element is not constant #define cpu_to_le32(x) htole32(x) ^~~~~~~ ffs-test.c:128:12: note: in expansion of macro ‘cpu_to_le32’ .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2), ^~~~~~~~~~~ To solve this, we code cpu_to_le16/32 in a way that allows them to be used when initializing structures. This fix was imported from meta-openembedded/android-tools/fix-big-endian-build.patch written by Thomas Petazzoni . CC: Thomas Petazzoni Signed-off-by: Peter Senna Tschudin Signed-off-by: Greg Kroah-Hartman commit db9fc500e85a5292872c4b7c7f6a8230be6e016a Author: Colin Ian King Date: Fri Jul 13 10:24:33 2018 +0100 usb: dwc3: gadget: remove redundant variable maxpacket Variable maxpacket is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'maxpacket' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit ec81419310f56524d7428a73ef813be6cd3761b9 Author: Colin Ian King Date: Fri Jul 13 10:29:56 2018 +0100 usb: host: ehci-sched: remove redundant pointer dev Pointer dev is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'dev' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit a99e72095c957d79edeff23c59c92b6320d186ba Author: Colin Ian King Date: Fri Jul 13 10:36:43 2018 +0100 usb: host: u132-hcd: remove redundant variable num_ports Variable num_ports is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'num_ports' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit bebee48e7fd6e917b1625487342bfe3b3f5c1c56 Author: Colin Ian King Date: Fri Jul 13 10:43:01 2018 +0100 USB: host: whci: remove redundant variable t Variable t is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 't' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 6c7dbe36198e23099209cb2938f9675849fdde68 Author: Colin Ian King Date: Fri Jul 13 10:48:07 2018 +0100 usb: xhci: dbc: remove redundant pointer dbc Pointer dbc is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: variable 'dbc' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 260560322616472e3e26ece9e9bd044b19031c6c Author: Colin Ian King Date: Fri Jul 13 10:51:51 2018 +0100 usb: isp1760: remove redundant variable 'selector' Variable 'selector' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'selector' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 795a8075e9a53f441229c3890f702bf96508406b Author: Colin Ian King Date: Fri Jul 13 10:55:30 2018 +0100 usb-misc: sisusbvga: remove redundant variable modey Variable modey is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'modey' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit c588f1a46aa57f58148239d74bb6aec898e214c9 Author: Colin Ian King Date: Fri Jul 13 10:58:44 2018 +0100 usb: misc: uss720: remove redundant pointer usbdev Pointer usbdev is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'usbdev' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit a7d8205eaee70b55b0fe45fbd77c11e1ad3d7a7e Author: Colin Ian King Date: Fri Jul 13 11:45:01 2018 +0100 usb: usbip: remove redundant pointer ep Pointer ep is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'ep' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 3870288897f455fd5ec62539829ce7120a434c24 Author: John Whitmore Date: Fri Jul 13 12:23:11 2018 +0100 staging:rtl8192u: Rename file macro to avoid camel case - Coding Style Simple rename of the preprosessor switch, protecting against multiple inclusion of the header file. Change to clear the checkpatch coding style issue. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit f6e1472ae3b14a1e9b19ad1f9bebdfad769c9c25 Author: John Whitmore Date: Fri Jul 13 12:23:10 2018 +0100 staging:rtl8192u: Rename CmdID_RF_WriteReg > CMD_ID_RF_WRITE_REG - Style Rename enum label CmdID_RF_WriteReg to CMD_ID_RF_WRITE_REG. This change clears the checkpatch issue with CamelCase. The change is style only and should not impact code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 64641cf65eed2f6f4f52d5d76e03482accdb1699 Author: John Whitmore Date: Fri Jul 13 12:23:09 2018 +0100 staging:rtl8192u: Rename CmdID_WritePortUchar > CMD_ID_WRITE_PORT_UCHAR Rename the enum label CmdID_WritePortUchar to CMD_ID_WRITE_PORT_UCHAR, to clear the checkpatch issue with CamelCase. The change is a coding style change only and should not impact code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 61c9f41b317500d95e562726d15c640ce5b4de76 Author: John Whitmore Date: Fri Jul 13 12:23:08 2018 +0100 staging:rtl8192u: Rename CmdID_WritePortUshort > CMD_ID_WRITE_PORT_USHORT Rename the enum label CmdID_WritePortUshort to CMD_ID_WRITE_PORT_USHORT to clear the checkpatch warning on CamelCase naming. This is a coding style change only and should not impact code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3ebdf34f548141d1d7f3a69c10b590789a0e5411 Author: John Whitmore Date: Fri Jul 13 12:23:07 2018 +0100 staging:rtl8192u: Rename CmdID_WritePortUlong > CMD_ID_WRITE_PORT_ULONG Rename enum label CmdID_WritePortUlong to CMD_ID_WRITE_PORT_ULONG to clear the checkpatch CamelCase issue. Simple syle change which should not impact code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3a11b1948981abea8fae00e0fbed418fd169b1c2 Author: John Whitmore Date: Fri Jul 13 12:23:06 2018 +0100 staging:rtl8192u: Remove unused enum label CmdID_BBRegWrite10 The enum label CmdID_BBRegWrite10 is not used in the code, so removed from the source code. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 1be8f4e7588f5f4272baac097f61396eeb513183 Author: John Whitmore Date: Fri Jul 13 12:23:05 2018 +0100 staging:rtl8192u: rename CmdID_SetTxPowerLevel > CMD_ID_SET_TX_PWR_LEVEL Rename enumeration label CmdID_SetTxPowerLevel to CMD_ID_SET_TX_PWR_LEVEL. This change clears a checkpatch warning on CamelCase. The change should not impact runtime execution, style change only. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8772da06f6d01636a9c6e0fb7634c19c1be9d6e5 Author: John Whitmore Date: Fri Jul 13 12:23:04 2018 +0100 staging:rtl8192u: Rename enum label CmdID_End > CMD_ID_END - Style Rename enum label to clear a CamelCase warning from checkpatch. This is a simple style change and should not impact execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 2dad9cba09036f614f39e4c1be258d7ed78d591d Author: John Whitmore Date: Fri Jul 13 12:23:03 2018 +0100 staging:rtl8192u: Rename SwChnlCmdID > switch_chan_cmd_id - Coding Style Rename enumerated type to clear a CamelCase warning from checkpatch. The change is style only. No impact on run time execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 9821cb6d9bcad7144f0596d39a97b99dd9318600 Author: John Whitmore Date: Fri Jul 13 12:23:02 2018 +0100 staging:rtl8192u: remove typedef from structure SwChnlCmd - Style Checkpatch warns against creation of new types in code. This patch simply removes the "typedef" declaration of the structure SwChnlCmd to clear this issue. Simple coding style issue which should not impact runtime execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 8b5c53e62c98e52b555feb52ff8fa8fc913141e7 Author: John Whitmore Date: Fri Jul 13 12:23:01 2018 +0100 staging:rtl8192u: Remove typdef from enumeration RF90_RADIO_PATH_E - Style Checkpatch warns about the creation of new types. This patch simply removes the typedef from the enumeration RF90_RADIO_PATH_E to clear this checkpatch warning. There should be no impact on run time code execution, as this is a coding style issue only. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 983e14e25443d63adf228bc0c60f1bfa2a814166 Author: John Whitmore Date: Fri Jul 13 12:23:00 2018 +0100 staging:rtl8192u: remove typdef from enumeration HW90_BLOCK_E - Style Checkpatch warns about the creation of new types in code. This patch simply removes the typedef from the enumeration HW90_BLOCK_E to clear this warning. There should be no impact on run time code execution. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4162433ac98e07501e42dccd176ae846dedc0e21 Author: John Whitmore Date: Fri Jul 13 12:22:59 2018 +0100 staging:rtl8192u: remove typedef of enumeration SwChnlCmdID - Style To clear a checkpatch issue removed the typedef of the enumeration SwChnlCmdID this should not impact runtime code as it's only a coding style change. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 819abf294a381499a177a660805bf0b8a329700b Author: Colin Ian King Date: Fri Jul 13 10:05:35 2018 +0100 tty: serial: jsm: remove redundant pointer ch Pointer ch is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'ch' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 9c48b1d116cd0ab44f1a4a55be84b2b3d4a11b9b Merge: 6fd066604123 b18bea2a45b1 Author: Daniel Borkmann Date: Fri Jul 13 15:26:42 2018 +0200 Merge branch 'bpf-arm-jit-improvements' Russell King says: ==================== Four further jit compiler improves for 32-bit ARM. ==================== Signed-off-by: Daniel Borkmann commit b18bea2a45b136c4da7ff75305b54d66cf57de81 Author: Russell King Date: Thu Jul 12 21:50:56 2018 +0100 ARM: net: bpf: improve 64-bit ALU implementation Improbe the 64-bit ALU implementation from: movw r8, #65532 movt r8, #65535 movw r9, #65535 movt r9, #65535 ldr r7, [fp, #-44] adds r7, r7, r8 str r7, [fp, #-44] ldr r7, [fp, #-40] adc r7, r7, r9 str r7, [fp, #-40] to: movw r8, #65532 movt r8, #65535 movw r9, #65535 movt r9, #65535 ldrd r6, [fp, #-44] adds r6, r6, r8 adc r7, r7, r9 strd r6, [fp, #-44] Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit c5eae692571d6c44efeb27fe78a5ed8b5ded9b4a Author: Russell King Date: Thu Jul 12 21:50:51 2018 +0100 ARM: net: bpf: improve 64-bit store implementation Improve the 64-bit store implementation from: ldr r6, [fp, #-8] str r8, [r6] ldr r6, [fp, #-8] mov r7, #4 add r7, r6, r7 str r9, [r7] to: ldr r6, [fp, #-8] str r8, [r6] str r9, [r6, #4] We leave the store as two separate STR instructions rather than using STRD as the store may not be aligned, and STR can handle misalignment. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit 077513b89424ba814432b1cd7d7f793958059ed8 Author: Russell King Date: Thu Jul 12 21:50:46 2018 +0100 ARM: net: bpf: improve 64-bit sign-extended immediate load Improve the 64-bit sign-extended immediate from: mov r6, #1 str r6, [fp, #-52] ; 0xffffffcc mov r6, #0 str r6, [fp, #-48] ; 0xffffffd0 to: mov r6, #1 mov r7, #0 strd r6, [fp, #-52] ; 0xffffffcc Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit f9ff5018c13b4918c98178ee81d41372b455201e Author: Russell King Date: Thu Jul 12 21:50:41 2018 +0100 ARM: net: bpf: improve 64-bit load immediate implementation Rather than writing each 32-bit half of the 64-bit immediate value separately when the register is on the stack: movw r6, #45056 ; 0xb000 movt r6, #60979 ; 0xee33 str r6, [fp, #-44] ; 0xffffffd4 mov r6, #0 str r6, [fp, #-40] ; 0xffffffd8 arrange to use the double-word store when available instead: movw r6, #45056 ; 0xb000 movt r6, #60979 ; 0xee33 mov r7, #0 strd r6, [fp, #-44] ; 0xffffffd4 Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit afed7bcf9487bb28e2e2b016a195085c07416c0b Author: Mark Rutland Date: Wed Jul 11 10:36:07 2018 +0100 locking/refcount: Always allow checked forms In many cases, it would be useful to be able to use the full sanity-checked refcount helpers regardless of CONFIG_REFCOUNT_FULL, as this would help to avoid duplicate warnings where callers try to sanity-check refcount manipulation. This patch refactors things such that the full refcount helpers were always built, as refcount_${op}_checked(), such that they can be used regardless of CONFIG_REFCOUNT_FULL. This will allow code which *always* wants a checked refcount to opt-in, avoiding the need to duplicate the logic for warnings. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: David Sterba Acked-by: Kees Cook Acked-by: Will Deacon Cc: Boqun Feng Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180711093607.1644-1-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 53dd0c51f16be5f215d3ecad435062df99ee29ae Author: Shawn Guo Date: Sun Jul 1 11:54:51 2018 +0800 PCI: spear13xx: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Acked-by: Pratyush Anand commit 739cd35918b7cf495ea2d7abb2ff6ee97605f41d Author: Shawn Guo Date: Sun Jul 1 11:54:50 2018 +0800 PCI: qcom: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Acked-by: Stanimir Varbanov commit 73fb9924d26b835f67acedacfe032343c9ed4f06 Author: Shawn Guo Date: Sun Jul 1 11:54:49 2018 +0800 PCI: histb: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Cc: Jianguo Sun commit 3513f81816ef085c0068c8aea04b78b0a06a8720 Author: Shawn Guo Date: Sun Jul 1 11:54:48 2018 +0800 PCI: designware-plat: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Acked-by: Gustavo Pimentel Cc: Joao Pinto commit 84b88219553af870a47e28d6ba288bd6fbd129f7 Author: Shawn Guo Date: Sun Jul 1 11:54:47 2018 +0800 PCI: artpec6: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Acked-by: Jesper Nilsson Cc: Jesper Nilsson commit 53b801fd020d4d00a1eebbab9f042a8b9fe03b78 Author: Shawn Guo Date: Sun Jul 1 11:54:46 2018 +0800 PCI: armada8k: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Acked-by: Thomas Petazzoni commit 8519bc8fe88fbe5c1e448ae1dd1ba215a1723abe Author: Shawn Guo Date: Sun Jul 1 11:54:45 2018 +0800 PCI: keystone: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Cc: Murali Karicheri commit 39f712e989c5e591c58b65b62981b85027ba3103 Author: Shawn Guo Date: Sun Jul 1 11:54:44 2018 +0800 PCI: imx6: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Reviewed-by: Lucas Stach Cc: Richard Zhu Cc: Lucas Stach commit a0476b3a678b4145a993f56071989af39d5718fb Author: Shawn Guo Date: Sun Jul 1 11:54:43 2018 +0800 PCI: exynos: Drop unnecessary root_bus_nr setting Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Lorenzo Pieralisi Cc: Jingoo Han commit 1b8a8589a3e10997fa8f43e7da874c4903f33ac7 Author: Hugues Fruchet Date: Thu Jul 5 11:05:00 2018 +0200 ARM: multi_v7_defconfig: enable STM32 DCMI media support Enables support of STM32 DCMI V4L2 media driver. Signed-off-by: Hugues Fruchet Signed-off-by: Alexandre Torgue commit e270718ec3d137d19b45ab3cc0fa3b7f67c6fd1f Author: Pierre-Yves MORDRET Date: Mon May 28 11:08:00 2018 +0200 ARM: multi_v7_defconfig: enable STM32 DMAv2, DMAMUX and MDMA This enables drivers for STM32: - DMAv2 - DMMAUX - MDMA Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Alexandre Torgue commit a9b8e2fb054cc9e315b9aa0e2b1ddaeffba5997d Author: Amelie Delaunay Date: Thu May 17 14:07:00 2018 +0200 ARM: multi_v7_defconfig: enable STM32 RTC Enable the STM32 Real Time Clock (RTC) driver, implemented on STM32MP1 SoC. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit c2888cc2e2b8fc16164de0cca806763831a36f6f Author: Ludovic Barre Date: Fri Jul 13 11:21:39 2018 +0200 ARM: dts: stm32: update iwdg with lsi clock name for stm32f429 This patch updates iwdg watchdog to use lsi clock name. Signed-off-by: Ludovic Barre Acked-by: Guenter Roeck Signed-off-by: Alexandre Torgue commit dd2eda3d97d99781f1889b3e08fd18c6f8ff23c7 Author: Ludovic Barre Date: Mon Jun 25 17:43:00 2018 +0200 ARM: dts: stm32: add iwdg2 support for stm32mp157c-ed1 This patch activates independent watchdog support for stm32mp157c board. Signed-off-by: Ludovic Barre Reviewed-by: Guenter Roeck Signed-off-by: Alexandre Torgue commit 5f0f3bac59207562b08124ad28339c6485c9178c Author: Ludovic Barre Date: Mon Jun 25 17:43:00 2018 +0200 ARM: dts: stm32: add iwdg2 support for stm32mp157c This patch adds independent watchdog support for stm32mp157c. Signed-off-by: Ludovic Barre Acked-by: Guenter Roeck Signed-off-by: Alexandre Torgue commit e880845e29f4393034c6c56f007ecda4fb377efc Author: Alexandre Torgue Date: Tue Jun 26 18:07:49 2018 +0200 ARM: dts: stm32: Reorder nodes in stm32mp157c-ed1 Nodes should be ordered in alphabetic order. Signed-off-by: Alexandre Torgue commit b86646881b4fe213ebaa58f3a18351df1a7ed2b1 Author: Alexandre Torgue Date: Tue Jun 26 17:55:13 2018 +0200 ARM: dts: stm32: remove gpio aliases for stm32mp157c GPIO aliases are not used by stm32 pinctrl driver. Signed-off-by: Alexandre Torgue commit a7419ff8b71a10fca551e3e7e89afe6a2b89559f Author: Christophe Roullier Date: Tue Jun 26 15:12:23 2018 +0200 ARM: dts: stm32: add support of ethernet on stm32mp157c-ev1 MAC is connected to a PHY in RGMII mode. Signed-off-by: Christophe Roullier Signed-off-by: Alexandre Torgue commit 7c045e8be193ef61a34953a22a9eba97f392a2b1 Author: Christophe Roullier Date: Tue Jun 26 18:24:26 2018 +0200 ARM: dts: stm32: Add ethernet dwmac on stm32mp1 Add Ethernet support (Synopsys MAC IP 4.20a) on stm32mp1 SOC. Enable feature supported by the stmmac driver, such as TSO. Signed-off-by: Christophe Roullier Signed-off-by: Alexandre Torgue commit 06944a55fe4b98218ab61305839ab5cd19f70ae3 Author: Christophe Roullier Date: Wed May 23 17:47:00 2018 +0200 ARM: dts: stm32: Add syscfg on stm32mp1 System configuration controller is mainly used to manage the compensation cell and other IOs and system related settings. Signed-off-by: Christophe Roullier Signed-off-by: Alexandre Torgue commit 7e29ed4a970ca563693ff0dac21a63977c184ce4 Author: Amelie Delaunay Date: Thu May 17 16:21:00 2018 +0200 ARM: dts: stm32: add SPI1 support on stm32mp157c-ev1 This patch adds SPI1 support on stm32mp157c-ev1 board. SPI1 is available on GPIO expansion connector but kept disabled so these pins can be used as GPIOs by default. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit dc3f8c86c10d9c3ed481af1cd219de7a37ebe5f0 Author: Amelie Delaunay Date: Tue Jun 26 14:54:07 2018 +0200 ARM: dts: stm32: add SPI support on stm32mp157c This patch adds all SPI instances on stm32mp157c. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit 7beba56566d50144d29c3e805e2b325b8de15b21 Author: Fabrice Gasnier Date: Wed May 23 11:30:00 2018 +0200 ARM: dts: stm32: Add DFSDM support to stm32mp157c stm32mp157c has DFSDM (Digital Filter For Sigma Delta Modulators) hardware with 6 filter instances. Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit 2dca78998a93029514ae8022f3f3bebdb0771973 Author: Fabrice Gasnier Date: Tue May 22 17:45:00 2018 +0200 ARM: dts: stm32: Add ADC support to stm32mp157c stm32mp157c has an ADC block with two physical ADCs. Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit 0bfa7f78dd226251fc31386346624e89ec79726b Author: Amelie Delaunay Date: Thu May 17 17:47:00 2018 +0200 ARM: dts: stm32: enable USB OTG HS on stm32mp157c-ev1 This patch enables USB OTG HS on stm32mp157c-ev1 in Peripheral mode. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit e2c205ab669b165190b19c1f925d96edba394339 Author: Amelie Delaunay Date: Thu May 17 17:47:00 2018 +0200 ARM: dts: stm32: add USB OTG HS support for stm32mp157c SoC This patch adds support for USB OTG HS on STM32MP157C SoC. USB OTG HS controller is based on DWC2 controller. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit 359754ed7a1efe0b08f5dd122015af53413c1bed Author: Amelie Delaunay Date: Thu May 17 16:36:00 2018 +0200 ARM: dts: stm32: enable USB Host (USBH) EHCI controller on stm32mp157c-ev1 This patch enables USB Host (USBH) EHCI controller on stm32mp157c-ev1. As a hub is used between USBH and USB connectors, no need to enable USBH OHCI controller: all low- and full-speed traffic is managed by the hub. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit c462f6c77e72804b72e008a91c4b6fa8d9b4b265 Author: Antoine Tenart Date: Thu Jun 28 17:15:44 2018 +0200 arm64: dts: marvell: armada-37xx: update the crypto engine compatible New compatibles are now supported by the Inside Secure SafeXcel driver. As they are more specific than the old ones, they should be used whenever possible. This patch updates the Marvell Armada 37xx device tree accordingly. Signed-off-by: Antoine Tenart Signed-off-by: Gregory CLEMENT commit 9598918b59f507d3dcbd9c46a68ff8c1930c6a72 Author: Antoine Tenart Date: Thu Jun 28 17:15:43 2018 +0200 arm64: dts: marvell: armada-cp110: update the crypto engine compatible New compatibles are now supported by the Inside Secure SafeXcel driver. As they are more specific than the old ones, they should be used whenever possible. This patch updates the Marvell cp110 device tree accordingly. Signed-off-by: Antoine Tenart Signed-off-by: Gregory CLEMENT commit 0043d4ae812e474d4edd28b60f203bfbb4edc93b Author: Ray Jui Date: Mon Jun 11 17:21:07 2018 -0700 PCI: iproc: Reduce inbound/outbound mapping print level Reduce inbound/outbound mapping print level from dev_info() to dev_dbg(). This reduces the console logs during Linux boot process. Signed-off-by: Ray Jui Signed-off-by: Lorenzo Pieralisi Reviewed-by: Scott Branden Reviewed-by: Oza Pawandeep commit f78e60a29d4ff27531770cf2c6eee89292379209 Author: Ray Jui Date: Mon Jun 11 17:21:06 2018 -0700 PCI: iproc: Reject unconfigured physical functions from PAXC PAXC is an emulated PCIe root complex internally in various Broadcom based SoCs. PAXC internally connects to the embedded network processor within these SoCs, with the embedeed network processor exposed as an endpoint device. The number of physical functions from the embedded network processor that can be accessed depends on the firmware configuration. Unfortunately, due to an ASIC bug, unconfigured physical functions cannot be properly hidden from the root complex during enumerattion. As a result, config write access to these unconfigured physical functions during enumeration will cause a bus lock up on the embedded network processor. Fortunately, these unconfigured physical functions contain a very specific, staled PCIe device ID 0x168e. By making use of this device ID, one is able to terminate the enumeration early in the vendor/device ID config read. Signed-off-by: Ray Jui Signed-off-by: Lorenzo Pieralisi Reviewed-by: Scott Branden Reviewed-by: Oza Pawandeep commit 1e5748c27ad6669ec4a377f44ef40898c28184e5 Author: Ray Jui Date: Mon Jun 11 17:21:05 2018 -0700 PCI: iproc: Disable MSI parsing in certain PAXC blocks The internal MSI parsing logic in certain revisions of PAXC root complexes does not work properly and can cause corruptions on the writes transactions so they need to be disabled. Signed-off-by: Ray Jui Signed-off-by: Lorenzo Pieralisi Reviewed-by: Scott Branden Reviewed-by: Oza Pawandeep commit 3bc70825e4361eaedffeb4e85e1b2774547e66a0 Author: Ray Jui Date: Mon Jun 11 17:21:04 2018 -0700 PCI: iproc: Fix up corrupted PAXC root complex config registers On certain versions of Broadcom PAXC based root complexes, certain regions of the configuration space are corrupted. As a result, it prevents the Linux PCIe stack from traversing the linked list of the capability registers completely and therefore the root complex is not advertised as "PCIe capable". This prevents the correct PCIe RID from being parsed in the kernel PCIe stack. A correct RID is required for mapping to a stream ID from the SMMU or the device ID from the GICv3 ITS. This patch fixes up the issue by manually populating the related PCIe capabilities. Signed-off-by: Ray Jui Signed-off-by: Lorenzo Pieralisi Reviewed-by: Oza Pawandeep commit b95e2cd021938d2c3455fd2fce69b4845de0b85f Author: Ray Jui Date: Mon Jun 11 17:21:03 2018 -0700 PCI: iproc: Activate PAXC bridge quirk for more devices Activate PAXC bridge quirk for more PAXC based PCIe root complex with the following PCIe device ID: 0xd750, 0xd802, 0xd804 Signed-off-by: Ray Jui Signed-off-by: Lorenzo Pieralisi Reviewed-by: Oza Pawandeep Acked-by: Bjorn Helgaas commit 90c3e2198777aaa355b6994a31a79c636c8d4306 Author: Clint Taylor Date: Tue Jul 10 13:02:05 2018 -0700 drm/i915/glk: Add Quirk for GLK NUC HDMI port issues. On GLK NUC platforms the HDMI retiming buffer needs additional disabled time to correctly sync to a faster incoming signal. When measured on a scope the highspeed lines of the HDMI clock turn off for ~400uS during a normal resolution change. The HDMI retimer on the GLK NUC appears to require at least a full frame of quiet time before a new faster clock can be correctly sync'd. Wait 100ms due to msleep inaccuracies while waiting for a completed frame. Add a quirk to the driver for GLK boards that use ITE66317 HDMI retimers. V2: Add more devices to the quirk list V3: Delay increased to 100ms, check to confirm crtc type is HDMI. V4: crtc type check extended to include _DDI and whitespace fixes v5: Fix white spaces, remove the macro for delay. Revert the crtc type check introduced in v4. Cc: Imre Deak Cc: # v4.14+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105887 Signed-off-by: Clint Taylor Tested-by: Daniel Scheller Signed-off-by: Radhakrishna Sripada Signed-off-by: Imre Deak Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20180710200205.1478-1-radhakrishna.sripada@intel.com commit d6be72ee2c77469d4fb391ccccc2ebc1b167a242 Author: Gustavo A. R. Silva Date: Wed Jul 4 11:37:20 2018 -0500 crypto: chtls - use 64-bit arithmetic instead of 32-bit Cast *val* to u64 in order to give the compiler complete information about the proper arithmetic to use. Notice that such variable is used in a context that expects an expression of type u64 (64 bits, unsigned) and the following expression is currently being evaluated using 32-bit arithmetic: val << bit_pos Addresses-Coverity-ID: 1467425 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Herbert Xu commit dcbc0c6e4aa1ef269179351ac615fd08ddefc849 Author: Tom Lendacky Date: Tue Jul 3 12:12:14 2018 -0500 crypto: ccp - Add support for new CCP/PSP device ID Add a new CCP/PSP PCI device ID and new PSP register offsets. Signed-off-by: Tom Lendacky Acked-by: Gary R Hook Reviewed-by: Brijesh Singh Signed-off-by: Herbert Xu commit ad01a984f512c42c9f4fe79d36b9cddbc6156a3f Author: Tom Lendacky Date: Tue Jul 3 12:12:03 2018 -0500 crypto: ccp - Support register differences between PSP devices In preparation for adding a new PSP device ID that uses different register offsets, add support to the PSP version data for register offset values. And then update the code to use these new register offset values. Signed-off-by: Tom Lendacky Acked-by: Gary R Hook Reviewed-by: Brijesh Singh Signed-off-by: Herbert Xu commit 03af91242c36f225c6fa79e143fad5f4c3624a46 Author: Tom Lendacky Date: Tue Jul 3 12:11:52 2018 -0500 crypto: ccp - Remove unused #defines Remove some unused #defines for register offsets that are not used. This will lessen the changes required when register offsets change between versions of the device. Signed-off-by: Tom Lendacky Acked-by: Gary R Hook Reviewed-by: Brijesh Singh Signed-off-by: Herbert Xu commit 015c8c85b721e93bcd6a3f4b5be63112ecb331c4 Author: Tom Lendacky Date: Tue Jul 3 12:11:42 2018 -0500 crypto: ccp - Add psp enabled message when initialization succeeds Add a dev_notice() message to the PSP initialization to report when the PSP initialization has succeeded and the PSP is enabled. Signed-off-by: Tom Lendacky Acked-by: Gary R Hook Signed-off-by: Herbert Xu commit f426d2b20f1cd63818873593031593e15c3db20b Author: Tom Lendacky Date: Tue Jul 3 12:11:33 2018 -0500 crypto: ccp - Fix command completion detection race The wait_event() function is used to detect command completion. The interrupt handler will set the wait condition variable when the interrupt is triggered. However, the variable used for wait_event() is initialized after the command has been submitted, which can create a race condition with the interrupt handler and result in the wait_event() never returning. Move the initialization of the wait condition variable to just before command submission. Fixes: 200664d5237f ("crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support") Cc: # 4.16.x- Signed-off-by: Tom Lendacky Reviewed-by: Brijesh Singh Acked-by: Gary R Hook Acked-by: Gary R Hook Signed-off-by: Herbert Xu commit cf19fa2cfa4e9b5458b6f3503c5317dd1a2bfbae Author: Noralf Trønnes Date: Thu Jul 12 17:04:14 2018 +0200 drm/client: Fix double free in error path This fixes a static checker warning: drivers/gpu/drm/drm_client.c:289 drm_client_buffer_create() error: double free of 'buffer' Extend drm_client_buffer_delete() to handle the case when there's no dumb buffer attached and drop the extra kfree. Fixes: c76f0f7cb546 ("drm: Begin an API for in-kernel clients") Reported-by: Dan Carpenter Cc: Daniel Vetter Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180712150414.46908-1-noralf@tronnes.org commit 153c6b11eb40e93c5a9cabd63ffebde37e7661f8 Author: Michael Straube Date: Thu Jul 12 12:36:10 2018 +0200 staging: rtl8723bs: fix comparsions to true Use if(x) instead of if(x == true). Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 6bf4d28ea1f438256983376b1f58f588a57161ec Author: Michael Straube Date: Thu Jul 12 12:36:09 2018 +0200 staging: rtl8723bs: change return type to bool Both rtw_is_cckrates_included() and rtw_is_cckratesonly_included() return true or false. Change the return type from uint to bool. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 4f2a3d835dbd971224c4c6ff2e715e1056659d10 Author: Michael Straube Date: Thu Jul 12 12:36:08 2018 +0200 staging: rtl8723bs: refactor rtw_is_cckratesonly_included Refactor rtw_is_cckratesonly_included() to improve readability and slightly reduce object file size. Suggested-by: Joe Perches Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c53578cd0ba8251304560c818c558b32a23217aa Author: Michael Straube Date: Thu Jul 12 12:36:07 2018 +0200 staging: rtl8723bs: refactor rtw_is_cckrates_included() Refactor rtw_is_cckrates_included() to improve readability and slightly reduce object file size. Suggested-by: Joe Perches Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 5e53b6c871520376edad8bcfc423c2181f13e169 Author: Michael Straube Date: Thu Jul 12 12:36:06 2018 +0200 staging: rtl8723bs: remove unused code Remove commented rtw_is_cckrates_included() and rtw_is_cckratesonly_included() from os_dep/ioctl_linux.c. Both are defined in core/rtw_ieee80211.c. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 704719d6cde0be9aaacdb64c4eacdb1b99838fea Author: John Whitmore Date: Wed Jul 11 20:21:49 2018 +0100 staging:rtl8192u: Change struct r8192_priv member Rf_Mode from u8 > enum The file r8192U.h defines the structure for holding private data for the driver (typedef struct r8192_priv). This structure includes a member Rf_Mode which is defined to be of type "u8". Whilst the variable Rf_Mode is defined to be of type "u8" it is being assigned enumerated values defined by the enumerated type "enum rf_op_type". Because of the mismatch in types being used any advantage of using an enumerated type, to have the compiler check assignments, is nullified. This patch changes the type of the Rf_Mode member from a u8 to the enumerated type "enum rf_op_type", so that the compiler can now check assignments. This change of type would cause a problem if the structure was mapped from a hardware device and the size and location of members was significant. I believe that the structure to hold private data for the driver is allocated from memory and populated with data in the function rtl8192_usb_probe() in the file r8192U_core.c. As such the physical size of the member variable Rf_Mode is not significant, so the change should have no impact on code execution, bar the move from a u8 type to an int, (or whatever size compiler uses for enum). Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6898f96695142c0d201ae59bd172236534b23ffe Author: John Whitmore Date: Wed Jul 11 20:21:48 2018 +0100 staging:rtl8192u: remove typedef from struct rx_drvinfo_819x_usb Removed the typedef from the struct rx_drvinfo_819x_usb to leave it as a simple structure. This clears the issue flagged by checkpatch, defining new types. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 0fab863ecc551a5661ff5c5e5ae4d3ba7504ffc3 Author: John Whitmore Date: Wed Jul 11 20:21:47 2018 +0100 staging:rtl8192u: Remove struct rx_desc_819x_usb_aggr_subframe Removal of structure rx_desc_819x_usb_aggr_subframe from local header file, which is not used outside the header file. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 2541fcd9bb5b18156af908b0dfc37a94a6268d33 Author: John Whitmore Date: Wed Jul 11 20:21:46 2018 +0100 staging:rtl8192u: typedef struct rx_desc_819x_usb remove typedef Change structure rx_desc_819x_usb from being typedef to being a simple structure, without the typedef. Clears a checkpatch issue, definging new types in the code. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit ec65e266ae548ea560c7f109c3d9749abcc877b5 Author: John Whitmore Date: Wed Jul 11 20:21:45 2018 +0100 staging:rtl8192u: typedef struct tx_fwinfo_819x_usb remove typedef Change structure tx_fwinfo_819x_usb from being typedef to being a simple structure, without the typedef. Clears the coding style issue flagged by checkpatch, (new type definitions) Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6e5fde482be90222aad73e6566dcd9b3f9343b27 Author: John Whitmore Date: Wed Jul 11 20:21:44 2018 +0100 staging:rtl8192u: typedef struct tx_desc_cmd_819x_usb remove typedef Change structure tx_desc_cmd_819x_usb from being typedef to being a simple structure, without the typedef. checkpatch warns about defining new types in the code. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 28a1fe524ac49590d052d4cf3b7aebef803d641d Author: John Whitmore Date: Wed Jul 11 20:21:42 2018 +0100 staging:rtl8192u: remove unused structure tx_desc_819x_usb_aggr_subframe Structure tx_desc_819x_usb_aggr_subframe is defined in a local header file but is not used outside of the header file. Removed from the code as a result. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit ef7ebea4ae3abaad659c3e809ae64f38685dd8ad Author: John Whitmore Date: Wed Jul 11 20:21:41 2018 +0100 staging:rtl8192u: trim multiple blank lines - Coding Style Trim the extra blank lines from the code, to clear checkpatch messages. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c0f94a0aebe605a5a3ffa8c9afc0ebedef6c0a15 Author: John Whitmore Date: Wed Jul 11 20:21:40 2018 +0100 staging:rtl8192u: typedef struct tx_desc_819x_usb > struct tx_desc_819x_usb Change structure tx_desc_819x_usb from being typedef to being a simple structure, without the typedef. checkpatch warns about defining new types in code. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 678c5b119307c40f9a17152512f9c949d0ec7292 Author: Tuomas Tynkkynen Date: Fri Jul 13 00:54:17 2018 +0300 staging: bcm2835-audio: Don't leak workqueue if open fails Currently, if bcm2835_audio_open() fails partway, the allocated workqueue is leaked. Avoid that. While at it, propagate the return value of bcm2835_audio_open_connection() on failure instead of returning -1. Signed-off-by: Tuomas Tynkkynen Signed-off-by: Greg Kroah-Hartman commit 4feb0f375f030050906c834fde8bf80ac4a4571b Author: Tuomas Tynkkynen Date: Fri Jul 13 00:54:16 2018 +0300 staging: bcm2835-audio: Check if workqueue allocation failed Currently, if allocating a workqueue fails, the driver will probe successfully but it will silently do nothing, which is rather silly. So instead bail out with -ENOMEM in bcm2835_audio_open() if alloc_workqueue() fails, and remove the now pointless checks for a NULL workqueue. While at it, get rid of the rather pointless one-line function my_workqueue_init(). Signed-off-by: Tuomas Tynkkynen Signed-off-by: Greg Kroah-Hartman commit 81f34e96dc9f965e80497ffbc764bf931b91ac5f Author: Ioana Radulescu Date: Thu Jul 12 12:12:29 2018 -0500 staging: fsl-dpaa2/eth: Remove unnecessary cast There's no need to explicitly cast DPAA2_ETH_MFL to u16, so remove it. Signed-off-by: Ioana Radulescu Suggested-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit de9b58400a3ce6b9b6cc45f66c3f5e3d754becf1 Author: Michael Straube Date: Thu Jul 12 18:16:13 2018 +0200 staging: rtl8188eu: use strlcpy instead of strncpy Use strlcpy instead of strncpy to avoid gcc 8 warning: warning: '__builtin_strncpy' specified bound 16 equals destination size [-Wstringop-truncation] The maximum length of the source string including terminating null is 5. Hence it always fits in the destination buffer of length 16. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit a796528951e25a9ee635bd22d0a6e2c4fb2bd45c Author: Bjorn Helgaas Date: Thu Jul 12 10:33:30 2018 -0500 staging: rtlwifi: Remove empty halmac_pcie_reg.h halmac_pcie_reg.h is empty, so remove it and the only include of it. Signed-off-by: Bjorn Helgaas Signed-off-by: Greg Kroah-Hartman commit 6cf58b91827002673b5e0a505743bb291951952d Author: Kacper Kołodziej Date: Thu Jul 12 10:11:39 2018 +0200 staging: rtl8188eu: break line longer than 80 cols Break too long line to follow kernel coding style. Signed-off-by: Kacper Kołodziej Signed-off-by: Greg Kroah-Hartman commit a5ba1d95e46ecaea638ddd7cd144107c783acb5d Author: Tycho Andersen Date: Fri Jul 6 10:24:57 2018 -0600 uart: fix race between uart_put_char() and uart_shutdown() We have reports of the following crash: PID: 7 TASK: ffff88085c6d61c0 CPU: 1 COMMAND: "kworker/u25:0" #0 [ffff88085c6db710] machine_kexec at ffffffff81046239 #1 [ffff88085c6db760] crash_kexec at ffffffff810fc248 #2 [ffff88085c6db830] oops_end at ffffffff81008ae7 #3 [ffff88085c6db860] no_context at ffffffff81050b8f #4 [ffff88085c6db8b0] __bad_area_nosemaphore at ffffffff81050d75 #5 [ffff88085c6db900] bad_area_nosemaphore at ffffffff81050e83 #6 [ffff88085c6db910] __do_page_fault at ffffffff8105132e #7 [ffff88085c6db9b0] do_page_fault at ffffffff8105152c #8 [ffff88085c6db9c0] page_fault at ffffffff81a3f122 [exception RIP: uart_put_char+149] RIP: ffffffff814b67b5 RSP: ffff88085c6dba78 RFLAGS: 00010006 RAX: 0000000000000292 RBX: ffffffff827c5120 RCX: 0000000000000081 RDX: 0000000000000000 RSI: 000000000000005f RDI: ffffffff827c5120 RBP: ffff88085c6dba98 R8: 000000000000012c R9: ffffffff822ea320 R10: ffff88085fe4db04 R11: 0000000000000001 R12: ffff881059f9c000 R13: 0000000000000001 R14: 000000000000005f R15: 0000000000000fba ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #9 [ffff88085c6dbaa0] tty_put_char at ffffffff81497544 #10 [ffff88085c6dbac0] do_output_char at ffffffff8149c91c #11 [ffff88085c6dbae0] __process_echoes at ffffffff8149cb8b #12 [ffff88085c6dbb30] commit_echoes at ffffffff8149cdc2 #13 [ffff88085c6dbb60] n_tty_receive_buf_fast at ffffffff8149e49b #14 [ffff88085c6dbbc0] __receive_buf at ffffffff8149ef5a #15 [ffff88085c6dbc20] n_tty_receive_buf_common at ffffffff8149f016 #16 [ffff88085c6dbca0] n_tty_receive_buf2 at ffffffff8149f194 #17 [ffff88085c6dbcb0] flush_to_ldisc at ffffffff814a238a #18 [ffff88085c6dbd50] process_one_work at ffffffff81090be2 #19 [ffff88085c6dbe20] worker_thread at ffffffff81091b4d #20 [ffff88085c6dbeb0] kthread at ffffffff81096384 #21 [ffff88085c6dbf50] ret_from_fork at ffffffff81a3d69f​ after slogging through some dissasembly: ffffffff814b6720 : ffffffff814b6720: 55 push %rbp ffffffff814b6721: 48 89 e5 mov %rsp,%rbp ffffffff814b6724: 48 83 ec 20 sub $0x20,%rsp ffffffff814b6728: 48 89 1c 24 mov %rbx,(%rsp) ffffffff814b672c: 4c 89 64 24 08 mov %r12,0x8(%rsp) ffffffff814b6731: 4c 89 6c 24 10 mov %r13,0x10(%rsp) ffffffff814b6736: 4c 89 74 24 18 mov %r14,0x18(%rsp) ffffffff814b673b: e8 b0 8e 58 00 callq ffffffff81a3f5f0 ffffffff814b6740: 4c 8b a7 88 02 00 00 mov 0x288(%rdi),%r12 ffffffff814b6747: 45 31 ed xor %r13d,%r13d ffffffff814b674a: 41 89 f6 mov %esi,%r14d ffffffff814b674d: 49 83 bc 24 70 01 00 cmpq $0x0,0x170(%r12) ffffffff814b6754: 00 00 ffffffff814b6756: 49 8b 9c 24 80 01 00 mov 0x180(%r12),%rbx ffffffff814b675d: 00 ffffffff814b675e: 74 2f je ffffffff814b678f ffffffff814b6760: 48 89 df mov %rbx,%rdi ffffffff814b6763: e8 a8 67 58 00 callq ffffffff81a3cf10 <_raw_spin_lock_irqsave> ffffffff814b6768: 41 8b 8c 24 78 01 00 mov 0x178(%r12),%ecx ffffffff814b676f: 00 ffffffff814b6770: 89 ca mov %ecx,%edx ffffffff814b6772: f7 d2 not %edx ffffffff814b6774: 41 03 94 24 7c 01 00 add 0x17c(%r12),%edx ffffffff814b677b: 00 ffffffff814b677c: 81 e2 ff 0f 00 00 and $0xfff,%edx ffffffff814b6782: 75 23 jne ffffffff814b67a7 ffffffff814b6784: 48 89 c6 mov %rax,%rsi ffffffff814b6787: 48 89 df mov %rbx,%rdi ffffffff814b678a: e8 e1 64 58 00 callq ffffffff81a3cc70 <_raw_spin_unlock_irqrestore> ffffffff814b678f: 44 89 e8 mov %r13d,%eax ffffffff814b6792: 48 8b 1c 24 mov (%rsp),%rbx ffffffff814b6796: 4c 8b 64 24 08 mov 0x8(%rsp),%r12 ffffffff814b679b: 4c 8b 6c 24 10 mov 0x10(%rsp),%r13 ffffffff814b67a0: 4c 8b 74 24 18 mov 0x18(%rsp),%r14 ffffffff814b67a5: c9 leaveq ffffffff814b67a6: c3 retq ffffffff814b67a7: 49 8b 94 24 70 01 00 mov 0x170(%r12),%rdx ffffffff814b67ae: 00 ffffffff814b67af: 48 63 c9 movslq %ecx,%rcx ffffffff814b67b2: 41 b5 01 mov $0x1,%r13b ffffffff814b67b5: 44 88 34 0a mov %r14b,(%rdx,%rcx,1) ffffffff814b67b9: 41 8b 94 24 78 01 00 mov 0x178(%r12),%edx ffffffff814b67c0: 00 ffffffff814b67c1: 83 c2 01 add $0x1,%edx ffffffff814b67c4: 81 e2 ff 0f 00 00 and $0xfff,%edx ffffffff814b67ca: 41 89 94 24 78 01 00 mov %edx,0x178(%r12) ffffffff814b67d1: 00 ffffffff814b67d2: eb b0 jmp ffffffff814b6784 ffffffff814b67d4: 66 66 66 2e 0f 1f 84 data32 data32 nopw %cs:0x0(%rax,%rax,1) ffffffff814b67db: 00 00 00 00 00 for our build, this is crashing at: circ->buf[circ->head] = c; Looking in uart_port_startup(), it seems that circ->buf (state->xmit.buf) protected by the "per-port mutex", which based on uart_port_check() is state->port.mutex. Indeed, the lock acquired in uart_put_char() is uport->lock, i.e. not the same lock. Anyway, since the lock is not acquired, if uart_shutdown() is called, the last chunk of that function may release state->xmit.buf before its assigned to null, and cause the race above. To fix it, let's lock uport->lock when allocating/deallocating state->xmit.buf in addition to the per-port mutex. v2: switch to locking uport->lock on allocation/deallocation instead of locking the per-port mutex in uart_put_char. Note that since uport->lock is a spin lock, we have to switch the allocation to GFP_ATOMIC. v3: move the allocation outside the lock, so we can switch back to GFP_KERNEL Signed-off-by: Tycho Andersen Cc: stable Signed-off-by: Greg Kroah-Hartman commit ad817297418539b8895bbbf1d05ee3e5a211a117 Author: Geert Uytterhoeven Date: Thu Jul 12 11:15:01 2018 +0200 gpio: rcar: Implement .get_direction() callback Allow gpiolib to read back the current I/O direction configuration by implementing the .get_direction() callback. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Linus Walleij commit 5089ea15baa9e7b0cb49f36881f2cb27bf281789 Author: Arnd Bergmann Date: Wed Jul 11 14:47:12 2018 +0200 rtc: use ktime_get_real_ts64() instead of getnstimeofday64() getnstimeofday64() is just a wrapper around the ktime accessor, so we should use that directly. I considered using ktime_get_boottime_ts64() (to avoid leap second problems) or ktime_get_real_seconds() (to simplify the calculation, but in the end concluded that the existing interface is probably the most appropriate in this case. Signed-off-by: Arnd Bergmann Signed-off-by: Alexandre Belloni commit 948fd537bd3d6f347ff1c87b82479873d1fcc77f Author: Felix Siegel Date: Fri Jul 13 00:58:49 2018 +0200 staging: gasket: Use __func__ instead of hardcoded string - Style Changed logging statements to use %s and __func__ instead of hard coding the function name in a string. Signed-off-by: Felix Siegel Signed-off-by: Greg Kroah-Hartman commit 792b260dafc33261444ca7d55bff30cf5e86a304 Author: Felix Siegel Date: Fri Jul 13 00:58:48 2018 +0200 staging: gasket: remove "function entered" log messages Remove log messages that solely print the function's name everytime it is called. Signed-off-by: Felix Siegel Signed-off-by: Greg Kroah-Hartman commit 1c22a252b3ded10d06acecdf8fb71f9dd8005c4f Author: Andy Shevchenko Date: Thu Jul 12 20:36:42 2018 +0300 gpiolib: Join one line back for better readability One line in gpiolib_dbg_show() still fits 80 characters, so, join it to be like that in order to increase readability. Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit a08eac479b4e6de3700d8d1c7c664d4ffc0535c7 Author: Thomas Zimmermann Date: Thu Jul 12 17:26:39 2018 +0200 drm/sti: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Acked-by: Benjamin Gaignard Signed-off-by: Benjamin Gaignard Link: https://patchwork.freedesktop.org/patch/msgid/20180712152639.30934-1-tzimmermann@suse.de commit a1a6fa3dcda11d068f5e629c7a18ef7282bf0c7d Author: Thomas Zimmermann Date: Fri Jul 13 10:06:25 2018 +0200 drm/stm: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Acked-by: Philippe Cornu Signed-off-by: Benjamin Gaignard Link: https://patchwork.freedesktop.org/patch/msgid/20180713080625.18256-1-tzimmermann@suse.de commit 9506755633d0b32ef76f67c345000178e9b0dfc4 Author: Wei Yongjun Date: Wed Jul 11 13:19:38 2018 +0000 gpio: pxa: Fix potential NULL dereference platform_get_resource() may fail and return NULL, so we should better check it's return value to avoid a NULL pointer dereference a bit later in the code. This is detected by Coccinelle semantic patch. @@ expression pdev, res, n, t, e, e1, e2; @@ res = platform_get_resource(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Signed-off-by: Wei Yongjun Acked-by: Robert Jarzmik Signed-off-by: Linus Walleij commit 55fe0768f53ecc6c0a1bbfa3b0c688090cfa0360 Author: Chris Wilson Date: Thu Jul 12 21:20:27 2018 +0100 drm/i915/guc: Protect against NULL client dereference in error path After aborting a module load, we may try and disable guc before we have finished setting it. Long term plan is to ensure perfect onion unwind, but in the short term we want to fix the oops to re-enable drv_module_reload. [ 317.401239] BUG: unable to handle kernel NULL pointer dereference at 0000000000000030 [ 317.401279] Oops: 0000 [#1] PREEMPT SMP PTI [ 317.401294] CPU: 5 PID: 4275 Comm: drv_module_relo Tainted: G U 4.18.0-rc4-CI-CI_DRM_4476+ #1 [ 317.401317] Hardware name: System manufacturer System Product Name/Z170M-PLUS, BIOS 3610 03/29/2018 [ 317.401440] RIP: 0010:unreserve_doorbell+0x0/0x80 [i915] [ 317.401454] Code: bb e0 48 8b 35 21 4d 18 00 49 c7 c0 a8 e5 62 a0 b9 cc 00 00 00 48 c7 c2 d8 41 5f a0 48 c7 c7 c9 f6 53 a0 e8 a2 3d c2 e0 0f 0b <0f> b7 47 30 66 3d 00 01 74 20 48 8b 57 18 48 0f a3 82 40 05 00 00 [ 317.401602] RSP: 0018:ffffc900003d3da0 EFLAGS: 00010246 [ 317.401619] RAX: ffffffff8223b300 RBX: 0000000000000000 RCX: 0000000000000000 [ 317.401636] RDX: 0000001fffffffc0 RSI: ffff880219f115f0 RDI: 0000000000000000 [ 317.401654] RBP: ffff880219f11838 R08: 0000000000000000 R09: 0000000000000000 [ 317.401671] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880219f11300 [ 317.401689] R13: ffff880219f17770 R14: ffff88022c1daef8 R15: ffffffffa06ae950 [ 317.401707] FS: 00007febf77a9980(0000) GS:ffff880236d40000(0000) knlGS:0000000000000000 [ 317.401727] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 317.401743] CR2: 0000000000000030 CR3: 0000000222072003 CR4: 00000000003606e0 [ 317.401761] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 317.401779] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 317.401796] Call Trace: [ 317.401894] guc_client_free+0x9/0x130 [i915] [ 317.401993] intel_guc_submission_fini+0x50/0x90 [i915] [ 317.402092] intel_uc_fini+0x34/0xd0 [i915] [ 317.402179] i915_gem_fini+0x5c/0x100 [i915] [ 317.402249] i915_driver_unload+0xd2/0x110 [i915] [ 317.402321] i915_pci_remove+0x10/0x20 [i915] [ 317.402341] pci_device_remove+0x36/0xb0 [ 317.402357] device_release_driver_internal+0x185/0x250 [ 317.402374] driver_detach+0x35/0x70 [ 317.402390] bus_remove_driver+0x53/0xd0 [ 317.402404] pci_unregister_driver+0x25/0xa0 [ 317.402423] __se_sys_delete_module+0x162/0x210 [ 317.402439] ? do_syscall_64+0xd/0x190 [ 317.402454] do_syscall_64+0x55/0x190 [ 317.402470] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 317.402485] RIP: 0033:0x7febf6e5d1b7 [ 317.402496] Code: 73 01 c3 48 8b 0d d1 8c 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 8c 2c 00 f7 d8 64 89 01 48 [ 317.402646] RSP: 002b:00007fffb5e72798 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0 [ 317.402667] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007febf6e5d1b7 [ 317.402686] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 0000562da1addd98 [ 317.402703] RBP: 0000562da1addd30 R08: 0000562da1addd9c R09: 00007fffb5e727d8 [ 317.402721] R10: 00007fffb5e71794 R11: 0000000000000206 R12: 0000562da0ff6470 Testcase: igt/drv_module_reload/basic-reload-inject Signed-off-by: Chris Wilson Cc: Michał Winiarski Cc: Michal Wajdeczko Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180712202027.19801-1-chris@chris-wilson.co.uk commit afdad61615cc37fef91bc70af7ee5b293785fbd6 Author: Claudio Imbrenda Date: Mon Apr 30 18:33:25 2018 +0200 KVM: s390: Fix storage attributes migration with memory slots This is a fix for several issues that were found in the original code for storage attributes migration. Now no bitmap is allocated to keep track of dirty storage attributes; the extra bits of the per-memslot bitmap that are always present anyway are now used for this purpose. The code has also been refactored a little to improve readability. Fixes: 190df4a212a ("KVM: s390: CMMA tracking, ESSA emulation, migration mode") Fixes: 4036e3874a1 ("KVM: s390: ioctls to get and set guest storage attributes") Acked-by: Janosch Frank Signed-off-by: Claudio Imbrenda Message-Id: <1525106005-13931-3-git-send-email-imbrenda@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger commit 03133347b4452ef9b1f1456b92f5fafa467c0655 Author: Claudio Imbrenda Date: Mon Apr 30 18:33:24 2018 +0200 KVM: s390: a utility function for migration Introduce a utility function that will be used later on for storage attributes migration, and use it in kvm_main.c to replace existing code that does the same thing. Signed-off-by: Claudio Imbrenda Message-Id: <1525106005-13931-2-git-send-email-imbrenda@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger commit 0230cae75df62de5813a4ca39a425ba439d036da Author: Janosch Frank Date: Wed Jul 4 15:50:01 2018 +0100 KVM: s390: Replace clear_user with kvm_clear_guest kvm_clear_guest also does the dirty tracking for us, which we want to have. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger commit cd70de2d356ee692477276bd5d6bc88c71a48733 Author: Neil Armstrong Date: Wed Jul 4 17:08:21 2018 +0200 media: platform: Add ChromeOS EC CEC driver The ChromeOS Embedded Controller can expose a CEC bus, this patch add the driver for such feature of the Embedded Controller. This driver is part of the cros-ec MFD and will be add as a sub-device when the feature bit is exposed by the EC. The controller will only handle a single logical address and handles all the messages retries and will only expose Success or Error. The controller will be tied to the HDMI CEC notifier by using the platform DMI Data and the i915 device name and connector name. Signed-off-by: Neil Armstrong Reviewed-by: Enric Balletbo i Serra Reviewed-by: Hans Verkuil Signed-off-by: Lee Jones commit 03a5755c811dfde75a41f62b56da9042c5957993 Author: Neil Armstrong Date: Wed Jul 4 17:08:20 2018 +0200 mfd: cros_ec_dev: Add CEC sub-device registration The EC can expose a CEC bus, thus add the cros-ec-cec MFD sub-device when the CEC feature bit is present. Signed-off-by: Neil Armstrong Reviewed-by: Enric Balletbo i Serra Acked-by: Hans Verkuil Signed-off-by: Lee Jones commit f47674e5263dfe0f89a640fc8b7dc54f9b79d5db Author: Neil Armstrong Date: Wed Jul 4 17:08:19 2018 +0200 mfd: cros-ec: Introduce CEC commands and events definitions. The EC can expose a CEC bus, this patch adds the CEC related definitions needed by the cros-ec-cec driver. Signed-off-by: Neil Armstrong Tested-by: Enric Balletbo i Serra Reviewed-by: Hans Verkuil Signed-off-by: Lee Jones commit 57e94c8b974db2d83c60e1139c89a70806abbea0 Author: Neil Armstrong Date: Wed Jul 4 17:08:18 2018 +0200 mfd: cros-ec: Increase maximum mkbp event size Having a 16 byte mkbp event size makes it possible to send CEC messages from the EC to the AP directly inside the mkbp event instead of first doing a notification and then a read. Signed-off-by: Stefan Adolfsson Signed-off-by: Neil Armstrong Tested-by: Enric Balletbo i Serra Acked-by: Hans Verkuil Signed-off-by: Lee Jones commit 9c229127aee2d7e80858b5d52a9a7049355b621c Author: Neil Armstrong Date: Wed Jul 4 17:08:17 2018 +0200 drm/i915: hdmi: add CEC notifier to intel_hdmi This patchs adds the cec_notifier feature to the intel_hdmi part of the i915 DRM driver. It uses the HDMI DRM connector name to differentiate between each HDMI ports. The changes will allow the i915 HDMI code to notify EDID and HPD changes to an eventual CEC adapter. Signed-off-by: Neil Armstrong Reviewed-by: Hans Verkuil Reviewed-by: Ville Syrjälä Acked-by: Rodrigo Vivi Signed-off-by: Lee Jones commit 7a78c1e116d2a786fcd541c8828472d462c8821f Author: Neil Armstrong Date: Wed Jul 4 17:08:16 2018 +0200 media: cec-notifier: Get notifier by device and connector name In non device-tree world, we can need to get the notifier by the driver name directly and eventually defer probe if not yet created. This patch adds a variant of the get function by using the device name instead and will not create a notifier if not yet created. But the i915 driver exposes at least 2 HDMI connectors, this patch also adds the possibility to add a connector name tied to the notifier device to form a tuple and associate different CEC controllers for each HDMI connectors. Signed-off-by: Neil Armstrong Reviewed-by: Hans Verkuil Signed-off-by: Lee Jones commit 858c5dfc8c336ca26b8d4d9f639a9dc40c5daa80 Author: Gustavo A. R. Silva Date: Mon Jul 9 16:51:56 2018 -0500 backlight: adp8860: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Acked-by: Michael Hennerich Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones commit 7a9a5df0a54e4b2a36a7984800d0a064b39fb3f8 Author: Arnd Bergmann Date: Tue Jul 10 17:18:47 2018 +0200 gpio: mt7621: add OF_GPIO dependency Compile-testing the driver fails unless OF_GPIO is enabled: drivers/gpio/gpio-mt7621.c: In function 'mediatek_gpio_bank_probe': drivers/gpio/gpio-mt7621.c:228:10: error: 'struct gpio_chip' has no member named 'of_node' Fixes: 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621") Signed-off-by: Arnd Bergmann Signed-off-by: Linus Walleij commit 9dcc7570b06836a9aa497bb921ff73c6b319d94c Author: Dong Jia Shi Date: Fri Jul 6 08:35:24 2018 +0200 MAINTAINERS: Remove myself as maintainer I am leaving IBM and will move on to other working area, so remove myself as a vfio-ccw maintainer. Signed-off-by: Dong Jia Shi Message-Id: <20180706015743.41810-1-bjsdjshi@linux.ibm.com> Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky commit c29677312d2532f7a7d49623539e435df6d64d22 Author: Arnd Bergmann Date: Mon Jul 9 16:56:03 2018 +0200 gpio: aspeed: fix compile testing warning Gcc cannot always see that BUG_ON(1) is guaranteed to not return, so we get a warning message in some configurations: drivers/gpio/gpio-aspeed.c: In function 'bank_reg': drivers/gpio/gpio-aspeed.c:244:1: error: control reaches end of non-void function [-Werror=return-type] Using a plain BUG() is easier here and avoids the problem. Fixes: 44ddf559d579 ("gpio: aspeed: Rework register type accessors") Signed-off-by: Arnd Bergmann Acked-by: Benjamin Herrenschmidt Signed-off-by: Linus Walleij commit 809567905b5f10f73828b3fab3024bfaaf967f32 Author: Andy Shevchenko Date: Mon Jul 9 21:47:21 2018 +0300 gpiolib: Consistent use of ->get_direction() inside gpiolib Two out of three calls to ->get_direction (excluding, of course, gpiod_get_direction() itself) are using gpiod_get_direction() and one is still open coded. Replace the latter one to use same API for sake of consistency. Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit b23ec59926faf05b0c43680d05671c484e810ac4 Author: Andy Shevchenko Date: Mon Jul 9 21:47:27 2018 +0300 gpiolib: Mark gpio_suffixes array with __maybe_unused Since we put static variable to a header file it's copied to each module that includes the header. But not all of them are actually used it. Mark gpio_suffixes array with __maybe_unused to hide a compiler warning: In file included from drivers/gpio/gpiolib-legacy.c:6:0: drivers/gpio/gpiolib.h:95:27: warning: ‘gpio_suffixes’ defined but not used [-Wunused-const-variable=] static const char * const gpio_suffixes[] = { "gpios", "gpio" }; ^~~~~~~~~~~~~ In file included from drivers/gpio/gpiolib-devprop.c:17:0: drivers/gpio/gpiolib.h:95:27: warning: ‘gpio_suffixes’ defined but not used [-Wunused-const-variable=] static const char * const gpio_suffixes[] = { "gpios", "gpio" }; ^~~~~~~~~~~~~ Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit f7cf1a1829f9ff776fb5504c9c5ffa0e9d2baf79 Author: Rodrigo Vivi Date: Thu Jul 12 23:54:26 2018 -0700 drm/i915: Update DRIVER_DATE to 20180712 Signed-off-by: Rodrigo Vivi commit 9306b62b43c460923ba4a32b66aeb7d0e4c02adf Author: Rodrigo Vivi Date: Wed Jul 11 22:27:15 2018 -0700 drm/i915/psr: Remove few mod parameters option. Reduce the module parameter to enable or disable. The link stand by vs full link off was used only once. And it was actually masking another bug fixed by commit '84bb2916a683 ("drm/i915/psr: Check for SET_POWER_CAPABLE bit at PSR init time.")' So, let's remove these options for now. End goal is to fully remove the mod param, moving it to a debugfs interface in upcoming patches. Cc: Dhinakaran Pandiyan Cc: Tarun Vyas Signed-off-by: Rodrigo Vivi Reviewed-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180712052715.8177-1-rodrigo.vivi@intel.com commit 521715f903783e324b0067c521baf4f9776d7561 Author: Rodrigo Vivi Date: Wed Jul 11 15:00:50 2018 -0700 drm/i915/psr: Remove useless function calls. PSR is no longer supported on VLV/CHV so this is just dead code. Cc: Dhinakaran Pandiyan Signed-off-by: Rodrigo Vivi Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20180711220050.21809-1-rodrigo.vivi@intel.com commit 75aa3209c945fc711163ff1ecbc031bd13962a9d Author: Douglas Gilbert Date: Thu Jul 12 13:35:42 2018 -0400 scsi: scsi_debug: skip long delays when ndelay small A test program's runtime became impractically long since any non zero ndelay (e.g. 1 nanosec) caused Start Stop Unit to delay over 8 magnitudes greater than other commands. This patch skips long delays (on Start Stop Unit and Synchronize Cache) if ndelay is less than or equal to 10 microsecs. Signed-off-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit 920447f138917d8d5b830b752cff5e5f747f67e8 Author: Arnd Bergmann Date: Wed Jul 11 14:37:37 2018 +0200 scsi: snic: fix printing time intervals We don't want to use 'struct timespec' because of the y2038 overflow problem. The overflow is not actually an issue here, but it's easy to replace with 'timespec64' for consistency. However, it's worth pointing out that nanosecond values have nine digits, not eight or ten, so I'm fixing the format strings accordingly as well. Signed-off-by: Arnd Bergmann Signed-off-by: Martin K. Petersen commit 0993ed922a3e62a66fcad41633985b127ecf71b0 Author: Hannes Reinecke Date: Wed Jul 11 10:09:30 2018 +0200 scsi: fcoe: hold disc_mutex when traversing rport lists When calling either fc_rport_logon() or fc_rport_logoff() during rport list traversal we cannot use the RCU list traversal, as either of these functions will be taking a mutex. So we need to partially revert commit a407c593398c to take the disc mutex during traversal. We should, however, continue to use krefs to ensure that the rport object will not be freed from under us. Fixes: a407c593398c ("scsi: libfc: Fixup disc_mutex handling") Signed-off-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit bbc0f8bd88abefb0f27998f40a073634a3a2db89 Author: Hannes Reinecke Date: Wed Jul 11 10:09:29 2018 +0200 scsi: libfc: Add WARN_ON() when deleting rports The discovery rport list handling is quite odd; the list traversal is independent from the lifetime of the rport itself. This makes auditing quite tricky, and the chance remains that we've missed something. So this patch adds a WARN_ON() statement when freeing an rport which is still part of a list. Signed-off-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit bc3d12b75491c0e844a8a7ce05e84de8f7d94822 Author: Hannes Reinecke Date: Wed Jul 11 10:09:28 2018 +0200 scsi: libfc: hold disc_mutex in fc_disc_stop_rports() fc_disc_stop_rports() is calling fc_rport_logoff(), which in turn is acquiring the rport mutex. So we cannot use RCU list traversal here, but rather need to hold the disc mutex to avoid list corruption while traversing. Fixes: a407c593398c ("scsi: libfc: Fixup disc_mutex handling") Signed-off-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 9a26653b9525c08bc3d0a2c5c65721e4de3a5f6d Author: Hannes Reinecke Date: Wed Jul 11 10:09:27 2018 +0200 scsi: libfc: fixup lockdep annotations fc_rport_recv_plogi_req() needs the lport mutex to be held; the rport mutex will be acquired in the function itself. Fixes: ee35624e1e4e ("scsi: libfc: Add lockdep annotations") Reported-by: Stephen Rothwell Signed-off-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit b15c9fd8bb38cc9a50d9b0a953c866c6091be08b Author: Chaitra P B Date: Fri Jun 29 10:58:10 2018 -0400 scsi: mpt3sas: Fix for regression caused by sparse cleanups Commit cf6bf9710cab ("scsi: mpt3sas: Bug fix for big endian systems") was merged to address sparse warnings. However, the patch introduced a regression on big endian since the code accidentally mixed I/O memory accessors, which do endian swaps, and regular CPU loads and stores. Do a partial revert of the offending commit. [mkp: replaced commit message] Signed-off-by: Chaitra P B Signed-off-by: Martin K. Petersen commit cb12ba356ce2a00cafd9e3f0c14d96fa9471ca44 Author: Ching Huang Date: Mon Jul 9 18:28:02 2018 +0800 scsi: arcmsr: Update driver version to v1.40.00.09-20180709 Update driver version to v1.40.00.09-20180709 Signed-off-by: Ching Huang Signed-off-by: Martin K. Petersen commit 97fe222524f8fdbcc528b44d160d1df71d96af86 Author: Ching Huang Date: Mon Jul 9 18:24:53 2018 +0800 scsi: arcmsr: Fix error of resuming from hibernation for adapter type E Fix error of resuming from hibernation for adapter type E. Signed-off-by: Ching Huang Signed-off-by: Martin K. Petersen commit 5b7b30864d1d18605e9ad81f2cd1eee6927399df Author: Dhinakaran Pandiyan Date: Wed Jul 4 17:31:21 2018 -0700 drm/i915/psr: Split sink status into a separate debugfs node This allows to read i915_edp_psr_status from tests without triggering any AUX communication. Take this opportunity to move this under the eDP-1 connector directory as the status we print is of the sink. Cc: Rodrigo Vivi Cc: José Roberto de Souza Suggested-by: Rodrigo Vivi Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180705003121.2478-1-dhinakaran.pandiyan@intel.com commit c3d433617d2048f5fc3ee1135bce1a9bc2375662 Author: Tarun Vyas Date: Wed Jul 11 22:33:23 2018 -0700 drm/i915: Use crtc_state->has_psr instead of CAN_PSR for pipe update In commit "drm/i915: Wait for PSR exit before checking for vblank evasion", the idea was to limit the PSR IDLE checks when PSR is actually supported. While CAN_PSR does do that check, it doesn't applies on a per-crtc basis. crtc_state->has_psr is a more granular check that only applies to pipe(s) that have PSR enabled. Without the has_psr check, we end up waiting on the eDP transcoder's PSR_STATUS register irrespective of whether the pipe being updated is driving it or not. v2: Remove unnecessary parantheses, make checkpatch happy. v3: Move the has_psr check to intel_psr_wait_for_idle and commit message changes (DK). v4: Derive dev_priv from intel_crtc_state (DK) v5: Commit message changes to reflect the HW behavior (DK) Fixes: a608987970b9 ("drm/i915: Wait for PSR exit before checking for vblank evasion") Reviewed-by: Dhinakaran Pandiyan Signed-off-by: Tarun Vyas Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180712053323.26266-1-tarun.vyas@intel.com commit 430ac34de9693bfe4bea0bab830e0ca0be9ef4b9 Author: Linus Walleij Date: Wed Jul 11 21:32:45 2018 +0200 net: gemini: Indicate that we can handle jumboframes The hardware supposedly handles frames up to 10236 bytes and implements .ndo_change_mtu() so accept 10236 minus the ethernet header for a VLAN tagged frame on the netdevices. Use ETH_MIN_MTU as minimum MTU. Signed-off-by: Linus Walleij Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 06d51513129495fba9bb68ef7aa8cc5ca60e0556 Author: Linus Walleij Date: Wed Jul 11 21:32:44 2018 +0200 net: gemini: Move main init to port The initialization sequence for the ethernet, setting up interrupt routing and such things, need to be done after both the ports are clocked and reset. Before this the config will not "take". Move the initialization to the port probe function and keep track of init status in the state. Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 60cc7767b901dd1e3f70755c3d2505556ba487c2 Author: Linus Walleij Date: Wed Jul 11 21:32:43 2018 +0200 net: gemini: Allow multiple ports to instantiate The code was not tested with two ports actually in use at the same time. (I blame this on lack of actual hardware using that feature.) Now after locating a system using both ports, add necessary fix to make both ports come up. Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 9ab5c929e641c68ab3ade762b330e22e29c51f13 Author: Linus Walleij Date: Wed Jul 11 21:32:42 2018 +0200 net: gemini: Improve connection prints Switch over to using a module parameter and debug prints that can be controlled by this or ethtool like everyone else. Depromote all other prints to debug messages. The phy_print_status() was already in place, albeit never really used because the debuglevel hiding it had to be set up using ethtool. Signed-off-by: Linus Walleij Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit cedca4180127e097e4823018e748b1635c0667f0 Author: Linus Walleij Date: Wed Jul 11 21:32:41 2018 +0200 net: gemini: Look up L3 maxlen from table The code to calculate the hardware register enumerator for the maximum L3 length isn't entirely simple to read. Use the existing defines and rewrite the function into a table look-up. Acked-by: Michał Mirosław Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 750c721ee04fc18e8b66a6a8711c09a33cd76c58 Merge: 23c9ef2b6ebd 3c641ba4a852 Author: David S. Miller Date: Thu Jul 12 17:37:14 2018 -0700 Merge branch 'devlink-Add-support-for-region-access' Alex Vesker says: ==================== devlink: Add support for region access This is a proposal which will allow access to driver defined address regions using devlink. Each device can create its supported address regions and register them. A device which exposes a region will allow access to it using devlink. The suggested implementation will allow exposing regions to the user, reading and dumping snapshots taken from different regions. A snapshot represents a memory image of a region taken by the driver. If a device collects a snapshot of an address region it can be later exposed using devlink region read or dump commands. This functionality allows for future analyses on the snapshots to be done. The major benefit of this support is not only to provide access to internal address regions which were inaccessible to the user but also to provide an additional way to debug complex error states using the region snapshots. Implemented commands: $ devlink region help $ devlink region show [ DEV/REGION ] $ devlink region del DEV/REGION snapshot SNAPSHOT_ID $ devlink region dump DEV/REGION [ snapshot SNAPSHOT_ID ] $ devlink region read DEV/REGION [ snapshot SNAPSHOT_ID ] address ADDRESS length length Show all of the exposed regions with region sizes: $ devlink region show pci/0000:00:05.0/cr-space: size 1048576 snapshot [1 2] pci/0000:00:05.0/fw-health: size 64 snapshot [1 2] Delete a snapshot using: $ devlink region del pci/0000:00:05.0/cr-space snapshot 1 Dump a snapshot: $ devlink region dump pci/0000:00:05.0/fw-health snapshot 1 0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30 0000000000000010 0000 0000 ffff ff04 0029 8c00 0028 8cc8 0000000000000020 0016 0bb8 0016 1720 0000 0000 c00f 3ffc 0000000000000030 bada cce5 bada cce5 bada cce5 bada cce5 Read a specific part of a snapshot: $ devlink region read pci/0000:00:05.0/fw-health snapshot 1 address 0 length 16 0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30 For more information you can check devlink-region.8 man page Future: There is a plan to extend the support to include a write command as well as performing read and dump live region v1->v2: -Add a parameter to enable devlink region snapshot -Allocate snapshot memory using kvmalloc -Introduce destructor function devlink_snapshot_data_dest_t to avoid double allocation v2->v3: -Fix incorrect comment in devlink.h for DEVLINK_ATTR_REGION_SIZE from u32 to u64 ==================== Signed-off-by: David S. Miller commit 3c641ba4a852cf4e90e3d7f29c5df08e24213c5d Author: Alex Vesker Date: Thu Jul 12 15:13:18 2018 +0300 net/mlx4_core: Use devlink region_snapshot parameter This parameter enables capturing region snapshot of the crspace during critical errors. The default value of this parameter is disabled, it can be enabled using devlink param commands. It is possible to configure during runtime and also driver init. Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Reviewed-by: Moshe Shemesh Signed-off-by: David S. Miller commit f6a69885f2e38be0229ab9f6a2d9d4a1b4ba2be5 Author: Alex Vesker Date: Thu Jul 12 15:13:17 2018 +0300 devlink: Add generic parameters region_snapshot region_snapshot - When set enables capturing region snapshots Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Reviewed-by: Moshe Shemesh Signed-off-by: David S. Miller commit bedc989b0c98285b277ff8a08ff9514e580913f4 Author: Alex Vesker Date: Thu Jul 12 15:13:16 2018 +0300 net/mlx4_core: Add Crdump FW snapshot support Crdump allows the driver to create a snapshot of the FW PCI crspace and health buffer during a critical FW issue. In case of a FW command timeout, FW getting stuck or a non zero value on the catastrophic buffer, a snapshot will be taken. The snapshot is exposed using devlink, cr-space, fw-health address regions are registered on init and snapshots are attached once a new snapshot is collected by the driver. Signed-off-by: Alex Vesker Signed-off-by: Tariq Toukan Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 523f9eb1ef25aab4aaf9aeb5356160e8039411ef Author: Alex Vesker Date: Thu Jul 12 15:13:15 2018 +0300 net/mlx4_core: Add health buffer address capability Health buffer address is a 32 bit PCI address offset provided by the FW. This offset is used for reading FW health debug data located on the shared CR space. Cr space is accessible in both driver and FW and allows for different queries and configurations. Health buffer size is always 64B of readable data followed by a lock which is used to block volatile CR space access. Signed-off-by: Alex Vesker Signed-off-by: Tariq Toukan Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 4e54795a27f56102649f121a34b8445e42f79ccd Author: Alex Vesker Date: Thu Jul 12 15:13:14 2018 +0300 devlink: Add support for region snapshot read command Add support for DEVLINK_CMD_REGION_READ_GET used for both reading and dumping region data. Read allows reading from a region specific address for given length. Dump allows reading the full region. If only snapshot ID is provided a snapshot dump will be done. If snapshot ID, Address and Length are provided a snapshot read will done. This is used for both snapshot access and will be used in the same way to access current data on the region. Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 866319bb9437614407ca36f8b16f89ab77a6a831 Author: Alex Vesker Date: Thu Jul 12 15:13:13 2018 +0300 devlink: Add support for region snapshot delete command Add support for DEVLINK_CMD_REGION_DEL used for deleting a snapshot from a region. The snapshot ID is required. Also added notification support for NEW and DEL of snapshots. Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit a006d467fbf1d405e73cd167829d7a9e3df600e3 Author: Alex Vesker Date: Thu Jul 12 15:13:12 2018 +0300 devlink: Extend the support querying for region snapshot IDs Extend the support for DEVLINK_CMD_REGION_GET command to also return the IDs of the snapshot currently present on the region. Each reply will include a nested snapshots attribute that can contain multiple snapshot attributes each with an ID. Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit d8db7ea55f2ff5890ad31137233a3808d80c7f62 Author: Alex Vesker Date: Thu Jul 12 15:13:11 2018 +0300 devlink: Add support for region get command Add support for DEVLINK_CMD_REGION_GET command which is used for querying for the supported DEV/REGION values of devlink devices. The support is both for doit and dumpit. Reply includes: BUS_NAME, DEVICE_NAME, REGION_NAME, REGION_SIZE Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit d7e5272282d93bedbbeb6174b8af8425d7dcfd6f Author: Alex Vesker Date: Thu Jul 12 15:13:10 2018 +0300 devlink: Add support for creating region snapshots Each device address region can store multiple snapshots, each snapshot is identified using a different numerical ID. This ID is used when deleting a snapshot or showing an address region specific snapshot. This patch exposes a callback to add a new snapshot to an address region. The snapshot will be deleted using the destructor function when destroying a region or when a snapshot delete command from devlink user tool. Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit ccadfa444b34c6ec7bb458eee17fdd8c9a456c63 Author: Alex Vesker Date: Thu Jul 12 15:13:09 2018 +0300 devlink: Add callback to query for snapshot id before snapshot create To restrict the driver with the snapshot ID selection a new callback is introduced for the driver to get the snapshot ID before creating a new snapshot. This will also allow giving the same ID for multiple snapshots taken of different regions on the same time. Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit b16ebe925a4400a2ec3dc663c81dce2fd9bf0998 Author: Alex Vesker Date: Thu Jul 12 15:13:08 2018 +0300 devlink: Add support for creating and destroying regions This allows a device to register its supported address regions. Each address region can be accessed directly for example reading the snapshots taken of this address space. Drivers are not limited in the name selection for different regions. An example of a region-name can be: pci cr-space, register-space. Signed-off-by: Alex Vesker Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 23c9ef2b6ebd3451057fa622d4d14ee63f95f7b1 Merge: 68d2f84a1368 436d4fdb208f Author: David S. Miller Date: Thu Jul 12 17:30:49 2018 -0700 Merge branch 'mvpp2-add-RSS-support' Maxime Chevallier says: ==================== net: mvpp2: add RSS support This series adds support for RSS on PPv2. There already was some code to handle the RSS tables, but the driver was missing all the classification steps required to actually use these tables. RSS is used through the classifier, using at least 2 lookups : - One using the C2 engine, a TCAM engine that match the packet based on some header extracted fields, assigns the default rx queue for that packet and tag it for RSS - One using the C3Hx engine, which computes the hash that's used to perform the lookup in the RSS table. Since RSS spreads the load across CPUs, we need to make sure that packets from the same flow are always assigned the same rx queue, to prevent re-ordering. This series therefore adds a classification step based on the Header Parser, that separate ingress traffic into 52 flows, based on some L2, L3 and L4 parameters. Patches 1 and 2 fix some header issues, from the driver splitting Patches 3 to 7 make sure the correct receive queue setup is used for RSS Patches 8 to 14 deal with the way we handle the RSS tables Patch 15 implement basic classifier configuration, by using it to assign the default receive queue Patch 16 implement the ingress traffic splitting into multiple flows Patch 17 adds RSS support, by using the needed classification steps Patch 18 adds the required ethtool ops to configure the flow hash parameters This was tested on MacchiatoBin, giving some nice performance improvements using ip forwarding (going from 5Gbps to 9.6Gbps total throughput). RSS is disabled by default. ==================== Signed-off-by: David S. Miller commit 436d4fdb208f25e17da854bcf58aab5716a483f1 Author: Maxime Chevallier Date: Thu Jul 12 13:54:27 2018 +0200 net: mvpp2: allow setting RSS flow hash parameters with ethtool This commit allows setting the RSS hash generation parameters from ethtool. When setting parameters for a given flow type from ethtool (e.g. tcp4), all the corresponding flows in the flow table are updated, according to the supported hash parameters. For example, when configuring TCP over IPv4 hash parameters to be src/dst IP + src/dst port ("ethtool -N eth0 rx-flow-hash tcp4 sdfn"), we only set the "src/dst port" hash parameters on the non-fragmented TCP over IPv4 flows. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit d33ec452500798868c430c5e2e4b5e8399ae70e3 Author: Maxime Chevallier Date: Thu Jul 12 13:54:26 2018 +0200 net: mvpp2: add an RSS classification step for each flow One of the classification action that can be performed is to compute a hash of the packet header based on some header fields, and lookup a RSS table based on this hash to determine the final RxQ. This is done by adding one lookup entry per flow per port, so that we can configure the hash generation parameters for each flow and each port. There are 2 possible engines that can be used for RSS hash generation : - C3HA, that generates a hash based on up to 4 header-extracted fields - C3HB, that does the same as c3HA, but also includes L4 info in the hash There are a lot of fields that can be extracted from the header. For now, we only use the ones that we can configure using ethtool : - DST MAC address - L3 info - Source IP - Destination IP - Source port - Destination port The C3HB engine is selected when we use L4 fields (src/dst port). Header parser Dec table Ingress pkt +-------------+ flow id +----------------------------+ ------------->| TCAM + SRAM |-------->|TCP IPv4 w/ VLAN, not frag | +-------------+ |TCP IPv4 w/o VLAN, not frag | |TCP IPv4 w/ VLAN, frag |--+ |etc. | | +----------------------------+ | | Flow table | +---------+ +------------+ +--------------------------+ | | RSS tbl |<--| Classifier |<--------| flow 0: C2 lookup | | +---------+ +------------+ | C3 lookup port 0 | | | | | C3 lookup port 1 | | +-----------+ +-------------+ | ... | | | C2 engine | | C3H engines | | flow 1: C2 lookup |<--+ +-----------+ +-------------+ | C3 lookup port 0 | | ... | | ... | | flow 51 : C2 lookup | | ... | +--------------------------+ The C2 engine also gains the role of enabling and disabling the RSS table lookup for this packet. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit f9358e12a0af53d107df09d4c0254425b6a10468 Author: Maxime Chevallier Date: Thu Jul 12 13:54:25 2018 +0200 net: mvpp2: split ingress traffic into multiple flows The PPv2 classifier allows to perform classification operations on each ingress packet, based on the flow the packet is assigned to. The current code uses only 1 flow per port, and the only classification action consists of assigning the rx queue to the packet, depending on the port. In preparation for adding RSS support, we have to split all incoming traffic into different flows. Since RSS assigns a rx queue depending on the hash of some header fields, we have to make sure that the hash is generated in a consistent way for all packets in the same flow. What we call a "flow" is actually a set of attributes attached to a packet that depends on various L2/L3/L4 info. This patch introduces 52 flows, wich are a combination of various L2, L3 and L4 attributes : - Whether or not the packet has a VLAN tag - Whether the packet is IPv4, IPv6 or something else - Whether the packet is TCP, UDP or something else - Whether or not the packet is fragmented at L3 level. The flow is associated to a packet by the Header Parser. Each flow corresponds to an entry in the decoding table. This entry then points to the sequence of classification lookups to be performed by the classifier, represented in the flow table. For now, the only lookup we perform is a C2 lookup to set the default rx queue. Header parser Dec table Ingress pkt +-------------+ flow id +----------------------------+ ------------->| TCAM + SRAM |-------->|TCP IPv4 w/ VLAN, not frag | +-------------+ |TCP IPv4 w/o VLAN, not frag | |TCP IPv4 w/ VLAN, frag |--+ |etc. | | +----------------------------+ | | Flow table | +------------+ +---------------------+ | To RxQ <---| Classifier |<-------| flow 0: C2 lookup |<--------+ +------------+ | flow 1: C2 lookup | | | ... | +------------+ | flow 51 : C2 lookup | | C2 engine | +---------------------+ +------------+ Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit b1a962c62c80da77751a296e27c944c9bae6c6f0 Author: Maxime Chevallier Date: Thu Jul 12 13:54:24 2018 +0200 net: mvpp2: use classifier to assign default rx queue The PPv2 Controller has a classifier, that can perform multiple lookup operations for each packet, using different engines. One of these engines is the C2 engine, which performs TCAM based lookups on data extracted from the packet header. When a packet matches an entry, the engine sets various attributes, used to perform classification operations. One of these attributes is the rx queue in which the packet should be sent. The current code uses the lookup_id table (also called decoding table) to assign the rx queue. However, this only works if we use one entry per port in the decoding table, which won't be the case once we add RSS lookups. This patch uses the C2 engine to assign the rx queue to each packet. The C2 engine is used through the flow table, which dictates what classification operations are done for a given flow. Right now, we have one flow per port, which contains every ingress packet for this port. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit e6e21c024272302ea4f0e397f044e2323035342f Author: Maxime Chevallier Date: Thu Jul 12 13:54:23 2018 +0200 net: mvpp2: rename per-port RSS init function mvpp22_init_rss function configures the RSS parameters for each port, so rename it accordingly. Since this function relies on classifier configuration, move its call right after the classifier config. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 2a2f467daf96f519f9d2ec69e133ad1365d3e8ff Author: Maxime Chevallier Date: Thu Jul 12 13:54:22 2018 +0200 net: mvpp2: make sure we don't spread load on disabled CPUs When filling the RSS table, we have to make sure that the rx queue is attached to an online CPU. This patch is not a full support for cpu_hotplug, but rather a way to make sure that we don't break network on system booted with the maxcpus parameter. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 662ae3fe65000a6b7ceeed1ecf510346d8fec447 Author: Antoine Tenart Date: Thu Jul 12 13:54:21 2018 +0200 net: mvpp2: improve the distribution of packets on CPUs when using RSS This patch adds an extra indirection when setting the indirection table into the RSS hardware table to improve the packets distribution across CPUs. For example, if 2 queues are used on a multi-core system this new indirection will choose two queues on two different CPUs instead of the two first queues which are on the same first CPU. Signed-off-by: Antoine Tenart Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 8179642b52d945852c0cd9f1372e70b09ed153b7 Author: Antoine Tenart Date: Thu Jul 12 13:54:20 2018 +0200 net: mvpp2: RSS indirection table support This patch adds the RSS indirection table support, allowing to use the ethtool -x and -X options to dump and set this table. Signed-off-by: Antoine Tenart [Maxime: Small warning fixes, use one table per port] Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit a27a254c264293b8ab0fe34169c654047393d370 Author: Maxime Chevallier Date: Thu Jul 12 13:54:19 2018 +0200 net: mvpp2: use one RSS table per port PPv2 Controller has 8 RSS Tables, of 32 entries each. A lookup in the RXQ2RSS_TABLE is performed for each incoming packet, and the RSS Table to be used is chosen according to the default rx queue that would be used for the packet. This default rx queue is set in the Lookup_id Table (also called Decoding Table), and is equal to the port->first_rxq. Since the Classifier itself isn't active at any time for the moment, this doesn't have a direct effect, the default rx queue at the moment is the one where all packets end-up into. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 4b86097be7f651ab931ae6571e27a798fccdbb84 Author: Maxime Chevallier Date: Thu Jul 12 13:54:18 2018 +0200 net: mvpp2: fix RSS register definitions There is no RSS_TABLE register in PPv2 Controller. The register 0x1510 which was specified is actually named "RSS_HASH_SEL", but isn't used by this driver at all. Based on how this register was used, it should have been the RXQ2RSS_TABLE register, which allows to select the RSS table that will be used for the incoming packet. The RSS_TABLE_POINTER is actually a field of this RXQ2RSS_TABLE register. Since RSS tables are actually not used by the driver for now, this commit does not fix a runtime bug. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 132baa0378c5abd07c8ac1f623a19e80d16a48bd Author: Antoine Tenart Date: Thu Jul 12 13:54:17 2018 +0200 net: mvpp2: fix a typo in the RSS code Cosmetic patch fixing a typo in one of the RSS comments. Signed-off-by: Antoine Tenart Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit f8c6ba8424b0fa5e001c23a30099351170f5be0d Author: Maxime Chevallier Date: Thu Jul 12 13:54:16 2018 +0200 net: mvpp2: use only one rx queue per port per CPU The number of receive queue per port is : - MVPP2_DEFAULT_RXQ if in single queue mode - MVPP2_DEFAULT_RXQ * num_possible_cpus if in multi queue mode with MVPP2_DEFAULT_RXQ = 4. However, we don't use the extra rx queues at the moment, we really only need one per port per CPU, until some more advanced classification rules are implemented. Suggested-by: Stefan Chulski Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 790d32c6d35de186154d94d6df2f0c4be33c7c52 Author: Maxime Chevallier Date: Thu Jul 12 13:54:15 2018 +0200 net: mvpp2: fix hardcoded number of rx queues There's a dedicated #define that indicates the number of rx queues per port per cpu, this commit removes a harcoded use of that value This doesn't fix any runtime bugs since the harcoded value matches the expected value. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 4c4a5686c4e7475ab16fdaa4da375e43810da978 Author: Yan Markman Date: Thu Jul 12 13:54:14 2018 +0200 net: mvpp2: use RSS only when using multi-queue mode Since RSS only applies when we have per-cpu rx queues, it should only be enabled when the driver is configured to make use of multi-queue mode. Signed-off-by: Yan Markman [Maxime: Commit message] Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 3f6aaf72895a9a1e1cffc6db29871d6664249752 Author: Maxime Chevallier Date: Thu Jul 12 13:54:13 2018 +0200 net: mvpp2: make multi queue mode the default mode The multi queue mode is needed to have RSS available, and offers some nice advantages, being able to have one rx queue vector per CPU. This mode has been usable through the use of a module parameter, this commit makes it the default value. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 1e27a628e3f444f53ab8099dfb31c5156e38d112 Author: Maxime Chevallier Date: Thu Jul 12 13:54:12 2018 +0200 net: mvpp2: make sure we use single queue mode on PPv2.1 The PPv2 driver defines 2 "queue_modes" : - QDIST_SINGLE_MODE, where each port share one rx queue vector between all CPUs - QDIST_MULTI_MODE, where each port has one rx queue vector per CPU. Multi queue mode isn't available on PPv2.1, make sure we fallback to single mode when running on this revision. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 0ad2f53906f9a21cd72def8e1268e75a366dc7b6 Author: Maxime Chevallier Date: Thu Jul 12 13:54:11 2018 +0200 net: mvpp2: define the number of RSS entries per table in mvpp2.h The size of the the RSS indirection tables should be defined in mvpp2.h, so that we can use it in all files of the PPv2 driver. This commit moves the define in mvpp2.h, and adds the missing #include in mvpp2_cls.h. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 53a40025c07a47eb9377bc243993a53799bd9f3b Author: Maxime Chevallier Date: Thu Jul 12 13:54:10 2018 +0200 net: mvpp2: fix include guards in mvpp2_prs.h Include guards should be put before #includes. This doesn't fix any bug, but prevent future compilation issues when adding new files in the mvpp2 driver The Header Parser init function needs the platform_device definition, and with the fixed include guards we need to add the missing include. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 68d2f84a1368cc5d4ccbbbfc6821f159d27681c9 Author: Prashant Bhole Date: Thu Jul 12 16:24:59 2018 +0900 net: gro: properly remove skb from list Following crash occurs in validate_xmit_skb_list() when same skb is iterated multiple times in the loop and consume_skb() is called. The root cause is calling list_del_init(&skb->list) and not clearing skb->next in d4546c2509b1. list_del_init(&skb->list) sets skb->next to point to skb itself. skb->next needs to be cleared because other parts of network stack uses another kind of SKB lists. validate_xmit_skb_list() uses such list. A similar type of bugfix was reported by Jesper Dangaard Brouer. https://patchwork.ozlabs.org/patch/942541/ This patch clears skb->next and changes list_del_init() to list_del() so that list->prev will maintain the list poison. [ 148.185511] ================================================================== [ 148.187865] BUG: KASAN: use-after-free in validate_xmit_skb_list+0x4b/0xa0 [ 148.190158] Read of size 8 at addr ffff8801e52eefc0 by task swapper/1/0 [ 148.192940] [ 148.193642] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.18.0-rc3+ #25 [ 148.195423] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20180531_142017-buildhw-08.phx2.fedoraproject.org-1.fc28 04/01/2014 [ 148.199129] Call Trace: [ 148.200565] [ 148.201911] dump_stack+0xc6/0x14c [ 148.203572] ? dump_stack_print_info.cold.1+0x2f/0x2f [ 148.205083] ? kmsg_dump_rewind_nolock+0x59/0x59 [ 148.206307] ? validate_xmit_skb+0x2c6/0x560 [ 148.207432] ? debug_show_held_locks+0x30/0x30 [ 148.208571] ? validate_xmit_skb_list+0x4b/0xa0 [ 148.211144] print_address_description+0x6c/0x23c [ 148.212601] ? validate_xmit_skb_list+0x4b/0xa0 [ 148.213782] kasan_report.cold.6+0x241/0x2fd [ 148.214958] validate_xmit_skb_list+0x4b/0xa0 [ 148.216494] sch_direct_xmit+0x1b0/0x680 [ 148.217601] ? dev_watchdog+0x4e0/0x4e0 [ 148.218675] ? do_raw_spin_trylock+0x10/0x120 [ 148.219818] ? do_raw_spin_lock+0xe0/0xe0 [ 148.221032] __dev_queue_xmit+0x1167/0x1810 [ 148.222155] ? sched_clock+0x5/0x10 [...] [ 148.474257] Allocated by task 0: [ 148.475363] kasan_kmalloc+0xbf/0xe0 [ 148.476503] kmem_cache_alloc+0xb4/0x1b0 [ 148.477654] __build_skb+0x91/0x250 [ 148.478677] build_skb+0x67/0x180 [ 148.479657] e1000_clean_rx_irq+0x542/0x8a0 [ 148.480757] e1000_clean+0x652/0xd10 [ 148.481772] net_rx_action+0x4ea/0xc20 [ 148.482808] __do_softirq+0x1f9/0x574 [ 148.483831] [ 148.484575] Freed by task 0: [ 148.485504] __kasan_slab_free+0x12e/0x180 [ 148.486589] kmem_cache_free+0xb4/0x240 [ 148.487634] kfree_skbmem+0xed/0x150 [ 148.488648] consume_skb+0x146/0x250 [ 148.489665] validate_xmit_skb+0x2b7/0x560 [ 148.490754] validate_xmit_skb_list+0x70/0xa0 [ 148.491897] sch_direct_xmit+0x1b0/0x680 [ 148.493949] __dev_queue_xmit+0x1167/0x1810 [ 148.495103] br_dev_queue_push_xmit+0xce/0x250 [ 148.496196] br_forward_finish+0x276/0x280 [ 148.497234] __br_forward+0x44f/0x520 [ 148.498260] br_forward+0x19f/0x1b0 [ 148.499264] br_handle_frame_finish+0x65e/0x980 [ 148.500398] NF_HOOK.constprop.10+0x290/0x2a0 [ 148.501522] br_handle_frame+0x417/0x640 [ 148.502582] __netif_receive_skb_core+0xaac/0x18f0 [ 148.503753] __netif_receive_skb_one_core+0x98/0x120 [ 148.504958] netif_receive_skb_internal+0xe3/0x330 [ 148.506154] napi_gro_complete+0x190/0x2a0 [ 148.507243] dev_gro_receive+0x9f7/0x1100 [ 148.508316] napi_gro_receive+0xcb/0x260 [ 148.509387] e1000_clean_rx_irq+0x2fc/0x8a0 [ 148.510501] e1000_clean+0x652/0xd10 [ 148.511523] net_rx_action+0x4ea/0xc20 [ 148.512566] __do_softirq+0x1f9/0x574 [ 148.513598] [ 148.514346] The buggy address belongs to the object at ffff8801e52eefc0 [ 148.514346] which belongs to the cache skbuff_head_cache of size 232 [ 148.517047] The buggy address is located 0 bytes inside of [ 148.517047] 232-byte region [ffff8801e52eefc0, ffff8801e52ef0a8) [ 148.519549] The buggy address belongs to the page: [ 148.520726] page:ffffea000794bb00 count:1 mapcount:0 mapping:ffff880106f4dfc0 index:0xffff8801e52ee840 compound_mapcount: 0 [ 148.524325] flags: 0x17ffffc0008100(slab|head) [ 148.525481] raw: 0017ffffc0008100 ffff880106b938d0 ffff880106b938d0 ffff880106f4dfc0 [ 148.527503] raw: ffff8801e52ee840 0000000000190011 00000001ffffffff 0000000000000000 [ 148.529547] page dumped because: kasan: bad access detected Fixes: d4546c2509b1 ("net: Convert GRO SKB handling to list_head.") Signed-off-by: Prashant Bhole Reported-by: Tyler Hicks Tested-by: Tyler Hicks Signed-off-by: David S. Miller commit c8c81de96be3a5a22c7d92143fb32abfb975e50c Merge: 0761680d5215 fb321f25e582 Author: David S. Miller Date: Thu Jul 12 16:42:40 2018 -0700 Merge branch 's390-qeth-updates' Julian Wiedmann says: ==================== s390/qeth: updates 2018-07-11 please apply this first batch of qeth patches for net-next. It brings the usual cleanups, and some performance improvements to the transmit paths. ==================== Signed-off-by: David S. Miller commit fb321f25e582ae45e6b792fb38a3fc261dc5131e Author: Julian Wiedmann Date: Wed Jul 11 17:42:47 2018 +0200 s390/qeth: speed-up IPv4 OSA xmit Move the xmit of offload-eligible (ie IPv4) traffic on OSA over to the new, copy-free path. As with L2, we'll need to preserve the skb_orphan() behaviour of the old code path until TX completion is sufficiently fast. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit a647a02512ca346bb399d7dc4f57e327f2475286 Author: Julian Wiedmann Date: Wed Jul 11 17:42:46 2018 +0200 s390/qeth: speed-up L3 IQD xmit This implements a new xmit path for L3 HiperSockets, which carves the HW header from skb headroom instead of allocating it from the hdr cache. It also adds NETIF_F_SG support. The delta in qeth_l3_xmit() is all just removal of IQD-specific code and some minor consolidation. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit ea1d4a0c7fa5a7aab823e77c3a9000035a231f77 Author: Julian Wiedmann Date: Wed Jul 11 17:42:45 2018 +0200 s390/qeth: add a L3 xmit wrapper In preparation for future work, move the high-level xmit work into a separate wrapper. This matches the L2 xmit code. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 371a1e7a07a0d1bb272f69ccb3df617f8a049d07 Author: Julian Wiedmann Date: Wed Jul 11 17:42:44 2018 +0200 s390/qeth: increase GSO max size for eligible L3 devices When a L3 device doesn't offer TSO, allow the stack to build full-size GSO skbs. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 09960b3a0a474f420894d88ae2e6f09ee4c60f9c Author: Julian Wiedmann Date: Wed Jul 11 17:42:43 2018 +0200 s390/qeth: clean up exported symbols Remove some redundant EXPORTs. While at it, also move some L2-only prototypes into the proper header file. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 6d8769abe44ad073bd3d08a9dfbcbd567e96e78b Author: Julian Wiedmann Date: Wed Jul 11 17:42:42 2018 +0200 s390/qeth: consolidate ccwgroup driver definition Reshuffle the code a bit so that everything is in one place. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 86c0cdb9e0a5d15f908438bf0491192b35db0869 Author: Julian Wiedmann Date: Wed Jul 11 17:42:41 2018 +0200 s390/qeth: clean up Output Queue selection Consolidate duplicated code, fix the misuse of RTN_UNSPEC and simplify the handling of non-unicast traffic on IQD devices. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 9aa17df3b84bc6df37398f51e8df6ed8e91049d4 Author: Julian Wiedmann Date: Wed Jul 11 17:42:40 2018 +0200 s390/qeth: fine-tune RX modesetting Changing a device's address lists (or its promisc mode) already triggers an RX modeset, there's no need to do it manually from the L2 driver's ndo_vlan_rx_kill_vid() hook. Also when setting a device online, dev_open() already calls dev_set_rx_mode(). So a manual modeset is only necessary from the recovery path. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit f67a43a73b543f686577507fe9ccdfae212b9924 Author: Julian Wiedmann Date: Wed Jul 11 17:42:39 2018 +0200 s390/qeth: remove unused buffer->aob pointer Except for tracing, the pointer is not used. At the same time, accessing it from qeth_qdio_output_handler() is racy: whenever qeth_qdio_cq_handler() gets control, its call to qeth_qdio_handle_aob() frees the AOB. So the AOB pointer that qeth_qdio_output_handler() stores into 'buffer' can go stale at any time, and trigger a use-after-free. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 3b346c18149674ee40dea5281c8644a572ef3fb1 Author: Julian Wiedmann Date: Wed Jul 11 17:42:38 2018 +0200 s390/qeth: various buffer management cleanups Use the new qeth_scrub_qdio_buffer() helper, remove an extra parameter from qeth_clear_output_buffer(), init the bufstates.user field just once (in qeth_flush_buffers()) and remove some noisy trace messages. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 0761680d521559813648fb430ddeb479c97ab060 Author: Jesper Dangaard Brouer Date: Wed Jul 11 17:01:20 2018 +0200 net: ipv4: fix listify ip_rcv_finish in case of forwarding In commit 5fa12739a53d ("net: ipv4: listify ip_rcv_finish") calling dst_input(skb) was split-out. The ip_sublist_rcv_finish() just calls dst_input(skb) in a loop. The problem is that ip_sublist_rcv_finish() forgot to remove the SKB from the list before invoking dst_input(). Further more we need to clear skb->next as other parts of the network stack use another kind of SKB lists for xmit_more (see dev_hard_start_xmit). A crash occurs if e.g. dst_input() invoke ip_forward(), which calls dst_output()/ip_output() that eventually calls __dev_queue_xmit() + sch_direct_xmit(), and a crash occurs in validate_xmit_skb_list(). This patch only fixes the crash, but there is a huge potential for a performance boost if we can pass an SKB-list through to ip_forward. Fixes: 5fa12739a53d ("net: ipv4: listify ip_rcv_finish") Signed-off-by: Jesper Dangaard Brouer Acked-by: Edward Cree Signed-off-by: David S. Miller commit 18952651dae8efcc6d565c97f8fe5629b399cb3e Merge: c7cd161ecb21 bf5b64355a3c Author: Paul E. McKenney Date: Thu Jul 12 15:42:41 2018 -0700 Merge branches 'fixes1.2018.07.12b' and 'torture1.2018.07.12b' into HEAD fixes1.2018.07.12b: Post-gp_seq miscellaneous fixes torture1.2018.07.12b: Post-gp_seq torture-test updates commit bf5b64355a3ce41752856b66c4efad4d7a88e84b Author: Joel Fernandes (Google) Date: Tue Jun 19 15:14:19 2018 -0700 rcutorture: Fix rcu_barrier successes counter The rcutorture test module currently increments both successes and error for the barrier test upon error, which results in misleading statistics being printed. This commit therefore changes the code to increment the success counter only when the test actually passes. This change was tested by by returning from the barrier callback without incrementing the callback counter, thus introducing what appeared to rcutorture to be rcu_barrier() failures. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit 4babd855fd6137f9792117eb73b096c221a49d3c Author: Joel Fernandes (Google) Date: Tue Jun 19 15:14:18 2018 -0700 rcutorture: Add support to detect if boost kthread prio is too low When rcutorture is built in to the kernel, an earlier patch detects that and raises the priority of RCU's kthreads to allow rcutorture's RCU priority boosting tests to succeed. However, if rcutorture is built as a module, those priorities must be raised manually via the rcutree.kthread_prio kernel boot parameter. If this manual step is not taken, rcutorture's RCU priority boosting tests will fail due to kthread starvation. One approach would be to raise the default priority, but that risks breaking existing users. Another approach would be to allow runtime adjustment of RCU's kthread priorities, but that introduces numerous "interesting" race conditions. This patch therefore instead detects too-low priorities, and prints a message and disables the RCU priority boosting tests in that case. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit 622be33fcbc93e9b672b99ed338369eb5e843ac3 Author: Arnd Bergmann Date: Mon Jun 18 16:47:34 2018 +0200 rcutorture: Use monotonic timestamp for stall detection The get_seconds() call is deprecated because it overflows on 32-bit architectures. The algorithm in rcu_torture_stall() can deal with the overflow, but another problem here is that using a CLOCK_REALTIME stamp can lead to a false-positive stall warning when a settimeofday() happens concurrently. Using ktime_get_seconds() instead avoids those issues and will never overflow. The added cast to 'unsigned long' however is necessary to make ULONG_CMP_LT() work correctly. Signed-off-by: Arnd Bergmann Signed-off-by: Paul E. McKenney commit 3b745c8969c752601cb68c82a06735363563ab42 Author: Joel Fernandes (Google) Date: Sun Jun 10 16:45:44 2018 -0700 rcutorture: Make boost test more robust Currently, with RCU_BOOST disabled, I get no failures when forcing rcutorture to test RCU boost priority inversion. The reason seems to be that we don't check for failures if the callback never ran at all for the duration of the boost-test loop. Further, the 'rtb' and 'rtbf' counters seem to be used inconsistently. 'rtb' is incremented at the start of each test and 'rtbf' is incremented per-cpu on each failure of call_rcu. So its possible 'rtbf' > 'rtb'. To test the boost with rcutorture, I did following on a 4-CPU x86 machine: modprobe rcutorture test_boost=2 sleep 20 rmmod rcutorture With patch: rtbf: 8 rtb: 12 Without patch: rtbf: 0 rtb: 2 In summary this patch: - Increments failed and total test counters once per boost-test. - Checks for failure cases correctly. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit 450efca7182a516a12dfcc0311abfd242bde42b2 Author: Joel Fernandes (Google) Date: Sun Jun 10 16:45:43 2018 -0700 rcutorture: Disable RT throttling for boost tests Currently rcutorture is not able to torture RCU boosting properly. This is because the rcutorture's boost threads which are doing the torturing may be throttled due to RT throttling. This patch makes rcutorture use the right torture technique (unthrottled rcutorture boost tasks) for torturing RCU so that the test fails correctly when no boost is available. Currently this requires accessing sysctl_sched_rt_runtime directly, but that should be Ok since rcutorture is test code. Such direct access is also only possible if rcutorture is used as a built-in so make it conditional on that. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit bf1bef50bee13b2292929f4b86118302a3827a32 Author: Paul E. McKenney Date: Sun Jun 10 08:50:09 2018 -0700 rcutorture: Emphasize testing of single reader protection type For RCU implementations supporting multiple types of reader protection, rcutorture currently randomly selects the combinations of types of protection for each phase of each reader. The problem with this, for example, given the four kinds of protection for RCU-sched (local_irq_disable(), local_bh_disable(), preempt_disable(), and rcu_read_lock_sched()), the reader will be protected by a single mechanism only 25% of the time. We really heavier testing of single read-side mechanisms. This commit therefore uses only a single mechanism about 60% of the time, half of the time explicitly and one-eighth of the time by chance. Signed-off-by: Paul E. McKenney commit 2397d072f76b552fc21cda19686d24a8066ced22 Author: Paul E. McKenney Date: Fri May 25 07:29:25 2018 -0700 rcutorture: Handle extended read-side critical sections This commit enables rcutorture to test whether RCU properly aggregates different types of read-side critical sections into a larger section covering the set. It does this by extending an initial read-side critical section randomly for a random number of extensions. There is a new rcu_torture_ops field ->extendable that specifies what extensions are permitted for a given flavor of RCU (for example, SRCU does not permit any extensions, while RCU-sched permits all types). Note that if a given operation (for example, local_bh_disable()) extends an RCU read-side critical section, then rcutorture feels free to also start and end the critical section with that operation's type of disabling. Disabling operations include local_bh_disable(), local_irq_disable(), and preempt_disable(). This commit also adds a new "busted_srcud" torture type, which verifies rcutorture's ability to detect extensions of RCU read-side critical sections that are not handled. Gotta test the test, after all! Note that it is not legal to invoke local_bh_disable() with interrupts disabled, and this transition is avoided by overriding the random-number generator when it wants to call local_bh_disable() while interrupts are disabled. The code instead leaves both interrupts and bh/softirq disabled in this case. Signed-off-by: Paul E. McKenney commit 241b42522abb36c78cdc84d0cade358c4449306f Author: Paul E. McKenney Date: Tue May 22 11:59:31 2018 -0700 rcutorture: Make rcu_torture_timer() use rcu_torture_one_read() This commit saves a few lines of code by making rcu_torture_timer() invoke rcu_torture_one_read(), thus completing the consolidation of code between rcu_torture_timer() and rcu_torture_reader(). Signed-off-by: Paul E. McKenney commit 3025520ec424df8b0fd5cdc319ad6b83406d9954 Author: Paul E. McKenney Date: Tue May 22 11:38:47 2018 -0700 rcutorture: Use per-CPU random state for rcu_torture_timer() Currently, the rcu_torture_timer() function uses a single global torture_random_state structure protected by a single global lock. This conflicts to some extent with performance and scalability, but even more with the goal of consolidating read-side testing with rcu_torture_reader(). This commit therefore creates a per-CPU torture_random_state structure for use by rcu_torture_timer() and eliminates the lock. Signed-off-by: Paul E. McKenney [ paulmck: Make rcu_torture_timer_rand static, per 0day Test Robot report. ] commit 8da9a59523b6608f4b21f3e489578d0993c0779f Author: Paul E. McKenney Date: Tue May 22 11:17:51 2018 -0700 rcutorture: Use atomic increment for n_rcu_torture_timers Currently, rcu_torture_timer() relies on a lock to guard updates to n_rcu_torture_timers. Unfortunately, consolidating code with rcu_torture_reader() will dispense with this lock. This commit therefore makes n_rcu_torture_timers be an atomic_long_t and uses atomic_long_inc() to carry out the update. Signed-off-by: Paul E. McKenney commit 6b06aa723ed705102f3c63a494ac45352ccc0e7c Author: Paul E. McKenney Date: Tue May 22 10:56:05 2018 -0700 rcutorture: Extract common code from rcu_torture_reader() This commit extracts the code executed on each pass through the loop in rcu_torture_reader() into a new rcu_torture_one_read() function. This new function will also be used by rcu_torture_timer(). Signed-off-by: Paul E. McKenney commit 2d3625841dcee549653b6f50ffa4e6431305035a Author: Paul E. McKenney Date: Thu May 17 11:09:47 2018 -0700 rcuperf: Remove unused torturing_tasks() function The torturing_tasks() function in rcuperf.c is not used, so this commit removes it. Signed-off-by: Paul E. McKenney commit 6bea2cc5a97b7e9677088b1a93e27edb74ae0e55 Author: Paul E. McKenney Date: Wed May 16 15:30:36 2018 -0700 rcu: Remove rcutorture test version and sequence number Back when RCU had a debugfs interface, there was a test version and sequence number that allowed associating debugfs data with a particular test run, where the test run started with modprobe and ended with rmmod, which was how tests were run back on the old ABAT system within IBM. But rcutorture testing no longer runs on ABAT, and there is no longer an RCU debugfs interface, so there is no longer any need for test versions and sequence numbers. This commit therefore removes the rcutorture_record_test_transition() and rcutorture_record_progress() functions, and along with them the rcutorture_testseq and rcutorture_vernum variables that they update. Signed-off-by: Paul E. McKenney commit 028be12b294e3a059e6fc06852d458fdc82717ed Author: Paul E. McKenney Date: Tue May 8 09:20:34 2018 -0700 rcutorture: Change units of onoff_interval to jiffies Some RCU bugs have been sensitive to the frequency of CPU-hotplug operations, which have been gradually increased over time. But this frequency is now at the one-second lower limit that can be specified using the rcutorture.onoff_interval kernel parameter. This commit therefore changes the units of rcutorture.onoff_interval from seconds to jiffies, and also sets the value specified for this kernel parameter in the TREE03 rcutorture scenario to 200, which is 200 milliseconds for HZ=1000. Signed-off-by: Paul E. McKenney commit c7cd161ecb2188c07ba9560ca82aee756575359f Author: Joel Fernandes (Google) Date: Tue Jun 19 15:14:17 2018 -0700 rcu: Assign higher prio to RCU threads if rcutorture is built-in The rcutorture RCU priority boosting tests fail even with CONFIG_RCU_BOOST set because rcutorture's threads run at the same priority as the default RCU kthreads (RT class with priority of 1). This patch checks if RCU torture is built into the kernel and if so, assigns RT priority 1 to the RCU threads, allowing the rcutorture boost tests to pass. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit b7b6f94cf6e6d961f78064315b6f5de5d9c6414b Author: NeilBrown Date: Mon Jun 18 14:22:40 2018 +1000 rculist: Improve documentation for list_for_each_entry_from_rcu() Unfortunately the patch for adding list_for_each_entry_from_rcu() wasn't the final patch after all review. It is functionally correct but the documentation was incomplete. This patch adds this missing documentation which includes an update to the documentation for list_for_each_entry_continue_rcu() to match the documentation for the new list_for_each_entry_from_rcu(), and adds list_for_each_entry_from_rcu() and the already existing hlist_for_each_entry_from_rcu() to section 7 of whatisRCU.txt. Reviewed-by: Paul E. McKenney Signed-off-by: NeilBrown Signed-off-by: Paul E. McKenney commit 52e17ba1d063ab6adb367f288babd380e30bad46 Author: Paul E. McKenney Date: Tue Jun 19 08:54:37 2018 -0700 srcu: Add grace-period number to rcutorture statistics printout This commit adds the SRCU grace-period number to the rcutorture statistics printout, which allows it to be compared to the rcutorture "Writer stall state" message. Signed-off-by: Paul E. McKenney commit 89b4cd4b9ebf15b01f70b85105ea5f5c6b2a3788 Author: Paul E. McKenney Date: Mon Jun 11 12:29:16 2018 -0700 rcu: Print stall-warning NMI dyntick state in hexadecimal The ->dynticks_nmi_nesting field records the nesting depth of both interrupt and NMI handlers. Because the kernel can enter interrupts and never leave them (and vice versa) and because NMIs can interrupt manipulation of the ->dynticks_nmi_nesting field, the values in this field must be both chosen and maniupated very carefully. As a result, although the value is zero when the corresponding CPU is executing neither an interrupt nor an NMI handler, it is 4,611,686,018,427,387,906 on 64-bit systems when there is a single level of interrupt/NMI handling in progress. This number is difficult to remember and interpret, so this commit switches the output to hexadecimal, resulting in the much nicer 0x4000000000000002. Signed-off-by: Paul E. McKenney commit cfe15038f4fc83503711a0880ba438f2deee91ff Author: Paul E. McKenney Date: Mon Jun 11 05:22:03 2018 -0700 MAINTAINERS: Update RCU, SRCU, and TORTURE-TEST entries The RCU, SRCU, and TORTURE-TEST entries are missing some recent changes, so this commit brings them up to date. Reported-by: Andrea Parri Signed-off-by: Paul E. McKenney Cc: Davidlohr Bueso Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan commit 2ee5aca54622aacc196106c623fea4116f1043a6 Author: Paul E. McKenney Date: Sat Jun 9 01:22:20 2018 -0700 rcu: Make rcu_seq_diff() more exact The current implementatation of rcu_seq_diff() follows tradition in providing a rough-and-ready approximation of the number of elapsed grace periods between the two rcu_seq values. However, this difference is used to flag RCU-failure "near misses", which can be a valuable debugging aid, so more exactitude would be an improvement. This commit therefore improves the accuracy of rcu_seq_diff(). Signed-off-by: Paul E. McKenney commit 264d4f88ad5ba0d3c890a70a1216b4e87e5c26ec Author: Andrea Parri Date: Thu Jun 7 12:01:57 2018 +0200 doc: Update synchronize_rcu() definition in whatisRCU.txt The synchronize_rcu() definition based on RW-locks in whatisRCU.txt does not meet the "Memory-Barrier Guarantees" in Requirements.html; for example, the following SB-like test: P0: P1: WRITE_ONCE(x, 1); WRITE_ONCE(y, 1); synchronize_rcu(); smp_mb(); r0 = READ_ONCE(y); r1 = READ_ONCE(x); should not be allowed to reach the state "r0 = 0 AND r1 = 0", but the current write_lock()+write_unlock() definition can not ensure this. This commit therefore inserts an smp_mb__after_spinlock() in order to cause this synchronize_rcu() implementation to provide this memory-barrier guarantee. Suggested-by: Paul E. McKenney Signed-off-by: Andrea Parri Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: Jonathan Corbet Signed-off-by: Paul E. McKenney commit 67abb96cbf307e16e3c6d1a0328ece085b5ce94c Author: Byungchul Park Date: Fri Jun 1 11:03:09 2018 +0900 rcu: Check the range of jiffies_till_{first,next}_fqs when setting them Currently, the range of jiffies_till_{first,next}_fqs are checked and adjusted on and on in the loop of rcu_gp_kthread on runtime. However, it's enough to check them only when setting them, not every time in the loop. So make them handled on a setting time via sysfs. Signed-off-by: Byungchul Park Signed-off-by: Paul E. McKenney commit 47199a0812535217c29933cecf468568bb37f933 Author: Paul E. McKenney Date: Mon May 28 10:33:08 2018 -0700 rcu: Add diagnostics for rcutorture writer stall warning This commit adds any in-the-future ->gp_seq_needed fields to the diagnostics for an rcutorture writer stall warning message. Signed-off-by: Paul E. McKenney commit cd23ac8ddb7be993f88bee893b89a8b4971c3651 Author: Steven Rostedt (VMware) Date: Thu May 24 18:58:16 2018 -0400 rcu: Add comment to the last sleep in the rcu tasks loop At the end of rcu_tasks_kthread() there's a lonely schedule_timeout_uninterruptible() call with no apparent rationale for its existence. But there is. It is to keep the thread from going into a tight loop if there's some anomaly. That really needs a comment. Link: http://lkml.kernel.org/r/20180524223839.GU3803@linux.vnet.ibm.com Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Paul E. McKenney commit c03be752d39dc64dcfda0ac8ce87fb10b1ee5621 Author: Steven Rostedt (VMware) Date: Thu May 24 18:49:46 2018 -0400 rcu: Speed up calling of RCU tasks callbacks Joel Fernandes found that the synchronize_rcu_tasks() was taking a significant amount of time. He demonstrated it with the following test: # cd /sys/kernel/tracing # while [ 1 ]; do x=1; done & # echo '__schedule_bug:traceon' > set_ftrace_filter # time echo '!__schedule_bug:traceon' > set_ftrace_filter; real 0m1.064s user 0m0.000s sys 0m0.004s Where it takes a little over a second to perform the synchronize, because there's a loop that waits 1 second at a time for tasks to get through their quiescent points when there's a task that must be waited for. After discussion we came up with a simple way to wait for holdouts but increase the time for each iteration of the loop but no more than a full second. With the new patch we have: # time echo '!__schedule_bug:traceon' > set_ftrace_filter; real 0m0.131s user 0m0.000s sys 0m0.004s Which drops it down to 13% of what the original wait time was. Link: http://lkml.kernel.org/r/20180523063815.198302-2-joel@joelfernandes.org Reported-by: Joel Fernandes (Google) Suggested-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Paul E. McKenney commit 0d805a70a652a6eef8d0283e5183879e7acb85ad Author: Joel Fernandes (Google) Date: Tue May 22 23:38:13 2018 -0700 rcu: Add comment documenting how rcu_seq_snap works rcu_seq_snap may be tricky to decipher. Lets document how it works with an example to make it easier. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney [ paulmck: Shrink comment as suggested by Peter Zijlstra. ] commit b06ae25a1e2b54b2b5bc589a4a118b7bb39159fe Author: Paul E. McKenney Date: Thu May 17 13:32:51 2018 -0700 rcu: Use RCU CPU stall timeout for rcu_check_gp_start_stall() Currently, rcu_check_gp_start_stall() waits for one second after the first request before complaining that a grace period has not yet started. This was desirable while testing the conversion from ->future_gp_needed[] to ->gp_seq_needed, but it is a bit on the hair-trigger side for production use under heavy load. This commit therefore makes this wait time be exactly that of the RCU CPU stall warning, allowing easy adjustment of both timeouts to suit the distribution or installation at hand. Signed-off-by: Paul E. McKenney commit 51fbb910f52c8559a78665d203e55ab2b95e7126 Author: Paul E. McKenney Date: Thu May 17 13:15:40 2018 -0700 rcu: Remove __maybe_unused from rcu_cpu_has_callbacks() The rcu_cpu_has_callbacks() function is now used in all configurations, so this commit removes the __maybe_unused. Signed-off-by: Paul E. McKenney commit 9622179519c52ead944c3b6a07aed9c6db3659e2 Author: Paul E. McKenney Date: Thu May 17 11:33:17 2018 -0700 rcu: Remove "inline" from rcu_perf_print_module_parms() This function is in rcuperf.c, which is not an include file, so there is no problem dropping the "inline", especially given that this function is invoked only twice per rcuperf run. This commit therefore delegates the inlining decision to the compiler by dropping the "inline". Signed-off-by: Paul E. McKenney commit eac45e586cd38a1b56aa716560002e68741b78a7 Author: Paul E. McKenney Date: Thu May 17 11:33:17 2018 -0700 rcu: Remove "inline" from rcu_torture_print_module_parms() This function is in rcutorture.c, which is not an include file, so there is no problem dropping the "inline", especially given that this function is invoked only twice per rcutorture run. This commit therefore delegates the inlining decision to the compiler by dropping the "inline". Signed-off-by: Paul E. McKenney commit 95394e69c42f0da83a176936fdb28f6cac57ea69 Author: Paul E. McKenney Date: Thu May 17 11:33:17 2018 -0700 rcu: Remove "inline" from panic_on_rcu_stall() and rcu_blocking_is_gp() These functions are in kernel/rcu/tree.c, which is not an include file, so there is no problem dropping the "inline", especially given that these functions are nowhere near a fastpath. This commit therefore delegates the inlining decision to the compiler by dropping the "inline". Signed-off-by: Paul E. McKenney commit ab6b82147f471e31d9397c95d523631b6c8953f2 Author: Paul E. McKenney Date: Thu May 17 11:21:20 2018 -0700 rcu: Remove unused local variable "cpu" One danger of using __maybe_unused is that the compiler doesn't yell at you when you remove the last reference, witness rcu_bind_gp_kthread() and its local variable "cpu". This commit removes this local variable. Signed-off-by: Paul E. McKenney commit 164ba3fc4864346dbc365f8b89d8888e1b6cd38c Author: Paul E. McKenney Date: Wed May 16 20:41:36 2018 -0700 rcu: Remove unused rcu_kick_nohz_cpu() function The rcu_kick_nohz_cpu() function is no longer used, and the functionality it used to provide is now provided by a call to resched_cpu() in the force-quiescent-state function rcu_implicit_dynticks_qs(). This commit therefore removes rcu_kick_nohz_cpu(). Signed-off-by: Paul E. McKenney commit c7037ff5249cee237b8c8a6f99998ae4f3916b60 Author: Paul E. McKenney Date: Wed May 16 18:00:17 2018 -0700 rcu: Clarify and correct the rcu_preempt_qs() header comment The rcu_preempt_qs() function only applies to the CPU, not the task. A task really is allowed to invoke this function while in an RCU-preempt read-side critical section, but only if it has first added itself to some leaf rcu_node structure's ->blkd_tasks list. Signed-off-by: Paul E. McKenney commit 3b57a3994f330a102b91bd70c84c9530c0ae50f6 Author: Paul E. McKenney Date: Wed May 16 16:01:56 2018 -0700 rcu: Inline rcu_dynticks_momentary_idle() into its sole caller The rcu_dynticks_momentary_idle() function is invoked only from rcu_momentary_dyntick_idle(), and neither function is particularly large. This commit therefore saves a few lines by inlining rcu_dynticks_momentary_idle() into rcu_momentary_dyntick_idle(). Signed-off-by: Paul E. McKenney commit 15651201fa055ec81d3669b36ab7c2fb12c3ce36 Author: Paul E. McKenney Date: Wed May 16 14:41:41 2018 -0700 rcu: Mark task as .need_qs less aggressively If any scheduling-clock interrupt interrupts an RCU-preempt read-side critical section, the interrupted task's ->rcu_read_unlock_special.b.need_qs field is set. This causes the outermost rcu_read_unlock() to incur the extra overhead of calling into rcu_read_unlock_special(). This commit reduces that overhead by setting ->rcu_read_unlock_special.b.need_qs only if the grace period has been in effect for more than one second. Why one second? Because this is comfortably smaller than the minimum RCU CPU stall-warning timeout of three seconds, but long enough that the .need_qs marking should happen quite rarely. And if your RCU read-side critical section has run on-CPU for a full second, it is not unreasonable to invest some CPU time in ending the grace period quickly. Signed-off-by: Paul E. McKenney commit 6f56f714db067056c80f5d71510118f82872e34c Author: Paul E. McKenney Date: Mon May 14 13:52:27 2018 -0700 rcu: Improve RCU-tasks naming and comments The naming and comments associated with some RCU-tasks code make the faulty assumption that context switches due to cond_resched() are voluntary. As several people pointed out, this is not the case. This commit therefore updates function names and comments to better reflect current reality. Reported-by: Byungchul Park Reported-by: Joel Fernandes Reported-by: Steven Rostedt Signed-off-by: Paul E. McKenney commit a7538352da722fae5cc95ae6656ea2013f5b8b21 Author: Joe Perches Date: Mon May 14 13:27:33 2018 -0700 rcu: Use pr_fmt to prefix "rcu: " to logging output This commit also adjusts some whitespace while in the area. Signed-off-by: Joe Perches Signed-off-by: Paul E. McKenney [ paulmck: Revert string-breaking %s as requested by Andy Shevchenko. ] commit 1445e9175bead409bb9930f3c745246a09f22cf6 Author: Mauro Carvalho Chehab Date: Mon May 7 06:35:46 2018 -0300 rcu: rcupdate.h: Get rid of Sphinx warnings at rcu_pointer_handoff() The code example at rcupdate.h currently produce lots of warnings: ./include/linux/rcupdate.h:572: WARNING: Unexpected indentation. ./include/linux/rcupdate.h:576: WARNING: Unexpected indentation. ./include/linux/rcupdate.h:580: WARNING: Block quote ends without a blank line; unexpected unindent. ./include/linux/rcupdate.h:582: WARNING: Block quote ends without a blank line; unexpected unindent. ./include/linux/rcupdate.h:582: WARNING: Inline literal start-string without end-string. This commit therefore changes it to a code-block. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paul E. McKenney commit 07f27570dcd148a5f4de7dc3513c1d1cd069b362 Author: Byungchul Park Date: Fri May 11 17:30:34 2018 +0900 rcu: Improve rcu_note_voluntary_context_switch() reporting We expect a quiescent state of TASKS_RCU when cond_resched_tasks_rcu_qs() is called, no matter whether it actually be scheduled or not. However, it currently doesn't report the quiescent state when the task enters into __schedule() as it's called with preempt = true. So make it report the quiescent state unconditionally when cond_resched_tasks_rcu_qs() is called. And in TINY_RCU, even though the quiescent state of rcu_bh also should be reported when the tick interrupt comes from user, it doesn't. So make it reported. Lastly in TREE_RCU, rcu_note_voluntary_context_switch() should be reported when the tick interrupt comes from not only user but also idle, as an extended quiescent state. Signed-off-by: Byungchul Park Signed-off-by: Paul E. McKenney [ paulmck: Simplify rcutiny portion given no RCU-tasks for !PREEMPT. ] commit 3949fa9bac090ad217534c30bc3b6572289abf21 Author: Paul E. McKenney Date: Tue May 8 15:29:10 2018 -0700 rcu: Make rcu_read_unlock_special() static Because rcu_read_unlock_special() is no longer used outside of kernel/rcu/tree_plugin.h, this commit makes it static. Signed-off-by: Paul E. McKenney commit f2e2df59786d7bd52e6e7e2d10c1c6ba433a0ee7 Author: Paul E. McKenney Date: Tue May 15 16:23:23 2018 -0700 rcu: Add diagnostics for offline CPUs failing to report QS CPUs are expected to report quiescent states when coming online and when going offline, and grace-period initialization is supposed to handle any race conditions where a CPU's ->qsmask bit is set just after it goes offline. This commit adds diagnostics for the case where an offline CPU nevertheless has a grace period waiting on it. Signed-off-by: Paul E. McKenney commit fea3f222d3523dfdd0e86b11227d3cda20765102 Author: Paul E. McKenney Date: Tue May 15 15:47:30 2018 -0700 rcu: Record ->gp_state for both phases of grace-period initialization Grace-period initialization first processes any recent CPU-hotplug operations, and then initializes state for the new grace period. These two phases of initialization are currently not distinguished in debug prints, but the distinction is valuable in a number of debug situations. This commit therefore introduces two new values for ->gp_state, RCU_GP_ONOFF and RCU_GP_INIT, in order to make this distinction. Signed-off-by: Paul E. McKenney commit 577389423187d8b51dfe6199297e579a3419b72b Author: Paul E. McKenney Date: Tue May 8 14:18:57 2018 -0700 rcu: Add CPU online/offline state to dump_blkd_tasks() Interactions between CPU-hotplug operations and grace-period initialization can result in dump_blkd_tasks(). One of the first debugging actions in this case is to search back in dmesg to work out which of the affected rcu_node structure's CPUs are online and to determine the last CPU-hotplug operation affecting any of those CPUs. This can be laborious and error-prone, especially when console output is lost. This commit therefore causes dump_blkd_tasks() to dump the state of the affected rcu_node structure's CPUs and the last grace period during which the last offline and online operation affected each of these CPUs. Signed-off-by: Paul E. McKenney commit ff3cee39088b1931a432587059d66cd505f785dc Author: Paul E. McKenney Date: Tue May 8 12:50:14 2018 -0700 rcu: Add up-tree information to dump_blkd_tasks() diagnostics This commit updates dump_blkd_tasks() to print out quiescent-state bitmasks for the rcu_node structures further up the tree. This information helps debugging of interactions between CPU-hotplug operations and RCU grace-period initialization. Signed-off-by: Paul E. McKenney commit e05121ba5b81e2f85349f038642410578457f6db Author: Paul E. McKenney Date: Mon May 7 12:07:48 2018 -0700 rcu: Remove CPU-hotplug failsafe from force-quiescent-state code path Now that quiescent states for newly offlined CPUs are reported either when that CPU goes offline or at the end of grace-period initialization, the CPU-hotplug failsafe in the force-quiescent-state code path is no longer needed. This commit therefore removes this failsafe. Signed-off-by: Paul E. McKenney commit 17a8212b8de21ce1b9a91fb75c8a6fb337685b9a Author: Paul E. McKenney Date: Thu May 3 14:30:02 2018 -0700 rcu: Remove failsafe check for lost quiescent state Now that quiescent-state reporting is fully event-driven, this commit removes the check for a lost quiescent state from force_qs_rnp(). Signed-off-by: Paul E. McKenney commit f34f2f5852e556ee1c3b3b294571086b1791008a Author: Paul E. McKenney Date: Thu May 3 13:40:25 2018 -0700 rcu: Move grace-period pre-init delay after pre-init The main race with the early part of grace-period initialization appears to be with CPU hotplug. To more fully open this race window, this commit moves the rcu_gp_slow() from the beginning of the early initialization loop to follow that loop, thus widening the race window, especially for the rcu_node structures that are initialized last. This commit also expands rcutree.gp_preinit_delay from 3 to 12, giving the same overall delay in the grace period, but concentrated in the spot where it will do the most good. Signed-off-by: Paul E. McKenney commit 1f3e5f51b933cbc25e3da0cdbdac40716df04ddb Author: Paul E. McKenney Date: Thu May 3 10:35:33 2018 -0700 rcu: Add RCU-preempt check for waiting on newly onlined CPU RCU should only be waiting on CPUs that were online at the time that the current grace period started. Failure to abide by this rule can result in confusing splats during grace-period cleanup and initialization. This commit therefore adds a check to RCU-preempt's preempted-task queuing that checks for waiting on newly onlined CPUs. Signed-off-by: Paul E. McKenney commit 1e64b15a4b102e1cd059d4d798b7a78f93341333 Author: Paul E. McKenney Date: Fri May 25 19:23:09 2018 -0700 rcu: Fix grace-period hangs due to race with CPU offline Without special fail-safe quiescent-state-propagation checks, grace-period hangs can result from the following scenario: 1. CPU 1 goes offline. 2. Because CPU 1 is the only CPU in the system blocking the current grace period, the grace period ends as soon as rcu_cleanup_dying_idle_cpu()'s call to rcu_report_qs_rnp() returns. 3. At this point, the leaf rcu_node structure's ->lock is no longer held: rcu_report_qs_rnp() has released it, as it must in order to awaken the RCU grace-period kthread. 4. At this point, that same leaf rcu_node structure's ->qsmaskinitnext field still records CPU 1 as being online. This is absolutely necessary because the scheduler uses RCU (in this case on the wake-up path while awakening RCU's grace-period kthread), and ->qsmaskinitnext contains RCU's idea as to which CPUs are online. Therefore, invoking rcu_report_qs_rnp() after clearing CPU 1's bit from ->qsmaskinitnext would result in a lockdep-RCU splat due to RCU being used from an offline CPU. 5. RCU's grace-period kthread awakens, sees that the old grace period has completed and that a new one is needed. It therefore starts a new grace period, but because CPU 1's leaf rcu_node structure's ->qsmaskinitnext field still shows CPU 1 as being online, this new grace period is initialized to wait for a quiescent state from the now-offline CPU 1. 6. Without the fail-safe force-quiescent-state checks, there would be no quiescent state from the now-offline CPU 1, which would eventually result in RCU CPU stall warnings and memory exhaustion. It would be good to get rid of the special fail-safe quiescent-state propagation checks, and thus it would be good to fix things so that the above scenario cannot happen. This commit therefore adds a new ->ofl_lock to the rcu_state structure. This lock is held by rcu_gp_init() across the applying of buffered online and offline operations to the rcu_node tree, and it is also held by rcu_cleanup_dying_idle_cpu() when buffering a new offline operation. This prevents rcu_gp_init() from acquiring the leaf rcu_node structure's lock during the interval between when rcu_cleanup_dying_idle_cpu() invokes rcu_report_qs_rnp(), which releases ->lock and the re-acquisition of that same lock. This in turn prevents the failure scenario outlined above, and will hopefully eventually allow removal of the offline-CPU checks from the force-quiescent-state code path. Signed-off-by: Paul E. McKenney commit ec2c29765a4ab12c236ac5a89b89660222ff6b01 Author: Paul E. McKenney Date: Mon May 7 09:34:17 2018 -0700 rcu: Fix grace-period hangs from mid-init task resume Without special fail-safe quiescent-state-propagation checks, grace-period hangs can result from the following scenario: 1. A task running on a given CPU is preempted in its RCU read-side critical section. 2. That CPU goes offline, and there are now no online CPUs corresponding to that CPU's leaf rcu_node structure. 3. The rcu_gp_init() function does the first phase of grace-period initialization, and sets the aforementioned leaf rcu_node structure's ->qsmaskinit field to all zeroes. Because there is a blocked task, it does not propagate the zeroing of either ->qsmaskinit or ->qsmaskinitnext up the rcu_node tree. 4. The task resumes on some other CPU and exits its critical section. There is no grace period in progress, so the resulting quiescent state is not reported up the tree. 5. The rcu_gp_init() function does the second phase of grace-period initialization, which results in the leaf rcu_node structure being initialized to expect no further quiescent states, but with that structure's parent expecting a quiescent-state report. The parent will never receive a quiescent state from this leaf rcu_node structure, so the grace period will hang, resulting in RCU CPU stall warnings. It would be good to get rid of the special fail-safe quiescent-state propagation checks. This commit therefore checks the leaf rcu_node structure's ->wait_blkd_tasks field during grace-period initialization. If this flag is set, the rcu_report_qs_rnp() is invoked to immediately report the possible quiescent state. While in the neighborhood, this commit also report quiescent states for any CPUs that went offline between the two phases of grace-period initialization, thus reducing grace-period delays and hopefully eventually allowing removal of offline-CPU checks from the force-quiescent-state code path. Signed-off-by: Paul E. McKenney commit 0b107d24d9361132758374a7b007c7c74efa007f Author: Paul E. McKenney Date: Tue May 8 16:18:28 2018 -0700 rcu: Suppress false-positive splats from mid-init task resume Consider the following sequence of events in a PREEMPT=y kernel: 1. All CPUs corresponding to a given leaf rcu_node structure are offline. 2. The first phase of the rcu_gp_init() function's grace-period initialization runs, and sets that rcu_node structure's ->qsmaskinit to zero, as it should. 3. One of the CPUs corresponding to that rcu_node structure comes back online. Note that because this CPU came online after the grace period started, this grace period can safely ignore this newly onlined CPU. 4. A task running on the newly onlined CPU enters an RCU-preempt read-side critical section, and is then preempted. Because the corresponding rcu_node structure's ->qsmask is zero, rcu_preempt_ctxt_queue() leaves the rcu_node structure's ->gp_tasks field NULL, as it should. 5. The rcu_gp_init() function continues running the second phase of grace-period initialization. The ->qsmask field of the parent of the aforementioned leaf rcu_node structure is set to not expect a quiescent state from the leaf, as is only right and proper. However, when rcu_gp_init() reaches the leaf, it invokes rcu_preempt_check_blocked_tasks(), which sees that the leaf's ->blkd_tasks list is non-empty, and therefore sets the leaf's ->gp_tasks field to reference the first task on that list. 6. The grace period ends before the preempted task resumes, which is perfectly fine, given that this grace period was under no obligation to wait for that task to exit its late-starting RCU-preempt read-side critical section. Unfortunately, the leaf's ->gp_tasks field is non-NULL, so rcu_gp_cleanup() splats. After all, it appears to rcu_gp_cleanup() that the grace period failed to wait for a task that was supposed to be blocking that grace period. This commit avoids this false-positive splat by adding a check of both ->qsmaskinit and ->wait_blkd_tasks to rcu_preempt_check_blocked_tasks(). If both ->qsmaskinit and ->wait_blkd_tasks are zero, then the task must have entered its RCU-preempt read-side critical section late (after all, the CPU that it is running on was not online at that time), which means that the upper-level rcu_node structure won't be waiting for anything on the leaf anyway. If ->wait_blkd_tasks is non-zero, then there is at least one task on ths rcu_node structure's ->blkd_tasks list whose RCU read-side critical section predates the current grace period. If ->qsmaskinit is non-zero, there is at least one CPU that was online at the start of the current grace period. Thus, if both are zero, there is nothing to wait for. Signed-off-by: Paul E. McKenney commit 99990da1b3c00f6c05a330e06a76b9dbc8416d7e Author: Paul E. McKenney Date: Thu May 3 09:45:00 2018 -0700 rcu: Suppress more involved false-positive preempted-task splats Consider the following sequence of events in a PREEMPT=y kernel: 1. All but one of the CPUs corresponding to a given leaf rcu_node structure go offline. Each of these CPUs clears its bit in that structure's ->qsmaskinitnext field. 2. A new grace period starts, and rcu_gp_init() scans the leaf rcu_node structures, applying CPU-hotplug changes since the start of the previous grace period, including those changes in #1 above. This copies each leaf structure's ->qsmaskinitnext to its ->qsmask field, which represents the CPUs that this new grace period will wait on. Each copy operation is done holding the corresponding leaf rcu_node structure's ->lock, and at the end of this scan, rcu_gp_init() holds no locks. 3. The last CPU corresponding to #1's leaf rcu_node structure goes offline, clearing its bit in that structure's ->qsmaskinitnext field, but not touching the ->qsmaskinit field. Note that rcu_gp_init() is not currently holding any locks! This CPU does -not- report a quiescent state because the grace period has not yet initialized itself sufficiently to have set any bits in any of the leaf rcu_node structures' ->qsmask fields. 4. The rcu_gp_init() function continues initializing the new grace period, copying each leaf rcu_node structure's ->qsmaskinit field to its ->qsmask field while holding the corresponding ->lock. This sets the ->qsmask bit corresponding to #3's CPU. 5. Before the grace period ends, #3's CPU comes back online. Because te grace period has not yet done any force-quiescent-state scans (which would report a quiescent state on behalf of any offline CPUs), this CPU's ->qsmask bit is still set. 6. A task running on the newly onlined CPU is preempted while in an RCU read-side critical section. Because this CPU's ->qsmask bit is net, not only does this task queue itself on the leaf rcu_node structure's ->blkd_tasks list, it also sets that structure's ->gp_tasks pointer to reference it. 7. The grace period started in #1 above comes to an end. This results in rcu_gp_cleanup() being invoked, which, among other things, checks to make sure that there are no tasks blocking the just-ended grace period, that is, that all ->gp_tasks pointers are NULL. The ->gp_tasks pointer corresponding to the task preempted in #3 above is non-NULL, which results in a splat. This splat is a false positive. The task's RCU read-side critical section cannot have begun before the just-ended grace period because this would mean either: (1) The CPU came online before the grace period started, which cannot have happened because the grace period started before that CPU went offline, or (2) The task started its RCU read-side critical section on some other CPU, but then it would have had to have been preempted before migrating to this CPU, which would mean that it would have instead queued itself on that other CPU's rcu_node structure. RCU's grace periods thus are working correctly. Or, more accurately, that remaining bugs in RCU's grace periods are elsewhere. This commit eliminates this false positive by adding code to the end of rcu_cpu_starting() that reports a quiescent state to RCU, which has the side-effect of clearing that CPU's ->qsmask bit, preventing the above scenario. This approach has the added benefit of more promptly reporting quiescent states corresponding to offline CPUs. Nevertheless, this commit does -not- remove the need for the force-quiescent-state scans to check for offline CPUs, given that a CPU might remain offline indefinitely. And without the checks in the force-quiescent-state scans, the grace period would also persist indefinitely, which could result in hangs or memory exhaustion. Note well that the call to rcu_report_qs_rnp() reporting the quiescent state must come -after- the setting of this CPU's bit in the leaf rcu_node structure's ->qsmaskinitnext field. Otherwise, lockdep-RCU will complain bitterly about quiescent states coming from an offline CPU. Signed-off-by: Paul E. McKenney commit fece27760ff57a0ca16c37e144f6a58a2f1851e9 Author: Paul E. McKenney Date: Wed May 2 20:04:12 2018 -0700 rcu: Suppress false-positive preempted-task splats Consider the following sequence of events in a PREEMPT=y kernel: 1. All CPUs corresponding to a given rcu_node structure go offline. A new grace period starts just after the CPU-hotplug code path does its synchronize_rcu() for the last CPU, so at least this CPU is present in that structure's ->qsmask. 2. Before the grace period ends, a CPU comes back online, and not just any CPU, but the one corresponding to a non-zero bit in the leaf rcu_node structure's ->qsmask. 3. A task running on the newly onlined CPU is preempted while in an RCU read-side critical section. Because this CPU's ->qsmask bit is net, not only does this task queue itself on the leaf rcu_node structure's ->blkd_tasks list, it also sets that structure's ->gp_tasks pointer to reference it. 4. The grace period started in #1 above comes to an end. This results in rcu_gp_cleanup() being invoked, which, among other things, checks to make sure that there are no tasks blocking the just-ended grace period, that is, that all ->gp_tasks pointers are NULL. The ->gp_tasks pointer corresponding to the task preempted in #3 above is non-NULL, which results in a splat. This splat is a false positive. The task's RCU read-side critical section cannot have begun before the just-ended grace period because this would mean either: (1) The CPU came online before the grace period started, which cannot have happened because the grace period started before that CPU was all the way offline, or (2) The task started its RCU read-side critical section on some other CPU, but then it would have had to have been preempted before migrating to this CPU, which would mean that it would have instead queued itself on that other CPU's rcu_node structure. This commit eliminates this false positive by adding code to the end of rcu_cleanup_dying_idle_cpu() that reports a quiescent state to RCU, which has the side-effect of clearing that CPU's ->qsmask bit, preventing the above scenario. This approach has the added benefit of more promptly reporting quiescent states corresponding to offline CPUs. Note well that the call to rcu_report_qs_rnp() reporting the quiescent state must come -before- the clearing of this CPU's bit in the leaf rcu_node structure's ->qsmaskinitnext field. Otherwise, lockdep-RCU will complain bitterly about quiescent states coming from an offline CPU. Signed-off-by: Paul E. McKenney commit 5554788e1d4253a92b794a9006b7ae2c10be52af Author: Paul E. McKenney Date: Tue May 15 10:14:34 2018 -0700 rcu: Suppress false-positive offline-CPU lockdep-RCU splat The rcu_lockdep_current_cpu_online() function currently checks only the RCU-sched data structures to determine whether or not RCU believes that a given CPU is offline. Unfortunately, there are multiple flavors of RCU, which means that there is a short window of time during which the various flavors disagree as to whether or not a given CPU is offline. This can result in false-positive lockdep-RCU splats in which some other flavor of RCU tries to do something based on its view that the CPU is online, only to get hit with a lockdep-RCU splat because RCU-sched instead believes that the CPU is offline. This commit therefore changes rcu_lockdep_current_cpu_online() to scan all RCU flavors and to consider a given CPU to be online if any of the RCU flavors believe it to be online, thus preventing these false-positive splats. Signed-off-by: Paul E. McKenney commit 928164351e700f91ab588f20fe470cac9db477a9 Author: Paul E. McKenney Date: Wed May 2 11:07:02 2018 -0700 rcu: Prevent useless FQS scan after all CPUs have checked in The force_qs_rnp() function checks for ->qsmask being all zero, that is, all CPUs for the current rcu_node structure having already passed through quiescent states. But with RCU-preempt, this is not sufficient to report quiescent states further up the tree, so there are further checks that can initiate RCU priority boosting and also for races with CPU-hotplug operations. However, if neither of these further checks apply, the code proceeds to carry out a useless scan of an all-zero ->qsmask. This commit therefore adds code to release the current rcu_node structure's lock and continue on to the next rcu_node structure, thereby avoiding this useless scan. Signed-off-by: Paul E. McKenney commit 91f63ced7dc4e80acd13386204327d5de00a672d Author: Paul E. McKenney Date: Tue May 1 15:05:45 2018 -0700 rcu: Replace smp_wmb() with smp_store_release() for stall check This commit gets rid of the smp_wmb() in record_gp_stall_check_time() in favor of an smp_store_release(). Signed-off-by: Paul E. McKenney commit 77cfc7bf24ba0ba37be54e224007847d485a860f Author: Paul E. McKenney Date: Tue May 1 15:00:10 2018 -0700 rcu: Fix typo and add additional debug This commit fixes a typo and adds some additional debugging to the message emitted when a task blocking the current grace period is listed as blocking it when either that grace period ends or the next grace period begins. This commit also reformats the console message for readability. Signed-off-by: Paul E. McKenney commit c74859d1eb2d8578bdf6d78ba893e394085aba1a Author: Paul E. McKenney Date: Fri Apr 27 14:05:27 2018 -0700 rcu: Make rcu_report_unblock_qs_rnp() warn on violated preconditions If rcu_report_unblock_qs_rnp() is invoked on something other than preemptible RCU or if there are still preempted tasks blocking the current grace period, something went badly wrong in the caller. This commit therefore adds WARN_ON_ONCE() to these conditions, but leaving the legitimate reason for early exit (rnp->qsmask != 0) unwarned. Signed-off-by: Paul E. McKenney commit 8d672fa6bf68ffc36a0c5e4868499f86bbea2308 Author: Paul E. McKenney Date: Wed May 2 14:46:43 2018 -0700 rcu: Make rcu_init_new_rnp() stop upon already-set bit Currently, rcu_init_new_rnp() walks up the rcu_node combining tree, setting bits in the ->qsmaskinit fields on the way up. It walks up unconditionally, regardless of the initial state of these bits. This is OK because only the corresponding RCU grace-period kthread ever tests or sets these bits during runtime. However, it is also pointless, and it increases both memory and lock contention (albeit only slightly), so this commit stops the walk as soon as an already-set bit is encountered. Signed-off-by: Paul E. McKenney commit c50cbe535c972150c2caf923239ef77e85c5ad60 Author: Paul E. McKenney Date: Wed May 2 13:51:57 2018 -0700 rcu: Fix an obsolete ->qsmaskinit comment Back in the old days, when grace-period initialization blocked CPU hotplug, the ->qsmaskinit mask was indeed updated at the time that a given CPU went offline. However, with the deferral of these updates until the beginning of the next grace period in commit 0aa04b055e71 ("rcu: Process offlining and onlining only at grace-period start"), it is instead ->qsmaskinitnext that gets updated at that time. This commit therefore updates the obsolete comment. It also fixes punctuation while on the topic of comments mentioning ->qsmaskinit. Signed-off-by: Paul E. McKenney commit 962aff03c315b508d980422db5b49b49e4382119 Author: Paul E. McKenney Date: Wed May 2 12:49:21 2018 -0700 rcu: Clean up handling of tasks blocked across full-rcu_node offline Commit 0aa04b055e71 ("rcu: Process offlining and onlining only at grace-period start") deferred handling of CPU-hotplug events until the start of the next grace period, but consider the following sequence of events: 1. A task is preempted within an RCU-preempt read-side critical section. 2. The CPU that this task was running on goes offline, along with all other CPUs sharing the corresponding leaf rcu_node structure. 3. The task resumes execution. 4. One of those CPUs comes back online before a new grace period starts. In step 2, the code in the next rcu_gp_init() invocation will (correctly) defer removing the leaf rcu_node structure from the upper-level bitmasks, and will (correctly) set that structure's ->wait_blkd_tasks field. During the ensuing interval, RCU will (correctly) track the tasks preempted on that structure because they must block any subsequent grace period. In step 3, the code in rcu_read_unlock_special() will (correctly) remove the task from the leaf rcu_node structure. From this point forward, RCU need not pay attention to this structure, at least not until one of the corresponding CPUs comes back online. In step 4, the code in the next rcu_gp_init() invocation will (incorrectly) invoke rcu_init_new_rnp(). This is incorrect because the corresponding rcu_cleanup_dead_rnp() was never invoked. This is nevertheless harmless because the upper-level bits are still set. So, no harm, no foul, right? At least, all is well until a little further into rcu_gp_init() invocation, which will notice that there are no longer any tasks blocked on the leaf rcu_node structure, conclude that there is no longer anything left over from step 2's offline operation, and will therefore invoke rcu_cleanup_dead_rnp(). But this invocation of rcu_cleanup_dead_rnp() is for the beginning of the earlier offline interval, and the previous invocation of rcu_init_new_rnp() is for the end of that same interval. That is right, they are invoked out of order. That cannot be good, can it? It turns out that this is not a (correctness!) problem because rcu_cleanup_dead_rnp() checks to see if any of the corresponding CPUs are online, and refuses to do anything if so. In other words, in the case where rcu_init_new_rnp() and rcu_cleanup_dead_rnp() execute out of order, they both have no effect. But this is at best an accident waiting to happen. This commit therefore adds logic to rcu_gp_init() so that rcu_init_new_rnp() and rcu_cleanup_dead_rnp() are always invoked in order, and so that neither are invoked at all in cases where RCU had to pay attention to the leaf rcu_node structure during the entire time that all corresponding CPUs were offline. And, while in the area, this commit reduces confusion by using formal parameters rather than local variables that just happen to have the same value at that particular point in the code. Signed-off-by: Paul E. McKenney commit 226ca5e76692e2c82c17e8e8eedab22043f6ffee Author: Joel Fernandes (Google) Date: Tue May 22 23:38:15 2018 -0700 rcu: Identify grace period is in progress as we advance up the tree There's no need to keep checking the same starting node for whether a grace period is in progress as we advance up the funnel lock loop. Its sufficient if we just checked it in the start, and then subsequently checked the internal nodes as we advanced up the combining tree. This also makes sense because the grace-period updates propogate from the root to the leaf, so there's a chance we may find a grace period has started as we advance up, lets check for the same. Reported-by: Paul McKenney Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit df2bf8f7f776cef57e6b27690c7b78c86f259515 Author: Joel Fernandes (Google) Date: Tue May 22 23:38:14 2018 -0700 rcu: Use better variable names in funnel locking loop The funnel locking loop in rcu_start_this_gp uses rcu_root as a temporary variable while walking the combining tree. This causes a tiresome exercise of a code reader reminding themselves that rcu_root may not be root. Lets just call it rnp, and rename other variables as well to be more appropriate. Original patch: https://patchwork.kernel.org/patch/10396577/ Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney [ paulmck: Fix name in comment as well. ] commit b73de91d6a4c97ed586b2a5a6ce7c6fe395d9a3b Author: Joel Fernandes Date: Sun May 20 21:42:18 2018 -0700 rcu: Rename the grace-period-request variables and parameters The name 'c' is used for variables and parameters holding the requested grace-period sequence number. However it is no longer very meaningful given the conversions from ->gpnum and (especially) ->completed to ->gp_seq. This commit therefore renames 'c' to 'gp_seq_req'. Previous patch discussion is at: https://patchwork.kernel.org/patch/10396579/ Signed-off-by: Joel Fernandes Signed-off-by: Paul E. McKenney commit 3d18469a2bb3988e669d67e097eff42dd40663d4 Author: Paul E. McKenney Date: Tue May 15 16:47:30 2018 -0700 rcu: Regularize resetting of rcu_data wrap indicator The rcu_data structure's ->gpwrap indicator is currently reset only when the CPU in question detects a new grace period. This is in theory sufficient because any CPU that has been out of action for long enough that its ->gpwrap indicator is set is guaranteed to see both the end of an old grace period and the start of a new one. However, the current code leaves a short window during which the ->gpwrap indicator has been reset but the corresponding ->gp_seq counter has not yet been brought up to date. This is harmless because interrupts are disabled, but it is likely to (at the very least) cause confusion. This commit therefore moves the resetting of ->gpwrap to follow the updating of ->gp_seq. While in the area, it also resets ->gp_seq_needed. Signed-off-by: Paul E. McKenney commit d72193123c81ae6123d108b3be2096f3f13b25a6 Author: Paul E. McKenney Date: Tue May 15 15:24:41 2018 -0700 rcutorture: Correctly handle grace-period sequence wrap The new ->gq_seq grace-period sequence numbers must be shifted down, which give artifacts when these numbers wrap. This commit therefore enables rcutorture and rcuperf to handle grace-period sequence numbers even if they do wrap. It does this by allowing a special subtraction function to be specified, and this function subtracts before shifting. Signed-off-by: Paul E. McKenney commit 2e3e5e55010105f9d4351f68e15dbc43402a7794 Author: Paul E. McKenney Date: Tue May 15 11:53:41 2018 -0700 rcu: Make rcu_start_this_gp() check for grace period already started In the old days of ->gpnum and ->completed, the code requesting a new grace period checked to see if that grace period had already started, bailing early if so. The new-age ->gp_seq approach instead checks whether the grace period has already finished. A compensating change pushed the requested grace period down to the bottom of the tree, thus reducing lock contention and even eliminating it in some cases. But why not further reduce contention, especially on large systems, by doing both, especially given that the cost of doing both is extremely small? This commit therefore adds a new rcu_seq_started() function that checks whether a specified grace period has already started. It then uses this new function in place of rcu_seq_done() in the rcu_start_this_gp() function's funnel locking code. Reported-by: Joel Fernandes Signed-off-by: Paul E. McKenney commit 5ca0905f6787e930bc2a626cf1d8f69fab52acef Author: Joel Fernandes (Google) Date: Sun May 13 20:15:41 2018 -0700 rcu: Fix cpustart tracepoint gp_seq number The "cpustart" trace event shows a stale gp_seq. This is because it uses rdp->gp_seq, which is updated only at the end of the __note_gp_changes() function. This commit therefore instead uses rnp->gp_seq. An alternative fix would be to update rdp->gp_seq earlier, but this would break RCU's detection of the beginning of a new-to-this-CPU grace period. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit 5b55072f22ba2ed136b7a1b6c5beea9ace8415a7 Author: Joel Fernandes (Google) Date: Sun May 13 20:15:40 2018 -0700 rcu: Produce last "CleanupMore" trace only if late-breaking request Currently Tree RCU's clean-up code emits a "CleanupMore" trace event in response to late-arriving grace-period requests even if the grace period was already requested. This makes "CleanupMore" show up an extra time (in addition to once for each rcu_node structure that was previously marked with the request), and for no good reason. This commit therefore avoids emitting this trace message unless the the only request for this next grace period arrived during or after the cleanup scan of the rcu_node structures. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney commit a2165e416878b325747f871df4b236b49bf61486 Author: Paul E. McKenney Date: Sat May 12 07:42:20 2018 -0700 rcu: Don't funnel-lock above leaf node if GP in progress The old grace-period start code would acquire only the leaf's rcu_node structure's ->lock if that structure believed that a grace period was in progress. The new code advances to the leaf's parent in this case, needlessly acquiring then leaf's parent's ->lock. This commit therefore checks the grace-period state after marking the leaf with the need for the specified grace period, and if the leaf believes that a grace period is in progress, takes an early exit. Reported-by: Joel Fernandes Signed-off-by: Paul E. McKenney [ paulmck: Add "Startedleaf" tracing as suggested by Joel Fernandes. ] commit e1333462e3cf933ab860c693ef1ff50775c7ea7f Author: Paul E. McKenney Date: Wed May 2 12:39:42 2018 -0700 doc: Update RCU CPU stall-warning documentation Signed-off-by: Paul E. McKenney commit 869cc745bfbd1d8fda8b1dae1a8882b85393cdfa Author: Paul E. McKenney Date: Tue May 1 16:26:46 2018 -0700 doc: Update memory-ordering documentation for ->gp-seq Signed-off-by: Paul E. McKenney commit b1e1f21f5b8f8a25e53b9f7c59bca9a1d749547e Author: Paul E. McKenney Date: Tue May 1 15:51:32 2018 -0700 doc: Update data-structure documentation for ->gp_seq Signed-off-by: Paul E. McKenney commit e44e73ca47b47510dac491329d453d82aea1d8d8 Author: Paul E. McKenney Date: Tue May 1 16:29:47 2018 -0700 rcu: Make simple callback acceleration refer to rdp->gp_seq_needed Now that the rcu_data structure contains ->gp_seq_needed, create an rcu_accelerate_cbs_unlocked() helper function that locklessly checks to see if new callbacks' required grace period has already been requested. If so, update the callback list locally and again locklessly. (Though interrupts must be and are disabled to avoid racing with conflicting updates in interrupt handlers.) Otherwise, call rcu_accelerate_cbs() as before. Signed-off-by: Paul E. McKenney commit ff3bb6f4d06247508489345ee90a8a9b6f3ffd3b Author: Paul E. McKenney Date: Tue May 1 14:34:08 2018 -0700 rcu: Remove ->gpnum and ->completed Now that everything has been converted to use ->gp_seq instead of ->gpnum and ->completed, this commit removes ->gpnum and ->completed. Signed-off-by: Paul E. McKenney commit fee5997c17562e95fb1fecc142efb2da0934baa4 Author: Paul E. McKenney Date: Tue May 1 13:35:20 2018 -0700 rcu: Convert rcu_fqs tracepoint to ->gp_seq This commit makes the rcu_fqs tracepoint use ->gp_seq instead of ->gpnum. Signed-off-by: Paul E. McKenney commit db023296f0115d2fe01fdabad54678f2b806da23 Author: Paul E. McKenney Date: Tue May 1 13:35:20 2018 -0700 rcu: Convert rcu_quiescent_state_report tracepoint to ->gp_seq This commit makes the rcu_quiescent_state_report tracepoint use ->gp_seq instead of ->gpnum. Signed-off-by: Paul E. McKenney commit 865aa1e08d8aefdfd1f5d30ecfce1b8ef8cd520a Author: Paul E. McKenney Date: Tue May 1 13:35:20 2018 -0700 rcu: Convert rcu_unlock_preempted_task tracepoint to ->gp_seq This commit makes the rcu_unlock_preempted_task tracepoint use ->gp_seq instead of ->gpnum. Signed-off-by: Paul E. McKenney commit 598ce09480efb6b48799df60c66bac70bea5ef54 Author: Paul E. McKenney Date: Tue May 1 13:35:20 2018 -0700 rcu: Convert rcu_preempt_task tracepoint to ->gp_seq This commit makes the rcu_preempt_task tracepoint use ->gp_seq instead of ->gpnum. Signed-off-by: Paul E. McKenney commit 63d86a7e85f84b8ac3b2f394570965aedbb03787 Author: Paul E. McKenney Date: Tue May 1 13:08:46 2018 -0700 rcu: Convert rcu_grace_period_init tracepoint to gp_seq This commit makes the rcu_grace_period_init tracepoint use gp_seq instead of ->gpnum. Signed-off-by: Paul E. McKenney commit abd13fdd9516e5baae2257721b921684ecb090d3 Author: Paul E. McKenney Date: Tue May 1 13:08:46 2018 -0700 rcu: Convert rcu_future_grace_period tracepoint to gp_seq This commit makes the rcu_future_grace_period tracepoint use gp_seq instead of ->gpnum and ->completed. Signed-off-by: Paul E. McKenney commit 477351f7829d2268769c5d545511081555066529 Author: Paul E. McKenney Date: Tue May 1 12:54:11 2018 -0700 rcu: Convert rcu_grace_period tracepoint to gp_seq This commit makes the rcu_grace_period tracepoint use gp_seq instead of ->gpnum or ->completed. It also introduces a "cpuofl-bgp" string to less obscurely indicate when a CPU has gone offline while a grace period is waiting on it. Signed-off-by: Paul E. McKenney commit ab5e869c1f7aa30a1210f5e8a277758b0599609f Author: Paul E. McKenney Date: Tue May 1 11:07:23 2018 -0700 rcu: Make rcu_nocb_wait_gp() check if GP already requested This commit makes rcu_nocb_wait_gp() check rdp->gp_seq_needed to see if the current CPU already knows about the needed grace period having already been requested. If so, it avoids acquiring the corresponding leaf rcu_node structure's ->lock, thus decreasing contention. This optimization is intended for cases where either multiple leader rcuo kthreads are running on the same CPU or these kthreads are running on a non-offloaded (e.g., housekeeping) CPU. Signed-off-by: Paul E. McKenney [ paulmck: Move lock release past "if" as suggested by Joel Fernandes. ] [ paulmck: Fix caching of furthest-future requested grace period. ] commit 7a1d0f23ad70cd4813bf4b72735ea2c26a4f53fe Author: Paul E. McKenney Date: Tue May 1 10:26:57 2018 -0700 rcu: Move from ->need_future_gp[] to ->gp_seq_needed One problem with the ->need_future_gp[] array is that the grace-period assignment of each element changes as the grace periods complete. This means that it is necessary to hold a lock when checking this array to learn if a given grace period has already been requested. This increase lock contention, which is the opposite of helpful. This commit therefore replaces the ->need_future_gp[] with a single ->gp_seq_needed value and keeps it updated in the rcu_data structure. This will enable reliable lockless checking of whether or not a given grace period has already been requested. Signed-off-by: Paul E. McKenney commit fb2896a77989314ea89d89c3bdfee93002a760c9 Merge: 0bff2a86103e 3f3a89e1d7c3 Author: Wolfram Sang Date: Fri Jul 13 00:12:53 2018 +0200 Merge branch 'i2c/precise-locking-names_immutable' into i2c/for-4.19 commit 3f3a89e1d7c31558c070692241e3d6146d2cf1bf Author: Peter Rosin Date: Wed Jun 20 07:18:03 2018 +0200 i2c: remove i2c_lock_adapter and use i2c_lock_bus directly The i2c_lock_adapter name is ambiguous since it is unclear if it refers to the root adapter or the adapter you name in the argument. The natural interpretation is the adapter you name in the argument, but there are historical reasons for that not being the case; it in fact locks the root adapter. Just remove the function and force users to spell out the I2C_LOCK_ROOT_ADAPTER name to indicate what is really going on. Also remove i2c_unlock_adapter, of course. This patch was generated with git grep -l 'i2c_\(un\)\?lock_adapter' \ | xargs sed -i 's/i2c_\(un\)\?lock_adapter(\([^)]*\))/'\ 'i2c_\1lock_bus(\2, I2C_LOCK_ROOT_ADAPTER)/g' followed by white-space touch-up. Signed-off-by: Peter Rosin Acked-by: Jonathan Cameron Tested-by: Sekhar Nori Signed-off-by: Wolfram Sang commit 8c8f74f327a76604a499fad8c54c15e1c0ee8051 Author: Peter Rosin Date: Wed Jun 20 07:18:02 2018 +0200 mfd: 88pm860x-i2c: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Acked-by: Lee Jones Signed-off-by: Wolfram Sang commit 581733e619ad66908e02351f8a412d04149a2e90 Author: Peter Rosin Date: Wed Jun 20 07:18:01 2018 +0200 media: tda18271: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Acked-by: Mauro Carvalho Chehab Signed-off-by: Wolfram Sang commit 3e985b3dba460df87e679337a833522145556382 Author: Peter Rosin Date: Wed Jun 20 07:18:00 2018 +0200 media: tda1004x: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Acked-by: Mauro Carvalho Chehab Signed-off-by: Wolfram Sang commit dfecde407623b19cb9d57ebfa5abbca9741d96cb Author: Peter Rosin Date: Wed Jun 20 07:17:59 2018 +0200 media: rtl2830: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Acked-by: Mauro Carvalho Chehab Signed-off-by: Wolfram Sang commit c060a9fe07426dc030c9481493ad59b6459d7c46 Author: Peter Rosin Date: Wed Jun 20 07:17:58 2018 +0200 media: drxk_hard: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Acked-by: Mauro Carvalho Chehab Signed-off-by: Wolfram Sang commit b1e1ca27570016e3aa0e3265df699fea87013abc Author: Peter Rosin Date: Wed Jun 20 07:17:57 2018 +0200 media: af9013: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Acked-by: Mauro Carvalho Chehab Signed-off-by: Wolfram Sang commit 193c2a07cfaacb9249ab0e3d34bce32490879355 Author: Peter Rosin Date: Wed Jun 20 07:17:56 2018 +0200 input: rohm_bu21023: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Acked-by: Dmitry Torokhov Signed-off-by: Wolfram Sang commit f06c97dd50870c3ccdea0726617a729bb83f5d30 Author: Peter Rosin Date: Wed Jun 20 07:17:55 2018 +0200 i2c: mux: pca9541: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Signed-off-by: Wolfram Sang commit bb853aac2c478ce78116128263801189408ad2a8 Author: Peter Rosin Date: Wed Jun 20 07:17:54 2018 +0200 tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Reviewed-by: Jarkko Sakkinen Tested-by: Alexander Steffen Signed-off-by: Wolfram Sang commit d6488ac19aabcc6c85a74b69eaf1b7301124c323 Author: Gustavo A. R. Silva Date: Thu Jul 5 09:56:00 2018 -0500 PCI: Mark fall-through switch cases before enabling -Wimplicit-fallthrough In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Bjorn Helgaas commit 51bef926be1e3154996ce400d862aebb98ccbed6 Author: Arnd Bergmann Date: Wed Jul 11 14:29:53 2018 +0200 nfp: avoid using getnstimeofday64() getnstimeofday64 is deprecated in favor of the ktime_get() family of functions. The direct replacement would be ktime_get_real_ts64(), but I'm picking the basic ktime_get() instead: - using a ktime_t simplifies the code compared to timespec64 - using monotonic time instead of real time avoids issues caused by a concurrent settimeofday() or during a leap second adjustment. Acked-by: Jakub Kicinski Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 44c58899b09d6cbf113f50465215fc66258461df Author: Arnd Bergmann Date: Wed Jul 11 14:29:52 2018 +0200 liquidio: use ktime_get_real_ts64() instead of getnstimeofday64() The two do the same thing, but we want to have a consistent naming in the kernel. Signed-off-by: Arnd Bergmann Acked-by: Felix Manlunas Signed-off-by: David S. Miller commit aa667c6408d20a84c7637420bc3b7aa0abab59a2 Author: James Puthukattukaran Date: Mon Jul 9 11:31:25 2018 -0400 PCI: Workaround IDT switch ACS Source Validation erratum Some IDT switches incorrectly flag an ACS Source Validation error on completions for config read requests even though PCIe r4.0, sec 6.12.1.1, says that completions are never affected by ACS Source Validation. Here's the text of IDT 89H32H8G3-YC, erratum #36: Item #36 - Downstream port applies ACS Source Validation to Completions Section 6.12.1.1 of the PCI Express Base Specification 3.1 states that completions are never affected by ACS Source Validation. However, completions received by a downstream port of the PCIe switch from a device that has not yet captured a PCIe bus number are incorrectly dropped by ACS Source Validation by the switch downstream port. Workaround: Issue a CfgWr1 to the downstream device before issuing the first CfgRd1 to the device. This allows the downstream device to capture its bus number; ACS Source Validation no longer stops completions from being forwarded by the downstream port. It has been observed that Microsoft Windows implements this workaround already; however, some versions of Linux and other operating systems may not. When doing the first config read to probe for a device, if the device is behind an IDT switch with this erratum: 1. Disable ACS Source Validation if enabled 2. Wait for device to become ready to accept config accesses (by using the Config Request Retry Status mechanism) 3. Do a config write to the endpoint 4. Enable ACS Source Validation (if it was enabled to begin with) The workaround suggested by IDT is basically only step 3, but we don't know when the device is ready to accept config requests. That means we need to do config reads until we receive a non-Config Request Retry Status, which means we need to disable ACS SV temporarily. Signed-off-by: James Puthukattukaran [bhelgaas: changelog, clean up whitespace, fold in unused variable fix from Anders Roxell ] Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Williamson commit ccb06fba51149e3f0e0f3debcfc270a1e1460f08 Merge: cca9bab1b72c c749cdda9089 Author: David S. Miller Date: Thu Jul 12 14:54:12 2018 -0700 Merge branch 'net-sched-act_skbedit-lockless-data-path' Davide Caratti says: ==================== net/sched: act_skbedit: lockless data path the data path of act_skbedit can be faster if we avoid using spinlocks: - patch 1 converts act_skbedit statistics to use per-cpu counters - patch 2 lets act_skbedit use RCU to read/update its configuration test procedure (using pktgen from https://github.com/netoptimizer): # ip link add name eth1 type dummy # ip link set dev eth1 up # tc qdisc add dev eth1 clsact # tc filter add dev eth1 egress matchall action skbedit priority c1a0:c1a0 # for c in 1 2 4 ; do > ./pktgen_bench_xmit_mode_queue_xmit.sh -v -s 64 -t $c -n 5000000 -i eth1 > done test results (avg. pps/thread) $c | before patch | after patch | improvement ----+--------------+--------------+------------ 1 | 3917464 ± 3% | 4000458 ± 3% | irrelevant 2 | 3455367 ± 4% | 3953076 ± 1% | +14% 4 | 2496594 ± 2% | 3801123 ± 3% | +52% v2: rebased on latest net-next ==================== Signed-off-by: David S. Miller commit c749cdda9089eb1fdb6a9ab98f945124d12f2595 Author: Davide Caratti Date: Wed Jul 11 16:04:50 2018 +0200 net/sched: act_skbedit: don't use spinlock in the data path use RCU instead of spin_{,un}lock_bh, to protect concurrent read/write on act_skbedit configuration. This reduces the effects of contention in the data path, in case multiple readers are present. Signed-off-by: Davide Caratti Signed-off-by: David S. Miller commit 6f3dfb0dc831953187fea8e3b798768611441321 Author: Davide Caratti Date: Wed Jul 11 16:04:49 2018 +0200 net/sched: skbedit: use per-cpu counters use per-CPU counters, instead of sharing a single set of stats with all cores: this removes the need of spinlocks when stats are read/updated. Signed-off-by: Davide Caratti Signed-off-by: David S. Miller commit cca9bab1b72cd2296097c75f59ef11ef80461279 Author: Arnd Bergmann Date: Wed Jul 11 12:16:12 2018 +0200 tcp: use monotonic timestamps for PAWS Using get_seconds() for timestamps is deprecated since it can lead to overflows on 32-bit systems. While the interface generally doesn't overflow until year 2106, the specific implementation of the TCP PAWS algorithm breaks in 2038 when the intermediate signed 32-bit timestamps overflow. A related problem is that the local timestamps in CLOCK_REALTIME form lead to unexpected behavior when settimeofday is called to set the system clock backwards or forwards by more than 24 days. While the first problem could be solved by using an overflow-safe method of comparing the timestamps, a nicer solution is to use a monotonic clocksource with ktime_get_seconds() that simply doesn't overflow (at least not until 136 years after boot) and that doesn't change during settimeofday(). To make 32-bit and 64-bit architectures behave the same way here, and also save a few bytes in the tcp_options_received structure, I'm changing the type to a 32-bit integer, which is now safe on all architectures. Finally, the ts_recent_stamp field also (confusingly) gets used to store a jiffies value in tcp_synq_overflow()/tcp_synq_no_recent_overflow(). This is currently safe, but changing the type to 32-bit requires some small changes there to keep it working. Signed-off-by: Arnd Bergmann Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 7f8b99ac5f2f09c5d04b2290b5ea2d53e9a17480 Author: Ben Whitten Date: Fri Jun 15 14:40:50 2018 +0100 dt-bindings: add laird and giantec vendor prefix This adds a vendor prefix "laird" for Laird PLC who make CPU modules and system on chips. Also adds "giantec" for Giantec Semiconductor, Inc. who make eeprom memory used on Laird designs. Signed-off-by: Ben Whitten Reviewed-by: Rob Herring Signed-off-by: Alexandre Belloni commit d2bdd2681278d66fd34cd8e0cf724de918f429b2 Author: Vakul Garg Date: Wed Jul 11 14:32:20 2018 +0530 net/tls: Use aead_request_alloc/free for request alloc/free Instead of kzalloc/free for aead_request allocation and free, use functions aead_request_alloc(), aead_request_free(). It ensures that any sensitive crypto material held in crypto transforms is securely erased from memory. Signed-off-by: Vakul Garg Acked-by: Dave Watson Signed-off-by: David S. Miller commit aebc82644b2c8eafa15e8c481fbafc1b41f4fbf9 Author: Paul E. McKenney Date: Tue May 1 06:42:51 2018 -0700 rcutorture: Convert rcutorture_get_gp_data() to ->gp_seq SRCU has long used ->srcu_gp_seq, and now RCU uses ->gp_seq. This commit therefore moves the rcutorture_get_gp_data() function from a ->gpnum / ->completed pair to ->gp_seq. Signed-off-by: Paul E. McKenney commit 471f87c3d91bd0884451c0e3071473476c165630 Author: Paul E. McKenney Date: Mon Apr 30 13:09:17 2018 -0700 rcu: Make RCU CPU stall warnings use ->gp_seq This commit makes the RCU CPU stall-warning code in print_other_cpu_stall(), print_cpu_stall(), and check_cpu_stall() use ->gp_seq instead of ->gpnum and ->completed. Signed-off-by: Paul E. McKenney commit 29365e563b1e4e5bfde211280d37dc6127c019ed Author: Paul E. McKenney Date: Mon Apr 30 10:57:36 2018 -0700 rcu: Convert grace-period requests to ->gp_seq This commit converts the grace-period request code paths from ->completed and ->gpnum to ->gp_seq. The need_future_gp_element() macro encapsulates the shift operation required to use ->gp_seq as an index to the ->need_future_gp[] array. The rcu_cbs_completed() function is removed in favor of the rcu_seq_snap() function. The rcu_start_this_gp() gets some temporary consistency checks and uses rcu_seq_done(), rcu_seq_current(), rcu_seq_state(), and rcu_gp_in_progress() in place of the earlier open-coded comparisons of ->gpnum and ->completed. The rcu_future_gp_cleanup() function replaces use of ->completed with ->gp_seq. The rcu_accelerate_cbs() function replaces a call to rcu_cbs_completed() with one to rcu_seq_snap(). The rcu_advance_cbs() function replaces an access to >completed with one to ->gp_seq and adds some temporary warnings. The rcu_nocb_wait_gp() function replaces a call to rcu_cbs_completed() with one to rcu_seq_snap() and an open-coded comparison with rcu_seq_done(). The temporary warnings will be removed when the various ->gpnum and ->completed fields are removed. Their purpose is to locate code who might still be using ->gpnum and ->completed. (Much easier that way than trying to trace down the causes of too-short grace periods and grace-period hangs!) Signed-off-by: Paul E. McKenney commit d43a5d32e125db1e34641922e52baaa4fee3510a Author: Paul E. McKenney Date: Sat Apr 28 18:50:06 2018 -0700 rcu: Convert ->completedqs to ->gp_seq This commit switches the quiescent-state no-backtracking checks from ->gpnum and ->completed to ->gp_seq. Signed-off-by: Paul E. McKenney commit 8aa670cdacc1820cb0597e4b4b413ef91ede2dd9 Author: Paul E. McKenney Date: Sat Apr 28 14:15:40 2018 -0700 rcu: Convert ->rcu_iw_gpnum to ->gp_seq This commit switches the interrupt-disabled detection mechanism to ->gp_seq. This mechanism is used as part of RCU CPU stall warnings, and detects cases where the stall is due to a CPU having interrupts disabled. Signed-off-by: Paul E. McKenney commit ba04107fc901ddce49686944f7e038b4f0b0a359 Author: Paul E. McKenney Date: Fri Apr 27 21:25:01 2018 -0700 rcu: Move rcu_gp_in_progress() to ->gp_seq This commit makes rcu_gp_in_progress() use ->gp_seq instead of ->completed and ->gpnum. The READ_ONCE() invocations are buried in rcu_seq_current(). Signed-off-by: Paul E. McKenney commit e0da2374c3881cb9a512e2718f9ca655a48de9db Author: Paul E. McKenney Date: Fri Apr 27 20:51:36 2018 -0700 rcu: Move rcu_nocb_gp_get() to ->gp_seq This commit makes rcu_try_advance_all_cbs() use ->gp_seq. It uses rcu_seq_ctr() in order to shift away the state bits, so that the low-order bits of the result may safely be used to index ->nocb_gp_wq[]. Signed-off-by: Paul E. McKenney commit 03c8cb765a747c02fd8d3fade1efe9d529ad54bd Author: Paul E. McKenney Date: Fri Apr 27 19:56:16 2018 -0700 rcu: Move rcu_try_advance_all_cbs() to ->gp_seq This commit makes rcu_try_advance_all_cbs() use ->gp_seq, with the exception of tracing, which will be converted later. Signed-off-by: Paul E. McKenney commit e05720b0977bd50707ea6cf296f99e709de3f760 Author: Paul E. McKenney Date: Fri Apr 27 18:58:58 2018 -0700 rcu: Move rcu_implicit_dynticks_qs() to ->gp_seq This commit makes rcu_implicit_dynticks_qs() use ->gp_seq, with the exception of tracing, which will be converted later. Signed-off-by: Paul E. McKenney commit a66ae8ae35de60a85d2d89689d8c2d6a4dc15d85 Author: Paul E. McKenney Date: Fri Apr 27 18:06:08 2018 -0700 rcu: Convert rcu_gpnum_ovf() to ->gp_seq This commit converts rcu_gpnum_ovf() to use ->gp_seq instead of ->gpnum. Same size unsigned long, so same approach. Signed-off-by: Paul E. McKenney commit 67e14c1e39d2d956300b3d6ad00f7708e3285531 Author: Paul E. McKenney Date: Fri Apr 27 16:01:46 2018 -0700 rcu: Move RCU's grace-period-change code to ->gp_seq This commit moves __note_gp_changes(), note_gp_changes(), and __rcu_pending() to ->gp_seq, creating new rcu_seq_completed_gp() and rcu_seq_new_gp() functions for this purpose. Signed-off-by: Paul E. McKenney [ paulmck: Reinstate "cpuend: trace as suggested by Joel Fernandes. ] commit e4be81a2ed3a7356a2c22c7571af622ceb57eb2b Author: Paul E. McKenney Date: Fri Apr 27 15:16:50 2018 -0700 rcu: Convert conditional grace-period primitives to ->gp_seq This commit converts get_state_synchronize_rcu(), cond_synchronize_rcu(), get_state_synchronize_sched(), and cond_synchronize_sched() from ->gpnum and ->completed to ->gp_seq. Note that this also introduces a full memory barrier in the already-done paths off cond_synchronize_rcu() and cond_synchronize_sched(), as work with LKMM indicates that the earlier smp_load_acquire() were insufficiently strong in some situations where these two functions were called just as the grace period ended. In such cases, these two functions would not gain the benefit of memory ordering at the end of the grace period. Please note that the performance impact is negligible, as you shouldn't be using either function anywhere near a fastpath in any case. Signed-off-by: Paul E. McKenney commit c9a24e2d0c7d33b141167f5fa13f95cf6d35cb1e Author: Paul E. McKenney Date: Fri Apr 27 14:54:46 2018 -0700 rcu: Make quiescent-state reporting use ->gp_seq This commit switches the functions reporting quiescent states from use of ->gpnum to ->gp_seq. In either case, the point is to handle races where a given grace period ends before a quiescent state can be reported. Failing to catch these races would result in too-short grace periods, hence the checking. Signed-off-by: Paul E. McKenney commit 78c5a67f1788f59d991c8e78d674ad3c8542f0ac Author: Paul E. McKenney Date: Fri Apr 27 13:32:28 2018 -0700 rcu: Convert rcu_check_gp_kthread_starvation() to GP sequence number This commit switches rcu_check_gp_kthread_starvation() from printing ->gpnum and ->completed to printing ->gp_seq upon detecting a starving RCU grace-period kthread during an RCU CPU stall warning. Signed-off-by: Paul E. McKenney commit 17ef2fe97c8c8e754e4a702c42f8e5b0ffadf4dd Author: Paul E. McKenney Date: Fri Apr 27 11:39:34 2018 -0700 rcu: Make rcutorture's batches-completed API use ->gp_seq The rcutorture test invokes rcu_batches_started(), rcu_batches_completed(), rcu_batches_started_bh(), rcu_batches_completed_bh(), rcu_batches_started_sched(), and rcu_batches_completed_sched() to do grace-period consistency checks, and rcuperf uses the _completed variants for statistics. These functions use ->gpnum and ->completed. This commit therefore replaces them with rcu_get_gp_seq(), rcu_bh_get_gp_seq(), and rcu_sched_get_gp_seq(), adjusting rcutorture and rcuperf to make use of them. Signed-off-by: Paul E. McKenney commit dee4f42298bba030e84035aca5c114f9fee8fa6a Author: Paul E. McKenney Date: Thu Apr 26 15:30:28 2018 -0700 rcu: Move rcu_gp_slow() to ->gp_seq This commit moves rcu_gp_slow() to ->gp_seq. This function only uses the grace-period number to modulate delay, so rcu_seq_ctr(rsp->gp_seq) gets the same effect, at least in cases where the delay is to happen more than four times per wrap of an unsigned long. Signed-off-by: Paul E. McKenney commit de30ad512a668b56e7ad7a5a7c379d7c5d138a94 Author: Paul E. McKenney Date: Thu Apr 26 11:52:09 2018 -0700 rcu: Introduce grace-period sequence numbers This commit adds grace-period sequence numbers (->gp_seq) to the rcu_state, rcu_node, and rcu_data structures, and updates them. It also checks for consistency between rsp->gpnum and rsp->gp_seq. These ->gp_seq counters will eventually replace the existing ->gpnum and ->completed counters, allowing a single memory access to determine whether or not a grace period is in progress and if so, which one. This in turn will enable changes that will reduce ->lock contention on the leaf rcu_node structures. Signed-off-by: Paul E. McKenney commit 609af1cdf040f8d3f3986755586f7833eaa96d2c Merge: fcc635436501 18390aeae701 fd55a281adf6 605000376373 Author: Paul E. McKenney Date: Thu Jul 12 14:26:14 2018 -0700 Merge branches 'expedited.2018.07.12a', 'fixes.2018.07.12a', 'srcu.2018.06.25b' and 'torture.2018.06.25b' into HEAD expedited.2018.07.12a: Expedited grace-period updates. fixes.2018.07.12a: Pre-gp_seq miscellaneous fixes. srcu.2018.06.25b: SRCU updates. torture.2018.06.25b: Pre-gp_seq torture-test updates. commit 18390aeae7010ee56b132dcfb663ba362a099d99 Author: Paul E. McKenney Date: Sun Apr 22 15:06:05 2018 -0700 rcu: Make rcu_gp_cleanup() write only once to ->gp_flags At the end of rcu_gp_cleanup(), if another grace period is needed, but not via rcu_accelerate_cbs(), the ->gp_flags field is written twice, once when making the new grace-period request, and once when clearing all other types of requests. This commit therefore adds an else-clause to avoid this double write. Signed-off-by: Paul E. McKenney commit 26d950a9451336a6b5abc1c8ca6c21df58e8d89f Author: Paul E. McKenney Date: Sat Apr 21 20:44:11 2018 -0700 rcu: Diagnostics for grace-period startup hangs This commit causes a splat if RCU is idle and a request for a new grace period is ignored for more than one second. This splat normally indicates that some code path asked for a new grace period, but failed to wake up the RCU grace-period kthread. Signed-off-by: Paul E. McKenney [ paulmck: Fix bug located by Dan Carpenter and his static checker. ] [ paulmck: Fix self-deadlock bug located 0day test robot. ] [ paulmck: Disable unless CONFIG_PROVE_RCU=y. ] commit ea870bb2ae6cbc1a5ba1f3ec8c8fca921a51880b Author: Helge Deller Date: Thu Jul 12 22:29:16 2018 +0200 block: skd: Use %pad printk format for dma_addr_t values Use the existing %pad printk format to print dma_addr_t values. This avoids the following warnings when compiling on the parisc64 platform: drivers/block/skd_main.c: In function 'skd_preop_sg_list': drivers/block/skd_main.c:660:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'dma_addr_t {aka unsigned int}' [-Wformat=] Reviewed-by: Bart Van Assche Signed-off-by: Helge Deller Signed-off-by: Jens Axboe commit c6bb11147eb09bd39f316c6062455b88c905ab6e Merge: a8802d97e733 b061c7a513af Author: Thomas Gleixner Date: Thu Jul 12 22:19:58 2018 +0200 Merge branch 'fortglx/4.19/time' of https://git.linaro.org/people/john.stultz/linux into timers/core Pull timekeeping updates from John Stultz: - Make the timekeeping update more precise when NTP frequency is set directly by updating the multiplier. - Adjust selftests commit bb376673ee32c8aaac27c7599eb556db32869792 Author: Paul Menzel Date: Sun Jul 8 09:18:21 2018 +0200 ata: Only output sg element mapped number in verbose debug Defining `ATA_DEBUG` there are a lof of messages like below in the log. [ 16.345472] ata_sg_setup: 1 sg elements mapped As that is too verbose, only output these messages in verbose debug. Signed-off-by: Paul Menzel Signed-off-by: Tejun Heo commit 32a5342ac19ad07000cfe06e97acf9544cc7cf28 Author: Paul Menzel Date: Sun Jul 8 09:11:34 2018 +0200 ata: Guard ata_scsi_dump_cdb() by ATA_VERBOSE_DEBUG Defining `ATA_DEBUG` nothing can be really seen, as the log is spammed with CDB messages. Therefore, guard the print by `ATA_VERBOSE_DEBUG`. Signed-off-by: Paul Menzel Signed-off-by: Tejun Heo commit bd0038b1b4f499d814d8f33a55b1df5ea6cf3b85 Author: Corentin Labbe Date: Thu Jul 12 11:41:31 2018 +0000 ata: ahci_platform: convert kcalloc to devm_kcalloc Like phys, target_pwrs could be allocated with devm_ function Signed-off-by: Corentin Labbe Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit a4b9f5ed02e235132ca781dce77deb8cab177f36 Author: Corentin Labbe Date: Thu Jul 12 11:41:30 2018 +0000 ata: ahci_platform: convert kzallloc to kcalloc It's better to kcalloc instead of kzalloc(n * sizeof()) Signed-off-by: Corentin Labbe Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit 7cf5fc65f9efe0838fcea4e04f48bafa6ee6eae6 Author: Corentin Labbe Date: Thu Jul 12 11:41:29 2018 +0000 ata: ahci_platform: correct parameter documentation for ahci_platform_shutdown The documentation about parameter for ahci_platform_shutdown has a typo. This fix the following build warning: drivers/ata/libahci_platform.c:693: warning: Function parameter or member 'pdev' not described in 'ahci_platform_shutdown' drivers/ata/libahci_platform.c:693: warning: Excess function parameter 'dev' description in 'ahci_platform_shutdow Signed-off-by: Corentin Labbe Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo commit e96a31cee962d766409d7da25d1831b3348b0a61 Author: Felix Siegel Date: Thu Jul 12 21:27:14 2018 +0200 staging: gasket: fix multi line comments style This patch fixes checkpatch.pl warnings: WARNING: Block comments should align the * on each line Signed-off-by: Felix Siegel Signed-off-by: Greg Kroah-Hartman commit 5c60ce7b6ae9a056ddcdee318142b60c0e09aed1 Author: Felix Siegel Date: Thu Jul 12 21:27:13 2018 +0200 staging: gasket: Move open-curly brace to match kernel code style Move open open-curly brace to the next line following function definition to match the kernel's coding style Signed-off-by: Felix Siegel Signed-off-by: Greg Kroah-Hartman commit 24daa451c2814e770c6d6b6c00a065cb5b8b22fd Author: Roman Kiryanov Date: Wed Jul 11 16:37:48 2018 -0700 staging: goldfish: add a blank line into struct goldfish_audio To separate data members and the comment for better readability. Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 683a060a1d975bb440d70662fbdb6f4879ad56ae Author: Roman Kiryanov Date: Wed Jul 11 16:36:28 2018 -0700 staging: goldfish: fix whitespace in goldfish_audio Linux kernel coding style: spaces are never used for indentation. Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 11ac66a379091ce425a456e1a714066f255f38f8 Author: Roman Kiryanov Date: Wed Jul 11 13:23:57 2018 -0700 staging: goldfish: Remove references to the retired driver from README The goldfish nand driver was retired (not used). Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 1ba60ad56c409f23ac244adb7734208e53f8a985 Author: Wei Yongjun Date: Wed Jul 11 13:15:54 2018 +0000 staging: pi433: fix error return code in pi433_probe() Fix to return a negative error code from the kthread_run() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Signed-off-by: Greg Kroah-Hartman commit 191c6a97a742d19dc2f4689d43f45168573dbe5a Author: Greg Kroah-Hartman Date: Wed Jul 11 13:39:12 2018 +0200 staging: gasket: remove TODO item about SPDX usage Now that the files are all properly tagged with SPDX lines, and the boilerplate license text is gone, remove the TODO item. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit bf9c7a8673831acd67ad4a92b6acd85ffcde174c Author: Greg Kroah-Hartman Date: Wed Jul 11 13:39:11 2018 +0200 staging: gasket: remove redundant license information Now that the SPDX tag is in all gasket files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit 2dec0644e0c8083e0a9d3bbdd11aad2d850859e9 Author: Greg Kroah-Hartman Date: Wed Jul 11 13:39:10 2018 +0200 staging: gasket: add SPDX identifiers to all files. It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Fix up the all of the staging gasket files to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Cc: Rob Springer Cc: John Joseph Cc: Ben Chan Signed-off-by: Greg Kroah-Hartman commit fcc63543650150629c8a873cbef3578770acecd9 Author: Boqun Feng Date: Fri Jun 15 12:06:31 2018 -0700 rcu: Make expedited GPs handle CPU 0 being offline Currently, the parallelized initialization of expedited grace periods uses the workqueue associated with each rcu_node structure's ->grplo field. This works fine unless that CPU is offline. This commit therefore uses the CPU corresponding to the lowest-numbered online CPU, or just queues the work on WORK_CPU_UNBOUND if there are no online CPUs corresponding to this rcu_node structure. Note that this patch uses cpu_is_offline() instead of the usual approach of checking bits in the rcu_node structure's ->qsmaskinitnext field. This is safe because preemption is disabled across both the cpu_is_offline() check and the call to queue_work_on(). Signed-off-by: Boqun Feng [ paulmck: Disable preemption to close offline race window. ] Signed-off-by: Paul E. McKenney [ paulmck: Apply Peter Zijlstra feedback on CPU selection. ] Tested-by: Aneesh Kumar K.V commit a8802d97e73346bc81609df9dfba7d3306f40d87 Author: Eric Dumazet Date: Wed Jul 11 11:16:41 2018 -0700 ktime: Provide typesafe ktime_to_ns() Using ktime_to_ns() is nice to help backports to stable kernels. Having a typesafe function instead of a macro avoid stupid typos and waste of time tracking these typos. Reported-by: Willem de Bruijn Signed-off-by: Eric Dumazet Signed-off-by: Thomas Gleixner Cc: Eric Dumazet Cc: John Stultz Cc: Peter Zijlstra Cc: Linus Torvalds Link: https://lkml.kernel.org/r/20180711181641.10369-1-edumazet@google.com commit cba54f9cf4ec1126dde5576e025691c27f669d85 Author: Pieter Jansen van Vuuren Date: Tue Jul 10 18:22:31 2018 -0700 tc-testing: add geneve options in tunnel_key unit tests Extend tc tunnel_key action unit tests with geneve options. Tests include testing single and multiple geneve options, as well as testing geneve options that are expected to fail. Signed-off-by: Pieter Jansen van Vuuren Acked-by: Lucas Bates Signed-off-by: David S. Miller commit 2989360d9c6669d8ae64edc933088e640481b48b Author: Reinette Chatre Date: Wed Jul 11 13:06:07 2018 -0700 x86/intel_rdt: Fix possible circular lock dependency Lockdep is reporting a possible circular locking dependency: ====================================================== WARNING: possible circular locking dependency detected 4.18.0-rc1-test-test+ #4 Not tainted ------------------------------------------------------ user_example/766 is trying to acquire lock: 0000000073479a0f (rdtgroup_mutex){+.+.}, at: pseudo_lock_dev_mmap but task is already holding lock: 000000001ef7a35b (&mm->mmap_sem){++++}, at: vm_mmap_pgoff+0x9f/0x which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&mm->mmap_sem){++++}: _copy_to_user+0x1e/0x70 filldir+0x91/0x100 dcache_readdir+0x54/0x160 iterate_dir+0x142/0x190 __x64_sys_getdents+0xb9/0x170 do_syscall_64+0x86/0x200 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&sb->s_type->i_mutex_key#3){++++}: start_creating+0x60/0x100 debugfs_create_dir+0xc/0xc0 rdtgroup_pseudo_lock_create+0x217/0x4d0 rdtgroup_schemata_write+0x313/0x3d0 kernfs_fop_write+0xf0/0x1a0 __vfs_write+0x36/0x190 vfs_write+0xb7/0x190 ksys_write+0x52/0xc0 do_syscall_64+0x86/0x200 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (rdtgroup_mutex){+.+.}: __mutex_lock+0x80/0x9b0 pseudo_lock_dev_mmap+0x2f/0x170 mmap_region+0x3d6/0x610 do_mmap+0x387/0x580 vm_mmap_pgoff+0xcf/0x110 ksys_mmap_pgoff+0x170/0x1f0 do_syscall_64+0x86/0x200 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: rdtgroup_mutex --> &sb->s_type->i_mutex_key#3 --> &mm->mmap_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_sem); lock(&sb->s_type->i_mutex_key#3); lock(&mm->mmap_sem); lock(rdtgroup_mutex); *** DEADLOCK *** 1 lock held by user_example/766: #0: 000000001ef7a35b (&mm->mmap_sem){++++}, at: vm_mmap_pgoff+0x9f/0x110 rdtgroup_mutex is already being released temporarily during pseudo-lock region creation to prevent the potential deadlock between rdtgroup_mutex and mm->mmap_sem that is obtained during device_create(). Move the debugfs creation into this area to avoid the same circular dependency. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/fffb57f9c6b8285904c9a60cc91ce21591af17fe.1531332480.git.reinette.chatre@intel.com commit 7a6e55375d5c584c7c11cfdcaa8ad9d6cccb419d Author: Geert Uytterhoeven Date: Thu Jul 12 16:41:18 2018 +0200 hrtimer: Improve kernel message printing - Join split message for easier grepping, - Use pr_*() instead of printk*(), - Use %u to format unsigned cpu numbers. Signed-off-by: Geert Uytterhoeven Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180712144118.8819-1-geert+renesas@glider.be commit fed0b1bd1b64a680874e8cfa4c3da8dfc01e143f Author: Colin Ian King Date: Wed Jul 11 09:33:12 2018 +0100 rtc: m48t59: remove redundant pointer 'name' Pointer 'name' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'name' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Alexandre Belloni commit 6fd066604123ed4ab71aefe797d35996655c5eb1 Merge: b103cbe0d721 8c9602d38c72 Author: Daniel Borkmann Date: Thu Jul 12 20:45:23 2018 +0200 Merge branch 'bpf-arm-jit-improvements' Russell King says: ==================== This series improves the ARM BPF JIT compiler by: - enumerating the stack layout rather than using constants that happen to be multiples of four - rejig the BPF "register" accesses to use negative numbers instead of positive, which could be confused with register numbers in the bpf2a32 array. - since we maintain the ARM FP register as a pointer to the top of our scratch space (or, with frame pointers enabled, a valid ARM frame pointer register), we can access our scratch space using FP, which is constant across all BPF programs, including tail-called programs. - use immediate forms of ARM instructions where possible, rather than first loading the immediate into an ARM register. - use load-with-shift instruction rather than seperate shift instruction followed by load - avoid reloading index and array in the tail-call code - use double-word load/store instructions where available Version 2: - Fix ARMv5 test pointed out by Olof - Fix build error found by 0-day (adding an additional patch) ==================== Signed-off-by: Daniel Borkmann commit 8c9602d38c7262664c31332101f540c1e179797d Author: Russell King Date: Wed Jul 11 10:32:38 2018 +0100 ARM: net: bpf: use double-word load/stores where available Use double-word load and stores where support for this instruction is supported by the CPU architecture. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit bef8968df8a6e3eb91081d68affc64b8d87d5721 Author: Russell King Date: Wed Jul 11 10:32:33 2018 +0100 ARM: net: bpf: always use odd/even register pair Always use an odd/even register pair for our 64-bit registers, so that we're able to use the double-word load/store instructions in the future. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit b50452299864fbc00a576241e1490541c8754d50 Author: Russell King Date: Wed Jul 11 10:32:28 2018 +0100 ARM: net: bpf: avoid reloading 'array' Rearranging the order of the initial tail call code a little allows is to avoid reloading the 'array' pointer. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit aaffd2f5c3d58f154ca7b3d104a2ee6b6e40bc6b Author: Russell King Date: Wed Jul 11 10:32:22 2018 +0100 ARM: net: bpf: avoid reloading 'index' Avoid reloading 'index' after we have validated it - it remains in tmp2[1] up to the point that we begin the code to index the pointer array, so with a little rearrangement of the registers, we can use the already loaded value. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit 2b6958ef1151452cb2160fde75a5c5382b512c34 Author: Russell King Date: Wed Jul 11 10:32:17 2018 +0100 ARM: net: bpf: use ldr instructions with shifted rm register Rather than pre-shifting the rm register for the ldr in the tail call, shift it in the load instruction. This eliminates one unnecessary instruction. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit 828e2b90e8e9b5bd844a25f22ceeb8df4dd18b07 Author: Russell King Date: Wed Jul 11 10:32:12 2018 +0100 ARM: net: bpf: use immediate forms of instructions where possible Rather than moving constants to a register and then using them in a subsequent instruction, use them directly in the desired instruction cutting out the "middle" register. This removes two instructions from the tail call code path. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit 1ca3b17b777c4136f9dba0195e13502c445f4ade Author: Russell King Date: Wed Jul 11 10:32:07 2018 +0100 ARM: net: bpf: imm12 constant conversion Provide a version of the imm8m() function that the compiler can optimise when used with a constant expression. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit 96cced4e774a2728710c8f8f48441fc7b29d6177 Author: Russell King Date: Wed Jul 11 10:32:02 2018 +0100 ARM: net: bpf: access eBPF scratch space using ARM FP register Access the eBPF scratch space using the frame pointer rather than our stack pointer, as the offsets from the ARM frame pointer are constant across all eBPF programs. Since we no longer reference the scratch space registers from the stack pointer, this simplifies emit_push_r64() as it no longer needs to know how many words are pushed onto the stack. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit a6eccac507e5e4aed63fb23320fcadeb253c2af6 Author: Russell King Date: Wed Jul 11 10:31:57 2018 +0100 ARM: net: bpf: 64-bit accessor functions for BPF registers Provide a couple of 64-bit register accessors, and use them where appropriate Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit 7a9870256361d4a36cb42e0301540256bb4b864e Author: Russell King Date: Wed Jul 11 10:31:52 2018 +0100 ARM: net: bpf: provide accessor functions for BPF registers Many of the code paths need to have knowledge about whether a register is stacked or in a CPU register. Move this decision making to a pair of helper functions instead of having it scattered throughout the code. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit 47b9c3bf416d80515901469f05aef2870b37c010 Author: Russell King Date: Wed Jul 11 10:31:47 2018 +0100 ARM: net: bpf: remove is_on_stack() and sstk/dstk The decision about whether a BPF register is on the stack or in a CPU register is detected at the top BPF insn processing level, and then percolated throughout the remainder of the code. Since we now use negative register values to represent stacked registers, we can detect where a BPF register is stored without restoring to carrying this additional metadata through all code paths. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit 1c35ba122d4a4eb32c3f8d63a445c1ebfd66d7bc Author: Russell King Date: Wed Jul 11 10:31:41 2018 +0100 ARM: net: bpf: use negative numbers for stacked registers Use negative numbers for eBPF registers that live on the stack. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit a8ef95a034233190b1dd73ff03472ff0f7f4fbdf Author: Russell King Date: Wed Jul 11 10:31:36 2018 +0100 ARM: net: bpf: provide load/store ops with negative immediates Provide a set of load/store opcode generators that work with negative immediates as well as positive ones. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit d449ceb11b3884770c06e71cf15edc9f3b4c9b05 Author: Russell King Date: Wed Jul 11 10:31:31 2018 +0100 ARM: net: bpf: enumerate the JIT scratch stack layout Enumerate the contents of the JIT scratch stack layout used for storing some of the JITs 64-bit registers, tail call counter and AX register. Signed-off-by: Russell King Signed-off-by: Daniel Borkmann commit b9cfb3d1200bcfd4b275f65fa84b2348560b9e30 Author: Johan Hovold Date: Wed Jul 4 11:05:58 2018 +0200 rtc: omap: drop unnecessary register unlock around reads Drop unnecessary register write-unlock around two read accesses. Signed-off-by: Johan Hovold Signed-off-by: Alexandre Belloni commit 4425070a5cfe634bc8e5657ff819a7a0c2d39d33 Author: Johan Hovold Date: Wed Jul 4 11:05:57 2018 +0200 rtc: omap: add missing register lock in error path For completeness re-lock the registers also in the power-off error path. Signed-off-by: Johan Hovold Signed-off-by: Alexandre Belloni commit 551757eb052986ec81cebcc6301cc1c4f8dca938 Author: Johan Hovold Date: Wed Jul 4 11:05:56 2018 +0200 rtc: omap: fix resource leak in registration error path Make sure to deregister the pin controller in case rtc registration fails. Fixes: 57072758623f ("rtc: omap: switch to rtc_register_device") Cc: stable # 4.14 Cc: Alexandre Belloni Signed-off-by: Johan Hovold Signed-off-by: Alexandre Belloni commit 5c8b84f410b3819d14cb1ebf32e4b3714b5a6e0b Author: Johan Hovold Date: Wed Jul 4 11:05:55 2018 +0200 rtc: omap: fix potential crash on power off Do not set the system power-off callback and omap power-off rtc pointer until we're done setting up our device to avoid leaving stale pointers around after a late probe error. Fixes: 97ea1906b3c2 ("rtc: omap: Support ext_wakeup configuration") Cc: stable # 4.9 Cc: Marcin Niestroj Cc: Tony Lindgren Signed-off-by: Johan Hovold Acked-by: Tony Lindgren Reviewed-by: Marcin Niestroj Signed-off-by: Alexandre Belloni commit 4936084c2ee227524c242d790a9fbad7650320c7 Author: Joshua Kinard Date: Sat Nov 18 23:00:51 2017 -0500 MIPS: Cleanup R10000_LLSC_WAR logic in atomic.h This patch reduces down the conditionals in MIPS atomic code that deal with a silicon bug in early R10000 cpus that required a workaround of a branch-likely instruction following a store-conditional in order to to guarantee the whole ll/sc sequence is atomic. As the only real difference is a branch-likely instruction (beqzl) over a standard branch (beqz), the conditional is reduced down to a single preprocessor check at the top to pick the required instruction. This requires writing the uses in assembler, thus we discard the non-R10000 case that uses a mixture of a C do...while loop with embedded assembler that was added back in commit 7837314d141c ("MIPS: Get rid of branches to .subsections."). A note found in the git log for commit 5999eca25c1f ("[MIPS] Improve branch prediction in ll/sc atomic operations.") is also addressed. The macro definition for the branch instruction and the code comment derives from a patch sent in earlier by Paul Burton for various cmpxchg cleanups. [paul.burton@mips.com: - Minor whitespace fix for checkpatch.] Signed-off-by: Joshua Kinard Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/17736/ Cc: Ralf Baechle Cc: James Hogan Cc: "Maciej W. Rozycki" Cc: linux-mips@linux-mips.org commit 2b4f07e99e97b3035ce354dd38010b92c34f6bb0 Author: Colin Ian King Date: Sun Jun 24 11:38:03 2018 +0100 rtc: test: make array pdev static The array pdev is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'pdev' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Alexandre Belloni commit 1a990fefb641398fb580a0ea0be99b0ff27cbb9b Author: Baruch Siach Date: Thu Jun 21 20:40:23 2018 +0300 rtc: armada38x: reset after rtc power loss When the RTC block looses power it needs a reset sequence to make it usable again. Otherwise, writes to the time register have no effect. This reset sequence combines information from the mvebu_rtc driver in the Marvell provided U-Boot, and the SolidRun provided U-Boot repo. Tested on the Armada 388 based SolidRun Clearfog Base. Signed-off-by: Baruch Siach Acked-by: Gregory CLEMENT Signed-off-by: Alexandre Belloni commit a0a5ac3ce8fe6bf26694f49f9ba42ed859487424 Author: Joshua Kinard Date: Sat Nov 18 22:29:56 2017 -0500 MIPS: Fix delay slot bug in `atomic*_sub_if_positive' for R10000_LLSC_WAR This patch fixes an old bug in MIPS ll/sc atomics, in the `atomic_sub_if_positive' and `atomic64_sub_if_positive' functions, for the R10000_LLSC_WAR case where the result of the subu/dsubu instruction would potentially not be made available to the sc/scd instruction due to being in the delay-slot of the branch-likely (beqzl) instruction. This also removes the need for the `noreorder' directive, allowing GAS to use delay slot scheduling as needed. The same fix is also applied to the standard branch (beqz) case in preparation for a follow-up patch that will cleanup/merge the R10000_LLSC_WAR and non-R10K sections together. Signed-off-by: Joshua Kinard Signed-off-by: Paul Burton Tested-by: Joshua Kinard Patchwork: https://patchwork.linux-mips.org/patch/17735/ Cc: Ralf Baechle Cc: James Hogan Cc: "Maciej W. Rozycki" Cc: linux-mips@linux-mips.org commit 77c56fd3c8cf5adcba9cffcc29ead295211bdae8 Author: Arnd Bergmann Date: Mon Jul 9 17:20:29 2018 +0200 drm/tinydrm: add backlight dependency for ili9341 This tinydrm driver fails to link without the backlight support: drivers/gpu/drm/tinydrm/ili9341.o: In function `ili9341_probe': ili9341.c:(.text+0x578): undefined reference to `devm_of_find_backlight' Fixes: 3fa0e8f6f960 ("drm/tinydrm: new driver for ILI9341 display panels") Signed-off-by: Arnd Bergmann Acked-by: Noralf Trønnes Signed-off-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20180709152106.990066-1-arnd@arndb.de commit cc4aecc5b724b47df65ef3e218ac7d73d2ee4e09 Author: Sudeep Holla Date: Wed Jul 11 16:17:39 2018 +0100 misc: vexpress/syscfg: Use devm_ioremap_resource() to map memory Instead of checking the return value of platform_get_resource(), we can use devm_ioremap_resource() which has the NULL pointer check and the memory region requesting. devm_ioremap_resource is designed to replace calls to devm_request_mem_region followed by devm_ioremap, so let's use the same. Cc: Lorenzo Pieralisi Acked-by: Liviu Dudau Signed-off-by: Sudeep Holla commit b103cbe0d7218d9633fe59965038ae23825b5d99 Merge: 671dffa7de7b 86f7d85cec9e Author: Daniel Borkmann Date: Thu Jul 12 18:55:54 2018 +0200 Merge branch 'bpf-helper-man-install' Quentin Monnet says: ==================== The three patches in this series are related to the documentation for eBPF helpers. The first patch brings minor formatting edits to the documentation in include/uapi/linux/bpf.h, and the second one updates the related header file under tools/. The third patch adds a Makefile under tools/bpf for generating the documentation (man pages) about eBPF helpers. The targets defined in this file can also be called from the bpftool directory (please refer to relevant commit logs for details). ==================== Signed-off-by: Daniel Borkmann commit 86f7d85cec9e1dba735ac5bd4b751b1908fedf80 Author: Quentin Monnet Date: Thu Jul 12 12:52:24 2018 +0100 tools: bpf: build and install man page for eBPF helpers from bpftool/ Provide a new Makefile.helpers in tools/bpf, in order to build and install the man page for eBPF helpers. This Makefile is also included in the one used to build bpftool documentation, so that it can be called either on its own (cd tools/bpf && make -f Makefile.helpers) or from bpftool directory (cd tools/bpf/bpftool && make doc, or cd tools/bpf/bpftool/Documentation && make helpers). Makefile.helpers is not added directly to bpftool to avoid changing its Makefile too much (helpers are not 100% directly related with bpftool). But the possibility to build the page from bpftool directory makes us able to package the helpers man page with bpftool, and to install it along with bpftool documentation, so that the doc for helpers becomes easily available to developers through the "man" program. Cc: linux-man@vger.kernel.org Suggested-by: Daniel Borkmann Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 9b8ca3795199f333269859b0c8393f810b9616a3 Author: Quentin Monnet Date: Thu Jul 12 12:52:23 2018 +0100 tools: bpf: synchronise BPF UAPI header with tools Update with latest changes from include/uapi/linux/bpf.h header. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 2bae79d2d38f3dc50bfef81d3b4f7328b2883a17 Author: Quentin Monnet Date: Thu Jul 12 12:52:22 2018 +0100 bpf: fix documentation for eBPF helpers Minor formatting edits for eBPF helpers documentation, including blank lines removal, fix of item list for return values in bpf_fib_lookup(), and missing prefix on bpf_skb_load_bytes_relative(). Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit b7178ffe7eb86fb9d428801509a5bd54d3ba94da Author: Maxime Ripard Date: Thu Jul 12 10:08:18 2018 +0200 drm/sun4i: tcon-top: Fix return type warning When commit af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling") was merged, the error handling path of the of_property_match_string was changed to take into account the fact that the returned value of that function wasn't an error pointer but an error code. Unfortunately, this introduced a warning since the now returned value is an integer, while the sun8i_tcon_top_register_gate function should return an error pointer. Fix that by calling ERR_PTR. Cc: Jernej Skrabec Cc: Chen-Yu Tsai Fixes: af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling") Reviewed-by: Daniel Vetter Reported-by: kbuild test robot Reported-by: Stephen Rothwell Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180712080818.3571-1-maxime.ripard@bootlin.com commit f88c5ee77496886071e76b5b9fdfee7158f6d079 Author: Jernej Skrabec Date: Fri Jul 6 18:47:32 2018 +0200 drm/sun4i: Implement zpos for DE2 Initial implementation of DE2 planes only supported fixed zpos. Expand implementation with configurable zpos property. Implementation background: Channel in DE2 driver represents one DRM plane, whereas pipe is just mapped channel to known Z position. Pipe 0 will always be at the bottom, pipe 1 just above pipe 0 and so on. If, for example, channel 1 is mapped at pipe 0 and channel 0 at pipe 1, whatever is on channel 0 will appear on top. Before this commit, channel id was used for addressing channel related registers (prefixed with SUN8I_MIXER_CHAN_UI_ or SUN8I_MIXER_CHAN_VI_) and pipe registers (prefixed with SUN8I_MIXER_BLEND_). Additionally, register SUN8I_MIXER_BLEND_ROUTE, which takes care for mapping channels to pipes had fixed value. It mapped channel 0 to pipe 0, 1 to 1 and so on. Consequence of all that was fixed Z order of planes. With this commit, pipe registers are using zpos property as index and channel related registers still use channel id as index. Pipe mapping register is now set dynamically too and pipe enable register is rebuild every time to make sure only active pipes are enabled. Testing was done to confirm that there is no issues if bottom plane contains pixels with alpha value < 0xff and if it doesn't whole screen. Tested-by: Paul Kocialkowski Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180706164732.24166-1-jernej.skrabec@siol.net commit b5d69129ea2b86d8a357efe3eca664b44860406e Author: Thomas Bogendoerfer Date: Thu Jul 12 15:42:55 2018 +0200 mips/jazz: provide missing dma_mask/coherent_dma_mask Commit 205e1b7f51e4 ("dma-mapping: warn when there is no coherent_dma_mask") introduced a warning, if a device is missing a coherent_dma_mask. ESP and sonic are using dma mapping functions, so they need dma masks. [paul.burton@mips.com: - Wrap commit message.] Signed-off-by: Thomas Bogendoerfer Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19828/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit d5dc0f43f268bf2b6bb61f109a18a652a49c6f4e Author: Ramalingam C Date: Thu Jun 28 19:04:49 2018 +0530 drm/i915/gmbus: Enable burst read Support for Burst read in HW is added for HDCP2.2 compliance requirement. This patch enables the burst read for all the gmbus read of more than 511Bytes, on capable platforms. v2: Extra line is removed. v3: Macro is added for detecting the BURST_READ Support [Jani] Runtime detection of the need for burst_read [Jani] Calculation enhancement. v4: GMBUS0 reg val is passed from caller [ville] Removed a extra var [ville] Extra brackets are removed [ville] Implemented the handling of 512Bytes Burst Read. v5: Burst read max length is fixed at 767Bytes [Ville] v6: Collecting the received reviewed-by. Signed-off-by: Ramalingam C Reviewed-by: Ville Syrjälä Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1530192889-5789-3-git-send-email-ramalingam.c@intel.com commit 73675cf6979bb80534641b1814a971eaf9f649b5 Author: Ramalingam C Date: Thu Jun 28 19:04:48 2018 +0530 drm/i915/gmbus: Increase the Bytes per Rd/Wr Op GMBUS HW supports 511Bytes as Max Bytes per single RD/WR op. Instead of enabling the 511Bytes per RD/WR cycle on legacy platforms for no absolute ROIs, this change allows the max bytes per op upto 511Bytes from Gen9 onwards. v2: No Change. v3: Inline function for max_xfer_size and renaming of the macro.[Jani] v4: Extra brackets removed [ville] Commit msg is modified. v5: Collecting the Reviewed-By received. Cc: Jani Nikula Cc: Chris Wilson Signed-off-by: Ramalingam C Reviewed-by: Jani Nikula Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1530192889-5789-2-git-send-email-ramalingam.c@intel.com commit 2abc77af89e17582db9039293c8ac881c8c96d79 Author: Al Viro Date: Thu Jul 12 11:18:42 2018 -0400 new helper: open_with_fake_path() open a file by given inode, faking ->f_path. Use with shitloads of caution - at the very least you'd damn better make sure that some dentry alias of that inode is pinned down by the path in question. Again, this is no general-purpose interface and I hope it will eventually go away. Right now overlayfs wants something like that, but nothing else should. Any out-of-tree code with bright idea of using this one *will* eventually get hurt, with zero notice and great delight on my part. I refuse to use EXPORT_SYMBOL_GPL(), especially in situations when it's really EXPORT_SYMBOL_DONT_USE_IT(), but don't take that export as "you are welcome to use it". Signed-off-by: Al Viro commit 701c5e73b296f93e3d07af663f354e859be4f1f7 Author: Jisheng Zhang Date: Thu Jul 12 09:59:40 2018 +0800 serial: 8250_dw: add fractional divisor support For Synopsys DesignWare 8250 uart which version >= 4.00a, there's a valid divisor latch fraction register. The fractional divisor width is 4bits ~ 6bits. Now the preparation is done, it's easy to add the feature support. This patch firstly tries to get the fractional divisor width during probe, then setups dw specific get_divisor() and set_divisor() hook. Signed-off-by: Jisheng Zhang Reviewed-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit 6226e5f31a786b58f33781852c897ac32a325ce6 Author: Jisheng Zhang Date: Thu Jul 12 09:58:14 2018 +0800 serial: 8250: export serial8250_do_set_divisor() Some drivers could call serial8250_do_set_divisor() to complete its own set_divisor routine. Export this symbol for code reusing. Signed-off-by: Jisheng Zhang Reviewed-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit 0238d2b4a4c7bb1b2268e1ef789629878e16ab02 Author: Jisheng Zhang Date: Thu Jul 12 09:57:00 2018 +0800 serial: 8250: introduce get_divisor() and set_divisor() hook Add these two hooks so that they can be overridden with driver specific implementations. Signed-off-by: Jisheng Zhang Reviewed-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit 42ac03213b7f102682157c2821e3fd9657ce4eb7 Author: Rodrigo Siqueira Date: Thu Jul 12 10:41:02 2018 -0300 drm/vkms: Add framebuffer and plane helpers This patch appends the minimum helpers related to framebuffer and plane to make vkms minimally usable. Changes since V1: - None Changes since V2: - Squash "Add plane helper struct" and "Add helper for framebuffer create" Changes since V3: Daniel Vetter: - Remove atomic_check from plane helper Signed-off-by: Rodrigo Siqueira Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/d37807da7d3b39444b4c9abb149fe3c518d07c61.1531402095.git.rodrigosiqueiramelo@gmail.com commit 5151e2b578e92f88d676ad78d36a2ef93d0a0dea Author: Tomas Winkler Date: Thu Jul 12 17:10:10 2018 +0300 mei: fix ssize_t to int assignment in read and write ops. Use ssize_t for rets variables in mei_write(), mei_read(), and mei_cl_write() as well as change the return type of mei_cl_write() to ssize_t, to prevent assignment of possible 64bit size_t to int 32 bit variable. As by product also eliminate warning drivers/misc/mei/client.c:1702:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 44c98df01851c0d5941b06c60d1bd092bac088c3 Author: Tomas Winkler Date: Thu Jul 12 17:10:09 2018 +0300 mei: use correct type for counter variable in for loops In for loops use same type for counter variable as has the limiting variable. drivers/misc/mei/bus-fixup.c:489:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/misc/mei/hw-txe.c:725:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/misc/mei/hw-txe.c:744:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit de8774371cdc4c18cd118490e0d61eccd5f2c4d8 Author: Tomas Winkler Date: Thu Jul 12 17:10:08 2018 +0300 mei: check for error returned from mei_hbuf_empty_slots() mei_hbuf_empty_slots() may return with an error in case of circular buffer overflow. This type of error may be caused only by a bug. However currently, the error won't be detected due signed type promotion in comparison to u32. We add explicit check for less then zero and explicit cast in comparison to suppress singn-compare warning. Reported-by: Dan Carpenter Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit a63983f26008804e8db12457e429e5fc18841894 Author: Michał Winiarski Date: Thu Jul 12 12:20:13 2018 +0100 drm/i915/selftests: Fixup GuC FW negative test Since: 0d4b78b3d2c0 ("drm/i915/guc: Assert we have the doorbell before setting it up") We have asserts in GuC doorbell related functions, which is a good thing. Unfortunately, we were using those to check whether GuC FW is refusing to allocate invalid doorbell - which makes the test fail. Well, it would make the test WARN, except we fumbled cleanup ordering and eat the BUG_ON instead. Let's keep the asserts and use the internal implementation in the test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107186 Signed-off-by: Michał Winiarski Cc: Chris Wilson Cc: Michel Thierry Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180712112013.3253-1-chris@chris-wilson.co.uk Signed-off-by: Chris Wilson commit 60c0a66ee96cbdb22e029da70ec42e249f1996a5 Author: Michał Winiarski Date: Thu Jul 12 14:48:10 2018 +0200 drm/i915: Tidy error handling in i915_gem_init_hw Let's reorder things so that we can do onion teardown rather than double goto. References: b96f6ebfd024 ("drm/i915: Correctly handle error path in i915_gem_init_hw") Signed-off-by: Michał Winiarski Cc: Michal Wajdeczko Cc: Sagar Arun Kamble Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180712124810.25241-1-michal.winiarski@intel.com commit 11527b3e0b577513ea318f01e392ccf7feb9d2a4 Author: Will Deacon Date: Thu Jul 12 15:14:23 2018 +0100 arm64: Drop asmlinkage qualifier from syscall_trace_{enter,exit} syscall_trace_{enter,exit} are only called from C code, so drop the asmlinkage qualifier from their definitions. Signed-off-by: Will Deacon commit 5f336e722cc961be94d264d96b90c92888fffae1 Author: Al Viro Date: Mon Jul 9 16:38:06 2018 -0400 few more cleanups of link_path_walk() callers Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 9b5858e99ae1cfb60dc00461cfc7bd4dd077d7d7 Author: Al Viro Date: Mon Jul 9 16:33:23 2018 -0400 allow link_path_walk() to take ERR_PTR() There is a check for IS_ERR(name) immediately upstream of each call of link_path_walk(name, nd), with positives treated as if link_path_walk() failed with PTR_ERR(name). Taking that check into link_path_walk() itself simplifies things nicely. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit edc2b1da779887c74ade799574efc5819906598f Author: Al Viro Date: Mon Jul 9 16:27:23 2018 -0400 make path_init() unconditionally paired with terminate_walk() including the failure exits Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 5014c2f378ca3f6ddfe310e4b5ef7027acfc2d45 Author: Al Viro Date: Mon Jul 9 19:20:08 2018 -0400 document alloc_file() changes Acked-by: Linus Torvalds Signed-off-by: Al Viro commit ee1904ba44bd4a242b453e8fe179b374906da173 Author: Al Viro Date: Sun Jun 17 14:21:27 2018 -0400 make alloc_file() static Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 4f089acc5f76ab1dff17b5f0be7608671a8441dc Author: Al Viro Date: Sun Jun 17 12:24:00 2018 -0400 do_shmat(): grab shp->shm_file earlier, switch to alloc_file_clone() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 183266f26f45a47958afb5c9aa1b3d4651e2eb8c Author: Al Viro Date: Sun Jun 17 14:15:10 2018 -0400 new helper: alloc_file_clone() alloc_file_clone(old_file, mode, ops): create a new struct file with ->f_path equal to that of old_file. pipe converted. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 152b6372c90630ef6787334e84cdddbcf8beb241 Author: Al Viro Date: Sat Jun 9 10:05:18 2018 -0400 create_pipe_files(): switch the first allocation to alloc_file_pseudo() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 52c91f8b3b1f5f69e47f7f65f76066d0c940b191 Author: Al Viro Date: Sat Jun 9 09:58:23 2018 -0400 anon_inode_getfile(): switch to alloc_file_pseudo() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit e68375c850b0d5699a27bb598317a3274913824b Author: Al Viro Date: Sat Jun 9 09:50:46 2018 -0400 hugetlb_file_setup(): switch to alloc_file_pseudo() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 118f4868616b2aef18ed93461b48f83c3a6bcc7f Author: Al Viro Date: Sun Jun 17 12:42:49 2018 -0400 ocxlflash_getfile(): switch to alloc_file_pseudo() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 908f7ca1731142e49e802b0277e94853cd772a8d Author: Al Viro Date: Sat Jun 9 09:45:56 2018 -0400 cxl_getfile(): switch to alloc_file_pseudo() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 93dec2da7b2349f0b294bbb23244cac135f13b79 Author: Al Viro Date: Sun Jul 8 23:02:03 2018 -0400 ... and switch shmem_file_setup() to alloc_file_pseudo() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit dac2d1f6cbfe3f63867a601d2431b7749d9bdbcf Author: Al Viro Date: Sat Jun 9 09:27:41 2018 -0400 __shmem_file_setup(): reorder allocations grab inode and reserve memory first. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit d93aa9d82aea80b80f225dbf9c7986df444d8106 Author: Al Viro Date: Sat Jun 9 09:40:05 2018 -0400 new wrapper: alloc_file_pseudo() takes inode, vfsmount, name, O_... flags and file_operations and either returns a new struct file (in which case inode reference we held is consumed) or returns ERR_PTR(), in which case no refcounts are altered. converted aio_private_file() and sock_alloc_file() to it Acked-by: Linus Torvalds Signed-off-by: Al Viro commit dbae8f2ca2f0586f4b80201c78ff0aed2a012ab5 Author: Al Viro Date: Fri Jun 8 17:51:47 2018 -0400 kill FILE_{CREATED,OPENED} no users left Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 00a07c1591a3fb3d71f7083361eab4a2444938a3 Author: Al Viro Date: Mon Jul 9 19:30:20 2018 -0400 switch atomic_open() and lookup_open() to returning 0 in all success cases caller can tell "opened" from "open it yourself" by looking at ->f_mode. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 6c9b1de172bdd0450d56e2cb3b2da5fc1833619e Author: Al Viro Date: Mon Jul 9 19:20:08 2018 -0400 document ->atomic_open() changes Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 64e1ac4d46f9f5d8284aefb97e1b550dbb26abe8 Author: Al Viro Date: Mon Jul 9 19:17:52 2018 -0400 ->atomic_open(): return 0 in all success cases FMODE_OPENED can be used to distingusish "successful open" from the "called finish_no_open(), do it yourself" cases. Since finish_no_open() has been adjusted, no changes in the instances were actually needed. The caller has been adjusted. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 3ec2eef116e900099edc6d31a1a0423166e2906d Author: Al Viro Date: Fri Jun 8 13:43:47 2018 -0400 get rid of 'opened' in path_openat() and the helpers downstream unused now Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 44907d79002466049fdbb8ef15730d185e0808b4 Author: Al Viro Date: Fri Jun 8 13:32:02 2018 -0400 get rid of 'opened' argument of ->atomic_open() - part 3 now it can be done... Acked-by: Linus Torvalds Signed-off-by: Al Viro commit b452a458caaa95d02b74897d35e87aa080122f07 Author: Al Viro Date: Fri Jun 8 13:06:28 2018 -0400 getting rid of 'opened' argument of ->atomic_open() - part 2 __gfs2_lookup(), gfs2_create_inode(), nfs_finish_open() and fuse_create_open() don't need 'opened' anymore. Get rid of that argument in those. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit be12af3ef5e61ebc44d065e121424ac605d7bb8e Author: Al Viro Date: Fri Jun 8 11:44:56 2018 -0400 getting rid of 'opened' argument of ->atomic_open() - part 1 'opened' argument of finish_open() is unused. Kill it. Signed-off-by Al Viro commit 6035a27b25ab9dadc8c3d5c5df5eae3fca62fc95 Author: Al Viro Date: Fri Jun 8 13:40:10 2018 -0400 IMA: don't propagate opened through the entire thing just check ->f_mode in ima_appraise_measurement() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 73a09dd94377e4b186b300bd5461920710c7c3d5 Author: Al Viro Date: Fri Jun 8 13:22:02 2018 -0400 introduce FMODE_CREATED and switch to it Parallel to FILE_CREATED, goes into ->f_mode instead of *opened. NFS is a bit of a wart here - it doesn't have file at the point where FILE_CREATED used to be set, so we need to propagate it there (for now). IMA is another one (here and everywhere)... Note that this needs do_dentry_open() to leave old bits in ->f_mode alone - we want it to preserve FMODE_CREATED if it had been already set (no other bit can be there). Acked-by: Linus Torvalds Signed-off-by: Al Viro commit aad888f828fec1e7160b67f122172e7ab7f82e03 Author: Al Viro Date: Fri Jun 8 12:58:04 2018 -0400 switch all remaining checks for FILE_OPENED to FMODE_OPENED ... and don't bother with setting FILE_OPENED at all. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 69527c554f82d4bca4b154ccc06ad1554806bdc0 Author: Al Viro Date: Fri Jun 8 13:01:49 2018 -0400 now we can fold open_check_o_direct() into do_dentry_open() These checks are better off in do_dentry_open(); the reason we couldn't put them there used to be that callers couldn't tell what kind of cleanup would do_dentry_open() failure call for. Now that we have FMODE_OPENED, cleanup is the same in all cases - it's simply fput(). So let's fold that into do_dentry_open(), as Christoph's patch tried to. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 7c1c01ec20d61ef52dba9b6f85435e53449bea71 Author: Al Viro Date: Fri Jun 8 12:56:55 2018 -0400 lift fput() on late failures into path_openat() Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 4d27f3266f14e4d1d13125ce32cb49a40f3122c3 Author: Al Viro Date: Mon Jul 9 11:14:39 2018 -0400 fold put_filp() into fput() Just check FMODE_OPENED in __fput() and be done with that... Acked-by: Linus Torvalds Signed-off-by: Al Viro commit f5d11409e61dadf1f9af91b22bbedc28a60a2e2c Author: Al Viro Date: Mon Jul 9 02:35:08 2018 -0400 introduce FMODE_OPENED basically, "is that instance set up enough for regular fput(), or do we want put_filp() for that one". NOTE: the only alloc_file() caller that could be followed by put_filp() is in arch/ia64/kernel/perfmon.c, which is (Kconfig-level) broken. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 9481769208b5e39b871ae4e89f5328c776ec38dc Author: Al Viro Date: Tue Jul 10 14:13:18 2018 -0400 ->file_open(): lose cred argument Acked-by: Linus Torvalds Signed-off-by: Al Viro commit e3f20ae21079ecac282df65d83865c5771f4bca0 Author: Al Viro Date: Tue Jul 10 13:25:29 2018 -0400 security_file_open(): lose cred argument Acked-by: Linus Torvalds Signed-off-by: Al Viro commit ae2bb293a3e8adbc54d08cede5afc22929030c03 Author: Al Viro Date: Tue Jul 10 13:22:28 2018 -0400 get rid of cred argument of vfs_open() and do_dentry_open() always equal to ->f_cred Acked-by: Linus Torvalds Signed-off-by: Al Viro commit ea73ea7279884ba80896d4ea0f0443bf48b9e311 Author: Al Viro Date: Wed Jul 11 15:00:04 2018 -0400 pass ->f_flags value to alloc_empty_file() ... and have it set the f_flags-derived part of ->f_mode. Signed-off-by: Al Viro commit 6de37b6dc085e7c5e092b69289af66876526da44 Author: Al Viro Date: Tue Jul 10 13:12:05 2018 -0400 pass creds to get_empty_filp(), make sure dentry_open() passes the right creds ... and rename get_empty_filp() to alloc_empty_file(). dentry_open() gets creds as argument, but the only thing that sees those is security_file_open() - file->f_cred still ends up with current_cred(). For almost all callers it's the same thing, but there are several broken cases. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 28519c891c5ad569203636b3b65d36bcb4333d4c Author: Christoph Hellwig Date: Thu Jul 12 10:09:59 2018 +0200 bsg: remove read/write support The code poses a security risk due to user memory access in ->release and had an API that can't be used reliably. As far as we know it was never used for real, but if that turns out wrong we'll have to revert this commit and come up with a band aid. Jann Horn did look software archives for users of this interface, and the only users found were example code in sg3_utils, and optional support in an optional module of the tgt user space iscsi target, which looks like a proof of concept extension of the /dev/sg read/write support. Tony Battersby chimes in that the code is basically unsafe to use in general: The read/write interface on /dev/bsg is impossible to use safely because the list of completed commands is per-device (bd->done_list) rather than per-fd like it is with /dev/sg. So if program A and program B are both using the write/read interface on the same bsg device, then their command responses will get mixed up, and program A will read() some command results from program B and vice versa. So no, I don't use read/write on /dev/bsg. From a security standpoint, it should definitely be fixed or removed. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit c9c554f21490bbc96cc554f80024d27d09670480 Author: Al Viro Date: Wed Jul 11 14:19:04 2018 -0400 alloc_file(): switch to passing O_... flags instead of FMODE_... mode ... so that it could set both ->f_flags and ->f_mode, without callers having to set ->f_flags manually. Signed-off-by: Al Viro commit 4378a7d4be30ec6994702b19936f7d1465193541 Author: Mark Rutland Date: Wed Jul 11 14:56:56 2018 +0100 arm64: implement syscall wrappers To minimize the risk of userspace-controlled values being used under speculation, this patch adds pt_regs based syscall wrappers for arm64, which pass the minimum set of required userspace values to syscall implementations. For each syscall, a wrapper which takes a pt_regs argument is automatically generated, and this extracts the arguments before calling the "real" syscall implementation. Each syscall has three functions generated: * __do_sys_ is the "real" syscall implementation, with the expected prototype. * __se_sys_ is the sign-extension/narrowing wrapper, inherited from common code. This takes a series of long parameters, casting each to the requisite types required by the "real" syscall implementation in __do_sys_. This wrapper *may* not be necessary on arm64 given the AAPCS rules on unused register bits, but it seemed safer to keep the wrapper for now. * __arm64__sys_ takes a struct pt_regs pointer, and extracts *only* the relevant register values, passing these on to the __se_sys_ wrapper. The syscall invocation code is updated to handle the calling convention required by __arm64__sys_, and passes a single struct pt_regs pointer. The compiler can fold the syscall implementation and its wrappers, such that the overhead of this approach is minimized. Note that we play games with sys_ni_syscall(). It can't be defined with SYSCALL_DEFINE0() because we must avoid the possibility of error injection. Additionally, there are a couple of locations where we need to call it from C code, and we don't (currently) have a ksys_ni_syscall(). While it has no wrapper, passing in a redundant pt_regs pointer is benign per the AAPCS. When ARCH_HAS_SYSCALL_WRAPPER is selected, no prototype is defines for sys_ni_syscall(). Since we need to treat it differently for in-kernel calls and the syscall tables, the prototype is defined as-required. The wrappers are largely the same as their x86 counterparts, but simplified as we don't have a variety of compat calling conventions that require separate stubs. Unlike x86, we have some zero-argument compat syscalls, and must define COMPAT_SYSCALL_DEFINE0() to ensure that these are also given an __arm64_compat_sys_ prefix. Signed-off-by: Mark Rutland Reviewed-by: Dominik Brodowski Reviewed-by: Catalin Marinas Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 55f849265af886aaf404cbf8a659b2c8d411fc3a Author: Mark Rutland Date: Wed Jul 11 14:56:55 2018 +0100 arm64: convert compat wrappers to C In preparation for converting to pt_regs syscall wrappers, convert our existing compat wrappers to C. This will allow the pt_regs wrappers to be automatically generated, and will allow for the compat register manipulation to be folded in with the pt_regs accesses. To avoid confusion with the upcoming pt_regs wrappers and existing compat wrappers provided by core code, the C wrappers are renamed to compat_sys_aarch32_. With the assembly wrappers gone, we can get rid of entry32.S and the associated boilerplate. Note that these must call the ksys_* syscall entry points, as the usual sys_* entry points will be modified to take a single pt_regs pointer argument. Signed-off-by: Mark Rutland Acked-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit d3516c9073b4b81410195489dc169891cd64e4cd Author: Mark Rutland Date: Wed Jul 11 14:56:54 2018 +0100 arm64: use SYSCALL_DEFINE6() for mmap We don't currently annotate our mmap implementation as a syscall, as we need to do to use pt_regs syscall wrappers. Let's mark it as a real syscall. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Dominik Brodowski Acked-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit bf4ce5cc23c9f8357bfd9c0328bf59685664cbc7 Author: Mark Rutland Date: Wed Jul 11 14:56:53 2018 +0100 arm64: use {COMPAT,}SYSCALL_DEFINE0 for sigreturn We don't currently annotate our various sigreturn functions as syscalls, as we need to do to use pt_regs syscall wrappers. Let's mark them as real syscalls. For compat_sys_sigreturn and compat_sys_rt_sigreturn, this changes the return type from int to long, matching the prototypes in sys32.c. Signed-off-by: Mark Rutland Reviewed-by: Dominik Brodowski Acked-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 3f7deccb037cc2bd2f848576439c033f81daeb6a Author: Mark Rutland Date: Wed Jul 11 14:56:52 2018 +0100 arm64: remove in-kernel call to sys_personality() With pt_regs syscall wrappers, the calling convention for sys_personality() will change. Use ksys_personality(), which is functionally equivalent. Signed-off-by: Mark Rutland Acked-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 9b54bf9d6a5b30e2cc22b18793e9a4158c5b4882 Author: Mark Rutland Date: Wed Jul 11 14:56:51 2018 +0100 kernel: add kcompat_sys_{f,}statfs64() Using this helper allows us to avoid the in-kernel calls to the compat_sys_{f,}statfs64() sycalls, as are necessary for parameter mangling in arm64's compat handling. Following the example of ksys_* functions, kcompat_sys_* functions are intended to be a drop-in replacement for their compat_sys_* counterparts, with the same calling convention. This is necessary to enable conversion of arm64's syscall handling to use pt_regs wrappers. Signed-off-by: Mark Rutland Reviewed-by: Dominik Brodowski Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Will Deacon commit bf1c77b4644f46d2986b7ca5e43e012f0fc8984b Author: Mark Rutland Date: Wed Jul 11 14:56:50 2018 +0100 kernel: add ksys_personality() Using this helper allows us to avoid the in-kernel call to the sys_personality() syscall. The ksys_ prefix denotes that this function is meant as a drop-in replacement for the syscall. In particular, it uses the same calling convention as sys_personality(). Since ksys_personality is trivial, it is implemented directly in , as we do for ksys_close() and friends. This helper is necessary to enable conversion of arm64's syscall handling to use pt_regs wrappers. Signed-off-by: Mark Rutland Reviewed-by: Dominik Brodowski Cc: Al Viro Cc: Christoph Hellwig Cc: Dave Martin Signed-off-by: Will Deacon commit 80d63bc39f9ace9c1d2bef7f921d2f3ef2037d4b Author: Mark Rutland Date: Wed Jul 11 14:56:49 2018 +0100 arm64: drop alignment from syscall tables Our syscall tables are aligned to 4096 bytes, which allowed their addresses to be generated with a single adrp in entry.S. This has the unfortunate property of wasting space in .rodata for the necessary padding. Now that the address is generated by C code, we can rely on the compiler to do the right thing, and drop the alignemnt. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit baaa7237fecc5ada99e518f38541126977ca7ff4 Author: Mark Rutland Date: Wed Jul 11 14:56:48 2018 +0100 arm64: zero GPRs upon entry from EL0 We can zero GPRs x0 - x29 upon entry from EL0 to make it harder for userspace to control values consumed by speculative gadgets. We don't blat x30, since this is stashed much later, and we'll blat it before invoking C code. Signed-off-by: Mark Rutland Acked-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 99ed3ed08d629eb0db6866d266e2bbe35efa5f9d Author: Mark Rutland Date: Wed Jul 11 14:56:47 2018 +0100 arm64: don't reload GPRs after apply_ssbd Now that all of the syscall logic works on the saved pt_regs, apply_ssbd can safely corrupt x0-x3 in the entry paths, and we no longer need to restore them. So let's remove the logic doing so. With that logic gone, we can fold the branch target into the macro, so that callers need not deal with this. GAS provides \@, which provides a unique value per macro invocation, which we can use to create a unique label. Signed-off-by: Mark Rutland Acked-by: Marc Zyngier Acked-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit d9be03256d745360a859b11091e5a43f7828382b Author: Mark Rutland Date: Wed Jul 11 14:56:46 2018 +0100 arm64: don't restore GPRs when context tracking Now that syscalls are invoked with pt_regs, we no longer need to ensure that the argument regsiters are live in the entry assembly, and it's fine to not restore them after context_tracking_user_exit() has corrupted them. Signed-off-by: Mark Rutland Acked-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 3b7142752e4bee153df6db4a76ca104ef0d7c0b4 Author: Mark Rutland Date: Wed Jul 11 14:56:45 2018 +0100 arm64: convert native/compat syscall entry to C Now that the syscall invocation logic is in C, we can migrate the rest of the syscall entry logic over, so that the entry assembly needn't look at the register values at all. The SVE reset across syscall logic now unconditionally clears TIF_SVE, but sve_user_disable() will only write back to CPACR_EL1 when SVE is actually enabled. Signed-off-by: Mark Rutland Reviewed-by: Catalin Marinas Reviewed-by: Dave Martin Cc: Will Deacon Signed-off-by: Will Deacon commit f37099b6992a0b818c7b51b899e435f4006a9f90 Author: Mark Rutland Date: Wed Jul 11 14:56:44 2018 +0100 arm64: convert syscall trace logic to C Currently syscall tracing is a tricky assembly state machine, which can be rather difficult to follow, and even harder to modify. Before we start fiddling with it for pt_regs syscalls, let's convert it to C. This is not intended to have any functional change. Signed-off-by: Mark Rutland Reviewed-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit a103af1b64d74853a5e08ca6c86aeb0e5c6ca4f1 Author: Alexander Usyskin Date: Mon Jul 9 12:21:44 2018 +0300 mei: don't update offset in write MEI enables writes of complete messages only while read can be performed in parts, hence write should not update the file offset to not break interleaving partial reads with writes. Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit cf1ed2c59b982d892b7c4d25b3dea2421cc5aa08 Author: Tomas Winkler Date: Wed Jul 11 15:29:32 2018 +0300 mei: bus: type promotion bug in mei_fwver() if __mei_cl_recv() returns a negative then "bytes_recv" type is promoted to a high positive value in comparison with size_t evaluated by MKHI_FWVER_LEN(1). It results in error condition not to be detected. Cc: Dan Carpenter Fixes: 9078ad92ef86 ("mei: expose fw version to sysfs") Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit b40b3e9358fbafff6a4ba0f4b9658f6617146f9c Author: Dan Carpenter Date: Wed Jul 11 15:29:31 2018 +0300 mei: bus: type promotion bug in mei_nfc_if_version() We accidentally removed the check for negative returns without considering the issue of type promotion. The "if_version_length" variable is type size_t so if __mei_cl_recv() returns a negative then "bytes_recv" is type promoted to a high positive value and treated as success. Cc: Fixes: 582ab27a063a ("mei: bus: fix received data size check in NFC fixup") Signed-off-by: Dan Carpenter Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 4141c857fd09dbed480f021b3eece4f46c653161 Author: Mark Rutland Date: Wed Jul 11 14:56:43 2018 +0100 arm64: convert raw syscall invocation to C As a first step towards invoking syscalls with a pt_regs argument, convert the raw syscall invocation logic to C. We end up with a bit more register shuffling, but the unified invocation logic means we can unify the tracing paths, too. Previously, assembly had to open-code calls to ni_sys() when the system call number was out-of-bounds for the relevant syscall table. This case is now handled by invoke_syscall(), and the assembly no longer need to handle this case explicitly. This allows the tracing paths to be simplified and unified, as we no longer need the __ni_sys_trace path and the __sys_trace_return label. This only converts the invocation of the syscall. The rest of the syscall triage and tracing is left in assembly for now, and will be converted in subsequent patches. Signed-off-by: Mark Rutland Reviewed-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 27d83e68f307ee55b70fdfdc7a9ba3f25f276189 Author: Mark Rutland Date: Wed Jul 11 14:56:42 2018 +0100 arm64: introduce syscall_fn_t In preparation for invoking arbitrary syscalls from C code, let's define a type for an arbitrary syscall, matching the parameter passing rules of the AAPCS. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 3085e1645e23888125224f66a710077cdb03106a Author: Mark Rutland Date: Wed Jul 11 14:56:41 2018 +0100 arm64: remove sigreturn wrappers The arm64 sigreturn* syscall handlers are non-standard. Rather than taking a number of user parameters in registers as per the AAPCS, they expect the pt_regs as their sole argument. To make this work, we override the syscall definitions to invoke wrappers written in assembly, which mov the SP into x0, and branch to their respective C functions. On other architectures (such as x86), the sigreturn* functions take no argument and instead use current_pt_regs() to acquire the user registers. This requires less boilerplate code, and allows for other features such as interposing C code in this path. This patch takes the same approach for arm64. Signed-off-by: Mark Rutland Tentatively-reviewed-by: Dave Martin Reviewed-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit f9209e26293300db80a57a6bf2f71ccb26ad45db Author: Mark Rutland Date: Wed Jul 11 14:56:40 2018 +0100 arm64: move sve_user_{enable,disable} to In subsequent patches, we'll want to make use of sve_user_enable() and sve_user_disable() outside of kernel/fpsimd.c. Let's move these to where we can make use of them. To avoid ifdeffery in sequences like: if (system_supports_sve() && some_condition) sve_user_disable(); ... empty stubs are provided when support for SVE is not enabled. Note that system_supports_sve() contains as IS_ENABLED(CONFIG_ARM64_SVE), so the sve_user_disable() call should be optimized away entirely when CONFIG_ARM64_SVE is not selected. To ensure that this is the case, the stub definitions contain a BUILD_BUG(), as we do for other stubs for which calls should always be optimized away when the relevant config option is not selected. At the same time, the include list of is sorted while adding . Signed-off-by: Mark Rutland Acked-by: Catalin Marinas Reviewed-by: Dave Martin Cc: Will Deacon Signed-off-by: Will Deacon commit 8d370933faecec098acb99fbf317cf9dfa9ee995 Author: Mark Rutland Date: Wed Jul 11 14:56:39 2018 +0100 arm64: kill change_cpacr() Now that we have sysreg_clear_set(), we can use this instead of change_cpacr(). Note that the order of the set and clear arguments differs between change_cpacr() and sysreg_clear_set(), so these are flipped as part of the conversion. Also, sve_user_enable() redundantly clears CPACR_EL1_ZEN_EL0EN before setting it; this is removed for clarity. Signed-off-by: Mark Rutland Reviewed-by: Dave Martin Acked-by: Catalin Marinas Cc: James Morse Cc: Will Deacon Signed-off-by: Will Deacon commit 25be597ada0b49d2748ab520a78a28c1764d69e4 Author: Mark Rutland Date: Wed Jul 11 14:56:38 2018 +0100 arm64: kill config_sctlr_el1() Now that we have sysreg_clear_set(), we can consistently use this instead of config_sctlr_el1(). Signed-off-by: Mark Rutland Reviewed-by: Dave Martin Acked-by: Catalin Marinas Cc: James Morse Cc: Will Deacon Signed-off-by: Will Deacon commit 1c312e84c2d71da4101754fa6118f703f7473e01 Author: Mark Rutland Date: Wed Jul 11 14:56:37 2018 +0100 arm64: move SCTLR_EL{1,2} assertions to Currently we assert that the SCTLR_EL{1,2}_{SET,CLEAR} bits are self-consistent with an assertion in config_sctlr_el1(). This is a bit unusual, since config_sctlr_el1() doesn't make use of these definitions, and is far away from the definitions themselves. We can use the CPP #error directive to have equivalent assertions in , next to the definitions of the set/clear bits, which is a bit clearer and simpler. At the same time, lets fill in the upper 32 bits for both registers in their respective RES0 definitions. This could be a little nicer with GENMASK_ULL(63, 32), but this currently lives in , which cannot safely be included from assembly, as can. Note the when the preprocessor evaluates an expression for an #if directive, all signed or unsigned values are treated as intmax_t or uintmax_t respectively. To avoid ambiguity, we define explicitly define the mask of all 64 bits. Signed-off-by: Mark Rutland Acked-by: Catalin Marinas Cc: Dave Martin Cc: James Morse Cc: Will Deacon Signed-off-by: Will Deacon commit 3eb6f1f9e6364d5eca1ddf3c9e963c5916069190 Author: Mark Rutland Date: Wed Jul 11 14:56:36 2018 +0100 arm64: consistently use unsigned long for thread flags In do_notify_resume, we manipulate thread_flags as a 32-bit unsigned int, whereas thread_info::flags is a 64-bit unsigned long, and elsewhere (e.g. in the entry assembly) we manipulate the flags as a 64-bit quantity. For consistency, and to avoid problems if we end up with more than 32 flags, let's make do_notify_resume take the flags as a 64-bit unsigned long. Signed-off-by: Mark Rutland Reviewed-by: Dave Martin Acked-by: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 5bfbeacf1983de58782b3aeb59b87d216091751c Author: Chris Wilson Date: Thu Jul 12 11:58:30 2018 +0100 drm/i915/guc: Skip cleaning up the doorbells on error-before-allocate If we fail the module load, we may try and cleanup before we even allocate the GuC clients. KISS in order to try and re-enable drv_module_reload for BAT. Testcase: igt/drv_module_reload/basic-reload-inject Signed-off-by: Chris Wilson Cc: Michał Winiarski Cc: Michal Wajdeczko Reviewed-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/20180712105830.20390-1-chris@chris-wilson.co.uk commit 818fed4f25bbfa729096d2adcdc779c52c932fa7 Author: Chris Wilson Date: Thu Jul 12 11:54:54 2018 +0100 drm/i915: Silence warning for no vlv powercontext Along a module load error path, we may try to cleanup the powercontext even before we have allocated it. Reorganising GT powermanagement is an on going process, so for simplicity handle it. [ 522.733832] WARN_ON(!dev_priv->vlv_pctx) [ 522.733986] WARNING: CPU: 1 PID: 3856 at drivers/gpu/drm/i915/intel_pm.c:7350 intel_cleanup_gt_powersave+0x5f/0x70 [i915] [ 522.733991] Modules linked in: i915(+) vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic btusb btrtl btbcm btintel intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul bluetooth snd_hda_codec ghash_clmulni_intel snd_hwdep snd_hda_core ecdh_generic lpc_ich r8169 snd_pcm mii i2c_hid prime_numbers [last unloaded: i915] [ 522.734105] CPU: 1 PID: 3856 Comm: drv_module_relo Tainted: G U 4.18.0-rc4-CI-CI_DRM_4474+ #1 [ 522.734110] Hardware name: \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff/DN2820FYK, BIOS FYBYT10H.86A.0059.2017.0607.2130 06/07/2017 [ 522.734193] RIP: 0010:intel_cleanup_gt_powersave+0x5f/0x70 [i915] [ 522.734197] Code: 00 74 0d 48 c7 83 68 a6 00 00 00 00 00 00 eb c8 e8 36 6f 37 e1 eb ec 48 c7 c6 c5 7a 3d a0 48 c7 c7 b5 78 3d a0 e8 71 04 e0 e0 <0f> 0b eb aa 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 f3 c3 0f 1f 40 [ 522.734445] RSP: 0018:ffffc900004f3af0 EFLAGS: 00010282 [ 522.734453] RAX: 0000000000000000 RBX: ffff880106360000 RCX: 0000000000000001 [ 522.734458] RDX: 0000000080000001 RSI: ffffffff820c65c4 RDI: 00000000ffffffff [ 522.734463] RBP: ffff880106360000 R08: 000000009f79baee R09: 0000000000000000 [ 522.734467] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88013b3133f8 [ 522.734472] R13: 00000000ffffffed R14: ffff880106360d58 R15: ffff88013b3133f8 [ 522.734477] FS: 00007f43f70af980(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000 [ 522.734481] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 522.734486] CR2: 000055a13a787580 CR3: 00000001325e6000 CR4: 00000000001006e0 [ 522.734490] Call Trace: [ 522.734595] intel_modeset_cleanup+0xcf/0x140 [i915] [ 522.734682] i915_driver_load+0xc85/0x10a0 [i915] [ 522.734694] ? _raw_spin_unlock_irqrestore+0x4c/0x60 [ 522.734703] ? trace_hardirqs_on_caller+0xe0/0x1b0 [ 522.734790] i915_pci_probe+0x29/0x90 [i915] [ 522.734801] pci_device_probe+0xa1/0x130 [ 522.734813] driver_probe_device+0x306/0x480 [ 522.734824] __driver_attach+0xdb/0x100 [ 522.734830] ? driver_probe_device+0x480/0x480 [ 522.734836] ? driver_probe_device+0x480/0x480 [ 522.734844] bus_for_each_dev+0x74/0xc0 [ 522.734855] bus_add_driver+0x15f/0x250 [ 522.734863] ? 0xffffffffa0793000 [ 522.734870] driver_register+0x56/0xe0 [ 522.734877] ? 0xffffffffa0793000 [ 522.734883] do_one_initcall+0x58/0x370 [ 522.734893] ? do_init_module+0x1d/0x1ea [ 522.734900] ? rcu_read_lock_sched_held+0x6f/0x80 [ 522.734906] ? kmem_cache_alloc_trace+0x282/0x2e0 [ 522.734918] do_init_module+0x56/0x1ea [ 522.734927] load_module+0x2435/0x2b20 [ 522.734965] ? __se_sys_finit_module+0xd3/0xf0 [ 522.734972] __se_sys_finit_module+0xd3/0xf0 [ 522.734995] do_syscall_64+0x55/0x190 [ 522.735003] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 522.735009] RIP: 0033:0x7f43f675d839 [ 522.735014] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48 [ 522.735260] RSP: 002b:00007ffe69384238 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 522.735269] RAX: ffffffffffffffda RBX: 000056100e387090 RCX: 00007f43f675d839 [ 522.735273] RDX: 0000000000000000 RSI: 000056100e37bff0 RDI: 0000000000000003 [ 522.735278] RBP: 000056100e37bff0 R08: 0000000000000000 R09: 0000000000000000 [ 522.735282] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000 [ 522.735286] R13: 000056100e37c890 R14: 0000000000000020 R15: 0000000000000027 [ 522.735309] irq event stamp: 1389594 [ 522.735316] hardirqs last enabled at (1389593): [] console_unlock+0x3fc/0x600 [ 522.735323] hardirqs last disabled at (1389594): [] error_entry+0x7c/0x100 [ 522.735329] softirqs last enabled at (1389356): [] __do_softirq+0x34f/0x505 [ 522.735336] softirqs last disabled at (1389335): [] irq_exit+0xa9/0xc0 [ 522.735432] WARNING: CPU: 1 PID: 3856 at drivers/gpu/drm/i915/intel_pm.c:7350 intel_cleanup_gt_powersave+0x5f/0x70 [i915] Testcase: igt/drv_module_reload/basic-reload-inject Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180712105454.16091-1-chris@chris-wilson.co.uk commit 9a9b13dd275dfe49ee0cf3ae5dc931069eb41475 Merge: c5a59d2477ab cb04ba33187c Author: Takashi Iwai Date: Thu Jul 12 13:58:07 2018 +0200 Merge branch 'topic/hda-core-intel' into topic/hda-acomp commit 0ae7383e83c6b1cea1e31173e362765dc24068c7 Author: Alan Douglas Date: Mon Jun 25 09:30:53 2018 +0100 PCI: cadence: Add shutdown callback to host driver Add shutdown callback to host driver which will disable PHY and PM runtime. Signed-off-by: Alan Douglas Signed-off-by: Lorenzo Pieralisi commit ee12c9efe685428ebfae1bf5347b5375f54ce44e Author: Alan Douglas Date: Mon Jun 25 09:30:52 2018 +0100 PCI: cadence: Add Power Management ops for host and EP These PM ops will enable/disable the optional PHYs if present. The AXI link-down register in the host driver is now cleared in cdns_pci_map_bus() since the link-down bit will be set if the PHY has been disabled. It is not cleared when enabling the PHY, since the link will not yet be up (e.g. when an EP controller is connected back-to-back to the host controller and its PHY is still disabled). Link: http://lkml.kernel.org/r/1529915453-4633-5-git-send-email-adouglas@cadence.com Signed-off-by: Alan Douglas [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi commit 9c3250a127901c93b23723dc5859c71a0d068fb8 Author: Daniel Klamt Date: Thu Jul 12 00:03:04 2018 +0200 powerpc/xive: Replace msleep(x) with msleep(OPAL_BUSY_DELAY_MS) Replace msleep(x) with with msleep(OPAL_BUSY_DELAY_MS) to document these sleeps are to wait for opal (firmware). Signed-off-by: Daniel Klamt Signed-off-by: Bjoern Noetel Signed-off-by: Michael Ellerman commit 54dbcfc211f15586c57d27492f938eb4df964257 Author: Michael Ellerman Date: Wed Jun 13 23:24:14 2018 +1000 powerpc/64s: Report SLB multi-hit rather than parity error When we take an SLB multi-hit on bare metal, we see both the multi-hit and parity error bits set in DSISR. The user manuals indicates this is expected to always happen on Power8, whereas on Power9 it says a multi-hit will "usually" also cause a parity error. We decide what to do based on the various error tables in mce_power.c, and because we process them in order and only report the first, we currently always report a parity error but not the multi-hit, eg: Severe Machine check interrupt [Recovered] Initiator: CPU Error type: SLB [Parity] Effective address: c000000ffffd4300 Although this is correct, it leaves the user wondering why they got a parity error. It would be clearer instead if we reported the multi-hit because that is more likely to be simply a software bug, whereas a true parity error is possibly an indication of a bad core. We can do that simply by reordering the error tables so that multi-hit appears before parity. That doesn't affect the error recovery at all, because we flush the SLB either way. Signed-off-by: Michael Ellerman Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman commit e11b64b1ef336f8976e5bf194b0eede48954f419 Author: Joel Stanley Date: Wed Jul 11 16:02:58 2018 +1000 powerpc: Remove Power8 DD1 from cputable This was added to support an early version of Power8 that did not have working doorbells. These machines were not publicly available, and all of the internal users have long since upgraded. Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman commit e87a4a92fba3721eb06ba8d061b550e09e3d063a Author: Will Deacon Date: Thu Jul 12 11:37:40 2018 +0100 Revert "arm64: fix infinite stacktrace" This reverts commit 7e7df71fd57ff2894d96abb0080922bf39460a79. When unwinding out of the IRQ stack and onto the interrupted EL1 stack, we cannot rely on the frame pointer being strictly increasing, as this could terminate the backtrace early depending on how the stacks have been allocated. Signed-off-by: Will Deacon commit 874846f1fccd67bff1fcb243b25f279f5c95f9d6 Author: Ezequiel Garcia Date: Fri Jul 6 12:08:18 2018 -0300 arm64: dts: rockchip: add 96boards RK3399 Ficus board The RK3399 Ficus board is an Enterprise Edition board manufactured by Vamrs Ltd., based on the Rockchip RK3399 SoC. The board exposes a bunch of nice peripherals, including SATA, HDMI, MIPI CSI, Ethernet, WiFi, and PCIe. Signed-off-by: Ezequiel Garcia Reviewed-by: Rob Herring Signed-off-by: Heiko Stuebner commit 6c18ccca42ddb3256c9d1e4bb6075c9eb04b89bc Author: Ezequiel Garcia Date: Fri Jul 6 12:08:17 2018 -0300 dt-bindings: Add vendor prefix for Vamrs Ltd. Vamrs Ltd. is a hardware solutions provider based in China. Website: http://vamrs.com/ Signed-off-by: Ezequiel Garcia Reviewed-by: Rob Herring Signed-off-by: Heiko Stuebner commit d6b4ea866b8117c1c4a048e2e2dadf0c83776a84 Author: Dominique Martinet Date: Thu Jul 12 08:41:03 2018 +0100 drm/i915/tv: fix strncpy truncation warning Change it to use strlcpy instead Signed-off-by: Dominique Martinet Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180712074103.21571-1-chris@chris-wilson.co.uk Signed-off-by: Chris Wilson commit 8249ede477c50d82c4ce82b0f08f1ce89c919ae7 Author: Chen-Yu Tsai Date: Thu Jul 12 11:04:17 2018 +0800 ARM: dts: sunxi: libretech-all-h3-cc: Enable eMMC module The Libretech ALL-H3-CC has a high density connector for attaching an eMMC module. The module form factor and connection is specific to Libretech, and has provisions for split vmmc/vqmmc (core and I/O) voltage supplies, but this board does not wire the vqmmc side. The H2+/H3/H5 SoCs do not support alternate I/O voltages for eMMC either. Only 3.3V is supported. A specific module that ties vqmmc to vmmc, with both at 3.3V, must be used. Given that a) eMMC is not designed to be hotplugged, b) power is always provided on the pins, and c) MMC controllers can deal with missing cards, we can enable this by default. If a module is attached it will be picked up by the system. Signed-off-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard commit 58d4d29823d9a6c4593c48a1a24e6a9dcec8e3ff Author: Arnd Bergmann Date: Wed Jul 11 16:43:10 2018 +0200 drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module: ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined! ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined! This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules. Fixes: 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs") Fixes: ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP") Signed-off-by: Arnd Bergmann Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180711144403.1022829-1-arnd@arndb.de commit 7da9b2e47fefb419a21e1c4c5a0682846b41b4a0 Author: Jernej Skrabec Date: Wed Jul 11 13:27:06 2018 +0200 drm/sun4i: mixer: Read id from DT Currently, TCON supports 2 ways to match TCON with engine (mixer in this case). Old way is to just traverse of graph backwards and compare node pointer. New way is to match TCON and engine by their respective ids. All SoCs with DE2 enabled till now used the old way, which means mixer id was never used and thus never implemented. However, for R40, only the new way will be used. To prepare for that, implement mixer id fetching from DT. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180711112706.30222-1-jernej.skrabec@siol.net commit c089af18b2bdc859f0c923bc6c026d96532797b4 Author: Wei Yongjun Date: Wed Jul 11 13:22:47 2018 +0000 drm/sun4i: DW HDMI: Make symbol sun8i_dw_hdmi_pltfm_driver static Fixes the following sparse warning: drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c:228:24: warning: symbol 'sun8i_dw_hdmi_pltfm_driver' was not declared. Should it be static? Signed-off-by: Wei Yongjun Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/1531315367-190647-1-git-send-email-weiyongjun1@huawei.com commit 91045034d53eb37b93a3ddd20f25883d9a40b100 Merge: 655250a8d1aa 279ce5d11707 Author: Rodrigo Vivi Date: Thu Jul 12 00:23:44 2018 -0700 Merge tag 'gvt-next-2018-07-11' of https://github.com/intel/gvt-linux into drm-intel-next-queued gvt-next-2018-07-11 - vGPU huge page support (Changbin) - BXT display irq warning fix (Colin) - Handle GVT dependency well (Henry) Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180711023353.GU1267@zhen-hp.sh.intel.com commit 51ecdd779e31ed45709bc32ff7efd4b28c3ce083 Author: Icenowy Zheng Date: Wed Jul 11 21:44:50 2018 +0800 ARM: sun8i: h3: add SY8113B regulator on Banana Pi M2 Zero board Banana Pi M2 Zero board has a SY8113B regulator, which is controlled via GPIO and capable of outputing 1.1V when the PL1 GPIO is set to output 0 or 1.1V when the PL6 GPIO is set to input or output 1, and the output is the power supply of the ARM cores in H3 SoC. Add the device tree node of this regulator and set the cpu's cpu-supply property to it. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit f1fbeada1bc07e710d972657ac083fca8db206dc Merge: d0c694fc7b01 28ace84b10fa Author: David S. Miller Date: Thu Jul 12 00:03:31 2018 -0700 Merge branch 'be2net-small-structures-clean-up' Ivan Vecera says: ==================== be2net: small structures clean-up The series: - removes unused / unneccessary fields in several be2net structures - re-order fields in some structures to eliminate holes, cache-lines crosses - as result reduces size of main struct be_adapter by 4kB ==================== Signed-off-by: David S. Miller commit 28ace84b10fa5a1bb542ee7198743e3c02e23a07 Author: Ivan Vecera Date: Tue Jul 10 22:59:48 2018 +0200 be2net: move rss_flags field in rss_info to ensure proper alignment The current position of .rss_flags field in struct rss_info causes that fields .rsstable and .rssqueue (both 128 bytes long) crosses cache-line boundaries. Moving it at the end properly align all fields. Before patch: struct rss_info { u64 rss_flags; /* 0 8 */ u8 rsstable[128]; /* 8 128 */ /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */ u8 rss_queue[128]; /* 136 128 */ /* --- cacheline 4 boundary (256 bytes) was 8 bytes ago --- */ u8 rss_hkey[40]; /* 264 40 */ }; After patch: struct rss_info { u8 rsstable[128]; /* 0 128 */ /* --- cacheline 2 boundary (128 bytes) --- */ u8 rss_queue[128]; /* 128 128 */ /* --- cacheline 4 boundary (256 bytes) --- */ u8 rss_hkey[40]; /* 256 40 */ u64 rss_flags; /* 296 8 */ }; Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit 03d231a963ae1179d05f552db75b661d1099272f Author: Ivan Vecera Date: Tue Jul 10 22:59:47 2018 +0200 be2net: re-order fields in be_error_recovert to avoid hole - Unionize two u8 fields where only one of them is used depending on NIC chipset. - Move recovery_supported field after that union These changes eliminate 7-bytes hole in the struct and makes it smaller by 8 bytes. Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit f9520b86dc22b6ac0ad2926cfa334e9fecb68a12 Author: Ivan Vecera Date: Tue Jul 10 22:59:46 2018 +0200 be2net: remove unused tx_jiffies field from be_tx_stats Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit 646d2c10aaa060281b4ce7c1d3649d7df2ba9e7f Author: Ivan Vecera Date: Tue Jul 10 22:59:45 2018 +0200 be2net: move txcp field in be_tx_obj to eliminate holes in the struct Before patch: struct be_tx_obj { u32 db_offset; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ struct be_queue_info q; /* 8 56 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct be_queue_info cq; /* 64 56 */ struct be_tx_compl_info txcp; /* 120 4 */ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 2 boundary (128 bytes) --- */ struct sk_buff * sent_skb_list[2048]; /* 128 16384 */ ... }: After patch: struct be_tx_obj { u32 db_offset; /* 0 4 */ struct be_tx_compl_info txcp; /* 4 4 */ struct be_queue_info q; /* 8 56 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct be_queue_info cq; /* 64 56 */ struct sk_buff * sent_skb_list[2048]; /* 120 16384 */ ... }; Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit e9c74cd85c00e46bff62d3bb2ce8c5fd02bf465e Author: Ivan Vecera Date: Tue Jul 10 22:59:44 2018 +0200 be2net: reorder fields in be_eq_obj structure Re-order fields in struct be_eq_obj to ensure that .napi field begins at start of cache-line. Also the .adapter field is moved to the first cache-line next to .q field and 3 fields (idx,msi_idx,spurious_intr) and the 4-bytes hole to 3rd cache-line. Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit d6d9704af8f42155791dc46d39d380e200c819ae Author: Ivan Vecera Date: Tue Jul 10 22:59:43 2018 +0200 be2net: remove desc field from be_eq_obj The event queue description (be_eq_obj.desc) field is used only to format string for IRQ name and it is not really needed to hold this value. Remove it and use local variable to format string for IRQ name. Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit c1328a27bb8cdbe3ff1677cc263d302fb8a72075 Author: Ivan Vecera Date: Tue Jul 10 22:59:42 2018 +0200 be2net: remove unused old custom busy-poll fields The commit fb6113e688e0 ("be2net: get rid of custom busy poll code") replaced custom busy-poll code by the generic one but left several macros and fields in struct be_eq_obj that are currently unused. Remove this stuff. Fixes: fb6113e688e0 ("be2net: get rid of custom busy poll code") Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit a5d7fcb689eba7884c3bd5d42cebebdf0e99b978 Author: Ivan Vecera Date: Tue Jul 10 22:59:41 2018 +0200 be2net: remove unused old AIC info The commit 2632bafd74ae ("be2net: fix adaptive interrupt coalescing") introduced a separate struct be_aic_obj to hold AIC information but unfortunately left the old stuff in be_eq_obj. So remove it. Fixes: 2632bafd74ae ("be2net: fix adaptive interrupt coalescing") Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit 19ad2b75c6436eb7a5233a68cca13ceb17041ec8 Author: Fabio Estevam Date: Mon Jul 9 14:55:58 2018 -0300 pwm: mxs: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Thierry Reding commit d0c694fc7b01a500741d4085d26ed78df5aa6c7a Author: Ivan Khoronzhuk Date: Tue Jul 10 16:04:04 2018 +0300 net: ethernet: ti: cpts: break cycle once late ts is matched The late ts queue can contain a bunch of skbs while hi rate testing, no need to check all of them if timestamp is already matched. Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 42801298386c7c261f376a7f08446b2633fe7bc2 Author: Petr Machata Date: Tue Jul 10 14:44:26 2018 +0200 selftests: forwarding: mirror_gre_nh: Unset rp_filter on host VRF The mirrored packets arrive at $h3 encapsulated in GRE/IPv4, with IP address from 192.0.2.128/28 network. However the interface is configured as a member of 192.0.2.160/28 and there's no route directing traffic from the former network through that interface. Correspondingly, the RP filter on the VRF rejects it. Therefore turn off the VRF's RP filter. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 3a0709928b172a4123a76078f70e0a706265690c Author: Rodrigo Siqueira Date: Wed Jul 11 23:02:26 2018 -0300 drm/vkms: Add vblank events simulated by hrtimers This commit adds regular vblank events simulated through hrtimers, which is a feature required by VKMS to mimic real hardware. Additionally, all the vblank event send after pageflip is kept in the atomic_flush function. Changes since V1: - Compute the vblank timer interval per interruption Ville Syrjälä and Daniel Vetter: - Removes hardcoded vblank interval to get it from user space Changes since V2: Chris Wilson - Removes unnecessary algorithm to compute the next period Daniel Vetter: - Uses drm_calc_timestamping_constants to get the vblank interval instead of calculating it manually - Adds disable_vblank helper that turns of crtc - Simplifies implementation by using drm_crtc_arm_vblank_event - Replaces the code in atomic_begin to atomic_flush - Removes unnecessary field in vkms_output Changes since V3: Daniel Vetter: - Squash "drm/vkms: Add atomic helpers functions" into the commit that handling vblank events simulated by hrtimers Signed-off-by: Rodrigo Siqueira Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/7709bba40782ec06332d57fff337797b272581fc.1531359228.git.rodrigosiqueiramelo@gmail.com commit d16489307a52f028dcb072addf681f9280f585c6 Author: Rodrigo Siqueira Date: Wed Jul 11 23:02:14 2018 -0300 drm/vkms: Add connectors helpers This patch adds the struct drm_connector_helper_funcs with some necessary hooks. Additionally, it also adds some missing hooks at drm_connector_funcs. Changes since V1: - None Change since V2: Daniel Vetter: - Remove vkms_conn_mode_valid Signed-off-by: Rodrigo Siqueira Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/c8ee28b889234e866ef18bce4216385661c48041.1531359228.git.rodrigosiqueiramelo@gmail.com commit 657cd71e8eb3ac9ba91b8e1e403632b24d6cfdf9 Author: Eames Trinh Date: Tue Jul 10 15:00:21 2018 +0200 drm: gma500: Changed __attribute__((packed)) to __packed Signed-off-by: Eames Trinh Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180710130021.4499-1-eamestrinh@gmail.com commit 559e50fd34d1c556d42016cbb9affce89cee9ea4 Author: Rodrigo Siqueira Date: Wed Jul 11 23:01:47 2018 -0300 drm/vkms: Add dumb operations VKMS currently does not handle dumb data, and as a consequence, it does not provide mechanisms for handling gem. This commit adds the necessary support for gem object/handler and the dumb functions. Changes since V1: Daniel Vetter: - Add dumb buffer support to the same patchset Changes since V2: Haneen: - Add missing gem_free_object_unlocked callback to fix the warning "Memory manager not clean during takedown" Signed-off-by: Rodrigo Siqueira Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/70b7becc91c6a323dbc15cb5fc912cbdfe4ef7d9.1531359228.git.rodrigosiqueiramelo@gmail.com commit c82705c54fe03960c620c38d428dee3676391cc7 Merge: c9c159b22902 fea9cf321c91 Author: Greg Kroah-Hartman Date: Thu Jul 12 08:42:09 2018 +0200 Merge tag 'fsi-updates-2018-07-12' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/linux-fsi into char-misc-next Ben writes: FSI fixes and updates: - Reported build fixes - Add configuration of send/echo delayus - Object lifetime fix - Re-arrange some definitions in preparation for adding the CF master commit d90a5215c8ff7f665336d404a56f26c320b9dd73 Merge: 80fd2d6ca546 b5de82f3dfbe Author: David S. Miller Date: Wed Jul 11 23:10:20 2018 -0700 Merge branch 'mlxsw-ERSPAN-Take-LACP-state-into-consideration' Ido Schimmel says: ==================== mlxsw: ERSPAN: Take LACP state into consideration Petr says: When offloading mirror-to-gretap, mlxsw needs to preroute the path that the encapsulated packet will take. That path may include a LAG device above a front panel port. So far, mlxsw resolved the path to the first up front panel slave of the LAG interface, but that only reflects administrative state of the port. It neglects to consider whether the port actually has a carrier, and what the LACP state is. This patch set aims to address these problems. Patch #1 publishes team_port_get_rcu(). Then in patch #2, a new function is introduced, mlxsw_sp_port_dev_check(). That returns, for a given netdevice that is a slave of a LAG device, whether that device is "txable", i.e. whether the LAG master would send traffic through it. Since there's no good place to put LAG-wide helpers, introduce a new header include/net/lag.h. Finally in patch #3, fix the slave selection logic to take into consideration whether a given slave has a carrier and whether it is txable. ==================== Signed-off-by: David S. Miller commit b5de82f3dfbebc2d1b6db72c68f119a1e0427ca8 Author: Petr Machata Date: Tue Jul 10 10:02:59 2018 +0300 mlxsw: spectrum_span: Change LAG lower selection When offloading mirror-to-gretap, mlxsw needs to preroute the path that the encapsulated packet will take. That path may include a LAG device above a front panel port. So far, mlxsw resolved the path to the first up front panel slave of the LAG interface, but that only reflects administrative state of the port. It neglects to consider whether the port actually has a carrier, and what the LACP state is. So instead of checking upness of the device, check carrier state and txability. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit eeed992b776c54af6108187c87ac60d028e69d37 Author: Petr Machata Date: Tue Jul 10 10:02:58 2018 +0300 net: Add lag.h, net_lag_port_dev_txable() LAG devices (team or bond) recognize for each one of their slave devices whether LAG traffic is going to be sent through that device. Bond calls such devices "active", team calls them "txable". When this state changes, a NETDEV_CHANGELOWERSTATE notification is distributed, together with a netdev_notifier_changelowerstate_info structure that for LAG devices includes a tx_enabled flag that refers to the new state. The notification thus makes it possible to react to the changes in txability in drivers. However there's no way to query txability from the outside on demand. That is problematic namely for mlxsw, which when resolving ERSPAN packet path, may encounter a LAG device, and needs to determine which of the slaves it should choose. To that end, introduce a new function, net_lag_port_dev_txable(), which determines whether a given slave device is "active" or "txable" (depending on the flavor of the LAG device). That function then dispatches to per-LAG-flavor helpers, bond_is_active_slave_dev() resp. team_port_dev_txable(). Because there currently is no good place where net_lag_port_dev_txable() should be added, introduce a new header file, lag.h, which should from now on hold any logic common to both team and bond. (But keep netif_is_lag_master() together with the rest of netif_is_*_master() functions). Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 3443b00e07eed5798605ba6524de37e1d3f1a4bf Author: Petr Machata Date: Tue Jul 10 10:02:57 2018 +0300 team: Publish team_port_get_rcu() A follow-up patch adds a new entry point, team_port_dev_txable(). Making it an ordinary exported function would mean that any module that may need the service in one of the supported configurations also unconditionally needs to pull in the team module, whether or not the user actually intends to create team interfaces. To prevent that, team_port_dev_txable() is defined in if_team.h, and therefore all dependencies of that function also need to be publicly-visible. Therefore move team_port_get_rcu() from team.c to if_team.h. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 80fd2d6ca5461b2752744df2e6e387cc65e7b86c Author: Travis Brown Date: Tue Jul 10 00:35:01 2018 +0000 macvlan: Change status when lower device goes down Today macvlan ignores the notification when a lower device goes administratively down, preventing the lack of connectivity from bubbling up. Processing NETDEV_DOWN results in a macvlan state of LOWERLAYERDOWN with NO-CARRIER which should be easy to interpret in userspace. 2: lower: mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 3: macvlan@lower: mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000 Signed-off-by: Suresh Krishnan Signed-off-by: Travis Brown Signed-off-by: David S. Miller commit 0e97c4fb180ce90406e597a0a3f882c99ee55785 Merge: e32f55f37321 7ea817f4e832 Author: David S. Miller Date: Wed Jul 11 23:06:14 2018 -0700 Merge branch 'tipc-make-link-protocol-more-resilient' Jon Maloy says: ==================== tipc: make link protocol more resilient These two commits make the link ptotocol more resilient to infrastructures with frequent packet duplication and long delays. ==================== Signed-off-by: David S. Miller commit 7ea817f4e8322fa27fb860d15025bf72f68b179f Author: Jon Maloy Date: Tue Jul 10 01:07:36 2018 +0200 tipc: check session number before accepting link protocol messages In some virtual environments we observe a significant higher number of packet reordering and delays than we have been used to traditionally. This makes it necessary with stricter checks on incoming link protocol messages' session number, which until now only has been validated for RESET messages. Since the other two message types, ACTIVATE and STATE messages also carry this number, it is easy to extend the validation check to those messages. We also introduce a flag indicating if a link has a valid peer session number or not. This eliminates the mixing of 32- and 16-bit arithmethics we are currently using to achieve this. Acked-by: Ying Xue Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 9012de5089560136b849b920ad038b96160ed8f6 Author: Jon Maloy Date: Tue Jul 10 01:07:35 2018 +0200 tipc: add sequence number check for link STATE messages Some switch infrastructures produce huge amounts of packet duplicates. This becomes a problem if those messages are STATE/NACK protocol messages, causing unnecessary retransmissions of already accepted packets. We now introduce a unique sequence number per STATE protocol message so that duplicates can be identified and ignored. This will also be useful when tracing such cases, and to avert replay attacks when TIPC is encrypted. For compatibility reasons we have to introduce a new capability flag TIPC_LINK_PROTO_SEQNO to handle this new feature. Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit e32f55f373217001187ff171e75c5dfbb251f633 Merge: 4929c9428a17 8ec56fc3c5ee Author: David S. Miller Date: Wed Jul 11 23:03:32 2018 -0700 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== L2 Fwd Offload & 10GbE Intel Driver Updates 2018-07-09 This patch series is meant to allow support for the L2 forward offload, aka MACVLAN offload without the need for using ndo_select_queue. The existing solution currently requires that we use ndo_select_queue in the transmit path if we want to associate specific Tx queues with a given MACVLAN interface. In order to get away from this we need to repurpose the tc_to_txq array and XPS pointer for the MACVLAN interface and use those as a means of accessing the queues on the lower device. As a result we cannot offload a device that is configured as multiqueue, however it doesn't really make sense to configure a macvlan interfaced as being multiqueue anyway since it doesn't really have a qdisc of its own in the first place. The big changes in this set are: Allow lower device to update tc_to_txq and XPS map of offloaded MACVLAN Disable XPS for single queue devices Replace accel_priv with sb_dev in ndo_select_queue Add sb_dev parameter to fallback function for ndo_select_queue Consolidated ndo_select_queue functions that appeared to be duplicates ==================== Signed-off-by: David S. Miller commit 4929c9428a171145f82f81aae0c3c25ef7d82837 Author: Deepti Raghavan Date: Mon Jul 9 17:53:39 2018 +0000 tcp: expose both send and receive intervals for rate sample Congestion control algorithms, which access the rate sample through the tcp_cong_control function, only have access to the maximum of the send and receive interval, for cases where the acknowledgment rate may be inaccurate due to ACK compression or decimation. Algorithms may want to use send rates and receive rates as separate signals. Signed-off-by: Deepti Raghavan Acked-by: Neal Cardwell Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e0479b670d394d478907bd4fc22daab6516953c7 Author: Vlad Buslov Date: Mon Jul 9 20:26:47 2018 +0300 net: sched: fix unprotected access to rcu cookie pointer Fix action attribute size calculation function to take rcu read lock and access act_cookie pointer with rcu dereference. Fixes: eec94fdb0480 ("net: sched: use rcu for action cookie update") Reported-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 2368957ab54d9eb14aff10b80bab1a888b092bd7 Merge: b32b088181b9 31e5f5c3e92f Author: David S. Miller Date: Wed Jul 11 22:59:39 2018 -0700 Merge branch 'cxgb4-move-stats-fetched-from-firmware-to-debugfs' Rahul Lakkireddy says: ==================== cxgb4: move stats fetched from firmware to debugfs Some stats are fetched via slow firmware mailbox, which can cause packet drops under heavy load. So, this series removes these stats from ethtool -S and expose them via debugfs. Patch 1 removes stats fetched via firmware from ethtool -S. Patch 2 exposes stats removed in Patch 1 via debugfs. ==================== Signed-off-by: David S. Miller commit 31e5f5c3e92f6560485d7625f772e36aec6d42ec Author: Rahul Lakkireddy Date: Mon Jul 9 21:42:47 2018 +0530 cxgb4: expose stats fetched from firmware via debugfs Expose stats obtained from firmware via debugfs. These stats can't be part of ethtool -S because the slow firmware mailbox can cause packet drops under heavy load. Signed-off-by: Rahul Lakkireddy Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit b351b16d8aa75856592d47600d6b3c6abee7ecbd Author: Rahul Lakkireddy Date: Mon Jul 9 21:42:46 2018 +0530 cxgb4: remove stats fetched from firmware When running ethtool -S, some stats are requested from firmware. Since getting these stats via firmware mailbox is slow, some packets get dropped under heavy load while running ethtool -S. So, remove these stats from ethtool -S. Signed-off-by: Rahul Lakkireddy Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit b32b088181b96035e187cdd4a69813f04ba20380 Author: Antoine Tenart Date: Mon Jul 9 17:00:43 2018 +0200 net: mvpp2: explicitly include linux/interrupt.h The Marvell PPv2 driver uses interrupts and tasklet but does not explicitly include linux/interrupt.h, relying on implicit includes. This one particularly is included by chance after a long unlogical chain of inclusions. Fix this so we do not get future build breaks. Signed-off-by: Antoine Tenart Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller commit fb8ed3af74e3fc0ae1c72b363af2f0d7783e1cd5 Author: Jan Dakinevich Date: Mon Jul 9 16:51:19 2018 +0300 cnic: use kvzalloc to allocate memory for csk_tbl Size of csk_tbl is about 58K, which means 3rd order page allocation. kvzalloc provides a fallback if no high order memory is available. Signed-off-by: Jan Dakinevich Signed-off-by: David S. Miller commit 3c546728df983c3c1c232241249c238c143bcb9e Author: Colin Ian King Date: Mon Jul 9 13:23:13 2018 +0100 wimax/i2400m: remove redundant variables ack_status, bcf and protocol Variables ack_status, bcf and protocol are being assigned but are never used hence they are redundant and can be removed. Also declare ack_type as unsigned int rather than unsigned to clean up a checkpatch warning. Cleans up clang warnings: warning: variable 'ack_status' set but not used [-Wunused-but-set-variable] warning: variable 'bcf' set but not used [-Wunused-but-set-variable] warning: variable 'protocol' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 01e866bf07fbb10e96bff46ea1e5e0410d6e40b9 Author: Vlad Buslov Date: Mon Jul 9 14:33:26 2018 +0300 net: sched: act_ife: fix memory leak in ife init Free params if tcf_idr_check_alloc() returned error. Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action") Reported-by: Dan Carpenter Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 8dce04f1fd64ce5cf03e942d7644967890ae4483 Author: Arjun Vynipadath Date: Mon Jul 9 16:52:03 2018 +0530 cxgb4: specify IQTYPE in fw_iq_cmd congestion argument passed to t4_sge_alloc_rxq() is used to differentiate between nic/ofld queues. Signed-off-by: Arjun Vynipadath Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 57cd07fbf725616021831974d381751d68ef0e3c Merge: 5e9a0fe492f8 f168db5e25f7 Author: David S. Miller Date: Wed Jul 11 22:50:46 2018 -0700 Merge branch 'net-ipv6-addr_gen_mode-fixes' Sabrina Dubroca says: ==================== net/ipv6: addr_gen_mode fixes This series fixes bugs in handling of the addr_gen_mode option, mainly related to the sysctl. A minor netlink issue was also present in the initial commit introducing the option on a per-netdevice basis. v2: add patch 4, requested by David Ahern during review of v1 add patch 5, missing documentation for the sysctl patches 1, 2, 3 are unchanged ==================== Signed-off-by: David S. Miller commit f168db5e25f762b96d00ffd8c3908cf4066741dd Author: Sabrina Dubroca Date: Mon Jul 9 12:25:18 2018 +0200 Documentation: ip-sysctl.txt: document addr_gen_mode addr_gen_mode was introduced in without documentation, add it now. Fixes: d35a00b8e33d ("net/ipv6: allow sysctl to change link-local address generation mode") Signed-off-by: Sabrina Dubroca Reviewed-by: David Ahern Signed-off-by: David S. Miller commit f24c5987dddd28b23443e7b21b55d47549207755 Author: Sabrina Dubroca Date: Mon Jul 9 12:25:17 2018 +0200 net/ipv6: propagate net.ipv6.conf.all.addr_gen_mode to devices This aligns the addr_gen_mode sysctl with the expected behavior of the "all" variant. Fixes: d35a00b8e33d ("net/ipv6: allow sysctl to change link-local address generation mode") Suggested-by: David Ahern Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit bdd72f41333d9f61a22e4c4494e95782e9731fdb Author: Sabrina Dubroca Date: Mon Jul 9 12:25:16 2018 +0200 net/ipv6: reserve room for IFLA_INET6_ADDR_GEN_MODE inet6_ifla6_size() is called to check how much space is needed by inet6_fill_link_af() and inet6_fill_ifinfo(), both of which include the IFLA_INET6_ADDR_GEN_MODE attribute. Reserve some room for it. Fixes: bc91b0f07ada ("ipv6: addrconf: implement address generation modes") Signed-off-by: Sabrina Dubroca Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 70c30d76e580fe4aefe6facdf0f1edb1aa9a0e7a Author: Sabrina Dubroca Date: Mon Jul 9 12:25:15 2018 +0200 net/ipv6: don't reinitialize ndev->cnf.addr_gen_mode on new inet6_dev The value has already been copied from this netns's devconf_dflt, it shouldn't be reset to the global kernel default. Fixes: d35a00b8e33d ("net/ipv6: allow sysctl to change link-local address generation mode") Signed-off-by: Sabrina Dubroca Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c6dbf7aaa48289d2eeacbef06785c069869ed0c0 Author: Sabrina Dubroca Date: Mon Jul 9 12:25:14 2018 +0200 net/ipv6: fix addrconf_sysctl_addr_gen_mode addrconf_sysctl_addr_gen_mode() has multiple problems. First, it ignores the errors returned by proc_dointvec(). addrconf_sysctl_addr_gen_mode() calls proc_dointvec() directly, which writes the value to memory, and then checks if it's valid and may return EINVAL. If a bad value is given, the value displayed when reading net.ipv6.conf.foo.addr_gen_mode next time will be invalid. In case the value provided by the user was valid, addrconf_dev_config() won't be called since idev->cnf.addr_gen_mode has already been updated. Fix this in the usual way we deal with values that need to be checked after the proc_do*() helper has returned: define a local ctl_table and storage, call proc_dointvec() on that temporary area, then check and store. addrconf_sysctl_addr_gen_mode() also writes the new value to the global ipv6_devconf_dflt, when we're writing to some netns's default, so that new netns will inherit the value that was set by the change occuring in any netns. That doesn't make any sense, so let's drop this assignment. Finally, since addr_gen_mode is a __u32, switch to proc_douintvec(). Fixes: d35a00b8e33d ("net/ipv6: allow sysctl to change link-local address generation mode") Signed-off-by: Sabrina Dubroca Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 5e9a0fe492f89ff1c7583ee6ea89dc37b8c2e5c2 Author: Jianbo Liu Date: Mon Jul 9 02:26:20 2018 +0000 net/sched: flower: Fix null pointer dereference when run tc vlan command Zahari issued tc vlan command without setting vlan_ethtype, which will crash kernel. To avoid this, we must check tb[TCA_FLOWER_KEY_VLAN_ETH_TYPE] is not null before use it. Also we don't need to dump vlan_ethtype or cvlan_ethtype in this case. Fixes: d64efd0926ba ('net/sched: flower: Add supprt for matching on QinQ vlan headers') Signed-off-by: Jianbo Liu Reported-by: Zahari Doychev Signed-off-by: David S. Miller commit efe803277364a621348b679058222d644e113c9c Author: Carlos Maiolino Date: Wed Jul 11 22:26:36 2018 -0700 xfs: Initialize variables in xfs_alloc_get_rec before using them Make sure we initialize *bno and *len, before jumping to out_bad_rec label, and risk calling xfs_warn() with uninitialized variables. Coverity: 100898 Coverity: 1437081 Coverity: 1437129 Coverity: 1437191 Coverity: 1437201 Coverity: 1437212 Coverity: 1437341 Signed-off-by: Carlos Maiolino Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a4722a643fbb9e1466491fbe5a3c44591805dcc8 Author: Eric Sandeen Date: Wed Jul 11 22:26:36 2018 -0700 xfs: remove unused iolock arg from xfs_break_dax_layouts Signed-off-by: Eric Sandeen Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit bb00b6f1e2b9699f6140849ab3d6a252b130f44e Author: Brian Foster Date: Wed Jul 11 22:26:35 2018 -0700 xfs: kill __xfs_buf_submit_common() Now that there is only one caller, fold the common submission helper into __xfs_buf_submit(). Suggested-by: Christoph Hellwig Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6af88cda007695af003a1cd41f077c826aa59b97 Author: Brian Foster Date: Wed Jul 11 22:26:35 2018 -0700 xfs: combine [a]sync buffer submission apis The buffer I/O submission path consists of separate function calls per type. The buffer I/O type is already controlled via buffer state (XBF_ASYNC), however, so there is no real need for separate submission functions. Combine the buffer submission functions into a single function that processes the buffer appropriately based on XBF_ASYNC. Retain an internal helper with a conditional wait parameter to continue to support batched !XBF_ASYNC submission/completion required by delwri queues. Suggested-by: Christoph Hellwig Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e339dd8d8b045399e918c6737b2cc435b21a451e Author: Brian Foster Date: Wed Jul 11 22:26:34 2018 -0700 xfs: use sync buffer I/O for sync delwri queue submission If a delwri queue occurs of a buffer that sits on a delwri queue wait list, the queue sets _XBF_DELWRI_Q without changing the state of ->b_list. This occurs, for example, if another thread beats the current delwri waiter thread to the buffer lock after I/O completion. Once the waiter acquires the lock, it removes the buffer from the wait list and leaves a buffer with _XBF_DELWRI_Q set but not populated on a list. This results in a lost buffer submission and in turn can result in assert failures due to _XBF_DELWRI_Q being set on buffer reclaim or filesystem lockups if the buffer happens to cover an item in the AIL. This problem has been reproduced by repeated iterations of xfs/305 on high CPU count (28xcpu) systems with limited memory (~1GB). Dirty dquot reclaim races with an xfsaild push of a separate dquot backed by the same buffer such that the buffer sits on the reclaim wait list at the time xfsaild attempts to queue it. Since the latter dquot has been flush locked but the underlying buffer not submitted for I/O, the dquot pins the AIL and causes the filesystem to livelock. This race is essentially made possible by the buffer lock cycle involved with waiting on a synchronous delwri queue submission. Close the race by using synchronous buffer I/O for respective delwri queue submission. This means the buffer remains locked across the I/O and so is inaccessible from other contexts while in the intermediate wait list state. The sync buffer I/O wait mechanism is factored into a helper such that sync delwri buffer submission and serialization are batched operations. Designed-by: Dave Chinner Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit eaebb515f1a4728565c482b13dfb17273dc4ddc8 Author: Brian Foster Date: Wed Jul 11 22:26:34 2018 -0700 xfs: refactor buffer submission into a common helper Sync and async buffer submission both do generally similar things with a couple odd exceptions. Refactor the core buffer submission code into a common helper to isolate buffer submission from completion handling of synchronous buffer I/O. This patch does not change behavior. It is a step towards support for using synchronous buffer I/O via synchronous delwri queue submission. Designed-by: Dave Chinner Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 5fdd97944ee5ae0fcdd88227224d0c2c87aa6db9 Author: Brian Foster Date: Wed Jul 11 22:26:33 2018 -0700 xfs: remove xfs_defer_init() firstblock param All but one caller of xfs_defer_init() passes in the ->t_firstblock of the associated transaction. The one outlier is xlog_recover_process_intents(), which simply passes a dummy value because a valid pointer is required. This firstblock variable can simply be removed. At this point we could remove the xfs_defer_init() firstblock parameter and initialize ->t_firstblock directly. Even that is not necessary, however, because ->t_firstblock is automatically reinitialized in the new transaction on a transaction roll. Since xfs_defer_init() should never occur more than once on a particular transaction (since the corresponding finish will roll it), replace the reinit from xfs_defer_init() with an assert that verifies the transaction has a NULLFSBLOCK firstblock. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9c3bf5da80efc1d502c7ef55ea5b77628e341510 Author: Brian Foster Date: Wed Jul 11 22:26:32 2018 -0700 xfs: use ->t_firstblock in inode inactivate Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f537538921872c772aa743d8b58b69e7729c73aa Author: Brian Foster Date: Wed Jul 11 22:26:32 2018 -0700 xfs: use ->t_firstblock in extent swap Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 381d592848721cb1b82b4ea9f57b46cf4a4a6973 Author: Brian Foster Date: Wed Jul 11 22:26:31 2018 -0700 xfs: use ->t_firstblock in reflink cow block cancel Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fb91f4b5d6187996796f4a9989decdf6ead12851 Author: Brian Foster Date: Wed Jul 11 22:26:31 2018 -0700 xfs: replace no-op firstblock init with ->t_firstblock xfs_refcount_recover_cow_leftovers() has no need for a firstblock variable and so passes an unrelated xfs_fsblock_t to xfs_defer_init() to avoid declaring one. Replace this no-op initialization with ->t_firstblock. This will be optimized away by the removal of the xfs_defer_init() firstblock param. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 058529c5f51cd680eddbc6c42f56d490e290dd78 Author: Brian Foster Date: Wed Jul 11 22:26:30 2018 -0700 xfs: use ->t_firstblock in dq alloc Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 64396ff2c25b2cd8156948a64ae0da5ff962e3f2 Author: Brian Foster Date: Wed Jul 11 22:26:30 2018 -0700 xfs: remove xfs_alloc_arg firstblock field The xfs_alloc_arg.firstblock field is used to control the starting agno for an allocation. The structure already carries a pointer to the transaction, which carries the current firstblock value. Remove the field and access ->t_firstblock directly in the allocation code. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit cf612de732cb6ef626019ca085406d183f0a055a Author: Brian Foster Date: Wed Jul 11 22:26:29 2018 -0700 xfs: remove xfs_btree_cur private firstblock field The bmbt cursor private structure has a firstblock field that is used to maintain locking order on bmbt allocations. The field holds an actual firstblock value (as opposed to a pointer), so it is initialized on cursor creation, updated on allocation and then the value is transferred back to the source before the cursor is destroyed. This value is always transferred from and back to the ->t_firstblock field. Since xfs_btree_cur already carries a reference to the transaction, we can remove this field from xfs_btree_cur and the associated copying. The bmbt allocations will update the value in the transaction directly. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 280253d213fb735b565532be2836f94cf574260d Author: Brian Foster Date: Wed Jul 11 22:26:29 2018 -0700 xfs: remove bmap format helpers firstblock params The bmap format helpers receive firstblock via ->t_firstblock. Drop the param and access it directly. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 92f9da30f57bdb653ee46f26df2d51484b27c7f0 Author: Brian Foster Date: Wed Jul 11 22:26:28 2018 -0700 xfs: remove bmap extent add helper firstblock params The add extent helpers all receive firstblock via ->t_firstblock. Drop the parameter and access it directly. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 94c07b4dba01481740ce893d05a71578150b8f0b Author: Brian Foster Date: Wed Jul 11 22:26:28 2018 -0700 xfs: remove xfs_bmalloca firstblock field The xfs_bmalloca.firstblock field carries the firstblock value from the transaction into the bmap infrastructure. It's initialized in one place from ->t_firstblock, so drop the field and access ->t_firstblock directly throughout the bmap code. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 4b77a088d781b53d263c37e75222439297b410e5 Author: Brian Foster Date: Wed Jul 11 22:26:27 2018 -0700 xfs: use ->t_firstblock in bmap extent split Also remove the unnecessary xfs_bmap_split_extent_at() parameter. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 333f950c89a17018f812eae13daaa2a404c413c1 Author: Brian Foster Date: Wed Jul 11 22:26:27 2018 -0700 xfs: remove bmap insert/collapse firstblock param The only callers pass ->t_firstblock. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2af528425342dc8f696b28693c5e61587cd72b43 Author: Brian Foster Date: Wed Jul 11 22:26:25 2018 -0700 xfs: remove xfs_bunmapi() firstblock param All callers pass ->t_firstblock from the current transaction. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a7beabeae221db2118a51f6948239d63b84499ca Author: Brian Foster Date: Wed Jul 11 22:26:25 2018 -0700 xfs: remove xfs_bmapi_write() firstblock param All callers pass ->t_firstblock from the current transaction. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d0a9d795729945fc7eea77387af7780a5a0ec4c5 Author: Brian Foster Date: Wed Jul 11 22:26:24 2018 -0700 xfs: use ->t_firstblock in insert/collapse range Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 580c4ff9484ac3395ad48b1118b269a6d68c9318 Author: Brian Foster Date: Wed Jul 11 22:26:24 2018 -0700 xfs: use ->t_firstblock in xfs_bmapi_remap() Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 372837978d90d1c563315192196735c09623a5d6 Author: Brian Foster Date: Wed Jul 11 22:26:23 2018 -0700 xfs: use ->t_firstblock for all xfs_bunmapi() callers Convert all xfs_bunmapi() callers to ->t_firstblock. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 650919f13182e8deeeeaeb580570afb0cdf8bd0d Author: Brian Foster Date: Wed Jul 11 22:26:23 2018 -0700 xfs: use ->t_firstblock for all xfs_bmapi_write() callers Convert all xfs_bmapi_write() users to ->t_firstblock. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 766139032f95bb41031f6de9c2ee0538bd035229 Author: Brian Foster Date: Wed Jul 11 22:26:22 2018 -0700 xfs: use ->t_firstblock in xattr ops Similar to the dirops code, the xattr code uses an on-stack firstblock variable for the various operations. This code rolls the underlying transaction in various places, however, which means we cannot simply replace the local firstblock vars with ->t_firstblock. Doing so (without further changes) would invalidate the memory pointed to by xfs_da_args.firstblock as soon as the first transaction rolls. To avoid this problem, remove xfs_da_args.firstblock and replace all such accesses with ->t_firstblock at the same time. This ensures that accesses to the current firstblock always occur through the current transaction rather than a potentially invalid xfs_da_args pointer. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 825d75cd8c1b53883dd8c2fe1d8833c371b08074 Author: Brian Foster Date: Wed Jul 11 22:26:21 2018 -0700 xfs: use ->t_firstblock in attrfork add Note that this codepath is a user of struct xfs_da_args. Switch it over to ->t_firstblock in preparation to remove xfs_da_args.firstblock. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 381eee69f862d38bef468e91517e37fc53f60885 Author: Brian Foster Date: Wed Jul 11 22:26:21 2018 -0700 xfs: remove firstblock param from xfs dir ops All callers of the xfs_dir_*() functions pass ->t_firstblock as the firstblock parameter. Drop the parameter and access ->t_firstblock directly. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f16dea54b789aad464ae4f34caea9f8d81052729 Author: Brian Foster Date: Wed Jul 11 22:26:20 2018 -0700 xfs: use ->t_firstblock in dir ops Callers of the xfs_dir_*() functions currently pass an on-stack firstblock variable. While the dirops infrastructure carries a pointer to this variable, it never rolls the transaction and so it is safe to use ->t_firstblock instead. Fix up the various xfs_dir_*() callers to use ->t_firstblock. Also remove the unnecessary parameter for xfs_cross_rename(). Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit bba59c5e4b38e160c6be25b2f4fe36ebc84f53df Author: Brian Foster Date: Wed Jul 11 22:26:20 2018 -0700 xfs: add firstblock field to xfs_trans A firstblock var is typically allocated and initialized along with xfs_defer_ops structures and passed around independent from the associated transaction. To facilitate combining the two, add an optional ->t_firstblock field to xfs_trans that can be used in place of an on-stack variable. The firstblock value follows the lifetime of the transaction, so initialize it on allocation and when a transaction rolls. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3ae2d89174e4ba581093320afb48421ca95191d2 Author: Brian Foster Date: Wed Jul 11 22:26:19 2018 -0700 xfs: allow null firstblock in xfs_bmapi_write() when tp is null xfs_bmapi_write() always expects a valid firstblock pointer. It immediately dereferences the pointer to help determine how to initialize the bma.minleft field. The remaining accesses are related to modifying btree format forks, which is only relevant for !COW fork callers. The reflink code passes a NULL transaction to xfs_bmapi_write() in a couple places that do COW fork unwritten conversion. The purpose of the firstblock field is to track the first block allocation in the current transaction, so technically firstblock should not be required for these callers either. Tweak xfs_bmapi_write() to initialize the bma correctly without accessing the firstblock pointer if no transaction is provided in the first place. Update the reflink callers to pass NULL instead of otherwise unused firstblock references. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit bcd2c9f33559764e0d306e226a8aa88bc2e1e6fb Author: Brian Foster Date: Wed Jul 11 22:26:19 2018 -0700 xfs: refactor dfops init to attach to transaction Most callers of xfs_defer_init() immediately attach the dfops structure to a transaction. Add a transaction parameter to eliminate much of this boilerplate code. This also helps self-document the fact that many codepaths now expect a dfops pointer implicitly via xfs_trans->t_dfops. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d5669ed58175f85d2c13e914c5c4e2bd3647d893 Author: Brian Foster Date: Wed Jul 11 22:26:18 2018 -0700 xfs: use ->t_dfops in reflink cow recover path Use ->t_dfops of the leftover COW reservation cleanup transaction. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 27356a063a8572b2d3bf57d92b0a12399478958a Author: Brian Foster Date: Wed Jul 11 22:26:18 2018 -0700 xfs: use ->t_dfops in cancel cow blocks operation Use ->t_dfops of the transaction from the caller. Reset it before we return to avoid leaks of local stack memory. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 7a7943c7e09546d4cc78b9756de23fd395b2cba4 Author: Brian Foster Date: Wed Jul 11 22:26:17 2018 -0700 xfs: use ->t_dfops for rmap extent swap operations xfs_swap_extent_rmap() uses a local dfops instance with a transaction from the caller. Since there is only one caller, pull the dfops structure into the caller and attach it to the transaction. This avoids the need to clear ->t_dfops to prevent invalid stack memory access. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ed7ef8e55c6f24ae4347b5bda89e00af475ebc89 Author: Brian Foster Date: Wed Jul 11 22:26:17 2018 -0700 xfs: remove unused btree cursor bc_private.a.dfops field The xfs_btree_cur.bc_private.a.dfops field is only ever initialized by the refcountbt cursor init function. The only caller of that function with a non-NULL dfops is from deferred completion context, which already has attached to ->t_dfops. In addition to that, the only actual reference of a.dfops is the cursor duplication function, which means the field is effectively unused. Remove the dfops field from the bc_private.a union. Any future users can acquire the dfops from the transaction. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 42b394a92562b464e9ef81954ca93930c037a51b Author: Brian Foster Date: Wed Jul 11 22:26:16 2018 -0700 xfs: remove xfs_btree_cur bmbt dfops field All assignments of xfs_btree_cur.bc_private.b.dfops originate from ->t_dfops. Replace accesses of the former with the latter and remove the unnecessary field. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 81ba8f3e947c3c53beb535c7f29fe402429cae37 Author: Brian Foster Date: Wed Jul 11 22:26:16 2018 -0700 xfs: remove dfops param from internal bmap extent helpers All callers of the various bmap extent helpers now use ->t_dfops. Remove the unnecessary dfops params and access ->t_dfops directly. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f4a9cf97faf4adb27e4e105beda420bb5253c502 Author: Brian Foster Date: Wed Jul 11 22:26:15 2018 -0700 xfs: use ->t_dfops for collapse/insert range operations Use ->t_dfops for the collapse and insert range transactions. These are the only callers of the respective bmap helpers, so replace the unnecessary dfops parameters with direct accesses to ->t_dfops. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3e3673e3029c1dedf75a1688a5203d9550adf490 Author: Brian Foster Date: Wed Jul 11 22:26:14 2018 -0700 xfs: remove struct xfs_bmalloca dfops field Now that bma.dfops is only assigned from ->t_dfops, replace all accesses to the former with the latter and remove the unnecessary field. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ff3edf255da7a1ceb0fb2cb7f195fc27edd0091d Author: Brian Foster Date: Wed Jul 11 22:26:14 2018 -0700 xfs: remove xfs_bmapi_remap() dfops param All xfs_bmapi_remap() callers already use ->t_dfops. Note that deferred completion context unconditionally sets ->t_dfops if it hasn't already been set by the caller. Remove the unnecessary parameter and access ->t_dfops directly. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ccd9d91148780a5e979ac00bce67c2155fb6378f Author: Brian Foster Date: Wed Jul 11 22:26:13 2018 -0700 xfs: remove xfs_bunmapi() dfops param Now that all xfs_bunmapi() callers use ->t_dfops, remove the unnecessary parameter and access ->t_dfops directly. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 4bcfa613a0582a9992a6c2af82273bd770103d12 Author: Brian Foster Date: Wed Jul 11 22:26:13 2018 -0700 xfs: use ->t_dfops for all xfs_bunmapi() callers Use ->t_dfops for all remaining xfs_bunmapi() callers. This prepares the latter to no longer require a dfops parameter. Note that xfs_itruncate_extents_flags() associates a local dfops with a transaction provided from the caller. Since there are multiple callers, set and reset ->t_dfops before the function returns to avoid exposure of stack memory to the caller. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6e702a5dcbe1d38cf479931dd2e2a3da884143f0 Author: Brian Foster Date: Wed Jul 11 22:26:12 2018 -0700 xfs: remove xfs_bmapi_write() dfops param Now that all callers use ->t_dfops, the xfs_bmapi_write() dfops parameter is no longer necessary. Remove it and access ->t_dfops directly. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 175d1a013eaf35c802e0195d87ac2a8df83ad42a Author: Brian Foster Date: Wed Jul 11 22:26:12 2018 -0700 xfs: use ->t_dfops for all xfs_bmapi_write() callers Attach ->t_dfops for all remaining callers of xfs_bmapi_write(). This prepares the latter to no longer require a separate dfops parameter. Note that xfs_symlink() already uses ->t_dfops. Fix up the local references for consistency. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2ba13721257e2c76e90e8d83dfd9ba91c434355d Author: Brian Foster Date: Wed Jul 11 22:26:11 2018 -0700 xfs: use ->t_dfops in dqalloc transaction xfs_dquot_disk_alloc() receives a transaction from the caller and passes a local dfops along to xfs_bmapi_write(). If we attach this dfops to the transaction, we have to make sure to clear it before returning to avoid invalid access of stack memory. Since xfs_qm_dqread_alloc() is the only caller, pull dfops into the caller and attach it to the transaction to eliminate this pattern entirely. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 32a9b7c65cfc7d9283055fc9d61e6393ee2aa984 Author: Brian Foster Date: Wed Jul 11 22:26:11 2018 -0700 xfs: replace xfs_da_args->dfops accesses with ->t_dfops and remove Now that xfs_da_args->dfops is always assigned from a ->t_dfops pointer (or one that is immediately attached), replace all downstream accesses of the former with the latter and remove the field from struct xfs_da_args. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d76e6ce8ed6943941c0c964d8ae43fdaefdcbb5a Author: Brian Foster Date: Wed Jul 11 22:26:10 2018 -0700 xfs: use ->t_dfops in extent split tx and remove param Attach the local dfops to ->t_dfops of the extent split transaction. Since this is the only caller of xfs_bmap_split_extent_at(), remove the dfops parameter as well. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0bd6207f836446f9d472f342a0ba3c21fe5e986f Author: Brian Foster Date: Wed Jul 11 22:26:10 2018 -0700 xfs: remove dfops param in attr fork add path Now that the attribute fork add tx carries dfops along with the transaction, it is unnecessary to pass it down the stack. Remove the dfops parameter and access ->t_dfops directly where necessary. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 40d03ac6aa2bebe05190462734690472310167e4 Author: Brian Foster Date: Wed Jul 11 22:26:09 2018 -0700 xfs: use ->t_dfops for attr set/remove operations Attach the local dfops to the transaction allocated for xattr add and remove operations. Add an earlier initialization in xfs_attr_remove() to ensure the structure is valid if it remains unused at transaction commit time. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 813d08cb6de0af43da40393aebff914d2de9e50e Author: Brian Foster Date: Wed Jul 11 22:26:09 2018 -0700 xfs: use ->t_dfops for recovery of [b|c]ui log items Log recovery passes down a central dfops structure to recovery handlers for bui and cui log items. Each of these handlers allocates and commits a transaction and defers any remaining operations to be completed by the main recovery sequence. Since dfops outlives the transaction in this context, set and clear ->t_dfops appropriately such that the *_finish_item() paths and below (i.e., xfs_bmapi*()) can expect to find the dfops in the transaction without it being committed with the dfops attached. This is required because transaction commit expects that an associated dfops is finished and in this context the dfops may be populated at commit time. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c9cfdb381172174ade2445e7b468f1be550b1a44 Author: Brian Foster Date: Wed Jul 11 22:26:08 2018 -0700 xfs: remove dfops param from high level dirname calls All callers of the directory create, rename and remove interfaces already associate the dfops with the transaction. Drop the dfops parameters in these calls in preparation for further cleanups in the layers below. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0e0417f3e54668cec9f677850130e6fbb64edcf2 Author: Brian Foster Date: Wed Jul 11 22:26:07 2018 -0700 xfs: remove dfops parameter from ifree call stack The inode free callchain starting in xfs_inactive_ifree() already associates its dfops with the transaction. It still passes the dfops on the stack down through xfs_difree_inobt(), however. Clean up the call stack and reference dfops directly from the transaction. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6aa6718439ac6907b3c34cbe7ac2c71408f84f6e Author: Brian Foster Date: Wed Jul 11 22:26:07 2018 -0700 xfs: rename xfs_trans ->t_agfl_dfops to ->t_dfops The ->t_agfl_dfops field is currently used to defer agfl block frees from associated transaction contexts. While all known problematic contexts have already been updated to use ->t_agfl_dfops, the broader goal is defer agfl frees from all callers that already use a deferred operations structure. Further, the transaction field facilitates a good amount of code clean up where the transaction and dfops have historically been passed down through the stack separately. Rename the field to something more generic to prepare to use it as such throughout XFS. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8a749386498327c98c2792e19eeeaa21dafc6954 Author: Brian Foster Date: Wed Jul 11 22:26:06 2018 -0700 xfs: cow unwritten conversion uses uninitialized dfops A couple COW fork unwritten extent conversion helpers pass an uninitialized dfops pointer to xfs_bmapi_write(). This does not cause problems because conversion does not use a transaction or the dfops structure for the COW fork. Drop the uninitialized usage of dfops in these codepaths and pass NULL along to xfs_bmapi_write() instead. Signed-off-by: Brian Foster Reviewed-by: Carlos Maiolino Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 98c1a7c0ece345dc8e34c0c85703e4df9fdfd071 Author: Christoph Hellwig Date: Wed Jul 11 22:26:06 2018 -0700 xfs: update my copyrights for the writeback and iomap code Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 82cb14175e7ddb08721fb1d766195cd10dad791a Author: Christoph Hellwig Date: Wed Jul 11 22:26:05 2018 -0700 xfs: add support for sub-pagesize writeback without buffer_heads Switch to using the iomap_page structure for checking sub-page uptodate status and track sub-page I/O completion status, and remove large quantities of boilerplate code working around buffer heads. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9dc55f1389f9569acf9659e58dd836a9c70df217 Author: Christoph Hellwig Date: Wed Jul 11 22:26:05 2018 -0700 iomap: add support for sub-pagesize buffered I/O without buffer heads After already supporting a simple implementation of buffered writes for the blocksize == PAGE_SIZE case in the last commit this adds full support even for smaller block sizes. There are three bits of per-block information in the buffer_head structure that really matter for the iomap read and write path: - uptodate status (BH_uptodate) - marked as currently under read I/O (BH_Async_Read) - marked as currently under write I/O (BH_Async_Write) Instead of having new per-block structures this now adds a per-page structure called struct iomap_page to track this information in a slightly different form: - a bitmap for the per-block uptodate status. For worst case of a 64k page size system this bitmap needs to contain 128 bits. For the typical 4k page size case it only needs 8 bits, although we still need a full unsigned long due to the way the atomic bitmap API works. - two atomic_t counters are used to track the outstanding read and write counts There is quite a bit of boilerplate code as the buffered I/O path uses various helper methods, but the actual code is very straight forward. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ac8ee54669c07e6b38b4cae13a65f5ec06a11323 Author: Christoph Hellwig Date: Wed Jul 11 22:26:04 2018 -0700 xfs: allow writeback on pages without buffer heads Disable the IOMAP_F_BUFFER_HEAD flag on file systems with a block size equal to the page size, and deal with pages without buffer heads in writeback. Thanks to the previous refactoring this is basically trivial now. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8e1f065bea1b1c128c92ef7e386779a23cd5d342 Author: Christoph Hellwig Date: Wed Jul 11 22:26:04 2018 -0700 xfs: refactor the tail of xfs_writepage_map Rejuggle how we deal with the different error vs non-error and have ioends vs not have ioend cases to keep the fast path streamlined, and the duplicate code at a minimum. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1b65d3dd2d5e938b035b2ad73d0b47f35b5ef9a0 Author: Christoph Hellwig Date: Wed Jul 11 22:26:03 2018 -0700 xfs: remove xfs_start_page_writeback This helper only has two callers, one of them with a constant error argument. Remove it to make pending changes to the code a little easier. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6d465e895343225e3ad35fe10d7b3e9f2f18faec Author: Christoph Hellwig Date: Wed Jul 11 22:26:03 2018 -0700 xfs: move all writeback buffer_head manipulation into xfs_map_at_offset This keeps it in a single place so it can be made otional more easily. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3faed667644d787c3cf6f977f80bac7a013eb045 Author: Christoph Hellwig Date: Wed Jul 11 22:26:02 2018 -0700 xfs: don't look at buffer heads in xfs_add_to_ioend Calculate all information for the bio based on the passed in information without requiring a buffer_head structure. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 889c65b3f60af4c840896478fc6151363ffa279f Author: Christoph Hellwig Date: Wed Jul 11 22:26:02 2018 -0700 xfs: remove the imap_valid flag Simplify the way we check for a valid imap - we know we have a valid mapping after xfs_map_blocks returned successfully, and we know we can call xfs_imap_valid on any imap, as it will always fail on a zero-initialized map. We can also remove the xfs_imap_valid function and fold it into xfs_map_blocks now. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3345746ef38bb794ae9d4d0762adf151e452663e Author: Christoph Hellwig Date: Wed Jul 11 22:26:02 2018 -0700 xfs: simplify xfs_map_blocks by using xfs_iext_lookup_extent directly xfs_bmapi_read adds zero value in xfs_map_blocks. Replace it with a direct call to the low-level extent lookup function. Note that we now always pass a 0 length to the trace points as we ask for an unspecified len. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 060d4eaa0bf30a8fc2d189e4d4922f6e9027857b Author: Christoph Hellwig Date: Wed Jul 11 22:26:01 2018 -0700 xfs: remove xfs_reflink_find_cow_mapping We only have one caller left, and open coding the simple extent list lookup in it allows us to make the code both more understandable and reuse calculations and variables already present. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c3a2f9fff1bbe3cfc2070b2e9f1f0ad0d5ccda91 Author: Christoph Hellwig Date: Wed Jul 11 22:26:01 2018 -0700 xfs: remove the now unused XFS_BMAPI_IGSTATE flag Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e2f6ad4624dfbde3a6c42c0cfbfc5553d93c3cae Author: Dave Chinner Date: Wed Jul 11 22:26:00 2018 -0700 xfs: make xfs_writepage_map extent map centric xfs_writepage_map() iterates over the bufferheads on a page to decide what sort of IO to do and what actions to take. However, when it comes to reflink and deciding when it needs to execute a COW operation, we no longer look at the bufferhead state but instead we ignore than and look up internal state held in the COW fork extent list. This means xfs_writepage_map() is somewhat confused. It does stuff, then ignores it, then tries to handle the impedence mismatch by shovelling the results inside the existing mapping code. It works, but it's a bit of a mess and it makes it hard to fix the cached map bug that the writepage code currently has. To unify the two different mechanisms, we first have to choose a direction. That's already been set - we're de-emphasising bufferheads so they are no longer a control structure as we need to do taht to allow for eventual removal. Hence we need to move away from looking at bufferhead state to determine what operations we need to perform. We can't completely get rid of bufferheads yet - they do contain some state that is absolutely necessary, such as whether that part of the page contains valid data or not (buffer_uptodate()). Other state in the bufferhead is redundant: BH_dirty - the page is dirty, so we can ignore this and just write it BH_delay - we have delalloc extent info in the DATA fork extent tree BH_unwritten - same as BH_delay BH_mapped - indicates we've already used it once for IO and it is mapped to a disk address. Needs to be ignored for COW blocks. The BH_mapped flag is an interesting case - it's supposed to indicate that it's already mapped to disk and so we can just use it "as is". In theory, we don't even have to do an extent lookup to find where to write it too, but we have to do that anyway to determine we are actually writing over a valid extent. Hence it's not even serving the purpose of avoiding a an extent lookup during writeback, and so we can pretty much ignore it. Especially as we have to ignore it for COW operations... Therefore, use the extent map as the source of information to tell us what actions we need to take and what sort of IO we should perform. The first step is to have xfs_map_blocks() set the io type according to what it looks up. This means it can easily handle both normal overwrite and COW cases. The only thing we also need to add is the ability to return hole mappings. We need to return and cache hole mappings now for the case of multiple blocks per page. We no longer use the BH_mapped to indicate a block over a hole, so we have to get that info from xfs_map_blocks(). We cache it so that holes that span two pages don't need separate lookups. This allows us to avoid ever doing write IO over a hole, too. Now that we have xfs_map_blocks() returning both a cached map and the type of IO we need to perform, we can rewrite xfs_writepage_map() to drop all the bufferhead control. It's also much simplified because it doesn't need to explicitly handle COW operations. Instead of iterating bufferheads, it iterates blocks within the page and then looks up what per-block state is required from the appropriate bufferhead. It then validates the cached map, and if it's not valid, we get a new map. If we don't get a valid map or it's over a hole, we skip the block. At this point, we have to remap the bufferhead via xfs_map_at_offset(). As previously noted, we had to do this even if the buffer was already mapped as the mapping would be stale for XFS_IO_DELALLOC, XFS_IO_UNWRITTEN and XFS_IO_COW IO types. With xfs_map_blocks() now controlling the type, even XFS_IO_OVERWRITE types need remapping, as converted-but-not-yet- written delalloc extents beyond EOF can be reported at XFS_IO_OVERWRITE. Bufferheads that span such regions still need their BH_Delay flags cleared and their block numbers calculated, so we now unconditionally map each bufferhead before submission. But wait! There's more - remember the old "treat unwritten extents as holes on read" hack? Yeah, that means we can have a dirty page with unmapped, unwritten bufferheads that contain data! What makes these so special is that the unwritten "hole" bufferheads do not have a valid block device pointer, so if we attempt to write them xfs_add_to_ioend() blows up. So we make xfs_map_at_offset() do the "realtime or data device" lookup from the inode and ignore what was or wasn't put into the bufferhead when the buffer was instantiated. The astute reader will have realised by now that this code treats unwritten extents in multiple-blocks-per-page situations differently. If we get any combination of unwritten blocks on a dirty page that contain valid data in the page, we're going to convert them to real extents. This can actually be a win, because it means that pages with interleaving unwritten and written blocks will get converted to a single written extent with zeros replacing the interspersed unwritten blocks. This is actually good for reducing extent list and conversion overhead, and it means we issue a contiguous IO instead of lots of little ones. The downside is that we use up a little extra IO bandwidth. Neither of these seem like a bad thing given that spinning disks are seek sensitive, and SSDs/pmem have bandwidth to burn and the lower Io latency/CPU overhead of fewer, larger IOs will result in better performance on them... As a result of all this, the only state we actually care about from the bufferhead is a single flag - BH_Uptodate. We still use the bufferhead to pass some information to the bio via xfs_add_to_ioend(), but that is trivial to separate and pass explicitly. This means we really only need 1 bit of state per block per page from the buffered write path in the writeback path. Everything else we do with the bufferhead is purely to make the buffered IO front end continue to work correctly. i.e we've pretty much marginalised bufferheads in the writeback path completely. Signed-off-By: Dave Chinner [hch: forward port, refactor and split off bits into other commits] Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 6a4c95013608120b2d88be67c6871cb6b86aa5d6 Author: Christoph Hellwig Date: Wed Jul 11 22:26:00 2018 -0700 xfs: rename the offset variable in xfs_writepage_map Calling it file_offset makes the usage more clear, especially with a new poffset variable that will be added soon for the offset inside the page. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 5c665e5b5af6b8ad3e38ee73cb495ec695bcf589 Author: Christoph Hellwig Date: Wed Jul 11 22:25:59 2018 -0700 xfs: remove xfs_map_cow We can handle the existing cow mapping case as a special case directly in xfs_writepage_map, and share code for allocating delalloc blocks with regular I/O in xfs_map_blocks. This means we need to always call xfs_map_blocks for reflink inodes, but we can still skip most of the work if it turns out that there is no COW mapping overlapping the current block. As a subtle detail we need to start caching holes in the wpc to deal with the case of COW reservations between EOF. But we'll need that infrastructure later anyway, so this is no big deal. Based on a patch from Dave Chinner. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fca8c805425c0d9435097a6c780e95332e54613a Author: Christoph Hellwig Date: Wed Jul 11 22:25:59 2018 -0700 xfs: remove xfs_reflink_trim_irec_to_next_cow We already have to check for overlapping COW extents everytime we come back to a page in xfs_writepage_map / xfs_map_cow, so this additional trim is not required. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a7b28f72ab90fe7a2f438360df5f6fda4237afdc Author: Christoph Hellwig Date: Wed Jul 11 22:25:59 2018 -0700 xfs: don't use XFS_BMAPI_IGSTATE in xfs_map_blocks We want to be able to use the extent state as a reliably indicator for the type of I/O, and stop using the buffer head state. For this we need to stop using the XFS_BMAPI_IGSTATE so that we don't see merged extents of different types. Based on a patch from Dave Chinner. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c57371a16d074bb4eafe6b73f29360085ecb2064 Author: Christoph Hellwig Date: Wed Jul 11 22:25:58 2018 -0700 xfs: don't clear imap_valid for a non-uptodate buffers Finding a buffer that isn't uptodate doesn't invalidate the mapping for any given block. The last_sector check will already take care of starting another ioend as soon as we find any non-update buffer, and if the current mapping doesn't include the next uptodate buffer the xfs_imap_valid check will take care of it. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 91cdfd1761659f338e673aca72af3d0d50b88847 Author: Christoph Hellwig Date: Wed Jul 11 22:25:58 2018 -0700 xfs: do not set the page uptodate in xfs_writepage_map We already track the page uptodate status based on the buffer uptodate status, which is updated whenever reading or zeroing blocks. This code has been there since commit a ptool commit in 2002, which claims to: "merge" the 2.4 fsx fix for block size < page size to 2.5. This needed major changes to actually fit. and isn't present in other writepage implementations. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d43801775766972535a0f4b78af65d0c13055e36 Author: Christoph Hellwig Date: Wed Jul 11 22:25:57 2018 -0700 xfs: move locking into xfs_bmap_punch_delalloc_range Both callers want the same looking, so do it only once. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 036257213836e13f08d1b28e528ba99e4ed3fc68 Author: Christoph Hellwig Date: Wed Jul 11 22:25:57 2018 -0700 xfs: simplify xfs_aops_discard_page Instead of looking at the buffer heads to see if a block is delalloc just call xfs_bmap_punch_delalloc_range on the whole page - this will leave any non-delalloc block intact and handle the iteration for us. As a side effect one more place stops caring about buffer heads and we can remove the xfs_check_page_type function entirely. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8b2e77c1634935aefc9a4e2aacadda9cd30b78d7 Author: Christoph Hellwig Date: Wed Jul 11 22:25:56 2018 -0700 xfs: use iomap for blocksize == PAGE_SIZE readpage and readpages For file systems with a block size that equals the page size we never do partial reads, so we can use the buffer_head-less iomap versions of readpage and readpages without conflicting with the buffer_head structures create later in write_begin. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c2efdfc100af42cc04525ef0db74b176da59e1a4 Merge: 1e4b044d2251 806a1477b10a Author: Darrick J. Wong Date: Wed Jul 11 22:24:40 2018 -0700 Merge branch 'iomap-4.19-merge' into xfs-4.19-merge commit 7f2ecdd837ae0a27149a0387b2534e11d955c5f8 Author: Jaegeuk Kim Date: Thu Jun 28 19:34:40 2018 -0700 f2fs: flush journal nat entries for nat_bits during unmount Let's flush journal nat entries for speed up in the next run. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e7016d8e6f1b92888cc6093fd4e09d9f85934eb9 Author: Yong Zhao Date: Wed Jul 11 22:33:08 2018 -0400 drm/amdkfd: Clean up reference of radeon Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 8d5f355290880331e265d4c3f3b66c805969f18e Author: Yong Zhao Date: Wed Jul 11 22:33:07 2018 -0400 drm/amdkfd: Replace mqd with mqd_mgr as the variable name for mqd_manager This will make reading code much easier. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 2b281977f5e072171bbd9e562c1dd27f0fe8461f Author: Yong Zhao Date: Wed Jul 11 22:33:06 2018 -0400 drm/amdkfd: Use module parameters noretry as the internal variable name This makes all module parameters use the same form. Meanwhile clean up the surrounding code. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 0e9a860c72ec387140a0feb4b8d9a6d0004e9316 Author: Yong Zhao Date: Wed Jul 11 22:33:05 2018 -0400 drm/amdkfd: Introduce KFD module parameter halt_if_hws_hang This avoids triggering a GPU reset or otherwise changing the HW state. Instead KFD will hang, which allows HW debugging tools to analyze the problem. Signed-off-by: Yong Zhao Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit a29ec470b19e58044005973301f233e0b20ed8c4 Author: Shaoyun Liu Date: Wed Jul 11 22:33:04 2018 -0400 drm/amdkfd: Add debugfs interface to trigger HWS hang Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 1b0bfcff463f390c4032ebe36a4d5fb777c00a4c Author: Shaoyun Liu Date: Wed Jul 11 22:33:03 2018 -0400 drm/amdgpu: Avoid destroy hqd when GPU is on reset Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit bff418a2ee5df84bd75ac43659af7289ec1bab1c Author: Shaoyun Liu Date: Wed Jul 11 22:33:02 2018 -0400 drm/amdgpu: Avoid invalidate tlbs when gpu is on reset Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 951df6d9cfd07f205f1905bf3b27d994612e0614 Author: Shaoyun Liu Date: Wed Jul 11 22:33:01 2018 -0400 drm/amdkfd: Fix kernel queue 64 bit doorbell offset calculation The bitmap index calculation should reverse the logic used on allocation so it will clear the same bit used on allocation Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 67ccea60591a0515c885af9bf8dfb932a905457f Author: Shaoyun Liu Date: Wed Jul 11 22:33:00 2018 -0400 drm/amdgpu: Check NULL pointer for job before reset job's ring job could be NULL when amdgpu_device_gpu_recover is called Signed-off-by: Shaoyun Liu Reviewed-by: Andrey Grodzovsky Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit b5d21aac33179e55807d0fb0c0e1f694c1dce2c3 Author: Shaoyun Liu Date: Wed Jul 11 22:32:59 2018 -0400 drm/amdgpu: Don't use shadow BO for compute context Compute contexts cannot keep going after a GPU reset. Currently the process must terminate. In the future a process may be able recreate its context from scratch. Either way, there is no need to restore the GPUVM page table from shadow BOs. Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Felix Kuehling Signed-off-by: Oded Gabbay commit 73ea648d921ed5c58895c8592321456fe12b697f Author: Shaoyun Liu Date: Wed Jul 11 22:32:58 2018 -0400 drm/amdkfd: Implement hang detection in KFD and call amdgpu The reset will be performed in a new hw_exception work thread to handle HWS hang without blocking the thread that detected the hang. Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 24da5a9ca6c225ecdc33ea9c7c1b3aa0debed203 Author: Shaoyun Liu Date: Wed Jul 11 22:32:57 2018 -0400 drm/amdgpu: Enable the gpu reset from KFD Hook up the gpu_recover callback from KFD to amdgpu to enable handling of GPU hangs detected by KFD. Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit e42051d2133b7912db99bd3a307c9219a88fe7c2 Author: Shaoyun Liu Date: Wed Jul 11 22:32:56 2018 -0400 drm/amdkfd: Implement GPU reset handlers in KFD Lock KFD and evict existing queues on reset. Notify user mode by signaling hw_exception events. Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 5c6dd71e597f33d517710affe3b8d8de253bc86d Author: Shaoyun Liu Date: Wed Jul 11 22:32:55 2018 -0400 drm/amdgpu: Call KFD reset handlers during GPU reset Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit e3b7a967743c2e10457442ffafcb715a41255f28 Author: Shaoyun Liu Date: Wed Jul 11 22:32:54 2018 -0400 drm/amdkfd: Add gpu reset interface and place holder Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 0c119abad7f0d7987c3ce4ea76b30bde76d0436e Author: Shaoyun Liu Date: Wed Jul 11 22:32:53 2018 -0400 drm/amd: Add kfd ioctl defines for hw_exception event Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 6d15ca0af0e070e67863c46b54d14f3664d925b4 Author: Shaoyun Liu Date: Wed Jul 11 22:32:52 2018 -0400 drm/amd: Add gpu reset interfaces between amdgpu and amdkfd Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 58e698861255129a00765b69c0499bc0d044feb4 Author: Lan Xiao Date: Wed Jul 11 22:32:51 2018 -0400 drm/amdkfd: fix zero reading of VMID and PASID for Hawaii Upon VM Fault, the VMID and PASID written by HW are zeros in Hawaii. Instead of reading from ih_ring_entry, read directly from the registers. This workaround fix the soft hang issues caused by mishandled VM Fault in Hawaii. Signed-off-by: Lan Xiao Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 2640c3facbd6e21e63c95f19588cc24913a263cd Author: shaoyunl Date: Wed Jul 11 22:32:50 2018 -0400 drm/amdkfd: Handle VM faults in KFD 1. Pre-GFX9 the amdgpu ISR saves the vm-fault status and address per per-vmid. amdkfd needs to get the information from amdgpu through the new get_vm_fault_info interface. On GFX9 and later, all the required information is in the IH ring 2. amdkfd unmaps all queues from the faulting process and create new run-list without the guilty process 3. amdkfd notifies the runtime of the vm fault trap via EVENT_TYPE_MEMORY Signed-off-by: shaoyun liu Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit b97dfa27ef3ad3eddd2cb97a3b6a140d7037827a Author: shaoyunl Date: Wed Jul 11 22:32:49 2018 -0400 drm/amdgpu: save vm fault information for amdkfd amdgpu save the vm fault related information for KFD usage and keep the copy until KFD read it. Signed-off-by: shaoyun liu Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 101fee63cbb0a3df9e54aaafbfad0ab5821a34e6 Author: Moses Reuben Date: Wed Jul 11 22:32:48 2018 -0400 drm/amdkfd: send SIGSEGV to process upon KFD_EVENT_TYPE_MEMORY Signed-off-by: Moses Reuben Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit e47cb828eb3fca3e8999a0b9aa053dda18552071 Author: Wei Lu Date: Wed Jul 11 22:32:47 2018 -0400 drm/amdkfd: Fix error codes in kfd_get_process Return ERR_PTR(-EINVAL) if kfd_get_process fails to find the process. This fixes kernel oopses when a child process calls KFD ioctls with a file descriptor inherited from the parent process. Signed-off-by: Wei Lu Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit a60d811b2bf45f2e776e00d71f0dc3c5043245d9 Author: Jay Cornwall Date: Wed Jul 11 22:32:46 2018 -0400 drm/amdkfd: Fix race between scheduler and context restore The scheduler may raise SQ_WAVE_STATUS.SPI_PRIO via SQ_CMD before context restore has completed. Restoring SPI_PRIO=0 after this point may cause context save to fail as the lower priority wavefronts are not selected for execution among spin-waiting wavefronts. Leave SPI_PRIO at its SPI-initialized or scheduler-raised value. v2: Also fix race with exception handler Signed-off-by: Jay Cornwall Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit 1cd106ecfc1f048db3795cc6aed8acb156ba6d4d Author: Felix Kuehling Date: Wed Jul 11 22:32:45 2018 -0400 drm/amdkfd: Stop using GFP_NOIO explicitly This is no longer needed with the memalloc_nofs_save/restore in dqm_lock/unlock. Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit efeaed4d98eb4dc9ce01e1dca6d3778d180b272c Author: Felix Kuehling Date: Wed Jul 11 22:32:44 2018 -0400 drm/amdkfd: Reliably prevent reclaim-FS while holding DQM lock This is needed to prevent deadlocks when MMU notifiers run in reclaim-FS context and take the DQM lock for userptr evictions. Previously this was done by making all memory allocations under DQM locks GFP_NOIO. This is error prone. Using memalloc_nofs_save/restore will reliably affect all memory allocations anywhere in the kernel while the DQM lock is held. Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay commit fea9cf321c916e9372874e6f2af1bf0b5beb89fb Author: Benjamin Herrenschmidt Date: Sun Jun 10 16:25:25 2018 +1000 fsi: Move various master definitions to a common header This moves the definitions for various protocol details (message & response codes, delays etc...) out of fsi-master-gpio.c to fsi-master.h in order to share them with other master implementations. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley commit 8ef9ccf81044a1e31d116b5d4972d5b65ae10846 Author: Benjamin Herrenschmidt Date: Wed Jun 13 10:05:17 2018 +1000 fsi: master-gpio: Add missing release function The embedded struct device needs a release function to be able to successfully remove the driver. We remove the devm_gpiod_put() as they are unnecessary (the resources will be released automatically) and because fsi_master_unregister() will cause the master structure to be freed. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley commit 265aac26bcd4a2a79d08d2bdcc08cf1653fd4248 Author: Benjamin Herrenschmidt Date: Thu Jun 28 16:26:19 2018 +1000 fsi: Don't use device_unregister() in fsi_master_register() In the error path of fsi_master_register(), we currently use device_unregister(). This will cause the last reference to the structure to be dropped, thus freeing the enclosing structure, which isn't what the callers want. Use device_del() instead so that we return to the caller with a refcount of 1. The caller can then assume that it must use put_device() after a call to fsi_master_register() regardless of whether the latter suceeded or failed. Signed-off-by: Benjamin Herrenschmidt commit 55382d301fd8992349da0e58c013400e2e72417d Author: Benjamin Herrenschmidt Date: Thu Jul 12 12:04:24 2018 +1000 fsi: master-gpio: Remove "GPIO" prefix on some definitions Some definitions are generic to the FSI protocol or any give master implementation. Rename them to remove the "GPIO" prefix in preparation for moving them to a common header. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley # Conflicts: # drivers/fsi/fsi-master-gpio.c commit 8b2e4751131396d942e2b99682623ffb750dada5 Author: Benjamin Herrenschmidt Date: Sun Jun 10 16:20:18 2018 +1000 fsi: master-gpio: Remove unused definitions Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley commit 777fd524ba197475a60198aa1666408662acbcbc Author: Benjamin Herrenschmidt Date: Tue May 29 19:28:38 2018 +1000 fsi: master-gpio: Add more tracepoints This adds a few more tracepoints that have proven useful when debugging issues with the FSI bus. This also makes echo_delay() use clock_zeros() instead of open-code it in order to share the tracepoint. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley commit 75854c148fa5983ff02f630a0eb2d80998fe12ae Author: Benjamin Herrenschmidt Date: Tue May 29 15:11:32 2018 +1000 fsi: master-gpio: Add support for link_config To configure the send and echo delays Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley commit edc2485148d20c56c67d9ceec4d645c18d795a8d Author: Benjamin Herrenschmidt Date: Tue May 29 15:09:45 2018 +1000 fsi: master-gpio: Rename and adjust send delay What the driver called "FSI_GPIO_PRIME_SLAVE_CLOCKS" is what the FSI spec calls tSendDelay and should be 16 clocks by default. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley commit a2e7da86cc392417b0d9f605b28038aae80b002f Author: Benjamin Herrenschmidt Date: Tue May 29 15:01:07 2018 +1000 fsi: Add mechanism to set the tSendDelay and tEchoDelay values Those values control the amount of "dummy" clocks between commands and between a command and its response. This adds a way to configure them from sysfs (to be later extended to defaults in the device-tree). The default remains 16 (the HW default). This is only supported if the backend supports the new link_config() callback to configure the generation of those delays. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley --- commit 935f9636389f0acd96e6ebcbc7d97425b84163b5 Author: Benjamin Herrenschmidt Date: Tue May 29 14:44:08 2018 +1000 fsi: Move code around to avoid forward declaration Move fsi_slave_set_smode() and its helpers to before it's first user and remove the corresponding forward declaration. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley commit d5c66e61e7fee82c50c04af8b69c1b88ce173b95 Author: Benjamin Herrenschmidt Date: Thu Jul 12 11:53:37 2018 +1000 fsi: sbefifo: Fix checker warning about late NULL check "dev" is dereferences before it's checked. Reported-by: Dan Carpenter Signed-off-by: Benjamin Herrenschmidt commit 26b754f99402d6e7fc4e07d67a2597e6ebabde8b Author: Fabio Estevam Date: Tue Jul 10 13:31:48 2018 -0300 ARM: mx5: Set the DBGEN bit in ARM_GPC register On i.MX51/i.MX53 it is necessary to set the DBGEN bit in ARM_GPC register in order to turn on the debug clocks. The DBGEN bit of ARM_GPC register has the following description in the i.MX53 Reference Manual: "This allows the user to manually activate clocks within the debug system. This register bit directly controls the platform's dbgen_out output signal which connects to the DAP_SYS to enable all debug clocks. Once enabled, the clocks cannot be disabled except by asserting the disable_trace input of the DAP_SYS." Based on a previous patch from Sebastian Reichel. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 32f7f89d3065d950a3524c91f4031acc129195cc Author: Guenter Roeck Date: Tue Jul 3 06:43:49 2018 -0700 fsi/sbefifo: Add dependency on OF_ADDRESS The driver calls of_platform_device_create() which is only available if OF_ADDRESS is enabled. When building sparc64 images, this results in ERROR: "of_platform_device_create" [drivers/fsi/fsi-sbefifo.ko] undefined! Fixes: 9f4a8a2d7f9d ("fsi/sbefifo: Add driver for the SBE FIFO") Cc: Benjamin Herrenschmidt Signed-off-by: Guenter Roeck Signed-off-by: Benjamin Herrenschmidt commit c00bac88764a0f294d34b40e5f4987de8ceab711 Author: Eddie James Date: Tue Jul 3 16:21:29 2018 -0500 fsi: sbefifo: Add missing mutex_unlock There was no unlock of the FFDC mutex. Fixes: 9f4a8a2d7f9d ("fsi/sbefifo: Add driver for the SBE FIFO") Signed-off-by: Eddie James Signed-off-by: Benjamin Herrenschmidt commit 4a2190aa2e92ba66d46e6bfdb8c68431e0ed9ced Author: Fabio Estevam Date: Tue Jul 10 13:31:47 2018 -0300 ARM: dts: imx53: Add a label for the PMU node Add a label for the PMU node so that the board dts may be able to pass the 'secure-reg-access' property like this: &pmu { secure-reg-access; }; This also makes it consistent with the PMU node in imx6qdl.dtsi Signed-off-by: Fabio Estevam Reviewed-by: Sebastian Reichel Tested-by: Sebastian Reichel Signed-off-by: Shawn Guo commit e548eac2b70423590cf7375a7aee5aaeefdfd638 Author: Fabio Estevam Date: Tue Jul 10 13:31:46 2018 -0300 ARM: dts: imx53: Add tigerp support As per the i.MX53 Reference Manual add an entry for the 'tigerp' region in the device tree. This is needed for accessing the ARM_GPC register to set the DBGEN bit, so that the debug clocks can be turned on. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit f2254a39f6225b6dc1173412cfd0f6def0dbcb42 Author: Fabio Estevam Date: Tue Jul 10 13:31:45 2018 -0300 ARM: dts: imx51: Add tigerp support As per the i.MX51 Reference Manual add an entry for the 'tigerp' region in the device tree. This is needed for accessing the ARM_GPC register to set the DBGEN bit, so that the debug clocks can be turned on. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 4b301223d0574e6c390a174183d5ffa17cd6a12c Author: Fabio Estevam Date: Tue Jul 10 13:31:44 2018 -0300 ARM: dts: imx51: Add PMU support Add PMU support in the device tree. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 168a7bb7f126c7a057dd77f6f7c93459ed780fa9 Author: Fabio Estevam Date: Tue Jul 10 13:31:43 2018 -0300 dt-bindings: freescale: Add bindings for the tigerp module Add bindings for the tigerp module present on i.MX51. Signed-off-by: Fabio Estevam Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 11d973de60e1a69e2b0b240557ad02cf9f884d71 Author: Fabio Estevam Date: Mon Jul 9 15:19:15 2018 -0300 ARM: imx51: Configure M4IF to avoid visual artifacts Configure the M4IF registers as per the vendor bootloader to avoid visual artifacts during video playback. This way we don't need to rely on the bootloader configuration for optimal IPU/VPU bus priorities. Signed-off-by: Fabio Estevam Tested-by: Sergey Lapin Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit b6b93a3fe7ed12f0b80800be5df798c19adcc4ee Author: Fabio Estevam Date: Mon Jul 9 15:19:14 2018 -0300 ARM: dts: imx51: Add M4IF support As per the i.MX51 Reference Manual the M4IF register region starts at 0x83fd8000 and has a 4kB address range. Add support for it. Signed-off-by: Fabio Estevam Tested-by: Sergey Lapin Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit ad780dd3655b500c51e6de36448568e3456f4226 Author: Fabio Estevam Date: Mon Jul 9 15:19:13 2018 -0300 dt-bindings: freescale: Add bindings for the M4IF module Add bindings for the M4IF module present on i.MX51. Signed-off-by: Fabio Estevam Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit bc36b2aac4f5e4accfe642bb51293f3d318312eb Author: Anson Huang Date: Sun Jun 3 09:44:05 2018 +0800 ARM: dts: imx6ul: add GPIO clocks i.MX6UL has GPIO clock gates in CCM CCGR, add clock property for GPIO driver to make sure all GPIO banks work as expected. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 8a9dbb779fe882325b9a0238494a7afaff2eb444 Author: Chanwoo Choi Date: Thu Jun 14 11:16:29 2018 +0900 extcon: Release locking when sending the notification of connector state Previously, extcon used the spinlock before calling the notifier_call_chain to prevent the scheduled out of task and to prevent the notification delay. When spinlock is locked for sending the notification, deadlock issue occured on the side of extcon consumer device. To fix this issue, extcon consumer device should always use the work. it is always not reasonable to use work. To fix this issue on extcon consumer device, release locking when sending the notification of connector state. Fixes: ab11af049f88 ("extcon: Add the synchronization extcon APIs to support the notification") Cc: stable@vger.kernel.org Cc: Roger Quadros Cc: Kishon Vijay Abraham I Signed-off-by: Chanwoo Choi commit 11bab5a28d4cb22f816beaed697ebf715730f96a Author: Enric Balletbo i Serra Date: Wed Jun 6 17:08:56 2018 +0200 extcon: usbc-cros-ec: Switch to SPDX identifier. Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Chanwoo Choi commit 686b30580058fa546035537bb4898b8ac3ae9561 Author: Enric Balletbo i Serra Date: Wed Jun 6 17:08:55 2018 +0200 extcon: usbc-cros-ec: Make license text and module license match. The license text is specifying "GPLv2" but the MODULE_LICENSE is set to GPL which means GNU Public License v2 or later. When MODULE_LICENSE and boiler plate does not match, go for boiler plate license. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Chanwoo Choi commit c355bb1afc5fe59e559fff585204180a94c6d58c Author: Wolfram Sang Date: Tue Apr 10 14:43:02 2018 +0200 extcon: int3496: Use proper GPIO include Since commit eca0f13c836a ("extcon: int3496: Ignore incorrect IoRestriction for ID pin"), the driver doesn't use GPIOF_* flags anymore. We can thus now drop the deprecated include file for GPIO and use the new one. Signed-off-by: Wolfram Sang Signed-off-by: Chanwoo Choi commit 2cc15e802b250a11ece57ea54f82993cf3430867 Author: Max Filippov Date: Wed Jul 11 14:33:41 2018 -0700 xtensa: platform-specific handling of coherent memory Memory layout is not fixed for noMMU xtensa configurations. Platforms that need to use coherent DMA should implement platform_vaddr_* helpers that check address type (cached/uncached) and convert addresses between these types. Signed-off-by: Max Filippov commit ae61f61fa802c829fa8d505587f9b337e63ea586 Author: Noralf Trønnes Date: Wed Jul 11 17:56:32 2018 +0200 drm/client: Fix: drm_client_new: Don't require DRM to be registered Commit 894a677f4b3e ("drm/cma-helper: Use the generic fbdev emulation") broke almost all drivers that use the CMA helper. The reason is that drm_client_new() requires that the DRM device has been registered, but the drivers register fbdev before registering DRM. Remove the requirement that DRM should be registered when creating a new client. Fixes: c76f0f7cb546 ("drm: Begin an API for in-kernel clients") Cc: Maxime Ripard Cc: Icenowy Zheng Cc: Chen-Yu Tsai Cc: Daniel Vetter Signed-off-by: Noralf Trønnes Tested-by: Icenowy Zheng Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180711155632.37437-1-noralf@tronnes.org commit 5685ca0ca292b656086085dc3847f10e7ff85225 Author: Noralf Trønnes Date: Tue Jul 10 17:05:18 2018 +0200 drm/tinydrm: Fix doc build warnings include/drm/tinydrm/tinydrm.h:34: warning: Function parameter or member 'fb_dirty' not described in 'tinydrm_device' drivers/gpu/drm/tinydrm/mipi-dbi.c:272: warning: Function parameter or member 'crtc_state' not described in 'mipi_dbi_enable_flush' drivers/gpu/drm/tinydrm/mipi-dbi.c:272: warning: Function parameter or member 'plane_state' not described in 'mipi_dbi_enable_flush' Move struct member docs inline so it's not missed next time. Cc: David Lechner Signed-off-by: Noralf Trønnes Reviewed-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20180710150518.10528-1-noralf@tronnes.org commit 15039efadd3c16307008becb24b0f9e0cebb2e04 Author: Bart Van Assche Date: Wed Jul 11 08:29:00 2018 -0700 hns: Remove a set-but-not-used variable Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 522628ed1a933a213051228b81bc1a215ea2ab76 Author: Bart Van Assche Date: Tue Jul 10 11:32:16 2018 -0700 IB/hfi1: Suppress a compiler warning Avoid that the following compiler warning is reported when building with gcc 8: drivers/infiniband/hw/hfi1/verbs.c:1896:2: warning: 'strncpy' output may be truncated copying 64 bytes from a string of length 64 [-Wstringop-truncation] Signed-off-by: Bart Van Assche Reviewed-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 671dffa7de7b6dcc37c028e33899ef69f939969d Merge: d90c936fb318 3ff5a4dc5d89 Author: Daniel Borkmann Date: Wed Jul 11 22:13:35 2018 +0200 Merge branch 'bpf-bpftool-improved-prog-load' Jakub Kicinski says: ==================== This series starts with two minor clean ups to test_offload.py selftest script. The next 11 patches extend the abilities of bpftool prog load beyond the simple cgroup use cases. Three new parameters are added: - type - allows specifying program type, independent of how code sections are named; - map - allows reusing existing maps, instead of creating a new map on every program load; - dev - offload/binding to a device. A number of changes to libbpf is required to accomplish the task. The section - program type logic mapping is exposed. We should probably aim to use the libbpf program section naming everywhere. For reuse of maps we need to allow users to set FD for bpf map object in libbpf. Examples Load program my_xdp.o and pin it as /sys/fs/bpf/my_xdp, for xdp program type: $ bpftool prog load my_xdp.o /sys/fs/bpf/my_xdp \ type xdp As above but for offload: $ bpftool prog load my_xdp.o /sys/fs/bpf/my_xdp \ type xdp \ dev netdevsim0 Load program my_maps.o, but for the first map reuse map id 17, and for the map called "other_map" reuse pinned map /sys/fs/bpf/map0: $ bpftool prog load my_maps.o /sys/fs/bpf/prog \ map idx 0 id 17 \ map name other_map pinned /sys/fs/bpf/map0 v3: - fix return codes in patch 5; - rename libbpf_prog_type_by_string() -> libbpf_prog_type_by_name(); - fold file path into xattr in patch 8; - add patch 10; - use dup3() in patch 12; - depend on fd value in patch 12; - close old fd in patch 12. v2: - add compat for reallocarray(). ==================== Signed-off-by: Daniel Borkmann commit 3ff5a4dc5d890963e669fc99cc62ee07d1da24e8 Author: Jakub Kicinski Date: Tue Jul 10 14:43:07 2018 -0700 tools: bpftool: allow reuse of maps with bpftool prog load Add map parameter to prog load which will allow reuse of existing maps instead of creating new ones. We need feature detection and compat code for reallocarray, since it's not available in many libc versions. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 26736eb9a483715c2e971a8866f55fbb156903e2 Author: Jakub Kicinski Date: Tue Jul 10 14:43:06 2018 -0700 tools: libbpf: allow map reuse More advanced applications may want to only replace programs without destroying associated maps. Allow libbpf users to achieve that. Instead of always creating all of the maps at load time, expose to users an API to reconstruct the map object from already existing map. The map parameters are read from the kernel and replace the parameters of the ELF map. libbpf does not restrict the map replacement, i.e. the reused map does not have to be compatible with the ELF map definition. We relay on the verifier for checking the compatibility between maps and programs. The ELF map definition is completely overwritten by the information read from the kernel, to make sure libbpf's view of map object corresponds to the actual map. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Andrey Ignatov Signed-off-by: Daniel Borkmann commit 531b014e7a2fedaeff0b19b2934d830cd4b35dc0 Author: Jakub Kicinski Date: Tue Jul 10 14:43:05 2018 -0700 tools: bpf: make use of reallocarray reallocarray() is a safer variant of realloc which checks for multiplication overflow in case of array allocation. Since it's not available in Glibc < 2.26 import kernel's overflow.h and add a static inline implementation when needed. Use feature detection to probe for existence of reallocarray. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Reviewed-by: Jiong Wang Signed-off-by: Daniel Borkmann commit 8d13406c02f9c38f106416e1dbe0e68059b9f59a Author: Jakub Kicinski Date: Tue Jul 10 14:43:04 2018 -0700 tools: libbpf: move library error code into a separate file libbpf_strerror() depends on XSI-compliant (POSIX) version of strerror_r(), which prevents us from using GNU-extensions in libbpf.c, like reallocarray() or dup3(). Move error printing code into a separate file to allow it to continue using POSIX strerror_r(). No functional changes. Signed-off-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit c8406848badd0a0b040b0d286e612678662a2ab3 Author: Jakub Kicinski Date: Tue Jul 10 14:43:03 2018 -0700 tools: bpftool: reimplement bpf_prog_load() for prog load bpf_prog_load() is a very useful helper but it doesn't give us full flexibility of modifying the BPF objects before loading. Open code bpf_prog_load() in bpftool so we can add extra logic in following commits. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 07f2d4eac2a850fc9649b27aa935cdcd263fb1ff Author: Jakub Kicinski Date: Tue Jul 10 14:43:02 2018 -0700 tools: libbpf: add extended attributes version of bpf_object__open() Similarly to bpf_prog_load() users of bpf_object__open() may need to specify the expected program type. Program type is needed at open to avoid the kernel version check for program types which don't require it. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Andrey Ignatov Signed-off-by: Daniel Borkmann commit f83fb22c6c68fdbc98c76291c9e12a40d1eb7ca5 Author: Jakub Kicinski Date: Tue Jul 10 14:43:01 2018 -0700 tools: libbpf: recognize offload neutral maps Add helper to libbpf for recognizing maps which should not have ifindex set when program is loaded. These maps only contain host metadata and therefore are not marked for offload, e.g. the perf event map. Use this helper in bpf_prog_load_xattr(). Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 49f2cba3e57a4d71e3e7001cc2934b563ee495f4 Author: Jakub Kicinski Date: Tue Jul 10 14:43:00 2018 -0700 tools: bpftool: allow users to specify program type for prog load Sometimes program section names don't match with libbpf's expectation. In particular XDP's default section names differ between libbpf and iproute2. Allow users to pass program type on command line. Name the types like the libbpf expected section names. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit b60df2a0e11fcd24186c312b0307ab8494031e27 Author: Jakub Kicinski Date: Tue Jul 10 14:42:59 2018 -0700 tools: libbpf: expose the prog type guessing from section name logic libbpf can guess program type based on ELF section names. As libbpf becomes more popular its association between section name strings and types becomes more of a standard. Allow libbpf users to use the same logic for matching strings to types, e.g. when the string originates from command line. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Andrey Ignatov Signed-off-by: Daniel Borkmann commit ba6dd679a3e81af023ec091c2fb7c82003a27316 Author: Jakub Kicinski Date: Tue Jul 10 14:42:58 2018 -0700 tools: bpftool: add support for loading programs for offload Extend the bpftool prog load command to also accept "dev" parameter, which will allow us to load programs onto devices. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 8d1fc3de3d9f9bda0d8ec719d8686e9c5b432573 Author: Jakub Kicinski Date: Tue Jul 10 14:42:57 2018 -0700 tools: bpftool: refactor argument parsing for prog load Add a new macro for printing more informative message than straight usage() when parameters are missing, and use it for prog do_load(). Save the object and pin path argument to variables for clarity. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 219f860d2a11b285ac2e880ca4a73e0d36811c0c Author: Jakub Kicinski Date: Tue Jul 10 14:42:56 2018 -0700 selftests/bpf: add Error: prefix in check_extack helper Currently the test only checks errors, not warnings, so save typing and prefix the extack messages with "Error:" inside the check helper. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 7479efc71f6da5fde6c67d91380ebc0fb455c53d Author: Jakub Kicinski Date: Tue Jul 10 14:42:55 2018 -0700 selftests/bpf: remove duplicated word from test offloads Trivial removal of duplicated "mode" in error message. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit e8e8b65224625f7d4dc7953484afe1b571db6c73 Author: oulijun Date: Mon Jul 9 17:48:10 2018 +0800 RDMA/hns: Update the implementation of set_mac This patch updates the implementation of set_mac by using command queue instead of directly writing registers. Signed-off-by: Lijun Ou Signed-off-by: Yixian Liu Signed-off-by: Wei Hu (Xavier) Signed-off-by: Jason Gunthorpe commit 4db134a3dde76330c65dd82e2918d655f2b6c90a Author: oulijun Date: Mon Jul 9 17:48:09 2018 +0800 RDMA/hns: Update the implementation of set_gid This patch updates the implementation of set_gid by using command queue instead of directly writing registers. Signed-off-by: Lijun Ou Signed-off-by: Yixian Liu Signed-off-by: Wei Hu (Xavier) Signed-off-by: Jason Gunthorpe commit ded58ff987dbc3066825789a552a0ce33075c4f7 Author: oulijun Date: Mon Jul 9 17:48:08 2018 +0800 RDMA/hns: Add TPQ link table support In hip08, the TPQ(Timer Poll Queue) should be extended to host memory. This patch adds the support of TPQ. Signed-off-by: Yixian Liu Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 6b63597d3540003c7a0ece4a0d2f5a3b06e3b729 Author: oulijun Date: Mon Jul 9 17:48:07 2018 +0800 RDMA/hns: Add TSQ link table support In hip08, TSQ(Transport Service Queue) should be extended to host memory to store the doorbells. This patch adds the support of creating TSQ, and then configured to the hardware. Signed-off-by: Yixian Liu Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) Signed-off-by: Jason Gunthorpe commit 0576cbde14482931b29c50e10f274805e6721bbe Author: oulijun Date: Mon Jul 9 17:48:06 2018 +0800 RDMA/hns: Fix endian conversions and annotations This patch removes the warnings reported by sparse. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 31e33a5b41bb158f27c30e13b12d6e5e6513ea05 Author: Jann Horn Date: Fri Jul 6 22:18:09 2018 +0200 net/mlx5: fix uaccess beyond "count" in debugfs read/write handlers In general, accessing userspace memory beyond the length of the supplied buffer in VFS read/write handlers can lead to both kernel memory corruption (via kernel_read()/kernel_write(), which can e.g. be triggered via sys_splice()) and privilege escalation inside userspace. In this case, the affected files are in debugfs (and should therefore only be accessible to root) and check that *pos is zero (which prevents the sys_splice() trick). Therefore, this is not a security fix, but rather a small cleanup. For the read handlers, fix it by using simple_read_from_buffer() instead of custom logic. For the write handler, add a check. changed in v2: - also fix dbg_write() Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Jann Horn Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit dff700fa81938d8947c86b7909920e5e5f772afc Author: Uwe Kleine-König Date: Sat Jun 9 08:43:13 2018 +0200 rtc: stmp3xxx: Don't reset the rtc in .probe() when watchdog is running As pointed out in the added comment resetting the rtc also stops the included watchdog. This is bad if the bootloader started the watchdog to secure the boot process. So don't reset if the watchdog is running. Signed-off-by: Uwe Kleine-König Acked-by: Guenter Roeck Signed-off-by: Alexandre Belloni commit d6c3029f32f72db7ba7b4183b0423cce2267ca3d Author: Uwe Kleine-König Date: Sun May 20 15:37:23 2018 +0200 rtc: pcf2127: add support for accessing internal static RAM The PCF2127 has 512 bytes of internal static RAM and this patch expands the driver to access this memory. Signed-off-by: Uwe Kleine-König Signed-off-by: Alexandre Belloni commit cd7f3a249dbed2858e6c2f30e5be7f1f7a709ee2 Author: Trent Piepho Date: Wed May 16 16:45:51 2018 -0700 rtc: snvs: Add timeouts to avoid kernel lockups In order to read correctly from asynchronously updated RTC registers, it's necessary to read repeatedly until their values do not change from read to read. It's also necessary to wait for three RTC clock ticks for certain operations. There are no timeouts in this code and these operations could possibly loop forever. To avoid kernel hangs, put in timeouts. The iMX7d can be configured to stop the SRTC on a tamper event, which will lockup the kernel inside this driver as described above. These hangs can happen when running under qemu, which doesn't emulate the SNVS RTC, though currently the driver will refuse to load on qemu due to a timeout in the driver probe method. It could also happen if the SRTC block where somehow placed into reset or the slow speed clock that drives the SRTC counter (but not the CPU) were to stop. The symptoms on a two core iMX7d are a work queue hang on rtc_timer_do_work(), which eventually blocks a systemd fsnotify operation that triggers a work queue flush, causing systemd to hang and thus causing all services that should be started by systemd, like a console getty, to fail to start or stop. Also optimize the wait code to wait less. It only needs to wait for the clock to advance three ticks, not to see it change three times. Cc: Alexandre Belloni Cc: Alessandro Zummo Cc: Fabio Estevam Cc: Shawn Guo Cc: Bryan O'Donoghue Signed-off-by: Trent Piepho Signed-off-by: Alexandre Belloni commit 7874b919866ba91bac253fa219d3d4c82bb944df Author: Zhouyang Jia Date: Tue Jun 12 12:40:03 2018 +0800 rtc: bq4802: add error handling for devm_ioremap When devm_ioremap fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling devm_ioremap. Signed-off-by: Zhouyang Jia Signed-off-by: Alexandre Belloni commit adbfa4e6f99689511f1079452508d9d22417544c Author: Max Filippov Date: Wed Feb 14 16:12:54 2018 -0800 xtensa: support DMA_ATTR_NO_KERNEL_MAPPING attribute An application that doesn't need kernel mapping of the DMA memory it allocates may specify DMA_ATTR_NO_KERNEL_MAPPING attribute to allocation function. Support this attribute and return address of the first struct page that covers the allocation. Signed-off-by: Max Filippov commit beae9eb555b918ecaf2214f2fd0a1af2dcec3ad7 Author: Bart Van Assche Date: Fri Jul 6 13:04:30 2018 -0700 RDMA/ocrdma: Make ocrdma_destroy_qp() easier to analyze This patch does not change any functionality but avoids that sparse reports the following: drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:1818:31: warning: context imbalance in 'ocrdma_destroy_qp' - different lock contexts for basic block Compile-tested only. Signed-off-by: Bart Van Assche Cc: Selvin Xavier Cc: Devesh Sharma Signed-off-by: Jason Gunthorpe commit 3f2bbf443e21584887f954328ceee8515d7691e7 Author: Christoph Hellwig Date: Tue Jun 19 09:03:16 2018 +0200 xtensa: use generic dma_noncoherent_ops Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig Signed-off-by: Max Filippov commit 07f3355df7e6d043d36d4c172a18e74510fe7e7b Author: Arnd Bergmann Date: Mon Jul 9 10:34:43 2018 +0200 infiniband: i40iw, nes: don't use wall time for TCP sequence numbers The nes infiniband driver uses current_kernel_time() to get a nanosecond granunarity timestamp to initialize its tcp sequence counters. This is one of only a few remaining users of that deprecated function, so we should try to get rid of it. Aside from using a deprecated API, there are several problems I see here: - Using a CLOCK_REALTIME based time source makes it predictable in case the time base is synchronized. - Using a coarse timestamp means it only gets updated once per jiffie, making it even more predictable in order to avoid having to access the hardware clock source - The upper 2 bits are always zero because the nanoseconds are at most 999999999. For the Linux TCP implementation, we use secure_tcp_seq(), which appears to be appropriate here as well, and solves all the above problems. i40iw uses a variant of the same code, so I do that same thing there for ipv4. Unlike nes, i40e also supports ipv6, which needs to call secure_tcpv6_seq instead. Acked-by: Shiraz Saleem Signed-off-by: Arnd Bergmann Signed-off-by: Jason Gunthorpe commit e4f8d81c738db6d3ffdabfb8329aa2feaa310699 Author: Steven Rostedt (VMware) Date: Mon Jul 9 17:48:54 2018 -0400 cgroup/tracing: Move taking of spin lock out of trace event handlers It is unwise to take spin locks from the handlers of trace events. Mainly, because they can introduce lockups, because it introduces locks in places that are normally not tested. Worse yet, because trace events are tucked away in the include/trace/events/ directory, locks that are taken there are forgotten about. As a general rule, I tell people never to take any locks in a trace event handler. Several cgroup trace event handlers call cgroup_path() which eventually takes the kernfs_rename_lock spinlock. This injects the spinlock in the code without people realizing it. It also can cause issues for the PREEMPT_RT patch, as the spinlock becomes a mutex, and the trace event handlers are called with preemption disabled. By moving the calculation of the cgroup_path() out of the trace event handlers and into a macro (surrounded by a trace_cgroup_##type##_enabled()), then we could place the cgroup_path into a string, and pass that to the trace event. Not only does this remove the taking of the spinlock out of the trace event handler, but it also means that the cgroup_path() only needs to be called once (it is currently called twice, once to get the length to reserver the buffer for, and once again to get the path itself. Now it only needs to be done once. Reported-by: Sebastian Andrzej Siewior Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Tejun Heo commit 23ebda2fc715534d383d59ae6740d4e3ebd43798 Author: Sebastian Andrzej Siewior Date: Wed Jul 11 17:21:05 2018 +0200 libata: remove ata_sff_data_xfer_noirq() ata_sff_data_xfer_noirq() is invoked via the ->sff_data_xfer hook. The latter is invoked by ata_pio_sector(), atapi_send_cdb() and __atapi_pio_bytes() which in turn is invoked by ata_sff_hsm_move(). The latter function requires that the "ap->lock" lock is held which needs to be taken with disabled interrupts. There is no need have to have ata_sff_data_xfer_noirq() which invokes ata_sff_data_xfer32() with disabled interrupts because at this point the interrupts are already disabled. Remove the function and its references to it and replace all callers with ata_sff_data_xfer32(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tejun Heo commit 854457d2148594fca79eac3cd19ee7a6dbd570c3 Merge: ce397d215ccd a64ad008980c Author: Stephen Boyd Date: Wed Jul 11 10:31:52 2018 -0700 Merge tag 'v4.19-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip Pull Rockchip clk driver updates from Heiko Stuebner: Support for Rockchip's PX30 SoC including its new half-divider clock type that is doing freq_out = 2*freq_in / (2*div + 3). As well as a register-bit fix for the rk3399 i2sout clock. * tag 'v4.19-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: fix clk_i2sout parent selection bits on rk3399 clk: rockchip: add clock controller for px30 clk: rockchip: add support for half divider dt-bindings: add bindings for px30 clock controller clk: rockchip: add dt-binding header for px30 commit 03e3ec9ad1ee484f872bad6d673d46c9742e71ef Author: Vladimir Zapolskiy Date: Fri Jul 6 21:51:01 2018 +0300 drm/panel: simple: Add Sharp LQ035Q7DB03 panel support The change adds support for Sharp LQ035Q7DB03 3.5" QVGA TFT panel. Note that this aged panel is already found in the kernel sources, for instance in board mach files mach-mx21ads.c, mach-mx27ads.c, mach-pcm043.c, lpd270.c and imx27-phytec-phycore-rdk.dts. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180706185101.31186-1-vz@mleia.com commit c9c159b22902f94ca68e29e4b95b666b87577539 Author: Arnd Bergmann Date: Wed Jul 11 17:50:29 2018 +0200 extcon: max3355: include mod_devicetable.h Another driver turned up that is missing linux/mod_devicetable.h after the device IDs are split out from linux/platform_device.h: drivers/extcon/extcon-max3355.c:127:34: error: array type has incomplete element type 'struct of_device_id' static const struct of_device_id max3355_match_table[] = { Fixes: ac3167257b9f ("headers: separate linux/mod_devicetable.h from linux/platform_device.h") Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit d2d49495b5c0dffee5c4da5ea12ac0da6679bd08 Author: Shuah Khan (Samsung OSG) Date: Fri Jun 22 11:43:23 2018 -0600 selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run Fix to return KSFT_SKIP when test couldn't be run because AT_SYSINFO_EHDR isn't found and gettimeofday isn't defined. Signed-off-by: Shuah Khan (Samsung OSG) commit 29ee92397f2c83c489b72a1ba72ec97484a18a67 Author: Shuah Khan (Samsung OSG) Date: Fri Jun 22 11:23:00 2018 -0600 selftests: vDSO - fix to exclude x86 test on non-x86 platforms Fix to exclude vdso_standalone_test_x86 test from building on non-x86 platforms. In addition, fix it to use TEST_GEN_PROGS which is the right variable to use for generated programs. TEST_PROGS is for shell scripts. Signed-off-by: Shuah Khan (Samsung OSG) commit cc7c673032fc7427087e74b75f732b43db38a256 Author: Li Zhijian Date: Wed Jul 11 10:08:00 2018 +0800 selftests/android: initialize heap_type to avoid compiling warning Initialize heap_type to ION_HEAP_TYPE_SYSTEM to avoid "used uninitialized" compiler warning. heap_type gets used after initialization, this change is to just keep the compiler happy. root@vm-lkp-nex04-8G-7 ~/linux-v4.18-rc2/tools/testing/selftests/android# make make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. make[1]: Entering directory '/root/linux-v4.18-rc2/tools/testing/selftests/android/ion' gcc -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/ -Wall -O2 -g ionapp_export.c ipcsocket.c ionutils.c -o ionapp_export ionapp_export.c: In function 'main': ionapp_export.c:91:2: warning: 'heap_type' may be used uninitialized in this function [-Wmaybe-uninitialized] printf("heap_type: %ld, heap_size: %ld\n", heap_type, heap_size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC: Shuah Khan CC: Pintu Agarwal Signed-off-by: Li Zhijian Signed-off-by: Shuah Khan (Samsung OSG) commit efdafd6895b2c454f1791de32248725879ded090 Author: Daniel Mack Date: Fri Jul 6 07:35:52 2018 +0200 power: supply: ds2760_battery: add devicetree probing Add a matching table for devicetree probing, and optionally set the module parameter variables from DT properties. Signed-off-by: Daniel Mack Signed-off-by: Sebastian Reichel commit bf49735537374c02fd4111bd5463e372f69c41f8 Author: Daniel Mack Date: Fri Jul 6 07:35:51 2018 +0200 power: supply: ds2760_battery: merge ds2760 supply driver with its w1 slave companion This patch removes the w1 slave driver that used to register the w1 family and instanciate a platform device at runtime. The code now lives in the supply driver instead to avoid that level of indirection. The old device name "ds2760-battery.0" is preserved, so userspace applications can access the same virtual device nodes as before. Note that because the w1 core does not currently have a framework for suspend/resume, the driver now registers a PM notifier callback. Signed-off-by: Daniel Mack Signed-off-by: Sebastian Reichel commit fae68031f7fbc8b6db58d87830ba7ed1d696fbb1 Author: Daniel Mack Date: Fri Jul 6 07:35:50 2018 +0200 w1: core: match sub-nodes of bus masters in devicetree Once a new slave device is detected, match it against all sub-nodes of the master bus controller. If a match is found, set the slave device's of_node pointer. Signed-off-by: Daniel Mack Signed-off-by: Sebastian Reichel commit da0a5d99b14ced8ec4bf741f5d2457348b932c82 Author: Daniel Mack Date: Fri Jul 6 07:35:49 2018 +0200 dt-bindings: w1: document bindings for ds2760 battery monitor This patch adds the devicetree bindings for Maxim's ds2760 battery monitors. Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit dfa32e119de5baaab1f08e66330d3787a0a8957a Author: Daniel Mack Date: Fri Jul 6 07:35:48 2018 +0200 dt-bindings: w1: document generic onewire bindings This patch adds a generic w1 bindings document that describes how w1 slave deviceses are grouped under master nodes. It also augments the existing w1-gpio.txt document a bit. Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit a284390b397ae2f95de799bc591efbfe54bf0907 Author: Josef Bacik Date: Wed Jul 11 10:34:42 2018 -0400 blk-iolatency: fix max_depth comparisons max_depth used to be a u64, but I changed it to a unsigned int but didn't convert my comparisons over everywhere. Fix by using UINT_MAX everywhere instead of (u64)-1. Reported-by: Dan Carpenter Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 2ba87a9bcc7a10aa28af9fbf5b4354b3168366e2 Author: Wei Yongjun Date: Wed Jul 11 13:18:59 2018 +0000 spi: cadence: Fix missing clk_disable_unprepare() on error in cnds_runtime_resume() Fix the missing clk_disable_unprepare() before return from cnds_runtime_resume() in the error handling case. Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown commit 655250a8d1aa3b18949a72869858d07ceac12799 Author: Chris Wilson Date: Fri Jun 29 08:53:20 2018 +0100 drm/i915/execlists: Switch to rb_root_cached The kernel recently gained an augmented rbtree with the purpose of cacheing the leftmost element of the rbtree, a frequent optimisation to avoid calls to rb_first() which is also employed by the execlists->queue. Switch from our open-coded cache to the library. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180629075348.27358-9-chris@chris-wilson.co.uk commit 03dc7a35fcc83a199121a5156c4a7a976b836682 Author: Arnd Bergmann Date: Wed Jul 11 12:19:14 2018 +0200 ipv6: xfrm: use 64-bit timestamps get_seconds() is deprecated because it can overflow on 32-bit architectures. For the xfrm_state->lastused member, we treat the data as a 64-bit number already, so we just need to use the right accessor that works on both 32-bit and 64-bit machines. Signed-off-by: Arnd Bergmann Signed-off-by: Steffen Klassert commit 996b1b611e2f604b542e60596e614ee340820eb7 Author: Andrey Smirnov Date: Tue Jul 10 22:07:04 2018 -0700 ARM: dts: imx: Add ZII SCU3 ESB Add support for the Zodiac Inflight Innovations i.MX51-base SCU3 Ethernet Switch Board (ESB) Cc: Fabio Estevam Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphealy@gmail.com Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Fabio Estevam Signed-off-by: Andrey Gusakov Signed-off-by: Andrey Smirnov Signed-off-by: Shawn Guo commit 386c5680e2e80b012de557cf8326962070e0897b Author: Arnd Bergmann Date: Wed Jul 11 12:19:13 2018 +0200 xfrm: use time64_t for in-kernel timestamps The lifetime managment uses '__u64' timestamps on the user space interface, but 'unsigned long' for reading the current time in the kernel with get_seconds(). While this is probably safe beyond y2038, it will still overflow in 2106, and the get_seconds() call is deprecated because fo that. This changes the xfrm time handling to use time64_t consistently, along with reading the time using the safer ktime_get_real_seconds(). It still suffers from problems that can happen from a concurrent settimeofday() call or (to a lesser degree) a leap second update, but since the time stamps are part of the user API, there is nothing we can do to prevent that. Signed-off-by: Arnd Bergmann Signed-off-by: Steffen Klassert commit 13211eec7b0e1b7b341b482811f69333c940f64c Author: Leonard Crestez Date: Wed Jul 11 15:11:17 2018 +0300 ARM: dts: imx6sl: Convert gpc to new bindings With old bindings imx_gpc_onecell_data always sets num_domains to 2 so the DISPMIX domain can't actually be referenced. The pd is still defined and pm core shuts it down as "unused" so display can't work. Fix this by converting to new gpc bindings by adding pgc nodes and referencing the newly-defined &pu_disp domain from &lcdif. Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 0b65a9ad25b3f68ab2f6a1a202fe1df28b08e28a Author: Yoshihiro Shimoda Date: Wed Jul 11 17:48:26 2018 +0900 arm64: dts: renesas: Unify the labels for RWDT The labels for RWDT device node were named as 2 types now: - wdt0: r8a7795, r8a7796, r8a77965. - rwdt: r8a77970, r8a77990, r8a77995. To be made consistent, this patch unifis the labels as the hardware name "rwdt". Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 5507ec5126df5cad778af22b13fc8c278ad977ea Author: Leonard Crestez Date: Wed Jul 11 15:11:16 2018 +0300 soc: imx: gpc: Disable 6sl display power gating for ERR006287 The imx6sl chip errata document describes ERR006287 like this: > Upon resuming from power gating, the modules in the display power domain (eLCDIF, EPDC, PXP and SPDC) might fail to perform register reads correctly. > When the modules listed above are used, do not use power gating on the display power domain. Link: https://www.nxp.com/docs/en/errata/IMX6SLCE.pdf#page=62 Handle this in the safest possible way by keeping the DISP domain always-on. Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach Reviewed-by: Ulf Hansson Signed-off-by: Shawn Guo commit cb4dc8daf4cb72d7833148a6087b425b5c20e903 Author: Chris Wilson Date: Wed Jul 11 13:29:52 2018 +0100 drm/i915/selftests: Add a safety net to live_workarounds Since live_workarounds poke around the w/a registers and checks to see if they survive across a reset, we are prone to fouling the machine and leaving it in a non-recoverable state. Wrap the probe inside a timeout to abort the test if the reset fails. v2: Include GEM_TRACE on declaring wedged. v3: Add a few includes to make the header look standalone. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188 Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180711122952.18448-1-chris@chris-wilson.co.uk commit ba4446d4faeb8e60a78915c4f19645beb5f7e6ad Author: Anson Huang Date: Wed Jul 11 08:58:59 2018 +0800 ARM: dts: imx6sx: add ocram_s support i.MX6SX has a 16KB always-on ocram bank called ocram_s, enable it as another mmio sram. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit bc0ebbd5b5c14cd8d85ba671d725fb439741afa2 Author: Arnd Bergmann Date: Mon Jul 9 17:51:17 2018 +0200 ARM: imx: call imx6sx_cpuidle_init() conditionally for 6sll The imx6sl platform has two different cpuidle implementations, and fails to link if we only want one of the two: arch/arm/mach-imx/mach-imx6sl.o: In function `imx6sl_init_late': mach-imx6sl.c:(.init.text+0x12): undefined reference to `imx6sx_cpuidle_init' This makes the call into reference conditional on the configuration. Fixes: e7fa1fb39b11 ("ARM: imx: add cpu idle support for i.MX6SLL") Signed-off-by: Arnd Bergmann Signed-off-by: Shawn Guo commit 9a189f25ff27f8984bb6c297cbbd557ee983e155 Author: Arnd Bergmann Date: Fri Jul 6 14:54:48 2018 +0200 ARM: imx: fix i.MX6SLL build The i.MX6SLL cpuidle support reuses the i.MX6SX implementation, but the Makefile accidentally enables the i.MX6SL one as well, which then fails with a link error unless the kernel also enables the the i.MX6SL clock driver: arch/arm/mach-imx/cpuidle-imx6sl.o: In function `imx6sl_enter_wait': cpuidle-imx6sl.c:(.text+0x24): undefined reference to `imx6sl_set_wait_clk' This changes the two lines that were just modified again, hopefully getting every case right this time. Fixes: e7fa1fb39b11 ("ARM: imx: add cpu idle support for i.MX6SLL") Signed-off-by: Arnd Bergmann Signed-off-by: Shawn Guo commit b074f057ac60d32f604e0ca3120064e688e9a622 Author: Stefan Agner Date: Mon Jul 9 17:48:48 2018 +0200 ARM: dts: imx6qdl-apalis/-colibri: remove unused pinctrl groups 100/200MHz states for USDHC3 are not required since the SoC does not support modes faster than DDR52 for the on board eMMC. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 330f85598e87497974431c0f6f736e413ccf2d27 Author: Stefan Agner Date: Mon Jul 9 17:48:47 2018 +0200 ARM: dts: imx6qdl-apalis/-colibri: assign VDDD to SGTL5000 VDDD is connected to VGEN4 of the PF0100. This rail should only run at 1.8V since there are multiple consumer and they all expect the rail to be at 1.8V. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 7060066d3e9920a4d96e106243e544c14ba0fd79 Author: Stefan Agner Date: Mon Jul 9 17:48:46 2018 +0200 ARM: dts: imx6qdl-apalis/-colibri: fix on-module regulators Remove the 2.5V regulator, it does not exist. There is 3.3V and 3.3V_AUDIO provided to the module through the edge connector, model those as fixed regulators like we use to do in other Colibri device trees. The SGTL5000 uses 3.3V_AUDIO as VDDA. Note that the driver derives the analog ground voltage (VAG) from this supply. The new value should allow higher output swings before clipping occurs. Refer to the SGTL5000 datasheet for details. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 7034de41186f3b49fe987b4626ae1a151760a609 Author: Stefan Agner Date: Mon Jul 9 17:48:45 2018 +0200 ARM: dts: imx6qdl-apalis/-colibri: remove 1.8V regulator The fixed 1.8V regulator is not used, and there is in fact no fixed 1.8V regulator on the module. Remove it. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 147299a8fc3a70f02984a6d6a042d0cbf53c46f9 Author: Stefan Agner Date: Mon Jul 9 17:48:44 2018 +0200 ARM: dts: imx6qdl-apalis/-colibri: disable read-only switch Use the disable-wp to indicate that Apalis and Colibri iMX6 do not make use of the native write-protect signal available on the i.MX 6 SoCs. This prevents warnings: mmc0: host does not support reading read-only switch, assuming write-enable Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 3b1147a952cf9efb36144c1f7fd847d5a99adb7a Author: Stefan Agner Date: Mon Jul 9 17:48:43 2018 +0200 ARM: dts: imx6qdl-apalis/-colibri: prevent 1.8V modes Use no-1-8-v device tree property to indicate that the board does not support 1.8V signaling. The property voltage-ranges seems not appropriate in our case since we do not have level shifters in place. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 5780acda81d3f5378b71d8dead95b8d052dc22ae Author: Stefan Agner Date: Mon Jul 9 17:48:42 2018 +0200 ARM: dts: imx6q-apalis-eval: add carrier board 3.3V supply Add the 3.3V main supply on the carrier board. Currently as a fixed supply since not all consumer are modeled yet. This gets also rid of some missing supply warnings. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 6c74366b8db6fc70b65266bf52c58a89ebc946f1 Author: Stefan Agner Date: Mon Jul 9 17:48:41 2018 +0200 ARM: dts: imx6q-apalis: add chosen node Add Apalis UART1 as default serial console. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 19bb33c756edee5e3f0fb126895f6ec23e60dd08 Author: Chris Wilson Date: Wed Jul 11 08:36:02 2018 +0100 drm/i915: Introduce i915_address_space.mutex Add a mutex into struct i915_address_space to be used while operating on the vma and their lists for a particular vm. As this may be called from the shrinker, we taint the mutex with fs_reclaim so that from the start lockdep warns us if we are caught holding the mutex across an allocation. (With such small steps we will eventually rid ourselves of struct_mutex recursion!) Signed-off-by: Chris Wilson Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180711073608.20286-2-chris@chris-wilson.co.uk commit 792f98677d7f777a4f58e567b5b0578191cb986a Merge: ab9a13665e7c 949bdcc8a97c Author: Tony Lindgren Date: Wed Jul 11 05:54:32 2018 -0700 Merge commit '949bdcc8a97c' into omap-for-v4.19/dt commit cff70654d8289311c427625020d9f74348ad856e Author: Nicholas Mc Guire Date: Sun Jul 8 10:32:54 2018 +0200 ARM: imx: flag failure of of_iomap imx_set_aips is assuming that the address returned from of_iomap is valid which it probably is in the normal case - as the call site is void error propagation is not possible but never the less at least a WARN_ON() seems warranted here. Signed-off-by: Nicholas Mc Guire Fixes: commit e57e4ab5fc2e ("ARM: i.MX: allow disabling supervisor protect via DT") Signed-off-by: Shawn Guo commit d6ff1b52b569dc12ba5be027bc6c22f4ac0f4ce1 Author: Colin Ian King Date: Wed Jul 11 12:47:28 2018 +0100 staging: vt6655: remove some redundant variables Variables rx_sts, sq, frame and is_pspoll are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'sq' set but not used [-Wunused-but-set-variable] warning: variable 'rx_sts' set but not used [-Wunused-but-set-variable] warning: variable 'frame' set but not used [-Wunused-but-set-variable] warning: variable 'is_pspoll' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit e63a46fa5ba76097233edb7643777069d7cc4d72 Author: Michael Straube Date: Wed Jul 11 14:27:15 2018 +0200 staging: rtl8188eu: remove blank lines Remove unrequired blank lines as reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit fecb45a07bec36f9b57b4f0385a0565db48f4547 Author: Michael Straube Date: Wed Jul 11 14:27:14 2018 +0200 staging: rtl8188eu: fix lines over 80 characters Fix lines over 80 characters by adding appropriate line breaks. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit e5ce09aa442bacbd43d0cdf50ada2e01286ca51e Author: Michael Straube Date: Wed Jul 11 14:27:13 2018 +0200 staging: rtl8188eu: add spaces around '|' Add spaces around '|' to follow kernel coding style. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit f0de833a603d114332563ae995624c000916d8b5 Author: Michael Straube Date: Wed Jul 11 13:23:30 2018 +0200 staging: rtl8723bs: simplify ratetbl_val_2wifirate() Simplify ratetbl_val_2wifirate() by not using extra variable for the return value. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c9d19e68a7963f33466d84302b18793c0e549f61 Author: Michael Straube Date: Wed Jul 11 13:23:29 2018 +0200 staging: rtl8723bs: fix comparsions to NULL Fix comparsions to NULL to follow kernel coding style. x == NULL -> !x x != NULL -> x Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 525cc4f9091f86d045ff23c17d5c0818cada1a2b Author: Michael Straube Date: Wed Jul 11 13:23:28 2018 +0200 staging: rtl8723bs: remove blank lines Remove unrequired blank lines as reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit a35115f3c2127ca094319895c530c2f728998825 Author: Michael Straube Date: Wed Jul 11 13:23:27 2018 +0200 staging: rtl8723bs: fix lines over 80 characters Fix lines over 80 characters by adding appropriate line breaks. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 6efc7e57e3430f1f67b3e917cfecfbb3c1392248 Author: Michael Straube Date: Wed Jul 11 13:23:26 2018 +0200 staging: rtl8723bs: add spaces around '|' Add spaces around '|' to follow kernel coding style. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 75ad9a33da2362868beb9c071d7f18020deac9ab Author: Colin Ian King Date: Wed Jul 11 12:26:07 2018 +0100 staging: speakup: remove redundant variable l Variable l is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'l' set but not used [-Wunused-but-set-variable Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 58ca6cec54b571f61cfb85f72a3c8be7c9eaf702 Author: Colin Ian King Date: Wed Jul 11 12:35:23 2018 +0100 staging: sm750fb: remove redundant pointer 'output' Pointer 'output' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'output' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit b31cd4377286904d8dd7f45b0846c1dfe79ceb04 Author: Andrey Smirnov Date: Fri Jul 6 19:49:02 2018 -0700 ARM: dts: imx: Add ZII SCU2 Mezz board Add support for the Zodiac Inflight Innovations SCU2 Mezz board (i.MX51-based). Cc: Fabio Estevam Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphealy@gmail.com Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Fabio Estevam Signed-off-by: Andrey Gusakov Signed-off-by: Andrey Smirnov Tested-by: Chris Healy Signed-off-by: Shawn Guo commit 0337976f40b0a9605c24797762b95b3414619d71 Author: Arnd Bergmann Date: Wed Jul 11 14:41:00 2018 +0200 drm/admkfd use modern ktime accessors getrawmonotonic64() and get_monotonic_boottime64() are deprecated because of the nonstandard naming. The replacement functions ktime_get_raw_ns() and ktime_get_boot_ns() also simplify the callers. Reviewed-by: Felix Kuehling . Signed-off-by: Arnd Bergmann Signed-off-by: Oded Gabbay commit 4ea7bdc6b5b33427bbd3f41c333e21c1825462a3 Author: Stefan Agner Date: Sun Mar 25 20:09:56 2018 +0200 ARM: trusted_foundations: do not use naked function As documented in GCC naked functions should only use basic ASM syntax. The extended ASM or mixture of basic ASM and "C" code is not guaranteed. Currently this works because it was hard coded to follow and check GCC behavior for arguments and register placement. Furthermore with clang using parameters in Extended asm in a naked function is not supported: arch/arm/firmware/trusted_foundations.c:47:10: error: parameter references not allowed in naked functions : "r" (type), "r" (arg1), "r" (arg2) ^ Use a regular function to be more portable. This aligns also with the other SMC call implementations e.g. in qcom_scm-32.c and bcm_kona_smc.c. Cc: Dmitry Osipenko Cc: Stephen Warren Cc: Thierry Reding Signed-off-by: Stefan Agner Signed-off-by: Thierry Reding commit 2db286d7361ecde6cb336cc8f10582afa9c09374 Author: Fabio Estevam Date: Wed Jul 4 14:52:50 2018 -0300 ARM: dts: imx: Remove optional 'fsl,sec-era' property Since commit 654f2b937b38 ("crypto: caam - allow retrieving 'era' from register") the CAAM driver is capable of obtaining the era version by reading the appropriate CAAM registers, so let the CAAM driver discover the era version in run-time instead of hardcoding such information in the device tree. According to Documentation/devicetree/bindings/crypto/fsl-sec4.txt the 'fsl,sec-era' is an optional property and this can be safely removed now. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit db7a2d1809a5b6b08d138ff68837f805fc073351 Author: Will Deacon Date: Wed Jun 20 14:58:10 2018 +0100 asm-generic: unistd.h: Wire up sys_rseq The new rseq call arrived in 4.18-rc1, so provide it in the asm-generic unistd.h for architectures such as arm64. Acked-by: Arnd Bergmann Acked-by: Mathieu Desnoyers Signed-off-by: Will Deacon commit 409d5db49867c20d226a1fc50a73d646bd733dae Author: Will Deacon Date: Wed Jun 20 14:46:50 2018 +0100 arm64: rseq: Implement backend rseq calls and select HAVE_RSEQ Implement calls to rseq_signal_deliver, rseq_handle_notify_resume and rseq_syscall so that we can select HAVE_RSEQ on arm64. Acked-by: Mathieu Desnoyers Acked-by: Mark Rutland Signed-off-by: Will Deacon commit caaac8cde914ebab128295240cb489841d224170 Author: Vladimir Zapolskiy Date: Tue Jul 3 22:29:34 2018 +0300 ARM: dts: imx31: add LogicPD MX31Lite board description The added DTS contains a combined description of LogicPD MX31 Lite SoM devices, peripherals are routed to ports on a baseboard: * PATA controller, * SD/MMC controller, * 2 GPIO LEDs, * UART controllers, * Freescale MC13783 MFD connected over SPI, * SMSC LAN9117, * ST Micro NAND SLC, 64 MiB, * Intel NOR flash, 16 MiB. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 465b3d77b1f8c88d3d28f9da6e4cdd75ce66b6b3 Author: Vladimir Zapolskiy Date: Thu Jul 5 22:05:49 2018 +0300 ARM: dts: imx31: add device tree description of basic controllers The change adds a number of basic peripherals found on i.MX31 SoC: * GPIO controllers, * I2C master controllers, * SPI master controllers, * ATA controller, * SDHC controllers, * RTC, watchdog and PWM contollers, * SDMA, * IRAM, * NAND and WEIM controllers on EMI. The added controller devices were tested on Freescale i.MX31 powered LogicPD Lite SoM and baseboard. DMA functionality was tested on SDHC and SPI controllers so far, thus dmas properties are added to those device nodes only. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 08a213c24f3ec2dbd6e790582a6e7ff303f02fd4 Author: Vladimir Zapolskiy Date: Tue Jul 3 22:29:32 2018 +0300 ARM: i.MX31: remove rnga registration as a platform device On i.MX31 powered boards with OF support Security Random Number Generator Accelerator RNGA controller is initialized from device tree, its registration as a platform device is redundant and actually it is broken due to missing clock information: mxc_rnga mxc_rnga: Could not get rng_clk! mxc_rnga: probe of mxc_rnga failed with error -2 Signed-off-by: Vladimir Zapolskiy Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 141cb3d4ee521eff45d0520327106ddfe0abe90a Author: Xiaowei Song Date: Wed Jul 11 16:09:46 2018 +0800 PCI: kirin: Add MSI support Add support for MSI to the kirin host controller driver, based on the generic dwc infrastructure. Signed-off-by: Xiaowei Song Signed-off-by: Yao Chen [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Andy Shevchenko commit eff2eb5bd57f3ddda47bedd87662d8cd9bd8b2a0 Author: Ivan Bornyakov Date: Wed Jul 11 14:13:34 2018 +0300 staging: gasket: fix plain integer as NULL pointer warning Trivial fix to remove sparse warnings: drivers/staging/gasket/gasket_page_table.c:884:40: warning: Using plain integer as NULL pointer drivers/staging/gasket/gasket_page_table.c:1743:57: warning: Using plain integer as NULL pointer drivers/staging/gasket/gasket_page_table.c:1768:57: warning: Using plain integer as NULL pointer Signed-off-by: Ivan Bornyakov Signed-off-by: Greg Kroah-Hartman commit 74463b19f4d5190b3cbbe6137fbc1fd2c2505733 Author: John Whitmore Date: Tue Jul 10 16:05:23 2018 +0100 staging:rtl8192u: Correction of indentation issues - Coding Style Simple changes to correct indentation issues. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit deb379066d376deec5a76ba9af705598f61ba67b Author: John Whitmore Date: Tue Jul 10 16:05:22 2018 +0100 staging:rtl8192u: Correct indentation of ieee80211_softmac_new_net() Coding style change to correct the indentation of the function ieee80211_softmac_new_net(). A large proportion of the function's if statements were incorrectly indented. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit e4c8f0638ae9ea921f1edba788f120948c2999e2 Author: John Whitmore Date: Tue Jul 10 16:05:21 2018 +0100 staging:rtl8192u: Remove unnecessary parentheses - Coding Style checkpatch.pl flags unnecessary parentheses, so removed from code. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 546f080527af7724faa2e60178b3781fe5b277ec Author: John Whitmore Date: Tue Jul 10 16:05:20 2018 +0100 staging:rtl8192u: Move trailing conditional statement to the following line Coding standard requires that the conditional statement is not on the same line as the 'if' or 'else' but on the following line. Statements moved accordingly. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3e824ba0c1e679cb80e1caf0bbe270e45bc3af12 Author: John Whitmore Date: Tue Jul 10 16:05:19 2018 +0100 staging:rtl8192u: Remove prohibited spaces - Coding Style Simple removal of spaces prohibited by the coding standard. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 591968b2f404913eb14417a142b3a261562048cd Author: John Whitmore Date: Tue Jul 10 16:05:18 2018 +0100 staging:rtl8192u: Correct spacing before and after parenthesis - Style Corrected coding style issues aroung opening and closed parenthesis. Spaces, or blank line, removed from after '(' or before ')' Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit eb2cbcc37763b6b401a3c9252c174e235c7396c3 Author: John Whitmore Date: Tue Jul 10 16:05:17 2018 +0100 staging:rtl8192u: Correct indentation and spacing for braces of code blocks Simple style change to fix the indentaiton and spacing of the braces around multiline code blocks. Braces removed from code block with a single line. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit de6171cdb082ecf71e37ddd7782b33b2019b0df2 Author: John Whitmore Date: Tue Jul 10 16:05:16 2018 +0100 staging:rtl8192u: Remove blank lines before '}' and after '{' characters Coding style change to simply remove the unrequired blanks lines before a closing brace or after an opening brace. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 15fc3e4a08872dafe0e4f32a8fda5694ee3a6f03 Author: Colin Ian King Date: Wed Jul 11 11:59:11 2018 +0100 staging: ks7010: remove redundant variable eth_proto Variable eth_proto is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'eth_proto' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit d8353a75005d518293307b3da7c919b08a778864 Author: Colin Ian King Date: Wed Jul 11 11:49:21 2018 +0100 staging: gdm724x: redundant variables idProduct and idVendor Variable idProduct and idVendor are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'idProduct' set but not used [-Wunused-but-set-variable] warning: variable 'idVendor' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 5a2c3ebe749d91136e4fe7a6a51f10f2d0703665 Author: Colin Ian King Date: Wed Jul 11 11:40:05 2018 +0100 staging: gasket: remove redundant pointer bar_data Pointer bar_data is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'bar_data' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit c833223652cf5ee0440413831d679419b69a1b7b Author: Colin Ian King Date: Wed Jul 11 11:32:29 2018 +0100 staging: comedi: remove redundant variable segpos Variable segpos is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'segpos' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 75971225d8700ce968fe876a971d714913b845c7 Author: Sophie Matter Date: Wed Jul 11 11:45:53 2018 +0200 staging: pi433: Make only one statement per line Lines containing multiple statements were broken into multiple lines, increasing readability and complying with the coding standard. This also fixes several checkpatch.pl errors complaining about the lines being too long. Signed-off-by: Sophie Matter Signed-off-by: Rico Schrage Signed-off-by: Greg Kroah-Hartman commit 368928160477d7315a2b06cf640e34374aa36fcb Author: Sophie Matter Date: Wed Jul 11 11:45:52 2018 +0200 staging: pi433: Use preferred commenting style For multi-line comments, the preferred commenting style from the coding style Documentation was applied to the comments, meaning almost blank lines at the beginning and end of the comment. One changed comment includes a line over 80 characters, causing checkpatch.pl to complain, however breaking this line would not make much sense, so it is kept like it is. Signed-off-by: Sophie Matter Signed-off-by: Rico Schrage Signed-off-by: Greg Kroah-Hartman commit 63688e61d5629c3b931562315bd0373335269880 Author: Sophie Matter Date: Wed Jul 11 11:45:51 2018 +0200 staging: pi433: Comply with 80 character column limit Lines have been split where it makes sense to shorten them in order to comply with the coding standards and fix checkpatch.pl warnings. There are still lines left that are too long, however breaking those would impair readability. Changes in v2: - now working on staging-next branch of the staging tree - the changes to the defines previously made are deleted due to readability Signed-off-by: Sophie Matter Signed-off-by: Rico Schrage Signed-off-by: Greg Kroah-Hartman commit baacd8d100d571aa713c3c60b1471b9962e6ec8a Author: Jerome Brunet Date: Thu Jul 5 12:13:49 2018 +0200 ASoC: dpcm: add rate merge to the BE stream merge As done for format and channels, add the possibility to merge the backend rates on the frontend rates. This useful if the backend does not support all rates supported by the frontend, or if several backends (cpu and codecs) with different capabilities are connected to the same frontend. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 435ffb76f8b35be108a52bf1c43233a57b3c72b4 Author: Jerome Brunet Date: Thu Jul 5 12:13:48 2018 +0200 ASoC: dpcm: rework runtime stream merge The goal of this patch is to simplify a bit dpcm runtime stream merge by removing several local variables. ATM, merge functions return the BE 'filter' values which should then be filtered against the FE stream values. This create a lot of local variable and unnecessary init of min and max. Instead of this, we can pass the FE stream values directly and let the BE filtering functions perform the merge 'in-place' Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit e76ad18b56775aa20c0fb8e6203fae2aaee57e5c Author: Srinivas Kandagatla Date: Fri Jul 6 16:05:27 2018 +0100 regmap: slimbus: add support to multi read/write SLIMbus supports upto 16 bytes in value management messages, so add support to read/writes upto 16 bytes. This also removes redundant single register reg_read/reg_write. Also useful for paged register access on SLIMbus interfaced codecs. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 76672e2e5b86d330e236eabe3ca3d471a581df57 Author: Geert Uytterhoeven Date: Tue Jun 19 15:32:05 2018 +0100 ARM: 8776/1: clkdev: Remove duplicated negative index check from __of_clk_get() __of_clk_get() calls of_parse_phandle_with_args(), which rejects negative indices since commit bd69f73f2c81eed9 ("of: Create function for counting number of phandles in a property"). Signed-off-by: Geert Uytterhoeven Reviewed-by: Stephen Boyd Signed-off-by: Russell King commit 2288fd51808cdf697f12d92706706554192db290 Author: Masahiro Yamada Date: Mon Jul 9 03:09:42 2018 +0100 ARM: 8779/1: add endianness option to LDFLAGS instead of LD With the recent syntax extension, Kconfig is now able to evaluate the compiler / toolchain capability. However, accumulating flags to 'LD' is not compatible with the way it works; 'LD' must be passed to Kconfig to call $(ld-option,...) from Kconfig files. If you tweak 'LD' in arch Makefile depending on CONFIG_CPU_BIG_ENDIAN, this would end up with circular dependency between Makefile and Kconfig. Signed-off-by: Masahiro Yamada Signed-off-by: Russell King commit e69244d29558c947703851a26bfed833945c093a Author: Will Deacon Date: Tue Jun 26 15:52:38 2018 +0100 ARM: 8777/1: Hook up SYNC_CORE functionality for sys_membarrier() Exception return implies context synchronization, so we can hook up the SYNC_CORE option to sys_membarrier() simply by selecting the Kconfig option, just like we've done for arm64 already. Cc: Orion Hodson Acked-by: Mathieu Desnoyers Signed-off-by: Will Deacon Signed-off-by: Russell King commit 89b135ba1b73cd54a09283b39420c90538283801 Author: Dan Carpenter Date: Wed Jul 11 10:58:13 2018 +0300 power: supply: adp5061: Fix a couple off by ones We end up reading one element beyond the end of the adp5061_vmax[] array here. Fixes: fe8e81b7e899 ("adp5061: New driver for ADP5061 I2C battery charger") Signed-off-by: Dan Carpenter Signed-off-by: Sebastian Reichel commit 231f9415001138a000cd0f881c46654b7ea3f8c5 Author: Willy Tarreau Date: Mon Jul 9 14:03:55 2018 +0200 ACPI / PM: save NVS memory for ASUS 1025C laptop Every time I tried to upgrade my laptop from 3.10.x to 4.x I faced an issue by which the fan would run at full speed upon resume. Bisecting it showed me the issue was introduced in 3.17 by commit 821d6f0359b0 (ACPI / sleep: Do not save NVS for new machines to accelerate S3). This code only affects machines built starting as of 2012, but this Asus 1025C laptop was made in 2012 and apparently needs the NVS data to be saved, otherwise the CPU's thermal state is not properly reported on resume and the fan runs at full speed upon resume. Here's a very simple way to check if such a machine is affected : # cat /sys/class/thermal/thermal_zone0/temp 55000 ( now suspend, wait one second and resume ) # cat /sys/class/thermal/thermal_zone0/temp 0 (and after ~15 seconds the fan starts to spin) Let's apply the same quirk as commit cbc00c13 (ACPI: save NVS memory for Lenovo G50-45) and reuse the function it provides. Note that this commit was already backported to 4.9.x but not 4.4.x. Cc: 3.17+ # 3.17+: requires cbc00c13 Signed-off-by: Willy Tarreau Signed-off-by: Rafael J. Wysocki commit 82dfbd27c837b5a7c2a7a13b54a4f0b16c51222f Author: Alan Douglas Date: Mon Jun 25 09:30:51 2018 +0100 dt-bindings: PCI: cadence: Add DT bindings for optional PHYs Update DT documentation to include optional PHYs for cadence PCIe host and endpoint controllers. Signed-off-by: Alan Douglas Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit dfb80534692ddc5b97e1da4384f13dc0287fccb2 Author: Alan Douglas Date: Mon Jun 25 09:30:50 2018 +0100 PCI: cadence: Add generic PHY support to host and EP drivers If PHYs are present, initialize and enable them at driver probe. Signed-off-by: Alan Douglas [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi commit 9df4f90954c860b9715f8fbca521781d8d5cf280 Author: Kunihiko Hayashi Date: Wed Jul 11 13:30:52 2018 +0900 regulator: uniphier: add regulator driver for UniPhier SoC Initial commit to add support for regulators implemented in UniPhier SoCs. This supports USB VBUS only. Signed-off-by: Kunihiko Hayashi Signed-off-by: Mark Brown commit 64a7b80ba6ee80f64d36e59331d14b1d25cf7006 Author: Kunihiko Hayashi Date: Wed Jul 11 13:30:51 2018 +0900 dt-bindings: regulator: add DT bindings for UniPhier regulator Add DT bindings for regulators implemented in UniPhier SoCs. Signed-off-by: Kunihiko Hayashi Signed-off-by: Mark Brown commit 7e37dc1db594d5a4ed062dbaf51ef89596a9df8a Author: Alan Douglas Date: Mon Jun 25 09:30:49 2018 +0100 PCI: cadence: Update cdns_pcie_writel() function signature cdns_pcie_writel() writes a long value; change the value parameter type from u16 to u32 to rectify the function signature and related behaviour. Signed-off-by: Alan Douglas [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi commit 626e6ee210fba380dd652e332493a9b10925f70b Author: Paul Kocialkowski Date: Tue Jul 10 10:01:06 2018 +0200 ARM: dts: sun8i: h3: Add SRAM controller node and C1 SRAM region This adds a SRAM controller node for the H3, with support for the C1 SRAM region that is shared between the Video Engine and the CPU. Signed-off-by: Paul Kocialkowski [Maxime: Fixed the compatible and commit prefix] Signed-off-by: Maxime Ripard commit ae54cf89d6ca897dc698858935b39e91e7e65535 Author: Maxime Ripard Date: Tue Jul 10 10:01:05 2018 +0200 ARM: dts: sun8i: a23-a33: Add SRAM controller node and C1 SRAM region This adds a SRAM controller node for the A23 and A33, with support for the C1 SRAM region that is shared between the Video Engine and the CPU. Signed-off-by: Maxime Ripard Signed-off-by: Paul Kocialkowski [Maxime: Fixed the prefix and the compatibles] Signed-off-by: Maxime Ripard commit 77c223c118a14285ca5efa0f457b2c6b15dfc147 Author: Maxime Ripard Date: Tue Jul 10 10:01:04 2018 +0200 ARM: dts: sun7i: Add support for the C1 SRAM region with the SRAM controller This adds support for the C1 SRAM region (to be used with the SRAM controller driver) for the A20 platform. The region is shared between the Video Engine and the CPU. Signed-off-by: Maxime Ripard Signed-off-by: Paul Kocialkowski [Maxime: Fixed the SRAM C size] Signed-off-by: Maxime Ripard commit c2e01602dc3290e7ba7a808152624fd09a9ef849 Author: Maxime Ripard Date: Tue Jul 10 10:01:03 2018 +0200 ARM: dts: sun5i: Add support for the C1 SRAM region with the SRAM controller This adds support for the C1 SRAM region (to be used with the SRAM controller driver) for sun5i-based platforms. The region is shared between the Video Engine and the CPU. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Signed-off-by: Paul Kocialkowski [Maxime: Fixed the SRAM C size to take the C2 and C3 SRAM into account] Signed-off-by: Maxime Ripard commit f4ca1a5c7e58ef0c38e6c697f7fefb1e081a579d Author: Paul Kocialkowski Date: Tue Jul 10 10:01:02 2018 +0200 ARM: dts: sun7i: Use most-qualified system control compatibles This switches the sun7i-a20 dtsi to use the most qualified compatibles for the system-control block (previously named SRAM controller) as well as the SRAM blocks. The sun4i-a10 compatibles are kept since these hardware blocks are backward-compatible. The node name for system control is also updated to reflect the fact that the controller described is really about system control rather than SRAM control. Signed-off-by: Paul Kocialkowski Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard commit 6b7677c05367db4d46bb80ef3b738a1c039f0ac3 Author: Paul Kocialkowski Date: Tue Jul 10 10:01:01 2018 +0200 ARM: dts: sun5i: Use most-qualified system control compatibles This switches the sun5i dtsi to use the most qualified compatibles for the system-control block (previously named SRAM controller) as well as the SRAM blocks. The node name for system control is also updated to reflect the fact that the controller described is really about system control rather than SRAM control. Signed-off-by: Paul Kocialkowski [Maxime: Removed the A10 compatible for the driver] Signed-off-by: Maxime Ripard commit 37fb1f8d4596813bf6d39ebd8e609bfa8aee75cd Author: Paul Kocialkowski Date: Tue Jul 10 10:01:00 2018 +0200 ARM: dts: sun4i: Switch to new system control compatible string This switches the sun4i-a10 dtsi to use the new compatible for the system-control block (previously named SRAM controller) instead of the deprecated one. The node name is also updated to reflect the fact that the controller described is really about system control rather than SRAM control. Signed-off-by: Paul Kocialkowski [Maxime: Amended the commit message] Signed-off-by: Maxime Ripard commit 5fdec16b69da273d5654c2c3be01246a59e1bcba Author: Maxime Ripard Date: Tue Jul 10 10:00:59 2018 +0200 drivers: soc: sunxi: Add support for the C1 SRAM region This introduces support for the SRAM C1 section, that is controlled by the system controller. This SRAM area can be muxed either to the CPU or the Video Engine, that needs this area to store various tables (e.g. the Huffman VLD decoding tables). This only supports devices with the same layout as the A10 (which also includes the A13, A20, A33 and other SoCs). Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Signed-off-by: Paul Kocialkowski Signed-off-by: Maxime Ripard commit 0ec201cfe7be7d2fd0667450f6214a7f43aa1309 Author: Paul Kocialkowski Date: Tue Jul 10 10:00:57 2018 +0200 dt-bindings: sram: sunxi: Populate valid sections compatibles This adds a list of valid SRAM sections compatibles for the A13, A20, A23 and H3 platforms. Per-platform compatibles are introduced for the SRAM sections of these platforms, with the A10 compatibles also listed as valid when applicable. In particular, compatibles for the C1 SRAM section are introduced. Other SRAMs (C2 and C3 in particular) are left out. They will be added we needed. Signed-off-by: Paul Kocialkowski [Maxime: Added the A10 compatible as fallback, not alternatives] Signed-off-by: Maxime Ripard commit 7d88cd78270ad33cc691b5b0652faff89db8abb4 Author: Paul Kocialkowski Date: Tue Jul 10 10:00:56 2018 +0200 dt-bindings: sram: sunxi: Add A13, A20, A23 and H3 dedicated bindings This introduces dedicated bindings for the system control blocks found on the A13, A20, A23 and H3 sunxi platforms. Since the controllers on the A33 are the very same as those on the A23, no specific compatible is introduced for it. These bindings are introduced to allow reflecting the differences that exist between these controllers, that may become significant to driver implementations. Signed-off-by: Paul Kocialkowski [Maxime: Added A10 fallback compatible for the A20] Signed-off-by: Maxime Ripard commit be9d6446c38c8bcd6a0307780f75eed723843907 Author: Shawn Guo Date: Tue Jul 3 20:24:49 2018 +0800 MAINTAINERS: add Freescale Layerscape ARM architecture entry I have been collecting Freescale Layerscape device tree source files for a while. Add a MAINTAINERS entry for it, so that relevant patches can reach my mail box. Signed-off-by: Shawn Guo Acked-by: Li Yang commit ffaa619af1b062d5a37871df6363aa52356007a7 Author: Petr Mladek Date: Tue Jul 10 10:44:53 2018 +0200 printk: Fix warning about unused suppress_message_printing suppress_message_printing() is not longer called in console_unlock(). Therefore it is not longer needed with disabled CONFIG_PRINTK. This fixes the warning: kernel/printk/printk.c:2033:13: warning: ‘suppress_message_printing’ defined but not used [-Wunused-function] static bool suppress_message_printing(int level) { return false; } Reported-by: Stephen Rothwell Reported-by: Arnd Bergmann Suggested-by: Maninder Singh Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit acc26f59f835142a48f495caf80b86592c4af1f5 Author: Paul Kocialkowski Date: Tue Jul 10 10:00:58 2018 +0200 soc: sunxi: sram: Add dt match for the A10 system-control compatible This binds the new A10 system-control compatible to the associated driver, with the same driver data as the previous compatible. Reviewed-by: Chen-Yu Tsai Signed-off-by: Paul Kocialkowski Signed-off-by: Maxime Ripard commit 2263dd0ce14cad467a78ae903de7a27df1e3d80a Author: Paul Kocialkowski Date: Tue Jul 10 10:00:55 2018 +0200 dt-bindings: sram: sunxi: Introduce new A10 binding for system-control Following-up on the introduction of a new binding for the A64, this introduces a system-control binding for the A10 as a replacement of the sram-controller binding. This change is motivated by consistency with the Allwinner literature, that mentions system control over SRAM controller. Moreover, the system control block is sometimes used for more than SRAM (e.g. for muxing related to the ethernet PHY). Signed-off-by: Paul Kocialkowski Signed-off-by: Maxime Ripard commit 6a7556f604f94461ca802ab69a6dad317c014d30 Author: Jernej Skrabec Date: Tue Jul 10 22:35:09 2018 +0200 ARM: dts: sun8i: r40: Disable TCONs by default. R40 has 4 TCONs, but only 2 of them can receive some kind of output at the same time. Let's disable them by default, so only those which are really connected on board can be enabled in board dts file. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit ccefd95f648a695e3fb62015fd3efc667a250a22 Author: Jernej Skrabec Date: Tue Jul 10 22:35:08 2018 +0200 ARM: dts: sun8i: r40: Add missing TCON-TOP - TCON connections Current R40 is missing some graph connections between TCON TOP and TCONs. Add them. Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline") Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit f9105d819dff1ad565ed3173851cd4eb996d42b5 Author: Jernej Skrabec Date: Tue Jul 10 22:35:07 2018 +0200 ARM: dts: sun8i: r40: Remove fallback compatible for TCON TV A83T and R40 TCON TV are very similar. However, R40 TCON TV is wired differently, which makes it incompatible with A83T TCON TV. Because of that, remove fallback A83T TCON TV compatible. Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline") Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit e64cb21c059ba3b08612727d6f116c3fd7ac9a4d Author: Jernej Skrabec Date: Tue Jul 10 22:35:01 2018 +0200 ARM: dts: sun8i: r40: Add mixer ids to TCON TOP sun4i-drm DT binding, second paragraph of the first section says: For all connections between components up to the TCONs in the display pipeline, when there are multiple components of the same type at the same depth, the local endpoint ID must be the same as the remote component's index. Add mixer ids in R40 DT as mandated by DT binding. Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline") Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 20d85508b8a35138df9248e1903ba9cc1e5b1255 Author: Jernej Skrabec Date: Tue Jul 10 22:34:56 2018 +0200 ARM: dts: sun8i: r40: Remove fallback display engine compatible R40 has pretty unique display pipeline. Because of that, H3 display engine compatible fallback should be removed. Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline") Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 3738c506657f34adbfc860df729b9e38b1567ed4 Author: Johan Hovold Date: Thu Jul 5 12:38:33 2018 +0200 USB: serial: clean up kl5kusb105 documentation Remove references to long-gone kl5kusb105 module parameters in the usb-serial documentation. Signed-off-by: Johan Hovold commit d118851a4d1f2e67ef9442cd3caa35e555bb370e Author: Johan Hovold Date: Thu Jul 5 12:38:32 2018 +0200 USB: serial: kl5kusb105: remove KLSI device id This driver was apparently never tested with an actual KLSI device. In fact, even the device-id entry which was supposed to allow for this had a typo in it. Tests now reveal that the predicted firmware differences with the PalmConnect adapters are real and that the driver does not support KLSI devices with PID 0x000c, so let's remove the broken entry. Reported-by: Chris Jakob Signed-off-by: Johan Hovold commit bd05a58ddfd719015d66e8670af48feb386a3ca6 Author: Nicholas Mc Guire Date: Mon Jul 9 10:42:44 2018 +0200 microblaze: warn if of_iomap() failed of_iomap() can return NULL. The function is void thus error propagation is not possible but at least a WARN_ON() seems warranted here as a silent failure might lead to a hard to understand system state. Signed-off-by: Nicholas Mc Guire Signed-off-by: Michal Simek commit ac1fe1322530ccca0771e3f680e8a6269c48c449 Author: Jernej Skrabec Date: Tue Jul 10 22:35:11 2018 +0200 dt-bindings: display: sun4i-drm: Fix order of DW HDMI PHY compatibles They are currently sorted alphabetically. However, they should be sorted by release date of the family and then alphabetically. Fixes: 03c35dbf73e0 ("dt-bindings: display: sun4i-drm: Add description of A64 HDMI PHY") Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-19-jernej.skrabec@siol.net commit 5e4965667a6edcf0d5b27fb982ecc07d3d0854f8 Author: Jernej Skrabec Date: Tue Jul 10 22:35:10 2018 +0200 drm/sun4i: tcon-top: Remove mux configuration at probe time Now that R40 TCON migrated to runtime mux configuration, old code can be removed. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-18-jernej.skrabec@siol.net commit 05db311a792d65633ab77950e520eaa5f031cf80 Author: Jernej Skrabec Date: Tue Jul 10 22:35:04 2018 +0200 drm/sun4i: tcon-top: Add helpers for mux switching We want to be able to set TCON TOP muxes at runtime. Add helpers for that. Old, static configuration of muxes at probe time is preserved for now. It will be removed when R40 TCON starts using them. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-12-jernej.skrabec@siol.net commit e0f56782bc2d715d6386f77df40e31e64e2b80b7 Author: Jernej Skrabec Date: Tue Jul 10 22:35:02 2018 +0200 drm/sun4i: mixer: Order includes alphabetically Includes are not alphabetically ordered. Reorder them. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-10-jernej.skrabec@siol.net commit 4a068c5c17e8e33518de0b102c0d23ed3615286b Author: Jernej Skrabec Date: Tue Jul 10 22:35:00 2018 +0200 drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search If error happens in sun8i_dw_hdmi_find_possible_crtcs(), nodes are not released with of_node_put() before returning. Fix that by calling of_node_put() when necessary. While on it, clean up the code by using of_graph_get_remote_node() which also lowers number of cases where error handling has to be performed. Fixes: 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs") Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-8-jernej.skrabec@siol.net commit 7a6677753413440781f07e372fd6f06a4b589c88 Author: Jernej Skrabec Date: Tue Jul 10 22:34:59 2018 +0200 dt-bindings: display: sun4i-drm: Add R40 TV TCON description TCON description is expanded with R40 TV TCON compatible. It is a bit special, because it is connected to TCON TOP instead directly to mixer and it needs special handling. Reviewed-by: Chen-Yu Tsai Acked-by: Rob Herring Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-7-jernej.skrabec@siol.net commit da82107ecf328d4914d316872866ceeb683c01eb Author: Jernej Skrabec Date: Tue Jul 10 22:34:58 2018 +0200 drm/sun4i: tcon: Release node when traversing of graph Function sun4i_tcon_find_engine_traverse() doesn't release node if it needs to traverse of graph deeper than 1 level. Fix this by calling of_node_put(). Fixes: 49836b11fe71 ("drm/sun4i: tcon: Generalize engine search algorithm") Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-6-jernej.skrabec@siol.net commit af11942ee44ed9d61ce7d8b1bd3277195ec4c1c1 Author: Jernej Skrabec Date: Tue Jul 10 22:34:57 2018 +0200 drm/sun4i: tcon-top: Cleanup clock handling There is no need to acquire reference to clock just to get its name. This commit just cleans up the code. There is no functional change. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec [Maxime: Fixed the of_property_match_string error check] Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-5-jernej.skrabec@siol.net commit d978a94b0a9e011dc3a7528fc9a34f0553ad0890 Author: Jernej Skrabec Date: Tue Jul 10 22:34:55 2018 +0200 drm/sun4i: Add R40 display engine compatible R40 has versatile display pipeline. It supports two simultanious outputs on various outputs (TVE, VGA, HDMI, MIPI DSI, LCD). Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-3-jernej.skrabec@siol.net commit decac6b00542ea2b95b68863fe3890ed134e5b57 Author: Jernej Skrabec Date: Tue Jul 10 22:34:54 2018 +0200 dt-bindings: display: sun4i-drm: Add R40 display engine compatible R40 has pretty unique display pipeline. It supports two outputs at the same time. Possible outputs: - 1x HDMI, - 2x TV output - 1x VGA, - 1x MIPI DSI and - 2x LCD outputs That is the biggest number of possible outputs from all Allwinner SoC. Because of that, add new compatible for it. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-2-jernej.skrabec@siol.net commit ff2d6acdf6f13d9f8fdcd890844c6d7535ac1f10 Author: Timo Wischer Date: Tue Jul 10 17:28:45 2018 +0200 ALSA: pcm: Fix snd_interval_refine first/last with open min/max Without this commit the following intervals [x y), (x y) were be replaced to (y-1 y) by snd_interval_refine_last(). This was also done if y-1 is part of the previous interval. With this changes it will be replaced with [y-1 y) in case of y-1 is part of the previous interval. A similar behavior will be used for snd_interval_refine_first(). This commit adapts the changes for alsa-lib of commit 9bb985c ("pcm: snd_interval_refine_first/last: exclude value only if also excluded before") Signed-off-by: Timo Wischer Signed-off-by: Takashi Iwai commit db560d1612f81c932df8d31e6f3bf7581c32ba91 Author: Petr Machata Date: Sun Jul 8 19:58:55 2018 +0200 selftests: forwarding: mirror_lib: Tighten up VLAN capture The function do_test_span_vlan_dir_ips() is used for testing whether mirrored packets are VLAN-encapsulated. But since it only considers VLAN encapsulation, it may end up matching unmirrored ARP traffic as well. One consequence is a rare failure of mirror_gre_vlan_bridge_1q's test_gretap_untagged_egress. Decreasing ping cadence in mirror_test() makes the problem easily reproducible. Therefore tighten up the match criterion to only count those 802.1q packets where the next header is IP. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 8115ce745fa26ccffe7d1a542ab4322acf4a682d Author: Yoshihiro Shimoda Date: Wed Jul 11 11:10:16 2018 +0900 dmaengine: sh: rcar-dmac: Add dma_pause operation This patch adds dma_pause operation. This patch is based on Muhammad Hamza Farooq's patch. After this patch applied, an issue that the sh-sci driver with high baud rate might cause data lost disappeared because the DMAC is possible to transmit between [1] and [2] below, and then the residue of [1] is not true: In rx_timer_fn() of the sh-sci.c: dmaengine_pause(); ... dmaengine_tx_status(); /* [1] */ ... dmaengine_terminate_all(); /* [2] */ Signed-off-by: Yoshihiro Shimoda Signed-off-by: Vinod Koul commit 4de1247a9826cec0ba054479124bd9aa60fb71a5 Author: Yoshihiro Shimoda Date: Wed Jul 11 11:10:15 2018 +0900 dmaengine: sh: rcar-dmac: add a new function to clear CHCR.DE with barrier This patch adds a new function rcar_dmac_clear_chcr_de() to simplify adding pause function later. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Vinod Koul commit 6b4e8085c0004382b985a5c005c685073630e746 Author: Al Viro Date: Sun Jul 8 21:45:07 2018 -0400 make sure do_dentry_open() won't return positive as an error An ->open() instances really, really should not be doing that. There's a lot of places e.g. around atomic_open() that could be confused by that, so let's catch that early. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit b10a4a9f7695335bd2bb19bffdda7fbefbc6581f Author: Al Viro Date: Mon Jul 9 02:29:58 2018 -0400 create_pipe_files(): use fput() if allocation of the second file fails ... just use put_pipe_info() to get the pipe->files down to 1 and let fput()-called pipe_release() do freeing. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 19f391eb05b8b005f2907ddc8f284487b446abf3 Author: Al Viro Date: Fri Jun 8 11:19:32 2018 -0400 turn filp_clone_open() into inline wrapper for dentry_open() it's exactly the same thing as dentry_open(&file->f_path, file->f_flags, file->f_cred) ... and rename it to file_clone_open(), while we are at it. 'filp' naming convention is bogus; sure, it's "file pointer", but we generally don't do that kind of Hungarian notation. Some of the instances have too many callers to touch, but this one has only two, so let's sanitize it while we can... Acked-by: Linus Torvalds Signed-off-by: Al Viro commit e8cff84faa4ddb6716caed085f515fbb1d856099 Author: Al Viro Date: Mon Jul 9 11:24:21 2018 -0400 fold security_file_free() into file_free() .. and the call of file_free() in case of security_file_alloc() failure in get_empty_filp() should be simply file_free_rcu() - no point in rcu-delays there, anyway. Acked-by: Linus Torvalds Signed-off-by: Al Viro commit 5025b99c96a509e46a299942eab8286bb6f0f50a Merge: 52b509218f0a 0c850344d388 Author: David S. Miller Date: Tue Jul 10 20:06:35 2018 -0700 Merge branch 'cake-qdisc' Toke Høiland-Jørgensen says: ==================== sched: Add Common Applications Kept Enhanced (cake) qdisc This patch series adds the CAKE qdisc, and has been split up to ease review. I have attempted to split out each configurable feature into its own patch. The first commit adds the base shaper and packet scheduler, while subsequent commits add the optional features. The full userspace API and most data structures are included in this commit, but options not understood in the base version will be ignored. The result of applying the entire series is identical to the out of tree version that have seen extensive testing in previous deployments, most notably as an out of tree patch to OpenWrt. However, note that I have only compile tested the individual patches; so the whole series should be considered as a unit. --- Changelog v19: - Rebase to current net-next. - Don't rely on the value of sch->q.qlen to break loops; fixes possible infinite loop on multi-queue devices. - Don't overwrite NAT flag when setting flow mode. v18: - Rework classification logic in the diffserv case to always hash if filter doesn't select a queue, and to run TC filters before selecting the diffserv tin (allowing filter to influence this). - Make sure we always call qdisc_watchdog_init() in cake_init(), so we don't crash in cake_destroy(). v17: - Rebase to newest net-next and move the conntrack callback to nf_ct_hook - Fix a compile error when NF_CONNTRACK is unset. v16: - Move conntrack lookup function into conntrack core and read it via RCU so it is only active when the nf_conntrack module is loaded. This avoids the module dependency on conntrack for NAT mode. Thanks to Pablo for the idea. v15: - Handle ECN flags in ACK filter v14: - Handle seqno wraps and DSACKs in ACK filter v13: - Avoid ktime_t to scalar compares - Add class dumping and basic stats - Fail with ENOTSUPP when requesting NAT mode and conntrack is not available. - Parse all TCP options in ACK filter and make sure to only drop safe ones. Also handle SACK ranges properly. v12: - Get rid of custom time typedefs. Use ktime_t for time and u64 for duration instead. v11: - Fix overhead compensation calculation for GSO packets - Change configured rate to be u64 (I ran out of bits before I ran out of CPU when testing the effects of the above) v10: - Christmas tree gardening (fix variable declarations to be in reverse line length order) v9: - Remove duplicated checks around kvfree() and just call it unconditionally. - Don't pass __GFP_NOWARN when allocating memory - Move options in cake_dump() that are related to optional features to later patches implementing the features. - Support attaching filters to the qdisc and use the classification result to select flow queue. - Support overriding diffserv priority tin from skb->priority v8: - Remove inline keyword from function definitions - Simplify ACK filter; remove the complex state handling to make the logic easier to follow. This will potentially be a bit less efficient, but I have not been able to measure a difference. v7: - Split up patch into a series to ease review. - Constify the ACK filter. v6: - Fix 6in4 encapsulation checks in ACK filter code - Checkpatch fixes v5: - Refactor ACK filter code and hopefully fix the safety issues properly this time. v4: - Only split GSO packets if shaping at speeds <= 1Gbps - Fix overhead calculation code to also work for GSO packets - Don't re-implement kvzalloc() - Remove local header include from out-of-tree build (fixes kbuild-bot complaint). - Several fixes to the ACK filter: - Check pskb_may_pull() before deref of transport headers. - Don't run ACK filter logic on split GSO packets - Fix TCP sequence number compare to deal with wraparounds v3: - Use IS_REACHABLE() macro to fix compilation when sch_cake is built-in and conntrack is a module. - Switch the stats output to use nested netlink attributes instead of a versioned struct. - Remove GPL boilerplate. - Fix array initialisation style. v2: - Fix kbuild test bot complaint - Clean up the netlink ABI - Fix checkpatch complaints - A few tweaks to the behaviour of cake based on testing carried out while writing the paper. ==================== Signed-off-by: David S. Miller commit 0c850344d3882886f842bf0b50a9ff23001adb7e Author: Toke Høiland-Jørgensen Date: Fri Jul 6 17:37:19 2018 +0200 sch_cake: Conditionally split GSO segments At lower bandwidths, the transmission time of a single GSO segment can add an unacceptable amount of latency due to HOL blocking. Furthermore, with a software shaper, any tuning mechanism employed by the kernel to control the maximum size of GSO segments is thrown off by the artificial limit on bandwidth. For this reason, we split GSO segments into their individual packets iff the shaper is active and configured to a bandwidth <= 1 Gbps. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit a729b7f0bd5bf4919306556aed614438f5174537 Author: Toke Høiland-Jørgensen Date: Fri Jul 6 17:37:19 2018 +0200 sch_cake: Add overhead compensation support to the rate shaper This commit adds configurable overhead compensation support to the rate shaper. With this feature, userspace can configure the actual bottleneck link overhead and encapsulation mode used, which will be used by the shaper to calculate the precise duration of each packet on the wire. This feature is needed because CAKE is often deployed one or two hops upstream of the actual bottleneck (which can be, e.g., inside a DSL or cable modem). In this case, the link layer characteristics and overhead reported by the kernel does not match the actual bottleneck. Being able to set the actual values in use makes it possible to configure the shaper rate much closer to the actual bottleneck rate (our experience shows it is possible to get with 0.1% of the actual physical bottleneck rate), thus keeping latency low without sacrificing bandwidth. The overhead compensation has three tunables: A fixed per-packet overhead size (which, if set, will be accounted from the IP packet header), a minimum packet size (MPU) and a framing mode supporting either ATM or PTM framing. We include a set of common keywords in TC to help users configure the right parameters. If no overhead value is set, the value reported by the kernel is used. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 83f8fd69af4f62136765b60fd0efa1c9167917c5 Author: Toke Høiland-Jørgensen Date: Fri Jul 6 17:37:19 2018 +0200 sch_cake: Add DiffServ handling This adds support for DiffServ-based priority queueing to CAKE. If the shaper is in use, each priority tier gets its own virtual clock, which limits that tier's rate to a fraction of the overall shaped rate, to discourage trying to game the priority mechanism. CAKE defaults to a simple, three-tier mode that interprets most code points as "best effort", but places CS1 traffic into a low-priority "bulk" tier which is assigned 1/16 of the total rate, and a few code points indicating latency-sensitive or control traffic (specifically TOS4, VA, EF, CS6, CS7) into a "latency sensitive" high-priority tier, which is assigned 1/4 rate. The other supported DiffServ modes are a 4-tier mode matching the 802.11e precedence rules, as well as two 8-tier modes, one of which implements strict precedence of the eight priority levels. This commit also adds an optional DiffServ 'wash' mode, which will zero out the DSCP fields of any packet passing through CAKE. While this can technically be done with other mechanisms in the kernel, having the feature available in CAKE significantly decreases configuration complexity; and the implementation cost is low on top of the other DiffServ-handling code. Filters and applications can set the skb->priority field to override the DSCP-based classification into tiers. If TC_H_MAJ(skb->priority) matches CAKE's qdisc handle, the minor number will be interpreted as a priority tier if it is less than or equal to the number of configured priority tiers. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit ea82511518f4f2e5fe83d2fe1884ef5fc6be6204 Author: Toke Høiland-Jørgensen Date: Fri Jul 6 17:37:19 2018 +0200 sch_cake: Add NAT awareness to packet classifier When CAKE is deployed on a gateway that also performs NAT (which is a common deployment mode), the host fairness mechanism cannot distinguish internal hosts from each other, and so fails to work correctly. To fix this, we add an optional NAT awareness mode, which will query the kernel conntrack mechanism to obtain the pre-NAT addresses for each packet and use that in the flow and host hashing. When the shaper is enabled and the host is already performing NAT, the cost of this lookup is negligible. However, in unlimited mode with no NAT being performed, there is a significant CPU cost at higher bandwidths. For this reason, the feature is turned off by default. Cc: netfilter-devel@vger.kernel.org Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit b60a60405fb95a688eb2ef4ef20f5fcaa7b64f68 Author: Toke Høiland-Jørgensen Date: Fri Jul 6 17:37:19 2018 +0200 netfilter: Add nf_ct_get_tuple_skb global lookup function This adds a global netfilter function to extract a conntrack tuple from an skb. The function uses a new function added to nf_ct_hook, which will try to get the tuple from skb->_nfct, and do a full lookup if that fails. This makes it possible to use the lookup function before the skb has passed through the conntrack init hooks (e.g., in an ingress qdisc). The tuple is copied to the caller to avoid issues with reference counting. The function returns false if conntrack is not loaded, allowing it to be used without incurring a module dependency on conntrack. This is used by the NAT mode in sch_cake. Cc: netfilter-devel@vger.kernel.org Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 8b7138814f29933898ecd31dfc83e35a30ee69f5 Author: Toke Høiland-Jørgensen Date: Fri Jul 6 17:37:19 2018 +0200 sch_cake: Add optional ACK filter The ACK filter is an optional feature of CAKE which is designed to improve performance on links with very asymmetrical rate limits. On such links (which are unfortunately quite prevalent, especially for DSL and cable subscribers), the downstream throughput can be limited by the number of ACKs capable of being transmitted in the *upstream* direction. Filtering ACKs can, in general, have adverse effects on TCP performance because it interferes with ACK clocking (especially in slow start), and it reduces the flow's resiliency to ACKs being dropped further along the path. To alleviate these drawbacks, the ACK filter in CAKE tries its best to always keep enough ACKs queued to ensure forward progress in the TCP flow being filtered. It does this by only filtering redundant ACKs. In its default 'conservative' mode, the filter will always keep at least two redundant ACKs in the queue, while in 'aggressive' mode, it will filter down to a single ACK. The ACK filter works by inspecting the per-flow queue on every packet enqueue. Starting at the head of the queue, the filter looks for another eligible packet to drop (so the ACK being dropped is always closer to the head of the queue than the packet being enqueued). An ACK is eligible only if it ACKs *fewer* bytes than the new packet being enqueued, including any SACK options. This prevents duplicate ACKs from being filtered, to avoid interfering with retransmission logic. In addition, we check TCP header options and only drop those that are known to not interfere with sender state. In particular, packets with unknown option codes are never dropped. In aggressive mode, an eligible packet is always dropped, while in conservative mode, at least two ACKs are kept in the queue. Only pure ACKs (with no data segments) are considered eligible for dropping, but when an ACK with data segments is enqueued, this can cause another pure ACK to become eligible for dropping. The approach described above ensures that this ACK filter avoids most of the drawbacks of a naive filtering mechanism that only keeps flow state but does not inspect the queue. This is the rationale for including the ACK filter in CAKE itself rather than as separate module (as the TC filter, for instance). Our performance evaluation has shown that on a 30/1 Mbps link with a bidirectional traffic test (RRUL), turning on the ACK filter on the upstream link improves downstream throughput by ~20% (both modes) and upstream throughput by ~12% in conservative mode and ~40% in aggressive mode, at the cost of ~5ms of inter-flow latency due to the increased congestion. In *really* pathological cases, the effect can be a lot more; for instance, the ACK filter increases the achievable downstream throughput on a link with 100 Kbps in the upstream direction by an order of magnitude (from ~2.5 Mbps to ~25 Mbps). Finally, even though we consider the ACK filter to be safer than most, we do not recommend turning it on everywhere: on more symmetrical link bandwidths the effect is negligible at best. Cc: Yuchung Cheng Cc: Neal Cardwell Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 7298de9cd7255a783ba93533acbf1c2b0a9c582d Author: Toke Høiland-Jørgensen Date: Fri Jul 6 17:37:19 2018 +0200 sch_cake: Add ingress mode The ingress mode is meant to be enabled when CAKE runs downlink of the actual bottleneck (such as on an IFB device). The mode changes the shaper to also account dropped packets to the shaped rate, as these have already traversed the bottleneck. Enabling ingress mode will also tune the AQM to always keep at least two packets queued *for each flow*. This is done by scaling the minimum queue occupancy level that will disable the AQM by the number of active bulk flows. The rationale for this is that retransmits are more expensive in ingress mode, since dropped packets have to traverse the bottleneck again when they are retransmitted; thus, being more lenient and keeping a minimum number of packets queued will improve throughput in cases where the number of active flows are so large that they saturate the bottleneck even at their minimum window size. This commit also adds a separate switch to enable ingress mode rate autoscaling. If enabled, the autoscaling code will observe the actual traffic rate and adjust the shaper rate to match it. This can help avoid latency increases in the case where the actual bottleneck rate decreases below the shaped rate. The scaling filters out spikes by an EWMA filter. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 046f6fd5daefac7f5abdafb436b30f63bc7c602b Author: Toke Høiland-Jørgensen Date: Fri Jul 6 17:37:19 2018 +0200 sched: Add Common Applications Kept Enhanced (cake) qdisc sch_cake targets the home router use case and is intended to squeeze the most bandwidth and latency out of even the slowest ISP links and routers, while presenting an API simple enough that even an ISP can configure it. Example of use on a cable ISP uplink: tc qdisc add dev eth0 cake bandwidth 20Mbit nat docsis ack-filter To shape a cable download link (ifb and tc-mirred setup elided) tc qdisc add dev ifb0 cake bandwidth 200mbit nat docsis ingress wash CAKE is filled with: * A hybrid Codel/Blue AQM algorithm, "Cobalt", tied to an FQ_Codel derived Flow Queuing system, which autoconfigures based on the bandwidth. * A novel "triple-isolate" mode (the default) which balances per-host and per-flow FQ even through NAT. * An deficit based shaper, that can also be used in an unlimited mode. * 8 way set associative hashing to reduce flow collisions to a minimum. * A reasonable interpretation of various diffserv latency/loss tradeoffs. * Support for zeroing diffserv markings for entering and exiting traffic. * Support for interacting well with Docsis 3.0 shaper framing. * Extensive support for DSL framing types. * Support for ack filtering. * Extensive statistics for measuring, loss, ecn markings, latency variation. A paper describing the design of CAKE is available at https://arxiv.org/abs/1804.07617, and will be published at the 2018 IEEE International Symposium on Local and Metropolitan Area Networks (LANMAN). This patch adds the base shaper and packet scheduler, while subsequent commits add the optional (configurable) features. The full userspace API and most data structures are included in this commit, but options not understood in the base version will be ignored. Various versions baking have been available as an out of tree build for kernel versions going back to 3.10, as the embedded router world has been running a few years behind mainline Linux. A stable version has been generally available on lede-17.01 and later. sch_cake replaces a combination of iptables, tc filter, htb and fq_codel in the sqm-scripts, with sane defaults and vastly simpler configuration. CAKE's principal author is Jonathan Morton, with contributions from Kevin Darbyshire-Bryant, Toke Høiland-Jørgensen, Sebastian Moeller, Ryan Mounce, Tony Ambardar, Dean Scarff, Nils Andreas Svee, Dave Täht, and Loganaden Velvindron. Testing from Pete Heist, Georgios Amanakis, and the many other members of the cake@lists.bufferbloat.net mailing list. tc -s qdisc show dev eth2 qdisc cake 8017: root refcnt 2 bandwidth 1Gbit diffserv3 triple-isolate split-gso rtt 100.0ms noatm overhead 38 mpu 84 Sent 51504294511 bytes 37724591 pkt (dropped 6, overlimits 64958695 requeues 12) backlog 0b 0p requeues 12 memory used: 1053008b of 15140Kb capacity estimate: 970Mbit min/max network layer size: 28 / 1500 min/max overhead-adjusted size: 84 / 1538 average network hdr offset: 14 Bulk Best Effort Voice thresh 62500Kbit 1Gbit 250Mbit target 5.0ms 5.0ms 5.0ms interval 100.0ms 100.0ms 100.0ms pk_delay 5us 5us 6us av_delay 3us 2us 2us sp_delay 2us 1us 1us backlog 0b 0b 0b pkts 3164050 25030267 9530280 bytes 3227519915 35396974782 12879808898 way_inds 0 8 0 way_miss 21 366 25 way_cols 0 0 0 drops 5 0 1 marks 0 0 0 ack_drop 0 0 0 sp_flows 1 3 0 bk_flows 0 1 1 un_flows 0 0 0 max_len 68130 68130 68130 Tested-by: Pete Heist Tested-by: Georgios Amanakis Signed-off-by: Dave Taht Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 59b851dbf7dc94214e4fab5dd29ea28b4075a04f Author: Bart Van Assche Date: Tue Jul 10 13:32:24 2018 -0700 RDMA/nes: Avoid complaints about unused variables Avoid that the compiler reports the following when building with W=1: drivers/infiniband/hw/nes/nes_utils.c: In function 'nes_arp_table': drivers/infiniband/hw/nes/nes_utils.c:689:9: warning: variable 'tmp_addr' set but not used [-Wunused-but-set-variable] __be32 tmp_addr; ^~~~~~~~ drivers/infiniband/hw/nes/nes_hw.c: In function 'flush_wqes': drivers/infiniband/hw/nes/nes_hw.c:3840:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^~~ drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_setup_virt_qp': drivers/infiniband/hw/nes/nes_verbs.c:811:6: warning: variable 'pbl_entries' set but not used [-Wunused-but-set-variable] u32 pbl_entries; ^~~~~~~~~~~ drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_dereg_mr': drivers/infiniband/hw/nes/nes_verbs.c:2487:6: warning: variable 'minor_code' set but not used [-Wunused-but-set-variable] u16 minor_code; ^~~~~~~~~~ drivers/infiniband/hw/nes/nes_cm.c: In function 'mini_cm_recv_pkt': drivers/infiniband/hw/nes/nes_cm.c:2570:20: warning: variable 'tmp_saddr' set but not used [-Wunused-but-set-variable] __be32 tmp_daddr, tmp_saddr; ^~~~~~~~~ drivers/infiniband/hw/nes/nes_cm.c:2570:9: warning: variable 'tmp_daddr' set but not used [-Wunused-but-set-variable] __be32 tmp_daddr, tmp_saddr; ^~~~~~~~~ drivers/infiniband/hw/nes/nes_cm.c: In function 'cm_event_connected': drivers/infiniband/hw/nes/nes_cm.c:3578:22: warning: variable 'raddr' set but not used [-Wunused-but-set-variable] struct sockaddr_in *raddr; ^~~~~ drivers/infiniband/hw/nes/nes_cm.c: In function 'cm_event_reset': drivers/infiniband/hw/nes/nes_cm.c:3753:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^~~ Signed-off-by: Bart Van Assche Cc: Faisal Latif Cc: Tatyana Nikolova Signed-off-by: Jason Gunthorpe commit 23ff6ba8feec5c4bdf993af3fba3937d57883dc8 Author: Jason Gunthorpe Date: Tue Jul 10 13:03:16 2018 -0600 RDMA/cxgb4: Restore the dropped uninitialized_var In some configurations even gcc 7 cannot unravel this complexity and still throws a warning. Fixes: 4ab39e2f98f2 ("RDMA/cxgb4: Make c4iw_poll_cq_one() easier to analyze") Reported-by: Stephen Rothwell Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit af8a6722fa39b9ddc63e8f3b97656ba168a04199 Author: Johannes Thumshirn Date: Fri Jul 6 15:33:49 2018 +0200 scsi: remove NCR_Q720 driver The NCR QUAD 720 SCSI driver depends on microchannel support, but microchannel support was removed from the kernel with commit bb8187d35f82 ("MCA: delete all remaining traces of microchannel bus support.") over 6 years ago. So zap the Q720 SCSI driver as well. Signed-off-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Acked-by: James E.J. Bottomley Signed-off-by: Martin K. Petersen commit 54e45716a84ac9df9e5fef779ab54fc2f97ebdf3 Author: Johannes Thumshirn Date: Fri Jul 6 15:33:48 2018 +0200 scsi: remove NCR_D700 driver The NCR DUAL 700 SCSI driver depends on microchannel support, but microchannel support was removed from the kernel with commit bb8187d35f82 ("MCA: delete all remaining traces of microchannel bus support.") over 6 years ago. So zap the D700 SCSI driver as well. Signed-off-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Acked-by: James E.J. Bottomley Signed-off-by: Martin K. Petersen commit 78adb2bc9f7216226799489c351f32ea3a092f49 Author: Johannes Thumshirn Date: Thu Jul 5 13:01:40 2018 +0200 scsi: ncr53c8xx: remove ScsiResult macro Remove the ScsiResult macro and open code it on all call sites. This will make subsequent refactoring in this area easier. Signed-off-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit c6668cae16f046ba5c4b6090bb234bdbccdb70cf Author: Johannes Thumshirn Date: Thu Jul 5 13:01:39 2018 +0200 scsi: lpfc: remove ScsiResult macro Remove the ScsiResult macro and open code it on all call sites. This will make subsequent refactoring in this area easier. Signed-off-by: Johannes Thumshirn Cc: James Smart Cc: Dick Kennedy Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 55c9d37165d28f081b7ba11fc2a7938d4bbb75c6 Author: Johannes Thumshirn Date: Thu Jul 5 13:01:38 2018 +0200 scsi: bfa: remove ScsiResult macro Remove the ScsiResult macro and open code it on all call sites. This will make subsequent refactoring in this area easier. Signed-off-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 2d362b8ad57f42701ea435140ad800c415cd4527 Author: Johannes Thumshirn Date: Thu Jul 5 13:01:37 2018 +0200 scsi: aacraid: remove AAC_STAT_GOOD define Remove the AAC_STAT_GOOD definition and open code it in the places it was used. This will make subsequent refactoring in this area easier. Signed-off-by: Johannes Thumshirn Cc: Dave Carroll Cc: Raghava Aditya Renukunta Reviewed-by: Dave Carroll Signed-off-by: Martin K. Petersen commit fa519f701d27198a2858bb108fc18ea9d8c106a7 Author: Hannes Reinecke Date: Wed Jul 4 13:59:16 2018 +0200 scsi: libfc: fixup 'sleeping function called from invalid context' fc_rport_login() will be calling mutex_lock() while running inside an RCU-protected section, triggering the warning 'sleeping function called from invalid context'. To fix this we can drop the rcu functions here altogether as the disc mutex protecting the list itself is already held, preventing any list manipulation. Fixes: a407c593398c ("scsi: libfc: Fixup disc_mutex handling") Signed-off-by: Hannes Reinecke Acked-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit ee35624e1e4e4e9a26a30d56c25a07ba9cdd8ecb Author: Hannes Reinecke Date: Wed Jul 4 13:56:48 2018 +0200 scsi: libfc: Add lockdep annotations Convert the free text locking notes into proper lockdep annotations. Signed-off-by: Hannes Reinecke Acked-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit d5038a13eca72fb216c07eb717169092e92284f1 Author: Johannes Thumshirn Date: Wed Jul 4 10:53:56 2018 +0200 scsi: core: switch to scsi-mq by default It has been more than one year since we tried to change the default from legacy to multi queue in SCSI with commit c279bd9e406 ("scsi: default to scsi-mq"). But due to issues with suspend/resume and performance problems it had been reverted again with commit cbe7dfa26eee ("Revert "scsi: default to scsi-mq""). In the meantime there have been a substantial amount of performance improvements and suspend/resume got fixed as well, thus we can re-enable scsi-mq without a significant performance penalty. Signed-off-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Ming Lei Acked-by: John Garry Signed-off-by: Martin K. Petersen commit fc21ae8927f391b6e3944f82e417355da5d06a83 Author: Gustavo A. R. Silva Date: Tue Jul 3 17:20:03 2018 -0500 scsi: mptfusion: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit 14b470b56840dbb093abd71f214e9d63770c87b8 Author: Arnd Bergmann Date: Fri Jul 6 22:19:07 2018 +0200 scsi: target: sbitmap: add seq_file forward declaration The target core runs into a warning in the linux/sbitmap.h file in some configurations: In file included from include/target/target_core_base.h:7, from drivers/target/target_core_fabric_lib.c:41: include/linux/sbitmap.h:331:46: error: 'struct seq_file' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] void sbitmap_show(struct sbitmap *sb, struct seq_file *m); ^~~~~~~~ In general, headers should not depend on others being included first, so this fixes it with a forward declaration for that struct name, but we probably want to merge the patch through the scsi tree to help bisection. Fixes: 10e9cbb6b531 ("scsi: target: Convert target drivers to use sbitmap") Signed-off-by: Arnd Bergmann Reviewed-by: Bart Van Assche Reviewed-by: Omar Sandoval Reviewed-by: Jens Axboe Signed-off-by: Martin K. Petersen commit 4ae2ebde318fc120bc91c65a0127b6a225b2d6ed Author: James Smart Date: Tue Jun 26 08:24:31 2018 -0700 scsi: lpfc: Revise copyright for new company language Change references from "Broadcom Limited" to "Broadcom Inc." in the copyright message. Update copyright duration if not yet updated for 2018. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 3e1ebadd889f2670ecef77157d84261d09a5ca41 Author: James Smart Date: Tue Jun 26 08:24:30 2018 -0700 scsi: lpfc: update driver version to 12.0.0.5 Update the driver version to 12.0.0.5 Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b0e830125b669570d8096b8ba22eb00f659fc05e Author: James Smart Date: Tue Jun 26 08:24:29 2018 -0700 scsi: lpfc: devloss timeout race condition caused null pointer reference A race condition between the context of devloss timeout handler and I/O completion caused devloss timeout handler de-referencing pointer that had been released. Added the check in lpfc_sli_validate_fcp_iocb() on LPFC_IO_ON_TXCMPLQ to capture the race condition of I/O completion and devloss timeout handler attemption for aborting the I/O. Also, added check on lpfc_cmd->rdata pointer before de-referenceing lpfc_cmd->rdata->pnode. Also, added protection in lpfc_sli_abort_iocb() routine on driver performed FCP I/O FLUSHING already under way before proceeding to aborting I/Os. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 6871e8144f935a1f08e7fc6269c894861ce494aa Author: James Smart Date: Tue Jun 26 08:24:28 2018 -0700 scsi: lpfc: Fix NVME Target crash in defer rcv logic Kernel occasionally crashed with the following ops on NVME Target: BUG: unable to handle kernel NULL pointer dereference at 0000000000000058 IP: [] lpfc_nvmet_defer_rcv+0x50/0x70 [lpfc] Callback routine was called for deferred rcv when it should be treated as a normal rcv. Added code in callback routine to detect this condition and log a message, then bail. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 66e9e6bf07cb0a2d4bbccebf6a6f1f27e6768e38 Author: James Smart Date: Tue Jun 26 08:24:27 2018 -0700 scsi: lpfc: Support duration field in Link Cable Beacon V1 command Current implementation missed setting the duration field. Correct the code to set the field. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 414abe0ab66f951efe743a3293cb36ac3255214a Author: James Smart Date: Tue Jun 26 08:24:26 2018 -0700 scsi: lpfc: Make PBDE optimizations configurable The PBDE optimizations aren't supported in all firmware revs. Make optimizations configurable in case there's a side effect on old firmware. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 68c9b55deea51151d9da3d45ecc9a5ef72f9dfb1 Author: James Smart Date: Tue Jun 26 08:24:25 2018 -0700 scsi: lpfc: Fix abort error path for NVMET rmmod of driver hangs As driver instances were being unloaded, the NVME target port was unloaded first. During the unload, the NVME initiator port sent a heartbeat IO. Because of the target port state, that IO was scheduled for an Abort; however, that abort subsequently failed. The failure was not cleaned up properly and lpfc_sli4_xri_exchange_busy_wait silently hung forever. Clean failed abort properly and make lpfc_sli4_xri_exchange_busy_wait not hangs silently while waiting for aborts to complete. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit d580c6137476ab307a66e278cf7dbc666230f714 Author: James Smart Date: Tue Jun 26 08:24:24 2018 -0700 scsi: lpfc: Fix panic if driver unloaded when port is offline System crashes when the lpfc module is unloaded after making the port offline The nvme queue pointers were freed during port offline, but were later accessed in pci remove path. Validate the pointers in pci remove path before accessing them. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 5cc167ddb7441013e2b5a5f47bf11af0264bb3e8 Author: James Smart Date: Tue Jun 26 08:24:23 2018 -0700 scsi: lpfc: Fix driver not setting dpp bits correctly in doorbell word Driver is incorrectly formatting a register on new hardware, using a format for an older chip. This can result in non-deterministic behavior. Ensure driver is not setting "workqueue index" in the WQ doorbell when making a non-dpp doorbell write. The field must be zero when non-dpp. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit afff0d2321ea2beb6f4dcd029d4667acf73dec25 Author: James Smart Date: Tue Jun 26 08:24:22 2018 -0700 scsi: lpfc: Add Buffer overflow check, when nvme_info larger than PAGE_SIZE Kernel crashes during fill_read_buffer when nvme_info sysfs file read. With multiple NVME targets, approx 40, nvme_info may grow larger than PAGE_SIZE bytes. snprintf(buf + len, PAGE_SIZE - len, ...) logic is flawed as PAGE_SIZE - len can be < 0 and is accepted by snprintf. This results in buffer overflow, and is detected with check from dev_attr_show and fill_read_buffer. Change to use scnprintf to a tmp array, before calling strlcat to ensure no buffer overflow over PAGE_SIZE bytes. Message "6314" created as a new message indicating when there is more nvme info, but is truncated to fit within PAGE_SIZE bytes. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit f075dce66c6039bb97b762b592a6db6d79e4350a Author: Linus Torvalds Date: Tue Jul 10 17:02:17 2018 -0700 scsi sg: remove incorrect scsi command checking logic The SCSI_IOCTL_SEND_COMMAND ioctl has interesting scsi command "security" checking. If the file was opened read-only (but only in that case), it will fetch the first byte of the command from user space, and do "sg_allow_access()" on it. That, in turn, will check that "blk_verify_command()" is ok with that command byte. If that passes, it will then do call "sg_scsi_ioctl()" to execute the command. This is entirely nonsensical for several reasons. It's nonsensical simply because it's racy: after it copies the command byte from user mode to check it, user mode could just change the byte before it is actually submitted later by "sg_scsi_ioctl()". But it is nonsensical also because "sg_scsi_ioctl()" itself already does blk_verify_command() on the command properly after it has been copied from user space. So it is an incorrect implementation of a pointless check. Remove it. Signed-off-by: Linus Torvalds commit 185441e03aa9dde9fb99e6a015441fc9b312d2ef Author: Paulo Zanoni Date: Fri May 4 13:32:52 2018 -0700 drm/i915: use the ICL stolen memory Now that our stolen memory is already reserved by the x86 subsystem (since commit "x86/gpu: reserve ICL's graphics stolen memory"), make use of it. Cc: Joonas Lahtinen Cc: Daniele Ceraolo Spurio Cc: x86@kernel.org Signed-off-by: Paulo Zanoni Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180504203252.28048-2-paulo.r.zanoni@intel.com commit db0c8d8b031d2b5960f6407f7f2ca20e97e00605 Author: Paulo Zanoni Date: Fri May 4 13:32:51 2018 -0700 x86/gpu: reserve ICL's graphics stolen memory ICL changes the registers and addresses to 64 bits. I also briefly looked at implementing an u64 version of the PCI config read functions, but I concluded this wouldn't be trivial, so it's not worth doing it for a single user that can't have any racing problems while reading the register in two separate operations. v2: - Scrub the development (non-public) changelog (Joonas). - Remove the i915.ko bits so this can be easily backported in order to properly avoid stolen memory even on machines without i915.ko (Joonas). - CC stable for the reasons above. Issue: VIZ-9250 CC: stable@vger.kernel.org Cc: Ingo Molnar Cc: H. Peter Anvin Cc: x86@kernel.org Cc: Daniele Ceraolo Spurio Cc: Joonas Lahtinen Signed-off-by: Paulo Zanoni Fixes: 412310019a20 ("drm/i915/icl: Add initial Icelake definitions.") Reviewed-by: Joonas Lahtinen Acked-by: Ingo Molnar Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180504203252.28048-1-paulo.r.zanoni@intel.com commit 6b4c1360e8adc2cbecf400b97c1ffcf9c5aad31e Author: Michael Ellerman Date: Tue Jul 10 12:08:36 2018 +1000 Documentation: Add powerpc options for spec_store_bypass_disable Document the support for spec_store_bypass_disable that was added for powerpc in commit a048a07d7f45 ("powerpc/64s: Add support for a store forwarding barrier at kernel entry/exit"). Signed-off-by: Michael Ellerman Reviewed-by: Kees Cook Acked-by: Thomas Gleixner Signed-off-by: Jonathan Corbet commit 9ac8c3bd50018c80ad413bff00f054496998cc0d Author: Yohan Pipereau Date: Sun Jul 8 20:19:32 2018 +0200 Documentation : Update relay function types This patch updates two callback functions provided as an example in relay API documentation : subbuf_start and create_buf_file_handler. These functions were using older and incorrect types causing an "initialization from incompatible pointer type". Signed-off-by: Yohan Pipereau Signed-off-by: Jonathan Corbet commit 7cbb540a3a68e4d4a8bef2d9451afb1635b5d2d3 Author: Sibi Sankar Date: Mon Jul 9 20:42:20 2018 +0530 remoteproc: qcom: q6v5-pil: fix modem hang on SDM845 after axis2 clk unvote GCC_MSS_AXIS2 clock is used for disabling boot IMEM (a part of AP boot up). With Boot IMEM disable now a part TZ/ATF, AXIS2 clock is no longer required post AP boot up and expected to remain untouched. However if the clock is turned ON after Q6 is brought out of reset and later turned off, it results in modem hang. When Q6 attempts a power collapse the internal handshaking to check if AXIS2 is idle never goes through since it is turned off preventing the RSC from getting triggered, leaving modem in a funky state. Hence removing AXIS2 clk enable/disable from the driver. Reported-by: Bjorn Andersson Signed-off-by: Sibi Sankar Signed-off-by: Bjorn Andersson commit 819d731fe3562783d5697f3269f7d15384b38f4c Author: Laurentiu Tudor Date: Thu Jul 5 16:31:42 2018 +0300 docs: kernel-parameters.txt: document xhci-hcd.quirks parameter This parameter introduced several years ago in the XHCI host controller driver was somehow left undocumented. Add a few lines in the kernel parameters text. Signed-off-by: Laurentiu Tudor Signed-off-by: Jonathan Corbet commit ded79d06986e62da1376ae1a62627a36ecbf9ee6 Author: Arnd Bergmann Date: Fri Jul 6 14:57:53 2018 +0200 remoteproc: qcom q6v5: fix modular build The new driver only works as built-in code at the moment but fails with a link error when configured as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/remoteproc/qcom_q6v5.o see include/linux/module.h for more information ERROR: "qcom_q6v5_init" [drivers/remoteproc/qcom_q6v5_pil.ko] undefined! ERROR: "qcom_q6v5_wait_for_start" [drivers/remoteproc/qcom_q6v5_pil.ko] undefined! ERROR: "qcom_q6v5_prepare" [drivers/remoteproc/qcom_q6v5_pil.ko] undefined! ERROR: "qcom_q6v5_unprepare" [drivers/remoteproc/qcom_q6v5_pil.ko] undefined! ERROR: "qcom_q6v5_request_stop" [drivers/remoteproc/qcom_q6v5_pil.ko] undefined! ERROR: "qcom_q6v5_init" [drivers/remoteproc/qcom_adsp_pil.ko] undefined! ERROR: "qcom_q6v5_wait_for_start" [drivers/remoteproc/qcom_adsp_pil.ko] undefined! ERROR: "qcom_q6v5_prepare" [drivers/remoteproc/qcom_adsp_pil.ko] undefined! ERROR: "qcom_q6v5_unprepare" [drivers/remoteproc/qcom_adsp_pil.ko] undefined! ERROR: "qcom_q6v5_request_stop" [drivers/remoteproc/qcom_adsp_pil.ko] undefined! This exports the internal symbols as needed and adds the MODULE_LICENSE() and MODULE_DESCRIPTION() tags. I could not figure out the author, so I did not add a MODULE_AUTHOR() tag for now. Fixes: 3b415c8fb263 ("remoteproc: q6v5: Extract common resource handling") Signed-off-by: Arnd Bergmann Signed-off-by: Bjorn Andersson commit 8dd99871f7acb776521b35a6107d3dd22f1522b8 Author: Matthew Wilcox Date: Tue Jul 3 12:43:54 2018 -0700 reed_solomon: Fix kernel-doc The current doc build warns: ./lib/reed_solomon/reed_solomon.c:287: WARNING: Unknown target name: "gfp". This is because it misinterprets the "GFP_" that is part of the description. Change the description to avoid the problem. Signed-off-by: Matthew Wilcox Acked-by: Kees Cook Signed-off-by: Jonathan Corbet commit b061c7a513afe14a68af41cec7c3476befc40e95 Author: Miroslav Lichvar Date: Mon Jun 4 15:34:21 2018 +0200 timekeeping: Update multiplier when NTP frequency is set directly When the NTP frequency is set directly from userspace using the ADJ_FREQUENCY or ADJ_TICK timex mode, immediately update the timekeeper's multiplier instead of waiting for the next tick. This removes a hidden non-deterministic delay in setting of the frequency and allows an extremely tight control of the system clock with update rates close to or even exceeding the kernel HZ. The update is limited to archs using modern timekeeping (!ARCH_USES_GETTIMEOFFSET). Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Signed-off-by: Miroslav Lichvar Signed-off-by: John Stultz commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f Author: John Stultz Date: Tue May 29 19:12:18 2018 -0700 selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress In the past we've warned when ADJ_OFFSET was in progress, usually caused by ntpd or some other time adjusting daemon running in non steady sate, which can cause the skew calculations to be incorrect. Thus, this patch checks to see if the clock was being adjusted when we fail so that we don't cause false negatives. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Suggested-by: Miroslav Lichvar Signed-off-by: John Stultz --- v2: Widened the checks to look for other clock adjustments that could happen, as suggested by Miroslav v3: Fixed up commit message commit 0d7f824b3342c774ea18062f5f0f39d542947c34 Author: kbuild test robot Date: Wed Jul 11 01:11:08 2018 +0800 drm/amd/pp: fix semicolon.cocci warnings drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c:1209:17-18: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: ea870e44415a ("drm/amd/pp: Export notify_smu_enable_pwe to display") CC: Rex Zhu Signed-off-by: kbuild test robot Signed-off-by: Alex Deucher commit c1ee15b39fedbeb856cb5867762dd3f3fb779611 Author: Leo Liu Date: Wed Jul 4 13:35:56 2018 -0400 drm/amdgpu: get VCN start to process in the dpm disabled case Fixes: 22cc6c5e19 (drm/amdgpu: Add runtime VCN PG support) Signed-off-by: Leo Liu Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d02f16058e661608566e444e1a433db8b0a32c0b Author: Leo Liu Date: Wed Jul 4 13:43:38 2018 -0400 drm/amdgpu: move cache window setup after power and clock resume To make register read/write reliable Signed-off-by: Leo Liu Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 7b4e54a9729d0a57cf036af801aa1e78ef315982 Author: Leo Liu Date: Mon Jul 9 11:59:01 2018 -0400 drm/amdgpu: Take VCN jpeg ring into account in idle work handler VCN won't get power off when only jpeg active Signed-off-by: Leo Liu Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f44907593d746d42821543992b7c7085d2cbeafb Author: Thomas Zimmermann Date: Thu Jun 21 15:21:37 2018 +0200 drm/ttm: Replace ttm_bo_unref() with ttm_bo_put() A call to ttm_bo_unref() clears the supplied pointer to NULL, while ttm_bo_put() does not. None of the converted call sites requires the pointer to become NULL, so the respective assign operations has been left out from the patch. Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8129fdad387ae3cf6373d74a6afb5372bf773cbd Author: Thomas Zimmermann Date: Thu Jun 21 15:21:36 2018 +0200 drm/ttm: Replace ttm_bo_reference() with ttm_bo_get() Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 89c815ef07a1db0ac2cc09d06cb2d5c3d86d6322 Author: Thomas Zimmermann Date: Thu Jun 21 15:21:35 2018 +0200 drm/ttm: Introduce ttm_bo_get() and ttm_bo_put() for ref counting The TTM buffer-object interface provides ttm_bo_reference() and ttm_bo_unref() for managing reference counts. Replacing them with ttm_bo_get() and ttm_bo_put() aligns the API with conventions used throughout the Linux kernel. The implementation of ttm_bo_unref() clears the supplied pointer to NULL. This leads to workarounds where the caller saves the pointer's value before de-referencing the BO. ttm_bo_put() does not clear the supplied pointer. Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 31e1c59796c8abeba8bbb961bc329a6aa5f5847c Author: Gustavo A. R. Silva Date: Mon Jul 9 10:24:47 2018 -0500 drm/ttm: use swap macro in ttm_bo_handle_move_mem Make use of the swap macro and remove unnecessary variable *tmp_mem*. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c3cb424a086921f6bb0449b10d998352a756d6d5 Author: Harry Wentland Date: Mon Jul 9 13:48:12 2018 -0400 drm/amd/pp: Send khz clock values to DC for smu7/8 The previous change wasn't covering smu 7 and 8 and therefore DC was seeing wrong clock values. This fixes an issue where the pipes seem to hang with a 4k DP and 1080p HDMI display. Fixes: c3df50abc84b ("drm/amd/pp: Convert clock unit to KHz as defined") Signed-off-by: Harry Wentland Acked-by: Alex Deucher Cc:rex.zhu@amd.com Signed-off-by: Alex Deucher commit e85115786ae1bdcfd86da759928a2b644204d42a Author: Andrey Grodzovsky Date: Thu Jul 5 14:49:34 2018 -0400 drm/amdgpu: Verify root PD is mapped into kernel address space (v4) Problem: When PD/PT update made by CPU root PD was not yet mapped causing page fault. Fix: Verify root PD is mapped into CPU address space. v2: Make sure that we add the root PD to the relocated list since then it's get mapped into CPU address space bt default in amdgpu_vm_update_directories. v3: Drop change to not move kernel type BOs to evicted list. v4: Remove redundant bo move to relocated list. Link: https://bugs.freedesktop.org/show_bug.cgi?id=107065 Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Reviewed-by: Junwei Zhang Signed-off-by: Alex Deucher commit efaa96463929684ceca4be96d0959e9ced1fa093 Author: Andrey Grodzovsky Date: Thu Jun 28 22:55:27 2018 -0400 drm/amdgpu: Present amdgpu_task_info in VM_FAULTS. Extract and present the reposnsible process and thread when VM_FAULT happens. v2: Use getter and setter functions. Signed-off-by: Andrey Grodzovsky Acked-by: Jim Qu Signed-off-by: Alex Deucher commit 2aa37bf58838fd0251e0e6819767ffc8a83eac38 Author: Andrey Grodzovsky Date: Thu Jun 28 22:51:32 2018 -0400 drm/amdgpu: Add support for logging process info in amdgpu_vm. Add process and thread names and pids and a function to extract this info from relevant amdgpu_vm. v2: Add documentation and fix identation. v3: Add getter and setter functions for amdgpu_task_info. Signed-off-by: Andrey Grodzovsky Acked-by: Jim Qu Signed-off-by: Alex Deucher commit bd4e725084189a198ca47d369d85100216d29b7e Author: Harry Wentland Date: Fri Jul 6 09:49:05 2018 -0400 drm/amd/display: Make function pointer structs const const to avoid hard-to-find bugs where some function overrides a function pointer. Signed-off-by: Harry Wentland Reviewed-by: Christian König Signed-off-by: Alex Deucher commit a14cc8422a2601348bc5279c1d849920e91170f2 Author: Christian König Date: Fri Jul 6 14:19:07 2018 +0200 drm/amd/display: make function tables const It is good practice to make global function tables const to avoid accidental override. Signed-off-by: Christian König Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 10e7fddd4aebf95a9468f20fc1a87e6238b7d8d4 Author: Christian König Date: Fri Jul 6 13:46:05 2018 +0200 drm/amd/display: fix invalid function table override Otherwise we try to program hardware with the wrong watermark functions when multiple DCE generations are installed in one system. Signed-off-by: Christian König Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit ed0926647daf855abd605525a123eb11a62f5498 Author: Rex Zhu Date: Thu Jul 5 16:45:21 2018 +0800 drm/amd/pp: Convert 10KHz to KHz as variable name The default clock unit in powerplay is 10KHz. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 73b1917454b3639ac1926c869f51e0dc20a0d22f Author: Rex Zhu Date: Thu Jul 5 16:34:13 2018 +0800 drm/amdgpu: Add CLK IP base offset so we can read/write the registers in CLK domain through RREG32/WREG32_SOC15 Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 02374bbd3bfa38cc6922fe56736716308c48f538 Author: Michel Dänzer Date: Mon Jun 25 11:07:17 2018 +0200 drm/amdgpu: Reserve VM root shared fence slot for command submission (v3) Without this, there could not be enough slots, which could trigger the BUG_ON in reservation_object_add_shared_fence. v2: * Jump to the error label instead of returning directly (Jerry Zhang) v3: * Reserve slots for command submission after VM updates (Christian König) Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/106418 Reported-by: mikhail.v.gavrilov@gmail.com Signed-off-by: Michel Dänzer Signed-off-by: Junwei Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit dc407ee0bda07e1e992ed7c93c1faef13a1125bd Author: Junwei Zhang Date: Tue Jun 26 16:23:48 2018 +0800 drm/amdgpu: fix kmap error handling for bo creations kmap happens after bo pin, so unpin is required on error Signed-off-by: Junwei Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit bb812f1ea87dd7a4f336242212219268393ed308 Author: Junwei Zhang Date: Mon Jun 25 13:32:24 2018 +0800 drm/amdgpu: allocate gart memory when it's required (v3) Instead of calling gart address space on every bo pin, allocates it on demand v2: fix error handling v3: drop the change on amdgpu_amdkfd_gpuvm.c, not needed. Signed-off-by: Junwei Zhang Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 7b7c6c81b3a370b46b0c48f4ab7ac3be83237a12 Author: Junwei Zhang Date: Mon Jun 25 12:51:14 2018 +0800 drm/amdgpu: separate gpu address from bo pin It could be got by amdgpu_bo_gpu_offset() if need Signed-off-by: Junwei Zhang Reviewed-by: Michel Dänzer Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 88b7210c81096c018f5836aff4749743c0d34623 Author: Arnd Bergmann Date: Tue Jul 10 17:21:34 2018 +0200 block: iolatency: avoid 64-bit division On 32-bit architectures, dividing a 64-bit number needs to use the do_div() function or something like it to avoid a link failure: block/blk-iolatency.o: In function `iolatency_prfill_limit': blk-iolatency.c:(.text+0x8cc): undefined reference to `__aeabi_uldivmod' Using div_u64() gives us the best output and avoids the need for an explicit cast. Fixes: d70675121546 ("block: introduce blk-iolatency io controller") Reviewed-by: Josef Bacik Signed-off-by: Arnd Bergmann Signed-off-by: Jens Axboe commit ddba595b7b24ac17d553814d9d525fe4472c89e6 Author: Serge Semin Date: Mon Jul 9 16:57:13 2018 +0300 mips: mm: Discard ioremap_uncached_accelerated() method Adaptive ioremap_wc() method is now available as of commit 9748e33e26c6 ("mips: mm: Create UCA-based ioremap_wc() method"). We can use it to obtain UnCached Accelerated (UCA) mappings safely on all MIPS systems, and so we don't need the MIPS-specific ioremap_uncached_accelerated() any longer. This macro hard-coded the UCA Cache Coherency Attribute (CCA) in a manner that isn't safe for kernels that may run on different CPUs, and it is also entirely unused so we can trivially remove it. [paul.burton@mips.com: - Reword the commit message a little. - Remove CC stable.] Signed-off-by: Serge Semin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19790/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: okaya@codeaurora.org Cc: chenhc@lemote.com Cc: Sergey.Semin@t-platforms.ru Cc: linux-kernel@vger.kernel.org commit 528922afd41cdd1da6a4b33e2c82e38c1746561c Author: Yishai Hadas Date: Sun Jul 8 13:24:39 2018 +0300 IB: Enable uverbs_destroy_def_handler to be used by drivers Enable uverbs_destroy_def_handler to be used by drivers and replace current code to use it. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9748e33e26c65d84a0fb09df93c963d023f90a3f Author: Serge Semin Date: Mon Jul 9 16:57:12 2018 +0300 mips: mm: Create UCA-based ioremap_wc() method Modern MIPS cores (like P5600/6600, M5150/6520, end so on) which got L2-cache on chip also can enable a special type Cache-Coherency attribute (CCA) named UnCached Accelerated attribute (UCA). In this way uncached accelerated accesses are treated the same way as non-accelerated uncached accesses, but uncached stores are gathered together for more efficient bus utilization. So to speak this CCA enables uncached transactions to better utilize bus bandwidth via burst transactions. This is exactly why ioremap_wc() method has been introduced in Linux. Alas MIPS-platform code hasn't implemented it so far, instead default one has been used which was an alias to ioremap_nocache. In order to fix this we added MIPS-specific ioremap_wc() macro substituted by generic __ioremap_mode() method call with writecombine CPU-info field passed. It shall create real ioremap_wc() method if CPU-cache supports UCA feature and fall-back to _CACHE_UNCACHED attribute if one doesn't. Additionally platform-specific io.h shall declare ARCH_HAS_IOREMAP_WC macro as indication of architectural definition of ioremap_wc() (similar to x86/powerpc). [paul.burton@mips.com: - Remove CC stable, this is new functionality.] Signed-off-by: Serge Semin Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19789/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: okaya@codeaurora.org Cc: chenhc@lemote.com Cc: Sergey.Semin@t-platforms.ru Cc: linux-kernel@vger.kernel.org commit caed9d636e857997e923dfe473b9310de645d916 Author: Hans de Goede Date: Thu Jul 5 00:59:35 2018 +0200 ASoC: Intel: bytcr_rt5651: Reporting button presses Enable reporting of button presses now that the codec driver recently has gotten support for this. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit b91f432cbc3326f715b8c3f02ff4066ab398833f Author: Hans de Goede Date: Thu Jul 5 00:59:34 2018 +0200 ASoC: Intel: bytcr_rt5651: Disable jack-detect over suspend/resume Disable jack-detection and thus the codec IRQ over suspend/resume. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit df1569f2006b157caa944367d0d431eb4ea08624 Author: Hans de Goede Date: Thu Jul 5 00:59:33 2018 +0200 ASoC: rt5651: Add button press support Enable button press detection for headsets by using the ovcd IRQ to get notified of button presses. This is modelled after (almost exactly copied from) the button press code for the rt5640 which has identical ovcd hardware. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown commit 34c906ddacd237511808fb2bbd941e6b91e9095a Author: Hans de Goede Date: Thu Jul 5 00:59:32 2018 +0200 ASoC: rt5651: Allow disabling jack-detect by calling set_jack(NULL) Allow the machine driver to disable jack-detect over a suspend/resume by calling snd_soc_component_set_jack(NULL). Note this renames rt5651_set_jack, where all the jack-enable work was done to rt5651_enable_jack_detect. This function can now no longer fail as it does not request the IRQ anymore. It can still be passed an invalid jack source, but that should never happen, so this is now logged and treated as no jack source. Cc: Carlo Caione Signed-off-by: Hans de Goede Signed-off-by: Mark Brown commit 8d2d7bcdc1645dc243f7735278675b083c0e506c Author: Hans de Goede Date: Thu Jul 5 00:59:31 2018 +0200 ASoC: rt5651: Fix workqueue cancel vs irq free race on remove On removal we must free the IRQ *before* cancelling the jack-detect work, so that the jack-detect work cannot be rescheduled by the IRQ. Before this commit we were cancelling the jack-detect work from the driver remove callback, while relying on devm to free the IRQ, which happens after the remove callback. This is the wrong order. This commit uses a devm-action to register a devm callback which cancels the work, before requesting the IRQ (devm tears things down in reverse order). This also allows us to remove the now empty remove driver callback. Cc: Carlo Caione Signed-off-by: Hans de Goede Signed-off-by: Mark Brown commit 5f6fb23d2e114506ddb8437a3e65f4a20d081013 Author: Hans de Goede Date: Sun Jul 1 20:36:31 2018 +0200 ASoC: Intel: bytcr_rt5651: Add support for externar amplifier enable GPIO The rt5651 does not have a built-in speaker amplifier, so it is often used together with an external amplifier. On Cherry Trail boards this external amplifier's enable pin is driven through a GPIO, which is given as the first GPIO in the ACPI resources of the codec fwnode. This commit adds support to the bytcr_rt5651 for this GPIO, fixing the speaker not working on CHT devices with a rt5651 codec. Cc: Carlo Caione Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 2c375204bfad2f481feb006a82cdb67cc570b670 Author: Hans de Goede Date: Sun Jul 1 20:36:30 2018 +0200 ASoC: Intel: bytcr_rt5651: Move getting of codec_dev into probe() Move the getting of the codec_dev, to add device-props to it, out of byt_rt5651_add_codec_device_props() and into its caller, snd_byt_rt5651_mc_probe(). This is a preparation patch for adding support for an external amplifier enable GPIO, which requires further accesses to the codec_dev. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit fbea16dbc0a31484811c5f335ae344b2bbc66f40 Author: Hans de Goede Date: Sun Jul 1 20:36:29 2018 +0200 ASoC: Intel: bytcr_rt5651: Remove is_valleyview helper Remove is_valleyview helper, this is not necessary, we can simply call x86_match_cpu() directly instead. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 81583afe790c5bd86300537783b23f3b12794f03 Author: Hans de Goede Date: Sat Jul 7 12:22:10 2018 +0200 ASoC: Intel: bytcr_rt5640: Add quirk for the Lenovo Miix2 8 tablet Add a quirk for the Lenovo Miix2 8 tablet, this tablet uses a digital mic on DMIC1 and has a mono-speaker. The jack-detect uses the default settings.. Reported-and-tested-by: russianneuromancer@ya.ru Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 54501ac150fed82b256e6a9bd4e2201bc3b21b22 Author: Arnd Bergmann Date: Tue Jul 10 17:16:27 2018 +0200 arm64: make flatmem depend on !NUMA Building without NUMA but with FLATMEM results in a link error because mem_map[] is not available: aarch64-linux-ld -EB -maarch64elfb --no-undefined -X -pie -shared -Bsymbolic --no-apply-dynamic-relocs --build-id -o .tmp_vmlinux1 -T ./arch/arm64/kernel/vmlinux.lds --whole-archive built-in.a --no-whole-archive --start-group arch/arm64/lib/lib.a lib/lib.a --end-group init/do_mounts.o: In function `mount_block_root': do_mounts.c:(.init.text+0x1e8): undefined reference to `mem_map' arch/arm64/kernel/vdso.o: In function `vdso_init': vdso.c:(.init.text+0xb4): undefined reference to `mem_map' This uses the same trick as the other architectures, making flatmem depend on !NUMA to avoid the broken configuration. Fixes: e7d4bac428ed ("arm64: add ARM64-specific support for flatmem") Signed-off-by: Arnd Bergmann Signed-off-by: Will Deacon commit c13207905340d85eaddd85b6d2868218f324b180 Author: Suzuki K Poulose Date: Tue Jul 10 09:58:04 2018 +0100 arm64: perf: Add support for chaining event counters Add support for 64bit event by using chained event counters and 64bit cycle counters. PMUv3 allows chaining a pair of adjacent 32-bit counters, effectively forming a 64-bit counter. The low/even counter is programmed to count the event of interest, and the high/odd counter is programmed to count the CHAIN event, taken when the low/even counter overflows. For CPU cycles, when 64bit mode is requested, the cycle counter is used in 64bit mode. If the cycle counter is not available, falls back to chaining. Cc: Will Deacon Acked-by: Mark Rutland Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 3cce50dfec4a5b0414c974190940f47dd32c6dee Author: Suzuki K Poulose Date: Tue Jul 10 09:58:03 2018 +0100 arm64: perf: Disable PMU while processing counter overflows The arm64 PMU updates the event counters and reprograms the counters in the overflow IRQ handler without disabling the PMU. This could potentially cause skews in for group counters, where the overflowed counters may potentially loose some event counts, while they are reprogrammed. To prevent this, disable the PMU while we process the counter overflows and enable it right back when we are done. This patch also moves the PMU stop/start routines to avoid a forward declaration. Suggested-by: Mark Rutland Cc: Will Deacon Acked-by: Mark Rutland Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 0c55d19c1659d3fc38dcecca8bdaf6eabda39a9d Author: Suzuki K Poulose Date: Tue Jul 10 09:58:02 2018 +0100 arm64: perf: Clean up armv8pmu_select_counter armv8pmu_select_counter always returns the passed idx. So let us make that void and get rid of the pointless checks. Suggested-by: Mark Rutland Cc: Will Deacon Acked-by: Mark Rutland Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 7dfc8db1d117ae08c649266d5459ac8b10800d6e Author: Suzuki K Poulose Date: Tue Jul 10 09:58:01 2018 +0100 arm_pmu: Tidy up clear_event_idx call backs The armpmu uses get_event_idx callback to allocate an event counter for a given event, which marks the selected counter as "used". Now, when we delete the counter, the arm_pmu goes ahead and clears the "used" bit and then invokes the "clear_event_idx" call back, which kind of splits the job between the core code and the backend. To keep things tidy, mandate the implementation of clear_event_idx() and add it for exisiting backends. This will be useful for adding the chained event support, where we leave the event idx maintenance to the backend. Also, when an event is removed from the PMU, reset the hw.idx to indicate that a counter is not allocated for this event, to help the backends do better checks. This will be also used for the chain counter support. Cc: Will Deacon Cc: Mark Rutland Reviewed-by: Julien Thierry Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit e2da97d328d4951d25f6634eda7213f7257417b6 Author: Suzuki K Poulose Date: Tue Jul 10 09:58:00 2018 +0100 arm_pmu: Add support for 64bit event counters Each PMU has a set of 32bit event counters. But in some special cases, the events could be counted using counters which are effectively 64bit wide. e.g, Arm V8 PMUv3 has a 64 bit cycle counter which can count only the CPU cycles. Also, the PMU can chain the event counters to effectively count as a 64bit counter. Add support for tracking the events that uses 64bit counters. This only affects the periods set for each counter in the core driver. Cc: Will Deacon Reviewed-by: Julien Thierry Acked-by: Mark Rutland Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 3a95200d3f89afd8b67f39d88d36cc7ec96ce385 Author: Suzuki K Poulose Date: Tue Jul 10 09:57:59 2018 +0100 arm_pmu: Change API to support 64bit counter values Convert the {read/write}_counter APIs to handle 64bit values to enable supporting chained event counters. The backends still use 32bit values and we pass them 32bit values only. So in effect there are no functional changes. Cc: Will Deacon Acked-by: Mark Rutland Reviewed-by: Julien Thierry Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 8d3e994241e6bcc7ead2b918c4f15b7683afa90a Author: Suzuki K Poulose Date: Tue Jul 10 09:57:58 2018 +0100 arm_pmu: Clean up maximum period handling Each PMU defines their max_period of the counter as the maximum value that can be counted. Since all the PMU backends support 32bit counters by default, let us remove the redundant field. No functional changes. Cc: Will Deacon Acked-by: Mark Rutland Reviewed-by: Julien Thierry Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 781a4016be54ac36b22eac2e84c7fe4cafd3492a Author: Jan Dakinevich Date: Mon Jul 9 16:51:08 2018 +0300 ib_srpt: use kvmalloc to allocate ring pointers An array of pointers to SRPT contexts in ib_device is over 30KiB even in default case, in which an amount of contexts is 4095. The patch is intended to weed out large contigous allocation for non-DMA memory. Signed-off-by: Jan Dakinevich Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 8942acea3723ff9424dc89350d2ab6e969fdd093 Author: Artemy Kovalyov Date: Wed Jul 4 15:57:51 2018 +0300 IB/uverbs: Pass IB_UVERBS_QPF_GRH_REQUIRED to user space Userspace also needs to know if the port requires GRHs to properly form the AVs it creates. Signed-off-by: Artemy Kovalyov Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit b02289b3d60f79ba0831051a7743d8fdb4110355 Author: Artemy Kovalyov Date: Wed Jul 4 15:57:50 2018 +0300 RDMA: Validate grh_required when handling AVs Extend the existing grh_required flag to check when AV's are handled that a GRH is present. Since we don't want to do query_port during the AV checks for performance reasons move the flag into the immutable_data. Signed-off-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 958200ad8e838bef3b36f9b0674923172b8d9da5 Author: Jason Gunthorpe Date: Wed Jul 4 15:57:49 2018 +0300 RDMA/hfi1: Move grh_required into update_sm_ah grh_required is intended to be a global setting where all AV's will require a GRH, not just the sm_lid. Move the special logic to the creation of the SM AH. Signed-off-by: Jason Gunthorpe Signed-off-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky commit 2f944c0fbf58b1f390e5e61affd98ba0061214c6 Author: Jason Gunthorpe Date: Wed Jul 4 15:57:48 2018 +0300 RDMA: Fix storage of PortInfo CapabilityMask in the kernel The internal flag IP_BASED_GIDS was added to a field that was being used to hold the port Info CapabilityMask without considering the effects this will have. Since most drivers just use the value from the HW MAD it means IP_BASED_GIDS will also become set on any HW that sets the IBA flag IsOtherLocalChangesNoticeSupported - which is not intended. Fix this by keeping port_cap_flags only for the IBA CapabilityMask value and store unrelated flags externally. Move the bit definitions for this to ib_mad.h to make it clear what is happening. To keep the uAPI unchanged define a new set of flags in the uapi header that are only used by ib_uverbs_query_port_resp.port_cap_flags which match the current flags supported in rdma-core, and the values exposed by the current kernel. Fixes: b4a26a27287a ("IB: Report using RoCE IP based gids in port caps") Signed-off-by: Jason Gunthorpe Signed-off-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky commit b6d83fccd877221416658fbdb59ba4d1628ba800 Author: Thierry Reding Date: Tue Jul 10 12:51:38 2018 +0200 drm/panel: p079zca: Use of_device_get_match_data() Use this helper to get rid of some extra boilerplate code. Reviewed-by: Heiko Stuebner Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180710110127.12315-1-thierry.reding@gmail.com commit cd0e0ca69109d025b1a1b6609f70682db62138b0 Author: Dan Carpenter Date: Wed Jul 4 12:38:09 2018 +0300 drm/panel: type promotion bug in s6e8aa0_read_mtp_id() The ARRAY_SIZE() macro is type size_t. If s6e8aa0_dcs_read() returns a negative error code, then "ret < ARRAY_SIZE(id)" is false because the negative error code is type promoted to a high positive value. Fixes: 02051ca06371 ("drm/panel: add S6E8AA0 driver") Signed-off-by: Dan Carpenter Reviewed-by: Andrzej Hajda Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180704093807.s3lqsb2v6dg2k43d@kili.mountain commit ebc950fdff6d5f9250cd5a5a348af97f7d8508df Author: Nickey Yang Date: Mon Jul 2 12:32:28 2018 +0200 dt-bindings: Add KINGDISPLAY KD097D04 panel bindings The KINGDISPLAY KD097D04 is a 9.7" panel with a 1536x2048 resolution and connected to DSI using 8 lanes. Signed-off-by: Nickey Yang Acked-by: Rob Herring Signed-off-by: Heiko Stuebner Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180702103229.3952-3-heiko@sntech.de commit 2bb7a39c1581a22efd6a6f21bbce9d5575ce9224 Author: Nickey Yang Date: Mon Jul 2 12:32:27 2018 +0200 dt-bindings: Add vendor prefix for kingdisplay Kingdisplay Technology Co., Ltd, established in China Shenzhen in 2006, is a national high-tech enterprise specializing in the R&D, manufacturing and marketing of TFT-LCM and touch panel. Signed-off-by: Nickey Yang Acked-by: Rob Herring Signed-off-by: Heiko Stuebner Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180702103229.3952-2-heiko@sntech.de commit de04a462fdcee724462bd656c13d461fba5ece51 Author: Lin Huang Date: Mon Jul 2 12:27:21 2018 +0200 drm/panel: p079zca: Support Innolux P097PFG panel Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel, it reuse the Innolux P079ZCA panel driver. Changes in v2: - None Changes in v3: - None Changes in v4: - None Changes in v5: - Document source of init-commands - 4 lanes per DSI interface Signed-off-by: Lin Huang Signed-off-by: Heiko Stuebner Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180702102721.3546-5-heiko@sntech.de commit 731edd4ce5d3fb477c808e2fc16f398c9ff3576b Author: Lin Huang Date: Mon Jul 2 12:27:20 2018 +0200 dt-bindings: Add Innolux P097PFG panel bindings The Innolux P097PFG panel is 9.7" panel with 1536X2048 resolution, it reuse P079ZCA panel driver, so improve p079ZCA dt-binding to support P097PFG. Changes in v2: - None Changes in v3: - None Changes in v4: - None Changes in v5: - use separate file for binding - keep power supplies as required Signed-off-by: Lin Huang Signed-off-by: Heiko Stuebner Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180702102721.3546-4-heiko@sntech.de commit 48bd379aa23d0d6249490137e5ebe7f8aeeb887d Author: Lin Huang Date: Mon Jul 2 12:27:19 2018 +0200 drm/panel: p079zca: Add variable unprepare_delay properties When panel power down, p079zca need delay between reset and disable power supply, but p097pfg does not need it. Similarly p097zca needs a delay after entering panel sleep mode. So add two delay properties, so we can meet these two panel power down sequence. Signed-off-by: Lin Huang [add sleep-mode delay] Signed-off-by: Heiko Stuebner Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180702102721.3546-3-heiko@sntech.de commit 7ad4e4636c54dcfbcaf43c8737af3c294ed17d11 Author: Lin Huang Date: Mon Jul 2 12:27:18 2018 +0200 drm/panel: p079zca: Refactor panel driver to support multiple panels Refactor Innolux P079ZCA panel driver, let it support multi panels from Innolux that share similar power sequences. Panels may require different power supplies so use regulator bulk interfaces and define per panel supply-names. Changes in v2: - Change regulator property name to meet the panel datasheet Changes in v3: - this patch only refactor P079ZCA panel to support multi panel, support P097PFG panel in another patch Changes in v4: - Modify the patch which suggest by Thierry Changes in v5: - use regulator_bulk to handle different supply number Signed-off-by: Lin Huang Signed-off-by: Heiko Stuebner Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180702102721.3546-2-heiko@sntech.de commit 3d5664f95ebe264c16f3ebfadce9eee6fee9acf7 Author: Colin Ian King Date: Tue Jun 26 17:03:54 2018 +0100 drm/panel: ili9881c: Fix missing assignment to error return ret Currently, ret is being checked for an error condition however it is not being assigned in the previous statement on the call of function mipi_dsi_dcs_exit_sleep_mode. Add in the missing assignment of ret. Detected by CoverityScan, CID#1470174, 1470178 ("Unchecked return value") Fixes: 26aec25593c2 ("drm/panel: Add Ilitek ILI9881c panel driver") Signed-off-by: Colin Ian King Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180626160354.1363-1-colin.king@canonical.com commit 97ceb1fb08b6a2f78aa44a7c229ca280964860c0 Author: Michal Vokáč Date: Mon Jun 25 14:41:30 2018 +0200 drm/panel: simple: Add support for DataImage SCF0700C48GGU18 This adds support for the DataImage SCF0700C48GGU18 7.0" WVGA (800x480) TFT LCD panel. The panel has 24-bit parallel interface and can be supported by the simple panel driver. Signed-off-by: Michal Vokáč Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/1529930490-11874-2-git-send-email-michal.vokac@ysoft.com commit 03fa9aa384940b006cabb03fe25a073f394f60d1 Author: Michal Vokáč Date: Mon Jun 25 14:41:29 2018 +0200 dt-bindings: Add DataImage, Inc. vendor prefix DataImage is a Taiwan-based manufacturer of LCD panels. Signed-off-by: Michal Vokáč Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/1529930490-11874-1-git-send-email-michal.vokac@ysoft.com commit a5d2ade627dcaa825707e20da6994e79c95e2434 Author: Christoph Fritz Date: Mon Jun 4 13:16:48 2018 +0200 drm/panel: simple: Add support for Innolux G070Y2-L01 This patch adds support for Innolux G070Y2-L01 7" WVGA (800x480) TFT LCD panel. Signed-off-by: Christoph Fritz Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/1528111008.2818.20.camel@googlemail.com commit 3b39ad7a553f3ecdf16374973e4b0971b861769d Author: Tomi Valkeinen Date: Mon Jun 18 16:22:40 2018 +0300 drm/panel: simple: Add newhaven, nhd-4.3-480272ef-atxl LCD Add support for newhaven,nhd-4.3-480272ef-atxl to panel-simple. Signed-off-by: Tomi Valkeinen Cc: Thierry Reding Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180618132242.8673-8-tomi.valkeinen@ti.com commit 955f60db0f2b87094f64df3d7f608fdac4a6ebb1 Author: Peter Ujfalusi Date: Mon Jun 18 16:22:34 2018 +0300 drm: Add support for extracting sync signal drive edge from videomode The sync in some panels needs to be driven by different edge of the pixel clock compared to data. This is reflected by the DISPLAY_FLAGS_SYNC_(POS|NEG)EDGE in videmode flags. Add similar similar definitions for bus_flags and convert the sync drive edge via drm_bus_flags_from_videomode(). Signed-off-by: Peter Ujfalusi Signed-off-by: Tomi Valkeinen Signed-off-by: Jyri Sarha Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180618132242.8673-2-tomi.valkeinen@ti.com commit ae8cf41b6a5e3a0847cf5ef9bf6feb82e75ab5eb Author: Andrzej Hajda Date: Tue Jun 19 10:19:26 2018 +0200 drm/panel: simple: Add support for BOE HV070WSA-100 panel to simple-panel The patch adds support for BOE HV070WSA-100 WSVGA 7.01 inch panel to the panel-simple driver. The panel is used in Exynos5250-arndale boards. Signed-off-by: Andrzej Hajda Signed-off-by: Maciej Purski Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/1529396370-18761-6-git-send-email-m.purski@samsung.com commit b0b7aa407e929b8e25a2982bff428eacd50f1630 Author: Andrzej Hajda Date: Tue Jun 19 10:19:25 2018 +0200 dt-bindings: display: Add DT bindings for BOE HV070WSA-100 panel The patch adds bindings to BOE HV070-WSA WSVGA panel. Bindings are compatible with simple panel bindings. Signed-off-by: Andrzej Hajda Signed-off-by: Maciej Purski Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/1529396370-18761-5-git-send-email-m.purski@samsung.com commit 1b9883eae82251b742627ebd9d544d1b1bddf121 Author: Boris Brezillon Date: Wed May 9 15:00:42 2018 +0200 drm/vc4: Support the case where the DSI device is disabled Having a device with a status property != "okay" in the DT is a valid use case, and we should not prevent the registration of the DRM device when the DSI device connected to the DSI controller is disabled. Consider the ENODEV return code as a valid result and do not expose the DSI encoder/connector when it happens. Signed-off-by: Boris Brezillon Reviewed-by: Eric Anholt Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180509130042.9435-5-boris.brezillon@bootlin.com commit 2e64a174179a144742fa70f09803a012aceca476 Author: Boris Brezillon Date: Wed May 9 15:00:41 2018 +0200 drm/of: Make drm_of_find_panel_or_bridge() fail when the device is disabled There's no point searching for a drm_bridge or drm_panel if the OF node we're pointing has a status property that is not "okay" or "ok". Just return -ENODEV in this case. Signed-off-by: Boris Brezillon Reviewed-by: Thierry Reding Acked-by: Thierry Reding Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180509130042.9435-4-boris.brezillon@bootlin.com commit c59eb3cfde1faed960fe6de5040c4bd4310fb1cd Author: Boris Brezillon Date: Wed May 9 15:00:40 2018 +0200 drm/panel: Let of_drm_find_panel() return -ENODEV when the panel is disabled DT nodes might be present in the DT but with a status property set to "disabled" or "fail". In this case, we should not return -EPROBE_DEFER when the caller asks for a drm_panel instance. Return -ENODEV instead. Signed-off-by: Boris Brezillon Reviewed-by: Thierry Reding Acked-by: Thierry Reding Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180509130042.9435-3-boris.brezillon@bootlin.com commit 5fa8e4a22182df8ea39adeba4bd518506e26a96d Author: Boris Brezillon Date: Wed May 9 15:00:39 2018 +0200 drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL Right now, the DRM panel logic returns NULL when a panel pointing to the passed OF node is not present in the list of registered panels. Most drivers interpret this NULL value as -EPROBE_DEFER, but we are about to modify the semantic of of_drm_find_panel() and let the framework return -ENODEV when the device node we're pointing to has a status property that is not equal to "okay" or "ok". Let's first patch the of_drm_find_panel() implementation to return ERR_PTR(-EPROBE_DEFER) instead of NULL and patch all callers to replace the '!panel' check by an 'IS_ERR(panel)' one. Signed-off-by: Boris Brezillon Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180509130042.9435-2-boris.brezillon@bootlin.com commit 0ca0c827efdf248dfb4bbd4b9066acb6337e07ac Author: Philipp Zabel Date: Wed May 23 11:25:04 2018 +0200 drm/panel: simple: Add DLC DLC0700YZG-1 panel This patch adds support for DLC DLC0700YZG-1 1024x600 LVDS panels to the simple-panel driver. Signed-off-by: Philipp Zabel [m.felsch@pengutronix.de: fix typo in compatible dt-binding] [m.felsch@pengutronix.de: add property bindings] Signed-off-by: Marco Felsch Reviewed-by: Eric Anholt Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180523092504.5142-3-m.felsch@pengutronix.de commit 7a6aca49358a8b678304f7444ec615dbb1175ce8 Author: Philipp Zabel Date: Wed May 23 11:25:03 2018 +0200 dt-bindings: Add vendor prefix for DLC Display Co., Ltd. DLC provides a wide range of display solutions. Website: http://www.dlcdisplay.com/ Signed-off-by: Philipp Zabel Signed-off-by: Marco Felsch Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180523092504.5142-2-m.felsch@pengutronix.de commit aad34de22e6325727f7c716e2e7aa396031ceed5 Author: Jan Tuerk Date: Tue Jun 19 11:55:45 2018 +0200 drm/panel: Add support for the EDT ETM0700G0EDH6 The Emerging Display Technology ETM0700G0EDH6 is the uses the same panel as the ETM0700G0BDH6. It differs in the hardware design for the backlight and the touchscreen i2c interface. As the new display type has different requirements for drive-strengths on the i2c-bus, add an additional compatible to allow the handling of it or warn about incompatible cpu and display combinations. Signed-off-by: Jan Tuerk Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180619095546.24445-3-jan.tuerk@emtrion.com commit aa7e6455e1ef75113d47889badb21730f1436714 Author: Jan Tuerk Date: Tue Jun 19 11:55:44 2018 +0200 drm/panel: Add support for the EDT ETM0700G0BDH6 The Emerging Display Technology ETM0700G0BDH6 is exactly the same display as the ETM0700G0DH6, exept the pixelclock polarity. Therefore re-use the ETM0700G0DH6 modes. It is used by default on emtrion Avari based development kits. Signed-off-by: Jan Tuerk Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180619095546.24445-2-jan.tuerk@emtrion.com commit 2230ca12cca14c5f42e38f11d94d2f3c1f868453 Author: Jan Tuerk Date: Tue Jun 19 11:55:43 2018 +0200 dt-bindings: display: Document the EDT et* displays in one file. Document the Emerging Display Technology Corp. (EDT) using the simple-panel binding in one single file. Reviewed-by: Rob Herring Signed-off-by: Jan Tuerk Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180619095546.24445-1-jan.tuerk@emtrion.com commit 23167fa9a519c5408c4aa7fd1dc85b7c48b37864 Author: Jagan Teki Date: Thu Jun 7 19:16:48 2018 +0530 drm/panel: simple: Add support for Rocktech RK070ER9427 LCD panel This adds support for the Rocktech Display Ltd. RK070ER9427 800(RGB)x480 TFT LCD panel, which can be supported by the simple panel driver. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180607134648.2902-1-jagan@amarulasolutions.com commit aef92a8bed25d03b8f03ce499a56e8e8e5e2c05e Author: Peter Zijlstra Date: Tue Jul 10 13:42:10 2018 +0200 watchdog/softlockup: Fix the SOFTLOCKUP_DETECTOR=n build I got confused by all the various CONFIG options here about and conflated CONFIG_LOCKUP_DETECTOR and CONFIG_SOFTLOCKUP_DETECTOR. This results in a build failure for: CONFIG_LOCKUP_DETECTOR=y && CONFIG_SOFTLOCKUP_DETECTOR=n As reported by Abdul. Reported-and-tested-by: Abdul Haleem Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-next Cc: linuxppc-dev Cc: mpe Cc: sachinp Cc: stephen Rothwell Fixes: 9cf57731b63e ("watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work") Link: http://lkml.kernel.org/r/20180710114210.GI2476@hirez.programming.kicks-ass.net Signed-off-by: Ingo Molnar commit 7ab87ede5078af1daccf26951096e16ac16e19cb Author: Chris Wilson Date: Tue Jul 10 15:38:21 2018 +0100 drm/i915: Unwind HW init after GVT setup failure Following intel_gvt_init() failure, we missed unwinding our setup leaving pointers dangling past the module unload. For our example, the pm_qos: [ 441.057615] top: 000000006b3baf1c, n: 0000000054d8ef33, p: 0000000097cdf1a2 prev: 0000000054d8ef33, n: 0000000097cdf1a2, p: 000000006b3baf1c next: 0000000097cdf1a2, n: 000000006de8fc8b, p: 0000000081087253 [ 441.057627] WARNING: CPU: 4 PID: 9277 at lib/plist.c:42 plist_check_prev_next+0x2d/0x40 [ 441.057628] Modules linked in: i915(+) vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core e1000e snd_pcm mei_me mei prime_numbers [last unloaded: i915] [ 441.057652] CPU: 4 PID: 9277 Comm: drv_selftest Tainted: G U 4.18.0-rc4-CI-CI_DRM_4464+ #1 [ 441.057653] Hardware name: System manufacturer System Product Name/Z170 PRO GAMING, BIOS 3402 04/26/2017 [ 441.057656] RIP: 0010:plist_check_prev_next+0x2d/0x40 [ 441.057657] Code: 08 48 39 f0 74 2b 49 89 f0 48 8b 4f 08 50 ff 32 52 48 89 fe 41 ff 70 08 48 8b 17 48 c7 c7 d8 ae 14 82 4d 8b 08 e8 63 0e 76 ff <0f> 0b 48 83 c4 20 c3 48 39 10 75 d0 f3 c3 0f 1f 44 00 00 41 54 55 [ 441.057717] RSP: 0018:ffffc900003a3a68 EFLAGS: 00010082 [ 441.057720] RAX: 0000000000000000 RBX: ffff8802193978c0 RCX: 0000000000000002 [ 441.057721] RDX: 0000000080000002 RSI: ffffffff820c65a4 RDI: 00000000ffffffff [ 441.057722] RBP: ffff8802193978c0 R08: 0000000000000000 R09: 0000000000000001 [ 441.057724] R10: ffffc900003a3a70 R11: 0000000000000000 R12: ffffffff82243de0 [ 441.057725] R13: ffffffff82243de0 R14: ffff88021a6c78c0 R15: 0000000077359400 [ 441.057726] FS: 00007fc23a4a9980(0000) GS:ffff880236d00000(0000) knlGS:0000000000000000 [ 441.057728] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 441.057729] CR2: 0000563e4503d038 CR3: 0000000138f86005 CR4: 00000000003606e0 [ 441.057730] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 441.057731] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 441.057732] Call Trace: [ 441.057736] plist_check_list+0x2e/0x40 [ 441.057738] plist_add+0x23/0x130 [ 441.057743] pm_qos_update_target+0x1bd/0x2f0 [ 441.057771] i915_driver_load+0xec4/0x1060 [i915] [ 441.057775] ? trace_hardirqs_on_caller+0xe0/0x1b0 [ 441.057800] i915_pci_probe+0x29/0x90 [i915] [ 441.057804] pci_device_probe+0xa1/0x130 [ 441.057807] driver_probe_device+0x306/0x480 [ 441.057810] __driver_attach+0xdb/0x100 [ 441.057812] ? driver_probe_device+0x480/0x480 [ 441.057813] ? driver_probe_device+0x480/0x480 [ 441.057816] bus_for_each_dev+0x74/0xc0 [ 441.057819] bus_add_driver+0x15f/0x250 [ 441.057821] ? 0xffffffffa0696000 [ 441.057823] driver_register+0x56/0xe0 [ 441.057825] ? 0xffffffffa0696000 [ 441.057827] do_one_initcall+0x58/0x370 [ 441.057830] ? do_init_module+0x1d/0x1ea [ 441.057832] ? rcu_read_lock_sched_held+0x6f/0x80 [ 441.057834] ? kmem_cache_alloc_trace+0x282/0x2e0 [ 441.057838] do_init_module+0x56/0x1ea [ 441.057841] load_module+0x2435/0x2b20 [ 441.057852] ? __se_sys_finit_module+0xd3/0xf0 [ 441.057854] __se_sys_finit_module+0xd3/0xf0 [ 441.057861] do_syscall_64+0x55/0x190 [ 441.057863] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 441.057865] RIP: 0033:0x7fc239d75839 [ 441.057866] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48 [ 441.057927] RSP: 002b:00007fffb7825d38 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 441.057930] RAX: ffffffffffffffda RBX: 0000563e45035dd0 RCX: 00007fc239d75839 [ 441.057931] RDX: 0000000000000000 RSI: 0000563e4502f8a0 RDI: 0000000000000004 [ 441.057932] RBP: 0000563e4502f8a0 R08: 0000000000000004 R09: 0000000000000000 [ 441.057933] R10: 00007fffb7825ea0 R11: 0000000000000246 R12: 0000000000000000 [ 441.057934] R13: 0000563e4502f690 R14: 0000000000000000 R15: 000000000000003f [ 441.057940] irq event stamp: 231338 [ 441.057943] hardirqs last enabled at (231337): [] _raw_spin_unlock_irqrestore+0x4c/0x60 [ 441.057944] hardirqs last disabled at (231338): [] _raw_spin_lock_irqsave+0xd/0x50 [ 441.057947] softirqs last enabled at (231024): [] __do_softirq+0x34f/0x505 [ 441.057949] softirqs last disabled at (231005): [] irq_exit+0xa9/0xc0 [ 441.057951] WARNING: CPU: 4 PID: 9277 at lib/plist.c:42 plist_check_prev_next+0x2d/0x40 v2: Add a load failure point to intel_gvt_init() so that we always exercise this path in future. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107129 Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Michał Winiarski Reviewed-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/20180710143821.1889-1-chris@chris-wilson.co.uk commit bbacb8e78a3b29ebdbb6af7d54fcf25d3f1c248f Author: Andy Shevchenko Date: Tue Jul 10 14:49:42 2018 +0300 dmaengine: idma64: Support dmaengine_terminate_sync() It appears that the driver misses the support of dmaengine_terminate_sync(). Since many of callers expects this behaviour implement the new device_synchronize() callback to allow proper synchronization when stopping a channel. Fixes: b36f09c3c441 ("dmaengine: Add transfer termination synchronization support") Signed-off-by: Andy Shevchenko Signed-off-by: Vinod Koul commit 2abc66cd499aa16876e45c6438788902f7d1ce22 Author: Andy Shevchenko Date: Tue Jul 10 14:49:08 2018 +0300 dmaengine: hsu: Support dmaengine_terminate_sync() It appears that the driver misses the support of dmaengine_terminate_sync(). Since many of callers expects this behaviour implement the new device_synchronize() callback to allow proper synchronization when stopping a channel. Fixes: b36f09c3c441 ("dmaengine: Add transfer termination synchronization support") Signed-off-by: Andy Shevchenko Signed-off-by: Vinod Koul commit 1662dd641f596e5517c7b7a23e4f8ddf36741b5f Author: Dmitry Osipenko Date: Sat May 26 17:20:35 2018 +0300 memory: tegra: Correct driver probe order The Reset Controller should be registered in the end of probe, otherwise Memory Controller device goes away if IRQ requesting fails and the Reset Controller stays registered. To avoid having to unwind the MC probing in a case of SMMU probe failure, let's simply print the error message without failing the MC probe. This allows us to just move the Reset Controller registering before the SMMU registration, reducing code churning. Also let's not fail MC probe in a case of Reset Controller registration failure as it doesn't prevent the MC driver to work. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit e01afc32502555beb2057ddd74401be38475d851 Author: Rob Herring Date: Mon Jul 9 09:41:53 2018 -0600 PM / Domains: Stop deferring probe at the end of initcall All PM domain drivers must be built-in (at least those using DT), so there is no point deferring probe after initcalls are done. Continuing to defer probe may prevent booting successfully even if managing PM domains is not required. This can happen if the user failed to enable the driver or if power-domains are added to a platform's DT, but there is not yet a driver (e.g. a new DTB with an old kernel). Call the driver core function driver_deferred_probe_check_init_done() instead of just returning -EPROBE_DEFER to stop deferring probe when initcalls are done. Acked-by: "Rafael J. Wysocki" Cc: Kevin Hilman Cc: Ulf Hansson Cc: Pavel Machek Cc: Len Brown Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit ac6bbf0cdf4206c517ac9789814c23e372ebce4d Author: Rob Herring Date: Mon Jul 9 09:41:52 2018 -0600 iommu: Remove IOMMU_OF_DECLARE Now that we use the driver core to stop deferred probe for missing drivers, IOMMU_OF_DECLARE can be removed. This is slightly less optimal than having a list of built-in drivers in that we'll now defer probe twice before giving up. This shouldn't have a significant impact on boot times as past discussions about deferred probe have given no evidence of deferred probe having a substantial impact. Cc: Robin Murphy Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: Rob Clark Cc: Heiko Stuebner Cc: Frank Rowand Cc: linux-arm-kernel@lists.infradead.org Cc: iommu@lists.linux-foundation.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Cc: devicetree@vger.kernel.org Acked-by: Will Deacon Acked-by: Marek Szyprowski Acked-by: Joerg Roedel Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 78f307be3e0bc85f25dc05baa60f7435a88c2abf Author: Rob Herring Date: Mon Jul 9 09:41:51 2018 -0600 iommu: Stop deferring probe at end of initcalls The IOMMU subsystem has its own mechanism to not defer probe if driver support is missing. Now that the driver core supports stopping deferring probe if drivers aren't built-in (and probed), use the driver core support so the IOMMU specific support can be removed. Acked-by: Joerg Roedel Cc: iommu@lists.linux-foundation.org Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit d19c5e79d46efdf89306be99f3c8824cf58e35f6 Author: Rob Herring Date: Mon Jul 9 09:41:50 2018 -0600 pinctrl: Support stopping deferred probe after initcalls Pinctrl drivers are a common dependency which can prevent a system booting even if the default or bootloader configured settings can work. If a pinctrl node in DT indicates that the default pin setup can be used with the 'pinctrl-use-default' property, then only defer probe until initcalls are done. If the deferred probe timeout is enabled or loadable modules are disabled, then we'll stop deferring probe regardless of the DT property. This gives platforms the option to work without their pinctrl driver being enabled. Dropped the pinctrl specific deferring probe message as the driver core can print deferred probe related messages if needed. Reviewed-by: Linus Walleij Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 7930eb919feb59b8c799cb3085d0e9f7b5ae34d1 Author: Rob Herring Date: Mon Jul 9 09:41:49 2018 -0600 dt-bindings: pinctrl: add a 'pinctrl-use-default' property Pin setup may be optional in some cases such as the reset default works or the pin setup is done by the bootloader. In these cases, it is optional for the OS to support managing the pin controller and pin setup. In order to support this scenario, add a property 'pinctrl-use-default' to indicate that the pin configuration is optional. Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 25b4e70dcce92168eab4d8113817bb4dd130ebd2 Author: Rob Herring Date: Mon Jul 9 09:41:48 2018 -0600 driver core: allow stopping deferred probe after init Deferred probe will currently wait forever on dependent devices to probe, but sometimes a driver will never exist. It's also not always critical for a driver to exist. Platforms can rely on default configuration from the bootloader or reset defaults for things such as pinctrl and power domains. This is often the case with initial platform support until various drivers get enabled. There's at least 2 scenarios where deferred probe can render a platform broken. Both involve using a DT which has more devices and dependencies than the kernel supports. The 1st case is a driver may be disabled in the kernel config. The 2nd case is the kernel version may simply not have the dependent driver. This can happen if using a newer DT (provided by firmware perhaps) with a stable kernel version. Deferred probe issues can be difficult to debug especially if the console has dependencies or userspace fails to boot to a shell. There are also cases like IOMMUs where only built-in drivers are supported, so deferring probe after initcalls is not needed. The IOMMU subsystem implemented its own mechanism to handle this using OF_DECLARE linker sections. This commit adds makes ending deferred probe conditional on initcalls being completed or a debug timeout. Subsystems or drivers may opt-in by calling driver_deferred_probe_check_init_done() instead of unconditionally returning -EPROBE_DEFER. They may use additional information from DT or kernel's config to decide whether to continue to defer probe or not. The timeout mechanism is intended for debug purposes and WARNs loudly. The remaining deferred probe pending list will also be dumped after the timeout. Not that this timeout won't work for the console which needs to be enabled before userspace starts. However, if the console's dependencies are resolved, then the kernel log will be printed (as opposed to no output). Cc: Alexander Graf Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 538603c6026ce769eec633bb79349f5f287519c7 Author: Yoshihiro Shimoda Date: Mon Jul 2 18:18:03 2018 +0900 dmaengine: sh: rcar-dmac: avoid to write CHCR.TE to 1 if TCR is set to 0 This patch fixes an issue that unexpected retransfering happens if TCR is set to 0 before rcar_dmac_sync_tcr() writes DE bit to the CHCR register. For example, sh-sci driver can reproduce this issue like below: In rx_timer_fn(): /* CHCR DE bit may be set to 1 */ dmaengine_tx_status() rcar_dmac_tx_status() rcar_dmac_chan_get_residue() rcar_dmac_sync_tcr() /* TCR is possible to be set to 0 */ According to the description of commit 73a47bd0da66 ("dmaengine: rcar-dmac: use TCRB instead of TCR for residue"), "this buffered data will be transferred if CHCR::DE bit was cleared". So, this patch doesn't need to check TCRB register. Fixes: 73a47bd0da66 ("dmaengine: rcar-dmac: use TCRB instead of TCR for residue") Signed-off-by: Yoshihiro Shimoda Signed-off-by: Vinod Koul commit 2f903bab92dea8dec8c93e4fa3c7c5295ef0a0fe Author: Vinod Koul Date: Mon Jul 9 20:08:48 2018 +0530 dmaengine: pl330: remove set but unused variable Compiler complains (with W=1): drivers/dma/pl330.c: In function ‘pl330_release_channel’: drivers/dma/pl330.c:1782:21: warning: variable ‘pl330’ set but not used [-Wunused-but-set-variable] struct pl330_dmac *pl330; ^~~~~ Remove the pl330 variable in pl330_release_channel as it is set but never used. Signed-off-by: Vinod Koul commit bbcb87555869cb6c249bf00d13d3bc400c476c84 Author: Vinod Koul Date: Mon Jul 9 17:09:58 2018 +0530 dmaengine: pl330: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vinod Koul commit 11ca58727ee4486037a0ca88b6243cc2976ecba7 Author: Fabio Estevam Date: Tue Jul 3 19:51:16 2018 -0300 dt-bindings: sram: Add 'clocks' as an optional property Some SoCs (like i.MX53) need to specify the SRAM clock in the device tree via the clocks property. Add an entry to the optional property section. Signed-off-by: Fabio Estevam Signed-off-by: Rob Herring commit df0e0304466c4b0d8d8137d9c582961db5c65e87 Author: Luis Araneda Date: Wed Jun 27 16:33:15 2018 -0400 dt-bindings: Add vendor prefix for AsusTek Computer Inc. "AsusTek Computer Inc. is a Taiwanese multinational computer and phone hardware and electronics company headquartered in Beitou District, Taipei, Taiwan." - Wikipedia.org Website: https://www.asus.com The prefix is already in use by at least 5 ARM boards Signed-off-by: Luis Araneda Signed-off-by: Rob Herring commit 913097bcdc9010d1617cded9f623a52438531653 Author: Benjamin Herrenschmidt Date: Wed Jun 27 09:57:51 2018 +1000 dt-bindings: misc: ASPEED coprocessor interrupt controller Add the device-tree binding definition for the AST2400 and AST2500 coprocessor interrupt controller Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Rob Herring commit 24a29949230c95d528d890e67004f239d4227a02 Author: Geert Uytterhoeven Date: Tue Jun 19 19:24:41 2018 +0200 dt-bindings: gpio: pca953x: Document interrupts, update example The device can optionally supply an interrupt, hence document that. Add required GPIO properties to the example (extracted from a patch by Wolfram Sang). Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring commit b01dcdd86e8c20599ee9293392d6fef8397fbc5d Author: Benjamin Herrenschmidt Date: Tue Jun 12 10:01:07 2018 +1000 drivers/of: Make of_io_request_and_map() "name" argument optional These days of_address_to_resource() puts a reasonable name in the resource struct, thus make the "name" argument an optional override. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Rob Herring commit b7394b7f5870234b77bf60224eb543a1b2d038a2 Author: Michal Simek Date: Wed Jun 6 14:49:48 2018 +0200 dt-bindings: Add bitmain vendor prefix Bitmain (https://www.bitmain.com) is a vendor of cryptocurrency hardware. Signed-off-by: Michal Simek Signed-off-by: Rob Herring commit cc55378c5f20af0864f4936d569ef59f8f94ce7c Author: Enric Balletbo i Serra Date: Wed Jun 6 17:39:42 2018 +0200 Documentation: devicetree: tilcdc: fix spelling mistake "suppors" -> "supports" Trivial fix to spelling mistake in tilcdc.txt devicetree documentation. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Rob Herring commit 73bad7ca87b65a91f61cf34b92a1febd689c01c1 Author: Chris Wilson Date: Tue Jul 10 10:44:21 2018 +0100 drm/i915: Cleanup modesetting on load-error path After handling a critical failure initialising GEM we need to unwind the modesetting setup. Testcase: igt/drv_module_reload/basic-reload-inject Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180710094421.16223-2-chris@chris-wilson.co.uk Reviewed-by: Matthew Auld commit 8bcf9f7034d81979837e97a6509b0b2a96f8f4c8 Author: Chris Wilson Date: Tue Jul 10 10:44:20 2018 +0100 drm/i915: Flush the residual parking on emergency shutdown On unwinding following a critical failure inside GEM init, we also need to be sure to flush the workers before unloading the module. Testcase: igt/drv_module_reload/basic-reload-inject Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180710094421.16223-1-chris@chris-wilson.co.uk commit 85b5bafb86e64f5d0ef143ab1a8363f5511eaabb Author: Noralf Trønnes Date: Tue Jul 3 18:03:54 2018 +0200 drm/cma-helper: Remove drm_fb_cma_fbdev_init_with_funcs() Remove drm_fb_cma_fbdev_init_with_funcs(), its only user tinydrm has moved to drm_fbdev_generic_setup(). Cc: Laurent Pinchart Signed-off-by: Noralf Trønnes Reviewed-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-9-noralf@tronnes.org commit dff1c7032ffea20cca2ad3973ed4c69c8182683d Author: Noralf Trønnes Date: Tue Jul 3 18:03:53 2018 +0200 drm/tinydrm: Use drm_fbdev_generic_setup() Make full use of the generic fbdev client. Cc: David Lechner Signed-off-by: Noralf Trønnes Reviewed-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-8-noralf@tronnes.org commit 9060d7f49376159dcc500a97cb247ca8e4b98f48 Author: Noralf Trønnes Date: Tue Jul 3 18:03:52 2018 +0200 drm/fb-helper: Finish the generic fbdev emulation This adds a drm_fbdev_generic_setup() function that sets up generic fbdev emulation with client callbacks for restore, hotplug and unregister. Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-7-noralf@tronnes.org commit e896c132eb2cb4975d99477ea7e95aedb6dffa95 Author: Noralf Trønnes Date: Tue Jul 3 18:03:51 2018 +0200 drm/debugfs: Add internal client debugfs file Print the names of the internal clients currently attached. Reviewed-by: Daniel Vetter Signed-off-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-6-noralf@tronnes.org commit 894a677f4b3e6d2ab8d01bb46c1fbd5f92e4591b Author: Noralf Trønnes Date: Tue Jul 3 18:03:50 2018 +0200 drm/cma-helper: Use the generic fbdev emulation This switches the CMA helper drivers that use its fbdev emulation over to the generic fbdev emulation. It's the first phase of using generic fbdev. A later phase will use DRM client callbacks for the lastclose/hotplug/remove callbacks. There are currently 2 fbdev init/fini functions: - drm_fb_cma_fbdev_init/drm_fb_cma_fbdev_fini - drm_fbdev_cma_init/drm_fbdev_cma_fini This is because the work on generic fbdev came up during a fbdev refactoring and thus wasn't completed. No point in completing that refactoring when drivers will soon move to drm_fb_helper_generic_probe(). tinydrm uses drm_fb_cma_fbdev_init_with_funcs(). Cc: Laurent Pinchart Signed-off-by: Noralf Trønnes Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-5-noralf@tronnes.org commit 244007ecb6bb94fa4e9b9a969fa86f2ad86ec543 Author: Noralf Trønnes Date: Tue Jul 3 18:03:49 2018 +0200 drm/pl111: Set .gem_prime_vmap and .gem_prime_mmap These are needed for pl111 to use the generic fbdev emulation. Cc: Eric Anholt Signed-off-by: Noralf Trønnes Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-4-noralf@tronnes.org commit d536540f304ce0ee35db9f67f7d880bc09f3743f Author: Noralf Trønnes Date: Tue Jul 3 18:03:48 2018 +0200 drm/fb-helper: Add generic fbdev emulation .fb_probe function This is the first step in getting generic fbdev emulation. A drm_fb_helper_funcs.fb_probe function is added which uses the DRM client API to get a framebuffer backed by a dumb buffer. Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-3-noralf@tronnes.org commit c76f0f7cb546b661b5e0ac769850a5c854927f65 Author: Noralf Trønnes Date: Tue Jul 3 18:03:47 2018 +0200 drm: Begin an API for in-kernel clients This the beginning of an API for in-kernel clients. First out is a way to get a framebuffer backed by a dumb buffer. Only GEM drivers are supported. The original idea of using an exported dma-buf was dropped because it also creates an anonomous file descriptor which doesn't work when the buffer is created from a kernel thread. The easy way out is to use drm_driver.gem_prime_vmap to get the virtual address, which requires a GEM object. This excludes the vmwgfx driver which is the only non-GEM driver apart from the legacy ones. A solution for vmwgfx will have to be worked out later if it wants to support the client API which it probably will when we have a bootsplash client. Suggested-by: Daniel Vetter Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-2-noralf@tronnes.org commit bf06112f869dd6a6c85a8d9fbbe879fb363011d6 Author: Chris Wilson Date: Mon Jul 9 14:02:04 2018 +0100 drm/i915: Tidy i915_gem_suspend() In the next patch, we will make a fairly minor change to flush outstanding resets before suspend. In order to keep churn to a minimum in that functional patch, we fix up the comments and coding style now. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180709130208.11730-7-chris@chris-wilson.co.uk commit 0adbe832f21ac8478f33aa64627c92fd3225b944 Author: Faiz Abbas Date: Tue Jul 10 04:05:30 2018 -0700 ARM: dts: dra76x: Add MCAN node Add support for the MCAN peripheral which supports both classic CAN messages along with the new CAN-FD message. Add MCAN node to evm and enable it with a maximum datarate of 5 mbps Signed-off-by: Faiz Abbas Signed-off-by: Tony Lindgren commit 09a070a3696771905a4db3d84e021aabe752463b Author: Faiz Abbas Date: Tue Jul 10 04:05:30 2018 -0700 ARM: dts: Add generic interconnect target module node for MCAN The ti-sysc driver provides support for manipulating the idle modes and interconnect level resets. Add the generic interconnect target module node for MCAN to support the same. CC: Tony Lindgren Signed-off-by: Faiz Abbas Signed-off-by: Tony Lindgren commit 6ae8d5c1a8ace610b2afc016b2ea5f5d9d774b71 Author: Lokesh Vutla Date: Tue Jul 10 04:05:30 2018 -0700 ARM: dts: dra762: Add MCAN clock support MCAN is clocked by H14 divider of DPLL_GMAC. Unlike other DPLL dividers this DPLL_GMAC H14 divider is controlled by control module. Adding support for these clocks. Signed-off-by: Lokesh Vutla Signed-off-by: Faiz Abbas Signed-off-by: Tony Lindgren commit 2427d174a476199111a20e74f76fda21296134f7 Author: Sergio Paracuellos Date: Mon Jul 9 22:21:04 2018 +0200 staging: mt7621-pci: factor out mt7621_pci_get_cfgaddr function To get config address the same pattern is repeated in some functions along the code. Factor out a new mt7621_pci_get_cfgaddr for calculate it and use it in convenient places. Adjust types to match to u32 where is neccesary. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit fc4afdfea0428f8a564b62a6d668da95935b6cbf Author: Sergio Paracuellos Date: Mon Jul 9 22:21:03 2018 +0200 staging: mt7621-pci: remove unused macro MV_READ_DATA This macro is not being used at all along the code. Just remove it. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 7c478d6a22392dd60f4e312a13f69fb620c27c83 Author: Sergio Paracuellos Date: Mon Jul 9 18:05:48 2018 +0200 staging: mt7621-gpio: remove driver from staging Remove driver from staging. It has been accepted in the linux-gpio tree. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 1cb5c5596b2621b5f5457d2f35048b7ee020ff5c Author: Michael Straube Date: Mon Jul 9 15:50:39 2018 +0200 staging: rtl8723bs: use mac_pton() Use mac_pton() instead of custom approach. Remove the now unused hex2num_i() and hwaddr_aton_i(). Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 1d2d116a93f0e9bf0bca72da76a96edef8a1d36d Author: Sergio Paracuellos Date: Mon Jul 9 13:28:30 2018 +0200 Revert "staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver" That patch causes the network interface on the device to stop working. device_initcall() is called much later than core_initcall_sync() and that seem to be a problem. Revert it to get a correct behaviour. Reported-by: NeilBrown Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 0be0debe4a8a6ff0c7b79ca7c16a656204651a69 Author: Sergio Paracuellos Date: Mon Jul 9 06:52:45 2018 +0200 staging: mt7621-pinctrl: init *map to NULL for correct memory assignation pinctrl_utils_reserve_map() calls krealloc() on *map. Because of this *map need to be initialized to NULL before calling it. Fixes: 62b6215c11ea ("staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map") Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 00fee00245e2f2d0ce9376ced63c0f20c406aa62 Author: Ioana Radulescu Date: Mon Jul 9 10:01:11 2018 -0500 staging: fsl-dpaa2/eth: Remove Rx frame size check Most Ethernet drivers don't enforce the MTU value as upper limit for ingress frames. We too support receiving frames larger than MTU, so allow that. Remove our ndo_change_mtu implementation, letting the default stack implementation handle things. Also, set the max frame length allowed by hardware only once at probe time, with the largest possible value. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit 3ccc8d475f9e29b87a8f0d114994a7a01c415ce4 Author: Ioana Radulescu Date: Mon Jul 9 10:01:10 2018 -0500 staging: fsl-dpaa2/eth: MTU cleanup Don't set the lower MTU limit explicitly, since we use the default value anyway. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit 0c047227578f64d96d12df0f93c2e53e67272278 Author: Ioana Radulescu Date: Mon Jul 9 10:01:09 2018 -0500 staging: fsl-dpaa2/eth: Remove pointless instruction We don't need to call dev_set_drvdata(dev, NULL) on driver remove since core kernel code also performs this step. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit e0cfb8f2d515312853ade9616248bc62575c61a6 Author: Ioana Radulescu Date: Mon Jul 9 10:01:08 2018 -0500 staging: fsl-dpaa2/eth: Remove obsolete reference Commit 2b7c86eb7bf3 ("staging: fsl-dpaa2/eth: Don't enable FAS on Tx") removed the status field from the TX confirm frame annotation, but a reference to it remained in the description of free_tx_fd(). Remove it. Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit 466bcdc1fa303be175c45d054bb00effc575033a Author: Ioana Radulescu Date: Mon Jul 9 10:01:07 2018 -0500 staging: fsl-dpaa2/eth: Fix DMA mapping direction We are using DMA_FROM_DEVICE when mapping RX frame buffers, but DMA_BIDIRECTIONAL for unmap. Fix the direction for DMA unmapping operation. Fixes: 87eb55e418b7 ("staging: fsl-dpaa2/eth: Fix potential endless loop") Signed-off-by: Ioana Radulescu Signed-off-by: Greg Kroah-Hartman commit b7bb6138c2d5fc0a79a465478c7bbf74902289f7 Author: Chris Wilson Date: Mon Jul 9 14:01:59 2018 +0100 drm/i915: Only reset hangcheck at the start of an activity cycle Across a reset, the seqno (and thus hangcheck) should restart and the hangcheck naturally progress, for when it does not, we want to declare an emergency. Currently, we only detect if reset and reinit fails, but we do not detect if the call to reinit succeeds but the HW is fried - as we are resetting hangcheck on initialisation the engine. Remove that and rely on the natural progress to reset the hangcheck timer. References: e21b141376f9 ("drm/i915: Mark the hangcheck as idle when unparking the engines") References: 1fd00c0faeec ("drm/i915: Declare the driver wedged if hangcheck makes no progress") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180709130208.11730-2-chris@chris-wilson.co.uk commit 7f69ae7fadd9dbebe563bfc28b993a2bc9c8acf9 Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:48 2018 +0200 ARM: davinci: unduplicate aemif support All users now register platform devices using the ti-aemif driver. Remove the handcrafted aemif API. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit acc0fb43c691e8b70bc8ae8c8ce9ed6d5177a60f Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:47 2018 +0200 ARM: davinci: mityomapl138: use aemif platform driver We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in mityomapl138. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit 59a2180298d9ccc7218f701061739cece7ddb49b Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:46 2018 +0200 ARM: davinci: dm646x-evm: use aemif platform driver We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in dm646x-evm. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit aa88d25d5296b013f2b8fec9277db1d9539b5579 Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:45 2018 +0200 ARM: davinci: da830-evm: use aemif platform driver We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in da830-evm. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit 2ee2948e874f61defb081acf6c4d850b7f889695 Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:44 2018 +0200 ARM: davinci: dm644x-evm: use aemif platform driver We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in dm644x-evm. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit 8c03a8889b1a0af293237879ff31b8c69f958805 Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:43 2018 +0200 ARM: davinci: dm365-evm: use the ti-aemif soc driver We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in dm365-evm. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit d51626ce5fe4c70ed013a1e9ba0f2db6f48e8b89 Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:42 2018 +0200 ARM: davinci: da850-evm: use aemif platform driver in legacy mode We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in da850-evm. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit 92eb49089c00487c87cf5cf177f19a18f1b78b59 Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:41 2018 +0200 ARM: davinci: omapl138-hawk: add aemif & nand support We now have support for aemif & nand from board files. As an example add support for nand to da850-hawk. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit 63a9a4f928407555bf0637a57f3fe69a5c94f1fc Merge: bfd107bd3b8b f917ff75ac55 Author: Sekhar Nori Date: Tue Jul 10 15:38:02 2018 +0530 Merge branch 'for-sekhar' of https://github.com/dlech/linux into v4.19/soc commit 3117c17301edce7583843bdee513e201bb69c37c Author: Sekhar Nori Date: Wed Jul 4 15:14:32 2018 +0530 ARM: dts: da850: Add power-domains to CPPI 4.1 node This adds the power-domains property to CPPI 4.1 node. The CPPI 4.1 DMA driver uses pm_runtime to manage the clocks, so it needs this property in order to find and enable the clock properly. Reviewed-by: David Lechner Tested-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit cecb368d2fe40e7f6a8166fef35abc69852f7501 Author: Chris Wilson Date: Mon Jul 9 20:49:15 2018 +0100 drm/i915/selftests: Filter out both physical address swizzles In our swizzling selftests, we cannot predict the physical address of the target page (at least not simply!) and so skip bit17 swizzles. However, there are two bit17 swizzle modes and we only skipped one, with the second being observed on the lab gdg causing the test to fail, as soon as we hit a page with bit17 set in its address. Testcase: igt/drv_selftest/live_objects #gdg Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180709194915.5789-1-chris@chris-wilson.co.uk commit ebfa7944d6d951c77dca6911a252917f6cecaab3 Author: Chris Wilson Date: Tue Jul 10 09:04:24 2018 +0100 drm/i915/selftests: Constrain mock_gtt tests to fit within RAM Be pessimistic and presume that we actually allocate every page we exercise via the mock_gtt (e.g. for gvt). In which case we have to keep our working set under the available physical memory to prevent oom. Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180710080424.7821-1-chris@chris-wilson.co.uk commit 8cff1f4a3ca58ab426f224b4bd6af61c1a9976ab Author: Chris Wilson Date: Mon Jul 9 14:48:58 2018 +0100 drm/i915: Remove function details from device error messages Error messages are intended to be addressed to the user; be clear, succinct, instructive and unambiguous. Adding the function name to that message does not add any information the user requires and in the process makes the message less clear. E.g. [ 245.539711] i915 0000:00:02.0: [drm:i915_gem_init [i915]] Failed to initialize GPU, declaring it wedged! becomes [ 245.539711] i915 0000:00:02.0: Failed to initialize GPU, declaring it wedged! Signed-off-by: Chris Wilson Acked-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180709134858.12446-1-chris@chris-wilson.co.uk commit d5f5ee1a16a4f14e9b98d1352bc850e43f2968ca Author: Jisheng Zhang Date: Wed May 16 15:48:57 2018 +0800 phy: berlin: switch to SPDX license identifier Use the appropriate SPDX license identifier and drop the previous license text. Signed-off-by: Jisheng Zhang Signed-off-by: Kishon Vijay Abraham I commit 2ce7f2f425ef7464a2a9a872d2e9acad49e6cb3e Author: Sergei Shtylyov Date: Sun Jun 10 21:24:13 2018 +0300 phy: Renesas R-Car gen3 PCIe PHY driver This PHY is still mostly undocumented -- the only documented registers exist on R-Car V3H (R8A77980) SoC where this PHY stays in a powered-down state after a reset and thus we must power it up for PCIe to work... Signed-off-by: Sergei Shtylyov Reviewed-by: Simon Horman Signed-off-by: Kishon Vijay Abraham I commit 4fa88cd3370ed33119863747a4db7f5e3f1dc308 Author: Sergei Shtylyov Date: Sun Jun 10 21:22:46 2018 +0300 dt-bindings: phy: Renesas R-Car Gen3 PCIe PHY bindings This PHY is still mostly undocumented -- the only documented registers exist on R-Car V3H (R8A77980) SoC. Add the corresponding device tree bindings. Signed-off-by: Sergei Shtylyov Reviewed-by: Simon Horman Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit 01abdcc5288f3bf3ea65378a4717138508b9c574 Author: Gustavo A. R. Silva Date: Thu Jul 5 10:00:09 2018 -0500 phy: qcom-usb-hs: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kishon Vijay Abraham I commit 8b1087fa3a272c962836ea0e9a8bba14b0ee0ee5 Author: Douglas Anderson Date: Fri Jul 6 16:31:42 2018 -0700 phy: qcom-qmp: Fix dts bindings to reflect reality A few patches have landed for the qcom-qmp PHY that affect how you would write a device tree node. ...yet the bindings weren't updated. Let's remedy the situation and make the bindings refelect reality. Fixes: efb05a50c956 ("phy: qcom-qmp: Add support for QMP V3 USB3 PHY") Fixes: ac0d239936bd ("phy: qcom-qmp: Add support for runtime PM") Signed-off-by: Douglas Anderson Signed-off-by: Kishon Vijay Abraham I commit 92696a89cd3f9c878182c00cae60fb7a0056cc30 Author: Ray Jui Date: Fri Jul 6 17:18:33 2018 -0700 phy: bcm-sr-pcie: Add Stingray PCIe PHY driver Add Stingray PCIe PHY driver for both PAXB and PAXC root complex Signed-off-by: Ray Jui Signed-off-by: Kishon Vijay Abraham I commit 95fb21253ea56d330053bafcf3cb502171551253 Author: Ray Jui Date: Fri Jul 6 17:18:32 2018 -0700 dt-bindings: phy: Add binding doc for Stingray PCIe PHY Add binding document for Stingray PCIe PHYs for both PAXB and PAXC based root complex Signed-off-by: Ray Jui Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit 5b9d2e8fb5fcb0e671994ce458d5d3e6221670af Author: Chunfeng Yun Date: Fri Jun 29 10:20:31 2018 +0800 MAINTAINERS: update files of MediaTek USB3 PHYs Update maintained files include MediaTek USB3 PHYs drivers and their bindings Signed-off-by: Chunfeng Yun Signed-off-by: Kishon Vijay Abraham I commit d4f97f10dac48bf49a199b826c3e8f1c4798bea2 Author: Chunfeng Yun Date: Fri Jun 29 10:20:30 2018 +0800 phy: phy-mtk-tphy: add property for BC12 Some platforms support BC12 which is disabled by default, here add a property to enable it if need Signed-off-by: Chunfeng Yun Signed-off-by: Kishon Vijay Abraham I commit 8158e917d91cb0be7e6177a7e839fcbb89d63867 Author: Chunfeng Yun Date: Fri Jun 29 10:20:29 2018 +0800 phy: phy-mtk-tphy: add properties for eye diagram test Add properties for Eye diagram test of HQA which sometimes need adjust some parameters of u2phy Signed-off-by: Chunfeng Yun Signed-off-by: Kishon Vijay Abraham I commit 8ccba47c699f82cb7b5f6bf24ffe6cd1d5c53381 Author: Chunfeng Yun Date: Fri Jun 29 10:20:28 2018 +0800 dt-bindings: phy-mtk-tphy: add optional properties for u2phy Add some optional properties for eye diagram test and BC12 of u2phy Signed-off-by: Chunfeng Yun Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit 3003cfa147e7626d26f6adae819380db600b7fd7 Author: Chunfeng Yun Date: Fri Jun 29 10:20:27 2018 +0800 phy: phy-mtk-tphy: use SPDX license tag Use SPDX-License-Identifier tag instead of the GPL license text Signed-off-by: Chunfeng Yun Signed-off-by: Kishon Vijay Abraham I commit 37070d6c940e582a39fd9287e06bb40b9f336184 Author: Arnd Bergmann Date: Mon Jul 9 17:19:02 2018 +0200 headers: fix linux/mod_devicetable.h inclusions A couple of drivers produced build errors after the mod_devicetable.h header was split out from the platform_device one, e.g. drivers/media/platform/davinci/vpbe_osd.c:42:40: error: array type has incomplete element type 'struct platform_device_id' drivers/media/platform/davinci/vpbe_venc.c:42:40: error: array type has incomplete element type 'struct platform_device_id' This adds the inclusion where needed. Fixes: ac3167257b9f ("headers: separate linux/mod_devicetable.h from linux/platform_device.h") Signed-off-by: Arnd Bergmann Acked-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman commit 8c5a916f4c8815196cc8a86b9582ca89422aac25 Author: Keerthy Date: Mon Jul 9 13:03:17 2018 +0530 ARM: OMAP2+: sleep33/43xx: Add RTC-Mode support Add support for RTC mode to low level suspend code. This includes providing the rtc base address for the assembly code to configuring the PMIC_PWR_EN line late in suspend to enter RTC+DDR mode. Note: This patch also fold in left out space parameter for am33xx_emif_sram_table and am43xx_emif_sram_table Signed-off-by: Dave Gerlach Signed-off-by: Keerthy Signed-off-by: Tony Lindgren commit 74655749a58405e259eaaba66bfc391fdbe1e34e Author: Dave Gerlach Date: Mon Jul 9 13:03:16 2018 +0530 ARM: OMAP2+: sleep33/43xx: Make sleep actions configurable Add an argument to the sleep33xx and sleep43xx code to allow us to set flags to determine which portions of the code get called in order to use the same code for multiple power saving modes. This patch allows us to decide whether or not we flush and disable caches, save EMIF context, put the memory into self refresh and disable the EMIF, and/or invoke the wkup_m3 when entering into WFI. Signed-off-by: Dave Gerlach Signed-off-by: Tero Kristo Signed-off-by: Keerthy Signed-off-by: Tony Lindgren commit eb07fe9f9f28d4ce441c5b51653d421725b0c998 Author: Andy Shevchenko Date: Mon Jul 9 10:23:41 2018 +0300 ARM: OMAP2+: reuse DEFINE_SHOW_ATTRIBUTE() macro Reuse DEFINE_SHOW_ATTRIBUTE() macro instead of open coding file operations followed by custom ->open() callbacks per each attribute. Signed-off-by: Andy Shevchenko Signed-off-by: Tony Lindgren commit 596e7955692b5d8b042fca500b7a83c25dfcf936 Author: Faiz Abbas Date: Mon Jul 9 22:18:39 2018 +0530 bus: ti-sysc: Add support for software reset Add support for the software reset of a target interconnect module using its sysconfig and sysstatus registers. Signed-off-by: Faiz Abbas [tony@atomide.com: updated to check if sysconfig exists] Signed-off-by: Tony Lindgren commit 7f35e63dbfcb627bd30bac45702ffdf1ddde1516 Author: Faiz Abbas Date: Mon Jul 9 22:18:38 2018 +0530 bus: ti-sysc: Add support for using ti-sysc for MCAN on dra76x The dra76x MCAN generic interconnect module has a its own format for the bits in the control registers. Therefore add a new module type, new regbits and new capabilities specific to the MCAN module. Acked-by: Rob Herring CC: Tony Lindgren Signed-off-by: Faiz Abbas Signed-off-by: Tony Lindgren commit 91c17a7006d2e8313afb9666f66313fdc992bfda Author: Faiz Abbas Date: Mon Jul 9 22:18:37 2018 +0530 clk: ti: dra7: Add clkctrl clock data for the mcan clocks Add clkctrl data for the m_can clocks and register it within the clkctrl driver Acked-by: Rob Herring Acked-by: Stephen Boyd CC: Tero Kristo Signed-off-by: Faiz Abbas Signed-off-by: Tony Lindgren commit 279ce5d117078ee8ea40c40199399889981fd808 Author: Hang Yuan Date: Mon Jul 9 18:24:10 2018 +0800 drm/i915/gvt: declare gvt as i915's soft dependency This helps initramfs builder and other tools to know the full dependencies of i915 and have gvt module loaded with i915. v2: add condition and change to pre-dependency (Chris) v3: move declaration to gvt.c. (Chris) v4: remove xengt (Zhenyu) Signed-off-by: Hang Yuan Reviewed-by: Chris Wilson Signed-off-by: Zhenyu Wang commit b861686b18538eaaf3530255eb37b4133146fbe2 Merge: 8038d2a9e6cd 9b07b287aa3e Author: Dave Airlie Date: Tue Jul 10 11:13:36 2018 +1000 Merge tag 'vmwgfx-next-4.19-3' of git://people.freedesktop.org/~thomash/linux into drm-next This introduces a header update and support for multisample surfaces. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/d020efb8-776d-5e8f-9d9f-122591e074d6@vmware.com commit 8038d2a9e6cde825be46359ad98a084da92294fe Merge: ba7ca97d73b4 812a954b787a Author: Dave Airlie Date: Tue Jul 10 11:05:46 2018 +1000 Merge tag 'vmwgfx-next-4.19-2' of git://people.freedesktop.org/~thomash/linux into drm-next A series of cleanups / reorganizations and modesetting changes that mostly target atomic state validation. [airlied: conflicts with SPDX stuff in amdgpu tree] Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/1a88485e-e509-b00e-8485-19194f074115@vmware.com commit 1e5d75843f57d8ec4f8b573e8b780269ceecf38e Author: Bartosz Golaszewski Date: Thu Jun 21 10:33:05 2018 +0200 powerpc/dts: Use a correct at24 compatible fallback in ac14xx Using 'at24' as fallback is now deprecated - use the full 'atmel,' string. Signed-off-by: Bartosz Golaszewski Signed-off-by: Michael Ellerman commit 6aeb43591f0dd75eea361d0517527d9e5397abe8 Author: Bartosz Golaszewski Date: Thu Jun 21 10:33:04 2018 +0200 powerpc/dts: Use 'atmel' as at24 manufacturer for kmcent2 Using compatible strings without the part for at24 is now deprecated. Use a correct 'atmel,' value. Signed-off-by: Bartosz Golaszewski Signed-off-by: Michael Ellerman commit 835b706bab95141e2663b046f2fc596169b57fa8 Author: Bartosz Golaszewski Date: Thu Jun 21 10:33:03 2018 +0200 powerpc/dts: Use 'atmel' as at24 manufacturer for pdm360ng Using 'at' as the part of the compatible string is now deprecated. Use a correct string: 'atmel,'. Signed-off-by: Bartosz Golaszewski Signed-off-by: Michael Ellerman commit ba7ca97d73b437eec883eba785495b8c9759b5f2 Merge: 61a3a9d6c9c9 43911fb68b19 Author: Dave Airlie Date: Tue Jul 10 10:57:02 2018 +1000 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next More features for 4.19: - Use core pcie functionality rather than duplicating our own for pcie gens and lanes - Scheduler function naming cleanups - More documentation - Reworked DC/Powerplay interfaces to improve power savings - Initial stutter mode support for RV (power feature) - Vega12 powerplay updates - GFXOFF fixes - Misc fixes Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180705221447.2807-1-alexander.deucher@amd.com commit 61a3a9d6c9c9a017decadb56669b66066612d728 Merge: 4da1d4c751c9 a132b5a5081c Author: Dave Airlie Date: Tue Jul 10 10:46:42 2018 +1000 Merge tag 'tilcdc-4.19' of https://github.com/jsarha/linux into drm-next tilcdc pull request for v4.19 Single fix to defer probing. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/a10f5b43-7711-6b80-1bc3-0dfce65c628f@ti.com commit 40291fb75123816b35ba06696e56b9cf2d96bf90 Merge: c474e9f2be99 413c94469a9d Author: Benson Leung Date: Mon Jul 9 16:36:00 2018 -0700 Merge tag 'ib-platform-chrome-mfd-move-cros-ec-transport-for-4.19' into working-branch-for-4.19 Immutable branch (mfd, chrome) due for the v4.19 window Immutable Branch which moves the cros_ec_i2c and cros_ec_spi transport drivers from mfd to platform/chrome. Changes in arm are a simple rename in defconfigs. Change in input is a rename in help text. commit 52b509218f0ab5946f9cbaf5501d88f69333f0e3 Author: Jesus Sanchez-Palencia Date: Mon Jul 9 16:20:56 2018 -0700 net: Use __u32 in uapi net_stamp.h We are not supposed to use u32 in uapi, so change the flags member of struct sock_txtime from u32 to __u32 instead. Fixes: 80b14dee2bea ("net: Add a new socket option for a future transmit time") Reported-by: Eric Dumazet Signed-off-by: Jesus Sanchez-Palencia Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 1497d2fd1bbb04beb795cc4c4f76fef7eb4c6061 Merge: eec4edc9ee08 a8b9f232ecd1 Author: David S. Miller Date: Mon Jul 9 16:24:18 2018 -0700 Merge branch 'mlxsw-More-Spectrum-2-preparations' aIdo Schimmel says: ==================== mlxsw: More Spectrum-2 preparations This is the second and last set of preparations towards initial Spectrum-2 support in mlxsw. It mainly re-arranges parts of the code that need to work with both ASICs, but somewhat differ. The first three patches allow different ASICs to register different set of operations for KVD linear (KVDL) management. In Spectrum-2 there is no linear memory and instead entries that reside there in Spectrum (e.g., nexthops) are hashed and inserted to the hash-based KVD memory. The fourth patch does a similar restructuring in the low-level multicast router code. This is necessary because multicast routing is implemented using regular circuit TCAM (C-TCAM) in Spectrum, whereas Spectrum-2 uses an algorithmic TCAM (A-TCAM). Next six patches prepare the ACL code for the introduction of A-TCAM in follow-up patch sets. Last two patches allow different ASICs to require different firmware versions and add two resources that need to be queried from firmware by Spectrum-2 specific code. ==================== Signed-off-by: David S. Miller commit a8b9f232ecd12ab85ed6772e6c16a5925224a8e4 Author: Jiri Pirko Date: Sun Jul 8 23:51:27 2018 +0300 mlxsw: resources: Add couple of Spectrum-2 KVD resources These resources are needed for Spectrum-2 KVD linear management implementation. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit abfd61825bdecd03249c833630b0f3c20efa7f26 Author: Jiri Pirko Date: Sun Jul 8 23:51:26 2018 +0300 mlxsw: spectrum: Prepare for multiple FW versions for Spectrum and Spectrum-2 Prepare for Spectrum-2 FW version checking and make mlxsw_sp_fw_rev_validate() per-ASIC as well as required FW revision and FW filename. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ea8b2e28aacfe8f36bacde944c04c5b909d0f364 Author: Jiri Pirko Date: Sun Jul 8 23:51:25 2018 +0300 mlxsw: spectrum_acl: Implement priority setting for rules inserted to TCAM For Spectrum-2, we need to insert priority to C-TCAM because HW needs that info in order to correctly process scenarios where rules are in both C-TCAM and A-TCAM. So extend the mlxsw_sp_acl_ctcam_entry_add() args to accept indication if priority needs to be filled up and implement the priority computation and fill-up. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 42df8358c3f9909eba8f09c83fbc1c6559ac43a3 Author: Jiri Pirko Date: Sun Jul 8 23:51:24 2018 +0300 mlxsw: reg: Add priority field for PTCEV2 register This is going to be needed for Spectrum-2 C-TCAM implementation. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a5995cc801f9b6a66af1d20b2025ff0c20a4c0bf Author: Jiri Pirko Date: Sun Jul 8 23:51:23 2018 +0300 mlxsw: spectrum_acl: Move block items encoding into Spectrum op Since Spectrum-2 encodes blocks into different HW layout, push this code into Spectrum-specific op. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c17d20838eff75caf14a25cf7bf2a532fa360820 Author: Jiri Pirko Date: Sun Jul 8 23:51:22 2018 +0300 mlxsw: spectrum_acl: Convert mlxsw_afk_create args to ops Since the flex keys for Spectrum-2 differ not only in blocks definitions but also in encoding layout, prepare for the implementation and pass Spectrum/Spectrum-2 specific ops down to mlxsw_afk_create. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit bab5c1cfb7a80dd4e8a0c248cf9c31dd414c1391 Author: Jiri Pirko Date: Sun Jul 8 23:51:21 2018 +0300 mlxsw: spectrum_acl: Add tcam init/fini ops Add ops to be called on driver instance init and fini. This is needed in order to be possible to do Spectrum-2 specific init and fini work. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 64eccd0066775aaf7442761413b3cac137c00ced Author: Jiri Pirko Date: Sun Jul 8 23:51:20 2018 +0300 mlxsw: spectrum_acl: Split TCAM handling 3 ways To allow easy and clean Spectrum-2 implementation for things that differ from Spectrum, split the existing ACL TCAM code 3 ways: 1) common code that calls Spectrum/Spectrum-2 specific ops 2) Spectrum ops implementations 3) common C-TCAM code that is going to be shared between Spectrum and Spectrum-2 implementations Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 8fae4392d4ad8bea3a60829ff71b0735abc307c1 Author: Jiri Pirko Date: Sun Jul 8 23:51:19 2018 +0300 mlxsw: spectrum_mr_tcam: Push Spectrum-specific operations into a separate file Since Spectrum-2 has different handling of TCAM, push Spectrum MR TCAM bits to a separate file accessible by ops which allows to implement Spectrum-2 specific ops. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0304c00546fce74028ce5e3ea5990e784c67a8a3 Author: Jiri Pirko Date: Sun Jul 8 23:51:18 2018 +0300 mlxsw: spectrum_kvdl: Pass entry_count to free function For the Spectrum-2 KVD linear manager implementation, entry_count will be needed even for the free function. So pass it down. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 4b6b18692aec205b98dd333938b714af9d7aefe1 Author: Jiri Pirko Date: Sun Jul 8 23:51:17 2018 +0300 mlxsw: spectrum_kvdl: Pass entry type to alloc/free Future Spectrum-2 KVD linear manager implementation needs to know type of the entry to alloc and free. So define the types in an enum and pass it down to alloc and free functions. Once the entry type is passed down, KVDL common part knows sizes of each entry types, so replace size function arg with entry count. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ebcff74386e6fbfe1d5dc406b99db63481f9c2c7 Author: Jiri Pirko Date: Sun Jul 8 23:51:16 2018 +0300 mlxsw: spectrum_kvdl: Push out KVD linear management into ops In Spectrum-2 there is a different implementation of KVD linear management. Unlike in Spectrum where there is a single index space, in Spectrum-2 the indexes are per-resource. Also there is need to explicitly tell HW that an entry is no longer used. So push out the existing implementation into spectrum1_kvdl.c and prepare ops infrastructure to allow new implementation in a follow-up. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit eec4edc9ee08fe5c2f219b4fab7aed71b409e196 Author: Kees Cook Date: Wed Jul 4 10:28:47 2018 -0700 net/mlx5: Use 2-factor allocator calls This restores the use of 2-factor allocation helpers that were already fixed treewide. Please do not use open-coded multiplication; prefer, instead, using 2-factor allocation helpers. Signed-off-by: Kees Cook Reviewed-by: Leon Romanovsky Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller commit 95765a6ca1288121ddcbf07cd60ec65341829ddc Author: Julian Wiedmann Date: Mon Jul 9 09:45:14 2018 +0200 tcp: remove SG-related comment in tcp_sendmsg() Since commit 74d4a8f8d378 ("tcp: remove sk_can_gso() use"), the code doesn't care whether the interface supports SG. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller commit 82edc7e8b8c06151bdc653935bc13b83e2f0fcfa Author: Rodrigo Vivi Date: Mon Jul 9 15:39:27 2018 -0700 drm/i915: Update DRIVER_DATE to 20180709 Signed-off-by: Rodrigo Vivi commit 863f4fdb715c3328d4ff1ed547c5508c8e6e2b06 Merge: c47078d6a33f 9af86f933894 Author: David S. Miller Date: Mon Jul 9 14:55:54 2018 -0700 Merge branch 'fix-use-after-free-bugs-in-skb-list-processing' Edward Cree says: ==================== fix use-after-free bugs in skb list processing A couple of bugs in skb list handling were spotted by Dan Carpenter, with the help of Smatch; following up on them I found a couple more similar cases. This series fixes them by changing the relevant loops to use the dequeue-enqueue model (rather than in-place list modification). v3: fixed another similar bug in __netif_receive_skb_list_core(). v2: dropped patch #3 (new list.h helper), per DaveM's request. ==================== Signed-off-by: David S. Miller commit 9af86f9338949a9369bda5e6fed69347d1813054 Author: Edward Cree Date: Mon Jul 9 18:10:19 2018 +0100 net: core: fix use-after-free in __netif_receive_skb_list_core __netif_receive_skb_core can free the skb, so we have to use the dequeue- enqueue model when calling it from __netif_receive_skb_list_core. Fixes: 88eb1944e18c ("net: core: propagate SKB lists through packet_type lookup") Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 9f17dbf04ddf55ae48f5bbafea4c4920ea943215 Author: Edward Cree Date: Mon Jul 9 18:10:02 2018 +0100 netfilter: fix use-after-free in NF_HOOK_LIST nf_hook() can free the skb, so we need to remove it from the list before calling, and add passed skbs to a sublist afterwards. Fixes: 17266ee93984 ("net: ipv4: listified version of ip_rcv") Reported-by: Dan Carpenter Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 8c057efaebb557b60ba514b5e39e8000a1eab0f1 Author: Edward Cree Date: Mon Jul 9 18:09:54 2018 +0100 net: core: fix uses-after-free in list processing In netif_receive_skb_list_internal(), all of skb_defer_rx_timestamp(), do_xdp_generic() and enqueue_to_backlog() can lead to kfree(skb). Thus, we cannot wait until after they return to remove the skb from the list; instead, we remove it first and, in the pass case, add it to a sublist afterwards. In the case of enqueue_to_backlog() we have already decided not to pass when we call the function, so we do not need a sublist. Fixes: 7da517a3bc52 ("net: core: Another step of skb receive list processing") Reported-by: Dan Carpenter Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 3fda24324582ae790961137ecb88b3f0f2feb1f0 Author: Kamal Heib Date: Mon Jul 9 22:21:03 2018 +0300 RDMA/ipoib: Fix return code from ipoib_cm_dev_init The proper return code is -EOPNOTSUPP and not -ENOSYS when the function isn't supported, also make sure to return the right error code from ipoib_transport_dev_init() when ipoib_cm_dev_init() is supported. Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 07e7056aff6c4377667fe1606ae7707b375b1caa Author: Parav Pandit Date: Sun Jul 8 13:41:17 2018 +0300 IB/core: Simplify check for RoCE route resolve roce_resolve_route_from_path() resolves the route based on the netdevice of the GID attribute, therefore there is no point in checking again if the route is resolved matches the same interface it arrived. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8ec56fc3c5ee6f9700adac190e9ce5b8859a58b6 Author: Alexander Duyck Date: Mon Jul 9 12:20:04 2018 -0400 net: allow fallback function to pass netdev For most of these calls we can just pass NULL through to the fallback function as the sb_dev. The only cases where we cannot are the cases where we might be dealing with either an upper device or a driver that would have configured things to support an sb_dev itself. The only driver that has any significant change in this patch set should be ixgbe as we can drop the redundant functionality that existed in both the ndo_select_queue function and the fallback function that was passed through to us. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 4f49dec9075aa0277b8c9c657ec31e6361f88724 Author: Alexander Duyck Date: Mon Jul 9 12:19:59 2018 -0400 net: allow ndo_select_queue to pass netdev This patch makes it so that instead of passing a void pointer as the accel_priv we instead pass a net_device pointer as sb_dev. Making this change allows us to pass the subordinate device through to the fallback function eventually so that we can keep the actual code in the ndo_select_queue call as focused on possible on the exception cases. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit a4ea8a3dacc312c3402c78f6e4843afdda9b43a0 Author: Alexander Duyck Date: Mon Jul 9 12:19:54 2018 -0400 net: Add generic ndo_select_queue functions This patch adds a generic version of the ndo_select_queue functions for either returning 0 or selecting a queue based on the processor ID. This is generally meant to just reduce the number of functions we have to change in the future when we have to deal with ndo_select_queue changes. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit eadec877ce9ca46a94e9036b5a44e7941d4fc501 Author: Alexander Duyck Date: Mon Jul 9 12:19:48 2018 -0400 net: Add support for subordinate traffic classes to netdev_pick_tx This change makes it so that we can support the concept of subordinate device traffic classes to the core networking code. In doing this we can start pulling out the driver specific bits needed to support selecting a queue based on an upper device. The solution at is currently stands is only partially implemented. I have the start of some XPS bits in here, but I would still need to allow for configuration of the XPS maps on the queues reserved for the subordinate devices. For now I am using the reference to the sb_dev XPS map as just a way to skip the lookup of the lower device XPS map for now as that would result in the wrong queue being picked. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 921c0f5ba58e4064deb18b4985a202508fc5527f Author: Parav Pandit Date: Sun Jul 8 13:40:30 2018 +0300 IB/mlx5: Honor cnt_set_id_valid flag instead of set_id It is incorrect to depend on set_id value to know if counters were allocated or not. set_id_valid field is set to true when counters were allocated. Therefore, use set_id_valid while deciding to free counters. Cc: # 4.15 Fixes: aac4492ef23a ("IB/mlx5: Update counter implementation for dual port RoCE") Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 58b0b3ed4c226f62fcdf82df366d644b7a2226ca Author: Alexander Duyck Date: Mon Jul 9 12:19:43 2018 -0400 ixgbe: Add code to populate and use macvlan TC to Tx queue map This patch makes it so that we use the tc_to_txq mapping in the macvlan device in order to select the Tx queue for outgoing packets. The idea here is to try and move away from using ixgbe_select_queue and to come up with a generic way to make this work for devices going forward. By encoding this information in the netdev this can become something that can be used generically as a solution for similar setups going forward. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit e3f1ed1f5ade66620ea727bdbd5a5e0091108a92 Author: Leon Romanovsky Date: Sun Jul 8 12:55:43 2018 +0300 RDMA/mlx5: Remove unused port number parameter Clean up a little bit code to drop unused port_num parameter. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 97202bbe22f8f0c225ba63a50acaf56d6796c990 Author: Jason Gunthorpe Date: Fri Jul 6 11:42:03 2018 -0600 IB/uverbs: Do not use uverbs_cmd_mask in the ioctl path Instead we are now checking the function pointers directly. Get rid of both cases in ioctl and drop the nonsense idea that destroy can fail. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky commit 60e6627f12a78203a093ca05b7bca15627747d81 Author: Jann Horn Date: Fri Jul 6 22:48:03 2018 +0200 IB/mlx5: fix uaccess beyond "count" in debugfs read/write handlers In general, accessing userspace memory beyond the length of the supplied buffer in VFS read/write handlers can lead to both kernel memory corruption (via kernel_read()/kernel_write(), which can e.g. be triggered via sys_splice()) and privilege escalation inside userspace. In this case, the affected files are in debugfs (and should therefore only be accessible to root), and the read handlers check that *pos is zero (meaning that at least sys_splice() can't trigger kernel memory corruption). Because of the root requirement, this is not a security fix, but rather a cleanup. For the read handlers, fix it by using simple_read_from_buffer() instead of custom logic. Add min() calls to the write handlers. Fixes: 4a2da0b8c078 ("IB/mlx5: Add debug control parameters for congestion control") Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Jann Horn Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ffcfe25bb50f27395e15fa999f1a7eb769f55360 Author: Alexander Duyck Date: Mon Jul 9 12:19:38 2018 -0400 net: Add support for subordinate device traffic classes This patch is meant to provide the basic tools needed to allow us to create subordinate device traffic classes. The general idea here is to allow subdividing the queues of a device into queue groups accessible through an upper device such as a macvlan. The idea here is to enforce the idea that an upper device has to be a single queue device, ideally with IFF_NO_QUQUE set. With that being the case we can pretty much guarantee that the tc_to_txq mappings and XPS maps for the upper device are unused. As such we could reuse those in order to support subdividing the lower device and distributing those queues between the subordinate devices. In order to distinguish between a regular set of traffic classes and if a device is carrying subordinate traffic classes I changed num_tc from a u8 to a s16 value and use the negative values to represent the subordinate pool values. So starting at -1 and running to -32768 we can encode those as pool values, and the existing values of 0 to 15 can be maintained. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 222c7b1fd4dcc596e4a21dc93f49d9c976f7e314 Author: Bart Van Assche Date: Fri Jul 6 14:27:42 2018 -0700 RDMA/rw: Fix rdma_rw_ctx_signature_init() kernel-doc header Fixes: 0e353e34e1e7 ("IB/core: add RW API support for signature MRs") Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Signed-off-by: Jason Gunthorpe commit 4ab39e2f98f2f49e97c8dd8e239697bd0bab8103 Author: Bart Van Assche Date: Fri Jul 6 10:28:27 2018 -0700 RDMA/cxgb4: Make c4iw_poll_cq_one() easier to analyze Introduce the function __c4iw_poll_cq_one() such that c4iw_poll_cq_one() becomes easier to analyze for static source code analyzers. This patch avoids that sparse reports the following: drivers/infiniband/hw/cxgb4/cq.c:401:36: warning: context imbalance in 'c4iw_flush_hw_cq' - unexpected unlock drivers/infiniband/hw/cxgb4/cq.c:824:9: warning: context imbalance in 'c4iw_poll_cq_one' - different lock contexts for basic block Compile-tested only. Signed-off-by: Bart Van Assche Cc: Steve Wise Acked-by: Steve Wise Signed-off-by: Jason Gunthorpe commit cbd8e988eb94ee54d890c103b4947bf4a8839fae Author: Bart Van Assche Date: Fri Jul 6 10:27:06 2018 -0700 RDMA/cxgb3: Make iwch_poll_cq_one() easier to analyze Introduce the function __iwch_poll_cq_one() to make iwch_poll_cq_one() easier to analyze for static source code analyzers. This patch avoids that sparse reports the following: drivers/infiniband/hw/cxgb3/iwch_cq.c:187:9: warning: context imbalance in 'iwch_poll_cq_one' - different lock contexts for basic block Compile-tested only. Signed-off-by: Bart Van Assche Cc: Steve Wise Acked-by: Steve Wise Signed-off-by: Jason Gunthorpe commit 2f229bcf25ca076e8d8f46b9b3dccad5751040d2 Author: Bart Van Assche Date: Fri Jul 6 09:45:32 2018 -0700 RDMA/rxe: Simplify the error handling code in rxe_create_ah() This patch not only simplifies the error handling code in rxe_create_ah() but also removes the dead code that was left behind by commit 47ec38666210 ("RDMA: Convert drivers to use sgid_attr instead of sgid_index"). Signed-off-by: Bart Van Assche Reviewed-by: Parav Pandit Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d7be97756f8a4874ac17003de5843c742dd84153 Author: Alexander Duyck Date: Mon Jul 9 12:19:32 2018 -0400 net-sysfs: Drop support for XPS and traffic_class on single queue device This patch makes it so that we do not report the traffic class or allow XPS configuration on single queue devices. This is mostly to avoid unnecessary complexity with changes I have planned that will allow us to reuse the unused tc_to_txq and XPS configuration on a single queue device to allow it to make use of a subset of queues on an underlying device. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 4d58e7034d1971436d44f203cf69d2feb6b82e5c Author: Arnd Bergmann Date: Fri Jul 6 14:48:47 2018 +0200 ARM: module: fix modsign build error The asm/module.h header file can not be included standalone, which breaks the module signing code after a recent change: In file included from kernel/module-internal.h:13, from kernel/module_signing.c:17: arch/arm/include/asm/module.h:37:27: error: 'struct module' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val); This adds a forward declaration of struct module to make it all work. Fixes: f314dfea16a0 ("modsign: log module name in the event of an error") Signed-off-by: Arnd Bergmann Acked-by: Russell King Signed-off-by: Jessica Yu commit efdbda81d910d8fafcd25e556b8a5722b836e162 Author: Bart Van Assche Date: Thu Jul 5 16:02:00 2018 -0700 IB/iser: Remove set-but-not-used variables This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit aa9d5ffbb72746dd1de9d92be7e8b437c41cf0a3 Author: Bart Van Assche Date: Thu Jul 5 10:52:25 2018 -0700 RDMA/ocrdma: Remove a set-but-not-used variable Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 4c5743bc4fe3233cecc1c184a773c79c8ee45bbe Author: Bart Van Assche Date: Thu Jul 5 10:51:35 2018 -0700 IB/nes: Fix a compiler warning Avoid that the following compiler warning is reported when building with W=1: drivers/infiniband/hw/nes/nes_hw.c:646:51: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit f8c2d2280cf67cd85cff6b42c989bbf1c7d0af61 Author: Bart Van Assche Date: Thu Jul 5 10:51:03 2018 -0700 RDMA/core: Remove set-but-not-used variables Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 28e39894ed4fecd19956ae672a312f65419bd703 Author: Bart Van Assche Date: Thu Jul 5 09:38:38 2018 -0700 RDMA/core: Remove ib_find_cached_gid() and ib_find_cached_gid_by_port() Remove these two functions since all their callers have been removed. See also commit ea8c2d8f6014 ("RDMA/core: Remove unused ib cache functions"). Signed-off-by: Bart Van Assche Reviewed-by: Parav Pandit Signed-off-by: Jason Gunthorpe commit b1b639708f7431c85df4f70ae0d82c336705d7d4 Author: Kamal Heib Date: Thu Jul 5 00:52:51 2018 +0300 RDMA/ipoib: Fix use of sizeof() Make sure to use sizeof(...) instead of sizeof ... which is more preferred. Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0578cdad190b19b23965cb05aebaf2aeb4b6b7e5 Author: Kamal Heib Date: Thu Jul 5 00:52:48 2018 +0300 RDMA/ipoib: Prefer unsigned int to bare use of unsigned This commit replaces all the unsigned definitions in favour of 'unsigned int' which is preferred. Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 299c36b1efe7a34ff255788592d835e913163a4d Author: Kamal Heib Date: Thu Jul 5 00:52:47 2018 +0300 RDMA/ipoib: Use min_t() macro instead of min() Use min_t() macro to avoid the casting when using min() macro, also fix the type of "length" and "wc->byte_len" to be "unsigned int" and "u32" which is the right type for each one of them. Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5773898b3b32f0e66059031afca5406702e89f9d Merge: a334e45dcbff a1547e0bca51 Author: Florian Fainelli Date: Mon Jul 9 05:22:16 2018 -0700 Merge tag 'bcm2835-drivers-next-2018-07-03' into drivers/next This pull request brings in the new HWMON driver for getting under-voltage detection from the Raspberry Pi firmware, and a change from Kees to remove another instance of VLA stack usage. Signed-off-by: Florian Fainelli commit a1547e0bca519b92b09ac5530c6accb7c3f69d1a Author: Kees Cook Date: Fri Jun 29 11:44:50 2018 -0700 firmware: raspberrypi: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this removes the VLA in favor of a maximum size and adds a sanity check. Existing callers of the firmware interface never need more than 24 bytes (struct gpio_set_config). This chooses 32 just to stay ahead of future growth. v2: Fix the length passed to rpi_firmware_property_list (by anholt, acked by Kees). [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 70eea1bbb5561154e62b322904b685acb0e52d3e Author: Stefan Wahren Date: Fri May 25 21:24:36 2018 +0200 firmware: raspberrypi: Register hwmon driver Since the raspberrypi-hwmon driver is tied to the VC4 firmware instead of particular hardware its registration should be in the firmware driver. Signed-off-by: Stefan Wahren Signed-off-by: Eric Anholt commit 74d1e007915fab590f8be9dc647b19511260210c Author: Stefan Wahren Date: Fri May 25 21:24:35 2018 +0200 hwmon: Add support for RPi voltage sensor Currently there is no easy way to detect undervoltage conditions on a remote Raspberry Pi. This hwmon driver retrieves the state of the undervoltage sensor via mailbox interface. The handling based on Noralf's modifications to the downstream firmware driver. In case of an undervoltage condition only an entry is written to the kernel log. CC: "Noralf Trønnes" Signed-off-by: Stefan Wahren Signed-off-by: Eric Anholt Acked-by: Guenter Roeck commit 163efb68d110d392b54e078ca041f24a4ea7d022 Author: Ray Jui Date: Mon May 28 11:01:37 2018 -0700 arm64: defconfig: add CONFIG_ARM_SP805_WATCHDOG Enable the SP805 watchdog timer Signed-off-by: Ray Jui Signed-off-by: Florian Fainelli commit 71e962a0c2d0646cc20f9a02e713fb5e01ea2756 Author: Ray Jui Date: Mon May 28 11:01:36 2018 -0700 arm64: dts: set initial SR watchdog timeout to 60 seconds Set initial Stingray watchdog timeout to 60 seconds By the time when the userspace watchdog daemon is ready and taking control over, the watchdog timeout will then be reset to what's configured in the daemon. Signed-off-by: Ray Jui Reviewed-by: Vladimir Olovyannikov Reviewed-by: Scott Branden Signed-off-by: Florian Fainelli commit 87a37ce9e400e40daee537ff95343e3c94743c6d Author: Håkon Bugge Date: Wed Jul 4 12:48:01 2018 +0200 IB/cm: Remove unused and erroneous msg sequence encoding In cm_form_tid(), a two bit message sequence number is OR'ed into bit 31-30 of the lower TID value. After commit f06d26537559 ("IB/cm: Randomize starting comm ID"), the local_id is XOR'ed with a 32-bit random value. Hence, bit 31-30 in the lower TID now has an arbitrarily value and it makes no sense to OR in the message sequence number. Adding to that, the evolution in use of IDR routines in cm_alloc_id() has always had the possibility of returning a value with bit 30 set. In addition, said bits are never checked. Hence, remove the encoding and the corresponding enum. Signed-off-by: Håkon Bugge Signed-off-by: Jason Gunthorpe commit 90ec93cb6bca598357d001dc9ea3e5bcb2465303 Author: Benjamin Gaignard Date: Fri Jul 6 15:02:20 2018 +0200 dmaengine: stm32: replace "%p" with "%pK" The format specifier "%p" can leak kernel addresses. Use "%pK" instead. Signed-off-by: Benjamin Gaignard Signed-off-by: Vinod Koul commit d8095f94e19581057bcad35b8a725aa739e77595 Author: Marek Szyprowski Date: Mon Jul 2 15:08:10 2018 +0200 dmaengine: add support for reporting pause and resume separately 'cmd_pause' DMA channel capability means that respective DMA engine supports both pausing and resuming given DMA channel. However, in some cases it is important to know if DMA channel can be paused without the need to resume it. This is a typical requirement for proper residue reading on transfer timeout in UART drivers. There are also some DMA engines with limited hardware, which doesn't really support resuming. Reporting pause and resume capabilities separately allows UART drivers to properly check for the really required capabilities and operate in DMA mode also in systems with limited DMA hardware. On the other hand drivers, which rely on full channel suspend/resume support, should now check for both 'pause' and 'resume' features. Existing clients of dma_get_slave_caps() have been checked and the only driver which rely on proper channel resuming is soc-generic-dmaengine-pcm driver, which has been updated to check the newly added capability. Existing 'cmd_pause' now only indicates that DMA engine support pausing given DMA channel. Signed-off-by: Marek Szyprowski Acked-by: Mark Brown Signed-off-by: Vinod Koul commit 76bc79ccceea09a19f681dff7fd633fb8fb95c79 Author: Jason Gunthorpe Date: Fri Jul 6 11:40:39 2018 -0600 IB/uverbs: Replace ib_ucq_object uverbs_file with the one in ib_uobject Now that ib_uobject has a ib_uverbs_file we don't need this extra one in ib_ucq_object. Signed-off-by: Jason Gunthorpe commit d0259e82e7d214340aed33732e9a5ce448564921 Author: Jason Gunthorpe Date: Wed Jul 4 11:32:11 2018 +0300 IB/uverbs: Remove ib_uobject_file The only purpose for this structure was to hold the ib_uobject_file pointer, but now that is part of the standard ib_uobject the structure no longer makes any sense, so get rid of it. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 6f258884ddac5195e76dc916ff5a3965db7836aa Author: Jason Gunthorpe Date: Wed Jul 4 11:32:10 2018 +0300 IB/uverbs: Tidy up remaining references to ucontext Unnecessary clutter, to indirect through ucontext when the ufile would do. Generally most of the code code should only be working with ufile, except for a few places that touch the driver interface. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 2cc1e3b80942a7de7dce81f8a86c27a4ba3a695e Author: Jason Gunthorpe Date: Wed Jul 4 11:32:09 2018 +0300 IB/uverbs: Replace file->ucontext with file in uverbs_cmd.c The ucontext isn't needed any more, just pass the uverbs_file directly. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 6ef1c82821b2ae9bfa26fe65e6f0a66dfd79b7d7 Author: Jason Gunthorpe Date: Wed Jul 4 11:32:08 2018 +0300 IB/uverbs: Replace ib_ucontext with ib_uverbs_file in core function calls The correct handle to refer to the idr/etc is ib_uverbs_file, revise all the core APIs to use this instead. The user API are left as wrappers that automatically convert a ucontext to a ufile for now. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 6a5e9c88419828a487204e35291ae4459697a9bd Author: Jason Gunthorpe Date: Wed Jul 4 11:32:07 2018 +0300 IB/uverbs: Move non driver related elements from ib_ucontext to ib_ufile The IDR is part of the ib_ufile so all the machinery to lock it, handle closing and disassociation rightly belongs to the ufile not the ucontext. This changes the lifetime of that data to match the lifetime of the file descriptor which is always strictly longer than the lifetime of the ucontext. We need the entire locking machinery to continue to exist after ucontext destruction to allow us to return the destroy data after a device has been disassociated. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit c33e73af2183fb9fcd993e37abcdecc058b22d91 Author: Jason Gunthorpe Date: Wed Jul 4 11:32:06 2018 +0300 IB/uverbs: Add a uobj_perform_destroy helper This consolidates a bunch of repeated code patterns into a helper. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit e189624916961c735c18e3c75acc478661403830 Author: Lorenzo Pieralisi Date: Mon Jun 25 14:05:52 2018 +0100 arm64: numa: rework ACPI NUMA initialization Current ACPI ARM64 NUMA initialization code in acpi_numa_gicc_affinity_init() carries out NUMA nodes creation and cpu<->node mappings at the same time in the arch backend so that a single SRAT walk is needed to parse both pieces of information. This implies that the cpu<->node mappings must be stashed in an array (sized NR_CPUS) so that SMP code can later use the stashed values to avoid another SRAT table walk to set-up the early cpu<->node mappings. If the kernel is configured with a NR_CPUS value less than the actual processor entries in the SRAT (and MADT), the logic in acpi_numa_gicc_affinity_init() is broken in that the cpu<->node mapping is only carried out (and stashed for future use) only for a number of SRAT entries up to NR_CPUS, which do not necessarily correspond to the possible cpus detected at SMP initialization in acpi_map_gic_cpu_interface() (ie MADT and SRAT processor entries order is not enforced), which leaves the kernel with broken cpu<->node mappings. Furthermore, given the current ACPI NUMA code parsing logic in acpi_numa_gicc_affinity_init(), PXM domains for CPUs that are not parsed because they exceed NR_CPUS entries are not mapped to NUMA nodes (ie the PXM corresponding node is not created in the kernel) leaving the system with a broken NUMA topology. Rework the ACPI ARM64 NUMA initialization process so that the NUMA nodes creation and cpu<->node mappings are decoupled. cpu<->node mappings are moved to SMP initialization code (where they are needed), at the cost of an extra SRAT walk so that ACPI NUMA mappings can be batched before being applied, fixing current parsing pitfalls. Acked-by: Hanjun Guo Tested-by: John Garry Fixes: d8b47fca8c23 ("arm64, ACPI, NUMA: NUMA support based on SRAT and SLIT") Link: http://lkml.kernel.org/r/1527768879-88161-2-git-send-email-xiexiuqi@huawei.com Reported-by: Xie XiuQi Signed-off-by: Lorenzo Pieralisi Cc: Punit Agrawal Cc: Jonathan Cameron Cc: Will Deacon Cc: Hanjun Guo Cc: Ganapatrao Kulkarni Cc: Jeremy Linton Cc: Catalin Marinas Cc: Xie XiuQi Signed-off-by: Will Deacon commit c99d64d8322043a3a67f62bb03f6b70ef99138c9 Author: shenwei.wang@nxp.com Date: Fri Jun 8 14:22:37 2018 -0500 dt-bindings: pwm: fsl-ftm: Add compatible string for i.MX8QM i.MX8QM integrates a new version of FTM IP block. It adds eight PWM enable bits in FTM_SC register. Add a new compatible string of "fsl,imx8qm-ftm-pwm" for i.MX8QM to differentiate it from the previous SoCs. Signed-off-by: Shenwei Wang Signed-off-by: Thierry Reding commit 2c4f2e326bd4d02f4b30d58f35448575573d5a04 Author: shenwei.wang@nxp.com Date: Fri Jun 8 14:22:36 2018 -0500 pwm: fsl-ftm: Enable support for the new SoC i.MX8QM Enabled the support for the new SoC i.MX8QM by adding the compatible string of "fsl,imx8qm-ftm-pwm" and its per-compatible data with setting "has_enable_bits" to "true". Signed-off-by: Shenwei Wang Signed-off-by: Thierry Reding commit db6c51ab156a2ec29edff41b1ebc1fe7d04a9614 Author: shenwei.wang@nxp.com Date: Fri Jun 8 14:22:35 2018 -0500 pwm: fsl-ftm: Added the support of per-compatible data On the i.MX8x SoC family, an additional PWM enable bit is added for each PWM channel in the register FTM_SC[23:16]. It supports 8 channels. Bit 16 is for channel 0, and bit 23 is for channel 7. As the IP version information can not be obtained via any of the FTM registers, a property of "has_enable_bits" is added via per-compatible data structure. Signed-off-by: Shenwei Wang Signed-off-by: Thierry Reding commit 82a9c55a2bb0a47b16c75e93d8ce54e8944758c0 Author: shenwei.wang@nxp.com Date: Fri Jun 8 14:22:34 2018 -0500 pwm: fsl-ftm: Added a dedicated IP interface clock The current driver assumes that the ftm_sys clock works as one of the clock sources for the IP block as well as the IP interface clock. This assumption does not apply any more on the latest i.MX8x SoC family. On i.MX8x SoCs, a dedicated IP interface clock is introduced and it must be enabled before accessing any FTM registers. Moreover, the clock can not be used as the source clock for the FTM IP block. This patch introduces the ipg_clk as the dedicated IP interface clock and by default it is the same as the ftm_sys clock if not specified. Signed-off-by: Shenwei Wang Signed-off-by: Thierry Reding commit 4964cb52b27a834ce22e515007a74ba74886074a Author: Enric Balletbo i Serra Date: Tue Jun 5 19:54:27 2018 +0200 pwm: cros-ec: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Thierry Reding commit a99290c5868a6450c299708ba0c7993affa911ed Author: Fabio Estevam Date: Fri Jul 6 19:47:17 2018 -0300 pwm: imx: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Thierry Reding commit 38dabd91ff0bde33352ca3cc65ef515599b77a05 Author: Vignesh R Date: Mon Jun 11 11:39:56 2018 +0530 pwm: tiehrpwm: Fix disabling of output of PWMs pwm-tiehrpwm driver disables PWM output by putting it in low output state via active AQCSFRC register in ehrpwm_pwm_disable(). But, the AQCSFRC shadow register is not updated. Therefore, when shadow AQCSFRC register is re-enabled in ehrpwm_pwm_enable() (say to enable second PWM output), previous settings are lost as shadow register value is loaded into active register. This results in things like PWMA getting enabled automatically, when PWMB is enabled and vice versa. Fix this by updating AQCSFRC shadow register as well during ehrpwm_pwm_disable(). Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM") Cc: stable@vger.kernel.org Signed-off-by: Vignesh R Signed-off-by: Thierry Reding commit aa49d628f6e016bcec8c6f8e704b9b18ee697329 Author: Vignesh R Date: Mon Jun 11 11:39:55 2018 +0530 pwm: tiehrpwm: Don't use emulation mode bits to control PWM output As per AM335x TRM SPRUH73P "15.2.2.11 ePWM Behavior During Emulation", TBCTL[15:14] only have effect during emulation suspend events (IOW, to stop PWM when debugging using a debugger). These bits have no effect on PWM output during normal running of system. Hence, remove code accessing these bits as they have no role in enabling/disabling PWMs. Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM") Cc: stable@vger.kernel.org Signed-off-by: Vignesh R Signed-off-by: Thierry Reding commit 4de445cb431eb4b473936396436d819a0724735c Author: Thomas Hebb Date: Wed Jun 6 13:42:10 2018 -0400 pwm: berlin: Don't use broken prescaler values The Berlin PWM driver is currently broken on at least BG2CD. The symptoms manifest as a very non-linear and erratic mapping from the duty cycle configured in software to the duty cycle produced by hardware. The cause of the bug is software's configuration of the prescaler, and in particular its usage of the six prescaler values between the minimum value of 1 and the maximum value of 4096. As it turns out, these six values do not actually slow down the PWM clock; rather, they emulate slowing down the clock by internally multiplying the value of TCNT. This would be a fine trick, if not for the fact that the internal, scaled TCNT value has no extra bits beyond the 16 already exposed to software in the register. What this means is that, for a prescaler of 4, the software must ensure that the top two bits of TCNT are not set, because hardware will chop them off; for a prescaler of 8, the top three bits must not be set, and so forth. Software does not currently ensure this, resulting in a TCNT several orders of magnitude lower than intended any time one of those six prescalers are selected. Because hardware chops off the high bits in its internal shift, the middle six prescalers don't actually allow *anything* that the first doesn't. In fact, they are strictly worse than the first, since the internal shift of TCNT prevents software from setting the low bits, decreasing the resolution, without providing any extra high bits. By skipping the useless prescalers entirely, this patch both fixes the driver's behavior and increases its performance (since, when the 4096 prescaler is selected, it now does only a single shift rather than the seven successive divisions it did before). Tested on BG2CD. Signed-off-by: Thomas Hebb Signed-off-by: Thierry Reding commit 30343897d8fd84c630ee2c7f5b38c16da2c7ee4b Author: Oleksij Rempel Date: Fri Jun 15 11:51:04 2018 +0200 clk: imx7d: add IMX7D_MU_ROOT_CLK This clock is needed for iMX mailbox driver Signed-off-by: Oleksij Rempel Reviewed-by: Dong Aisheng Reviewed-by: Fabio Estevam Signed-off-by: Stephen Boyd commit e919417bd6468b7f1b2899200a78f1ad078757d3 Author: Kuninori Morimoto Date: Tue Jul 3 00:29:29 2018 +0000 dmaengine: rcar-dmac: clear channel register when error We need to clear channel register in error case as recovery. The channel is already stopped in such case, thus we don't need to call rcar_dmac_chan_halt() before clearing. rcar_dmac_chan_halt() will clear and confirm DE bit. But it will be failed because channel is already stopped in error case. In other words, we shouldn't call it then. Reported-by: Hiroki Negishi Signed-off-by: Kuninori Morimoto Reviewed-by: Hiroki Negishi Reviewed-by: Simon Horman Signed-off-by: Vinod Koul commit 5def854e370ff5c52172fb185932fdbffbf15692 Author: Stefan Agner Date: Sun Jun 24 23:27:27 2018 +0200 ARM: dts: tegra: enable NAND flash on Colibri T20 This enables the on-module ONFI conformant NAND flash. Signed-off-by: Lucas Stach Signed-off-by: Stefan Agner Signed-off-by: Thierry Reding commit 6c468f109884c2cd8d8bc042945fdd861f375523 Author: Lucas Stach Date: Sun Jun 24 23:27:26 2018 +0200 ARM: dts: tegra: add Tegra20 NAND flash controller node Add basic controller device tree node to be extended by individual boards. Use the assigned-clocks mechanism to set NDFLASH clock to a sensible default rate of 150MHz. Signed-off-by: Lucas Stach Signed-off-by: Stefan Agner Signed-off-by: Thierry Reding commit 45c9a603a4dfde06f53446ce1db218958442849b Author: Geert Uytterhoeven Date: Mon Jul 2 17:02:06 2018 +0200 dmaengine: rcar-dmac: Disable interrupts while stopping channels During system reboot or halt, with lockdep enabled: ================================ WARNING: inconsistent lock state 4.18.0-rc1-salvator-x-00002-g9203dbec90a68103 #41 Tainted: G W -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. reboot/2779 [HC0[0]:SC0[0]:HE1:SE1] takes: 0000000098ae4ad3 (&(&rchan->lock)->rlock){?.-.}, at: rcar_dmac_shutdown+0x58/0x6c {IN-HARDIRQ-W} state was registered at: lock_acquire+0x208/0x238 _raw_spin_lock+0x40/0x54 rcar_dmac_isr_channel+0x28/0x200 __handle_irq_event_percpu+0x1c0/0x3c8 handle_irq_event_percpu+0x34/0x88 handle_irq_event+0x48/0x78 handle_fasteoi_irq+0xc4/0x12c generic_handle_irq+0x18/0x2c __handle_domain_irq+0xa8/0xac gic_handle_irq+0x78/0xbc el1_irq+0xec/0x1c0 arch_cpu_idle+0xe8/0x1bc default_idle_call+0x2c/0x30 do_idle+0x144/0x234 cpu_startup_entry+0x20/0x24 rest_init+0x27c/0x290 start_kernel+0x430/0x45c irq event stamp: 12177 hardirqs last enabled at (12177): [] _raw_spin_unlock_irq+0x2c/0x4c hardirqs last disabled at (12176): [] _raw_spin_lock_irq+0x1c/0x60 softirqs last enabled at (11948): [] __do_softirq+0x160/0x4ec softirqs last disabled at (11935): [] irq_exit+0xa0/0xfc other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&(&rchan->lock)->rlock); lock(&(&rchan->lock)->rlock); *** DEADLOCK *** 3 locks held by reboot/2779: #0: 00000000bfabfa74 (reboot_mutex){+.+.}, at: sys_reboot+0xdc/0x208 #1: 00000000c75d8c3a (&dev->mutex){....}, at: device_shutdown+0xc8/0x1c4 #2: 00000000ebec58ec (&dev->mutex){....}, at: device_shutdown+0xd8/0x1c4 stack backtrace: CPU: 6 PID: 2779 Comm: reboot Tainted: G W 4.18.0-rc1-salvator-x-00002-g9203dbec90a68103 #41 Hardware name: Renesas Salvator-X 2nd version board based on r8a7795 ES2.0+ (DT) Call trace: dump_backtrace+0x0/0x148 show_stack+0x14/0x1c dump_stack+0xb0/0xf0 print_usage_bug.part.26+0x1c4/0x27c mark_lock+0x38c/0x610 __lock_acquire+0x3fc/0x14d4 lock_acquire+0x208/0x238 _raw_spin_lock+0x40/0x54 rcar_dmac_shutdown+0x58/0x6c platform_drv_shutdown+0x20/0x2c device_shutdown+0x160/0x1c4 kernel_restart_prepare+0x34/0x3c kernel_restart+0x14/0x5c sys_reboot+0x160/0x208 el0_svc_naked+0x30/0x34 rcar_dmac_stop_all_chan() takes the channel lock while stopping a channel, but does not disable interrupts, leading to a deadlock when a DMAC interrupt comes in. Before, the same code block was called from an interrupt handler, hence taking the spinlock was sufficient. Fix this by disabling local interrupts while taking the spinlock. Fixes: 9203dbec90a68103 ("dmaengine: rcar-dmac: don't use DMAC error interrupt") Signed-off-by: Geert Uytterhoeven Signed-off-by: Vinod Koul commit 8ab11f8068ef57e5763e1cc91b3dfe23a2482e68 Author: Krzysztof Kozlowski Date: Mon Jul 9 18:05:19 2018 +0200 ARM: tegra: Work safely with 256 MB Colibri-T20 modules Colibri-T20 can come in 256 MB RAM (with 512 MB NAND) or 512 MB RAM (with 1024 MB NAND) flavors. Both of them will use the same DTSI expecting the bootloader to do the fixup of /memory node. However in case it does not happen, let's stay on safe side by limiting the memory to 256 MB for both versions of Colibri-T20. Rename to remove the unnecessary memory size from the device tree file name. While at it, also follow the typical Toradex SoC, module, carrier board hierarchy. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stefan Agner Tested-by: Stefan Agner Signed-off-by: Thierry Reding commit 35a21229f8e0b461b1db7ab96a4ef390b42b13d2 Author: Krzysztof Kozlowski Date: Mon Jul 9 18:05:18 2018 +0200 ARM: tegra: Fix unit_address_vs_reg and avoid_unnecessary_addr_size DTC warnings Remove unneeded address/size cells properties and unit addresses to fix DTC warnings like: arch/arm/boot/dts/tegra30-apalis-eval.dtb: Warning (unit_address_vs_reg): /i2c@7000d000/stmpe811@41/stmpe_touchscreen@0: node has a unit name, but no reg property arch/arm/boot/dts/tegra30-apalis-eval.dtb: Warning (avoid_unnecessary_addr_size): /i2c@7000d000/stmpe811@41: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stefan Agner Signed-off-by: Thierry Reding commit 482997699ef038af7553399d49b7ba74c3301424 Author: Krzysztof Kozlowski Date: Mon Jul 9 18:05:17 2018 +0200 ARM: tegra: Fix unit_address_vs_reg DTC warnings for /memory Add a generic /memory node in each Tegra DTSI (with empty reg property, to be overidden by each DTS) and set proper unit address for /memory nodes to fix the DTC warnings: arch/arm/boot/dts/tegra20-harmony.dtb: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name The DTB after the change is the same as before except adding unit-address to /memory node. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stefan Agner Signed-off-by: Thierry Reding commit f48ba1ae6ac5e5df6fd4ebd8e9593296396e0831 Author: Krzysztof Kozlowski Date: Mon Jul 9 18:05:16 2018 +0200 ARM: tegra: Remove usage of deprecated skeleton.dtsi Remove the usage of skeleton.dtsi because it was deprecated since commit 9c0da3cc61f1 ("ARM: dts: explicitly mark skeleton.dtsi as deprecated"). It also allows later to fix DTC warnings for missing unit name in /memory nodes. Compiled DTBs are the same as before this commit. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stefan Agner Signed-off-by: Thierry Reding commit 166f3a8ad67738061d6deada4d71019240bdbdaf Merge: ce397d215ccd 7df533a7e3d2 Author: Stephen Boyd Date: Mon Jul 9 09:47:55 2018 -0700 Merge tag 'meson-clk-4.19-1' of https://github.com/BayLibre/clk-meson into clk-meson Pull first round of updates for meson clocks from Jerome Brunet: - Remove legacy register access (finish moving to syscon) - Clean up configuration flags - Add axg PCIe clocks - Add GEN CLK on gxbb, gxl and axg - Remove clk_audio_divider driver - Add axg audio clock controller * tag 'meson-clk-4.19-1' of https://github.com/BayLibre/clk-meson: clk: meson: add gen_clk clk: meson: gxbb: remove HHI_GEN_CLK_CTNL duplicate definition clk: meson-axg: add clocks required by pcie driver clk: meson: remove unused clk-audio-divider driver clk: meson: stop rate propagation for audio clocks clk: meson: axg: add the audio clock controller driver clk: meson: add axg audio sclk divider driver clk: meson: add triple phase clock driver clk: meson: add clk-phase clock driver clk: meson: clean-up meson clock configuration clk: meson: remove obsolete register access clk: meson: expose GEN_CLK clkid clk: meson-axg: add pcie and mipi clock bindings dt-bindings: clock: add meson axg audio clock controller bindings clk: meson: audio-divider is one based clk: add duty cycle support clk: meson-gxbb: set fclk_div2 as CLK_IS_CRITICAL commit 5ba57babcb40227ceb70d9bc71afa57e004f8417 Author: Arnd Bergmann Date: Mon Jul 9 17:48:18 2018 +0200 drm: vkms: select DRM_KMS_HELPER Without this, we get link errors during randconfig build: drivers/gpu/drm/vkms/vkms_drv.o:(.rodata+0xa0): undefined reference to `drm_atomic_helper_check' drivers/gpu/drm/vkms/vkms_drv.o:(.rodata+0xa8): undefined reference to `drm_atomic_helper_commit' drivers/gpu/drm/vkms/vkms_plane.o:(.rodata+0x0): undefined reference to `drm_atomic_helper_update_plane' drivers/gpu/drm/vkms/vkms_plane.o:(.rodata+0x8): undefined reference to `drm_atomic_helper_disable_plane' drivers/gpu/drm/vkms/vkms_plane.o:(.rodata+0x18): undefined reference to `drm_atomic_helper_plane_reset' drivers/gpu/drm/vkms/vkms_plane.o:(.rodata+0x28): undefined reference to `drm_atomic_helper_plane_duplicate_state' drivers/gpu/drm/vkms/vkms_plane.o:(.rodata+0x30): undefined reference to `drm_atomic_helper_plane_destroy_state' drivers/gpu/drm/vkms/vkms_output.o:(.rodata+0x1c0): undefined reference to `drm_helper_probe_single_connector_modes' drivers/gpu/drm/vkms/vkms_crtc.o:(.rodata+0x40): undefined reference to `drm_atomic_helper_crtc_reset' drivers/gpu/drm/vkms/vkms_crtc.o:(.rodata+0x70): undefined reference to `drm_atomic_helper_set_config' drivers/gpu/drm/vkms/vkms_crtc.o:(.rodata+0x78): undefined reference to `drm_atomic_helper_page_flip' drivers/gpu/drm/vkms/vkms_crtc.o:(.rodata+0x90): undefined reference to `drm_atomic_helper_crtc_duplicate_state' drivers/gpu/drm/vkms/vkms_crtc.o:(.rodata+0x98): undefined reference to `drm_atomic_helper_crtc_destroy_state' Fixes: 854502fa0a38 ("drm/vkms: Add basic CRTC initialization") Fixes: 1c7c5fd916a0 ("drm/vkms: Introduce basic VKMS driver") Signed-off-by: Arnd Bergmann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180709154901.1989316-1-arnd@arndb.de commit 66c7bb7c4133c5cc4e9962d5951bf3bd65e29120 Author: Gregory CLEMENT Date: Tue Jun 19 14:34:46 2018 +0200 clk: mvebu: armada-37xx-periph: switch to SPDX license identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Gregory CLEMENT Signed-off-by: Stephen Boyd commit 3be77fe8c3f138cbab68d9c745c2038607286b24 Merge: 2bebdfcdcd0f b7dd29b401f5 Author: Florian Fainelli Date: Mon Jul 9 05:19:34 2018 -0700 Merge tag 'bcm2835-dt-next-2018-07-03' into devicetree/next This pull request brings in a board DT for the Raspberry Pi Compute Module and its I/O board, the Pi3's PMU node, and the display's transposer block. Signed-off-by: Florian Fainelli commit 2bebdfcdcd0feb58d5df419532a2cedc78a336d7 Author: Vivek Unune Date: Mon Jun 18 13:41:59 2018 -0400 ARM: dts: BCM5301X: Add support for Linksys EA9500 Hardware Info ------------- Processor - Broadcom BCM4709C0KFEBG dual-core @ 1.4 GHz Switch - BCM53012 in BCM4709C0KFEBG & external BCM53125 DDR3 RAM - 256 MB Flash - 128 MB (Toshiba TC58BVG0S3HTA00) 2.4GHz - BCM4366 4×4 2.4/5G single chip 802.11ac SoC Power Amp - Skyworks SE2623L 2.4 GHz power amp (x4) 5GHz x 2 - BCM4366 4×4 2.4/5G single chip 802.11ac SoC Power Amp - PLX Technology PEX8603 3-lane, 3-port PCIe switch Ports - 8 Ports, 1 WAN Ports Antennas - 8 Antennas Serial Port - @J6 [GND,TX,RX] (VCC NC) 115200 8n1 Tested with OpenWrt built with DSA driver and Kernel v4.14 Signed-off-by: Vivek Unune Signed-off-by: Florian Fainelli commit a21e7548438f3a8f59f9b9f3a8bc973613d3726a Author: Rafał Miłecki Date: Thu Jun 14 18:41:47 2018 +0200 ARM: dts: BCM53573: Add architected timer It's a standard ARM architected timer that was simply missed when initially adding this .dtsi file. Signed-off-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit 37f6130ec39fe14e923d472746a51e6f06f761b7 Author: Vivek Unune Date: Mon Apr 9 18:31:53 2018 -0400 ARM: dts: BCM5301X: Make USB 3.0 PHY use MDIO PHY driver Currently, the USB 3.0 PHY in bcm5301x.dtsi uses platform driver which requires register range "ccb-mii" <0x18003000 0x1000>. This range overlaps with MDIO cmd and param registers (<0x18003000 0x8>). Essentially, the platform driver partly acts like a MDIO bus driver, hence to use of this register range. In some Northstar devices like Linksys EA9500, secondary switch is connected via external MDIO. The only way to access and configure the external switch is via MDIO bus. When we enable the MDIO bus in it's current state, the MDIO bus and any child buses fail to register because of the register range overlap. On Northstar, the USB 3.0 PHY is connected at address 0x10 on the internal MDIO bus. This change moves the usb3_phy node and makes it a child node of internal MDIO bus. Thanks to Rafał Miłecki's commit af850e14a7ae ("phy: bcm-ns-usb3: add MDIO driver using proper bus layer") the same USB 3.0 platform driver can now act as USB 3.0 PHY MDIO driver. Tested on Linksys Panamera (EA9500) Signed-off-by: Vivek Unune Signed-off-by: Florian Fainelli commit a08e950de6499ff7ed6f62c74512e2bf9f0e0985 Author: Mohamed Ismail Abdul Packir Mohamed Date: Wed Jun 6 11:21:31 2018 -0700 ARM: dts: cygnus: enable iproc-hwrng Enable the HW rng driver "iproc-rng200" for all cygnus platforms. Signed-off-by: Mohamed Ismail Abdul Packir Mohamed Reviewed-by: Ray Jui Signed-off-by: Scott Branden Tested-by: Clément Péron Signed-off-by: Florian Fainelli commit 00d1ae38404537975d7e055ba2eaa6a11a2148ea Author: Clément Péron Date: Thu May 3 11:56:18 2018 +0200 ARM: dts: cygnus: add ethernet0 alias In order to avoid Linux generating a random mac address on every boot, add an ethernet0 alias that will allow u-boot to patch the dtb with the MAC address. Signed-off-by: Clément Péron Acked-by: Scott Branden Signed-off-by: Florian Fainelli commit b7dd29b401f5862ea24df13ee5c10bed8668c14b Author: Boris Brezillon Date: Mon Jul 2 14:20:20 2018 +0200 ARM: dts: bcm283x: Add Transposer block The transposer block is allowing one to write the result of the VC4 composition back to memory instead of displaying it on a screen. Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Reviewed-by: Eric Anholt Signed-off-by: Eric Anholt commit b8ccf02a5014b8d3a828a859a35b1fb6ceb6e688 Author: Eric Anholt Date: Mon May 21 11:39:07 2018 -0700 ARM: dts: bcm283x: Add the PMU to the devicetree. This only probes on arm64 so far, but hopefully that driver will be generalized soon. Signed-off-by: Eric Anholt Acked-by: Stefan Wahren commit 3993e501bf853cce85c5114a704b86b8f486790c Author: Randy Dunlap Date: Fri Jul 6 20:49:19 2018 -0700 block/DAC960.c: fix defined but not used build warnings Fix build warnings in DAC960.c when CONFIG_PROC_FS is not enabled by marking the unused functions as __maybe_unused. ../drivers/block/DAC960.c:6429:12: warning: 'dac960_proc_show' defined but not used [-Wunused-function] ../drivers/block/DAC960.c:6449:12: warning: 'dac960_initial_status_proc_show' defined but not used [-Wunused-function] ../drivers/block/DAC960.c:6456:12: warning: 'dac960_current_status_proc_show' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap Cc: Jens Axboe Cc: linux-block@vger.kernel.org Signed-off-by: Jens Axboe commit ca4b2a011948fae4e4d31490107db4926385a983 Author: Matias Bjørling Date: Fri Jul 6 19:38:39 2018 +0200 null_blk: add zone support Adds support for exposing a null_blk device through the zone device interface. The interface is managed with the parameters zoned and zone_size. If zoned is set, the null_blk instance registers as a zoned block device. The zone_size parameter defines how big each zone will be. Signed-off-by: Matias Bjørling Signed-off-by: Bart Van Assche Signed-off-by: Damien Le Moal Signed-off-by: Jens Axboe commit 6dad38d38f20c0c8a84b5ae4f23c62b2c8758ec5 Author: Matias Bjørling Date: Fri Jul 6 19:38:38 2018 +0200 null_blk: move shared definitions to header file Split the null_blk device driver, such that it can prepare for zoned block interface support. Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit e9a83853302b339e63dea4072f6210e5a88ab4bb Author: Geert Uytterhoeven Date: Fri Jul 6 10:49:35 2018 +0200 block: Add default switch case to blk_pm_allow_request() to kill warning With gcc 4.9.0 and 7.3.0: block/blk-core.c: In function 'blk_pm_allow_request': block/blk-core.c:2747:2: warning: enumeration value 'RPM_ACTIVE' not handled in switch [-Wswitch] switch (rq->q->rpm_status) { ^ Convert the return statement below the switch() block into a default case to fix this. Fixes: e4f36b249b4d4e75 ("block: fix peeking requests during PM") Signed-off-by: Geert Uytterhoeven Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b88aef36b87c9787a4db724923ec4f57dfd513f3 Author: Mikulas Patocka Date: Tue Jul 3 13:34:22 2018 -0400 block: fix infinite loop if the device loses discard capability If __blkdev_issue_discard is in progress and a device mapper device is reloaded with a table that doesn't support discard, q->limits.max_discard_sectors is set to zero. This results in infinite loop in __blkdev_issue_discard. This patch checks if max_discard_sectors is zero and aborts with -EOPNOTSUPP. Signed-off-by: Mikulas Patocka Tested-by: Zdenek Kabelac Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe commit c137969bd4c5b2a67803d10518e3d60d3b13d0cb Author: Shakeel Butt Date: Tue Jul 3 10:14:46 2018 -0700 block, mm: remove unnecessary __GFP_HIGH flag The flag GFP_ATOMIC already contains __GFP_HIGH. There is no need to explicitly or __GFP_HIGH again. So, just remove unnecessary __GFP_HIGH. Signed-off-by: Shakeel Butt Signed-off-by: Jens Axboe commit 00a8cdb84fcb64c7f9f1061298ff676a96dfaf41 Author: Liu Bo Date: Fri Jul 6 03:07:13 2018 +0800 null_blk: remove NULLB_DEV_FL_CONFIGURED on turning off nullb device Currently mbps knob could only be set once before switching power knob to on, after power knob has been set at least once, there is no way to set mbps knob again due to -EBUSY. As nullb is mainly used for testing, in order to make it flexible, this removes the flag NULLB_DEV_FL_CONFIGURED so that mbps knob can be reset when power knob is off, e.g. echo 0 > /config/nullb/a/power echo 40 > /config/nullb/a/mbps echo 1 > /config/nullb/a/power So does other knobs under /config/nullb/a. Signed-off-by: Liu Bo Signed-off-by: Jens Axboe commit ca47e8c72ae141587cabf3dab693f6754d8c416b Author: Josef Bacik Date: Tue Jul 3 11:15:03 2018 -0400 mm: skip readahead if the cgroup is congested We noticed in testing we'd get pretty bad latency stalls under heavy pressure because read ahead would try to do its thing while the cgroup was under severe pressure. If we're under this much pressure we want to do as little IO as possible so we can still make progress on real work if we're a throttled cgroup, so just skip readahead if our group is under pressure. Signed-off-by: Josef Bacik Acked-by: Tejun Heo Acked-by: Andrew Morton Signed-off-by: Jens Axboe commit b351f0c76c3eb94c9ccfb68d0b23899a35e47f27 Author: Josef Bacik Date: Tue Jul 3 11:15:02 2018 -0400 Documentation: add a doc for blk-iolatency A basic documentation to describe the interface, statistics, and behavior of io.latency. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit d70675121546c35feaceebf7ed9caed8716640f3 Author: Josef Bacik Date: Tue Jul 3 11:15:01 2018 -0400 block: introduce blk-iolatency io controller Current IO controllers for the block layer are less than ideal for our use case. The io.max controller is great at hard limiting, but it is not work conserving. This patch introduces io.latency. You provide a latency target for your group and we monitor the io in short windows to make sure we are not exceeding those latency targets. This makes use of the rq-qos infrastructure and works much like the wbt stuff. There are a few differences from wbt - It's bio based, so the latency covers the whole block layer in addition to the actual io. - We will throttle all IO types that comes in here if we need to. - We use the mean latency over the 100ms window. This is because writes can be particularly fast, which could give us a false sense of the impact of other workloads on our protected workload. - By default there's no throttling, we set the queue_depth to INT_MAX so that we can have as many outstanding bio's as we're allowed to. Only at throttle time do we pay attention to the actual queue depth. - We backcharge cgroups for root cg issued IO and induce artificial delays in order to deal with cases like metadata only or swap heavy workloads. In testing this has worked out relatively well. Protected workloads will throttle noisy workloads down to 1 io at time if they are doing normal IO on their own, or induce up to a 1 second delay per syscall if they are doing a lot of root issued IO (metadata/swap IO). Our testing has revolved mostly around our production web servers where we have hhvm (the web server application) in a protected group and everything else in another group. We see slightly higher requests per second (RPS) on the test tier vs the control tier, and much more stable RPS across all machines in the test tier vs the control tier. Another test we run is a slow memory allocator in the unprotected group. Before this would eventually push us into swap and cause the whole box to die and not recover at all. With these patches we see slight RPS drops (usually 10-15%) before the memory consumer is properly killed and things recover within seconds. Signed-off-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit 67b42d0bf7a8fd1ec0cf1acdc9550e688d7c8578 Author: Josef Bacik Date: Tue Jul 3 11:15:00 2018 -0400 rq-qos: introduce dio_bio callback wbt cares only about request completion time, but controllers may need information that is on the bio itself, so add a done_bio callback for rq-qos so things like blk-iolatency can use it to have the bio when it completes. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit c1c80384c8f47021a01a0cc42894a06bed2b801b Author: Josef Bacik Date: Tue Jul 3 11:14:59 2018 -0400 block: remove external dependency on wbt_flags We don't really need to save this stuff in the core block code, we can just pass the bio back into the helpers later on to derive the same flags and update the rq->wbt_flags appropriately. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit a79050434b45959f397042080fd1d70ffa9bd9df Author: Josef Bacik Date: Tue Jul 3 09:32:35 2018 -0600 blk-rq-qos: refactor out common elements of blk-wbt blkcg-qos is going to do essentially what wbt does, only on a cgroup basis. Break out the common code that will be shared between blkcg-qos and wbt into blk-rq-qos.* so they can both utilize the same infrastructure. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 2ecbf456352d0699f51b4c6d70ea5bf29766579c Author: Josef Bacik Date: Tue Jul 3 11:14:57 2018 -0400 blk-stat: export helpers for modifying blk_rq_stat We need to use blk_rq_stat in the blkcg qos stuff, so export some of these helpers so they can be used by other things. Signed-off-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit 2cf855837b89d92996cf264713f3bed2bf9b0b4f Author: Tejun Heo Date: Tue Jul 3 11:14:56 2018 -0400 memcontrol: schedule throttling if we are congested Memory allocations can induce swapping via kswapd or direct reclaim. If we are having IO done for us by kswapd and don't actually go into direct reclaim we may never get scheduled for throttling. So instead check to see if our cgroup is congested, and if so schedule the throttling. Before we return to user space the throttling stuff will only throttle if we actually required it. Signed-off-by: Tejun Heo Signed-off-by: Josef Bacik Acked-by: Johannes Weiner Acked-by: Andrew Morton Signed-off-by: Jens Axboe commit d09d8df3a29403693d9d20cc34ed101f2c558e2b Author: Josef Bacik Date: Tue Jul 3 11:14:55 2018 -0400 blkcg: add generic throttling mechanism Since IO can be issued from literally anywhere it's almost impossible to do throttling without having some sort of adverse effect somewhere else in the system because of locking or other dependencies. The best way to solve this is to do the throttling when we know we aren't holding any other kernel resources. Do this by tracking throttling in a per-blkg basis, and if we require throttling flag the task that it needs to check before it returns to user space and possibly sleep there. This is to address the case where a process is doing work that is generating IO that can't be throttled, whether that is directly with a lot of REQ_META IO, or indirectly by allocating so much memory that it is swamping the disk with REQ_SWAP. We can't use task_add_work as we don't want to induce a memory allocation in the IO path, so simply saving the request queue in the task and flagging it to do the notify_resume thing achieves the same result without the overhead of a memory allocation. Signed-off-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit 0d3bd88d54f513723602b361dccfc71639f50779 Author: Tejun Heo Date: Tue Jul 3 11:14:54 2018 -0400 swap,blkcg: issue swap io with the appropriate context For backcharging we need to know who the page belongs to when swapping it out. We don't worry about things that do ->rw_page (zram etc) at the moment, we're only worried about pages that actually go to a block device. Signed-off-by: Tejun Heo Signed-off-by: Josef Bacik Acked-by: Johannes Weiner Acked-by: Andrew Morton Signed-off-by: Jens Axboe commit 0d1e0c7cd5909d6c6aa0957179318e13fcca971a Author: Josef Bacik Date: Tue Jul 3 11:14:53 2018 -0400 blk: introduce REQ_SWAP Just like REQ_META, it's important to know the IO coming down is swap in order to guard against potential IO priority inversion issues with cgroups. Add REQ_SWAP and use it for all swap IO, and add it to our bio_issue_as_root_blkg helper. Signed-off-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit 903d23f0a354f226fa78f1c1c34b60aaf992e812 Author: Josef Bacik Date: Tue Jul 3 11:14:52 2018 -0400 blk-cgroup: allow controllers to output their own stats blk-iolatency has a few stats that it would like to print out, and instead of adding a bunch of crap to the generic code just provide a helper so that controllers can add stuff to the stat line if they want to. Hide it behind a boot option since it changes the output of io.stat from normal, and these stats are only interesting to developers. Signed-off-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit c7c98fd37653955d3a17dd4f1fa67aba070096a9 Author: Josef Bacik Date: Tue Jul 3 11:14:51 2018 -0400 block: introduce bio_issue_as_root_blkg Instead of forcing all file systems to get the right context on their bio's, simply check for REQ_META to see if we need to issue as the root blkg. We don't want to force all bio's to have the root blkg associated with them if REQ_META is set, as some controllers (blk-iolatency) need to know who the originating cgroup is so it can backcharge them for the work they are doing. This helper will make sure that the controllers do the proper thing wrt the IO priority and backcharging. Signed-off-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit 08e18eab0c579ad84399c1899c11899734854eb2 Author: Josef Bacik Date: Tue Jul 3 11:14:50 2018 -0400 block: add bi_blkg to the bio for cgroups Currently io.low uses a bi_cg_private to stash its private data for the blkg, however other blkcg policies may want to use this as well. Since we can get the private data out of the blkg, move this to bi_blkg in the bio and make it generic, then we can use bio_associate_blkg() to attach the blkg to the bio. Theoretically we could simply replace the bi_css with this since we can get to all the same information from the blkg, however you have to lookup the blkg, so for example wbc_init_bio() would have to lookup and possibly allocate the blkg for the css it was trying to attach to the bio. This could be problematic and result in us either not attaching the css at all to the bio, or falling back to the root blkcg if we are unable to allocate the corresponding blkg. So for now do this, and in the future if possible we could just replace the bi_css with bi_blkg and update the helpers to do the correct translation. Signed-off-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit 6e768717304bdbe8d2897ca8298f6b58863fdc41 Author: Ming Lei Date: Tue Jul 3 09:03:16 2018 -0600 blk-mq: dequeue request one by one from sw queue if hctx is busy It won't be efficient to dequeue request one by one from sw queue, but we have to do that when queue is busy for better merge performance. This patch takes the Exponential Weighted Moving Average(EWMA) to figure out if queue is busy, then only dequeue request one by one from sw queue when queue is busy. Fixes: b347689ffbca ("blk-mq-sched: improve dispatching from sw queue") Cc: Kashyap Desai Cc: Laurence Oberman Cc: Omar Sandoval Cc: Christoph Hellwig Cc: Bart Van Assche Cc: Hannes Reinecke Reported-by: Kashyap Desai Tested-by: Kashyap Desai Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit d893ff86034f7107f89d8b740c2b5902a21a49db Author: Gustavo A. R. Silva Date: Mon Jul 2 12:52:06 2018 -0500 block/loop: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jens Axboe commit d769a992966b0a188096fda24fc08fc769ec6547 Author: Gustavo A. R. Silva Date: Mon Jul 2 12:49:02 2018 -0500 drbd: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used in this case: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jens Axboe commit b04f50ab8a74129b3041a2836c33c916be3c6667 Author: Ming Lei Date: Mon Jul 2 17:35:59 2018 +0800 blk-mq: only attempt to merge bio if there is rq in sw queue Only attempt to merge bio iff the ctx->rq_list isn't empty, because: 1) for high-performance SSD, most of times dispatch may succeed, then there may be nothing left in ctx->rq_list, so don't try to merge over sw queue if it is empty, then we can save one acquiring of ctx->lock 2) we can't expect good merge performance on per-cpu sw queue, and missing one merge on sw queue won't be a big deal since tasks can be scheduled from one CPU to another. Cc: Laurence Oberman Cc: Omar Sandoval Cc: Bart Van Assche Tested-by: Kashyap Desai Reported-by: Kashyap Desai Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 3f0cedc7e9a0b32e79c79d2aac0c96d2b870ae55 Author: Ming Lei Date: Mon Jul 2 17:35:58 2018 +0800 blk-mq: use list_splice_tail_init() to insert requests list_splice_tail_init() is much more faster than inserting each request one by one, given all requets in 'list' belong to same sw queue and ctx->lock is required to insert requests. Cc: Laurence Oberman Cc: Omar Sandoval Cc: Bart Van Assche Tested-by: Kashyap Desai Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit c018c84fdb453ae057f3bcc87a1f1f730d41628b Author: Minwoo Im Date: Sat Jun 30 22:12:41 2018 +0900 blk-mq: fix typo in a function comment Fix typo in a function blk_mq_alloc_tag_set() comment. if if it too large -> if it's too large. Signed-off-by: Minwoo Im Signed-off-by: Jens Axboe commit 0da73d00ca111a6175825a00d94dbeae185f6d7e Author: Minwoo Im Date: Mon Jul 2 23:46:43 2018 +0900 blk-mq: code clean-up by adding an API to clear set->mq_map set->mq_map is now currently cleared if something goes wrong when establishing a queue map in blk-mq-pci.c. It's also cleared before updating a queue map in blk_mq_update_queue_map(). This patch provides an API to clear set->mq_map to make it clear. Signed-off-by: Minwoo Im Signed-off-by: Jens Axboe commit 5efac89c849849ad3a959224eb711f9c311e5bde Author: Colin Ian King Date: Mon Jul 2 09:14:19 2018 +0100 paride: remove redundant variable n Variable n is being assigned but is never used hence it is redundant and can be removed. Also put spacing between variables in declaration to clean up checkpatch warnings. Cleans up clang warning: warning: variable 'n' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Jens Axboe commit e84422cdf3caa9cf35e625076dc62977f0023992 Author: Colin Ian King Date: Mon Jul 2 08:13:59 2018 +0100 partitions/ldm: remove redundant pointer dgrp Pointer dgrp is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'dgrp' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Jens Axboe commit f4354a94e2097fe87a14d47ff502754bb547029a Author: Colin Ian King Date: Mon Jul 2 08:47:06 2018 +0100 loop: remove redundant pointer inode Pointer inode is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'inode' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Jens Axboe commit b64a71a0130dd2a88b0fc36a3c0a4882f47813e8 Author: Colin Ian King Date: Mon Jul 2 08:42:34 2018 +0100 block/floppy: remove redundant variable dflags Variable dflags is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'dflags' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Jens Axboe commit 43ada78781246cb36036f26158a645c17550ac54 Author: Liu Bo Date: Fri Jun 29 09:56:56 2018 +0800 Block: blk-throttle: set low_valid immediately once one cgroup has io.low configured Once one cgroup has io.low configured, @low_valid becomes true and other cgroups won't switch it back whatsoever. Signed-off-by: Liu Bo Signed-off-by: Jens Axboe commit e1a413245a564683697a3d02ec197b72cf009b89 Author: Liu Bo Date: Fri Jun 29 09:56:08 2018 +0800 Blktrace: bail out early if block debugfs is not configured Since @blk_debugfs_root couldn't be configured dynamically, we can save a few memory allocation if it's not there. Signed-off-by: Liu Bo Signed-off-by: Jens Axboe commit 1954e9a998d59d08520d7d4bebeafb8f66ba0d0f Author: Bart Van Assche Date: Wed Jun 27 13:09:05 2018 -0700 block: Document how blk_update_request() handles RQF_SPECIAL_PAYLOAD requests The payload of struct request is stored in the request.bio chain if the RQF_SPECIAL_PAYLOAD flag is not set and in request.special_vec if RQF_SPECIAL_PAYLOAD has been set. However, blk_update_request() iterates over req->bio whether or not RQF_SPECIAL_PAYLOAD has been set. Additionally, the RQF_SPECIAL_PAYLOAD flag is ignored by blk_rq_bytes() which means that the value returned by that function is incorrect if the RQF_SPECIAL_PAYLOAD flag has been set. It is not clear to me whether this is an oversight or whether this happened on purpose. Anyway, document that it is known that both functions ignore RQF_SPECIAL_PAYLOAD. See also commit f9d03f96b988 ("block: improve handling of the magic discard payload"). Reviewed-by: Christoph Hellwig Signed-off-by: Bart Van Assche Cc: Ming Lei Signed-off-by: Jens Axboe commit d05d199883b09cd34937ebb045adbed9098e9780 Author: Bart Van Assche Date: Mon Jun 25 15:51:00 2018 -0700 drbd: Do not redefine __must_hold() Since __must_hold() is defined in , do not redefine it in DRBD. Compile-tested only. Reviewed-by: Christoph Hellwig Signed-off-by: Bart Van Assche Cc: Philipp Reisner Cc: Lars Ellenberg Signed-off-by: Jens Axboe commit 1311326cf4755c7ffefd20f576144ecf46d9906b Author: Ming Lei Date: Mon Jun 25 19:31:49 2018 +0800 blk-mq: avoid to synchronize rcu inside blk_cleanup_queue() SCSI probing may synchronously create and destroy a lot of request_queues for non-existent devices. Any synchronize_rcu() in queue creation or destroy path may introduce long latency during booting, see detailed description in comment of blk_register_queue(). This patch removes one synchronize_rcu() inside blk_cleanup_queue() for this case, commit c2856ae2f315d75(blk-mq: quiesce queue before freeing queue) needs synchronize_rcu() for implementing blk_mq_quiesce_queue(), but when queue isn't initialized, it isn't necessary to do that since only pass-through requests are involved, no original issue in scsi_execute() at all. Without this patch and previous one, it may take more 20+ seconds for virtio-scsi to complete disk probe. With the two patches, the time becomes less than 100ms. Fixes: c2856ae2f315d75 ("blk-mq: quiesce queue before freeing queue") Reported-by: Andrew Jones Cc: Omar Sandoval Cc: Bart Van Assche Cc: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Cc: Christoph Hellwig Tested-by: Andrew Jones Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 97889f9ac24f8d2fc8e703ea7f80c162bab10d4d Author: Ming Lei Date: Mon Jun 25 19:31:48 2018 +0800 blk-mq: remove synchronize_rcu() from blk_mq_del_queue_tag_set() We have to remove synchronize_rcu() from blk_queue_cleanup(), otherwise long delay can be caused during lun probe. For removing it, we have to avoid to iterate the set->tag_list in IO path, eg, blk_mq_sched_restart(). This patch reverts 5b79413946d (Revert "blk-mq: don't handle TAG_SHARED in restart"). Given we have fixed enough IO hang issue, and there isn't any reason to restart all queues in one tags any more, see the following reasons: 1) blk-mq core can deal with shared-tags case well via blk_mq_get_driver_tag(), which can wake up queues waiting for driver tag. 2) SCSI is a bit special because it may return BLK_STS_RESOURCE if queue, target or host is ready, but SCSI built-in restart can cover all these well, see scsi_end_request(), queue will be rerun after any request initiated from this host/target is completed. In my test on scsi_debug(8 luns), this patch may improve IOPS by 20% ~ 30% when running I/O on these 8 luns concurrently. Fixes: 705cda97ee3a ("blk-mq: Make it safe to use RCU to iterate over blk_mq_tag_set.tag_list") Cc: Omar Sandoval Cc: Bart Van Assche Cc: Christoph Hellwig Cc: Martin K. Petersen Cc: linux-scsi@vger.kernel.org Reported-by: Andrew Jones Tested-by: Andrew Jones Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 5815839b3ca16bb1d45939270871169f6803a121 Author: Ming Lei Date: Mon Jun 25 19:31:47 2018 +0800 blk-mq: introduce new lock for protecting hctx->dispatch_wait Now hctx->lock is only acquired when adding hctx->dispatch_wait to one wait queue, but not held when removing it from the wait queue. IO hang can be observed easily if SCHED RESTART is disabled, that means now RESTART exits just for fixing the issue in blk_mq_mark_tag_wait(). This patch fixes the issue by introducing hctx->dispatch_wait_lock and holding it for removing hctx->dispatch_wait in blk_mq_dispatch_wake(), since we need to avoid acquiring hctx->lock in irq context. Fixes: eb619fdb2d4cb8b3d3419 ("blk-mq: fix issue with shared tag queue re-running") Cc: Christoph Hellwig Cc: Omar Sandoval Cc: Bart Van Assche Tested-by: Andrew Jones Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 2278d69f030f6cb7fdacba6281a46fb9d637d2aa Author: Ming Lei Date: Mon Jun 25 19:31:46 2018 +0800 blk-mq: don't pass **hctx to blk_mq_mark_tag_wait() 'hctx' won't be changed at all, so not necessary to pass '**hctx' to blk_mq_mark_tag_wait(). Cc: Christoph Hellwig Cc: Bart Van Assche Tested-by: Andrew Jones Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 8ab6bb9ee8d04ba56b9eb19cc7e4f56d0a43ad1a Author: Ming Lei Date: Mon Jun 25 19:31:45 2018 +0800 blk-mq: cleanup blk_mq_get_driver_tag() We never pass 'wait' as true to blk_mq_get_driver_tag(), and hence we never change '**hctx' as well. The last use of these went away with the flush cleanup, commit 0c2a6fe4dc3e. So cleanup the usage and remove the two extra parameters. Cc: Bart Van Assche Cc: Christoph Hellwig Tested-by: Andrew Jones Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 277a4a9b56cde0f3d53ea8abc0e43ff636820007 Author: Paolo Valente Date: Mon Jun 25 21:55:37 2018 +0200 block, bfq: give a better name to bfq_bfqq_may_idle The actual goal of the function bfq_bfqq_may_idle is to tell whether it is better to perform device idling (more precisely: I/O-dispatch plugging) for the input bfq_queue, either to boost throughput or to preserve service guarantees. This commit improves the name of the function accordingly. Tested-by: Holger Hoffstätte Tested-by: Oleksandr Natalenko Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit 9fae8dd59ff3d9c19570cbddf12e87d7bb66c8a2 Author: Paolo Valente Date: Mon Jun 25 21:55:36 2018 +0200 block, bfq: fix service being wrongly set to zero in case of preemption If - a bfq_queue Q preempts another queue, because one request of Q arrives in time, - but, after this preemption, Q is not the queue that is set in service, then Q->entity.service is set to 0 when Q is eventually set in service. But Q should have continued receiving service with its old budget (which is why preemption has occurred) and its old service. This commit addresses this issue by resetting service on queue real expiration. Tested-by: Holger Hoffstätte Tested-by: Oleksandr Natalenko Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit 4420b095cc474759f6fbdb6351648c7ff9833a54 Author: Paolo Valente Date: Mon Jun 25 21:55:35 2018 +0200 block, bfq: do not expire a queue that will deserve dispatch plugging For some bfq_queues, BFQ plugs I/O dispatching when the queue becomes idle, and keeps the plug until a new request of the queue arrives, or a timeout fires. BFQ does so either to boost throughput or to preserve service guarantees for the queue. More precisely, for such a queue, plugging starts when the queue happens to have either no request enqueued, or no request in flight, that is, no request already dispatched but not yet completed. On the opposite end, BFQ may happen to expire a queue with no request enqueued, without doing any plugging, if the queue still has some request in flight. Unfortunately, such a premature expiration causes the queue to lose its chance to enjoy dispatch plugging a moment later, i.e., when its in-flight requests finally get completed. This breaks service guarantees for the queue. This commit prevents BFQ from expiring an empty queue if the latter still has in-flight requests. Tested-by: Holger Hoffstätte Tested-by: Oleksandr Natalenko Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit 0471559c2fbd2c19d183fc0f51ce88aefa0a13c8 Author: Paolo Valente Date: Mon Jun 25 21:55:34 2018 +0200 block, bfq: add/remove entity weights correctly To keep I/O throughput high as often as possible, BFQ performs I/O-dispatch plugging (aka device idling) only when beneficial exactly for throughput, or when needed for service guarantees (low latency, fairness). An important case where the latter condition holds is when the scenario is 'asymmetric' in terms of weights: i.e., when some bfq_queue or whole group of queues has a higher weight, and thus has to receive more service, than other queues or groups. Without dispatch plugging, lower-weight queues/groups may unjustly steal bandwidth to higher-weight queues/groups. To detect asymmetric scenarios, BFQ checks some sufficient conditions. One of these conditions is that active groups have different weights. BFQ controls this condition by maintaining a special set of unique weights of active groups (group_weights_tree). To this purpose, in the function bfq_active_insert/bfq_active_extract BFQ adds/removes the weight of a group to/from this set. Unfortunately, the function bfq_active_extract may happen to be invoked also for a group that is still active (to preserve the correct update of the next queue to serve, see comments in function bfq_no_longer_next_in_service() for details). In this case, removing the weight of the group makes the set group_weights_tree inconsistent. Service-guarantee violations follow. This commit addresses this issue by moving group_weights_tree insertions from their previous location (in bfq_active_insert) into the function __bfq_activate_entity, and by moving group_weights_tree extractions from bfq_active_extract to when the entity that represents a group remains throughly idle, i.e., with no request either enqueued or dispatched. Tested-by: Holger Hoffstätte Tested-by: Oleksandr Natalenko Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit 6a5ac9846508ad7d1d23881d9d5add35f2e6ae71 Author: Bart Van Assche Date: Fri Jun 15 14:55:21 2018 -0700 block: Make struct request_queue smaller for CONFIG_BLK_DEV_ZONED=n Exclude zoned block device members from struct request_queue for CONFIG_BLK_DEV_ZONED == n. Avoid breaking the build by only building the code that uses these struct request_queue members if CONFIG_BLK_DEV_ZONED != n. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Matias Bjorling Cc: Christoph Hellwig Signed-off-by: Jens Axboe commit 7c8542b7982264226cf94102950343185869b584 Author: Bart Van Assche Date: Fri Jun 15 14:55:20 2018 -0700 block: Inline blk_queue_nr_zones() Since the implementation of blk_queue_nr_zones() is trivial and since it only has a single caller, inline this function. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Matias Bjorling Cc: Christoph Hellwig Signed-off-by: Jens Axboe commit 6b1d83d274486615cc341e410467a98fd9c27c0a Author: Bart Van Assche Date: Fri Jun 15 14:55:19 2018 -0700 block: Remove bdev_nr_zones() Remove this function since it has no callers. This function was introduced in commit 6cc77e9cb080 ("block: introduce zoned block devices zone write locking"). Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Christoph Hellwig Cc: Matias Bjorling Signed-off-by: Jens Axboe commit b3e7e7d2d668de0102264302a4d10dd9d4438a42 Author: Bart Van Assche Date: Fri Jun 15 14:55:18 2018 -0700 include/uapi/linux/blkzoned.h: Remove a superfluous __packed directive Using the __packed directive for a structure that does not need it is wrong because it makes gcc generate suboptimal code on some architectures. Hence remove the __packed directive from the blk_zone_report structure definition. See also http://digitalvampire.org/blog/index.php/2006/07/31/why-you-shouldnt-use-__attribute__packed/. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Matias Bjorling Cc: Christoph Hellwig Signed-off-by: Jens Axboe commit f441108fa08c466d986a7dca776f59dabab58456 Author: Bart Van Assche Date: Fri Jun 15 14:55:17 2018 -0700 block: Remove a superfluous cast from blkdev_report_zones() No cast is necessary when assigning a non-void pointer to a void pointer. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Matias Bjorling Cc: Christoph Hellwig Signed-off-by: Jens Axboe commit 700253e7b2b293785218faef6a69bc8cb49b6345 Author: Marcel Ziswiler Date: Tue Jul 3 17:03:39 2018 +0200 ARM: tegra: Fix can2 on Tegra30 Apalis CAN2 currently fails on probe as follows: mcp251x spi1.1: Probe failed, err=19 Fix this by enabling input on pin mux of resp. SPI4 pins. Signed-off-by: Marcel Ziswiler Signed-off-by: Marcel Ziswiler Signed-off-by: Thierry Reding commit 932cac10c8fb07e72a1eba28e71b92f7f2cd756e Author: Chris Wilson Date: Mon Jul 9 14:01:58 2018 +0100 drm/i915/selftests: Prevent background reaping of active objects igt_mmap_offset_exhaustion() wants to test what happens when the mmap space is filled with zombie objects, objects discarded by userspace but still active on the GPU. As they are only protected by the active reference, we have to be certain that active reference is kept while we peek into our dangling pointer. That active reference should not be freed until we retire, but we do that retirement from a background thread. This leaves us with a subtle timing problem, exacerbated and highlighted by KASAN: <3>[ 132.380399] BUG: KASAN: use-after-free in drm_gem_create_mmap_offset+0x8c/0xd0 <3>[ 132.380430] Read of size 8 at addr ffff8801e13245f8 by task drv_selftest/5822 <4>[ 132.380470] CPU: 0 PID: 5822 Comm: drv_selftest Tainted: G U 4.18.0-rc3-g7ae7763aa2be-kasan_48+ #1 <4>[ 132.380473] Hardware name: Dell Inc. XPS 8300 /0Y2MRG, BIOS A06 10/17/2011 <4>[ 132.380475] Call Trace: <4>[ 132.380481] dump_stack+0x7c/0xbb <4>[ 132.380487] print_address_description+0x65/0x270 <4>[ 132.380493] kasan_report+0x25b/0x380 <4>[ 132.380497] ? drm_gem_create_mmap_offset+0x8c/0xd0 <4>[ 132.380503] drm_gem_create_mmap_offset+0x8c/0xd0 <4>[ 132.380584] i915_gem_object_create_mmap_offset+0x6d/0x100 [i915] <4>[ 132.380650] igt_mmap_offset_exhaustion+0x462/0x940 [i915] <4>[ 132.380714] ? i915_gem_close_object+0x740/0x740 [i915] <4>[ 132.380784] ? igt_gem_huge+0x269/0x3d0 [i915] <4>[ 132.380865] __i915_subtests+0x5a/0x160 [i915] <4>[ 132.380936] __run_selftests+0x1a2/0x2f0 [i915] <4>[ 132.381008] i915_live_selftests+0x4e/0x80 [i915] <4>[ 132.381071] i915_pci_probe+0xd8/0x1b0 [i915] <4>[ 132.381077] pci_device_probe+0x1c5/0x3a0 <4>[ 132.381087] driver_probe_device+0x6b6/0xcb0 <4>[ 132.381094] __driver_attach+0x22d/0x2c0 <4>[ 132.381100] ? driver_probe_device+0xcb0/0xcb0 <4>[ 132.381103] bus_for_each_dev+0x113/0x1a0 <4>[ 132.381108] ? check_flags.part.24+0x450/0x450 <4>[ 132.381112] ? subsys_dev_iter_exit+0x10/0x10 <4>[ 132.381123] bus_add_driver+0x38b/0x6e0 <4>[ 132.381131] driver_register+0x189/0x400 <4>[ 132.381136] ? 0xffffffffc12d8000 <4>[ 132.381140] do_one_initcall+0xa0/0x4c0 <4>[ 132.381145] ? initcall_blacklisted+0x180/0x180 <4>[ 132.381152] ? do_init_module+0x4a/0x54c <4>[ 132.381156] ? rcu_lockdep_current_cpu_online+0xdc/0x130 <4>[ 132.381161] ? kasan_unpoison_shadow+0x30/0x40 <4>[ 132.381169] do_init_module+0x1b5/0x54c <4>[ 132.381177] load_module+0x619e/0x9b70 <4>[ 132.381202] ? module_frob_arch_sections+0x20/0x20 <4>[ 132.381211] ? vfs_read+0x257/0x2f0 <4>[ 132.381214] ? vfs_read+0x257/0x2f0 <4>[ 132.381221] ? kernel_read+0x8b/0x130 <4>[ 132.381231] ? copy_strings_kernel+0x120/0x120 <4>[ 132.381244] ? __se_sys_finit_module+0x17c/0x1a0 <4>[ 132.381248] __se_sys_finit_module+0x17c/0x1a0 <4>[ 132.381252] ? __ia32_sys_init_module+0xa0/0xa0 <4>[ 132.381261] ? __se_sys_newstat+0x77/0xd0 <4>[ 132.381265] ? cp_new_stat+0x590/0x590 <4>[ 132.381269] ? kmem_cache_free+0x2f0/0x340 <4>[ 132.381285] do_syscall_64+0x97/0x400 <4>[ 132.381292] entry_SYSCALL_64_after_hwframe+0x49/0xbe <4>[ 132.381295] RIP: 0033:0x7eff4af46839 <4>[ 132.381297] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48 <4>[ 132.381426] RSP: 002b:00007ffcd84f4cf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 <4>[ 132.381432] RAX: ffffffffffffffda RBX: 000055dfdeb429a0 RCX: 00007eff4af46839 <4>[ 132.381435] RDX: 0000000000000000 RSI: 000055dfdeb43670 RDI: 0000000000000004 <4>[ 132.381437] RBP: 000055dfdeb43670 R08: 0000000000000004 R09: 0000000000000000 <4>[ 132.381440] R10: 00007ffcd84f4e60 R11: 0000000000000246 R12: 0000000000000000 <4>[ 132.381442] R13: 000055dfdeb3bec0 R14: 0000000000000000 R15: 000000000000003b <3>[ 132.381466] Allocated by task 5822: <4>[ 132.381485] kmem_cache_alloc+0xdf/0x2e0 <4>[ 132.381546] i915_gem_object_create_internal+0x24/0x1e0 [i915] <4>[ 132.381609] igt_mmap_offset_exhaustion+0x257/0x940 [i915] <4>[ 132.381677] __i915_subtests+0x5a/0x160 [i915] <4>[ 132.381742] __run_selftests+0x1a2/0x2f0 [i915] <4>[ 132.381806] i915_live_selftests+0x4e/0x80 [i915] <4>[ 132.381865] i915_pci_probe+0xd8/0x1b0 [i915] <4>[ 132.381868] pci_device_probe+0x1c5/0x3a0 <4>[ 132.381871] driver_probe_device+0x6b6/0xcb0 <4>[ 132.381874] __driver_attach+0x22d/0x2c0 <4>[ 132.381877] bus_for_each_dev+0x113/0x1a0 <4>[ 132.381880] bus_add_driver+0x38b/0x6e0 <4>[ 132.381884] driver_register+0x189/0x400 <4>[ 132.381886] do_one_initcall+0xa0/0x4c0 <4>[ 132.381889] do_init_module+0x1b5/0x54c <4>[ 132.381892] load_module+0x619e/0x9b70 <4>[ 132.381895] __se_sys_finit_module+0x17c/0x1a0 <4>[ 132.381898] do_syscall_64+0x97/0x400 <4>[ 132.381901] entry_SYSCALL_64_after_hwframe+0x49/0xbe <3>[ 132.381914] Freed by task 150: <4>[ 132.381931] kmem_cache_free+0xb7/0x340 <4>[ 132.381995] __i915_gem_free_objects+0x875/0xf50 [i915] <4>[ 132.382054] __i915_gem_free_work+0x69/0xb0 [i915] <4>[ 132.382058] process_one_work+0x78b/0x1740 <4>[ 132.382061] worker_thread+0x82/0xb80 <4>[ 132.382064] kthread+0x30c/0x3d0 <4>[ 132.382067] ret_from_fork+0x3a/0x50 <3>[ 132.382081] The buggy address belongs to the object at ffff8801e1324500 which belongs to the cache drm_i915_gem_object of size 1168 <3>[ 132.382133] The buggy address is located 248 bytes inside of 1168-byte region [ffff8801e1324500, ffff8801e1324990) <3>[ 132.382179] The buggy address belongs to the page: <0>[ 132.382202] page:ffffea000784c800 count:1 mapcount:0 mapping:ffff8801dedf6500 index:0xffff8801e1323ec0 compound_mapcount: 0 <0>[ 132.382251] flags: 0x8000000000008100(slab|head) <1>[ 132.382274] raw: 8000000000008100 ffff8801d6317440 ffff8801d6317440 ffff8801dedf6500 <1>[ 132.382307] raw: ffff8801e1323ec0 0000000000140013 00000001ffffffff 0000000000000000 <1>[ 132.382339] page dumped because: kasan: bad access detected <3>[ 132.382373] Memory state around the buggy address: <3>[ 132.382395] ffff8801e1324480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc <3>[ 132.382426] ffff8801e1324500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb <3>[ 132.382457] >ffff8801e1324580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb <3>[ 132.382488] ^ <3>[ 132.382517] ffff8801e1324600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb <3>[ 132.382548] ffff8801e1324680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb This patch tricks the system into running without the background retire thread, until after we finish the test. The only reaping should then be performed by the mmap offset routine to reclaim the space as required. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180709130208.11730-1-chris@chris-wilson.co.uk commit 76411a0d97c3b216ce1c987aa4afa7f3789c89d9 Author: Rafael David Tinoco Date: Wed Jun 6 14:44:24 2018 -0300 gpio: selftests: gpio-mockup-chardev GPIOHANDLE_REQUEST_OUTPUT fix Following logic from commit: 22f6592b23, GPIOHANDLE_REQUEST_OUTPUT should handle errors same way as GPIOHANDLE_REQUEST_INPUT does, or else the following error occurs: gpio-mockup-chardev: gpio line<0> test flag<0x2> value<0>: No such file or directory despite the real result of gpio_pin_test(), gpio_debugfs_get() and gpiotools_request_linehandle() functions. Signed-off-by: Rafael David Tinoco Signed-off-by: Linus Walleij commit 6e1811900b6fe6f2b4665dba6bd6ed32c6b98575 Author: Jon Hunter Date: Tue Jul 3 09:59:47 2018 +0100 ARM: tegra: Fix Tegra30 Cardhu PCA954x reset On all versions of Tegra30 Cardhu, the reset signal to the NXP PCA9546 I2C mux is connected to the Tegra GPIO BB0. Currently, this pin on the Tegra is not configured as a GPIO but as a special-function IO (SFIO) that is multiplexing the pin to an I2S controller. On exiting system suspend, I2C commands sent to the PCA9546 are failing because there is no ACK. Although it is not possible to see exactly what is happening to the reset during suspend, by ensuring it is configured as a GPIO and driven high, to de-assert the reset, the failures are no longer seen. Please note that this GPIO is also used to drive the reset signal going to the camera connector on the board. However, given that there is no camera support currently for Cardhu, this should not have any impact. Fixes: 40431d16ff11 ("ARM: tegra: enable PCA9546 on Cardhu") Cc: stable@vger.kernel.org Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 8853daf3b4acb3bf8c0244a12b4f58ed5123f449 Author: Janusz Krzysztofik Date: Wed Jul 4 00:18:19 2018 +0200 gpiolib: Defer on non-DT find_chip_by_name() failure Avoid replication of error code conversion in non-DT GPIO consumers' code by returning -EPROBE_DEFER from gpiod_find() in case a chip identified by its label in a registered lookup table is not ready. See https://lkml.org/lkml/2018/5/30/176 for example case. Suggested-by: Boris Brezillon Signed-off-by: Janusz Krzysztofik Reviewed-by: Boris Brezillon Signed-off-by: Linus Walleij commit ea58c33d4d85504b4255dd74999603a6793bc56a Author: Hanno Zulla Date: Thu Jun 14 16:32:16 2018 +0200 HID: hid-sony.c: Use devm_ api to simplify sc->output_report_dmabuf HID: hid-sony.c: Use devm_ api to simplify sc->output_report_dmabuf Using devm_ calls, the resources of the Sony game devices's features are tied to the main device handle, making it easier to handle errors and teardown inside the device driver. Altogether, this reduces complexity of the driver source. Signed-off-by: Hanno Zulla Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 8082d3f02261adbdc4eb3301fb99960162c3d142 Author: Hanno Zulla Date: Thu Jun 14 16:31:36 2018 +0200 HID: hid-sony.c: Use devm_ api to simplify sony_battery_probe() HID: hid-sony.c: Use devm_ api to simplify sony_battery_probe() Using devm_ calls, the resources of the Sony game devices's features are tied to the main device handle, making it easier to handle errors and teardown inside the device driver. Altogether, this reduces complexity of the driver source. Signed-off-by: Hanno Zulla Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit f2d98e2c020e8f33813a746ac8a92a4582ac416a Author: Hanno Zulla Date: Thu Jun 14 16:30:46 2018 +0200 HID: hid-sony.c: Use devm_ api to simplify sony_leds_init() [PATCH 3/5] HID: hid-sony.c: Use devm_ api to simplify sony_leds_init() Using devm_ calls, the resources of the Sony game devices's features are tied to the main device handle, making it easier to handle errors and teardown inside the device driver. Altogether, this reduces complexity of the driver source. Signed-off-by: Hanno Zulla Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit ea4a5fdc8d07df9115881f698c14bcfd7046a846 Author: Hanno Zulla Date: Thu Jun 14 16:30:02 2018 +0200 HID: hid-sony.c: Use devm_ api to simplify sony_register_sensors() [PATCH 2/5] HID: hid-sony.c: Use devm_ api to simplify sony_register_sensors() Using devm_ calls, the resources of the Sony game devices's features are tied to the main device handle, making it easier to handle errors and teardown inside the device driver. Altogether, this reduces complexity of the driver source. Signed-off-by: Hanno Zulla Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit cc070a847bc0b6fb66e4c05b5bd036d2ea80fb9a Author: Hanno Zulla Date: Thu Jun 14 16:29:08 2018 +0200 HID: hid-sony.c: Use devm_ api to simplify sony_register_touchpad() HID: hid-sony.c: Use devm_ api to simplify sony_register_touchpad() Using devm_ calls, the resources of the Sony game devices's features are tied to the main device handle, making it easier to handle errors and teardown inside the device driver. Altogether, this reduces complexity of the driver source. Signed-off-by: Hanno Zulla Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 36b312792b97933dc07abe074f50941199bd357c Author: Andy Shevchenko Date: Tue Jul 3 03:38:31 2018 +0300 gpiolib: Respect error code of ->get_direction() In case we try to lock GPIO pin as IRQ when something going wrong we print a misleading message. Correct this by checking an error code from ->get_direction() in gpiochip_lock_as_irq() and printing a corresponding message. Signed-off-by: Andy Shevchenko Cc: Mika Westerberg Signed-off-by: Linus Walleij commit f8b52dd50ccdae7efc42ef54278f29d2f9d6cb36 Author: Anson Huang Date: Tue Jul 3 09:18:14 2018 +0800 gpio: mxc: Add clocks optional binding for imx gpio Some i.MX SoCs have GPIO clock gate in CCM, accessing GPIO registers needs to enable GPIO clock gate first, i.MX GPIO driver will enable clock gate if there is clock property in GPIO node of dtb, add optional property to i.MX GPIO binding doc. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Linus Walleij commit d9a13ce3fa5f396f100ab3f58e5ca127c77a74bb Author: Chris Wilson Date: Mon Jul 9 13:20:44 2018 +0100 drm/i915/selftests: Replace wait-on-timeout with explicit timeout In igt_flush_test() we install a background timer in order to ensure that the wait completes within a certain time. We can now tell the wait that it has to complete within a timeout, and so no longer need the background timer. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Tvrtko Ursulin Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180709122044.7028-3-chris@chris-wilson.co.uk commit 2621cefaa42b3a7455d30e78831c6b55290d40c8 Author: Chris Wilson Date: Mon Jul 9 13:20:43 2018 +0100 drm/i915: Provide a timeout to i915_gem_wait_for_idle() on setup With a broken GPU we expect it to fail during the initial GPU setup where do a couple of context switches to record the defaults. This is a task that takes a few milliseconds even on the slowest of devices, but we may have to wait 60s for hangcheck to give in and declare the machine inoperable. In this a case where any gpu hang is unacceptable, both from a timeliness and practical standpoint. We can therefore set a timeout on our wait-for-idle that is shorter than the hangcheck (which may be up to 60s for a declaring a wedged driver) and so detect the broken GPU much more quickly during driver load (and so prevent stalling userspace for ages). Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Tvrtko Ursulin Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180709122044.7028-2-chris@chris-wilson.co.uk commit ec625fb932bb057e2d3c2ed28eee56a827385ab8 Author: Chris Wilson Date: Mon Jul 9 13:20:42 2018 +0100 drm/i915: Provide a timeout to i915_gem_wait_for_idle() Usually we have no idea about the upper bound we need to wait to catch up with userspace when idling the device, but in a few situations we know the system was idle beforehand and can provide a short timeout in order to very quickly catch a failure, long before hangcheck kicks in. In the following patches, we will use the timeout to curtain two overly long waits, where we know we can expect the GPU to complete within a reasonable time or declare it broken. In particular, with a broken GPU we expect it to fail during the initial GPU setup where do a couple of context switches to record the defaults. This is a task that takes a few milliseconds even on the slowest of devices, but we may have to wait 60s for hangcheck to give in and declare the machine inoperable. In this a case where any gpu hang is unacceptable, both from a timeliness and practical standpoint. The other improvement is that in selftests, we do not need to arm an independent timer to inject a wedge, as we can just limit the timeout on the wait directly. v2: Include the timeout parameter in the trace. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Tvrtko Ursulin Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180709122044.7028-1-chris@chris-wilson.co.uk commit 64b2f025715a68bed49fb14588c2d893dfbd00a8 Author: Stefan Agner Date: Sat Jul 7 23:16:56 2018 +0200 arm: perf: prevent unbind/bind via sysfs Unbinding and rebinding the ARM PMU driver via sysfs leads to a warning followed by more errors: WARNING: CPU: 0 PID: 217 at kernel/irq/chip.c:1034 irq_modify_status+0x150/0x16c .. genirq: Flags mismatch irq 19. 00010c04 (arm-pmu) vs. 00010c04 (arm-pmu) hw perfevents: unable to request IRQ19 for ARM PMU counters hw perfevents: /pmu: failed to register PMU devices! armv7-pmu: probe of pmu failed with error -16 The driver is clearly not designed to be removed. Disable bind/ unbind for this driver. Signed-off-by: Stefan Agner Signed-off-by: Will Deacon commit ec93d5a25f9f959e6c20351e74182ad4bfa85716 Merge: ce397d215ccd 79db60a8bb0b Author: Florian Fainelli Date: Mon Jul 9 05:23:47 2018 -0700 Merge tag 'bcm2835-defconfig-64-next-2018-07-03' into defconfig-arm64/next This pull request enables the new RPi HWMON driver in the 64-bit defconfig. Signed-off-by: Florian Fainelli commit b0ba9fad81e419f85829c2a6925110d9714dd708 Merge: ce397d215ccd 7b54aafff3ef Author: Florian Fainelli Date: Mon Jul 9 05:23:16 2018 -0700 Merge tag 'bcm2835-defconfig-next-2018-07-03' into defconfig/next This pull request enables the new RPi HWMON driver in the 32-bit defconfigs. Signed-off-by: Florian Fainelli commit 03fc7f9c99c1e7ae2925d459e8487f1a6f199f79 Author: Petr Mladek Date: Wed Jun 27 16:20:28 2018 +0200 printk/nmi: Prevent deadlock when accessing the main log buffer in NMI The commit 719f6a7040f1bdaf96 ("printk: Use the main logbuf in NMI when logbuf_lock is available") brought back the possible deadlocks in printk() and NMI. The check of logbuf_lock is done only in printk_nmi_enter() to prevent mixed output. But another CPU might take the lock later, enter NMI, and: + Both NMIs might be serialized by yet another lock, for example, the one in nmi_cpu_backtrace(). + The other CPU might get stopped in NMI, see smp_send_stop() in panic(). The only safe solution is to use trylock when storing the message into the main log-buffer. It might cause reordering when some lines go to the main lock buffer directly and others are delayed via the per-CPU buffer. It means that it is not useful in general. This patch replaces the problematic NMI deferred context with NMI direct context. It can be used to mark a code that might produce many messages in NMI and the risk of losing them is more critical than problems with eventual reordering. The context is then used when dumping trace buffers on oops. It was the primary motivation for the original fix. Also the reordering is even smaller issue there because some traces have their own time stamps. Finally, nmi_cpu_backtrace() need not longer be serialized because it will always us the per-CPU buffers again. Fixes: 719f6a7040f1bdaf96 ("printk: Use the main logbuf in NMI when logbuf_lock is available") Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20180627142028.11259-1-pmladek@suse.com To: Steven Rostedt Cc: Peter Zijlstra Cc: Tetsuo Handa Cc: Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit a338f84dc196f44b63ba0863d2f34fd9b1613572 Author: Petr Mladek Date: Wed Jun 27 16:08:16 2018 +0200 printk: Create helper function to queue deferred console handling It is just a preparation step. The patch does not change the existing behavior. Link: http://lkml.kernel.org/r/20180627140817.27764-3-pmladek@suse.com To: Steven Rostedt Cc: Peter Zijlstra Cc: Tetsuo Handa Cc: Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit e7d4bac428edb806c5f5d903ab8850ffbe0ed9ce Author: Nikunj Kela Date: Fri Jul 6 10:47:24 2018 -0700 arm64: add ARM64-specific support for flatmem Flatmem is useful in reducing kernel memory usage. One usecase is in kdump kernel. We are able to save ~14M by moving to flatmem scheme. Cc: xe-kernel@external.cisco.com Cc: Nikunj Kela Signed-off-by: Nikunj Kela Signed-off-by: Will Deacon commit d7c7118caf99fc4fe3b2e1f47e3d23b2bbaf7929 Author: Will Deacon Date: Thu Jul 5 17:18:05 2018 +0100 MAINTAINERS: arm64: Remove boot/dts/ directory from arm64 entry The arm-soc tree does a good job handling .dts files, so exclude them from the ARM64 entry in MAINTAINERS. Cc: Catalin Marinas Acked-by: Olof Johansson Signed-off-by: Will Deacon commit ba552399954dde1b388f7749fecad5c349216981 Author: Petr Mladek Date: Wed Jun 27 16:08:15 2018 +0200 printk: Split the code for storing a message into the log buffer It is just a preparation step. The patch does not change the existing behavior. Link: http://lkml.kernel.org/r/20180627140817.27764-2-pmladek@suse.com To: Steven Rostedt Cc: Peter Zijlstra Cc: Tetsuo Handa Cc: Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 8512486ba2d441187d6d619006f034704a3e5a31 Author: Linus Walleij Date: Mon Jul 9 13:51:57 2018 +0200 gpio: mt7621: Edit to preferred syntax This fixes some syntactic nits that makes the GPIO maintainer happier. It is way easier to show by example and do it myself than to try to explain it with comments. It's just my personal taste of minimalism. Cc: Sergio Paracuellos Cc: NeilBrown Signed-off-by: Linus Walleij commit 7df533a7e3d2216e860ecf147ae8cee49bf133e9 Author: Jerome Brunet Date: Wed Jul 4 18:54:58 2018 +0200 clk: meson: add gen_clk GEN_CLK is able to route several internal clocks to one of the SoC pads. In the future, even more clocks could be made accessible using cts_msr_clk - the clock measure block. Signed-off-by: Jerome Brunet commit 80d396b5118f448cb2206a509aba6917691a835e Author: Jerome Brunet Date: Wed Jul 4 18:54:56 2018 +0200 clk: meson: gxbb: remove HHI_GEN_CLK_CTNL duplicate definition HHI_GEN_CLK_CTNL is defined twice, just remove the duplicate definition Fixes: 738f66d3211d ("clk: gxbb: add AmLogic GXBB clk controller driver") Acked-by: Martin Blumenstingl Signed-off-by: Jerome Brunet commit cddcb20b2bb36401e038d0ae41ba8a956d91f82e Author: Yixun Lan Date: Mon Jul 2 21:31:18 2018 +0000 clk: meson-axg: add clocks required by pcie driver Adding clocks for the pcie driver. Due to the ASIC design, the pcie controller re-use part of the mipi clock logic, so the mipi clock is also added. Tested-by: Jianxin Qin Signed-off-by: Yixun Lan [amended to remove unnecessary locales] Signed-off-by: Jerome Brunet commit 85ddc1a32cace10bc8b7dc5dfae98b6a1785fc0c Author: Jerome Brunet Date: Wed Jun 20 12:06:10 2018 +0200 clk: meson: remove unused clk-audio-divider driver clk-audio-divider is no longer used, we can remove it. Acked-by: Neil Armstrong Signed-off-by: Jerome Brunet commit 9799d5ae003c05f0db5d6c5884183a388b74ba3c Author: Jerome Brunet Date: Wed Jun 20 12:06:09 2018 +0200 clk: meson: stop rate propagation for audio clocks It is actually a lot easier to setup the PLL with carefully chosen rates than relying on CCF clock propagation for this audio use case. This way, we can make sure we will always be able to provide the common audio clock rates, while having the PLL in the optimal operating range. For this, we stop the rate propagation at the mux picking the PLL and let it round to the closest matching PLL. Doing so, we can use the generic divider for the i2s clock. clk-audio-divider is no longer required. It was a (poor) attempt to use CCF rate propagation while making sure the PLL rate would be high enough to work with audio use cases. Acked-by: Neil Armstrong Signed-off-by: Jerome Brunet commit 1cd50181750f4bde1e4305812a8df5a5731ed28a Author: Jerome Brunet Date: Tue May 22 18:34:57 2018 +0200 clk: meson: axg: add the audio clock controller driver The axg audio clock controller is the clock generation unit for the amlogic audio subsystem of A113 based SoCs. It may be clocked by 8 different plls provided by the primary clock controller and also by 10 slave bit clocks and 10 slave sample clocks which may be provided by external components, such as audio codecs, through the SoC pads. It contains several muxes, dividers and gates which are fed into the the different devices of the audio subsystem. Acked-by: Neil Armstrong Signed-off-by: Jerome Brunet commit 3054a55c5dd2619a597d6e96d8589318f2b210ad Author: Jerome Brunet Date: Tue May 22 18:34:55 2018 +0200 clk: meson: add axg audio sclk divider driver Add a driver to control the clock divider found in the sample clock generator of the axg audio clock controller. The sclk divider accumulates specific features which make the generic divider unsuitable to control it: - zero based divider (div = val + 1), but zero value gates the clock, so minimum divider value is 2. - lrclk variant may adjust the duty cycle depending the divider value and the 'hi' value. Acked-by: Neil Armstrong Signed-off-by: Jerome Brunet commit 2eb2a01b6477ac50ec686f4b0a74f2c3b6a55fe4 Merge: e8dd9207763e 9fba738a53dd Author: Jerome Brunet Date: Mon Jul 9 13:47:38 2018 +0200 Merge remote-tracking branch 'clk/clk-core-duty-cycle' into next/drivers commit e8dd9207763e0317ac256c78dcd50dca7826f2f6 Author: Jerome Brunet Date: Tue May 22 18:34:54 2018 +0200 clk: meson: add triple phase clock driver Add a driver to control the output of the sample clock generator found in the axg audio clock controller. The goal of this driver is to coherently control the phase provided to the different element using the sample clock generator. This simplify the usage of the sample clock generator a lot, without comprising the ability of the SoC. Acked-by: Neil Armstrong Signed-off-by: Jerome Brunet commit 47f21315a6e4454ed9d8a450288a0989113e1e44 Author: Jerome Brunet Date: Tue May 22 18:34:53 2018 +0200 clk: meson: add clk-phase clock driver Add a driver based meson clk-regmap to control clock phase on amlogic SoCs Acked-by: Neil Armstrong Signed-off-by: Jerome Brunet commit a9387f70cd27a8ca82c2141ef33787868d5c8de9 Merge: 443f2285789d de3c1e71d412 Author: Jerome Brunet Date: Mon Jul 9 13:46:33 2018 +0200 Merge branch 'next/dt' into next/drivers commit 443f2285789d2a4bf616b610c4cd8db839660a4a Author: Jerome Brunet Date: Tue May 22 18:34:52 2018 +0200 clk: meson: clean-up meson clock configuration Clean the dependencies in meson clock Kconfig. CLK_AMLOGIC should actually select CLK_REGMAP_MESON which it uses. Also, each platform should select CLK_AMLOGIC, so everything is properly turned on when the platform Kconfig enable each configuration flag Acked-by: Neil Armstrong Signed-off-by: Jerome Brunet commit 60e267f3fd73366feac2c0be5a50feb24118c2ca Author: Jerome Brunet Date: Tue Jun 19 18:00:50 2018 +0200 clk: meson: remove obsolete register access The legacy method to access the hhi register space is not longer used. We can safely drop it now. Acked-by: Neil Armstrong Signed-off-by: Jerome Brunet commit 4ba9c3afda41213ec98c30053e32963892e6dc7c Author: Sergio Paracuellos Date: Thu Jul 5 15:43:10 2018 +0200 gpio: mt7621: Add a driver for MT7621 Add driver support for gpio of MT7621 SoC. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown [Switched wording WIDTH to STRIDE] Signed-off-by: Linus Walleij commit 8599dc7dec874b137384714bfe3ddbbf5d4a614e Author: Petr Mladek Date: Wed Jun 27 17:06:41 2018 +0200 printk: Clean up syslog_print_all() syslog_print_all() is called twice. Once with a valid buffer and once just to set the indexes. Both variants are already handled separately. This patch just makes it more obvious. It does not change the existing behavior. Link: http://lkml.kernel.org/r/20180627150641.p56xyy6mdzvnfpig@pathway.suse.cz Cc: Sergey Senozhatsky Cc: Namit Gupta Cc: linux-kernel@vger.kernel.org Cc: pankaj.m@samsung.com Cc: a.sahrawat@samsung.com Cc: himanshu.m@samsung.com Signed-off-by: Petr Mladek commit de3c1e71d412d7e254e3eebeb82e260fb8513566 Author: Jerome Brunet Date: Wed Jul 4 18:54:57 2018 +0200 clk: meson: expose GEN_CLK clkid Expose GEN_CLK clock id Signed-off-by: Jerome Brunet commit af2b04d19242686a2c30e526c9b7a9e9c57bbce9 Author: Sergio Paracuellos Date: Thu Jul 5 15:43:11 2018 +0200 gpio: mt7621: Add DT bindings Add a devicetree binding documentation for the mt7621 gpio. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown Reviewed-by: Rob Herring Signed-off-by: Linus Walleij commit 38fce264b12bab641f22cef59db5d5b0b0cd841f Author: Gustavo A. R. Silva Date: Mon Jul 2 13:06:05 2018 -0500 dmaengine: nbpfaxi: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Vinod Koul commit 5bea327962fa296efd16f2d3369dd339ddd7ce6f Author: Lars-Peter Clausen Date: Fri Jul 6 16:19:14 2018 +0300 ASoC: adau171x1: Connect playback DAI to the DSP The playback DAI is connected to the DSP and the DSP might be sourcing signals from the playback stream. Add a DAPM route between the two to make sure that the playback DAI is powered up, when the DSP is active. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Signed-off-by: Mark Brown commit 9d1310daedae494874fe36a995172e64b06e29a4 Author: Arnd Bergmann Date: Fri Jul 6 15:30:48 2018 +0200 ASoC: pxa: make SND_PXA_SOC_SSP depend on PLAT_PXA For the moment, we can't enable CONFIG_SND_PXA_SOC_SSP unless we are building for ARM PXA or MMP: WARNING: unmet direct dependencies detected for PXA_SSP Depends on [n]: PLAT_PXA [=n] Selected by [y]: - SND_PXA_SOC_SSP [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] This adds an explicit dependency for it. Fixes: 0a94cf345740 ("ASoC: pxa: make SND_PXA2XX_SOC_I2S selectable") Signed-off-by: Arnd Bergmann Signed-off-by: Mark Brown commit 1aa1b918946537c089716bffd1399e30a2981cb7 Author: Dan Carpenter Date: Fri Jul 6 11:37:18 2018 +0300 regulator: max8997: clean up a condition in max8997_list_voltage() The current code generates a static cehcker warnings because "rid < 0" is always false: drivers/regulator/max8997-regulator.c:169 max8997_list_voltage() warn: condition is always false The problem is that because of type promotion, if "rid" is negative the comparison against ARRAY_SIZE() is type promoted to size_t and it's treated as a very high positive value. I've changed the order of the checks so now everyone is happy. Signed-off-by: Dan Carpenter Signed-off-by: Mark Brown commit 1cf86bc21257a330e3af51f2a4e885f1a705f6a5 Author: Douglas Anderson Date: Mon Jul 2 15:59:39 2018 -0700 pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant If you do this on an sdm845 board: grep "" /sys/kernel/debug/pinctrl/*spmi:pmic*/pinconf-groups ...it looks like nonsense. For every pin you see listed: input bias disabled, input bias high impedance, input bias pull down, input bias pull up, ... That's because pmic_gpio_config_get() isn't complying with the rules that pinconf_generic_dump_one() expects. Specifically for boolean parameters (anything with a "struct pin_config_item" where has_arg is false) the function expects that the function should return its value not through the "config" parameter but should return "0" if the value is set and "-EINVAL" if the value isn't set. Let's fix this. From a quick sample of other pinctrl drivers, it appears to be tradition to also return 1 through the config parameter for these boolean parameters when they exist. I'm not one to knock tradition, so I'll follow tradition and return 1 in these cases. While I'm at it, I'll also continue searching for four leaf clovers, kocking on wood three times, and trying not to break mirrors. NOTE: This also fixes an apparent typo for reading PIN_CONFIG_BIAS_DISABLE where the old driver was accidentally using "=" instead of "==" and thus was setting some internal state when you tried to query PIN_CONFIG_BIAS_DISABLE. Oops. Fixes: eadff3024472 ("pinctrl: Qualcomm SPMI PMIC GPIO pin controller driver") Signed-off-by: Douglas Anderson Signed-off-by: Linus Walleij commit 8db339d66774821091f73bd0e57c8a7511c5988e Author: benjamin.gaignard@linaro.org Date: Fri Jul 6 15:07:03 2018 +0200 ASoC: stm32: replace "%p" with "%pK" The format specifier "%p" can leak kernel addresses. Use "%pK" instead. Signed-off-by: Benjamin Gaignard Signed-off-by: Mark Brown commit 05e0c828955c1cab58dd71a04539442e5375d917 Author: Douglas Anderson Date: Mon Jul 2 15:59:38 2018 -0700 pinctrl: msm: Fix msm_config_group_get() to be compliant If you do this on an sdm845 board: cat /sys/kernel/debug/pinctrl/3400000.pinctrl/pinconf-groups ...it looks like nonsense. For every pin you see listed: input bias bus hold, input bias disabled, input bias pull down, input bias pull up That's because msm_config_group_get() isn't complying with the rules that pinconf_generic_dump_one() expects. Specifically for boolean parameters (anything with a "struct pin_config_item" where has_arg is false) the function expects that the function should return its value not through the "config" parameter but should return "0" if the value is set and "-EINVAL" if the value isn't set. Let's fix this. From a quick sample of other pinctrl drivers, it appears to be tradition to also return 1 through the config parameter for these boolean parameters when they exist. I'm not one to knock tradition, so I'll follow tradition and return 1 in these cases. While I'm at it, I'll also continue searching for four leaf clovers, kocking on wood three times, and trying not to break mirrors. Fixes: f365be092572 ("pinctrl: Add Qualcomm TLMM driver") Signed-off-by: Douglas Anderson Signed-off-by: Linus Walleij commit b1911710e6e5a9faf91e1925b1e2cdd007920c4c Author: Andy Shevchenko Date: Tue Jul 3 03:39:03 2018 +0300 gpiolib: Join string literals back For easy grepping on debug purposes join string literals back in the messages. While here, fix couple of small indentation issues. Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 63f3fb8d7ccb813e0a1f2ceedb9a3ebe2685b620 Author: Douglas Anderson Date: Mon Jul 2 15:59:37 2018 -0700 pinctrl: Document pin_config_group_get() return codes like pin_config_get() The pinconf_generic_dump_one() function makes the assumption that pin_config_group_get() should return -EINVAL and -ENOTSUPP just like pin_config_get() does. Document that so it's more obvious. Signed-off-by: Douglas Anderson Signed-off-by: Linus Walleij commit ab9a13665e7c25b31cbe4f6ea8acf2deaad5cacd Author: Peter Robinson Date: Wed Jul 4 09:37:38 2018 +0100 ARM: dts: pandaboard: add gpio user button The PandaBoard has a user button connected to GPIO. On the ES this is connected to GPIO 113, on all the other Panda editons this is GPIO 121. Signed-off-by: Peter Robinson Signed-off-by: Tony Lindgren commit 8008b6f3ac155ff9351841ac00253cd41119d1d8 Author: Derald D. Woods Date: Tue Jul 3 20:48:30 2018 -0500 ARM: dts: am3517-evm: Add 'vdd_io_reg' regulator references There are a few peripherals that generate some extra noise when they don't have a regulator assigned to them. This patch assigns them to their actual tps65023 regulator 'vdd_io_reg' (VDCDC2). Signed-off-by: Derald D. Woods Signed-off-by: Adam Ford Signed-off-by: Tony Lindgren commit de73708915adc1b3f05e617a86da6b2d68fae141 Author: Marc Zyngier Date: Thu Jun 21 10:43:59 2018 +0100 KVM: arm/arm64: Enable adaptative WFE trapping Trapping blocking WFE is extremely beneficial in situations where the system is oversubscribed, as it allows another thread to run while being blocked. In a non-oversubscribed environment, this is the complete opposite, and trapping WFE is just unnecessary overhead. Let's only enable WFE trapping if the CPU has more than a single task to run (that is, more than just the vcpu thread). Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 0a72a5ab9feb8ba6101b00bbcac14cdbae1d1df7 Author: Marc Zyngier Date: Tue May 1 12:09:42 2018 +0100 KVM: arm/arm64: Remove unnecessary CMOs when creating HYP page tables There is no need to perform cache maintenance operations when creating the HYP page tables if we have the multiprocessing extensions. ARMv7 mandates them with the virtualization support, and ARMv8 just mandates them unconditionally. Let's remove these operations. Acked-by: Mark Rutland Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 0db9dd8a0fbd5c861737bf2a8a2852e56dbd7ceb Author: Marc Zyngier Date: Wed Jun 27 15:51:05 2018 +0100 KVM: arm/arm64: Stop using the kernel's {pmd,pud,pgd}_populate helpers The {pmd,pud,pgd}_populate accessors usage have always been a bit weird in KVM. We don't have a struct mm to pass (and neither does the kernel most of the time, but still...), and the 32bit code has all kind of cache maintenance that doesn't make sense on ARMv7+ when MP extensions are mandatory (which is the case when the VEs are present). Let's bite the bullet and provide our own implementations. The only bit of architectural code left has to do with building the table entry itself (arm64 having up to 52bit PA, arm lacking PUD level). Acked-by: Mark Rutland Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 88dc25e8ea7c968bbf76d033431e2d7e1418bcd7 Author: Marc Zyngier Date: Fri May 25 12:23:11 2018 +0100 KVM: arm/arm64: Consolidate page-table accessors The arm and arm64 KVM page tables accessors are pointlessly different between the two architectures, and likely both wrong one way or another: arm64 lacks a dsb(), and arm doesn't use WRITE_ONCE. Let's unify them. Acked-by: Mark Rutland Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 2f6ea23f63cca99cd514c221f075c986b57c927e Author: Marc Zyngier Date: Wed Apr 25 17:58:20 2018 +0100 arm64: KVM: Avoid marking pages as XN in Stage-2 if CTR_EL0.DIC is set On systems where CTR_EL0.DIC is set, we don't need to perform icache invalidation to guarantee that we'll fetch the right instruction stream. This also means that taking a permission fault to invalidate the icache is an unnecessary overhead. On such systems, we can safely leave the page as being executable. Acked-by: Catalin Marinas Acked-by: Mark Rutland Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 09605e94c2cbb67c6472c07e1c06a7a0e7271f83 Author: Marc Zyngier Date: Thu May 17 11:05:08 2018 +0100 arm64: KVM: Handle Set/Way CMOs as NOPs if FWB is present Set/Way handling is one of the ugliest corners of KVM. We shouldn't have to handle that, but better safe than sorry. Thankfully, FWB fixes this for us by not requiering any maintenance (the guest is forced to use cacheable memory, no matter what it says, and the whole system is garanteed to be cache coherent), which means we don't have to emulate S/W CMOs, and don't have to track VM ops either. We still have to trap S/W though, if only to prevent the guest from doing something bad. Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier commit e48d53a91f6e90873e21a5ca5e8c0d7a9f8936a4 Author: Marc Zyngier Date: Fri Apr 6 12:27:28 2018 +0100 arm64: KVM: Add support for Stage-2 control of memory types and cacheability Up to ARMv8.3, the combinaison of Stage-1 and Stage-2 attributes results in the strongest attribute of the two stages. This means that the hypervisor has to perform quite a lot of cache maintenance just in case the guest has some non-cacheable mappings around. ARMv8.4 solves this problem by offering a different mode (FWB) where Stage-2 has total control over the memory attribute (this is limited to systems where both I/O and instruction fetches are coherent with the dcache). This is achieved by having a different set of memory attributes in the page tables, and a new bit set in HCR_EL2. On such a system, we can then safely sidestep any form of dcache management. Acked-by: Catalin Marinas Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 1689cac5b32a6db6f812e8063ea418a7cf023d03 Author: Vivek Gautam Date: Wed Jun 27 18:20:56 2018 +0530 driver core: Add flag to autoremove device link on supplier unbind Add a flag to autoremove the device links on supplier driver unbind. This obviates the need to explicitly delete the link in the remove path. We remove these links only when the supplier's link to its consumers has gone to DL_STATE_SUPPLIER_UNBIND state. Signed-off-by: Vivek Gautam Suggested-by: Lukas Wunner Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit e88728f46cfbb59cc7e7acf1d230c05ec093764e Author: Vivek Gautam Date: Wed Jun 27 18:20:55 2018 +0530 driver core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER Now that we want to add another flag to autoremove the device link on supplier unbind, it's fair to rename the existing flag from DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can add similar flag for supplier later. And, while we are touching device.h, fix a doc build warning. Signed-off-by: Vivek Gautam Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 27dceb81f445c58b1d10d27d26eaf4ac2e9e0b00 Author: Ulf Hansson Date: Fri Jun 29 13:04:32 2018 +0200 PM / Domains: Introduce dev_pm_domain_attach_by_name() For the multiple PM domain case, let's introduce a new API called dev_pm_domain_attach_by_name(). This allows a consumer driver to associate its device with one of its PM domains, by using a name based lookup. Do note that, currently it's only genpd that supports multiple PM domains per device, but dev_pm_domain_attach_by_name() can easily by extended to cover other PM domain types, if/when needed. Signed-off-by: Ulf Hansson Tested-by: Rajendra Nayak Reviewed-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 5d6be70add65e3f236642ab0029e356261617cd0 Author: Ulf Hansson Date: Fri Jun 29 13:04:31 2018 +0200 PM / Domains: Introduce option to attach a device by name to genpd For the multiple PM domain case, let's introduce a new function called genpd_dev_pm_attach_by_name(). This allows a device to be associated with its PM domain through genpd, by using a name based lookup. Note that, genpd_dev_pm_attach_by_name() shall only be called by the driver core / PM core, similar to how the existing dev_pm_domain_attach_by_id() makes use of genpd_dev_pm_attach_by_id(). However, this is implemented by following changes on top. Signed-off-by: Ulf Hansson Tested-by: Rajendra Nayak Reviewed-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 79a5c45199cd942047b1cf7bb50ff0699c2a3af0 Author: Ulf Hansson Date: Fri Jun 29 13:04:30 2018 +0200 PM / Domains: dt: Add a power-domain-names property Let's add a power-domain-names property, to allow consumer drivers to match the power-domains specifiers via a list of power domain names. This follows the same concept as for other similar DT bindings. Signed-off-by: Ulf Hansson Tested-by: Rajendra Nayak Reviewed-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit e147913247e3a7ea98e72e8537336bcea06c2405 Author: Chris Wilson Date: Sat Jul 7 11:04:05 2018 +0100 drm/i915/selftests: Magic numbers for old Y-tiling i915g has a slightly different tiling layout, and so requires a different reference swizzle pattern. Testcase: igt/drv_selftests/live_objects #gdg Signed-off-by: Chris Wilson Acked-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180707100405.817-1-chris@chris-wilson.co.uk commit 23cae492b4ed8cb2eb741f21a48bfd712960e87f Author: Dan Carpenter Date: Sat May 19 09:37:15 2018 +0300 firmware: arm_scmi: remove some unnecessary checks The "pi->dom_info" buffer is allocated in init() and it can't be NULL here. These tests are sort of weird as well because if "pi->dom_info" was NULL but "domain" was non-zero then it would lead to an Oops. Signed-off-by: Dan Carpenter Signed-off-by: Sudeep Holla commit 6663484b4e2d98f5609dc1b90fe4c242dd8fe18a Author: Kees Cook Date: Fri Jun 29 11:48:50 2018 -0700 EDAC, thunderx: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], switch to using a kmalloc-allocated buffer instead of stack space. This should be fine since the existing routine is allocating memory too. Signed-off-by: Kees Cook Acked-by: Jan Glauber Cc: David Daney Cc: linux-edac Link: http://lkml.kernel.org/r/20180629184850.GA37464@beast Link: https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com [1] Signed-off-by: Borislav Petkov commit 2c4c2a71bd6f75c3982ac09407889b110673ac83 Author: Randy Dunlap Date: Sat Jul 7 08:25:01 2018 -0700 ACPI / button: fix defined but not used warning Fix a build warning in the ACPI button driver when CONFIG_PROC_FS is not enabled by marking the unused function as __maybe_unused. ../drivers/acpi/button.c:252:12: warning: 'acpi_button_state_seq_show' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap Signed-off-by: Rafael J. Wysocki commit e74770fb6823c6fde49c3f2b38e3a2e68ae46682 Author: Bob Moore Date: Fri Jun 29 11:28:13 2018 -0700 ACPICA: Update version to 20180629 Version 20180629. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit a9efdcffd54dc1098a089c3c833eef8d7bee4d77 Author: Erik Schmauss Date: Fri Jun 29 11:28:12 2018 -0700 ACPICA: Revert "iASL compiler: allow compilation of externals with paths that refer to existing names" Revert commit 3ddd3f6a9410 (ACPICA: iASL compiler: allow compilation of externals with paths that refer to existing names; upstream ACPICA commit 9a252114197409290813bee570e9d53c22b99d32). This was done in order to allow more relaxed usage of ASL external declarations. Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit da7f7126f04c37cf0b33a75b7a5dd3c1b2adfa2b Author: Erik Schmauss Date: Fri Jun 29 11:28:11 2018 -0700 ACPICA: Revert "iASL: change processing of external op namespace nodes for correctness" Revert commit b43eac6f3384 (ACPICA: iASL: change processing of external op namespace nodes for correctness; upstream ACPICA commit aa866a9b4f24bbec9f158d10325b486d7d12d90f). This was done in order to allow more relaxed usage of ASL external declarations. Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit d072094b0d4e96a55661f07c0b56077162b38927 Author: Dmitry Osipenko Date: Sun May 20 16:48:46 2018 +0300 ARM: dts: tegra30: Add Memory Client reset to VDE Hook up Memory Client reset of the Video Decoder to the decoders DT node. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit a37ff8f985cbc5333b735244ffd586e6e0e47346 Author: Dmitry Osipenko Date: Sun May 20 16:48:44 2018 +0300 ARM: dts: tegra20: Add Memory Client reset to VDE Hook up Memory Client reset of the Video Decoder to the decoders DT node. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 518ea3c54eb7e454b718a50aa35bc5ea7856aa20 Author: Ilan Peer Date: Fri Jul 6 15:29:05 2018 +0300 mac80211_hwsim: Add support for HE Add support for HE in mac8011_hwsim, conforming with P802.11ax_D2.0. Signed-off-by: Liad Kaufman Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 0832b603c7583e75f149ea984827b6d929f336b5 Author: Johannes Berg Date: Tue Jul 3 14:47:25 2018 +0200 mac80211: don't put null-data frames on the normal TXQ Since (QoS) NDP frames shouldn't be put into aggregation nor are assigned real sequence numbers, etc. it's better to treat them as non-data packets and not put them on the normal TXQs, for example when building A-MPDUs they need to be treated specially, and they are more used for management (e.g. to see if the station is alive) anyway. Signed-off-by: Johannes Berg commit dcb14337e0f2adb227c376e6327ef0c3e4cce6f9 Author: Shilpasri G Bhat Date: Wed Apr 25 11:44:55 2018 +0530 cpufreq: powernv: Remove global pstate ramp-down timer in POWER9 POWER9 does not support global pstate requests for the chip. So remove the timer logic which slowly ramps down the global pstate in P9 platforms. Signed-off-by: Shilpasri G Bhat Acked-by: Viresh Kumar [mpe: Drop NULL check before kfree(policy->driver_data)] Signed-off-by: Michael Ellerman commit 215af5499d9e2b55f111d2431ea20218115f29b3 Author: Thomas Gleixner Date: Sat Jul 7 11:40:18 2018 +0200 cpu/hotplug: Online siblings when SMT control is turned on Writing 'off' to /sys/devices/system/cpu/smt/control offlines all SMT siblings. Writing 'on' merily enables the abilify to online them, but does not online them automatically. Make 'on' more useful by onlining all offline siblings. Signed-off-by: Thomas Gleixner commit f1fd4a4db777030a2542701fb0d3a261d4472d6d Author: Tomer Maimon Date: Wed Jul 4 02:23:26 2018 +0300 hwmon: Add NPCM7xx PWM and Fan driver Add Nuvoton BMC NPCM750/730/715/705 Pulse Width Modulation (PWM) and Fan tacho driver. The Nuvoton BMC NPCM750/730/715/705 supports 8 PWM controller outputs and 16 Fan controller inputs. The driver provides a sysfs entries through which the user can configure the duty-cycle value from 0(off) and 255(full speed) and read the fan tacho rpm value. Signed-off-by: Tomer Maimon Signed-off-by: Guenter Roeck commit 68dde6cae6e523dfec8ec097af2c41680fb766c6 Author: Tomer Maimon Date: Wed Jul 4 02:23:25 2018 +0300 dt-binding: hwmon: Add NPCM7xx PWM and Fan controller documentation Added device tree binding documentation for Nuvoton BMC NPCM7xx Pulse Width Modulation (PWM) and Fan tach controller. The Nuvoton BMC NPCM7XX supports 8 PWM controller outputs and 16 Fan tachometer controller inputs. Signed-off-by: Tomer Maimon Reviewed-by: Rob Herring [groeck: Fixed whitespace errors noticed by git] Signed-off-by: Guenter Roeck commit 7a001dbab4ade869a149318f5f112c4f185a40dc Author: Kun Yi Date: Tue Jul 3 15:26:49 2018 -0700 hwmon: (pmbus/max34440) Add support for MAX34451. MAX34451 is a 16-Channel Voltage/Current Monitor and 12-Channel Sequencer. Signed-off-by: Kun Yi Signed-off-by: Guenter Roeck commit fb41a710f84efd1f7a85ffcc4adead6a971b5163 Author: Shilpasri G Bhat Date: Fri Jul 6 17:26:06 2018 +0530 hwmon: Document the sensor enable attribute Document new ABI attributes: in[0-*]_enable fan[1-*]_enable temp[1-*]_enable curr[1-*]_enable power[1-*]_enable energy[1-*]_enable humidity[1-*]_enable Signed-off-by: Shilpasri G Bhat [groeck: Updated commit text, removed unnecessary details from ABI description] Signed-off-by: Guenter Roeck commit 65afb4c8e7e4e7e74b28efa1df62da503ca3e7a6 Author: Vadim Pasternak Date: Tue Jul 3 07:00:09 2018 +0000 hwmon: (mlxreg-fan) Add support for Mellanox FAN driver Driver obtains PWM and tachometers registers location according to the system configuration and creates FAN/PWM hwmon objects and a cooling device. PWM and tachometers are controlled through the on-board programmable device, which exports its register map. This device could be attached to any bus type, for which register mapping is supported. Single instance is created with one PWM control, up to 12 tachometers and one cooling device. It could be as many instances as programmable device supports. Currently driver will be activated from the Mellanox platform driver: drivers/platform/x86/mlx-platform.c. For the future ARM based systems it could be activated from the ARM platform module. Signed-off-by: Vadim Pasternak Signed-off-by: Guenter Roeck commit ffb32432457c6a6deffb64982b54d8f7b72ef618 Author: Gustavo A. R. Silva Date: Mon Jul 2 16:30:17 2018 -0500 hwmon: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Jean Delvare Signed-off-by: Guenter Roeck commit 57fec3acb47c99c688de9daf4c6a2ffa364cdb16 Author: Guenter Roeck Date: Mon Jun 18 09:21:46 2018 -0700 hwmon: (nct6775) Fix comment in the description of pwm_mode Commit 415eb2a1aaa488 ("hwmon: (nct6775) Fix writing pwmX_mode") changed the definition of the pwm_mode variable, but did not update the comment describing it. Reported-by: Ben Hutchings Cc: Ben Hutchings Signed-off-by: Guenter Roeck commit 73ed6e22c34f4de09f5af5dfe3926e1d41082a89 Author: Jakob Albert Date: Wed Jun 13 17:13:25 2018 +0200 hwmon: (nct7904) Fix UNSPECIFIED_INT warning Fix UNSPECIFIED_INT warning reported by checkpatch.pl Signed-off-by: Lorenz Kaestle Signed-off-by: Jakob Albert Signed-off-by: Guenter Roeck commit 12f0c3401cea2d0a62413a71a6f930a9e975265b Author: Jakob Albert Date: Wed Jun 13 17:13:24 2018 +0200 hwmon: (nct7904) Fix CODE_INDENT error Fix CODE_INDENT error reported by checkpatch.pl Signed-off-by: Lorenz Kaestle Signed-off-by: Jakob Albert Signed-off-by: Guenter Roeck commit ec1460ef7a2c8f75e8efe9b140424dd1ab1e5e28 Author: Jakob Albert Date: Wed Jun 13 17:13:23 2018 +0200 hwmon: (nct7904) Fix SPACING errors Fix SPACING errors reported by checkpatch.pl Signed-off-by: Lorenz Kaestle Signed-off-by: Jakob Albert Signed-off-by: Guenter Roeck commit 93d68b258e7d6b2b4b0716c6f33a38d5b6a536ff Author: Colin Xu Date: Mon Jul 9 09:28:18 2018 +0800 drm/i915/gvt: Handle EDP_PSR_IMR and EDP_PSR_IIR for BXT. BXT supports EDP. However since GVT-g only simulate DP monitor to guest and handles EDP_PSR_IMR and EDP_PSR_IIR as default MMIO r/w. If guest r/w these IMR/IIR, GVT-g won't simulate the real HW behavior and below warning is printed: -------- Interrupt register 0x64838 is not zero: 0xffffffff WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/i915/i915_irq.c:161 gen3_assert_iir_is_zero+0x34/0xa0 Call Trace: gen8_de_irq_postinstall+0xad/0x330 gen8_irq_postinstall+0x23/0x80 drm_irq_install+0xb5/0x130 i915_driver_load+0xafd/0xf70 -------- Since GVT-g won't simulate EDP to guest, always set EDP_PSR_IMR and EDP_PSR_IIR IMR/IIR to 0. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit aa36ed6d9536ad694995340264b69d57b01da7d3 Author: Changbin Du Date: Tue May 15 10:35:46 2018 +0800 drm/i915: Enable platform support for vGPU huge gtt pages Now GVTg supports shadowing both 2M/64K huge gtt pages. So let's turn on the cap info bit VGT_CAPS_HUGE_GTT. v2: Split changes in i915 side into a separated patch. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 80e76ea631de6e14c2c436b278ee0c6871227606 Author: Changbin Du Date: Tue May 15 10:35:45 2018 +0800 drm/i915/gvt: Fix error handling in ppgtt_populate_spt_by_guest_entry Don't forget to free allocated spt if shadowing failed. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 54c81653bd67ce2a11fa08295d9148385ea29603 Author: Changbin Du Date: Tue May 15 10:35:44 2018 +0800 drm/i915/gvt: Handle special sequence on PDE IPS bit If the guest update the 64K gtt entry before changing IPS bit of PDE, we need to re-shadow the whole page table. Because we have ignored all updates to unused entries. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit b901b252b6cf5cecc612059ccf05d974a9085c58 Author: Changbin Du Date: Tue May 15 10:35:43 2018 +0800 drm/i915/gvt: Add 2M huge gtt support This add 2M huge gtt support for GVTg. Unlike 64K gtt entry, we can shadow 2M guest entry with real huge gtt. But before that, we have to check memory physical continuous, alignment and if it is supported on the host. We can get all supported page sizes from intel_device_info.page_sizes. Finally we must split the 2M page into smaller pages if we cannot satisfy guest Huge Page. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 79e542f5af79918e5e766c441561fb9bff8af3aa Author: Changbin Du Date: Tue May 15 10:35:42 2018 +0800 drm/i915/kvmgt: Support setting dma map for huge pages To support huge gtt, we need to support huge pages in kvmgt first. This patch adds a 'size' param to the intel_gvt_mpt::dma_map_guest_page API and implements it in kvmgt. v2: rebase. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit eb3a353014d2c2402e572ab7bef86bf5e328160f Author: Changbin Du Date: Tue May 15 10:35:41 2018 +0800 drm/i915/gvt: Add 64K huge gtt support Finally, this add the first huge gtt support for GVTg - 64K pages. Since 64K page and 4K page cannot be mixed on the same page table, so we always split a 64K entry into small 4K page. And when unshadow guest 64K entry, we need ensure all the shadowed entries in shadow page table also get cleared. For page table which has 64K gtt entry, only PTE#0, PTE#16, PTE#32, ... PTE#496 are used. Unused PTEs update should be ignored. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 4c9414d7b152bf344521bf786b5748e833270776 Author: Changbin Du Date: Tue May 15 10:35:40 2018 +0800 drm/i915/gvt: Make PTE iterator 64K entry aware 64K PTE is special, only PTE#0, PTE#16, PTE#32, ... PTE#496 are used in the page table. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 155521c93e468211673206e1871b53d26a44a82d Author: Changbin Du Date: Tue May 15 10:35:39 2018 +0800 drm/i915/gvt: Split ppgtt_alloc_spt into two parts We need a interface to allocate a pure shadow page which doesn't have a guest page associated with. Such shadow page is used to shadow 2M huge gtt entry. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit c3e697635fcc9173e1d7116d9ebfd2fd0887177d Author: Changbin Du Date: Tue May 15 10:35:38 2018 +0800 drm/i915/gvt: Add GTT clear_pse operation Add clear_pse operation in case we need to split huge gtt into small pages. v2: correct description. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 716348485695de1a91b2f8b398f9c08687f794af Author: Changbin Du Date: Tue May 15 10:35:37 2018 +0800 drm/i915/gvt: Add software PTE flag to mark special 64K splited entry This add a software PTE flag on the Ignored bit of PTE. It will be used to identify splited 64K shadow entries. v2: fix mask definition. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 40b271767dcf9748327619ed550be810cc2e10ae Author: Changbin Du Date: Tue May 15 10:35:36 2018 +0800 drm/i915/gvt: Detect 64K gtt entry by IPS bit of PDE This change help us detect the real entry type per PSE and IPS setting. For 64K entry, we also need to check reg GEN8_GAMW_ECO_DEV_RW_IA. v2: Extend IPS mmio control to Gen10. (Matthew Auld) Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 52ca14e6844a04e174b5cd3d7dbf63a23271775c Author: Changbin Du Date: Tue May 15 10:35:35 2018 +0800 drm/i915/gvt: Handle MMIO GEN8_GAMW_ECO_DEV_RW_IA for 64K GTT The register RENDER_HWS_PGA_GEN7 is renamed to GEN8_GAMW_ECO_DEV_RW_IA from GEN8 which can control IPS enabling. v3: MMIO control for IPS is not removed from gen9 but gen10 (Matthew Auld) v2: IPS of all engines must be enabled together for gen9. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 6fd7937832698e73a5719ff488c2fc5e22c9c0ba Author: Changbin Du Date: Tue May 15 10:35:34 2018 +0800 drm/i915/gvt: Add PTE IPS bit operations Add three IPS operation functions to test/set/clear IPS in PDE. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit b294657d1bab3371bf02c31a243232bfa9f4629f Author: Changbin Du Date: Tue May 15 10:35:33 2018 +0800 drm/i915/gvt: Add new 64K entry type Add a new entry type GTT_TYPE_PPGTT_PTE_64K_ENTRY. 64K entry is very different from 2M/1G entry. 64K entry is controlled by IPS bit in upper PDE. To leverage the current logic, I take IPS bit as 'PSE' for PTE level. Which means, 64K entries can also processed by get_pse_type(). v2: Make it bisectable. Signed-off-by: Changbin Du Signed-off-by: Zhenyu Wang commit 405fcacbd866cfe75733b94bacdef5bcb4aa6c6c Author: Dmitry Osipenko Date: Tue Jun 5 15:12:32 2018 +0300 clk: tegra: emc: Avoid out-of-bounds bug Apparently there was an attempt to avoid out-of-bounds accesses when there is only one memory timing available, but there is a typo in the code that neglects that attempt. Signed-off-by: Dmitry Osipenko Signed-off-by: Stephen Boyd commit da0d2239a56ec8fe6a617aade5901ab3bffc1ef4 Author: Dmitry Osipenko Date: Mon Jun 4 01:48:05 2018 +0300 clk: tegra: Mark Memory Controller clock as critical Memory Controller should be always-on. Currently the sibling EMC clock is marked as critical, let's mark MC clock too for consistency. Signed-off-by: Dmitry Osipenko Acked-By: Peter De Schrijver Signed-off-by: Stephen Boyd commit 8097d4c75f00f3fce8f4916521ec61ec0c607324 Author: Thierry Reding Date: Mon Jun 11 10:20:37 2018 +0200 clk: tegra: Make vde a child of pll_c3 The current default is to leave the VDE clock's parent at the default, which is clk_m. However, that is not a configuration that will allow the VDE to function. Reparent it to pll_c3 instead to make sure the hardware can actually decode video content. Signed-off-by: Thierry Reding Signed-off-by: Stephen Boyd commit 26f8590c4a1f7bd30ef9b9d713388bd96eb43d16 Author: Thierry Reding Date: Mon Jun 11 10:18:53 2018 +0200 clk: tegra: Make vic03 a child of pll_c3 By default, the vic03 clock is a child of pll_m but that runs at 924 MHz which is too fast for VIC. Make vic03 a child of pll_c3 by default so it will run at a supported frequency. Signed-off-by: Thierry Reding Signed-off-by: Stephen Boyd commit 69448867abcb231afaa7891ff9d9fd04b2b94a0d Author: Amir Goldstein Date: Thu Jul 5 09:25:43 2018 +0300 fs: shave 8 bytes off of struct inode Here is a link to Linus' reply to Jan's concern about making i_blkbibts byte addressable: https://marc.info/?l=linux-fsdevel&m=152882624707975&w=2 Here is a link to an lkp.org report about potential performance improvement in some workload, which could(?) be related to packing i_blkbits closer to i_bytes/i_lock: https://marc.info/?l=linux-fsdevel&m=153077048108198&w=2 Changes since v1: - Add links to relevant discussions Signed-off-by: Amir Goldstein Signed-off-by: Al Viro commit f7b3182232c82bb9769e2d5471d702bae2972d2b Author: Mikko Perttunen Date: Fri Jun 29 17:38:14 2018 +0300 clk: tegra: bpmp: Don't crash when a clock fails to register When registering clocks, we just skip any that fail to register (leaving a NULL hole in the clock table). However, our of_xlate function still tries to dereference each entry while looking for the clock with the requested id, causing a crash if any clocks failed to register. Add a check to of_xlate to skip any NULL clocks. Signed-off-by: Mikko Perttunen Acked-by: Jon Hunter Signed-off-by: Stephen Boyd commit 5c324a2ffa06f8b6fda59a77c6807acb9f45cfee Author: Gilad Ben-Yossef Date: Sun Jul 1 08:02:39 2018 +0100 crypto: ccree - rate limit debug print A debug print about register status post interrupt can happen quite often. Rate limit it to avoid cluttering the log. Signed-off-by: Gilad Ben-Yossef Reported-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Herbert Xu commit 84f366dadc6a03dd39a3f4b2fc63347f04a56628 Author: Gilad Ben-Yossef Date: Sun Jul 1 08:02:38 2018 +0100 crypto: ccree - use CBC-CS3 CTS mode The ccree driver implemented NIST 800-38A CBC-CS2 ciphertext format, which only reverses the last two blocks if the stolen ciphertext amount are none zero. Move it to the kernel chosen format of CBC-CS3 which swaps the final blocks unconditionally and rename it to "cts" now that it complies with the kernel format and passes the self tests. Ironically, the CryptoCell REE HW does just that, so the fix is dropping the code that forced it to use plain CBC if the ciphertext was block aligned. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit d6b609d1b8e99694cfc47180e395f14fde68addb Author: Gilad Ben-Yossef Date: Sun Jul 1 08:02:37 2018 +0100 crypto: ccree - remove dead legacy code Remove legacy code no longer used by anything. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 00904aa0cd59a36d659ec93d272309e2174bcb5b Author: Gilad Ben-Yossef Date: Sun Jul 1 08:02:36 2018 +0100 crypto: ccree - fix iv handling We were copying our last cipher block into the request for use as IV for all modes of operations. Fix this by discerning the behaviour based on the mode of operation used: copy ciphertext for CBC, update counter for CTR. CC: stable@vger.kernel.org Fixes: 63ee04c8b491 ("crypto: ccree - add skcipher support") Reported by: Hadar Gat Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 76715095933b3a2e6082e171bc82ecd90baf9af0 Author: Gilad Ben-Yossef Date: Sun Jul 1 08:02:35 2018 +0100 crypto: testmgr - add hash finup tests The testmgr hash tests were testing init, digest, update and final methods but not the finup method. Add a test for this one too. While doing this, make sure we only run the partial tests once with the digest tests and skip them with the final and finup tests since they are the same. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 26497e72a1aba4d27c50c4cbf0182db94e58a590 Author: Hadar Gat Date: Sun Jul 1 08:02:34 2018 +0100 crypto: ccree - fix finup finup() operation was incorrect, padding was missing. Fix by setting the ccree HW to enable padding. Signed-off-by: Hadar Gat [ gilad@benyossef.com: refactored for better code sharing ] Signed-off-by: Gilad Ben-Yossef Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu commit 85d7311f1908b9ca20c10c2c23f5dbb93875f0c6 Author: Eric Biggers Date: Sat Jun 30 15:16:16 2018 -0700 crypto: remove redundant type flags from tfm allocation Some crypto API users allocating a tfm with crypto_alloc_$FOO() are also specifying the type flags for $FOO, e.g. crypto_alloc_shash() with CRYPTO_ALG_TYPE_SHASH. But, that's redundant since the crypto API will override any specified type flag/mask with the correct ones. So, remove the unneeded flags. This patch shouldn't change any actual behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 2c95e6d97892235b5b98cd4805e47fac87c2226f Author: Eric Biggers Date: Sat Jun 30 15:16:15 2018 -0700 crypto: skcipher - remove useless setting of type flags Some skcipher algorithms set .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER. But this is redundant with the C structure type ('struct skcipher_alg'), and crypto_register_skcipher() already sets the type flag automatically, clearing any type flag that was already there. Apparently the useless assignment has just been copy+pasted around. So, remove the useless assignment from all the skcipher algorithms. This patch shouldn't change any actual behavior. Signed-off-by: Eric Biggers Acked-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 3f4a537a26a68600ed1439222fb5e5c3aa513c7a Author: Eric Biggers Date: Sat Jun 30 15:16:14 2018 -0700 crypto: aead - remove useless setting of type flags Some aead algorithms set .cra_flags = CRYPTO_ALG_TYPE_AEAD. But this is redundant with the C structure type ('struct aead_alg'), and crypto_register_aead() already sets the type flag automatically, clearing any type flag that was already there. Apparently the useless assignment has just been copy+pasted around. So, remove the useless assignment from all the aead algorithms. This patch shouldn't change any actual behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit c87a405e3bacaae324bb05ee9a48aa9844688469 Author: Eric Biggers Date: Sat Jun 30 15:16:13 2018 -0700 crypto: ahash - remove useless setting of cra_type Some ahash algorithms set .cra_type = &crypto_ahash_type. But this is redundant with the C structure type ('struct ahash_alg'), and crypto_register_ahash() already sets the .cra_type automatically. Apparently the useless assignment has just been copy+pasted around. So, remove the useless assignment from all the ahash algorithms. This patch shouldn't change any actual behavior. Signed-off-by: Eric Biggers Acked-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 6a38f62245c9d5217b696ec5aca6a5cf6351f615 Author: Eric Biggers Date: Sat Jun 30 15:16:12 2018 -0700 crypto: ahash - remove useless setting of type flags Many ahash algorithms set .cra_flags = CRYPTO_ALG_TYPE_AHASH. But this is redundant with the C structure type ('struct ahash_alg'), and crypto_register_ahash() already sets the type flag automatically, clearing any type flag that was already there. Apparently the useless assignment has just been copy+pasted around. So, remove the useless assignment from all the ahash algorithms. This patch shouldn't change any actual behavior. Signed-off-by: Eric Biggers Acked-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit e50944e219f908968a6e01fbd0e8811a33bd5f04 Author: Eric Biggers Date: Sat Jun 30 15:16:11 2018 -0700 crypto: shash - remove useless setting of type flags Many shash algorithms set .cra_flags = CRYPTO_ALG_TYPE_SHASH. But this is redundant with the C structure type ('struct shash_alg'), and crypto_register_shash() already sets the type flag automatically, clearing any type flag that was already there. Apparently the useless assignment has just been copy+pasted around. So, remove the useless assignment from all the shash algorithms. This patch shouldn't change any actual behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 8aeef492fe248e0e56d888e2d5432724ac45f80d Author: Eric Biggers Date: Fri Jun 29 17:01:44 2018 -0700 crypto: x86/sha-mb - decrease priority of multibuffer algorithms With all the crypto modules enabled on x86, and with a CPU that supports AVX-2 but not SHA-NI instructions (e.g. Haswell, Broadwell, Skylake), the "multibuffer" implementations of SHA-1, SHA-256, and SHA-512 are the highest priority. However, these implementations only perform well when many hash requests are being submitted concurrently, filling all 8 AVX-2 lanes. Otherwise, they are incredibly slow, as they waste time waiting for more requests to arrive before proceeding to execute each request. For example, here are the speeds I see hashing 4096-byte buffers with a single thread on a Haswell-based processor: generic avx2 mb (multibuffer) ------- -------- ---------------- sha1 602 MB/s 997 MB/s 0.61 MB/s sha256 228 MB/s 412 MB/s 0.61 MB/s sha512 312 MB/s 559 MB/s 0.61 MB/s So, the multibuffer implementation is 500 to 1000 times slower than the other implementations. Note that with smaller buffers or more update()s per digest, the difference would be even greater. I believe the vast majority of people are in the boat where the multibuffer code is much slower, and only a small minority are doing the highly parallel, hashing-intensive, latency-flexible workloads (maybe IPsec on servers?) where the multibuffer code may be beneficial. Yet, people often aren't familiar with all the crypto config options and so the multibuffer code may inadvertently be built into the kernel. Also the multibuffer code apparently hasn't been very well tested, seeing as it was sometimes computing the wrong SHA-256 digest. So, let's make the multibuffer algorithms low priority. Users who want to use them can either request them explicitly by driver name, or use NETLINK_CRYPTO (crypto_user) to increase their priority at runtime. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit e47890163a3c2a6ec5a18322d283046d1bdec5e6 Author: Eric Biggers Date: Fri Jun 29 17:01:43 2018 -0700 crypto: sha512_generic - add cra_priority sha512-generic and sha384-generic had a cra_priority of 0, so it wasn't possible to have a lower priority SHA-512 or SHA-384 implementation, as is desired for sha512_mb which is only useful under certain workloads and is otherwise extremely slow. Change them to priority 100, which is the priority used for many of the other generic algorithms. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit b73b7ac0a77492b1bd671a72787931847b330c03 Author: Eric Biggers Date: Fri Jun 29 17:01:42 2018 -0700 crypto: sha256_generic - add cra_priority sha256-generic and sha224-generic had a cra_priority of 0, so it wasn't possible to have a lower priority SHA-256 or SHA-224 implementation, as is desired for sha256_mb which is only useful under certain workloads and is otherwise extremely slow. Change them to priority 100, which is the priority used for many of the other generic algorithms. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 90ef3e4835c33541f2eca0b4276fbc1dd83832d8 Author: Eric Biggers Date: Fri Jun 29 17:01:41 2018 -0700 crypto: sha1_generic - add cra_priority sha1-generic had a cra_priority of 0, so it wasn't possible to have a lower priority SHA-1 implementation, as is desired for sha1_mb which is only useful under certain workloads and is otherwise extremely slow. Change it to priority 100, which is the priority used for many of the other generic algorithms. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 26ec38872b5bc2105037f7a03fdd72afdf9fd241 Author: Eric Biggers Date: Fri Jun 29 14:21:11 2018 -0700 crypto: MAINTAINERS - fix file path for SHA multibuffer code "arch/x86/crypto/sha*-mb" needs a trailing slash, since it refers to directories. Otherwise get_maintainer.pl doesn't find the entry. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit af839b4e546613aed1fbd64def73956aa98631e7 Author: Eric Biggers Date: Fri Jun 29 14:14:35 2018 -0700 crypto: x86/sha256-mb - fix digest copy in sha256_mb_mgr_get_comp_job_avx2() There is a copy-paste error where sha256_mb_mgr_get_comp_job_avx2() copies the SHA-256 digest state from sha256_mb_mgr::args::digest to job_sha256::result_digest. Consequently, the sha256_mb algorithm sometimes calculates the wrong digest. Fix it. Reproducer using AF_ALG: #include #include #include #include #include #include static const __u8 expected[32] = "\xad\x7f\xac\xb2\x58\x6f\xc6\xe9\x66\xc0\x04\xd7\xd1\xd1\x6b\x02" "\x4f\x58\x05\xff\x7c\xb4\x7c\x7a\x85\xda\xbd\x8b\x48\x89\x2c\xa7"; int main() { int fd; struct sockaddr_alg addr = { .salg_type = "hash", .salg_name = "sha256_mb", }; __u8 data[4096] = { 0 }; __u8 digest[32]; int ret; int i; fd = socket(AF_ALG, SOCK_SEQPACKET, 0); bind(fd, (void *)&addr, sizeof(addr)); fork(); fd = accept(fd, 0, 0); do { ret = write(fd, data, 4096); assert(ret == 4096); ret = read(fd, digest, 32); assert(ret == 32); } while (memcmp(digest, expected, 32) == 0); printf("wrong digest: "); for (i = 0; i < 32; i++) printf("%02x", digest[i]); printf("\n"); } Output was: wrong digest: ad7facb2000000000000000000000000ffffffef7cb47c7a85dabd8b48892ca7 Fixes: 172b1d6b5a93 ("crypto: sha256-mb - fix ctx pointer and digest copy") Cc: # v4.8+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 9744fec95f0674fbf67b12c42c3784dc299dc904 Author: Ofer Heifetz Date: Thu Jun 28 17:21:57 2018 +0200 crypto: inside-secure - remove request list to improve performance This patch main goal is to improve driver performance by moving the crypto request from a list to a RDR ring shadow. This is possible since there is one producer and one consume for this RDR request shadow and one ring descriptor is left unused. Doing this change eliminates the use of spinlock when accessing the descriptor ring and the need to dynamicaly allocate memory per crypto request. The crypto request is placed in the first RDR shadow descriptor only if there are enough descriptors, when the result handler is invoked, it fetches the first result descriptor from RDR shadow. Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 6246987932a52c2676a3bab7d624a607aa228e59 Author: Ofer Heifetz Date: Thu Jun 28 17:21:56 2018 +0200 crypto: inside-secure - ecb(des3_ede) and cbc(des3_ede) support This patch adds support for two new algorithms in the Inside Secure SafeXcel cryptographic engine driver: ecb(des3_ede) and cbc(des3_ede). Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit a7dea8c0ff9f2573b1b34d320670693f979136b8 Author: Ofer Heifetz Date: Thu Jun 28 17:21:55 2018 +0200 crypto: inside-secure - ecb(des) and cbc(des) support This patch adds support for two algorithms in the Inside Secure SafeXcel cryptographic engine driver: ecb(des) and cbc(des). Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit b471e4b988af70eeb1940dddea62a92eff49023e Author: Ofer Heifetz Date: Thu Jun 28 17:21:54 2018 +0200 crypto: inside-secure - hmac(md5) support This patch adds support for the hmac(md5) algorithm in the Inside Secure SafeXcel cryptographic engine driver. Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 293f89cf930e7f0e99e74223673e3dc46380b26b Author: Ofer Heifetz Date: Thu Jun 28 17:21:53 2018 +0200 crypto: inside-secure - md5 support This patch adds the MD5 algorithm support to the Inside Secure SafeXcel cryptographic engine driver. Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 63b942782f1dd241d19a7584b4b644da0f5338c0 Author: Ofer Heifetz Date: Thu Jun 28 17:15:42 2018 +0200 crypto: inside-secure - set tx_max_cmd_queue to 32 The ORO bridge (connected to the EIP197 write channel) does not generate back pressure towards the EIP197 when its internal FIFO is full. It assumes that the EIP will not drive more write transactions than the maximal supported outstanding (32). Hence tx_max_cmd_queue must be configured to 5 (or less). Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit f1edf29a770ce97cd6b7e028a4999d24bb5ae492 Author: Ofer Heifetz Date: Thu Jun 28 17:15:41 2018 +0200 crypto: inside-secure - reset CDR and RDR rings on module removal This patch adds extra steps in the module removal path, to reset the command and result rings. The corresponding interrupts are cleared, and the ring address configuration is reset. Signed-off-by: Ofer Heifetz [Antoine: small reworks, commit message] Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit fbd0a7c920686721cbc6671cc7dd6c31d5ac6430 Author: Ofer Heifetz Date: Thu Jun 28 17:15:40 2018 +0200 crypto: inside-secure - adjust the TRC configuration for EIP197D This patch updates the TRC configuration so that the version of the EIP197 engine being used is taken into account, as the configuration differs between the EIP197B and the EIP197D. Signed-off-by: Ofer Heifetz [Antoine: commit message] Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 6cdc06d639dfe57749586a57bfff39d4731ca81d Author: Antoine Tenart Date: Thu Jun 28 17:15:39 2018 +0200 Documentation/bindings: crypto: inside-secure: eip197d support This patch documents the new compatible used for the eip197d engine, as this new engine is now supported by the Inside Secure SafeXcel cryptographic driver. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 5eb0911894b17e17859443b4c924583eb4bb20d0 Author: Antoine Tenart Date: Thu Jun 28 17:15:38 2018 +0200 crypto: inside-secure - eip197d support This patch adds support for the eip197d engine to the Inside Secure SafeXcel cryptographic driver. This new engine is similar to the eip197b and reuse most of its code. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 367571e43cfee4a8a6de11a53bba147f46221f84 Author: Ofer Heifetz Date: Thu Jun 28 17:15:37 2018 +0200 crypto: inside-secure - add multiple processing engine support So far a single processing engine (PE) was configured and used in the Inside Secure SafeXcel cryptographic engine driver. Some versions have more than a single PE. This patch rework the driver's initialization to take this into account and to allow configuring more than one PE. Signed-off-by: Ofer Heifetz [Antoine: some reworks and commit message.] Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 18e0e95b82e4440eaf4179c36aa5164b9bd8323d Author: Ofer Heifetz Date: Thu Jun 28 17:15:36 2018 +0200 crypto: inside-secure - dynamic ring configuration allocation The Inside Secure SafeXcel driver currently uses 4 rings, but the eip197d engines has 8 of them. This patch updates the driver so that rings are allocated dynamically based on the number of available rings supported by a given engine. Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 53c83e915ce8b2fdd7c4e143966a105c96454647 Author: Antoine Tenart Date: Thu Jun 28 17:15:35 2018 +0200 crypto: inside-secure - add an invalidation flag Add a flags field in the private structure, and a first flag for engines needing context invalidation (currently only the eip197b). The invalidation is needed when the engine includes a TRC cache, which will also be true for the upcoming addition of the eip197d engine. Suggested-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 998d2abb0cb343c419c63898a414084ac6c17100 Author: Antoine Tenart Date: Thu Jun 28 17:15:34 2018 +0200 crypto: inside-secure - filter out the algorithms by engine EIP engines do not support the same set of algorithms. So far the supported engines in the Inside Secure SafeXcel driver support the same set of algorithms, but that won't be true for all engines. This patch adds an 'engines' field in the algorithm definitions so that they only are registered when using a compatible cryptographic engine. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit bfda74ad6f507e19923c8870695b25d4247b2727 Author: Antoine Tenart Date: Thu Jun 28 17:15:33 2018 +0200 Documentation/bindings: crypto: inside-secure: update the compatibles The compatibles were updated in the Inside Secure SafeXcel cryptographic driver, as the ones previously used were not specific enough. The old compatibles are still supported by the driver for backward compatibility. This patch updates the documentation accordingly. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 7d8f52a30d5a70673415a58b6766e1ae505dd321 Author: Antoine Tenart Date: Thu Jun 28 17:15:32 2018 +0200 crypto: inside-secure - use precise compatibles At first we used two compatibles in the SafeXcel driver, named after the engine revision: eip97 and eip197. However this family of engines has more precise versions and in fact we're supporting the eip97ies and eip197b. More versions will be supported in the future, such as the eip197d, and we'll need to differentiate them. This patch fixes the compatibles used in the driver, to now use precise ones. The two historical compatibles are kept for backward compatibility. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 043ecc635f70c38d9fed1fe1ea20009cf45b12d6 Author: Antoine Tenart Date: Thu Jun 28 17:15:31 2018 +0200 crypto: inside-secure - move the firmware to a better location This patch moves the firmware loaded by the Inside Secure SafeXcel driver from /lib/firmware/ to /lib/firmware/inside-secure/eip197b/. This prepares the driver for future patches which will support other revisions of the EIP197 crypto engine as they'll have their own firmwares. To keep the compatibility of what was done, the old path is still supported as a fallback for the EIP197b (currently the only one supported by the driver that loads a firmware). Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit e3fe0ae129622b78e710e75ecbf7aca7af5dda47 Author: Stephan Mueller Date: Wed Jun 27 08:15:31 2018 +0200 crypto: dh - add public key verification test According to SP800-56A section 5.6.2.1, the public key to be processed for the DH operation shall be checked for appropriateness. The check shall covers the full verification test in case the domain parameter Q is provided as defined in SP800-56A section 5.6.2.3.1. If Q is not provided, the partial check according to SP800-56A section 5.6.2.3.2 is performed. The full verification test requires the presence of the domain parameter Q. Thus, the patch adds the support to handle Q. It is permissible to not provide the Q value as part of the domain parameters. This implies that the interface is still backwards-compatible where so far only P and G are to be provided. However, if Q is provided, it is imported. Without the test, the NIST ACVP testing fails. After adding this check, the NIST ACVP testing passes. Testing without providing the Q domain parameter has been performed to verify the interface has not changed. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 73463ade0a57d2c7f23e1dfad25d32f18c79db95 Author: lionel.debieve@st.com Date: Tue Jun 26 14:52:46 2018 +0200 crypto: stm32/crc - Add power management support Adding pm and pm_runtime support to STM32 CRC. Signed-off-by: Lionel Debieve Signed-off-by: Herbert Xu commit 8b4d566de6a5ecb332a7fe8d79731d4d6fc06d6b Author: lionel.debieve@st.com Date: Tue Jun 26 14:52:45 2018 +0200 crypto: stm32/hash - Add power management support Adding pm and pm_runtime support to STM32 HASH. Signed-off-by: Lionel Debieve Signed-off-by: Herbert Xu commit 65f9aa36ee47a2d6bf4c246c29c98d5f2842b4a6 Author: lionel.debieve@st.com Date: Tue Jun 26 14:52:44 2018 +0200 crypto: stm32/cryp - Add power management support Adding pm and pm_runtime support to STM32 CRYP. Signed-off-by: Lionel Debieve Signed-off-by: Herbert Xu commit cefd769fd0192c84d638f66da202459ed8ad63ba Author: Stafford Horne Date: Mon Jun 25 21:45:37 2018 +0900 crypto: skcipher - Fix -Wstringop-truncation warnings As of GCC 9.0.0 the build is reporting warnings like: crypto/ablkcipher.c: In function ‘crypto_ablkcipher_report’: crypto/ablkcipher.c:374:2: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation] strncpy(rblkcipher.geniv, alg->cra_ablkcipher.geniv ?: "", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sizeof(rblkcipher.geniv)); ~~~~~~~~~~~~~~~~~~~~~~~~~ This means the strnycpy might create a non null terminated string. Fix this by explicitly performing '\0' termination. Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Cc: Max Filippov Cc: Eric Biggers Cc: Nick Desaulniers Signed-off-by: Stafford Horne Signed-off-by: Herbert Xu commit ea169a30a6bf6782a05a51d2b9cf73db151eab8b Author: Stephan Mueller Date: Mon Jun 25 12:00:18 2018 +0200 crypto: ecdh - add public key verification test According to SP800-56A section 5.6.2.1, the public key to be processed for the ECDH operation shall be checked for appropriateness. When the public key is considered to be an ephemeral key, the partial validation test as defined in SP800-56A section 5.6.2.3.4 can be applied. The partial verification test requires the presence of the field elements of a and b. For the implemented NIST curves, b is defined in FIPS 186-4 appendix D.1.2. The element a is implicitly given with the Weierstrass equation given in D.1.2 where a = p - 3. Without the test, the NIST ACVP testing fails. After adding this check, the NIST ACVP testing passes. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 872d6d96cd050e534a1cd479cff72e7e34a4ba61 Merge: 3287ecdf14fd 990c10091db3 Author: Olof Johansson Date: Sun Jul 8 09:12:51 2018 -0700 Merge tag 'soc_drivers_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into next/drivers Keystone SOC driver update for 4.19 - Add suspend/resume functionality to TI EMIF SRAM driver - Add wakeup M3 RTC self refresh support - Fix for the PM runtime ifdefs * tag 'soc_drivers_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: soc: ti: wkup_m3_ipc: mark PM functions as __maybe_unused soc: ti: wkup_m3_ipc: Add wkup_m3_request_wake_src soc: ti: wkup_m3_ipc: Add rtc_only with ddr in self refresh mode support memory: ti-emif-sram: Add resume function to recopy sram code Signed-off-by: Olof Johansson commit 2d74fac5acd5b612b70216a77f248d8ab1165294 Merge: 021c91791a5e 60e9343b3551 Author: Olof Johansson Date: Sun Jul 8 09:10:40 2018 -0700 Merge tag 'keystone_config_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into next/defconfig ARM: Keystone config updates for 4.19 - Enable MMC support - Enable Micrel and DP83867 phys * tag 'keystone_config_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: ARM: configs: keystone: Enable CONFIG_MMC_SDHCI_OMAP ARM: keystone: k2g: enable micrel and dp83867 phys Signed-off-by: Olof Johansson commit df054c15440d42148ca74ed46956ee5a2c8a7770 Merge: c7ea1579a17e f7e8a182a41e Author: Olof Johansson Date: Sun Jul 8 09:10:03 2018 -0700 Merge tag 'keystone_dts_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into next/dt ARM: Keystone DTS updates for 4.19 - K2G NIC drriver support - Enbale network support for K2G ICE and EVM boards - Hardware Ring driver support for k2hk, k2l and k2e socs - Add MMC supply for k2g EVM * tag 'keystone_dts_for_4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: ARM: dts: keystone-k2g-evm: Use sdhci-omap programming model ARM: dts: keystone-k2g-evm: Add "vqmmc-supply" property for mmc0/mmc1 ARM: dts: k2e: add dts node for k2e hw_rng driver ARM: dts: k2l: add dts node for k2l hw_rng driver ARM: dts: k2hk: add dts node for k2hk hw_rng driver ARM: dts: keystone-k2g-ice: Enable netcp network driver ARM: dts: keystone-k2g-evm: Enable netcp network driver ARM: dts: k2g: add dt bindings to support network driver Signed-off-by: Olof Johansson commit 7a7a7e0ec450fbde6dd814054001fe231f1af4b5 Author: Michael Straube Date: Sun Jul 8 13:58:12 2018 +0200 staging: rtl8188eu: replace tabs with spaces Replace tabs with spaces in some function definitions and variable declarations. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 4f98cf805d42c652b0c0e6737d8e025de881e293 Author: Michael Straube Date: Sun Jul 8 13:58:11 2018 +0200 staging: rtl8188eu: refactor rtw_macaddr_cfg() Use ether_addr_copy() instead of memcpy() to copy the mac address. Using is_broadcast_ether_addr() and is_zero_ether_addr() instead of testing each byte of the mac[] array for 0xff and 0x00 shortens the code and improves readability. Instead of a fixed default mac address use a random one to reduce the likelihood of mac address collision. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 86ef7175e317f78f16013f023065dbb7993e7ecf Author: Michael Straube Date: Sun Jul 8 12:38:55 2018 +0200 staging: rtl8723bs: remove braces from single if statement Remove braces from single if statement to follow kernel coding style. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit bea378608b75116277804c260cff8438681f5ac0 Author: Michael Straube Date: Sun Jul 8 12:38:54 2018 +0200 staging: rtl8723bs: add missing blank lines Add missing blank lines after declarations as reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 5d109ed610415b1ddfe741d7a7f60f5eff0b9cd2 Author: Michael Straube Date: Sun Jul 8 12:38:53 2018 +0200 staging: rtl8723bs: remove blank lines Remove unrequired blank lines as reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 3ba461286835e0c66c540c871fb7f67d6108e7f9 Author: Michael Straube Date: Sun Jul 8 12:38:52 2018 +0200 staging: rtl8723bs: fix indentation Remove unrequired extra indentations. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c9ed0be8ca3a8fa11435eb5117b18f24f599ce10 Author: Michael Straube Date: Sun Jul 8 12:38:51 2018 +0200 staging: rtl8723bs: replace tab with space Replace tabs with spaces in some function definitions. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 058f285ed43c71565d19cc009c281e74a57fe75e Author: Michael Straube Date: Sun Jul 8 12:38:50 2018 +0200 staging: rtl8723bs: replace while with shorter for loop Simplify rtw_get_rateset_len() by replacing the while loop with a shorter for loop. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 0bde13ed847923dfb55185c5280b7390f627dc80 Author: John Whitmore Date: Sat Jul 7 15:55:07 2018 +0100 staging:rtl8192u: rename HT_EXTCHNL_OFFSET -> enum ht_extension_chan_width remove the typedef of enumerated type HT_EXTCHNL_OFFSET and replace it with 'enum ht_extension_chan_offset' Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit de6610e27dd2e47aea09f1b1c70f1d1b531d2267 Author: John Whitmore Date: Sat Jul 7 15:55:05 2018 +0100 staging:rtl8192u: Add spaces required around operators - Coding Style Added the spaces, required by coding style, around the various operators. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c01bd60e758fb0711744167519ac5ff604631cae Author: John Whitmore Date: Sat Jul 7 15:55:03 2018 +0100 staging:rtl8192u: Add space required before '(' - Style Simple addition of the coding style required space before '('. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 854727247ab9fb3547d39b9b3610b682223b9bf2 Author: John Whitmore Date: Sat Jul 7 15:55:02 2018 +0100 staging:rtl8192u: rename HT_CHANNEL_WIDTH -> enum ht_channel_width remove the typedef HT_CHANNEL_WIDTH and replace with 'enum ht_channel_width' Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 28af109a57d14211e5e8ba1551f00428be2fd508 Author: Javier Martinez Canillas Date: Sun Jul 8 15:34:59 2018 +0200 driver core: add a debugfs entry to show deferred devices With Device Trees (DT), the dependencies of the devices are defined in the DT, then the drivers parse that information to lookup the needed resources that have as dependencies. Since drivers and devices are registered in a non-deterministic way, it is possible that a device that is a dependency has not been registered yet by the time that is looked up. In this case the driver that requires this dependency cannot probe and has to defer it. So the driver core adds it to a list of deferred devices that is iterated again every time that a new driver is probed successfully. For debugging purposes it may be useful to know what are the devices whose probe function was deferred. Add a debugfs entry showing that information. $ cat /sys/kernel/debug/devices_deferred 48070000.i2c:twl@48:bci musb-hdrc.0.auto omapdrm.0 This information could be obtained partially by enabling debugging, but it means that the kernel log has to be parsed and the probe deferral balanced with the successes. This can be error probe and has to be done in a ad-hoc manner by everyone who needs to debug these kind of issues. Since the information is already known by the kernel, just show it to make it easier to debug. Signed-off-by: Javier Martinez Canillas Reviewed-by: Andy Shevchenko Reviewed-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 81b18bce48af3e222ca9eebb3b931f59141b7b49 Author: Sunil Muthuswamy Date: Sun Jul 8 02:56:51 2018 +0000 Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic In the VM mode on Hyper-V, currently, when the kernel panics, an error code and few register values are populated in an MSR and the Hypervisor notified. This information is collected on the host. The amount of information currently collected is found to be limited and not very actionable. To gather more actionable data, such as stack trace, the proposal is to write one page worth of kmsg data on an allocated page and the Hypervisor notified of the page address through the MSR. - Sysctl option to control the behavior, with ON by default. Cc: K. Y. Srinivasan Cc: Stephen Hemminger Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit e464d28273f895bfc57bfec2beb8a894eb45237c Author: Srinivas Kandagatla Date: Sat Jul 7 20:28:41 2018 +0100 slimbus: stream: Fix htmldocs warnings This patch fixes below warning during building htmldoc: slimbus.h:352: warning: Function parameter or member 'name' not described in 'slim_stream_runtime' This patch also removes documentation for state variable in struct slim_stream_runtime which was redundant and removed. Reported-by: kbuild test robot Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 053a389b461c558e4ecf84a55b94dfc51cb0cbce Author: Randy Dunlap Date: Sat Jul 7 14:03:29 2018 -0700 headers: fix build error in arch/arm/plat-samsung/adc.c, add arch/arm/plat-samsung/adc.c needs to #include explicitly since that header file was removed from (it wasn't needed there). Reported-by: kbuild test robot Signed-off-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman commit 993a4a5f7cd3aef53be3953d11f86b2d3630ebb8 Author: Sven Eckelmann Date: Sat Jul 7 21:50:18 2018 +0200 batman-adv: Convert batadv_dat_addr_t to proper type The #define for batadv_dat_addr_t is doing nothing else than giving u16 a new typename. But C already has the special keyword "typedef" which is also better supported by kernel-doc. Signed-off-by: Sven Eckelmann Acked-by: Antonio Quartulli Signed-off-by: Simon Wunderlich commit 794ac821cc44e4d148df36eb330a7e9729c06a82 Author: Julia Lawall Date: Mon May 21 11:49:09 2018 +0200 iio: adc: max1363: merge calls to of_match_device and of_device_get_match_data Drop call to of_match_device, which is subsumed by the subsequent call to of_device_get_match_data. The code becomes simpler, and a temporary variable can be dropped. The semantic match that makes this change is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression match; identifier i; expression x, dev, e, e1; @@ - match@i = of_match_device(x, dev); - if (match) e = of_device_get_match_data(dev); - else e = e1; + e = of_device_get_match_data(dev); + if (!e) e = e1; @@ identifier r.i; @@ - const struct of_device_id *i; ... when != i // Signed-off-by: Julia Lawall Signed-off-by: Jonathan Cameron commit c47078d6a33fd78d882200cdaacbcfcd63318234 Author: Eric Dumazet Date: Sat Jul 7 23:15:56 2018 -0700 tcp: remove redundant SOCK_DONE checks In both tcp_splice_read() and tcp_recvmsg(), we already test sock_flag(sk, SOCK_DONE) right before evaluating sk->sk_state, so "!sock_flag(sk, SOCK_DONE)" is always true. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 3d907eafa34335bb379fd429dcd326e3f44aff19 Merge: 0dbc81eab4d1 0317a6f4eb42 Author: David S. Miller Date: Sun Jul 8 17:05:20 2018 +0900 Merge branch 'mlxsw-Spectrum2-acl-prep' Ido Schimmel says: ==================== mlxsw: Spectrum-2 small ACL preparations This is the first set of changes towards Spectrum-2 support in the mlxsw driver. It contains small changes that prepare the code for the later introduction of Spectrum-2 support. The Spectrum-2 ASIC uses an algorithmic TCAM (A-TCAM) instead of a circuit TCAM (C-TCAM) as Spectrum, and thus most of the changes are around the ACL code. ==================== Signed-off-by: David S. Miller commit 0317a6f4eb42a7a8cc9c920183d340312d2e8c87 Author: Jiri Pirko Date: Sun Jul 8 10:00:21 2018 +0300 mlxsw: core_acl_flex_actions: Fix helper to get the first KVD linear index The helper should return always KVD linear index of the second set. It is unused now, but going to be used soon. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 5b9488fd5f1e007d22543e68cc95eb41c91f8018 Author: Jiri Pirko Date: Sun Jul 8 10:00:20 2018 +0300 mlxsw: core_acl_flex_actions: Allow the first set to be dummy In Spectrum-2, the real action sets are always in KVD linear. The first set is always empty and contains only pointer to the first real set in KVD linear. So provide possibility to specify the first set is the dummy one. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 9dbab6f588ebc9b6f741f926dc06878cba4f6c77 Author: Jiri Pirko Date: Sun Jul 8 10:00:19 2018 +0300 mlxsw: spectrum: Put pointer to flex action ops to mlxsw_sp Spectrum-2 need a slightly different handling of flexible actions. So put an ops pointer in mlxsw_sp struct and rename it. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 82b63bcf8c2414d6f445830f2076da5ef4a1ba25 Author: Jiri Pirko Date: Sun Jul 8 10:00:18 2018 +0300 mlxsw: core_acl_flex_keys: Change SRC_SYS_PORT flex key element size The SRC_SYS_PORT is passed as 8 bit value down to hw anyway, so cap it in the driver as well. Also, in Spectrum-2 the FW iface for SRC_SYS_PORT is only 8 bits, so prepare for it. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c43ea06dbd8c3daa2c6e3fa6ce3713b454c375f9 Author: Jiri Pirko Date: Sun Jul 8 10:00:17 2018 +0300 mlxsw: core_acl_flex_keys: Split MAC and IP address flex key elements Since in Spectrum-2, MACs are split and IP addresses are split as well, in order to use the same elements for Spectrum and Spectrum-2 split them now. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 2139469b0461ac750b616d110756e374d298e228 Author: Jiri Pirko Date: Sun Jul 8 10:00:16 2018 +0300 mlxsw: spectrum_acl: Ignore always-zeroed bits in tp->prio The lowest 16 bits of tp->prio are always zero, so ignore them with a shift. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 45e0620d5eb15daa102e9212b92180adf2f4f0aa Author: Jiri Pirko Date: Sun Jul 8 10:00:15 2018 +0300 mlxsw: reg: Introduce Flex2 key type for PTAR register Introduce Flex2 key type for PTAR register which is used in Spectrum-2. Also, extend mlxsw_reg_ptar_pack() to set the value according to the caller. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d4b0d20fec47c95a2bbd2c7d82dc72e59364faae Author: Jiri Pirko Date: Sun Jul 8 10:00:14 2018 +0300 mlxsw: spectrum: Change name of mlxsw_sp_afk_blocks to mlxsw_sp1_afk_blocks This is specific for Spectrum as Spectrum-2 has completely different key blocks. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0dbc81eab4d13f6d295da69c00e6efee2427b55c Author: David S. Miller Date: Sun Jul 8 17:02:59 2018 +0900 net: sched: Fix warnings from xchg() on RCU'd cookie pointer. The kbuild test robot reports: >> net/sched/act_api.c:71:15: sparse: incorrect type in initializer (different address spaces) @@ expected struct tc_cookie [noderef] *__ret @@ got [noderef] *__ret @@ net/sched/act_api.c:71:15: expected struct tc_cookie [noderef] *__ret net/sched/act_api.c:71:15: got struct tc_cookie *new_cookie >> net/sched/act_api.c:71:13: sparse: incorrect type in assignment (different address spaces) @@ expected struct tc_cookie *old @@ got struct tc_cookie [noderef] *[assigned] __ret >> net/sched/act_api.c:132:48: sparse: dereference of noderef expression Handle this in the usual way by force casting away the __rcu annotation when we are using xchg() on it. Fixes: eec94fdb0480 ("net: sched: use rcu for action cookie update") Reported-by: kbuild test robot Signed-off-by: David S. Miller commit e9ec8045644cf730d798cd8df8a6f8a86b7fba64 Merge: b233504033db 90b73b77d08e Author: David S. Miller Date: Sun Jul 8 12:42:29 2018 +0900 Merge branch 'Modify-action-API-for-implementing-lockless-actions' Vlad Buslov says: ==================== Modify action API for implementing lockless actions Currently, all netlink protocol handlers for updating rules, actions and qdiscs are protected with single global rtnl lock which removes any possibility for parallelism. This patch set is a first step to remove rtnl lock dependency from TC rules update path. Recently, new rtnl registration flag RTNL_FLAG_DOIT_UNLOCKED was added. Handlers registered with this flag are called without RTNL taken. End goal is to have rule update handlers(RTM_NEWTFILTER, RTM_DELTFILTER, etc.) to be registered with UNLOCKED flag to allow parallel execution. However, there is no intention to completely remove or split rtnl lock itself. This patch set addresses specific problems in action API that prevents it from being executed concurrently. This patch set does not completely unlock rules or actions update path. Additional patch sets are required to refactor individual actions and filters update for parallel execution. As a preparation for executing TC rules update handlers without rtnl lock, action API code was audited to determine areas that assume external synchronization with rtnl lock and must be changed to allow safe concurrent access with following results: 1. Action idr is already protected with spinlock. However, some code paths assume that idr state is not changes between several consecutive tcf_idr_* function calls. 2. tc_action reference and bind counters are implemented as plain integers. They purpose was to allow single actions to be shared between multiple filters, not to provide means for concurrent modification. 3. tc_action 'cookie' pointer field is not protected against modification. 4. Action API functions, that work with set of actions, use intrusive linked list, which cannot be used concurrently without additional synchronization. 5. Action API functions don't take reference to actions while using them, assuming external synchronization with rtnl lock. Following solutions to these problems are implemented: 1. To remove assumption that idr state doesn't change between tcf_idr_* calls, implement new functions that atomically perform several operations on idr without releasing idr spinlock. (function to atomically lookup and delete action by index, function to atomically check if action exists and allocate new one if necessary, etc.) 2. Use atomic operations on counters to make them suitable for concurrent get/put operations. 3. Data that 'cookie' points to is never modified, so it enough to refactor it to rcu pointer to prevent concurrent de-allocation. 4. Action API doesn't actually use any linked list specific operations on actions intrusive linked list, so it can be refactored to array in straightforward manner. 5. Always take reference to action while accessing it in action API. tcf_idr_search function modified to take reference to action before returning it, so there is no way to lookup an action without incrementing its reference counter. All users of this function are modified to release the reference, after they done using action. With all users using reference counting, it is now safe to concurrently delete actions. Additionally, actions init function signature was expanded with 'rtnl_held' argument, that allows actions that have internal dependency on rtnl lock to take/release it when necessary. Since only shared state in action API module are actions themselves and action idr, these changes are sufficient to not to rely on global rtnl lock for protection of internal action API data structures. Changes from V5 to V6: - Rebase on current net-next - When action is deleted, set pointer in actions array to NULL to prevent double freeing. Changes from V4 to V5: - Change action delete API to track actions that were deleted, to prevent releasing them on error. Changes from V3 to V4: - Expand cover letter. - Reduce actions array size in tcf_action_init_1. - Rebase on latest net-next. Changes from V2 to V3: - Re-send with changelog copied to individual patches. Changes from V1 to V2: - Removed redundant actions ops lookup during delete. - Merge action ops delete definition and implementation. - Assume all actions have delete implemented and don't check for it explicitly. - Resplit action lookup/release code to prevent memory leaks in individual patches. - Make __tcf_idr_check function static - Remove unique idr insertion function. Change original idr insert to do the same thing. - Merge changes that take reference to action when performing lookup and changes that account for this additional reference when dumping action to user space into single patch. - Change convoluted commit message. - Rename "unlocked" to "rtnl_held" for clarity. - Remove estimator lock add patch. - Refactor action check-alloc code into standalone function. - Rename tcf_idr_find_delete to tcf_idr_delete_index. - Rearrange variable definitions in tc_action_delete. - Add patch that refactors action API code to use array of pointers to actions instead of intrusive linked list. - Expand cover letter. ==================== Signed-off-by: David S. Miller commit 90b73b77d08ec395311411b545c756ca710aae59 Author: Vlad Buslov Date: Thu Jul 5 17:24:33 2018 +0300 net: sched: change action API to use array of pointers to actions Act API used linked list to pass set of actions to functions. It is intrusive data structure that stores list nodes inside action structure itself, which means it is not safe to modify such list concurrently. However, action API doesn't use any linked list specific operations on this set of actions, so it can be safely refactored into plain pointer array. Refactor action API to use array of pointers to tc_actions instead of linked list. Change argument 'actions' type of exported action init, destroy and dump functions. Acked-by: Jiri Pirko Signed-off-by: Vlad Buslov Signed-off-by: David S. Miller commit 0190c1d452a91c38a3462abdd81752be1b9006a8 Author: Vlad Buslov Date: Thu Jul 5 17:24:32 2018 +0300 net: sched: atomically check-allocate action Implement function that atomically checks if action exists and either takes reference to it, or allocates idr slot for action index to prevent concurrent allocations of actions with same index. Use EBUSY error pointer to indicate that idr slot is reserved. Implement cleanup helper function that removes temporary error pointer from idr. (in case of error between idr allocation and insertion of newly created action to specified index) Refactor all action init functions to insert new action to idr using this API. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit cae422f379f37fe9105d2a113259788f989e7df5 Author: Vlad Buslov Date: Thu Jul 5 17:24:31 2018 +0300 net: sched: use reference counting action init Change action API to assume that action init function always takes reference to action, even when overwriting existing action. This is necessary because action API continues to use action pointer after init function is done. At this point action becomes accessible for concurrent modifications, so user must always hold reference to it. Implement helper put list function to atomically release list of actions after action API init code is done using them. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 4e8ddd7f1758ca4ddd0c1f7cf3e66fce736241d2 Author: Vlad Buslov Date: Thu Jul 5 17:24:30 2018 +0300 net: sched: don't release reference on action overwrite Return from action init function with reference to action taken, even when overwriting existing action. Action init API initializes its fourth argument (pointer to pointer to tc action) to either existing action with same index or newly created action. In case of existing index(and bind argument is zero), init function returns without incrementing action reference counter. Caller of action init then proceeds working with action, without actually holding reference to it. This means that action could be deleted concurrently. Change action init behavior to always take reference to action before returning successfully, in order to protect from concurrent deletion. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 16af6067392c40e454e49eec834843ab03643d96 Author: Vlad Buslov Date: Thu Jul 5 17:24:29 2018 +0300 net: sched: implement reference counted action release Implement helper delete function that uses new action ops 'delete', instead of destroying action directly. This is required so act API could delete actions by index, without holding any references to action that is being deleted. Implement function __tcf_action_put() that releases reference to action and frees it, if necessary. Refactor action deletion code to use new put function and not to rely on rtnl lock. Remove rtnl lock assertions that are no longer needed. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit b409074e6693bcdaa7abbee2a035f22a9eabda53 Author: Vlad Buslov Date: Thu Jul 5 17:24:28 2018 +0300 net: sched: add 'delete' function to action ops Extend action ops with 'delete' function. Each action type to implements its own delete function that doesn't depend on rtnl lock. Implement delete function that is required to delete actions without holding rtnl lock. Use action API function that atomically deletes action only if it is still in action idr. This implementation prevents concurrent threads from deleting same action twice. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 2a2ea349704fffade9526d5122299edbbfd122ca Author: Vlad Buslov Date: Thu Jul 5 17:24:27 2018 +0300 net: sched: implement action API that deletes action by index Implement new action API function that atomically finds and deletes action from idr by index. Intended to be used by lockless actions that do not rely on rtnl lock. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 3f7c72bc4227b169ba2c924a7987324e24bbc4b2 Author: Vlad Buslov Date: Thu Jul 5 17:24:26 2018 +0300 net: sched: always take reference to action Without rtnl lock protection it is no longer safe to use pointer to tc action without holding reference to it. (it can be destroyed concurrently) Remove unsafe action idr lookup function. Instead of it, implement safe tcf idr check function that atomically looks up action in idr and increments its reference and bind counters. Implement both action search and check using new safe function Reference taken by idr check is temporal and should not be accounted by userspace clients (both logically and to preserver current API behavior). Subtract temporal reference when dumping action to userspace using existing tca_get_fill function arguments. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 789871bb2a0381425b106d2a995bde1460d35a34 Author: Vlad Buslov Date: Thu Jul 5 17:24:25 2018 +0300 net: sched: implement unlocked action init API Add additional 'rtnl_held' argument to act API init functions. It is required to implement actions that need to release rtnl lock before loading kernel module and reacquire if afterwards. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 036bb44327f50273e85ee4a2c9b56eebce1c0838 Author: Vlad Buslov Date: Thu Jul 5 17:24:24 2018 +0300 net: sched: change type of reference and bind counters Change type of action reference counter to refcount_t. Change type of action bind counter to atomic_t. This type is used to allow decrementing bind counter without testing for 0 result. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit eec94fdb04806790c7b7e6ea347820064cc6d467 Author: Vlad Buslov Date: Thu Jul 5 17:24:23 2018 +0300 net: sched: use rcu for action cookie update Implement functions to atomically update and free action cookie using rcu mechanism. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit b233504033dbd65740e59681820ccfd0a2a8ec53 Author: Yifeng Sun Date: Mon Jul 2 08:18:03 2018 -0700 openvswitch: kernel datapath clone action Add 'clone' action to kernel datapath by using existing functions. When actions within clone don't modify the current flow, the flow key is not cloned before executing clone actions. This is a follow up patch for this incomplete work: https://patchwork.ozlabs.org/patch/722096/ v1 -> v2: Refactor as advised by reviewer. Signed-off-by: Yifeng Sun Signed-off-by: Andy Zhou Acked-by: Pravin B Shelar Signed-off-by: David S. Miller commit 20fbdc35723f0b3e1a0d2948960244f9721d1646 Author: Randy Dunlap Date: Sat Jul 7 08:31:15 2018 -0700 isdn/capi: fix defined but not used warnings Fix build warnings in drivers/isdn/capi/ when CONFIG_PROC_FS is not enabled by marking the unused functions as __maybe_unused. ../drivers/isdn/capi/capi.c:1324:12: warning: 'capi20_proc_show' defined but not used [-Wunused-function] ../drivers/isdn/capi/capi.c:1347:12: warning: 'capi20ncci_proc_show' defined but not used [-Wunused-function] ../drivers/isdn/capi/capidrv.c:2454:12: warning: 'capidrv_proc_show' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap Cc: Karsten Keil Cc: isdn4linux@listserv.isdn4linux.de (subscribers-only) Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit d2af686c2df82659673c2a795c06dcd37730a3b9 Author: Randy Dunlap Date: Sat Jul 7 08:27:53 2018 -0700 connector: fix defined but not used warning Fix a build warning in connector.c when CONFIG_PROC_FS is not enabled by marking the unused function as __maybe_unused. ../drivers/connector/connector.c:242:12: warning: 'cn_proc_show' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap Cc: Evgeniy Polyakov Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit a64ad008980c65d38e6cf6858429c78e6b740c41 Author: Alberto Panizzo Date: Fri Jul 6 15:18:51 2018 +0200 clk: rockchip: fix clk_i2sout parent selection bits on rk3399 Register, shift and mask were wrong according to datasheet. Fixes: 115510053e5e ("clk: rockchip: add clock controller for the RK3399") Cc: stable@vger.kernel.org Signed-off-by: Alberto Panizzo Signed-off-by: Anthony Brandon Signed-off-by: Heiko Stuebner commit 7914c67667a06d7b5dbc297dfff49285b9c3a0d4 Author: Vinod Koul Date: Thu Jun 28 20:38:49 2018 +0530 dt-bindings: power: reset: qcom: Add resin binding Resin is similar to pwrkey, add the description and example for resin bindings Signed-off-by: Vinod Koul Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit 3b1709de64bcc54284812fa43808da07089008ca Author: Sven Eckelmann Date: Sat Jul 7 21:46:11 2018 +0200 batman-adv: Join batadv_purge_orig_ref and _batadv_purge_orig The single line function batadv_purge_orig_ref has no function beside providing the name used by other source files. This can also be done simpler by just renaming _batadv_purge_orig to batadv_purge_orig_ref. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 94f01eed49b569a14f02fcfecfd6401a95008049 Author: Sven Eckelmann Date: Sat Jul 7 21:36:24 2018 +0200 batman-adv: Unify include guards style All other include guards in batman-adv use the style: * _NET_BATMAN_ADV_$(FILENAME)_ * uppercase only * "." & "-" replaced with "_" Use this also in the B.A.T.M.A.N. IV/V OGM implementation headers. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 777baca07ef179301e363b10a14c428e5ebbd6a6 Author: Stefan Popa Date: Wed Jul 4 17:32:53 2018 +0300 dt-bindings: iio: dac: Add docs for AD5758 DAC Signed-off-by: Stefan Popa Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 28d1a7ac2a0d9589e04dd36a83f242b3e14da1eb Author: Stefan Popa Date: Wed Jul 4 17:32:03 2018 +0300 iio: dac: Add AD5758 support The AD5758 is a single channel DAC with 16-bit precision which uses the SPI interface that operates at clock rates up to 50MHz. The output can be configured as voltage or current and is available on a single terminal. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/ad5758.pdf Signed-off-by: Stefan Popa Signed-off-by: Jonathan Cameron commit e161ef7c3c376f6807cdef7e8a2804b964dd7584 Author: Gustavo A. R. Silva Date: Tue Jul 3 14:44:36 2018 -0500 iio: mma8452: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used in this case: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jonathan Cameron commit 82d65f9d552818b7e56c85edaaf6c3d2b104d07d Author: Gustavo A. R. Silva Date: Tue Jul 3 14:35:50 2018 -0500 iio:imu:adis: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jonathan Cameron commit 5f0d4fd6b2c6f4ce14af861b17b9bebc8ba1265a Author: Colin Ian King Date: Mon Jul 2 11:13:59 2018 +0100 iio: dac: ltc2632 remove redundant pointer chip_info and spi_dev_id Pointers chip_info and spi_dev_id are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warning: warning: variable 'chip_info' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Jonathan Cameron commit 366995df8b9ed7743386813412dcfa991c170d28 Author: Colin Ian King Date: Mon Jul 2 11:24:35 2018 +0100 iio: dac: ti-dac5571 remove redundant variable 'shift' Variable shift is being assigned but is never used hence it is redundant and can be removed. Cleans up two clang warnings: warning: variable ‘shift’ set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Reviewed-by: Sean Nyekjaer Signed-off-by: Jonathan Cameron commit 6b0b3e378e16f75338665fa519c2a06e4a071889 Author: Nikolaus Voss Date: Tue Jul 3 08:06:57 2018 +0200 IIO: st_accel_i2c.c: Use probe_new() instead of probe() struct i2c_device_id argument of probe() is not used, so use probe_new() instead. Signed-off-by: Nikolaus Voss Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 19868faad4c59646a9fbebc34c3bf07733db341e Author: Nikolaus Voss Date: Tue Jul 3 07:41:00 2018 +0200 IIO: st_accel_i2c.c: Simplify access to driver data Use device_get_match_data API to simplify access to driver data. Let acpi_device_id table entries point to the same driver data as of_device_id table entries and uniquify access to driver data by using device_get_match_data API. Remove unused i2c_device_id .driver_data fields. Signed-off-by: Nikolaus Voss Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron commit 7d6cd21d82bacab2d1786fe5e989e4815b75d9a3 Author: Akinobu Mita Date: Mon Jun 25 00:05:21 2018 +0900 iio: adc: ina2xx: avoid kthread_stop() with stale task_struct When the buffer is enabled for ina2xx driver, a dedicated kthread is invoked to capture mesurement data. When the buffer is disabled, the kthread is stopped. However if the kthread gets register access errors, it immediately exits and when the malfunctional buffer is disabled, the stale task_struct pointer is accessed as there is no kthread to be stopped. A similar issue in the usbip driver is prevented by kthread_get_run and kthread_stop_put helpers by increasing usage count of the task_struct. This change applies the same solution. Cc: Stefan Brüns Cc: Jonathan Cameron Signed-off-by: Akinobu Mita Fixes: c43a102e67db ("iio: ina2xx: add support for TI INA2xx Power Monitors") Signed-off-by: Jonathan Cameron commit c855cf2759d27142f771173d9fd8e7fdf9cf5138 Author: Rajat Jain Date: Sat Jun 16 10:49:46 2018 -0700 sysfs: Fix internal_create_group() for named group updates There are a couple of problems with named group updates in the code today: * sysfs_update_group() will always fail for a named group, because internal_create_group() will try to create a new sysfs directory unconditionally, which will ofcourse fail with -EEXIST. * We can leak the kernfs_node for grp->name if some one tries to: - rename a group (change grp->name), or - update a named group, to an unnamed group It appears that the whole purpose of sysfs_update_group() was to allow changing the permissions or visibility of attributes and not the names. So make it clear in the comments, and allow it to update an existing named group. Signed-off-by: Rajat Jain Signed-off-by: Greg Kroah-Hartman commit 319b11ef5719a2f0ae65ce5f665f263a5e7a06c3 Author: Wesley W. Terpstra Date: Thu Jun 21 15:37:37 2018 +0200 base: fix order of OF initialization This fixes: [ 0.010000] cpu cpu0: Error -2 creating of_node link ... which you get for every CPU on all architectures that use CONFIG_GENERIC_CPU_DEVICES. In that case, driver_init() calls cpu_dev_init() before calling of_core_init(). Then we get the callchain: cpu_dev_init() -> cpu_dev_register_generic() -> register_cpu(cpu, i) -> device_register(&cpu->dev) -> device_add(dev) -> device_add_class_symlinks(dev) ... in device_add_class_symlinks, we we dev->of_node, and call sysfs_create_link(), which fails because we haven't called of_core_init() to register the sysfs devicetree directory yet. Signed-off-by: Wesley W. Terpstra [hch: updated the changelog based on review feedback] Signed-off-by: Christoph Hellwig Acked-by: Mark Rutland Acked-by: Frank Rowand Signed-off-by: Greg Kroah-Hartman commit ac3167257b9fe16c9426c2087ead1c9f1b0992b1 Author: Randy Dunlap Date: Tue Jun 19 22:47:28 2018 -0700 headers: separate linux/mod_devicetable.h from linux/platform_device.h At over 4000 #includes, is the 9th most #included header file in the Linux kernel. It does not need , so drop that header and explicitly add to source files that need it. 4146 #include After this patch, there are 225 files that use , for a reduction of around 3900 times that does not have to be read & parsed. 225 #include This patch was build-tested on 20 different arch-es. It also makes these drivers SubmitChecklist#1 compliant. Signed-off-by: Randy Dunlap Reported-by: kbuild test robot # drivers/media/platform/vimc/ Reported-by: kbuild test robot # drivers/pinctrl/pinctrl-u300.c Signed-off-by: Greg Kroah-Hartman commit ea614629c69c2c0258ef6414b017c998e3cc61a7 Author: Randy Dunlap Date: Sat Jun 16 18:53:57 2018 -0700 linux/device.h: fix kernel-doc notation warning Fix kernel-doc build warning (missing " *" at beginning of line): ../include/linux/device.h:93: warning: bad line: this bus. Fixes: 07397df29e57c ("dma-mapping: move dma configuration to bus infrastructure") Signed-off-by: Randy Dunlap Cc: Nipun Gupta Cc: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman commit 591217d19b00bfdc48c19b65c667523d3f61ff33 Author: Geert Uytterhoeven Date: Thu Jun 21 21:00:16 2018 +0200 misc: ti-st: Allow compile test of GPIO consumers if !GPIOLIB The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven Acked-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman commit 8a1ed14ebf8c4e916fac8cb34b1eebbe60624db4 Author: Luis R. Rodriguez Date: Wed Jun 6 14:38:47 2018 -0700 Documentation: update firmware loader fallback reference The firmware loader has a fallback mechanism, and it now has some proper kdoc, but we forgot to update the Documentation to use the new kdoc. Fix that. Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman commit 2e0e3a24ca50519219ebdd471e8b65043a10196b Author: Geert Uytterhoeven Date: Wed Jun 6 14:40:56 2018 +0200 android: binder: Drop dependency on !M68K As of commit 7124330dabe5b3cb ("m68k/uaccess: Revive 64-bit get_user()"), the 64-bit Android binder interface builds fine on m68k. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit 71bdd87f58f6791e50ddd7a078c47f9803c523ee Author: Alexander Kapshuk Date: Thu May 31 22:22:47 2018 +0300 ver_linux: Do not check for ver_linux pattern in version function Checking whether output of commands matches the ver_linux pattern in the version function is original shell implementation legacy code. When the original implementation failed to locate a particular utility, it generated error output along the lines of: ver_linux:line number: command not found. The awk implementation, does not contain the name of the script within the body of the error message returned by the subshell when a given utility fails to be located. The error message returned is along the lines of: sh: name of utility: command not found Safeguarding against the ver_linux pattern being found in the output being parsed may thus be safely omitted. Signed-off-by: Alexander Kapshuk Signed-off-by: Greg Kroah-Hartman commit 34fe3cfda826e221d15610aa07364384bf8adb94 Author: Alexander Kapshuk Date: Thu May 31 22:22:46 2018 +0300 ver_linux: Process input coming from procmaps that matches libc only Currently, input coming from /proc/self/maps is split into fields without checking whether or not it matches libc.so. This is not efficient. All text processing should only be performed on lines of input that match libc.so. Signed-off-by: Alexander Kapshuk Signed-off-by: Greg Kroah-Hartman commit ce054546cc2c26891cefa2f284d90d93b52205de Author: Matt Ranostay Date: Fri Jun 8 23:58:15 2018 -0700 tsl2550: fix lux1_input error in low light ADC channel 0 photodiode detects both infrared + visible light, but ADC channel 1 just detects infrared. However, the latter is a bit more sensitive in that range so complete darkness or low light causes a error condition in which the chan0 - chan1 is negative that results in a -EAGAIN. This patch changes the resulting lux1_input sysfs attribute message from "Resource temporarily unavailable" to a user-grokable lux value of 0. Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Matt Ranostay Signed-off-by: Greg Kroah-Hartman commit 6051e79bbfa6111c3a56a86fa8c6ff9a248e30a6 Author: Arnd Bergmann Date: Mon Jun 18 16:25:51 2018 +0200 misc: mic: fix passing the current time I noticed that the mic driver passes a 'struct timespec64' as part of a message into an attached device, where it is used to set the current system time. This won't actually work if one of the two sides runs a 32-bit kernel and the other runs a 64-bit kernel, since the structure layout is different between the two. I found this while replacing calls to the deprecated do_settimeofday64() interface with the modern ktime_get_real_ts() variant, but it seems appropriate to address both at the same time here. To make sure we have a sane structure, let's define our own structure using the layout of the 64-bit kernel. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 16777ecd1b54d75136f77b2cc25f2cfa75156852 Author: Samuel Thibault Date: Sun Jun 3 20:18:58 2018 +0200 kbd: complete dead keys definitions This completes dead keys definitions for internationalization completeness on the console. The representatives have been chosen coherently with libx11 compose sequences, which avoid symetry conflicts (e.g. there is U with caron, but no c with breve). Signed-off-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman commit 77d2a24b6107bd9b3bf2403a65c1428a9da83dd0 Author: Guenter Roeck Date: Sun Jul 1 13:57:16 2018 -0700 kobject: Replace strncpy with memcpy gcc 8.1.0 complains: lib/kobject.c:128:3: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] lib/kobject.c: In function 'kobject_get_path': lib/kobject.c:125:13: note: length computed here Using strncpy() is indeed less than perfect since the length of data to be copied has already been determined with strlen(). Replace strncpy() with memcpy() to address the warning and optimize the code a little. Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit e890591413819eeb604207ad3261ba617b2ec0bb Author: Uwe Kleine-König Date: Thu Jun 28 09:57:42 2018 +0200 siox: don't create a thread without starting it When a siox master device is registered a kthread is created that is only started when triggered by userspace. So this thread might be in TASK_UNINTERRUPTIBLE state for long and trigger a warning [ 241.130465] INFO: task siox-0:626 blocked for more than 120 seconds. with the respective debug settings enabled. It might be right to put an unstarted thread to TASK_IDLE (in kernel/kthread.c:kthread()) instead, but independant of this discussion it is cleaner for siox_master_register() to start the thread immediately. The effect is that it enters its own waiting state and then stays in state TASK_IDLE which doesn't trigger the above warning. As siox_poll_thread() uses some variables of the device the initialisation of these is moved before thread creation. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Uwe Kleine-König Acked-by: Gavin Schenk Signed-off-by: Greg Kroah-Hartman commit 7e6f7d24535b7c1edec3605d85c7684f7388d122 Author: Uwe Kleine-König Date: Tue Jun 19 11:38:54 2018 +0200 siox: treat type errors as status errors The type bits are part of the per-device status word. So it's natural to consider an error in the type bits as a status error instead of only resulting in an unsynced state. Signed-off-by: Uwe Kleine-König Acked-by: Gavin Schenk Signed-off-by: Greg Kroah-Hartman commit bcde98fcf9cf084f6ed6c1751d2ef68877a87c20 Author: Gustavo A. R. Silva Date: Tue Jul 3 17:36:29 2018 -0500 misc: mic: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman commit f1a54cddbbc36ebf1e8ce10a3e1fa5f8a4ce9613 Author: Gustavo A. R. Silva Date: Tue Jul 3 17:43:43 2018 -0500 sgi-xp: xpc_partition: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman commit 0c2ccd8cd1436d79010354029f43e4d167f1d755 Author: Gustavo A. R. Silva Date: Tue Jul 3 17:47:36 2018 -0500 eeprom: at25: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman commit c9a104e23cb8ff37ddeb788f7d57b3b8d1a030ab Author: Colin Ian King Date: Sat May 26 14:39:45 2018 +0100 parport: parport_serial: Add WCH CH382L PCIe single parallel port support The WCH CH382L PCIe adapter has 1 parallel port but unlike the similar WCH CH328 adapter there are no serial ports connected to it. Enable this adapter with the addition of the appropriate PCIe IDs and board support config. PCIe device ID 1c00:3050: 02:00.0 Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850]) Subsystem: Device 1c00:3050 Flags: fast devsel, IRQ 16 I/O ports at 2000 [size=256] Memory at d0000000 (32-bit, prefetchable) [size=32K] I/O ports at 2100 [size=4] Expansion ROM at b0200000 [disabled] [size=32K] Capabilities: [60] Power Management version 3 Capabilities: [68] MSI: Enable- Count=1/32 Maskable+ 64bit+ Capabilities: [80] Express Legacy Endpoint, MSI 00 Capabilities: [100] Advanced Error Reporting Kernel driver in use: parport_pc Kernel modules: parport_pc, parport_serial Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 97b715b62e5b4c6edb75d023f556fd09a46cb4e1 Author: Wei Yongjun Date: Sat May 26 09:45:59 2018 +0000 misc: ibmvmc: Use GFP_ATOMIC under spin lock The function alloc_dma_buffer() is called from ibmvmc_add_buffer(), in which a spin lock be held here, so we should use GFP_ATOMIC when a lock is held. Fixes: 0eca353e7ae7 ("misc: IBM Virtual Management Channel Driver (VMC)") Signed-off-by: Wei Yongjun Reviewed-by: Bryant G. Ly Signed-off-by: Greg Kroah-Hartman commit 5faecb0162883df2b06965c7e6dd7c42278f7e0d Author: Gustavo A. R. Silva Date: Mon Jul 2 12:57:24 2018 -0500 /dev/mem: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman commit 7fb2fd4e25fc1fb10dcb30b5519de257cfeae84c Author: Dan Carpenter Date: Wed Jul 4 12:33:34 2018 +0300 vmci: type promotion bug in qp_host_get_user_memory() The problem is that if get_user_pages_fast() fails and returns a negative error code, it gets type promoted to a high positive value and treated as a success. Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.") Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit fc82975aea38da8d605ff2fae3f871ac2929b67d Author: Srinivas Kandagatla Date: Tue Jun 26 12:36:40 2018 +0100 nvmem: core: remove unused nvmem_device ncells member nvmem ncells can be over written by calling nvmem_add_cells() multiple times. I see there is no real point of maintaining count of cells when we have a list of cell. Remove this to avoid any confusion! Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 26d79b820b2773eabdc512c84d1152f0f631b2fc Author: Kees Cook Date: Wed Jun 20 11:26:00 2018 -0700 nvmem: rave-sp-eeprom: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this uses the maximum allocation size for the stack and adds a sanity check, similar to what has already be done for the regular rave-sp driver. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Reviewed-by: Andrey Smirnov Tested-by: Andrey Smirnov Signed-off-by: Greg Kroah-Hartman commit 55d7d44eb21dd7b88d7f17747bdc96e415bde75c Author: Geert Uytterhoeven Date: Fri Jun 22 12:08:20 2018 +0200 MAINTAINERS: Add file patterns for w1 device tree bindings Submitters of device tree binding documentation may forget to CC the subsystem maintainer if this is missing. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit c7e5a5b4f0371dac0888e2be7c59273d8e4c013f Author: Mariusz Bialonczyk Date: Thu Jul 5 06:51:36 2018 +0200 w1: fix w1_ds2438 documentation The previous documentation was wrongly stating about the order of magnitude of CONVERT_V result files contents (vad, vdd). This commit is correcting this. Reported-by: Adam Stolarczyk Signed-off-by: Mariusz Bialonczyk Signed-off-by: Greg Kroah-Hartman commit 7b4bcbcdb2a9c16ec8d83f43c04c4dd4db0df032 Author: Henriette Hofmeier Date: Thu Jun 14 17:20:41 2018 +0200 ds2490.c: Move struct open braces to previous line Move open braces of two structs to the declaration line, as criticized by checkpatch. Signed-off-by: Henriette Hofmeier Signed-off-by: Florian Harbecke Signed-off-by: Greg Kroah-Hartman commit b2dd10ce8b620f6aaafe0874c7eec4b2e275a497 Author: Henriette Hofmeier Date: Thu Jun 14 17:20:40 2018 +0200 ds2490.c: Remove unnecessary whitespace Remove unnecessary whitespace criticized by checkpatch. Signed-off-by: Henriette Hofmeier Signed-off-by: Florian Harbecke Signed-off-by: Greg Kroah-Hartman commit 98860b7b605ce6b5017b5870dba4492155128280 Author: Henriette Hofmeier Date: Thu Jun 14 17:20:39 2018 +0200 ds2490.c: Add required spaces Add missing spaces in for- and while-loops reported missing by checkpatch. Signed-off-by: Henriette Hofmeier Signed-off-by: Florian Harbecke Signed-off-by: Greg Kroah-Hartman commit 52490169cddf55a1174772c6bf7be32db2ce01e0 Author: Srinivas Kandagatla Date: Thu Jul 5 14:54:26 2018 +0100 slimbus: ngd: add stream support This patch adds support to stream support, this involve implementing user specific implementation of Data channel management and channel management SLIMbus messages. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit abb9c9b8b51ba53b47ad7685ad2a0a64dbbf7bf5 Author: Srinivas Kandagatla Date: Thu Jul 5 14:54:25 2018 +0100 slimbus: stream: add stream support This patch adds support to SLIMbus stream apis for slimbus device. SLIMbus streaming involves adding support to Data Channel Management and channel Reconfiguration Messages to slim core plus few stream apis. >From slim device side the apis are very simple mostly inline with other stream apis. Currently it only supports Isochronous and Push/Pull transport protocols, which are sufficient for audio use cases. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 917809e2280bb83994be8b642373fd941d40c407 Author: Srinivas Kandagatla Date: Tue Jun 19 17:13:01 2018 +0100 slimbus: ngd: Add qcom SLIMBus NGD driver This patch adds suppor to Qualcomm SLIMBus Non-Generic Device (NGD) controller driver. This is light-weight SLIMBus controller driver responsible for communicating with slave HW directly over the bus using messaging interface, and communicating with master component residing on ADSP for bandwidth and data-channel management Based on intial work from Karthikeyan Ramasubramanian and Sagar Dharia Signed-off-by: Srinivas Kandagatla Tested-by: Craig Tatlor Reviewed-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman commit 992d36158a06322638fc6041744886766336fe50 Author: Srinivas Kandagatla Date: Tue Jun 19 17:13:00 2018 +0100 slimbus: ngd: dt-bindings: Add slim ngd dt bindings This patch adds bindings for Qualcomm SLIMBus NGD controller. SLIMBus NGD controller is a light-weight driver responsible for communicating with SLIMBus slaves directly over the bus using messaging interface and communicating with master component residing on ADSP for bandwidth and data-channel management Signed-off-by: Srinivas Kandagatla Reviewed-by: Rob Herring Tested-by: Craig Tatlor Reviewed-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman commit d3062a21093093bc77a8ebf1b555e380993993e7 Author: Srinivas Kandagatla Date: Tue Jun 19 17:12:59 2018 +0100 slimbus: messaging: add slim_alloc/free_txn_tid() This patch adds slim_alloc_txn_tid() and slim_free_txn_tid() api to allow controllers like ngd to allocate tids for user specific commands. This also cleans up the existing code to use single place for tid allocations and free. This patch also make the tid allocation cyclic one, its very useful to track the transactions back during debug. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit db455d66b9900a8a81fe474f11c78c8c8a95eefa Author: Srinivas Kandagatla Date: Tue Jun 19 17:12:58 2018 +0100 slimbus: core: rearrange slim_eaddr structure Rearrange struct slim_eaddr so that the structure is packed correctly to be able to send in SLIMBus messages. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit e0772de8a48b69d39624cdf99fac8f4a3fcc387b Author: Srinivas Kandagatla Date: Tue Jun 19 17:12:57 2018 +0100 slimbus: core: add of_slim_device_get() helper On SLIMBus controllers like Qcom NGD(non ported device), controller can request logical address once the remote side is powered, having a helper function like this to explicitly enumerate the bus is helpful. Also codec drivers which are taking to interface device would need such a helper too. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit ba883d90b1c8eccf8e315bd2a79ce6b0b2420d3b Author: Srinivas Kandagatla Date: Tue Jun 19 16:12:05 2018 +0100 slimbus: qcom: remove redundant depends in Kconfig QCOM SLIMBus controller is already under a 'if SLIMBUS' in Kconfig, having depends on SLIMBUS is totally redundant. Just remove it. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit ffa2d92191286f47b993c62013c351b397400708 Author: Srinivas Kandagatla Date: Tue Jun 19 16:12:04 2018 +0100 slimbus: messaging: initialize completion correctly slim_val_inf can contain random value from stack, make sure the completion is initialized to NULL while filling the msg. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 057ba872d0adc9b512e455f38159f1c3616b616c Author: Srinivas Kandagatla Date: Tue Jun 19 16:12:03 2018 +0100 slimbus: messaging: remove multiple calls to pm_runtime_mark_last_busy There seems to be a multiple calls to pm_runtime_mark_last_busy(), which looks like a typo. Fix this by properly adding pm_runtime_put_autosuspend to put controller in auto suspend state. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 8134d27103b35dbdc94d762f82ca0bfb00f349ff Author: Srinivas Kandagatla Date: Tue Jun 19 16:12:02 2018 +0100 slimbus: messaging: pass correct wbuf There seems to be a typo while filling msg for slim_write, wbuf is set to NULL instead of rbuf. Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman commit 448a5a552f336bd7b847b1951ffd15eb2e7167a3 Author: Sudeep Holla Date: Fri Jul 6 13:50:31 2018 +0100 drivers: base: cacheinfo: use OF property_read_u32 instead of get_property,read_number of_property_read_u32 searches for a property in a device node and read a 32-bit value from it. Instead of using of_get_property to get the property and then read 32-bit value using of_read_number, we can simplify it by using of_property_read_u32. Suggested-by: Andy Shevchenko Signed-off-by: Sudeep Holla Signed-off-by: Greg Kroah-Hartman commit 43986798fd504c8cd846e3c65bcf732e3f971938 Author: Zhouyang Jia Date: Tue Jun 12 11:07:21 2018 +0800 ipack: add error handling for ioremap_nocache When ioremap_nocache fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling ioremap_nocache. Signed-off-by: Zhouyang Jia Acked-by: Samuel Iglesias Gonsalvez Signed-off-by: Greg Kroah-Hartman commit 5c74f27bf6ca9e2b30ba5d7ae11831f89c41b37a Merge: a59f95c7a2c3 9f4a8a2d7f9d Author: Greg Kroah-Hartman Date: Sat Jul 7 17:02:35 2018 +0200 Merge tag 'fsi-updates-2018-06-12' of https://git.kernel.org/pub/scm/linux/kernel/git/benh/linux-fsi into char-misc-next Ben writes: FSI updates and sbefifo driver commit 3ff10703c74ab08d4861b0d3924dc3a3f05da004 Author: Andy Shevchenko Date: Fri Jul 6 18:52:59 2018 +0300 serial: 8250_dw: Introduce IO accessors to extended registers There are several extended (in comparison to the traditional 16550) registers are present in Synopsys DesignWare UART. All of them are 32-bit ones. Introduce helpers to simplify access to them and convert existing users. Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit a59f95c7a2c35031264eafc62e684df07f5f2a8f Author: Alan Tull Date: Wed Jun 27 20:56:19 2018 -0500 Documentation: fpga: cleanup Minor fixes including: * fix some typos * correct use of a/an * rephrase explanation of .state ops function * s/re-use/reuse/ (use only one spelling of 'reuse' in these docs) * s/cpu/CPU/ Signed-off-by: Alan Tull Acked-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman commit cd50699fe1b546a2abffdfdcd022d702e9c58f3f Author: Johan Hovold Date: Mon Jun 11 09:42:02 2018 +0200 MAINTAINERS: update two greybus sections Fix a file entry typo and drop the obsolete timesync entries, which were all caught by: scripts/get_maintainer.pl --self-test=patterns Reported-by: Joe Perches Signed-off-by: Johan Hovold Acked-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman commit e17f46c6715448dace0e6300ac48f9052a3ca613 Author: Michael Straube Date: Sat Jul 7 13:22:50 2018 +0200 staging: rtl8188eu: replace while with shorter for loop Simplify rtw_get_rateset_len() by replacing the while loop with a shorter for loop. Also replace tabs with spaces in the definition line. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 50730e79a2af78c592c72f3c335de7ffc0409626 Author: Michael Straube Date: Sat Jul 7 13:38:41 2018 +0200 staging: rtl8723bs: remove rtw_beamforming.h The header rtw_beamforming.h is not used anywhere. 'git grep rtw_beamforming.h' returns nothing, remove the file. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 7898a516c35639af4cc9e634ec5c144a191f50c6 Author: Michael Straube Date: Sat Jul 7 13:38:40 2018 +0200 staging: rtl8723bs: remove rtw_br_ext.h The header rtw_br_ext.h is not used anywhere. 'git grep rtw_br_ext.h' returns nothing, remove the file. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 460f6f8b24ff94fbd9635502e2339dda7927f556 Author: Tim Collier Date: Fri Jul 6 20:38:15 2018 +0100 staging: wlan-ng: remove unneeded parentheses from prism2mgmt.c remove parentheses reported as unnecessary by checkpatch Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit e47b374ce4bec599f792d55ff9bcaa1f5322778c Author: Tim Collier Date: Fri Jul 6 20:38:14 2018 +0100 staging: wlan-ng: fix expression continuation in prism2mgmt.c checkpatch reports "CHECK: Logical continuations should be on the previous line" when a continuation line begins with an operator. Reformat the code so that the operator appears at the end of the line being continued. Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit 0148f49c118ad786fedf64621ac0037475a027fa Author: Tim Collier Date: Fri Jul 6 20:38:13 2018 +0100 staging: wlan-ng: fix expression continuation in prism2fw.c checkpatch reports "CHECK: Logical continuations should be on the previous line" when a continuation line begins with an operator. Reformat the code so that the operator appears at the end of the line being continued. Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit 005c1c0eac82d76214581e9698ee183c2df9f3c6 Author: Colin Ian King Date: Sat Jul 7 13:47:06 2018 +0100 drivers: net: lmc: remove redundant variable next_rx Variable next_rx is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'next_rx' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 676dce64dd48f4eb3e5710305109712e35a612a0 Merge: 8f704ef66640 1c0e8123e32a Author: David S. Miller Date: Sat Jul 7 21:22:57 2018 +0900 Merge branch 'cpsw-allow-PTP-224.0.0.107-to-be-timestamped' Ivan Khoronzhuk says: ==================== allow PTP 224.0.0.107 to be timestamped Allows packets with 224.0.0.107 mcas address for PTP packets to be timestamped. Only for cpsw version > v1.15. ==================== Signed-off-by: David S. Miller commit 1c0e8123e32a048a6c79435704c77d9e04ec5a1b Author: Ivan Khoronzhuk Date: Fri Jul 6 21:44:45 2018 +0300 net: ethernet: ti: cpsw: allow PTP 224.0.0.107 to be timestamped Tested on AM572x with cpsw v1.15 for PTP sync and delay_req messages. It doesn't work on cpsw v1.12, so added only for cpsw v > 1.15. Command for testing: ptp4l -P -4 -H -i eth0 -l 6 -m -q -p /dev/ptp0 -f ptp.cfg where ptp.cfg: [global] tx_timestamp_timeout 20 Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 1239a96a8fcbdaa5e4171db12ccc694027a20ee7 Author: Ivan Khoronzhuk Date: Fri Jul 6 21:44:44 2018 +0300 net: ethernet: ti: cpsw: use BIT macro It's needed to avoid checkpatch warnings for farther changes. Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller commit 8f704ef666406fc5e42032308a2b366ea7bca846 Author: Arnd Bergmann Date: Fri Jul 6 15:36:07 2018 +0200 stmmac: fix signed 64-bit division I link error on 32-bit ARM points to yet another arithmetic bug: drivers/net/ethernet/stmicro/stmmac/stmmac_tc.o: In function `tc_setup_cbs': stmmac_tc.c:(.text+0x148): undefined reference to `__aeabi_uldivmod' stmmac_tc.c:(.text+0x1fc): undefined reference to `__aeabi_uldivmod' stmmac_tc.c:(.text+0x308): undefined reference to `__aeabi_uldivmod' stmmac_tc.c:(.text+0x320): undefined reference to `__aeabi_uldivmod' stmmac_tc.c:(.text+0x33c): undefined reference to `__aeabi_uldivmod' drivers/net/ethernet/stmicro/stmmac/stmmac_tc.o:stmmac_tc.c:(.text+0x3a4): more undefined references to `__aeabi_uldivmod' follow I observe that the last change to add the 'ul' prefix was incorrect, as it did not turn the result of the multiplication into a 64-bit expression on 32-bit architectures. Further, it seems that the do_div() macro gets confused by the fact that we pass a signed variable rather than unsigned into it. This changes the code to instead use the div_s64() helper that is meant for signed division, along with changing the constant suffix to 'll' to actually make it a 64-bit argument everywhere, fixing both of the issues I pointed out. I'm not completely convinced that this makes the code correct, but I'm fairly sure that we have two problems less than before. Fixes: 1f705bc61aee ("net: stmmac: Add support for CBS QDISC") Fixes: c18a9c096683 ("net: stmmac_tc: use 64-bit arithmetic instead of 32-bit") Signed-off-by: Arnd Bergmann Acked-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit a4dc70d46cf1a05b244a06d3d8c0c09908ea13b9 Author: Jon Maloy Date: Fri Jul 6 15:22:36 2018 +0200 tipc: extend link reset criteria for stale packet retransmission Currently a link is declared stale and reset if there has been 100 repeated attempts to retransmit the same packet. However, in certain infrastructures we see that packet (NACK) duplicates and delays may cause such retransmit attempts to occur at a high rate, so that the peer doesn't have a reasonable chance to acknowledge the reception before the 100-limit is hit. This may take much less than the stipulated link tolerance time, and despite that probe/probe replies otherwise go through as normal. We now extend the criteria for link reset to also being time based. I.e., we don't reset the link until the link tolerance time is passed AND we have made 100 retransmissions attempts. Acked-by: Ying Xue Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 4af4f7e8d8d10617b247020e52007acc3da2e22f Merge: 94c763513452 d64efd0926ba Author: David S. Miller Date: Sat Jul 7 20:51:53 2018 +0900 Merge branch 'Introduce-matching-on-double-vlan-QinQ-headers-for-TC-flower' Jianbo Liu says: ==================== Introduce matching on double vlan/QinQ headers for TC flower Currently TC flower supports only one vlan tag, it doesn't match on both outer and inner vlan headers for QinQ. To do this, we add support to get both outer and inner vlan headers for flow dissector, and then TC flower do matching on those information. We also plan to extend TC command to support this feature. We add new cvlan_id/cvlan_prio/cvlan_ethtype keywords for inner vlan header. The existing vlan_id/vlan_prio/vlan_ethtype are for outer vlan header, and vlan_ethtype must be 802.1q or 802.1ad. The examples for command and output are as the following. flower vlan_id 1000 vlan_ethtype 802.1q \ cvlan_id 100 cvlan_ethtype ipv4 \ action vlan pop \ action vlan pop \ action mirred egress redirect dev ens1f1_0 filter protocol 802.1ad pref 33 flower chain 0 filter protocol 802.1ad pref 33 flower chain 0 handle 0x1 vlan_id 1000 vlan_ethtype 802.1Q cvlan_id 100 cvlan_ethtype ip eth_type ipv4 in_hw ... v2: fix sparse warning. ==================== Signed-off-by: David S. Miller commit d64efd0926ba4f32e657e615a4f4a6170d5cc0fa Author: Jianbo Liu Date: Fri Jul 6 05:38:16 2018 +0000 net/sched: flower: Add supprt for matching on QinQ vlan headers As support dissecting of QinQ inner and outer vlan headers, user can add rules to match on QinQ vlan headers. Signed-off-by: Jianbo Liu Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit d30695126f0ac5bca85d09c7946ad9a1deab5d25 Author: Jianbo Liu Date: Fri Jul 6 05:38:15 2018 +0000 net/sched: flower: Dump the ethertype encapsulated in vlan Currently the encapsulated ethertype is not dumped as it's the same as TCA_FLOWER_KEY_ETH_TYPE keyvalue. But the dumping result is inconsistent with input, we add dumping it with TCA_FLOWER_KEY_VLAN_ETH_TYPE. Signed-off-by: Jianbo Liu Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 24c590e3b0f9eebe603ebe3d516990306d385f46 Author: Jianbo Liu Date: Fri Jul 6 05:38:14 2018 +0000 net/flow_dissector: Add support for QinQ dissection Dissect the QinQ packets to get both outer and inner vlan information, then store to the extended flow keys. Signed-off-by: Jianbo Liu Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit aaab08344d2670e5c119b7b497d5063d7ddb8364 Author: Jianbo Liu Date: Fri Jul 6 05:38:13 2018 +0000 net/sched: flower: Add support for matching on vlan ethertype As flow dissector stores vlan ethertype, tc flower now can match on that. It is to make preparation for supporting QinQ. Signed-off-by: Jianbo Liu Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 2064c3d4c02026572d4975177f28a58052f0a8b7 Author: Jianbo Liu Date: Fri Jul 6 05:38:12 2018 +0000 net/flow_dissector: Save vlan ethertype from headers Change vlan dissector key to save vlan tpid to support both 802.1Q and 802.1AD ethertype. Signed-off-by: Jianbo Liu Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 94c763513452b466d1e5c86b9d883ba13c9a031a Author: Colin Ian King Date: Sat Jul 7 12:27:30 2018 +0100 farsync: remove redundant variable txq_length Variable txq_length is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'txq_length' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 26476f6a1236304f1f230961469ff51c67111c8e Merge: a2f1483b9147 1ba97e6725a9 Author: David S. Miller Date: Sat Jul 7 20:29:34 2018 +0900 Merge branch 'Add-a-mlxsw-specific-test-for-mirror-to-gretap' Petr Machata says: ==================== Add a mlxsw-specific test for mirror-to-gretap Some configurations of mirror-to-gretap are impossible for mlxsw to offload. Add a test that checks that these out-of-domain conditions are handled properly by mlxsw. In patch #1, fix mirror_gre_lib.sh and mirror_gre_topo_lib.sh so that they can be imported from directories other than forwarding/. In patch #2, add a test to check handling of several scenarios that mlxsw is expected to fail to offload. ==================== Signed-off-by: David S. Miller commit 1ba97e6725a91f2f005699565a12267445a74f1f Author: Petr Machata Date: Thu Jul 5 21:09:04 2018 +0200 selftests: mlxsw: Add mlxsw-specific test for mirror to gretap Test several aspects of offloading mirror to gretap and ip6gretap netdevices that are specific to mlxsw, such as requirements for TTL and TOS values. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit e88bc0f25b99294b039b965e92a68213d594ba5b Author: Petr Machata Date: Thu Jul 5 21:10:59 2018 +0200 selftests: forwarding: Allow importing dependent libraries The next patch introduces a new mlxsw-specific test that uses mirror_gre_lib.sh and mirror_gre_topo_lib.sh. However when sourcing their own deps, these libraries assume that the test that's running is in the same directory. That's not the case for driver-specific tests. So change the libraries to source their deps through $relative_path. That variable is set up by lib.sh, which should be imported by the test in question in any case. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit a2f1483b91470804f37ce8fc69b48e8e5635c36f Merge: 22dd14916735 0241b836732f Author: David S. Miller Date: Sat Jul 7 20:20:46 2018 +0900 Merge branch 'vxlan-fix-default-fdb-entry-user-space-notify-ordering-race' Roopa Prabhu says: ==================== vxlan: fix default fdb entry user-space notify ordering/race Problem: In vxlan_newlink, a default fdb entry is added before register_netdev. The default fdb creation function notifies user-space of the fdb entry on the vxlan device which user-space does not know about yet. (RTM_NEWNEIGH goes before RTM_NEWLINK for the same ifindex). This series fixes the user-space netlink notification ordering issue with the following changes: - decouple fdb notify from fdb create. - Move fdb notify after register_netdev. - modify rtnl_configure_link to allow configuring a link early. - Call rtnl_configure_link in vxlan newlink handler to notify userspace about the newlink before fdb notify and hence avoiding the user-space race. ==================== Fixes: afbd8bae9c79 ("vxlan: add implicit fdb entry for default destination") Signed-off-by: Roopa Prabhu commit 0241b836732f5f43c3f0fd9e9073c1fb24ea6757 Author: Roopa Prabhu Date: Wed Jul 4 16:46:32 2018 -0700 vxlan: fix default fdb entry netlink notify ordering during netdev create Problem: In vxlan_newlink, a default fdb entry is added before register_netdev. The default fdb creation function also notifies user-space of the fdb entry on the vxlan device which user-space does not know about yet. (RTM_NEWNEIGH goes before RTM_NEWLINK for the same ifindex). This patch fixes the user-space netlink notification ordering issue with the following changes: - decouple fdb notify from fdb create. - Move fdb notify after register_netdev. - Call rtnl_configure_link in vxlan newlink handler to notify userspace about the newlink before fdb notify and hence avoiding the user-space race. Fixes: afbd8bae9c79 ("vxlan: add implicit fdb entry for default destination") Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 4c2438ba85cad3be282e19147782ef3a99717a1a Author: Roopa Prabhu Date: Wed Jul 4 16:46:31 2018 -0700 vxlan: make netlink notify in vxlan_fdb_destroy optional Add a new option do_notify to vxlan_fdb_destroy to make sending netlink notify optional. Used by a later patch. Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 25e20e730d56471cffa25419bf2a66078bd55330 Author: Roopa Prabhu Date: Wed Jul 4 16:46:30 2018 -0700 vxlan: add new fdb alloc and create helpers - Add new vxlan_fdb_alloc helper - rename existing vxlan_fdb_create into vxlan_fdb_update: because it really creates or updates an existing fdb entry - move new fdb creation into a separate vxlan_fdb_create Main motivation for this change is to introduce the ability to decouple vxlan fdb creation and notify, used in a later patch. Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 8d356b89f36d234a56434a110ae779e8ac389ca2 Author: Roopa Prabhu Date: Wed Jul 4 16:46:29 2018 -0700 rtnetlink: add rtnl_link_state check in rtnl_configure_link rtnl_configure_link sets dev->rtnl_link_state to RTNL_LINK_INITIALIZED and unconditionally calls __dev_notify_flags to notify user-space of dev flags. current call sequence for rtnl_configure_link rtnetlink_newlink rtnl_link_ops->newlink rtnl_configure_link (unconditionally notifies userspace of default and new dev flags) If a newlink handler wants to call rtnl_configure_link early, we will end up with duplicate notifications to user-space. This patch fixes rtnl_configure_link to check rtnl_link_state and call __dev_notify_flags with gchanges = 0 if already RTNL_LINK_INITIALIZED. Later in the series, this patch will help the following sequence where a driver implementing newlink can call rtnl_configure_link to initialize the link early. makes the following call sequence work: rtnetlink_newlink rtnl_link_ops->newlink (vxlan) -> rtnl_configure_link (initializes link and notifies user-space of default dev flags) rtnl_configure_link (updates dev flags if requested by user ifm and notifies user-space of new dev flags) Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 22dd149167359981ea6f4afde04026fb78747ddc Author: Arnd Bergmann Date: Fri Jul 6 14:58:51 2018 +0200 devlink: fix incorrect return statement A newly added dummy helper function tries to return a failure from a "void" function: In file included from include/net/dsa.h:24, from arch/arm/plat-orion/common.c:21: include/net/devlink.h: In function 'devlink_param_value_changed': include/net/devlink.h:771:9: error: 'return' with a value, in function returning void [-Werror] return -EOPNOTSUPP; This fixes it by removing the bogus statement. Fixes: ea601e170988 ("devlink: Add devlink notifications support for params") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit be9c64b19b8131459dd7107dc0ae209eeeaa9ce8 Author: Arnd Bergmann Date: Fri Jul 6 14:44:45 2018 +0200 mlxsw: spectrum_router: avoid uninitialized variable access When CONFIG_BRIDGE_VLAN_FILTERING is disabled, gcc correctly points out that the 'vid' variable is uninitialized whenever br_vlan_get_pvid returns an error: drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function 'mlxsw_sp_rif_vlan_fid_get': drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:6881:6: error: 'vid' may be used uninitialized in this function [-Werror=maybe-uninitialized] This changes the condition check to always return -EINVAL here, which I guess is what the author intended here. Fixes: e6f1960ae6c7 ("mlxsw: spectrum_router: Allocate FID according to PVID") Signed-off-by: Arnd Bergmann Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit d0414fdd58eb51ffd6528280fd66705123663964 Author: Huibin Hong Date: Fri Jul 6 16:03:57 2018 +0800 arm64: dts: rockchip: corrected uart1 clock-names for rk3328 Corrected the uart clock-names or the uart driver might fail. Fixes: 52e02d377a72 ("arm64: dts: rockchip: add core dtsi file for RK3328 SoCs") Cc: stable@vger.kernel.org Signed-off-by: Huibin Hong Signed-off-by: Heiko Stuebner commit 8559bbeeb849283003138648ada9098a7eb63632 Author: Heiko Stuebner Date: Sat Jun 2 18:11:46 2018 +0200 arm64: dts: rockchip: add Google Bob After Kevin, the second chromebook-incarnation of the Gru series is Bob. This materializes as the Asus Chromebook Flip C101PA, whose formfactor is quite similar to Minnie from the Veyron series. Add the devicetree file and binding update for it. Signed-off-by: Heiko Stuebner commit d67a38c5a623845dbd562598f8de4991ed0cc58e Author: Heiko Stuebner Date: Sat Jun 2 16:06:30 2018 +0200 arm64: dts: rockchip: move core edp from rk3399-kevin to shared chromebook Bob needs the same backlight and core edp settings, so move these nodes to the shared dtsi that both will use as a base. Signed-off-by: Heiko Stuebner commit a0aa6bfebcc729fcbfb1c7ea5751822c4c724765 Author: Heiko Stuebner Date: Sat Jun 2 08:53:40 2018 +0200 arm64: dts: rockchip: move Chromebook-specific Gru-parts to a separate file Similar to rk3288-Veyron before, the Gru-series does contain Chromebook (aka clamshell laptops) and non-Chromebook devices. And while the two Chromebook devices Kevin and Bob are quite similar, Scarlet the tablet- device is quite different in its design. Therefore move the Chromebook parts into a gru-chromebook dtsi file to make sharing easier. Signed-off-by: Heiko Stuebner commit ea3cb4812ed5f04e18d2409eb7b4a6b9b630cc26 Author: Heiko Stuebner Date: Sat Jun 2 08:58:54 2018 +0200 arm64: dts: rockchip: add phandles to some nodes on rk3399-gru Some nodes will need to be refined on a per board level, so add phandles to them to reference them later. Signed-off-by: Heiko Stuebner commit 57f4e8bc1c3ebbd06a278107edeb6af95b53e5bf Author: Jonathan Bakker Date: Sat Jul 7 12:09:43 2018 +0200 dt-bindings: samsung: Document bindings for SGH-T959P board Document the binding for Samsung Galaxy S Fascinate 4G (SGH-T959P). Signed-off-by: Jonathan Bakker Signed-off-by: Paweł Chmiel Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski commit c0acddb027c347340af6f45c0c91fe8895afee18 Author: Paweł Chmiel Date: Sat Jul 7 12:09:42 2018 +0200 dt-bindings: samsung: Document bindings for Samsung aries boards Document the binding for Samsung Galaxy S (i9000) phone and whole Samsung Aries devices family (based on S5PV210). Also because this is first not Exynos-based devices, document this information at beginning of file. Signed-off-by: Paweł Chmiel Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski commit ac71a5cca57d3996e32e5a7bc3b17075f7c15d15 Author: Jonathan Bakker Date: Sat Jul 7 12:09:41 2018 +0200 ARM: dts: s5pv210: Add initial DTS for SGH-T959P phone This DTS file have initial support Samsung SGH-T959P phone, also known as Samsung Galaxy S 4G or fascinate4g. It belongs to Samsung Aries devices family. Initial version have support for: - sdcard - max8998 pmic and rtc - max17040 fuel gauge - gpio keys - fimd (no panel driver yet) - usb (peripherial mode) - wifi Signed-off-by: Jonathan Bakker Signed-off-by: Paweł Chmiel Signed-off-by: Krzysztof Kozlowski commit a3213bfb461cedc25817fd8d20e896db61e47744 Author: Paweł Chmiel Date: Sat Jul 7 12:09:40 2018 +0200 ARM: dts: s5pv210: Add initial DTS for Samsung Galaxy S phone This DTS file have initial support Samsung Galaxy S phone, also known as i9000. It belongs to Samsung Aries devices family. Initial version have support for: - sdcard - internal memory - max8998 pmic and rtc - max17040 fuel gauge - gpio keys - fimd (no panel driver yet) - usb (peripherial mode) - wifi Signed-off-by: Paweł Chmiel Signed-off-by: Krzysztof Kozlowski commit 170642468a513eacc694fcd924dd71d07dd28d81 Author: Paweł Chmiel Date: Sat Jul 7 12:09:39 2018 +0200 ARM: dts: s5pv210: Add initial DTS for Samsung Aries based phones This DTS file have initial support Samsung Aries based phones. Initial version have support for: - sdcard - internal memory (present only on non 4g variant) - max8998 pmic and rtc - max17040 fuel gauge - gpio keys - fimd (no panel driver yet) - usb (peripherial mode) - wifi Signed-off-by: Paweł Chmiel Signed-off-by: Krzysztof Kozlowski commit fb60e87dc4aa415f9d797c5df522eb9578366359 Author: Colin Ian King Date: Wed Jul 4 07:46:09 2018 +0100 mtd: nftl: remove redundant variable nb_erases Variable nb_erases is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'nb_erases' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Boris Brezillon commit 0219ef1ce577b85a859559c43458c52ca7f29586 Author: Colin Ian King Date: Tue Jul 3 08:43:39 2018 +0100 mtd: cfi: cmdset_0002: remove redundant variable timeo Variable is_local is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'timeo' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Boris Brezillon commit 48360246162b50e84a6e63ed572fdda5e038518b Author: Geert Uytterhoeven Date: Thu Jun 28 10:20:11 2018 +0200 mtd: Use kasprintf() instead of fixed buffer formatting Using "%4.4X" in the calculation of the buffer size is misleading, as the format string literal has no relation to the actual size needed. Hence this is fragile w.r.t. future modification. As this is not a hot path, fix this by replacing the formatting in a fixed buffer by kasprintf(). Signed-off-by: Geert Uytterhoeven Signed-off-by: Boris Brezillon commit 98534a58c8a40cdc9e3bcb04d74719fbcedfeb52 Author: Rafał Miłecki Date: Tue Jun 26 00:05:08 2018 +0200 mtd: parsers: trx: add of_match_table with the new DT binding This allows using TRX parser to find TRX partitions on flash device described in DT using a proper binding. It's useful for devices storing firmware on a separated flash and having rootfs partition in it. Signed-off-by: Rafał Miłecki Signed-off-by: Boris Brezillon commit d1001b060621d2119a81ee00b652a84595b03abe Author: Rafał Miłecki Date: Tue Jun 26 00:05:07 2018 +0200 dt-bindings: mtd: document Broadcom's TRX firmware format binding Broadcom based home router devices use TRX firmware format. It's a container that can hold few partitions. If operating system is expected to access them it has to understand that format and parse flash data accordingly. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Boris Brezillon commit 24ede29d026a9f00aa3f4e7a5531803af4810734 Author: Paweł Chmiel Date: Fri Jul 6 20:32:50 2018 +0200 ARM: s5pv210_defconfig: Enable options needed to boot typical Linux distro Enable few options which are required to boot typical Linux distro. It was tested by booting ArchLinux ARM from sdcard. Signed-off-by: Paweł Chmiel Signed-off-by: Krzysztof Kozlowski commit 6ad73ea4c3e6098f24d821a56d5ff50592203505 Author: Paweł Chmiel Date: Fri Jul 6 20:32:49 2018 +0200 ARM: s5pv210_defconfig: Enable drivers for Samsung Aries based phones Enable config options required for Samsung Aries based phones. ARM_APPENDED_DTB is also needed, because stock bootloader does not support loading DTB files. Signed-off-by: Paweł Chmiel Signed-off-by: Krzysztof Kozlowski commit c31106b7af32d845e56acb705f07e187f9b519e6 Author: Zhouyang Jia Date: Fri Jun 22 09:52:20 2018 +0800 mtd: maps: gpio-addr-flash: add error handling for ioremap_nocache When ioremap_nocache fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling ioremap_nocache. Signed-off-by: Zhouyang Jia Signed-off-by: Boris Brezillon commit 0df13b619d5c11820238095ea9cd566e6a363f08 Author: Paweł Chmiel Date: Fri Jul 6 20:32:48 2018 +0200 ARM: s5pv210_defconfig: Run make savedefconfig Cleanup the config with savedefconfig. Signed-off-by: Paweł Chmiel Signed-off-by: Krzysztof Kozlowski commit 3508f7ceb8cd5750df9d3485e62b70cf5a0a2303 Author: Paweł Chmiel Date: Fri Jul 6 20:32:42 2018 +0200 ARM: dts: s5pv210: Add missing interrupt-controller property to gph2 Adds missing interrupt-controller property to gph2 block, to silence following warnings during build: /soc/pinctrl@e0200000/gph2: Missing interrupt-controller or interrupt-map property It's reguired by Samsung Aries boards, an S5PV210 based Samsung Galaxy S (i9000) and Galaxy S 4G phones, which are added in next patches. Signed-off-by: Paweł Chmiel Signed-off-by: Krzysztof Kozlowski commit 33d77fc00e9027266884a2dbcffd9b9f75ef39ad Author: Randy Dunlap Date: Fri Jul 6 20:54:37 2018 -0700 staging/rtl8192u: fix defined but not used build warnings Fix build warnings in rtl8192u when CONFIG_PROC_FS is not enabled by marking the unused functions as __maybe_unused. ../drivers/staging/rtl8192u/r8192U_core.c:508:12: warning: 'proc_get_stats_ap' defined but not used [-Wunused-function] ../drivers/staging/rtl8192u/r8192U_core.c:527:12: warning: 'proc_get_registers' defined but not used [-Wunused-function] ../drivers/staging/rtl8192u/r8192U_core.c:568:12: warning: 'proc_get_stats_tx' defined but not used [-Wunused-function] ../drivers/staging/rtl8192u/r8192U_core.c:627:12: warning: 'proc_get_stats_rx' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap Cc: Jerry chuang Cc: devel@driverdev.osuosl.org Cc: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 4cd6bacfaa74ecf15b5e6f50b94100d62f00c52c Author: Peter Vernia Date: Sat Jul 7 03:10:22 2018 -0400 staging: mt7621-pci: Move open-braces to match kernel code style Moves some open-braces to the end of the conditional statement to match the kernel's coding style Signed-off-by: Peter Vernia Signed-off-by: Greg Kroah-Hartman commit bd84b268351db4bd26843974a3c0ca917f7e0cca Author: Peter Vernia Date: Sat Jul 7 03:09:19 2018 -0400 staging: mt7621-pci: Add spaces after commas in pci-mt7621.c Adds spaces after commas in parameter lists in pci-mt7621.c Signed-off-by: Peter Vernia Signed-off-by: Greg Kroah-Hartman commit d723b7cca52b89de0945cd7f90fad3c49930b394 Author: Peter Vernia Date: Sat Jul 7 03:08:36 2018 -0400 staging: mt7621-pci: Fix spacing around equals sign Add spaces in front of the equals sign in assignment operations Signed-off-by: Peter Vernia Signed-off-by: Greg Kroah-Hartman commit b6c319606eb62c393a95bc53f9d4cbee31d5b88d Author: Peter Vernia Date: Sat Jul 7 03:07:55 2018 -0400 staging: mt7621-pci: Fix spaces around parenthesis in pci-7621.c Adds spaces before open parenthesis, and removes spaces after open parenthesis Signed-off-by: Peter Vernia Signed-off-by: Greg Kroah-Hartman commit 4cc4dbbc0946c31b0988bb44eea19d759b054351 Author: Todd Poynor Date: Fri Jul 6 23:43:10 2018 -0700 drivers/staging/gasket: Use refcount_read() Use the refcount_read accessor function, avoid reaching into refcount and atomic struct fields. Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman commit 166126c1e54d927c2e8efa2702d420e0ce301fd9 Author: Guenter Roeck Date: Sun Jul 1 13:57:13 2018 -0700 kernfs: Replace strncpy with memcpy gcc 8.1.0 complains: fs/kernfs/symlink.c:91:3: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length fs/kernfs/symlink.c: In function 'kernfs_iop_get_link': fs/kernfs/symlink.c:88:14: note: length computed here Using strncpy() is indeed less than perfect since the length of data to be copied has already been determined with strlen(). Replace strncpy() with memcpy() to address the warning and optimize the code a little. Signed-off-by: Guenter Roeck Acked-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman commit 890fd185d53037d05d10a0825950c4b038e39d4a Author: Chris Wilson Date: Fri Jul 6 22:07:10 2018 +0100 drm/i915: Replace nested subclassing with explicit subclasses In the next patch, we will want a third distinct class of timeline that may overlap with the current pair of client and engine timeline classes. Rather than use the ad hoc markup of SINGLE_DEPTH_NESTING, initialise the different timeline classes with an explicit subclass. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180706210710.16251-1-chris@chris-wilson.co.uk commit 008095e065a85a13ffb41b9c98149456267c30b8 Author: Boris Brezillon Date: Tue Jul 3 09:50:22 2018 +0200 drm/vc4: Add support for the transposer block The transposer block is providing support for mem-to-mem composition, which is exposed as a drm_writeback connector in DRM. Add a driver to support this feature. Signed-off-by: Boris Brezillon Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-9-boris.brezillon@bootlin.com commit 1ebe99a75eeda1067c39c1c039ca9bb7e3c9c342 Author: Boris Brezillon Date: Tue Jul 3 09:50:21 2018 +0200 drm/vc4: Call drm_atomic_helper_fake_vblank() in the commit path Mimic what is done in drm_atomic_commit_tail() and call drm_atomic_helper_fake_vblank() so that VBLANK events are faked when the drm_crtc_state.no_vblank is true. Will be needed when we'll add support for the transposer block. Signed-off-by: Boris Brezillon Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-8-boris.brezillon@bootlin.com commit 6fb42b6682f0d3c6ca9dc0e338c294fb92448e1d Author: Boris Brezillon Date: Tue Jul 3 09:50:20 2018 +0200 drm/atomic: Call fake_vblank() from the generic commit_tail() helpers Now that we have a way to fake VBLANK events when requested by the CRTC hook it up to the generic commit_tail() helpers. Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-7-boris.brezillon@bootlin.com commit b25c60af7a8773694a505cdb0d2e67807243217d Author: Boris Brezillon Date: Tue Jul 3 09:50:19 2018 +0200 drm/crtc: Add a generic infrastructure to fake VBLANK events In some cases CRTCs are active but are not able to generating events, at least not at every frame at it's expected to. This is typically the case when the CRTC is feeding a writeback connector that has no job queued. In this situation the CRTC is usually stopped until a new job is queued, and this can lead to timeouts when part of the pipeline is updated but no new jobs are queued to the active writeback connector. In order to solve that, we add a ->no_vblank flag to drm_crtc_state and ask the CRTC drivers to set it to true when they know they're not able to generate VBLANK events. The core drm_atomic_helper_fake_vblank() helper can then be used to fake VBLANKs at commit time. Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-6-boris.brezillon@bootlin.com commit 184d3cf4f73896267340cf06acfa751fad4f8dd2 Author: Boris Brezillon Date: Tue Jul 3 09:50:18 2018 +0200 drm/vc4: Use wait_for_flip_done() instead of wait_for_vblanks() drm_atomic_helper_wait_for_vblanks() assumes the CRTC will continuously generate VBLANK events and the vblank counter will keep increasing. While this work for a regular pipeline, it doesn't when you have the CRTC is feeding the transposer block, because this block works in oneshot mode, and, by the time we reach drm_atomic_helper_wait_for_vblanks() the only VBLANK event might have already been sent and the VBLANK counter will stay unchanged, thus triggering a timeout. Luckily, we can replace the drm_atomic_helper_wait_for_vblanks() call by drm_atomic_helper_wait_for_flip_done() because the only thing we want to check when calling drm_atomic_helper_wait_for_vblanks() from vc4_atomic_complete_commit() is that new FBs are in use and the old ones can be safely released. Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-5-boris.brezillon@bootlin.com commit 814bde99ee809c172a409829889d1bafc3e4bcf7 Author: Boris Brezillon Date: Tue Jul 3 09:50:17 2018 +0200 drm/connector: Make ->atomic_commit() optional Not all writeback connector implementations might want to commit things from the connector driver. Some, like the malidp driver, commit things from their main commit_tail() function, and would rather not have to implement a dummy hook for drm_connector_helper_funcs.atomic_commit(). Make this function optional and reflect this fact in the doc. Signed-off-by: Boris Brezillon Acked-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-4-boris.brezillon@bootlin.com commit 425132fdb169c2a2772190ff56e0e8eea37ff716 Author: Boris Brezillon Date: Tue Jul 3 09:50:16 2018 +0200 drm/connector: Pass a drm_connector_state to ->atomic_commit() Other atomic hooks are passed state objects, let's change this one to be consistent. Signed-off-by: Boris Brezillon Acked-by: Liviu Dudau Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-3-boris.brezillon@bootlin.com commit b82c1f8f78b4d273d1bcefe3e805eff61e879a68 Author: Boris Brezillon Date: Tue Jul 3 09:50:15 2018 +0200 drm/atomic: Avoid connector to writeback_connector casts Use container_of() instead of type casting so that it keeps working even if base is moved inside the drm_writeback_connector struct. Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-2-boris.brezillon@bootlin.com commit 73915b2b1f2581cbce5a511550c2cac2e2b42595 Author: Boris Brezillon Date: Tue Jul 3 19:40:46 2018 +0200 drm/writeback: Fix the "overview" section of the doc Fix the bullet list declaration in the overview section. Signed-off-by: Boris Brezillon Reported-by: Daniel Vetter Fixes: 935774cd71fe ("drm: Add writeback connector type") Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703174046.22396-1-boris.brezillon@bootlin.com commit e2664f97c38c4f1bef3cbcc69969627c134aee17 Merge: 4fed38cf2627 8d40854fc180 Author: David S. Miller Date: Sat Jul 7 11:13:07 2018 +0900 Merge branch 'hns3-misc-fixes' Salil Mehta says: ==================== Misc. bug fixes & cleanups for HNS3 driver This patch-set presents some miscellaneous bug fixes and cleanups for the HNS3 driver. ==================== Signed-off-by: David S. Miller commit 8d40854fc180b7d39bf08cc76fbb9a60bcd65f14 Author: Huazhong Tan Date: Fri Jul 6 11:28:04 2018 +0100 net: hns3: Prevent sending command during global or core reset According to hardware's description, driver should not send command to IMP while hardware doing global or core reset. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit a754e5c4ed0627c3d5695ebbbc7ca53b38c6103a Author: Peng Li Date: Fri Jul 6 11:28:03 2018 +0100 net: hns3: Remove the warning when clear reset cause Only the core/global/IMP reset need clear cause, other type does not need do it. The warning may be treated as error as it is normal. This patch removes the warning. Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 03718db97bfb57535f3aa8110f0cbe0c616a67c0 Author: Yunsheng Lin Date: Fri Jul 6 11:28:02 2018 +0100 net: hns3: Fix get_vector ops in hclgevf_main module The hclgevf_free_vector function expects the caller to pass the vector_id to it, and hclgevf_put_vector pass vector to it now, which will cause vector allocation problem. This patch fixes it by converting vector into vector_id before calling hclgevf_free_vector. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit d7099d15478e89edb9bc6c6e3ab4cd341884a367 Author: Yunsheng Lin Date: Fri Jul 6 11:28:01 2018 +0100 net: hns3: Fix warning bug when doing lp selftest The napi_alloc_skb is excepted to be called under the non-preemptible code path when it is called by hns3_clean_rx_ring during loopback selftest, otherwise the below warning will be logged: [ 92.420780] BUG: using smp_processor_id() in preemptible [00000000] code: ethtool/1873 [ 92.463202] check_preemption_disabled+0xf8/0x100 [ 92.467893] debug_smp_processor_id+0x1c/0x28 [ 92.472239] __napi_alloc_skb+0x30/0x130 [ 92.476158] hns3_clean_rx_ring+0x118/0x5f0 [hns3] [ 92.480941] hns3_self_test+0x32c/0x4d0 [hns3] [ 92.485375] ethtool_self_test+0xdc/0x1e8 [ 92.489372] dev_ethtool+0x1020/0x1da8 [ 92.493109] dev_ioctl+0x188/0x3a0 [ 92.496499] sock_do_ioctl+0xf4/0x208 [ 92.500148] sock_ioctl+0x228/0x3e8 [ 92.503626] do_vfs_ioctl+0xc4/0x880 [ 92.507189] SyS_ioctl+0x94/0xa8 [ 92.510404] el0_svc_naked+0x30/0x34 This patch fix it by disabling preemption when calling hns3_clean_rx_ring during loopback selftest. Fixes: c39c4d98dc65 ("net: hns3: Add mac loopback selftest support in hns3 driver") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 8fc7346c84a4471d21389a9ead1bbc2420d65ea0 Author: Jian Shen Date: Fri Jul 6 11:28:00 2018 +0100 net: hns3: Add configure for mac minimal frame size When change the mtu, the minimal frame size of mac will be set to zero, it is incorrect. This patch fixes it by set it to the default value. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit ead5bd4d35c0a14d5ce1474177718c678dff5205 Author: Fuyun Liang Date: Fri Jul 6 11:27:59 2018 +0100 net: hns3: Fix for mailbox message truncated problem The payload of mailbox message is 16 byte and the value of HCLGE_MBX_MAX_ARQ_MSG_SIZE is 8. A message truncated problem will happen when mailbox message is converted to ARQ message. This patch replaces HCLGE_MBX_MAX_ARQ_MSG_SIZE with the size of ARQ message in hclgevf_mbx_handler to fix this problem. Fixes: b11a0bb231f3 ("net: hns3: Add mailbox support to VF driver") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 5c8971979a10783150e1011ece685333bbec5759 Author: Yunsheng Lin Date: Fri Jul 6 11:27:58 2018 +0100 net: hns3: Fix for l4 checksum offload bug Hardware only support tcp/udp/sctp l4 checksum offload, but the driver currently tell hardware to do l4 checksum offlad when l3 is IPv4 or IPv6, which may cause checksumm error. This patch fixes it by only enabling the l4 offload when l4 is tcp/udp/sctp. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 3738287c7a54c7b3d7421cc92c22aa5ad9096fd8 Author: Yunsheng Lin Date: Fri Jul 6 11:27:57 2018 +0100 net: hns3: Fix for waterline not setting correctly The HCLGE_RX_PRIV_EN_B is used to tell the firmware whether to update the specific waterline value, if the is not set, the firmware will ignore the value. This patch fixes by setting the HCLGE_RX_PRIV_EN_B even if the updated value is zero. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 6d0ec65cb5810f9bf08671be008785bb8c84d39f Author: Yunsheng Lin Date: Fri Jul 6 11:27:56 2018 +0100 net: hns3: Fix for mac pause not disable in pfc mode When pfc pause mode is enable, the mac pause mode need to be disabled, otherwise the pfc pause packet will not be sent when congestion happens. This patch fixes by disabling the mac pause when pfc pause is enabled. Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit a75a8efa00c59d6987e9372583017baf63a2c27d Author: Yunsheng Lin Date: Fri Jul 6 11:27:55 2018 +0100 net: hns3: Fix tc setup when netdev is first up Currently, tc related configuration is not setup when the netdev is first up, which cause the stack only using tc 0 problem. This patch fixes it by setting the tc related configuration using the info from NCL_CONFIG when netdev is first up. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 4fed38cf26278e6597b506e62a9156e45cbcec49 Author: Rick Farrington Date: Fri Jul 6 11:27:07 2018 -0700 liquidio: fix kernel panic when NIC firmware is older than 1.7.2 Pre-1.7.2 NIC firmware does not support (and does not respond to) the "get speed" command which is sent by the 1.7.2 driver (for CN23XX-225 cards only) during modprobe. Due to a bug in older firmware (with respect to unknown commands), this unsupported command causes a cascade of errors that ends in a kernel panic. Fix it by making the sending of the "get speed" command conditional on the firmware version. Signed-off-by: Rick Farrington Signed-off-by: Felix Manlunas Signed-off-by: David S. Miller commit 9ebcb397aaaf6a18d35db0168375e183e9170f53 Merge: ab8565af6800 fbf47813607b Author: David S. Miller Date: Sat Jul 7 10:58:50 2018 +0900 Merge branch 'sock-cookie-initializers' Willem de Bruijn says: ==================== sock cookie initializers Recent UDP GSO and SO_TXTIME features added new fields to cookie structs. When adding a field, all sites where a struct is initialized have to be updated, which is a lot of boilerplate. Alternatively, a field can be initialized selectively, but this is fragile. I introduced a bug in udp gso where an uninitialized field was read. See also fix commit ("9887cba19978 ip: limit use of gso_size to udp"). Introduce initializers for structs ipcm(6)_cookie and sockc_cookie. patch 1..3 do exactly this. patch 4..5 make ipv4 and ipv6 handle cookies the same way and remove some boilerplate in doing so. patch 6 removes the udp gso branch that needed the above fix ==================== Signed-off-by: David S. Miller commit fbf47813607ba8c4e5c5b81da3c47fc66ac314b1 Author: Willem de Bruijn Date: Fri Jul 6 10:12:59 2018 -0400 ip: unconditionally set cork gso_size Now that ipc(6)->gso_size is correctly initialized in all callers of ip(6)_setup_cork, it is safe to unconditionally pass it to the cork. Link: http://lkml.kernel.org/r/20180619164752.143249-1-willemdebruijn.kernel@gmail.com Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 678ca42d688534adfc780b150abefaaac7c86687 Author: Willem de Bruijn Date: Fri Jul 6 10:12:58 2018 -0400 ip: remove tx_flags from ipcm_cookie and use same logic for v4 and v6 skb_shinfo(skb)->tx_flags is derived from sk->sk_tsflags, possibly after modification by __sock_cmsg_send, by calling sock_tx_timestamp. The IPv4 and IPv6 paths do this conversion differently. In IPv4, the individual protocols that support tx timestamps call this function and store the result in ipc.tx_flags. In IPv6, sock_tx_timestamp is called in __ip6_append_data. There is no need to store both tx_flags and ts_flags in the cookie as one is derived from the other. Convert when setting up the cork and remove the redundant field. This is similar to IPv6, only have the conversion happen only once per datagram, in ip(6)_setup_cork. Also change __ip6_append_data to match __ip_append_data. Only update tskey if timestamping is enabled with OPT_ID. The SOCK_.. test is redundant: only valid protocols can have non-zero cork->tx_flags. After this change the IPv4 and IPv6 logic is the same. Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 5fdaa88dfefa87ee1ea92750e99950dca182ea41 Author: Willem de Bruijn Date: Fri Jul 6 10:12:57 2018 -0400 ipv6: fold sockcm_cookie into ipcm6_cookie ipcm_cookie includes sockcm_cookie. Do the same for ipcm6_cookie. This reduces the number of arguments that need to be passed around, applies ipcm6_init to all cookie fields at once and reduces code differentiation between ipv4 and ipv6. Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 657a0667025e77cc17f8a38b93e60a2bc24d830c Author: Willem de Bruijn Date: Fri Jul 6 10:12:56 2018 -0400 sock: sockc cookie initializer Initialize the cookie in one location to reduce code duplication and avoid bugs from inconsistent initialization, such as that fixed in commit 9887cba19978 ("ip: limit use of gso_size to udp"). Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit b515430ac9c25d5192cf498af3c6be6c4f51caad Author: Willem de Bruijn Date: Fri Jul 6 10:12:55 2018 -0400 ipv6: ipcm6_cookie initializer Initialize the cookie in one location to reduce code duplication and avoid bugs from inconsistent initialization, such as that fixed in commit 9887cba19978 ("ip: limit use of gso_size to udp"). Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 351782067b6be81879b0af0daf7bd3acbb32d986 Author: Willem de Bruijn Date: Fri Jul 6 10:12:54 2018 -0400 ipv4: ipcm_cookie initializers Initialize the cookie in one location to reduce code duplication and avoid bugs from inconsistent initialization, such as that fixed in commit 9887cba19978 ("ip: limit use of gso_size to udp"). Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 6c79d12e945e85556674a04cde13657a5d7943da Author: Taniya Das Date: Sat Jun 23 19:49:26 2018 +0530 dt-bindings: clock: Introduce QCOM Display clock bindings Add device tree bindings for display clock controller for Qualcomm Technology Inc's SDM845 SoCs. Signed-off-by: Taniya Das Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit da172d2b6ba8c98101b9c18a986758662a91adbb Author: Taniya Das Date: Sat Jun 23 19:49:25 2018 +0530 clk: qcom: Move frequency table macro to common file Frequency table macro is used by multiple clock drivers, move frequency table macro to common header file. Signed-off-by: Taniya Das Signed-off-by: Stephen Boyd commit d90c936fb3181695d63a1edb155d26fc576b17b4 Merge: 02000b55850d 9fb410a89e8f Author: Daniel Borkmann Date: Sat Jul 7 01:45:31 2018 +0200 Merge branch 'bpf-nfp-mul-div-support' Jiong Wang says: ==================== NFP supports u16 and u32 multiplication. Multiplication is done 8-bits per step, therefore we need 2 steps for u16 and 4 steps for u32. We also need one start instruction to initialize the sequence and one or two instructions to fetch the result depending on either you need the high halve of u32 multiplication. For ALU64, if either operand is beyond u32's value range, we reject it. One thing to note, if the source operand is BPF_K, then we need to check "imm" field directly, and we'd reject it if it is negative. Because for ALU64, "imm" (with s32 type) is expected to be sign extended to s64 which NFP mul doesn't support. For ALU32, it is fine for "imm" be negative though, because the result is 32-bits and here is no difference on the low halve of result for signed/unsigned mul, so we will get correct result. NFP doesn't have integer divide instruction, this patch set uses reciprocal algorithm (the basic one, reciprocal_div) to emulate it. For each u32 divide, we would need 11 instructions to finish the operation. 7 (for multiplication) + 4 (various ALUs) = 11 Given NFP only supports multiplication no bigger than u32, we'd require divisor and dividend no bigger than that as well. Also eBPF doesn't support signed divide and has enforced this on C language level by failing compilation. However LLVM assembler hasn't enforced this, so it is possible for negative constant to leak in as a BPF_K operand through assembly code, we reject such cases as well. Meanwhile reciprocal_div.h only implemented the basic version of: "Division by Invariant Integers Using Multiplication" - Torbjörn Granlund and Peter L. Montgomery This patch set further implements the optimized version (Figure 4.2 in the paper) inside existing reciprocal_div.h. When the divider is even and the calculated reciprocal magic number doesn't fit u32, we could reduce the required ALU instructions from 4 to 2 or 1 for some cases. The advanced version requires more complex calculation to get the reciprocal multiplier and other control variables, but then could reduce the required emulation operations. It makes sense to use it for JIT divide code generation (for example eBPF JIT backends) for which we are willing to trade performance of JITed code with that of host. v2: - add warning in l == 32 code path. (Song Liu/Jakub) - jit separate insn sequence for l == 32. (Jakub/Edwin) - should use unrestricted operand for mul. - once place should use "1U << exp" instead of "1 << exp". ==================== Signed-off-by: Daniel Borkmann commit 9fb410a89e8fa92f8ebc7aa95563442a14da21eb Author: Jiong Wang Date: Fri Jul 6 15:13:23 2018 -0700 nfp: bpf: migrate to advanced reciprocal divide in reciprocal_div.h As we are doing JIT, we would want to use the advanced version of the reciprocal divide (reciprocal_value_adv) to trade performance with host. We could reduce the required ALU instructions from 4 to 2 or 1. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 2a952b03d1a011e2e7ddc9ca59cbb21df7dc3525 Author: Jiong Wang Date: Fri Jul 6 15:13:22 2018 -0700 nfp: bpf: support u32 divide using reciprocal_div.h NFP doesn't have integer divide instruction, this patch use reciprocal algorithm (the basic one, reciprocal_div) to emulate it. For each u32 divide, we would need 11 instructions to finish the operation. 7 (for multiplication) + 4 (various ALUs) = 11 Given NFP only supports multiplication no bigger than u32, we'd require divisor and dividend no bigger than that as well. Also eBPF doesn't support signed divide and has enforced this on C language level by failing compilation. However LLVM assembler hasn't enforced this, so it is possible for negative constant to leak in as a BPF_K operand through assembly code, we reject such cases as well. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit d3d23fdb4688de4421e94227c95b1d54b233f432 Author: Jiong Wang Date: Fri Jul 6 15:13:21 2018 -0700 nfp: bpf: support u16 and u32 multiplications NFP supports u16 and u32 multiplication. Multiplication is done 8-bits per step, therefore we need 2 steps for u16 and 4 steps for u32. We also need one start instruction to initialize the sequence and one or two instructions to fetch the result depending on either you need the high halve of u32 multiplication. For ALU64, if either operand is beyond u32's value range, we reject it. One thing to note, if the source operand is BPF_K, then we need to check "imm" field directly, and we'd reject it if it is negative. Because for ALU64, "imm" (with s32 type) is expected to be sign extended to s64 which NFP mul doesn't support. For ALU32, it is fine for "imm" be negative though, because the result is 32-bits and here is no difference on the low halve of result for signed/unsigned mul, so we will get correct result. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit 33b94310586b761fd04de0ef951d2f5d764b9b2a Author: Jiong Wang Date: Fri Jul 6 15:13:20 2018 -0700 nfp: bpf: copy range info for all operands of all ALU operations NFP verifier hook is coping range information of the shift amount for indirect shift operation so optimized shift sequences could be generated. We want to use range info to do more things. For example, to decide whether multiplication and divide are supported on the given range. This patch simply let NFP verifier hook to copy range info for all operands of all ALU operands. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit 662c54721d3a1e8950029cb6b0ed264d59847711 Author: Jiong Wang Date: Fri Jul 6 15:13:19 2018 -0700 nfp: bpf: rename umin/umax to umin_src/umax_src The two fields are a copy of umin and umax info of bpf_insn->src_reg generated by verifier. Rename to make their meaning clear. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit 06ae48269d1e0324d806fca30fe77112f4a4a14a Author: Jiong Wang Date: Fri Jul 6 15:13:18 2018 -0700 lib: reciprocal_div: implement the improved algorithm on the paper mentioned The new added "reciprocal_value_adv" implements the advanced version of the algorithm described in Figure 4.2 of the paper except when "divisor > (1U << 31)" whose ceil(log2(d)) result will be 32 which then requires u128 divide on host. The exception case could be easily handled before calling "reciprocal_value_adv". The advanced version requires more complex calculation to get the reciprocal multiplier and other control variables, but then could reduce the required emulation operations. It makes no sense to use this advanced version for host divide emulation, those extra complexities for calculating multiplier etc could completely waive our saving on emulation operations. However, it makes sense to use it for JIT divide code generation (for example eBPF JIT backends) for which we are willing to trade performance of JITed code with that of host. As shown by the following pseudo code, the required emulation operations could go down from 6 (the basic version) to 3 or 4. To use the result of "reciprocal_value_adv", suppose we want to calculate n/d, the C-style pseudo code will be the following, it could be easily changed to real code generation for other JIT targets. struct reciprocal_value_adv rvalue; u8 pre_shift, exp; // handle exception case. if (d >= (1U << 31)) { result = n >= d; return; } rvalue = reciprocal_value_adv(d, 32) exp = rvalue.exp; if (rvalue.is_wide_m && !(d & 1)) { // floor(log2(d & (2^32 -d))) pre_shift = fls(d & -d) - 1; rvalue = reciprocal_value_adv(d >> pre_shift, 32 - pre_shift); } else { pre_shift = 0; } // code generation starts. if (imm == 1U << exp) { result = n >> exp; } else if (rvalue.is_wide_m) { // pre_shift must be zero when reached here. t = (n * rvalue.m) >> 32; result = n - t; result >>= 1; result += t; result >>= rvalue.sh - 1; } else { if (pre_shift) result = n >> pre_shift; result = ((u64)result * rvalue.m) >> 32; result >>= rvalue.sh; } Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 02000b55850deeadffe433e4b4930a8831f477de Author: Roman Gushchin Date: Fri Jul 6 14:28:16 2018 -0700 bpftool: add bash completion for cgroup tree command This commit adds a bash completion to the bpftool cgroup tree command. Signed-off-by: Roman Gushchin Cc: Jakub Kicinski Cc: Quentin Monnet Cc: Daniel Borkmann Cc: Alexei Starovoitov Acked-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 7d31a0a168979e671e25073c492c29c42610e7e2 Author: Roman Gushchin Date: Fri Jul 6 14:28:15 2018 -0700 bpftool: document cgroup tree command Describe cgroup tree command in the corresponding bpftool man page. Signed-off-by: Roman Gushchin Acked-by: Jakub Kicinski Cc: Quentin Monnet Cc: Daniel Borkmann Cc: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 2058b38371d0dbd84831a085db64b996d623f81a Author: Roman Gushchin Date: Fri Jul 6 14:28:14 2018 -0700 bpftool: introduce cgroup tree command This commit introduces a new bpftool command: cgroup tree. The idea is to iterate over the whole cgroup tree and print all attached programs. I was debugging a bpf/systemd issue, and found, that there is no simple way to listen all bpf programs attached to cgroups. I did master something in bash, but after some time got tired of it, and decided, that adding a dedicated bpftool command could be a better idea. So, here it is: $ sudo ./bpftool cgroup tree CgroupPath ID AttachType AttachFlags Name /sys/fs/cgroup/system.slice/systemd-machined.service 18 ingress 17 egress /sys/fs/cgroup/system.slice/systemd-logind.service 20 ingress 19 egress /sys/fs/cgroup/system.slice/systemd-udevd.service 16 ingress 15 egress /sys/fs/cgroup/system.slice/systemd-journald.service 14 ingress 13 egress Signed-off-by: Roman Gushchin Acked-by: Jakub Kicinski Cc: Quentin Monnet Cc: Daniel Borkmann Cc: Alexei Starovoitov Signed-off-by: Daniel Borkmann commit 07e070e1e3b24e4b66a3b5e55e6486d7fe9769dd Author: Chris Wilson Date: Fri Jul 6 21:59:47 2018 +0100 drm/i915/selftests: Avoid warning if runtime pm is disabled Inside the mock GEM device, we try to grab the runtime pm for the fake device to prevent it from ever suspending. However, if CONFIG_PM is not set, trying to obtain the wakref returns an error which we WARN about. Suppress the expected warning. Signed-off-by: Chris Wilson Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180706205947.11209-1-chris@chris-wilson.co.uk commit 1b4f42a1e33fec999e94802df13dbd7521315742 Author: Miklos Szeredi Date: Fri Jul 6 23:57:03 2018 +0200 vfs: dedupe: extract helper for a single dedup Extract vfs_dedupe_file_range_one() helper to deal with a single dedup request. Signed-off-by: Miklos Szeredi Reviewed-by: Christoph Hellwig commit 87eb5eb2423213ac0e7315ce5d275f1ff80e0263 Author: Miklos Szeredi Date: Fri Jul 6 23:57:03 2018 +0200 vfs: dedupe: rationalize args Clean up f_op->dedupe_file_range() interface. 1) Use loff_t for offsets and length instead of u64 2) Order the arguments the same way as {copy|clone}_file_range(). Signed-off-by: Miklos Szeredi Reviewed-by: Darrick J. Wong commit 5740c99e9d30b81fcc478797e7215c61e241f44e Author: Miklos Szeredi Date: Fri Jul 6 23:57:03 2018 +0200 vfs: dedupe: return int Signed-off-by: Miklos Szeredi commit 92b66d2cdd7a4f6f6aa31be5f16a3f0c88902690 Author: Miklos Szeredi Date: Fri Jul 6 23:57:02 2018 +0200 vfs: limit size of dedupe Suggested-by: Darrick J. Wong Signed-off-by: Miklos Szeredi commit d0897bc85ca89d5ddc6c2fcf2f99e04d4a577b63 Author: Stephen Boyd Date: Fri Jul 6 14:08:04 2018 -0700 clk: imx51-imx53: Include sizes.h to silence compile errors This driver uses sizes.h, but relies on it being implicitly included somewhere else breaking random direct compilation of the file. Include sizes.h so we can build it those configurations too for better compile coverage. Signed-off-by: Stephen Boyd commit ed235d556945f46dbac84227f6f1467d397e39a3 Author: Fabio Estevam Date: Wed Jul 4 10:49:23 2018 -0300 clk: imx51-imx53: Annotate critical clocks as CLK_IS_CRITICAL Instead of explicitly enabling critical clocks via clk_prepare_enable(), let's use the standard CLK_IS_CRITICAL flag instead, which makes the code a bit shorter. Signed-off-by: Fabio Estevam Signed-off-by: Stephen Boyd commit 9d8108f9f3cb996a9677223fcd1feeb1f3e05566 Author: Anson Huang Date: Fri Jun 22 14:32:33 2018 +0800 clk: imx6sll: add GPIO LPCGs According to Reference Manual Rev.0, 06/2017, there are GPIO LPCGs defined in CCM CCGRs, add them into clock tree. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit cd88259a7215e0737f8ef2c2842f41922ae87d8d Author: Lei YU Date: Tue Jun 26 09:55:25 2018 +0800 clk: aspeed: Fix SDCLK name The SDCLK was named SDCLKCLK, and no one has used this yet. Fix it. Signed-off-by: Lei YU Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 4d94f95d30c8fbfe86068e9abed110974d697cf5 Author: Jaganath Kanakkassery Date: Fri Jul 6 22:50:32 2018 +0200 Bluetooth: Use extended LE Connection if supported This implements extended LE craete connection and enhanced LE conn complete event if the controller supports. For now it is as good as legacy LE connection and event as no new features in the extended connection is handled. < HCI Command: LE Extended Create Connection (0x08|0x0043) plen 26 Filter policy: White list is not used (0x00) Own address type: Public (0x00) Peer address type: Random (0x01) Peer address: DB:7E:2E:1D:85:E8 (Static) Initiating PHYs: 0x01 Entry 0: LE 1M Scan interval: 60.000 msec (0x0060) Scan window: 60.000 msec (0x0060) Min connection interval: 50.00 msec (0x0028) Max connection interval: 70.00 msec (0x0038) Connection latency: 0 (0x0000) Supervision timeout: 420 msec (0x002a) Min connection length: 0.000 msec (0x0000) Max connection length: 0.000 msec (0x0000) > HCI Event: Command Status (0x0f) plen 4 LE Extended Create Connection (0x08|0x0043) ncmd 2 Status: Success (0x00) > HCI Event: LE Meta Event (0x3e) plen 31 LE Enhanced Connection Complete (0x0a) Status: Success (0x00) Handle: 3585 Role: Master (0x00) Peer address type: Random (0x01) Peer address: DB:7E:2E:1D:85:E8 (Static) Local resolvable private address: 00:00:00:00:00:00 (Non-Resolvable) Peer resolvable private address: 00:00:00:00:00:00 (Non-Resolvable) Connection interval: 67.50 msec (0x0036) Connection latency: 0 (0x0000) Supervision timeout: 420 msec (0x002a) Master clock accuracy: 0x00 @ MGMT Event: Device Connected (0x000b) plen 40 LE Address: DB:7E:2E:1D:85:E8 (Static) Flags: 0x00000000 Data length: 27 Name (complete): Designer Mouse Appearance: Mouse (0x03c2) Flags: 0x05 LE Limited Discoverable Mode BR/EDR Not Supported 16-bit Service UUIDs (complete): 1 entry Human Interface Device (0x1812) Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit fc20654389364a55eeab837244b24f8da75009f6 Author: Robert Jarzmik Date: Wed Jun 27 21:41:23 2018 +0200 clk: pxa: export 32kHz PLL This clock is especially used by the RTC driver, so export it so that devicetree users can use it. Signed-off-by: Robert Jarzmik Signed-off-by: Stephen Boyd commit d12fb05643f9b48134c7650f5a03f9729aacfde4 Author: Jaganath Kanakkassery Date: Fri Jul 6 17:05:30 2018 +0530 Bluetooth: Introduce helpers for le conn status and complete This is done so that the helpers can be used for extended conn implementation which will be done in subsequent patch. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 33f5104624b96c6514621e63909b5703276b4dac Author: Daniel Mack Date: Fri Jul 6 20:53:03 2018 +0200 clk: Add driver for MAX9485 This patch adds a driver for MAX9485, a programmable audio clock generator. The device requires a 27.000 MHz clock input. It can provide a gated buffered output of its input clock and two gated outputs of a PLL that can generate one out of 16 discrete frequencies. There is only one PLL however, so the two gated outputs will always have the same frequency but they can be switched individually. The driver for this device exposes 4 clocks in total: - MAX9485_MCLKOUT: A gated, buffered output of the input clock - MAX9485_CLKOUT: A PLL that can be configured to 16 different discrete frequencies - MAX9485_CLKOUT[1,2]: Two gated outputs for MAX9485_CLKOUT Some PLL output frequencies can be achieved with different register settings. The driver will select the one with lowest jitter in such cases. Signed-off-by: Daniel Mack [sboyd@kernel.org: Use local variable for val in max9485_clkout_recalc_rate() and shorten line of max9485_of_clk_get()] Signed-off-by: Stephen Boyd commit c215e9397b00b3045a668120ed7dbd89f2866e74 Author: Jaganath Kanakkassery Date: Fri Jul 6 17:05:29 2018 +0530 Bluetooth: Process extended ADV report event This patch enables Extended ADV report event if extended scanning is supported in the controller and process the same. The new features are not handled and for now its as good as legacy ADV report. > HCI Event: LE Meta Event (0x3e) plen 53 LE Extended Advertising Report (0x0d) Num reports: 1 Entry 0 Event type: 0x0013 Props: 0x0013 Connectable Scannable Use legacy advertising PDUs Data status: Complete Legacy PDU Type: ADV_IND (0x0013) Address type: Random (0x01) Address: DB:7E:2E:1A:85:E8 (Static) Primary PHY: LE 1M Secondary PHY: LE 1M SID: 0x00 TX power: 0 dBm RSSI: -90 dBm (0xa6) Periodic advertising invteral: 0.00 msec (0x0000) Direct address type: Public (0x00) Direct address: 00:00:00:00:00:00 (OUI 00-00-00) Data length: 0x1b 0f 09 44 65 73 69 67 6e 65 72 20 4d 6f 75 73 65 ..Designer Mouse 03 19 c2 03 02 01 05 03 03 12 18 ........... Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit a2344b9e3a8c5c2064306b0d99b0e9a6c4813c08 Author: Jaganath Kanakkassery Date: Fri Jul 6 17:05:28 2018 +0530 Bluetooth: Use extended scanning if controller supports This implements Set extended scan param and set extended scan enable commands and use it for start LE scan based on controller support. The new features added in these commands are setting of new PHY for scanning and setting of scan duration. Both features are disabled for now, meaning only 1M PHY is set and scan duration is set to 0 which means that scanning will be done untill scan disable is called. < HCI Command: LE Set Extended Scan Parameters (0x08|0x0041) plen 8 Own address type: Random (0x01) Filter policy: Accept all advertisement (0x00) PHYs: 0x01 Entry 0: LE 1M Type: Active (0x01) Interval: 11.250 msec (0x0012) Window: 11.250 msec (0x0012) > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Scan Parameters (0x08|0x0041) ncmd 1 Status: Success (0x00) < HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6 Extended scan: Enabled (0x01) Filter duplicates: Enabled (0x01) Duration: 0 msec (0x0000) Period: 0.00 sec (0x0000) > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Scan Enable (0x08|0x0042) ncmd 2 Status: Success (0x00) Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 3baef810462746cd5a085c1e1416829d2af2622d Author: Jaganath Kanakkassery Date: Fri Jul 6 17:05:27 2018 +0530 Bluetooth: Introduce helpers for LE set scan start and complete Introduce a helper hci_req_start_scan() which starts an LE scan and call it from passive_Scan() and active_scan(). There is not functionality change in this patch. This is basically done to enable extended scanning if the controller supports which will be done in the subsequent patch Signed-off-by: Jaganath Kanakkassery Signed-off-by: Marcel Holtmann commit 3a32497f0dbe170794e1506deb41dc44c4fea8d9 Author: Chris Wilson Date: Fri Jul 6 18:49:26 2018 +0100 drm/i915/selftests: Provide full mb() around clflush clflush is an unserialised instruction and the IA manual strongly advises you to serialise it with a mb. To be cautious, apply one before and one after, so that it is serialised with both writes and reads without worrying too much about the required direction. Signed-off-by: Chris Wilson Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180706174926.4712-1-chris@chris-wilson.co.uk commit 2b555a4b9caecfcab1b2aade176df795ceceaefa Author: Paul Cercueil Date: Wed Jun 27 14:14:59 2018 +0200 clk: ingenic: Add missing flag for UDC clock The UDC clock of the JZ4740 SoC can be gated, but the data structure representing it was missing the CGU_CLK_GATE flag to make it work. Signed-off-by: Paul Cercueil Signed-off-by: Stephen Boyd commit 574f4e80d59e5c669c0729718525df8bac5e4d78 Author: Paul Cercueil Date: Wed Jun 27 14:14:58 2018 +0200 clk: ingenic: Fix incorrect data for the i2s clock The register field for configuring the divider for the i2s clock occupies the bits [8-0], which means 9 bits and not 8. Signed-off-by: Paul Cercueil Signed-off-by: Stephen Boyd commit 18df02fb79cb20ba4de1e02e1df41ba83f8b9bec Author: Daniel Mack Date: Sun Jun 17 14:05:34 2018 +0200 dts: clk: add devicetree bindings for MAX9485 This patch adds the devicetree bindings for MAX9485, a programmable audio clock generator. Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 9b07b287aa3ef49695bfad59c1870cd942f579a8 Author: Deepak Rawat Date: Wed Jun 20 15:09:43 2018 -0700 drm/vmwgfx: Expose SM4_1 param to user space A new param DRM_VMW_PARAM_SM4_1, is added for user space to determine availability of SM4.1. Minor version bump for SM4.1. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Brian Paul Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit f9261b30d92f3835891648041ce8699b1fb9a694 Author: Deepak Rawat Date: Wed Jun 20 15:24:05 2018 -0700 drm/vmwgfx: Add support for multisampling Support for SVGA3D_SURFACE_MULTISAMPLE and surface mob size according to sample count. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Brian Paul Reviewed-by: Thomas Hellstrom Reviewed-by: Charmaine Lee Signed-off-by: Thomas Hellstrom commit 14b1c33e84295693c3b1a1d7c6ac82b3f384cd17 Author: Deepak Rawat Date: Wed Jun 20 14:48:35 2018 -0700 drm/vmwgfx: Add new ioctl for GB surface create and reference New ioctls DRM_VMW_GB_SURFACE_CREATE_EXT and DRM_VMW_GB_SURFACE_REF_EXT are added which support 64-bit wide svga device surface flags, quality level and multisample pattern. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Brian Paul Reviewed-by: Thomas Hellstrom Reviewed-by: Charmaine Lee Signed-off-by: Thomas Hellstrom commit 397a11175f830e1ceb82b608a1c7adbacfbe39b0 Author: Deepak Rawat Date: Wed Jun 20 14:25:07 2018 -0700 drm/vmwgfx: Support for SVGA3dSurfaceAllFlags in vmwgfx Since svga device introduced new 64bit SVGA3dSurfaceAllFlags, vmwgfx now stores the surface flags internally as SVGA3dSurfaceAllFlags. For legacy surface define commands, only lower 32-bit is used. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Brian Paul Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit cdff8e73006c05ee342dd588b5ba90b5def56184 Author: Deepak Rawat Date: Wed Jun 20 14:20:23 2018 -0700 drm/vmwgfx: Add support for SVGA3dCmdDefineGBSurface_v3 SVGA device added new command SVGA3dCmdDefineGBSurface_v3 which allows 64-bit SVGA3dSurfaceAllFlags. This commit adds support for SVGA3dCmdDefineGBSurface_v3 command in vmwgfx. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Brian Paul Reviewed-by: Thomas Hellstrom Reviewed-by: Charmaine Lee Signed-off-by: Thomas Hellstrom commit 30aeee6728abf29b29d625061782519a15be88db Author: Deepak Rawat Date: Wed Jun 20 13:52:32 2018 -0700 drm/vmwgfx: Add SM4_1 flag A boolean flag in device private structure to specify if the device support SM4_1. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Brian Paul Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit 0d81d346a6281c59595a34a035c470e54f403cab Author: Neha Bhende Date: Mon Jun 18 17:14:56 2018 -0700 drm/vmwgfx: Add support for SVGA3dCmdIntraSurfaceCopy command A new command to support Intra-Surface-Copy. Signed-off-by: Neha Bhende Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit 3b4c2511c004521efa89875512b5039a04d5e2e0 Author: Neha Bhende Date: Mon Jun 18 16:44:48 2018 -0700 drm/vmwgfx: Add CAP2 support in vmwgfx The device exposes a new capability register. Add support for it. Signed-off-by: Neha Bhende Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit 96e4ea8c253d12079db4d7174990455b4bbf0c87 Author: Codrin Ciubotariu Date: Mon Jun 18 17:12:36 2018 +0300 clk: at91: add I2S clock mux driver This driver is a simple muxing driver that controls the I2S's clock input by using syscon/regmap to change the parent. The available inputs can be peripheral clock and generated clock. Signed-off-by: Codrin Ciubotariu [sboyd@kernel.org: Fix SPDX tag comment style] Signed-off-by: Stephen Boyd commit 5f273c0d9facfea124f6dea9de41775085056cc2 Author: Codrin Ciubotariu Date: Mon Jun 18 17:12:35 2018 +0300 dt-bindings: clk: at91: add an I2S mux clock The I2S mux clock can be used to select the I2S input clock. The available parents are the peripheral and the generated clocks. Signed-off-by: Codrin Ciubotariu Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 51b9a379a843c288b07b501784a5cc52b2c5aa69 Author: Dinh Nguyen Date: Tue Jun 26 08:28:10 2018 -0500 clk: socfpga: stratix10: fix the sdmmc_free_clk mux The first parent of the sdmmc_free_clk should be the main_sdmmc_clk. Signed-off-by: Dinh Nguyen Signed-off-by: Stephen Boyd commit 2772ffd979baa1893c1fa75041c59b507716dcc7 Author: Dinh Nguyen Date: Tue Jun 26 08:28:09 2018 -0500 clk: socfpga: stratix10: fix the parents of mpu_free_clk Add a clock mux that is used as a parent for the mpu_free_clk. Signed-off-by: Dinh Nguyen Signed-off-by: Stephen Boyd commit 964e3717e4987b17c585d29ce366702dbc74bbf1 Merge: ce397d215ccd 4c3d88526eba Author: Stephen Boyd Date: Fri Jul 6 10:58:51 2018 -0700 Merge tag 'clk-renesas-for-v4.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull Renesas clk driver updates for v4.19 from Geert Uytterhoeven: - Add support for Crypto Engine clocks on R-Car H3 - Add support for the new RZ/N1D SoC * tag 'clk-renesas-for-v4.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: Renesas R9A06G032 clock driver dt-bindings: clock: renesas,r9a06g032-sysctrl: documentation dt-bindings: clock: Add the r9a06g032-sysctrl.h file clk: renesas: r8a7795: Add CCREE clock clk: renesas: r8a7795: Add CR clock commit fe8e81b7e899968690e5e87c25727178921b5b9a Author: Stefan Popa Date: Wed Apr 11 18:09:42 2018 +0300 adp5061: New driver for ADP5061 I2C battery charger This patch adds basic support for Analog Devices I2C programmable linear battery charger. With this driver, some parameters can be read and configured such as: * trickle charge current level (PRECHARGE_CURRENT) * trickle charge voltage threshold (VOLTAGE_MIN) * weak charge threshold (VOLTAGE_AVG) * constant current (CONSTANT_CHARGE_CURRENT) * constant charge voltage limit (CONSTANT_CHARGE_VOLTAGE_MAX) * battery full (CAPACITY_LEVEL) * input current limit (INPUT_CURRENT_LIMIT) * charger status (STATUS) * battery status (CAPACITY_LEVEL) * termination current (CHARGE_TERM_CURRENT) Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/ADP5061.pdf Signed-off-by: Stefan Popa Signed-off-by: Sebastian Reichel commit f917ff75ac55b6d829c9d1142e83913064565d5b Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:40 2018 +0200 clk: davinci: psc-da830: add a lookup entry for aemif clock We want to use the ti-aemif platform driver for da830-evm. To make it work we need a lookup entry for the aemif clock. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner Signed-off-by: David Lechner commit b910f74a03fb87b5838216612a1c3da445148ce6 Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:39 2018 +0200 clk: davinci: psc-dm646x: use two lookup entries for the aemif clock We want to be able to get the clock both from the board file by its con_id and from the aemif driver by dev_id. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner Signed-off-by: David Lechner commit 8d1a83faa6d3f9c5ffb2a844bc6da6631e177245 Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:38 2018 +0200 clk: davinci: psc-dm644x: use two lookup entries for the aemif clock We want to be able to get the clock both from the board file by its con_id and from the aemif driver by dev_id. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner Signed-off-by: David Lechner commit 63521abc150752b26f3e347ed5809541b5a14aed Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:37 2018 +0200 clk: davinci: psc-dm365: use two lookup entries for the aemif clock We want to be able to get the clock both from the board file by its con_id and from the aemif driver by dev_id. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner Signed-off-by: David Lechner commit a82c02e5b8ec55bfa31218ef26c78b7d88afa97b Author: Bartosz Golaszewski Date: Thu Jun 28 11:57:36 2018 +0200 clk: davinci: psc-da850: remove the 'davinci_nand.0" lookup Since commit a8e3923ab571 ("mtd: rawnand: davinci: don't acquire and enable clock") we no longer acquire the aemif clock from the davinci nand driver - we only do it from the ti-aemif driver. Remove the nand entry from the psc lookup table. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner Signed-off-by: David Lechner commit 8b293eb53a7d7605f762351918083a4e402dc784 Author: Chris Wilson Date: Fri Jul 6 13:31:57 2018 +0100 drm/i915: Track the last-active inside the i915_vma Using a VMA on more than one timeline concurrently is the exception rather than the rule (using it concurrently on multiple engines). As we expect to only use one active tracker, store the most recently used tracker inside the i915_vma itself and only fallback to the rbtree if we need a second or more concurrent active trackers. v2: Comments on how we overwrite any existing last_active cache. v3: __list_del_entry() before list_replace_init() is confusing and, much more important, entirely redundant. v4: Note that both last_active and the rbtree may be simultaneously tracking this timeline, albeit with different requests, and so the vma may be retired twice for the same timeline. v5: No, that list_del is required! Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180706123157.9645-1-chris@chris-wilson.co.uk commit 5c3f8c221c77ccdce3c2a8b96d196e5f4e2dac0c Author: Chris Wilson Date: Fri Jul 6 11:39:46 2018 +0100 drm/i915: Track vma activity per fence.context, not per engine In the next patch, we will want to be able to use more flexible request timelines that can hop between engines. From the vma pov, we can then not rely on the binding of this request to an engine and so can not ensure that different requests are ordered through a per-engine timeline, and so we must track activity of all timelines. (We track activity on the vma itself to prevent unbinding from HW before the HW has finished accessing it.) v2: Switch to a rbtree for 32b safety (since using u64 as a radixtree index is fraught with aliasing of unsigned longs). v3: s/lookup_active/active_instance/ because we can never agree on names Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180706103947.15919-5-chris@chris-wilson.co.uk commit e6bb1d7f1adfcd24ac7d82ab157a8b8809a0d2c8 Author: Chris Wilson Date: Fri Jul 6 11:39:45 2018 +0100 drm/i915: Move i915_vma_move_to_active() to i915_vma.c i915_vma_move_to_active() has grown beyond its execbuf origins, and should take its rightful place in i915_vma.c as a method for i915_vma! Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180706103947.15919-4-chris@chris-wilson.co.uk commit a523697857cdfb6a548f6caf38f42f4fe0f7d757 Author: Chris Wilson Date: Fri Jul 6 11:39:44 2018 +0100 drm/i915: Start returning an error from i915_vma_move_to_active() Handling such a late error in request construction is tricky, but to accommodate future patches which may allocate here, we potentially could err. To handle the error after already adjusting global state to track the new request, we must finish and submit the request. But we don't want to use the request as not everything is being tracked by it, so we opt to cancel the commands inside the request. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180706103947.15919-3-chris@chris-wilson.co.uk commit 6dd7526f6f6c73961eecec8a4b9b717d414010f8 Author: Chris Wilson Date: Fri Jul 6 11:39:43 2018 +0100 drm/i915: Export i915_request_skip() In the next patch, we will want to start skipping requests on failing to complete their payloads. So export the utility function current used to make requests inoperable following a failed gpu reset. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180706103947.15919-2-chris@chris-wilson.co.uk commit da99fe5f858525b0eac5a5296bba5d6bedb81abd Author: Chris Wilson Date: Fri Jul 6 11:39:42 2018 +0100 drm/i915: Refactor export_fence() after i915_vma_move_to_active() Currently all callers are responsible for adding the vma to the active timeline and then exporting its fence. Combine the two operations into i915_vma_move_to_active() to move all the extra handling from the callers to the single site. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180706103947.15919-1-chris@chris-wilson.co.uk commit 243229b11121fbc90d9ee875292dfc75ecf53040 Author: Elaine Zhang Date: Fri Jun 15 10:16:51 2018 +0800 clk: rockchip: add clock controller for px30 Add the clock tree definition for the new px30 SoC. Signed-off-by: Elaine Zhang Signed-off-by: Heiko Stuebner commit 956060a52795a060833e8de2d1bb89209e61bed2 Author: Elaine Zhang Date: Fri Jun 15 10:16:50 2018 +0800 clk: rockchip: add support for half divider The new Rockchip socs have optional half divider: The formula is shown as: freq_out = 2*freq_in / (2*div + 3) Is this the same for all of new SoCs. So we use "branch_half_divider" + "COMPOSITE_NOMUX_HALFDIV \ DIV_HALF \ COMPOSITE_HALFDIV \ CMPOSITE_NOGATE_HALFDIV" to hook that special divider clock-type into our clock-tree. Signed-off-by: Elaine Zhang Signed-off-by: Heiko Stuebner commit a427503edaaed9b75ed9746a654cece7e93e60a8 Author: H. Nikolaus Schaller Date: Tue Jun 26 15:28:30 2018 +0200 power: generic-adc-battery: check for duplicate properties copied from iio channels If an iio channel defines a basic property, there are duplicate entries in /sys/class/power/*/uevent. So add a check to avoid duplicates. Since all channels may be duplicates, we have to modify the related error check. Signed-off-by: H. Nikolaus Schaller Cc: stable@vger.kernel.org Fixes: e60fea794e6e ("power: battery: Generic battery driver using IIO") Signed-off-by: Sebastian Reichel commit cc9aec03e58fea4dbab04c05d1e15852f801ca53 Author: Dan Williams Date: Fri Jul 6 09:08:06 2018 -0700 x86/numa_emulation: Introduce uniform split capability The current NUMA emulation capabilities for splitting System RAM by a fixed size or by a set number of nodes may result in some nodes being larger than others. The implementation prioritizes establishing a minimum usable memory size over satisfying the requested number of NUMA nodes. Introduce a uniform split capability that evenly partitions each physical NUMA node into N emulated nodes. For example numa=fake=3U creates 6 emulated nodes total on a system that has 2 physical nodes. This capability is useful for debugging and evaluating platform memory-side-cache capabilities as described by the ACPI HMAT (see 5.2.27.5 Memory Side Cache Information Structure in ACPI 6.2a) Compare numa=fake=6 that results in only 5 nodes being created against numa=fake=3U which takes the 2 physical nodes and evenly divides them. numa=fake=6 available: 5 nodes (0-4) node 0 cpus: 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 node 0 size: 2648 MB node 0 free: 2443 MB node 1 cpus: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 node 1 size: 2672 MB node 1 free: 2442 MB node 2 cpus: 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 node 2 size: 5291 MB node 2 free: 5278 MB node 3 cpus: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 node 3 size: 2677 MB node 3 free: 2665 MB node 4 cpus: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 node 4 size: 2676 MB node 4 free: 2663 MB node distances: node 0 1 2 3 4 0: 10 20 10 20 20 1: 20 10 20 10 10 2: 10 20 10 20 20 3: 20 10 20 10 10 4: 20 10 20 10 10 numa=fake=3U available: 6 nodes (0-5) node 0 cpus: 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 node 0 size: 2900 MB node 0 free: 2637 MB node 1 cpus: 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 node 1 size: 3023 MB node 1 free: 3012 MB node 2 cpus: 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 node 2 size: 2015 MB node 2 free: 2004 MB node 3 cpus: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 node 3 size: 2704 MB node 3 free: 2522 MB node 4 cpus: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 node 4 size: 2709 MB node 4 free: 2698 MB node 5 cpus: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 node 5 size: 2612 MB node 5 free: 2601 MB node distances: node 0 1 2 3 4 5 0: 10 10 10 20 20 20 1: 10 10 10 20 20 20 2: 10 10 10 20 20 20 3: 20 20 20 10 10 10 4: 20 20 20 10 10 10 5: 20 20 20 10 10 10 Signed-off-by: Dan Williams Cc: David Rientjes Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Wei Yang Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/153089328617.27680.14930758266174305832.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Ingo Molnar commit 3b6c62f363a19ce82bf378187ab97c9dc01e3927 Author: Dan Williams Date: Fri Jul 6 09:08:01 2018 -0700 x86/numa_emulation: Fix emulated-to-physical node mapping Without this change the distance table calculation for emulated nodes may use the wrong numa node and report an incorrect distance. Signed-off-by: Dan Williams Cc: David Rientjes Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Wei Yang Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/153089328103.27680.14778434392225818887.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Ingo Molnar commit 990c10091db318c7eb7e8935c86b6f7c01585015 Author: Arnd Bergmann Date: Fri Jul 6 09:47:51 2018 -0700 soc: ti: wkup_m3_ipc: mark PM functions as __maybe_unused Everyone gets these #ifdefs wrong, leading to another warning here: drivers/soc/ti/wkup_m3_ipc.c:547:12: error: 'wkup_m3_ipc_resume' defined but not used [-Werror=unused-function] static int wkup_m3_ipc_resume(struct device *dev) drivers/soc/ti/wkup_m3_ipc.c:539:12: error: 'wkup_m3_ipc_suspend' defined but not used [-Werror=unused-function] static int wkup_m3_ipc_suspend(struct device *dev) The easiest way to get it right is to remove all the #ifdefs and let the compiler drop the unused functions silently after we mark them as __maybe_unused. Fixes: 7a872b6fb7fd ("soc: ti: wkup_m3_ipc: Add rtc_only with ddr in self refresh mode support") Signed-off-by: Arnd Bergmann Signed-off-by: Santosh Shilimkar commit 932d47448c3caa0fa99e84d7f5bc302aa286efd8 Author: H. Nikolaus Schaller Date: Tue Jun 26 15:28:29 2018 +0200 power: generic-adc-battery: fix out-of-bounds write when copying channel properties We did have sporadic problems in the pinctrl framework during boot where a pin group name unexpectedly became NULL leading to a NULL dereference in strcmp. Detailled analysis of the failing cases did reveal that there were two devm allocated objects close to each other. The second one was the affected group_desc in pinmux and the first one was the psy_desc->properties buffer of the gab driver. Review of the gab code showed that the address calculation for one memcpy() is wrong. It does properties + sizeof(type) * index but C is defined to do the index multiplication already for pointer + integer additions. Hence the factor was applied twice and the memcpy() does write outside of the properties buffer. Sometimes it happened to be the pinctrl and triggered the strcmp(NULL). Anyways, it is overkill to use a memcpy() here instead of a simple assignment, which is easier to read and has less risk for wrong address calculations. So we change code to a simple assignment. If we initialize the index to the first free location, we can even remove the local variable 'properties'. This bug seems to exist right from the beginning in 3.7-rc1 in commit e60fea794e6e ("power: battery: Generic battery driver using IIO") Signed-off-by: H. Nikolaus Schaller Cc: stable@vger.kernel.org Fixes: e60fea794e6e ("power: battery: Generic battery driver using IIO") Signed-off-by: Sebastian Reichel commit e22e953189f7b3a3bfc7efb511d2b1d1454adde5 Merge: a012024571d9 4da1d4c751c9 Author: Gustavo Padovan Date: Fri Jul 6 13:34:13 2018 -0300 Merge drm-upstream/drm-next into drm-misc-next Pull in the malidp writeback implementation for further work on writeback in drm-misc-next. Signed-off-by: Gustavo Padovan commit 8fdbfd8686329e286465bcef11a7ef20be84d6b6 Author: Chris Wilson Date: Fri Jul 6 15:23:23 2018 +0100 drm/i915/selftests: Fixup missing MI_MEM_VIRTUAL for live_hangcheck We always want to use a virtual address (i.e. use the GTT) for MI_STORE_DWORD_IMM, but forgot the ever so important flag in live_hangcheck for gen3. Signed-off-by: Chris Wilson Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180706142323.25699-2-chris@chris-wilson.co.uk commit 5b544337109081ac4de23e7ded1c31f7457e5f5e Author: Chris Wilson Date: Fri Jul 6 15:23:22 2018 +0100 drm/i915/selftests: Replace magic 1<<22 with MI_USE_GGTT/MI_MEM_VIRTUAL Replace the magic bit with the proper symbolic name for instructing MI_STORE_DWORD_IMM to use a virtual address (on gen3) or the global GTT address (still virtual!) on gen4+. Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180706142323.25699-1-chris@chris-wilson.co.uk Reviewed-by: Ville Syrjälä commit 663336ee2628096df0ce2b546b148cb74b5249fe Author: Joe Perches Date: Wed May 9 08:15:46 2018 -0700 device: Add #define dev_fmt similar to #define pr_fmt Add a prefixing macro to dev_ uses similar to the pr_fmt prefixing macro used in pr_ calls. This can help avoid some string duplication in dev_ uses. The default, like pr_fmt, is an empty #define dev_fmt(fmt) fmt Rename the existing dev_ functions to _dev_ and introduce #define dev_ _dev_ macros that use the new #define dev_fmt Miscellanea: o Consistently use #defines with fmt, ... and ##__VA_ARGS__ o Remove unnecessary externs Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman commit 207b700050b8d323d0c23b457c200b22c7ed3737 Author: Chris Wilson Date: Fri Jul 6 13:53:38 2018 +0100 drm/i915/selftests: Limit live_gtt allocation test to fit within RAM Limit the GTT size we try and allocate to ensure that it fits within RAM and does not trigger the oomkiller indiscriminately. Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706125338.24432-1-chris@chris-wilson.co.uk commit 4031e6ca35993fd5818d2ddf3ced5351b1d46c36 Author: John Whitmore Date: Wed Jul 4 15:20:56 2018 +0100 staging: rtl8192u: Add space after ', ' character - Coding Style checkpatch requires a space after ',' - Added. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 60ecbaae5e3ba21a43ebf6b83de10d5aa34a85eb Author: John Whitmore Date: Wed Jul 4 15:20:55 2018 +0100 staging: rtl8192u: Add required space around '=' operator - Style checkpatch requires spaces around '=' operator so added. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit e19532885f52c9ea2f3eea4ebfa309287ce1ecdf Author: John Whitmore Date: Wed Jul 4 15:20:54 2018 +0100 staging: rtl8192u: Remove space after cast - Coding Style According to checkpatch - No space is necessary after a cast. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit bb81b8241fbfe8356b5f1c9d641fb45f81a76bc3 Author: John Whitmore Date: Wed Jul 4 15:20:53 2018 +0100 staging: rtl8192u: Add required spaces around '||' operator - Sytle Additon of the coding style required spaces around the '||' operator. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5d22905819bc56292f10e0f3b63c201caad97aed Author: John Whitmore Date: Wed Jul 4 15:20:52 2018 +0100 staging: rtl8192u: Add space required around '==' opeartor - Style Simple addition of the coding style required spaces around '==' operator. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5e540f8acb302cf5a7ac4ea6687c822f5c18d2d1 Author: John Whitmore Date: Wed Jul 4 15:20:51 2018 +0100 staging: rtl8192u: Remove superfluous blank lines - Coding Style Removal of extra blank lines from the ieee80211_softmac.c file Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 15d7e53e66b7e92c19d0f9231595e22d14a63fe5 Author: John Whitmore Date: Wed Jul 4 15:20:50 2018 +0100 staging: rtl8192u: Remove redundant definitions in header Truncated header file removing definitions which aren't used. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 868e346c1c5c4b0dac7765b63a85f986dba15a49 Author: John Whitmore Date: Wed Jul 4 15:20:49 2018 +0100 staging: rtl8192u: Use memset to initialize memory, instead of loop. Replaced memory initialising loop with memset instead. Suggested-by: Andy Shevchenko Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c336f8325ff03afecc51631ead0f7dfc1ac6e0c5 Author: John Whitmore Date: Wed Jul 4 12:59:21 2018 +0100 staging: rtl8192u: Use __func__ instead of hardcoded string - Style Changed logging statements to use %s and __func__ instead of hard coding the function name in a string. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit ad515954f634b69847d54c1c4c2eb0de1834a489 Author: Michael Straube Date: Wed Jul 4 13:37:41 2018 +0200 staging: rtl8188eu: rename Hal8188ERateAdaptive Rename header and source file to avoid CamelCase. Hal8188ERateAdaptive.h -> hal8188e_rate_adaptive.h Hal8188ERateAdaptive.c -> hal8188e_rate_adaptive.c Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 89778d0d6c2a198b01df44ba20222e4da5442910 Author: Michael Straube Date: Wed Jul 4 13:37:40 2018 +0200 staging: rtl8188eu: rename Hal8188EPhyReg.h Rename header file to avoid CamelCase. Hal8188EPhyReg.h -> hal8188e_phy_reg.h Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 4d31db586090dd88ef74b4c8891ac981d971df46 Author: Michael Straube Date: Wed Jul 4 13:37:39 2018 +0200 staging: rtl8188eu: rename Hal8188EPhyCfg.h Rename header file to avoid CamelCase. Hal8188EPhyCfg.h -> hal8188e_phy_cfg.h Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit de63831a21e944c66f8b4165451f7159fdff7b20 Author: Michael Straube Date: Fri Jul 6 16:56:01 2018 +0200 staging: rtl8723bs: remove rtl8192c_rf.h All functions declared in rtl8192c_rf.h have no definition/are not used in any other file/anywhere. Checked with 'git grep '. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 15c3381e3abba34c8634575305db1e414e587e3b Author: Ajay Singh Date: Thu Jul 5 14:52:35 2018 +0530 staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit() Fix for static checker warning inconsistent returns of 'hif_deinit_lock'(more details [1]). "drivers/staging/wilc1000/host_interface.c:3390 wilc_deinit() warn: inconsistent returns 'hif_deinit_lock'." Fixes: ff52a57a7a42 ("staging: wilc1000: move the allocation of cmd out of wilc_enqueue_cmd()") [1]. https://www.spinics.net/lists/linux-driver-devel/msg114216.html Reported-by: Dan Carpenter Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 9b227cb1cf28464144fe4054f0c0fadf471649cb Author: Michael Straube Date: Mon Jul 2 21:35:07 2018 +0200 staging: rtl8188eu: remove rtw_mp_phy_regdef.h The header rtw_mp_phy_regdef.h is not used anywhere. 'git grep rtw_mp_phy_regdef.h' returns nothing, remove the file. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 8602ffc65887d558198b742920f5569ec3a6a1a8 Author: Razvan Stefanescu Date: Wed Jul 4 11:17:44 2018 +0300 staging: fsl-dpaa2/ethsw: Update maintainers for Ethernet Switch driver Removing myself as the maintainer for this driver and adding Ioana R. and Ioana C. Signed-off-by: Razvan Stefanescu Acked-by: Ioana Radulescu Acked-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman commit c5fae4f4fd28189b1062fb8ef7b21fec37cb8b17 Author: Colin Ian King Date: Mon Jul 2 14:27:35 2018 +0100 staging: rts5208: fix missing error check on call to rtsx_write_register Currently the check on error return from the call to rtsx_write_register is checking the error status from the previous call. Fix this by adding in the missing assignment of retval. Detected by CoverityScan, CID#709877 Fixes: fa590c222fba ("staging: rts5208: add support for rts5208 and rts5288") Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit c37a192ef442fc34e9aa7c9e479f20eb4cd6f7af Author: Dan Carpenter Date: Fri Jul 6 11:39:21 2018 +0300 Staging: Gasket: shift wrapping bug in gasket_read_modify_write_64() This function only has one caller so mask_width is 1 and mask_shift is 32. Shifting an int by 32 bits is undefined, but I guess on GCC it wraps to 0x1? Anyway it's supposed to be 0x100000000. Fixes: 9a69f5087ccc ("drivers/staging: Gasket driver framework + Apex driver") Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 7cc6dfd076e84359a96a851c41ac8dc696565a3f Author: Dan Carpenter Date: Fri Jul 6 11:38:25 2018 +0300 Staging: Gasket: fix a couple off by one bugs The > should be >= or we end up writing one element beyond the end of the interrupt_data->eventfd_ctxs[] array. Fixes: 9a69f5087ccc ("drivers/staging: Gasket driver framework + Apex driver") Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 97b23455ccd53a632585d0fd06ff9d30877c810a Author: Dan Carpenter Date: Fri Jul 6 11:37:56 2018 +0300 Staging: Gasket: uninitialized return in gasket_mmap() We forgot to set the error code on this error path so ret can be uninitialized. Fixes: 9a69f5087ccc ("drivers/staging: Gasket driver framework + Apex driver") Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 9f2378d94d0f026389fff351848f2adc484650fe Author: Kees Cook Date: Wed Jul 4 10:31:25 2018 -0700 drivers/staging/gasket: Use 2-factor allocator calls As already done treewide, switch from open-coded multiplication to using 2-factor allocator helpers. Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman commit 7383f87de80694f1f4c21b81b964d42a54144cfb Author: Sergio Paracuellos Date: Thu Jun 28 21:03:09 2018 +0200 staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver We don't really need initialization of this at such an early stage. Just use builtin_platform_driver to initialize this driver. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit b595818682bd7160266015555ea773296312c0e9 Author: Sergio Paracuellos Date: Thu Jun 28 21:03:08 2018 +0200 staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback The debug information provided by this function does not make sense at all, so just remove it. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 74ee97cc05110a8421fe554506309fe071103654 Author: Sergio Paracuellos Date: Thu Jun 28 21:03:07 2018 +0200 staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name Trivial change to have only one return in 'rt2880_get_group_name' function using a ternary operator instead of an if statement and two returns. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit e12a1a6e087b9803befc6e9ab47734716c3e20e2 Author: Sergio Paracuellos Date: Thu Jun 28 21:03:06 2018 +0200 staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function Using 'function' and 'group' bindings in the device tree give the posibility of refactor 'rt2880_pinctrl_dt_node_to_map' and simplify it a lot. Make use of 'for_each_node_with_property' function to count number of groups for the node and iterate over the groups using 'of_property_for_each_string' calling 'pinctrl_utils_add_map_mux' function which is the same of the custom function in this driver code 'rt2880_pinctrl_dt_subnode_to_map' which is not needed anymore. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit d7461eab5a04e8426dc5ddcbf7911903d22b69f4 Author: Sergio Paracuellos Date: Thu Jun 28 21:03:05 2018 +0200 staging: mt7621-dts: use 'function' and 'group' for pinctrl bindings According to documentation 'pinctrl-bindings.txt' bindings 'group' and 'function' can be used directly. So replace all of them. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 62b6215c11eade6938d3d25e18a3682ed3dfcb91 Author: Sergio Paracuellos Date: Thu Jun 28 21:03:04 2018 +0200 staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map Function rt2880_pinctrl_dt_node_to_map was using 'kzalloc' to reserve map memory. There is a 'pinctrl_utils_reserve_map' to do this function. Just use it. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 4a1cf86bce6782a44c4a6c96e6e036e590099012 Author: Sergio Paracuellos Date: Thu Jun 28 21:03:03 2018 +0200 staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field Struct 'rt2880_priv' contains a field 'gpio' which is defined as uint8_t and should be defined with 'u8' which is preferred. Update some cast along the code related with this new change. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 39a30ef33f99d4c685dd202be01c15ea496c7282 Author: Sergio Paracuellos Date: Thu Jun 28 21:03:02 2018 +0200 staging: mt7621-pinctrl: make use of pinctrl_utils_free_map There was a custom 'rt2880_pinctrl_dt_free_map' function which it was doing the same as pinctrl_utils_free_map defined in 'pinctrl-utils.h' header file. Use it instead avoiding code duplications. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit a2a678b6972ce59dcffefd5d0a86bff07e67a9a2 Author: Sergio Paracuellos Date: Thu Jun 28 21:03:01 2018 +0200 staging: mt7621-pinctrl: use tabs instead of spaces in some indentations Kernel coding style use tabs for indent code instead of spaces. Fix some places where spaces were being used silencing also checkpatch script complains. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit d756d387d4f4e8701ac195772a5b29efa717d19e Author: Sergio Paracuellos Date: Thu Jun 28 21:03:00 2018 +0200 staging: mt7621-pinctrl: align function parameters in some functions Function parameters along the code has different alignment styles. Just unify all of them making style consistent. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit e5d66a1815a22a33af2619402f1d9afe40d0001a Author: Sergio Paracuellos Date: Thu Jun 28 21:02:59 2018 +0200 staging: mt7621-pinctrl: replace seq_printf with seq_puts For a constant format without additional arguments, use seq_puts() instead of seq_printf() fixing also the following checkpatch.pl warning: 'Prefer seq_puts to seq_printf' Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit c60cf7e034d3868562f32e8e0458da32ba704b93 Author: Sergio Paracuellos Date: Thu Jun 28 21:02:58 2018 +0200 staging: mt7621-pinctrl: avoid lines over 80 chars This commit silence checkpatch warnings about lines which exceeds 80 chars. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit f4da9b1ed66fa6a97d20fa3a93f2a83097c7717c Author: Sergio Paracuellos Date: Thu Jun 28 21:02:57 2018 +0200 staging: mt7621-pinctrl: avoid space after if condition Adding spaces between if condition and parenthesis are not needed at all and checkpatch script complains about them. Fix one in driver code. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit b3cd051dc3a84fffe5ff1a896a6b6c7a33a96fe6 Author: Sergej Perschin Date: Thu Jul 5 14:41:01 2018 +0200 staging: mt7621-mmc: Fix printk() facility level The patch fixes the following issue: WARNING: printk() should include KERN_ facility level Signed-off-by: Sergej Perschin Signed-off-by: Marcel Budoj Signed-off-by: Greg Kroah-Hartman commit ff19ad29d257f7b3ff738054f9040606998cc114 Author: Sergio Paracuellos Date: Thu Jul 5 08:00:29 2018 +0200 staging: mt7621-gpio: use devm_kasprintf to set gpio banks labels Instead of using a custom function to return desired name for gpio use the default assigned one and concat it '-bankN' suffix using devm_kasprintf kernel function. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 24186ccda251c8880de0e77ce3bb28a4066763b2 Author: Sergio Paracuellos Date: Thu Jul 5 08:00:28 2018 +0200 staging: mt7621-gpio: assign gpio chip custom changes after bgpio_init bgpio_init function set different data of the gpio chip, like the name. We want specific name for each bank so to get that not overwritten move all custom changes after the bgpio_init function call. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit cf229037c57d0e7ff4846ba304ba5a4ae2f7aee4 Author: Sergio Paracuellos Date: Thu Jul 5 08:00:27 2018 +0200 staging: mt7621-gpio: use custom xlate function The default gpio.of_xlate function assumes there is one gpio chip for each devicetree node. Device tree had changed to only use one node, which corresponds to 3 different gpio chips now. For that approach to work we need a custom xlate function. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit de7d179377356b7eb8912e29d72e92df7f919ca5 Author: Sergio Paracuellos Date: Thu Jul 5 08:00:26 2018 +0200 staging: mt7621-gpio: set irq chip name only once There is only one irq chip so set its name only once in driver probe function. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit bedbeec65c6cdec25aab609d557b630c97f81866 Author: Will Deacon Date: Fri Jul 6 16:21:17 2018 +0100 arm64: mm: Export __flush_icache_range() to modules lkdtm calls flush_icache_range(), which results in an out-of-line call to __flush_icache_range(), which is not exported to modules. Export the symbol to modules to fix this build breakage. Fixes: 3b8c9f1cdfc5 ("arm64: IPI each CPU after invalidating the I-cache for kernel mappings") Signed-off-by: Will Deacon commit f2a42595f0865886a2d40524b0e9d15600848670 Author: Hans de Goede Date: Wed May 23 15:33:21 2018 +0200 power: supply: axp288_charger: Fix initial constant_charge_current value We should look at val which contains the value read from the register, not ret which is always 0 on a successful read. Signed-off-by: Hans de Goede Fixes: eac53b3664f59 ("power: supply: axp288_charger: Drop platform_data dependency") Signed-off-by: Sebastian Reichel commit 66daec6b21840ea09af4c41f706867df7d81c820 Author: Chris Wilson Date: Fri Jul 6 13:26:11 2018 +0100 drm/i915/gtt: Control cache domain of dma_map_page() directly We already maually control the CPU cache for our page table directories, so we can tell the dma mapper to skip doing it as well. Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706122611.4142-2-chris@chris-wilson.co.uk commit 58174eac1593f104c03a15330e0fea1b1ec01434 Author: Chris Wilson Date: Fri Jul 6 13:26:10 2018 +0100 drm/i915/gtt: Suppress warnings for dma_map_page As we propagate back the error to the caller for them to handle, we do not need the lowest level spitting out a redundant warning upon an allocation failure inside dma_map_page(). Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706122611.4142-1-chris@chris-wilson.co.uk commit 8b0d62d49aea991016d1a2e072e6af0a813b4a2d Author: Arnd Bergmann Date: Mon Jun 18 16:23:29 2018 +0200 power: supply: ab8500: stop using getnstimeofday64() getnstimeofday64() is deprecated in favor of the ktime_get() family. The direct replacement would be ktime_get_real_ts64(), but we only need the seconds value, and it seems better to use boottime than real time to avoid unexpected behavior with a concurrent settimeofday(). ktime_get_seconds() might also work, but it seems better to use boottime than monotonic time since I assume that the charging process continues during suspend. Signed-off-by: Arnd Bergmann Acked-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 0a50f61c4fbd7840cdaf783c312e42b8ccde9ab3 Author: Todd Poynor Date: Wed Jun 20 17:35:56 2018 -0700 drivers: base: initcall_debug logs for driver probe times Add initcall_debug logs for each driver device probe call, for example: probe of a3800000.ramoops returned 1 after 3007 usecs This replaces the previous code added to report times for deferred probes. It also reports OF platform bus device creates that were formerly lumped together in a single entry for function of_platform_default_populate_init, as well as helping to annotate other initcalls that involve device probing. Remove restriction on printing probe times only during initcalls, since initcall_debug now continues to show driver timing info past the boot phase. Signed-off-by: Todd Poynor Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 36cb055f1bcfd10e4565867a696ff688d9de3cf4 Author: Johan Hovold Date: Wed Jul 4 08:46:26 2018 +0200 dt-bindings: vendor-prefixes: fix bad merge Remove the vendor-prefix reject file which was accidentally added when merging the gnss sirfstar binding. The wi2wi prefix had already been added by commit a593bff82cae2 ("dt-bindings: define vendor prefix for Wi2Wi, Inc."). Fixes: 176193b7dd6e ("dt-bindings: gnss: add sirfstar binding") Reported-by: Andrew Morton Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit d5b9653dd2bb7a2b1c8cc783c5d3b607bbb6b271 Author: Johan Hovold Date: Tue Jul 3 12:05:48 2018 +0200 misc: sram: enable clock before registering regions Make sure to enable the clock before registering regions and exporting partitions to user space at which point we must be prepared for I/O. Fixes: ee895ccdf776 ("misc: sram: fix enabled clock leak on error path") Signed-off-by: Johan Hovold Reviewed-by: Vladimir Zapolskiy Signed-off-by: Greg Kroah-Hartman commit f294d00961d1d869ecffa60e280eeeee1ccf9a49 Author: Johan Hovold Date: Tue Jul 3 12:05:47 2018 +0200 misc: sram: fix resource leaks in probe error path Make sure to disable clocks and deregister any exported partitions before returning on late probe errors. Note that since commit ee895ccdf776 ("misc: sram: fix enabled clock leak on error path"), partitions are deliberately exported before enabling the clock so we stick to that logic here. A follow up patch will address this. Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support") Cc: stable # 4.9 Cc: Alexandre Belloni Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 447735fafe5f8779f07091f5d30cca6a44c0c1fd Author: Mars Cheng Date: Wed Jul 4 09:52:53 2018 +0800 dt-bindings: interrupt-controller: add binding for mt6765 Update the dt-binding documentation of sysirq for mt6765 Signed-off-by: Mars Cheng Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit eb3c74c27d059234c58e40caefa3d64cbf998a45 Author: Mars Cheng Date: Wed Jul 4 09:52:52 2018 +0800 dt-bindings: mtk-uart: add mt6765 uart bindings Add documentation for mt6765 uart dt-bindings Signed-off-by: Mars Cheng Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 2867443e3b6b35a0b8fafabe9090fa8c35f690e7 Author: Mars Cheng Date: Wed Jul 4 09:52:51 2018 +0800 dt-bindings: mediatek: add support for mt6765 reference board Update binding document for mt6765 reference board Signed-off-by: Mars Cheng Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 6101be86cb1c46d1c6da969a5e22c7efc0de6f46 Author: Jisheng Zhang Date: Wed Jul 4 17:00:40 2018 +0800 serial: 8250: let serial8250_get_divisor() get uart_port * as param Align serial8250_get_divisor() with serial8250_set_divisor() to accept uart_port pointer as the first parameter. No functionality changes. Signed-off-by: Jisheng Zhang Reviewed-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit 6eefc68d1bbe28feb6cdfbd49648a713446bdc00 Author: Geert Uytterhoeven Date: Fri Jul 6 11:05:43 2018 +0200 serial: sh-sci: Stop using deprecated dmaengine_terminate_all() As of commit b36f09c3c441a6e5 ("dmaengine: Add transfer termination synchronization support"), dmaengine_terminate_all() is deprecated. Replace calls to dmaengine_terminate_all() in DMA release code by calls to dmaengine_terminate_sync(), as the latter waits until all running completion callbacks have finished. Replace calls to dmaengine_terminate_all() in DMA failure paths by calls to dmaengine_terminate_async(), as these are usually done in atomic context. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit f661131766e45bc0b3c8b85b19676a470dc75abf Author: Geert Uytterhoeven Date: Fri Jul 6 11:05:42 2018 +0200 serial: sh-sci: Stop TX DMA workqueue during port shutdown The transmit DMA workqueue is never stopped, hence the work function may be called after the port has been shut down. Fix this race condition by cancelling queued work, if any, before DMA release. Don't initialize the work if DMA initialization failed, as it won't be used anyway. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit 2c4ee23530ffc022dc22d2fd4b0eb039c6b4c5e9 Author: Geert Uytterhoeven Date: Fri Jul 6 11:05:41 2018 +0200 serial: sh-sci: Postpone DMA release when falling back to PIO When the sh-sci driver detects an issue with DMA during operation, it falls backs to PIO, and releases all DMA resources. As releasing DMA resources immediately has no advantages, but complicates the code, and is susceptible to races, it is better to postpone this to port shutdown. This allows to remove the locking from sci_rx_dma_release() and sci_tx_dma_release(), but requires keeping a copy of the DMA channel pointers for release during port shutdown. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit c5a9262fa8bfed0dddc7466ef10fcd292e2af61b Author: Geert Uytterhoeven Date: Fri Jul 6 11:08:36 2018 +0200 serial: sh-sci: Stop RX FIFO timer during port shutdown The RX FIFO timer may be armed when the port is shut down, hence the timer function may still be called afterwards. Fix this race condition by deleting the timer during port shutdown. Fixes: 039403765e5da3c6 ("serial: sh-sci: SCIFA/B RX FIFO software timeout") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman commit 5f9810730cf4c0315f30e2fa0daf273fb2d3cadb Author: Yoshihiro Shimoda Date: Tue Jul 3 19:46:58 2018 +0900 usb: host: xhci-rcar: Add a condition check about PLL active This patch adds a condition check about the PLL acvice of this controller. Otherwise, the controller might cause hang when any USB clocks are not supplied yet and accesses the xHCI registers. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Greg Kroah-Hartman commit ed8603e11124ea2f5626e29d09680afcac71a9bb Author: Yoshihiro Shimoda Date: Tue Jul 3 19:46:57 2018 +0900 usb: host: xhci-rcar: Simplify getting the firmware name for R-Car Gen3 This patch simplifies getting the firmware name for R-Car Gen3. Almost all R-Car Gen3 USB3.0 Host controllers use "V3". But, r8a7795 ES1.x SoCs only should use "V2". Since the xhci-plat already has the firmware_name of R-Car Gen3 as "V3", the xhci-rcar doesn't need some members of rcar_quirks_match. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Greg Kroah-Hartman commit fc72aa83b4a7c84cc032649380641fe5300a7c4c Author: Yoshihiro Shimoda Date: Tue Jul 3 19:46:56 2018 +0900 usb: host: xhci-plat: add firmware_name for R-Car Gen3 To clean up the xhci-rcar.c code later, this patch adds firmware_name "V3" for R-Car Gen3. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Greg Kroah-Hartman commit 8160eac1213fb6d466dee156638647a71da7d7fb Author: Arnd Bergmann Date: Fri Jul 6 15:28:32 2018 +0200 usb: typec: avoid format-overflow warning gcc-8 points out that the fix-byte buffer might be too small if desc->mode is a three-digit number: drivers/usb/typec/class.c: In function 'typec_register_altmode': drivers/usb/typec/class.c:502:32: error: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Werror=format-overflow=] sprintf(alt->group_name, "mode%d", desc->mode); ^~ drivers/usb/typec/class.c:502:27: note: directive argument in the range [0, 255] sprintf(alt->group_name, "mode%d", desc->mode); ^~~~~~~~ drivers/usb/typec/class.c:502:2: note: 'sprintf' output between 6 and 8 bytes into a destination of size 6 sprintf(alt->group_name, "mode%d", desc->mode); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I assume this cannot happen in practice, but we can simply make the string long enough to avoid the warning. This uses the two padding bytes that already exist after the string. Fixes: 4ab8c18d4d67 ("usb: typec: Register a device for every mode") Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 98a1a0c7a321a46e805df289c7d385a9b1b4c661 Author: Colin Ian King Date: Thu Jul 5 14:36:47 2018 +0100 usb: typec: unlock dp->lock on error exit path, and also zero ret if successful One of the error handling paths forgets to unlock dp->lock on the error exit path leading to a potential lock-up. Also the return path for a successful call to the function configuration_store can return an uninitialized error return code if dp->alt->active is false, so ensure ret is zeroed on the successful exit path to avoid garbage being returned. Detected by CoverityScan, CID#1471597 ("Unitialized scalar variable") Fixes: 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode") Signed-off-by: Colin Ian King Acked-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 11b71782c1d10d9bccc31825cf84291cd7588a1e Author: Anton Vasilyev Date: Fri Jul 6 15:32:53 2018 +0300 uwb: hwa-rc: fix memory leak at probe hwarc_probe() allocates memory for hwarc, but does not free it if uwb_rc_add() or hwarc_get_version() fail. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Greg Kroah-Hartman commit 9920184d78edeccd165832d54d6203fae4c860f5 Author: Colin Ian King Date: Wed Jul 4 13:34:06 2018 +0100 usb: typec: fix dereference before null check on adev Pointer adev is being dereferenced before it is being sanity checked with a null pointer check, hence it is possible for a null pointer dereference to occur. Fix this by dereferencing adev only once it is null checked. Detected by CoverityScan, CID#1471598 ("Dereference before null check") Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes") Signed-off-by: Colin Ian King Acked-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 6f3fde684d0232e66ada3410f016a58e09a87689 Author: Sebastian Andrzej Siewior Date: Sun Jul 1 17:35:44 2018 +0200 usb: usbtest: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Acked-by: Alan Stern Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit ada1de89f34ea338fb4406e61dc1a95edcf65213 Author: Linus Walleij Date: Mon Jun 18 00:58:19 2018 +0200 power: gemini-poweroff: Avoid more spurious poweroffs Even after the previous fix I have experienced more spurious poweroffs on the gemini SoC. After this fix it finally seems to go away. Fixes: f7a388d6cd1c ("power: reset: Add a driver for the Gemini poweroff") Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 09bebb1adb21ecd04adf7ccb3b06f73e3a851e93 Author: Sudeep Holla Date: Mon Jun 18 16:54:32 2018 +0100 power: vexpress: fix corruption in notifier registration Vexpress platforms provide two different restart handlers: SYS_REBOOT that restart the entire system, while DB_RESET only restarts the daughter board containing the CPU. DB_RESET is overridden by SYS_REBOOT if it exists. notifier_chain_register used in register_restart_handler by design relies on notifiers to be registered once only, however vexpress restart notifier can get registered twice. When this happen it corrupts list of notifiers, as result some notifiers can be not called on proper event, traverse on list can be cycled forever, and second unregister can access already freed memory. So far, since this was the only restart handler in the system, no issue was observed even if the same notifier was registered twice. However commit 6c5c0d48b686 ("watchdog: sp805: add restart handler") added support for SP805 restart handlers and since the system under test contains two vexpress restart and two SP805 watchdog instances, it was observed that during the boot traversing the restart handler list looped forever as there's a cycle in that list resulting in boot hang. This patch fixes the issues by ensuring that the notifier is installed only once. Cc: Sebastian Reichel Signed-off-by: Sudeep Holla Fixes: 46c99ac66222 ("power/reset: vexpress: Register with kernel restart handler") Signed-off-by: Sebastian Reichel commit 7efe25a70c37395b41b034335345d6855926c2a6 Author: Corentin Labbe Date: Thu Jun 7 19:44:56 2018 +0000 iommu/shmobile: Remove unused include/linux/platform_data/sh_ipmmu.h header include/linux/platform_data/sh_ipmmu.h is unused since commit ae50dc4874c5 ("iommu/shmobile: Remove unused Renesas IPMMU/IPMMUI") Let's remove it. Signed-off-by: Corentin Labbe Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Joerg Roedel commit 3ffa6583e24e1ad1abab836d24bfc9d2308074e5 Author: Benjamin Tissoires Date: Mon Jun 25 09:51:48 2018 +0200 power: remove possible deadlock when unregistering power_supply If a device gets removed right after having registered a power_supply node, we might enter in a deadlock between the remove call (that has a lock on the parent device) and the deferred register work. Allow the deferred register work to exit without taking the lock when we are in the remove state. Stack trace on a Ubuntu 16.04: [16072.109121] INFO: task kworker/u16:2:1180 blocked for more than 120 seconds. [16072.109127] Not tainted 4.13.0-41-generic #46~16.04.1-Ubuntu [16072.109129] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [16072.109132] kworker/u16:2 D 0 1180 2 0x80000000 [16072.109142] Workqueue: events_power_efficient power_supply_deferred_register_work [16072.109144] Call Trace: [16072.109152] __schedule+0x3d6/0x8b0 [16072.109155] schedule+0x36/0x80 [16072.109158] schedule_preempt_disabled+0xe/0x10 [16072.109161] __mutex_lock.isra.2+0x2ab/0x4e0 [16072.109166] __mutex_lock_slowpath+0x13/0x20 [16072.109168] ? __mutex_lock_slowpath+0x13/0x20 [16072.109171] mutex_lock+0x2f/0x40 [16072.109174] power_supply_deferred_register_work+0x2b/0x50 [16072.109179] process_one_work+0x15b/0x410 [16072.109182] worker_thread+0x4b/0x460 [16072.109186] kthread+0x10c/0x140 [16072.109189] ? process_one_work+0x410/0x410 [16072.109191] ? kthread_create_on_node+0x70/0x70 [16072.109194] ret_from_fork+0x35/0x40 [16072.109199] INFO: task test:2257 blocked for more than 120 seconds. [16072.109202] Not tainted 4.13.0-41-generic #46~16.04.1-Ubuntu [16072.109204] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [16072.109206] test D 0 2257 2256 0x00000004 [16072.109208] Call Trace: [16072.109211] __schedule+0x3d6/0x8b0 [16072.109215] schedule+0x36/0x80 [16072.109218] schedule_timeout+0x1f3/0x360 [16072.109221] ? check_preempt_curr+0x5a/0xa0 [16072.109224] ? ttwu_do_wakeup+0x1e/0x150 [16072.109227] wait_for_completion+0xb4/0x140 [16072.109230] ? wait_for_completion+0xb4/0x140 [16072.109233] ? wake_up_q+0x70/0x70 [16072.109236] flush_work+0x129/0x1e0 [16072.109240] ? worker_detach_from_pool+0xb0/0xb0 [16072.109243] __cancel_work_timer+0x10f/0x190 [16072.109247] ? device_del+0x264/0x310 [16072.109250] ? __wake_up+0x44/0x50 [16072.109253] cancel_delayed_work_sync+0x13/0x20 [16072.109257] power_supply_unregister+0x37/0xb0 [16072.109260] devm_power_supply_release+0x11/0x20 [16072.109263] release_nodes+0x110/0x200 [16072.109266] devres_release_group+0x7c/0xb0 [16072.109274] wacom_remove+0xc2/0x110 [wacom] [16072.109279] hid_device_remove+0x6e/0xd0 [hid] [16072.109284] device_release_driver_internal+0x158/0x210 [16072.109288] device_release_driver+0x12/0x20 [16072.109291] bus_remove_device+0xec/0x160 [16072.109293] device_del+0x1de/0x310 [16072.109298] hid_destroy_device+0x27/0x60 [hid] [16072.109303] usbhid_disconnect+0x51/0x70 [usbhid] [16072.109308] usb_unbind_interface+0x77/0x270 [16072.109311] device_release_driver_internal+0x158/0x210 [16072.109315] device_release_driver+0x12/0x20 [16072.109318] usb_driver_release_interface+0x77/0x80 [16072.109321] proc_ioctl+0x20f/0x250 [16072.109325] usbdev_do_ioctl+0x57f/0x1140 [16072.109327] ? __wake_up+0x44/0x50 [16072.109331] usbdev_ioctl+0xe/0x20 [16072.109336] do_vfs_ioctl+0xa4/0x600 [16072.109339] ? vfs_write+0x15a/0x1b0 [16072.109343] SyS_ioctl+0x79/0x90 [16072.109347] entry_SYSCALL_64_fastpath+0x24/0xab [16072.109349] RIP: 0033:0x7f20da807f47 [16072.109351] RSP: 002b:00007ffc422ae398 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [16072.109353] RAX: ffffffffffffffda RBX: 00000000010b8560 RCX: 00007f20da807f47 [16072.109355] RDX: 00007ffc422ae3a0 RSI: 00000000c0105512 RDI: 0000000000000009 [16072.109356] RBP: 0000000000000000 R08: 00007ffc422ae3e0 R09: 0000000000000010 [16072.109357] R10: 00000000000000a6 R11: 0000000000000246 R12: 0000000000000000 [16072.109359] R13: 00000000010b8560 R14: 00007ffc422ae2e0 R15: 0000000000000000 Reported-and-tested-by: Richard Hughes Tested-by: Aaron Skomra Signed-off-by: Benjamin Tissoires Fixes: 7f1a57fdd6cb ("power_supply: Fix possible NULL pointer dereference on early uevent") Signed-off-by: Sebastian Reichel commit e6a578e2890dcedf1b5722d5bead9cad2e0d9195 Author: Vinod Koul Date: Thu Jun 28 20:38:46 2018 +0530 power: reset: qcom-pon: Add Qcom PON driver Add support Qualcomm PM8xxx PON which is responsible for reboot mode support. Co-developed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Sebastian Reichel commit ad0e95347962479d4ed2dc63171b06b95420f9e8 Author: Vinod Koul Date: Thu Jun 28 20:38:45 2018 +0530 dt-bindings: power: reset: Add qcom pon binding The Power On device for Qcom PM 8xxx is a MFD supporting pwrkey and resin along with the Android reboot-mode. Add the binding describing this. Suggested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson Signed-off-by: Vinod Koul Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit add00e6d896fab882e6115ed4908b2456f1b3a85 Author: Chris Wilson Date: Fri Jul 6 12:54:02 2018 +0100 drm/i915: Flush the WCB following a WC write If we have just completed a WC write, we must ensure that the WCB (Write Combining Buffer) is flushed out to main memory before we can expect to see the results. This is especially important when mixing WC with GTT as the physical paths are different and cachelines are not naturally flushed. Testcase: igt/drv_selftests/live_coherency #gdg Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180706115402.18547-1-chris@chris-wilson.co.uk commit 03bbc508a312d9f4833f1cb0f7b2da7517787b61 Author: Chris Wilson Date: Fri Jul 6 12:45:10 2018 +0100 drm/i915/selftests: Skip live_execlists if the GPU is terminally wedged If the GPU is irrecoverably wedged, we can not execute any requests making testing execlists (request execution) pointless. Skip! Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706114510.18467-1-chris@chris-wilson.co.uk commit 0fdbe58c4a0f8c2fa67e38a740ce6ff3cffa8c86 Author: Chris Wilson Date: Fri Jul 6 11:19:23 2018 +0100 drm/i915/selftests: Skip live context execution test without logical contexts If the HW (or driver) doesn't support logical contexts, don't pretend we gain anything from trying to execute GPU commands with them. At best it reports -ENODEV, which is an unhelpful failure that we should just skip. v2: Be more specific and check the driver/engine caps for logical (HW) context support. Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706101923.28548-1-chris@chris-wilson.co.uk commit 481827b441674b7f1d030c223decdb56266ff398 Author: Chris Wilson Date: Fri Jul 6 11:14:41 2018 +0100 drm/i915: Record logical context support in driver caps Avoid looking at the magical engines[RCS] to decide if the HW and driver supports logical contexts, and instead record that knowledge during initialisation. Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706101442.21279-1-chris@chris-wilson.co.uk commit d64c5cf8e89d124355924c513a42b16f0d7d3a03 Author: Liam Girdwood Date: Fri Jul 6 13:50:36 2018 +0100 ALSA: pcm: Allow drivers to set R/W wait time. Currently ALSA core blocks userspace for about 10 seconds for PCM R/W IO. This needs to be configurable for modern hardware like DSPs where no pointer update in milliseconds can indicate terminal DSP errors. Add a substream variable to set the wait time in ms. This allows userspace and drivers to recover more quickly from terminal DSP errors. Signed-off-by: Liam Girdwood Signed-off-by: Takashi Iwai commit a012024571d98e2e4bf29a9168fb7ddc44b7ab86 Author: Maarten Lankhorst Date: Wed Apr 18 14:51:21 2018 +0200 drm/crc: Only report a single overflow when a CRC fd is opened This reduces the amount of spam when you debug a CRC reading program. Signed-off-by: Maarten Lankhorst [mlankhorst: Change bool overflow to was_overflow (Ville)] Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180418125121.72081-1-maarten.lankhorst@linux.intel.com commit b79ebe74e1c4219e91940b637d40939b0c80c0f2 Author: Imre Deak Date: Thu Jul 5 15:26:54 2018 +0300 drm/i915/ddi: Simplify get_encoder_power_domains() We can simplify the encoder's get_power_domains() hook by calling it only if the encoder is active. That way the hook can return its power domains unconditionally without checking the active state by calling encoder::get_hw_state(). This get_hw_state() query is in fact redundant since it's already done by intel_modeset_readout_hw_state() setting the encoder's crtc or leaving it NULL accordingly. Let's use this fact to decide if the encoder is active. While at it clarify the comment in intel_ddi_get_power_domains() about primary vs. fake MST encoders and make sure we never do an incorrect encoder->dig_port cast for fake MST encoders. Suggested-by: Ville Syrjälä Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705122654.17072-1-imre.deak@intel.com commit 90fcffd9cf5e7cc593169f529799f3e3c5437e75 Author: Suravee Suthikulpanit Date: Wed Jun 27 10:31:22 2018 -0500 iommu/amd: Add support for IOMMU XT mode The AMD IOMMU XT mode enables interrupt remapping with 32-bit destination APIC ID, which is required for x2APIC. The feature is available when the XTSup bit is set in the IOMMU Extended Feature register and/or the IVHD Type 10h IOMMU Feature Reporting field. For more information, please see section "IOMMU x2APIC Support" of the AMD I/O Virtualization Technology (IOMMU) Specification. Cc: Joerg Roedel Signed-off-by: Suravee Suthikulpanit Signed-off-by: Joerg Roedel commit e881dbd5d4a6950c9e2e7623c79d9578949365c9 Author: Suravee Suthikulpanit Date: Wed Jun 27 10:31:21 2018 -0500 iommu/amd: Add support for higher 64-bit IOMMU Control Register Currently, the driver only supports lower 32-bit of IOMMU Control register. However, newer AMD IOMMU specification has extended this register to 64-bit. Therefore, replace the accessing API with the 64-bit version. Cc: Joerg Roedel Signed-off-by: Suravee Suthikulpanit Signed-off-by: Joerg Roedel commit 818b7587b4d34e989ea6c042eeb8d50ffa5be13e Author: Suravee Suthikulpanit Date: Wed Jun 27 10:31:20 2018 -0500 x86: irq_remapping: Move irq remapping mode enum The enum is currently defined in Intel-specific DMAR header file, but it is also used by APIC common code. Therefore, move it to a more appropriate interrupt-remapping common header file. This will also be used by subsequent patches. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Joerg Roedel Signed-off-by: Suravee Suthikulpanit Signed-off-by: Joerg Roedel commit 6cc42152b02b3f73969934b63332d47e2dac55e4 Author: Maarten Lankhorst Date: Thu Jun 28 09:23:02 2018 +0200 drm/i915: Remove support for legacy debugfs crc interface This interface is deprecated, and has been replaced by the upstream drm crc interface. Signed-off-by: Maarten Lankhorst Cc: Tomi Sarvela Cc: Petri Latvala Cc: Jani Nikula Cc: Ville Syrjälä Acked-by: Ville Syrjälä Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180628072303.14175-1-maarten.lankhorst@linux.intel.com commit 3e781fcafedb6d364f93caa44128d63e975daa6d Author: Lu Baolu Date: Tue Jun 19 10:49:19 2018 +0800 iommu/vt-d: Remove unnecessary WARN_ON() When drivers call intel_svm_available() to check whether the Shared Virtual Memory(SVM) is supported by the IOMMU driver, they will get a warning in the kernel message if the SVM is not supported by the hardware. [ 3.790876] WARNING: CPU: 0 PID: 267 at drivers/iommu/intel-svm.c:334 intel_svm_bind_mm+0x292/0x570 [ 3.790877] Modules linked in: dsa(+) vfio_mdev mdev vfio_iommu_type1 soundcore vfio serio_raw parport_pc ppdev lp parport autofs4 psmouse virtio_net pata_acpi [ 3.790884] CPU: 0 PID: 267 Comm: systemd-udevd Not tainted 4.15.0+ #358 [ 3.790885] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014 [ 3.790887] RIP: 0010:intel_svm_bind_mm+0x292/0x570 [ 3.790887] RSP: 0000:ffffac72c08a3a70 EFLAGS: 00010246 [ 3.790889] RAX: 0000000000000000 RBX: ffff90447a5160a0 RCX: 0000000000000000 [ 3.790889] RDX: 0000000000000000 RSI: 0000000000000082 RDI: ffff90447fc16550 [ 3.790890] RBP: ffff90447a516000 R08: 0000000000000000 R09: 0000000000000178 [ 3.790891] R10: 0000000000000220 R11: 0000000000aaaaaa R12: 0000000000000000 [ 3.790891] R13: 0000000000000002 R14: ffffac72c08a3b18 R15: ffffac72c08a3eb8 [ 3.790893] FS: 00007fb21e85b8c0(0000) GS:ffff90447fc00000(0000) knlGS:0000000000000000 [ 3.790894] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3.790894] CR2: 000055c08167d148 CR3: 000000013a6f4000 CR4: 00000000000006f0 [ 3.790903] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 3.790904] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 This is caused by a unnecessary WARN_ON() in intel_svm_bind_mm(). Hence, remove it. Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit e67ecf647020d31342d37e73c3766ae02434ed24 Author: Sudeep Holla Date: Fri Jul 6 12:02:48 2018 +0100 arm64: topology: re-introduce numa mask check for scheduler MC selection Commit 37c3ec2d810f ("arm64: topology: divorce MC scheduling domain from core_siblings") selected the smallest of LLC, socket siblings, and NUMA node siblings to ensure that the sched domain we build for the MC layer isn't larger than the DIE above it or it's shrunk to the socket or NUMA node if LLC exist acrosis NUMA node/chiplets. Commit acd32e52e4e0 ("arm64: topology: Avoid checking numa mask for scheduler MC selection") reverted the NUMA siblings checks since the CPU topology masks weren't updated on hotplug at that time. This patch re-introduces numa mask check as the CPU and NUMA topology is now updated in hotplug paths. Effectively, this patch does the partial revert of commit acd32e52e4e0. Cc: Catalin Marinas Cc: Will Deacon Tested-by: Ganapatrao Kulkarni Tested-by: Hanjun Guo Signed-off-by: Sudeep Holla Signed-off-by: Will Deacon commit f70ff1271378b12570aa3c4ebe2ad07f35a4ec51 Author: Sudeep Holla Date: Fri Jul 6 12:02:47 2018 +0100 arm64: topology: rename llc_siblings to align with other struct members Similar to core_sibling and thread_sibling, it's better to align and rename llc_siblings to llc_sibling. Cc: Catalin Marinas Cc: Will Deacon Tested-by: Ganapatrao Kulkarni Tested-by: Hanjun Guo Signed-off-by: Sudeep Holla Signed-off-by: Will Deacon commit 7f9545aa1a91a9a4dc8c3e1476dbbfa98dd38b81 Author: Sudeep Holla Date: Fri Jul 6 12:02:46 2018 +0100 arm64: smp: remove cpu and numa topology information when hotplugging out CPU We already repopulate the information on CPU hotplug-in, so we can safely remove the CPU topology and NUMA cpumap information during CPU hotplug out operation. This will help to provide the correct cpumask for scheduler domains. Cc: Catalin Marinas Cc: Will Deacon Tested-by: Ganapatrao Kulkarni Tested-by: Hanjun Guo Signed-off-by: Sudeep Holla Signed-off-by: Will Deacon commit 5ec8b59172b4e8d26a12952ce3a2914b30128538 Author: Sudeep Holla Date: Fri Jul 6 12:02:45 2018 +0100 arm64: topology: restrict updating siblings_masks to online cpus only It's incorrect to iterate over all the possible CPUs to update the sibling masks when any CPU is hotplugged in. In case the topology siblings masks of the CPU is removed when is it hotplugged out, we end up updating those masks when one of it's sibling is powered up again. This will provide inconsistent view. Further, since the CPU calling update_sibling_masks is yet to be set online, there's no need to compare itself with each online CPU when updating the siblings masks. This patch restricts updation of sibling masks only for CPUs that are already online. It also the drops the unnecessary cpuid check. Cc: Catalin Marinas Cc: Will Deacon Tested-by: Ganapatrao Kulkarni Tested-by: Hanjun Guo Signed-off-by: Sudeep Holla Signed-off-by: Will Deacon commit 5bdd2b3f0f8830f281bb568e65df6eabf655dd0d Author: Sudeep Holla Date: Fri Jul 6 12:02:44 2018 +0100 arm64: topology: add support to remove cpu topology sibling masks This patch adds support to remove all the CPU topology information using clear_cpu_topology and also resetting the sibling information on other sibling CPUs. This will be used in cpu_disable so that all the topology sibling information is removed on CPU hotplug out. Cc: Catalin Marinas Cc: Will Deacon Tested-by: Ganapatrao Kulkarni Tested-by: Hanjun Guo Signed-off-by: Sudeep Holla Signed-off-by: Will Deacon commit 97fd6016a7b3df00901b4cfdd883eac01e89fa8a Author: Sudeep Holla Date: Fri Jul 6 12:02:43 2018 +0100 arm64: numa: separate out updates to percpu nodeid and NUMA node cpumap Currently numa_clear_node removes both cpu information from the NUMA node cpumap as well as the NUMA node id from the cpu. Similarly numa_store_cpu_info updates both percpu nodeid and NUMA cpumap. However we need to retain the numa node id for the cpu and only remove the cpu information from the numa node cpumap during CPU hotplug out. The same can be extended for hotplugging in the CPU. This patch separates out numa_{add,remove}_cpu from numa_clear_node and numa_store_cpu_info. Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Ganapatrao Kulkarni Tested-by: Ganapatrao Kulkarni Tested-by: Hanjun Guo Signed-off-by: Sudeep Holla Signed-off-by: Will Deacon commit 31b46035576d405ca9a98be95945986c91986368 Author: Sudeep Holla Date: Fri Jul 6 12:02:42 2018 +0100 arm64: topology: refactor reset_cpu_topology to add support for removing topology Currently reset_cpu_topology clears all the CPU topology information and resets to default values. However we may need to just clear the information when we hotplug out the CPU. In preparation to add the support the same, let's refactor reset_cpu_topology to just reset the information and move clearing out the topology information to clear_cpu_topology. Cc: Catalin Marinas Cc: Will Deacon Tested-by: Ganapatrao Kulkarni Tested-by: Hanjun Guo Signed-off-by: Sudeep Holla Signed-off-by: Will Deacon commit 178909a669584b97e9154375df2126fd93b6306c Author: Will Deacon Date: Fri Jul 6 09:57:45 2018 +0100 arm64: errata: Don't define type field twice for arm64_errata[] entries The ERRATA_MIDR_REV_RANGE macro assigns ARM64_CPUCAP_LOCAL_CPU_ERRATUM to the '.type' field of the 'struct arm64_cpu_capabilities', so there's no need to assign it explicitly as well. Signed-off-by: Will Deacon commit ec28bb9c9b0826d7bd36f44cccfa5295c291cadd Author: Chintan Pandya Date: Wed Jun 6 12:31:21 2018 +0530 arm64: Implement page table free interfaces arm64 requires break-before-make. Originally, before setting up new pmd/pud entry for huge mapping, in few cases, the modifying pmd/pud entry was still valid and pointing to next level page table as we only clear off leaf PTE in unmap leg. a) This was resulting into stale entry in TLBs (as few TLBs also cache intermediate mapping for performance reasons) b) Also, modifying pmd/pud was the only reference to next level page table and it was getting lost without freeing it. So, page leaks were happening. Implement pud_free_pmd_page() and pmd_free_pte_page() to enforce BBM and also free the leaking page tables. Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidation of TLB 3) Freeing of the un-used next level page tables Reviewed-by: Will Deacon Signed-off-by: Chintan Pandya Signed-off-by: Will Deacon commit 05f2d2f83b5a02a15b6538017f29ee53a73088fb Author: Chintan Pandya Date: Wed Jun 6 12:31:20 2018 +0530 arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable Add an interface to invalidate intermediate page tables from TLB for kernel. Acked-by: Will Deacon Signed-off-by: Chintan Pandya Signed-off-by: Will Deacon commit f3551520416978111b422b7c177f6f1f6d75ff62 Merge: 693350a79980 5e0fb5df2ee8 Author: Will Deacon Date: Fri Jul 6 13:15:06 2018 +0100 Merge branch 'x86/mm' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into aarch64/for-next/core Pull in core ioremap changes from -tip, since we depend on these for re-enabling huge I/O mappings on arm64. Signed-off-by: Will Deacon commit bc24f62bf8763660110f915cead86dd13840ed26 Author: Magnus Damm Date: Thu Jun 14 12:48:26 2018 +0200 iommu/ipmmu-vmsa: Document R-Car V3H and E3 IPMMU DT bindings Update the IPMMU DT binding documentation to include the compat strings for the IPMMU devices included in the R-Car V3H and E3 SoCs. Signed-off-by: Magnus Damm Reviewed-by: Simon Horman Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Signed-off-by: Joerg Roedel commit 98dbffd39a6513b9d0b60e9a20265b2d7866af3c Author: Jacopo Mondi Date: Thu Jun 14 12:48:25 2018 +0200 iommu/ipmmu-vmsa: Hook up R8A77965 DT matching code Add support for R-Car M3-N (R8A77965) SoC IPMMUs. Signed-off-by: Jacopo Mondi Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Joerg Roedel commit 3be6937a271a808e42ea785d1555e7df97b750e3 Author: Jacopo Mondi Date: Thu Jun 14 12:48:24 2018 +0200 dt-bindings: iommu/ipmmu-vmsa: Add R-Car M3-N (R8A77965) Add Renesas R-Car M3-N (R8A77965) compat string to IPMMU DT bindings documentation. Signed-off-by: Jacopo Mondi Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Joerg Roedel commit 3701c123e1c13cdf258e10b26df7ae4bef6a5a93 Author: Simon Horman Date: Thu Jun 14 12:48:23 2018 +0200 iommu/ipmmu-vmsa: Hook up r8a779(70|95) DT matching code Support the r8a77970 (R-Car V3M) and r8a77995 (R-Car D3) IPMMUs by sharing feature flags with r8a7795 (R-Car H3) and r8a7796 (R-Car M3-W). Also update IOMMU_OF_DECLARE to hook up the compat strings. Based on work for the r8a7796 by Magnus Damm [rebased on v4.17] Signed-off-by: Jacopo Mondi Signed-off-by: Simon Horman Reviewed-by: Geert Uytterhoeven Signed-off-by: Joerg Roedel commit 0b8ac1409641e18912e5fe0accd92a5f3e2d2581 Author: Magnus Damm Date: Thu Jun 14 12:48:22 2018 +0200 iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Support the r8a7796 IPMMU by sharing feature flags between r8a7795 and r8a7796. Also update IOMMU_OF_DECLARE to hook up the updated compat string. [rebased on v4.17] Signed-off-by: Jacopo Mondi Signed-off-by: Magnus Damm Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Joerg Roedel commit ddbbddd76a3fcec12fe59bb1b8b855842e1e7fe8 Author: Magnus Damm Date: Thu Jun 14 12:48:21 2018 +0200 iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 Bump up the maximum numbers of micro-TLBS to 48. Each IPMMU device instance get micro-TLB assignment via the "iommus" property in DT. Older SoCs tend to use a maximum number of 32 micro-TLBs per IPMMU instance however newer SoCs such as r8a7796 make use of up to 48 micro-TLBs. At this point no SoC specific handling is done to validate the maximum number of micro-TLBs, and because of that the DT information is assumed to be within correct range for each particular SoC. If needed in the future SoC specific feature flags can be added to handle the maximum number of micro-TLBs without requiring DT changes, however at this point this does not seem necessary. Signed-off-by: Magnus Damm Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Joerg Roedel commit c8e144f8ab00e6c4a070a932ef9c57db09aa41cf Author: Thomas Petazzoni Date: Fri Jun 29 11:16:20 2018 +0200 PCI: aardvark: Convert to use pci_host_probe() Part of advk_pcie_probe() is exactly an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly. Signed-off-by: Thomas Petazzoni [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi commit 91a2968e245d6ba616db37001fa1a043078b1a65 Author: Zachary Zhang Date: Fri Jun 29 11:16:19 2018 +0200 PCI: aardvark: Size bridges before resources allocation The PCIE I/O and MEM resource allocation mechanism is that root bus goes through the following steps: 1. Check PCI bridges' range and computes I/O and Mem base/limits. 2. Sort all subordinate devices I/O and MEM resource requirements and allocate the resources and writes/updates subordinate devices' requirements to PCI bridges I/O and Mem MEM/limits registers. Currently, PCI Aardvark driver only handles the second step and lacks the first step, so there is an I/O and MEM resource allocation failure when using a PCI switch. This commit fixes that by sizing bridges before doing the resource allocation. Fixes: 8c39d710363c1 ("PCI: aardvark: Add Aardvark PCI host controller driver") Signed-off-by: Zachary Zhang [Thomas: edit commit log.] Signed-off-by: Thomas Petazzoni Signed-off-by: Lorenzo Pieralisi Cc: commit 7d0f5fd3e4d687424cc2ab68b55472e328e2ee0a Author: Gary R Hook Date: Tue Jun 12 16:41:30 2018 -0500 iommu/amd: Add basic debugfs infrastructure for AMD IOMMU Implement a skeleton framework for debugfs support in the AMD IOMMU. Add an AMD-specific Kconfig boolean that depends upon general enablement of DebugFS in the IOMMU. Signed-off-by: Gary R Hook Signed-off-by: Joerg Roedel commit bad614b24293ae463e74d2465685f0e4e229baca Author: Gary R Hook Date: Tue Jun 12 16:41:21 2018 -0500 iommu: Enable debugfs exposure of IOMMU driver internals Provide base enablement for using debugfs to expose internal data of an IOMMU driver. When called, create the /sys/kernel/debug/iommu directory. Emit a strong warning at boot time to indicate that this feature is enabled. This function is called from iommu_init, and creates the initial DebugFS directory. Drivers may then call iommu_debugfs_new_driver_dir() to instantiate a device-specific directory to expose internal data. It will return a pointer to the new dentry structure created in /sys/kernel/debug/iommu, or NULL in the event of a failure. Since the IOMMU driver can not be removed from the running system, there is no need for an "off" function. Signed-off-by: Gary R Hook Signed-off-by: Joerg Roedel commit 379521462e4add27f3514da8e4ab1fd7a54fe1c7 Author: Niklas Cassel Date: Tue Jun 12 16:06:10 2018 +0200 iommu/msm: Don't call iommu_device_{,un}link from atomic context Fixes the following splat during boot: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:747 in_atomic(): 1, irqs_disabled(): 128, pid: 77, name: kworker/2:1 4 locks held by kworker/2:1/77: #0: (ptrval) ((wq_completion)"events"){+.+.}, at: process_one_work+0x1fc/0x8fc #1: (ptrval) (deferred_probe_work){+.+.}, at: process_one_work+0x1fc/0x8fc #2: (ptrval) (&dev->mutex){....}, at: __device_attach+0x40/0x178 #3: (ptrval) (msm_iommu_lock){....}, at: msm_iommu_add_device+0x28/0xcc irq event stamp: 348 hardirqs last enabled at (347): [] kfree+0xe0/0x3c0 hardirqs last disabled at (348): [] _raw_spin_lock_irqsave+0x2c/0x68 softirqs last enabled at (0): [] copy_process.part.5+0x280/0x1a68 softirqs last disabled at (0): [<00000000>] (null) Preemption disabled at: [<00000000>] (null) CPU: 2 PID: 77 Comm: kworker/2:1 Not tainted 4.17.0-rc5-wt-ath-01075-gaca0516bb4cf #239 Hardware name: Generic DT based system Workqueue: events deferred_probe_work_func [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0xa0/0xcc) [] (dump_stack) from [] (___might_sleep+0x1f8/0x2d4) ath10k_sdio mmc2:0001:1: Direct firmware load for ath10k/QCA9377/hw1.0/board-2.bin failed with error -2 [] (___might_sleep) from [] (__might_sleep+0x70/0xa8) [] (__might_sleep) from [] (__mutex_lock+0x50/0xb28) [] (__mutex_lock) from [] (mutex_lock_nested+0x2c/0x34) ath10k_sdio mmc2:0001:1: board_file api 1 bmi_id N/A crc32 544289f7 [] (mutex_lock_nested) from [] (kernfs_find_and_get_ns+0x30/0x5c) [] (kernfs_find_and_get_ns) from [] (sysfs_add_link_to_group+0x28/0x58) [] (sysfs_add_link_to_group) from [] (iommu_device_link+0x50/0xb4) [] (iommu_device_link) from [] (msm_iommu_add_device+0xa0/0xcc) [] (msm_iommu_add_device) from [] (add_iommu_group+0x3c/0x64) [] (add_iommu_group) from [] (bus_for_each_dev+0x84/0xc4) [] (bus_for_each_dev) from [] (bus_set_iommu+0xd0/0x10c) [] (bus_set_iommu) from [] (msm_iommu_probe+0x5b8/0x66c) [] (msm_iommu_probe) from [] (platform_drv_probe+0x60/0xbc) [] (platform_drv_probe) from [] (driver_probe_device+0x30c/0x4cc) [] (driver_probe_device) from [] (__device_attach_driver+0xac/0x14c) [] (__device_attach_driver) from [] (bus_for_each_drv+0x68/0xc8) [] (bus_for_each_drv) from [] (__device_attach+0xe4/0x178) [] (__device_attach) from [] (device_initial_probe+0x1c/0x20) [] (device_initial_probe) from [] (bus_probe_device+0x98/0xa0) [] (bus_probe_device) from [] (deferred_probe_work_func+0x74/0x198) [] (deferred_probe_work_func) from [] (process_one_work+0x2c4/0x8fc) [] (process_one_work) from [] (worker_thread+0x2c4/0x5cc) [] (worker_thread) from [] (kthread+0x180/0x188) [] (kthread) from [] (ret_from_fork+0x14/0x20) Fixes: 42df43b36163 ("iommu/msm: Make use of iommu_device_register interface") Signed-off-by: Niklas Cassel Reviewed-by: Vivek Gautam Signed-off-by: Joerg Roedel commit 1c48db44924298ad0cb5a6386b88017539be8822 Author: Jacob Pan Date: Thu Jun 7 09:57:00 2018 -0700 iommu/vt-d: Fix dev iotlb pfsid use PFSID should be used in the invalidation descriptor for flushing device IOTLBs on SRIOV VFs. Signed-off-by: Jacob Pan Cc: stable@vger.kernel.org Cc: "Ashok Raj" Cc: "Lu Baolu" Signed-off-by: Joerg Roedel commit 0f725561e168485eff7277d683405c05b192f537 Author: Jacob Pan Date: Thu Jun 7 09:56:59 2018 -0700 iommu/vt-d: Add definitions for PFSID When SRIOV VF device IOTLB is invalidated, we need to provide the PF source ID such that IOMMU hardware can gauge the depth of invalidation queue which is shared among VFs. This is needed when device invalidation throttle (DIT) capability is supported. This patch adds bit definitions for checking and tracking PFSID. Signed-off-by: Jacob Pan Cc: stable@vger.kernel.org Cc: "Ashok Raj" Cc: "Lu Baolu" Signed-off-by: Joerg Roedel commit 3c120143f584360a13614787e23ae2cdcb5e5ccd Author: Zhen Lei Date: Wed Jun 6 10:18:46 2018 +0800 iommu/amd: make sure TLB to be flushed before IOVA freed Although the mapping has already been removed in the page table, it maybe still exist in TLB. Suppose the freed IOVAs is reused by others before the flush operation completed, the new user can not correctly access to its meomory. Signed-off-by: Zhen Lei Fixes: b1516a14657a ('iommu/amd: Implement flush queue') Signed-off-by: Joerg Roedel commit 4674686d6c8974eb4eebec894c398a0f6c506af3 Author: yzhai003@ucr.edu Date: Fri Jun 1 11:30:14 2018 -0700 iommu/amd: Argument page_size could be uninitialized Argument "page_size" passing to function "fetch_pte" could be uninitialized if the function returns NULL The caller "iommu_unmap_page" checks the return value but the page_size is used outside the if block. Signed-off-by: yzhai003@ucr.edu Signed-off-by: Joerg Roedel commit 1b0707a781eeaeeaacb464e18bb3f049b99b496b Author: Corentin Labbe Date: Thu Jun 7 19:50:38 2018 +0000 Bluetooth: remove unused bt-nokia-h4p.h header Nothing in tree use this header which seems a remains of a staging driver. This patch remove it. Signed-off-by: Corentin Labbe Reviewed-by: Sebastian Reichel Signed-off-by: Marcel Holtmann commit 545f2596b907f0747170c7cb71edc74cecf68c5c Author: Ankit Navik Date: Fri Jun 29 12:13:20 2018 +0530 Bluetooth: Add HCI command for clear Resolv list Check for Resolv list supported by controller. So check the supported commmand first before issuing this command i.e.,HCI_OP_LE_CLEAR_RESOLV_LIST Before patch: < HCI Command: LE Read White List... (0x08|0x000f) plen 0 #55 [hci0] 13.338168 > HCI Event: Command Complete (0x0e) plen 5 #56 [hci0] 13.338842 LE Read White List Size (0x08|0x000f) ncmd 1 Status: Success (0x00) Size: 25 < HCI Command: LE Clear White List (0x08|0x0010) plen 0 #57 [hci0] 13.339029 > HCI Event: Command Complete (0x0e) plen 4 #58 [hci0] 13.339939 LE Clear White List (0x08|0x0010) ncmd 1 Status: Success (0x00) < HCI Command: LE Read Resolving L.. (0x08|0x002a) plen 0 #59 [hci0] 13.340152 > HCI Event: Command Complete (0x0e) plen 5 #60 [hci0] 13.340952 LE Read Resolving List Size (0x08|0x002a) ncmd 1 Status: Success (0x00) Size: 25 < HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0 #61 [hci0] 13.341180 > HCI Event: Command Complete (0x0e) plen 12 #62 [hci0] 13.341898 LE Read Maximum Data Length (0x08|0x002f) ncmd 1 Status: Success (0x00) Max TX octets: 251 Max TX time: 17040 Max RX octets: 251 Max RX time: 17040 After patch: < HCI Command: LE Read White List... (0x08|0x000f) plen 0 #55 [hci0] 28.919131 > HCI Event: Command Complete (0x0e) plen 5 #56 [hci0] 28.920016 LE Read White List Size (0x08|0x000f) ncmd 1 Status: Success (0x00) Size: 25 < HCI Command: LE Clear White List (0x08|0x0010) plen 0 #57 [hci0] 28.920164 > HCI Event: Command Complete (0x0e) plen 4 #58 [hci0] 28.920873 LE Clear White List (0x08|0x0010) ncmd 1 Status: Success (0x00) < HCI Command: LE Read Resolving L.. (0x08|0x002a) plen 0 #59 [hci0] 28.921109 > HCI Event: Command Complete (0x0e) plen 5 #60 [hci0] 28.922016 LE Read Resolving List Size (0x08|0x002a) ncmd 1 Status: Success (0x00) Size: 25 < HCI Command: LE Clear Resolving... (0x08|0x0029) plen 0 #61 [hci0] 28.922166 > HCI Event: Command Complete (0x0e) plen 4 #62 [hci0] 28.922872 LE Clear Resolving List (0x08|0x0029) ncmd 1 Status: Success (0x00) < HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0 #63 [hci0] 28.923117 > HCI Event: Command Complete (0x0e) plen 12 #64 [hci0] 28.924030 LE Read Maximum Data Length (0x08|0x002f) ncmd 1 Status: Success (0x00) Max TX octets: 251 Max TX time: 17040 Max RX octets: 251 Max RX time: 17040 Signed-off-by: Ankit Navik Signed-off-by: Marcel Holtmann commit cfdb0c2d095ac5d7f09cac1317b7d0a9e8178134 Author: Ankit Navik Date: Fri Jun 29 12:12:50 2018 +0530 Bluetooth: Store Resolv list size When the controller supports the Read LE Resolv List size feature, the maximum list size are read and now stored. Before patch: < HCI Command: LE Read White List... (0x08|0x000f) plen 0 #55 [hci0] 17.979791 > HCI Event: Command Complete (0x0e) plen 5 #56 [hci0] 17.980629 LE Read White List Size (0x08|0x000f) ncmd 1 Status: Success (0x00) Size: 25 < HCI Command: LE Clear White List (0x08|0x0010) plen 0 #57 [hci0] 17.980786 > HCI Event: Command Complete (0x0e) plen 4 #58 [hci0] 17.981627 LE Clear White List (0x08|0x0010) ncmd 1 Status: Success (0x00) < HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0 #59 [hci0] 17.981786 > HCI Event: Command Complete (0x0e) plen 12 #60 [hci0] 17.982636 LE Read Maximum Data Length (0x08|0x002f) ncmd 1 Status: Success (0x00) Max TX octets: 251 Max TX time: 17040 Max RX octets: 251 Max RX time: 17040 After patch: < HCI Command: LE Read White List... (0x08|0x000f) plen 0 #55 [hci0] 13.338168 > HCI Event: Command Complete (0x0e) plen 5 #56 [hci0] 13.338842 LE Read White List Size (0x08|0x000f) ncmd 1 Status: Success (0x00) Size: 25 < HCI Command: LE Clear White List (0x08|0x0010) plen 0 #57 [hci0] 13.339029 > HCI Event: Command Complete (0x0e) plen 4 #58 [hci0] 13.339939 LE Clear White List (0x08|0x0010) ncmd 1 Status: Success (0x00) < HCI Command: LE Read Resolving L.. (0x08|0x002a) plen 0 #59 [hci0] 13.340152 > HCI Event: Command Complete (0x0e) plen 5 #60 [hci0] 13.340952 LE Read Resolving List Size (0x08|0x002a) ncmd 1 Status: Success (0x00) Size: 25 < HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0 #61 [hci0] 13.341180 > HCI Event: Command Complete (0x0e) plen 12 #62 [hci0] 13.341898 LE Read Maximum Data Length (0x08|0x002f) ncmd 1 Status: Success (0x00) Max TX octets: 251 Max TX time: 17040 Max RX octets: 251 Max RX time: 17040 Signed-off-by: Ankit Navik Signed-off-by: Marcel Holtmann commit a5e50d5b127562f3eef5438f84b1066eeda4d7c6 Author: Sebastian Andrzej Siewior Date: Tue Jun 19 23:56:57 2018 +0200 Bluetooth: btusb: use irqsave() in URB's complete callback The USB completion callback does not disable interrupts while acquiring the ->lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave variant of the locking primitives. Cc: Marcel Holtmann Cc: Johan Hedberg Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Marcel Holtmann commit 8f63e9230decb06ea9068feaf0845c0eb39ab890 Merge: 58ec5e9c9044 1268ed0c474a Author: Thomas Gleixner Date: Fri Jul 6 12:35:56 2018 +0200 Merge branch 'x86/urgent' into x86/hyperv Integrate the upstream bug fix to resolve the resulting conflict in __send_ipi_mask(). Signed-off-by: Thomas Gleixner commit 45ae68b8cfc25bdbffc11248001c47ab1b76ff6e Author: Jian-Hong Pan Date: Fri May 25 17:54:52 2018 +0800 Bluetooth: Add a new Realtek 8723DE ID 0bda:b009 Without this patch we cannot turn on the Bluethooth adapter on HP 14-bs007la. T: Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=b009 Rev= 2.00 S: Manufacturer=Realtek S: Product=802.11n WLAN Adapter S: SerialNumber=00e04c000001 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms Signed-off-by: Jian-Hong Pan Signed-off-by: Marcel Holtmann commit 03bc05e1a4972f73b4eb8907aa373369e825c252 Author: Michael Scott Date: Tue Jun 19 16:44:06 2018 -0700 6lowpan: iphc: reset mac_header after decompress to fix panic After decompression of 6lowpan socket data, an IPv6 header is inserted before the existing socket payload. After this, we reset the network_header value of the skb to account for the difference in payload size from prior to decompression + the addition of the IPv6 header. However, we fail to reset the mac_header value. Leaving the mac_header value untouched here, can cause a calculation error in net/packet/af_packet.c packet_rcv() function when an AF_PACKET socket is opened in SOCK_RAW mode for use on a 6lowpan interface. On line 2088, the data pointer is moved backward by the value returned from skb_mac_header(). If skb->data is adjusted so that it is before the skb->head pointer (which can happen when an old value of mac_header is left in place) the kernel generates a panic in net/core/skbuff.c line 1717. This panic can be generated by BLE 6lowpan interfaces (such as bt0) and 802.15.4 interfaces (such as lowpan0) as they both use the same 6lowpan sources for compression and decompression. Signed-off-by: Michael Scott Acked-by: Alexander Aring Acked-by: Jukka Rissanen Signed-off-by: Marcel Holtmann commit 31c9bd78018cc36e62525fe3edc0009c1da6347f Author: Chris Wilson Date: Fri Jul 6 07:53:14 2018 +0100 drm/i915/selftests: Skip over live context testing when wedged If the GPU is terminally wedged we cannot submit any requests into a context, completely unfulfilling our purpose of doing so. As this expectedly fails, skip over the test. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-9-chris@chris-wilson.co.uk commit 921d07d73ebf6d87064883d69fedd3d7e9e99538 Author: Chris Wilson Date: Fri Jul 6 07:53:13 2018 +0100 drm/i915/selftests: Skip huge pages live tests if wedged We test the GPU handling of huge pages by submitting requests that write into a huge page, but if the GPU is irrecoverably wedged we cannot submit any requests. As the test expectedly fails, skip over it. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-8-chris@chris-wilson.co.uk commit 7783decff5be6811a1a31df91b47fd2541b993d0 Author: Chris Wilson Date: Fri Jul 6 07:53:12 2018 +0100 drm/i915/selftests: Skip live eviction tests when wedged If the GPU is irrecoverably wedged, we cannot submit any requests and so cannot make the GTT busy in order to test evicting active objects. As this expectedly fails, skip over the test. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-7-chris@chris-wilson.co.uk commit 47e61a79806d5d222261250dc573a68c53e99c22 Author: Chris Wilson Date: Fri Jul 6 07:53:11 2018 +0100 drm/i915/selftests: Skip workaround tests when wedged If the GPU is irrecoverably wedged, we cannot submit any request and therefore cannot query the register state of the context (which is done using the GPU command stream). So skip over the test as it expectedly fails. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-6-chris@chris-wilson.co.uk commit a9450e15ad9e921fd2d76b038a8b252b1afc7bb6 Author: Chris Wilson Date: Fri Jul 6 07:53:10 2018 +0100 drm/i915/selftests: Skip all request selftests when wedged If the GPU is irrecoverably wedge, we cannot submit any request and so all of the request selftests will expectedly fail. Skip over them. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-5-chris@chris-wilson.co.uk commit e16f4c36cb9bf61fcd70a2ea978cee2a23ebf71d Author: Chris Wilson Date: Fri Jul 6 07:53:09 2018 +0100 drm/i915/selftests: Skip making an object busy if the GPU is wedged If the GPU is wedged, we cannot make the object busy as trying to submit a request will generate -EIO. Skip to the end of the test. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-4-chris@chris-wilson.co.uk commit b5f6e53d4cd58043e2c4e1b60fd446924cf56cbe Author: Chris Wilson Date: Fri Jul 6 07:53:08 2018 +0100 drm/i915/selftests: Skip using the GPU if wedged If the GPU is irrecoverably broken, we can not use it to dirty memory and check for cache coherency with the CPU. All we can do is simply skip over the GPU subtests and focus on the CPU domains (WC, WB) cache management. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107127 Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-3-chris@chris-wilson.co.uk commit e5d2435bfaeee3f4045e03441d3902c63254b618 Author: Chris Wilson Date: Fri Jul 6 07:53:07 2018 +0100 drm/i915/selftests: Destroy partial tiling vma after use As we keep VMA around until the object is destroyed, when testing partial tiling we instantiate many, many VMA (as the object is huge allowing for many different partial regions). We test elsewhere our handling of populating large objects with a full set of VMA and checking we can retrieve them afterwards, but in this test we incur the cost of flushing all VMA after every GTT write, dramatically slowing down the test. References: https://bugs.freedesktop.org/show_bug.cgi?id=107130 Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-2-chris@chris-wilson.co.uk commit 1eca65d922d7543b60610624afd345b4f3d71ae2 Author: Chris Wilson Date: Fri Jul 6 07:53:06 2018 +0100 drm/i915: Squelch very verbose error logging Having found the error causing the IGT test to fail, downgrade the verbose logging so that we stop flooding the syslogs as we deliberately provoke it many thousands of time during selftests. References: 10195b1e4411 ("drm/i915: Show vma allocator stack when in doubt") Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180706065332.15214-1-chris@chris-wilson.co.uk commit d61d1b3bbba1054a7a326c18a3c66f822f9fa338 Author: Madhav Chauhan Date: Thu Jul 5 19:19:38 2018 +0530 drm/i915/icl: Define AUX lane registers for Port A/B This patch defines AUX lane registers for PORT_PCS_DW1, PORT_TX_DW2, PORT_TX_DW4, PORT_TX_DW5 used during dsi enabling. v2: Review comments from Jani N: - Define _ICL_PORT_PCS_DW1_AUX_A for consistency - Three spaces for bitfield definition. Signed-off-by: Madhav Chauhan Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1530798591-2077-8-git-send-email-madhav.chauhan@intel.com commit 45f09f7adc8a10138b158c5805a4d3b20aac611a Author: Madhav Chauhan Date: Thu Jul 5 19:19:37 2018 +0530 drm/i915/icl: Power down unused DSI lanes To save power, unused lanes should be powered down using the bitfield of PORT_CL_DW10. v2: Review comments from Jani N - Put default label next to case 4 - Include the shifts in the macros Signed-off-by: Madhav Chauhan Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1530798591-2077-7-git-send-email-madhav.chauhan@intel.com commit 166869b390b6fe763544fe4ae1e01acd28db331a Author: Madhav Chauhan Date: Thu Jul 5 19:19:36 2018 +0530 drm/i915/icl: Define PORT_CL_DW_10 register This register used to power down individual lanes for DDI/DSI ports. Bitfields to power up/down various combinations of lanes are also added in this patch. v2: Review comments from Jani N - Use override instead of "override" for bitfields - Define mask for override bitfield - Define PWR_DOWN_LN* macros shifted in place v3: Correct PWR_DOWN_LN_MASK value (Jani N) Signed-off-by: Madhav Chauhan Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1530798591-2077-6-git-send-email-madhav.chauhan@intel.com commit b1cb21a5f1c668534b25464717c806e141ba500f Author: Madhav Chauhan Date: Thu Jul 5 19:19:35 2018 +0530 drm/i915/icl: Enable DSI IO power This patch configures mode of operation for DSI and enable DDI IO power by configuring power well. v2: Use for_each_dsi_port() for power get (Jani N) Signed-off-by: Madhav Chauhan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1530798591-2077-5-git-send-email-madhav.chauhan@intel.com commit 21652f3b0d48749e3ba0d332d2b39cc18eacb1c0 Author: Madhav Chauhan Date: Thu Jul 5 19:19:34 2018 +0530 drm/i915/icl: Define DSI mode ctl register This patch defines DSI IO mode control register and it's bits used while enabling IO power for DSI. Signed-off-by: Madhav Chauhan Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1530798591-2077-4-git-send-email-madhav.chauhan@intel.com commit fcfe0bdcb1911a4ff6ab6b6264e3323745178025 Author: Madhav Chauhan Date: Thu Jul 5 19:19:33 2018 +0530 drm/i915/icl: Program DSI Escape clock Divider Escape Clock is used for LP communication across the DSI Link. To achieve the constant frequency of the escape clock from the variable DPLL frequency output, a variable divider(M) is needed. This patch programs the same. v2: (Jani N) Don't end line with "(". Signed-off-by: Madhav Chauhan Signed-off-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/1530798591-2077-3-git-send-email-madhav.chauhan@intel.com commit af846a6f6de27eabcefa81ea98b0c3bd21aa25c7 Author: Johan Hovold Date: Wed Jul 4 17:02:19 2018 +0200 USB: serial: kobil_sct: add missing version error handling Add missing version-request error handling and suppress printing of the (zeroed) transfer-buffer content in case of errors. Signed-off-by: Johan Hovold commit a420b5d939ee58f1d950f0ea782834056520aeaa Author: Johan Hovold Date: Wed Jul 4 17:02:18 2018 +0200 USB: serial: kobil_sct: fix modem-status error handling Make sure to return -EIO in case of a short modem-status read request. While at it, split the debug message to not include the (zeroed) transfer-buffer content in case of errors. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Johan Hovold commit 8adbbb2e7871e76d53ea91e6159864ee534fdac8 Author: Yannick Fertre Date: Fri Jun 29 13:22:35 2018 +0200 drm/stm: ltdc: rework reset sequence Reset must be properly assert before deassert. This is important if there is an early boot splash screen before the kernel start up. Signed-off-by: Yannick Fertre Reviewed-by: Philippe Cornu Tested-by: Philippe Cornu Signed-off-by: Benjamin Gaignard Link: https://patchwork.freedesktop.org/patch/msgid/1530271355-5608-1-git-send-email-yannick.fertre@st.com commit 7868e5079228b4c07cf61b5ad5d35af5c29f7375 Author: Yannick Fertre Date: Fri Jun 29 13:22:22 2018 +0200 drm/stm: ltdc: filter mode pixel clock vs pad constraint Filter the requested mode pixel clock frequency according to the pad maximum supported frequency. Signed-off-by: Yannick Fertre Reviewed-by: Philippe Cornu Tested-by: Philippe Cornu Signed-off-by: Benjamin Gaignard Link: https://patchwork.freedesktop.org/patch/msgid/1530271342-5532-1-git-send-email-yannick.fertre@st.com commit f8878bb2f8675e3c7716906b9b41bddc9b3bc039 Author: Benjamin Gaignard Date: Tue Jun 5 15:54:01 2018 +0200 drm: print plane state normalized zpos value When dumping plane state print normalized zpos value as done for the other plane state fields. Signed-off-by: Benjamin Gaignard Reviewed-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20180605135407.20214-2-benjamin.gaignard@linaro.org commit 012bf847d1396e4cf2503e298ca49b3dc4591755 Author: Jani Nikula Date: Thu Jul 5 16:25:09 2018 +0300 drm/i915/dsi: update some of the platform based checks Use the more customary order of latest platform first, and don't bother with an if in the last branch. Cc: Madhav Chauhan Cc: Daniel Vetter Cc: Chris Wilson Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Reviewed-by: Madhav Chauhan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180705132509.12881-3-jani.nikula@intel.com commit e518634b4366d2fe874d36e6394693b1be0a9f44 Author: Jani Nikula Date: Thu Jul 5 16:25:08 2018 +0300 drm/i915/dsi: use vlv and bxt prefixes for the global DSI functions Avoid confusion with the functions to be added for the new ICL or gen 11 DSI implementation by renaming the current DSI functions. While at it, permutate the words in the function names to make them all start with "vlv_dsi" or "vlv_dsi_pll" etc. Reduce the platform abstractions in the PLL file while at it, moving the checks to vlv_dsi.c instead, where we typically already have the necessary if ladders. Leave the static functions as-is for now; they could be renamed later if needed. No functional changes. v2: use "gen7" prefix. v3: use "vlv" and "bxt" prefixes, reduce the abstractions. References: https://patchwork.freedesktop.org/series/44823/ Cc: Madhav Chauhan Cc: Daniel Vetter Cc: Chris Wilson Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Reviewed-by: Madhav Chauhan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180705132509.12881-2-jani.nikula@intel.com commit ca3589c11815cb1587a908c46e8f04a05a193254 Author: Jani Nikula Date: Thu Jul 5 16:25:07 2018 +0300 drm/i915/dsi: rename the current DSI files based on first platform Starting from ICL or gen 11 we have a new DSI block which requires completely different programming from the current implementation. Having them in the same file would be confusing. Rename the current DSI and DSI PLL implementation files as vlv_dsi.c and vlv_dsi_pll.c. No functional changes. v2: use "gen7" prefix. v3: use "vlv" prefix. References: https://patchwork.freedesktop.org/series/44823/ Cc: Madhav Chauhan Cc: Daniel Vetter Cc: Chris Wilson Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Reviewed-by: Madhav Chauhan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180705132509.12881-1-jani.nikula@intel.com commit 6c8021503f728b4b3eda69876c20e1ff30767a22 Author: Vasily Gorbik Date: Sun Jul 1 16:59:44 2018 +0200 s390/appldata: reuse generic proc handler functions Simplify appldata proc handlers by reusing generic proc handler functions. Tested-by: Gerald Schaefer Reviewed-by: Gerald Schaefer Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 71e33a1dd712dc6f68de733218d4506bea26bda6 Author: Vasily Gorbik Date: Sun Jul 1 15:56:28 2018 +0200 s390/cmm: split and simplify cmm pages proc handler Split cmm_pages_handler into cmm_pages_handler and cmm_timed_pages_handler, each handling separate proc entry. And reuse proc_doulongvec_minmax to simplify proc handlers. Min/max values are optional and are omitted here. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 196851bed5221a7670024e3ad39704c6d92b2014 Author: Vasily Gorbik Date: Sun Jun 24 12:28:46 2018 +0200 s390/topology: correct topology mode proc handler Reuse proc_douintvec_minmax to simplify topology mode proc handler. This also enforces correct range of 0-1 on proc writes and correctly handles numbers starting with 0 or spaces. Before: $ echo 01 > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 0 $ echo ' 1' > /proc/sys/s390/topology -bash: echo: write error: Invalid argument $ echo 2 > /proc/sys/s390/topology -bash: echo: write error: Invalid argument $ echo 12 > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 1 After: $ echo 01 > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 1 $ echo ' 1' > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 1 $ echo 2 > /proc/sys/s390/topology -bash: echo: write error: Invalid argument $ echo 12 > /proc/sys/s390/topology -bash: echo: write error: Invalid argument $ echo ' 0' > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 0 Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit f149371e9e02d23495fc796c09075adeb376a375 Author: Vasily Gorbik Date: Sun Jun 24 23:28:12 2018 +0200 s390/sclp_async: replace callhome proc handler with generic one Reuse generic proc_dointvec_minmax proc handler instead of proc_handler_callhome. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 5bedf8aa03c28cb8dc98bdd32a41b66d8f7d3eaa Author: Vasily Gorbik Date: Sun Jun 24 12:17:43 2018 +0200 s390/mm: correct allocate_pgste proc_handler callback Since proc_dointvec does not perform value range control, proc_dointvec_minmax should be used to limit value range, which is clearly intended here, as the internal representation of the value: unsigned int alloc_pgste:1; In fact it currently works, since we have mm->context.alloc_pgste = page_table_allocate_pgste || ... ... since commit 23fefe119ceb5 ("s390/kvm: avoid global config of vm.alloc_pgste=1") Before that it was mm->context.alloc_pgste = page_table_allocate_pgste; which was broken. That was introduced with commit 0b46e0a3ec0d7 ("s390/kvm: remove delayed reallocation of page tables for KVM"). Fixes: 0b46e0a3ec0d7 ("s390/kvm: remove delayed reallocation of page tables for KVM") Acked-by: Christian Borntraeger Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 287d6070acbb2529e24462faffca46663885dddc Author: Philipp Rudo Date: Wed Jun 27 12:03:43 2018 +0200 s390/purgatory: Remove duplicate variable definitions Currently there are some variables in the purgatory (e.g. kernel_entry) which are defined twice, once in assembler- and once in c-code. The reason for this is that these variables are set during purgatory load, where sanity checks on the corresponding Elf_Sym's are made, while they are used in assembler-code. Thus adding a second definition in c-code is a handy workaround to guarantee correct Elf_Sym's are created. When the purgatory is compiled with -fcommon (default for gcc on s390) this is no problem because both symbols are merged by the linker. However this is not required by ISO C and when the purgatory is built with -fno-common the linker fails with errors like arch/s390/purgatory/purgatory.o:(.bss+0x18): multiple definition of `kernel_entry' arch/s390/purgatory/head.o:/.../arch/s390/purgatory/head.S:230: first defined here Thus remove the duplicate definitions and add the required size and type information to the assembler definition. Also add -fno-common to the command line options to prevent similar hacks in the future. Signed-off-by: Philipp Rudo Acked-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit c315e69308c739a43c4ebc539bedbc1ac8d79854 Author: Philipp Rudo Date: Tue Jun 26 18:24:52 2018 +0200 s390/purgatory: Add missing FORCE to Makefile targets Without FORCE make does not detect changes only made to the command line options. So object files might not be re-built even when they should be. Fix this by adding FORCE where it is missing. Fixes: 840798a1f5299 ("s390/kexec_file: Add purgatory") Cc: # 4.17 Signed-off-by: Philipp Rudo Acked-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit ad03b821fbc30395b72af438f5bb41676a5f891d Author: Philipp Rudo Date: Tue Jun 26 12:24:30 2018 +0200 s390/purgatory: Fix crash with expoline enabled When the kernel is built with CONFIG_EXPOLINE=y and a compiler with indirect branch mitigation enabled the purgatory crashes. The reason for that is that the macros defined for expoline are used in mem.S. These macros define new sections (.text.__s390x_indirect_*) which are marked executable. Due to the missing linker script those sections are linked to address 0, just as the .text section. In combination with the entry point also being at address 0 this causes the purgatory load code (kernel/kexec_file.c: kexec_purgatory_setup_sechdrs) to update the entry point twice. Thus the old kernel jumps to some 'random' address causing the crash. To fix this turn off expolines for the purgatory. There is no problem with this in this case due to the fact that the purgatory only runs once and the tlb is purged (diag 308) in the end. Fixes: 840798a1f5299 ("s390/kexec_file: Add purgatory") Cc: # 4.17 Signed-off-by: Philipp Rudo Reviewed-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit c4e4f4545bdc3939ae9fff1da55ed1e28776dafe Author: Chris Wilson Date: Thu Jul 5 16:02:14 2018 +0100 drm/i915/selftests: Fail hangcheck testing if the GPU is wedged If the GPU is irrecoverably wedged on startup, it means that it failed on initialisation and we have already tried to reset it but failed. We can ignore all further testing, as it is already dead. Failing early, prevents us from slowly failing in our endeavours later and timing out. Signed-off-by: Chris Wilson Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180705150214.28316-1-chris@chris-wilson.co.uk commit b9b0a74aad1ca47544f875d6afac4d91e789f67c Author: Kuninori Morimoto Date: Wed Jul 4 00:34:10 2018 +0000 dmaengine: rcar-dmac: convert to SPDX identifiers This patch is using C++ comment style for SPDX line only, because driver author want it. Signed-off-by: Kuninori Morimoto Reviewed-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Signed-off-by: Vinod Koul commit 24ca312dd66329b126230b6f5826f45a61ebb5a8 Author: Robin Gong Date: Wed Jul 4 18:06:42 2018 +0800 dmaengine: imx-sdma: add missing structure description Some member description or colons missing cause build warning with 'W=1' as below: drivers/dma/imx-sdma.c:326: warning: Function parameter or member 'vd' not described in 'sdma_desc' drivers/dma/imx-sdma.c:326: warning: Function parameter or member 'num_bd' not described in 'sdma_desc' drivers/dma/imx-sdma.c:326: warning: Function parameter or member 'bd_phys' not described in 'sdma_desc' drivers/dma/imx-sdma.c:326: warning: Function parameter or member 'buf_tail' not described in 'sdma_desc' drivers/dma/imx-sdma.c:326: warning: Function parameter or member 'buf_ptail' not described in 'sdma_desc' drivers/dma/imx-sdma.c:326: warning: Function parameter or member 'period_len' not described in 'sdma_desc' drivers/dma/imx-sdma.c:326: warning: Function parameter or member 'chn_real_count' not described in 'sdma_desc' drivers/dma/imx-sdma.c:326: warning: Function parameter or member 'chn_count' not described in 'sdma_desc Signed-off-by: Robin Gong Reported-by: Vinod Koul Signed-off-by: Vinod Koul commit 8b1d9676a8b82517b9a3ac6e321c77296955c5ca Author: Tony Lindgren Date: Thu Jul 5 22:41:12 2018 -0700 dt-bindings: Update omap l4 binding for optional registers The interconnects on omap variants have configuration registers. There are registers for a link agent, one or more interconnect agent, and an optional access protection. Let's also update the example for omap4 l4 per instance as it has multiple interconnect agent registers. For more information, see chapter "Interconnect" in TI techical reference manuals. Cc: Mark Rutland Cc: Rob Herring Cc: Tero Kristo Reviewed-by: Rob Herring Signed-off-by: Tony Lindgren commit ab8565af68001ac5f9331daa311938ead3eb5636 Merge: 2cc0608e42ac d8269e2cbf90 Author: David S. Miller Date: Fri Jul 6 11:19:08 2018 +0900 Merge branch 'IP-listification-follow-ups' Edward Cree says: ==================== IP listification follow-ups While working on IPv6 list processing, I found another bug in the IPv4 version. So this patch series has that fix, and the IPv6 version with both fixes incorporated. ==================== Signed-off-by: David S. Miller commit d8269e2cbf908f9d26aa5d3217236227dffd1d89 Author: Edward Cree Date: Thu Jul 5 15:49:42 2018 +0100 net: ipv6: listify ipv6_rcv() and ip6_rcv_finish() Essentially the same as the ipv4 equivalents. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit efe6aaca67a0229a195f493d142102c864b41dde Author: Edward Cree Date: Thu Jul 5 15:47:39 2018 +0100 net: ipv4: fix list processing on L3 slave devices If we have an L3 master device, l3mdev_ip_rcv() will steal the skb, but we were returning NET_RX_SUCCESS from ip_rcv_finish_core() which meant that ip_list_rcv_finish() would keep it on the list. Instead let's move the l3mdev_ip_rcv() call into the caller, so that our response to a steal can be different in the single packet path (return NET_RX_SUCCESS) and the list path (forget this packet and continue). Fixes: 5fa12739a53d ("net: ipv4: listify ip_rcv_finish") Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 4da1d4c751c9b1b713c13043bad7c4d27cd1418c Merge: a1c3b49523ae e368fc75c190 Author: Dave Airlie Date: Fri Jul 6 10:02:10 2018 +1000 Merge commit 'refs/for-upstream/mali-dp' of git://linux-arm.org/linux-ld into drm-next "mali-dp driver changes for drm-next, includes the driver implementation for writeback, improvements for power management handling in the driver and a debugfs entry for reporting possible internal errors. Please pull at your earliest convenience. Boris Brezillon is also interested in this pull as he is going to change slightly the parameter for the writeback connector's atomic_commit() and he needs to fix the mali-dp driver in his series." Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180705144408.GH15340@e110455-lin.cambridge.arm.com commit a1c3b49523aeb89a7f5ffa852c29db9c4e5ac8dd Merge: c5be9b540343 968d72e6a510 Author: Dave Airlie Date: Fri Jul 6 08:52:45 2018 +1000 Merge tag 'drm-misc-next-2018-07-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 4.19: UAPI Changes: v3d: add fourcc modicfier for fourcc for the Broadcom UIF format (Eric Anholt) Cross-subsystem Changes: console/fbcon: Add support for deferred console takeover (Hans de Goede) Core Changes: dma-fence clean up, improvements and docs (Daniel Vetter) add mask function for crtc, plane, encoder and connector DRM objects(Ville Syrjälä) Driver Changes: pl111: add Nomadik LCDC variant (Linus Walleij) Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180704234641.GA3981@juma commit c5be9b54034339a7983a1167cdc80dc27fea1799 Merge: 96b2bb0b9637 07c13bb78c8b Author: Dave Airlie Date: Fri Jul 6 06:30:32 2018 +1000 Merge branch 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux into drm-next A patchset worked out together with Peter Zijlstra. Ingo is OK with taking it through the DRM tree: This is a small fallout from a work to allow batching WW mutex locks and unlocks. Our Wound-Wait mutexes actually don't use the Wound-Wait algorithm but the Wait-Die algorithm. One could perhaps rename those mutexes tree-wide to "Wait-Die mutexes" or "Deadlock Avoidance mutexes". Another approach suggested here is to implement also the "Wound-Wait" algorithm as a per-WW-class choice, as it has advantages in some cases. See for example http://www.mathcs.emory.edu/~cheung/Courses/554/Syllabus/8-recv+serial/deadlock-compare.html Now Wound-Wait is a preemptive algorithm, and the preemption is implemented using a lazy scheme: If a wounded transaction is about to go to sleep on a contended WW mutex, we return -EDEADLK. That is sufficient for deadlock prevention. Since with WW mutexes we also require the aborted transaction to sleep waiting to lock the WW mutex it was aborted on, this choice also provides a suitable WW mutex to sleep on. If we were to return -EDEADLK on the first WW mutex lock after the transaction was wounded whether the WW mutex was contended or not, the transaction might frequently be restarted without a wait, which is far from optimal. Note also that with the lazy preemption scheme, contrary to Wait-Die there will be no rollbacks on lock contention of locks held by a transaction that has completed its locking sequence. The modeset locks are then changed from Wait-Die to Wound-Wait since the typical locking pattern of those locks very well matches the criterion for a substantial reduction in the number of rollbacks. For reservation objects, the benefit is more unclear at this point and they remain using Wait-Die. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180703105339.4461-1-thellstrom@vmware.com commit 43911fb68b19f7c37ab69eff8e6a3c1370bc0cb5 Author: Darren Powell Date: Wed Jun 27 17:05:20 2018 -0400 drm/amd: Add sphinx documentation for amd_ip_funcs Signed-off-by: Darren Powell Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 8405cf39e8bd034be29971342fca49b01e772da2 Author: Sonny Jiang Date: Tue Jun 26 15:48:34 2018 -0400 drm/amdgpu: update documentation for amdgpu_drv.c Signed-off-by: Sonny Jiang Acked-by: Junwei Zhang Acked-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 400443e894c5a7f63f3ace3664640ec3ea4e1585 Author: Mikita Lipski Date: Tue Jul 3 09:42:51 2018 -0400 drm/amd/display: add a check for display depth validity [why] HDMI 2.0 fails to validate 4K@60 timing with 10 bpc [how] Adding a helper function that would verify if the display depth assigned would pass a bandwidth validation. Drop the display depth by one level till calculated pixel clk is lower than maximum TMDS clk. Bugzilla: https://bugs.freedesktop.org/106959 Signed-off-by: Mikita Lipski Tested-by: Mike Lothian Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit fe61a2f1a57fea5d7b3d27d019fa67e1bc5b7079 Author: Mikita Lipski Date: Wed Jul 4 09:27:02 2018 -0400 drm/amd/display: adding ycbcr420 pixel encoding for hdmi [why] HDMI EDID's VSDB contains spectial timings for specifically YCbCr 4:2:0 colour space. In those cases we need to verify if the mode provided is one of the special ones has to use YCbCr 4:2:0 pixel encoding for display info. [how] Verify if the mode is using specific ycbcr420 colour space with the help of DRM helper function and assign the mode to use ycbcr420 pixel encoding. Signed-off-by: Mikita Lipski Tested-by: Mike Lothian Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 87e3f1366eaa82c78b826b38008987406470b03d Author: Darren Powell Date: Mon Jun 25 19:04:03 2018 -0400 drm/amd: Remove errors from sphinx documentation Eliminating the warnings produced by sphinx when processing the sphinx comments in amdgpu_device.c & amdgpu_mn.c Signed-off-by: Darren Powell Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 6f3472a993e7cb63cde5d818dcabc8e42fc03744 Author: Gustavo A. R. Silva Date: Wed Jul 4 08:22:11 2018 -0500 drm/amd/display/dc/dce: Fix multiple potential integer overflows Add suffix ULL to constant 5 and cast variables target_pix_clk_khz and feedback_divider to uint64_t in order to avoid multiple potential integer overflows and give the compiler complete information about the proper arithmetic to use. Notice that such constant and variables are used in contexts that expect expressions of type uint64_t (64 bits, unsigned). The current casts to uint64_t effectively apply to each expression as a whole, but they do not prevent them from being evaluated using 32-bit arithmetic instead of 64-bit arithmetic. Also, once the expressions are properly evaluated using 64-bit arithmentic, there is no need for the parentheses that enclose them. Addresses-Coverity-ID: 1460245 ("Unintentional integer overflow") Addresses-Coverity-ID: 1460286 ("Unintentional integer overflow") Addresses-Coverity-ID: 1460401 ("Unintentional integer overflow") Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 4c1ac53eb867670883f1518f620b19c2fed7e516 Author: Kees Cook Date: Wed Jul 4 10:27:30 2018 -0700 drm/amd/display: Use 2-factor allocator calls As already done treewide, switch from open-coded multiplication to 2-factor allocation helper. Signed-off-by: Kees Cook Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 25177e7f94a3deeda410edaf9313d0f1a2bb68e0 Author: Harry Wentland Date: Wed Jul 4 13:47:07 2018 -0400 Revert "drm/amd/display: Fix indentation in dcn10 resource constructor" That change was a merge gone bad. This reverts commit cb1d7eacb58f7d1b7d0e57b26dc02d45eada4a3c. Signed-off-by: Harry Wentland Signed-off-by: Alex Deucher commit 5d908944c5ba4fc8d301e1332635c64c1b77d843 Author: Dan Carpenter Date: Wed Jul 4 12:46:15 2018 +0300 drm/amd/display: off by one in find_irq_source_info() The ->info[] array has DAL_IRQ_SOURCES_NUMBER elements so this condition should be >= instead of > or we could read one element beyond the end of the array. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Dan Carpenter Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 20582319bce482e65ee1f417b9867f028d058c12 Author: Rex Zhu Date: Wed Jun 20 15:05:04 2018 +0800 drm/amd/pp: Remove the same struct define in powerplay delete the same struct define in powerplay, share the struct with display. Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 70b63170c3effc1d9a66fbfe4a5702c8cbbd31c3 Author: Rex Zhu Date: Tue Jul 3 17:17:21 2018 +0800 drm/amd/display: Fix copy error when set memory clocks Set memory clocks same as soc clocks Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit b0a634ac68337b263e01d83359a023676e370cce Author: Rex Zhu Date: Tue Jul 3 16:31:35 2018 +0800 drm/amd/display: Refine the implementation of dm_pp_get_funcs_rv powerplay/dpm export all interfaces in struct amd_pm_funcs. so call common exported interfaces instead of powerplay inner interfaces Also not include header file hwmgr.h Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit ea870e44415a5f5ed09b6e002e38d3e0de7f390e Author: Rex Zhu Date: Fri Jun 22 14:12:59 2018 +0800 drm/amd/pp: Export notify_smu_enable_pwe to display Display can notify smu to enable pwe after gpu suspend. It is used in case when display resumes from S3 and wants to start audio driver by enabling pwe Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 289278cb7d32685ee75baf599857d7049c4b8030 Author: Alex Deucher Date: Mon Jun 25 15:14:46 2018 -0500 drm: drop drm_pcie_get_speed_cap_mask and drm_pcie_get_max_link_width These functions duplicated functionality which was ultimately added to the pci core. All users of these functions have been ported to using the newly exposed pci functionality. These functions are no longer used, so drop them. Acked-by: Christian König Reviewed-by: Dave Airlie Signed-off-by: Alex Deucher commit 5f152a572c10cae4b08c2c5f2932a51684f454ba Author: Alex Deucher Date: Mon Jun 25 14:37:45 2018 -0500 drm/radeon: use pcie functions for link width This is the last user of drm_pcie_get_speed_cap_mask. Use the pci version so we can drop drm_pcie_get_speed_cap_mask. Acked-by: Christian König Signed-off-by: Alex Deucher commit 5d9a6330403271fbb1244f14380a7cc44662796f Author: Alex Deucher Date: Mon Jun 25 13:07:50 2018 -0500 drm/amdgpu: use pcie functions for link width and speed Use the newly exported pci functions to get the link width and speed rather than using the drm duplicated versions. Also query the GPU link caps directly rather than hardcoding them. Acked-by: Christian König Signed-off-by: Alex Deucher commit 4976f1c8ccff0d682176851692976e3bf03267d6 Author: Alex Deucher Date: Mon Jun 25 13:03:51 2018 -0500 drm/amdgpu: update amd_pcie.h to include gen4 speeds Internal header used by the driver to specify pcie gen speeds of the asic and chipset. Acked-by: Christian König Signed-off-by: Alex Deucher commit 576c7218a1546e0153480b208b125509cec71470 Author: Alex Deucher Date: Mon Jun 25 13:17:41 2018 -0500 PCI: Export pcie_get_speed_cap and pcie_get_width_cap So drivers can use them. This can be used to replace duplicate code in the drm subsystem. Acked-by: Christian König Acked-by: Bjorn Helgaas Signed-off-by: Alex Deucher commit 8eaf2b1faaf4358c6337785f2192055c6ef41e0d Author: Alex Deucher Date: Mon Jul 2 14:35:36 2018 -0500 drm/amdgpu: switch firmware path for SI parts Use separate firmware path for amdgpu to avoid conflicts with radeon on SI parts. Reviewed-by: Chunming Zhou Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ce206464e3c7a0936468f0190599d2e6070850f4 Author: Alex Deucher Date: Mon Jul 2 14:32:28 2018 -0500 drm/amdgpu: switch firmware path for CIK parts (v2) Use separate firmware path for amdgpu to avoid conflicts with radeon on CIK parts. v2: squash in logic simplification (Alex) Reviewed-by: Chunming Zhou Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 9fc15f5fc836712b173f04e143b8d77fdded1a37 Author: Nicolai Hähnle Date: Fri Jun 29 13:23:25 2018 +0200 drm/amdgpu: fix user fence write race condition The buffer object backing the user fence is reserved using the non-user fence, i.e., as soon as the non-user fence is signaled, the user fence buffer object can be moved or even destroyed. Therefore, emit the user fence first. Both fences have the same cache invalidation behavior, so this should have no user-visible effect. Signed-off-by: Nicolai Hähnle Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 860c15e903327f9af269d2ee7011454624dfcb90 Author: Rex Zhu Date: Wed Jun 20 13:36:58 2018 +0800 drm/amd/pp: Remove duplicate code in vega12_hwmgr.c use smu_helper function smu_set_watermarks_for_clocks_ranges in vega12_set_watermarks_for_clocks_ranges. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 99c5e27d3368eb92476f47530355a6f25bf486e8 Author: Rex Zhu Date: Fri Jun 22 18:26:52 2018 +0800 drm/amd/pp: Refine the interface exported to display use void * as function parameter type in order for extension. Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit d4d5eace210d3676202153c19e473aeb51a81909 Author: rex zhu Date: Mon Jul 2 16:20:56 2018 +0800 drm/amd/display: Notify powerplay the display controller id powerplay can recalculate the number of active display Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 3180fb676d7fd38a7c1effa2e5d9265779473c23 Author: rex zhu Date: Mon Jul 2 14:55:43 2018 +0800 drm/amd/display: Notify powerplay the min_dcef clock powerplay can notify smu to recalculates the maximum deep-sleep divider display allowed. Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 7d8d968dac88a98bd1d4503a020e8b114672611e Author: rex zhu Date: Thu Jun 28 13:55:46 2018 +0800 drm/amd/pp: Switch the tolerable latency for display Select the lowest MCLK frequency that is within the tolerable latency defined in DISPALY Acked-by: Alex Deucher Acked-by: Harry Wentland Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 6eb9d6030479c5e079a1374941b77ac205b10912 Author: Rex Zhu Date: Mon Jun 18 18:49:07 2018 +0800 drm/amd/pp: Memory Latency is always 25us on Vega10 For HBM, 25us latency is enough for memory clock switch. Acked-by: Alex Deucher Acked-by: Harry Wentland Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 23ec3d1479fd79658cd52c47618d8ddd2f32550b Author: Rex Zhu Date: Mon Jun 18 18:15:15 2018 +0800 drm/amd/pp: Convert clock unit to KHz as defined Convert clock unit 10KHz to KHz as the data sturct defined. e.g. struct pp_clock_with_latency { uint32_t clocks_in_khz; uint32_t latency_in_us; }; Meanwhile revert the same conversion in display side. Acked-by: Alex Deucher Acked-by: Harry Wentland Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit afb1436c7b44ab928e6369a4d48e3abb8215241e Author: Alex Deucher Date: Thu Jun 28 12:32:27 2018 -0500 drm/amdgpu: update uvd_v6_0_ring_vm_funcs to use new nop packet Was missed when updating the uvd 6 module. Fixes: 1aac3c9180 (drm/amdgpu: fix insert nop for UVD6 ring) Reviewed-by: Leo Liu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f8ddb39a15100076884a625e97c91f3578c686f5 Author: Huang Rui Date: Thu Jun 28 14:38:21 2018 +0800 drm/amdgpu: fix the wrong type of gem object creation We still use legacy type of gem_object_create, it should update to ttm_bo_type now. Signed-off-by: Huang Rui Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit da5fd66c0eb79e01501578bfc69352cc5e2e979d Author: Dirk Hohndel (VMware) Date: Mon May 7 01:16:23 2018 +0200 drm/radeon: add SPDX identifier and clarify license This is dual licensed under GPL-2.0 or MIT. Acked-by: Thomas Gleixner Signed-off-by: Dirk Hohndel (VMware) Signed-off-by: Alex Deucher commit 9f87830f61e79d5e2ae2529cd225cb123f7742b2 Author: Dirk Hohndel (VMware) Date: Mon May 7 01:16:20 2018 +0200 drm/amd: add SPDX identifier and clarify license This is dual licensed under GPL-2.0 or MIT. Acked-by: Thomas Gleixner Signed-off-by: Dirk Hohndel (VMware) Signed-off-by: Alex Deucher commit c3c18309c8319ab4600830bc010d916cb4e529de Author: Thomas Zimmermann Date: Thu Jun 28 16:10:25 2018 +0200 drm/amd: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Alex Deucher commit 5d4af988f39052b77f8fdd9ed5cb61ca1645a3a6 Author: Alex Deucher Date: Mon Jun 25 12:41:21 2018 -0500 drm/amdgpu/vce: simplify vce instance setup Set the me instance in early init and use that rather than calculating the instance based on the ring pointer. Reviewed-by: James Zhu Reviewed-by: Leo Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1cf0abb6c983d90ec541ebba79934a9c4786df1d Author: Alex Deucher Date: Mon Jun 25 12:24:10 2018 -0500 drm/amdgpu/sdma: simplify sdma instance setup Set the me instance in early init and use that rather than calculating the instance based on the ring pointer. Reviewed-by: James Zhu Reviewed-by: Leo Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ed54d954e5c1d8bad453fb86109075b3577152b7 Author: Alex Deucher Date: Thu Jun 28 13:21:12 2018 -0500 drm/amdgpu/pp: fix copy paste typo in smu7_get_pp_table_entry_callback_func_v1 Should be using PCIELaneLow for the low clock level. Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 9861023c29dbc069e49dc85fb21f01da9f75ff06 Author: Alex Deucher Date: Thu Jun 28 12:52:43 2018 -0500 drm/amdgpu/pp: fix copy paste typo in smu7_init_dpm_defaults Should be mclk rather than sclk. Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 594c34cc6f31807f23aae5c9cec6dea31d782f90 Author: Alex Deucher Date: Thu Jun 28 12:51:06 2018 -0500 drm/amdgpu/pp: fix endian swapping in atomctrl_get_voltage_range Need to swap before doing arthimetic on the values. Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit c9037d44390cc1ef7ec490c63ec8a4ee92a57925 Author: Alex Deucher Date: Thu Jun 28 12:48:10 2018 -0500 drm/amdgpu/pp: add missing byte swapping in process_pptables_v1_0.c Values need to be swapped on big endian. Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 70eb46db101b55acdf432187800915f72962a564 Author: Alex Deucher Date: Thu Jun 28 12:44:25 2018 -0500 drm/amdgpu/pm: fix display count in non-DC path new_active_crtcs is a bitmask, new_active_crtc_count is the actual count. Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 3413accb3eac9182ee0fc0b350a5f18247d8ac9d Author: Alex Deucher Date: Thu Jun 28 12:38:53 2018 -0500 drm/amdgpu: fix swapped emit_ib_size in vce3 The phys and vm versions had the values swapped. Reviewed-by: Junwei Zhang Signed-off-by: Alex Deucher commit 3f37e29626b0b5dbfcdf964ef2858b36a4c2cd67 Author: Michel Dänzer Date: Fri Jun 29 11:27:11 2018 +0200 drm/amdgpu: Remove amdgpu_gem_map_attach target_dev documentation The parameter was removed. Fixes: a19741e5e5a9 "dma_buf: remove device parameter from attach callback v2" Reviewed-by: Junwei Zhang Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 463d2fe85b0eacb3760febe100994d4eb8fedde9 Author: Michel Dänzer Date: Fri Jun 22 18:54:03 2018 +0200 drm/amdgpu: Add AMDGPU_GPU_PAGES_IN_CPU_PAGE define To hopefully make the code dealing with GPU vs CPU pages a little clearer. Suggested-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 9735bf1930e658b074d72ea46bb317ad12483692 Author: Michel Dänzer Date: Fri Jun 15 16:37:03 2018 +0200 drm/amdgpu: Use gmc_vram_full_visible in vram_mgr_bo_invisible_size Signed-off-by: Michel Dänzer Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 280cf1a94b822dfa2b505afcd24979dae643d6bf Author: Lyude Paul Date: Mon Jun 25 21:09:07 2018 -0400 drm/amdgpu: Dynamically probe for ATIF handle (v2) The other day I was testing one of the HP laptops at my office with an i915/amdgpu hybrid setup and noticed that hotplugging was non-functional on almost all of the display outputs. I eventually discovered that all of the external outputs were connected to the amdgpu device instead of i915, and that the hotplugs weren't being detected so long as the GPU was in runtime suspend. After some talking with folks at AMD, I learned that amdgpu is actually supposed to support hotplug detection in runtime suspend so long as the OEM has implemented it properly in the firmware. On this HP ZBook 15 G4 (the machine in question), amdgpu wasn't managing to find the ATIF handle at all despite the fact that I could see acpi events being sent in response to any hotplugging. After going through dumps of the firmware, I discovered that this machine did in fact support ATIF, but that it's ATIF method lived in an entirely different namespace than this device's handle (the device handle was \_SB_.PCI0.PEG0.PEGP, but ATIF lives in ATPX's handle at \_SB_.PCI0.GFX0). So, fix this by probing ATPX's ACPI parent's namespace if we can't find ATIF elsewhere, along with storing a pointer to the proper handle to use for ATIF and using that instead of the device's handle. This fixes HPD detection while in runtime suspend for this ZBook! v2: Update the comment to reflect how the namespaces are arranged based on the system configuration. (Alex) Signed-off-by: Lyude Paul Signed-off-by: Alex Deucher commit 24aeefcdee255d21cc43bb511d5fdb760062199d Author: Lyude Paul Date: Mon Jun 25 21:09:06 2018 -0400 drm/amdgpu: Add amdgpu_atpx_get_dhandle() Since it seems that some vendors are storing the ATIF ACPI methods under the same handle that ATPX lives under instead of the device's own handle, we're going to need to be able to retrieve this handle later so we can probe for ATIF there. Signed-off-by: Lyude Paul Signed-off-by: Alex Deucher commit aa03c075d02f89ae5acae10df1c8a3b095a440e7 Author: Lyude Paul Date: Mon Jun 25 21:09:05 2018 -0400 drm/amdgpu: s/disp_detetion_ports/disp_detection_ports/ Fix typo. Reviewed-by: Jim Qu Signed-off-by: Lyude Paul Signed-off-by: Alex Deucher commit 102c16a0246d77043e555e1e5b5de316bc068cbc Author: Lyude Paul Date: Mon Jun 25 21:09:04 2018 -0400 drm/amdgpu: Make struct amdgpu_atif private to amdgpu_acpi.c Currently, there is nothing in amdgpu that actually uses these structs other than amdgpu_acpi.c. Additionally, since we're about to start saving the correct ACPI handle to use for calling ATIF in this struct this saves us from having to handle making sure that the acpi_handle (and by proxy, the type definition for acpi_handle and all of the other acpi headers) doesn't need to be included within the amdgpu_drv struct itself. This follows the example set by amdgpu_atpx_handler.c. Signed-off-by: Lyude Paul Signed-off-by: Alex Deucher commit 0c3d01744511f053c5f67737cb7a6a99c0216a84 Author: Evan Quan Date: Mon Jun 11 16:48:43 2018 +0800 drm/amd/powerplay: cosmetic fix Fix coding style and drop unused variable. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6ad87101f3a34ea2b955a09dde085e4e9901bab9 Author: Evan Quan Date: Mon Jun 11 16:46:40 2018 +0800 drm/amd/powerplay: correct vega12 thermal support as true Thermal support is enabled on vega12. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 28a7b4f4498546c0d4d41c084abd0496f9922bf3 Author: Evan Quan Date: Mon Jun 11 17:22:33 2018 +0800 drm/amd/powerplay: set vega12 pre display configurations Set num_displays to 0 and force uclk high as part of the mode set sequence. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit e17c7f92b2b7c2f14934c305a8d72bbb0bf6f362 Author: Evan Quan Date: Mon Jun 11 16:40:57 2018 +0800 drm/amd/powerplay: apply clocks adjust rules on power state change This add the apply_clocks_adjust_rules callback which is used to validate the clock settings on a power state change. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit a0a59c8fc7af37287228a0c89b0a71a1ffadc29b Author: Evan Quan Date: Mon Jun 11 16:33:40 2018 +0800 drm/amd/powerplay: correct vega12 max num of dpm level Use MAX_NUM_CLOCKS instead of VG12_PSUEDO* macros for the max number of dpm levels. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 30222561808f8fdf6d56c22ccfe3d9140fd0a169 Author: Evan Quan Date: Wed Jun 20 12:28:10 2018 +0800 drm/amd/powerplay: drop unnecessary uclk hard min setting We don't need to set uclk hard min here because this will be set with other clocks on power state change. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit ac32b06acee88ab4c9f3336be5aea4a050b0d4e5 Author: Evan Quan Date: Wed Jun 20 12:24:29 2018 +0800 drm/amd/powerplay: correct smc display config for multi monitor Need to take into account multi-head with synced displays. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit f74aa69d0aed89b5ea283f4a6f86f0505407021e Author: Evan Quan Date: Mon Jun 11 16:25:14 2018 +0800 drm/amd/powerplay: initialize uvd/vce powergate status v4 On UVD/VCE dpm enabled/disabled, the powergate status will be set as false/true. So that we will not try to ungate/gate them( enable/disable their dpm) again. v2: added check for uvd/vce powergate status before gating v3: fix typo in description v4: warning fix (Alex) Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 8fd26361701187e6fbb56c7c8bf22b4ab763b082 Author: Evan Quan Date: Mon Jun 11 16:04:17 2018 +0800 drm/amd/powerplay: revise clock level setup Make sure the clock level set only on dpm enabled. Also uvd/vce/soc clock also changed correspondingly. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 70fef5741c6b82ad293a225f116006565646fb72 Author: Evan Quan Date: Mon Jun 11 15:41:44 2018 +0800 drm/amd/powerplay: retrieve all clock ranges on startup So that we do not need to use PPSMC_MSG_GetMin/MaxDpmFreq to get the clock ranges on runtime. Since that causes some problems. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 3b579c5483286fba6e13bc4b2f1d8a6627410371 Author: Evan Quan Date: Mon Jun 11 15:25:37 2018 +0800 drm/amd/powerplay: revise default dpm tables setup Initialize the soft/hard min/max level correctly and handle the dpm disabled situation. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 9bf40d787924f45d6a0fa49d3e69d772c2aa5b19 Author: Evan Quan Date: Mon Jun 11 17:38:54 2018 +0800 drm/amd/powerplay: drop the acg fix This workaround is not needed any more. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 77564c9dff26f2a90d089dfb282906ec7be7c144 Author: Evan Quan Date: Mon Jun 11 15:20:39 2018 +0800 drm/amd/powerplay: smc_dpm_info structure change A new member Vr2_I2C_address is added. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit acee16f4deab484b9b78876b8b292174e95ccf88 Author: Evan Quan Date: Mon May 28 08:59:16 2018 +0800 drm/amd/powerplay: correct vega12 bootup values settings The vbios firmware structure changed between v3_1 and v3_2. So, the code to setup bootup values needs different paths based on header version. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit b1c6fddb583f70892f2dd6de8c63af3aa4600a7b Author: Rex Zhu Date: Wed Jun 20 12:52:43 2018 +0800 drm/amd/display: Fix a typo in wm_min_memg_clk_in_khz change wm_min_memg_clk_in_khz -> wm_min_mem_clk_in_khz Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit e856ec3c292ecd6c15e38f2c6c22b350dc0daa17 Author: rex zhu Date: Wed Jun 27 18:19:08 2018 +0800 drm/amd/display: Ctrl stutter mode through module parameter use ppfeaturemask to enable/disable stutter mode. Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 22994e16dd025aefd7f97a863f13ae23d8853601 Author: rex zhu Date: Wed Jun 27 18:08:43 2018 +0800 drm/amdgpu: Add stutter mode ctrl in module parameter Enable stutter mode can save power in low DRAM use cases including but not limited to productivity application use, web browsing, and video playback. Currently this feature is disabled by default. Make bit 17 in module parameter amdgpu_pp_feature_mask as stutter mode mask, so user can enable/disable this feature easily. Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 916ac57ffbe952c02fcd883dee28970e39366eca Author: Rex Zhu Date: Wed Jun 6 13:42:42 2018 +0800 drm/amdgpu: Move CG/PG setting out of delay worker thread Partially revert commit 2dc80b00652f ("drm/amdgpu: optimize amdgpu driver load & resume time")' 1. CG/PG enablement are part of gpu hw ip initialize, we should wait for them complete. otherwise, there are some potential conflicts, for example, Suspend and CG enablement concurrently. 2. better run ib test after hw initialize completely. That is to say, ib test should be after CG/PG enablement. otherwise, the test will not cover the cg/pg/poweroff enable case. Reviewed-by: Evan Quan Reviewed-by: Christian König Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit c9f96fd5063150dce7e71ecc508989f5ff055039 Author: Rex Zhu Date: Wed Jun 13 19:30:40 2018 +0800 drm/amdgpu: Split set_pg_state into separate function 1. add amdgpu_device_ip_late_set_pg_state function for set pg state. 2. delete duplicate pg state setting on gfx_v8_0's late_init. Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 9134c6d7f288f902d932e7cf57fab2f49e8ad70b Author: Rex Zhu Date: Tue Jun 5 11:46:35 2018 +0800 drm/amdgpu: Add gfx_off support in smu through pp_set_powergating_by_smu we can take gfx off feature as gfx power gate. gfx off feature is also controled by smu. so add gfx_off support in pp_set_powergating_by_smu. Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit a214e1c415e70f5cbc7835180cb9ed5c8e4aa35e Author: Rex Zhu Date: Tue Jun 5 13:55:04 2018 +0800 drm/amd/pp: Add powergate_gfx backend function on Raven Raven support gfx off feature instand of gfx powergate, so use smu10_gfx_off_control as the powergate_gfx backend function. Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 85f80cb3af10f5daf79eee28300c3bbc55a70666 Author: Rex Zhu Date: Thu Jun 14 13:07:19 2018 +0800 drm/amd/pp: Add gfx pg support in smu through set_powergating_by_smu gfx ip block can call set_powergating_by_smu to set gfx pg state if necessary. Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit b92c628712ed3a1cf5d4a144290e8ffc170bf51e Author: Rex Zhu Date: Tue Jun 5 13:06:11 2018 +0800 drm/amd/pp: Unify powergate_uvd/vce/mmhub to set_powergating_by_smu Some HW ip blocks need call SMU to enter/leave power gate state. So export common set_powergating_by_smu interface. 1. keep consistent with set_clockgating_by_smu 2. scales easily to powergate other ip(gfx) if necessary Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 3eb6e4795de3171d5c59f9368f48bb770087de77 Author: Rex Zhu Date: Tue Jun 5 11:28:03 2018 +0800 drm/amd/pp: Rename enable_per_cu_power_gating to powergate_gfx keep consistent with powergate_uvd/vce/mmhub Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit a8da8ff3332b1f92588d22a8a643965409d1892d Author: Rex Zhu Date: Tue Jun 5 10:07:53 2018 +0800 drm/amdgpu: Rename set_mmhub_powergating_by_smu to powergate_mmhub In order to keep consistent with powergate_uvd/vce. Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 66917e56dcfe8d2ba00f2d86c7dfbf953e0604ae Author: rex zhu Date: Wed Jun 27 17:34:37 2018 +0800 drm/amd/display: Fix dm-pp clks type convert error fix a typo when convert displayphyclk type. Reviewed-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit f0626896bb2f09e8ce6438f380ac7f6511b72f84 Author: rex zhu Date: Wed Jun 27 17:35:40 2018 +0800 drm/amd/display: Drop unnecessary header file powerplay implement hwmgr_function table for all supported asics in order to conceal the asic's detail infomation. so no need to include the smu10_hwmgr.h. Reviewed-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit cc450654291bb40c2d67a04d7e2fb42bff7e162a Author: Flora Cui Date: Wed Jun 27 13:53:53 2018 +0800 drm/amdgpu: remove duplicated codes the fence_context and seqno is init in amdgpu_vm_manager_init() & amdgpu_vmid_mgr_init(). remove the amdgpu_vmid_mgr_init() copy. Signed-off-by: Flora Cui Reviewed-by: Junwei Zhang Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher commit d6258eaa41fc531277d44fbbee670c866025bfdc Author: Stefan Agner Date: Sun Jun 17 10:53:38 2018 +0200 drm/amd/display: don't initialize result The wrong enum type is used to initialize the result, leading to a warning when using clang: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1998:26: warning: implicit conversion from enumeration type 'enum ddc_result' to different enumeration type 'enum dc_status' [-Wenum-conversion] enum dc_status result = DDC_RESULT_UNKNOWN; ~~~~~~ ^~~~~~~~~~~~~~~~~~ 1 warning generated. Initialization of result is unnecessary anyway, just drop the initialization. Signed-off-by: Stefan Agner Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit c49d82800bbf04a6d7d6843c6f2c2ea5746eb26e Author: Andrey Grodzovsky Date: Tue Jun 5 12:56:26 2018 -0400 drm/amdgpu: Rename entity cleanup finctions. Everything in the flush code path (i.e. waiting for SW queue to become empty) names with *_flush() and everything in the release code path names *_fini() Signed-off-by: Andrey Grodzovsky Suggested-by: Christian König Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 180fc134d712a93a2bbc3d11ed657b5208e6f90f Author: Andrey Grodzovsky Date: Tue Jun 5 12:43:23 2018 -0400 drm/scheduler: Rename cleanup functions v2. Everything in the flush code path (i.e. waiting for SW queue to become empty) names with *_flush() and everything in the release code path names *_fini() This patch also effect the amdgpu and etnaviv drivers which use those functions. v2: Also pplay the change to vd3. Signed-off-by: Andrey Grodzovsky Suggested-by: Christian König Acked-by: Lucas Stach Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f3efec54ed6ac05ba63be1bd93bd741d41b6eb37 Author: Tony Cheng Date: Fri Jun 8 17:36:26 2018 -0400 drm/amd/display: Allow option to use worst-case watermark use worse case watermark (consider both DCC and VM) to keep golden consistent regardless of DCC Signed-off-by: Tony Cheng Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 1eeedbcc20d64ff2ef7eb9823f85bbb1c2545064 Author: Samson Tam Date: Wed May 30 15:44:50 2018 -0400 drm/amd/display: get board layout for edid emulation Signed-off-by: Samson Tam Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 7f93c1de64693dc18afe55559f14cee6b5403c6c Author: Charlene Liu Date: Sat Jun 9 19:33:14 2018 -0400 drm/amd/display: add valid regoffset and NULL pointer check Signed-off-by: Charlene Liu Reviewed-by: Dmytro Laktyushkin Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit c1aaea99a43e39c7c8dc6c71b84589c89d5bcbf2 Author: Tony Cheng Date: Tue Jun 5 09:14:36 2018 -0400 drm/amd/display: dal 3.1.52 Signed-off-by: Tony Cheng Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit b6c3053a8f431a032a1473dc0e0069ca7fd0b0e5 Author: Yongqiang Sun Date: Fri Jun 8 13:07:53 2018 -0500 drm/amd/display: Check scaling ration not viewports params. In case of roation, width and height in viewport is difference between viewport and h_active and v_active, while this is not scaling. The right way is check ratios in scaling data, to determine it is a scaling case or not. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit bf28c2e205b1c37e412cb6785a34f10de944bae1 Author: Dmytro Laktyushkin Date: Tue Jun 5 07:33:10 2018 -0400 drm/amd/display: remove soc_bounding_box.c Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit e21db6dbdf4327f620c5a203f7801b59dad9942e Author: Dmytro Laktyushkin Date: Thu May 24 14:39:01 2018 -0400 drm/amd/display: move dcn watermark programming to set_bandwidth Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 7144d3cfff7d8b0d98d9d25ee42c674491e31bc9 Author: Dmytro Laktyushkin Date: Tue Jun 5 13:14:13 2018 -0400 drm/amd/display: separate out wm change request dcn workaround Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 69d6bb171fe15f564adfbc485e77dd8c5ca953d5 Author: Dmytro Laktyushkin Date: Tue Jun 5 07:19:08 2018 -0400 drm/amd/display: remove dcn1 watermark sets b, c and d Currently dcn1 will not switch between watermark sets so we can save time by not calculating 3 extra sets. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 33a6a7eb8014cb7089570534ef4d502efe4372ed Author: Dmytro Laktyushkin Date: Wed Jun 6 13:19:39 2018 -0400 drm/amd/display: fix dcn1 watermark range reporting Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit f7c1ed341ae0807e55fc583fbd5582ff4ef35a98 Author: Mikita Lipski Date: Fri Jun 1 15:02:55 2018 -0400 drm/amd/display: Moving powerplay functions to a separate class Moving powerplay functions to a new amdgpu_dm_pp_smu class and cleaning dm_services class from unused headers. Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 746c58ed225b9439a8272f755a1c60f795de9a3c Author: Dmytro Laktyushkin Date: Tue Jun 5 07:40:04 2018 -0400 drm/amd/display: move dml defaults to respective dcn resource files Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 724a75524b1c77ea8abb96c21cdba05385b22b39 Author: Mikita Lipski Date: Thu May 31 14:44:18 2018 -0400 drm/amd/display: Convert 10kHz clks from PPLib into kHz The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 015ec75918698e63f770c9bee0752ce802ed55e2 Author: Mikita Lipski Date: Thu May 31 17:31:14 2018 -0400 drm/amd/display: Add dmpp clks types for conversion Add more cases for dm_pp clks translator into pp clks so we can pass the right structures to the powerplay. Use clks translator instead of massive switch statement. Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 5094ffac6bd265130f735dd500532cef39f0d72f Author: Mikita Lipski Date: Thu May 31 14:49:00 2018 -0400 drm/amd/display: Enable PPLib calls from DC on linux Set the powerplay debug flag to false for both Windows and Linux to allow the calls to pplib. So we can retrieve the clock values from powerplay instead of using default hardcoded values. Signed-off-by: Mikita Lipski Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 6f66ccf0aa8f6d430d161a1ac2bc43e665d2fc59 Author: Roman Li Date: Tue Jun 5 14:24:53 2018 -0400 drm/amd/display: fix potential infinite loop in fbc path - Fixing integer overflow bug in wait_for_fbc_state_changed() - Correct the max value of retries for the corresponding warning Signed-off-by: Roman Li Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit d4fa93e03839c3e4e9d16020f1a3c78ae36c646a Author: Tony Cheng Date: Tue Jun 5 09:14:22 2018 -0400 drm/amd/display: dal 3.1.51 Signed-off-by: Tony Cheng Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit b9c1c67aeb8805015f02efb0a6a6ddf68ea8a4b4 Author: Dmytro Laktyushkin Date: Tue Jun 5 12:54:38 2018 -0400 drm/amd/display: clean rq/dlg/ttu reg structs before calculations Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 9f6e2842d0681a9a6579618a301c8ae06e20a6cd Author: Tony Cheng Date: Tue Jun 5 09:13:56 2018 -0400 drm/amd/display: dal 3.1.50 Signed-off-by: Tony Cheng Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit dc38fd9dac3e15538c7c238c4dfb98ceb408fa19 Author: David Francis Date: Fri Jun 1 09:49:06 2018 -0400 drm/amd/display: Add front end for dp debugfs files As part of hardware certification, read-write access to the link rate, lane count, voltage swing, pre-emphasis, and PHY test pattern of DP connectors is required. This commit adds debugfs files that will correspond to these values. The file operations are not yet implemented: currently writing or reading them does nothing. Signed-off-by: David Francis Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 0176e8c4c0f35555f7554ec3097283187b33ccbd Author: Tony Cheng Date: Tue May 8 12:25:29 2018 -0400 drm/amd/display: dal 3.1.49 Signed-off-by: Tony Cheng Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit f3e077d95ca0a016fdf3d6b1e97a9910dfdaff17 Author: Wesley Chalmers Date: Tue May 29 17:45:05 2018 -0400 drm/amd/display: fix use of uninitialized memory DML does not calculate chroma values for RQ when surface is not YUV, but DC will unconditionally use the uninitialized values for HW programming. This does not cause visual corruption since HW will ignore garbage chroma values when surface is not YUV, but causes presubmission tests to fail golden value comparison. Signed-off-by: Wesley Chalmers Signed-off-by: Eryk Brol Reviewed-by: Wenjing Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 836758ffe78a7bc45af9484e34cba2b685f2a0b2 Author: Zheng, XueLai(Eric) Date: Tue May 8 12:25:15 2018 -0400 drm/amd/display: support ACrYCb2101010 Signed-off-by: XueLai(Eric), Zheng Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit d7b539d34acea44ee555a4fe35e77c23b8dc4bc4 Author: Dmytro Laktyushkin Date: Thu May 24 15:09:40 2018 -0400 drm/amd/display: add safe_to_lower support to dcn wm programming This will prevent watermarks from lowering when unsafe to do so. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 294c7e7347d400b2f2d9f09898e8c462f752f500 Author: Dmytro Laktyushkin Date: Wed May 30 17:17:27 2018 -0400 drm/amd/display: change dentist DID enum values to uppercase Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 5f8d084939d0a94d21c32adf2a4e9249e6ce5654 Author: Dmytro Laktyushkin Date: Wed May 30 17:12:16 2018 -0400 drm/amd/display: add CHG_DONE mash/sh defines for dentist Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 5b0ec710dadd4569c1ed76dc175b94abb594b977 Author: Dmytro Laktyushkin Date: Fri Jun 1 15:01:32 2018 -0400 drm/amd/display: fix pplib voltage request This fixes incorrect clock caching and by extension fixes the clock reporting. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Yang Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 89af301e21b53317f1d0c5ed6f8e935f65e877d0 Author: Dmytro Laktyushkin Date: Fri Jun 1 14:13:40 2018 -0400 drm/amd/display: fix dccg dcn1 ifdef Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Yang Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 7e17cb4ba90cf2ab51e65427092fdc878cc956bc Author: Charlene Liu Date: Wed May 30 15:58:08 2018 -0400 drm/amd/display: Define dp_alt_mode Also cleanup command_table2.c. No need for a lot of forward declarations. Signed-off-by: Charlene Liu Reviewed-by: Krunoslav Kovac Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0eebf8ca18b647024fc9a3ccc88c0184d02db534 Author: Wesley Chalmers Date: Fri Jun 1 10:54:53 2018 -0400 drm/amd/display: Temporarily remove Chroma logs To ensure tests continue to pass Signed-off-by: Wesley Chalmers Reviewed-by: Shahin Khayyer Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit aa162e2727254262a79509ec3e99ace33b3232b6 Author: Dmytro Laktyushkin Date: Thu May 31 13:28:00 2018 -0400 drm/amd/display: remove unnecessary pplib volage requests that are asserting Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit c910a717dac6540a636a57c1a34261c6d84fc0eb Author: Dmytro Laktyushkin Date: Wed May 23 18:39:21 2018 -0400 drm/amd/display: clean up set_bandwidth usage This removes redundant set_bandwidth calls as well as fixes a bug in post_set_address_update where dcn1 would never get to lower clocks. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Nikola Cornij Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 3cdecd4513d57993aaddc03ccdf4539add772aa4 Author: Dmytro Laktyushkin Date: Thu May 24 16:48:38 2018 -0400 drm/amd/display: rename dce_disp_clk to dccg No functional change. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Nikola Cornij Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 472800a0a0c84e224a7d4d5a4cfcd8dd6a4dd2b1 Author: Dmytro Laktyushkin Date: Thu May 24 15:50:18 2018 -0400 drm/amd/display: clean up dccg divider calc and dcn constructor No functional change. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 12c3130dd6f391437a60c765912a30b4cbb77247 Author: Dmytro Laktyushkin Date: Wed May 23 18:18:50 2018 -0400 drm/amd/display: move dcn1 dispclk programming to dccg No functional change. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Nikola Cornij Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit d578839ca014e5f4e6d540caadc0b84d50a8977f Author: Dmytro Laktyushkin Date: Wed May 23 18:02:27 2018 -0400 drm/amd/display: get rid of cur_clks from dcn_bw_output Cleans up dcn_bw_output to only contain calculated info, actual programmed values will now be stored in respective blocks. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Nikola Cornij Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 25684c59aff5147d48cc7ce04d4d75a15c5a3a71 Author: Mikita Lipski Date: Tue May 29 16:20:37 2018 -0400 drm/amd/display: Add clock types to applying clk for voltage Add DCF and FCLK clock case statements for changing raven's clocks for voltage request. Also maintain DCEF clock for DCE120 calls. Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 9654a28b3ac075f2454d5867d490b0c2f7cde9fd Author: Mikita Lipski Date: Tue May 29 16:15:12 2018 -0400 drm/amd/display: Use local structs instead of struct pointers Change struct pointers to creating structs on a stack. Thats fixing a mistake in a previous patch introducing dm_pplib functions Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0d8be24134eddaf5acc937f59d58e62d869f0a6f Author: Yongqiang Sun Date: Tue May 29 07:18:27 2018 -0700 drm/amd/display: Use tg count for opp init. In case of tg count not equal to FE pipe count, if use pipe count to iterate the tgs, it will cause BSOD. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 2dfa76d328630de3dd4fc09b296ee9771ba13e39 Author: Dmytro Laktyushkin Date: Mon May 28 18:09:52 2018 -0400 drm/amd/display: remove invalid assert when no max_pixel_clk is found Signed-off-by: Dmytro Laktyushkin Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 92276a06f9c3d29183c7bdf46a6dbbc9c00f7acf Author: Mikita Lipski Date: Wed Apr 11 14:52:41 2018 -0400 drm/amd/display: Introduce pp-smu raven functions DM powerplay calls for DCN10 allowing to bypass PPLib and call directly to the SMU functions. Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 30f0ea6d0901c1ff9e7a4d986959e3e4008ee8e1 Author: Tony Cheng Date: Tue May 8 12:25:15 2018 -0400 drm/amd/display: dal 3.1.48 Signed-off-by: Tony Cheng Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit db4e525304ddf272e45542cbfd820840cf6ac874 Author: Mikita Lipski Date: Wed Apr 18 17:19:23 2018 -0400 drm/amd/display: Adding Get static clocks for dm_pp interface Adding a call to powerplay to get system clocks and translate to dm structure Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 28825c841bfd993bbe5c9466533baca8520f08c3 Author: Mikita Lipski Date: Mon Apr 9 13:40:00 2018 -0400 drm/amd/display: Apply clock for voltage request Translate dm_pp tructure to pp type Call PP lib to apply clock voltage request for display Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 734b096096ac860b5a72c52e8a6a8b81fa9e016c Author: Mikita Lipski Date: Mon Apr 9 09:48:15 2018 -0400 drm/amd/display: Adding dm-pp clocks getting by voltage Function to get clock levels by voltage from PPLib Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit e2e0a1dcd3229eec32ded439f69438a25ec817d6 Author: Dmytro Laktyushkin Date: Wed May 23 17:52:04 2018 -0400 drm/amd/display: move clock programming from set_bandwidth to dccg This change moves dcn clock programming(with exception of dispclk) into dccg. This should have no functional effect. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 6ca11246180a6e5e6b5b668545c2575b304c9f7f Author: Dmytro Laktyushkin Date: Wed May 23 16:44:26 2018 -0400 drm/amd/display: rename display clock block to dccg Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit fab55d61b9f04693abc6fdbc92e3fdf3872915b1 Author: Dmytro Laktyushkin Date: Wed May 23 16:21:54 2018 -0400 drm/amd/display: redesign dce/dcn clock voltage update request The goal of this change is to move clock programming and voltage requests to a single function. As of this change only dce is affected. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 765b26836430e9d9ebef95fced42dd167b4ccad6 Author: Dmytro Laktyushkin Date: Wed May 23 13:16:50 2018 -0400 drm/amd/display: replace clocks_value struct with dc_clocks This will avoid structs with duplicate information. Also removes pixel clock voltage request. This has no effect since pixel clock does not affect dcn voltage and this function only matters for dcn. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit a25ca1625dd4ecc89c20bb9082b325490f3f78f2 Author: Alex Deucher Date: Fri Jun 22 15:00:26 2018 -0500 Revert "drm/amdgpu: avoid sleep while executing atombios table (V2)" This reverts commit 8f4805a265fd710a2827b2c0e10c08ef2b526870. This change was mistakenly committed and should have been dropped with the rest of the series. Signed-off-by: Alex Deucher commit 9bdc2092b488bc81aa5409b4d6fc931c5bea1094 Author: Andrey Grodzovsky Date: Tue Jun 19 10:27:53 2018 -0400 drm/amdgpu: Add parsing SQ_EDC_INFO to SQ IH v3. Access to SQ_EDC_INFO requires selecting register instance and hence mutex lock when accessing GRBM_GFX_INDEX for which a work is schedueled from IH. But SQ interrupt can be raised on many instances at once which means queuing work will usually succeed for the first one but fail for the rest since the work takes time to process. To avoid losing info about other interrupt instances call the parsing function directly from high IRQ when current work hasn't finished and avoid accessing SQ_EDC_INFO in that case. v2: Simplify high IRQ and BH handlers synchronization using work_pending. Remove {READ,WRITE}_ONCE notations since smp_{r,w}mb are implicit compiler barriers. v3: Remove exlicit memory barriers as scedule_work has r/w barriers. Signed-off-by: Andrey Grodzovsky Acked-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit d9e222b460b195a47b30fd9057fbb131fcbd7bac Author: Andrey Grodzovsky Date: Mon Jun 18 11:15:10 2018 -0400 drm/amdgpu: Polish SQ IH. Switch to using reg fields defines istead of magic values. Add SH_ID and PRIV fields reading for instr. and err cases. Signed-off-by: Andrey Grodzovsky Acked-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit b374d82dca4721c534eb940b599dd4d45ba3a18f Author: Tom St Denis Date: Wed Jun 20 07:55:39 2018 -0400 drm/amd/amdgpu: Add a GPU_LOAD entry to sysfs (v3) This adds what should be a stable interface to read GPU load from userspace. (v2): Fix comments and name of file per recommendations. (v3): Add chapter to amdgpu.rst as well. Signed-off-by: Tom St Denis Acked-by: Slava Abramov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a315f232f44e685397639649fe559325424d32d4 Author: Christian König Date: Tue Jun 19 10:45:03 2018 +0200 drm/amdgpu: band aid validating VM PTs Always validating the VM PTs takes to much time. Only always validate the per VM BOs for now. Signed-off-by: Christian König Reviewed-by: Junwei Zhang Signed-off-by: Alex Deucher commit 6f7b0bad88397ad5d7901ce63696163ac8b481ce Author: Uwe Kleine-König Date: Mon Jul 2 22:05:35 2018 +0200 usb: simplify usbport trigger The led trigger core learned a few things that allow to simplify the trigger drivers. Make use of automated trigger attributes and error checking of the activate callback. Also use the wrappers to set and get trigger_data. Acked-by: Pavel Machek Acked-by: Greg Kroah-Hartman Signed-off-by: Uwe Kleine-König Signed-off-by: Jacek Anaszewski commit 9bfd7d9e5d63532da2d2d55a6bec5bb377761d37 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:34 2018 +0200 leds: gpio trigger: simplifications from core changes The trigger core learned error handling for the activate callback and to handle device attributes. Also make use of the module_led_trigger() helper to simplify trigger registration. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit e4786ba0db7b1163403c29c429f5ef61906a84c0 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:33 2018 +0200 leds: backlight trigger: simplifications from core changes Use the new module_led_trigger() helper. Also use attribute support from the trigger core. Drop error message on allocation failure as kzalloc() already screams loudly when failing. Use wrappers to get and set trigger data. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 13d698cbd99ce90f1d6b4fb0ff11ab90eb55f55e Author: Uwe Kleine-König Date: Mon Jul 2 22:05:32 2018 +0200 leds: activity trigger: simplifications from core changes The trigger core learned error handling for the activate callback and can handle device attributes now. This allows simplifying the driver considerably. Note that .deactivate() is only called when .activate() succeeded, so the check for .activated can go away in .deactivate(). Also make use of module_led_trigger() and the accessor function to get and set trigger_data. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 5cccc555108b602f92101a939143925095ff9b1d Author: Uwe Kleine-König Date: Mon Jul 2 22:05:31 2018 +0200 leds: default-on trigger: make use of module_led_trigger() This removes some boilerplate from the driver. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 71c4af71e597f429d37c89f5db2e44c59c8ba88c Author: Uwe Kleine-König Date: Mon Jul 2 22:05:30 2018 +0200 leds: heartbeat trigger: simplifications from core changes The trigger core learned error handling for the activate callback and can handle device attributes now. This allows simplifying the driver considerably. Note that .deactivate() is only called when .activate() succeeded, so the check for .activated can go away in .deactivate(). Also make use of module_led_trigger() and the accessor function to get and set trigger_data. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 81d5533297fb672012bb298c1f7545f9c168ccb0 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:29 2018 +0200 leds: oneshot trigger: simplifications from core changes The trigger core learned error handling for the activate callback and can handle device attributes now. This allows simplifying the driver considerably. Note that .deactivate() is only called when .activate() succeeded, so the check for .activated can go away in .deactivate(). Also make use of module_led_trigger() and do some minor coding style improvements. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 823f786ac7615f1bf822227fc4cbeafe11fb6bf8 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:28 2018 +0200 leds: transient trigger: simplifications from core changes The trigger core learned error handling for the activate callback and can handle device attributes now. This allows simplifying the driver considerably. Note that .deactivate() is only called when .activate() succeeded, so the check for .activated can go away. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 2b7b6d44e29160eb12abd950c374babf21ed83d4 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:27 2018 +0200 leds: timer trigger: simplifications from core changes The trigger core learned error handling for the activate callback and can handle device attributes now. This allows simplifying the driver considerably. Note that .deactivate() is only called when .activate() succeeded, so the check for .trigger_data being non-NULL can go away. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit f8112a1de1a728ffef0dd9f6c3005490c5f79ab1 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:26 2018 +0200 leds: netdev trigger: simplifications from core changes The trigger core learned error handling for the activate callback and can handle device attributes now. This allows simplifying the driver considerably. Note that .deactivate() is only called when .activate() succeeded, so the check for trigger_data being non-NULL can go away. (It was broken before because the core didn't clear .trigger_data, so it might have been non-NULL even if .activate() failed before.) Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 9acc560de2aac73ef99c54f0fdfb86b4684296b5 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:25 2018 +0200 leds: triggers: new function led_set_trigger_data() This is the natural counter part to the already existing led_get_trigger_data(). Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit a0b750768371e410d77b60bcf49c18bd45078d55 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:24 2018 +0200 leds: triggers: define module_led_trigger helper This helps to simplify modules that provide a simple led_trigger. It's inspired by module_platform_driver, module_i2c_driver et al. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit a7d5904a6f44e0da05d62197521ec7d96cebb6aa Author: Uwe Kleine-König Date: Mon Jul 2 22:05:23 2018 +0200 leds: triggers: handle .trigger_data and .activated() in the core This helps keeping these two fields consistent and drivers don't need to care for this themselves any more. Note that .activated isn't set to true automatically because that might confuse some triggers when deactivating (e.g. ledtrig-gpio). Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit a7e7a3156300a7e1982b03cc9cb8fb0c86434c49 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:22 2018 +0200 leds: triggers: add device attribute support As many triggers use device attributes, add support for these in led_trigger_set which allows simplifying the drivers accordingly. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 2282e125a406e09331c5a785e3df29035c99a607 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:21 2018 +0200 leds: triggers: let struct led_trigger::activate() return an error code Given that activating a trigger can fail, let the callback return an indication. This prevents to have a trigger active according to the "trigger" sysfs attribute but not functional. All users are changed accordingly to return 0 for now. There is no intended change in behaviour. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 033692eb3ec8305f6e9998b297aaec6899680637 Author: Uwe Kleine-König Date: Mon Jul 2 22:05:20 2018 +0200 leds: triggers: make the MODULE_LICENSE string match the actual license These files are licensed under GPL version 2 only. So use "GPL v2" instead of "GPL" (which means v2 or later). Also remove an empty (but commented) line at the end of the license header which nicely proves in the context that the drivers are really v2 only :-) Signed-off-by: Uwe Kleine-König Signed-off-by: Jacek Anaszewski commit 96b2bb0b9637df1a68bb5b6853903a207fabcefd Merge: f29135ee4e0d f8466184bd5b Author: Dave Airlie Date: Fri Jul 6 06:28:05 2018 +1000 Merge tag 'omapdrm-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next omapdrm changes for 4.19 * Workaround for DRA7 errata i932 * Fix mm_list locking * Cleanups Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/88b2e77f-9646-d15f-645b-ba45af2a1966@ti.com commit 73d8e5fba54f400cd5fe48517dbe6776fb16c2ad Author: Chris Wilson Date: Thu Jul 5 18:15:23 2018 +0100 drm/i915/selftests: Detect unknown swizzling correctly i915_gem_detect_bit_6_swizzle() tries to hide unknown swizzling from userspace (and ourselves) leaving us with the only clue inside i915->quirks & QUIRK_PIN_SWIZZLED_PAGES. If we see this bit set, it means that we really have no clue as to what the swizzle pattern is being used in any one page and so cannot compute what the reference value should be in our tiling selftests. We have to skip the test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107133 Signed-off-by: Chris Wilson Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180705171523.18462-1-chris@chris-wilson.co.uk commit ca52bea9fa8007f837ab4685b98979bbffc33416 Author: Ville Syrjälä Date: Fri Jun 15 20:07:34 2018 +0300 drm/atomic-helper: Use bitwise or for filling a bitmask Using += to set the bits in a mask looks funny. It works in this case because we never set the same bit twice. But let's switch to |= to make this look more regular. Cc: Maarten Lankhorst Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180615170734.2774-1-ville.syrjala@linux.intel.com Reviewed-by: Eric Anholt commit 9757973f41b52cd8fa7850100b8b0ae85261bcc5 Author: Ville Syrjälä Date: Thu Jun 21 20:46:58 2018 +0300 drm/i915: Remove pointless if-else from sdvo code The return value is a bool so we can just return the result of the biwise AND. The compiler will take care of the rest. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180621174658.18823-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit a65020d0a65da69f504b5ee4d43d255d0875999e Author: Eric Anholt Date: Tue Jul 3 10:05:15 2018 -0700 drm/v3d: Fix a grammar nit in the scheduler docs. Signed-off-by: Eric Anholt Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703170515.6298-4-eric@anholt.net Reviewed-by: Alex Deucher Acked-by: Daniel Vetter commit 2dd4f211e70728af386684d912b964b62d5fa15f Author: Eric Anholt Date: Tue Jul 3 10:05:14 2018 -0700 drm/v3d: Add missing v3d documentation structure. This was a failure of "git add" on my part -- we already referenced the doc from drivers.rst. Signed-off-by: Eric Anholt Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703170515.6298-3-eric@anholt.net Reviewed-by: Alex Deucher Acked-by: Daniel Vetter commit e0d018119ae82cbde32c1d4f8e9b8d8f43a3c88a Author: Eric Anholt Date: Tue Jul 3 10:05:13 2018 -0700 drm/v3d: Remove unnecessary dma_fence_ops. The dma-fence core as of commit 418cc6ca0607 ("dma-fence: Make ->wait callback optional") provides appropriate defaults for these methods. Signed-off-by: Eric Anholt Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703170515.6298-2-eric@anholt.net Reviewed-by: Alex Deucher Acked-by: Daniel Vetter commit 624bb0c08b8298cbc6a16f9c68edc93f767716ec Author: Eric Anholt Date: Tue Jul 3 10:05:12 2018 -0700 drm/v3d: Delay the scheduler timeout if we're still making progress. GTF-GLES2.gtf.GL.acos.acos_float_vert_xvary submits jobs that take 4 seconds at maximum resolution, but we still want to reset quickly if a job is really hung. Sample the CL's current address and the return address (since we call into tile lists repeatedly) and if either has changed then assume we've made progress. Signed-off-by: Eric Anholt Cc: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/20180703170515.6298-1-eric@anholt.net Reviewed-by: Alex Deucher Acked-by: Daniel Vetter commit 408633d2e740221204100efb9c3eed71f39aacd0 Author: Souptick Joarder Date: Wed Jul 4 20:25:57 2018 +0530 drm/v3d: use new return type vm_fault_t in v3d_gem_fault Instead of converting an errno into a vm_fault_t ourselves, use vmf_insert_mixed() which returns a vm_fault_t directly. Signed-off-by: Souptick Joarder Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180704145556.GA11036@jordon-HP-15-Notebook-PC Reviewed-by: Matthew Wilcox commit ebc7709f65001911f275e13dd5f29b02803c0688 Author: Colin Ian King Date: Tue Jul 3 07:51:09 2018 +0100 md/r5cache: remove redundant pointer bio Pointer bio is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'bio' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Shaohua Li commit df8c676418e1eb6f7bbafc1e01983f3538584894 Author: Guoqing Jiang Date: Mon Jul 2 16:26:26 2018 +0800 md-cluster: don't send msg if array is closing If we close an array which resync thread is running, then we don't need the node to send msg since another node would launch the resync thread to continue the rest works. Also send a message is time consuming, we should avoid it. Signed-off-by: Guoqing Jiang Reviewed-by: NeilBrown Signed-off-by: Shaohua Li commit 0357ba27bd611ff496390fdb172fdb31ca475398 Author: Guoqing Jiang Date: Mon Jul 2 16:26:25 2018 +0800 md-cluster: show array's status more accurate When resync or recovery is happening in one node, other nodes don't show the appropriate info now. For example, when create an array in master node without "--assume-clean", then assemble the array in slave nodes, you can see "resync=PENDING" when read /proc/mdstat in slave nodes. However, the info is confusing since "PENDING" status is introduced for start array in read-only mode. We introduce RESYNCING_REMOTE flag to indicate that resync thread is running in remote node. The flags is set when node receive RESYNCING msg. And we clear the REMOTE flag in following cases: 1. resync or recover is finished in master node, which means slaves receive msg with both lo and hi are set to 0. 2. node continues resync/recovery in recover_bitmaps. 3. when resync_finish is called. Then we show accurate information in status_resync by check REMOTE flags and with other conditions. Signed-off-by: Guoqing Jiang Reviewed-by: NeilBrown Signed-off-by: Shaohua Li commit 010228e4a932ca1e8365e3b58c8e1e44c16ff793 Author: Guoqing Jiang Date: Mon Jul 2 16:26:24 2018 +0800 md-cluster: clear another node's suspend_area after the copy is finished When one node leaves cluster or stops the resyncing (resync or recovery) array, then other nodes need to call recover_bitmaps to continue the unfinished task. But we need to clear suspend_area later after other nodes copy the resync information to their bitmap (by call bitmap_copy_from_slot). Otherwise, all nodes could write to the suspend_area even the suspend_area is not handled by any node, because area_resyncing returns 0 at the beginning of raid1_write_request. Which means one node could write suspend_area while another node is resyncing the same area, then data could be inconsistent. So let's clear suspend_area later to avoid above issue with the protection of bm lock. Also it is straightforward to clear suspend_area after nodes have copied the resync info to bitmap. Signed-off-by: Guoqing Jiang Reviewed-by: NeilBrown Signed-off-by: Shaohua Li commit ed1ae2dd9f242c7a36e8e39100f6a7f6bcdfdd89 Author: pascal paillet Date: Thu Jul 5 14:25:56 2018 +0000 regulator: core: Link consumer with regulator driver Add a device link between the consumer and the driver so that the consumer is not suspended before the driver. The goal is to avoid implementing suspend_late ops in regulator drivers. Signed-off-by: pascal paillet Signed-off-by: Mark Brown commit d8842211b6f63d3f069df973d137de0a85964965 Author: pascal paillet Date: Thu Jul 5 14:25:56 2018 +0000 driver core: Add device_link_remove function Device_link_remove uses the same arguments than device_link_add. The Goal is to avoid storing the link pointer. Signed-off-by: pascal paillet Acked-by: Greg Kroah-Hartman Signed-off-by: Mark Brown commit 0380cf7dbaca75c524e34b30979f0806124fa8e6 Author: pascal paillet Date: Thu Jul 5 14:25:57 2018 +0000 regulator: core: Change suspend_late to suspend Change suspend_late ops to suspend normal ops. The goal is to avoid requesting all the regulator drivers to be operational in suspend late phase. Signed-off-by: pascal paillet Signed-off-by: Mark Brown commit bb9e8755a4259a306cd1691b4e17c4c485d81c9e Author: Chris Wilson Date: Thu Jul 5 16:47:56 2018 +0100 drm/i915/selftests: Fixup recursive MI_BB_START for gen3 There's no magic bit0 in MI_BB_START for gen3, it's the same dword length parameter as elsewhere and needs to be zero. v2: Same bug in both live_requests and live_hanghcheck. References: https://bugs.freedesktop.org/show_bug.cgi?id=107132 Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180705154756.5533-1-chris@chris-wilson.co.uk Reviewed-by: Ville Syrjälä commit 693350a7998018391852c48f68956cf0f855b2b9 Author: Will Deacon Date: Tue Jun 19 17:55:28 2018 +0100 arm64: insn: Don't fallback on nosync path for general insn patching Patching kernel instructions at runtime requires other CPUs to undergo a context synchronisation event via an explicit ISB or an IPI in order to ensure that the new instructions are visible. This is required even for "hotpatch" instructions such as NOP and BL, so avoid optimising in this case and always go via stop_machine() when performing general patching. ftrace isn't quite as strict, so it can continue to call the nosync code directly. Signed-off-by: Will Deacon commit 3b8c9f1cdfc506e94e992ae66b68bbe416f89610 Author: Will Deacon Date: Mon Jun 11 14:22:09 2018 +0100 arm64: IPI each CPU after invalidating the I-cache for kernel mappings When invalidating the instruction cache for a kernel mapping via flush_icache_range(), it is also necessary to flush the pipeline for other CPUs so that instructions fetched into the pipeline before the I-cache invalidation are discarded. For example, if module 'foo' is unloaded and then module 'bar' is loaded into the same area of memory, a CPU could end up executing instructions from 'foo' when branching into 'bar' if these instructions were fetched into the pipeline before 'foo' was unloaded. Whilst this is highly unlikely to occur in practice, particularly as any exception acts as a context-synchronizing operation, following the letter of the architecture requires us to execute an ISB on each CPU in order for the new instruction stream to be visible. Acked-by: Catalin Marinas Signed-off-by: Will Deacon commit 7373fed2f258e640031387616a2275a6fc0d7231 Author: Mark Rutland Date: Thu Jul 5 15:16:54 2018 +0100 arm64: remove unused COMPAT_PSR definitions Now that users have been migrated to PSR_AA32, kill the unused COMPAT_PSR definitions. The only difference we need a definition for is COMPAT_PSR_DIT_BIT, which differs from PSR_AA32_DIT_BIT. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 256c0960b7b6453dc90a4e879da52ab76b4037f9 Author: Mark Rutland Date: Thu Jul 5 15:16:53 2018 +0100 kvm/arm: use PSR_AA32 definitions Some code cares about the SPSR_ELx format for exceptions taken from AArch32 to inspect or manipulate the SPSR_ELx value, which is already in the SPSR_ELx format, and not in the AArch32 PSR format. To separate these from cases where we care about the AArch32 PSR format, migrate these cases to use the PSR_AA32_* definitions rather than COMPAT_PSR_*. There should be no functional change as a result of this patch. Note that arm64 KVM does not support a compat KVM API, and always uses the SPSR_ELx format, even for AArch32 guests. Signed-off-by: Mark Rutland Acked-by: Christoffer Dall Acked-by: Marc Zyngier Signed-off-by: Will Deacon commit d64567f67835736d65086e9bfc41a19b2863c32e Author: Mark Rutland Date: Thu Jul 5 15:16:52 2018 +0100 arm64: use PSR_AA32 definitions Some code cares about the SPSR_ELx format for exceptions taken from AArch32 to inspect or manipulate the SPSR_ELx value, which is already in the SPSR_ELx format, and not in the AArch32 PSR format. To separate these from cases where we care about the AArch32 PSR format, migrate these cases to use the PSR_AA32_* definitions rather than COMPAT_PSR_*. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 76fc52bd07d3e9cb708f1a50b60c825c96acd606 Author: Mark Rutland Date: Thu Jul 5 15:16:51 2018 +0100 arm64: ptrace: map SPSR_ELx<->PSR for compat tasks The SPSR_ELx format for exceptions taken from AArch32 is slightly different to the AArch32 PSR format. Map between the two in the compat ptrace code. Signed-off-by: Mark Rutland Fixes: 7206dc93a58fb764 ("arm64: Expose Arm v8.4 features") Cc: Catalin Marinas Cc: Suzuki Poulose Cc: Will Deacon Signed-off-by: Will Deacon commit 25dc2c80cfa33153057aa94984855acd57adf92a Author: Mark Rutland Date: Thu Jul 5 15:16:50 2018 +0100 arm64: compat: map SPSR_ELx<->PSR for signals The SPSR_ELx format for exceptions taken from AArch32 differs from the AArch32 PSR format. Thus, we must translate between the two when setting up a compat sigframe, or restoring context from a compat sigframe. Signed-off-by: Mark Rutland Fixes: 7206dc93a58fb764 ("arm64: Expose Arm v8.4 features") Cc: Catalin Marinas Cc: Suzuki Poulose Cc: Will Deacon Signed-off-by: Will Deacon commit 1265132127b63502d34e0f58c8bdef3a4dc927c2 Author: Mark Rutland Date: Thu Jul 5 15:16:49 2018 +0100 arm64: don't zero DIT on signal return Currently valid_user_regs() treats SPSR_ELx.DIT as a RES0 bit, causing it to be zeroed upon exception return, rather than preserved. Thus, code relying on DIT will not function as expected, and may expose an unexpected timing sidechannel. Let's remove DIT from the set of RES0 bits, such that it is preserved. At the same time, the related comment is updated to better describe the situation, and to take into account the most recent documentation of SPSR_ELx, in ARM DDI 0487C.a. Signed-off-by: Mark Rutland Fixes: 7206dc93a58fb764 ("arm64: Expose Arm v8.4 features") Cc: Catalin Marinas Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Will Deacon commit 25086263425641c74123f9387426c23072b299ea Author: Mark Rutland Date: Thu Jul 5 15:16:48 2018 +0100 arm64: add PSR_AA32_* definitions The AArch32 CPSR/SPSR format is *almost* identical to the AArch64 SPSR_ELx format for exceptions taken from AArch32, but the two have diverged with the addition of DIT, and we need to treat the two as logically distinct. This patch adds new definitions for the SPSR_ELx format for exceptions taken from AArch32, with a consistent PSR_AA32_ prefix. The existing COMPAT_PSR_ definitions will be used for the PSR format as seen from AArch32. Definitions of DIT are provided for both, and inline functions are provided to map between the two formats. Note that for SPSR_ELx, the (RES0) J bit has been re-allocated as the DIT bit. Once users of the COMPAT_PSR definitions have been migrated over to the PSR_AA32 definitions, the (majority of) the former will be removed, so no efforts is made to avoid duplication until then. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Christoffer Dall Cc: Marc Zyngier Cc: Suzuki Poulose Cc: Will Deacon Signed-off-by: Will Deacon commit e3853498f25d4c64a4175b42b6d7625fe0b90038 Author: Geert Uytterhoeven Date: Fri Jun 29 16:51:12 2018 +0200 arm64: dts: renesas: salvator-common: Prefer HSCIF1 over SCIF1 HSCIF is superior to SCIF (larger FIFOs, more accurate and wider supported range of bitrates). Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit b7eba890a228f591fea2889b901267ba5de7839b Author: Andreas Gruenbacher Date: Thu Jun 21 07:42:37 2018 -0500 gfs2: Eliminate redundant ip->i_rgd GFS2 remembers the last rgrp used for allocations in ip->i_rgd. However, block allocations are made by way of a reservations structure, ip->i_res, which keeps the last rgrp in ip->i_res.rs_rgd, and ip->i_res is kept in sync with ip->i_res.rs_rgd, so it's redundant. Get rid of ip->i_rgd and just use ip->i_res.rs_rgd in its place. Based on patches by Robert Peterson. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson commit f68b883e8fad23ed0ac4756d91594809d78678ed Author: Sameer Nanda Date: Wed May 2 17:44:17 2018 +0200 power: supply: add cros-ec USBPD charger driver. This driver gets various bits of information about what is connected to USB PD ports from the EC and converts that into power_supply properties. Signed-off-by: Sameer Nanda Signed-off-by: Enric Balletbo i Serra Acked-by: Lee Jones Signed-off-by: Sebastian Reichel commit 0d08901ba8765134dd1e78b933a79a52b8561f04 Merge: 1d45d2d2fde6 3144dce72b7c Author: Sebastian Reichel Date: Thu Jul 5 17:05:12 2018 +0200 Merge tag 'ib-mfd-v4.19' into psy-next Immutable branch between MFD and power-supply due for the v4.19 merge window Signed-off-by: Sebastian Reichel commit f7ddff54d0a0f068442414b48bec7f22aa777de7 Author: Gustavo A. R. Silva Date: Thu Jul 5 08:06:17 2018 -0500 ASoC: nau8824: use 64-bit arithmetic instead of 32-bit Add suffix ULL to constant 256 in order to give the compiler complete information about the proper arithmetic to use. Notice that such constant is used in a context that expects an expression of type u64 (64 bits, unsigned) and the following expression is currently being evaluated using 32-bit arithmetic: 256 * fs * 2 * mclk_src_scaling[i].param Addresses-Coverity-ID: 1432039 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 7389172fc3ed5c4c6757e853d7d5bd2cfc6d204b Author: Marcus Cooper Date: Wed Jul 4 10:30:03 2018 +0200 ARM: dts: sun8i: h3: Enable dwmac-sun8i on the Beelink X2 The enabling of the EMAC was reverted as there was an issue on how to handle the integrated PHY and it was getting close to the release window (fe45174b72ae ("arm: dts: sunxi: Revert EMAC changes")). When a solution was found, then the changes were restored in 4b236a0fe512 ("arm: dts: sunxi: h3/h5: Restore EMAC changes") and 4904337fe34f ("ARM: dts: sunxi: Restore EMAC changes (boards)"). Unfortunately enabling for the Beelink X2 was missed. This reverts partially commit 6b0e06df5cad (Revert "ARM: dts: sun8i: h3: Enable dwmac-sun8i on the Beelink X2") Signed-off-by: Marcus Cooper Signed-off-by: Maxime Ripard commit e368fc75c190a4ad5853e4ec5a0c8acf86bd5119 Author: Ayan Kumar Halder Date: Tue May 15 17:04:19 2018 +0100 drm/arm/malidp: Added the late system pm functions malidp_pm_suspend_late checks if the runtime status is not suspended and if so, invokes malidp_runtime_pm_suspend which disables the display engine/core interrupts and the clocks. It sets the runtime status as suspended. The difference between suspend() and suspend_late() is as follows:- 1. suspend() makes the device quiescent. In our case, we invoke the DRM helper which disables the CRTC. This would have invoked runtime pm suspend but the system suspend process disables runtime pm. 2. suspend_late() It continues the suspend operations of the drm device which was started by suspend(). In our case, it performs the same functionality as runtime_suspend(). The complimentary functions are resume() and resume_early(). In the case of resume_early(), we invoke malidp_runtime_pm_resume() which enables the clocks and the interrupts. It sets the runtime status as active. If the device was in runtime suspend mode before system suspend was called, pm_runtime_work() will put the device back in runtime suspended mode( after the complete system has been resumed). Signed-off-by: Ayan Kumar Halder Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit f877006d5db49f3615fcee4bd5eb1a56c053d419 Author: Ayan Kumar Halder Date: Tue May 15 17:04:18 2018 +0100 drm/arm/malidp: Set the output_depth register in modeset One needs to store the value of the OUTPUT_DEPTH that one has parsed from device tree, so that it can be restored on system resume. This value is set in the modeset function as this gets reset when the system suspends. Signed-off-by: Ayan Kumar Halder Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit fbcc454e8a350b929cb04fbcfdfa72fab37acf38 Author: Ayan Kumar Halder Date: Tue May 15 17:04:17 2018 +0100 drm/arm/malidp: Enable/disable interrupts in runtime pm Display and scaling engine interrupts need to be disabled when the runtime pm invokes malidp_runtime_pm_suspend(). Conversely, they need to be enabled in malidp_runtime_pm_resume(). This patch depends on: https://lkml.org/lkml/2017/5/15/695 Reported-by: Alexandru-Cosmin Gheorghe Signed-off-by: Alexandru-Cosmin Gheorghe Signed-off-by: Ayan Kumar Halder Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit ff8fc26a764acdf5e0a2f86430bcb96c7b4eebec Author: Ayan Kumar Halder Date: Tue May 15 17:04:16 2018 +0100 drm/arm/malidp: Split malidp interrupt initialization functions. Malidp uses two interrupts ie 1. se_irq - used for memory writeback. and 2. de_irq - used for display output. Extract the hardware initialization part from malidp interrupt registration ie (malidp_de_irq_init()/ malidp_se_irq_init()) into a separate function (ie malidp_de_irq_hw_init()/malidp_se_irq_hw_init()) which will be later invoked from runtime_pm_resume function when it needs to re-enable the interrupts. Signed-off-by: Ayan Kumar Halder Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit 62862cfbb18d10c5f8409f4c8e49c4bbaaf18d3a Author: Ayan Kumar Halder Date: Tue May 15 17:04:15 2018 +0100 drm/arm/malidp: Modified the prototype of malidp irq de-initializers Malidp uses two interrupts ie 1. se_irq - used for memory writeback. and 2. de_irq - used for display output. 'struct drm_device' is being replaced with 'struct malidp_hw_device' as the function argument. The reason being the dependency of malidp_de_irq_fini on 'struct drm_device' needs to be removed so as to enable it to call from functions which receives 'struct malidp_hw_device' as argument. Furthermore, there is no way to retrieve 'struct drm_device' from 'struct malidp_hw_device'. Signed-off-by: Ayan Kumar Halder Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit 613c5c7fc8152866a798c52a5944e4b437b526f5 Author: Alexandru Gheorghe Date: Tue May 15 11:18:50 2018 +0100 drm: mali-dp: Add debugfs file for reporting internal errors Status register contains a lot of bits for reporting internal errors inside Mali DP. Currently, we just silently ignore all of the errors, that doesn't help when we are investigating different bugs, especially on the FPGA models which have a lot of constraints, so we could easily end up in AXI or underrun errors. Add a new file called debug that contains an aggregate of the errors reported by the Mali DP hardware. E.g: [root@alarm ~]# cat /sys/kernel/debug/dri/1/debug [DE] num_errors : 167 [DE] last_error_status : 0x00000001 [DE] last_error_vblank : 385 [SE] num_errors : 3 [SE] last_error_status : 0x00e23001 [SE] last_error_vblank : 201 Changes since v2: - Add lock to protect the errors stats. - Add possibility to reset the error stats by writing anything to the debug file. Signed-off-by: Alexandru Gheorghe Acked-by: Liviu Dudau Signed-off-by: Liviu Dudau commit 0735cfdf0af4d4ffc3743fb75b9ad929dfd37206 Author: Liviu Dudau Date: Fri Jun 15 16:56:09 2018 +0100 drm/mali-dp: Improve writeback handling for DP500. Mali DP500 operates in continuous writeback mode (writes frame content until stopped) and it needs special handling in order to behave like a one-shot writeback engine. The original state machine added for DP500 was a bit fragile, as it did not handle correctly cases where a new atomic commit was in progress when the SE IRQ happens and it would commit some partial updates. Improve the handling by adding a parameter to the set_config_valid() function to clear the config valid bit in hardware before starting a new commit and by introducing a MW_RESTART state in the writeback state machine to cater for the case where a new writeback commit gets submitted while the last one is still being active. Reported-by: Brian Starkey Reviewed-by: Brian Starkey Signed-off-by: Liviu Dudau commit 8cbc5caf36ef7a299b5cbedf55f27fd898d700bf Author: Brian Starkey Date: Thu Nov 2 16:49:51 2017 +0000 drm: mali-dp: Add writeback connector Mali-DP has a memory writeback engine which can be used to write the composition result to a memory buffer. Expose this functionality as a DRM writeback connector on supported hardware. Changes since v1: Daniel Vetter: - Don't require a modeset when writeback routing changes - Make writeback connector always disconnected Changes since v2: - Rebase onto new drm_writeback_connector - Add reset callback, allocating subclassed state Daniel Vetter: - Squash out-fence support into this commit Gustavo Padovan: - Don't signal fence directly from driver (and drop malidp_mw_job) Changes since v3: - Modifications to fit with Mali-DP commit tail changes Signed-off-by: Brian Starkey [rebased and fixed conflicts] Signed-off-by: Mihail Atanassov Signed-off-by: Liviu Dudau commit 09368e32a97587d4e118b800c206b4c86b4db845 Author: Liviu Dudau Date: Thu Apr 12 18:13:26 2018 +0100 drm/mali-dp: Add RGB writeback formats for DP500. Annotate the pixel format matrix for DP500 with the memory-write flag for formats that are supported by the SE memwrite engine. Reviewed-by: Brian Starkey Signed-off-by: Liviu Dudau commit 1cb3cbe732d9bedd4046bbeb2726d1699cdfabce Author: Liviu Dudau Date: Tue Apr 10 17:25:57 2018 +0100 drm/mali-dp: Add writeback support for DP500. Mali DP500 behaves differently from the rest of the Mali DP IP, in that it does not have a one-shot mode and keeps writing the content of the current frame to the provided memory area until stopped. As a way of emulating the one-shot behaviour, we are going to use the CVAL interrupt that is being raised at the start of each frame, during prefetch phase, to act as End-of-Write signal, but with a twist: we are going to disable the memory write engine right after we're notified that it has been enabled, using the knowledge that the bit controlling the enabling will only be acted upon on the next vblank/prefetch. CVAL interrupt will fire durint the next prefetch phase every time the global CVAL bit gets set, so we need a state byte to track the memory write enabling. We also need to pay attention during the disabling of the memory write engine as that requires the CVAL bit to be set in the control register, but we don't want to do that during an atomic commit, as it will write into the hardware a partial state. Reviewed-by: Brian Starkey Signed-off-by: Liviu Dudau commit a67bbbe225c281f441533d55cd9dce5c2ae207a5 Author: Brian Starkey Date: Wed Mar 29 17:42:35 2017 +0100 drm: mali-dp: Add RGB writeback formats for DP550/DP650 Add a layer bit for the SE memory-write, and add it to the pixel format matrix for DP550/DP650. Signed-off-by: Brian Starkey [rebased and fixed conflicts] Signed-off-by: Mihail Atanassov Signed-off-by: Liviu Dudau commit 846c87a068f4b72e200357b899ca4dcc92ef42c4 Author: Liviu Dudau Date: Wed Mar 29 17:42:34 2017 +0100 drm: mali-dp: Add support for writeback on DP550/DP650 Mali-DP display processors are able to write the composition result to a memory buffer via the SE. Add entry points in the HAL for enabling/disabling this feature, and implement support for it on DP650 and DP550. DP500 acts differently and so is omitted from this change. Changes since v3: - Fix missing vsync interrupt for DP550 Signed-off-by: Liviu Dudau Signed-off-by: Brian Starkey [rebased and fixed conflicts] Signed-off-by: Mihail Atanassov commit 0b7510d15e14ba628ab9bacd6516e3f6a35ba21f Author: Ville Syrjälä Date: Thu Jun 28 16:13:15 2018 +0300 drm/tilcdc: Use drm_connector_has_possible_encoder() Use drm_connector_has_possible_encoder() for checking whether the encoder has an associated connector. v2: Replace the drm_for_each_connector_encoder_ids() loop with a simple drm_connector_has_possible_encoder() call Cc: Jyri Sarha Cc: Tomi Valkeinen Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-10-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher Acked-by: Jyri Sarha commit f8222409d1ac7a53de4c89db5a6dc268d523f6c7 Author: Ville Syrjälä Date: Thu Jun 28 16:13:14 2018 +0300 drm/msm: Use drm_connector_has_possible_encoder() Use drm_connector_has_possible_encoder() for checking whether the encoder has an associated connector. v2: Replace the drm_for_each_connector_encoder_ids() loop with a simple drm_connector_has_possible_encoder() call Cc: Rob Clark Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-9-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit 38cb8d96933eb07231073efdcd24a6ffa43b23e6 Author: Ville Syrjälä Date: Thu Jun 28 16:13:13 2018 +0300 drm: Add drm_connector_has_possible_encoder() Add a small helper for checking whether a connector and encoder are associated with each other. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-8-ville.syrjala@linux.intel.com Reviewed-by: Alex Deucher commit 7b71ca249b265fe69ab3152a15bc6c305554a7da Author: Ville Syrjälä Date: Thu Jun 28 16:13:12 2018 +0300 drm/radeon: Use drm_connector_for_each_possible_encoder() Use drm_connector_for_each_possible_encoder() for iterating connector->encoder_ids[]. A bit more convenient not having to deal with the implementation details. v2: Replace drm_for_each_connector_encoder_ids() with drm_connector_for_each_possible_encoder() (Daniel) Cc: Daniel Vetter Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing) Zhou" Cc: Harry Wentland Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-7-ville.syrjala@linux.intel.com commit ddba766dd07e67d0ca70b632d3bbac72234b547e Author: Ville Syrjälä Date: Mon Jul 2 18:29:27 2018 +0300 drm/nouveau: Use drm_connector_for_each_possible_encoder() Use drm_connector_for_each_possible_encoder() for iterating connector->encoder_ids[]. A bit more convenient not having to deal with the implementation details. v2: Replace drm_for_each_connector_encoder_ids() with drm_connector_for_each_possible_encoder() (Daniel) v3: Initialize nv_encoder to NULL to shut up gcc/smatch Cc: Dan Carpenter Cc: Daniel Vetter Cc: Ben Skeggs Cc: nouveau@lists.freedesktop.org Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180702152927.13351-1-ville.syrjala@linux.intel.com commit 98c0e348c09575edccdd63e9d2938f090b0d8739 Author: Ville Syrjälä Date: Thu Jun 28 16:13:10 2018 +0300 drm/amdgpu: Use drm_connector_for_each_possible_encoder() Use drm_connector_for_each_possible_encoder() for iterating connector->encoder_ids[]. A bit more convenient not having to deal with the implementation details. v2: Replace drm_for_each_connector_encoder_ids() with drm_connector_for_each_possible_encoder() (Daniel) Cc: Daniel Vetter Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing) Zhou" Cc: Harry Wentland Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-5-ville.syrjala@linux.intel.com commit 83aefbb887b59df0b3520965c3701e01deacfc52 Author: Ville Syrjälä Date: Thu Jun 28 16:13:09 2018 +0300 drm: Add drm_connector_for_each_possible_encoder() Add a convenience macro for iterating connector->encoder_ids[]. Isolates the users from the implementation details. Note that we don't seem to pass the file_priv down to drm_encoder_find() because encoders apparently don't get leased. No idea why drm_encoder_finc() even takes the file_priv actually. Also use ARRAY_SIZE() when populating the array to avoid spreading knowledge about the array size all over. v2: Hide the drm_encoder_find() in the macro, and rename the macro appropriately (Daniel) v3: Fix kernel docs (Daniel) Cc: Daniel Vetter Reviewed-by: Alex Deucher Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-4-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit 20431c05ae682ff2ad387945738fc129d9751d6e Author: Ville Syrjälä Date: Thu Jun 28 16:13:08 2018 +0300 drm/i915: Nuke intel_mst_best_encoder() With the fb-helper no longer relying on the non-atomic .best_encoder() we can eliminate the hook from the MST encoder. Cc: Daniel Vetter Cc: Dhinakaran Pandiyan Reviewed-by: Daniel Vetter Reviewed-by: Alex Deucher Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-3-ville.syrjala@linux.intel.com commit 0d99889109892396a8164bf6dd178e36d3fe3166 Author: Ville Syrjälä Date: Thu Jun 28 16:13:07 2018 +0300 drm/fb-helper: Eliminate the .best_encoder() usage Instead of using the .best_encoder() hook to figure out whether a given connector+crtc combo will work, let's instead do what userspace does and just iterate over all the encoders for the connector, and then check each crtc against each encoder's possible_crtcs bitmask. v2: Avoid oopsing on NULL encoders (Daniel) s/connector_crtc_ok/connector_has_possible_crtc/ Cc: Dhinakaran Pandiyan Cc: Harry Wentland Cc: Daniel Vetter Reviewed-by: Daniel Vetter Reviewed-by: Alex Deucher Suggested-by: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-2-ville.syrjala@linux.intel.com commit f0d759f038dcced7dfb756dc54c224f09ad062a2 Author: Gustavo A. R. Silva Date: Thu Jun 28 17:35:41 2018 -0500 drm/i915: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 141432 Addresses-Coverity-ID: 141433 Addresses-Coverity-ID: 141434 Addresses-Coverity-ID: 141435 Addresses-Coverity-ID: 141436 Addresses-Coverity-ID: 1357360 Addresses-Coverity-ID: 1357403 Addresses-Coverity-ID: 1357433 Addresses-Coverity-ID: 1392622 Addresses-Coverity-ID: 1415273 Addresses-Coverity-ID: 1435752 Addresses-Coverity-ID: 1441500 Addresses-Coverity-ID: 1454596 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180628223541.GA17665@embeddedor.com commit 27efd2566cb89b7909366dbb88add8fb1e3d24e2 Author: Madhav Chauhan Date: Thu Jul 5 18:31:48 2018 +0530 drm/i915/icl: Define register for DSI PLL This patch adds the new registers and corresponding bit definitions which will be used for programming/enable DSI PLL. v2: Review comments from Jani N - Fix spaces while defining ICL_ESC_CLK_DIV_MASK - Define shift and mask for bitfields. Signed-off-by: Madhav Chauhan Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1530795727-28644-2-git-send-email-madhav.chauhan@intel.com commit be01dc33b7b36fd974275ed91b85fcf2c6ae62aa Author: Sven Eckelmann Date: Thu Jul 5 14:42:49 2018 +0200 batman-adv: fix checkpatch warning about misspelled "cache" commit a2d4df9b673c ("spelling.txt: add more spellings to spelling.txt") introduced the spellcheck of "cache" for checkpatch.pl. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit c91b007ed137c8497fa89993cc6757a8e81ff99b Author: Rodrigo Siqueira Date: Wed May 16 20:56:40 2018 -0300 drm/vkms: Add extra information about vkms Add the following additional information: authors and description in Kconfig. Signed-off-by: Rodrigo Siqueira Reviewed-by: Haneen Mohammed Signed-off-by: Daniel Vetter Signed-off-by: Gustavo Padovan Link: https://patchwork.freedesktop.org/patch/msgid/180770375b0537f1ba1857bdb7fdc71dd201882e.1526514457.git.rodrigosiqueiramelo@gmail.com commit 854502fa0a38dc77c9e855c95d239a8fd50a9b13 Author: Rodrigo Siqueira Date: Wed May 16 20:56:21 2018 -0300 drm/vkms: Add basic CRTC initialization This commit adds the essential infrastructure for around CRTCs which is composed of: a new data struct for output data information, a function for creating planes, and a simple encoder attached to the connector. Finally, due to the introduction of a new initialization function, connectors were moved from vkms_drv.c to vkms_display.c. Signed-off-by: Rodrigo Siqueira Reviewed-by: Haneen Mohammed Signed-off-by: Daniel Vetter Signed-off-by: Gustavo Padovan Link: https://patchwork.freedesktop.org/patch/msgid/b6e27bc6a54f5cb340658fa5969f7b48fbfbf1b7.1526514457.git.rodrigosiqueiramelo@gmail.com commit c04372ea4abd83ec6c86083f2afe9322515ee293 Author: Rodrigo Siqueira Date: Wed May 16 20:55:36 2018 -0300 drm/vkms: Add mode_config initialization Initialize minimum and maximum width and height of the frame buffers with default values. Signed-off-by: Rodrigo Siqueira Reviewed-by: Haneen Mohammed Signed-off-by: Daniel Vetter Signed-off-by: Gustavo Padovan Link: https://patchwork.freedesktop.org/patch/msgid/75c55df671f24b037f9172700b479f4bb2fa7c92.1526514457.git.rodrigosiqueiramelo@gmail.com commit 41111ce17ee7277cb7451e8a21e319220afc130d Author: kbuild test robot Date: Tue May 15 19:30:52 2018 +0800 drm/vkms: vkms_driver can be static Fixes: 58d8108f080c ("drm/vkms: Introduce basic VKMS driver") Signed-off-by: Fengguang Wu Acked-by: Haneen Mohammed Signed-off-by: Daniel Vetter Signed-off-by: Gustavo Padovan Link: https://patchwork.freedesktop.org/patch/msgid/20180515113052.GA111532@lkp-ib04 commit 1c7c5fd916a0ff66501467f1e8e79d3ff8eca112 Author: Haneen Mohammed Date: Mon May 14 17:33:46 2018 +0300 drm/vkms: Introduce basic VKMS driver This patch introduces Virtual Kernel Mode-Setting (VKMS) driver. It creates a very basic kms driver with 1 crtc/encoder/connector/plane. VKMS driver would be useful for testing, or for running X (or similar) on headless machines and be able to still use the GPU. Thus it enables a virtual display without the need for hardware display capability. Signed-off-by: Haneen Mohammed Signed-off-by: Daniel Vetter Signed-off-by: Gustavo Padovan Link: https://patchwork.freedesktop.org/patch/msgid/20180514143346.GA21695@haneen-vb commit 2cc0608e42aceb38abc9e57a017449b9efc2e4a9 Author: Gustavo A. R. Silva Date: Wed Jul 4 17:34:37 2018 -0500 net: core: filter: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 3cc87d03992fc2a2d57b8a76110463fb18a95d72 Author: Gustavo A. R. Silva Date: Wed Jul 4 17:05:00 2018 -0500 net: decnet: dn_nsp_in: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit c53e0c787e672b4edbf719b7c1ec5833db3af2da Author: Gustavo A. R. Silva Date: Wed Jul 4 16:13:59 2018 -0500 tipc: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Acked-by: Ying Xue Signed-off-by: David S. Miller commit dfecc759e64b0ea581468fe2359836f1998deac9 Author: Ganesh Goudar Date: Wed Jul 4 17:49:33 2018 +0530 cxgb4: Fix the condition to check if the card is T5 Use 'chip_ver' rather than 'chip' to check if the card is T5. Fixes: e8d452923ae6 ("cxgb4: clean up init_one") Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 4ed88df766704633459d8fddce1c1c87e1acb844 Author: Colin Ian King Date: Thu Jul 5 12:05:25 2018 +0100 net: ethernet: sun: remove redundant variables adv and lpa and mii_reads Variables adv and lpa are being assigned but are never used hence they are redundant and can be removed. Also remove the unncessary mii_reads too. Cleans up clang warnings: warning: variable 'lpa' set but not used [-Wunused-but-set-variable] warning: variable 'adv' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit a132b5a5081ca106193a02e0835e01db7c4055ec Author: Sjoerd Simons Date: Fri Mar 30 15:15:53 2018 +0200 drm/tilcdc: Defer probe if there are no connectors During probe there may not be any connectors yet if e.g. the panel failed or hasn't been probed yet. I hitting this in practice the panels probing was being delayed due to using a gpio backlight. Fix this by returning -EPROBE_DEFER so the probing will be retried. Signed-off-by: Sjoerd Simons Signed-off-by: Jyri Sarha commit 2727eac605bb4787ae43eff6e022196f5297e329 Merge: 8e15268e3d93 eec8bb138e6e Author: David S. Miller Date: Thu Jul 5 20:05:55 2018 +0900 Merge branch 'net-ethernet-Miscellaneous-Kconfig-and-Makefile-cleanups' Geert Uytterhoeven says: ==================== net: ethernet: Miscellaneous Kconfig and Makefile cleanups This patch series contains a few Kconfig and Makefile cleanups w.r.t. Ethernet vendors. ==================== Signed-off-by: David S. Miller commit eec8bb138e6e8214918f30eb7bdf729236d866a8 Author: Geert Uytterhoeven Date: Wed Jul 4 13:50:13 2018 +0200 net: ethernet: sfc: Make subdir logic consistent with other vendors Both SFC and SFC_FALCON depend on NET_VENDOR_SOLARFLARE, hence use the latter to decide whether to descend into the sfc subdirectory. Move the rule to descend into sfc/falcon to the sfc subdirectory. Signed-off-by: Geert Uytterhoeven Acked-by: Martin Habets Signed-off-by: David S. Miller commit 0df5f81c481e383f37f9f97eb014c885898b1773 Author: Geert Uytterhoeven Date: Wed Jul 4 13:50:12 2018 +0200 net: ethernet: Add missing VENDOR to Cadence and Packet Engines symbols The vendor guard Kconfig symbols for Cadence and Packet Engines use a "NET_" prefix, while all other vendor guards use a "NET_VENDOR_" prefix. Hence make them consistent with the rest, and add the missing trailing "S" for Packet Engines while at it. As these options don't directly affect the kernel build, and default to "y", this change has no impact on kernels built with existing (def)configs. Signed-off-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit 118e96906dd321ac01e02db6d5c02d5b3e92bbe7 Author: Geert Uytterhoeven Date: Wed Jul 4 13:50:11 2018 +0200 net: ethernet: Make NET_VENDOR_AURORA default to yes Enabling NET_VENDOR_* Kconfig options does not directly affect the kernel build. Hence NET_VENDOR_AURORA should default to yes, like other NET_VENDOR_* options. Signed-off-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit 8e15268e3d931944675e6a7ed69c1cda60faa718 Author: Colin Ian King Date: Wed Jul 4 12:45:53 2018 +0100 qlogic: netxen: remove various redundant variables Variables consumer, cmd_desc, end_cnt and no_of_desc are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'consumer' set but not used [-Wunused-but-set-variable] warning: variable 'cmd_desc' set but not used [-Wunused-but-set-variable] warning: variable 'end_cnt' set but not used [-Wunused-but-set-variable] warning: variable 'no_of_desc' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 2e41c380d1078a8c3b7707bf595c834817bf9ffc Merge: 827ad90cfa61 6354b95eb871 Author: David S. Miller Date: Thu Jul 5 19:58:36 2018 +0900 Merge branch 'devlink-Add-configuration-parameters-support' Moshe Shemesh says: ==================== Add configuration parameters support Add configuration parameters setting through devlink. Each device registers supported configuration parameters table. Each parameter can be either generic or driver specific. The user can retrieve data on these parameters by "devlink param show" command and can set new value to a parameter by "devlink param set" command. The parameters can be set in different configuration modes: runtime - set while driver is running, no reset required. driverinit - applied while driver initializes, requires restart driver by devlink reload command. permanent - written to device's non-volatile memory, hard reset required. The patches at the end of the patchset introduce few params that are using the introduced infrastructure on mlx4 and bnxt. Command examples and output: pci/0000:81:00.0: name internal_error_reset type generic values: cmode runtime value true cmode driverinit value true name max_macs type generic values: cmode driverinit value 128 name enable_64b_cqe_eqe type driver-specific values: cmode driverinit value true name enable_4k_uar type driver-specific values: cmode driverinit value false pci/0000:81:00.0: name internal_error_reset type generic values: cmode runtime value false cmode driverinit value true ==================== Signed-off-by: David S. Miller commit 6354b95eb871beee89b8679a1f576fccc132cf90 Author: Vasundhara Volam Date: Wed Jul 4 14:30:37 2018 +0300 bnxt_en: Add bnxt_en initial params table and register it. Create initial devlink parameters table for bnxt_en. Table consists of a permanent generic parameter. enable_sriov - Enables Single-Root Input/Output Virtualization(SR-IOV) characteristic of the device. Reviewed-by: Jiri Pirko Reviewed-by: Michael Chan Signed-off-by: Vasundhara Volam Signed-off-by: David S. Miller commit f567bcdae2b052bab94be7903863cb9ab47c907c Author: Vasundhara Volam Date: Wed Jul 4 14:30:36 2018 +0300 devlink: Add enable_sriov boolean generic parameter enable_sriov - Enables Single-Root Input/Output Virtualization(SR-IOV) characteristic of the device. Reviewed-by: Michael Chan Signed-off-by: Vasundhara Volam Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit dfb3c0821a4435600879b6dc7fb5d9dbf9678475 Author: Moshe Shemesh Date: Wed Jul 4 14:30:35 2018 +0300 mlx4: Add support for devlink reload and load driverinit values Add mlx4_devlink_reload() to support devlink reload operation. Add mlx4_devlink_param_load_driverinit_values() to load values which were set using driverinit configuration mode. Signed-off-by: Moshe Shemesh Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit bd1b51dc66dfe355b67afc94d299f2916136f104 Author: Moshe Shemesh Date: Wed Jul 4 14:30:34 2018 +0300 mlx4: Add mlx4 initial parameters table and register it Create initial parameters table for mlx4. The table consists of two generic parameters and two driver-specific parameters. Generic: internal_err_reset - Enable reset device on internal errors. This parameter can be configured on mlx4 either on runtime or during driver initialization. max_macs - Max number of MACs per ETH port. For mlx4 this parameter value range is between 1 and 128. This parameter can be configured on mlx4 only during driver initialization. Driver specific: enable_64b_cqe_eqe - Enable 64 byte CQEs/EQEs when the FW supports it. This parameter can be configured on mlx4 only during driver initialization. enable_4k_uar - Enable using 4K UAR. This parameter can be configured on mlx4 only during driver initialization. Register the parameters table on mlx4_init_one() and unregister on mlx4_remove_one(). Signed-off-by: Moshe Shemesh Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 036467c3990c75ec8ce97e517a864b52e184a1aa Author: Moshe Shemesh Date: Wed Jul 4 14:30:33 2018 +0300 devlink: Add generic parameters internal_err_reset and max_macs Add 2 first generic parameters to devlink configuration parameters set: internal_err_reset - When set enables reset device on internal errors. max_macs - max number of MACs per ETH port. Signed-off-by: Moshe Shemesh Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit ea601e17098856ee059f35c2a75659e57df81f25 Author: Moshe Shemesh Date: Wed Jul 4 14:30:32 2018 +0300 devlink: Add devlink notifications support for params Add devlink_param_notify() function to support devlink param notifications. Add notification call to devlink param set, register and unregister functions. Add devlink_param_value_changed() function to enable the driver notify devlink on value change. Driver should use this function after value was changed on any configuration mode part to driverinit. Signed-off-by: Moshe Shemesh Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit ec01aeb1803eaaf0d006e7b07b5ddb5e429c38a4 Author: Moshe Shemesh Date: Wed Jul 4 14:30:31 2018 +0300 devlink: Add support for get/set driverinit value "driverinit" configuration mode value is held by devlink to enable the driver query the value after reload. Two additional functions added to help the driver get/set the value from/to devlink: devlink_param_driverinit_value_set() and devlink_param_driverinit_value_get(). Signed-off-by: Moshe Shemesh Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit e3b7ca18ad7b2f47ebd3b6e6ce58a42c6ec24746 Author: Moshe Shemesh Date: Wed Jul 4 14:30:30 2018 +0300 devlink: Add param set command Add param set command to set value for a parameter. Value can be set to any of the supported configuration modes. Signed-off-by: Moshe Shemesh Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 45f05def5c44c806f094709f1c9b03dcecdd54f0 Author: Moshe Shemesh Date: Wed Jul 4 14:30:29 2018 +0300 devlink: Add param get command Add param get command which gets data per parameter. Option to dump the parameters data per device. Signed-off-by: Moshe Shemesh Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit eabaef1896bc06319461a644e3aa139885454def Author: Moshe Shemesh Date: Wed Jul 4 14:30:28 2018 +0300 devlink: Add devlink_param register and unregister Define configuration parameters data structure. Add functions to register and unregister the driver supported configuration parameters table. For each parameter registered, the driver should fill all the parameter's fields. In case the only supported configuration mode is "driverinit" the parameter's get()/set() functions are not required and should be set to NULL, for any other configuration mode, these functions are required and should be set by the driver. Signed-off-by: Moshe Shemesh Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 827ad90cfa6140f86c398a7a8d32d9f319835273 Author: Colin Ian King Date: Thu Jul 5 11:11:07 2018 +0100 net/hamradio/6pack: remove redundant variable channel Variable channel is being assigned but is never used hence it is redundant and can be removed. Cleans up two clang warnings: warning: variable 'channel' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit b67030b139de957f1266555009f5f19feac819c4 Author: Colin Ian King Date: Thu Jul 5 11:05:32 2018 +0100 fjes: use currently unused variable my_epid and max_epid Variables my_epid and max_epid are currently assigned and not being used - however, I suspect they were intended to be used in the for-loops to reduce the dereferencing of hw. Replace hw->my_epid and hw->max_epid with these variables. Cleans up clang warnings: warning: variable 'my_epid' set but not used [-Wunused-but-set-variable] variable 'max_epid' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 2f9be18164add28fa231950e20ad9a978a34f13d Author: Colin Ian King Date: Thu Jul 5 10:55:49 2018 +0100 net: tehuti: remove redundant pointer skb Pointer skb is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'skb' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit e0515b0cbccc69c7fb4d6edc2f25ac1faa20ac0f Author: Colin Ian King Date: Thu Jul 5 10:26:13 2018 +0100 net: socionext: remove redundant pointer ndev Pointer ndev is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'ndev' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit dfbd07497860f32b847bfac0023331947d33aae6 Author: Wei Yongjun Date: Thu Jul 5 09:00:10 2018 +0000 net: aquantia: Make some functions static Fixes the following sparse warnings: drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:525:5: warning: symbol 'hw_atl_utils_mpi_set_speed' was not declared. Should it be static? drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:536:5: warning: symbol 'hw_atl_utils_mpi_set_state' was not declared. Should it be static? Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit e7550b0be3cf1361bcadd629b8ea1c9e749725e4 Author: Wei Yongjun Date: Thu Jul 5 08:59:09 2018 +0000 net: dsa: vsc73xx: Make some functions static Fixes the following sparse warnings: drivers/net/dsa/vitesse-vsc73xx.c:1054:6: warning: symbol 'vsc73xx_get_strings' was not declared. Should it be static? drivers/net/dsa/vitesse-vsc73xx.c:1113:5: warning: symbol 'vsc73xx_get_sset_count' was not declared. Should it be static? drivers/net/dsa/vitesse-vsc73xx.c:1122:6: warning: symbol 'vsc73xx_get_ethtool_stats' was not declared. Should it be static? Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 896e863d6df7df70a5c4ec37800a67e1fb5ae5f0 Author: Colin Ian King Date: Thu Jul 5 09:30:04 2018 +0100 net: dsa: fix spelling mistake "waitting" -> "waiting" Trivial fix to spelling mistake in dev_err error message. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 6312fe77751f57d4fa2b28abeef84c6a95c28136 Author: Li RongQing Date: Thu Jul 5 14:34:32 2018 +0800 net: limit each hash list length to MAX_GRO_SKBS After commit 07d78363dcff ("net: Convert NAPI gro list into a small hash table.")' there is 8 hash buckets, which allows more flows to be held for merging. but MAX_GRO_SKBS, the total held skb for merging, is 8 skb still, limit the hash table performance. keep MAX_GRO_SKBS as 8 skb, but limit each hash list length to 8 skb, not the total 8 skb Signed-off-by: Li RongQing Signed-off-by: David S. Miller commit 0f17d5dd2199555830482b638a5fc8bf915f2f10 Author: Chris Wilson Date: Thu Jul 5 07:56:53 2018 +0100 drm/i915/selftests: Replace open-coded i915_address_space_init() Use i915_address_space_init() rather than open-code it inside mock_ppgtt() as we will forget to keep it in sync. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180705065653.20449-3-chris@chris-wilson.co.uk commit eae4c9445354602926ff7cc4702c2516e2485a94 Author: Chris Wilson Date: Thu Jul 5 07:56:52 2018 +0100 drm/i915/selftests: Use full release for local ppgtt allocation We can now use the full release mechanism (i915_ppgtt_put) for our local ppgtt allocation in igt_ppgtt_alloc. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180705065653.20449-2-chris@chris-wilson.co.uk commit cef08fdc743c4211aeba69dd23408093d59da241 Author: Chris Wilson Date: Thu Jul 5 07:56:51 2018 +0100 drm/i915: Remove defunct i915->vm_list No longer used and can be removed. One less global that currently demands struct_mutex protection. References: e9e7dc4144cd ("drm/i915/gtt: Make gen6 page directories evictable") Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180705065653.20449-1-chris@chris-wilson.co.uk commit 90eb6b59d311e6facd040124cb5b659a865125b8 Author: Daniel Mack Date: Mon Jul 2 17:11:00 2018 +0200 ASoC: pxa-ssp: add support for an external clock in devicetree Allow setting a clock called 'extclk' in the device of the ssp-dai device. If specified, this clock will be set to the mclk rate from the DAI's .set_sysclk() callback. The DAI will also configure itself to use that external clock. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 74b37e299f038c910dc728d736e3f071ba0ead2a Author: Andrew Gabbasov Date: Thu Jul 5 11:20:04 2018 +0900 ASoC: rsnd: cmd: Add missing newline to debug message To comply with the style of all kernel messages, add newline to the end of every message. Fixes: 70fb10529f61 ("ASoC: rsnd: add MIX (Mixer) support") Signed-off-by: Andrew Gabbasov Signed-off-by: Jiada Wang Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown commit b999a7a9e72bd2d37b5d03772cedfc4dd45875bf Author: Gustavo A. R. Silva Date: Wed Jul 4 09:18:33 2018 -0500 ASoC: fsl_spdif: Use 64-bit arithmetic instead of 32-bit Add suffix ULL to constant 64 in order to give the compiler complete information about the proper arithmetic to use. Notice that such constant is used in a context that expects an expression of type u64 (64 bits, unsigned) and the following expression is currently being evaluated using 32-bit arithmetic: rate[index] * txclk_df * 64 Addresses-Coverity-ID: 1222129 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva Acked-by: Nicolin Chen Signed-off-by: Mark Brown commit 314d53d297980676011e6fd83dac60db4a01dc70 Author: Suzuki K Poulose Date: Wed Jul 4 23:07:46 2018 +0100 arm64: Handle mismatched cache type Track mismatches in the cache type register (CTR_EL0), other than the D/I min line sizes and trap user accesses if there are any. Fixes: be68a8aaf925 ("arm64: cpufeature: Fix CTR_EL0 field definitions") Cc: Cc: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 4c4a39dd5fe2d13e2d2fa5fceb8ef95d19fc389a Author: Suzuki K Poulose Date: Wed Jul 4 23:07:45 2018 +0100 arm64: Fix mismatched cache line size detection If there is a mismatch in the I/D min line size, we must always use the system wide safe value both in applications and in the kernel, while performing cache operations. However, we have been checking more bits than just the min line sizes, which triggers false negatives. We may need to trap the user accesses in such cases, but not necessarily patch the kernel. This patch fixes the check to do the right thing as advertised. A new capability will be added to check mismatches in other fields and ensure we trap the CTR accesses. Fixes: be68a8aaf925 ("arm64: cpufeature: Fix CTR_EL0 field definitions") Cc: Cc: Mark Rutland Cc: Catalin Marinas Reported-by: Will Deacon Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 5d168964aece0b4a41269839c613683c5d7e0fb2 Author: Will Deacon Date: Tue Mar 13 21:17:01 2018 +0000 arm64: kconfig: Ensure spinlock fastpaths are inlined if !PREEMPT When running with CONFIG_PREEMPT=n, the spinlock fastpaths fit inside 64 bytes, which typically coincides with the L1 I-cache line size. Inline the spinlock fastpaths, like we do already for rwlocks. Signed-off-by: Will Deacon commit c11090474d70590170cf5fa6afe85864ab494b37 Author: Will Deacon Date: Tue Mar 13 20:45:45 2018 +0000 arm64: locking: Replace ticket lock implementation with qspinlock It's fair to say that our ticket lock has served us well over time, but it's time to bite the bullet and start using the generic qspinlock code so we can make use of explicit MCS queuing and potentially better PV performance in future. Signed-off-by: Will Deacon commit 598865c5f32d6e11e99f2aac07348e5fd17cdc03 Author: Will Deacon Date: Wed Jan 31 15:55:24 2018 +0000 arm64: barrier: Implement smp_cond_load_relaxed We can provide an implementation of smp_cond_load_relaxed using READ_ONCE and __cmpwait_relaxed. Signed-off-by: Will Deacon commit 6fcf9b1d4d6cd38202247de5c0ac7d85c4483abb Author: Heiner Kallweit Date: Wed Jul 4 21:11:29 2018 +0200 r8169: fix runtime suspend When runtime-suspending we configure WoL w/o touching saved_wolopts. If saved_wolopts == 0 we would power down the PHY in this case what's wrong. Therefore we have to check the actual chip WoL settings here. Fixes: 433f9d0ddcc6 ("r8169: improve saved_wolopts handling") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit ec93b62fec9c7138d2b75334d192ecc12376f885 Author: Dave Gerlach Date: Wed Jul 4 20:19:06 2018 -0700 soc: ti: wkup_m3_ipc: Add wkup_m3_request_wake_src Add wkup_m3_request_wake_src to allow users to get the name of the wakeup source after a DeepSleep or Standby transition. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy Signed-off-by: Santosh Shilimkar commit 7a872b6fb7fdc4213e9bb4e1c83a65e6b8af7ebd Author: Keerthy Date: Wed Jul 4 20:19:06 2018 -0700 soc: ti: wkup_m3_ipc: Add rtc_only with ddr in self refresh mode support Adds rtc_only support. This needs resume function to shutdown and reboot the m3. Signed-off-by: Keerthy Signed-off-by: Santosh Shilimkar commit a4ca8b7df73c6d78b8b5aa8246a7d794b25c25ce Author: Edward Cree Date: Wed Jul 4 19:23:50 2018 +0100 net: ipv4: fix drop handling in ip_list_rcv() and ip_list_rcv_finish() Since callees (ip_rcv_core() and ip_rcv_finish_core()) might free or steal the skb, we can't use the list_cut_before() method; we can't even do a list_del(&skb->list) in the drop case, because skb might have already been freed and reused. So instead, take each skb off the source list before processing, and add it to the sublist afterwards if it wasn't freed or stolen. Fixes: 5fa12739a53d net: ipv4: listify ip_rcv_finish Fixes: 17266ee93984 net: ipv4: listified version of ip_rcv Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 0eaec62a91ed9d5694b7e2bff30a1b1ad7107be7 Author: Casey Leedom Date: Wed Jul 4 15:12:56 2018 +0530 cxgb4: Add support to read actual provisioned resources In highly constrained resources environments (like the 124VF T5 and 248VF T6 configurations), PF4 may not have very many resources at all and we need to adapt to whatever we've been allocated, this patch adds support to get the provisioned resources. Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 03f8c41c73da849ec2b73aa678ce6380e8318920 Author: Andreas Gruenbacher Date: Thu Jun 21 07:22:12 2018 -0500 gfs2: Stop messing with ip->i_rgd in the rlist code In the resource group list code, keep the last resource group added in the last position in the array. Check against that instead of messing with ip->i_rgd. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson commit 63fd659fb1a52262a37293a9a034a912a2406b26 Author: Chris Wilson Date: Wed Jul 4 19:55:18 2018 +0100 drm/i915/gtt: Pull global wc page stash under its own locking Currently, the wc-stash used for providing flushed WC pages ready for constructing the page directories is assumed to be protected by the struct_mutex. However, we want to remove this global lock and so must install a replacement global lock for accessing the global wc-stash (the per-vm stash continues to be guarded by the vm). We need to push ahead on this patch due to an oversight in hastily removing the struct_mutex guard around the igt_ppgtt_alloc selftest. No matter, it will prove very useful (i.e. will be required) in the near future. v2: Restore the onstack stash so that we can drop the vm->mutex in future across the allocation. v3: Restore the lost pagevec_init of the onstack allocation, and repaint function names. v4: Reorder init so that we don't try and use i915_address_space before it is ininitialised. Fixes: 1f6f00238abf ("drm/i915/selftests: Drop struct_mutex around lowlevel pggtt allocation") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180704185518.4193-1-chris@chris-wilson.co.uk commit 16659bc53a027f8e4bce6393476849e2bda8b8fa Author: Ville Syrjälä Date: Mon Jun 11 23:02:58 2018 +0300 drm/i915: Unmask and enable master error interrupt on gen2/3 For whatever reason we only unmask and enable the master error interrut on gen4. With the EIR handling fixed let's do that on gen2/3 as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180611200258.27121-4-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit 78c357dd3fcf51de61a0b8db3abdb8ed5aea6dd8 Author: Ville Syrjälä Date: Mon Jun 11 23:02:57 2018 +0300 drm/i915: Fix pre-ILK error interrupt ack Adjust the EIR clearing to cope with the edge triggered IIR on i965/g4x. To guarantee an edge in the ISR master error bit we temporarily mask everything in EMR. As some of the EIR bits can't even be directly cleared we also borrow a trick from i915_clear_error_registers() and permanently mask any bit that remains high. No real thought given to how we might unmask them again once the cause for the error has been clered. I suppose on pre-g4x GPU reset will reinitialize EMR from scratch. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180611200258.27121-3-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit 0ba7c51a6fd80a89236f6ceb52e63f8a7f62bfd3 Author: Ville Syrjälä Date: Thu Jun 14 20:56:25 2018 +0300 drm/i915: Fix hotplug irq ack on i965/g4x Just like with PIPESTAT, the edge triggered IIR on i965/g4x also causes problems for hotplug interrupts. To make sure we don't get the IIR port interrupt bit stuck low with the ISR bit high we must force an edge in ISR. Unfortunately we can't borrow the PIPESTAT trick and toggle the enable bits in PORT_HOTPLUG_EN as that act itself generates hotplug interrupts. Instead we just have to loop until we've cleared PORT_HOTPLUG_STAT, or we just give up and WARN. v2: Don't frob with PORT_HOTPLUG_EN Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180614175625.1615-1-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit 422e3d37ed7ea8b421208a44913c420055334976 Author: Jason Gunthorpe Date: Wed Jul 4 08:50:31 2018 +0300 RDMA/uverbs: Combine MIN_SZ_OR_ZERO with UVERBS_ATTR_STRUCT After all the rework is done it is now possible to include single flags in the type macros. Any user of UVERBS_ATTR_STRUCT needs to zero check data past the end of the known struct to be correct, so make this mandatory, and get rid of MIN_SZ_OR_ZERO as a user flag. This changes UVERBS_ATTR_TYPE to refer to a struct of exact size with not possibility of extension, convert the few users of UVERBS_ATTR_TYPE and MIN_SZ_OR_ZERO to use UVERBS_ATTR_STRUCT. The one user of UVERBS_ATTR_STRUCT without MIN_SZ_OR_ZERO is just confused. There is some padding at the end of that struct, but userspace always provides it with the padding. The construction doesn't test if the padding is zero, so it is pointless. Just use UVERBS_ATTR_TYPE. Finally, rename min_sz_or_zero to zero_trailing to better reflect what it does and hopefully avoid such mis-uses in the future. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 540cd69209682a351ab76b83b85ea856b8192720 Author: Jason Gunthorpe Date: Wed Jul 4 08:50:30 2018 +0300 RDMA/uverbs: Use UVERBS_ATTR_MIN_SIZE correctly and uniformly This newer macro allows specifying a lower bound on the accepted size, and has an 'unlimited' upper bound. Due to this it never checks for trailing zeroing so it doesn't make any sense to combine it with MIN_SZ_OR_ZERO, so drop MIN_SZ_OR_ZERO when they are used together There were a couple of places that open coded this pattern, switch them to use the clearer UVERBS_ATTR_MIN_SIZE for clarity. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 83bb4442330f035bd68ec5d2f5b87bfef1c1a4ab Author: Jason Gunthorpe Date: Wed Jul 4 08:50:29 2018 +0300 RDMA/uverbs: Remove UA_FLAGS This bit of boilerplate isn't really necessary, we can use bitfields instead of a flags enum and the macros can then individually initialize them through the __VA_ARGS__ like everything else. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 9a119cd597769e0dd432110361ed1deec729ac06 Author: Jason Gunthorpe Date: Wed Jul 4 08:50:28 2018 +0300 RDMA/uverbs: Get rid of the & in method specifications Hide it inside the macros. The & is confusing and interferes with using this as a generic DSL in later patches. Since this also touches almost every line, also run the specs through clang-format (with 'BinPackParameters: false') to make the maintenance easier. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 6c61d2a55c4e5980e231fac9bb54e6ff1a5e811b Author: Jason Gunthorpe Date: Wed Jul 4 08:50:27 2018 +0300 RDMA/uverbs: Simplify UVERBS_OBJECT and _TREE family of macros Instead of the large set of indirecting macros, define the few needed macros to directly instantiate the struct uverbs_oject_tree_def and associated objects list. This is small amount of code duplication but the readability is far better. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 595c7736d48037d67e7926f5d3ebf484b95b1d13 Author: Jason Gunthorpe Date: Wed Jul 4 08:50:26 2018 +0300 RDMA/uverbs: Simplify method definition macros Instead of the large set of indirecting macros, define the few needed macros to directly instantiate the struct uverbs_method_def and associated attributes list. This is small amount of code duplication but the readability is far better. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit d108dac08085b6fe3947df9625c76fc9f66c1bbb Author: Jason Gunthorpe Date: Wed Jul 4 08:50:25 2018 +0300 RDMA/uverbs: Simplify UVERBS_ATTR family of macros Instead of using a complex cascade of macros, just directly provide the initializer list each of the declarations is trying to create. Now that the macros are simplified this also reworks the uverbs_attr_spec to be friendly to older compilers by eliminating any unnamed structures/unions inside, and removing the duplication of some fields. The structure size remains at 16 bytes which was the original motivation for some of this oddness. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit ad544cfe54cbd1b0b68c620a371ebcde6a3264eb Author: Jason Gunthorpe Date: Wed Jul 4 08:50:24 2018 +0300 RDMA/uverbs: Split UVERBS_ATTR_FLOW_ACTION_ESP_HANDLE Two methods are sharing the same attribute constant, but the attribute definitions are not the same. This should not have been done, instead split them into two attributes with the same number. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 87fc2a620a398e970872064841b0db7cc6d0149f Author: Jason Gunthorpe Date: Wed Jul 4 08:50:23 2018 +0300 RDMA/uverbs: Store the specs_root in the struct ib_uverbs_device The specs are required to operate the uverbs file, so they belong inside the ib_uverbs_device, not inside the ib_device. The spec passed in the ib_device is just a communication from the driver and should not be used during runtime. This also changes the lifetime of the spec memory to match the ib_uverbs_device, however at this time the spec_root can still contain driver pointers after disassociation, so it cannot be used if ib_dev is NULL. This is preparation for another series. Signed-off-by: Jason Gunthorpe Reviewed-by: Michael J. Ruhl Signed-off-by: Leon Romanovsky commit 5e0fb5df2ee871b841f96f9cb6a7f2784e96aa4e Author: Toshi Kani Date: Wed Jun 27 08:13:48 2018 -0600 x86/mm: Add TLB purge to free pmd/pte page interfaces ioremap() calls pud_free_pmd_page() / pmd_free_pte_page() when it creates a pud / pmd map. The following preconditions are met at their entry. - All pte entries for a target pud/pmd address range have been cleared. - System-wide TLB purges have been peformed for a target pud/pmd address range. The preconditions assure that there is no stale TLB entry for the range. Speculation may not cache TLB entries since it requires all levels of page entries, including ptes, to have P & A-bits set for an associated address. However, speculation may cache pud/pmd entries (paging-structure caches) when they have P-bit set. Add a system-wide TLB purge (INVLPG) to a single page after clearing pud/pmd entry's P-bit. SDM 4.10.4.1, Operation that Invalidate TLBs and Paging-Structure Caches, states that: INVLPG invalidates all paging-structure caches associated with the current PCID regardless of the liner addresses to which they correspond. Fixes: 28ee90fe6048 ("x86/mm: implement free pmd/pte page interfaces") Signed-off-by: Toshi Kani Signed-off-by: Thomas Gleixner Cc: mhocko@suse.com Cc: akpm@linux-foundation.org Cc: hpa@zytor.com Cc: cpandya@codeaurora.org Cc: linux-mm@kvack.org Cc: linux-arm-kernel@lists.infradead.org Cc: Joerg Roedel Cc: stable@vger.kernel.org Cc: Andrew Morton Cc: Michal Hocko Cc: "H. Peter Anvin" Cc: Link: https://lkml.kernel.org/r/20180627141348.21777-4-toshi.kani@hpe.com commit 785a19f9d1dd8a4ab2d0633be4656653bd3de1fc Author: Chintan Pandya Date: Wed Jun 27 08:13:47 2018 -0600 ioremap: Update pgtable free interfaces with addr The following kernel panic was observed on ARM64 platform due to a stale TLB entry. 1. ioremap with 4K size, a valid pte page table is set. 2. iounmap it, its pte entry is set to 0. 3. ioremap the same address with 2M size, update its pmd entry with a new value. 4. CPU may hit an exception because the old pmd entry is still in TLB, which leads to a kernel panic. Commit b6bdb7517c3d ("mm/vmalloc: add interfaces to free unmapped page table") has addressed this panic by falling to pte mappings in the above case on ARM64. To support pmd mappings in all cases, TLB purge needs to be performed in this case on ARM64. Add a new arg, 'addr', to pud_free_pmd_page() and pmd_free_pte_page() so that TLB purge can be added later in seprate patches. [toshi.kani@hpe.com: merge changes, rewrite patch description] Fixes: 28ee90fe6048 ("x86/mm: implement free pmd/pte page interfaces") Signed-off-by: Chintan Pandya Signed-off-by: Toshi Kani Signed-off-by: Thomas Gleixner Cc: mhocko@suse.com Cc: akpm@linux-foundation.org Cc: hpa@zytor.com Cc: linux-mm@kvack.org Cc: linux-arm-kernel@lists.infradead.org Cc: Will Deacon Cc: Joerg Roedel Cc: stable@vger.kernel.org Cc: Andrew Morton Cc: Michal Hocko Cc: "H. Peter Anvin" Cc: Link: https://lkml.kernel.org/r/20180627141348.21777-3-toshi.kani@hpe.com commit f967db0b9ed44ec3057a28f3b28efc51df51b835 Author: Toshi Kani Date: Wed Jun 27 08:13:46 2018 -0600 x86/mm: Disable ioremap free page handling on x86-PAE ioremap() supports pmd mappings on x86-PAE. However, kernel's pmd tables are not shared among processes on x86-PAE. Therefore, any update to sync'd pmd entries need re-syncing. Freeing a pte page also leads to a vmalloc fault and hits the BUG_ON in vmalloc_sync_one(). Disable free page handling on x86-PAE. pud_free_pmd_page() and pmd_free_pte_page() simply return 0 if a given pud/pmd entry is present. This assures that ioremap() does not update sync'd pmd entries at the cost of falling back to pte mappings. Fixes: 28ee90fe6048 ("x86/mm: implement free pmd/pte page interfaces") Reported-by: Joerg Roedel Signed-off-by: Toshi Kani Signed-off-by: Thomas Gleixner Cc: mhocko@suse.com Cc: akpm@linux-foundation.org Cc: hpa@zytor.com Cc: cpandya@codeaurora.org Cc: linux-mm@kvack.org Cc: linux-arm-kernel@lists.infradead.org Cc: stable@vger.kernel.org Cc: Andrew Morton Cc: Michal Hocko Cc: "H. Peter Anvin" Cc: Link: https://lkml.kernel.org/r/20180627141348.21777-2-toshi.kani@hpe.com commit 8193abb6a8171c775503acd041eb957cc7e9e7f4 Merge: c1dfc0114c90 25bb36e75d7d Author: Jason Gunthorpe Date: Wed Jul 4 13:19:46 2018 -0600 Merge branch 'mlx5-dump-fill-mkey' into rdma.git for-next For dependencies, branch based on 'mellanox/mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git Pull Dump and fill MKEY from Leon Romanovsky: ==================== MLX5 IB HCA offers the memory key, dump_fill_mkey to increase performance, when used in a send or receive operations. It is used to force local HCA operations to skip the PCI bus access, while keeping track of the processed length in the ibv_sge handling. In this three patch series, we expose various bits in our HW spec file (mlx5_ifc.h), move unneeded for mlx5_core FW command and export such memory key to user space thought our mlx5-abi header file. ==================== Botched auto-merge in mlx5_ib_alloc_ucontext() resolved by hand. * branch 'mlx5-dump-fill-mkey': IB/mlx5: Expose dump and fill memory key net/mlx5: Add hardware definitions for dump_fill_mkey net/mlx5: Limit scope of dump_fill_mkey function net/mlx5: Rate limit errors in command interface Signed-off-by: Jason Gunthorpe commit 25bb36e75d7d62dc14ae2306dca38d672e0c3fa0 Author: Yonatan Cohen Date: Tue Jun 19 08:47:24 2018 +0300 IB/mlx5: Expose dump and fill memory key MLX5 IB HCA offers the memory key, dump_fill_mkey to boost performance, when used in a send or receive operations. It is used to force local HCA operations to skip the PCI bus access, while keeping track of the processed length in the ibv_sge handling. Meaning, instead of a PCI write access the HCA leaves the target memory untouched, and skips filling that packet section. Similar behavior is done upon send, the HCA skips data in memory relevant to this key and saves PCI bus access. This functionality saves PCI read/write operations. Signed-off-by: Yonatan Cohen Reviewed-by: Yishai Hadas Reviewed-by: Guy Levi Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b183ee27f5fb07c8428e2fe45d5f35dac611c45d Author: Leon Romanovsky Date: Tue Jun 19 08:47:23 2018 +0300 net/mlx5: Add hardware definitions for dump_fill_mkey MLX5 IB HCA offers the memory key, dump_fill_mkey to boost performance by forcing local HCA operations to skip the PCI bus access, This patch adds needed hardware definitions. Signed-off-by: Leon Romanovsky commit 4d4fb5dc988a36307711be292bde6e39b8bdbceb Author: Yonatan Cohen Date: Tue Jun 19 08:47:22 2018 +0300 net/mlx5: Limit scope of dump_fill_mkey function mlx5_core_dump_fill_mkey() is going to be used in next patch in IB and doesn't need to be visible to whole mlx5_core. Move that command to mlx5_ib. Signed-off-by: Yonatan Cohen Signed-off-by: Leon Romanovsky commit 390d975e0c4e60ce70d4157e0dd91ede37824603 Author: Konrad Rzeszutek Wilk Date: Thu Jun 28 17:10:36 2018 -0400 x86/KVM/VMX: Use MSR save list for IA32_FLUSH_CMD if required If the L1D flush module parameter is set to 'always' and the IA32_FLUSH_CMD MSR is available, optimize the VMENTER code with the MSR save list. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit 989e3992d2eca32c3f1404f2bc91acda3aa122d8 Author: Konrad Rzeszutek Wilk Date: Wed Jun 20 22:01:22 2018 -0400 x86/KVM/VMX: Extend add_atomic_switch_msr() to allow VMENTER only MSRs The IA32_FLUSH_CMD MSR needs only to be written on VMENTER. Extend add_atomic_switch_msr() with an entry_only parameter to allow storing the MSR only in the guest (ENTRY) MSR array. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit 3190709335dd31fe1aeeebfe4ffb6c7624ef971f Author: Konrad Rzeszutek Wilk Date: Wed Jun 20 22:00:47 2018 -0400 x86/KVM/VMX: Separate the VMX AUTOLOAD guest/host number accounting This allows to load a different number of MSRs depending on the context: VMEXIT or VMENTER. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit ca83b4a7f2d068da79a029d323024aa45decb250 Author: Konrad Rzeszutek Wilk Date: Wed Jun 20 20:11:39 2018 -0400 x86/KVM/VMX: Add find_msr() helper function .. to help find the MSR on either the guest or host MSR list. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit 33966dd6b2d2c352fae55412db2ea8cfff5df13a Author: Konrad Rzeszutek Wilk Date: Wed Jun 20 13:58:37 2018 -0400 x86/KVM/VMX: Split the VMX MSR LOAD structures to have an host/guest numbers There is no semantic change but this change allows an unbalanced amount of MSRs to be loaded on VMEXIT and VMENTER, i.e. the number of MSRs to save or restore on VMEXIT or VMENTER may be different. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit c595ceee45707f00f64f61c54fb64ef0cc0b4e85 Author: Paolo Bonzini Date: Mon Jul 2 13:07:14 2018 +0200 x86/KVM/VMX: Add L1D flush logic Add the logic for flushing L1D on VMENTER. The flush depends on the static key being enabled and the new l1tf_flush_l1d flag being set. The flags is set: - Always, if the flush module parameter is 'always' - Conditionally at: - Entry to vcpu_run(), i.e. after executing user space - From the sched_in notifier, i.e. when switching to a vCPU thread. - From vmexit handlers which are considered unsafe, i.e. where sensitive data can be brought into L1D: - The emulator, which could be a good target for other speculative execution-based threats, - The MMU, which can bring host page tables in the L1 cache. - External interrupts - Nested operations that require the MMU (see above). That is vmptrld, vmptrst, vmclear,vmwrite,vmread. - When handling invept,invvpid [ tglx: Split out from combo patch and reduced to a single flag ] Signed-off-by: Paolo Bonzini Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit 3fa045be4c720146b18a19cea7a767dc6ad5df94 Author: Paolo Bonzini Date: Mon Jul 2 13:03:48 2018 +0200 x86/KVM/VMX: Add L1D MSR based flush 336996-Speculative-Execution-Side-Channel-Mitigations.pdf defines a new MSR (IA32_FLUSH_CMD aka 0x10B) which has similar write-only semantics to other MSRs defined in the document. The semantics of this MSR is to allow "finer granularity invalidation of caching structures than existing mechanisms like WBINVD. It will writeback and invalidate the L1 data cache, including all cachelines brought in by preceding instructions, without invalidating all caches (eg. L2 or LLC). Some processors may also invalidate the first level level instruction cache on a L1D_FLUSH command. The L1 data and instruction caches may be shared across the logical processors of a core." Use it instead of the loop based L1 flush algorithm. A copy of this document is available at https://bugzilla.kernel.org/show_bug.cgi?id=199511 [ tglx: Avoid allocating pages when the MSR is available ] Signed-off-by: Paolo Bonzini Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit a47dd5f06714c844b33f3b5f517b6f3e81ce57b5 Author: Paolo Bonzini Date: Mon Jul 2 12:47:38 2018 +0200 x86/KVM/VMX: Add L1D flush algorithm To mitigate the L1 Terminal Fault vulnerability it's required to flush L1D on VMENTER to prevent rogue guests from snooping host memory. CPUs will have a new control MSR via a microcode update to flush L1D with a single MSR write, but in the absence of microcode a fallback to a software based flush algorithm is required. Add a software flush loop which is based on code from Intel. [ tglx: Split out from combo patch ] [ bpetkov: Polish the asm code ] Signed-off-by: Paolo Bonzini Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit a399477e52c17e148746d3ce9a483f681c2aa9a0 Author: Konrad Rzeszutek Wilk Date: Mon Jul 2 12:29:30 2018 +0200 x86/KVM/VMX: Add module argument for L1TF mitigation Add a mitigation mode parameter "vmentry_l1d_flush" for CVE-2018-3620, aka L1 terminal fault. The valid arguments are: - "always" L1D cache flush on every VMENTER. - "cond" Conditional L1D cache flush, explained below - "never" Disable the L1D cache flush mitigation "cond" is trying to avoid L1D cache flushes on VMENTER if the code executed between VMEXIT and VMENTER is considered safe, i.e. is not bringing any interesting information into L1D which might exploited. [ tglx: Split out from a larger patch ] Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit 26acfb666a473d960f0fd971fe68f3e3ad16c70b Author: Konrad Rzeszutek Wilk Date: Wed Jun 20 11:29:53 2018 -0400 x86/KVM: Warn user if KVM is loaded SMT and L1TF CPU bug being present If the L1TF CPU bug is present we allow the KVM module to be loaded as the major of users that use Linux and KVM have trusted guests and do not want a broken setup. Cloud vendors are the ones that are uncomfortable with CVE 2018-3620 and as such they are the ones that should set nosmt to one. Setting 'nosmt' means that the system administrator also needs to disable SMT (Hyper-threading) in the BIOS, or via the 'nosmt' command line parameter, or via the /sys/devices/system/cpu/smt/control. See commit 05736e4ac13c ("cpu/hotplug: Provide knobs to control SMT"). Other mitigations are to use task affinity, cpu sets, interrupt binding, etc - anything to make sure that _only_ the same guests vCPUs are running on sibling threads. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit c1dfc0114c901b4f46c85ceff0491debf2b2a2ec Author: Dan Carpenter Date: Wed Jul 4 12:58:02 2018 +0300 RDMA/bnxt_re: Fix a bunch of off by one bugs in qplib_fp.c The srq->swq[] is allocated in bnxt_qplib_create_srq(). It has srq->hwq.max_elements elements so these tests should be > instead of >= or we might go beyond the end of the array. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Dan Carpenter Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 474e5a86067e5f12c97d1db8b170c7f45b53097a Author: Dan Carpenter Date: Wed Jul 4 12:57:11 2018 +0300 RDMA/bnxt_re: Fix a couple off by one bugs The sgid_tbl->tbl[] array is allocated in bnxt_qplib_alloc_sgid_tbl(). It has sgid_tbl->max elements. So the > should be >= to prevent accessing one element beyond the end of the array. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Dan Carpenter Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit c2d7c8ff89b22ddefb1ac2986c0d48444a667689 Author: Dan Carpenter Date: Wed Jul 4 12:32:12 2018 +0300 IB/core: type promotion bug in rdma_rw_init_one_mr() "nents" is an unsigned int, so if ib_map_mr_sg() returns a negative error code then it's type promoted to a high unsigned int which is treated as success. Fixes: a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API") Signed-off-by: Dan Carpenter Signed-off-by: Jason Gunthorpe commit e543a245cbe08a47a742500ea72aadf85f537ed8 Author: Or Gerlitz Date: Tue Jul 3 18:02:37 2018 +0300 MAINTAINERS: Moving out... The 2.6.18... was a hell of a ride, and by now both me and Roi are not dealing with iser any more. Max will replace us as maintainer, good luck to you dear! Signed-off-by: Or Gerlitz Acked-by: Sagi Grimberg Signed-off-by: Jason Gunthorpe commit 5d9a2b0e28759e319a623da33940dbb3ce952b7d Author: Leon Romanovsky Date: Sun Jul 1 19:36:24 2018 +0300 RDMA/i40w: Hold read semaphore while looking after VMA VMA lookup is supposed to be performed while mmap_sem is held. Fixes: f26c7c83395b ("i40iw: Add 2MB page support") Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f1228867adaf8890826f2b59e4caddb1c5cc2df7 Author: Tarick Bedeir Date: Mon Jul 2 14:02:34 2018 -0700 IB/mlx4: Test port number before querying type. rdma_ah_find_type() can reach into ib_device->port_immutable with a potentially out-of-bounds port number, so check that the port number is valid first. Fixes: 44c58487d51a ("IB/core: Define 'ib' and 'roce' rdma_ah_attr types") Signed-off-by: Tarick Bedeir Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 76f4e2da45b44bf70f61c28fcbc91668492463e0 Author: Mark Rutland Date: Mon Jul 2 14:17:53 2018 +0100 arm64: kexec: always reset to EL2 if present Currently machine_kexec() doesn't reset to EL2 in the case of a crashdump kernel. This leaves potentially dodgy state active at EL2, and means that if the crashdump kernel attempts to online secondary CPUs, these will be booted as mismatched ELs. Let's reset to EL2, as we do in all other cases, and simplify things. If EL2 state is corrupt, things are already sufficiently bad that kdump is unlikely to work, and it's best-effort regardless. Cc: Catalin Marinas Cc: James Morse Acked-by: Marc Zyngier Signed-off-by: Mark Rutland Signed-off-by: Will Deacon commit 7e7df71fd57ff2894d96abb0080922bf39460a79 Author: Mikulas Patocka Date: Thu Jun 14 14:58:21 2018 -0400 arm64: fix infinite stacktrace I've got this infinite stacktrace when debugging another problem: [ 908.795225] INFO: rcu_preempt detected stalls on CPUs/tasks: [ 908.796176] 1-...!: (1 GPs behind) idle=952/1/4611686018427387904 softirq=1462/1462 fqs=355 [ 908.797692] 2-...!: (1 GPs behind) idle=f42/1/4611686018427387904 softirq=1550/1551 fqs=355 [ 908.799189] (detected by 0, t=2109 jiffies, g=130, c=129, q=235) [ 908.800284] Task dump for CPU 1: [ 908.800871] kworker/1:1 R running task 0 32 2 0x00000022 [ 908.802127] Workqueue: writecache-writeabck writecache_writeback [dm_writecache] [ 908.820285] Call trace: [ 908.824785] __switch_to+0x68/0x90 [ 908.837661] 0xfffffe00603afd90 [ 908.844119] 0xfffffe00603afd90 [ 908.850091] 0xfffffe00603afd90 [ 908.854285] 0xfffffe00603afd90 [ 908.863538] 0xfffffe00603afd90 [ 908.865523] 0xfffffe00603afd90 The machine just locked up and kept on printing the same line over and over again. This patch fixes it. Signed-off-by: Mikulas Patocka Signed-off-by: Will Deacon commit 7c1b9a5aeed91bef98988ac0fcf38c8c1f4f9a3a Author: Sylwester Nawrocki Date: Tue May 15 05:21:45 2018 -0400 media: exynos4-is: Prevent NULL pointer dereference in __isp_video_try_fmt() This patch fixes potential NULL pointer dereference as indicated by the following static checker warning: drivers/media/platform/exynos4-is/fimc-isp-video.c:408 isp_video_try_fmt_mplane() error: NULL dereference inside function '__isp_video_try_fmt(isp, &f->fmt.pix_mp, (0))()'. Fixes: 34947b8aebe3: ("[media] exynos4-is: Add the FIMC-IS ISP capture DMA driver") Reported-by: Dan Carpenter Signed-off-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab commit 381a2c6fb9c5e7d31e2caae48ced6e6e2273e5f3 Author: Sebastian Andrzej Siewior Date: Wed Jul 4 15:01:06 2018 +0000 Input: iforce - use GFP_KERNEL in iforce_get_id_packet() iforce_get_id_packet() invokes wait_event_interruptible_timeout() which means it has to be in non-atomic context at that point, thus we can use GFP_KERNEL instead of GFP_ATOMIC. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Dmitry Torokhov commit f9e02d80416933b0e07d57efecbe309bdea9c6c4 Author: Chen Zhong Date: Wed Jul 4 15:19:05 2018 +0000 dt-bindings: input: add common keyboard document bindings This patch adds the device tree binding documentation for common keyboard. Acked-by: Rob Herring Signed-off-by: Chen Zhong Signed-off-by: Dmitry Torokhov commit 4f0794c0ac0898a009fbce3db647092976484ee1 Author: Colin Ian King Date: Wed Jul 4 15:53:42 2018 +0000 Input: cros_ec_keyb - remove redundant variable num_cols Variable num_cols is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable ‘num_cols’ set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Dmitry Torokhov commit fd8135b6f80a4d2ea2e398fb33e38ec255037111 Author: Daniel Mack Date: Wed Jul 4 15:46:55 2018 +0000 Input: eeti - fix link to documentation and email address in header Keep the documentation link up-to-date in case anybody need to dive into it again, and update email address while at it. Signed-off-by: Daniel Mack Signed-off-by: Dmitry Torokhov commit a114cbd00afe7afa3a6403fb025632ba6b47b443 Author: Daniel Mack Date: Wed Jul 4 15:46:22 2018 +0000 Input: eeti - drop module parameters, parse DT properties The only user of this driver in mainline does not make use of the module parameters, so let's remove them. All properties for this driver should be set through DT or pdata. Use touchscreen_parse_properties() to automatically set some of the common touchscreen properties and derive the axis inversion through that. And finally, use touchscreen_report_pos() to handle the DT properties automatically instead of doing the inversion ourselves. Signed-off-by: Daniel Mack Signed-off-by: Dmitry Torokhov commit e32d7f1b246c1aef7b2d4f9fe0ce8863ac21128c Author: Daniel Mack Date: Wed Jul 4 15:45:47 2018 +0000 Input: eeti - add device tree matching table Provide a match table so that the driver can be used in devicetree setups. More properties are added in a later patch. Signed-off-by: Daniel Mack Signed-off-by: Dmitry Torokhov commit 7f40a478c1d0e2c24428b34f4d2ee90d33489c66 Author: Daniel Mack Date: Wed Jul 4 15:44:39 2018 +0000 dt-bindings: input: touchscreen: add bindings for eeti touchscreen controller Describe the bindings for EETI touchscreen controllers. Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Signed-off-by: Dmitry Torokhov commit 666e994aa2278e948e2492ee9d81b4df241e7222 Author: Wolfram Sang Date: Thu Apr 19 10:05:57 2018 -0400 media: platform: s5p-mfc: simplify getting .drvdata We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang Acked-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab commit c51756d56e20a12476e4e192b332fac39c1550ca Author: Kees Cook Date: Fri Jun 29 11:47:40 2018 -0700 drm/sun4i: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this switches to using a kmalloc allocation and moves all the size calculations to the start to do an allocation. If an upper bounds on the mode timing calculations could be determined, a fixed stack size could be used instead. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180629184740.GA37415@beast commit 2473394343c338426689476aec42790e6d40731c Author: Wolfram Sang Date: Thu Apr 19 10:05:56 2018 -0400 media: platform: exynos4-is: simplify getting .drvdata We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang Acked-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab commit 4a07ed51cae18765c76d9aede5b9830d42db1546 Author: Lorenzo Bianconi Date: Fri Jun 29 13:40:55 2018 +0200 mt76x2: debugfs: add sw pulse statistics to dfs debugfs Add sw pattern detector statistics to mt76x2 debugfs. Moreover track down number of allocated sequence by the detector Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit b7384e4e0d564a6d898b7f9b68e3ba7e619fcdc1 Author: Lorenzo Bianconi Date: Fri Jun 29 13:40:54 2018 +0200 mt76x2: dfs: add sw pattern detector Add sw DFS pattern detector support for mt76x2 based devices. Dfs pattern supported: - short pulse radar patterns - staggered radar patterns Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 1fc9bc9ab501cf31119e959379f158280f2a8ea1 Author: Lorenzo Bianconi Date: Fri Jun 29 13:40:53 2018 +0200 mt76x2: dfs: add sw event ring buffer Introduce sw event ring buffer to queue DFS pulses loaded from the hw. Radar pulses will be used in DFS sw detector Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit ee8aa945e4ae94f2928ef1c2af340a655f16dfcc Author: Lorenzo Bianconi Date: Fri Jun 29 13:40:52 2018 +0200 mt76: introduce mt76_{incr,decr} utility routines Add mt76_{incr,decr} utility routines to increment/decrement a value with wrap-around (they will be used by mt76x2 DFS sw detector) Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit f9cbaeb52930342059429f56d0b9f05c8d54c0ba Author: YueHaibing Date: Sat Jun 30 14:33:41 2018 +0800 atmel: using strlcpy() to avoid possible buffer overflows 'firmware' is a module param which may been longer than firmware_id, so using strlcpy() to guard against overflows. Also priv is allocated with zeroed memory,no need to set firmware_id[0] to '\0'. Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit 04614fe46f315a223d96b8f5df7b52130965677b Author: Gustavo A. R. Silva Date: Thu Jun 28 08:08:09 2018 -0500 wlcore: Fix memory leak in wlcore_cmd_wait_for_event_or_timeout In case memory resources for *events_vector* were allocated, release them before return. Addresses-Coverity-ID: 1470194 ("Resource leak") Fixes: 4ec7cece87b3 ("wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()") Signed-off-by: Gustavo A. R. Silva Acked-by: Tony Lindgren Signed-off-by: Kalle Valo commit 7444a8092906ed44c09459780c56ba57043e39b1 Author: Daniel Mack Date: Wed Jun 27 20:58:45 2018 +0200 libertas: fix suspend and resume for SDIO connected cards Prior to commit 573185cc7e64 ("mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus"), the MMC core used to call into the power management functions of SDIO clients itself and removed the card if the return code was non-zero. IOW, the mmc handled errors gracefully and didn't upchain them to the pm core. Since this change, the mmc core relies on generic power management functions which treat all errors as a reason to cancel the suspend immediately. This causes suspend attempts to fail when the libertas driver is loaded. To fix this, power down the card explicitly in if_sdio_suspend() when we know we're about to lose power and return success. Also set a flag in these cases, and power up the card again in if_sdio_resume(). Fixes: 573185cc7e64 ("mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus") Cc: Signed-off-by: Daniel Mack Reviewed-by: Chris Ball Reviewed-by: Ulf Hansson Signed-off-by: Kalle Valo commit 07b1ae46874949252625c96f309f96ca0f337020 Author: Rafał Miłecki Date: Thu Jun 28 12:36:23 2018 +0200 brcmfmac: update STA info struct to the v5 That struct is used when querying firmware for the STA. It seem is has been changing during the time. Luckily its format seems to be backward compatible starting with v2 (the only breakage was v1 -> v2). The version that was supported by brcmfmac so far was v4. It was what 43602a1 and 4366b1 firmwares (7.35.177.56 and 10.10.69.3309 accordingly) were using. It also seems to be used by early 4366c0 firmwares (10.10.69.6908 and 10.10.69.69017). The problem appears when switching to the 10.10.122.20 firmware. It uses v5 and instead of falling back to v4 when submitted buffer isn't big enough it fallbacks to the v3. To receive all v4 specific info with the newest firmware we have to submit a struct (buffer) that matches v5. Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel Signed-off-by: Kalle Valo commit 4b4a8d808c58fc0defc32a26b2fea35d66692c45 Author: Rafał Miłecki Date: Thu Jun 28 08:16:13 2018 +0200 brcmfmac: define more bits for the flags of struct brcmf_sta_info_le That struct is passed by a firmware when querying for STA info. Flags are used to indicate what info could be obtained. These new defines may allow passing more info to the cfg80211 in the future. They had been obtained from Broadcom's SDK file wlioctl_defs.h used by DD-WRT. Signed-off-by: Rafał Miłecki Signed-off-by: Kalle Valo commit a8d7631858aff156b72f807ee7cc062048e63836 Author: Rafał Miłecki Date: Sun Jun 24 21:44:37 2018 +0200 brcmfmac: handle msgbuf packets marked with monitor mode flag New Broadcom firmwares mark monitor mode packets using a newly defined bit in the flags field. Use it to filter them out and pass to the monitor interface. These defines were found in bcmmsgbuf.h from SDK. As not every firmware generates radiotap header this commit introduces BRCMF_FEAT_MONITOR_FMT_RADIOTAP flag. It has to be has based on firmware capabilities. If not present brcmf_netif_mon_rx() will assume packet is a raw 802.11 frame and will prepend it with an empty radiotap header. This new code is limited to the msgbuf protocol at this point. Adding support for SDIO/USB devices will require some extra work (possibly a new firmware release). Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel Signed-off-by: Kalle Valo commit e63410ac65e0ead2040bbd3927c116889edf87e4 Author: Rafał Miłecki Date: Sun Jun 24 21:44:36 2018 +0200 brcmfmac: detect firmware support for radiotap monitor frames Depending on used build-time options some firmwares may already include radiotap header in passed monitor frames. Add a new feature flag to store info about it. It's needed for proper handling of received frames before passing them up. Signed-off-by: Rafał Miłecki Signed-off-by: Arend van Spriel Signed-off-by: Kalle Valo commit 01f69dfafdbe7deff58b58053bc3a4a75c6a570c Author: Rafał Miłecki Date: Sun Jun 24 21:44:35 2018 +0200 brcmfmac: detect firmware support for monitor interface Many/most of firmwares support creating monitor interface but only the most recent ones explicitly /announce/ it using a "monitor" entry in the list of capabilities. Check for that entry and store internally info about monitor mode support using a new feature flag. Once we sort out all details of handling monitor interface it will be used when reporting available interfaces to the cfg80211. Later some fallback detecion method may be added for older firmwares. For now just stick to the "monitor" capability which should be 100% reliable. Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel Signed-off-by: Kalle Valo commit b5cb15d9372abc9adc4e844c0c1bf594ca6a7695 Author: Chris von Recklinghausen Date: Tue Jul 3 15:43:08 2018 -0400 usercopy: Allow boot cmdline disabling of hardening Enabling HARDENED_USERCOPY may cause measurable regressions in networking performance: up to 8% under UDP flood. I ran a small packet UDP flood using pktgen vs. a host b2b connected. On the receiver side the UDP packets are processed by a simple user space process that just reads and drops them: https://github.com/netoptimizer/network-testing/blob/master/src/udp_sink.c Not very useful from a functional PoV, but it helps to pin-point bottlenecks in the networking stack. When running a kernel with CONFIG_HARDENED_USERCOPY=y, I see a 5-8% regression in the receive tput, compared to the same kernel without this option enabled. With CONFIG_HARDENED_USERCOPY=y, perf shows ~6% of CPU time spent cumulatively in __check_object_size (~4%) and __virt_addr_valid (~2%). The call-chain is: __GI___libc_recvfrom entry_SYSCALL_64_after_hwframe do_syscall_64 __x64_sys_recvfrom __sys_recvfrom inet_recvmsg udp_recvmsg __check_object_size udp_recvmsg() actually calls copy_to_iter() (inlined) and the latters calls check_copy_size() (again, inlined). A generic distro may want to enable HARDENED_USERCOPY in their default kernel config, but at the same time, such distro may want to be able to avoid the performance penalties in with the default configuration and disable the stricter check on a per-boot basis. This change adds a boot parameter that conditionally disables HARDENED_USERCOPY via "hardened_usercopy=off". Signed-off-by: Chris von Recklinghausen Signed-off-by: Kees Cook commit f1478a1476d45c5d7b070c726f46a7b581d3103c Author: Srinivas Kandagatla Date: Wed Jul 4 10:49:42 2018 +0100 ASoC: qdsp6: q6afe-dai: Do not overwrite slim dai num_channels num_channels for slim dais are aready set int set_channel_map, do not overwrite them in hw_params. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 9191ffe2d212f64aa2ec311f4294ba7066d1f8a1 Author: Srinivas Kandagatla Date: Wed Jul 4 10:49:41 2018 +0100 ASoC: qdsp6: q6routing: add slim rx routings This patch add routings mixer controls for slim rx ports. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit f03d6b1b4d2460a749fb2826aa71e15a66104a88 Author: Srinivas Kandagatla Date: Wed Jul 4 10:49:40 2018 +0100 ASoC: qdsp6: q6afe-dai: add support to slim tx dais This patch adds support to SLIMbus TX dais in AFE module. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 25090bc3f36cc3c171ec020dcc89c71db6bd0a67 Author: Srinivas Kandagatla Date: Wed Jul 4 10:49:39 2018 +0100 ASoC: qdsp6: q6afe: Add missing slimbus capture ports Existing code already has support for SLIMbus TX and RX, only thing that was missing from TX side was mapping between virtual to actual DSP port ids. This patch adds those mappings. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit b1625fbb3b87affbedf14545b65d69ff182a0611 Author: Takashi Iwai Date: Wed Jul 4 16:01:46 2018 +0200 ASoC: stm32: Use snd_pcm_stop_xrun() helper The XRUN trigger from the driver should be done via snd_pcm_stop_xrun(). It simplifies the locking as well. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit dc865fb9e7c2251c9585ff6a7bf185d499db13e4 Author: Takashi Iwai Date: Wed Jul 4 16:01:45 2018 +0200 ASoC: sti: Use snd_pcm_stop_xrun() helper The XRUN trigger from the driver should be done via snd_pcm_stop_xrun(). It fixes the missing stream locking as a gratis, too. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit 1a42e7e3aff1aa4789378020318dff7432317d25 Author: Takashi Iwai Date: Wed Jul 4 16:01:44 2018 +0200 ASoC: qcom: Use snd_pcm_stop_xrun() helper The XRUN trigger from the driver should be done via snd_pcm_stop_xrun(). It fixes the missing stream locking as a gratis, too. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit dae35d1f4f7dab9ccef20037df91c43e680bad0f Author: Takashi Iwai Date: Wed Jul 4 16:01:43 2018 +0200 ASoC: davinci: Use snd_pcm_stop_xrun() helper Replace open-codes with the standard snd_pcm_stop_xrun() helper. It simplifies codes a lot. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown commit da13ed1d80fe6a4d95043aaf2e0aff292ade5708 Author: Gustavo A. R. Silva Date: Wed Jul 4 09:28:28 2018 -0500 ASoC: nau8825: use 64-bit arithmetic instead of 32-bit Add suffix ULL to constant 256 in order to give the compiler complete information about the proper arithmetic to use. Notice that such constant is used in a context that expects an expression of type u64 (64 bits, unsigned) and the following expression is currently being evaluated using 32-bit arithmetic: 256 * fs * 2 * mclk_src_scaling[i].param Addresses-Coverity-ID: 1339616 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 5dffc1752cabde6396fca28ff8343febfa524512 Author: Srinivas Kandagatla Date: Wed Jul 4 10:49:44 2018 +0100 ASoC: qdsp6: q6asm-dai: do not close port if its not opened asm ports are open as part of prepare, so for use cases like "aplay sample.wav" were sample.wav is not present. This would call port close eventhough port was never opened. DSP would return errors for such use cases. Avoid doing this by checking the port state. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 110743189c863e96dc08a581d56c50b965870a3f Author: Srinivas Kandagatla Date: Wed Jul 4 10:49:43 2018 +0100 ASoC: qdsp6: q6afe-dai: do not close port if its not opened afe ports are open as part of prepare, so for use cases like "aplay sample.wav" were sample.wav is not present. This would call port close eventhough port was never opened. DSP would return errors for such use cases. Avoid doing this by checking the port state. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 010b876ae9a05307c138cd591555fcd8a0a0bf14 Author: Maciej S. Szmigiero Date: Mon Jul 2 17:23:24 2018 -0400 media: tuner-simple: allow setting mono radio mode For some types of tuners (Philips FMD1216ME(X) MK3 currently) we know that letting TDA9887 output port 1 remain high (inactive) will switch FM radio to mono mode. Let's make use of this functionality - nothing changes for the default stereo radio mode. Tested on a Medion 95700 board which has a FMD1216ME tuner. Signed-off-by: Maciej S. Szmigiero Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 211c41c8c46b5035b2a747a4d41627eef8261969 Author: Colin Ian King Date: Wed Jul 4 13:19:29 2018 +0100 epic100: remove redundant variable 'irq' Variable 'irq' is being assigned but is never used hence it is and can be removed. Cleans up clang warning: warning: variable 'irq' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 2e6dde5c618f847fdb811373ad520cdb3a4425ab Author: Colin Ian King Date: Wed Jul 4 13:13:01 2018 +0100 sfc: remove redundant variable old_vlan Variable old_vlan is being assigned but is never used hence it is and can be removed. Cleans up clang warning: warning: variable 'old_vlan' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 9b0bb10a84ffbbbb9f589122e34ceee0194ea5ca Author: Colin Ian King Date: Wed Jul 4 13:06:26 2018 +0100 qed: remove redundant pointer 'name' Pointer 'name' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'name' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 5074298ab08bfc218ad8773ba270a6415a38468d Author: Colin Ian King Date: Wed Jul 4 12:20:44 2018 +0100 ethernet: micrel: remove redundant pointer 'info' Pointer 'info' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'info' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 541a1fecff3082664193c4615d2368186bd80dd5 Author: Colin Ian King Date: Wed Jul 4 09:06:27 2018 +0100 net: hinic: remove redundant pointer pfhwdev Pointer pfhwdev is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'pfhwdev' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 8c3689fcc5985c06a8d057cde82d59da8ebe29e2 Author: Colin Ian King Date: Wed Jul 4 08:59:25 2018 +0100 net: hns3: remove redundant variable 'protocol' Variable 'protocol' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'protocol' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 1d981f1dbe14ebf96fe1b2de58b72f60e897fb91 Author: Colin Ian King Date: Wed Jul 4 08:54:55 2018 +0100 net: ethernet: gianfar_ethtool: remove redundant variable last_rule_idx Variable last_rule_idx is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'last_rule_idx' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Acked-by: Claudiu Manoil Signed-off-by: David S. Miller commit f06bd2ed745cdca87ca398e27ef0bbbdf1089b05 Author: Colin Ian King Date: Wed Jul 4 08:49:43 2018 +0100 net: fec: remove redundant variable 'inc' Variable 'inc' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'inc' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Acked-by: Fugang Duan Signed-off-by: David S. Miller commit b68431ace4b60ac58fef92c0d70b61b3d2cba165 Author: Colin Ian King Date: Wed Jul 4 08:39:12 2018 +0100 cnic: remove redundant pointer req and variable func Pointer req and variable func are being assigned but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'req' set but not used [-Wunused-but-set-variable] warning: variable 'func' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 15cdd5764a547caf7c9ab14306829135c616845d Author: Colin Ian King Date: Wed Jul 4 08:30:43 2018 +0100 net: bgmac: remove redundant variable 'freed' Variable 'freed' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'freed' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 5b9f78ecdf590131aa1411b37151acda4f2ffc17 Author: Colin Ian King Date: Wed Jul 4 08:20:20 2018 +0100 net: ethernet: nb8800: remove redundant pointer rxd Pointer rxd is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'rxb' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 371b4fc33b2e32bd18fc139d2fb8b508ea66fe50 Author: Colin Ian King Date: Wed Jul 4 08:15:30 2018 +0100 net: alx: remove redundant variable old_duplex Variable old_duplex is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'old_duplex' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 3ff39a21640efd469c8b9d96e34d281deed0c6f6 Author: Colin Ian King Date: Wed Jul 4 08:01:35 2018 +0100 net: alteon: acenic: remove redundant pointer rxdesc Pointer rxdesc is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'rxdesc' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 5c17a07cff792bc5ec2ae8a3577f1fcfd5668595 Author: Colin Ian King Date: Wed Jul 4 07:54:36 2018 +0100 net: dsa: bcm_sf2: remove redundant variable off Variable 'off' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'off' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit af16d0a132af47c60494c373100ff8952d557b01 Author: Maciej S. Szmigiero Date: Mon Jul 2 17:23:22 2018 -0400 media: cx25840: add kernel-doc description of struct cx25840_state This commit describes a device instance private data of the driver (struct cx25840_state) in a kernel-doc style comment. Signed-off-by: Maciej S. Szmigiero Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e647f5a5c5d165c87750e8c0dcbe341b5a378ffd Author: Takashi Iwai Date: Wed Jul 4 15:08:05 2018 +0200 ALSA: pcm: Use snd_pcm_stop_xrun() for xrun injection Basically the xrun injection routine can simply call the standard helper snd_pcm_stop_xrun(), but with one exception: it may be called even when the stream is closed. Make snd_pcm_stop_xrun() more robust and check the NULL runtime state, and simplify xrun injection code by calling it. Signed-off-by: Takashi Iwai commit 9cd641ed31f576d08f7b784850ba93eef050f32f Author: Takashi Iwai Date: Wed Jul 4 14:46:27 2018 +0200 ALSA: pcm: trace XRUN event at injection, too The PCM xrun injection triggers directly snd_pcm_stop() without the standard xrun handler, hence it's not recorded on the event buffer. Ditto for snd_pcm_stop_xrun() call and SNDRV_PCM_IOCTL_XRUN ioctl. They are inconvenient from the debugging POV. Let's make them to trigger XRUN via the standard helper more consistently. Signed-off-by: Takashi Iwai commit c928d45475d7b07f1c1bdd68c327189289fcb3c2 Author: Maciej S. Szmigiero Date: Mon Jul 2 17:23:21 2018 -0400 media: ivtv: zero-initialize cx25840 platform data We need to zero-initialize cx25840 platform data structure to make sure that its future members do not contain random stack garbage. Signed-off-by: Maciej S. Szmigiero Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d45c9dc0b8349d8005ed8f7bc82c4583f50dd357 Author: Keiichi Watanabe Date: Mon Jun 18 03:58:54 2018 -0400 media: mtk-vcodec: Support VP9 profile in decoder Add V4L2_CID_MPEG_VIDEO_VP9_PROFILE control in MediaTek decoder's driver. MediaTek decoder only supports profile 0 for now. Signed-off-by: Keiichi Watanabe Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2a75364d09b05f257f4cd1f718e06e0247eb1dd3 Author: Keiichi Watanabe Date: Mon Jun 18 03:58:53 2018 -0400 media: v4l2-ctrl: Add control for VP9 profile Add a new control V4L2_CID_MPEG_VIDEO_VP9_PROFILE for VP9 profiles. This control allows selecting the desired profile for VP9 encoder and querying for supported profiles by VP9 encoder/decoder. Though this control is similar to V4L2_CID_MPEG_VIDEO_VP8_PROFILE, we need to separate this control from it because supported profiles usually differ between VP8 and VP9. Signed-off-by: Keiichi Watanabe Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d11a899ff0de3efad3c27fb1241de51e9d1a04a8 Merge: d287c5024361 4b15c7075352 Author: David S. Miller Date: Wed Jul 4 22:30:28 2018 +0900 Merge branch 'Scheduled-packet-Transmission-ETF' Jesus Sanchez-Palencia says: ==================== Scheduled packet Transmission: ETF Changes since v1: - moved struct sock_txtime from socket.h to uapi net_tstamp.h; - sk_clockid was changed from u16 to u8; - sk_txtime_flags was changed from u16 to a u8 bit field in struct sock; - the socket option flags are now validated in sock_setsockopt(); - added SO_EE_ORIGIN_TXTIME; - sockc.transmit_time is now initialized from all IPv4 Tx paths; - added support for the IPv6 Tx path; Overview ======== This work consists of a set of kernel interfaces that can be used by applications that require (time-based) Scheduled Tx of packets. It is comprised by 3 new components to the kernel: - SO_TXTIME: socket option + cmsg programming interfaces. - etf: the "earliest txtime first" qdisc, that provides per-queue TxTime-based scheduling. This has been renamed from 'tbs' to 'etf' to better describe its functionality. - taprio: the "time-aware priority scheduler" qdisc, that provides per-port Time-Aware scheduling; This patchset is providing the first 2 components, which have been developed for longer. The taprio qdisc will be shared as an RFC separately (shortly). Note that this series is a follow up of the "Time based packet transmission" RFCv3 [1]. etf (formerly known as 'tbs') ============================= For applications/systems that the concept of time slices isn't precise enough, the etf qdisc allows applications to control the instant when a packet should leave the network controller. When used in conjunction with taprio, it can also be used in case the application needs to control with greater guarantee the offset into each time slice a packet will be sent. Another use case of etf, is when only a small number of applications on a system are time sensitive, so it can then be used with a more traditional root qdisc (like mqprio). The etf qdisc is designed so it buffers packets until a configurable time before their deadline (Tx time). The qdisc uses a rbtree internally so the buffered packets are always 'ordered' by their txtime (deadline) and will be dequeued following the earliest txtime first. It relies on the SO_TXTIME API set for receiving the per-packet timestamp (txtime) as well as the config flags for each socket: the clockid to be used as a reference, if the expected mode of txtime for that socket is deadline or strict mode, and if packet drops should be reported on the socket's error queue or not. The qdisc will drop any packets with a Tx time in the past, or if a packet expires while waiting for being dequeued. Drops can be reported as errors back to userspace through the socket's error queue. Example configuration: $ tc qdisc add dev enp2s0 parent 100:1 etf offload delta 200000 \ clockid CLOCK_TAI Here, the Qdisc will use HW offload for the txtime control. Packets will be dequeued by the qdisc "delta" (200000) nanoseconds before their transmission time. Because this will be using HW offload and since dynamic clocks are not supported by hrtimers, the system clock and the PHC clock must be synchronized for this mode to behave as expected. A more complete example can be found here, with instructions of how to test it: https://gist.github.com/jeez/bd3afeff081ba64a695008dd8215866f [2] Note that we haven't modified the qdisc so it uses a timerqueue because the modification needed was increasing the number of cachelines of a sk_buff. This series is also hosted on github and can be found at [3]. The companion iproute2 patches can be found at [4]. [1] https://patchwork.ozlabs.org/cover/882342/ [2] github doesn't make it clear, but the gist can be cloned like this: $ git clone https://gist.github.com/jeez/bd3afeff081ba64a695008dd8215866f scheduled-tx-tests [3] https://github.com/jeez/linux/tree/etf-v2 [4] https://github.com/jeez/iproute2/tree/etf-v2 ==================== Signed-off-by: David S. Miller commit 4b15c7075352668d4467ced7594b676707d11cae Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:43:00 2018 -0700 net/sched: Make etf report drops on error_queue Use the socket error queue for reporting dropped packets if the socket has enabled that feature through the SO_TXTIME API. Packets are dropped either on enqueue() if they aren't accepted by the qdisc or on dequeue() if the system misses their deadline. Those are reported as different errors so applications can react accordingly. Userspace can retrieve the errors through the socket error queue and the corresponding cmsg interfaces. A struct sock_extended_err* is used for returning the error data, and the packet's timestamp can be retrieved by adding both ee_data and ee_info fields as e.g.: ((__u64) serr->ee_data << 32) + serr->ee_info This feature is disabled by default and must be explicitly enabled by applications. Enabling it can bring some overhead for the Tx cycles of the application. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 3048cf84d152344f874e993558770bba73a65c8f Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:59 2018 -0700 igb: Add support for ETF offload Implement HW offload support for SO_TXTIME through igb's Launchtime feature. This is done by extending igb_setup_tc() so it supports TC_SETUP_QDISC_ETF and configuring i210 so time based transmit arbitration is enabled. The FQTSS transmission mode added before is extended so strict priority (SP) queues wait for stream reservation (SR) ones. igb_config_tx_modes() is extended so it can support enabling/disabling Launchtime following the previous approach used for the credit-based shaper (CBS). As the previous flow, FQTSS transmission mode is enabled automatically by the driver once Launchtime (or CBS, as before) is enabled. Similarly, it's automatically disabled when the feature is disabled for the last queue that had it setup on. The driver just consumes the transmit times from the skbuffs directly, so no special handling is done in case an 'invalid' time is provided. We assume this has been handled by the ETF qdisc already. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 1b9231e7e148520a3ba63a604b27f11093f21bee Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:58 2018 -0700 igb: Only call skb_tx_timestamp after descriptors are ready Currently, skb_tx_timestamp() is being called before the Tx descriptors are prepared in igb_xmit_frame_ring(), which happens during either the igb_tso() or igb_tx_csum() calls. Given that now the skb->tstamp might be used to carry the timestamp for SO_TXTIME, we must only call skb_tx_timestamp() after the information has been copied into the Tx descriptors. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 8080e6ab4e99216f414c5c314264fd7cf3b6e4c1 Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:57 2018 -0700 igb: Refactor igb_offload_cbs() Split code into a separate function (igb_offload_apply()) that will be used by ETF offload implementation. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 0364a0d0e7a124e7c821cc536a95f7ef421349cb Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:56 2018 -0700 igb: Only change Tx arbitration when CBS is on Currently the data transmission arbitration algorithm - DataTranARB field on TQAVCTRL reg - is always set to CBS when the Tx mode is changed from legacy to 'Qav' mode. Make that configuration a bit more granular in preparation for the upcoming Launchtime enabling patches, since CBS and Launchtime can be enabled separately. That is achieved by moving the DataTranARB setup to igb_config_tx_modes() instead. Similarly, when disabling CBS we must check if it has been disabled for all queues, and clear the DataTranARB accordingly. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 91db364236c8ae1af976d9794e5fec98e859dae7 Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:55 2018 -0700 igb: Refactor igb_configure_cbs() Make this function retrieve what it needs from the Tx ring being addressed since it already relies on what had been saved on it before. Also, since this function will be used by the upcoming Launchtime patches rename it to better reflect its intention. Note that Launchtime is not part of what 802.1Qav specifies, but the i210 datasheet refers to this set of functionality as "Qav Transmission Mode". Here we also perform a tiny refactor at is_any_cbs_enabled(), and add further documentation to igb_setup_tx_mode(). Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 88cab77162e86e0f6a2b7e4f859c1435c4e24feb Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:54 2018 -0700 net/sched: Add HW offloading capability to ETF Add infra so etf qdisc supports HW offload of time-based transmission. For hw offload, the time sorted list is still used, so packets are dequeued always in order of txtime. Example: $ tc qdisc replace dev enp2s0 parent root handle 100 mqprio num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 0 $ tc qdisc add dev enp2s0 parent 100:1 etf offload delta 100000 \ clockid CLOCK_REALTIME In this example, the Qdisc will use HW offload for the control of the transmission time through the network adapter. The hrtimer used for packets scheduling inside the qdisc will use the clockid CLOCK_REALTIME as reference and packets leave the Qdisc "delta" (100000) nanoseconds before their transmission time. Because this will be using HW offload and since dynamic clocks are not supported by the hrtimer, the system clock and the PHC clock must be synchronized for this mode to behave as expected. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 25db26a91364db00f5a30da2fea8e9afe14a163c Author: Vinicius Costa Gomes Date: Tue Jul 3 15:42:53 2018 -0700 net/sched: Introduce the ETF Qdisc The ETF (Earliest TxTime First) qdisc uses the information added earlier in this series (the socket option SO_TXTIME and the new role of sk_buff->tstamp) to schedule packets transmission based on absolute time. For some workloads, just bandwidth enforcement is not enough, and precise control of the transmission of packets is necessary. Example: $ tc qdisc replace dev enp2s0 parent root handle 100 mqprio num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 0 $ tc qdisc add dev enp2s0 parent 100:1 etf delta 100000 \ clockid CLOCK_TAI In this example, the Qdisc will provide SW best-effort for the control of the transmission time to the network adapter, the time stamp in the socket will be in reference to the clockid CLOCK_TAI and packets will leave the qdisc "delta" (100000) nanoseconds before its transmission time. The ETF qdisc will buffer packets sorted by their txtime. It will drop packets on enqueue() if their skbuff clockid does not match the clock reference of the Qdisc. Moreover, on dequeue(), a packet will be dropped if it expires while being enqueued. The qdisc also supports the SO_TXTIME deadline mode. For this mode, it will dequeue a packet as soon as possible and change the skb timestamp to 'now' during etf_dequeue(). Note that both the qdisc's and the SO_TXTIME ABIs allow for a clockid to be configured, but it's been decided that usage of CLOCK_TAI should be enforced until we decide to allow for other clockids to be used. The rationale here is that PTP times are usually in the TAI scale, thus no other clocks should be necessary. For now, the qdisc will return EINVAL if any clocks other than CLOCK_TAI are used. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 860b642b9c33ea4a6ae2f416607b0b98a9d11bb0 Author: Vinicius Costa Gomes Date: Tue Jul 3 15:42:52 2018 -0700 net/sched: Allow creating a Qdisc watchdog with other clocks This adds 'qdisc_watchdog_init_clockid()' that allows a clockid to be passed, this allows other time references to be used when scheduling the Qdisc to run. Signed-off-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 3d0ba8c03ca9c49ffcb79d989312f123dd1bdc7a Author: Richard Cochran Date: Tue Jul 3 15:42:51 2018 -0700 net: packet: Hook into time based transmission. For raw layer-2 packets, copy the desired future transmit time from the CMSG cookie into the skb. Signed-off-by: Richard Cochran Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit a818f75e311c23cdac528888c60ae6e43a8958d0 Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:50 2018 -0700 net: ipv6: Hook into time based transmission Add a struct sockcm_cookie parameter to ip6_setup_cork() so we can easily re-use the transmit_time field from struct inet_cork for most paths, by copying the timestamp from the CMSG cookie. This is later copied into the skb during __ip6_make_skb(). For the raw fast path, also pass the sockcm_cookie as a parameter so we can just perform the copy at rawv6_send_hdrinc() directly. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit bc969a977880511057053642a81371196303ca01 Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:49 2018 -0700 net: ipv4: Hook into time based transmission Add a transmit_time field to struct inet_cork, then copy the timestamp from the CMSG cookie at ip_setup_cork() so we can safely copy it into the skb later during __ip_make_skb(). For the raw fast path, just perform the copy at raw_send_hdrinc(). Signed-off-by: Richard Cochran Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 80b14dee2bea128928537d61c333f24cb8cbb62f Author: Richard Cochran Date: Tue Jul 3 15:42:48 2018 -0700 net: Add a new socket option for a future transmit time. This patch introduces SO_TXTIME. User space enables this option in order to pass a desired future transmit time in a CMSG when calling sendmsg(2). The argument to this socket option is a 8-bytes long struct provided by the uapi header net_tstamp.h defined as: struct sock_txtime { clockid_t clockid; u32 flags; }; Note that new fields were added to struct sock by filling a 2-bytes hole found in the struct. For that reason, neither the struct size or number of cachelines were altered. Signed-off-by: Richard Cochran Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit c47d8c2f38f805ba541496ddd7d8c3aee59b49d5 Author: Jesus Sanchez-Palencia Date: Tue Jul 3 15:42:47 2018 -0700 net: Clear skb->tstamp only on the forwarding path This is done in preparation for the upcoming time based transmission patchset. Now that skb->tstamp will be used to hold packet's txtime, we must ensure that it is being cleared when traversing namespaces. Also, doing that from skb_scrub_packet() before the early return would break our feature when tunnels are used. Signed-off-by: Jesus Sanchez-Palencia Signed-off-by: David S. Miller commit 5520b9467a39d5ec9ce9cd8a9ed01f826b817524 Author: Keiichi Watanabe Date: Mon Jun 18 03:58:52 2018 -0400 media: v4l2-ctrl: Change control for VP8 profile to menu control Add a menu control V4L2_CID_MPEG_VIDEO_VP8_PROFILE for VP8 profile and make V4L2_CID_MPEG_VIDEO_VPX_PROFILE an alias of it. This new control is used to select the desired profile for VP8 encoder and query for supported profiles by VP8 encoder/decoder. Though we have originally a control V4L2_CID_MPEG_VIDEO_VPX_PROFILE and its name contains 'VPX', it works only for VP8 because supported profiles usually differ between VP8 and VP9. In addition, this control cannot be used for querying since it is not a menu control but an integer control, which cannot return an arbitrary set of supported profiles. The new control V4L2_CID_MPEG_VIDEO_VP8_PROFILE is a menu control as with controls for other codec profiles. (e.g. H264) In addition, this patch also fixes the use of V4L2_CID_MPEG_VIDEO_VPX_PROFILE in drivers of Qualcomm's venus and Samsung's s5p-mfc. Signed-off-by: Keiichi Watanabe Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 779680e2e793db349c37668099f26d9080801f53 Author: Jan Luebbe Date: Fri May 18 09:56:39 2018 -0400 media: imx: add support for RGB565_2X8 on parallel bus The IPU can only capture RGB565 with two 8-bit cycles in bayer/generic mode on the parallel bus, compared to a specific mode on MIPI CSI-2. To handle this, we extend imx_media_pixfmt with a cycles per pixel field, which is used for generic formats on the parallel bus. Based on the selected format and bus, we then update the width to account for the multiple cycles per pixel. Signed-off-by: Jan Luebbe Signed-off-by: Steve Longerbeam Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f6aaac7fa03e36bb43401182864a74f65a211e86 Author: Jan Luebbe Date: Fri May 18 09:56:38 2018 -0400 media: imx: capture: refactor enum_/try_fmt By checking and handling the internal IPU formats (ARGB or AYUV) first, we don't need to check whether it's a bayer format, as we can default to passing the input format on in all other cases. This simplifies handling the different configurations for RGB565 between parallel and MIPI CSI-2, as we don't need to check the details of the format anymore. Signed-off-by: Jan Luebbe Reviewed-by: Philipp Zabel Reviewed-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 56e5faf299502d902b94cd88d6ff1c48c3865c69 Author: Peter Seiderer Date: Thu Mar 15 15:13:23 2018 -0400 media: staging/imx: fill vb2_v4l2_buffer sequence entry - enables gstreamer v4l2src lost frame detection, e.g: 0:00:08.685185668 348 0x54f520 WARN v4l2src gstv4l2src.c:970:gst_v4l2src_create: lost frames detected: count = 141 - ts: 0:00:08.330177332 - fixes v4l2-compliance test failure: Streaming ioctls: test read/write: OK (Not Supported) Video Capture: Buffer: 0 Sequence: 0 Field: None Timestamp: 92.991450s Buffer: 1 Sequence: 0 Field: None Timestamp: 93.008135s fail: v4l2-test-buffers.cpp(294): (int)g_sequence() < seq.last_seq + 1 fail: v4l2-test-buffers.cpp(707): buf.check(q, last_seq) Signed-off-by: Peter Seiderer Reviewed-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a38d4b71cb7a12b65317f4e3d59883a918957719 Author: Peter Seiderer Date: Thu Mar 15 15:13:22 2018 -0400 media: staging/imx: fill vb2_v4l2_buffer field entry - fixes gstreamer v4l2src warning: 0:00:00.716640334 349 0x164f720 WARN v4l2bufferpool gstv4l2bufferpool.c:1195:gst_v4l2_buffer_pool_dqbuf: Driver should never set v4l2_buffer.field to ANY - fixes v4l2-compliance test failure: Streaming ioctls: test read/write: OK (Not Supported) Video Capture: Buffer: 0 Sequence: 0 Field: Any Timestamp: 58.383658s fail: v4l2-test-buffers.cpp(297): g_field() == V4L2_FIELD_ANY Signed-off-by: Peter Seiderer Reviewed-by: Steve Longerbeam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8736c1038cd22fe639091349767ae89b883d1a81 Author: Jacopo Mondi Date: Wed Jul 4 04:51:36 2018 -0400 media: dt-bindings: media: rcar-vin: Add R8A77995 support Add compatible string for R-Car D3 R8A7795 to list of SoCs supported by rcar-vin driver. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit aa2446ef9e8b33d304bde808ea3dac416af1bd0c Author: Jacopo Mondi Date: Tue Jun 12 05:43:32 2018 -0400 media: rcar-vin: Add support for R-Car R8A77995 SoC Add R-Car R8A77995 SoC to the rcar-vin supported ones. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5cda0fca7824605d56e4c0d9a96d464d9a93dc33 Author: Jacopo Mondi Date: Tue Jun 12 05:43:31 2018 -0400 media: rcar-vin: Rename _rcar_info to rcar_info Remove leading underscore to align all rcar_group_route structure declarations. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1284605dc821cebdc4793772487f65f56c5d0c62 Author: Jacopo Mondi Date: Tue Jun 12 05:43:30 2018 -0400 media: rcar-vin: Handle parallel subdev in link_notify Handle parallel subdevices in link_notify callback. If the notified link involves a parallel subdevice, do not change routing of the VIN-CSI-2 devices and mark the VIN instance as using a parallel input. If the CSI-2 link setup succeeds instead, mark the VIN instance as using CSI-2. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a962a80476b06fc6c2a4b7d77bb38b77dd73edac Author: Jacopo Mondi Date: Tue Jun 12 05:43:29 2018 -0400 media: rcar-vin: Link parallel input media entities When running with media-controller link the parallel input media entities with the VIN entities at 'complete' callback time. To create media links the v4l2_device should be registered first. Check if the device is already registered, to avoid double registrations. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a597a772cd3f51193e1917a729db8a991615341b Author: Jacopo Mondi Date: Tue Jun 12 05:43:28 2018 -0400 media: rcar-vin: Parse parallel input on Gen3 The rcar-vin driver so far had a mutually exclusive code path for handling parallel and CSI-2 video input subdevices, with only the CSI-2 use case supporting media-controller. As we add support for parallel inputs to Gen3 media-controller compliant code path now parse both port@0 and port@1, handling the media-controller use case in the parallel bound/unbind notifier operations. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 158e2a53fc9620fac7ebbb83223ec18280bd34f0 Author: Jacopo Mondi Date: Tue Jun 12 05:43:27 2018 -0400 media: rcar-vin: Cache the mbus configuration flags Media bus configuration flags and media bus type were so far a property of each VIN instance, as the subdevice they were connected to was immutable during the whole system life time. With the forth-coming introduction of parallel input devices support, a VIN instance can have the subdevice it is connected to switched at runtime, from a CSI-2 subdevice to a parallel one and viceversa, through the modification of links between media entities in the media controller graph. To avoid discarding the per-subdevice configuration flags retrieved by v4l2_fwnode parsing facilities, cache them in the 'rvin_graph_entity' member of each VIN instance, opportunely renamed to 'rvin_parallel_entity'. Also modify the register configuration function to take mbus flags into account when running on a bus type that supports them. The media bus type currently in use will be updated in a follow-up patch to the link state change notification function. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9863bc8695bc36e39aca289650e5a4f17c1bf628 Author: Jacopo Mondi Date: Tue Jun 12 05:43:26 2018 -0400 media: rcar-vin: Cleanup notifier in error path During the notifier initialization, memory for the list of associated async subdevices is reserved during the fwnode endpoint parsing from the v4l2-async framework. If the notifier registration fails, that memory should be released and the notifier 'cleaned up'. Catch the notifier registration error and perform the cleanup both for the group and the parallel notifiers. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d287c5024361554d746e918b20d69a37f1b6bd79 Author: Gustavo A. R. Silva Date: Tue Jul 3 16:17:31 2018 -0500 isdn: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 2241ea75b82c43e060d3da26fa2c286f6c872348 Author: Jacopo Mondi Date: Tue Jun 12 05:43:25 2018 -0400 media: rcar-vin: Create a group notifier As CSI-2 subdevices are shared between several VIN instances, a shared notifier to collect the CSI-2 async subdevices is required. So far, the rcar-vin driver used the notifier of the last VIN instance to probe but with the forth-coming introduction of parallel input subdevices support in mc-compliant code path, each VIN may register its own notifier if any parallel subdevice is connected there. To avoid registering a notifier twice (once for parallel subdev and one for the CSI-2 subdevs) create a group notifier, shared by all the VIN instances. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 03fc5d4ffb0da005f0dce02d7c015821681e260c Author: Marcel Ziswiler Date: Tue Jul 3 17:06:49 2018 +0200 net: usb: asix: allow optionally getting mac address from device tree For Embedded use where e.g. AX88772B chips may be used without external EEPROMs the boot loader may choose to pass the MAC address to be used via device tree. Therefore, allow for optionally getting the MAC address from device tree data e.g. as follows (excerpt from a T30 based board, local-mac-address to be filled in by boot loader): /* EHCI instance 1: USB2_DP/N -> AX88772B */ usb@7d004000 { status = "okay"; #address-cells = <1>; #size-cells = <0>; asix@1 { reg = <1>; local-mac-address = [00 00 00 00 00 00]; }; }; Signed-off-by: Marcel Ziswiler Signed-off-by: David S. Miller commit a561e9e0944aea3e8683c3ab17219d6942ad3ca8 Author: Jacopo Mondi Date: Tue Jun 12 05:43:24 2018 -0400 media: rcar-vin: Remove two empty lines Remove un-necessary empty lines. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 30e99ed6dbdde68f5ad23db3a5872c3c247526b6 Author: Wei Yongjun Date: Tue Jul 3 13:45:12 2018 +0000 net: sched: act_pedit: fix possible memory leak in tcf_pedit_init() 'keys_ex' is malloced by tcf_pedit_keys_ex_parse() in tcf_pedit_init() but not all of the error handle path free it, this may cause memory leak. This patch fix it. Fixes: 71d0ed7079df ("net/act_pedit: Support using offset relative to the conventional network headers") Signed-off-by: Wei Yongjun Acked-by: Cong Wang Signed-off-by: David S. Miller commit d24c029ed3fb64f4b61ff38b8db4e2b35fa140a8 Author: Jacopo Mondi Date: Tue Jun 12 05:43:23 2018 -0400 media: rcar-vin: Rename 'digital' to 'parallel' As the term 'digital' is used all over the rcar-vin code in place of 'parallel', rename all the occurrencies. Signed-off-by: Jacopo Mondi Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e35f702151346b7a97979d9d78d66ab461ba366f Author: Hans Verkuil Date: Mon Jul 2 11:36:06 2018 -0400 media: vim2m: add media device Request API requires a media node. Add one to the vim2m driver so we can use requests with it. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit be2fff656322e82f215730839063c2c2ca73d14b Author: Ezequiel Garcia Date: Mon Jul 2 11:36:05 2018 -0400 media: add helpers for memory-to-memory media controller A memory-to-memory pipeline device consists in three entities: two DMA engine and one video processing entities. The DMA engine entities are linked to a V4L interface. This commit add a new v4l2_m2m_{un}register_media_controller API to register this topology. For instance, a typical mem2mem device topology would look like this: Device topology - entity 1: source (1 pad, 1 link) type Node subtype V4L flags 0 pad0: Source -> "proc":1 [ENABLED,IMMUTABLE] - entity 3: proc (2 pads, 2 links) type Node subtype Unknown flags 0 pad0: Source -> "sink":0 [ENABLED,IMMUTABLE] pad1: Sink <- "source":0 [ENABLED,IMMUTABLE] - entity 6: sink (1 pad, 1 link) type Node subtype V4L flags 0 pad0: Sink <- "proc":0 [ENABLED,IMMUTABLE] [hans.verkuil@cisco.com: mark interface links as IMMUTABLE] Suggested-by: Laurent Pinchart Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 26064848efbca49c643d1237dc1f8215515d52ee Author: Aaro Koskinen Date: Tue Jun 19 23:52:30 2018 +0300 powerpc: Enable kernel XZ compression option on BOOK3S_32 Enable kernel XZ compression option on BOOK3S_32. Tested on G4 PowerBook. Signed-off-by: Aaro Koskinen [mpe: Use one select under the PPC symbol guarded by if PPC_BOOK3S] Signed-off-by: Michael Ellerman commit 1b80ac648483189e45f60d4ddbb54b78ca942849 Author: Kees Cook Date: Fri Jun 29 11:52:54 2018 -0700 powerpc/msi: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this switches from an unchanging variable to a constant expression to eliminate the VLA generation. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Michael Ellerman commit 00c376fdd7ed6cc083da3a3c51a63a75f270d647 Author: Alexey Kardashevskiy Date: Mon Jul 2 17:42:05 2018 +1000 powerpc/powernv/ioda2: Add 256M IOMMU page size to the default POWER8 case The sketchy bypass uses 256M pages so add this page size as well. This should cause no behavioral change but will be used later. Fixes: 477afd6ea6 "powerpc/ioda: Use ibm,supported-tce-sizes for IOMMU page size mask" Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 4d1e4545a65903a09f5d15d32a3fbb6131a8d11e Author: Hans Verkuil Date: Mon Jul 2 08:43:02 2018 -0400 media: mark entity-intf links as IMMUTABLE Currently links between entities and an interface are just marked as ENABLED. But (at least today) these links cannot be disabled by userspace or the driver, so they should also be marked as IMMUTABLE. It might become possible that drivers can disable such links (if for some reason the device node cannot be used), so we might need to add a new link flag at some point to mark interface links that can be changed by the driver but not by userspace. Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8950329c4a64c6d3ca0bc34711a1afbd9ce05657 Author: Hari Bathini Date: Thu Jun 28 10:49:56 2018 +0530 powerpc/kdump: Handle crashkernel memory reservation failure Memory reservation for crashkernel could fail if there are holes around kdump kernel offset (128M). Fail gracefully in such cases and print an error message. Signed-off-by: Hari Bathini Tested-by: David Gibson Reviewed-by: Dave Young Signed-off-by: Michael Ellerman commit 7184e7e7d9df8147d8c065de0233a7ed360cff85 Merge: f744c4bb5ca5 a14e9fafaa34 Author: David S. Miller Date: Wed Jul 4 21:40:02 2018 +0900 Merge branch 'bridge-iproute2-isolated-port-and-selftests' Nikolay Aleksandrov says: ==================== bridge: iproute2 isolated port and selftests Add support to iproute2 for port isolation config and selftests for it. ==================== Signed-off-by: David S. Miller commit a14e9fafaa3437a5e73e6ff521d3a351f173799b Author: Nikolay Aleksandrov Date: Tue Jul 3 15:42:44 2018 +0300 selftests: forwarding: test for bridge port isolation This test checks if the bridge port isolation feature works as expected by performing ping/ping6 tests between hosts that are isolated (should not work) and between an isolated and non-isolated hosts (should work). Same test is performed for flooding from and to isolated and non-isolated ports. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 967450c54300fd858b24e044ee960a1133c916a4 Author: Nikolay Aleksandrov Date: Tue Jul 3 15:42:43 2018 +0300 selftests: forwarding: lib: extract ping and ping6 so they can be reused Extract ping and ping6 command execution so the return value can be checked by the caller, this is needed for port isolation tests that are intended to fail. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 0245abf8206fb573a3977558de2b7b2be6f3d9f8 Author: Hans Verkuil Date: Fri Jun 29 06:12:43 2018 -0400 media: v4l2-ctrls.c: fix broken auto cluster handling When you switch from auto to manual mode for an auto-cluster (e.g. autogain+gain controls), then the current HW value has to be copied to the current control value. However, has_changed was never set to true, so new_to_cur didn't actually copy this value. Reported-by: Hugues FRUCHET Tested-by: Hugues FRUCHET Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f744c4bb5ca59289616c7d583dae6d28268f5486 Merge: e7e3728bd776 6369fec5be0a Author: David S. Miller Date: Wed Jul 4 21:30:47 2018 +0900 Merge branch 'vhost_net-Avoid-vq-kicks-during-busyloop' Toshiaki Makita says: ==================== vhost_net: Avoid vq kicks during busyloop Under heavy load vhost tx busypoll tend not to suppress vq kicks, which causes poor guest tx performance. The detailed scenario is described in commitlog of patch 2. Rx seems not to have that serious problem, but for consistency I made a similar change on rx to avoid rx wakeups (patch 3). Additionary patch 4 is to avoid rx kicks under heavy load during busypoll. Tx performance is greatly improved by this change. I don't see notable performance change on rx with this series though. Performance numbers (tx): - Bulk transfer from guest to external physical server. [Guest]->vhost_net->tap--(XDP_REDIRECT)-->i40e --(wire)--> [Server] - Set 10us busypoll. - Guest disables checksum and TSO because of host XDP. - Measured single flow Mbps by netperf, and kicks by perf kvm stat (EPT_MISCONFIG event). Before After Mbps kicks/s Mbps kicks/s UDP_STREAM 1472byte 247758 27 Send 3645.37 6958.10 Recv 3588.56 6958.10 1byte 9865 37 Send 4.34 5.43 Recv 4.17 5.26 TCP_STREAM 8801.03 45794 9592.77 2884 v2: - Split patches into 3 parts (renaming variables, tx-kick fix, rx-wakeup fix). - Avoid rx-kicks too (patch 4). - Don't memorize endtime as it is not needed for now. ==================== Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 6369fec5be0aad4965bb13cc8f26a621ff39cc65 Author: Toshiaki Makita Date: Tue Jul 3 16:31:34 2018 +0900 vhost_net: Avoid rx vring kicks during busyloop We may run out of avail rx ring descriptor under heavy load but busypoll did not detect it so busypoll may have exited prematurely. Avoid this by checking rx ring full during busypoll. Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Signed-off-by: David S. Miller commit be294a51adfc1e1d9884e34480c34e4388f27904 Author: Toshiaki Makita Date: Tue Jul 3 16:31:33 2018 +0900 vhost_net: Avoid rx queue wake-ups during busypoll We may run handle_rx() while rx work is queued. For example a packet can push the rx work during the window before handle_rx calls vhost_net_disable_vq(). In that case busypoll immediately exits due to vhost_has_work() condition and enables vq again. This can lead to another unnecessary rx wake-ups, so poll rx work instead of enabling the vq. Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Signed-off-by: David S. Miller commit 027b17603b030f1334ade079b7a3e986569c956b Author: Toshiaki Makita Date: Tue Jul 3 16:31:32 2018 +0900 vhost_net: Avoid tx vring kicks during busyloop Under heavy load vhost busypoll may run without suppressing notification. For example tx zerocopy callback can push tx work while handle_tx() is running, then busyloop exits due to vhost_has_work() condition and enables notification but immediately reenters handle_tx() because the pushed work was tx. In this case handle_tx() tries to disable notification again, but when using event_idx it by design cannot. Then busyloop will run without suppressing notification. Another example is the case where handle_tx() tries to enable notification but avail idx is advanced so disables it again. This case also leads to the same situation with event_idx. The problem is that once we enter this situation busyloop does not work under heavy load for considerable amount of time, because notification is likely to happen during busyloop and handle_tx() immediately enables notification after notification happens. Specifically busyloop detects notification by vhost_has_work() and then handle_tx() calls vhost_enable_notify(). Because the detected work was the tx work, it enters handle_tx(), and enters busyloop without suppression again. This is likely to be repeated, so with event_idx we are almost not able to suppress notification in this case. To fix this, poll the work instead of enabling notification when busypoll is interrupted by something. IMHO vhost_has_work() is kind of interruption rather than a signal to completely cancel the busypoll, so let's run busypoll after the necessary work is done. Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Signed-off-by: David S. Miller commit 28b9b33b983f4de3ce9e660e3efe1e08adabf779 Author: Toshiaki Makita Date: Tue Jul 3 16:31:31 2018 +0900 vhost_net: Rename local variables in vhost_net_rx_peek_head_len So we can easily see which variable is for which, tx or rx. Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Signed-off-by: David S. Miller commit 662a99e145661c2b35155cf375044deae9b79896 Author: Alexey Khoroshilov Date: Fri Jun 29 17:49:22 2018 -0400 media: fsl-viu: fix error handling in viu_of_probe() viu_of_probe() ignores fails in i2c_get_adapter(), tries to unlock uninitialized mutex on error path. The patch streamlining the error handling in viu_of_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b8f8e559c71980c527d8697d274d53809c61aa37 Author: Philipp Zabel Date: Fri Jun 29 08:47:20 2018 -0400 media: coda: mark CODA960 firmware version 2.1.9 as supported This patch adds the i.MX6 CODA960 firmware versions 2.1.9 (revision 32515) to the list of supported firmware versions. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2b84e2a0092c74e4ccc7933a06014e850c905a55 Author: Philipp Zabel Date: Fri Jun 29 08:46:48 2018 -0400 media: coda: jpeg: explicitly disable thumbnails in SEQ_INIT Explicitly clear DEC_SEQ_JPG_THUMB_EN during sequence initialization. Not clearing the register does not cause problems, since the only other codec (MPEG-4 decode) that writes to this register happens to always write 0 as well. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e7e3728bd776d1d1450212ad266832f1003f833f Author: Qiaobin Fu Date: Sun Jul 1 15:16:27 2018 -0400 net:sched: add action inheritdsfield to skbedit The new action inheritdsfield copies the field DS of IPv4 and IPv6 packets into skb->priority. This enables later classification of packets based on the DS field. v5: *Update the drop counter for TC_ACT_SHOT v4: *Not allow setting flags other than the expected ones. *Allow dumping the pure flags. v3: *Use optional flags, so that it won't break old versions of tc. *Allow users to set both SKBEDIT_F_PRIORITY and SKBEDIT_F_INHERITDSFIELD flags. v2: *Fix the style issue *Move the code from skbmod to skbedit Original idea by Jamal Hadi Salim Signed-off-by: Qiaobin Fu Reviewed-by: Michel Machado Acked-by: Jamal Hadi Salim Reviewed-by: Marcelo Ricardo Leitner Acked-by: Davide Caratti Signed-off-by: David S. Miller commit 968d72e6a5105a18fe17c0a8b4ef2951d0eb42dd Author: Dan Carpenter Date: Wed Jul 4 12:48:10 2018 +0300 drm/savage: off by one in savage_bci_cmdbuf() The > should be >= here so that we don't read beyond the end of the dma->buflist[] array. Signed-off-by: Dan Carpenter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180704094810.whrgn6jxe7uibnfv@kili.mountain commit 86b30a671b3bbe376ad7679ae3c1436c2a8f4510 Author: Philipp Zabel Date: Fri Jun 29 08:46:47 2018 -0400 media: coda: jpeg: only queue two buffers into the bitstream for JPEG on CODA7541 Padding the bitstream buffer is not enough to reliably avoid prefetch failures. Picture runs with the next buffer's header already visible to the CODA7541 succeed much more reliably, so always queue two JPEG frames into the bitstream buffer. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1e3e2a9ac40ad4d11699a49a1bbbf40cd8d4c8bd Author: Philipp Zabel Date: Fri Jun 29 08:46:46 2018 -0400 media: coda: jpeg: allow non-JPEG colorspace The hardware codec is not colorspace aware. We should trust userspace to set the correct colorimetry information on the OUTPUT queue and mirror the exact same setting on the CAPTURE queue. There is no reason to restrict colorspace to JPEG for JPEG images, if userspace injects the correct colorspace information into the JPEG headers after encoding. Fixes: b14ac545688d ("[media] coda: improve colorimetry handling") Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4d2096b4695623e3683cd41a96d6d0af6a5acf87 Author: Philipp Zabel Date: Fri Jun 29 08:42:08 2018 -0400 media: coda: clear hold flag on streamoff If new buffers are queued after streamoff, the flag will be cleared anyway, so this is mostly for the purpose of correctness. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 83a729530a3a8a40dd529c72e4c3fe491d9bce68 Author: Hans Verkuil Date: Fri Jun 29 05:40:41 2018 -0400 media: vivid: fix gain when autogain is on In the vivid driver you want gain to continuous change while autogain is on. However, dev->jiffies_vid_cap doesn't actually change. It probably did in the past, but changes in the code caused this to be a fixed value that is only set when you start streaming. Replace it by jiffies, which is always changing. [mchehab@kernel.org: use jiffies_to_msecs() instead of dividing by HZ] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9f84310d88304bb2f2b154ba740ecc3a6326c175 Author: Philipp Zabel Date: Thu Jun 28 11:47:09 2018 -0400 media: coda: fix reorder detection for unknown levels Whether reordering should be enabled only depends on the h.264 profile. Stop parsing the level and drop the debug message, profile and level can now be determined via read-only decoder controls. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 42a68012e67c2613e0570d462c5a0bd9a1527048 Author: Philipp Zabel Date: Thu Jun 28 11:47:08 2018 -0400 media: coda: add read-only h.264 decoder profile/level controls The decoder profile/level controls initially can be used to determine supported profiles and levels. The values are set for a given stream once the headers are parsed. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 18c227af2c90eee06bd90f751a4b1193ee209d56 Author: Philipp Zabel Date: Thu Jun 28 11:44:12 2018 -0400 media: coda: fix encoder source stride The encoder picture run command takes a picture source stride parameter. This must be set to the output queue's bytesperline, not width. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 421860b9d47053badce4b247576fa48df9ab4c48 Author: Steve Longerbeam Date: Wed Jun 27 14:39:43 2018 -0400 media: v4l2-ctrls: Fix CID base conflict between MAX217X and IMX When the imx-media driver was initially merged, there was a conflict with 8d67ae25 ("media: v4l2-ctrls: Reserve controls for MAX217X") which was not fixed up correctly, resulting in V4L2_CID_USER_MAX217X_BASE and V4L2_CID_USER_IMX_BASE taking on the same value. Fix by assigning imx CID base the next available range at 0x10b0. Signed-off-by: Steve Longerbeam Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit de3e581f31626a9e5697ea1581967729fcffdd1d Author: Ezequiel Garcia Date: Fri Jun 15 15:07:32 2018 -0400 media: stk1160: Set the vb2_queue lock before calling vb2_queue_init The vb2_queue will soon be mandatory. The videobuf2 core will throw a verbose warning if it's not set. The stk1160 driver is setting the queue lock, but after the vb2_queue_init call. Avoid the warning by setting the lock before the queue initialization. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1d120649a81e5fc71151cbe8d6d82c58f7777160 Author: Ezequiel Garcia Date: Fri Jun 15 15:07:31 2018 -0400 media: m2m-deinterlace: Implement wait_prepare and wait_finish This driver is currently specifying a video_device lock, which means it is protecting all the ioctls (including queue ioctls) with a single mutex. It's therefore straightforward to implement wait_prepare and wait_finish, by explicitly setting the vb2_queue lock. Having these callbacks releases the queue lock while blocking, which improves latency by allowing for example streamoff or qbuf operations while waiting in dqbuf. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a4273abcd3e40f7e8fe9c5347dea1e0a6b9ccadb Author: Ezequiel Garcia Date: Fri Jun 15 15:07:30 2018 -0400 media: mx_emmaprp: Implement wait_prepare and wait_finish This driver is currently specifying a video_device lock, which means it is protecting all the ioctls (including queue ioctls) with a single mutex. It's therefore straightforward to implement wait_prepare and wait_finish, by explicitly setting the vb2_queue lock. Having these callbacks releases the queue lock while blocking, which improves latency by allowing for example streamoff or qbuf operations while waiting in dqbuf. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4e55969f2308129b0fd1aa90438553728e21ec7d Author: Ezequiel Garcia Date: Fri Jun 15 15:07:29 2018 -0400 media: davinci_vpfe: Add video_device and vb2_queue locks Currently, this driver does not serialize its video4linux ioctls, which is a bug, as race conditions might appear. In addition, video_device and vb2_queue locks are now both mandatory. Add them, and implement wait_prepare and wait_finish. To stay on the safe side, this commit uses a single mutex for both locks. Better latency can be obtained by separating these if needed. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e5e4c9c962742b7f8dc8efc3b67f03add20fe467 Author: Ezequiel Garcia Date: Fri Jun 15 15:07:27 2018 -0400 media: staging: bcm2835-camera: Provide lock for vb2_queue Use the device mutex to protect the vb2_queue. This allows to replace the ad-hoc wait_{prepare, finish} with vb2_ops_wait_{prepare, finish}. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b53e19e16153ff8a0a560151ed27c3bc8d846de2 Author: Ezequiel Garcia Date: Fri Jun 15 15:07:26 2018 -0400 media: s5p-g2d: Implement wait_prepare and wait_finish This driver is currently specifying a vb2_queue lock, which means it straightforward to implement wait_prepare and wait_finish. Having these callbacks releases the queue lock while blocking, which improves latency by allowing for example streamoff or qbuf operations while waiting in dqbuf. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f1db5d978d88c75cfb1bcac74fbf06f77b86b7c3 Author: Ezequiel Garcia Date: Fri Jun 15 15:07:25 2018 -0400 media: mtk-mdp: Add locks for capture and output vb2_queues Use the mutex in struct mtk_mdp_ctx to protect the capture and output vb2_queues. This allows to replace the ad-hoc wait_{prepare, finish} with vb2_ops_wait_{prepare, finish}. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cd63c0288fd760ce7de247fba618e2bbcfc0c35c Author: Ezequiel Garcia Date: Fri Jun 15 15:07:22 2018 -0400 media: sta2x11: Add video_device and vb2_queue locks Currently, this driver does not serialize its video4linux ioctls, which is a bug, as race conditions might appear. In addition, video_device and vb2_queue locks are now both mandatory. Add them, and implement wait_prepare and wait_finish. To stay on the safe side, this commit uses a single mutex for both locks. Better latency can be obtained by separating these if needed. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d862bc08ffcb45316962a4d59c6d4ffb51f9dbfa Author: Hans Verkuil Date: Fri Jun 15 15:07:21 2018 -0400 media: v4l2-ioctl.c: use correct vb2_queue lock for m2m devices For m2m devices the vdev->queue lock was always taken instead of the lock for the specific capture or output queue. Now that we pushed the locking down into __video_do_ioctl() we can pick the correct lock and potentially improve the performance of m2m devices. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 19d38b235b88e0d28e40fb091b52fc10050e0d5e Author: Luca Ceresoli Date: Mon Jun 11 07:35:38 2018 -0400 media: imx274: fix typo pd -> pad Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7ff67863c690fbe1e10c70cefbb718b36c155a32 Author: Luca Ceresoli Date: Mon Jun 11 07:35:36 2018 -0400 media: imx274: simplify imx274_write_table() imx274_write_table() is a mere wrapper (and the only user) to imx274_regmap_util_write_table_8(). Remove this useless indirection by merging the two functions into one. Also get rid of the wait_ms_addr and end_addr parameters since it does not make any sense to give them any values other than IMX274_TABLE_WAIT_MS and IMX274_TABLE_END. Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0b4c9553b135a511f3c5c565ea2b48e801a5f81f Author: Luca Ceresoli Date: Mon Jun 11 07:35:35 2018 -0400 media: imx274: actually use IMX274_DEFAULT_MODE IMX274_DEFAULT_MODE is defined but not used. Start using it, so the default can be more easily changed without digging into the code. Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4317322d5a10467e75cfb5b12e13e5e6f3261b25 Author: Luca Ceresoli Date: Mon Jun 11 07:35:34 2018 -0400 media: imx274: get rid of mode_index After restructuring struct imx274_frmfmt, the mode_index field is still in use only for two dev_dbg() calls in imx274_s_stream(). Let's remove it and avoid duplicated information. Replacing the first usage requires some rather annoying but trivial pointer math. The other one can be removed entirely since it would print the same value anyway. Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 96a2c731a4e661470d3a0a39d5efc792a22c7bba Author: Luca Ceresoli Date: Mon Jun 11 07:35:33 2018 -0400 media: imx274: consolidate per-mode data in imx274_frmfmt Data about the implemented readout modes is partially stored in imx274_formats[], the rest is scattered in several arrays. The latter are then accessed using the mode index, e.g.: min_frame_len[priv->mode_index] Consolidate all these data in imx274_formats[], and store a pointer to the selected mode (i.e. imx274_formats[priv->mode_index]) in the main device struct. This way code to use these data becomes more readable, e.g.: priv->mode->min_frame_len This removes lots of scaffolding code and keeps data about each mode in a unique place. Also remove a parameter to imx274_mode_regs() that is now unused. While this adds the mode pointer to the device struct, it does not remove the mode_index from it because mode_index is still used in two dev_dbg() calls. This will be handled in a follow-up commit. Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 438ac1fd5e1e132782795ba474b97fffbc79bbd5 Author: Luca Ceresoli Date: Mon Jun 11 07:35:32 2018 -0400 media: imx274: initialize format before v4l2 controls The current probe function calls v4l2_ctrl_handler_setup() before initializing the format info. This triggers call paths such as: imx274_probe -> v4l2_ctrl_handler_setup -> imx274_s_ctrl -> imx274_set_exposure, where priv->mode_index is accessed before being assigned. This is wrong but does not trigger a visible bug because priv is zero-initialized and 0 is the default value for priv->mode_index. But this would become a crash in follow-up commits when mode_index is replaced by a pointer that must always be valid. Fix the bug before it shows up by initializing struct members early. Signed-off-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 90ee26fb2f50e1e57f9d957a1799af1bcafd9671 Author: Bingbu Cao Date: Tue Jun 19 02:01:47 2018 -0400 media: ak7375: Add ak7375 lens voice coil driver Add a v4l2 sub-device driver for the ak7375 lens voice coil. This is a voice coil module using the i2c bus to control the focus position. ak7375 can write multiple bytes of data at a time. If more data is received instead of the stop condition after receiving one byte of data, the address inside the chip is automatically incremented and the data is written into the next address. The ak7375 can control the position with 12 bits value and consists of two 8 bit registers show as below: register 0x00(AK7375_REG_POSITION): +---+---+---+---+---+---+---+---+ |D11|D10|D09|D08|D07|D06|D05|D04| +---+---+---+---+---+---+---+---+ register 0x01: +---+---+---+---+---+---+---+---+ |D03|D02|D01|D00|---|---|---|---| +---+---+---+---+---+---+---+---+ This driver support : - set ak7375 to standby mode once suspend and turn it back to active if resume - set the position via V4L2_CID_FOCUS_ABSOLUTE ctrl [Sakari Ailus: Rename val as ret in probe, drop redundant error message] Signed-off-by: Tianshu Qiu Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 59b62e7ad0874681dc4f84cac90cc991dc265809 Author: Will Deacon Date: Wed Jul 4 11:50:50 2018 +0100 drivers/perf: Initialise return value in armpmu_request_irqs() If a PMU doesn't have any IRQs, we should return 0 from armpmu_request_irqs(), rather than uninitialised stack. Signed-off-by: Will Deacon commit 4dd3cdb281f7a3200234ed2bcaae79af15f120d2 Author: Daniel Vetter Date: Wed Jul 4 11:29:09 2018 +0200 dma-fence: Polish kernel-doc for dma-fence.c - Intro section that links to how this is exposed to userspace. - Lots more hyperlinks. - Minor clarifications and style polish v2: Add misplaced hunk of kerneldoc from a different patch. Reviewed-by: Christian König Signed-off-by: Daniel Vetter Cc: Sumit Semwal Cc: Gustavo Padovan Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20180704092909.6599-6-daniel.vetter@ffwll.ch commit ad5145164b21eb4fcb091096b1b384a3faecac64 Author: Bingbu Cao Date: Tue Jun 19 02:01:46 2018 -0400 media: dt-bindings: Add bindings for AKM ak7375 voice coil lens Add device tree bindings for AKM ak7375 voice coil lens driver. This chip is used to drive a lens in a camera module. Signed-off-by: Tianshu Qiu Signed-off-by: Bingbu Cao Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 72a361a5b91c77b33ab2533674fdcec4de3278d0 Author: Tristian Celestin Date: Sat Jun 9 18:18:06 2018 -0400 ACPI / x86: enable touchscreen on Dell Venue Pro 7139 Permanently enable the SYNA7500 touchscreen device on the Dell Venue Pro 7139. The DSDT hides the touchscreen ACPI device on the 7139 in the same fashion as the 7130, and needs to be enabled in the same way. Signed-off-by: Tristian Celestin Signed-off-by: Rafael J. Wysocki commit 6f9db69ad93cd6ab77d5571cf748ff7cdcfb0285 Author: Tristian Celestin Date: Fri Jun 15 04:50:18 2018 -0400 ACPI / PM: Default to s2idle in all machines supporting LP S0 The Dell Venue Pro 7140 supports the Low Power S0 Idle state, but does not support any of the _DSM functions that the current heuristic checks for. Since suspend-to-mem can not be safely performed on this machine, and since the bitfield check can't cover this case, it is safer to enable s2idle by default by checking for the presence of the _DSM alone and removing the bitfield check. Signed-off-by: Tristian Celestin Signed-off-by: Rafael J. Wysocki commit 30000d80b506819ae5dae926f636412a34594ed6 Author: Daniel Vetter Date: Thu May 3 16:15:17 2018 +0200 backlight: Remove obsolete comment for ->state Jani spotted this when reviewing my earlier patch to remove the driver internal usage of this field in: Commit 3cf91adaa594 ("backlight: Nuke BL_CORE_DRIVER1") Signed-off-by: Daniel Vetter Acked-by: Daniel Thompson Signed-off-by: Lee Jones commit c8cc0f0460bb53e1a731097c7cdfdb4973c7cfcf Author: Enric Balletbo i Serra Date: Mon Apr 9 10:33:33 2018 +0200 dt-bindings: pwm-backlight: Move brightness-levels to optional The patch 'backlight: pwm_bl: compute brightness of LED linearly to human eye' introduced a default brightness-levels table that is used when brightness-levels is not available in the dts. So move brightness-levels and default-brightness-level to be optional. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Rob Herring Acked-by: Daniel Thompson Signed-off-by: Lee Jones commit 88ba95bedb7958a89ba107a11d9863ca58b64f22 Author: Enric Balletbo i Serra Date: Mon Apr 9 10:33:32 2018 +0200 backlight: pwm_bl: Compute brightness of LED linearly to human eye When you want to change the brightness using a PWM signal, one thing you need to consider is how human perceive the brightness. Human perceive the brightness change non-linearly, we have better sensitivity at low luminance than high luminance, so to achieve perceived linear dimming, the brightness must be matches to the way our eyes behave. The CIE 1931 lightness formula is what actually describes how we perceive light. This patch computes a default table with the brightness levels filled with the numbers provided by the CIE 1931 algorithm, the number of the brightness levels is calculated based on the PWM resolution. The calculation of the table using the CIE 1931 algorithm is enabled by default when you do not define the 'brightness-levels' propriety in your device tree. Signed-off-by: Enric Balletbo i Serra Acked-by: Daniel Thompson Signed-off-by: Lee Jones commit 1e5e7cc794b5a332c23216dade0a2e937d694b7f Author: Enric Balletbo i Serra Date: Mon Apr 9 10:33:31 2018 +0200 dt-bindings: pwm-backlight: Add a num-interpolation-steps property The num-interpolated-steps property specifies the number of interpolated steps between each value of brightness-level table. This is useful for high resolution PWMs to not have to list out every possible value in the brightness-level array. Signed-off-by: Enric Balletbo i Serra Acked-by: Daniel Thompson Reviewed-by: Rob Herring Signed-off-by: Lee Jones commit 573fe6d1c25c81b0af856ffafb516db7e8d978c5 Author: Enric Balletbo i Serra Date: Mon Apr 9 10:33:30 2018 +0200 backlight: pwm_bl: Linear interpolation between brightness-levels Setting num-interpolated-steps in the dts will allow you to have linear interpolation between values of brightness-levels. This way a high resolution pwm duty cycle can be used without having to list out every possible value in the dts. This system also allows for gamma corrected values. The most simple example is interpolate between two brightness values a number of steps, this can be done setting the following in the dts: brightness-levels = <0 65535>; num-interpolated-steps = <1024>; default-brightness-level = <512>; This will create a brightness-level table with the following values: <0 63 126 189 252 315 378 441 ... 64260 64323 64386 64449 65535> Another use case can be describe a gamma corrected curve, as we have better sensitivity at low luminance than high luminance we probably want have smaller steps for low brightness levels values and bigger steps for high brightness levels values. This can be achieved with the following in the dts: brightness-levels = <0 4096 65535>; num-interpolated-steps = <1024>; default-brightness-level = <512>; This will create a brightness-levels table with the following values: <0 4 8 12 16 20 ... 4096 4156 4216 4276 ... 65535> Signed-off-by: Enric Balletbo i Serra Acked-by: Daniel Thompson Signed-off-by: Lee Jones commit dc75e733308c3673d88664fe5e6b9478fa6bec4d Author: Deepak Rawat Date: Wed Jun 13 13:53:28 2018 -0700 drm/vmwgfx: Update the device headers This change updates the device headers to the latest device version. Where renaming affects the existing code, it's updated accordingly. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit ad5728ce21398926a1215ebb38570113fa8edd99 Author: Kees Cook Date: Tue Jul 3 12:52:21 2018 -0700 RAID/s390: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this moves the "$#" replacement from being an argument to being inside the function, which avoids generating VLAs. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Martin Schwidefsky commit d2f2df69885d0548ed5c0ba8fa2751497ba62352 Author: Sebastian Ott Date: Tue Jul 3 13:06:45 2018 +0200 s390/dasd: fix cast-function-type warnings Change the tasklets parameter type to fix W=1 warnings when building with gcc 8 like below: drivers/s390/block/dasd.c: In function 'dasd_alloc_device': drivers/s390/block/dasd.c:129:8: warning: cast between incompatible function types from 'void (*)(struct dasd_device *)' to 'void (*)(long unsigned int)' [-Wcast-function-type] (void (*)(unsigned long)) dasd_device_tasklet, ^ Signed-off-by: Sebastian Ott Acked-by: Jan Höppner Signed-off-by: Martin Schwidefsky commit 0ac942826b3d900b7054f71bb6a15428441458d2 Author: Sebastian Ott Date: Fri Apr 8 17:55:19 2016 +0200 s390/pci: add fmt3 fmb Add support for format 3 function measurement blocks. Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit c287572b739ad18b7fd298f3af3bec21037a55f7 Author: Marek Vasut Date: Mon Jun 11 13:58:51 2018 +0200 mfd: da9063: Add DA9063L support Add support for DA9063L, which is a reduced variant of the DA9063 with less regulators and without RTC. Signed-off-by: Marek Vasut Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Acked-by: Steve Twiss Signed-off-by: Lee Jones commit 1c892e38ce59c82998e5444c8516ccb23a4e426f Author: Marek Vasut Date: Mon Jun 11 13:58:50 2018 +0200 regulator: da9063: Handle less LDOs on DA9063L Move the LDOs present only on DA9063 at the end of the list, so that the DA9063L can simply indicate less LDOs and still share the list of regulators with DA9063. Signed-off-by: Marek Vasut Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Signed-off-by: Lee Jones commit c2ffec5e4bb6091bfd7b8dbe835df5059ef5b3f2 Author: Marek Vasut Date: Mon Jun 11 13:58:49 2018 +0200 mfd: da9063: Register RTC only on DA9063L The DA9063L does not contain RTC block, unlike the full DA9063. Split the RTC block into separate mfd cell and register it only on DA9063. Signed-off-by: Marek Vasut Signed-off-by: Lee Jones commit 4ad5a999c46003e26356104e7e5ae5a656a2dae5 Author: Marek Vasut Date: Mon Jun 11 13:58:48 2018 +0200 mfd: da9063: Add custom IRQ map for DA9063L The DA9063L does not have an RTC. Add custom IRQ map for DA9063L to ignore the Alarm and Tick IRQs from the PMIC. Signed-off-by: Marek Vasut Signed-off-by: Lee Jones commit 4bd6ad0adb078db7cc774b5be69e55f4c9374693 Author: Marek Vasut Date: Mon Jun 11 13:58:47 2018 +0200 mfd: da9063: Add custom regmap for DA9063L The DA9063L does not have an RTC. Add custom regmap for DA9063L to prevent access into that register block. Signed-off-by: Marek Vasut Signed-off-by: Lee Jones commit 8ae81814cca96a4b7f66dcf1aeb904a0a077f7f4 Author: Marek Vasut Date: Mon Jun 11 13:58:46 2018 +0200 mfd: da9063: Add DA9063L type Add type for DA9063L, which is a reduced variant of the DA9063 without RTC block and with less regulators. Signed-off-by: Marek Vasut Reviewed-by: Geert Uytterhoeven Acked-by: Steve Twiss Signed-off-by: Lee Jones commit 492510dd7d39794e809d8218a2839e857c101ce5 Author: Marek Vasut Date: Mon Jun 11 13:58:45 2018 +0200 mfd: da9063: Replace model with type The model number stored in the struct da9063 is the same for all variants of the da9063 since it is the chip ID, which is always the same. Replace that with a separate identifier instead, which allows us to discern the DA9063 variants by setting the type based on either DT match or otherwise. Signed-off-by: Marek Vasut Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Signed-off-by: Lee Jones commit df7878f9dc77a9f630893811f0401bc021df4fbf Author: Marek Vasut Date: Mon Jun 11 13:58:44 2018 +0200 mfd: da9063: Rename PMIC_DA9063 to PMIC_CHIP_ID_DA9063 The PMIC_DA9063 is a complete misnomer, it denotes the value of the DA9063 chip ID register, so rename it as such. It is also the value of chip ID register of DA9063L though, so drop the enum as all the DA9063 "models" share the same chip ID and thus the distinction will have to be made using DT or otherwise. Signed-off-by: Marek Vasut Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Acked-by: Steve Twiss Signed-off-by: Lee Jones commit c727eea92c9232169c0d375309718fb398aaec67 Author: Marek Vasut Date: Mon Jun 11 13:58:43 2018 +0200 mfd: da9063: Replace DA9063_NUM_IRQ with ARRAY_SIZE Replace DA9063_NUM_IRQ macro which is not used anywhere with plain ARRAY_SIZE(). Signed-off-by: Marek Vasut Reviewed-by: Geert Uytterhoeven Signed-off-by: Lee Jones commit 152bed762ad95373279dc15044706f59c2f39638 Author: Marek Vasut Date: Mon Jun 11 13:58:42 2018 +0200 mfd: da9063: Use PLATFORM_DEVID_NONE Use PLATFORM_DEVID_NONE instead of -1 in mfd_add_devices. Signed-off-by: Marek Vasut Reviewed-by: Geert Uytterhoeven Signed-off-by: Lee Jones commit 8b55734dc8bdc2327d78fcace3811e64a7c7cfec Author: Marek Vasut Date: Mon Jun 11 13:58:41 2018 +0200 mfd: da9063: Use REGMAP_IRQ_REG Convert the regmap_irq table to use REGMAP_IRQ_REG(). Signed-off-by: Marek Vasut Acked-by: Steve Twiss Reviewed-by: Geert Uytterhoeven Signed-off-by: Lee Jones commit 2905086def931d70e61ffd912b1c0ab7c15c6f85 Author: Marek Vasut Date: Mon Jun 11 13:58:40 2018 +0200 mfd: da9063: Use regmap_reg_range Convert the regmap_range tables to use regmap_reg_range() macro. Signed-off-by: Marek Vasut Reviewed-by: Geert Uytterhoeven Signed-off-by: Lee Jones commit af8df945876c027969fafefb9ec07b79cfadb16f Author: Marek Vasut Date: Mon Jun 11 13:58:39 2018 +0200 mfd: da9063: Replace mfd_add_devices with devm counterpart Use devm_mfd_add_devices() instead of plain mfd_add_devices(), which removes the need for da9063_device_exit() altogether and also for the .remove callback in da9063-i2c.c . Signed-off-by: Marek Vasut Signed-off-by: Lee Jones commit 7494de0454af50215bc46c93c83b88a32ca39fab Author: Marek Vasut Date: Mon Jun 11 13:58:38 2018 +0200 mfd: da9063: Replace regmap_add_irq_chip with devm counterpart Use devm_regmap_add_irq_chip() instead of plain regmap_add_irq_chip(), which removes the need for da9063_irq_exit() altogether and also fixes a bug in da9063_device_init() where the da9063_irq_exit() was not called in a failpath. Signed-off-by: Marek Vasut Signed-off-by: Lee Jones commit 3144dce72b7c53a0ca9f054c8187925c40381caa Author: Enric Balletbo i Serra Date: Wed May 2 17:44:18 2018 +0200 mfd: cros_ec_dev: Register cros_usbpd-charger driver as a subdevice. Check whether this EC instance has USBPD host command support and instatiate the cros_usbpd-charger driver as a subdevice in such case. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Lee Jones commit 06635894a371be69373fcb5484f559284c8d1ac3 Author: Sameer Nanda Date: Wed May 2 17:44:16 2018 +0200 mfd: cros_ec: Add USBPD charger commands and struct definitions. The USBPD charger driver gets information from the ChromeOS EC, this patch adds the USBPD charger definitions needed by this driver. Signed-off-by: Sameer Nanda Signed-off-by: Enric Balletbo i Serra Signed-off-by: Lee Jones commit f145b0a707ac2abbc40c107b10cb3969b9d7e7ad Merge: 2d1b138505dc 239e754af854 Author: David S. Miller Date: Wed Jul 4 14:18:46 2018 +0900 Merge branch 'More-mirror-to-gretap-tests-with-bridge-in-UL' Petr Machata says: ==================== More mirror-to-gretap tests with bridge in UL This patchset adds two more tests where the mirror-to-gretap has a bridge in underlay packet path, without a VLAN above or below that bridge. In patch #1, a non-VLAN-filtering bridge is tested. In patch #2, a VLAN-filtering bridge is tested. ==================== Signed-off-by: David S. Miller commit 239e754af854137f300e7d3ea199684c3e02a888 Author: Petr Machata Date: Mon Jul 2 19:58:56 2018 +0200 selftests: forwarding: Test mirror-to-gretap w/ UL 802.1q Test for "tc action mirred egress mirror" that mirrors to gretap when the underlay route points at a VLAN-aware bridge (802.1q). Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 35c31d5c323f14ddd70c3382ca0a65b0b92d02ee Author: Petr Machata Date: Mon Jul 2 19:58:49 2018 +0200 selftests: forwarding: Test mirror-to-gretap w/ UL 802.1d Test for "tc action mirred egress mirror" that mirrors to gretap when the underlay route points at a VLAN-unaware bridge (802.1d). Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 2d1b138505dc29bbd7ac5f82f5a10635ff48bddb Merge: 2bdea157b999 b9f463d6c984 Author: David S. Miller Date: Wed Jul 4 14:06:20 2018 +0900 Merge branch 'Handle-multiple-received-packets-at-each-stage' Edward Cree says: ==================== Handle multiple received packets at each stage This patch series adds the capability for the network stack to receive a list of packets and process them as a unit, rather than handling each packet singly in sequence. This is done by factoring out the existing datapath code at each layer and wrapping it in list handling code. The motivation for this change is twofold: * Instruction cache locality. Currently, running the entire network stack receive path on a packet involves more code than will fit in the lowest-level icache, meaning that when the next packet is handled, the code has to be reloaded from more distant caches. By handling packets in "row-major order", we ensure that the code at each layer is hot for most of the list. (There is a corresponding downside in _data_ cache locality, since we are now touching every packet at every layer, but in practice there is easily enough room in dcache to hold one cacheline of each of the 64 packets in a NAPI poll.) * Reduction of indirect calls. Owing to Spectre mitigations, indirect function calls are now more expensive than ever; they are also heavily used in the network stack's architecture (see [1]). By replacing 64 indirect calls to the next-layer per-packet function with a single indirect call to the next-layer list function, we can save CPU cycles. Drivers pass an SKB list to the stack at the end of the NAPI poll; this gives a natural batch size (the NAPI poll weight) and avoids waiting at the software level for further packets to make a larger batch (which would add latency). It also means that the batch size is automatically tuned by the existing interrupt moderation mechanism. The stack then runs each layer of processing over all the packets in the list before proceeding to the next layer. Where the 'next layer' (or the context in which it must run) differs among the packets, the stack splits the list; this 'late demux' means that packets which differ only in later headers (e.g. same L2/L3 but different L4) can traverse the early part of the stack together. Also, where the next layer is not (yet) list-aware, the stack can revert to calling the rest of the stack in a loop; this allows gradual/creeping listification, with no 'flag day' patch needed to listify everything. Patches 1-2 simply place received packets on a list during the event processing loop on the sfc EF10 architecture, then call the normal stack for each packet singly at the end of the NAPI poll. (Analogues of patch #2 for other NIC drivers should be fairly straightforward.) Patches 3-9 extend the list processing as far as the IP receive handler. Patches 1-2 alone give about a 10% improvement in packet rate in the baseline test; adding patches 3-9 raises this to around 25%. Performance measurements were made with NetPerf UDP_STREAM, using 1-byte packets and a single core to handle interrupts on the RX side; this was in order to measure as simply as possible the packet rate handled by a single core. Figures are in Mbit/s; divide by 8 to obtain Mpps. The setup was tuned for maximum reproducibility, rather than raw performance. Full details and more results (both with and without retpolines) from a previous version of the patch series are presented in [2]. The baseline test uses four streams, and multiple RXQs all bound to a single CPU (the netperf binary is bound to a neighbouring CPU). These tests were run with retpolines. net-next: 6.91 Mb/s (datum) after 9: 8.46 Mb/s (+22.5%) Note however that these results are not robust; changes in the parameters of the test sometimes shrink the gain to single-digit percentages. For instance, when using only a single RXQ, only a 4% gain was seen. One test variation was the use of software filtering/firewall rules. Adding a single iptables rule (UDP port drop on a port range not matching the test traffic), thus making the netfilter hook have work to do, reduced baseline performance but showed a similar gain from the patches: net-next: 5.02 Mb/s (datum) after 9: 6.78 Mb/s (+35.1%) Similarly, testing with a set of TC flower filters (kindly supplied by Cong Wang) gave the following: net-next: 6.83 Mb/s (datum) after 9: 8.86 Mb/s (+29.7%) These data suggest that the batching approach remains effective in the presence of software switching rules, and perhaps even improves the performance of those rules by allowing them and their codepaths to stay in cache between packets. Changes from v3: * Fixed build error when CONFIG_NETFILTER=n (thanks kbuild). Changes from v2: * Used standard list handling (and skb->list) instead of the skb-queue functions (that use skb->next, skb->prev). - As part of this, changed from a "dequeue, process, enqueue" model to using list_for_each_safe, list_del, and (new) list_cut_before. * Altered __netif_receive_skb_core() changes in patch 6 as per Willem de Bruijn's suggestions (separate **ppt_prev from *pt_prev; renaming). * Removed patches to Generic XDP, since they were producing no benefit. I may revisit them later. * Removed RFC tags. Changes from v1: * Rebased across 2 years' net-next movement (surprisingly straightforward). - Added Generic XDP handling to netif_receive_skb_list_internal() - Dealt with changes to PFMEMALLOC setting APIs * General cleanup of code and comments. * Skipped function calls for empty lists at various points in the stack (patch #9). * Added listified Generic XDP handling (patches 10-12), though it doesn't seem to help (see above). * Extended testing to cover software firewalls / netfilter etc. [1] http://vger.kernel.org/netconf2018_files/DavidMiller_netconf2018.pdf [2] http://vger.kernel.org/netconf2018_files/EdwardCree_netconf2018.pdf ==================== Signed-off-by: David S. Miller commit b9f463d6c9849230043123a6335d59ac7fea4d5a Author: Edward Cree Date: Mon Jul 2 16:14:44 2018 +0100 net: don't bother calling list RX functions on empty lists Generally the check should be very cheap, as the sk_buff_head is in cache. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 5fa12739a53d0780265ed9d44d9ec9ba5f9ad00a Author: Edward Cree Date: Mon Jul 2 16:14:34 2018 +0100 net: ipv4: listify ip_rcv_finish ip_rcv_finish_core(), if it does not drop, sets skb->dst by either early demux or route lookup. The last step, calling dst_input(skb), is left to the caller; in the listified case, we split to form sublists with a common dst, but then ip_sublist_rcv_finish() just calls dst_input(skb) in a loop. The next step in listification would thus be to add a list_input() method to struct dst_entry. Early demux is an indirect call based on iph->protocol; this is another opportunity for listification which is not taken here (it would require slicing up ip_rcv_finish_core() to allow splitting on protocol changes). Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 17266ee939849cb095ed7dd9edbec4162172226b Author: Edward Cree Date: Mon Jul 2 16:14:12 2018 +0100 net: ipv4: listified version of ip_rcv Also involved adding a way to run a netfilter hook over a list of packets. Rather than attempting to make netfilter know about lists (which would be a major project in itself) we just let it call the regular okfn (in this case ip_rcv_finish()) for any packets it steals, and have it give us back a list of packets it's synchronously accepted (which normally NF_HOOK would automatically call okfn() on, but we want to be able to potentially pass the list to a listified version of okfn().) The netfilter hooks themselves are indirect calls that still happen per- packet (see nf_hook_entry_hookfn()), but again, changing that can be left for future work. There is potential for out-of-order receives if the netfilter hook ends up synchronously stealing packets, as they will be processed before any accepts earlier in the list. However, it was already possible for an asynchronous accept to cause out-of-order receives, so presumably this is considered OK. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 88eb1944e18c1ba61da538ae9d1732832eb79b9d Author: Edward Cree Date: Mon Jul 2 16:13:56 2018 +0100 net: core: propagate SKB lists through packet_type lookup __netif_receive_skb_core() does a depressingly large amount of per-packet work that can't easily be listified, because the another_round looping makes it nontrivial to slice up into smaller functions. Fortunately, most of that work disappears in the fast path: * Hardware devices generally don't have an rx_handler * Unless you're tcpdumping or something, there is usually only one ptype * VLAN processing comes before the protocol ptype lookup, so doesn't force a pt_prev deliver so normally, __netif_receive_skb_core() will run straight through and pass back the one ptype found in ptype_base[hash of skb->protocol]. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 4ce0017a373afaaa9ef17614d8fa4f6fde261d18 Author: Edward Cree Date: Mon Jul 2 16:13:40 2018 +0100 net: core: another layer of lists, around PF_MEMALLOC skb handling First example of a layer splitting the list (rather than merely taking individual packets off it). Involves new list.h function, list_cut_before(), like list_cut_position() but cuts on the other side of the given entry. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 7da517a3bc529dc5399e742688b32cafa2ca5ca0 Author: Edward Cree Date: Mon Jul 2 16:13:24 2018 +0100 net: core: Another step of skb receive list processing netif_receive_skb_list_internal() now processes a list and hands it on to the next function. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 920572b73280a29e3a9f58807a8b90051b19ee60 Author: Edward Cree Date: Mon Jul 2 16:13:11 2018 +0100 net: core: unwrap skb list receive slightly further Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit e090bfb9f19259b958387d2bd4938d66b324cd09 Author: Edward Cree Date: Mon Jul 2 16:12:53 2018 +0100 sfc: batch up RX delivery Improves packet rate of 1-byte UDP receives by up to 10%. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit f6ad8c1bcdf014272d08c55b9469536952a0a771 Author: Edward Cree Date: Mon Jul 2 16:12:45 2018 +0100 net: core: trivial netif_receive_skb_list() entry point Just calls netif_receive_skb() in a loop. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 2bdea157b99903c8d344dbae44fedf033db4e2c2 Merge: 05bd97fc559d 0999f021c988 Author: David S. Miller Date: Wed Jul 4 11:36:55 2018 +0900 Merge branch 'sctp-fully-support-for-dscp-and-flowlabel-per-transport' Xin Long says: ==================== sctp: fully support for dscp and flowlabel per transport Now dscp and flowlabel are set from sock when sending the packets, but being multi-homing, sctp also supports for dscp and flowlabel per transport, which is described in section 8.1.12 in RFC6458. v1->v2: - define ip_queue_xmit as inline in net/ip.h, instead of exporting it in Patch 1/5 according to David's suggestion. - fix the param len check in sctp_s/getsockopt_peer_addr_params() in Patch 3/5 to guarantee that an old app built with old kernel headers could work on the newer kernel per Marcelo's point. ==================== Signed-off-by: David S. Miller commit 0999f021c988770a37edfb266027db9c413901fd Author: Xin Long Date: Mon Jul 2 18:21:15 2018 +0800 sctp: check for ipv6_pinfo legal sndflow with flowlabel in sctp_v6_get_dst The transport with illegal flowlabel should not be allowed to send packets. Other transport protocols already denies this. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 4be4139f7d0dc74e5a0932c7c7ddf0eb65da9e3a Author: Xin Long Date: Mon Jul 2 18:21:14 2018 +0800 sctp: add support for setting flowlabel when adding a transport Struct sockaddr_in6 has the member sin6_flowinfo that includes the ipv6 flowlabel, it should also support for setting flowlabel when adding a transport whose ipaddr is from userspace. Note that addrinfo in sctp_sendmsg is using struct in6_addr for the secondary addrs, which doesn't contain sin6_flowinfo, and it needs to copy sin6_flowinfo from the primary addr. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 0b0dce7a36fb9f1a9dd8245ea82d3a268c6943fe Author: Xin Long Date: Mon Jul 2 18:21:13 2018 +0800 sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams spp_ipv6_flowlabel and spp_dscp are added in sctp_paddrparams in this patch so that users could set sctp_sock/asoc/transport dscp and flowlabel with spp_flags SPP_IPV6_FLOWLABEL or SPP_DSCP by SCTP_PEER_ADDR_PARAMS , as described section 8.1.12 in RFC6458. As said in last patch, it uses '| 0x100000' or '|0x1' to mark flowlabel or dscp is set, so that their values could be set to 0. Note that to guarantee that an old app built with old kernel headers could work on the newer kernel, the param's check in sctp_g/setsockopt_peer_addr_params() is also improved, which follows the way that sctp_g/setsockopt_delayed_ack() or some other sockopts' process that accept two types of params does. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 8a9c58d28d0f66569737a3295116710ed24573cd Author: Xin Long Date: Mon Jul 2 18:21:12 2018 +0800 sctp: add support for dscp and flowlabel per transport Like some other per transport params, flowlabel and dscp are added in transport, asoc and sctp_sock. By default, transport sets its value from asoc's, and asoc does it from sctp_sock. flowlabel only works for ipv6 transport. Other than that they need to be passed down in sctp_xmit, flow4/6 also needs to set them before looking up route in get_dst. Note that it uses '& 0x100000' to check if flowlabel is set and '& 0x1' (tos 1st bit is unused) to check if dscp is set by users, so that they could be set to 0 by sockopt in next patch. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 69b9e1e07d98b57b972df3c44647ca8795284d39 Author: Xin Long Date: Mon Jul 2 18:21:11 2018 +0800 ipv4: add __ip_queue_xmit() that supports tos param This patch introduces __ip_queue_xmit(), through which the callers can pass tos param into it without having to set inet->tos. For ipv6, ip6_xmit() already allows passing tclass parameter. It's needed when some transport protocol doesn't use inet->tos, like sctp's per transport dscp, which will be added in next patch. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 05bd97fc559df4d26e33b0714b5327de8f610971 Author: Linus Walleij Date: Sat Jun 30 13:17:31 2018 +0200 net: dsa: Add Vitesse VSC73xx DSA router driver This adds a DSA driver for: Vitesse VSC7385 SparX-G5 5-port Integrated Gigabit Ethernet Switch Vitesse VSC7388 SparX-G8 8-port Integrated Gigabit Ethernet Switch Vitesse VSC7395 SparX-G5e 5+1-port Integrated Gigabit Ethernet Switch Vitesse VSC7398 SparX-G8e 8-port Integrated Gigabit Ethernet Switch These switches have a built-in 8051 CPU and can download and execute firmware in this CPU. They can also be configured to use an external CPU handling the switch in a memory-mapped manner by connecting to that external CPU's memory bus. This driver (currently) only takes control of the switch chip over SPI and configures it to route packages around when connected to a CPU port. The chip has embedded PHYs and VLAN support so we model it using DSA as a best fit so we can easily add VLAN support and maybe later also exploit the internal frame header to get more direct control over the switch. The four built-in GPIO lines are exposed using a standard GPIO chip. Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 975ae7c69d51154fccd7024d2e7f0347c34c6f72 Author: Linus Walleij Date: Sat Jun 30 13:17:30 2018 +0200 net: phy: vitesse: Add support for VSC73xx The VSC7385, VSC7388, VSC7395 and VSC7398 are integrated switch/router chips for 5+1 or 8-port switches/routers. When managed directly by Linux using DSA we need to do a special set-up "dance" on the PHY. Unfortunately these sequences switches the PHY to undocumented pages named 2a30 and 52b6 and does undocumented things. It is described by these opaque sequences also in the reference manual. This is a best effort to integrate it anyways. Reviewed-by: Florian Fainelli Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 1decd2ec22b91fc4ea360ddc5cc21811cd64bd68 Author: Linus Walleij Date: Sat Jun 30 13:17:29 2018 +0200 net: dsa: Add DT bindings for Vitesse VSC73xx switches This adds the device tree bindings for the Vitesse VSC73xx switches. We also add the vendor name for Vitesse. Cc: devicetree@vger.kernel.org Reviewed-by: Florian Fainelli Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit f29135ee4e0d4e01911ed569f731bfdb841cea6d Merge: eab976693153 021c91791a5e Author: Dave Airlie Date: Wed Jul 4 10:27:12 2018 +1000 Merge v4.18-rc3 into drm-next Two requests have come in for a backmerge, and I've got some pull reqs on rc2, so this just makes sense. Signed-off-by: Dave Airlie commit b68034087a6d0b16e0fc5265b98107274084ce93 Merge: 44a4c4698ee8 0b9e3d543f9f Author: David S. Miller Date: Wed Jul 4 08:53:53 2018 +0900 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2018-07-03 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Various improvements to bpftool and libbpf, that is, bpftool build speed improvements, missing BPF program types added for detection by section name, ability to load programs from '.text' section is made to work again, and better bash completion handling, from Jakub. 2) Improvements to nfp JIT's map read handling which allows for optimizing memcpy from map to packet, from Jiong. 3) New BPF sample is added which demonstrates XDP in combination with bpf_perf_event_output() helper to sample packets on all CPUs, from Toke. 4) Add a new BPF kselftest case for tracking connect(2) BPF hooks infrastructure in combination with TFO, from Andrey. 5) Extend the XDP/BPF xdp_rxq_info sample code with a cmdline option to read payload from packet data in order to use it for benchmarking. Also for '--action XDP_TX' option implement swapping of MAC addresses to avoid drops on some hardware seen during testing, from Jesper. ==================== Signed-off-by: David S. Miller commit cfe1824411ad6bed3eb05efabbd43135592fcfd7 Author: Steven J. Hill Date: Tue Jul 3 16:44:25 2018 -0500 MIPS: Octeon: Simplify CIU register functions. Collapse and simplify switch statements in functions. Signed-off-by: Steven J. Hill Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19713/ Cc: linux-mips@linux-mips.org Cc: Chandrakala Chavva commit a730c7cd4534b3ffb62d1a692f05e313b058bc38 Author: Steven J. Hill Date: Tue Jul 3 16:44:24 2018 -0500 MIPS: Octeon: Create simple macro for CIU registers. Create new CVMX_CIU_ADDR macro to improve readability. Signed-off-by: Steven J. Hill Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19712/ Cc: linux-mips@linux-mips.org Cc: Chandrakala Chavva commit c39f8ecff73b641067855fe27ef5761fdf61961a Author: Steven J. Hill Date: Tue Jul 3 16:44:23 2018 -0500 MIPS: Octeon: Remove all unused CIU macros. Get rid of all unused CIU macros and sort them. Verified with 'make allyesconfig' build test. [paul.burton@mips.com: - Also checked via convoluted grep invocation for use of all removed macros within arch/mips/ & drivers/.] Signed-off-by: Steven J. Hill Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19710/ Cc: linux-mips@linux-mips.org Cc: Chandrakala Chavva commit 9609e3e9f8de4c760f4711e3cfc7403173352c1a Author: Steven J. Hill Date: Tue Jul 3 16:44:22 2018 -0500 MIPS: Octeon: Convert CIU types to use bitfields. Convert remaining structures to use __BITFIELD_FIELD macro. Also straighten up the description text and whitespace. Signed-off-by: Steven J. Hill Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19709/ Cc: linux-mips@linux-mips.org Cc: Chandrakala Chavva commit 769f4372b2887b7c758f67f4fae82bd5b8555b59 Author: Steven J. Hill Date: Tue Jul 3 16:44:21 2018 -0500 MIPS: Octeon: Unify QLM data types in CIU header. Data types 'cvmx_ciu_qlm0' and 'cvmx_ciu_qlm1' are identical in their usage and structure. Combine them and update the PCIe code. Signed-off-by: Steven J. Hill Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19708/ Cc: linux-mips@linux-mips.org Cc: Chandrakala Chavva commit 67701aea341e9e667eae816510523982137b12e6 Author: Steven J. Hill Date: Tue Jul 3 16:44:20 2018 -0500 MIPS: Octeon: Remove unused CIU types. Remove all unused data types. Verified with a 'make allyesconfig' and Cavium platform. [paul.burton@mips.com: - Also checked via convoluted grep invocation for use of all removed structs & unions within arch/mips/ & drivers/.] Signed-off-by: Steven J. Hill Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19711/ Cc: linux-mips@linux-mips.org Cc: Chandrakala Chavva commit 11e40f5c577624d440154388d0a71bb2db0cd9f7 Author: Neil Horman Date: Fri Jun 29 07:52:06 2018 -0400 vmw_pvrdma: Release netdev when vmxnet3 module is removed On repeated module load/unload cycles, its possible for the pvrmda driver to encounter this crash: ... [ 297.032448] RIP: 0010:[] [] netdev_walk_all_upper_dev_rcu+0x50/0xb0 [ 297.034078] RSP: 0018:ffff95087780bd08 EFLAGS: 00010286 [ 297.034986] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff95087a0c0000 [ 297.036196] RDX: ffff95087a0c0000 RSI: ffffffff839e44e0 RDI: ffff950835d0c000 [ 297.037421] RBP: ffff95087780bd40 R08: ffff95087a0e0ea0 R09: abddacd03f8e0ea0 [ 297.038636] R10: abddacd03f8e0ea0 R11: ffffef5901e9dbc0 R12: ffff95087a0c0000 [ 297.039854] R13: ffffffff839e44e0 R14: ffff95087a0c0000 R15: ffff950835d0c828 [ 297.041071] FS: 0000000000000000(0000) GS:ffff95087fc00000(0000) knlGS:0000000000000000 [ 297.042443] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 297.043429] CR2: ffffffffffffffe8 CR3: 000000007a652000 CR4: 00000000003607f0 [ 297.044674] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 297.045893] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 297.047109] Call Trace: [ 297.047545] [] netdev_has_upper_dev_all_rcu+0x18/0x20 [ 297.048691] [] is_eth_port_of_netdev+0x2f/0xa0 [ib_core] [ 297.049886] [] ? is_eth_active_slave_of_bonding_rcu+0x70/0x70 [ib_core] ... This occurs because vmw_pvrdma on probe stores a pointer to the netdev that exists on function 0 of the same bus/device/slot (which represents the vmxnet3 ethernet driver). However, it never removes this pointer if the vmxnet3 module is removed, leading to crashes resulting from use after free dereferencing incidents like the one above. The fix is pretty straightforward. vmw_pvrdma should listen for NETDEV_REGISTER and NETDEV_UNREGISTER events in its event listener code block, and update the stored netdev pointer accordingly. This solution has been tested by myself and the reporter with successful results. This fix also allows the pvrdma driver to find its underlying ethernet device in the event that vmxnet3 is loaded after pvrdma, which it was not able to do before. Signed-off-by: Neil Horman Reported-by: ruquin@redhat.com Tested-by: Adit Ranadive Acked-by: Adit Ranadive Signed-off-by: Jason Gunthorpe commit a93b632c4531ff50c43d658447a45cbc11f488fd Author: Maor Gottlieb Date: Sun Jul 1 15:50:17 2018 +0300 IB/mlx5: Fix GRE flow specification Currently the driver sets the mask of the gre_protocol to 0xffff without consideration in the user request. Fix it by copy the mask from the verbs spec. Fixes: da2f22ae7707 ("IB/mlx5: Add support for GRE flow specification") Signed-off-by: Maor Gottlieb Reviewed-by: Ariel Levkovich Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0bff2a86103e7bec979df9b9ff66c823a8d82d0a Author: Mika Westerberg Date: Thu Jun 28 16:08:24 2018 +0300 i2c: i801: Add support for Intel Ice Lake Intel Ice Lake has the same SMBus host controller than Intel Cannon Lake. Add the PCI ID to the drivers list of supported devices. Signed-off-by: Mika Westerberg [jarkko.nikula@linux.intel.com: Add entries to Documentation and Kconfig] Signed-off-by: Jarkko Nikula Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit 80d943ab19e998a4c72e8accdcaea7db590c4745 Author: Jarkko Nikula Date: Thu Jun 28 14:25:53 2018 +0300 i2c: i801: Consolidate chipset names in documentation and Kconfig Make list of supported chipsets a little bit shorter by consolidating names that belong to the same family. Signed-off-by: Jarkko Nikula Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit c5907c6b96f187ddb4209a6c8843b82823e0f3d3 Author: Thierry Reding Date: Tue Jun 19 12:49:42 2018 +0200 i2c: tegra: Add support for Tegra194 In order to support advanced features, the I2C FIFO interface was changed in the version of the Tegra I2C controller found in Tegra194. The changes are backwards incompatible, so the driver needs to be programmed in a slightly different way on new chips. Add support for MST FIFO programming and add an OF match entry for Tegra194. At the same time, mark all prior generations of this controller as not having the MST FIFO interface. Acked-by: Jon Hunter Signed-off-by: Thierry Reding Signed-off-by: Wolfram Sang commit bbe899700a44af8b81dcef49f4005d9d1afe7c47 Author: Wolfram Sang Date: Fri Jun 29 11:12:47 2018 +0200 i2c: gpio: fault-injector: add incomplete_write_byte Add another injector for an incomplete transfer. As mentioned in the docs, this one is important to check bus recovery algorithms with it. Otherwise random data may be sent to devices! Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 1f6f00238abf2bfa46f4d2c44cfc7512566f3685 Author: Chris Wilson Date: Tue Jul 3 14:53:31 2018 +0100 drm/i915/selftests: Drop struct_mutex around lowlevel pggtt allocation For a ppgtt that we are constructing, there is no struct_mutex dependence so skip it. In the process, also ping the scheduler frequently to try and avoid the NMI watchdog. v2: gen6 requires struct_mutex to clean up (currently) Suggested-by: Tvrtko Ursulin References: https://bugs.freedesktop.org/show_bug.cgi?id=107094 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180703135331.12265-1-chris@chris-wilson.co.uk commit 16d55daa56cd7520055758f98f96e8544cc7713e Author: Wolfram Sang Date: Fri Jun 29 11:12:46 2018 +0200 i2c: gpio: fault-injector: refactor incomplete transfer Make the incomplete_transfer routine reusable, so we can add other test cases with different patterns later. Prepare the docs for that, too. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit d07bdbc02cdf9930da5f4b8b502c8b33a6d29fcf Author: Jarkko Nikula Date: Tue Jun 19 14:23:25 2018 +0300 i2c: designware: Add debug print for bus speed Trivial added debug print for dev->clk_freq doesn't necessarily tell the actual bus speed or mode the controller is operating. For instance it may indicate 1 MHz Fast Mode Plus or 3.4 MHz High Speed but driver ends up using 400 kHz Fast Mode due missing timing parameters or missing support from HW. Add a debug print that prints the bus speed based on the validated speed that gets programmed into a HW. Reviewed-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 1706a96b30d6011e3f6829b365ace2030a306fe3 Author: Jarkko Nikula Date: Tue Jun 19 14:23:24 2018 +0300 i2c: designware: Add debug print for SDA hold time value SDA hold time is an important timing parameter and often reason for arbitration lost errors if not set to a correct value. Add a debug print for it in order to see what value gets programmed to a HW. Reviewed-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 56b637b5b2acd2cc0a340be6ce1369cbf52d7b30 Author: Jarkko Nikula Date: Tue Jun 19 14:23:23 2018 +0300 i2c: designware: Separate timing parameter setting from HW initalization Mixed timing parameter validation, calculation and their debug prints with HW initialization in i2c_dw_init_master() and i2c_dw_init_slave() as been bothering me some time. It makes function a little bit unclear to follow, doesn't show what steps are needed to do only once during probe and what are needed whenever HW needs to be reinitialized. Also those debug prints show information that doesn't change runtime and thus are also needlessly printed multiple times whenever HW is reinitialized. Thus let the i2c_dw_init_master() and i2c_dw_init_slave() to do only HW initialization and move out one time parameter setting and debug prints to separate functions which are called only during probe. Reviewed-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 1080ee7e28e1cea86310739e5dd4612868768aed Author: Jarkko Nikula Date: Tue Jun 19 14:23:22 2018 +0300 i2c: designware: Move SDA hold time configuration to common code SDA hold time configuration is common to both master and slave code. It is also something that can be done once during probe and do only register write when HW needs to be reinitialized. Remove duplication and move SDA hold time configuration to common code. It will be called from slave probe and for master code from a new i2c_dw_set_timings_master() to where we will populate more probe time timing parameter setting. Reviewed-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 3bd4f277274bd7dde65879e5c8cd16d0b34eba90 Author: Jarkko Nikula Date: Tue Jun 19 14:23:21 2018 +0300 i2c: designware: Call i2c_dw_clk_rate() only once in i2c_dw_init_master() This is rather readability update than micro-optimization, or if not optimization at all. We take the input clock rate to a variable and pass that to SCL timing parameter calculation functions. Reviewed-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 83b2cb48cbc5c4196fcc9357836f30713f74dbc2 Author: Jarkko Nikula Date: Tue Jun 19 14:23:20 2018 +0300 i2c: designware: Don't use internal ___constant_swab32 It looks ___constant_swab32 is an internal byte swap detail. Switch to swap32() and include header file for it explicitly. Now it comes implicitly via linux/i2c.h include. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 3aca0bd6f4f87f554b1e9bbe4f6fbfb9a6eff916 Author: Jarkko Nikula Date: Tue Jun 19 14:23:19 2018 +0300 i2c: designware: Move register access detection to common code Move register access detection out from master and slave HW initialization code to common code. Motivation for this is to have register access configured before HW initialization and remove duplicated code. This allows to do further separation between probe time initialization and runtime reinitialization code. Reviewed-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 6e6bcc0d30079056ad12946fb8c51e31ebce8d07 Author: Jarkko Nikula Date: Tue Jun 19 14:23:18 2018 +0300 i2c: designware: Remove needless variable from i2c_dw_init_slave() Commit 43df43e6ba13 ("i2c: designware: Don't set SCL timings and speed mode when in slave mode") made variable comp_param1 needless in i2c_dw_init_slave(). Remove it now. Reviewed-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 38b7fb0b2ad1f2ba83bf9a8535cedb198a448ea4 Author: Chris Wilson Date: Tue Jul 3 11:18:29 2018 +0100 drm/i915/selftests: Release the struct_mutex to free the objects live_gtt is a very slow test to run, simply because it tries to allocate and use as much as the 48b address space as possibly can and in the process will try to own all of the system memory. This leads to resource exhaustion and CPU starvation; the latter impacts us when the NMI watchdog declares a task hung due to a mutex contention with ourselves. This we can prevent by releasing the struct_mutex and forcing our i915/rcu workers to run, and in particular flushing the freed object worker that is the cause for concern. References: https://bugs.freedesktop.org/show_bug.cgi?id=107094 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180703101829.7360-1-chris@chris-wilson.co.uk commit 25184082459604f0f162da1b4bf077ed15503864 Author: Peter Rosin Date: Wed Jun 20 10:51:57 2018 +0200 i2c: mux: make use of __i2c_smbus_xfer Calling the __i2c_smbus_xfer wrapper in __i2c_mux_smbus_xfer provides retries and thus makes the parent-locked case consistent with the both mux-locked (i2c_mux_smbus_xfer) and the I2C transfer cases. Signed-off-by: Peter Rosin Signed-off-by: Wolfram Sang commit 1bcb852f5bff7ae9b94777b4d844818f07b02bcd Author: Peter Rosin Date: Wed Jun 20 10:51:56 2018 +0200 i2c: mux: pca954x: make use of __i2c_smbus_xfer This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin Signed-off-by: Wolfram Sang commit a5306b803419f1fb0bf7627fcb9afd1a7d9b158c Author: Peter Rosin Date: Wed Jun 20 10:51:55 2018 +0200 i2c: mux: pca9541: make use of __i2c_smbus_xfer This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin Signed-off-by: Wolfram Sang commit d7a0aef2960dfcfbbaef136f21fd88513ad679fb Author: Peter Rosin Date: Wed Jun 20 10:51:54 2018 +0200 i2c: mux: mlxcpld: make use of __i2c_smbus_xfer This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin Acked-by: Michael Shych Signed-off-by: Wolfram Sang commit 63453b59e41173241c4efe9335815f6432fa8586 Author: Peter Rosin Date: Wed Jun 20 10:51:53 2018 +0200 i2c: smbus: add unlocked __i2c_smbus_xfer variant Removes all locking from i2c_smbus_xfer and renames it to __i2c_smbus_xfer, then adds a new i2c_smbus_xfer function that simply grabs the lock while calling the unlocked variant. This is not perfectly equivalent, since i2c_smbus_xfer was callable from atomic/irq context if you happened to end up emulating SMBus with an I2C transfer, and that is no longer the case with this patch. It is unknown (to me) if anything depends on that quirk, but it seems fragile enough to simply break those cases and require them to call i2c_transfer directly instead. While at it, for consistency rename the 2nd to last argument (size) of the i2c_smbus_xfer declaration to protocol and remove the surplus extern marker. Signed-off-by: Peter Rosin Signed-off-by: Wolfram Sang commit b7d3f17fa7a93250daec8c679bf8069715dbeb25 Author: Matthew Wilcox Date: Tue Jul 3 08:08:35 2018 -0700 fs: Add more kernel-doc to the produced documentation People have gone to all the effort of writing kernel-doc for these functions; the least we can do is put them in the "Other functions" part of the VFS documentation. Signed-off-by: Matthew Wilcox Signed-off-by: Al Viro commit 3fae17468a96f3a397dff633be82a42d89fb1b91 Author: Matthew Wilcox Date: Tue Jul 3 08:08:34 2018 -0700 fs: Fix attr.c kernel-doc A couple of minor warnings. Signed-off-by: Matthew Wilcox Signed-off-by: Al Viro commit e3091644bf2e6d21841de62d8b3e6a526c5172d5 Author: Michael J. Ruhl Date: Mon Jul 2 08:08:37 2018 -0700 IB/hfi1: Remove incorrect call to do_interrupt callback The general interrupt handler is_rcv_avail_int() has two paths, do_interrupt() (callback) and handle_user_interrupt(). The do_interrupt() callback is for the threaded receive handling. is_rcv_avail_int() cannot handle threaded IRQs. If the do_interrupt() path is taken, and the IRQ returns IRQ_WAKE_THREAD, the IRQ behavior will be indeterminate. Remove incorrect call to do_interrupt() from is_rcv_avail_int(), leaving the un-threaded (handle_user_interrupt()) path. Fixes: f4f30031c33c ("staging/rdma/hfi1: Thread the receive interrupt.") Reviewed-by: Mike Marciniszyn Reviewed-by: Kamenee Arumugam Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit d108c60d3d55e117695dc7ea6e1ed3df31113ce3 Author: Michael J. Ruhl Date: Mon Jul 2 08:08:27 2018 -0700 IB/hfi1: Set in_use_ctxts bits for user ctxts only The in_use_ctxts bitmask is for user receive contexts only. Setting it for any other type of receive context is incorrect. Move initial set of in_use_ctxts bits from the general context init to the user context specific init. Having this bit set can allow contexts to be incorrectly identified by some IRQ handlers. This will allow handle_user_interrupt() will now filter user contexts correctly. Clean up redundant is_rcv_urgent_int() user context check. A follow on patch will clean up an incorrect code path in the is_rcv_avail_int(). Fixes: 8737ce95c463 ("IB/hfi1: Fix an assign/ordering issue with shared context IDs") Reviewed-by: Mike Marciniszyn Reviewed-by: Kamenee Arumugam Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 07abd4325e7013c728bf9642fbb862aa9eb4a367 Author: Dan Murphy Date: Mon Jul 2 13:12:16 2018 -0500 leds: lm3692x: Support LED sync configuration The LM36922 has one output but can sync current to 2 LED strings. The user may only use one sync so the other syncs need to be disabled. The LM36923 has 3 LED syncs. Signed-off-by: Dan Murphy Signed-off-by: Jacek Anaszewski commit 581e3ca38a1aa40b742baad39026f440445488d4 Author: Dan Murphy Date: Mon Jul 2 13:12:15 2018 -0500 dt: bindings: lm3692x: Update binding for LED sync control Update the binding to be able to configure the LED sync to turn on. The LM36922 has one output but can sync current to 2 LED strings. The user may only use one sync so the other syncs need to be disabled. The LM36923 has 3 LED syncs. Signed-off-by: Dan Murphy Signed-off-by: Jacek Anaszewski commit 9a5c1c64ac0a4d01c78328283dac7a9dc33ff0f9 Author: Dan Murphy Date: Mon Jul 2 13:12:14 2018 -0500 leds: lm3692x: Change DT calls to fwnode calls Update the code to use the fwnode calls as opposed to ARM DT node api's. This allows the device to be used with either DT configurations or ACPI definitions. Signed-off-by: Dan Murphy Signed-off-by: Jacek Anaszewski commit 43d20ff3633112322de38c18b4b35bbbf04438d7 Author: Dan Murphy Date: Mon Jul 2 13:12:13 2018 -0500 leds: lm3692x: Update license header to SPDX Update the license header to the current SPDX licensing format. Signed-off-by: Dan Murphy Signed-off-by: Jacek Anaszewski commit 14d15c2b278011056482eb015dff89f9cbf2b841 Author: Bart Van Assche Date: Mon Jul 2 14:08:45 2018 -0700 ib_srpt: Fix a use-after-free in __srpt_close_all_ch() BUG: KASAN: use-after-free in srpt_set_enabled+0x1a9/0x1e0 [ib_srpt] Read of size 4 at addr ffff8801269d23f8 by task check/29726 CPU: 4 PID: 29726 Comm: check Not tainted 4.18.0-rc2-dbg+ #4 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014 Call Trace: dump_stack+0xa4/0xf5 print_address_description+0x6f/0x270 kasan_report+0x241/0x360 __asan_load4+0x78/0x80 srpt_set_enabled+0x1a9/0x1e0 [ib_srpt] srpt_tpg_enable_store+0xb8/0x120 [ib_srpt] configfs_write_file+0x14e/0x1d0 [configfs] __vfs_write+0xd2/0x3b0 vfs_write+0x101/0x270 ksys_write+0xab/0x120 __x64_sys_write+0x43/0x50 do_syscall_64+0x77/0x230 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f235cfe6154 Fixes: aaf45bd83eba ("IB/srpt: Detect session shutdown reliably") Signed-off-by: Bart Van Assche Cc: Signed-off-by: Jason Gunthorpe commit 995250959d22fc341b5424e3343b0ce5df672461 Author: Bart Van Assche Date: Mon Jul 2 14:08:18 2018 -0700 ib_srpt: Fix a use-after-free in srpt_close_ch() Avoid that KASAN reports the following: BUG: KASAN: use-after-free in srpt_close_ch+0x4f/0x1b0 [ib_srpt] Read of size 4 at addr ffff880151180cb8 by task check/4681 CPU: 15 PID: 4681 Comm: check Not tainted 4.18.0-rc2-dbg+ #4 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014 Call Trace: dump_stack+0xa4/0xf5 print_address_description+0x6f/0x270 kasan_report+0x241/0x360 __asan_load4+0x78/0x80 srpt_close_ch+0x4f/0x1b0 [ib_srpt] srpt_set_enabled+0xf7/0x1e0 [ib_srpt] srpt_tpg_enable_store+0xb8/0x120 [ib_srpt] configfs_write_file+0x14e/0x1d0 [configfs] __vfs_write+0xd2/0x3b0 vfs_write+0x101/0x270 ksys_write+0xab/0x120 __x64_sys_write+0x43/0x50 do_syscall_64+0x77/0x230 entry_SYSCALL_64_after_hwframe+0x49/0xbe Fixes: aaf45bd83eba ("IB/srpt: Detect session shutdown reliably") Signed-off-by: Bart Van Assche Cc: Signed-off-by: Jason Gunthorpe commit 7496a511a0be976406d0e7ab8cdec7df6e5aac04 Author: Bart Van Assche Date: Mon Jul 2 08:59:28 2018 -0700 IB/mlx5: Remove set-but-not-used variables Avoid that the compiler complains about set-but-not-used variables when building with W=1. This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Leon Romanovsky Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit af7b641ed4d06794550e9811259b5fa970857cd0 Author: Bart Van Assche Date: Mon Jul 2 08:58:41 2018 -0700 IB/srp: Remove driver version and release data information Remove the driver version and release date information because such information is not relevant for an upstream driver. See also commit e1267b01240a ("RDMA: Remove useless MODULE_VERSION"). Signed-off-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit 7a5de56db902ea632a0ff0c2b47481d278db645f Author: Colin Ian King Date: Mon Jul 2 17:50:37 2018 +0100 leds: max8997: use mode when calling max8997_led_set_mode Variable mode is assigned to pdata->led_pdata->mode[led->id] and yet is not being used when calling function max8997_led_set_mode. Fix this by using mode when calling max8997_led_set_mode. Cleans up clang warning: warning: variable 'mode' set but not used [-Wunused-but-set-variable] Fixes: 8584cb82f151 ("leds: Add suuport for MAX8997-LED driver") Signed-off-by: Colin Ian King Signed-off-by: Jacek Anaszewski commit dd08ac2e5fbc867c5793c3fc0404ef16390b5206 Author: Daniel Mack Date: Wed Jun 27 20:52:37 2018 +0200 leds: lt3593: update email address and switch to SPDX license header Update the email address in the module information and in the comments and in the module information, and drop the existing boilerplate in favor of a SPDX header. Also sync the module license information with the header. Signed-off-by: Daniel Mack Signed-off-by: Jacek Anaszewski commit 8cd7d6daba9330383259686d1cc1d64caf857b11 Author: Daniel Mack Date: Wed Jun 27 20:52:36 2018 +0200 leds: lt3593: Add device tree probing glue The binding details are described in an earlier commit that adds the documentation. Signed-off-by: Daniel Mack Signed-off-by: Jacek Anaszewski commit 73f103c9528135bc896459a58e2371ce86090aea Author: Daniel Mack Date: Wed Jun 27 20:52:35 2018 +0200 leds: lt3593: switch to gpiod interface Clean up the code a bit and transition over to the gpiod based interface. Signed-off-by: Daniel Mack Signed-off-by: Jacek Anaszewski commit d8be286739d6317b2c4b2a6c2cbf63d76410ff90 Author: Daniel Mack Date: Wed Jun 27 20:52:34 2018 +0200 leds: lt3593: merge functions and clean up code In preparation to DT probe functionality, merge create_lt3593_led() into its only call-site. The DT based setup code will be quite different, so this internal helper function is of no help. This also changes the way the driver works by only handling one entry inside 'struct gpio_led_platform_data'. If multiple devices of the same type are found in a design, there should be a platform device for each of them. The only mainline user of this driver is not affected by this change. Last, use devm_led_classdev_register() instead of led_classdev_register(), so the driver's remove callback can go away. Signed-off-by: Daniel Mack Signed-off-by: Jacek Anaszewski commit f041f96abcf8718540e94aac6e73604c5d33d9f9 Author: Daniel Mack Date: Wed Jun 27 20:52:33 2018 +0200 dt-bindings: leds: Add bindings for lltc,lt3593 This patch adds the bindings document for LT3593 LED drivers. The binding is kept consistent with other LED driver bindings in that it stores all the LED-specific properties in its own subnode. As the hardware only supports one channel, there can consequently only be one sub-node. Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Signed-off-by: Jacek Anaszewski commit 4eefd62c17a9a5e7576207e84f3d2b4f73aba750 Author: Bart Van Assche Date: Mon Jul 2 10:06:51 2018 -0700 include/rdma/opa_addr.h: Fix an endianness issue IB_MULTICAST_LID_BASE is defined as follows: #define IB_MULTICAST_LID_BASE cpu_to_be16(0xC000) Hence use be16_to_cpu() to convert it to CPU endianness. Compile-tested only. Fixes: af808ece5ce9 ("IB/SA: Check dlid before SA agent queries for ClassPortInfo") Signed-off-by: Bart Van Assche Cc: Venkata Sandeep Dhanalakota Cc: Mike Marciniszyn Cc: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 413c94469a9db26ac4e1d16bf8de0248de93e2d8 Author: Enric Balletbo i Serra Date: Mon Jul 2 12:22:01 2018 +0200 Input: keyboard: Fix ChromeOS EC keyboard help message. The cros-ec I2C and SPI transport drivers have been moved from MFD subsystem to platform/chrome, at the same time, the config symbol has been renamed and lost the MFD_ prefix So, update the help message accordingly. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Guenter Roeck Signed-off-by: Benson Leung commit 23c706416a1a3ee84341093216c699437ef5401a Author: Enric Balletbo i Serra Date: Mon Jul 2 12:22:00 2018 +0200 arm/arm64: configs: Remove the MFD_ prefix for MFD_CROS_EC_I2C/SPI symbols. The cros-ec I2C and SPI transport drivers have been moved from MFD subsystem to platform/chrome, at the same time, the config symbol has been renamed and lost the MFD_ prefix, so update all configs to the new config symbol name. Signed-off-by: Enric Balletbo i Serra Acked-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Signed-off-by: Benson Leung commit d00a8741fd8fab2dc82f1c44d4111a337d505e60 Author: Enric Balletbo i Serra Date: Mon Jul 2 12:21:59 2018 +0200 platform/chrome: Move cros-ec transport drivers to drivers/platform. There are some cros-ec transport drivers (I2C, SPI) living in MFD, while others (LPC) living in drivers/platform. The transport drivers are more platform specific. So, move the I2C and SPI transport drivers to the platform/chrome directory. The patch also removes the MFD_ prefix of their Kconfig symbols. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Guenter Roeck Acked-by: Lee Jones Signed-off-by: Benson Leung commit d409d59f021d4c8c97a2ee29d1cae74773fb36bd Merge: 97752d234351 63b8add24e1a Author: Heiko Stuebner Date: Tue Jul 3 20:50:49 2018 +0200 Merge branch 'v4.19-shared/clkids' into v4.19-clk/next commit 97752d2343518169db7e1fb9da7f2386cf2c3727 Author: Elaine Zhang Date: Fri Jun 15 10:16:48 2018 +0800 dt-bindings: add bindings for px30 clock controller Add devicetree bindings for Rockchip cru which found on Rockchip SoCs. Signed-off-by: Elaine Zhang Reviewed-by: Rob Herring Signed-off-by: Heiko Stuebner commit 63b8add24e1a99d7218c904f258623e7c07ce99e Author: Elaine Zhang Date: Fri Jun 15 10:16:49 2018 +0800 clk: rockchip: add dt-binding header for px30 Add the dt-bindings header for the px30, that gets shared between the clock controller and the clock references in the dts. Add softreset ID for px30. Signed-off-by: Elaine Zhang Reviewed-by: Rob Herring Signed-off-by: Heiko Stuebner commit 812a954b787ab5a91d62e597a36351628b08d079 Author: Thomas Hellstrom Date: Thu Jun 21 09:44:42 2018 +0200 drm/vmwgfx: Remove an obsolete __le32 conversion We've long ago given up on enforcing the device format is always little endian, so remove a leftover conversion. Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat commit 6ff67ae759a0f839efeab40424c9dc544223f900 Author: Thomas Hellstrom Date: Thu Jun 21 09:39:21 2018 +0200 drm/vmwgfx: Fix host message module function declarations Make the host message module function declarations similar to the other declarations in vmwgfx_drv.h and include the header in vmwgfx_msg.c Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat commit 14dba7178491e2bc411dc2e4542295709c1fb9e6 Author: Thomas Hellstrom Date: Wed Jun 20 11:51:02 2018 +0200 drm/vmwgfx: Reorganize the fence wait loop Reorganize the fence wait loop somewhat to make it look more like the examples in set_current_state() kerneldoc, and add some code comments. Also if we're about to time out, make sure we check again whether the fence is actually signaled. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Deepak Rawat commit 3fbeccf8ceb1651b376a14bfe1005d518a4d8fa0 Author: Thomas Hellstrom Date: Wed Jun 20 11:38:48 2018 +0200 drm/vmwgfx: Improve on host message error messages Make sure the error messages are a bit more descriptive, so that a log reader may understand what's gone wrong. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Sinclair Yeh commit 3e79ecdad8897dad4d311576989b6856dbcb958e Author: Deepak Rawat Date: Wed Jun 20 11:34:26 2018 +0200 drm/vmwgfx: Add gui_x/y to vmw_connector_state As gui_x/y positioning is display unit is protected by requested_layout_mutex adding vmw_connector_state copy of the same and modeset commit will refer the state copy to sync with modeset_check state. v2: Tested with CONFIG_PROVE_LOCKING enabled. Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit b89e5ff9eeeb8b1fe3d2d7477fb9e1c1aed5dd5b Author: Deepak Rawat Date: Wed Jun 20 11:32:29 2018 +0200 drm/vmwgfx: Use a mutex to protect gui positioning in vmw_display_unit To avoid race condition between update_layout ioctl and modeset ioctl for access to gui_x/y positioning added a new mutex requested_layout_mutex. Also used drm_for_each_connector_iter to iterate over connector list. Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit b41023282d07b61a53e2c9b9508912b1e7ce7b4f Author: Randy Li Date: Thu Jun 21 21:32:10 2018 +0800 arm64: dts: rockchip: add some common pin-settings to rk3399 Those pins would be used by many boards. Signed-off-by: Randy Li Signed-off-by: Heiko Stuebner commit 018f60b26602bb41b33139da3408224e36dfe02d Author: Deepak Rawat Date: Wed Jun 20 11:26:59 2018 +0200 drm/vmwgfx: Remove primary memory validation against mode while creating fb This validation is not required because user-space will send create_fb request once the memory is allocated. This check should be performed during mode-setting. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit 7e14eabca82ec75da5200769989d396da46033ee Author: Deepak Rawat Date: Wed Jun 20 11:23:55 2018 +0200 drm/vmwgfx: Perform memory validations only when need full modeset. For cases when full modeset is not requested like page-flip, skip memory validation as the topology is not changed. Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit 5e24133ea3dfb89fd0cf28cd7a845b66fa680b69 Author: Deepak Rawat Date: Wed Jun 20 11:17:16 2018 +0200 drm/vmwgfx: Use modeset display memory validation for layout ioctl Call the same display memory validation function which is used by modeset_check. This ensure consistency that kernel change preferred mode/topology only if supported. Also change the internal function to use drm_rect instead of drm_vmw_rect. Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit 0a80eb4c122fd6119f3a15910d7bb9e6e33c3661 Author: Deepak Rawat Date: Tue Jun 19 19:51:15 2018 +0200 drm/vmwgfx: Perform topology validation during atomic modeset. This patch adds display (primary) memory validation during modeset check. Display memory validation are applicable to both SOU and STDU, so allow both display unit to undergo this check. Also added check for SVGA_CAP_NO_BB_RESTRICTION capability which lifts bounding box restriction for STDU. Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom commit b249cb4f6bc45485f631803b9762e443108a4b00 Author: Sinclair Yeh Date: Tue Jun 19 19:46:58 2018 +0200 drm/vmwgfx: Fix atomic mode set check vmw_kms_atomic_check_modeset() is currently checking config using the legacy state, which is updated after a commit has happened. This means vmw_kms_atomic_check_modeset() will reject an invalid config on the next update rather than the current one. Fix this by using the new states for config checking Signed-off-by: Sinclair Yeh Reviewed-by: Deepak Rawat Signed-off-by: Thomas Hellstrom commit 19f976ab01a6bb1f36384dd8cc743b88a6b7ebd6 Author: Thomas Hellstrom Date: Tue Jun 19 19:22:16 2018 +0200 drm/vmwgfx: Use blocking buffer object reserves when evicting resources Previously when evicting resources we were unconditionally calling ttm_eu_reserve_buffers with a NULL ww acquire context. That meant all buffer object reserves were done using trylock semantics. That makes sense when evicting during resource validation, because then there already are a number of buffers reserved and using waiting locks would cause lockdep errors. That's not the case when unconditionally evicting all resources as part of driver takedown or hibernation, so in that code path, make sure we have a ww acquire context to get waiting lock buffer object reserve semantics. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Sinclair Yeh commit 098d7d532bf78ea218b46c1d6887cbb43197ab4e Author: Thomas Hellstrom Date: Tue Jun 19 19:20:29 2018 +0200 drm/vmwgfx: Optimize the buffer object swap_notify callback somewhat. Only try to unmap cached maps when the buffer is moved into or out from vram. Otherwise the underlying pages stay the same. Also when unbinding resources from MOBs about to move, make sure we're really moving out of MOB memory. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Sinclair Yeh Reviewed-by: Deepak Rawat commit e9431ea5076a913a3b350cf5f89eacf9375126b1 Author: Thomas Hellstrom Date: Tue Jun 19 15:33:53 2018 +0200 drm/vmwgfx: Move buffer object related code to vmwgfx_bo.c It makes more sense to have all the buffer object related code in a single file rather than splitting it up between the resource code and buffer object pinning utilities. Place all buffer object related code in vmwgfx_bo.c. Fix up headers and export resource functionality when needed in the buffer object code. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Sinclair Yeh Reviewed-by: Deepak Rawat commit f1d34bfd70b1b4543a139ea28bad4c001c5f413d Author: Thomas Hellstrom Date: Tue Jun 19 15:02:16 2018 +0200 drm/vmwgfx: Replace vmw_dma_buffer with vmw_buffer_object Initially vmware buffer objects were only used as DMA buffers, so the name DMA buffer was a natural one. However, currently they are used also as dumb buffers and MOBs backing guest backed objects so renaming them to buffer objects is logical. Particularly since there is a dmabuf subsystem in the kernel where a dma buffer means something completely different. This also renames user-space api structures and IOCTL names correspondingly, but the old names remain defined for now and the ABI hasn't changed. There are a couple of minor style changes to make checkpatch happy. Signed-off-by: Thomas Hellstrom Reviewed-by: Sinclair Yeh Reviewed-by: Deepak Rawat commit cfb8282e18e292a8efc4d13ea1e4547a47dfb2d0 Author: Amit Nischal Date: Mon Jun 11 12:08:15 2018 +0530 clk: qcom: Enable clocks which needs to be always on for SDM845 There are certain clocks which needs to be always enabled for system operation. Add support for the same by adding 'CLK_IS_CRITICAL' flag for such clocks. Signed-off-by: Amit Nischal Signed-off-by: Stephen Boyd commit 806a1477b10a153cd01ee7ccba8ca2492df3e0b2 Author: Andreas Gruenbacher Date: Tue Jul 3 09:07:47 2018 -0700 iomap: add inline data support to iomap_readpage_actor Just copy the inline data into the page using the existing helper. Signed-off-by: Andreas Gruenbacher Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ec181f6782d8e8c22aa2c3462a20195cfa214ec6 Author: Andreas Gruenbacher Date: Tue Jul 3 09:07:47 2018 -0700 iomap: support direct I/O to inline data Add support for reading from and writing to inline data to iomap_dio_rw. This saves filesystems from having to implement fallback code for this case. The inline data is actually cached in the inode, so the I/O is only direct in the sense that it doesn't go through the page cache. Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 09230435dffdb13de507e5e40b524b0069fc5c7b Author: Christoph Hellwig Date: Tue Jul 3 09:07:46 2018 -0700 iomap: refactor iomap_dio_actor Split the function up into two helpers for the bio based I/O and hole case, and a small helper to call the two. This separates the code a little better in preparation for supporting I/O to inline data. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 34db50e55656621c19b1a83bf896be5ac75025b9 Author: Hans de Goede Date: Tue Jul 3 17:43:10 2018 +0200 efifb: Copy the ACPI BGRT boot graphics to the framebuffer On systems where fbcon is configured for deferred console takeover, the intend is for the framebuffer to show the boot graphics (e.g a vendor logo) until some message (e.g. an error) is printed or a graphical session takes over. Some firmware relies on the OS to show the boot graphics. This patch adds support to efifb to show the boot graphics and automatically enables this when fbcon is configured for deferred console takeover. Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit 0c9250368792c42b296d0bba73f7fff918b73381 Author: Hans de Goede Date: Tue Jul 3 17:43:10 2018 +0200 efi/bgrt: Drop __initdata from bgrt_image_size bgrt_image_size is necessary to (optionally) show the boot graphics from the efifb code. The efifb driver is a platform driver, using a normal driver probe() driver callback. So even though it is always builtin it cannot reference __initdata. Acked-by: Ard Biesheuvel Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit db3b4fd17519c774317b3647b7e5d2562f54cce8 Author: Geert Uytterhoeven Date: Tue Jul 3 17:43:09 2018 +0200 video: fbdev: simplefb: Stop including Simplefb is not a clock provider, but it uses of_clk_get_parent_count(), so it can just include instead. Signed-off-by: Geert Uytterhoeven Acked-by: Hans de Goede Acked-by: Stephen Boyd Signed-off-by: Bartlomiej Zolnierkiewicz commit 365da08c8921369a7ad119f2e48843ee21c77171 Author: Julia Lawall Date: Tue Jul 3 17:43:09 2018 +0200 omapfb: encoder-tpd12s015: fix error return code Return an error code on failure. Problem found using Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Bartlomiej Zolnierkiewicz commit ace6033ec5c356615eaa3582fb1946e9eaff6662 Author: Christoffer Dall Date: Tue Jul 3 17:43:09 2018 +0200 video: fbdev: Set pixclock = 0 in goldfishfb User space Android code identifies pixclock == 0 as a sign for emulation and will set the frame rate to 60 fps when reading this value, which is the desired outcome. Signed-off-by: Christoffer Dall Signed-off-by: Peter Maydell Signed-off-by: Roman Kiryanov Signed-off-by: Bartlomiej Zolnierkiewicz commit 1ef4e117c85f7d237f30f6f18d0668d334b30695 Author: Yu Ning Date: Tue Jul 3 17:43:09 2018 +0200 video: fbdev: Enable ACPI-based enumeration for goldfishfb Add an ACPI id to make goldfish framebuffer to support ACPI enumeration. Signed-off-by: Yu Ning Signed-off-by: Roman Kiryanov Signed-off-by: Bartlomiej Zolnierkiewicz commit 38e8f5c80524d55d5c9814423a1a176b81f856da Author: Roman Kiryanov Date: Tue Jul 3 17:43:09 2018 +0200 video: fbdev: Fix checkpatch warnings in goldfishfb.c Address issues pointed by checkpatch.pl Signed-off-by: Roman Kiryanov Signed-off-by: Bartlomiej Zolnierkiewicz commit a655de808cbde6c58b3298e704d786b53f59fb5d Author: Liam Girdwood Date: Mon Jul 2 16:59:54 2018 +0100 ASoC: core: Allow topology to override machine driver FE DAI link config. Machine drivers statically define a number of DAI links that currently cannot be changed or removed by topology. This means PCMs and platform components cannot be changed by topology at runtime AND machine drivers are tightly coupled to topology. This patch allows topology to override the machine driver DAI link config in order to reuse machine drivers with different topologies and platform components. The patch supports :- 1) create new FE PCMs with a topology defined PCM ID. 2) destroy existing static FE PCMs 3) change the platform component driver. 4) assign any new HW params fixups. 5) assign a new card name prefix to differentiate this topology to userspace. The patch requires no changes to the machine drivers, but does add some platform component flags that the platform component driver can assign before loading topologies. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown commit 2bd368d7bf21028f37a123041a138922254d4840 Author: Codrin Ciubotariu Date: Tue Jul 3 17:56:31 2018 +0300 ASoC: atmel-i2s: dt-bindings: Remove unnecessary phandle to aclk The optional clock phandle to aclk (Audio PLL clock) is no longer needed by the driver. Signed-off-by: Codrin Ciubotariu Signed-off-by: Mark Brown commit 73ad0df572901e03fc703b6f114e4442291f45c2 Author: Codrin Ciubotariu Date: Tue Jul 3 17:56:30 2018 +0300 ASoC: atmel-i2s: Remove unnecessary audio PLL clock (aclk) The generated clock (gclk) driver is able to set aclk as its parent and change its rate alone, if needed. This means that our driver no longer needs to configure aclk and we can let gclk select and configure its clock source. Signed-off-by: Codrin Ciubotariu Signed-off-by: Mark Brown commit 563c263248ff37dcd743549a0c0932fe2bf83980 Author: Jerome Brunet Date: Tue Jul 3 17:06:00 2018 +0200 ASoC: es7134: add support for the es7154 Add support for the es7154 which is basically an es7134 with an embedded power amplifier and lower maximum sample rate Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 30ddfffd10b73d5d960650ea70b33a8ee0562679 Author: Jerome Brunet Date: Tue Jul 3 17:05:59 2018 +0200 ASoC: es7134: correct required power supplies Drop AVDD in favor of PVDD to match the names used in the datasheet and only claim PVDD on the es7154. The es7134 and es7144 don't have a separate supply for the digital I/O. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit c9445d94d7fc60e7b0290df9e109daef85d26bd4 Author: Jerome Brunet Date: Tue Jul 3 17:05:58 2018 +0200 ASoC: es7134: update DT binding with new compatible and supplies Update the documentation to add support for the es7154 and optional power supplies phandles. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit df61f9f76609456efbc60d495b3235baf7d07691 Author: Daniel Kurtz Date: Mon Jul 2 15:19:55 2018 -0600 ASoC: AMD: Simplify trigger handler Now that the I2S channel names are fixed, and DMA data flow order is consistent (ch1 then ch2), we can simplify channel start order: start the upstream channel and then the downstream channel for both playback and capture cases. Signed-off-by: Daniel Kurtz Signed-off-by: Mark Brown commit 1a337a1e7885085d224583c766614e5945bde671 Author: Daniel Kurtz Date: Mon Jul 2 15:19:51 2018 -0600 ASoC: AMD: Reset bytescount when starting transaction The pointer() callback gets its value by reading the I2S BYTE_COUNT register. This is a 64-bit runnning transaction counter. If a transaction was aborted in the middle of a sample buffer, the counter will stop counting on a number divisible by the buffer size. Since we actually use it as a pointer into an aligned buffer, however, we do want to ensure that it always starts at a number divisible by the buffer size when starting a transaction, hence we reset it whenever starting a transaction. To accomplish this, it wasn't necessary to zero bytescount at the termination of each transaction, so remove this unnecessary code. Signed-off-by: Daniel Kurtz Signed-off-by: Mark Brown commit 8c6b964eddd2c39a9796899b2be099ece1b6c6ca Author: Daniel Kurtz Date: Mon Jul 2 15:19:54 2018 -0600 ASoC: AMD: Do not generate interrups for every captured sample On capture, audio data is first copied from I2S to ACP memory, and then from ACP to SYSRAM. The I2S_TO_ACP_DMA interrupt fires on every sample transferred from I2S to ACP memory. That is it fires ~48000 times per second when capturing @ 48 kHz. Since we don't do anything on this interrupt anyway, disable it to save quite a few unnecessary interrupts. The real "work" (calling snd_pcm_period_elapsed()) is done when transfer from ACP to SYSRAM is complete. Signed-off-by: Daniel Kurtz Signed-off-by: Mark Brown commit 55af49ac1b8627dfbfa2689af118d994d7a0ba1b Author: Daniel Kurtz Date: Mon Jul 2 15:19:53 2018 -0600 ASoC: AMD: Fix Capture DMA channel names On capture, audio data is first copied from I2S to ACP memory, and then to SYSRAM. For each step the channel number increases, so the names in the driver were wrong. Signed-off-by: Daniel Kurtz Signed-off-by: Mark Brown commit 715cdce04487fb23d5c10693b3bc01309fea955a Author: Daniel Kurtz Date: Mon Jul 2 15:19:52 2018 -0600 ASoC: AMD: Always subtract bytescount It is always correct to subtract out the starting bytescount value. Even in the case of 2^64 byte rollover (292 Million Years in the future @ 48000 Hz) the math still works out. Signed-off-by: Daniel Kurtz Signed-off-by: Mark Brown commit 30896d3619bd80486a3f8a75d62ea3b58fc61ad5 Author: Daniel Kurtz Date: Mon Jul 2 15:19:50 2018 -0600 ASoC: AMD: Always stop ch2 first Commit 6b116dfb4633a ("ASoC: AMD: make channel 1 dma as circular") made both channels circular, so this comment and logic no longer applies. Always stop ch2 (the channel closest to the output) before ch1. This ensures that the downstream circular DMA channel does not continue to play/capture repeated samples after the upstream circular DMA channel has already stopped. Signed-off-by: Daniel Kurtz Signed-off-by: Mark Brown commit e0431de301cbb8e3915261dfff4d0b072738de69 Author: Gustavo A. R. Silva Date: Mon Jul 2 07:17:07 2018 -0500 ASoC: pxa-ssp: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown commit 5f7bdc466c772b3af3145a71724965ecdc03e6bf Author: Jerome Brunet Date: Tue Jul 3 15:28:45 2018 +0200 ASoC: es7241: add es7241 codec support Add support for the everest es7241 which is a simple 2 channels analog to digital converter. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 1b8fc56ed514f815c4779273348c3308fb263c87 Author: Jerome Brunet Date: Tue Jul 3 15:28:44 2018 +0200 ASoC: es7241: add dt-bindings documentation for the es7241 adc Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 2daf3d9962c5a11fb79fe17bae03125df5d60236 Author: Bard Liao Date: Tue Jul 3 13:07:25 2018 +0800 ASoC: rt5682: add button detection mode control We are currently using power saving mode for button detection. However, it will impact the headset recording performance. This patch will switch button detection to normal mode in capture and switch to power saving mode in the end of capture. Signed-off-by: Bard Liao Signed-off-by: Mark Brown commit 44a4c4698ee86daa3f44ad4b370f5a9f58831d29 Merge: c18a9c096683 1d1c21228344 Author: David S. Miller Date: Tue Jul 3 23:23:48 2018 +0900 Merge branch 'aquantia-various-ethtool-ops-implementation' Igor Russkikh says: ==================== net: aquantia: various ethtool ops implementation In this patchset Anton Mikaev and I added some useful ethtool operations: - ring size changes - link renegotioation - flow control management The patch also improves init/deinit sequence. V3 changes: - After review and analysis it is clear that rtnl lock (which is captured by default on ethtool ops) is enough to secure possible overlapping of dev open/close. Thus, just dropping internal mutex. V2 changes: - using mutex to secure simultaneous dev close/open - using state var to store/restore dev state ==================== Signed-off-by: David S. Miller commit 1d1c21228344f2519f14aea25d0ebb1274b43c9a Author: Igor Russkikh Date: Mon Jul 2 17:03:39 2018 +0300 net: aquantia: bump driver version Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit b8d68b62d99355c827243c62f00de70168e1661f Author: Anton Mikaev Date: Mon Jul 2 17:03:38 2018 +0300 net: aquantia: Add renegotiate ethtool operation support Adds ethtool -r|--negotiate operation support. It triggers special control bit on FW interface causing FW to restart link negotiation. Signed-off-by: Igor Russkikh Signed-off-by: Anton Mikaev Signed-off-by: David S. Miller commit 288551de45aa39a751bc03e7976919aa896c5093 Author: Igor Russkikh Date: Mon Jul 2 17:03:37 2018 +0300 net: aquantia: Implement rx/tx flow control ethtools callback Runtime change of pause frame configuration (rx/tx flow control) via ethtool. Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 44e00dd8eb94b894b7f60009c251acf24b8bbaf1 Author: Igor Russkikh Date: Mon Jul 2 17:03:36 2018 +0300 net: aquantia: Improve adapter init/deinit logic We now pass link drop status to FW on init/deinit. This is required to inform FW that driver took/released a control on link. FW then will manage its own state and device power profile based on this information. To improve management we remove mpi_set function which ambiguously took both state and speed parameters. Deinit callback is now a part of FW ops, as it actually manages the FW. Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit c1af5427954b6a7f8c34b9778b1e1c9f1d9af302 Author: Anton Mikaev Date: Mon Jul 2 17:03:35 2018 +0300 net: aquantia: Ethtool based ring size configuration Implemented ring size setup, min/max validation and reconfiguration in runtime. Signed-off-by: Anton Mikaev Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit c18a9c096683dd30300686ffc755443816893968 Author: Gustavo A. R. Silva Date: Mon Jul 2 07:09:32 2018 -0500 net: stmmac_tc: use 64-bit arithmetic instead of 32-bit Add suffix UL to constant 1024 in order to give the compiler complete information about the proper arithmetic to use. Notice that this constant is used in a context that expects an expression of type u64 (64 bits, unsigned) and following expressions are currently being evaluated using 32-bit arithmetic: qopt->idleslope * 1024 * ptr qopt->hicredit * 1024 * 8 qopt->locredit * 1024 * 8 Addresses-Coverity-ID: 1470246 ("Unintentional integer overflow") Addresses-Coverity-ID: 1470248 ("Unintentional integer overflow") Addresses-Coverity-ID: 1470249 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva Acked-by: Jose Abreu Signed-off-by: David S. Miller commit c72051d5778a9c0e5df31d6553a6fa3507b3685c Author: Arnd Bergmann Date: Mon Jun 18 16:58:24 2018 +0200 audit: use ktime_get_coarse_ts64() for time access The API got renamed for consistency with the other time accessors, this changes the audit caller as well. Signed-off-by: Arnd Bergmann Reviewed-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 82210bfd942b891c502afe471cda16eccf565ed5 Author: Fabio Estevam Date: Tue Jul 3 10:05:54 2018 -0300 ARM: dts: imx51: Fix USB PHY duplicate unit-address Currently the following DTC warnings are seen with W=1: arch/arm/boot/dts/imx51-babbage.dtb: Warning (unique_unit_address): /usbphy/usbphy@0: duplicate unit-address (also used in node /usbphy/usbh1phy@0) arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dtb: Warning (unique_unit_address): /usbphy/usbphy@0: duplicate unit-address (also used in node /usbphy/usbh1phy@0) Fix it by moving the USB PHY nodes outside of simple-bus and drop the unneeded unit-address, which matches the bindings documentation at Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt While at it rename the USB PHY node to usbphy1 for consistency. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit de10eba0f68a161f3176b710b6e27d291d48aac2 Author: Dan Carpenter Date: Tue Jul 3 15:29:21 2018 +0300 drm/vgem: off by one in vgem_gem_fault() If page_offset is == num_pages then we end up reading beyond the end of obj->pages[]. Fixes: af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces") Signed-off-by: Dan Carpenter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703122921.brlfxl4vx2ybvrd2@kili.mountain commit a1de8d0a7e2cc79dad6d469901b3b5d4c94c4554 Author: Dan Carpenter Date: Tue Jul 3 15:30:16 2018 +0300 drm/i810: off by one in i810_dma_vertex() If vertex->idx == dma->buf_count then we end up reading one element beyond the end of the dma->buflist[] array. Signed-off-by: Dan Carpenter Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180703123015.kma7v7rwtdy4urce@kili.mountain commit b97872d4eb226fa853d0f69c72b24a711e388757 Author: Viresh Kumar Date: Fri May 25 16:02:01 2018 +0530 ARM: dts: imx: Add missing OPP properties for CPUs The OPP properties, like "operating-points", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can create an OPP table. Add such missing properties. Fix other missing properties (like clocks, supply, clock latency) as well to make it all work. Signed-off-by: Viresh Kumar Signed-off-by: Shawn Guo commit 64e625cf53539fea4fcc5410d64c619fdbf3d225 Author: Daniel Vetter Date: Thu May 3 16:26:02 2018 +0200 drm/virtio: Remove unecessary dma_fence_ops dma_fence_default_wait is the default now, same for the trivial enable_signaling implementation. Reviewed-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: David Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20180503142603.28513-15-daniel.vetter@ffwll.ch commit 144b09795528780d96491d70619ccbadac324e68 Author: Daniel Vetter Date: Fri May 4 16:09:01 2018 +0200 drm/vc4: Remove unecessary dma_fence_ops dma_fence_default_wait is the default now, same for the trivial enable_signaling implementation. v2: Also remove the relase hook, dma_fence_free is the default. Reviewed-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180504140901.27471-1-daniel.vetter@ffwll.ch commit 93f8252bcbec8b810ce5f01184c10f4a6b8b86eb Author: Daniel Vetter Date: Thu May 3 16:25:59 2018 +0200 drm/qxl: Remove unecessary dma_fence_ops The trivial enable_signaling implementation matches the default code. v2: Fix up commit message to match patch better (Eric). Cc: Eric Anholt Reviewed-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20180503142603.28513-12-daniel.vetter@ffwll.ch commit 51eebbc76b25c16e110d3a40a4f45b31e53b298e Author: Daniel Vetter Date: Thu May 3 16:25:55 2018 +0200 drm/etnaviv: Remove unecessary dma_fence_ops dma_fence_default_wait is the default now, same for the trivial enable_signaling implementation. Acked-by: Lucas Stach Reviewed-by: Christian Gmeiner Signed-off-by: Daniel Vetter Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: etnaviv@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20180503142603.28513-8-daniel.vetter@ffwll.ch commit 99e227cb03970287958d05ed41589cc82383534d Author: Daniel Vetter Date: Thu May 3 16:25:54 2018 +0200 drm: Remove unecessary dma_fence_ops dma_fence_default_wait is the default now, same for the trivial enable_signaling implementation. Reviewed-by: Eric Anholt Signed-off-by: Daniel Vetter Cc: Gustavo Padovan Cc: Maarten Lankhorst Cc: Sean Paul Cc: David Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180503142603.28513-7-daniel.vetter@ffwll.ch commit 95f9e2636a60424c27dc16c7674a03feef9e1303 Author: Daniel Vetter Date: Thu May 3 16:25:53 2018 +0200 drm/amdgpu: Remove unecessary dma_fence_ops dma_fence_default_wait is the default now. Reviewed-by: Christian König Signed-off-by: Daniel Vetter Cc: Alex Deucher Cc: "Christian König" Cc: Monk Liu Cc: pding Cc: Andrey Grodzovsky Cc: Evan Quan Cc: Daniel Vetter Cc: Kees Cook Link: https://patchwork.freedesktop.org/patch/msgid/20180503142603.28513-6-daniel.vetter@ffwll.ch commit 418cc6ca06071e7b7d75c0d525d80a6f49a763d6 Author: Daniel Vetter Date: Thu May 3 16:25:52 2018 +0200 dma-fence: Make ->wait callback optional Almost everyone uses dma_fence_default_wait. v2: Also remove the BUG_ON(!ops->wait) (Chris). Reviewed-by: Christian König (v1) Signed-off-by: Daniel Vetter Cc: Chris Wilson Cc: Sumit Semwal Cc: Gustavo Padovan Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20180503142603.28513-5-daniel.vetter@ffwll.ch commit 3cfaeb33530592b02b2ceb76b379364c55ca612e Author: Alexander Usyskin Date: Mon Jun 25 00:11:41 2018 +0300 mei: expose fw version to sysfs The ME FW version is constantly used by detection and update tools. To improve the reliability and simplify these tools provide a sysfs interface to access version of the platform ME firmware in the following format: :.... There can be up to three such blocks for different FW components. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 9a7c0b69b6e765c655133ef530876aea3da71d58 Author: Alexander Usyskin Date: Mon Jun 25 00:11:40 2018 +0300 mei: add optional timeout to internal bus recv Add optional timeout to internal bus recv function to enable break out of internal flows in case of no answer from FW. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 3458657f9e1041838d6c3d1bccf251f14dbb1b29 Author: Alexander Usyskin Date: Thu Jun 7 00:31:47 2018 +0300 mei: remove unused MEI_IAMTHIF_STALL_TIMER define MEI_IAMTHIF_STALL_TIMER is unused now and can be safely removed. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman commit 7dc9b6b8089d2ea510943fc6841c641ea9f50ab1 Author: Michael Kelley Date: Tue Jun 5 13:37:54 2018 -0700 Drivers: hv: vmbus: Make TLFS #define names architecture neutral The Hyper-V feature and hint flags in hyperv-tlfs.h are all defined with the string "X64" in the name. Some of these flags are indeed x86/x64 specific, but others are not. For the ones that are used in architecture independent Hyper-V driver code, or will be used in the upcoming support for Hyper-V for ARM64, this patch removes the "X64" from the name. This patch changes the flags that are currently known to be used on multiple architectures. Hyper-V for ARM64 is still a work-in-progress and the Top Level Functional Spec (TLFS) has not been separated into x86/x64 and ARM64 areas. So additional flags may need to be updated later. This patch only changes symbol names. There are no functional changes. Signed-off-by: Michael Kelley Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 41afb1dfad4d6af0c716746f6a15f3230482955c Author: Andy Shevchenko Date: Fri Jun 29 22:31:13 2018 +0300 x86/platform/intel-mid: Remove per platform code After custom TSC calibration gone, there is no more reason to have custom platform code for each of Intel MID. Thus, remove it for good. Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Pavel Tatashin Link: https://lkml.kernel.org/r/20180629193113.84425-7-andriy.shevchenko@linux.intel.com commit d99e5da91b36db5c35ddaf3653b280ee060971da Author: Andy Shevchenko Date: Fri Jun 29 22:31:12 2018 +0300 x86/platform/intel-mid: Remove custom TSC calibration Since the commit 7da7c1561366 ("x86, tsc: Add static (MSR) TSC calibration on Intel Atom SoCs") introduced a common way for all Intel MID chips to get their TSC frequency via MSRs, there is no need to keep a duplication in each of Intel MID platform code. Thus, remove the custom calibration code for good. Note, there is slight difference in how to get frequency for (reserved?) values in MSRs, i.e. legacy code enforces some defaults while new code just uses 0 in that cases. Suggested-by: Alexander Shishkin Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Pavel Tatashin Cc: Bin Gao Link: https://lkml.kernel.org/r/20180629193113.84425-6-andriy.shevchenko@linux.intel.com commit 5067b087cf5b2fa4de00443cdc6a66acb28a4953 Author: Andy Shevchenko Date: Fri Jun 29 22:31:11 2018 +0300 x86/tsc: Use SPDX identifier and update Intel copyright Use SPDX identifier and update year in Intel copyright line. While here, remove file name from the file itself. Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Pavel Tatashin Link: https://lkml.kernel.org/r/20180629193113.84425-5-andriy.shevchenko@linux.intel.com commit 397d3ad18dc431456baf8bce96606fa1d18b30b0 Author: Andy Shevchenko Date: Fri Jun 29 22:31:09 2018 +0300 x86/tsc: Convert to use x86_match_cpu() and INTEL_CPU_FAM6() Move the code to use recently introduced INTEL_CPU_FAM6() macro and drop custom version of x86_match_cpu() function. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Pavel Tatashin Link: https://lkml.kernel.org/r/20180629193113.84425-3-andriy.shevchenko@linux.intel.com commit e2ce67b2b34b6e9d77da2f375dba5b525508f7df Author: Andy Shevchenko Date: Fri Jun 29 22:31:08 2018 +0300 x86/cpu: Introduce INTEL_CPU_FAM*() helper macros These macros are often used by drivers and there exists already a lot of duplication as ICPU() macro across the drivers. Provide a generic x86 macro for users. Note, as Ingo Molnar pointed out this has a hidden issue when a driver needs to preserve const qualifier. Though, it would be addressed separately at some point. Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Pavel Tatashin Link: https://lkml.kernel.org/r/20180629193113.84425-2-andriy.shevchenko@linux.intel.com commit dbd0fbc76c77daac08ddd245afdcbade0d506e19 Author: Andy Shevchenko Date: Fri Jun 29 22:31:10 2018 +0300 x86/tsc: Add missing header to tsc_msr.c Add a missing header otherwise compiler warns about missed prototype: CC arch/x86/kernel/tsc_msr.o arch/x86/kernel/tsc_msr.c:73:15: warning: no previous prototype for ‘cpu_khz_from_msr’ [-Wmissing-prototypes] unsigned long cpu_khz_from_msr(void) ^~~~~~~~~~~~~~~~ Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Pavel Tatashin Link: https://lkml.kernel.org/r/20180629193113.84425-4-andriy.shevchenko@linux.intel.com commit 07136793ccad877727afada2b0c926031f10cf52 Author: Vitaly Kuznetsov Date: Tue Jun 5 13:37:56 2018 -0700 Tools: hv: vss: fix loop device detection Commit ea81fdf0981d ("Tools: hv: vss: Skip freezing filesystems backed by loop") added skip for filesystems backed by loop device. However, it seems the detection of such cases is incomplete. It was found that with 'devicemapper' storage driver docker creates the following chain: NAME MAJ:MIN loop0 7:0 ..docker-8:4-8473394-pool 253:0 ..docker-8:4-8473394-eac... 253:1 so when we're looking at the mounted device we see major '253' and not '7'. Solve the issue by walking /sys/dev/block/*/slaves chain and checking if there's a loop device somewhere. Other than that, don't skip mountpoints silently when stat() fails. In case e.g. SELinux is failing stat we don't want to skip freezing everything without letting user know about the failure. Fixes: ea81fdf0981d ("Tools: hv: vss: Skip freezing filesystems backed by loop") Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 8a99c920092f444cf9f1d737ae76527102886d8e Author: Olaf Hering Date: Tue Jun 5 13:37:55 2018 -0700 tools: hv: update lsvmbus to be compatible with python3 Python3 changed the way how 'print' works. Adjust the code to a syntax that is understood by python2 and python3. Signed-off-by: Olaf Hering Acked-by: Dexuan Cui Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 619a4c8b2b5a0b64842b0362a152a63072615a54 Author: Michael Kelley Date: Tue Jun 5 13:37:53 2018 -0700 Drivers: hv: vmbus: Remove x86 MSR refs in arch independent code In architecture independent code for manipulating Hyper-V synthetic timers and synthetic interrupts, pass in an ordinal number identifying the timer or interrupt, rather than an actual MSR register address. Then in x86/x64 specific code, map the ordinal number to the appropriate MSR. This change facilitates the introduction of an ARM64 version of Hyper-V, which uses the same synthetic timers and interrupts, but a different mechanism for accessing them. Signed-off-by: Michael Kelley Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 50229128727f7e11840ca1b2b501f880818d56b6 Author: Dexuan Cui Date: Tue Jun 5 13:37:52 2018 -0700 Drivers: hv: vmbus: Fix the offer_in_progress in vmbus_process_offer() I didn't really hit a real bug, but just happened to spot the bug: we have decreased the counter at the beginning of vmbus_process_offer(), so we mustn't decrease it again. Fixes: 6f3d791f3006 ("Drivers: hv: vmbus: Fix rescind handling issues") Signed-off-by: Dexuan Cui Cc: stable@vger.kernel.org Cc: Stephen Hemminger Cc: K. Y. Srinivasan Cc: Stable # 4.14 and above Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 71b38245acb05a38d2d861792bdd99cd9f6a0f78 Author: Michael Kelley Date: Tue Jun 5 13:37:51 2018 -0700 Drivers: hv: vmbus: Add comments on ring buffer signaling Add comments describing intricacies of Hyper-V ring buffer signaling code. This information is not in Hyper-V public documents, so include here to capture the knowledge for future coders. There are no code changes in this commit. Signed-off-by: Michael Kelley Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit e9a7fda29a5620d9ac2a750d8e35f5d270096321 Author: Michael Kelley Date: Tue Jun 5 13:37:50 2018 -0700 x86/hyperv: Add interrupt handler annotations Add standard interrupt handler annotations to hyperv_vector_handler(). This does not fix any observed bug, but avoids potential removal of the code by link time optimization and makes it consistent with hv_stimer0_vector_handler in the same source file. Suggested-by: Thomas Gleixner Signed-off-by: Michael Kelley Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit af0a5646cb8d03f33ef028eff5b92996e53da201 Author: Arjan van de Ven Date: Tue Jun 5 13:37:49 2018 -0700 use the new async probing feature for the hyperv drivers Recent kernels support asynchronous probing; most hyperv drivers can be probed async easily so set the required flag for this. Signed-off-by: Arjan van de Ven Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman commit 2e08b1dbbc3aa50cdbf975633459e8fa2660fd2e Author: Colin Ian King Date: Tue Jul 3 08:04:00 2018 +0100 eeprom: idt_89hpesx: remove redundant variable csrval_len Variable csrval_len is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'csrval_len' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 07fb28b80c7705c15002fe91dd4340bcd5174dbd Author: Colin Ian King Date: Mon Jul 2 09:31:45 2018 +0100 char: pcmcia: remove redundant pointer dev Pointer dev is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable ‘dev’ set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 9f10ee32bfaf10dc4d2b0ccd149726eda8df3d57 Author: Colin Ian King Date: Mon Jul 2 09:21:16 2018 +0100 hpet: remove redundant pointer hpet Pointer hpet is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'hpet' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit ea4ba866d14fee63df370eca5002937b69babd99 Author: Colin Ian King Date: Sat Jun 23 23:26:54 2018 +0100 goldfish_pipe: make tasklet goldfish_interrupt_tasklet static Tasklet goldfish_interrupt_tasklet is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'goldfish_interrupt_tasklet' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit c6446c210f2b658ce5a7abc5b9763447910d751d Author: Colin Ian King Date: Thu Jun 21 18:08:06 2018 +0100 w1: ds2482: make module parameter extra_config static The variable extra_config is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: warning: symbol 'extra_config' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit ce7d8f8a66e6d0600e5f368233849d2e4560a732 Author: Colin Ian King Date: Fri Jun 1 15:54:44 2018 +0100 misc: rtsx: make several functions static Several helper functions are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'rtsx_pm_power_saving' was not declared. Should it be static? symbol 'rtsx_set_l1off_sub_cfg_d0' was not declared. Should it be static? symbol 'rtsx_pm_full_on' was not declared. Should it be static? symbol 'rtsx_comm_set_ltr_latency' was not declared. Should it be static? symbol 'rtsx_pci_process_ocp' was not declared. Should it be static? symbol 'rtsx_pci_process_ocp_interrupt' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit c4bcaffa6b8192379eec9a8f7fe263907c4b755e Author: Colin Ian King Date: Tue Jul 3 08:38:08 2018 +0100 misc: vmci: remove redundant variable is_local Variable is_local is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'is_local' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 53e44782e2302f6483b34539f0c3efbf5c6f9f37 Author: Colin Ian King Date: Tue Jul 3 08:32:49 2018 +0100 misc: ti-st: remove redundant variable 'type' Variable type is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'type' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit aa8998e57640c98ce0c53c1dfc7a8e990adfffa4 Author: Colin Ian King Date: Tue Jul 3 08:23:05 2018 +0100 sgi-xp: remove redundant pointers ch and rp The pointers ch and rp are set but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'ch' set but not used [-Wunused-but-set-variable] warning: variable 'rp' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit ccbaef5d0ba8b0015ac94d8e65957bc1f5864513 Author: Colin Ian King Date: Tue Jul 3 08:14:43 2018 +0100 misc: genwqe: remove several redundant variables The variables val16, type, pci_dev and type are set but are never used hence they are redundant and can be removed. Cleans up clang warnings: warning: variable 'type' set but not used [-Wunused-but-set-variable] warning: variable 'val16' set but not used [-Wunused-but-set-variable] warning: variable 'pci_dev' set but not used [-Wunused-but-set-variable] warning: variable 'type' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 9cf04a29ff701d259fdcaf45baf92087898c6f61 Author: Nadav Amit Date: Tue Jun 19 16:00:30 2018 -0700 vmw_balloon: update maintainers list Philip Moltman is no longer a maintainer of the VMware balloon. Setting Nadav Amit as one instead. Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit Signed-off-by: Greg Kroah-Hartman commit 8b4770ec7df700bcbecc961e2ddbddf552421906 Author: Nadav Amit Date: Tue Jun 19 16:00:29 2018 -0700 vmw_balloon: update copyright message Removing the GPL wording and replace it with an SPDX tag. The immediate trigger for doing it now is the need to remove the list of maintainers from the source file, as the maintainer list changed. Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit Signed-off-by: Greg Kroah-Hartman commit ec992cc7ea40e46e53aa8d38bc39db205de9cd34 Author: Nadav Amit Date: Tue Jun 19 16:00:28 2018 -0700 vmw_balloon: remove inflation rate limiting Since commit 33d268ed0019 ("VMware balloon: Do not limit the amount of frees and allocations in non-sleep mode."), the allocations are not increased, and therefore balloon inflation rate limiting is in practice broken. While we can restore rate limiting, in practice we see that it can result in adverse effect, as the hypervisor throttles down the VM if it does not respond well enough, or alternatively causes it to perform very poorly as the host swaps out the VM memory. Throttling the VM down can even have a cascading effect, in which the VM reclaims memory even slower and consequentially throttled down even further. We therefore remove all the rate limiting mechanisms, including the slow allocation cycles, as they are likely to do more harm than good. Fixes: 33d268ed0019 ("VMware balloon: Do not limit the amount of frees and allocations in non-sleep mode.") Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit Signed-off-by: Greg Kroah-Hartman commit c3cc1b0fc27508da53fe955a3b23d03964410682 Author: Nadav Amit Date: Tue Jun 19 16:00:27 2018 -0700 vmw_balloon: fix VMCI use when balloon built into kernel Currently, when all modules, including VMCI and VMware balloon are built into the kernel, the initialization of the balloon happens before the VMCI is probed. As a result, the balloon fails to initialize the VMCI doorbell, which it uses to get asynchronous requests for balloon size changes. The problem can be seen in the logs, in the form of the following message: "vmw_balloon: failed to initialize vmci doorbell" The driver would work correctly but slightly less efficiently, probing for requests periodically. This patch changes the balloon to be initialized using late_initcall() instead of module_init() to address this issue. It does not address a situation in which VMCI is built as a module and the balloon is built into the kernel. Fixes: 48e3d668b790 ("VMware balloon: Enable notification via VMCI") Cc: stable@vger.kernel.org Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit Signed-off-by: Greg Kroah-Hartman commit ce664331b2487a5d244a51cbdd8cb54f866fbe5d Author: Nadav Amit Date: Tue Jun 19 16:00:26 2018 -0700 vmw_balloon: VMCI_DOORBELL_SET does not check status When vmballoon_vmci_init() sets a doorbell using VMCI_DOORBELL_SET, for some reason it does not consider the status and looks at the result. However, the hypervisor does not update the result - it updates the status. This might cause VMCI doorbell not to be enabled, resulting in degraded performance. Fixes: 48e3d668b790 ("VMware balloon: Enable notification via VMCI") Cc: stable@vger.kernel.org Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit Signed-off-by: Greg Kroah-Hartman commit 5081efd112560d3febb328e627176235b250d59d Author: Nadav Amit Date: Tue Jun 19 16:00:25 2018 -0700 vmw_balloon: do not use 2MB without batching If the hypervisor sets 2MB batching is on, while batching is cleared, the balloon code breaks. In this case the legacy mechanism is used with 2MB page. The VM would report a 2MB page is ballooned, and the hypervisor would only take the first 4KB. While the hypervisor should not report such settings, make the code more robust by not enabling 2MB support without batching. Fixes: 365bd7ef7ec8e ("VMware balloon: Support 2m page ballooning.") Cc: stable@vger.kernel.org Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit Signed-off-by: Greg Kroah-Hartman commit 09755690c6b7c1eabdc4651eb3b276f8feb1e447 Author: Nadav Amit Date: Tue Jun 19 16:00:24 2018 -0700 vmw_balloon: fix inflation of 64-bit GFNs When balloon batching is not supported by the hypervisor, the guest frame number (GFN) must fit in 32-bit. However, due to a bug, this check was mistakenly ignored. In practice, when total RAM is greater than 16TB, the balloon does not work currently, making this bug unlikely to happen. Fixes: ef0f8f112984 ("VMware balloon: partially inline vmballoon_reserve_page.") Cc: stable@vger.kernel.org Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit Signed-off-by: Greg Kroah-Hartman commit 51d7d35817aad6f4dd0f60b80063206f1761b69b Merge: 1259d239799b cb04ba33187c Author: Takashi Iwai Date: Tue Jul 3 12:51:26 2018 +0200 Merge branch 'topic/hda-core-intel' into for-next Merge the development branch for HD-audio ext bus refactoring. Signed-off-by: Takashi Iwai commit 418b573b431310306db31e445594317ba62f5508 Author: Ping Cheng Date: Mon Jun 25 13:24:36 2018 -0700 HID: wacom: convert Wacom custom usages to standard HID usages Otherwise the switch would not catch the proper usages. Signed-off-by: Ping Cheng Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit 578325120ec122db98b3d57e833d16c1bdac6ec6 Author: Jason Gerecke Date: Mon Jun 25 13:24:35 2018 -0700 HID: wacom: Move handling of HID quirks into a dedicated function We want to keep device-specific quirks as contained as possible so that the the code remains maintainable. Our 'wacom_setup_device_quirks' function is the usual place for this, but some quirks need to be applied to the HID descriptor as it is parsed. This commit introduces a new function which is called for each usage so that any HID-specific quirks can be applied. The function now houses quirks that were being done in 'wacom_feature_mapping' and 'wacom_usage_mapping'. Signed-off-by: Jason Gerecke Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit 29b9e14846f1ff201c4c1ba4fdb868dcdce6c760 Author: Jason Gerecke Date: Mon Jun 25 13:24:34 2018 -0700 HID: wacom: Replace touch_max fixup code with static touch_max definitions Detecting the number of supported touches for a particular device used to be tricky, both because early forms of the driver didn't have a very good HID parser and because early hardware didn't always advertise the actual number. At the time, we added a block of code which would ensure that touch_max would always be equal to at least 1 on any touch device, and relied on setting touch_max to e.g. 2 only for the multitouch-capable exceptions. The common case has since flipped, and the driver and descriptors can reliably detect the number of touches supported by modern sensors. Because of this, it makes sense to remove the fixup code and instead place static declarations of "touch_max = 1" for these old devices. It isn't entirely clear if all 2-finger devices actually report a maximum number of touches so we leave these declarations still in place. For the eagle-eyed, the "> BAMBOO_PT" condition was originally equivalent to ">= TABLETPC", which is what the intent was. This commit doesn't have to consider the types introduced in the interim since they shouldn't be affected, hence why only the tablet PC definitions have been modified. Signed-off-by: Jason Gerecke Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit 6c0ad1df179b8d26ecd5e9954c36146fa87c1b0c Author: Yixun Lan Date: Mon Jul 2 21:31:17 2018 +0000 clk: meson-axg: add pcie and mipi clock bindings Add the pcie and mipi clock dt-bindings for the pcie driver. Since the mipi clock isalso used by the pcie driver, we add it together in this patch. Tested-by: Jianxin Qin Signed-off-by: Yixun Lan Signed-off-by: Jerome Brunet commit 747ff6265db4c2b77e8c7384f8054916a0c1eb39 Author: Baoquan He Date: Mon Jun 25 11:16:56 2018 +0800 x86/boot/KASLR: Skip specified number of 1GB huge pages when doing physical randomization (KASLR) When KASLR is enabled then 1GB huge pages allocations might regress sporadically. To reproduce on a KVM guest with 4GB RAM: - add the following options to the kernel command-line: 'default_hugepagesz=1G hugepagesz=1G hugepages=1' - boot the guest and check number of 1GB pages reserved: # grep HugePages_Total /proc/meminfo - sporadically, every couple of bootups the output of this command shows that when booting with "nokaslr" HugePages_Total is always 1, while booting without "nokaslr" sometimes HugePages_Total is set as 0 (that is, reserving the 1GB page failed). Note that you may need to boot a few times to trigger the issue, because it's somewhat non-deterministic. The root cause is that kernel may be put into the only good 1GB huge page in the [0x40000000, 0x7fffffff] physical range randomly. Below is the dmesg output snippet from the KVM guest. We can see that only [0x40000000, 0x7fffffff] region is good 1GB huge page, [0x100000000, 0x13fffffff] will be touched by the memblock top-down allocation: [...] e820: BIOS-provided physical RAM map: [...] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable [...] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved [...] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved [...] BIOS-e820: [mem 0x0000000000100000-0x00000000bffdffff] usable [...] BIOS-e820: [mem 0x00000000bffe0000-0x00000000bfffffff] reserved [...] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved [...] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved [...] BIOS-e820: [mem 0x0000000100000000-0x000000013fffffff] usable Besides, on bare-metal machines with larger memory, one less 1GB huge page might be available with KASLR enabled. That too is because the kernel image might be randomized into those "good" 1GB huge pages. To fix this, firstly parse the kernel command-line to get how many 1GB huge pages are specified. Then try to skip the specified number of 1GB huge pages when decide which memory region kernel can be randomized into. Also change the name of handle_mem_memmap() as handle_mem_options() since it handles not only 'mem=' and 'memmap=', but also 'hugepagesxxx' now. Signed-off-by: Baoquan He Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: douly.fnst@cn.fujitsu.com Cc: fanc.fnst@cn.fujitsu.com Cc: indou.takao@jp.fujitsu.com Cc: keescook@chromium.org Cc: lcapitulino@redhat.com Cc: yasu.isimatu@gmail.com Link: http://lkml.kernel.org/r/20180625031656.12443-3-bhe@redhat.com [ Rewrote the changelog, fixed style problems in the code. ] Signed-off-by: Ingo Molnar commit 9b912485e0e74a74e042e4f2dd87f262e46fcdf1 Author: Baoquan He Date: Mon Jun 25 11:16:55 2018 +0800 x86/boot/KASLR: Add two new functions for 1GB huge pages handling Introduce two new functions: parse_gb_huge_pages() and process_gb_huge_pages(), which handle a conflict between KASLR and huge pages of 1GB. These two functions will be used in the next patch: - parse_gb_huge_pages() is used to parse kernel command-line to get how many 1GB huge pages have been specified. A static global variable 'max_gb_huge_pages' is added to store the number. - process_gb_huge_pages() is used to skip as many 1GB huge pages as possible from the passed in memory region according to the specified number. Signed-off-by: Baoquan He Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: douly.fnst@cn.fujitsu.com Cc: fanc.fnst@cn.fujitsu.com Cc: indou.takao@jp.fujitsu.com Cc: keescook@chromium.org Cc: lcapitulino@redhat.com Cc: yasu.isimatu@gmail.com Link: http://lkml.kernel.org/r/20180625031656.12443-2-bhe@redhat.com Signed-off-by: Ingo Molnar commit 6d609b35c815ba20132b7b64bcca04516bb17c56 Author: Dave Gerlach Date: Thu Jun 21 14:43:08 2018 +0530 ARM: hwmod: RTC: Don't assume lock/unlock will be called with irq enabled When the RTC lock and unlock functions were introduced it was likely assumed that they would always be called from irq enabled context, hence the use of local_irq_disable/enable. This is no longer true as the RTC+DDR path makes a late call during the suspend path after irqs have been disabled to enable the RTC hwmod which calls both unlock and lock, leading to IRQs being reenabled through the local_irq_enable call in omap_hwmod_rtc_lock call. To avoid this change the local_irq_disable/enable to local_irq_save/restore to ensure that from whatever context this is called the proper IRQ configuration is maintained. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy Signed-off-by: Tony Lindgren commit 6709812f094d96543b443645c68daaa32d3d3e77 Author: Jan Beulich Date: Mon Jul 2 04:47:57 2018 -0600 x86/entry/64: Add two more instruction suffixes Sadly, other than claimed in: a368d7fd2a ("x86/entry/64: Add instruction suffix") ... there are two more instances which want to be adjusted. As said there, omitting suffixes from instructions in AT&T mode is bad practice when operand size cannot be determined by the assembler from register operands, and is likely going to be warned about by upstream gas in the future (mine does already). Add the other missing suffixes here as well. Signed-off-by: Jan Beulich Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/5B3A02DD02000078001CFB78@prv1-mh.provo.novell.com Signed-off-by: Ingo Molnar commit a7bea8308933aaeea76dad7d42a6e51000417626 Author: Jan Beulich Date: Mon Jul 2 04:31:54 2018 -0600 x86/asm/64: Use 32-bit XOR to zero registers Some Intel CPUs don't recognize 64-bit XORs as zeroing idioms. Zeroing idioms don't require execution bandwidth, as they're being taken care of in the frontend (through register renaming). Use 32-bit XORs instead. Signed-off-by: Jan Beulich Cc: Alok Kataria Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: davem@davemloft.net Cc: herbert@gondor.apana.org.au Cc: pavel@ucw.cz Cc: rjw@rjwysocki.net Link: http://lkml.kernel.org/r/5B39FF1A02000078001CFB54@prv1-mh.provo.novell.com Signed-off-by: Ingo Molnar commit 07c13bb78c8b8a9cb6ee169659528945038d5e85 Author: Thomas Hellstrom Date: Thu Jun 14 09:29:22 2018 +0200 drm: Change deadlock-avoidance algorithm for the modeset locks. For modeset locks we don't expect a high number of contending transactions so change algorithm from Wait-Die to Wound-Wait. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Thomas Hellstrom Acked-by: Ingo Molnar commit 08295b3b5beec9aac0f7a9db86f0fc3792039da3 Author: Thomas Hellstrom Date: Fri Jun 15 10:17:38 2018 +0200 locking: Implement an algorithm choice for Wound-Wait mutexes The current Wound-Wait mutex algorithm is actually not Wound-Wait but Wait-Die. Implement also Wound-Wait as a per-ww-class choice. Wound-Wait is, contrary to Wait-Die a preemptive algorithm and is known to generate fewer backoffs. Testing reveals that this is true if the number of simultaneous contending transactions is small. As the number of simultaneous contending threads increases, Wait-Wound becomes inferior to Wait-Die in terms of elapsed time. Possibly due to the larger number of held locks of sleeping transactions. Update documentation and callers. Timings using git://people.freedesktop.org/~thomash/ww_mutex_test tag patch-18-06-15 Each thread runs 100000 batches of lock / unlock 800 ww mutexes randomly chosen out of 100000. Four core Intel x86_64: Algorithm #threads Rollbacks time Wound-Wait 4 ~100 ~17s. Wait-Die 4 ~150000 ~19s. Wound-Wait 16 ~360000 ~109s. Wait-Die 16 ~450000 ~82s. Cc: Ingo Molnar Cc: Jonathan Corbet Cc: Gustavo Padovan Cc: Maarten Lankhorst Cc: Sean Paul Cc: David Airlie Cc: Davidlohr Bueso Cc: "Paul E. McKenney" Cc: Josh Triplett Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Cc: Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Co-authored-by: Peter Zijlstra Signed-off-by: Thomas Hellstrom Acked-by: Peter Zijlstra (Intel) Acked-by: Ingo Molnar commit 55f036ca7e74b85e34958af3d22121c656796413 Author: Peter Ziljstra Date: Fri Jun 15 10:07:12 2018 +0200 locking: WW mutex cleanup Make the WW mutex code more readable by adding comments, splitting up functions and pointing out that we're actually using the Wait-Die algorithm. Cc: Ingo Molnar Cc: Jonathan Corbet Cc: Gustavo Padovan Cc: Maarten Lankhorst Cc: Sean Paul Cc: David Airlie Cc: Davidlohr Bueso Cc: "Paul E. McKenney" Cc: Josh Triplett Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Cc: Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Co-authored-by: Thomas Hellstrom Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Hellstrom Acked-by: Ingo Molnar commit 5bd5bce567c658d265ebb169e05b1a9d0f294f95 Author: Adam Ford Date: Sat Jun 23 08:24:03 2018 -0500 ARM: dts: am3517-evm: Enable USB1 Host The AM3517-evm has a single USB Host port connected to hsusb1. This patch enables that USB port. Signed-off-by: Adam Ford Signed-off-by: Tony Lindgren commit 070473bcf703366e9acb14e172d5b6563cc07a26 Author: Russell King Date: Mon Jul 2 17:21:23 2018 +0100 drm: add missing ctx argument to plane transitional helpers In commits: 34a2ab5e0689 ("drm: Add acquire ctx parameter to ->update_plane") 1931529448bc ("drm: Add acquire ctx parameter to ->plane_disable") a pointer to a drm_modeset_acquire_ctx structure was added as an argument to the method prototypes. The transitional helpers are supposed to be directly plugged in as implementations of these methods, but doing so generates a warning. Add the missing argument. A number of buggy users were added for drm_plane_helper_disable() which need to be fixed up for this change, which we do by passing a NULL ctx argument. Fixes: 1931529448bc ("drm: Add acquire ctx parameter to ->plane_disable") Signed-off-by: Russell King Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/E1fa1Zr-0005gT-VF@rmk-PC.armlinux.org.uk commit 19054d0a0014d9770ac21d2e5f166f584d329441 Author: Felix Brack Date: Mon Jun 11 16:45:53 2018 +0200 ARM: dts: am33xx: Fix syntax of alias names DT specifications do not allow the underscore character in alias names. Replace all underscores in alias names by dashes. Signed-off-by: Felix Brack Signed-off-by: Tony Lindgren commit f83ee19be4272564ad592ef90145db7295229490 Author: Peter Zijlstra Date: Thu Jun 7 10:55:56 2018 +0200 kthread: Simplify kthread_park() completion Oleg explains the reason we could hit park+park is that smpboot_update_cpumask_percpu_thread()'s for_each_cpu_and(cpu, &tmp, cpu_online_mask) smpboot_park_kthread(); turns into: for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) smpboot_park_kthread(); on UP, ignoring the mask. But since we just completely removed that function, this is no longer relevant. So revert commit: b1f5b378e126 ("kthread: Allow kthread_park() on a parked kthread") Suggested-by: Oleg Nesterov Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit 167a88677b05d6a810f23b871cfb2b5db1808e60 Author: Peter Zijlstra Date: Thu Jun 7 10:53:01 2018 +0200 smpboot: Remove cpumask from the API Now that the sole use of the whole smpboot_*cpumask() API is gone, remove it. Suggested-by: Oleg Nesterov Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit 9cf57731b63e37ed995b46690adc604891a9a28f Author: Peter Zijlstra Date: Thu Jun 7 10:52:03 2018 +0200 watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work Oleg suggested to replace the "watchdog/%u" threads with cpu_stop_work. That removes one thread per CPU while at the same time fixes softlockup vs SCHED_DEADLINE. But more importantly, it does away with the single smpboot_update_cpumask_percpu_thread() user, which allows cleanups/shrinkage of the smpboot interface. Suggested-by: Oleg Nesterov Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit 4520843dfa34417eb1e2061f60d2345d9ca614e1 Merge: 03585a95cd83 1cef1150ef40 Author: Ingo Molnar Date: Tue Jul 3 09:20:22 2018 +0200 Merge branch 'sched/urgent' into sched/core, to pick up fixes Signed-off-by: Ingo Molnar commit c5fcdbf15523f6bbbaeb822e3be6003e60f9d3b7 Author: Masahiro Yamada Date: Tue Jul 3 10:50:14 2018 +0900 x86/build/vdso: Simplify 'cmd_vdso2c' No reason to use 'define' directive here. Just use the = operator. Signed-off-by: Masahiro Yamada Cc: Andy Lutomirski Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1530582614-5173-3-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Ingo Molnar commit b5722a457b6e5eabd97a7f39c6c2b8e9a623ab15 Author: Masahiro Yamada Date: Tue Jul 3 10:50:13 2018 +0900 x86/build/vdso: Remove unused vdso-syms.lds This file contains symbol values, and was originally linked into vmlinux, but I have no idea what it was actually used for. Since the following commit: 827880ec260b ("x86/um: thin archives build fix") it is not even linked. Now it is completely orphan, and no problem has been reported. It is a proof that this file was not needed in the first place. Signed-off-by: Masahiro Yamada Acked-by: Richard Weinberger Cc: Andy Lutomirski Cc: Jeff Dike Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-um@lists.infradead.org Link: http://lkml.kernel.org/r/1530582614-5173-2-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Ingo Molnar commit 8b75b3dcb18239b71b351f2b59ebbdb3faa5ce45 Author: Adam Ford Date: Fri Jun 8 06:27:36 2018 -0500 ARM: dts: am3517-som: Add builtin Bluetooth This enables the Bluetooth on the wl1271 available in some models of the AM3517-SOM from Logic PD. Signed-off-by: Adam Ford Signed-off-by: Tony Lindgren commit 6bf5e3410f190374371d89a5816d1a4aaae66776 Author: Adam Ford Date: Fri Jun 8 06:29:26 2018 -0500 ARM: dts: am3517-som: Add WL127x Wifi Certain models of the AM3517 SOM from Logic PD come with an integrated WL1271 WiFi. This patch enables the WiFi. Signed-off-by: Adam Ford Signed-off-by: Tony Lindgren commit 1a1f919eb52ea1e63e135a478c5762b3d8b0935b Author: Oleksij Rempel Date: Tue Jul 3 09:12:47 2018 +0200 ARM: imx: Provide support for NXP i.MX7D Cortex-M4 Cortex M4 part can be started from a boot loader or over Linux remoteproc framework. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 5e2e1c4fb3a6b98bd23ea5e0d5cd61714997a0c9 Author: Enric Balletbo i Serra Date: Wed Jun 6 17:54:13 2018 +0200 ARM: dts: am335x-sl50: enable tsadc on SL50 board The tsadc is used to read various voltages on the board, so enable it to be able to read these voltages from userspace. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tony Lindgren commit 70bd28eb4fb3f4e0ca1aaeb005e653ceb075b0dd Author: Enric Balletbo i Serra Date: Wed Jun 6 17:54:12 2018 +0200 ARM: dts: am335x-sl50: fix label names for all LEDs Fix the label for all LEDs, we made a mistake setting the label names on all LEDs, where says green should say red, and viceversa, where says red should be green. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tony Lindgren commit e5f89dbdebc5125460c4e305574cfb36eac9961c Author: Enric Balletbo i Serra Date: Wed Jun 6 17:54:11 2018 +0200 ARM: dts: am335x-sl50: use audio-graph-card for sound audio-graph-card is recommended for audio bindings. Let's change to it and improve the support by adding the Amplifier configuration and the clock enable control. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tony Lindgren commit 9843532de118c96a445db6020bd5148b6f11b90a Author: Enric Balletbo i Serra Date: Wed Jun 6 17:54:10 2018 +0200 ARM: dts: am335x-sl50: add support for DS1339 Real Time Clock Production hardware will go with the DS1339 RTC chip, so replace the old for the new one and also add the nIRQ pin to be able to properly wakeup the system from suspend. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tony Lindgren commit f9d1dec9fbce30801975eb177692cc893622ee71 Author: Enric Balletbo i Serra Date: Wed Jun 6 17:54:09 2018 +0200 ARM: dts: am335x-sl50: set dr_mode to otg The board can be either a host, or a peripheral, so set the controller as OTG mode to reflect this. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tony Lindgren commit 79932e7ae97dca914963f710ae7950f64021151d Author: Enric Balletbo i Serra Date: Wed Jun 6 17:54:08 2018 +0200 ARM: dts: am335x-sl50: add a node for the LCD controller Add the pins used by the LCD controller, the panel-info and display-timings information for the MIDAS displays connected to the board. There are two displays in the board, and these, are connected to the LCD controller through a FPGA, so the timings and the resolution is what expects the FPGA, not the MIDAS displays. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tony Lindgren commit 25d2ee9f1b22dc62d06265420296a8cd150ad272 Author: Enric Balletbo i Serra Date: Wed Jun 6 17:54:07 2018 +0200 ARM: dts: am335x-sl50: use phy-phandle declarations phy-phandle is now a preferred method to reference a PHY device. The new method also allows you to specify a reset gpio which is required for this board. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tony Lindgren commit 7c1280267ac0e17df3f1d450cc9c5612a5aba54d Author: Enric Balletbo i Serra Date: Wed Jun 6 17:54:06 2018 +0200 ARM: dts: am335x-sl50: update backlight nodes This patch updates the backlight nodes to improve the support and describe better how hardware is done. The changes done were: * Use PWM_POLARITY_INVERTED instead of the hardcoded number. * Add pinctrl configuration. * Add the enable gpio definition. * Add the power supply definition. * Add more brightness levels. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tony Lindgren commit d082852f40de5cf55a7a689bf582fced39f5443e Author: Anson Huang Date: Fri Jun 22 13:32:48 2018 +0800 ARM: imx: enable bus auto clock gating function for i.mx6sll i.MX6SLL has HW bus auto clock gating function, enable it by default to save VDD_SOC_IN power, about 5% ~ 20% saved depends on different use cases. Signed-off-by: Anson Huang Acked-by: Lee Jones Signed-off-by: Shawn Guo commit e40c7f75c9bc81a19c3f927769e42fd974fccaa2 Author: Tony Lindgren Date: Mon Jul 2 23:57:42 2018 -0700 ARM: dts: omap4-droid4: Use software debounce for gpio-keys The default value of 5ms will use GPIO hardware based debounce clocks that will keep L4PER from idling consuming about extra 30mW. Use a value of 10ms that is above the hardware debounce maximum of 7.95ms forcing software based debouncing. This allows droid4 to enter PER retention during idle as long as UARTs are idled and USB modules unloaded or unbound. Note that there seems to be a pending issue with having droid 4 enter core retention during idle where GPIO bank 1 needs to be reset late after init for some reason to not block core retention. In addition to that, we are also missing GPIO related PM runtime calls for omap4 that will be posted separately. Cc: Marcel Partap Cc: Merlijn Wajer Cc: Michael Scott Cc: NeKit Cc: Pavel Machek Cc: Sebastian Reichel Signed-off-by: Tony Lindgren commit 731b409878a3b4387ce824f48228f4e161e20e1c Author: Tony Lindgren Date: Mon Jul 2 23:57:32 2018 -0700 ARM: dts: Configure duovero for to allow core retention during idle By reconfiguring few GPIOs in the dts file we can make duovero parlor hit retention during idle: 1. Let's a larger debounce value for gpio-keys This will then make gpio-keys use software debounce and the GPIO debounce clock is not enabled. 2. Let's allow WLAN suspend for mwifiex This can be done just by adding keep-power-in-suspend. 3. Let's reconfigure smsc911x driver to use GPIO edge interrupt This will allow using NFSroot while the system idles, and the kernel has quite a few dts files with "smsc,lan9115" compatible using edge interrupts. Then to have the system hit core retention during idle, the UARTs needs to be idled and USB modules need to be unloaded or unbound. Cc: Ash Charles Signed-off-by: Tony Lindgren commit 346f5976cc3200896d5fb873412a4fe9c0fc611e Author: Viresh Kumar Date: Fri May 25 11:10:02 2018 +0530 arm64: dts: freescale: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Do minor rearrangement as well to keep ordering consistent. Signed-off-by: Viresh Kumar Signed-off-by: Shawn Guo commit 58ec5e9c9044bd7e1c0bcc6ad822b2e909f49732 Author: Vitaly Kuznetsov Date: Fri Jun 22 19:06:25 2018 +0200 x86/hyper-v: Trace PV IPI send Trace Hyper-V PV IPIs the same way we do PV TLB flush. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Cc: devel@linuxdriverproject.org Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "H. Peter Anvin" Cc: Tianyu Lan Cc: "Michael Kelley (EOSG)" Link: https://lkml.kernel.org/r/20180622170625.30688-5-vkuznets@redhat.com commit 4bd06060762bc7e4834ecf9daeb78834f7a29582 Author: Vitaly Kuznetsov Date: Fri Jun 22 19:06:24 2018 +0200 x86/hyper-v: Use cheaper HVCALL_SEND_IPI hypercall when possible When there is no need to send an IPI to a CPU with VP number > 64 we can do the job with fast HVCALL_SEND_IPI hypercall. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: devel@linuxdriverproject.org Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "H. Peter Anvin" Cc: Tianyu Lan Cc: "Michael Kelley (EOSG)" Link: https://lkml.kernel.org/r/20180622170625.30688-4-vkuznets@redhat.com commit d8e6b232cfdd5d141c03e40a14c1c781480ea05e Author: Vitaly Kuznetsov Date: Fri Jun 22 19:06:23 2018 +0200 x86/hyper-v: Use 'fast' hypercall for HVCALL_SEND_IPI Current Hyper-V TLFS (v5.0b) claims that HvCallSendSyntheticClusterIpi hypercall can't be 'fast' (passing parameters through registers) but apparently this is not true, Windows always uses 'fast' version. We can do the same in Linux too. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: devel@linuxdriverproject.org Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "H. Peter Anvin" Cc: Tianyu Lan Cc: "Michael Kelley (EOSG)" Link: https://lkml.kernel.org/r/20180622170625.30688-3-vkuznets@redhat.com commit 53e52966901a5b14caa2a7c77428a693fe71f734 Author: Vitaly Kuznetsov Date: Fri Jun 22 19:06:22 2018 +0200 x86/hyper-v: Implement hv_do_fast_hypercall16 Implement 'Fast' hypercall with two 64-bit input parameter. This is going to be used for HvCallSendSyntheticClusterIpi hypercall. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Cc: devel@linuxdriverproject.org Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "H. Peter Anvin" Cc: Tianyu Lan Cc: "Michael Kelley (EOSG)" Link: https://lkml.kernel.org/r/20180622170625.30688-2-vkuznets@redhat.com commit ba6096311ba6aed28fec237038ec986c9bf9b8e9 Author: Daniel Vetter Date: Mon Jul 2 11:10:23 2018 +0200 drm: Fix hdmi connector content type property docs Apparently didn't get carefully checked. Fixes: 50525c332b55 ("drm: content-type property for HDMI connector") Cc: Hans Verkuil Cc: Daniel Vetter Cc: Stanislav Lisovskiy Cc: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180702091023.695-1-daniel.vetter@ffwll.ch commit 572cf7d7b07d3d61b82024bccb2a45366d58710e Author: Tony Lindgren Date: Mon Jul 2 23:57:20 2018 -0700 ARM: dts: Improve omap l4per idling with wlcore edge sensitive interrupt The wl1835mod.pdf data sheet says this pretty clearly for WL_IRQ line: "WLAN SDIO out-of-band interrupt line. Set to rising edge (active high) by default." And it seems this interrupt can be optionally configured to use falling edge too since commit bd763482c82e ("wl18xx: wlan_irq: support platform dependent interrupt types"). On omap4, if the wlcore interrupt is configured as level instead of edge, L4PER will stop doing hardware based idling after ifconfig wlan0 down is done and the WL_EN line is pulled down. The symptoms show up with L4PER status registers no longer showing the IDLEST bits as 2 but as 0 for all the active GPIO banks and for L4PER_CLKCTRL. Also the l4per_pwrdm RET count stops increasing in the /sys/kernel/debug/pm_debug/count. While there is also probably a GPIO related issue that needs to be still fixed, this change gets us to the point where we can have L4PER idling. I'm guessing wlcore was at some point configured to use level interrupts because of edge handling issues in gpio-omap. However, with the recent fixes to gpio-omap the edge interrupts seem to be working just fine. Let's change it for all omap boards with wlcore interrupt set as level. Cc: Dave Gerlach Cc: Eyal Reizer Cc: Grygorii Strashko Cc: Kalle Valo Cc: Nishanth Menon Cc: Tero Kristo [tony@atomide.com updated comments a bit for gpio issue] Signed-off-by: Tony Lindgren commit 382ceeaabdada40637449b395fcf17de2b87a005 Author: Roger Quadros Date: Tue May 29 12:00:58 2018 +0300 ARM: dts: dra76-evm: Add VBUS GPIO to USB1/USB2 extcon The board has USB VBUS detection available over GPIO. Plug it to extcon node of USB1 and USB2 ports. Signed-off-by: Roger Quadros Signed-off-by: Tony Lindgren commit a78936fc8cec309804e4baf9febb4c9fb46680cb Author: Roger Quadros Date: Tue May 29 12:00:57 2018 +0300 ARM: dts: dra71-evm: Add VBUS GPIO to USB1/USB2 extcon The board has USB VBUS detection available over GPIO. Plug it to extcon node of USB1 and USB2 ports. Signed-off-by: Roger Quadros Signed-off-by: Tony Lindgren commit b0fa6143ae7469f5efde8ce4195a6151519b77f0 Author: Roger Quadros Date: Tue May 29 12:00:56 2018 +0300 ARM: dts: dra7-evm: Add extcon to USB2 port Both ports on the dra7-evm and related boards can be used as dual-role ports. Although we don't enable dual-role mode for USB2 port let's add the necessary extcon bits to it. Move the common portion of extcon_usb2 into dra7-evm-common.dtsi Signed-off-by: Roger Quadros Signed-off-by: Tony Lindgren commit 5f3cc16483d40bbc609a828511ff851296fc62b6 Author: Roger Quadros Date: Tue May 29 12:00:55 2018 +0300 ARM: dts: am57xx-idk: Enable dual role for USB2 port Dual-role support was added in v4.12. We should be using it for USB2 port on the am57xx-idk. Cc: [4.16+] Reported-by: Bin Liu Signed-off-by: Roger Quadros Signed-off-by: Tony Lindgren commit 484d578b71d4981eb1734f8fffbe42814b043b7f Author: Viresh Kumar Date: Fri May 25 16:01:55 2018 +0530 ARM: dts: omap5: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Fix other missing properties (clocks, supply, clock latency) as well to make it all work. Signed-off-by: Viresh Kumar Signed-off-by: Tony Lindgren commit d6ace1c5f960e90392c32a07020312f933547cdd Author: Viresh Kumar Date: Fri May 25 16:01:54 2018 +0530 ARM: dts: dra74x: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Fix other missing properties (clocks, supply, clock latency) as well to make it all work. Signed-off-by: Viresh Kumar Signed-off-by: Tony Lindgren commit 77cf8a009df8a47ba0c8f32b0d6bb6cbfb55a17e Author: Anson Huang Date: Mon Jul 2 10:04:36 2018 +0800 ARM: dts: imx6: correct anatop regulators range According to i.MX6 datasheet, the LDO_1P1's typical programming operating range is 1.0V to 1.2V, and the LDO_2P5's typical programming operating range is 2.25V to 2.75V, correct LDO_1P1 and LDO_2P5's regulator range settings for i.MX6 SoCs. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 33dc3e410a0d99f394905143b26d34f1fd64c962 Author: Reinette Chatre Date: Sat Jun 30 22:17:33 2018 -0700 x86/intel_rdt: Make CPU information accessible for pseudo-locked regions When a resource group enters pseudo-locksetup mode it reflects that the platform supports cache pseudo-locking and the resource group is unused, ready to be used for a pseudo-locked region. Until it is set up as a pseudo-locked region the resource group is "locked down" such that no new tasks or cpus can be assigned to it. This is accomplished in a user visible way by making the cpus, cpus_list, and tasks resctrl files inaccassible (user cannot read from or write to these files). When the resource group changes to pseudo-locked mode it represents a cache pseudo-locked region. While not appropriate to make any changes to the cpus assigned to this region it is useful to make it easy for the user to see which cpus are associated with the pseudo-locked region. Modify the permissions of the cpus/cpus_list file when the resource group changes to pseudo-locked mode to support reading (not writing). The information presented to the user when reading the file are the cpus associated with the pseudo-locked region. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/12756b7963b6abc1bffe8fb560b87b75da827bd1.1530421961.git.reinette.chatre@intel.com commit 392487def48e4b596526a4a8c2c2ec4cfe73bf13 Author: Reinette Chatre Date: Sat Jun 30 22:17:32 2018 -0700 x86/intel_rdt: Support restoration of subset of permissions As the mode of a resource group changes, the operations it can support may also change. One way in which the supported operations are managed is to modify the permissions of the files within the resource group's resctrl directory. At the moment only two possible permissions are supported: the default permissions or no permissions in support for when the operation is "locked down". It is possible where an operation on a resource group may have more possibilities. For example, if by default changes can be made to the resource group by writing to a resctrl file while the current settings can be obtained by reading from the file, then it may be possible that in another mode it is only possible to read the current settings, and not change them. Make it possible to modify some of the permissions of a resctrl file in support of a more flexible way to manage the operations on a resource group. In this preparation work the original behavior is maintained where all permissions are restored. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/8773aadfade7bcb2c48a45fa294a04d2c03bb0a1.1530421961.git.reinette.chatre@intel.com commit 546d3c74277398a3d76d059bd2db47186bb47fc8 Author: Reinette Chatre Date: Sat Jun 30 22:03:03 2018 -0700 x86/intel_rdt: Fix cleanup of plr structure on error When a resource group enters pseudo-locksetup mode a pseudo_lock_region is associated with it. When the user writes to the resource group's schemata file the CBM of the requested pseudo-locked region is entered into the pseudo_lock_region struct. If any part of pseudo-lock region creation fails the resource group will remain in pseudo-locksetup mode with the pseudo_lock_region associated with it. In case of failure during pseudo-lock region creation care needs to be taken to ensure that the pseudo_lock_region struct associated with the resource group is cleared from any pseudo-locking data - especially the CBM. This is because the existence of a pseudo_lock_region struct with a CBM is significant in other areas of the code, for example, the display of bit_usage and initialization of a new resource group. Fix the error path of pseudo-lock region creation to ensure that the pseudo_lock_region struct is cleared at each error exit. Fixes: 018961ae5579 ("x86/intel_rdt: Pseudo-lock region creation/removal core") Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/49b4782f6d204d122cee3499e642b2772a98d2b4.1530421026.git.reinette.chatre@intel.com commit ce730f1cc1255be152c879a2bc5f295d341d8036 Author: Reinette Chatre Date: Sat Jun 30 22:03:02 2018 -0700 x86/intel_rdt: Move pseudo_lock_region_clear() The pseudo_lock_region_clear() function is moved to earlier in the file in preparation for its use in functions that currently appear before it. No functional change. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/ef098ec2a45501e23792289bff80ae3152141e2f.1530421026.git.reinette.chatre@intel.com commit e878647ec4dd662f16df1d7fcbfac68a9b20ea81 Author: Fabio Estevam Date: Sun Jul 1 19:56:01 2018 -0300 ARM: dts: imx6sll: Fix the SPDX notation for header file Per Documentation/process/license-rules.rst the SPDX notation for header file should be /* */ style, so fix it accordingly. Fixes: 9f30b6b1a957 ("ARM: dts: imx: Add basic dtsi file for imx6sll") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit a33d13e4fe04d46e2b68e879885929f2d7bd7136 Author: Adam Ford Date: Sat May 19 15:48:08 2018 -0500 ARM: dts: am3517-evm: Remove unnessary PMIC parameters The AM3517-EVM uses a TPS65023 PMIC. This is already defined by: compatible = "ti,tps65023" There doesn't seem to be a need to have each regulator in the PMIC with the 'compatible = "regulator-fixed"' since each regulator has a min and max setting. Signed-off-by: Adam Ford Signed-off-by: Tony Lindgren commit 7d034c5c6106b6f9ae13a67eaa98f558f430e33b Author: Sébastien Szymanski Date: Fri Jun 29 16:52:21 2018 +0200 ARM: dts: imx6ull: add operating points i.MX6ULL has different operating ranges than i.MX6UL so add the operating points for the i.MX6ULL and remove them from board device trees. A 25mV offset is added to the minimum allowed values like for the i.MX6UL. The valid frequencies are now selected by the cpufreq driver according to ratings stored in fuses since commit 0aa9abd4c212 ("cpufreq: imx6q: check speed grades for i.MX6ULL") Signed-off-by: Sébastien Szymanski Acked-by: Viresh Kumar Signed-off-by: Shawn Guo commit 5128666b17b4c64c6f9911ea78f578dbaf153bbb Author: Nick Dyer Date: Thu Jun 28 23:56:26 2018 +0100 ARM: dts: imx51-zii-rdu1: correct touchscreen axis inversion The RMI4 touchscreen driver applied inversion and axis swap in the wrong order, violating the DT binding for those properties. This was fixed in 645a397, so correct the RDU1 DT to apply the inversion to the correct axis. Tested on Zii RDU1 00-5105-30 rev B Signed-off-by: Nick Dyer Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit d08605a64e67944eaecfb0e6340f633e01376951 Author: Janusz Krzysztofik Date: Tue Jul 3 00:28:28 2018 +0200 ARM: OMAP1: ams-delta: move late devices back to init_machine Initialization of several Amstrad Delta devices was once moved to late_initcall by commit f7519d8c8290 ("ARM: OMAP1: ams-delta: register latch dependent devices later"). The purpose of that move was to allow smooth conversion of Amstrad Delta latches to GPIO. After successful conversion only ams_delta_serio driver was moved back to device_initcall by commit 8d09a1bb3147 ("input: serio: ams-delta: toggle keyboard power over GPIO"). Registration of ams-delta-nand and lcd_ams_delta devices was kept in late_initcall in order to avoid corrupt data reported by the serio driver on boot. Registration of cx20442-codec device was kept there for it to be probed after a regulator on which it depended was ready. The issue of "keybrd_dataout" GPIO pin not initilized to GPIO_OUT_LOW before other latch2 pins causing the corruption have been apparently fixed by commit 5322c19b117a ("ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin"). In turn, the issue of missing regulator has been fixed by commit 50c678772a0b ("ASoC: cx20442: Don't ignore regulator_get() errors."). Simplify the board init code by moving registration of those devices back to init_machine. Signed-off-by: Janusz Krzysztofik Signed-off-by: Tony Lindgren commit 5f73861fae087df19f7337620da65c99e4260c72 Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:28 2018 +0200 Input: ams_delta_serio: Get FIQ buffer from platform_data Instead of exporting the FIQ buffer symbol to be used in ams-delta-serio driver, pass it to the driver as platform_data. Signed-off-by: Janusz Krzysztofik Acked-by: Dmitry Torokhov Signed-off-by: Tony Lindgren commit a617b36bbc0a1d175bbe98e009e903c1ea0e2be5 Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:27 2018 +0200 Input: ams_delta_serio: use IRQ resource The driver still obtains IRQ number from a hardcoded GPIO. Use IRQ resource instead. For this to work on Amstrad Delta, add the IRQ resource to ams-delta-serio platform device structure. Obtain the IRQ number assigned to "keybrd_clk" GPIO pin from FIQ initialization routine. As a benefit, the driver no longer needs to include . Signed-off-by: Janusz Krzysztofik Acked-by: Dmitry Torokhov Signed-off-by: Tony Lindgren commit dc8fbeb0ffde1f2395449006019e2c89c177df50 Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:26 2018 +0200 ARM: OMAP1: Get rid of Split the header file into two parts and move them to directories where they belong. Information on internal structure of FIQ buffer is moved to for ams-delta-serio driver use. Other information used by ams-delta board init file and FIQ code is made local to mach-omap1 root directory. Signed-off-by: Janusz Krzysztofik Acked-by: Dmitry Torokhov Signed-off-by: Tony Lindgren commit a32d5ce1dbf9389ad28d438dbcdaa520a913cde8 Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:25 2018 +0200 ARM: OMAP1: ams-delta FIQ: Keep serio input GPIOs requested From the very beginning, input GPIO pins of ams-delta serio port have been used by FIQ handler, not serio driver. Don't request those pins from the ams-delta-serio driver any longer, instead keep them requested and initialized by the FIQ initialization routine which already requests them and releases while identifying GPIO IRQs. Signed-off-by: Janusz Krzysztofik Acked-by: Dmitry Torokhov Signed-off-by: Tony Lindgren commit 97abda99a56949059955ac0d82c0f6c8277416c4 Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:24 2018 +0200 ARM: OMAP1: ams-delta FIQ: don't use static GPIO numbers With introduction of GPIO lookup tables to Amstrad Delta board init file, semantics of symbols representing OMAP GPIO pins defined in changed from statically assigned global GPIO numbers to hardware pin numbers local to OMAP "gpio-0-15" chip. This patch modifies deferred FIQ interrupt handler so it no longer uses static GPIO numbers in favour of IRQ data descriptors obtained at FIQ initialization time from descriptor of the GPIO chip with use of its hardware pin numbers. The chip descriptor is passed from the board init file. As a benefit, the deferred FIQ handler should work faster. Signed-off-by: Janusz Krzysztofik Acked-by: Linus Walleij [tony@atomide.com: removed duplicate gpiochip_match_by_label] Signed-off-by: Tony Lindgren commit 5180ee394fe81849e65bc89bfb54a6ec5fe88c75 Author: Sebastian Reichel Date: Thu Jun 28 18:36:39 2018 +0200 ARM: dts: imx53-ppd: Rename usbphy nodes This renames usbphy nodes 2 & 3, so that they follow the same format as usbphy node 0 & 1 from imx53.dtsi. Signed-off-by: Sebastian Reichel Signed-off-by: Shawn Guo commit 5bb59c8003650993f89a0c99090ac1a8d37fb63e Author: Sebastian Reichel Date: Thu Jun 28 18:36:38 2018 +0200 ARM: dts: imx53-ppd: Add fixed-regulator information Add information about 3V3 power rail to avoid kernel warnings, that dummy regulators have been added. Signed-off-by: Sebastian Reichel Signed-off-by: Shawn Guo commit cc3aba48e0d4f79ca1623248aefb7e83bb8680c8 Author: Andrey Smirnov Date: Tue Jul 3 13:43:47 2018 +0800 ARM: dts: imx51-babbage: Make use of pinctrl_usbh1reg Pinctrl_usbh1reg defines pinmux setting for reset GPIO used by usbh1phy, but is not referenced by that node. Fix that. Signed-off-by: Andrey Smirnov Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 399c4129eba6145924ab90363352b7bdcd554751 Merge: 021c91791a5e cd31b8073685 Author: Ulf Hansson Date: Tue Jul 3 06:57:48 2018 +0200 Merge tag 'pxa-for-4.19-dma_slave_map' of https://github.com/rjarzmik/linux Pull in branch for switching pxa to DMA slave maps, from Robert Jarzmik. This is needed due to dependencies of changes for the pxamci mmc driver. Signed-off-by: Ulf Hansson commit 00f553660a7f524a3b913cb5cf6c5f33f9638f09 Author: Dan Murphy Date: Fri Jun 29 10:35:46 2018 -0500 net: phy: DP83TC811: Fix SGMII enable/disable If SGMII was selected in the DT then the device should write the SGMII enable bit. If SGMII is not selected in the DT then the SGMII bit should be disabled. Signed-off-by: Dan Murphy Signed-off-by: David S. Miller commit 42036383599e53fc4b3d9aab52d1492c561ab650 Author: Dan Murphy Date: Fri Jun 29 10:35:45 2018 -0500 net: phy: DP83TC811: Add INT_STAT3 Add INT_STAT3 interrupt setting and clearing support. Signed-off-by: Dan Murphy Signed-off-by: David S. Miller commit c17d6179ad5aec2a6ef85f8555454e9cefd4b9fb Author: Masahiro Yamada Date: Tue Jul 3 09:39:12 2018 +0900 gcc-plugins: remove unused GCC_PLUGIN_SUBDIR GCC_PLUGIN_SUBDIR has never been used. If you really need this in the future, please re-add it then. For now, the code is unused. Remove. 'export HOSTLIBS' is not necessary either. Signed-off-by: Masahiro Yamada Signed-off-by: Kees Cook commit 741c5640a15a23a2ec3a0846668a82e8e3b4314d Author: Kees Cook Date: Mon Jul 2 08:56:21 2018 -0700 powerpc/mpc5200: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this switches to using a stack size large enough for the saved routine and adds a sanity check making sure the routine doesn't overflow into the 0x600 exception handler. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Reviewed-by: Arnd Bergmann Signed-off-by: Michael Ellerman commit 47768f372eae030db6fab5225f9504a820d2c07f Author: Viresh Kumar Date: Fri May 25 16:01:48 2018 +0530 ARM: dts: ls1021a: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Signed-off-by: Viresh Kumar Signed-off-by: Shawn Guo commit 5cd3da4ba2397ef07226ca2aa5094ed21ff8198f Merge: f6779e4e53b6 d0fbad0aec1d Author: David S. Miller Date: Tue Jul 3 10:26:50 2018 +0900 Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net Simple overlapping changes in stmmac driver. Adjust skb_gro_flush_final_remcsum function signature to make GRO list changes in net-next, as per Stephen Rothwell's example merge resolution. Signed-off-by: David S. Miller commit 6aa56f44253a6dd802e45d8ab1b48847feaf063a Author: Kamal Mostafa Date: Fri Jun 29 13:04:21 2018 -0700 usercopy: Do not select BUG with HARDENED_USERCOPY There is no need to "select BUG" when CONFIG_HARDENED_USERCOPY is enabled. The kernel thread will always die, regardless of the CONFIG_BUG. Signed-off-by: Kamal Mostafa [kees: tweak commit log] Signed-off-by: Kees Cook commit c7ea1579a17e81c602cfc8121013cf8e39edd32b Author: Viresh Kumar Date: Fri May 25 16:01:58 2018 +0530 arm: dts: highbank: Add missing OPP properties for CPUs The OPP properties, like "operating-points", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can create an OPP table. Add such missing properties. Fix other missing property (clock latency) as well to make it all work. Signed-off-by: Viresh Kumar Acked-by: Rob Herring Signed-off-by: Olof Johansson commit e936a38ac92dd40867ac3b52cfd8f3f70fe717a5 Author: Bart Van Assche Date: Fri Jun 22 14:53:07 2018 -0700 scsi: target: Remove se_dev_entry.ua_count se_dev_entry.ua_count is only used to check whether or not se_dev_entry.ua_list is empty. Use list_empty_careful() instead. Checking whether or not ua_list is empty without holding the lock that protects that list is fine because the code that dequeues from that list will check again whether or not that list is empty. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 325c1e8b248ed12a685d0a904b774abef3821e8e Author: Bart Van Assche Date: Fri Jun 22 14:53:06 2018 -0700 scsi: target: Fix handling of removed LUNs Send a valid ASC / ASCQ combination back to the initiator if a SCSI command is received after a LUN has been removed. This patch fixes the following call trace: WARNING: CPU: 0 PID: 4 at drivers/target/target_core_transport.c:3131 translate_sense_reason+0x164/0x190 [target_core_mod] Workqueue: ib-comp-wq ib_cq_poll_work [ib_core] RIP: 0010:translate_sense_reason+0x164/0x190 [target_core_mod] Call Trace: transport_send_check_condition_and_sense+0x95/0x1c0 [target_core_mod] transport_generic_request_failure+0x102/0x270 [target_core_mod] transport_generic_new_cmd+0x138/0x340 [target_core_mod] transport_handle_cdb_direct+0x2f/0x80 [target_core_mod] target_submit_cmd_map_sgls+0x212/0x2a0 [target_core_mod] srpt_handle_new_iu+0x244/0x680 [ib_srpt] __ib_process_cq+0x6d/0xc0 [ib_core] ib_cq_poll_work+0x18/0x50 [ib_core] process_one_work+0x20b/0x6a0 worker_thread+0x35/0x380 kthread+0x117/0x130 ret_from_fork+0x24/0x30 Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 17e391dd09f5b257365367ce812a4332dc2c9653 Author: Bart Van Assche Date: Fri Jun 22 14:53:05 2018 -0700 scsi: target: Send unit attention condition even if the sense buffer is too small Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 89a104ed4f6a6876c25fbe8de0253b89466869f0 Author: Bart Van Assche Date: Fri Jun 22 14:53:04 2018 -0700 scsi: target: Do not duplicate the code that marks that a command has sense data This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 799d44d0fab60a96a0f13cdb13c9cc94ce06765e Author: Bart Van Assche Date: Fri Jun 22 14:53:03 2018 -0700 scsi: target/tcm_loop: Avoid that static checkers warn about dead code The code under the "release:" label can only be reached after se_cmd has been set to a non-NULL value. Hence remove the if (se_cmd) test. Keep the else-part since calling transport_generic_free_cmd() is not necessary for a command that has not been submitted to the core. Reported-by: Dan Carpenter Fixes: 4d3895d5ea43 ("target/tcm_loop: Merge struct tcm_loop_cmd and struct tcm_loop_tmr") Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Dan Carpenter Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit aa090eabcb341b0c023e802884235c29598df1e5 Author: Bart Van Assche Date: Fri Jun 22 14:53:02 2018 -0700 scsi: target: Remove second argument from fabric_make_tpg() Since most target drivers do not use the second fabric_make_tpg() argument ("group") and since it is trivial to derive the group pointer from the wwn pointer, do not pass the group pointer to fabric_make_tpg(). Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Felipe Balbi Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 35bea5c84fd13c643cce63f0b5cd4b148f8c901d Author: Bart Van Assche Date: Fri Jun 22 14:53:01 2018 -0700 scsi: target/iscsi: Make iscsit_ta_authentication() respect the output buffer size Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1") Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Martin K. Petersen commit ed88f055788a89598c33d183652af8a84dfc5007 Author: Bart Van Assche Date: Fri Jun 22 14:53:00 2018 -0700 scsi: target/iscsi: Reduce number of __iscsit_free_cmd() callers Instead of calling __iscsit_free_cmd() from inside iscsit_aborted_task() if a command has been aborted and from inside iscsit_free_cmd() if a command has not been aborted, call __iscsit_free_cmd() from inside lio_release_cmd(). The latter function is namely called for all commands once the reference count has dropped to zero. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Varun Prakash Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 7b2cc7dc0dbf5da9cf16ffcf1ca8e904ab574ff5 Author: Bart Van Assche Date: Fri Jun 22 14:52:59 2018 -0700 scsi: target: Simplify the code for waiting for command completion Instead of embedding the completion that is used for waiting for command completion in struct se_cmd, let the context that waits for command completion allocate it. This makes it possible to have a single code path for non-aborted and aborted commands in target_release_cmd_kref() and avoids that transport_generic_free_cmd() has to call cmd->se_tfo->release_cmd() directly. This patch does not change any functionality. Note: transport_generic_free_cmd() only waits until the se_cmd reference count has reached zero after it has set both CMD_T_FABRIC_STOP and CMD_T_ABORTED. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit edf46eee59c5acd829c3b6a564c26b5386362ea3 Author: Bart Van Assche Date: Fri Jun 22 14:52:58 2018 -0700 scsi: target: Simplify transport_generic_free_cmd() (2/2) Since target_wait_free_cmd() skips TMFs with no associated LUN, it is safe to call that function for such commands. Use this to simplify transport_generic_free_cmd(). The only functional change in this patch is that CMD_T_FABRIC_STOP gets set for TMFs with no associated LUN by transport_generic_free_cmd(). Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit a8864d861d62feadc5f37c6651a7d7a2fc2477a8 Author: Bart Van Assche Date: Fri Jun 22 14:52:57 2018 -0700 scsi: target: Simplify transport_generic_free_cmd() (1/2) Move identical code outside an if/else statement. This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 65422d705f1abf65897464b4e9c51ec3e1376ec4 Author: Bart Van Assche Date: Fri Jun 22 14:52:56 2018 -0700 scsi: target: Fold core_tmr_handle_tas_abort() into transport_cmd_finish_abort() For the two calls to transport_cmd_finish_abort() outside core_tmr_handle_tas_abort() it is guaranteed that CMD_T_TAS is not set. Use this property to fold core_tmr_handle_tas_abort() into transport_cmd_finish_abort(). This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 709d56512fe8ed6d5092a1d43a4343d23df2b31c Author: Bart Van Assche Date: Fri Jun 22 14:52:55 2018 -0700 scsi: target: Simplify core_tmr_handle_tas_abort() The code that can set CMD_T_TAS is executed by the same thread as the thread that executes core_tmr_handle_tas_abort(). That means that no locking is needed to check CMD_T_TAS from inside core_tmr_handle_tas_abort(). This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 953bcf7ad16ac6ecee7d2f5593501aee5e5ae8b8 Author: Bart Van Assche Date: Fri Jun 22 14:52:54 2018 -0700 scsi: target: Document when CMD_T_STOP and CMD_T_COMPLETE are set Document those aspects of transport_cmd_check_stop_to_fabric() and transport_generic_free_cmd() of which it is nontrivial to derive these from their implementation. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 00d909a10710a3416272d4179adf3837b9a9f3c2 Author: Bart Van Assche Date: Fri Jun 22 14:52:53 2018 -0700 scsi: target: Make the session shutdown code also wait for commands that are being aborted Target drivers must call target_sess_cmd_list_set_waiting() and target_wait_for_sess_cmds() before freeing a session. Since freeing a session is only safe after all commands that are associated with a session have finished, make target_wait_for_sess_cmds() also wait for commands that are being aborted. Instead of setting a flag in each pending command from target_sess_cmd_list_set_waiting() and waiting in target_wait_for_sess_cmds() on a per-command completion, only set a per-session flag in the former function and wait on a per-session completion in the latter function. This change is safe because once a SCSI initiator system has submitted a command a target system is always allowed to execute it to completion. See also commit 0f4a943168f3 ("target: Fix remote-port TMR ABORT + se_cmd fabric stop"). This patch is based on the following two patches: * Bart Van Assche, target: Simplify session shutdown code, February 19, 2015 (https://github.com/bvanassche/linux/commit/8df5463d7d7619f2f1b70cfe5172eaef0aa52815). * Christoph Hellwig, target: Rework session shutdown code, December 7, 2015 (http://thread.gmane.org/gmane.linux.scsi.target.devel/10695). Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Martin K. Petersen commit d1bff07f387c05cfaba1ea505fc2ee5eac6b2c21 Author: Bart Van Assche Date: Fri Jun 22 14:52:52 2018 -0700 scsi: target: Introduce transport_init_session() Other than initializing xcopy_pt_sess.sess_wait_list, this patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 317f89712d7aa4acc2d93df27b753d4489826cc5 Author: Bart Van Assche Date: Fri Jun 22 14:52:51 2018 -0700 scsi: target: Rename transport_init_session() into transport_alloc_session() Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 3eeff1984051e45448765e49b712c6bfee1de378 Author: Bart Van Assche Date: Fri Jun 22 14:52:50 2018 -0700 scsi: target: Move a list_del_init() statement This patch does not change any functionality but makes the next patch easier to read. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 36d4cb460bcbe2a1323732a6e4bb9dd783284368 Author: Bart Van Assche Date: Thu Jun 28 13:48:57 2018 -0500 scsi: target: Avoid that EXTENDED COPY commands trigger lock inversion The approach for adding a device to the devices_idr data structure and for removing it is as follows: * &dev->dev_group.cg_item is initialized before a device is added to devices_idr. * If the reference count of a device drops to zero then target_free_device() removes the device from devices_idr. * All devices_idr manipulations are protected by device_mutex. This means that increasing the reference count of a device is sufficient to prevent removal from devices_idr and also that it is safe access dev_group.cg_item for any device that is referenced by devices_idr. Use this to modify target_find_device() and target_for_each_device() such that these functions no longer introduce a dependency between device_mutex and the configfs root inode mutex. Note: it is safe to pass a NULL pointer to config_item_put() and also to config_item_get_unless_zero(). This patch prevents that lockdep reports the following complaint: ====================================================== WARNING: possible circular locking dependency detected 4.12.0-rc1-dbg+ #1 Not tainted ------------------------------------------------------ rmdir/12053 is trying to acquire lock: (device_mutex#2){+.+.+.}, at: [] target_free_device+0xae/0xf0 [target_core_mod] but task is already holding lock: (&sb->s_type->i_mutex_key#14){++++++}, at: [] vfs_rmdir+0x50/0x140 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sb->s_type->i_mutex_key#14){++++++}: lock_acquire+0x59/0x80 down_write+0x36/0x70 configfs_depend_item+0x3a/0xb0 [configfs] target_depend_item+0x13/0x20 [target_core_mod] target_xcopy_locate_se_dev_e4_iter+0x87/0x100 [target_core_mod] target_devices_idr_iter+0x16/0x20 [target_core_mod] idr_for_each+0x39/0xc0 target_for_each_device+0x36/0x50 [target_core_mod] target_xcopy_locate_se_dev_e4+0x28/0x80 [target_core_mod] target_xcopy_do_work+0x2e9/0xdd0 [target_core_mod] process_one_work+0x1ca/0x3f0 worker_thread+0x49/0x3b0 kthread+0x109/0x140 ret_from_fork+0x31/0x40 -> #0 (device_mutex#2){+.+.+.}: __lock_acquire+0x101f/0x11d0 lock_acquire+0x59/0x80 __mutex_lock+0x7e/0x950 mutex_lock_nested+0x16/0x20 target_free_device+0xae/0xf0 [target_core_mod] target_core_dev_release+0x10/0x20 [target_core_mod] config_item_put+0x6e/0xb0 [configfs] configfs_rmdir+0x1a6/0x300 [configfs] vfs_rmdir+0xb7/0x140 do_rmdir+0x1f4/0x200 SyS_rmdir+0x11/0x20 entry_SYSCALL_64_fastpath+0x23/0xc2 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#14); lock(device_mutex#2); lock(&sb->s_type->i_mutex_key#14); lock(device_mutex#2); *** DEADLOCK *** 3 locks held by rmdir/12053: #0: (sb_writers#10){.+.+.+}, at: [] mnt_want_write+0x1f/0x50 #1: (&sb->s_type->i_mutex_key#14/1){+.+.+.}, at: [] do_rmdir+0x15e/0x200 #2: (&sb->s_type->i_mutex_key#14){++++++}, at: [] vfs_rmdir+0x50/0x140 stack backtrace: CPU: 3 PID: 12053 Comm: rmdir Not tainted 4.12.0-rc1-dbg+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014 Call Trace: dump_stack+0x86/0xcf print_circular_bug+0x1c7/0x220 __lock_acquire+0x101f/0x11d0 lock_acquire+0x59/0x80 __mutex_lock+0x7e/0x950 mutex_lock_nested+0x16/0x20 target_free_device+0xae/0xf0 [target_core_mod] target_core_dev_release+0x10/0x20 [target_core_mod] config_item_put+0x6e/0xb0 [configfs] configfs_rmdir+0x1a6/0x300 [configfs] vfs_rmdir+0xb7/0x140 do_rmdir+0x1f4/0x200 SyS_rmdir+0x11/0x20 entry_SYSCALL_64_fastpath+0x23/0xc2 Signed-off-by: Bart Van Assche [Rebased to handle conflict withe target_find_device removal] Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 6f3bf5a2fa4a53c8dbb5b7b3d3d93bf85acaa2eb Author: Bart Van Assche Date: Fri Jun 22 14:52:48 2018 -0700 scsi: target: Use config_item_name() instead of open-coding it Some target code uses config_item_name() while other code accesses .ci_name directly. Make the target code consistent by switching to config_item_name(). Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 265d59aacbce7e50bdc1f5d25033c38dd70b3767 Author: Ming Lei Date: Sat Jun 30 09:27:24 2018 +0800 scsi: core: fix scsi_host_queue_ready 328728630d9f ("scsi: avoid to hold host-wide counter of host_busy for scsi_mq") adds one extra check on scsi_host_busy(shost) in scsi_host_queue_ready(), which is wrong and not necessary, can causes booting stall on LSI53c895A. So remove the check. Cc: Omar Sandoval , Cc: "Martin K. Petersen" , Cc: James Bottomley , Cc: Christoph Hellwig , Cc: Don Brace Cc: Kashyap Desai Cc: Mike Snitzer Cc: Hannes Reinecke Cc: Laurence Oberman Cc: Bart Van Assche Cc: Guenter Roeck Reported-by: Guenter Roeck Fixes: 328728630d9f ("scsi: avoid to hold host-wide counter of host_busy for scsi_mq") Signed-off-by: Ming Lei Tested-by: Guenter Roeck Signed-off-by: Martin K. Petersen commit 624fa7790f80575a4ec28fbdb2034097dc18d051 Author: Bart Van Assche Date: Fri Jun 22 14:54:49 2018 -0700 scsi: klist: Make it safe to use klists in atomic context In the scsi_transport_srp implementation it cannot be avoided to iterate over a klist from atomic context when using the legacy block layer instead of blk-mq. Hence this patch that makes it safe to use klists in atomic context. This patch avoids that lockdep reports the following: WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&(&k->k_lock)->rlock); local_irq_disable(); lock(&(&q->__queue_lock)->rlock); lock(&(&k->k_lock)->rlock); lock(&(&q->__queue_lock)->rlock); stack backtrace: Workqueue: kblockd blk_timeout_work Call Trace: dump_stack+0xa4/0xf5 check_usage+0x6e6/0x700 __lock_acquire+0x185d/0x1b50 lock_acquire+0xd2/0x260 _raw_spin_lock+0x32/0x50 klist_next+0x47/0x190 device_for_each_child+0x8e/0x100 srp_timed_out+0xaf/0x1d0 [scsi_transport_srp] scsi_times_out+0xd4/0x410 [scsi_mod] blk_rq_timed_out+0x36/0x70 blk_timeout_work+0x1b5/0x220 process_one_work+0x4fe/0xad0 worker_thread+0x63/0x5a0 kthread+0x1c1/0x1e0 ret_from_fork+0x24/0x30 See also commit c9ddf73476ff ("scsi: scsi_transport_srp: Fix shost to rport translation"). Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: James Bottomley Acked-by: Greg Kroah-Hartman Signed-off-by: Martin K. Petersen commit 68c3f904ed4591797ccac22148b95c54af391f30 Author: Bart Van Assche Date: Thu Jun 28 08:31:28 2018 -0700 scsi: sd_zbc: Remove an assignment from sd_zbc_setup_report_cmnd() Since nr_bytes == blk_rq_bytes(rq) == rq->__data_len, the rq->__data_len = nr_bytes assignment does not modify the value of rq->__data_len. Hence remove that assignment. Note: the code in sd_done() that sets the residual to zero for zone report requests is not affected by this patch. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Hannes Reinecke Cc: Johannes Thumshirn Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 915d9b71422126076f1971f1a44561ae76890060 Author: Dan Carpenter Date: Thu Jun 28 12:23:10 2018 +0300 scsi: qedi: tidy up a size calculation The id_tbl->table pointer points to unsigned long so static checkers complain that instead of 4 we should be allocating sizeof(long) bytes. We're trying to allocate enough bits for the bitmap. The size variable is always 1024. (1024 / 32 * 4) is the same as (1024 / 64 * 8) so this doesn't change runtime, but this is the more idiomatic way to do it and makes the static checker happy. [mkp: typo] Signed-off-by: Dan Carpenter Acked-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit 1262dc09dc9ae7bf4ad00b6a2c5ed6a6936bcd10 Author: Breno Leitao Date: Tue Jun 26 17:35:16 2018 -0300 scsi: ibmvscsi: Improve strings handling Currently an open firmware property is copied into partition_name variable without keeping a room for \0. Later one, this variable (partition_name), which is 97 bytes long, is strncpyed into ibmvcsci_host_data->madapter_info->partition_name, which is 96 bytes long, possibly truncating it 'again' and removing the \0. This patch simply decreases the partition name to 96 and just copy using strlcpy() which guarantees that the string is \0 terminated. I think there is no issue if this there is a truncation in this very first copy, i.e, when the open firmware property is read and copied into the driver for the very first time; This issue also causes the following warning on GCC 8: drivers/scsi/ibmvscsi/ibmvscsi.c:281:2: warning: strncpy output may be truncated copying 96 bytes from a string of length 96 [-Wstringop-truncation] ... inlined from ibmvscsi_probe at drivers/scsi/ibmvscsi/ibmvscsi.c:2221:7: drivers/scsi/ibmvscsi/ibmvscsi.c:265:3: warning: strncpy specified bound 97 equals destination size [-Wstringop-truncation] CC: Bart Van Assche CC: Tyrel Datwyler Signed-off-by: Breno Leitao Acked-by: Tyrel Datwyler Signed-off-by: Martin K. Petersen commit a608987970b929e250957e4e3fb891f1f10eff6f Author: Tarun Vyas Date: Wed Jun 27 13:02:50 2018 -0700 drm/i915: Wait for PSR exit before checking for vblank evasion The PIPEDSL freezes on PSR entry and if PSR hasn't fully exited, then the pipe_update_start call schedules itself out to check back later. On ChromeOS-4.4 kernel, which is fairly up-to-date w.r.t drm/i915 but lags w.r.t core kernel code, hot plugging an external display triggers tons of "potential atomic update errors" in the dmesg, on *pipe A*. A closer analysis reveals that we try to read the scanline 3 times and eventually timeout, b/c PSR hasn't exited fully leading to a PIPEDSL stuck @ 1599. This issue is not seen on upstream kernels, b/c for *some* reason we loop inside intel_pipe_update start for ~2+ msec which in this case is more than enough to exit PSR fully, hence an *unstuck* PIPEDSL counter, hence no error. On the other hand, the ChromeOS kernel spends ~1.1 msec looping inside intel_pipe_update_start and hence errors out b/c the source is still in PSR. Regardless, we should wait for PSR exit (if PSR is disabled, we incur a ~1-2 usec penalty) before reading the PIPEDSL, b/c if we haven't fully exited PSR, then checking for vblank evasion isn't actually applicable. v4: Comment explaining psr_wait after enabling VBL interrupts (DK) v5: CAN_PSR() to handle platforms that don't support PSR. v6: Handle local_irq_disable on early return (Chris) Acked-by: Daniel Vetter Reviewed-by: Dhinakaran Pandiyan Signed-off-by: Tarun Vyas Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180627200250.1515-2-tarun.vyas@intel.com commit c43dbcbbcc8c515d4ececc7a996d5fc7286c28c3 Author: Tarun Vyas Date: Wed Jun 27 13:02:49 2018 -0700 drm/i915/psr: Lockless version of psr_wait_for_idle This is a lockless version of the exisiting psr_wait_for_idle(). We want to wait for PSR to idle out inside intel_pipe_update_start. At the time of a pipe update, we should never race with any psr enable or disable code, which is a part of crtc enable/disable. The follow up patch will use this lockless wait inside pipe_update_ start to wait for PSR to idle out before checking for vblank evasion. We need to keep the wait in pipe_update_start to as less as it can be. So,we can live and flourish w/o taking any psr locks at all. Even if psr is never enabled, psr2_enabled will be false and this function will wait for PSR1 to idle out, which should just return immediately, so a very short (~1-2 usec) wait for cases where PSR is disabled. v2: Add comment to explain the 25msec timeout (DK) v3: Rename psr_wait_for_idle to __psr_wait_for_idle_locked to avoid naming conflicts and propagate err (if any) to the caller (Chris) v5: Form a series with the next patch v7: Better explain the need for lockless wait and increase the max timeout to handle refresh rates < 60 Hz (Daniel Vetter) v8: Rebase Acked-by: Daniel Vetter Reviewed-by: Dhinakaran Pandiyan Signed-off-by: Tarun Vyas Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180627200250.1515-1-tarun.vyas@intel.com commit abdd322f680870dbe1942425d1fa2c74de4721f4 Author: Dhinakaran Pandiyan Date: Wed Jun 27 23:18:54 2018 -0700 drm/i915: Remove unnecessary check for unsupported modifiers for NV12 There is already a check to allow only RGB8888 formats with CCS modifiers. Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Daniel Vetter Reviewed-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20180628061854.6430-1-dhinakaran.pandiyan@intel.com commit 00b062967f1524de25daf6578d9043b0bbe7c208 Author: Vathsala Nagaraju Date: Wed Jun 27 13:38:30 2018 +0530 drm/i915/psr: Add psr1 live status Prints live state of psr1.Extending the existing PSR2 live state function to cover psr1. Tested on KBL with psr2 and psr1 panel. v2: rebase v3: DK Rename psr2_live_status to psr_source_status. v4: DK Move EDP_PSR_STATUS_STATE_SHIFT below EDP_PSR_STATUS_STATE_MASK. Pass seq to psr_source_status, handle source status prints in psr_source_status. v5: Fixed CI warning messages v6: Remove extra space in the title before the colon.(DK) Rebase. (Jani) v7: Use tabs for indenting the values.(Jani) v8: Addressed dk's review comments. Cc: Rodrigo Vivi Cc: Dhinakaran Pandiyan Reviewed-by: Dhinakaran Pandiyan Signed-off-by: Vathsala Nagaraju Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/1530086910-15914-1-git-send-email-vathsala.nagaraju@intel.com commit be926ceeb4efc3bf44cb9b56f5c71aac9b1f8bbe Author: Jean-Christophe Dubois Date: Sun Jul 1 00:10:50 2018 +0200 thermal: i.MX: Allow thermal probe to fail gracefully in case of bad calibration. Without this fix, the thermal probe on i.MX6 might trigger a division by zero exception later in the probe if the calibration does fail. Note: This linux behavior (Division by zero in kernel) has been triggered on a Qemu i.MX6 emulation where parameters in nvmem were not set. With this fix the division by zero is not triggeed anymore as the thermal probe does fail early. Signed-off-by: Jean-Christophe Dubois Reviewed-by: Fabio Estevam Signed-off-by: Eduardo Valentin commit ea272257ccba1e57b9448444e1e3de39794ad6b4 Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:49:11 2018 -0300 docs: histogram.txt: convert it to ReST file format Despite being mentioned at Documentation/trace/ftrace.rst as a rst file, this file was still a text one, with several issues. Convert it to ReST and add it to the trace index: - Mark the document title as such; - Identify and indent the literal blocks; - Use the proper markups for table. Signed-off-by: Mauro Carvalho Chehab Acked-by: Steven Rostedt (VMware) Signed-off-by: Jonathan Corbet commit 60a866685006bae0c3db20e4bae31887eb452ff1 Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:49:08 2018 -0300 gpio.h: fix location of gpio legacy documentation The location of this doc file was moved. Change its reference accordingly. Fixes: 7ee2c13080c9 ("Documentation: gpio: Move legacy documentation to driver-api") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet commit 2f896e1c518c7678fb059e16dd92bbac1cb68c95 Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:49:07 2018 -0300 MAINTAINERS: fix location of ina2xx.txt device tree file This file got moved and merged, causing the old reference to not exist anymore. Fix it. Fixes: 6e24d205a8aa ("hwmon: ina209: move binding docs to proper place") Fixes: 62bc9f15e443 ("dt-bindings: merge ina209 binding into ina2xx binding") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet commit 3fc3bbfc2083a048500a2a1b8377331af7f9175f Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:49:06 2018 -0300 devicectree: bindings: fix location of leds common file The leds.txt was moved and renamed. Fix references to it accordingly. Fixes: f67605394f0b ("devicetree/bindings: Move gpio-leds binding into leds directory") Signed-off-by: Mauro Carvalho Chehab Acked-by: Pavel Machek Signed-off-by: Jonathan Corbet commit 1d1636e32e69961ed42ee043ef6b75c26d327599 Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:49:05 2018 -0300 docs: zh_CN: fix location of oops-tracing.txt This file was merged with bug-hunting. Make the translation to point for its new location. Fixes: f226e460875d ("admin-guide: merge oops-tracing with bug-hunting") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet commit 5d395fa63baa5cce7314ff806b81c77319432bf2 Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:49:04 2018 -0300 scripts/documentation-file-ref-check: ignore sched-pelt false positive When Documentation/scheduler/sched-pelt.c is compiled, it generates a file called Documentation/scheduler/sched-pelt. As this only exists after building such tool, we need an explict check to remove the false-positive. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet commit d25c0634441ca59325f1119cbd203ecda65521b2 Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:49:03 2018 -0300 scripts/documentation-file-ref-check: remove some false positives There are several false positives at tcm_mod_builder.txt: Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000 Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000 Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_base.h Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../include/target/target_core_fabric_ops.h Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_fabric.c Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_fabric.h Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_configfs.c Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/Kbuild Documentation/target/tcm_mod_builder.txt: mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/Kconfig Ignore them. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet commit c633d0f19d4e3eea1ac4be60d9cdcedd946530ea Merge: 2bc0b8e2461f 70455ac7ffb6 Author: Olof Johansson Date: Mon Jul 2 10:18:53 2018 -0700 Merge tag 'socfpga_updates_for_v4.19_part1' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into next/dt SoCFPGA DTS updates for v4.19 - Add SPI node for Arria10 - Stratix10 platform updates - Add QSPI support on devkit - Add clocks for SPI/USB/watchdog - Add additional OCP reset property * tag 'socfpga_updates_for_v4.19_part1' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: dts: stratix10: Add SPI node clocks for Stratix10 ARM: dts: Add SPI0 node for Arria10 arm64: dts: stratix10: add OCP reset property for ethernet arm64: dts: stratix10: fill in clocks field for usb and watchdog arm64: dts: stratix10: Add QSPI support for Stratix10 Signed-off-by: Olof Johansson commit 3287ecdf14fd40dbeca831d8cb1b1b73b1885dcb Merge: 021c91791a5e 3249527f19d6 Author: Olof Johansson Date: Mon Jul 2 10:18:09 2018 -0700 Merge tag 'tee-drv-for-4.18' of git://git.linaro.org/people/jens.wiklander/linux-tee into next/drivers Misc enhancement for tee driver subsystem * Replaces getnstimeofday64() with ktime_get_real_ts64() * Adds OPTEE_SHM_NUM_PRIV_PAGES to configure how many pages should be statically reserved for driver private allocations * tag 'tee-drv-for-4.18' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: making OPTEE_SHM_NUM_PRIV_PAGES configurable via Kconfig tee: replace getnstimeofday64() with ktime_get_real_ts64() Signed-off-by: Olof Johansson commit 5f6654094ff35a7a92eb76667788ef633595e4ea Merge: 5105730fbf67 021c91791a5e Author: Jonathan Corbet Date: Mon Jul 2 11:14:50 2018 -0600 Merge tag 'v4.18-rc3' into docs-next -rc1 broke the docs build due to changes in the e100/e1000 drivers; -rc3 got the fixes via the networking tree. Pull in -rc3 so that the docs tree can actually build the docs again. commit a67de8820943661edbb4e0a498f64c3c2785e176 Merge: 021c91791a5e c44e182e5374 Author: Olof Johansson Date: Mon Jul 2 10:10:43 2018 -0700 Merge tag 'renesas-arm-soc-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc Renesas ARM Based SoC Arm SoC Updates for v4.19 * Convert to SPDX identifier * Remove legacy SMP fallback code for R-CAR H2 and M2-W - DT enablement has been in since 4.8, no longer needed * APMU cleanups after legacy SMP fallback removal * Drop legacy SYSC fallback code for R-Car H1, H2 and M2-W - DT enablement has been in since 4.7, no longer needed. * tag 'renesas-arm-soc-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: convert to SPDX identifier soc: renesas: rcar-sysc: Drop legacy handling ARM: shmobile: r8a7779: Remove explicit SYSC config and init ARM: shmobile: r8a7779: Use rcar_sysc_power_{down,up}_cpu() soc: renesas: rcar-sysc: Provide helpers to power up/down CPUs ARM: shmobile: r8a7779: Stop powering down secondary CPUs during early boot ARM: shmobile: rcar-gen2: Remove explicit SYSC config and init ARM: shmobile: apmu: Remove platsmp-apmu.h ARM: shmobile: apmu: Remove obsolete shmobile_smp_apmu_prepare_cpus() ARM: shmobile: apmu: Move cpu_leave_lowpower() to SUSPEND section ARM: shmobile: Remove unused shmobile_smp_init_fallback_ops() ARM: shmobile: r8a7791: Use common R-Car Gen2 machine definition ARM: shmobile: r8a7791: Remove legacy SMP fallback code ARM: shmobile: r8a7790: Use common R-Car Gen2 machine definition ARM: shmobile: r8a7790: Remove legacy SMP fallback code Signed-off-by: Olof Johansson commit 2bc0b8e2461f525d447f05df8332d91d8f322081 Merge: 021c91791a5e 6b284a813078 Author: Olof Johansson Date: Mon Jul 2 10:03:16 2018 -0700 Merge tag 'renesas-arm64-dt-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt Renesas ARM64 Based SoC DT Updates for v4.19 * All applicable R-Car Gen 3 SoCs - Correct VSPD registers range - Convert R-Car Gen3 SoC and board DT files to SPDX identifiers * R-Car H3 (r8a7795), M3-W (r8a7796) and M3-N (r8a77965) SoCs - Salvator-X and Salvator-XS boards + Describe HSCIF1 device + Correct I2C ch4 clock to 400kHz - Salvator-X, Salvator-XS and ULCB boards + Add sdhi2_ds pin group to SDHI2 pinctrl groups * R-Car H3 (r8a7795) SoC - Describe CryptoCAL (CCREE) device * R-Car M3-W (r8a7796) SoC - Describe PCIe devices - Describe HSCIF nodes * R-Car M3-N (r8a77965) SoC - Describe PCIe devices - Use CPG MSSR symbols instead of numeric indicies * R-Car D3 (r8a77995) SoC - Describe Thermal device - Describe MSIOF devices - Add power domains to description of IPMMU devices - Do not use deprecated renesas,gpio-rcar compat string - Describe HDMI and CVBS input in DT of R-Car Gen3 D3 Draak board * R-Car V3H (r8a77980) SoC - Describe secondary CA53 CPU cores, and GPIO and interconected FCPVD0, VSPD0, DU, and LVDS0 devices - Enable ethernet on V3HSK board - Specify Ethernet PHY IRQs in the DT of the Condor and V3HSK boards. This is possible now that GPIO support is present. Previously phylib had to resort to polling. - Enable I2C0 on Condor board * R-Car E3 (r8a77990) - Enable Watchdog timer and USB2.0 host on Ebisu board - Enable secondary CA53 CPU core * tag 'renesas-arm64-dt-for-v4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (29 commits) arm64: dts: renesas: r8a77995: Add MSIOF device nodes arm64: dts: renesas: salvator-common: Add HSCIF1 device support arm64: dts: renesas: r8a77980: add FCPVD/VSPD/DU/LVDS support arm64: dts: renesas: condor/v3hsk: specify Ethernet PHY IRQs arm64: dts: renesas: r8a77965: Add PCIe device nodes arm64: dts: renesas: Fix VSPD registers range arm64: dts: renesas: convert to SPDX identifiers arm64: dts: renesas: r8a77980: add GPIO support arm64: dts: renesas: r8a77990: Enable USB2.0 Host for Ebisu board arm64: dts: renesas: r8a7796: Add PCIe device nodes arm64: dts: renesas: r8a77990: Add secondary CA53 CPU core arm64: dts: renesas: r8a77990: ebisu: Enable watchdog timer arm64: dts: renesas: condor: add I2C0 support arm64: dts: renesas: r8a77980: add I2C support arm64: dts: renesas: salvator-x(s): Update I2C ch4 clock to 400kHz arm64: dts: renesas: Add sdhi2_ds pin group to SDHI2 pinctrl groups arm64: dts: renesas: r8a77965: Add all HSCIF nodes arm64: dts: renesas: r8a77965: Use r8a77965-cpg-mssr binding definitions arm64: dts: renesas: r8a7795: add ccree to device tree arm64: dts: renesas: r8a77965: Add Watchdog Timer controller node using RCLK Watchdog Timer ... Signed-off-by: Olof Johansson commit a06e5c0562e9eec70a36d77dc98bdac4a075dcc8 Author: Viresh Kumar Date: Fri May 25 11:10:04 2018 +0530 arm64: dts: mediatek: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Signed-off-by: Viresh Kumar Signed-off-by: Matthias Brugger commit 7e7367d3bc6cf27dd7e007e7897fcebfeff1ee8b Author: Chris Wilson Date: Sat Jun 30 10:05:09 2018 +0100 drm/i915: Try GGTT mmapping whole object as partial If the whole object is already pinned by HW for use as scanout, we will fail to move it to the mappable region and so must resort to using a partial VMA covering the whole object. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104513 Fixes: aa136d9d72c2 ("drm/i915: Convert partial ggtt vma to full ggtt if it spans the entire object") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180630090509.469-1-chris@chris-wilson.co.uk commit 399111aaa7b9b4a2f7f20d38943ab55b6a67653e Author: Hans de Goede Date: Sun Jul 1 14:27:20 2018 +0200 USB: typec: fsusb302: Drop empty set_current_limit implementation The set_current_limit tcpm_dev callback is optional and the tcpm core will already log the passed in values, so there is no need to have an empty implementation of this. Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 25b22e353c1f8d48e69fdef70a31be2f0d2bc410 Author: Gustavo A. R. Silva Date: Thu Jun 28 13:37:22 2018 -0500 USB: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman commit 169d3606dccfa3cfc5aa98b6e01705582074e1eb Author: Gustavo A. R. Silva Date: Thu Jun 28 13:32:33 2018 -0500 USB: musb: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman commit d3ac5598c5010a8999978ebbcca3b1c6188ca36b Author: Julia Lawall Date: Sun Jul 1 19:32:04 2018 +0200 usb: wusbcore: security: cast sizeof to int for comparison Comparing an int to a size, which is unsigned, causes the int to become unsigned, giving the wrong result. usb_get_descriptor can return a negative error code. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ int x; expression e,e1; identifier f; @@ *x = f(...); ... when != x = e1 when != if (x < 0 || ...) { ... return ...; } *x < sizeof(e) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman commit ea632725956d1dd7c4a10aa2449c672bbb22b2cb Author: Ville Syrjälä Date: Tue Jun 26 22:47:16 2018 +0300 drm/vmwgfx: Use drm_plane_mask() & co. Use drm_{plane,connector}_mask() where appropriate. Cc: VMware Graphics Cc: Sinclair Yeh Cc: Thomas Hellstrom Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-10-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit c0183a8eae1820173f410dada7e311295e6a8580 Author: Ville Syrjälä Date: Tue Jun 26 22:47:15 2018 +0300 drm/vc4: Use drm_crtc_mask() Use drm_crtc_mask() where appropriate. Cc: Eric Anholt Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-9-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi Reviewed-by: Eric Anholt commit dbf8f9e40e6f5fc39e2e6c4c8a392fe99189c4d2 Author: Ville Syrjälä Date: Tue Jun 26 22:47:14 2018 +0300 drm/sun4i: Use drm_crtc_mask() Use drm_crtc_mask() where appropriate. Cc: Maxime Ripard Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-8-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi Acked-by: Maxime Ripard commit 2d4569fd8d8ee13a8556ed3dd8b2cd1dc45fd8bd Author: Ville Syrjälä Date: Tue Jun 26 22:47:12 2018 +0300 drm/imx: Use drm_plane_mask() Use drm_plane_mask() where appropriate. Cc: Philipp Zabel Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-6-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi Acked-by: Philipp Zabel commit 40560e26dc45e53ae05cce61804a31367f36a5e6 Author: Ville Syrjälä Date: Tue Jun 26 22:47:11 2018 +0300 drm/i915: Use drm_plane_mask() & co. Use drm_{plane,crtc,encoder,connector}_mask() where appropriate. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-5-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 737057321f3c2d30b98fa8006b7af1869c32a68b Author: Ville Syrjälä Date: Tue Jun 26 22:47:10 2018 +0300 drm: Add drm_connector_mask() Add drm_connector_mask() which returns the 1< Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-4-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 6f3be036da5cf6b192966ebea250cf9c8b1fd4a0 Author: Ville Syrjälä Date: Tue Jun 26 22:47:09 2018 +0300 drm: Add drm_encoder_mask() Add drm_encoder_mask() which returns the 1< Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-3-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 6a52193bd0dd683607793bea0caf6be94b32b333 Author: Ville Syrjälä Date: Tue Jun 26 22:47:08 2018 +0300 drm: Use drm_crtc_mask() Use drm_crtc_mask() where appropriate. Mostly performed with coccinelle: @@ @@ - (1< Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-2-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 62f77ad0969594ee428043523bf28329df191b39 Author: Ville Syrjälä Date: Tue Jun 26 22:47:07 2018 +0300 drm: Add drm_plane_mask() Add drm_plane_mask() which returns the 1< Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-1-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit e35a2f9aee31fb9e85ebbf4820481ce3f5e94db2 Author: Ville Syrjälä Date: Tue Jun 26 23:41:44 2018 +0300 drm/atomic-helper: Use old/new state in drm_atomic_helper_commit_planes_on_crtc() Update drm_atomic_helper_commit_planes_on_crtc() to use explicit old/new states instead of relying on obj->state. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180626204144.14769-1-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit e9576fe8e605c4413beb91b290b8a473985710de Author: Heikki Krogerus Date: Wed Jun 27 18:19:53 2018 +0300 usb: typec: tcpm: Support for Alternate Modes This adds more complete handling of VDMs and registration of partner alternate modes, and introduces callbacks for alternate mode operations. Only DFP role is supported for now. Signed-off-by: Heikki Krogerus Tested-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 49cbb33dfdeb7651b91c2316a61b644d8e6cfe22 Author: Heikki Krogerus Date: Wed Jun 27 18:19:52 2018 +0300 usb: typec: pi3usb30532: Start using generic state values Instead of the tcpm specific mux states, using the generic USB Type-C connector state values, and with DisplayPort using connector states defined for the DisplayPort Alt Mode. Signed-off-by: Heikki Krogerus Tested-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 0e3bb7d6894d9b6e67d6382bb03a46a1dc989588 Author: Heikki Krogerus Date: Wed Jun 27 18:19:51 2018 +0300 usb: typec: Add driver for DisplayPort alternate mode DisplayPort USB Type-C Alt Mode allows DisplayPort displays and adapters to be attached to the USB Type-C ports on the system. Signed-off-by: Heikki Krogerus Tested-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 8a37d87d72f0c69f837229c04d2fcd7117ea57e7 Author: Heikki Krogerus Date: Wed Jun 27 18:19:50 2018 +0300 usb: typec: Bus type for alternate modes Introducing a simple bus for the alternate modes. Bus allows binding drivers to the discovered alternate modes the partners support. Signed-off-by: Heikki Krogerus Tested-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 4ab8c18d4d67321cc7b660559de17511d4fc0237 Author: Heikki Krogerus Date: Wed Jun 27 18:19:49 2018 +0300 usb: typec: Register a device for every mode Before a device was created for every discovered SVID, but this will create a device for every discovered mode of every SVID. The idea is to make it easier to create mode specific drivers once a bus for the alternate mode is added. Signed-off-by: Heikki Krogerus Tested-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 93dd2112c7b2fa5512cc4aff2c449420487fcb68 Author: Heikki Krogerus Date: Wed Jun 27 18:19:48 2018 +0300 usb: typec: mux: Get the mux identifier from function parameter In order for the muxes to be usable with alternate modes, the alternate mode devices will need also to be able to get a handle to the muxes on top of the port devices. To make that possible, the muxes need to be possible to request with an identifier. This will change the API so that the mux identifier is given as a function parameter to typec_mux_get(), and the hard-coded "typec-mux" is replaced with that value. Signed-off-by: Heikki Krogerus Tested-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 025d0e7f73c6a9cc3ca2fe7de821792a8f3269bf Author: Andreas Gruenbacher Date: Mon Mar 19 23:10:52 2018 +0000 gfs2: Remove gfs2_write_{begin,end} Now that generic_file_write_iter is no longer used, there are no remaining users of these address space operations. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit 967bcc91b044936e85dbb5848952dc1335a846f4 Author: Andreas Gruenbacher Date: Tue Jun 19 15:08:02 2018 +0100 gfs2: iomap direct I/O support The page unmapping previously done in gfs2_direct_IO is now done generically in iomap_dio_rw. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit bcfe94139a45fae128844558d6e27a0258860a90 Author: Andreas Gruenbacher Date: Fri May 11 17:44:19 2018 +0100 gfs2: gfs2_extent_length cleanup Now that gfs2_extent_length is no longer used for determining the size of a hole and always with an upper size limit, the function can be simplified. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit 64bc06bb32ee9cf458f432097113c8b495d75757 Author: Andreas Gruenbacher Date: Sun Jun 24 15:04:04 2018 +0100 gfs2: iomap buffered write support With the traditional page-based writes, blocks are allocated separately for each page written to. With iomap writes, we can allocate a lot more blocks at once, with a fraction of the allocation overhead for each page. Split calculating the number of blocks that can be allocated at a given position (gfs2_alloc_size) off from gfs2_iomap_alloc: that size determines the number of blocks to allocate and reserve in the journal. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit d505a96a3b16f46455035dc0296bc2da6014e163 Author: Andreas Gruenbacher Date: Sun Jun 24 10:43:49 2018 +0100 gfs2: Further iomap cleanups In gfs2_iomap_alloc, set the type of newly allocated extents to IOMAP_MAPPED so that iomap_to_bh will set the bh states correctly: otherwise, the bhs would not be marked as mapped, confusing __mpage_writepage. This means that we need to check for the IOMAP_F_NEW flag in fallocate_chunk now. Further clean up gfs2_iomap_get and implement gfs2_stuffed_iomap here directly. For reads beyond the end of the file, return holes instead of failing with -ENOENT so that we can get rid of that special case in gfs2_block_map. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson commit e67005e59a74613c2d5879f63eef70e6267bb452 Author: Jani Nikula Date: Fri Jun 29 13:20:39 2018 +0300 drm/i915: abstract and document register picking macros Try to describe what the pick variants do, and which to prefer. No functional changes. Reviewed-by: Rodrigo Vivi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180629102039.2435-1-jani.nikula@intel.com commit f0eea2772a6baf06961c6b0812bcb3adcce307a9 Author: Daniel Mack Date: Fri Jun 29 14:37:45 2018 +0200 wcn36xx: drop unnecessary initialization of variables Initialization is unneccessary when the variable is written before it is read. There were some occasions in which the driver would initialize `ret' during declaration without need. Purely a cosmetic change with no functional impact. Signed-off-by: Daniel Mack Signed-off-by: Kalle Valo commit 9a53d0b6f8c61b27e7071d75fb82cf707968f75a Author: Maya Erez Date: Fri Jun 29 16:28:48 2018 +0300 wil6210: remove crash dump collection from OTP section In some cases where the device is stuck, reading from OTP can timeout. As OTP section is known there is no need to read it during device crash dump collection. Adding a new field to struct fw_map to indicate if to include this section in crash dump collection. Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit f1dbb6c1e83394e68b082b3058aabb12ab046f25 Author: Maya Erez Date: Fri Jun 29 16:28:42 2018 +0300 wil6210: add support for Talyn-MB boot flow Talyn-MB introduces various of FW download options: FW download via PCIe, SPI or PBL for secured access. The boot and FW download path is determined based on the OTP HW register. Driver reads this register as part of the SW reset flow and performs the appropriate initialization sequence. Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit d98b853934fee79b3cde2c850e03b9c367297a78 Author: Maya Erez Date: Fri Jun 29 16:28:37 2018 +0300 wil6210: add support for enhanced DMA debugfs Add debugfs support for enhanced DMA TX and RX descriptor rings, TX and RX status rings and RX buffer management. Run the following command to print the TX and RX status rings: cat srings Run the following command in order to select the status ring: echo STATUS_RING_IDX > dbg_sring_index Run the following command in order to select the status message: echo STATUS_MSG_IDX > dbg_status_msg_index Run the following command in order to print the selected status message from the selected status ring: cat status_msg Run the following command in order to print the RX buffer management debug information: cat rx_buff_mgmt Signed-off-by: Gidon Studinski Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 7be13fc3e60fb51570288d4516a15266ed500dfd Author: Gidon Studinski Date: Fri Jun 29 16:28:33 2018 +0300 wil6210: add support for enhanced DMA RX data flows Enhanced DMA RX data path is handled using a single RX descriptor ring for all VIFs. Multiple RX status rings are supported, to allow RSS and multi MSI support. The driver gets the RX completions via the RX status rings. The RX status message includes the completed RX buffer ID, which points to the allocated SKB. The enhanced DMA RX data flow supports RX chaining, where multiple SKBs are merged into a single packet. Enhanced DMA HW supports RX HW reorder offload, enabled by default for Talyn-MB. amsdu_en debugfs entry was added to allow control MSDU aggregation. Use the following command to disable AMSDU (enabled by default): echo 0 > amsdu_en Signed-off-by: Gidon Studinski Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 9202d7b6748098d508a3d0a7fcc221a4bcf1ecd9 Author: Maya Erez Date: Fri Jun 29 16:28:28 2018 +0300 wil6210: add support for enhanced DMA TX data flows The enhanced DMA TX data path is handled using a descriptor ring per connection and a single status ring. The driver gets TX completions via the TX status ring. Each status message points to the completed descriptor ring and includes the number of completed descriptors in this ring. Non TSO enhanced DMA TX descriptors are similar to legacy DMA TX descriptors, hence the same transmit function can be used. However, enhanced DMA TSO frames division is performed by the HW, hence a new function is added to handle enhanced DMA TSO. Signed-off-by: Gidon Studinski Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 96c93589e2dfd43ad16b92e6677ceaf279ae5062 Author: Gidon Studinski Date: Fri Jun 29 16:28:23 2018 +0300 wil6210: initialize TX and RX enhanced DMA rings Enhanced DMA design includes the following rings: - Single RX descriptor ring is used for all VIFs - Multiple RX status rings are supported, to allow RSS - TX descriptor ring is allocated per connection - A single TX status ring is used for all TX descriptor rings This patch initializes and frees the above descriptor and status rings. The RX SKBs are handled by a new entity of RX buffers manager, which handles RX buffers, each one points to an allocated SKB. During Rx completion processing, the driver extracts a buffer ID which is used as an index to the buffers array. After the SKB is freed the buffer is moved from the 'active' list to the 'free' list, indicating it can be used for another descriptor. During Rx refill, SKBs are allocated and attached to 'free' buffers. Those buffers are attached to new descriptors and moved to the 'active' list. New debugfs entries were added to allow edma configuration: Run the following command to configure the number of status rings: echo NUM_OF_STATUS_RINGS > num_rx_status_rings Run the following command to use extended RX status message for additional debug fields from HW: echo 0 > compressed_rx_status Run the following command to control the size of the TX status ring: echo TX_STATUS_RING_ORDER > tx_status_ring_order The status ring size will be 1 << tx_status_ring_order Run the following command to control the size of the RX status ring: echo RX_STATUS_RING_ORDER > rx_status_ring_order Due to HW constrains RX sring order should be bigger than RX ring order The status ring size will be 1 << rx_status_ring_order Run the following command to change the number of RX buffer IDs: echo RX_BUFF_ID_COUNT > rx_buff_id_count Signed-off-by: Gidon Studinski Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 10590c6a07b6a84cc3224cfda481317deaf31565 Author: Gidon Studinski Date: Fri Jun 29 16:28:18 2018 +0300 wil6210: add support for enhanced DMA structures In enhanced DMA the vrings are handled internally by the FW and are not exposed to the driver. Instead, the driver handles descriptor rings, which are mapped by the FW to vrings. The completions of the TX and RX descriptors are notified to the driver using status rings. Each status ring descriptor includes information of the completed descriptors and the ring id of their descriptor ring. This patch changes struct vring to generic wil_ring to allow its reuse for enhanced DMA descriptor rings and adds the descriptor and status rings specific descriptors. The vring debugfs entries have changed as follows: - dbg_vring_index has changed to dbg_ring_index - vrings has changed to rings - vring_idle_trsh has changed to ring_idle_trsh - vring_index has changed to ring_index Signed-off-by: Gidon Studinski Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 485790d070532e68a78d8beb4a139f276b35cbbd Author: Maya Erez Date: Fri Jun 29 16:28:14 2018 +0300 wil6210: add support for Talyn-MB (Talyn ver 2.0) device Add changes to support initialization of Talyn-MB wil6210 device: - Add definition for Talyn-MB new JTAG id - Define talyn_mb_fw_mapping array - Add Talyn-MB reset sequence Signed-off-by: Maya Erez Signed-off-by: Kalle Valo commit 8530b4e7b22bc3bd8240579f3844c73947cd5f71 Author: Alagu Sankar Date: Fri Jun 29 16:28:00 2018 +0300 ath10k: sdio: set skb len for all rx packets Without this, packets larger than 1500 will silently be dropped. Easily reproduced by sending a ping packet with a size larger than 1500. Co-Developed-by: Niklas Cassel Signed-off-by: Alagu Sankar Signed-off-by: Niklas Cassel Signed-off-by: Kalle Valo commit d1d061b1395a6eff8fd625f59ba97620f9488620 Author: Alagu Sankar Date: Fri Jun 29 16:27:58 2018 +0300 ath10k: sdio: allocate correct size for RECV_1MORE_BLOCK rx packets Without this, when receiving a packet that has this flag set from firmware, we will read invalid trailer data from the packet, which will be shown as various errors, e.g. "sdio mbox lookahead is zero" or "invalid rx packet" or "payload length x exceeds max htc length". Co-Developed-by: Niklas Cassel Signed-off-by: Alagu Sankar Signed-off-by: Niklas Cassel Signed-off-by: Kalle Valo commit 679e1f07c86221b7183dd69df7068fd42d0041f6 Author: Alagu Sankar Date: Fri Jun 29 16:27:56 2018 +0300 ath10k: sdio: use same endpoint id for all packets in a bundle All packets in a bundle should use the same endpoint id as the first lookahead. This matches how things are done is ath6kl, however, this patch can theoretically handle several bundles in ath10k_sdio_mbox_rx_process_packets(). Without this patch we get lots of errors about invalid endpoint id: ath10k_sdio mmc2:0001:1: invalid endpoint in look-ahead: 224 ath10k_sdio mmc2:0001:1: failed to get pending recv messages: -12 ath10k_sdio mmc2:0001:1: failed to process pending SDIO interrupts: -12 Co-Developed-by: Niklas Cassel Signed-off-by: Alagu Sankar Signed-off-by: Niklas Cassel Signed-off-by: Kalle Valo commit 2b6c83cad13d12b3561e7ae9e7505b3c831c6fce Merge: 72b38caf7b75 a7ca13826e47 Author: Linus Walleij Date: Mon Jul 2 16:10:25 2018 +0200 Merge branch 'ib-aspeed' into devel commit a7ca13826e478f9b201eb2f9f20de0b978a82ad9 Author: Benjamin Herrenschmidt Date: Fri Jun 29 14:11:19 2018 +1000 gpio: aspeed: Add interfaces for co-processor to grab GPIOs On the Aspeed chip, the GPIOs can be under control of the ARM chip or of the ColdFire coprocessor. (There's a third command source, the LPC bus, which we don't use or support yet). The control of which master is allowed to modify a given GPIO is per-bank (8 GPIOs). Unfortunately, systems already exist for which we want to use GPIOs of both sources in the same bank. This provides an API exported by the gpio-aspeed driver that an aspeed coprocessor driver can use to "grab" some GPIOs for use by the coprocessor, and allow the coprocessor driver to provide callbacks for arbitrating access. Once at least one GPIO of a given bank has been "grabbed" by the coprocessor, the entire bank is marked as being under coprocessor control. It's command source is switched to the coprocessor. If the ARM then tries to write to a GPIO in such a marked bank, the provided callbacks are used to request access from the coprocessor driver, which is responsible to doing whatever is necessary to "pause" the coprocessor or prevent it from trying to use the GPIOs while the ARM is doing its accesses. During that time, the command source for the bank is temporarily switched back to the ARM. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley Reviewed-by: Andrew Jeffery Signed-off-by: Linus Walleij commit 0f1e03c2b5a395e3eb38899a41c7e74afbc16ba0 Author: Benjamin Herrenschmidt Date: Fri Jun 29 14:11:18 2018 +1000 gpio: aspeed: Add command source registers This adds the definitions for the command source registers and a helper to set them. Those registers allow to control which bus master on the SoC is allowed to modify a given bank of GPIOs and will be used by subsequent patches. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley Reviewed-by: Andrew Jeffery Signed-off-by: Linus Walleij commit c67dda88cc5da58c5a63083e0405fe93e2476bb7 Author: Benjamin Herrenschmidt Date: Fri Jun 29 14:11:17 2018 +1000 gpio: aspeed: Add "Read Data" register to read the write latch The Aspeed GPIO hardware has a quirk: the value register, for an output GPIO, doesn't contain the last value written (the write latch content) but the sampled input value. This means that when reading back shortly after writing, you can get an incorrect value as the input value is delayed by a few synchronizers. The HW supports a separate read-only register "Data Read Register" which allows you to read the write latch instead. This adds the definition for it, and uses it for the initial population of the GPIO value cache. It will be used more in subsequent patches. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley Reviewed-by: Andrew Jeffery Signed-off-by: Linus Walleij commit 44ddf559d5792b2bffcd44febf9b7b55b03e06b4 Author: Benjamin Herrenschmidt Date: Fri Jun 29 14:11:16 2018 +1000 gpio: aspeed: Rework register type accessors Use a single accessor function for all register types instead of several spread around. This will make it easier/cleaner to introduce new registers and keep the mechanism in one place. The big switch/case is optimized at compile time since the switch value is a constant. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley Reviewed-by: Andrew Jeffery Signed-off-by: Linus Walleij commit 23ee0f192033ac6742fc179699d91336a000aef5 Author: Colin Ian King Date: Mon Jul 2 13:47:08 2018 +0100 pinctrl: actions: fix unsigned less than zero comparison The check to see if platform_get_irq failed is performed on the unsigned value of pctrl->irq[i] and the check is never true because an unsigned cannot be less than zero. Fix this by assinging the signed int ret to the return of platform_get_irq and checking ret instead. Detected by CoverityScan, CID#1470247 ("Unsigned comparison against 0") Fixes: 6c5d0736e9c0 ("pinctrl: actions: Add interrupt support for OWL S900 SoC") Signed-off-by: Colin Ian King Acked-by: Manivannan Sadhasivam Signed-off-by: Linus Walleij commit 72b38caf7b7568ebc167fdd4ec5fa1daa113d08b Author: Baruch Siach Date: Thu Jun 21 16:38:46 2018 +0300 gpio: pca953x: suppress interrupts warning when not applicable Don't warn about missing interrupts support when the parent interrupt is not defined. Enabling interrupts support would not make it work anyway. Signed-off-by: Baruch Siach Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 122d00f778b370124ec38bb59b2ac7622d0c6943 Author: Linus Walleij Date: Thu Jun 28 08:35:46 2018 +0200 gpio: syscon: Include the right header This is a GPIO driver, include only . Signed-off-by: Linus Walleij commit 97a48fcd628e5bf2a34dd23c08f646253c8767ec Author: Linus Walleij Date: Wed Jun 27 11:37:23 2018 +0200 gpio: stp-xway: Include the right header This is a GPIO driver, include only . Signed-off-by: Linus Walleij commit ecac6e602ccd8ace3b5ec01ed8f8bf0350e30b92 Author: Linus Walleij Date: Wed Jun 27 11:30:48 2018 +0200 gpio: stmpe: Include the right header This is a GPIO driver, include only . Signed-off-by: Linus Walleij commit aadf77c88d2f8f1ffcf75c1e985da1a5cb66c36a Author: Linus Walleij Date: Wed Jun 27 11:27:34 2018 +0200 gpio: sta2x11: Inline regs macro I don't like the __namespace and this is simple enough to just inline at all sites. Cc: Bartosz Golaszewski Acked-by: Alessandro Rubini Signed-off-by: Linus Walleij commit 24dcfd8437b257a187a1295eb62f3f49c72b025f Author: Linus Walleij Date: Wed Jun 27 11:13:03 2018 +0200 gpio: sta2x11: Use BIT() macro This removes the custom implementation of the BIT() macro and inlines all calls to the helper. Cc: Bartosz Golaszewski Acked-by: Alessandro Rubini Signed-off-by: Linus Walleij commit 25fc1778b9ed29e75ef8b30c7827e61b444b8bce Author: Linus Walleij Date: Wed Jun 27 11:09:55 2018 +0200 gpio: sta2x11: Include the right header This is a GPIO driver, include only . Cc: Bartosz Golaszewski Acked-by: Alessandro Rubini Signed-off-by: Linus Walleij commit 9fc18cc54add2e535c0e265a967f5e9075e22f73 Author: Linus Walleij Date: Wed Jun 27 11:07:02 2018 +0200 gpio: spear-spics: Include the right header This is a GPIO driver, include only . Signed-off-by: Linus Walleij commit eb452a84ece6b84e22c53abdd49ff018d189ae8a Author: Linus Walleij Date: Wed Jun 27 11:03:22 2018 +0200 gpio: sch311x: Replace unsigned char with u8 This purely syntactic change switches unsigned char to u8 in the driver. Cc: Bruno Randolf Signed-off-by: Linus Walleij commit 4455a82a400ba462db8abb642c670555d505bccc Author: Linus Walleij Date: Wed Jun 27 11:00:44 2018 +0200 gpio: sch311x: Implement open drain support The chip has a bit for controlling open drain, and it is easy to implement the callback to support open drain when needed, so let's implement it. Cc: Bruno Randolf Signed-off-by: Linus Walleij commit 4a2398d7211f8f750b717ce4a2b0d117385f2a4a Author: Linus Walleij Date: Wed Jun 27 10:52:07 2018 +0200 gpio: sch311x: Use RMW to change direction Bit 0 in the config register obviously controls the direction of the GPIO so instead of hammering 0x0/0x1 into that register, use read-modify-write so that we can also alter the other bits in the register. Cc: Bruno Randolf Signed-off-by: Linus Walleij commit f9e03b0ef10ce5040714783a09cf12df26bcb3d7 Author: Linus Walleij Date: Wed Jun 27 10:47:28 2018 +0200 gpio: sch311x: Implement .get_direction() It's pretty simple to implement the .get_direction() for this chip, so let's just do it. Cc: Bruno Randolf Signed-off-by: Linus Walleij commit 30467c19e456ac3503164248131ec0ea57852abf Author: Linus Walleij Date: Wed Jun 27 10:42:01 2018 +0200 gpio: sch311x: Include the right header This is a GPIO driver, include only . Cc: Bruno Randolf Signed-off-by: Linus Walleij commit d8e764c2cc451452f07e4f35a3e83df9decf7f99 Author: Linus Walleij Date: Wed Jun 27 10:39:31 2018 +0200 gpio: sch: Implement .get_direction() It's pretty simple to implement the .get_direction() for this chip, so let's just do it. Cc: Denis Turischev Cc: Daniel Krueger Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit 4c1abc84f482706f033113665faa062852bd97da Author: Linus Walleij Date: Wed Jun 27 09:49:25 2018 +0200 gpio: sch: Include the right header This is a GPIO driver, include only . Cc: Denis Turischev Cc: Daniel Krueger Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit 827fb6af6664b614d70330f1ee96d0fb02da3504 Author: Linus Walleij Date: Wed Jun 27 09:48:03 2018 +0200 gpio: sa1100: Include the right header This is a GPIO driver, include only . Signed-off-by: Linus Walleij commit 05467e54998be15a35c20e0605315fec309b6a5b Author: Linus Walleij Date: Wed Jun 27 09:46:15 2018 +0200 gpio: rdc321x: Include the right header This is a GPIO driver, include only . Signed-off-by: Linus Walleij commit 4b1d8007987a85b9f4264905fdd6d76a3cc0b001 Author: Linus Walleij Date: Thu May 31 08:08:13 2018 +0200 gpio: rcar: Include the right header This is a GPIO driver, include only . Signed-off-by: Linus Walleij commit 98aef8e777544ccf015fd588ecd69d780d672bc8 Author: Linus Walleij Date: Thu May 31 08:06:23 2018 +0200 gpio: rc5t583: Include the right header This is a GPIO driver, include only . Signed-off-by: Linus Walleij commit 5b9b2b5284f81941972105b13337c58489ea8fca Author: Mathias Kresin Date: Thu Jun 28 21:57:40 2018 +0200 gpio: stp-xway: Implement get callback Add an implementation to get the current GPIO state. The callback is used by the leds-gpio driver for example, in case the current LED/GPIO state should be kept during driver load. Signed-off-by: Mathias Kresin Signed-off-by: Linus Walleij commit bac5c3b829c3f2944d258dad1adec444b9deb338 Author: Mikko Perttunen Date: Wed Jun 20 15:54:03 2018 +0300 gpio: tegra186: Add support for Tegra194 Add support for the Tegra194 GPIO bank configuration. Signed-off-by: Mikko Perttunen Acked-by: Thierry Reding Signed-off-by: Linus Walleij commit 25b7256500a1738141d74da4afcd3c380141f71c Author: Mikko Perttunen Date: Wed Jun 20 15:54:02 2018 +0300 dt-bindings: tegra186-gpio: Add information for Tegra194 The Tegra194 GPIO controller is similar to the one in Tegra186. Add relevant information to the device tree binding documentation. Signed-off-by: Mikko Perttunen Reviewed-by: Rob Herring Acked-by: Thierry Reding Signed-off-by: Linus Walleij commit d497ebf5fb3a026c0817f8c96cde578787f24093 Author: Frederic Barrat Date: Mon Jun 18 14:14:36 2018 +0200 ocxl: Fix page fault handler in case of fault on dying process If a process exits without doing proper cleanup, there's a window where an opencapi device can try to access the memory of the dying process and may trigger a page fault. That's an expected scenario and the ocxl driver holds a reference on the mm_struct of the process until the opencapi device is notified of the process exiting. However, if mm_users is already at 0, i.e. the address space of the process has already been destroyed, the driver shouldn't try resolving the page fault, as it will fail, but it can also try accessing already freed data. It is fixed by only calling the bottom half of the page fault handler if mm_users is greater than 0 and get a reference on mm_users instead of mm_count. Otherwise, we can safely return a translation fault to the device, as its associated memory context is being removed. The opencapi device will be properly cleaned up shortly after when closing the file descriptors. Fixes: 5ef3166e8a32 ("ocxl: Driver code for 'generic' opencapi devices") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Frederic Barrat Reviewed-By: Alastair D'Silva Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 24bf6864e8b3f9e07b461fe30e0e365b5bb8cdf8 Author: Breno Leitao Date: Tue Jun 26 10:20:13 2018 -0300 selftests/powerpc: Fix typos Fix two typos in the file header. Replacing the word 'priviledged' by 'privileged' and 'exuecuted' by 'executed'. Signed-off-by: Breno Leitao Signed-off-by: Gustavo Romero Signed-off-by: Michael Ellerman commit 09a61e894ac852fb063ee0b54fc513b13abcab08 Author: Breno Leitao Date: Tue Jun 26 10:20:12 2018 -0300 selftests/powerpc: Fix strncpy usage There is a buffer overflow in dscr_inherit_test.c test. In main(), strncpy()'s third argument is the length of the source, not the size of the destination buffer, which makes strncpy() behaves like strcpy(), causing a buffer overflow if argv[0] is bigger than LEN_MAX (100). This patch maps 'prog' to the argv[0] memory region, removing the static allocation and the LEN_MAX size restriction. Signed-off-by: Breno Leitao Signed-off-by: Michael Ellerman commit 29aa59efc6bf91cfa5bfba8375fd730150a19d3f Author: Mikko Perttunen Date: Mon Jul 2 15:11:30 2018 +0300 dt-bindings: arm: Add compatible string for NVIDIA Carmel Add compatibility string for the Carmel CPU in Tegra194. Signed-off-by: Mikko Perttunen Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 7780a03495e13cd2bef704bcbf8c727de9f65232 Author: Mikko Perttunen Date: Mon Jul 2 15:11:31 2018 +0300 arm64: tegra: Add CPU nodes to Tegra194 device tree Add CPU and PSCI nodes to device tree. The Tegra194 SoC contains eight NVIDIA Carmel CPUs. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit f89b58ce71a949ca3592728b586d2077b6cc7ecc Author: Mikko Perttunen Date: Wed Jun 20 15:54:06 2018 +0300 arm64: tegra: Add ethernet controller on Tegra194 The Tegra194 contains the same ethernet controller as the Tegra186. Add the device tree node for it, and correspondingly the PHY node on the board device tree. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit ef633bfc21e9b358a9bd677f628b4438d3de7879 Author: Mikko Perttunen Date: Wed Jun 20 15:54:05 2018 +0300 arm64: tegra: Enable card detect for SD card on P2888 Now that we have a GPIO controller, enable the card detect GPIO for the SD card slot. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit f69ce393ec48a759e5df4ea6660fb7662f24197c Author: Mikko Perttunen Date: Wed Jun 20 15:54:04 2018 +0300 arm64: tegra: Add GPIO controller on Tegra194 Add the device tree node for the GPIO controller on Tegra194. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit f3988ca4c74e136e49487b51231d324d0c923495 Author: Frederic Barrat Date: Thu Jun 28 12:05:09 2018 +0200 cxl: Remove abandonned capi support for the Mellanox CX4, final cleanup Remove a few XSL/CX4 oddities which are no longer needed. A simple revert of the initial commits was not possible (or not worth it) due to the history of the code. Signed-off-by: Frederic Barrat Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit f18a4e1d973bc69a50419eb8918f458ea89c6c3f Author: Frederic Barrat Date: Thu Jun 28 12:05:08 2018 +0200 Revert "cxl: Allow a default context to be associated with an external pci_dev" Remove abandonned capi support for the Mellanox CX4. This reverts commit a19bd79e31769626d288cc016e21a31b6f47bf6f. Signed-off-by: Frederic Barrat Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 322dc4af6c95cddc4f9d806197fe6b376cfae350 Author: Frederic Barrat Date: Thu Jun 28 12:05:07 2018 +0200 Revert "cxl: Add cxl_slot_is_supported API" Remove abandonned capi support for the Mellanox CX4. This reverts commit 4e56f858bdde5cbfb70f61baddfaa56a8ed851bf. Signed-off-by: Frederic Barrat Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 8bf6b91a5125ad9972281666430691d6a282d794 Author: Alastair D'Silva Date: Thu Jun 28 12:05:06 2018 +0200 Revert "powerpc/powernv: Add support for the cxl kernel api on the real phb" Remove abandonned capi support for the Mellanox CX4. This reverts commit 4361b03430d685610e5feea3ec7846e8b9ae795f. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit c8d43cf08ab8c0b8829e67f7711bc72a3be6503f Author: Alastair D'Silva Date: Thu Jun 28 12:05:05 2018 +0200 Revert "cxl: Add support for using the kernel API with a real PHB" Remove abandonned capi support for the Mellanox CX4. This reverts commit 317f5ef1b363417b6f1e93b90dfd2ffd6be6e867. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 29fea8aa21a69418386e3e08fa546a0ba9bee96d Author: Alastair D'Silva Date: Thu Jun 28 12:05:04 2018 +0200 Revert "cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards" Remove abandonned capi support for the Mellanox CX4. This reverts commit b0b5e5918ad1babfd1d43d98c7281926a7b57b9f. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 82c6ae67fbbef68c80c2a39d559dd649d7530cd6 Author: Alastair D'Silva Date: Thu Jun 28 12:05:03 2018 +0200 Revert "cxl: Add kernel APIs to get & set the max irqs per context" Remove abandonned capi support for the Mellanox CX4. This reverts commit 79384e4b71240abf50c375eea56060b0d79c242a. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 17d29039388807305ab02a4d6eae7cbe09f81f90 Author: Alastair D'Silva Date: Thu Jun 28 12:05:02 2018 +0200 Revert "cxl: Add preliminary workaround for CX4 interrupt limitation" Remove abandonned capi support for the Mellanox CX4. This reverts commit cbce0917e2e47d4bf5aa3b5fd6b1247f33e1a126. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 0cfd7335d1ebea42cf113fd22452f6a10d3960fe Author: Alastair D'Silva Date: Thu Jun 28 12:05:01 2018 +0200 Revert "cxl: Add support for interrupts on the Mellanox CX4" Remove abandonned capi support for the Mellanox CX4. This reverts commit a2f67d5ee8d950caaa7a6144cf0bfb256500b73e. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit c5828150067c47a97f30e690a472e0548d3ac97d Author: Alastair D'Silva Date: Thu Jun 28 12:05:00 2018 +0200 Revert "cxl: Add kernel API to allow a context to operate with relocate disabled" Remove abandonned capi support for the Mellanox CX4. The symbol 'cxl_set_translation_mode' is never called, so ctx->real_mode is always false. This reverts commit 7a0d85d313c2066712e530e668bc02bb741a685c. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 7dea6f2f053599d90f7894216db0dd0bedeb3a1c Author: Michael Neuling Date: Fri Jun 29 10:12:09 2018 +1000 powerpc/powernv/memtrace: Remove memtrace mmap() debugfs doesn't support mmap(), so this code is never used. Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman commit d3d4ffaae439981e1e441ebb125aa3588627c5d8 Author: Alexey Kardashevskiy Date: Fri Jun 1 18:06:16 2018 +1000 powerpc/powernv/ioda2: Reduce upper limit for DMA window size We use PHB in mode1 which uses bit 59 to select a correct DMA window. However there is mode2 which uses bits 59:55 and allows up to 32 DMA windows per a PE. Even though documentation does not clearly specify that, it seems that the actual hardware does not support bits 59:55 even in mode1, in other words we can create a window as big as 1<<58 but DMA simply won't work. This reduces the upper limit from 59 to 55 bits to let the userspace know about the hardware limits. Fixes: 7aafac11e3 "powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested" Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit aad15ccc4c043280624ebd345d311dc7b6398bba Author: Michael Neuling Date: Mon Jun 25 11:34:56 2018 +1000 powerpc: Document issues with TM on POWER9 Signed-off-by: Michael Neuling Acked-by: Stewart Smith Signed-off-by: Michael Ellerman commit c6bef2e9e50ca27987aae90147511bd320a2264e Author: Michael Neuling Date: Mon Jun 25 11:34:55 2018 +1000 powerpc: Document issues with the DAWR on POWER9 Signed-off-by: Michael Neuling Acked-by: Stewart Smith Signed-off-by: Michael Ellerman commit 3bfb450ee7b52d41ce2117738ee9c155f3c75237 Author: Breno Leitao Date: Mon Jun 18 19:15:02 2018 -0300 powerpc/pci: Remove legacy debug code Commit 59f47eff03a0 ("powerpc/pci: Use of_irq_parse_and_map_pci() helper") removed the 'oirq' variable, but kept memsetting it when the DEBUG macro is defined. When setting DEBUG macro for debugging purpose, the kernel fails to build since 'oirq' is not defined anymore. This patch simply remove the debug block, since it does not seem to sense now. Fixes: 59f47eff03a08c ("powerpc/pci: Use of_irq_parse_and_map_pci() helper") Signed-off-by: Breno Leitao Signed-off-by: Michael Ellerman commit 8449a4cb69ab6fbb873d653a82787a2ae6f352aa Author: Breno Leitao Date: Tue Nov 28 17:29:34 2017 -0200 scripts: Add ppc64le support for checkstack.pl 64-bit ELF v2 ABI specification for POWER describes, on section "General Stack Frame Requirements", that the stack should use the following instructions when compiled with backchain: mflr r0 std r0, 16(r1) stdu r1, -XX(r1) Where XX is the frame size for that function, and this is the value checkstack.pl will find the stack size for each function. This patch also simplifies the entire Powerpc section, since just two type of instructions are used, 'stdu' for 64 bits and 'stwu' for 32 bits platform. Signed-off-by: Breno Leitao Signed-off-by: Michael Ellerman commit 8272f598523d0975259080d2f9d760b9ce625e18 Author: Jonathan Neuschäfer Date: Sun Jun 17 14:49:06 2018 +0200 powerpc: wii: Remove outdated comment about memory fixups The workaround has been removed. What stays is just code to find the memory hole so the BATs can be configured properly in the function below. Fixes: 57deb8fea01f ("powerpc/wii: Don't rely on the reserved memory hack") Signed-off-by: Jonathan Neuschäfer Signed-off-by: Michael Ellerman commit f6bd74fa084eb9ad573ffbb236a095454163f66d Author: Arnd Bergmann Date: Mon Jun 18 11:56:24 2018 +0200 powerpc: xmon: use ktime_get_coarse_boottime64 get_monotonic_boottime() is deprecated, and may not be safe to call in every context, as it has to read a hardware clocksource. This changes xmon to print the time using ktime_get_coarse_boottime64() instead, which avoids the old timespec type and the HW access. Signed-off-by: Arnd Bergmann Acked-by: Balbir Singh Signed-off-by: Michael Ellerman commit ee8c446fed99ffdc29dedf7d2a8854f1ea9a1022 Author: Mauro S. M. Rodrigues Date: Thu Mar 22 23:10:52 2018 -0300 powerpc/eeh: Avoid misleading message "EEH: no capable adapters found" Due to recent refactoring in EEH in: commit b9fde58db7e5 ("powerpc/powernv: Rework EEH initialization on powernv") a misleading message was seen in the kernel message buffer: [ 0.108431] EEH: PowerNV platform initialized [ 0.589979] EEH: No capable adapters found This happened due to the removal of the initialization delay for powernv platform. Even though the EEH infrastructure for the devices is eventually initialized and still works just fine the eeh device probe step is postponed in order to assure the PEs are created. Later pnv_eeh_post_init does the probe devices job but at that point the message was already shown right after eeh_init flow. This patch introduces a new flag EEH_POSTPONED_PROBE to represent that temporary state and avoid the message mentioned above and showing the follow one instead: [ 0.107724] EEH: PowerNV platform initialized [ 4.844825] EEH: PCI Enhanced I/O Error Handling Enabled Signed-off-by: Mauro S. M. Rodrigues Acked-by: Russell Currey Tested-by:Venkat Rao B Signed-off-by: Michael Ellerman commit a545cf032d11437ed86e62f00d499108d91cae54 Author: Souptick Joarder Date: Tue Jun 12 01:59:04 2018 +0530 ocxl: Change return type for fault handler Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") There is an existing bug when vm_insert_pfn() can return ENOMEM which was ignored and VM_FAULT_NOPAGE returned as default. The new inline vmf_insert_pfn() has removed this inefficiency by returning correct vm_fault_ type. Signed-off-by: Souptick Joarder Acked-by: Andrew Donnellan Acked-by: Frederic Barrat Signed-off-by: Michael Ellerman commit 1259d239799bf9c898091d92adc4317f2c3d74ad Author: John Ogness Date: Sun Jul 1 17:28:08 2018 +0200 ALSA: usb-midi: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Acked-by: Clemens Ladisch Signed-off-by: Takashi Iwai commit 875a92b3f58a117842c0f9e8d65355c6be218fa2 Author: Andy Shevchenko Date: Fri Jun 29 15:36:34 2018 +0300 pinctrl: intel: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit 9b11233d8e2ca80afc6e16200b680c5daf051333 Author: John Ogness Date: Sun Jul 1 17:28:07 2018 +0200 ALSA: usb: caiaq: audio: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Acked-by: Daniel Mack Signed-off-by: Takashi Iwai commit f6779e4e53b6177c319f05b61a5c447137d0ab70 Merge: 50d4feb5e60e e4e87715aa85 Author: David S. Miller Date: Mon Jul 2 22:49:14 2018 +0900 Merge branch 'hns3-a-few-code-improvements' Peng Li says: ==================== net: hns3: a few code improvements This patchset removes some redundant code and fixes a few code stylistic issues from internal concentrated review, no functional changes introduced. --- Change log: V1 -> V2: 1, remove a patch according to the comment reported by David Miller. --- ==================== Signed-off-by: David S. Miller commit e4e87715aa850ab312fd3a3f3452d7390d46ba02 Author: Peng Li Date: Mon Jul 2 15:50:26 2018 +0800 net: hns3: modify hnae_ to hnae3_ For consistency, prefix hnae_ should be modified to hnae3_. Signed-off-by: Peng Li Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 024cc792f9309f1342a2fd7bd5840e112b333687 Author: Huazhong Tan Date: Mon Jul 2 15:50:25 2018 +0800 net: hns3: use dma_zalloc_coherent instead of kzalloc/dma_map_single Reference to Documentation/DMA-API-HOWTO.txt, Streaming DMA mappings which are usually mapped for one DMA transfer, Network card DMA ring descriptors should use Consistent DMA mappings. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 7a7056e3dfa6636989b821d890448ae49375bd22 Author: Huazhong Tan Date: Mon Jul 2 15:50:24 2018 +0800 net: hns3: give default option while dependency HNS3 set Give default option for HNS3_HCLGE and HNS3_ENET will be helpful, while dependency HNS3 is set. Meanwhile, use "if HNS3" section instead of all the "depends on HNS3". Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit a9fc79b681025ce47df8a04b8aba9df4999bf167 Author: Huazhong Tan Date: Mon Jul 2 15:50:23 2018 +0800 net: hns3: remove some unused members of some structures Some members in struct hns3_enet_tqp_vector, struct hnae3_client and struct hnae3_ae_algo are unused. This patch removes them. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit f6762f3852bbb1c43343916199713eb6c4f964f1 Author: Huazhong Tan Date: Mon Jul 2 15:50:22 2018 +0800 net: hns3: remove a redundant hclge_cmd_csq_done Set complete in the first hclge_cmd_csq_done of hclge_cmd_send, and check if complete later, unnecessary to do hclge_cmd_csq_done again. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 1c1270da47a290cd3c880b933bb06073c0365e2c Author: Huazhong Tan Date: Mon Jul 2 15:50:21 2018 +0800 net: hns3: simplify hclge_cmd_csq_clean csq is used as a ring buffer, the value of the desc will be replaced in next use. This patch removes the unnecessary memset, and just updates the next_to_clean. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 043fa454f43dcd70e9821f392968970ce9dab7f8 Author: Huazhong Tan Date: Mon Jul 2 15:50:20 2018 +0800 net: hns3: remove some redundant assignments Remove some redundant assignments. desc->flag = cpu_to_le16(HCLGE_CMD_FLAG_NO_INTR | HCLGE_CMD_FLAG_IN) has set bit HCLGE_CMD_FLAG_WR to zero, so does others. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit eb55323c564dc793a21fe71eec782ffb5b4776da Author: Huazhong Tan Date: Mon Jul 2 15:50:19 2018 +0800 net: hns3: remove useless code in hclge_cmd_send There are some useless type cast, print in hclge_cmd_send. This patch removes them. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 5411b984216824902344726f0f9c357cdb60fd89 Author: Huazhong Tan Date: Mon Jul 2 15:50:18 2018 +0800 net: hns3: remove unused hclge_ring_to_dma_dir hclge_ring_to_dma_dir is unused anywhere. This patch removes it. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit eca4c4e47eb0658ad251f0bff465e23c055377da Author: João Paulo Rechi Vita Date: Fri Jun 29 15:12:46 2018 -0700 platform/x86: asus-wireless: Fix uninitialized symbol usage 'ret' will not be initialized if acpi_evaluate_integer() returns through an error path, so it should not be used in this case. This fixes the following Smatch static analyser error: drivers/platform/x86/asus-wireless.c:76 asus_wireless_method() error: uninitialized symbol 'ret'. Reported-by: Dan Carpenter Signed-off-by: João Paulo Rechi Vita Signed-off-by: Andy Shevchenko commit 6bb6ec285df9a20128f8b0ed7cdaad7152208eb8 Author: João Paulo Rechi Vita Date: Fri Jun 29 17:11:38 2018 -0700 platform/x86: asus-wireless: Toggle airplane mode LED This commit makes use of a newly implemented RFKill LED trigger to trigger the LED when all radios are blocked. Signed-off-by: João Paulo Rechi Vita Signed-off-by: Andy Shevchenko commit 10a2032d7a6ac1d9e435ecb355fcc297e550d148 Author: Colin Ian King Date: Sat Jun 30 13:10:24 2018 +0100 platform/x86: dell-smbios-wmi: make function dell_smbios_wmi_call static The function dell_smbios_wmi_call is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'dell_smbios_wmi_call' was not declared. Should it be static? Signed-off-by: Colin Ian King Acked-by: Mario Limonciello Signed-off-by: Andy Shevchenko commit 4f5e81a7a68afa7c0a943ab42c61b00a21913db2 Author: Matt Delco Date: Sun Jun 24 17:29:40 2018 -0700 platform/x86: intel-vbtn: Add support for dock mode detection The Dell laptop I have has an ACPI that sends 0xCB and 0xCC on entering tablet mode. On exiting tablet mode it sends 0xCA and 0xCD. Based on: http://www.traby.de/medion/DSDT/dsdt.dsl https://gist.github.com/jprvita/5737de3cbb670e80973b7d4e51c38ab6 https://osdn.net/projects/android-x86/scm/git/kernel/commits/ 7cbe5a330687b851f32dd9f1048a6ce182d0ff44 It appears that 0xCA and 0xCB are about dock mode, which for my convertible laptop seems questionably tied to whether I've put the laptop in tablet or laptop mode. I previously proposed no-oping 0xCA and 0xCB but this revised change attempts to add support for detecting dock mode--this detection will essentially be broken for my laptop (the main workaround would be for 0xCA and 0xCB to be used to provoke a query of the VGBS method that reports the current dock & tablet mode [which is accurately reported on my laptop but based on the prior workarounds in the driver it apparently can't be trusted for all systems]). Signed-off-by: Matt Delco Cc: Darren Hart Cc: Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Reviewed-by: AceLan Kao Signed-off-by: Andy Shevchenko commit 5bf24e20d18f8335420149894988b2501d70319f Author: Srinivas Pandruvada Date: Thu Jun 28 11:19:06 2018 -0700 platform/x86: intel-hid: Add support for Device Specific Methods In some of the recent platforms, it is possible that stand alone methods for HEBC() or other methods used in this driver may not exist. In this case intel-hid driver will fail to load and power button will not be functional. It is also possible that some quirks in this driver added for some platforms may have same issue in loading intel-hid driver. There is an update to the ACPI details for the HID event filter driver. In the updated specification a _DSM is added, which has separate function indexes for each of the previous stand alone methods. This change brings in support for the _DSM and allows usage of function index for corresponding stand alone methods. Details of Device Specific Method: Intel HID Event Filter Driver _DSM UUID: eeec56b3-4442-408f-a792-4edd4d758054 • Function index 0: Returns a buffer with a bit-field representing the supported function IDs. Function Index ASL Object -------------------------------- 1 BTNL 2 HDMM 3 HDSM 4 HDEM 5 BTNS 6 BTNE 7 HEBC 8 VGBS 9 HEBC One significant change is to query the supported methods implemented on the platform. So the previous HEBC() has two variants. HEBC v1 and HEBC v2. The v2 version allowed further define which of the 5-button are actually defined by the platform. HEBC v2 support is only available via new DSM. v1 Button details: Bits [0] - Rotation Lock, Num Lock, Home, End, Page Up, Page Down Bits [1] - Wireless Radio Control Bits [2] - System Power Down Bits [3] - System Hibernate Bits [4] - System Sleep/ System Wake Bits [5] - Scan Next Track Bits [6] - Scan Previous Track Bits [7] - Stop Bits [8] - Play/Pause Bits [9] - Mute Bits [10] - Volume Increment Bits [11] - Volume Decrement Bits [12] - Display Brightness Increment Bits [13] - Display Brightness Decrement Bits [14] - Lock Tablet Bits [15] - Release Tablet Bits [16] - Toggle Bezel Bits [17] - 5 button array Bits [18-31] - reserved v2 Buttom details: Bits [0-16] - Same as v1 version Bits [17] - 5 button array Bits [18] – Power Button Bits [19] - W Home Button Bits [20] - Volume Up Button Bits [21] - Volume Down Button Bits [22] – Rotation Lock Button Bits [23-31] – reserved Signed-off-by: Srinivas Pandruvada Tested-by: Mario Limonciello Signed-off-by: Andy Shevchenko commit ee08f5782a12328f01935b02aba7ea59734eccb1 Author: Jun Bo Bi Date: Sun Jul 1 17:47:14 2018 -0400 platform/x86: touchscreen_dmi: Add info for the Onda V820w tablet Add touchscreen platform data for the Onda V820w tablet. Signed-off-by: Jun Bo Bi [andy: fixed compilation error, massaged commit message] Signed-off-by: Andy Shevchenko commit 50d4feb5e60e64a8c3053414483e7457be2f111d Author: Colin Ian King Date: Mon Jul 2 08:37:21 2018 +0100 atm: zatm: remove redundant pointer zatm_dev Pointer zatm_dev is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'zatm_dev' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit cf87915cb9f873742135e786d12d42a35eea7538 Author: Heiner Kallweit Date: Mon Jul 2 08:08:13 2018 +0200 net: phy: realtek: add support for RTL8211C RTL8211C has an issue when operating in Gigabit slave mode, therefore genphy driver can't be used. See also this U-boot change. https://lists.denx.de/pipermail/u-boot/2016-March/249712.html Add a PHY driver for this chip with the quirk to force Gigabit master mode. As a note: This will make it impossible to connect two network ports directly which both are driven by a RTl8211C. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 70455ac7ffb6b707af1e56e1993af82906fddaae Author: Thor Thayer Date: Wed Jun 27 12:50:27 2018 -0500 arm64: dts: stratix10: Add SPI node clocks for Stratix10 Add the required clocks for the new Stratix10 clock bindings to the SPI nodes. Signed-off-by: Thor Thayer Signed-off-by: Dinh Nguyen commit 84f95684d9503d7cff920c716b2c7fd5522217eb Author: Thor Thayer Date: Fri Jun 22 13:49:36 2018 -0500 ARM: dts: Add SPI0 node for Arria10 Add the SPI0 node for Arria10. Signed-off-by: Thor Thayer Signed-off-by: Dinh Nguyen commit 05690e8ab29e9d144f634ffa65b8c7f765f627c9 Author: Dinh Nguyen Date: Wed Jun 6 14:55:54 2018 -0500 arm64: dts: stratix10: add OCP reset property for ethernet Add the additional OCP reset property for the ethernet nodes. Signed-off-by: Dinh Nguyen commit 03761ab1b0ab134abcb900d23b32f7c0c615b360 Author: Dinh Nguyen Date: Wed Jun 6 12:07:12 2018 -0500 arm64: dts: stratix10: fill in clocks field for usb and watchdog Populate the clocks field for USB and watchdog. Signed-off-by: Dinh Nguyen commit 0cb140d07fc75fb40dc402ba7e6e8c3c3a6f9d71 Author: Thor Thayer Date: Tue May 15 17:26:27 2018 -0500 arm64: dts: stratix10: Add QSPI support for Stratix10 Add qspi_clock The qspi_clk frequency is updated by U-Boot before starting Linux. Add QSPI interface node. Add QSPI flash memory child node. Setup the QSPI memory in 2 partitions. Signed-off-by: Thor Thayer Signed-off-by: Dinh Nguyen commit 9868c0b2eb18470a91d6f0f0df318738a50554e2 Author: Roman Mashak Date: Mon Jul 2 00:02:02 2018 -0400 net sched actions: add extack messages in pedit action Signed-off-by: Roman Mashak Signed-off-by: David S. Miller commit 414372f633e378b3ef7443ce0f0370a6a4e5808b Author: Guenter Roeck Date: Sun Jul 1 13:57:38 2018 -0700 TTY: isdn: Replace strncpy with memcpy gcc 8.1.0 complains: drivers/isdn/i4l/isdn_tty.c: In function 'isdn_tty_suspend.isra.1': drivers/isdn/i4l/isdn_tty.c:790:3: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length drivers/isdn/i4l/isdn_tty.c:778:6: note: length computed here drivers/isdn/i4l/isdn_tty.c: In function 'isdn_tty_resume': drivers/isdn/i4l/isdn_tty.c:880:3: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length drivers/isdn/i4l/isdn_tty.c:817:6: note: length computed here Using strncpy() is indeed less than perfect since the length of data to be copied has already been determined with strlen(). Replace strncpy() with memcpy() to address the warning and optimize the code a little. Signed-off-by: Guenter Roeck Signed-off-by: David S. Miller commit 100ec4bf09679583d45316fcf13611f66a8d0f88 Author: Heiner Kallweit Date: Sun Jul 1 19:14:58 2018 +0200 net: phy: realtek: add missing entry for RTL8211 to mdio_device_id table When adding support for RTL8211 I forgot to update the mdio_device_id table. Signed-off-by: Heiner Kallweit Fixes: d241d4aac93f ("net: phy: realtek: add support for RTL8211") Signed-off-by: David S. Miller commit d6f19938eb031ee2158272757db33258153ae59c Author: Yafang Shao Date: Sun Jul 1 23:31:30 2018 +0800 net: expose sk wmem in sock_exceed_buf_limit tracepoint Currently trace_sock_exceed_buf_limit() only show rmem info, but wmem limit may also be hit. So expose wmem info in this tracepoint as well. Regarding memcg, I think it is better to introduce a new tracepoint(if that is needed), i.e. trace_memcg_limit_hit other than show memcg info in trace_sock_exceed_buf_limit. Signed-off-by: Yafang Shao Signed-off-by: David S. Miller commit 335c997dce5c448ee06b3fd4dfe49fc7279f73ce Author: Heiner Kallweit Date: Sun Jul 1 00:25:19 2018 +0200 r8169: remove old PHY reset hack This hack (affecting the non-PCIe models only) was introduced in 2004 to deal with link negotiation failures in 1GBit mode. Based on a comment in the r8169 vendor driver I assume the issue affects RTL8169sb in combination with particular 1GBit switch models. Resetting the PHY every 10s and hoping that one fine day we will make it to establish the link seems to be very hacky to me. I'd say: If 1GBit doesn't work reliably in a users environment then the user should remove 1GBit from the advertised modes, e.g. by using ethtool -s advertise <10/100 modes> If the issue affects one chip version only and that with most link partners, then we could also think of removing 1GBit from the advertised modes for this chip version in the driver. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 1823342a1f2b47a4e6f5667f67cd28ab6bc4d6cd Author: Guenter Roeck Date: Sun Jul 1 13:56:54 2018 -0700 configfs: replace strncpy with memcpy gcc 8.1.0 complains: fs/configfs/symlink.c:67:3: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length fs/configfs/symlink.c: In function 'configfs_get_link': fs/configfs/symlink.c:63:13: note: length computed here Using strncpy() is indeed less than perfect since the length of data to be copied has already been determined with strlen(). Replace strncpy() with memcpy() to address the warning and optimize the code a little. Signed-off-by: Guenter Roeck Signed-off-by: Christoph Hellwig commit ad78b000fc100aec89ebe1ced9ed80e696444123 Author: Vinod Koul Date: Mon Jul 2 18:42:51 2018 +0530 dmaengine: imx-sdma: remove unused variable The variable is no longer used, though it is set, so remove it drivers/dma/imx-sdma.c:1298:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] int ret, i, count; ^~~ Signed-off-by: Vinod Koul commit c1199875d327a9b3bbb3fb1cca0d467d3e625fbb Author: Vinod Koul Date: Mon Jul 2 18:37:27 2018 +0530 dmaengine: imx-sdma: Use GFP_NOWAIT for dma allocations The memory allocation in DMA callbacks should use GFP_NOWAIT, so update this one and fix code alignment for this call while at it. Signed-off-by: Vinod Koul commit 680302c47513f727063031f7ec4fcac0316241eb Author: Vinod Koul Date: Mon Jul 2 18:34:02 2018 +0530 dmaengine: imx-sdma: Fix some typos Signed-off-by: Vinod Koul commit fe5b85c656bcf54468cb1efcd692a491a524ae86 Author: Robin Gong Date: Wed Jun 20 00:57:04 2018 +0800 dmaengine: imx-sdma: alloclate bd memory from dma pool dma_terminate_all maybe called in interrupt context which means WARN_ON() will be triggered as below when bd memory freed. Allocat bd memory from dma pool instead. [ 29.161079] WARNING: CPU: 1 PID: 533 at ./include/linux/dma-mapping.h:541 sdma_free_bd+0xa4/0xb4 [ 29.169883] Modules linked in: [ 29.172990] CPU: 1 PID: 533 Comm: mpegaudioparse0 Not tainted 4.18.0-rc1-next-20180618-00009-gf79f22c #20 [ 29.182597] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 29.189163] Backtrace: [ 29.191685] [] (dump_backtrace) from [] (show_stack+0x18/0x1c) [ 29.199306] r7:00000000 r6:600f0093 r5:00000000 r4:c107db7c [ 29.205029] [] (show_stack) from [] (dump_stack+0xb4/0xe8) [ 29.212312] [] (dump_stack) from [] (__warn+0x104/0x130) [ 29.219411] r9:ec3e817c r8:0000021d r7:00000009 r6:c0d1d440 r5:00000000 r4:00000000 [ 29.227204] [] (__warn) from [] (warn_slowpath_null+0x44/0x50) [ 29.234821] r8:ed129dc4 r7:c0b01978 r6:c04d4e90 r5:0000021d r4:c0d1d440 [ 29.241574] [] (warn_slowpath_null) from [] (sdma_free_bd+0xa4/0xb4) [ 29.249706] r6:4c001000 r5:f082e000 r4:00000024 [ 29.254376] [] (sdma_free_bd) from [] (sdma_desc_free+0x14/0x20) [ 29.262163] r7:ec3e8110 r6:00000100 r5:00000200 r4:ecf89a00 [ 29.267873] [] (sdma_desc_free) from [] (vchan_dma_desc_free_list+0xa4/0xac) [ 29.276697] r5:00000200 r4:ed129d9c [ 29.280326] [] (vchan_dma_desc_free_list) from [] (sdma_disable_channel_with_delay+0x14c/0x188) [ 29.290808] r9:ecae560c r8:ec3e815c r7:00000000 r6:c1008908 r5:ed129dc4 r4:ec3e8110 [ 29.298605] [] (sdma_disable_channel_with_delay) from [] (snd_dmaengine_pcm_trigger+0x90/0x1b0) [ 29.309087] r8:ecae5000 r7:ec940800 r6:ed31bd80 r5:ecadb200 r4:ec26a700 [ 29.315855] [] (snd_dmaengine_pcm_trigger) from [] (soc_pcm_trigger+0xb4/0x130) [ 29.324953] r8:ecae5000 r7:ec940800 r6:00000000 r5:ecadb200 r4:ec26a700 [ 29.331716] [] (soc_pcm_trigger) from [] (snd_pcm_do_stop+0x58/0x5c) [ 29.339859] r9:ecaed5a8 r8:ed31bdc0 r7:00000000 r6:00000001 r5:ecadb200 r4:c0b9c4d0 [ 29.347652] [] (snd_pcm_do_stop) from [] (snd_pcm_action_single+0x40/0x80) [ 29.356315] [] (snd_pcm_action_single) from [] (snd_pcm_action+0xf4/0xfc) [ 29.364883] r7:00000001 r6:c0b9c4d0 r5:ecadb2d4 r4:ecadb200 [ 29.370593] [] (snd_pcm_action) from [] (snd_pcm_drop+0x58/0x9c) Signed-off-by: Robin Gong Reviewed-by: Sascha Hauer Tested-by: Lucas Stach Signed-off-by: Vinod Koul commit 21420841a554dae8a193cd3454ba91d913cfc320 Author: Robin Gong Date: Wed Jun 20 00:57:03 2018 +0800 dmaengine: imx-sdma: add sdma_transfer_init to decrease code overlap There are lot of codes overlap between prep_sg and prep_cyclic function. Add sdma_transfer_init() function to elimated the code overlap. Signed-off-by: Robin Gong Reviewed-by: Sascha Hauer Tested-by: Lucas Stach Signed-off-by: Vinod Koul commit 36e8d3b133e16eb2aee8a53b9ed5cd34821f6123 Author: Robin Gong Date: Wed Jun 20 00:57:02 2018 +0800 dmaengine: imx-sdma: remove the maximum limitation for bd numbers No this limitation now after virtual dma used since bd is allocated dynamically instead of static. Signed-off-by: Robin Gong Reviewed-by: Sascha Hauer Tested-by: Lucas Stach Signed-off-by: Vinod Koul commit d69d1e17c39e0a14f743da72a9e35796e1fd0f87 Author: Robin Gong Date: Wed Jun 20 00:57:01 2018 +0800 dmaengine: imx-sdma: remove useless 'lock' and 'enabled' in 'struct sdma_channel' Since 'sdmac->vc.lock' and 'sdmac->desc' can be used as 'lock' and 'enabled' in 'struct sdma_channel sdmac', remove them. Signed-off-by: Robin Gong Reviewed-by: Sascha Hauer Tested-by: Lucas Stach Signed-off-by: Vinod Koul commit 57b772b86871e025c1fc149d8c3e48667be0869f Author: Robin Gong Date: Wed Jun 20 00:57:00 2018 +0800 dmaengine: imx-sdma: add virt-dma support The legacy sdma driver has below limitations or drawbacks: 1. Hardcode the max BDs number as "PAGE_SIZE / sizeof(*)", and alloc one page size for one channel regardless of only few BDs needed most time. But in few cases, the max PAGE_SIZE maybe not enough. 2. One SDMA channel can't stop immediatley once channel disabled which means SDMA interrupt may come in after this channel terminated.There are some patches for this corner case such as commit "2746e2c389f9", but not cover non-cyclic. The common virt-dma overcomes the above limitations. It can alloc bd dynamically and free bd once this tx transfer done. No memory wasted or maximum limititation here, only depends on how many memory can be requested from kernel. For No.2, such issue can be workaround by checking if there is available descript("sdmac->desc") now once the unwanted interrupt coming. At last the common virt-dma is easier for sdma driver maintain. Signed-off-by: Robin Gong Reviewed-by: Sascha Hauer Tested-by: Lucas Stach Signed-off-by: Vinod Koul commit 76c33d27073e29bd98d1c975265e1cbe0889fc53 Author: Sascha Hauer Date: Wed Jun 20 00:56:59 2018 +0800 dmaengine: imx-sdma: factor out a struct sdma_desc from struct sdma_channel This is a preparation step to make the adding of virt-dma easier. We create a struct sdma_desc, move some fields from struct sdma_channel there and add a pointer from the former to the latter. For now we allocate the data statically in struct sdma_channel, but with virt-dma support it will be dynamically allocated. Signed-off-by: Sascha Hauer Signed-off-by: Robin Gong Reviewed-by: Sascha Hauer Tested-by: Lucas Stach Signed-off-by: Vinod Koul commit 41f8fee385a00dcbc6107e7d356490391505a59a Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:23 2018 +0200 ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin "keybrd_dataout" GPIO pin used to be initialized by ams-delta-serio driver to a state safe for ams-delta-serio device function and not changed thereafter. As such, it may be assumed not under the driver control and responsibility for its initialization handed over to board init file. Introduce a GPIO hog table and take over control of the "keybrd_dataout" GPIO pin from the ams-delta-serio driver. Signed-off-by: Janusz Krzysztofik Signed-off-by: Tony Lindgren commit 2bcb1be0923700deee554120304777cad465b5bc Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:22 2018 +0200 Input: ams_delta_serio: Replace power GPIO with regulator Modify the driver so it no longer requests and manipulates the "keybrd_pwr" GPIO pin but a "vcc" regulator supply instead. For this to work with Amstrad Delta, define a regulator over the "keybrd_pwr" GPIO pin with the "vcc" supply for ams-delta-serio device and register it from the board file. Both assign an absulute GPIO number to the soon depreciated .gpio member of the regulator config structure, and also build and register a GPIO lookup table so it is ready for use by the regulator driver as soon as its upcoming update is applied. Signed-off-by: Janusz Krzysztofik Acked-by: Dmitry Torokhov Signed-off-by: Tony Lindgren commit 56de7570b3264fdd920f74bda5cf334b82f4c1f9 Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:21 2018 +0200 Input: ams_delta_serio: use private structure Introduce a driver private structure and allocate it on device probe. For now, use it instead of a static variable for storing a pointer to serio structure. Subsequent patches will populate it with more members as needed. Signed-off-by: Janusz Krzysztofik Acked-by: Dmitry Torokhov Signed-off-by: Tony Lindgren commit df88c5768927855e54b8f0bd7dd478150b30beda Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:20 2018 +0200 Input: ams_delta_serio: convert to platform driver Convert the driver to an "ams-delta-serio" platform driver. For it to be used with Amstrad Delta, register an "ams-delta-serio" platform device from the board init file. Signed-off-by: Janusz Krzysztofik Acked-by: Dmitry Torokhov Signed-off-by: Tony Lindgren commit 68e62a15a9146dead4a221ad1a31e3b186f12734 Author: Janusz Krzysztofik Date: Fri Jun 22 00:41:19 2018 +0200 ARM: OMAP1: ams-delta: drop GPIO lookup table for serio device GPIO lookup table for ams-delta-serio device was introduced by commit 0486738928bf ("ARM: OMAP1: ams-delta: add GPIO lookup tables"). Unfortunately, a follow up patch "Input: ams_delta_serio: use GPIO lookup table" was not accepted by subystem maintainer who requested conversion of the driver to a platform driver, replacepemnt of IRQ GPIO pin with IRQ resource, replacement of GPIO pin providing keyboard power with a regulator and removal of remaining GPIO pins from the driver as not handled by it. Let's start with removal of the no longer needed GPIO lookup table from the board init file. Signed-off-by: Janusz Krzysztofik Signed-off-by: Tony Lindgren commit 8c14b0846f5c6e5e043c9250cbe34b44a0e216b7 Author: Janusz Krzysztofik Date: Sun May 27 15:55:48 2018 +0200 ARM: OMAP1: ams-delta: assign LED GPIO numbers from descriptors Assign a label to latch1 GPIO device the LEDs hang off, enumerate its pins for the purpose of indexing gpio_led table, remove hardcoded GPIO numbers from that table replacing them with invalid GPIO numbers and remove initialization of incompletely described LED device from machine_init. As soon as the latch1 GPIO device is registered, use its label to find respective GPIO chip, identify each LED's GPIO descriptor by its pin number and assign its gobal GPIO number to the gpio_led table. Once completed, register the LED device. Created and tested against linux-v4.17-rc3. Signed-off-by: Janusz Krzysztofik Signed-off-by: Tony Lindgren commit 3e14de3bfb3afc296a33f1ccbab6d781e5bbb482 Author: Janusz Krzysztofik Date: Sun May 27 15:55:47 2018 +0200 ARM: OMAP1: ams-delta: refactor late_init() Before the board level GPIO handling is converted from GPIO numbers to GPIO descriptors, split late_init() into functional blocks and move them to separate functions. While being at it, drop machine type check from late_init() - the function is now called from the board init_late callback so there is no need for yet another applicability check. Signed-off-by: Janusz Krzysztofik Signed-off-by: Tony Lindgren commit c72d95e5189b30cc7f8574a79f597f13cb2e1fcb Author: Hans de Goede Date: Sun Jul 1 11:32:56 2018 +0200 platform/x86: touchscreen_dmi: Add info for the "Connect Tablet 9" tablet Add touchscreen info for the "Connect Tablet 9" tablet. This appears to be a variant of the same hardware as the ITworks TW891 tablet, but it needs different firmware for the touchscreen to fonction properly. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit c0d730885e6e5180cbb593f25babffa878e18fef Author: youling257 Date: Mon Jun 18 15:11:44 2018 +0200 platform/x86: touchscreen_dmi: Add info for the ONDA V891W Dual OS tablet Add touchscreen info for hardware revision "v3" of the ONDA V891W Dual OS tablet. Reported-and-tested-by: youling257 Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit e6a785116df09f07c8d185fb18211d2bbacb047b Author: Kees Cook Date: Fri Jun 29 11:51:07 2018 -0700 dmaengine: ste_dma40: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this switches to using a pre-allocated scratch register space, set up with all other other allocations. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Reviewed-by: Arnd Bergmann Signed-off-by: Vinod Koul commit ed99d29b2b1562e5173953a5ea8b7861a4f29e2c Author: Chris Chiu Date: Wed Jun 20 22:46:45 2018 +0800 platform/x86: asus-wmi: Add keyboard backlight toggle support Some ASUS laptops like UX550GE has hotkey (Fn+F7) for keyboard backlight toggle which would emit the scan code 0xc7 each keypress. On the UX550GE, the max keyboard brightness level is 3 so the toggle would not be simply on/off the led but need to be cyclic. Per ASUS spec, it should increment the brightness for each keypress, then toggle(off) the LED when it already reached the max level. Signed-off-by: Chris Chiu Signed-off-by: Andy Shevchenko commit dbb3d78f61badeadc7448f9d88a070a76612860f Author: Chris Chiu Date: Wed Jun 20 22:46:44 2018 +0800 platform/x86: asus-wmi: Call led hw_changed API on kbd brightness change Make asus-wmi notify on hotkey kbd brightness changes, listen for brightness events and update the brightness directly in the driver. Create new do_kbd_led_set function for in-driver update, and leave kbd_led_set for original led_classdev call path. Update the brightness by led_classdev_notify_brightness_hw_changed. This will allow userspace to monitor (poll) for brightness changes on the LED without reporting via input keymapping. Signed-off-by: Chris Chiu Signed-off-by: Andy Shevchenko commit 6e2d4b4f3a711a9e6bdb238818c545ef91036ce5 Author: Bartosz Golaszewski Date: Thu Jun 21 09:37:06 2018 +0200 ARM: davinci: dts: add a reset control to the dsp node The davinci-rproc driver will soon use the reset framework. Add the resets property to the dsp node in da850.dtsi. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner Signed-off-by: Sekhar Nori commit 4cf2afd6ef0d5e43e92d46401e7c1d3a9fac915b Author: Box, David E Date: Fri Jun 8 17:02:37 2018 -0700 platform/x86: intel_pmc_core: Add CNP SLPS0 debug registers Adds debugfs access to registers in the Cannon Point PCH PMC that are useful for debugging #SLP_S0 signal assertion and other low power relate activities. Device pm states are latched in these registers whenever the package enters C10 and can be read from slp_s0_debug_status. The pm states may also be latched by writing 1 to slp_s0_dbg_latch which will immediately capture the current state on the next read of slp_s0_debug_status. Signed-off-by: Box, David E Signed-off-by: Andy Shevchenko commit 74421786f0bcdc3599983137de4b39b8ff0ff9a2 Author: Hans de Goede Date: Fri Jun 8 23:45:58 2018 +0200 platform/x86: Rename silead_dmi to touchscreen_dmi Not only silead touchscreens need some extra info not available in the ACPI tables to work properly. X86 devices with a Chipone ICN8505 chip also need some DMI based extra configuration. There is no reason to have separate dmi config code per touchscreen controller vendor. This commit renames silead_dmi to a more generic touchscreen_dmi name (and Kconfig option) in preparation of adding info for tablets with an ICN8505 based touchscreen. Note there are no functional changes all code changes are limited to removing references to silead where these are no longer applicable. Acked-by: Andy Shevchenko Acked-by: Ard Biesheuvel Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit b4c86811ce955ebf1909b5b5e531d33d667a8613 Author: Hans de Goede Date: Fri Jun 8 23:45:57 2018 +0200 platform/x86: silead_dmi: Add touchscreen info for the Chuwi Vi10 tablet Add touchscreen info for the 10" Chuwi Vi10 (CWI505) tablet. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 6a655a0dfe861e22e52ae01ac6924b5194c4cc35 Author: Hans de Goede Date: Fri Jun 8 23:45:56 2018 +0200 platform/x86: silead_dmi: Sort entries alphabetically We have so much entries now that it is good to bring some form of order to them. This should also reduce conflicts when multiple patches make changes at the same time (compared to tagging all new entries at the end). Note this commit purely moves stuff around and adds 2 comments about keeping the data and table alphabetically sorted. There are no functional changes. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit d6b0d7d8d50de98516fa57c39088cbb1710d03bb Author: Hans de Goede Date: Fri Jun 8 23:45:55 2018 +0200 platform/x86: silead_dmi: Rename trekstor entries Prefix the entries for trekstor tablets with trekstor_ and drop the detailed model version (still available as comment in the dmi table) to keep things within 80 chars. This is a preparation patch for sorting all the entries alphabetically. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 5e7765df703493a108ee3310873c063676a14f35 Author: Bartosz Golaszewski Date: Thu Jun 21 09:37:05 2018 +0200 ARM: davinci: dts: make psc0 a reset provider The psc driver registers with the reset framework as a provider. Add the #reset-cells property to the psc0 node. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner Signed-off-by: Sekhar Nori commit 1201a5a25cf0f7d8019d106a81c64f3a7397d17c Author: Kees Cook Date: Fri Jun 29 11:45:36 2018 -0700 perf/arm-cci: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this removes the VLA in favor of a maximum size and adds a sanity check at registration time. The sizes are all explicitly enumerated already, so this just collects them into macros. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Signed-off-by: Will Deacon commit c02462d8a3e96d99967fb26fca7375d449328ce6 Author: Colin Ian King Date: Sat Jun 30 21:39:24 2018 +0100 netdevsim: fix sa_idx out of bounds check Currently if sa_idx is equal to NSIM_IPSEC_MAX_SA_COUNT then an out-of-bounds read on ipsec->sa will occur. Fix the incorrect bounds check by using >= rather than >. Detected by CoverityScan, CID#1470226 ("Out-of-bounds-read") Fixes: 7699353da875 ("netdevsim: add ipsec offload testing") Signed-off-by: Colin Ian King Acked-by: Shannon Nelson Signed-off-by: David S. Miller commit 7c058c7c74b3dbeb7d157c273959f87faf710350 Author: Ravi Chandra Sadineni Date: Wed Jun 27 10:55:02 2018 -0700 ACPI / button: increment wakeup count only when notified Because acpi_lid_initialize_state() is called on every system resume and it triggers acpi_lid_notify_state() which invokes acpi_pm_wakeup_event() for the lid device, the lid's wakeup count is incremented even if the lid was not the source of the event that woke up the system. That behavior confuses user space deamons using wakeup_count to identify the potential system wakeup source. To avoid the confusion, only trigger acpi_pm_wakeup_event() in the acpi_button_notify() path and don't do that in the acpi_lid_initialize_state() path. Signed-off-by: Ravi Chandra Sadineni Signed-off-by: Rafael J. Wysocki commit 40dda8720b8d8f972336f5b9910677e953f8232a Author: Arvind Yadav Date: Tue Dec 26 12:07:11 2017 +0530 ARM: OMAP1: constify gpio_led gpio_led are not supposed to change at runtime. struct gpio_led_platform_data working with const gpio_led provided by . So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Tony Lindgren commit 88763a5cf80ca59a7c3bea32681ce8f697d9995f Author: Daniel Lezcano Date: Tue Jun 26 12:53:29 2018 +0200 powercap / idle_inject: Add an idle injection framework Initially, the cpu_cooling device for ARM was changed by adding a new policy inserting idle cycles. The intel_powerclamp driver does a similar action. Instead of implementing idle injections privately in the cpu_cooling device, move the idle injection code in a dedicated framework and give the opportunity to other frameworks to make use of it. The framework relies on the smpboot kthreads which handles via its main loop the common code for hotplugging and [un]parking. This code was previously tested with the cpu cooling device and went through several iterations. It results now in split code and API exported in the header file. It was tested with the cpu cooling device with success. Signed-off-by: Daniel Lezcano Reviewed-by: Viresh Kumar [ rjw: Rewrite of all comments ] Signed-off-by: Rafael J. Wysocki commit ee6d777d3e93670af801a7288ee6281626f4ac2d Author: Vasily Gorbik Date: Thu Jun 28 19:22:21 2018 +0200 s390/decompressor: support extra debug flags Since decompressor cflags and aflags are made from scratch add extra debug flags when CONFIG_DEBUG_INFO is enabled. Also adds support for CONFIG_DEBUG_INFO_DWARF4 option. Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 251987a8025da049f42001bdb21250f79644ede3 Author: Vasily Gorbik Date: Sun Jul 1 11:32:51 2018 +0200 s390/build: add *.o.chkbss files to targets list Adding *.o.chkbss files to targets list makes sure that the kbuild is aware of them and removes them during make clean. Also remove *.o.chkbss file before an actual check, to avoid having stale *.o.chkbss file left even if the check is failed. Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 7e0363b469f5d2ad00234497aad65c7b46db42c0 Author: Vasily Gorbik Date: Thu Jun 28 19:21:36 2018 +0200 s390/decompressor: avoid packing *.o.chkbss files into startup.a startup.a build rule packs a list of prerequisites into archive. That didn't take into account extra prerequisites added by chkbss, so that zero length *.o.chkbss files were also packed into the archive. To avoid that filter only real object from prerequisites list. Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit b887b1b106654141ab034061ef0cc8d471ebc683 Author: Vasily Gorbik Date: Sun Jul 1 11:31:48 2018 +0200 s390/decompressor: avoid constant startup.a rebuilds Correct merging error which replaced startup.a in targets list with non-existing setup.a. Due to missing startup.a in targets list if_changed triggered startup.a rebuild unconditionally. Fixes: 3e200c54438d ("s390/decompressor: avoid reusing uncompressed image objects") Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 9f35b818a2f90fb6cb291aa0c9f835d4f0974a9a Author: Heiko Carstens Date: Mon Jul 2 10:54:02 2018 +0200 s390/sysinfo: add missing #ifdef CONFIG_PROC_FS Get rid of this compile warning for !PROC_FS: CC arch/s390/kernel/sysinfo.o arch/s390/kernel/sysinfo.c:275:12: warning: 'sysinfo_show' defined but not used [-Wunused-function] static int sysinfo_show(struct seq_file *m, void *v) Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit 424e2b4b3521334812d833eef27df77671428698 Author: Jerome Brunet Date: Fri Jun 29 17:09:23 2018 +0200 ASoC: es7134: Add VDD and AVDD power supplies Add the VDD and AVDD power supplies to the DAPM graph as some board may need to enable a regulator to turn them on. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit a016b11cc41df06b79c0c226e719d0d88373919c Author: Jerome Brunet Date: Fri Jun 29 17:09:21 2018 +0200 ASoC: es7134: check if mclk rate is valid For each supported sample rate, the es7134 can work with several mclk / sample rate ratio. Check if ratio we get is actually OK. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 5650729f9a1bbf65b57139d855dabe0a7e6cb494 Author: Jerome Brunet Date: Fri Jun 29 17:09:20 2018 +0200 ASoC: es7134: remove 64kHz rate from the supported rates 64Khz is actually not supported by the es7134 according to the datasheet Fixes: 9000b59d7a12 ("ASoC: es7134: add es7134 DAC driver") Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit d8ffee2f551a627ffb7b216e2da322cb9a037f77 Author: Krzysztof Kozlowski Date: Fri Jun 29 13:33:09 2018 +0200 spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe Registers of DSPI should not be accessed before enabling its clock. On Toradex Colibri VF50 on Iris carrier board this could be seen during bootup as imprecise abort: Unhandled fault: imprecise external abort (0x1c06) at 0x00000000 Internal error: : 1c06 [#1] ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.39-dirty #97 Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree) Backtrace: [<804166a8>] (regmap_write) from [<80466b5c>] (dspi_probe+0x1f0/0x8dc) [<8046696c>] (dspi_probe) from [<8040107c>] (platform_drv_probe+0x54/0xb8) [<80401028>] (platform_drv_probe) from [<803ff53c>] (driver_probe_device+0x280/0x2f8) [<803ff2bc>] (driver_probe_device) from [<803ff674>] (__driver_attach+0xc0/0xc4) [<803ff5b4>] (__driver_attach) from [<803fd818>] (bus_for_each_dev+0x70/0xa4) [<803fd7a8>] (bus_for_each_dev) from [<803fee74>] (driver_attach+0x24/0x28) [<803fee50>] (driver_attach) from [<803fe980>] (bus_add_driver+0x1a0/0x218) [<803fe7e0>] (bus_add_driver) from [<803fffe8>] (driver_register+0x80/0x100) [<803fff68>] (driver_register) from [<80400fdc>] (__platform_driver_register+0x48/0x50) [<80400f94>] (__platform_driver_register) from [<8091cf7c>] (fsl_dspi_driver_init+0x1c/0x20) [<8091cf60>] (fsl_dspi_driver_init) from [<8010195c>] (do_one_initcall+0x4c/0x174) [<80101910>] (do_one_initcall) from [<80900e8c>] (kernel_init_freeable+0x144/0x1d8) [<80900d48>] (kernel_init_freeable) from [<805ff6a8>] (kernel_init+0x10/0x114) [<805ff698>] (kernel_init) from [<80107be8>] (ret_from_fork+0x14/0x2c) Cc: Fixes: 5ee67b587a2b ("spi: dspi: clear SPI_SR before enable interrupt") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Mark Brown commit 05739375f1c0a1048fea8b9c4cb54d9e4a891938 Author: Daniel Mack Date: Fri Jun 29 14:59:40 2018 +0200 ASoC: pxa-ssp: remove .set_pll() and .set_clkdiv() callbacks The .set_pll() and .set_clkdiv() callbacks are considered legacy and should not be used anymore. In order to support PXA boards on DT platforms, remove them and let the code figure out the correct dividers and PLL base frequencies itself. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 1581250119daa9426c359d059e2dc14ec04bcc0c Author: Daniel Mack Date: Sat Jun 30 22:24:33 2018 +0200 ASoC: pxa: select SND_PXA2XX_LIB for drivers that depend on it Commit d767d3ce5c48b ("ASoC: pxa: provide PCM ops for ssp, i2s and ac97 components") created a build-time dependency to SND_PXA2XX_LIB but missed to reflect that in Kconfig. Reported-by: kbuild test robot Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 1a8f0a3c13c136951de7ea24ccb148e745db98a2 Author: Kuninori Morimoto Date: Mon Jul 2 06:26:27 2018 +0000 ASoC: ac97: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 1356a6071cf4d7187652cd2b18dfab4763e0dba6 Author: Kuninori Morimoto Date: Mon Jul 2 06:25:11 2018 +0000 ASoC: soc-generic-dmaengine-pcm: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit b3ed4c86a700b494fc5058a52531eeb14d6fe00f Author: Kuninori Morimoto Date: Mon Jul 2 06:24:57 2018 +0000 ASoC: soc-compress: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit f2b6a1b25fecc48a46c8a41636101af8a41c88a8 Author: Kuninori Morimoto Date: Mon Jul 2 06:24:45 2018 +0000 ASoC: soc-topology: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit c01f3af4d32071915119ffcb933e75d7c165378e Author: Kuninori Morimoto Date: Mon Jul 2 06:24:31 2018 +0000 ASoC: soc-dapm: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 873486ed4af3e11bfc20832dff7b124ba652bf77 Author: Kuninori Morimoto Date: Mon Jul 2 06:24:18 2018 +0000 ASoC: soc-core: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 7730bb13c7472620b585783f248b2dccd09d1819 Author: Kuninori Morimoto Date: Mon Jul 2 06:24:04 2018 +0000 ASoC: soc-acpi: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 9e14035c7fac144f31a822f0034fe5ed79c9ef8a Author: Kuninori Morimoto Date: Mon Jul 2 06:23:45 2018 +0000 ASoC: soc-devres.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 632628df453ccda727fbcc1e346600162ac995e9 Author: Kuninori Morimoto Date: Mon Jul 2 06:23:30 2018 +0000 ASoC: soc-utils.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 8ab0215c11817fc0a89f1f82cdf10fd4c0eb9e86 Author: Kuninori Morimoto Date: Mon Jul 2 06:23:16 2018 +0000 ASoC: soc-jack.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit b53c34b4b73eb65e6480ada6ec8ddbcc2d4e9817 Author: Kuninori Morimoto Date: Mon Jul 2 06:22:58 2018 +0000 ASoC: soc-dpcm.h: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit ed51758247c51dfdb526d279164cfd925496f187 Author: Kuninori Morimoto Date: Mon Jul 2 06:22:44 2018 +0000 ASoC: soc-pcm.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 4eef5a90ca8b2aab61c98853141f9242af4a8339 Author: Kuninori Morimoto Date: Mon Jul 2 06:22:30 2018 +0000 ASoC: soc-ops.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit e2cfd2c9673f4e9d08971fed53fe1f41d8270ef0 Author: Kuninori Morimoto Date: Mon Jul 2 06:22:15 2018 +0000 ASoC: soc-dai.h: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit d1aaa2e68619ca4c1cc05ce7bc029cda5a8cbe87 Author: Kuninori Morimoto Date: Mon Jul 2 06:21:54 2018 +0000 ASoC: soc-io.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit ac204c9b030fe2d27cf3a63386811254d99b3ce4 Author: Kuninori Morimoto Date: Mon Jul 2 06:31:33 2018 +0000 ASoC: audio-graph-scu-card.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit decd896121f965db2fdee0f0475c3e404746b333 Author: Kuninori Morimoto Date: Mon Jul 2 06:31:16 2018 +0000 ASoC: audio-graph-card.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 9afe58f1cbd1fb5e9426483656ae6f65de4130e4 Author: Kuninori Morimoto Date: Mon Jul 2 06:30:58 2018 +0000 ASoC: simple-scu-card.c: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit d613a7f45ebb2f113444630fcbbb8a074c741998 Author: Kuninori Morimoto Date: Mon Jul 2 06:30:44 2018 +0000 ASoC: simple-card-utils: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit d573454d9b4f00061da314460908e19476d2ff6d Author: Kuninori Morimoto Date: Mon Jul 2 06:30:28 2018 +0000 ASoC: simple-card: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 464a5686e6c9df364fbfa9a6d0f61276a777d550 Author: Fabio Estevam Date: Sun Jul 1 22:18:27 2018 -0300 regulator: Revert "regulator: pfuze100: add enable/disable for switch" This reverts commit 5fe156f1cab4f340ddb6283c993912be77594016. Commit 5fe156f1cab4 ("regulator: pfuze100: add enable/disable for switch") causes boot regression on some platforms such as imx6sl-evk and imx6sll-evk. After this commit the SW4 regulator will be turned off and since it supplies the DDR voltage on these boards, a kernel hang is observed. Revert it to avoid breaking old dtb's. Fixes: 5fe156f1cab4 ("regulator: pfuze100: add enable/disable for switch") Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown commit d5641c64c48f4408500a348301bff01fbf2c1ec5 Author: Chengguang Xu Date: Mon Jun 25 13:30:58 2018 +0800 PM / hibernate: cast PAGE_SIZE to int when comparing with error code If PAGE_SIZE is unsigned type then negative error code will be larger than PAGE_SIZE. Signed-off-by: Chengguang Xu Signed-off-by: Rafael J. Wysocki commit 90aff8d091c9c1fa46df45ddd8e73e4c6b6e2b0b Author: Peng Donglin Date: Wed Jun 13 09:11:56 2018 +0800 ARM64: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Peng Donglin Signed-off-by: Will Deacon commit f314dfea16a085a58d2ff227ea9fa9e490ee5d18 Author: Jessica Yu Date: Fri Jun 29 16:37:08 2018 +0200 modsign: log module name in the event of an error Now that we have the load_info struct all initialized (including info->name, which contains the name of the module) before module_sig_check(), make the load_info struct and hence module name available to mod_verify_sig() so that we can log the module name in the event of an error. Signed-off-by: Jessica Yu commit 5f936e19cc0ef97dbe3a56e9498922ad5ba1edef Author: Thomas Gleixner Date: Mon Jul 2 09:34:29 2018 +0200 alarmtimer: Prevent overflow for relative nanosleep Air Icy reported: UBSAN: Undefined behaviour in kernel/time/alarmtimer.c:811:7 signed integer overflow: 1529859276030040771 + 9223372036854775807 cannot be represented in type 'long long int' Call Trace: alarm_timer_nsleep+0x44c/0x510 kernel/time/alarmtimer.c:811 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1235 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1213 [inline] __x64_sys_clock_nanosleep+0x326/0x4e0 kernel/time/posix-timers.c:1213 do_syscall_64+0xb8/0x3a0 arch/x86/entry/common.c:290 alarm_timer_nsleep() uses ktime_add() to add the current time and the relative expiry value. ktime_add() has no sanity checks so the addition can overflow when the relative timeout is large enough. Use ktime_add_safe() which has the necessary sanity checks in place and limits the result to the valid range. Fixes: 9a7adcf5c6de ("timers: Posix interface for alarm-timers") Reported-by: Team OWL337 Signed-off-by: Thomas Gleixner Cc: John Stultz Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1807020926360.1595@nanos.tec.linutronix.de commit 78c9c4dfbf8c04883941445a195276bb4bb92c76 Author: Thomas Gleixner Date: Tue Jun 26 15:21:32 2018 +0200 posix-timers: Sanitize overrun handling The posix timer overrun handling is broken because the forwarding functions can return a huge number of overruns which does not fit in an int. As a consequence timer_getoverrun(2) and siginfo::si_overrun can turn into random number generators. The k_clock::timer_forward() callbacks return a 64 bit value now. Make k_itimer::ti_overrun[_last] 64bit as well, so the kernel internal accounting is correct. 3Remove the temporary (int) casts. Add a helper function which clamps the overrun value returned to user space via timer_getoverrun(2) or siginfo::si_overrun limited to a positive value between 0 and INT_MAX. INT_MAX is an indicator for user space that the overrun value has been clamped. Reported-by: Team OWL337 Signed-off-by: Thomas Gleixner Acked-by: John Stultz Cc: Peter Zijlstra Cc: Michael Kerrisk Link: https://lkml.kernel.org/r/20180626132705.018623573@linutronix.de commit 6fec64e1c92d5c715c6d0f50786daa7708266bde Author: Thomas Gleixner Date: Tue Jun 26 15:21:31 2018 +0200 posix-timers: Make forward callback return s64 The posix timer ti_overrun handling is broken because the forwarding functions can return a huge number of overruns which does not fit in an int. As a consequence timer_getoverrun(2) and siginfo::si_overrun can turn into random number generators. As a first step to address that let the timer_forward() callbacks return the full 64 bit value. Cast it to (int) temporarily until k_itimer::ti_overrun is converted to 64bit and the conversion to user space visible values is sanitized. Reported-by: Team OWL337 Signed-off-by: Thomas Gleixner Acked-by: John Stultz Cc: Peter Zijlstra Cc: Michael Kerrisk Link: https://lkml.kernel.org/r/20180626132704.922098090@linutronix.de commit a1d0015423920672c3f32e69bd9feef2ec629b57 Author: Bastian Stender Date: Fri Jun 8 11:06:39 2018 +0200 cpufreq: imx6q/thermal: imx: register cooling device depending on OF The cooling device should be part of the i.MX cpufreq driver, but it cannot be removed for the sake of DT stability. So turn the cooling device registration into a separate function and perform the registration only if the CPU OF node does not have the #cooling-cells property. Use of_cpufreq_power_cooling_register in imx_thermal code to link the cooling device to the device tree node provided. This makes it possible to bind the cpufreq cooling device to a custom thermal zone via a cooling-maps entry like: cooling-maps { map0 { trip = <&board_alert>; cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; }; }; Assuming a cpu node exists with label "cpu0" and #cooling-cells property. Signed-off-by: Bastian Stender Reviewed-by: Lucas Stach Signed-off-by: Rafael J. Wysocki commit 1111b7836c80ec4094318e1dfb3a5abe6df95afb Author: Xie Yisheng Date: Thu May 31 19:11:15 2018 +0800 cpufreq: intel_pstate: use match_string() helper match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Reviewed-by: Andy Shevchenko Signed-off-by: Yisheng Xie Acked-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 0cc3cd21657be04cb0559fe8063f2130493f92cf Author: Thomas Gleixner Date: Fri Jun 29 16:05:48 2018 +0200 cpu/hotplug: Boot HT siblings at least once Due to the way Machine Check Exceptions work on X86 hyperthreads it's required to boot up _all_ logical cores at least once in order to set the CR4.MCE bit. So instead of ignoring the sibling threads right away, let them boot up once so they can configure themselves. After they came out of the initial boot stage check whether its a "secondary" sibling and cancel the operation which puts the CPU back into offline state. Reported-by: Dave Hansen Signed-off-by: Thomas Gleixner Tested-by: Tony Luck commit 506a66f374891ff08e064a058c446b336c5ac760 Author: Thomas Gleixner Date: Fri Jun 29 16:05:47 2018 +0200 Revert "x86/apic: Ignore secondary threads if nosmt=force" Dave Hansen reported, that it's outright dangerous to keep SMT siblings disabled completely so they are stuck in the BIOS and wait for SIPI. The reason is that Machine Check Exceptions are broadcasted to siblings and the soft disabled sibling has CR4.MCE = 0. If a MCE is delivered to a logical core with CR4.MCE = 0, it asserts IERR#, which shuts down or reboots the machine. The MCE chapter in the SDM contains the following blurb: Because the logical processors within a physical package are tightly coupled with respect to shared hardware resources, both logical processors are notified of machine check errors that occur within a given physical processor. If machine-check exceptions are enabled when a fatal error is reported, all the logical processors within a physical package are dispatched to the machine-check exception handler. If machine-check exceptions are disabled, the logical processors enter the shutdown state and assert the IERR# signal. When enabling machine-check exceptions, the MCE flag in control register CR4 should be set for each logical processor. Reverting the commit which ignores siblings at enumeration time solves only half of the problem. The core cpuhotplug logic needs to be adjusted as well. This thoughtful engineered mechanism also turns the boot process on all Intel HT enabled systems into a MCE lottery. MCE is enabled on the boot CPU before the secondary CPUs are brought up. Depending on the number of physical cores the window in which this situation can happen is smaller or larger. On a HSW-EX it's about 750ms: MCE is enabled on the boot CPU: [ 0.244017] mce: CPU supports 22 MCE banks The corresponding sibling #72 boots: [ 1.008005] .... node #0, CPUs: #72 That means if an MCE hits on physical core 0 (logical CPUs 0 and 72) between these two points the machine is going to shutdown. At least it's a known safe state. It's obvious that the early boot can be hit by an MCE as well and then runs into the same situation because MCEs are not yet enabled on the boot CPU. But after enabling them on the boot CPU, it does not make any sense to prevent the kernel from recovering. Adjust the nosmt kernel parameter documentation as well. Reverts: 2207def700f9 ("x86/apic: Ignore secondary threads if nosmt=force") Reported-by: Dave Hansen Signed-off-by: Thomas Gleixner Tested-by: Tony Luck commit d053d639f00c58122ac0e3fe3a08aa8dc2a08ce6 Author: Vasily Gorbik Date: Fri Jun 29 17:32:09 2018 +0200 s390/tools: fix gcc 8 stringop-truncation warnings Replace strncpy which has been used to copy a substring into buf without NUL-termination with memcpy to avoid the following gcc 8 warnings: arch/s390/tools/gen_opcode_table.c: In function ‘add_to_group.isra.4’: arch/s390/tools/gen_opcode_table.c:260:2: warning: ‘strncpy’ output may be truncated copying 2 bytes from a string of length 19 [-Wstringop-truncation] strncpy(group->opcode, insn->opcode, 2); In function ‘print_opcode_table’, inlined from ‘main’ at arch/s390/tools/gen_opcode_table.c:333:2: arch/s390/tools/gen_opcode_table.c:286:4: warning: ‘strncpy’ output may be truncated copying 2 bytes from a string of length 19 [-Wstringop-truncation] strncpy(opcode, insn->opcode, 2); Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 627c9b62058ebfd368b7411e7ea5a27df48486c8 Author: Vasily Gorbik Date: Mon Jun 25 13:59:35 2018 +0200 s390/boot: block uncompressed vmlinux booting attempts Since the plain vmlinux ELF file no longer carries all necessary parts for starting up (like the entry point and decompressor), add a check which would block boot process and encourage users to use bzImage or arch/s390/boot/compressed/vmlinux instead. The check relies on s390 linux entry point ABI definition, which is only present in bzImage and arch/s390/boot/compressed/vmlinux. Reported-by: Guenter Roeck Tested-by: Guenter Roeck Acked-by: Cornelia Huck Acked-by: Christian Borntraeger Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 9acdb3bb070167c257252e131f56fb8daaa99766 Author: Vasily Gorbik Date: Thu Jun 28 13:16:14 2018 +0200 s390/monwriter: fix gcc 8 stringop-truncation warning The following gcc warning is issued for strncpy which is used to deliberately avoid string NUL-termination. Reuse memcpy to avoid the warning. inlined from 'monwrite_diag' at drivers/s390/char/monwriter.c:64:2: ./include/linux/string.h:246:9: warning: '__builtin_strncpy' output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] Reviewed-by: Gerald Schaefer Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 276d605081fbbc96be02318abb36119625b47bb3 Author: Vasily Gorbik Date: Thu Jun 28 13:28:37 2018 +0200 s390/tape: fix gcc 8 stringop-truncation warning Replace strncpy which is used to deliberately avoid string NUL-termination with memcpy. This allows to get rid of gcc 8 stringop-truncation warning: inlined from 'ext_to_int_kekl' at drivers/s390/char/tape_3590.c:123:2: ./include/linux/string.h:246:9: warning: '__builtin_strncpy' output may be truncated copying 64 bytes from a string of length 64 [-Wstringop-truncation] Also replaces "for" loop on memset. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 5d2f6e26b318a41e4e588bb270377da13b78b3c8 Author: Vasily Gorbik Date: Mon Jun 18 22:49:32 2018 +0200 s390/tape: fix stringop-truncation gcc 8 warnings Use strlcpy to make sure strings are NUL-terminated. Fixes the following gcc 8 warning: inlined from 'register_tape_dev' at drivers/s390/char/tape_class.c:57:2: ./include/linux/string.h:246:9: warning: '__builtin_strncpy' specified bound 32 equals destination size [-Wstringop-truncation] Acked-by: Martin Schwidefsky Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 3ad4c05a53b5f816fb0480ca0c55cc7957bbf5f1 Author: Vasily Gorbik Date: Thu Jun 28 13:12:27 2018 +0200 s390: align struct lowcore to double page size Aligning struct lowcore to double page size allows to get rid of this gcc warning: In file included from ./arch/s390/include/asm/setup.h:56, from ./arch/s390/include/asm/page.h:36, from ./arch/s390/include/asm/user.h:11, from ./include/linux/user.h:1, from ./include/linux/elfcore.h:5, from ./include/linux/crash_core.h:6, from ./include/linux/kexec.h:18, from arch/s390/purgatory/purgatory.c:10: ./arch/s390/include/asm/lowcore.h:189:1: warning: alignment 1 of 'struct lowcore' is less than 8 [-Wpacked-not-aligned] } __packed; Acked-by: Christian Borntraeger Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 2d6f74f797f26e14bdd672b3547ad29199bbb6b8 Author: Vasily Gorbik Date: Thu Jun 28 07:39:24 2018 +0200 s390/decompressor: correct EXCLUDE_FILE construct The following linker construct is problematic with linkers of binutils < 2.28: EXCLUDE_FILE (*piggy.o) *(.rodata.*) from 8f1732fc2a11dc of binutils: "though the linker accepts this without complaint the EXCLUDE_FILE part is silently ignored and has no effect." Silent ignoring of EXCLUDE_FILE construct made .rodata.compressed be part of .rodata, and in case of .rodata.compressed following some unaligned data, input_len would also become unaligned. from arch/s390/boot/compressed/vmlinux.map: .rodata.compressed 0x0000000000012fea 0x4d57e7 arch/s390/boot/compressed/piggy.o 0x0000000000012fea input_len 0x0000000000012fee input_data input_len is later used here: arch/s390/boot/compressed/misc.c:113 __decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error); asm generated by gcc looks like: .loc 3 113 0 egfrl %r11,input_len from what assembler generates invalid (the second operand must be aligned on a doubleword boundary): 0x00000000000129b4 <+148>: c4 bc 00 00 03 1b lgfrl %r11,0x12fea hence specification exception is recognized. To avoid an issue use EXCLUDE_FILE construct which is recognized by older linkers (since at least binutils-2_11) *(EXCLUDE_FILE (*piggy.o) .rodata.compressed) Also ensure that .rodata.compressed is at least doubleword aligned. Fixes: 89b5202e81df ("s390/decompressor: support uncompressed kernel") Reported-by: Halil Pasic Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit f56506ef3061f3362bb35a396f6951f7035b8294 Author: Vasily Gorbik Date: Wed Jun 27 17:53:40 2018 +0200 s390: move _text to an actual .text start Since the uncompressed image .text section starts at 0x100000 now there is no need to redefine _text to something else to make perf happy. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit c949786450d6e19ef21f0837488a3dc1554131d6 Author: Vasily Gorbik Date: Wed Jun 27 17:32:53 2018 +0200 s390: correct _stext offset Avoid unnecessary rewrite of psw and merge _stext into startup_continue. This allows to move _stext definition to vmlinux.lds.S, where _etext is also defined and set _stext to the actual beginning of .text at 0x100000. This fixes the problem with setting the last .text page as not-executable due to vmem_map_init relying on page alinged _stext and _etext. Fixes: bd79d6632958 ("s390/decompressor: trim the kernel image up to 1M") Reported-by: Nils Hoppmann Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 183ab05ff285555c56b7f00bb4fd52d80a9513fb Author: Vasily Gorbik Date: Wed Jun 27 17:10:14 2018 +0200 s390: get rid of the first mb of uncompressed image Instead of generating uncompressed kernel image starting at 0, filling first mb with zeros (with ".org 0x100000") and then trimming it off from vmlinux.bin before compression, simply generate a kernel image starting from 0x100000. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 8e533fdd092598db73312af801dbddea8cab6f9c Author: Vasily Gorbik Date: Wed Jun 27 16:59:26 2018 +0200 s390: remove unused _ehead symbol Since startup code now reserves memory ranges [0, PARMAREA_END] and [_stext, ] _ehead symbol is not used and could be cleaned up. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 94cbc0ea163f58ec3ce167a1ccbdf55ff1e88111 Author: Vasily Gorbik Date: Wed Jun 27 14:58:46 2018 +0200 s390: put expoline execute-trampolines into .text section Currently none of the vmlinux linker script patterns in .text section match expoline execute-trampolines, and they end up as separate sections: .text.__s390_indirect_jump_r1, .text.__s390x_indirect_jump_r1use_r9, .text.__s390x_indirect_branch_4_1use_6, ... Add a pattern to match them all. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 4778dc08ef99825d2931d44888fda8d49319d93a Author: Vasily Gorbik Date: Wed Jun 27 14:46:57 2018 +0200 s390/decompressor: discard ___kcrctab section ___kcrctab section is not used during the decompressor phase and could be discarded to save the memory. It is currently generated due to lib/mem.S usage, which exports few symbols. Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 1fee96264a718fc5a2a94a09d5c7e2915a1c76b2 Author: Harald Freudenberger Date: Wed Jun 27 09:50:43 2018 +0200 s390/zcrypt: add copy_from_user length plausibility checks There have been identified some places in the zcrypt device driver where copy_from_user() is called but the length value is not explicitly checked. So now some plausibility checks and comments have been introduced there. Signed-off-by: Harald Freudenberger Acked-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit ad82a928eb58471adb2dec2001f5fbe57e5ee4b5 Author: Vasily Gorbik Date: Mon Jun 18 17:51:29 2018 +0200 s390/perf: fix gcc 8 array-bounds warning arch/s390/kernel/perf_regs.c:36:19: warning: array subscript 16 is above array bounds of 'long unsigned int[16]' [-Warray-bounds] return regs->gprs[idx]; gcc tries to be smart here and since there is a condition: if (idx >= PERF_REG_S390_R0 && idx <= PERF_REG_S390_R15) return regs->gprs[idx]; which covers all possible array subscripts, it gives the warning for the last function return statement: return regs->gprs[idx]; which in presence of that condition does not really make sense and should be replaced with "return 0;" Also move WARN_ON_ONCE((u32)idx >= PERF_REG_S390_MAX) to the end of the function. Reviewed-by: Hendrik Brueckner Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit f6ea4d25e95972f482e14cdcefaa0789e6158d35 Author: Vasily Gorbik Date: Mon Jun 18 16:50:42 2018 +0200 s390: fix gcc 8 stringop-truncation warnings in proc handlers arch/s390/kernel/topology.c:591:3: warning: 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length [-Wstringop-truncation] strncpy(buf, topology_is_enabled() ? "1\n" : "0\n", ARRAY_SIZE(buf)); arch/s390/appldata/appldata_base.c:326:3: warning: 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length [-Wstringop-truncation] strncpy(buf, ops->active ? "1\n" : "0\n", ARRAY_SIZE(buf)); arch/s390/appldata/appldata_base.c:217:3: warning: 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length [-Wstringop-truncation] strncpy(buf, appldata_timer_active ? "1\n" : "0\n", ARRAY_SIZE(buf)); To avoid the warning, just reuse memcpy. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 4e0f5e916f7f4623b312e4fcf9f9fe45c4bea290 Author: Vasily Gorbik Date: Sun Jun 17 12:18:56 2018 +0200 s390/dasd: fix gcc 8 stringop-truncation warning drivers/s390/block/dasd_alias.c:711:2: warning: 'strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation] strncpy((char *) &cqr->magic, "ECKD", 4); Replace strncpy to int as a buffer with memcpy. Acked-by: Stefan Haberland Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit c6756b7d0c5d57233c985dd1e50ce7b33a15ce6b Author: Vasily Gorbik Date: Sun Jun 17 11:56:17 2018 +0200 s390/dasd,zfcp: fix gcc 8 stringop-truncation warnings ccw "busid" should always be NUL-terminated, as evident from e.g. get_ccwdev_by_busid doing "return (strcmp(bus_id, dev_name(dev)) == 0)". Replace all strncpy initializing busid with strlcpy. This fixes the following gcc 8 warnings: drivers/s390/scsi/zfcp_aux.c:104:2: warning: 'strncpy' specified bound 20 equals destination size [-Wstringop-truncation] strncpy(busid, token, ZFCP_BUS_ID_SIZE); drivers/s390/block/dasd_eer.c:316:2: warning: 'strncpy' specified bound 10 equals destination size [-Wstringop-truncation] strncpy(header.busid, dev_name(&device->cdev->dev), DASD_EER_BUSID_SIZE); drivers/s390/block/dasd_eer.c:359:2: warning: 'strncpy' specified bound 10 equals destination size [-Wstringop-truncation] strncpy(header.busid, dev_name(&device->cdev->dev), DASD_EER_BUSID_SIZE); drivers/s390/block/dasd_devmap.c:429:3: warning: 'strncpy' specified bound 20 equals destination size [-Wstringop-truncation] strncpy(new->bus_id, bus_id, DASD_BUS_ID_SIZE); Acked-by: Stefan Haberland Acked-by: Steffen Maier Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 6b2ddf33baec23dace85bd647e3fc4ac070963e8 Author: Vasily Gorbik Date: Sun Jun 17 00:30:43 2018 +0200 s390/extmem: fix gcc 8 stringop-overflow warning arch/s390/mm/extmem.c: In function '__segment_load': arch/s390/mm/extmem.c:436:2: warning: 'strncat' specified bound 7 equals source length [-Wstringop-overflow=] strncat(seg->res_name, " (DCSS)", 7); What gcc complains about here is the misuse of strncat function, which in this case does not limit a number of bytes taken from "src", so it is in the end the same as strcat(seg->res_name, " (DCSS)"); Keeping in mind that a res_name is 15 bytes, strncat in this case would overflow the buffer and write 0 into alignment byte between the fields in the struct. To avoid that increasing res_name size to 16, and reusing strlcat. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit d642d6262f4fcfa5d200ec6e218c17f0c15b3390 Author: Vasily Gorbik Date: Mon Jun 25 14:30:42 2018 +0200 s390/scm_blk: correct numa_node in scm_blk_dev_setup The numa_node field of the tag_set struct has to be explicitly initialized, otherwise it stays as 0, which is a valid numa node id and cause memory allocation failure if node 0 is offline. Acked-by: Sebastian Ott Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit b17e3abb0af404cb62ad4ef1a5962f58b06e2b78 Author: Vasily Gorbik Date: Sun Jun 24 09:21:59 2018 +0200 s390/dasd: correct numa_node in dasd_alloc_queue The numa_node field of the tag_set struct has to be explicitly initialized, otherwise it stays as 0, which is a valid numa node id and cause memory allocation failure if node 0 is offline. Acked-by: Stefan Haberland Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 0d7fa8fa9cbc659ad825aacc3dc53e03400894ea Author: Radek Dostál Date: Mon Jul 2 09:28:49 2018 +0200 staging: fbtft: indent fbtft_device_display - last entry - pdev - dev The dev section was opening curly bracket, but not adding ident, which resulted in two times "}," after each other with same indentation. Add ident at the right place fixes this problem. This formatting issue is not detectable by checkpatch.pl Signed-off-by: Radek Dostál Signed-off-by: Greg Kroah-Hartman commit 7651f3abf88e310579afaa56535438df5a1e7cd9 Author: Michael Straube Date: Sat Jun 30 20:14:40 2018 +0200 staging: rtl8188eu: fix block comments - coding style Write multiple single line comments as block comments to follow kernel coding style and improve readability. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit f33f23048f638c078a83007e7678872756174d42 Author: Michael Straube Date: Sat Jun 30 20:14:39 2018 +0200 staging: rtl8188eu: move return type to functions definition line The return type of a function should be on the same line as the definition. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 3a26036ff91a2a5ec2b639e9cd3c0241a7c50682 Author: Michael Straube Date: Sat Jun 30 20:14:38 2018 +0200 staging: rtl8188eu: reorder switch cases and remove default break Reorder the cases of a switch statement to be in ascending order. Remove unrequired break from default case. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 9d4bedcbf2ad15e9090b8f56a40c77d1c23986b0 Author: Michael Straube Date: Sat Jun 30 13:36:28 2018 +0200 staging: rtl8723bs: simplify if else statement Simplify if else statement to a single function call by passing the variable. Suggested-by: Andreas Schwab Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit d2ab9916f0122c77cc9bbb8b74c6a6dde458b4a2 Author: Michael Straube Date: Sat Jun 30 13:36:27 2018 +0200 staging: rtl8723bs: fix comparsion to true/false and brace issues Use if(x) and if(!x) instead of comparsion to true/false. Reported by checkpatch. Remove unrequired braces from single if else statement. Add missing space after else: else{ -> else { Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 790d5d2a7e9b494272dcf8ddc44f12aec4d36b35 Author: John Whitmore Date: Fri Jun 29 19:10:06 2018 +0100 staging: rtl8192u Remove redundant #include directive The file includes the file rtl819x_HT.h, which has already been included by the previously included file ieee80211.h Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 698b47cb2204e7ee24a02a58fdf414f1d9139e02 Author: Ivan Safonov Date: Sat Jun 30 20:25:29 2018 +0300 staging:r8188eu: Use lib80211 to encrypt (WEP) tx frames Put data to skb, decrypt with lib80211_crypt_wep, and place back to tx buffer. Signed-off-by: Ivan Safonov Signed-off-by: Greg Kroah-Hartman commit 0a561b0f91d2820c6054eb620af755b9dd39b35e Author: Michael Straube Date: Thu Jun 28 19:02:52 2018 +0200 staging: rtl8723bs: remove pointless if else in rtw_sdio_resume() Whether any of the conditions is true or not, the return variable is always set to rtw_resume_process(padapter). Replace the if else construct with a single call to rtw_resume_process(). Also remove the now unused local variable pwrpriv. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 3b41f9bc8076f0b6c323b3af2f2b05152ef54c0f Author: Michael Straube Date: Fri Jun 29 20:59:44 2018 +0200 staging: rtl8188eu: remove unnecessary parentheses Remove unnecessary parentheses as reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 24e66e98683859e930cb08837d2077e9c47461c7 Author: Michael Straube Date: Sat Jun 30 10:24:52 2018 +0200 staging: rtl8723bs: fix line over 80 characters Fix line over 80 characters by replacing tab with space. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 699ed92dce9444f1d5e6713e648b4a76c435183c Author: Michael Straube Date: Sat Jun 30 16:59:41 2018 +0200 staging: rtl8188eu: remove rtw_ioctl_rtl.h The header rtw_ioctl_rtl.h is not used anywhere. Running 'grep -r rtw_ioctl_rtl *' from kernel root directory returns nothing, remove the file. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit fd29edc7232bc19f969e8f463138afc5472b3d5f Author: Guenter Roeck Date: Sun Jul 1 13:57:24 2018 -0700 staging: speakup: Replace strncpy with memcpy gcc 8.1.0 generates the following warnings. drivers/staging/speakup/kobjects.c: In function 'punc_store': drivers/staging/speakup/kobjects.c:522:2: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length drivers/staging/speakup/kobjects.c:504:6: note: length computed here drivers/staging/speakup/kobjects.c: In function 'synth_store': drivers/staging/speakup/kobjects.c:391:2: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length drivers/staging/speakup/kobjects.c:388:8: note: length computed here Using strncpy() is indeed less than perfect since the length of data to be copied has already been determined with strlen(). Replace strncpy() with memcpy() to address the warning and optimize the code a little. Signed-off-by: Guenter Roeck Reviewed-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman commit 796422f227eef662256dcf74f609abd48cfd1cc9 Author: Daniel Vetter Date: Thu May 3 16:25:51 2018 +0200 dma-fence: Allow wait_any_timeout for all fences When this was introduced in commit a519435a96597d8cd96123246fea4ae5a6c90b02 Author: Christian König Date: Tue Oct 20 16:34:16 2015 +0200 dma-buf/fence: add fence_wait_any_timeout function v2 there was a restriction added that this only works if the dma-fence uses the dma_fence_default_wait hook. Which works for amdgpu, which is the only caller. Well, until you share some buffers with e.g. i915, then you get an -EINVAL. But there's really no reason for this, because all drivers must support callbacks. The special ->wait hook is only as an optimization; if the driver needs to create a worker thread for an active callback, then it can avoid to do that if it knows that there's a process context available already. So ->wait is just an optimization, just using the logic in dma_fence_default_wait() should work for all drivers. Let's remove this restriction. Reviewed-by: Christian König Signed-off-by: Daniel Vetter Cc: Sumit Semwal Cc: Gustavo Padovan Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Cc: Christian König Cc: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180503142603.28513-4-daniel.vetter@ffwll.ch commit c701317a3eb8c012364a8d468f20eabf6df1ad77 Author: Daniel Vetter Date: Fri May 4 16:10:34 2018 +0200 dma-fence: Make ->enable_signaling optional Many drivers have a trivial implementation for ->enable_signaling. Let's make it optional by assuming that signalling is already available when the callback isn't present. v2: Don't do the trick to set the ENABLE_SIGNAL_BIT unconditionally, it results in an expensive spinlock take for everyone. Instead just check if the callback is present. Suggested by Maarten. Also move misplaced kerneldoc hunk to the right patch. Cc: Maarten Lankhorst Reviewed-by: Christian König (v1) Reviewed-by: Maarten Lankhorst Signed-off-by: Daniel Vetter Cc: Sumit Semwal Cc: Gustavo Padovan Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20180504141034.27727-1-daniel.vetter@ffwll.ch commit 1b48b7202c43e41c9f05d39901567dbcad5dc307 Author: Daniel Vetter Date: Thu May 3 16:25:49 2018 +0200 dma-fence: remove fill_driver_data callback Noticed while I was typing docs. Entirely unused. v2: Remove reference in @timeline_value_str too. While at it clarify why timeline_value_str has a fence parameter - we don't have an explicit timeline structure unfortunately. Cc: Eric Anholt Reviewed-by: Eric Anholt Reviewed-by: Christian König (v1) Cc: Christian König (v1) Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180503142603.28513-2-daniel.vetter@ffwll.ch commit 243f37cb1f63dfdc4451802aa519fb3c3d9c9d32 Author: Chris Packham Date: Mon Jun 25 10:44:46 2018 +1200 mtd: rawnand: micron: add fixup for ONFI revision Some Micron NAND chips (MT29F1G08ABAFAWP-ITE:F) report 00 00 for the revision number field of the ONFI parameter page. Rather than rejecting these outright assume ONFI version 1.0 if the revision number is 00 00. Signed-off-by: Chris Packham Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 872b71ff084ab125c68073d9e69acfd7095f2015 Author: Chris Packham Date: Mon Jun 25 10:44:45 2018 +1200 mtd: rawnand: add defines for ONFI version bits Add defines for the ONFI version bits and use them in nand_flash_detect_onfi(). Signed-off-by: Chris Packham Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 00ce4e039ad5bded462931606c3063ff691964b7 Author: Chris Packham Date: Mon Jun 25 10:44:44 2018 +1200 mtd: rawnand: add manufacturer fixup for ONFI parameter page This is called after the ONFI parameter page checksum is verified and allows us to override the contents of the parameter page. Suggested-by: Boris Brezillon Signed-off-by: Chris Packham Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit ed6d0285f81cbf27d8294b47ac0bc8f28041b186 Author: Chris Packham Date: Mon Jun 25 10:44:43 2018 +1200 mtd: rawnand: marvell: Handle on-die ECC >From the controllers point of view this is the same as no or software only ECC. Signed-off-by: Chris Packham Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit d7d9f8ec77fe90472a649d1c2adba43a2e306eeb Author: Stefan Agner Date: Sun Jun 24 23:27:25 2018 +0200 mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver Add support for the NAND flash controller found on NVIDIA Tegra 2 SoCs. This implementation does not make use of the command queue feature. Regular operations using ->exec_op() use PIO mode for data transfers. Raw, ECC and OOB read/writes make use of the DMA mode for data transfer. Signed-off-by: Lucas Stach Signed-off-by: Stefan Agner Reviewed-by: Dmitry Osipenko Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit f8a53187a25fdb9fb9b3cbde63f9abdc5c0b7dec Author: Stefan Agner Date: Sun Jun 24 23:27:24 2018 +0200 dt-bindings: mtd: add tegra NAND controller binding This adds the devicetree binding for the Tegra 2 NAND flash controller. Signed-off-by: Lucas Stach Signed-off-by: Stefan Agner Reviewed-by: Boris Brezillon Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal commit f922bd798bb94e0adcce26ddd811245443173268 Author: Stefan Agner Date: Sun Jun 24 23:27:23 2018 +0200 mtd: rawnand: add an option to specify NAND chip as a boot device Allow to define a NAND chip as a boot device. This can be helpful for the selection of the ECC algorithm and strength in case the boot ROM supports only a subset of controller provided options. Signed-off-by: Stefan Agner Reviewed-by: Boris Brezillon Acked-by: Rob Herring Signed-off-by: Miquel Raynal commit 9a69f5087ccc20bb411025decab455836df04168 Author: Simon Que Date: Fri Jun 29 22:49:38 2018 -0400 drivers/staging: Gasket driver framework + Apex driver The Gasket (Google ASIC Software, Kernel Extensions, and Tools) kernel framework is a generic, flexible system that supports thin kernel drivers. Gasket kernel drivers are expected to handle opening and closing devices, mmap'ing BAR space as requested, a small selection of ioctls, and handling page table translation (covered below). Any other functions should be handled by userspace code. The Gasket common module is not enough to run a device. In order to customize the Gasket code for a given piece of hardware, a device specific module must be created. At a minimum, this module must define a struct gasket_driver_desc containing the device-specific data for use by the framework; in addition, the module must declare an __init function that calls gasket_register_device with the module's gasket_driver_desc struct. Finally, the driver must define an exit function that calls gasket_unregister_device with the module's gasket_driver_desc struct. One of the core assumptions of the Gasket framework is that precisely one process is allowed to have an open write handle to the device node at any given time. (That process may, once it has one write handle, open any number of additional write handles.) This is accomplished by tracking open and close data for each driver instance. Signed-off-by: Rob Springer Signed-off-by: John Joseph Signed-off-by: Simon Que Signed-off-by: Greg Kroah-Hartman commit f308d7353d1f5c3ddedc784a367edc72fc51bbaa Author: Stefan Agner Date: Sun Jun 24 23:27:22 2018 +0200 mtd: rawnand: add Reed-Solomon error correction algorithm Add Reed-Solomon (RS) to the enumeration of ECC algorithms. Signed-off-by: Stefan Agner Reviewed-by: Boris Brezillon Acked-by: Rob Herring Signed-off-by: Miquel Raynal commit 16c4fba03a45ac8c6048a96e02abc933e1354852 Author: Martin Blumenstingl Date: Sun Jun 24 22:53:55 2018 +0200 mtd: rawnand: hynix: fix decoding the OOB size on H27UCG8T2BTR The datasheet of the H27UCG8T2BTR states that this chip has a page size of "16,384 + 1,280(Spare) bytes". The description of the "4th Byte of Device Identifier Description" indicates that bits 6, 3 and 2 are encoding the "Redundant Area Size / 8KB", where 640 bytes is a value of 0x6 (110 in binary notation). hynix_nand_extract_oobsize decodes an OOB size of 640 bytes for this chip. Kernel boot log extract before this patch: nand: Could not find valid ONFI parameter page; aborting nand: device found, Manufacturer ID: 0xad, Chip ID: 0xde nand: Hynix NAND 8GiB 3,3V 8-bit nand: 8192 MiB, MLC, erase size: 4096 KiB, page size: 16384, OOB size: 640 However, based on the description in the datasheet we need to multiply the OOB size with 2, because it's "640 spare bytes per 8192 bytes page size" and this NAND chip has a page size of 16384 (= 2 * 8192). After this patch the kernel boot log reports: nand: Could not find valid ONFI parameter page; aborting nand: device found, Manufacturer ID: 0xad, Chip ID: 0xde nand: Hynix NAND 8GiB 3,3V 8-bit nand: 8192 MiB, MLC, erase size: 4096 KiB, page size: 16384, OOB size: 1280 Signed-off-by: Martin Blumenstingl Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit ac8cf0b9e784acaf6fa20de89cb23b156834ca01 Author: Boris Brezillon Date: Wed Jun 20 09:44:43 2018 +0200 mtd: rawnand: micron: Update ecc_stats.corrected Even if we can't update ecc_stats.corrected with an accurate value we should at least increase the number of bitflips so that MTD users can know that there was some bitflips. Just add chip->ecc.strength to mtd->ecc_stats.corrected which should account for the worst case situation. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit efc6362c6f8c1e74b340e2611f1b35e7d557ce7b Author: Peter Rosin Date: Thu Mar 29 15:10:54 2018 +0200 mtd: rawnand: atmel: add module param to avoid using dma On a sama5d31 with a Full-HD dual LVDS panel (132MHz pixel clock) NAND flash accesses have a tendency to cause display disturbances. Add a module param to disable DMA from the NAND controller, since that fixes the display problem for me. Signed-off-by: Peter Rosin Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit ee55fe552fcd8dcdafc52155ba515548c6538647 Author: Jason Cooper Date: Sun Jul 1 14:48:14 2018 -0400 staging/skein: Remove Skein and Threefish code It's been four years since this was added. In the interim, skein has not seen any mainstream adoption. Same with the threefish block cipher upon which it's based. In the discussion over which hash algorithm will replace SHA1 in git, it's not one of the contenders. There's absolutely no reason to think that there is anything wrong with Skein or Threefish. The only reason for this removal is a lack of adoption. If a real user comes forward, I'd be happy to assist with integrating this code into mainline. Signed-off-by: Jason Cooper Signed-off-by: Greg Kroah-Hartman commit 67cd0eec5b62e0c6715d4ff5d43a80fa8edeee6a Author: Niklas Cassel Date: Fri Jun 29 19:01:01 2018 +0200 rpmsg: smd: Add missing include of sizes.h Add missing include of sizes.h. drivers/rpmsg/qcom_smd.c: In function ‘qcom_smd_channel_open’: drivers/rpmsg/qcom_smd.c:809:36: error: ‘SZ_4K’ undeclared (first use in this function) bb_size = min(channel->fifo_size, SZ_4K); ^~~~~ Signed-off-by: Niklas Cassel Signed-off-by: Bjorn Andersson commit 0bc26314957504e82dc9e3704422959db99b38ef Author: Stephen Rothwell Date: Fri Jun 29 14:54:04 2018 +1000 usb: update for tcpci drivers moving out of staging Signed-off-by: Stephen Rothwell Signed-off-by: Greg Kroah-Hartman commit 714c95ce8bad7a2042006fc9a2079fcd469b6a03 Merge: aaf3f4e925dc 021c91791a5e Author: Greg Kroah-Hartman Date: Mon Jul 2 08:28:32 2018 +0200 Merge 4.18-rc3 into usb-next We want the USB and other fixes in here as well to make merges and testing easier. Signed-off-by: Greg Kroah-Hartman commit 16ecf49c10a1e8ecf917f91b93dd85624349e930 Merge: 708d0bff9121 021c91791a5e Author: Greg Kroah-Hartman Date: Mon Jul 2 08:23:43 2018 +0200 Merge 4.18-rc3 into tty-next We want ths tty core changes in here as well. Signed-off-by: Greg Kroah-Hartman commit 7f5d8f711687fb6ad39ece9dd8e76dc6b196ac5c Merge: a98a5c27b54e 021c91791a5e Author: Greg Kroah-Hartman Date: Mon Jul 2 08:21:54 2018 +0200 Merge 4.18-rc3 into staging-next We want the staging/iio fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 97680ade43dc6a8ad2451389d66b0492458196d4 Merge: 1a84d7fdb5fc a4fd1f4babe3 Author: David S. Miller Date: Mon Jul 2 09:06:24 2018 +0900 Merge branch 'xps-symmretric-queue-selection' Amritha Nambiar says: ==================== Symmetric queue selection using XPS for Rx queues This patch series implements support for Tx queue selection based on Rx queue(s) map. This is done by configuring Rx queue(s) map per Tx-queue using sysfs attribute. If the user configuration for Rx queues does not apply, then the Tx queue selection falls back to XPS using CPUs and finally to hashing. XPS is refactored to support Tx queue selection based on either the CPUs map or the Rx-queues map. The config option CONFIG_XPS needs to be enabled. By default no receive queues are configured for the Tx queue. - /sys/class/net//queues/tx-*/xps_rxqs A set of receive queues can be mapped to a set of transmit queues (many:many), although the common use case is a 1:1 mapping. This will enable sending packets on the same Tx-Rx queue association as this is useful for busy polling multi-threaded workloads where it is not possible to pin the threads to a CPU. This is a rework of Sridhar's patch for symmetric queueing via socket option: https://www.spinics.net/lists/netdev/msg453106.html Testing Hints: Kernel: Linux 4.17.0-rc7+ Interface: driver: ixgbe version: 5.1.0-k firmware-version: 0x00015e0b Configuration: ethtool -L $iface combined 16 ethtool -C $iface rx-usecs 1000 sysctl net.core.busy_poll=1000 ATR disabled: ethtool -K $iface ntuple on Workload: Modified memcached that changes the thread selection policy to be based on the incoming rx-queue of a connection using SO_INCOMING_NAPI_ID socket option. The default is round-robin. Default: No rxqs_map configured Symmetric queues: Enable rxqs_map for all queues 1:1 mapped to Tx queue System: Architecture: x86_64 CPU(s): 72 Model name: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 16 threads 400K requests/sec ============================= ------------------------------------------------------------------------------- Default Symmetric queues ------------------------------------------------------------------------------- RTT min/avg/max 4/51/2215 2/30/5163 (usec) intr/sec 26655 18606 contextswitch/sec 5145 4044 insn per cycle 0.43 0.72 cache-misses 6.919 4.310 (% of all cache refs) L1-dcache-load- 4.49 3.29 -misses (% of all L1-dcache hits) LLC-load-misses 13.26 8.96 (% of all LL-cache hits) ------------------------------------------------------------------------------- 32 threads 400K requests/sec ============================= ------------------------------------------------------------------------------- Default Symmetric queues ------------------------------------------------------------------------------- RTT min/avg/max 10/112/5562 9/46/4637 (usec) intr/sec 30456 27666 contextswitch/sec 7552 5133 insn per cycle 0.41 0.49 cache-misses 9.357 2.769 (% of all cache refs) L1-dcache-load- 4.09 3.98 -misses (% of all L1-dcache hits) LLC-load-misses 12.96 3.96 (% of all LL-cache hits) ------------------------------------------------------------------------------- 16 threads 800K requests/sec ============================= ------------------------------------------------------------------------------- Default Symmetric queues ------------------------------------------------------------------------------- RTT min/avg/max 5/151/4989 9/69/2611 (usec) intr/sec 35686 22907 contextswitch/sec 25522 12281 insn per cycle 0.67 0.74 cache-misses 8.652 6.38 (% of all cache refs) L1-dcache-load- 3.19 2.86 -misses (% of all L1-dcache hits) LLC-load-misses 16.53 11.99 (% of all LL-cache hits) ------------------------------------------------------------------------------- 32 threads 800K requests/sec ============================= ------------------------------------------------------------------------------- Default Symmetric queues ------------------------------------------------------------------------------- RTT min/avg/max 6/163/6152 8/88/4209 (usec) intr/sec 47079 26548 contextswitch/sec 42190 39168 insn per cycle 0.45 0.54 cache-misses 8.798 4.668 (% of all cache refs) L1-dcache-load- 6.55 6.29 -misses (% of all L1-dcache hits) LLC-load-misses 13.91 10.44 (% of all LL-cache hits) ------------------------------------------------------------------------------- v6: - Changed the names of some functions to begin with net_if. - Cleaned up sk_tx_queue_set/sk_rx_queue_set functions. - Added sk_rx_queue_clear to make it consistent with tx_queue_mapping initialization. ==================== Signed-off-by: David S. Miller commit a4fd1f4babe3fac5887faa5b1b88bde4cd4d1b0d Author: Amritha Nambiar Date: Fri Jun 29 21:27:12 2018 -0700 Documentation: Add explanation for XPS using Rx-queue(s) map Signed-off-by: Amritha Nambiar Signed-off-by: David S. Miller commit 8af2c06ff4b144064b51b7f688194474123d9c9c Author: Amritha Nambiar Date: Fri Jun 29 21:27:07 2018 -0700 net-sysfs: Add interface for Rx queue(s) map per Tx queue Extend transmit queue sysfs attribute to configure Rx queue(s) map per Tx queue. By default no receive queues are configured for the Tx queue. - /sys/class/net/eth0/queues/tx-*/xps_rxqs Signed-off-by: Amritha Nambiar Signed-off-by: David S. Miller commit fc9bab24e9c654f62f3d411fc0b041be9e487e9d Author: Amritha Nambiar Date: Fri Jun 29 21:27:02 2018 -0700 net: Enable Tx queue selection based on Rx queues This patch adds support to pick Tx queue based on the Rx queue(s) map configuration set by the admin through the sysfs attribute for each Tx queue. If the user configuration for receive queue(s) map does not apply, then the Tx queue selection falls back to CPU(s) map based selection and finally to hashing. Signed-off-by: Amritha Nambiar Signed-off-by: David S. Miller commit c6345ce7d361dce1b5d02a2181ccb598c27fd7ae Author: Amritha Nambiar Date: Fri Jun 29 21:26:57 2018 -0700 net: Record receive queue number for a connection This patch adds a new field to sock_common 'skc_rx_queue_mapping' which holds the receive queue number for the connection. The Rx queue is marked in tcp_finish_connect() to allow a client app to do SO_INCOMING_NAPI_ID after a connect() call to get the right queue association for a socket. Rx queue is also marked in tcp_conn_request() to allow syn-ack to go on the right tx-queue associated with the queue on which syn is received. Signed-off-by: Amritha Nambiar Signed-off-by: Sridhar Samudrala Signed-off-by: David S. Miller commit 755c31cd85aea35cf7a5e7253851b52c08eff6e9 Author: Amritha Nambiar Date: Fri Jun 29 21:26:51 2018 -0700 net: sock: Change tx_queue_mapping in sock_common to unsigned short Change 'skc_tx_queue_mapping' field in sock_common structure from 'int' to 'unsigned short' type with ~0 indicating unset and other positive queue values being set. This will accommodate adding a new 'unsigned short' field in sock_common in the next patch for rx_queue_mapping. Signed-off-by: Amritha Nambiar Signed-off-by: David S. Miller commit 04157469b7b848f4a9978b63b1ea2ce62ad3a0a3 Author: Amritha Nambiar Date: Fri Jun 29 21:26:46 2018 -0700 net: Use static_key for XPS maps Use static_key for XPS maps to reduce the cost of extra map checks, similar to how it is used for RPS and RFS. This includes static_key 'xps_needed' for XPS and another for 'xps_rxqs_needed' for XPS using Rx queues map. Signed-off-by: Amritha Nambiar Signed-off-by: David S. Miller commit 80d19669ecd34423e85ca04f2210b0e42a47cb16 Author: Amritha Nambiar Date: Fri Jun 29 21:26:41 2018 -0700 net: Refactor XPS for CPUs and Rx queues Refactor XPS code to support Tx queue selection based on CPU(s) map or Rx queue(s) map. Signed-off-by: Amritha Nambiar Signed-off-by: David S. Miller commit e08015e7d6a4b5395e75cc286ab6400667c63dc0 Author: Linus Walleij Date: Thu Jun 21 20:44:50 2018 +0200 drm/pl111: Support Nomadik LCDC variant The Nomadik has a variant of the PL110 known as "Color LCD Controller" LCDC. This variant has the same bit ordering as the DRM subsystem (in difference from the other variants) and adds a few bits for the control of 5551, 565 etc in the control register. Notably it also adds a packed RGB888 24BPP mode. We add support by detecting this variant and also adding a small plug-in that will mux the LCDC out if the ASIC happens to be muxed to the other graphics controller (they are mutually exclusive). Reviewed-by: Eric Anholt Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20180621184450.25377-1-linus.walleij@linaro.org commit 6d8e85ffe17895d7bc632dfbaa9e2e33b22fe873 Author: Nathan Harold Date: Fri Jun 29 15:07:10 2018 -0700 xfrm: Allow Set Mark to be Updated Using UPDSA Allow UPDSA to change "set mark" to permit policy separation of packet routing decisions from SA keying in systems that use mark-based routing. The set mark, used as a routing and firewall mark for outbound packets, is made update-able which allows routing decisions to be handled independently of keying/SA creation. To maintain consistency with other optional attributes, the set mark is only updated if sent with a non-zero value. The per-SA lock and the xfrm_state_lock are taken in that order to avoid a deadlock with xfrm_timer_handler(), which also takes the locks in that order. Signed-off-by: Nathan Harold Signed-off-by: Steffen Klassert commit 2d0b768bd1a8a1b83ac3ce3c5600075ee115fb21 Author: Anson Huang Date: Thu Jun 28 09:04:27 2018 +0800 ARM: dts: imx6sll-evk: enable usdhc3 slot On i.MX6SLL EVK board, SD3 slot can be used for WiFi and other SD accessories, enable it. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 4508a44da371f38a0beceb6ff82028359dd8cdaa Author: Andrey Smirnov Date: Wed Jun 27 21:24:24 2018 -0700 ARM: dts: imx6qdl-zii-rdu2: Populate RAVE SP power button node RAVE SP found on RDU2 implements power button control compatible with the rave-sp-pwrbutton driver. Add a node to make it availible. Cc: Fabio Estevam Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphealy@gmail.com Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 8cbcf1d2dbc006baa42fc1656d6ede1631e72b1c Author: Andrey Smirnov Date: Wed Jun 27 21:24:23 2018 -0700 ARM: dts: imx6qdl-zii-rdu2: Populate RAVE SP backlight node RAVE SP found on RDU2 implements backlight control compatible with the rave-sp-backlight driver. Add a node to make it availible. Cc: Fabio Estevam Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphealy@gmail.com Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit ec84fd24cfaec7bb4782a2983e933cbf8500ab8b Author: Andrey Smirnov Date: Wed Jun 27 21:24:22 2018 -0700 ARM: dts: imx6qdl-zii-rdu2: Populate RAVE SP EEPROM nodes ZII's RDU2s come with two EEPROMs attached to RAVE SP. Add corresponding nodes to make them availible. Cc: Fabio Estevam Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphealy@gmail.com Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 6e1a8a621ed1b9f170172fa13b6855d1b69774ca Author: Andrey Smirnov Date: Wed Jun 27 21:24:21 2018 -0700 ARM: dts: imx51-zii-rdu1: Populate RAVE SP EEPROM nodes ZII's RDU1s come with up to 3 EEPROMs attached to RAVE SP. Add corresponding nodes to make them availible. Cc: Fabio Estevam Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphealy@gmail.com Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 3d177f483e2bc1852e119f9f9a58b7d7d65ef18d Author: Fabio Estevam Date: Tue Jun 26 21:34:22 2018 -0300 ARM: dts: imx53-qsb: Let the codec control MCLK pinctrl The hog pinctrl hog is meant for pins that do not have an associated driver. The MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK pin is the one that provides the MCLK signal to the SGTL5000 codec, so a better represenation is to move it under the codec node. While at it, change the pinctrl value from 0x80000000 to the POR reset value of register IOMUXC_SW_PAD_CTL_PAD_GPIO_0. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3428d14d8a912b5231e9672261013fdd1bede2de Author: Fabio Estevam Date: Tue Jun 26 21:05:01 2018 -0300 ARM: dts: imx6ull: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9152743b298ef67619766eb55a6ac31055eb5b46 Author: Fabio Estevam Date: Tue Jun 26 20:18:52 2018 -0300 ARM: dts: imx51: Add sahara crypto support The sahara crypto block on i.MX51 has the same IP version as the one on i.MX53. Add support for it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit c4288946d43ed2d76247ab757581ce428c90d9ef Author: Stefan Agner Date: Tue Jun 26 16:52:43 2018 +0200 ARM: dts: imx6qdl-colibri: use pull-down on wake-up pin The wake-up pin is pulled low with 100kOhm on the carrier board. The current configuration of 100kOhm pull-up caused lots of interrupts, especially during boot up. Make sure the pin is at a reasonable level at startup by pulling it low on SoC side too. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit c768224360094b3e3b11c81a4163a9e1c7bd3336 Author: Stefan Agner Date: Tue Jun 26 16:52:42 2018 +0200 ARM: dts: imx6qdl-colibri: move card detect to module device tree Muxing the card detect only in the carrier board device tree overwrites the USDHC muxing in the module level device tree. Move card detect to the module level device tree since this is also a default pinout of the Colibri standard. If a carrier board requires a different setting it still can overwrite the nodes in the carrier board specific device tree. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit 10d11dad4a4e343652fca86bda3b10684be30d4e Author: Stefan Agner Date: Tue Jun 26 16:52:41 2018 +0200 ARM: dts: imx6qdl-colibri: mux SD/MMC card detect explicitly Do not rely on reset/boot defaults and use a default GPIO setting with pull-up enabled. Signed-off-by: Stefan Agner Signed-off-by: Shawn Guo commit e4e4730698c9138f09ed73dadd1f35d4bb95ada5 Author: Denis Efremov Date: Tue Jun 19 23:23:57 2018 +0300 crypto: skcipher - remove the exporting of skcipher_walk_next The function skcipher_walk_next declared as static and marked as EXPORT_SYMBOL_GPL. It's a bit confusing for internal function to be exported. The area of visibility for such function is its .c file and all other modules. Other *.c files of the same module can't use it, despite all other modules can. Relying on the fact that this is the internal function and it's not a crucial part of the API, the patch just removes the EXPORT_SYMBOL_GPL marking of skcipher_walk_next. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Denis Efremov Signed-off-by: Herbert Xu commit d0d859bb87ac3b4df1cb6692531fc95d093357c5 Author: Farhan Ali Date: Tue Jun 19 11:41:34 2018 -0400 crypto: virtio - Register an algo only if it's supported Register a crypto algo with the Linux crypto layer only if the algorithm is supported by the backend virtio-crypto device. Also route crypto requests to a virtio-crypto device, only if it can support the requested service and algorithm. Signed-off-by: Farhan Ali Acked-by: Gonglei Acked-by: Christian Borntraeger Signed-off-by: Herbert Xu commit b551bac14acab9c601269e2007a6b6cad2250a4c Author: Farhan Ali Date: Tue Jun 19 11:41:33 2018 -0400 crypto: virtio - Read crypto services and algorithm masks Read the crypto services and algorithm masks which provides information about the services and algorithms supported by virtio-crypto backend. Signed-off-by: Farhan Ali Acked-by: Gonglei Acked-by: Christian Borntraeger Signed-off-by: Herbert Xu commit 0917b873127cebd4a259b92d43af5963484981ae Author: Eric Biggers Date: Mon Jun 18 10:22:40 2018 -0700 crypto: vmac - remove insecure version with hardcoded nonce Remove the original version of the VMAC template that had the nonce hardcoded to 0 and produced a digest with the wrong endianness. I'm unsure whether this had users or not (there are no explicit in-kernel references to it), but given that the hardcoded nonce made it wildly insecure unless a unique key was used for each message, let's try removing it and see if anyone complains. Leave the new "vmac64" template that requires the nonce to be explicitly specified as the first 16 bytes of data and uses the correct endianness for the digest. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ed331adab35bcddc595dae066522ca6336ee9210 Author: Eric Biggers Date: Mon Jun 18 10:22:39 2018 -0700 crypto: vmac - add nonced version with big endian digest Currently the VMAC template uses a "nonce" hardcoded to 0, which makes it insecure unless a unique key is set for every message. Also, the endianness of the final digest is wrong: the implementation uses little endian, but the VMAC specification has it as big endian, as do other VMAC implementations such as the one in Crypto++. Add a new VMAC template where the nonce is passed as the first 16 bytes of data (similar to what is done for Poly1305's nonce), and the digest is big endian. Call it "vmac64", since the old name of simply "vmac" didn't clarify whether the implementation is of VMAC-64 or of VMAC-128 (which produce 64-bit and 128-bit digests respectively); so we fix the naming ambiguity too. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit bb29648102335586e9a66289a1d98a0cb392b6e5 Author: Eric Biggers Date: Mon Jun 18 10:22:38 2018 -0700 crypto: vmac - separate tfm and request context syzbot reported a crash in vmac_final() when multiple threads concurrently use the same "vmac(aes)" transform through AF_ALG. The bug is pretty fundamental: the VMAC template doesn't separate per-request state from per-tfm (per-key) state like the other hash algorithms do, but rather stores it all in the tfm context. That's wrong. Also, vmac_final() incorrectly zeroes most of the state including the derived keys and cached pseudorandom pad. Therefore, only the first VMAC invocation with a given key calculates the correct digest. Fix these bugs by splitting the per-tfm state from the per-request state and using the proper init/update/final sequencing for requests. Reproducer for the crash: #include #include #include int main() { int fd; struct sockaddr_alg addr = { .salg_type = "hash", .salg_name = "vmac(aes)", }; char buf[256] = { 0 }; fd = socket(AF_ALG, SOCK_SEQPACKET, 0); bind(fd, (void *)&addr, sizeof(addr)); setsockopt(fd, SOL_ALG, ALG_SET_KEY, buf, 16); fork(); fd = accept(fd, NULL, NULL); for (;;) write(fd, buf, 256); } The immediate cause of the crash is that vmac_ctx_t.partial_size exceeds VMAC_NHBYTES, causing vmac_final() to memset() a negative length. Reported-by: syzbot+264bca3a6e8d645550d3@syzkaller.appspotmail.com Fixes: f1939f7c5645 ("crypto: vmac - New hash algorithm for intel_txt support") Cc: # v2.6.32+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 73bf20ef3df262026c3470241ae4ac8196943ffa Author: Eric Biggers Date: Mon Jun 18 10:22:37 2018 -0700 crypto: vmac - require a block cipher with 128-bit block size The VMAC template assumes the block cipher has a 128-bit block size, but it failed to check for that. Thus it was possible to instantiate it using a 64-bit block size cipher, e.g. "vmac(cast5)", causing uninitialized memory to be used. Add the needed check when instantiating the template. Fixes: f1939f7c5645 ("crypto: vmac - New hash algorithm for intel_txt support") Cc: # v2.6.32+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 76744502ff328a0a00ca46601da871a96539997d Author: Leonard Crestez Date: Mon Jun 25 23:09:32 2018 +0300 ARM: dts: imx: Add missing chosen/stdout-path This makes it possible to enable earlycon for debugging by just passing an empty "earlycon" argument on the kernel command-line. Signed-off-by: Leonard Crestez Signed-off-by: Shawn Guo commit 54c43959ab7066fb2acf0427d6a1bb983d9971b4 Author: Alexander Kurz Date: Sun Jun 24 06:15:38 2018 +0000 ARM: dts: imx50: remove non-existent USB instances According to the i.MX50 Reference Manual, the SoC features one USB OTG and one host controller. Remove the non-existent instances from the DTS which probably got initially copied from the mx53 DTS. Signed-off-by: Alexander Kurz Signed-off-by: Shawn Guo commit ff6f5a691cd9f346e323c2a74937c1af5025f751 Author: Alexander Kurz Date: Sun Jun 24 05:59:29 2018 +0000 ARM: dts: imx50: fix KPP pin definition typos iMX50 pin mux options for pads KEY_COL2 and KEY_COL3 allow muxing the same KEY_COL instances as the pad name. Fix typos shifting KEY_COL instances. Signed-off-by: Alexander Kurz Signed-off-by: Shawn Guo commit ba72b5a49957d92bfa7101a67e2414e166847291 Author: Fabio Estevam Date: Wed Jun 20 15:06:19 2018 -0300 ARM: dts: imx51: Add aipstz nodes Currently when trying to use the 'devmem' tool to read/write registers the following bus error is observed: [ 82.689185] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6ff10c4 [ 82.697071] pgd = (ptrval) [ 82.699920] [b6ff10c4] *pgd=a87c5831, *pte=73fa8383, *ppte=73fa8a33 Bus error Add the aipstz nodes, so that the following function from imx51_dt_init() can work properly: imx_aips_allow_unprivileged_access("fsl,imx51-aipstz"); After adding these nodes, 'devmem' tool can work correctly, which is very useful for debugging purposes. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 4a23e6ee9f691cfbd6bfc99c2c5aa8d23d8c1662 Author: Leonard Crestez Date: Wed Jun 20 13:41:16 2018 +0300 ARM: dts: imx7d-sdb: Restore pwm backlight support This was removed in commit 5eaeaccdaedb ("ARM: dts: imx7d-sdb: Pass 'enable-gpios' and 'power-supply' properties") with a note claiming that GPIO1_IO01 is connected to a pin labeled as "PWREN" on the connector. Despite that label this pin does actually work as a PWM controlling brightness. So restore pwm functionality. Signed-off-by: Leonard Crestez Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0b9e3d543f9fa6a8abdac04f974176ee02312860 Merge: 509fda105ba8 121c58bed01a Author: Daniel Borkmann Date: Sun Jul 1 01:01:51 2018 +0200 Merge branch 'bpf-bpftool-libbpf-improvements' Jakub Kicinski says: ==================== Set of random updates to bpftool and libbpf. I'm preparing for extending bpftool prog load, but there is a good number of improvements that can be made before bpf -> bpf-next merge helping to keep the later patch set to a manageable size as well. First patch is a bpftool build speed improvement. Next missing program types are added to libbpf program type detection by section name. The ability to load programs from '.text' section is restored when ELF file doesn't contain any pseudo calls. In bpftool I remove my Author comments as unnecessary sign of vanity. Last but not least missing option is added to bash completions and processing of options in bash completions is improved. ==================== Signed-off-by: Daniel Borkmann commit 121c58bed01a45043381ce52b8556e851dbaa123 Author: Jakub Kicinski Date: Thu Jun 28 14:41:42 2018 -0700 tools: bpftool: deal with options upfront Remove options (in getopt() sense, i.e. starting with a dash like -n or --NAME) while parsing arguments for bash completions. This allows us to refer to position-dependent parameters better, and complete options at any point. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit ef347a340b1a8507c22ee3cf981cd5cd64188431 Author: Jakub Kicinski Date: Thu Jun 28 14:41:41 2018 -0700 tools: bpftool: add missing --bpffs to completions --bpffs is not suggested by bash completions. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 71e07ddcdc03000e37acfc6e757f70c81a963d58 Author: Jakub Kicinski Date: Thu Jun 28 14:41:40 2018 -0700 tools: bpftool: drop unnecessary Author comments Drop my author comments, those are from the early days of bpftool and make little sense in tree, where we have quite a few people contributing and git to attribute the work. While at it bump some copyrights. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit eac7d84519a35fc9fc8071b7d93803b2b075e2a7 Author: Jakub Kicinski Date: Thu Jun 28 14:41:39 2018 -0700 tools: libbpf: don't return '.text' as a program for multi-function programs Make bpf_program__next() skip over '.text' section if object file has pseudo calls. The '.text' section is hardly a program in that case, it's more of a storage for code of functions other than main. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 9a94f277c4fb84815f450418d37bfc568d57b5cc Author: Jakub Kicinski Date: Thu Jun 28 14:41:38 2018 -0700 tools: libbpf: restore the ability to load programs from .text section libbpf used to be able to load programs from the default section called '.text'. It's not very common to leave sections unnamed, but if it happens libbpf will fail to load the programs reporting -EINVAL from the kernel. The -EINVAL comes from bpf_obj_name_cpy() because since 48cca7e44f9f ("libbpf: add support for bpf_call") libbpf does not resolve program names for programs in '.text', defaulting to '.text'. '.text', however, does not pass the (isalnum(*src) || *src == '_') check in bpf_obj_name_cpy(). With few extra lines of code we can limit the pseudo call assumptions only to objects which actually contain code relocations. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 9aba36139a5f9ee1d11a60d0a3a90944b8d56385 Author: Jakub Kicinski Date: Thu Jun 28 14:41:37 2018 -0700 tools: libbpf: allow setting ifindex for programs and maps Users of bpf_object__open()/bpf_object__load() APIs may want to load the programs and maps onto a device for offload. Allow setting ifindex on those sub-objects. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit d9b683d7464ec9e8298d82c00b9033c96e27a187 Author: Jakub Kicinski Date: Thu Jun 28 14:41:36 2018 -0700 tools: libbpf: add section names for missing program types Specify default section names for BPF_PROG_TYPE_LIRC_MODE2 and BPF_PROG_TYPE_LWT_SEG6LOCAL, these are the only two missing right now. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit c256429fbd01d6993a2e19ff24f252514a0b84a5 Author: Jakub Kicinski Date: Thu Jun 28 14:41:35 2018 -0700 tools: bpftool: use correct make variable type to improve compilation time Commit 4bfe3bd3cc35 ("tools/bpftool: use version from the kernel source tree") added version to bpftool. The version used is equal to the kernel version and obtained by running make kernelversion against kernel source tree. Version is then communicated to the sources with a command line define set in CFLAGS. Use a simply expanded variable for the version, otherwise the recursive make will run every time CFLAGS are used. This brings the single-job compilation time for me from almost 16 sec down to less than 4 sec. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 7ce3f912ae0a79e5d738a3ae1f158b281973e849 Author: Sinan Kaya Date: Sat Jun 30 11:24:24 2018 -0400 PCI: Enable PASID only if entire path supports End-End TLP prefixes A PCIe endpoint carries the process address space identifier (PASID) in the TLP prefix as part of the memory read/write transaction. The address information in the TLP is relevant only for a given PASID context. An IOMMU takes PASID value and the address information from the TLP to look up the physical address in the system. PASID is an End-End TLP Prefix (PCIe r4.0, sec 6.20). Sec 2.2.10.2 says It is an error to receive a TLP with an End-End TLP Prefix by a Receiver that does not support End-End TLP Prefixes. A TLP in violation of this rule is handled as a Malformed TLP. This is a reported error associated with the Receiving Port (see Section 6.2). Prevent error condition by proactively requiring End-End TLP prefix to be supported on the entire data path between the endpoint and the root port before enabling PASID. Signed-off-by: Sinan Kaya Signed-off-by: Bjorn Helgaas commit f778a0d26fe3912424401e7b997155094de36487 Author: Logan Gunthorpe Date: Wed May 30 14:13:11 2018 -0600 PCI: Expand documentation for pci_add_dma_alias() Seeing there's been some confusion about the use of pci_add_dma_alias(), expand the comment to describe why it must be called early and how early it must be called. Also, expand on the purpose of this function and common reasons it would be used. [The comment was reworded to some extent by Alex Williamson] Signed-off-by: Logan Gunthorpe Signed-off-by: Bjorn Helgaas Cc: Alex Williamson Cc: Doug Meyer commit 5df362a6cf49ca8d2e69a2f68e605310e3c576cb Author: Freeman Liu Date: Thu Jun 21 11:14:05 2018 +0800 iio: adc: Add Spreadtrum SC27XX PMICs ADC support The Spreadtrum SC27XX PMICs ADC controller contains 32 channels, which is used to sample voltages with 12 bits conversion. [Baolin Wang did lots of improvements] Signed-off-by: Freeman Liu Signed-off-by: Baolin Wang Signed-off-by: Jonathan Cameron commit d93de07a12e8b00e99ff9d7522c326ba6a5747c0 Author: Baolin Wang Date: Thu Jun 21 11:14:04 2018 +0800 dt-bindings: iio: Add Spreadtrum SC27XX PMICs ADC controller documentation This patch adds the binding documentation for Spreadtrum SC27XX series PMICs ADC controller device. Signed-off-by: Baolin Wang Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 732238e22e4c5497bd76d02adcf5c4fcba6dcb67 Author: Akinobu Mita Date: Tue Jun 26 00:22:42 2018 +0900 iio: accel: adxl345: add calibration offset support The ADXL345 provides the offset adjustment registers for each axis. This adds the iio channel information for the calibraion offsets with that feature. Cc: Eva Rachel Retuya Cc: Andy Shevchenko Cc: Jonathan Cameron Signed-off-by: Akinobu Mita Signed-off-by: Jonathan Cameron commit 9048f1f18a70a01eaa3c8e7166fdb2538929d780 Author: Akinobu Mita Date: Tue Jun 26 00:22:41 2018 +0900 iio: accel: adxl345: convert address field usage in iio_chan_spec Currently the address field in iio_chan_spec is filled with an accel data register address for the corresponding axis. In preparation for adding calibration offset support, this sets the address field to the index of accel data registers instead of the actual register address. This change makes it easier to access both accel registers and calibration offset registers with fewer lines of code as these are located in X-axis, Y-axis, Z-axis order. Cc: Eva Rachel Retuya Cc: Andy Shevchenko Cc: Jonathan Cameron Signed-off-by: Akinobu Mita Signed-off-by: Jonathan Cameron commit 4b5de1fa97b9932db0e989afe7dba3029fbd4545 Author: Akinobu Mita Date: Tue Jun 26 00:22:40 2018 +0900 iio: accel: adxl345: add link to datasheet Add a link to the ADXL345 datasheet Cc: Eva Rachel Retuya Cc: Andy Shevchenko Cc: Jonathan Cameron Signed-off-by: Akinobu Mita Signed-off-by: Jonathan Cameron commit c6988eb0e7d2ae1c892874d92ee9a7e8a380896d Author: Karim Eshapa Date: Mon Jun 25 21:11:23 2018 +0200 staging:iio:impedance-analyzer:ad5933: Macro replacement Cleanups. Doing some macro replacement to start an array of structures so it can be reused by manipulating it with different values. Signed-off-by: Karim Eshapa Signed-off-by: Jonathan Cameron commit 5105730fbf6789ff9e20837bdefe32e8ba133595 Author: Mike Rapoport Date: Sat Jun 30 00:05:11 2018 +0300 docs/idr: use empty "functions" directive to avoid duplication of DOC: sections in the middle of the API reference. Signed-off-by: Mike Rapoport Acked-by: Matthew Wilcox Signed-off-by: Jonathan Corbet commit f2e8603604aae9251d91249d8438f02234f17464 Author: Mike Rapoport Date: Sat Jun 30 00:05:10 2018 +0300 Documentation/sphinx: allow "functions" with no parameters When kernel-doc:: specified in .rst document without explicit directives, it outputs both comment and DOC: sections. If a DOC: section was explicitly included in the same document it will be duplicated. For example, the output generated for Documentation/core-api/idr.rst [1] has "IDA description" in the "IDA usage" section and in the middle of the API reference. This patch enables using "functions" directive without parameters to output all the documentation excluding DOC: sections. [1] https://www.kernel.org/doc/html/v4.17/core-api/idr.html Signed-off-by: Mike Rapoport Acked-by: Matthew Wilcox Signed-off-by: Jonathan Corbet commit e876c445df4009d7b1ebdd2a92ca23566ca05440 Author: Al Viro Date: Sat Jun 23 20:33:59 2018 -0400 hpfs: fix an inode leak in lookup, switch to d_splice_alias() Signed-off-by: Al Viro commit 1a84d7fdb5fc07b903678756f6f169d36de542b8 Merge: a847726159c6 1b6130df62d0 Author: David S. Miller Date: Sat Jun 30 22:06:16 2018 +0900 Merge branch 'mlxsw-Add-resource-scale-tests' Petr Machata says: ==================== mlxsw: Add resource scale tests There are a number of tests that check features of the Linux networking stack. By running them on suitable interfaces, one can exercise the mlxsw offloading code. However none of these tests attempts to push mlxsw to the limits supported by the ASIC. As an additional wrinkle, the "limits supported by the ASIC" themselves may not be a set of fixed numbers, but rather depend on a profile that determines how the ASIC resources are allocated for different purposes. This patchset introduces several tests that verify capability of mlxsw to offload amounts of routes, flower rules, and mirroring sessions that match predicted ASIC capacity, at different configuration profiles. Additionally they verify that amounts exceeding the predicted capacity can *not* be offloaded. These are not generic tests, but ones that are tailored for mlxsw specifically. For that reason they are not added to net/forwarding selftests subdirectory, but rather to a newly-added drivers/net/mlxsw. Patches #1, #2 and #3 tweak the generic forwarding/lib.sh to support the new additions. In patches #4 and #5, new libraries for interfacing with devlink are introduced, first a generic one, then a Spectrum-specific one. In patch #6, a devlink resource test is introduced. Patches #7 and #8, #9 and #10, and #11 and #12 introduce three scale tests: router, flower and mirror-to-gretap. The first of each pair of patches introduces a generic portion of the test (mlxsw-specific), the second introduces a Spectrum-specific wrapper. Patch #13 then introduces a scale test driver that runs (possibly a subset of) the tests introduced by patches from previous paragraph. ==================== Signed-off-by: David S. Miller commit 1b6130df62d0346698c5465736e36d935605af0c Author: Yuval Mintz Date: Sat Jun 30 02:53:52 2018 +0200 selftests: mlxsw: Add scale test for resources Add a scale test capable of validating that offloaded network functionality is indeed functional at scale when configured to the different KVD profiles available. Start by testing offloaded routes are functional at scale by passing traffic on each one of them in turn. Signed-off-by: Yuval Mintz Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 9136074d56419fc502efeea1c80b63af0e4da3e7 Author: Petr Machata Date: Sat Jun 30 02:53:14 2018 +0200 selftests: mlxsw: Add target for mirror-to-gretap test on spectrum Add a wrapper around mlxsw/mirror_gre_scale.sh that parameterized number of offloadable mirrors on Spectrum machines. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit b973b78aaeae44d650f534b617a2b62e5a83327a Author: Petr Machata Date: Sat Jun 30 02:52:34 2018 +0200 selftests: mlxsw: Add scale test for mirror-to-gretap Test that it's possible to offload a given number of mirrors. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 741a7661f077bf906761fbaef31f3b5aa393c734 Author: Petr Machata Date: Sat Jun 30 02:51:55 2018 +0200 selftests: mlxsw: Add target for tc flower test on spectrum Add a wrapper around mlxsw/tc_flower_scale.sh that parameterizes the generic tc flower scale test template with Spectrum-specific target values. Signed-off-by: Petr Machata Reviewed-by: Yuval Mintz Signed-off-by: David S. Miller commit d67a94e81fda793fc2cd8562501117720e221634 Author: Petr Machata Date: Sat Jun 30 02:51:05 2018 +0200 selftests: mlxsw: Add tc flower scale test Add test of capacity to offload flower. This is a generic portion of the test that is meant to be called from a driver that supplies a particular number of rules to be tested with. Signed-off-by: Petr Machata Reviewed-by: Yuval Mintz Signed-off-by: David S. Miller commit c51a744a28bad6faec696b56c176519bea0e73bc Author: Yuval Mintz Date: Sat Jun 30 02:50:28 2018 +0200 selftests: mlxsw: Add target for router test on spectrum IPv4 routes in Spectrum are based on the kvd single-hash, but as it's a hash we need to assume we cannot reach 100% of its capacity. Add a wrapper that provides us with good/bad target numbers for the Spectrum ASIC. Signed-off-by: Yuval Mintz Reviewed-by: Petr Machata [petrm@mellanox.com: Drop shebang.] Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit d98307c52b19354830af205a1a8346d13e2b1fa7 Author: Arkadi Sharshevsky Date: Sat Jun 30 02:49:32 2018 +0200 selftests: mlxsw: Add router test This test aims for both stand alone and internal usage by the resource infra. The test receives the number routes to offload and checks: - The routes were offloaded correctly - Traffic for each route. Signed-off-by: Arkadi Sharshevsky Signed-off-by: Yuval Mintz Reviewed-by: Petr Machata Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit b030c338116438700fc61fe572d82034f190d3e8 Author: Yuval Mintz Date: Sat Jun 30 02:48:27 2018 +0200 selftests: mlxsw: Add devlink KVD resource test Add a selftest that can be used to perform basic sanity of the devlink resource API as well as test the behavior of KVD manipulation in the driver. This is the first case of a HW-only test - in order to test the devlink resource a driver capable of exposing resources has to be provided first. Signed-off-by: Yuval Mintz [petrm@mellanox.com: Extracted two patches out of this patch. Tweaked commit message.] Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 5aeba3e89b3ee4e541dc882d23c7332893dd4b5a Author: Petr Machata Date: Sat Jun 30 02:48:12 2018 +0200 selftests: mlxsw: Add devlink_lib_spectrum.sh This library builds on top of devlink_lib.sh and contains functionality specific to Spectrum ASICs, e.g., re-partitioning the various KVD sub-parts. Signed-off-by: Yuval Mintz [petrm@mellanox.com: Split this out from another patch. Fix line length in devlink_sp_read_kvd_defaults().] Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit bc7cbb1e9f4ccb147fefb7502ab8acdcd52b9a29 Author: Petr Machata Date: Sat Jun 30 02:47:08 2018 +0200 selftests: forwarding: Add devlink_lib.sh This helper library contains wrappers to devlink functionality agnostic to the underlying device. Signed-off-by: Yuval Mintz [petrm@mellanox.com: Split this out from another patch.] Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 68d9cea594b5da185e5b048e9b4fa0dadeafe88a Author: Petr Machata Date: Sat Jun 30 02:46:05 2018 +0200 selftests: forwarding: lib: Parameterize NUM_NETIFS in two functions setup_wait() and tc_offload_check() both assume that all NUM_NETIFS interfaces are relevant for a given test. However, the scale test script acts as an umbrella for a number of sub-tests, some of which may not require all the interfaces. Thus it's suboptimal for tc_offload_check() to query all the interfaces. In case of setup_wait() it's incorrect, because the sub-test in question of course doesn't configure any interfaces beyond what it needs, and setup_wait() then ends up waiting indefinitely for the extraneous interfaces to come up. For that reason, give setup_wait() and tc_offload_check() an optional parameter with a number of interfaces to probe. Fall back to global NUM_NETIFS if the parameter is not given. Signed-off-by: Petr Machata Reviewed-by: Yuval Mintz Signed-off-by: David S. Miller commit 96fa91d281229390b75a004d49582400b5f93cb1 Author: Petr Machata Date: Sat Jun 30 02:45:47 2018 +0200 selftests: forwarding: lib: Add check_err_fail() In the scale testing scenarios, one usually has a condition that is expected to either fail, or pass, depending on which side of the scale is being tested. To capture this logic, add a function check_err_fail(), which dispatches either to check_err() or check_fail(), depending on the value of the first argument, should_fail. Signed-off-by: Petr Machata Reviewed-by: Yuval Mintz Signed-off-by: David S. Miller commit 87d8fb18cbe919342a1909a1e4168c9a63b9bbbf Author: Yuval Mintz Date: Sat Jun 30 02:45:19 2018 +0200 selftests: forwarding: Allow lib.sh sourcing from other directories The devlink related scripts are mlxsw-specific. As a result, they'll reside in a different directory - but would still need the common logic implemented in lib.sh. So as a preliminary step, allow lib.sh to be sourced from other directories as well. Signed-off-by: Yuval Mintz Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit a847726159c618966a01d128ce5c7f94a2768948 Merge: 4e485d06bb8c 635cf43dbddd Author: David S. Miller Date: Sat Jun 30 21:31:57 2018 +0900 Merge branch 'nfp-flower-updates-and-netconsole' Jakub Kicinski says: ==================== nfp: flower updates and netconsole This set contains assorted updates to driver base and flower. First patch is a follow up to a fix to calculating counters which went into net. For ethtool counters we should also make sure they are visible even after ring reconfiguration. Next patch is a safety measure in case we are running on a machine with a broken BIOS we should fail the probe when risk of incorrect operation is too high. The next two patches add netpoll support and make use of napi_consume_skb(). Last we populate bus info on all representors. Pieter adds support for offload of the checksum action in flower. John follows up to another fix he's done in net, we set TTL values on tunnels to stack's default, now Johns does a full route lookup to get a more precise information, he populates ToS field as well. Last but not least he follows up on Jiri's request to enable LAG offload in case the team driver is used and then hash function is unknown. ==================== Signed-off-by: David S. Miller commit 635cf43dbddd166cd702c7883c837b9a3ace4565 Author: John Hurley Date: Fri Jun 29 17:04:42 2018 -0700 nfp: flower: enabled offloading of Team LAG Currently the NFP fw only supports L3/L4 hashing so rejects the offload of filters that output to LAG ports implementing other hash algorithms. Team, however, uses a BPF function for the hash that is not defined. To support Team offload, accept hashes that are defined as 'unknown' (only Team defines such hash types). In this case, use the NFP default of L3/L4 hashing for egress port selection. Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 51a8cefc6e3d8dd4bb18918b07faa5715f877aa6 Author: John Hurley Date: Fri Jun 29 17:04:41 2018 -0700 nfp: flower: offload tos and tunnel flags for ipv4 udp tunnels Extract the tos and the tunnel flags from the tunnel key and offload these action fields. Only the checksum and tunnel key flags are implemented in fw so reject offloads of other flags. The tunnel key flag is always considered set in the fw so enforce that it is set in the rule. Note that the compulsory setting of the tunnel key flag and optional setting of checksum is inline with how tc currently generates ipv4 udp tunnel actions. Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit ed21b637e940e7680fc52eb10a5d9ee74715cd38 Author: John Hurley Date: Fri Jun 29 17:04:40 2018 -0700 nfp: flower: extract ipv4 udp tunnel ttl from route Previously the ttl for ipv4 udp tunnels was set to the namespace default. Modify this to attempt to extract the ttl from a full route lookup on the tunnel destination. If this is not possible then resort to the default. Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit ed8f2b52b622bbc550dadb69d3f10d81528f9fbc Author: Pieter Jansen van Vuuren Date: Fri Jun 29 17:04:39 2018 -0700 nfp: flower: ignore checksum actions when performing pedit actions Hardware will automatically update csum in headers when a set action has been performed. This means we could in the driver ignore the explicit checksum action when performing a set action. Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 5d4b0b4068f1dc637d8a9b53c2960bbad8ce654d Author: Jakub Kicinski Date: Fri Jun 29 17:04:38 2018 -0700 nfp: populate bus-info on representors We used to leave bus-info in ethtool driver info empty for representors in case multi-PCIe-to-single-host cards make the association between PCIe device and NFP many to one. It seems these attempts are futile, we need to link the representors to one PCIe device in sysfs to get consistent naming, plus devlink uses one PCIe as a handle, anyway. The multi-PCIe-to-single-system support won't be clean, if it ever comes. Turns out some user space (RHEL tests) likes to read bus-info so just populate it. While at it remove unnecessary app NULL-check, representors are spawned by an app, so it must exist. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit d387b8a19a3921e291ebeb26b55495479cd36b21 Author: Jakub Kicinski Date: Fri Jun 29 17:04:37 2018 -0700 nfp: make use of napi_consume_skb() Use napi_consume_skb() in nfp_net_tx_complete() to get bulk free. Pass 0 as budget for ctrl queue completion since it runs out of a tasklet. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit 670b5274ff976a7eed57fd303460a8a9de267c0e Author: Jakub Kicinski Date: Fri Jun 29 17:04:36 2018 -0700 nfp: implement netpoll ndo (thus enabling netconsole) NFP NAPI handling will only complete the TXed packets when called with budget of 0, implement ndo_poll_controller by scheduling NAPI on all TX queues. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 18aa5b180f00a10c2f63944b4f0ab116bf8ea19b Author: Jakub Kicinski Date: Fri Jun 29 17:04:35 2018 -0700 nfp: fail probe if serial or interface id is missing On some platforms with broken ACPI tables we may not have access to the Serial Number PCIe capability. This capability is crucial for us for switchdev operation as we use serial number as switch ID, and for communication with management FW where interface ID is used. If we can't determine the Serial Number we have to fail device probe. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit f055a9dfee8508173a35169372bdedcfac49d0f6 Author: Jakub Kicinski Date: Fri Jun 29 17:04:34 2018 -0700 nfp: expose ring stats of inactive rings via ethtool After user changes the ring count statistics for deactivated rings disappear from ethtool -S output. This causes loss of information to the user and means that ethtool stats may not add up to interface stats. Always expose counters from all the rings. Note that we allocate at most num_possible_cpus() rings so number of rings should be reasonable. The alternative of only listing stats for rings which were ever in use could be confusing. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit 4e485d06bb8c7811a0d69a811c77befd54b9ab0c Author: Vakul Garg Date: Sat Jun 30 00:45:55 2018 +0530 strparser: Call skb_unclone conditionally Calling skb_unclone() is expensive as it triggers a memcpy operation. Instead of calling skb_unclone() unconditionally, call it only when skb has a shared frag_list. This improves tls rx throughout significantly. Signed-off-by: Vakul Garg Suggested-by: Boris Pismenny Signed-off-by: David S. Miller commit 180390c470e1b6e3e19b4f969524182eeb5e4e6c Author: Keara Leibovitz Date: Fri Jun 29 10:47:31 2018 -0400 tc-testing: initial version of tunnel_key unit tests Create unittests for the tc tunnel_key action. v2: For the tests expecting failures, added non-zero exit codes in the teardowns. This prevents those tests from failing if the act_tunnel_key module is unloaded. Signed-off-by: Keara Leibovitz Signed-off-by: David S. Miller commit 8365da2c0570f02615e7f1d2d729d854029202b0 Merge: a1be5a20f137 a42177505869 Author: David S. Miller Date: Sat Jun 30 21:08:12 2018 +0900 Merge tag 'mac80211-next-for-davem-2018-06-29' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Small merge conflict in net/mac80211/scan.c, I preserved the kcalloc() conversion. -DaveM Johannes Berg says: ==================== This round's updates: * finally some of the promised HE code, but it turns out to be small - but everything kept changing, so one part I did in the driver was >30 patches for what was ultimately <200 lines of code ... similar here for this code. * improved scan privacy support - can now specify scan flags for randomizing the sequence number as well as reducing the probe request element content * rfkill cleanups * a timekeeping cleanup from Arnd * various other cleanups ==================== Signed-off-by: David S. Miller commit a1be5a20f137bdf436bab86c18998229908ce951 Author: GhantaKrishnamurthy MohanKrishna Date: Fri Jun 29 13:26:18 2018 +0200 tipc: extend sock diag for group communication This commit extends the existing TIPC socket diagnostics framework for information related to TIPC group communication. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: GhantaKrishnamurthy MohanKrishna Signed-off-by: David S. Miller commit 6a939f365bdb03a74b4617bdb4402fc08da088b9 Author: GhantaKrishnamurthy MohanKrishna Date: Fri Jun 29 13:23:41 2018 +0200 tipc: Auto removal of peer down node instance A peer node is considered down if there are no active links (or) lost contact to the node. In current implementation, a peer node instance is deleted either if a) TIPC module is removed (or) b) Application can use a netlink/iproute2 interface to delete a specific down node. Thus, a down node instance lives in the system forever, unless the application explicitly removes it. We fix this by deleting the nodes which are down for a specified amount of time (5 minutes). Existing node supervision timer is used to achieve this. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: GhantaKrishnamurthy MohanKrishna Signed-off-by: David S. Miller commit e397286b8e89bf38f4f56c0dcf6626e79dc2a323 Author: Heiner Kallweit Date: Fri Jun 29 08:07:04 2018 +0200 r8169: remove TBI 1000BaseX support The very first version of RTL8169 from 2002 (and only this one) has support for a TBI 1000BaseX fiber interface. The TBI support in the driver makes switching to phylib tricky, so best would be to get rid of it. I found no report from anybody using a device with RTL8169 and fiber interface, also the vendor driver doesn't support this mode (any longer). So remove TBI support and bail out with a message if a card with activated TBI is detected. If there really should be any user of it out there, we could add a stripped-down version of the driver supporting chip version 01 and TBI only (and maybe move it to staging). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 759f29b62fb9af5274e7f761f9f4cdfa7bb5a1f2 Author: Tung Nguyen Date: Thu Jun 28 22:39:25 2018 +0200 tipc: optimize function tipc_node_timeout() In single-link usage, the function tipc_node_timeout() still iterates over the whole link array to handle each link. Given that the maximum number of bearers are 3, there are 2 redundant iterations with lock grab/release. Since this function is executing very frequently it makes sense to optimize it. This commit adds conditional checking to exit from the loop if the known number of configured links has already been accessed. Acked-by: Ying Xue Signed-off-by: Tung Nguyen Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit ef9be755697f1b841c2a219a05df1a72ccd6f471 Author: Tung Nguyen Date: Thu Jun 28 22:25:04 2018 +0200 tipc: eliminate buffer cloning in function tipc_msg_extract() The function tipc_msg_extract() is using skb_clone() to clone inner messages from a message bundle buffer. Although this method is safe, it has an undesired effect that each buffer clone inherits the true-size of the bundling buffer. As a result, the buffer clone almost always ends up with being copied anyway by the message validation function. This makes the cloning into a sub-optimization. In this commit we take the consequence of this realization, and copy each inner message to a separately allocated buffer up front in the extraction function. As a bonus we can now eliminate the two cases where we had to copy re-routed packets that may potentially go out on the wire again. Signed-off-by: Tung Nguyen Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit 9ca78674eb6a19acbb1d69e86273ebd1d3edf087 Author: Gustavo A. R. Silva Date: Thu Jun 28 13:50:48 2018 -0500 net: usb: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit d241d4aac93f25a48ed42c246163b6c28354b1e5 Author: Heiner Kallweit Date: Thu Jun 28 20:46:45 2018 +0200 net: phy: realtek: add support for RTL8211 In preparation of adding phylib support to the r8169 driver we need PHY drivers for all chip-internal PHY types. Fortunately almost all of them are either supported by the Realtek PHY driver already or work with the genphy driver. Still missing is support for the PHY of RTL8169s, it requires a quirk to properly support 100Mbit-fixed mode. The quirk was copied from r8169 driver which copied it from the vendor driver. Based on the PHYID the internal PHY seems to be a RTL8211. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 49d17512560b5d9384b9da1f12395be960602420 Author: Heiner Kallweit Date: Thu Jun 28 20:36:15 2018 +0200 r8169: use standard debug output functions I see no need to define a private debug output symbol, let's use the standard debug output functions instead. In this context also remove the deprecated PFX define. The one assertion is wrong IMO anyway, this code path is used also by chip version 01. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit b5f16484dd1c99b63eb986121c2b0fc624182d52 Merge: b0402f011367 684b89bc39ce Author: David S. Miller Date: Sat Jun 30 20:42:26 2018 +0900 Merge branch 'smc-pnetid-and-SMC-D-support' Ursula Braun says: ==================== smc: pnetid and SMC-D support SMC requires a configured pnet table to map Ethernet interfaces to RoCE adapter ports. For s390 there exists hardware support to group such devices. The first three patches cover the s390 pnetid support, enabling SMC-R usage on s390 without configuring an extra pnet table. SMC currently requires RoCE adapters, and uses RDMA-techniques implemented with IB-verbs. But s390 offers another method for intra-CEC Shared Memory communication. The following seven patches implement a solution to run SMC traffic based on intra-CEC DMA, called SMC-D. ==================== Signed-off-by: David S. Miller commit 684b89bc39ce4f204b1a2b180f39f2eb36a6b695 Author: Sebastian Ott Date: Thu Jun 28 19:05:13 2018 +0200 s390/ism: add device driver for internal shared memory Add support for the Internal Shared Memory vPCI Adapter. This driver implements the interfaces of the SMC-D protocol. Signed-off-by: Sebastian Ott Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 4b1b7d3b30a6d32ac1a1dcede284e76ef8a8542d Author: Hans Wippel Date: Thu Jun 28 19:05:12 2018 +0200 net/smc: add SMC-D diag support This patch adds diag support for SMC-D. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun Suggested-by: Thomas Richter Signed-off-by: David S. Miller commit 413498440e30bfe381ac99dfc31628a3d8d4382a Author: Hans Wippel Date: Thu Jun 28 19:05:11 2018 +0200 net/smc: add SMC-D support in af_smc This patch ties together the previous SMC-D patches. It adds support for SMC-D to the listen and connect functions and, thus, enables SMC-D support in the SMC code. If a connection supports both SMC-R and SMC-D, SMC-D is preferred. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun Suggested-by: Thomas Richter Signed-off-by: David S. Miller commit be244f28d22f77d939ba2b973c102ad2b49d3496 Author: Hans Wippel Date: Thu Jun 28 19:05:10 2018 +0200 net/smc: add SMC-D support in data transfer The data transfer and CDC message headers differ in SMC-R and SMC-D. This patch adds support for the SMC-D data transfer to the existing SMC code. It consists of the following: * SMC-D CDC support * SMC-D tx support * SMC-D rx support The CDC header is stored at the beginning of the receive buffer. Thus, a rx_offset variable is added for the CDC header offset within the buffer (0 for SMC-R). Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun Suggested-by: Thomas Richter Signed-off-by: David S. Miller commit c758dfddc1b5b1c9b8c64e5e4bb9bf24b74f4a59 Author: Hans Wippel Date: Thu Jun 28 19:05:09 2018 +0200 net/smc: add SMC-D support in CLC messages There are two types of SMC: SMC-R and SMC-D. These types are signaled within the CLC messages during the CLC handshake. This patch adds support for and checks of the SMC type. Also, SMC-R and SMC-D need to exchange different information during the CLC handshake. So, this patch extends the current message formats to support the SMC-D header fields. The Proposal message can contain both SMC-R and SMC-D information. The Accept and Confirm messages contain either SMC-R or SMC-D information. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun Suggested-by: Thomas Richter Signed-off-by: David S. Miller commit 1619f770589a183af56f248de261534b255122de Author: Hans Wippel Date: Thu Jun 28 19:05:08 2018 +0200 net/smc: add pnetid support for SMC-D and ISM SMC-D relies on PNETIDs to find usable SMC-D/ISM devices for a SMC connection. This patch adds SMC-D/ISM support to the current PNETID implementation. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun Suggested-by: Thomas Richter Signed-off-by: David S. Miller commit c6ba7c9ba43de1b57e9a53946e7ff988554c84ed Author: Hans Wippel Date: Thu Jun 28 19:05:07 2018 +0200 net/smc: add base infrastructure for SMC-D and ISM SMC supports two variants: SMC-R and SMC-D. For data transport, SMC-R uses RDMA devices, SMC-D uses so-called Internal Shared Memory (ISM) devices. An ISM device only allows shared memory communication between SMC instances on the same machine. For example, this allows virtual machines on the same host to communicate via SMC without RDMA devices. This patch adds the base infrastructure for SMC-D and ISM devices to the existing SMC code. It contains the following: * ISM driver interface: This interface allows an ISM driver to register ISM devices in SMC. In the process, the driver provides a set of device ops for each device. SMC uses these ops to execute SMC specific operations on or transfer data over the device. * Core SMC-D link group, connection, and buffer support: Link groups, SMC connections and SMC buffers (in smc_core) are extended to support SMC-D. * SMC type checks: Some type checks are added to prevent using SMC-R specific code for SMC-D and vice versa. To actually use SMC-D, additional changes to pnetid, CLC, CDC, etc. are required. These are added in follow-up patches. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun Suggested-by: Thomas Richter Signed-off-by: David S. Miller commit e82f2e31f5597a3de44bd27b7427f577f637c552 Author: Ursula Braun Date: Thu Jun 28 19:05:06 2018 +0200 net/smc: optimize consumer cursor updates The SMC protocol requires to send a separate consumer cursor update, if it cannot be piggybacked to updates of the producer cursor. Currently the decision to send a separate consumer cursor update just considers the amount of data already received by the socket program. It does not consider the amount of data already arrived, but not yet consumed by the receiver. Basing the decision on the difference between already confirmed and already arrived data (instead of difference between already confirmed and already consumed data), may lead to a somewhat earlier consumer cursor update send in fast unidirectional traffic scenarios, and thus to better throughput. Signed-off-by: Ursula Braun Suggested-by: Thomas Richter Signed-off-by: David S. Miller commit 0afff91c6f5ecef27715ea71e34dc2baacba1060 Author: Ursula Braun Date: Thu Jun 28 19:05:05 2018 +0200 net/smc: add pnetid support s390 hardware supports the definition of a so-call Physical NETwork IDentifier (short PNETID) per network device port. These PNETIDS can be used to identify network devices that are attached to the same physical network (broadcast domain). On s390 try to use the PNETID of the ethernet device port used for initial connecting, and derive the IB device port used for SMC RDMA traffic. On platforms without PNETID support fall back to the existing solution of a configured pnet table. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit be6a3f38ff2a2bfd2e591fdc566940a0d4d9428c Author: Ursula Braun Date: Thu Jun 28 19:05:04 2018 +0200 net/smc: determine port attributes independent from pnet table For SMC it is important to know the current port state of RoCE devices. Monitoring port states has been triggered, when a RoCE device was added to the pnet table. To support future alternatives to the pnet table the monitoring of ports is made independent of the existence of a pnet table. It starts once the smc_ib_device is established. Due to this change smc_ib_remember_port_attr() is now a local function and shuffling its location and the location of its used functions makes any forward references obsolete. And the duplicate SMC_MAX_PORTS definition is removed. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit b0402f0113675ad78bc10c839f93a25348dd1f73 Merge: b330219cb21d 4e74cc7c5d3f Author: David S. Miller Date: Sat Jun 30 20:34:09 2018 +0900 Merge branch 'Fixes-for-running-mirror-to-gretap-tests-on-veth' Petr Machata says: ==================== Fixes for running mirror-to-gretap tests on veth The forwarding selftests infrastructure makes it possible to run the individual tests on a purely software netdevices. Names of interfaces to run the test with can be passed as command line arguments to a test. lib.sh then creates veth pairs backing the interfaces if none exist in the system. However, the tests need to recognize that they might be run on a soft device. Many mirror-to-gretap tests are buggy in this regard. This patch set aims to fix the problems in running mirror-to-gretap tests on veth devices. In patch #1, a service function is split out of setup_wait(). In patch #2, installing a trap is made optional. In patch #3, tc filters in several tests are tweaked to work with veth. In patch #4, the logic for waiting for neighbor is fixed for veth. ==================== Signed-off-by: David S. Miller commit 4e74cc7c5d3f58cb0e2534cd68716c5746d52d07 Author: Petr Machata Date: Thu Jun 28 18:56:39 2018 +0200 selftests: forwarding: mirror_gre_changes: Fix waiting for neighbor When running the test on soft devices, there's no mechanism to gratuitously start resolving the neighbor for remote tunnel endpoint. So instead of passively waiting, wait for the device to be up, and then probe the neighbor with a ping. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit ec9fdc99f5a6a2cfe4061e807fcb0cc1129f0a2d Author: Petr Machata Date: Thu Jun 28 18:56:33 2018 +0200 selftests: forwarding: Tweak tc filters for mirror-to-gretap tests When running mirror_gre_bridge_1d_vlan tests on veth, several issues cause spurious failures: - vlan_ethtype should be ip, not ipv6 even in mirror-to-ip6gretap case, because the overlay packet is still IPv4. - Similarly ip_proto matches the innermost IP protocol, so can't be used to filter out GRE packet. Drop the corresponding condition. - Because the above fixes the filters to match in slow path as well, they need to be made skip_hw so as not to double-count packets. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit ac0fcadf03f8f86be28980d7aa0a09c202ec4f78 Author: Petr Machata Date: Thu Jun 28 18:56:28 2018 +0200 selftests: forwarding: lib: Avoid trapping soft devices There are several cases where traffic that would normally be forwarded in silicon needs to be observed in slow path. That's achieved by trapping such traffic, and the functions trap_install() and trap_uninstall() realize that. However, such treatment is obviously wrong if the device in question is actually a soft device not backed by an ASIC. Therefore try to trap if possible, but fall back to inserting a continue if not. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 010079bac0ce294f0ce177c0363e0e7579ed7f0c Author: Petr Machata Date: Thu Jun 28 18:56:20 2018 +0200 selftests: forwarding: lib: Split out setup_wait_dev() Split out of setup_wait() a function setup_wait_dev() that waits for a single device. This gives tests the opportunity to wait for a selected device after they tinkered with its upness. Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit b330219cb21ddbb79d02e31cdb768cc1340e51db Merge: dfe76a361427 14291d10a8f5 Author: David S. Miller Date: Sat Jun 30 20:15:45 2018 +0900 Merge branch 'xilinx_emaclite-coding-style' Radhey Shyam Pandey says: ==================== Fixes coding style in xilinx_emaclite.c This patchset fixes checkpatch and kernel-doc warnings in xilinx emaclite driver. No functional change. Changes from v2: -In 2/5 patch refactor if-else to make failure path return early. -In 2/5 patch coalesce the format onto a single line and add the missing space after the comma. ==================== Signed-off-by: David S. Miller commit 14291d10a8f5908224ecc219e8b77934f86e315c Author: Radhey Shyam Pandey Date: Thu Jun 28 18:41:50 2018 +0530 net: emaclite: Remove unnecessary spaces This patch fixes below checkpatch checks- CHECK: spaces preferred around that '*' (ctx:VxV) CHECK: No space is necessary after a cast Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit 49a83f002731dbfacb292d66399c828eb1e9f50f Author: Radhey Shyam Pandey Date: Thu Jun 28 18:41:49 2018 +0530 net: emaclite: Fix block comments style This patch fixes below checkpatch warnings- WARNING: Block comments use a trailing */ on a separate line WARNING: Block comments use * on subsequent lines WARNING: networking block comments don't use an empty /* line, use /* Comment Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit f713d50f33c1fbd1046832f30cf95921840a0150 Author: Radhey Shyam Pandey Date: Thu Jun 28 18:41:48 2018 +0530 net: emaclite: update kernel-doc comments This patch fixes below kernel-doc warnings: Function parameter or member 'maxlen' not described in 'xemaclite_recv_data' Function parameter or member 'address'not described in 'xemaclite_set_mac_address' Excess function parameter 'addr' description in 'xemaclite_set_mac_address' No description found for return value of 'xemaclite_interrupt' No description found for return value of 'xemaclite_mdio_write' Function parameter or member 'dev' not described in 'xemaclite_mdio_setup' Excess function parameter 'ofdev' description in 'xemaclite_mdio_setup' No description found for return value of 'xemaclite_open' No description found for return value of 'xemaclite_close' Excess function parameter 'match' description in 'xemaclite_of_probe' Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit aa5848bc4043abf92c0b72a636bbc0cbe2828fed Author: Radhey Shyam Pandey Date: Thu Jun 28 18:41:47 2018 +0530 net: emaclite: Simplify if-else statements Remove else as it is not required with if doing a return. It also coalesce the format onto a single line and add the missing space after the comma. Fixes below checkpatch warning- WARNING: else is not generally useful after a break or return Signed-off-by: Radhey Shyam Pandey Signed-off-by: Michal Simek Signed-off-by: David S. Miller commit 21d61166cada03405db7ad2d985b3c2c0e46e074 Author: Radhey Shyam Pandey Date: Thu Jun 28 18:41:46 2018 +0530 net: emaclite: Use __func__ instead of hardcoded name Switch hardcoded function name with a reference to __func__ making the code more maintainable. Address below checkpatch warning: WARNING: Prefer using '"%s...", __func__' to using 'xemaclite_mdio_read', this function's name, in a string + "xemaclite_mdio_read(phy_id=%i, reg=%x) == %x\n", WARNING: Prefer using '"%s...", __func__' to using 'xemaclite_mdio_write', this function's name, in a string + "xemaclite_mdio_write(phy_id=%i, reg=%x, val=%x)\n", Signed-off-by: Radhey Shyam Pandey Signed-off-by: Michal Simek Signed-off-by: David S. Miller commit dfe76a3614270a727d3f2bde4fc62e9f774365dd Merge: ea5d0c32498e dc734dbe9969 Author: David S. Miller Date: Sat Jun 30 18:54:09 2018 +0900 Merge branch 'mvpp2-Add-big-endian-support' Maxime Chevallier says: ==================== net: mvpp2: Add big-endian support This series allows to use PPv2 on system built as big endian. The first patch fixes the way we represent TX and RX descriptors, so that they used fixed little endianness as expected by the PPv2 controller. The second reworks the way we handle the software representation of the Header Parser entries, so that we don't use a union of arrays. The last two patches fixes some incorrect byte swapping logic, that wen't un-noticed on little-endian. This whole series doesn't fix any existing bug for little-endian systems, and since big-endian never worked for this driver, I didn't include 'fixes' tags. This was tested on MacchiatoBin (Armada 8040). ==================== Signed-off-by: David S. Miller commit dc734dbe99695862e4d9121b6b0af8716b8e09fa Author: Maxime Chevallier Date: Thu Jun 28 14:42:07 2018 +0200 net: mvpp2: Use htons when checking protocol info When checking the skb->protocol field, we have to make sure we use the proper endianness using htons, and not swab16. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 432b59426bcaf217137a27c384bc1d215946912d Author: Maxime Chevallier Date: Thu Jun 28 14:42:06 2018 +0200 net: mvpp2: prs: Drop unnecessary swab16 in vlan detection Vlan IDs must not be swapped when creating Header Parser entries. This has no effect on little-endian systems, but is wrong for big-endian. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit bd43d1ba12b71bda33bac82cff623bb8fa19b953 Author: Maxime Chevallier Date: Thu Jun 28 14:42:05 2018 +0200 net: mvpp2: prs: Drop unions representing TCAM and SRAM entries PPv2's Header Parser use some large TCAM and SRAM entries, that are duplicated in software so that we can write them to hardware only when we are done modifying them. Currently, PPv2 uses a union containing arrays of u32 and u8 to represent these entries, to facilitate byte per byte access. This representation is broken when we want to support big endian, and this makes the code confusing to read. This patch drops the union, and simply stores the TCAM and SRAM entries as u32 arrays, each entry corresponding to a 32-bit register. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 7b9c7d7dc539308e4b08974ebeba9cc1f685320b Author: Maxime Chevallier Date: Thu Jun 28 14:42:04 2018 +0200 net: mvpp2: Make TX / RX descriptors little-endian The PPv2 controller always expect descriptors to be in little endian. We must therefore force descriptors to use that format, and convert to the host endianness when necessary. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit ea5d0c32498e1a08ff5f3dbeafa4d74895851b0d Author: Yafang Shao Date: Thu Jun 28 00:22:56 2018 -0400 tcp: add new SNMP counter for drops when try to queue in rcv queue When sk_rmem_alloc is larger than the receive buffer and we can't schedule more memory for it, the skb will be dropped. In above situation, if this skb is put into the ofo queue, LINUX_MIB_TCPOFODROP is incremented to track it. While if this skb is put into the receive queue, there's no record. So a new SNMP counter is introduced to track this behavior. LINUX_MIB_TCPRCVQDROP: Number of packets meant to be queued in rcv queue but dropped because socket rcvbuf limit hit. Signed-off-by: Yafang Shao Signed-off-by: David S. Miller commit 83607344d667315687e1a5ddd2ad2fbbff22cc43 Author: Gustavo A. R. Silva Date: Wed Jun 27 20:32:23 2018 -0500 bnx2x: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 1f705bc61aee5fab2826bcf6de152a5d92378a85 Author: Jose Abreu Date: Wed Jun 27 15:57:02 2018 +0100 net: stmmac: Add support for CBS QDISC This adds support for CBS reconfiguration using the TC application. A new callback was added to TC ops struct and another one to DMA ops to reconfigure the channel mode. Tested in GMAC5.10. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Vitor Soares Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller commit 783e84961b1d7a75045383586b8c49e02b7704cd Author: Bjorn Helgaas Date: Fri Jun 29 21:17:26 2018 -0500 PCI: Make pci_get_rom_size() static pci_get_rom_size() is called only from pci_map_rom(), so it can be static. Make it static and remove the declaration from include/linux/pci.h. Signed-off-by: Bjorn Helgaas commit beced88e6af43c9653cee09f5111ae7495824e07 Author: Rex Zhu Date: Tue Jun 5 09:46:46 2018 +0800 PCI: Add check code for last image indicator not set If the "last image" indicator was not set in the PCI data struct, print "No more image in the PCI ROM" instead of looping back and printing "Invalid PCI ROM header signature". Signed-off-by: Rex Zhu Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Deucher commit 445ec321e71b3124abacfb358f72ac6a70d87602 Author: Rex Zhu Date: Tue Jun 5 09:46:45 2018 +0800 PCI: Avoid accessing memory outside the ROM BAR pci_get_rom_size() accepts the base and size of the ROM BAR as arguments. The byte at "rom + size" is the first byte *past* the ROM, so change ">" to ">=" to avoid accessing beyond the actual length of the ROM BAR. Signed-off-by: Rex Zhu [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Deucher commit ad281ecf1c7d4c905607e049b967bb6412587ca1 Author: Doug Meyer Date: Wed May 23 13:18:06 2018 -0700 PCI: Add DMA alias quirk for Microsemi Switchtec NTB Add a quirk for the Microsemi Switchtec parts to allow DMA access via non-transparent bridging to work when the IOMMU is turned on. This exclusively addresses the ability of a remote NT endpoint to perform DMA accesses through the locally enumerated NT endpoint. Other aspects of the Switchtec NTB functionality, such as interrupts for doorbells and messages are independent of this quirk, and will work whether the IOMMU is on or off. When a requestor on one NT endpoint accesses memory on another NT endpoint, it does this via a devfn proxy ID. Proxy IDs are statically assigned to each NT endpoint by the NTB hardware as part of the release-from-reset sequence prior to PCI enumeration. These proxy IDs cannot be modified dynamically, and are not visible to the host during enumeration. When the Switchtec NTB driver loads it will map local requestor IDs, such as the root complex and transparent bridge DMA engines, to proxy IDs by populating those requestor IDs in hardware mapping table table entries. This establishes a fixed relationship between a requestor ID and a proxy ID. When a peer on a remote NT endpoint performs an access within a particular translation window in it's NT endpoint BAR address space, that access is translated to a DMA request on the local endpoint's bus. As part of the translation process, the original requestor ID has its devfn replaced with the proxy ID, and the bus portion of the BDF is replaced with the bus of the local NT endpoint. Thus, the DMA access from a remote NT endpoint will appear on the local bus to have come from the unknown devfn which the IOMMU will reject. Interrogate NTB hardware registers for each remote NT endpoint to obtain the proxy IDs that have been assigned to it and alias them to the local (enumerated) NT endpoint's device. The IOMMU then accepts the remote proxy IDs as if they were requests coming directly from the enumerated endpoint, giving remote requestors access to memory resources which the local host has made available. Note that the aliasing of the proxy IDs cannot be performed at the driver level given the current IOMMU architecture. Superficially this is because pci_add_dma_alias() symbol is not exported. Functionally, the current IOMMU design requires the aliasing to be performed prior to the creation of IOMMU groups. If a driver were to attempt to use pci_add_dma_alias() in its probe routine it would fail since the IOMMU groups have been set up by that time. If the Switchtec hardware supported dynamic proxy ID (re-)assignment this would be an issue, but it does not. To further clarify static proxy ID assignment: While the requester ID to proxy ID mapping can be dynamically changed, the number and value of proxy IDs given to an NT EP cannot, even for dynamic reconfiguration such as hot-add. Therefore, the chip configuration must account a priori for the proxy IDs needs, considering both static and dynamic system configurations. For example, a port on the chip may not having anything plugged into it at start of day; but it must have a sufficient number of proxy IDs assigned to accommodate the supported devices which may be hot-added. Switchtec NTB functionality with the IOMMU off is unchanged by this quirk. Signed-off-by: Doug Meyer [bhelgaas: use hard-coded Device IDs instead of adding #defines for each] Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit cfdfc14e7fb8ae77290e9d5afaeecc0a234a3846 Author: Doug Meyer Date: Wed May 23 13:18:05 2018 -0700 switchtec: Use generic PCI Vendor ID and Class Code Move the Microsemi Switchtec PCI Vendor ID (same as PCI_VENDOR_ID_PMC_Sierra) to pci_ids.h. Also, replace Microsemi class constants with the standard PCI definitions. Signed-off-by: Doug Meyer [bhelgaas: restore SPDX (I assume it was removed by mistake), remove device ID definitions] Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit 11eb0e0e8dea8b97cff972b09cf6fb033b729dff Author: Sinan Kaya Date: Mon Jun 4 22:16:09 2018 -0400 PCI: Make early dump functionality generic Move early dump functionality into common code so that it is available for all architectures. No need to carry arch-specific reads around as the read hooks are already initialized by the time pci_setup_device() is getting called during scan. Tested-by: Andy Shevchenko Signed-off-by: Sinan Kaya Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit b1277a226d8c519b8c33e23fe68b4e1658f15963 Author: Christian König Date: Fri Jun 29 19:55:03 2018 -0500 PCI: Cleanup PCI_REBAR_CTRL_BAR_SHIFT handling Cleanup PCI_REBAR_CTRL_BAR_SHIFT handling. That was hard coded instead of properly defined in the header for some reason. Signed-off-by: Christian König Signed-off-by: Bjorn Helgaas commit d3252ace0bc652a1a244455556b6a549f969bf99 Author: Christian König Date: Fri Jun 29 19:54:55 2018 -0500 PCI: Restore resized BAR state on resume Resize BARs after resume to the expected size again. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199959 Fixes: d6895ad39f3b ("drm/amdgpu: resize VRAM BAR for CPU access v6") Fixes: 276b738deb5b ("PCI: Add resizable BAR infrastructure") Signed-off-by: Christian König Signed-off-by: Bjorn Helgaas CC: stable@vger.kernel.org # v4.15+ commit 60e9343b355118e903a155135f0511918d69e3ac Author: Kishon Vijay Abraham I Date: Fri Jun 29 15:57:53 2018 -0700 ARM: configs: keystone: Enable CONFIG_MMC_SDHCI_OMAP Enable CONFIG_MMC_SDHCI_OMAP so that TI's K2G SoC can use sdhci-omap driver for MMC/SD controller. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Santosh Shilimkar commit f7e8a182a41e791cca3d7a9e25adddf2908bddde Author: Kishon Vijay Abraham I Date: Fri Jun 29 15:57:27 2018 -0700 ARM: dts: keystone-k2g-evm: Use sdhci-omap programming model Use sdhci-omap programming model based on the generic sdhci library for programming the MMC/SD controller. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Santosh Shilimkar commit bb601b38ddceb6e2b37e4695b2f98e64e4775b66 Author: Kishon Vijay Abraham I Date: Fri Jun 29 15:57:18 2018 -0700 ARM: dts: keystone-k2g-evm: Add "vqmmc-supply" property for mmc0/mmc1 Add "vqmmc-supply" property for mmc0/mmc1 to indicate the supply connected to the IO lines. Also add dt node for ldo1 regulator required for mmc1 vqmmc-supply. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Santosh Shilimkar commit 1ea29bbd47cf5640fd67f8bcca1f934aa468c428 Author: Michal Wajdeczko Date: Mon Jun 18 11:18:20 2018 +0000 drm/i915/guc: Print CTL params passed to Guc While debugging we may want to examine params passed to GuC. v2: drop #ifdef DEBUG_GUC - Michal Signed-off-by: Michal Wajdeczko Cc: Daniele Ceraolo Spurio Cc: Michel Thierry Reviewed-by: Michel Thierry #1 Cc: Michal Winiarski Reviewed-by: Michał Winiarski Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180618111821.47088-1-michal.wajdeczko@intel.com commit 491657a915601febfb9d0c253d843124438ae35d Author: Eric Anholt Date: Thu Jun 21 16:17:59 2018 -0700 drm/vc4: Make DSI call into the bridge after the DSI link is enabled. This allows panels or bridges that need to send DSI commands during pre_enable() to successfully send them. We delay DISP0 (aka the actual display) enabling until after pre_enable so that pixels aren't streaming before then. v2: Just clear out the encoder->bridge value to disable the midlayer calls (idea by Andrzej Hajda). Signed-off-by: Eric Anholt Cc: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20180621231759.29604-1-eric@anholt.net Reviewed-by: Andrzej Hajda commit 14d9deeb273c2bf4ec256589adabd8df65395d36 Author: Eric Anholt Date: Wed Jun 20 17:17:03 2018 -0700 drm/v3d: Define the fourcc modifier for the Broadcom UIF format. This will be used by Mesa, and potentially other drivers in the future, to describe tiled buffers. Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180621001703.13522-1-eric@anholt.net Acked-by: Daniel Vetter commit 1c77483e4c50339b0306572167ccbff6b55d051b Author: Yishai Hadas Date: Wed Jun 20 17:11:39 2018 +0300 IB: Improve uverbs_cleanup_ucontext algorithm Improve uverbs_cleanup_ucontext algorithm to work properly when the topology graph of the objects cannot be determined at compile time. This is the case with objects created via the devx interface in mlx5. Typically uverbs objects must be created in a strict topologically sorted order, so that LIFO ordering will generally cause them to be freed properly. There are only a few cases (eg memory windows) where objects can point to things out of the strict LIFO order. Instead of using an explicit ordering scheme where the HW destroy is not allowed to fail, go over the list multiple times and allow the destroy function to fail. If progress halts then a final, desperate, cleanup is done before leaking the memory. This indicates a driver bug. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e620ebfc228dcbef7519e3d16f43c6c6f1a1d0cb Author: Bart Van Assche Date: Tue Jun 26 15:24:48 2018 -0700 IB/srpt: Support HCAs with more than two ports Since there are adapters that have four ports, increase the size of the srpt_device.port[] array. This patch avoids that the following warning is hit with quad port Chelsio adapters: WARN_ON(sdev->device->phys_port_cnt > ARRAY_SIZE(sdev->port)); Reported-by: Steve Wise Signed-off-by: Bart Van Assche Cc: Steve Wise Cc: Christoph Hellwig Cc: Reviewed-by: Steve Wise Signed-off-by: Jason Gunthorpe commit dff96888860a9ebaa618be973b51f4d86aec1211 Author: Dirk Hohndel (VMware) Date: Mon May 7 01:16:26 2018 +0200 drm/vmwgfx: add SPDX idenitifier and clarify license This is dual licensed under GPL-2.0 or MIT. vmwgfx_msg.h is the odd one out that is GPL-2.0+ or MIT. Acked-by: Thomas Gleixner Signed-off-by: Dirk Hohndel (VMware) Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180506231626.115996-9-dirk@hohndel.org commit a3be6f6c6e3e9fc93cf0ac19aae039c7135686e3 Author: Dirk Hohndel (VMware) Date: Mon May 7 01:16:25 2018 +0200 drm/vmwgfx: add SPDX idenitifier and clarify license These files are licensed under GPL-2.0. Removing the MIT boilerplate as that really didn't make any sense for those two header files. Acked-by: Thomas Gleixner Signed-off-by: Dirk Hohndel (VMware) Signed-off-by: Thomas Hellstrom Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180506231626.115996-8-dirk@hohndel.org commit eee3dc56e22eb8bf54eab925bba30bd94ae403bd Author: Dirk Hohndel (VMware) Date: Mon May 7 01:16:22 2018 +0200 drm/noveau: add SPDX identifier and clarify license This is dual licensed under GPL-2.0 or MIT. Acked-by: Thomas Gleixner Signed-off-by: Dirk Hohndel (VMware) Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180506231626.115996-5-dirk@hohndel.org commit 4f960dcf75421033b00052abcfc4454e4d302655 Author: Dirk Hohndel (VMware) Date: Mon May 7 01:16:21 2018 +0200 drm: add SPDX identifier and clarify license This is dual licensed under GPL-2.0 or MIT. Acked-by: Thomas Gleixner Signed-off-by: Dirk Hohndel (VMware) Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180506231626.115996-4-dirk@hohndel.org commit 3e2b88cbd225f0867fee6ba63ffe3c38a2e98822 Author: Dirk Hohndel (VMware) Date: Mon May 7 01:16:19 2018 +0200 drm: add SPDX idenitifier and clarify license This is dual licensed under GPL-2.0 or MIT. Signed-off-by: Dirk Hohndel (VMware) Signed-off-by: David Herrmann Signed-off-by: David Airlie Acked-by: Thomas Gleixner Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20180506231626.115996-2-dirk@hohndel.org commit 49e414c32053554736c421b1ac5b645f5c73e879 Author: Daniel Mack Date: Sun Jun 24 19:41:34 2018 +0200 arm: dts: pxa3xx: Add ssp ports to pxa3xx device tree Also fix the documentation for these bindings. The DMA properties have to be passed in the ssp users for now. Signed-off-by: Daniel Mack Signed-off-by: Robert Jarzmik commit 267a113cec976227810f99caf8eaa51f450f5a55 Author: Daniel Mack Date: Sun Jun 24 19:42:05 2018 +0200 arm: dts: pxa3xx: provide correct clk-names property for nand controller node The NAND driver looks for a clock named "core" and falls back to a pdev clock that has a wrong rate if not set. Signed-off-by: Daniel Mack Signed-off-by: Robert Jarzmik commit e66e39982ed1f9ee85e9b87fec9c1183b006edc4 Author: Daniel Mack Date: Sat Jun 23 21:37:45 2018 +0200 ARM: dts: pxa: add label to lcd controller node So it can be referenced and filled with more details from board files. Signed-off-by: Daniel Mack Signed-off-by: Robert Jarzmik commit be01de596ef65ad1fc66a795d45e7334d197e594 Author: Chris Wilson Date: Fri Jun 29 14:37:17 2018 +0100 drm/i915/selftests: Attach the fence to the object when making busy make_obj_busy() makes a dummy busy object, but didn't attach the fence to the reservation object, so it would not have registered as busy. For completeness, attach the dummy request as the exclusive fence and mark the object as written (in i915_vma_move_to_active) Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180629133717.11761-2-chris@chris-wilson.co.uk commit d78e2bbf483faa48f060c2454c56c3ff9cd74573 Author: Chris Wilson Date: Fri Jun 29 14:37:16 2018 +0100 drm/i915/selftests: Mark up write into scratch vma We correctly attach the exclusive fetch for the scratch object when emitting a request that writes into it, but for completeness we should also declared the write to i915_vma_move_to_active() Reported-by: Tvrtko Ursulin Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180629133717.11761-1-chris@chris-wilson.co.uk commit e14d7dfb41f5807a0c1c26a13f2b8ef16af24935 Author: Michal Hocko Date: Wed Jun 27 17:46:50 2018 +0200 x86/speculation/l1tf: Fix up pte->pfn conversion for PAE Jan has noticed that pte_pfn and co. resp. pfn_pte are incorrect for CONFIG_PAE because phys_addr_t is wider than unsigned long and so the pte_val reps. shift left would get truncated. Fix this up by using proper types. Fixes: 6b28baca9b1f ("x86/speculation/l1tf: Protect PROT_NONE PTEs against speculation") Reported-by: Jan Beulich Signed-off-by: Michal Hocko Signed-off-by: Thomas Gleixner Acked-by: Vlastimil Babka commit a7047564fef3ddf0092e64a229ddb17596717120 Author: Philipp Puschmann Date: Fri Jun 8 12:19:24 2018 +0200 clk: imx6: fix video_27m parent for IMX6QDL_CLK_CKO1_SEL q/dl datasheets list the 5th selection value for ck01_sel as video_27M_clk_root. By replacing the dummy value we then can set IMX6QDL_CLK_VIDEO_27M as parent for IMX6QDL_CLK_CKO1_SEL. Signed-off-by: Philipp Puschmann Reviewed-by: Fabio Estevam Signed-off-by: Stephen Boyd commit 4a2eaa8e2567297d4dc6e2709841a874927c83aa Author: Anson Huang Date: Mon Jun 4 09:06:46 2018 +0800 clk: imx6ul: remove clks_init_on array Clock framework will enable those clocks registered with CLK_IS_CRITICAL flag, so no need to have clks_init_on array during clock initialization now. ARM clock is busy divider type which has the CLK_IS_CRITICAL flag set by default when registered. Signed-off-by: Anson Huang Signed-off-by: Stephen Boyd commit debef195bd5c79210d60f1d6dec38bde3dae2b88 Author: Anson Huang Date: Sun Jun 3 09:44:04 2018 +0800 clk: imx6ul: add GPIO clock gates i.MX6UL has GPIO clock gates in CCM CCGR, add them into clock tree for clock management. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 222bce5eb88d1af656419db04bcd84b2419fb900 Author: Nicholas Mc Guire Date: Fri Jun 29 19:07:42 2018 +0200 ALSA: snd-aoa: add of_node_put() in error path Both calls to of_find_node_by_name() and of_get_next_child() return a node pointer with refcount incremented thus it must be explicidly decremented here after the last usage. As we are assured to have a refcounted np either from the initial of_find_node_by_name(NULL, name); or from the of_get_next_child(gpio, np) in the while loop if we reached the error code path below, an x of_node_put(np) is needed. Signed-off-by: Nicholas Mc Guire Fixes: commit f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa") Signed-off-by: Takashi Iwai commit 566f5b67fc0c3bffec03a963334eb7c1df30204d Author: Anson Huang Date: Mon Jun 4 09:06:45 2018 +0800 clk: imx6sx: remove clks_init_on array Clock framework will enable those clocks registered with CLK_IS_CRITICAL flag, so no need to have clks_init_on array during clock initialization now. ARM clock is busy divider type which has the CLK_IS_CRITICAL flag set by default when registered. IPG clock has no clock gate and its parent AHB clock is busy divider type, so no need to add CLK_IS_CRITICAL flag for IPG clock. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Stephen Boyd commit 8e12ce99541bdf5ec7cee08683bf455d8c882e49 Author: Anson Huang Date: Mon Jun 4 09:06:44 2018 +0800 clk: imx6sl: remove clks_init_on array Clock framework will enable those clocks registered with CLK_IS_CRITICAL flag, so no need to have clks_init_on array during clock initialization now. ARM clock is busy divider type which has the CLK_IS_CRITICAL flag set by default when registered. IPG clock has no clock gate and its parent AHB clock is busy divider type, so no need to add CLK_IS_CRITICAL flag for IPG clock. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Stephen Boyd commit 54614d1218fdf5ccf87ac1499514755fd9c4a179 Author: Anson Huang Date: Mon Jun 4 09:06:43 2018 +0800 clk: imx6q: remove clks_init_on array Clock framework will enable those clocks registered with CLK_IS_CRITICAL flag, so no need to have clks_init_on array during clock initialization now. ARM clock is busy divider type which has the CLK_IS_CRITICAL flag set by default when registered. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Stephen Boyd commit 68348441ef7d15e6a902c956e139723c99e065ed Author: Sagi Grimberg Date: Wed Jun 27 11:03:45 2018 +0300 IB/iser: set can_queue earlier to allow setting higher queue depth We need to set can_queue earlier than when enabling the scsi host. in a blk-mq enabled environment, the tagset allocation is taken from can_queue which cannot be modified later. Also, pass an updated .can_queue to iscsi_session_setup to have enough iscsi tasks allocated in the session kfifo. Reported-by: Karandeep Chahal Signed-off-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 24c937b39dfb102860e086f47ab9a58a0f6b0deb Author: Vijay Immanuel Date: Mon Jun 18 18:48:56 2018 -0700 IB/rxe: don't clear the tx queue on every transfer Do not call sk_dst_set() on every packet transfer because that calls sk_tx_queue_clear(), which clears the tx queue. A QP must stay on the same tx queue to maintain packet order. Signed-off-by: Vijay Immanuel Acked-by: Moni Shoua Signed-off-by: Jason Gunthorpe commit e8f127caf63ad29e2b4cb01894b97730384ad1ab Author: Mike Looijmans Date: Mon Jun 4 07:34:39 2018 +0200 clk-si514, clk-si544: Implement prepare/unprepare/is_prepared operations This adds prepare/unprepare/is_prepared functionality to the drivers for the SI544 and SI514 chips, allowing the clock output to be disabled when the clock is not in use. Signed-off-by: Mike Looijmans Signed-off-by: Stephen Boyd commit 92ebb6a0a13a698f88fb3ba58c01844f190d2af5 Author: Jason Gunthorpe Date: Wed Jun 27 10:44:26 2018 +0300 IB/cm: Remove now useless rcu_lock in dst_fetch_ha This lock used to be protecting a call to dst_get_neighbour_noref, however the below commit changed it to dst_neigh_lookup which no longer requires rcu. Access to nud_state, neigh_event_send or rdma_copy_addr does not require RCU, so delete the lock. Fixes: 02b619555ad6 ("infiniband: Convert dst_fetch_ha() over to dst_neigh_lookup().") Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 151779996597af671e14a6838589d99fa09ffc6d Author: Leon Romanovsky Date: Wed Jun 27 10:44:24 2018 +0300 RDMA/mlx5: Don't leak UARs in case of free fails The failure in releasing one UAR doesn't mean that we can't continue to release rest of system pages, so don't return too early. As part of cleanup, there is no need to print warning if mlx5_cmd_free_uar() fails because such warning will be printed as part of mlx5_cmd_exec(). Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7403bd14d7b545ef89c3443c09ccdb3c631a9a27 Author: Jia-Ju Bai Date: Sun Mar 18 22:53:28 2018 +0800 PCI: hv: Replace GFP_ATOMIC with GFP_KERNEL in new_pcichild_device() new_pcichild_device() is not called in atomic context. The call chain ending up at new_pcichild_device() is: [1] new_pcichild_device() <- pci_devices_present_work() pci_devices_present_work() is only set in INIT_WORK(). Despite never getting called from atomic context, new_pcichild_device() calls kzalloc with GFP_ATOMIC, which waits busily for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL to avoid busy waiting. Signed-off-by: Jia-Ju Bai [lorenzo.pieralisi@arm.com: reworked commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Michael Kelley commit dad05139541359d61ea0850a7fc5311d9ca560f0 Author: Michael Rodin Date: Sun Jun 3 20:17:33 2018 +0200 Documentation/process/howto.rst: add a missing cross-reference Add a missing cross-reference from Documentation/process/howto.rst to Documentation/admin-guide/README.rst. Signed-off-by: Michael Rodin Signed-off-by: Jonathan Corbet commit 351f10a3ce93dc3db29f8ab1ce4173115dadd3d3 Author: Michael Rodin Date: Sun Jun 3 20:16:09 2018 +0200 Documentation/admin-guide/README.rst: add a label for cross-referencing Add a label to the top of the file to allow cross-referencing. Currently it's not possible to cross-reference this file from Documentation/process/howto.rst because of the missing label. Signed-off-by: Michael Rodin Signed-off-by: Jonathan Corbet commit 8ab1416a6d51a6cbc4875b496f01f70dc43612f8 Author: Anders Roxell Date: Fri Jun 29 14:52:01 2018 +0200 doc: dev-tools: kselftest.rst: update contributing new tests Add a description that kernel config options should be added into a config file that is placed next to the newly added test. Signed-off-by: Anders Roxell Reviewed-by: Shuah Khan (Samsung OSG) Signed-off-by: Jonathan Corbet commit 30408a43a3b5ac26dc591496ee7f6e07e9d6f935 Merge: c65a6a930b70 ed56c5193ad8 Author: David S. Miller Date: Fri Jun 29 23:54:31 2018 +0900 Merge tag 'mlx5e-updates-2018-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5e-updates-2018-06-28 mlx5e netdevice driver updates: - Boris Pismenny added the support for UDP GSO in the first two patches. Impressive performance numbers are included in the commit message, @Line rate with ~half of the cpu utilization compared to non offload or no GSO at all. - From Tariq Toukan: - Convert large order kzalloc allocations to kvzalloc. - Added performance diagnostic statistics to several places in data path. From Saeed and Eran, - Update NIC HW stats on demand only, this is to eliminate the background thread needed to update some HW statistics in the driver cache in order to report error and drop counters from HW in ndo_get_stats. ==================== Signed-off-by: David S. Miller commit c65a6a930b70ce99bd34ea3835184d2deccd35a3 Merge: c90d160487c4 0ed5269f9e41 Author: David S. Miller Date: Fri Jun 29 23:50:27 2018 +0900 Merge branch 'net-Geneve-options-support-for-TC-act_tunnel_key' Jakub Kicinski says: ==================== net: Geneve options support for TC act_tunnel_key Simon & Pieter say: This set adds Geneve Options support to the TC tunnel key action. It provides the plumbing required to configure Geneve variable length options. The options can be configured in the form CLASS:TYPE:DATA, where CLASS is represented as a 16bit hexadecimal value, TYPE as an 8bit hexadecimal value and DATA as a variable length hexadecimal value. Additionally multiple options may be listed using a comma delimiter. v2: - fix sparse warnings in patches 3 and 4 (first one reported by build bot). ==================== Signed-off-by: David S. Miller commit 0ed5269f9e41f495c8e9020c85f5e1644c1afc57 Author: Simon Horman Date: Tue Jun 26 21:39:37 2018 -0700 net/sched: add tunnel option support to act_tunnel_key Allow setting tunnel options using the act_tunnel_key action. Options are expressed as class:type:data and multiple options may be listed using a comma delimiter. # ip link add name geneve0 type geneve dstport 0 external # tc qdisc add dev eth0 ingress # tc filter add dev eth0 protocol ip parent ffff: \ flower indev eth0 \ ip_proto udp \ action tunnel_key \ set src_ip 10.0.99.192 \ dst_ip 10.0.99.193 \ dst_port 6081 \ id 11 \ geneve_opts 0102:80:00800022,0102:80:00800022 \ action mirred egress redirect dev geneve0 Signed-off-by: Simon Horman Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 256c87c17c53e60882a43dcf3e98f3bf859eaf6f Author: Pieter Jansen van Vuuren Date: Tue Jun 26 21:39:36 2018 -0700 net: check tunnel option type in tunnel flags Check the tunnel option type stored in tunnel flags when creating options for tunnels. Thereby ensuring we do not set geneve, vxlan or erspan tunnel options on interfaces that are not associated with them. Make sure all users of the infrastructure set correct flags, for the BPF helper we have to set all bits to keep backward compatibility. Signed-off-by: Pieter Jansen van Vuuren Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 9d7298cd1dc55ebe053686f9bce74bfdcc812399 Author: Simon Horman Date: Tue Jun 26 21:39:35 2018 -0700 net/sched: act_tunnel_key: add extended ack support Add extended ack support for the tunnel key action by using NL_SET_ERR_MSG during validation of user input. Cc: Alexander Aring Signed-off-by: Simon Horman Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Reviewed-by: David Ahern Signed-off-by: David S. Miller commit a1165b591925551d7c8f1ed45484ebc2847ec8fa Author: Simon Horman Date: Tue Jun 26 21:39:34 2018 -0700 net/sched: act_tunnel_key: disambiguate metadata dst error cases Metadata may be NULL for one of two reasons: * Missing user input * Failure to allocate the metadata dst Disambiguate these case by returning -EINVAL for the former and -ENOMEM for the latter rather than -EINVAL for both cases. This is in preparation for using extended ack to provide more information to users when parsing their input. Signed-off-by: Simon Horman Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit c90d160487c4f82ba128730bcbaf7da760c5bdf1 Author: Arjun Vynipadath Date: Tue Jun 26 17:10:50 2018 +0530 cxgb4: Support ethtool private flags This is used to change TX workrequests, which helps in host->vf communication. Signed-off-by: Arjun Vynipadath Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit d5fbda61ac923e0adb89fd59fdf4a1d99406b86e Author: Arjun Vynipadath Date: Tue Jun 26 17:10:25 2018 +0530 cxgb4: Add support for FW_ETH_TX_PKT_VM_WR The present TX workrequest(FW_ETH_TX_PKT_WR) cant be used for host->vf communication, since it doesn't loopback the outgoing packets to virtual interfaces on the same port. This can be done using FW_ETH_TX_PKT_VM_WR. This fix depends on ethtool_flags to determine what WR to use for TX path. Support for setting this flags by user is added in next commit. Based on the original work by : Casey Leedom Signed-off-by: Casey Leedom Signed-off-by: Arjun Vynipadath Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 485f8b2824ef10f2a7b12d45a3f2b5c943aa1e04 Author: Simon Horman Date: Thu Jun 28 14:42:59 2018 +0200 arm64: dts: renesas: r8a77965: Add second port to rcar_sound placeholder This node is just a placeholder but fills that function better if it does not trigger build warnings. This update satisfies the requirement that nodes with #address-cells/#size-cells properties have more than one child node. This is flagged by dtc as follows: # make dtbs W=1 arch/arm64/boot/dts/renesas/r8a77965-salvator-x.dtb: Warning (graph_child_address): /soc/sound@ec500000/ports: graph node has single child node 'port@0', #address-cells/#size-cells are not necessary arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dtb: Warning (graph_child_address): /soc/sound@ec500000/ports: graph node has single child node 'port@0', #address-cells/#size-cells are not necessary Signed-off-by: Simon Horman Reviewed-by: Geert Uytterhoeven commit 4436a3711e3249840e0679e92d3c951bcaf25515 Author: Victor Gu Date: Tue Jun 26 10:17:01 2018 +0200 arm64: dts: marvell: armada-37xx: reserve memory for ATF The PSCI area should be reserved in Linux for PSCI operations such as suspend/resume. Reserve 2MiB of memory which matches the area used by ATF (BL1, BL2, BL3x, see [1] in ATF source code). This covers all PSCI code and data area and is 2MiB aligned, which is required by Linux for huge pages handling. Please note that this is a default setup allowing to perform PSCI operations with legacy bootloaders. Recent bootloaders should update the region size/position accordingly. [1] plat/marvell/a3700/common/include/platform_def.h Signed-off-by: Victor Gu [miquel.raynal@bootlin.com: reword of commit message, comment in the DTSI] Signed-off-by: Miquel Raynal Acked-by: Thomas Petazzoni Signed-off-by: Gregory CLEMENT commit d970737fa305a39900c2fc90d421d34d38345b45 Author: Gregory CLEMENT Date: Tue Jun 19 14:44:02 2018 +0200 arm64: dts: marvell: armada-37xx: add the node allowing AVS support In order to be able to use Adaptive Voltage Scaling, we need to add a reference to these registers. Acked-by: Viresh Kumar Signed-off-by: Gregory CLEMENT commit 17b98aadcedc823312bdc3641deae873027063bf Author: David Lechner Date: Thu May 31 15:25:49 2018 -0500 ARM: davinci_all_defconfig: Enable Bluetooth This enables Bluetooth modules in davinic_all_defconfig needed for LEGO MINDSTORMS EV3. Build CONFIG_SERIAL_DEV_BUS into the kernel since SERIAL_DEV_CTRL_TTYPORT requires it so. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit b0e9a2fe3ff971950833bc0ffc383babd9443bc4 Author: Xin Long Date: Thu Jun 28 15:31:00 2018 +0800 sctp: add support for SCTP_REUSE_PORT sockopt This feature is actually already supported by sk->sk_reuse which can be set by socket level opt SO_REUSEADDR. But it's not working exactly as RFC6458 demands in section 8.1.27, like: - This option only supports one-to-one style SCTP sockets - This socket option must not be used after calling bind() or sctp_bindx(). Besides, SCTP_REUSE_PORT sockopt should be provided for user's programs. Otherwise, the programs with SCTP_REUSE_PORT from other systems will not work in linux. To separate it from the socket level version, this patch adds 'reuse' in sctp_sock and it works pretty much as sk->sk_reuse, but with some extra setup limitations that are needed when it is being enabled. "It should be noted that the behavior of the socket-level socket option to reuse ports and/or addresses for SCTP sockets is unspecified", so it leaves SO_REUSEADDR as is for the compatibility. Note that the name SCTP_REUSE_PORT is somewhat confusing, as its functionality is nearly identical to SO_REUSEADDR, but with some extra restrictions. Here it uses 'reuse' in sctp_sock instead of 'reuseport'. As for sk->sk_reuseport support for SCTP, it will be added in another patch. Thanks to Neil to make this clear. v1->v2: - add sctp_sk->reuse to separate it from the socket level version. v2->v3: - improve changelog according to Marcelo's suggestion. Acked-by: Neil Horman Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 23c94d63a7e395c5706f7d9edde1ff839b050c5f Author: David Wu Date: Thu Jun 28 09:33:21 2018 +0800 net: ethernet: stmmac: dwmac-rk: Add GMAC support for px30 Add constants and callback functions for the dwmac on px30 Soc. The base structure is the same, but registers and the bits in them are moved slightly, and add the clk_mac_speed for selecting mac speed. Signed-off-by: David Wu Signed-off-by: David S. Miller commit 9b10000f4921e9f9f8231f9ceecae4446928844a Author: Gustavo A. R. Silva Date: Wed Jun 27 20:45:24 2018 -0500 tg3: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Acked-by: Michael Chan Signed-off-by: David S. Miller commit e6800d2601fafb51f5feb3c216c884c2efb4c77d Author: Andy Shevchenko Date: Wed Jun 27 15:05:53 2018 +0300 pinctrl: intel: Add Ice Lake PCH pin controller support This adds pinctrl/GPIO support for Intel Ice Lake PCH. The Ice Lake PCH GPIO is based on the same version of the Intel GPIO hardware than Intel Cannon Lake with different set of pins and ACPI ID. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg Signed-off-by: Linus Walleij commit 7bd160245196b8ddd6d1f424cae70779c7aff95e Merge: c981c01164d5 334bb8972a13 Author: Gustavo Padovan Date: Fri Jun 29 09:50:14 2018 -0300 Merge tag 'ib-fbdev-drm-v4.19-deferred-console-takeover-fixup' of https://github.com/bzolnier/linux into drm-misc-next Immutable branch between fbdev and drm for the v4.19 merge window (contains build fixup for the deferred console takeover feature) Signed-off-by: Gustavo Padovan # gpg: Signature made Fri 29 Jun 2018 06:47:23 AM -03 # gpg: using RSA key 7E33B63FA047C20B # gpg: Can't check signature: public key not found Link: https://patchwork.freedesktop.org/patch/msgid/3340294.YySDL1Tsl7@amdc3058 commit 6a230edd5d6e02655ad3a7ac718f521e96b9830c Author: Miquel Raynal Date: Tue Jun 26 16:06:13 2018 +0200 pinctrl: armada-37xx: add suspend/resume support Add suspend/resume hooks in pinctrl driver to handle S2RAM operations. Beyond the traditional register save/restore operations, these hooks also keep the GPIOs used for both-edge IRQ synchronized between their level (low/high) and expected IRQ polarity (falling/rising edge). Since pinctrl is an infrastructure module, its resume should be issued prior to other IO drivers. The pinctrl PM operations are requested at early/late stages for this reason. Suggested-by: Ken Ma Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Linus Walleij commit c1d9b4196ba6b311bd48a9320cd46aa125e0b034 Author: KaiChieh Chuang Date: Fri Jun 29 20:29:45 2018 +0800 ASoC: mt6797: sub dai use list_head Signed-off-by: KaiChieh Chuang Signed-off-by: Mark Brown commit f11c5db770ab675d270cb4d5a2bb90923066ef49 Author: KaiChieh Chuang Date: Fri Jun 29 20:29:44 2018 +0800 ASoC: mediatek: sub dai use list_head use list_head for sub_dais, since original sub_dais array is sparsely occupied Signed-off-by: KaiChieh Chuang Signed-off-by: Mark Brown commit 6c5d0736e9c09f00f5549f20390d6daae98a1bfd Author: Manivannan Sadhasivam Date: Sat Jun 23 10:29:54 2018 +0530 pinctrl: actions: Add interrupt support for OWL S900 SoC Add interrupt support for Actions Semi OWL S900 SoC. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit e3bc2ebd922dadfdc9eea569a2c93d70eb75fc07 Author: Manivannan Sadhasivam Date: Sat Jun 23 10:29:52 2018 +0530 dt-bindings: pinctrl: Add gpio interrupt bindings for Actions S900 SoC Add gpio interrupt bindings for Actions Semi S900 SoC. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Signed-off-by: Linus Walleij commit 216da1287a8a9e8a2dbef59c8bfc2f4dda11b92a Author: Loic Poulain Date: Wed Jun 20 09:58:00 2018 +0200 wcn36xx: Fix WEP encryption In case of WEP encryption, driver has to configure shared key for associated station(s). Note that sta pointer is NULL in case of non pairwise key, causing NULL pointer dereference with existing code (sta_priv->is_data_encrypted). Fix this by using associated sta list instead. This enables WEP support as client, WEP AP is non-functional. Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo commit e3160542ab488cff4e12c81066c51928c08e384d Author: Loic Poulain Date: Wed Jun 20 09:57:59 2018 +0200 wcn36xx: Track associated stations Add list of associated stations(STA, AP, peer...) per vif. Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo commit 10db60b9fab7d45a9c3b983ead41cd1416eb1cb3 Author: Loic Poulain Date: Wed Jun 20 09:57:58 2018 +0200 wcn36xx: Fix WEP104 encryption type This is an obvious copy & paste bug. Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo commit 62652555c616cad23a572f76cb5e870ab5395191 Author: Bob Copeland Date: Thu Jun 21 08:25:48 2018 -0400 ath10k: use locked skb_dequeue for rx completions In our environment we are occasionally seeing the following stack trace in ath10k: Unable to handle kernel paging request at virtual address 0000a800 pgd = c0204000 [0000a800] *pgd=00000000 Internal error: Oops: 17 [#1] SMP ARM Modules linked in: dwc3 dwc3_of_simple phy_qcom_dwc3 nf_nat xt_connmark CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.31 #2 Hardware name: Generic DT based system task: c09f4f40 task.stack: c09ee000 PC is at kfree_skb_list+0x1c/0x2c LR is at skb_release_data+0x6c/0x108 pc : [] lr : [] psr: 200f0113 sp : c09efb68 ip : c09efb80 fp : c09efb7c r10: 00000000 r9 : 00000000 r8 : 043fddd1 r7 : bf15d160 r6 : 00000000 r5 : d4ca2f00 r4 : ca7c6480 r3 : 000000a0 r2 : 01000000 r1 : c0a57470 r0 : 0000a800 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 10c5787d Table: 56e6006a DAC: 00000051 Process swapper/0 (pid: 0, stack limit = 0xc09ee210) Stack: (0xc09efb68 to 0xc09f0000) fb60: ca7c6480 d4ca2f00 c09efb9c c09efb80 c065da5c c065dcb4 fb80: d4ca2f00 00000000 dcbf8400 bf15d160 c09efbb4 c09efba0 c065db28 c065d9fc fba0: d4ca2f00 00000000 c09efbcc c09efbb8 c065db48 c065db04 d4ca2f00 00000000 fbc0: c09efbe4 c09efbd0 c065ddd0 c065db38 d4ca2f00 00000000 c09efc64 c09efbe8 fbe0: bf09bd00 c065dd10 00000003 7fffffff c09efc24 dcbfc9c0 01200000 00000000 fc00: 00000000 00000000 ddb7e440 c09e9440 c09efc48 1d195000 c09efc7c c09efc28 fc20: c027bb68 c028aa00 ddb7e4f8 bf13231c ddb7e454 0004091f bf154571 d4ca2f00 fc40: dcbf8d00 ca7c5df6 bf154538 01200000 00000000 bf154538 c09efd1c c09efc68 fc60: bf132458 bf09bbbc ca7c5dec 00000041 bf154538 bf154539 000007bf bf154545 fc80: bf154538 bf154538 bf154538 bf154538 bf154538 00000000 00000000 000016c1 fca0: 00000001 c09efcb0 01200000 00000000 00000000 00000000 00000000 00000001 fcc0: bf154539 00000041 00000000 00000007 00000000 000000d0 ffffffff 3160ffff fce0: 9ad93e97 3e973160 7bf09ad9 0004091f d4ca2f00 c09efdb0 dcbf94e8 00000000 fd00: dcbf8d00 01200000 00000000 dcbf8d00 c09efd44 c09efd20 bf132544 bf132130 fd20: dcbf8d00 00000000 d4ca2f00 c09efdb0 00000001 d4ca2f00 c09efdec c09efd48 fd40: bf133630 bf1324d0 ca7c5cc0 000007c0 c09efd88 c09efd70 c0764230 c02277d8 fd60: 200f0113 ffffffff dcbf94c8 bf000000 dcbf93b0 dcbf8d00 00000040 dcbf945c fd80: dcbf94e8 00000000 c09efdcc 00000000 c09efd90 c09efd90 00000000 00000024 fda0: dcbf8d00 00000000 00000005 dcbf8d00 c09efdb0 c09efdb0 00000000 00000040 fdc0: c09efdec dcbf8d00 dcbfc9c0 c09ed140 00000040 00000000 00000100 00000040 fde0: c09efe14 c09efdf0 bf1739b4 bf132840 dcbfc9c0 ddb82140 c09ed140 1d195000 fe00: 00000001 00000100 c09efe64 c09efe18 c067136c bf173958 ddb7fac8 c09f0d00 fe20: 001df678 0000012c c09efe28 c09efe28 c09efe30 c09efe30 c0a7fb28 ffffe000 fe40: c09f008c 00000003 00000008 c0a598c0 00000100 c09f0080 c09efeb4 c09efe68 fe60: c02096e0 c0671278 c0494584 00000080 dd5c3300 c09f0d00 00000004 001df677 fe80: 0000000a 00200100 dd5c3300 00000000 00000000 c09eaa70 00000060 dd410800 fea0: c09ee000 00000000 c09efecc c09efeb8 c0227944 c02094c4 00000000 00000000 fec0: c09efef4 c09efed0 c0268b64 c02278ac de802000 c09f1b1c c09eff20 c0a16cc0 fee0: de803000 c09ee000 c09eff1c c09efef8 c020947c c0268ae0 c02103dc 600f0013 ff00: ffffffff c09eff54 ffffe000 c09ee000 c09eff7c c09eff20 c021448c c0209424 ff20: 00000001 00000000 00000000 c021ddc0 00000000 00000000 c09f1024 00000001 ff40: ffffe000 c09f1078 00000000 c09eff7c c09eff80 c09eff70 c02103ec c02103dc ff60: 600f0013 ffffffff 00000051 00000000 c09eff8c c09eff80 c0763cc4 c02103bc ff80: c09effa4 c09eff90 c025f0e4 c0763c98 c0a59040 c09f1000 c09effb4 c09effa8 ffa0: c075efe0 c025efd4 c09efff4 c09effb8 c097dcac c075ef7c ffffffff ffffffff ffc0: 00000000 c097d6c4 00000000 c09c1a28 c0a59294 c09f101c c09c1a24 c09f61c0 ffe0: 4220406a 512f04d0 00000000 c09efff8 4220807c c097d95c 00000000 00000000 [] (kfree_skb_list) from [] (skb_release_data+0x6c/0x108) [] (skb_release_data) from [] (skb_release_all+0x30/0x34) [] (skb_release_all) from [] (__kfree_skb+0x1c/0x9c) [] (__kfree_skb) from [] (consume_skb+0xcc/0xd8) [] (consume_skb) from [] (ieee80211_rx_napi+0x150/0x82c [mac80211]) [] (ieee80211_rx_napi [mac80211]) from [] (ath10k_htt_t2h_msg_handler+0x15e8/0x19c4 [ath10k_core]) [] (ath10k_htt_t2h_msg_handler [ath10k_core]) from [] (ath10k_htt_t2h_msg_handler+0x16d4/0x19c4 [ath10k_core]) [] (ath10k_htt_t2h_msg_handler [ath10k_core]) from [] (ath10k_htt_txrx_compl_task+0xdfc/0x12cc [ath10k_core]) [] (ath10k_htt_txrx_compl_task [ath10k_core]) from [] (ath10k_pci_napi_poll+0x68/0xf4 [ath10k_pci]) [] (ath10k_pci_napi_poll [ath10k_pci]) from [] (net_rx_action+0x100/0x33c) [] (net_rx_action) from [] (__do_softirq+0x228/0x31c) [] (__do_softirq) from [] (irq_exit+0xa4/0x114) The trace points to a corrupt skb inside kfree_skb(), seemingly because one of the shared skb queues is getting corrupted. Most of the skb queues ath10k uses are local to a single call stack, but three are shared among multiple codepaths: - rx_msdus_q, - rx_in_ord_compl_q, and - tx_fetch_ind_q Of the three, the first two are manipulated using the unlocked skb_queue functions without any additional lock protecting them. Use the locked variants of skb_queue_* functions to protect these manipulations. Signed-off-by: Bob Copeland Signed-off-by: Kalle Valo commit 84a0d4669c8fdbe6e3e23937c5083af99a1946f2 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:36:45 2018 +0200 ath9k: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: QCA ath9k Development Cc: Kalle Valo Cc: "David S. Miller" Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Kalle Valo commit fe041deba4f6a857cd9d0c08a84b9f1709ede2b1 Author: Arnd Bergmann Date: Mon Jun 18 17:11:17 2018 +0200 ath9k: use timespec64 for tsf_ts ath9k is the last remaining user of the deprecated getrawmonotonic() interface. There is nothing wrong with this usage, but migrating to a timespec64 based interface lets us clean up the old API. Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo commit 0a94cf3457408058f894cc4d95e58d8e18eb7f75 Author: Daniel Mack Date: Wed Jun 27 21:33:59 2018 +0200 ASoC: pxa: make SND_PXA2XX_SOC_I2S selectable Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit c7b4f15ddb4f28451679019374027f5223c616ce Author: Daniel Mack Date: Wed Jun 27 21:33:58 2018 +0200 ASoC: pxa: remove bindings from pxa2xx-pcm This platform is no longer needed on DT boards, so let's remove them to avoid confusion. DT bindings should use the CPU DAIs (I2S/SSP/AC97) directly. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit d767d3ce5c48b3378e20e8cfd5d5379c4ca6001b Author: Daniel Mack Date: Wed Jun 27 21:33:57 2018 +0200 ASoC: pxa: provide PCM ops for ssp, i2s and ac97 components Now that the functions are now available through pxa2xx-lib, hook them up to pxa-sspi, pxa-ac97 and pxa-i2s. This allows DT platforms to use the DAIs without a platform driver. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 456ec80876564edb74a0fff78499beb7ca286302 Author: Daniel Mack Date: Wed Jun 27 21:33:56 2018 +0200 ASoC: pxa2xx-pcm-lib: fix indenting While at it, also fix some indenting. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 7afd1b0b2ef9a8120951188a955010ef92bdf885 Author: Daniel Mack Date: Wed Jun 27 21:33:55 2018 +0200 ASoC: pxa: move some functions to pxa2xx-lib To get rid of some intermediate platform layers, move pxa2xx_soc_pcm_new() and pxa2xx_pcm_ops in pxa2xx-lib. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit a7160670b5e2d6b59e0f7a5b7e5bcef3b532c24c Author: Daniel Mack Date: Wed Jun 27 21:33:54 2018 +0200 ASoC: pxa: clean up function names in pxa2xx-lib Clean up the namespace a bit and drop the __ prefix of all functions exported by pxa2xx-lib. This improves the readability of the code. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 95acb005fef2aeaeb63c20de98aca0ed5bd0efa2 Author: Daniel Mack Date: Wed Jun 27 21:33:53 2018 +0200 ASoC: fold pxa2xx-pcm into its only user, pxa2xx-ac97 Now that the PXA SSP bits are ported over to generic DMA, the pxa2xx-pcm code only has a single user left. This patch folds the remaining bits into its only user and removes the unnecessary glue layer along with its header file. The include dependency to linux/dma/pxa-dma.h is also gone now. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 8f54061d001ad2da24dba89fc48adbbf4c85222b Author: Robert Jarzmik Date: Thu Jun 28 22:08:37 2018 +0200 ASoC: pxa: remove the dmaengine compat need As the pxa architecture switched towards the dmaengine slave map, the old compatibility mechanism to acquire the dma requestor line number and priority are not needed anymore. This patch simplifies the dma resource acquisition, using the more generic function dma_request_slave_channel(). Signed-off-by: Robert Jarzmik Signed-off-by: Daniel Mack Signed-off-by: Mark Brown commit 13d7f936e9ccd9c9be38748a15a30a1dfa0beb64 Merge: d725d6e3290b 334bb8972a13 Author: Bartlomiej Zolnierkiewicz Date: Fri Jun 29 11:54:33 2018 +0200 Merge tag 'ib-fbdev-drm-v4.19-deferred-console-takeover-fixup' of https://github.com/bzolnier/linux into fbdev-for-next Immutable branch between fbdev and drm for the v4.19 merge window (contains build fixup for the deferred console takeover feature) commit 334bb8972a131e604a741e9b284d8867190c723e Author: Hans de Goede Date: Fri Jun 29 11:46:19 2018 +0200 console: dummycon: export dummycon_[un]register_output_notifier Export dummycon_[un]register_output_notifier, the fbcon code needs this and may be build as a module. Fixes: 83d83bebf401 ("console/fbcon: Add support for deferred console takeover") Cc: Stephen Rothwell Reported-by: Stephen Rothwell Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit 0894aa28aece680a81e28906e2f328084a3d55c3 Author: Radhey Shyam Pandey Date: Wed Jun 13 13:04:48 2018 +0530 dmaengine: xilinx_dma: Enable VDMA S2MM vertical flip support Vertical flip state is exported in xilinx_vdma_config and depending on IP configuration(c_enable_vert_flip) vertical flip state is programmed in hardware. Signed-off-by: Radhey Shyam Pandey Signed-off-by: Michal Simek Acked-by: Kedareswara rao Appana Signed-off-by: Vinod Koul commit 714b83924a2bc0cce00d73dd1fed7e35f60213a0 Author: Radhey Shyam Pandey Date: Wed Jun 13 13:04:47 2018 +0530 dt-bindings: dmaengine: xilinx_dma: Add VDMA vertical flip property The AXI VDMA core supports Vertical flip in S2MM path when Enable Vertical Flip (Advanced tab) is selected. To allow vertical flip programming define an optional 'xlnx,enable-vert-flip' channel child node property. Signed-off-by: Radhey Shyam Pandey Signed-off-by: Michal Simek Acked-by: Kedareswara rao Appana Reviewed-by: Rob Herring Signed-off-by: Vinod Koul commit 457209595789a3acd57990e2e9dade95bbea8fba Author: Maarten Lankhorst Date: Mon Jun 25 18:37:58 2018 +0200 drm/i915: Remove delayed FBC activation. The only time we should start FBC is when we have waited a vblank after the atomic update. We've already forced a vblank wait by doing wait_for_flip_done before intel_post_plane_update(), so we don't need to wait a second time before enabling. Removing the worker simplifies the code and removes possible race conditions, like happening in 103167. Cc: Paulo Zanoni Cc: Rodrigo Vivi Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103167 Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20180625163758.10871-2-maarten.lankhorst@linux.intel.com Reviewed-by: Ville Syrjälä commit c9855a561afa5b21db7f2218f0b7baaa555fa90c Author: Maarten Lankhorst Date: Mon Jun 25 18:37:57 2018 +0200 drm/i915: Block enabling FBC until flips have been completed There is a small race window in which FBC can be enabled after pre_plane_update is called, but before the page flip has been queued or completed. Signed-off-by: Maarten Lankhorst Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103167 Link: https://patchwork.freedesktop.org/patch/msgid/20180625163758.10871-1-maarten.lankhorst@linux.intel.com Reviewed-by: Ville Syrjälä commit a4217750586975dee7d6dd8829a1be24a7678b3d Author: Omer Efrat Date: Sun Jun 17 13:06:25 2018 +0300 mac80211: use BIT_ULL for NL80211_STA_INFO_* attribute types The BIT macro uses unsigned long which some architectures handle as 32 bit and therefore might cause macro's shift to overflow when used on a value equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards). Since 'filled' member in station_info changed to u64, BIT_ULL macro should be used with all NL80211_STA_INFO_* attribute types instead of BIT to prevent future possible bugs when one will use BIT macro for higher attributes by mistake. This commit cleans up all usages of BIT macro with the above field in mac80211 by changing it to BIT_ULL instead. Signed-off-by: Omer Efrat Signed-off-by: Johannes Berg commit 397c657a0644e7607c6aebea84d2b0f08ab59dfc Author: Omer Efrat Date: Sun Jun 17 13:06:14 2018 +0300 cfg80211: use BIT_ULL for NL80211_STA_INFO_* attribute types The BIT macro uses unsigned long which some architectures handle as 32 bit and therefore might cause macro's shift to overflow when used on a value equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards). Since 'filled' member in station_info changed to u64, BIT_ULL macro should be used with all NL80211_STA_INFO_* attribute types instead of BIT to prevent future possible bugs when one will use BIT macro for higher attributes by mistake. This commit cleans up all usages of BIT macro with the above field in cfg80211 by changing it to BIT_ULL instead. In addition, there are some places which don't use BIT nor BIT_ULL macros so align those as well. Signed-off-by: Omer Efrat Signed-off-by: Johannes Berg commit f0c0407d2a9fc3b2be33ec6c67ebc1f73595d2cb Author: Johannes Berg Date: Fri Jun 29 09:51:39 2018 +0200 mac80211: remove unnecessary NULL check We don't need to check if he_oper is NULL before calling ieee80211_verify_sta_he_mcs_support() as it - now - will correctly check this itself. Remove the redundant check. Signed-off-by: Johannes Berg commit 47aa7861b9bf8e8a540f3b11971e4a3f631e8ff4 Author: Gustavo A. R. Silva Date: Mon Jun 18 07:41:34 2018 -0500 mac80211: fix potential null pointer dereference he_op is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving the pointer dereference after he_op has been properly null checked. Notice that, currently, he_op is already being null checked before calling this function at 4593: 4593 if (!he_oper || 4594 !ieee80211_verify_sta_he_mcs_support(sband, he_oper)) 4595 ifmgd->flags |= IEEE80211_STA_DISABLE_HE; but in case ieee80211_verify_sta_he_mcs_support is ever called without verifying he_oper is not null, we will end up having a null pointer dereference. So, we better don't take any chances. Addresses-Coverity-ID: 1470068 ("Dereference before null check") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Johannes Berg commit fe0984d38938249f3f11fc558a8845fc6f8a0105 Author: Arnd Bergmann Date: Mon Jun 18 17:11:14 2018 +0200 cfg80211: track time using boottime The cfg80211 layer uses get_seconds() to read the current time in its supend handling. This function is deprecated because of the 32-bit time_t overflow, and it can cause unexpected behavior when the time changes due to settimeofday() calls or leap second updates. In many cases, we want to use monotonic time instead, however cfg80211 explicitly tracks the time spent in suspend, so this changes the driver over to use ktime_get_boottime_seconds(), which is slightly slower, but not used in a fastpath here. Signed-off-by: Arnd Bergmann Signed-off-by: Johannes Berg commit 58c77bf1d4107f5a21e98850af7e7e972fe98ba5 Merge: 6d268910a4e2 b6e71bdebb12 Author: David S. Miller Date: Fri Jun 29 11:32:55 2018 +0900 Merge branch 'ila-Cleanup' Tom Herbert says: ==================== ila: Cleanup Perform some cleanup in ILA code. This includes: - Fix rhashtable walk for cases where nl dumps are done with muliple function calls. Add a skip index to skip over entries in a node that have been previously visitied. Call rhashtable_walk_peek to avoid dropping items between calls to ila_nl_dump. - Call alloc_bucket_spinlocks to create bucket locks. - Split out module initialization and netlink definitions into separate files. - Add ILA_CMD_FLUSH netlink command to clear the ILA translation table. ==================== Signed-off-by: David S. Miller commit b6e71bdebb12cb79f931db358066a33f5f526b6a Author: Tom Herbert Date: Wed Jun 27 14:39:02 2018 -0700 ila: Flush netlink command to clear xlat table Add ILA_CMD_FLUSH netlink command to clear the ILA translation table. Signed-off-by: Tom Herbert Signed-off-by: David S. Miller commit ad68147ef2878cad0cb9aba2a682c4bb8832cca7 Author: Tom Herbert Date: Wed Jun 27 14:39:01 2018 -0700 ila: Create main ila source file Create a main ila file that contains the module initialization functions as well as netlink definitions. Previously these were defined in ila_xlat and ila_common. This approach allows better extensibility. Signed-off-by: Tom Herbert Signed-off-by: David S. Miller commit b893281715ab4ea0e63034165b4fa11d1bb984c5 Author: Tom Herbert Date: Wed Jun 27 14:39:00 2018 -0700 ila: Call library function alloc_bucket_locks To allocate the array of bucket locks for the hash table we now call library function alloc_bucket_spinlocks. Signed-off-by: Tom Herbert Signed-off-by: David S. Miller commit f7a2ba5ab9c5e7cf9036ec68d3528ccdf9e81b0a Author: Tom Herbert Date: Wed Jun 27 14:38:59 2018 -0700 ila: Fix use of rhashtable walk in ila_xlat.c Perform better EAGAIN handling, handle case where ila_dump_info fails and we missed objects in the dump, and add a skip index to skip over ila entires in a list on a rhashtable node that have already been visited (by a previous call to ila_nl_dump). Signed-off-by: Tom Herbert Signed-off-by: David S. Miller commit 6d268910a4e222184172e3b991d64c94edfa5388 Merge: 16c0cd074f2f ab68059e15d7 Author: David S. Miller Date: Fri Jun 29 11:06:35 2018 +0900 Merge branch 'hns3-a-few-code-improvements' Peng Li says: ==================== net: hns3: a few code improvements This patchset fixes a few code stylistic issues from concentrated review, no functional changes introduced. ==================== Signed-off-by: David S. Miller commit ab68059e15d7a05d162716fc0b3ca04b7df46c65 Author: Huazhong Tan Date: Thu Jun 28 12:12:29 2018 +0800 net: hns3: use lower_32_bits and upper_32_bits MACRO lower_32_bits and upper_32_bits can help to get bits 0-31 and bits 32-63 of a number, so just use it. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 541a7bd6bf23a1f4b5a1353b175279e0ba407871 Author: Huazhong Tan Date: Thu Jun 28 12:12:28 2018 +0800 net: hns3: remove back in struct hclge_hw hclge_hw is embedded in hclge_dev, so use container_of instead of back to get hclge_dev. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 43e2b1c7f4a498520c741b4c0a89f8475bd8b950 Author: Peng Li Date: Thu Jun 28 12:12:27 2018 +0800 net: hns3: remove the Redundant put_vector in hns3_client_uninit The interface h->ae_algo->ops->put_vector is called in both hns3_nic_dealloc_vector_data and hns3_nic_uninit_vector_data in hns3_client_uninit, this will cause vector freed twice. This patch remove the Redundant put_vector to make vector freed only once. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit ccc2bef8298031f5a74f0d9b39010379370035a2 Author: Peng Li Date: Thu Jun 28 12:12:26 2018 +0800 net: hns3: print the ret value in error information Print the ret value in error information can help find the reason. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 48569cdaaf8b624915b9ec07ce90e9d4b35af33a Author: Peng Li Date: Thu Jun 28 12:12:25 2018 +0800 net: hns3: extraction an interface for state init|uninit Extraction an interface for state init|uninit to make the code easier to read. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit fe589e0454b3a18ab9aaddaa8b4925e629d46792 Author: Peng Li Date: Thu Jun 28 12:12:24 2018 +0800 net: hns3: remove unused head file in hnae3.c linux/slab.h is not used in hnae3.h, this patch removes it. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 0e6084aa1c4eba8913143ea30254d50ed01724eb Author: Peng Li Date: Thu Jun 28 12:12:23 2018 +0800 net: hns3: add unlikely for error check The first bd of a packet is invalid and invalid ring head for tx IRQ is not offen, they may occur when there is error, Add unlikely for error check branch is better for performance. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 94c5e532130207f6ecfe0e1afd4ed3495ec1706f Author: Peng Li Date: Thu Jun 28 12:12:22 2018 +0800 net: hns3: add l4_type check for both ipv4 and ipv6 HW supports UDP, TCP and SCTP packets checksum for both ipv4 and ipv6, but do not support other type packets checksum for ipv4 or ipv6. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 36cbbdf6439729878271ff15422a643d13f133d4 Author: Peng Li Date: Thu Jun 28 12:12:21 2018 +0800 net: hns3: add vector status check before free vector If the hdev->vector_status[vector_id] is already HCLGE_INVALID_VPORT, should log the error and return. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit e718a93fee036fa8f9b09c76319c81713473287b Author: Peng Li Date: Thu Jun 28 12:12:20 2018 +0800 net: hns3: rename the interface for init_client_instance and uninit_client_instance The interface init_client_instance and uninit_client_instance do not register anything, only initialize the client instance. This patch rename the related interface to make the function name to indicate the purpose. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit b204bc74840080136bf11643e998dc83afc2c11e Author: Peng Li Date: Thu Jun 28 12:12:19 2018 +0800 net: hns3: remove hclge_get_vector_index from hclge_bind_ring_with_vector In hclge_unmap_ring_frm_vector, there are 2 steps: step 1: get vector index. step 2 unbind ring with vector. But it gets vector id again in step 2 interface. This patch removes hclge_get_vector_index from hclge_bind_ring_with_vector, and make the step the same with hns3 PF driver. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit c981c01164d5e47b98973f92d4680df4287275c2 Merge: eab976693153 83d83bebf401 Author: Gustavo Padovan Date: Thu Jun 28 18:56:03 2018 -0300 Merge tag 'ib-fbdev-drm-v4.19-deferred-console-takeover' of https://github.com/bzolnier/linux into drm-misc-next Immutable branch between fbdev and drm for the v4.19 merge window (contains the deferred console takeover feature) Signed-off-by: Gustavo Padovan # gpg: Signature made Thu 28 Jun 2018 10:24:50 AM -03 # gpg: using RSA key 7E33B63FA047C20B # gpg: Can't check signature: public key not found # Conflicts: # drivers/gpu/drm/i915/i915_gem.c # drivers/gpu/drm/i915/intel_crt.c # drivers/gpu/drm/i915/intel_display.c # drivers/gpu/drm/i915/intel_lrc.c Link: https://patchwork.freedesktop.org/patch/msgid/2462549.rLSfW9kX99@amdc3058 commit 9512f985c32d45ab439a210981e0d73071da395a Author: Chris Wilson Date: Thu Jun 28 21:12:11 2018 +0100 drm/i915/execlists: Direct submission of new requests (avoid tasklet/ksoftirqd) Back in commit 27af5eea54d1 ("drm/i915: Move execlists irq handler to a bottom half"), we came to the conclusion that running our CSB processing and ELSP submission from inside the irq handler was a bad idea. A really bad idea as we could impose nearly 1s latency on other users of the system, on average! Deferring our work to a tasklet allowed us to do the processing with irqs enabled, reducing the impact to an average of about 50us. We have since eradicated the use of forcewaked mmio from inside the CSB processing and ELSP submission, bringing the impact down to around 5us (on Kabylake); an order of magnitude better than our measurements 2 years ago on Broadwell and only about 2x worse on average than the gem_syslatency on an unladen system. In this iteration of the tasklet-vs-direct submission debate, we seek a compromise where by we submit new requests immediately to the HW but defer processing the CS interrupt onto a tasklet. We gain the advantage of low-latency and ksoftirqd avoidance when waking up the HW, while avoiding the system-wide starvation of our CS irq-storms. Comparing the impact on the maximum latency observed (that is the time stolen from an RT process) over a 120s interval, repeated several times (using gem_syslatency, similar to RT's cyclictest) while the system is fully laden with i915 nops, we see that direct submission an actually improve the worse case. Maximum latency in microseconds of a third party RT thread (gem_syslatency -t 120 -f 2) x Always using tasklets (a couple of >1000us outliers removed) + Only using tasklets from CS irq, direct submission of requests +------------------------------------------------------------------------+ | + | | + | | + | | + + | | + + + | | + + + + x x x | | +++ + + + x x x x x x | | +++ + ++ + + *x x x x x x | | +++ + ++ + * *x x * x x x | | + +++ + ++ * * +*xxx * x x xx | | * +++ + ++++* *x+**xx+ * x x xxxx x | | **x++++*++**+*x*x****x+ * +x xx xxxx x x | |x* ******+***************++*+***xxxxxx* xx*x xxx + x+| | |__________MA___________| | | |______M__A________| | +------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 118 91 186 124 125.28814 16.279137 + 120 92 187 109 112.00833 13.458617 Difference at 95.0% confidence -13.2798 +/- 3.79219 -10.5994% +/- 3.02677% (Student's t, pooled s = 14.9237) However the mean latency is adversely affected: Mean latency in microseconds of a third party RT thread (gem_syslatency -t 120 -f 1) x Always using tasklets + Only using tasklets from CS irq, direct submission of requests +------------------------------------------------------------------------+ | xxxxxx + ++ | | xxxxxx + ++ | | xxxxxx + +++ ++ | | xxxxxxx +++++ ++ | | xxxxxxx +++++ ++ | | xxxxxxx +++++ +++ | | xxxxxxx + ++++++++++ | | xxxxxxxx ++ ++++++++++ | | xxxxxxxx ++ ++++++++++ | | xxxxxxxxxx +++++++++++++++ | | xxxxxxxxxxx x +++++++++++++++ | |x xxxxxxxxxxxxx x + + ++++++++++++++++++ +| | |__A__| | | |____A___| | +------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 120 3.506 3.727 3.631 3.6321417 0.02773109 + 120 3.834 4.149 4.039 4.0375167 0.041221676 Difference at 95.0% confidence 0.405375 +/- 0.00888913 11.1608% +/- 0.244735% (Student's t, pooled s = 0.03513) However, since the mean latency corresponds to the amount of irqsoff processing we have to do for a CS interrupt, we only need to speed that up to benefit not just system latency but our own throughput. v2: Remember to defer submissions when under reset. v4: Only use direct submission for new requests v5: Be aware that with mixing direct tasklet evaluation and deferred tasklets, we may end up idling before running the deferred tasklet. v6: Remove the redudant likely() from tasklet_is_enabled(), restrict the annotation to reset_in_progress(). v7: Take the full timeline.lock when enabling perf_pmu stats as the tasklet is no longer a valid guard. A consequence is that the stats are now only valid for engines also using the timeline.lock to process state. Testcase: igt/gem_exec_latency/*rthog* References: 27af5eea54d1 ("drm/i915: Move execlists irq handler to a bottom half") Suggested-by: Tvrtko Ursulin Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-9-chris@chris-wilson.co.uk commit fd8526e509020ed30298ab57d03edc97bef83962 Author: Chris Wilson Date: Thu Jun 28 21:12:10 2018 +0100 drm/i915/execlists: Trust the CSB Now that we use the CSB stored in the CPU friendly HWSP, we do not need to track interrupts for when the mmio CSB registers are valid and can just check where we read up to last from the cached HWSP. This means we can forgo the atomic bit tracking from interrupt, and in the next patch it means we can check the CSB at any time. v2: Change the splitting inside reset_prepare, we only want to lose testing the interrupt in this patch, the next patch requires the change in locking Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-8-chris@chris-wilson.co.uk commit 3800cd1953059b64593c7ca1022071b96bc40ef3 Author: Chris Wilson Date: Thu Jun 28 21:12:09 2018 +0100 drm/i915/execlists: Stop storing the CSB read pointer in the mmio register As we now never read back our current head position from the CSB pointers register, and the HW itself doesn't use it to prevent overwriting unread CSB entries, we do not need to keep updating the register. As it turns out this register is not listed as being shadowed, and so requires forcewake -- but we haven't been taking forcewake around it so the writes has probably been regularly dropped. Fortuitously, we only read the value after a reset where it did not matter, and zero was the right answer (well, close enough). Mika pointed out that this was how we used to do it (accidentally!) before he fixed it in commit cc53699b25b5 ("drm/i915: Use masked write for Context Status Buffer Pointer"). References: cc53699b25b5 ("drm/i915: Use masked write for Context Status Buffer Pointer") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Daniele Ceraolo Spurio Cc: Mika Kuoppala Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-7-chris@chris-wilson.co.uk commit f4b58f0438ba53002e2032e3817c8e847da9a9e1 Author: Chris Wilson Date: Thu Jun 28 21:12:08 2018 +0100 drm/i915/execlists: Reset CSB write pointer after reset On HW reset, the HW clears the write pointer (to 0). But since it also writes its first CSB entry to slot 0, we need to reset the write pointer back to the element before (so the first entry we read is 0). This is required for the next patch, where we trust the CSB completely! v2: Use _MASKED_FIELD v3: Store the reset value, so that we differentiate between mmio/hwsp transparently and without pretense. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-6-chris@chris-wilson.co.uk commit bc4237ec8deaaee5f75d1afa91a19bfe6f948c6f Author: Chris Wilson Date: Thu Jun 28 21:12:07 2018 +0100 drm/i915/execlists: Unify CSB access pointers Following the removal of the last workarounds, the only CSB mmio access is for the old vGPU interface. The mmio registers presented by vGPU do not require forcewake and can be treated as ordinary volatile memory, i.e. they behave just like the HWSP access just at a different location. We can reduce the CSB access to a set of read/write/buffer pointers and treat the various paths identically and not worry about forcewake. (Forcewake is nightmare for worstcase latency, and we want to process this all with irqsoff -- no latency allowed!) v2: Comments, comments, comments. Well, 2 bonus comments. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-5-chris@chris-wilson.co.uk commit 8ea397fa70be357f52988eb156b324105b286607 Author: Chris Wilson Date: Thu Jun 28 21:12:06 2018 +0100 drm/i915/execlists: Process one CSB update at a time In the next patch, we will process the CSB events directly from the submission path, rather than only after a CS interrupt. Hence, we will no longer have the need for a loop until the has-interrupt bit is clear, and in the meantime can remove that small optimisation. v2: Tvrtko pointed out it was safer to unconditionally kick the tasklet after each irq, when assuming that the tasklet is called for each irq. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-4-chris@chris-wilson.co.uk commit d8857d541c67110cdcedb330e9677efdc9c5844d Author: Chris Wilson Date: Thu Jun 28 21:12:05 2018 +0100 drm/i915/execlists: Pull CSB reset under the timeline.lock In the following patch, we will process the CSB events under the timeline.lock and not serialised by the tasklet. This also means that we will need to protect access to common variables such as execlists->csb_head with the timeline.lock during reset. v2: Move sync_irq to avoid deadlocks between taking timeline.lock from our interrupt handler. v3: Kill off the synchronize_hardirq as it raises more questions than answered; now we use the timeline.lock entirely for CSB serialisation between the irq and elsewhere, we don't need to be so heavy handed with flushing v4: Treat request cancellation (wedging after failed reset) similarly Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-3-chris@chris-wilson.co.uk commit 0b02befa828c0be67a5416e10a0244e181fde0d3 Author: Chris Wilson Date: Thu Jun 28 21:12:04 2018 +0100 drm/i915/execlists: Pull submit after dequeue under timeline lock In the next patch, we will begin processing the CSB from inside the submission path (underneath an irqsoff section, and even from inside interrupt handlers). This means that updating the execlists->port[] will no longer be serialised by the tasklet but needs to be locked by the engine->timeline.lock instead. Pull dequeue and submit under the same lock for protection. (An alternate future plan is to keep the in/out arrays separate for concurrent processing and reduced lock coverage.) Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-2-chris@chris-wilson.co.uk commit 74093f3eccac232447ef95536c6a359ee7661650 Author: Chris Wilson Date: Thu Jun 28 21:12:03 2018 +0100 drm/i915: Drop posting reads to flush master interrupts We do not need to do a posting read of our uncached mmio write to re-enable the master interrupt lines after handling an interrupt, so don't. This saves us a slow UC read before we can process the interrupt, most noticeable in execlists where any stalls imposes extra latency on GPU command execution. Signed-off-by: Chris Wilson Reviewed-by: Ville Syrjala Link: https://patchwork.freedesktop.org/patch/msgid/20180628201211.13837-1-chris@chris-wilson.co.uk commit f7dc0157e4b5f23780559c6b71d3f7282f6c7f1b Author: Michal Wajdeczko Date: Thu Jun 28 14:15:21 2018 +0000 drm/i915/uc: Fetch GuC/HuC firmwares from guc/huc specific init We're fetching GuC/HuC firmwares directly from uc level during init_early stage but this breaks guc/huc struct isolation and also strict SW-only initialization rule for init_early. Move fw fetching to init phase and do it separately per guc/huc struct. v2: don't forget to move wopcm_init - Michele v3: fetch in init_misc phase - Michal Signed-off-by: Michal Wajdeczko Cc: Daniele Ceraolo Spurio Cc: Michel Thierry Reviewed-by: Michel Thierry #2 Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180628141522.62788-2-michal.wajdeczko@intel.com commit c39d2e7e35f6f357e59c7313dab8e90f7d1ff93e Author: Michal Wajdeczko Date: Thu Jun 28 14:15:20 2018 +0000 drm/i915/guc: Use intel_guc_init_misc to hide GuC internals We will add more init steps to misc phase and there is no need to expose them separately for use in uc_init_misc function. Signed-off-by: Michal Wajdeczko Cc: Michel Thierry Reviewed-by: Michel Thierry Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180628141522.62788-1-michal.wajdeczko@intel.com commit 509fda105ba8f9a1a5c6f8b79e4c7fc50b35c1e3 Author: Jesper Dangaard Brouer Date: Mon Jun 25 16:27:48 2018 +0200 samples/bpf: xdp_rxq_info action XDP_TX must adjust MAC-addrs XDP_TX requires also changing the MAC-addrs, else some hardware may drop the TX packet before reaching the wire. This was observed with driver mlx5. If xdp_rxq_info select --action XDP_TX the swapmac functionality is activated. It is also possible to manually enable via cmdline option --swapmac. This is practical if wanting to measure the overhead of writing/updating payload for other action types. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Toke Høiland-Jørgensen Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit 0d25c43ab988766ad52ff2930af3bf47d92c20ac Author: Jesper Dangaard Brouer Date: Mon Jun 25 16:27:43 2018 +0200 samples/bpf: extend xdp_rxq_info to read packet payload There is a cost associated with reading the packet data payload that this test ignored. Add option --read to allow enabling reading part of the payload. This sample/tool helps us analyse an issue observed with a NIC mlx5 (ConnectX-5 Ex) and an Intel(R) Xeon(R) CPU E5-1650 v4. With no_touch of data: Running XDP on dev:mlx5p1 (ifindex:8) action:XDP_DROP options:no_touch XDP stats CPU pps issue-pps XDP-RX CPU 0 14,465,157 0 XDP-RX CPU 1 14,464,728 0 XDP-RX CPU 2 14,465,283 0 XDP-RX CPU 3 14,465,282 0 XDP-RX CPU 4 14,464,159 0 XDP-RX CPU 5 14,465,379 0 XDP-RX CPU total 86,789,992 When not touching data, we observe that the CPUs have idle cycles. When reading data the CPUs are 100% busy in softirq. With reading data: Running XDP on dev:mlx5p1 (ifindex:8) action:XDP_DROP options:read XDP stats CPU pps issue-pps XDP-RX CPU 0 9,620,639 0 XDP-RX CPU 1 9,489,843 0 XDP-RX CPU 2 9,407,854 0 XDP-RX CPU 3 9,422,289 0 XDP-RX CPU 4 9,321,959 0 XDP-RX CPU 5 9,395,242 0 XDP-RX CPU total 56,657,828 The effect seen above is a result of cache-misses occuring when more RXQs are being used. Based on perf-event observations, our conclusion is that the CPUs DDIO (Direct Data I/O) choose to deliver packet into main memory, instead of L3-cache. We also found, that this can be mitigated by either using less RXQs or by reducing NICs the RX-ring size. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Toke Høiland-Jørgensen Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit ed56c5193ad89d1097cdbdc87abeb062e03a06eb Author: Saeed Mahameed Date: Wed May 23 18:26:09 2018 -0700 net/mlx5e: Update NIC HW stats on demand only Disable periodic stats update background thread and update stats in background on demand when ndo_get_stats is called. Having a background thread running in the driver all the time is bad for power consumption and normally a user space daemon will query the stats once every specific interval, so ideally the background thread and its interval can be done in user space.. Signed-off-by: Saeed Mahameed Reviewed-by: Eran Ben Elisha commit 2ad9ecdbe7d482867000d3da7cbccc63689a7f70 Author: Tariq Toukan Date: Sun May 13 13:42:16 2018 +0300 net/mlx5e: Add counter for total num of NOP operations A per-ring counter for NOP operations already exists. Here I add a counter that sums them up. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit b71ba6b46ffeeb99f4b5f52892e9029b700a9068 Author: Tariq Toukan Date: Wed Jun 28 19:27:18 2017 +0300 net/mlx5e: Add counter for MPWQE filler strides Add ethtool counter to indicate the number of strides consumed by filler CQEs. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit a1bf74dc6e66f91325cc8d35231e151a24a1f9ff Author: Tariq Toukan Date: Tue Mar 13 11:19:28 2018 +0200 net/mlx5e: Add channel events counter Add per-channel and global ethtool counters for channel events. Each event indicates an interrupt on one of the channel's completion queues. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit dc983f0e2b6e2b514cdb1c687fdf7b5a007f8ea4 Author: Tariq Toukan Date: Sun Mar 4 14:25:00 2018 +0200 net/mlx5e: Add a counter for congested UMRs Add per-ring and global ethtool counters for congested UMR requests. These events indicate congestion in UMR handlers in HW. Such event is concluded when there's an outstanding UMR post, yet the SW consumed at least two additional MPWQEs in the meanwhile. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 2d7103c800add14d9ea3194a704130622474d54f Author: Tariq Toukan Date: Wed May 2 18:29:42 2018 +0300 net/mlx5e: Add NAPI statistics Add per-channel and global ethtool counters for NAPI. This helps us monitor and analyze performance in general. - ch[i]_poll: the number of times the channel's NAPI poll was invoked. - ch[i]_arm: the number of times the channel's NAPI poll completed and armed the completion queues. - ch[i]_aff_change: the number of times the channel's NAPI poll explicitly stopped execution on a cpu due to a change in affinity. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit cbe73aaeecaee5157f5db282da21f407ab41805f Author: Tariq Toukan Date: Sun Mar 4 10:35:00 2018 +0200 net/mlx5e: Add XDP_TX completions statistics Add per-ring and global ethtool counters for XDP_TX completions. This helps us monitor and analyze XDP_TX flow performance. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 861556569645f907d50b70b663196291cf65cd34 Author: Tariq Toukan Date: Wed Apr 18 13:33:15 2018 +0300 net/mlx5e: Add TX completions statistics Add per-ring and global ethtool counters for TX completions. This helps us monitor and analyze TX flow performance. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit c400028371e54d0b247c65809b97d7cf44c2999c Author: Tariq Toukan Date: Sun Jun 3 17:41:48 2018 +0300 net/mlx5e: RX, Use existing WQ local variable Local variable 'wq' already points to &sq->wq, use it. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit ca11b798998a62c2bf87ea0477b5c60af25ba46d Author: Tariq Toukan Date: Tue Jun 5 11:47:04 2018 +0300 net/mlx5e: Convert large order kzalloc allocations to kvzalloc Replace calls to kzalloc_node with kvzalloc_node, as it fallsback to lower-order pages if the higher-order trials fail. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit bc5a7ccd9a6025e2ba555ab7dcd5043e2bfde315 Author: Boris Pismenny Date: Mon Jun 11 17:24:58 2018 +0300 net/mlx5e: Add UDP GSO remaining counter This patch adds a counter for tx UDP GSO packets that contain a segment that is not aligned to MSS - remaining segment. Signed-off-by: Boris Pismenny Signed-off-by: Saeed Mahameed commit 689adf0d4892680f5998ea424e0ace560b492dc2 Author: Boris Pismenny Date: Thu May 31 15:29:42 2018 +0300 net/mlx5e: Add UDP GSO support This patch enables UDP GSO support. We enable this by using two WQEs the first is a UDP LSO WQE for all segments with equal length, and the second is for the last segment in case it has different length. Due to HW limitation, before sending, we must adjust the packet length fields. We measure performance between two Intel(R) Xeon(R) CPU E5-2643 v2 @3.50GHz machines connected back-to-back with Connectx4-Lx (40Gbps) NICs. We compare single stream UDP, UDP GSO and UDP GSO with offload. Performance: | MSS (bytes) | Throughput (Gbps) | CPU utilization (%) UDP GSO offload | 1472 | 35.6 | 8% UDP GSO | 1472 | 25.5 | 17% UDP | 1472 | 10.2 | 17% UDP GSO offload | 1024 | 35.6 | 8% UDP GSO | 1024 | 19.2 | 17% UDP | 1024 | 5.7 | 17% UDP GSO offload | 512 | 33.8 | 16% UDP GSO | 512 | 10.4 | 17% UDP | 512 | 3.5 | 17% Signed-off-by: Boris Pismenny Signed-off-by: Yossi Kuperman Signed-off-by: Saeed Mahameed commit 6b5939d2e528525a1514adabe635f5f8f7328744 Author: Geert Uytterhoeven Date: Mon Jun 11 10:44:22 2018 +0200 MIPS: AR7: Normalize clk API Coldfire still provides its own variant of the clk API rather than using the generic COMMON_CLK API. This generally works, but it causes some link errors with drivers using the clk_round_rate(), clk_set_rate(), clk_set_parent(), or clk_get_parent() functions when a platform lacks those interfaces. This adds empty stub implementations for each of them, and I don't even try to do something useful here but instead just print a WARN() message to make it obvious what is going on if they ever end up being called. The drivers that call these won't be used on these platforms (otherwise we'd get a link error today), so the added code is harmless bloat and will warn about accidental use. Based on commit bd7fefe1f06ca6cc ("ARM: w90x900: normalize clk API"). Signed-off-by: Geert Uytterhoeven Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19503/ Cc: Arnd Bergmann Cc: linux-m68k@lists.linux-m68k.org Cc: linux-mips@linux-mips.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org commit 344ebf09949c31bcb8818d8458b65add29f1d67b Author: Paul Burton Date: Mon Jun 18 17:37:59 2018 -0700 MIPS: Always use -march=, not - shortcuts The VDSO Makefile filters CFLAGS to select a subset which it uses whilst building the VDSO ELF. One of the flags it allows through is the -march= flag that selects the architecture/ISA to target. Unfortunately in cases where CONFIG_CPU_MIPS32_R{1,2}=y and the toolchain defaults to building for MIPS64, the main MIPS Makefile ends up using the short-form - flags in cflags-y. This is because the calls to cc-option always fail to use the long-form -march= flag due to the lack of an -mabi= flag in KBUILD_CFLAGS at the point where the cc-option function is executed. The resulting GCC invocation is something like: $ mips64-linux-gcc -Werror -march=mips32r2 -c -x c /dev/null -o tmp cc1: error: '-march=mips32r2' is not compatible with the selected ABI These short-form - flags are dropped by the VDSO Makefile's filtering, and so we attempt to build the VDSO without specifying any architecture. This results in an attempt to build the VDSO using whatever the compiler's default architecture is, regardless of whether that is suitable for the kernel configuration. One encountered build failure resulting from this mismatch is a rejection of the sync instruction if the kernel is configured for a MIPS32 or MIPS64 r1 or r2 target but the toolchain defaults to an older architecture revision such as MIPS1 which did not include the sync instruction: CC arch/mips/vdso/gettimeofday.o /tmp/ccGQKoOj.s: Assembler messages: /tmp/ccGQKoOj.s:273: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:329: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:520: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:714: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1009: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1066: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1114: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1279: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1334: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1374: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1459: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1514: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:1814: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:2002: Error: opcode not supported on this processor: mips1 (mips1) `sync' /tmp/ccGQKoOj.s:2066: Error: opcode not supported on this processor: mips1 (mips1) `sync' make[2]: *** [scripts/Makefile.build:318: arch/mips/vdso/gettimeofday.o] Error 1 make[1]: *** [scripts/Makefile.build:558: arch/mips/vdso] Error 2 make[1]: *** Waiting for unfinished jobs.... This can be reproduced for example by attempting to build pistachio_defconfig using Arnd's GCC 8.1.0 mips64 toolchain from kernel.org: https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-mips64-linux.tar.xz Resolve this problem by using the long-form -march= in all cases, which makes it through the arch/mips/vdso/Makefile's filtering & is thus consistently used to build both the kernel proper & the VDSO. The use of cc-option to prefer the long-form & fall back to the short-form flags makes no sense since the short-form is just an abbreviation for the also-supported long-form in all GCC versions that we support building with. This means there is no case in which we have to use the short-form - flags, so we can simply remove them. The manual redefinition of _MIPS_ISA is removed naturally along with the use of the short-form flags that it accompanied, and whilst here we remove the separate assembler ISA selection. I suspect that both of these were only required due to the mips32 vs mips2 mismatch that was introduced by commit 59b3e8e9aac6 ("[MIPS] Makefile crapectomy.") and fixed but not cleaned up by commit 9200c0b2a07c ("[MIPS] Fix Makefile bugs for MIPS32/MIPS64 R1 and R2."). I've marked this for backport as far as v4.4 where the MIPS VDSO was introduced. In earlier kernels there should be no ill effect to using the short-form flags. Signed-off-by: Paul Burton Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # v4.4+ Reviewed-by: James Hogan Patchwork: https://patchwork.linux-mips.org/patch/19579/ commit 8e5c88bfbb8cca797e9e108abf6ef63028f678d8 Author: Joe Perches Date: Fri Jun 22 23:29:28 2018 -0700 MIPS: ath25: Convert random_ether_addr to eth_random_addr random_ether_addr is a #define for eth_random_addr which is generally preferred in kernel code by ~3:1 Convert the uses of random_ether_addr to enable removing the #define Signed-off-by: Joe Perches Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19600/ Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org commit 97c8580e85cf81cbc785102a1180f81ff431b1f0 Author: Paul Burton Date: Fri Jun 22 10:55:47 2018 -0700 MIPS: Annotate cpu_wait implementations with __cpuidle Annotate cpu_wait implementations using the __cpuidle macro which places these functions in the .cpuidle.text section. This allows cpu_in_idle() to return true for PC values which fall within these functions, allowing nmi_backtrace() to produce cleaner output for CPUs running idle functions. For example: # echo l >/proc/sysrq-trigger [ 38.587170] sysrq: SysRq : Show backtrace of all active CPUs [ 38.593657] NMI backtrace for cpu 1 [ 38.597611] CPU: 1 PID: 161 Comm: sh Not tainted 4.18.0-rc1+ #27 [ 38.604306] Stack : 00000000 00000004 00000006 80486724 00000000 00000000 00000000 00000000 [ 38.613647] 80e17eda 00000034 00000000 00000000 80d20000 80b67e98 8e559c90 0ffe1e88 [ 38.622986] 00000000 00000000 80e70000 00000000 8f61db18 38312e34 722d302e 202b3163 [ 38.632324] 8e559d3c 8e559adc 00000001 6b636162 80d20000 80000000 00000000 80d1cfa4 [ 38.641664] 00000001 80d20000 80d19520 00000000 00000003 80836724 00000004 80e10004 [ 38.650993] ... [ 38.653724] Call Trace: [ 38.656499] [<8040cdd0>] show_stack+0xa0/0x144 [ 38.661475] [<80b67e98>] dump_stack+0xe8/0x120 [ 38.666455] [<80b6f6d4>] nmi_cpu_backtrace+0x1b4/0x1cc [ 38.672189] [<80b6f81c>] nmi_trigger_cpumask_backtrace+0x130/0x1e4 [ 38.679081] [<808295d8>] __handle_sysrq+0xc0/0x180 [ 38.684421] [<80829b84>] write_sysrq_trigger+0x50/0x64 [ 38.690176] [<8061c984>] proc_reg_write+0xd0/0xfc [ 38.695447] [<805aac1c>] __vfs_write+0x54/0x194 [ 38.700500] [<805aaf24>] vfs_write+0xe0/0x18c [ 38.705360] [<805ab190>] ksys_write+0x7c/0xf0 [ 38.710238] [<80416018>] syscall_common+0x34/0x58 [ 38.715558] Sending NMI from CPU 1 to CPUs 0,2-3: [ 38.720916] NMI backtrace for cpu 0 skipped: idling at r4k_wait_irqoff+0x2c/0x34 [ 38.729186] NMI backtrace for cpu 3 skipped: idling at r4k_wait_irqoff+0x2c/0x34 [ 38.737449] NMI backtrace for cpu 2 skipped: idling at r4k_wait_irqoff+0x2c/0x34 Without this we get register value & backtrace output from all CPUs, which is generally useless for those running the idle function & serves only to overwhelm & obfuscate the meaningful output from non-idle CPUs. Signed-off-by: Paul Burton Cc: James Hogan Cc: Ralf Baechle Cc: Huacai Chen Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/19598/ commit e3be4079ea91c8b7bcb97cf44889ec5663c55fb4 Author: Chris Wilson Date: Wed Jun 27 21:13:04 2018 +0100 drm/i915: Only signal from interrupt when requested Avoid calling dma_fence_signal() from inside the interrupt if we haven't enabled signaling on the request. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180627201304.15817-4-chris@chris-wilson.co.uk commit 78796877c37cb2c3898c4bcd2a12238d83858287 Author: Chris Wilson Date: Wed Jun 27 21:13:03 2018 +0100 drm/i915: Move the irq_counter inside the spinlock Rather than have multiple locked instructions inside the notify_ring() irq handler, move them inside the spinlock and reduce their intrinsic locking. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180627201304.15817-3-chris@chris-wilson.co.uk commit 69dc4d003e3b7c262fd5fea3f25852e853eb6d4f Author: Chris Wilson Date: Wed Jun 27 21:13:02 2018 +0100 drm/i915: Only trigger missed-seqno checking next to boundary If we have more interrupts pending (because we know there are more breadcrumb signals before the completion), then we do not need to trigger an irq_seqno_barrier or even wakeup the task on this interrupt as there will be another. To allow some margin of error (we are trying to work around incoherent seqno after all), we wakeup the breadcrumb before the target as well as on the target. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180627201304.15817-2-chris@chris-wilson.co.uk commit 3f88325c2e396658a17632a19b59958750d7ad89 Author: Chris Wilson Date: Wed Jun 27 21:13:01 2018 +0100 drm/i915: Reduce spinlock hold time during notify_ring() interrupt By taking advantage of the RCU protection of the task struct, we can find the appropriate signaler under the spinlock and then release the spinlock before waking the task and signaling the fence. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180627201304.15817-1-chris@chris-wilson.co.uk commit 10195b1e4411191a30456e3e60bc539531b17053 Author: Chris Wilson Date: Thu Jun 28 14:22:06 2018 +0100 drm/i915: Show vma allocator stack when in doubt At the moment, gem_exec_gttfill fails with a sporadic EBUSY due to us wanting to unbind a pinned batch. Let's dump who first bound that vma to see if that helps us identify who still unexpectedly has it pinned. v2: We cannot allocate inside the printer (as it may be on an fs-reclaim path), so hope for the best and build the string on the stack v3: stack depth of 16 routinely overflows a 512 character string, limit it to 12 to avoid unsightly truncation. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180628132206.8329-1-chris@chris-wilson.co.uk commit 30f3b42147ba6f29bc95c1bba34468740762d91b Author: Uwe Kleine-König Date: Wed Jun 27 11:20:52 2018 +0200 can: mark led trigger as broken The driver was suggested for deletion as it implements a subset of the netdev trigger. It's in the way for further cleanups in the trigger code but doesn't get an Ack by someone who can actually test and confirm that the netdev trigger works for can devices. So marking as broken to get forward with the cleanups. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 868ec1cad0d93365ddbb1cba2b671c6c8c9221ba Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:49:06 2018 -0300 devicectree: bindings: fix location of leds common file The leds.txt was moved and renamed. Fix references to it accordingly. Fixes: f67605394f0b ("devicetree/bindings: Move gpio-leds binding into leds directory") Signed-off-by: Mauro Carvalho Chehab Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 3d74243db89f9c7cea7afc471f67e15b96cc6278 Author: Uwe Kleine-König Date: Tue Jun 26 11:37:58 2018 +0200 leds: triggers: don't depend on LEDS_TRIGGERS twice All the triggers are defined in a big if LEDS_TRIGGERS...endif block. So there is no need to let each driver depend on LEDS_TRIGGERS explicitly once more. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit 8cb21086cc6359c6d4f003a788050308afb211ad Author: Raffaello D. Di Napoli Date: Mon Jun 25 08:50:02 2018 -0400 leds: Modify PC Engines apu/apu2 driver to support apu3 PC Engines apu3 is an improved version of the apu2, using the same SoC and almost everything else. This patch reuses as much as possible from the apu2 definitions, to avoid redundancy. Signed-off-by: Raffaello D. Di Napoli Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit b0c6108ecf64fce3987f80c1610472a56d480d9a Author: Al Viro Date: Wed May 16 10:55:01 2018 -0400 nfs_instantiate(): prevent multiple aliases for directory inode Since NFS allows open-by-fhandle, we have to cope with the possibility of mkdir vs. open-by-guessed-handle races. A local filesystem could decide what the inumber of the new object will be and insert a locked inode with that inumber into icache _before_ the on-disk data structures begin to look good and unlock it only once it has a dentry alias, so that open-by-handle coming first would quietly fail and mkdir coming first would have open-by-handle grab its dentry. For NFS it's a non-starter - the icache key is server-supplied fhandle and we do not get that until the object has been fully created on server. We really have to deal with the possibility that open-by-handle gets the in-core inode and attaches a dentry to it before mkdir does. Solution: let nfs_mkdir() use d_splice_alias() to catch those. We can * get an error. Just return it to our caller. * get NULL - no preexisting dentry aliases, we'd just done what d_add() would've done. Success. * get a reference to preexisting alias. In that case the alias had been moved in place of nfs_mkdir() argument (and hashed there), while nfs_mkdir() argument is left unhashed negative. Which is just fine for ->mkdir() callers, all we need is to release the reference we'd got from d_splice_alias() and report success. Cc: Trond Myklebust Signed-off-by: Al Viro commit a24362ead99ab5d39b594a7b4ff48abc9addc059 Author: Thomas Zimmermann Date: Mon Jun 18 13:01:54 2018 +0200 drm/i915: Replace drm_dev_unref with drm_dev_put This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618110154.30462-6-tdz@users.sourceforge.net commit 01159b47a400fa8ba7026dd647d52e89ef7322bd Author: Thomas Zimmermann Date: Mon Jun 18 13:01:53 2018 +0200 drm/i915: Replace drm_gem_object_unreference_unlocked with put function This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618110154.30462-5-tdz@users.sourceforge.net commit 55f95c2723daedb44b0552c6ab10401e0bd32a22 Author: Thomas Zimmermann Date: Mon Jun 18 13:01:52 2018 +0200 drm/i915: Replace __drm_gem_object_unreference with __drm_gem_object_put This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618110154.30462-4-tdz@users.sourceforge.net commit 0f67706e6600cab897e1806133eea7f5000a2789 Author: Thomas Zimmermann Date: Mon Jun 18 13:01:51 2018 +0200 drm/i915: Replace drm_gem_object_{un/reference} with {put,get} functions This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618110154.30462-3-tdz@users.sourceforge.net commit ef196b5c2f4fb7a701a8f189cdcba94f422c9009 Author: Thomas Zimmermann Date: Mon Jun 18 13:01:50 2018 +0200 drm/i915: Replace drm_connector_{un/reference} with put,get functions This patch unifies the naming of DRM functions for reference counting of struct drm_connector. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618110154.30462-2-tdz@users.sourceforge.net commit a7f58b9ecfd3c0f63703ec10f4a592cc38dbd1b8 Author: Keith Busch Date: Tue May 8 10:00:22 2018 -0600 PCI: vmd: White list for fast interrupt handlers Devices with slow interrupt handlers are significantly harming performance when their interrupt vector is shared with a fast device. Create a class code white list for devices with known fast interrupt handlers and let all other devices share a single vector so that they don't interfere with performance. At the moment, only the NVM Express class code is on the list, but more may be added if VMD users desire to use other low-latency devices in these domains. Signed-off-by: Keith Busch [lorenzo.pieralisi@arm.com: changelog] Signed-off-by: Lorenzo Pieralisi Acked-by: Jon Derrick: commit 4fa7f086993594e79f456a04656da2fcb5691209 Author: Richard Guy Briggs Date: Thu Jun 14 16:20:06 2018 -0400 audit: simplify audit_enabled check in audit_watch_log_rule_change() Check the audit_enabled flag and bail immediately. This does not change the functionality, but brings the code format in line with similar checks in audit_tree_log_remove_rule(), audit_mark_log_rule_change(), and elsewhere in the audit code. See: https://github.com/linux-audit/audit-kernel/issues/50 Signed-off-by: Richard Guy Briggs [PM: tweaked subject line] Signed-off-by: Paul Moore commit 65a8766f5f50a5cd342f3d8f77a30917648ddb67 Author: Richard Guy Briggs Date: Thu Jun 14 16:20:05 2018 -0400 audit: check audit_enabled in audit_tree_log_remove_rule() Respect the audit_enabled flag when printing tree rule config change records. See: https://github.com/linux-audit/audit-kernel/issues/50 Signed-off-by: Richard Guy Briggs [PM: tweak the subject line] Signed-off-by: Paul Moore commit 96487173aaf69216fe4d7f8241ef42a539969789 Author: Baruch Siach Date: Thu Jun 28 10:13:36 2018 +0300 ARM: dts: armada388-clearfog: drop future changes disclaimer The current device-tree description of the SolidRun Armada 38x platforms has been successfully tested with production systems. Signed-off-by: Baruch Siach Acked-by: Jon Nettleton Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit bb683d7ad9d53442586cfdd0a79a6d6c1fec344e Author: Baruch Siach Date: Thu Jun 28 10:13:35 2018 +0300 ARM: dts: armada388-clearfog: enable spi flash The SolidRun Armada 388 SOM has the SPI flash populated by default unless the customer explicitly asks otherwise. Enable support by default. Signed-off-by: Baruch Siach Acked-by: Russell King Signed-off-by: Gregory CLEMENT commit 4b09791ba059cc5a5ec7d69049f5d05da65b6418 Author: Ondrej Mosnáček Date: Tue Jun 26 13:04:42 2018 +0200 cred: conditionally declare groups-related functions The groups-related functions declared in include/linux/cred.h are defined in kernel/groups.c, which is compiled only when CONFIG_MULTIUSER=y. Move all these function declarations under #ifdef CONFIG_MULTIUSER to help avoid accidental usage in contexts where CONFIG_MULTIUSER might be disabled. This patch also adds a fallback for groups_search(). Currently this function is only called from kernel/groups.c itself and security/keys/permissions.c, where the call is (by coincidence) optimized away in case CONFIG_MULTIUSER=n. However, the audit subsystem (which does not depend on CONFIG_MULTIUSER) calls this function in -next, so the fallback will be needed to avoid compilation errors or ugly workarounds. See also: https://lkml.org/lkml/2018/6/20/670 https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git/commit/?h=next&id=af85d1772e31fed34165a1b3decef340cf4080c0 Reported-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit c1e802f68ca057a5ce73ce81eb78dd6f455ff512 Author: Christian Lamparter Date: Mon May 28 13:06:01 2018 +0200 dt-bindings: pinctrl: qcom: add gpio-ranges, gpio-reserved-ranges This patch adds the gpio-ranges and gpio-reserved-ranges property definitions to the binding text files supported by the pinctrl-msm driver framework. gpio-ranges: For DT-based platforms the pinctrl-msm framework currently relies on the deprecated-for-DT gpiochip_add_pin_range() function to add the range of GPIOs to be handled by the pin controller. Due to interactions within gpiolib code, this causes the pinctrl-msm driver to bail out (-517) during boot when a gpio-hog is declared. This can be fatal and cause the system to not boot or reset (for a detailed explanation and call-trace, refer to patch: "pinctrl: msm: fix gpio-hog related boot issues" in this series). gpio-reserved-ranges: The binding has been added as a precaution since the TrustZone firmware (aka QSEE), which is running as the hypervisor, might have reserved certain, but undisclosed pins. Hence reading or writing to the registers for those pins will cause an XPU violation and this subsequently crashes the kernel. Signed-off-by: Christian Lamparter Reviewed-by: Rob Herring Signed-off-by: Linus Walleij commit 746777012c982c251d4cb173e02494c483ce4a35 Author: Joel Stanley Date: Mon Jun 18 22:15:06 2018 +0930 pinctrl: aspeed: Fix documentation Fixes these warnings: pinctrl-aspeed.c:112: warning: Function parameter or member 'map' not described in 'aspeed_sig_desc_eval' pinctrl-aspeed.c:112: warning: Excess function parameter 'regmap' description in 'aspeed_sig_desc_eval' Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Signed-off-by: Linus Walleij commit a319b56175ad6e9b619f9c6fddf7fde747791a7c Author: Mika Westerberg Date: Mon Jun 18 14:25:06 2018 +0300 pinctrl: cedarfork: Correct EAST pin ordering The driver missed the fact that PECI_SMB_DATA has moved from EAST community 224 to 182 instead. Correct the pin ordering accordingly. Signed-off-by: Mika Westerberg Acked-by: Andy Shevchenko Signed-off-by: Linus Walleij commit a98a5c27b54e01dd9c42e2b0addb543f0dc494cd Author: Michael Straube Date: Wed Jun 27 20:47:32 2018 +0200 staging: rtl8188eu: remove whitespace - coding style Remove unrequired whitespace in some declarations, fix an indentation and remove unrequired blank lines. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit a50d971c08ea72506d5f986fb7df9a5909c3997c Author: Michael Straube Date: Wed Jun 27 19:36:49 2018 +0200 staging: rtl8723bs: use mac_pton() in rtw_macaddr_cfg() Use the mac_pton() helper to convert the mac address string. The functions key_char2num() and key_2char2num() are not used anywhere else and can be removed. This also has the benefit of validating the input since mac_pton() returns false if the string is not valid. Signed-off-by: Michael Straube Reviewed-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman commit 9579ba6e5d4f2e823a16f0f99ba755cb345c3605 Author: Michael Straube Date: Wed Jun 27 19:36:48 2018 +0200 staging: rtl8723bs: use ether_addr_copy() in rtw_macaddr_cfg() Use ether_addr_copy() instead of memcpy() to copy the mac address. Suggested-by: Andy Shevchenko Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 375a2bd2758395ecf8aed01ea264953afede6a4f Author: Michael Straube Date: Wed Jun 27 19:36:47 2018 +0200 staging: rtl8723bs: refactor rtw_macaddr_cfg() Using is_broadcast_ether_addr() and is_zero_ether_addr() instead of testing each byte of the mac[] array for 0xff and 0x00 shortens the code and improves readability. If np == NULL, of_get_property() returns NULL, hence the "np" check is not needed. Instead of a fixed default mac address use a random one to reduce the likelihood of mac address collision. Thanks to Joe Perches and Dan Carpenter. Suggested-by: Joe Perches Suggested-by: Dan Carpenter Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 05ccc7061a3b2f11ac0a6c4d9528b4ca62acc139 Author: Michael Straube Date: Wed Jun 27 19:36:46 2018 +0200 staging: rtl8723bs: fix comparsion to NULL - coding style Fix comparsion to NULL issues found by checkpatch. Use !x instead of x == NULL. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit d725d6e3290bad6af3b8c60eaffc1663bc163910 Merge: 6b16f5d12202 83d83bebf401 Author: Bartlomiej Zolnierkiewicz Date: Thu Jun 28 15:41:55 2018 +0200 Merge tag 'ib-fbdev-drm-v4.19-deferred-console-takeover' of https://github.com/bzolnier/linux into fbdev-for-next Immutable branch between fbdev and drm for the v4.19 merge window (contains the deferred console takeover feature) commit 3c4a737267e89aafa6308c6c456d2ebea3fcd085 Author: Hugues Fruchet Date: Wed Jun 20 04:40:57 2018 -0400 media: ov5640: fix frame interval enumeration Driver must reject frame interval enumeration of unsupported resolution. This was detected by v4l2-compliance format ioctl test: v4l2-compliance Format ioctls: info: found 2 frameintervals for pixel format 4745504a and size 176x144 fail: v4l2-test-formats.cpp(123): found frame intervals for invalid size 177x144 test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL Signed-off-by: Hugues Fruchet Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2bbc46e811f0d40ed92ff9c104fce6618049f726 Author: Sakari Ailus Date: Thu Jun 21 05:41:21 2018 -0400 media: v4l-common: Make v4l2_find_nearest_size more sparse-friendly This sparse warning is emitted by using v4l2_find_nearest_size in some cases. Fix it in the framework. >> drivers/media/i2c/ov5640.c:1394:14: sparse: incorrect type in assignment +(different base types) @@ expected struct ov5640_mode_info const *mode @@ +got ststruct ov5640_mode_info const *mode @@ drivers/media/i2c/ov5640.c:1394:14: expected struct ov5640_mode_info const +*mode drivers/media/i2c/ov5640.c:1394:14: got struct ov5640_mode_info const ( *< +noident> )[9] Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 41cb1c739dcddf9905a5a3e3da9429b89cd5c616 Author: Philipp Puschmann Date: Wed Jun 6 05:11:38 2018 -0400 media: ov5640: adjust xclk_max According to ov5640 datasheet xvclk is allowed to be between 6 and 54 MHz. I run a successful test with 27 MHz. Signed-off-by: Philipp Puschmann Reviewed-by: Fabio Estevam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 22216ec41e919682c15345e95928f266e8ba6f9e Author: Akinobu Mita Date: Sun Jun 10 11:42:26 2018 -0400 media: soc_camera: ov772x: correct setting of banding filter The banding filter ON/OFF is controlled via bit 5 of COM8 register. It is attempted to be enabled in ov772x_set_params() by the following line. ret = ov772x_mask_set(client, COM8, BNDF_ON_OFF, 1); But this unexpectedly results disabling the banding filter, because the mask and set bits are exclusive. On the other hand, ov772x_s_ctrl() correctly sets the bit by: ret = ov772x_mask_set(client, COM8, BNDF_ON_OFF, BNDF_ON_OFF); The same fix was already applied to non-soc_camera version of ov772x driver in the commit commit a024ee14cd36 ("media: ov772x: correct setting of banding filter") Cc: Jacopo Mondi Cc: Laurent Pinchart Cc: Hans Verkuil Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 30ed2b83343bd1e07884ca7355dac70d25ffc158 Author: Akinobu Mita Date: Sun Jun 10 11:42:01 2018 -0400 media: s3c-camif: ignore -ENOIOCTLCMD from v4l2_subdev_call for s_power When the subdevice doesn't provide s_power core ops callback, the v4l2_subdev_call for s_power returns -ENOIOCTLCMD. If the subdevice doesn't have the special handling for its power saving mode, the s_power isn't required. So -ENOIOCTLCMD from the v4l2_subdev_call should be ignored. Cc: Hans Verkuil Signed-off-by: Akinobu Mita Acked-by: Sylwester Nawrocki Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2ec7debd44b49927a6e2861521994cc075a389ed Author: Javier Martinez Canillas Date: Sat Jun 9 08:22:45 2018 -0400 media: omap3isp: zero-initialize the isp cam_xclk{a,b} initial data The struct clk_init_data init variable is declared in the isp_xclk_init() function so is an automatic variable allocated in the stack. But it's not explicitly zero-initialized, so some init fields are left uninitialized. This causes the data structure to have undefined values that may confuse the common clock framework when the clock is registered. For example, the uninitialized .flags field could have the CLK_IS_CRITICAL bit set, causing the framework to wrongly prepare the clk on registration. This leads to the isp_xclk_prepare() callback being called, which in turn calls to the omap3isp_get() function that increments the isp dev refcount. Since this omap3isp_get() call is unexpected, this leads to an unbalanced omap3isp_get() call that prevents the requested IRQ to be later enabled, due the refcount not being 0 when the correct omap3isp_get() call happens. Fixes: 9b28ee3c9122 ("[media] omap3isp: Use the common clock framework") Signed-off-by: Javier Martinez Canillas Reviewed-by: Sebastian Reichel Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 16c0cd074f2fde76541395c6b269dd3a44d7425b Merge: 003504a23a76 9c4c325252c5 Author: David S. Miller Date: Thu Jun 28 22:21:33 2018 +0900 Merge branch 'net-preserve-sock-reference-when-scrubbing-the-skb' Flavio Leitner says: ==================== net: preserve sock reference when scrubbing the skb. The sock reference is lost when scrubbing the packet and that breaks TSQ (TCP Small Queues) and XPS (Transmit Packet Steering) causing performance impacts of about 50% in a single TCP stream when crossing network namespaces. XPS breaks because the queue mapping stored in the socket is not available, so another random queue might be selected when the stack needs to transmit something like a TCP ACK, or TCP Retransmissions. That causes packet re-ordering and/or performance issues. TSQ breaks because it orphans the packet while it is still in the host, so packets are queued contributing to the buffer bloat problem. Preserving the sock reference fixes both issues. The socket is orphaned anyways in the receiving path before any relevant action, but the transmit side needs some extra checking included in the first patch. The first patch will update netfilter to check if the socket netns is local before use it. The second patch removes the skb_orphan() from the skb_scrub_packet() and improve the documentation. ChangeLog: - split into two (Eric) - addressed Paolo's offline feedback to swap the checks in xt_socket.c to preserve original behavior. - improved ip-sysctl.txt (reported by Cong) ==================== Signed-off-by: David S. Miller commit 5b0a205466578432ce8faadd08f8d7ef895a180f Author: Alan Chiang Date: Tue Apr 24 22:12:08 2018 -0400 media: dw9807: Add dw9807 vcm driver DW9807 is a 10 bit DAC from Dongwoon, designed for linear control of voice coil motor. This driver creates a V4L2 subdevice and provides control to set the desired focus. Signed-off-by: Alan Chiang Signed-off-by: Andy Yeh Reviewed-by: Jacopo Mondi Reviewed-by: Tomasz Figa Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9c4c325252c54b34d53b3d0ffd535182b744e03d Author: Flavio Leitner Date: Wed Jun 27 10:34:26 2018 -0300 skbuff: preserve sock reference when scrubbing the skb. The sock reference is lost when scrubbing the packet and that breaks TSQ (TCP Small Queues) and XPS (Transmit Packet Steering) causing performance impacts of about 50% in a single TCP stream when crossing network namespaces. XPS breaks because the queue mapping stored in the socket is not available, so another random queue might be selected when the stack needs to transmit something like a TCP ACK, or TCP Retransmissions. That causes packet re-ordering and/or performance issues. TSQ breaks because it orphans the packet while it is still in the host, so packets are queued contributing to the buffer bloat problem. Preserving the sock reference fixes both issues. The socket is orphaned anyways in the receiving path before any relevant action and on TX side the netfilter checks if the reference is local before use it. Signed-off-by: Flavio Leitner Signed-off-by: David S. Miller commit f564650106a6e85702660fefd59fdff0877ab46a Author: Flavio Leitner Date: Wed Jun 27 10:34:25 2018 -0300 netfilter: check if the socket netns is correct. Netfilter assumes that if the socket is present in the skb, then it can be used because that reference is cleaned up while the skb is crossing netns. We want to change that to preserve the socket reference in a future patch, so this is a preparation updating netfilter to check if the socket netns matches before use it. Signed-off-by: Flavio Leitner Acked-by: Florian Westphal Signed-off-by: David S. Miller commit 83d83bebf40132e2d55ec58af666713cc76f9764 Author: Hans de Goede Date: Thu Jun 28 15:20:30 2018 +0200 console/fbcon: Add support for deferred console takeover Currently fbcon claims fbdevs as soon as they are registered and takes over the console as soon as the first fbdev gets registered. This behavior is undesirable in cases where a smooth graphical bootup is desired, in such cases we typically want the contents of the framebuffer (typically a vendor logo) to stay in place as is. The current solution for this problem (on embedded systems) is to not enable fbcon. This commit adds a new FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER config option, which when enabled defers fbcon taking over the console from the dummy console until the first text is displayed on the console. Together with the "quiet" kernel commandline option, this allows fbcon to still be used together with a smooth graphical bootup, having it take over the console as soon as e.g. an error message is logged. Note the choice to detect the first console output in the dummycon driver, rather then handling this entirely inside the fbcon code, was made after 2 failed attempts to handle this entirely inside the fbcon code. The fbcon code is woven quite tightly into the console code, making this to only feasible option. Reviewed-by: Daniel Vetter Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit 3bd3a0e330aae4fffa8028aba2407ef615ab040b Author: Hans de Goede Date: Thu Jun 28 15:20:28 2018 +0200 fbcon: Call WARN_CONSOLE_UNLOCKED() where applicable Replace comments about places where the console lock should be held with calls to WARN_CONSOLE_UNLOCKED() to assert that it is actually held. Acked-by: Steven Rostedt (VMware) Reviewed-by: Daniel Vetter Reviewed-by: Sergey Senozhatsky Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit d48de54a9dab5370edd2e991f78cc7996cf5483e Author: Hans de Goede Date: Thu Jun 28 15:20:27 2018 +0200 printk: Export is_console_locked This is a preparation patch for adding a number of WARN_CONSOLE_UNLOCKED() calls to the fbcon code, which may be built as a module (event though usually it is not). Acked-by: Steven Rostedt (VMware) Acked-by: Sergey Senozhatsky Acked-by: Petr Mladek Reviewed-by: Daniel Vetter Signed-off-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit 5129c0e1f6ac65eb1524aa520b06c6c742f0430e Author: Alan Chiang Date: Tue Apr 24 22:12:07 2018 -0400 media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil Dongwoon DW9807 is a voice coil lens driver. Signed-off-by: Alan Chiang Signed-off-by: Andy Yeh Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6882e01bf8b9e176f9a1f7f7431e269363c19b84 Author: Yong Zhi Date: Wed May 30 18:51:17 2018 -0400 media: MAINTAINERS: Update entry for Intel IPU3 cio2 driver This patch adds Bingbu as additional maintainer, and both Tian Shu and Jian Xu as reviewers for IPU3 CIO2 driver. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6f3de8388efcede60a7aee04022c4d02719f44c8 Author: Arnd Bergmann Date: Fri May 25 11:25:08 2018 -0400 media: omap3isp: fix warning for !CONFIG_PM The final version of the COMPILE_TEST patch for this driver missed one warning about suspend/resume functions that can now appear on platforms that don't always set CONFIG_PM: drivers/media/platform/omap3isp/isp.c:1008:13: error: 'isp_resume_modules' defined but not used [-Werror=unused-function] static void isp_resume_modules(struct isp_device *isp) ^~~~~~~~~~~~~~~~~~ drivers/media/platform/omap3isp/isp.c:974:12: error: 'isp_suspend_modules' defined but not used [-Werror=unused-function] static int isp_suspend_modules(struct isp_device *isp) This marks the respective functions as __maybe_unused as an easy workaround. Fixes: 243131134be4 ("media: omap3isp: Allow it to build with COMPILE_TEST") Signed-off-by: Arnd Bergmann Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 795bce437f4ef9bdc116af1d7575c9f73f783a0c Author: Akinobu Mita Date: Sun May 6 10:19:29 2018 -0400 media: ov772x: create subdevice device node Set the V4L2_SUBDEV_FL_HAS_DEVNODE flag for the subdevice so that the subdevice device node is created. Cc: Laurent Pinchart Cc: Hans Verkuil Signed-off-by: Akinobu Mita Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7b9998c9361950040af1c6e7a914519e891052a1 Author: Akinobu Mita Date: Sun May 6 10:19:28 2018 -0400 media: ov772x: make set_fmt() and s_frame_interval() return -EBUSY while streaming The ov772x driver is going to offer a V4L2 sub-device interface, so changing the output data format and the frame interval on this sub-device can be made anytime. However, these requests are preferred to fail while the video stream on the device is active. Cc: Laurent Pinchart Cc: Hans Verkuil Signed-off-by: Akinobu Mita Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 95f5a45aea8800e011698fef1c4f535e9afb374a Author: Akinobu Mita Date: Sun May 6 10:19:27 2018 -0400 media: ov772x: avoid accessing registers under power saving mode The set_fmt() in subdev pad ops, the s_ctrl() for subdev control handler, and the s_frame_interval() in subdev video ops could be called when the device is under power saving mode. These callbacks for ov772x driver cause updating H/W registers that will fail under power saving mode. This avoids it by not apply any changes to H/W if the device is not powered up. Instead the changes will be restored right after power-up. Cc: Laurent Pinchart Cc: Hans Verkuil Signed-off-by: Akinobu Mita Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 09e620c6af57ecc94411895eec78c5799a6e2a8d Author: Akinobu Mita Date: Sun May 6 10:19:26 2018 -0400 media: ov772x: use v4l2_ctrl to get current control value The ov772x driver provides three V4L2 controls and the current value of each control is saved as a variable in the private data structure. We don't need to keep track of the current value by ourself, if we use v4l2_ctrl returned from v4l2_ctrl_new_std() instead. This is a preparatory change to avoid accessing registers under power saving mode. This simplifies s_ctrl() by making it just return without saving the current control value in private area when it is called under power saving mode. Cc: Jacopo Mondi Cc: Laurent Pinchart Cc: Hans Verkuil Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 80dc2a49ba040b3ce09c13d5a7be1799bc75a166 Author: Akinobu Mita Date: Sun May 6 10:19:25 2018 -0400 media: ov772x: reconstruct s_frame_interval() This splits the s_frame_interval() in subdev video ops into selecting the frame interval and setting up the registers. This is a preparatory change to avoid accessing registers under power saving mode. Cc: Hans Verkuil Signed-off-by: Akinobu Mita Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6d2b0f7b9c1e8028f9a3efb99f539cb2f6d3d669 Author: Joe Perches Date: Sat Jun 23 10:27:58 2018 -0700 staging: Convert random_ether_addr to eth_random_addr random_ether_addr is a #define for eth_random_addr which is generally preferred in kernel code by ~3:1 Convert the uses of random_ether_addr to enable removing the #define Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman commit b244f917acb7e1f492c40f6f4cf7be860a5065a5 Author: Michael Straube Date: Tue Jun 26 17:38:56 2018 +0200 staging: rtl8188eu: remove blank lines Remove unrequired blank lines after open and before close braces. Reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 39b2ef70d6d37db595bb28b372efcf4cd03417b8 Author: Tim Collier Date: Fri Jun 22 20:39:34 2018 +0100 staging: wlan-ng: add parentheses to macro argument usage in prism2mgmt.c Fix two "CHECK: Macro argument 'N' may be better as '(N)' to avoid precedence issue" messages, reported by checkpatch, by adding parentheses around the offending macro argument references. Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit b2679009fa7def0772bff1af4b7579dc2d8ff442 Author: Tim Collier Date: Fri Jun 22 20:39:33 2018 +0100 staging: wlan-ng: replace macro with inline function in prism2mgmt.c checkpatch gives the following message for the p80211rate_to_p2bit macro: CHECK: Macro argument reuse 'n' - possible side-effects? To fix the message, replace the macro with an equivalent inline function. Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit 9e5ffffb6853aafb6441193e27f60576a67a2e32 Author: Tim Collier Date: Fri Jun 22 20:39:32 2018 +0100 staging: wlan-ng: replace WLAN_CTL_FRAMELEN with inline function in p80211hdr.h checkpatch reports a "CHECK" diagnostic for WLAN_CTL_FRAMELEN as the macro reuses its argument, leading to possible side-effects. Avoid this by replacing the macro with an equivalent function, named wlan_ctl_framelen (as recommended in the coding style). All references to the macro also updated accordingly. Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit a37545e5e581d8b493d472f51a6011ef6f151de5 Author: Tim Collier Date: Fri Jun 22 20:39:31 2018 +0100 staging: wlan-ng: fix coding style (indentation) in prism2mib.c Fix "CHECK: Alignment should match open parenthesis" reported by checkpatch.pl. Signed-off-by: Tim Collier Signed-off-by: Greg Kroah-Hartman commit 003504a23a765620815622cb57b962b4aebdc5af Merge: 0a9fe5c375b5 430527415398 Author: David S. Miller Date: Thu Jun 28 22:12:03 2018 +0900 Merge branch 'net-sched-actions-code-style-cleanup-and-fixes' Roman Mashak says: ==================== net sched actions: code style cleanup and fixes The patchset fixes a few code stylistic issues and typos, as well as one detected by sparse semantic checker tool. No functional changes introduced. Patch 1 & 2 fix coding style bits caught by the checkpatch.pl script Patch 3 fixes an issue with a shadowed variable Patch 4 adds sizeof() operator instead of magic number for buffer length Patch 5 fixes typos in diagnostics messages Patch 6 explicitly sets unsigned char for bitwise operation v2: - submit for net-next - added Reviewed-by tags - use u8* instead of char* as per Davide Caratti suggestion ==================== Signed-off-by: David S. Miller commit 430527415398cf7e741f5e2f11324a8df9093327 Author: Roman Mashak Date: Wed Jun 27 13:33:35 2018 -0400 net sched actions: avoid bitwise operation on signed value in pedit Since char can be unsigned or signed, and bitwise operators may have implementation-dependent results when performed on signed operands, declare 'u8 *' operand instead. Suggested-by: Davide Caratti Signed-off-by: Roman Mashak Signed-off-by: David S. Miller commit 95b0d2dc13c7e7ea51675836680732e8c16e378a Author: Roman Mashak Date: Wed Jun 27 13:33:34 2018 -0400 net sched actions: fix misleading text strings in pedit action Change "tc filter pedit .." to "tc actions pedit .." in error messages to clearly refer to pedit action. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak Signed-off-by: David S. Miller commit 6ff7586e382cb4274adefd56501d428ea39a5af3 Author: Roman Mashak Date: Wed Jun 27 13:33:33 2018 -0400 net sched actions: use sizeof operator for buffer length Replace constant integer with sizeof() to clearly indicate the destination buffer length in skb_header_pointer() calls. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak Signed-off-by: David S. Miller commit 544377cd2545f33cc6cd5458301749d828adacb0 Author: Roman Mashak Date: Wed Jun 27 13:33:32 2018 -0400 net sched actions: fix sparse warning The variable _data in include/asm-generic/sections.h defines sections, this causes sparse warning in pedit: net/sched/act_pedit.c:293:35: warning: symbol '_data' shadows an earlier one ./include/asm-generic/sections.h:36:13: originally declared here Therefore rename the variable. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak Signed-off-by: David S. Miller commit d020d4559de9baf47cafa2669f29ea59d11a914c Author: Roman Mashak Date: Wed Jun 27 13:33:31 2018 -0400 net sched actions: fix coding style in pedit headers Fix coding style issues in tc pedit headers detected by the checkpatch script. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak Signed-off-by: David S. Miller commit 80f0f574cc615b2c61bdfb0e3c2449478d63c488 Author: Roman Mashak Date: Wed Jun 27 13:33:30 2018 -0400 net sched actions: fix coding style in pedit action Fix coding style issues in tc pedit action detected by the checkpatch script. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak Signed-off-by: David S. Miller commit ac5e4875e6d81f7f24a70247770c32585d773839 Author: Jia-Ju Bai Date: Wed Jun 20 10:58:01 2018 +0800 staging: rtlwifi: Fix a possible sleep-in-atomic-context bug in _is_fw_read_cmd_down() The driver may sleep with holding a spinlock. The function call path (from bottom to top) in Linux-4.16.7 is: [FUNC] schedule drivers/staging/rtlwifi/halmac/rtl_halmac.c, 884: schedule in _is_fw_read_cmd_down drivers/staging/rtlwifi/halmac/rtl_halmac.c, 912: _is_fw_read_cmd_down in rtl_halmac_send_h2c drivers/staging/rtlwifi/halmac/rtl_halmac.c, 907: _raw_spin_lock_irqsave in rtl_halmac_send_h2c To fix this bug, schedule() is replaced with mdelay(1). This bug is found by my static analysis tool (DSAC-2) and checked by my code review. Signed-off-by: Jia-Ju Bai Signed-off-by: Greg Kroah-Hartman commit 6b142341a605ceacc5bf82f69dedfc95fc607365 Author: Chris Opperman Date: Fri Jun 22 17:29:02 2018 +0200 staging: wlan-ng: improved readability of function prism2_add_key Improve readability of prism2_add_key: a) Reduce nesting and removed goto statement by using more return statements. Signed-off-by: Chris Opperman Signed-off-by: Greg Kroah-Hartman commit c238d7b1e5fd6416458d7a7295a6d20ab56a3baa Author: Arnd Bergmann Date: Mon Jun 18 16:38:02 2018 +0200 staging: rtsx: remove rtsx_trace() and related code The driver has rather excessive amount of tracing code, which would be better done using ftrace. This is obviously not a main feature of the driver, and it should work just as well without it. Removing it saves over 1300 lines of code and likely makes the driver a bit faster by avoiding lots of calls into the timekeeping code. I came across this while cleaning up the last users of the deprecated getnstimeofday64() function, of which there is one in the now-removed get_current_time() function of the rtsx driver that was only used for tracing. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 5c6a5eb3aa86ecde00fe45410fc384363ee9bc92 Author: Omer Efrat Date: Mon Jun 18 17:18:11 2018 +0300 staging: use BIT_ULL for NL80211_STA_INFO_* attribute types The BIT macro uses unsigned long which some architectures handle as 32 bit and therefore might cause macro's shift to overflow when used on a value equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards). Since 'filled' member in station_info changed to u64, BIT_ULL macro should be used with all NL80211_STA_INFO_* attribute types instead of BIT to prevent future possible bugs when one will use BIT macro for higher attributes by mistake. This commit cleans up all usages of BIT macro with the above field in cfg80211 by changing it to BIT_ULL instead. Signed-off-by: Omer Efrat Signed-off-by: Greg Kroah-Hartman commit efc8f3b2f3177c3946f12db838ed58fa032f74c0 Author: Marcin Ciupak Date: Fri Jun 15 14:21:09 2018 +0000 staging: most: fix sparse warning Using plain integer as NULL pointer This patch fixes following sparse warning: Using plain integer as NULL pointer in drivers/staging/most/dim2/dim2.c Signed-off-by: Marcin Ciupak Signed-off-by: Greg Kroah-Hartman commit 34af7d920b766ffa582231ff3ce526d0c6179cd0 Author: Akinobu Mita Date: Sun May 6 10:19:24 2018 -0400 media: ov772x: handle nested s_power() calls Depending on the v4l2 driver, calling s_power() could be nested. So the actual transitions between power saving mode and normal operation mode should only happen at the first power on and the last power off. This adds an s_power() nesting counter and updates the power state if the counter is modified from 0 to != 0 or from != 0 to 0. Cc: Laurent Pinchart Cc: Hans Verkuil Reviewed-by: Jacopo Mondi Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0a9fe5c375b57fab6d18ed0a6a7f935eefb09db3 Author: Yousuk Seung Date: Wed Jun 27 10:32:19 2018 -0700 netem: slotting with non-uniform distribution Extend slotting with support for non-uniform distributions. This is similar to netem's non-uniform distribution delay feature. Commit f043efeae2f1 ("netem: support delivering packets in delayed time slots") added the slotting feature to approximate the behaviors of media with packet aggregation but only supported a uniform distribution for delays between transmission attempts. Tests with TCP BBR with emulated wifi links with non-uniform distributions produced more useful results. Syntax: slot dist DISTRIBUTION DELAY JITTER [packets MAX_PACKETS] \ [bytes MAX_BYTES] The syntax and use of the distribution table is the same as in the non-uniform distribution delay feature. A file DISTRIBUTION must be present in TC_LIB_DIR (e.g. /usr/lib/tc) containing numbers scaled by NETEM_DIST_SCALE. A random value x is selected from the table and it takes DELAY + ( x * JITTER ) as delay. Correlation between values is not supported. Examples: Normal distribution delay with mean = 800us and stdev = 100us. > tc qdisc add dev eth0 root netem slot dist normal 800us 100us Optionally set the max slot size in bytes and/or packets. > tc qdisc add dev eth0 root netem slot dist normal 800us 100us \ bytes 64k packets 42 Signed-off-by: Yousuk Seung Acked-by: Eric Dumazet Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit 7c5746c4487349976d524596f8779c63ac063728 Author: Michael Straube Date: Mon Jun 25 16:50:25 2018 +0200 staging: rtl8723bs: remove rtw_set_tx_chksum_offload() The function rtw_set_tx_chksum_offload() has empty definition. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit c2cae8951772aff8355171882fcc8e4eb9f53840 Author: Akinobu Mita Date: Sun May 6 10:19:23 2018 -0400 media: ov772x: support device tree probing The ov772x driver currently only supports legacy platform data probe. This change enables device tree probing. Note that the platform data probe can select auto or manual edge control mode, but the device tree probling can only select auto edge control mode for now. [Sakari Ailus: Remove direct OF dependencies from device ID table] Cc: Laurent Pinchart Cc: Hans Verkuil Reviewed-by: Jacopo Mondi Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e8466ea7bc3affde1733663cf17d657b7587f03c Author: Henriette Hofmeier Date: Fri Jun 22 16:01:59 2018 +0200 staging: rtl8723bs: Fix comment on variable init Change comment from 'local variable' to 'global variables' and change style to comply with coding-style. Signed-off-by: Henriette Hofmeier Signed-off-by: Florian Harbecke Signed-off-by: Greg Kroah-Hartman commit cbb2cb50c05600b32d6d198f2d3588299c053e12 Author: Henriette Hofmeier Date: Fri Jun 22 16:01:58 2018 +0200 staging: rtl8723bs: Remove unnecessary initializations Remove initializations of global variables with 0. Criticized by checkpatch. Signed-off-by: Henriette Hofmeier Signed-off-by: Florian Harbecke Signed-off-by: Greg Kroah-Hartman commit 3520c7a47b390e08531c145275f9c8a040458cff Author: Henriette Hofmeier Date: Fri Jun 22 16:01:57 2018 +0200 staging: rtl8723bs: Move definition open brace Move open braces of definitions to the next line to comply with codestyle. Criticized by checkpatch. Signed-off-by: Henriette Hofmeier Signed-off-by: Florian Harbecke Signed-off-by: Greg Kroah-Hartman commit 05e540b27718fee5135655e9d60ae05069dcba36 Author: Jia-Ju Bai Date: Wed Jun 20 17:50:16 2018 +0800 staging: rtl8723bs: Fix two possible sleep-in-atomic-context bugs in translate_scan() The driver may sleep with holding a spinlock. The function call paths (from bottom to top) in Linux-4.16.7 are: [FUNC] kzalloc(GFP_KERNEL) drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 323: kzalloc in translate_scan drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1554: translate_scan in rtw_wx_get_scan drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1533: spin_lock_bh in rtw_wx_get_scan [FUNC] kzalloc(GFP_KERNEL) drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 455: kzalloc in translate_scan drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1554: translate_scan in rtw_wx_get_scan drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1533: spin_lock_bh in rtw_wx_get_scan To fix these bugs, GFP_KERNEL is replaced with GFP_ATOMIC. These bugs are found by my static analysis tool (DSAC-2) and checked by my code review. Signed-off-by: Jia-Ju Bai Signed-off-by: Greg Kroah-Hartman commit 8498887660dfc9a07659ad545bfec389eb1d1d3f Author: Arnd Bergmann Date: Mon Jun 18 17:06:50 2018 +0200 staging: rtl8723bs: remove get_monotonic_boottime() get_monotonic_boottime() is deprecated because it uses the old 'timespec' structure. This replaces one of the last callers with a call to ktime_get_boottime, which also simplifies it a bit by avoiding a double conversion. Signed-off-by: Arnd Bergmann Reviewed-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit 8cc46a2cc2a1060538e7051f54bd921e8575f039 Author: Quytelda Kahja Date: Sat Jun 16 22:30:40 2018 -0700 staging: rtl8723bs: Add missing curly braces on else statement. Fix 'braces {} should be used on all arms of this statement' coding style problem in 'phy_get_tx_pwr_lmt()'. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit 904604397d163ca391862b7c71d3387416463aab Author: Quytelda Kahja Date: Sat Jun 16 22:30:39 2018 -0700 staging: rtl8723bs: Merge workaround conditionals into single else-if. The if conditionals used to work around wrong TX power limit indices can be condensed into a single if/else-if statement for more concise expression. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit f5746848212021db200ad6a24d394cbadf4f17cf Author: Quytelda Kahja Date: Sat Jun 16 22:30:38 2018 -0700 staging: rtl8723bs: Merge conditionals with similar bodies. Two conditionals that set 'channel' based on 'band_type' in 'phy_get_tx_pwr_lmt()' can be simplified into one single-line conditional. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit 871081d4e95778120b7dbe150b627a6b854e3141 Author: Quytelda Kahja Date: Sat Jun 16 22:30:37 2018 -0700 staging: rtl8723bs: Fix spelling mistake in comment. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit 81dff62b3d03e9050a6ab4da3d1c8fd8f14b2495 Author: Quytelda Kahja Date: Sat Jun 16 22:30:36 2018 -0700 staging: rtl8723bs: Move bandwidth index lookup to new function. Factoring out the conditional lookup of bandwidth index into the power limit table into it's own function simplifies the logic of 'phy_get_tx_pwr_lmt()'. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit 9ca65c3041fd296af74ff7e356865217fba58e50 Author: Quytelda Kahja Date: Sat Jun 16 22:30:35 2018 -0700 staging: rtl8723bs: Move rate section index lookup to new function. The rate section lookup is a large switch statement in the middle of 'phy_get_tx_pwr_lmt()'; refactor this statement into it's own function for increased readability. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit ac41f631d4187f072e9e693fbdb4423e2e0f0e00 Author: Quytelda Kahja Date: Sat Jun 16 22:30:34 2018 -0700 staging: rtl8723bs: Remove empty else-if conditional. This else-if conditional block does nothing; remove it. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit fdf620d6970c93d9bfe8975130d49d2a060153c1 Author: Quytelda Kahja Date: Sat Jun 16 22:30:33 2018 -0700 staging: rtl8723bs: Combine if statements with equivalent body. Two if statements that carry out the same operation can be combined with a logical OR. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit 717209ec616cb4216732e4598afd4aa587ea54c2 Author: Quytelda Kahja Date: Sat Jun 16 22:30:32 2018 -0700 staging: rtl8723bs: Fix camel-case names in phy_get_tx_pwr_lmt(). Change camel-case names to snake-case names; to avoid variable name conflicts, rename table index variables to idx_*. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit cc2231a3bbcfcdd858cbbed1f2a0fbb9c230438b Author: Quytelda Kahja Date: Sat Jun 16 22:30:31 2018 -0700 staging: rtl8723bs: Rename PHY_GetTxPowerLimit(). Rename camel-case 'PHY_GetTxPowerLimit()' to 'phy_get_tx_pwr_lmt()'. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit 26472590a6b7b9ec24ce9a00247a79a6bead4ba6 Author: Quytelda Kahja Date: Sat Jun 16 22:30:30 2018 -0700 staging: rtl8723bs: Clean up whitespace in 'PHY_GetTxPowerLimit()'. Wrap lines longer than 80 characters where possible, delete double newlines, and fix alignment per the kernel coding style guidelines. Signed-off-by: Quytelda Kahja Signed-off-by: Greg Kroah-Hartman commit e8b8fc8a38b5ea3c10e2eb88b7805187ae7be6c5 Author: Valentin Vidic Date: Mon Jun 25 14:04:41 2018 +0200 staging: pi433: cleanup comments in rf69.h Fixes checkpatch warning: WARNING: line over 80 characters Signed-off-by: Valentin Vidic Signed-off-by: Greg Kroah-Hartman commit ecfacacf3ff0feef2387b4c7440b256aa798065d Author: Valentin Vidic Date: Mon Jun 25 13:52:23 2018 +0200 staging: pi433: add SPDX-License-Identifier tag Use GPL-2.0+ based on the license text in each of the files. Signed-off-by: Valentin Vidic Signed-off-by: Greg Kroah-Hartman commit 8679339524c11497b7b7019fa7e24fe8e9a78a91 Author: Valentin Vidic Date: Sun Jun 24 18:31:38 2018 +0200 staging: pi433: replace simple switch statements Use const array to map switch cases to resulting values. Signed-off-by: Valentin Vidic Reviewed-by: Marcus Wolf Signed-off-by: Greg Kroah-Hartman commit 983000d7fa5d7538915810b58c9e63cb6118eb1e Author: Hugo Lefeuvre Date: Wed Jun 20 09:37:19 2018 -0400 staging: pi433: fix race condition in pi433_open The device structure contains a useless non-atomic users counter which is subject to race conditions. It has probably been created to handle the case where remove is executed while operations are still executing on open fds but this will never happen because of reference counts. Drop the users counter and move rx buffer {de,}allocation to probe() and remove(). Remove associated dead code from open() and release(). Remove related TODO entry from ioctl(). Signed-off-by: Hugo Lefeuvre Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 89ce93fd5b75d515ca4f9df15ef1507bff47b203 Author: Akinobu Mita Date: Sun May 6 10:19:22 2018 -0400 media: ov772x: omit consumer ID when getting clock reference Currently the ov772x driver obtains a clock with a specific consumer ID. As there's a single clock for this driver, we could omit clock-names property in device tree by passing NULL as a consumer ID to clk_get(). Cc: Laurent Pinchart Cc: Hans Verkuil Suggested-by: Laurent Pinchart Tested-by: Jacopo Mondi Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 40519d545824355fff7b94cf6e58efffe2908e7d Author: Akinobu Mita Date: Sun May 6 10:19:21 2018 -0400 media: ov772x: use generic names for reset and powerdown gpios The ov772x driver uses "rstb-gpios" and "pwdn-gpios" for reset and powerdown pins. However, using generic names for these gpios is preferred. ("reset-gpios" and "powerdown-gpios" respectively) There is only one mainline user for these gpios, so rename to generic names. Cc: Laurent Pinchart Cc: Hans Verkuil Reviewed-by: Jacopo Mondi Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4b610d6d03eed17a035eba49826d1f47baf83396 Author: Akinobu Mita Date: Sun May 6 10:19:20 2018 -0400 media: ov772x: add media controller support Create a source pad and set the media controller type to the sensor. Cc: Laurent Pinchart Cc: Hans Verkuil Reviewed-by: Jacopo Mondi Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 10c553b154c725e27da2f09e45692222f97beb6e Author: Arnd Bergmann Date: Mon Jun 18 17:09:09 2018 +0200 staging: android/vsoc: stop using 'timespec' The timespec structure suffers from the y2038 overflow and should not be used. This changes handle_vsoc_cond_wait() to use ktime_t directly. Signed-off-by: Arnd Bergmann Reviewed-by: Martijn Coenen Tested-by: Alistair Strachan Signed-off-by: Greg Kroah-Hartman commit 8632c614565d0c5fdde527889601c018e97b6384 Author: Alistair Strachan Date: Tue Jun 19 17:57:35 2018 -0700 staging: android: ashmem: Fix mmap size validation The ashmem driver did not check that the size/offset of the vma passed to its .mmap() function was not larger than the ashmem object being mapped. This could cause mmap() to succeed, even though accessing parts of the mapping would later fail with a segmentation fault. Ensure an error is returned by the ashmem_mmap() function if the vma size is larger than the ashmem object size. This enables safer handling of the problem in userspace. Cc: Todd Kjos Cc: devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org Cc: kernel-team@android.com Cc: Joel Fernandes Signed-off-by: Alistair Strachan Acked-by: Joel Fernandes (Google) Reviewed-by: Martijn Coenen Signed-off-by: Greg Kroah-Hartman commit 59848d6aded59a644bd3199033a9dc5a66d528f5 Author: Alistair Strachan Date: Tue Jun 19 17:57:34 2018 -0700 staging: android: ashmem: Remove use of unlikely() There is no speed difference, and it makes the code harder to read. Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg Cc: Todd Kjos Cc: Martijn Coenen Cc: devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org Cc: kernel-team@android.com Cc: Joel Fernandes Suggested-by: Greg Kroah-Hartman Signed-off-by: Alistair Strachan Signed-off-by: Greg Kroah-Hartman commit 30f3b17eaf4913e9e56be15915ce57aae69db701 Author: Akinobu Mita Date: Sun May 6 10:19:19 2018 -0400 media: ov772x: add checks for register read errors This change adds checks for register read errors and returns correct error code. Cc: Laurent Pinchart Cc: Hans Verkuil Reviewed-by: Jacopo Mondi Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0b964d183cbf3f95a062ad9f3eec87ffa2790558 Author: Akinobu Mita Date: Sun May 6 10:19:18 2018 -0400 media: ov772x: allow i2c controllers without I2C_FUNC_PROTOCOL_MANGLING The ov772x driver only works when the i2c controller have I2C_FUNC_PROTOCOL_MANGLING. However, many i2c controller drivers don't support it. The reason that the ov772x requires I2C_FUNC_PROTOCOL_MANGLING is that it doesn't support repeated starts. This changes the reading ov772x register method so that it doesn't require I2C_FUNC_PROTOCOL_MANGLING by calling two separated i2c messages. Cc: Laurent Pinchart Cc: Hans Verkuil Cc: Wolfram Sang Reviewed-by: Jacopo Mondi Signed-off-by: Akinobu Mita Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5c6d0dbb023d9c55b60aae3d2d2617bd05cc6199 Author: Ajay Singh Date: Tue Jun 26 11:37:14 2018 +0530 staging: wilc1000: updated TODO file Item [1] in TODO list is already addressed, so removed it from TODO file. [1]. Move handling for each individual members of 'union message_body' out into a separate 'struct work_struct' and completely remove the multiplexerthat is currently part of host_if_work(), allowing movement of the implementation of each message handler into the callsite of the function that currently queues the 'host_if_msg'. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 688a45ea203010ed9145596f8f84bd6eed930d84 Author: Ajay Singh Date: Tue Jun 26 11:37:13 2018 +0530 staging: wilc1000: avoid use of static variable 'rssi' Instead of static variable now allocating the data and passing to handle_get_rssi() to fill the rssi information. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 6566dc0416084e7e6d607024b8c04ed08ad8011e Author: Ajay Singh Date: Tue Jun 26 11:37:12 2018 +0530 staging: wilc1000: avoid use of static variable 'inactive_time' Avoided the use of static variable 'inactive_time' and move it as part of 'sta_inactive_t' structure. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 56b408e513baeaff715acadbe98472f94e4cdbf3 Author: Ajay Singh Date: Tue Jun 26 11:37:11 2018 +0530 staging: wilc1000: handle freeing of 'key' & 'seq' data in wilc_add_rx_gtk() Handle freeing of memory allocated to keep 'key' & 'seq' in wilc_add_rx_gtk(). Once completion event is received, free the memory allocated for to avoid missing of free in work function. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 5b9be6713a7ca8bf0a82778c4fdd2cdbf4434767 Author: Ajay Singh Date: Tue Jun 26 11:37:10 2018 +0530 staging: wilc1000: handle freeing of key data in wilc_add_ptk() Handle freeing of memory allocated to store the 'key' in wilc_add_ptk() function. Once work completion notification is received, free the memory allocated to avoid missing of free in work function sepecially for error scenario. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit e6ea187b5b2acff5ed07dacff37306d0f56d6d43 Author: Ajay Singh Date: Tue Jun 26 11:37:09 2018 +0530 staging: wilc1000: handle freeing of key data in wep add key Modified the code to free the allocated memory, used to store the key in wilc_add_wep_key_bss_sta() and wilc_add_wep_key_bss_ap(). After work completion notification is received, free the memory allocated to avoid missing of free in work function. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit c6a358d56476274c0ed4c4604565959692569762 Author: Ajay Singh Date: Tue Jun 26 11:37:08 2018 +0530 staging: wilc1000: rename wilc_enqueue_cmd() to wilc_enqueue_work() Rename wilc_enqueue_cmd() to wilc_enqueue_work() because its used to enqueue the work queue. Also removed the function header comment for wilc_enqueue_cmd() as its not correct. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 708d96fb2abe4a1a356e9d44ed5a6a470dab3204 Author: Ajay Singh Date: Tue Jun 26 11:37:07 2018 +0530 staging: wilc1000: remove 'hif_thread_comp' completions Remove 'hif_thread_comp' completions as its not required after adding completion event as part work data to handle each sync call. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 5e6f8a8ae2923e0f9a8425320d5edb490a73abf0 Author: Ajay Singh Date: Tue Jun 26 11:37:06 2018 +0530 staging: wilc1000: added 'work_comp' completion as part of host_if_msg Added 'work_comp' completion in 'host_if_msg'. It allows handling the sync call to wait for sepecific completion event. The commands can be run in sync way waiting for their specific completion event. Added is_sync flag in wilc_create_work_queue() to handle the sync call to host interface. After adding completion as part of host_if_msg now below completion are not required comp_test_key_block; comp_test_disconn_block comp_get_rssi comp_inactive_time hif_wait_response Modified wilc_get_statistics() API to handle get statistic in sync & async way. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit ff52a57a7a4237ad5e089d32c7d621a68f4a7610 Author: Ajay Singh Date: Tue Jun 26 11:37:05 2018 +0530 staging: wilc1000: move the allocation of cmd out of wilc_enqueue_cmd() Instead of allocating the host_if_cmd in wilc_enqueue_cmd() now moved the allocation of cmd in the caller. Added the NULL check for 'hif_workqueue' before posting the work queue in wilc_enqueue_cmd(). Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 02f08321d0bbf64ffcd709ec664bac0f0ec6b3d8 Author: Ajay Singh Date: Tue Jun 26 11:37:04 2018 +0530 staging: wilc1000: remove unused marco related to HIF commands After removing the multiplexing of hif commands in hif_if_work() macros prefix with 'HOST_IF_MSG_' are not required. Also 'id' field in host_if_msg is not required anymore. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 7233be314e022a9b1f62c986e313d92a86ebb281 Author: Ajay Singh Date: Tue Jun 26 11:37:03 2018 +0530 staging: wilc1000: remove host_if_work() to handle TODO list issue Remove multiplexing of command at host_if_work(). Make use of function pointer instead of command ID to track individual work_struct separately. Modified the handler function to take work_struct pointer as argument and its return type is changes to void. Now prototype of 'handle_' function is same work_struct i.e. 'void (*fun)(struct struct *)' to register with work_queue. Removed host_if_work() because its not required now. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 8c05c98b1a2f0bc8a8fbcc0746adedea01311040 Author: Thibaut Robert Date: Tue Jun 19 20:44:19 2018 +0200 staging: wilc1000: Use common structs to parse ip packets Use structs ethhdr, iphdr and tcphdr instead of manual parsing in tcp_process. This commit fix handling of ip packets containing options. It also fixes the following sparse warning: drivers/staging/wilc1000//wilc_wlan.c:201:19: warning: cast to restricted __be16 Signed-off-by: Thibaut Robert Reviewed-by: Dan Carpenter Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 6042985276994d5a99b9f195c8ceac002e66f00d Author: Sergio Paracuellos Date: Mon Jun 18 11:36:20 2018 +0200 staging: mt7621-gpio: avoid use banks in device tree Banks shouldn't be defined in DT if number of resources per bank is not variable. We actually know that this SoC has three banks so take that into account in order to don't overspecify the device tree. Device tree will only have one node making it simple. Update device tree, binding doc and code accordly. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 36913c87abc19833874be792569efae890069585 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:19 2018 +0200 staging: mt7621-gpio: update Kconfig with SoC details Kconfig is using a generic 'Mediatek GPIO Support' in description and help which is not specific at all about the current SoC which is MT7621. Update it. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 32c06cdef5c672e47a611f6794368e751034a9b5 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:18 2018 +0200 staging: mt7621-gpio: avoid long line in a comment Checkpatch script is complaining about a comment line which exceeds 80 characteres. Just silence it. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit c4604a0e5c6b28601613e620de71877ace9a314e Author: Sergio Paracuellos Date: Mon Jun 18 11:36:17 2018 +0200 staging: mt7621-gpio: set different names for each gpio_chip and irq_chip Currently the driver defines 3 gpiochips, one for each bank. /sys/class/gpio/gpiochip416/label:1e000600.gpio /sys/class/gpio/gpiochip448/label:1e000600.gpio /sys/class/gpio/gpiochip480/label:1e000600.gpio Unfortunately they all have the same label Interrupts from /proc/interrupt show the same name which is confusing: /proc/interrupts: 17: 0 0 0 0 MIPS GIC 19 mt7621, mt7621, mt7621 which is the interrupt from the GPIO controller. It is a little weird that all three banks are named "mt7621" here. We also have: 26: 0 0 0 0 GPIO 18 reset which is the interrupt from GPIO which provides the "reset" button. I suspect that if I had interrupts form two different banks they would both be called "GPIO" which would be a little confusing. In order to unify all of this set different names for each chip Use a 'bank-based' name instead the same for all: 'mt7621-bank[0-2]'. Create a new 'mediatek_gpio_bank_name' function which return the name depending on the bank number. This function is allways called with a valid index 0, 1 or 2. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 888295597e07e266dd6fa9d1029af015dc40c67b Author: Sergio Paracuellos Date: Mon Jun 18 11:36:16 2018 +0200 staging: mt7621-gpio: avoid one level indentation in interrupt handler There is no need to check for 'pending' before loop over the interrupts using 'for_each_set_bit' if nothing is set the return values will be the same so just avoid this check avoiding also one level intentation and improving readability. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit e4550f6e9a134ab5e32a7b0c0baeab5586b37692 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:15 2018 +0200 staging: mt7621-gpio: avoid to set up irqs if not defined in dts If there is no interrupt defined in the dts 'irq_of_parse_and_map' returns 0 and we should't set up interrupts for each gpio chip in that case. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit bfb623c5b0935a2e4b5fe86eab79a37a37b67209 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:14 2018 +0200 staging: mt7621-gpio: avoid check for NULL in 'to_mediatek_gpio' calls Function 'to_mediatek_gpio' cannot return NULL, so this NULL checkings are pointless. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 3e55d7c9136980c80e5ab99d24dc7b3247362953 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:13 2018 +0200 staging: mt7621-gpio: align indentation for all defines There was two remaining defines which weren't properly aligned with the rest. Align them improving readability. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 26cbc8cf92a3675223489751b97ca0627d865263 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:12 2018 +0200 staging: mt7621-gpio: update kerneldoc for state containers Update kernel doc for mtk_data and also remove no needed documentation for mtk_gc which is clear enough to don't need it. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 5547b411e9924c69bc3074e884227ee9bd5850d5 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:11 2018 +0200 staging: mt7621-gpio: remove no more necessary PIN_MASK macro PIN_MASK macro was being used because of the fact we were only using one interrupt controller for all of the gpio chips. This has been changed to use one per gpio chip and each has 32 irqs. Because of this this macro is not needed anymore. Use BIT macro instead. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 7bf3d70e6e2c5ab724214a234a8755c03acb39a8 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:10 2018 +0200 staging: mt7621-gpio: avoid custom irq_domain for gpio Instead of create a custom irq_domain for this chip, use 'gpiochip_set_chained_irqchip' from GPIOLIB_IRQCHIP. It is ok to call this function several times. We have to manually mark the line with 'IRQF_SHARED' and then loop over the three banks until you find a hit. There were some problems with removing an irqchip like that but this driver is a bool so it might work just fine. After this changes the functions 'mediatek_gpio_to_irq' is not needed anymore and also the 'gpio_irq_domain' field from the state container. Instead of use the custom irq domain in the irq handler use the associated domain from the gpio_chip in 'irq_find_mapping' function. Function 'mediatek_gpio_bank_probe' has been moved a it to the botton to have all the irq related functions together and avoid some forward declarations to resolve some symbols along the code. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 368d97d69dabc7d1a3d444436381ac62ba195818 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:09 2018 +0200 staging: mt7621-gpio: implement high level and low level irqs This chip support high level and low level interrupts. Those have to be implemented also to get a complete and clean driver. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit fe84f0c9b71395dd93f7f3239936ab34f7c51c39 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:08 2018 +0200 staging: mt7621-gpio: add kerneldoc for state data containers This commit adds kerneldoc for the two data containers in order to better understanding of its existence. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 72b2884d62962e62079a940e58aee9a67074d304 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:07 2018 +0200 staging: mt7621-gpio: add COMPILE_TEST This driver is actually platform-agnostic. Add COMPILE_TEST for the compilation test coverage. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 7e7cda889925af269ab902b2f402b94ce72059fc Author: Sergio Paracuellos Date: Mon Jun 18 11:36:06 2018 +0200 staging: mt7621-gpio: implement '.irq_[request|release]_resources' functions When implementing custom irqchips it is important to also implement .irq_request_resources() and .irq_release_resources() and make sure these call gpiochip_[un]lock_as_irq(). Add those two for this driver. Also store struct device pointer in global state structure to be able to use 'dev_err' with the device from 'mediatek_request_resources' function. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 98f0703bf20a9c90df8f959ecd10775fd45ae2b1 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:05 2018 +0200 staging: mt7621-gpio: make use of 'builtin_platform_driver' This driver was being registered using 'module_platform_driver' but it is not a module at all. Instead of this use 'builtin_platform_driver' which seems to be the correct one. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 7f68fefbbf94a99b35db393b89b497cd8bae7ae3 Author: Sergio Paracuellos Date: Mon Jun 18 11:36:04 2018 +0200 staging: mt7621-gpio: avoid including 'gpio.h' Including file '' should be avoided in new drivers code, so just remove it because it is no necessary at all. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 8b9005072821bccbcb4a6456416dfa69e8e7dd7a Author: Sergio Paracuellos Date: Mon Jun 18 11:36:03 2018 +0200 staging: mt7621-gpio: make use 'bgpio_init' from GPIO_GENERIC Gpio complexity is just masking the fact that offset is always 0..n and writes to bits 0..n of some memory address. Because of this whole thing can just me converted to use GPIO_GENERIC and avoid duplications of a lot of driver custom functions. So use bgpio_init instead of custom code adding GPIO_GENERIC dependency to the Kconfig file. Also to make easier using bgpio_init function offset for each gpio bank, enumeration where register were defined has been replaced in favour of some macros which handle each gpio offset taking into account the bank where are located. Because of this change write and read functions which are being used for remaining irq handling stuff have been updated also as well as its dependencies along the code. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 144e2643e2f57d29804cacb5403708cd22984b73 Author: Kamal Heib Date: Wed Jun 20 13:47:11 2018 +0300 staging: mt7621-eth: Use eth_hw_addr_random() Use eth_hw_addr_random() to set a random dev_addr and update addr_assign_type. Fixes: e3cbf478f846 ('staging: mt7621-eth: add the drivers core files') Signed-off-by: Kamal Heib Signed-off-by: Greg Kroah-Hartman commit 85e1d42663a0c163002961d2685be952067b0dc2 Author: Kamal Heib Date: Tue Jun 19 20:04:08 2018 +0300 staging: mt7621-eth: Fix memory leak in mtk_add_mac() error path Fix memory leak in error path of mtk_add_mac() by make sure to free the allocated netdev. Fixes: e3cbf478f846 ('staging: mt7621-eth: add the drivers core files') Signed-off-by: Kamal Heib Signed-off-by: Greg Kroah-Hartman commit d0233204fbc10f003d1ef077f57341c2feca4002 Author: Rosen Penev Date: Sat Jun 16 19:17:50 2018 -0700 staging: mt7621-dts: Fix remaining pcie warnings This currently fixes the remaining dtb warnings: Node /pcie@1e140000/pcie0 has a reg or ranges property, but no unit name Node /pcie@1e140000/pcie1 has a reg or ranges property, but no unit name Node /pcie@1e140000/pcie2 has a reg or ranges property, but no unit name Node /pcie@1e140000/pcie0 node name is not "pci" or "pcie" Node /pcie@1e140000/pcie0 missing ranges for PCI bridge (or not a bridge) Node /pcie@1e140000/pcie0 missing bus-range for PCI bridge Node /pcie@1e140000/pcie1 node name is not "pci" or "pcie" Node /pcie@1e140000/pcie1 missing ranges for PCI bridge (or not a bridge) Node /pcie@1e140000/pcie1 missing bus-range for PCI bridge Node /pcie@1e140000/pcie2 node name is not "pci" or "pcie" Node /pcie@1e140000/pcie2 missing ranges for PCI bridge (or not a bridge) Node /pcie@1e140000/pcie2 missing bus-range for PCI bridge Warning (unit_address_format): Failed prerequisite 'pci_bridge' Warning (pci_device_reg): Failed prerequisite 'pci_bridge' Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge' device_type was removed since according to documentation, it's deprecated for pci(e) devices. Signed-off-by: Rosen Penev Signed-off-by: Greg Kroah-Hartman commit 370713270ea40ea46398c73a93427785bc41c771 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:08 2018 +0200 staging: mt7621-mmc: Find response of SD_APP_OP_COND by default The response type of the SD_APP_OP_COND command is correctly determined using the mmc_resp_type macro, because the only use of that opcode, mmc_send_app_op_cond, correctly places MMC_RSP_R3 in cmd.flags. So there is no need to treat that opcode separately. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit c3f28802a11840cb3e0a0e572b5510fe46e39eaf Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:07 2018 +0200 staging: mt7621-mmc: Find response of MMC_SEND_OP_COND by default The response type of the MMC_SEND_OP_COND command is correctly determined using the mmc_resp_type macro, because the only use of that opcode, mmc_send_op_cond, correctly places MMC_RSP_R3 in cmd.flags. So there is no need to treat that opcode separately. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 256e086636241c4c98b45ad5c173aef79a70e57a Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:06 2018 +0200 staging: mt7621-mmc: Factor out from msdc_command_start() Currently msdc_command_start does multiple things and is hard to read, so factor out the finding of the response type. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 38ee87eaadf593de9e55ec1977c90f24dc39454e Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:05 2018 +0200 staging: mt7621-mmc: Remove unused argument from msdc_do_command The argument tune of msdc_do_command is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 008f3853de82a8674bde444c593bab7a9436ad82 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:04 2018 +0200 staging: mt7621-mmc: Remove unused macro is_card_present The macro is_card_present is unused and also a duplicate of a macro in mmc, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 2de186940b8716f514a91a8df1788ce6e8c9d036 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:03 2018 +0200 staging: mt7621-mmc: Remove unused define MAX_PHY_SGMTS The define MAX_PHY_SGMTS is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 4bd8897a7dd4801772190eba9a49fa137937262a Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:02 2018 +0200 staging: mt7621-mmc: Remove unused enum msdc_mode The enum msdc_mode is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit ed940e75474ecaf13e9ab787023e90d292d07727 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:01 2018 +0200 staging: mt7621-mmc: Remove unused define IRQ_SDC The define IRQ_SDC is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit a76187ffa593ec04066d1852411635aef8bb6727 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:15:00 2018 +0200 staging: mt7621-mmc: Remove unused define RALINK_MSDC_BASE The define RALINK_MSDC_BASE is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 2dfc73d5bb908e38789c715de1aceeae0fb2f4b9 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:59 2018 +0200 staging: mt7621-mmc: Cleanup source of base address for io Currently the base address for all io operations is hidden behind a macro, REG_ADD. This macro uses the symbol "base" as the base address and all functions set base = host->base. This is hard to read, so the whole wrapping is removed and host->base is directly inserted in the io access. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 8a5b9f049bed94a16ca99070364fad5033e82d5f Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:58 2018 +0200 staging: mt7621-mmc: Remove MSDC_MODE_* defines The MSDC_MODE_* defines are all never used and do not contain any information about the device, so remove them. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 6aab8b53084a487ccdff095aec091814d9db70c3 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:57 2018 +0200 staging: mt7621-mmc: Remove unused variable from msdc_tune_request The variable cmd in the function msdc_tune_request is set but never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit a98c143734924e78c40320183fc9739ac7453169 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:56 2018 +0200 staging: mt7621-mmc: Remove unused macro MAX_BD_PER_GPD The macro MAX_BD_PER_GPD is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 6a1636fa1146bbeb86e1731d815f3528e8dec1b1 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:55 2018 +0200 staging: mt7621-mmc: Remove unused macro msdc_retry The macro msdc_retry is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit e327df5e886e8a34165a931128e10ecd99377256 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:54 2018 +0200 staging: mt7621-mmc: Make msdc_clr_fifo a function and relax cpu In the current code, msdc_clr_fifo is a macro and just busy waits for a limited amount of time for the fifo clear to finish. That is not correct, the programming manual hits, that the user should wait until the bit is cleared by hardware and not a limited amount of time. So the code is changed to a function, that also relaxes the cpu while busy waiting. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 41015d06e64fdafcbbb4ca17baf8a673f5ae3f09 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:53 2018 +0200 staging: mt7621-mmc: Remove unnecessary BUG_ON() in msdc_dma_setup The BUG_ON() removed by this patch is just a duplicate of a prior BUG_ON() statement. There the condition is just clearer, it checks weather sglen > MAX_BD_NUM and MAX_BD_NUM is equal MAX_BD_PER_GPD. So this statement can be safely removed. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit d812c6a9bba4fad6eb82ff19428f6c6e4df3cdf3 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:52 2018 +0200 staging: mt7621-mmc: Remove variable num form msdc_dma_setup The variable num in msdc_dma_setup is only used for a BUG_ON statement, so it can be removed by inlining the condition. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit fe219842d688c8d5acd9823ea92967cc0f8df1f9 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:51 2018 +0200 staging: mt7621-mmc: Remove unused field sglen from msdc_dma The field sglen from struct msdc_dma is once set and never read, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit acbd652b033d3197ea859bc18a6ba5524af0520b Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:50 2018 +0200 staging: mt7621-mmc: Remove unused field sg from msdc_dma The field sg from struct msdc_dma is once set and never read, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 8cfba8ac750d3167128bda34bee7e408f4ae2785 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:49 2018 +0200 staging: mt7621-mmc: Refactor dma setup process Current code uses two functions for dma setup, msdc_dma_config and msdc_dma_setup. By now msdc_dma_setup is nearly empty and mainly calls msdc_dma_config, so the later one can be inline into the first one. While doing this there is also some refactoring done. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 1668d5fc7b811f13827cf6bf26482dfd2537d34f Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:48 2018 +0200 staging: mt7621-mmc: Remove unused field mode from msdc_dma The field mode of struct msdc_dma has no remaining use, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit f3e1b5766c5945b70c7d4dc36f145ba02c9b23e5 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:47 2018 +0200 staging: mt7621-mmc: Remove DMA basic mode code The driver currently only uses DMA linked mode and the upstream driver does the same, so remove the basic mode code. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit b9ec4b83781a45d310b79cc986159176295332db Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:46 2018 +0200 staging: mt7621-mmc: Remove register debugging structures Current code has structures for all the registers of the device, but these are never used and there are also masks for all of them, so these structures do not contain any useful information. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 9705766bfba49c073bd7c7759e6cd9881f243a7d Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:45 2018 +0200 staging: mt7621-mmc: Remove unused macro sdr_write8 The macro sdr_write8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 85e25ffc9922a9dc1b3758f75d2bf09749839c9a Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:44 2018 +0200 staging: mt7621-mmc: Remove unused macro sdr_read8 The macro sdr_read8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit e988d35a6240252eaf802111d64e0a701d8dea13 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:43 2018 +0200 staging: mt7621-mmc: Replace sdr_read32 with readl The current code uses a macro (sdr_read32) for reading from hardware, but it is only a readl, so replace it to get nearer to upstream code. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 8fbcf12087ef17490e3c59dcf53db9bccb5e81ba Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:42 2018 +0200 staging: mt7621-mmc: Replace sdr_write32 with writel The current code uses a macro (sdr_write32) for writing to hardware, but it is only a writel with switched arguments, so replace it to get nearer to upstream code. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 09cb808cfdf3aaf129d8a01e43b281e8d6dcc30e Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:41 2018 +0200 staging: mt7621-mmc: Remove unused macro msdc_rxfifocnt The macro msdc_rxfifocnt is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 98336f9924d242e26de1f4cf14976af0beaa536b Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:40 2018 +0200 staging: mt7621-mmc: Remove unused macro msdc_txfifocnt The macro msdc_txfifocnt is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit dbed911180b0d88bd29a04280eabce25b1f12e63 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:39 2018 +0200 staging: mt7621-mmc: Remove unused macro msdc_fifo_read32 The macro msdc_fifo_read32 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit bbe95e24212f704db81fc1c36e343514b50f4ba0 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:38 2018 +0200 staging: mt7621-mmc: Remove unused macro msdc_fifo_write32 The macro msdc_fifo_write32 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 12c3ab44fabb834699e2463f6530289a5680a30f Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:37 2018 +0200 staging: mt7621-mmc: Remove unused macro msdc_fifo_read8 The macro msdc_fifo_read8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 73384e52756a607fa5d1bff1fa06ed9f4ae52651 Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:36 2018 +0200 staging: mt7621-mmc: Remove unused macro msdc_fifo_write8 The macro msdc_fifo_write8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 2e477f9ee5e3085a0d020acd6b614eca568981ee Author: Christian Lütke-Stetzkamp Date: Sat Jun 16 16:14:35 2018 +0200 staging: mt7621-mmc: Remove unused variable in msdc_command_resp The variable resp in msdc_command_resp is once set and never read, delete it. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman commit 32c6dcffdd20e8697ca5f2ce13f9bfbc582f1caf Author: Sergio Paracuellos Date: Fri Jun 8 14:16:34 2018 +0200 staging: mt7621-pinctrl: replace ENOSYS with better fitting error code This commit replaces ENOSYS return with ENOTSUPP silencing the following checkpatch warning: WARNING: ENOSYS means 'invalid syscall nr' and nothing else Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 63e57b953f747ce39f8de51548b4e584f00273ae Author: Sergio Paracuellos Date: Fri Jun 8 14:16:33 2018 +0200 staging: mt7621-pinctrl: remove unnecessary 'out of memory' message Messages when memory allocation fails are not needed at all and checkpatch script complains about them. Remove one in this driver code. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit c3de99239efd15d956c0f2b8475f6670f6f69b7b Author: Sergio Paracuellos Date: Fri Jun 8 14:16:32 2018 +0200 staging: mt7621-pinctrl: replace 'unsigned' types with 'unsigned int' This commit replaces all 'unsigned' type declarations along the driver code in favour of the preferred one 'unsigned int'. This also silence checkpatch script warnings about this issue. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit 3b20b0037a59c2344696eebb076f5bad12dd72e0 Author: Sergio Paracuellos Date: Fri Jun 8 14:16:31 2018 +0200 staging: mt7621-pinctrl: add SPDX identifier It's good to have SPDX identifiers in driver files to make it easier to audit the kernel tree for correct licenses. Fix up the one of staging mt7621-pinctrl file to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman commit c3f3ba3e6f78ea2159fca284e18840c6b3c1bfb6 Author: Hugues Fruchet Date: Mon Jun 18 06:29:19 2018 -0400 media: ov5640: add support of module orientation Add support of module being physically mounted upside down. In this case, mirror and flip are enabled to fix captured images orientation. [Sakari Ailus: Use dev_fwnode() instead of accessing device's of_node] Signed-off-by: Hugues Fruchet Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7e5dd6fd1283bde6cea7e09db6e9635602b5fc21 Author: Hugues Fruchet Date: Mon Jun 18 06:29:18 2018 -0400 media: dt-bindings: ov5640: Add "rotation" property Add the rotation property to the list of optional properties for the OV5640 camera sensor. Signed-off-by: Hugues Fruchet Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ce85705a2abb4324e18ded9d6df2b278b952edb6 Author: Hugues Fruchet Date: Mon Jun 18 06:29:17 2018 -0400 media: ov5640: add HFLIP/VFLIP controls support Add HFLIP/VFLIP controls support by setting registers REG21/REG20. Useless values in hardcoded mode sequences are removed and remaining binning values are now set after mode sequence being set. Note that due to BSI (Back Side Illuminated) technology, image capture is physically mirrored, mirror logic is so inversed in REG21 register to cancel this effect. Signed-off-by: Hugues Fruchet Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5f9e711b75a51b96c05f61a93b3f7c0d79dc20e2 Author: Sakari Ailus Date: Wed May 2 16:59:00 2018 -0400 media: smiapp: Support the "rotation" property Use the "rotation" property to tell that the sensor is mounted upside down. This reverses the behaviour of the VFLIP and HFLIP controls as well as the pixel order. Signed-off-by: Sakari Ailus Reviewed-by: Sebastian Reichel Signed-off-by: Mauro Carvalho Chehab commit 691faafa78e1a0eae2fa7db87a1b9c3e95dc9292 Author: Sakari Ailus Date: Thu Jun 14 08:17:29 2018 -0400 media: dt-bindings: smia: Add "rotation" property Add the rotation property to list of optional properties for the smia sensors. Signed-off-by: Sakari Ailus Reviewed-by: Sebastian Reichel Acked-by: Rob Herring Signed-off-by: Mauro Carvalho Chehab commit 6d4e7919d7b5ffc388ec9d8babd72368e6d65d6e Author: Sakari Ailus Date: Wed May 2 16:47:20 2018 -0400 media: dt-bindings: media: Define "rotation" property for sensors Sensors are occasionally mounted upside down to systems such as mobile phones or tablets. In order to use such a sensor without having to turn every image upside down, most camera sensors support reversing the readout order by setting both horizontal and vertical flipping. This patch documents the "rotation" property for camera sensors, mirroring what is defined for displays in Documentation/devicetree/bindings/display/panel/panel.txt . Signed-off-by: Sakari Ailus Reviewed-by: Sebastian Reichel Reviewed-by: Rob Herring Signed-off-by: Mauro Carvalho Chehab commit 708d0bff9121506db08adb73845a3c70312fadf3 Author: Nicolas Pitre Date: Tue Jun 26 23:56:42 2018 -0400 vt: unicode fallback for scrollback There is currently no provision for scrollback content in the core code, leaving that to backend video drivers where this can be highly optimized. There is currently no common method for those drivers to tell the core what part of the scrollback is actually displayed and what size the scrollback buffer is either. Because of that, the unicode screen buffer has no provision for any scrollback. At least we can provide backtranslated glyph values when the scrollback is active which should be plenty good enough for now. Signed-off-by: Nicolas Pitre Tested-by: Dave Mielke Acked-by: Adam Borowski Signed-off-by: Greg Kroah-Hartman commit d21b0be246bf3bbf569e6e239f56abb529c7154e Author: Nicolas Pitre Date: Tue Jun 26 23:56:41 2018 -0400 vt: introduce unicode mode for /dev/vcs Now that the core vt code knows how to preserve unicode values for each displayed character, it is then possible to let user space access it via /dev/vcs*. Unicode characters are presented as 32 bit values in native endianity via the /dev/vcsu* devices, mimicking the simple /dev/vcs* devices. Unicode with attributes (similarly to /dev/vcsa*) is not supported at the moment. Data is available only as long as the console is in UTF-8 mode. ENODATA is returned otherwise. This was tested with the latest development version (to become version 5.7) of BRLTTY. Amongst other things, this allows ⠋⠕⠗ ⠞⠓⠊⠎ ⠃⠗⠁⠊⠇⠇⠑⠀⠞⠑⠭⠞⠀to appear directly on braille displays regardless of the console font being used. Signed-off-by: Nicolas Pitre Tested-by: Dave Mielke Acked-by: Adam Borowski Signed-off-by: Greg Kroah-Hartman commit d8ae7242718738ee1bf9bfdd632d2a4b150fdd26 Author: Nicolas Pitre Date: Tue Jun 26 23:56:40 2018 -0400 vt: preserve unicode values corresponding to screen characters The vt code translates UTF-8 strings into glyph index values and stores those glyph values directly in the screen buffer. Because there can only be at most 512 glyphs, it is impossible to represent most unicode characters, in which case a default glyph (often '?') is displayed instead. The original unicode value is then lost. This patch implements the basic screen buffer handling to preserve unicode values alongside corresponding display glyphs. It is not activated by default, meaning that people not relying on that functionality won't get the implied overhead. Signed-off-by: Nicolas Pitre Tested-by: Dave Mielke Acked-by: Adam Borowski Signed-off-by: Greg Kroah-Hartman commit 1d45d2d2fde69ed068b605730aa0dd3230566cd0 Author: Colin Ian King Date: Sat May 26 14:56:06 2018 +0100 power: supply: max1721x: fix spelling mistake "RSenese" -> "RSense" Trivial fix to spelling mistake in dev_warn message text Signed-off-by: Colin Ian King Signed-off-by: Sebastian Reichel commit 34b6a3a91f87851bc0ea9e6776266f23d8acf388 Author: Helmut Grohne Date: Mon Jun 4 12:22:19 2018 +0200 serial: xuartps: remove unnecessary register write This writel writes the exact same value as the previous writel and is thus unnecessary. It accidentally became unnecessary in e3538c37ee38 ("tty: xuartps: Beautify read-modify writes"), but the new behaviour is now expected. Link: https://www.spinics.net/lists/linux-serial/msg23168.html Signed-off-by: Helmut Grohne Signed-off-by: Greg Kroah-Hartman commit de4ed391ae98fa378b563fe7baf04dfa525ab7fe Author: Helmut Grohne Date: Mon Jun 4 12:22:11 2018 +0200 serial: xuartps: reduce hardware TX race condition After sending data to the uart, the driver was waiting until the TX FIFO was empty (for every single char written). After that, TX was disabled by writing the original TX state to the status register. At that time however, the state machine could still be shifting characters. Not waiting can result in strange hardware states, especially when coupled with calls to cdns_uart_set_termios, whose symptom generally is garbage characters being received from uart or a hang. According to UG585, the TACTIVE bit of the channel status register indicates the shifter operation and we should be waiting for that bit to clear. Sending characters does not require the TX FIFO to be empty, but merely to not be full. So cdns_uart_console_putchar is updated accordingly. During tests with an instrumented kernel and an oscilloscope, we could determine that the chance of a race is reduced by this patch. It is not removed entirely. On the oscilloscope, one can see that disabling the transmitter early can result in the transmission hanging in the middle of a character for a tiny duration. This hiccup is enough to desynchronize with a remote device for a sequence of characters until a data bit doesn't match the start or stop bits anymore. Link: https://www.spinics.net/lists/linux-serial/msg23156.html Link: https://www.spinics.net/lists/linux-serial/msg26139.html Signed-off-by: Helmut Grohne Acked-by: Sören Brinkmann Signed-off-by: Greg Kroah-Hartman commit 68d12bb267da44f50167e64a95f1581cb729e5fc Author: Helmut Grohne Date: Mon Jun 4 12:22:05 2018 +0200 serial: xuartps: fix typo in cdns_uart_startup The bit mask changes in commit 6e14f7c1f2c2 ("tty: xuartps: Improve startup function") doesn't do what the commit message advertises. The original behaviour was clearing the RX_DIS bit, but due to missing ~, that bit is now the only bit kept. Currently, the regression is harmless, because the previous write to the control register sets it to TXRST | RXRST. Thus the RX_DIS bit is previously cleared. The *RST bits are cleared by the hardware, so this commit does not currently change behaviour, but makes future changes less risky. Link: https://www.spinics.net/lists/linux-serial/msg23157.html Signed-off-by: Helmut Grohne Fixes: 6e14f7c1f2c2 ("tty: xuartps: Improve startup function") Reviewed-by: Sören Brinkmann Signed-off-by: Greg Kroah-Hartman commit 85c634e919bd6ef17427f26a52920aeba12e16ee Author: Zhouyang Jia Date: Tue Jun 12 12:36:25 2018 +0800 drivers/tty: add error handling for pcmcia_loop_config When pcmcia_loop_config fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling pcmcia_loop_config. Signed-off-by: Zhouyang Jia Signed-off-by: Greg Kroah-Hartman commit be70874498f3004bd602c77e07d14f4b11acd699 Author: Nishanth Menon Date: Tue Jun 19 14:44:50 2018 -0500 serial: 8250_omap: Add support for AM654 UART controller AM654 uses a UART controller that is compatible (partially) with existing 8250 UART, however, has a few differences with respect to DMA support and control paths. Introduce a base definition that allows us to build up the differences in follow on patches. Cc: Sekhar Nori Cc: Vignesh R Signed-off-by: Nishanth Menon Acked-by: Tony Lindgren Signed-off-by: Greg Kroah-Hartman commit ccd8350d06c6df5dca868fefbd925af8ef55ac12 Author: Nishanth Menon Date: Tue Jun 19 14:44:49 2018 -0500 dt-bindings: serial: 8250_omap: Add compatible for AM654 UART controller AM654 uses a UART controller that is only partially compatible with existing 8250 UART. UART DMA integration is substantially different and even a match against standard 8250 or omap4 would result in non-working UART once DMA is enabled by default. Introduce a specific compatible to help build up the differences in follow on patches. Cc: Sekhar Nori Cc: Vignesh R Signed-off-by: Nishanth Menon Acked-by: Rob Herring Acked-by: Tony Lindgren Signed-off-by: Greg Kroah-Hartman commit c5a884838ce34681200b5a45b2330177036affd0 Author: Geert Uytterhoeven Date: Thu Jun 14 15:48:08 2018 +0200 arm64: dts: renesas: salvator-common: Fix adv7482 decimal unit addresses With recent dtc and W=1: ...salvator-x.dtb: Warning (graph_port): /soc/i2c@e66d8000/video-receiver@70/port@10: graph node unit address error, expected "a" ...salvator-x.dtb: Warning (graph_port): /soc/i2c@e66d8000/video-receiver@70/port@11: graph node unit address error, expected "b" Unit addresses are always hexadecimal (without prefix), while the bases of reg property values depend on their prefixes. Fixes: 908001d778eba06e ("arm64: dts: renesas: salvator-common: Add ADV7482 support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Acked-by: Kieran Bingham Signed-off-by: Simon Horman commit f052df96c46dbe52fbacd02189e7906f41686f27 Author: Alexey Khoroshilov Date: Sun Jun 3 01:22:05 2018 +0300 power: reset: zx-reboot: put device node in zx_reboot_probe() zx_reboot_probe() increments refcnt of zx296702-pcu device node by of_find_compatible_node() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Reviewed-by: Nicholas Mc Guire Signed-off-by: Sebastian Reichel commit 91937b1478aa3e9eb93d6f68283786f3553213b3 Author: Enric Balletbo i Serra Date: Tue Jun 5 12:00:21 2018 +0200 power: supply: tps65217: Switch to SPDX identifier. Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Sebastian Reichel commit e1a98c163eb276b5b5e1bece560ed7f0b9eb3b49 Author: Hans Verkuil Date: Fri Jun 15 09:19:46 2018 -0400 media: media.h: remove __NEED_MEDIA_LEGACY_API The __NEED_MEDIA_LEGACY_API define is 1) ugly and 2) dangerous since it is all too easy for drivers to define it to get hold of legacy defines. Instead just define what we need in media-device.c which is the only place where we need the legacy define (MEDIA_ENT_T_DEVNODE_UNKNOWN). Signed-off-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab commit 45fab2c61f88394762d9e69b2e9d6fbe448277db Author: Brian Norris Date: Tue Jun 12 13:20:42 2018 -0700 dt-bindings: power: sbs-battery: re-document "ti,bq20z75" This compatible property was documented before the driver was renamed to "SBS" (see commit e57f1b68c406 ("devicetree-bindings: Propagate bq20z75->sbs rename to dt bindings")). The driver has continued to support this property as an alternative to "sbs,sbs-battery", and because we've noticed there are some lingering TI specifics (in the manufacturer-specific portion of the SBS spec), we'd like to start using this property again to differentiate. In typical DT fashion, the , specifics should be used ahead of the generic "sbs,sbs-battery" string, so we can handle vendor specifics -- so document this. Language borrowed mostly from Documentation/devicetree/bindings/power/supply/sbs_sbs-charger.txt Also fixup the example to use this property (it's already implying that it's "bq20z75@b"); fixup the node name to be generic ("battery", not ""); and fixup some whitespace. Signed-off-by: Brian Norris Acked-by: Rhyland Klein Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit 76b16f4cdfb8d7f88552de6dd9022b65f906a5e5 Author: Brian Norris Date: Tue Jun 12 13:20:41 2018 -0700 power: supply: sbs-battery: don't assume MANUFACTURER_DATA formats This driver was originally submitted for the TI BQ20Z75 battery IC (commit a7640bfa10c5 ("power_supply: Add driver for TI BQ20Z75 gas gauge IC")) and later renamed to express generic SBS support. While it's mostly true that this driver implemented a standard SBS command set, it takes liberties with the REG_MANUFACTURER_DATA register. This register is specified in the SBS spec, but it doesn't make any mention of what its actual contents are. We've sort of noticed this optionality previously, with commit 17c6d3979e5b ("sbs-battery: make writes to ManufacturerAccess optional"), where we found that some batteries NAK writes to this register. What this really means is that so far, we've just been lucky that most batteries have either been compatible with the TI chip, or else at least haven't reported highly-unexpected values. For instance, one battery I have here seems to report either 0x0000 or 0x0100 to the MANUFACTURER_ACCESS_STATUS command -- while this seems to match either Wake Up (bits[11:8] = 0000b) or Normal Discharge (bits[11:8] = 0001b) status for the TI part [1], they don't seem to actually correspond to real states (for instance, I never see 0101b = Charge, even when charging). On other batteries, I'm getting apparently random data in return, which means that occasionally, we interpret this as "battery not present" or "battery is not healthy". All in all, it seems to be a really bad idea to make assumptions about REG_MANUFACTURER_DATA, unless we already know what battery we're using. Therefore, this patch reimplements the "present" and "health" checks to the following on most SBS batteries: 1. HEALTH: report "unknown" -- I couldn't find a standard SBS command that gives us much useful here 2. PRESENT: just send a REG_STATUS command; if it succeeds, then the battery is present Also, we stop sending MANUFACTURER_ACCESS_SLEEP to non-TI parts. I have no proof that this is useful and supported. If someone explicitly provided a 'ti,bq20z75' compatible property, then we continue to use the existing TI command behaviors, and we effectively revert commit 17c6d3979e5b ("sbs-battery: make writes to ManufacturerAccess optional") to again make these commands required. [1] http://www.ti.com/lit/er/sluu265a/sluu265a.pdf Signed-off-by: Brian Norris Reviewed-by: Guenter Roeck Acked-by: Rhyland Klein Signed-off-by: Sebastian Reichel commit 6b16f5d12202a23d875915349cc031c07fe1b3ec Merge: 85ebd164de56 7daf201d7fe8 Author: Bartlomiej Zolnierkiewicz Date: Thu Jun 28 14:07:57 2018 +0200 Merge tag 'v4.18-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next Linux 4.18-rc2 commit 5fd691afdf929061c391d897fa627822c3b2fd5a Author: Peter Zijlstra Date: Tue Jun 5 16:53:34 2018 +0200 atomic/tty: Fix up atomic abuse in ldsem Mark found ldsem_cmpxchg() needed an (atomic_long_t *) cast to keep working after making the atomic_long interface type safe. Needing casts is bad form, which made me look at the code. There are no ld_semaphore::count users outside of these functions so there is no reason why it can not be an atomic_long_t in the first place, obviating the need for this cast. That also ensures the loads use atomic_long_read(), which implies (at least) READ_ONCE() in order to guarantee single-copy-atomic loads. When using atomic_long_try_cmpxchg() the ldsem_cmpxchg() wrapper gets very thin (the only difference is not changing *old on success, which most callers don't seem to care about). So rework the whole thing to use atomic_long_t and its accessors directly. While there, fixup all the horrible comment styles. Cc: Peter Hurley Reported-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Signed-off-by: Greg Kroah-Hartman commit 9d9398944488cd3a3e1e0912b26fbc4d5921e547 Author: Daniel Golle Date: Mon Jun 4 23:33:07 2018 +0200 tty: serial: exar: generalize RS485 setup Move the non-board-specific part of the RS485 initialization from iot2040_rs485_config function to a new generic function used also for other boards. This allows using TIOCGRS485 and TIOCSRS485 on boards (such as mPCIe serial IO modules) which are hard-wired to RS485 or have jumpers for their configurations. Signed-off-by: Daniel Golle Reviewed-by: Jan Kiszka Signed-off-by: Greg Kroah-Hartman commit c3bf40ce2c2029b4e11bfcfa404dda4472d93429 Author: Johan Hovold Date: Wed May 30 12:50:59 2018 +0200 serdev: add controller runtime PM support Add support for controller runtime power management to serdev core. This is needed to allow slave drivers to manage the runtime PM state of the underlying serial controller when its driver, in turn, implements more aggressive runtime power management (e.g. using autosuspend). For some applications, for example, where loss off initial data after a remote-wakeup event is acceptable or where rx is not used at all, aggressive serial controller runtime PM may be used without further involvement of the slave driver. But when this is not the case, the slave driver must be able to indicate when incoming data is expected in order to avoid data loss. To facilitate the common case, where the serial controller power state is active whenever the port is open (which is the case with just about every serial driver), and where data loss is not acceptable and cannot even be prevented by explicit controller runtime power management, an RPM reference is taken in serdev open and put again at close. This reference can later be balanced by any serdev driver which wants and/or can handle aggressive controller runtime PM. Note that the .ignore_children flag is set for the serdev controller to allow the underlying hardware to idle when no I/O is expected, regardless of the slave device RPM state. Acked-by: Tony Lindgren Reviewed-by: Sebastian Reichel Signed-off-by: Johan Hovold Acked-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 95a0e656580fab3128c7bee5f660c50784f53651 Author: Christophe JAILLET Date: Mon Jun 11 19:30:35 2018 +0200 serial: pxa: Fix an error handling path in 'serial_pxa_probe()' If port.line is out of range, we still need to release some resources, or we will leak them. Fixes: afc7851fab83 ("serial: pxa: Fix out-of-bounds access through serial port index") Signed-off-by: Christophe JAILLET Signed-off-by: Greg Kroah-Hartman commit 4cf9a888fd3c8e61509afb0d2fe0ad2170d77d9f Author: Jan Kundrát Date: Fri Jun 8 14:27:00 2018 +0200 serial: max310x: Check the clock readiness This chip has a diagnostics status bit informing about the state and stability of the clock subsystem. According to the datasheet (STSint register, bit 5, ClockReady), this bit works with the crystal oscillator, but even without the PLL. Therefore: - ensure that the clock check is done even when PLL is not active - warn when the chip thinks that the clock is not ready yet There are HW features which would let us wait asynchronously (there's a maskable IRQ for that bit), but I think that even this simple check is a net improvement. It would have saved me two days of debugging :). Signed-off-by: Jan Kundrát Signed-off-by: Greg Kroah-Hartman commit c884f871fb0ef0af0485d270215ba7f7debf38ad Author: Arnd Bergmann Date: Mon Jun 18 16:16:26 2018 +0200 tty: use 64-bit timstamp The automated VFS conversion to timespec64 has left one caller of the deprecated get_seconds() function in the tty driver, this cleans it up to call ktime_get_real_seconds() instead, fixing the possible overflow. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit a7eaad7f7517ba7cdabfeb28fa05bae4e70b4b5a Author: Michel Pollet Date: Thu Jun 28 09:17:12 2018 +0100 dt-bindings: cpu: Add Renesas R9A06G032 SMP enable method. Add a special enable method for second CA7 of the R9A06G032 Signed-off-by: Michel Pollet Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit fb7f1bf8d05e4f339450f3f74bd91c72ce980748 Author: Robin Gong Date: Wed Jun 20 00:56:58 2018 +0800 tty: serial: imx: correct dma cookie status Correct to check the right rx dma cookie status in spit of it works because only one cookie is running in the current sdma. But it will not once sdma driver support multi cookies running based on virt-dma. Signed-off-by: Robin Gong Reviewed-by: Sascha Hauer Acked-by: Uwe Kleine-König Tested-by: Lucas Stach Signed-off-by: Greg Kroah-Hartman commit e51e597d9f692cd7d205e3b44bb35ea3b97e7329 Author: Baruch Siach Date: Thu Jun 28 10:25:32 2018 +0300 dt-bindings: serial: imx: clarify rs485 support usage The i.MX UART peripheral uses the RST_B signal as input, and CTS_B as output. This is just like the DCE role in RS-232. This is true regardless of the "DTE mode" setting of this peripheral. As a result, rs485 support hardware must use the CTS_B signal to control the RS-485 transceiver. This is in contrast to generic rs485 kernel code, documentation, and DT property names that consistently refer to the RTS as transceiver control signal. Add a note in the DT binding document about that, to reduce the confusion somewhat. Signed-off-by: Baruch Siach Acked-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman commit 728e74a46fd4166935f2079b619007eaad98c9a5 Author: Uwe Kleine-König Date: Tue Jun 12 11:58:37 2018 +0200 serial: imx: fix comment about UCR2_SRST and its handling for shadowing Initially when register shadowing was introduced (commit 3a0ab62f43de ("serial: imx: implement shadow registers for UCRx and UFCR")) the logic to handle UCR2_SRST was wrong but documented consistently. Later the handling was fixed, but the comment was not. This change makes up leeway for the latter. Fixes: 0aa821d846c0 ("serial: imx: fix cached UCR2 read on software reset") Signed-off-by: Uwe Kleine-König Reviewed-by: Stefan Agner Signed-off-by: Greg Kroah-Hartman commit 00af4635a1de10644ed76fee973b44a001499108 Author: Hans Verkuil Date: Fri Jun 15 09:19:45 2018 -0400 media: subdev-formats.rst: fix incorrect types The ycbcr_enc, quantization and xfer_func fields are __u16 and not enums. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8c4fe24812e65703658d93005046f34aa27e3557 Author: Hans Verkuil Date: Fri Jun 15 09:19:44 2018 -0400 media: Documentation/media/uapi/mediactl: redo tables Drop the '- .. row 1' lines to make it easier to add new rows to the tables in the future without having to renumber these lines. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1831af092308aa5a59ae61e47494e441c8be6b93 Author: Javier Martinez Canillas Date: Sun Jun 10 16:43:02 2018 -0400 media: Revert "[media] tvp5150: fix pad format frame height" This reverts commit 0866df8dffd514185bfab0d205db76e4c02cf1e4. The v4l uAPI documentation [0] makes clear that in the case of interlaced video (i.e: field is V4L2_FIELD_ALTERNATE) the height refers to the number of lines in the field and not the number of lines in the full frame (which is twice the field height for interlaced formats). So the original height calculation was correct, and it shouldn't had been changed by the mentioned commit. [0]:https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/subdev-formats.html Fixes: 0866df8dffd5 ("[media] tvp5150: fix pad format frame height") Signed-off-by: Javier Martinez Canillas Cc: # for v4.12 and up Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit aed19754c491b336cb40bbd3f072b0e9e1397200 Author: Ezequiel Garcia Date: Thu Jun 14 11:34:05 2018 -0400 media: rcar_vpu: Drop unneeded job_ready It is not required to implement job_ready(). Since this one is dummy, we can drop it. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d7e913cc58c5f6db5159c72e8f8d1f2be9e2fe2f Author: Ezequiel Garcia Date: Thu Jun 14 11:34:03 2018 -0400 media: mem2mem: Remove unused v4l2_m2m_ops .lock/.unlock Commit f1a81afc98e3 ("[media] m2m: fix bad unlock balance") removed the last use of v4l2_m2m_ops.lock and v4l2_m2m_ops.unlock hooks. They are not actually used anymore. Remove them. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1b97e5275ba6ef862a09f8b993fa3e8b373dfe9b Author: Ezequiel Garcia Date: Fri Jun 1 15:49:52 2018 -0400 media: rockchip/rga: Remove unrequired wait in .job_abort As per the documentation, job_abort is not required to wait until the current job finishes. It is redundant to do so, as the core will perform the wait operation. Remove the wait infrastructure completely. Signed-off-by: Ezequiel Garcia Reviewed-by: Jacob Chen Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9aecc03555825a79a8a4ca45199cb866e8684623 Author: Ezequiel Garcia Date: Fri Jun 1 15:49:51 2018 -0400 media: rockchip/rga: Fix broken .start_streaming Currently, rga_buf_start_streaming() is expecting pm_runtime_get_sync to return zero on success, which is wrong. As per the documentation, pm_runtime_get_sync increments the device's usage counter and return its result. This means it will typically return a positive integer on success and a negative error code. Therefore, rockchip-rga driver is currently unusable failing to start_streaming in most cases. Fix it and while here, cleanup the buffer return-to-core logic. Fixes: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support") Signed-off-by: Ezequiel Garcia Reviewed-by: Jacob Chen [hans.verkuil@cisco.com: fix line over 80 cols warning] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1946117b8f135a62eea5cfa18be63b1741174b9f Author: Alexandre Courbot Date: Tue Jun 5 00:50:46 2018 -0400 media: venus: keep resolution when adjusting format When checking a format for validity, the resolution is reset to 1280x720 whenever the pixel format is not supported. This behavior can mislead user-space into believing that this is the only resolution supported, and looks strange considering that if we try/set the same format with just the pixel format changed to a valid one, the call will this time succeed without altering the resolution. Resolution is managed independently of the pixel format, so remove this reset. Signed-off-by: Alexandre Courbot Acked-by: Stanimir Varbanov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e95d7c6eb94c634852eaa5ff4caf3db05b5d2e86 Author: Zhouyang Jia Date: Mon Jun 11 00:39:20 2018 -0400 media: tm6000: add error handling for dvb_register_adapter When dvb_register_adapter fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling dvb_register_adapter. Signed-off-by: Zhouyang Jia [hans.verkuil@cisco.com: use pr_err and fix typo: adater -> adapter] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6c8871baebc781f27ec9ccc1324afd9802941b11 Author: Zhouyang Jia Date: Mon Jun 11 03:41:58 2018 -0400 media: cx88: add error handling for snd_ctl_add When snd_ctl_add fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling snd_ctl_add. Signed-off-by: Zhouyang Jia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7534122d60066a50859c422ced4636deb23760bf Author: Colin Ian King Date: Tue Jun 12 05:42:00 2018 -0400 media: cx18: remove redundant zero check on retval The check for a zero retval is redundant as all paths that lead to this point have set retval to an error return value that is non-zero. Remove the redundant check. Detected by CoverityScan, CID#102589 ("Logically dead code") Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 34dbb848d5e47f0a16abeb40885f93dd43045ff1 Author: Ezequiel Garcia Date: Tue Jun 12 09:22:51 2018 -0400 media: mem2mem: Remove excessive try_run call If there is a schedulable job, v4l2_m2m_try_schedule() calls v4l2_m2m_try_run(). This makes the unconditional v4l2_m2m_try_run() called by v4l2_m2m_job_finish superfluous. Remove it. Fixes: 7f98639def42 ("V4L/DVB: add memory-to-memory device helper framework for videobuf") Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a4367ff42dde5d24f5217edba7c54cd13e21b2b6 Author: Anton Leontiev Date: Tue Jun 12 06:11:06 2018 -0400 media: rga: Remove surplus name initialization Name is already initialized by assignment from rga_videodev. Signed-off-by: Anton Leontiev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 661e7e8178fba7bbaf0845326b36fd99887982d3 Author: Anton Leontiev Date: Tue Jun 12 06:11:05 2018 -0400 media: m2m-deinterlace: Remove surplus name initialization Name is already initialized by assignment from deinterlace_videodev. Signed-off-by: Anton Leontiev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0874f0295d4e7f61b7c2c8b3ce3a7c70727693bd Author: Anton Leontiev Date: Tue Jun 12 06:11:04 2018 -0400 media: mx2: Remove surplus name initialization Name is already initialized by assignment from emmaprp_videodev. Signed-off-by: Anton Leontiev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4fb5288b1965f33c7c0056c55b3ec5d9d4a52044 Author: Anton Leontiev Date: Tue Jun 12 06:11:03 2018 -0400 media: s5p-g2d: Remove surplus name initialization Name is already initialized by assignment from g2d_videodev. Signed-off-by: Anton Leontiev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0d961c8998d7e8ea6dd0e00a7fdc629a0a0753cd Author: Anton Leontiev Date: Tue Jun 12 06:11:02 2018 -0400 media: ti-vpe: Remove surplus name initialization Name is already initialized by assignment from vpe_videodev. Signed-off-by: Anton Leontiev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a9c24b8977c216cd7a8bf5a9f9d0621668e49746 Author: Anton Leontiev Date: Tue Jun 12 06:11:01 2018 -0400 media: vim2m: Remove surplus name initialization Name is already initialized by assignment from vim2m_videodev. Signed-off-by: Anton Leontiev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f91b84171b618dfd565b10c1a7feead0af869ba5 Author: Colin Ian King Date: Mon Jun 11 04:32:20 2018 -0400 media: bt8xx: bttv: fix spelling mistake: "culpit" -> "culprit" Trivial fix to spelling mistake in pr_notice message text Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b7bf15c43c90c13c15db23612409783db97f680a Author: Steve Longerbeam Date: Fri Jun 8 17:45:51 2018 -0400 media: i2c: adv748x: csi2: set entity function to video interface bridge The ADV748x CSI-2 subdevices are HDMI/AFE to MIPI CSI-2 bridges. Signed-off-by: Steve Longerbeam Acked-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 22d71a5097ec7059b6cbbee678a4f88484695941 Author: Mika Westerberg Date: Thu Jun 28 13:52:23 2018 +0300 spi: pxa2xx: Add support for Intel Ice Lake Intel Ice Lake SPI host controller follows the Intel Cannon Lake but the PCI IDs are different. Add the new PCI IDs to the driver supported devices list. Signed-off-by: Mika Westerberg Signed-off-by: Jarkko Nikula Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit cc00f5845af5ef2e0b8fb921517d57bf5d987917 Author: Corentin Labbe Date: Thu Jun 7 16:02:21 2018 -0400 media: cx25821: remove cx25821-audio-upstream.c and cx25821-video-upstream.c Those two files are unused since commit 486a7a2813c7 ("[media] cx25821: remove cx25821-audio-upstream.c") and commit b6f21dc3541a ("[media] cx25821: remove video output support") Remove them from tree. Signed-off-by: Corentin Labbe Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 152e0bf60219ba589254c7aff4c095943c36cf68 Author: Hugues Fruchet Date: Wed Jun 13 05:59:39 2018 -0400 media: stm32-dcmi: add power saving support Implements runtime & system sleep power management ops. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f11552d030e8e5a0a945b1920e31eaf48fe3fad4 Author: Nicholas Mc Guire Date: Tue Jun 12 13:23:16 2018 -0400 media: stm32-dcmi: simplify of_node_put usage This does not fix any bug - this is just a code simplification. As np is not used after passing it to v4l2_fwnode_endpoint_parse() its refcount can be decremented immediately and at one location. Signed-off-by: Nicholas Mc Guire Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c2ee2243ce3763fef8da097851b2c07b73e18cdb Author: Nicholas Mc Guire Date: Tue Jun 12 13:22:18 2018 -0400 media: stm32-dcmi: add mandatory of_node_put() in success path The endpoint allocated by of_graph_get_next_endpoint() needs an of_node_put() in both error and success path. As ep is not used the refcount decrement can be right after the last use of ep. Fixes: commit 37404f91ef8b ("[media] stm32-dcmi: STM32 DCMI camera interface driver") Signed-off-by: Nicholas Mc Guire Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f8eb8e5c1f31f059677a80e0a902e64065695fa8 Author: Nicholas Mc Guire Date: Tue Jun 12 13:22:17 2018 -0400 media: stm32-dcmi: drop unnecessary while(1) loop The while(1) is effectively useless as all possible paths within it return thus there is no way to loop. Signed-off-by: Nicholas Mc Guire Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fdaf59582c037ca5bd23f23ab28c1c5c384c0520 Author: Hugues Fruchet Date: Mon Jun 11 05:52:17 2018 -0400 media: stm32-dcmi: revisit stop streaming ops Do not wait for interrupt completion when stopping streaming, stopping sensor and disabling interruptions are enough. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 49bcc1746ffbf94f41840718c5fab1a8d56c82d8 Author: Hugues Fruchet Date: Mon Jun 11 05:50:27 2018 -0400 media: stm32-dcmi: revisit buffer list management Cleanup "active" field usage and enhance list management to avoid exceptions when releasing buffers on error or stopping streaming. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2d494d4a09c027fd656862dc0a1aa7a14db42e2a Author: Hugues Fruchet Date: Mon Jun 11 05:50:26 2018 -0400 media: stm32-dcmi: clarify state logic on buffer starvation Introduce WAIT_FOR_BUFFER state instead of "active" field checking to manage buffer starvation case. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a331df3cb3a121ed9d6c2010f28ca0fccc4153ba Author: Hugues Fruchet Date: Mon Jun 11 05:50:25 2018 -0400 media: stm32-dcmi: return buffer in error state on dma error Return buffer to V4L2 in error state if DMA error occurs. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b53a24fc2849a4d56961ac74a7aaeca9f5953a5a Author: Hugues Fruchet Date: Mon Jun 11 05:50:24 2018 -0400 media: stm32-dcmi: do not fall into error on buffer starvation Return silently instead of falling into error when running out of available buffers when restarting capture. Capture will be restarted when new buffers will be provided by V4L2 client. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4b84e75020a6b136e7160a9c53443b4c26e5d518 Author: Hugues Fruchet Date: Mon Jun 11 05:50:09 2018 -0400 media: stm32-dcmi: code cleanup Minor non-functional fixes around comments, variable namings and trace point enhancement. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 312ae0ae7479d30f8876bafbc4cca24f0605c65f Author: Matti Vaittinen Date: Thu Jun 28 14:23:04 2018 +0300 regulator: bd71837: Remove duplicate description from DT bindings Same general chip description was written in MFD and Regulator binding documents for ROHM bd71837 PMIC. Remove description from regulator binding as suggested by Rob H. Signed-off-by: Matti Vaittinen Signed-off-by: Mark Brown commit bfe75f76d7bee4513bc7851ba1699f4bc472d6ca Author: Hugues Fruchet Date: Mon Jun 11 05:41:19 2018 -0400 media: stm32-dcmi: increase max width/height to 2592 DCMI can capture 5Mp raw frames, increase limit accordingly. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c9dc4cfa10a1266376dde151485f7b493447258b Author: Matti Vaittinen Date: Thu Jun 28 14:22:23 2018 +0300 regulator: bd71837: Editorial cleanups. Address issues spotted by Andy Shevchenko during review of original patch No functional changes intended Signed-off-by: Matti Vaittinen Signed-off-by: Mark Brown commit fdd49c510021d389bf5979282193e084f328e031 Author: Takashi Iwai Date: Wed Jun 27 09:54:46 2018 +0200 ALSA: hda/hdmi - Don't fall back to generic when i915 binding fails When i915 component binding fails, it means that HDMI isn't applicable anyway. Although the probe with the generic HDMI parser would still work, it's essentially useless, hence better to be left unbound. This patch mimics the probe_id field at failing the i915 component binding so that the generic HDMI won't be bound after that. Signed-off-by: Takashi Iwai commit 10f146639fee5ffaf7cf0081c1af518f7d0c533c Author: Johan Hovold Date: Fri Jun 1 10:22:59 2018 +0200 gnss: add receiver type support Add a "type" device attribute and a "GNSS_TYPE" uevent variable which can be used to determine the type of a GNSS receiver. The currently identified types reflect the protocol(s) supported by a receiver: "NMEA" NMEA 0183 "SiRF" SiRF Binary "UBX" UBX Note that both SiRF and UBX type receivers typically support a subset of NMEA 0183 with vendor extensions (e.g. to allow switching to the vendor protocol). Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit d2efbbd18b1e26ac79401841089e4a4b97d745c3 Author: Johan Hovold Date: Fri Jun 1 10:22:58 2018 +0200 gnss: add driver for sirfstar-based receivers Add driver for serial-connected SiRFstar-based GNSS receivers. These devices typically boot into hibernate mode from which they can be woken using a pulse on the ON_OFF input pin. Once active, a pulse on the same ON_OFF pin is used to put the device back into hibernate mode. The current state can be determined by sampling the WAKEUP output. Hardware configurations where WAKEUP has been connected to ON_OFF (and where an initial WAKEUP pulse during boot is sufficient to have the device boot into active mode) are also supported. In this case, device power is managed using the main-supply regulator only. Note that configurations where WAKEUP is left not connected, so that the device power state can only indirectly be determined using the I/O interface, is currently not supported. It should be fairly straight-forward to extend the current implementation with such support however (and this this is the main reason for not using the generic serial implementation for this driver). Note that timepulse-support is left unimplemented. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 176193b7dd6ebcb4bb843f7b08663aeeabbdeacc Author: Johan Hovold Date: Fri Jun 1 10:22:57 2018 +0200 dt-bindings: gnss: add sirfstar binding Add binding for SiRFstar-based GNSS receivers. Note that while four compatible-strings are initially added representing devices which differ in which I/O interfaces they support, they otherwise essentially share the same feature set. Pin and supply names vary slightly, as do some recommended timings. Note that the wakeup gpio is not intended to be used as a wakeup source, but rather to detect the current power state of the device (active or hibernate). Reviewed-by: Rob Herring Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 1ad69f10e3a58db60210f2869d5afddb40714507 Author: Johan Hovold Date: Fri Jun 1 10:22:56 2018 +0200 gnss: add driver for u-blox receivers Add driver for serial-connected u-blox GNSS receivers. Note that the driver uses the generic GNSS serial implementation and therefore essentially only manages power abstracted into three power states: ACTIVE, STANDBY, and OFF. For u-blox receivers with a main supply and no enable-gpios, this simply means that the main supply is disabled in STANDBY and OFF (the optional backup supply is kept enabled while the driver is bound). Note that timepulse-support is not yet implemented. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit cf408372e5f583c5289319f597a2816f282b572b Author: Johan Hovold Date: Fri Jun 1 10:22:55 2018 +0200 dt-bindings: gnss: add u-blox binding Add binding for u-blox GNSS receivers. Note that the u-blox product names encodes form factor (e.g. "neo"), chipset (e.g. "8") and variant (e.g. "q"), but that only formfactor and chipset is used for the compatible strings (for now). Signed-off-by: Johan Hovold Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 37768b054f2074f40de3cacd492baed482f5d9da Author: Johan Hovold Date: Fri Jun 1 10:22:54 2018 +0200 gnss: add generic serial driver Add a generic serial GNSS driver (library) which provides a common implementation for the gnss interface and power management (runtime and system suspend). This allows GNSS drivers for specific chip to be implemented by simply providing a set_power() callback to handle three states: ACTIVE, STANDBY and OFF. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 98ddec80fdf1c3e6c594fe633e6fb2a8a0d699dd Author: Johan Hovold Date: Fri Jun 1 10:22:53 2018 +0200 dt-bindings: add generic gnss binding Describe generic properties for GNSS receivers. Reviewed-by: Rob Herring Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 2b6a440351436d792b1960822da4b7d6e673f568 Author: Johan Hovold Date: Fri Jun 1 10:22:52 2018 +0200 gnss: add GNSS receiver subsystem Add a new subsystem for GNSS (e.g. GPS) receivers. While GNSS receivers are typically accessed using a UART interface they often also support other I/O interfaces such as I2C, SPI and USB, while yet other devices use iomem or even some form of remote-processor messaging (rpmsg). The new GNSS subsystem abstracts the underlying interface and provides a new "gnss" class type, which exposes a character-device interface (e.g. /dev/gnss0) to user space. This allows GNSS receivers to have a representation in the Linux device model, something which is important not least for power management purposes. Note that the character-device interface provides raw access to whatever protocol the receiver is (currently) using, such as NMEA 0183, UBX or SiRF Binary. These protocols are expected to be continued to be handled by user space for the time being, even if some hybrid solutions are also conceivable (e.g. to have kernel drivers issue management commands). This will still allow for better platform integration by allowing GNSS devices and their resources (e.g. regulators and enable-gpios) to be described by firmware and managed by kernel drivers rather than platform-specific scripts and services. While the current interface is kept minimal, it could be extended using IOCTLs, sysfs or uevents as needs and proper abstraction levels are identified and determined (e.g. for device and feature identification). Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit aa2f88712718d045855acc6686dbce6a7286d010 Author: Niklas Söderlund Date: Thu May 17 10:30:15 2018 -0400 media: v4l2-ioctl: create helper to fill in v4l2_standard for ENUMSTD Prepare for adding a new IOCTL VIDIOC_SUBDEV_ENUMSTD which would enumerate the standards for a subdevice by breaking out the code which could be shared between the video and subdevice versions of this IOCTL. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil [hans.verkuil@cisco.com: fixed 'sdandard' typos in v4l2-ioctl.h] Signed-off-by: Mauro Carvalho Chehab commit 39fb993038e158d4cbba47f6dbda6fe77a0e8cb9 Author: Jacopo Mondi Date: Mon May 28 12:37:11 2018 -0400 media: arch: sh: ap325rxa: Use new renesas-ceu camera driver Use the new renesas-ceu camera driver in ap325rxa board file instead of the soc_camera based sh_mobile_ceu_camera driver. Get rid of soc_camera specific components, and register CEU0 with a single video sensor (ov7725). Memory for the CEU video buffers is now reserved with membocks APIs and need to be declared as dma_coherent during machine initialization to remove that architecture specific part from CEU driver. The ap325rxa board file registers another camera (ncm03j) for which I found no driver in mainline kernel version, and that was configured/probed by sending i2c messages (of 'magic blobs) from the board file itself. I removed the sensor registration from this new version as it used soc_camera components that will be later removed. While at there update license to SPDX header and sort headers alphabetically. Compile tested only. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1a3c230b415169b7110a5d937145a56fc12b13bf Author: Jacopo Mondi Date: Mon May 28 12:37:10 2018 -0400 media: arch: sh: ms7724se: Use new renesas-ceu camera driver Use the new renesas-ceu camera driver is ms7724se board file instead of the soc_camera based sh_mobile_ceu_camera driver. Get rid of soc_camera specific components, and register CEU0 and CEU1 with no active video subdevices. Memory for the CEU video buffers is now reserved with membocks APIs and need to be declared as dma_coherent during machine initialization to remove that architecture specific part from CEU driver. While at there update license to SPDX header and sort headers alphabetically. No need to udapte the clock source names, as commit c2f9b05fd5c1 ("media: arch: sh: ecovec: Use new renesas-ceu camera driver") already updated it to the new ceu driver name for all SH7724 boards (possibly breaking ms7724se before this commit). Compile tested only. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f3590dc329744dc8426dc9c76e37f4bd27ca8594 Author: Jacopo Mondi Date: Mon May 28 12:37:09 2018 -0400 media: arch: sh: kfr2r09: Use new renesas-ceu camera driver Use the new renesas-ceu camera driver in kfr2r09 board file instead of the soc_camera based sh_mobile_ceu_camera driver. Get rid of soc_camera specific components, and move clk and gpio handling away from board file, registering the clock source and the enable gpios for driver consumption. Memory for the CEU video buffers is now reserved with membocks APIs, and need to be declared as dma_coherent during machine initialization to remove that architecture specific part from CEU driver. While at there update license to SPDX header and sort headers alphabetically. No need to udapte the clock source names, as commit c2f9b05fd5c1 ("media: arch: sh: ecovec: Use new renesas-ceu camera driver") already updated it to the new ceu driver name for all SH7724 boards (possibly breaking kfr2r09 before this commit). Compile tested only. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8cba1ae675f2b4662a62e8c83a4a172360bdf3ea Author: Jacopo Mondi Date: Mon May 28 12:37:08 2018 -0400 media: i2c: rj54n1: Remove soc_camera dependencies Remove soc_camera framework dependencies from rj54n1 sensor driver. - Handle clock - Handle GPIOs (named 'powerup' and 'enable') - Register the async subdevice - Remove g/s_mbus_config as they're deprecated. - Adjust build system - List the driver as maintained for 'Odd Fixes' as I don't have HW to test. This commits does not remove the original soc_camera based driver. Compiled tested only. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f187352dcd45d6f48c43c78dcc0d88d5508ecb11 Author: Jacopo Mondi Date: Mon May 28 12:37:07 2018 -0400 media: i2c: Copy rj54n1cb0c soc_camera sensor driver Copy the soc_camera based driver in v4l2 sensor driver directory. This commit just copies the original file without modifying it. No modification to KConfig and Makefile as soc_camera framework dependencies need to be removed first in next commit. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a740e3b2f7a26c5dd13741d399b69e22660b1b96 Author: Niklas Söderlund Date: Mon May 28 19:49:06 2018 -0400 media: rcar-vin: enable support for r8a77965 Add the SoC specific information for Renesas r8a77965. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 23689ab1add36964b69b6e4fdb97d52f315119f5 Author: Niklas Söderlund Date: Mon May 28 19:26:37 2018 -0400 media: rcar-vin: sync which hardware buffer to start capture from When starting the VIN capture procedure we are not guaranteed that the first buffer written to is VnMB1 to which we assigned the first buffer queued. This is problematic for two reasons. Buffers might not be dequeued in the same order they where queued for capture. Future features planed for the VIN driver is support for outputting frames in SEQ_TB/BT format and to do that it's important that capture starts from the first buffer slot, VnMB1. We are guaranteed that capturing always happens in sequence (VnMB1 -> VnMB2 -> VnMB3 -> VnMB1). So drop up to two frames when starting capturing so that the driver always returns buffers in the same order they are queued and prepare for SEQ_TB/BT output. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e10cf92ead486b24a3169bb3b3215cf5775225fd Author: Niklas Söderlund Date: Mon May 28 19:17:04 2018 -0400 media: dt-bindings: media: rcar_vin: fix style for ports and endpoints The style for referring to ports and endpoint are wrong. Refer to them using lowercase and a unit address, port@x and endpoint@x. Signed-off-by: Niklas Söderlund Reported-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Simon Horman Reviewed-by: Simon Horman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6ad48c27fc08e1cc931798399eccfdc46b45f4b8 Author: Niklas Söderlund Date: Sun May 13 14:58:18 2018 -0400 media: dt-bindings: media: rcar_vin: add support for r8a77965 Signed-off-by: Niklas Söderlund Reviewed-by: Simon Horman Acked-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fd59ccb9b6cb5051b84ec7ac9df32631ec43da2a Author: Simon Horman Date: Wed May 9 14:45:58 2018 -0400 media: rcar-vin: Drop unnecessary register properties from example vin port The example vin port node does not have an address and thus does not need address-cells or address size-properties. Signed-off-by: Simon Horman Acked-by: Niklas Söderlund Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 653d500ccaadd76ccade9f07469cdc66759315b6 Author: Pavel Machek Date: Sun May 6 04:06:07 2018 -0400 media: i2c: lm3560: add support for lm3559 chip Add support for LM3559, as found in Motorola Droid 4 phone, for example. SW interface seems to be identical. Signed-off-by: Pavel Machek Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit aaf3f4e925dc2bdc4715142103660285632a245c Author: Heikki Krogerus Date: Wed Jun 27 18:19:47 2018 +0300 usb: typec: function for checking cable plug orientation This adds function typec_get_orientation() that can be used for checking the current cable plug orientation. Signed-off-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 82f5d7749fa4f3851f705c75b33babf68edb90b8 Author: Heikki Krogerus Date: Wed Jun 27 18:19:46 2018 +0300 usb: pd: include kernel.h This makes life a bit easier for the drivers that include pd.h. All pd_header_*_le() inline functions defined in pd.h call le16_to_cpu(), and all *_LE() macros in pd.h call cpu_to_le16(). Signed-off-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit ce3ff60f02349471b3bb24516b87da799a5b61e6 Author: Gabriel Fanelli Date: Thu Jun 7 03:12:16 2018 -0400 media: staging: media: bcm2048: match alignment with open parenthesis This patch fixes the checkpatch.pl issue: CHECK: Alignment should match open parenthesis Signed-off-by: Gabriel Fanelli Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 055eceebecfe0d0997b6f7902b36cd6bb5fac860 Author: Jacopo Mondi Date: Wed Jun 6 09:21:53 2018 -0400 media: renesas-ceu: Add support for YUYV permutations Add support for YUYV permutations, passing down to the subdevice the media bus format with components ordering that reflect the output pixel format one. Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4f9195e3f88c13de94f5828f53d0ffab00d20e6d Author: Nicholas Mc Guire Date: Fri Jun 1 09:30:14 2018 -0400 media: atmel-isi: move of_node_put() to cover success branch as well The of_node_put() was only covering the error branch but missed the success branch so the refcount for ep which of_graph_get_remote_port_parent() incremented on success would was not being decremented. Signed-off-by: Nicholas Mc Guire Acked-by: Ludovic Desroches Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e8ced209510164f0b54d4bb2a34d243a8af8f561 Author: Nicholas Mc Guire Date: Fri Jun 1 08:46:14 2018 -0400 media: atmel-isi: drop unnecessary while loop As there is no way this can loop it actually makes no sense to have a while(1){} around the body - all three possible paths end in a return statement. Fixes: commit c1d82b895380 "[media] atmel-isi: move out of soc_camera to atmel" Signed-off-by: Nicholas Mc Guire Acked-by: Ludovic Desroches Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 990da41530b31ed7de29340ce1d78c04bee9670c Author: Li Jun Date: Wed Jun 27 07:45:32 2018 +0800 staging: typec: tcpci: move tcpci drivers out of staging Move TCPCI(Typec port controller interface) driver and rt1711h driver out of staging. Signed-off-by: Li Jun Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 002514880ef36c26c19b144b11d7dae839ae4fe6 Author: Li Jun Date: Wed Jun 27 07:45:31 2018 +0800 staging: typec: tcpci: Only touch target bit when enable vconn We need regmap_update_bits to avoid touch any other bits when enable or disable vconn. Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Signed-off-by: Greg Kroah-Hartman commit 3af50c293368f42390b8f3d9ec19e3b9b858c34d Author: Li Jun Date: Wed Jun 27 07:45:30 2018 +0800 staging: typec: tcpci: keep the disconnected cc line open While set polarity, we should keep the disconnected cc line to be open. Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 8e04b3721cc86ce7a3d95bcbc6971d7996aa541c Author: Li Jun Date: Wed Jun 27 07:45:29 2018 +0800 typec: tcpm: add starting value for drp toggling As DRP port autonomously toggles the Rp/Rd need a start value to begin with, so add one parameter for it in tcpm_start_drp_toggling. Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Signed-off-by: Greg Kroah-Hartman commit 21046320b43811fb52787939e4607818687b8b39 Author: Li Jun Date: Wed Jun 27 07:45:28 2018 +0800 staging: typec: tcpci: enable vbus detection TCPCI implementation may need SW to enable VBUS detection to generate power status events. Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Signed-off-by: Greg Kroah-Hartman commit b28d9be6ce881ff427b508aef5aad9f7726ef4f2 Author: Peter Chen Date: Wed Jun 27 07:45:27 2018 +0800 staging: typec: tcpci: register port before request irq With that we can clear any pending events and the port is registered so driver can be ready to handle typec events once we request irq. Reviewed-by: Heikki Krogerus Signed-off-by: Peter Chen Signed-off-by: Li Jun Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit d3a4c916a92f7e50acd58b54f300c4390c04639f Author: Li Jun Date: Wed Jun 27 07:45:26 2018 +0800 staging: typec: tcpci: use IS_ERR() instead of PTR_ERR_OR_ZERO() As tcpm_register_port() and tcpci_register_port() never return NULL and NULL is not a success in this case, use IS_ERR() to check the return value of both. Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit c2ee5e18652f7ed2bf6e0fbaa374f23cfd406e72 Author: Li Jun Date: Wed Jun 27 07:45:25 2018 +0800 staging: typec: tcpci: remove unused tcpci_tcpc_config Since we will use config settings via device properties, so remove the hard code tcpci_tcpc_config. Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 96232cbc6c994c6af387c3c6e2a1f121cf5b1a2d Author: Li Jun Date: Wed Jun 27 07:45:24 2018 +0800 usb: typec: tcpm: support get typec and pd config from device properties This patch adds support of get typec and power delivery config from firmware description. Reviewed-by: Heikki Krogerus Reviewed-by: Guenter Roeck Signed-off-by: Li Jun Acked-by: Adam Thomson Signed-off-by: Greg Kroah-Hartman commit 9c90e02434b66f9bcfc5c9a91a808eee5b7aa21b Author: Li Jun Date: Wed Jun 27 07:45:23 2018 +0800 usb: typec: add API to get typec basic port power and data config This patch adds 3 APIs to get the typec port power and data type, and preferred power role by its name string. Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Signed-off-by: Greg Kroah-Hartman commit 5e85a04c8c0d271d7561a770b85741f186398868 Author: Li Jun Date: Wed Jun 27 07:45:22 2018 +0800 usb: typec: add fwnode to tcpc Add fwnode handle to get the fwnode so we can get typec configs it contains. Suggested-by: Heikki Krogerus Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 40242086f78c78284b54d11148f8bb35600178a4 Author: Li Jun Date: Wed Jun 27 07:45:21 2018 +0800 staging: typec: tcpci: add compatible string for nxp ptn5110 Add nxp ptn5110 typec controller compatible string: "nxp,ptn5110", which is a standard tcpci chip with power delivery support. Meanwhile remove "usb,tcpci" because it doesn't follow the binding format rule and has not been used yet. Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 9aaf7e4348141c7ca7e47a2155e654f32031b397 Author: Li Jun Date: Wed Jun 27 07:45:20 2018 +0800 dt-bindings: usb: add documentation for typec port controller(TCPCI) TCPCI stands for typec port controller interface, its implementation has full typec port control with power delivery support, it's a standard i2c slave with GPIO input as irq interface, detail see spec "Universal Serial Bus Type-C Port Controller Interface Specification Revision 1.0, Version 1.1" Reviewed-by: Rob Herring Signed-off-by: Li Jun Signed-off-by: Greg Kroah-Hartman commit 7a846d3c43b0b6d04300be9ba666b102b57a391a Author: Li Jun Date: Wed Jun 27 07:45:19 2018 +0800 dt-bindings: connector: add properties for typec Add bindings supported by current typec driver, so user can pass all those properties via dt. Reviewed-by: Rob Herring Signed-off-by: Li Jun Signed-off-by: Greg Kroah-Hartman commit 8d361fa2c29dcaf258f71e70cd75ff51084c3e5e Author: Kees Cook Date: Mon Jun 25 15:23:16 2018 -0700 usb: typec: tps6598x: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this uses the maximum buffer size and adds a sanity check. While 25 bytes is the size of the largest current things coming through, Heikki Krogerus pointed out that the actual max in 64 bytes, as per ch 1.3.2 http://www.ti.com/lit/ug/slvuan1a/slvuan1a.pdf [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit e32eb0d8a6cdc965347b964e45e40c9254bd7408 Author: Nicholas Mc Guire Date: Fri Jun 1 05:21:32 2018 -0400 media: adv7604: simplify of_node_put() As the of_node_put() is unconditional here there is no need to have it twice. Signed-off-by: Nicholas Mc Guire Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7fc77a2fdaa985393d84b8967db2c27664ec384b Author: Arnd Bergmann Date: Wed May 30 18:07:11 2018 -0400 media: v4l: omap: add VIDEO_V4L2 dependency The omap media driver can be built-in while the v4l2 core is a loadable module. This is a mistake and leads to link errors: drivers/media/platform/omap/omap_vout.o: In function `omap_vout_remove': omap_vout.c:(.text+0xec): undefined reference to `v4l2_device_unregister' omap_vout.c:(.text+0x140): undefined reference to `video_device_release' omap_vout.c:(.text+0x150): undefined reference to `video_unregister_device' omap_vout.c:(.text+0x15c): undefined reference to `v4l2_ctrl_handler_free' An explicit Kconfig dependency on VIDEO_V4L2 avoids the problem. I ran into this problem for the first time today during my randconfig builds, but could not find what caused it. Signed-off-by: Arnd Bergmann Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5a0996af33879c027725daa58becdf172e0f166d Author: Janani Sankara Babu Date: Tue May 29 19:08:22 2018 -0400 media: Staging:media:imx Fix multiple assignments in a line This patch solves multiple assignments warning shown by checkpatch script. Signed-off-by: Janani Sankara Babu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 854dca5053d3653394aad319e3bd70c245401f12 Author: Dmitry Osipenko Date: Sat May 26 10:33:55 2018 -0400 media: dt: bindings: tegra-vde: Document new optional Memory Client reset property Recently binding of the Memory Controller has been extended, exposing the Memory Client reset controls and hence it is now a reset controller. Tegra video-decoder device is among the Memory Controller reset users, document the new optional VDE HW reset property. Signed-off-by: Dmitry Osipenko Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f8466184bd5b5c21eb6196cd0e44668725a2e47a Author: Daniel Vetter Date: Fri May 25 19:39:25 2018 +0300 drm/omap: gem: Switch to gem_free_object_unlocked() The only thing that omap_gem_free_object does that might need the magic protection of struct_mutex (of keeping all objects alive if that lock is held, even if the last reference is gone) is the mm_list manipulation. This is already protected by the separate omapdrm->list_lock, which means that struct_mutex is not needed by omapdrm. We can switch to gem_free_object_unlocked() Signed-off-by: Daniel Vetter Reviewed-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen commit 5117bd898e8c0a31e8ab3a9b8523aecf0706e997 Author: Daniel Vetter Date: Fri May 25 19:39:24 2018 +0300 drm/omap: gem: Fix mm_list locking - None of the list walkings where protected. - Switch to a mutex since the list walking at device resume time can sleep when pinning buffers through the tiler. Only thing we need to be careful with here is that while we walk the list we can't unreference any gem objects, since the final unref would result in a recursive deadlock. But the only functions that walk the list is the device resume and debugfs dumping, so all safe. Signed-off-by: Daniel Vetter Reviewed-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen commit 3cbd0c587b129beaefb1405bbe43831e6bc9461e Author: Laurent Pinchart Date: Sat May 26 19:54:33 2018 +0300 drm/omap: gem: Replace struct_mutex usage with omap_obj private lock The DRM device struct_mutex is used to protect against concurrent GEM object operations that deal with memory allocation and pinning. All those operations are local to a GEM object and don't need to be serialized across different GEM objects. Replace the struct_mutex with a local omap_obj.lock or drop it altogether where not needed. Signed-off-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen commit dc8c9aeee5098688c1085691213fb9a703bf20ad Author: Laurent Pinchart Date: Fri May 25 19:39:22 2018 +0300 drm/omap: gem: Don't take struct_mutex to get GEM object mmap offset GEM objects mmap offsets are created by calling drm_gem_create_mmap_offset_size() that doesn't need struct_mutex protection as it includes its own locking, based on a size that is static across the object's life time. Remove the unneeded struct_mutex locking. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Vetter Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen commit 2491244d7709d4e35f61d75ed3f6b4ea31b0a6f3 Author: Laurent Pinchart Date: Fri May 25 19:39:21 2018 +0300 drm/omap: gem: Merge __omap_gem_get_pages() and omap_gem_attach_pages() The __omap_gem_get_pages() function is a wrapper around omap_gem_attach_pages() that returns the omap_obj->pages pointer through a function argument. Some callers don't need the pages pointer, and all of them can access omap_obj->pages directly. To simplify the code merge the __omap_gem_get_pages() wrapper with omap_gem_attach_pages() and update the callers accordingly. Signed-off-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen commit 620063e10ed48c63027c4f59dab97d2ead67f9f1 Author: Laurent Pinchart Date: Fri May 25 19:39:20 2018 +0300 drm/omap: gem: Rename GEM function with omap_gem_* prefix get_pages() as a local function name is too generic and easily confused for a generic MM kernel function. Rename it to __omap_gem_get_pages(). Rename the is_contiguous(), is_cache_coherent(), evict(), evict_entry(), fault_1d() and fault_2d() functions for the same reason. Signed-off-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen commit 6505d75cd23291565ca668dd1e66f4e38b5c8f38 Author: Tomi Valkeinen Date: Thu May 24 14:46:19 2018 +0300 drm/omap: fix email address Change tomi.valkeinen@nokia.com to tomi.valkeinen@ti.com. Signed-off-by: Tomi Valkeinen commit c618a3a93b5a118fcf4afe5fe85e83c190f4b127 Author: Venkateswara Rao Mandela Date: Wed Jan 24 16:15:09 2018 +0530 drm/omap: Implement workaround for DRA7 errata ID:i932 Description of DRA7 Errata i932: In rare circumstances DPLL_VIDEO1 and DPLL_VIDEO2 PLL's may not lock on the first attempt during DSS initialization. When this occurs, a subsequent attempt to relock the PLL will result in PLL successfully locking. This patch does the following as per the errata recommendation: - retries locking the PLL upto 20 times. - The time to wait for a PLL lock set to 1000 REFCLK cycles. We use usleep_range to wait for 1000 REFCLK cycles in the us range. This tight constraint is imposed as a lock later than 1000 REFCLK cycles may have high jitter. - Criteria for PLL lock is extended from check on just the PLL_LOCK bit to check on 6 PLL_STATUS bits. Silicon Versions Impacted: DRA71, DRA72, DRA74, DRA76 - All silicon revisions AM57x - All silicon revisions OMAP4/5 are not impacted by this errata Signed-off-by: Venkateswara Rao Mandela [tomi.valkeinen@ti.com: ported to v4.14] Signed-off-by: Tomi Valkeinen commit 6ada1328642b8ffc25917c89569d3e16354b43d2 Author: Souptick Joarder Date: Tue May 22 23:43:57 2018 +0530 gpu: drm: omapdrm: Adding new typedef vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_mixed() returns err which driver mapped into VM_FAULT_* type. Also return value of vm_insert_mixed() not handled correctly and 0 was returned inside fault_2d() as default. The new function vmf_insert_mixed() will replace this inefficiency by returning correct VM_FAULT_* type. vmf_error() is the newly introduce inline function in 4.17-rc6. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Tomi Valkeinen commit 42f073d7656bcfe6915b7023cb01427caa29a9be Author: Colin Ian King Date: Sat May 26 09:45:07 2018 -0400 media: mtk-vpu: fix spelling mistake: "Prosessor" -> "Processor" Trivial fix to spelling mistake in module description text. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 64bac6916ef7d9cc57367893aea1544fcad91b9b Author: Alexey Khoroshilov Date: Fri May 25 17:54:00 2018 -0400 media: tc358743: release device_node in tc358743_probe_of() of_graph_get_next_endpoint() returns device_node with refcnt increased, but these is no of_node_put() for it. The patch adds one on error and normal paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Reviewed-by: Nicholas Mc Guire Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 579b9cca2bff170ac4c4487de6e8ebff7906b3a6 Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:35 2018 +0200 usb: cdc-wdm: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Oliver Neukum Cc: "Bjørn Mork" Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit 24b2068e26c6f24de05c81459553cbc6cf753708 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:39:06 2018 +0200 NFC: nfcmrvl_usb: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Samuel Ortiz Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit 2df6948428542c5a22fbf9c7c36c66ccc9363c7d Author: Sebastian Andrzej Siewior Date: Thu Jun 14 18:36:46 2018 +0200 USB: cdc-wdm: don't enable interrupts in USB-giveback In the code path __usb_hcd_giveback_urb() -> wdm_in_callback() -> service_outstanding_interrupt() The function service_outstanding_interrupt() will unconditionally enable interrupts during unlock and invoke usb_submit_urb() with GFP_KERNEL. If the HCD completes in BH (like ehci does) then the context remains atomic due local_bh_disable() and enabling interrupts does not change this. Defer the error case handling to a workqueue as suggested by Oliver Neukum. In case of an error the worker performs the read out and wakes the user. Fixes: c1da59dad0eb ("cdc-wdm: Clear read pipeline in case of error") Cc: Robert Foss Signed-off-by: Sebastian Andrzej Siewior Acked-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman commit 4327059a14bb6d9578bfb82a6b7c59b3bbf78335 Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:45 2018 +0200 usb: legousbtower: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Juergen Stuber Cc: legousb-devel@lists.sourceforge.net Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit d7cdbdd024d978b9002a20223cc384d11a0a03ea Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:44 2018 +0200 usb: ldusb: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit efd61e94fa3fd44b72afb5c0ab89bf400d9da40b Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:43 2018 +0200 usb: iowarrior: remove intr_idx_lock The intr_idx_lock lock is acquired only in the completion callback of the ->int_in_urb (iowarrior_callback()). There is only one URB that is scheduled / completed so there can't be more than one user of the lock. The comment says that it protects ->intr_idx and the callback is the only place in driver that writes to it. Remove the intr_idx_lock lock because it is superfluous. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit 957ada71b69e6da4d8131b082c5d57558f7fa415 Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:42 2018 +0200 usb: adutux: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit 7375fc9f5f162e783661ee9cdb85a62ec5f6b6d5 Author: John Ogness Date: Mon Jun 25 00:08:41 2018 +0200 usb: wusbcore: remove excessive irqsave wa_urb_dequeue() locks multiple spinlocks while disabling interrupts: spin_lock_irqsave(&lock1, flags); spin_lock_irqsave(&lock2, flags2); Obviously there is no need for the second irqsave and "flags2" variable since interrupts are disabled at that point. Remove the second irqsave: spin_lock_irqsave(&lock1, flags); spin_lock(&lock2); and eliminate the flags2 variable. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit 8982c8440f564549261fb80ca3fe1e3266635936 Author: John Ogness Date: Mon Jun 25 00:08:39 2018 +0200 usb: usb-skeleton: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit 0f5f7ace852ff172d77dfbbc89e6a86349f7f476 Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:38 2018 +0200 usb: usblp: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: Sebastian Andrzej Siewior Acked-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman commit 3f38dace1a206d0ffe9d9a25e97288fbf8c79b55 Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:37 2018 +0200 usb: usbfs: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: Sebastian Andrzej Siewior Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit 31adcb0a9cba3b7e3560c6364aaa8d0060764e12 Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:36 2018 +0200 usb: core: use irqsave() in sg_complete() complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: Sebastian Andrzej Siewior Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit 4685be25a19078de6301f50bde7a755483805269 Author: Sebastian Andrzej Siewior Date: Mon Jun 25 00:08:34 2018 +0200 usb: cdc-acm: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Oliver Neukum Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman commit 4da24f4dd0bb2b88e9c84690aa769b524c63b316 Author: Dan Carpenter Date: Wed Jun 27 11:37:05 2018 +0300 USB: host: ehci-npcm7xx: Fix some error codes in probe We accidentally return 1 instead of negative error codes. Fixes: df44831ee2dd ("USB host: Add USB ehci support for nuvoton npcm7xx platform") Signed-off-by: Dan Carpenter Signed-off-by: Avi Fishman Signed-off-by: Greg Kroah-Hartman commit 4febced15ac8ddb9cf3e603edb111842e4863d9a Author: Jerome Brunet Date: Wed Jun 27 17:36:38 2018 +0200 ASoC: dpcm: don't merge format from invalid codec dai When merging codec formats, dpcm_runtime_base_format() should skip the codecs which are not supporting the current stream direction. At the moment, if a BE link has more than one codec, and only one of these codecs has no capture DAI, it becomes impossible to start a capture stream because the merged format would be 0. Skipping invalid codec DAI solves the problem. Fixes: b073ed4e2126 ("ASoC: soc-pcm: DPCM cares BE format") Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 4f2bd18b191a10660782f2f1ccc989b000b2be63 Author: Jerome Brunet Date: Wed Jun 27 11:48:18 2018 +0200 ASoC: dpcm: extend channel merging to the backend cpu dai Extend dpcm_merge_chan to also check backend cpu dai channels capabilities. Apply the same policy as soc_pcm_init_runtime_hw() for multicodec links and only check cpu dai in this case. Cc: Jiada Wang Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit c54c1c5ee8e73b7cb752834e52e2129b1dab00bd Author: Dan Carpenter Date: Wed Jun 27 11:56:53 2018 +0300 ASoC: qdsp6: qdafe: fix some off by one bugs The > should be >= or we could read one element beyond the end of the port_maps[] array. Fixes: 7fa2d70f9766 ("ASoC: qdsp6: q6afe: Add q6afe driver") Signed-off-by: Dan Carpenter Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit de15d7ff5bef98746fcb76a0db7ac46de48d3560 Author: Jerome Brunet Date: Tue Jun 26 12:07:25 2018 +0200 ASoC: dpcm: improve runtime update predictability As it is, dpcm_runtime_update() performs the old path and new path update of a frontend before going on to the next frontend DAI. Depending the order of the FEs within the rtd list, the result of the update might be different. For example: * Frontend A connected to backend C, with a 48kHz playback * Frontend B connected to backend D, with a 44.1kHz playback * FE A appears before FE B in the rtd list of the card. If we reparent BE C to FE B (disconnecting BE D): * old path update of FE A will run first, and BE C will get hw_free() and shutdown() * new path update of FE B will run after and BE C, which is stopped, so it will be configured at 44.1kHz, as expected If we reparent BE D to FE A (disconnecting BE C): * new path update of FE A will run first but since BE D is still running at 44.1kHz, it won't be reconfigured (no call to startup() or hw_params()) * old path update of FE B runs after, nothing happens * In this case, we end up with a BE playing at 44.1kHz a stream which is supposed to be played at 48Khz (too slow) To improve this situation, this patch performs all the FE old paths update before going on to update the new paths. With this, the result should no longer depend on the order of the FE within the card rtd list. Please note that there might be a small performance penalty since dpcm_process_paths() is called twice per stream direction. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit e4568eac0464ae6d5b361b186b1ee6eb7bf0bdbb Author: Erik Stromdahl Date: Mon Jun 18 17:01:29 2018 +0300 ath10k: replace hardcoded constant with define The hardcoded values used in ath10k_mac_tx_push_pending and ath10k_mac_op_wake_tx_queue set an upper limit of how many packets that can be consumed from the TX queue. HTC_HOST_MAX_MSG_PER_TX_BUNDLE is a proper name for this constant, as the value effectively limits the number of messages that can be consumed in one step. Thus, the value is an upper limit of the number of messages that can be added to a TX message bundle. Signed-off-by: Erik Stromdahl Signed-off-by: Kalle Valo commit ab687de9535c5178c1d9141664205c84493225c8 Author: Erik Stromdahl Date: Mon Jun 18 17:01:23 2018 +0300 ath10k: rename HTC_HOST_MAX_MSG_PER_BUNDLE define This define is only used for RX bundling so it is more descriptive if RX is added to the define-name. Signed-off-by: Erik Stromdahl Signed-off-by: Kalle Valo commit d1a566bec5887988cd7e4b7cf98b05e1ff7a0f8a Author: Erik Stromdahl Date: Mon Jun 18 17:01:21 2018 +0300 ath10k: fix bug in masking of TID value Although the TID mask is 0xf, the modulus operation does still not produce identical results as the bitwise and operator. If the TID is 15, the modulus operation will "convert" it to 0, whereas the bitwise and will keep it as 15. This was found during code review. Signed-off-by: Erik Stromdahl Signed-off-by: Kalle Valo commit 168f75f11fe68455e0d058a818ebccfc329d8685 Author: Ben Greear Date: Mon Jun 18 17:00:56 2018 +0300 ath10k: protect ath10k_htt_rx_ring_free with rx_ring.lock While debugging driver crashes related to a buggy firmware crashing under load, I noticed that ath10k_htt_rx_ring_free could be called without being under lock. I'm not sure if this is the root cause of the crash or not, but it seems prudent to protect it. Originally tested on 4.16+ kernel with ath10k-ct 10.4 firmware running on 9984 NIC. Signed-off-by: Ben Greear Signed-off-by: Kalle Valo commit 3f04950f32d5d592ab4fcaecac2178558a6f7437 Author: Niklas Cassel Date: Mon Jun 18 17:00:49 2018 +0300 ath10k: transmit queued frames after processing rx packets When running iperf on ath10k SDIO, TX can stop working: iperf -c 192.168.1.1 -i 1 -t 20 -w 10K [ 3] 0.0- 1.0 sec 2.00 MBytes 16.8 Mbits/sec [ 3] 1.0- 2.0 sec 3.12 MBytes 26.2 Mbits/sec [ 3] 2.0- 3.0 sec 3.25 MBytes 27.3 Mbits/sec [ 3] 3.0- 4.0 sec 655 KBytes 5.36 Mbits/sec [ 3] 4.0- 5.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 5.0- 6.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 6.0- 7.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 7.0- 8.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 8.0- 9.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 9.0-10.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 0.0-10.3 sec 9.01 MBytes 7.32 Mbits/sec There are frames in the ieee80211_txq and there are frames that have been removed from from this queue, but haven't yet been sent on the wire (num_pending_tx). When num_pending_tx reaches max_num_pending_tx, we will stop the queues by calling ieee80211_stop_queues(). As frames that have previously been sent for transmission (num_pending_tx) are completed, we will decrease num_pending_tx and wake the queues by calling ieee80211_wake_queue(). ieee80211_wake_queue() does not call wake_tx_queue, so we might still have frames in the queue at this point. While the queues were stopped, the socket buffer might have filled up, and in order for user space to write more, we need to free the frames in the queue, since they are accounted to the socket. In order to free them, we first need to transmit them. This problem cannot be reproduced on low-latency devices, e.g. pci, since they call ath10k_mac_tx_push_pending() from ath10k_htt_txrx_compl_task(). ath10k_htt_txrx_compl_task() is not called on high-latency devices. Fix the problem by calling ath10k_mac_tx_push_pending(), after processing rx packets, just like for low-latency devices, also in the SDIO case. Since we are calling ath10k_mac_tx_push_pending() directly, we also need to export it. Signed-off-by: Niklas Cassel Signed-off-by: Kalle Valo commit 98dc04ba60b9c2df1e70c2fe1ea480476a570615 Author: Zhi Chen Date: Mon Jun 18 17:00:43 2018 +0300 ath10k: fix tlv 5ghz channel missing issue The 5ghz channel parameters of TLV target wasn't passed to host, it caused host can only use lower channels from 36 to 64. Signed-off-by: Zhi Chen Signed-off-by: Kalle Valo commit c8291988806407e02a01b4b15b4504eafbcc04e0 Author: Zhi Chen Date: Mon Jun 18 17:00:39 2018 +0300 ath10k: fix scan crash due to incorrect length calculation Length of WMI scan message was not calculated correctly. The allocated buffer was smaller than what we expected. So WMI message corrupted skb_info, which is at the end of skb->data. This fix takes TLV header into account even if the element is zero-length. Crash log: [49.629986] Unhandled kernel unaligned access[#1]: [49.634932] CPU: 0 PID: 1176 Comm: logd Not tainted 4.4.60 #180 [49.641040] task: 83051460 ti: 8329c000 task.ti: 8329c000 [49.646608] $ 0 : 00000000 00000001 80984a80 00000000 [49.652038] $ 4 : 45259e89 8046d484 8046df30 8024ba70 [49.657468] $ 8 : 00000000 804cc4c0 00000001 20306320 [49.662898] $12 : 33322037 000110f2 00000000 31203930 [49.668327] $16 : 82792b40 80984a80 00000001 804207fc [49.673757] $20 : 00000000 0000012c 00000040 80470000 [49.679186] $24 : 00000000 8024af7c [49.684617] $28 : 8329c000 8329db88 00000001 802c58d0 [49.690046] Hi : 00000000 [49.693022] Lo : 453c0000 [49.696013] epc : 800efae4 put_page+0x0/0x58 [49.700615] ra : 802c58d0 skb_release_data+0x148/0x1d4 [49.706184] Status: 1000fc03 KERNEL EXL IE [49.710531] Cause : 00800010 (ExcCode 04) [49.714669] BadVA : 45259e89 [49.717644] PrId : 00019374 (MIPS 24Kc) Signed-off-by: Zhi Chen Signed-off-by: Kalle Valo commit 75ab939394fd0b262ad4b5625a55c2895a73c065 Author: Chen-Yu Tsai Date: Wed Jun 27 10:27:09 2018 +0800 ARM: dts: sun8i: a83t: Add CPU regulator supplies for A83T boards The OPPs for the A83T CPU cores were added in v4.17 in commit 2db639d8c166 ("ARM: dts: sun8i: a83t: add stable OPP tables and CPUfreq"), but board level regulator supplies for the CPU clusters were only added for the TBS-A711 tablet. This means the other A83T boards do not benefit from voltage scaling, or worse, if the implementation does not scale the frequency when the voltage is fixed, no benefit at all. Add board level CPU cluster power supplies to all the A83T development boards, so they can have proper dynamic CPU voltage and frequency scaling. Signed-off-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard commit db49c6825901756e711123d948034661f5b075d9 Author: Jernej Skrabec Date: Mon Jun 25 14:03:04 2018 +0200 ARM: dts: sun8i: r40: Enable HDMI output on BananaPi M2 Ultra Since HDMI can be considered as main output, most capable mixer is connected to it (mixer0). Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 05a43a262d0360e2ff684862d989ac0fd3cc9e69 Author: Jernej Skrabec Date: Mon Jun 25 14:03:03 2018 +0200 ARM: dts: sun8i: r40: Add HDMI pipeline Add all entries needed for HDMI to function properly. Since R40 has highly configurable pipeline, both mixers and both TCON TVs are added. Board specific DT should then connect them together trough TCON TOP muxers to best fit the purpose of the board. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 8818e865aa35493baf7326f9335b8ec6b7d77df7 Author: Icenowy Zheng Date: Fri Jun 22 20:45:36 2018 +0800 bus: add bus driver for accessing Allwinner A64 DE2 The "Display Engine 2.0" (usually called DE2) on the Allwinner A64 SoC is different from the ones on other Allwinner SoCs. It requires a SRAM region to be claimed, otherwise all DE2 subblocks won't be accessible. Add a bus driver for the Allwinner A64 DE2 part which claims the SRAM region when probing. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit a6e3ab0bcc34647365c4dee74fc8707de607c250 Author: Icenowy Zheng Date: Fri Jun 22 20:45:35 2018 +0800 dt-bindings: add binding for the Allwinner A64 DE2 bus All the sub-blocks of Allwinner A64 DE2 needs the SRAM C on A64 SoC to be claimed, otherwise the whole DE2 space is inaccessible. Add a device tree binding of the DE2 part as a sub-bus. Reviewed-by: Rob Herring Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit 1adca4b0cd65c14cb8b8c9c257720385869c3d5f Author: Kai-Heng Feng Date: Thu Jun 28 15:28:24 2018 +0800 ALSA: hda: Add AZX_DCAPS_PM_RUNTIME for AMD Raven Ridge This patch can make audio controller in AMD Raven Ridge gets runtime suspended to D3, to save ~1W power when it's not in use. Cc: Vijendar Mukunda Signed-off-by: Kai-Heng Feng Signed-off-by: Takashi Iwai commit 7861552cedd81a164c0d5d1c89fe2cb45a3ed41b Author: David Ahern Date: Tue Jun 26 12:39:18 2018 -0700 netlink: Return extack message if attribute validation fails Have one extack message for parsing and validating. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 8d0752d11312be830c33e84dfd1016e6a47c2938 Author: Brandon Maier Date: Tue Jun 26 12:50:50 2018 -0500 net: phy: xgmiitorgmii: Check read_status results We're ignoring the result of the attached phy device's read_status(). Return it so we can detect errors. Signed-off-by: Brandon Maier Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit cf31ea71c0593ca6227bd3f4958c098753267f44 Author: Brandon Maier Date: Tue Jun 26 12:50:49 2018 -0500 net: phy: xgmiitorgmii: Use correct mdio bus The xgmiitorgmii is using the mii_bus of the device it's attached to, instead of the bus it was given during probe. Signed-off-by: Brandon Maier Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit ab4e6ee578e88a659938db8fbf33720bc048d29c Author: Brandon Maier Date: Tue Jun 26 12:50:48 2018 -0500 net: phy: xgmiitorgmii: Check phy_driver ready before accessing Since a phy_device is added to the global mdio_bus list during phy_device_register(), but a phy_device's phy_driver doesn't get attached until phy_probe(). It's possible of_phy_find_device() in xgmiitorgmii will return a valid phy with a NULL phy_driver. Leading to a NULL pointer access during the memcpy(). Fixes this Oops: Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0004000 [00000000] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.14.40 #1 Hardware name: Xilinx Zynq Platform task: ce4c8d00 task.stack: ce4ca000 PC is at memcpy+0x48/0x330 LR is at xgmiitorgmii_probe+0x90/0xe8 pc : [] lr : [] psr: 20000013 sp : ce4cbb54 ip : 00000000 fp : ce4cbb8c r10: 00000000 r9 : 00000000 r8 : c0c49178 r7 : 00000000 r6 : cdc14718 r5 : ce762800 r4 : cdc14710 r3 : 00000000 r2 : 00000054 r1 : 00000000 r0 : cdc14718 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 18c5387d Table: 0000404a DAC: 00000051 Process swapper/0 (pid: 1, stack limit = 0xce4ca210) ... [] (memcpy) from [] (xgmiitorgmii_probe+0x90/0xe8) [] (xgmiitorgmii_probe) from [] (mdio_probe+0x28/0x34) [] (mdio_probe) from [] (driver_probe_device+0x254/0x414) [] (driver_probe_device) from [] (__device_attach_driver+0xac/0x10c) [] (__device_attach_driver) from [] (bus_for_each_drv+0x84/0xc8) [] (bus_for_each_drv) from [] (__device_attach+0xd0/0x134) [] (__device_attach) from [] (device_initial_probe+0x1c/0x20) [] (device_initial_probe) from [] (bus_probe_device+0x98/0xa0) [] (bus_probe_device) from [] (device_add+0x43c/0x5d0) [] (device_add) from [] (mdio_device_register+0x34/0x80) [] (mdio_device_register) from [] (of_mdiobus_register+0x170/0x30c) [] (of_mdiobus_register) from [] (macb_probe+0x710/0xc00) [] (macb_probe) from [] (platform_drv_probe+0x44/0x80) [] (platform_drv_probe) from [] (driver_probe_device+0x254/0x414) [] (driver_probe_device) from [] (__driver_attach+0x10c/0x118) [] (__driver_attach) from [] (bus_for_each_dev+0x8c/0xd0) [] (bus_for_each_dev) from [] (driver_attach+0x2c/0x30) [] (driver_attach) from [] (bus_add_driver+0x50/0x260) [] (bus_add_driver) from [] (driver_register+0x88/0x108) [] (driver_register) from [] (__platform_driver_register+0x50/0x58) [] (__platform_driver_register) from [] (macb_driver_init+0x24/0x28) [] (macb_driver_init) from [] (do_one_initcall+0x60/0x1a4) [] (do_one_initcall) from [] (kernel_init_freeable+0x15c/0x1f8) [] (kernel_init_freeable) from [] (kernel_init+0x18/0x124) [] (kernel_init) from [] (ret_from_fork+0x14/0x20) Code: ba000002 f5d1f03c f5d1f05c f5d1f07c (e8b151f8) ---[ end trace 3e4ec21905820a1f ]--- Signed-off-by: Brandon Maier Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 26eef11a2e59587c3ed9f4c3b791d78e4f70fc00 Merge: a408194aa050 2766a11161cc Author: David S. Miller Date: Thu Jun 28 16:10:08 2018 +0900 Merge branch 'ipsec-selftests-updates' Shannon Nelson says: ==================== Updates for ipsec selftests Fix up the existing ipsec selftest and add tests for the ipsec offload driver API. v2: addressed formatting nits in netdevsim from Jakub Kicinski v3: a couple more nits from Jakub ==================== Signed-off-by: David S. Miller commit 2766a11161cc6995421bc5730eb4819231f40cfb Author: Shannon Nelson Date: Tue Jun 26 10:07:55 2018 -0700 selftests: rtnetlink: add ipsec offload API test Using the netdevsim as a device for testing, try out the XFRM commands for setting up IPsec hardware offloads. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 7699353da875c2ae0d87a4f5a995c144115b31bb Author: Shannon Nelson Date: Tue Jun 26 10:07:54 2018 -0700 netdevsim: add ipsec offload testing Implement the IPsec/XFRM offload API for testing. Signed-off-by: Shannon Nelson Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit c3eba0a4ebf0dedabf30804d4cfc31cdd87b5398 Author: Shannon Nelson Date: Tue Jun 26 10:07:53 2018 -0700 selftests: rtnetlink: use dummydev as a test device We really shouldn't mess with local system settings, so let's use the already created dummy device instead for ipsec testing. Oh, and let's put the temp file into a proper directory. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit fd0e418d6b1d6dfa193f2196534aef1c95c205fc Author: Shannon Nelson Date: Tue Jun 26 10:07:52 2018 -0700 selftests: rtnetlink: clear the return code at start of ipsec test Following the custom from the other functions, clear the global ret code before starting the test so as to not have previously failed tests cause us to thing this test has failed. Reported-by: Anders Roxell Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit a408194aa050f9a820f5a64301c7a08880f8af7d Author: Guillaume Nault Date: Tue Jun 26 18:41:36 2018 +0200 l2tp: define helper for parsing struct sockaddr_pppol2tp* 'sockaddr_len' is checked against various values when entering pppol2tp_connect(), to verify its validity. It is used again later, to find out which sockaddr structure was passed from user space. This patch combines these two operations into one new function in order to simplify pppol2tp_connect(). A new structure, l2tp_connect_info, is used to pass sockaddr data back to pppol2tp_connect(), to avoid passing too many parameters to l2tp_sockaddr_get_info(). Also, the first parameter is void* in order to avoid casting between all sockaddr_* structures manually. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 242b1bbe5144de3577ad12da058e70ef88167146 Author: Eric Dumazet Date: Tue Jun 26 08:45:49 2018 -0700 tcp: remove one indentation level in tcp_create_openreq_child Signed-off-by: Eric Dumazet Acked-by: Yuchung Cheng Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit 782e85c5f7aee0294cefb52a190b05e082c178d5 Author: Sergei Shtylyov Date: Tue Jun 26 18:42:33 2018 +0300 sh_eth: fix *enum* {A|M}PR_BIT The *enum* {A|M}PR_BIT were declared in the commit 86a74ff21a7a ("net: sh_eth: add support for Renesas SuperH Ethernet") adding SH771x support, however the SH771x manual doesn't have the APR/MPR registers described and the code writing to them for SH7710 was later removed by the commit 380af9e390ec ("net: sh_eth: CPU dependency code collect to "struct sh_eth_cpu_data""). All the newer SoC manuals have these registers documented as having a 16-bit TIME parameter of the PAUSE frame, not 1-bit -- update the *enum* accordingly, fixing up the APR/MPR writes... Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit cb04ba33187ca571142b67c2fb60d0a8c24994c8 Author: Rakesh Ughreja Date: Fri Jun 1 22:53:58 2018 -0500 ALSA: hdac: add extended ops in the hdac_bus Add extended ops in the hdac_bus to allow calling the ASoC HDAC library ops to reuse the legacy HDA codec drivers with ASoC framework. Extended ops are used by the legacy codec drivers to call into hdac_hda library, in the subsequent patches.. Signed-off-by: Rakesh Ughreja Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit 6298542fa33b6ba0e3effbace5b99b70b93ed9ae Author: Rakesh Ughreja Date: Fri Jun 1 22:53:57 2018 -0500 ALSA: hdac: remove memory allocation from snd_hdac_ext_bus_device_init Remove memory allocation within snd_hdac_ext_bus_device_init, to make its behaviour identical to snd_hdac_bus_device_init. So that caller can allocate the parent data structure containing hdac_device. This API change helps in reusing the legacy HDA codec drivers with ASoC platform drivers. Signed-off-by: Rakesh Ughreja Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit 24494d3f939774c3c21d78b5e95d37f9e74d154c Author: Rakesh Ughreja Date: Fri Jun 1 22:53:56 2018 -0500 ALSA: hda: split snd_hda_codec_new function Split snd_hda_codec_new into two separate functions. snd_hda_codec_device_init allocates memory and registers with bus. snd_hda_codec_device_new initialializes the fields and performs snd_device_new. This enables reuse of legacy HDA codec drivers as ASoC codec drivers. In addition mark some functions with EXPORT_SYMBOL_GPL so that it can be called by ASoC wrapper around the legacy HDA driver (hdac_hda). Signed-off-by: Rakesh Ughreja Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit f8a7fe1aea215e25eaf3bf04dff66fc7621ec9d7 Author: Rakesh Ughreja Date: Fri Jun 1 22:54:00 2018 -0500 ALSA: hdac: ext: add wait for codec to respond after link reset As per HDA spec section 4.3 - Codec Discovery, the software shall wait for atleast 521usec for codec to respond after link reset. With the multi-link capability each link is turned ON/OFF individually. Link controller drives reset signal when it is turned ON. Signed-off-by: Rakesh Ughreja Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit e1df9317cbb192582ed7aa88c5f294c2336a3c75 Author: Rakesh Ughreja Date: Fri Jun 1 22:53:51 2018 -0500 ALSA: hdac: Remove usage of struct hdac_ext_driver, use hdac_driver instead This patch removes the hdac_ext_driver structure. The legacy and enhanced HDaudio capabilities can be handled in a backward-compatible way without separate definitions. Signed-off-by: Rakesh Ughreja Signed-off-by: Takashi Iwai commit 76f56fae1cf9040325a58d1375291baf71dfaf03 Author: Rakesh Ughreja Date: Fri Jun 1 22:53:50 2018 -0500 ALSA: hdac: Remove usage of struct hdac_ext_bus and use hdac_bus instead This patch removes the hdac_ext_bus structure. The legacy and enhanced HDaudio capabilities can be handled in a backward-compatible way without separate definitions. Follow-up patches in this series handle the driver definition. Signed-off-by: Rakesh Ughreja Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit 3787a39852b0d6a9e67336f8fb5815c13ab78bb6 Author: Rakesh Ughreja Date: Fri Jun 1 22:53:49 2018 -0500 ALSA: hdac: Remove usage of struct hdac_ext_device and use hdac_device instead This patch removes the hdac_ext_device structure. The legacy and enhanced HDaudio capabilities can be handled in a backward-compatible way without separate definitions. Follow-up patches in this series handle the bus and driver definitions. Signed-off-by: Rakesh Ughreja Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit 5092ad4dd52dddc9957ebb8adde99f7a22c29f6a Author: Keara Leibovitz Date: Tue Jun 26 10:16:28 2018 -0400 tc-tests: add an extreme-case csum action test Added an extreme-case test for all 7 csum action headers. Signed-off-by: Keara Leibovitz Signed-off-by: David S. Miller commit 30d6f790b29fddd8427c4e99668a1a665164a383 Merge: 964fc35c0910 7142529f1688 Author: David S. Miller Date: Thu Jun 28 14:18:49 2018 +0900 Merge branch 'mscc-ocelot-add-more-features' Alexandre Belloni says: ==================== net: mscc: ocelot: add more features This series adds link aggregation and VLAN filtering hardware offload support to the ocelot driver. PTP support will be sent later. changes in v2: - rebased on v4.18-rc1 - check for aggregation type and only offload it when type is hash (balance-xor or 802.3ad) ==================== Signed-off-by: David S. Miller commit 7142529f168846065eaf4e8126e3de7c8ffc292d Author: Antoine Tenart Date: Tue Jun 26 14:28:49 2018 +0200 net: mscc: ocelot: add VLAN filtering Add hardware VLAN filtering offloading on ocelot. Signed-off-by: Antoine Tenart Signed-off-by: Alexandre Belloni Signed-off-by: David S. Miller commit dc96ee3730fc41d2d1efb4213c3a4656ed272e9e Author: Alexandre Belloni Date: Tue Jun 26 14:28:48 2018 +0200 net: mscc: ocelot: add bonding support Add link aggregation hardware offload support for Ocelot. ocelot_get_link_ksettings() is not great but it does work until the driver is reworked to switch to phylink. Signed-off-by: Alexandre Belloni Signed-off-by: David S. Miller commit 964fc35c0910c7970120f893fa866e6b3468dcf0 Author: Ganesh Goudar Date: Tue Jun 26 14:51:13 2018 +0530 cxgb4: Add new T5 PCI device id 0x50ae Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit a081e11536a716da3fd2b09061e75c09e691b2f8 Author: Casey Leedom Date: Tue Jun 26 14:48:48 2018 +0530 cxgb4: Add flag tc_flower_initialized Add flag tc_flower_initialized to indicate the completion if tc flower initialization. Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller commit 9203dbec90a68103644ad9bf3ccf16461d67fcac Author: Kuninori Morimoto Date: Fri Jun 15 00:53:33 2018 +0000 dmaengine: rcar-dmac: don't use DMAC error interrupt rcar-dmac has 2 types of interrupt, 1) error IRQ (for all), 2) IRQ for each channels. If error happens on some channels, the error IRQ will be handled by 1), and "all" channels will be restarted. But in this design, error handling itself will be problem for non error channel users. This patch removes 1) handler, and handles error IRQ on 2) Signed-off-by: Magnus Damm [Kuninori: updated patch to adjust DMACHCR/DMAOR] Signed-off-by: Kuninori Morimoto Tested-by: Nguyen Viet Dung Reviewed-by: Geert Uytterhoeven Signed-off-by: Vinod Koul commit eab976693153b9854bfa83d131374748f6ca4280 Merge: b4d4b0b7defb 57e23de02f48 Author: Dave Airlie Date: Thu Jun 28 13:28:31 2018 +1000 Merge tag 'drm-misc-next-2018-06-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 4.19: Cross-subsystem Changes: devicetree documentation dt-bindings defintions for sun8i (Jernej Skrabec) Core Changes: Consider drivers setting DRIVER_ATOMIC as atomic (Eric Anholt) Improvements for in-kernel clients (Noralf Trønnes) Export and rename drm_crtc_port_mask() (Jernej Skrabec) Driver Changes: v3d: Add looking for GPU scheduler jobs management (Eric Anholt) Add Ilitek ILI9881c panel driver(Maxime Ripard) rockchip: vop: fixup linebuffer mode calc error (Sandy Huang) tinydrm: new driver for ILI9341 display panels (David Lechner) sun4i: Add TCON TOP driver (Jernej Skrabec) Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180628010018.GA10929@juma commit eecd78bc7805964527acdaba5f2b91d7b317aeea Author: Anson Huang Date: Wed Jun 20 16:38:37 2018 +0800 ARM: dts: imx6sll: declare src module to be compatible to imx51's src i.MX6SLL uses same SRC module as i.MX51, add "fsl,imx51-src" compatible string to enable SRC driver to support setting CPU resume address for cpu-idle and suspend/resume. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit b4d4b0b7defbc226cc2237e08ced62c1c806e301 Merge: 3c8daa7db46d e1cacec9d50d Author: Dave Airlie Date: Thu Jun 28 13:10:37 2018 +1000 Merge tag 'drm-intel-next-2018-06-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Chris is doing many reworks that allow us to get full-ppgtt supported on all platforms back to HSW. As well many other fix and improvements, Including: - Use GEM suspend when aborting initialization (Chris) - Change i915_gem_fault to return vm_fault_t (Chris) - Expand VMA to Non gem object entities (Chris) - Improve logs for load failure, but quite logging on fault injection to avoid noise on CI (Chris) - Other page directory handling fixes and improvements for gen6 (Chris) - Other gtt clean-up removing redundancies and unused checks (Chris) - Reorder aliasing ppgtt fini (Chris) - Refactor of unsetting obg->mm.pages (Chris) - Apply batch location restrictions before pinning (Chris) - Ringbuffer fixes for context restore (Chris) - Execlist fixes on freeing error pointer on allocation error (Chris) - Make closing request flush mandatory (Chris) - Move GEM sanitize from resume_early to resume (Chris) - Improve debug dumps (Chris) - Silent compiler for selftest (Chris) - Other execlists changes to improve hangcheck and reset. - Many gtt page directory fixes and improvements (Chris) - Reorg context workarounds (Chris) - Avoid ERR_PTR dereference on selftest (Chris) Other GEM related work: - Stop trying to reset GPU if reset failed (Mika) - Add HW workaround for KBL to fix GPU reset (Mika) - Fix context ban and hang accounting for client (Mika) - Fixes on OA perf (Michel, Jani) - Refactor on GuC log mechanisms (Piotr) - Enable provoking vertex fix on Gen9 system (Kenneth) More ICL patches for Display enabling: - ICL - 10-bit support for HDMI (RK) - ICL - Start adding TBT PLL (Paulo) - ICL - DDI HDMK level selection (Manasi) - ICL - GMBUS GPIO pin mapping fix (Mahesh) - ICL - Adding DP_AUX_E support (James) - ICL - Display interrupts handling (DK) Other display fixes and improvements: - Fix sprite destination color keying on SKL+ (Ville) - Fixes and improvements on PCH detection, specially for non PCH systems (Jani) - Document PCH_NOP (Lucas) - Allow DBLSCAN user modes with eDP/LVDS/DSI (Ville) - Opregion and ACPI cleanup and organization (Jani) - Kill delays when activation psr (Rodrigo) - ...and a consequent fix of the psr activation flow (DK) - Fix HDMI infoframe setting (Imre) - Fix Display interrupts and modes on old gens (Ville) - Start switching to kernel unsigned int types (Jani) - Introduction to Amber Lake and Whiskey Lake platforms (Jose) - Audio clock fixes for HBR3 (RK) - Standardize i915_reg.h definitions according to our doc and checkpatch (Paulo) - Remove unused timespec_to_jiffies_timeout function (Arnd) - Increase the scope of PSR wake fix for other VBTs out there (Vathsala) - Improve debug msgs with prop name/id (Ville) - Other clean up on unecessary cursor size defines (Ville) - Enforce max hdisplay/hblank_start limits on HSW/BDW (Ville) - Make ELD pointers constant (Jani) - Fix for PSR VBT parse (Colin) - Add warn about unsupported CDCLK rates (Imre) Signed-off-by: Dave Airlie # gpg: Signature made Thu 21 Jun 2018 07:12:10 AM AEST # gpg: using RSA key FA625F640EEB13CA # gpg: Good signature from "Rodrigo Vivi " # gpg: aka "Rodrigo Vivi " # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6D20 7068 EEDD 6509 1C2C E2A3 FA62 5F64 0EEB 13CA Link: https://patchwork.freedesktop.org/patch/msgid/20180625165622.GA21761@intel.com commit fdfbd7d125fd8e2536954fdd63a5738bceb7896f Author: Emmanuel Vadot Date: Mon Jun 18 17:42:57 2018 +0200 ARM: dts: imx6: RIoTboard Add chosen stdout-path property The RIoTboard debug uart is connected to serial1. Add a chosen property in the DTS so OS knows what serial port to use for the console. Signed-off-by: Emmanuel Vadot Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit f3d80deb080f422ff1df4a715444f156bb51adc1 Author: Anson Huang Date: Fri Jun 8 11:06:40 2018 +0200 ARM: dts: imx: add cooling-cells for cpufreq cooling device Add #cooling-cells for i.MX6/7 SoCs for cpufreq cooling device usage. Signed-off-by: Anson Huang Signed-off-by: Bastian Stender Signed-off-by: Shawn Guo commit 328bd82526156fbc42372d22ff1967dc145d81c8 Author: Philipp Zabel Date: Wed Dec 13 15:24:06 2017 +0100 ARM: dts: imx51: add CodaHx4 VPU Add the CodaHx4 VPU to the i.MX51 device tree. Signed-off-by: Philipp Zabel Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit feb20faec73ba0b30f949d54c4153cf0ad3807c8 Author: Takashi Iwai Date: Wed Jun 27 09:03:51 2018 +0200 ALSA: hda - Move in_pm accessors to HDA core The in_pm atomic in hdac_device is an important field used as a flag as well as a refcount for PM. The existing snd_hdac_power_up/down helpers already refer to it in the HD-audio core code, while the code to actually setting the value (atomic_inc() / _dec()) is open-coded in HDA legacy side, which is hard to find. This patch adds the helper functions to set/reset the in_pm counter to HDA core and use them in HDA legacy side, for making it clearer who / where the PM is managed. There is no functional changes, just code refactoring. Reviewed-by: Chris Wilson Signed-off-by: Takashi Iwai commit 3160422251b214c7a7a8ef91bb76da012bb44b57 Author: Anusha Srivatsa Date: Tue Jun 26 13:52:23 2018 -0700 drm/i915/icp: Add Interrupt Support This patch addresses Interrupts from south display engine (SDE). ICP has two registers - SHOTPLUG_CTL_DDI and SHOTPLUG_CTL_TC. Introduce these registers and their intended values. Introduce icp_irq_handler(). The icp_irq_postinstall() takes care of enabling all PCH interrupt sources, to unmask them as needed with SDEIMR, as is done done by ibx_irq_pre_postinstall() for earlier platforms. We do not need to explicitly call the ibx_irq_pre_postinstall(). Also, while changing these, s/CPT/PPT/CPT-CNP comment. v2: - remove redundant register defines.(Lucas) - Change register names to be more consistent with previous platforms (Lucas) v3: -Reorder bit defines to a more appropriate location. Change the comments. Confirm in the commit message that icp_irq_postinstall() need not go to ibx_irq_pre_postinstall() and ibx_irq_postinstall() as in earlier platforms. (Paulo) Cc: Lucas De Marchi Cc: Paulo Zanoni Cc: Dhinakaran Pandiyan Cc: Ville Syrjala Reviewed-by: Lucas De Marchi Reviewed-by: Paulo Zanoni Signed-off-by: Anusha Srivatsa [Paulo: coding style bikesheds and rebases]. Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/1530046343-30649-1-git-send-email-anusha.srivatsa@intel.com commit 4e1077f720f5fb54a295c8c2b5f73c09aac75fd9 Author: Yuval Shaia Date: Wed Jun 27 19:26:11 2018 +0300 RDMA/vmw_pvrdma: Delete unused function This function is not in use - delete it. Signed-off-by: Yuval Shaia Acked-by: Adit Ranadive Signed-off-by: Jason Gunthorpe commit 7a5c938b9ed0985ea09b821b4b7f12b5e3d88d5d Author: Jason Gunthorpe Date: Mon Jun 25 16:03:41 2018 -0600 IB/core: Check for rdma_protocol_ib only after validating port_num port_num is untrusted data from the user, so it should be checked after calling fill_sgid_attr, which validates it. Fixes: 8d9ec9addd6c ("IB/core: Add a sgid_attr pointer to struct rdma_ah_attr") Signed-off-by: Jason Gunthorpe commit 57e23de02f4878061818fd118129a6b0e1516b11 Author: Jernej Skrabec Date: Mon Jun 25 14:03:02 2018 +0200 drm/sun4i: DW HDMI: Expand algorithm for possible crtcs drm_of_find_possible_crtcs() doesn't work when DW HDMI encoder is connected to TCON (crtc) through mux in TCON TOP. In that case TCON TOP HDMI mux input port has to be manually traversed and checked if it matches any known crtc. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-23-jernej.skrabec@siol.net commit 8b5f7a62464a24cb83d6290c01d6cf9c8871774a Author: Jernej Skrabec Date: Mon Jun 25 14:03:01 2018 +0200 drm: of: Export and rename drm_crtc_port_mask() Function is useful when drm_of_find_possible_crtcs() can't be used and custom parsing is needed. This can happen for example when there is a node with multiple muxes between crtc and encoder. Reviewed-by: Sean Paul Signed-off-by: Jernej Skrabec [maxime: change the function to have a consistent prefix] Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-22-jernej.skrabec@siol.net commit b46e2c9f5f64a3bbd925856cab5336680ca2e9be Author: Jernej Skrabec Date: Mon Jun 25 14:03:00 2018 +0200 drm/sun4i: Add support for A64 HDMI PHY PHY is the same as in H3, except it can switch between two clock parents. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-21-jernej.skrabec@siol.net commit c891a65a7fc940ed387ad822732f711cae554b24 Author: Jernej Skrabec Date: Mon Jun 25 14:02:59 2018 +0200 drm/sun4i: Add support for second clock parent to DW HDMI PHY clk driver Expand HDMI PHY clock driver to support second clock parent. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-20-jernej.skrabec@siol.net commit aef13fd8426279fcd9e0b2b5b446d35c0d49ec5d Author: Jernej Skrabec Date: Mon Jun 25 14:02:58 2018 +0200 drm/sun4i: DW HDMI PHY: Add support for second PLL Some DW HDMI PHYs, like those found in A64 and R40 SoCs, can select between two clock parents. Add code which reads second PLL from DT. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-19-jernej.skrabec@siol.net commit 09f380e3ba4103a32faf4fad35d90dc144578214 Author: Jernej Skrabec Date: Mon Jun 25 14:02:57 2018 +0200 drm/sun4i: Don't change clock bits in DW HDMI PHY driver DW HDMI PHY driver and PHY clock driver share same registers. Make sure that DW HDMI PHY setup code doesn't change any clock related bits. During initialization, set PHY PLL parent bit to 0. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-18-jernej.skrabec@siol.net commit 09773c532d30187f86a142901c27c93e629ce6ba Author: Jernej Skrabec Date: Mon Jun 25 14:02:56 2018 +0200 drm/sun4i: Enable DW HDMI PHY clock Current DW HDMI PHY code never prepares and enables PHY clock after it is created. It's just used as it is. This may work in some cases, but it's clearly wrong. Fix it by adding proper calls to enable/disable PHY clock. Fixes: 4f86e81748fe ("drm/sun4i: Add support for H3 HDMI PHY variant") Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-17-jernej.skrabec@siol.net commit 03c35dbf73e0726136bad921cb2649728ce909d5 Author: Jernej Skrabec Date: Mon Jun 25 14:02:55 2018 +0200 dt-bindings: display: sun4i-drm: Add description of A64 HDMI PHY A64 HDMI PHY is similar to H3 HDMI PHY except it has two possible PLL clock parents. It is compatible to other HDMI PHYs, like that found in R40. Acked-by: Rob Herring Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-16-jernej.skrabec@siol.net commit 0740845909b1e0089ff60ee62b55622759875e4f Author: Jernej Skrabec Date: Mon Jun 25 14:02:54 2018 +0200 drm/sun4i: Add support for R40 mixers Both mixers have similar capabilities as others SoCs with DE2. First mixer has 1 VI and 3 UI planes and supports HW scaling on all planes. Second mixer has 1 VI and 1 UI planes and also supports HW scaling on all planes. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-15-jernej.skrabec@siol.net commit 63d6310f6cc63735f08b86b3c8390b9f066a2221 Author: Jernej Skrabec Date: Mon Jun 25 14:02:52 2018 +0200 drm/sun4i: Don't check for panel or bridge on TV TCONs TV TCONs are always connected to TV or HDMI encoder, so it doesn't make sense to check if panel or bridge is connected to them. Check if TCON has channel 0 and only then check for connected panel or bridges. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-13-jernej.skrabec@siol.net commit 2a72d0c5796b7ec90ebf51e714b3d305d4367341 Author: Jernej Skrabec Date: Mon Jun 25 14:02:51 2018 +0200 drm/sun4i: Don't check for LVDS and RGB when TCON has only ch1 LVDS and RGB interfaces are always connected to TCONs which have channel 0. It doesn't make sense to try to init them on TV TCONs. Add a check if TCON has channel 0 before trying to init LVDS or RGB interface. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-12-jernej.skrabec@siol.net commit 49836b11fe71b93bd0124cbaecac0814aadec9eb Author: Jernej Skrabec Date: Mon Jun 25 14:02:50 2018 +0200 drm/sun4i: tcon: Generalize engine search algorithm Current "old" method to find engine worked pretty well for DE2. However, it doesn't work when TCON TOP is between mixer (engine) and TCON. TCON TOP has multiple input ports, but current engine search algorithm expects only one. This can be fixed by first looking for output port id and selecting matching input by subtracting 1 for the next round. This work even if there is only one input and output. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-11-jernej.skrabec@siol.net commit c5cf04df56e62f5a3ef09452181ee1dc51106080 Author: Jernej Skrabec Date: Mon Jun 25 14:02:49 2018 +0200 drm/sun4i: Don't skip TCONs if they don't have channel 0 TV TCONs (channel 1 only) are always connected to TV or HDMI encoder. Because of that, all output endpoints on such TCON node will point to a encoder which is part of component framework. Correct current graph traversing algorithm in such way that it doesn't skip output enpoints with id 0 on TV TCONs. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-10-jernej.skrabec@siol.net commit ef0cf6441fbb1ac4390e4fa4223d421a924fd458 Author: Jernej Skrabec Date: Mon Jun 25 14:02:48 2018 +0200 drm/sun4i: Add support for traversing graph with TCON TOP TCON TOP is different from other nodes in graph by having 3 input and 3 output ports. Additionally, connection to TV TCON might lead back to HDMI mux input port, creating loops. Add support for traversing such graph. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-9-jernej.skrabec@siol.net commit 71f4796ac09d6b634f4756388cfdbe9d778499e9 Author: Jernej Skrabec Date: Mon Jun 25 14:02:47 2018 +0200 drm/sun4i: Split out code for enumerating endpoints in output port Until now, each node has one input port and one output port. However, with TCON TOP this is no longer true. It has 3 input and 3 output ports. In order to prepare to this situation, split out the code which checks all endpoints in input port and adds available components to fifo. This patch doesn't do any functional change. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-8-jernej.skrabec@siol.net commit 367c359aa8637b15ee8df6335c5a29b7623966ec Author: Jernej Skrabec Date: Mon Jun 25 14:02:46 2018 +0200 drm/sun4i: Fix releasing node when enumerating enpoints sun4i_drv_add_endpoints() has a memory leak since it uses of_node_put() when remote is equal to NULL and does nothing when remote has a valid pointer. Invert the logic to fix memory leak. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-7-jernej.skrabec@siol.net commit 19f3ebed3f3612f97ee28af26d53656f5776f89a Author: Jernej Skrabec Date: Mon Jun 25 14:02:45 2018 +0200 drm/sun4i: Add TCON TOP driver As already described in DT binding, TCON TOP is responsible for configuring display pipeline. In this initial driver focus is on HDMI pipeline, so TVE and LCD configuration is not implemented. Implemented features: - HDMI source selection - clock driver (TCON and DSI gating) - connecting mixers and TCONS Something similar also existed in previous SoCs, except that it was part of first TCON. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-6-jernej.skrabec@siol.net commit 59a9c39544cd1e5952c2a33028d71aa8180648f8 Author: Jernej Skrabec Date: Mon Jun 25 14:02:44 2018 +0200 dt-bindings: display: sunxi-drm: Add TCON TOP description TCON TOP main purpose is to configure whole display pipeline. It determines relationships between mixers and TCONs, selects source TCON for HDMI, muxes LCD and TV encoder GPIO output, selects TV encoder clock source and contains additional TV TCON and DSI gates. Reviewed-by: Rob Herring Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-5-jernej.skrabec@siol.net commit 5cbef9f97d0d60f411a2b2cbcc37a0423615ff55 Author: Icenowy Zheng Date: Fri Jun 22 21:05:24 2018 +0800 arm64: dts: allwinner: a64: add HDMI regulator to all DTs' simplefb_hdmi On usual A64 board design the power of HDMI controller is connected to DLDO1 of the AXP803 PMIC. If this regulator is shut down, the HDMI output will be blank. Therefore the simplefb driver should keep this regulator on. Add the regulator to all currently available A64 boards' simplefb_hdmi device node, if the board is capable of outputing HDMI. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit fca63f58972508e07d0acbd82946e5ffceab67ed Author: Icenowy Zheng Date: Fri Jun 22 20:45:39 2018 +0800 arm64: dts: allwinner: a64: add device tree node for HDMI simplefb As the U-Boot bootloader now is also capable of initialize the HDMI on A64 boards, add a simplefb device tree node for accessing the HDMI framebuffer initialized by the bootloader. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit 2c796fc8f5dbd1424b007046a33294bb7b697781 Author: Icenowy Zheng Date: Fri Jun 22 20:45:38 2018 +0800 arm64: dts: allwinner: a64: add necessary device tree nodes for DE2 CCU As we have all necessary parts to enable the DE2 CCU on the Allwinner A64 SoC, add the needed device tree nodes, including the DE2 CCU itself and the DE2 bus. The "mixer0-lcd0" simplefb device node is updated to use the DE2 CCU. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit 0195156340d365540c7dfa239232065826904f59 Author: Icenowy Zheng Date: Fri Jun 22 20:45:37 2018 +0800 clk: sunxi-ng: add A64 compatible string As claiming Allwinner A64 SRAM C is a prerequisite for all sub-blocks of the A64 DE2, not only the CCU sub-block, a bus driver is then written for enabling the access to the whole DE2 part by claiming the SRAM. In this situation, the A64 compatible string will be just added with no other requirments, as they're processed by the parent bus driver. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit f7486bc38c21b24ca418f0c740dd44db9849078d Author: Icenowy Zheng Date: Fri Jun 22 20:26:09 2018 +0800 dt-bindings: add compatible string for the A64 DE2 CCU The Allwinner A64 SoC has a DE2 CCU like the one in the DE2 of Allwinner H5 SoC. Add a compatible string for it. Signed-off-by: Icenowy Zheng Reviewed-by: Rob Herring Acked-by: Stephen Boyd Signed-off-by: Maxime Ripard commit 3fa0e8f6f9609ba195b8b3e4cf3e61420451fc7b Author: David Lechner Date: Fri May 25 14:36:23 2018 -0500 drm/tinydrm: new driver for ILI9341 display panels This adds a new driver for display panels that use the Ilitek ILI9341 controller. It currently supports a single display panel, namely the YX240QV29-T (e.g. Adafruit 2.4" TFT). The init sequence is from the Adafruit Python library for the ILI9341 controller. https://github.com/adafruit/Adafruit_Python_ILI9341 Signed-off-by: David Lechner Reviewed-by: Andy Shevchenko Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20180525193623.15533-5-david@lechnology.com commit 7b59d2d8d7980522bb4b532dcecb39bac3639726 Author: David Lechner Date: Fri May 25 14:36:22 2018 -0500 dt-bindings: new binding for Ilitek ILI9341 display panels This adds a new binding for Ilitek ILI9341 display panels. It includes a compatible string for one display (more can be added in the future). The YX240QV29-T panel[1] is found, for example, in an Adafruit breakout board[2] and in Mindsensors' PiStorms[3]. The vendor prefix "adafruit" is used because the actual vendor is not known, but Adafruit is the most common source for a product that contains this panel. [1]: https://cdn-learn.adafruit.com/assets/assets/000/046/879/original/SPEC-YX240QV29-T_Rev.A__1_.pdf [2]: https://www.adafruit.com/product/2478 [3]: http://www.mindsensors.com/stem-with-robotics/13-pistorms-v2-base-kit-raspberry-pi-brain-for-lego-robot Signed-off-by: David Lechner Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20180525193623.15533-4-david@lechnology.com commit bb2a9b6eb1f6d1a6efee629198beafdcb188b851 Author: David Lechner Date: Fri May 25 14:36:21 2018 -0500 dt-bindings: Add vendor prefix for Adafruit This adds a device tree vendor prefix for Adafruit Industries, LLC. Signed-off-by: David Lechner Acked-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20180525193623.15533-3-david@lechnology.com commit 10cfc747835e34c5ee09599c236128067b990723 Author: David Lechner Date: Fri May 25 14:36:20 2018 -0500 MAINTAINERS: fix path to ilitek, ili9225 device tree bindings This fixes the path to the ilitek,ili9225 device tree binding file. Signed-off-by: David Lechner Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20180525193623.15533-2-david@lechnology.com commit a61b47f672c1ebd56b273a55cfed9621448d253e Author: Chris Wilson Date: Wed Jun 27 12:53:34 2018 +0100 drm/i915: Wait for engines to idle before retiring In the next^W forthcoming patch, we will start to defer retiring the request from the engine list if it is still active on the submission backend. To preserve the semantics that after wait-for-idle completes the system is idle and fully retired, we need to therefore wait for the backends to idle before calling i915_retire_requests(). Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180627115334.16282-1-chris@chris-wilson.co.uk commit 4d97f7d53da7dc830dbf416a3d2a6778d267ae68 Author: Henry Wilson Date: Thu May 31 09:43:03 2018 +0000 inotify: Add flag IN_MASK_CREATE for inotify_add_watch() The flag IN_MASK_CREATE is introduced as a flag for inotiy_add_watch() which prevents inotify from modifying any existing watches when invoked. If the pathname specified in the call has a watched inode associated with it and IN_MASK_CREATE is specified, fail with an errno of EEXIST. Use of IN_MASK_CREATE with IN_MASK_ADD is reserved for future use and will return EINVAL. RATIONALE In the current implementation, there is no way to prevent inotify_add_watch() from modifying existing watch descriptors. Even if the caller keeps a record of all watch descriptors collected, this is only sufficient to detect that an existing watch descriptor may have been modified. The assumption that a particular path will map to the same inode over multiple calls to inotify_add_watch() cannot be made as files can be renamed or deleted. It is also not possible to assume that two distinct paths do no map to the same inode, due to hard-links or a dereferenced symbolic link. Further uses of inotify_add_watch() to revert the change may cause other watch descriptors to be modified or created, merely compunding the problem. There is currently no system call such as inotify_modify_watch() to explicity modify a watch descriptor, which would be able to revert unwanted changes. Thus the caller cannot guarantee to be able to revert any changes to existing watch decriptors. Additionally the caller cannot assume that the events that are associated with a watch descriptor are within the set requested, as any future calls to inotify_add_watch() may unintentionally modify a watch descriptor's mask. Thus it cannot currently be guaranteed that a watch descriptor will only generate events which have been requested. The program must filter events which come through its watch descriptor to within its expected range. Reviewed-by: Amir Goldstein Signed-off-by: Henry Wilson Signed-off-by: Jan Kara commit 6df6ba974a55678a2c7d9a0c06eb15cde0c4b184 Author: Evan Wang Date: Fri Apr 6 16:55:36 2018 +0200 PCI: aardvark: Remove PCIe outbound window configuration Outbound window is used to translate CPU space addresses to PCIe space addresses when the CPU initiates PCIe transactions. According to the suggestion of the HW designers, the recommended solution is to use the default outbound parameters, even though the current outbound window setting does not cause any known functional issue. This patch doesn't address any known functional issue, but aligns to HW design guidelines, and removes code that isn't needed. Signed-off-by: Evan Wang [Thomas: tweak commit log.] Signed-off-by: Thomas Petazzoni [lorenzo.pieralisi@arm.com: handled host->controller dir move] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Victor Gu Reviewed-by: Nadav Haklai commit 248d4e59616c632f37f04c233eec6d5008384926 Author: Thomas Petazzoni Date: Fri Apr 6 16:55:35 2018 +0200 PCI: aardvark: Introduce an advk_pcie_valid_device() helper In other to mimic other PCIe host controller drivers, introduce an advk_pcie_valid_device() helper, used in the configuration read/write functions. Signed-off-by: Thomas Petazzoni [lorenzo.pieralisi@arm.com: updated host->controller dir move] Signed-off-by: Lorenzo Pieralisi commit d18e85349f6a65baa69b8ee397efb93e4ca31909 Author: Jernej Skrabec Date: Mon Jun 25 14:02:43 2018 +0200 clk: sunxi-ng: r40: Export video PLLs Video PLLs need to be referenced in R40 DT as possible HDMI PHY parent. Export them. Reviewed-by: Rob Herring Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit fb4aa0f64380d94bf10b5da63a6760962d824dbc Author: Jernej Skrabec Date: Mon Jun 25 14:02:42 2018 +0200 clk: sunxi-ng: r40: Allow setting parent rate to display related clocks Display related peripherals need precise clocks to operate correctly. Allow DE2, TCONs and HDMI to set parent clock. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 24a95f7578f517e78367d6fb61aba238497a046b Author: Jernej Skrabec Date: Mon Jun 25 14:02:41 2018 +0200 clk: sunxi-ng: r40: Add minimal rate for video PLLs According to documentation and experience with other similar SoCs, video PLLs don't work stable if their output frequency is set below 192 MHz. Because of that, set minimal rate to both R40 video PLLs to 192 MHz. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 57c7f58111806faa0165b88155bff15679024122 Author: Daniel Stone Date: Fri May 18 14:47:05 2018 +0100 drm/mtk: mtk_drm_fb -> drm_framebuffer Now that mtk_drm_fb is an empty wrapper around drm_framebuffer, we can just delete it. Signed-off-by: Daniel Stone Signed-off-by: CK Hu Reviewed-by: Thierry Reding Reviewed-by: Sean Paul Cc: Philipp Zabel commit 548cb82538582f1b2badbc78df83c46899b6c694 Author: Daniel Stone Date: Fri May 18 14:47:04 2018 +0100 drm/mtk: Move GEM BO to drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle and destroy functions the same as the GEM framebuffer helper, we can reuse those. Signed-off-by: Daniel Stone Signed-off-by: CK Hu Reviewed-by: Thierry Reding Reviewed-by: Sean Paul Cc: Philipp Zabel commit 06ede493a9d755185ba8a97225ce1352fa5c310c Author: Daniel Stone Date: Fri May 18 14:47:03 2018 +0100 drm/mtk: Remove impossible internal error We cannot create a framebuffer with no objects, so there's no point testing for it. v2: Remove the error entirely. (Sean, CK, Thierry) Signed-off-by: Daniel Stone Cc: Sean Paul Cc: Thierry Reding Cc: CK Hu Cc: Philipp Zabel Acked-by: Thierry Reding Signed-off-by: CK Hu commit e6ab087a224fd7bcf712db698fbade673cc9addd Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:31 2018 +0800 drm/mediatek: Add support for mediatek SOC MT2712 This patch add support for the Mediatek MT2712 DISP subsystem. There are two OVL engine and three disp output in MT2712. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 5a2fbbd832758157a85a7f5a83ea33e06cf92217 Author: CK Hu Date: Wed Jun 27 21:04:05 2018 +0800 drm/mediatek: Split line to not over 80 characters Split the long line into two short line to make sure eache line not over 80 characters. Signed-off-by: CK Hu commit c3ae2103e06953b1521a96c3e6934136b835e027 Author: Felix Fietkau Date: Thu Jun 21 11:18:01 2018 +0200 mt76: improve gain adjustment in noisy environments When switching between low gain (high RSSI) and high gain settings, it can take a few seconds to adjust to the current environment. This can lead to short periods of time with extreme packet loss. When switching from low_gain=1 to low_gain=2, start with the same gain adjustment value instead of the lowest to avoid spikes of huge numbers of false CCA events Also avoid resetting adjustment values on switching between low_gain values 0 and 1, since it affects only the upper limit of vga adjustment Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 32e49efe0f15706021fda62e341fa6308e8d7c1e Author: Felix Fietkau Date: Thu Jun 21 11:18:00 2018 +0200 mt76: track ewma rssi for gain adjustment per station This preserves more sensitivity when weak stations are active and avoids counting signal measurements from other unrelated networks Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 108ec4dafd6166bcf5804aaa0486c9f02649e809 Author: Felix Fietkau Date: Thu Jun 21 11:17:59 2018 +0200 mt76: add a debugfs file to dump agc calibration information Useful for debugging gain adjustment issues triggered by signal strength changes. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 8e31f0d35a881537cf9b4ebabf63791dde3bbb0a Author: Felix Fietkau Date: Thu Jun 21 11:17:58 2018 +0200 mt76: fix variable gain adjustment range The range should only be limited to 4 for really weak signals, for all other gain settings the range is 16. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit fa967b5860318d1e77bf01b5102ce5ea4e56efef Author: Felix Fietkau Date: Thu Jun 21 11:17:57 2018 +0200 mt76: clear false CCA counters after changing gain settings They will be read on the next calibration step without gain change and must not count earlier events Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 929211687197adcb252129aed43ff81d9bb90110 Author: Felix Fietkau Date: Thu Jun 21 11:17:56 2018 +0200 mt76: adjust AGC control register 26 based on gain for VHT80 Use values based on the vendor driver Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 6cdb9614a818b7e318328c9e30d3ee4046308678 Author: Felix Fietkau Date: Thu Jun 21 11:17:55 2018 +0200 mt76: fix swapped values for RXO-18 in gain control The lowest bit should be set to 0 only for strong links, not for weak ones. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 9afef0fddaa1879ae4e14fc3079e38f1fbdd7427 Author: Felix Fietkau Date: Thu Jun 21 11:17:54 2018 +0200 mt76: fix threshold for gain adjustment The gain should be reduced only for very strong connections, not for mid range. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit aea38272920c227865af25c7d7710f1ab0d8a1ce Author: Felix Fietkau Date: Thu Jun 21 11:17:53 2018 +0200 mt76: fix beacon timer drift The beacon timer drifts by 1 microsecond every TBTT. After 20 minutes with a beacon interval of 100, the drift will be almost 12 ms, enough to cause weird issues for devices in powersave mode. Since the beacon timer is configured in units of 1/16 TU (64 us), we need to adjust it once every 64 beacons and only for one beacon. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo commit 81454b8405f24df8b24984698d62c5f560d01fe3 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:36:48 2018 +0200 zd1211rw: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Daniel Drake Cc: Ulrich Kunitz Cc: Kalle Valo Cc: "David S. Miller" Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Kalle Valo commit a3128feef6d516fecc33b6299266a4673454815f Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:36:47 2018 +0200 libertas: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. I am removing the BUG_ON(!in_interrupt()); check because it serves no purpose. Running the completion callback in BH context makes in_interrupt() still return true but the interrupts could be enabled. The important part is that ->driver_lock is acquired with disabled interrupts which is the case now. Cc: Kalle Valo Cc: "David S. Miller" Cc: libertas-dev@lists.infradead.org Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Kalle Valo commit fc75122fabb54d38a0cedcc6e99004dc99af9631 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:36:46 2018 +0200 libertas_tf: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. I am removing the BUG_ON(!in_interrupt()); check because it serves no purpose. Running the completion callback in BH context makes in_interrupt() still return true but the interrupts could be enabled. The important part is that ->driver_lock is acquired with disabled interrupts which is the case now. Cc: Kalle Valo Cc: "David S. Miller" Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Kalle Valo commit c288248f5b26cd5563112fcdc077bf44964a942d Author: Takashi Iwai Date: Wed Jun 27 14:59:00 2018 +0200 ALSA: intel_hdmi: Use strlcpy() instead of strncpy() hdmi_lpe_audio_probe() copies the pcm name string via strncpy(), but as a gcc8 warning suggests, it misses a NUL terminator, and unlikely the expected result. Use the proper one, strlcpy() instead. Signed-off-by: Takashi Iwai commit 3cade2f3d98a7fcfd36fcb0d743f5ed5cdffb119 Author: Arnd Bergmann Date: Mon Jun 18 17:11:16 2018 +0200 ipw2x00: track time using boottime The ipw2x00 driver family uses get_seconds() to read the current time for various purposes. This function is deprecated because of the 32-bit time_t overflow, and it can cause unexpected behavior when the time changes due to settimeofday() calls or leap second updates. In many cases, we want to use monotonic time instead, however ipw2x00 explicitly tracks the time spent in suspend, so this changes the driver over to use ktime_get_boottime_seconds(), which is slightly slower, but not used in a fastpath here. Signed-off-by: Arnd Bergmann Acked-by: Stanislav Yakovlev Signed-off-by: Kalle Valo commit 71e140b57151425829f87a0aaaa87636860dd7d2 Author: Arnd Bergmann Date: Mon Jun 18 17:11:15 2018 +0200 zd1211rw: stop using deprecated get_seconds() The get_seconds() function is deprecated because of the y2038 overflow. In zd1211rw we don't even care about the absolute value, so this is not a problem, but it's equally trivial to change to the non-deprecated ktime_get_seconds(). Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo commit 22d0d2fafca93ba1d92a2fbd4a60463c919a12ad Author: Omer Efrat Date: Sun Jun 17 13:07:13 2018 +0300 wireless-drivers: use BIT_ULL for NL80211_STA_INFO_ attribute types The BIT macro uses unsigned long which some architectures handle as 32 bit and therefore might cause macro's shift to overflow when used on a value equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards). Since 'filled' member in station_info changed to u64, BIT_ULL macro should be used with all NL80211_STA_INFO_* attribute types instead of BIT to prevent future possible bugs when one will use BIT macro for higher attributes by mistake. This commit cleans up all usages of BIT macro with the above field in wireless-drivers by changing it to BIT_ULL instead. In addition, there are some places which don't use BIT nor BIT_ULL macros so align those as well. Signed-off-by: Omer Efrat Signed-off-by: Kalle Valo commit ae636fb1554833ee5133ca47bf4b2791b6739c52 Author: Dan Carpenter Date: Tue Jun 5 14:31:39 2018 +0300 rndis_wlan: potential buffer overflow in rndis_wlan_auth_indication() This is a static checker fix, not something I have tested. The issue is that on the second iteration through the loop, we jump forward by le32_to_cpu(auth_req->length) bytes. The problem is that if the length is more than "buflen" then we end up with a negative "buflen". A negative buflen is type promoted to a high positive value and the loop continues but it's accessing beyond the end of the buffer. I believe the "auth_req->length" comes from the firmware and if the firmware is malicious or buggy, you're already toasted so the impact of this bug is probably not very severe. Fixes: 030645aceb3d ("rndis_wlan: handle 802.11 indications from device") Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo commit 8668f9a57c8c551f3e6a45d2733e64686c7b7904 Author: YueHaibing Date: Mon Jun 4 18:32:10 2018 +0800 atmel: use memdup_user to simplify the code use existing memdup_user() helper function instead of open-coding Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit 2d1e9be0016230f3707812243561fbd16f1aea4b Author: Lorenzo Bianconi Date: Mon Jun 4 11:19:41 2018 +0200 mt76x2: fix mrr idx/count estimation in mt76x2_mac_fill_tx_status() Fix mcs and attempt count estimation in mt76x2_mac_fill_tx_status routine if the number of tx retries reported by the hw is grater than IEEE80211_TX_MAX_RATES Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e") Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo commit 4e5f881d430aa243c8723c0de48fa16af30b292d Author: Varsha Rao Date: Sun Jun 3 16:41:35 2018 +0530 net: ipw2x00: Replace NULL comparison with !priv Remove extra parentheses and replace NULL comparison with !priv, to fix clang warning of extraneous parentheses and check patch issue. Following coccinelle script is used to fix it. @disable is_null,paren@ expression e; statement s; @@ if ( - (e==NULL) +!e ) s Signed-off-by: Varsha Rao Signed-off-by: Kalle Valo commit 38013eef0233bdd1133570e74192eefe989cb87d Author: Xinming Hu Date: Fri Jun 1 15:53:40 2018 +0800 mwifiex: uap: do not chok ethernet header in bridge path Do not chock ethernet header for uap bridge data path, as it is still needed to send skb to dest station. Signed-off-by: Xinming Hu Signed-off-by: Kalle Valo commit 0e2dc70e3d0d503b0cc9c5f74db3eb6db52c9e22 Author: Johannes Berg Date: Wed Jun 20 08:58:30 2018 +0200 bitfield: add tests Add tests for the bitfield helpers. The constant ones will all be folded to nothing by the compiler (if everything is correct in the header file), and the variable ones do some tests against open-coding the necessary shifts. A few test cases that should fail/warn compilation are provided under ifdef. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo commit 37a3862e1238262e9866d5d66e5f5f9069cee3a1 Author: Johannes Berg Date: Wed Jun 20 08:58:29 2018 +0200 bitfield: add u8 helpers There's no reason why we shouldn't pack/unpack bits into/from u8 values/registers/etc., so add u8 helpers. Use the ____MAKE_OP() macro directly to avoid having nonsense le8_encode_bits() and similar functions. Reviewed-by: Andy Shevchenko Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo commit e7d4a95da86e0b048702765bbdcdc968aaf312e7 Author: Johannes Berg Date: Wed Jun 20 08:58:28 2018 +0200 bitfield: fix *_encode_bits() There's a bug in *_encode_bits() in using ~field_multiplier() for the check whether or not the constant value fits into the field, this is wrong and clearly ~field_mask() was intended. This was triggering for me for both constant and non-constant values. Additionally, make this case actually into an compile error. Declaring the extern function that will never exist with just a warning is pointless as then later we'll just get a link error. While at it, also fix the indentation in those lines I'm touching. Finally, as suggested by Andy Shevchenko, add some tests and for that introduce also u8 helpers. The tests don't compile without the fix, showing that it's necessary. Fixes: 00b0c9b82663 ("Add primitives for manipulating bitfields both in host- and fixed-endian.") Reviewed-by: Andy Shevchenko Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo commit ab8d904654e2bb55b2964588700c31f974382894 Author: Colin Ian King Date: Sat Jun 23 23:15:31 2018 +0100 brcmsmac: make function wlc_phy_workarounds_nphy_rev1 static The function wlc_phy_workarounds_nphy_rev1 is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'wlc_phy_workarounds_nphy_rev1' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit c9a61469fc97672a08b2f798830a55ea6e03dc4a Author: Stefan Agner Date: Sun Jun 17 12:33:50 2018 +0200 brcmsmac: fix wrap around in conversion from constant to s16 The last value in the log_table wraps around to a negative value since s16 has a value range of -32768 to 32767. This is not what the table intends to represent. Use the closest positive value 32767. This fixes a warning seen with clang: drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c:216:2: warning: implicit conversion from 'int' to 's16' (aka 'short') changes value from 32768 to -32768 [-Wconstant-conversion] 32768 ^~~~~ 1 warning generated. Fixes: 4c0bfeaae9f9 ("brcmsmac: fix array out-of-bounds access in qm_log10") Cc: Tobias Regnery Signed-off-by: Stefan Agner Signed-off-by: Kalle Valo commit eb5d2f3afc0f924e55b508576d7d6366e02b6af2 Author: Varsha Rao Date: Fri Jun 1 07:44:12 2018 +0530 brcmsmac: Remove unnecessary parentheses This patch fixes the clang warning of extraneous parentheses, with the following coccinelle script. @@ identifier i; expression e; statement s; @@ if ( -(i == e) +i == e ) s Suggested-by: Lukas Bulwahn Signed-off-by: Varsha Rao Signed-off-by: Kalle Valo commit 6fbef9540af027276deaabc43e1270b5e7952401 Author: Andrey Shevchenko Date: Thu May 31 12:10:58 2018 +0300 qtnfmac: enable source MAC address randomization support Enable support for source MAC address randomization of probe request frames. Pass addr/mask randomization parameters to firmware. Signed-off-by: Andrey Shevchenko Signed-off-by: Kalle Valo commit ed9f34bb9d338734ed8ec3d7f1269a28ef0a553e Author: Igor Mitsyanko Date: Thu May 31 12:10:57 2018 +0300 qtnfmac: implement net_device_ops callback to set MAC address Implement net_device_ops::ndo_set_mac_address callback to allow for setting interface MAC address. Implementation is done through existing CHANGE_INTF firmware command. All validation is to be done by firmware. Signed-off-by: Igor Mitsyanko Signed-off-by: Kalle Valo commit 9b71578de08748defb3bcae3ce8ed1a75cb6a8d7 Author: Tony Lindgren Date: Tue Jun 19 02:43:42 2018 -0700 wlcore: Enable runtime PM autosuspend support With runtime PM tested working for wlcore with no autosuspend, we can now enable autosuspend to cut down on enable/disable for interrupts. Basically we just replace pm_runtime_put() with the autosuspend variants. Let's use autosuspend delay of 50ms that MMC drivers typically use. Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo commit c40aad28a3cf762c4f842fdb8f6e7fa653a2241e Author: Tony Lindgren Date: Tue Jun 19 02:43:41 2018 -0700 wlcore: Make sure firmware is initialized in wl1271_op_add_interface() We have wl12xx_boot() call wl12xx_enable_interrupts() and if we have wl1271_op_add_interface() call pm_runtime_get_sync() before the interrupts are enabled. And then we get the following error during boot: wlcore: ERROR ELP wakeup timeout! Let's fix this by first checking if we need to boot the firmware. And only after that call pm_runtime_get_sync() when interrupts are enabled. And only after that do the check for wl12xx_need_fw_change(). Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo commit 45aa7f071b06c8481afed4c7b93e07c9584741e8 Author: Eyal Reizer Date: Tue Jun 19 02:43:40 2018 -0700 wlcore: Use generic runtime pm calls for wowlan elp configuration With runtime PM enabled, we can now use calls to pm_runtime_force_suspend and pm_runtime_force_resume for enabling elp during suspend when wowlan is enabled and waking the chip from elp on resume. Remove the custom API that was used to ensure that the command that is used to allow ELP during suspend is completed before the system suspend. Signed-off-by: Eyal Reizer Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo commit db68052bdf581eb5e7f74da4a5bb5933113dbaaf Author: Tony Lindgren Date: Tue Jun 19 02:43:39 2018 -0700 wlcore: Fix timout errors after recovery After enabling runtime PM, if we force hardware reset multiple times with: # echo 1 > /sys/kernel/debug/ieee80211/phy0/wlcore/start_recovery We will after few tries get the following error: wlcore: ERROR timeout waiting for the hardware to complete initialization And then wlcore is unable to reconnect until after the wlcore related modules are reloaded. Let's fix this by moving pm_runtime_put() earlier before we restart the hardware. And let's use the sync version to make sure we're done before we restart. Note that we still will get -EBUSY warning from wl12xx_sdio_set_power() but let's fix that separately once we know exactly why we get the warning. Reported-by: Eyal Reizer Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo commit 3ebbabea4219816ff148209473e074adaaa5f610 Author: Tony Lindgren Date: Tue Jun 19 02:43:38 2018 -0700 wlcore: Fix misplaced PM call for scan_complete_work() With runtime PM enabled, we now need to have wlcore enabled longer until after we're done calling wlcore_cmd_regdomain_config_locked(): scan_complete_work() wlcore_cmd_regdomain_config_locked() wlcore_cmd_send_failsafe() wl12xx_sdio_raw_read() Note that this is not needed before runtime PM support as the custom PM code had it's own timer. We have not yet enabled runtime PM autosuspend for wlcore and this is why this issue now shows up. Let's fix the issues first before we enable runtime PM autosuspend. Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo commit fa2648a34e73fb7a17fd0a82e0335a9451d8f5c8 Author: Tony Lindgren Date: Tue Jun 19 02:43:37 2018 -0700 wlcore: Add support for runtime PM We can update wlcore to use PM runtime by adding functions for wlcore_runtime_suspend() and wlcore_runtime_resume() and replacing calls to wl1271_ps_elp_wakeup() and wl1271_ps_elp_sleep() with calls to pm_runtime_get_sync() and pm_runtime_put(). Note that the new wlcore_runtime_suspend() and wlcore_runtime_resume() functions are based on simplified versions of wl1271_ps_elp_sleep() and wl1271_ps_elp_wakeup(). We don't want to use the old functions as we can now take advantage of the runtime PM usage count. And we don't need the old elp_work at all. And we can also remove WL1271_FLAG_ELP_REQUESTED that is no longer needed. Pretty much the only place where we are not just converting the existing functions is wl1271_op_suspend() where we add pm_runtime_put_noidle() to keep the calls paired. As the next step is to implement runtime PM autosuspend, let's not add wrapper functions for the generic runtime PM calls. We would be getting rid of any wrapper functions anyways. After autoidle we should be able to start using Linux generic wakeirqs for the padconf interrupt. Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo commit 02edf81362fe8b6a8230ac6610e0c94a0e9d1d62 Author: Tony Lindgren Date: Tue Jun 19 02:43:36 2018 -0700 wlcore: Make sure PM calls are paired The call to wl1271_ps_elp_wakeup() in wl12xx_queue_recovery_work() is unpaired. Let's remove it and add paired calls to wl1271_recovery_work() instead in preparation for changing things to use runtime PM. Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo commit 4ec7cece87b3ed21ffcd407c62fb2f151a366bc1 Author: Tony Lindgren Date: Tue Jun 19 02:43:35 2018 -0700 wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout() Otherwise we can get: WARNING: CPU: 0 PID: 55 at drivers/net/wireless/ti/wlcore/io.h:84 I've only seen this few times with the runtime PM patches enabled so this one is probably not needed before that. This seems to work currently based on the current PM implementation timer. Let's apply this separately though in case others are hitting this issue. Signed-off-by: Tony Lindgren Signed-off-by: Kalle Valo commit 4b03df5fc8c65659e41c3531b627ff615ed8ede9 Author: Geert Uytterhoeven Date: Wed Jun 20 15:53:23 2018 +0200 arm64: dts: renesas: r8a77990: Remove non-existing STBE region R-Car E3 does not have the Stream Buffer for EtherAVB-IF (STBE). Note that the RAVB driver does not use this region. Fixes: 913a78b575c313b8 ("arm64: dts: renesas: r8a77990: Add EthernetAVB device nodes") Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 23295aeebf0706c717adf55487779b19a3605e21 Author: Geert Uytterhoeven Date: Tue Jun 19 19:20:49 2018 +0200 ARM: shmobile: rcar-gen2: Stop compiling headsmp-apmu on !SMP As of commit cad160ed0a94927e ("ARM: shmobile: Convert file to use cntvoff"), there's no non-SMP code left in headsmp-apmu.S. Hence build the file for SMP only, and drop the no longer needed check for CONFIG_SMP inside the file. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit ffdc4984100050d0c8e2f11f76a15ca36f5d9e37 Author: Axel Lin Date: Wed Jun 27 20:40:14 2018 +0800 regulator: bd71837: Simplify bd71837_set_voltage_sel_restricted implementation Signed-off-by: Axel Lin Signed-off-by: Mark Brown commit adb78a8e24bbfe19df0d4dd19ee78cec351a5f04 Author: Axel Lin Date: Wed Jun 27 20:40:13 2018 +0800 regulator: bd71837: Staticize ldo_2_volts Signed-off-by: Axel Lin Signed-off-by: Mark Brown commit 9fab166a3e8f9e071de3418d27ffd03cdba2e9df Author: Arnd Bergmann Date: Fri May 25 11:25:10 2018 -0400 media: cx231xx: fix RC_CORE dependency With CONFIG_RC_CORE=m and VIDEO_CX231XX=y, we get a link failure: drivers/media/usb/cx231xx/cx231xx-input.o: In function `cx231xx_ir_init': cx231xx-input.c:(.text+0xd4): undefined reference to `rc_allocate_device' This narrows down the dependency so that only valid configurations are allowed. Fixes: 84545d2a1436 ("media: cx231xx: Remove RC_CORE dependency") Signed-off-by: Arnd Bergmann Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4e61d7d1dd4c5b2e6da73852c24160e2ce7f8147 Author: Geert Uytterhoeven Date: Fri May 18 06:51:23 2018 -0400 media: v4l: rcar_fdp1: Change platform dependency to ARCH_RENESAS The Renesas Fine Display Processor driver is used on Renesas R-Car SoCs only. Since commit 9b5ba0df4ea4f940 ("ARM: shmobile: Introduce ARCH_RENESAS") is ARCH_RENESAS a more appropriate platform dependency than the legacy ARCH_SHMOBILE, hence use the former. This will allow to drop ARCH_SHMOBILE on ARM and ARM64 in the near future. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Laurent Pinchart Reviewed-by: Simon Horman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 63842c21347ecf4685d6ec008e667e61b0ead6e5 Author: Namit Gupta Date: Wed Jun 20 19:26:19 2018 +0530 printk: Remove unnecessary kmalloc() from syslog during clear When the request is only for clearing logs, there is no need for allocation/deallocation. Only the indexes need to be reset and returned. Rest of the patch is mostly made up of changes because of indention. Link: http://lkml.kernel.org/r/20180620135951epcas5p3bd2a8f25ec689ca333bce861b527dba2~54wyKcT0_3155531555epcas5p3y@epcas5p3.samsung.com Cc: linux-kernel@vger.kernel.org Cc: pankaj.m@samsung.com Cc: a.sahrawat@samsung.com Signed-off-by: Namit Gupta Signed-off-by: Himanshu Maithani Reviewed-by: Steven Rostedt (VMware) Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 22eceb8bf3e8f1f9b2f566062d06b25807725d7f Author: Hans de Goede Date: Tue Jun 19 13:57:26 2018 +0200 printk: Make CONSOLE_LOGLEVEL_QUIET configurable The goal of passing the "quiet" option to the kernel is for the kernel to be quiet unless something really is wrong. Sofar passing quiet has been (mostly) equivalent to passing loglevel=4 on the kernel commandline. Which means to show any messages with a level of KERN_ERR or higher severity on the console. In practice this often does not result in a quiet boot though, since there are many false-positive or otherwise harmless error messages printed, defeating the purpose of the quiet option. Esp. the ACPICA code is really bad wrt this, but there are plenty of others too. This commit makes CONSOLE_LOGLEVEL_QUIET configurable. This for example will allow distros which want quiet to really mean quiet to set CONSOLE_LOGLEVEL_QUIET so that only messages with a higher severity then KERN_ERR (CRIT, ALERT, EMERG) get printed, avoiding an endless game of whack-a-mole silencing harmless error messages. Link: http://lkml.kernel.org/r/20180619115726.3098-1-hdegoede@redhat.com To: Petr Mladek To: Sergey Senozhatsky Cc: Hans de Goede Cc: Steven Rostedt Cc: linux-kernel@vger.kernel.org Signed-off-by: Hans de Goede Acked-by: Steven Rostedt (VMware) Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 375899cddcbb26881b03cb3fbdcfd600e4e67f4a Author: Maninder Singh Date: Fri Jun 1 14:26:42 2018 +0530 printk: make sure to print log on console. This patch make sure printing of log on console if loglevel at time of storing log is less than current console loglevel. @why In SMP printk can work asynchronously, logs can be missed on console because it checks current log level at time of console_unlock, not at time of storing logs. func() { .... .... console_verbose(); // user wants to have all the logs on console. pr_alert(); dump_backtrace(); //prints with default loglevel. ... console_silent(); // stop all logs from printing on console. } Now if console_lock was owned by another process, the messages might be handled after the consoles were silenced. Reused flag LOG_NOCONS as its usage is gone long back by the commit 5c2992ee7fd8a29d0412 ("printk: remove console flushing special cases for partial buffered lines"). Note that there are still some corner cases where this patch is not enough. For example, when the messages are flushed later from printk_safe buffers or when there are races between console_verbose() and console_silent() callers. Link: http://lkml.kernel.org/r/20180601090029epcas5p3cc93d4bfbebb3199f0a2684058da7e26~z-a_jkmrI2993329933epcas5p3q@epcas5p3.samsung.com Cc: linux-kernel@vger.kernel.org Cc: a.sahrawat@samsung.com Cc: pankaj.m@samsung.com Cc: v.narang@samsung.com Cc: Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit f6f630327de95c251741c1f682a94243c48f2b13 Author: Arnd Bergmann Date: Wed May 30 18:07:10 2018 -0400 media: v4l: cadence: add VIDEO_V4L2 dependency The cadence media drivers can be built-in while the v4l2 core is a loadable module. This is a mistake and leads to link errors: drivers/media/v4l2-core/v4l2-fwnode.o: In function `v4l2_async_register_subdev_sensor_common': v4l2-fwnode.c:(.text+0x12f0): undefined reference to `v4l2_async_subdev_notifier_register' v4l2-fwnode.c:(.text+0x1304): undefined reference to `v4l2_async_register_subdev' v4l2-fwnode.c:(.text+0x1318): undefined reference to `v4l2_async_notifier_unregister' v4l2-fwnode.c:(.text+0x1338): undefined reference to `v4l2_async_notifier_cleanup' cdns-csi2rx.c:(.text+0x9f8): undefined reference to `v4l2_subdev_init' cdns-csi2rx.c:(.text+0xa78): undefined reference to `v4l2_async_register_subdev' drivers/media/platform/cadence/cdns-csi2tx.o: In function `csi2tx_remove': cdns-csi2tx.c:(.text+0x88): undefined reference to `v4l2_async_unregister_subdev' drivers/media/platform/cadence/cdns-csi2tx.o: In function `csi2tx_probe': cdns-csi2tx.c:(.text+0x884): undefined reference to `v4l2_subdev_init' cdns-csi2tx.c:(.text+0xa9c): undefined reference to `v4l2_async_register_subdev' An explicit Kconfig dependency on VIDEO_V4L2 avoids the problem. Fixes: 1fc3b37f34f6 ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver") Signed-off-by: Arnd Bergmann Acked-by: Maxime Ripard Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3c46ab9d37e542dd28ee27ee31defe5f8b5e466c Author: Arnd Bergmann Date: Fri May 25 11:25:09 2018 -0400 media: v4l: cadence: include linux/slab.h I ran into a randconfig build error with the new driver: drivers/media/platform/cadence/cdns-csi2tx.c: In function 'csi2tx_probe': drivers/media/platform/cadence/cdns-csi2tx.c:477:11: error: implicit declaration of function 'kzalloc'; did you mean 'd_alloc'? [-Werror=implicit-function-declaration] kzalloc() is declared in linux/slab.h, so let's include this to make it build in all configurations. Fixes: 84b477e6d4bc ("media: v4l: cadence: Add Cadence MIPI-CSI2 TX driver") Signed-off-by: Arnd Bergmann Acked-by: Maxime Ripard Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 17121d12a5c1089bdfce429bc6f7ae2c25d9d25d Author: Sakari Ailus Date: Wed May 23 05:33:32 2018 -0400 media: imx258: Check the rotation property has a value of 180 The driver only supports streaming images flipped horizontally and vertically. In order to ensure that all current users will be fine if or when support for upright streaming is added, require the presence of the "rotation" control now. Signed-off-by: Sakari Ailus Tested-by: "Lai, Jim" Signed-off-by: Mauro Carvalho Chehab commit 67ca07e7ac10d7cdc2aa7ac216cab7fb64c95e50 Author: Imre Deak Date: Tue Jun 26 17:22:32 2018 +0300 drm/i915/icl: Add power well support Add the definition for ICL power wells and their mapping to power domains. On ICL there are 3 power well control registers, we'll select the correct one based on higher bits of the power well ID. The offset for the control and status flags within this register is based on the lower bits of the ID as on older platforms. As the DC state programming is also the same as on old platforms we can reuse the corresponding helpers. For this we mark here the DC-off power well as shared among multiple platforms. Other than the above the delta between old platforms and ICL: - Pipe C has its own power well, so we can save some additional power in the pipe A+B and (non-eDP) pipe A configurations. - Power wells for port E/F DDI/AUX IO and Thunderbolt 1-4 AUX IO v2: - Rebase on drm-tip after prep patch for this was merged there as requested by Paulo. - Actually add the new AUX and DDI power well control regs (Rakshmi) v3: - Fix power well register names in code comments - Add TBT AUX->power well 3 dependency v4: - Rebase v5: - Detach AUX power wells from the INIT power domain. These power wells can only be enabled in a TC/TBT connected state and otherwise not needed during driver initialization. v6: - Use _MMIO_PORT(...) instead _MMIO(_PICK(...)) (Paulo) Fix checkpatch warnings. Cc: Animesh Manna Cc: Rakshmi Bhatia Cc: Paulo Zanoni Signed-off-by: Imre Deak Reviewed-by: Animesh Manna (v1) Reviewed-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180626142232.22361-1-imre.deak@intel.com commit 106359177a57c7ea4a0c31e9cd24e6313b355ed7 Author: Sandy Huang Date: Tue Jun 26 16:16:44 2018 +0800 drm/rockchip: vop: fixup linebuffer mode calc error linebuffer mode should be LB_YUV_3840X5 when width is bigger than 1280 in yuv mode. Separate yuv and rgb case makes the scl_vop_cal_lb_mode() logic clearer. Signed-off-by: Sandy Huang Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/1530001004-25036-1-git-send-email-hjc@rock-chips.com commit fe2c32545bfc281122cb8b66572949a366ad747e Author: Arnd Bergmann Date: Wed Jun 20 16:31:40 2018 +0200 ext2: use ktime_get_real_seconds for timestamps get_seconds() is deprecated because of the y2038 overflow, so users should migrate to 64-bit timestamps using ktime_get_real_seconds(). In ext2, the timestamps in the superblock and in the inode are all limited to 32-bit, and this won't get fixed, so let's just stop using the deprecated interface and keep truncating. All users of ext2 should migrate to ext4 before 2038 to prevent this from causing problems. Signed-off-by: Arnd Bergmann Signed-off-by: Jan Kara commit c3b9cecd89b806e14544af596396e18abd00f145 Author: Arnd Bergmann Date: Wed Jun 20 10:15:13 2018 +0200 udf: convert inode stamps to timespec64 The VFS structures are finally converted to always use 64-bit timestamps, and this file system can represent a long range of on-disk timestamps already, so now let's fit in the missing bits for udf. Signed-off-by: Arnd Bergmann Signed-off-by: Jan Kara commit eaa2c6b0c9181c3c70f773361bd81d9efd5804d9 Author: Amir Goldstein Date: Sat Jun 23 17:54:51 2018 +0300 fanotify: factor out helpers to add/remove mark Factor out helpers fanotify_add_mark() and fanotify_remove_mark() to reduce duplicated code. Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 3ac70bfcde812b1b97d8a88a832df59941fa293f Author: Amir Goldstein Date: Sat Jun 23 17:54:50 2018 +0300 fsnotify: add helper to get mask from connector Use a helper to get the mask from the object (i.e. i_fsnotify_mask) to generalize code of add/remove inode/vfsmount mark. Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 36f10f55ff1d2867bfc48ed898a9cc0dc6b49dd2 Author: Amir Goldstein Date: Sat Jun 23 17:54:49 2018 +0300 fsnotify: let connector point to an abstract object Make the code to attach/detach a connector to object more generic by letting the fsnotify connector point to an abstract fsnotify_connp_t. Code that needs to dereference an inode or mount object now uses the helpers fsnotify_conn_{inode,mount}. Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit b812a9f5896379b6cff2ac168ddb5b89037d8e78 Author: Amir Goldstein Date: Sat Jun 23 17:54:48 2018 +0300 fsnotify: pass connp and object type to fsnotify_add_mark() Instead of passing inode and vfsmount arguments to fsnotify_add_mark() and its _locked variant, pass an abstract object pointer and the object type. The helpers fsnotify_obj_{inode,mount} are added to get the concrete object pointer from abstract object pointer. Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 9b6e543450dc03635899ba56b1c39cc593694560 Author: Amir Goldstein Date: Sat Jun 23 17:54:47 2018 +0300 fsnotify: use typedef fsnotify_connp_t for brevity The object marks manipulation functions fsnotify_destroy_marks() fsnotify_find_mark() and their helpers take an argument of type struct fsnotify_mark_connector __rcu ** to dereference the connector pointer. use a typedef to describe this type for brevity. Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit a3e77e1655961f4ed7ad4eea8763aed418bd932e Author: Ville Syrjälä Date: Tue Jun 26 22:47:13 2018 +0300 drm/rockchip: Use drm_crtc_mask() Use drm_crtc_mask() where appropriate. Cc: Sandy Huang Cc: "Heiko Stübner" Signed-off-by: Ville Syrjälä Reviewed-by: Rodrigo Vivi Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-7-ville.syrjala@linux.intel.com commit f516d32262a4c0fef3fccdf2a82671f54f5c1e33 Author: Jerome Brunet Date: Wed Jun 27 09:39:37 2018 +0200 ASoC: tas517x: add tas5707 support Add support for the tas5707 audio power amplifier. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 599eb9060c7ccaf6a8f0386ab89e3cb5c1f1fea4 Author: Jerome Brunet Date: Wed Jun 27 09:39:36 2018 +0200 ASoC: tas571x: add tas5707 compatible Add the tas5707 to the available compatibles of the tas571x driver Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 8ed237e83ce9ff4b3964a6b096beb1cbd3397d5a Author: Jerome Brunet Date: Tue Jun 26 14:11:28 2018 +0200 ASoC: simple-amplifer: add simple-amplifier compatible Add simple-audio-amplifier to the list of available compatible Suggested-by: Nicolò Veronese Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 8d881bb6216d28896112bdc0b42f1f21eb6cd4ee Author: Jerome Brunet Date: Tue Jun 26 14:11:27 2018 +0200 ASoC: simple-amplifier: rename dio2125 to simple-amplifer The dio2125 is simple enough that we can make it a generic component. Just rename and sed the dio2125 amplifier driver to simple_amplifier. Suggested-by: Nicolò Veronese Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 0ed03e6dc288c50b2e7d71523b99df1afd81cea1 Author: Jerome Brunet Date: Tue Jun 26 14:11:26 2018 +0200 ASoC: simple-amplifier: remame dio2125 documentation The dio2125 is simple enough that we can make it a generic component. Rename the the dio2125 documentation to simple-amplifier to prepare this change. Suggested-by: Nicolò Veronese Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 55d69c0309acea65fb3dd99a05a665b51630362d Author: Hans de Goede Date: Sun Jun 24 16:06:34 2018 +0200 ASoC: Intel: bytcr_rt5651: Sort DMI table entries alphabetically As we get more entries in the DMI quirk table it is nice to have some sort of ordering in the table, sort it alphabetically. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 8f250e7009d71e6f3f3aeb95a540c36fc9c03398 Author: Hans de Goede Date: Sun Jun 24 16:06:33 2018 +0200 ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_HP_LR_SWAPPED quirk One some models (Chuwi Vi8 Plus, Chuwi Hi8 Pro) the headphone output has left and right swapped. This can be fixed in with special mixer settings in the UCM profile, bit this requires these devices loading a different UCM profile. This commit adds a BYT_RT5651_HP_LR_SWAPPED quirk for this and postfixes the longname with "-hp-swapped" if set, so that a different UCM profile will be loaded. We can safely do this without causing regressions (UCM profile not found due to the longname change) as the UCM profiles are not in upstream alsa-lib yet. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 8e69cd640097fa7af53fb476dbd3597608f32b10 Author: Hans de Goede Date: Sun Jun 24 16:06:32 2018 +0200 ASoC: Intel: bytcr_rt5651: Simplify card long-name Now that the headset-mic is always IN3 there is no reason to have the headset-mic mapping in the long-name. This commit simplifies the long name to "bytcr-rt5651--mic". We can safely do this without causing regressions (UCM profile not found due to the longname change) as the UCM profiles are not in upstream alsa-lib yet. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 37c7401e8c1f583d197c096152fc87a58f460277 Author: Hans de Goede Date: Sun Jun 24 16:06:31 2018 +0200 ASoC: Intel: bytcr_rt5651: Fix DMIC map headsetmic mapping The initial bytcr_rt5651 machine driver commit mapped IN2 as the headset mic. In retrospect this is not correct as all known boards have the headset mic on IN3. This commit fixes the original DMIC mapping to correctly have the headset mic on IN3. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit de23147983013591bc4d6812ce441f351dec6b9d Author: Hans de Goede Date: Sun Jun 24 16:06:30 2018 +0200 ASoC: Intel: bytcr_rt5651: Fix IN1 map headsetmic mapping The initial bytcr_rt5651 machine driver commit mapped IN2 as the headset mic. In retrospect this is not correct as all known boards have the headset mic on IN3. To workaround this special IN?_HS_IN3 mappings were added. This commit fixes the original IN1 mapping to correctly have the headset mic on IN3, moves all users of the IN1_HS_IN3 mapping over to the fixed IN1_MAP and drops the now no longer needed IN1_HS_IN3 mapping. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit fcdf1391caa6f7f01de56eea63e070555771fac7 Author: Hans de Goede Date: Sun Jun 24 16:06:29 2018 +0200 ASoC: Intel: bytcr_rt5651: Remove IN2 input mappings BYT_RT5651_IN2_MAP was introduced in commit 39712db878a4 ("SoC: intel: byt: Introduce new custom IN2 map"), uses in commit 2fe30129b0a6 ("ASoC: intel: byt: Enable IN2 map quirk for a KIANO laptop"), only to be replaced by a new BYT_RT5651_IN1_IN2_MAP quirk in commit ea261bd02a67 ("ASoC: intel: byt: Introduce new map for dual mics") quickly afterwards, because the KIANO laptop has 2 internal mics on IN1 and IN2 and the headset mic is not in IN1 where the BYT_RT5651_IN2_MAP maps it, but on IN3. Now that the KIANO quirk entry uses BYT_RT5651_IN1_IN2_MAP, there are no users of BYT_RT5651_IN2_MAP left. This makes sense since the headset mic seems to always be connected to IN3, so BYT_RT5651_IN2_MAP is not useful. To deal with BYT_RT5651_IN2_MAP wrongly mapping the headset mic to IN1, BYT_RT5651_IN2_HS_IN3_MAP was added in commit f026e0631780 ("ASoC: Intel: bytcr_rt5651: Add new IN2_HS_IN3 input map and a quirk using it"). This was based on the assumption then some devices have the internal mic connected to IN2 only. Further testing has shown that this is wrong and the internal mic is always connected to IN1 and sometimes to both IN1 and IN2. TL;DR: Both BYT_RT5651_IN2_MAP and BYT_RT5651_IN2_HS_IN3_MAP are based on on wrong assumptions from the past and are no longer useful now, so they can both be removed. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 366780df3e2d40533cc95a4bf25ddd3b934b5fd3 Author: Hans de Goede Date: Sun Jun 24 16:06:28 2018 +0200 ASoC: Intel: bytcr_rt5651: Fix IN1_IN2_MAP quirk not being logged Fix the quirk logging code not logging the IN1_IN2_MAP quirk. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 10876d24eb40c6bfaa0aabd97e3e143258176c53 Author: Hans de Goede Date: Sun Jun 24 16:06:27 2018 +0200 ASoC: Intel: bytcr_rt5651: Change default input map from in2 to in1 Further testing on all 6 model x86 tablets with a rt5651 which I have access to for testing has shown that their single (mono) microphone is connected to both IN1 *and* IN2. The previous default mapping of IN2 was based on testing on the same 6 tablets, where the internal mic works fine with a mapping of IN2. But it works fine too with a mapping of IN1. This commit changes the default input mapping to to use IN1 instead of IN2, to match the mapping used for the other mono devices in the DMI quirk table. So that we need less different mappings. The same change is made to the Chuwi Vi8 Plus quirks, which is one of the 6 models tested. This is a preparation patch for simplifying the maps in a follow-up commit. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit fc7c460fbb4003bf3f5d2b435079c85888644663 Author: Hans de Goede Date: Sun Jun 24 16:06:26 2018 +0200 ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_DEFAULT_QUIRKS define Almost all boards use the mclk and use the same jack-detect settings, add a BYT_RT5651_DEFAULT_QUIRKS define for this. This shaves of some lines and makes it easier to see which settings are unique to a certain model. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 4729bef965e5309295b1e01a04b3248ce3060800 Author: David Lechner Date: Thu May 31 15:25:48 2018 -0500 ARM: dts: da850-lego-ev3: Add Bluetooth nodes This adds nodes for describing the Bluetooth chip and connections on LEGO MINDSTORMS EV3 to da850-lego-ev3.dts. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 097f0987eb81e6156ea759194481f770c1b64183 Author: David Lechner Date: Tue Jun 26 10:28:17 2018 -0500 ARM: dts: da850: Add power-domains to PWM nodes This adds the power-domains property to both the ECAP and EHRPWM PWM nodes. Both have drivers that use pm_runtime to enable the clocks, so they need this property in order to find and enable the clock properly. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 401caff70cd3d3ef3c96e1a1cbf6f973c24ba899 Author: Takashi Iwai Date: Wed Jun 27 11:43:09 2018 +0200 ALSA: hda - Kill snd_hda_codec_update_cache() snd_hda_codec_update_cache() used to serve for a slightly different purpose from snd_hdac_write_cache(), but now both of them became identical. Let's unify and replace with the latter one consistently. Signed-off-by: Takashi Iwai commit a7f7547f5e2b90554b0f3d1604899a4f26dba92d Author: Andrey Ignatov Date: Tue Jun 26 14:22:41 2018 -0700 selftests/bpf: Test sys_connect BPF hooks with TFO TCP Fast Open is triggered by sys_sendmsg with MSG_FASTOPEN flag for SOCK_STREAM socket. Even though it's sys_sendmsg, it eventually calls __inet_stream_connect the same way sys_connect does for TCP. __inet_stream_connect, in turn, already has BPF hooks for sys_connect. That means TFO is already covered by BPF_CGROUP_INET{4,6}_CONNECT and the only missing piece is selftest. The patch adds selftest for TFO. Signed-off-by: Andrey Ignatov Signed-off-by: Daniel Borkmann commit 0d0f6249058834ffe1ceaad0bb31464af66f6e7a Author: Vlastimil Babka Date: Fri Jun 22 17:39:33 2018 +0200 x86/speculation/l1tf: Protect PAE swap entries against L1TF The PAE 3-level paging code currently doesn't mitigate L1TF by flipping the offset bits, and uses the high PTE word, thus bits 32-36 for type, 37-63 for offset. The lower word is zeroed, thus systems with less than 4GB memory are safe. With 4GB to 128GB the swap type selects the memory locations vulnerable to L1TF; with even more memory, also the swap offfset influences the address. This might be a problem with 32bit PAE guests running on large 64bit hosts. By continuing to keep the whole swap entry in either high or low 32bit word of PTE we would limit the swap size too much. Thus this patch uses the whole PAE PTE with the same layout as the 64bit version does. The macros just become a bit tricky since they assume the arch-dependent swp_entry_t to be 32bit. Signed-off-by: Vlastimil Babka Signed-off-by: Thomas Gleixner Acked-by: Michal Hocko commit 1e54ad251a93a524f1a2950b1d65bc7437c57a53 Author: Toke Høiland-Jørgensen Date: Mon Jun 25 14:25:02 2018 +0200 samples/bpf: Add xdp_sample_pkts example Add an example program showing how to sample packets from XDP using the perf event buffer. The example userspace program just prints the ethernet header for every packet sampled. Reviewed-by: Jakub Kicinski Signed-off-by: Toke Høiland-Jørgensen Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit 22adedd304668f0a2001284ddf225b49e9c05c64 Author: Toke Høiland-Jørgensen Date: Mon Jun 25 14:25:02 2018 +0200 trace_helpers.c: Add helpers to poll multiple perf FDs for events Add two new helper functions to trace_helpers that supports polling multiple perf file descriptors for events. These are used to the XDP perf_event_output example, which needs to work with one perf fd per CPU. Reviewed-by: Jakub Kicinski Signed-off-by: Toke Høiland-Jørgensen Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit cc0dff6dc3b44e33cd6b935893db66563ef15ba0 Author: Jiong Wang Date: Tue Jun 26 19:48:52 2018 -0700 nfp: bpf: allow source ptr type be map ptr in memcpy optimization Map read has been supported on NFP, this patch enables optimization for memcpy from map to packet. This patch also fixed one latent bug which will cause copying from unexpected address once memcpy for map pointer enabled. The fixed code path was not exercised before. Reported-by: Mary Pham Reported-by: David Beckett Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski Acked-by: Song Liu Signed-off-by: Daniel Borkmann commit 8e326289e3069dfc9fa9c209924668dd031ab8ef Author: Roopa Prabhu Date: Mon Jun 25 20:32:53 2018 -0700 neighbour: force neigh_invalidate when NUD_FAILED update is from admin In systems where neigh gc thresh holds are set to high values, admin deleted neigh entries (eg ip neigh flush or ip neigh del) can linger around in NUD_FAILED state for a long time until periodic gc kicks in. This patch forces neigh_invalidate when NUD_FAILED neigh_update is from an admin. Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 77bc8c28ddac90287bc42c129002eb703288d550 Author: Lucas Stach Date: Mon Jun 18 17:32:30 2018 +0200 ARM: mvebu: convert secondary CPU clock sync to hotplug state The current call site in boot_secondary is causing sleep in invalid context warnings, as this part of the code is running with interrrupts disabled and some of the calls into the clock framework might sleep on a mutex. Convert the secondary CPU clock sync to a hotplug state, which allows to call it from a sleepable context. Signed-off-by: Lucas Stach Signed-off-by: Gregory CLEMENT commit d0d378ff451a66e486488eec842e507d28145813 Author: Ethan Tuttle Date: Tue Jun 19 21:31:08 2018 -0700 ARM: mvebu: declare asm symbols as character arrays in pmsu.c With CONFIG_FORTIFY_SOURCE, memcpy uses the declared size of operands to detect buffer overflows. If src or dest is declared as a char, attempts to copy more than byte will result in a fortify_panic(). Address this problem in mvebu_setup_boot_addr_wa() by declaring mvebu_boot_wa_start and mvebu_boot_wa_end as character arrays. Also remove a couple addressof operators to avoid "arithmetic on pointer to an incomplete type" compiler error. See commit 54a7d50b9205 ("x86: mark kprobe templates as character arrays, not single characters") for a similar fix. Fixes "detected buffer overflow in memcpy" error during init on some mvebu systems (armada-370-xp, armada-375): (fortify_panic) from (mvebu_setup_boot_addr_wa+0xb0/0xb4) (mvebu_setup_boot_addr_wa) from (mvebu_v7_cpu_pm_init+0x154/0x204) (mvebu_v7_cpu_pm_init) from (do_one_initcall+0x7c/0x1a8) (do_one_initcall) from (kernel_init_freeable+0x1bc/0x254) (kernel_init_freeable) from (kernel_init+0x8/0x114) (kernel_init) from (ret_from_fork+0x14/0x2c) Signed-off-by: Ethan Tuttle Tested-by: Ethan Tuttle Signed-off-by: Gregory CLEMENT commit 1d1de580a3e0b1cfacd63b4093573d8f327b0a1a Author: Johan Hovold Date: Tue Jun 26 15:43:13 2018 +0200 USB: serial: digi_acceleport: rename tty flag variable Add a "tty_" prefix to the tty "flag" variable to avoid any future mixups with the recently added irq-mask "flags" one. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit b30408d7a38356e4d6b4f913686b25401fae386c Author: Leon Romanovsky Date: Sun Jun 24 11:23:46 2018 +0300 net/mlx5: Rate limit errors in command interface Any error status returned by FW will trigger a print similar to the following error message in the dmesg. [ 55.884355] mlx5_core 0000:00:04.0: mlx5_cmd_check:712:(pid 555): ALLOC_UAR(0x802) op_mod(0x0) failed, status limits exceeded(0x8), syndrome (0x0) Those prints are extremely valuable to diagnose issues with running system and it is important to keep them. However, not-so-careful user can trigger endless number of such prints by depleting HW resources and will spam dmesg. Rate limiting of such messages solves this issue. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b1a5046b2497e39cea9eb585358f3749442fb3f7 Merge: 3463e51dc337 18ec44f6effb Author: David S. Miller Date: Wed Jun 27 10:42:13 2018 +0900 Merge branch 'Multipath-tests-for-tunnel-devices' Petr Machata says: ==================== Multipath tests for tunnel devices This patchset adds a test for ECMP and weighted ECMP between two GRE tunnels. In patches #1 and #2, the function multipath_eval() is first moved from router_multipath.sh to lib.sh for ease of reuse, and then fixed up. In patch #3, the function tc_rule_stats_get() is parameterized to be useful for egress rules as well. In patch #4, a new function __simple_if_init() is extracted from simple_if_init(). This covers the logic that needs to be done for the usual interface: VRF migration, upping and installation of IP addresses. Patch #5 then adds the test itself. Additionally in patch #6, a requirement to add diagrams to selftests is documented. ==================== Signed-off-by: David S. Miller commit 18ec44f6effbd7bd6f7ec95e8ccd324b05219224 Author: Petr Machata Date: Tue Jun 26 02:08:17 2018 +0200 selftests: forwarding: README: Require diagrams ASCII art diagrams are well suited for presenting the topology that a test uses while being easy to embed directly in the test file iteslf. They make the information very easy to grasp even for simple topologies, and for more complex ones they are almost essential, as figuring out the interconnects from the script itself proves to be difficult. Therefore state the requirement for topology ASCII art in README. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 54818c4c4b9379f942db7d19e5ff23fb08f6bc79 Author: Petr Machata Date: Tue Jun 26 02:08:05 2018 +0200 selftests: forwarding: Test multipath tunneling Add a GRE-tunneling test such that there are two tunnels involved, with a multipath route listing both as next hops. Similarly to router_multipath.sh, test that the distribution of traffic to the tunnels honors the configured weights. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 3368b22379d67a92b0da8f2a76a6f0764177601d Author: Petr Machata Date: Tue Jun 26 02:08:00 2018 +0200 selftests: forwarding: lib: Extract interface-init functions The function simple_if_init() does two things: it creates a VRF, then moves an interface into this VRF and configures addresses. The latter comes in handy when adding more interfaces into a VRF later on. The situation is similar for simple_if_fini(). Therefore split the interface remastering and address de/initialization logic to a new pair of helpers __simple_if_init() / __simple_if_fini(), and defer to these helpers from simple_if_init() and simple_if_fini(). Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit a66d62d84225e1c2debaa238cff07a7df86c5aa8 Author: Petr Machata Date: Tue Jun 26 02:07:45 2018 +0200 selftests: forwarding: tc_rule_stats_get: Parameterize direction The GRE multipath tests need stats on an egress counter. Change tc_rule_stats_get() to take direction as an optional argument, with default of ingress. Take the opportunity to change line continuation character from | to \. Move the | to the next line, which indent. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 1b86fa3bbacef0a8e9961257557801ab1b5bef78 Author: Petr Machata Date: Tue Jun 26 02:07:08 2018 +0200 selftests: forwarding: multipath_eval(): Improve style - Change the indentation of the function body from 7 spaces to one tab. - Move initialization of weights_ratio up so that it can be referenced from the error message about packet difference being zero. - Move |'s consistently to continuation line, which reindent. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit b2c478723c7f8fa78d4fbdb9d7de4191249b92e0 Author: Petr Machata Date: Tue Jun 26 02:06:06 2018 +0200 selftests: forwarding: Move multipath_eval() to lib.sh This function will be useful for the GRE multipath test that is coming later. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 3463e51dc337ddd6e608fd595130398e9c60680f Author: Kees Cook Date: Mon Jun 25 16:55:05 2018 -0700 net/tls: Remove VLA usage on nonce It looks like the prior VLA removal, commit b16520f7493d ("net/tls: Remove VLA usage"), and a new VLA addition, commit c46234ebb4d1e ("tls: RX path for ktls"), passed in the night. This removes the newly added VLA, which happens to have its bounds based on the same max value. Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 00c8f19463ab42d22332fc9c9fca605f12eadeb7 Author: José Roberto de Souza Date: Tue Jun 26 13:16:44 2018 -0700 drm/i915/psr: Enable CRC check in the static frame on the sink side Sink can be configured to calculate the CRC over the static frame and compare with the CRC calculated and transmited in the VSC SDP by source, if there is a mismatch sink will do a short pulse in HPD and set DP_PSR_LINK_CRC_ERROR in DP_PSR_ERROR_STATUS. Spec: 7723 v6: andling DP_PSR_LINK_CRC_ERROR here and remove "bdw+" from commit message v4: patch moved to after 'drm/i915/psr: Avoid PSR exit max time timeout' to avoid touch in 2 patches EDP_PSR_DEBUG. v3: disabling PSR instead of exiting on error Reviewed-by: Dhinakaran Pandiyan Cc: Rodrigo Vivi Signed-off-by: José Roberto de Souza Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180626201644.21932-5-jose.souza@intel.com commit 3ebe3df50bb1db45c7bf1ce90c3d61c4eed1ba84 Author: José Roberto de Souza Date: Tue Jun 26 13:16:43 2018 -0700 drm/i915/psr: Avoid PSR exit max time timeout Specification requires that max time should be masked from bdw and forward but it can be also safely enabled to hsw. This will make PSR exits more deterministic and only when really needed. If this was used to fix a issue in some panel than can only self-refresh for a few seconds, that panel will interrupt and assert one of the PSR errors handled in: 'drm/i915/psr: Handle PSR RFB storage error' and 'drm/i915/psr: Begin to handle PSR/PSR2 errors set by sink' Spec: 21664 v4: patch moved to before 'drm/i915/psr/bdw+: Enable CRC check in the static frame on the sink side' to avoid touch in 2 patches EDP_PSR_DEBUG. Cc: Rodrigo Vivi Reviewed-by: Dhinakaran Pandiyan Signed-off-by: José Roberto de Souza Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180626201644.21932-4-jose.souza@intel.com commit 93bf76ed882d5b7c6824e95d868d608f61b4f663 Author: José Roberto de Souza Date: Tue Jun 26 13:16:42 2018 -0700 drm/i915/psr: Handle PSR errors Sink will interrupt source when it have any PSR error. DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR is a PSR2 but already handling it here. The only missing error to be handled is DP_PSR_LINK_CRC_ERROR that will be taken in care in a futher patch. v6: not handling DP_PSR_LINK_CRC_ERROR here v5: handling all PSR errors here, so the commit message and comment have changed v3: disabling PSR instead of exiting on error Cc: Rodrigo Vivi Reviewed-by: Dhinakaran Pandiyan Signed-off-by: José Roberto de Souza Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180626201644.21932-3-jose.souza@intel.com commit cc3054ff6214f6d14d35ffe629ff8d5032ace7f7 Author: José Roberto de Souza Date: Tue Jun 26 13:16:41 2018 -0700 drm/i915/psr: Begin to handle PSR/PSR2 errors set by sink eDP spec states that sink device will do a short pulse in HPD line when there is a PSR/PSR2 error that needs to be handled by source, this is handling the first and most simples error: DP_PSR_SINK_INTERNAL_ERROR. Here taking the safest approach and disabling PSR(at least until the next modeset), to avoid multiple rendering issues due to bad pannels. v5: added lockdep_assert in psr_disable and renamed psr_disable() to intel_psr_disable_locked() v4: Using CAN_PSR instead of HAS_PSR in intel_psr_short_pulse v3: disabling PSR instead of exiting on error Reviewed-by: Dhinakaran Pandiyan Cc: Rodrigo Vivi Signed-off-by: José Roberto de Souza Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180626201644.21932-2-jose.souza@intel.com commit 42f53ffcad7fcf11b5767767dd0c0ff607d99787 Author: José Roberto de Souza Date: Tue Jun 26 13:16:40 2018 -0700 drm/i915/psr: Remove intel_crtc_state parameter from disable_source() It was only used in VLV/CHV so after the removal of the PSR support for those platforms it is not necessary any more. v7: Rebased Reviewed-by: Dhinakaran Pandiyan Cc: Rodrigo Vivi Signed-off-by: José Roberto de Souza Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180626201644.21932-1-jose.souza@intel.com commit ced8025b569e21c31b52cc80410ed49d0bf13368 Author: Dennis Gilmore Date: Tue Jun 5 17:15:45 2018 -0500 ARM: dts: armada388-helios4 The helios4 is a Armada388 based nas board designed by SolidRun and based on their SOM. It is sold by kobol.io the dts file came from https://raw.githubusercontent.com/armbian/build/master/patch/kernel/mvebu-default/95-helios4-device-tree.patch I added a SPDX license line to match the clearfog it says it was based on and a compatible line for "kobol,helios4" Signed-off-by: Dennis Gilmore Signed-off-by: Gregory CLEMENT commit 22613c29502a82940ffa8ea81df230d665e9e50a Author: Baruch Siach Date: Sun Jun 24 08:28:17 2018 +0300 arm64: dts: marvell: mcbin: fix eth3 connector name The right most SFP connector on the Macchiatobin board and schematics is marked as CON13/CON14. Signed-off-by: Baruch Siach Signed-off-by: Gregory CLEMENT commit a334e45dcbff66ccbb6085ce5fdc2fcd861cc788 Author: Florian Fainelli Date: Fri May 11 15:02:42 2018 -0700 soc: bcm: brcmstb: Add missing DDR MEMC compatible strings We would not be matching the following chip/compatible strings combinations, which would lead to not setting the warm boot flag correctly, fix that: 7260A0/B0: brcm,brcmstb-memc-ddr-rev-b.2.1 7255A0: brcm,brcmstb-memc-ddr-rev-b.2.3 7278Bx: brcm,brcmstb-memc-ddr-rev-b.3.1 The B2.1 core (which is in 7260 A0 and B0) doesn't have the SHIMPHY_ADDR_CNTL_0_DDR_PAD_CNTRL setup in the memsys init code, nor does it have the warm boot flag re-definition on entry. Those changes were for B2.2 and later MEMSYS cores. Fall back to the previous S2/S3 entry method for these specific chips. Fixes: 0b741b8234c8 ("soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)") Reviewed-by: Rob Herring Signed-off-by: Florian Fainelli commit 77d899631d8aeb2aed0beae24a6e5a7e5c880505 Author: Doug Berger Date: Fri May 11 15:02:41 2018 -0700 soc: bcm: brcmstb: pm: Add support for newer rev B3.0 controllers Update the Device Tree binding document and add a matching entry for the MEMC DDR controller revision B3.0 which is found on chips like 7278A0 and newer. Signed-off-by: Doug Berger [florian: tweak commit message, make it apply to upstream kernel] Reviewed-by: Rob Herring Signed-off-by: Florian Fainelli commit a0061fc283bc4f8ac5f7f4b717ca089100124518 Author: Pramod Kumar Date: Fri Jun 1 17:56:08 2018 -0700 arm64: dts: Update Stingray clock DT nodes Update clock output names in the Stingray clock DT nodes so they match the binding document and the latest ASIC datasheet. Also add entries for LCPLL2 Signed-off-by: Pramod Kumar Signed-off-by: Ray Jui Signed-off-by: Florian Fainelli commit 8dd970a2cd7fcca44acec30aaaeee19f1e2bd6de Author: Scott Branden Date: Wed May 23 13:17:10 2018 -0700 arm64: dts: stingray: Add OTP device node Add OTP device node for Stingray SOC. Signed-off-by: Scott Branden Signed-off-by: Florian Fainelli commit 22f969f351b4251acb7938a5741b5228ba77782e Author: Scott Branden Date: Tue May 22 11:55:42 2018 -0700 arm64: dts: stingray: move common board components to stingray-board-base Move common board components from base bcm958742 dtsi file to new stingray-board-base dtsi file so they can be shared between many stingray boards following common design. Signed-off-by: Scott Branden Signed-off-by: Florian Fainelli commit 1e169ca3c4e3fb9d23fa481d05bb1555626e0b5c Author: Colin Ian King Date: Thu Jun 21 19:15:24 2018 +0100 platform/x86: dell-smbios: make a function and a pointer static The function dell_smbios_smm_call and pointer platform_device are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: warning: symbol 'platform_device' was not declared. Should it be static? warning: symbol 'dell_smbios_smm_call' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Darren Hart (VMware) commit 58e73aa177850babb947555257fd4f79e5275cf1 Author: Takashi Iwai Date: Fri Jun 22 10:59:17 2018 +0200 platform/x86: ideapad-laptop: Apply no_hw_rfkill to Y20-15IKBM, too The commit 5d9f40b56630 ("platform/x86: ideapad-laptop: Add Y520-15IKBN to no_hw_rfkill") added the entry for Y20-15IKBN, and it turned out that another variant, Y20-15IKBM, also requires the no_hw_rfkill. Trim the last letter from the string so that it matches to both Y20-15IKBN and Y20-15IKBM models. Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1098626 Cc: Signed-off-by: Takashi Iwai Signed-off-by: Darren Hart (VMware) commit 937b62b44cb69ff6e4efcd15fe0ea0a21bc42203 Author: Mario Limonciello Date: Fri Jun 15 12:12:51 2018 -0500 platform/x86: dell-smbios-base: Support systems without tokens Some Dell servers can use dell-smbios but they don't support the token interface. Make it optional. Signed-off-by: Mario Limonciello Signed-off-by: Darren Hart (VMware) commit cb5c1978f7f40be7d55cfffa344b7e5e47cdf90f Author: Benjamin Berg Date: Wed Jun 20 15:49:27 2018 +0200 platform/x86: thinkpad_acpi: Add support for calculator hotkey The P52 has a keyboard which features a calculator key above the numpad. Add support for this the calculator key (0x1313). Signed-off-by: Benjamin Berg Acked-by: Henrique de Moraes Holschuh Signed-off-by: Darren Hart (VMware) commit 147288e63de8188c4f6d6653a0e1aa91066ccfbe Author: Azael Avalos Date: Fri Jun 15 11:46:27 2018 -0600 platform/x86: toshiba_acpi: Update KBD backlight LED on second gen laptops Second generation keyboard backlight (type 2) laptops can switch on the keyboard LED on their own via hardware/firmware, but the LED subsystem is unaware of such change since the LED interface was only being created on first generation keyboard backlight (type 1) laptops. This patch creates the LED interface for second gen keyboards and calls the *_hw_changed API whenever userspace changes the state of the keyboard backlight LED. While we are at it, remove an unneeded asignment to the acpi_dev struct under *_kbd_bl_work, and also update the kbd_event_generated variable in the main toshiba struct instead of the global struct. Signed-off-by: Azael Avalos [dvhart: correct int* and int compare with dev->kbd_mode] Signed-off-by: Darren Hart (VMware) commit c455daa4af3c3ee6e841fc9ed42024d6b8d50d66 Author: Bjorn Andersson Date: Tue Jun 26 07:11:59 2018 -0500 remoteproc: Introduce prepare and unprepare for subdevices On rare occasions a subdevice might need to prepare some hardware resources before a remote processor is booted, and clean up some state after it has been shut down. One such example is the IP Accelerator found in various Qualcomm platforms, which is accessed directly from both the modem remoteproc and the application subsystem and requires an intricate lockstep process when bringing the modem up and down. Tested-by: Fabien Dessenne Signed-off-by: Bjorn Andersson [elder@linaro.org: minor description and comment edits] Signed-off-by Alex Elder Signed-off-by: Bjorn Andersson commit 6f8b037308ea7511191b8280efc9d0d5b46c74fe Author: Alex Elder Date: Tue Jun 26 07:11:58 2018 -0500 remoteproc: rename subdev probe and remove functions Rename functions used when subdevices are started and stopped to reflect the new naming scheme. Tested-by: Fabien Dessenne Signed-off-by Alex Elder Signed-off-by: Bjorn Andersson commit 4902676f04acc20fe12e49f5f4916f2659c2a7bc Author: Bjorn Andersson Date: Tue Jun 26 07:11:57 2018 -0500 remoteproc: Make client initialize ops in rproc_subdev In preparation of adding the additional prepare and unprepare operations make the client responsible for filling out the function pointers of the rproc_subdev. This makes the arguments to rproc_add_subdev() more manageable, in particular when some of the functions are left out. Tested-by: Fabien Dessenne Signed-off-by: Bjorn Andersson [elder@linaro.org: added comment about assigning function pointers] Signed-off-by Alex Elder Signed-off-by: Bjorn Andersson commit be37b1e0fb100a369cfb7ebf016491dfb6c71987 Author: Bjorn Andersson Date: Tue Jun 26 07:11:56 2018 -0500 remoteproc: Make start and stop in subdev optional Some subdevices, such as glink ssr only care about the stop operation, so make the operations optional to reduce client code. Tested-by: Fabien Dessenne Signed-off-by: Bjorn Andersson Signed-off-by Alex Elder Signed-off-by: Bjorn Andersson commit 618fcff3742b4c62fea24bea1f01a2f002ed4b37 Author: Bjorn Andersson Date: Tue Jun 26 07:11:55 2018 -0500 remoteproc: Rename subdev functions to start/stop "start" and "stop" are more suitable names for how these two operations are used, and they fit better with the upcoming introduction of two additional operations in the struct. Tested-by: Fabien Dessenne Signed-off-by: Bjorn Andersson [elder@linaro.org: minor comment edits] Signed-off-by Alex Elder Signed-off-by: Bjorn Andersson commit c8d049896729423a979d2838175d251b9cfee3b5 Author: Baolin Wang Date: Fri Jun 22 16:09:05 2018 +0800 spi: sprd: Change to use devm_hwspin_lock_request_specific() Change to use devm_hwspin_lock_request_specific() instead of freeing the hwlock explicitly when unbound the device. Acked-by: Mark Brown Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson commit d4942c119c978f1c6649212d2e42696bef43dd27 Author: Baolin Wang Date: Fri Jun 22 16:09:04 2018 +0800 spi: sprd: Replace of_hwspin_lock_get_id() with of_hwspin_lock_get_id_byname() Now the hwlock core has supplied new function to get a specific hwlock id by one hwlock name, which is more clear for users. So change to use of_hwspin_lock_get_id_byname(). Acked-by: Mark Brown Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson commit 38ce606533385e56b9216cab2e1128930652c315 Author: Baolin Wang Date: Fri Jun 22 16:09:02 2018 +0800 hwspinlock: Fix one comment mistake Fix one comment mistake with correct function names. Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson commit 2ceda54c44530b8e46363b0b12201855da5fd631 Author: Baolin Wang Date: Fri Jun 22 16:09:01 2018 +0800 hwspinlock: Remove redundant config The hardware core can not be built as a module, so remove the redundant CONFIG_HWSPINLOCK_MODULE config. Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson commit c102780acdbc22e5f664cfaf760eaccffbd6c385 Author: Baolin Wang Date: Fri Jun 22 16:09:00 2018 +0800 hwspinlock: Add devm_xxx() APIs to register/unregister one hwlock controller This patch introduces devm_hwspin_lock_register() and devm_hwspin_lock_unregister() interfaces to help to register or unregister one hardware spinlock controller, that will help to simplify the cleanup code for hwspinlock drivers. Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson commit b03799b0cb35dbc39e89602b1203863e2a6e06bf Author: Bjorn Helgaas Date: Mon Jun 25 16:49:06 2018 -0500 PCI: shpchp: Separate existence of SHPC and permission to use it The shpchp driver registers for all PCI bridge devices. Its probe method should fail if either (1) the bridge doesn't have an SHPC or (2) the OS isn't allowed to use it (the platform firmware may be operating the SHPC itself). Separate these two tests into: - A new shpc_capable() that looks for the SHPC hardware and is applicable on all systems (ACPI and non-ACPI), and - A simplified acpi_get_hp_hw_control_from_firmware() that we call only when we already know an SHPC exists and there may be ACPI methods to either request permission to use it (_OSC) or transfer control to the OS (OSHP). acpi_get_hp_hw_control_from_firmware() is implemented when CONFIG_ACPI=y, but does nothing if the current platform doesn't support ACPI. Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 5e62d5ff1b9a6573d0d6b411893b1c17ccc21ce7 Author: Jason Gunthorpe Date: Sun Jun 24 16:57:50 2018 +0300 IB/mlx4: Create slave AH's directly Since slave GID's do not exist in the core gid table we can no longer use the core code to help do this without creating inconsistencies. Directly create the AH using mlx4 internal APIs. Signed-off-by: Jason Gunthorpe Reviewed-by: Jack Morgenstein Signed-off-by: Leon Romanovsky commit d9c44040ed05991bc43dddb7dbb043891b3bdb1f Author: Leon Romanovsky Date: Sun Jun 24 11:23:52 2018 +0300 RDMA/uverbs: Remove redundant check kern_spec->reserved is checked prior to calling kern_spec_to_ib_spec_filter() which makes this second check redundant. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 3a2e791c9456aab38a727b2b2558c08210f59f03 Author: Leon Romanovsky Date: Sun Jun 24 11:23:48 2018 +0300 RDMA/umem: Don't check for a negative return value of dma_map_sg_attrs() dma_map_sg_attrs() returns 0 on error and can't return a negative number (ensured by BUG_ON), so don't check. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a5cc9831af05e658543593abaee45a29d061bac4 Author: Leon Romanovsky Date: Sun Jun 24 11:23:47 2018 +0300 RDMA/uverbs: Don't overwrite NULL pointer with ZERO_SIZE_PTR Number of specs is provided by user and in valid case can be equal to zero. Such argument causes to call to kcalloc() with zero-length request and in return the ZERO_SIZE_PTR is assigned. This pointer is different from NULL and makes various if (..) checks to success. Fixes: b6ba4a9aa59f ("IB/uverbs: Add support for flow counters") Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4f1acd758b08d93306d13010c74d38dd8d9f5768 Author: Baolin Wang Date: Fri Jun 22 16:08:59 2018 +0800 hwspinlock: Add devm_xxx() APIs to request/free hwlock This patch introduces some devm_xxx() APIs to help to request or free the hwlocks, which will help to simplify the cleanup code for drivers requesting one hwlock, ensuring that the hwlock is automatically freed whenever the device is unbound. Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson commit 5560f70cad996e7d90d1c141bcbca0df214eefc9 Author: Baolin Wang Date: Fri Jun 22 16:08:58 2018 +0800 hwspinlock: Add one new API to support getting a specific hwlock by the name The hardware spinlock binding already supplied the 'hwlock-names' property to match and get a specific hwlock, but did not supply one API for users to get a specific hwlock by the hwlock name. So this patch introduces one API to support this requirement. Signed-off-by: Baolin Wang Signed-off-by: Bjorn Andersson commit 8c42b1f39fdf9fde7cfc4024397255f31a860db6 Author: Paul E. McKenney Date: Mon Apr 9 11:04:46 2018 -0700 rcu: Exclude near-simultaneous RCU CPU stall warnings There is a two-jiffy delay between the time that a CPU will self-report an RCU CPU stall warning and the time that some other CPU will report a warning on behalf of the first CPU. This has worked well in the past, but on busy systems, it is possible for the two warnings to overlap, which makes interpreting them extremely difficult. This commit therefore uses a cmpxchg-based timing decision that allows only one report in a given one-minute period (assuming default stall-warning Kconfig parameters). This approach will of course fail if you are seeing minute-long vCPU preemption, but in that case the overlapping RCU CPU stall warnings are the least of your worries. Reported-by: Dmitry Vyukov Signed-off-by: Paul E. McKenney commit ce11fae8d43fe9a36823fbbfe7c44de775b7e346 Author: Boqun Feng Date: Fri Mar 9 09:32:18 2018 +0800 rcu: Use the proper lockdep annotation in dump_blkd_tasks() Sparse reported this: | kernel/rcu/tree_plugin.h:814:9: warning: incorrect type in argument 1 (different modifiers) | kernel/rcu/tree_plugin.h:814:9: expected struct lockdep_map const *lock | kernel/rcu/tree_plugin.h:814:9: got struct lockdep_map [noderef] * This is caused by using vanilla lockdep annotations on rcu_node::lock, and that requires accessing ->lock of rcu_node directly. However we need to keep rcu_node::lock __private to avoid breaking its extra ordering guarantee. And we have a dedicated lockdep annotation for rcu_node::lock, so use it. Signed-off-by: Boqun Feng Signed-off-by: Paul E. McKenney commit 4bc8d55574dd316e43975651b9259c5c18d741fc Author: Paul E. McKenney Date: Mon Nov 27 15:13:56 2017 -0800 rcu: Add debugging info to assertion The WARN_ON_ONCE(rcu_preempt_blocked_readers_cgp()) in rcu_gp_cleanup() triggers (inexplicably, of course) every so often. This commit therefore extracts more information. Signed-off-by: Paul E. McKenney commit bcc233b2aa7878bdcfbad6505ac66383a82a73dd Author: Dhinakaran Pandiyan Date: Tue Jun 26 02:05:22 2018 -0700 drm/i915/psr: Warn for erroneous enabling of both PSR1 and PSR2. Depending whether PSR1 or PSR2 was configured, we print a warning if the corresponding control mmio indicated PSR was erroneously enabled. As Chris pointed out, it makes more sense to check for both the mmio's since we expect neither PSR1 nor PSR2 to be enabled when psr_activate() is called. v2: Read PSR2 control register only on supported platforms (Rodrigo) Cc: Rodrigo Vivi Cc: Chris Wilson Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180626090522.17682-1-dhinakaran.pandiyan@intel.com commit c12e0643a05d978657877630d4da1ace06ea3720 Author: Dhinakaran Pandiyan Date: Sun Jun 24 22:47:40 2018 -0700 drm/i915/psr: Fix race in intel_psr_work() Commit 5422b37c907e ("drm/i915/psr: Kill delays when activating psr back.") switched from delayed work to the plain variant and while doing so removed the check for work_busy() before scheduling a PSR activation. This appears to cause consecutive executions of psr_activate() in this scenario - after a worker picks up the PSR work item for execution and before the work function can acquire the PSR mutex, a psr_flush() can get hold of the mutex and schedule another PSR work. Without a psr_exit() between the two psr_activate() calls, warning messages get printed. Further, since we drop the mutex in the midst of psr_work() to wait for PSR to idle, another work item can also get scheduled. Fix this by returning if PSR was already active. Fixes: 5422b37c907e ("drm/i915/psr: Kill delays when activating psr back.") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106948 Cc: Rodrigo Vivi Cc: Chris Wilson Cc: José Roberto de Souza Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Chris Wilson Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180625054741.3919-1-dhinakaran.pandiyan@intel.com commit cf5d862db2e301b8e487f42f99c5cf6f5228ddae Author: Rodrigo Vivi Date: Mon Jun 25 22:25:36 2018 -0700 drm/i915/psr: Kill useless function pointers. At some point we introduced the function pointers on PSR code to help with VLV/CHV separation logic because it had a different HW implementation from PSR. Since all converged to HSW PSR and we dropped the VLV/CHV support, let's also kill the useless function pointers and leave the code cleaner. Cc: Dhinakaran Pandiyan Signed-off-by: Rodrigo Vivi Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180626052536.15137-1-rodrigo.vivi@intel.com commit 38853979e6dce8466a1f611cadebc0f00adb901b Author: Dave Gerlach Date: Tue Jun 26 10:05:17 2018 -0700 memory: ti-emif-sram: Add resume function to recopy sram code After an RTC+DDR cycle we lose sram context so emif pm functions present in sram are lost. We can check if the first byte of the original code in DDR contains the same first byte as the code in sram, and if they do not match we know we have lost context and must recopy the functions to the previous address to maintain PM functionality. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy Signed-off-by: Santosh Shilimkar commit 598831e6838d6808899926ca5ecbeeb519716fb5 Author: Murali Karicheri Date: Tue Jun 26 10:02:56 2018 -0700 ARM: keystone: k2g: enable micrel and dp83867 phys Enable micrel and dp83867 phys for K2G Boards in keystone_defconfig to support Network driver on these boards (K2G ICE and GP EVM). Signed-off-by: Murali Karicheri Signed-off-by: Santosh Shilimkar commit bf5ebea4812f01ef3aa73cdb8a01ca115797f43c Author: Vitaly Andrianov Date: Tue Jun 26 10:02:57 2018 -0700 ARM: dts: k2e: add dts node for k2e hw_rng driver This patch adds dts node for k2e hw_random generator driver Signed-off-by: Vitaly Andrianov Signed-off-by: Murali Karicheri Signed-off-by: Santosh Shilimkar commit 3d0b6bd8717b5faa318ce0bd7ec6c048355f950f Author: Vitaly Andrianov Date: Tue Jun 26 10:02:57 2018 -0700 ARM: dts: k2l: add dts node for k2l hw_rng driver This patch adds dts node for k2l hw_random generator driver Signed-off-by: Vitaly Andrianov [t-kristo@ti.com: added missing addresses from node identifiers] Signed-off-by: Tero Kristo Signed-off-by: Murali Karicheri Signed-off-by: Santosh Shilimkar commit 5653d72c72947ed69586d71e1e86d4a106e6af29 Author: Vitaly Andrianov Date: Tue Jun 26 10:02:56 2018 -0700 ARM: dts: k2hk: add dts node for k2hk hw_rng driver This patch adds dts node for k2hk hw_random generator driver Signed-off-by: Vitaly Andrianov [t-kristo@ti.com: added missing addresses from node identifiers] Signed-off-by: Tero Kristo Signed-off-by: Murali Karicheri Signed-off-by: Santosh Shilimkar commit 1fbaa958769458fee565703f3c2077b6e7c26093 Author: Murali Karicheri Date: Tue Jun 26 10:02:56 2018 -0700 ARM: dts: keystone-k2g-ice: Enable netcp network driver This patch adds dt bindings to enable netcp network driver on K2G ICE boards. This consists of enabling bindings for NSS qmss, pktdma, 2u ethss, mdio, pinmux and netcp devices as well as DP83867 phy. EVM hardware spec recommends to add 0.25 nsec delay in the tx direction and 2.25 nsec delay in the rx direction for internal delay in the clock path to be on the safer side. The board straps RX_DV/RX_CTRL pin of on board DP83867 phy in mode 1. The phy data manual disallows this. Add ti,dp83867-rxctrl-strap-quirk in the phy node to allow software to enable the workaround suggested for this incorrect strap setting. This ensures proper operation of this PHY. Signed-off-by: Murali Karicheri Signed-off-by: Santosh Shilimkar commit c95ca2c797b4604487128a4aa3d07a01d16a4664 Author: Murali Karicheri Date: Tue Jun 26 10:02:56 2018 -0700 ARM: dts: keystone-k2g-evm: Enable netcp network driver Add dt bindings to enable netcp network driver on K2G GP EVM. This consists of enabling bindings for nss qmss, pktdma, 2u ethss, mdio, pinmux and netcp devices. Signed-off-by: Murali Karicheri Signed-off-by: Santosh Shilimkar commit ca8e26a72dd1e1c2ead65e00abe94e87772c851e Author: Murali Karicheri Date: Tue Jun 26 10:02:56 2018 -0700 ARM: dts: k2g: add dt bindings to support network driver This patch add dt bindings to support network driver based on Network Sub System (NSS) found on k2g SoC. This consists of bindings for netcp node, nss qmss , pktdma, cpsw 2u version of ethss and mdio. In order to support transitioning between non-promiscuous and promiscuous modes in K2G's ethernet switch, netcp ALE needs to be enabled. Therefore this patch enables K2G's netcp ALE for that purpose. Signed-off-by: Murali Karicheri Signed-off-by: WingMan Kwok Signed-off-by: Grygorii Strashko Signed-off-by: Santosh Shilimkar commit 0c218e16a8501cfda30f498217b434976cb62fc5 Author: Mike Christie Date: Tue Jun 26 11:47:20 2018 -0500 scsi: tcmu: Don't pass KERN_ERR to pr_err Fix warning: smatch warnings: drivers/target/target_core_user.c:301 tcmu_genl_cmd_done() warn: KERN_* level not at start of string Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 328728630d9f2bf14b82ca30b5e47489beefe361 Author: Ming Lei Date: Sun Jun 24 22:03:27 2018 +0800 scsi: core: avoid host-wide host_busy counter for scsi_mq It isn't necessary to check the host depth in scsi_queue_rq() any more since it has been respected by blk-mq before calling scsi_queue_rq() via getting driver tag. Lots of LUNs may attach to same host and per-host IOPS may reach millions, so we should avoid expensive atomic operations on the host-wide counter in the IO path. This patch implements scsi_host_busy() via blk_mq_tagset_busy_iter() for reading the count of busy IOs for scsi_mq. It is observed that IOPS is increased by 15% in IO test on scsi_debug (32 LUNs, 32 submit queues, 1024 can_queue, libaio/dio) in a dual-socket system. [mkp: clarified commit message] Cc: Omar Sandoval , Cc: "Martin K. Petersen" , Cc: James Bottomley , Cc: Christoph Hellwig , Cc: Don Brace Cc: Kashyap Desai Cc: Mike Snitzer Cc: Hannes Reinecke Cc: Laurence Oberman Cc: Bart Van Assche Signed-off-by: Ming Lei Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c84b023a4c1461498abf0eda54f60e2fd64a1ca2 Author: Ming Lei Date: Sun Jun 24 22:03:26 2018 +0800 scsi: read host_busy via scsi_host_busy() No functional change. Just introduce scsi_host_busy() and replace the direct read of scsi_host->host_busy with this new API. Cc: Omar Sandoval , Cc: "Martin K. Petersen" , Cc: James Bottomley , Cc: Christoph Hellwig , Cc: Don Brace Cc: Kashyap Desai Cc: Mike Snitzer Cc: Hannes Reinecke Cc: Laurence Oberman Cc: Bart Van Assche Signed-off-by: Ming Lei Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2b33ab371e026cfcea4cbdf233c6b8776dde9ba8 Author: Bart Van Assche Date: Mon Jun 25 16:49:38 2018 -0700 scsi: sd: Remove a superfluous assignment Since blk_rq_bytes(req) returns req->__data_len, assigning that value to req->__data_len is superfluous. Hence remove that assignment. See also commit 5db44863b6eb ("[SCSI] sd: Implement support for WRITE SAME"). Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c2cdef95160440ed6291bc343139d958ba3261e4 Author: Bart Van Assche Date: Mon Jun 25 08:05:16 2018 -0700 scsi: qedi: Fix misleading indentation This patch avoids that smatch reports the following warnings: drivers/scsi/qedi/qedi_fw_api.c:129: init_sqe() warn: inconsistent indenting drivers/scsi/qedi/qedi_fw_api.c:137: init_sqe() warn: inconsistent indenting Signed-off-by: Bart Van Assche Cc: QLogic-Storage-Upstream@cavium.com Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 6bec4c3842cd7338973839683bbf96273c3b85f7 Author: Johannes Thumshirn Date: Mon Jun 25 13:20:59 2018 +0200 scsi: don't add scsi command result bytes Some drivers are ADDing the scsi command's result bytes instead of ORing them. While this can produce correct results it has unexpected side effects. Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c65be1a63f1df224c8f22d72b9ec824241ada585 Author: Johannes Thumshirn Date: Mon Jun 25 13:20:58 2018 +0200 scsi: core: check for equality of result byte values When evaluating a SCSI command's result using the field access macros, check for equality of the fields and not if a specific bit is set. This is a preparation patch, for reworking the results field in the SCSI command. Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 8e1695a07c7b28e2eb1c02cc01e2b8f5dd28bf87 Author: Douglas Gilbert Date: Sat Jun 23 12:22:20 2018 +0200 scsi: core: scsi_io_completion convert BUGs to WARNs The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 0d437906f6dca6167b37c8e1f6f6ec395bde6230 Author: Douglas Gilbert Date: Sat Jun 23 12:22:19 2018 +0200 scsi: core: scsi_io_completion hints on fastpath Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 4ae61c68f7d72d98e7e41a8d4ec21bbaa46b63d4 Author: Douglas Gilbert Date: Sat Jun 23 12:22:18 2018 +0200 scsi: core: add scsi_io_completion_reprep helper Since the action "reprep" is called from two places, rather than repeat the code, make a new scsi_io_completion helper with "reprep" as its suffix. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit da32baea17e36b2bd95cf38b07d1297daf1d98cf Author: Douglas Gilbert Date: Sat Jun 23 12:22:17 2018 +0200 scsi: core: add scsi_io_completion_action helper Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit ab83108460a2a0d71c5bb22830036c4646e94e63 Author: Douglas Gilbert Date: Sat Jun 23 12:22:16 2018 +0200 scsi: core: add scsi_io_completion_nz_result function Break out several intertwined paths when cmd->result is non zero and place them in the scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 1f7cbb8e4b04fd33325a5cb279693861e549c03b Author: Douglas Gilbert Date: Sat Jun 23 12:22:15 2018 +0200 scsi: core: scsi_io_completion: rename variables Change and add some variable names, adjust some associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 7e63b5a4a68309383868b3582e92c217ad8a5347 Author: Douglas Gilbert Date: Sat Jun 23 12:22:14 2018 +0200 scsi: core: scsi_io_completion: comment on end_request return scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit e2607484370ea1b3595a3c51485e66e0cbd17341 Author: Mike Christie Date: Fri Jun 22 16:40:23 2018 -0500 scsi: target: remove target_find_device target_find_device is no longer used, so remove it. Signed-off-by: Mike Christie Tested-by: Xiubo Li Signed-off-by: Martin K. Petersen commit bdaeedc1bea9e833196b5c7eb0ffd74edf9c863e Author: Mike Christie Date: Fri Jun 22 16:40:22 2018 -0500 scsi: tcmu: add module wide block/reset_netlink support This patch based on Xiubo's patches adds 2 tcmu attr to block and reset the netlink interface. It's used during userspace daemon reinitialization after the daemon has crashed while there is outstanding nl requests. The daemon can block the nl interface, kill outstanding requests in the kernel and then reopen the netlink socket and unblock it to allow new requests. [mkp: typo] Signed-off-by: Mike Christie Tested-by: Xiubo Li Signed-off-by: Martin K. Petersen commit 06add777bd0aa764a2252e80c46ecc55ddc29dd1 Author: Mike Christie Date: Fri Jun 22 16:40:21 2018 -0500 scsi: tcmu: misc nl code cleanup Some misc cleanup of the nl rework patches. 1. Fix space instead of tabs use and extra newline 2. Drop initializing variables to 0 when not needed 3. Just pass the skb_buff and msg_header pointers to tcmu_netlink_event_send. Signed-off-by: Mike Christie Tested-by: Xiubo Li Signed-off-by: Martin K. Petersen commit 9de3a1ef032a5ad5d7b642d625b6bd362b1989d6 Author: Mike Christie Date: Fri Jun 22 16:40:20 2018 -0500 scsi: tcmu: simplify nl interface Just return EBUSY if a nl request comes in while processing one. The upper layers do not support sending multiple create/remove requests at the same time (you cannot have a create and remove at the same time or do multiple creates or removes at the same time) and doing a reconfig while a create/remove is still executing does not make sense. Signed-off-by: Mike Christie Tested-by: Xiubo Li Signed-off-by: Martin K. Petersen commit 3228691ffec134353cb5bf6fb4342283e0243412 Author: Mike Christie Date: Fri Jun 22 16:40:19 2018 -0500 scsi: tcmu: track nl commands The next patch is going to fix the hung nl command issue so this adds a list of outstanding nl commands that we can later abort when the daemon is restarted. Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 0297e962907d98ece34188cb267d3313812b6e42 Author: Mike Christie Date: Fri Jun 22 16:40:18 2018 -0500 scsi: tcmu: delete unused __wait When this code changed, this was never cleaned up. Signed-off-by: Mike Christie Tested-by: Xiubo Li Signed-off-by: Martin K. Petersen commit 772c2917ff4e3b15c38f74e77062360e5ffd1308 Author: Takashi Iwai Date: Tue Jun 26 17:17:53 2018 +0200 ALSA: hda/realtek - Comprehensive model list for ALC882 & co More comprehensive list of model strings for ALC882 & co. Also corrected the subsection in models.rst, too. Signed-off-by: Takashi Iwai commit e43c44d62dbb4d8e2f217198142c97fce1a25ac1 Author: Takashi Iwai Date: Tue Jun 26 17:02:08 2018 +0200 ALSA: hda/realtek - Comprehensive model list for ALC262 Added a few missing entries for ALC262 model strings. All about specific hardwares. Signed-off-by: Takashi Iwai commit 03bf11c934c3ced43aa9be3cfb93962ab15d737b Author: Takashi Iwai Date: Tue Jun 26 16:56:41 2018 +0200 ALSA: hda/realtek - Comprehensive model list for ALC268 Add the missing entry for ALC268 model strings. Only "spdif" was missing, and that's it. Signed-off-by: Takashi Iwai commit a26d96c7802e09473d5997791829774ba4f7e867 Author: Takashi Iwai Date: Tue Jun 26 15:09:25 2018 +0200 ALSA: hda/realtek - Comprehensive model list for ALC259 & co Like the previous commit for ALC662, let's give more comprehensive list of model entries for ALC269 & co as well. Signed-off-by: Takashi Iwai commit aa3841b56b3b4f68d1e0a64941189ec932c4881b Author: Takashi Iwai Date: Tue Jun 26 07:42:40 2018 +0200 ALSA: hda/realtek - Comprehensive model list for ALC662 & co ALC662 and others have far more fixup entries than the model table. Let's add more model string entries so that user can test / debug without compiling kernels at each time. Signed-off-by: Takashi Iwai commit c4d6204dc1742581c0450d2ff6a058f61ea4f4ce Author: Arnd Bergmann Date: Mon Jun 18 17:28:23 2018 +0200 scsi: lpfc: use monotonic timestamps for statistics The get_seconds() function suffers from a possible overflow in 2038 or 2106, as well as jitter due to settimeofday or leap second updates, and is deprecated. As we are interested in elapsed time only, using ktime_get_seconds() to read the CLOCK_MONOTONIC timebase is ideal here. This also lets us remove the hack that tries to deal with get_seconds() going slightly backwards, which cannot happen with montonic timestamps. Signed-off-by: Arnd Bergmann Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit fe7f4e5d11541402f54ebd777a4f49caee891401 Author: Arnd Bergmann Date: Mon Jun 18 17:29:51 2018 +0200 scsi: scsi_transport_fc: use 64-bit timestamps consistently The get_seconds() helper returns an 'unsigned long' value, which can overflow on 32-bit architectures. Since the interface we pass it into already uses a 64-bit type, we can just use ktime_get_real_seconds() instead. While we generally prefer local timestamps in CLOCK_MONOTONIC format (ktime_get_seconds), this keeps using the CLOCK_REALTIME version in order to maintain compatibility with existing code. Signed-off-by: Arnd Bergmann Reviewed-by: Johannes Thumshirn Reviewed-by: Tyrel Datwyler Reviewed-by: James Smart Signed-off-by: Martin K. Petersen commit 38150f7a68ef736c4cbae53b6f1f2a19c55178a3 Author: Arnd Bergmann Date: Mon Jun 18 17:26:47 2018 +0200 scsi: aacraid: stop using deprated get_seconds() get_seconds() can overflow on 32-bit architectures and is deprecated because of that. The use in the aacraid driver has the same problem due to a limited firmware interface, it also overflows in the year 2106. This changes all calls to get_seconds() to the non-deprecated ktime_get_real_seconds(), which unfortunately doesn't solve that problem but gets rid of one user of the deprecated interface. [mkp: checkpatch] Signed-off-by: Arnd Bergmann Reviewed-by: Raghava Aditya Renukunta Signed-off-by: Martin K. Petersen commit 0e6995e3b37bac69b4a815a116f9992d31a7bba0 Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:24:40 2018 -0300 ALSA: Fix references to Documentation/.*/MultiSound Now that the documentation/script file got restored, fix the references within the Kernel tree. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Takashi Iwai commit 513f930667beca7f67e3aa4558196c143864083f Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:24:39 2018 -0300 ALSA: multisound.sh: update module namespace The modules for the cards described here changed their names. Update accordingly. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Takashi Iwai commit 06501a6d2d2912b9e357702327c0249a5ecd7c9e Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:24:38 2018 -0300 ALSA:: multisound.sh: fix script to make it build with modern tools The script is old and produce some warnings and errors, because it lacks including stdlib.h and io.h is at sys/io.h. Fix it to run with the tools found on modern Linux distros. Tested building it on Fedora 28. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Takashi Iwai commit 5c10ed433da26ff3509ae11c6b22d21e131484d8 Author: Mauro Carvalho Chehab Date: Tue Jun 26 06:24:37 2018 -0300 sound: restore MultiSound script This script is mentioned at multisound Kconfig and files. As the driver still exists, it probably makes sense to restore it. Fixes: 727dede0ba8a ("sound: Retire OSS") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Takashi Iwai commit 37912da4387f24368f4c91c5fd9685d0bf3ea4dc Author: Federico Vaga Date: Wed Jun 6 00:49:03 2018 +0200 doc:it_IT: translation for doc-guide This is the complete translation of 'doc-guide' in Italian. Please note that code comments will stay in English because thats the language that everyone should use to write comments. External files (svg, dot) are taken from Documentation/doc-guide instead of copying them into the Italian translation. Signed-off-by: Federico Vaga Signed-off-by: Alessia Mantegazza Signed-off-by: Jonathan Corbet commit 3ece641656ad6a392ee3a122700923972da53fe8 Author: Federico Vaga Date: Wed Jun 6 00:49:02 2018 +0200 doc: add Italian language skeleton Signed-off-by: Federico Vaga Signed-off-by: Jonathan Corbet commit aa586e25744ad0a481fdba2da05041af235c110d Author: Federico Vaga Date: Wed Jun 6 00:49:01 2018 +0200 doc: add some chapter labels The idea is to make it easier to create references (doc-guide does the same). This will be used, for example but not only, in translations to point to the main document. Signed-off-by: Federico Vaga Signed-off-by: Jonathan Corbet commit 85c32d9c6f3ebcb6807f2a6a54b2578cf281654a Author: Federico Vaga Date: Wed Jun 6 00:49:00 2018 +0200 doc: move away translations from top-level index In translations/ we have now a dedicated index.rst where we add/remove references to translations. Translations are in English alphabetical order. Signed-off-by: Federico Vaga Signed-off-by: Jonathan Corbet commit f3821276f62c80184f4b7543e423ec5c7f43bbe1 Author: Federico Vaga Date: Wed Jun 6 00:48:59 2018 +0200 doc:sphinx: fix parse-header description The description speaks about the option ``--man`` but it does not exist. Instead, there is the option ``--usage`` $ ./Documentation/sphinx/parse-headers.pl --man Unknown option: man Usage: parse_headers.pl [] [] Where can be: --debug, --help or --man. Signed-off-by: Federico Vaga Signed-off-by: Jonathan Corbet commit c1ec85ff408db77f5c97ae71b8854faed40e89f1 Author: Federico Vaga Date: Wed Jun 6 00:48:58 2018 +0200 doc:doc-guide: fix a typo and an error Fix a typo in sphinx.rst and a minor error in parse-header.rst Signed-off-by: Federico Vaga Signed-off-by: Jonathan Corbet commit fc1ca3d5b4b9532fff76fa21f7d22efdf02d38b7 Author: Yang Shi Date: Tue Jun 19 07:59:18 2018 +0800 doc: add description to dirtytime_expire_seconds commit 1efff914afac8a965ad63817ecf8861a927c2ace ("fs: add dirtytime_expire_seconds sysctl") introduced dirtytime_expire_seconds knob, but there is not description about it in Documentation/sysctl/vm.txt. Add the description for it. Cc: Theodore Ts'o Signed-off-by: Yang Shi Signed-off-by: Jonathan Corbet commit 83d4fcb3a0b36aafb0c9c1c625782a9db561f339 Author: Martin Kepplinger Date: Fri Jun 22 09:32:11 2018 +0200 Documentation: nommu-map: Fix duplicate word typo Signed-off-by: Martin Kepplinger Signed-off-by: Jonathan Corbet commit cccd289f12d0e827070c847b1ff96ba02eb20eaf Author: Randy Dunlap Date: Sat Jun 16 19:02:03 2018 -0700 Documentation/process: fix reST table border error Fix reST error in Documentation/process/: Documentation/process/2.Process.rst:131: ERROR: Malformed table. Bottom/header table border does not match top border. Fixes: 8962e40c1993 ("docs: update kernel versions and dates in tables") Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: Tim Bird Signed-off-by: Jonathan Corbet commit f339155a4063cf3177bb38f6e83760951148e86b Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:16 2018 +0100 ASoC: qdsp6: q6asm: remove unused struct q6asm member pcmdev in struct q6asm seems be left over and unused, so just remove it. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit 972562f7aaaa261ec6e1ac14fed0c5bdd0dfb1cb Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:15 2018 +0100 ASoC: qdsp6: q6routing: add proper error check q6adm_open can return error pointer or a null in error cases. Fix the return handling. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit 2d12c20b98ad610892151da37367f2d018181455 Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:14 2018 +0100 ASoC: qcom: apq8096: remove redundant owner assignment module owner is already set in platform_driver_register(), so remove this redundant assignment. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit f48bde4bfbcf434d6aef604c1c50d68b12a4bc45 Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:13 2018 +0100 ASoC: qdsp6: q6routing: support dt based module loading This patch uses new compatible string to make DT based module loading work. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit 1ce09ef36fb190fa207fdb3e31fc1c8caa292125 Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:12 2018 +0100 ASoC: qdsp6: q6asm-dai: support dt based module loading This patch uses new compatible string to make DT based module loading work. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit eb7cc9be6e9ce17e69252a6fc00e75a5b08201ab Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:11 2018 +0100 ASoC: qdsp6: q6afe-dai: support dt based module loading This patch uses new compatible string to make DT based module loading work. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit 01afbd45f78cb0557db18c3ba768eea3e9576cfd Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:10 2018 +0100 ASoC: qdsp6: q6afe: use of_platform_populate/depopulate() Now that the child nodes have there own compatible strings, Use of_platform_populate/depopulate() instead of less common of_platform_device_create()/destroy(). Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit 4aac7e2773030d667491fbb6d97c9f467fdcbc05 Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:09 2018 +0100 ASoC: qdsp6: q6asm: use of_platform_populate/depopulate() Now that the child nodes have there own compatible strings, Use of_platform_populate/depopulate() instead of less common of_platform_device_create()/destroy(). Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit f614c9b070ed149bbaac4edefb2b5fcb7755c4b0 Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:08 2018 +0100 ASoC: qdsp6: q6adm: use of_platform_populate/depopulate() Now that the child nodes have there own compatible strings, Use of_platform_populate/depopulate() instead of less common of_platform_device_create()/destroy(). Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit e43792c6e5027ad3f0280f5a2e6952b0d436b19b Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:07 2018 +0100 ASoC: q6afe: dt-bindings: add compatible string to dais Add compatible string to dais so that it can support DT based module autoloading. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit 9618b706672db1b595c7076389a833078335417c Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:06 2018 +0100 ASoC: q6asm: dt-bindings: add compatible string to dais Add compatible string to dais so that it can support DT based module autoloading. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit c486a185744c593417a126aebb119771c1bbe670 Author: Srinivas Kandagatla Date: Tue Jun 26 10:20:05 2018 +0100 ASoC: q6adm: dt-bindings: add compatible string to routing Add compatible string to routing so that it can support DT based module autoloading. Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel Signed-off-by: Mark Brown commit b66c9b911fe6ca188002b342b05c43deab4491a3 Author: Fabio Estevam Date: Tue Jun 26 08:58:35 2018 -0300 ASoC: soc-utils: Fix unregistration order The unregistration should happen in the opposite order of the registration, so change it accordingly. No real issue has been noticed, but it is good practice to keep the correct unregistration order. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown commit 27a2628b3c24ce8ef23bd393f5514f8f45188f08 Author: Petr Machata Date: Tue Jun 26 01:20:32 2018 +0200 selftests: forwarding: mirror_gre_vlan_bridge_1q: Unset rp_filter The IP addresses of tunnel endpoint at H3 are set at the VLAN device $h3.555. Therefore when test_gretap_untagged_egress() sets vlan 555 to egress untagged at $swp3, $h3's rp_filter rejects these packets. The test then spuriously fails. Therefore turn off net.ipv4.conf.{all, $h3}.rp_filter. Fixes: 9c7c8a82442c ("selftests: forwarding: mirror_gre_vlan_bridge_1q: Add more tests") Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 68cc444dab1e70e59a719b7bf44bcaacbffa7496 Author: Kees Cook Date: Mon Jun 25 15:49:49 2018 -0700 mdio-mux-gpio: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this allocates the values buffer during the callback instead of putting it on the stack. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a6e65e5d2ca4b1d3ff4ac03e056f82b6854ed50e Merge: 572de270f0a3 326367427cc0 Author: David S. Miller Date: Tue Jun 26 23:21:33 2018 +0900 Merge branch 'net-sched-support-replay-of-filter-offload-when-binding-to-block' Jakub Kicinski says: ==================== net: sched: support replay of filter offload when binding to block This series from John adds the ability to replay filter offload requests when new offload callback is being registered on a TC block. This is most likely to take place for shared blocks today, when a block which already has rules is bound to another interface. Prior to this patch set if any of the rules were offloaded the block bind would fail. A new tcf_proto_op is added to generate a filter-specific offload request. The new 'offload' op is supporting extack from day 0, hence we need to propagate extack to .ndo_setup_tc TC_BLOCK_BIND/TC_BLOCK_UNBIND and through tcf_block_cb_register() to tcf_block_playback_offloads(). The immediate use of this patch set is to simplify life of drivers which require duplicating rules when sharing blocks. Switch drivers (mlxsw) can bind ports to rule lists dynamically, NIC drivers generally don't have that ability and need the rules to be duplicated for each ingress they match on. In code terms this means that switch drivers don't register multiple callbacks for each port. NIC drivers do, and get a separate request and hance rule per-port, as if the block was not shared. The registration fails today, however, if some rules were already present. As John notes in description of patch 7, drivers which register multiple callbacks to shared blocks will likely need to flush the rules on block unbind. This set makes the core not only replay the the offload add requests but also offload remove requests when callback is unregistered. v2: - name parameters in patch 2; - use unsigned int instead of u32 for in_hw_coun; - improve extack message in patch 7. ==================== Signed-off-by: David S. Miller commit 326367427cc09d38e4c1d145131ee2e228ac94c5 Author: John Hurley Date: Mon Jun 25 14:30:10 2018 -0700 net: sched: call reoffload op on block callback reg Call the reoffload tcf_proto_op on all tcf_proto nodes in all chains of a block when a callback tries to register to a block that already has offloaded rules. If all existing rules cannot be offloaded then the registration is rejected. This replaces the previous policy of rejecting such callback registration outright. On unregistration of a callback, the rules are flushed for that given cb. The implementation of block sharing in the NFP driver, for example, duplicates shared rules to all devs bound to a block. This meant that rules could still exist in hw even after a device is unbound from a block (assuming the block still remains active). Signed-off-by: John Hurley Signed-off-by: Jakub Kicinski Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 7e916b76805f11c1686a43ab5ead9a9b1a0a5945 Author: John Hurley Date: Mon Jun 25 14:30:09 2018 -0700 net: sched: cls_bpf: implement offload tcf_proto_op Add the offload tcf_proto_op in cls_bpf to generate an offload message for each bpf prog in the given tcf_proto. Call the specified callback with this new offload message. The function only returns an error if the callback rejects adding a 'hardware only' prog. A prog contains a flag to indicate if it is in hardware or not. To ensure the offload function properly maintains this flag, keep a reference counter for the number of instances of the prog that are in hardware. Only update the flag when this counter changes from or to 0. Signed-off-by: John Hurley Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 530d995123fe647d28566d81ff9562fe6cbaff94 Author: John Hurley Date: Mon Jun 25 14:30:08 2018 -0700 net: sched: cls_u32: implement offload tcf_proto_op Add the offload tcf_proto_op in cls_u32 to generate an offload message for each filter and the hashtable in the given tcf_proto. Call the specified callback with this new offload message. The function only returns an error if the callback rejects adding a 'hardware only' rule. A filter contains a flag to indicate if it is in hardware or not. To ensure the offload function properly maintains this flag, keep a reference counter for the number of instances of the filter that are in hardware. Only update the flag when this counter changes from or to 0. Signed-off-by: John Hurley Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 0efd1b3a13bfabc8b70e79bd22aa413d6d2ad7a5 Author: John Hurley Date: Mon Jun 25 14:30:07 2018 -0700 net: sched: cls_matchall: implement offload tcf_proto_op Add the reoffload tcf_proto_op in matchall to generate an offload message for each filter in the given tcf_proto. Call the specified callback with this new offload message. The function only returns an error if the callback rejects adding a 'hardware only' rule. Ensure matchall flags correctly report if the rule is in hw by keeping a reference counter for the number of instances of the rule offloaded. Only update the flag when this counter changes from or to 0. Signed-off-by: John Hurley Signed-off-by: Jakub Kicinski Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 31533cba4327aefeafe8a7d57de0c737a3b2faa6 Author: John Hurley Date: Mon Jun 25 14:30:06 2018 -0700 net: sched: cls_flower: implement offload tcf_proto_op Add the reoffload tcf_proto_op in flower to generate an offload message for each filter in the given tcf_proto. Call the specified callback with this new offload message. The function only returns an error if the callback rejects adding a 'hardware only' rule. A filter contains a flag to indicate if it is in hardware or not. To ensure the reoffload function properly maintains this flag, keep a reference counter for the number of instances of the filter that are in hardware. Only update the flag when this counter changes from or to 0. Add a generic helper function to implement this behaviour. Signed-off-by: John Hurley Signed-off-by: Jakub Kicinski Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit e56185c78b500ac4d08768278ad8a25d5b756942 Author: John Hurley Date: Mon Jun 25 14:30:05 2018 -0700 net: sched: add tcf_proto_op to offload a rule Create a new tcf_proto_op called 'reoffload' that generates a new offload message for each node in a tcf_proto. Pointers to the tcf_proto and whether the offload request is to add or delete the node are included. Also included is a callback function to send the offload message to and the option of priv data to go with the cb. Signed-off-by: John Hurley Signed-off-by: Jakub Kicinski Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 60513bd82c825b659c05957e4f8106ba06f0797f Author: John Hurley Date: Mon Jun 25 14:30:04 2018 -0700 net: sched: pass extack pointer to block binds and cb registration Pass the extact struct from a tc qdisc add to the block bind function and, in turn, to the setup_tc ndo of binding device via the tc_block_offload struct. Pass this back to any block callback registrations to allow netlink logging of fails in the bind process. Signed-off-by: John Hurley Signed-off-by: Jakub Kicinski Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 572de270f0a38c6d6f329d494d3bf624e05f933b Merge: 2f533f6bd830 470103dc840e Author: David S. Miller Date: Tue Jun 26 23:15:43 2018 +0900 Merge branch 'sh_eth-RPADIR-related-clean-ups' Sergei Shtylyov says: ==================== sh_eth: RPADIR related clean-ups Here's a set of 2 patches against DaveM's 'net-next.git' repo. They are clean-ups related to RPADIR (DMA padding to NET_IP_ALIGN)... ==================== Signed-off-by: David S. Miller commit 470103dc840ec9cda91b5049d82f4bb599cea759 Author: Sergei Shtylyov Date: Mon Jun 25 23:37:06 2018 +0300 sh_eth: remove sh_eth_cpu_data::rpadir_value If RPADIR exists, the value written to it is always the same for all SoCs (and derived from NET_IP_ALIGN), so there has not been any need to store it in the *struct* sh_eth_cpu_data... Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit b13ca098fd35bb0cfbe027f2415a17a6ceb6f47f Author: Sergei Shtylyov Date: Mon Jun 25 23:36:21 2018 +0300 sh_eth: fix *enum* RPADIR_BIT The *enum* RPADIR_BIT was declared in the commit 86a74ff21a7a ("net: sh_eth: add support for Renesas SuperH Ethernet") adding SH771x support, however the SH771x manual doesn't have the RPADIR register described and, moreover, tells why the padding insertion must not be used. The newer SoC manuals do have RPADIR documented, though with somewhat different layout -- update the *enum* according to these manuals... Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit 2f533f6bd8300b11e8d941c9a8f51183a9d88c9c Author: Heiner Kallweit Date: Mon Jun 25 20:34:41 2018 +0200 r8169: reject unsupported WoL options So far unsupported WoL options are silently ignored. Change this and reject attempts to set unsupported options. This prevents situations where a user tries to set an unsupported WoL option and is under the impression it was successful because ethtool doesn't complain. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 99672eb6c63c5207e4e1a6283ec4fc46aafeb07c Author: Petr Machata Date: Mon Jun 25 16:43:55 2018 +0200 selftests: net: Test headroom handling of ip6_gre devices Commit 5691484df961 ("net: ip6_gre: Fix headroom request in ip6erspan_tunnel_xmit()") and commit 01b8d064d58b ("net: ip6_gre: Request headroom in __gre6_xmit()") fix problems in reserving headroom in the packets tunneled through ip6gre/tap and ip6erspan netdevices. These two patches included snippets that reproduced the issues. This patch elevates the snippets to a full-fledged test case. Suggested-by: David Miller Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 16572a48b46d9dbaa447501c058b4f74b62f09bd Merge: 1d7229ddc735 2685fbb8044f Author: David S. Miller Date: Tue Jun 26 22:55:52 2018 +0900 Merge branch 'l2tp-trivial-cleanups' Guillaume Nault says: ==================== l2tp: trivial cleanups Just a set of unrelated trivial cleanups (remove unused code, make local functions static, etc.). ==================== Signed-off-by: David S. Miller commit 2685fbb8044f9bd8d3b5de1fa7854fea655f2df6 Author: Guillaume Nault Date: Mon Jun 25 16:07:25 2018 +0200 l2tp: make l2tp_xmit_core() return void It always returns 0, and nobody reads the return value anyway. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 363a341d190bde3f6d5f2786feefb9f1a7a45b95 Author: Guillaume Nault Date: Mon Jun 25 16:07:24 2018 +0200 l2tp: avoid duplicate l2tp_pernet() calls Replace 'l2tp_pernet(tunnel->l2tp_net)' with 'pn', which has been set on the preceding line. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit d08532bb5080f234f1ac45f9fc909eb15f51834b Author: Guillaume Nault Date: Mon Jun 25 16:07:23 2018 +0200 l2tp: don't export l2tp_tunnel_closeall() This function is only used in l2tp_core.c. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 2e67560ef6c53dae273b7c5c47a2ab4fb1ba9b30 Author: Guillaume Nault Date: Mon Jun 25 16:07:22 2018 +0200 l2tp: don't export l2tp_session_queue_purge() This function is only used in l2tp_core.c. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit e484b1c227b6c661eba8ae424b271ed5b420ae4a Author: Guillaume Nault Date: Mon Jun 25 16:07:20 2018 +0200 l2tp: remove l2tp_tunnel_priv() This function, and the associated .priv field, are unused. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit c3612f0e901766e1caddabd18e0a34f0e6d82e20 Author: Guillaume Nault Date: Mon Jun 25 16:07:19 2018 +0200 l2tp: remove .show from struct l2tp_tunnel This callback has never been implemented. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 877375e4856c9d1b98aec30ff736896b333449e7 Author: Guillaume Nault Date: Mon Jun 25 16:07:18 2018 +0200 l2tp: remove pppol2tp_session_close() l2tp_core.c verifies that ->session_close() is defined before calling it. There's no need for a stub. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit a323f94611aac0f68b710048ae53c73a53b5c7b5 Author: John Ogness Date: Sun Jun 24 00:32:15 2018 +0200 USB: serial: usb_wwan: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit cf83be24b2efc423f6869a155372e3694c12a558 Author: John Ogness Date: Sun Jun 24 00:32:14 2018 +0200 USB: serial: ti_usb_3410_5052: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit 5e02bfcf3f4f8c76c47718063d408c8a09d61bca Author: John Ogness Date: Sun Jun 24 00:32:13 2018 +0200 USB: serial: symbolserial: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit 5ae79cf18dc1a97d8d0ab420fc4d3f8674bcf0e8 Author: Gustavo A. R. Silva Date: Mon Jun 25 07:33:55 2018 -0500 drm/gma500: Fix compile warning Fix the following compile warning: warning: unused variable ‘psbfb’ [-Wunused-variable] struct psb_framebuffer *psbfb = to_psb_fb(fb); Fixes: c7cbed560ce2 ("drm/gma500: Fix Medfield for drm_framebuffer move") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180625123355.GA16757@embeddedor.com commit 80c18ba11a7a84cb97e39e5c9b6cdeee9f3c0728 Author: Gustavo A. R. Silva Date: Mon Jun 25 07:18:44 2018 -0500 drm/gma500: Fix potential NULL pointer dereference fb is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving the pointer dereference after fb has been properly null checked at line 74: if (!fb) Addresses-Coverity-ID: 1470169 ("Dereference before null check") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180625121844.GA12466@embeddedor.com commit d4bf25b3fc250a5d950691e824bbfa7a732a6608 Author: John Ogness Date: Sun Jun 24 00:32:12 2018 +0200 USB: serial: sierra: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit 1d7229ddc73543d63d0b234ecdf15f8d709c7017 Merge: 651b4513bdd2 17ae0b0ee9db Author: David S. Miller Date: Tue Jun 26 22:15:15 2018 +0900 Merge branch 'DPAA-PTP-clock-and-timestamping' Yangbo Lu says: ==================== Support DPAA PTP clock and timestamping This patchset is to support DPAA FMAN PTP clock and HW timestamping. It had been verified on both ARM platform and PPC platform. - The patch #1 to patch #5 are to support DPAA FMAN 1588 timer in ptp_qoriq driver. - The patch #6 to patch #10 are to add HW timestamping support in DPAA ethernet driver. ==================== Signed-off-by: David S. Miller commit 17ae0b0ee9db4d553df186cfa2a92e0ac0225c44 Author: Yangbo Lu Date: Mon Jun 25 20:37:16 2018 +0800 dpaa_eth: add the get_ts_info interface for ethtool Added the get_ts_info interface for ethtool to check the timestamping capability. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit 4664856e9ca2e5061718d639bac2741464cf3d23 Author: Yangbo Lu Date: Mon Jun 25 20:37:15 2018 +0800 dpaa_eth: add support for hardware timestamping This patch is to add hardware timestamping support for dpaa_eth. On Rx, timestamping is enabled for all frames. On Tx, we only instruct the hardware to timestamp the frames marked accordingly by the stack. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit dcce36ab7130a6ed46e9a9cce8b7452bffd95966 Author: Yangbo Lu Date: Mon Jun 25 20:37:14 2018 +0800 fsl/fman: define frame description command UPD Defined frame description command FM_FD_CMD_UPD for prepended data updating. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit 880f874cf505681d3cfef867892ac15094afaf2b Author: Yangbo Lu Date: Mon Jun 25 20:37:13 2018 +0800 fsl/fman_port: support getting timestamp This patch is to add fman_port_get_tstamp() interface to get timestamp. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit 0fab782a28e41137a76ca1ebcd5ae8ed7900f8fc Author: Yangbo Lu Date: Mon Jun 25 20:37:12 2018 +0800 fsl/fman: add set_tstamp interface This patch is to add set_tstamp interface for memac, dtsec, and 10GEC controllers to configure HW timestamping. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit 9cd19b52e1c4ba3f097a6ccab9b7595e6b9fbd3c Author: Yangbo Lu Date: Mon Jun 25 20:37:11 2018 +0800 arm64: dts: fsl: move ptp timer out of fman This patch is to move ptp timer node out of fman. Because ptp timer will be probed by ptp_qoriq driver, it should be an independent device in case of conflict memory mapping. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit dab4a02630d5cb7628bed7f2a58354aca053eda7 Author: Yangbo Lu Date: Mon Jun 25 20:37:10 2018 +0800 powerpc/mpc85xx: move ptp timer out of fman in dts This patch is to move ptp timer node out of fman. Because ptp timer will be probed by ptp_qoriq driver, it should be an independent device in case of conflict memory mapping. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit 2cb785b4967aa56b0c4dc9742db413b76a373aa3 Author: Yangbo Lu Date: Mon Jun 25 20:37:09 2018 +0800 dt-binding: ptp_qoriq: add DPAA FMan support This patch is to add bindings description for DPAA FMan 1588 timer, and also remove its description in fsl-fman dt-bindings document. Signed-off-by: Yangbo Lu Reviewed-by: Rob Herring Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit a8f62d0c6fe533e07cd1acce7588278f9d6e7720 Author: Yangbo Lu Date: Mon Jun 25 20:37:08 2018 +0800 ptp: support DPAA FMan 1588 timer in ptp_qoriq This patch is to support DPAA (Data Path Acceleration Architecture) 1588 timer by adding "fsl,fman-ptp-timer" compatible, sharing interrupt with FMan, adding FSL_DPAA_ETH dependency, and fixing up register offset. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit c4015302565c9869bfc16824096211a32ba4d416 Author: Yangbo Lu Date: Mon Jun 25 20:37:07 2018 +0800 fsl/fman: share the event interrupt This patch is to share fman event interrupt because the 1588 timer driver will also use this interrupt. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur Signed-off-by: David S. Miller commit e60870012e5a35b1506d7b376fddfb30e9da0b27 Author: John Ogness Date: Sun Jun 24 00:32:11 2018 +0200 USB: serial: sierra: fix potential deadlock at close The portdata spinlock can be taken in interrupt context (via sierra_outdat_callback()). Disable interrupts when taking the portdata spinlock when discarding deferred URBs during close to prevent a possible deadlock. Fixes: 014333f77c0b ("USB: sierra: fix urb and memory leak on disconnect") Cc: stable Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior [ johan: amend commit message and add fixes and stable tags ] Signed-off-by: Johan Hovold commit 2ba02c8dd063c4396111629e96dec5a3f231f995 Author: John Ogness Date: Sun Jun 24 00:32:10 2018 +0200 USB: serial: quatech2: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit 19bfbf462e8921d8e520bcc0a23ebc4988223631 Author: John Ogness Date: Sun Jun 24 00:32:09 2018 +0200 USB: serial: mos7840: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit f7c8a9ccc9afe3781dfd6e1977775457102c5c83 Author: John Ogness Date: Sun Jun 24 00:32:08 2018 +0200 USB: serial: mos7720: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit 6778b0cbdbb44afdaa97dd16395be31e239777cf Author: John Ogness Date: Sun Jun 24 00:32:07 2018 +0200 USB: serial: io_ti: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit dd1fae527612543e560e84f2eba4f6ef2006ac55 Author: John Ogness Date: Sun Jun 24 00:32:06 2018 +0200 USB: serial: io_edgeport: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit 041b7db9668a60dc7f03c53fe4fe1c8e137e935b Author: John Ogness Date: Sun Jun 24 00:32:05 2018 +0200 USB: serial: digi_acceleport: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit c75d18cc5a97e9d01d04ee7af457fddea38ca539 Author: John Ogness Date: Sun Jun 24 00:32:04 2018 +0200 USB: serial: cyberjack: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold commit 3652e2741f4297524d1b166c0ba19c390cea7c71 Author: David Lechner Date: Fri May 18 11:48:29 2018 -0500 ARM: dts: da850: Add clocks This adds clock provider nodes for da850 and wires them up to all of the devices. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit bfd107bd3b8ba4ce5f5536fe1d69d0ba06d0e741 Author: David Lechner Date: Fri May 18 11:48:28 2018 -0500 ARM: davinci: da8xx-dt: switch to device tree clocks This removes all of the clock init code from da8xx-dt.c. This includes all of the OF_DEV_AUXDATA that was just used for looking up clocks. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 62604824d234ddf456dd4a97f52bcd0f4e534446 Author: David Lechner Date: Fri May 18 11:48:27 2018 -0500 ARM: davinci: add device tree support to timer This adds device tree support to the davinci timer so that when clocks are moved to device tree, the timer will still work. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 862ceabb4690c83d02d823bc712c47451714f34a Author: David Lechner Date: Fri May 18 11:48:26 2018 -0500 dt-bindings: timer: new bindings for TI DaVinci timer This adds new device tree bindings for the timer IP block of TI DaVinci-like SoCs. Reviewed-by: Rob Herring Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 88ff663d50e09fdb36dae41fdf803d01529e6883 Author: David Lechner Date: Fri May 18 11:48:25 2018 -0500 ARM: davinci: remove legacy clocks This removes the unused legacy clock code from arch/arm/mach-davinci/. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit c0c3fb1a1520f1c416b45b0da92f2f7abd6ac54d Author: David Lechner Date: Fri May 18 11:48:24 2018 -0500 ARM: davinci: da8xx: Remove legacy USB and SATA clock init This removes the unused legacy USB and SATA clock init code from arch/arm/mach-davinci/{devices,usb}-da8xx}.c. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit cf0a51b4f08617c4bc50c6fd3172f4e86d347ac2 Author: David Lechner Date: Fri May 18 11:48:23 2018 -0500 ARM: davinci: dm646x: Remove legacy clock init This removes the unused legacy clock init code from arch/arm/mach-davinci/dm646x.c. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit 015927027bce0dbff45bf50661cd17992073c60e Author: David Lechner Date: Fri May 18 11:48:22 2018 -0500 ARM: davinci: dm644x: Remove legacy clock init This removes the unused legacy clock init code from arch/arm/mach-davinci/dm644x.c. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit ab0f2a60bb0df6f72db111865e368da8365171b1 Author: David Lechner Date: Fri May 18 11:48:21 2018 -0500 ARM: davinci: dm365: Remove legacy clock init This removes the unused legacy clock init code from arch/arm/mach-davinci/dm365.c. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit feee4eda2de296aeaecbba8fa1128e1e2006ff0a Author: David Lechner Date: Fri May 18 11:48:20 2018 -0500 ARM: davinci: dm355: Remove legacy clock init This removes the unused legacy clock init code from arch/arm/mach-davinci/dm355.c. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit 9cc247b82d3c2d30f0a075020d0cdeba6aaafdd8 Author: David Lechner Date: Fri May 18 11:48:19 2018 -0500 ARM: davinci: da850: Remove legacy clock init This removes the unused legacy clock init code from arch/arm/mach-davinci/da850.c. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit 5ab7ba12ab513c40c1e2868100ee5b45689644f1 Author: David Lechner Date: Fri May 18 11:48:18 2018 -0500 ARM: davinci: da830: Remove legacy clock init This removes the unused legacy clock init code from arch/arm/mach-davinci/da830.c. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit 27823278baa72edd776a4d2e195a29877f2975bd Author: David Lechner Date: Fri May 18 11:48:17 2018 -0500 ARM: davinci: switch to common clock framework This switches ARCH_DAVINCI to use the common clock framework. The legacy clock code in arch/arm/mach-davinci/ is no longer used. New drivers in drivers/clk/davinci/ are used instead. A few macros had to be moved to prevent compilation errors. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 1dd8dac0f2ea1722323fc5fada1223e6bab80355 Author: David Lechner Date: Fri May 18 11:48:16 2018 -0500 ARM: davinci_all_defconfig: remove CONFIG_DAVINCI_RESET_CLOCKS This removes CONFIG_DAVINCI_RESET_CLOCKS. The option has been removed from the kernel. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit 4d7ee968edea20d5cd50a8e899920843884c1943 Author: David Lechner Date: Fri May 18 11:48:15 2018 -0500 ARM: davinci: remove CONFIG_DAVINCI_RESET_CLOCKS The common clock framework will take care of disabling unused clocks when we switch from the legacy davinci clocks and having this enabled will cause compile errors after we switch, so remove it now. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit aa1da33c091b731f1e88d0c65ee9f285ac8dd5f9 Author: David Lechner Date: Fri May 18 11:48:14 2018 -0500 ARM: davinci: da8xx: add new sata_refclk init using common clock framework This adds the new SATA REFCLK clock init in mach-davinci/devices-da8xx.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also, the #includes are sorted since we are adding some here. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori Signed-off-by: Sekhar Nori commit 5411bad4ea16622d4204dc590567000b194e5cc2 Author: David Lechner Date: Fri May 18 11:48:13 2018 -0500 ARM: davinci: da8xx: add new USB PHY clock init using common clock framework This adds the new USB PHY clock init in mach-davinci/usb-da8xx.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 81df7d85364f28df6e13a76c7119533140a3b176 Author: David Lechner Date: Fri May 18 11:48:12 2018 -0500 ARM: davinci: dm646x: add new clock init using common clock framework This adds the new board-specific clock init in mach-davinci/dm646x.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also clean up the #includes since we are adding some here. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit a5b1a87199ac7ee35e69bcf00410abf2ab22483f Author: David Lechner Date: Fri May 18 11:48:11 2018 -0500 ARM: davinci: dm644x: add new clock init using common clock framework This adds the new board-specific clock init in mach-davinci/dm644x.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also clean up the #includes since we are adding some here. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 21c2f4773dd0c45899a524a4a7f70dd32db4c1a1 Author: David Lechner Date: Fri May 18 11:48:10 2018 -0500 ARM: davinci: dm365: add new clock init using common clock framework This adds the new board-specific clock init in mach-davinci/dm365.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also clean up the #includes since we are adding some here. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 5b19f66d63b44ca38953b157e81595fb1e985762 Author: David Lechner Date: Fri May 18 11:48:09 2018 -0500 ARM: davinci: dm355: add new clock init using common clock framework This adds the new board-specific clock init in mach-davinci/dm355.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also clean up the #includes since we are adding some here. Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 482db8893ee4fa777e2256dd66ba207e719777dc Author: David Lechner Date: Fri May 18 11:48:08 2018 -0500 ARM: davinci: da850: add new clock init using common clock framework This adds the new board-specific clock init in mach-davinci/da850.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also clean up the #includes since we are adding some here. Some CFGCHIP macros were removed because we are now including linux/mfd/da8xx-cfgchip.h which defines the same values. Reviewed-by: Sekhar Nori Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 3952af1ca29216ff8d56896048607b237e472a5b Author: David Lechner Date: Fri May 18 11:48:07 2018 -0500 ARM: davinci: da830: add new clock init using common clock framework This adds the new board-specific clock init in mach-davinci/da830.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also clean up the #includes since we are adding some here. Reviewed-by: Sekhar Nori Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit a7da5277cdc6690823ad226335feefc11391cf67 Author: David Lechner Date: Fri May 18 11:48:06 2018 -0500 ARM: davinci: pass clock as parameter to davinci_timer_init() This changes davinci_timer_init() so that we pass the clock as a parameter instead of using clk_get(). This is done in preparation for converting to the common clock framework. It removes the requirement that we have to have a clock with con_id of "timer0", which will be good for DT bindings since clock-names = "timer0" doesn't really make sense. Also, drop use of extern in header file since we are touching the definition. Reviewed-by: Sekhar Nori Signed-off-by: David Lechner Signed-off-by: Sekhar Nori commit 525280552b21722d2dfb48a7020dcd56f9e2023c Author: Imre Deak Date: Thu Jun 21 21:44:49 2018 +0300 drm/i915/ddi: Get AUX power domain for DP main link too So far we got an AUX power domain reference only for the duration of DP AUX transfers. However, the following suggests that we also need these for main link functionality: - The specification doesn't state whether it's needed or not for main link functionality, but suggests that these power wells need to be enabled already during display core initialization (Sequences to Initialize Display). - For PSR we need to keep the AUX power well enabled. - On ICL combo PHY ports (non-TC) the AUX power well is needed for link training too: while the port is enabled with a DP link training test pattern trying to toggle the AUX power well will time out. - On ICL MG PHY ports (TC) the AUX power well is needed also for main link functionality (both in DP and HDMI modes). - Windows enables these power wells both for main and AUX lane functionality. Based on the above take an AUX power reference for main link functionality too. This makes a difference only on GEN10+ (GLK+) platforms, where we have separate port specific AUX power wells. For PSR we still need to distinguish between port A and the other ports, since on port A DC states must stay enabled for main link functionality, but DC states must be disabled for driver initiated AUX transfers. So re-use the corresponding helper from intel_psr.c. Since we take now a reference for main link functionality on all DP ports we can forgo taking the separate power ref for PSR functionality. v2: - Make sure DC states stay enabled when taking the ref on port A. (Ville) v3: (Ville) - Fix comment about logic for encoders without a crtc state and add FIXME note for a simplification to avoid calling get_power_domains in such cases. - Use intel_crtc_has_dp_encoder() instead !intel_crtc_has_type(HDMI). Cc: Ville Syrjälä Cc: Dhinakaran Pandiyan Cc: Paulo Zanoni Signed-off-by: Imre Deak [Clarified code comments in intel_ddi_main_link_aux_domain() and intel_ddi_get_power_domains() (Imre)] Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20180621184449.26634-1-imre.deak@intel.com commit 651b4513bdd232e92320f409d0f211c556ba80a9 Merge: fb223502ec08 5b1e7f9ebd56 Author: David S. Miller Date: Tue Jun 26 18:05:32 2018 +0900 Merge branch 'mlxsw-Support-bridge-router-interfaces-with-non-default-VLAN' Ido Schimmel says: ==================== mlxsw: Support bridge router interfaces with non-default VLAN Petr says: When traffic is inserted on a router interface associated with an 802.1q bridge, the VLAN that the traffic appears on is determined by PVID of the bridge device itself. However currently mlxsw always configures such traffic to be forwarded to VLAN 1, regardless of the bridge PVID. Fix the problem by modifying the FID-handling code to assign such traffic not to FID that corresponds to VLAN 1, but to a FID that corresponds to the configured PVID. Bail out if there is no PVID. This is implemented in patches #1 and #2. From that point on, also forbid any changes to bridge device PVID, because such changes would not be reflected. This is implemented in patches #3, #4 and #5. Finally in patch #6, introduce tests that use bridge as a routed interface, and test mlxsw in both the currently-supported scenario of using PVID 1, and the newly-supported one of using a custom PVID. ==================== Signed-off-by: David S. Miller commit 5b1e7f9ebd5653dc4cc026671ca07d8ab2419a99 Author: Petr Machata Date: Mon Jun 25 10:48:18 2018 +0300 selftests: forwarding: Test routed bridge interface Add test for cases where bridge itself acts as a router interface, with front panel port attached to the bridge in question. In the first test (router_bridge.sh), VLAN memberships are not configured in any way, and everything uses default PVID of 1. Thus traffic in $h1 and $h2 is untagged. This test ensures that the previous patches didn't break a currently working scenario. In the second test (router_bridge_vlan.sh), a VLAN 555 pvid untagged is added to the bridge CPU port, with that VLAN leaving the bridge tagged through its sole member port. The traffic is therefore expected to come out tagged at $h1. This tests the fix introduced in the previous patches. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 567ad1a2bb6c1e2ca9644d1b47263b7d5e1ff900 Author: Petr Machata Date: Mon Jun 25 10:48:17 2018 +0300 mlxsw: spectrum_switchdev: Ban PVID change if bridge has a RIF When traffic passes through a router port, it needs to be assigned a FID for ASIC to forward correctly. For bridges, this FID used to be the one corresponding to VLAN 1. In a previous patch, this was changed to instead use the PVID at the time that the RIF is created. This patch guards PVID changes after the RIF was introduced. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a28b1ebef72b19bf40fbceacdf33212d820728dd Author: Petr Machata Date: Mon Jun 25 10:48:16 2018 +0300 mlxsw: spectrum_router: Add mlxsw_sp_rif_fid() In order to allow querying of the VID for which a RIF was created, add a new function that returns a FID for a given RIF. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0c41292bc5ffb4e514652731dfeda1552e2df120 Author: Petr Machata Date: Mon Jun 25 10:48:15 2018 +0300 mlxsw: spectrum_router: Publish mlxsw_sp_rif_find_by_dev() In order to guard against removal of a PVID for which a FID was allocated, spectrum_switchdev needs to first determine whether there is a RIF associated with a given bridge. To that end, publish a preexisting function mlxsw_sp_rif_find_by_dev(). Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e6f1960ae6c736b7bb65a012809eb7c3654b42d7 Author: Petr Machata Date: Mon Jun 25 10:48:14 2018 +0300 mlxsw: spectrum_router: Allocate FID according to PVID For bridge netdevices, instead of assuming that the router traffic is on VLAN 1, look at the bridge PVID. This patch assumes that the PVID doesn't change after the router interface is created (i.e. after the IP address is assigned). Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 5f15e257e1e2bd17830fdf32ac715ca4a29a504f Author: Petr Machata Date: Mon Jun 25 10:48:13 2018 +0300 mlxsw: spectrum_router: Propagate extack to .fid_get() In the follow-up patch, mlxsw_sp_rif_vlan_fid_get() will be changed in a way that could fail. Give that function a possibility to explain the failure through extack. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a63d3bd230772b307c6595469e615d44a1dacdab Author: Thomas Zimmermann Date: Mon Jun 25 17:21:48 2018 +0200 drm/gma500: Replace drm_gem_object_unreference_unlocked with put function This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180625152148.29555-1-contact@tzimmermann.org commit eb7692b4f3b315f7ec1bdb01a0db4b1dbb5c2a32 Author: Linus Walleij Date: Mon Jun 18 01:00:48 2018 +0200 pinctrl: gemini: Mask properly Some logical error in the gemini pin control driver made it not mask and write properly for the GMAC. Signed-off-by: Linus Walleij commit 3a358e22844d4a88d872891c77d7eee4fbca5f37 Author: Geert Uytterhoeven Date: Thu Jun 21 20:54:42 2018 +0200 w1: Allow compile test of GPIO consumers if !GPIOLIB The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven Acked-by: Linus Walleij Acked-by: Evgeniy Polyakov Signed-off-by: Linus Walleij commit 8905764a6aca1e1794e248ac680c6245b7aee406 Author: Amelie Delaunay Date: Thu May 17 14:07:00 2018 +0200 ARM: dts: stm32: enable RTC on stm32mp157c-ed1 Enable RTC (Real Time Clock) on stm32mp157c-ed1 board. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit 8499163a2e5b07561ffc9540844eceb366eeb4e2 Author: Amelie Delaunay Date: Thu May 17 14:07:00 2018 +0200 ARM: dts: stm32: add RTC support to stm32mp157c Add support for RTC (Real Time Clock) to STM32MP157C SoC. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit 26c6ccdf5c06aa83bb78518c72cb287f043db3df Author: Frederic Weisbecker Date: Tue Jun 26 04:58:59 2018 +0200 perf/hw_breakpoint: Clean up and consolidate modify_user_hw_breakpoint_check() Remove the dance around old and new attributes. Just don't modify the previous breakpoint at all until we have verified everything. Original-patch-by: Andy Lutomirski Reported-by: Linus Torvalds Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-13-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit cb8b78815b68b048303f55c276d2aef147e8f2e7 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:58 2018 +0200 perf/hw_breakpoint: Pass new breakpoint type to modify_breakpoint_slot() We soon won't be able to rely on bp->attr anymore to get the new type of the modifying breakpoint because the new attributes are going to be copied only once we successfully modified the breakpoint slot. This will fix the current misdesigned layout where the new attr are copied to the modifying breakpoint before we actually know if the modification will be validated. In order to prepare for that, allow modify_breakpoint_slot() to take the new breakpoint type. Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-12-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit cffbb3bd444bc95186b6ab0ed3bf1d5bcf4aa620 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:57 2018 +0200 perf/hw_breakpoint: Remove default hw_breakpoint_arch_parse() All architectures have implemented it, we can now remove the poor weak version. Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-11-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit ac46c7fddef702dadae18c1fc932530cd31cf9cd Author: Frederic Weisbecker Date: Tue Jun 26 04:58:56 2018 +0200 perf/arch/xtensa: Implement hw_breakpoint_arch_parse() Migrate to the new API in order to remove arch_validate_hwbkpt_settings() that clumsily mixes up architecture validation and commit Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-10-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit 551624d6fc6b282cdcc3f8ab395cb03da0a38fc7 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:55 2018 +0200 perf/arch/sh: Implement hw_breakpoint_arch_parse() Migrate to the new API in order to remove arch_validate_hwbkpt_settings() that clumsily mixes up architecture validation and commit Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-9-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit 923442895760df69eedfd3e25aa954af99a753e6 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:54 2018 +0200 perf/arch/sh: Remove "struct arch_hw_breakpoint::name" unused field This field seem to be unused, perhaps a leftover from old code... Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-8-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit 8c449753a681517f0e6f877aad8539ac4c71757d Author: Frederic Weisbecker Date: Tue Jun 26 04:58:53 2018 +0200 perf/arch/arm64: Implement hw_breakpoint_arch_parse() Migrate to the new API in order to remove arch_validate_hwbkpt_settings() that clumsily mixes up architecture validation and commit. Signed-off-by: Frederic Weisbecker Acked-by: Will Deacon Acked-by: Mark Rutland Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-7-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit 9d52718cd392a94414f0ce780d9bae3ed518ab34 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:52 2018 +0200 perf/arch/arm: Implement hw_breakpoint_arch_parse() Migrate to the new API in order to remove arch_validate_hwbkpt_settings() that clumsily mixes up architecture validation and commit. Signed-off-by: Frederic Weisbecker Acked-by: Mark Rutland Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-6-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit 5d5176baed7abf88bb465a128d414fa8748dcab7 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:51 2018 +0200 perf/arch/powerpc: Implement hw_breakpoint_arch_parse() Migrate to the new API in order to remove arch_validate_hwbkpt_settings() that clumsily mixes up architecture validation and commit Signed-off-by: Frederic Weisbecker Acked-by: Michael Ellerman Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Mark Rutland Cc: Max Filippov Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-5-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit a0baf043c5cfa3a489a63ac50f5201c31a651e21 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:50 2018 +0200 perf/arch/x86: Implement hw_breakpoint_arch_parse() Migrate to the new API in order to remove arch_validate_hwbkpt_settings() that clumsily mixes up architecture validation and commit. Original-patch-by: Andy Lutomirski Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-4-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit 8e983ff9ac02a8fb454ed09c2462bdb3617006a8 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:49 2018 +0200 perf/hw_breakpoint: Pass arch breakpoint struct to arch_check_bp_in_kernelspace() We can't pass the breakpoint directly on arch_check_bp_in_kernelspace() anymore because its architecture internal datas (struct arch_hw_breakpoint) are not yet filled by the time we call the function, and most implementation need this backend to be up to date. So arrange the function to take the probing struct instead. Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Linus Torvalds Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-3-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit 9a4903dde2c8633c5fcf887b98c4e047a6154a54 Author: Frederic Weisbecker Date: Tue Jun 26 04:58:48 2018 +0200 perf/hw_breakpoint: Split attribute parse and commit arch_validate_hwbkpt_settings() mixes up attribute check and commit into a single code entity. Therefore the validation may return an error due to incorrect atributes while still leaving halfway modified architecture breakpoint data. This is harmless when we deal with a new breakpoint but it becomes a problem when we modify an existing breakpoint. Split attribute parse and commit to fix that. The architecture is passed a "struct arch_hw_breakpoint" to fill on top of the new attr and the core takes care about copying the backend data once it's fully validated. The architectures then need to implement the new API. Original-patch-by: Andy Lutomirski Reported-by: Linus Torvalds Signed-off-by: Frederic Weisbecker Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Chris Zankel Cc: Jiri Olsa Cc: Joel Fernandes Cc: Mark Rutland Cc: Max Filippov Cc: Michael Ellerman Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rich Felker Cc: Thomas Gleixner Cc: Will Deacon Cc: Yoshinori Sato Link: http://lkml.kernel.org/r/1529981939-8231-2-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar commit f446474889c06883a3879faa0896e2359e812a6b Merge: 01bdee64f9cf 6f0d349d922b Author: Ingo Molnar Date: Tue Jun 26 09:02:41 2018 +0200 Merge branch 'linus' into perf/core, to pick up fixes Signed-off-by: Ingo Molnar commit 71e9bd3ff847afae91b9f66f9217921e98c25b0b Author: Michael Straube Date: Mon Jun 25 23:41:56 2018 +0200 staging: rtl8188eu: add SPDX identifiers This satisfies a checkpatch warning and is the preferred method for notating the license. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 931113828cd1fc0c2d1dcc1037aa2967d633b996 Author: John Whitmore Date: Sun Jun 24 16:34:54 2018 +0100 staging: rtl8192u: Correction of spelling mistake in comment. Simple spelling correction. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit c8cf478ab7180d1c0efb66ac6cfcab3154073485 Author: John Whitmore Date: Sun Jun 24 16:34:53 2018 +0100 staging: rtl8192u: Correct if statement - Coding Style Corrected the coding style of if statement. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit dff11576389f099b608daba633eb84b6dde1c283 Author: John Whitmore Date: Sun Jun 24 16:34:52 2018 +0100 staging: rtl8192u: Remove braces from single statement blocks - Style Removed the unrequired braces from single statement blocks - Coding Style. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit e62b4e21d1edf1cbe6d79e4c05fdbd56190a57aa Author: John Whitmore Date: Sun Jun 24 16:34:50 2018 +0100 staging: rtl8192u: Truncate block comments to 80 character length - Style Where possible truncation of block comments to the 80 character length preferred by the coding style. In a previous version of this commit some of the comments were contentious so those have not been touched in this version. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 5d9f4b53ca148bc4b03b41237a86a021f0f7ac79 Author: John Whitmore Date: Sun Jun 24 16:34:48 2018 +0100 staging: rtl8192u: Correct indentation of switch statement - Coding Style Removed an extra indentation from the code of the various case options in a switch statement. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 9b468c7e0216330b8b6a5020cdf9ef395a56ed95 Author: John Whitmore Date: Sun Jun 24 16:34:47 2018 +0100 staging: rtl8192u: change block comments to prefered style - Coding Style Some of the comment blocks are commening out code so have been left for the moment. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 997e66741413a304e3337dd0f904e54ed50b3cbe Author: Janani Sankara Babu Date: Mon Jun 18 12:05:45 2018 -0400 Staging:rtl8192e Cleanup comparison to NULL This patch replaces the comparison of var to NULL with !var Signed-off-by: Janani Sankara Babu Signed-off-by: Greg Kroah-Hartman commit 4eff3e9d971e75cc2f822596b842e2af181986a1 Author: Janani Sankara Babu Date: Mon Jun 18 12:05:29 2018 -0400 Staging:rtl8192e Fix Comparison to true is error prone This patch removes the comaprison to bool value in the code Signed-off-by: Janani Sankara Babu Signed-off-by: Greg Kroah-Hartman commit 6b6da6228c646d00567a631bfe7ee10ce61ba50b Author: Janani Sankara Babu Date: Mon Jun 18 12:05:09 2018 -0400 Staging:rtl8192e Fix Comparison to False is error prone This patch removes comparison to False and boolean values in the code which can be written as !var Signed-off-by: Janani Sankara Babu Signed-off-by: Greg Kroah-Hartman commit 9ca7a85582424098f73b402afa5420808745de68 Author: Fabian Bläse Date: Sun Jun 17 23:02:31 2018 +0200 rtl8192u/rtl819x_BAProc.c: Adjust spaces to coding guidelines This patch improves spacing according to the coding guidelines, mainly around braces. This patch fixes errors reported by checkpatch. Signed-off-by: Fabian Bläse Signed-off-by: Maximilian Ott Signed-off-by: Greg Kroah-Hartman commit 40a596e64f856b3d70bb859725742e830e5a0947 Author: Fabian Bläse Date: Sun Jun 17 23:02:30 2018 +0200 rtl8192u/rtl819x_Qos.h: Adjust spaces to coding guidelines This patch improves spacing according to the coding guidelines, mainly around braces. This patch fixes errors reported by checkpatch. Signed-off-by: Fabian Bläse Signed-off-by: Maximilian Ott Signed-off-by: Greg Kroah-Hartman commit f44426346289fee0a5c4bb366583fea71da0b95d Author: Jia-Ju Bai Date: Wed Jun 20 18:01:19 2018 +0800 staging: rtl8188eu: Fix a possible sleep-in-atomic-context bug in rtw_disassoc_cmd() The driver may sleep with holding a spinlock. The function call paths (from bottom to top) in Linux-4.16.7 are: [FUNC] kzalloc(GFP_KERNEL) drivers/staging/rtl8188eu/core/rtw_cmd.c, 502: kzalloc in rtw_disassoc_cmd drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 256: rtw_disassoc_cmd in rtw_set_802_11_ssid drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 235: spin_lock_bh in rtw_set_802_11_ssid [FUNC] kzalloc(GFP_KERNEL) drivers/staging/rtl8188eu/core/rtw_cmd.c, 502: kzalloc in rtw_disassoc_cmd drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 352: rtw_disassoc_cmd in rtw_set_802_11_infrastructure_mode drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 336: spin_lock_bh in rtw_set_802_11_infrastructure_mode To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC. This bug is found by my static analysis tool (DSAC-2) and checked by my code review. Signed-off-by: Jia-Ju Bai Signed-off-by: Greg Kroah-Hartman commit 6677bbded4c6d0052eed09d1e4d574fb79ebd5bc Author: Chen-Yu Tsai Date: Wed Jun 20 15:13:41 2018 +0800 arm64: dts: allwinner: h6: Add LED device nodes for Pine H64 The Pine H64 has 3 GPIO-controlled LEDs, which are labeled "heartbeat", "link", and "status". Add device nodes for them. Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit fb223502ec0889444965f602f57b1f45f9e9845e Author: Yafang Shao Date: Sun Jun 24 10:02:54 2018 -0400 tcp: add SNMP counter for zero-window drops It will be helpful if we could display the drops due to zero window or no enough window space. So a new SNMP MIB entry is added to track this behavior. This entry is named LINUX_MIB_TCPZEROWINDOWDROP and published in /proc/net/netstat in TcpExt line as TCPZeroWindowDrop. Signed-off-by: Yafang Shao Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 7e55052783fd3a9202e9f7c4c480629a7270645f Merge: 9ff3b40e411c 07d78363dcff Author: David S. Miller Date: Tue Jun 26 11:33:04 2018 +0900 Merge branch 'NAPI-gro-hash' Convert GRO receive over to hash table. When many parallel flows are present and being received on the same RX queue, GRO processing can become expensive because each incoming frame must traverse the per-NAPI GRO list at each protocol layer of GRO receive (eth --> ipv{4,6} --> tcp). Use the already computed hash to chain these SKBs in a hash table instead of a simple list. The first patch makes the GRO list a true list_head. The second patch implements the hash table. This series patches basic testing and I added some diagnostics to make sure we really were aggregating GRO frames :-) Signed-off-by: David S. Miller commit 07d78363dcffd9cb1bf6f06a6cac0e0847f3c1de Author: David Miller Date: Sun Jun 24 14:14:02 2018 +0900 net: Convert NAPI gro list into a small hash table. Improve the performance of GRO receive by splitting flows into multiple hash chains. Suggested-by: Eric Dumazet Signed-off-by: David S. Miller commit d4546c2509b1e9cd082e3682dcec98472e37ee5a Author: David Miller Date: Sun Jun 24 14:13:49 2018 +0900 net: Convert GRO SKB handling to list_head. Manage pending per-NAPI GRO packets via list_head. Return an SKB pointer from the GRO receive handlers. When GRO receive handlers return non-NULL, it means that this SKB needs to be completed at this time and removed from the NAPI queue. Several operations are greatly simplified by this transformation, especially timing out the oldest SKB in the list when gro_count exceeds MAX_GRO_SKBS, and napi_gro_flush() which walks the queue in reverse order. Signed-off-by: David S. Miller commit ba0ab35a81de1da15e1691142834eefd34e34a0e Author: Marcel Ziswiler Date: Mon Jun 25 09:58:43 2018 +0200 usb: chipidea: tegra: Use aligned DMA on Tegra114/124 USB Ethernet gadget now works on Tegra114 and Tegra124. Similar to commit 061e20e9899e ("usb: chipidea: tegra: Use aligned DMA on Tegra30"). Signed-off-by: Marcel Ziswiler Signed-off-by: Peter Chen commit f62252bf39445d4155c70871a8ce486f872d1442 Merge: 6557dd49369c 6794e23fa3fe Author: Greg Kroah-Hartman Date: Tue Jun 26 07:47:37 2018 +0800 Merge tag 'iio-for-4.19a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First set of IIO new device support, features and cleanups in the 4.19 cycle The usual mixed bunch. Particular good to see is the generic touch screen driver. Will be interesting to see if this works for other ADCs without major changes. Core features * Channel types - New position relative channel type primarily for touch screen sensors to feed the generic touchscreen driver. New device support * ad5586 - Add support for the AD5311R DAC. * Generic touch screen driver as an IIO consumer. - Note this is in input, but due to dependencies is coming through the IIO tree. - Specific support for this added to the at91-sama5d2 ADC. - Various necessary DT bindings added. Staging Drops * ADIS16060 gyro - A device with a very odd interface that was never cleanly supported. It's now very difficult to get, so unlikely it'll ever be fixed up. Cleanups and minor features and fixes * core - Fix y2038 timestamp issues now the core support is in place. * 104-quad-8 - Provide some defines for magic numbers to help readability. - Fix an off by one error in register selection * ad7606 - Put in a missing function parameter name in a prototype. * adis16023 - Use generic sign_extend function rather than local version. * adis16240 - Use generic sign_extend funciton rather than local version. * at91-sama5d2 - Drop dependency on HAS_DMA now this is handled elsewhere. Will improve build test coverage. - Add oversampling ratio control. Note there is a minor ABI change here to increase the apparent depth to 14 bits so as to allow for transparent provision of different oversampling ratios that drop the actual bit depth to 13 or 12 bits. * hx711 - Add a MAINTAINERS entry for this device. * inv_mpu6050 - Replace the timestamp fifo 'special' code with generic timestamp handling. - Switch to using local store of timestamp divider rather than rate as that is more helpful for accurate time measurement. - Fix an unaligned access that didn't seem to be causing any trouble. - Use the fifo overflow bit to track the overflow status rather than a software counter. - New timestamping mechanism to deal with missed sample interrupts. * stm32-adc - Drop HAS_DMA build dependency. * sun4i-gpadc - Select REGMAP_IRQ a very rarely hit build issue fix. commit 9ff3b40e411c00870d1c29cd6b843fca7c4160ae Merge: 823819507095 6f0d349d922b Author: David S. Miller Date: Tue Jun 26 08:07:17 2018 +0900 Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net commit 1ccddc42da03876f60fe2d0a1b124c27ed5ff201 Author: Leon Romanovsky Date: Sun Jun 24 11:23:45 2018 +0300 RDMA/verbs: Drop kernel variant of destroy_flow Following the removal of ib_create_flow(), adjust the code to get rid of ib_destroy_flow() too. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ca576fbbdc80d26ca46dd881944413e7dc05c21d Author: Leon Romanovsky Date: Sun Jun 24 11:23:44 2018 +0300 RDMA/verbs: Drop kernel variant of create_flow There are no kernel users of this interface so lets drop it. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e99028ad76e788574a7eafaee2e5916c5b9bbf87 Author: Jason Gunthorpe Date: Mon Jun 25 15:21:15 2018 -0600 RDMA/uverbs: Check existence of create_flow callback In the accepted series "Refactor ib_uverbs_write path", we presented the roadmap to get rid of uverbs_cmd_mask and uverbs_ex_cmd_mask fields in favor of simple check of function pointer. So let's put NULL check of create_flow function callback despite the fact that uverbs_ex_cmd_mask still exists. Link: https://www.spinics.net/lists/linux-rdma/msg60753.html Suggested-by: Michael J Ruhl Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a69d8b3a41165ba0a70f2e9612a08ea0af909233 Author: Bart Van Assche Date: Fri Jun 22 08:11:17 2018 -0700 MAINTAINERS: Update SRP entries Reflect the acquisition of SanDisk by Western Digital in my e-mail address. Remove the reference to David Dillow's git tree since SRP patches are queued by Doug and Jason. Remove the reference to the OpenFabrics website since the srp_daemon source code has been moved from that website into the rdma-core project. Add an entry for the SRP target driver. Signed-off-by: Bart Van Assche Cc: Bart Van Assche Cc: David Dillow Signed-off-by: Jason Gunthorpe commit 43cbd64b1fdc1da89abdad88a022d9e87a98e9c6 Author: Jason Gunthorpe Date: Wed Jun 13 11:19:42 2018 -0600 IB/usnic: Update with bug fixes from core code usnic has a modified version of the core codes' ib_umem_get() and related, and the copy misses many of the bug fixes done over the years: Commit bc3e53f682d9 ("mm: distinguish between mlocked and pinned pages") Commit 87773dd56d54 ("IB: ib_umem_release() should decrement mm->pinned_vm from ib_umem_get") Commit 8494057ab5e4 ("IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic") Commit 8abaae62f3fd ("IB/core: disallow registering 0-sized memory region") Commit 66578b0b2f69 ("IB/core: don't disallow registering region starting at 0x0") Commit 53376fedb9da ("RDMA/core: not to set page dirty bit if it's already set.") Commit 8e907ed48827 ("IB/umem: Use the correct mm during ib_umem_release") Signed-off-by: Jason Gunthorpe commit 1975acd9f3fdc08d5e77fa95e740592e37c97fc0 Author: Yishai Hadas Date: Tue Jun 19 10:43:56 2018 +0300 IB/mlx4: Add support for drain SQ & RQ This patch follows the logic from ib_core but considers the internal device state upon executing the involved commands. Specifically, Upon internal error state modify QP to an error state can be assumed to be success as each in-progress WR going to be flushed in error in any case as expected by that modify command. In addition, As the drain should never fail the driver makes sure that post_send/recv will succeed even if the device is already in an internal error state. As such once the driver will supply the simulated/SW CQEs the CQE for the drain WR will be handled as well. In case of an internal error state the CQE for the drain WR may be completed as part of the main task that handled the error state or by the task that issued the drain WR. As the above depends on scheduling the code takes the relevant locks and actions to make sure that the completion handler for that WR will always be called after that the post_send/recv were issued but not in parallel to the other task that handles the error flow. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d0e84c0ad39826c38a9d6881fd8f9af476a5d9a7 Author: Yishai Hadas Date: Tue Jun 19 10:43:55 2018 +0300 IB/mlx5: Add support for drain SQ & RQ This patch follows the logic from ib_core but considers the internal device state upon executing the involved commands. Specifically, Upon internal error state modify QP to an error state can be assumed to be success as each in-progress WR going to be flushed in error in any case as expected by that modify command. In addition, As the drain should never fail the driver makes sure that post_send/recv will succeed even if the device is already in an internal error state. As such once the driver will supply the simulated/SW CQEs the CQE for the drain WR will be handled as well. In case of an internal error state the CQE for the drain WR may be completed as part of the main task that handled the error state or by the task that issued the drain WR. As the above depends on scheduling the code takes the relevant locks and actions to make sure that the completion handler for that WR will always be called after that the post_send/recv were issued but not in parallel to the other task that handles the error flow. Signed-off-by: Yishai Hadas Reviewed-by: Max Gurtovoy Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ea8c2d8f6014b74921dd5a9654a623a725d79608 Author: Jason Gunthorpe Date: Tue Jun 19 10:59:21 2018 +0300 RDMA/core: Remove unused ib cache functions Now that all users have been converted to use the version of these APIs that returns a gid_attr pointer we can delete the old entry points. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit a8872d53e9b7fcf650f0e4be40887b3ad5210e33 Author: Parav Pandit Date: Tue Jun 19 10:59:20 2018 +0300 IB/cm: Use sgid_attr from the AV Prior patches now ensure that the AV has a sgid_attr, if one would have been required. Instead of querying for one, take it directly from the AH. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 398391071f2576bbc6351bcb92c78fc432190ac3 Author: Parav Pandit Date: Tue Jun 19 10:59:19 2018 +0300 IB/cm: Replace members of sa_path_rec with 'struct sgid_attr *' While processing a path record entry in CM messages the associated GID attribute is now also supplied. Currently for RoCE a netdevice's net namespace pointer and ifindex are stored in path record entry. Both of these fields of the netdev can change anytime while processing CM messages. Additionally storing net namespace without holding reference will lead to use-after-free crash. Therefore it is removed. Netdevice information for RoCE is instead provided via referenced gid attribute in ib_cm requests. Such a design leads to a situation where the kernel can crash when the net pointer becomes invalid. However today it is always initialized to init_net, which cannot become invalid. In order to support processing packets in any arbitrary namespace of the received packet, it is necessary to avoid such conditions. This patch removes the dependency on the net pointer and ifindex; instead it will rely on SGID attribute which contains a pointer to netdev. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 815d456ef21a132b60ce67908d289235e9bb896c Author: Parav Pandit Date: Tue Jun 19 10:59:18 2018 +0300 IB/cm: Pass the sgid_attr through various events Make the sgid_attr available along with path information to the event consumer, this allows the consumer to keep using the same GID table entry as the event is related to. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 4ed13a5f2d606d2e6bcc5b8adbf08ed52e76cbb5 Author: Parav Pandit Date: Tue Jun 19 10:59:17 2018 +0300 IB/cm: Keep track of the sgid_attr that created the cm id Hold reference to the the sgid_attr which is used in a cm_id until the cm_id is destroyed. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit aa74f4878d61c83244ad8613082989b60a566ca4 Author: Parav Pandit Date: Tue Jun 19 10:59:16 2018 +0300 IB: Make init_ah_attr_grh_fields set sgid_attr Use the sgid and other information from the path record to figure out the sgid_attrs. Store the selected table entry in the sgid_attr for everything else to use. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit f685c19529f0e4d9738f52cbf65d1189c6551fd5 Author: Parav Pandit Date: Tue Jun 19 10:59:15 2018 +0300 IB: Make ib_init_ah_from_mcmember set sgid_attr This is really just a CM support function, normally a multicast address does not have a specific SGID - but the RDMA CM usage model does restrict things to the netdevice the CM id is bound to, at least for roce case. Store the selected table entry in the sgid_attr for everything else to use. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit b7403217656dcf6c51f09d0bca7a12db0de8934a Author: Parav Pandit Date: Tue Jun 19 10:59:14 2018 +0300 IB: Make ib_init_ah_attr_from_wc set sgid_attr The work completion is inspected to determine what dgid table entry was used to receieve the packet, produces a sgid_attr that matches and sticks it in the ah_attr. All callers of this function are now required to release the ah_attr on success. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 6794e23fa3fed82b1e71f730359618b40cbf7d66 Author: Eugen Hristev Date: Thu Jun 21 10:56:21 2018 +0300 iio: adc: at91-sama5d2_adc: add support for oversampling resolution This implements oversampling support for the SAMA5d2 ADC device. Enabling oversampling : OSR can improve resolution from 12 bits to 13 or 14 bits. Changing the channel specification to have 14 bits, and we shift the value 1 bit to the left if we have oversampling for just one extra bit, and two bits to the left if we have no oversampling (old support). From this commit on, the converted values for all the voltage channels change to 14 bits real data, with most insignificant two bits always zero if oversampling is not enabled. sysfs object oversampling_ratio has been enabled and oversampling_ratio_available will list possible values (1 or 4 or 16) having 1 as default (no oversampling, 1 sample for each conversion). Special care was required for the triggered buffer scenario (+ DMA), to adjust the values accordingly. Touchscreen measurements supported by this driver are not affected by oversampling, they are still on 12 bits (scale handing is already included in the driver). Signed-off-by: Eugen Hristev Signed-off-by: Jonathan Cameron commit 60500037637397dcc8ea3d3c2f16e05ea6695a86 Author: Paul E. McKenney Date: Tue May 15 12:25:05 2018 -0700 torture: Keep old-school dmesg format This commit adds "#define pr_fmt(fmt) fmt" to the torture-test files in order to keep the current dmesg format. Once Joe's commits have hit mainline, these definitions will be changed in order to automatically generate the dmesg line prefix that the scripts expect. This will have the beneficial side-effect of allowing printk() formats to be used more widely and of shortening some pr_*() lines. Signed-off-by: Paul E. McKenney Cc: Joe Perches commit 90127d605f403d814f4986436871210bf8ceb335 Author: Paul E. McKenney Date: Wed May 9 10:29:18 2018 -0700 torture: Make online/offline messages appear only for verbose=2 Some bugs reproduce quickly only at high CPU-hotplug rates, so the rcutorture TREE03 scenario now has only 200 milliseconds spacing between CPU-hotplug operations. At this rate, the torture-test pair of console messages per operation becomes a bit voluminous. This commit therefore converts the torture-test set of "verbose" kernel-boot arguments from bool to int, and prints the extra console messages only when verbose=2. The default is still verbose=1. Signed-off-by: Paul E. McKenney commit b4c1906f65cff3fbd1f3b7e08b3baa983e142756 Author: Paul E. McKenney Date: Thu May 3 14:41:54 2018 -0700 rcutorture: Make kvm-find-errors.sh find close calls Although warnings about close calls are printed by kvm-recheck.sh, kvm-find-errors.sh currently ignores them. This could easily result in someone failing to investigate close calls, so this commit makes them visible to kvm-find-errors.sh. Signed-off-by: Paul E. McKenney commit 69409750b28d098e5387310cc9ec4ff66301057b Author: Paul E. McKenney Date: Mon Apr 30 16:40:01 2018 -0700 rcutorture: Remove obsolete TREE08-T.boot file The TREE08-T.boot file was used to provide alternative options for debugging, but things have changed, it has not kept up, and it has not been used or missed. This commit therefore removes it. Signed-off-by: Paul E. McKenney commit 5bfd7d34fe0905421b42f0091ee9c59d83deef9c Author: Paul E. McKenney Date: Mon Apr 23 14:03:00 2018 -0700 torture: Use a single build directory for torture scenarios The torture scripting currently builds each kernel from a set of parallel runs in its own build directory. This can waste quite a bit of space when running large numbers of concurrent scenarios, and pointlessly given that the builds are run sequentially (albeit with a largish -j number passed to "make"). This commit therefore places all build-command output in the results directory, then does all builds in a single "b1" build directory. Signed-off-by: Paul E. McKenney commit fd55a281adf6c9b9723d369203fdd92e5ea62a09 Author: Paul E. McKenney Date: Fri Apr 27 10:06:03 2018 -0700 srcu: Introduce srcu_read_{un,}lock_notrace() Joel Fernandes is using SRCU to protect from-idle tracepoints, which requires notrace variants of srcu_read_lock() and srcu_read_unlock() in order to avoid problems with tracepoints in lockdep. This commit therefore adds srcu_read_lock_notrace() and srcu_read_unlock_notrace(). [1] http://lkml.kernel.org/r/20180427042656.190746-1-joelaf@google.com Reported-by: Joel Fernandes Intermittently-reported-by: Steven Rostedt Signed-off-by: Paul E. McKenney commit 5ab07a8df4d6c958ca63640d3f2ef896f0679c05 Author: Paul E. McKenney Date: Tue May 22 12:28:04 2018 -0700 srcu: Add address of first callback to rcutorture output This commit adds the address of the first callback to the per-CPU rcutorture output in order to allow lost wakeups to be more efficiently tracked down. Signed-off-by: Paul E. McKenney commit 17294ce6a41d3fee6a9bfc52387c107a4607c1c9 Author: Paul E. McKenney Date: Wed Apr 25 12:03:36 2018 -0700 srcu: Document that srcu_funnel_gp_start() implies srcu_funnel_exp_start() This commit updates the header comment of srcu_funnel_gp_start() to document the fact that srcu_funnel_gp_start() does the work of srcu_funnel_exp_start(), in some cases by invoking it directly. Signed-off-by: Paul E. McKenney commit 5ef98a6328a1506f544a64b28d6a8a7b99af475b Author: Paul E. McKenney Date: Tue Apr 24 21:30:13 2018 -0700 srcu: Fix typos in __call_srcu() header comment This commit simply changes some copy-pasta call_rcu() instances to the correct call_srcu(). Signed-off-by: Paul E. McKenney commit 5257514d8885b2ebc11bf359ea1527282b47a5fd Author: Paul E. McKenney Date: Tue Apr 24 11:03:39 2018 -0700 rcu: Make expedited grace period use direct call on last leaf During expedited grace-period initialization, a work item is scheduled for each leaf rcu_node structure. However, that initialization code is itself (normally) executing from a workqueue, so one of the leaf rcu_node structures could just as well be handled by that pre-existing workqueue, and with less overhead. This commit therefore uses a shiny new rcu_is_leaf_node() macro to execute the last leaf rcu_node structure's initialization directly from the pre-existing workqueue. Signed-off-by: Paul E. McKenney commit 26aec25593c2ee2e24f9facabcf85abba54bdb37 Author: Maxime Ripard Date: Tue May 29 11:49:15 2018 +0200 drm/panel: Add Ilitek ILI9881c panel driver The LHR050H41 panel is the panel shipped with the BananaPi M2-Magic, and is based on the Ilitek ILI9881c Controller. Add a driver for it, modelled after the other Ilitek controller drivers. Acked-by: Daniel Vetter Reviewed-by: Linus Walleij Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/acb5453112ab7c7b801cf4f1669e351b391e77e8.1527587352.git-series.maxime.ripard@bootlin.com commit 66ddff86f682a635d2beaa1dc90e2a03e83af77e Author: Maxime Ripard Date: Tue May 29 11:49:14 2018 +0200 dt-bindings: panel: Add the Ilitek ILI9881c panel documentation The LHR050H41 from BananaPi is a 1280x700 4-lanes DSI panel based on the ILI9881c from Ilitek. Acked-by: Rob Herring Acked-by: Daniel Vetter Reviewed-by: Linus Walleij Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/a348cdd07d3287e8203ee8d840ea279fe10a6204.1527587352.git-series.maxime.ripard@bootlin.com commit 48f3e7bf38db6603bf88ef889ade8df408d81cc4 Author: Icenowy Zheng Date: Sat Jun 23 00:06:31 2018 +0800 arm64: allwinner: a64: allow laptops to wake up from lid Currently all ARM kernels will have s2idle enabled if CONFIG_SUSPEND is present. In this case if the lid is closed, systemd-logind will enter s2idle mode by default; however there's no possible wakeup source defined, so the system will enter a forever idle. Add the lid itself as a wakeup source, thus the system can wakeup when the lid is opened. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit e4357c82e3a6e3e7142d0ea17c874e2d0bd623d4 Author: Icenowy Zheng Date: Sat Jun 23 00:06:30 2018 +0800 arm64: allwinner: a64: change TERES-I DLDO3's name to start with "vdd" Originally the name of the DLDO3 regulator on TERES-I is "eDP12", which is not consistent with other regulator names. Change it to "vdd-edp", in order to make it more consistent. Signed-off-by: Icenowy Zheng Signed-off-by: Maxime Ripard commit 5613ee51b09deec6ec9a9a53824b37c9b1461ecf Author: Denis Efremov Date: Sun Jun 17 22:46:17 2018 +0300 ARM: s3c24xx: Fix typo in guard macro of s3c2412.h The guard macro __ARCH_ARM_REGS_S3C24XX_S3C2412_H in header s3c2412.h doesn't match the #ifndef macro __ARCH_ARM_MACH_S3C24XX_S3C2412_H. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Denis Efremov Signed-off-by: Krzysztof Kozlowski commit 17aa1530f1ff89ca4e21765e5f4d9e6bcd464eb2 Author: Krzysztof Kozlowski Date: Mon Jun 18 19:42:15 2018 +0200 arm64: dts: exynos: Remove leading 0x from unit addresses in Exynos5433 Remove leading 0x from recently introduced unit addresses to fix DTC warnings: Warning (unit_address_format): /soc/sysmmu@0x15040000: unit name should not have leading "0x" Signed-off-by: Krzysztof Kozlowski commit 0263a3038dc4223fb7f7862ac0c726bf84af824a Author: Bartlomiej Zolnierkiewicz Date: Mon Apr 16 12:12:05 2018 +0200 arm64: dts: exynos: Remove no longer needed samsung thermal properties Remove no longer needed samsung thermal properties. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Krzysztof Kozlowski commit c05b799ecc4b4363e57e23db401561a6fc51d054 Author: Bartlomiej Zolnierkiewicz Date: Thu Jun 21 12:35:30 2018 +0200 ARM: dts: exynos: remove no longer needed samsung thermal properties Remove no longer needed samsung thermal properties. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Krzysztof Kozlowski commit 856817cfbe822fa1e0af449ad96a155c719a10d9 Author: Krzysztof Kozlowski Date: Mon May 28 20:53:10 2018 +0200 dt-bindings: arm: Remove obsolete insignal-boards.txt The compatibles mentioned in insignal-boards.txt are already documented under devicetree/bindings/arm/samsung/samsung-boards.txt. Also the contents of insignal-boards.txt is not accurate, e.g. does not mention Arndale boards. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring commit 265e83d6cf97c54b73374c7447a6f26006ec6929 Author: Krzysztof Kozlowski Date: Wed May 30 18:49:22 2018 +0200 ARM: dts: exynos: Add missing CPU clocks to secondary CPUs on Exynos542x Secondary CPUs should have the same information in DeviceTree as booting CPU from both correctness point of view and for possible hotplug scenarios. Suggested-by: Viresh Kumar Signed-off-by: Krzysztof Kozlowski Acked-by: Viresh Kumar Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar commit 672f33198bee21ee91e6af2cb8f67cfc8bc97ec1 Author: Viresh Kumar Date: Fri May 25 16:01:53 2018 +0530 arm: dts: exynos: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Fix other missing properties (clocks, OPP, clock latency) as well to make it all work. Signed-off-by: Viresh Kumar Signed-off-by: Krzysztof Kozlowski commit 57b54d74dd5c559bd35f2affaf11d8828aaf5733 Merge: 65793f3cd93a 7daf201d7fe8 Author: James Morris Date: Mon Jun 25 09:20:40 2018 -0700 Merge tag 'v4.18-rc2' into next-general Merge to Linux 4.18-rc2 for security subsystem developers. commit 86cd90020688ee8b45268e588a05454cbe979cb7 Author: John Stultz Date: Thu Jun 21 16:01:16 2018 -0700 drm: kirin: Remove useless "Scale not support" error message The driver doesn't support scaling, but when an atomic test is done it repeatedly spits out this warning which isn't particularly useful. So just remove the error message. Cc: Xinliang Liu Cc: Rongrong Zou Cc: Xinwei Kong Cc: Chen Feng Cc: David Airlie Cc: Daniel Vetter Cc: Peter Griffin Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1529622076-20386-1-git-send-email-john.stultz@linaro.org commit e4db5b61c572475bbbcf63e3c8a2606bfccf2c9d Author: Florian Westphal Date: Mon Jun 25 17:26:02 2018 +0200 xfrm: policy: remove pcpu policy cache Kristian Evensen says: In a project I am involved in, we are running ipsec (Strongswan) on different mt7621-based routers. Each router is configured as an initiator and has around ~30 tunnels to different responders (running on misc. devices). Before the flow cache was removed (kernel 4.9), we got a combined throughput of around 70Mbit/s for all tunnels on one router. However, we recently switched to kernel 4.14 (4.14.48), and the total throughput is somewhere around 57Mbit/s (best-case). I.e., a drop of around 20%. Reverting the flow cache removal restores, as expected, performance levels to that of kernel 4.9. When pcpu xdst exists, it has to be validated first before it can be used. A negative hit thus increases cost vs. no-cache. As number of tunnels increases, hit rate decreases so this pcpu caching isn't a viable strategy. Furthermore, the xdst cache also needs to run with BH off, so when removing this the bh disable/enable pairs can be removed too. Kristian tested a 4.14.y backport of this change and reported increased performance: In our tests, the throughput reduction has been reduced from around -20% to -5%. We also see that the overall throughput is independent of the number of tunnels, while before the throughput was reduced as the number of tunnels increased. Reported-by: Kristian Evensen Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit efe79d48a7debf57ad156a43a9215f8b0c9210d4 Author: Chris Wilson Date: Mon Jun 25 11:06:04 2018 +0100 drm/i915: Context objects can never be active when freed Due to how we only release the pining on the context state on retirement and never track activity on the context vma itself, the object can never be active at the point of release. Replace the conditional transfer of ownership onto an active-reference with an assert that the object is idle. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180625100604.22598-2-chris@chris-wilson.co.uk commit dd12c6ca5b45fd54e80c1424b11a5a25ad913dbb Author: Chris Wilson Date: Mon Jun 25 11:06:03 2018 +0100 drm/i915/execlists: Check for ce->state before destroy As we may cancel the ce->state allocation during context pinning (but crucially after we mark ce as operational), that means we may be asked to destroy a nonexistent ce->state. Given the choice in handing a complex error path on pinning, and just ignoring the lack of state in destroy, choice the latter for simplicity. Reported-by: Zhao Yakui Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180625100604.22598-1-chris@chris-wilson.co.uk commit 8d52e447807b350b98ffb4e64bc2fcc1f181c5be Author: Chris Wilson Date: Sat Jun 23 11:39:51 2018 +0100 drm/i915: Defer modeset cleanup to a secondary task If we avoid cleaning up the old state immediately in intel_atomic_commit_tail() and defer it to a second task, we can avoid taking heavily contended locks when the caller is ready to procede. Subsequent modesets will wait for the cleanup operation (either directly via the ordered modeset wq or indirectly through the atomic helperr) which keeps the number of inflight cleanup tasks in check. As an example, during reset an immediate modeset is performed to disable the displays before the HW is reset, which must avoid struct_mutex to avoid recursion. Moving the cleanup to a separate task, defers acquiring the struct_mutex to after the GPU is running again, allowing it to complete. Even in a few patches time (optimist!) when we no longer require struct_mutex to unpin the framebuffers, it will still be good practice to minimise the number of contention points along reset. The mutex dependency still exists (as one modeset flushes the other), but in the short term it resolves the deadlock for simple reset cases. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101600 Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180623103951.23889-1-chris@chris-wilson.co.uk Acked-by: Maarten Lankhorst Acked-by: Daniel Vetter commit 34093104304df1eb09f9bd15f8f157f085a85a3b Author: Sean Wang Date: Mon May 21 01:01:53 2018 +0800 arm64: dts: mt7622: add EINT support to pinctrl Add EINT support to pinctrl and set those GPIO keys as interrupt-driven keys. Signed-off-by: Sean Wang Acked-by: Linus Walleij Signed-off-by: Matthias Brugger commit 0c7f7a5150023f3c6f0b27c4d4940ce3dfaf62cc Author: Viresh Kumar Date: Fri May 25 16:01:49 2018 +0530 arm: dts: mediatek: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Signed-off-by: Viresh Kumar Signed-off-by: Matthias Brugger commit d30827ce0df4410648c3fbba48681d7aafb19f36 Author: Noralf Trønnes Date: Mon Jun 18 16:17:30 2018 +0200 drm: Make ioctls available for in-kernel clients Make ioctl wrappers for functions that will be used by the in-kernel API. The following functions are touched: - drm_mode_create_dumb_ioctl() - drm_mode_destroy_dumb_ioctl() - drm_mode_addfb() - drm_mode_rmfb() Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618141739.48151-4-noralf@tronnes.org commit 7eeaeb90a6a5c8dc0de9bbb16a12d474d31d820e Author: Noralf Trønnes Date: Mon Jun 18 16:17:29 2018 +0200 drm/file: Don't set master on in-kernel clients It only makes sense for userspace clients. Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618141739.48151-3-noralf@tronnes.org commit 1572042a4ab25567e4785b53b947729dfa2dac99 Author: David Herrmann Date: Mon Jun 18 16:17:28 2018 +0200 drm: provide management functions for drm_file Rather than doing drm_file allocation/destruction right in the fops, lets provide separate helpers. This decouples drm_file management from the still-mandatory drm-fops. It prepares for use of drm_file without the fops, both by possible separate fops implementations and APIs (not that I am aware of any such plans), and more importantly from in-kernel use where no real file is available. Signed-off-by: David Herrmann Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618141739.48151-2-noralf@tronnes.org commit dc748b66dbfbbfa187044f007d42d9cc01e5ab11 Author: Avi Fishman Date: Wed Jun 20 09:33:05 2018 +0300 dt-bindings: usb: new ehci-npcm7xx dt Device Tree documentation for Nuvoton npcm7xx EHCI. Signed-off-by: Avi Fishman Reviewed-by: Rob Herring Reviewed-by: Sergei Shtylyov Signed-off-by: Greg Kroah-Hartman commit df44831ee2dde0d61f17ca86069f2c992c0dae95 Author: Avi Fishman Date: Wed Jun 20 09:33:04 2018 +0300 USB host: Add USB ehci support for nuvoton npcm7xx platform This patch adds support for ehci controller for the Nuvoton npcm7xx platform. Most of the code was taken from ehci-spear.c + specific initialization code Signed-off-by: Avi Fishman Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit cae2bc768d176bfbdad7035bbcc3cdc973eb7984 Author: Jaejoong Kim Date: Thu Jun 21 17:45:05 2018 +0900 usb: cdc-acm: Decrement tty port's refcount if probe() fail The cdc-acm driver does not have a refcount of itself, but uses a tty_port's refcount. That is, if the refcount of tty_port is '0', we can clean up the cdc-acm driver by calling the .destruct() callback function of struct tty_port_operations. The problem is the destruct() callback function is not called if the probe() fails, because tty_port's refcount is not zero. So, add tty_port_put() when probe() fails. Signed-off-by: Jaejoong Kim Acked-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman commit 61ef4b90793b3c1905ed8cbec228ff63ecb1a5c5 Author: Arnd Bergmann Date: Mon Jun 18 16:27:45 2018 +0200 USB: mon: use ktime_get_real_ts64 instead of getnstimeofday64 The two do the same thing, but we want to remove getnstimeofday64() to have a more consistent interface. It would be nice to use a monotonic clocksource here rather than 'real' time, but that would break the user interface. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 41cc73c5568f148f9f7d3a1a53fb68c7da6086eb Author: Erwan Le Ray Date: Mon Jun 25 15:44:24 2018 +0200 ARM: dts: stm32: m_can activation on stm32mp157c-ev1 Add activation of the Controller Area Network m_can on stm32mp157c-ev1 board. Signed-off-by: Bich Hemon Signed-off-by: Erwan Le Ray Signed-off-by: Alexandre Torgue commit 8f9cc83c06d44081d7c7e179f778cbeb4d074fa7 Author: Alan Stern Date: Fri Jun 8 16:59:57 2018 -0400 USB: xhci-hcd: Add get_resuming_ports method This patch adds support for the new get_resuming_ports HCD method to the xhci-hcd driver. Signed-off-by: Alan Stern Acked-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit 00d423c8d0132915f4204b330343420c271b9142 Author: Alan Stern Date: Fri Jun 8 16:59:50 2018 -0400 USB: ehci-hcd: Add get_resuming_ports method This patch adds support for the new get_resuming_ports HCD method to the ehci-hcd driver. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit 379cacc5e566f7197bdeb1ea3e99219d3e880c0a Author: Alan Stern Date: Fri Jun 8 16:59:37 2018 -0400 USB: Report wakeup events on root-hub ports When a USB device attached to a root-hub port sends a wakeup request to a sleeping system, we do not report the wakeup event to the PM core. This is because a system resume involves waking up all suspended USB ports as quickly as possible; without the normal USB_RESUME_TIMEOUT delay, the host controller driver doesn't set the USB_PORT_STAT_C_SUSPEND flag and so usb_port_resume() doesn't realize that a wakeup request was received. However, some environments (such as Chrome OS) want to have all wakeup events reported so they can be ascribed to the appropriate device. To accommodate these environments, this patch adds a new routine to the hub driver and a corresponding new HCD method to be used when a root hub resumes. The HCD method returns a bitmap of ports that have initiated a wakeup signal but not yet completed resuming. The hub driver can then report to the PM core that the child devices attached to these ports initiated a wakeup event. Signed-off-by: Alan Stern Suggested-by: Anshuman Gupta Signed-off-by: Greg Kroah-Hartman commit 6b284a81307848b4331453b02cf7a33c09719d4b Author: Hiromitsu Yamasaki Date: Wed Jun 20 14:01:20 2018 +0200 arm64: dts: renesas: r8a77995: Add MSIOF device nodes This patch adds MSIOF device nodes for the R8A77995 SoC. Signed-off-by: Hiromitsu Yamasaki Signed-off-by: Takeshi Kihara [uli: remove unimplemented ref clock, clock-names] Signed-off-by: Ulrich Hecht Reviewed-by: Geert Uytterhoeven [simon: preserved node ordering by moving msiof nodes to before vin nodes] Signed-off-by: Simon Horman commit b6d3134ddcbe4d3c3986e4e7b649467a19045949 Author: Hiromitsu Yamasaki Date: Tue Jun 19 19:14:01 2018 +0200 arm64: dts: renesas: salvator-common: Add HSCIF1 device support This patch adds pin control for HSCIF1, and supports connection with Debug Serial-1 (CN26) on Salvator boards. SCIF1 and HSCIF1 are sharing the pins connected to Debug Serial-1 (CN26) on Salvator boards, and it is necessary to ensure that either SCIF1 or HSCIF1 is enabled, not both. As for the default of this DeviceTree, SCIF1 is connected. Signed-off-by: Hiromitsu Yamasaki Signed-off-by: Takeshi Kihara [geert: Add missing "uart-has-rtscts"] Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit a334e781e01afeb97634480ec0d9819287b79a68 Author: Sergei Shtylyov Date: Wed Jun 13 23:11:27 2018 +0300 arm64: dts: renesas: r8a77980: add FCPVD/VSPD/DU/LVDS support Describe the interconnected FCPVD0, VSPD0, DU, and LVDS0 devices in the R8A77980 device tree... Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Reviewed-by: Laurent Pinchart Signed-off-by: Simon Horman commit ffbd52352208534a30d5bbe2e15ee9e5cbb98c6d Author: Sergei Shtylyov Date: Wed Jun 13 19:42:15 2018 +0300 arm64: dts: renesas: condor/v3hsk: specify Ethernet PHY IRQs Specify Ethernet PHY IRQs in the Condor/V3HSK board device trees, now that we have the GPIO support (previously phylib had to resort to polling). Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman commit 406c5ad238d04135beaa9415d621e8b6157b7765 Author: Takeshi Kihara Date: Thu Jun 7 21:11:34 2018 +0900 arm64: dts: renesas: r8a77965: Add PCIe device nodes This patch adds PCIe{0,1} device nodes to R8A77965 SoC. Based on a similar patches of the R8A7796 device tree by Harunobu Kurokawa . Signed-off-by: Takeshi Kihara Signed-off-by: Yoshihiro Kaneko Signed-off-by: Simon Horman commit e21adc781bb45e810f1c396c4bc2c1624a4c25b9 Author: Laurent Pinchart Date: Fri Jun 8 15:21:15 2018 +0300 arm64: dts: renesas: Fix VSPD registers range The VSPD and FCPVD nodes have overlapping register ranges, as the FCPVD devices are mapped in the memory range usually used by the VSP LUT and CLU, which are not present in the VSPD. Fix this by shortening the VSPD registers range to 0x5000. Fixes: 9f8573e38a0b ("arm64: dts: renesas: r8a7795: Add VSP instances") Fixes: 291e0c4994d0 ("arm64: dts: r8a7795: Add support for R-Car H3 ES2.0") Fixes: f06ffdfbdd90 ("arm64: dts: r8a7796: Add VSP instances") Fixes: b4f92030d5d3 ("arm64: dts: renesas: r8a77970: add VSPD support") Fixes: 295952a183d3 ("arm64: dts: renesas: r8a77995: add VSP instances") Fixes: 85cb3229218a ("arm64: dts: renesas: r8a77965: Add VSP instances") Reported-by: Simon Horman Reported-by: Geert Uytterhoeven Signed-off-by: Laurent Pinchart Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit cba59c25888938720390c47aaf1e05f39b42ecf4 Author: Wolfram Sang Date: Mon Jun 11 23:49:35 2018 +0900 arm64: dts: renesas: convert to SPDX identifiers Signed-off-by: Wolfram Sang Acked-by: Yoshihiro Shimoda Acked-by: Kuninori Morimoto Signed-off-by: Simon Horman commit efcb52e35d162dc9104be56492b65049a17dc6a4 Author: Sergei Shtylyov Date: Fri Jun 1 23:44:46 2018 +0300 arm64: dts: renesas: r8a77980: add GPIO support Describe all 6 GPIO controllers in the R8A77980 device tree. Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 6dd72b4d3da1f2be7fc57511677a0cb782d6acd9 Author: Yoshihiro Shimoda Date: Wed Jun 6 18:52:06 2018 +0900 arm64: dts: renesas: r8a77990: Enable USB2.0 Host for Ebisu board This patch adds USB2.0 PHY and Host(EHCI/OHCI) nodes and enables them for R-Car E3 Ebisu board. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Simon Horman commit 51933b101567692b3a2a8e6d9e06883985c79724 Author: Harunobu Kurokawa Date: Tue Jun 5 02:49:08 2018 +0900 arm64: dts: renesas: r8a7796: Add PCIe device nodes This patch adds PCIe{0,1} device nodes for R8A7796 SoC. Signed-off-by: Harunobu Kurokawa Signed-off-by: Takeshi Kihara Signed-off-by: Yoshihiro Kaneko Signed-off-by: Simon Horman commit 7085f5d9e803688045e92ccb69e1f7fe0eee9621 Author: Geert Uytterhoeven Date: Tue Jun 5 19:17:13 2018 +0200 arm64: dts: renesas: r8a77990: Add secondary CA53 CPU core Add a device node for the second Cortex-A53 CPU core on the Renesas R-Car E3 (r8a77990) SoC, and adjust the interrupt delivery masks for ARM Generic Interrupt Controller and Architectured Timer. Based on a patch in the BSP by Takeshi Kihara. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit eb614d94395293da7beecaa29555acb8966a2796 Author: Takeshi Kihara Date: Tue Jun 5 19:20:34 2018 +0200 arm64: dts: renesas: r8a77990: ebisu: Enable watchdog timer Add a device node for the Watchdog Timer (WDT) controller on the R8A77990 SoC, and enable the watchdog on the Ebisu board. Signed-off-by: Takeshi Kihara [geert: Squashed 2 commits] Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 45fde0d498dc77e5fc221960843fa377e0c70822 Author: Sergei Shtylyov Date: Thu May 31 23:26:49 2018 +0300 arm64: dts: renesas: condor: add I2C0 support Define the Condor board dependent part of the I2C0 device node. The I2C0 bus is populated by 2 ON Semiconductor PCA9654 I/O expanders and Analog Devices ADV7511W HDMI transmitter (but we're only describing the former chips now). Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman commit bc620474c6e283c0e1e60796ed0ac9b04da9890c Author: Sergei Shtylyov Date: Thu May 31 23:22:39 2018 +0300 arm64: dts: renesas: r8a77980: add I2C support Define the generic R8A77980 parts of the I2C[0-5] device nodes. Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 56195dc5c3a156cad6afb7cbda411fd2cfd978ae Author: Takeshi Kihara Date: Mon May 28 21:29:47 2018 +0200 arm64: dts: renesas: salvator-x(s): Update I2C ch4 clock to 400kHz Any of the following devices connected to I2C ch4 of the Salvator-X(S) boards will operate at 400 kHz: PCA9654, 9FGV0841, ADV7482WBBCZ, MAX9611, 5P49V5923, 5P49V6901A This patch updates the clock frequency to 400 KHz. Signed-off-by: Takeshi Kihara [wsa: squashed commits into one] Signed-off-by: Wolfram Sang Signed-off-by: Simon Horman commit c5dd01aa790c436f2839ed9a7ab7feaf8924e7e4 Author: Masaharu Hayakawa Date: Mon May 28 21:28:42 2018 +0200 arm64: dts: renesas: Add sdhi2_ds pin group to SDHI2 pinctrl groups This patch adds definitions for configuration of the power-source, drive-strength, etc... for the SD2_DS pin for Salvator-X(S) and ULCB boards. Signed-off-by: Masaharu Hayakawa Signed-off-by: Takeshi Kihara [wsa: fixed for ULCB boards, too] Signed-off-by: Wolfram Sang Signed-off-by: Simon Horman commit b8e3c8e17611ccfa77acd4d06e1df7e49d40c763 Author: Takeshi Kihara Date: Mon May 28 15:16:19 2018 +0200 arm64: dts: renesas: r8a77965: Add all HSCIF nodes Based on a similar patch of the R8A7796 device tree by Ulrich Hecht . Signed-off-by: Takeshi Kihara Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit a6972dec904ed073bc40ccabd1bccca1bfd2f7bf Author: Geert Uytterhoeven Date: Mon May 28 15:15:29 2018 +0200 arm64: dts: renesas: r8a77965: Use r8a77965-cpg-mssr binding definitions Replace the hardcoded clock indices by R8A77965_CLK_* symbols. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 0f6d237cafda2e06b289eab1fa2addf09e666a07 Author: Gilad Ben-Yossef Date: Thu May 24 15:19:10 2018 +0100 arm64: dts: renesas: r8a7795: add ccree to device tree Add bindings for CryptoCell instance in the SoC. Signed-off-by: Gilad Ben-Yossef Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 0b3d87d12fd400efad7e089683e4ba314425a4d6 Author: Takeshi Kihara Date: Tue May 29 16:01:02 2018 +0900 arm64: dts: renesas: r8a77965: Add Watchdog Timer controller node using RCLK Watchdog Timer Add a device node for the Watchdog Timer (WDT) controller on the Renesas R-Car M3-N (R8A77965) SoC. Based on a similar patch of the R8A7796 device tree by Geert Uytterhoeven . Signed-off-by: Takeshi Kihara Signed-off-by: Yoshihiro Kaneko Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit c0f91cac37df2d6b7f2d6692552a2f16099f7755 Author: Sergei Shtylyov Date: Fri May 18 22:46:19 2018 +0300 arm64: dts: renesas: v3hsk: add GEther support Define the V3H Starter Kit board dependent part of the GEther device node. Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman commit 87bea6780b952dac7f58ed2395d2eaa434deb0fb Author: Sergei Shtylyov Date: Fri May 18 22:45:36 2018 +0300 arm64: dts: renesas: r8a77980: add GEther support Define the generic R8A77980 part of the GEther device node. Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven [simon: add resets property] Signed-off-by: Simon Horman commit 21bd05387fe6643a6f1cdfe395e85725fd296f6c Author: Yoshihiro Kaneko Date: Sun May 20 18:26:19 2018 +0900 arm64: dts: renesas: r8a77995: add thermal device support Signed-off-by: Yoshihiro Kaneko Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 2ec1e4b4a815ee872fb29753f4872abf1a2e62a4 Author: Sergei Shtylyov Date: Thu May 17 23:19:44 2018 +0300 arm64: dts: renesas: r8a77980: add SMP support Add the device nodes for 3 more Cortex-A53 CPU cores; adjust the interrupt delivery masks for the ARM GIC and Architectured Timer. Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven [simon: corrected whitespace] Signed-off-by: Simon Horman commit 1b1b30a233d41fe764190340654f648fe15905d2 Author: Jacopo Mondi Date: Mon May 21 16:45:42 2018 +0200 arm64: dts: renesas: draak: Describe HDMI input Describe HDMI input connector and ADV7612 HDMI decoder installed on R-Car Gen3 Draak board. The video signal routing to the HDMI decoder to the video input interface VIN4 is multiplexed with CVBS input path, and enabled/disabled through on-board switches SW-49, SW-50, SW-51 and SW-52. As the default board switches configuration connects CVBS input to VIN4, leave the HDMI decoder unconnected in DTS. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Simon Horman commit 6a0942c20f5ca9bf203a20ab4a91c7b7dcd6a0c5 Author: Jacopo Mondi Date: Mon May 21 16:45:41 2018 +0200 arm64: dts: renesas: draak: Describe CVBS input Describe CVBS video input through analog video decoder ADV7180 connected to video input interface VIN4. The video input signal path is shared with HDMI video input, and selected by on-board switches SW-53 and SW-54 with CVBS input selected by the default switches configuration. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Simon Horman commit 341238b57dfb1adf40d26557da4399de8823532a Author: Simon Horman Date: Mon May 14 16:35:43 2018 +0200 arm64: dts: renesas: r8a77995: don't use deprecated renesas,gpio-rcar compat string The compat string renesas,gpio-rcar has been deprecated since v4.14, the same release that r8a77990 SoC support was added. Thus renesas,gpio-rcar can safely be removed without any risk of behaviour changes between old and new mainline kernels and DTBs. Signed-off-by: Simon Horman commit 7e26bd3334bb21daefe092dc34e7a8e38bac576f Author: Magnus Damm Date: Mon May 21 23:04:14 2018 +0900 arm64: dts: renesas: r8a77995: Add IPMMU power domains Add power domain information to the R-Car D3 IPMMU device nodes. As specified by the data sheet, all the IPMMU devices are always on. Signed-off-by: Magnus Damm Signed-off-by: Simon Horman commit 856e7e42a4aa9a9acfadf84f4ff2b23ba6c69b11 Author: Ulrich Hecht Date: Tue May 15 14:20:40 2018 +0200 arm64: dts: renesas: draak: add X12 input dot clock 74.25 Mhz oscillator X12 is connected to DU_DOTCLKIN0. Signed-off-by: Ulrich Hecht Reviewed-by: Simon Horman Reviewed-by: Laurent Pinchart Signed-off-by: Simon Horman commit d4bdf2d2ba737c2c02ec014bdc2db40a030595d0 Author: Nicolas Adenis-Lamarre Date: Wed Jun 20 12:55:15 2018 +0200 HID: wiimote: add support for Guitar-Hero devices This adds the drums and guitar extensions for Wiimote devices. Devices are reported as "Nintendo Wii Remote Guitar/Drums". If I ever get my hands on "RockBand" guitars, I will try to report them via the same interface so user-space does not have to bother which device it deals with. This is a rebase of the original commits 8e22ecb603c8 and 73f8645db191. They were reverted several years ago, since they were dependent on the ABS_* rework of the input core. Sadly, this never worked out so these commits were never pushed into a release. This rebase now uses the ABS_HAT* event codes to report all pressure information. Signed-off-by: Nicolas.Adenis-Lamarre (Original commits by Nicolas, adapted to v4.18 by David) Signed-off-by: David Herrmann Signed-off-by: Jiri Kosina commit f49255e00c2e085b1467087d2dbb6b01d7042cc8 Author: Sebastian Andrzej Siewior Date: Tue Jun 19 23:59:44 2018 +0200 HID: usbhid: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the ->lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: linux-input@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Jiri Kosina commit dc9b8e85ed95cbe7e3ad0eabb5b48d617bbc365e Author: Robert Munteanu Date: Tue Jun 19 11:20:40 2018 +0300 HID: redragon: fix num lock and caps lock LEDs The redragon asura keyboard registers two input devices. The initial commit 85455dd906d5 ("HID: redragon: Fix modifier keys for Redragon Asura Keyboard") considered this an error and prevented one of the devices from registering. However, once this is done the num lock and caps lock leds no longer toggle on and off, although the key functionality is not affected. This commit removes the code that prevents the input device registration and restores the num lock and caps lock LEDs. Fixes: 85455dd906d5 ("HID: redragon: Fix modifier keys for Redragon Asura Keyboard") Signed-off-by: Robert Munteanu Signed-off-by: Jiri Kosina commit 44d4d51de9a3534a2b63d69efda02a10e66541e4 Author: Zhouyang Jia Date: Thu Jun 14 21:37:17 2018 +0800 HID: hid-ntrig: add error handling for sysfs_create_group When sysfs_create_group fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling sysfs_create_group. Signed-off-by: Zhouyang Jia Signed-off-by: Jiri Kosina commit 6136f97cd2dd2b5a88d62bd73cc663a803124c09 Author: Stephen Boyd Date: Thu Jun 21 19:27:17 2018 -0700 HID: i2c-hid: Add vddl regulator control Some wacom w9013 devices have a vddl supply for "low valtage" requirements. Add support in this driver to turn on this low voltage supply. We can also drop a handful of error messages because the regulator core is already printing an error when bulk regulators fail to enable or disable. Cc: Benjamin Tissoires Cc: Hans de Goede Cc: Andy Shevchenko Cc: Dmitry Torokhov Cc: Doug Anderson Acked-by: Rob Herring Cc: Signed-off-by: Stephen Boyd Acked-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit d6f83894110de247a81392ab7ef89e5498df7e80 Author: Stephen Boyd Date: Thu Jun 21 19:27:16 2018 -0700 HID: i2c-hid: Use devm to allocate i2c_hid struct Use devm here to save some lines and prepare for bulk regulator usage in this driver. Otherwise, when we devm bulk get regulators we'll free the containing i2c_hid structure and try to put regulator pointers from freed memory. Cc: Benjamin Tissoires Cc: Hans de Goede Cc: Andy Shevchenko Cc: Dmitry Torokhov Cc: Doug Anderson Signed-off-by: Stephen Boyd Acked-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 35fbd905b05d318573bd86c6abfeda32156b461d Merge: 50c678772a0b cd31b8073685 Author: Mark Brown Date: Mon Jun 25 14:05:18 2018 +0100 Merge tag 'pxa-for-4.19-dma_slave_map' of https://github.com/rjarzmik/linux into asoc-4.19 for ac'97 deps commit c322d96fccc4ab727c6df6394cb882836dad8292 Author: Erwan Le Ray Date: Tue May 15 14:23:00 2018 +0200 ARM: dts: stm32: m_can support to stm32mp157c Add support for the Controller Area Network m_can to STM32MP157C SoC. Signed-off-by: Bich Hemon Signed-off-by: Erwan Le Ray Signed-off-by: Alexandre Torgue commit 1e726a40e067948ecf90b8ea876bb6038c0c495f Author: Lionel Debieve Date: Mon May 14 12:00:00 2018 +0200 ARM: dts: stm32: Add HASH support on stm32mp157c This patch add HASH instance of the stm32mp157c SoC Signed-off-by: Lionel Debieve Signed-off-by: Alexandre Torgue commit 50c678772a0b3f9dc6b04262f27e2c373fe03a4d Author: Janusz Krzysztofik Date: Sun Jun 24 20:14:41 2018 +0200 ASoC: cx20442: Don't ignore regulator_get() errors. In its current shape, the driver just ignores errors returned by regulator_get() at component_probe(). This doesn't hurt on Amstrad Delta board as long as it registers the codec device at late_initcall, when the regulator which depends on basic-mmio-gpio device (probed as late as at dev_initcall) is already available. Otherwise the driver may end up trying to control a codec which is not powered up. Remove that dependency on initialization order by handling the error. If the regulator is not yet available and -ENODEV is returned, convert it to -EPROBE_DEFER to get another chance. Signed-off-by: Janusz Krzysztofik Signed-off-by: Mark Brown commit 860f0d21a7ef6675f5566aeac3d754414f105894 Author: Amelie Delaunay Date: Wed May 9 17:18:00 2018 +0200 ARM: dts: stm32: update rtc st,syscfg property on stm32f746 To fit with latest rtc driver updates, rtc st,syscfg property must contain the control register offset of pwrcfg and the mask corresponding to the DBP (Disable Backup Protection) bit. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit 3306657119ce673629be62dfa373f440eaf16cc9 Author: Amelie Delaunay Date: Wed May 9 17:18:00 2018 +0200 ARM: dts: stm32: update rtc st,syscfg property on stm32f429 To fit with latest rtc driver updates, rtc st,syscfg property must contain the control register offset of pwrcfg and the mask corresponding to the DBP (Disable Backup Protection) bit. Signed-off-by: Amelie Delaunay Signed-off-by: Alexandre Torgue commit 996302c5e85650722f1e5aeaeaaac12f9f362bf8 Author: Masahiro Yamada Date: Sun Jun 24 00:37:44 2018 +0900 module: replace VMLINUX_SYMBOL_STR() with __stringify() or string literal With the special case handling for Blackfin and Metag was removed by commit 94e58e0ac312 ("export.h: remove code for prefixing symbols with underscore"), VMLINUX_SYMBOL_STR() is now equivalent to __stringify(). Replace the remaining usages to prepare for the entire removal of VMLINUX_SYMBOL_STR(). Signed-off-by: Masahiro Yamada Signed-off-by: Jessica Yu commit 4c3d88526eba214357150764a0e3e5308acbef4a Author: Michel Pollet Date: Thu Jun 14 11:56:34 2018 +0100 clk: renesas: Renesas R9A06G032 clock driver This provides a clock driver for the Renesas R09A06G032. This uses a structure derived from both the R-Car Gen2 driver as well as the renesas-cpg-mssr driver. Signed-off-by: Michel Pollet Signed-off-by: Geert Uytterhoeven commit e4b08e1f3e86a5acda93fc7adb014840af7248bb Author: Michel Pollet Date: Thu Jun 14 11:56:31 2018 +0100 dt-bindings: clock: renesas,r9a06g032-sysctrl: documentation The Renesas R9A06G032 SYSCTRL node description. Signed-off-by: Michel Pollet Reviewed-by: Rob Herring Signed-off-by: Geert Uytterhoeven commit 62267e0ecc9c00a1b8ff7859cfa03e34b419f7ee Author: Jason A. Donenfeld Date: Fri Jun 22 17:38:50 2018 +0200 module: print sensible error code Printing "err 0" to the user in the warning message is not particularly useful, especially when this gets transformed into a -ENOENT for the remainder of the call chain. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jessica Yu commit 3391ca1dcd70a8e958984f7e95f242d36f0b9ab8 Author: Chengguang Xu Date: Mon Jun 25 15:35:18 2018 +0800 USB: serial: cast sizeof() to int when comparing with error code Negative error code will be larger than sizeof(). Note that none of these bugs prevent errors from being detected, even if the ir-usb one would cause a less precise debug message to printed. Signed-off-by: Chengguang Xu [ johan: add comment about implications ] Signed-off-by: Johan Hovold commit c879f71c746c655ae03e1b828296c461b77ac8b6 Merge: 514211f542dd f1b0a4343c41 Author: Martin Schwidefsky Date: Mon Jun 25 10:25:09 2018 +0200 Merge branch 'zcrypt' into features Add the zcrypt base patches into features using a tip branch for parallel merging via multiple tress. commit f1b0a4343c4184bef9fdea8fad41f09bbd3d63ec Author: Harald Freudenberger Date: Tue Jun 12 15:42:36 2018 +0200 s390/zcrypt: Integrate ap_asm.h into include/asm/ap.h. Move all the inline functions from the ap bus header file ap_asm.h into the in-kernel api header file arch/s390/include/asm/ap.h so that KVM can make use of all the low level AP functions. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 4a07750ba8f3f45f0be730f7370c2c21a7491cd7 Author: Harald Freudenberger Date: Thu Jun 7 15:09:48 2018 +0200 s390/zcrypt: Show load of cards and queues in sysfs Show the current load value of cards and queues in sysfs. The load value for each card and queue is maintained by the zcrypt device driver for dispatching and load balancing requests over the available devices. This patch provides the load value to userspace via a new read only sysfs attribute 'load' per card and queue. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit df80c03831331b6254ae9f16b6a10e672e0919c2 Author: Harald Freudenberger Date: Thu Jun 7 11:44:19 2018 +0200 s390/zcrypt: Review inline assembler constraints. Reviewed and adapted the register use and asm constraints of the C inline assembler functions in accordance to the the AP instructions specifications. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit ea3c4185efb34e3157caf0529be8f1a68acc0550 Author: Harald Freudenberger Date: Thu Jun 7 07:19:48 2018 +0200 s390/zcrypt: Add ZAPQ inline function. Added new inline function ap_pqap_zapq() which is a C inline function wrapper for the AP PQAP(ZAPQ) instruction. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 514211f542dd6eb877adf46d400ce351c81d95ad Author: Vasily Gorbik Date: Tue Jun 12 16:46:59 2018 +0200 s390/setup: do not reserve the decompressor code Introduce PARMAREA_END, and use it for memblock reserve of low memory, which is used for lowcore, kdump data mover code and page buffer, early stack and parmarea. There is no need to reserve an area between PARMAREA_END and the decompressor _ehead. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 6075e4ae6e729778ac687a9ffb0c0d5223a0a19e Author: Arnd Bergmann Date: Mon Jun 18 12:05:00 2018 +0200 s390: hypfs: use ktime_get_seconds() instead of get_seconds() time_t and get_seconds() are deprecated because they will overflow on 32-bit architectures in the future. This is not a problem on 64-bit s390, but we should use proper interfaces anyway. Besides moving to the time64_t based interface, the CLOCK_MONOTONIC based ktime_get_seconds() is preferred for kernel internal timekeeping because it does not behave in unexpected ways during leap second changes or settimeofday() calls. Signed-off-by: Arnd Bergmann Signed-off-by: Martin Schwidefsky commit 89b5202e81df9f0f0f0a11cf8c78bc8bfdc52a21 Author: Vasily Gorbik Date: Wed Jun 13 00:00:25 2018 +0200 s390/decompressor: support uncompressed kernel Implement uncompressed kernel support (when "None" is picked in kernel compression mode list). In that case an actual decompression code is skipped and control is passed from boot/head.S to startup_continue in kernel/head64.S. To achieve that uncompressed kernel payload is conditionally put at 0x100000 in bzImage. In reality this is very close to classic uncompressed kernel "image", but the decompressor has its own build and link process, kernel/head64.S lives at 0x100000 rather than at 0x11000, and .bss section is reused for both stages. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit f16466af385b985f8d56f3fc50146ab41ec0dd89 Author: Vasily Gorbik Date: Tue Jun 12 21:26:35 2018 +0200 init/Kconfig: add an option for uncompressed kernel Add "None" as the kernel compression mode. This option is useful for debugging the kernel in slow simulation environments, where decompressing and moving the kernel is awfully slow. Uncompressed kernel implementation might allow early boot code to skip the decompressor and jump right at uncompressed kernel image entry point. Platforms implementing that should define HAVE_KERNEL_UNCOMPRESSED. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit c98b6c679a3b8032a2dd5c9724f489e1b959e5a7 Author: Vasily Gorbik Date: Wed Jun 13 06:34:45 2018 +0200 s390/decompressor: allow to pack uncompressed vmlinux.bin into piggy.o If none of compression methods defined, leave suffix-y empty, so that plain uncompressed vmlinux.bin could be reused instead. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit b8326bf52e0894004c790183228c1ec18aae7f72 Author: Vasily Gorbik Date: Tue Jun 12 21:59:13 2018 +0200 s390/decompressor: allow preprocessor in piggy.o linker script Rename vmlinux.scr to vmlinux.scr.lds.S and add it to build rules to enable preprocessor for it. Also add vmlinux.scr.lds to local .gitignore Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 0580bce1312f75362662881c938192856167cf7e Author: Vasily Gorbik Date: Wed May 16 10:57:44 2018 +0200 s390/decompressor: extend .bss check for early code Cover the decompressor code with no .bss usage compile time check. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 78c95647e76d830e8193ac254a012b0e56d5675d Author: Vasily Gorbik Date: Wed May 16 10:50:02 2018 +0200 s390: add custom target and make path extension optional for .bss check "chkbss-target" could be now used to override default target .bss check is bound to. Objects to be checked are only path extended when needed. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 4560ff1386e35f51f7bafa0107fe4e0eb31db090 Author: Vasily Gorbik Date: Tue Jun 12 21:52:45 2018 +0200 s390/decompressor: avoid repeating objects list in Makefile Optimize the decompressor's Makefile to have a single objects list. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit cad5b35da9f7e429131592421c463a93703bb02e Author: Vasily Gorbik Date: Tue Jun 12 22:58:50 2018 +0200 s390/decompressor: reuse lib/mem.S for mem functions Reusing arch/s390/lib/mem.S file solves a problem that sclp_early_core.c and its dependencies have to be compiled with -march=z900 (no need to compile compressed/misc.c with -march=z900). This also allows to avoid mem functions duplicates, makes code a bit smaller and optimized mem functions are utilized. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit a1d7d91f105413750b5c8fb6a13a8c969a8b1f81 Author: Vasily Gorbik Date: Tue Jun 12 15:52:01 2018 +0200 s390/decompressor: avoid reusing uncompressed image objects Re-compile ebcdic.c and sclp_early_core.c for the decompressor, using proper decompressor CFLAGS. This also allows to potentially use instrumentation for those files when built for the main kernel image. With kbuild there is no easy way to re-compile a source file from another directory. Bypass ugly rules and Makefile meta-programming with relative path includes of original files. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 2dd26659e3167526212b7b3a18a5c747058aff1e Author: Vasily Gorbik Date: Tue Jun 12 15:14:51 2018 +0200 s390/als: avoid .init.* sections usage Since als.c is the part of the decompressor only, there is no point in using init sections for code and data. That's just creating extra sections in the decompressor image. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit a5802353b1ee8e4c97e5c255bed7651b924098fa Author: Vasily Gorbik Date: Wed Jun 13 06:25:36 2018 +0200 s390/decompressor: rename entry point to startup_decompressor Rename the decompressor entry point to startup_decompressor to avoid confusion, leaving startup_continue as the entry point of the uncompressed image. Also remove obsolete comment, as the decompressor code is unconditionally called from boot/head.S now. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 8282cd64d0f9a5292e9f8408a96733523e7f1fec Author: Vasily Gorbik Date: Tue Jun 12 15:11:40 2018 +0200 s390/boot: make head.S and als.c be part of the decompressor only Since uncompressed kernel image does not have to be bootable anymore, move head.S, head_kdump.S and als.c to boot/ folder and compile them in just in the decompressor. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit bd79d66329580d6c3fd9556423d2e5124906cfdd Author: Vasily Gorbik Date: Tue Jun 12 15:11:40 2018 +0200 s390/decompressor: trim the kernel image up to 1M Move head64.S main kernel entry point "startup_continue" to 0x100000 and trim everything which is below 1M during build. So, that the decompressor would unpack the main kernel image, move it to 0x100000 and jump to startup_continue. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 00f2fb573fdc3c21f3b7266a4a8758a85943edfb Author: Vasily Gorbik Date: Mon Jun 11 14:35:01 2018 +0200 s390: remove uncompressed kernel image build Dropping support for uncompressed kernel "image" build. Having both image and bzImage makes it complicated to add new code to an early boot phase (which is part of vmlinux for uncompressed kernel and a separate arch/s390/boot/compressed/vmlinux for bzImage). e.g. sclp_early_core.o is used for both, the decompressor phase and the main kernel. The fact of having uncompressed kernel "image" forces us to have a single object file and sacrifice instrumentation flags on such files (so that we could use them early). The story gets much more complicated with the need to utilize some of the string functions. With bzImage only support, we have 2 separate boot stages each built and linked separately, which allows to reuse some shared code, but recompile with appropriate flags. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 76bf9d6cef5788c769af987ff6f8ece40c6ab152 Author: Vasily Gorbik Date: Fri Jun 15 12:28:05 2018 +0200 s390/decompressor: correct build flags The decompressor requires its own set of cc and asm flags, to avoid building with features which do not make sense at such an early boot stage (e.g. expoline, ftrace). Currently cc flags are already set for the decompressor, but "cflags-y" is not exported and hence empty. To fix that and to add asm flags, define and export KBUILD_AFLAGS_DECOMPRESSOR and KBUILD_CFLAGS_DECOMPRESSOR and rely on them in the decompressor's Makefile. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 19f73e16199ee21b95e15bb5c380ad69f12e8c5b Author: Vasily Gorbik Date: Fri Jun 15 10:48:54 2018 +0200 s390/build: remove obsolete -mkernel-backchain flag -mkernel-backchain cc flag is obsolete since quite a while, and not present in minimal (supported by s390) gcc version 4.3. Removing it. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 157484abb9b05e3f49cd3903202ffad35cea4350 Author: Vasily Gorbik Date: Fri Jun 15 10:22:18 2018 +0200 s390: disable asm code expolines if cc does not support it To avoid a mixture of asm code with expolines and c code without them, propagate CC_USING_EXPOLINE to KBUILD_AFLAGS and use it to detect whether asm code should have expolines or not. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky commit 64e03ff72623b8c2ea89ca3cb660094e019ed4ae Author: Julian Wiedmann Date: Wed May 16 09:37:25 2018 +0200 s390/qdio: reset old sbal_state flags When allocating a new AOB fails, handle_outbound() is still capable of transmitting the selected buffer (just without async completion). But if a previous transfer on this queue slot used async completion, its sbal_state flags field is still set to QDIO_OUTBUF_STATE_FLAG_PENDING. So when the upper layer driver sees this stale flag, it expects an async completion that never happens. Fix this by unconditionally clearing the flags field. Fixes: 104ea556ee7f ("qdio: support asynchronous delivery of storage blocks") Cc: #v3.2+ Signed-off-by: Julian Wiedmann Signed-off-by: Martin Schwidefsky commit efe557320ab6cea12205794fd4062e6e850b7e1c Author: Takashi Iwai Date: Fri Jun 15 11:55:02 2018 +0200 ALSA: hda/realtek - Apply PRE_PROBE fixup after ALC269 codec variant setups Currently patch_alc269() calls the fixup with HDA_FIXUP_ACT_PRE_PROBE before setting up the codec model-specific setups (e.g. setting codec_variant or mixer_nid setup). This is rather confusing as others do call the *_PRE_PROBE fixup after such a setup. Due to this disorder, we have to override spec->shutup not at the usual HDA_FIXUP_ACT_PRE_PROBE but the unusual HDA_FIXUP_ACT_PROBE time. This patch corrects the fixup call orders in patch_alc269(), and also corrects the action to set up spec->shutup accordingly. No functional changes but just refactoring. Signed-off-by: Takashi Iwai commit f8bfc628f73c95c242dd49efa16d59005d8558fc Author: Takashi Iwai Date: Wed Jun 20 17:27:50 2018 +0200 ALSA: hda/via - Use standard verb containers In this patch, the remaining static init verbs in VIA codec driver are converted to the standard snd_hda_add_verbs() calls. The conversion is straightforward, but one change to be noted is the place of calls: since these verbs are supposed to be executed at the beginning of the init / resume procedure, we need to add snd_hda_add_verbs() calls before calling the other parsers. This is merely a cleanup, no functional changes. Signed-off-by: Takashi Iwai commit 0e8f9862493a55d85d3351cb4517f2e4d95c9600 Author: Takashi Iwai Date: Wed Jun 20 17:20:42 2018 +0200 ALSA: hda/via - Simplify control management This patch replaces the control element creations in VIA codec driver with the standard snd_hda_gen_add_kctl() calls as a cleanup. There are two major fields targeted by this patch: the beep controls and static init controls. The former is converted just like other codec drivers do. The spec->beep_amp field can be eliminated by this change as well. The latter, static init controls, are replaced simply with explicit snd_hda_gen_add_kctl() calls. After these conversions, via_build_controls() becomes superfluous and replaced with snd_hda_gen_build_controls(), too. Signed-off-by: Takashi Iwai commit fcbdcc1a93dd49ccd0e0f34224ce1ba4203b75de Author: Takashi Iwai Date: Wed Jun 20 22:36:17 2018 +0200 ALSA: hda/via - Rewrite with error goto Currently VIA codec driver invokes via_free() at each place of the error path. Move the error handling to the end of each function commonly and do goto-error as a standard idiom. This is a preliminary patch for the further cleanups, and no functional changes. Signed-off-by: Takashi Iwai commit 0785b0ecb8fa960b4f49010d0679d174efad423c Author: Takashi Iwai Date: Wed Jun 20 17:10:51 2018 +0200 ALSA: hda/cirrus - Simplify creation of new controls This patch moves the mixer creation code in Cirrus codec driver from its own build_controls callback to snd_hda_gen_add_kctl() for simplification. As a bonus, this allows us to remove the cs421x_build_controls as it becomes identical with snd_hda_gen_build_controls(). Signed-off-by: Takashi Iwai commit 51e19ca5f7555802687324d3bee3bc6b7df240d4 Author: Takashi Iwai Date: Wed Jun 20 17:06:58 2018 +0200 ALSA: hda/conexant - Clean up beep code Like the previous commit for Realtek codec, the similar cleanup work can be applied to Conexant codec, too. A slight difference is that the call of cx_auto_parse_beep() is moved after snd_hda_gen_parse_auto_config(). It's not strictly needed, but it'd be good to make the creation of such beep mixers at the end, which matches with the former situation. Along with this conversion, cx_auto_build_controls() becomes just calling snd_hda_gen_build_controls(), so it's simply replaced with snd_hda_gen_build_controls. Signed-off-by: Takashi Iwai commit fea80fae552c428b67591cb0aacca56c11c3eeaf Author: Takashi Iwai Date: Wed Jun 20 12:52:46 2018 +0200 ALSA: hda/realtek - Use common helper for creating beep controls In the Realtek codec driver, we used to build kctl elements for beep mixer in the own build_controls callback. This is an open-code and can be covered by the standard feature of the generic parser with snd_hda_gen_add_kctl() instead. Also, after the conversion, spec->beep_amp becomes superfluous; hence it's removed along with the conversion. Signed-off-by: Takashi Iwai commit a5cb463a81737dde1ef3f1b1cf3e17bf69f20669 Author: Takashi Iwai Date: Wed Jun 20 12:50:11 2018 +0200 ALSA: hda/realtek - Use common helper for creating ALC268 beep controls The beep mixer controls are the only remaining stuff that uses spec->mixers[] array, and they can be well converted to the standard helper in the generic parser, snd_hda_gen_add_kctl(). This simplifies the code, especially the superfluous mixers and num_mixers fields can be now removed from alc_spec. Signed-off-by: Takashi Iwai commit df73d83fad97237b68949058e632b48d55533c09 Author: Takashi Iwai Date: Tue Jun 19 23:05:47 2018 +0200 ALSA: hda/realtek - Use common GPIO mask for ALC660VD ASUS fixup The ALC660VD_FIX_ASUS_GPIO1 quirk requires to set up GPIO bit0 ON while bit 1 OFF. Implement the fixup function and convert from the static init verbs. Signed-off-by: Takashi Iwai commit d44a68640668544891fc4b468284d1eaeb49c1d8 Author: Takashi Iwai Date: Tue Jun 19 23:04:03 2018 +0200 ALSA: hda/realtek - Simplify Dell XPS13 GPIO handling Dell XPS13 has multi-step fixups, and one of them (ALC288_FIXUP_DELL_XPS_13_GPIO6) corresponds to the management of GPIO bit6 (0x40). It used to be a static init verbs (to turn *off* the bit6). In this patch, we convert it as the gpio_mask and gpio_dir initializations folded in the existing fixup function. With this change, ALC288_FIXUP_DELL_XPS_13_GPIO6 becomes superfluous, thus it's removed. Signed-off-by: Takashi Iwai commit ae065f1ce07c09600af0e1dbb6b071991f7cb6e5 Author: Takashi Iwai Date: Tue Jun 19 23:00:03 2018 +0200 ALSA: hda/realtek - Convert some manual GPIO setups This patch converts the remaining static init verbs for GPIO bits with the common gpio_* fields management. Only the verbs setting the GPIO data bits are targeted in this patch. The rest will be changed in later patches. Signed-off-by: Takashi Iwai commit 01e4a275e93bc955d0b79520156da6367505658f Author: Takashi Iwai Date: Tue Jun 19 22:47:30 2018 +0200 ALSA: hda/realtek - Simplify mute LED GPIO handling Now we can simplify the mute LED GPIO handling as well. Each fixup dealing with GPIO for the mute LED controls defined the static init verbs, and they are converted to the common GPIO bit fields with the new helper, alc_fixup_hp_gpio_led(). Signed-off-by: Takashi Iwai commit 215c850cf205fa502aa45c2540b8d8bc70bd0f1e Author: Takashi Iwai Date: Tue Jun 19 22:34:26 2018 +0200 ALSA: hda/realtek - Simplify alc885_fixup_macpro_gpio() The fixup for Macbook Pro is nothing but setting the GPIO bits as usual but with one exception: it adds some delay at writing the GPIO bits. Add a flag to put the conditional delay in the common helper, and clean up alc885_fixup_macpro_gpio() with the new flag. Signed-off-by: Takashi Iwai commit d261eec80ca987a2415dd26f982ca25844e4497c Author: Takashi Iwai Date: Tue Jun 19 22:32:29 2018 +0200 ALSA: hda/realtek - Consolidate gpio_data and gpio_led Until now, two fields, gpio_data and gpio_led, coexist in alc_spec although basically both of them serve for the same purpose -- the GPIO data bits. This patch consolidates both usages and eliminates the superfluous gpio_led field. Signed-off-by: Takashi Iwai commit aaf312de4eb915e5b45c65c2da7304bf34b5ab47 Author: Takashi Iwai Date: Tue Jun 19 22:28:22 2018 +0200 ALSA: hda/realtek - Add GPIO data update helper For updating GPIO bits dynamically, provide a new helper, and use it from the alc260 automute hook. This helper will be used by other places in future, too. Signed-off-by: Takashi Iwai commit 5579cd6f6629bc1e09b3b2d13ab7a1ed371c5ac2 Author: Takashi Iwai Date: Tue Jun 19 22:22:41 2018 +0200 ALSA: hda/realtek - Manage GPIO bits commonly Currently the GPIO bits are managed by individual verbs in some cases while toggled dynamically in other cases. For simplifying the GPIO management, define the GPIO mask, dir and data bits in alc_spec fields, and refer to / set them consistently from all places. As a first step, along with the definition of the new gpio_* fields, this patch replaces the static verbs that are used at initialization and fixups with the common helper functions. Signed-off-by: Takashi Iwai commit 1c76aa5fb48d8357f38fb2f1d2cef742a617d695 Author: Takashi Iwai Date: Thu Jun 21 16:37:54 2018 +0200 ALSA: hda/realtek - Allow skipping spec->init_amp detection Some devices have the overrides of spec->init_amp at HDA_FIXUP_ACT_PROBE just because alc_ssid_check() gives the false-positive values from the SSID. For more consistent behavior, define the logic in the following way: - Define ALC_INIT_UNDEFINED as the default value before calling alc_ssid_check() - Each fixup may set up spec->init_amp with another value at HDA_FIXUP_ACT_PRE_PROBE - At detection, check whether spec->init_amp is ALC_INIT_UNDEFINED or not; if it's different, we skip the detection Also, it turned out that ASUS TX300 requires the spec->init_amp override, too; currently it ignores the GPIO bits implicitly by its static init verb, but this will be changed in the later patchset. Signed-off-by: Takashi Iwai commit ab1bcc93b73dda48a618adbf9d94bef111fd15db Merge: 1bce62a6e0dd 2225a3e6af78 Author: Takashi Iwai Date: Mon Jun 25 10:03:39 2018 +0200 Merge branch 'topic/ac97-bus' into for-next commit 2225a3e6af78e605119e0f178ae957d860882b1d Author: Robert Jarzmik Date: Fri Jun 22 21:28:34 2018 +0200 ALSA: ac97: add codecs devicetree binding Add a devicetree binding for codecs. This is especially useful if the AC97 bitclk clock is provided by the codec, as it has to be described in the devicetree description for the ac97 bus code to aquire it. Signed-off-by: Robert Jarzmik Signed-off-by: Takashi Iwai commit cc51574ad2632dde790241129617bb97f46f7c85 Author: Robert Jarzmik Date: Fri Jun 22 21:28:33 2018 +0200 ALSA: ac97: add bus binding for codecs Add the generic ac97 bus binding, especially for ac97 codecs discovered by ac97 hardware probing. Signed-off-by: Robert Jarzmik Signed-off-by: Takashi Iwai commit 818489e511a3a38d4c9c120675e0700608925800 Author: Sudeep Holla Date: Mon Jun 18 15:34:22 2018 +0100 ARM: cpuidle: silence error on driver registration failure It's perfectly fine to have multiple cpuidle driver compiled in the build configuration. However, it's not good to throw error on driver registration failure if some other driver is already initialised and assigned. In such cases, __cpuidle_register_driver returns -EBUSY and we can check for such error before throwing the error. Signed-off-by: Sudeep Holla Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 823819507095135b475a99048f0b0b6e75580fbc Merge: 064f390265be fe87bef01f9b Author: David S. Miller Date: Mon Jun 25 16:21:52 2018 +0900 Merge branch 'r8169-improve-PHY-initialization-and-WoL-handling' Heiner Kallweit says: ==================== r8169: improve PHY initialization and WoL handling Series with smaller improvements regarding PHY initialization and WoL handling. ==================== Signed-off-by: David S. Miller commit fe87bef01f9be5d968badb35648a527fa37888c1 Author: Heiner Kallweit Date: Sun Jun 24 18:40:23 2018 +0200 r8169: don't check WoL when powering down PHY and interface is down We can power down the PHY irregardless of WOL settings if interface is down. So far we would have left the PHY enabled if WOL options are set and the interface is brought down. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 433f9d0ddcc6020ac5ecc91626f12e3e23b52be0 Author: Heiner Kallweit Date: Sun Jun 24 18:39:06 2018 +0200 r8169: improve saved_wolopts handling Let's make saved_wolopts a shadow copy of the WoL options. This allows to simplify the code and get rid of calls to now unneeded function __rtl8169_get_wol(). However don't remove __rtl8169_get_wol() completely to be prepared for the case that we can respect BIOS WOL settings again. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 92bad8509159b2377b40fe91a6b37f1b4cb63569 Author: Heiner Kallweit Date: Sun Jun 24 18:37:36 2018 +0200 r8169: improve phy initialization when resuming Let's move calling rtl8169_init_phy() to __rtl8169_resume(). It simplifies the code and avoids rtl8169_init_phy() being called when resuming whilst interface is down. rtl_open() will initialize the PHY when the interface is brought up. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 064f390265be42763e804f742b1d920e4e997ddb Merge: 0ef8b4567d08 246ab6f01efb Author: David S. Miller Date: Mon Jun 25 16:14:04 2018 +0900 Merge branch 'sched-couple-of-ndo_setup_tc-fixes-and-adjustments' Jiri Pirko says: ==================== net: sched: couple of ndo_setup_tc fixes and adjustments This patchset includes couple of patches that fix or adjust default cases and return values in ndo_setup_tc implementations in drivers. ==================== Signed-off-by: David S. Miller commit 246ab6f01efb808610535be34aab2de9325da6fa Author: Jiri Pirko Date: Sun Jun 24 10:38:39 2018 +0200 cls_flower: fix error values for commands not supported by drivers -EOPNOTSUPP is the error value that should be reported if a flower command is not supported by a driver. Fix it in couple of Intel drivers. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit eba7927b55938b8db7ba5d76086f0ab0a2e2274d Author: Jiri Pirko Date: Sun Jun 24 10:38:38 2018 +0200 nfp: handle cls_flower command default case Currently the default case is not handled, which with future command introductions would introduce a warning. So handle it. Signed-off-by: Jiri Pirko Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 83741bb0430465ea9f0654d4772c03d694b33ad7 Author: Jiri Pirko Date: Sun Jun 24 10:38:37 2018 +0200 bnxt: simplify cls_flower command switch and handle default case Currently the default case is not handled, which with future command introductions would introduce a warning. So handle it and make the switch a bit simplier removing unneeded "rc" variable. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 3c8daa7db46dd50c95778b4fbca5c7da6edaac9b Author: Christian König Date: Fri Jun 22 12:37:37 2018 +0200 drm/omap: remove now unused functions Some functions are unused after removal of the kmap_atomic DMA-buf interface. Signed-off-by: Christian König Fixes: f664a5269542 ("dma-buf: remove kmap_atomic interface") Link: https://patchwork.freedesktop.org/series/45245/ Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie commit 3a658f23fb689107d9dd4801f3042978723b0e8c Author: Zhu Yi Date: Wed May 30 11:41:11 2018 -0700 Input: add bu21029 touch driver Add Rohm BU21029 resistive touch panel controller support with I2C interface. Signed-off-by: Zhu Yi Signed-off-by: Mark Jonas Reviewed-by: Heiko Schocher Reviewed-by: Rob Herring Signed-off-by: Dmitry Torokhov commit 7a1f1b594a3d102f3766b9866aa081f5480c0be0 Author: Masahiro Yamada Date: Sun Jun 24 00:35:42 2018 +0900 mtd: replace VMLINUX_SYMBOL_STR() with string literal With the special case handling for Blackfin and Metag was removed by commit 94e58e0ac312 ("export.h: remove code for prefixing symbols with underscore"), VMLINUX_SYMBOL_STR() can be replaced with string literal. Signed-off-by: Masahiro Yamada Signed-off-by: Boris Brezillon commit 829caee7e38273ef27d64207578d4653979c525e Author: Rickard Strandqvist Date: Thu Jan 1 20:18:22 2015 +0100 arch: mips: mm: page: Remove unused function Remove the function sb1_dma_init() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist Patchwork: https://patchwork.linux-mips.org/patch/8873/ Signed-off-by: Paul Burton Cc: John Crispin Cc: Thomas Bogendoerfer Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit ff404a936a958a45e3969730e065ea2886acc5e8 Author: Rickard Strandqvist Date: Thu Jan 1 16:32:06 2015 +0100 arch: mips: pci: pci-ip27.c: Remove unused function Remove the function pci_enable_swapping() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist Patchwork: https://patchwork.linux-mips.org/patch/8867/ Signed-off-by: Paul Burton Cc: John Crispin Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit dd129c6374e90e665ec022019bcc2f392f25cf2c Author: Paul Burton Date: Mon Sep 19 22:21:31 2016 +0100 MIPS: Malta: Use PIIX4 poweroff driver to power down Remove the platform code used to power down the system, instead relying upon the new PIIX4 poweroff driver. This reduces the amount of platform code required for the Malta board in preparation for allowing it to be part of a more generic kernel. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/14282/ commit a07539c00046dfa890e6aac1db4f0de01acb0132 Author: Paul Burton Date: Fri Sep 2 16:10:06 2016 +0100 MIPS: Malta: Cleanup DMA coherence #ifdefs DMA coherence is not user-selectable in Kconfig, and Malta selects CONFIG_DMA_MAYBE_COHERENT which in turn selects CONFIG_DMA_NONCOHERENT. Remove #ifdefs whose conditions can therefore never be true for Malta. This removes a significant amount of code from bonito_quirks_setup(), but the code is duplicated in plat_enable_iocoherency() anyway so we lose nothing but duplication. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/14188/ commit d1c5872ce1042d10d44e54b6e8e8f5b7c2e76541 Author: Paul Burton Date: Fri Jun 2 15:17:25 2017 -0700 MIPS: Set MIPS_IC_SNOOPS_REMOTE for systems with CM In systems that include a MIPS Coherency Manager, the icache always fills from a cache which is coherent across all CPUs. In I6400 & I6500 systems the icache fills from the dcache which is coherent across all CPUs. In all other CM-based systems the icache fills from the L2 cache which is shared between all cores. This means that an icache will always see stores from remote CPUs without needing to write them back any further than that L2, which is what the cpu_icache_snoops_remote_store feature is used to test. In order for it to return 1 without needing a per-platform override (which is what Malta has relied upon so far) set the MIPS_IC_SNOOPS_REMOTE flag when a CM is present. Signed-off-by: Paul Burton Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16200/ commit 8fd2d6ea66272f849943269c7ea771ce85fd8fb1 Author: Joshua Kinard Date: Tue Oct 17 14:26:12 2017 -0400 MIPS: Use !pci_is_root_bus(bus) in ops-bridge.c This is a manual cherrypick of commit c7ddc3d137b7 from Alastair Bridgewater's IP35 tree that replaces two cases of "if (bus->number > 0)" with a more correct "if (!pci_is_root_bus(bus))" in arch/mips/pci/ops-bridge.c. Cc: linux-mips@linux-mips.org Cc: Alastair Bridgewater Suggested-by: Alastair Bridgewater Signed-off-by: Joshua Kinard Patchwork: https://patchwork.linux-mips.org/patch/17501/ Signed-off-by: Paul Burton Cc: Linux/MIPS commit 8c8d953c28000045e5e823f3398319f04d49a7f1 Author: Paul Burton Date: Tue Dec 19 15:11:08 2017 -0800 MIPS: Schedule on CPUs we need to lose FPU for a mode switch Commit 6b8322576e9d ("MIPS: Force CPUs to lose FP context during mode switches") ensures that we react to PR_SET_FP_MODE prctl syscalls quickly by broadcasting an IPI in order to cause CPUs to lose FPU access when necessary. Whilst it achieves that, unfortunately it causes all sorts of strange race conditions because: 1) The IPI may arrive at a point where the FPU is in the process of being enabled, but that process is not yet complete leading to a state we aren't prepared to handle. For example: [ 370.215903] do_cpu invoked from kernel context![#1]: [ 370.221064] CPU: 0 PID: 963 Comm: fp-prctl Not tainted 4.9.0-rc5-00323-g210db32-dirty #226 [ 370.229420] task: a8000000fd672e00 task.stack: a8000000fd630000 [ 370.235399] $ 0 : 0000000000000000 0000000000000001 0000000000000001 a8000000fd630000 [ 370.243882] $ 4 : a8000000fd672e00 0000000000000000 0000000000000453 0000000000000000 [ 370.252317] $ 8 : 0000000000000000 a8000000fd637c28 1000000000000000 0000000000000010 [ 370.260753] $12 : 00000000140084e0 ffffffff80109c00 0000000000000000 0000000000000002 [ 370.269179] $16 : ffffffff8092f080 a8000000fd672e00 ffffffff80107fe8 a8000000fd485000 [ 370.277612] $20 : ffffffff8084d328 ffffffff80940000 0000000000000009 ffffffff80930000 [ 370.286038] $24 : 0000000000000000 900000001612048c [ 370.294476] $28 : a8000000fd630000 a8000000fd637ac0 ffffffff80937300 ffffffff8010807c [ 370.302909] Hi : 0000000000000000 [ 370.306595] Lo : 0000000000000200 [ 370.310376] epc : ffffffff80115d38 _save_fp+0x10/0xa0 [ 370.315784] ra : ffffffff8010807c prepare_for_fp_mode_switch+0x94/0x1b0 [ 370.322707] Status: 140084e2 KX SX UX KERNEL EXL [ 370.327980] Cause : 1080002c (ExcCode 0b) [ 370.332091] PrId : 0001a428 (MIPS P6600) [ 370.336179] Modules linked in: [ 370.339486] Process fp-prctl (pid: 963, threadinfo=a8000000fd630000, task=a8000000fd672e00, tls=00000000756e67d0) [ 370.349724] Stack : 0000000000000000 a8000000fd557dc0 0000000000000000 ffffffff801ca8e0 [ 370.358161] 0000000000000000 a8000000fd637b9c 0000000000000009 ffffffff80923780 [ 370.366575] ffffffff80850000 ffffffff8011610c 00000000000000b8 ffffffff801a5084 [ 370.374989] ffffffff8084a370 ffffffff8084a388 ffffffff80923780 ffffffff80923828 [ 370.383395] 0000000000010000 ffffffff809237a8 0000000000020000 ffffffff80a40000 [ 370.391817] 000000000000007c 00000000004a0000 00000000756dedd0 ffffffff801a5188 [ 370.400230] a800000002014900 0000000000000001 ffffffff80923780 0000000080923828 [ 370.408644] ffffffff80923780 ffffffff80923780 ffffffff80923828 ffffffff801a521c [ 370.417066] ffffffff80923780 ffffffff80923828 0000000000010000 ffffffff801a8f84 [ 370.425472] ffffffff80a40000 a8000000fd637c20 ffffffff80a39240 0000000000000001 [ 370.433885] ... [ 370.436562] Call Trace: [ 370.439222] [] _save_fp+0x10/0xa0 [ 370.444305] [] prepare_for_fp_mode_switch+0x94/0x1b0 [ 370.451035] [] flush_smp_call_function_queue+0xf8/0x230 [ 370.457991] [] ipi_call_interrupt+0xc/0x20 [ 370.463814] [] __handle_irq_event_percpu+0xc4/0x1a8 [ 370.470404] [] handle_irq_event_percpu+0x20/0x68 [ 370.476734] [] handle_irq_event+0x4c/0x88 [ 370.482486] [] handle_edge_irq+0x12c/0x210 [ 370.488316] [] generic_handle_irq+0x38/0x48 [ 370.494280] [] gic_handle_shared_int+0x194/0x268 [ 370.500616] [] generic_handle_irq+0x38/0x48 [ 370.506529] [] do_IRQ+0x18/0x28 [ 370.511445] [] plat_irq_dispatch+0xc4/0x140 [ 370.517339] [] ret_from_irq+0x0/0x4 [ 370.522583] [] do_ri+0x4fc/0x7e8 [ 370.527546] [] ret_from_exception+0x0/0x10 2) The IPI may arrive during kernel use of the FPU, since we generally only disable preemption around use of the FPU & leave interrupts enabled. This can lead to us unexpectedly losing access to the FPU in places where it previously had not been possible. For example: do_cpu invoked from kernel context![#2]: CPU: 2 PID: 7338 Comm: fp-prctl Tainted: G D 4.7.0-00424-g49b0c82 #2 task: 838e4000 ti: 88d38000 task.ti: 88d38000 $ 0 : 00000000 00000001 ffffffff 88d3fef8 $ 4 : 838e4000 88d38004 00000000 00000001 $ 8 : 3400fc01 801f8020 808e9100 24000000 $12 : dbffffff 807b69d8 807b0000 00000000 $16 : 00000000 80786150 00400fc4 809c0398 $20 : 809c0338 0040273c 88d3ff28 808e9d30 $24 : 808e9d30 00400fb4 $28 : 88d38000 88d3fe88 00000000 8011a2ac Hi : 0040273c Lo : 88d3ff28 epc : 80114178 _restore_fp+0x10/0xa0 ra : 8011a2ac mipsr2_decoder+0xd5c/0x1660 Status: 1400fc03 KERNEL EXL IE Cause : 1080002c (ExcCode 0b) PrId : 0001a920 (MIPS I6400) Modules linked in: Process fp-prctl (pid: 7338, threadinfo=88d38000, task=838e4000, tls=766527d0) Stack : 00000000 00000000 00000000 88d3fe98 00000000 00000000 809c0398 809c0338 808e9100 00000000 88d3ff28 00400fc4 00400fc4 0040273c 7fb69e18 004a0000 004a0000 004a0000 7664add0 8010de18 00000000 00000000 88d3fef8 88d3ff28 808e9100 00000000 766527d0 8010e534 000c0000 85755000 8181d580 00000000 00000000 00000000 004a0000 00000000 766527d0 7fb69e18 004a0000 80105c20 ... Call Trace: [<80114178>] _restore_fp+0x10/0xa0 [<8011a2ac>] mipsr2_decoder+0xd5c/0x1660 [<8010de18>] do_ri+0x90/0x6b8 [<80105c20>] ret_from_exception+0x0/0x10 At first glance a simple fix may seem to be to disable interrupts around kernel use of the FPU rather than merely preemption, however this would introduce further overhead outside of the mode switch path & doesn't solve the third problem: 3) The IPI may arrive whilst the kernel is running code that will lead to a preempt_disable() call & FPU usage soon. If this happens then the IPI will be serviced & we'll proceed to enable an FPU whilst the mode switch is in progress, leading to strange & inconsistent behaviour. Further to all of this is a separate but related problem: 4) There are various paths through which we may enable the FPU without the user having triggered a coprocessor 1 disabled exception. These paths are those in which we emulate instructions & then enable the FPU with the expectation that the user might execute an FP instruction shortly afterwards. However these paths have not previously checked whether an FP mode switch is underway for the task, and therefore could enable the FPU whilst such a mode switch is in progress leading to strange & inconsistent behaviour for user code. This patch fixes all of the above by taking a step back & re-examining our approach to FP mode switches. Up until now we have taken these basic steps: a) Prevent any threads that are part of the affected process from being able to obtain ownership of the FPU. b) Cause any threads that are part of the affected process and already have ownership of an FPU to lose it. c) Set the thread flags for each thread that is part of the affected process to reflect the new FP mode. d) Allow threads to obtain ownership of the FPU again. This approach is however more complex than necessary. All that we really require is that the mode switch has occurred for all threads that are part of the affected process before mips_set_process_fp_mode(), and thus the PR_SET_FP_MODE prctl() syscall, returns. This doesn't require that we stop threads from owning or using an FPU whilst a mode switch occurs, only that we force them to relinquish it after the mode switch has occurred such that they next own an FPU with the correct mode configured. Our basic steps therefore simplify to: A) Set the thread flags for each thread that is part of the affected process to reflect the new FP mode. B) Cause any threads that are part of the affected process and already have ownership of an FPU to lose it. We implement B) by forcing each CPU which might be running a thread which is part of the affected process to schedule a no-op function, which causes the affected thread to lose its FPU ownership when it is descheduled. The end result is simpler FP mode switching with less overhead in the FPU enable path (ie. enable_restore_fp_context()) and fewer moving parts. Signed-off-by: Paul Burton Fixes: 9791554b45a2 ("MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for MIPS") Fixes: 6b8322576e9d ("MIPS: Force CPUs to lose FP context during mode switches") Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: stable # v4.0+ commit 9667bb039bf6b5168d502c888fa3ea64b49d2641 Author: Rob Herring Date: Tue Jun 19 15:47:10 2018 -0600 MIPS: lantiq: remove unnecessary of_platform_default_populate call The DT core will call of_platform_default_populate, so it is not necessary for arch specific code to call it unless there are custom match entries, auxdata or parent device. Neither of those apply here, so remove the call. Cc: John Crispin Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: linux-mips@linux-mips.org Signed-off-by: Rob Herring Patchwork: https://patchwork.linux-mips.org/patch/19592/ Signed-off-by: Paul Burton Cc: linux-kernel@vger.kernel.org commit 6a7ec6c5ca0c8264bd505be122ca2d4ede60de92 Author: Rob Herring Date: Tue Jun 19 15:47:09 2018 -0600 MIPS: generic: remove unnecessary of_platform_populate call The DT core will call of_platform_populate, so it is not necessary for arch specific code to call it unless there are custom match entries, auxdata or parent device. Neither of those apply here, so remove the call. Cc: Paul Burton Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Signed-off-by: Rob Herring Patchwork: https://patchwork.linux-mips.org/patch/19591/ Signed-off-by: Paul Burton Cc: linux-kernel@vger.kernel.org commit 0279455f166dd79eb6bb1b45982401480db778db Author: Rob Herring Date: Tue Jun 19 15:47:08 2018 -0600 MIPS: bmips: remove unnecessary call to register "simple-bus" The DT core will register "simple-bus" by default, so it is not necessary for arch specific code to do so unless there are custom match entries, auxdata or parent device. Neither of those apply here, so remove the call. Cc: Kevin Cernekee Cc: Florian Fainelli Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: linux-mips@linux-mips.org Signed-off-by: Rob Herring Patchwork: https://patchwork.linux-mips.org/patch/19590/ Signed-off-by: Paul Burton Cc: linux-kernel@vger.kernel.org commit 40c911ed8432130385ecd049922d7c994a83883d Author: Rob Herring Date: Tue Jun 19 15:47:07 2018 -0600 MIPS: netlogic: remove unnecessary of_platform_bus_probe call The DT core code will probe "simple-bus" by default, so remove the Netlogic specific call. The probing of simple-bus happens at arch_initcall_sync, so the call being removed here is already a nop. Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: linux-mips@linux-mips.org Signed-off-by: Rob Herring Patchwork: https://patchwork.linux-mips.org/patch/19589/ Signed-off-by: Paul Burton Cc: linux-kernel@vger.kernel.org commit f072f9ce9bd3602bd3b14e15513ee80d437cf4cf Author: Rob Herring Date: Tue Jun 19 15:47:06 2018 -0600 MIPS: octeon: use of_platform_populate to probe devices of_platform_bus_probe is deprecated in favor of of_platform_populate. of_platform_populate is stricter requiring compatible properties for matching rather than name or type. Octeon uses compatible strings for matching, so convert it to of_platform_populate. Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: linux-mips@linux-mips.org Signed-off-by: Rob Herring Patchwork: https://patchwork.linux-mips.org/patch/19588/ Signed-off-by: Paul Burton Cc: linux-kernel@vger.kernel.org commit c8bf38055efaf764fd8c313695759c64dc735842 Author: Heiher Date: Mon Jun 11 17:01:10 2018 +0800 MIPS: Fix ejtag handler on SMP On SMP systems, the shared ejtag debug buffer may be overwritten by other cores, because every cores can generate ejtag exception at same time. Unfortunately, in that context, it's difficult to relax more registers to access per cpu buffers. so use ll/sc to serialize the access. [paul.burton@mips.com: This could in theory be backported at least as far back as the beginning of the git era, however in general it's exceedingly rare that anyone would hit this without further changes, so it doesn't seem worthwhile marking for backport.] Signed-off-by: Heiher Patchwork: https://patchwork.linux-mips.org/patch/19507/ Signed-off-by: Paul Burton Cc: jhogan@kernel.org Cc: ralf@linux-mips.org commit be462bd9700aec12029d43d48e6ff2207cb68fb7 Author: Masahiro Yamada Date: Mon Apr 16 23:47:46 2018 +0900 MIPS: boot: merge build rules of vmlinux.*.itb by using pattern rule Merge the build rule of vmlinux.{gz,bz2,lzma,lzo}.itb, and also move 'targets' close to the related code. [paul.burton@mips.com: - Remove leading tabs from assignments to itb_addr_cells, since after this patch moves the additions to the 'targets' variable the assignments to itb_addr_cells wound up being treated as part of the uImage rule above them, causing the .its to incorrectly be generated with empty ADDR_CELLS.] Signed-off-by: Masahiro Yamada Patchwork: https://patchwork.linux-mips.org/patch/19095/ Signed-off-by: Paul Burton Cc: Kees Cook Cc: linux-kernel@vger.kernel.org commit 92b34a9763480b12745a2fc93ff14972426fe8df Author: Masahiro Yamada Date: Mon Apr 16 23:47:45 2018 +0900 MIPS: boot: add missing targets for vmlinux.*.its The build rule of vmlinux.*.its is invoked by $(call if_changed,...) but it always rebuilds the target needlessly due to missing targets. Signed-off-by: Masahiro Yamada Patchwork: https://patchwork.linux-mips.org/patch/19092/ Signed-off-by: Paul Burton Cc: Kees Cook Cc: linux-kernel@vger.kernel.org commit 67e09db507db3e1642ddce512a4313d20addd6e5 Author: Masahiro Yamada Date: Mon Apr 16 23:47:43 2018 +0900 MIPS: boot: fix build rule of vmlinux.its.S As Documentation/kbuild/makefile.txt says, it is a typical mistake to forget the FORCE prerequisite for the rule invoked by if_changed. Add the FORCE to the prerequisite, but it must be filtered-out from the files passed to the 'cat' command. Because this rule generates .vmlinux.its.S.cmd, vmlinux.its.S must be specified as targets so that the .cmd file is included. Signed-off-by: Masahiro Yamada Patchwork: https://patchwork.linux-mips.org/patch/19097/ Signed-off-by: Paul Burton Cc: Kees Cook Cc: linux-kernel@vger.kernel.org commit 321f95b643573d689ac1fb5b68b90044ba47d1a4 Author: Masahiro Yamada Date: Mon Apr 16 23:47:42 2018 +0900 MIPS: boot: do not include $(cpp_flags) for preprocessing ITS $(CPP) is used here to perform macro replacement in ITS. Do not pass $(cpp_flags) because it pulls in more options for dependency file generation etc. but none of which is necessary here. ITS files do not include any header file, so $(call if_change,...) is enough. Signed-off-by: Masahiro Yamada Patchwork: https://patchwork.linux-mips.org/patch/19093/ Signed-off-by: Paul Burton Cc: Kees Cook Cc: linux-kernel@vger.kernel.org commit 902b923da619b79e311fd456f78c24619d03131b Author: Masahiro Yamada Date: Mon Apr 16 23:47:41 2018 +0900 Revert "MIPS: boot: Define __ASSEMBLY__ for its.S build" This reverts commit 0f9da844d87796ac31b04e81ee95e155e9043132. It is true that commit 0f9da844d877 ("MIPS: boot: Define __ASSEMBLY__ for its.S build") fixed the build error, but it should not have defined __ASSEMBLY__ just for textual substitution in arbitrary data. The file is image tree source in this case, but the purpose of using CPP is to replace some macros. I merged a better solution, commit a95b37e20db9 ("kbuild: get out of "). The original fix-up is no longer needed. Signed-off-by: Masahiro Yamada Patchwork: https://patchwork.linux-mips.org/patch/19096/ Signed-off-by: Paul Burton Cc: Kees Cook Cc: linux-kernel@vger.kernel.org commit 7896de7bd727c9269b7571cfa8dcbc9b99dfb13c Author: Nicholas Mc Guire Date: Sat Jun 16 09:26:32 2018 +0200 MIPS: Octeon: assign bool true/false not 1/0 Booleans should be assigned true/false not 1/0 as comparison is not needed Signed-off-by: Nicholas Mc Guire Patchwork: https://patchwork.linux-mips.org/patch/19559/ Signed-off-by: Paul Burton Cc: James Hogan Cc: David Daney Cc: "Steven J. Hill" Cc: Joe Perches Cc: Colin Ian King Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org commit 803ad26eed4a5db07cc52e8dec387689cd007df4 Author: Christoph Hellwig Date: Fri Jun 15 13:08:54 2018 +0200 MIPS: remove unneeded includes from dma-mapping.h Keep this file as light as possible as it gets pulled into every driver using dma mapping APIs. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19552/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 28f512d9cb48ec09288e4cc4475d022d1745b7bf Author: Christoph Hellwig Date: Fri Jun 15 13:08:53 2018 +0200 MIPS: remove the old dma-default implementation Now unused. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19551/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit d59098a0e9cb3c7767090e935c909b37a30629ab Author: Christoph Hellwig Date: Fri Jun 15 13:08:52 2018 +0200 MIPS: bmips: use generic dma noncoherent ops Provide phys_to_dma/dma_to_phys helpers, and the special arch_sync_dma_for_cpu_all hook, everything else is generic Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19550/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit faef87723ace12e5f685437c1e68cbecb69a7a89 Author: Christoph Hellwig Date: Fri Jun 15 13:08:51 2018 +0200 dma-noncoherent: add a arch_sync_dma_for_cpu_all hook The MIPS bmips platform needs a global flush when transferring ownership back to the CPU. Add a hook for that to the dma-noncoherent implementation. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19549/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit c5e2bbb45d28d53d278f25068142a283a0a74f7a Author: Christoph Hellwig Date: Fri Jun 15 13:08:50 2018 +0200 MIPS: jazz: split dma mapping operations from dma-default Jazz actually has a very basic IOMMU, so split the ops into a separate implementation from the generic default support (which is about to go away anyway). Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19548/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit d1f2564a5639bb54493eaa313aef612aee47ba7c Author: Christoph Hellwig Date: Fri Jun 15 13:08:49 2018 +0200 MIPS: ath25: use generic dma noncoherent ops Provide phys_to_dma/dma_to_phys helpers only if PCI support is enabled, everything else is generic. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19547/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 03df8229a822ab2c262bf78b05a3ada686b885b9 Author: Christoph Hellwig Date: Fri Jun 15 13:08:48 2018 +0200 MIPS: IP32: use generic dma noncoherent ops Provide phys_to_dma/dma_to_phys helpers, everything else is generic. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19546/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit e905086e6b2fc9d7e2764cf04622743ca86558f1 Author: Christoph Hellwig Date: Wed Jun 20 09:11:15 2018 +0200 MIPS: loongson64: use generic dma noncoherent ops Provide phys_to_dma/dma_to_phys helpers, everything else is generic. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19545/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit f8c55dc6e828324fc58c0bb32d72a5a4041d1c3b Author: Christoph Hellwig Date: Fri Jun 15 13:08:46 2018 +0200 MIPS: use generic dma noncoherent ops for simple noncoherent platforms Convert everything not overriding dma-coherence.h to the generic noncoherent ops. The new dma-noncoherent.c file duplicates a lot of the code in dma-default.c, but that file will be gone by the end of this series. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19544/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit aa4db775959a65ddbb4a5b2c886cc520614abb81 Author: Christoph Hellwig Date: Fri Jun 15 13:08:45 2018 +0200 MIPS: move coherentio setup to setup.c We want to be able to use it even when not building dma-default.c in the near future. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19543/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 54aed4dd35269ef15eb1569517f34fb3961d4d34 Author: Christoph Hellwig Date: Fri Jun 15 13:08:44 2018 +0200 MIPS: IP27: use dma_direct_ops IP27 is coherent and has a reasonably direct mapping, just with a little per-bus offset added into the dma address. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19542/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit dffbfde7582b03f57aed15055dbf8af433c5b1ae Author: Christoph Hellwig Date: Fri Jun 15 13:08:43 2018 +0200 MIPS: use dma_direct_ops for coherent I/O Switch the simple cache coherent architectures that don't require any DMA address translation to dma_direct_ops. We'll soon use at least parts of the direct DMA ops implementation for all platforms, so select the symbol globally. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19540/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit d7e64bf9499b1c260f274d00199c4556196ec5e5 Author: Christoph Hellwig Date: Fri Jun 15 13:08:42 2018 +0200 MIPS: loongson: remove loongson-3 handling from dma-coherence.h Loongson3 is dma coherent and uses swiotlb, so it will never used any of these helpers. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19541/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit d3bc81befcf2634c64f1b2a95311d54ccfa1e06c Author: Christoph Hellwig Date: Fri Jun 15 13:08:41 2018 +0200 MIPS: loongson: untangle dma implementations Only loongson-3 is DMA coherent and uses swiotlb. So move the dma address translations stubs directly to the loongson-3 code, and remove a few Kconfig indirections. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19539/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit a330a9c59b45e53dee7985237340f6480a1ea08f Author: Christoph Hellwig Date: Fri Jun 15 13:08:40 2018 +0200 MIPS: Octeon: move swiotlb declarations out of dma-coherence.h No need to pull them into a global header. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19538/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 1f99e4b13b312737f0c4059d668782534ea1dc76 Author: Christoph Hellwig Date: Fri Jun 15 13:08:39 2018 +0200 MIPS: Octeon: remove mips dma-default stubs Octeon doesn't use the dma-default code, and now doesn't built it either, so these stubs can be removed. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19537/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 3369ddb62a42e8392562c86d63811ba8b0167a58 Author: Christoph Hellwig Date: Fri Jun 15 13:08:38 2018 +0200 MIPS: make the default mips dma implementation optional Octeon and loonson64 already don't use it at all, and we're going to migrate more plaforms away from it. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19536/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit d3b83dcc7fcba94b7ec6bc0899828e1d814d20a9 Author: Christoph Hellwig Date: Fri Jun 15 13:08:37 2018 +0200 MIPS: remove the mips_dma_map_ops indirection And use mips_default_dma_map_ops directly. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19535/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit f6d302e33d68ddbaf99c774ed994599243462b24 Author: Christoph Hellwig Date: Fri Jun 15 13:08:36 2018 +0200 MIPS: consolidate the swiotlb implementations Octeon and Loongson share exactly the same code, move it into a common implementation, and use that implementation directly from get_arch_dma_ops. Also provide the expected dma-direct.h helpers directly instead of delegating to platform dma-coherence.h headers. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19534/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit e799de3efb9d6e0df5740eed901b89a6e533eaef Author: Christoph Hellwig Date: Fri Jun 15 13:08:35 2018 +0200 MIPS: loongson: remove loongson_dma_supported swiotlb_dma_supported will always return true for a mask large enough to cover the DMA addresses for all physical memory, which is the right thing to do for swiotlb based dma ops. This function returned false if the mask was bigger than a firmware set dma_mask_bits that apparently can be either 32 or 64, and which seems completely buggys if it actually is not 64, as the false return negates the whole point of swiotlb. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19533/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 97f9f9763a7a431e04f0ffd4e62d0d288a59f908 Author: Christoph Hellwig Date: Fri Jun 15 13:08:34 2018 +0200 MIPS: Octeon: refactor swiotlb code Share a common set of swiotlb operations, and to instead branch out in __phys_to_dma/__dma_to_phys for the PCI vs non-PCI case. Also use const structures for the PCI methods so that attackers can't use them as exploit vectors. Signed-off-by: Christoph Hellwig Patchwork: https://patchwork.linux-mips.org/patch/19532/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit e20c5074f829c091d1173622213c98c963bebb91 Author: Christoph Hellwig Date: Fri Jun 15 13:08:33 2018 +0200 MIPS: Octeon: unexport __phys_to_dma and __dma_to_phys These functions are just low-level helpers for the swiotlb and dma-direct implementations, and should never be used by drivers. Signed-off-by: Christoph Hellwig Reviewed-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19531/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 7e4dbdc11261bd7aaa18051247d01429e0b7cd03 Author: Christoph Hellwig Date: Fri Jun 15 13:08:32 2018 +0200 MIPS: remove CONFIG_DMA_COHERENT We can just check for !CONFIG_DMA_NONCOHERENT instead and simplify things a lot. Signed-off-by: Christoph Hellwig Reviewed-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19530/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 972dc3b79f421b5ae553b1073708cbd0d4da4a91 Author: Christoph Hellwig Date: Fri Jun 15 13:08:31 2018 +0200 MIPS: simplify CONFIG_DMA_NONCOHERENT ifdefs CONFIG_DMA_MAYBE_COHERENT already selects CONFIG_DMA_NONCOHERENT, so we can remove the extra conditions. Signed-off-by: Christoph Hellwig Reviewed-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19529/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 9c78ecaf7ba88818b45303365d05b5a3461e0f3b Author: Christoph Hellwig Date: Fri Jun 15 13:08:30 2018 +0200 MIPS: remove a dead ifdef from mach-ath25/dma-coherence.h ath25 is alwas non-coherent, so keeping these ifdefs doesn't make any sense. Signed-off-by: Christoph Hellwig Reviewed-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19528/ Signed-off-by: Paul Burton Cc: Florian Fainelli Cc: David Daney Cc: Kevin Cernekee Cc: Jiaxun Yang Cc: Tom Bogendoerfer Cc: Huacai Chen Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org commit 28a87b459baf7a2b583ba2cdc553e58419b2e40b Author: Yegor Yefremov Date: Wed Apr 25 09:39:06 2018 +0200 MIPS: kexec: fix typos Correct a couple of typos within comments in arch/mips/kernel/relocate_kernel.S. [paul.burton@mips.com: Add a commit message.] Signed-off-by: Yegor Yefremov Patchwork: https://patchwork.linux-mips.org/patch/19218/ Signed-off-by: Paul Burton commit 0c3bf18491c094d9fdc1d0a0a9f0f9f8f520869d Author: Thomas Bogendoerfer Date: Tue Jun 5 12:00:20 2018 +0200 MIPS: Make elf2ecoff work on 64bit host machines Use fixed width integer types for ecoff structs to make elf2ecoff work on 64bit host machines. Signed-off-by: Thomas Bogendoerfer Reviewed-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19483/ Signed-off-by: Paul Burton commit 0ef8b4567d08a557b5226a4926ffd689ef0298ad Author: Vakul Garg Date: Mon Jun 25 01:37:50 2018 +0530 tls: Removed unused variable Removed unused variable 'rxm' from tls_queue(). Signed-off-by: Vakul Garg Signed-off-by: David S. Miller commit 45e7f5d2889a35b6e1b0eecdcc2e0a1ebac071bf Author: Arnd Bergmann Date: Mon Jun 18 17:31:36 2018 +0200 iio: use timespec64 based interfaces for iio_get_time_ns() We have replacements for all the deprecated timespec based interfaces now, so this can finally convert iio_get_time_ns() to consistently use the nanosecond or timespec64 based interfaces instead, avoiding the y2038 overflow. Signed-off-by: Arnd Bergmann Signed-off-by: Jonathan Cameron commit 5f1d651fbfa7d9de678c58329c645727261e5cb8 Author: Karim Eshapa Date: Mon Jun 18 19:44:50 2018 +0200 staging:iio:accel:adis16240: sign extend function replace hard code duplication Use sign_extend32 kernel function instead of code duplication, Safe also for 16 bit. and remove declaration of bits variable not needed. Signed-off-by: Karim Eshapa Signed-off-by: Jonathan Cameron commit 6fc0de37f663278af160e8e1f0c38b27e6c06206 Author: Reinette Chatre Date: Fri Jun 22 15:42:30 2018 -0700 x86/intel_rdt: Limit C-states dynamically when pseudo-locking active Deeper C-states impact cache content through shrinking of the cache or flushing entire cache to memory before reducing power to the cache. Deeper C-states will thus negatively impact the pseudo-locked regions. To avoid impacting pseudo-locked regions C-states are limited on pseudo-locked region creation so that cores associated with the pseudo-locked region are prevented from entering deeper C-states. This is accomplished by requesting a CPU latency target which will prevent the core from entering C6 across all supported platforms. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/1ef4f99dd6ba12fa6fb44c5a1141e75f952b9cd9.1529706536.git.reinette.chatre@intel.com commit f3be1e7b2cf8bc096386a3588fc640b0db6b28d7 Author: Reinette Chatre Date: Fri Jun 22 15:42:29 2018 -0700 x86/intel_rdt: Support L3 cache performance event of Broadwell Broadwell microarchitecture supports pseudo-locking. Add support for the L3 cache related performance events of these systems so that the success of pseudo-locking can be measured more accurately on these platforms. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/36c1414e9bd17c3faf440f32b644b9c879bcbae2.1529706536.git.reinette.chatre@intel.com commit 8a2fc0e1bc0cd856101927188884d7c370b62188 Author: Reinette Chatre Date: Fri Jun 22 15:42:28 2018 -0700 x86/intel_rdt: More precise L2 hit/miss measurements Intel Goldmont processors supports non-architectural precise events that can be used to give us more insight into the success of L2 cache pseudo-locking on these platforms. Introduce a new measurement trigger that will enable two precise events, MEM_LOAD_UOPS_RETIRED.L2_HIT and MEM_LOAD_UOPS_RETIRED.L2_MISS, while accessing pseudo-locked data. A new tracepoint, pseudo_lock_l2, is created to make these results visible to the user. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/06b1456da65b543479dac8d9493e41f92f175d6c.1529706536.git.reinette.chatre@intel.com commit 746e08590b864cf730d7bd23394e2d3fbb0f22b6 Author: Reinette Chatre Date: Fri Jun 22 15:42:27 2018 -0700 x86/intel_rdt: Create character device exposing pseudo-locked region After a pseudo-locked region is created it needs to be made available to user space for usage. A character device supporting mmap() is created for each pseudo-locked region. A user space application can now use mmap() system call to map pseudo-locked region into its virtual address space. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/fccbb9b20f07655ab0a4df9fa1c1babc0288aea0.1529706536.git.reinette.chatre@intel.com commit 5126aec542fecf68dac877ea9da47d3777edcbfb Author: Geert Uytterhoeven Date: Fri Jun 22 13:05:01 2018 +0200 iio: adc: Remove depends on HAS_DMA in case of platform dependency Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their dependencies on HAS_DMA, to prevent compiling subsystems or drivers that cannot work anyway. This simplifies the dependencies, and allows to improve compile-testing. Signed-off-by: Geert Uytterhoeven Reviewed-by: Mark Brown Acked-by: Robin Murphy Signed-off-by: Jonathan Cameron commit 67cc414e6474eeee6f7c948cc420e4b247a7e0e3 Author: Andreas Klinger Date: Sat Jun 23 20:55:18 2018 +0200 iio: hx711: add maintainer for driver add a maintainer for driver hx711 Signed-off-by: Andreas Klinger Signed-off-by: Jonathan Cameron commit 0e4c88f37693d4857fc0be66e548e2eb8b3d8a15 Author: Vitaly Kuznetsov Date: Thu Jun 21 15:32:38 2018 +0200 x86/hyper-v: Use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} hypercalls when possible While working on Hyper-V style PV TLB flush support in KVM I noticed that real Windows guests use TLB flush hypercall in a somewhat smarter way: When the flush needs to be performed on a subset of first 64 vCPUs or on all present vCPUs Windows avoids more expensive hypercalls which support sparse CPU sets and uses their 'cheap' counterparts. This means that HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED name is actually a misnomer: EX hypercalls (which support sparse CPU sets) are "available", not "recommended". This makes sense as they are actually harder to parse. Nothing stops us from being equally 'smart' in Linux too. Switch to doing cheaper hypercalls whenever possible. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "Michael Kelley (EOSG)" Cc: Tianyu Lan Cc: devel@linuxdriverproject.org Cc: "H. Peter Anvin" Link: https://lkml.kernel.org/r/20180621133238.30757-1-vkuznets@redhat.com commit 6ff84735070276d72af716e21c3214ee20d60e70 Author: Deepa Dinamani Date: Sat Jun 16 22:11:44 2018 -0700 time: Change types to new y2038 safe __kernel_itimerspec timer_set/gettime and timerfd_set/get apis use struct itimerspec at the user interface layer. struct itimerspec is not y2038-safe. Change these interfaces to use y2038-safe struct __kernel_itimerspec instead. This will help define new syscalls when 32bit architectures select CONFIG_64BIT_TIME. Signed-off-by: Deepa Dinamani Signed-off-by: Thomas Gleixner Cc: arnd@arndb.de Cc: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Cc: linux-api@vger.kernel.org Cc: y2038@lists.linaro.org Link: https://lkml.kernel.org/r/20180617051144.29756-4-deepa.kernel@gmail.com commit afef05cf238cfcecdc5ea9b06f31027b13ce6214 Author: Deepa Dinamani Date: Sat Jun 16 22:11:43 2018 -0700 time: Enable get/put_compat_itimerspec64 always This will aid in enabling the compat syscalls on 32-bit architectures later on. Also move compat_itimerspec and related defines to compat_time.h. The compat_time.h file will eventually be deleted. Signed-off-by: Deepa Dinamani Signed-off-by: Thomas Gleixner Cc: arnd@arndb.de Cc: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Cc: linux-api@vger.kernel.org Cc: y2038@lists.linaro.org Link: https://lkml.kernel.org/r/20180617051144.29756-3-deepa.kernel@gmail.com commit d0dd63a8aee1ef89f2e48e554b796b9f9e4fcadb Author: Deepa Dinamani Date: Sat Jun 16 22:11:42 2018 -0700 time: Introduce struct __kernel_itimerspec struct itimerspec is not y2038-safe. Introduce a new struct __kernel_itimerspec based on the kernel internal y2038-safe struct itimerspec64. The definition of struct __kernel_itimerspec includes two struct __kernel_timespec. Since struct __kernel_timespec has the same representation in native and compat modes, so does struct __kernel_itimerspec. This helps have a common entry point for syscalls using struct __kernel_itimerspec. New y2038-safe syscalls will use this new type. Since most of the new syscalls are just an update to the native syscalls with the type update, place the new definition under CONFIG_64BIT_TIME. This helps architectures that do not support the above config to keep using the old definition of struct itimerspec. Also change the get/put_itimerspec64 to use struct__kernel_itimerspec. This will help 32 bit architectures to use the new syscalls when architectures select CONFIG_64BIT_TIME. Signed-off-by: Deepa Dinamani Signed-off-by: Thomas Gleixner Cc: arnd@arndb.de Cc: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Cc: linux-api@vger.kernel.org Cc: y2038@lists.linaro.org Link: https://lkml.kernel.org/r/20180617051144.29756-2-deepa.kernel@gmail.com commit 519cc8652b3a1d3d0a02257afbe9573ad644da26 Author: Lukas Wunner Date: Sun Jun 24 10:35:30 2018 +0200 genirq: Synchronize only with single thread on free_irq() When pciehp is converted to threaded IRQ handling, removal of unplugged devices below a PCIe hotplug port happens synchronously in the IRQ thread. Removal of devices typically entails a call to free_irq() by their drivers. If those devices share their IRQ with the hotplug port, __free_irq() deadlocks because it calls synchronize_irq() to wait for all hard IRQ handlers as well as all threads sharing the IRQ to finish. Actually it's sufficient to wait only for the IRQ thread of the removed device, so call synchronize_hardirq() to wait for all hard IRQ handlers to finish, but no longer for any threads. Compensate by rearranging the control flow in irq_wait_for_interrupt() such that the device's thread is allowed to run one last time after kthread_stop() has been called. kthread_stop() blocks until the IRQ thread has completed. On completion the IRQ thread clears its oneshot thread_mask bit. This is safe because __free_irq() holds the request_mutex, thereby preventing __setup_irq() from handing out the same oneshot thread_mask bit to a newly requested action. Stack trace for posterity: INFO: task irq/17-pciehp:94 blocked for more than 120 seconds. schedule+0x28/0x80 synchronize_irq+0x6e/0xa0 __free_irq+0x15a/0x2b0 free_irq+0x33/0x70 pciehp_release_ctrl+0x98/0xb0 pcie_port_remove_service+0x2f/0x40 device_release_driver_internal+0x157/0x220 bus_remove_device+0xe2/0x150 device_del+0x124/0x340 device_unregister+0x16/0x60 remove_iter+0x1a/0x20 device_for_each_child+0x4b/0x90 pcie_port_device_remove+0x1e/0x30 pci_device_remove+0x36/0xb0 device_release_driver_internal+0x157/0x220 pci_stop_bus_device+0x7d/0xa0 pci_stop_bus_device+0x3d/0xa0 pci_stop_and_remove_bus_device+0xe/0x20 pciehp_unconfigure_device+0xb8/0x160 pciehp_disable_slot+0x84/0x130 pciehp_ist+0x158/0x190 irq_thread_fn+0x1b/0x50 irq_thread+0x143/0x1a0 kthread+0x111/0x130 Signed-off-by: Lukas Wunner Signed-off-by: Thomas Gleixner Cc: Bjorn Helgaas Cc: Mika Westerberg Cc: linux-pci@vger.kernel.org Link: https://lkml.kernel.org/r/d72b41309f077c8d3bee6cc08ad3662d50b5d22a.1529828292.git.lukas@wunner.de commit 836557bd58e5e65c05c73af9f6ebed885dbfccfc Author: Lukas Wunner Date: Sun Jun 24 10:35:18 2018 +0200 genirq: Update code comments wrt recycled thread_mask Previously a race existed between __free_irq() and __setup_irq() wherein the thread_mask of a just removed action could be handed out to a newly added action and the freed irq thread would then tread on the oneshot mask bit of the newly added irq thread in irq_finalize_oneshot(): time | __free_irq() | raw_spin_lock_irqsave(&desc->lock, flags); | | raw_spin_unlock_irqrestore(&desc->lock, flags); | | __setup_irq() | raw_spin_lock_irqsave(&desc->lock, flags); | | raw_spin_unlock_irqrestore(&desc->lock, flags); | | irq_thread() of freed irq (__free_irq() waits in synchronize_irq()) | irq_thread_fn() | irq_finalize_oneshot() | raw_spin_lock_irq(&desc->lock); | desc->threads_oneshot &= ~action->thread_mask; | raw_spin_unlock_irq(&desc->lock); v The race was known at least since 2012 when it was documented in a code comment by commit e04268b0effc ("genirq: Remove paranoid warnons and bogus fixups"). The race itself is harmless as nothing touches any of the potentially freed data after synchronize_irq(). In 2017 the race was close by commit 9114014cf4e6 ("genirq: Add mutex to irq desc to serialize request/free_irq()"), apparently inadvertantly so because the race is neither mentioned in the commit message nor was the code comment updated. Make up for that. Signed-off-by: Lukas Wunner Signed-off-by: Thomas Gleixner Cc: Bjorn Helgaas Cc: Mika Westerberg Cc: linux-pci@vger.kernel.org Link: https://lkml.kernel.org/r/32fc25aa35ecef4b2692f57687bb7fc2a57230e2.1529828292.git.lukas@wunner.de commit fe0b082fedd1d09c73c48883f04a9fe2967b5899 Author: Cong Wang Date: Sat Jun 23 13:46:39 2018 -0700 net_sched: remove unused htb drop_list After commit a09ceb0e0814 ("sched: remove qdisc->drop"), it is no longer used. Cc: Florian Westphal Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit b0c1638f26a5f8d593e79b226e8dec0bcd5adc3e Author: Fabio Estevam Date: Sat Jun 23 21:28:22 2018 -0300 net: phy: fixed-phy: Make the error path simpler When platform_device_register_simple() fails we can return the error immediately instead of jumping to the 'err_pdev' label. This makes the error path a bit simpler. Signed-off-by: Fabio Estevam Signed-off-by: David S. Miller commit 561fad31e697b73c22e0373e01a33311912b58eb Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:30 2018 +0800 drm/mediatek: add third ddp path This patch create third crtc by third ddp path Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 16dd757ead7a05e9cb88db9972916eef4e0a842a Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:29 2018 +0800 drm/mediatek: add DSI3 support for mutex This patch add the DSI3 support for mutex Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit dee8eb4e668d059d2cc3a92717006da50bb2d491 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:28 2018 +0800 drm/mediatek: add DSI2 support for mutex This patch add the DSI2 support for mutex Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit f4f3ec480e82fa0c8c93a02b01e46719e4985752 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:27 2018 +0800 drm/mediatek: add DPI1 support for mutex This patch add the DPI1 support for mutex Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit d335369e7543fdf8f9111d8b03a8cae3e1526434 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:26 2018 +0800 drm/mediatek: add connection from RDMA2 to DSI3 This patch add the connection from RDMA2 to DSI3 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 46ce9b2dc78ca7f8e224fb74c71f3d4caf2f7dab Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:25 2018 +0800 drm/mediatek: add connection from RDMA2 to DSI2 This patch add the connection from RDMA2 to DSI2 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 0064be8c71fd38d9d65c18d3561d9ea48d759387 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:24 2018 +0800 drm/mediatek: add connection from RDMA2 to DSI1 This patch add the connection from RDMA2 to DSI1 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 7ddac091673c576f010aca262bb56f5e25fc5577 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:23 2018 +0800 drm/mediatek: add connection from RDMA2 to DPI1 This patch add the connection from RDMA2 to DPI1 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 01915b8588142af11a9416dcbb4e58bc0518c3ee Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:22 2018 +0800 drm/mediatek: add connection from RDMA2 to DPI0 This patch add the connection from RDMA2 to DPI0 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 15484ae0afa9286f166bdb64a97700f215ada956 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:21 2018 +0800 drm/mediatek: add connection from RDMA1 to DSI3 This patch add the connection from RDMA1 to DSI3 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 5346010f72226c38de987c366fdf81cb313679ef Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:20 2018 +0800 drm/mediatek: add connection from RDMA1 to DSI2 This patch add the connection from RDMA1 to DSI2 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit d46a8f851e880695410745a72a69abd6f05c376b Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:19 2018 +0800 drm/mediatek: add connection from RDMA1 to DSI1 This patch add the connection from RDMA1 to DSI1 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 73fabd5cebc11eccbf99dacda397c1dcb1198d73 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:18 2018 +0800 drm/mediatek: add connection from RDMA1 to DPI1 This patch add the connection from RDMA1 to DPI1 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 89c04d65022496628dc6f9b01e51533ab26a8d18 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:17 2018 +0800 drm/mediatek: add connection from RDMA0 to DSI3 This patch add the connection from RDMA0 to DSI3 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 49793b767456863ccd260b61a661e74b8cd6d103 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:16 2018 +0800 drm/mediatek: add connection from RDMA0 to DSI2 This patch add the connection from RDMA0 to DSI2 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 7b86302401dfdee2b26d99be0d61759a5ab47f11 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:15 2018 +0800 drm/mediatek: add connection from RDMA0 to DPI0 This patch add the connection from RDMA0 to DPI0 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 09013b1619934cb5c5b17d9a5a183c3b20ca8d6e Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:14 2018 +0800 drm/mediatek: Update the definition of connection from RDMA1 to DPI0 This patch update the definition of connection from RDMA1 to DPI0. Change the term MOUT to SOUT. Because our HW datasheet use the term SOUT to match its function for RDMA. For consistency, changing the name from MOUT to SOUT is better. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 9b7b38de386c529d2529bb9670582cec680e239e Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:13 2018 +0800 drm/mediatek: add connection from OD1 to RDMA1 This patch add the connection from OD1 to RDMA1 for ext path. Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 6de614026234f900ee55afb8dc8ea5f07b7509cd Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:12 2018 +0800 drm/mediatek: add the DSI1 for component init condition This patch add the DSI1 for component init condition Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit b1df55d308a0489dc7f1531c83607101c3535b8e Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:11 2018 +0800 drm/mediatek: add component DSI3 This patch add the component DSI3 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit afbff52882325db7cfb65fab014dae5930dce31a Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:10 2018 +0800 drm/mediatek: add component DSI2 This patch add the component DSI2 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 879a91807f5af1bb02ad3b6019f9729c2b0ea4bf Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:09 2018 +0800 drm/mediatek: add component DPI1 This patch add the component DPI1 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 2e2447784e568bd3469df085d51cd651e6a00993 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:08 2018 +0800 drm/mediatek: add ddp component PWM2 This patch add component PWM2 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 9ec3818eb37104561774c96349ec7a2b0633fbac Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:07 2018 +0800 drm/mediatek: add ddp component PWM1 This patch add component PWM1 in mtk_ddp_matches Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit df2dce4e11a33fa7e3e72d3b4e4570e8f653d387 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:06 2018 +0800 drm/mediatek: add ddp component OD1 This patch add the component OD1 and rename the OD to OD0 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit d480bbc47425d82d7f6cee0f370e43a1f6aff1a1 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:05 2018 +0800 drm/mediatek: add ddp component AAL1 This patch add component AAL1 and rename AAL to AAL0 Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 8617ec2474fda604d60eefe1bd058a167f265308 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:04 2018 +0800 drm/mediatek: support maximum 64 mutex mod This patch support that if modules more than 32, add index more than 31 when using DISP_REG_MUTEX_MOD2 bit Signed-off-by: Stu Hsieh Signed-off-by: CK Hu commit 9dd64e8f7b62e04cb34e984f637ba331d7e71829 Author: stu.hsieh@mediatek.com Date: Wed Jun 20 16:19:03 2018 +0800 drm/mediatek: update dt-bindings for mt2712 Update device tree binding documentation for the display subsystem for Mediatek MT2712 SoCs. Signed-off-by: Stu Hsieh Acked-by: Rob Herring Signed-off-by: CK Hu commit 50f307401113350a8d46ca45cace07a92c9bedc8 Author: Al Viro Date: Sat Jun 23 20:27:29 2018 -0400 hostfs_lookup: switch to d_splice_alias() Signed-off-by: Al Viro commit 63a67a926e214dac94e29147c0f3d11499f655a1 Author: Al Viro Date: Sat Jun 23 17:16:44 2018 -0400 kill dentry_update_name_case() the last user is gone Spotted-by: Richard Weinberger Signed-off-by: Al Viro commit f203b76d78092faf248db3f851840fbecf80b40e Author: Steffen Klassert Date: Tue Jun 12 14:07:12 2018 +0200 xfrm: Add virtual xfrm interfaces This patch adds support for virtual xfrm interfaces. Packets that are routed through such an interface are guaranteed to be IPsec transformed or dropped. It is a generic virtual interface that ensures IPsec transformation, no need to know what happens behind the interface. This means that we can tunnel IPv4 and IPv6 through the same interface and support all xfrm modes (tunnel, transport and beet) on it. Co-developed-by: Lorenzo Colitti Co-developed-by: Benedict Wong Signed-off-by: Lorenzo Colitti Signed-off-by: Benedict Wong Signed-off-by: Steffen Klassert Acked-by: Shannon Nelson Tested-by: Benedict Wong Tested-by: Antony Antony Reviewed-by: Eyal Birger commit 7e6526404adedf079279aa7aa11722deaca8fe2e Author: Steffen Klassert Date: Tue Jun 12 14:07:07 2018 +0200 xfrm: Add a new lookup key to match xfrm interfaces. This patch adds the xfrm interface id as a lookup key for xfrm states and policies. With this we can assign states and policies to virtual xfrm interfaces. Signed-off-by: Steffen Klassert Acked-by: Shannon Nelson Acked-by: Benedict Wong Tested-by: Benedict Wong Tested-by: Antony Antony Reviewed-by: Eyal Birger commit d159ce7957eec306eacda672e5909e26675ca8ef Author: Steffen Klassert Date: Tue Jun 12 14:06:57 2018 +0200 flow: Extend flow informations with xfrm interface id. Add a new flowi_xfrm structure with informations needed to do a xfrm lookup. At the moment it keeps the informations about the new xfrm interface id needed to lookup xfrm interfaces that are introduced with a followup patch. We need this new lookup key as other possible keys, like the ifindex is already part of the xfrm selector and used as a key to enforce the output device after the transformation in the policy/state lookup. Signed-off-by: Steffen Klassert Acked-by: Shannon Nelson Acked-by: Benedict Wong Tested-by: Benedict Wong Tested-by: Antony Antony Reviewed-by: Eyal Birger commit 9b42c1f179a614e11893ae4619f0304a38f481ae Author: Steffen Klassert Date: Tue Jun 12 12:44:26 2018 +0200 xfrm: Extend the output_mark to support input direction and masking. We already support setting an output mark at the xfrm_state, unfortunately this does not support the input direction and masking the marks that will be applied to the skb. This change adds support applying a masked value in both directions. The existing XFRMA_OUTPUT_MARK number is reused for this purpose and as it is now bi-directional, it is renamed to XFRMA_SET_MARK. An additional XFRMA_SET_MARK_MASK attribute is added for setting the mask. If the attribute mask not provided, it is set to 0xffffffff, keeping the XFRMA_OUTPUT_MARK existing 'full mask' semantics. Co-developed-by: Tobias Brunner Co-developed-by: Eyal Birger Co-developed-by: Lorenzo Colitti Signed-off-by: Steffen Klassert Signed-off-by: Tobias Brunner Signed-off-by: Eyal Birger Signed-off-by: Lorenzo Colitti commit eb9fe6029ad49469b072a09a7fbfab34661e171a Author: Hiroyuki Yokoyama Date: Wed Jun 20 14:01:37 2018 +0200 dmaengine: rcar-dmac: Document R8A77990 bindings Renesas R-Car E3 (R8A77990) SoC also has the R-Car gen2/3 compatible DMA controllers, so document the SoC specific binding. Signed-off-by: Hiroyuki Yokoyama Signed-off-by: Ulrich Hecht Reviewed-by: Simon Horman Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Signed-off-by: Vinod Koul commit dd55c4ea9e6ba957083f985f33f994c23b405e9e Merge: a055b02f348e aa1e7d2c31ef Author: David S. Miller Date: Sat Jun 23 20:54:56 2018 +0900 Merge branch 'r8169-enable-ASPM-on-RTL8168E-VL' Heiner Kallweit says: ==================== r8169: enable ASPM on RTL8168E-VL This patch series enables ASPM for the RTL8168E-VL and aligns ASPM entry latency handling with the vendor driver before. ==================== Signed-off-by: David S. Miller commit aa1e7d2c31efd561fbbecc77eb785c8af685c1af Author: Heiner Kallweit Date: Sat Jun 23 09:53:00 2018 +0200 r8169: enable ASPM on RTL8168E-VL Let's enable ASPM also on the RTL8168E-VL (chip version 34). Works fine on my Zotac Mini PC with this chip. Temperature when being idle is significantly lower than before due to reaching deeper PC states. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit f37658da21aae3b4801860858caf4616286a0dc8 Author: Heiner Kallweit Date: Sat Jun 23 09:51:28 2018 +0200 r8169: align ASPM entry latency setting with vendor driver The r8168 vendor driver always uses value 0x27. In r8169 we have few chips where 0x17 is used. So far this didn't matter because ASPM was disabled anyway. Now that ASPM was re-enabled let's also use 0x27 only. One of the chips affected by this change is RTL8168E-VL, on my system with this chip value 0x27 works fine. In addition rename rtl_csi_access_enable_2() to rtl_set_def_aspm_entry_latency() to make clear that we set the default ASPM entry latency. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit a055b02f348e70626f437dcd999c10e288ef7f17 Merge: 5424ea27390f 418e7dab0f83 Author: David S. Miller Date: Sat Jun 23 20:52:09 2018 +0900 Merge branch 'pch_gbe-Cleanups' Paul Burton says: ==================== net: pch_gbe: Cleanups This series begins the process of cleaning up the pch_gbe network driver. Whilst my ultimate goal is to add support for using this driver on the MIPS Boston development board, this series sets that aside in favor of making some more general cleanups. My hope is that this will both make the driver a little more maleable & reduce the probability of me gouging out my eyes. Applies cleanly atop net-next as of 5424ea27390f ("netns: get more entropy from net_hash_mix()"). ==================== Signed-off-by: David S. Miller commit 418e7dab0f83fcef4f3cb1ae5b1c02ee83b8e26c Author: Paul Burton Date: Fri Jun 22 20:17:53 2018 -0700 net: pch_gbe: Clean up pch_gbe_set_multi Refactor pch_gbe_set_multi in order to avoid unnecessary indentation & make it clearer what the code is doing. The one behavioral change from this patch is that we'll no longer configure the MAC address registers for multicast addresses when the IFF_PROMISC or IFF_ALLMULTI flags are set. In these cases, just as when we want to monitor more multicast addresses than we have MAC address registers, we disable multicast filtering so the MAC address registers are unused. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 6ab91e47694e03775bbe874fa8f15f84db404c00 Author: Paul Burton Date: Fri Jun 22 20:17:52 2018 -0700 net: pch_gbe: Inline pch_gbe_mac_mc_addr_list_update The pch_gbe driver sets up multicast address filters using a convoluted mechanism by which pch_gbe_set_multi allocates an array to hold multicast addresses, copies desired addresses into that array, calls a pch_gbe_mac_mc_addr_list_update function which copies addresses out of that array into MAC registers, then frees the array. This patch simplifies this somewhat by inlining pch_gbe_mac_mc_addr_list_update into pch_gbe_set_multi, and removing the requirement for the MAC addresses to stored consecutively in a single array. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 99a9c28863ccccf25f6e95c5b38cb6884d922a7f Author: Paul Burton Date: Fri Jun 22 20:17:51 2018 -0700 net: pch_gbe: Use module_pci_driver() Make use of the module_pci_driver() macro to remove some needless boilerplate code from the pch_gbe driver. This does have the side effect of removing the print of the driver's version during probe, but this is pretty useless information anyway - the version has changed only once whilst the driver has been in mainline, despite many changes being made to it before and since. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 90e3f637eb4d2e1fdb6a799e758a21c2a4e20a1d Author: Paul Burton Date: Fri Jun 22 20:17:50 2018 -0700 net: pch_gbe: Remove dead RINGFREE code The pch_gbe driver includes some code which appears to be an attempt to work around a problem with the pch_gbe_free_rx_resources & pch_gbe_free_tx_resources functions that no longer exists. Remove the code guarded by the never-defined RINGFREE preprocessor macro. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 41fd60fa74d6aac84c214afc71aa4b9d3edba263 Author: Paul Burton Date: Fri Jun 22 20:17:49 2018 -0700 net: pch_gbe: Remove PCH_GBE_MAC_IFOP_RGMII define The pch_gbe driver currently presumes that the PHY is connected using RGMII, and would need further work to support other buses. It includes a define which is always set that conditionalises some of the RGMII-specific code regardless. Remove it. If we do ever support different MII buses then preprocessor defines won't be the best way to select between them anyway. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit c63ebdf01ad96d8c11ab3ff245a3acd30e7fc8ba Author: Paul Burton Date: Fri Jun 22 20:17:48 2018 -0700 net: pch_gbe: Remove pch_gbe_hal_setup_init_funcs The pch_gbe driver calls a pch_gbe_hal_setup_init_funcs function which ultimately sets the value of one field in struct pch_gbe_phy_info in a convoluted way. This patch removes pch_gbe_hal_setup_init_funcs in favor of inlining it, and in turn its callee pch_gbe_plat_init_function_pointers, into the single caller pch_gbe_sw_init. With this pch_gbe_api.c & pch_gbe_api.h are essentially empty, so they are removed & inclusions of the latter replaced with pch_gbe_phy.h which was previously being included via pch_gbe_api.h. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit b02c38a23a5a308466d6cf87895ef16b6fa3306c Author: Paul Burton Date: Fri Jun 22 20:17:47 2018 -0700 net: pch_gbe: Remove get_bus_info HAL abstraction For some reason the pch_gbe driver contains a struct pch_gbe_functions with pointers used by a HAL abstraction layer, even though there is only one implementation of each function. This patch removes the get_bus_info abstraction. Its single implementation (pch_gbe_plat_get_bus_info) only sets values within a struct pch_gbe_bus_info which is never used, so we simply remove the call to it in pch_gbe_probe & remove struct pch_gbe_bus_info entirely. Now that struct pch_gbe_functions is empty we remove it entirely too. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 3ef594b0e465c4dd7b1ea7736dfc4bb80c53e33d Author: Paul Burton Date: Fri Jun 22 20:17:46 2018 -0700 net: pch_gbe: Remove init_hw HAL abstraction For some reason the pch_gbe driver contains a struct pch_gbe_functions with pointers used by a HAL abstraction layer, even though there is only one implementation of each function. This patch removes the init_hw abstraction in favor of inlining its single implementation (pch_gbe_plat_init_hw) into its single caller (pch_gbe_reset). Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit c96a0f74312ba7a640b50257d58085f372fff352 Author: Paul Burton Date: Fri Jun 22 20:17:45 2018 -0700 net: pch_gbe: Remove {read,write}_phy_reg HAL abstraction For some reason the pch_gbe driver contains a struct pch_gbe_functions with pointers used by a HAL abstraction layer, even though there is only one implementation of each function. This patch removes the read_phy_reg & write_phy_reg abstractions in favor of calling pch_gbe_phy_read_reg_miic & pch_gbe_phy_write_reg_miic directly. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 7dbe38aed0ba01e9557621d7e6d59c5b92decead Author: Paul Burton Date: Fri Jun 22 20:17:44 2018 -0700 net: pch_gbe: Remove reset_phy HAL abstraction For some reason the pch_gbe driver contains a struct pch_gbe_functions with pointers used by a HAL abstraction layer, even though there is only one implementation of each function. This patch removes the reset_phy abstraction in favor of calling pch_gbe_phy_hw_reset directly. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 66dde2b0aa7013dbaf9d0e18ff24360877312a79 Author: Paul Burton Date: Fri Jun 22 20:17:43 2018 -0700 net: pch_gbe: Remove sw_reset_phy HAL abstraction For some reason the pch_gbe driver contains a struct pch_gbe_functions with pointers used by a HAL abstraction layer, even though there is only one implementation of each function. This patch removes the sw_reset_phy abstraction, which it turns out is never even used. Its one implementation, which is already called directly within the same translation unit, can therefore be made static and removed from the pch_gbe_phy.h header. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 9c020d7b0525d3b913a85d055a34aca64d852be5 Author: Paul Burton Date: Fri Jun 22 20:17:42 2018 -0700 net: pch_gbe: Remove read_mac_addr HAL abstraction For some reason the pch_gbe driver contains a struct pch_gbe_functions with pointers used by a HAL abstraction layer, even though there is only one implementation of each function. This patch removes the read_mac_addr abstraction in favor of calling pch_gbe_mac_read_mac_addr directly. Since this is defined in the same translation unit as all of its callers, we can make it static & remove it from the pch_gbe.h header. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit ac6c0e0aa49ff8cb26573fe31403800de98218a1 Author: Paul Burton Date: Fri Jun 22 20:17:41 2018 -0700 net: pch_gbe: Remove power_{up,down}_phy HAL abstraction For some reason the pch_gbe driver contains a struct pch_gbe_functions with pointers used by a HAL abstraction layer, even though there is only one implementation of each function. This patch removes the power_up_phy & power_down_phy abstractions in favor of calling pch_phy_power_up & pch_phy_power_down directly. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 33bfdeaa768a2b53abc7b8c0f3cae272770d31d4 Author: Paul Burton Date: Fri Jun 22 20:17:40 2018 -0700 net: pch_gbe: Remove unused copybreak parameter The pch_gbe driver includes a 'copybreak' parameter which appears to have been copied from the e1000e driver but is entirely unused. Remove the dead code. Signed-off-by: Paul Burton Signed-off-by: David S. Miller commit 443810fe6160542c78e24c66047edd7a3cc830c6 Author: Reinette Chatre Date: Fri Jun 22 15:42:26 2018 -0700 x86/intel_rdt: Create debugfs files for pseudo-locking testing There is no simple yes/no test to determine if pseudo-locking was successful. In order to test pseudo-locking we expose a debugfs file for each pseudo-locked region that will record the latency of reading the pseudo-locked memory at a stride of 32 bytes (hardcoded). These numbers will give us an idea of locking was successful or not since they will reflect cache hits and cache misses (hardware prefetching is disabled during the test). The new debugfs file "pseudo_lock_measure" will, when the pseudo_lock_mem_latency tracepoint is enabled, record the latency of accessing each cache line twice. Kernel tracepoints offer us histograms (when CONFIG_HIST_TRIGGERS is enabled) that is a simple way to visualize the memory access latency and immediately see any cache misses. For example, the hist trigger below before trigger of the measurement will display the memory access latency and instances at each latency: echo 'hist:keys=latency' > /sys/kernel/debug/tracing/events/resctrl/\ pseudo_lock_mem_latency/trigger echo 1 > /sys/kernel/debug/tracing/events/resctrl/pseudo_lock_mem_latency/enable echo 1 > /sys/kernel/debug/resctrl//pseudo_lock_measure echo 0 > /sys/kernel/debug/tracing/events/resctrl/pseudo_lock_mem_latency/enable cat /sys/kernel/debug/tracing/events/resctrl/pseudo_lock_mem_latency/hist Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/6b2ea76181099d1b79ccfa7d3be24497ab2d1a45.1529706536.git.reinette.chatre@intel.com commit 37707ec6cba6668f22a47016fdee612b0ff62fe9 Author: Reinette Chatre Date: Fri Jun 22 15:42:25 2018 -0700 x86/intel_rdt: Create resctrl debug area In preparation for support of debugging of RDT sub features the user can now enable a RDT debugfs region. The debug area is always enabled when CONFIG_DEBUG_FS is set as advised in http://lkml.kernel.org/r/20180523080501.GA6822@kroah.com Also from same discussion in above linked email, no error checking on the debugfs creation return value since code should not behave differently when debugging passes or fails. Even on failure the returned value can be passed safely to other debugfs calls. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/9f553faf30866a6317f1aaaa2fe9f92de66a10d2.1529706536.git.reinette.chatre@intel.com commit 0af6a48da481109affc4ea8295034f69993a91ef Author: Reinette Chatre Date: Fri Jun 22 15:42:24 2018 -0700 x86/intel_rdt: Ensure RDT cleanup on exit The RDT system's initialization does not have the corresponding exit handling to ensure everything initialized on load is cleaned up also. Introduce the cleanup routines that complement all initialization. This includes the removal of a duplicate rdtgroup_init() declaration. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/a9e3a2bbd731d13915d2d7bf05d4f675b4fa109b.1529706536.git.reinette.chatre@intel.com commit f4e80d67a527469245f391976d8665f934a16205 Author: Reinette Chatre Date: Fri Jun 22 15:42:23 2018 -0700 x86/intel_rdt: Resctrl files reflect pseudo-locked information Information about resources as well as resource groups are contained in a variety of resctrl files. Now that pseudo-locked regions can be created the files can be updated to present appropriate information to the user. Update the resource group's schemata file to show only the information of the pseudo-locked region. Update the resource group's size file to show the size in bytes of only the pseudo-locked region. Update the bit_usage file to use the letter 'P' for all pseudo-locked regions. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/5ece82869b651c2178b278e00bca959f7626b6e9.1529706536.git.reinette.chatre@intel.com commit e0bdfe8e36f3fbbdc91e70bf927f743ca23917b0 Author: Reinette Chatre Date: Fri Jun 22 15:42:22 2018 -0700 x86/intel_rdt: Support creation/removal of pseudo-locked region The user triggers the creation of a pseudo-locked region when writing a valid schemata to the schemata file of a resource group in the pseudo-locksetup mode. A valid schemata is one that: (1) does not overlap with any other resource group, (2) does not involve a cache that already contains a pseudo-locked region within its hierarchy. After a valid schemata is parsed the system is programmed to associate the to be pseudo-lock bitmask with the closid associated with the resource group. With the system set up the pseudo-locked region can be created. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/8929c3a9e2ba600e79649abe584aa28b8d0ff639.1529706536.git.reinette.chatre@intel.com commit 018961ae5579016d46ee03587c0ecf673821eedb Author: Reinette Chatre Date: Fri Jun 22 15:42:21 2018 -0700 x86/intel_rdt: Pseudo-lock region creation/removal core The user requests a pseudo-locked region by providing a schemata to a resource group that is in the pseudo-locksetup mode. This is the functionality that consumes the parsed user data and creates the pseudo-locked region. First, required information is deduced from user provided data. This includes, how much memory does the requested bitmask represent, which CPU the requested region is associated with, and what is the cache line size of that cache (to learn the stride needed for locking). Second, a contiguous block of memory matching the requested bitmask is allocated. Finally, pseudo-locking is performed. The resource group already has the allocation that reflects the requested bitmask. With this class of service active and interference minimized, the allocated memory is loaded into the cache. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/67391160bbf06143bc62d856d3d234eb152008b7.1529706536.git.reinette.chatre@intel.com commit f2a177292bd052ce12ac453d2ceeb083fe07718a Author: Reinette Chatre Date: Fri Jun 22 15:42:20 2018 -0700 x86/intel_rdt: Discover supported platforms via prefetch disable bits Knowing the model specific prefetch disable bits is required to support cache pseudo-locking because the hardware prefetchers need to be disabled when the kernel memory is pseudo-locked to cache. We add these bits only for platforms known to support cache pseudo-locking. When the user requests locksetup mode to be entered it will fail if the prefetch disabling bits are not known for the platform. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/3eef559aa9fd693a104ff99ff909cfee450c1695.1529706536.git.reinette.chatre@intel.com commit 72d505056604a305a4fcd8b268d2f6e979e17023 Author: Reinette Chatre Date: Fri Jun 22 15:42:19 2018 -0700 x86/intel_rdt: Add utilities to test pseudo-locked region possibility A pseudo-locked region does not have a class of service associated with it and thus not tracked in the array of control values maintained as part of the domain. Even so, when the user provides a new bitmask for another resource group it needs to be checked for interference with existing pseudo-locked regions. Additionally only one pseudo-locked region can be created in any cache hierarchy. Introduce two utilities in support of above scenarios: (1) a utility that can be used to test if a given capacity bitmask overlaps with any pseudo-locked regions associated with a particular cache instance, (2) a utility that can be used to test if a pseudo-locked region exists within a particular cache hierarchy. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/b8e31dbdcf22ddf71df46072647b47e7558abb32.1529706536.git.reinette.chatre@intel.com commit 17eafd076291ed23eeb17b28132fa33b0688bc57 Author: Reinette Chatre Date: Fri Jun 22 15:42:18 2018 -0700 x86/intel_rdt: Split resource group removal in two Resource groups used for pseudo-locking do not require the same work on removal as the other resource groups. The resource group removal is split in two in preparation for support of pseudo-locking resource groups. A single re-ordering occurs - the setting of the rdtgrp flag is moved to later. This flag is not used by any of the code between its original and new location. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/c8cbf7a7c72480b39bb946a929dbae96c0f9aca1.1529706536.git.reinette.chatre@intel.com commit dfe9674b04ff6b819f9105650a008d164d81725e Author: Reinette Chatre Date: Fri Jun 22 15:42:17 2018 -0700 x86/intel_rdt: Enable entering of pseudo-locksetup mode The user can request entering pseudo-locksetup mode by writing "pseudo-locksetup" to the mode file. Act on this request as well as support switching from a pseudo-locksetup mode (before pseudo-locked mode was entered). It is not supported to modify the mode once pseudo-locked mode has been entered. The schemata reflects the new mode by adding "uninitialized" to all resources. The size resctrl file reports zero for all cache domains in support of the uninitialized nature. Since there are no users of this class of service its allocations can be ignored when searching for appropriate default allocations for new resource groups. For the same reason resource groups in pseudo-locksetup mode are not considered when testing if new resource groups may overlap. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/56f553334708022903c296284e62db3bbc1ff150.1529706536.git.reinette.chatre@intel.com commit 63657c1cdf89a37d3b69471ad4e5b55c77e86d3f Author: Reinette Chatre Date: Fri Jun 22 15:42:16 2018 -0700 x86/intel_rdt: Support enter/exit of locksetup mode The locksetup mode is the way in which the user communicates that the resource group will be used for a pseudo-locked region. Locksetup mode should thus ensure that all restrictions on a resource group are met before locksetup mode can be entered. The resource group should also be configured to ensure that it cannot be modified in unsupported ways when a pseudo-locked region. Introduce the support where the request for entering locksetup mode can be validated. This includes: CDP is not active, no cpus or tasks are assigned to the resource group, monitoring is not in progress on the resource group. Once the resource group is determined ready for a pseudo-locked region it is configured to not allow future changes to these properties. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/b120f71ced30116bcc6c6f651e8a7906ae6b903d.1529706536.git.reinette.chatre@intel.com commit e8140a2d13d429364f18ca41b1e4960708c3a40e Author: Reinette Chatre Date: Fri Jun 22 15:42:15 2018 -0700 x86/intel_rdt: Introduce pseudo-locked region A pseudo-locked region is introduced representing an instance of a pseudo-locked cache region. Each cache instance (domain) can support one pseudo-locked region. Similarly a resource group can be used for one pseudo-locked region. Include a pointer to a pseudo-locked region from the domain and resource group structures. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/9f69eb159051067703bcbc714de62e69874d5dee.1529706536.git.reinette.chatre@intel.com commit bbcee99b67c5a8cc4e8037d561be9ed293961fd3 Author: Reinette Chatre Date: Fri Jun 22 15:42:14 2018 -0700 x86/intel_rdt: Add check to determine if monitoring in progress When a resource group is pseudo-locked it is orphaned without a class of service associated with it. We thus do not want any monitoring in progress on a resource group that will be used for pseudo-locking. Introduce a test that can be used to determine if pseudo-locking in progress on a resource group. Temporarily mark it as unused to avoid compile warnings until it is used. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/14fd9494f87ca72a213b3a197d1172d4e66ae196.1529706536.git.reinette.chatre@intel.com commit 2a5d76a4fc6469ea9dd6f02fcd4dad3a129bc1c0 Author: Reinette Chatre Date: Fri Jun 22 15:42:13 2018 -0700 x86/intel_rdt: Utilities to restrict/restore access to specific files In support of Cache Pseudo-Locking we need to restrict access to specific resctrl files to protect the state of a resource group used for pseudo-locking from being changed in unsupported ways. Introduce two utilities that can be used to either restrict or restore the access to all files irrelevant to cache pseudo-locking when pseudo-locking in progress for the resource group. At this time introduce a new source file, intel_rdt_pseudo_lock.c, that will contain most of the code related to cache pseudo-locking. Temporarily mark these new functions as unused to silence compile warnings until they are used. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/ab6319d1244366be3f9b7f9fba1c3da4810a274b.1529706536.git.reinette.chatre@intel.com commit c966dac8a5ede5d5f9b730512d8bdbcec307fe38 Author: Reinette Chatre Date: Fri Jun 22 15:42:12 2018 -0700 x86/intel_rdt: Protect against resource group changes during locking We intend to modify file permissions to make the "tasks", "cpus", and "cpus_list" not accessible to the user when cache pseudo-locking in progress. Even so, it is still possible for the user to force the file permissions (using chmod) to make them writeable. Similarly, directory permissions will be modified to prevent future monitor group creation but the user can override these restrictions also. Add additional checks to the files we intend to restrict to ensure that no modifications from user space are attempted while setting up a pseudo-locking or after a pseudo-locked region is set up. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/0c5cb006e81ead0b8bfff2df530c5d3017fd31d1.1529706536.git.reinette.chatre@intel.com commit 125db711e3629977b5e1f06fa066abe6366db294 Author: Reinette Chatre Date: Fri Jun 22 15:42:11 2018 -0700 x86/intel_rdt: Add utility to restrict/restore access to resctrl files When a resource group is used for Cache Pseudo-Locking then the region of cache ends up being orphaned with no class of service referring to it. The resctrl files intended to manage how the classes of services are utilized thus become irrelevant. The fact that a resctrl file is not relevant can be communicated to the user by setting all of its permissions to zero. That is, its read, write, and execute permissions are unset for all users. Introduce two utilities, rdtgroup_kn_mode_restrict() and rdtgroup_kn_mode_restore(), that can be used to restrict and restore the permissions of a file or directory belonging to a resource group. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/7afdbf5551b2f93cd45d61fbf5e01d87331f529a.1529706536.git.reinette.chatre@intel.com commit f7a6e3f6f5ffa4926818ea2b3e8994ecef00b84f Author: Reinette Chatre Date: Fri Jun 22 15:42:10 2018 -0700 x86/intel_rdt: Add utility to test if tasks assigned to resource group In considering changes to a resource group it becomes necessary to know whether tasks have been assigned to the resource group in question. Introduce a new utility that can be used to check if any tasks have been assigned to a particular resource group. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/be9ea3969ffd731dfd90c0ebcd5a0e0a2d135bb2.1529706536.git.reinette.chatre@intel.com commit 21220bb199f7d65c8f0a63ac7d3209e40fbdd706 Author: Reinette Chatre Date: Fri Jun 22 15:42:09 2018 -0700 x86/intel_rdt: Respect read and write access By default, if the opener has CAP_DAC_OVERRIDE, a kernfs file can be opened regardless of RW permissions. Writing to a kernfs file will thus succeed even if permissions are 0000. It's required to restrict the actions that can be performed on a resource group from userspace based on the mode of the resource group. This restriction will be done through a modification of the file permissions. That is, for example, if a resource group is locked then the user cannot add tasks to the resource group. For this restriction through file permissions to work it has to be ensured that the permissions are always respected. To do so the resctrl filesystem is created with the KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK flag that will result in open(2) failing with -EACCESS regardless of CAP_DAC_OVERRIDE if the permission does not have the respective read or write access. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/26f4fc25f110bfc07c2d2c8b2c4ee904922fedf7.1529706536.git.reinette.chatre@intel.com commit bb9fec69cb41380428d6b8dab3a303189a9b480a Author: Reinette Chatre Date: Fri Jun 22 15:42:08 2018 -0700 x86/intel_rdt: Introduce the Cache Pseudo-Locking modes The two modes used to manage Cache Pseudo-Locked regions are introduced. A resource group is assigned "pseudo-locksetup" mode when the user indicates that this resource group will be used for a Cache Pseudo-Locked region. When the Cache Pseudo-Locked region has been set up successfully after the user wrote the requested schemata to the "schemata" file, then the mode will automatically changed to "pseudo-locked". The user is not able to modify the mode to "pseudo-locked" by writing "pseudo-locked" to the "mode" file directly. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/98d6ca129bbe7dd0932d1fcfeb3cbb65f29a8d9d.1529706536.git.reinette.chatre@intel.com commit e17e733070d4ab312a35848ab248e85b78dcb3f4 Author: Reinette Chatre Date: Fri Jun 22 15:42:07 2018 -0700 x86/intel_rdt: Documentation for Cache Pseudo-Locking Add description of Cache Pseudo-Locking feature, its interface, as well as an example of its usage. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/6e118c15d2c254a27b8891783505cd1bb94a2b10.1529706536.git.reinette.chatre@intel.com commit d9b48c86eb380bb272d0ad8f5338d8dc941f3b32 Author: Reinette Chatre Date: Fri Jun 22 15:42:06 2018 -0700 x86/intel_rdt: Display resource groups' allocations' size in bytes The schemata file displays the allocations associated with each domain of each resource. The syntax of this file reflects the capacity bitmask (CBM) of the actual allocation. In order to determine the actual size of an allocation the user needs to dig through three different files to query the variables needed to compute it (the cache size, the CBM length, and the schemata). Introduce a new file "size" associated with each resource group that will mirror the schemata file syntax and display the size in bytes of each allocation. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/cc0058014c30adb88ca7d1a5abfadacbfb5edd0d.1529706536.git.reinette.chatre@intel.com commit e651901187ab8bc8a0a969144da6ae0e2e59a148 Author: Reinette Chatre Date: Fri Jun 22 15:42:05 2018 -0700 x86/intel_rdt: Introduce "bit_usage" to display cache allocations details With cache regions now explicitly marked as "shareable" or "exclusive" we would like to communicate to the user how portions of the cache are used. Introduce "bit_usage" that indicates for each resource how portions of the cache are configured to be used. To assist the user to distinguish whether the sharing is from software or hardware we add the following annotation: 0 - currently unused X - currently available for sharing and used by software and hardware H - currently used by hardware only but available for software use S - currently used and shareable by software only E - currently used exclusively by one resource group Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/105d44c40e582c2b7e2dccf0ae247e5e61137d4b.1529706536.git.reinette.chatre@intel.com commit 9ab9aa15c3096000678891b61f7309c8729928e0 Author: Reinette Chatre Date: Fri Jun 22 15:42:04 2018 -0700 x86/intel_rdt: Ensure requested schemata respects mode When the administrator requests a change in a resource group's schemata we have to ensure that the new schemata respects the current resource group as well as the other active resource groups' schemata. The new schemata is not allowed to overlap with the schemata of any exclusive resource groups. Similarly, if the resource group being changed is exclusive then its new schemata is not allowed to overlap with any schemata of any other active resource group. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/b0c05b21110d3040fff45f4c1d2cfda8dba3f207.1529706536.git.reinette.chatre@intel.com commit 7604df6e16ae0b4dba6553ae74abcf7280a512fb Author: Reinette Chatre Date: Fri Jun 22 15:42:03 2018 -0700 x86/intel_rdt: Support flexible data to parsing callbacks Each resource is associated with a configurable callback that should be used to parse the information provided for the particular resource from user space. In addition to the resource and domain pointers this callback is provided with just the character buffer being parsed. In support of flexible parsing the callback is modified to support a void pointer as argument. This enables resources that need more data than just the user provided data to pass its required data to the callback without affecting the signatures for the callbacks of all the other resources. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/34baacfced4d787d994ec7015e249e6c7e619053.1529706536.git.reinette.chatre@intel.com commit 9af4c0a6dc1a1abf5336f2c3f951444db6b71da9 Author: Reinette Chatre Date: Fri Jun 22 15:42:02 2018 -0700 x86/intel_rdt: Making CBM name and type more explicit cbm_validate() receives a pointer to the variable that will be initialized with a validated capacity bitmask. The pointer points to a variable of type unsigned long that is immediately assigned to a variable of type u32 by the caller on return from cbm_validate(). Let cbm_validate() initialize a variable of type u32 directly. At this time also change tha variable name "data" within parse_cbm() to a name more reflective of the content: "cbm_val". This frees up the generic "data" to be used later when it is indeed used for a collection of input. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/5e29cf0209ea2deac9beacd35cbe5239a50959fb.1529706536.git.reinette.chatre@intel.com commit 49f7b4efa1101bbc143a960eff3a9c8f9d6f7358 Author: Reinette Chatre Date: Fri Jun 22 15:42:01 2018 -0700 x86/intel_rdt: Enable setting of exclusive mode The new "mode" file now accepts "exclusive" that means that the allocations of this resource group cannot be shared. Enable users to modify a resource group's mode to "exclusive". To succeed it is required that there is no overlap between resource group's current schemata and that of all the other active resource groups as well as cache regions potentially used by other hardware entities. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/83642cbba3c8c21db7fa6bb36fe7d385d3b275f2.1529706536.git.reinette.chatre@intel.com commit 414dd2b4732949ddc972c2592a13c799434249c6 Author: Reinette Chatre Date: Fri Jun 22 15:42:00 2018 -0700 x86/intel_rdt: Introduce new "exclusive" mode At the moment all allocations are shareable. There is no way for a user to designate that an allocation associated with a resource group cannot be shared by another. Introduce the new mode "exclusive". When a resource group is marked as such it implies that no overlap is allowed between its allocation and that of another resource group. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/f6d24672a4280fe3b24cd2da9b5f50214439c1af.1529706536.git.reinette.chatre@intel.com commit 95f0b77efa5749f19e7acfedcb8521da4b13ed0e Author: Reinette Chatre Date: Fri Jun 22 15:41:59 2018 -0700 x86/intel_rdt: Initialize new resource group with sane defaults Currently when a new resource group is created its allocations would be those that belonged to the resource group to which its closid belonged previously. That is, we can encounter a case like: mkdir newgroup cat newgroup/schemata L2:0=ff;1=ff echo 'L2:0=0xf0;1=0xf0' > newgroup/schemata cat newgroup/schemata L2:0=0xf0;1=0xf0 rmdir newgroup mkdir newnewgroup cat newnewgroup/schemata L2:0=0xf0;1=0xf0 When the new group is created it would be reasonable to expect its allocations to be initialized with all regions that it can possibly use. At this time these regions would be all that are shareable by other resource groups as well as regions that are not currently used. If the available cache region is found to be non-contiguous the available region is adjusted to enforce validity. When a new resource group is created the hardware is initialized with these new default allocations. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/c468ed79340b63024111978e01430bb9589d85c0.1529706536.git.reinette.chatre@intel.com commit 024d15be3855044faa8bddf829e3613961fd27ba Author: Reinette Chatre Date: Fri Jun 22 15:41:58 2018 -0700 x86/intel_rdt: Make useful functions available internally In support of the work done to enable resource groups to have different modes some static functions need to be available for sharing amongst all RDT components. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/2af8fd6e937ae4fbdaa52dee1123823cb4993176.1529706536.git.reinette.chatre@intel.com commit 0b9aa6562650f42da23c29814adc2318c135cef4 Author: Reinette Chatre Date: Fri Jun 22 15:41:57 2018 -0700 x86/intel_rdt: Introduce test to determine if closid is in use During CAT feature discovery the capacity bitmasks (CBMs) associated with all the classes of service are initialized to all ones, even if the class of service is not in use. Introduce a test that can be used to determine if a class of service is in use. This test enables code interested in parsing the CBMs to know if its values are meaningful or can be ignored. Temporarily mark the function as unused to silence compile warnings until it is used. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/798f8d89cd9b12df492d48c14bdc8ee3b39b1c6f.1529706536.git.reinette.chatre@intel.com commit d48d7a57f7181b36be748ad8fb806e8de3104e89 Author: Reinette Chatre Date: Fri Jun 22 15:41:56 2018 -0700 x86/intel_rdt: Introduce resource group's mode resctrl file A new resctrl file "mode" associated with each resource group is introduced. This file will display the resource group's current mode and an administrator can also use it to modify the resource group's mode. Only shareable mode is currently supported. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/20ab78fda26a8c8d98e18ec555f6a1f728948972.1529706536.git.reinette.chatre@intel.com commit 472ef09b40c5802a2e014ae2503ad8619486f9e6 Author: Reinette Chatre Date: Fri Jun 22 15:41:55 2018 -0700 x86/intel_rdt: Associate mode with each RDT resource group Each RDT resource group is associated with a mode that will reflect the level of sharing of its allocations. The default, shareable, will be associated with each resource group on creation since it is zero and resource groups are created with kzalloc. The managing of the mode of a resource group will follow. The default resource group always remain though so ensure that it is reset to the default mode when the resctrl filesystem is unmounted. Also introduce a utility that can be used to determine the mode of a resource group when it is searched for based on its class of service. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/797e4e1de4e4fcdf5b5e0039354d6a28079e2015.1529706536.git.reinette.chatre@intel.com commit eb956a636f90bd0297309a7eae6db388ae5bfc43 Author: Reinette Chatre Date: Fri Jun 22 15:41:54 2018 -0700 x86/intel_rdt: Introduce RDT resource group mode At this time there are no constraints on how bitmasks represented by schemata can be associated with closids represented by resource groups. A bitmask of one class of service can without any objections overlap with the bitmask of another class of service. The concept of "mode" is introduced in preparation for support of control over whether cache regions can be shared between classes of service. At this time the only mode reflects the current cache allocations where all can potentially be shared. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/87e88275597fbfa03ea9d41c1186bf012c831c01.1529706536.git.reinette.chatre@intel.com commit cba1aab84fb815675038f9f932c1dd0a5519c63d Author: Reinette Chatre Date: Fri Jun 22 15:41:53 2018 -0700 x86/intel_rdt: Document new mode, size, and bit_usage By default resource groups allow sharing of their cache allocations. There is nothing that prevents a resource group from configuring a cache allocation that overlaps with that of an existing resource group. To enable resource groups to specify that their cache allocations cannot be shared a resource group "mode" is introduced to support two possible modes: "shareable" and "exclusive". A "shareable" resource group allows sharing of its cache allocations, an "exclusive" resource group does not. A new resctrl file "mode" associated with each resource group is used to communicate its (the associated resource group's) mode setting and allow the mode to be changed. The new "mode" file as well as two other resctrl files, "bit_usage" and "size", are introduced in this series. Add documentation for the three new resctrl files as well as one example demonstrating their use. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/f03a3059ec40ae719be6f3fba9f446bb055e0064.1529706536.git.reinette.chatre@intel.com commit 32206ab36553be8714d9253ce33f4085681d369c Author: Reinette Chatre Date: Fri Jun 22 15:41:52 2018 -0700 x86/intel_rdt: Provide pseudo-locking hooks within rdt_mount Stephen Rothwell reported that the Cache Pseudo-Locking enabling and the kernfs support for mounting with fs_context are conflicting. In preparation for a conflict-free merge between the two repos some no-op hooks are created within the RDT mount function being changed by the two features. The goal is for this commit to be placed on a minimal no-rebase branch to be consumed by both features. Reported-by: Stephen Rothwell Suggested-by: Al Viro Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Cc: David Howells Link: https://lkml.kernel.org/r/410697ead08978bd12111c0afc4ce9e7bd71a5fe.1529706536.git.reinette.chatre@intel.com commit 55f949c4fa6cefb199fd6208c275a3457e39e4bc Author: Sven Eckelmann Date: Sat May 26 11:40:31 2018 +0200 batman-adv: Remove "default n" in Kconfig The "default n" is the default value for any bool or tristate Kconfig setting. It is therefore not necessary to add it to a config entry. Reported-by: Sergei Shtylyov Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit ab4e58534dee7f273badfe21fa29cbe24553682f Author: Antonio Quartulli Date: Sun Jun 3 18:52:03 2018 +0800 batman-adv: enable DAT by default at compile time DAT (Distributed ARP Table) has been enabled by default in the out-of-tree batman-adv kernel module for several years already. It can now be enabled in the kernel too. Signed-off-by: Antonio Quartulli Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 951a06e78d5af9ffda9f00139fef1186c202f8ae Author: Sven Eckelmann Date: Sat May 26 11:40:32 2018 +0200 batman-adv: Drop "experimental" from BATMAN_V Kconfig The Kconfig option BATMAN_ADV_BATMAN_V is now enabled by default when the BATMAN_ADV is enabled. A feature which is enabled by default for a module should not be considered experimental. Reported-by: Joe Perches Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 5424ea27390f1f8903e5de0eaa0c5b561e8e877a Author: Eric Dumazet Date: Fri Jun 22 16:27:47 2018 -0700 netns: get more entropy from net_hash_mix() struct net are effectively allocated from order-1 pages on x86, with one object per slab, meaning that the 13 low order bits of their addresses are zero. Once shifted by L1_CACHE_SHIFT, this leaves 7 zero-bits, meaning that net_hash_mix() does not help spreading objects on various hash tables. For example, TCP listen table has 32 buckets, meaning that all netns use the same bucket for port 80 or port 443. Signed-off-by: Eric Dumazet Reported-by: Maciej Żenczykowski Signed-off-by: David S. Miller commit 6c1f0a1ffb7c2b0501521b9fc1f53b4109f1791b Author: Joe Perches Date: Fri Jun 22 10:51:00 2018 -0700 net: drivers/net: Convert random_ether_addr to eth_random_addr random_ether_addr is a #define for eth_random_addr which is generally preferred in kernel code by ~3:1 Convert the uses of random_ether_addr to enable removing the #define Miscellanea: o Convert &vfmac[0] to equivalent vfmac and avoid unnecessary line wrap Signed-off-by: Joe Perches Acked-by: Jeff Kirsher Signed-off-by: David S. Miller commit d55207e37a35f811e1d93ae83d4dcaaaecde053d Author: Geert Uytterhoeven Date: Thu Jun 21 20:58:00 2018 +0200 net: phy: Allow compile test of GPIO consumers if !GPIOLIB The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven Acked-by: Linus Walleij Signed-off-by: David S. Miller commit 6fb741076a9fc53355e56dff2e2b46782b3a46d3 Author: Kees Cook Date: Wed Jun 20 14:31:41 2018 -0700 platform/x86: wmi: Do not mix pages and kmalloc The probe handler_data was being allocated with __get_free_pages() for no reason I could find. The error path was using kfree(). Since other things are happily using kmalloc() in the probe path, switch to kmalloc() entirely. This fixes the error path mismatch and will avoid issues with CONFIG_HARDENED_USERCOPY_PAGESPAN=y. Reported-by: Mihai Donțu Signed-off-by: Kees Cook Acked-by: Mario Limonciello Cc: stable@vger.kernel.org Signed-off-by: Darren Hart (VMware) commit 46d8f405e16cdc47962edbe7771246c8d5b8c795 Author: Eric Anholt Date: Thu Jun 21 12:54:28 2018 -0700 drm: Consider drivers setting DRIVER_ATOMIC as atomic. Drivers such as vc4 don't initialize mode_config.funcs until later in initialization, but we know they're atomic since they've got the flag set. This avoids oopsing on dereferencing funcs in the new atomic methods sanity checks. I moved the atomic check function down below the core flag check, to avoid needing a prototype. Signed-off-by: Eric Anholt Fixes: ba1f665f161c ("drm: Add checks for atomic_[duplicate/destroy]_state with atomic drivers") Link: https://patchwork.freedesktop.org/patch/msgid/20180621195428.17447-1-eric@anholt.net Reviewed-by: Daniel Vetter commit aa58f58d9c6471a1087ede57e4ab6cc0817c949f Author: Anusha Srivatsa Date: Fri Jun 22 11:19:03 2018 -0700 drm/i915/guc: Remove USES_GUC_SUBMISSION for ads programming In the guc_ctl_debug_flags, the ads struct is programmed only when USES_GUC_SUBMISSION is satisfied. But, this has to be programmed for all suspend/resume cases. Remove the condition and program the ads struct for both huc loading and guc submission. This issue was noticed when CI threw errors for enable_guc=2 (load huc; disable submission) v2: - Change commit title. - Correct the shifts. (Daniele) Credits to: Daniele Ceraolo Spurio Cc: John Spotswood Cc: Oscar Mateo Cc: Daniele Ceraolo Spurio Signed-off-by: Anusha Srivatsa Reviewed-by: Daniele Ceraolo Spurio Reviewed-by: John Spotswood Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/1529691543-28606-1-git-send-email-anusha.srivatsa@intel.com commit 4adc18371f14cf9dfd169d9b8ebdfdaee13c2639 Author: Christian König Date: Fri Jun 22 11:23:26 2018 +0200 drm/omap: remove now unused functions Some functions are unused after removal of the kmap_atomic DMA-buf interface. Signed-off-by: Christian König Reviewed-by: Alex Deucher Fixes: f664a5269542 ("dma-buf: remove kmap_atomic interface") Link: https://patchwork.freedesktop.org/series/45245/ commit 70324739ac5e0332dc053eaeaba773f5ab755879 Author: Michael J. Ruhl Date: Wed Jun 20 09:43:23 2018 -0700 IB/hfi1: Remove INTx support and simplify MSIx usage The INTx IRQ support does not work for all HF1 IRQ handlers (specifically the receive data IRQs). Remove all supporting code for the INTx IRQ. If the requested MSIx vector request is unsuccessful, do not allow the driver to continue. Reviewed-by: Mike Marciniszyn Reviewed-by: Kamenee Arumugam Reviewed-by: Sadanand Warrier Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 071e4fec8e4dfaca4799f835d379f7368cbdf102 Author: Mike Marciniszyn Date: Wed Jun 20 09:43:14 2018 -0700 IB/hfi1: Reorg ctxtdata and rightsize fields Many fields in ctxtdata are incorrectly sized and the organization of the fields within the structure is a jumble. Fix by: - Correcting oversize fields. - Putting fields common to all contexts at the top with hot fields at the top. - Moving PSM fields to the bottom of the structure. Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 06e81e3e920806593fa7459ee52bf9b978a8d260 Author: Mike Marciniszyn Date: Wed Jun 20 09:43:06 2018 -0700 IB/hfi1: Remove caches of chip CSRs Remove the sizeable cache of the chip sizing CSRs and replace with CSR reads as needed. Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 15d063d5db188b3d6ef5c5d73d59b47895454861 Author: Mike Marciniszyn Date: Wed Jun 20 09:42:57 2018 -0700 IB/hfi1: Remove unused/writeonly devdata fields Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 4b0b76bd37fe3de94f368b9fa146792d74207266 Author: Mike Marciniszyn Date: Wed Jun 20 09:42:49 2018 -0700 IB/hfi1: Rightsize ctxt_eager_bufs fields Fields in this structure are sized excessively based on hardware limitations and input values. Fix by reducing fields as appropriate and repositioning to close holes in the structure. Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit b67bbc5923bf99b4898fd3d4ed2337e8b716b448 Author: Mike Marciniszyn Date: Wed Jun 20 09:42:40 2018 -0700 IB/hfi1: Remove rcvctrl from ctxtdata It is only ever written. Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit b25784312840bcf33558c12e5b2563029ad9dec6 Author: Mike Marciniszyn Date: Wed Jun 20 09:42:31 2018 -0700 IB/hfi1: Remove rcvhdrq_size The usage of this ctxt data field is not hot path and the value can be computed on demand to cut down the ctxtdata bloat. Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 38641b83ebc54635151810eeef00b61da3097952 Author: Tudor-Dan Ambarus Date: Wed Jun 13 16:29:59 2018 +0300 crypto: atmel-ecc - remove overly verbose dev_info Remove it because when using a slow console, it can affect the speed of crypto operations. Similar to 'commit 730f23b66095 ("crypto: vmx - Remove overly verbose printk from AES XTS init")'. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit e9440ff37254c85cbc1143991a39b656957394ba Author: Tudor-Dan Ambarus Date: Wed Jun 13 16:29:58 2018 +0300 crypto: atmel-ecc - fix to allow multi segment scatterlists Remove the limitation of single element scatterlists. ECDH with multi-element scatterlists is needed by TPM. Similar to 'commit 95ec01ba1ef0 ("crypto: ecdh - fix to allow multi segment scatterlists")'. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit 2a2b9461f8aceab65bb46f33d7be65bfa3f015e1 Author: Colin Ian King Date: Fri Jun 1 14:12:27 2018 +0100 crypto: cavium - make structure algs static The structure algs is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: drivers/crypto/cavium/cpt/cptvf_algs.c:354:19: warning: symbol 'algs' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Herbert Xu commit b25c1199acaea4fbc69944c0c14eb2300de9dec4 Author: Colin Ian King Date: Wed May 30 11:50:05 2018 +0100 crypto: aegis - fix indentation of a statement Trival fix to correct the indentation of a single statement Signed-off-by: Colin Ian King Signed-off-by: Herbert Xu commit ea23cb533ce419204af129380cfe1d287481aa14 Author: Antoine Tenart Date: Tue May 29 14:13:52 2018 +0200 crypto: inside-secure - authenc(hmac(sha384), cbc(aes)) support This patch adds the authenc(hmac(sha384),cbc(aes)) algorithm support to the Inside Secure SafeXcel driver. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 1f5d5d981879466c4af8be5415fb8be6eb451470 Author: Antoine Tenart Date: Tue May 29 14:13:51 2018 +0200 crypto: inside-secure - hmac(sha384) support This patch adds the hmac(sha384) algorithm support to the Inside Secure SafeXcel driver. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 9e46eafdf82a67dd069eef27c48898b79379c9f2 Author: Antoine Tenart Date: Tue May 29 14:13:50 2018 +0200 crypto: inside-secure - sha384 support This patch adds the sha384 algorithm support to the Inside Secure SafeXcel driver. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 26f7120b86a964a886ececb9eb8e6dd50276dbb2 Author: Antoine Tenart Date: Tue May 29 14:13:49 2018 +0200 crypto: sha512_generic - add a sha384 0-length pre-computed hash This patch adds the sha384 pre-computed 0-length hash so that device drivers can use it when an hardware engine does not support computing a hash from a 0 length input. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 87eee125e7490cf17e2de845a8b81b5bf63929c7 Author: Antoine Tenart Date: Tue May 29 14:13:48 2018 +0200 crypto: inside-secure - authenc(hmac(sha512), cbc(aes)) support This patch adds the authenc(hmac(sha512),cbc(aes)) algorithm support to the Inside Secure SafeXcel driver. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 0de54fb100e9b8adc9df2d896b911dda2dee0a49 Author: Antoine Tenart Date: Tue May 29 14:13:47 2018 +0200 crypto: inside-secure - hmac(sha512) support This patch adds the hmac(sha512) algorithm support to the Inside Secure SafeXcel driver. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit b460edb6230ac2877b0d176b9122736fed6f3c6e Author: Antoine Tenart Date: Tue May 29 14:13:46 2018 +0200 crypto: inside-secure - sha512 support This patch adds the sha512 algorithm support to the Inside Secure SafeXcel driver. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 30c217ef6411d24b8c8b0478b89335dc2dabe6e8 Author: Antoine Tenart Date: Tue May 29 14:13:45 2018 +0200 crypto: sha512_generic - add a sha512 0-length pre-computed hash This patch adds the sha512 pre-computed 0-length hash so that device drivers can use it when an hardware engine does not support computing a hash from a 0 length input. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 25bc95510317dc7259299adb786f050617199b42 Author: Antoine Tenart Date: Tue May 29 14:13:44 2018 +0200 crypto: inside-secure - improve the counter computation A counter is given to the engine when finishing hash computation. It currently uses the blocksize while it counts the number of 64 bytes blocks given to the engine. This works well for all algorithms so far, as SHA1, SHA224 and SHA256 all have a blocksize of 64 bytes, but others algorithms such as SHA512 wouldn't work. Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit cda3e73a54971e38a7388db0132c3681eab87847 Author: Antoine Tenart Date: Tue May 29 14:13:43 2018 +0200 crypto: inside-secure - use the error handler for invalidation requests This patch reworks the way invalidation request handlers handle the result descriptor errors, to use the common error handling function. This improves the drivers in terms of readability and maintainability. Suggested-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit 59d40813328f405976774662ddb530c6e9e9df52 Author: Parav Pandit Date: Thu Jun 21 15:31:25 2018 +0300 IB/core: Free GID table entry during GID deletion If we already hold the table->lock when doing the kref_put it means we are in a context where it is safe to do the deletion synchronously, with no need for the work queue. This helps to eliminate issues when GID change is requested as part of MAC address change or bonding event change where expectation is to replace the GID almost immediately. Fixes: b150c3862d21 ("IB/core: Introduce GID entry reference counts") Reviewed-by: Daniel Jurgens Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 88145678924891bdb959010de20b1bb4f27542d5 Author: Parav Pandit Date: Thu Jun 21 15:31:24 2018 +0300 RDMA/cma: Consider net namespace while leaving multicast group When sending multicast leave request, consider the net ns in which this cm_id is created. Code was duplicated in cma_leave_mc_groups() and rdma_leave_multicast(), which is now done using a helper function cma_leave_roce_mc_group(). Fixes: bee3c3c91865 ("IB/cma: Join and leave multicast groups with IGMP") Reviewed-by: Daniel Jurgens Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 321d7863acf7b1cf921ac18cd5ad5483b3cbb7ec Author: Jason Gunthorpe Date: Wed Jun 20 15:47:11 2018 -0600 IB/uverbs: Delete type and id from uverbs_obj_attr In this context the uobject is not allowed to be NULL, so type is the same as uobject->type, and at least for IDR, id is the same as uobject->id. FD objects should never handle the FD number outside the uAPI boundary code. Suggested-by: Guy Levi Signed-off-by: Jason Gunthorpe commit ce43b2e351c860bc50151b3ddc190b92a7536c8e Author: Ofer Heifetz Date: Mon May 28 11:03:27 2018 +0200 crypto: inside-secure - increase minimum transfer size The token size was increased for AEAD support. Occasional authentication fails arise since the result descriptor overflows. This is because the token size and the engine minimal thresholds must be in sync. Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu commit f4c277b817cc9489fffabffb4e15d2f3b686056c Author: Jiada Wang Date: Wed Jun 20 18:25:20 2018 +0900 ASoC: soc-pcm: DPCM cares BE channel constraint Current DPCM is caring only FE channel configuration. Sometimes it will be trouble if user selects channel which isn't supported by BE. This patch adds new .dpcm_merged_chan on struct snd_soc_dai_link. DPCM will use FE / BE merged channel if struct snd_soc_dai_link has it. Signed-off-by: Jiada Wang Signed-off-by: Mark Brown commit 4d7dff2b8b24d0087c75afb8e53140acdd1dc2bd Merge: cfdeb8934b6f 9f876f3de661 Author: Jason Gunthorpe Date: Fri Jun 22 08:53:27 2018 -0600 Merge branch 'icrc-counter' into rdma.git for-next For dependencies, branch based on 'mellanox/mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git Pull RoCE ICRC counters from Leon Romanovsky: ==================== This series exposes RoCE ICRC counter through existing RDMA hw_counters sysfs interface. The first patch has all HW definitions in mlx5_ifc.h file and second patch is the actual counter implementation. ==================== * branch 'icrc-counter': IB/mlx5: Support RoCE ICRC encapsulated error counter net/mlx5: Add RoCE RX ICRC encapsulated counter commit 9f876f3de6616f02960d7d88ad52c805946f4b63 Author: Talat Batheesh Date: Thu Jun 21 15:37:56 2018 +0300 IB/mlx5: Support RoCE ICRC encapsulated error counter This patch adds support to query the counter that counts the RoCE packets with corrupted ICRC (Invariant Cyclic Redundancy Code). This counter will be under /sys/class/infiniband//ports//hw_counters/ rx_icrc_encapsulated - The number of RoCE packets with ICRC error. Signed-off-by: Talat Batheesh Reviewed-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a12f671b4241f53e7cd9dec8770d51549682453b Author: Katsuhiro Suzuki Date: Wed Jun 20 10:59:59 2018 +0900 ASoC: add hp-det-gpio and mic-det-gpio to audio graph card binding Add headphone and microphone detection GPIO support to audio graph card same as supported in simple card. Signed-off-by: Katsuhiro Suzuki Signed-off-by: Mark Brown commit 2718c89a233bf8549fdba0925947b2c3cb887a95 Author: Akshu Agrawal Date: Thu Jun 21 12:58:17 2018 +0800 ASoC: AMD: Configure channel 1 or channel 0 for capture ST/CZ SoC have 2 channels for capture in the I2SSP path. The DMA though these channels is done using the same dma descriptors. We configure the channel and enable it on the basis of channel selected by machine driver. Machine driver knows which codec sits on which channel and thus sends the information to dma driver. Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit 44fedd7da485bafcc5eee8794fa54cfc0c047dd4 Merge: 3bec6fa3cdd3 1b31de922e28 Author: Mark Brown Date: Fri Jun 22 15:47:23 2018 +0100 Merge branch 'asoc-4.18' into asoc-4.19 for amd dep commit 3bec6fa3cdd338860d4b7d4110a49292646d801e Author: Agrawal, Akshu Date: Thu Jun 21 12:58:16 2018 +0800 ASoC: AMD: Change codec to channel link as per hardware redesign This is a correction to match acutal hardware configuration. The hardware configuration looks like: I2S_BT -> SPK(Max) + DMIC(Adau) I2S_SP -> DA7219 Headset No actual products have been shipped with previous configuration. Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit 366f074d047b2538cc5d7e4a820bb6c117a3ccec Author: Katsuhiro Suzuki Date: Thu Jun 21 11:56:28 2018 +0900 ASoC: uniphier: remove redundant check of PLL ID This patch removes redudant check of PLL ID. struct uniphier_aio_pll enable member has already been checked at is_valid_pll(). Signed-off-by: Katsuhiro Suzuki Signed-off-by: Mark Brown commit 2854a214f398f2c3315204a05efff11739fec062 Author: Wei Yongjun Date: Fri Jun 22 02:23:34 2018 +0000 ASoC: rt1305: use devm_snd_soc_register_component() Using devm_snd_soc_register_component() and drop all of the code related to .remove hook. Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown commit a98ec93d7e378db21a6cdbc6d55feaba9fb4b999 Author: Wei Yongjun Date: Fri Jun 22 02:23:24 2018 +0000 ASoC: rt5682: use devm_snd_soc_register_component() Using devm_snd_soc_register_component() and drop all of the code related to .remove hook. Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown commit bb450fa59c0772310ebcc704722dd8a0313bf8ed Author: Pierre-Louis Bossart Date: Thu Jun 21 15:47:35 2018 -0500 ASoC: Intel: common: fix missing rename from 'reef' to 'sof' Somehow I missed the Nau8824 support which was added in 4.17. Oops Fixes: 4f722a6a736 ("ASoC: Intel: common: rename 'reef' to 'sof' in ACPI matching table") Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit d467239f37c4e49158e0569a26c6a9c365ec5b61 Author: Michel Pollet Date: Thu Jun 14 11:56:30 2018 +0100 dt-bindings: clock: Add the r9a06g032-sysctrl.h file This adds the constants necessary to use the renesas,r9a06g032-sysctrl node. Signed-off-by: Michel Pollet Reviewed-by: Rob Herring Signed-off-by: Geert Uytterhoeven commit 7ce2f0393ea2396142b7faf6ee9b1f3676d08a5f Author: Borislav Petkov Date: Fri Jun 22 11:34:11 2018 +0200 x86/CPU/AMD: Move TOPOEXT reenablement before reading smp_num_siblings The TOPOEXT reenablement is a workaround for broken BIOSen which didn't enable the CPUID bit. amd_get_topology_early(), however, relies on that bit being set so that it can read out the CPUID leaf and set smp_num_siblings properly. Move the reenablement up to early_init_amd(). While at it, simplify amd_get_topology_early(). Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner commit d5c84ef202d7db9c838448229f62d66560b951e5 Author: Borislav Petkov Date: Fri Jun 22 11:54:27 2018 +0200 x86/mce: Cleanup __mc_scan_banks() Correct comments, improve readability, simplify. No functional changes. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180622095428.626-7-bp@alien8.de commit f35565e3986dcc5dde52649d461543cde1b745cd Author: Borislav Petkov Date: Fri Jun 22 11:54:26 2018 +0200 x86/mce: Carve out bank scanning code Carve out the scan loop into a separate function. No functional changes. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180622095428.626-6-bp@alien8.de commit 45deca7d96e0e33061b7d12932b381114db18f60 Author: Borislav Petkov Date: Fri Jun 22 11:54:25 2018 +0200 x86/mce: Remove !banks check If we don't have MCA banks, we won't see machine checks anyway. Drop the check. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180622095428.626-5-bp@alien8.de commit d3d6923cd1ae61a493a405f2f001293ab62eb092 Author: Borislav Petkov Date: Fri Jun 22 11:54:24 2018 +0200 x86/mce: Carve out the crashing_cpu check Carve out the rendezvous handler timeout avoidance check into a separate function in order to simplify the #MC handler. No functional changes. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180622095428.626-4-bp@alien8.de commit bc39f010200d09dc6d4d5e613e86dfd0b22c63b3 Author: Arnd Bergmann Date: Fri Jun 22 11:54:22 2018 +0200 x86/mce: Always use 64-bit timestamps The machine check timestamp uses get_seconds(), which returns an 'unsigned long' number that might overflow on 32-bit architectures (in the distant future) and is therefore deprecated. The normal replacement would be ktime_get_real_seconds(), but that needs to use a sequence lock that might cause a deadlock if the MCE happens at just the wrong moment. The __ktime_get_real_seconds() skips that lock and is safer here, but has a miniscule risk of returning the wrong time when we read it on a 32-bit architecture at the same time as updating the epoch, i.e. from before y2106 overflow time to after, or vice versa. This seems to be an acceptable risk in this particular case, and is the same thing we do in kdb. Signed-off-by: Arnd Bergmann Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Thomas Gleixner Cc: Tony Luck Cc: linux-edac Cc: y2038@lists.linaro.org Link: http://lkml.kernel.org/r/20180618100759.1921750-1-arnd@arndb.de commit 74bdf7815dfb3805a37b0bba615814063a227bf5 Author: Eric Dumazet Date: Wed Jun 20 08:03:32 2018 -0700 genirq: Speedup show_interrupts() Since commit 425a5072dcd1 ("genirq: Free irq_desc with rcu"), show_interrupts() can be switched to rcu locking, which removes possible contention on sparse_irq_lock. The per_cpu count scan and print can be done without holding desc spinlock. And there is no need to call kstat_irqs_cpu() and abuse irq_to_desc() while holding rcu read lock, since desc and desc->kstat_irqs wont disappear or change. Signed-off-by: Eric Dumazet Signed-off-by: Thomas Gleixner Cc: Eric Dumazet Link: https://lkml.kernel.org/r/20180620150332.163320-1-edumazet@google.com commit 5fdc7db6448a4f558f298b1c98d6d124fdf2ad95 Author: Jessica Yu Date: Fri Jun 22 14:00:01 2018 +0200 module: setup load info before module_sig_check() We want to be able to log the module name in early error messages, such as when module signature verification fails. Previously, the module name is set in layout_and_allocate(), meaning that any error messages that happen before (such as those in module_sig_check()) won't be logged with a module name, which isn't terribly helpful. In order to do this, reshuffle the order in load_module() and set up load info earlier so that we can log the module name along with these error messages. This requires splitting rewrite_section_headers() out of setup_load_info(). While we're at it, clean up and split up the operations done in layout_and_allocate(), setup_load_info(), and rewrite_section_headers() more cleanly so these functions only perform what their names suggest. Signed-off-by: Jessica Yu commit 81a0abd9f213704fbeeea1550ff202000e3c3cdf Author: Jessica Yu Date: Fri Jun 22 13:59:29 2018 +0200 module: make it clear when we're handling the module copy in info->hdr In load_module(), it's not always clear whether we're handling the temporary module copy in info->hdr (which is freed at the end of load_module()) or if we're handling the module already allocated and copied to it's final place. Adding an info->mod field and using it whenever we're handling the temporary copy makes that explicitly clear. Signed-off-by: Jessica Yu commit 372401efd9eeee24701848874ecb9845524013ee Author: Jerome Brunet Date: Tue May 22 18:34:56 2018 +0200 dt-bindings: clock: add meson axg audio clock controller bindings Export the clock ids dt-bindings usable by the consumers of the clock controller and add the documentation for the device tree bindings of the audio clock controller of the A113 based SoCs. Acked-by: Neil Armstrong Reviewed-by: Rob Herring Signed-off-by: Jerome Brunet commit 01bdee64f9cf8e15f998bf52789ed9d0ebdfa621 Author: Masami Hiramatsu Date: Fri Jun 22 15:07:40 2018 +0900 kprobes/Documentation: Fix various typos Fix typos and clean up the wording, with the help of Randy Dunlap. Suggested-by: Randy Dunlap Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Cc: linux-arch@vger.kernel.org Cc: linux-doc@vger.kernel.org Link: http://lkml.kernel.org/r/20180622150740.bd26241032c972d86e23bf73@kernel.org Signed-off-by: Ingo Molnar commit edb24ffe14d3bc309cc0c9e20d3b928e1147f30d Author: Emmanuel Vadot Date: Wed Jun 20 11:30:55 2018 +0200 arm64: allwinner: a64-sopine: Add cd-gpios to mmc0 node The card detect GPIO for Sopine and Pine64-LTS is PF6. Add this to the dts. Signed-off-by: Emmanuel Vadot Signed-off-by: Maxime Ripard commit a99790bf5c7f3d68d8b01e015d3212a98ee7bd57 Author: Kai-Heng Feng Date: Thu Jun 21 16:30:39 2018 +0800 r8169: Reinstate ASPM Support On Intel platforms (Skylake and newer), ASPM support in r8169 is the last missing puzzle to let CPU's Package C-State reaches PC8. Without ASPM support, the CPU cannot reach beyond PC3. PC8 can save additional ~3W in comparison with PC3 on a Coffee Lake platform, Dell G3 3779. This is based on the work from Chunhao Lin . Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit 671646c151d492c3846e6e6797e72ff757b5d65e Author: Kai-Heng Feng Date: Thu Jun 21 16:30:38 2018 +0800 r8169: Don't disable ASPM in the driver Enable or disable ASPM should be done in PCI core instead of in the device driver. Commit ba04c7c93bbc ("r8169: disable ASPM") uses pci_disable_link_state() to disable ASPM, but it's not the best way to do it. If the device really wants to disable ASPM, we can use a quirk in PCI core to prevent the PCI core from setting ASPM before probe. Let's remove pci_disable_link_state() for now. Use PCI core quirks if any regression happens. Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit cadefe5f584abaac40dce72009e4de738cbff467 Author: Eric Dumazet Date: Wed Jun 20 16:07:35 2018 -0400 tcp_bbr: fix bbr pacing rate for internal pacing This commit makes BBR use only the MSS (without any headers) to calculate pacing rates when internal TCP-layer pacing is used. This is necessary to achieve the correct pacing behavior in this case, since tcp_internal_pacing() uses only the payload length to calculate pacing delays. Signed-off-by: Kevin Yang Signed-off-by: Eric Dumazet Reviewed-by: Neal Cardwell Signed-off-by: David S. Miller commit 3f484a6e766740c9cb89cf576fdceeec49e221fd Merge: f79e7115bd76 feae641d2914 Author: David S. Miller Date: Fri Jun 22 13:57:46 2018 +0900 Merge branch 'usb-callbacks' Sebastian Andrzej Siewior says: ==================== net/usb: Use irqsave in USB's complete callback This is about using _irqsave() primitives in the completion callback in order to get rid of local_irq_save() in __usb_hcd_giveback_urb(). ==================== Signed-off-by: David S. Miller commit feae641d2914e1559a29b9bf2e349578c3634b00 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:31:21 2018 +0200 net: usb: rtl8150: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Petko Manolov Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit ed7aa30e861510043f602b39f460c90aba792776 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:31:20 2018 +0200 net: usb: r8152: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit ba49fed8bbaebe6cc1fba0ac57789894be7121ed Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:31:19 2018 +0200 net: usb: kaweth: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit 12c4de4bcc23ecf3ae3400e12d0686ccdc1c0238 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:31:18 2018 +0200 net: usb: hso: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit fafa6b10485e4534fcce00a75226caec7f5e2c11 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 21:31:17 2018 +0200 net: usb: cdc-phonet: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit f79e7115bd76666860603b8fab8ccaa48a7d1735 Author: Joakim Tjernlund Date: Wed Jun 20 18:29:18 2018 +0200 ucc_geth: Add BQL support Signed-off-by: Joakim Tjernlund Signed-off-by: David S. Miller commit b212ffa14d5a4e4318523bc0bc9fe1104d206f5d Merge: e8f5b035276a 16630f54fe28 Author: David S. Miller Date: Fri Jun 22 13:54:39 2018 +0900 Merge branch 'ISDN-irqsave-and-usb_fill_int_urb' Sebastian Andrzej Siewior says: ==================== ISDN: use irqsave() in URB completion + usb_fill_int_urb This series is mostly about using _irqsave() primitives in the completion callback in order to get rid of local_irq_save() in __usb_hcd_giveback_urb(). While at it, I also tried to move drivers to use usb_fill_int_urb() otherwise it is hard find users of a certain API. ==================== Signed-off-by: David S. Miller commit 16630f54fe28fb50f95f2911dc7a3b4bf137305f Author: Sebastian Andrzej Siewior Date: Wed Jun 20 12:40:28 2018 +0200 isdn: mISDN: use irqsave() in USB's complete callback The USB completion callback does not disable interrupts while acquiring the ->lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Karsten Keil Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit e112ce43565492fae9a0481f26909899c0b60293 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 12:40:27 2018 +0200 isdn: hisax: st5481_usb: use usb_fill_int_urb() Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct (like ->complete) reveal lots of other things, too. Cc: Karsten Keil Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit dd3adc4e604a3d1ad71da489310221e136937efe Author: Sebastian Andrzej Siewior Date: Wed Jun 20 12:40:26 2018 +0200 isdn: hisax: hfc_usb: use usb_fill_int_urb() Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct (like ->complete) reveal lots of other things, too. The `interval' parameter is now set differently on HS and SS. The argument is fed from bInterval so it should be the right thing to do. Cc: Karsten Keil Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit 78c696c19578ff2bb14622304e63d7beb54206e5 Author: Sebastian Andrzej Siewior Date: Wed Jun 20 12:40:25 2018 +0200 isdn: gigaset: use usb_fill_int_urb() Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct (like ->complete) reveal lots of other things, too. Cc: Paul Bolle Cc: Karsten Keil Cc: gigaset307x-common@lists.sourceforge.net Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit e8f5b035276a71125d9872cb59c00eac7d907a79 Merge: 3f6c65d6255a 7000d53b865a Author: David S. Miller Date: Fri Jun 22 13:47:55 2018 +0900 Merge branch 'ipsec-selftests-fixes' Shannon Nelson says: ==================== fixes for ipsec selftests A couple of bad behaviors in the ipsec selftest were pointed out by Anders Roxell and are addressed here. ==================== Signed-off-by: David S. Miller commit 7000d53b865ab46e0c557e2bf7ccf05d33d0624c Author: Shannon Nelson Date: Tue Jun 19 22:42:43 2018 -0700 selftests: rtnetlink: use a local IP address for IPsec tests Find an IP address on this machine to use as a source IP, and make up a destination IP address based on the source IP. No actual messages will be sent, just a couple of IPsec rules are created and deleted. Fixes: 5e596ee171ba ("selftests: add xfrm state-policy-monitor to rtnetlink.sh") Reported-by: Anders Roxell Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 1599b218d511afad570be6048108d0746f78bfe9 Author: Shannon Nelson Date: Tue Jun 19 22:42:42 2018 -0700 selftests: rtnetlink: hide complaint from terminated monitor Set up the "ip xfrm monitor" subprogram so as to not see a "Terminated" message when the subprogram is killed. Fixes: 5e596ee171ba ("selftests: add xfrm state-policy-monitor to rtnetlink.sh") Reported-by: Anders Roxell Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 3f6c65d6255a872846c44182c82c78d3dc6239f5 Author: Wei Wang Date: Tue Jun 19 21:42:50 2018 -0700 tcp: ignore rcv_rtt sample with old ts ecr value When receiving multiple packets with the same ts ecr value, only try to compute rcv_rtt sample with the earliest received packet. This is because the rcv_rtt calculated by later received packets could possibly include long idle time or other types of delay. For example: (1) server sends last packet of reply with TS val V1 (2) client ACKs last packet of reply with TS ecr V1 (3) long idle time passes (4) client sends next request data packet with TS ecr V1 (again!) At this time, the rcv_rtt computed on server with TS ecr V1 will be inflated with the idle time and should get ignored. Signed-off-by: Wei Wang Signed-off-by: Neal Cardwell Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 66caeeb99d0db139c894b1b650546c982701aa27 Merge: e5ab564c9ebe c0690016a73f Author: David S. Miller Date: Fri Jun 22 13:43:28 2018 +0900 Merge branch 'rhashtables-cleanups' NeilBrown says: ==================== Assorted rhashtables cleanups. Following 7 patches are selections from a recent RFC series I posted that have all received suitable Acks. The most visible changes are that rhashtable-types.h is now preferred for inclusion in include/linux/*.h rather than rhashtable.h, and that the full hash is used - no bits a reserved for a NULLS pointer. ==================== Signed-off-by: David S. Miller commit c0690016a73fe6bd456887bbbe6e10c7f0096554 Author: NeilBrown Date: Mon Jun 18 12:52:50 2018 +1000 rhashtable: clean up dereference of ->future_tbl. Using rht_dereference_bucket() to dereference ->future_tbl looks like a type error, and could be confusing. Using rht_dereference_rcu() to test a pointer for NULL adds an unnecessary barrier - rcu_access_pointer() is preferred for NULL tests when no lock is held. This uses 3 different ways to access ->future_tbl. - if we know the mutex is held, use rht_dereference() - if we don't hold the mutex, and are only testing for NULL, use rcu_access_pointer() - otherwise (using RCU protection for true dereference), use rht_dereference_rcu(). Note that this includes a simplification of the call to rhashtable_last_table() - we don't do an extra dereference before the call any more. Acked-by: Herbert Xu Signed-off-by: NeilBrown Signed-off-by: David S. Miller commit 0ad66449aa3cbaedbdeaf55bffce74084bb7e9f9 Author: NeilBrown Date: Mon Jun 18 12:52:50 2018 +1000 rhashtable: use cmpxchg() to protect ->future_tbl. Rather than borrowing one of the bucket locks to protect ->future_tbl updates, use cmpxchg(). This gives more freedom to change how bucket locking is implemented. Acked-by: Herbert Xu Signed-off-by: NeilBrown Signed-off-by: David S. Miller commit 5af68ef7333c8606bfe6e400cb962081518c3acb Author: NeilBrown Date: Mon Jun 18 12:52:50 2018 +1000 rhashtable: simplify nested_table_alloc() and rht_bucket_nested_insert() Now that we don't use the hash value or shift in nested_table_alloc() there is room for simplification. We only need to pass a "is this a leaf" flag to nested_table_alloc(), and don't need to track as much information in rht_bucket_nested_insert(). Note there is another minor cleanup in nested_table_alloc() here. The number of elements in a page of "union nested_tables" is most naturally PAGE_SIZE / sizeof(ntbl[0]) The previous code had PAGE_SIZE / sizeof(ntbl[0].bucket) which happens to be the correct value only because the bucket uses all the space in the union. Acked-by: Herbert Xu Signed-off-by: NeilBrown Signed-off-by: David S. Miller commit 9b4f64a227b6f462482a8cc68c7134dc6e26f1c1 Author: NeilBrown Date: Mon Jun 18 12:52:50 2018 +1000 rhashtable: simplify INIT_RHT_NULLS_HEAD() The 'ht' and 'hash' arguments to INIT_RHT_NULLS_HEAD() are no longer used - so drop them. This allows us to also remove the nhash argument from nested_table_alloc(). Acked-by: Herbert Xu Signed-off-by: NeilBrown Signed-off-by: David S. Miller commit 9f9a707738aa7a8b9f78a641b83927ada256a626 Author: NeilBrown Date: Mon Jun 18 12:52:50 2018 +1000 rhashtable: remove nulls_base and related code. This "feature" is unused, undocumented, and untested and so doesn't really belong. A patch is under development to properly implement support for detecting when a search gets diverted down a different chain, which the common purpose of nulls markers. This patch actually fixes a bug too. The table resizing allows a table to grow to 2^31 buckets, but the hash is truncated to 27 bits - any growth beyond 2^27 is wasteful an ineffective. This patch results in NULLS_MARKER(0) being used for all chains, and leaves the use of rht_is_a_null() to test for it. Acked-by: Herbert Xu Signed-off-by: NeilBrown Signed-off-by: David S. Miller commit 0eb71a9da5796851fa87ddc1a534066c0fe54055 Author: NeilBrown Date: Mon Jun 18 12:52:50 2018 +1000 rhashtable: split rhashtable.h Due to the use of rhashtables in net namespaces, rhashtable.h is included in lots of the kernel, so a small changes can required a large recompilation. This makes development painful. This patch splits out rhashtable-types.h which just includes the major type declarations, and does not include (non-trivial) inline code. rhashtable.h is no longer included by anything in the include/ directory. Common include files only include rhashtable-types.h so a large recompilation is only triggered when that changes. Acked-by: Herbert Xu Signed-off-by: NeilBrown Signed-off-by: David S. Miller commit cbab901296232b1247b46e6e127103d2f738d783 Author: NeilBrown Date: Mon Jun 18 12:52:50 2018 +1000 rhashtable: silence RCU warning in rhashtable_test. print_ht in rhashtable_test calls rht_dereference() with neither RCU protection or the mutex. This triggers an RCU warning. So take the mutex to silence the warning. Acked-by: Herbert Xu Signed-off-by: NeilBrown Signed-off-by: David S. Miller commit 565c17b5f02dacd8430da8d95bbba60587f339af Merge: f4366e44efeb a21daa88d4f0 Author: Dave Airlie Date: Fri Jun 22 13:18:32 2018 +1000 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next First feature request for 4.19. Highlights: - Add initial amdgpu documentation - Add initial GPU scheduler documention - GPU scheduler fixes for dying processes - Add support for the JPEG engine on VCN - Switch CI to use powerplay by default - EDC support for CZ - More powerplay cleanups - Misc DC fixes Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180621161138.3008-1-alexander.deucher@amd.com commit f4366e44efeb895c358fddd11f9ecee81bdad06b Merge: 3069290d9d6a c612ae0503af Author: Dave Airlie Date: Fri Jun 22 12:56:48 2018 +1000 Merge tag 'drm-misc-next-2018-06-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 4.19: UAPI Changes: - Add writeback connector (Brian Starkey/Liviu Dudau) - Add "content type" property to HDMI connectors (Stanislav Lisovskiy) Cross-subsystem Changes: - some devicetree Docs update - fix compile breakage on ION due to the dma-buf cleanups (Christian König) Core Changes: - Reject over-sized allocation requests early (Chris Wilson) - gem-fb-helper: Always do implicit sync (Daniel Vetter) - dma-buf cleanups (Christian König) Driver Changes: - Fixes for the otm8009a panel driver (Philippe Cornu) - Add Innolux TV123WAM panel driver support (Sandeep Panda) - Move GEM BO to drm_framebuffer in few drivers (Daniel Stone) - i915 pinning improvements (Chris Wilson) - Stop consulting plane->fb/crtc in a few drivers (Ville Syrjälä) Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180621105428.GA20795@juma commit a38b80c5f49c30c3cbd4523bdbde0cc725bb0e63 Author: Souptick Joarder Date: Wed Jun 20 23:55:07 2018 +0530 scsi: cxlflash: Change return type for fault handler Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously, VM_FAULT_NOPAGE was returned without verifying return value of vm_insert_pfn. The new inline vmf_insert_pfn() will address this issue by returning correct VM_FAULT_* type from fault handler. Signed-off-by: Souptick Joarder Acked-by: Matthew R. Ochs Signed-off-by: Martin K. Petersen commit 3069290d9d6a9afa93661c299419089eea57164b Merge: ce397d215ccd 14c3f8425080 Author: Dave Airlie Date: Fri Jun 22 11:34:41 2018 +1000 Merge tag 'drm-intel-next-2018-06-06' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Ice Lake's display enabling patches (Jose, Mahesh, Dhinakaran, Paulo, Manasi, Anusha, Arkadiusz) - Ice Lake's workarounds (Oscar and Yunwei) - Ice Lake interrupt registers fixes (Oscar) - Context switch timeline fixes and improvements (Chris) - Spelling fixes (Colin) - GPU reset fixes and improvements (Chris) - Including fixes on execlist and preemption for a proper GPU reset (Chris) - Clean-up the port pipe select bits (Ville) - Other execlist improvements (Chris) - Remove unused enable_cmd_parser parameter (Chris) - Fix order of enabling pipe/transcoder/planes on HSW+ to avoid hang on ICL (Paulo) - Simplification and changes on intel_context (Chris) - Disable LVDS on Radiant P845 (Ondrej) - Improve HSW/BDW voltage swing handling (Ville) - Cleanup and renames on few parts of intel_dp code to make code clear and less confusing (Ville) - Move acpi lid notification code for fixing LVDS (Chris) - Speed up GPU idle detection (Chris) - Make intel_engine_dump irqsafe (Chris) - Fix GVT crash (Zhenyu) - Move GEM BO inside drm_framebuffer and use intel_fb_obj everywhere (Chris) - Revert edp's alternate fixed mode (Jani) - Protect tainted function pointer lookup (Chris) - And subsequent unsigned long size fix (Chris) - Allow page directory allocation to fail (Chris) - VBT's edp and lvds fix and clean-up (Ville) - Many other reorganizations and cleanups on DDI and DP code, as well on scaler and planes (Ville) - Selftest pin the mock kernel context (Chris) - Many PSR Fixes, clean-up and improvements (Dhinakaran) - PSR VBT fix (Vathsala) - Fix i915_scheduler and intel_context declaration (Tvrtko) - Improve PCH underruns detection on ILK-IVB (Ville) - Few s/drm_priv/i915 (Chris, Michal) - Notify opregion of the sanitized encoder state (Maarten) - Guc's event handling improvements and fixes on initialization failures (Michal) - Many gtt fixes and improvements (Chris) - Fixes and improvements for Suspend and Freeze safely (Chris) - i915_gem init and fini cleanup and fixes (Michal) - Remove obsolete switch_mm for gen8+ (Chris) - hw and context id fixes for GuC (Lionel) - Add new vGPU cap info bit VGT_CAPS_HUGE_GTT (Changbin) - Make context pin/unpin symmetric (Chris) - vma: Move the bind_count vs pin_count assertion to a helper (Chris) - Use available SZ_1M instead of 1 << 20 (Chris) - Trace and PMU fixes and improvements (Tvrtko) Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20180611162737.GA2378@intel.com commit 79db60a8bb0b32fdda90a338f09fc83d7d576abe Author: Stefan Wahren Date: Fri May 25 21:24:39 2018 +0200 arm64: defconfig: Enable RPi voltage sensor The patch enables the hwmon driver for the Raspberry Pi. Signed-off-by: Stefan Wahren Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 7b54aafff3ef4571567ff6a7d13ed51554f07a71 Author: Stefan Wahren Date: Fri May 25 21:24:38 2018 +0200 ARM: multi_v7_defconfig: Enable RPi voltage sensor The patch enables the hwmon driver for the Raspberry Pi. Signed-off-by: Stefan Wahren Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 992f641f396c60b90013d9a8e04241c5936ac407 Author: Stefan Wahren Date: Fri May 25 21:24:37 2018 +0200 ARM: bcm2835_defconfig: Enable RPi voltage sensor The patch enables the hwmon driver for the Raspberry Pi. Signed-off-by: Stefan Wahren Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 5ae3769917d223175d001c5de3c1fa598ee37228 Author: Fabio Estevam Date: Tue Jun 19 11:19:55 2018 -0700 Input: imx6ul_tsc - switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Dmitry Torokhov commit e5163596820d138c7eec9378ea0eaff281328dff Author: Fabio Estevam Date: Tue Jun 19 11:19:28 2018 -0700 Input: fsl-imx25-tcq - switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Dmitry Torokhov commit a9faa462b6e79edcc230b25e3eb922ebc65b7430 Author: Fabio Estevam Date: Tue Jun 19 11:19:14 2018 -0700 Input: snvs_pwrkey - switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Dmitry Torokhov commit 0eb70904546bbaad22cb609caef8b9132216474e Author: Fabio Estevam Date: Tue Jun 19 11:18:50 2018 -0700 Input: imx_keypad - switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Dmitry Torokhov commit be3035e3627d2570de4c2c612ecd095968986437 Author: Stefan Wahren Date: Fri May 25 21:24:34 2018 +0200 ARM: bcm2835: Add GET_THROTTLED firmware property Recent Raspberry Pi firmware provides a mailbox property to detect under-voltage conditions. Here is the current definition. The u32 value returned by the firmware is divided into 2 parts: - lower 16-bits are the live value - upper 16-bits are the history or sticky value Bits: 0: undervoltage 1: arm frequency capped 2: currently throttled 16: undervoltage has occurred 17: arm frequency capped has occurred 18: throttling has occurred Signed-off-by: Stefan Wahren Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit e9af481cbc21bba1d4447a5a4bd1674c40d619a1 Author: Stefan Wahren Date: Thu Jun 14 21:50:04 2018 +0200 ARM: dts: add Raspberry Pi Compute Module and IO board The Raspberry Pi Compute Module (CM1) is a SoM which contains a BCM2835 processor, 512 MB RAM and a 4 GB eMMC. There is also a carrier board which is called Compute Module IO Board. Signed-off-by: Stefan Wahren Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 02361bc7788852f33dd0a05235a52b9ccf097916 Author: Kees Cook Date: Thu May 31 11:45:25 2018 -0700 lib/bch: Remove VLA usage In the quest to remove all stack VLA usage from the kernel[1], this allocates a fixed size stack array to cover the range needed for bch. This was done instead of a preallocation on the SLAB due to performance reasons, shown by Ivan Djelic: little-endian, type sizes: int=4 long=8 longlong=8 cpu: Intel(R) Core(TM) i5 CPU         650  @ 3.20GHz calibration: iter=4.9143µs niter=2034 nsamples=200 m=13 t=4   Buffer allocation |  Encoding throughput (Mbit/s) ---------------------------------------------------  on-stack, VLA      |   3988  on-stack, fixed    |   4494  kmalloc            |   1967 So this change actually improves performance too, it seems. The resulting stack allocation can get rather large; without CONFIG_BCH_CONST_PARAMS, it will allocate 4096 bytes, which trips the stack size checking: lib/bch.c: In function ‘encode_bch’: lib/bch.c:261:1: warning: the frame size of 4432 bytes is larger than 2048 bytes [-Wframe-larger-than=] Even the default case for "allmodconfig" (with CONFIG_BCH_CONST_M=14 and CONFIG_BCH_CONST_T=4) would have started throwing a warning: lib/bch.c: In function ‘encode_bch’: lib/bch.c:261:1: warning: the frame size of 2288 bytes is larger than 2048 bytes [-Wframe-larger-than=] But this is how large it's always been; it was just hidden from the checker because it was a VLA. So the Makefile has been adjusted to silence this warning for anything smaller than 4500 bytes, which should provide room for normal cases, but still low enough to catch any future pathological situations. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook Reviewed-by: Ivan Djelic Tested-by: Ivan Djelic Acked-by: Boris Brezillon Signed-off-by: Boris Brezillon commit 38ebbe2b7282e985a7acc862892564e8fbbde866 Author: Alexey Khoroshilov Date: Wed May 9 18:11:20 2018 +0300 mtd: spi-nor: nxp-spifi: release flash_np in nxp_spifi_probe() nxp_spifi_probe() increments refcnt of SPI flash device node by of_get_next_available_child() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: Boris Brezillon commit 14d1d190869685d3a1e8a3f63924e20594557cb2 Author: Eric Anholt Date: Tue Jun 5 12:03:01 2018 -0700 drm/v3d: Remove the bad signaled() implementation. Since our seqno value comes from a counter associated with the GPU ring, not the entity (aka client), they'll be completed out of order. There's actually no need for this code at all, since we don't have enable_signaling() and thus DMA_FENCE_SIGNALED_BIT will be set before we could be called. Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180605190302.18279-2-eric@anholt.net Reviewed-by: Lucas Stach commit 7122b68b8a9692dcc3acf89595f04c492872115f Author: Eric Anholt Date: Wed Jun 6 10:48:51 2018 -0700 drm/v3d: Take a lock across GPU scheduler job creation and queuing. Between creation and queueing of a job, you need to prevent any other job from being created and queued. Otherwise the scheduler's fences may be signaled out of seqno order. v2: move mutex unlock to the error label. Signed-off-by: Eric Anholt Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+") Link: https://patchwork.freedesktop.org/patch/msgid/20180606174851.12433-1-eric@anholt.net Reviewed-by: Lucas Stach commit 6aa13402c11035a428d8c621b334734971d5d39d Author: Eric Anholt Date: Wed Jun 6 12:04:29 2018 -0700 drm/bridge: Move the struct drm_bridge member kerneldoc inline. This makes it more likely that the docs stay updated with the code. Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180606190431.1833-1-eric@anholt.net Reviewed-by: Andrzej Hajda commit abd7dbe921bb2c12933551423de23dda2980c890 Author: Souptick Joarder Date: Sat Apr 14 21:53:21 2018 +0530 gpu: drm: vc4: Adding new typedef vm_fault_t Use new return type vm_fault_t for fault handler. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit e16a375086337af3fcf21dbd512e1573049ba6cb Author: Vandita Kulkarni Date: Thu Jun 21 20:43:56 2018 +0530 drm/i915: Enable hw workaround to bypass alpha Alpha blending with alpha 0 and 0xff passes through alpha math and rounding logic causing differences compared to fully transparent or opaque plane,resulting in CRC mismatch. This WA on icl and above enables hardware to bypass alpha math and rounding for per pixel alpha values of 00 and 0xff v2: Fix patchwork checkpatch warnings. Signed-off-by: Vandita Kulkarni Reviewed-by: Maarten Lankhorst Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/1529594036-25036-1-git-send-email-vandita.kulkarni@intel.com commit 0af5107cd0640ee3424e337b492e4b11b450ce28 Author: Talat Batheesh Date: Thu May 17 11:14:18 2018 +0300 net/mlx5: Add RoCE RX ICRC encapsulated counter Add capability bit in PCAM register and RoCE ICRC error counter to PPCNT register. Signed-off-by: Talat Batheesh Reviewed-by: Mark Bloch Signed-off-by: Leon Romanovsky commit 75a040ff14d9a99fc041f5e1d8f09541cab13ba4 Author: Alexey Dobriyan Date: Sun Apr 1 01:00:36 2018 +0300 locking/refcounts: Include fewer headers in Debloat 's dependencies: - is not needed, but is. - is not needed, only a forward declaration of "struct mutex". - is not needed, is enough. Signed-off-by: Alexey Dobriyan Cc: Andrew Morton Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Link: https://lkml.kernel.org/lkml/20180331220036.GA7676@avx2 Signed-off-by: Ingo Molnar commit 8d4f4b82155cc6774d0fd8aaafb882566f7fd5fb Author: Ville Syrjälä Date: Fri Jun 15 20:39:39 2018 +0300 drm: Document mode_config.max_width/height as the max fb dimensions The meaning of the mode_config max_width/height fields has not been entirely clear. They are used both as the max framebuffer dimensions, and they are also used by drm_mode_getconnector() to filter out any mode whose hdisplay/vdisplay exceed those limits. Let's put it in writing that max_width/height only refrer to the max framebuffer dimensions, and should those be higher than the hardware limits for display timings the driver must validate the latter using some other means. We'll keep the max_width/height usage in drm_mode_getconnector() because setcrtc treats hdisplay/vdisplay also as the primary plane width, and having a plane bigger than the max fb size doesn't make much sense (if we ignore scaling that is). It all works out fine as long as the max fb dimensions are at least equal to the max timing limits. If the opposite were true we may want to rethink what drm_mode_getconnector() does. Maybe do the mode filtering only for non-atomic userspace? Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180615173939.11353-1-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit bd99ce085f165a07fe8b33ad04157b91c91b8668 Author: Imre Deak Date: Tue Jun 19 19:41:15 2018 +0300 drm/i915/icl: Do read-modify-write as needed during MG PLL programming Some MG PLL registers have fields that need to be preserved at their HW default or BIOS programmed values. So make sure we preserve them. v2: - Add comment to icl_mg_pll_write() explaining the need for register masks. (Vandita) - Fix patchwork checkpatch warning. v3: - Rebase on drm-tip. Cc: Vandita Kulkarni Cc: Paulo Zanoni Cc: James Ausmus Signed-off-by: Imre Deak Reviewed-by: James Ausmus (v1) Reviewed-by: Vandita Kulkarni Link: https://patchwork.freedesktop.org/patch/msgid/20180619164115.7835-1-imre.deak@intel.com commit 9fc59bae0f4a8ec3676a9245abed7721b4d3d8c9 Author: Imre Deak Date: Fri Jun 15 17:39:10 2018 +0300 drm/i915/icl: Fix MG PLL setup when refclk is 38.4MHz Atm we're zeroing out fields in MG_PLL_BIAS and MG_PLL_TDC_COLDST_BIAS if refclk is 38.4MHz, whereas the spec tells us to preserve them. Although the calculated values mostly match the register defaults even for the 38.4MHz case, there are some differences wrt. what BIOS programs (I noticed at least differences in the MG_PLL_BIAS/IREFTRIM and MG_PLL_BIAS/BIASCAL_EN fields). In the lack of further info on how to program these fields, just do what the spec says and preserve the BIOS state. v2: - Preserve the BIOS programmed reg fields instead of programming them. Cc: Vandita Kulkarni Cc: Paulo Zanoni Cc: James Ausmus Signed-off-by: Imre Deak Reviewed-by: James Ausmus (v1) Reviewed-by: Vandita Kulkarni Link: https://patchwork.freedesktop.org/patch/msgid/20180615143911.31082-1-imre.deak@intel.com commit 03585a95cd830e7a92697d2a8fe9a34df87563db Author: Li RongQing Date: Wed Apr 11 13:16:56 2018 +0800 sched/fair: Remove stale tg_unthrottle_up() comments After commit: 82958366cfea ("sched: Replace update_shares weight distribution with per-entity computation") tg_unthrottle_up() did not update the weight. Signed-off-by: Li RongQing Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/lkml/1523423816-18322-1-git-send-email-lirongqing@baidu.com Signed-off-by: Ingo Molnar commit 8a29c778fa1a50a25a3e66cf9589888758858d24 Author: Lucas De Marchi Date: Wed May 23 11:04:35 2018 -0700 drm/i915: remove check for aux irq This became dead code with commit 309bd8ed464f ("drm/i915: Reinstate GMBUS and AUX interrupts on gen4/g4x"). v2: Move comment about HW behavior to where decision is made to enable MSI (Ville). Cc: Ville Syrjälä Signed-off-by: Lucas De Marchi Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180523180435.18042-1-lucas.demarchi@intel.com commit 1bce62a6e0dd85c15cbab36a0f7b9d4766cef18e Author: Takashi Iwai Date: Tue Jun 19 23:15:59 2018 +0200 ALSA: hda/realtek - Simplify alc269_fixup_hp_line1_mic1_led() alc269_fixup_hp_line1_mic1_led() can be simplified more with the existing helper code. Signed-off-by: Takashi Iwai commit 0722867dcbc28cc9b269b57acd847c7c1aa638d6 Author: Masami Hiramatsu Date: Sat Apr 28 21:38:04 2018 +0900 kprobes/arm64: Fix %p uses in error messages Fix %p uses in error messages by removing it because those are redundant or meaningless. Signed-off-by: Masami Hiramatsu Acked-by: Will Deacon Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Cc: Arnd Bergmann Cc: David Howells Cc: David S . Miller Cc: Heiko Carstens Cc: Jon Medhurst Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tobin C . Harding Cc: acme@kernel.org Cc: akpm@linux-foundation.org Cc: brueckner@linux.vnet.ibm.com Cc: linux-arch@vger.kernel.org Cc: rostedt@goodmis.org Cc: schwidefsky@de.ibm.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/lkml/152491908405.9916.12425053035317241111.stgit@devbox Signed-off-by: Ingo Molnar commit 75b2f5f5911fe7a2fc82969b2b24dde34e8f820d Author: Masami Hiramatsu Date: Sat Apr 28 21:37:33 2018 +0900 kprobes/arm: Fix %p uses in error messages Fix %p uses in error messages by removing it and using general dumper. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Cc: Arnd Bergmann Cc: David Howells Cc: David S . Miller Cc: Heiko Carstens Cc: Jon Medhurst Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tobin C . Harding Cc: Will Deacon Cc: acme@kernel.org Cc: akpm@linux-foundation.org Cc: brueckner@linux.vnet.ibm.com Cc: linux-arch@vger.kernel.org Cc: rostedt@goodmis.org Cc: schwidefsky@de.ibm.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/lkml/152491905361.9916.15300852365956231645.stgit@devbox Signed-off-by: Ingo Molnar commit 0ea063306eecf300fcf06d2f5917474b580f666f Author: Masami Hiramatsu Date: Sat Apr 28 21:37:03 2018 +0900 kprobes/x86: Fix %p uses in error messages Remove all %p uses in error messages in kprobes/x86. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Cc: Arnd Bergmann Cc: David Howells Cc: David S . Miller Cc: Heiko Carstens Cc: Jon Medhurst Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tobin C . Harding Cc: Will Deacon Cc: acme@kernel.org Cc: akpm@linux-foundation.org Cc: brueckner@linux.vnet.ibm.com Cc: linux-arch@vger.kernel.org Cc: rostedt@goodmis.org Cc: schwidefsky@de.ibm.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/lkml/152491902310.9916.13355297638917767319.stgit@devbox Signed-off-by: Ingo Molnar commit 4458515b2c52831ee622411d2fe3e774d1f5c49a Author: Masami Hiramatsu Date: Sat Apr 28 21:36:33 2018 +0900 kprobes: Replace %p with other pointer types Replace %p with %pS or just remove it if unneeded. And use WARN_ONCE() if it is a single bug. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Cc: Arnd Bergmann Cc: David Howells Cc: David S . Miller Cc: Heiko Carstens Cc: Jon Medhurst Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tobin C . Harding Cc: Will Deacon Cc: acme@kernel.org Cc: akpm@linux-foundation.org Cc: brueckner@linux.vnet.ibm.com Cc: linux-arch@vger.kernel.org Cc: rostedt@goodmis.org Cc: schwidefsky@de.ibm.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/lkml/152491899284.9916.5350534544808158621.stgit@devbox Signed-off-by: Ingo Molnar commit 81365a947de453bcaba2558f8de5dadcffe05bc1 Author: Masami Hiramatsu Date: Sat Apr 28 21:36:02 2018 +0900 kprobes: Show address of kprobes if kallsyms does Show probed address in debugfs kprobe list file as same as kallsyms does. This information is used for checking kprobes are placed in the expected address. So it should be able to compared with address in kallsyms. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Cc: Arnd Bergmann Cc: David Howells Cc: David S . Miller Cc: Heiko Carstens Cc: Jon Medhurst Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tobin C . Harding Cc: Will Deacon Cc: acme@kernel.org Cc: akpm@linux-foundation.org Cc: brueckner@linux.vnet.ibm.com Cc: linux-arch@vger.kernel.org Cc: rostedt@goodmis.org Cc: schwidefsky@de.ibm.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/lkml/152491896256.9916.1583733714492565296.stgit@devbox Signed-off-by: Ingo Molnar commit ffb9bd68ebdb3b8d00ef5a79bbe8167a3281cace Author: Masami Hiramatsu Date: Sat Apr 28 21:35:32 2018 +0900 kprobes: Show blacklist addresses as same as kallsyms does Show kprobes blacklist addresses under same condition of showing kallsyms addresses. Since there are several name conflict for local symbols, kprobe blacklist needs to show each addresses so that user can identify where is on blacklist by comparing with kallsyms. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Cc: Arnd Bergmann Cc: David Howells Cc: David S . Miller Cc: Heiko Carstens Cc: Jon Medhurst Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Thomas Richter Cc: Tobin C . Harding Cc: Will Deacon Cc: acme@kernel.org Cc: akpm@linux-foundation.org Cc: brueckner@linux.vnet.ibm.com Cc: linux-arch@vger.kernel.org Cc: rostedt@goodmis.org Cc: schwidefsky@de.ibm.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/lkml/152491893217.9916.14760965896164273464.stgit@devbox Signed-off-by: Ingo Molnar commit f2a3ab36077222437b4826fc76111caa14562b7c Author: Masami Hiramatsu Date: Sat Apr 28 21:35:01 2018 +0900 kprobes: Make list and blacklist root user read only Since the blacklist and list files on debugfs indicates a sensitive address information to reader, it should be restricted to the root user. Suggested-by: Thomas Richter Suggested-by: Ingo Molnar Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Cc: Arnd Bergmann Cc: David Howells Cc: David S . Miller Cc: Heiko Carstens Cc: Jon Medhurst Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tobin C . Harding Cc: Will Deacon Cc: acme@kernel.org Cc: akpm@linux-foundation.org Cc: brueckner@linux.vnet.ibm.com Cc: linux-arch@vger.kernel.org Cc: rostedt@goodmis.org Cc: schwidefsky@de.ibm.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/lkml/152491890171.9916.5183693615601334087.stgit@devbox Signed-off-by: Ingo Molnar commit 80dc12cdfb9e8966da4f02d6d7accf2cb691caf2 Author: Gustavo A. R. Silva Date: Thu Jun 21 08:22:09 2018 -0500 spi: spi-fsl-dspi: Fix copy-paste error in dspi_probe It seems that the proper structure field to use in this particular case is *regmap_pushr* instead of regmap. Addresses-Coverity-ID: 1470126 ("Copy-paste error") Fixes: 58ba07ec79e6 ("spi: spi-fsl-dspi: Add support for XSPI mode registers") Signed-off-by: Gustavo A. R. Silva Acked-by: Esben Haabendal Signed-off-by: Mark Brown commit 11e34e64e4103955fc4568750914c75d65ea87ee Author: Konrad Rzeszutek Wilk Date: Wed Jun 20 16:42:58 2018 -0400 x86/cpufeatures: Add detection of L1D cache flush support. 336996-Speculative-Execution-Side-Channel-Mitigations.pdf defines a new MSR (IA32_FLUSH_CMD) which is detected by CPUID.7.EDX[28]=1 bit being set. This new MSR "gives software a way to invalidate structures with finer granularity than other architectual methods like WBINVD." A copy of this document is available at https://bugzilla.kernel.org/show_bug.cgi?id=199511 Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit 6415b38bae2641ab6e173ffa4ff6a453b60ba99b Author: Jiri Slaby Date: Fri May 18 08:47:13 2018 +0200 x86/stacktrace: Enable HAVE_RELIABLE_STACKTRACE for the ORC unwinder In SUSE, we need a reliable stack unwinder for kernel live patching, but we do not want to enable frame pointers for performance reasons. So after the previous patches to make the ORC reliable, mark ORC as a reliable stack unwinder on x86. Signed-off-by: Jiri Slaby Acked-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/lkml/20180518064713.26440-6-jslaby@suse.cz Signed-off-by: Ingo Molnar commit d31a580266eeb1f355df90fde8a71f480e30ad70 Author: Josh Poimboeuf Date: Fri May 18 08:47:12 2018 +0200 x86/unwind/orc: Detect the end of the stack The existing UNWIND_HINT_EMPTY annotations happen to be good indicators of where entry code calls into C code for the first time. So also use them to mark the end of the stack for the ORC unwinder. Use that information to set unwind->error if the ORC unwinder doesn't unwind all the way to the end. This will be needed for enabling HAVE_RELIABLE_STACKTRACE for the ORC unwinder so we can use it with the livepatch consistency model. Thanks to Jiri Slaby for teaching the ORCs about the unwind hints. Signed-off-by: Josh Poimboeuf Signed-off-by: Jiri Slaby Acked-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/lkml/20180518064713.26440-5-jslaby@suse.cz Signed-off-by: Ingo Molnar commit 0c414367c04eeb00c3ebfee0b74c9e7f3b95fd62 Author: Jiri Slaby Date: Fri May 18 08:47:11 2018 +0200 x86/stacktrace: Do not fail for ORC with regs on stack save_stack_trace_reliable now returns "non reliable" when there are kernel pt_regs on stack. This means an interrupt or exception happened somewhere down the route. It is a problem for the frame pointer unwinder, because the frame might not have been set up yet when the irq happened, so the unwinder might fail to unwind from the interrupted function. With ORC, this is not a problem, as ORC has out-of-band data. We can find ORC data even for the IP in the interrupted function and always unwind one level up reliably. So lift the check to apply only when CONFIG_FRAME_POINTER=y is enabled. Signed-off-by: Jiri Slaby Acked-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/lkml/20180518064713.26440-4-jslaby@suse.cz Signed-off-by: Ingo Molnar commit 441ccc3580f45340715fd8f5c4db795b06326404 Author: Jiri Slaby Date: Fri May 18 08:47:10 2018 +0200 x86/stacktrace: Clarify the reliable success paths Make clear which path is for user tasks and for kthreads and idle tasks. This will allow easier plug-in of the ORC unwinder in the next patches. Note that we added a check for unwind error to the top of the loop, so that an error is returned also for user tasks (the 'goto success' would skip the check after the loop otherwise). Signed-off-by: Jiri Slaby Acked-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/lkml/20180518064713.26440-3-jslaby@suse.cz Signed-off-by: Ingo Molnar commit 17426923b03f098da83b8c1e044934a34959f69b Author: Jiri Slaby Date: Fri May 18 08:47:09 2018 +0200 x86/stacktrace: Remove STACKTRACE_DUMP_ONCE The stack unwinding can sometimes fail yet. Especially with the generated debug info. So do not yell at users -- live patching (the only user of this interface) will inform the user about the failure gracefully. And given this was the only user of the macro, remove the macro proper too. Signed-off-by: Jiri Slaby Acked-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/lkml/20180518064713.26440-2-jslaby@suse.cz Signed-off-by: Ingo Molnar commit 0797a8d0d79769574550caa5ca5d89c237723250 Author: Jiri Slaby Date: Fri May 18 08:47:08 2018 +0200 x86/stacktrace: Do not unwind after user regs Josh pointed out, that there is no way a frame can be after user regs. So remove the last unwind and the check. Signed-off-by: Jiri Slaby Acked-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/lkml/20180518064713.26440-1-jslaby@suse.cz Signed-off-by: Ingo Molnar commit 9e3ed2d7597ccbce2a30e036342fb0613d0759e5 Author: Souptick Joarder Date: Mon May 21 23:55:20 2018 +0530 perf/core: Change perf_mmap_fault() return type to 'vm_fault_t' Use new return type 'vm_fault_t' for fault handlers. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. See the following commit: 1c8f422059ae ("mm: change return type to vm_fault_t") Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: acme@kernel.org Cc: akpm@linux-foundation.org Cc: alexander.shishkin@linux.intel.com Cc: jolsa@redhat.com Cc: namhyung@kernel.org Link: https://lkml.kernel.org/lkml/20180521182520.GA19677@jordon-HP-15-Notebook-PC Signed-off-by: Ingo Molnar commit 1a7ed1ba4bba6c075d5ad61bb75e3fbc870840d6 Author: Vlastimil Babka Date: Thu Jun 21 12:36:29 2018 +0200 x86/speculation/l1tf: Extend 64bit swap file size limit The previous patch has limited swap file size so that large offsets cannot clear bits above MAX_PA/2 in the pte and interfere with L1TF mitigation. It assumed that offsets are encoded starting with bit 12, same as pfn. But on x86_64, offsets are encoded starting with bit 9. Thus the limit can be raised by 3 bits. That means 16TB with 42bit MAX_PA and 256TB with 46bit MAX_PA. Fixes: 377eeaa8e11f ("x86/speculation/l1tf: Limit swap file size to MAX_PA/2") Signed-off-by: Vlastimil Babka Signed-off-by: Thomas Gleixner commit 8f894bf47dc9e8b77166125a084a7217693a28cd Author: Yisheng Xie Date: Thu May 31 19:11:19 2018 +0800 sched/debug: Use match_string() helper instead of open-coded logic match_string() returns the index of an array for a matching string, which can be used instead of the open coded variant. Signed-off-by: Yisheng Xie Reviewed-by: Andy Shevchenko Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/1527765086-19873-15-git-send-email-xieyisheng1@huawei.com Signed-off-by: Ingo Molnar commit 8b077e4a69bef5c4121426e99497975860191e53 Author: Kan Liang Date: Tue Jun 5 08:38:46 2018 -0700 perf/x86/intel/lbr: Optimize context switches for the LBR call stack Context switches with perf LBR call stack context are fairly expensive because they do a lot of MSR writes. Currently we unconditionally do the expensive operation when LBR call stack is enabled. It's not necessary for some common cases, e.g task -> other kernel thread -> same task. The LBR registers are not changed, hence they don't need to be rewritten/restored. Introduce per-CPU variables to track the last LBR call stack context. If the same context is scheduled in, the rewrite/restore is not required, with the following two exceptions: - The LBR registers may be modified by a normal LBR event, i.e., adding a new LBR event or scheduling an existing LBR event. In both cases, the LBR registers are reset first. The last LBR call stack information is cleared in intel_pmu_lbr_reset(). Restoring the LBR registers is required. - The LBR registers are initialized to zero in C6. If the LBR registers which TOS points is cleared, C6 must be entered while swapped out. Restoring the LBR registers is required as well. These exceptions are not common. Signed-off-by: Kan Liang Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Stephane Eranian Cc: Vince Weaver Cc: Alexander Shishkin Cc: acme@kernel.org Cc: eranian@google.com Link: https://lore.kernel.org/lkml/1528213126-4312-2-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar commit 0592e57b24e7e05ec1f4c50b9666c013abff7017 Author: Kan Liang Date: Tue Jun 5 08:38:45 2018 -0700 perf/x86/intel/lbr: Fix incomplete LBR call stack LBR has a limited stack size. If a task has a deeper call stack than LBR's stack size, only the overflowed part is reported. A complete call stack may not be reconstructed by perf tool. Current code doesn't access all LBR registers. It only read the ones below the TOS. The LBR registers above the TOS will be discarded unconditionally. When a CALL is captured, the TOS is incremented by 1 , modulo max LBR stack size. The LBR HW only records the call stack information to the register which the TOS points to. It will not touch other LBR registers. So the registers above the TOS probably still store the valid call stack information for an overflowed call stack, which need to be reported. To retrieve complete call stack information, we need to start from TOS, read all LBR registers until an invalid entry is detected. 0s can be used to detect the invalid entry, because: - When a RET is captured, the HW zeros the LBR register which TOS points to, then decreases the TOS. - The LBR registers are reset to 0 when adding a new LBR event or scheduling an existing LBR event. - A taken branch at IP 0 is not expected The context switch code is also modified to save/restore all valid LBR registers. Furthermore, the LBR registers, which don't have valid call stack information, need to be reset in restore, because they may be polluted while swapped out. Here is a small test program, tchain_deep. Its call stack is deeper than 32. noinline void f33(void) { int i; for (i = 0; i < 10000000;) { if (i%2) i++; else i++; } } noinline void f32(void) { f33(); } noinline void f31(void) { f32(); } ... ... noinline void f1(void) { f2(); } int main() { f1(); } Here is the test result on SKX. The max stack size of SKX is 32. Without the patch: $ perf record -e cycles --call-graph lbr -- ./tchain_deep $ perf report --stdio # # Children Self Command Shared Object Symbol # ........ ........ ........... ................ ................. # 100.00% 99.99% tchain_deep tchain_deep [.] f33 | --99.99%--f30 f31 f32 f33 With the patch: $ perf record -e cycles --call-graph lbr -- ./tchain_deep $ perf report --stdio # Children Self Command Shared Object Symbol # ........ ........ ........... ................ .................. # 99.99% 0.00% tchain_deep tchain_deep [.] f1 | ---f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24 f25 f26 f27 f28 f29 f30 f31 f32 f33 Signed-off-by: Kan Liang Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Stephane Eranian Cc: Vince Weaver Cc: Alexander Shishkin Cc: Thomas Gleixner Cc: acme@kernel.org Cc: eranian@google.com Link: https://lore.kernel.org/lkml/1528213126-4312-1-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar commit 1966c5e5bd9802cf62d3744ef4d2d6d32e22604d Author: Uros Bizjak Date: Tue Jun 5 18:39:09 2018 +0200 x86/asm: Use CC_SET/CC_OUT in percpu_cmpxchg8b_double() to micro-optimize code generation Use CC_SET(z)/CC_OUT(z) instead of explicit SETZ instruction. Using these two defines, the compiler that supports generation of condition code outputs from inline assembly flags generates e.g.: cmpxchg8b %fs:(%esi) jne 172255 <__kmalloc+0x65> instead of: cmpxchg8b %fs:(%esi) sete %al test %al,%al je 172255 <__kmalloc+0x65> Note that older compilers now generate: cmpxchg8b %fs:(%esi) sete %cl test %cl,%cl je 173a85 <__kmalloc+0x65> since we have to mark that cmpxchg8b instruction outputs to %eax register and this way clobbers the value in the register. Signed-off-by: Uros Bizjak Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180605163910.13015-1-ubizjak@gmail.com Signed-off-by: Ingo Molnar commit ee9c7f9ae3d4fb9fb5c9cacbe3880d5dd66feb16 Author: Arnd Bergmann Date: Wed Jun 20 15:15:24 2018 -0500 gfs2: call ktime_get_coarse_real_ts64() directly current_kernel_time64() is now just a deprecated wrapper around ktime_get_coarse_real_ts64(), so let's just call that directly. Signed-off-by: Arnd Bergmann Signed-off-by: Bob Peterson commit 00251a16d7f9eb380437b402def05cd7c1b16c09 Author: Andreas Gruenbacher Date: Mon Jun 18 16:34:59 2018 +0100 gfs2: Minor clarification to __gfs2_punch_hole Rename end_off to end_len to make the code less confusing. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson commit 9e1a9ecd13b9bb421c88135b178577caf4d54f6a Author: Andreas Gruenbacher Date: Thu Jun 7 11:56:46 2018 +0100 gfs2: Don't withdraw under a spin lock In two places, the gfs2_io_error_bh macro is called while holding the sd_ail_lock spin lock. This isn't allowed because gfs2_io_error_bh withdraws the filesystem, which can sleep because it issues a uevent. To fix that, add a gfs2_io_error_bh_wd macro that does withdraw the filesystem and change gfs2_io_error_bh to not withdraw the filesystem. In those places where the new gfs2_io_error_bh is used, withdraw the filesystem after releasing sd_ail_lock. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson Reviewed-by: Andrew Price commit f85c10e24ab9fd8ccb6de3d6061a3110ff3581df Author: Bob Peterson Date: Wed Jun 13 08:52:47 2018 -0500 gfs2: eliminate rs_inum and reduce the size of gfs2 inodes Before this patch, block reservations kept track of the inode number. At one point, that was a valid thing to do. However, since we made the reservation a part of the inode (rather than a pointer to a separate allocated object) the reservation can determine the inode number by using container_of. This saves us a little memory in our inode. Signed-off-by: Bob Peterson Acked-by: Steven Whitehouse Reviewed-by: Andreas Gruenbacher commit 7cc7eaad49c30ac165ecf84d95b26f7e0d53bd97 Author: Mark Rutland Date: Thu Jun 21 13:13:21 2018 +0100 atomics/treewide: Clean up '*_andnot()' ifdeffery The ifdeffery for atomic*_{fetch_,}andnot() is unlike that for all the other atomics. If atomic*_andnot() is not defined, the corresponding atomic*_fetch_andnot() is assumed to not be defined. Additionally, the fallbacks for the various ordering cases are written much later in atomic.h as static inlines. This isn't problematic today, but gets in the way of scripting the generation of atomics. To prepare for scripting, this patch: * Switches to separate ifdefs for atomic*_andnot() and atomic*_fetch_andnot(), updating implementations as appropriate. * Moves the fallbacks into the standards ifdefs, as macro expansions rather than static inlines. * Removes trivial andnot implementations from architectures, where these are superseded by core code. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-19-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit b3a2a05f9111de0b79312e577608a27b0318c0a1 Author: Mark Rutland Date: Thu Jun 21 13:13:20 2018 +0100 atomics/treewide: Make conditional inc/dec ops optional The conditional inc/dec ops differ for atomic_t and atomic64_t: - atomic_inc_unless_positive() is optional for atomic_t, and doesn't exist for atomic64_t. - atomic_dec_unless_negative() is optional for atomic_t, and doesn't exist for atomic64_t. - atomic_dec_if_positive is optional for atomic_t, and is mandatory for atomic64_t. Let's make these consistently optional for both. At the same time, let's clean up the existing fallbacks to use atomic_try_cmpxchg(). The instrumented atomics are updated accordingly. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-18-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 9837559d8eb01ce834e56fc9a567c1d94ebd3698 Author: Mark Rutland Date: Thu Jun 21 13:13:19 2018 +0100 atomics/treewide: Make unconditional inc/dec ops optional Many of the inc/dec ops are mandatory, but for most architectures inc/dec are simply trivial wrappers around their corresponding add/sub ops. Let's make all the inc/dec ops optional, so that we can get rid of these boilerplate wrappers. The instrumented atomics are updated accordingly. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-17-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 18cc1814d4e7560412c9c8c6d28f9d6782c8b402 Author: Mark Rutland Date: Thu Jun 21 13:13:18 2018 +0100 atomics/treewide: Make test ops optional Some of the atomics return the result of a test applied after the atomic operation, and almost all architectures implement these as trivial wrappers around the underlying atomic. Specifically: * _inc_and_test(v) is (_inc_return(v) == 0) * _dec_and_test(v) is (_dec_return(v) == 0) * _sub_and_test(i, v) is (_sub_return(i, v) == 0) * _add_negative(i, v) is (_add_return(i, v) < 0) Rather than have these definitions duplicated in all architectures, with minor inconsistencies in formatting and documentation, let's make these operations optional, with default fallbacks as above. Implementations must now provide a preprocessor symbol. The instrumented atomics are updated accordingly. Both x86 and m68k have custom implementations, which are left as-is, given preprocessor symbols to avoid being overridden. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Geert Uytterhoeven Acked-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-16-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 356701329fb391184618eda7b7fb68cb35271506 Author: Mark Rutland Date: Thu Jun 21 13:13:17 2018 +0100 atomics/treewide: Make atomic64_fetch_add_unless() optional Architectures with atomic64_fetch_add_unless() provide a preprocessor symbol if they do so, and all other architectures have trivial C implementations of atomic64_add_unless() which are near-identical. Let's unify the trivial definitions of atomic64_fetch_add_unless() in , so that we always have both atomic64_fetch_add_unless() and atomic64_add_unless() with less boilerplate code. This means that atomic64_add_unless() is always implemented in core code, and the instrumented atomics are updated accordingly. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-15-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 2b523f170e399b0e1c8eec2c4b5889735b0d2b9b Author: Mark Rutland Date: Thu Jun 21 13:13:16 2018 +0100 atomics/riscv: Define atomic64_fetch_add_unless() As a step towards unifying the atomic/atomic64/atomic_long APIs, this patch converts the arch/riscv implementation of atomic64_add_unless() into an implementation of atomic64_fetch_add_unless(). A wrapper in will build atomic_add_unless() atop of this, provided it is given a preprocessor definition. No functional change is intended as a result of this patch. Acked-by Palmer Dabbelt Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Albert Ou Cc: Boqun Feng Cc: Linus Torvalds Cc: Palmer Dabbelt Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-14-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 4f44b4b2b337e100ae655d03c42d140816c8caf9 Author: Mark Rutland Date: Thu Jun 21 13:13:15 2018 +0100 atomics/powerpc: Define atomic64_fetch_add_unless() As a step towards unifying the atomic/atomic64/atomic_long APIs, this patch converts the arch/powerpc implementation of atomic64_add_unless() into an implementation of atomic64_fetch_add_unless(). A wrapper in will build atomic_add_unless() atop of this, provided it is given a preprocessor definition. No functional change is intended as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Acked-by: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Boqun Feng Cc: Linus Torvalds Cc: Paul Mackerras Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-13-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit fee8ca9fa5659d8d79432d38c52fa18da67f1e71 Author: Mark Rutland Date: Thu Jun 21 13:13:14 2018 +0100 atomics/arm: Define atomic64_fetch_add_unless() As a step towards unifying the atomic/atomic64/atomic_long APIs, this patch converts the arch/arm implementation of atomic64_add_unless() into an implementation of atomic64_fetch_add_unless(). A wrapper in will build atomic_add_unless() atop of this, provided it is given a preprocessor definition. No functional change is intended as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Linus Torvalds Cc: Russell King Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-12-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit ab0b910490fef91cd02691d3311f6ebaaed4c196 Author: Mark Rutland Date: Thu Jun 21 13:13:13 2018 +0100 atomics/arc: Define atomic64_fetch_add_unless() As a step towards unifying the atomic/atomic64/atomic_long APIs, this patch converts the arch/arc implementation of atomic64_add_unless() into an implementation of atomic64_fetch_add_unless(). A wrapper in will build atomic_add_unless() atop of this, provided it is given a preprocessor definition. No functional change is intended as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Vineet Gupta Link: https://lore.kernel.org/lkml/20180621121321.4761-11-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 434b6acc31302b37031674af104f45eb4e7a1fc1 Author: Mark Rutland Date: Thu Jun 21 13:13:12 2018 +0100 atomics/alpha: Define atomic64_fetch_add_unless() As a step towards unifying the atomic/atomic64/atomic_long APIs, this patch converts the arch/alpha implementation of atomic64_add_unless() into an implementation of atomic64_fetch_add_unless(). A wrapper in will build atomic_add_unless() atop of this, provided it is given a preprocessor definition. No functional change is intended as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Ivan Kokshaysky Cc: Linus Torvalds Cc: Matt Turner Cc: Richard Henderson Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-10-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 00b808ab79ead372daf1a0682d1ef271599c0b55 Author: Mark Rutland Date: Thu Jun 21 13:13:11 2018 +0100 atomics/generic: Define atomic64_fetch_add_unless() As a step towards unifying the atomic/atomic64/atomic_long APIs, this patch converts the generic implementation of atomic64_add_unless() into a generic implementation of atomic64_fetch_add_unless(). A wrapper in will build atomic_add_unless() atop of this, provided it is given a preprocessor definition. No functional change is intended as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Arnd Bergmann Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-9-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 0ae1d994020d75ac065fd42ac4cbf5ac6ce9b255 Author: Mark Rutland Date: Thu Jun 21 13:13:10 2018 +0100 atomics: Prepare for atomic64_fetch_add_unless() Currently all architectures must implement atomic_fetch_add_unless(), with common code providing atomic_add_unless(). Architectures must also implement atomic64_add_unless() directly, with no corresponding atomic64_fetch_add_unless(). This divergence is unfortunate, and means that the APIs for atomic_t, atomic64_t, and atomic_long_t differ. In preparation for unifying things, with architectures providing atomic64_fetch_add_unless, this patch adds a generic atomic64_add_unless() which will use atomic64_fetch_add_unless(). The instrumented atomics are updated to take this case into account. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Albert Ou Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Boqun Feng Cc: Ivan Kokshaysky Cc: Linus Torvalds Cc: Matt Turner Cc: Michael Ellerman Cc: Palmer Dabbelt Cc: Paul Mackerras Cc: Richard Henderson Cc: Russell King Cc: Thomas Gleixner Cc: Vineet Gupta Link: https://lore.kernel.org/lkml/20180621121321.4761-8-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit eccc2da8c03f316bba202e15af2be4615f461900 Author: Mark Rutland Date: Thu Jun 21 13:13:09 2018 +0100 atomics/treewide: Make atomic_fetch_add_unless() optional Several architectures these have a near-identical implementation based on atomic_read() and atomic_cmpxchg() which we can instead define in , so let's do so, using something close to the existing x86 implementation with try_cmpxchg(). Where an architecture provides its own atomic_fetch_add_unless(), it must define a preprocessor symbol for it. The instrumented atomics are updated accordingly. Note that arch/arc's existing atomic_fetch_add_unless() had redundant barriers, as these are already present in its atomic_cmpxchg() implementation. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Geert Uytterhoeven Reviewed-by: Will Deacon Acked-by: Geert Uytterhoeven Acked-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Vineet Gupta Link: https://lore.kernel.org/lkml/20180621121321.4761-7-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit bef828204a1bc7a0fd3a24551c4265e9c2ab95ed Author: Mark Rutland Date: Thu Jun 21 13:13:08 2018 +0100 atomics/treewide: Make atomic64_inc_not_zero() optional We define a trivial fallback for atomic_inc_not_zero(), but don't do the same for atomic64_inc_not_zero(), leading most architectures to define the same boilerplate. Let's add a fallback in , and remove the redundant implementations. Note that atomic64_add_unless() is always defined in , and promotes its arguments to the requisite types, so we need not do this explicitly. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-6-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit ade5ef9280c33993099199c51e2e27c2c4013afd Author: Mark Rutland Date: Thu Jun 21 13:13:07 2018 +0100 atomics: Make conditional ops return 'bool' Some of the atomics return a status value, which is a boolean value describing whether the operation was performed. To make it clear that this is a boolean value, let's update the common fallbacks to return bool, fixing up the return values and comments likewise. At the same time, let's simplify the description of the operations in their respective comments. The instrumented atomics and generic atomic64 implementation are updated accordingly. Note that atomic64_dec_if_positive() doesn't follow the usual test op pattern, and returns the would-be decremented value. This is not changed. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Linus Torvalds Cc: Michael Ellerman Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-5-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit f74445b6dd6b8f33ed34e005d19ecbb49171dabf Author: Mark Rutland Date: Thu Jun 21 13:13:06 2018 +0100 atomics/treewide: Remove atomic_inc_not_zero_hint() While documentation suggests atomic_inc_not_zero_hint() will perform better than atomic_inc_not_zero(), this is unlikely to be the case. No architectures implement atomic_inc_not_zero_hint() directly, and thus it either falls back to atomic_inc_not_zero(), or a loop using atomic_cmpxchg(). Whenever the hint does not match the value in memory, the repeated use of atomic_cmpxchg() will be more expensive than the read that atomic_inc_not_zero_hint() attempts to avoid. For architectures with LL/SC atomics, a read cannot be avoided, and it would always be better to use atomic_inc_not_zero() directly. For other architectures, their own atomic_inc_not_zero() is likely to be more optimal than an atomic_cmpxchg() loop regardless. Generally, atomic_inc_not_zero_hint() is liable to perform worse than atomic_inc_not_zero(). Further, atomic_inc_not_zero_hint() only exists for atomic_t, and not atomic64_t or atomic_long_t, and there is only one user in the kernel tree. Given all this, let's remove atomic_inc_not_zero_hint(), and migrate the existing user over to atomic_inc_not_zero(). There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-4-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 8b47038e6d349cca950e75076566a0de990c4645 Author: Mark Rutland Date: Thu Jun 21 13:13:05 2018 +0100 atomics/treewide: Remove redundant atomic_inc_not_zero() definitions When atomic_inc_not_zero(v) isn't defined, will define it as falling back to atomic_add_unless((v), 1, 0), so there's no need for arch code to do so. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-3-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit bfc18e389c7a09fbbbed6bf4032396685b14246e Author: Mark Rutland Date: Thu Jun 21 13:13:04 2018 +0100 atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() While __atomic_add_unless() was originally intended as a building-block for atomic_add_unless(), it's now used in a number of places around the kernel. It's the only common atomic operation named __atomic*(), rather than atomic_*(), and for consistency it would be better named atomic_fetch_add_unless(). This lack of consistency is slightly confusing, and gets in the way of scripting atomics. Given that, let's clean things up and promote it to an official part of the atomics API, in the form of atomic_fetch_add_unless(). This patch converts definitions and invocations over to the new name, including the instrumented version, using the following script: ---- git grep -w __atomic_add_unless | while read line; do sed -i '{s/\<__atomic_add_unless\>/atomic_fetch_add_unless/}' "${line%%:*}"; done git grep -w __arch_atomic_add_unless | while read line; do sed -i '{s/\<__arch_atomic_add_unless\>/arch_atomic_fetch_add_unless/}' "${line%%:*}"; done ---- Note that we do not have atomic{64,_long}_fetch_add_unless(), which will be introduced by later patches. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Will Deacon Acked-by: Geert Uytterhoeven Acked-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Cc: Boqun Feng Cc: Linus Torvalds Cc: Thomas Gleixner Link: https://lore.kernel.org/lkml/20180621121321.4761-2-mark.rutland@arm.com Signed-off-by: Ingo Molnar commit 2207def700f902f169fc237b717252c326f9e464 Author: Thomas Gleixner Date: Tue Jun 5 14:00:11 2018 +0200 x86/apic: Ignore secondary threads if nosmt=force nosmt on the kernel command line merely prevents the onlining of the secondary SMT siblings. nosmt=force makes the APIC detection code ignore the secondary SMT siblings completely, so they even do not show up as possible CPUs. That reduces the amount of memory allocations for per cpu variables and saves other resources from being allocated too large. This is not fully equivalent to disabling SMT in the BIOS because the low level SMT enabling in the BIOS can result in partitioning of resources between the siblings, which is not undone by just ignoring them. Some CPUs can use the full resources when their sibling is not onlined, but this is depending on the CPU family and model and it's not well documented whether this applies to all partitioned resources. That means depending on the workload disabling SMT in the BIOS might result in better performance. Linus analysis of the Intel manual: The intel optimization manual is not very clear on what the partitioning rules are. I find: "In general, the buffers for staging instructions between major pipe stages are partitioned. These buffers include µop queues after the execution trace cache, the queues after the register rename stage, the reorder buffer which stages instructions for retirement, and the load and store buffers. In the case of load and store buffers, partitioning also provided an easier implementation to maintain memory ordering for each logical processor and detect memory ordering violations" but some of that partitioning may be relaxed if the HT thread is "not active": "In Intel microarchitecture code name Sandy Bridge, the micro-op queue is statically partitioned to provide 28 entries for each logical processor, irrespective of software executing in single thread or multiple threads. If one logical processor is not active in Intel microarchitecture code name Ivy Bridge, then a single thread executing on that processor core can use the 56 entries in the micro-op queue" but I do not know what "not active" means, and how dynamic it is. Some of that partitioning may be entirely static and depend on the early BIOS disabling of HT, and even if we park the cores, the resources will just be wasted. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit 1e1d7e25fd759eddf96d8ab39d0a90a1979b2d8c Author: Thomas Gleixner Date: Wed Jun 6 00:57:38 2018 +0200 x86/cpu/AMD: Evaluate smp_num_siblings early To support force disabling of SMT it's required to know the number of thread siblings early. amd_get_topology() cannot be called before the APIC driver is selected, so split out the part which initializes smp_num_siblings and invoke it from amd_early_init(). Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar commit 119bff8a9c9bb00116a844ec68be7bc4b1c768f5 Author: Borislav Petkov Date: Fri Jun 15 20:48:39 2018 +0200 x86/CPU/AMD: Do not check CPUID max ext level before parsing SMP info Old code used to check whether CPUID ext max level is >= 0x80000008 because that last leaf contains the number of cores of the physical CPU. The three functions called there now do not depend on that leaf anymore so the check can go. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar commit 1910ad5624968f93be48e8e265513c54d66b897c Author: Thomas Gleixner Date: Wed Jun 6 01:00:55 2018 +0200 x86/cpu/intel: Evaluate smp_num_siblings early Make use of the new early detection function to initialize smp_num_siblings on the boot cpu before the MP-Table or ACPI/MADT scan happens. That's required for force disabling SMT. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit 95f3d39ccf7aaea79d1ffdac1c887c2e100ec1b6 Author: Thomas Gleixner Date: Wed Jun 6 00:55:39 2018 +0200 x86/cpu/topology: Provide detect_extended_topology_early() To support force disabling of SMT it's required to know the number of thread siblings early. detect_extended_topology() cannot be called before the APIC driver is selected, so split out the part which initializes smp_num_siblings. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit 545401f4448a807b963ff17b575e0a393e68b523 Author: Thomas Gleixner Date: Wed Jun 6 00:53:57 2018 +0200 x86/cpu/common: Provide detect_ht_early() To support force disabling of SMT it's required to know the number of thread siblings early. detect_ht() cannot be called before the APIC driver is selected, so split out the part which initializes smp_num_siblings. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit 44ca36de56d1bf196dca2eb67cd753a46961ffe6 Author: Thomas Gleixner Date: Wed Jun 6 00:47:10 2018 +0200 x86/cpu/AMD: Remove the pointless detect_ht() call Real 32bit AMD CPUs do not have SMT and the only value of the call was to reach the magic printout which got removed. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit 55e6d279abd92cfd7576bba031e7589be8475edb Author: Thomas Gleixner Date: Wed Jun 6 00:36:15 2018 +0200 x86/cpu: Remove the pointless CPU printout The value of this printout is dubious at best and there is no point in having it in two different places along with convoluted ways to reach it. Remove it completely. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit 05736e4ac13c08a4a9b1ef2de26dd31a32cbee57 Author: Thomas Gleixner Date: Tue May 29 17:48:27 2018 +0200 cpu/hotplug: Provide knobs to control SMT Provide a command line and a sysfs knob to control SMT. The command line options are: 'nosmt': Enumerate secondary threads, but do not online them 'nosmt=force': Ignore secondary threads completely during enumeration via MP table and ACPI/MADT. The sysfs control file has the following states (read/write): 'on': SMT is enabled. Secondary threads can be freely onlined 'off': SMT is disabled. Secondary threads, even if enumerated cannot be onlined 'forceoff': SMT is permanentely disabled. Writes to the control file are rejected. 'notsupported': SMT is not supported by the CPU The command line option 'nosmt' sets the sysfs control to 'off'. This can be changed to 'on' to reenable SMT during runtime. The command line option 'nosmt=force' sets the sysfs control to 'forceoff'. This cannot be changed during runtime. When SMT is 'on' and the control file is changed to 'off' then all online secondary threads are offlined and attempts to online a secondary thread later on are rejected. When SMT is 'off' and the control file is changed to 'on' then secondary threads can be onlined again. The 'off' -> 'on' transition does not automatically online the secondary threads. When the control file is set to 'forceoff', the behaviour is the same as setting it to 'off', but the operation is irreversible and later writes to the control file are rejected. When the control status is 'notsupported' then writes to the control file are rejected. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit cc1fe215e1efa406b03aa4389e6269b61342dec5 Author: Thomas Gleixner Date: Tue May 29 17:49:05 2018 +0200 cpu/hotplug: Split do_cpu_down() Split out the inner workings of do_cpu_down() to allow reuse of that function for the upcoming SMT disabling mechanism. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit c4de65696d865c225fda3b9913b31284ea65ea96 Author: Thomas Gleixner Date: Tue May 29 19:05:25 2018 +0200 cpu/hotplug: Make bringup/teardown of smp threads symmetric The asymmetry caused a warning to trigger if the bootup was stopped in state CPUHP_AP_ONLINE_IDLE. The warning no longer triggers as kthread_park() can now be invoked on already or still parked threads. But there is still no reason to have this be asymmetric. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit f048c399e0f7490ab7296bc2c255d37eb14a9675 Author: Thomas Gleixner Date: Thu Jun 21 10:37:20 2018 +0200 x86/topology: Provide topology_smt_supported() Provide information whether SMT is supoorted by the CPUs. Preparatory patch for SMT control mechanism. Suggested-by: Dave Hansen Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar commit 6a4d2657e048f096c7ffcad254010bd94891c8c0 Author: Thomas Gleixner Date: Tue May 29 17:50:22 2018 +0200 x86/smp: Provide topology_is_primary_thread() If the CPU is supporting SMT then the primary thread can be found by checking the lower APIC ID bits for zero. smp_num_siblings is used to build the mask for the APIC ID bits which need to be taken into account. This uses the MPTABLE or ACPI/MADT supplied APIC ID, which can be different than the initial APIC ID in CPUID. But according to AMD the lower bits have to be consistent. Intel gave a tentative confirmation as well. Preparatory patch to support disabling SMT at boot/runtime. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit ba2591a5993eabcc8e874e30f361d8ffbb10d6d4 Author: Peter Zijlstra Date: Tue May 29 16:43:46 2018 +0200 sched/smt: Update sched_smt_present at runtime The static key sched_smt_present is only updated at boot time when SMT siblings have been detected. Booting with maxcpus=1 and bringing the siblings online after boot rebuilds the scheduling domains correctly but does not update the static key, so the SMT code is not enabled. Let the key be updated in the scheduler CPU hotplug code to fix this. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar commit 0bed2aa3ac5cbbd0b89bf5e94f165e2ef18180ad Author: Takashi Iwai Date: Tue Jun 19 12:45:53 2018 +0200 ALSA: hda - Sanity check of unexpected cap_sync_hook override There are a couple of places setting cap_sync_hook in the codec drivers, and they just overwrite the value. Add a sanity check via WARN_ON() in case if an old non-NULL value is overridden and forgotten. Signed-off-by: Takashi Iwai commit 3bf29db731ce22480de748464031b4447b248c0f Author: Takashi Iwai Date: Tue Jun 19 12:44:35 2018 +0200 ALSA: hda/sigmatel - Use common helper for mic mute LED To simplify the code and to get the mic-mute LED behavior control, use the new helper function for controlling the mic mute LED instead of open-codes. Signed-off-by: Takashi Iwai commit c647f806b8c227de05f7f91b0ba8450b58cb3dfe Author: Takashi Iwai Date: Tue Jun 19 12:42:03 2018 +0200 ALSA: hda - Allow multiple ADCs for mic mute LED controls Instead of refusing, allow the configuration with the multiple ADCs (thus multiple capture switches) for enabling the mic mute LED. This has been done for Sigmatel/IDT codecs, and we treat the OR-ed values from all capture switches as the boolean condition. Signed-off-by: Takashi Iwai commit 184e302b46c94bfb1d53fe3d4c925a45a6990430 Author: Takashi Iwai Date: Tue Jun 19 12:36:36 2018 +0200 ALSA: hda/conexant - Use the mic-mute LED helper Convert to use the common helper for controlling the mic mute LED for HP laptops, just as we've done for Realtek codecs. This will give the mic mute LED enum as gratis. Signed-off-by: Takashi Iwai commit d03abecab5b4f4fa533f5971a4b205d05e9a4bc3 Author: Takashi Iwai Date: Tue Jun 19 12:29:13 2018 +0200 ALSA: hda/realtek - Use the mic-mute LED helper for HP and others Similar as the previous commit, convert to use the common helper for controlling the mic mute LED for HP and other machines in the Realtek codec driver, too. This will give the mic mute LED enum as gratis. Signed-off-by: Takashi Iwai commit 69b2c6d7c0204e68185b694f9cfcb8f2636fed5d Author: Takashi Iwai Date: Mon Jun 18 17:28:45 2018 +0200 ALSA: hda - Use the common helper for thinkpad_acpi mic mute LED handling Use the new common helper for setting up and controlling the mic mute LED over thinkpad_acpi. This also provides a new mixer enum "Mic Mute-LED Mode" (that was present only for Dell models), which allows user to choose the mic mute LED behavior. For example, if you want the mic mute LED turned on only while mic is on, choose "Follow Capture" there. Tested-by: Pali Rohár Signed-off-by: Takashi Iwai commit f567b78851d49a4887b9bb1a8b3cfad37da515c8 Author: Takashi Iwai Date: Mon Jun 18 17:26:12 2018 +0200 ALSA: hda - Move mic mute LED helper to the generic parser Move the code for setting up and controlling the mic mute LED hook from dell-wmi helper to the generic parser, so that it can be referred from the multiple driver codes. No functional change. Tested-by: Pali Rohár Signed-off-by: Takashi Iwai commit 4f722a6a736765310bc95dd3879f1545e5f64303 Author: Pierre-Louis Bossart Date: Tue Jun 19 14:00:37 2018 -0500 ASoC: Intel: common: rename 'reef' to 'sof' in ACPI matching table Align with firmware tools, no functionality change Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 356c6fe7d80c678cf77aede0f95291dfd5ed2ef2 Author: Will Deacon Date: Tue Jun 19 13:53:14 2018 +0100 locking/atomics/arm64, arm64/bitops: Include provides the ext2 atomic bitop definitions, so we don't need to define our own. Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-10-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit 7c8fc35dfc32dfa97d8a1dc25dbd064cf83936db Author: Will Deacon Date: Tue Jun 19 13:53:13 2018 +0100 locking/atomics/arm64: Replace our atomic/lock bitop implementations with asm-generic The implementations are built around the atomic-fetch ops, which we implement efficiently for both LSE and LL/SC systems. Use that instead of our hand-rolled, out-of-line bitops.S. Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-9-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit 84c6591103dbeaf393a092a3fc7b09510825f6b9 Author: Will Deacon Date: Tue Jun 19 13:53:12 2018 +0100 locking/atomics, asm-generic/bitops/lock.h: Rewrite using atomic_fetch_*() The lock bitops can be implemented more efficiently using the atomic_fetch_*() ops, which provide finer-grained control over the memory ordering semantics than the bitops. Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-8-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit e986a0d6cb36b54838b2f5f8ac2bb5f9baadd977 Author: Will Deacon Date: Tue Jun 19 13:53:11 2018 +0100 locking/atomics, asm-generic/bitops/atomic.h: Rewrite using atomic_*() APIs The atomic bitops can actually be implemented pretty efficiently using the atomic_*() ops, rather than explicit use of spinlocks. Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-7-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit 1c2672b49aa49d4fdc69d4ebbaf959264051e34a Author: Will Deacon Date: Tue Jun 19 13:53:10 2018 +0100 locking/atomics/sh: Don't pull in all of in The sh implementation of pulls in so that it can refer to BITS_PER_BYTE. It also transitively relies on this pulling in for READ_ONCE(). Replace the #include with and . Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-6-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit b22d73c2bd76a6d05256dcd3262d00b5f5af09f4 Author: Will Deacon Date: Tue Jun 19 13:53:09 2018 +0100 locking/atomics/openrisc: Don't pull in all of in The openrisc implementation of pulls in , so that it can refer to BITS_PER_BYTE. It also transitively relies on this pulling in for READ_ONCE(). Replace the #include with and . Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-5-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit 8bd9cb51daac89337295b6f037b0486911e1b408 Author: Will Deacon Date: Tue Jun 19 13:53:08 2018 +0100 locking/atomics, asm-generic: Move some macros from to a new file In preparation for implementing the asm-generic atomic bitops in terms of atomic_long_*(), we need to prevent implementations from pulling in . A common reason for this include is for the BITS_PER_BYTE definition, so move this and some other BIT() and masking macros into a new header file, . Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-4-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit 84038fd98e8e03ec418e3244b98eb248c5349d7e Author: Will Deacon Date: Tue Jun 19 13:53:07 2018 +0100 locking/atomics/m68k: Don't use is shortly going to be built on top of the atomic_long_*() API, which introduces a nasty circular dependency for m68k where pulls in via: linux/atomic.h asm/atomic.h linux/irqflags.h asm/irqflags.h linux/preempt.h asm/preempt.h asm-generic/preempt.h linux/thread_info.h asm/thread_info.h asm/page.h asm-generic/getorder.h linux/log2.h linux/bitops.h Since m68k isn't SMP and doesn't support ACQUIRE/RELEASE barriers, we can just define the lock bitops in terms of the atomic bitops in the header. Signed-off-by: Will Deacon Acked-by: Geert Uytterhoeven Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-3-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit a70cee9737802654bbbddec027d1d57b7ff24a2c Author: Will Deacon Date: Tue Jun 19 13:53:06 2018 +0100 locking/atomics/h8300: Don't include in isn't needed by and will result in circular dependencies when the asm-generic atomic bitops are built around the atomic_long_t interface. Remove the broad include and replace it with for READ_ONCE() etc and for arch_local_irq_save() etc. Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yoshinori Sato Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-2-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar commit 4de58696de076d9bd2745d1cbe0930635c3f5ac9 Author: Masami Hiramatsu Date: Wed Jun 20 01:17:15 2018 +0900 kprobes: Remove jprobe stub API Remove jprobe stub APIs from linux/kprobes.h since the jprobe implementation was completely gone. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Link: https://lore.kernel.org/lkml/152942503572.15209.1652552217914694917.stgit@devbox Signed-off-by: Ingo Molnar commit dcce32d952eddcd427f648ebd04339cfbf305e23 Author: Masami Hiramatsu Date: Wed Jun 20 01:16:46 2018 +0900 Documentation/kprobes: Add how to change the execution path Add a section that explaining how to change the execution path with kprobes and warnings for some arch. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/lkml/152942500680.15209.12374262914863044775.stgit@devbox Signed-off-by: Ingo Molnar commit 2bbda764d720aacabaad38374d26fcccb7843f17 Author: Masami Hiramatsu Date: Wed Jun 20 01:16:17 2018 +0900 kprobes/x86: Do not disable preempt on int3 path Since int3 and debug exception(for singlestep) are run with IRQ disabled and while running single stepping we drop IF from regs->flags, that path must not be preemptible. So we can remove the preempt disable/enable calls from that path. Suggested-by: Ingo Molnar Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/lkml/152942497779.15209.2879580696589868291.stgit@devbox Signed-off-by: Ingo Molnar commit cce188bd58cfbd603b904dbce75f34de2eff959a Author: Masami Hiramatsu Date: Wed Jun 20 01:15:45 2018 +0900 bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe Clear current_kprobe and enable preemption in kprobe even if pre_handler returns !0. This simplifies function override using kprobes. Jprobe used to require to keep the preemption disabled and keep current_kprobe until it returned to original function entry. For this reason kprobe_int3_handler() and similar arch dependent kprobe handers checks pre_handler result and exit without enabling preemption if the result is !0. After removing the jprobe, Kprobes does not need to keep preempt disabled even if user handler returns !0 anymore. But since the function override handler in error-inject and bpf is also returns !0 if it overrides a function, to balancing the preempt count, it enables preemption and reset current kprobe by itself. That is a bad design that is very buggy. This fixes such unbalanced preempt-count and current_kprobes setting in kprobes, bpf and error-inject. Note: for powerpc and x86, this removes all preempt_disable from kprobe_ftrace_handler because ftrace callbacks are called under preempt disabled. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Acked-by: Naveen N. Rao Cc: Alexei Starovoitov Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: David S. Miller Cc: Fenghua Yu Cc: Heiko Carstens Cc: James Hogan Cc: Josef Bacik Cc: Linus Torvalds Cc: Martin Schwidefsky Cc: Michael Ellerman Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Ralf Baechle Cc: Rich Felker Cc: Russell King Cc: Steven Rostedt Cc: Tony Luck Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-ia64@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-s390@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: sparclinux@vger.kernel.org Link: https://lore.kernel.org/lkml/152942494574.15209.12323837825873032258.stgit@devbox Signed-off-by: Ingo Molnar commit d5ad85b6d9ac286ae7fa8718a8a1c28561349c07 Author: Masami Hiramatsu Date: Wed Jun 20 01:15:17 2018 +0900 sparc64/kprobes: Don't call the ->break_handler() in sparc64 kprobes code Don't call the ->break_handler() from the sparc64 kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: David S. Miller Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: sparclinux@vger.kernel.org Link: https://lore.kernel.org/lkml/152942491684.15209.8114703769135529984.stgit@devbox Signed-off-by: Ingo Molnar commit fa5a24b16f94415d0a5da40bd479c26cfc6c15e3 Author: Masami Hiramatsu Date: Wed Jun 20 01:14:47 2018 +0900 sh/kprobes: Don't call the ->break_handler() in SH kprobes code Don't call the ->break_handler() from the SH kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rich Felker Cc: Steven Rostedt Cc: Yoshinori Sato Cc: linux-arch@vger.kernel.org Cc: linux-sh@vger.kernel.org Link: https://lore.kernel.org/lkml/152942488763.15209.7791710414058030809.stgit@devbox Signed-off-by: Ingo Molnar commit cba5ec980ca14b204bdb128be397ed1ddc1c7249 Author: Masami Hiramatsu Date: Wed Jun 20 01:14:18 2018 +0900 s390/kprobes: Don't call the ->break_handler() in s390 kprobes code Don't call the ->break_handler() from the s390 kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Heiko Carstens Cc: Linus Torvalds Cc: Martin Schwidefsky Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-s390@vger.kernel.org Link: https://lore.kernel.org/lkml/152942485849.15209.16608277783809018031.stgit@devbox Signed-off-by: Ingo Molnar commit 9b85753da73c5c10a9bee4d573be9503ad726b45 Author: Masami Hiramatsu Date: Wed Jun 20 01:13:49 2018 +0900 MIPS/kprobes: Don't call the ->break_handler() in MIPS kprobes code Don't call the ->break_handler() from the MIPS kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: James Hogan Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Ralf Baechle Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-mips@linux-mips.org Link: https://lore.kernel.org/lkml/152942482953.15209.843924518200700137.stgit@devbox Signed-off-by: Ingo Molnar commit cf3bb032fd753424e48d1bc580634768fc54aabe Author: Masami Hiramatsu Date: Wed Jun 20 01:13:20 2018 +0900 ia64/kprobes: Don't call the ->break_handler() in ia64 kprobes code Don't call the ->break_handler() from the ia64 kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Fenghua Yu Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Tony Luck Cc: linux-arch@vger.kernel.org Cc: linux-ia64@vger.kernel.org Link: https://lore.kernel.org/lkml/152942480045.15209.10715901482832337704.stgit@devbox Signed-off-by: Ingo Molnar commit 6e5fd3a298e9ff74e5bf60f161e31cdb72f2e6bd Author: Masami Hiramatsu Date: Wed Jun 20 01:12:51 2018 +0900 powerpc/kprobes: Don't call the ->break_handler() in powerpc kprobes code Don't call the ->break_handler() from the powerpc kprobes code, because it was only used by jprobes which got removed. This also removes skip_singlestep() and embeds it in the caller, kprobe_ftrace_handler(), which simplifies regs->nip operation around there. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Acked-by: Naveen N. Rao Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Benjamin Herrenschmidt Cc: Linus Torvalds Cc: Michael Ellerman Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/lkml/152942477127.15209.8982613703787878618.stgit@devbox Signed-off-by: Ingo Molnar commit c9abd554aa1231df2ad1dd5b30114c1552c2d956 Author: Masami Hiramatsu Date: Wed Jun 20 01:12:22 2018 +0900 arm64/kprobes: Don't call the ->break_handler() in arm64 kprobes code Don't call the ->break_handler() from the arm64 kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Acked-by: Will Deacon Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Catalin Marinas Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/lkml/152942474231.15209.17684808374429473004.stgit@devbox Signed-off-by: Ingo Molnar commit 75feff53a2011e8954fab02bdcef49f36a01b256 Author: Masami Hiramatsu Date: Wed Jun 20 01:11:53 2018 +0900 ARM/kprobes: Don't call the ->break_handler() in arm kprobes code Don't call the ->break_handler() from the arm kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Russell King Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/lkml/152942471328.15209.10625693210204476080.stgit@devbox Signed-off-by: Ingo Molnar commit 5ed4b0c5d17671160c0ab74a260ae57e9352b585 Author: Masami Hiramatsu Date: Wed Jun 20 01:11:24 2018 +0900 ARC/kprobes: Don't call the ->break_handler() in ARC kprobes code Don't call the ->break_handler() from the ARC kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Vineet Gupta Cc: linux-arch@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Link: https://lore.kernel.org/lkml/152942468446.15209.13773902741600803798.stgit@devbox Signed-off-by: Ingo Molnar commit e704e34cd0bbd1c69eb4ca724935a23f6440502e Author: Masami Hiramatsu Date: Wed Jun 20 01:10:55 2018 +0900 kprobes/x86: Don't call the ->break_handler() in x86 kprobes Don't call the ->break_handler() and remove break_handler related code from x86 since that was only used by jprobe which got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Link: https://lore.kernel.org/lkml/152942465549.15209.15889693025972771135.stgit@devbox Signed-off-by: Ingo Molnar commit 059053a275b56eff1db11605c68988a6e9818561 Author: Masami Hiramatsu Date: Wed Jun 20 01:10:27 2018 +0900 kprobes: Don't check the ->break_handler() in generic kprobes code Don't check the ->break_handler() from the core kprobes code, because it was only used by jprobes which got removed. ( In followup patches we'll remove the remaining calls in low level arch handlers as well and remove the callback altogether. ) Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Link: https://lore.kernel.org/lkml/152942462686.15209.6324404940493598980.stgit@devbox Signed-off-by: Ingo Molnar commit e9bf11a5a68b39e41f2113b7d3cf5125d6816e23 Author: Masami Hiramatsu Date: Wed Jun 20 01:09:58 2018 +0900 sparc64/kprobes: Remove jprobe implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/sparc. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: David S. Miller Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: sparclinux@vger.kernel.org Link: https://lore.kernel.org/lkml/152942459795.15209.9736720668494241853.stgit@devbox Signed-off-by: Ingo Molnar commit 8a4b11a21eaf2b7bae91e6de7ac0543e0342e955 Author: Masami Hiramatsu Date: Wed Jun 20 01:09:28 2018 +0900 sh/kprobes: Remove jprobe implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/sh. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rich Felker Cc: Steven Rostedt Cc: Yoshinori Sato Cc: linux-arch@vger.kernel.org Cc: linux-sh@vger.kernel.org Link: https://lore.kernel.org/lkml/152942456877.15209.5482537226935729621.stgit@devbox Signed-off-by: Ingo Molnar commit fc682f7ba30e89aa49386fd7e427e3d083b7ae58 Author: Masami Hiramatsu Date: Wed Jun 20 01:08:59 2018 +0900 s390/kprobes: Remove jprobe implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/s390. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Heiko Carstens Cc: Linus Torvalds Cc: Martin Schwidefsky Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-s390@vger.kernel.org Link: https://lore.kernel.org/lkml/152942453967.15209.8535227381029256754.stgit@devbox Signed-off-by: Ingo Molnar commit 8c2c3f2d40b6c4f40eddc099916dffac6171bf2e Author: Masami Hiramatsu Date: Wed Jun 20 01:08:30 2018 +0900 MIPS/kprobes: Remove jprobe implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/mips. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: James Hogan Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Ralf Baechle Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-mips@linux-mips.org Link: https://lore.kernel.org/lkml/152942451058.15209.3459785416221980965.stgit@devbox Signed-off-by: Ingo Molnar commit 0aeaf6b3a34588050a32d88177e18a1909bbb994 Author: Masami Hiramatsu Date: Wed Jun 20 01:08:01 2018 +0900 ia64/kprobes: Remove jprobe implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/ia64. Note that since ia64 jprobes code is a bit different from other architectures, this keeps __IA64_BREAK_JPROBE for checking the ->break_handler(). It will be removed with the break_handler() calls afterwards. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Fenghua Yu Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Tony Luck Cc: linux-arch@vger.kernel.org Cc: linux-ia64@vger.kernel.org Link: https://lore.kernel.org/lkml/152942448152.15209.2026051332977587306.stgit@devbox Signed-off-by: Ingo Molnar commit c530e2f02ef8700ec59fed175e800a2a97695350 Author: Masami Hiramatsu Date: Wed Jun 20 01:07:32 2018 +0900 powerpc/kprobes: Remove jprobe powerpc implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/powerpc. This also reverts commits related __is_active_jprobe() function. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Acked-by: Naveen N. Rao Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Benjamin Herrenschmidt Cc: Linus Torvalds Cc: Michael Ellerman Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/lkml/152942445234.15209.12868722778364739753.stgit@devbox Signed-off-by: Ingo Molnar commit 2efb75cd712d8311a2d0c1ba041ded191398bca7 Author: Masami Hiramatsu Date: Wed Jun 20 01:07:03 2018 +0900 arm64/kprobes: Remove jprobe implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arm64. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Acked-by: Will Deacon Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Catalin Marinas Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/lkml/152942442318.15209.17767976282305601884.stgit@devbox Signed-off-by: Ingo Molnar commit 454f3e132d0520472558518df61ee14db1dbef88 Author: Masami Hiramatsu Date: Wed Jun 20 01:06:34 2018 +0900 ARM/kprobes: Remove jprobe arm implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arm. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Russell King Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/lkml/152942439350.15209.11127640848082283736.stgit@devbox Signed-off-by: Ingo Molnar commit e00f1993e98b464bf530ba6ac5763b2ceccd2a1e Author: Masami Hiramatsu Date: Wed Jun 20 01:06:04 2018 +0900 ARC/kprobes: Remove jprobe implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arc. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Vineet Gupta Cc: linux-arch@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Link: https://lore.kernel.org/lkml/152942436460.15209.3038881268172249579.stgit@devbox Signed-off-by: Ingo Molnar commit 80006dbee674f9fa7c20a799d208657a18b5dabf Author: Masami Hiramatsu Date: Wed Jun 20 01:05:35 2018 +0900 kprobes/x86: Remove jprobe implementation Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/x86. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Link: https://lore.kernel.org/lkml/152942433578.15209.14034551799624757792.stgit@devbox Signed-off-by: Ingo Molnar commit 5a6cf77f5e35e7af35d36a1e7dc21a42f6412e4f Author: Masami Hiramatsu Date: Wed Jun 20 01:05:07 2018 +0900 kprobes: Remove jprobe API implementation Remove functionally empty jprobe API implementations and test cases. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Link: https://lore.kernel.org/lkml/152942430705.15209.2307050500995264322.stgit@devbox Signed-off-by: Ingo Molnar commit bc8c9da5a24bb5087197820a2ccabd9c37627035 Author: Masami Hiramatsu Date: Wed Jun 20 01:04:38 2018 +0900 Documentation/kprobes: Remove jprobes related leftover Remove 'jps' from the document, since jprobe got removed. Signed-off-by: Masami Hiramatsu Acked-by: Thomas Gleixner Cc: Ananth N Mavinakayanahalli Cc: Andrew Morton Cc: Jonathan Corbet Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: linux-arch@vger.kernel.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/lkml/152942427814.15209.6650206464370123166.stgit@devbox Signed-off-by: Ingo Molnar commit c612ae0503af753c062594dcd14aecea121fa414 Author: Christian König Date: Wed Jun 20 20:48:59 2018 +0200 staging: android: ion: fix ion_dma_buf_attach signatur Fixup for "dma_buf: remove device parameter from attach callback v2". I missed this driver, sorry for the noise. Patch is not even compile tested. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/230641/ commit d20ac620f0010f9cdcbbe8408e5f22aae3c49faa Author: Chris Wilson Date: Thu Jun 21 09:01:50 2018 +0100 drm/i915: Redefine EINVAL for debugging To aide debugging spurious EINVALs, include a debug message every time we emit one from execbuf. References: https://bugs.freedesktop.org/show_bug.cgi?id=106744 Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180621080150.8110-1-chris@chris-wilson.co.uk commit 827db9d8bb4a01314f214065e3f18c8345c5fc9f Author: Chris Wilson Date: Thu Jun 21 08:32:05 2018 +0100 drm/i915: Ignore applying the self-relocation BIAS if no relocations We only need to apply the BIAS for self-relocations into the batchbuffer iff the execobject has any relocations. This suppresses some warnings we may get with a full gtt (so the batch object has wound up at 0 from a previous invocation), but doesn't fix the underlying problem of how we tried to move a pinned batch vma (how we have a pinned user vma outside of execbuf, I do not know, though this being on an aliasing ppgtt means it could be a spurious pinning via the global gtt). One step at a time... References: https://bugs.freedesktop.org/show_bug.cgi?id=106744#c1 Testcase: igt/gem_exec_gttfill # byt (sporadic) Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180621073205.26701-1-chris@chris-wilson.co.uk commit cbc654c88178b7dc3b63f57278cb917ffdb629cc Author: Robert Jarzmik Date: Sun Jun 17 19:02:11 2018 +0200 net: smc91x: remove the dmaengine compat need As the pxa architecture switched towards the dmaengine slave map, the old compatibility mechanism to acquire the dma requestor line number and priority are not needed anymore. This patch simplifies the dma resource acquisition, using the more generic function dma_request_slave_channel(). Signed-off-by: Robert Jarzmik Acked-by: David S. Miller commit 9d7bc29cc96bd6242ad451d3ee0b62387b14e0f0 Author: Robert Jarzmik Date: Sun Jun 17 19:02:10 2018 +0200 net: smc911x: remove the dmaengine compat need As the pxa architecture switched towards the dmaengine slave map, the old compatibility mechanism to acquire the dma requestor line number and priority are not needed anymore. This patch simplifies the dma resource acquisition, using the more generic function dma_request_slave_channel(). Signed-off-by: Robert Jarzmik Acked-by: David S. Miller commit 56563f53d3066afa9e63d6c997bf67e76a8b05c0 Author: Konrad Rzeszutek Wilk Date: Wed Jun 20 16:42:57 2018 -0400 x86/bugs: Move the l1tf function and define pr_fmt properly The pr_warn in l1tf_select_mitigation would have used the prior pr_fmt which was defined as "Spectre V2 : ". Move the function to be past SSBD and also define the pr_fmt. Fixes: 17dbca119312 ("x86/speculation/l1tf: Add sysfs reporting for l1tf") Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner commit 26eb4cd6c7c7793ee76c73b66621f63daff51953 Author: Chris Wilson Date: Wed Jun 20 14:59:29 2018 +0100 drm/i915: Disable bh around call to tasklet The guc submission backends expects to only be run from (at least) softirq context, but during our intel_engine_is_idle() check we would call into the tasklet to make sure it was flushed. As this could occur from process context, occasionally we would be caught out using a wait_for_atomic() not from an atomic context: [ 59.939091] WARN_ON_ONCE((1) && !(preempt_count() != 0)) [ 59.939142] WARNING: CPU: 1 PID: 2901 at drivers/gpu/drm/i915/intel_guc_submission.c:615 guc_submission_tasklet+0x784/0xa90 [i915] [ 59.939143] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic i915 x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul snd_hda_intel crc32_pclmul snd_hda_codec ghash_clmulni_intel snd_hwdep snd_hda_core e1000e snd_pcm mei_me mei prime_numbers [ 59.939164] CPU: 1 PID: 2901 Comm: gem_exec_schedu Tainted: G U W 4.18.0-rc1-g93475d62c730-drmtip_67+ #1 [ 59.939165] Hardware name: System manufacturer System Product Name/Z170M-PLUS, BIOS 3610 03/29/2018 [ 59.939188] RIP: 0010:guc_submission_tasklet+0x784/0xa90 [i915] [ 59.939189] Code: fc ff ff 80 3d 2f 87 11 00 00 0f 85 80 fb ff ff 48 c7 c6 f8 49 40 c0 48 c7 c7 80 41 3e c0 c6 05 14 87 11 00 01 e8 2c ea d6 d3 <0f> 0b e9 5f fb ff ff 8b 46 38 89 cf 31 c7 83 e7 c0 75 08 39 c1 0f [ 59.939253] RSP: 0018:ffffaafe08a03c10 EFLAGS: 00010286 [ 59.939255] RAX: 0000000000000000 RBX: ffff8f9112c246f0 RCX: 0000000000000001 [ 59.939256] RDX: 0000000080000001 RSI: ffffffff95086d8e RDI: 00000000ffffffff [ 59.939257] RBP: ffff8f9112c24680 R08: 000000009517be77 R09: 0000000000000000 [ 59.939258] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8f9112c24700 [ 59.939259] R13: ffff8f9112c24700 R14: 0000000000000000 R15: ffff8f9112c242a8 [ 59.939260] FS: 00007fc2cc7e5980(0000) GS:ffff8f9136c40000(0000) knlGS:0000000000000000 [ 59.939261] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 59.939262] CR2: 00007fc2cc815040 CR3: 000000021f10e003 CR4: 00000000003606e0 [ 59.939263] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 59.939264] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 59.939265] Call Trace: [ 59.939288] ? intel_engine_is_idle+0x64/0x160 [i915] [ 59.939323] ? intel_engine_dump+0x638/0x890 [i915] [ 59.939327] ? seq_printf+0x49/0x70 [ 59.939353] ? i915_engine_info+0xc8/0x100 [i915] [ 59.939356] ? drm_get_color_range_name+0x20/0x20 [ 59.939361] ? seq_read+0xf1/0x470 [ 59.939365] ? trace_hardirqs_on_caller+0xe0/0x1b0 [ 59.939370] ? full_proxy_read+0x51/0x80 [ 59.939389] ? __vfs_read+0x31/0x170 [ 59.939395] ? do_sys_open+0x13b/0x240 [ 59.939398] ? rcu_read_lock_sched_held+0x6f/0x80 [ 59.939401] ? vfs_read+0x9e/0x140 [ 59.939404] ? ksys_read+0x50/0xc0 [ 59.939409] ? do_syscall_64+0x55/0x190 [ 59.939412] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 59.939420] irq event stamp: 552834 [ 59.939422] hardirqs last enabled at (552833): [] console_unlock+0x3fc/0x600 [ 59.939425] hardirqs last disabled at (552834): [] error_entry+0x7c/0x100 [ 59.939451] softirqs last enabled at (552614): [] i915_request_add+0x2e3/0x7b0 [i915] [ 59.939470] softirqs last disabled at (552604): [] i915_request_add+0x25b/0x7b0 [i915] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106977 Fixes: dd0cf235d81f ("drm/i915: Speed up idle detection by kicking the tasklets") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Cc: Michal Wajdeczko Cc: Michał Winiarski Cc: Michel Thierry Reviewed-by: Michel Thierry Link: https://patchwork.freedesktop.org/patch/msgid/20180620135929.23956-1-chris@chris-wilson.co.uk commit e1cacec9d50d7299893eeab2d895189f3db625da Author: Rodrigo Vivi Date: Wed Jun 20 14:10:48 2018 -0700 drm/i915: Update DRIVER_DATE to 20180620 Signed-off-by: Rodrigo Vivi commit cd9e11a8bf259550577e2df7163d43a8a5655739 Author: Radhakrishna Sripada Date: Mon May 21 17:25:51 2018 -0700 drm/i915/icl: Add 10-bit support for hdmi Starting Icelake silicon supports 10-bpc hdmi to support certain media workloads. Currently hdmi supports 8 and 12 bpc. Plumbed in support for 10 bit hdmi. Cc: James Ausmus Cc: Jani Nikula Cc: Paulo Zanoni Cc: Manasi Navare Cc: Rodrigo Vivi Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Radhakrishna Sripada Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-18-paulo.r.zanoni@intel.com commit 35b69d626c3a4eaac15618f9419b8a29c8a1da22 Author: Robert Jarzmik Date: Sun Jun 3 22:17:02 2018 +0200 ARM: pxa: zylonite: use the new ac97 bus support Now the PXA is converted to new ac97 bus support, the wm9713 is automatically detected and probed. Remove it from the platform bus. Signed-off-by: Robert Jarzmik commit 22abc0d25db35e74753c7d3d8f30d2823a7fe2a1 Author: Robert Jarzmik Date: Sun Jun 3 22:15:39 2018 +0200 ARM: pxa: add the missing AC97 clocks The AC97 bit clock is added as the pxa internally generated 13MHz clock. This is a consequence of the new ac97 framework. Signed-off-by: Robert Jarzmik commit a4d7baf0a02a1bd5725df5f46c09ab374a3abd79 Author: Robert Jarzmik Date: Sun May 27 21:23:38 2018 +0200 ARM: pxa: mioa701 convert to the new AC97 bus This migration implies : - wm9713 device is removed, it will be auto-probed Signed-off-by: Robert Jarzmik commit f439b5c8a00d7b17d3f3618ea9b3b8977f33f8e7 Author: Robert Jarzmik Date: Sat May 26 11:38:34 2018 +0200 ARM: pxa: hx4700: fix the usb client The usb client of the hx4700 is not working because no platform data is declared. Fix it by adding the missing call. Signed-off-by: Robert Jarzmik commit c238ad62588981b3e83e1ba41bf5ec57b8875dd4 Author: Colin Ian King Date: Wed Jun 20 14:25:43 2018 +0100 drm/i915/psr: fix copy-paste error with setting of tp2_wakeup_time_us Currently for the psr_table->tp2_tp3_wakeup_time case 3 there appears to be a copy-paste error from the previous switch statement where dev_priv->vbt.psr.tp1_wakeup_time_us is being assigned and I believe it should be dev_priv->vbt.psr.tp2_tp3_wakeup_time_us that should be assigned instead. Detected by CoverityScan, CID#1470105 ("Copy-paste error") Fixes: 77312ae8f071 ("drm/i915/psr: vbt change for psr") Signed-off-by: Colin Ian King Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180620132543.28092-1-colin.king@canonical.com commit 98fa2aecb5096bbeb18f6509ffd181aafe4d267d Author: Dhinakaran Pandiyan Date: Mon Jun 18 15:02:07 2018 -0700 drm/i915/psr: Fix warning in intel_psr_activate() commit 5422b37c907e ("drm/i915/psr: Kill delays when activating psr back.") removed the call to cancel a scheduled psr_work from psr_disable() and instead added an early return in the work function. But, if the scheduled work item is executed after psr_enable(), we end up printing warnings as PSR is already enabled and active. So, put the cancel_work call back in psr_disable(). Cc: Rodrigo Vivi Cc: José Roberto de Souza Fixes: 5422b37c907e ("drm/i915/psr: Kill delays when activating psr back.") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106948 Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Rodrigo Vivi Signed-off-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180618220207.2778-1-dhinakaran.pandiyan@intel.com commit 377eeaa8e11fe815b1d07c81c4a0e2843a8c15eb Author: Andi Kleen Date: Wed Jun 13 15:48:28 2018 -0700 x86/speculation/l1tf: Limit swap file size to MAX_PA/2 For the L1TF workaround its necessary to limit the swap file size to below MAX_PA/2, so that the higher bits of the swap offset inverted never point to valid memory. Add a mechanism for the architecture to override the swap file size check in swapfile.c and add a x86 specific max swapfile check function that enforces that limit. The check is only enabled if the CPU is vulnerable to L1TF. In VMs with 42bit MAX_PA the typical limit is 2TB now, on a native system with 46bit PA it is 32TB. The limit is only per individual swap file, so it's always possible to exceed these limits with multiple swap files or partitions. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Reviewed-by: Josh Poimboeuf Acked-by: Michal Hocko Acked-by: Dave Hansen commit 42e4089c7890725fcd329999252dc489b72f2921 Author: Andi Kleen Date: Wed Jun 13 15:48:27 2018 -0700 x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings For L1TF PROT_NONE mappings are protected by inverting the PFN in the page table entry. This sets the high bits in the CPU's address space, thus making sure to point to not point an unmapped entry to valid cached memory. Some server system BIOSes put the MMIO mappings high up in the physical address space. If such an high mapping was mapped to unprivileged users they could attack low memory by setting such a mapping to PROT_NONE. This could happen through a special device driver which is not access protected. Normal /dev/mem is of course access protected. To avoid this forbid PROT_NONE mappings or mprotect for high MMIO mappings. Valid page mappings are allowed because the system is then unsafe anyways. It's not expected that users commonly use PROT_NONE on MMIO. But to minimize any impact this is only enforced if the mapping actually refers to a high MMIO address (defined as the MAX_PA-1 bit being set), and also skip the check for root. For mmaps this is straight forward and can be handled in vm_insert_pfn and in remap_pfn_range(). For mprotect it's a bit trickier. At the point where the actual PTEs are accessed a lot of state has been changed and it would be difficult to undo on an error. Since this is a uncommon case use a separate early page talk walk pass for MMIO PROT_NONE mappings that checks for this condition early. For non MMIO and non PROT_NONE there are no changes. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Reviewed-by: Josh Poimboeuf Acked-by: Dave Hansen commit 17dbca119312b4e8173d4e25ff64262119fcef38 Author: Andi Kleen Date: Wed Jun 13 15:48:26 2018 -0700 x86/speculation/l1tf: Add sysfs reporting for l1tf L1TF core kernel workarounds are cheap and normally always enabled, However they still should be reported in sysfs if the system is vulnerable or mitigated. Add the necessary CPU feature/bug bits. - Extend the existing checks for Meltdowns to determine if the system is vulnerable. All CPUs which are not vulnerable to Meltdown are also not vulnerable to L1TF - Check for 32bit non PAE and emit a warning as there is no practical way for mitigation due to the limited physical address bits - If the system has more than MAX_PA/2 physical memory the invert page workarounds don't protect the system against the L1TF attack anymore, because an inverted physical address will also point to valid memory. Print a warning in this case and report that the system is vulnerable. Add a function which returns the PFN limit for the L1TF mitigation, which will be used in follow up patches for sanity and range checks. [ tglx: Renamed the CPU feature bit to L1TF_PTEINV ] Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Reviewed-by: Josh Poimboeuf Acked-by: Dave Hansen commit 10a70416e1f067f6c4efda6ffd8ea96002ac4223 Author: Andi Kleen Date: Wed Jun 13 15:48:25 2018 -0700 x86/speculation/l1tf: Make sure the first page is always reserved The L1TF workaround doesn't make any attempt to mitigate speculate accesses to the first physical page for zeroed PTEs. Normally it only contains some data from the early real mode BIOS. It's not entirely clear that the first page is reserved in all configurations, so add an extra reservation call to make sure it is really reserved. In most configurations (e.g. with the standard reservations) it's likely a nop. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Reviewed-by: Josh Poimboeuf Acked-by: Dave Hansen commit 6b28baca9b1f0d4a42b865da7a05b1c81424bd5c Author: Andi Kleen Date: Wed Jun 13 15:48:24 2018 -0700 x86/speculation/l1tf: Protect PROT_NONE PTEs against speculation When PTEs are set to PROT_NONE the kernel just clears the Present bit and preserves the PFN, which creates attack surface for L1TF speculation speculation attacks. This is important inside guests, because L1TF speculation bypasses physical page remapping. While the host has its own migitations preventing leaking data from other VMs into the guest, this would still risk leaking the wrong page inside the current guest. This uses the same technique as Linus' swap entry patch: while an entry is is in PROTNONE state invert the complete PFN part part of it. This ensures that the the highest bit will point to non existing memory. The invert is done by pte/pmd_modify and pfn/pmd/pud_pte for PROTNONE and pte/pmd/pud_pfn undo it. This assume that no code path touches the PFN part of a PTE directly without using these primitives. This doesn't handle the case that MMIO is on the top of the CPU physical memory. If such an MMIO region was exposed by an unpriviledged driver for mmap it would be possible to attack some real memory. However this situation is all rather unlikely. For 32bit non PAE the inversion is not done because there are really not enough bits to protect anything. Q: Why does the guest need to be protected when the HyperVisor already has L1TF mitigations? A: Here's an example: Physical pages 1 2 get mapped into a guest as GPA 1 -> PA 2 GPA 2 -> PA 1 through EPT. The L1TF speculation ignores the EPT remapping. Now the guest kernel maps GPA 1 to process A and GPA 2 to process B, and they belong to different users and should be isolated. A sets the GPA 1 PA 2 PTE to PROT_NONE to bypass the EPT remapping and gets read access to the underlying physical page. Which in this case points to PA 2, so it can read process B's data, if it happened to be in L1, so isolation inside the guest is broken. There's nothing the hypervisor can do about this. This mitigation has to be done in the guest itself. [ tglx: Massaged changelog ] Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Reviewed-by: Josh Poimboeuf Acked-by: Michal Hocko Acked-by: Vlastimil Babka Acked-by: Dave Hansen commit 2f22b4cd45b67b3496f4aa4c7180a1271c6452f6 Author: Linus Torvalds Date: Wed Jun 13 15:48:23 2018 -0700 x86/speculation/l1tf: Protect swap entries against L1TF With L1 terminal fault the CPU speculates into unmapped PTEs, and resulting side effects allow to read the memory the PTE is pointing too, if its values are still in the L1 cache. For swapped out pages Linux uses unmapped PTEs and stores a swap entry into them. To protect against L1TF it must be ensured that the swap entry is not pointing to valid memory, which requires setting higher bits (between bit 36 and bit 45) that are inside the CPUs physical address space, but outside any real memory. To do this invert the offset to make sure the higher bits are always set, as long as the swap file is not too big. Note there is no workaround for 32bit !PAE, or on systems which have more than MAX_PA/2 worth of memory. The later case is very unlikely to happen on real systems. [AK: updated description and minor tweaks by. Split out from the original patch ] Signed-off-by: Linus Torvalds Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Tested-by: Andi Kleen Reviewed-by: Josh Poimboeuf Acked-by: Michal Hocko Acked-by: Vlastimil Babka Acked-by: Dave Hansen commit bcd11afa7adad8d720e7ba5ef58bdcd9775cf45f Author: Linus Torvalds Date: Wed Jun 13 15:48:22 2018 -0700 x86/speculation/l1tf: Change order of offset/type in swap entry If pages are swapped out, the swap entry is stored in the corresponding PTE, which has the Present bit cleared. CPUs vulnerable to L1TF speculate on PTE entries which have the present bit set and would treat the swap entry as phsyical address (PFN). To mitigate that the upper bits of the PTE must be set so the PTE points to non existent memory. The swap entry stores the type and the offset of a swapped out page in the PTE. type is stored in bit 9-13 and offset in bit 14-63. The hardware ignores the bits beyond the phsyical address space limit, so to make the mitigation effective its required to start 'offset' at the lowest possible bit so that even large swap offsets do not reach into the physical address space limit bits. Move offset to bit 9-58 and type to bit 59-63 which are the bits that hardware generally doesn't care about. That, in turn, means that if you on desktop chip with only 40 bits of physical addressing, now that the offset starts at bit 9, there needs to be 30 bits of offset actually *in use* until bit 39 ends up being set, which means when inverted it will again point into existing memory. So that's 4 terabyte of swap space (because the offset is counted in pages, so 30 bits of offset is 42 bits of actual coverage). With bigger physical addressing, that obviously grows further, until the limit of the offset is hit (at 50 bits of offset - 62 bits of actual swap file coverage). This is a preparatory change for the actual swap entry inversion to protect against L1TF. [ AK: Updated description and minor tweaks. Split into two parts ] [ tglx: Massaged changelog ] Signed-off-by: Linus Torvalds Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Tested-by: Andi Kleen Reviewed-by: Josh Poimboeuf Acked-by: Michal Hocko Acked-by: Vlastimil Babka Acked-by: Dave Hansen commit 50896e180c6aa3a9c61a26ced99e15d602666a4c Author: Andi Kleen Date: Wed Jun 13 15:48:21 2018 -0700 x86/speculation/l1tf: Increase 32bit PAE __PHYSICAL_PAGE_SHIFT L1 Terminal Fault (L1TF) is a speculation related vulnerability. The CPU speculates on PTE entries which do not have the PRESENT bit set, if the content of the resulting physical address is available in the L1D cache. The OS side mitigation makes sure that a !PRESENT PTE entry points to a physical address outside the actually existing and cachable memory space. This is achieved by inverting the upper bits of the PTE. Due to the address space limitations this only works for 64bit and 32bit PAE kernels, but not for 32bit non PAE. This mitigation applies to both host and guest kernels, but in case of a 64bit host (hypervisor) and a 32bit PAE guest, inverting the upper bits of the PAE address space (44bit) is not enough if the host has more than 43 bits of populated memory address space, because the speculation treats the PTE content as a physical host address bypassing EPT. The host (hypervisor) protects itself against the guest by flushing L1D as needed, but pages inside the guest are not protected against attacks from other processes inside the same guest. For the guest the inverted PTE mask has to match the host to provide the full protection for all pages the host could possibly map into the guest. The hosts populated address space is not known to the guest, so the mask must cover the possible maximal host address space, i.e. 52 bit. On 32bit PAE the maximum PTE mask is currently set to 44 bit because that is the limit imposed by 32bit unsigned long PFNs in the VMs. This limits the mask to be below what the host could possible use for physical pages. The L1TF PROT_NONE protection code uses the PTE masks to determine which bits to invert to make sure the higher bits are set for unmapped entries to prevent L1TF speculation attacks against EPT inside guests. In order to invert all bits that could be used by the host, increase __PHYSICAL_PAGE_SHIFT to 52 to match 64bit. The real limit for a 32bit PAE kernel is still 44 bits because all Linux PTEs are created from unsigned long PFNs, so they cannot be higher than 44 bits on a 32bit kernel. So these extra PFN bits should be never set. The only users of this macro are using it to look at PTEs, so it's safe. [ tglx: Massaged changelog ] Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Reviewed-by: Josh Poimboeuf Acked-by: Michal Hocko Acked-by: Dave Hansen commit f55786faa156370374c358d186eabf2f6e32e93f Author: Chris Wilson Date: Wed Jun 20 17:21:52 2018 +0100 drm/i915/selftests: Remove unused dmabuf->kmap routines, fix the build Fix i915's CI build after the removal of the dmabuf->kmap interface that left the mock routines intact. In file included from drivers/gpu/drm/i915/i915_gem_dmabuf.c:335:0: drivers/gpu/drm/i915/selftests/mock_dmabuf.c:104:13: error: ‘mock_dmabuf_kunmap_atomic’ defined but not used [-Werror=unused-function] static void mock_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, unsigned long page_num, void *addr) drivers/gpu/drm/i915/selftests/mock_dmabuf.c:97:14: error: ‘mock_dmabuf_kmap_atomic’ defined but not used [-Werror=unused-function] static void *mock_dmabuf_kmap_atomic(struct dma_buf *dma_buf, unsigned long page_num) Fixes: f664a5269542 ("dma-buf: remove kmap_atomic interface") Signed-off-by: Chris Wilson Cc: Christian König Cc: Daniel Vetter Cc: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/20180620162152.1158-1-chris@chris-wilson.co.uk Reviewed-by: Christian König commit c03cea42149de56fbae2301d7123daaa2cfe80e2 Author: Christoph Hellwig Date: Tue Jun 19 15:10:58 2018 -0700 iomap: add initial support for writes without buffer heads For now just limited to blocksize == PAGE_SIZE, where we can simply read in the full page in write begin, and just set the whole page dirty after copying data into it. This code is enabled by default and XFS will now be feed pages without buffer heads in ->writepage and ->writepages. If a file system sets the IOMAP_F_BUFFER_HEAD flag on the iomap the old path will still be used, this both helps the transition in XFS and prepares for the gfs2 migration to the iomap infrastructure. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d98c71dadc2d0debdb80beb5a478baf1e6f98758 Merge: d67b6a206507 daf0678c2036 Author: Gustavo Padovan Date: Wed Jun 20 13:22:22 2018 -0300 Merge drm-upstream/drm-next into drm-misc-next We got a few conflicts in drm_atomic.c after merging the DRM writeback support, now we need a backmerge to unlock develop development on drm-misc-next. Signed-off-by: Gustavo Padovan commit d67b6a2065076d763c7df626b8c54f16038ad862 Author: Liviu Dudau Date: Wed Feb 28 14:11:23 2018 +0000 drm: writeback: Add client capability for exposing writeback connectors Due to the fact that writeback connectors behave in a special way in DRM (they always report being disconnected) we might confuse some userspace. Add a client capability for writeback connectors that will filter them out for clients that don't understand the capability. Changelog: - only accept the capability if the client has already set the DRM_CLIENT_CAP_ATOMIC one. Cc: Sean Paul Cc: Brian Starkey Signed-off-by: Liviu Dudau Reviewed-by: Eric Anholt Reviewed-by: Brian Starkey Link: https://patchwork.freedesktop.org/patch/229038/ commit b13cc8dd588434e2aec781e6d12224e4c408ac18 Author: Brian Starkey Date: Wed Mar 29 17:42:33 2017 +0100 drm: writeback: Add out-fences for writeback connectors Add the WRITEBACK_OUT_FENCE_PTR property to writeback connectors, to enable userspace to get a fence which will signal once the writeback is complete. It is not allowed to request an out-fence without a framebuffer attached to the connector. A timeline is added to drm_writeback_connector for use by the writeback out-fences. In the case of a commit failure or DRM_MODE_ATOMIC_TEST_ONLY, the fence is set to -1. Changes from v2: - Rebase onto Gustavo Padovan's v9 explicit sync series - Change out_fence_ptr type to s32 __user * - Set *out_fence_ptr to -1 in drm_atomic_connector_set_property - Store fence in drm_writeback_job Gustavo Padovan: - Move out_fence_ptr out of connector_state - Signal fence from drm_writeback_signal_completion instead of in driver directly Changes from v3: - Rebase onto commit 7e9081c5aac7 ("drm/fence: fix memory overwrite when setting out_fence fd") (change out_fence_ptr to s32 __user *, for real this time.) - Update documentation around WRITEBACK_OUT_FENCE_PTR Signed-off-by: Brian Starkey [rebased and fixed conflicts] Signed-off-by: Mihail Atanassov Signed-off-by: Liviu Dudau Reviewed-by: Eric Anholt Reviewed-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/229036/ commit 935774cd71fe604cc8ed24adcb507d7784255672 Author: Brian Starkey Date: Wed Mar 29 17:42:32 2017 +0100 drm: Add writeback connector type Writeback connectors represent writeback engines which can write the CRTC output to a memory framebuffer. Add a writeback connector type and related support functions. Drivers should initialize a writeback connector with drm_writeback_connector_init() which takes care of setting up all the writeback-specific details on top of the normal functionality of drm_connector_init(). Writeback connectors have a WRITEBACK_FB_ID property, used to set the output framebuffer, and a WRITEBACK_PIXEL_FORMATS blob used to expose the supported writeback formats to userspace. When a framebuffer is attached to a writeback connector with the WRITEBACK_FB_ID property, it is used only once (for the commit in which it was included), and userspace can never read back the value of WRITEBACK_FB_ID. WRITEBACK_FB_ID can only be set if the connector is attached to a CRTC. Changes since v1: - Added drm_writeback.c + documentation - Added helper to initialize writeback connector in one go - Added core checks - Squashed into a single commit - Dropped the client cap - Writeback framebuffers are no longer persistent Changes since v2: Daniel Vetter: - Subclass drm_connector to drm_writeback_connector - Relax check to allow CRTC to be set without an FB - Add some writeback_ prefixes - Drop PIXEL_FORMATS_SIZE property, as it was unnecessary Gustavo Padovan: - Add drm_writeback_job to handle writeback signalling centrally Changes since v3: - Rebased - Rename PIXEL_FORMATS -> WRITEBACK_PIXEL_FORMATS Chances since v4: - Embed a drm_encoder inside the drm_writeback_connector to reduce the amount of boilerplate code required from the drivers that are using it. Changes since v5: - Added Rob Clark's atomic_commit() vfunc to connector helper funcs, so that writeback jobs are committed from atomic helpers - Updated create_writeback_properties() signature to return an error code rather than a boolean false for failure. - Free writeback job with the connector state rather than when doing the cleanup_work() Changes since v7: - fix extraneous use of out_fence that is only introduced in a subsequent patch. Changes since v8: - whitespace changes pull from subsequent patch Changes since v9: - Revert the v6 changes that free the writeback job in the connector state cleanup and return to doing it in the cleanup_work() function Signed-off-by: Brian Starkey [rebased and fixed conflicts] Signed-off-by: Mihail Atanassov [rebased and added atomic_commit() vfunc for writeback jobs] Signed-off-by: Rob Clark Signed-off-by: Liviu Dudau Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/229037/ commit f664a52695429b68afb4e130a0f69cd5fd1fec86 Author: Christian König Date: Mon May 28 13:34:01 2018 +0200 dma-buf: remove kmap_atomic interface Neither used nor correctly implemented anywhere. Just completely remove the interface. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Acked-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/226645/ commit a19741e5e5a9f1f02f8e3c037bde7d73d4bfae9c Author: Christian König Date: Mon May 28 11:47:52 2018 +0200 dma_buf: remove device parameter from attach callback v2 The device parameter is completely unused because it is available in the attachment structure as well. v2: fix kerneldoc as well Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/226643/ commit 3e7cc6252dc81100bd2803b3148a1e59b3dfae6a Author: Esben Haabendal Date: Wed Jun 20 09:34:42 2018 +0200 spi: spi-fsl-dspi: Enable extended SPI mode Set the XSPI bit for devices configured for XSPI mode (currently LS1021A), and thereby switch to extended SPI mode, allowing for SPI transfers using from 4 to 32 bits per word instead of 4 to 16 bits per word. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 35c9d461a436101a31d4ece7e5de5f4df6b59a5e Author: Esben Haabendal Date: Wed Jun 20 09:34:41 2018 +0200 spi: spi-fsl-dspi: Advertise 32 bit for XSPI mode Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 8fcd151d2619c46e3435e891379a22985538633c Author: Esben Haabendal Date: Wed Jun 20 09:34:40 2018 +0200 spi: spi-fsl-dspi: XSPI FIFO handling (in TCFQ mode) This implements handling of split CMD and TX FIFO queues for XSPI when running in TCFQ mode. It should be simple to add it to EOQ mode also. Currently, EOQ mode is only used with coldfire. So if coldfire DSPI supports XSPI, XSPI FIFO handling should be added to EOQ mode also. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 51d583ae7792cb11e952124cedc0e06e7b55d031 Author: Esben Haabendal Date: Wed Jun 20 09:34:39 2018 +0200 spi: spi-fsl-dspi: Framesize control for XSPI mode Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 58ba07ec79e62054dd2b2f1cea082a542aa01c44 Author: Esben Haabendal Date: Wed Jun 20 09:34:38 2018 +0200 spi: spi-fsl-dspi: Add support for XSPI mode registers This prepares for adding support for extended SPI mode (XSPI), by extending the regmap with the extra SREX and CTAREx registers. An additional register map is made for allowing 16 bit access to CMD and TX FIFO of the PUSHR register separately, which is also needed for XSPI mode support. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 071db7a6759d5d0a85ecf6a600ac1f9caa7f6404 Merge: d87e08f14213 8570043e2cc6 Author: Mark Brown Date: Wed Jun 20 14:47:07 2018 +0100 Merge branch 'spi-4.18' into spi-4.19 for DSPI dep commit 8570043e2cc659f375336fb8141917ca1b050234 Author: Esben Haabendal Date: Wed Jun 20 09:34:36 2018 +0200 spi: spi-fsl-dspi: Fixup regmap configuration Mark volatile registers to avoid caching bugs. Note: SPI_MCR is marked volatile because of CLR_TXF and CLR_RXF bits. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit d87e08f1421373f010308b1d065a1f0c3b251a52 Author: Esben Haabendal Date: Wed Jun 20 09:34:37 2018 +0200 spi: spi-fsl-dspi: Fix MCR register handling The MCR register is not changed, so initialize it in dspi_init(). The exception is the CLR_TXF and CLR_RXF bits, which should be written to before each transfer to make sure we start with empty FIFOs. With MCR register now configured as volatile, the regmap_update_bits will do a real read-modify-write cycle. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit dadcf4abd60ba6401b592c329a19719a6e1dd444 Author: Esben Haabendal Date: Wed Jun 20 09:34:35 2018 +0200 spi: spi-fsl-dspi: Support 4 to 16 bits per word transfers This extends the driver with support for all SPI framesizes from 4 to 16 bits, and adds support for per transfer specific bits_per_word, while at the same time reducing code size and complexity. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 0a4ec2c158634afa208ceda970b2c83764a1d99c Author: Esben Haabendal Date: Wed Jun 20 09:34:34 2018 +0200 spi: spi-fsl-dspi: Simplify transfer counter handling Simplify driver by avoiding counter wrapping by clearing transfer counter on first SPI transfer per interrupt instead of tracking what it was before. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 9e1dc9bd099363760afdd2316fc057f9ca38b559 Author: Esben Haabendal Date: Wed Jun 20 09:34:33 2018 +0200 spi: spi-fsl-dspi: Fix per transfer cs_change handling As of 92dc20d83adec565378254c0630e839ff5674e14, transfer->cs_change has been supported for non-last transfers, but not for last transfer. This change brings handling of cs_change in line with the specification in spi.h, implementing handling of transfer->cs_change for all transfers. The value for CMD FIFO is precalculated with transfer->cs_change field taken into account, allowing for CS de-activate between transfers and keeping CS activated after last transfer. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 4779f23d1ac8694f7acc537fcadb750bff664ea5 Author: Esben Haabendal Date: Wed Jun 20 09:34:32 2018 +0200 spi: spi-fsl-dspi: Drop unneeded use of dataflags bits Checking directly against pointer value should be at least as fast as doing bitmasking and compare, so let's keep it simple. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit c87bdcc89d867df13fbb92d05323337bfd15d579 Author: Esben Haabendal Date: Wed Jun 20 09:34:31 2018 +0200 spi: spi-fsl-dspi: Drop unreachable else if statement The if statement just above this if/else statement triggers on the same condition, and then invalidates it. Signed-off-by: Esben Haabendal Acked-by: Martin Hundebøll Signed-off-by: Mark Brown commit 2227a7a219fdd2b925b1e861f36255efd149ff6d Author: Daniel Vetter Date: Thu Apr 5 17:44:48 2018 +0200 drm/vc4: Always obey implicit sync Same justification as for drm_gem_fb_prepare_fb. Cc: Eric Anholt Reviewed-by: Eric Anholt Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180405154449.23038-9-daniel.vetter@ffwll.ch Link: https://patchwork.freedesktop.org/patch/msgid/20180409085134.27321-1-daniel.vetter@ffwll.ch commit 9d54fcd5416d84a3ab6a0b58846cff88ce62a4d4 Author: Daniel Vetter Date: Thu Apr 5 17:44:47 2018 +0200 drm/gem-fb-helper: Always do implicit sync I've done a lot of history digging. The first signs of this optimization was introduced in i915: commit 25067bfc060d1a481584dcb51ef4b5680176ecb6 Author: Gustavo Padovan Date: Wed Sep 10 12:03:17 2014 -0300 drm/i915: pin sprite fb only if it changed without much justification. Pinning already pinned stuff is real cheap (it's just obj->pin_count++ really), and the missing implicit sync was entirely forgotten about it seems. It's at least not mentioned anywhere it the commit message. It was also promptly removed shortly afterwards in commit ea2c67bb4affa84080c616920f3899f123786e56 Author: Matt Roper Date: Tue Dec 23 10:41:52 2014 -0800 drm/i915: Move to atomic plane helpers (v9) again without really mentioning the side-effect that plane updates with the same fb now again obey implicit syncing. Note that this only ever applied to the plane_update hook, all other legacy entry points (set_base, page_flip) always obeyed implicit sync in the drm/i915 driver. The real source of this code here seems to be msm, copied to vc4, then copied to tinydrm. I've also tried to dig around in all available msm sources, but the corresponding check for fb != old_fb is present ever since the initial merge in commit cf3a7e4ce08e6876cdcb80390876647f28a7cf8f Author: Rob Clark Date: Sat Nov 8 13:21:06 2014 -0500 drm/msm: atomic core bits The only older version I've found of msm atomic code predates the atomic helpers, and so didn't even use any of this. It also does not have a corresponding check (because it simply did no implicit sync at all). I've chatted with Rob on irc, and he didn't remember the reason for this either. Note we had epic amounts of fun with too much syncing against _vblank_, especially around cursor updates. But I don't ever discussing a need for less syncing against implicit fences. Also note that explicit fencing allows you to sidetrack all of this, at least for all the drivers correctly implemented using drm_atomic_set_fence_for_plane(). Given that it seems to be an accident of history, and that big drivers like i915 (and also nouveau it seems, I didn't follow the amdgpu/radeon sync code to figure this out properly there) never have done it, let's remove this. Cc: Rob Clark Cc: Matt Roper Cc: Gustavo Padovan Cc: Ville Syrjälä Cc: Maarten Lankhorst Cc: Sean Paul Cc: David Airlie Cc: "Noralf Trønnes" Reviewed-by: Eric Anholt Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180405154449.23038-8-daniel.vetter@ffwll.ch commit f648661bc7de497634c474a38608a715a0af4bbd Author: Chris Wilson Date: Wed Jun 20 12:24:41 2018 +0100 drm/i915/selftests: Avoid ERR_PTR dereference Along the early error path for igt_switch_to_kernel_context we may try to dereference an invalid error pointer. Instead, return early rather than dump the GEM trace since we haven't yet emitted anything of interest. Reported-by: Dan Carpenter Fixes: 09a4c02e58c1 ("drm/i915: Look for an active kernel context before switching") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180620112441.13085-1-chris@chris-wilson.co.uk commit 1b31de922e28de2bf2078b7a1e341ad4aee6aa03 Author: Charles Keepax Date: Wed Jun 20 11:56:20 2018 +0100 ASoC: arizona: Set compressed IRQ to a wake source The current code is not setting the compressed IRQ as a wake source. Normally this doesn't cause any issues as the CODEC IRQ is set as a wake source by the jack detection code and the CODEC only produces a single IRQ line. However if the system is not using jack detection the compressed audio IRQ should still function as a wake source, as such directly set the compressed audio IRQ as a wake source. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit 7f7cca08abf4c6c58ff1037cff5beec5a10a7da3 Author: Charles Keepax Date: Wed Jun 20 11:56:21 2018 +0100 ASoC: wm_adsp: Simplify handling of alg offset and length The current code that reads the algorithm list from the DSP is somewhat unclear, it converts directly from bytes to registers using a hard coded divide by 2. Most offsets are usually handled in DSP words within the driver and there is a function specifically for converting from words to register addresses. So update the handling to use these. This also removes the assumption that the registers are 16-bit word addressed, which will no longer be true on some of our newer parts. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit a41efe03e6110d7d85db272290aeed7e1ce9b63b Author: Alexandre Belloni Date: Mon Jun 18 10:52:02 2018 +0200 rtc: ds1685: remove sysfs access to control registers Access to the control registers is mostly not needed and can cause runtime issues (like missed interrupts). Remove this debugging interface. Signed-off-by: Alexandre Belloni commit 30a5271d4583ccaf22b4cb5b36caf254262dc113 Author: Alexandre Belloni Date: Mon Jun 18 10:52:01 2018 +0200 rtc: ds1685: remove improper datetime access ABI The driver exposes an undocumented ABI to access the date and time registers. It is not actually used by any userspace tools. Remove it. Signed-off-by: Alexandre Belloni commit 59ef2671a84732c96cb08a5060b7fcceaa44f4d9 Author: Alexandre Belloni Date: Thu Jun 7 10:41:07 2018 +0200 ARM: dts: fix PMC compatible Make each SoC dtsi use its soc specific PMc compatible string. This solves a potential issue on at91sam9261 and at91sam9263 when using suspend to RAM Acked-by: Nicolas Ferre Signed-off-by: Alexandre Belloni commit 91f87180e18fff629b5b3b8de9e5dfaa409a09c6 Author: Alexandre Belloni Date: Thu Jun 7 10:41:06 2018 +0200 ARM: at91: fix USB clock detection handling Add more compatibles to be able to correct the USB clock detection. at91sam9261 and at91sam9263 have the same PMC_SCSR layout as at91sam9260. at91sam9rl doesn't have any USB clock. Acked-by: Nicolas Ferre Signed-off-by: Alexandre Belloni commit 1e259703f9562d7301945d12a07af9787e13d4e5 Author: Alexandre Belloni Date: Thu Jun 7 10:41:05 2018 +0200 dt-bindings: clk: at91: Document all the PMC compatibles Add missing PMC compatibles to the list of available compatibles. Acked-by: Rob Herring Acked-by: Nicolas Ferre Signed-off-by: Alexandre Belloni commit 272ff92b697b5ed2d0fd61d66dce34edb6ddfa5a Author: Alexandre Belloni Date: Thu Jun 7 10:41:04 2018 +0200 dt-bindings: arm: remove PMC bindings The PMC bindings are fully described in Documentation/devicetree/bindings/clock/at91-clock.txt. Remove the duplicate and incomplete documentation. Acked-by: Rob Herring Acked-by: Nicolas Ferre Signed-off-by: Alexandre Belloni commit b3dae109fa89d67334bf3349babab3ad9b6f233f Author: Peter Zijlstra Date: Tue Jun 12 10:34:52 2018 +0200 sched/swait: Rename to exclusive Since swait basically implemented exclusive waits only, make sure the API reflects that. $ git grep -l -e "\" -e "\" | while read file; do sed -i -e 's/\/&_one/g' -e 's/\/&_exclusive/g' $file; done With a few manual touch-ups. Suggested-by: Linus Torvalds Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Acked-by: Linus Torvalds Cc: bigeasy@linutronix.de Cc: oleg@redhat.com Cc: paulmck@linux.vnet.ibm.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180612083909.261946548@infradead.org commit 0abf17bc7790dd0467ed0e38522242f23c5da1c4 Author: Peter Zijlstra Date: Tue Jun 12 10:34:51 2018 +0200 sched/swait: Switch to full exclusive mode Linus noted that swait basically implements exclusive mode -- because swake_up() only wakes a single waiter. And because of that it should take care to properly deal with the interruptible case. In short, the problem is that swake_up() can race with a signal. In this this case it is possible the swake_up() 'wakes' the waiter that is already on the way out because it just got a signal and the wakeup gets lost. The normal wait code is very careful and avoids this situation, make sure we do too. Copy the exact exclusive semantics from wait. Suggested-by: Linus Torvalds Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Acked-by: Linus Torvalds Cc: bigeasy@linutronix.de Cc: oleg@redhat.com Cc: paulmck@linux.vnet.ibm.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180612083909.209762413@infradead.org commit 6519750210d9d3330e85d12e0128652edde448d2 Author: Peter Zijlstra Date: Tue Jun 12 10:34:50 2018 +0200 sched/swait: Remove __prepare_to_swait There is no public user of this API, remove it. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Acked-by: Linus Torvalds Cc: bigeasy@linutronix.de Cc: oleg@redhat.com Cc: paulmck@linux.vnet.ibm.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180612083909.157076812@infradead.org commit 3249527f19d660c5adfb2b6f4ffd4ca0506b8755 Author: Sahil Malhotra Date: Fri Jun 8 12:38:13 2018 +0530 tee: optee: making OPTEE_SHM_NUM_PRIV_PAGES configurable via Kconfig This change adds KCONFIG option to set number of pages out of whole shared memory to be used for OP-TEE driver private data structures. Signed-off-by: Sahil Malhotra [jw: fixing trivial merge conflict] Signed-off-by: Jens Wiklander commit 4ae5e9d159f83392c98c4ed88dfc63f19745be38 Author: Don Brace Date: Mon Jun 18 13:23:06 2018 -0500 scsi: smartpqi: bump driver version to 1.1.4-130 Reviewed-by: Scott Benesh Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit dac12fbc7b0a433a160b89212a56e155c94f3a80 Author: Kevin Barnett Date: Mon Jun 18 13:23:00 2018 -0500 scsi: smartpqi: fix critical ARM issue reading PQI index registers Use the readl() kernel function to read all index registers. For ARM systems, this function includes a read memory barrier that eliminates ci/pi corruption. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Tested-by: Shunyong Yang Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 9f8d05fa98442de78d1ab30235b0cc656ed7aff0 Author: Kevin Barnett Date: Mon Jun 18 13:22:54 2018 -0500 scsi: smartpqi: add inspur advantech ids Add support for these new device IDs: Advantech MIC-8312BridgeB INSPUR PM8204-2GB INSPUR PM8204-4GB INSPUR PM8222-SHBA Reviewed-by: Scott Benesh Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 26b390aba2a8f7b9dd5ce4e3ada9431de327da6d Author: Kevin Barnett Date: Mon Jun 18 13:22:48 2018 -0500 scsi: smartpqi: improve error checking for sync requests Detect rare error cases for synchronous requests down the RAID path. Also retry INQUIRY of VPD page 0 sent to an HBA drive if the command failed due to an abort. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 957c5ab108c7d98369b7524daea532c0ebbcf845 Author: Kevin Barnett Date: Mon Jun 18 13:22:42 2018 -0500 scsi: smartpqi: improve handling for sync requests Decrement the active thread count after the synchronous request was submitted to the controller but before the driver blocks to wait for the request to complete. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 4beb4867f049aea801a93a8fc97801250e32d700 Author: Bart Van Assche Date: Fri Jun 15 14:42:01 2018 -0700 scsi: mpt3sas: Improve kernel-doc headers Avoids that warnings about the kernel headers appear when building with W=1. Remove useless "@Returns - Nothing" clauses. Change "@Return - " into "Return: ". Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Cc: Randy Dunlap Signed-off-by: Martin K. Petersen commit c7a357058882637548dd0908b743c674a23ce0e2 Author: Bart Van Assche Date: Fri Jun 15 14:42:00 2018 -0700 scsi: mpt3sas: Split _base_reset_handler(), mpt3sas_scsih_reset_handler() and mpt3sas_ctl_reset_handler() Split each of these functions in three functions - one function per reset phase. This patch does not change any functionality but makes the code easier to read. Note: it is much easier to review the git diff -w output after having applied this patch than by reviewing the patch itself. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Signed-off-by: Martin K. Petersen commit 982ea6f9ff2b2f92c03eda06df420b2f3699b7ad Author: Bart Van Assche Date: Fri Jun 15 14:41:59 2018 -0700 scsi: mpt3sas: Fix a race condition in mpt3sas_base_hard_reset_handler() Since ioc->shost_recovery is set after ioc->reset_in_progress_mutex is obtained, if concurrent resets are issued there is a short time during which ioc->reset_in_progress_mutex is locked and ioc->shost_recovery == 0. Avoid that this can cause trouble by unconditionally locking ioc->shost_recovery. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Signed-off-by: Martin K. Petersen commit 91b7bdb2c0089cbbb817df6888ab1458c645184e Author: Bart Van Assche Date: Fri Jun 15 14:41:58 2018 -0700 scsi: mpt3sas: Fix _transport_smp_handler() error path This patch avoids that smatch complains about a double unlock on ioc->transport_cmds.mutex. Fixes: 651a01364994 ("scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough") Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 84203b3561726be0e4c4fbb2db90c9d7e6f59314 Author: Bart Van Assche Date: Fri Jun 15 14:41:57 2018 -0700 scsi: mpt3sas: Introduce struct mpt3sas_nvme_cmd Make _base_build_nvme_prp() easier to read by introducing a structure to access NVMe command fields. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Signed-off-by: Martin K. Petersen commit eb0c7af26beb1cf13b30fc51ea05dd1977df2061 Author: Bart Van Assche Date: Fri Jun 15 14:41:56 2018 -0700 scsi: mpt3sas: Annotate switch/case fall-through This patch avoids that gcc complains about switch/case fall-through when building with W=1. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Signed-off-by: Martin K. Petersen commit 7d1207288fdff3f645f3f7a5c8cf658b3e389c5d Author: Bart Van Assche Date: Fri Jun 15 14:41:55 2018 -0700 scsi: mpt3sas: Remove set-but-not-used variables This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Signed-off-by: Martin K. Petersen commit 199fd79a11f29f222da41421846b37a68e66ce0d Author: Bart Van Assche Date: Fri Jun 15 14:41:54 2018 -0700 scsi: mpt3sas: Fix indentation Modify the indentation such that smatch no longer complains about inconsistent indenting. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Signed-off-by: Martin K. Petersen commit 2fa4a32613c9182b00e46872755b0662374424a7 Author: Jason Yan Date: Thu May 10 11:05:16 2018 +0800 scsi: libsas: dynamically allocate and free ata host Commit 2623c7a5f2 ("libata: add refcounting to ata_host") v4.17+ introduced refcounting to ata_host and will increase or decrease the refcount when adding or deleting transport ATA port. Now the ata host for libsas is embedded in domain_device, and the ->kref member is not initialized. Afer we add ata transport class, ata_host_get() will be called when adding transport ATA port and a warning will be triggered as below: refcount_t: increment on 0; use-after-free. WARNING: CPU: 2 PID: 103 at lib/refcount.c:153 refcount_inc+0x40/0x48 ...... Call trace: refcount_inc+0x40/0x48 ata_host_get+0x10/0x18 ata_tport_add+0x40/0x120 ata_sas_tport_add+0xc/0x14 sas_ata_init+0x7c/0xc8 sas_discover_domain+0x380/0x53c process_one_work+0x12c/0x288 worker_thread+0x58/0x3f0 kthread+0xfc/0x128 ret_from_fork+0x10/0x18 And also when removing transport ATA port ata_host_put() will be called and another similar warning will be triggered. If the refcount decreased to zero, the ata host will be freed. But this ata host is only part of domain_device, it cannot be freed directly. So we have to change this embedded static ata host to a dynamically allocated ata host and initialize the ->kref member. To use ata_host_get() and ata_host_put() in libsas, we need to move the declaration of these functions to the public libata.h and export them. Fixes: b6240a4df018 ("scsi: libsas: add transport class for ATA devices") Signed-off-by: Jason Yan CC: John Garry CC: Taras Kondratiuk CC: Tejun Heo Acked-by: Tejun Heo Signed-off-by: Martin K. Petersen commit 693ba15c9202fe0283404abe4066e1b986e284eb Author: Matthew Wilcox Date: Tue Jun 12 12:05:45 2018 -0700 scsi: Remove percpu_ida With its one user gone, remove the library code. Signed-off-by: Matthew Wilcox Reviewed-by: Jens Axboe Signed-off-by: Martin K. Petersen commit 10e9cbb6b531117be0c4a79f2c7fa9a45a0dd532 Author: Matthew Wilcox Date: Tue Jun 12 12:05:44 2018 -0700 scsi: target: Convert target drivers to use sbitmap The sbitmap and the percpu_ida perform essentially the same task, allocating tags for commands. The sbitmap outperforms the percpu_ida as documented here: https://lkml.org/lkml/2014/4/22/553 The sbitmap interface is a little harder to use, but being able to remove the percpu_ida code and getting better performance justifies the additional complexity. Signed-off-by: Matthew Wilcox Acked-by: Felipe Balbi # f_tcm Reviewed-by: Jens Axboe Signed-off-by: Martin K. Petersen commit 83c2b54b9295a5fc0d9c8f1751aaf8099d1760f6 Author: Matthew Wilcox Date: Tue Jun 12 12:05:43 2018 -0700 scsi: target: Abstract tag freeing Introduce target_free_tag() and convert all drivers to use it. Signed-off-by: Matthew Wilcox Reviewed-by: Jens Axboe Signed-off-by: Martin K. Petersen commit ba80917d9932da022d2e74eae66e44139dd65136 Author: Tomas Winkler Date: Thu Jun 14 11:14:09 2018 +0300 scsi: ufs: ufshcd_dump_regs to use memcpy_fromio ufshcd_dump_regs should use memcpy_fromio to read host registers instead of directly accessing using memcpy. The same function is utilized in ufs-qcom. Elminite compilation warning drivers/scsi/ufs/ufshcd.c:356:9: warning: incorrect type in argument 6 (different address spaces) drivers/scsi/ufs/ufshcd.c:356:9: expected void const *buf drivers/scsi/ufs/ufshcd.c:356:9: got void [noderef] *mmio_base Signed-off-by: Tomas Winkler Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit 5b9d397447f8c03843198b573d7cecf8893523fb Author: Jeff Moyer Date: Mon Jun 18 09:57:12 2018 -0400 scsi: sg: clean up gfp_mask in sg_build_indirect commit a45b599ad808c ("scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()") changed the call to alloc_pages to always use __GFP_ZERO. Just above that, though, there was this: if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) gfp_mask |= __GFP_ZERO; And there's only one user of the gfp_mask. Just or in the __GFP_ZERO flag at the top of the function and be done with it. Signed-off-by: Jeff Moyer Acked-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit b3a8aa90c46095cbad454eb068bfb5a8eb56d4e3 Author: Sebastian Andrzej Siewior Date: Mon Jun 11 16:40:53 2018 +0200 scsi: qla2xxx: remove irq save in qla2x00_poll() In commit d2ba5675d899 ("[SCSI] qla2xxx: Disable local-interrupts while polling for RISC status.") added a local_irq_disable() before invoking the ->intr_handler callback. The function, which was used in this callback, did not disable interrupts while acquiring the spin_lock so a deadlock was possible and this change was one possible solution. The function in question was qla2300_intr_handler() and is using spin_lock_irqsave() since commit 43fac4d97a1a ("[SCSI] qla2xxx: Resolve a performance issue in interrupt"). I checked all other ->intr_handler callbacks and all of them use the irqsave variant so it is safe to remove the local_irq_save() block now. Cc: qla2xxx-upstream@qlogic.com Signed-off-by: Sebastian Andrzej Siewior Acked-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 91ebc1facd7797d799a4c9208cb7fdc8d86e0bb4 Author: Johannes Thumshirn Date: Wed Jun 13 09:53:47 2018 +0200 scsi: core: remove Scsi_Cmnd typedef This will make subsequent refactoring easier to handle. Note: this patch is nowhere checkpatch clean. Signed-off-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit aa154ea885eb0c2407457ce9c1538d78c95456fa Author: Zhouyang Jia Date: Tue Jun 12 11:13:00 2018 +0800 scsi: bnx2i: add error handling for ioremap_nocache When ioremap_nocache fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling ioremap_nocache. Signed-off-by: Zhouyang Jia Reviewed-by: Johannes Thumshirn Acked-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit 2da11d4262639dc0e2fabc6a70886db57af25c43 Author: Sebastian Andrzej Siewior Date: Thu Jun 14 18:18:09 2018 +0200 scsi: libsas: remove irq save in sas_ata_qc_issue() Since commit 312d3e56119a ("[SCSI] libsas: remove ata_port.lock management duties from lldds") the sas_ata_qc_issue() function unlocks the ata_port.lock and disables interrupts before doing so. That lock is always taken with disabled interrupts so at this point, the interrupts are already disabled. There is no need to disable the interrupts before the unlock operation because they are already disabled. Restoring the interrupt state later does not change anything because they were disabled and remain disabled. Therefore remove the operations which do not change the behaviour. Fixes: 312d3e56119a ("[SCSI] libsas: remove ata_port.lock management duties from lldds") Signed-off-by: Sebastian Andrzej Siewior Acked-by: Dan Williams Reviewed-by: John Garry Signed-off-by: Martin K. Petersen commit 15c5a5e0761f9ace2e58097c405ab362b2e02c83 Author: Wen Xiong Date: Wed Jun 6 10:01:36 2018 -0500 scsi: ipr: Format HCAM overlay ID 0x41 This patch adds formatting error overlay 0x41 to improve debug capabilities. Signed-off-by: Wen Xiong Acked-by: Brian King Signed-off-by: Martin K. Petersen commit 7931cd918f35e1e7c9183f004f4b90b43f22adfd Author: John Garry Date: Thu May 31 20:50:50 2018 +0800 scsi: hisi_sas: Update a couple of register settings for v3 hw Update CFG_1US_TIMER_TRSH and CON_CFG_DRIVER settings. Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit ce70c2e6af8e9bb823b5e2183f3b777e9a5e7259 Author: John Garry Date: Thu May 31 20:50:49 2018 +0800 scsi: hisi_sas: Add missing PHY spinlock init The init is missed for hisi_sas_phy spinlock, so add it. Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 2ba5afb6834b876c1547fa7d714ddca8a8039b36 Author: Xiang Chen Date: Thu May 31 20:50:48 2018 +0800 scsi: hisi_sas: Pre-allocate slot DMA buffers Currently the driver spends much time allocating and freeing the slot DMA buffer for command delivery/completion. To boost the performance, pre-allocate the buffers for all IPTT. The downside of this approach is that we are reallocating all buffer memory upfront, so hog memory which we may not need. However, the current method - DMA buffer pool - also caches all buffers and does not free them until the pool is destroyed, so is not exactly efficient either. On top of this, since the slot DMA buffer is slightly bigger than a 4K page, we need to allocate 2x4K pages per buffer (for 4K page kernel), which is quite wasteful. For 64K page size this is not such an issue. So, for the 4K page case, in order to make memory usage more efficient, pre-allocating larger blocks of DMA memory for the buffers can be more efficient. To make DMA memory usage most efficient, we would choose a single contiguous DMA memory block, but this could use up all the DMA memory in the system (when CMA enabled and no IOMMU), or we may just not be able to allocate a DMA buffer large enough when no CMA or IOMMU. To decide the block size we use the LCM (least common multiple) of the buffer size and the page size. We roundup(64) to ensure the LCM is not too large, even though a little memory may be wasted per block. So, with this, the total memory requirement is about is about 17MB for 4096 max IPTT. Previously (for 4K pages case), it would be 32MB (for all slots allocated). With this change, the relative increase of IOPS for bs=4K read when PAGE_SIZE=4K and PAGE_SIZE=64K is as follows: IODEPTH 4K PAGE_SIZE 64K PAGE_SIZE 32 56% 47% 64 53% 44% 128 64% 43% 256 67% 45% Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit f2ae8d04327f14ff93a263af265bc91c689c208e Author: Xiaofei Tan Date: Thu May 31 20:50:47 2018 +0800 scsi: hisi_sas: Release all remaining resources in clear nexus ha In host reset, we use TMF or soft-reset to re-init device, and if success, we will release all LLDD resources of this device. If the init fails - maybe because the device was removed or link has not come up - then do not release the LLDD resources, but rather rely on SCSI EH to handle the timeout for these resources later on. But if clear nexus ha calls host reset, which is the last effort of SCSI EH, we should release all LLDD remain resources. Because SCSI EH will release all tasks after clear nexus ha. Before release, we do I_T nexus reset to try to clear target remain IOs. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit ed99e1d94936bb33fc32d1f0151ae42c051e0d42 Author: Xiaofei Tan Date: Thu May 31 20:50:46 2018 +0800 scsi: hisi_sas: Add a flag to filter PHY events during reset During reset, we don't want PHY events reported to libsas for PHYs which were previously attached prior to reset. So check hisi_hba->flags for HISI_SAS_RESET_BIT to filter PHY events during reset. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 214e702d4b70b6ca7c8a57ff89e1990a76d12f82 Author: Xiaofei Tan Date: Thu May 31 20:50:45 2018 +0800 scsi: hisi_sas: Adjust task reject period during host reset After soft_reset() for host reset, we should not be allowed to send commands to the HW before the PHYs have come up and the port ids have been refreshed. Prior to this point, any commands cannot be successfully completed. This exclusion is achieved by grabbing the host reset semaphore. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit d2fc401e47529d9ffd2673a5395d56002e31ad98 Author: Xiaofei Tan Date: Thu May 31 20:50:44 2018 +0800 scsi: hisi_sas: Fix the conflict between dev gone and host reset There is a possible conflict when a device is removed and host reset occurs concurrently. The reason is that then the device is notified as gone, we try to clear the ITCT, which is notified via an interrupt. The dev gone function pends on this event with a completion, which is completed when the ITCT interrupt occurs. But host reset will disable all interrupts, the wait_for_completion() may wait indefinitely. This patch adds an semaphore to synchronise this two processes. The semaphore is taken by the host reset as the basis of synchronising. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 1324ae1ce55927622b531cc3123387c0fe05244d Author: Xiaofei Tan Date: Thu May 31 20:50:43 2018 +0800 scsi: hisi_sas: Only process broadcast change in phy_bcast_v3_hw() There are many BROADCAST primitives generated by the host. We are only interested in BROADCAST (CHANGE) primitives currently, so only process this. We have applied this processing for v2 hw before, and it is also needed for v3 hw. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 4e63ac82b9f020f348ab6c9f062d2fbd2dcd0b7e Author: Xiang Chen Date: Thu May 31 20:50:42 2018 +0800 scsi: hisi_sas: Use dmam_alloc_coherent() This patch replaces the usage of dma_alloc_coherent() with the managed version, dmam_alloc_coherent(), hereby reducing replicated code. Signed-off-by: Xiang Chen Signed-off-by; John Garry Signed-off-by: Martin K. Petersen commit 9458321750cbfdaf9fd3cb95194f37c52e0cb356 Author: Ketan Mukadam Date: Thu Jun 7 13:54:43 2018 +0530 scsi: be2iscsi: Update copyright Update Broadcom copyright markings in all modified files. Signed-off-by: Ketan Mukadam Reviewed-by: Jitendra Bhivare Signed-off-by: Martin K. Petersen commit a81dde7e0216d2520f04027d0dfbb94d9713e8b4 Author: Jitendra Bhivare Date: Thu Jun 7 13:54:41 2018 +0530 scsi: be2iscsi: Include null char in SET_HOST_DATA FW needs NULL terminated driver version string. Signed-off-by: Ketan Mukadam Reviewed-by: Jitendra Bhivare Signed-off-by: Jitendra Bhivare Signed-off-by: Martin K. Petersen commit f193f7985f48a40885ce2e270c4cea9697650cc1 Author: Vadim Pasternak Date: Sun Jun 17 16:56:55 2018 +0000 Documentation/ABI: Add documentation mlxreg-io sysfs interfaces Add documentation for mlxreg-io platform driver sysfs interfaces to allow user space access for system resets control, reset causes monitoring, programmable devices version reading and device selection control. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 8871f5e4234112f02b8afe1000c18f49827c8d01 Author: Vadim Pasternak Date: Sun Jun 17 16:56:54 2018 +0000 platform/x86: mlx-platform: Add mlxreg-io platform driver activation Add mlxreg-io platform driver activation. Access driver uses the same regmap infrastructure as others Mellanox platform drivers. Specific registers description for default platform data configuration are added to mlx-platform. There are the registers for resets control, reset causes monitoring, programmable devices version reading and mux select control. This platform data is passed to mlxreg-io driver. Also some default values for the register are set at initialization time through the regmap infrastructure, which are necessary for moving write protection from the general purpose registers, which are used by mlxreg-io for write access. Signed-off-by: Vadim Pasternak v4-v5: Changes added by Vadim: - Add two new attributes for ASIC health and main power domain shutdown. Signed-off-by: Darren Hart (VMware) commit 5ec4a8ace06cc0dc1af190dfa53d175029714d66 Author: Vadim Pasternak Date: Sun Jun 17 16:56:53 2018 +0000 platform/mellanox: Introduce support for Mellanox register access driver Introduce new Mellanox platform driver to allow access to Mellanox programmable device register space trough sysfs interface. The driver purpose is to provide sysfs interface for user space for the registers essential for system control and monitoring. The sets of registers for sysfs access are supposed to be defined per system type bases and include the registers related to system resets operation, system reset causes monitoring and some kinds of mux selection. Signed-off-by: Vadim Pasternak [dvhart: Kconfig typo fixes spotted by Randy Dunlap] Signed-off-by: Darren Hart (VMware) commit 4486baca66e7a96a6ded3957cb522872a49870ce Author: Heiko Stuebner Date: Sat Jun 16 16:11:32 2018 +0200 arm64: dts: rockchip: generalize rk3399 #sound-dai-cells The soc spdif and i2s controllers always only have one compontent, so always require #sound-dai-cells to be 0. Therefore there is no need to duplicate this property in individual boards. So move them to rk3399.dtsi. Signed-off-by: Heiko Stuebner commit cc9b0918037454d2cd9f6f07d95095fe30b02091 Author: Viresh Kumar Date: Fri May 25 11:10:05 2018 +0530 arm64: dts: rockchip: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Do minor rearrangement as well to keep ordering consistent. Signed-off-by: Viresh Kumar Signed-off-by: Heiko Stuebner commit ea41d63b544062489b3f2af2aab4eefee45aef31 Author: Vicente Bergas Date: Sun Jun 3 00:07:18 2018 +0200 arm64: dts: rockchip: enable hdmi sound on rk3399-sapphire Simply enable the hdmi-sound simple-audio-card on the sapphire board. Signed-off-by: Vicente Bergas Signed-off-by: Heiko Stuebner commit 0d60d48ca3fb378ca1dee8f7323de638dd000ac0 Author: Vicente Bergas Date: Sun Jun 3 00:07:17 2018 +0200 arm64: dts: rockchip: connect hdmi sound in rk3399 Everything is in place and working, it only needed to be wired up. Signed-off-by: Vicente Bergas Signed-off-by: Heiko Stuebner commit e184fde6f3f5353040dd4b5637f823fc87436e55 Author: Andreas Gruenbacher Date: Tue Jun 19 15:10:57 2018 -0700 iomap: add private pointer to struct iomap Add a private pointer to struct iomap to allow filesystems to pass data from iomap_begin to iomap_end. Will be used by gfs2 for passing on the on-disk inode buffer head. Signed-off-by: Andreas Gruenbacher Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 72b4daa241295440f98e80ae21294a67b27ca091 Author: Christoph Hellwig Date: Tue Jun 19 15:10:57 2018 -0700 iomap: add an iomap-based readpage and readpages implementation Simply use iomap_apply to iterate over the file and a submit a bio for each non-uptodate but mapped region and zero everything else. Note that as-is this can not be used for file systems with a blocksize smaller than the page size, but that support will be added later. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 63899c6f8851c32214b19390254fa1ae90b582df Author: Christoph Hellwig Date: Tue Jun 19 15:10:56 2018 -0700 iomap: add a page_done callback This will be used by gfs2 to attach data to transactions for the journaled data mode. But the concept is generic enough that we might be able to use it for other purposes like encryption/integrity post-processing in the future. Based on a patch from Andreas Gruenbacher. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 19e0c58f6552638c86395f0717210326fdf14fd2 Author: Andreas Gruenbacher Date: Tue Jun 19 15:10:56 2018 -0700 iomap: generic inline data handling Add generic inline data handling by adding a pointer to the inline data region to struct iomap. When handling a buffered IOMAP_INLINE write, iomap_write_begin will copy the current inline data from the inline data region into the page cache, and iomap_write_end will copy the changes in the page cache back to the inline data region. This doesn't cover inline data reads and direct I/O yet because so far, we have no users. Signed-off-by: Andreas Gruenbacher [hch: small cleanups to better fit in with other iomap work] Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ebf00be37de35788cad72f4f20b4a39e30c0be4a Author: Andreas Gruenbacher Date: Tue Jun 19 15:10:55 2018 -0700 iomap: complete partial direct I/O writes synchronously According to xfstest generic/240, applications seem to expect direct I/O writes to either complete as a whole or to fail; short direct I/O writes are apparently not appreciated. This means that when only part of an asynchronous direct I/O write succeeds, we can either fail the entire write, or we can wait for the partial write to complete and retry the remaining write as buffered I/O. The old __blockdev_direct_IO helper has code for waiting for partial writes to complete; the new iomap_dio_rw iomap helper does not. The above mentioned fallback mode is needed for gfs2, which doesn't allow block allocations under direct I/O to avoid taking cluster-wide exclusive locks. As a consequence, an asynchronous direct I/O write to a file range that contains a hole will result in a short write. In that case, wait for the short write to complete to allow gfs2 to recover. Signed-off-by: Andreas Gruenbacher Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3d7b6b21f6c590c4d70b311bbdd78a214637c9c7 Author: Andreas Gruenbacher Date: Tue Jun 19 15:10:55 2018 -0700 iomap: mark newly allocated buffer heads as new In iomap_to_bh, not only mark buffer heads in IOMAP_UNWRITTEN maps as new, but also buffer heads in IOMAP_MAPPED maps with the IOMAP_F_NEW flag set. This will be used by filesystems like gfs2, which allocate blocks in iomap->begin. Minor corrections to the comment for IOMAP_UNWRITTEN maps. Signed-off-by: Andreas Gruenbacher Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit a6d639da63aeb838d5c0b7dc50598f2eac4014a0 Author: Christoph Hellwig Date: Tue Jun 19 15:10:55 2018 -0700 fs: factor out a __generic_write_end helper Bits of the buffer.c based write_end implementations that don't know about buffer_heads and can be reused by other implementations. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 93c9a7f8793175fdad5c472af5af07f994116a04 Author: Jan Kiszka Date: Tue Jun 19 16:52:42 2018 -0500 PCI: Clean up resource allocation in devm_of_pci_get_host_bridge_resources() Instead of first allocating and then freeing memory for struct resource in case we cannot parse a PCI resource from the device tree, work against a local struct and kmemdup() it when we decide to go with it. Suggested-by: Andy Shevchenko Signed-off-by: Jan Kiszka Signed-off-by: Bjorn Helgaas Reviewed-by: Vladimir Zapolskiy commit ac2bf28ad1a1708d7af84ff22b1ec60a89e69afb Merge: 1c3eced3d4ad 57c8a484a9cb Author: Rodrigo Vivi Date: Tue Jun 19 14:44:35 2018 -0700 Merge tag 'gvt-next-2018-06-19' of https://github.com/intel/gvt-linux into drm-intel-next-queued gvt-next-2018-06-19 - fine-grained per vgpu locking (Colin) - fine-grained vgpu scheduler locking (Colin) - deliver windows guest cursor hotspot info (Tina) - GVT-g BXT support (Colin) - other misc and checker fixes (Chris, Xinyun) Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180619090043.ly6gquafbmxuus6h@zhen-hp.sh.intel.com commit 1e1d5b69397c0c9908fbf375930326fc529e73b1 Author: Boris Brezillon Date: Wed Jun 13 10:29:36 2018 +0200 MAINTAINERS: Remove the AT91 clk driver entry I've stopped actively maintaining this driver for quite some time already, and at91 maintainers are doing a good job at maintaining it. Remove the AT91 clk driver entry so that the driver automatically falls under the "ARM/Microchip (AT91) SoC support" entry. Signed-off-by: Boris Brezillon Acked-by: Stephen Boyd Signed-off-by: Alexandre Belloni commit d30c8d2031259d6dc360f8c96d362bb36665c99c Author: Arnd Bergmann Date: Tue Jun 19 10:18:56 2018 +0200 leds: ledtrig-activity: use ktime_get_boot_ns() get_monotonic_boottime() is deprecated, so let's convert this to the simpler ktime_get_boot_ns(). Signed-off-by: Arnd Bergmann Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski commit cfdeb8934b6f85f235071e9d3700756a0a12758d Author: Leon Romanovsky Date: Tue Jun 19 10:39:06 2018 +0300 RDMA/mlx5: Refactor transport domain checks Put all relevant checks for transport domain in the mlx5_ib_alloc/dealloc_transport_domain functions. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit bd646104ac5a6bf8bdddaeaf4e441f5d439ded96 Author: Arnd Bergmann Date: Tue Jun 19 17:51:02 2018 +0200 jfs: use time64_t for otime The file creation time in the inode uses time_t which is defined differently on 32-bit and 64-bit architectures and deprecated. The representation in the inode uses an unsigned 32-bit number, but this gets wrapped around after year 2038 when assigned to a time_t. This changes the type to time64_t, so we can support the full range of timestamps between 1970 and 2106 on 32-bit systems like we do on 64-bit systems already, and matching what we do for the atime/ctime/mtime stamps since the introduction of 64-bit timestamps in VFS. Note: the otime stamp is not actually used anywhere at the moment in the kernel, it is just set when writing a file, so none of this really makes a difference unless we implement setting the btime field in the getattr() callback. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Kleikamp commit 6c5e1ac0e144a8560cfa11bed8cdadab9491952f Author: Takashi Sakamoto Date: Mon Jun 18 21:07:55 2018 +0900 ALSA: firewire-motu: add support for Motu Traveler This commit adds support for MOTU Traveler, launched in 2005, discontinued quite before. As a result, transmission of PCM frame and MIDI messages is available via ALSA PCM and RawMIDI/Sequencer interfaces. This model supports sampling transmission frequency up to 192.0 kHz, and AES/EBU on XLR interface and ADAT on optical interface. Unlike Motu 828MkII, Windows driver can switch fetching mode for DSP, like mute/unmute feature. Although this commit enables high sampling transmission frequency, actual sound from this model is not good. As long as I tested, it's silence at 176.4 kHz, and it includes hissing noise at 192.0 kHz. In my opinion, as I reported at 3526ce7f9ba7 ('ALSA: firewire-motu: add MOTU specific protocol layer'), timestamping on source packet header (SPH) may not still be good for this model as well. $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 04106505 bus_info_length 4, crc_length 16, crc 25861 404 31333934 bus_name "1394" 408 20001000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 1 (4) 40c 0001f200 company_id 0001f2 | 410 0001f32f device_id 000001f32f | EUI-64 0001f2000001f32f root directory ----------------------------------------------------------------- 414 0004c65c directory_length 4, crc 50780 418 030001f2 vendor 41c 0c0083c0 node capabilities per IEEE 1394 420 8d000006 --> eui-64 leaf at 438 424 d1000001 --> unit directory at 428 unit directory at 428 ----------------------------------------------------------------- 428 00035955 directory_length 3, crc 22869 42c 120001f2 specifier id 430 13000009 version 434 17107800 model eui-64 leaf at 438 ----------------------------------------------------------------- 438 000206b2 leaf_length 2, crc 1714 43c 0001f200 company_id 0001f2 | 440 0001f32f device_id 000001f32f | EUI-64 0001f2000001f32f Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 191ef57683aab1939d9b7afdc43f9213c21c5e1e Author: Takashi Sakamoto Date: Mon Jun 18 21:07:54 2018 +0900 ALSA: firewire-motu: cancel chunk alignment for protocol version 2 For MOTU protocol version 2, this driver arranges the number of data chunks to align chunks to quadlet data channel. However, MOTU Traveler has padding bytes in the end of data block at high clock mode. This commit removes the arrangement. Fortunately, at low and middle clock mode, supported model for v2 protocol (828mkII) gets no influence from this change because all of combination for data chunks are just aligned to quadlet data channel. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 06ac0b6f8f74e98d32f9dea5209bd26f3e7b50ba Author: Takashi Sakamoto Date: Mon Jun 18 21:07:53 2018 +0900 ALSA: firewire-motu: add a flag for AES/EBU on XLR interface MOTU Traveler supports AES/EBU on XLR interface and data block of rx/tx packet includes two chunk for the interface. This commit adds a flag for this purpose. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 81720c6d49b7932d642e7dca736bef9a40c9b5f7 Author: Takashi Sakamoto Date: Mon Jun 18 21:07:52 2018 +0900 ALSA: firewire-motu: add a flag for chunks for main 1/2 out This driver explicitly assumes that all of supported models have main data chunk separated from chunk for analog ports. However, MOTU Traveler doesn't support the separated main data chunk. This commit adds a flag for the separated main data chunk. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 6c1549c4cc3c1b0d8623cde00e28f094b2db0d41 Author: Takashi Sakamoto Date: Mon Jun 18 21:07:51 2018 +0900 ALSA: firewire-motu: suppless consumption for unused element of array in stack In MOTU firewire protocol, data block consists of 24 bit data chunks except for one quadlet for source packet header (SPH). The number of data chunk in a data block is different between three clock modes; low, middle and high. When unit supports ADAT on optical interface, the data block includes some chunks for ADAT channels. These ADAT chunks are unavailable at high mode. This driver has local functions to calculate the number of ADAT chunks. But They uses stack for three clock modes. This is useless for higher mode. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit a21daa88d4f08c959a36ad9760df045407a080e5 Author: Stefan Agner Date: Tue Jun 19 11:16:56 2018 +0200 drm/amdgpu: Use correct enum to set powergating state Use enum amd_powergating_state instead of enum amd_clockgating_state. The underlying value stays the same, so there is no functional change in practise. This fixes a warning seen with clang: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1930:14: warning: implicit conversion from enumeration type 'enum amd_clockgating_state' to different enumeration type 'enum amd_powergating_state' [-Wenum-conversion] AMD_CG_STATE_UNGATE); ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Stefan Agner Signed-off-by: Alex Deucher commit 761f58e0e91334983cce60637adfbf7492aa97b3 Author: Junwei Zhang Date: Tue Jun 19 11:22:18 2018 +0800 drm/amdgpu: correct GART location info Avoid confusing the GART with the GTT domain. Signed-off-by: Junwei Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8e2c7ad99dce3f4242fa0d0d5950ca3ba0f212c3 Author: Chunming Zhou Date: Fri Jun 15 14:39:57 2018 +0800 drm/amdgpu: update ib_start/size_alignment same as windows used PAGE_SIZE for start_alignment is far much than hw requirement, And now, update to expereince value from window side. Signed-off-by: Chunming Zhou Acked-by: Marek Olšák Acked-by: Christian König Acked-by: Junwei Zhang Signed-off-by: Alex Deucher commit eeb2c3c2a614f003cd42cc3d96d23f5c29ff6727 Author: Arnd Bergmann Date: Mon Jun 18 17:35:10 2018 +0200 amdgpu: display: use modern ktime accessors getrawmonotonic64() is deprecated because of the nonstandard naming. The replacement functions ktime_get_raw_ns() also simplifies the callers. Signed-off-by: Arnd Bergmann Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 4daa4fba3a3899a3eefff26e38cf680661a931e4 Author: Souptick Joarder Date: Sat Jun 2 00:57:24 2018 +0530 gpu: drm: ttm: Adding new return type vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_{mixed,pfn} returns err which driver mapped into VM_FAULT_* type. The new function vmf_insert_{mixed,pfn} will replace this inefficiency by returning VM_FAULT_* type. Signed-off-by: Souptick Joarder Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2bfb0b678e48dee76543bfa2079b7e42609332fb Author: Souptick Joarder Date: Mon Apr 16 19:13:51 2018 +0530 gpu: drm: radeon: Adding new typedef vm_fault_t Use new return type vm_fault_t for fault handler in vm_operations_struct. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2e2ba09e48b72497a9b69fc49ab693f7f0c2e5cf Author: Mike Marciniszyn Date: Mon Jun 4 11:44:02 2018 -0700 IB/rdmavt, IB/hfi1: Create device dependent s_flags Move some s_flags defines out of rdmavt and into hfi1 because they are hfi1 specific and therefore should remain in the driver instead of bubbling up to rdmavt. Document device specific ranges in rdmavt and remap those in hfi1. Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 32e3d97079ad0d9adb36af2d2d09a806100690e9 Author: Mike Marciniszyn Date: Mon Jun 4 11:43:46 2018 -0700 IB/hfi1: Remove rcvhdrsize The field is based on a constant that can never change. Use the define to assign the register instead. Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 40442b30aad0b5a476aef8f9ea91c11d0f9eae2a Author: Mike Marciniszyn Date: Mon Jun 4 11:43:37 2018 -0700 IB/hfi1: Move rhf_offset from devdata to ctxtdata This field should be in ctxtdata to allow for better locality of access by eliminating a dd dereference. The new field is now side-by-side with rcvhdrqentsize since the rhf_offset is a function of the rcvhdrqentsize. Both fields are now correctly sized as u8. Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit b0ba3c18d6bf7e454e83e5f49bbc1fd0eb42be71 Author: Mike Marciniszyn Date: Mon Jun 4 11:43:29 2018 -0700 IB/hfi1: Move normal functions from hfi1_devdata to const array The current implementation precludes having receive context specific packet type receive handlers. Fix this by adding adding c99 const array for the existing handlers and remove the current 72 bytes of pointers from devdata. A new pointer in hfi1_ctxtdata will point to the const array. Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 67b0b4e4988f296ecc69fc8d09a2ce2741653ee0 Author: peter enderborg Date: Tue Jun 12 10:09:12 2018 +0200 selinux: Cleanup printk logging in netnode Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit 07c81ac2adccbdfe8cc48fe4ad347cd37520c504 Author: peter enderborg Date: Tue Jun 12 10:09:11 2018 +0200 selinux: Cleanup printk logging in avc Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit 0d3a115429e98997b6d12cbd0670059501f4ce71 Author: peter enderborg Date: Tue Jun 12 10:09:10 2018 +0200 selinux: Cleanup printk logging in netif Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit d006469d3fac547743612170756ed1571edcf97e Author: peter enderborg Date: Tue Jun 12 10:09:09 2018 +0200 selinux: Cleanup printk logging in netport Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit b21a695d9cba3a144cc833961457bdc6c987226e Author: peter enderborg Date: Tue Jun 12 10:09:08 2018 +0200 selinux: Cleanup printk logging in sidtab Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit d85a78334e7b67292834cd222962e010142905ca Author: peter enderborg Date: Tue Jun 12 10:09:07 2018 +0200 selinux: Cleanup printk logging in netlink Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit f8b69a5f00ee0a8e71555fdbd77f79db9c0769f0 Author: peter enderborg Date: Tue Jun 12 10:09:06 2018 +0200 selinux: Cleanup printk logging in selinuxfs Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit b54c85c15a7bf1a34b14f23eb186e4a737ac3447 Author: peter enderborg Date: Tue Jun 12 10:09:05 2018 +0200 selinux: Cleanup printk logging in services Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit 9fba738a53dda20e748d6ee240b6c017c8146b4b Author: Jerome Brunet Date: Tue Jun 19 16:41:41 2018 +0200 clk: add duty cycle support Add the possibility to apply and query the clock signal duty cycle ratio. This is useful when the duty cycle of the clock signal depends on some other parameters controlled by the clock framework. For example, the duty cycle of a divider may depends on the raw divider setting (ratio = N / div) , which is controlled by the CCF. In such case, going through the pwm framework to control the duty cycle ratio of this clock would be a burden. A clock provider is not required to implement the operation to set and get the duty cycle. If it does not implement .get_duty_cycle(), the ratio is assumed to be 50%. This change also adds a new flag, CLK_DUTY_CYCLE_PARENT. This flag should be used to indicate that a clock, such as gates and muxes, may inherit the duty cycle ratio of its parent clock. If a clock does not provide a get_duty_cycle() callback and has CLK_DUTY_CYCLE_PARENT, then the call will be directly forwarded to its parent clock, if any. For set_duty_cycle(), the clock should also have CLK_SET_RATE_PARENT for the call to be forwarded Signed-off-by: Jerome Brunet Signed-off-by: Michael Turquette Link: lkml.kernel.org/r/20180619144141.8506-1-jbrunet@baylibre.com commit 9461f7b33d11cbbf5ce79c3c03d0da9d42dfce92 Author: Jerome Brunet Date: Tue Jun 19 15:40:51 2018 +0200 clk: fix CLK_SET_RATE_GATE with clock rate protection CLK_SET_RATE_GATE should prevent any operation which may result in a rate change or glitch while the clock is prepared/enabled. IOW, the following sequence is not allowed anymore with CLK_SET_RATE_GATE: * clk_get() * clk_prepare_enable() * clk_get_rate() * clk_set_rate() At the moment this is enforced on the leaf clock of the operation, not along the tree. This problematic because, if a PLL has the CLK_RATE_GATE, it won't be enforced if the clk_set_rate() is called on its child clocks. Using clock rate protection, we can now enforce CLK_SET_RATE_GATE along the clock tree Acked-by: Linus Walleij Tested-by: Quentin Schulz Tested-by: Maxime Ripard Signed-off-by: Jerome Brunet Signed-off-by: Michael Turquette Link: lkml.kernel.org/r/20180619134051.16726-3-jbrunet@baylibre.com commit 04cdd5af51c610ddc7ff4881790a830a6a97d3fd Author: Jerome Brunet Date: Tue Jun 19 15:40:50 2018 +0200 clk: qcom: drop CLK_SET_RATE_GATE from sdc clocks the mmci driver (drivers/mmc/host/mmci.c) does the following sequence: * clk_prepare_enable() * clk_set_rate() on SDCx_clk which is a children of SDCx_src. SDCx_src has CLK_SET_RATE_GATE so this sequence should not be allowed but this was not enforced. IOW, the flag is ignored. Dropping the flag won't change anything to the current behaviour of the platform. CLK_SET_RATE_GATE is being fixed and enforced now. If the flag was kept, the mmci driver would receive -EBUSY when calling clk_set_rate() Signed-off-by: Jerome Brunet Signed-off-by: Michael Turquette Link: lkml.kernel.org/r/20180619134051.16726-2-jbrunet@baylibre.com commit c87a7e75a3e2180a15df1c76343ee1a2d477b224 Author: peter enderborg Date: Tue Jun 12 10:09:04 2018 +0200 selinux: Cleanup printk logging in avtab Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit c103a91e8916540c774805af11ed4bc3ba75f874 Author: peter enderborg Date: Tue Jun 12 10:09:03 2018 +0200 selinux: Cleanup printk logging in hooks Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit c59450c463695a016e823175bac421cff219935d Author: Yishai Hadas Date: Sun Jun 17 13:00:06 2018 +0300 IB/mlx5: Expose DEVX tree Expose DEVX tree to be used by upper layers. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f6fe01b7181be1751a5d8f19f230eb0d17b9a7b1 Author: Yishai Hadas Date: Sun Jun 17 13:00:05 2018 +0300 IB/mlx5: Add DEVX query EQN support Return the matching device EQN for a given user vector number via the DEVX interface. Note: EQs are owned by the kernel and shared by all user processes. Basically, a user CQ can point to any EQ. The kernel doesn't enforce any such limitation today either. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit aeae94579caf77406a8a235ea33fdb67abe9a57e Author: Yishai Hadas Date: Sun Jun 17 13:00:04 2018 +0300 IB/mlx5: Add DEVX support for memory registration Add support to register a memory with the firmware via the DEVX interface. The driver translates a given user address to ib_umem then it will register the physical addresses with the firmware and get a unique id for this registration to be used for this virtual address. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7c043e908a74ae0a935037cdd984d0cb89b2b970 Author: Yishai Hadas Date: Sun Jun 17 13:00:03 2018 +0300 IB/mlx5: Add support for DEVX query UAR Return a device UAR index for a given user index via the DEVX interface. Security note: The hardware protection mechanism works like this: Each device object that is subject to UAR doorbells (QP/SQ/CQ) gets a UAR ID (called uar_page in the device specification manual) upon its creation. Then upon doorbell, hardware fetches the object context for which the doorbell was rang, and validates that the UAR through which the DB was rang matches the UAR ID of the object. If no match the doorbell is silently ignored by the hardware. Of course, the user cannot ring a doorbell on a UAR that was not mapped to it. Now in devx, as the devx kernel does not manipulate the QP/SQ/CQ command mailboxes (except tagging them with UID), we expose to the user its UAR ID, so it can embed it in these objects in the expected specification format. So the only thing the user can do is hurt itself by creating a QP/SQ/CQ with a UAR ID other than his, and then in this case other users may ring a doorbell on its objects. The consequence of that will be that another user can schedule a QP/SQ of the buggy user for execution (just insert it to the hardware schedule queue or arm its CQ for event generation), no further harm is expected. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e662e14d801b01a976e58bc3f8d9fe49b9fcec3a Author: Yishai Hadas Date: Sun Jun 17 13:00:02 2018 +0300 IB/mlx5: Add DEVX support for modify and query commands Add support in DEVX for modify and query commands, the required lock is taken (i.e. READ/WRITE) by the KABI infrastructure accordingly. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7efce3691d33e1f4263a7c64e8ff39b12922509b Author: Yishai Hadas Date: Sun Jun 17 13:00:01 2018 +0300 IB/mlx5: Add obj create and destroy functionality Add support to create and destroy firmware objects via the DEVX interface. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8aa8c95ce4ccc10a72f6755ee889d9fb1ceb60a6 Author: Yishai Hadas Date: Sun Jun 17 13:00:00 2018 +0300 IB/mlx5: Add support for DEVX general command Add support to run general firmware command via the DEVX interface. A command that works on some object (e.g. CQ, WQ, etc.) will be added in next patches while maintaining the required object lock. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a8b92ca1b0e5ce620e425e9d2f89ce44f1a82a82 Author: Yishai Hadas Date: Sun Jun 17 12:59:57 2018 +0300 IB/mlx5: Introduce DEVX Introduce DEVX to enable direct device commands in downstream patches from this series. In that mode of work the firmware manages the isolation between processes' resources and as such a DEVX user id is created and assigned to the given user context upon allocation request. A capability check is done to make sure that this feature is really supported by the firmware prior to creating the DEVX user id. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7dc08dcfc8c86cb4457e383734ff6844ddaff876 Author: Yishai Hadas Date: Sun Jun 17 12:59:59 2018 +0300 IB/core: Expose ib_ucontext from a given ib_uverbs_file Drivers that use the IOCTL API may have the ib_uverbs_file and need a way to get the related ib_ucontext from it, this is enabled by this patch. Downstream patches from this series will use it. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e502a864c3526aa93b983d4b14e9615b3da430e6 Author: Yishai Hadas Date: Sun Jun 17 12:59:58 2018 +0300 IB/core: Introduce DECLARE_UVERBS_GLOBAL_METHODS Introduce a new macro to be used for global methods on a singleton object. This macros sets internally the type_attrs to be NULL as such an object can't be created. Downstream patches from this series will use this macro. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 19b9def25852caf710b978cd27955090650f115b Author: Matan Barak Date: Sun Jun 17 12:59:54 2018 +0300 IB/uverbs: Allow an empty namespace in ioctl() framework The ioctl parser framework wrongly assumed that each namespace is populated. This could lead to NULL dereferences. Fix the parser to always check that a given namespace indeed exists. Fixes: fac9658cabb9 ("IB/core: Add new ioctl interface") Signed-off-by: Matan Barak Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2d9c1bd7e177bd8b460403db9513b0a223e46ab8 Author: Matan Barak Date: Sun Jun 17 12:59:53 2018 +0300 IB/uverbs: Add a macro to define a type with no kernel known size Sometimes the uverbs uAPI doesn't really care about the structure it gets from user-space. All it wants to do is to allocate enough space and send it to the hardware/provider driver. Adding a UVERBS_ATTR_MIN_SIZE that could be used for this scenarios. We use USHRT_MAX as the kernel known size to bypass any zero validations. Signed-off-by: Matan Barak Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8762d149e88dea5bc09e0d7faa84b635807167ab Author: Matan Barak Date: Sun Jun 17 12:59:52 2018 +0300 IB/uverbs: Add PTR_IN attributes that are allocated/copied automatically Adding UVERBS_ATTR_SPEC_F_ALLOC_AND_COPY flag to PTR_IN attributes. By using this flag, the parse automatically allocates and copies the user-space data. This data is accessible by using uverbs_attr_get_len and uverbs_attr_get_alloced_ptr inline accessor functions from the handler. Signed-off-by: Matan Barak Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9442d8bf1d63e09780dc3b60ac6cdfa0813a98c2 Author: Matan Barak Date: Sun Jun 17 12:59:51 2018 +0300 IB/uverbs: Refactor uverbs_finalize_objects uverbs_finalize_objects is currently used only to commit or abort objects. Since we want to add automatic allocation/free of PTR_IN attributes, moving it to uverbs_ioctl.c and renamit it to uverbs_finalize_attrs. Signed-off-by: Matan Barak Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1114b0a8a83dfc82464fd1d8a34313044381cf5e Author: Matan Barak Date: Sun Jun 17 12:59:50 2018 +0300 IB/uverbs: Export uverbs idr and fd types As provider drivers could use UVERBS_ATTR_FD and UVERBS_ATTR_IDR macros need to export them. Signed-off-by: Matan Barak Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 620758a210d91618f19bed3001aa80c31d7644bb Merge: 3cba33d31188 38b7ca927d6a Author: Jason Gunthorpe Date: Tue Jun 19 10:49:42 2018 -0600 Merge branch 'mellanox/mlx5-next' into RDMA for-next From git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git * branch 'mellanox/mlx5-next': net/mlx5: Expose DEVX specification net/mlx5: Prevent warns in dmesg upon firmware commands commit 9ffdd49e3d735a5d12b5b31151893049e7075332 Author: peter enderborg Date: Tue Jun 12 10:09:02 2018 +0200 selinux: Cleanup printk logging in policydb Replace printk with pr_* to avoid checkpatch warnings and replace KERN_CONT with 2 longer prints. Signed-off-by: Peter Enderborg [PM: fixed some missing newlines identified by Joe Perches] Signed-off-by: Paul Moore commit 38b7ca927d6a12bf4466be22a90b7d998f5ae69a Author: Yishai Hadas Date: Thu Mar 8 14:36:27 2018 +0200 net/mlx5: Expose DEVX specification This patch updates the mlx5_ifc structures and command interface to support DEVX. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky commit fc6c391a7acf410b21c161764a48e5a6cc01c474 Author: Yishai Hadas Date: Sun May 13 13:21:40 2018 +0300 net/mlx5: Prevent warns in dmesg upon firmware commands When DEVX is used application builds by itself the command mail box, this patch prevents warns upon firmware commands as of invalid user space usage. In addition, A failure in destroy_mkey command was changed to be printed only under debug mode. This prevents a redundant warn when a memory window was used with rereg_mr and finally was some kernel cleanup as of reset flow/process termination. In that case this command might temporarily fails as part of the cleanup but finally it expects to succeed. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky commit 180cfc58cd9a8bf836dccde0c9e8af0d3073e4bd Author: peter enderborg Date: Tue Jun 12 10:09:01 2018 +0200 selinux: Cleanup printk logging in ebitmap Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit ab48576c4298f7d8cd93e78f085841a05967e125 Author: peter enderborg Date: Tue Jun 12 10:09:00 2018 +0200 selinux: Cleanup printk logging in conditional Replace printk with pr_* to avoid checkpatch warnings. Signed-off-by: Peter Enderborg Signed-off-by: Paul Moore commit 244e293690a6e07cbdfa11af1977488d91931eed Author: Charles Keepax Date: Tue Jun 19 16:22:09 2018 +0100 ASoC: pcm: Tidy up open/hw_params handling Currently, the core will continue processing open/hw_params component callbacks after one has failed even though it will abort immediately afterwards. This is unnecessary and also has the issue that close/hw_free will be called on the component which failed open/hw_params which could result in issues if the driver doesn't expect this behaviour. Update the core to abort processing open/hw_params when an error is hit and only call close/hw_free for those components that were successfully opened. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit a9191579ba1086d91842199263e6fe6bb5eec1ba Author: Charles Keepax Date: Tue Jun 19 16:10:00 2018 +0100 regulator: arizona-ldo1: Use correct device to get enable GPIO Currently the enable GPIO is being looked up on the regulator device itself but that does not have its own DT node, this causes the lookup to fail and the regulator not to get its GPIO. The DT node is shared across the whole MFD and as such the lookup needs to happen on that parent device. Moving the lookup to the parent device also means devres can no longer be used as the life time would attach to the wrong device. Additionally, the enable GPIO is active high so we should be passing GPIOD_OUT_LOW to ensure the regulator starts in its off state allowing the driver to enable it when it is ready. Fixes: e1739e86f0cb ("regulator: arizona-ldo1: Look up a descriptor and pass to the core") Reported-by: Matthias Reichl Signed-off-by: Charles Keepax Signed-off-by: Mark Brown commit 1f1f5183981d70bf0950f8467772851a05eb9148 Author: Icenowy Zheng Date: Wed Apr 11 22:16:41 2018 +0800 arm64: dts: allwinner: a64: add SRAM controller device tree node Allwinner A64 has a SRAM controller, and in the device tree currently we have a syscon node to enable EMAC driver to access the EMAC clock register. As SRAM controller driver can now export regmap for this register, replace the syscon node to the SRAM controller device node, and let EMAC driver to acquire its EMAC clock regmap. Signed-off-by: Icenowy Zheng [wens@csie.org: Updated compatible string] Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit ede18ae31202256824b47cfbebc8c0dc219354ef Author: Chen-Yu Tsai Date: Tue May 22 01:02:41 2018 +0800 soc: sunxi: sram: Add updated compatible string for A64 system control The SRAM mapping controls on Allwinner SoCs is located in a block called "System Controls". This block also has registers for identifying the SoC, reading the state of an external boot-related pin, and on some newer SoCs, glue layer controls for the EMAC Ethernet controller. The A64 variant compatible is renamed to "allwinner,a64-system-control" to reflect this. The old A64 compatible is deprecated. So far we haven't seen any actual use of it. Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit f412c8d7a2f43fe2d83d077e143b02f2656b1640 Author: Chen-Yu Tsai Date: Thu May 17 13:59:03 2018 +0800 dt-bindings: sram: Rename A64 SRAM controller compatible The SRAM mapping controls on Allwinner SoCs is located in a block called "System Controls". This block also has registers for identifying the SoC, reading the state of an external boot-related pin, and on some newer SoCs, glue layer controls for the EMAC Ethernet controller. The A64 variant compatible is renamed to "allwinner,a64-system-control" to reflect this. The old A64 compatible is deprecated. So far we haven't seen any actual use of it. Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit 5828729bebbb69d0743488e742bed8a9727b0b71 Author: Icenowy Zheng Date: Wed Apr 11 22:16:40 2018 +0800 soc: sunxi: export a regmap for EMAC clock reg on A64 The A64 SRAM controller memory zone has a EMAC clock register, which is needed by the Ethernet MAC driver (dwmac-sun8i). Export a regmap for this register on A64. Signed-off-by: Icenowy Zheng [wens@csie.org: export whole address range with only EMAC register accessible and drop regmap name] Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit f0d9034b290d8bad590e843c2a1081eb47d813ad Author: Pierre-Louis Bossart Date: Mon Jun 18 13:29:42 2018 -0500 ASoC: Intel: common: fix copy/paste issue with SOF/broadwell topology file There are two commercially-available Broadwell platforms based on I2S (Dell XPS13 and 'Samus' Pixel 2015 Chromebook). Fix a copy/paste issue to allow each platform to enable different features if needed when SOF is enabled Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit b45350135b9241b64cc91ccc8dddca2ee4dc25d7 Author: Pierre-Louis Bossart Date: Mon Jun 18 13:29:41 2018 -0500 ASoC: Intel: common: add entries for SOF-based machine drivers While we are at it, add entries for machine drivers that are used on SOF-based platforms. The drivers will be submitted upstream after the core SOF patches, but there's no harm in adding these references now. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit e6d298fd4a4454dd121343323e3f00a27f8819a4 Author: Pierre-Louis Bossart Date: Mon Jun 18 13:29:39 2018 -0500 ASoC: Intel: common: add firmware/topology information for SOF No functionality change for Skylake driver, add relevant names needed by SOF for BXT/APL, GLK and CNL. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 65a33883c778befcb85ef45285763fd8ac1b2ba3 Author: Naveen Manohar Date: Mon Jun 18 13:29:38 2018 -0500 ASoC: Intel: common: Add Geminilake Dialog+Maxim machine driver entry This patch adds da7219_max98357a machine driver entry into machine table Signed-off-by: Naveen Manohar Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit cbaa7f0bdbee1969bb311c641abbd0d2af6ba861 Author: Pierre-Louis Bossart Date: Mon Jun 18 13:29:37 2018 -0500 ASoC: Intel: move SKL+ codec ACPI tables to common directory No functionality change, just move to common tables to make it easier to deal with SOF and share the same machine drivers - as done previously for BYT/CHT/HSW/BDW. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 5f15f267daf81a4c7c2a1cd2a0d6743ec7fc8b59 Author: Pierre-Louis Bossart Date: Mon Jun 18 13:29:36 2018 -0500 ASoC: Intel: Skylake: cleanup before moving ACPI tables There is no need to deal with DMICs if the DSP is not present and there is no ACPI machine ID found. Simplify before moving these ACPI tables to sound/soc/intel/common Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 95555f580dca21fac5ea35c10fa92fa034bd403f Author: Naveen Manohar Date: Mon Jun 18 13:29:35 2018 -0500 ASoC: Intel: broxton: reduce machine name for bxt_da7219_max98357a Use truncated names in bxt id table and bxt_da7219_max98357a machine as platform device id table expects names to be less then 20chars. Signed-off-by: Naveen Manohar Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 5fd46e649ee63259f2197625662477ac67a69e79 Author: Mac Chiang Date: Tue Jun 19 14:16:06 2018 +0800 ASoC: Intel: kbl_da7219_max98357a: add fe_ops for kbl Audio Capture Port platform support fixed constraint hw_prams as Stereo, 48KHz, 16 bits. This fixed the headset mic recorded noise due to mono capturing request from some apps. e.g. online Voice Recorder Signed-off-by: Louis Collard Signed-off-by: Mac Chiang Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit f7859590d97614815b35a755c8213dfb8f2766bd Author: Richard Guy Briggs Date: Tue Jun 5 19:20:39 2018 -0400 audit: eliminate audit_enabled magic number comparison Remove comparison of audit_enabled to magic numbers outside of audit. Related: https://github.com/linux-audit/audit-kernel/issues/86 Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 1c3eced3d4ad7fd0a62c782205c36b96c0091813 Author: Jani Nikula Date: Tue Jun 19 15:44:37 2018 +0300 drm/i915/audio: constify ELD pointers The hooks aren't supposed to modify the ELD, so use const pointer. As a drive-by fix, use drm_eld_size() to log ELD size. Suggested-by: Ville Syrjala Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180619124437.10982-1-jani.nikula@intel.com commit d904ac0320d3c4ff4e9d80e4294ca5dde803696f Author: Richard Guy Briggs Date: Tue Jun 5 11:45:07 2018 -0400 audit: rename FILTER_TYPE to FILTER_EXCLUDE The AUDIT_FILTER_TYPE name is vague and misleading due to not describing where or when the filter is applied and obsolete due to its available filter fields having been expanded. Userspace has already renamed it from AUDIT_FILTER_TYPE to AUDIT_FILTER_EXCLUDE without checking if it already exists. The userspace maintainer assures that as long as it is set to the same value it will not be a problem since the userspace code does not treat compiler warnings as errors. If this policy changes then checks if it already exists can be added at the same time. See: https://github.com/linux-audit/audit-kernel/issues/89 Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit cf89fe88a676d9482313b6b674e9edce34591400 Author: Arnd Bergmann Date: Mon Jun 18 16:24:56 2018 +0200 tee: replace getnstimeofday64() with ktime_get_real_ts64() The two do the same thing, but we want to have a consistent naming in the kernel. Signed-off-by: Arnd Bergmann Signed-off-by: Jens Wiklander commit af85d1772e31fed34165a1b3decef340cf4080c0 Author: Ondrej Mosnáček Date: Tue Jun 5 11:00:10 2018 +0200 audit: Fix extended comparison of GID/EGID The audit_filter_rules() function in auditsc.c used the in_[e]group_p() functions to check GID/EGID match, but these functions use the current task's credentials, while the comparison should use the credentials of the task given to audit_filter_rules() as a parameter (tsk). Note that we can use group_search(cred->group_info, ...) as a replacement for both in_group_p and in_egroup_p as these functions only compare the parameter to cred->fsgid/egid and then call group_search. In fact, the usage of in_group_p was even more incorrect: it compares to cred->fsgid (which is usually equal to cred->egid) and not cred->gid. GitHub issue: https://github.com/linux-audit/audit-kernel/issues/82 Fixes: 37eebe39c973 ("audit: improve GID/EGID comparation logic") Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit d87de4a878e110d0061fb22726d37a54a281285d Author: Richard Guy Briggs Date: Thu May 31 16:28:12 2018 -0400 audit: tie ANOM_ABEND records to syscall Since core dump events are triggered by user activity, tie the ANOM_ABEND record to the syscall record to collect all records from the same event. See: https://github.com/linux-audit/audit-kernel/issues/88 Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 9b8753fffe7b3642688135f28aa8a0a0f45fd9ab Author: Richard Guy Briggs Date: Thu May 31 16:27:24 2018 -0400 audit: tie SECCOMP records to syscall Since seccomp events are triggered by user activity, tie the SECCOMP record to the syscall record to collect all records from the same event. See: https://github.com/linux-audit/audit-kernel/issues/87 Signed-off-by: Richard Guy Briggs Signed-off-by: Paul Moore commit ad193bc6206d3ee2fc39fe29a2525333faf1afd9 Author: Ville Syrjälä Date: Fri Jun 15 20:44:06 2018 +0300 drm/i915: Enforce max hdisplay/hblank_start limits on HSW/BDW FDI The PCH transcoder registers are only 12 bits wide for the hdisplay and hblank_start values. On HSW/BDW the CPU side registers are 13 bits wide. intel_mode_valid() only checks against the higher limit (since we don't know where the mode is to be used), so an extra check is required against the FDI limits. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180615174406.12258-3-ville.syrjala@linux.intel.com Reviewed-by: Paulo Zanoni commit ad77c537eab1c28732e02c03f3da82917722bef6 Author: Ville Syrjälä Date: Fri Jun 15 20:44:05 2018 +0300 drm/i915: Check timings against hardware maximums Validate that all display timings fit within the number of bits we have in the transcoder timing registers. The limits are: hsw+: 4k: vdisplay, vblank_start 8k: everything else gen3+: 4k: h/vdisplay, h/vblank_start 8k: everything else gen2: 2k: h/vdisplay, h/vblank_start 4k: everything else Also document the fact that the mode_config.max_width/height limits refer to just the max framebuffer dimensions we support. Which may be larger than the max hdisplay/vdisplay. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180615174406.12258-2-ville.syrjala@linux.intel.com Reviewed-by: Paulo Zanoni commit 98fac1d5c5825e61721c7b73875f8b46159e6dcb Author: Ville Syrjälä Date: Fri Jun 15 20:44:04 2018 +0300 drm/i915: Nuke the cursor size defines No point in having this extra indireciton for the cursor max size. So drop the defines and just write out the raw numbers. Makes it easier to see what's going on. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180615174406.12258-1-ville.syrjala@linux.intel.com Reviewed-by: Paulo Zanoni commit 1a4b8901c5ecd321904f7eb5bd73be59c1ca062c Author: Ville Syrjälä Date: Mon Jun 11 22:34:03 2018 +0300 drm/i915: Print prop name/id when rejecting it Use the '[PROP:id:name]' format I introduced for the core in the driver debug messages as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180611193403.16118-3-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit 8163496e78db100a6b5cfbdaece385686ae50129 Author: Benjamin Coddington Date: Tue Jun 19 04:57:24 2018 -0400 nfsd: don't advertise a SCSI layout for an unsupported request_queue Commit 30181faae37f ("nfsd: Check queue type before submitting a SCSI request") did the work of ensuring that we don't send SCSI requests to a request queue that won't support them, but that check is in the GETDEVICEINFO path. Let's not set the SCSI layout in fs_layout_type in the first place, and then we'll have less clients sending GETDEVICEINFO for non-SCSI request queues and less unnecessary WARN_ONs. While we're in here, remove some outdated comments that refer to "overwriting" layout seletion because commit 8a4c3926889e ("nfsd: allow nfsd to advertise multiple layout types") changed things to no longer overwrite the layout type. Signed-off-by: Benjamin Coddington Reviewed-by: Christoph Hellwig Signed-off-by: J. Bruce Fields commit 29c1372d6a9b872acf479ba2744e4e7f043981c0 Author: Ondrej Mosnáček Date: Wed May 30 10:45:24 2018 +0200 audit: allow other filter list types for AUDIT_EXE This patch removes the restriction of the AUDIT_EXE field to only SYSCALL filter and teaches audit_filter to recognize this field. This makes it possible to write rule lists such as: auditctl -a exit,always [some general rule] # Filter out events with executable name /bin/exe1 or /bin/exe2: auditctl -a exclude,always -F exe=/bin/exe1 auditctl -a exclude,always -F exe=/bin/exe2 See: https://github.com/linux-audit/audit-kernel/issues/54 Signed-off-by: Ondrej Mosnacek Reviewed-by: Richard Guy Briggs Signed-off-by: Paul Moore commit fb9acf5f1f21f1de193523ff780bda375b4c2e21 Author: Jan Kundrát Date: Mon Jun 4 16:34:25 2018 +0200 spi: orion: fix CS GPIO handling again The code did not de-assert any CS GPIOs before probing slaves. This means that several CS signals could be active at once, garbling the communication. Whether this was actually a problem depended on the type of the SPI device attached (so my "spidev" for userspace access worked correctly because its probe was effectively a no-op), and on the state of the GPIO pins at SoC's boot. The code was already iterating through all DT children of the SPI controller, so this change re-uses that loop for CS GPIO setup as well. This means that this might change the number of the HW CS signal which is picked for all GPIO CS devices. Previously, the lowest one was used, but we now use the first one from the DT. With this move of the code, we can also finally initialize each GPIO CS lane before registering the SPI controller (which in turn probes for slaves). I tried to fix this in 544248623b95 already, but that only did it half way by registering the GPIOs properly. That patch failed to set their logic signals early enough, though. Signed-off-by: Jan Kundrát Signed-off-by: Mark Brown commit 0fdb3f75a358256188b88391d698349af8cb7340 Author: Vathsala Nagaraju Date: Mon Jun 18 11:42:06 2018 +0530 drm/i915/psr: Adds psrwake options for all platforms Adds new psrwake options defined in the below table. Platform PSR wake options vbt version KBL/CFL/WHL All(205+) BXT Uses old interpretation. CNL/ICL+ All(205+) GLK All(205+) SKL All PV releases (Check for 205+ might help but cannot be foolproof) We will continue with newer interpretation for SKL from 205. v2: Jani Keep the bdb version check. v3: Apply newer version for skl from 205+(DK). Add (version check && platform list) (Jani). Add bdb version for each platform in commit message(DK). Cc: Jani Nikula Cc: Rodrigo Vivi Cc: Puthikorn Voravootivat Cc: Dhinakaran Pandiyan Cc: Ashutosh D Shukla Cc: Maulik V Vaghela Signed-off-by: Vathsala Nagaraju Reviewed-by: Dhinakaran Pandiyan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1529302326-3567-1-git-send-email-vathsala.nagaraju@intel.com commit 46f3bb5fb944089aaa8130a80f5b7df877c58554 Author: Gilad Ben-Yossef Date: Thu May 24 15:19:09 2018 +0100 clk: renesas: r8a7795: Add CCREE clock This patch adds the clock used by the CryptoCell 630p instance in the SoC. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Geert Uytterhoeven commit 3d5155eaadaf512808cb57ec0c7db7bd4cc1ef67 Author: Geert Uytterhoeven Date: Thu May 17 11:04:15 2018 +0200 clk: renesas: r8a7795: Add CR clock Add the CR core clock, which is used by the Secure Engine (SCEG). Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Reviewed-by: Simon Horman Tested-by: Gilad Ben-Yossef commit dc1b7b6ca9d5fa905c164a667086d8a3d8605875 Author: Arnd Bergmann Date: Mon Jun 18 17:00:38 2018 +0200 sysinfo: Remove get_monotonic_boottime() get_monotonic_boottime() is deprecated because it uses the old 'timespec' structure. This replaces one of the last callers with a call to ktime_get_boottime. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Reviewed-by: Cyrill Gorcunov Cc: Andrew Morton Cc: y2038@lists.linaro.org Cc: Dominik Brodowski Cc: Cyrill Gorcunov Link: https://lkml.kernel.org/r/20180618150114.849216-1-arnd@arndb.de commit 58a10456d7175fa674b951f1fd7ead3d9a550db4 Author: Arnd Bergmann Date: Mon Jun 18 16:32:24 2018 +0200 posix-timers: Use new ktime_get_*_ts64() helpers Some of the oddly named time accessor functions now have a more consistent naming, which should be used from now on so the aliases can be removed. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Cc: y2038@lists.linaro.org Cc: Deepa Dinamani Cc: "Eric W. Biederman" Link: https://lkml.kernel.org/r/20180618143246.3865099-1-arnd@arndb.de commit d30faff900e666f9a6395a159fdd353c02f5bed0 Author: Arnd Bergmann Date: Mon Jun 18 16:08:01 2018 +0200 timekeeping: Use ktime_get_real_ts64() instead of getnstimeofday64() The two do the same, this moves all users to the newer name for consistency. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Cc: John Stultz Cc: y2038@lists.linaro.org Cc: Stephen Boyd Cc: Miroslav Lichvar Link: https://lkml.kernel.org/r/20180618140811.2998503-3-arnd@arndb.de commit f5a89295e2f566d8e9f1d4f3d524d8d3c966958c Author: Arnd Bergmann Date: Mon Jun 18 16:08:00 2018 +0200 time: Use ktime_get_real_seconds() in time syscall Both get_seconds() and do_gettimeofday() are deprecated. Change the time() implementation to use the replacement function instead. Obviously the system call will still overflow in 2038, but this gets us closer to removing the old helper functions. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Cc: John Stultz Cc: y2038@lists.linaro.org Cc: Stephen Boyd Cc: Deepa Dinamani Cc: Al Viro Link: https://lkml.kernel.org/r/20180618140811.2998503-2-arnd@arndb.de commit 0a13ec0bbc42bddf90ab6a444df8aaa67c148b16 Author: Jonathan Neuschäfer Date: Sun Jun 17 14:40:18 2018 +0200 genirq: Fix editing error in a comment When the comment was reflowed to a wider format, the "*" snuck in. Fixes: ae88a23b32fa ("irq: refactor and clean up the free_irq() code flow") Signed-off-by: Jonathan Neuschäfer Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180617124018.25539-1-j.neuschaefer@gmx.net commit 4a5f4d2f891bcff7285b5f7490ed5a7a5d516049 Author: Eric Dumazet Date: Mon Jun 18 05:56:12 2018 -0700 genirq: Use rcu in kstat_irqs_usr() Jeremy Dorfman identified mutex contention when multiple threads parse /proc/stat concurrently. Since commit 425a5072dcd1 ("genirq: Free irq_desc with rcu"), kstat_irqs_usr() can be switched to rcu locking, which removes this mutex contention. show_interrupts() case will be handled in a separate patch. Reported-by: Jeremy Dorfman Signed-off-by: Eric Dumazet Signed-off-by: Thomas Gleixner Cc: Eric Dumazet Cc: Willem de Bruijn Link: https://lkml.kernel.org/r/20180618125612.155057-1-edumazet@google.com commit d5b65efd2b2e674668d773a82d858ce161956b0a Author: Arnd Bergmann Date: Mon Jun 18 17:38:43 2018 +0200 i915: remove timespec_to_jiffies_timeout This function has been unused since commit 5ed0bdf21a85 ("drm: i915: Use nsec based interfaces"). Let's remove the definition as well now to help get rid of all uses of 'timespec'. Signed-off-by: Arnd Bergmann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180618153855.2126048-1-arnd@arndb.de commit 707c62352909a9be2453ae073e160de59d2d4a1f Author: Bart Van Assche Date: Fri Jun 15 15:20:42 2018 -0700 configfs: use kvasprintf() instead of open-coding it Signed-off-by: Bart Van Assche Signed-off-by: Christoph Hellwig commit 4cb0e60112168594da2ac8a7752b0250c4387733 Author: Dave Jiang Date: Mon Jun 11 12:49:03 2018 -0700 dmaengine: ioatdma: set the completion address register after channel reset It seems that starting with Skylake Xeon, channel reset clears the completion address register. Make sure the completion address register is set again after reset. Signed-off-by: Dave Jiang Signed-off-by: Vinod Koul commit 7a2aeb91757b12081e741b436466ec90e6d2c043 Author: Li Yang Date: Tue Jun 12 13:28:42 2018 -0500 arm64: dts: freescale: Update to use SPDX identifiers Replace license text with corresponding SPDX identifiers and update the format of existing SPDX identifiers to follow the new guideline Documentation/process/license-rules.rst. Note that some of the files mentioned X11 license previously but the license text actually matches MIT license. Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 13d8f1762bf64c564317695b573b0b2528a90af9 Author: Leonard Crestez Date: Mon Jun 18 16:11:09 2018 +0300 ARM: dts: imx7d-sdb: Remove duplicate regulator-can2-3v3 Two different regulators are defined with the same name and label but distinct properties. The first definition was added with the first board dts and the second was added when upstream added flexcan support. Looking at schematics it is indeed gpio2 14 connected to the STB pin of the CAN transceiver so remove the first definition. The second definition entirely overrides the first so this already worked and this patch results in no DTB change, just a cleanup. Signed-off-by: Leonard Crestez Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 88c83ae6707107ae9503048f26afd7b3c761df37 Author: Leonard Crestez Date: Mon Jun 18 11:15:45 2018 +0300 ARM: imx_v6_v7_defconfig: Enable imx6qdl-sabreauto sensors CONFIG_SENSORS_ISL29018 supports isil,il29023 light sensor CONFIG_MMA8452 supports fsl,mma8451 accelerometer CONFIG_MAG3110 for fsl,mag3110 is already enabled Signed-off-by: Leonard Crestez Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit a211b8c55f3ce54423bd1daf1bca82271b08ac2f Author: Leonard Crestez Date: Mon Jun 18 11:15:44 2018 +0300 ARM: dts: imx6qdl-sabreauto: Add sensors The following sensors are on I2C3 on the baseboard: * isil,isl29023 light sensor * fsl,mag3110 magnetometer * fsl,mma8451 accelerometer Added under i2cmux/i2c@1 because they're not otherwise accessible. These are all supported by iio with following configs: * CONFIG_SENSORS_ISL29018 * CONFIG_MAG3110 * CONFIG_MMA8452 Tested with raw reads from iio sysfs. Signed-off-by: Leonard Crestez Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit f3af1e5c0c6fe20cd2cc3ae5512c79d8e2dfbfba Author: Jagan Teki Date: Thu Jun 7 19:21:33 2018 +0530 ARM: dts: imx6qdl-icore: Fix wrong reg_2p5 regulator node name - in reg_2p5, fix regulator node name as regulator-2p5v - remove exctra line Signed-off-by: Jagan Teki Signed-off-by: Shawn Guo commit 3992516af3846bc2dcba002de5d7c908be5c06de Author: Jagan Teki Date: Thu Jun 7 19:21:32 2018 +0530 ARM: dts: imx6q-icore-mipi: Add OV5640 Camera sensor OV5640 Camera sensor is connected in i.CoreM6 1.5 Quad/Dual MIPI starter kit. This patch also move MX6QDL_PAD_GPIO_0__CCM_CLKO1 pinctrl from i2c3 to ov5640 pinctrl. Signed-off-by: Jagan Teki Signed-off-by: Shawn Guo commit a8039f2dd0899a41d869ba2cc0f73a29b519d268 Author: Jagan Teki Date: Thu Jun 7 19:21:31 2018 +0530 ARM: dts: imx6dl: Add Engicam i.CoreM6 1.5 Quad/Dual MIPI starter kit support i.CoreM6 1.5 is an another i.CoreM6 QDL cpu modules which can be connected to EDIMM starter kit design with eMMC and MIPI-CSI interfaces suitable for Android and video capture application. notable features: CPU NXP i.MX6 S/DL/D/Q, Up to 4 x Cortex-A9@800MHz Memory Up to 2 GB DDR3-1066 Video Interfaces Up to 1 Parallel Up to 2 LVDS HDMI 1.4 port 8 bit CSI INPUT MIPI-CSI INPUT 1 x 10/100 Ethernet interface, 2 x USB, 1 x PCIe, 1 x I2S etc Signed-off-by: Jagan Teki Signed-off-by: Shawn Guo commit 39143301bed9cae5ce1c1c65b0c482ea650bf367 Author: Lucas Stach Date: Wed Jun 6 11:30:45 2018 +0200 ARM: dts: imx6: RDU2: correct touchscreen axis inversion The RMI4 touchscreen driver applied inversion and axis swap in the wrong order, violating the DT binding for those properties. This is fixed now, so correct the RDU2 DT to apply the inversion to the correct axis. Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 83ef5da0527cfeb1bb77c25f67b7ce0e06a42579 Author: Anson Huang Date: Sun Jun 3 10:33:46 2018 +0800 ARM: imx: remove i.MX6SLL support in i.MX6SL cpu idle driver i.MX6SLL supports ARM power off in cpu idle, better to reuse i.MX6SX cpu idle driver instead of i.MX6SL which does NOT support ARM power off. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e7fa1fb39b118cc8415a946fd2e6bc0f6b6c05c9 Author: Anson Huang Date: Sun Jun 3 10:33:45 2018 +0800 ARM: imx: add cpu idle support for i.MX6SLL i.MX6SLL supports cpu idle with ARM power gated, it can reuse i.MX6SX's cpu idle driver to support below 3 states of cpu idle: state0: WFI; state1: WAIT mode with ARM power on; state2: WAIT mode with ARM power off. L2_PGE in GPC_CNTR needs to be cleared to support state2 cpu idle. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit c791bbbf812a18a7831619783f12a316beeac558 Author: Anson Huang Date: Sun Jun 3 10:33:44 2018 +0800 ARM: imx: add L2 page power control for GPC Some platforms like i.MX6UL/i.MX6SLL have L2 page power control in GPC, it needs to be disabled if ARM is power gated and L2 is NOT flushed, add GPC interface to control it. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit cda6d30e60c4abceee3ad4f80559b8e37385549c Author: Shivasharan S Date: Mon Jun 4 03:45:13 2018 -0700 scsi: megaraid_sas: driver version upgrade Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit e9495e2de7769a9cfec03281d611313347f337ca Author: Shivasharan S Date: Mon Jun 4 03:45:12 2018 -0700 scsi: megaraid_sas: Support FW provided TM timeout values Firmware provides drive specific target reset and task abort timeout values. Driver needs to use these timeout values during task management calls. If FW does not provide these values, fall back to using earlier default timeout of 50 seconds for TM. [mkp: clarified comment] Signed-off-by: Sumit Saxena Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 9c9db8b792a27d38cbb2a4f51a56e35b4506c897 Author: Shivasharan S Date: Mon Jun 4 03:45:11 2018 -0700 scsi: megaraid_sas: Return immediately from wait_for_adapter_operational after kill adapter While driver is waiting for adapter to become operational, if a kill adapter is issued, driver can bail out from the wait loop immediately rather than waiting for the entire 180 seconds. Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit c3b10a55abc943a526aaecd7e860b15671beb906 Author: Shivasharan S Date: Mon Jun 4 03:45:10 2018 -0700 scsi: megaraid_sas: Update controller info during resume There is a possibility that firmware on the controller was upgraded before system was suspended. During resume, driver needs to read updated controller properties. Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 2747e6be4ca71b1c44ed25c89cc100f89a4e913b Author: Shivasharan S Date: Mon Jun 4 03:45:09 2018 -0700 scsi: megaraid_sas: Do not do Kill adapter if GET_CTRL_INFO times out If MR_DCMD_CTRL_GET_INFO DCMD timed out, return failure rather than doing kill adapter. Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 2cd4bf89f76311944fd7415a2402bd88f1eaf79d Author: Chaitra P B Date: Thu May 31 06:34:52 2018 -0400 scsi: mpt3sas: Update driver version "26.100.00.00" Updated driver version to "26.100.00.00" Signed-off-by: Chaitra P B Signed-off-by: Martin K. Petersen commit 2b48be65685a23f4ffc7a06858992bc31e98e198 Author: Chaitra P B Date: Thu May 31 06:34:51 2018 -0400 scsi: mpt3sas: As per MPI-spec, use combined reply queue for SAS3.5 controllers when HBA supports more than 16 MSI-x vectors. Presently driver is using combined reply queue feature when MSI-x vectors > 8 for both SAS3 and SAS3.5 controllers. But as per MPI-spec, 1. For SAS3 controllers, driver should use combined reply queue when HBA supports more than 8 MSI-x vectors. 2. For SAS3.5 controllers, driver should use combined reply queue when HBA supports more than 16 MSI-x vectors. Modified driver code to use combined reply queue for SAS3 controllers when HBA supports > 8 MSI-x vectors and for SAS3.5 controllers when HBA supports > 16 MSI-x vectors. Signed-off-by: Chaitra P B Signed-off-by: Martin K. Petersen commit d37306ca0eacdc040e1df91910123117a9df6d40 Author: Chaitra P B Date: Thu May 31 06:34:50 2018 -0400 scsi: mpt3sas: Fix, False timeout prints for ioctl and other internal commands during controller reset. When an ioctl is sent to FW, and if there is a controller reset issued before ioctl gets completed, then in controller reset path all the pending ioctl commands are terminated from "mpt3sas_ctl_reset_handler" function. This will wake up the waiting ioctl commands in ioctl path and print timeouts which are actually not timeouts. Introduced "mpt3sas_base_check_cmd_timeout" function to check and print whether command got timed out (or) terminated due to Host reset. Signed-off-by: Chaitra P B Signed-off-by: Martin K. Petersen commit 20a044332dc47e91045670311f9f9dcb1e32483f Author: Chaitra P B Date: Thu May 31 06:34:49 2018 -0400 scsi: mpt3sas: Don't access the structure after decrementing it's instance reference count. While configuring of NVMe device handling, _pcie_device structure member was accessed after its reference count is decremented/put. Hence modified code to access member of _pcie_device structure before its reference count is decremented/put. Signed-off-by: Chaitra P B Signed-off-by: Martin K. Petersen commit e3586147b8b123fcaf739f4dcda741e13c5eaf9e Author: Chaitra P B Date: Thu May 31 06:34:48 2018 -0400 scsi: mpt3sas: Incorrect command status was set/marked as not used. In _scsih_scan_finished driver should mark port_enable_cmd.status as 'command not used', instead base_cmds.status was marked as 'command not used'. Update code to mark port_enable_cmd.status as 'command not used'. Signed-off-by: Chaitra P B Signed-off-by: Martin K. Petersen commit 999c85134db71599698917775f35fd56ced2dc0a Author: Chaitra P B Date: Thu May 31 06:34:47 2018 -0400 scsi: mpt3sas: Don't abort I/Os issued to NVMe drives while processing Async Broadcast primitive event. Linux driver when receives Broadcast Asynchronous Event Notification (BAEN) from the controller firmware, checks all pending I/Os at the driver level and issues query task, abort task TMs. This is done in the driver to handle drives which are connected with multiple initiators and undergoing target resets. In the BAEN handling code, the I/Os issued to NVMe drives are also handled and query task and abort task TMs are issued, which are not necessary as there is no multi-initiator and no BAEN concept with NVMe drives. Hence when the driver checks for pending I/Os it skips NVMe drives at this moment. Signed-off-by: Chaitra P B Signed-off-by: Martin K. Petersen commit 9554c1be48b437f192234eebb89f124ba3ef0e25 Author: Xiubo Li Date: Thu Jun 7 02:31:36 2018 -0400 scsi: tcmu: remove useless code and clean up the code style. Since the TCMU_RING_SIZE macro is not using here will discard it and at the same time clean up the code style. Signed-off-by: Xiubo Li Acked-by: Mike Christie Signed-off-by: Martin K. Petersen commit 22021948c98c5d86a7b44d2c610bf610dcea4a81 Author: Anson Huang Date: Thu May 31 10:06:09 2018 +0800 ARM: imx: add mem mode suspend for i.MX6SLL Add mem mode suspend for i.MX6SLL, when linux kernel suspend, SoC will enter STOP mode, ARM core will be power gated and MMDC IO will be set to low power mode. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 07c4be9d27ade3eaef8c6ba8abf1f3270a6a26f4 Author: Anson Huang Date: Thu May 31 10:06:08 2018 +0800 ARM: imx: add standby mode suspend for i.MX6SLL Add standby mode suspend for i.MX6SLL, when linux kernel suspend, SoC will enter STOP mode with ARM core power on. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit b796b9710fd52d7f406f606697322fb5c7f562f3 Author: Dhinakaran Pandiyan Date: Fri Jun 15 17:05:30 2018 -0700 drm/i915/icl: Handle hotplug interrupts for DP over TBT This patch enables hotplug interrupts for DP over TBT output on TC ports. The TBT interrupts are enabled and handled irrespective of the actual output type which could be DP Alternate, DP over TBT, native DP or native HDMI. Cc: Animesh Manna Cc: Paulo Zanoni Cc: Anusha Srivatsa Cc: Manasi Navare Reviewed-by: Lucas De Marchi Signed-off-by: Dhinakaran Pandiyan Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180616000530.5357-3-paulo.r.zanoni@intel.com commit 121e758ee5782b31fa5ecf23a3828f86167d36cc Author: Dhinakaran Pandiyan Date: Fri Jun 15 17:05:29 2018 -0700 drm/i915/icl: Support for TC North Display interrupts The hotplug interrupts for the ports can be routed to either North Display or South Display depending on the output mode. DP Alternate or DP over TBT outputs will have hotplug interrupts routed to the North Display while interrupts for legacy modes will be routed to the South Display in PCH. This patch adds hotplug interrupt handling support for DP Alternate mode. Cc: Jani Nikula Cc: Anusha Srivatsa Reviewed-by: Paulo Zanoni Signed-off-by: Dhinakaran Pandiyan [Paulo: coding style changes] Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180616000530.5357-2-paulo.r.zanoni@intel.com commit df0d28c185ad29d539826a8eb8b651ea9c46051d Author: Dhinakaran Pandiyan Date: Fri Jun 15 17:05:28 2018 -0700 drm/i915/icl: GSE interrupt moves from DE_MISC to GU_MISC The Graphics System Event(GSE) interrupt bit has a new location in the GU_MISC_INTERRUPT_{IIR, ISR, IMR, IER} registers. Since GSE was the only DE_MISC interrupt that was enabled, with this change we don't enable/handle any of DE_MISC interrupts for gen11. Credits to Paulo for pointing out the register change. v2: from DK raw_reg_[read/write], branch prediction hint and drop platform check (Mika) v3: From DK Early re-enable of master interrupt (Chris) Cc: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Paulo Zanoni Signed-off-by: Dhinakaran Pandiyan [Paulo: bikesheds and rebases] Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180616000530.5357-1-paulo.r.zanoni@intel.com commit 3a3d4163e0bfde184ffbc54c887f5b1ec9969c90 Author: Sricharan R Date: Thu Jun 7 22:57:11 2018 +0530 remoteproc: qcom: Introduce Hexagon V5 based WCSS driver IPQ8074 has an integrated Hexagon dsp core q6v5 and a wireless lan (Lithium) IP. An mdt type single image format is used for the firmware. So the mdt_load function can be directly used to load the firmware. Also add the relevant resets required for this core. Acked-by: Rob Herring (bindings) Signed-off-by: Sricharan R [bjorn: Rewrote as a separate driver, intead of extending q6v5_pil.c] Signed-off-by: Bjorn Andersson commit 7d674731f36c2b3f2707baad6c01cce93c754edf Author: Bjorn Andersson Date: Mon Jun 4 13:30:38 2018 -0700 remoteproc: qcom: q6v5-pil: Use common q6v5 helpers Migrate the MSS remoteproc driver to use the newly extracted helper functions. Reviewed-by: Sricharan R Signed-off-by: Bjorn Andersson commit 6103b1a616ab010edddd9a60542df86fd47eb46b Author: Bjorn Andersson Date: Mon Jun 4 13:30:37 2018 -0700 remoteproc: qcom: adsp: Use common q6v5 helpers Migrate the Hexagon V5 PAS (ADSP) driver to using the newly extracted helper functions. The use of the handover callback does introduce latent disabling of proxy resources. But apart from this there should be no change in functionality. Reviewed-by: Rohit kumar Reviewed-by: Sricharan R Tested-by: Rohit kumar Signed-off-by: Bjorn Andersson commit 3b415c8fb263173a60e12666213073c9653737d0 Author: Bjorn Andersson Date: Mon Jun 4 13:30:36 2018 -0700 remoteproc: q6v5: Extract common resource handling Shared between all Hexagon V5 based remoteprocs is the handling of the 5 interrupts and the SMP2P stop request, so break this out into a separate function in order to allow these drivers to be cleaned up. Reviewed-by: Rohit kumar Tested-by: Rohit kumar Signed-off-by: Bjorn Andersson commit 0e622e80191e75c99b6ecc265c140a37d81e7a63 Author: Sricharan R Date: Mon Jun 4 13:30:35 2018 -0700 remoteproc: qcom: mdt_loader: Make the firmware authentication optional qcom_mdt_load function loads the mdt type firmware and initialises the secure memory as well. Make the initialisation only when requested by the caller, so that the function can be used by self-authenticating remoteproc as well. Acked-by: Andy Gross Signed-off-by: Sricharan R Signed-off-by: Bjorn Andersson commit 9e8789ec967a2d524bcfc79c47a85d08dfbe626a Author: Paulo Zanoni Date: Tue Jun 12 16:56:54 2018 -0700 drm/i915/i915_reg.h: fix the checkpatch MACRO_ARG_PRECEDENCE issues While I don't see any issue with the way these macros are being called today, let's protect them against operator precedence issues before they happen. Reviewed-by: Rodrigo Vivi Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180612235654.7914-4-paulo.r.zanoni@intel.com commit af7187b784432d62cb2059d65ef91b7e0aa77a4f Author: Paulo Zanoni Date: Tue Jun 12 16:56:53 2018 -0700 drm/i915/i915_reg.h: fix the checkpatch SPACE_BEFORE_TAB issues Since I'm touching the file I might as well fix this class of errors since they are just a few. Also drive-by fix the styling of the VLV_TURBO_SOC_OVERRIDE definitions instead of just the spaces before the tabs. Reviewed-by: Rodrigo Vivi Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180612235654.7914-3-paulo.r.zanoni@intel.com commit 5ee8ee86c86f30950a6e53eb5a340e929353e855 Author: Paulo Zanoni Date: Mon Jun 18 11:09:43 2018 -0700 drm/i915/i915_reg.h: fix the checkpatch SPACING issues Because OCD. Now seriously, commit 1aa920ea0e85 ("drm/i915: add register macro definition style guide") has finally established a coding standard to be followed by the rest of the file, and I've been trying to request everybody to adhere to that since then. The problem is that when someone adds a new line to a register that has the wrong style, these people generally propagate the wrong style and I have to keep asking them to drive-by fix the whole register, which is not something I like to do and also creates extra work for them. Or I can ignore the propagation of the wrong coding style and feel anxious about it. On top of that, we now have our CI happily reminding us about these problems, which makes everything worse. So IMHO the best way to proceed is to fix the spacing issues in the file once and for all. Contributors will stop propagating the bad style when adding new bits to registers that already have bad style, we will stop asking them to redo their patches and the CI emails will become more relevant by having less semi-false errors. Yes, there will be some pain involved for backporters, but at least spacing issues like that are easy to spot and fix in the patch files. This patch was generated by: ../../../../scripts/checkpatch.pl -f --strict --types SPACING \ --fix-inplace i915_reg.h I manually checked the output and everything seems sane. v2: Single conflict around the addition of DP_TP_CTL_LINK_TRAIN_PAT4. Cc: Jani Nikula Cc: Rodrigo Vivi Cc: Joonas Lahtinen Acked-by: Rodrigo Vivi Reviewed-by: Jani Nikula Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180618180943.894-1-paulo.r.zanoni@intel.com commit 3cba33d3118880706e2178ec8b4f3a7109f370ea Author: Bharat Potnuri Date: Fri Jun 15 20:58:23 2018 +0530 iw_cxgb4: remove duplicate memcpy() in c4iw_create_listen() memcpy() of mapped addresses is done twice in c4iw_create_listen(), removing the duplicate memcpy(). Fixes: 170003c894d9 ("iw_cxgb4: remove port mapper related code") Reviewed-by: Steve Wise Signed-off-by: Potnuri Bharat Teja Signed-off-by: Jason Gunthorpe commit 8ba6731ad4c7e9f612b2f7dae1b5ed6bfc884b67 Author: Johannes Berg Date: Mon Jun 18 22:43:58 2018 +0200 rfkill: add header files to MAINTAINERS These files weren't covered by the MAINTAINERS file, add them. Reported-by: Peter Meerwald-Stadler Signed-off-by: Johannes Berg commit 41cbb0f5a29592874355e4159489eb08337cd50e Author: Luca Coelho Date: Sat Jun 9 09:14:44 2018 +0300 mac80211: add support for HE Add support for HE in mac80211 conforming with P802.11ax_D1.4. Johannes: Fix another bug with the buf_size comparison in agg-rx.c. Signed-off-by: Liad Kaufman Signed-off-by: Johannes Berg Signed-off-by: Ilan Peer Signed-off-by: Ido Yariv Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit b8042b3da925f390c1482bf9dc0898dc0b3ea7b5 Author: Johannes Berg Date: Mon Jun 18 22:39:29 2018 +0200 ieee80211: bump IEEE80211_MAX_AMPDU_BUF to support HE Bump the IEEE80211_MAX_AMPDU_BUF size to 0x100 for HE support and - for now - use IEEE80211_MAX_AMPDU_BUF_HT everywhere. This is derived from my internal patch, parts of which Luca had sent upstream. Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit cf76e1e5198aad2721c8da84c2cc0933d32223cf Author: Paul Moore Date: Mon Jun 18 15:43:32 2018 -0400 MAINTAINERS: update the LSM and SELinux subsystems The SELinux code, security/selinux/, already has a MAINTAINERS entry so exclude it from the security subsystem entry in an effort to better reflect current practices. Signed-off-by: Paul Moore commit 58884bbc7c9d8dd2623510ecf8ba3ddf1af9ce96 Author: Radhakrishna Sripada Date: Thu Jun 7 12:20:13 2018 -0700 drm/i915/audio: Add 810 MHz clock entries to dp_aud_n_m table Expand the Maud/Naud table according to DP 1.4 spec to include entries for 810 MHz clock. This is required for audio to work with HBR3. Cc: Dhinakaran Pandiyan Cc: Jani Nikula Signed-off-by: Radhakrishna Sripada Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180607192013.25872-1-radhakrishna.sripada@intel.com commit cd31b80736852d34bc1072f3e579a6fd73a244e7 Author: Robert Jarzmik Date: Sun Jun 17 19:02:17 2018 +0200 ARM: pxa: change SSP DMA channels allocation Now the dma_slave_map is available for PXA architecture, switch the SSP device to it. This specifically means that : - for platform data based machines, the DMA requestor channels are extracted from the slave map, where pxa-ssp-dai. is a 1-1 match to ssp., and the channels are either "rx" or "tx". - for device tree platforms, the dma node should be hooked into the pxa2xx-ac97 or pxa-ssp-dai node. Signed-off-by: Robert Jarzmik Acked-by: Daniel Mack commit b77ed2e6d61d40117272be1b2377c5dfd101e9cd Author: Robert Jarzmik Date: Sun Jun 17 19:02:16 2018 +0200 ARM: pxa: remove the DMA IO resources As the last driver using the former mechanism to acquire the DMA requestor line has be converted to the dma_slave_map, remove all these resources from the PXA devices. Signed-off-by: Robert Jarzmik commit b6d1a17f4729e4fda5740a855da91d202db2c118 Author: Robert Jarzmik Date: Sun Jun 17 19:02:14 2018 +0200 dmaengine: pxa: document pxad_param Add some documentation for the pxad_param structure, and describe the contract behind the minimal required priority of a DMA channel. Signed-off-by: Robert Jarzmik Acked-by: Vinod Koul commit 273340e8bf86de53eef7073993352ea11c563696 Author: Robert Jarzmik Date: Sun Jun 17 19:02:13 2018 +0200 ata: pata_pxa: remove the dmaengine compat need As the pxa architecture switched towards the dmaengine slave map, the old compatibility mechanism to acquire the dma requestor line number and priority are not needed anymore. This patch simplifies the dma resource acquisition, using the more generic function dma_request_slave_channel(). Signed-off-by: Robert Jarzmik Acked-by: Bartlomiej Zolnierkiewicz commit ac75a50b6de3b092d084fdd9818707d0d5073ad6 Author: Robert Jarzmik Date: Sun Jun 17 19:02:09 2018 +0200 mtd: rawnand: marvell: remove the dmaengine compat need As the pxa architecture switched towards the dmaengine slave map, the old compatibility mechanism to acquire the dma requestor line number and priority are not needed anymore. This patch simplifies the dma resource acquisition, using the more generic function dma_request_slave_channel(). Signed-off-by: Daniel Mack Signed-off-by: Robert Jarzmik Acked-by: Miquel Raynal commit f727b6cda449184188d8a64987f194687bf01782 Author: Robert Jarzmik Date: Sun Jun 17 19:02:08 2018 +0200 media: pxa_camera: remove the dmaengine compat need As the pxa architecture switched towards the dmaengine slave map, the old compatibility mechanism to acquire the dma requestor line number and priority are not needed anymore. This patch simplifies the dma resource acquisition, using the more generic function dma_request_slave_channel(). Signed-off-by: Robert Jarzmik Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab commit 6b3348f9e6eb35d2c2d49ffa274039ef9a901adc Author: Robert Jarzmik Date: Sun Jun 17 19:02:07 2018 +0200 mmc: pxamci: remove the dmaengine compat need As the pxa architecture switched towards the dmaengine slave map, the old compatibility mechanism to acquire the dma requestor line number and priority are not needed anymore. This patch simplifies the dma resource acquisition, using the more generic function dma_request_slave_channel(). Signed-off-by: Robert Jarzmik Acked-by: Ulf Hansson commit 88a0513cf6114bbabbd3a158f039dbd03f49e0bf Author: Robert Jarzmik Date: Sun Jun 17 19:02:06 2018 +0200 dmaengine: pxa: add a default requestor policy As what former drcmr -1 value meant, add a this as a default to each channel, ie. that by default no requestor line is used. This is specifically used for network drivers smc91x and smc911x, and needed for their port to slave maps. Cc: Arnd Bergmann Signed-off-by: Robert Jarzmik Acked-by: Vinod Koul commit 1da10c17afd1109ae22d529c3b16d9f6de3fdbec Author: Robert Jarzmik Date: Sun Jun 17 19:02:05 2018 +0200 ARM: pxa: add dma slave map In order to remove the specific knowledge of the dma mapping from PXA drivers, add a default slave map for pxa architectures. This is the first step, and once all drivers are converted, pxad_filter_fn() will be made static, and the DMA resources removed from device.c. Signed-off-by: Robert Jarzmik Reported-by: Arnd Bergmann commit 420c0117db25db38b72b6230223f7a976d3070ea Author: Robert Jarzmik Date: Sun Jun 17 19:02:04 2018 +0200 dmaengine: pxa: use a dma slave map In order to remove the specific knowledge of the dma mapping from PXA drivers, add a default slave map for pxa architectures. This won't impact MMP architecture, but is aimed only at all PXA boards. This is the first step, and once all drivers are converted, pxad_filter_fn() will be made static, and the DMA resources removed from device.c. Signed-off-by: Robert Jarzmik Reported-by: Arnd Bergmann Acked-by: Vinod Koul commit 33023fb85a42b53bf778bc025f9667b582282be4 Author: Steve Wise Date: Mon Jun 18 08:05:26 2018 -0700 IB/core: add max_send_sge and max_recv_sge attributes This patch replaces the ib_device_attr.max_sge with max_send_sge and max_recv_sge. It allows ulps to take advantage of devices that have very different send and recv sge depths. For example cxgb4 has a max_recv_sge of 4, yet a max_send_sge of 16. Splitting out these attributes allows much more efficient use of the SQ for cxgb4 with ulps that use the RDMA_RW API. Consider a large RDMA WRITE that has 16 scattergather entries. With max_sge of 4, the ulp would send 4 WRITE WRs, but with max_sge of 16, it can be done with 1 WRITE WR. Acked-by: Sagi Grimberg Acked-by: Christoph Hellwig Acked-by: Selvin Xavier Acked-by: Shiraz Saleem Acked-by: Dennis Dalessandro Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe commit b90575ce7b84483d46ebedd5c164e5f274f7ce5a Author: Zhu Yanjun Date: Thu Jun 14 05:45:42 2018 -0400 IB/rxe: avoid unnecessary NULL check Before goto err2, the variable qp is checked. So it is not necessary to check qp in label err2. Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Reviewed-by: Yuval Shaia Signed-off-by: Jason Gunthorpe commit 92cf36eec2a76d8fe61d439cd2b3ebbf33029477 Author: Vijay Immanuel Date: Tue Jun 12 18:12:05 2018 -0700 IB/rxe: support for 802.1q VLAN on the listener Set the vlan flag and vlan_id field in the wc for rdma_listen() to work over VLAN. This is required by ib_init_ah_attr_from_wc() which is called by the CM REQ handler. Signed-off-by: Vijay Immanuel Reviewed-by: Yonatan Cohen Signed-off-by: Jason Gunthorpe commit 6a965ee57d0ccff9994cf068bfc4f8beb2a2aba0 Author: Vijay Immanuel Date: Wed Jun 13 18:48:37 2018 -0700 IB/rxe: increase max MR limit Increase the max MR limit to support more I/O queues for NVMe over Fabrics hosts. Signed-off-by: Vijay Immanuel Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit aece27a2f01be4bb7683790f69cd1bed3a0929a2 Author: Samuel Morris Date: Tue May 29 10:06:12 2018 +0000 ata: ahci_platform: allow disabling of hotplug to save power A number of resources remain powered to support hotplug. On platforms I've worked with, allowing the ahci_platform to suspend saves about 150mW. This patch enables rpm and allows the device to be auto-suspended through sysfs. Signed-off-by: Samuel Morris Signed-off-by: Tejun Heo commit 332c42a9ff7f75a4d9dd263a6e5da32b45de12ec Author: Samuel Morris Date: Tue May 29 10:06:11 2018 +0000 ata: ahci: rpm_put port on port_stop to match rpm_get in port_start This change balances out the final ahci_port_resume in port_start to ensure reference counts are correct after port stop. Signed-off-by: Samuel Morris Signed-off-by: Tejun Heo commit e364672477a105029346f0888bfa797b1ec3eee4 Author: José Roberto de Souza Date: Thu Jun 14 16:37:20 2018 -0700 drm/i915/aml: Introducing Amber Lake platform Amber Lake uses the same gen graphics as Kaby Lake, including a id that were previously marked as reserved on Kaby Lake, but that now is moved to AML page. So, let's just move it to AML macro that will feed into KBL macro just to keep it better organized to make easier future code review but it will be handled as a KBL. Reviewed-by: Rodrigo Vivi Signed-off-by: José Roberto de Souza Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180614233720.30517-2-jose.souza@intel.com commit b9be78531d2710f4302545aa80e0678ed0a3dd09 Author: José Roberto de Souza Date: Thu Jun 14 16:37:19 2018 -0700 drm/i915/whl: Introducing Whiskey Lake platform Whiskey Lake uses the same gen graphics as Coffe Lake, including some ids that were previously marked as reserved on Coffe Lake, but that now are moved to WHL page. So, let's just move them to WHL macros that will feed into CFL macro just to keep it better organized to make easier future code review but it will be handled as a CFL. v2: Fixing GT level of some ids Cc: Rodrigo Vivi Signed-off-by: José Roberto de Souza Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180614233720.30517-1-jose.souza@intel.com commit 9a41e38a467c06a0c48369970ce5a9f790edd64d Author: willy@infradead.org Date: Wed Jun 13 05:34:03 2018 -0700 IB/mad: Use IDR for agent IDs Allocate agent IDs from a global IDR instead of an atomic variable. This eliminates the possibility of reusing an ID which is already in use after 4 billion registrations. We limit the assigned ID to be less than 2^24 as the mlx4 driver uses the most significant byte of the agent ID to store the slave number. Users unlucky enough to see a collision between agent numbers and slave numbers see messages like: mlx4_ib: egress mad has non-null tid msb:1 class:4 slave:0 and the MAD layer stops working. We look up the agent under protection of the RCU lock, which means we have to free the agent using kfree_rcu, and only increment the reference counter if it is not 0. Signed-off-by: Matthew Wilcox Reported-by: Hans Westgaard Ry Acked-by: Jack Morgenstein Tested-by: Jack Morgenstein Signed-off-by: Jason Gunthorpe commit 3c60e868c31e4ff144776bf53ff0dfe9e9e4ec15 Author: willy@infradead.org Date: Wed Jun 13 11:45:55 2018 -0700 IDR: Expose the XArray lock Allow users of the IDR to use the XArray lock for their own synchronisation purposes. The IDR continues to rely on the caller to handle locking, but this lets the caller use the lock embedded in the IDR data structure instead of allocating their own lock. Signed-off-by: Matthew Wilcox Signed-off-by: Jason Gunthorpe commit 89af969a665390dc6b156fef55755ca546cd8d92 Author: Parav Pandit Date: Wed Jun 13 10:22:09 2018 +0300 RDMA: Convert drivers to use the AH's sgid_attr in post_wr paths For UD the drivers were doing a sgid_index lookup into the cache to get the attrs, however we can now directly access the same attrs stores in the ib_ah instead and remove the lookup. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 1a1f460ff151710289c2f8d4badd8b603b87d610 Author: Jason Gunthorpe Date: Wed Jun 13 10:22:08 2018 +0300 RDMA: Hold the sgid_attr inside the struct ib_ah/qp If the AH has a GRH then hold a reference to the sgid_attr inside the common struct. If the QP is modified with an AV that includes a GRH then also hold a reference to the sgid_attr inside the common struct. This informs the cache that the sgid_index is in-use so long as the AH or QP using it exists. This also means that all drivers can access the sgid_attr directly from the ah_attr instead of querying the cache during their UD post-send paths. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 7492052a186b11be024800eabedef25dcb882613 Author: Parav Pandit Date: Wed Jun 13 10:22:07 2018 +0300 IB/mlx4: Use GID attribute from ah attribute While converting GID index from attribute to that of the HCA, GID attribute is available from the ah_attr. Make use of GID attribute to simplify the code and also avoid avoid GID query. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 47ec38666210485de860ab24675acb3d2e7d4954 Author: Parav Pandit Date: Wed Jun 13 10:22:06 2018 +0300 RDMA: Convert drivers to use sgid_attr instead of sgid_index The core code now ensures that all driver callbacks that receive an rdma_ah_attrs will have a sgid_attr's pointer if there is a GRH present. Drivers can use this pointer instead of calling a query function with sgid_index. This simplifies the drivers and also avoids races where a gid_index lookup may return different data if it is changed. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit d97099fe53ed9ab8b17d084bed0099feb08a48c1 Author: Jason Gunthorpe Date: Wed Jun 13 10:22:05 2018 +0300 IB{cm, core}: Introduce and use ah_attr copy, move, replace APIs Introduce AH attribute copy, move and replace APIs to be used by core and provider drivers. In CM code flow when ah attribute might be re-initialized twice while processing incoming request, or initialized once while from path record while sending out CM requests. Therefore use rdma_move_ah_attr API to handle such scenarios instead of memcpy(). Provider drivers keeps a copy ah_attr during the lifetime of the ah. Therefore, use rdma_replace_ah_attr() which conditionally release reference to old ah_attr and holds reference to new attribute whose referrence is released when the AH is freed. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 947c99ecfcb49ddf7ade5e5fa4c33cf77d6d33f3 Author: Parav Pandit Date: Wed Jun 13 10:22:04 2018 +0300 IB/core: Tidy ib_resolve_eth_dmac No reason to call rdma_ah_retrieve_grh, tidy whitespace, and add a function comment block. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 8d9ec9addd6c492a99d3699212653cba92989767 Author: Jason Gunthorpe Date: Wed Jun 13 10:22:03 2018 +0300 IB/core: Add a sgid_attr pointer to struct rdma_ah_attr The sgid_attr will ultimately replace the sgid_index in the ah_attr. This will allow for all layers to have a consistent view of what gid table entry was selected as processing runs through all stages of the stack. This commit introduces the pointer and ensures it is set before calling any driver callback that includes a struct ah_attr callback, allowing future patches to adjust both the drivers and the callers to use sgid_attr instead of sgid_index. Signed-off-by: Jason Gunthorpe Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky commit fb51eecaa523c909cdc6240d3e9b8bfc74e7a888 Author: Parav Pandit Date: Wed Jun 13 10:22:02 2018 +0300 IB: Ensure that all rdma_ah_attr's are zero initialized Since we are adding some new fields to this structure it is safest if all users reliably initialize the struct to zero. Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit 0c271c433ca2f481ccf5e9a5645a2ec071188c19 Author: Matthew Wilcox Date: Fri Jun 8 10:42:17 2018 -0700 IB/mad: Agent registration is process context only Document this (it's implicitly true due to sleeping operations already in use in both registration and deregistration). Use this fact to use spin_lock_irq instead of spin_lock_irqsave. This improves performance slightly. Signed-off-by: Matthew Wilcox Signed-off-by: Jason Gunthorpe commit 7f3ee8e030d851fdb0eace00cc5ceb294238c1b8 Author: Jason Gunthorpe Date: Mon Jun 11 20:56:50 2018 -0600 IB/rxe: Do not hide uABI stuff in memcpy struct rxe_global_route and struct ib_global_route are not the same thing and should not be memcpy'd over each other, do a member by member copy instead. This allows the layout of the in-kernel struct ib_global_route to be changed without breaking rxe. Reviewed-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit aaf5e003b1c454c5722bc4ea9dfd3506c57d36a9 Author: Shiraz Saleem Date: Fri Jun 1 12:18:36 2018 -0500 i40iw: Reorganize acquire/release of locks in i40iw_manage_apbvt Commit f43c00c04bbf ("i40iw: Extend port reuse support for listeners") introduces a sparse warning: include/linux/spinlock.h:365:9: sparse: context imbalance in 'i40iw_manage_apbvt' - unexpected unlock Fix this by reorganizing the acquire/release of locks in i40iw_manage_apbvt and add a new function i40iw_cqp_manage_abvpt_cmd to perform the CQP command. Also, use __clear_bit and __test_and_set_bit as we do not need atomic versions. Fixes: f43c00c04bbf ("i40iw: Extend port reuse support for listeners") Suggested-by: Jason Gunthorpe Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit de7498147d0053273fd3dcf85ba20babb9ef9725 Author: Leon Romanovsky Date: Tue Jun 5 07:55:02 2018 +0300 RDMA/uverbs: Refactor flow_resources_alloc() function Simplify the flow_resources_alloc() function call by reducing number of goto statements. Reviewed-by: Michael J. Ruhl Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit dd8028f1e912134f35698392652bc561ef0d9cb4 Author: Leon Romanovsky Date: Tue Jun 5 07:26:51 2018 +0300 RDMA/nldev: Return port capability flag for IB only Port capability flag represents IBTA PortInfo:CapabilityMask, but was mistakenly mixed with non-relevant fields. Return that information for IB only. Link: https://patchwork.kernel.org/patch/10386245/ Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 82f82ceb8e660322c642d1ea6f835756aa061b34 Author: Parav Pandit Date: Tue Jun 5 08:40:23 2018 +0300 IB/rxe: Use rdma GID API rxe_netdev_from_av can now be done by the core code directly from the gid_attrs, no need for a helper in the driver. ib_find_cached_gid_by_port can be switched to use the rdma version here as well. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1dfce294577120ec60399a64094ea00e4247103d Author: Parav Pandit Date: Tue Jun 5 08:40:22 2018 +0300 IB: Replace ib_query_gid/ib_get_cached_gid with rdma_query_gid If the gid_attr argument is NULL then the functions behave identically to rdma_query_gid. ib_query_gid just calls ib_get_cached_gid, so everything can be consolidated to one function. Now that all callers either use rdma_query_gid() or ib_get_cached_gid(), ib_query_gid() API is removed. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 83f6f8d29dd3079b278791ebf14e87802f91b6bc Author: Jason Gunthorpe Date: Tue Jun 5 08:40:21 2018 +0300 IB/core: Make rdma_find_gid_by_filter support all protocols There is no reason to restrict this function to roce only these days, allow the filter function to be called on any protocol. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c3d71b69a75cbbc03c8f43571b003ddadd40d056 Author: Jason Gunthorpe Date: Tue Jun 5 08:40:20 2018 +0300 IB/core: Provide rdma_ versions of the gid cache API These versions are functionally similar but all return gid_attrs and related information via reference instead of via copy. The old API is preserved, implemented as wrappers around the new, until all callers can be converted. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ddb457c6993babbcdd41fca638b870d2a2fc3941 Author: Parav Pandit Date: Tue Jun 5 08:40:19 2018 +0300 net/smc: Replace ib_query_gid with rdma_get_gid_attr Push the copy of the gid_attr into the SMC code. This probably doesn't push it far enough, as it looks like the conn->lgr should potentially hold the reference for its lifetime. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 77e786fcbe2ecdac57ced610260ffb1f7cfeed00 Author: Parav Pandit Date: Tue Jun 5 08:40:18 2018 +0300 IB/core: Replace ib_query_gid with rdma_get_gid_attr These call sites have a use of ib_query_gid with a simple lifetime for the struct gid_attr pointer, with an easy conversion. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit bf399c2cadfa66d399d01d5a92a7bb0a112f1568 Author: Parav Pandit Date: Tue Jun 5 08:40:17 2018 +0300 IB/core: Introduce GID attribute get, put and hold APIs This patch introduces three APIs, rdma_get_gid_attr(), rdma_put_gid_attr(), and rdma_hold_gid_attr() which expose the reference counting for GID table entries to the entire stack. The kref counting is based on the struct ib_gid_attr pointer Later patches will convert more cache query function to return struct ib_gid_attrs. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f4df9a7c34d8f9e84af73ce187bcdf6fea65c4cb Author: Parav Pandit Date: Tue Jun 5 08:40:16 2018 +0300 RDMA: Use GID from the ib_gid_attr during the add_gid() callback Now that ib_gid_attr contains the GID, make use of that in the add_gid() callback functions for the provider drivers to simplify the add_gid() implementations. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b150c3862d21a4a9ce0f26d8067b9dcd41e2050c Author: Parav Pandit Date: Tue Jun 5 08:40:15 2018 +0300 IB/core: Introduce GID entry reference counts In order to be able to expose pointers to the ib_gid_attrs in the GID table we need to make it so the value of the pointer cannot be changed. Thus each GID table entry gets a unique piece of kref'd memory that is written only during initialization and remains constant for its lifetime. This eventually will allow the struct ib_gid_attrs to be returned without copy from many of query the APIs, but it also provides a way to track when all users of a HW table index go away. For roce we no longer allow an in-use HW table index to be re-used for a new an different entry. When a GID table entry needs to be removed it is hidden from the find API, but remains as a valid HW index and all ib_gid_attr points remain valid. The HW index is not relased until all users put the kref. Later patches will broadly replace the use of the sgid_index integer with the kref'd structure. Ultimately this will prevent security problems where the OS changes the properties of a HW GID table entry while an active user object is still using the entry. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f3f49e42c119f6fc7cd06ddae495915cf9f65654 Author: Clément Peron Date: Wed May 30 15:19:56 2018 +0200 ARM: debug: fix BCM2836 order entry Entries are sorted by their address value, except the BCM2836/KONA which are not in the proper order. Signed-off-by: Clément Peron Signed-off-by: Florian Fainelli commit 295898ba62161e33a0836df5df45ec3788dcaba8 Author: Clément Peron Date: Wed May 30 15:19:55 2018 +0200 ARM: debug: Add iProc UART3 debug addresses Broadcom iProc SoCs typically use the UART3 for debug/console, provide a known good location for that. Signed-off-by: Clément Peron Signed-off-by: Florian Fainelli commit a8eaad7b04eaab3df6b8db722d4418286815b46c Author: Arnd Bergmann Date: Mon Jun 18 17:41:01 2018 +0200 ALSA: line6: stop using get_seconds() The get_seconds() function is deprecated because it truncates the timestamp to 32 bits, so all users should change to ktime_get_seconds() or ktime_get_real_seconds(). The firmware interface for passing the timestamp is also limited to 32 bits, so this patch only has the cosmetic effect of avoiding the old interface. Signed-off-by: Arnd Bergmann Signed-off-by: Takashi Iwai commit a753af301c616cd51dedb3b5a8b3ba6cac3e58b8 Author: Stefan Agner Date: Sun Jun 17 15:46:49 2018 +0200 ALSA: ctxfi: use enum type CT_SUM_CTL where appropriate Currently a variable of type enum CT_AMIXER_CTL is used for enum CT_SUM_CTL values. This leads to warnings when using clang: sound/pci/ctxfi/ctmixer.c:945:32: warning: implicit conversion from enumeration type 'enum CT_SUM_CTL' to different enumeration type 'enum CT_AMIXER_CTL' [-Wenum-conversion] for (i = AMIXER_MASTER_F, j = SUM_IN_F; ~ ^~~~~~~~ sound/pci/ctxfi/ctmixer.c:975:29: warning: implicit conversion from enumeration type 'enum CT_SUM_CTL' to different enumeration type 'enum CT_AMIXER_CTL' [-Wenum-conversion] for (i = AMIXER_PCM_F, j = SUM_IN_F; i <= AMIXER_PCM_S; i++, j++) { ~ ^~~~~~~~ Introduce enum CT_SUM_CTL k and it instead. Signed-off-by: Stefan Agner Signed-off-by: Takashi Iwai commit 01655193c2da12510af8a8b66b56da5e13ce1f91 Author: Stefan Agner Date: Sun Jun 17 15:46:29 2018 +0200 ALSA: ice1724: remove unused array This fixes a warning seen with clang: sound/pci/ice1712/prodigy_hifi.c:321:28: warning: variable 'wm_vol' is not needed and will not be emitted [-Wunneeded-internal-declaration] static const unsigned char wm_vol[256] = { ^ Signed-off-by: Stefan Agner Signed-off-by: Takashi Iwai commit 8ae024497b3d68165e692d6ad5ba149cd070dac2 Author: Adam Ford Date: Fri May 18 15:33:35 2018 -0500 ARM: dts: da850-evm: Enable LCD and backlight When using the board files the LCD works, but not with the DT. This adds enables the original da850-evm to work with the same LCD in device tree mode. The EVM has a gpio for backlight regulator and a PWM for dimming the backlight. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, do not load the vpif driver. Signed-off-by: Adam Ford Signed-off-by: Sekhar Nori commit 4be9e673298fb4d204c6d4c782c800ec6d17d0c6 Author: Adam Ford Date: Fri May 18 15:43:39 2018 -0500 ARM: dts: da850-evm: Enable SATA port The DA850-EVM from Logic PD has a SATA port and the module that went with the kit supports it as well. This patch enables SATA controller. Signed-off-by: Adam Ford Signed-off-by: Sekhar Nori commit d9ca5d08c6dea23ce8f933d072ed615a9fde05e1 Author: Adam Ford Date: Fri May 18 13:09:53 2018 -0500 ARM: davinci_all_defconfig: set CONFIG_BACKLIGHT_PWM=m The da850-evm came with an LCD with a backlight tied to a pwm. This enables CONFIG_BACKLIGHT_PWM as a module so the PWM backlight can be used to maintain brightness control of the backlight. Signed-off-by: Adam Ford Signed-off-by: Sekhar Nori commit 89a7e2f752859c1a1696adf7b00b6ca9a5da2cda Author: Kyle Spiers Date: Fri Jun 1 13:20:16 2018 -0700 async_pq: Remove VLA usage In the quest to remove VLAs from the kernel[1], this adjusts the allocation of coefs and blocks to use the existing maximum values (with one new define, MAX_DISKS for coefs, and a reuse of the existing NDISKS for blocks). [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Kyle Spiers Reviewed-by: Kees Cook Reviewed-by: Dan Williams Signed-off-by: Vinod Koul commit cf85ec88701610f0de2e959ac447d9613462fbc7 Author: Vasily Averin Date: Sat Jun 9 16:18:16 2018 +0300 removed extra extern file_fdatawait_range Jeff added this extern twice in commit a823e4589e68 Fixes: a823e4589e68 ("mm: add file_fdatawait_range and file_write_and_wait") Signed-off-by: Vasily Averin Signed-off-by: Al Viro commit 4cf44d525548eaa49a65eeda2b87dfa76984fffb Merge: ce397d215ccd d5e5f6855aab Author: Kalle Valo Date: Mon Jun 18 16:48:15 2018 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for 4.19. Major changes: ath10k * support channel 173 * fix spectral scan for QCA9984 and QCA9888 chipsets ath6kl * add support for Dell Wireless 1537 commit 5ee4a7a6db8eb46aafdfea1f26cbdbbb4cef76b3 Author: Chris Wilson Date: Mon Jun 18 10:41:50 2018 +0100 drm/i915/execlists: Pull the w/a LRI emission into a helper Having the w/a registers as an open-coded table leaves a trap for the unwary; it would be easy to miss incrementing the LRI counter when adding a new register to the list. Instead, pull the list of registers into a table, so that we only need add new registers to that table rather than try and remember important side-effects of earlier chunks of GPU instructions. Suggested-by: Joonas Lahtinen Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180618094150.30895-1-chris@chris-wilson.co.uk commit bcc2661e3243fe75b91ec682de01e7cbedfbe7f9 Author: Chris Wilson Date: Mon Jun 18 08:31:35 2018 +0100 drm/i915: Only show debug for state changes when banning Since we trigger 10,000s of hangs and resets during selftesting, we emit many, many thousands of lines of useless debug messages. Reduce the frequency by only logging a change in state of a guilty context. Fixes: 14921f3cef85 ("drm/i915: Fix context ban and hang accounting for client") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180618073135.10849-1-chris@chris-wilson.co.uk commit 6456314ff1de246414a43e3132075b70b3e050ac Author: Sandy Huang Date: Tue Jun 12 15:20:28 2018 +0200 drm/rockchip: vop: fix irq disabled after vop driver probed The vop irq is shared between vop and iommu and irq probing in the iommu driver moved to the probe function recently. This can in some cases lead to a stall if the irq is triggered while the vop driver still has it disabled, but the vop irq handler gets called. But there is no real need to disable the irq, as the vop can simply also track its enabled state and ignore irqs in that case. For this we can simply check the power-domain state of the vop, similar to how the iommu driver does it. So remove the enable/disable handling and add appropriate condition to the irq handler. changes in v2: - move to just check the power-domain state - add clock handling changes in v3: - clarify comment to speak of runtime-pm not power-domain changes in v4: - address Marc's comments (clk-enable WARN_ON and style improvement) Fixes: d0b912bd4c23 ("iommu/rockchip: Request irqs in rk_iommu_probe()") Cc: stable@vger.kernel.org Signed-off-by: Sandy Huang Signed-off-by: Heiko Stuebner Tested-by: Ezequiel Garcia Reviewed-by: Tomasz Figa Reviewed-by: Marc Zyngier Link: https://patchwork.freedesktop.org/patch/msgid/20180612132028.27490-3-heiko@sntech.de commit e2810a7167df14c762e085fae5aade38425b71bf Author: Heiko Stuebner Date: Tue Jun 12 15:20:27 2018 +0200 drm/rockchip: vop: split out core clock enablement into separate functions Judging from the iommu code, both the hclk and aclk are necessary for register access. Split them off into separate functions from the regular vop enablement, so that we can use them elsewhere as well. Fixes: d0b912bd4c23 ("iommu/rockchip: Request irqs in rk_iommu_probe()") [prerequisite change for the actual fix] Cc: stable@vger.kernel.org Signed-off-by: Heiko Stuebner Tested-by: Ezequiel Garcia Reviewed-by: Tomasz Figa Link: https://patchwork.freedesktop.org/patch/msgid/20180612132028.27490-2-heiko@sntech.de commit 931c4e9a72ae91d59c5332ffb6812911a749da8e Author: Janek Kotas Date: Mon Jun 4 11:24:44 2018 +0000 spi: cadence: Change usleep_range() to udelay(), for atomic context The path "spi: cadence: Add usleep_range() for cdns_spi_fill_tx_fifo()" added a usleep_range() function call, which cannot be used in atomic context. However the cdns_spi_fill_tx_fifo() function can be called during an interrupt which may result in a kernel panic: BUG: scheduling while atomic: grep/561/0x00010002 Modules linked in: Preemption disabled at: [] wait_for_common+0x48/0x178 CPU: 0 PID: 561 Comm: grep Not tainted 4.17.0 #1 Hardware name: Cadence CSP (DT) Call trace: dump_backtrace+0x0/0x198 show_stack+0x14/0x20 dump_stack+0x8c/0xac __schedule_bug+0x6c/0xb8 __schedule+0x570/0x5d8 schedule+0x34/0x98 schedule_hrtimeout_range_clock+0x98/0x110 schedule_hrtimeout_range+0x10/0x18 usleep_range+0x64/0x98 cdns_spi_fill_tx_fifo+0x70/0xb0 cdns_spi_irq+0xd0/0xe0 __handle_irq_event_percpu+0x9c/0x128 handle_irq_event_percpu+0x34/0x88 handle_irq_event+0x48/0x78 handle_fasteoi_irq+0xbc/0x1b0 generic_handle_irq+0x24/0x38 __handle_domain_irq+0x84/0xf8 gic_handle_irq+0xc4/0x180 This patch replaces the function call with udelay() which can be used in an atomic context, like an interrupt. Signed-off-by: Jan Kotas Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit f12a0a3c4cc6f594d7c2ea361f2396ae5c518d2c Author: Hans de Goede Date: Sun Jun 3 15:42:32 2018 +0200 ASoC: Intel: bytcr_rt5640: Fix Acer Iconia 8 over-current detect threshold Change the over-current detect threshold on the Acer Iconia 8 from 2000ua to 1500uA, this fixes headset button presses not being detected. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 6cea3590820819049df5945136b8a5acd72ed0f8 Author: Hans de Goede Date: Sun Jun 3 15:42:31 2018 +0200 ASoC: Intel: bytcr_rt5640: Add quirk for the Nuvison/TMax TM800W560 tablet Add a quirk for the Nuvison/TMax TM800W560 tablet, this tablet uses IN1 for the internal mic rather then the default IN3 and it uses JD2 rather then JD1 for its not-inverted jack-detect switch. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 7c5dfd549617b87db8e891ff4ecaa4a582b6c4cc Author: Alexey Khoroshilov Date: Sat Jun 16 01:22:58 2018 +0300 ASoC: tegra: fix device_node refcounting tegra_rt5677_probe() gets a couple of device nodes with of_parse_phandle(), but there is no release of them. The patch adds the release to tegra_rt5677_remove() and to error handling paths in the probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Reviewed-by: Nicholas Mc Guire Signed-off-by: Mark Brown commit a4519526ebbd261e36425fa1c269515ee0648ab2 Author: Robert Jarzmik Date: Sun Jun 17 12:50:01 2018 +0200 ASoC: pxa: add devicetree support Add the devicetree support, so that the driver can be used in a devictree platform. Signed-off-by: Robert Jarzmik Signed-off-by: Mark Brown commit e2b35e468c89000cf3b8b5beb63fd73dfa8a5435 Author: Robert Jarzmik Date: Sun Jun 17 12:50:00 2018 +0200 ASoC: pxa: add binding for pxa2xx-ac97 audio complex This adds a binding for the Marvell PXA audio complex, available in pxa2xx and pxa3xx variants. Signed-off-by: Robert Jarzmik Signed-off-by: Mark Brown commit a7dc662c6a7b9209df600c64b16d33d72dbf56b1 Author: Stefan Agner Date: Sun Jun 17 15:45:29 2018 +0200 ASoC: codecs: PCM1789: unconditionally flush work Work is guaranteed to be initialized on exit. Drop the unnecessary if statement and always call flush_work. This fixes a warning seen with clang: sound/soc/codecs/pcm1789.c:265:13: warning: address of 'priv->work' will always evaluate to 'true' [-Wpointer-bool-conversion] if (&priv->work) ~~ ~~~~~~^~~~ Signed-off-by: Stefan Agner Signed-off-by: Mark Brown commit 0ddce71c21f03fd19867c4939d3ca710f37cdf1a Author: Bard Liao Date: Thu Jun 7 16:37:38 2018 +0800 ASoC: rt5682: add rt5682 codec driver This is the initial codec driver for rt5682. Signed-off-by: Bard Liao Signed-off-by: Mark Brown commit 53af408cd9f2d1c66bc081c1d82797bfe44af3e5 Author: Steven Eckhoff Date: Mon Jun 4 15:47:02 2018 -0500 ASoC: TSCS42xx: Add headphone auto switching Add headphone auto switching controls Signed-off-by: Steven Eckhoff Signed-off-by: Mark Brown commit 19d996cc3ad698379bcd8482dabe78abe3dc8d96 Author: Steven Eckhoff Date: Mon Jun 4 15:46:28 2018 -0500 ASoC: TSCS42xx: Remove Playback/Capture in names These aren't needed and some userspace apps don't work consistently with them. Remove Playback/Capture from control names Signed-off-by: Steven Eckhoff Signed-off-by: Mark Brown commit 58f7d470c85801f55bbae2d3c93fe1a3d34aa143 Author: Steven Eckhoff Date: Mon Jun 4 15:45:40 2018 -0500 ASoC: TSCS42xx: Add mic bias boost control Add mic bias boost control Signed-off-by: Steven Eckhoff Signed-off-by: Mark Brown commit 62624f72592b1d8e756e699cd6ade2be379f95a9 Author: Colin Ian King Date: Wed Jun 6 11:31:23 2018 +0100 ASoC: ak4458: make structure soc_codec_dev_ak4458 static const The structure soc_codec_dev_ak4458 is local to the source and do not need to be in global scope and can be const, make it static const. Cleans up sparse warnings: warning: symbol 'soc_codec_dev_ak4458' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Mark Brown commit e380be7c557c4ddb1cb71404c10e0bfb3daf4644 Author: Colin Ian King Date: Wed Jun 6 10:57:19 2018 +0100 ASoC: ak5558: make two structures static The structure ak5558_pm and soc_codec_dev_ak5558 are local to the source and do not need to be in global scope, so make them static. Also make soc_codec_dev_ak5558 static. Cleans up sparse warnings: warning: symbol 'ak5558_pm' was not declared. Should it be static? warning: symbol 'soc_codec_dev_ak5558' was not declared. Should it be static? Signed-off-by: Colin Ian King Reviewed-by: Daniel Baluta Signed-off-by: Mark Brown commit 510e419cb85798915c6426c496a164ec6328d1a7 Author: Colin Ian King Date: Wed Jun 6 10:35:04 2018 +0100 ASoC: twl6040: make pointer dmic_codec_dev static The pointer dmic_codec_dev is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: warning: symbol 'dmic_codec_dev' was not declared. Should it be static? Signed-off-by: Colin Ian King Acked-by: Peter Ujfalusi Signed-off-by: Mark Brown commit d5c4e972d512ae0b59108ca92b9b35bc5cf5c14e Author: Rohit Kumar Date: Wed Jun 6 14:25:24 2018 +0530 ASoC: qcom: apq8096: set card as device drvdata snd_soc_card is retrieved as device drvdata during unbind(). Set it as drvdata during bind() to avoid memory corruption during unbind(). Signed-off-by: Rohit kumar Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit a0d847c380ba47886fcca4168698eef51c69f109 Author: Kuninori Morimoto Date: Tue Jun 12 05:51:46 2018 +0000 ASoC: rsnd: add rsnd_daidrv_get() rsnd priv has many parameters. On __rsnd_dai_probe() it uses rsnd_rdai_get() to get rdai pointer, but is using priv->daidrv directly to get daidrvhv, but it is confusable for reader. This patch adds rsnd_daidrv_get() to get daidrv from priv. Now reader can understand that rdai and daidrv are related. Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown commit f6de35cc145fb55d842db94e74841ecd8382e012 Author: Katsuhiro Suzuki Date: Mon Jun 11 17:32:14 2018 +0900 ASoC: audio-graph-card: add hp and mic detect gpios same as simple-card This patch adds headphone and microphone jack detection gpios as same as simple-card driver. Signed-off-by: Katsuhiro Suzuki Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 8d1bd113a194407f9ad083403ea1cf92108edf5c Author: Katsuhiro Suzuki Date: Mon Jun 11 17:32:13 2018 +0900 ASoC: simple-card: move hp and mic detection to soc_card probe This patch moves headphone and microphone detection to probe() of snd_soc_card from init() of snd_soc_dai_link. This is because init() is called (and an input device /dev/input/eventX is created too) twice or above if simple card has two or more DAI links. Signed-off-by: Katsuhiro Suzuki Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 62c2c9fcac4341d306dda4cf400b77e7e124480a Author: Katsuhiro Suzuki Date: Mon Jun 11 17:32:12 2018 +0900 ASoC: simple-card-utils: move hp and mic detect gpios from simple-card This patch moves headphone and microphone jack detection gpios from simple-card driver. It is preparing for using this feature from other drivers. Signed-off-by: Katsuhiro Suzuki Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown commit d5a1826c32fa2ec2b161a89df904c6977f7ec44c Author: Hans de Goede Date: Fri Jun 8 10:19:25 2018 +0200 ASoC: Intel: bytcr_rt5640: Add quirk for the Chuwi Vi10 tablet Add a quirk for the Chuwi Vi10 tablet, this tablet uses IN1 for the internal mic rather then the default IN3 and it uses JD2 rather then JD1 for its jack-detect switch. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 4f29b663c08d369fe320a148179996c94cf7d01b Author: Geert Uytterhoeven Date: Thu Jun 7 15:50:48 2018 +0200 ASoC: rt1305: Use ULL suffixes for 64-bit constants With gcc 4.1.2: sound/soc/codecs/rt1305.c: In function ‘rt1305_calibrate’: sound/soc/codecs/rt1305.c:1069: warning: integer constant is too large for ‘long’ type sound/soc/codecs/rt1305.c:1086: warning: integer constant is too large for ‘long’ type Add the missing "ULL" suffixes to fix this. Fixes: 29bc643ddd7efb74 ("ASoC: rt1305: Add RT1305/RT1306 amplifier driver") Signed-off-by: Geert Uytterhoeven Signed-off-by: Mark Brown commit 75b31192fe6ad20b42276b20ee3bdf1493216d63 Author: Jianqun Xu Date: Fri Jun 8 16:31:09 2018 +0800 ASoC: rockchip: add config for rockchip dmaengine pcm register This patch makes the rockchip i2s pcm configurable by adding rockchip pcm config for devm_snd_dmaengine_pcm_register. Signed-off-by: Jianqun Xu Signed-off-by: Mark Brown commit a56df73ba5960848f60f609c68770d2638bf1dd5 Author: Alexey Khoroshilov Date: Sun Jun 10 01:20:54 2018 +0300 ASoC: rockchip: put device_node on remove snd_rk_mc_probe() gets a couple of device nodes with of_parse_phandle(), but there is no release of them. The patch adds remove handler and proper error handling in the probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: Mark Brown commit 187e01d0d56d1fd682dfaafb0b45d332abec6387 Author: olivier moysan Date: Mon Jun 11 17:13:59 2018 +0200 ASoC: stm32: sai: add iec958 controls support Add support of iec958 controls for STM32 SAI. Signed-off-by: Olivier Moysan Signed-off-by: Mark Brown commit 08ba7ae35b15cd13b965d5fd5a835e0a0cb803e6 Author: Geert Uytterhoeven Date: Wed Jun 13 10:41:15 2018 +0200 spi: sh-msiof: Make sure all DMA operations have completed In case of a bi-directional transfer, receive DMA may complete in the rcar-dmac driver before transmit DMA, due to scheduling latencies. As the MSIOF driver waits for completion of the receive DMA only, it may submit the next transmit DMA request before the previous one has completed. Make the driver more robust by waiting for the completion of both receive and transmit DMA, when applicable. Based on a patch in the BSP by Ryo Kataoka. Signed-off-by: Geert Uytterhoeven Signed-off-by: Mark Brown commit 3e247b0fb540a9a503a71ef6b918a3443e49655f Author: Corentin Labbe Date: Thu Jun 7 19:40:32 2018 +0000 spi: remove unused adi_spi3.h header include/linux/spi/adi_spi3.h is unused since commit 47838669de9d ("spi: remove blackfin related host drivers") Finish the cleaning by removing it. Signed-off-by: Corentin Labbe Signed-off-by: Mark Brown commit 02f361f5fdfb7bc24fcd686ae581114038eacbdd Author: Jani Nikula Date: Tue Jun 12 12:19:35 2018 +0300 drm/i915/lspcon: switch to kernel unsigned int types We have fairly mixed uintN_t vs. uN usage throughout the driver, but try to stick to kernel types at least where it's more prevalent. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1e132575785d9b615208eb60ee5e388df5991172.1528794959.git.jani.nikula@intel.com commit c25004964c5a8a0ee7b749bf969b3621dcaf2597 Author: Jani Nikula Date: Tue Jun 12 12:19:34 2018 +0300 drm/i915/audio: switch to kernel unsigned int types We have fairly mixed uintN_t vs. uN usage throughout the driver, but try to stick to kernel types at least where it's more prevalent. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/808b06e1f0a95a4ee892553abf11fdbc30025571.1528794959.git.jani.nikula@intel.com commit fd620bf92a609315241fa5440d336ef17ea76550 Author: Jani Nikula Date: Tue Jun 12 12:19:33 2018 +0300 drm/i915/backlight: switch to kernel unsigned int types We have fairly mixed uintN_t vs. uN usage throughout the driver, but try to stick to kernel types at least where it's more prevalent. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/e68c3f16738eb3ab9f276d797f20326ed6d15848.1528794959.git.jani.nikula@intel.com commit accb1eb57196adcdd47efc7ded32f356ed396b6c Author: Jani Nikula Date: Tue Jun 12 12:56:21 2018 +0300 drm/i915/dvo: switch to kernel unsigned int types We have fairly mixed uintN_t vs. uN usage throughout the driver, but try to stick to kernel types at least where it's more prevalent. v2: fix checkpatch warning on indentation Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180612095621.21101-1-jani.nikula@intel.com commit 93383b5705e689451fff99f2a6048750104982a3 Author: Jani Nikula Date: Tue Jun 12 12:19:31 2018 +0300 drm/i915/uncore: switch to kernel unsigned int types We have fairly mixed uintN_t vs. uN usage throughout the driver, but try to stick to kernel types at least where it's more prevalent. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/4af5f30fc9665d1bed1eed09e7f749737749d739.1528794959.git.jani.nikula@intel.com commit faa087c476a3bc6bbbb8600043eb53733233e7c5 Author: Jani Nikula Date: Tue Jun 12 12:19:30 2018 +0300 drm/i915/hdmi: switch to kernel unsigned int types We have fairly mixed uintN_t vs. uN usage throughout the driver, but try to stick to kernel types at least where it's more prevalent. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/d8b79de3d52e1fcaeabf3abfbb2ed99c4397ff2b.1528794959.git.jani.nikula@intel.com commit 0ede01418854664526541eed7164c2e77df1646c Author: Jani Nikula Date: Tue Jun 12 12:19:29 2018 +0300 drm/i915/vbt: switch to kernel unsigned int types We have fairly mixed uintN_t vs. uN usage throughout the driver, but try to stick to kernel types at least where it's more prevalent. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/ed5de29c280797b20eb625d52592dcbba8326684.1528794959.git.jani.nikula@intel.com commit 6e56e5d04191aa20e08430dcb203c081fa247e93 Author: Agrawal, Akshu Date: Thu Jun 7 14:48:43 2018 +0800 ASoC: AMD: Add NULL pointer check Fix crash in those platforms whose machine driver does not expose platform_info. For those platforms we rely on default value and select I2SSP channel. Signed-off-by: Akshu Agrawal Signed-off-by: Mark Brown commit 203cdf51f28820bee7893b4be392847418e6f4ec Author: Kuninori Morimoto Date: Tue Jun 12 05:52:17 2018 +0000 ASoC: rsnd: SSI parent cares SWSP bit SSICR has SWSP bit (= Serial WS Polarity) which decides WS pin 1st channel polarity (low or hi). This bit shouldn't exchange after running. Current SSI "parent" doesn't care SSICR, just controls clock only. Because of this behavior, if platform uses SSI0 as playback, SSI1 as capture, and if user starts capture -> playback order, SSI0 SSICR::SWSP bit exchanged 0 -> 1 during captureing, and it makes capture noise. This patch cares SSICR on SSI parent, too. Special thanks to Yokoyama-san Reported-by: Hiroyuki Yokoyama Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown commit 7cc90a5cadb1733d95d3c2bc147cbcf7843aa585 Author: Kuninori Morimoto Date: Tue Jun 12 05:52:00 2018 +0000 ASoC: rsnd: has .symmetric_rates if SSIs are sharing WS pin If SSIs are sharing WS pin, it should has .symmetric_rates. This patch sets it. Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown commit 6c974d4dfafe5e9ee754f2a6fba0eb1864f1649e Author: Johan Hovold Date: Tue Jun 12 14:43:35 2018 +0200 EDAC, i7core: Fix memleaks and use-after-free on probe and remove Make sure to free and deregister the addrmatch and chancounts devices allocated during probe in all error paths. Also fix use-after-free in a probe error path and in the remove success path where the devices were being put before before deregistration. Signed-off-by: Johan Hovold Cc: Mauro Carvalho Chehab Cc: linux-edac Fixes: 356f0a30860d ("i7core_edac: change the mem allocation scheme to make Documentation/kobject.txt happy") Link: http://lkml.kernel.org/r/20180612124335.6420-2-johan@kernel.org Signed-off-by: Borislav Petkov commit 7bd0c7ba62e8a9840f15fc4ff0122b29fe1b6413 Author: Matthias Kaehlcke Date: Thu Jun 7 16:51:38 2018 -0700 regulator: Fix typo in comment of struct regulator_linear_range regulator_map_linar_range() => regulator_map_linear_range() Signed-off-by: Matthias Kaehlcke Signed-off-by: Mark Brown commit 297101ab85841319aac2c7843ca755d650c1964f Author: Stefan Wahren Date: Fri Jun 15 13:44:53 2018 +0200 regulator: pfuze100: add pfuze3001 support This extends the pfuze100 driver with pfuze3001 support. Latest datasheet: https://www.nxp.com/docs/en/data-sheet/PF3001.pdf Signed-off-by: Robin Gong Signed-off-by: Stefan Wahren Signed-off-by: Mark Brown commit 5986f83efab0435918e58416f89a5d82adc11f5d Author: Stefan Wahren Date: Fri Jun 15 13:44:52 2018 +0200 regulator: pfuze100: add pfuze3001 support This patch extends binding according to support the pfuze3001 chip. Signed-off-by: Stefan Wahren Signed-off-by: Mark Brown commit 04433977b164c8ed0b65cd023c87c74da0fff2bf Author: Kuninori Morimoto Date: Tue Jun 12 05:59:27 2018 +0000 ASoC: sh7760-ac97: convert to SPDX identifiers Tidyup incoherence between MODULE_LICENSE and header license, too Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit ddfe227c0cbfb97b37afe123e014b9bc4df217b5 Author: Kuninori Morimoto Date: Tue Jun 12 05:59:11 2018 +0000 ASoC: dma-sh7760: convert to SPDX identifiers Tidyup incoherence between MODULE_LICENSE and header license, too Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 0026c551bacd9654eaa6ee8e4aa19d52730e74f4 Author: Kuninori Morimoto Date: Tue Jun 12 05:58:54 2018 +0000 ASoC: migor: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 1e0edd4deadbbacd3b35179c233efa26624ab2af Author: Kuninori Morimoto Date: Tue Jun 12 05:58:38 2018 +0000 ASoC: rsnd: convert to SPDX identifiers Tidyup incoherence between MODULE_LICENSE and header license, too Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 4e6fdaf1bd334e7e3ad9d6ef7aef4a433c770952 Author: Kuninori Morimoto Date: Tue Jun 12 05:58:07 2018 +0000 ASoC: siu: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 217bc8c898b24fa2098a375a575f6170cfac45a9 Author: Kuninori Morimoto Date: Tue Jun 12 05:57:47 2018 +0000 ASoC: ssi: convert to SPDX identifiers Tidyup incoherence between MODULE_LICENSE and header license, too Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit cb006e7b1712bb9507a218be7ed811ca8e65fc4d Author: Kuninori Morimoto Date: Tue Jun 12 05:57:13 2018 +0000 ASoC: hac: convert to SPDX identifiers Tidyup incoherence between MODULE_LICENSE and header license, too Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 134c875bff58ac988c64a1ea2a337acba1711d4b Author: Kuninori Morimoto Date: Tue Jun 12 05:56:51 2018 +0000 ASoC: fsi: convert to SPDX identifiers Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 503e79b793fea5de626db73accf8e8994bc4289d Author: Liam Girdwood Date: Thu Jun 14 20:53:59 2018 +0100 ASoC: topology: Add callback for DAPM route load/unload Add a callback fro clients for notification about DAPM route loading and unloading. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown commit c60b613a7097cff20fdd05e2891ce69542f0d5a3 Author: Liam Girdwood Date: Thu Jun 14 20:50:37 2018 +0100 ASoC: topology: Give more data to clients via callbacks Give topology clients more access to the topology data by passing index, pcm, link_config and dai_driver to clients. This allows clients to fully instantiate and track topology objects. The SOF driver is the first user of these new APIs and needs them to build component topology driver and FW objects. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown commit e01b4f624278d5efe5fb5da585ca371947b16680 Author: Liam Girdwood Date: Thu Jun 14 20:26:42 2018 +0100 ASoC: dapm: Fix potential DAI widget pointer deref when linking DAIs Sometime a component or topology may configure a DAI widget with no private data leading to a dev_dbg() dereferencne of this data. Fix this to check for non NULL private data and let users know if widget is missing DAI. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown commit f999d76a0011abfd814c8513a5e60a7eb9b9dac0 Author: Viresh Kumar Date: Fri May 25 16:01:56 2018 +0530 ARM: dts: rockchip: Add missing cooling device properties for CPUs on rk3288 The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Fix other missing properties (clocks, OPP, clock latency) as well to make it all work. Signed-off-by: Viresh Kumar [follow conversion to operating-points-v2] Signed-off-by: Heiko Stuebner commit ce76de984649bf85c81ee437eea282d10ba0dbb3 Author: Heiko Stuebner Date: Sat Jun 16 16:55:17 2018 +0200 ARM: dts: rockchip: convert rk3288 to operating-points-v2 Operating points need to be present in each cpu core using it, not only the first one. With operating-points-v1 this would require duplicating this table into each cpu node. With opp-v2 we can share the same table on all nodes. Signed-off-by: Heiko Stuebner Acked-by: Viresh Kumar commit 403cc7037f3858c3029fdf7629960516c7d3aced Author: Michel Pollet Date: Tue May 22 11:01:21 2018 +0100 dt-bindings: arm: Document the RZN1D-DB board This documents the RZ/N1 bindings for the RZN1D-DB board. Signed-off-by: Michel Pollet Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 83c05e98f732bfa77830631e8d4403c76cad9b31 Author: Dien Pham Date: Wed May 23 15:35:31 2018 +0200 arm64: defconfig: Enable BD9571MWV regulator The BD9571 PMIC is present on the Renesas Salvator-X(S) and R-Car Starter Kit Premier/Pro development boards. Signed-off-by: Dien Pham Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit c44e182e537492baaa37303fc0ee299222fce921 Author: Wolfram Sang Date: Thu Jun 14 10:56:06 2018 +0900 ARM: shmobile: convert to SPDX identifier Signed-off-by: Wolfram Sang Acked-by: Yoshihiro Shimoda Acked-by: Kuninori Morimoto Signed-off-by: Simon Horman commit 7e8a50df26f4e7003d09f7e8d1e57fbbb7ebb750 Author: Geert Uytterhoeven Date: Wed May 30 17:25:16 2018 +0200 soc: renesas: rcar-sysc: Drop legacy handling Now the R-Car platform code no longer supports DTBs lacking a SYSC device node in DT, all legacy handling can be dropped from the R-Car SYSC driver: - Make rcar_sysc_ch private to the driver, - Make rcar_sysc_power_{down,up}() static (they have been replaced by rcar_sysc_power_{down,up}_cpu()), - Remove the legacy wrapper rcar_sysc_init(), and the check for double initialization (only the early_initcall is left). Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 16acd53b1547d3dbe3eabef5e3356674eb957ae4 Author: Geert Uytterhoeven Date: Wed May 30 17:25:15 2018 +0200 ARM: shmobile: r8a7779: Remove explicit SYSC config and init If the R-Car H1 system controller is described in DT, the rcar-sysc driver configures SYSCIER and SYSCIMR based on the SoC-specific power area definitions in r8a7779-sysc. The platform code still passed this information to the rcar-sysc driver, for compatibility with old DTBs predating commit b2df3aa487395a1b ("ARM: dts: r8a7779: Add SYSC PM Domains") in v4.7. The time has come to drop backwards compatibility, and delegate everything to the DT enabled rcar-sysc driver. After stopping powering down secondary CPUs during early boot, there is no longer a need to force an early initialization of the rcar-sysc driver. It will be initialized in time for secondary CPU bringup by its early_initcall(). Hence all explicit SYSC configuration and initialization can be removed from the R-Car H1 platform code. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 9d65c891587ea9d0936551e432f34485c16bb71c Author: Geert Uytterhoeven Date: Wed May 30 17:25:14 2018 +0200 ARM: shmobile: r8a7779: Use rcar_sysc_power_{down,up}_cpu() The r8a7779 SMP code calls rcar_sysc_power_{down,up}() to control power to the SYSC power areas containing CPUs. This requires passing full CPU power area parameter blocks. Migrate the code to call the new rcar_sysc_power_{down,up}_cpu() helpers, which just take a CPU index, and use the SYSC power area definitions from the r8a7779-sysc driver. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit f2b1d2f94af887c91bb8a0cfb495e546331bc5ed Author: Geert Uytterhoeven Date: Wed May 30 17:25:13 2018 +0200 soc: renesas: rcar-sysc: Provide helpers to power up/down CPUs Provide helpers to control CPU power areas from platform code, taking just a CPU index. This will avoid having to pass full CPU power area parameter blocks, and thus duplicating information already provided by SoC-specific SYSC drivers. This will be used on R-Car H1 only. Later R-Car generations rely on APMU/RST for CPU power area control. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 62f55ce683e3675aa83cc3e912f070aef1baeff8 Author: Geert Uytterhoeven Date: Wed May 30 17:25:12 2018 +0200 ARM: shmobile: r8a7779: Stop powering down secondary CPUs during early boot At .smp_prepare_cpus() time, CPUs 1-3 are still powered down: - The bootloader doesn't enable CPUs 1-3, - Non-boot CPUs are disabled by kexec before starting the new kernel. Hence there is no need to try to power them down again, as it will fail silently with -EIO anyway. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 319b15df66f931544dace69eb6465fc0a6e05797 Author: Geert Uytterhoeven Date: Wed May 30 17:25:11 2018 +0200 ARM: shmobile: rcar-gen2: Remove explicit SYSC config and init If the R-Car system controller is described in DT, the rcar-sysc driver configures SYSCIER and SYSCIMR based on the SoC-specific power area definitions in r8a779*-sysc. The platform code still passed this information to the rcar-sysc driver, for compatibility with old R-Car H2 and M2-W DTBs predating commit 8574de861978d518 ("ARM: dts: r8a7791: Add SYSC PM Domains") in v4.7. The time has come to drop backwards compatibility, and delegate everything to the DT enabled rcar-sysc driver. After the removal of the legacy SMP fallbacks, which powered up the SCUs explicitly, there is no longer a need to force an early initialization of the rcar-sysc driver. It will be initialized in time for secondary CPU bringup by its early_initcall(). Hence all explicit SYSC configuration and initialization can be removed from the R-Car Gen2 platform code. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 3bf6d77388273c2d99756040b820dd71959e4587 Author: Geert Uytterhoeven Date: Wed May 30 17:15:28 2018 +0200 ARM: shmobile: apmu: Remove platsmp-apmu.h After the removal of the legacy SMP fallbacks, platsmp-apmu.h is no longer needed outside platsmp-apmu.c. Hence remove platsmp-apmu.h, and make the functions exported previously static. As the header file also provided forward declarations, the code in platsmp-apmu.c must be reshuffled. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 36a90c0553dd9c4d54a65f5387638ee55e4cf93c Author: Geert Uytterhoeven Date: Wed May 30 17:15:27 2018 +0200 ARM: shmobile: apmu: Remove obsolete shmobile_smp_apmu_prepare_cpus() After the removal of the legacy SMP fallbacks, there are no more users left of shmobile_smp_apmu_prepare_cpus(). Remove it, together with the legacy SMP config parser. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit fa6e9cb2aca1cdca1b85e5b19f9cda8aac78752b Author: Geert Uytterhoeven Date: Wed May 30 17:15:26 2018 +0200 ARM: shmobile: apmu: Move cpu_leave_lowpower() to SUSPEND section cpu_leave_lowpower() is used for suspend only, not for CPU hotplug. Hence move it from the HOTPLUG_CPU || SUSPEND section to the SUSPEND section. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit aa03319f28402fa7613d313b411490952b3f9bd4 Author: Geert Uytterhoeven Date: Fri May 18 14:48:54 2018 +0200 ARM: shmobile: Remove unused shmobile_smp_init_fallback_ops() shmobile_smp_init_fallback_ops() became unused after removing SoC-specific machine definitions that provided legacy SMP initialization fallbacks. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 1e90fea35b80cfe17718ceecf8898eb4b8188b45 Author: Geert Uytterhoeven Date: Fri May 18 14:48:53 2018 +0200 ARM: shmobile: r8a7791: Use common R-Car Gen2 machine definition Now r8a7791 no longer needs the SMP initialization fallback, it can use the common R-Car Gen2 machine definition, and the r8a7791-specific one can be removed. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 488aa3c045a7de12a39babec5196260b9f0e8881 Author: Geert Uytterhoeven Date: Fri May 18 14:48:52 2018 +0200 ARM: shmobile: r8a7791: Remove legacy SMP fallback code As of commit f89a51700d7ae0ef ("ARM: shmobile: r8a7791: Prioritize DT APMU support") in v4.8, non-DT enablement of SMP was left as a fallback for backwards compatibility with old DTBs. The time has come to drop backwards compatibility, hence remove the fallback code. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 78a9057fcc6341bb468e7ec5ac599f06e6a75547 Author: Geert Uytterhoeven Date: Fri May 18 14:48:51 2018 +0200 ARM: shmobile: r8a7790: Use common R-Car Gen2 machine definition Now r8a7790 no longer needs the SMP initialization fallback, it can use the common R-Car Gen2 machine definition, and the r8a7790-specific one can be removed. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit f13e47ee48e283e0b5aab8f899d438ae54b1d05d Author: Geert Uytterhoeven Date: Fri May 18 14:48:50 2018 +0200 ARM: shmobile: r8a7790: Remove legacy SMP fallback code As of commit f5d70b9cee2282ec ("ARM: shmobile: r8a7790: Prioritize DT APMU support") in v4.8, non-DT enablement of SMP was left as a fallback for backwards compatibility with old DTBs. The time has come to drop backwards compatibility, hence remove the fallback code. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 5058a96cb7e8dca97629c48084537fe5def8344f Author: Marek Vasut Date: Wed May 23 13:43:40 2018 +0200 ARM: dts: porter: Add missing PMIC nodes Add PMIC nodes to Porter and connect CPU DVFS supply. There is one DA9063L and one DA9210 on Porter, the only difference from the other boards is that DA9063L is at I2C address 0x5a rather than 0x58 . Signed-off-by: Marek Vasut Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 9882b5375df532acb2c2399a90d882461112e612 Author: Boris Brezillon Date: Fri Jun 1 12:03:25 2018 +0200 mtd: m25p80: Use SPI_MEM_OP_NO_DUMMY instead of SPI_MEM_OP_DUMMY(0, x) SPI_MEM_OP_DUMMY(0, x) means there's 0 dummy bytes to send, which is similar to SPI_MEM_OP_NO_DUMMY except it's less clear. Use SPI_MEM_OP_NO_DUMMY instead of SPI_MEM_OP_DUMMY(0, x) in m25p80_write(). Also stop updating op.dummy.buswidth since this value is only meaningful if you have dummy bytes. Reported-by: Cyrille Pitchen Signed-off-by: Boris Brezillon Acked-by: Marek Vasut commit 00a5762b45250ebde8920d3cf68ca3974a0253b2 Author: Boris Brezillon Date: Fri Jun 1 12:03:24 2018 +0200 mtd: m25p80: Remove unneeded m25p->command field The ->command field is no longer used, remove it. Signed-off-by: Boris Brezillon Acked-by: Marek Vasut commit 4fdd5b4e9aba5fbbc6d3072a5a87fa1d3f3fc030 Author: Chris Wilson Date: Sat Jun 16 21:25:34 2018 +0100 drm/i915: Fix fallout of fake reset along resume commit b2209e62a450 ("drm/i915/execlists: Reset the CSB head tracking on reset/sanitization") and commit 1288786b18f7 ("drm/i915: Move GEM sanitize from resume_early to resume") show the conflicting requirements on the code. We must reset the GPU before trashing live state on a fast resume (hibernation debug, or error paths), but we must only reset our state tracking iff the GPU is reset (or power cycled). This is tricky if we are disabling GPU reset to simulate broken hardware; we reset our state tracking but the GPU is left intact and recovers from its stale state. v2: Again without the assertion for forcewake, no longer required since commit b3ee09a4de33 ("drm/i915/ringbuffer: Fix context restore upon reset") as the contexts are reset from the CS ensuring everything is powered up. Fixes: b2209e62a450 ("drm/i915/execlists: Reset the CSB head tracking on reset/sanitization") Fixes: 1288786b18f7 ("drm/i915: Move GEM sanitize from resume_early to resume") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180616202534.18767-1-chris@chris-wilson.co.uk commit b77422f80337d363eed60c8c48db9cb6e33085c9 Author: Kenneth Graunke Date: Fri Jun 15 20:06:05 2018 +0100 drm/i915: Enable provoking vertex fix on Gen9 systems. The SF and clipper units mishandle the provoking vertex in some cases, which can cause misrendering with shaders that use flat shaded inputs. There are chicken bits in 3D_CHICKEN3 (for SF) and FF_SLICE_CHICKEN (for the clipper) that work around the issue. These registers are unfortunately not part of the logical context (even the power context), and so we must reload them every time we start executing in a context. Bugzilla: https://bugs.freedesktop.org/103047 Signed-off-by: Kenneth Graunke Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180615190605.16238-1-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen Cc: stable@vger.kernel.org commit 6557dd49369c2a9cfc21988bc0f793fa7ed54c01 Author: ankit patel Date: Fri Jun 15 13:42:13 2018 -0500 Staging: comedi: comedi_compat32.h: fixed missing or malformed SPDX-License-Identifier Fixed SPDX-License-Identifier comment on first line Signed-off-by: ankit patel Signed-off-by: Greg Kroah-Hartman commit aa4c8dc649a046e523880f3ef2b1addc7ce45c9b Author: ankit patel Date: Fri Jun 15 13:42:14 2018 -0500 Staging: comedi: comedi_pci.h: fixed missing or malformed SPDX-License-Identifier Fixed SPDX-License-Identifier comment on first line Signed-off-by: ankit patel Signed-off-by: Greg Kroah-Hartman commit 46c851a92872ae32810f774c6aa439fdc23bb5fa Author: ankit patel Date: Fri Jun 15 13:42:15 2018 -0500 Staging: comedi: comedi_pcmcia.h: fixed missing or malformed SPDX-License-Identifier Fixed SPDX-License-Identifier comment on first line Signed-off-by: ankit patel Signed-off-by: Greg Kroah-Hartman commit be932c686bb0a0cfe99c37a38c0675c106bfba1b Author: ankit patel Date: Fri Jun 15 13:42:16 2018 -0500 Staging: comedi: comedilib.h: fixed missing or malformed SPDX-License-Identifier Fixed SPDX-License-Identifier comment on first line Signed-off-by: ankit patel Signed-off-by: Greg Kroah-Hartman commit 50b1cf85b12d36891582cd56929ee83038f1405b Author: ankit patel Date: Fri Jun 15 13:42:12 2018 -0500 Staging: comedi: comedi.h: fixed missing or malformed SPDX-License-Identifier Fixed SPDX-License-Identifier comment on first line Signed-off-by: ankit patel Signed-off-by: Greg Kroah-Hartman commit eee222db377e19c708f821e2d9074f00979e2478 Author: Roman Kiryanov Date: Fri Jun 15 15:57:21 2018 -0700 staging: goldfish: Fix checkpatch CHECK in goldfish_audio.c Fix "CHECK: Alignment should match open parenthesis" Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 9f2d1e68cf4d641def734adaccfc3823d3575e6c Author: Jessica Yu Date: Tue Jun 5 10:22:52 2018 +0200 module: exclude SHN_UNDEF symbols from kallsyms api Livepatch modules are special in that we preserve their entire symbol tables in order to be able to apply relocations after module load. The unwanted side effect of this is that undefined (SHN_UNDEF) symbols of livepatch modules are accessible via the kallsyms api and this can confuse symbol resolution in livepatch (klp_find_object_symbol()) and cause subtle bugs in livepatch. Have the module kallsyms api skip over SHN_UNDEF symbols. These symbols are usually not available for normal modules anyway as we cut down their symbol tables to just the core (non-undefined) symbols, so this should really just affect livepatch modules. Note that this patch doesn't affect the display of undefined symbols in /proc/kallsyms. Reported-by: Josh Poimboeuf Tested-by: Josh Poimboeuf Reviewed-by: Josh Poimboeuf Signed-off-by: Jessica Yu commit 77ad0f2e34f849d4f85c30933c14ab742f617078 Author: Viresh Kumar Date: Tue Jun 5 10:17:48 2018 +0530 ARM: dts: sun8i-h3: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Fix other missing properties (clocks, clock-names) as well to make it all work. Signed-off-by: Viresh Kumar Signed-off-by: Maxime Ripard commit df35fbcfa3983c233f5fadaf8db18bfd10ac58b6 Author: Icenowy Zheng Date: Tue Jun 5 22:17:02 2018 -0700 arm64: dts: allwinner: add support for Pinebook Pinebook is a A64-based laptop produced by Pine64, with the following peripherals: USB: - Two external USB ports (one is directly connected to A64's OTG controller, the other is under a internal hub connected to the host-only controller.) - USB HID keyboard and touchpad connected to the internal hub. - USB UVC camera connected to the internal hub. Power-related: - A DC IN jack connected to AXP803's DCIN pin. - A Li-Polymer battery connected to AXP803's battery pins. Storage: - An eMMC by Foresee on the main board (in the product revision of the main board it's designed to be switchable). - An external MicroSD card slot. Display: - An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge. - A mini HDMI port. Misc: - A Hall sensor designed to detect the status of lid, connected to GPIO PL12. - A headphone jack connected to the SoC's internal codec. - A debug UART port muxed with headphone jack. This commit adds basical support for it. [vasily: squashed several commits into one, added simplefb node, added usbphy to ehci0 and ohci0 nodes and other cosmetic changes to dts] Signed-off-by: Icenowy Zheng Signed-off-by: Vasily Khoruzhick Signed-off-by: Maxime Ripard commit b5df280bb16345875c0c1baf1db5607fde005395 Author: Andre Przywara Date: Tue Jun 5 22:17:01 2018 -0700 arm64: dts: allwinner: a64: Add PWM controllers The Allwinner A64 SoC features two PWM controllers, which are fully compatible to the one used in the A13 and H3 chips. Add the nodes for the devices (one for the "normal" PWM, the other for the one in the CPUS domain) and the pins their outputs are connected to. On the A64 the "normal" PWM is muxed together with one of the MDIO pins used to communicate with the Ethernet PHY, so it won't be usable on many boards. But the Pinebook laptop uses this pin for controlling the LCD backlight. On Pine64 the CPUS PWM pin however is routed to the "RPi2" header, at the same location as the PWM pin on the RaspberryPi. Tested on Pinebook and Teres-I [vasily: fixed comment message as requested by Stefan Bruens, added default muxing options to pwm and r_pwm nodes] Signed-off-by: Andre Przywara Signed-off-by: Vasily Khoruzhick Tested-by: Harald Geyer Signed-off-by: Maxime Ripard commit 871b5352125c49a2d5f31db69baede43e003a532 Author: Icenowy Zheng Date: Tue Jun 5 22:17:00 2018 -0700 arm64: dts: allwinner: a64: add R_I2C controller Allwinner A64 has a I2C controller, which is in the R_ MMIO zone and has two groups of pinmuxes on PL bank, so it's called R_I2C. Add support for this I2C controller and the pinmux which doesn't conflict with RSB. Signed-off-by: Icenowy Zheng Signed-off-by: Vasily Khoruzhick Signed-off-by: Maxime Ripard commit 33c3d4eb67fe4e0c13fcf7f03ec99dc41f318865 Author: Jagan Teki Date: Fri Jun 1 23:05:27 2018 +0530 arm64: allwinner: a64-amarula-relic: Enable AP6330 WiFi support Enable AP6330 WiFi/BT combo chip on Amarula A64-Relic board: - WiFi SDIO interface is connected to MMC1 - WiFi WL-PMU-EN pin connected to gpio PL2: attach to mmc-pwrseq - WiFi WL-WAKE-AP pin connected to gpio PL3 - 32kHz external oscillator gate clock from RTC Signed-off-by: Jagan Teki Signed-off-by: Maxime Ripard commit e1a9a4745fd5e6e61d57803659cd54fbe757a172 Author: Jagan Teki Date: Fri Jun 1 23:05:26 2018 +0530 arm64: allwinner: a64: Add RTC clock to phandle 32kHz external oscillator Outside of SOC few chips need external clock source through RTC example Wifi chip. So RTC clock nodes to phandle 32kHz external oscillator. prefix rtc- with clock-output-names defined in dt-binding to avoid confusion with existing osc32k name. Signed-off-by: Jagan Teki Signed-off-by: Maxime Ripard commit f64f2e0ff2fe062421cc1fd3cc580fdee2c8b3e9 Author: Jagan Teki Date: Thu May 24 16:46:31 2018 +0530 arm64: allwinner: a64: Add Amarula A64-Relic initial support Amarula A64-Relic is Allwinner A64 based IoT device, which support - Allwinner A64 Cortex-A53 - Mali-400MP2 GPU - AXP803 PMIC - 1GB DDR3 RAM - 8GB eMMC - AP6330 Wifi/BLE - MIPI-DSI - CSI: OV5640 sensor - USB OTG - 12V DC power supply Signed-off-by: Jagan Teki Signed-off-by: Maxime Ripard commit 6461315eabc47d3da310c8c2641da42b071c2563 Author: Emmanuel Vadot Date: Mon May 21 13:54:26 2018 +0200 arm64: dts: allwinner: sun50i: h5: Add spi flash node for OrangePi PC2 The OrangePi PC2 have an mx25l1606e spi flash. Add a node for it. Signed-off-by: Emmanuel Vadot Signed-off-by: Maxime Ripard commit 4661c3afefe900ff7b5004aca0a2c927cfa37f3b Author: Emmanuel Vadot Date: Mon May 21 13:54:13 2018 +0200 arm64: dts: allwinner: sun50i: a64: Add spi flash node for sopine The Sopine and Pine64-LTS have a winbond w25q128 spi flash on spi0. Add a node for it. Signed-off-by: Emmanuel Vadot Signed-off-by: Maxime Ripard commit e3b742026b92a141b43560858b089921953a63de Author: Viresh Kumar Date: Tue Jun 5 10:17:49 2018 +0530 ARM: dts: sunxi: Add missing cooling device properties for CPUs The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Fix other missing properties (clocks, OPP, clock latency) as well to make it all work. Signed-off-by: Viresh Kumar Signed-off-by: Maxime Ripard commit ba1f665f161ce112a2703649317bfdc9b6521613 Author: Haneen Mohammed Date: Fri May 25 04:25:55 2018 +0300 drm: Add checks for atomic_[duplicate/destroy]_state with atomic drivers This patch add checks for atomic_[duplicate/destroy]_state of drm_[connector/crtc/plane]_funcs for atomic drivers in the relevant drm_*_init functions since these callback are mandatory for atomic drivers. Update the kerneldoc comments for those callbacks. Signed-off-by: Haneen Mohammed Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180525012555.GA8448@haneen-vb commit 65793f3cd93abf4ca1109f78e07c1b7193abdfec Author: Paul Moore Date: Wed Jun 13 16:26:46 2018 -0400 MAINTAINERS: remove the outdated "LINUX SECURITY MODULE (LSM) FRAMEWORK" entry This has been replaced with the "SECURITY SUBSYSTEM" entry. Signed-off-by: Paul Moore Signed-off-by: James Morris commit c969cb2f70aedf2159bc64073d012618506ef18f Author: Linus Walleij Date: Fri Jun 15 15:23:07 2018 +0200 pinctrl: Cut unused sysfs includes We simply don't use sysfs. Signed-off-by: Linus Walleij commit 96b0686dca33970c89f8cf37cf47aec94e6f10f5 Author: Stephen Boyd Date: Tue Jun 12 16:06:04 2018 -0700 pinctrl: qcom: spmi-gpio: Add pm8998 and pm8005 to binding Update the binding for two more PMICs supported by the same driver. While we're here, remove the duplicate pmi8994 lines because that support got merged twice. Cc: Rajendra Nayak Cc: Signed-off-by: Stephen Boyd Reviewed-by: Rob Herring Reviewed-by: Vivek Gautam Signed-off-by: Linus Walleij commit 7d71b5f4b2fb5b2a38794fe029d6245c86244de6 Author: Geert Uytterhoeven Date: Thu Jun 7 14:24:34 2018 +0200 pinctrl: pinctrl-single: Avoid divisions in context save/restore The divisions (and multiplications) can be avoided by changing the loops to use increments of mux_bytes instead of 1. While at it, remove the unneeded casts when assigning void pointers. This saves +100 bytes of kernel size on arm32/arm64. Signed-off-by: Geert Uytterhoeven Acked-by: Tony Lindgren Tested-by: Keerthy Reviewed-by: Keerthy Signed-off-by: Linus Walleij commit 7547b5969e069520d4cf23ba43b4ac889f8bd0ef Author: Jan Kundrát Date: Tue Feb 20 19:04:47 2018 +0100 pinctrl: mcp23s08: debugfs: Do not restore the INTF register Apart from the usual stuff, the debugfs code is currently also used for one non-obvious side effect. It attempts to check whether the chip's registers are still set to an expected value, and if not, re-initializes them. It seems that the driver has "always" done so. The code, however, also checks the INTF register which normally indicates which pins have caused the recent interrupt. That's a volatile register, and the datasheet says that writes are ignored in there. When I'm just cat-ing /sys/kernel/debug/gpio with no SPI traffic and no nosie on the GPIO lines, I'm not getting any warnings. Once I actually use these GPIOs and cat that file in parallel, I always seem to get a: mcp23s08 spi1.1: restoring reg 0x07 from 0x0000 to 0xffff (power-loss?) This might be a sign that I should not leave my unused inputs floating, but the code should not be checking a volatile register, anyway. Let's simply skip this last item in the iteration. I was also considering removing this enitre re-initialization because it's non-obvious, but the code survived various refactorings already and has sign-offs by people who know more than I do, so let's leave it as-is. For now :). Signed-off-by: Jan Kundrát Reviewed-by: Phil Reid Signed-off-by: Linus Walleij commit 6ff45566554ace49f8db45734dc6ce59e02487f5 Author: Jan Kundrát Date: Thu Feb 15 15:56:03 2018 +0100 pinctrl: mcp23s08: Kconfig: update to reflect supported features Commit d8f4494e70ae removed comments which described this limitation. The code supported interrupts even before. Also add some spacing so that the chip IDs are a bit more readable. Signed-off-by: Jan Kundrát Reviewed-by: Phil Reid Signed-off-by: Linus Walleij commit 90b39402e9f31c4aab48dc1a43d85a724065793f Author: Linus Walleij Date: Fri Jun 1 13:21:27 2018 +0200 gpio: Add API to explicitly name a consumer The GPIO (descriptor) API registers a "label" naming what is currently using the GPIO line. Typically this is taken from things like the device tree node, so "reset-gpios" will result in he line being labeled "reset". The technical effect is pretty much zero: the use is for debug and introspection, such as "lsgpio" and debugfs files. However sometimes the user want this cuddly feeling of listing all GPIO lines and seeing exactly what they are for and it gives a very fulfilling sense of control. Especially in the cases when the device tree node doesn't provide a good name, or anonymous GPIO lines assigned just to "gpios" in the device tree because the usage is implicit. For these cases it may be nice to be able to label the line directly and explicitly. Signed-off-by: Linus Walleij commit f3a049e784b337e9fa08f2f9046c955cc80af535 Author: Zhouyang Jia Date: Tue Jun 12 11:28:52 2018 +0800 gpio: max732x: add error handling for i2c_new_dummy When i2c_new_dummy fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling i2c_new_dummy. Signed-off-by: Zhouyang Jia Signed-off-by: Linus Walleij commit eb3744a2dd01cb07ce9f556d56d6fe451f0c313a Author: Keerthy Date: Wed Jun 13 09:10:37 2018 +0530 gpio: davinci: Do not assume continuous IRQ numbering Currently the driver assumes that the interrupts are continuous and does platform_get_irq only once and assumes the rest are continuous, instead call platform_get_irq for all the interrupts and store them in an array for later use. Signed-off-by: Keerthy Reviewed-by: Grygorii Strashko Signed-off-by: Linus Walleij commit c1d013a70f557e0d6db29398c955b2ec87db1ff8 Author: Keerthy Date: Wed Jun 13 09:10:36 2018 +0530 gpio: davinci: Shuffle IRQ resource fetching from DT to beginning of probe This is needed in case of PROBE_DEFER if IRQ resource is not yet ready. Signed-off-by: Keerthy Signed-off-by: Linus Walleij commit 29d43c22e480b150e00f1ac28a6653efca31cce4 Author: Sergei Shtylyov Date: Fri Jun 1 23:13:47 2018 +0300 gpio-rcar: document R8A77980 bindings Renesas R-Car V3H (R8A77980) SoC also has the R-Car gen3 compatible GPIO controllers, so document the SoC specific bindings. Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit 7279d9917560bbd0d82813d6bf00490a82c06783 Author: Nadav Amit Date: Mon Jun 4 06:58:14 2018 -0700 gpio: Fix wrong rounding in gpio-menz127 men_z127_debounce() tries to round up and down, but uses functions which are only suitable when the divider is a power of two, which is not the case. Use the appropriate ones. Found by static check. Compile tested. Fixes: f436bc2726c64 ("gpio: add driver for MEN 16Z127 GPIO controller") Signed-off-by: Nadav Amit Signed-off-by: Linus Walleij commit 6b293258cded9c8ee44cce4081d9170d6d1b5f5d Author: Benjamin Herrenschmidt Date: Tue Jun 12 15:19:11 2018 +1000 fsi: scom: Major overhaul This was too hard to split ... this adds a number of features to the SCOM user interface: - Support for indirect SCOMs - read()/write() interface now handle errors and retries - New ioctl() "raw" interface for use by debuggers Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Eddie James Reviewed-by: Alistair Popple commit f143304442f4b273f28343910f79d0221984b096 Author: Benjamin Herrenschmidt Date: Tue Jun 12 15:19:10 2018 +1000 fsi: scom: Add register definitions Add a few more register and bit definitions, also define and use SCOM_READ_CMD (which is 0 but it makes the code clearer) Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Eddie James commit 5a3c2f7656d0332eca310c74fb3641da0e45df17 Author: Benjamin Herrenschmidt Date: Tue Jun 12 15:19:09 2018 +1000 fsi: scom: Fixup endian annotations Use the proper annotated type __be32 and fixup the accessor used for get_scom() Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Eddie James commit bd21336457922280ac0eccdb3aeec14a5bf1391b Author: Benjamin Herrenschmidt Date: Tue Jun 12 15:19:08 2018 +1000 fsi: scom: Whitespace fixes No functional changes Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Eddie James commit 162c3946734d1f1950b413bbb3182d76d5be484b Author: Benjamin Herrenschmidt Date: Tue Jun 12 15:19:07 2018 +1000 fsi: scom: Add mutex around FSI2PIB accesses Otherwise, multiple clients can open the driver and attempt to access the PIB at the same time, thus clobbering each other in the process. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Eddie James commit 11454d6dc81813edb085b63b43b2e4df5e006218 Author: Joel Stanley Date: Mon Jun 18 13:13:35 2018 +0930 fsi: core: Fix sparse warnings fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:210:9: warning: cast to restricted __be32 fsi-core.c:606:15: warning: incorrect type in assignment (different base types) fsi-core.c:606:15: expected unsigned int [unsigned] [assigned] [usertype] smode fsi-core.c:606:15: got restricted __be32 [usertype] fsi-core.c:492:28: warning: expression using sizeof(void) fsi-core.c:520:29: warning: expression using sizeof(void) fsi-core.c:682:19: warning: cast to restricted __be32 fsi-core.c:682:19: warning: cast to restricted __be32 fsi-core.c:682:19: warning: cast to restricted __be32 fsi-core.c:682:19: warning: cast to restricted __be32 fsi-core.c:682:19: warning: cast to restricted __be32 fsi-core.c:682:19: warning: cast to restricted __be32 fsi-core.c:706:24: warning: incorrect type in assignment (different base types) fsi-core.c:706:24: expected unsigned int [unsigned] [usertype] llmode fsi-core.c:706:24: got restricted __be32 [usertype] Signed-off-by: Joel Stanley Signed-off-by: Benjamin Herrenschmidt commit fbdb5eac5ca64350333b0aa38c9dca6973d6d3a3 Author: Joel Stanley Date: Mon Jun 18 13:13:34 2018 +0930 fsi: master-hub: Fix sparse warnings fsi-master-hub.c:128:13: warning: incorrect type in assignment (different base types) fsi-master-hub.c:128:13: expected unsigned int [unsigned] [usertype] cmd fsi-master-hub.c:128:13: got restricted __be32 [usertype] fsi-master-hub.c:208:13: warning: incorrect type in assignment (different base types) fsi-master-hub.c:208:13: expected restricted __be32 [addressable] [assigned] [usertype] reg fsi-master-hub.c:208:13: got int Signed-off-by: Joel Stanley Signed-off-by: Benjamin Herrenschmidt commit 2992513877d9eada1443d2d70c2c89b77ac2cf2c Author: Joel Stanley Date: Mon Jun 18 13:13:33 2018 +0930 fsi: sbefifo: Fix sparse warnings fsi-sbefifo.c:547:58: warning: incorrect type in argument 2 (different base types) fsi-sbefifo.c:547:58: expected restricted __be32 [usertype] *word fsi-sbefifo.c:547:58: got unsigned int * fsi-sbefifo.c:635:16: warning: incorrect type in assignment (different base types) fsi-sbefifo.c:635:16: expected unsigned int [unsigned] fsi-sbefifo.c:635:16: got restricted __be32 [usertype] fsi-sbefifo.c:636:16: warning: incorrect type in assignment (different base types) fsi-sbefifo.c:636:16: expected unsigned int [unsigned] fsi-sbefifo.c:636:16: got restricted __be32 [usertype] Signed-off-by: Joel Stanley Signed-off-by: Benjamin Herrenschmidt commit 1c36cf912ad19c99592c7d089aed5d1c321a678a Author: Parav Pandit Date: Tue Jun 5 08:40:14 2018 +0300 IB/core: Store default GID property per-table instead of per-entry There are at max one or two default GIDs for RoCE. Instead of storing a default GID property for all the GIDs, store default GID indices as individual bit per table. This allows a future simplification to get rid of the GID property field. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a1a4caeebac95875eaf6c8afb5a9784566484b2e Author: Parav Pandit Date: Tue Jun 5 08:40:13 2018 +0300 IB/core: Do not set the gid type when reserving default entries When default GIDs are added, their gid type is set by ib_cache_gid_set_default_gid(). There is no need to set the gid type of a free GID entry during GID table initialization. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5b7b15aee641904ae269be9846610a3950cbd64c Author: J. Bruce Fields Date: Wed Jun 13 15:21:35 2018 -0400 nfsd: fix corrupted reply to badly ordered compound We're encoding a single op in the reply but leaving the number of ops zero, so the reply makes no sense. Somewhat academic as this isn't a case any real client will hit, though in theory perhaps that could change in a future protocol extension. Reviewed-by: Jeff Layton Signed-off-by: J. Bruce Fields commit 7a04cfda7dfa00173ab165577254ede83f81bf01 Author: J. Bruce Fields Date: Wed Jun 13 15:04:59 2018 -0400 nfsd: clarify check_op_ordering Document a couple things that confused me on a recent reading. Reviewed-by: Jeff Layton Signed-off-by: J. Bruce Fields commit 4a269efb6f8199b58aa77a1a40404877974feb26 Author: J. Bruce Fields Date: Fri Apr 13 17:34:35 2018 -0400 nfsd: update obselete comment referencing the BKL It's inode->i_lock that's now taken in setlease and break_lease, instead of the big kernel lock. Reviewed-by: Jeff Layton Signed-off-by: J. Bruce Fields commit ca0552f4641436a1dd5c49906690ee39ab5d43a3 Author: J. Bruce Fields Date: Wed Apr 11 17:01:53 2018 -0400 nfsd4: cleanup sessionid in nfsd4_destroy_session The name of this variable doesn't fit the type. And we only ever use one field of it. Reviewed-by: Jeff Layton Signed-off-by: J. Bruce Fields commit 665d507276004823e07596997d49d2705b4598a3 Author: J. Bruce Fields Date: Wed Apr 11 16:53:36 2018 -0400 nfsd4: less confusing nfsd4_compound_in_session Make the function prototype match the name a little better. Reviewed-by: Jeff Layton Signed-off-by: J. Bruce Fields commit a85857633b04d57f4524cca0a2bfaf87b2543f9f Author: J. Bruce Fields Date: Wed Apr 25 13:26:23 2018 -0400 nfsd4: support change_attr_type attribute The change attribute is what is used by clients to revalidate their caches. Our server may use i_version or ctime for that purpose. Those choices behave slightly differently, and it may be useful to the client to know which we're using. This attribute tells the client that. The Linux client doesn't yet use this attribute yet, though. Reviewed-by: Jeff Layton Signed-off-by: J. Bruce Fields commit 16945141c3567bb8561de3677de1ec657675bb15 Author: J. Bruce Fields Date: Wed Apr 25 14:34:11 2018 -0400 nfsd: fix NFSv4 time_delta attribute Currently we return the worst-case value of 1 second in the time delta attribute. That's not terribly useful. Instead, return a value calculated from the time granularity supported by the filesystem and the system clock. Reviewed-by: Jeff Layton Signed-off-by: J. Bruce Fields commit d6ebf5088f09472c1136cd506bdc27034a6763f8 Author: J. Bruce Fields Date: Fri Jun 8 12:33:17 2018 -0400 nfsd4: return default lease period I don't have a good rationale for the lease period, but 90 seconds seems long, and as long as we're allowing the server to extend the grace period up to double the lease period, let's half the default to 45. Signed-off-by: J. Bruce Fields commit 03f318ca652889a1aa407e7088b9a2f6a14ae374 Author: J. Bruce Fields Date: Fri Jun 8 12:28:47 2018 -0400 nfsd4: extend reclaim period for reclaiming clients If the client is only renewing state a little sooner than once a lease period, then it might not discover the server has restarted till close to the end of the grace period, and might run out of time to do the actual reclaim. Extend the grace period by a second each time we notice there are clients still trying to reclaim, up to a limit of another whole lease period. Signed-off-by: J. Bruce Fields commit 4708aa85d50cc6e962dfa8acf5ad4e0d290a21db Author: Johan Hovold Date: Tue Jun 12 14:43:34 2018 +0200 EDAC: Fix memleak in module init error path Make sure to use put_device() to free the initialised struct device so that resources managed by driver core also gets released in the event of a registration failure. Signed-off-by: Johan Hovold Cc: Denis Kirjanov Cc: Mauro Carvalho Chehab Cc: linux-edac Fixes: 2d56b109e3a5 ("EDAC: Handle error path in edac_mc_sysfs_init() properly") Link: http://lkml.kernel.org/r/20180612124335.6420-1-johan@kernel.org Signed-off-by: Borislav Petkov commit 9d72fe1ce81bc757ecb6d57b58e5fd95b9ad1b26 Author: Christophe JAILLET Date: Sun Jun 10 19:45:32 2018 +0200 EDAC, altera: Fix an error handling path in altr_s10_sdram_probe() If regmap_write() fails, we should release some resources as done in all the other error handling paths of the function. Signed-off-by: Christophe JAILLET Reviewed-by: Thor Thayer Cc: linux-edac Link: http://lkml.kernel.org/r/20180610174532.22071-1-christophe.jaillet@wanadoo.fr Fixes: e9918d7fafae ("EDAC, altera: Handle SDRAM Uncorrectable Errors on Stratix10") Signed-off-by: Borislav Petkov commit 4ee99cebd486238ac433da823b95cc5f8d8a6905 Author: Klaus Goger Date: Fri Dec 15 12:44:26 2017 +0100 arm64: dts: rockchip: use SPDX-License-Identifier Update all 64bit rockchip devicetree files to use SPDX-License-Identifiers. All devicetrees claim to be either GPL or X11 while the actual license text is MIT. Therefore we use MIT for the SPDX tag as X11 is clearly wrong. Signed-off-by: Klaus Goger Acked-by: Brian Norris Acked-by: Matthias Brugger Acked-by: Douglas Anderson Signed-off-by: Heiko Stuebner commit 0bac06df36abb3b74e146091ca51c8c6d70d69a6 Author: Viresh Kumar Date: Fri May 25 16:01:50 2018 +0530 ARM: dts: rockchip: Add missing cooling device properties for CPUs on rk322x The cooling device properties, like "#cooling-cells" and "dynamic-power-coefficient", should either be present for all the CPUs of a cluster or none. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device. Add such missing properties. Signed-off-by: Viresh Kumar Signed-off-by: Heiko Stuebner commit fce152a63d9597c108c10a0eb7a71f1edfc9d42e Author: Klaus Goger Date: Fri Dec 15 12:44:27 2017 +0100 ARM: dts: rockchip: use SPDX-License-Identifier Update all 32bit rockchip devicetree files to use SPDX-License-Identifiers. All files except rk3288-veyron-analog-audio.dtsi (which is GPL 2.0 only) claim to be GPL and X11 while the actual license text is MIT. Use the MIT SPDX tag for them. Signed-off-by: Klaus Goger Acked-by: Brian Norris Acked-by: Matthias Brugger Acked-by: Douglas Anderson Signed-off-by: Heiko Stuebner commit cddb86833615d9550d7b3a1b65b71071784dae70 Author: Heiko Stuebner Date: Sat Jun 16 16:20:04 2018 +0200 ARM: dts: rockchip: fix graph node unit address error from dtc The updated dtc emits a warning for the edp-panel of two rk3288 boards: Warning (graph_endpoint): /dp@ff970000/ports/port@1/endpoint: graph node unit address error, expected "0" Fix this by adding the necessary @0 to the endpoint node. Signed-off-by: Heiko Stuebner commit dcae11de22c9da83755d03f2631d7ddf4db00293 Author: Alexander Kurz Date: Tue May 29 06:20:21 2018 +0000 ARM: dts: imx6dl-riotboard: fix OTG regulator polarity USB OTG power is switched on when the GPIO is pulled low. Signed-off-by: Alexander Kurz Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e732f6d26eeab94a4988a556951bbc015b0c3d16 Author: Alexander Kurz Date: Tue May 29 06:20:20 2018 +0000 ARM: dts: imx6qdl-wandboard: enable USB OTG Enable USB OTG (dual-role) on the Wandboard. Note, that the USB_OTG_VBUS current is quite limited due to a 22R resistor in the power line. Hence, the overcurrent signal of 1A will never be triggered on this board. Signed-off-by: Alexander Kurz Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit d8d5f9dc40e7cf74a78f8e4164854b4eb5e45d8c Author: Alexander Kurz Date: Tue May 29 06:20:19 2018 +0000 ARM: dts: imx6dl-riotboard: remove regulators bus node To match the convention, move regulator-fixed nodes directly into the root node. Signed-off-by: Alexander Kurz Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9d1b8418b4773add2ec6ae29cfbd953cf07cc042 Author: Alexander Kurz Date: Tue May 29 06:20:18 2018 +0000 ARM: dts: imx6qdl-wandboard: remove regulators bus node To match the convention, move all regulator-fixed nodes directly into the root node. Signed-off-by: Alexander Kurz Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9235d1f85eb7628005aa86b17d7a311d53ae6967 Author: Clément Peron Date: Mon May 28 19:34:08 2018 +0200 ARM: imx: remove inexistant EPIT timer init i.MX EPIT timer has been removed but not the init function declaration. Signed-off-by: Clément Peron Signed-off-by: Shawn Guo commit bcf1477468143170ab98638a09162a3cac221367 Author: Andrey Smirnov Date: Fri May 25 19:12:38 2018 -0700 ARM: dts: imx51-zii-rdu1: Make sure SD1_WP is low Make sure that MX51_PAD_GPIO1_1 does not remain configure as ALT0/SD1_WP (it is out of reset). This is needed because of external pull-up resistor attached to that pad that, when left unchanged, will drive SD1_WP high preventing eSDHC1/eMMC from working correctly. To fix that add a pinmux configuration line configureing the pad to function as a GPIO. While we are at it, add a corresponding output-high GPIO hog in an effort to minimize current consumption. Cc: Nikita Yushchenko Cc: Fabio Estevam Cc: Lucas Stach Cc: Chris Healy Cc: Rob Herring Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Tested-By: Nikita Yushchenko Signed-off-by: Shawn Guo commit 6e21e4c215a6e088c0d49fc107fd56361b1fdf22 Author: Nikita Yushchenko Date: Thu May 17 22:19:23 2018 +0300 ARM: dts: imx51-zii-rdu1: add rave-sp subdevices This adds rave-sp powerbutton and backlight devices to RDU1 device tree. Signed-off-by: Nikita Yushchenko Tested-by: Chris Healy Signed-off-by: Shawn Guo commit 3053339b17f8f3bf0e4f5350adb7097266cd6f1a Author: Joshua Lang Date: Mon Jun 4 14:08:22 2018 -0700 staging: goldfish: Clear audio read buffer status after each read The buffer_status field is interrupt updated. After every read request, the buffer_status read field should be reset so that on the next loop iteration we don't read a stale value and read data before the device is ready. Signed-off-by: Joshua Lang Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 06e526f49b7a8280c62710265b699254a7cf3344 Author: Yu Ning Date: Mon Jun 4 14:08:21 2018 -0700 staging: goldfish: Enable ACPI-based enumeration for goldfish audio Add an ACPI id to make goldfish audio to support ACPI enumeration. Signed-off-by: Yu Ning Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit a75647d1e72f0af686b19940b864f35b9be631d6 Author: Roman Kiryanov Date: Mon Jun 4 14:08:19 2018 -0700 staging: goldfish: Replace read and write macros with functions Functions are less error-prone and generate cleaner compilation. Signed-off-by: Roman Kiryanov Signed-off-by: Greg Kroah-Hartman commit 5df204016c36a175829e6579f01244a8e2351480 Author: Julia Lawall Date: Thu Jun 7 01:34:02 2018 +0200 staging: rtl8723bs: drop test The test selects between two identical values, so it doesn't look useful. It turns out that the tested expression can only be true anyway, so drop the test, the corresponding parameter, and the corresponding argument at the only call site. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1; @@ * e ? e1 : e1 // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman commit 91c458b435df86d733754b3d50d8a5d1848c51dc Author: Sabin Mihai Rapan Date: Sat Jun 2 11:04:14 2018 +0200 staging: rtlwifi: Fix "Alwyas"->"Always" Trivial fix to spelling mistake in comment text. Signed-off-by: Sabin Mihai Rapan Signed-off-by: Greg Kroah-Hartman commit 971f3f119d30ce3cdbe58de74768a445893f9d20 Author: Sabin Mihai Rapan Date: Sat Jun 2 11:04:13 2018 +0200 staging: rtlwifi: Fix "writen"->"written" Trivial fix to spelling mistake in comment text. Signed-off-by: Sabin Mihai Rapan Signed-off-by: Greg Kroah-Hartman commit dba1b8ac7391f056019e419c9ba4f76dcc46aa96 Author: Sabin Mihai Rapan Date: Sat Jun 2 11:04:12 2018 +0200 staging: rtlwifi: Fix "Trafic"->"Traffic" Trivial fix to spelling mistake in comment text. Signed-off-by: Sabin Mihai Rapan Signed-off-by: Greg Kroah-Hartman commit ca707dcadecff31ee5e1bda474018d68ae9c6fc1 Author: Colin Ian King Date: Wed Jun 6 09:06:00 2018 +0100 staging: vc04_services: make a couple of pointers static The pointers vchiq_dbg_dir and vchiq_dbg_clients are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: warning: symbol 'vchiq_dbg_dir' was not declared. Should it be static? warning: symbol 'vchiq_dbg_clients' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 1daddbc8dec56e3c656ade8e5e6ef20a1be68823 Author: Fabio Rafael da Rosa Date: Sun Jun 3 23:24:45 2018 -0300 staging: vboxvideo: Update driver to use drm_dev_register. The use of load and unload hooks is deprecated. DRM drivers should use drm_dev_alloc|drm_dev_init and drm_dev_register for initialization and publishing. Signed-off-by: Fabio Rafael da Rosa Reviewed-by: Nicholas Mc Guire Signed-off-by: Greg Kroah-Hartman commit 089a137ad23a7b970b2c05bdb25937b96eab1700 Author: Ajay Singh Date: Mon Jun 4 10:59:10 2018 +0530 staging: wilc1000: move 'txq_spinlock_flags' from 'wilc' structure to local variable Cleanup patch to remove 'txq_spinlock_flags' element in 'wilc' and used local variable 'flag' in wilc_wlan_txq_filter_dup_tcp_ack(). Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 42e4a3adb0e211f4c222cd9297095a51a78769e2 Author: Ajay Singh Date: Mon Jun 4 10:59:09 2018 +0530 staging: wilc1000: remove 'rxq_entries' from 'wilc' struct Removed unnecessary 'rxq_entries' element from 'wilc' struct, as its value is not used. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 6adc35d973018a13076b36e85a2774fdcc24608b Author: Ajay Singh Date: Mon Jun 4 10:59:08 2018 +0530 staging: wilc1000: use list_head to maintain 'rxq_entry_t elements in rx queue Make use of 'list_head' data structure to maintain the rx buffer queue. Modified wilc_wlan_rxq_add() to add the element at the tail by using list_head API and wilc_wlan_rxq_remove() to remove the element from head. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit 3d9241d652748cd94f333562da45e8bd85ff6a47 Author: Ajay Singh Date: Mon Jun 4 10:59:07 2018 +0530 staging: wilc1000: use list_head to maintain 'txq_entry_t' elements of tx queue Use list_head data structure for the doubly linked list instead of own implementation. Only 'txq_head' is required, so removed the txq_tail pointer from 'wilc' structure. Following functions are modified to provide data using list_head API's wilc_wlan_txq_remove() wilc_wlan_txq_remove_from_head() wilc_wlan_txq_add_to_tail() wilc_wlan_txq_add_to_head() wilc_wlan_txq_get_first() wilc_wlan_txq_get_next() Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea Signed-off-by: Greg Kroah-Hartman commit e986b667ea6a4af33e28997f950e4ff196ec8f36 Author: Yisheng Xie Date: Wed Jun 6 10:21:11 2018 +0800 Staging: gdm724x: use match_string() helper match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Cc: Greg Kroah-Hartman Cc: Quytelda Kahja Cc: devel@driverdev.osuosl.org Signed-off-by: Yisheng Xie Signed-off-by: Greg Kroah-Hartman commit 70ce2440e20833d1b08222749cba780291a66e30 Author: Anton Vasilyev Date: Wed Jun 13 20:34:43 2018 +0300 staging: rts5208: add error handling into rtsx_probe If rtsx_probe() fails to allocate dev->chip, then release_everything() will crash on uninitialized dev->cmnd_ready complete. Patch adds error handling into rtsx_probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev Signed-off-by: Greg Kroah-Hartman commit 3a29f43cc3160c3f5cde7b1779fc05ebe68a56e5 Author: Kyle Buzby Date: Sun Jun 10 22:09:30 2018 -0500 staging: clocking-wizard: prefer 'help' in Kconfig Fixes the checkpatch warning: WARNING: prefer 'help' over '---help---' for new help texts +config COMMON_CLK_XLNX_CLKWZRD Signed-off-by: Kyle Buzby Signed-off-by: Greg Kroah-Hartman commit e9d93154e59ebffdf536d40bee6001afd285daa2 Author: Kenneth Lu Date: Sun Jun 10 16:17:52 2018 +0800 staging: rtl8192u: remove redundant variables Clean up W=1 warning: variable set but not used. Signed-off-by: Kenneth Lu Signed-off-by: Greg Kroah-Hartman commit 8df6d28548918be9573ce0b7b7df29250716676d Author: John Whitmore Date: Fri Jun 8 14:01:37 2018 +0100 staging: rtl8192e: remove unnecessary parentheses - Coding Style Remove unneccessary parentheses, and removed unnecessary (void *) cast Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4b22ca814e700d5eec617bd3760d7044d097180b Author: John Whitmore Date: Wed Jun 6 12:40:02 2018 +0100 staging: rtl8192e: Optimise Comparison to NULL tests - Coding Style Change comparison to NULL to better adhere to coding standard. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 1247b2327762d6b4e32300b6ee15cc1f7458de26 Author: John Whitmore Date: Wed Jun 6 12:40:01 2018 +0100 staging: rtl8192e: Correct declaration of HTResetIOTSetting - Coding Style Declaration of function was spread over three lines. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 786fe3b545b0afae5a7a49fb702b14cfc57e1a48 Author: John Whitmore Date: Wed Jun 6 12:40:00 2018 +0100 staging: rtl8192e: Remove unrequired space at start of line - Coding Style Function HTIOTActIsDisableMCS14 contained spurious space at start of line. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 355654ef2c0e74f2b6bd3e5178b743e1c81259a0 Author: John Whitmore Date: Wed Jun 6 12:39:59 2018 +0100 staging: rtl8192e: Correct alignment of if statements - Coding Style Function HTIOTPeerDetermine used incorrect indentation in if statements. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 3218202de96fef499dfa3ec17e031119bff38901 Author: John Whitmore Date: Wed Jun 6 12:39:58 2018 +0100 staging: rtl8192e: Remove unnecessary return statements - Coding style Return statments from void functions are not required by the coding standard. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 4c53614f39431838674c6a9fbca4eedf9119f1ed Author: John Whitmore Date: Wed Jun 6 12:39:57 2018 +0100 staging: rtl8192e: Addition of prefered spacing - Coding style Added spaces around various operators, as preferred by coding style. Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 7695ff3084878aac6c7eec801cca6ea0a4735dda Author: John Whitmore Date: Wed Jun 6 12:39:56 2018 +0100 staging: rtl8192e: Add and remove blank lines - Coding style Simple addition & removal of blank lines as required Signed-off-by: John Whitmore Signed-off-by: Greg Kroah-Hartman commit 6de4ef65a8c6f53ce7eef06666410bc3b6e4b624 Author: Hugo Lefeuvre Date: Wed Jun 13 21:04:38 2018 -0400 staging: pi433: fix race condition in pi433_ioctl In the PI433_IOC_WR_TX_CFG case in pi433_ioctl, instance->tx_cfg is modified via copy_from_user(&instance->tx_cfg, argp, sizeof(struct pi433_tx_cfg))) without any kind of synchronization. In the case where two threads would execute this same command concurrently the tx_cfg field might enter in an inconsistent state. Additionally: if ioctl(PI433_IOC_WR_TX_CFG) and write() execute concurrently the tx config might be modified while it is being copied to the fifo, resulting in potential data corruption. Fix: Get instance->tx_cfg_lock before modifying tx config in the PI433_IOC_WR_TX_CFG case in pi433_ioctl. Also, do not copy data directly from user space to instance->tx_cfg. Instead use a temporary buffer allowing future checks for correctness of copied data and simpler code. Signed-off-by: Hugo Lefeuvre Signed-off-by: Greg Kroah-Hartman commit 0d6485282a2eb8839ecb98d4da2dc1c35aab7223 Author: Abdun Nihaal Date: Sat Jun 9 18:37:42 2018 +0530 staging: mt7621-pci: Fix coding style error This patch removes space after * to fix the following checkpatch error: ERROR: "foo * bar" should be "foo *bar" Signed-off-by: Abdun Nihaal Signed-off-by: Greg Kroah-Hartman commit 9c562d8411a54f6731cdc587c29968d9e8610c85 Author: Sankalp Negi Date: Sun Jun 3 00:07:31 2018 +0530 staging: mt7621-spi: Remove unnecessary braces {} from single statement if block. The patch fixes following checkpatch.pl issue: WARNING : braces {} are not necessary for single statement blocks Signed-off-by: Sankalp Negi Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 6e89217cdb28809a039dad9c5cb321d408ca2473 Author: Sankalp Negi Date: Sun Jun 3 00:07:30 2018 +0530 staging: mt7621-spi: Add a space before open paranthesis. The patch fixes following checkpatch.pl issue: ERROR : space required before the open parenthesis Signed-off-by: Sankalp Negi Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 6781e751049c0bb7ccd1f684ca73da5c92c01e48 Author: Sankalp Negi Date: Sun Jun 3 00:07:29 2018 +0530 staging: mt7621-spi: Use tabs for indentation instead of spaces. The patch fixes following checkpatch.pl issue: ERROR : code indent should use tabs where possible Signed-off-by: Sankalp Negi Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit b8a952784969fc0a5e25710fef7f26359b89d4ab Author: Sankalp Negi Date: Sun Jun 3 00:07:28 2018 +0530 staging: mt7621-spi: Fix line over 80 characters by refactoring. The patch fixes following checkpatch.pl issue: WARNING : line over 80 characters Signed-off-by: Sankalp Negi Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit d42fd96ac281c348e87b57b0bc73b28b426a9761 Author: Sankalp Negi Date: Sun Jun 3 00:07:27 2018 +0530 staging: mt7621-spi: Indent case labels and switch at the same level. The patch fixes following checkpatch.pl issue: ERROR : switch and case should be at the same indent Signed-off-by: Sankalp Negi Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 1112b5b1c1936b69e801b42e8a22a79eac836ba8 Author: NeilBrown Date: Thu Jun 7 08:04:21 2018 +1000 staging: mt7621-dts: convert to gpio-keys Now that gpio-interrupts work correctly, we can use gpio-keys instead of gpio-keys-polled for the single push-button on the gbpc-1. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 97738374a310b9116f9c33832737e517226d3722 Author: NeilBrown Date: Thu Jun 7 08:04:21 2018 +1000 staging: mt7621-dts: correct various clock frequencies. The MT7621 documentation says that the sys clock - also known as OCP clock for the Open Core Protocol - can be configured to 1/3 or 1/4 of the CPU clock. Testing on my hardware, using the fact that the SPI clock is based on the OCP clock and measuring transfer rates, shows a clock of a little over 200MHz with a CPU clock of 900MHz. So assume 1/4 is the default. Also, the nor-flash in the gbpc1 is documented as accepting 50MHz for request requests, and higher for other requests. So set maximum to 50MHz. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit bf732c6bff5b5767a1c2ec6495dccd76d71c05eb Author: NeilBrown Date: Thu Jun 7 08:04:21 2018 +1000 staging: mt7621-spi: revised half-duplex message handling The mt7621 SPI engine has a 32 byte buffer and the driver currently only allows 32-byte read requests and 36 bytes writes (there is a 4byte op/addr buffer). This is an unnecessary limitation. As the SPI clock is controlled by the host it is quite acceptable to send a larger message in multiple smaller transactions. As long as Chip Select is kept asserted the whole time, the SPI engine can be run multiple times for a single SPI message. This patch factors out the transaction logic and calls for each transfer in the message. A write transfer might leave bytes in the buffer to be combined with a following read transfer, as this is a common pattern. With this in place, we can remove the current max_transfer_size limit. In testing, this increases the read throughput for a NOR flash chip from 1.4MB/s to 2.3MB/s, a 50% improvement. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit a83834c1c9ba446f694c0bc29bce25687bf06582 Author: NeilBrown Date: Thu Jun 7 08:04:21 2018 +1000 staging: mt7621-spi: change mt7621_spi_wait_till_ready to take struct mt7621_spi All callers have a 'struct mt7621_spi' and that is all mt7621_spi_wait_till_ready() needs. So just pass it instead of the spi_device. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit c0f784ba92e051d0de33ca7e1fd192317cfdb738 Author: NeilBrown Date: Thu Jun 7 08:04:20 2018 +1000 staging: mt7621-pci: use rt_sysc_?32() to access system-control register. This driver currently has internal knowledge ofthe address of system-control registers and accesses them by dereferencing a constant pointer. It is cleaner to use rt_sysc_r32(), rt_sysc_w32(), rt_sysc_m32() which is a more standard interface. So change the defined names to offsets instead of pointers, and use these functions. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 456aec73799f6cd31d5162d0814f8c372acffed6 Author: Justin Skists Date: Mon Jun 4 10:52:12 2018 +0100 staging: speakup: refactor synths array to use a list The synths[] array is a collection of synths acting like a list. There is no need for synths to be an array, so refactor synths[] to use standard kernel list_head API, instead, and modify the usages to suit. As a side-effect, the maximum number of synths has also become redundant. Signed-off-by: Justin Skists Reviewed-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman commit 2665df51017b15119987913bfa39d02d71cb7232 Author: Chris Opperman Date: Wed Jun 13 19:14:35 2018 +0200 staging: comedi: Improved readability of function comedi_nsamples_left. Improve readability of comedi_nsamples_left: a) Reduce nesting by using more return statements. b) Declare variables scans_left and samples_left at start of function. c) Change type of scans_Left to unsigned long long to avoid cast. Signed-off-by: Chris Opperman Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit fbe1be81b2840f4f5a25405e92cf67b69bafe9c1 Author: Giulio Benetti Date: Tue Jun 12 16:54:09 2018 +0200 staging: comedi: drivers: ni_mio_common: add names to function pointer parameters. Checkpatch.pl complains about packbits function pointer that lacks parameters name. Add parameter names to packbits function pointer. Signed-off-by: Giulio Benetti Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit d83301c8506cb448a82f52321e0898d202701517 Author: Giulio Benetti Date: Tue Jun 12 16:54:08 2018 +0200 staging: comedi: drivers: cb_pcimdda: fix warning on quoted string split across lines. Checkpatch.pl complains about "quoted string split across lines" for string in MODULE_DESCRIPTION(). Put string on only one line. Signed-off-by: Giulio Benetti Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit 6aa02093936898c4d8c485e702e5b61d9e39f408 Author: Giulio Benetti Date: Tue Jun 12 16:50:33 2018 +0200 staging: comedi: drivers: daqboard2000: make bool bit-field unsigned int bit-fields. Checkpatch complains on bool bitfields to be an int or u8/u16/u32 bitfield. Make bool bit-fields to be unsigned int bit-fields. Signed-off-by: Giulio Benetti Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit 904f9d4d3a83ef0eccaea5fe455f2c586c6f5cf0 Author: Giulio Benetti Date: Tue Jun 12 16:50:32 2018 +0200 staging: comedi: drivers: amplc_pci230: make bool bit-field unsigned int bit-fields. Checkpatch complains on bool bitfields to be an int or u8/u16/u32 bitfield. Make bool bit-fields to be unsigned int bit-fields. Signed-off-by: Giulio Benetti Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit 3164da7b9ccc0b50ce3593e21b7f4be36c9e8cef Author: Giulio Benetti Date: Tue Jun 12 16:50:31 2018 +0200 staging: comedi: drivers: amplc_dio200_common: make bool bit-field unsigned int bit-fields. Checkpatch complains on bool bitfields to be an int or u8/u16/u32 bitfield. Make bool bit-fields to be unsigned int bit-fields. Signed-off-by: Giulio Benetti Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit 46fb63b3a12af241269de34b4f9db2516e28a60a Author: Giulio Benetti Date: Tue Jun 12 16:50:30 2018 +0200 staging: comedi: drivers: amplc_dio200: make bool bit-field unsigned int bit-fields. Checkpatch complains on bool bitfields to be an int or u8/u16/u32 bitfield. Make bool bit-fields to be unsigned int bit-fields. Signed-off-by: Giulio Benetti Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit fd02c95fab8bc8ba63299d370f6d5437c62641d1 Author: Giulio Benetti Date: Tue Jun 12 16:50:29 2018 +0200 staging: comedi: comedidev: make bool bit-field unsigned int bit-fields. Checkpatch complains on bool bitfields to be an int or u8/u16/u32 bitfield. Make bool bit-fields to be unsigned int bit-fields. Signed-off-by: Giulio Benetti Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit b3c16227013f7f24429487cb501390c0f44fba8f Author: Giulio Benetti Date: Tue Jun 12 16:50:28 2018 +0200 staging: comedi: comedi_fops: make bool bit-field unsigned int bit-fields. Checkpatch complains on bool bitfields to be an int or u8/u16/u32 bitfield. Make bool bit-fields to be unsigned int bit-fields. Signed-off-by: Giulio Benetti Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit 52f2b531948db99c2dc5aaa8f81163c67921ed08 Author: Lukasz Majewski Date: Tue Jun 12 15:32:08 2018 +0200 ARM: dts: imx53: Add support for imx53 HSC/DDC boards from K+P This commit provides support for HSC and DDC boards from Kieback&Peter GmbH vendor. Signed-off-by: Lukasz Majewski Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 5ebc384a15e4a315d7b50576799653e2ec5402f7 Author: Daniel Mack Date: Wed May 23 10:30:12 2018 +0200 ARM: dts: imx6: make edt-ft5x06 a wakeup source for imx6 boards The touchscreen driver no longer configures the device as wakeup source by default. A "wakeup-source" property is needed. Signed-off-by: Daniel Mack Signed-off-by: Shawn Guo commit 26bd0e5964deb4ee326689911a089889734bd409 Author: Bai Ping Date: Fri May 25 15:42:07 2018 +0800 ARM: dts: imx: Add basic dts support for imx6sll EVK board Add dts file support for imx6sll EVK board. Signed-off-by: Bai Ping Reviewed-by: Rob Herring Acked-by: Dong Aisheng Signed-off-by: Shawn Guo commit 9f30b6b1a957b3d4cbfd97738ef2b02291aaf394 Author: Bai Ping Date: Fri May 25 15:42:06 2018 +0800 ARM: dts: imx: Add basic dtsi file for imx6sll Add dtsi file for imx6sll. Signed-off-by: Bai Ping Reviewed-by: Rob Herring Acked-by: Dong Aisheng Signed-off-by: Shawn Guo commit c474e9f2be9992861d926eea3e5d4fb393cd6e2a Author: Benson Leung Date: Tue Jun 5 14:05:29 2018 -0700 platform/chrome: chromeos_tbmc - fix SPDX identifier Original submission was GPLv2 only, so mark as GPL-2.0. Also restored some descriptive lines that were there before. Signed-off-by: Benson Leung commit c660abab5c7edbc9ec9cd3b7b8611e7bac01d0ac Author: Karim Eshapa Date: Tue Jun 12 18:48:38 2018 +0200 staging:iio:accel:adis16203: sign extend function rather code duplication Use sign_extend32 kernel function instead of code duplication. This function is also safe for 16 bits. Signed-off-by: Karim Eshapa Signed-off-by: Jonathan Cameron commit 0baf5cc971fc21ff55d75183dd1fe3afb505bff8 Author: Lin Huang Date: Tue May 22 16:53:41 2018 +0800 drm/rockchip: cnd-dp: adjust spdif register setting We use jitter bypass mode for spdif, so do not need to set jitter mode related bit in SPDIF_CTRL_ADDR register. But of course we need to keep the SPDIF_ENABLE bit. Signed-off-by: Chris Zhong Signed-off-by: Lin Huang Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/1526979222-32478-1-git-send-email-hl@rock-chips.com commit ebfb081edc8afd250a6d290c37481bfb2262e7cb Author: Julia Lawall Date: Wed May 23 21:07:16 2018 +0200 drm/rockchip: lvds: add missing of_node_put The device node iterators perform an of_node_get on each iteration, so a jump out of the loop requires an of_node_put. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression root,e; local idexpression child; iterator name for_each_child_of_node; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child + of_node_put(child); ? break; ... } ... when != child // Fixes: 34cc0aa25456 ("drm/rockchip: Add support for Rockchip Soc LVDS") Cc: stable@vger.kernel.org Signed-off-by: Julia Lawall Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr commit f677bd558de2e98b70b7f8c522024b26d2d1120d Author: Paulo Zanoni Date: Thu Jun 14 15:10:18 2018 -0700 drm/i915/icl: update VBT's child_device_config flags2 field Some bits from the flags2 field are going to be used in the next patches, so replace the whole-byte definition with the actual bits and document their versions. This patch is based on a patch by Animesh Manna. Cc: Animesh Manna Credits-to: Animesh Manna Reviewed-by: Rodrigo Vivi Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180614221018.19044-2-paulo.r.zanoni@intel.com commit 9378985eb05c486b32a61b69945df3297c6e854d Author: Paulo Zanoni Date: Thu Jun 14 15:10:17 2018 -0700 drm/i915/icl: implement DVFS for ICL ICL DVFS is almost the same as CNL, except for the CDCLK/DDICLK table. Implement it just like CNL does. References: commit 48469eced282 ("drm/i915: Use cdclk_state->voltage on CNL") References: commit 53e9bf5e8159 ("drm/i915: Adjust system agent voltage on CNL if required by DDI ports") Cc: Ville Syrjälä Reviewed-by: Rodrigo Vivi Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180614221018.19044-1-paulo.r.zanoni@intel.com commit e89ea355966182007712c396a3b8e78255f17c32 Author: Alexandru Gheorghe Date: Wed May 30 18:30:52 2018 +0100 drm/atomic: Set current atomic state in drm_private_state drm_private_state has a back pointer to the drm_atomic_state, however that was not initialized in drm_atomic_get_private_obj_state after duplication, as it is the case for other drm atomic getters Signed-off-by: Alexandru Gheorghe Link: https://patchwork.freedesktop.org/patch/msgid/1527701452-1934-1-git-send-email-alexandru-cosmin.gheorghe@arm.com Signed-off-by: Ville Syrjälä commit 6ab0edf4e79c42e3dc9c47e060a68d337af51be0 Author: Ville Syrjälä Date: Mon Jun 11 22:34:02 2018 +0300 drm: Print bad user modes Print out the modeline when we reject a bad user mode. Avoids having to guess why it was rejected. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180611193403.16118-2-ville.syrjala@linux.intel.com Reviewed-by: Harry Wentland commit b6f690ab237d801cbf881be4bc164062727053fd Author: Ville Syrjälä Date: Mon Jun 11 22:34:01 2018 +0300 drm/atomic: Improve debug messages Print the id/name of the object we're dealing with. Makes it easier to figure out what's going on. Also toss in a few extra debug prints that might be useful. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180611193403.16118-1-ville.syrjala@linux.intel.com Reviewed-by: Harry Wentland commit 1c0f1b3db7a647ef8962fb4186105e91710a3ade Author: Ville Syrjälä Date: Thu Jun 14 21:05:00 2018 +0300 drm/i915: s/IS_G4X && !IS_GM45/IS_G45/ We have IS_G45 these days. Let's use it instead of the 'IS_G4X && !IS_GM45' construct. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180614180500.2565-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit b2209e62a4507f6649233eaf0675de3ad86bd868 Author: Chris Wilson Date: Fri Jun 15 10:31:37 2018 +0100 drm/i915/execlists: Reset the CSB head tracking on reset/sanitization We can avoid the mmio read of the CSB pointers after reset based on the knowledge that the HW always start writing at entry 0 in the CSB buffer. We need to reset our CSB head tracking after GPU reset (and on sanitization after resume) so that we are expecting to read from entry 0, hence we reset our head tracking back to the entry before (the last entry in the ring). Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180615093137.14270-2-chris@chris-wilson.co.uk commit 042ed2dbe5b294e6c225e12d380062ee6adb3ac0 Author: Chris Wilson Date: Fri Jun 15 10:31:36 2018 +0100 drm/i915: Be irqsafe inside reset As we want to be able to call i915_reset_engine and co from a softirq or timer context, we need to be irqsafe at all times. So we have to forgo the simple spin_lock_irq for the full spin_lock_irqsave. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180615093137.14270-1-chris@chris-wilson.co.uk commit 85ee15d6a3d3c55e3e653426cc32e138ee515585 Author: Mikita Lipski Date: Mon May 28 10:08:30 2018 -0400 drm/amd/display: Do not skip FBC init in failsafe mode Initially FBC would be initialized if display's edid was correct and all the modes acquired from it, but n case when edid is corrupted or non-existant we must still initialize FBC. Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit e9522309efb31423a450c32f433dd95bfb8b5787 Author: Eric Bernstein Date: Fri May 18 10:49:33 2018 -0400 drm/amd/display: Add num_opp to resource_caps Number of OPPs to be instantiated is based on number of timing generators, not number of pipes. Signed-off-by: Eric Bernstein Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 12036586a368b8c949d4e6e57ae3b40c41daf17a Author: Eric Bernstein Date: Fri May 25 11:57:26 2018 -0400 drm/amd/display: Allow DP register double buffer Remove setting DP_DB_DISABLE to avoid issues when changing bit depth after vbios take over. Refactor code to perform single register update for both pixel encoding and component depth fields. Signed-off-by: Eric Bernstein Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit ce3f6e82249cccbbfd919ad30d256ec62d06b4af Author: Alvin lee Date: Fri May 18 14:14:38 2018 -0400 drm/amd/display: create sink_id in dc_sink structure to idenitify all sinks Signed-off-by: Alvin lee Reviewed-by: Jun Lei Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 74167ad60c04c45e991af59ee5c7f62aff5c4c38 Author: Vitaly Prosyak Date: Fri May 25 08:37:36 2018 -0500 drm/amd/display: Add new transfer type HWPWL It is used when curve register settings are generated by 'matlab', i.e. bypass color module calculation. Signed-off-by: Vitaly Prosyak Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 6aa57bb8e4d47b442c01f5cf361d7b0efe619f6c Author: Anthony Koo Date: Thu May 24 11:25:00 2018 -0400 drm/amd/display: Disable stats by default Signed-off-by: Anthony Koo Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit b73552323a5d089ab29342803f04fb32b0a0a2a5 Author: Krunoslav Kovac Date: Wed May 30 10:59:11 2018 -0400 drm/amd/display: Convert quotes to Ascii quotes Signed-off-by: Harry Wentland Signed-off-by: Krunoslav Kovac Reviewed-by: Anthony Koo Signed-off-by: Alex Deucher commit 6f0db2dc02def18ee6fb93f408a847077addb4fc Author: Krunoslav Kovac Date: Wed May 30 10:57:32 2018 -0400 drm/amd/display: Make it more clear when info frames affect DP or HDMI Signed-off-by: Harry Wentland Signed-off-by: Krunoslav Kovac Reviewed-by: Anthony Koo Signed-off-by: Alex Deucher commit 2cbe6d9be5a4ea5a6aff064a3bcca2ef92921993 Author: Krunoslav Kovac Date: Wed May 30 10:56:32 2018 -0400 drm/amd/display: Drop duplicate dc_stream_set_static_screen_events definition Signed-off-by: Harry Wentland Signed-off-by: Krunoslav Kovac Reviewed-by: Anthony Koo Signed-off-by: Alex Deucher commit a10dc97ab8e9b5560fc47d57d2048c7455774472 Author: Krunoslav Kovac Date: Thu May 17 14:50:12 2018 -0400 drm/amd/display: Add use_dynamic_meta flag to stream_state Signed-off-by: Krunoslav Kovac Reviewed-by: Anthony Koo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 973d42c79e99aedd767071407ce286bb7eefe202 Author: Harry Wentland Date: Wed May 9 11:35:21 2018 -0400 drm/amd/display: Move i2c and aux structs into dc_ddc_types.h We'd like to use some of them in dc_link_ddc and amdgpu_dm and should have them available in dc_ddc_types.h. Signed-off-by: Harry Wentland Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit b4f84bdf579eb654add9a4c257b97af499c23e03 Author: Eric Bernstein Date: Tue May 22 15:16:33 2018 -0400 drm/amd/display: Stream encoder update Update stream encoder based on feedback from HW team. Signed-off-by: Eric Bernstein Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 6e0ef9d85b99baeeea4b9c4a9777809cb0c6040a Author: Mikita Lipski Date: Thu May 17 15:44:20 2018 -0400 drm/amd/display: Write TEST_EDID_CHECKSUM_WRITE for EDID tests Extract edid's checksum and send it back for verification if EDID_TEST is requested. Also added a flag for EDID checksum write in TEST_RESPONSE structure, and simple spelling fix. Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 3b070c60ea511a0d103b39de3122d3bad0de45ab Author: Mikita Lipski Date: Tue May 22 15:55:43 2018 -0400 drm/amd/display: Drop to fail-safe mode if edid is bad Provide the connector with a single fail-safe mode of 640x480 for CTS tests instead of providing a list of possible base modes. Signed-off-by: Mikita Lipski Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 00553cf8116e041c75c6c201bdf6d4e006fcf956 Author: Andrey Grodzovsky Date: Wed Jun 13 16:01:38 2018 -0400 drm/amdgpu: Update function level documentation for GPUVM. Add documentation for missed parameters. Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit ab3ec8a1a9f1c785103f395e9502ab5804705134 Author: Michel Dänzer Date: Thu Jun 14 11:59:20 2018 +0200 drm/amdgpu: Restore :internal: for amdgpu_vm.c documentation This was accidentally dropped by the "drm/amdgpu: update documentation for amdgpu_irq.c v3" change, resulting in the GPUVM documentation body being included twice in the generated documentation. Trivial. Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit b1ddf5484727296f8812118a6042c76ebd1faff4 Author: Rex Zhu Date: Mon Jun 4 18:26:18 2018 +0800 drm/amdgpu: Get real power source to initizlize ac_power driver need to know the real power source to do some power related configuration when initialize. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit e1e36485e9f398be7207630d866810df485fbf34 Author: Rex Zhu Date: Mon Jun 4 18:12:31 2018 +0800 drm/amd/pp: Implement update_smc_table for CI. driver need to update uvd/vce smc table before enable uvd/vce dpm. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 600ae890be59910e65b75fe25a1b900d83c0329c Author: Rex Zhu Date: Mon Jun 4 16:39:38 2018 +0800 drm/amdgpu: Use real power source in powerplay instand of hardcode 1. move ac_power to struct pm from dpm, so can be shared with powerplay 2. remove power_source in powerplay, use adev->pm.ac_power instand. 3. update ac_power before dispatch power task. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit c5792d7776e61737af200bf6f0d15354b5a3d205 Author: Rex Zhu Date: Mon Jun 4 13:33:14 2018 +0800 drm/amd/pp: Remove SAMU support in powerplay As the SAMU ip was not supported in linux, so delete the SAMU support in powerplay on asics Bonarire/Hawwii/Tonga/Fiji/Polaris/vegam. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit dc85db256d47062955145264df5923f03b85b0c6 Author: Alex Deucher Date: Fri Jun 1 12:28:14 2018 -0500 drm/doc: Add amdgpu hwmon/power documentation (v2) Document the hwmon and power control interfaces exposed by the amdgpu driver. v2: use section rather than chapter for now Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit c8c5e569c5b0c9ad523c35497af2ae5788a29581 Author: Andrey Grodzovsky Date: Tue Jun 12 14:28:20 2018 -0400 drm/amdgpu: Consolidate visible vs. real vram check v2. Move all instnaces of this check into a function in amdgpu_gmc.h Rename the original function to a more proper name. v2: Add more places to cleanup. Reviewed-by: Christian König Signed-off-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 923ff76eb035b0de3725edd7c13cda3b068ba197 Author: Slava Abramov Date: Thu Jun 7 17:27:07 2018 -0400 drm/amdgpu: update documentation for amdgpu_irq.c v3 Add/update function level documentation and add reference to amdgpu_irq.c in amdgpu.rst v2: Added DOC comment Added more explanations for amdgpu_hotplug_work_func Properly formatted unused parameters Properly formatted return values Fixed usage of acronyms More consistent styling v3: Removed duplicate "not" Using '&' to refer to functions and types Signed-off-by: Slava Abramov Acked-by: Christian König Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 7fc48e5912795caf78b1e2fb86d5f6ee02fbdb8c Author: Andrey Grodzovsky Date: Mon Jun 11 11:11:24 2018 -0400 drm/amdgpu: Update function level documentation for GPUVM v3 Add/update function level documentation and add reference to amdgpu_vm.c in amdgpu.rst v2: Fix reference in rst file. Fix compilation warnings. Add space between function names and params list where it's missing. v3: Fix some funtion comments. Add formatted documentation to structs. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f4557923b5d3bd5aaa4177ea184c4389175cc92f Author: Slava Abramov Date: Wed Jun 13 10:50:31 2018 -0400 drm/amdgpu: fix typo in amdgpu_mn.c comments In doc comments for struct amdgpu_mn: destrution -> destruction Signed-off-by: Slava Abramov Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ad7f0b6334fe3cf52f2d79345791a4ef4547353f Author: Christian König Date: Tue Jun 5 11:47:43 2018 +0200 drm/amdgpu: fix documentation of amdgpu_mn.c v2 And wire it up as well. v2: improve the wording, fix label mismatch Signed-off-by: Christian König Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 528e083d85bd0306e056fe1bdfd05493ebbff9cc Author: Christian König Date: Wed Jun 13 14:55:20 2018 -0500 drm/amdgpu: rename rmn to amn in the MMU notifier code (v2) Just a copy&paste leftover from radeon. v2: rebase (Alex) Signed-off-by: Christian König Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit abea57d70e90b0c41b9a3b9d7b7d39ab81146e19 Author: Harry Wentland Date: Thu Jun 7 15:45:08 2018 -0400 drm/amdgpu: Add BRACKET_LAYOUT_ENUMs to ObjectID.h DC has an upcoming change that requires these to read the board layout. Signed-off-by: Harry Wentland Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 59d61be2229fcb8d52db6ba3f82658f501c06333 Author: Junwei Zhang Date: Tue Jun 12 13:57:45 2018 +0800 drm/amdgpu: remove unused parameter for va update Don't need validation list any more Signed-off-by: Junwei Zhang Reviewed-by: David Zhou Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 04ad26bbc41edea0529aed9a92e146e46b6efe5e Author: David Panariti Date: Tue May 22 14:25:49 2018 -0400 drm/amdgpu: Add plumbing for handling SQ EDC/ECC interrupts v2. SQ can generate interrupts and installs the ISR to handle the SQ interrupts. Add parsing SQ data in interrupt handler. v2: Remove CZ only limitation. Rebase. Signed-off-by: David Panariti Signed-off-by: Andrey Grodzovsky Reviewed-by: Nicolai Hähnle Signed-off-by: Alex Deucher commit 981658c67a97591ce03b5b94f7be9f5f92720e8d Author: David Panariti Date: Tue May 22 14:09:06 2018 -0400 drm/amdgpu: Add interrupt SQ source struct to amdgpu_gfx struct v2. SQ can generate interrupts on EDC/ECC errors and this struct controls how the interrupt is handled. The guts are filled in in the gf_v_.c files. v2: Rebase. Signed-off-by: David Panariti Reviewed-by: Nicolai Hähnle Signed-off-by: Alex Deucher commit 5a2f291343bc349aef45b9fdbe73332b933fa92b Author: David Panariti Date: Tue May 15 11:45:11 2018 -0400 drm/amdgpu: Added ISR for CP ECC/EDC interrupt v2. ISR will DRM_ERROR ECC error message. v2: Remove CZ only limitation. Rebase. Signed-off-by: David Panariti Signed-off-by: Andrey Grodzovsky Reviewed-by: Nicolai Hähnle Signed-off-by: Alex Deucher commit 8f4039fefd94a0ca2c61507975f6d47f9fc9943a Author: Shirish S Date: Fri Jun 8 10:15:42 2018 +0530 drm/amdgpu: change gfx8 ib test to use WB This patch is extends the usage of WB in gfx8's ib test which was originally implemented in the below upstream patch "ed9324a drm/amdgpu: change gfx9 ib test to use WB" For reference below are the reasons for switching to WB: 1)Because when doing IB test we don't want to involve KIQ health status affect, and since SCRATCH register access is go through KIQ that way GFX IB test would failed due to KIQ fail. 2)acccessing SCRATCH register cost much more time than WB method because SCRATCH register access runs through KIQ which at least could begin after GPU world switch back to current Guest VF Signed-off-by: Shirish S Reviewed-by: Chunming Zhou Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 11528640c77891363bc7dea749ced64607aa1b22 Author: Emily Deng Date: Fri Jun 8 16:36:22 2018 +0800 drm/amdgpu: Correct the ndw of bo update mapping. For buffer object that has shadow buffer, need twice commands. Signed-off-by: Emily Deng Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b7e6cd57027f5151d4f330dfabb0182f78d26e83 Author: Boyuan Zhang Date: Tue May 1 14:59:12 2018 -0400 drm/amdgpu: add AMDGPU_HW_IP_VCN_JPEG to queue mgr Add AMDGPU_HW_IP_VCN_JPEG to queue mgr Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 4bafe44024295f087fd633a16e100a34ca363e7c Author: Boyuan Zhang Date: Tue May 1 14:58:25 2018 -0400 drm/amdgpu: add AMDGPU_HW_IP_VCN_JPEG to info query Add AMDGPU_HW_IP_VCN_JPEG to info query Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 81d350144bd4590ae546d83344421106e8faf69a Author: Boyuan Zhang Date: Tue May 1 14:47:31 2018 -0400 uapi/drm: add AMDGPU_HW_IP_VCN_JPEG for jpeg CS Add AMDGPU_HW_IP_VCN_JPEG define for jpeg CS Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 5b2329b61875e7118a599f2f1cf6d23c8ac75a69 Author: Boyuan Zhang Date: Tue May 1 14:40:24 2018 -0400 drm/amdgpu: enable vcn jpeg ib test Enable vcn jpeg ib ring test in amdgpu_ib.c Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 6173040f167e2529c514765c6343abb55a4e0b44 Author: Boyuan Zhang Date: Wed May 30 15:56:43 2018 -0400 drm/amdgpu: add vcn jpeg ib test Add an ib test for vcn jpeg. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b1d3760645acd7f16c377499460305d8f35bad00 Author: Boyuan Zhang Date: Wed May 30 15:49:51 2018 -0400 drm/amdgpu: add vcn jpeg ring test Add a ring test for vcn jpeg. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 0c5e4b3e1e8a13cf918c1d2197e5b91fd865138a Author: Boyuan Zhang Date: Wed May 30 15:32:16 2018 -0400 drm/amdgpu: add vcn jpeg sw finish Add software finish for vcn jpeg ring. v2: remove unnecessary scheduler entity. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b7fe681e35aaf8c844755297777bdceae030f6c3 Author: Boyuan Zhang Date: Wed May 30 15:19:52 2018 -0400 drm/amdgpu: add patch to jpeg ring Add patch commands to jepg ring by calling set patch ring function. v2: remove modifications on max_dw, buf_mask and ptr_mask, since we are now using extra_dw for jpeg ring. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c8c1a1d2ef040d2661fc9c7f0b32aec5b1058ae3 Author: Boyuan Zhang Date: Fri Jun 1 12:30:17 2018 -0400 drm/amdgpu: define and add extra dword for jpeg ring Define extra dword for jpeg ring. Jpeg ring will allocate extra dword to store the patch commands for fixing the known issue. v2: dropping extra_dw for rings other than jpeg. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8a998052f29b811497b004b87dfe1ea1dfef75d1 Author: Boyuan Zhang Date: Wed May 30 14:57:16 2018 -0400 drm/amdgpu: implement patch for fixing a known bug Implement a patch to maunally reset read pointer v2: using ring assignment instead of amdgpu_ring_write. adding comments for each steps in the patch function. v3: fixing a typo bug. v4: fixing a bug in v3. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d2314b48d62110d5ce9aebcc8900bc44eed72700 Author: Boyuan Zhang Date: Wed May 30 14:47:39 2018 -0400 drm/amdgpu: initialize vcn jpeg ring Add implementations for vcn jpeg ring initialization Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 59dd2b883fcd50d76b644d2ade084dae0137a8f7 Author: Boyuan Zhang Date: Wed May 30 14:42:33 2018 -0400 drm/amdgpu: add vcn jpeg irq support Add vcn jpeg irq support. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit e612bcc3abbb10b6a2204e17849f9aed8627a46e Author: Boyuan Zhang Date: Wed May 30 14:23:33 2018 -0400 drm/amdgpu: set jpeg ring functions Set all vcn jpeg ring function pointers. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 221f36c460d7d671e9d19d0d8184225aa068d3a8 Author: Boyuan Zhang Date: Wed May 30 14:39:07 2018 -0400 drm/amdgpu: implement jpeg ring functions Implement all ring functions needed for jpeg ring v2: remove unnecessary mem read function. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 50613395abc00f150f051d6bc440877741b6fae9 Author: Boyuan Zhang Date: Mon Apr 30 16:55:39 2018 -0400 drm/amdgpu: add more jpeg register offset headers Add more jpeg registers defines that are needed for jpeg ring functions Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d521093a5f84cacf9935e8c9834ad3054b423ee1 Author: Boyuan Zhang Date: Mon Apr 30 16:51:33 2018 -0400 drm/amdgpu: add jpeg packet defines to soc15d.h Add new packet for vcn jpeg, including condition checks, types and packet Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit fa3087f7682e714af30c1dd8a7cdf95da38e43ff Author: Boyuan Zhang Date: Wed May 30 14:13:33 2018 -0400 drm/amdgpu: add vcn jpeg ring Add jpeg to amdgpu_vcn v2: remove unnecessary scheduler entity Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8e0fce5a96cfcce77cda3f0fccc2799d6be2524d Author: Boyuan Zhang Date: Mon Apr 30 16:35:34 2018 -0400 drm/amdgpu: define vcn jpeg ring Add AMDGPU_RING_TYPE_VCN_JPEG ring define Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 48ad368a8a3ab2fd3c2bc2ccccc6e29b1acda1bb Author: Andrey Grodzovsky Date: Wed May 30 15:28:52 2018 -0400 drm/amdgpu: move amdgpu_ctx_mgr_entity_fini to f_ops flush hook (V4) With this we can now terminate jobs enqueue into SW queue the moment the task is being killed instead of waiting for last user of drm file to release it. Also stop checking for kref_read(&ctx->refcount) == 1 when calling drm_sched_entity_do_release since other task might still hold a reference to this entity but we don't care since KILL means terminate job submission regardless of what other tasks are doing. v2: Use returned remaining timeout as parameter for the next call. Rebase. v3: Switch to working with jiffies. Streamline remainder TO usage. Rebase. v4: Rebase. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 741f01e636b72ff3f81204fd595ac1078907671b Author: Andrey Grodzovsky Date: Wed May 30 15:11:01 2018 -0400 drm/scheduler: Avoid using wait_event_killable for dying process (V4) Dying process might be blocked from receiving any more signals so avoid using it. Also retire enity->fini_status and just check the SW queue, if it's not empty do the fallback cleanup. Also handle entity->last_scheduled == NULL use case which happens when HW ring is already hangged whem a new entity tried to enqeue jobs. v2: Return the remaining timeout and use that as parameter for the next call. This way when we need to cleanup multiple queues we don't wait for the entire TO period for each queue but rather in total. Styling comments. Rebase. v3: Update types from unsigned to long. Work with jiffies instead of ms. Return 0 when TO expires. Rebase. v4: Remove unnecessary timeout calculation. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Signed-off-by: Alex Deucher commit a2d19d66b1454b88bfcf1929837b329378d3377f Author: Michel Dänzer Date: Fri Jun 1 12:30:44 2018 +0200 drm/amdgpu: Hook up amdgpu_object.c documentation Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 2472e11b85f08e56519b988c4b76c610c818b1b0 Author: Michel Dänzer Date: Fri Jun 1 12:29:45 2018 +0200 drm/amdgpu: Fix-ups for amdgpu_object.c documentation * Fix format of return value descriptions * Document all parameters of amdgpu_bo_free_kernel * Document amdgpu_bo_get_preferred_pin_domain Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 0152ac16522b6c6dd9319e005bf2945f585328d4 Author: Michel Dänzer Date: Fri Jun 1 12:10:02 2018 +0200 drm/amdgpu: Hook up documentation about memory domains Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 8f4805a265fd710a2827b2c0e10c08ef2b526870 Author: Shirish S Date: Tue May 29 09:23:53 2018 +0530 drm/amdgpu: avoid sleep while executing atombios table (V2) This patch replaces kzalloc's flag from GFP_KERNEL to GFP_ATOMIC to avoid sleeping in atomic context. Below is the stack trace: BUG: sleeping function called from invalid context at mm/slab.h:*** in_atomic(): 1, irqs_disabled(): 0, pid: 1137, name: DrmThread CPU: 1 PID: 1137 Comm: DrmThread Tainted: G W 4.14.43 #10 Call Trace: dump_stack+0x4d/0x63 ___might_sleep+0x11f/0x12e __kmalloc+0x76/0x126 amdgpu_atom_execute_table_locked+0xfc/0x285 amdgpu_atom_execute_table+0x5d/0x72 transmitter_control_v1_5+0xef/0x11a hwss_edp_backlight_control+0x132/0x151 dce110_disable_stream+0x133/0x16e core_link_disable_stream+0x1c5/0x23b dce110_reset_hw_ctx_wrap+0xb4/0x1aa dce110_apply_ctx_to_hw+0x4e/0x6da ? generic_reg_get+0x1f/0x33 dc_commit_state+0x33f/0x3d2 amdgpu_dm_atomic_commit_tail+0x2cf/0x5d2 ? wait_for_common+0x5b/0x69 commit_tail+0x42/0x64 drm_atomic_helper_commit+0xdc/0xf9 drm_atomic_helper_set_config+0x5c/0x76 __drm_mode_set_config_internal+0x64/0x105 drm_mode_setcrtc+0x474/0x56f ? drm_mode_getcrtc+0x155/0x155 drm_ioctl_kernel+0x6c/0xa8 drm_ioctl+0x267/0x353 ? drm_mode_getcrtc+0x155/0x155 amdgpu_drm_ioctl+0x4f/0x7f vfs_ioctl+0x21/0x2f do_vfs_ioctl+0x4c4/0x4e7 ? security_file_ioctl+0x3b/0x4f SyS_ioctl+0x57/0x79 do_syscall_64+0x64/0x72 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 V2: Added stack trace in commit message. Signed-off-by: Shirish S Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit baca30fabdc9ba2712481e1b9e14ded1de6cfa3a Author: Michel Dänzer Date: Tue May 29 18:33:41 2018 +0200 drm/amdgpu: Add documentation for PRIME related code Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 99fa7ce3a82bf8047b6104682da6ae276beb22d8 Author: Michel Dänzer Date: Tue May 29 18:39:04 2018 +0200 drm/doc: Add initial amdgpu driver documentation Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 41f507080e45010f916698165420640422942f7c Author: Michel Dänzer Date: Wed May 30 13:00:46 2018 +0200 drm/doc: Add a label for the PRIME Buffer Sharing chapter So that it can be referenced from e.g. DOC comments. Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 3120e2a390a9322a8247d7e9b8be52a7efc26dab Author: Alex Deucher Date: Thu May 31 12:46:08 2018 -0500 drm/amdgpu/pp: switch the default dpm implementation for CI Switch hawaii and bonaire to use powerplay rather than the old dpm implementation. Powerplay supports more features and is better maintained. Ultimately, we can drop the older dpm implementation like we did for other older asics. Reviewed-by: Huang Rui Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit d1a9146b3a98a139c79b79c7e1426f1128e2bbdf Author: Alex Deucher Date: Thu May 31 09:28:47 2018 -0500 drm/amdgpu/display: enable CONFIG_DRM_AMD_DC_DCN1_0 by default It's required for displays on Raven. The DCN bandwidth calcs use floating point, but DCN is APU only and it already depends on X86. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 5099114ba3b2e5ae9fb487aeb3ae0434fe38a7da Author: Alex Deucher Date: Thu May 31 09:09:59 2018 -0500 drm/amdgpu/display: drop DRM_AMD_DC_FBC kconfig option Just enable it always. This was leftover from feature bring up. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit b646c1dc835b6b73884a88643c2534f1a4a1928f Author: Samuel Li Date: Thu May 24 14:32:49 2018 -0400 drm/amdgpu: add kernel doc for memory domains. Document the GEM domains exposed to userspace. Suggested-by: Alex Deucher Signed-off-by: Samuel Li Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 6f4e8d6e592a5ca998337525b6f5133555228326 Author: Samuel Li Date: Thu May 17 17:58:45 2018 -0400 drm/amdgpu: add kernel doc for amdgpu_object.c Document the amdgpu buffer object API. v2: Add a DOC section and some more clarification. v3: Add some clarification and fix a spelling. Suggested-by: Alex Deucher Signed-off-by: Samuel Li Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 0ce55b4676f2e237e46d9196eb84fe35499a0d2e Author: Tony Cheng Date: Tue May 8 12:25:02 2018 -0400 drm/amd/display: dal 3.1.47 Signed-off-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0dd6cfe15cbd888e7e43ec1bb28f372de7d1b3e1 Author: Dmytro Laktyushkin Date: Wed May 16 08:51:11 2018 -0400 drm/amd/display: add dentist frequency to resource pool Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0b126112e90a96907aa14c39374fc7bfdbba131a Author: Eric Bernstein Date: Mon May 14 17:01:00 2018 -0400 drm/amd/display: DP YCbCr 4:2:0 support Update MSA MISC1 bit 6 programming to handle YCbCr 4:2:0 and BT2020 cases. Signed-off-by: Eric Bernstein Reviewed-by: Hersen Wu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 8de94233f4cdcd5b3065fa9b9af3edc10874a120 Author: Reza Amini Date: Wed May 9 15:41:47 2018 -0400 drm/amd/display: Prefix TIMING_STANDARD entries with DC_ Signed-off-by: Reza Amini Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit e0d4234982b3e9ce7eaa6c1726ceb04efd0b800f Author: Tony Cheng Date: Tue May 8 12:24:40 2018 -0400 drm/amd/display: dal 3.1.46 Signed-off-by: Tony Cheng Reviewed-by: Dmytro Laktyushkin Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit a27f1996778363adc5ca3a31f6306edd8fa54350 Author: Yasir Al Shekerchi Date: Fri May 4 16:53:03 2018 -0400 drm/amd/display: Added documentation for some DC interface functions Signed-off-by: Yasir Al Shekerchi Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 43610a9be188ca67189363334833c5e815e5e86c Author: Vitaly Prosyak Date: Thu May 10 12:37:35 2018 -0500 drm/amd/display: HLG support Low level calculation methods. Signed-off-by: Vitaly Prosyak Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 1a05873f21d6192575382afd2feb18df935e46f0 Author: Anthony Koo Date: Thu May 10 14:21:47 2018 -0400 drm/amd/display: Refactor audio programming Signed-off-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 4ea209073d229a0cb65f9978e83fa7c044026416 Author: Krunoslav Kovac Date: Tue May 8 16:03:58 2018 -0400 drm/amd/display: Dynamic HDR metadata mem buffer Basic framework: - caps for reporting dynamic HDR metadata support - allocation of frame buffer memory and storage Signed-off-by: Krunoslav Kovac Reviewed-by: Tony Cheng Reviewed-by: Anthony Koo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 3c8e4316a0bf6f65e8fbcf777abbc3b0e629e800 Author: Nikola Cornij Date: Wed May 9 17:07:36 2018 -0400 drm/amd/display: Optimize DP_SINK_STATUS_ESI range read on HPD DP_SINK_STATUS_ESI range data is not continual, but rather than getting it in two AUX reads, it's quicker to read more bytes in a AUX read and then memcpy the required fields (it's only 8 more bytes to read). Signed-off-by: Nikola Cornij Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit bf58968647729ce320a7ef27077d60b7b2cdcd00 Author: Aric Cyr Date: Wed May 9 14:36:50 2018 -0400 drm/amd/display: Default log masks should include all connectivity events Signed-off-by: Aric Cyr Reviewed-by: Jun Lei Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit cb1d7eacb58f7d1b7d0e57b26dc02d45eada4a3c Author: Hersen Wu Date: Tue May 8 16:35:09 2018 -0400 drm/amd/display: Fix indentation in dcn10 resource constructor Signed-off-by: Hersen Wu Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 8ca809008571f87e7d73535175601328175dac81 Author: Anthony Koo Date: Tue May 8 17:08:57 2018 -0400 drm/amd/display: add DPCD read for Sink ieee OUI Signed-off-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0f6ca3bac44dd6c16e3b4c484243bbb1dad3f6a7 Author: Eric Bernstein Date: Tue May 8 16:20:52 2018 -0400 drm/amd/display: Add function to get optc active size Signed-off-by: Eric Bernstein Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 73770ca53f63489b32175ab8b5ddd4632b747275 Author: Hersen Wu Date: Mon Apr 23 19:21:45 2018 -0400 drm/amd/display: AUX will exit when HPD LOW detected This change shorten wait time when HPD LOW. With HPD LOW, without this change, AUX routine delay is 450us. With this change, it is 42us. Signed-off-by: Hersen Wu Reviewed-by: Tony Cheng Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit f9430b235dd46c7753a018fa39e3c31981b0a54d Author: Anthony Koo Date: Tue May 8 11:24:05 2018 -0400 drm/amd/display: Prefix event prints with ==Event== Signed-off-by: Anthony Koo Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit ae2389e0fc3d4608ebb212c5c655ac964a4ee501 Author: Tony Cheng Date: Mon Apr 16 13:31:05 2018 -0400 drm/amd/display: dal 3.1.45 Signed-off-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 9a08f51fa737d6cc167beb98bc21db8821b2dff2 Author: Dmytro Laktyushkin Date: Thu May 3 13:42:43 2018 -0400 drm/amd/display: upgrade scaler math This change will allow the viewport overlap to apply to rotated/ mirrored surfaces. Viewport overlap results in extra pixels being added to viewport allowing the first few pixels to be scaled as if there is no cut-off(mpo or pipe split) and allows us to get matching crc's between scaled split and unsplit outputs of the same thing. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 66e48cd37147e153cef61bcbfbfa4771fe632207 Author: Charlene Liu Date: Thu May 3 17:51:07 2018 -0400 drm/amd/display: Clean up submit_channel_request Signed-off-by: Charlene Liu Reviewed-by: Vitaly Prosyak Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit ea4a202053c94b1be0e056b66032961523cc9aa3 Author: Eric Bernstein Date: Tue May 1 15:21:42 2018 -0400 drm/amd/display: pass pipe_ctx straight to blank_pixel_data Signed-off-by: Eric Bernstein Reviewed-by: Dmytro Laktyushkin Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 677e8622a9ae8cd9d351f98ecf120fb1c83b59d1 Author: Nayan Deshmukh Date: Fri May 25 10:15:48 2018 +0530 drm/doc: add a chapter for gpu scheduler Signed-off-by: Nayan Deshmukh Reviewed-by: Christian König Acked-by: Daniel Vetter Signed-off-by: Alex Deucher commit 2d33948e4e00b501b91367fed21243a948426591 Author: Nayan Deshmukh Date: Tue May 29 11:23:07 2018 +0530 drm/scheduler: add documentation convert existing raw comments into kernel-doc format as well as add new documentation v2: reword the overview Signed-off-by: Alex Deucher Signed-off-by: Nayan Deshmukh Reviewed-by: Alex Deucher Reviewed-by: Christian König Acked-by: Daniel Vetter commit fe78627d430435d22316fe39f2012ece31bf23c2 Author: Gustavo A. R. Silva Date: Fri Jun 15 08:32:28 2018 -0500 drm/amd/display: fix type of variable Currently, the maximum value that *counter* can reach is 255, and code at line 150: while (counter < 1000) { implies a bigger value could be expected. Fix this by changing the type of variable *counter* from uint8_t to uint16_t. Addresses-Coverity-ID: 1470030 ("Operands don't affect result") Fixes: 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Alex Deucher commit 5c2199270275581a06571960e7d6abac008ff060 Author: Alex Deucher Date: Thu Jun 14 10:24:06 2018 -0500 drm/amdgpu: Fix uvd firmware version information for vega20 (v2) The uvd version information was not set correctly for vega20. Rearrange the logic to set it correctly and fix the warnings as a result. v2: fix version formatting for userspace based on feedback from Leo Fixes: 96ca7f298f (drm/amdgpu/vg20:support new UVD FW version naming convention) Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit dd06eecb73d2e5f5c4039bcd9d83d4f7e0156d6f Author: James Zhu Date: Wed Jun 6 14:38:14 2018 -0400 drm/amdgpu/vg20:support new UVD FW version naming convention Vega20 UVD Firmware has a new version naming convention: [31, 30] for encode interface major [29, 24] for encode interface minor [15, 8] for decode interface minor [7, 0] for hardware family id Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit e1fa921f022d2401f3e3328ebf0c2ded84d4924a Author: Rex Zhu Date: Wed Jun 13 18:53:49 2018 +0800 drm/amd/pp: Make sure clock_voltage_limit_table on dc is valid if vbios not set the max clock voltage limit table for DC mode, Set the table as sama as the table for AC mode. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit ecfee95a8ae7f35d43b8f63d61220e70ec8d2ea8 Author: Rex Zhu Date: Wed Jun 13 18:26:38 2018 +0800 drm/amd/pp: Add S3 support for OD feature make custom values survive when S3 sleep transitions. so not reset the od table if it is not null. Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit b1dc9d8755d9ee605990f32d82ca39b57c7cdcbb Author: Christian König Date: Mon Jun 11 15:10:02 2018 +0200 drm/amdgpu: allocate shared fence slot in VA IOCTL Per VM BOs share the reservation object with the PD and so need to reserve a shared fence slot for the update. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Reviewed-by: Junwei Zhang Signed-off-by: Alex Deucher commit 14921f3cef85b0167a9145e5f29b9dfc3b2a84dc Author: Mika Kuoppala Date: Fri Jun 15 13:44:29 2018 +0300 drm/i915: Fix context ban and hang accounting for client If client is smart or lucky enough to create a new context after each hang, our context banning mechanism will never catch up, and as a result of that it will be saved from client banning. This can result in a never ending streak of gpu hangs caused by bad or malicious client, preventing access from other legit gpu clients. Fix this by always incrementing per client ban score if it hangs in short successions regardless of context ban scoring. The exception are non bannable contexts. They remain detached from client ban scoring mechanism. v2: xchg timestamp, tidyup (Chris) v3: comment, bannable & banned together (Chris) Fixes: b083a0870c79 ("drm/i915: Add per client max context ban limit") Cc: Chris Wilson Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180615104429.31477-1-mika.kuoppala@linux.intel.com commit ce041c43f22298485122bab15c14d062383fbc67 Author: Thierry Escande Date: Wed Jun 13 19:18:40 2018 +0200 lib/test_printf.c: accept "ptrval" as valid result for plain 'p' tests If the test_printf module is loaded before the crng is initialized, the plain 'p' tests will fail because the printed address will not be hashed and the buffer will contain "(____ptrval____)" or "(ptrval)" instead (64-bit vs 32-bit). Since we cannot wait for the crng to be initialized for an undefined time, both plain 'p' tests now accept the strings "(____ptrval____)" or "(ptrval)" as a valid result and print a warning message. Link: http://lkml.kernel.org/r/20180613171840.29827-1-thierry.escande@linaro.org Fixes: ad67b74d2469d9b82 ("printk: hash addresses printed with %p") To: Andrew Morton To: David Miller Cc: Rasmus Villemoes Cc: "Tobin C . Harding" Cc: linux-kernel@vger.kernel.org Signed-off-by: Thierry Escande Reviewed-by: Andy Shevchenko Signed-off-by: Petr Mladek commit 548764bb7ce050afdba15892fb4add79d15974db Author: Chris Wilson Date: Fri Jun 15 13:02:07 2018 +0100 drm/i915: Keep the ctx workarounds tightly packed For each platform, we have a few registers that are rewritten with different values -- they are not part of a sequence, just different parts of a masked register set at different times (e.g. platform and gen workarounds). Consolidate these into a single register write to keep the table compact, important since we are running of room in the current fixed sized buffer. While adjusting the construction of the wa table, make it non fatal so that the driver still loads but keeping the warning and extra details for inspection. Inspecting the changes for a Kabylake system, Before: Address val mask read 0x07014 0x20002000 0x00002000 0x00002100 0x0E194 0x01000100 0x00000100 0x00000114 0x0E4F0 0x81008100 0x00008100 0xFFFF8120 0x0E184 0x00200020 0x00000020 0x00000022 0x0E194 0x00140014 0x00000014 0x00000114 0x07004 0x00420042 0x00000042 0x000029C2 0x0E188 0x00080000 0x00000008 0x00008030 0x07300 0x80208020 0x00008020 0x00008830 0x07300 0x00100010 0x00000010 0x00008830 0x0E184 0x00020002 0x00000002 0x00000022 0x0E180 0x20002000 0x00002000 0x00002000 0x02580 0x00010000 0x00000001 0x00000004 0x02580 0x00060004 0x00000006 0x00000004 0x07014 0x01000100 0x00000100 0x00002100 0x0E100 0x00100010 0x00000010 0x00008050 After: Address val mask read 0x02580 0x00070004 0x00000007 0x00000004 0x07004 0x00420042 0x00000042 0x000029C2 0x07014 0x21002100 0x00002100 0x00002100 0x07300 0x80308030 0x00008030 0x00008830 0x0E100 0x00100010 0x00000010 0x00008050 0x0E180 0x20002000 0x00002000 0x00002000 0x0E184 0x00220022 0x00000022 0x00000022 0x0E188 0x00080000 0x00000008 0x00008030 0x0E194 0x01140114 0x00000114 0x00000114 0x0E4F0 0x81008100 0x00008100 0xFFFF8120 Signed-off-by: Chris Wilson Cc: Oscar Mateo Cc: Mika Kuoppala Cc: Joonas Lahtinen Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180615120207.13952-1-chris@chris-wilson.co.uk commit 95a28eeaf1491bcb8bf521bad4784683333705ee Author: Luca Coelho Date: Sat Jun 9 09:14:43 2018 +0300 radiotap: add structs for HE Add radiotap structures for HE. Signed-off-by: Liad Kaufman Signed-off-by: Johannes Berg Signed-off-by: Ilan Peer Signed-off-by: Ido Yariv Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit c4cbaf7973a794839af080f13748335976cf3f3f Author: Luca Coelho Date: Sat Jun 9 09:14:42 2018 +0300 cfg80211: Add support for HE Add support for the HE in cfg80211 and also add userspace API to nl80211 to send rate information out, conforming with P802.11ax_D2.0. Signed-off-by: Liad Kaufman Signed-off-by: Johannes Berg Signed-off-by: Ilan Peer Signed-off-by: Ido Yariv Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 446faa15c6e80620826edd659e63c6760137975a Author: Antonio Quartulli Date: Thu Jun 14 09:43:06 2018 +0800 nl80211: report 4ADDR status with GET_INTERFACE User space tools might be interested in knowing the current status of the 4ADDR property of an interface (when supported). Send the status along with the other attributes when replying to a GET_INTERFACE netlink query. Signed-off-by: Antonio Quartulli Signed-off-by: Johannes Berg commit 2d4f545cb14fa2d9865124183f3100d46dc9b3b5 Author: Peter Meerwald Date: Mon Jun 4 23:34:06 2018 +0200 rfkill: Fixes and cleanup of kernel-doc in the header file Fixes kerneldoc parameter names to match implementation, rfkill_set_hw_state(), rfkill_set_sw_state(). Fix description of rfkill_resume_polling(). Fix typos in documentation of rfkill_find_type(). Consistently start kerneldoc description with uppercase letter. Signed-off-by: Peter Meerwald-Stadler Signed-off-by: Johannes Berg commit cba340fa89bc9834cf8ac648c060f45ee955beb4 Author: Peter Meerwald Date: Mon Jun 4 23:02:03 2018 +0200 rfkill: Fix several typos in documentation Signed-off-by: Peter Meerwald-Stadler Signed-off-by: Johannes Berg commit e529f4d651595fa6c007d3ddeaccf22babbf083c Author: Peter Meerwald Date: Mon Jun 4 22:32:43 2018 +0200 rfkill: Correctly document rkill subfolder range as >= 0 in sysfs-class-rfkill The first subfolder is rfkill0, hence rfkillX (X >= 0). Also fix two trivial typos. Signed-off-by: Peter Meerwald-Stadler Signed-off-by: Johannes Berg commit b9771d41aee7aa3207b985422a1cc19e8342bc50 Author: Johannes Berg Date: Mon May 28 15:47:41 2018 +0200 mac80211: support scan features for improved scan privacy Support the new random SN and minimal probe request contents scan flags for the case of software scan - for hardware scan the drivers need to opt in, but may need to do only that, depending on their implementation. Signed-off-by: Johannes Berg Signed-off-by: Johannes Berg commit 2e076f199097d670ce5e5492cea57f552b93bba9 Author: Johannes Berg Date: Mon May 28 15:47:40 2018 +0200 nl80211: add scan features for improved scan privacy Add the scan flags for randomized SN and minimized probe request content for improved scan privacy. Signed-off-by: Johannes Berg Signed-off-by: Johannes Berg commit 45ad683484b61b5859ccb5a93a8254e1b4d20a29 Author: Johannes Berg Date: Mon May 28 15:47:39 2018 +0200 mac80211: split ieee80211_send_probe_req() This function is passed many more parameters in the scan case than in the MLME case, and differentiates the two cases inside. Split it up and make both versions static to simplify things. Signed-off-by: Johannes Berg Signed-off-by: Johannes Berg commit 00387f321537395f62d5c0eca64c2d7838f39ac3 Author: Johannes Berg Date: Mon May 28 15:47:38 2018 +0200 mac80211: add probe request building flags Add flags to pass through to probe request building and change the "bool directed" to be one of them. Signed-off-by: Johannes Berg Signed-off-by: Johannes Berg commit db0a4ad80d3aee6f6e96eddc7ef6a88f4e38d357 Author: Johannes Berg Date: Mon May 28 15:47:37 2018 +0200 nl80211: refactor common code in scan flags checks There's a very common pattern to check for a scan flag and then reject it if an extended feature flag isn't set, factor this out into a helper function. Signed-off-by: Johannes Berg Signed-off-by: Johannes Berg commit 1d211d43167690f94f1bcadf44395799382d85d0 Author: Johannes Berg Date: Wed May 23 14:53:41 2018 +0200 cfg80211: use better order for kcalloc() arguments The arguments should be (# of elements, size of each) instead of the other way around, which really ends up being mostly equivalent but smatch complains about it, so swap them. Signed-off-by: Johannes Berg Signed-off-by: Johannes Berg commit 2edd53272120ea3fd32193ef7f921580a534e218 Author: Manasi Navare Date: Mon Jun 11 15:26:55 2018 -0700 drm/i915/dp: Add support for HBR3 and TPS4 during link training DP spec 1.4 supports training pattern set 4 (TPS4) for HBR3 link rate. This will be used in link training's channel equalization phase if supported by both source and sink. This patch adds the helpers to check if HBR3 is supported and uses TPS4 in training pattern selection during link training. Cc: Rodrigo Vivi Cc: Jani Nikula Reviewed-by: James Ausmus Signed-off-by: Manasi Navare Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180611222655.5696-2-paulo.r.zanoni@intel.com commit 46b527d19c4327897197d09748a8b332e322a1d7 Author: Manasi Navare Date: Mon Jun 11 15:26:54 2018 -0700 drm/i915/icl: Add allowed DP rates for Icelake For ICL, on Combo PHY the allowed max rates are: - HBR3 8.1 eDP (DDIA) - HBR2 5.4 DisplayPort (DDIB) and for MG PHY/TC DDI Ports allowed DP rates are: - HBR3 8.1 DisplayPort (DP alternate mode, DP over TBT, - DP on legacy connector - DDIC/D/E/F) v2 (from Paulo): Remove misleading comment (Ville). Cc: Rodrigo Vivi Cc: Jani Nikula Reviewed-by: James Ausmus Signed-off-by: Manasi Navare Signed-off-by: James Ausmus [Paulo: bikeshed to keep future platforms on "else", v2.] Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180611222655.5696-1-paulo.r.zanoni@intel.com commit 1fa11ee2d9d0ccd58a6b56a9e490e336c99e98bf Author: Paulo Zanoni Date: Mon May 21 17:25:48 2018 -0700 drm/i915/icl: start adding the TBT pll This commit just adds the register addresses and the basic skeleton of the code. The next commits will expand on more specific functions. Reviewed-by: Lucas De Marchi Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-15-paulo.r.zanoni@intel.com commit 00c92d929ac36848fbe88567ef14af947ab636e4 Author: Paulo Zanoni Date: Mon May 21 17:25:47 2018 -0700 drm/i915/icl: unconditionally init DDI for every port On ICP, port present straps (from SFUSE_STRAP PCH register) are no longer supported. Software should determine the presence through BIOS VBT, hotplug or other mechanisms. v2: Improve commit message (Lucas). Reviewed-by: Lucas De Marchi Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-14-paulo.r.zanoni@intel.com commit 970888e7d130f19affc72ffbadf05b40b7693a27 Author: Paulo Zanoni Date: Mon May 21 17:25:44 2018 -0700 drm/i915/icl: add icelake_get_ddi_pll() Implement the hardware state readout code. Thanks to Animesh Manna for spotting this problem. Cc: Animesh Manna Credits-to: Animesh Manna Reviewed-by: Lucas De Marchi Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-11-paulo.r.zanoni@intel.com commit a0fbacb58ce1b5885475d38338b8ad3e8c86e5e9 Author: Chris Wilson Date: Thu Jun 14 19:42:18 2018 +0100 drm/i915/gtt: Reduce a pair of runtime asserts We can stop asserting using WARN_ON as given sufficient CI coverage, we can rely on using GEM_BUG_ON() to catch problems before merging. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180614184218.1606-2-chris@chris-wilson.co.uk commit 986dbac4803c7eb2be0d0dac7bc642744502d080 Author: Chris Wilson Date: Thu Jun 14 19:42:17 2018 +0100 drm/i915/gtt: Cache the PTE encoding of the scratch page As the most frequent PTE encoding is for the scratch page, cache it upon creation. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180614184218.1606-1-chris@chris-wilson.co.uk commit 4a192c7e8b14a2bf8f30b1fac3599a7d391dfcf9 Author: Chris Wilson Date: Thu Jun 14 14:43:15 2018 +0100 drm/i915/gtt: Free unused page tables on unbind the context As we cannot reliably change used page tables while the context is active, the earliest opportunity we have to recover excess pages is when the context becomes idle. So whenever we unbind the context (it must be idle, and indeed being evicted) free the unused ptes. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180614134315.5900-2-chris@chris-wilson.co.uk commit 549fe88bf71d30563f20dcfd7970b7424bf07907 Author: Chris Wilson Date: Thu Jun 14 14:43:14 2018 +0100 drm/i915/gtt: Lazily allocate page directories for gen7 As we were only supporting aliasing_ppgtt on gen7 for some time, we saved a few checks by preallocating the page directories on creation. However, since we need 2MiB of page directories for each ppgtt, to support arbitrary numbers of user contexts, we need to be more prudent in our allocations, and defer the page allocation until it is used. We don't recover unused pages yet as we found that doing so on the fly (i.e. altering TLB entries) would confuse the GPU. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180614134315.5900-1-chris@chris-wilson.co.uk commit 1fd00c0faeec0a89dfe97de842facbecc8a04efb Author: Chris Wilson Date: Sat Jun 2 11:48:53 2018 +0100 drm/i915: Declare the driver wedged if hangcheck makes no progress Hangcheck is our back up in case the GPU or the driver gets stuck. It detects when the GPU is not making any progress and issues a GPU reset. However, if the driver is failing to make any progress, we can get ourselves into a situation where we continually try resetting the GPU to no avail. Employ a second timeout such that if we continue to see the same seqno (the stalled engine has made no progress at all) over the course of several hangchecks, declare the driver wedged and attempt to start afresh. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180602104853.17140-1-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala commit 5db1d4ea91b6ee447c4ae01f7f56803e32e690b1 Author: Chris Wilson Date: Mon Jun 4 08:34:40 2018 +0100 drm/i915/execlists: Push the tasklet kick after reset to reset_finish In the unlikely case where we have failed to keep submitting to the GPU, we end up with the ELSP queue empty but a pending queue of requests. Here, we skip the per-engine reset as there is no guilty request, but in doing so we also skip the engine restart leaving ourselves with a permanently hung engine. A quick way to recover is by moving the tasklet kick to execlists_reset_finish() (from init_hw). We still emit the error on hanging, so the error is not lost but we should be able to recover. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Cc: Michel Thierry Link: https://patchwork.freedesktop.org/patch/msgid/20180604073441.6737-2-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala commit 920d3fb1a00c3d7bb24c9b396c8b2950192c5ad8 Author: Chris Wilson Date: Thu Jun 14 13:49:23 2018 +0100 drm/i915/selftests: Initialise request to silence a compiler With an old (4.7.3 on 32bit) gcc, it emits a warning for In file included from drivers/gpu/drm/i915/i915_request.c:1425:0: drivers/gpu/drm/i915/selftests/i915_request.c: In function ‘live_nop_request’: drivers/gpu/drm/i915/selftests/i915_request.c:380:21: error: ‘request’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Silence it by just setting it to NULL on initialisation. Signed-off-by: Chris Wilson Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180614124923.18071-1-chris@chris-wilson.co.uk commit 51a9f6dfc00d35f927ecfaf6f0ae8ebaba39b3fe Author: Ville Syrjälä Date: Wed Jun 13 19:05:53 2018 +0300 drm/i915: Turn off g4x DP port in .post_disable() While Bspec doesn't list a specific sequence for turning off the DP port on g4x we are getting an underrun if the port is disabled in the .disable() hook. Looks like the pipe stops when the port stops, and by that time the plane disable may not have completed yet. Also the plane(s) seem to end up in some wonky state when this happens as they also signal another underrun immediately after we turn them back on during the next enable sequence. We could add a vblank wait in .disable() to avoid wedging the planes, but I assume we're still tripping up the pipe in some way. So it seems better to me to just follow the ILK+ sequence and turn off the DP port in .post_disable() instead. This sequence doesn't seem to suffer from this problem. Could be it was always the intended sequence for DP and the gen4 bspec was just never updated to include it. Originally we used the bad sequence even on ilk+, but I changed that in commit 08aff3fe26ae ("drm/i915: Move DP port disable to post_disable for pch platforms") as it was causing issues on those platforms as well. I left out g4x then only because I didn't have the hardware to test it. Now that I do it's fairly clear that the ilk+ sequence is also the right choice for g4x. v2: Fix whitespace fail (Jani) Mention the ilk+ commit (Jani) Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180613160553.11664-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 929168c5f3df5d9ea0ef426c33e971157d045eab Author: Ville Syrjälä Date: Wed Jun 13 19:05:52 2018 +0300 drm/i915: Disallow interlaced modes on g4x DP outputs Looks like interlaced DP output doesn't work on g4x either. Not all that surprising considering we already established that interlaced DP output is busted on VLV/CHV. Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180613160553.11664-1-ville.syrjala@linux.intel.com commit 132c27c97cb958f637dc05adc35a61b47779bcd8 Author: Ville Syrjälä Date: Mon Jun 11 23:02:55 2018 +0300 drm/i915: Fix PIPESTAT irq ack on i965/g4x On i965/g4x IIR is edge triggered. So in order for IIR to notice that there is still a pending interrupt we have to force and edge in ISR. For the ISR/IIR pipe event bits we can do that by temporarily clearing all the PIPESTAT enable bits when we ack the status bits. This will force the ISR pipe event bit low, and it can then go back high when we restore the PIPESTAT enable bits. This avoids the following race: 1. stat = read(PIPESTAT) 2. an enabled PIPESTAT status bit goes high 3. write(PIPESTAT, enable|stat); 4. write(IIR, PIPE_EVENT) The end result is IIR==0 and ISR!=0. This can lead to nasty vblank wait/flip_done timeouts if another interrupt source doesn't trick us into looking at the PIPESTAT status bits despite the IIR PIPE_EVENT bit being low. Before i965 IIR was level triggered so this problem can't actually happen there. And curiously VLV/CHV went back to the level triggered scheme as well. But for simplicity we'll use the same i965/g4x compatible code for all platforms. Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106033 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105225 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106030 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180611200258.27121-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit 3b567bb059b960a222c08d4d795360beb97e8551 Author: Imre Deak Date: Wed Jun 13 20:07:10 2018 +0300 drm/i915/ddi: Removed unused var from hsw_write_infoframe() Cc: Vandita Kulkarni Cc: Paulo Zanoni Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180613170710.15080-6-imre.deak@intel.com commit c737376442e26c84ef188e7c829e15d42928fc03 Author: Imre Deak Date: Wed Jun 13 20:07:09 2018 +0300 drm/i915/ddi: Set HDMI infoframes with pipe clocks enabled On ICL for setting the HDMI infoframe the pipe clock needs to be enabled, otherwise accessing the VIDEO_DIP_CTL register will hang the machine. Cc: Vandita Kulkarni Cc: Paulo Zanoni Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180613170710.15080-5-imre.deak@intel.com commit 8fc0aa6eaa568caf72adb8482bf33738d579c32d Author: Imre Deak Date: Wed Jun 13 20:07:08 2018 +0300 drm/i915/ddi: Check transcoder instead of port when setting HDMI infoframe The only requirement by BSpec for setting the HDMI infoframes is on DDI platforms to do that before enabling the HDMI transcoder function, see VIDEO_DIP_CTL bit 16. Accordingly check for the transcoder function disabled state instead of the port's disabled state on DDI platforms. This is needed by the next patch as it will set the infoframe during crtc disabling where the port is still enabled. Suggested-by: Ville Syrjälä Cc: Vandita Kulkarni Cc: Paulo Zanoni Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180613170710.15080-4-imre.deak@intel.com commit afb2c4437daeed2d0c49e246ad1ad4def5d913cd Author: Imre Deak Date: Wed Jun 13 20:27:46 2018 +0300 drm/i915/ddi: Push pipe clock enabling to encoders On ICL the pipe clock needs to be enabled before setting the HDMI infoframe, but these steps are in the reverse order atm. Move the pipe clock enabling to the encoders, so reordering of the two steps can be done in a clean way. No functional change. v2: - Rebased on drm-tip. Cc: Vandita Kulkarni Cc: Paulo Zanoni Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180613172746.18525-1-imre.deak@intel.com commit 24a28179ecc0011e41a0fc8034a1a8e0fefbb406 Author: Imre Deak Date: Wed Jun 13 20:07:06 2018 +0300 drm/i915/ddi: s/crtc->config/old_crtc_state in haswell_crtc_disable() crtc->config points to the old crtc state at the point display.crtc_disable() is called, so use the more descriptive pointer instead. v2: - Convert one remaining instance of the ptr in the function. (Ville) Cc: Vandita Kulkarni Cc: Paulo Zanoni Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180613170710.15080-2-imre.deak@intel.com commit 5422b37c907e7c00a15d5298d6717c6f7ba1403f Author: Rodrigo Vivi Date: Wed Jun 13 12:26:00 2018 -0700 drm/i915/psr: Kill delays when activating psr back. The immediate enabling was actually not an issue for the HW perspective for core platforms that have HW tracking. HW will wait few identical idle frames before transitioning to actual psr active anyways. Now that we removed VLV/CHV out of the picture completely we can safely remove any delays. Note that this patch also remove the delayed activation on HSW and BDW introduced by commit 'd0ac896a477d ("drm/i915: Delay first PSR activation.")'. This was introduced to fix a blank screen on VLV/CHV and also masked some frozen screens on other core platforms. Probably the same that we are now properly hunting and fixing. v2:(DK): Remove unnecessary WARN_ONs and make some other VLV | CHV more readable. v3: Do it regardless the timer rework. v4: (DK/CI): Add VLV || CHV check on cancel work at psr_disable. v5: Kill remaining items and fully rework activation functions. v6: Rebase on top of VLV/CHV clean-up and keep the reactivation on a regular non-delayed work to avoid extra delays on exit calls and allow us to add few more safety checks before real activation. Cc: Dhinakaran Pandiyan Signed-off-by: Rodrigo Vivi Reviewed-by: José Roberto de Souza Reviewed-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180613192600.3955-1-rodrigo.vivi@intel.com commit d5e5f6855aab87dd54ff3a33c6a3ccdc9f97fbcc Author: Colin Ian King Date: Wed May 30 10:25:03 2018 +0100 ath9k: debug: fix spelling mistake "WATHDOG" -> "WATCHDOG" Trivial fix to spelling mistake in PR_IS message text. Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit d16a7ab20ac9861979c83d7fce8f5edc48daada6 Author: Govind Singh Date: Wed Jun 13 12:18:06 2018 +0530 ath10k: handle resource init failure case Return type of resource init method is not assigned. Handle resource init failures for graceful exit. Signed-off-by: Govind Singh Signed-off-by: Kalle Valo commit 5db98aee93cd1ba5b94b1a9bc9057c98e2a36fd6 Author: Surabhi Vishnoi Date: Wed Jun 13 10:33:35 2018 +0530 ath10k: skip data calibration for non-bmi target In non-bmi target ex. WCN3990, data calibration is handled via QMI. Skip data calibration in debug routine to enable ath10k debugfs for non bmi targets. Signed-off-by: Surabhi Vishnoi Signed-off-by: Kalle Valo commit 50c51f394e685c450276e1ae5b91405ad55d8570 Author: Niklas Cassel Date: Tue Jun 12 13:39:05 2018 +0200 ath10k: do not mix spaces and tabs in Kconfig Do not mix spaces and tabs in Kconfig. Signed-off-by: Niklas Cassel Signed-off-by: Kalle Valo commit c9f3e7fa8bcb63a52531bf7e02bf53e0d177f3dc Author: Brian Norris Date: Mon Jun 11 14:09:46 2018 -0700 ath10k: snoc: sort include files Sort these alphabetically, with local includes in a separate section. Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit 13e6cc0bd4effa9fc4b03fb9b1baf0e26e2e217d Author: Brian Norris Date: Mon Jun 11 14:09:45 2018 -0700 ath10k: snoc: drop unused WCN3990_CE_ATTR_FLAGS We started using a common CE_ATTR_FLAGS definition, so drop this one. Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit 8ac5fe8e3d110eaff47dd2becf98b08762c84c75 Author: Brian Norris Date: Mon Jun 11 14:09:44 2018 -0700 ath10k: snoc: stop including pci.h It's easier to violate abstractions and introduce bugs when snoc.h is including pci.h. Let's not do that. I'm not extremely familiar with this driver yet, but several of the shared PCI/SNOC bits seem to be related to the Copy Engine, so move them to ce.h. Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit 426a0f0b5a2fe1df3496ba299ee3521159dba302 Author: Brian Norris Date: Mon Jun 11 14:09:43 2018 -0700 ath10k: snoc: use correct bus-specific pointer in RX retry We're 'ath10k_snoc', not 'ath10k_pci'. This probably means we're accessing junk data in ath10k_snoc_rx_replenish_retry(), unless 'ath10k_snoc' and 'ath10k_pci' happen to have very similar struct layouts. Noticed by inspection. Fixes: d915105231ca ("ath10k: add hif rx methods for wcn3990") Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit 0644fef97451908ef1048043b0a60d1324d8a522 Author: Brian Norris Date: Mon Jun 11 12:35:40 2018 -0700 ath10k: snoc: use module_platform_driver() macro ath10k_snoc_init()/ath10k_snoc_exit() don't add much value; module_platform_driver() can remove the boilerplate. Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit 7f8f72d8511a7f57595ce166cd9fc7da94a8faf4 Author: Brian Norris Date: Mon Jun 11 11:19:35 2018 -0700 ath10k: use crash_dump enum instead of magic numbers The comments are telling you what the enum could tell you instead. Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit 9fb31b66b91ff4e6c38fa0a10e517f4282e380e7 Author: YueHaibing Date: Mon Jun 4 20:35:42 2018 +0800 ath10k: use dma_zalloc_coherent instead of allocator/memset Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit 5a211627004e2cddd0ab8b9df19e5fb0bbe97634 Author: YueHaibing Date: Fri Jun 1 19:25:48 2018 +0800 ath10k: fix incorrect size of dma_free_coherent in ath10k_ce_alloc_src_ring_64 sizeof(struct ce_desc) should be a copy-paste mistake just use sizeof(struct ce_desc_64) to avoid mem leak Fixes: b7ba83f7c414 ("ath10k: add support for shadow register for WNC3990") Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit 6ee0e175a33deea08354bc8a91b743f0ec8c8a0a Author: Wei Yongjun Date: Thu May 31 02:33:14 2018 +0000 ath10k: make some functions static Fixes the following sparse warnings: drivers/net/wireless/ath/ath10k/snoc.c:823:5: warning: symbol 'ath10k_snoc_get_ce_id_from_irq' was not declared. Should it be static? drivers/net/wireless/ath/ath10k/snoc.c:871:6: warning: symbol 'ath10k_snoc_init_napi' was not declared. Should it be static? Signed-off-by: Wei Yongjun Signed-off-by: Kalle Valo commit 2e9bcd0d73243f5e49daf92508d64cc33c30da01 Author: Karthikeyan Periyasamy Date: Tue May 29 17:01:13 2018 +0530 ath10k: fix spectral scan for QCA9984 and QCA9888 chipsets The spectral scan has been always broken on QCA9984 and QCA9888. Introduce a hardware parameter 'spectral_bin_offset' to resolve this issue for QCA9984 and QCA9888 chipsets. For other chipsets, the hardware parameter 'spectral_bin_offset' is zero so that existing behaviour is retained as it is. In QCA9984 and QCA9888 chipsets, hardware param value 'spectral_bin_discard' is 12 bytes. This 12 bytes is derived as the sum of segment index (4 bytes), extra bins before the actual data (4 bytes) and extra bins after the actual data (4 bytes). Always discarding (12 bytes) happens at end of the samples and incorrect samples got dumped, so that user can find incorrect arrangement samples in spectral scan dump. To fix this issue, we have to discard first 8 bytes and last 4 bytes in every samples, so totally 12 bytes are discarded. In every sample we need to consider the offset while taking the actual spectral data. For QCA9984, QCA9888 the offset is 8 bytes (segment index + extra bins before actual data). Hardware tested: QCA9984 and QCA9888 Firmware tested: 10.4-3.5.3-00053 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo commit 38441fb6fcbb97817dff5c012609860a2b39c3e9 Author: Ben Greear Date: Tue Jan 2 16:51:01 2018 -0800 ath10k: support use of channel 173 The India regulatory domain allows CH 173, so add that to the available channel list. I verified basic connectivity between a 9880 and 9984 NIC. Signed-off-by: Ben Greear Signed-off-by: Kalle Valo commit a2bbf714834288da0ed4668d4e4d895ffef73de2 Author: Chris Wilson Date: Thu Jun 14 10:41:03 2018 +0100 drm/i915/gtt: Only keep gen6 page directories pinned while active In order to be able to evict the gen6 ppgtt, we have to unpin it at some point. We can simply use our context activity tracking to know when the ppgtt is no longer in use by hardware, and so only keep it pinned while being used a request. For the kernel_context (and thus aliasing_ppgtt), it remains pinned at all times, as the kernel_context itself is pinned at all times. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180614094103.18025-5-chris@chris-wilson.co.uk commit e62230deeeae1f096a4be2360204536caf9ad8b6 Author: Chris Wilson Date: Thu Jun 14 10:41:02 2018 +0100 drm/i915: Show CCID in engine dumps For debugging context issues, knowing what context the GPU is loading/using is helpful. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180614094103.18025-4-chris@chris-wilson.co.uk commit 286e615356000ae51fac0e497247543724414d52 Author: Chris Wilson Date: Thu Jun 14 10:41:01 2018 +0100 drm/i915: Make the hexdump row offset visually distinct Currently we use %08x for the row offset, and %08x for the binary contents of the buffer. This makes it very easily to confuse the two, so switch to using [%04x] for the start-of-row offset. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180614094103.18025-3-chris@chris-wilson.co.uk commit 83c317832eb1862e27f872606ee1a2fed6ab638f Author: Chris Wilson Date: Thu Jun 14 13:21:50 2018 +0100 drm/i915: Dump the ringbuffer of the active request for debugging Sometimes we need to see what instructions we emitted for a request to try and gather a glimmer of insight into what the GPU is doing when it stops responding. v2: Move ring dumping into its own routine Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180614122150.17552-1-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen commit 856e1b175650816dce554d2865ec258aa3b72098 Author: Jani Nikula Date: Thu Jun 14 13:47:09 2018 +0300 drm/i915/dsm: remove unnecessary dsm priv structure Pass a local acpi_handle around instead of having a static dsm priv structure. If we need it later, we can always move it to dev_priv, and the change at hand will make that easier as well. Care is taken to preserve old behaviour, particularly using the last non-NULL acpi handle, whether it makes sense or not. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180614104709.2808-1-jani.nikula@intel.com commit d6abe6df706c66d803e6dd4fe98c1b6b7f125a56 Author: Inki Dae Date: Thu May 24 18:32:59 2018 +0900 drm/bridge: sil_sii8620: do not have a dependency of RC_CORE This patch makes RC_CORE to be selected with this driver. sil_sii8620 driver calls remote controller interfaces directly so RC_CORE should be enabled mandatorily. And some boards not using remote controller device don't really need to know that RC_CORE config should be enabled to use sil_sii8620 driver only for HDMI. Changelog v2: - select INPUT because compiling will fail without INPUT. Signed-off-by: Inki Dae Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/1527154379-31886-1-git-send-email-inki.dae@samsung.com commit 1288786b18f7d979f1f9bcb0134ee5fbfcc8e3d1 Author: Chris Wilson Date: Thu Jun 14 10:40:59 2018 +0100 drm/i915: Move GEM sanitize from resume_early to resume This should be a no-op in terms of our control flow, we move the sanitization (GPU reset) from the bottom of the early resume phase to the top of the next. However, following hibernation debug, the power code skips the early resume phase, but as we are about to completely restore the GTT mappings, we first need to stop the GPU using them i.e. perform a GPU reset (i915_gem_sanitize()). Testcase: igt/gem_exec_suspend/basic-S4-devices Signed-off-by: Chris Wilson Cc: Imre Deak Cc: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180614094103.18025-1-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen commit 1cf8e5de4055f85383405a21a0a7c3c4348bf2ed Author: Konstantin Khorenko Date: Fri Jun 8 17:27:12 2018 +0300 fs/lock: show locks taken by processes from another pidns Currently if we face a lock taken by a process invisible in the current pidns we skip the lock completely, but this 1) makes the output not that nice (root@vz7)/: cat /proc/${PID_A2}/fdinfo/3 pos: 4 flags: 02100002 mnt_id: 257 lock: (root@vz7)/: 2) makes it more difficult to debug issues with leaked flocks if you get error on lock, but don't see any locks in /proc/$id/fdinfo/$file Let's show information about such locks again as previously, but show zero in the owner pid field. After the patch: =============== (root@vz7)/:cat /proc/${PID_A2}/fdinfo/3 pos: 4 flags: 02100002 mnt_id: 295 lock: 1: FLOCK ADVISORY WRITE 0 b6:f8a61:529946 0 EOF Fixes: 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks") Signed-off-by: Konstantin Khorenko Acked-by: Andrey Vagin Reviewed-by: Benjamin Coddington Signed-off-by: Jeff Layton commit 826d7bc9f013d01e92997883d2fd0c25f4af1f1c Author: Konstantin Khorenko Date: Fri Jun 8 17:27:11 2018 +0300 fs/lock: skip lock owner pid translation in case we are in init_pid_ns If the flock owner process is dead and its pid has been already freed, pid translation won't work, but we still want to show flock owner pid number when expecting /proc/$PID/fdinfo/$FD in init pidns. Reproducer: process A process A1 process A2 fork()---------> exit() open() flock() fork()---------> exit() sleep() Before the patch: ================ (root@vz7)/: cat /proc/${PID_A2}/fdinfo/3 pos: 4 flags: 02100002 mnt_id: 257 lock: (root@vz7)/: After the patch: =============== (root@vz7)/:cat /proc/${PID_A2}/fdinfo/3 pos: 4 flags: 02100002 mnt_id: 295 lock: 1: FLOCK ADVISORY WRITE ${PID_A1} b6:f8a61:529946 0 EOF Fixes: 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks") Signed-off-by: Konstantin Khorenko Acked-by: Andrey Vagin Reviewed-by: Benjamin Coddington Signed-off-by: Jeff Layton commit 2e932b9cdecebe3f41eaa86f8cec15c42fc62d41 Author: Jani Nikula Date: Wed Jun 13 14:39:27 2018 +0300 drm/i915/opregion: move acpi notifier to dev_priv Get rid of the silly static variable. Reviewed-by: Chris Wilson Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180613113927.30033-1-jani.nikula@intel.com commit 6ebb6d8ebe56135b06b1427ecaa712580b878ea2 Author: Jani Nikula Date: Wed Jun 13 14:49:29 2018 +0300 drm/i915/perf: make oa format tables const No reason not to be const. Reviewed-by: Lionel Landwerlin Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180613114929.14541-1-jani.nikula@intel.com commit 697b9a8714cb4631fd0526b3c78955d5422c24ba Author: Chris Wilson Date: Tue Jun 12 11:51:35 2018 +0100 drm/i915: Make closing request flush mandatory For symmetry, simplicity and ensuring the request is always truly idle upon its completion, always emit the closing flush prior to emitting the request breadcrumb. Previously, we would only emit the flush if we had started a user batch, but this just leaves all the other paths open to speculation (do they affect the GPU caches or not?) With mm switching, a key requirement is that the GPU is flushed and invalidated before hand, so for absolute safety, we want that closing flush be mandatory. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180612105135.4459-1-chris@chris-wilson.co.uk commit a9ef97d098c5bfb000a3a7454efd0304127b6b0b Author: Benjamin Herrenschmidt Date: Thu Jun 14 14:01:46 2018 +1000 fsi: sbefifo: Remove unneeded semicolon Spotted by kbuild-test-bot Signed-off-by: Benjamin Herrenschmidt commit e4dd27aadd205417a2e9ea9902b698a0252ec3a0 Author: Ville Syrjälä Date: Thu May 24 15:54:03 2018 +0300 drm/i915: Allow DBLSCAN user modes with eDP/LVDS/DSI When encountering a connector with the scaling mode property both intel and modesetting ddxs sometimes add tons of DBLSCAN modes to the output's mode list. The idea presumably being that since the output will be going through the panel fitter anyway we can pretend to use any kind of mode. Sadly that means we can't reject user modes with the DBLSCAN flag until we know whether we're going to be using the panel's native mode or the user mode directly. Doing otherwise means X clients using xf86vidmode/xrandr will get a protocol error (and often self terminate as a result) when the kernel refuses to use the requested mode with the DBLSCAN flag. To undo the regression we'll move the DBLSCAN checks into the connector->mode_valid() and encoder->compute_config() hooks. Cc: stable@vger.kernel.org Cc: Vito Caputo Reported-by: Vito Caputo Fixes: e995ca0b8139 ("drm/i915: Provide a device level .mode_valid() hook") References: https://lkml.org/lkml/2018/5/21/715 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180524125403.23445-1-ville.syrjala@linux.intel.com Reviewed-by: Maarten Lankhorst Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106804 Tested-by: Arkadiusz Miskiewicz commit 260e629bbf441585860e21d5e10d2e88437f47c8 Author: Colin Ian King Date: Sun May 27 22:17:02 2018 +0100 ath10k: fix memory leak of tpc_stats Currently tpc_stats is allocated and is leaked on the return path if num_tx_chain is greater than WMI_TPC_TX_N_CHAIN. Avoid this leak by performing the check on num_tx_chain before the allocation of tpc_stats. Detected by CoverityScan, CID#1469422 ("Resource Leak") Fixes: 4b190675ad06 ("ath10k: fix kernel panic while reading tpc_stats") Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo commit 12b67b0d6bcbe91d8b0682610f43d1cd8cdf280e Author: Gustavo A. R. Silva Date: Fri May 25 16:22:07 2018 -0500 ath9k: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo commit 4de30c906ef08af67c6d81c03e3505ee467db026 Author: Gustavo A. R. Silva Date: Fri May 25 13:23:11 2018 -0500 ath6kl: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Steve deRosier Signed-off-by: Kalle Valo commit 87b466f42e8fa8c0297b23c4b9776bd4e5d9d029 Author: Guy Chronister Date: Mon May 21 16:26:44 2018 -0500 ath6kl: add support for Dell Wireless 1537 This is a Qualcomm Atheros AR6004X with an sdio ID of 0x19 and hardware ID of 0271:0419. Tested on a Dell Venue 11 Pro 7130 with a self compiled kernel. Signed-off-by: Guy Chronister [kvalo@codeaurora.org: cleanup commit log] Signed-off-by: Kalle Valo commit aae28cefc279203c1d1bc460c831b0a557662945 Author: Gustavo A. R. Silva Date: Thu May 24 18:07:00 2018 -0500 ath5k: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo commit f1d270ae10ffc8d4f9726cc8b654e4e8cda294b5 Author: Gustavo A. R. Silva Date: Thu May 24 17:59:28 2018 -0500 ath10k: htt_tx: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced "pass through" with a proper "fall through" comment, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo commit 57c8a484a9cbf1315b5299702d12aef04867eeee Author: Colin Xu Date: Mon Jun 11 15:39:40 2018 +0800 drm/i915: Enable KVMGT for BXT. Enable KVMGT for BXT. is_supported_device() acting as the gatekeeper of GVT-g init. If all supported platforms share the same configurations for some specific feature, platform check will rely on this check only. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit d71cb7129e7cf038ed1444781a50766e486bb2bd Author: Colin Xu Date: Mon Jun 11 15:39:39 2018 +0800 drm/i915/gvt: Add mmio handler for for BXT. Leverage most SKL/KBL mmio init info and add different mmio to BXT specific function init_bxt_mmio_info(). Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 84eb04f6d77a824b33da11a08118ed2766038f13 Author: Colin Xu Date: Mon Jun 11 15:39:38 2018 +0800 drm/i915/gvt: Enable dma_buf support for BXT. Handle dma_buf on BXT as SKL and KBL. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 72bad9972876933b3c428fcee122bb1dcbf8cf5a Author: Colin Xu Date: Mon Jun 11 15:39:37 2018 +0800 drm/i915/gvt: Enable virtual display support for BXT. Virtual monitor on BXT start from port B. Unlike SKL/KBL, digital display port connectivity is detected via GEN8_DE_PORT_ISR so emulate monitor state change by setting it. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 47d9d3be5925688dfcc7407b0ae70013ba2dce2e Author: Colin Xu Date: Mon Jun 11 15:39:36 2018 +0800 drm/i915/gvt: Enable force wake support for BXT. BXT forcewake is handled in the same way as SKL/KBL. v2: Add missing inhibit_context restore for BXT. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit f093f182ace9ce3c618c110e316cc1e22d0c9d3b Author: Colin Xu Date: Mon Jun 11 15:39:35 2018 +0800 drm/i915/gvt: Enable cmd_parser support for BXT. Handle BXT cmd_parser as SKL/KBL. v2: All supported platforms share the same routines. Remove the platform check by now and let is_supported_device() be the gate keeper. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit a94cf2e0ef7fef5cb42ed96f73c18c3ad4f0d170 Author: Colin Xu Date: Mon Jun 11 15:39:34 2018 +0800 drm/i915/gvt: Enable mmio context init and switch for BXT. Handle pending tlb flush, mocs/mmio switch and context as KBL. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit d0f827bb18fe2ceb39707718334b636b89be4af0 Author: Colin Xu Date: Mon Jun 11 15:39:33 2018 +0800 drm/i915/gvt: Enable irq initialization for BXT. Initialize BXT irq handler as SKL/KBL. v2: All supported platforms share the same irq ops and map. Remove the platform check by now and let is_supported_device() be the gate keeper. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 665004b8f50612d1e354eb9abd6d97e6eb85a619 Author: Colin Xu Date: Mon Jun 11 15:39:32 2018 +0800 drm/i915/gvt: Enable gtt initialization for BXT. Initialize BXT gtt as SKL/KBL. v2: All supported platforms share the same gtt ops. Remove the platform check by now and let is_supported_device() be the gate keeper. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 6fa6616b8f7adaf8380d72e53733bc2472b0d157 Author: Colin Xu Date: Mon Jun 11 15:39:31 2018 +0800 drm/i915/gvt: Enable device info initialization for BXT. Initialize BXT device info as SKL/KBL. v2: All supported platforms share the same device configuration. Remove the platform check by now and let is_supported_device() be the gate keeper. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 02b966c12b49ba6dae627c2135b7c1a258e32303 Author: Colin Xu Date: Mon Jun 11 15:39:30 2018 +0800 drm/i915/gvt: Add MEDIA_POOL_STATE for BXT. As referred in PRM for Broxton Graphics on 01.org Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 2939db9e2879a1f80bcf863ccbd4919b3eef0d91 Author: Colin Xu Date: Mon Jun 11 15:39:29 2018 +0800 drm/i915/gvt: Add D_BXT device type define for BXT. Broxton belongs to GEN9 family so add to SKL and GEN9 plus. Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit 5aff29efbec020f0997e5cdbefce0ff383518986 Merge: 9bd034225300 3ef8a2eeb6dc Author: Dmitry Torokhov Date: Tue Jun 12 16:38:35 2018 -0700 Merge branch 'ib/4.17-xen-kbdfront-runtime-config' into next Bring in xen-kbdfront changes. commit 9bd034225300c7ddf14f4b4c28531efc7a5e1524 Author: Ravi Chandra Sadineni Date: Tue Jun 12 16:32:40 2018 -0700 Input: i8042 - increment wakeup_count for the respective port Call pm_wakeup_event on every interrupt. This should help us in identifying if keyboard was a potential wake reason for the last resume. Signed-off-by: Ravi Chandra Sadineni Signed-off-by: Dmitry Torokhov commit 925ffff2ea8b408428f2558074af92cf31325156 Author: Ravi Chandra Sadineni Date: Tue Jun 12 16:31:38 2018 -0700 Input: cros_ec_keyb - remove check before calling pm_wakeup_event Remove the unnecessary check before calling pm_wakeup_event. If the device is not wake enabled, this call is no-op anyway. Signed-off-by: Ravi Chandra Sadineni Signed-off-by: Dmitry Torokhov commit 27fff22168e014141c08d0f5f630fdbcae6043ef Author: Enric Balletbo i Serra Date: Tue Jun 12 16:27:52 2018 -0700 Input: cros_ec_keyb - switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Dmitry Torokhov commit e7a35f124a9a4efd01b7ffba61be94720deef4f0 Author: Enric Balletbo i Serra Date: Tue Jun 12 16:26:26 2018 -0700 Input: cros_ec_keyb - make license text and MODULE_LICENSE match The license text is specifying "GPLv2" but the MODULE_LICENSE is set to GPL which means GNU Public License v2 or later. When MODULE_LICENSE and boiler plate does not match, go for boiler plate license. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Dmitry Torokhov commit 3ef8a2eeb6dcd1fa61ec8ae107976e655f50e412 Author: Oleksandr Andrushchenko Date: Tue Jun 12 15:04:43 2018 -0700 Input: xen-kbdfront - allow better run-time configuration It is now only possible to control if multi-touch virtual device is created or not (via the corresponding XenStore entries), but keyboard and pointer devices are always created. In some cases this is not desirable. For example, if virtual keyboard device is exposed to Android then the latter won't automatically show on-screen keyboard as it expects that a physical keyboard device can be used for typing. Utilize keyboard and pointer device XenStore feature fields to configure which virtual devices are created: - set "feature-disable-keyboard" to 1 if no keyboard device needs to be created - set "feature-disable-pointer" to 1 if no pointer device needs to be created Keep old behavior by default. Signed-off-by: Oleksandr Andrushchenko Suggested-by: Andrii Chepurnyi Tested-by: Andrii Chepurnyi Reviewed-by: Juergen Gross Signed-off-by: Dmitry Torokhov commit ce6f7d087e2b037f47349c1c36ac97678d02e394 Author: Oleksandr Andrushchenko Date: Tue Jun 12 15:03:36 2018 -0700 Input: xen-kbdfront - fix multi-touch XenStore node's locations kbdif protocol describes multi-touch device parameters as a part of frontend's XenBus configuration nodes while they belong to backend's configuration. Fix this by reading the parameters as defined by the protocol. Fixes: 49aac8204da5 ("Input: xen-kbdfront - add multi-touch support") Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Juergen Gross Signed-off-by: Dmitry Torokhov commit ce63b2c89cc02d8acf7472272016ecd979fb08d5 Author: Oleksandr Andrushchenko Date: Tue Jun 12 15:02:57 2018 -0700 xen: Sync up with the canonical protocol definitions in Xen This is the sync up with the canonical definitions of the input, sound and display protocols in Xen. Changes to kbdif: 1. Add missing string constants for {feature|request}-raw-pointer to align with the rest of the interface file. 2. Add new XenStore feature fields, so it is possible to individually control set of exposed virtual devices for each guest OS: - set feature-disable-keyboard to 1 if no keyboard device needs to be created - set feature-disable-pointer to 1 if no pointer device needs to be created 3. Move multi-touch device parameters to backend nodes: these are described as a part of frontend's XenBus configuration nodes while they belong to backend's configuration. Fix this by moving the parameters to the proper section. Unique-id field: 1. Add unique-id XenBus entry for virtual input and display. 2. Change type of unique-id field to string for sndif to align with display and input protocols. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Juergen Gross Signed-off-by: Dmitry Torokhov commit bb187e93e48d3a3f1e3c9bcae76c5b13d3529391 Author: James Ausmus Date: Mon Jun 11 17:25:12 2018 -0700 drm/i915/icl: DP_AUX_E is valid on ICL+ Add support for DP_AUX_E. Here we also introduce the bits for the AUX power well E, however ICL power well support is still not enabled yet, so the power well is not used. Cc: Rodrigo Vivi Cc: Dhinakaran Pandiyan Reviewed-by: Paulo Zanoni Signed-off-by: James Ausmus Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180612002512.29783-2-paulo.r.zanoni@intel.com commit af1f1b81130e82a1ee62fe48aa09e6bdab6e68f4 Author: Mahesh Kumar Date: Mon Jun 11 17:25:11 2018 -0700 drm/i915/icl: fix gmbus gpio pin mapping ICP has GPIO pin 1/2 mapped to combo-phy ports & GPIO pins 9/10/11/12 mapped to tc ports[1-4]. This patch defines GPIOCTL registers for GPIO pins 9-12 & uses them in GPIO pin mapping table. Cc: Anusha Srivatsa Cc: Madhav Chauhan Cc: Lucas De Marchi Reviewed-by: Lucas De Marchi Signed-off-by: Mahesh Kumar Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180612002512.29783-1-paulo.r.zanoni@intel.com commit dccc7228b5de7658f79ad0074a57a8798462c533 Author: Manasi Navare Date: Mon May 21 17:25:41 2018 -0700 drm/i915/icl: Add DDI HDMI level selection for ICL This patch adds a proper HDMI DDI entry level for vswing programming sequences on ICL. Spec doesn't specify any default for HDMI tables, so let's pick the last entry as the default for now to stay consistent with older platform like CNL. Cc: Rakshmi Bhatia Cc: Rodrigo Vivi Reviewed-by: Lucas De Marchi Signed-off-by: Manasi Navare Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-8-paulo.r.zanoni@intel.com commit e9e7dc4144cd6d4ba873fd506fe38bccb9dbbd85 Author: Chris Wilson Date: Tue Jun 12 13:04:46 2018 +0100 drm/i915/gtt: Make gen6 page directories evictable Currently all page directories are bound at creation using an unevictable node in the GGTT. This severely limits us as we cannot remove any inactive ppgtt for new contexts, or under aperture pressure. To fix this we need to make the page directory into a first class and unbindable vma. Hence, the creation of a custom vma to wrap the page directory as opposed to a GEM object. In this patch, we leave the page directories pinned upon creation. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180612120446.13901-1-chris@chris-wilson.co.uk commit 3d6d62eae7d75a902f4eacdbb2d775c7c27f3987 Author: Piotr Piorkowski Date: Tue Jun 5 17:13:30 2018 +0200 drm/i915/guc: Add support for define guc_log_size in megabytes. At this moment we can define GuC logs sizes only using pages. But GuC also allows use for this values expressed in megabytes. Lets add support for define guc_log_size in megabytes when we debug of GuC. v2: - change buffers size to more friendly (Michał Wajdeczko) - merge statements in guc_ctl_log_params_flags() (Michał Wajdeczko) v3: - fix ifdef (rename DRM_I915_DEBUG_GUC to CONFIG_DRM_I915_DEBUG_GUC) (Michał Wajdeczko) - use SZ_* macros to define buffers sizes (Michał Wajdeczko) Signed-off-by: Piotr Piórkowski Cc: Michal Wajdeczko Cc: Michał Winiarski Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Michal Wajdeczko Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180605151330.9954-2-piotr.piorkowski@intel.com commit 5288c7182dd389bb03b0a1aa38550b344fe5bf97 Author: Piotr Piorkowski Date: Tue Jun 5 17:13:29 2018 +0200 drm/i915/guc: Move defines with size of GuC logs to intel_guc_log.h At this moment, we have defined GuC logs sizes in intel_guc_fwif.h, but as these values are related directly to the GuC logs, and not to API of GuC parameters, we should move these defines to intel_guc_log.h. v2: - change buffers size to more friendly (Michał Wajdeczko) - remove GUC_LOG_SIZE define (Michał Wajdeczko) v3: - use SZ_* macros to define buffers sizes (Michał Wajdeczko) Signed-off-by: Piotr Piórkowski Cc: Michal Wajdeczko Cc: Michał Winiarski Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Michal Wajdeczko Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180605151330.9954-1-piotr.piorkowski@intel.com commit 741cebee0aa59cdaafb798c66171c2a863c3fa32 Author: Piotr Piorkowski Date: Mon Jun 4 16:19:45 2018 +0200 drm/i915/guc: Refactoring preparation of the GUC_CTL_CTXINFO parameter At the moment, the preparation of GUC_CTL_CTXINFO is disordered. Lets move all GUC_CTL_CTXINFO related operations to one place. v2: - move 'ctxnum' and 'base' declarations to USES_GUC_SUBMISSION case (Michał Wajdeczko) Signed-off-by: Piotr Piórkowski Cc: Michal Wajdeczko Cc: Michał Winiarski Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Michal Wajdeczko Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180604141947.8299-5-piotr.piorkowski@intel.com commit 532717b90bd0159f221a6f5f1d0b35514e88192b Author: Piotr Piorkowski Date: Mon Jun 4 16:19:44 2018 +0200 drm/i915/guc: Refactoring preparation of the GUC_CTL_LOG_PARAMS parameter At the moment, the preparation of GUC_CTL_LOG_PARAMS is disordered. Additionally, in struct intel_guc_log we have an unnecessary field 'flags' which we use only to assign value to GuC parameter. Lets move all GUC_CTL_LOG_PARAMS related operations to one place, and lets remove field 'flags' from struct intel_guc_log. Signed-off-by: Piotr Piórkowski Cc: Michal Wajdeczko Cc: Michał Winiarski Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Michal Wajdeczko Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180604141947.8299-4-piotr.piorkowski@intel.com commit dc755faef2640ea3d9ef3714c4ac5ece28bfe5a3 Author: Piotr Piorkowski Date: Mon Jun 4 16:19:43 2018 +0200 drm/i915/guc: Refactoring preparation of the GUC_CTL_FEATURE parameter At the moment, the preparation of GUC_CTL_FEATURE is disordered. Lets move all GUC_CTL_FEATURE related operations to one place. Signed-off-by: Piotr Piórkowski Cc: Michal Wajdeczko Cc: Michał Winiarski Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Michal Wajdeczko Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180604141947.8299-3-piotr.piorkowski@intel.com commit 24d891d81312ab3921ce735952d8d2ad34dd90fb Author: Piotr Piorkowski Date: Mon Jun 4 16:19:42 2018 +0200 drm/i915/guc: Refactoring preparation of the GUC_CTL_DEBUG parameter At the moment, the preparation of GUC_CTL_DEBUG is disordered. Lets move all GUC_CTL_DEBUG related operations to one place. v2: - move 'ads' declaration to USES_GUC_SUBMISSION case (Michał Wajdeczko) Signed-off-by: Piotr Piórkowski Cc: Michal Wajdeczko Cc: Michał Winiarski Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Michal Wajdeczko Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180604141947.8299-2-piotr.piorkowski@intel.com commit 50935ac767cab5494b4e15f3a95aa9e10513d82d Author: Piotr Piórkowski Date: Mon Jun 4 16:19:41 2018 +0200 drm/i915/guc: Don't store runtime GuC log level in modparam Currently we are using modparam as placeholder for GuC log level. Stop doing this and keep runtime GuC level in intel_guc_log struct. v2: - rename functions intel_guc_log_level_[get|set] to intel_guc_log_[get|set]_level (Michał Wajdeczko) - remove GEM_BUG_ON from intel_guc_log_get_level() (Michał Wajdeczko) Signed-off-by: Piotr Piórkowski Cc: Michal Wajdeczko Cc: Michał Winiarski Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Michal Wajdeczko Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180604141947.8299-1-piotr.piorkowski@intel.com commit a9ded78535a109389cd2ca38a22c8d5c0099f71e Author: Chris Wilson Date: Tue Jun 12 09:18:15 2018 +0100 drm/i915/gtt: Onionify error handling for gen6_ppgtt_create Pull the empty stubs together into the top level gen6_ppgtt_create, and tear each one down on error in proper onion order (rather than use Joonas' pet hate of calling the cleanup function in indeterminable state). Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180612081815.3585-2-chris@chris-wilson.co.uk commit 35ac40d8b65ab5bd09b683720bca96a1f5a0625b Author: Chris Wilson Date: Tue Jun 12 09:18:14 2018 +0100 drm/i915/gtt: Subclass gen6_hw_ppgtt The legacy gen6 ppgtt needs a little more hand holding than gen8+, and so requires a larger structure. As I intend to make this slightly more complicated in the future, separate the gen6 from the core gen8 hw struct by subclassing. This patch moves the gen6 only features out to gen6_hw_ppgtt and pipes the new type everywhere that needs it. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180612081815.3585-1-chris@chris-wilson.co.uk commit d9d117e40d4ffc03438177eeac83d96dfeee76be Author: Chris Wilson Date: Mon Jun 11 18:18:25 2018 +0100 drm/i915/ringbuffer: Serialize load of PD_DIR After triggering the mm switch with a load of PD_DIR, which may be deferred unto the MI_SET_CONTEXT on rcs, serialise the next commands with that load by posting a read of PD_DIR (or else those subsequent commands may access the stale page tables). Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180611171825.13678-2-chris@chris-wilson.co.uk commit 68a8570375df647cf8b6626d63917b564dd9390e Author: Chris Wilson Date: Mon Jun 11 18:18:24 2018 +0100 drm/i915/gtt: Invalidate GGTT caches after writing the gen6 page directories When we update the gen6 ppgtt page directories, we do so by writing the new address into a reserved slot in the GGTT. It appears that when the GPU reads that entry from the gsm, it uses its small cache and that we need to invalidate that cache after writing. We don't see an issue currently as we prefill the ppgtt page directories on creation; and only create the single aliasing_ppgtt long before we start using the GGTT (and so before the cache may have a conflicting entry). Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180611171825.13678-1-chris@chris-wilson.co.uk commit 9f4a8a2d7f9d71093f41c4bb0ef8707e8145bad3 Author: Benjamin Herrenschmidt Date: Thu May 17 15:58:00 2018 +1000 fsi/sbefifo: Add driver for the SBE FIFO This driver provides an in-kernel and a user API for accessing the command FIFO of the SBE (Self Boot Engine) of the POWER9 processor, via the FSI bus. It provides an in-kernel interface to submit command and receive responses, along with a helper to locate and analyse the response status block. It's a simple synchronous submit() type API. The user interface uses the write/read interface that an earlier version of this driver already provided, however it has some specific limitations in order to keep the driver simple and avoid using up a lot of kernel memory: - The user should perform a single write() with the command and a single read() to get the response (with a buffer big enough to hold the entire response). - On a write() the command is simply "stored" into a kernel buffer, it is submitted as one operation on the subsequent read(). This allows to have the code write directly from the FIFO into the user buffer and avoid hogging the SBE between the write() and read() syscall as it's critical that the SBE be freed asap to respond to the host. An extra write() will simply replace the previously written command. - A write of a single 4 bytes containing the value 0x52534554 in big endian will trigger a reset request. No read is necessary, the write() call will return when the reset has been acknowledged or times out. - The command is limited to 4K bytes. Signed-off-by: Benjamin Herrenschmidt Tested-by: Joel Stanley --- commit 52b7116e885e95a0d4206cca7f11ef332bb1dd89 Author: Eddie James Date: Tue May 8 17:43:32 2018 -0500 fsi: scom: Remove PIB reset during probe The PIB reset causes problems for the running P9 chip. The reset shouldn't be performed by this driver. Signed-off-by: Eddie James Reviewed-by: Christopher Bostic Signed-off-by: Benjamin Herrenschmidt Tested-by: Joel Stanley commit 26d79b272d388e2180d93d01b4085208c028f79a Author: Jeremy Kerr Date: Thu May 24 11:29:56 2018 +0800 fsi/master-gpio: Replace bit_bit lock with IRQ disable/enable We currently use a spinlock (bit_lock) around operations that clock bits out of the FSI bus, and a mutex to protect against simultaneous access to the master. This means that bit_lock isn't needed for mutual exlusion, only to prevent timing issues when clocking bits out. To reflect this, this change converts bit_lock to just the local_irq_save/restore operation. Signed-off-by: Jeremy Kerr Signed-off-by: Benjamin Herrenschmidt Tested-by: Joel Stanley commit c49e34401a32acc05bafec2b3d28d8e58410724c Author: Benjamin Herrenschmidt Date: Tue May 15 13:40:21 2018 +1000 fsi/fsi-master-gpio: More error handling cleanup Remove calls to the empty and useless fsi_master_gpio_error() function, and report CRC errors as "FSI_ERR_NO_SLAVE" when reading an all 1's response. Signed-off-by: Benjamin Herrenschmidt Tested-by: Joel Stanley commit 4e56828a5db19e2de8f8dc464c6df2e7e9ff4e13 Author: Benjamin Herrenschmidt Date: Tue May 15 16:14:43 2018 +1000 fsi/fsi-master-gpio: Implement CRC error recovery The FSI protocol defines two modes of recovery from CRC errors, this implements both: - If the device returns an ECRC (it detected a CRC error in the command), then we simply issue the command again. - If the master detects a CRC error in the response, we send an E_POLL command which requests a resend of the response without actually re-executing the command (which could otherwise have unwanted side effects such as dequeuing a FIFO twice). Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Christopher Bostic Tested-by: Joel Stanley --- Note: This was actually tested by removing some of my fixes, thus causing us to hit occasional CRC errors during high LPC activity. commit 0e82e5c1fad79ffe9d316296c7a4c1de539d0c48 Author: Jeremy Kerr Date: Thu May 10 17:22:05 2018 +0800 fsi/gpio: Use relative-addressing commands FSI CFAMs support shorter commands that use a relative (or same) address as the last. This change introduces a last_addr to the master state, and uses it for subsequent reads/writes, and performs relative addressing when a subsequent read/write is in range. Signed-off-by: Jeremy Kerr Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Christopher Bostic Tested-by: Joel Stanley commit 8193fb4451ceb8c6585a529556542bdeb375e0d9 Author: Jeremy Kerr Date: Thu May 10 17:22:04 2018 +0800 fsi/gpio: Include command build in locked section For implementing relative addressing mode, we'll need to build a command that is coherent with CFAM state. To do that, include the build_command_* functions in the locked section of read/write/term. Signed-off-by: Jeremy Kerr Signed-off-by: Benjamin Herrenschmidt Tested-by: Joel Stanley commit f3ca4834ac335bbf693d424326e4c93523a0c245 Author: Benjamin Herrenschmidt Date: Tue May 15 23:05:58 2018 +1000 fsi/fsi-master-gpio: Delay sampling of FSI data input Most SoC GPIO implementations, including the Aspeed one, have synchronizers on the GPIO inputs. This means that the value read from a GPIO is a couple of clocks old, from whatever clock source feeds those synchronizers. In practice, this means that in no-delay mode, we are using a value that can potentially be a bit too old and too close to the clock edge establishing the data on the other side of the link. The voltage converters we use on some systems make this worse and sensitive to things like voltage fluctuations etc... This is, we believe, the cause of occasional CRC errors encountered during heavy activity on the LPC bus. This is fixed by introducing a dummy GPIO read before the actual data read. It slows down SBEFIFO by about 15% (less than any delay primitive) and the end result is so far solid. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Christopher Bostic Tested-by: Joel Stanley commit b632642e4ce22f1fbf2094752e936565771b34f4 Author: Benjamin Herrenschmidt Date: Tue May 8 11:46:18 2018 +1000 fsi/fsi-master-gpio: Reduce dpoll clocks FSI_GPIO_DPOLL_CLOCKS is the number of clocks before sending a DPOLL command after receiving a BUSY status. It should be at least tSendDelay (16 clocks). According to comments in the code, it needs to also be at least 21 clocks due to HW issues. It's currently 100 clocks which impacts performances negatively in some cases. Reduces it in half to 50 clocks which seems to still be solid. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Christopher Bostic Tested-by: Joel Stanley commit 97a4e5c95bf762ac254209dc4808ee5138ee574e Author: Benjamin Herrenschmidt Date: Tue May 8 11:06:39 2018 +1000 fsi/fsi-master-gpio: Reduce turnaround clocks FSI_GPIO_PRIME_SLAVE_CLOCKS is the number of clocks if the "idle" phase between the end of a response and the beginning of the next one. It corresponds to tSendDelay in the FSI specification. The default value in the slave is 16 clocks. 100 is way overkill and significantly reduces the driver performance. This changes it to 20 (which gives the HW a bit of margin still just in case). Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Christopher Bostic Tested-by: Joel Stanley commit bc1099d2b2519fa0f6c7613d8de398df8438a36b Author: Benjamin Herrenschmidt Date: Tue May 8 11:06:38 2018 +1000 fsi/fsi-master-gpio: Add "no-gpio-delays" option This adds support for an optional device-tree property that makes the driver skip all the delays around clocking the GPIOs and set it in the device-tree of common POWER9 based OpenPower platforms. This useful on chips like the AST2500 where the GPIO block is running at a fairly low clock frequency (25Mhz typically). In this case, the delays are unnecessary and due to the low precision of the timers, actually quite harmful in terms of performance. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Christopher Bostic Tested-by: Joel Stanley commit 5d0d16f135c0cb7a12e417cbe12b271524ce4d40 Author: Benjamin Herrenschmidt Date: Tue May 8 11:06:37 2018 +1000 fsi/fsi-master-gpio: Sample input data on different clock phase We currently sample the input data right after we toggle the clock low, then high. The slave establishes the data on the rising edge, so this is not ideal. We should sample it on the low phase instead. This currently works because we have an extra delay, but subsequent patches will remove it. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Christopher Bostic Tested-by: Joel Stanley commit e5538139e043bcae133da1e55f02b0646eb601fa Author: Jeremy Kerr Date: Tue Feb 20 14:48:44 2018 +1030 fsi: gpio: Use a mutex to protect transfers Reduce time spent with interrupts disabled by limiting the critical sections to bitbanging FSI symbols. We only need to ensure exclusive use of the bus for an entire transfer, not that the transfer be performed in atomic context. Signed-off-by: Jeremy Kerr Signed-off-by: Benjamin Herrenschmidt Tested-by: Joel Stanley commit e212ab47bd029466ad758a24831e3046a34ebda1 Author: Andrew Jeffery Date: Tue Feb 20 14:48:43 2018 +1030 fsi: gpio: Remove unused 'id' variable Signed-off-by: Andrew Jeffery Signed-off-by: Benjamin Herrenschmidt Tested-by: Joel Stanley commit 918da95176beb743ff47b3bbfb0a4ee420658a95 Author: Andrew Jeffery Date: Tue Feb 20 14:48:33 2018 +1030 fsi: gpio: Trace busy count An observation from trace output of the existing FSI tracepoints was that the remote device was sometimes reporting as busy. Add a new tracepoint reporting the busy count in order to get a better grip on how often this is the case. Signed-off-by: Andrew Jeffery Acked-by: Eddie James Signed-off-by: Benjamin Herrenschmidt Tested-by: Joel Stanley commit e00fb8564ee98c5c3a72c74b1a27e441abff6cca Author: Ville Syrjälä Date: Fri May 25 21:50:45 2018 +0300 drm: Stop updating plane->crtc/fb/old_fb on atomic drivers Stop playing around with plane->crtc/fb/old_fb with atomic drivers. Make life a lot simpler when we don't have to do the magic old_fb vs. fb dance around plane updates. That way we can't risk plane->fb getting out of sync with plane->state->fb and we're less likely to leak any refcounts as well. Signed-off-by: Ville Syrjälä Reviewed-by: Maarten Lankhorst Acked-by: Harry Wentland Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-14-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit 2f958af7fc2483e09a048308fe55399343d8f20c Author: Ville Syrjälä Date: Fri May 25 21:50:44 2018 +0300 drm/vc4: Stop updating plane->fb/crtc We want to get rid of plane->fb/crtc on atomic drivers. Stop setting them. Cc: Eric Anholt Signed-off-by: Ville Syrjälä Reviewed-by: Maarten Lankhorst Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-13-ville.syrjala@linux.intel.com Reviewed-by: Eric Anholt Reviewed-by: Sinclair Yeh commit 50dcd554181e57c2352b387a0d0fb8cf4a1aa555 Author: Ville Syrjälä Date: Fri May 25 21:50:43 2018 +0300 drm/virtio: Stop updating plane->crtc We want to get rid of plane->crtc on atomic drivers. Stop setting it. v2: s/fb/crtc/ in the commit message (Gerd) Cc: David Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Signed-off-by: Ville Syrjälä Reviewed-by: Maarten Lankhorst Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-12-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit d0766b0047c2161ae2261865297992f570e63cfa Author: Ville Syrjälä Date: Fri May 25 21:50:42 2018 +0300 drm/msm: Stop updating plane->fb/crtc We want to get rid of plane->fb/crtc on atomic drivers. Stop setting them. v2: Catch a few more cases Cc: Rob Clark Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä Reviewed-by: Maarten Lankhorst #v1 Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-11-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit 67ba0c56a807912b4254da043b9b47c90a391eb6 Author: Ville Syrjälä Date: Fri May 25 21:50:41 2018 +0300 drm/exynos: Stop updating plane->crtc We want to get rid of plane->crtc on atomic drivers. Stop setting it. Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Signed-off-by: Ville Syrjälä Reviewed-by: Maarten Lankhorst Reviewed-by: Daniel Vetter Acked-by: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-10-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit cd30fbca9713d225bc61ff9a2d5f1fbaff9df2f2 Author: Ville Syrjälä Date: Fri May 25 21:50:40 2018 +0300 drm/i915: Stop updating plane->fb/crtc We want to get rid of plane->fb/crtc on atomic drivers. Stop setting them. v2: Fix up the comment in intel_crtc_active() and nuke the rest of the stale comments (Daniel) Signed-off-by: Ville Syrjälä Reviewed-by: Maarten Lankhorst #v1 Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-9-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit 9e5c947cb7c11211bb5ca55bf209730c684fe43b Author: Ville Syrjälä Date: Fri May 25 21:50:39 2018 +0300 drm/amdgpu/dc: Stop updating plane->fb We want to get rid of plane->fb on atomic drivers. Stop setting it. Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing) Zhou" Cc: Harry Wentland Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Ville Syrjälä Reviewed-by: Maarten Lankhorst Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-8-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit 93b21226bbff59e00b1b08caa4bf64325a3991b7 Author: Ville Syrjälä Date: Fri May 25 21:50:38 2018 +0300 drm/vmwgfx: Stop messing about with plane->fb/old_fb/crtc plane->fb/old_fb/crtc should no longer be used by atomic drivers. Stop messing about with them. Cc: Deepak Rawat Cc: Thomas Hellstrom Cc: Sinclair Yeh Cc: VMware Graphics Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-7-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit 0d45d79de22feb4f32de08249e93d878fa6fdab8 Author: Ville Syrjälä Date: Fri May 25 21:50:37 2018 +0300 drm/vmwgfx: Stop using plane->fb in atomic_enable() Instead of looking at the (soon to be deprecated) plane->fb we'll examing plane->state->fb instead. We can do this because vmw_du_crtc_atomic_check() prevents us from enabling a crtc without the primary plane also being enabled. Due to that same reason, I'm actually not sure what the checks here are for NULL fb. If we can't enable the crtc without an enabled plane we should always have an fb. But I'll leave that for someone else to figure out. Cc: Deepak Rawat Cc: Thomas Hellstrom Cc: Sinclair Yeh Cc: VMware Graphics Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Reviewed-by: Deepak Rawat Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-6-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit e1cd4f8e45937ce7bbf2613de2c9503d3cda6c12 Author: Ville Syrjälä Date: Fri May 25 21:50:36 2018 +0300 drm/vmwgfx: Stop updating plane->fb We want to get rid of plane->fb on atomic drivers. Stop setting it. Cc: Deepak Rawat Cc: Thomas Hellstrom Cc: Sinclair Yeh Cc: VMware Graphics Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Reviewed-by: Deepak Rawat Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-5-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit ec8a31a7d0eb9f2bc675bf4ad6bdcc9cc84e6221 Author: Ville Syrjälä Date: Fri May 25 21:50:35 2018 +0300 drm/vmwgfx: Stop using plane->fb in vmw_kms_update_implicit_fb() The only caller of vmw_kms_update_implicit_fb() is the page_flip hook which itself gets called with the plane mutex already held. Hence we can look at plane->state safely. v2: Drop the bogus lockdep assert Cc: Deepak Rawat Cc: Thomas Hellstrom Cc: Sinclair Yeh Cc: VMware Graphics Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Reviewed-by: Deepak Rawat Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-4-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit 464ce098e69cf886ce99a08cb3ebf5f8c53820b5 Author: Ville Syrjälä Date: Fri May 25 21:50:34 2018 +0300 drm/vmwgfx: Stop using plane->fb in vmw_kms_helper_dirty() Instead of plane->fb (which we're going to deprecate for atomic drivers) we need to look at plane->state->fb. The maze of code leading to vmw_kms_helper_dirty() wasn't particularly clear, but my analysis concluded that the calls originating from vmw_*_primary_plane_atomic_update() all pass in the crtc which means we'll never end up in this branch of the function. All other callers use drm_modeset_lock_all() somewhere higher up, which means accessing plane->state is safe. v2: Drop the comment and make the code do what it did before (Thomas) v3: Drop the bogus lockdep assert Cc: Deepak Rawat Cc: Thomas Hellstrom Cc: Sinclair Yeh Cc: VMware Graphics Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-3-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit 06168448733a82da165981115d61b5d2faa82761 Author: Ville Syrjälä Date: Fri May 25 21:50:33 2018 +0300 drm/vmwgfx: Stop using plane->fb in vmw_kms_atomic_check_modeset() Instead of looking at plane->fb let's look at the proper new plane state. Not that the code makes a ton of sense. It's only going through the crtcs in the atomic state, so assuming not all of them are included we're not even calculating the total bandwidth here. Also we're not considering whether each crtc is actually enabled or not. Cc: Deepak Rawat Cc: Thomas Hellstrom Cc: Sinclair Yeh Cc: VMware Graphics Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-2-ville.syrjala@linux.intel.com Reviewed-by: Sinclair Yeh commit 467d35789e5a4f47428b65ef711b30fdabbb0fd4 Author: Chris Wilson Date: Mon Jun 11 16:33:32 2018 +0100 drm/i915/execlists: Avoid putting the error pointer On allocation error, do not jump to the unwind handler that tries to free the error pointer. Reported-by: Lionel Landwerlin Fixes: a89d1f921c15 ("drm/i915: Split i915_gem_timeline into individual timelines") Signed-off-by: Chris Wilson Cc: Lionel Landwerlin Cc: Tvrtko Ursulin Reviewed-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20180611153332.14824-1-chris@chris-wilson.co.uk commit 41d37680ca0b157ad1ed29409bcdc2b0bc21d11f Author: Chris Wilson Date: Mon Jun 11 12:08:45 2018 +0100 drm/i915: Wrap around the tail offset before setting ring->tail The HW only accepts offsets within ring->size, and fails peculiarly if the RING_HEAD or RING_TAIL is set to ring->size. Therefore whenever we set ring->head/ring->tail we want to make sure it is within value (using intel_ring_wrap()). v2: Double check execlists as well v3: Remove redundancy with assert_ring_tail_valid() v4: Just assert in intel_ring_reset() rather than be over-defensive. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Cc: Tvrtko Ursulin Reviewed-by: Joonas Lahtinen #v2 Link: https://patchwork.freedesktop.org/patch/msgid/20180611110845.31890-2-chris@chris-wilson.co.uk commit b3ee09a4de33259a89d30aca6b2ebb0bc26640af Author: Chris Wilson Date: Mon Jun 11 12:08:44 2018 +0100 drm/i915/ringbuffer: Fix context restore upon reset The discovery with trying to enable full-ppgtt was that we were completely failing to the load both the mm and context following the reset. Although we were performing mmio to set the PP_DIR (per-process GTT) and CCID (context), these were taking no effect (the assumption was that this would trigger reload of the context and restore the page tables). It was not until we performed the LRI + MI_SET_CONTEXT in a following context switch would anything occur. Since we are then required to reset the context image and PP_DIR using CS commands, we place those commands into every batch. The hardware should recognise the no-ops and eliminate the expensive context loads, but we still have to pay the cost of using cross-powerwell register writes. In practice, this has no effect on actual context switch times, and only adds a few hundred nanoseconds to no-op switches. We can improve the latter by eliminating the w/a around known no-op switches, but there is an ulterior motive to keeping them. Always emitting the context switch at the beginning of the request (and relying on HW to skip unneeded switches) does have one key advantage. Should we implement request reordering on Haswell, we will not know in advance what the previous executing context was on the GPU and so we would not be able to elide the MI_SET_CONTEXT commands ourselves and always have to emit them. Having our hand forced now actually prepares us for later. Now since that context and mm follow the request, we no longer (and not for a long time since requests took over!) require a trace point to tell when we write the switch into the ring, since it is always. (This is even more important when you remember that simply writing into the ring bears no relation to the current mm.) v2: Sandybridge has to agree to use LRI as well. Testcase: igt/drv_selftests/live_hangcheck Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Cc: Tvrtko Ursulin Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180611110845.31890-1-chris@chris-wilson.co.uk commit 1fc719d13ac07b082ff9daa8f40254680cade111 Author: Chris Wilson Date: Mon Jun 11 11:48:08 2018 +0100 drm/i915/ringbuffer: Brute force context restore An issue encountered with switching mm on gen7 is that the GPU likes to hang (with the VS unit busy) when told to force restore the current context. We can simply workaround this by substituting the MI_FORCE_RESTORE flag with a round-trip through the kernel_context, forcing the context to be saved and restored; thereby reloading the PP_DIR registers and updating the modified page directory! v2: Undo attempted optimisation in caller (Tvrtko) Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Cc: Tvrtko Ursulin Reviewed-by: Joonas Lahtinen Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180611104808.24295-1-chris@chris-wilson.co.uk commit 602a9de513d5a43ecaf7d0443eca41656165d3c4 Author: Imre Deak Date: Fri Jun 8 17:41:37 2018 +0300 drm/i915/skl: Add warn about unsupported CDCLK rates While checking workarounds related to the CDCLK PLL, I noticed that the DMC firmware bits for WA#1183 are missing for SKL. After that I clarified with HW people that it's not needed on SKL, since it doesn't support eDP1.4 which would be the only thing requiring the problematic CDCLK clock rates. So in theory we shouldn't ever choose these frequencies, but add an assert in any case for catching such cases and for documentation. v2: - Move the check to skl_set_cdclk and warn whenever using the corresponding VCO freq. (Ville) v3: - Actually check for the platform. (Ville) Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180608144137.7943-1-imre.deak@intel.com commit 2b9a820318ebdf81f666be4daf7414d98123fefb Author: Michel Thierry Date: Mon Jun 4 16:32:50 2018 -0700 drm/i915/perf: fix gen11 engine class shift Use the correct engine class shift value while storing the ctx hw id. Fixes the copy+paste error from commit 61d5676b5561 ("drm/i915/perf: fix ctx_id read with GuC & ICL"). Apologies for not spotting this in the original review, the specific_ctx_id_mask is correct, only the specific_ctx_id had this problem. v2: Just use the upper 32 bits of lrc_desc (Chris) v3: If we use the lrc_desc, we must apply the ctx_id_mask too (Lionel) Fixes: 61d5676b5561 ("drm/i915/perf: fix ctx_id read with GuC & ICL") Signed-off-by: Michel Thierry Cc: Lionel Landwerlin Cc: Chris Wilson Cc: Michel Thierry Cc: Matthew Auld Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org Reviewed-by: Lionel Landwerlin Signed-off-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20180604233250.609-2-michel.thierry@intel.com commit 9904b1560e4a2e7c956004f9843939e23d84cd7b Author: Michel Thierry Date: Mon Jun 4 16:32:49 2018 -0700 drm/i915/perf: use the lrc_desc to get the ctx hw id in gen8-10 The upper 32 bits of the lrc_desc (bits 52-32 to be precise) are the context hw id in GEN8-10, so use them and have one less thing to maintain in the unlikely case we change the descriptor sw fields. v2: If we use the lrc_desc, we must apply the ctx_id_mask too (Lionel) Signed-off-by: Michel Thierry Cc: Lionel Landwerlin Cc: Chris Wilson Reviewed-by: Lionel Landwerlin Signed-off-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20180604233250.609-1-michel.thierry@intel.com commit 746c8f143afad7aaa66c484485fc39888d437a3f Author: Chris Wilson Date: Sun Jun 10 20:43:09 2018 +0100 drm/i915: Apply batch location restrictions before pinning We special case the position of the batch within the GTT to prevent negative self-relocation deltas from underflowing. However, that restriction is being applied after a trial pin of the batch in its current position. Thus we are not rejecting an invalid location if the batch has been used before, leading to an assertion if we happen to need to rearrange the entire payload. In the worst case, this may cause a GPU hang on gen7 or perhaps missing state. References: https://bugs.freedesktop.org/show_bug.cgi?id=105720 Fixes: 2889caa92321 ("drm/i915: Eliminate lots of iterations over the execobjects array") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Martin Peres Link: https://patchwork.freedesktop.org/patch/msgid/20180610194325.13467-2-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen commit acd1c1e621fcd90bf94e31b0c871cd241c9153ef Author: Chris Wilson Date: Mon Jun 11 08:55:32 2018 +0100 drm/i915: Refactor unsettting obj->mm.pages As i915_gem_object_phys_attach() wants to play dirty and mess around with obj->mm.pages itself (replacing the shmemfs with a DMA allocation), refactor the gubbins so into i915_gem_object_unset_pages() that we don't have to duplicate all the secrets. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180611075532.26534-1-chris@chris-wilson.co.uk Link: https://patchwork.freedesktop.org/patch/msgid/152871104647.1718.8796913290418060204@jlahtine-desk.ger.corp.intel.com commit 51c18bf7fdbe3c0546e86cb0fa5866fee07c5261 Author: Chris Wilson Date: Sat Jun 9 12:10:58 2018 +0100 drm/i915: Squash GEM load failure message (again) Due to a silent conflict (silent because we are trying to fix the CI test that is meant to exercising these failures!) between commit 51e645b6652c ("drm/i915: Mark the GPU as wedged without error on fault injection") and commit 8571a05a9dd0 ("drm/i915: Use GEM suspend when aborting initialisation"), we failed to actually squash the error message after injecting the load failure. Rearrange the code to export i915_load_failure() for better logging of real errors (and quiet logging of injected errors). Signed-off-by: Chris Wilson Cc: Michał Winiarski Reviewed-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/20180609111058.2660-1-chris@chris-wilson.co.uk commit 07ba0a82536e4955682b3b9077957ae1421d94bf Author: Jani Nikula Date: Fri Jun 8 15:33:30 2018 +0300 drm/i915: fix PCH_NOP setting for non-PCH platforms Setting PCH type to PCH_NOP before checking whether we actually have a PCH ends up returning true for HAS_PCH_SPLIT() on all non-PCH split platforms. Fix this by using PCH_NOP only for platforms that actually have a PCH. Cc: Ville Syrjala Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180608123330.31003-6-jani.nikula@intel.com commit 13d0464b3240429234c34b39b819fe6f088fc3c8 Author: Jani Nikula Date: Fri Jun 8 15:33:29 2018 +0300 drm/i915: be more strict about HAS_PCH_NOP() usage HAS_PCH_NOP() implies a PCH platform without south display, not generic disabled display. Prefer num_pipes == 0 for PCH independent checks. Cc: Ville Syrjala Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180608123330.31003-5-jani.nikula@intel.com commit 85b17e6e4d3f288cc757ff5407b2ca6604673d74 Author: Jani Nikula Date: Fri Jun 8 15:33:28 2018 +0300 drm/i915: clean up virtual PCH special case handling Use intel_pch_type() also for mapping the no PCH case (PCH id 0) to PCH_NONE to simplify code. Also make sure that intel_pch_type() knows all the PCH ids returned by intel_virt_detect_pch(). Loudly fail if this isn't the case; this shouldn't happen anyway. Cc: Colin Xu Reviewed-by: Ville Syrjälä Tested-by: Colin Xu Reviewed-by: Colin Xu Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180608123330.31003-4-jani.nikula@intel.com commit b8bf31d82d22ee06e7bb4802c2ce93ccb4b8ee5b Author: Lucas De Marchi Date: Fri Jun 8 15:33:27 2018 +0300 drm/i915: document PCH_NOP There's a difference between PCH_NONE and PCH_NOP: the former means we don't have a PCH while in the latter we do, but it doesn't have the south display. Signed-off-by: Lucas De Marchi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180608123330.31003-3-jani.nikula@intel.com commit 78ef3faff9ea557e54b053234b6c9461d3ea183f Author: Jani Nikula Date: Fri Jun 8 15:33:26 2018 +0300 drm/i915: fix guest virtual PCH detection on non-PCH systems Virtualized non-PCH systems such as Broxton or Geminilake should use PCH_NONE to indicate no PCH rather than PCH_NOP. The latter is a specific case to indicate a PCH system without south display. Reported-by: Colin Xu Cc: Colin Xu Reviewed-by: Ville Syrjälä Tested-by: Colin Xu Reviewed-by: Colin Xu Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180608123330.31003-2-jani.nikula@intel.com commit 1417fad75cb4eddc8d50604be88ca9a8a8de4c71 Author: Xinyun Liu Date: Thu Jun 7 22:48:42 2018 +0800 drm/i915/gvt: use array to avoid potential buffer overflow Array 'pdp_pair' of size 1 may use index value(s) 1..7. Changed to pdps[8] to avoid confusion. Signed-off-by: Xinyun Liu Signed-off-by: Zhenyu Wang commit 659571953d315b36204acac508ef8d477044d260 Author: Xinyun Liu Date: Thu Jun 7 22:48:41 2018 +0800 drm/i915/gvt: removed unnecessary boundary check type is already checked in the function entry. So it is unnecessary to check it again. Signed-off-by: Xinyun Liu Signed-off-by: Zhenyu Wang commit 1f1c60d5b577377d07863f3e0891e63a0a56a3ad Author: Xinyun Liu Date: Thu Jun 7 22:48:40 2018 +0800 drm/i915/gvt: Avoid dereference a potential null pointer Add sanity check for up_irq_info. Signed-off-by: Xinyun Liu Signed-off-by: Zhenyu Wang commit 727198f99e276c7ce8fc63e90489f63ad886ed39 Author: Giulio Benetti Date: Sat Jun 9 00:13:31 2018 +0200 staging: iio: adc: ad7606: fix function pointer parameter names missing. Checkpatch.pl complains about function pointer parameter names missing. Add parameter names. Signed-off-by: Giulio Benetti Reviewed-by: Martin Kelly Signed-off-by: Jonathan Cameron commit d8084a048cca85e3316c685415fd15234665b160 Author: Stefan Popa Date: Mon Jun 4 17:22:07 2018 +0300 iio:dac:ad5686: Add AD5311R support AD5311R is a single channel DAC with 10-bit precision and i2c interface. The device includes a 2.5V internal reference which is enabled by default. This device is similar to AD5691R/AD5692R/AD5693/AD5693R, the only difference is that it has 10-bit precision. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5310R_5311R.pdf Signed-off-by: Stefan Popa Signed-off-by: Jonathan Cameron commit a591525f43e7d17dc5f94f314d30f6e4da753d7b Author: Eugen Hristev Date: Tue May 22 10:52:37 2018 +0300 dt-bindings: iio: adc: at91-sama5d2_adc: add channel specific consumer info Added defines for channel consumer device-tree binding Signed-off-by: Eugen Hristev Reviewed-by: Rob Herring Acked-by: Ludovic Desroches Signed-off-by: Jonathan Cameron commit aa132ffb6b0a188c418f35da0750bdaf7aa34758 Author: Eugen Hristev Date: Tue May 22 10:52:36 2018 +0300 input: touchscreen: resistive-adc-touch: add generic resistive ADC touchscreen This adds a generic resistive touchscreen (GRTS) driver, which is based on an IIO device (an ADC). It must be connected to the channels of an ADC to receive touch data. Then it will feed the data into the input subsystem where it registers an input device. It uses an IIO callback buffer to register to the IIO device Some parts of this patch are based on initial original work by Mohamed Jamsheeth Hajanajubudeen and Bandaru Venkateswara Swamy Signed-off-by: Eugen Hristev Acked-by: Dmitry Torokhov Signed-off-by: Jonathan Cameron commit 23ec2774f1cc168b1f32a2e0ed2709cb473bb94e Author: Eugen Hristev Date: Tue May 22 10:52:35 2018 +0300 iio: adc: at91-sama5d2_adc: add support for position and pressure channels This implements the support for position and pressure for the included touchscreen support in the SAMA5D2 SOC ADC block. Two position channels are added and one for pressure. They can be read in raw format, or through a buffer. A normal use case is for a consumer driver to register a callback buffer for these channels. When the touchscreen channels are in the active scan mask, the driver will start the touchscreen sampling and push the data to the buffer. Some parts of this patch are based on initial original work by Mohamed Jamsheeth Hajanajubudeen and Bandaru Venkateswara Swamy Signed-off-by: Eugen Hristev Acked-by: Ludovic Desroches Signed-off-by: Jonathan Cameron commit 1b5bd7d25c7826bb2cc56ff4e9e41a4bdfd8f7a8 Author: Eugen Hristev Date: Tue May 22 10:52:34 2018 +0300 dt-bindings: input: touchscreen: resistive-adc-touch: create bindings Added bindings for generic resistive touchscreen ADC. Signed-off-by: Eugen Hristev Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 15e20eabd7f9c857a005a34be642829dd8229538 Author: Eugen Hristev Date: Tue May 22 10:52:33 2018 +0300 dt-bindings: input: touchscreen: add minimum pressure touchscreen property Add a common touchscreen optional property that will specify the minimum pressure applied to the screen that is needed such that the driver will report the touch event. Signed-off-by: Eugen Hristev Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit 3055a6cfa04ba4288589778925e8838261e56078 Author: Eugen Hristev Date: Tue May 22 10:52:32 2018 +0300 iio: Add channel for Position Relative Add new channel type for relative position on a pad. These type of analog sensor offers the position of a pen on a touchpad, and is represented as a voltage, which can be converted to a position on X and Y axis on the pad. The channel will hand the relative position on the pad in both directions. The channel can then be consumed by a touchscreen driver or read as-is for a raw indication of the touchpen on a touchpad. Signed-off-by: Eugen Hristev Signed-off-by: Jonathan Cameron commit d22cd4dd6677274df30a38149891524dde8859f3 Author: Eugen Hristev Date: Tue May 22 10:52:31 2018 +0300 MAINTAINERS: add generic resistive touchscreen adc Add MAINTAINERS entry for generic resistive touchscreen adc Signed-off-by: Eugen Hristev Signed-off-by: Jonathan Cameron commit adca2d68d70410b4a4266c2879cdfab05874c397 Author: Jonathan Cameron Date: Sun May 20 14:45:01 2018 +0100 staging: iio: Drop ADIS16060 driver from staging This part has been declared "not for new designs". It is now difficult to obtain and we have had no-one come forward with hardware making it difficult to proceed with the necessary work to move this driver out of staging. The device uses two separate chip selects and would require locking between them which is thought to be difficult to enforce without non trivial changes in the SPI subsystem. This work simply isn't worth doing given the status of the part and the fact no one seems to have gone for a similar hardware design since this one. If anyone does have access to one of these and is willing to contribute the time necessary then we can reevaluate dropping the driver. Signed-off-by: Jonathan Cameron commit 4bcc19f1b218983be841a319a3a506f2e446c6b5 Author: Jean-Baptiste Maneyrol Date: Mon May 28 15:22:04 2018 +0200 iio: imu: inv_mpu6050: new timestamp mechanism Check validity of interrupt timestamps by computing time between 2 interrupts. If it matches the chip frequency modulo 4%, it is used as the data timestamp and also for estimating the chip frequency measured from the system. Otherwise timestamp is computed using the estimated chip frequency. Signed-off-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron commit 17f0361936a5bdeb4958813b1c5542fdc91de925 Author: William Breathitt Gray Date: Sun May 27 13:18:43 2018 -0400 iio: 104-quad-8: Provide defines for magic numbers This patch adds several register and bit defines to help improve the clarity of the code by cleaning up magic numbers throughout the driver. Signed-off-by: William Breathitt Gray Signed-off-by: Jonathan Cameron commit f5057e7b2dba4c33ed293196d75cb139d5014715 Author: Jean-Baptiste Maneyrol Date: Tue May 22 16:18:21 2018 +0200 iio: imu: inv_mpu6050: better fifo overflow handling Use fifo overflow bit from int status rather than using an arbitrary threshold. Signed-off-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron commit 5cba7caaacfb842c4326959315f2817897711f53 Author: Jean-Baptiste Maneyrol Date: Tue May 22 16:18:20 2018 +0200 iio: imu: inv_mpu6050: fix fifo count reading Use unaligned access since buffer is a bytes table. Truncate fifo count to read only complete datum. Signed-off-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron commit 7b782508f829d39f30a80250935974e8f77c173a Author: Jean-Baptiste Maneyrol Date: Tue May 22 16:18:19 2018 +0200 iio: imu: inv_mpu6050: switch to use sample rate divider Instead of storing fifo rate in Hz, store the chip internal sample rate divider. This will be more useful for timestamping. There are both equivalent. Signed-off-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron commit 3ca4fb431b83faaeb9476d10f394882e135a3d83 Author: Jean-Baptiste Maneyrol Date: Tue May 22 16:18:18 2018 +0200 iio: imu: inv_mpu6050: replace timestamp fifo by generic timestamp Using a fifo for storing timestamps is useless since the interrupt is in one-shot mode, preventing the hard irq handler to be called when the irq thread is running. Instead use the generic timestamp function iio_pollfunc_store_time. Signed-off-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron commit c2c8406b315f7606175b85e9ac1b4fc0972c917f Author: Arnd Bergmann Date: Fri May 25 17:34:23 2018 +0200 iio: adc: sun4i-gpadc: select REGMAP_IRQ We can't call regmap_irq_get_virq() unless the regmap-irq support is enabled: drivers/iio/adc/sun4i-gpadc-iio.o: In function `sun4i_irq_init': sun4i-gpadc-iio.c:(.text+0x59c): undefined reference to `regmap_irq_get_virq' I came across this in a randconfig build now, but I guess this is a much older problem that I simply never hit before because regmap_irq is usually enabled by one of the other drivers that need it. Fixes: d1caa9905538 ("iio: adc: add support for Allwinner SoCs ADC") Signed-off-by: Arnd Bergmann Signed-off-by: Jonathan Cameron commit 2873c3f0e2bd12a7612e905c920c058855f4072a Author: William Breathitt Gray Date: Thu May 24 16:37:46 2018 -0400 iio: 104-quad-8: Fix off-by-one error in register selection The reset flags operation is selected by bit 2 in the "Reset and Load Signals Decoders" register, not bit 1. Fixes: 28e5d3bb0325 ("iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8") Signed-off-by: William Breathitt Gray Signed-off-by: Jonathan Cameron commit eed2890374446ff67fe5b14517d0b2b08a1a11d2 Author: Chris Wilson Date: Sat Jun 9 10:01:51 2018 +0100 drm/i915/gtt: Reorder aliasing_ppgtt fini To allow ourselves to use a first class vma for the aliasing_ppgtt page directory, we have to reorder the shutdown on module unload to remove and unpin the aliasing_ppgtt before complaining about any objects left in the GGTT. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180609090151.22007-1-chris@chris-wilson.co.uk commit e1f8789883a1bfdb4bfa8b638eeb24eb089c5836 Author: Chris Wilson Date: Fri Jun 8 16:04:35 2018 +0100 drm/i915/gtt: Remove vgpu check for gen6 Since vgpu is not supported on Haswell or any other gen6/7, we do not need to check and act upon it's enablement. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180608150435.15010-2-chris@chris-wilson.co.uk commit f6b1e35f3e47f40d18fe50a52c09a618ec703c1b Author: Chris Wilson Date: Fri Jun 8 16:04:34 2018 +0100 drm/i915/gtt: Remove redundant hsw_mm_switch() hsw_mm_switch() and gen7_mm_switch() are identical, so let's remove the redundant specialism. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180608150435.15010-1-chris@chris-wilson.co.uk commit b4e2727df2713a5aea9de6364f7a943147ceef92 Author: Chris Wilson Date: Fri Jun 8 18:32:21 2018 +0100 drm/i915/gtt: Fix unwind length passed to gen6_ppgtt_clear_range When we want to unwind an error when allocating the PD for gen6, we call gen6_ppgtt_clear_range() telling to clear upto the PD we've previously allocated. However, we passed it an incorrect length, passing it the endpoint instead. Fortunately, as the start was always 0, this has no impact today, but tomorrow we want to start using non-zero origins. Reported-by: Matthew Auld Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180608173221.10455-1-chris@chris-wilson.co.uk commit 672b3c4bc3d157078c00146c2d20bdd3aeec38e6 Author: Ville Syrjälä Date: Tue May 29 21:28:00 2018 +0300 drm/i915: Fix sprite destination colorkeying on SKL+ On SKL+ the dst colorkey must be configured on the lower plane that contains the colorkey. This is in contrast to most earlier platforms where the dst colorkey is configured on the plane above. The hardware will peform dst keying only between two immediately adjacent (in zorder) planes. Plane 2 will be keyed against plane 1, plane 3 againts plane 2, and so on. There is no way to key arbitrary planes against plane 1. Thus offering dst color keying on plane 3+ is pointless. In fact it can be harmful since enabling dst keying on more than one plane on the same pipe leads to only the top-most of the planes performing the keying. For any plane lower in zorder the dst key enable is simply ignored. v2: s/plane 0/plane 1/ etc. since the hw plane names start from 1 Don't break dst colorkey on pre-SKL sprites (hunk ended in the wrong patch) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180529182804.8571-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy #v1 commit 51e645b6652c997a68cbadf70e62a7b0c49e63a2 Author: Chris Wilson Date: Thu Jun 7 14:45:58 2018 +0100 drm/i915: Mark the GPU as wedged without error on fault injection If we have been instructed (by CI) to inject a fault to load the module with a wedged GPU, do so quietly less we upset CI. Signed-off-by: Chris Wilson Cc: Michał Winiarski Cc: Michal Wajdeczko Reviewed-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/20180607134558.31150-1-chris@chris-wilson.co.uk commit 39e78234b0be7ae543db8c8ea3cd2e433b8a7bec Author: Mika Kuoppala Date: Thu Jun 7 20:24:44 2018 +0300 drm/i915: Add WaKBLVECSSemaphoreWaitPoll There is a problem with kbl up to rev E0 where a heavy memory/fabric traffic from adjacent engine(s) can cause an engine reset to fail. This traffic can be from normal memory accesses or it can be from heavy polling on a semaphore wait. For engine hogging causing a fail, we already fallback to full reset. Which effectively stops all engines and thus we only add a workaround documentation. For the semaphore wait loop poll case, we add one microsecond poll interval to semaphore wait to guarantee bandwidth for the reset preration. The side effect is that we make semaphore completion latencies also 1us longer. v2: Let full reset handle the adjacent engine idling (Chris) v3: Skip render engine (Joonas), please checkpatch on define (Mika) References: https://bugs.freedesktop.org/show_bug.cgi?id=106684 References: VTHSD#2227190, HSDES#1604216706, BSID#0917 Cc: Joonas Lahtinen Cc: Chris Wilson Signed-off-by: Mika Kuoppala Acked-by: Chris Wilson Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180607172444.17080-1-mika.kuoppala@linux.intel.com commit c30acb04e7c401d5b412ec925ff4b862bc77b0b8 Author: Mika Kuoppala Date: Tue Jun 5 19:03:56 2018 +0300 drm/i915: Cancel reset preparations on failed resets Our reset handling has a retry layer further up in the chain. As we have told the engine to prepare for reset, and failed it, make sure to remove that preparation so that the next attempted reset has a clean slate by triggering another full prepare cycle for the engines. v2: ret as int, simplified cleanup (Chris) Cc: Chris Wilson Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180605160357.32591-1-mika.kuoppala@linux.intel.com commit 17f297b427a32ef5524a494de331c68366e8226d Author: Chris Wilson Date: Thu Jun 7 17:30:40 2018 +0100 drm/i915/gtt: Push allocation to hw ppgtt constructor In the next patch, we will subclass the gen6 hw_ppgtt. In order, for the two different generations of hw ppgtt stucts to be of different size, push the allocation down to the constructor. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180607163040.9781-1-chris@chris-wilson.co.uk commit 93f2cde2a4f7947f6330ecfb9b27d13e2f4d43af Author: Chris Wilson Date: Thu Jun 7 16:40:46 2018 +0100 drm/i915: Decouple vma vfuncs from vm To allow for future non-object backed vma, we need to be able to specialise the callbacks for binding, et al, the vma. For example, instead of calling vma->vm->bind_vma(), we now call vma->ops->bind_vma(). This gives us the opportunity to later override the operation for a custom vma. v2: flip order of unbind/bind Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180607154047.9171-2-chris@chris-wilson.co.uk commit 520ea7c581bf3ba4761c1fb61c53b11767665b62 Author: Chris Wilson Date: Thu Jun 7 16:40:45 2018 +0100 drm/i915: Prepare for non-object vma In order to allow ourselves to use VMA to wrap other entities other than GEM objects, we need to allow for the vma->obj backpointer to be NULL. In most cases, we know we are operating on a GEM object and its vma, but we need the core code (such as i915_vma_pin/insert/bind/unbind) to work regardless of the innards. The remaining eyesore here is vma->obj->cache_level and related (but less of an issue) vma->obj->gt_ro. With a bit of care we should mirror those on the vma itself. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180607154047.9171-1-chris@chris-wilson.co.uk commit 521370106d0d614fca76c7001bf5a82e1250fa27 Author: Chris Wilson Date: Wed Jun 6 22:45:20 2018 +0100 drm/i915: Change i915_gem_fault() to return vm_fault_t In preparation for vm_fault_t becoming a distinct type, convert the fault handler (i915_gem_fault()) over to the new interface. Based on a patch by Souptick Joarder References: 1c8f422059ae ("mm: change return type to vm_fault_t") Signed-off-by: Chris Wilson Cc: Souptick Joarder Cc: Joonas Lahtinen Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180606214520.20220-1-chris@chris-wilson.co.uk commit 8571a05a9dd0986a788f03e4de1a42fc9235959f Author: Chris Wilson Date: Wed Jun 6 15:54:41 2018 +0100 drm/i915: Use GEM suspend when aborting initialisation As part of our GEM initialisation now, we send a request to the hardware in order to record the initial GPU state. This coupled with deferred idle workers, makes aborting on error tricky. We already have the mechanism in place to wait on the GPU and cancel all the deferred workers for suspend, so let's reuse it during the error teardown. It is already used in places for later init error handling, but doing so at this point is slightly ugly due to the mutex dance (it's ok, the module load is still single threaded). Testcase: igt/drv_module_reload/basic-reload-inject Signed-off-by: Chris Wilson Cc: Michał Winiarski Reviewed-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/20180606145441.4460-1-chris@chris-wilson.co.uk commit 0766e2efc6968179ceec9828caf740ec0ac58a15 Merge: 9a512e23f173 14c3f8425080 Author: Zhenyu Wang Date: Thu Jun 7 10:24:50 2018 +0800 Merge tag 'drm-intel-next-2018-06-06' into gvt-next Backmerge for recent request->hw_context change and new vGPU huge page capability definition. Signed-off-by: Zhenyu Wang commit 14c3f8425080a1ff97df7b81f7c339bf42c427a3 Author: Rodrigo Vivi Date: Wed Jun 6 15:10:47 2018 -0700 drm/i915: Update DRIVER_DATE to 20180606 Signed-off-by: Rodrigo Vivi commit 64b3c93649a652c2e4a25569f167378333338347 Author: Chris Wilson Date: Wed Jun 6 21:51:28 2018 +0100 drm/i915/gtt: Fix typo in fill_px() macro The macro declared the ppgtt parameter but implicitly used the local vm instead. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180606205128.25952-1-chris@chris-wilson.co.uk commit cf68f0c3a07b092bca92e7b4f1b3893ab454bd38 Author: Chris Wilson Date: Wed Jun 6 15:41:53 2018 +0100 drm/i915: Mark i915.inject_load_failure as being hit When we reach the magic value and do inject a fault into our module load, mark the module option as being hit. Since we fail from inside pci probe, the module load isn't actually aborted and the module (and parameters) are left lingering. igt can then inspect the parameter on its synchronous completion of modprobe to see if the fault injection was successful, and will keeping on injecting new faults until the module succeeds in loading having surpassed the number of fault points. v2: Reset to 0 after being hit; Signed-off-by: Chris Wilson Cc: Michał Winiarski Cc: Imre Deak Reviewed-by: Michał Winiarski Reviewed-by: Michal Wajdeczko Link: https://patchwork.freedesktop.org/patch/msgid/20180606144153.4244-1-chris@chris-wilson.co.uk commit 82ad6443a55ea274ab2f0e24ada71f0529f3238b Author: Chris Wilson Date: Tue Jun 5 16:37:58 2018 +0100 drm/i915/gtt: Rename i915_hw_ppgtt base member In the near future, I want to subclass gen6_hw_ppgtt as it contains a few specialised members and I wish to add more. To avoid the ugliness of using ppgtt->base.base, rename the i915_hw_ppgtt base member (i915_address_space) as vm, which is our common shorthand for an i915_address_space local. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180605153758.18422-1-chris@chris-wilson.co.uk commit cd68e04cf56a38029940a33cbc834b4ab15b2bdb Author: Chris Wilson Date: Tue Jun 5 17:06:23 2018 +0100 drm/i915/error: Fixup inactive/active counting The inactive counter was over the active list, and vice versa. Fortuitously this should not cause a problem in practice as they shared the same array and clamped the number of entries they would write. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180605160623.30163-1-chris@chris-wilson.co.uk commit 70be8b3dab43497718a2260f1daf47d378815d90 Author: Michal Wajdeczko Date: Tue Jun 5 12:05:47 2018 +0000 drm/i915/guc: Don't leak stage descriptor pool on init failure In case of failure during GuC clients creation, we forget to cleanup earlier pool allocation. Use proper teardown to fix that. Signed-off-by: Michal Wajdeczko Cc: Daniele Ceraolo Spurio Cc: Chris Wilson Cc: Michal Winiarski Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180605120547.16468-1-michal.wajdeczko@intel.com commit 9f473ecfe7a8520de359ed20bf95a1628e85e650 Author: Tvrtko Ursulin Date: Tue Jun 5 15:02:53 2018 +0100 drm/i915/pmu: Do not assume fixed hrtimer period As Chris has discovered on his Ivybridge, and later automated test runs have confirmed, on most of our platforms hrtimer faced with heavy GPU load can occasionally become sufficiently imprecise to affect PMU sampling calculations. This means we cannot assume sampling frequency is what we asked for, but we need to measure the interval ourselves. This patch is similar to Chris' original proposal for per-engine counters, but instead of introducing a new set to work around the problem with frequency sampling, it swaps around the way internal frequency accounting is done. Instead of accumulating current frequency and dividing by sampling frequency on readout, it accumulates frequency scaled by each period. v2: * Typo in commit message, comment on period calculation and USEC_PER_SEC. (Chris Wilson) Testcase: igt/perf_pmu/*busy* # snb, ivb, hsw Signed-off-by: Tvrtko Ursulin Suggested-by: Chris Wilson Cc: Chris Wilson Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180605140253.3541-1-tvrtko.ursulin@linux.intel.com commit 57d7116c472cd32ab167f208e1dec100596ce949 Author: Tvrtko Ursulin Date: Tue Jun 5 14:41:24 2018 +0100 drm/i915/trace: Context field needs to be 64-bit wide Underlaying field is u64 so the tracepoint needs to be as well. v2: * Re-order binary packet for 64-bit alignment. (Chris Wilson) Signed-off-by: Tvrtko Ursulin Suggested-by: Chris Wilson Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180605134124.25672-1-tvrtko.ursulin@linux.intel.com commit f24e74a7b73953b0b0a7afcddfa26c298b20c7c8 Author: Tvrtko Ursulin Date: Fri May 25 09:26:41 2018 +0100 drm/i915/trace: Remove engine out of the context sandwich In the string tracepoint representation we ended up with the engine sandwiched between context hardware id and context fence id. Move the two pieces of context data together for redability. Binary records are left as is, that is both fields remaing under the existing name and ordering. v2: * Do not consolidate the printk format, just reorder. (Lionel) Signed-off-by: Tvrtko Ursulin Cc: Lionel Landwerlin Reviewed-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20180525082642.18246-2-tvrtko.ursulin@linux.intel.com commit 2956e970f0b5f760a7c595730bac81d2f5e6250c Author: Tvrtko Ursulin Date: Fri May 25 09:26:40 2018 +0100 drm/i915/trace: Describe engines as class:instance pairs Instead of using the engine->id, use uabi_class:instance pairs in trace- points including engine info. This will be more readable, more future proof and more stable for userspace consumption. v2: * Use u16 for class and instance. (Chris Wilson) Signed-off-by: Tvrtko Ursulin Cc: Chris Wilson Cc: svetlana.kukanova@intel.com Reviewed-by: Chris Wilson Reviewed-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20180525082642.18246-1-tvrtko.ursulin@linux.intel.com commit 420980ca79bcac50cab5bfd20c3d7e5425b1f3d6 Author: Chris Wilson Date: Tue Jun 5 14:57:46 2018 +0100 drm/i915: Swap magics and use SZ_1M Since the kernel provides SZ_1M, use it in preference of 1 << 20. Signed-off-by: Chris Wilson Reviewed-by: Michal Wajdeczko Link: https://patchwork.freedesktop.org/patch/msgid/20180605135746.8020-1-chris@chris-wilson.co.uk commit b96f6ebfd02444b290ff5048c1ae61f5d3d52319 Author: Michal Wajdeczko Date: Tue Jun 5 12:24:43 2018 +0000 drm/i915: Correctly handle error path in i915_gem_init_hw In function gem_init_hw() we are calling uc_init_hw() but in case of error later in function, we missed to call matching uc_fini_hw() v2: pulled out from the series Signed-off-by: Michal Wajdeczko Cc: Sagar Arun Kamble Cc: Chris Wilson Reviewed-by: Sagar Arun Kamble Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180605122443.23776-1-michal.wajdeczko@intel.com commit 83d317adfb4b27ec589b59548cf52e3b63a39fc9 Author: Chris Wilson Date: Tue Jun 5 10:41:07 2018 +0100 drm/i915/vma: Move the bind_count vs pin_count assertion to a helper To spare ourselves a long line later, refactor the repeated check of bind_count vs pin_count to a helper. v2: Fix up the commentary! Suggested-by: Joonas Lahtinen Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180605094107.31367-1-chris@chris-wilson.co.uk commit 744799850ef1cb053457a8a7652165e895ea26a0 Author: Chris Wilson Date: Tue Jun 5 09:28:56 2018 +0100 drm/i915/gtt: Teach restore-gtt to walk the ggtt vma list not the object list In preparation, for having non-vma objects stored inside the ggtt, to handle restoration of the GGTT following resume, we need to walk over the ggtt address space rebinding vma, as opposed to walking over bound objects looking for ggtt entries. v2: Skip objects only bound for the aliasing_ppgtt Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Joonas Lahtinen #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20180605082856.19221-1-chris@chris-wilson.co.uk commit d901e8e6733544e772713a23ab345eb79153de8c Author: Chris Wilson Date: Tue Jun 5 09:53:48 2018 +0100 drm/i915/ringbuffer: Make context pin/unpin symmetric Currently, we have a special routine for pinning the context state at the start of activity tracking, but lack the complementary unpin routine. Create it to to ease later patches that want to do partial teardown on error, and, not least, to improve the readability of the code. Suggested-by: Joonas Lahtinen Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180605085348.3018-1-chris@chris-wilson.co.uk commit 52b2416ceb72e8f757eb56de5a98ade04d9b062d Author: Changbin Du Date: Tue May 8 17:07:05 2018 +0800 drm/i915: Add new vGPU cap info bit VGT_CAPS_HUGE_GTT This adds a new vGPU cap info bit VGT_CAPS_HUGE_GTT, which is to detect whether the host supports shadowing of huge gtt pages. If host does support it, remove the page sizes restriction for vGPU. Signed-off-by: Changbin Du Reviewed-by: Joonas Lahtinen Signed-off-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/1525770425-5373-1-git-send-email-changbin.du@intel.com commit 5544717d416d9a095edc616be789bdab69e284dc Merge: 2858e2cfc2ef ff2faf1289c1 Author: Mark Brown Date: Tue Jun 5 12:27:32 2018 +0100 Merge branch 'asoc-4.18' into asoc-next commit 2858e2cfc2ef6501bc9a8cccf847a4ee58b5c9bf Merge: 29dcea88779c c90ddb69d4b2 Author: Mark Brown Date: Tue Jun 5 12:27:30 2018 +0100 Merge branch 'asoc-4.17' into asoc-linus commit aca429ff9d14f0f55f6d319d6bb1dfc2bbee09fe Author: Richard Fitzgerald Date: Mon May 21 11:00:02 2018 +0100 gpio: madera: Support Cirrus Logic Madera class codecs This adds support for the GPIOs on Cirrus Logic Madera class codecs. Any pins not used for special functions (see the pinctrl driver) can be used as general single-bit input or output lines. The number of available GPIOs varies between codecs. Note that this is part of a composite MFD for these codecs and can only be used with the corresponding MFD and other child drivers on those silicon. The GPIO block on these codecs does not exist indepedently of the rest of the MFD. Signed-off-by: Nariman Poushin Signed-off-by: Richard Fitzgerald Signed-off-by: Charles Keepax Acked-by: Linus Walleij Signed-off-by: Lee Jones commit 218d72a77b0bc203649c28f03cad6f90af88a787 Author: Richard Fitzgerald Date: Mon May 21 11:00:01 2018 +0100 pinctrl: madera: Add driver for Cirrus Logic Madera codecs These codecs have a variable number of I/O lines each of which is individually selectable to a wide range of possible functions. The functionality is slightly different from the traditional muxed GPIO since most of the functions can be mapped to any pin (and even the same function to multiple pins). Most pins have a dedicated "alternate" function that is only available on that pin. The alternate functions are usually a group of signals, though it is not always necessary to enable the full group, depending on the alternate function and how it is to be used. The mapping between alternate functions and GPIO pins varies between codecs depending on the number of alternate functions and available pins. Signed-off-by: Richard Fitzgerald Reviewed-by: Linus Walleij Signed-off-by: Lee Jones commit b3b606c98fa0cb3e4bc5ae40358e9fafd474ce11 Author: Richard Fitzgerald Date: Mon May 21 11:00:00 2018 +0100 pinctrl: madera: Add DT bindings for Cirrus Logic Madera codecs This is the binding description of the pinctrl driver for Cirrus Logic Madera codecs. The binding uses the generic pinctrl binding so the main purpose here is to describe the device-specific names for groups and functions. Signed-off-by: Richard Fitzgerald Acked-by: Rob Herring Acked-by: Linus Walleij Signed-off-by: Lee Jones commit 5c76ee4e40eb7de905eee2ed08653ba0889bb5ad Author: Richard Fitzgerald Date: Mon May 21 10:59:59 2018 +0100 mfd: madera: Register map tables for Cirrus Logic CS47L90/91 Regmap configuration tables for Cirrus Logic CS47L90 and CS47L91 codecs. Signed-off-by: Nikesh Oswal Signed-off-by: Richard Fitzgerald Signed-off-by: Charles Keepax Signed-off-by: Lee Jones commit bb7320986f9593b7d36d03895c4d6da038ecc970 Author: Richard Fitzgerald Date: Mon May 21 10:59:58 2018 +0100 mfd: madera: Register map tables for Cirrus Logic CS47L85 Regmap configuration tables for Cirrus Logic CS47L85 codecs. Signed-off-by: Nariman Poushin Signed-off-by: Richard Fitzgerald Signed-off-by: Charles Keepax Signed-off-by: Lee Jones commit f975b7faf1d527da5dc78eced43012c82f59d3a1 Author: Richard Fitzgerald Date: Mon May 21 10:59:57 2018 +0100 mfd: madera: Register map tables for Cirrus Logic CS47L35 Regmap configuration tables for Cirrus Logic CS47L35 codecs. Signed-off-by: Piotr Stankiewicz Signed-off-by: Richard Fitzgerald Signed-off-by: Charles Keepax Signed-off-by: Lee Jones commit 16b27467f46c1e0dbf093f53971aeb5decbaff4e Author: Richard Fitzgerald Date: Mon May 21 10:59:56 2018 +0100 mfd: madera: Add common support for Cirrus Logic Madera codecs This adds the generic core support for Cirrus Logic "Madera" class codecs. These are complex audio codec SoCs with a variety of digital and analogue I/O, onboard audio processing and DSPs, and other features. These codecs are all based off a common set of hardware IP so can be supported by a core of common code (with a few minor device-to-device variations). Signed-off-by: Charles Keepax Signed-off-by: Nikesh Oswal Signed-off-by: Richard Fitzgerald Signed-off-by: Lee Jones commit 2b49088cdba7dd59693887532e4058ee33b42d87 Author: Richard Fitzgerald Date: Mon May 21 10:59:55 2018 +0100 mfd: madera: Add DT bindings for Cirrus Logic Madera codecs Specification of the bindings for the parent MFD driver component of the Cirrus Logic Madera codec drivers. Note that although the interrupt controller and GPIO are child drivers their required bindings are trivial, mandatory, and exist within the parent MFD node so are documented here. Signed-off-by: Richard Fitzgerald Acked-by: Rob Herring Signed-off-by: Lee Jones commit 97c2b5cba2044f1c0bc3f14d7102176dbcf81af0 Author: Richard Fitzgerald Date: Mon May 21 10:59:54 2018 +0100 mfd: madera: Add register definitions for Cirrus Logic Madera codecs This patch adds a header file of register definitions for Cirrus Logic "Madera" class codecs. These codecs are all based off a common set of hardware IP so have a common register map (with a few minor device-to-device variations). The registers.h file is tool-generated directly from the hardware design but has been manually stripped down to reduce size (full register map is >44000 lines). All names are kept the same as datasheet names so that they can be cross-referenced between source and datasheet without confusion. The register map layout is kept fully-defined rather than factored into macros and/or block-indexing code. The major reasons for this are: - #1 is that it makes the source highly greppable, which is important. "What does the driver do with register bits XYZ" or "Where does it use register bits XYZ" are commonly types of questions. These can be quickly answered by a grep. Squashing definitions into generator macros or block- indexing code is a way of defeating grep. - most of the register definitions are used in tables, so a constant value is required. Using generator macros make the table definition clunky and obscure. - the code is clearer when it's there in the source exactly what register and field it is using - it is easier to diff the register map of a new (unsupported) codec against what is already supported and merge in differences - it makes the register map available in source for maintenance/debugging instead of having to refer back to the datasheet for a register map Signed-off-by: Richard Fitzgerald Signed-off-by: Lee Jones commit 6ceb7277173597eeed8d635e08db51e35235ab21 Author: Mahesh Kumar Date: Thu May 17 18:56:26 2018 +0530 drm/i915/icl: Don't update enabled dbuf slices struct until updated in hw Do not update number of enabled dbuf slices in dev_priv struct until we actually enable/disable dbuf slice in hw. This is leading to never updating dbuf slices and resulting in DBuf slice mismatch warning. Fixes: aa9664ffe863 ("drm/i915/icl: Enable 2nd DBuf slice only when needed") Reviewed-by: Paulo Zanoni Signed-off-by: Mahesh Kumar Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180517132626.5885-1-mahesh1.kumar@intel.com commit 61d5676b5561d61e3fdd9e88fc2b549b9b4df08f Author: Lionel Landwerlin Date: Sat Jun 2 12:29:46 2018 +0100 drm/i915/perf: fix ctx_id read with GuC & ICL One thing we didn't really understand about the OA report is that the ContextID field (dword 2) is copy of the context descriptor (dword 1). On Gen8->10 and without using GuC we didn't notice the issue because we only checked the 21bits of the ContextID field in the OA reports which matches exactly the hw_id stored into the context descriptor. When using GuC submission we have an issue of a non matching hw_id because GuC uses bit 20 of the hw_id to signal proxy submission. This change introduces a mask to compare only the relevant bits. On ICL the context descriptor format has changed and we failed to address this. On top of using a mask we also need to shift the bits properly. v2: Reuse lrc_desc rather than recomputing part of it (Chris/Michel) v3: Always pin the context we're filtering with (Chris) Signed-off-by: Lionel Landwerlin Fixes: 1de401c08fa805 ("drm/i915/perf: enable perf support on ICL") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104252 BSpec: 1237 Testcase: igt/perf/gen8-unprivileged-single-ctx-counters Acked-by: Chris Wilson Reviewed-by: Michel Thierry Link: https://patchwork.freedesktop.org/patch/msgid/20180602112946.30803-3-lionel.g.landwerlin@intel.com Cc: Lionel Landwerlin Cc: Matthew Auld Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org commit 218b5000982b7c5e7433b86819be92f95984a1ae Author: Lionel Landwerlin Date: Sat Jun 2 12:29:45 2018 +0100 drm/i915: drop one bit on the hw_id when using guc We currently using GuC as a proxy to the hardware. When Guc is used in such mode, it consumes the bit 20 of the hw_id to indicate that the workload was submitted by proxy. So far we probably haven't seen the issue because we need to allocate 1048576+ contexts to hit this issue. Still, we should avoid allocating the hw_id on that bit and restriction to bits [0:19] (i.e 20bits instead of 21). v2: Leave the max hw_id computation in i915_gem_context.c (Michel) v3: Be consistent on if/else usage (Chris) Signed-off-by: Lionel Landwerlin BSpec: 1237 Reviewed-by: Michel Thierry Acked-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180602112946.30803-2-lionel.g.landwerlin@intel.com commit 30aacd3fe7f16bc577c612b710de8f047c2c492a Author: Chris Wilson Date: Mon Jun 4 14:15:52 2018 +0100 drm/i915/gtt: Remove obsolete switch_mm hooks for gen8+ As the ppgtt for execlists is tightly coupled to the executing context, and not switch separately, we no longer use the ppgtt->switch_mm hooks on gen8+. Remove them. References: 79e6770cb1f5 ("drm/i915: Remove obsolete ringbuffer emission for gen8+") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180604131552.29370-1-chris@chris-wilson.co.uk commit 8979187a8cfa1fd221a17a06a9ce76e72ae52a05 Author: Michal Wajdeczko Date: Mon Jun 4 09:00:32 2018 +0000 drm/i915: Move i915_gem_fini to i915_gem.c We should keep i915_gem_init/fini functions together for easier tracking of their symmetry. v2: rebased, pulled out from the series Signed-off-by: Michal Wajdeczko Cc: Sagar Arun Kamble Cc: Chris Wilson Reviewed-by: Sagar Arun Kamble Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180604090032.20840-1-michal.wajdeczko@intel.com commit 6931317c714885f2d792e8150ef6715d416ac681 Author: Lubosz Sarnecki Date: Tue May 29 13:52:15 2018 +0200 drm/edid: Quirk Vive Pro VR headset non-desktop. This adds the Vive Pro's EDID information and sets EDID_QUIRK_NON_DESKTOP. Signed-off-by: Lubosz Sarnecki Signed-off-by: Daniel Stone Reviewed-by: Daniel Stone Cc: # v4.15+ Link: https://patchwork.freedesktop.org/patch/msgid/20180529115215.4526-1-lubosz.sarnecki@collabora.com commit 5428bf5a9a9f28fae1ba2c57ba4ea8f8d358d10c Author: Arkadiusz Hiler Date: Mon May 21 17:25:46 2018 -0700 drm/i915/icl: Calculate link clock using the new registers Start using the new registers for ICL and on. Cc: Manasi Navare Cc: Rodrigo Vivi Cc: Paulo Zanoni Reviewed-by: Paulo Zanoni Signed-off-by: Arkadiusz Hiler Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-13-paulo.r.zanoni@intel.com commit 51c83cfaf96382ab65717d694f80af86482ba795 Author: Manasi Navare Date: Wed May 23 15:44:44 2018 -0700 drm/i915/icl: Get DDI clock for ICL based on PLLs. PLLs are the source clocks for the DDIs so in order to determine the ddi clock we need to check the PLL configuration. This gets a little tricky for ICL since there is no register bit that maps directly to the link clock. So this patch creates a separate function in intel_dpll_mgr.c to obtain the write array PLL Params and compares the set pll_params with the table to get the corresponding link clock. v2: - Fix the encoder type check (DK). - Improve our error checking, return a sane value (Mika, Paulo). - Fix table entries (Paulo). Cc: Rodrigo Vivi Cc: Mika Kahola Cc: Paulo Zanoni Cc: Dhinakaran Pandiyan Reviewed-by: Mika Kahola Signed-off-by: Manasi Navare Signed-off-by: Lucas De Marchi [Paulo: implement v2] Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180523224444.19017-1-paulo.r.zanoni@intel.com commit f17ca5010c34e99e4035f22437f8b83452584a26 Author: Anusha Srivatsa Date: Mon May 21 17:25:43 2018 -0700 drm/i915/icl: Add Icelake PCH detection This patch adds the support to detect PCH_ICP. Reviewed-by: Paulo Zanoni Suggested-by: Paulo Zanoni Signed-off-by: Anusha Srivatsa Signed-off-by: Michel Thierry Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-10-paulo.r.zanoni@intel.com commit 3937eb1a076f251ecc29330a0b6ca10dbe2e633b Author: Radhakrishna Sripada Date: Mon May 21 17:25:42 2018 -0700 drm/i915/icl: Map VBT DDC Pin to BSpec DDC Pin On ICL we need to map VBT DDC Pin to BSpec DDC Pin. Adding ICL Pin Values. According to VBT Block 2 (General Bytes Definition) DDC Bus +----------+-----------+--------------------+ | DDI Type | VBT Value | BSpec Mapped Value | +----------+-----------+--------------------+ | DDI-A | 0x1 | 0x1 | | DDI-B | 0x2 | 0x2 | | PORT-1 | 0x4 | 0x9 | | PORT-2 | 0x5 | 0xA | | PORT-3 | 0x6 | 0xB | | PORT-4 | 0x7 | 0xC | +----------+-----------+--------------------+ Cc: James Ausmus Cc: Jani Nikula Cc: Anusha Srivatsa Cc: Clinton Taylor Cc: Ville Syrjälä Cc: Rodrigo Vivi Cc: Paulo Zanoni Reviewed-by: James Ausmus Signed-off-by: Radhakrishna Sripada Signed-off-by: Rodrigo Vivi [Paulo: checkpatch fixes.] Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-9-paulo.r.zanoni@intel.com commit a2bc69a1a9d6820976dfa014a6e7dcc53c585793 Author: Manasi Navare Date: Fri May 25 12:03:52 2018 -0700 drm/i915/icl: Add register definition for DFLEXDPMLE DFLEXDPMLE register is required to tell the FIA hardware which main links of DP are enabled on TCC Connectors. FIA uses this information to program PHY to Controller signal mapping. This register is applicable in both TC connector's Alternate mode as well as DP connector mode. v2: * Remove _ICL prefix since the reg is first introduced in ICL (Paulo) * s/ICL/icl in commit message (Lucas) Cc: Jani Nikula Cc: Animesh Manna Cc: Madhav Chauhan Cc: Anusha Srivatsa Cc: Paulo Zanoni Reviewed-by: Paulo Zanoni Signed-off-by: Manasi Navare Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/1527275032-4555-1-git-send-email-manasi.d.navare@intel.com commit ac213c1b45f7dcedb71d955c2321cbb4a2b6558e Author: Paulo Zanoni Date: Mon May 21 17:25:37 2018 -0700 drm/i915/icl: introduce tc_port Add and enum for TC ports and auxiliary functions to handle them. Icelake brings a lot of registers and other things that only apply to the TC ports and are indexed starting from 0, so having an enum for tc_ports that starts at 0 really helps the indexing. This patch is based on previous patches written by Dhinakaran Pandiyan and Mahesh Kumar. Cc: Dhinakaran Pandiyan Cc: Mahesh Kumar Reviewed-by: Mahesh Kumar Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-4-paulo.r.zanoni@intel.com commit 9bb635d9e7dbfd8e0bc352457c70e75d612c7edb Author: Dhinakaran Pandiyan Date: Mon May 21 17:25:35 2018 -0700 drm/i915/icl: Extend AUX F interrupts to ICL ICL has AUX F. Cc: Paulo Zanoni Cc: Anusha Srivatsa Reviewed-by: Anusha Srivatsa Reviewed-by: Paulo Zanoni Signed-off-by: Dhinakaran Pandiyan Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-2-paulo.r.zanoni@intel.com commit c46ef57d2008e5195f086a538550488b49644db7 Author: Mahesh Kumar Date: Fri May 25 08:52:38 2018 -0700 drm/i915/icl: fix icl_unmap/map_plls_to_ports All connectors may not have best_encoder attached, so don't dereference encoder pointer for each connector. Fixes: c27e917e2bda ("drm/i915/icl: add basic support for the ICL clocks") Reviewed-by: Lucas De Marchi Signed-off-by: Mahesh Kumar Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180525155238.7054-1-lucas.demarchi@intel.com commit 95c778daecb5cd5aafcc09ebf1353fdc759b6fd7 Author: Chris Wilson Date: Fri Jun 1 15:41:25 2018 +0100 drm/i915: Apply the full CPU domain markup before freezing Let's not take any chances by using a shortcut to mark the objects as in the CPU domain upon freezing (all pages will be written to disk and so on restore all objects will start from the CPU domain). Currently, we simply mark the objects as being in the CPU domain, bypassing the flushes. Let's call the full domain transfer function so that we have less special case code (and symmetry with the suspend path) even though it will be mostly redundant. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180601144125.18026-2-chris@chris-wilson.co.uk commit 9776f47253c3d953db8f9e33b3d75105f293ca70 Author: Chris Wilson Date: Fri Jun 1 15:41:24 2018 +0100 drm/i915: Flush all writes before suspend As we have already suspended the device, this should be a no-op except for marking that all writes are indeed complete. The downside is that we then have to walk all the lists of objects for what should be a no-op (in some cases they will be mmio read to ensure the GGTT writes are indeed flushed, and clflushes to ensure that cpu writes are in memory). It seems prudent and the safer course for us to ensure all writes are flushed to memory before suspend. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180601144125.18026-1-chris@chris-wilson.co.uk commit 0a59952b24e24e153b8d1cbd781c8d264257b1b3 Author: Ville Syrjälä Date: Mon May 21 21:56:13 2018 +0300 drm/i915: Configure SKL+ scaler initial phase correctly Set up the SKL+ scaler initial phase registers correctly. Otherwise we start fetching the data from the center of the first pixel instead of the top-left corner, which obviously then leads to right/bottom edges replicating data excessively as the data runs out half a pixel too soon. Cc: Vidya Srinivas Cc: Maarten Lankhorst Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180521185613.5097-2-ville.syrjala@linux.intel.com Reviewed-By: Vidya Srinivas commit 012d79e6a33f095c293fe2a02b2b3b26d8c6402c Author: Ville Syrjälä Date: Mon May 21 21:56:12 2018 +0300 drm/i915: Remove bogus NV12 PLANE_COLOR_CTL setup We already handle the color encoding mode properly. Remove the broken NV12 special case. Cc: Vidya Srinivas Cc: Maarten Lankhorst Fixes: 8ed30ab6aced ("drm/i915: Enable YUV to RGB for Gen10 in Plane Ctrl Reg") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180521185613.5097-1-ville.syrjala@linux.intel.com Reviewed-By: Vidya Srinivas commit b4686c481b9b60f9dea12a3001ddbaad6291dc79 Author: Ville Syrjälä Date: Wed May 30 19:59:22 2018 +0300 drm/i915: Fix tabs vs. spaces in sprite code The sprite code has a bunch of spaces where tabs should be used. Fix it up. v2: Make the patch subject more specific (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180530165933.11424-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 6380db61c54f6e5d6b05598eeb9beaf54c3e21a4 Author: Ville Syrjälä Date: Tue Jan 30 22:38:07 2018 +0200 drm/i915: s/plane/i9xx_plane/ Call the enum i9xx_plane_id variable i9xx_plane like we do elsewhere. Cc: Hans de Goede Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180130203807.13721-7-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit e876b78c5fbf1ef1b5eded8bd4d7ae045ade589a Author: Ville Syrjälä Date: Tue Jan 30 22:38:05 2018 +0200 drm/i915: Disable trickle feed for SNB/IVB cursors We disable trickle feed whenever possible, except for the cursors on SNB/IVB. Let's try disabling it there too if for no other reason than consistency. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180130203807.13721-5-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit b99b9ec1d374fd0354691d94ddb87b593f700f3e Author: Ville Syrjälä Date: Wed Jan 31 16:37:09 2018 +0200 drm/i915: Clean up cursor defines Use MCURSOR_ instead of CURSOR_ as the prefix for the non-845/865 cursor defines consistently, and move the pipe CSC enable bit next to the other non-845/865 cursor defines. v2: Take care of gvt uses as well v3: Another gvt use popped up Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180131143709.875-1-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola #v2 commit eade6c894498c12c2940e7fbe598dc08a292994f Author: Ville Syrjälä Date: Tue Jan 30 22:38:03 2018 +0200 drm/i915: Have plane->get_hw_state() return the current pipe Like we do for encoder let's make the plane->get_hw_state() return the pipe to which the plane is currently attached. We don't currently allow planes to move between the pipes, but perhaps one day we will. In either case this makes the code more uniform and perhaps makes intel_plane_mapping_ok() slightly more clear. Note that for i965 and g4x planes A and B still have pipe select bits but they're hardwired to pipe A and B respectively. This means we can safely interpret those bits just like on gen2/3. This allows the same readout code work for plane C (which can still be assigned to eiter pipe on i965) should we ever expose it. g4x no longer allows moving the cursor planes between the pipes, but the pipe select bits can still be set in the register. Thus we have to ignore those bits. OTOH i965 still allows the cursors to move between pipes thus we have to trust the bits there. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180130203807.13721-3-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 3df845e7528b4f337e5cf91f3fd75610a646b259 Author: Chris Wilson Date: Fri Jun 1 10:35:50 2018 +0100 drm/i915/gtt: Don't restore the non-existent PDE for GGTT On resume, we have to rewrite all the PDE entries for gen7 ppgtts. If we switch on full-ppgtt, there is then one address space with no PDE, the GGTT. Currently under aliasing-ppgtt, the GGTT address space does have an associated ppgtt and so the restore works just fine. We would have a similar problem if we tried disabling aliasing-ppgtt (i915.enable_ppgtt=0). So skip the empty ppgtt, as being non-existent it doesn't need restoring. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180601093554.13083-2-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen commit 37800ca8037adeeb1ccd23dc15f6452b395e3101 Author: Chris Wilson Date: Fri Jun 1 10:35:49 2018 +0100 drm/i915/gtt: Avoid calling non-existent allocate_va_range On hsw and older, we do not need to allocate the ppgtt on the fly and so ppgtt->allocate_va_range() is NULL. Fixup ppgtt_bind_vma not to call it, in that case! v2: PIN_UPDATE still exists. Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180601093554.13083-1-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180601093554.13083-2-chris@chris-wilson.co.uk commit e312b689a92d82d2b67f8b58b307fe5b79019d60 Author: Chris Wilson Date: Fri Jun 1 10:40:02 2018 +0100 drm/i915: Check intel_contexts to avoid one extra pointer chase As we store the intel_context on the request (rq->hw_context), we can simply compare that against the local intel_context for the i915->kernel_context rather than using the rq->gem_context. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180601094002.13329-1-chris@chris-wilson.co.uk commit 1934f5deaf8f53e0af0b55f87b7fc519b76515a0 Author: Chris Wilson Date: Thu May 31 23:40:57 2018 +0100 drm/i915: Assert we idle in the kernel context Now that we always switch to the kernel context upon idling, we can make that assertion. References: 4dfacb0bcbee ("drm/i915: Switch to kernel context before idling at runtime") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180531224057.6036-1-chris@chris-wilson.co.uk commit 09ea0dfbf972c63dfea8cf46f2fb67f39e4d833b Author: Gerd Hoffmann Date: Tue May 29 15:59:18 2018 +0200 dma-buf: make map_atomic and map function pointers optional So drivers don't need dummy functions just returning NULL. Cc: Daniel Vetter Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter Reviewed-by: Oleksandr Andrushchenko Link: http://patchwork.freedesktop.org/patch/msgid/20180529135918.19729-1-kraxel@redhat.com commit e065a8dd30af703b4794dc740c0825ee12b92efd Author: Dave Stevenson Date: Fri Mar 16 15:04:35 2018 -0700 drm/vc4: Add support for SAND modifier. This is the format generated by VC4's H.264 engine, and preferred by the ISP as well. By displaying SAND buffers directly, we can avoid needing to use the ISP to rewrite the SAND H.264 output to linear before display. This is a joint effort by Dave Stevenson (who wrote the initial patch and DRM demo) and Eric Anholt (drm_fourcc.h generalization, safety checks, RGBA support). v2: Make the parameter macro give all of the middle 48 bits (suggested by Daniels). Fix fourcc_mod_broadcom_mod()'s bits/shift being swapped. Mark NV12/21 as supported, not YUV420. Signed-off-by: Dave Stevenson Signed-off-by: Eric Anholt Cc: Daniel Vetter Acked-by: Daniel Stone (v1) Cc: Boris Brezillon Cc: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-3-eric@anholt.net commit 1e871d65e375280757833d9fce91dda71980bdf5 Author: Eric Anholt Date: Fri Mar 16 15:04:34 2018 -0700 drm/vc4: Add missing formats to vc4_format_mod_supported(). Daniel's format_mod_supported() patch predated Dave's for NV21/61, and I didn't catch that when rebasing. This is a problem since the formats are now getting validated before being passed to the driver's atomic hooks. Signed-off-by: Eric Anholt Acked-by: Daniel Stone Cc: Dave Stevenson Fixes: 423ad7b3cbd1 ("drm/vc4: Advertise supported modifiers for planes") Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-2-eric@anholt.net commit ec92ad00a393d07f7f6c1c9a0ff65141f2173050 Author: Chris Wilson Date: Thu May 31 09:22:46 2018 +0100 drm/i915: Only sanitize GEM from late suspend During testing we encounter a conflict between SUSPEND_TEST_DEVICES and disabling reset (gem_eio/suspend). This results in the device continuing on without being reset, but since it has gone through HW sanitization to account for the suspend/resume cycle, we have to assume the device has been reset to its defaults. A simple way around this is to skip the sanitize phase for SUSPEND_TEST_DEVICES by moving it to suspend-late. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180531082246.9763-4-chris@chris-wilson.co.uk commit c3160da9a6af0e2d8f4fb3410df9d027a178ca3d Author: Chris Wilson Date: Thu May 31 09:22:45 2018 +0100 drm/i915: After reset on sanitization, reset the engine backends As we reset the GPU on suspend/resume, we also do need to reset the engine state tracking so call into the engine backends. This is especially important so that we can also sanitize the state tracking across resume. References: https://bugs.freedesktop.org/show_bug.cgi?id=106702 Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180531082246.9763-3-chris@chris-wilson.co.uk commit 0606035fcab6b2630b0d95a5b31e235ec9ad5642 Author: Chris Wilson Date: Thu May 31 09:22:44 2018 +0100 drm/i915: "Race-to-idle" after switching to the kernel context During suspend we want to flush out all active contexts and their rendering. To do so we queue a request from the kernel's context, once we know that request is done, we know the GPU is completely idle. To speed up that switch bump the GPU clocks. Switching to the kernel context prior to idling is also used to enforce a barrier before changing OA properties, and when evicting active rendering from the global GTT. All cases where we do want to race-to-idle. v2: Limit the boosting to only the switch before suspend. v3: Limit it to the wait-for-idle on suspend. Signed-off-by: Chris Wilson Cc: David Weinehall Cc: Mika Kuoppala Tested-by: David Weinehall #v1 Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180531082246.9763-2-chris@chris-wilson.co.uk commit 4dfacb0bcbee79fa2ef4b2e9e64a8f8a28598934 Author: Chris Wilson Date: Thu May 31 09:22:43 2018 +0100 drm/i915: Switch to kernel context before idling at runtime We can reduce our exposure to random neutrinos by resting on the kernel context having flushed out the user contexts to system memory and beyond. The corollary is that we then we require two passes through the idle handler to go to sleep, which on a truly idle system involves an extra pass through the slow and irregular retire work handler. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180531082246.9763-1-chris@chris-wilson.co.uk commit 13295bd887d07a9d904401808f41a8d35946d8c2 Author: Michal Wajdeczko Date: Mon May 28 17:16:18 2018 +0000 drm/i915/guc: Don't read SOFT_SCRATCH(15) on MMIO error SOFT_SCRATCH(15) is used by GuC for sending MMIO GuC events to host and those events are now handled by intel_guc_to_host_event_handler_mmio(). We should not try to read it on MMIO action error as 1) we may be using different set of registers for GuC MMIO communication, and 2) GuC may use CTB mechanism for sending events to host. While here, upgrade error message to DRM_ERROR. Signed-off-by: Michal Wajdeczko Cc: Michel Thierry Cc: Joonas Lahtinen Cc: Chris Wilson Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180528171618.10436-1-michal.wajdeczko@intel.com commit 8fb756dfa273bcb42bdaff65baae83548b6c326d Author: Eric Anholt Date: Fri Mar 16 15:04:33 2018 -0700 drm: Trust format_mod_supported() when it OKs a plane modifier. For parameterized modifiers (Broadcom's SAND and UIF), we need to allow the parameter fields to be filled in, while exposing only the variant of the modifier with the parameter unfilled in the internal arrays and the format blob. Signed-off-by: Eric Anholt Cc: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-1-eric@anholt.net Reviewed-by: Ville Syrjälä commit d6cae4aa30ce551dfa2872f793f64d39719da6b7 Author: Maarten Lankhorst Date: Wed May 16 10:50:38 2018 +0200 drm/i915: Call intel_opregion_notify_encoder in intel_sanitize_encoder, v2. Normally this is called on a modeset, but the call is missing when we inherit the mode from the BIOS, so make sure it's called somewhere in hardware readout. Changes since v1: - Unconditionally call intel_opregion_notify_encoder. (Ville) Signed-off-by: Maarten Lankhorst Cc: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180516085038.36785-1-maarten.lankhorst@linux.intel.com Reviewed-by: Ville Syrjälä commit 9d570dbfc095de08e401d6a627c9c212ab7aaa80 Author: Rodrigo Vivi Date: Wed May 30 15:00:51 2018 -0700 drm/i915: Update DRIVER_DATE to 20180530 Signed-off-by: Rodrigo Vivi commit a38189c5f79d486cb6193a3965dad98d1b0a17b2 Author: Ville Syrjälä Date: Fri May 18 19:21:59 2018 +0300 drm/i915: Promote .format_mod_supported() to the lead role Up to now we've used the plane's modifier list as the primary source of information for which modifiers are supported by a given plane. In order to allow auxiliary metadata to be embedded within the bits of the modifier we need to stop doing that. Thus we have to make .format_mod_supported() aware of the plane's capabilities and gracefully deal with any modifier being passed in directly from userspace. v2: Rebase after NV12 Simplify Cc: Eric Anholt References: https://lists.freedesktop.org/archives/dri-devel/2018-March/169782.html Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518162159.30305-1-ville.syrjala@linux.intel.com Reviewed-by: Eric Anholt commit cc7cc5343584d90e74b7c929ff2c9a2ec8b49cfe Author: Chris Wilson Date: Tue May 29 14:29:18 2018 +0100 drm/i915: Remove stale asserts from i915_gem_find_active_request() Since we use i915_gem_find_active_request() from inside intel_engine_dump() and may call that at any time, we do not guarantee that the engine is paused nor that the signal kthreads and irq handler are suspended, so we cannot assert that the breadcrumb doesn't advance and that the irq hasn't happened on another CPU signaling the request we believe to be idle. The second assert removed (that request->engine == engine) remains valid, but is now more rigorously checked during retirement. Fixes: f636edb214a5 ("drm/i915: Make i915_engine_info pretty printer to standalone") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180529132922.6831-1-chris@chris-wilson.co.uk Reviewed-by: Tvrtko Ursulin commit a3db142829e68e2619207306a7b83e8ed47466a6 Author: Dhinakaran Pandiyan Date: Thu May 24 20:30:47 2018 -0700 drm/i915/psr: Set idle frame count based on sink synchronization latency DPCD 2009h "Synchronization latency in sink" has bits that tell us the maximum number of frames sink can take to resynchronize to source timing when exiting PSR. More importantly, as per eDP 1.4b, this is the "Minimum number of frames following PSR exit that the Source device needs to wait for PSR entry." We currently use this value only to setup the number frames to wait before PSR2 selective update. But, based on the above description it makes more sense to use this to configure idle frames for both PSR1 and and PSR2. This will ensure we wait the required number of frames before activation whether it is PSR1 or PSR2. The minimum number of idle frames remains 6, while allowing sink synchronization latency and VBT to increase this value. This also solves the flip-flop between sink and source frames that I noticed on my Thinkpad X260 during PSR exit. This specific panel has a value of 8h, which according to the spec means the "Source device must wait for more than eight active frames after PSR exit before initiating PSR entry. (In this case, should be provided by the panel supplier.)" VBT however has a value of 0. Cc: Jani Nikula Cc: Jose Roberto de Souza Cc: Rodrigo Vivi Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180525033047.7596-1-dhinakaran.pandiyan@intel.com commit bccfaffb76a8974ca275b99e9293a2594ae75f31 Author: Lukasz Majewski Date: Mon May 14 21:08:49 2018 +0200 display: panel: Add AUO g070vvn01 display support (800x480) This commit adds support for AUO's 7.0" display. Signed-off-by: Lukasz Majewski Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180514190849.18723-1-lukma@denx.de commit 4ece66b149a38c7b52ead463fb608f2aad39c20e Author: Oscar Mateo Date: Fri May 25 15:05:39 2018 -0700 drm/i915/icl: Wa_1406463099 Prevents an error in the GAM unit. Also known as WaGamTlbPendError References: HSDES#1406463099 References: HSDES#1406465643 Signed-off-by: Oscar Mateo Reviewed-by: Mika Kuoppala Signed-off-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/1527285939-20113-12-git-send-email-oscar.mateo@intel.com commit 0bf059f3532bb39c52d917142206a8554fc2f1c5 Author: Oscar Mateo Date: Fri May 25 15:05:32 2018 -0700 drm/i915/icl: WaEnableFloatBlendOptimization Enables blend optimization for floating point RTs v2: Rebased on top of the WA refactoring v3: Added References (Mika) References: HSDES#1406393558 Cc: Mika Kuoppala Signed-off-by: Oscar Mateo Reviewed-by: Mika Kuoppala Signed-off-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/1527285939-20113-5-git-send-email-oscar.mateo@intel.com commit b1f88820f4d7ea5b98f331abb50588cdc77b248a Author: Oscar Mateo Date: Fri May 25 15:05:31 2018 -0700 drm/i915/icl: Wa_2006665173 Disable blend embellishment in RCC. Also, some other registers style fixed in passing. v2: Rebased on top of the WA refactoring v3: Added References (Mika) v4: - Fixed in B0 - Mentioned style fixes in commit message References: HSDES#2006665173 Cc: Mika Kuoppala Signed-off-by: Oscar Mateo Reviewed-by: Mika Kuoppala Signed-off-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/1527285939-20113-4-git-send-email-oscar.mateo@intel.com commit f63c7b4880aabaf7423b301be438bd47a6720ddc Author: Oscar Mateo Date: Fri May 25 15:05:30 2018 -0700 drm/i915/icl: WaEnableStateCacheRedirectToCS Redirects the state cache to the CS Command buffer section for performance reasons. v2: Rebased v3: Rebased on top of the WA refactoring v3: Added References (Mika) References: HSDES#1604325460 Cc: Mika Kuoppala Signed-off-by: Oscar Mateo Reviewed-by: Mika Kuoppala Signed-off-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/1527285939-20113-3-git-send-email-oscar.mateo@intel.com commit 3c7ab27896804ebda7499969befbdbfbc4edaa53 Author: Oscar Mateo Date: Fri May 25 15:05:29 2018 -0700 drm/i915/icl: WaDisableImprovedTdlClkGating Revert to the legacy implementation. v2: GEN7_ROW_CHICKEN2 is masked v3: - Rebased - Renamed to Wa_2006611047 - A0 and B0 only v4: - Add spaces around '<<' (and fix the surrounding code as well) - Mark the WA as pre-prod v5: Rebased on top of the WA refactoring v6: Added References (Mika) v7: Fixed in B0 References: HSDES#2006611047 Signed-off-by: Oscar Mateo Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Signed-off-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/1527285939-20113-2-git-send-email-oscar.mateo@intel.com commit 6c2590914cffa9212874da5c1eddfcfe6553bda6 Author: Souptick Joarder Date: Thu May 10 19:12:04 2018 +0530 gpu: drm: drm_vm: Adding new typedef vm_fault_t Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. commit 1c8f422059ae ("mm: change return type to vm_fault_t") Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180510134203.GA25166@jordon-HP-15-Notebook-PC commit d104328ce352eec23e608dab875f2ad2fead60fb Author: Daniel Vetter Date: Thu May 24 11:01:05 2018 +0200 drm/fb-helper: Fix typo on kerneldoc Copypasta mistake. Fixes: 742547b73d27 ("drm/fb_helper: Create wrappers for blit, copyarea and fillrect funcs") Cc: Archit Taneja Cc: Daniel Vetter Cc: Gustavo Padovan Cc: Maarten Lankhorst Cc: Sean Paul Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Acked-by: Noralf Trønnes Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180524090105.21196-1-daniel.vetter@ffwll.ch commit 6b1c5eaf5cfd994bc364ce367ab4cd1f572cc476 Author: Arnd Bergmann Date: Fri May 25 17:50:08 2018 +0200 drm/sun4i: mark PM functions as __maybe_unused Disabling CONFIG_PM produces a compile time warning when these functions are not referenced: drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:1072:12: error: 'sun6i_dsi_runtime_suspend' defined but not used [-Werror=unused-function] static int sun6i_dsi_runtime_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:1043:12: error: 'sun6i_dsi_runtime_resume' defined but not used [-Werror=unused-function] static int sun6i_dsi_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 133add5b5ad4 ("drm/sun4i: Add Allwinner A31 MIPI-DSI controller support") Signed-off-by: Arnd Bergmann Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180525155030.3667352-1-arnd@arndb.de commit 8f1ad1ef1e7ac916a0b344e5e473f52b9159fc87 Author: Michal Wajdeczko Date: Fri May 25 12:18:58 2018 +0000 drm/i915/uc: Trivial s/dev_priv/i915 in intel_uc.c Some functions already use i915 name instead of dev_priv. Let's rename this param in all remaining functions, except those that still use legacy macros. v2: don't forget about function descriptions (Sagar) v3: rebased v4: rebased v5: rebased, pulled out from the series Signed-off-by: Michal Wajdeczko Reviewed-by: Sagar Arun Kamble Cc: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180525121858.53928-1-michal.wajdeczko@intel.com commit 2b5b63126ef4037a576bc8f9954629dc22274ad2 Author: Ville Syrjälä Date: Thu May 24 22:04:06 2018 +0300 drm/i915: Simplify ilk-ivb underrun suppression Let's suppress the underruns around every modeset sequence instead of trying to avoid it. Planes are disabled at this point anyway so we don't really gain anything from keeping the underrun reporting enabled. Also for PCH ports we already suppress all underruns here anyway so trying avoid it for the CPU eDP doesn't seem all that important. Maybe this gets rid of some lingering spurious underruns? Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180524190406.2973-2-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson commit 952a08a21ac537c2a0e5c481e8cf3a2426311f56 Author: Ville Syrjälä Date: Thu Apr 5 18:13:57 2018 +0300 drm/atmel-hlcdc: Stop using plane->fb We want to get rid of plane->fb on atomic drivers. Stop looking at it. Daniel pointed out that the drm_framebuffer_put() in the plane cleanup indicates that the driver doesn't shut things down cleanly. To do that we should be able to just call drm_atomic_helper_shutdown(). Not really sure the current cleanup sequence is actually sane, but whatever. v2: Replace the drm_framebuffer_put() with drm_atomic_helper_shutdown() (Daniel) Cc: Daniel Vetter Cc: Boris Brezillon Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180405151400.11326-10-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit b79df2767cc6bcb5da169d147fc199512a527d4b Author: Ville Syrjälä Date: Thu Apr 5 18:13:58 2018 +0300 drm/omapdrm: Nuke omap_framebuffer_get_next_connector() omap_framebuffer_get_next_connector() uses plane->fb which we want to deprecate for atomic drivers. As omap_framebuffer_get_next_connector() is unused just nuke the entire function. Cc: Tomi Valkeinen Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180405151400.11326-11-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter Reviewed-by: Tomi Valkeinen commit 3ed70ecd865943a2cbe9b1631f33c9370bc03578 Author: Ville Syrjälä Date: Thu Apr 5 18:14:00 2018 +0300 drm: Add local 'plane' variable for tmp->primary Clean up the ugly tmp->primary-> stuff in __drm_mode_set_config_internal() with a local plane variable. Cc: Daniel Vetter Suggested-by: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180405151400.11326-13-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit 0010ac3ffc0e2638b08869bef2588673e04b257d Author: Ville Syrjälä Date: Thu Apr 5 18:13:50 2018 +0300 drm/atmel-hlcdc: Stop consulting plane->crtc We want to get rid of plane->crtc on atomic drivers. Stop looking at it. Cc: Boris Brezillon Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180405151400.11326-3-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit df751849219b1be87c86b3224cf07fd0de4c5228 Author: Ville Syrjälä Date: Thu Apr 5 18:13:49 2018 +0300 drm/sti: Stop consulting plane->crtc We want to get rid of plane->crtc on atomic drivers. Stop looking at it. Cc: Benjamin Gaignard Cc: Vincent Abriou Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180405151400.11326-2-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit 42eb2f729e55a521e10dbb6dea6d736e0ad6df2a Author: Ville Syrjälä Date: Thu Apr 5 18:13:48 2018 +0300 drm/msm: Stop consulting plane->fb/crtc We want to get rid of plane->fb/crtc on atomic drivers. Stop looking at them. v2: Catch the plane->crtc case too Cc: Rob Clark Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä Reviewed-by: Maarten Lankhorst #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20180405151400.11326-1-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter commit 1add20eb0068fb4526b946e8ae0a94676438a6fa Author: Ville Syrjälä Date: Thu Apr 5 22:50:29 2018 +0300 drm/arc: Stop consulting plane->fb We want to stop using plane->fb with atomic driver, so stop looking at it. I have no idea what this code is trying to achieve. There is no corresponding check in the enable path. Also since arc_pgu_set_pxl_fmt() will anyway oops if there is no fb I'm going to assuming that I can just remove the check entirely. There seems to be a general shortage of .atomic_check() in this driver... Cc: Alexey Brodkin Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180405195035.24722-1-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter Acked-by: Alexey Brodkin commit ca3b3fa344476c640712aa9c49b5bc3b350f2584 Author: Ville Syrjälä Date: Fri May 18 18:01:38 2018 +0300 drm/i915: Consult VBT "LVDS config" bits to determine whether internal LVDS is present VBT seems to have some bits to tell us whether the internal LVDS port has something hooked up. In theory one might expect the VBT to not have a child device for the LVDS port if there's no panel hooked up, but in practice many VBTs still add the child device. The "LVDS config" bits seem more reliable though, so let's check those. So far we've used the "LVDS config" bits to check for eDP support on ILK+, and disable the internal LVDS when the value is 3. That value is actually documented as "Both internal LVDS and SDVO LVDS", but in practice it looks to mean "eDP" on all the ilk+ VBTs I've seen. So let's keep that interpretation, but for pre-ILK we will consider the value 3 to also indicate the presence of the internal LVDS. Currently we have 25 DMI matches for the "no internal LVDS" quirk. In an effort to reduce that let's toss in a WARN when the DMI match and VBT both tell us that the internal LVDS is not present. The hope is that people will report a bug, and then we can just nuke the corresponding entry from the DMI quirk list. Credits to Jani for this idea. v2: Split the basic int_lvds_support thing to a separate patch (Jani) v3: Rebase v4: Limit this to VBT version >= 134 Cc: Jani Nikula Cc: Ondrej Zary Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518150138.18361-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit ea80a661fe56f27821a4fc40f8149be650ec913d Author: Ville Syrjälä Date: Thu May 24 22:04:05 2018 +0300 drm/i915: Try to suppress more spurious PCH underruns on ILK-IVB My ILK seems to generate a spurious PCH underrun with most interlaced HDMI modes. Add a second vblank wait to avoid it. We have seen some spurious PCH underruns still in CI as well, some of which seem to be progressive DP. The logs also point towards some spurious underrins with progressive HDMI on SNB. While I don't have a solid explanation for those let's try to kill all the birds with one stone and always do the double wait. Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106387 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180524190406.2973-1-ville.syrjala@linux.intel.com Acked-by: Chris Wilson commit 10ed55e4d94c39cf32058cc0a2a7935b67e4bc9c Author: Ville Syrjälä Date: Wed May 23 17:57:18 2018 +0300 drm/i915: Initialize panel_pipe to INVALID_PIPE We can always figure out which pipe is affected by the panel power sequencer lockout mechanism. So no need for the pipe A fallback anymore. The only case we may have to worry about is an invalid port select in the power sequencer, but INVALID_PIPE is just fine in that case. We'll get the WARN about the bogus pps port select anyway. Cc: Jani Nikula Suggested-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180523145718.22932-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 7869196000080ace29ddd1f05153d23fa1734d79 Author: Ville Syrjälä Date: Thu May 24 22:20:35 2018 +0300 drm/edid: Fix up edid_cea_modes[] formatting Fix up a bunch of bad indentation and insconsistent comments in edid_cea_modes[]. v2: Instead of stripping the aspect ratio comments let's add them to all modes Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180524192035.9776-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 73b66f8731573a5fa74799dfabb4cdfe513b9241 Author: Chris Wilson Date: Fri May 25 10:26:29 2018 +0100 drm/i915: Prepare GEM for suspend earlier In order to prepare the GPU for sleeping, we may want to submit commands to it. This is a complicated process that may even require some swapping in from shmemfs, if the GPU was in the wrong state. As such, we need to do this preparation step synchronously before the rest of the system has started to turn off (e.g. swapin fails if scsi is suspended). Fortunately, we are provided with a such a hook, pm_ops.prepare(). v2: Compile cleanup v3: Fewer asserts, fewer problems? v4: Ville pointed out that in some circumstances (such as switching off the overlay) the display code may issue a GPU request. This is unexpected, and will result in us going to sleep with us believing the GPU is still awake (though all user work has been saved). Add a comment to remind our future selves of what trouble brews. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106640 Testcase: igt/drv_suspend after igt/gem_tiled_swapping Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180525092629.1456-1-chris@chris-wilson.co.uk Cc: Ville Syrjälä Reviewed-by: Mika Kuoppala commit fe25f3048322f32131a151ebe213f52821322f9c Author: Chris Wilson Date: Tue May 22 11:19:37 2018 +0100 drm/i915/execlists: Wait for ELSP submission on restart After a reset, we will ensure that there is at least one request submitted to HW to ensure that a context is loaded for powersaving. Let's wait for this submission via a tasklet to complete before we drop our forcewake, ensuring the system is ready for rc6 before we let it possibly sleep. Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180522101937.7738-1-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala commit 9a4dc80399b1630cea0f1ad8ef0417436cbb95d0 Author: Chris Wilson Date: Fri May 18 11:09:33 2018 +0100 drm/i915: Flush the ring stop bit after clearing RING_HEAD in reset Inside the live_hangcheck (reset) selftests, we occasionally see failures like <7>[ 239.094840] i915_gem_set_wedged rcs0 <7>[ 239.094843] i915_gem_set_wedged current seqno 19a98, last 19a9a, hangcheck 0 [5158 ms] <7>[ 239.094846] i915_gem_set_wedged Reset count: 6239 (global 1) <7>[ 239.094848] i915_gem_set_wedged Requests: <7>[ 239.095052] i915_gem_set_wedged first 19a99 [e8c:5f] prio=1024 @ 5159ms: (null) <7>[ 239.095056] i915_gem_set_wedged last 19a9a [e81:1a] prio=139 @ 5159ms: igt/rcs0[5977]/1 <7>[ 239.095059] i915_gem_set_wedged active 19a99 [e8c:5f] prio=1024 @ 5159ms: (null) <7>[ 239.095062] i915_gem_set_wedged [head 0220, postfix 0280, tail 02a8, batch 0xffffffff_ffffffff] <7>[ 239.100050] i915_gem_set_wedged ring->start: 0x00283000 <7>[ 239.100053] i915_gem_set_wedged ring->head: 0x000001f8 <7>[ 239.100055] i915_gem_set_wedged ring->tail: 0x000002a8 <7>[ 239.100057] i915_gem_set_wedged ring->emit: 0x000002a8 <7>[ 239.100059] i915_gem_set_wedged ring->space: 0x00000f10 <7>[ 239.100085] i915_gem_set_wedged RING_START: 0x00283000 <7>[ 239.100088] i915_gem_set_wedged RING_HEAD: 0x00000260 <7>[ 239.100091] i915_gem_set_wedged RING_TAIL: 0x000002a8 <7>[ 239.100094] i915_gem_set_wedged RING_CTL: 0x00000001 <7>[ 239.100097] i915_gem_set_wedged RING_MODE: 0x00000300 [idle] <7>[ 239.100100] i915_gem_set_wedged RING_IMR: fffffefe <7>[ 239.100104] i915_gem_set_wedged ACTHD: 0x00000000_0000609c <7>[ 239.100108] i915_gem_set_wedged BBADDR: 0x00000000_0000609d <7>[ 239.100111] i915_gem_set_wedged DMA_FADDR: 0x00000000_00283260 <7>[ 239.100114] i915_gem_set_wedged IPEIR: 0x00000000 <7>[ 239.100117] i915_gem_set_wedged IPEHR: 0x02800000 <7>[ 239.100120] i915_gem_set_wedged Execlist status: 0x00044052 00000002 <7>[ 239.100124] i915_gem_set_wedged Execlist CSB read 5 [5 cached], write 5 [5 from hws], interrupt posted? no, tasklet queued? no (enabled) <7>[ 239.100128] i915_gem_set_wedged ELSP[0] count=1, ring->start=00283000, rq: 19a99 [e8c:5f] prio=1024 @ 5164ms: (null) <7>[ 239.100132] i915_gem_set_wedged ELSP[1] count=1, ring->start=00257000, rq: 19a9a [e81:1a] prio=139 @ 5164ms: igt/rcs0[5977]/1 <7>[ 239.100135] i915_gem_set_wedged HW active? 0x5 <7>[ 239.100250] i915_gem_set_wedged E 19a99 [e8c:5f] prio=1024 @ 5164ms: (null) <7>[ 239.100338] i915_gem_set_wedged E 19a9a [e81:1a] prio=139 @ 5164ms: igt/rcs0[5977]/1 <7>[ 239.100340] i915_gem_set_wedged Queue priority: 139 <7>[ 239.100343] i915_gem_set_wedged Q 0 [e98:19] prio=132 @ 5164ms: igt/rcs0[5977]/8 <7>[ 239.100346] i915_gem_set_wedged Q 0 [e84:19] prio=121 @ 5165ms: igt/rcs0[5977]/2 <7>[ 239.100349] i915_gem_set_wedged Q 0 [e87:19] prio=82 @ 5165ms: igt/rcs0[5977]/3 <7>[ 239.100352] i915_gem_set_wedged Q 0 [e84:1a] prio=44 @ 5164ms: igt/rcs0[5977]/2 <7>[ 239.100356] i915_gem_set_wedged Q 0 [e8b:19] prio=20 @ 5165ms: igt/rcs0[5977]/4 <7>[ 239.100362] i915_gem_set_wedged drv_selftest [5894] waiting for 19a99 where the GPU saw an arbitration point and idles; AND HAS NOT BEEN RESET! The RING_MODE indicates that is idle and has the STOP_RING bit set, so try clearing it. v2: Only clear the bit on restarting the ring, as we want to be sure the STOP_RING bit is kept if reset fails on wedging. v3: Spot when the ring state doesn't make sense when re-initialising the engine and dump it to the logs so that we don't have to wait for an error later and try to guess what happened earlier. v4: Prepare to print all the unexpected state, not just the first. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180518100933.2239-1-chris@chris-wilson.co.uk commit 8359768c5c325f841473343288fc4d55a256954f Author: Tvrtko Ursulin Date: Thu May 24 16:06:21 2018 +0100 drm/i915: Forward declare struct intel_context This is to avoid an error with structure declared in parameter list if the include ordering changes. Signed-off-by: Tvrtko Ursulin Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180524150621.17332-2-tvrtko.ursulin@linux.intel.com commit c5d1f5562ea7f83fe911d6f9fcb3a32a8e1139ae Author: Tvrtko Ursulin Date: Thu May 24 16:06:20 2018 +0100 drm/i915: Include i915_scheduler.h from i915_gem_context.h struct i915_gem_context embeds struct i915_sched_attr so needs to include the respective header. Signed-off-by: Tvrtko Ursulin Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180524150621.17332-1-tvrtko.ursulin@linux.intel.com commit 9eece5d9c6e0316f17091e37ff3ec87331bdedf3 Author: Oleksandr Andrushchenko Date: Wed May 23 14:36:30 2018 +0300 drm/xen-front: fix pointer casts Building for a 32-bit target results in warnings from casting between a 32-bit pointer and a 64-bit integer. Fix the warnings by casting those pointers to uintptr_t first. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Juergen Gross Link: https://patchwork.freedesktop.org/patch/msgid/20180523113630.29811-1-andr2000@gmail.com commit 09a4c02e58c1b3d9748f78242962b7f63c68477e Author: Chris Wilson Date: Thu May 24 09:11:35 2018 +0100 drm/i915: Look for an active kernel context before switching We were not very carefully checking to see if an older request on the engine was an earlier switch-to-kernel-context before deciding to emit a new switch. The end result would be that we could get into a permanent loop of trying to emit a new request to perform the switch simply to flush the existing switch. What we need is a means of tracking the completion of each timeline versus the kernel context, that is to detect if a more recent request has been submitted that would result in a switch away from the kernel context. To realise this, we need only to look in our syncmap on the kernel context and check that we have synchronized against all active rings. v2: Since all ringbuffer clients currently share the same timeline, we do have to use the gem_context to distinguish clients. As a bonus, include all the tracing used to debug the death inside suspend. v3: Test, test, test. Construct a selftest to exercise and assert the expected behaviour that multiple switch-to-contexts do not emit redundant requests. Reported-by: Mika Kuoppala Fixes: a89d1f921c15 ("drm/i915: Split i915_gem_timeline into individual timelines") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180524081135.15278-1-chris@chris-wilson.co.uk commit 2edd4e698dc8a0c497a502c75561c87be0e8a9a6 Author: Chris Wilson Date: Mon May 21 09:21:31 2018 +0100 drm/i915: Pin the ring high If we can use an unmappable ring, try to pin it out of the mappable aperture. This simple layout preference is to try and keep the mappable aperture reserved and available to handle GGTT mmapping requests from userspace without causing evictions and GPU stalls. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180521082131.13744-4-chris@chris-wilson.co.uk commit eb479f86397923cdb82dabae4ca33dc4fec18968 Author: Chris Wilson Date: Mon May 21 09:21:30 2018 +0100 drm/i915: Limit searching for PIN_HIGH To no surprise (since we've flip-flopped over the use of PIN_HIGH a few times), doing a search by address over a pathologically fragmented address space is exceeding slow. To protect ourselves from nearly unbounded latency (think searching a million holes while under struct_mutex), limit the search for the highest available hole and fallback to best-fit if it fails. In the pathologically fragmented case, such as igt/gem_ctx_thrash, the effect is dramatic, bringing the runtime down from hours to seconds (depending on how many other slow searches you hit, e.g. alloc_iova() and alloc_vmap_area() both degrade to a slow rbtree walk after their small cache is exhausted). For the real world, the number of search steps is unlikely to be significant as we should only need to search once per new context. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180521082131.13744-3-chris@chris-wilson.co.uk commit 83bc4ec37210b17bd611a58968b2ce0e9cc7f251 Author: Chris Wilson Date: Mon May 21 09:21:29 2018 +0100 drm/mm: Add a search-by-address variant to only inspect a single hole Searching for an available hole by address is slow, as there no guarantee that a hole will be available and so we must walk over all nodes in the rbtree before we determine the search was futile. In many cases, the caller doesn't strictly care for the highest available hole and was just opportunistically laying out the address space in a preferred order. In such cases, the caller can accept any address and would rather do so then do a slow walk. To be able to mix search strategies, the caller wants to tell the drm_mm how long to spend on the search. Without a good guide for what should be the best split, start with a request to try once at most. That is return the top-most (or lowest) hole if it fulfils the alignment and size requirements. v2: Documentation, by why of example (selftests) and kerneldoc. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180521082131.13744-2-chris@chris-wilson.co.uk commit 2f7e87692e0441abf27a9714991edd136e87363a Author: Chris Wilson Date: Mon May 21 09:21:28 2018 +0100 drm/mm: Reject over-sized allocation requests early As we keep an rbtree of available holes sorted by their size, we can very easily determine if there is any hole large enough that might satisfy the allocation request. This helps when dealing with a highly fragmented address space and a request for a search by address. To cache the largest size, we convert into the cached rbtree variant which tracks the leftmost node for us. However, currently we sorted into ascending size order so the leftmost node is the smallest, and so to make it the largest hole we need to invert our sorting. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20180521082131.13744-1-chris@chris-wilson.co.uk commit 97c9de66ca8075871b31f4af05593e027e880e67 Author: Dhinakaran Pandiyan Date: Fri May 11 12:51:45 2018 -0700 drm/i915/psr: Fix ALPM cap check for PSR2 While touching the code around this, I noticed that absence of ALPM capability does not stop us from enabling PSR2. But, the spec unambiguously states that ALPM is required for PSR2 and so does this commit that introduced this code drm/i915/psr: enable ALPM for psr2 As per edp1.4 spec , alpm is required for psr2 operation as it's used for all psr2 main link power down management and alpm enable bit must be set for psr2 operation. Cc: Jose Roberto de Souza Cc: Vathsala Nagaraju Reviewed-by: Vathsala Nagaraju Reviewed-by: Tarun Vyas Signed-off-by: Dhinakaran Pandiyan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180511195145.3829-6-dhinakaran.pandiyan@intel.com commit 264ff016cf0672f99f98ea853dbc7e45c3527bc2 Author: Dhinakaran Pandiyan Date: Fri May 11 12:51:44 2018 -0700 drm/i915/psr: Fall back to max. synchronization latency if DPCD read fails Noticed that we assume the best case of 0 latency when the DPCD read fails, reasonable pessimism is safer. eDP spec does say that if latency is greater than 8, the panel supplier needs to provide it. I didn't see anything specific in the VBT for this, so let's go with 8 frames as a fallback. Cc: Jose Roberto de Souza Cc: Ville Syrjälä Reviewed-by: José Roberto de Souza Signed-off-by: Dhinakaran Pandiyan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180511195145.3829-5-dhinakaran.pandiyan@intel.com commit 1e8b251ebcbbfc6bfa826bca4d91a8e1bcad2e5f Author: Dhinakaran Pandiyan Date: Fri May 11 12:51:43 2018 -0700 drm/i915/psr: Avoid unnecessary DPCD read of DP_PSR_CAPS intel_dp->psr_dpcd already has the required values. Cc: Jose Roberto de Souza Reviewed-by: Tarun Vyas Reviewed-by: Vathsala Nagaraju Signed-off-by: Dhinakaran Pandiyan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180511195145.3829-4-dhinakaran.pandiyan@intel.com commit 84bb2916a6835636fe28e8db192c3293f2d4df21 Author: Dhinakaran Pandiyan Date: Fri May 11 12:51:41 2018 -0700 drm/i915/psr: Check for SET_POWER_CAPABLE bit at PSR init time. By moving the check from psr_compute_config() to psr_init_dpcd(), we get to set the dev_priv->psr.sink_support flag only when the panel is capable of changing power state. An additional benefit is that the check will be performed only at init time instead of every atomic_check. This should change the psr_basic IGT failures on HSW to skips. v2: Return early when SET_POWER_CAPABLE bit is 0 (Jose) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106217 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106346 Cc: José Roberto de Souza Cc: Ville Syrjälä Signed-off-by: Dhinakaran Pandiyan Reviewed-by: José Roberto de Souza Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180511195145.3829-2-dhinakaran.pandiyan@intel.com commit 8cf6da7ef755c8e09094baae941134b771bd4344 Author: Dhinakaran Pandiyan Date: Fri May 11 12:51:40 2018 -0700 drm/i915/psr: Avoid DPCD reads when panel does not support PSR Ville noticed that we are unncessarily reading DPCD's after knowing panel did not support PSR. Looks like this check that was present earlier got removed unintentionally, let's put it back. While we do this, add the PSR version number in the debug print. Cc: Ville Syrjälä Reviewed-by: Tarun Vyas Reviewed-by: Vathsala Nagaraju Signed-off-by: Dhinakaran Pandiyan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180511195145.3829-1-dhinakaran.pandiyan@intel.com commit ce3508fd2a778e9366ab638f4e1dbe6dab874c5b Author: Dhinakaran Pandiyan Date: Fri May 11 16:00:59 2018 -0700 drm/i915/psr: Nuke PSR support for VLV and CHV PSR hardware and hence the driver code for VLV and CHV deviates a lot from their DDI counterparts. While the feature has been disabled for a long time now, retaining support for these platforms is a maintenance burden. There have been multiple refactoring commits to just keep the existing code for these platforms in line with the rest. There are known issues that need to be fixed to enable PSR on these platforms, and there is no PSR capable platform in CI to ensure the code does not break again if we get around to fixing the existing issues. On account of all these reasons, let's nuke this code for now and bring it back if a need arises in the future. Cc: Jani Nikula Cc: Rodrigo Vivi Cc: Ville Syrjälä Acked-by: Jani Nikula Acked-by: Rodrigo Vivi Reviewed-by: José Roberto de Souza Signed-off-by: Dhinakaran Pandiyan Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180511230059.19387-1-dhinakaran.pandiyan@intel.com commit 77312ae8f071fb389d9982ce743b72975990c4d9 Author: Vathsala Nagaraju Date: Tue May 22 14:57:23 2018 +0530 drm/i915/psr: vbt change for psr For psr block #9, the vbt description has moved to options [0-3] for TP1,TP2,TP3 Wakeup time from decimal value without any change to vbt structure. Since spec does not mention from which VBT version this change was added to vbt.bsf file, we cannot depend on bdb->version check to change for all the platforms. There is RCR inplace for GOP team to provide the version number to make generic change. Since Kabylake with bdb version 209 is having this change, limiting this change to gen9_bc and version 209+ to unblock google. Tested on skl(bdb version 203,without options) and kabylake(bdb version 209,212) having new options. bspec 20131 v2: (Jani and Rodrigo) move the 165 version check to intel_bios.c v3: Jani Move the abstraction to intel_bios. v4: Jani Rename tp*_wakeup_time to have "us" suffix. For values outside range[0-3],default to max 2500us. Old decimal value was wake up time in multiples of 100us. v5: Jani and Rodrigo Handle option 2 in default condition. Print oustide range value. For negetive values default to 2500us. v6: Jani Handle default first and then fall through for case 2. v7: Rodrigo Apply this change for IS_GEN9_BC and vbt version > 209 v8: Puthik Add new function vbt_psr_to_us. v9: Jani Change to v7 version as it's more readable. DK add comment /*fall through*/ after case2. Cc: Rodrigo Vivi Cc: Puthikorn Voravootivat Cc: Dhinakaran Pandiyan Cc: Jani Nikula Cc: José Roberto de Souza Signed-off-by: Maulik V Vaghela Signed-off-by: Vathsala Nagaraju Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1526981243-2745-1-git-send-email-vathsala.nagaraju@intel.com commit 1d1a4f6dd1645fba6533c7884582006d13664748 Author: Souptick Joarder Date: Mon Apr 16 20:32:32 2018 +0530 gpu: drm: vgem: Change return type to vm_fault_t Use new return type vm_fault_t for fault handler. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180416150232.GA26745@jordon-HP-15-Notebook-PC commit fe864b76c2ab9503b4ff90d5d8785716a0b8d815 Author: Yunwei Zhang Date: Fri May 18 15:41:25 2018 -0700 drm/i915: Implement WaProgramMgsrForL3BankSpecificMmioReads L3Bank could be fused off in hardware for debug purpose, and it is possible that subslice is enabled while its corresponding L3Bank pairs are disabled. In such case, if MCR packet control register(0xFDC) is programed to point to a disabled bank pair, a MMIO read into L3Bank range will return 0 instead of correct values. However, this is not going to be the case in any production silicon. Therefore, we only check at initialization and issue a warning should this really happen. References: HSDES#1405586840 v2: - use fls instead of find_last_bit (Chris) - use is_power_of_2() instead of counting bit set (Chris) v3: - rebase on latest tip v5: - Added references (Mika) - Move local variable into scope where they are used (Ursulin) - use a new local variable to reduce long line of code (Ursulin) v6: - Some coding style and use more local variables for clearer logic (Ursulin) Cc: Oscar Mateo Cc: Michel Thierry Cc: Joonas Lahtinen Cc: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Signed-off-by: Yunwei Zhang Reviewed-by: Oscar Mateo Signed-off-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/1526683285-24861-1-git-send-email-yunwei.zhang@intel.com commit d78fa508f08d7d91d8ce9e2cec1f04bd2d63f0a1 Author: Yunwei Zhang Date: Fri May 18 15:40:32 2018 -0700 drm/i915/icl: Enable WaProgramMgsrForCorrectSliceSpecificMmioReads WaProgramMgsrForCorrectSliceSpecificMmioReads applies for Icelake as well. References: HSD#1405586840, BSID#0575 v2: - GEN11 mask is different from its predecessors. (Oscar) - Better separate GEN10 and GEN11. (Oscar) Cc: Oscar Mateo Cc: Michel Thierry Cc: Joonas Lahtinen Cc: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Signed-off-by: Yunwei Zhang Reviewed-by: Oscar Mateo Signed-off-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/1526683232-24753-1-git-send-email-yunwei.zhang@intel.com commit 1e40d4aea57bbbd277777dd1fe18599dd77c55ab Author: Yunwei Zhang Date: Fri May 18 15:39:57 2018 -0700 drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads WaProgramMgsrForCorrectSliceSpecificMmioReads dictate that before any MMIO read into Slice/Subslice specific registers, MCR packet control register(0xFDC) needs to be programmed to point to any enabled slice/subslice pair. Otherwise, incorrect value will be returned. However, that means each subsequent MMIO read will be forwarded to a specific slice/subslice combination as read is unicast. This is OK since slice/subslice specific register values are consistent in almost all cases across slice/subslice. There are rare occasions such as INSTDONE that this value will be dependent on slice/subslice combo, in such cases, we need to program 0xFDC and recover this after. This is already covered by read_subslice_reg. Also, 0xFDC will lose its information after TDR/engine reset/power state change. References: HSD#1405586840, BSID#0575 v2: - use fls() instead of find_last_bit() (Chris) - added INTEL_SSEU to extract sseu from device info. (Chris) v3: - rebase on latest tip v5: - Added references (Mika) - Change the ordered of passing arguments and etc. (Ursulin) v7: - Moved WA explanation Comments(Oscar) - Rebased. v8: - Renamed sanitize_mcr to calculate_s_ss_select. (Oscar) - calculate s/ss selector instead of whole mcr. (Oscar) v9: - Updated function name (Oscar) - Remove redundant variables (Oscar) v10: - Separate pre-GEN10 and GEN11 mask. (Oscar) Cc: Oscar Mateo Cc: Michel Thierry Cc: Joonas Lahtinen Cc: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Signed-off-by: Yunwei Zhang Reviewed-by: Oscar Mateo Signed-off-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/1526683197-24656-1-git-send-email-yunwei.zhang@intel.com commit 949bdcc8a97c6078f21c8d4966436b117f2e4cd3 Author: Kevin Hilman Date: Mon May 21 13:08:32 2018 -0700 ARM: dts: dra7: fix DCAN node addresses Fix the DT node addresses to match the reg property addresses, which were verified to match the TRM: http://www.ti.com/lit/pdf/sprui30 Cc: Roger Quadros Signed-off-by: Kevin Hilman Acked-by: Roger Quadros Signed-off-by: Tony Lindgren commit c894d63c6b36de20f0248d88801be5ace8e6bee8 Author: José Roberto de Souza Date: Fri May 18 13:15:47 2018 -0700 drm/i915/icl: Disable pipe CSC and gamma in cursor plane 'Pipe CSC enable' bit is more than just deprecated in ICL+, it was disabled in commit 077ef1f09c25 ("drm/i915/icl: Don't set pipe CSC/Gamma in PLANE_COLOR_CTL") for primary and sprite planes as it was causing those planes to be rendered as always black but it was not disabled in cursor plane, also causing it to be rendered as black. As mentioned in the commit referenced above, this is a workaround too and the CSC and gamma per plane values needs to be setup before enable CSC and gamma again. BSpec: 4278 and 7635 Cc: James Ausmus Cc: Paulo Zanoni Reviewed-by: Paulo Zanoni Signed-off-by: José Roberto de Souza Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20180518201547.15793-1-jose.souza@intel.com commit 4a774ee35c9f57feaf332b252ecb2d4275521c8a Author: Chris Wilson Date: Wed May 23 15:23:46 2018 +0100 drm/i915/selftests: Pin the mock kernel context The driver assumes that the kernel context is pinned and always available for use from any process or atomic context. Make it so for selftesting as well! Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180523142346.27953-1-chris@chris-wilson.co.uk commit f0d2b758e05e209f4572182afade180cda22c9c8 Author: Ville Syrjälä Date: Fri May 18 18:29:31 2018 +0300 drm/i915: WARN if power sequencer is not connected to the LVDS port on pre-ilk We don't support using the power sequencer with other ports besides LVDS on pre-ilk platforms. WARN if someone has mistakenly connected the power sequencer to the wrong port. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518152931.13104-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 4c23dea48b0d8d9da2ac0911f8cee105f4394281 Author: Ville Syrjälä Date: Fri May 18 18:29:30 2018 +0300 drm/i915: Implement the missing bits of assert_panel_unlocked() Add the missing eDP port handling into assert_panel_unlocked(). We now have intel_dp_port_enabled() which makes this trivial. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518152931.13104-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 05bf51d3b5750f3b47c241e094b9c2230a9c1a93 Author: Ville Syrjälä Date: Fri May 18 18:29:29 2018 +0300 drm/i915: Allow eDP on port C in theory The power sequencer has bits to allow DP C to be used for eDP. Currently we assume this will never happen, but I guess it could theoretically be a thing. Make the code do the right thing in that case, and toss in a MISSING_CASE() for any other port. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518152931.13104-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 59b74c497ae4e9d703307bc9b7b20566588d1ccf Author: Ville Syrjälä Date: Fri May 18 18:29:28 2018 +0300 drm/i915: Clean up DP pipe select bits Clean up the DP pipe select bits. To make the whole situation a bit less ugly we'll start to share the same code between .get_hw_state(), the port state asserts, and the VLV power sequencer code. v2: Return PIPE_A for cpt/ppt when the port isn't selected by any transcoder. Returning INVALID_PIPE explodes *somewhere* on some machines (can't immediately see where though). This now matches the old behaviour. v3: Order the defines shift,mask,value (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518152931.13104-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 5a0b385e1cb6a8289e01367710035e18d72794cd Author: Ville Syrjälä Date: Fri May 18 18:29:27 2018 +0300 drm/i915: Nuke intel_trans_dp_port_sel() for_each_encoder_on_crtc() is legacy and shouldn't be used by atomic drivers. Let's throw out intel_trans_dp_port_sel() and replace it with intel_get_crtc_new_encoder() which looks the atomic state instead. Since we now have to call intel_get_crtc_new_encoder() during the commit phase we'll need to plumb in the top level atomic state. The crtc_state->state pointers are no longer valid at that point. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518152931.13104-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f67dc6d8869fd29fb1635119e3210bf92ce983a2 Author: Ville Syrjälä Date: Fri May 18 18:29:26 2018 +0300 drm/i915: Parametrize TRANS_DP_PORT_SEL Parametrize the TRANS_DP_PORT_SEL macros. v2: WARN for bogus ports (Jani) Order the defines mask,value (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518152931.13104-2-ville.syrjala@linux.intel.com commit f606bc6d9d416504596844d513474791cdbb3993 Author: Ville Syrjälä Date: Fri May 18 18:29:25 2018 +0300 drm/i915: Move intel_ddi_get_crtc_new_encoder() out from ddi code The ddi code no longer uses intel_ddi_get_crtc_new_encoder(). Move it elsewhere where we have some users left. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180518152931.13104-1-ville.syrjala@linux.intel.com commit 3c5f134ac9d0e405a15af652c3ce8cbaa9bf1bc7 Author: Souptick Joarder Date: Wed Apr 25 10:29:22 2018 +0530 gpu: drm: udl: Adding new typedef vm_fault_t Use new return type vm_fault_t for fault and huge_fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_page() returns err which driver mapped into VM_FAULT_* type. The new function vmf_ insert_page() will replace this inefficiency by returning VM_FAULT_* type. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180425045922.GA21590@jordon-HP-15-Notebook-PC commit ca510ead96d78c5379db5d36ffbdf5382f36db6d Author: Laura Abbott Date: Tue Apr 10 18:03:30 2018 -0700 drm/i2c: tda998x: Remove VLA usage There's an ongoing effort to remove VLAs[1] from the kernel to eventually turn on -Wvla. The vla in reg_write_range is based on the length of data passed. The one use of a non-constant size for this range is bounded by the size buffer passed to hdmi_infoframe_pack which is a fixed size. Switch to this upper bound. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Laura Abbott Reviewed-by: Kees Cook Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180411010330.17866-1-labbott@redhat.com commit 520ea9347505f5eb90a6162385cf821e80b6c233 Author: Laura Abbott Date: Mon Apr 9 14:06:47 2018 -0700 drm/gma500: Remove VLA There's an ongoing effort to remove VLAs[1] from the kernel to eventually turn on -Wvla. Switch to a reasonable upper bound for the VLAs in the gma500 driver. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Laura Abbott Reviewed-by: Kees Cook Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180409210647.3718-1-labbott@redhat.com commit a33b1dc8a732144e11cb4bf067d24ba51e6b8ab0 Author: Chris Wilson Date: Tue May 22 13:10:18 2018 +0100 drm/i915/query: nospec expects no more than an unsigned long nospec quite reasonably asserts that it will never be used with an index larger than unsigned long (that being the largest possibly index into an C array). However, our ubi uses the convention of u64 for any large integer, running afoul of the assertion on 32b. Reduce our index to an unsigned long, checking for type overflow first. drivers/gpu/drm/i915/i915_query.c: In function 'i915_query_ioctl': include/linux/compiler.h:339:38: error: call to '__compiletime_assert_119' declared with attribute error: BUILD_BUG_ON failed: sizeof(_s) > sizeof(long) Reported-by: kbuild-all@01.org Fixes: 84b510e22da7 ("drm/i915/query: Protect tainted function pointer lookup") Signed-off-by: Chris Wilson Cc: Lionel Landwerlin Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Reviewed-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20180522121018.15199-1-chris@chris-wilson.co.uk commit 59462a00cc88bc45eaed069942362839ccb0b3de Author: Ville Syrjälä Date: Tue May 8 15:41:36 2018 +0300 drm/i915: Eliminate the unused dev_priv->vbt.lvds_vbt dev_priv->vbt.lvds_vbt is set but never actually used. Kill it. Signed-off-by: Ville Syrjälä Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180508124136.10969-3-ville.syrjala@linux.intel.com commit 5255e2f8d1177f3eddeae930dda58e4dc7b4373d Author: Ville Syrjälä Date: Tue May 8 17:08:14 2018 +0300 drm/i915: Replace vbt edp.support with int_lvds_support Replace dev_priv->vbt.edp.support with dev_priv->vbt.int_lvds_support. We'll want to extend its use beyond the LVDS vs. eDP case in the future. v2: Nuke the edp.support from parse_edp() (Jani) Only clear int_lvds_support for gen5+ to preserve the current behaviour (Jani) Cc: Jani Nikula Cc: Ondrej Zary Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180508140814.20105-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 1abb70f5955d1a9021f96359a2c6502ca569b68d Author: Chris Wilson Date: Tue May 22 09:36:43 2018 +0100 drm/i915/gtt: Allow pagedirectory allocations to fail As we handle the allocation failure of the page directory and tables by propagating the failure back to userspace, allow it to fail if direct reclaim is unable to satisfy the request (i.e. disable the oomkiller). The premise being that if we are unable to allocate a single page for the pagetable, we will not be able to handle the multitude of pages required for the gfx operation and we should back off to allow the system to recover. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106609 Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Joonas Lahtinen Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20180522083643.29601-1-chris@chris-wilson.co.uk commit 84b510e22da7926522a257cfe295d3695346a0bd Author: Chris Wilson Date: Mon May 21 22:05:30 2018 +0100 drm/i915/query: Protect tainted function pointer lookup Smatch identifies i915_query_ioctl() as being a potential victim of Spectre due to its use of a tainted user index into a function pointer array. Use array_index_nospec() to defang the user index before using it to lookup the function pointer. Fixes: a446ae2c6e65 ("drm/i915: add query uAPI") Signed-off-by: Chris Wilson Cc: Lionel Landwerlin Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Reviewed-by: Lionel Landwerlin Link: https://patchwork.freedesktop.org/patch/msgid/20180521210530.26008-1-chris@chris-wilson.co.uk commit d93fa1b47b8fcd149b5091f18385304f402a8e15 Author: Jani Nikula Date: Wed May 16 11:01:10 2018 +0300 Revert "drm/i915/edp: Allow alternate fixed mode for eDP if available." This reverts commit dc911f5bd8aacfcf8aabd5c26c88e04c837a938e. Per the report, no matter what display mode you select with xrandr, the i915 driver will always select the alternate fixed mode. For the reporter this means that the display will always run at 40Hz which is quite annoying. This may be due to the mode comparison. But there are some other potential issues. The choice of alt_fixed_mode seems dubious. It's the first non-preferred mode, but there are no guarantees that the only difference would be refresh rate. Similarly, there may be more than one preferred mode in the probed modes list, and the commit changes the preferred mode selection to choose the last one on the list instead of the first. (Note that the probed modes list is the raw, unfiltered, unsorted list of modes from drm_add_edid_modes(), not the pretty result after a drm_helper_probe_single_connector_modes() call.) Finally, we already have eerily similar code in place to find the downclock mode for DRRS that seems like could be reused here. Back to the drawing board. Note: This is a hand-crafted revert due to conflicts. If it fails to backport, please just try reverting the original commit directly. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105469 Reported-by: Rune Petersen Reported-by: Mark Spencer Fixes: dc911f5bd8aa ("drm/i915/edp: Allow alternate fixed mode for eDP if available.") Cc: Clint Taylor Cc: David Weinehall Cc: Rodrigo Vivi Cc: Paulo Zanoni Cc: Jani Nikula Cc: Chris Wilson Cc: Jim Bride Cc: Jani Nikula Cc: Joonas Lahtinen Cc: intel-gfx@lists.freedesktop.org Cc: # v4.14+ Signed-off-by: Jani Nikula Reviewed-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20180516080110.22770-1-jani.nikula@intel.com commit c7cbed560ce24a87eccf219bc4c78a19961a6074 Author: Daniel Stone Date: Mon May 21 15:24:49 2018 +0100 drm/gma500: Fix Medfield for drm_framebuffer move Commit bc61c97502e2 ("drm/gma500: Move GEM BO to drm_framebuffer") moved the gtt_range structure, from being in psb_framebuffer and embedding the GEM object, to being placed in the drm_framebuffer with the gtt_range being derived from the GEM object. The conversion missed out the Medfield subdriver, which was not being built in the default drm-misc config. Do the trivial fixup here. Signed-off-by: Daniel Stone Reported-by: kbuild test robot Reviewed-by: Thierry Reding Fixes: bc61c97502e2 ("drm/gma500: Move GEM BO to drm_framebuffer") Cc: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20180521142449.20800-1-daniels@collabora.com commit 2ecceeb53b19455ffa50b31fd3c20fe2974508a6 Author: Daniel Stone Date: Fri Mar 30 15:11:21 2018 +0100 drm/omap: Move buffer pitch/offset to drm_framebuffer drm_framebuffer already holds per-plane pitch and offsets, which is filled out for us when we create the framebuffer. Nuke our local copy in the plane struct. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Reviewed-by: Sebastian Reichel Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-7-daniels@collabora.com commit 3e44255260dc3c329a92cf0aa64495951ccc4fb7 Author: Daniel Stone Date: Fri Mar 30 15:11:20 2018 +0100 drm/omap: Move GEM BO to drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle and destroy functions the same as the GEM framebuffer helper, we can reuse those. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Reviewed-by: Sebastian Reichel Cc: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-6-daniels@collabora.com commit a268bcd7647d2c22bffdfbb111e5f7291b8494a6 Author: Daniel Stone Date: Fri May 18 15:30:08 2018 +0100 drm/i915: Move GEM BO inside drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. v2: Only hold a single reference per framebuffer, not per plane. (Ville) v3: Drop NULL check in intel_fb_obj. (Ville) Signed-off-by: Daniel Stone Reviewed-by: Ville Syrjälä Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20180518143008.4120-2-daniels@collabora.com commit a5ff7a45c9c8fc4d2d9484c028a9d882da6d5f48 Author: Daniel Stone Date: Fri May 18 15:30:07 2018 +0100 drm/i915: Use intel_fb_obj() everywhere We already have a macro to pull the GEM object from a FB, so use it everywhere. We'll make use of this later to move the object storage. Signed-off-by: Daniel Stone Reviewed-by: Ville Syrjälä Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20180518143008.4120-1-daniels@collabora.com commit 17e23993f297467bae946a46e44f945d8dae93f8 Author: Dan Carpenter Date: Fri May 18 11:10:41 2018 +0300 drm/v3d: Checking for NULL vs IS_ERR() The v3d_fence_create() only returns error pointers on error. It never returns NULL. Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+") Signed-off-by: Dan Carpenter Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180518081041.GC28335@mwanda commit 6bb2a2af8b1b38a5e33984f5fdda2638317ed8fd Author: Zhenyu Wang Date: Mon May 21 16:17:52 2018 +0800 drm/i915/gvt: Fix crash after request->hw_context change When we do shadowing, workload's request might not be allocated yet, so we still require shadow context's object. And when complete workload, delay to zero workload's request pointer after used for update guest context. v2: Move request alloc earlier as already try to track shadow status depending on request state, which also facilitate to use request->hw_context for target engine context reference. Fixes: 1fc44d9b1afb ("drm/i915: Store a pointer to intel_context in i915_request") Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: Zhi Wang Cc: Weinan Li Signed-off-by: Zhenyu Wang Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180521081752.31056-1-zhenyuw@linux.intel.com commit e8b58d6de1fe9119018ed9bbeecf373dcc397b8d Author: Peter Rosin Date: Wed May 2 09:40:24 2018 +0200 drm/rockchip: lvds: avoid duplicating drm_bridge_attach drm_bridge_attach takes care of these assignments, so there is no need to open-code them a second time. Signed-off-by: Peter Rosin Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20180502074025.12421-3-peda@axentia.se commit 2773397171ac4b6e794ba0b3e34c06cbaf29897a Author: Dou Liyang Date: Fri May 11 16:09:56 2018 +0800 x86/vector: Merge allocate_vector() into assign_vector_locked() assign_vector_locked() calls allocate_vector() to get a real vector for an IRQ. If the current target CPU is online and in the new requested affinity mask, allocate_vector() will return 0 and nothing should be done. But, assign_vector_locked() calls apic_update_irq_cfg() even in that case which is pointless. allocate_vector() is not called from anything else, so the functions can be merged and in case of no change the apic_update_irq_cfg() can be avoided. [ tglx: Massaged changelog ] Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/20180511080956.6316-1-douly.fnst@cn.fujitsu.com commit 39d3cc03e9ddd3c7b564acd07ba1691ba817837d Author: Chris Wilson Date: Thu May 17 15:24:41 2018 +0100 drm/i915/selftests: Wait longer for the old active request When testing reset, we wait for 1s on the main thread for the hang to start. Meanwhile, we continue submitting requests on all the background threads, and we may have more threads than cores and so potentially starve the waiter from being woken within the timeout. As the hang timeout and the active timeouts are the same, it is hard to distinguish which caused the timeout. Bump the active thread timeouts to 5s, compared to the 1s timeout for the hang, so that we preferentially report the hang timing out, while hopefully ensuring that we do at least wake up the hang thread first before declaring the background active timeout. Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180517142442.16979-1-chris@chris-wilson.co.uk Reviewed-by: Tvrtko Ursulin commit 2399a4a6f5dff645d7890135db1c965592e1b8f3 Author: Chris Wilson Date: Fri May 18 10:02:12 2018 +0100 drm/i915: Allow init_breadcrumbs to be used from irq context In order to support engine reset from irq (timer) context, we need to be able to re-initialise the breadcrumbs. So we need to promote the plain spin_lock_irq to a safe spin_lock_irqsave. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180518090212.5349-3-chris@chris-wilson.co.uk commit fe0c493538f42ee1cbc4701dc6f9eb2b82d856cf Author: Chris Wilson Date: Fri May 18 10:02:11 2018 +0100 drm/i915/execlists: Handle copying default context state for atomic reset We want to be able to reset the GPU from inside a timer callback (hardirq context). One step requires us to copy the default context state over to the guilty context, which means we need to plan in advance to have that object accessible from within an atomic context. The atomic context prevents us from pinning the object or from peeking into the shmemfs backing store (all may sleep), so we choose to pin the default_state into memory when the engine becomes active. This compromise allows us to swap out the default state when idle, when required. References: 5692251c254a ("drm/i915/lrc: Scrub the GPU state of the guilty hanging request") Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180518090212.5349-2-chris@chris-wilson.co.uk commit d6d12ec081776bdea7e0ad58f2a7e7f92e414e7f Author: Chris Wilson Date: Fri May 18 10:02:10 2018 +0100 drm/i915: Make intel_engine_dump irqsafe To be useful later, enable intel_engine_dump() to be called from irq context (i.e. using saving and restoring irq start rather than assuming we enter with irqs enabled). Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180518090212.5349-1-chris@chris-wilson.co.uk commit dd0cf235d81f24c1ba80c4a000bafc9f2dce3840 Author: Chris Wilson Date: Sun May 6 18:13:28 2018 +0100 drm/i915: Speed up idle detection by kicking the tasklets We rely on ksoftirqd to run in a timely fashion in order to drain the execlists queue. Quite frequently, it does not. In some cases we may see latencies of over 200ms triggering our idle timeouts and forcing us to declare the driver wedged! Thus we can speed up idle detection by bypassing ksoftirqd in these cases and flush our tasklet to confirm if we are indeed still waiting for the ELSP to drain. v2: Put the execlists.first check back; it is required for handling reset! References: https://bugs.freedesktop.org/show_bug.cgi?id=106373 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180506171328.30034-1-chris@chris-wilson.co.uk commit e578a570dc7c20475774d1ff993825e3bd7a7011 Author: Chris Wilson Date: Fri May 18 08:48:40 2018 +0100 drm/i915/lvds: Move acpi lid notification registration to registration phase Delay registering ourselves with the acpi lid notification mechanism until we are registering the connectors after initialisation is complete. This prevents a possibility of trying to handle the lid notification before we are ready with the danger of chasing uninitialised function pointers. BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 IP: (null) PGD 0 P4D 0 Oops: 0010 [#1] PREEMPT SMP PTI Modules linked in: arc4(+) iwldvm(+) i915(+) mac80211 i2c_algo_bit coretemp mei_wdt iwlwifi drm_kms_helper kvm_intel wmi_bmof iTCO_wdt iTCO_vendor_support kvm snd_hda_codec_conexant snd_hda_codec_generic drm psmouse cfg80211 irqbypass input_leds pcspkr i2c_i801 snd_hda_intel snd_hda_codec thinkpad_acpi snd_hda_core mei_me lpc_ich snd_hwdep e1000e wmi nvram snd_pcm mei snd_timer shpchp ptp pps_core rfkill syscopyarea snd intel_agp sysfillrect intel_gtt soundcore sysimgblt battery led_class fb_sys_fops ac rtc_cmos agpgart evdev mac_hid acpi_cpufreq ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 fscrypto crypto_simd glue_helper cryptd aes_x86_64 xts algif_skcipher af_alg dm_crypt dm_mod sd_mod uas usb_storage serio_raw atkbd libps2 ahci libahci uhci_hcd libata scsi_mod ehci_pci ehci_hcd usbcore usb_common i8042 serio CPU: 1 PID: 378 Comm: systemd-logind Not tainted 4.16.8-1-ARCH #1 Hardware name: LENOVO 7454CTO/7454CTO, BIOS 6DET72WW (3.22 ) 10/25/2012 RIP: 0010: (null) RSP: 0018:ffffaf4580c33a18 EFLAGS: 00010287 RAX: 0000000000000000 RBX: ffff947533558000 RCX: 000000000000003e RDX: ffffffffc0aa80c0 RSI: ffffaf4580c33a3c RDI: ffff947534e4c000 RBP: ffff947533558338 R08: ffff947534598930 R09: ffffffffc0a928b1 R10: ffffd8f181d5fd40 R11: 0000000000000000 R12: ffffffffc0a928b1 R13: ffff947533558368 R14: ffffffffc0a928a9 R15: ffff947534e4c000 FS: 00007f3dc4ddb940(0000) GS:ffff947539280000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000006e214000 CR4: 00000000000406e0 Call Trace: ? intel_modeset_setup_hw_state+0x385/0xf60 [i915] ? __intel_display_resume+0x1e/0xc0 [i915] ? intel_display_resume+0xcc/0x120 [i915] ? intel_lid_notify+0xbc/0xc0 [i915] ? notifier_call_chain+0x47/0x70 ? blocking_notifier_call_chain+0x3e/0x60 ? acpi_lid_notify_state+0x8f/0x1d0 ? acpi_lid_update_state+0x49/0x70 ? acpi_lid_input_open+0x60/0x90 ? input_open_device+0x5d/0xa0 ? evdev_open+0x1ba/0x1e0 [evdev] ? chrdev_open+0xa3/0x1b0 ? cdev_put.part.0+0x20/0x20 ? do_dentry_open+0x14c/0x300 ? path_openat+0x30c/0x1240 ? current_time+0x16/0x60 ? do_filp_open+0x93/0x100 ? __check_object_size+0xfb/0x180 ? do_sys_open+0x186/0x210 ? do_syscall_64+0x74/0x190 ? entry_SYSCALL_64_after_hwframe+0x3d/0xa2 Code: Bad RIP value. RIP: (null) RSP: ffffaf4580c33a18 CR2: 0000000000000000 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106559 Fixes: c1c7af608920 ("drm/i915: force mode set at lid open time") Signed-off-by: Chris Wilson Cc: Maarten Lankhorst Cc: Ville Syrjälä Cc: Daniel Vetter Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180518074840.16194-1-chris@chris-wilson.co.uk Cc: stable@vger.kernel.org commit 957428f9935ac6f41443431f61478023261c8d36 Author: Daniel Stone Date: Fri Mar 30 15:11:19 2018 +0100 drm/rockchip: rockchip_drm_fb -> drm_framebuffer Now that rockchip_drm_fb is just a wrapper around drm_framebuffer, we can remove it. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Reviewed-by: Sean Paul Acked-by: Heiko Stübner Tested-by: Heiko Stübner Cc: Sandy Huang Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-5-daniels@collabora.com commit 4c7c9a63f215da5576460b3a526e23d564de1360 Author: Daniel Stone Date: Fri Mar 30 15:11:18 2018 +0100 drm/rockchip: Place GEM BOs in drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle and destroy functions the same as the GEM framebuffer helper, we can reuse those. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Reviewed-by: Sean Paul Acked-by: Heiko Stübner Tested-by: Heiko Stübner Cc: Sandy Huang Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-4-daniels@collabora.com commit 6a3e913cb8d5fb792782beb8766c0b81e8bfe1ac Author: Daniel Stone Date: Fri May 18 14:47:05 2018 +0100 drm/mtk: mtk_drm_fb -> drm_framebuffer Now that mtk_drm_fb is an empty wrapper around drm_framebuffer, we can just delete it. Signed-off-by: Daniel Stone Reviewed-by: CK Hu Reviewed-by: Thierry Reding Reviewed-by: Sean Paul Cc: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/20180518134705.12533-3-daniels@collabora.com commit 81a073d14c7a46f6e7282a5ffc24f112ac5429ed Author: Daniel Stone Date: Fri May 18 14:47:04 2018 +0100 drm/mtk: Move GEM BO to drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle and destroy functions the same as the GEM framebuffer helper, we can reuse those. Signed-off-by: Daniel Stone Reviewed-by: CK Hu Reviewed-by: Thierry Reding Reviewed-by: Sean Paul Cc: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/20180518134705.12533-2-daniels@collabora.com commit c734f496770801f97ae1a59607634b972b002cdf Author: Daniel Stone Date: Fri May 18 14:47:03 2018 +0100 drm/mtk: Remove impossible internal error We cannot create a framebuffer with no objects, so there's no point testing for it. v2: Remove the error entirely. (Sean, CK, Thierry) Signed-off-by: Daniel Stone Acked-by: Thierry Reding Cc: Sean Paul Cc: CK Hu Cc: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/20180518134705.12533-1-daniels@collabora.com commit 45101e939ea34c3f0794175845eb946e839e7873 Author: Ville Syrjälä Date: Thu May 17 20:03:09 2018 +0300 drm/i915: Rename the remaining gen4 references to g4x in the DP code i965 does not have native DP. Let's rename the remaining gen4 references in the DP code to g4x. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180517170309.28630-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 4d82c2b5f09f5b09ac55e557c0436eb4b29c07fe Author: Ville Syrjälä Date: Thu May 17 20:03:08 2018 +0300 drm/i915: Rename SNB/IVB CPU eDP signal level funcs To make the intent more clear, let's rename the signal level funcs for the SNB/IVB CPU eDP. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180517170309.28630-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit b752e995829e3644015300103a31c48de2634169 Author: Ville Syrjälä Date: Thu May 17 20:03:07 2018 +0300 drm/i915: Check for IVB instead of gen7 when we think about IVB CPU eDP Almost all of the GEN7 checks in the DP code are actually looking for IVB. HSW doesn't even take these codepaths, and VLV is excluded on account of not having port A. So let's change the checks to IS_IVB to make the code less confusing. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180517170309.28630-3-ville.syrjala@linux.intel.com commit 4718a365cf12094ed131089518003ac7ecb66743 Author: Ville Syrjälä Date: Thu May 17 20:03:06 2018 +0300 drm/i915: Use the same vswing->max_preemph mapping on HSW/BDW as on SKL+ All DDI platforms support the full set of preemph settings for each supported vswing, so let's use the same code for them. We'll also move the code into intel_ddi.c so that it sits closer to the actual buf trans tables. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180517170309.28630-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit a393e9649582894078130f5741877bbafa0bd8a9 Author: Ville Syrjälä Date: Thu May 17 20:03:05 2018 +0300 drm/i915: Use intel_ddi_dp_voltage_max() for HSW/BDW too Use intel_ddi_dp_voltage_max() for HSW/BDW too instead of letting these fall through the if ladder in a weird way. This function will look at the actual buf trans tables we have for HSW/BDW to determine the max vswing level. It looks to me like the current code leads HSW port A down the IVB port A path, HSW port B+ and BDW fall through to the very end. Both cases do result in the correct max vswing level 2, but it's very hard to see that from the code. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180517170309.28630-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 7f7105f99b75aca4f8c2a748ed6b82c7f8be3293 Author: Ondrej Zary Date: Fri Mar 9 23:22:04 2018 +0100 drm/i915: Disable LVDS on Radiant P845 Radiant P845 does not have LVDS, only VGA. Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105468 Signed-off-by: Ondrej Zary Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180309222204.4771-1-linux@rainbow-software.org commit 080205096579a07fa1b18fcd28ff4d41c3c6e4d7 Author: Daniel Stone Date: Fri Mar 30 15:11:35 2018 +0100 drm/msm: Move GEM BOs to drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle function the same as the GEM framebuffer helper, we can reuse that. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Cc: Rob Clark Cc: linux-arm-msm@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-21-daniels@collabora.com commit bc61c97502e26af1be54022883d14ee0c03379fc Author: Daniel Stone Date: Fri Mar 30 15:11:34 2018 +0100 drm/gma500: Move GEM BO to drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle and destroy functions the same as the GEM framebuffer helper, we can reuse those. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Cc: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-20-daniels@collabora.com commit ecb8a947855c9658cd0382f3cab39f91a7ebe86a Author: Daniel Stone Date: Fri Mar 30 15:11:33 2018 +0100 drm/armada: Move GEM BO to drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle and destroy functions the same as the GEM framebuffer helper, we can reuse those. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Reviewed-by: Russell King Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-19-daniels@collabora.com commit 3823da3aeb47c1b5f07974cf7c87443da2a93ad0 Author: Daniel Stone Date: Fri Mar 30 15:11:17 2018 +0100 drm/virtio: Place GEM BOs in drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle and destroy functions the same as the GEM framebuffer helper, we can reuse those. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-3-daniels@collabora.com commit 121df61e5a301a6b4ef9efd4d1b190f73ef01419 Author: Daniel Stone Date: Fri Mar 30 15:11:16 2018 +0100 drm/cirrus: cirrus_framebuffer -> drm_framebuffer Now cirrus_framebuffer is just an empty wrapper around drm_framebuffer, we can drop it. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-2-daniels@collabora.com commit 9d7e70020c244940dc34f19b8d2da6b3f6516946 Author: Daniel Stone Date: Fri Mar 30 15:11:15 2018 +0100 drm/cirrus: Place GEM BOs in drm_framebuffer Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass. As this makes the framebuffer create_handle and destroy functions the same as the GEM framebuffer helper, we can reuse those. Signed-off-by: Daniel Stone Reviewed-by: Thierry Reding Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Link: https://patchwork.freedesktop.org/patch/msgid/20180330141138.28987-1-daniels@collabora.com commit c9b6be7dc13e2f87592ee4c9812cb450dba484d5 Author: Stefan Agner Date: Thu Apr 19 23:20:03 2018 +0200 drm/panel: simple: Fix data type in KEO TX31D200VM0BAA timings All values in a struct struct timing_entry (every entry in struct display_timing) require an integer. Choose the closest safe integer of 32. This avoids a warning seen with clang: drivers/gpu/drm/panel/panel-simple.c:1250:27: warning: implicit conversion from 'double' to 'u32' (aka 'unsigned int') changes value from 33.5 to 33 [-Wliteral-conversion] .vfront_porch = { 6, 21, 33.5 }, ~ ^~~~ drivers/gpu/drm/panel/panel-simple.c:1251:26: warning: implicit conversion from 'double' to 'u32' (aka 'unsigned int') changes value from 33.5 to 33 [-Wliteral-conversion] .vback_porch = { 6, 21, 33.5 }, ~ ^~~~ Signed-off-by: Stefan Agner Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180419212003.8155-1-stefan@agner.ch commit 2554f154b46f7d8a933f0616e8170bf4d970a2bf Author: Lucas Stach Date: Wed Apr 11 17:27:41 2018 +0200 drm/panel: simple: AUO P320HVN03 uses SPWG data ordering The patch adding support for the AUO P320HVN03 panel was written against a preliminary datasheet, which specified JEIDA data ordering. Testing with real hardware has shown that the actually used data ordering is SPWG. Fixes: 70c0d5b783f5 (drm/panel: simple: add support for AUO P320HVN03) Signed-off-by: Lucas Stach Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180411152741.22483-1-l.stach@pengutronix.de commit da50bd4258db62810de4e0f3d75cf7d3d67466b1 Author: spanda@codeaurora.org Date: Tue May 15 11:22:43 2018 +0530 drm/panel: simple: Add Innolux TV123WAM panel driver support Add support for Innolux TV123WAM, which is a 12.3" eDP display panel with 2160x1440 resolution. Changes in v1: - Add the compatibility string, display_mode and panel_desc structures in alphabetical order (Sean Paul). Signed-off-by: Sandeep Panda Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/1526363564-13823-4-git-send-email-spanda@codeaurora.org commit 9c04400f7ea6bbdfd0f069f082188c34c2d6a929 Author: spanda@codeaurora.org Date: Tue May 15 11:22:44 2018 +0530 dt-bindings: drm/panel: Document Innolux TV123WAM panel bindings Innolux TV123WAM is a 12.3" eDP display panel with 2160x1440 resolution, which can be supported by simple panel driver. Changes in v1: - Make use of simple panel driver instead of creating a new driver for this panel (Sean Paul). - Combine dt-binding and driver changes into one patch as done by other existing panel support changes. Changes in v2: - Separate driver change from dt-binding documentation (Rob Herring). - Add the properties from simple-panel binding that are applicable to this panel (Rob Herring). Signed-off-by: Sandeep Panda Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/1526363564-13823-5-git-send-email-spanda@codeaurora.org commit eea740a98df9ff914001bd066389b6e8f1024991 Author: Thierry Reding Date: Thu Apr 26 15:58:53 2018 +0200 drm/bridge: cdns: Mark runtime PM operations as maybe unused Building the driver in a configuration with !PM currently causes a warning about these operations being unused. Mark them as such to shut up the compiler. Reviewed-by: Daniel Vetter Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180426135853.30895-1-thierry.reding@gmail.com commit 12a6cbd4f3f10b01b8a190de3766e70492df316b Author: Philippe CORNU Date: Mon Apr 23 16:10:53 2018 +0200 drm/panel: otm8009a: Use new backlight API The backlight API provides new functions to enable and disable the backlight and which hide the intricacies of achieving the correct result. Signed-off-by: Philippe Cornu Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180423141054.13128-5-philippe.cornu@st.com commit 6982b943123d5867997a6d0f8b5976ac3ddb2fa6 Author: Philippe CORNU Date: Mon Apr 23 16:10:52 2018 +0200 drm/panel: otm8009a: No message if probe success Remove the message in case of probe success. This comes from a suggestion followed in the recent integration of the raydium rm68200 panel. Signed-off-by: Philippe Cornu Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180423141054.13128-4-philippe.cornu@st.com commit 36830ce4eb2b5f6fe796c457b4043160c0e1e1fe Author: Philippe CORNU Date: Mon Apr 23 16:10:51 2018 +0200 drm/panel: otm8009a: Fix glitches by moving backlight enable to otm8009a_enable() The backlight 1st update was in the otm8009a_prepare() function for a bad reason: backlight was not working in video mode and the otm8009a_prepare() is in command mode for the init sequence. As the backlight is now fixed (no low-power mode), it is good to put it back in the otm8009a_enable() function, avoiding also image glitches visible on some "slow" devices. Signed-off-by: Philippe Cornu Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180423141054.13128-3-philippe.cornu@st.com commit d9f9565c1f7f51904a5009671595a50b8ab0462b Author: Philippe CORNU Date: Mon Apr 23 16:10:50 2018 +0200 drm/panel: otm8009a: Fix backlight updates Backlight updates was not working anymore since the good implementation of the DSI low-power mode in the DSI host driver. After a longer analysis, the backlight updates in DSI video mode require the DSI high- speed mode. Note: it is important to keep the DSI low-power mode for the rest of the driver as init sequence, sleep in/out... DSI commands work in low-power mode. Signed-off-by: Philippe Cornu Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20180423141054.13128-2-philippe.cornu@st.com commit 0c08754b59da5557532d946599854e6df28edc22 Author: Jyri Sarha Date: Thu Apr 26 11:07:00 2018 +0300 drm/panel: Add device_link from panel device to DRM device Add device_link from panel device (supplier) to DRM device (consumer) when drm_panel_attach() is called. This patch should protect the master DRM driver if an attached panel driver unbinds while it is in use. The device_link should make sure the DRM device is unbound before the panel driver becomes unavailable. The device_link is removed when drm_panel_detach() is called. The drm_panel_detach() should be called by the consumer DRM driver, not the panel driver, otherwise both drivers are racing to delete the same link. Signed-off-by: Jyri Sarha Reviewed-by: Eric Anholt Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/b53584fd988d045c13de22d81825395b0ae0aad7.1524727888.git.jsarha@ti.com commit 38992c57c9c8425dc9cb75efe6f9b9255ea627a0 Author: Jyri Sarha Date: Thu Apr 26 11:06:59 2018 +0300 drm/panel: Remove drm_panel_detach() calls from all panel drivers Remove all drm_panel_detach() calls from all panel drivers and update the kerneldoc for drm_panel_detach(). Setting the connector and drm to NULL when the DRM panel device is going away hardly serves any purpose. Usually the whole memory structure is freed right after the remove call. However, calling the detach function from the master DRM device, and setting the connector pointer to NULL, has the logic of marking the panel again as available for another DRM master to attach. The usual situation would be the same DRM master device binding again. Signed-off-by: Jyri Sarha Reviewed-by: Daniel Vetter Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/464b8d330d6b4c94cfb5aad2ca9ea7eb2c52d934.1524727888.git.jsarha@ti.com commit 867985d4a4319819a971645a262f3340f7d30343 Author: Chris Wilson Date: Thu May 17 22:26:33 2018 +0100 drm/i915: Pull the context->pin_count dec into the common intel_context_unpin As all backends implement the same pin_count mechanism and do a dec-and-test as their first step, pull that into the common intel_context_unpin(). This also pulls into the caller, eliminating the indirect call in the usual steady state case. The intel_context_pin() side is a little more complicated as it combines the lookup/alloc as well as pinning the state, and so is left for a later date. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180517212633.24934-4-chris@chris-wilson.co.uk commit 1fc44d9b1afb0afe46acd99bdfdf793805a850e1 Author: Chris Wilson Date: Thu May 17 22:26:32 2018 +0100 drm/i915: Store a pointer to intel_context in i915_request To ease the frequent and ugly pointer dance of &request->gem_context->engine[request->engine->id] during request submission, store that pointer as request->hw_context. One major advantage that we will exploit later is that this decouples the logical context state from the engine itself. v2: Set mock_context->ops so we don't crash and burn in selftests. Cleanups from Tvrtko. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Acked-by: Zhenyu Wang Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180517212633.24934-3-chris@chris-wilson.co.uk commit 01278cb143955f4b592568d1756f1baf506245c2 Author: Chris Wilson Date: Thu May 17 22:26:31 2018 +0100 drm/i915: Move fiddling with engine->last_retired_context Move the knowledge about resetting the current context tracking on the engine from inside i915_gem_context.c into intel_engine_cs.c Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180517212633.24934-2-chris@chris-wilson.co.uk commit 4e0d64dba816adf18c17488d38ede67a3d0e9b40 Author: Chris Wilson Date: Thu May 17 22:26:30 2018 +0100 drm/i915: Move request->ctx aside In the next patch, we want to store the intel_context pointer inside i915_request, as it is frequently access via a convoluted dance when submitting the request to hw. Having two context pointers inside i915_request leads to confusion so first rename the existing i915_gem_context pointer to i915_request.gem_context. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180517212633.24934-1-chris@chris-wilson.co.uk commit 9a512e23f173a3598709b74d6ccf9a6616403967 Author: Colin Xu Date: Sat May 19 12:28:55 2018 +0800 drm/i915/gvt: Use sched_lock to protect gvt scheduler logic. The scheduler lock(gvt->sched_lock) is used to protect gvt scheduler logic, including the gvt scheduler structure(gvt->scheduler and per vgpu schedule data(vgpu->sched_data, vgpu->sched_ctl). v9: - Change commit author since the patches are improved a lot compared with original version. Original author: Pei Zhang - Rebase to latest gvt-staging. v8: - Correct coding wqstyle. - Rebase to latest gvt-staging. v7: - Remove gtt_lock since already proteced by gvt_lock and vgpu_lock. v6: - Rebase to latest gvt-staging. v5: - Rebase to latest gvt-staging. v4: - Rebase to latest gvt-staging. v3: update to latest code base Signed-off-by: Pei Zhang Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit f25a49ab8ab9c1b5587837c8a386b276403f315c Author: Colin Xu Date: Sat May 19 12:28:54 2018 +0800 drm/i915/gvt: Use vgpu_lock to protect per vgpu access The patch set splits out 2 small locks from the original big gvt lock: - vgpu_lock protects per-vGPU data and logic, especially the vGPU trap emulation path. - sched_lock protects gvt scheudler structure, context schedule logic and vGPU's schedule data. Use vgpu_lock to replace the gvt big lock. By doing this, the mmio read/write trap path, vgpu virtual event emulation and other vgpu related process, would be protected under per vgpu_lock. v9: - Change commit author since the patches are improved a lot compared with original version. Original author: Pei Zhang - Rebase to latest gvt-staging. v8: - Correct coding and comment style. - Rebase to latest gvt-staging. v7: - Remove gtt_lock since already proteced by gvt_lock and vgpu_lock. - Fix a typo in intel_gvt_deactivate_vgpu, unlock the wrong lock. v6: - Rebase to latest gvt-staging. v5: - Rebase to latest gvt-staging. - intel_vgpu_page_track_handler should use vgpu_lock. v4: - Rebase to latest gvt-staging. - Protect vgpu->active access with vgpu_lock. - Do not wait gpu idle in vgpu_lock. v3: update to latest code base v2: add gvt->lock in function gvt_check_vblank_emulation Performance comparison on Kabylake platform. - Configuration: Host: Ubuntu 16.04. Guest 1 & 2: Ubuntu 16.04. glmark2 score comparison: - Configuration: Host: glxgears. Guests: glmark2. +--------------------------------+-----------------+ | Setup | glmark2 score | +--------------------------------+-----------------+ | unified lock, iommu=on | 58~62 (avg. 60) | +--------------------------------+-----------------+ | unified lock, iommu=igfx_off | 57~61 (avg. 59) | +--------------------------------+-----------------+ | per-logic lock, iommu=on | 60~68 (avg. 64) | +--------------------------------+-----------------+ | per-logic lock, iommu=igfx_off | 61~67 (avg. 64) | +--------------------------------+-----------------+ lock_stat comparison: - Configuration: Stop lock stat immediately after boot up. Boot 2 VM Guests. Run glmark2 in guests. Start perf lock_stat for 20 seconds and stop again. - Legend: c - contentions; w - waittime-avg +------------+-----------------+-----------+---------------+------------+ | | gvt_lock |sched_lock | vgpu_lock | gtt_lock | + lock type; +-----------------+-----------+---------------+------------+ | iommu set | c | w | c | w | c | w | c | w | +------------+-------+---------+----+------+------+--------+-----+------+ | unified; | 20697 | 839 |N/A | N/A | N/A | N/A | N/A | N/A | | on | | | | | | | | | +------------+-------+---------+----+------+------+--------+-----+------+ | unified; | 21838 | 658.15 |N/A | N/A | N/A | N/A | N/A | N/A | | igfx_off | | | | | | | | | +------------+-------+---------+----+------+------+--------+-----+------+ | per-logic; | 1553 | 1599.96 |9458|429.97| 5846 | 274.33 | 0 | 0.00 | | on | | | | | | | | | +------------+-------+---------+----+------+------+--------+-----+------+ | per-logic; | 1911 | 1678.32 |8335|445.16| 5451 | 244.80 | 0 | 0.00 | | igfx_off | | | | | | | | | +------------+-------+---------+----+------+------+--------+-----+------+ Signed-off-by: Pei Zhang Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit c8af5274c3cbacb0905a26bcdef85901216e1134 Author: Paulo Zanoni Date: Wed May 2 14:58:51 2018 -0700 drm/i915: enable the pipe/transcoder/planes later on HSW+ For all platforms that run haswell_crtc_enable, our spec tells us to configure the transcoder clocks and do link training before it tells us to set pipeconf and the other pipe/transcoder/plane registers. Starting from Icelake, we get machine hangs if we try to touch the pipe/transcoder registers without having the clocks configured and not having some chicken bits set. So this patch changes haswell_crtc_enable() to issue the calls at the appropriate order mandated by the spec. While setting the appropriate chicken bits would also work here, it's better if we actually program the hardware the way it is intended to be programmed. And the chicken bit also has some theoretical downsides that may or may not affect us. Also, correctly programming the hardware does not prevent us from setting the chicken bits in a later patch in case we decide to. v2: Don't forget link training (Ville). Cc: Arthur J Runyan Cc: James Ausmus Cc: Ville Syrjälä Signed-off-by: Paulo Zanoni Reviewed-by: Rodrigo Vivi Reviewed-by: Manasi Navare Link: https://patchwork.freedesktop.org/patch/msgid/20180502215851.30736-1-paulo.r.zanoni@intel.com commit 6b7a6a7b4ba12715fabde30fea96f9df3df2da93 Author: Oscar Mateo Date: Thu May 10 14:59:55 2018 -0700 drm/i915/icl: Read the correct Gen11 interrupt registers Stop reading some now deprecated interrupt registers in both debugfs and error state. Instead, read the new equivalents in the Gen11 interrupt repartitioning scheme. Note that the equivalent to the PM ISR & IIR cannot be read without affecting the current state of the system, so I've opted for leaving them out. See gen11_reset_one_iir() for more info. v2: else if !!! (Paulo) v3: another else if (Vinay) v4: - Rebased - Renamed patch - Improved the ordering of GENs - Improved the printing of per-GEN info v5: Avoid maybe-unitialized & add comment explaining the lack of PM ISR & IIR Suggested-by: Paulo Zanoni Signed-off-by: Oscar Mateo Cc: Tvrtko Ursulin Cc: Daniele Ceraolo Spurio Cc: Sagar Arun Kamble Cc: Vinay Belgaumkar Reviewed-by: Vinay Belgaumkar [Paulo: fix commit message and coding style.] Signed-off-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/1525989595-18220-1-git-send-email-oscar.mateo@intel.com commit 560f6ad8edeaab1b14f1cb86083c7e0c1d37c749 Author: Chris Wilson Date: Thu May 17 16:07:27 2018 +0100 drm/i915: Remove unused enable_cmd_parser modparam The command parser is feature complete, stable and required by userspace. In commit 41736a8e3331 ("drm/i915: Use the precomputed value for whether to enable command parsing") I accidentally removed control from the modparam, and as no one has complained, remove the left over modparam completely! References: 41736a8e3331 ("drm/i915: Use the precomputed value for whether to enable command parsing") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Jani Nikula Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180517150727.10431-1-chris@chris-wilson.co.uk commit 96d4f03c20d04c80026b1ec3643c090cf4f0eb20 Author: Chris Wilson Date: Thu May 17 16:28:24 2018 +0100 drm/i915: Nul-terminate legacy debug string Make sure that when we don't have any scheduler attributes for the request, the string is terminated. Fixes: 247870ac8ea7 ("drm/i915: Build request info on stack before printk") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180517152824.11619-1-chris@chris-wilson.co.uk commit 57877b70739a5d49d95bedf94218ba125e8afef3 Author: Chris Wilson Date: Thu May 17 12:56:47 2018 +0100 drm/i915/execlists: HWACK checking superseded checking port[0].count The HWACK bit more generically solves the problem of resubmitting ESLP while the hardware is still processing the current ELSP write. We no longer need to check port[0].count itself. References: ba74cb10c775 ("drm/i915/execlists: Delay writing to ELSP until HW has processed the previous write") Signed-off-by: Chris Wilson Cc: Michel Thierry Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180517115647.17205-1-chris@chris-wilson.co.uk commit b45a258897a4a37b6cbc0bf1dc21354432f3e8c1 Author: Ville Syrjälä Date: Mon May 14 20:24:23 2018 +0300 drm/i915: Clean up DVO pipe select bits Parametrize the DVO pipe select bits. For consistency with the new way of doing things, let's read out the pipe select bits even when the port is disable, even though we don't need that behaviour for asserts in this case. v2: Order the defines shift,mask,value (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180514172423.9302-5-ville.syrjala@linux.intel.com commit 4add0f6bde0506677a224e761cc9f764d24dbe96 Author: Ville Syrjälä Date: Mon May 14 20:24:22 2018 +0300 drm/i915: Clean up TV pipe select bits Parametrize the TV pipe select bits. For consistency with the new way of doing things, let's read out the pipe select bits even when the port is disable, even though we don't need that behaviour for asserts in this case. v2: Order the defines shift,mask,value (Jani) Clear the stale pipe select bit in load detection (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180514172423.9302-4-ville.syrjala@linux.intel.com commit 762034675ee7476180eb3e7fc6c7b52db71654ed Author: Ville Syrjälä Date: Mon May 14 20:24:21 2018 +0300 drm/i915: Clean up SDVO pipe select bits Clean up the SDVO pipe select bits. To make the whole situation a bit less ugly we'll start to share the same code between .get_hw_state() and the port state asserts. v2: Order the defines shift,mask,value (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180514172423.9302-3-ville.syrjala@linux.intel.com commit a44628b9293b81b53b00adbf90b3dd6e3b9dbc32 Author: Ville Syrjälä Date: Mon May 14 21:28:27 2018 +0300 drm/i915: Clean up LVDS pipe select bits Clean up the LVDS pipe select bits. To make the whole situation a bit less ugly we'll start to share the same code between .get_hw_state() and the port state asserts. v2: Order the defines shift,mask,value (Jani) Drop ruperfluous braces and whitesapce changes (Jani) Combine masks in compute_is_dual_link_lvds() (Jani) v3: Fix LVDS_PIPE_SEL_MASK_CPT Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180514182827.28629-1-ville.syrjala@linux.intel.com commit 6102a8ee8ad60c51b5194e425c3cc8ce43aca384 Author: Ville Syrjälä Date: Mon May 14 20:24:19 2018 +0300 drm/i915: Clean up ADPA pipe select bits Clean up the ADPA pipe select bits. To make the whole situation a bit less ugly we'll start to share the same code between .get_hw_state() and the port state asserts. v2: Order the defines shift,mask,value (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180514172423.9302-1-ville.syrjala@linux.intel.com commit 6553b123eae8dd117f6adb4a42e2e6ef8bff321d Author: Stanislav Lisovskiy Date: Tue May 15 16:59:28 2018 +0300 i915: content-type property for HDMI connector Added encoding of drm content_type property from drm_connector_state within AVI infoframe in order to properly handle external HDMI TV content-type setting. This requires also manipulationg ITC bit, as stated in HDMI spec. v2: * Moved helper function which attaches content type property to the drm core, as was suggested. Removed redundant connector state initialization. v3: * Removed caps in drm_content_type_enum_list. After some discussion it turned out that HDMI Spec 1.4 was wrongly assuming that IT Content(itc) bit doesn't affect Content type states, however itc bit needs to be manupulated as well. In order to not expose additional property for itc, for sake of simplicity it was decided to bind those together in same "content type" property. v4: * Added it_content checking in intel_digital_connector_atomic_check. Fixed documentation for new content type enum. v5: * Moved patch revision's description to commit messages. v6: * Minor naming fix for the content type enumeration string. v7: * Fix parameter name for documentation and parameter alignment in order not to get warning. Added Content Type description to new HDMI connector properties section. v8: * Thrown away unneeded numbers from HDMI content-type property description. Switch to strings desription instead of plain definitions. v9: * Moved away hdmi specific content-type enum from drm_connector_state. Content type property should probably not be bound to any specific connector interface in drm_connector_state. Same probably should be done to hdmi_picture_aspect_ration enum which is also contained in drm_connector_state. Added special helper function to get derive hdmi specific relevant infoframe fields. v10: * Added usage description to HDMI properties kernel doc. v11: * Created centralized function for filling HDMI AVI infoframe, based on correspondent DRM property value. Acked-by: Hans Verkuil Acked-by: Daniel Vetter Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20180515135928.31092-3-stanislav.lisovskiy@intel.com [vsyrjala: clean up checkpatch multiple blank lines warnings] Signed-off-by: Ville Syrjälä commit 50525c332b55f899fb231d786931d0b45a3f3d41 Author: Stanislav Lisovskiy Date: Tue May 15 16:59:27 2018 +0300 drm: content-type property for HDMI connector Added content_type property to drm_connector_state in order to properly handle external HDMI TV content-type setting. v2: * Moved helper function which attaches content type property to the drm core, as was suggested. Removed redundant connector state initialization. v3: * Removed caps in drm_content_type_enum_list. After some discussion it turned out that HDMI Spec 1.4 was wrongly assuming that IT Content(itc) bit doesn't affect Content type states, however itc bit needs to be manupulated as well. In order to not expose additional property for itc, for sake of simplicity it was decided to bind those together in same "content type" property. v4: * Added it_content checking in intel_digital_connector_atomic_check. Fixed documentation for new content type enum. v5: * Moved patch revision's description to commit messages. v6: * Minor naming fix for the content type enumeration string. v7: * Fix parameter name for documentation and parameter alignment in order not to get warning. Added Content Type description to new HDMI connector properties section. v8: * Thrown away unneeded numbers from HDMI content-type property description. Switch to strings desription instead of plain definitions. v9: * Moved away hdmi specific content-type enum from drm_connector_state. Content type property should probably not be bound to any specific connector interface in drm_connector_state. Same probably should be done to hdmi_picture_aspect_ration enum which is also contained in drm_connector_state. Added special helper function to get derive hdmi specific relevant infoframe fields. v10: * Added usage description to HDMI properties kernel doc. v11: * Created centralized function for filling HDMI AVI infoframe, based on correspondent DRM property value. Acked-by: Hans Verkuil Acked-by: Daniel Vetter Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20180515135928.31092-2-stanislav.lisovskiy@intel.com [vsyrjala: clean up checkpatch multiple blank lines warnings] Signed-off-by: Ville Syrjälä commit 5d435b46fa68c53af8dc3a69ff2936b8f17aa294 Author: Philippe Cornu Date: Tue May 15 22:37:36 2018 +0200 drm/bridge: spelling and coding style minor fixes Minor fixes detected with "scripts/checkpatch.pl --strict" Signed-off-by: Philippe Cornu Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180515203736.9224-1-philippe.cornu@st.com commit 3257ec797d3a8c5232389eb1952d4451e80f3931 Author: Maxime Ripard Date: Thu May 17 15:37:59 2018 +0200 drm/vc4: plane: Expand the lower bits by repeating the higher bits The vc4 HVS uses an internal RGB888 representation of the frames, and will by default expand formats using a lower depth using zeros. This causes an issue when we try to use other compositing software such as pixman that fill the missing bits by repeating the higher significant bits. As such, we can't check the display output in a reliable way by doing a software composition and an hardware one and compare both. To prevent this, force the same behaviour so that we can do such things. Signed-off-by: Maxime Ripard Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180517133759.25626-1-maxime.ripard@bootlin.com commit 579e2f6d999991d2d2dd39c7185cba0a97137cee Author: Chris Wilson Date: Wed Mar 15 17:39:50 2017 +0000 drm/i915/gvt: Use offsetofend() rather than offsetof + sizeof Compute the offset of the end of the crc32 field using offsetofend() rather than open-coding. Signed-off-by: Chris Wilson Cc: Zhenyu Wang Cc: Zhi Wang Reviewed-by: Mika Kuoppala Signed-off-by: Zhenyu Wang commit 3f6e9822308127104a7bb007ca569f2c57d03b67 Author: Chris Wilson Date: Wed May 16 19:33:55 2018 +0100 drm/i915: Stop parking the signaler around reset We cannot call kthread_park() from softirq context, so let's avoid it entirely during the reset. We wanted to suspend the signaler so that it would not mark a request as complete at the same time as we marked it as being in error. Instead of parking the signaling, stop the engine from advancing so that the GPU doesn't emit the breadcrumb for our chosen "guilty" request. v2: Refactor setting STOP_RING so that we don't have the same code thrice Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Michałt Winiarski CC: Michel Thierry Cc: Jeff McGee Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-8-chris@chris-wilson.co.uk commit 63572937cebf5d229a87fb11b201864f7d0b8171 Author: Chris Wilson Date: Wed May 16 19:33:54 2018 +0100 drm/i915/execlists: Flush pending preemption events during reset Catch up with the inflight CSB events, after disabling the tasklet before deciding which request was truly guilty of hanging the GPU. Signed-off-by: Chris Wilson Cc: Michał Winiarski CC: Michel Thierry Cc: Jeff McGee Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-7-chris@chris-wilson.co.uk commit 73377dbcc754f1e673b60f238c237c5e909f92b1 Author: Chris Wilson Date: Wed May 16 19:33:53 2018 +0100 drm/i915/execlists: Split out CSB processing Pull the CSB event processing into its own routine so that we can reuse it during reset to flush any missed interrupts/events. Signed-off-by: Chris Wilson Cc: Michał Winiarski CC: Michel Thierry Cc: Jeff McGee Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-6-chris@chris-wilson.co.uk commit 1329115c6c4370e93813b44084ee06610c3279bd Author: Chris Wilson Date: Wed May 16 19:33:52 2018 +0100 drm/i915: Split execlists/guc reset preparations In the next patch, we will make the execlists reset prepare callback take into account preemption by flushing the context-switch handler. This is not applicable to the GuC submission backend, so split the two into their own backend callbacks. Signed-off-by: Chris Wilson Cc: Michał Winiarski CC: Michel Thierry Cc: Jeff McGee Reviewed-by: Jeff McGee Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-5-chris@chris-wilson.co.uk commit 5adfb772f8ac1224fe4d651f3628a2e03190f5af Author: Chris Wilson Date: Wed May 16 19:33:51 2018 +0100 drm/i915: Move engine reset prepare/finish to backends In preparation to more carefully handling incomplete preemption during reset by execlists, we move the existing code wholesale to the backends under a couple of new reset vfuncs. Signed-off-by: Chris Wilson Cc: Michał Winiarski CC: Michel Thierry Cc: Jeff McGee Reviewed-by: Jeff McGee Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-4-chris@chris-wilson.co.uk commit ef2fb7204638f0c67446a90b75e1eae4330682f8 Author: Chris Wilson Date: Wed May 16 19:33:50 2018 +0100 drm/i915/execlists: Refactor out complete_preempt_context() As a complement to inject_preempt_context(), follow up with the function to handle its completion. This will be useful should we wish to extend the duties of the preempt-context for execlists. v2: And do the same for the guc. Signed-off-by: Chris Wilson Cc: Jeff McGee Cc: Michał Winiarski Reviewed-by: Jeff McGee #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-3-chris@chris-wilson.co.uk commit f351d087d8329a08eca9e69872c3906c139e1f11 Author: Chris Wilson Date: Wed May 16 19:33:49 2018 +0100 drm/i915: Only sync tasklets once for recursive reset preparation When setting up reset, we may need to recursively prepare an engine. In which case we should only synchronously flush the tasklets on the outer most call, the inner calls will then be inside an atomic section where the tasklet will never be run (and so the sync will never complete). Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-2-chris@chris-wilson.co.uk commit b8444cf85b629413ad23f5b6ed9bf5267f38acab Author: Chris Wilson Date: Wed May 16 19:33:48 2018 +0100 drm/i915: Remove tasklet flush before disable The idea was to try and let the existing tasklet run to completion before we began the reset, but it involves a racy check against anything else that tries to run the tasklet. Rather than acknowledge and ignore the race, let it be and don't try and be too clever. The tasklet will resume execution after reset (after spinning a bit during reset), but before we allow it to resume we will have cleared all the pending state. Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-1-chris@chris-wilson.co.uk commit e7f2af7894b1ac76f2062f32724d51f23438249b Author: Colin Ian King Date: Wed May 9 11:16:06 2018 +0100 drm/i915/dp: fix spelling mistakes: "seqeuncer" and "seqeuencer" Trivial fix to spelling mistakes in WARN warning message text and in comments: "seqeuncer", "seqeuencer" -> "sequencer" Signed-off-by: Colin Ian King Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180509101606.17483-1-colin.king@canonical.com commit f75f91574617a3c6fbc821c6b156f5777a59d0ed Author: Chris Wilson Date: Tue May 15 15:31:49 2018 +0100 drm/i915: Shrink search list for active timelines When switching to the kernel context, we force the switch to occur after all currently active requests (so that we know the GPU won't switch immediately away and the kernel context remains current as we work). To do so we have to inspect all the timelines and add a fence from the active work to queue our switch afterwards. We can use the tracked set of active rings to shrink our search for active timelines. v2: Use a local to shrink the list_for_each_entry() Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180515143149.4795-1-chris@chris-wilson.co.uk commit 1c6ccad8a4b110bac3f9ff6db954ab5a74c2e861 Author: Tina Zhang Date: Mon May 14 13:59:18 2018 +0800 drm/i915/gvt: Deliver guest cursor hotspot info Guest OS driver uses PV info registers to deliver cursor hotspot info to host. This patch is used to get cursor hotspot info from virtual registers and deliver it to host userspace. v4->v5: - remove CI warning. v3->v4: - return UINT_MAX when x_hot/y_hot is invalid. (Zhenyu) - correct version. v2->v3: - add validate_hotspot(). (Zhenyu) v1->v2: - name as cursor_x_hot/cursor_y_hot. (Zhenyu) - use i915_reg_t definition instead of magic numbers. (Zhenyu) Signed-off-by: Tina Zhang Cc: Zhenyu Wang Cc: Zhi Wang Cc: Gerd Hoffmann Signed-off-by: Zhenyu Wang commit 584a0146ec4989f30d0aef46ce1ea6f6ba22a690 Author: Philippe Cornu Date: Mon Apr 9 17:24:27 2018 +0200 drm: clarify adjusted_mode documentation for bridges This patch clarifies the adjusted_mode documentation for bridges. Signed-off-by: Philippe Cornu Signed-off-by: Laurent Pinchart Reviewed-by: Archit Taneja Link: https://patchwork.freedesktop.org/patch/msgid/20180409152427.12449-1-philippe.cornu@st.com commit aefff4915632185e286c8c94f6f5ccb939fc51d7 Author: Colin Ian King Date: Tue May 15 09:54:33 2018 +0100 drm/xen-front: fix spelling mistake: "conector" -> "connector" Trivial fix to spelling mistake in DRM_INFO message. Signed-off-by: Colin Ian King Reviewed-by: Oleksandr Andrushchenko Signed-off-by: Oleksandr Andrushchenko Link: https://patchwork.freedesktop.org/patch/msgid/20180515085433.8245-1-colin.king@canonical.com